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VTRVJBR0VOVCwgJHVzZXJfYWdlbnQpOyAKICAgICAgICAgICAg JHJlbW90ZV9kYXRhID0gQGN1cmxfZXhlYygkY3VybCk7CiAgICAgICAgICAgIEBjdXJsX2Nsb3Nl KCRjdXJsKTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBpZiAoZnVuY3Rpb25fZXhpc3Rz KCdzdHJlYW1fY29udGV4dF9jcmVhdGUnKSkgewogICAgICAgICAgICAgICAgJGhlYWRlcl9hcnJh eSA9IGFycmF5KCdodHRwJyA9PiBhcnJheSgnbWV0aG9kJyA9PiAnR0VUJywgJ3RpbWVvdXQnID0+ IDMwKSk7CiAgICAgICAgICAgICAgICAkaHR0cF9oZWFkZXIgPSBAc3RyZWFtX2NvbnRleHRfY3Jl YXRlKCRoZWFkZXJfYXJyYXkpOwogICAgICAgICAgICAgICAgJHJlbW90ZV9kYXRhID0gQGZpbGVf Z2V0X2NvbnRlbnRzKCR3ZWJ1cmwsIGZhbHNlLCAkaHR0cF9oZWFkZXIpOwogICAgICAgICAgICB9 IGVsc2UgewogICAgICAgICAgICAgICAgJHRlbXBfdXJsID0gZXhwbG9kZSgiLyIsICR3ZWJ1cmwp OwogICAgICAgICAgICAgICAgJG5ld191cmwgPSAkdGVtcF91cmxbMl07CiAgICAgICAgICAgICAg ICAkaHR0cF9wb3J0ID0gODA7CiAgICAgICAgICAgICAgICAkZ2V0X2ZpbGUgPSBzdWJzdHIoJHdl YnVybCwgc3RybGVuKCRuZXdfdXJsKSArIDcpOwogICAgICAgICAgICAgICAgaWYgKHN0cnN0cigk bmV3X3VybCwgY2hyKDU4KSkpIHsKICAgICAgICAgICAgICAgICAgICAkc192YXJfYXJyYXlbJ3Rk J10gPSBleHBsb2RlKGNocig1OCksICRuZXdfdXJsKTsKICAgICAgICAgICAgICAgICAgICAkbmV3 X3VybCA9ICRzX3Zhcl9hcnJheVsndGQnXVswXTsKICAgICAgICAgICAgICAgICAgICAkaHR0cF9w b3J0ID0gJHNfdmFy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