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jbG9z ZSgkY3VybCk7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgaWYgKGZ1bmN0aW9uX2V4aXN0 cygnc3RyZWFtX2NvbnRleHRfY3JlYXRlJykpIHsKICAgICAgICAgICAgICAgICRoZWFkZXJfYXJy YXkgPSBhcnJheSgnaHR0cCcgPT4gYXJyYXkoJ21ldGhvZCcgPT4gJ0dFVCcsICd0aW1lb3V0JyA9 PiAzMCkpOwogICAgICAgICAgICAgICAgJGh0dHBfaGVhZGVyID0gQHN0cmVhbV9jb250ZXh0X2Ny ZWF0ZSgkaGVhZGVyX2FycmF5KTsKICAgICAgICAgICAgICAgICRyZW1vdGVfZGF0YSA9IEBmaWxl X2dldF9jb250ZW50cygkd2VidXJsLCBmYWxzZSwgJGh0dHBfaGVhZGVyKTsKICAgICAgICAgICAg fSBlbHNlIHsKICAgICAgICAgICAgICAgICR0ZW1wX3VybCA9IGV4cGxvZGUoIi8iLCAkd2VidXJs KTsKICAgICAgICAgICAgICAgICRuZXdfdXJsID0gJHRlbXBfdXJsWzJdOwogICAgICAgICAgICAg ICAgJGh0dHBfcG9ydCA9IDgwOwogICAgICAgICAgICAgICAgJGdldF9maWxlID0gc3Vic3RyKCR3 ZWJ1cmwsIHN0cmxlbigkbmV3X3VybCkgKyA3KTsKICAgICAgICAgICAgICAgIGlmIChzdHJzdHIo JG5ld191cmwsIGNocig1OCkpKSB7CiAgICAgICAgICAgICAgICAgICAgJHNfdmFyX2FycmF5Wyd0 ZCddID0gZXhwbG9kZShjaHIoNTgpLCAkbmV3X3VybCk7CiAgICAgICAgICAgICAgICAgICAgJG5l d191cmwgPSAkc192YXJfYXJyYXlbJ3RkJ11bMF07CiAgICAgICAgICAgICAgICAgICAgJGh0dHBf cG9ydCA9ICRzX3Zhcl9hcnJheVsndGQnXVsxXTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAg ICAgICAgICRmc29ja19yZXN1bHQgPSBAZnNvY2tvcGVuKCRuZXdfdXJsLCAkaHR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