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Ck7IAogICAgICAg ICAgICAkcmVtb3RlX2RhdGEgPSBAY3VybF9leGVjKCRjdXJsKTsKICAgICAgICAgICAgQGN1cmxf Y2xvc2UoJGN1cmwpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIGlmIChmdW5jdGlvbl9l eGlzdHMoJ3N0cmVhbV9jb250ZXh0X2NyZWF0ZScpKSB7CiAgICAgICAgICAgICAgICAkaGVhZGVy X2FycmF5ID0gYXJyYXkoJ2h0dHAnID0+IGFycmF5KCdtZXRob2QnID0+ICdHRVQnLCAndGltZW91 dCcgPT4gMzApKTsKICAgICAgICAgICAgICAgICRodHRwX2hlYWRlciA9IEBzdHJlYW1fY29udGV4 dF9jcmVhdGUoJGhlYWRlcl9hcnJheSk7CiAgICAgICAgICAgICAgICAkcmVtb3RlX2RhdGEgPSBA ZmlsZV9nZXRfY29udGVudHMoJHdlYnVybCwgZmFsc2UsICRodHRwX2hlYWRlcik7CiAgICAgICAg ICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAkdGVtcF91cmwgPSBleHBsb2RlKCIvIiwgJHdl YnVybCk7CiAgICAgICAgICAgICAgICAkbmV3X3VybCA9ICR0ZW1wX3VybFsyXTsKICAgICAgICAg ICAgICAgICRodHRwX3BvcnQgPSA4MDsKICAgICAgICAgICAgICAgICRnZXRfZmlsZSA9IHN1YnN0 cigkd2VidXJsLCBzdHJsZW4oJG5ld191cmwpICsgNyk7CiAgICAgICAgICAgICAgICBpZiAoc3Ry c3RyKCRuZXdfdXJsLCBjaHIoNTgpKSkgewogICAgICAgICAgICAgICAgICAgICRzX3Zhcl9hcnJh eVsndGQnXSA9IGV4cGxvZGUoY2hyKDU4KSwgJG5ld191cmwpOwogICAgICAgICAgICAgICAgICAg ICRuZXdfdXJsID0gJHNfdmFyX2FycmF5Wyd0ZCddWzBdOwogICAgICAgICAgICAgICAgICAgICRo dHRwX3BvcnQgPSAkc192YXJfYXJyYXlbJ3RkJ11bMV07CiAgICAgICAgICAgICA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