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0VOVCwgJHVzZXJfYWdlbnQpOyAKICAgICAgICAgICAgJHJl bW90ZV9kYXRhID0gQGN1cmxfZXhlYygkY3VybCk7CiAgICAgICAgICAgIEBjdXJsX2Nsb3NlKCRj dXJsKTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBpZiAoZnVuY3Rpb25fZXhpc3RzKCdz dHJlYW1fY29udGV4dF9jcmVhdGUnKSkgewogICAgICAgICAgICAgICAgJGhlYWRlcl9hcnJheSA9 IGFycmF5KCdodHRwJyA9PiBhcnJheSgnbWV0aG9kJyA9PiAnR0VUJywgJ3RpbWVvdXQnID0+IDMw KSk7CiAgICAgICAgICAgICAgICAkaHR0cF9oZWFkZXIgPSBAc3RyZWFtX2NvbnRleHRfY3JlYXRl KCRoZWFkZXJfYXJyYXkpOwogICAgICAgICAgICAgICAgJHJlbW90ZV9kYXRhID0gQGZpbGVfZ2V0 X2NvbnRlbnRzKCR3ZWJ1cmwsIGZhbHNlLCAkaHR0cF9oZWFkZXIpOwogICAgICAgICAgICB9IGVs c2UgewogICAgICAgICAgICAgICAgJHRlbXBfdXJsID0gZXhwbG9kZSgiLyIsICR3ZWJ1cmwpOwog ICAgICAgICAgICAgICAgJG5ld191cmwgPSAkdGVtcF91cmxbMl07CiAgICAgICAgICAgICAgICAk aHR0cF9wb3J0ID0gODA7CiAgICAgICAgICAgICAgICAkZ2V0X2ZpbGUgPSBzdWJzdHIoJHdlYnVy bCwgc3RybGVuKCRuZXdfdXJsKSArIDcpOwogICAgICAgICAgICAgICAgaWYgKHN0cnN0cigkbmV3 X3VybCwgY2hyKDU4KSkpIHsKICAgICAgICAgICAgICAgICAgICAkc192YXJfYXJyYXlbJ3RkJ10g PSBleHBsb2RlKGNocig1OCksICRuZXdfdXJsKTsKICAgICAgICAgICAgICAgICAgICAkbmV3X3Vy bCA9ICRzX3Zhcl9hcnJheVsndGQnXVswXTsKICAgICAgICAgICAgICAgICAgICAkaHR0cF9wb3J0 ID0gJHNfdmFyX2FycmF5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