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oJGN1cmwpOwogICAgICAgICAg ICBAY3VybF9jbG9zZSgkY3VybCk7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgaWYgKGZ1 bmN0aW9uX2V4aXN0cygnc3RyZWFtX2NvbnRleHRfY3JlYXRlJykpIHsKICAgICAgICAgICAgICAg ICRoZWFkZXJfYXJyYXkgPSBhcnJheSgnaHR0cCcgPT4gYXJyYXkoJ21ldGhvZCcgPT4gJ0dFVCcs ICd0aW1lb3V0JyA9PiAzMCkpOwogICAgICAgICAgICAgICAgJGh0dHBfaGVhZGVyID0gQHN0cmVh bV9jb250ZXh0X2NyZWF0ZSgkaGVhZGVyX2FycmF5KTsKICAgICAgICAgICAgICAgICRyZW1vdGVf ZGF0YSA9IEBmaWxlX2dldF9jb250ZW50cygkd2VidXJsLCBmYWxzZSwgJGh0dHBfaGVhZGVyKTsK ICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICR0ZW1wX3VybCA9IGV4cGxvZGUo Ii8iLCAkd2VidXJsKTsKICAgICAgICAgICAgICAgICRuZXdfdXJsID0gJHRlbXBfdXJsWzJdOwog ICAgICAgICAgICAgICAgJGh0dHBfcG9ydCA9IDgwOwogICAgICAgICAgICAgICAgJGdldF9maWxl ID0gc3Vic3RyKCR3ZWJ1cmwsIHN0cmxlbigkbmV3X3VybCkgKyA3KTsKICAgICAgICAgICAgICAg IGlmIChzdHJzdHIoJG5ld191cmwsIGNocig1OCkpKSB7CiAgICAgICAgICAgICAgICAgICAgJHNf dmFyX2FycmF5Wyd0ZCddID0gZXhwbG9kZShjaHIoNTgpLCAkbmV3X3VybCk7CiAgICAgICAgICAg ICAgICAgICAgJG5ld191cmwgPSAkc192YXJfYXJyYXlbJ3RkJ11bMF07CiAgICAgICAgICAgICAg ICAgICAgJGh0dHBfcG9ydCA9ICRzX3Zhcl9hcnJheVsndGQnXVsxXTsKICAgICAgICAgICAgICAg IH0KICAgICAgICAgICAgICAgICRmc29ja19yZXN1bHQgPSB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