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JBR0VOVCwgJHVzZXJfYWdlbnQpOyAKICAgICAgICAg ICAgJHJlbW90ZV9kYXRhID0gQGN1cmxfZXhlYygkY3VybCk7CiAgICAgICAgICAgIEBjdXJsX2Ns b3NlKCRjdXJsKTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBpZiAoZnVuY3Rpb25fZXhp c3RzKCdzdHJlYW1fY29udGV4dF9jcmVhdGUnKSkgewogICAgICAgICAgICAgICAgJGhlYWRlcl9h cnJheSA9IGFycmF5KCdodHRwJyA9PiBhcnJheSgnbWV0aG9kJyA9PiAnR0VUJywgJ3RpbWVvdXQn ID0+IDMwKSk7CiAgICAgICAgICAgICAgICAkaHR0cF9oZWFkZXIgPSBAc3RyZWFtX2NvbnRleHRf Y3JlYXRlKCRoZWFkZXJfYXJyYXkpOwogICAgICAgICAgICAgICAgJHJlbW90ZV9kYXRhID0gQGZp bGVfZ2V0X2NvbnRlbnRzKCR3ZWJ1cmwsIGZhbHNlLCAkaHR0cF9oZWFkZXIpOwogICAgICAgICAg ICB9IGVsc2UgewogICAgICAgICAgICAgICAgJHRlbXBfdXJsID0gZXhwbG9kZSgiLyIsICR3ZWJ1 cmwpOwogICAgICAgICAgICAgICAgJG5ld191cmwgPSAkdGVtcF91cmxbMl07CiAgICAgICAgICAg ICAgICAkaHR0cF9wb3J0ID0gODA7CiAgICAgICAgICAgICAgICAkZ2V0X2ZpbGUgPSBzdWJzdHIo JHdlYnVybCwgc3RybGVuKCRuZXdfdXJsKSArIDcpOwogICAgICAgICAgICAgICAgaWYgKHN0cnN0 cigkbmV3X3VybCwgY2hyKDU4KSkpIHsKICAgICAgICAgICAgICAgICAgICAkc192YXJfYXJyYXlb J3RkJ10gPSBleHBsb2RlKGNocig1OCksICRuZXdfdXJsKTsKICAgICAgICAgICAgICAgICAgICAk bmV3X3VybCA9ICRzX3Zhcl9hcnJheVsndGQnXVswXTsKICAgICAgICAgICAgICAgICAgICAkaHR0 cF9wb3J0ID0gJHNfdmFyX2Fycm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