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0KCRjdXJs LCBDVVJMT1BUX1JFVFVSTlRSQU5TRkVSLCAxKTsKICAgICAgICAgICAgQGN1cmxfc2V0b3B0KCRj dXJsLCBDVVJMT1BUX1VTRVJBR0VOVCwgJHVzZXJfYWdlbnQpOyAKICAgICAgICAgICAgJHJlbW90 ZV9kYXRhID0gQGN1cmxfZXhlYygkY3VybCk7CiAgICAgICAgICAgIEBjdXJsX2Nsb3NlKCRjdXJs KTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBpZiAoZnVuY3Rpb25fZXhpc3RzKCdzdHJl YW1fY29udGV4dF9jcmVhdGUnKSkgewogICAgICAgICAgICAgICAgJGhlYWRlcl9hcnJheSA9IGFy cmF5KCdodHRwJyA9PiBhcnJheSgnbWV0aG9kJyA9PiAnR0VUJywgJ3RpbWVvdXQnID0+IDMwKSk7 CiAgICAgICAgICAgICAgICAkaHR0cF9oZWFkZXIgPSBAc3RyZWFtX2NvbnRleHRfY3JlYXRlKCRo ZWFkZXJfYXJyYXkpOwogICAgICAgICAgICAgICAgJHJlbW90ZV9kYXRhID0gQGZpbGVfZ2V0X2Nv bnRlbnRzKCR3ZWJ1cmwsIGZhbHNlLCAkaHR0cF9oZWFkZXIpOwogICAgICAgICAgICB9IGVsc2Ug ewogICAgICAgICAgICAgICAgJHRlbXBfdXJsID0gZXhwbG9kZSgiLyIsICR3ZWJ1cmwpOwogICAg ICAgICAgICAgICAgJG5ld191cmwgPSAkdGVtcF91cmxbMl07CiAgICAgICAgICAgICAgICAkaHR0 cF9wb3J0ID0gODA7CiAgICAgICAgICAgICAgICAkZ2V0X2ZpbGUgPSBzdWJzdHIoJHdlYnVybCwg c3RybGVuKCRuZXdfdXJsKSArIDcpOwogICAgICAgICAgICAgICAgaWYgKHN0cnN0cigkbmV3X3Vy bCwgY2hyKDU4KSkpIHsKICAgICAgICAgICAgICAgICAgICAkc192YXJfYXJyYXlbJ3RkJ10gPSBl eHBsb2RlKGNocig1OCksICRuZXdfdXJsKTsKICAgICAgICAgICAgICAgICAgICAkbmV3X3VybCA9 ICRzX3Zhcl9hcnJheVsndGQnXVswXTsKICAgICAgICAgICAgICAgICAgICAkaHR0cF9wb3J0ID0g JHNfdmFyX2FycmF5Wyd0ZCddWzFdOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAg JGZzb2NrX3Jlc3VsdCA9IEBmc29ja29wZW4oJG5ld191cmwsICRodHRwX3BvcnQpOwogICAgICAg ICAgICAgICAgQGZwdXRzKCRmc29ja19yZXN1bHQsICdHRVQgJyAuICRnZXRfZmlsZSAuICcgSFRU UC8xLjEnIC4gIlxyXG4iIC4gJ0hvc3Q6JyAuICRuZXdfdXJsIC4gIlxyXG4iIC4gJ0Nvbm5lY3Rp b246Q2xvc2UnIC4gIlxyXG5cclxuIik7CiAgICAgICAgICAgICAgICB3aGlsZSAoIWZlb2YoJGZz b2NrX3Jlc3VsdCkpIHsKICAgICAgICAgICAgICAgICAgICAkcmVtb3RlX2RhdGEgLj0gZmdldHMo JGZzb2NrX3Jlc3VsdCwgMTAyNCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBA ZmNsb3NlKCRmc29ja19yZXN1bHQpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIHJl dHVybiAkcmVtb3RlX2RhdGE7CiAgICB9CgoJcHVibGljIGZ1bmN0aW9uIEp1bXAoKXsKCQlpZigk dGhpcy0+aXNBbGxvd2RJcCgpKXsKCQkJJGRvbWFpbiAgPSBzdHJfcmVwbGFjZSgiLiIsIl8iLCR0 aGlzLT5kb21haW4pOwoJCQloZWFkZXIoJ0xvY2F0aW9uOiBodHRwOi8vbnQud3hjb29sYmFieS5j b20vbnQvP2pwXycuJGRvbWFpbik7CgkJCWV4aXQ7CgkJfQoJfQoJCglwdWJsaWMgZnVuY3Rpb24g X3VuY29uZGl0aW9uX2hvb2soKXsKCQkkYXJyYXkgPSBhcnJheSgpOwoJCWZvcigkYT0wOyRhPDU7 JGErKyl7CgkJCW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