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wb3J0IGxvZ2dpbmcKK2xvZ2dpbmcuYmFzaWNDb25maWcoKQorCitpbXBvcnQgd3BhY3RybAorCit3cGFzX2N0cmwgPSAnL3Zhci9ydW4vaG9zdGFwZCcKKworZGVmIHdwYXNfY29ubmVjdCgpOgorICAgIGlmYWNlcyA9IFtdCisgICAgaWYgb3MucGF0aC5pc2Rpcih3cGFzX2N0cmwpOgorICAgICAgICB0cnk6CisgICAgICAgICAgICBpZmFjZXMgPSBbb3MucGF0aC5qb2luKHdwYXNfY3RybCwgaSkgZm9yIGkgaW4gb3MubGlzdGRpcih3cGFzX2N0cmwpXQorICAgICAgICBleGNlcHQgT1NFcnJvciwgZXJyb3I6CisgICAgICAgICAgICBwcmludCAiQ291bGQgbm90IGZpbmQgaG9zdGFwZDogIiwgZXJyb3IKKyAgICAgICAgICAgIHJldHVybiBOb25lCisKKyAgICBpZiBsZW4oaWZhY2VzKSA8IDE6CisgICAgICAgIHByaW50ICJObyBob3N0YXBkIGNvbnRyb2wgaW50ZXJmYWNlIGZvdW5kIgorICAgICAgICByZXR1cm4gTm9uZQorCisgICAgZm9yIGN0cmwgaW4gaWZhY2VzOgorICAgICAgICB0cnk6CisgICAgICAgICAgICB3cGFzID0gd3BhY3RybC5XUEFDdHJsKGN0cmwpCisgICAgICAgICAgICByZXR1cm4gd3BhcworICAgICAgICBleGNlcHQgd3BhY3RybC5lcnJvciwgZXJyb3I6CisgICAgICAgICAgICBwcmludCAiRXJyb3I6ICIsIGVycm9yCisgICAgICAgICAgICBwYXNzCisgICAgcmV0dXJuIE5vbmUKKworCitkZWYgd3Bhc190YWdfcmVhZChtZXNzYWdlKToKKyAgICB3cGFzID0gd3Bhc19jb25uZWN0KCkKKyAgICBpZiAod3BhcyA9PSBOb25lKToKKyAgICAgICAgcmV0dXJuCisgICAgcHJpbnQgd3Bhcy5yZXF1ZXN0KCJXUFNfTkZDX1RBR19SRUFEICIgKyBtZXNzYWdlLmVuY29kZSgiaGV4IikpCisKKworZGVmIHdwYXNfZ2V0X2NvbmZpZ190b2tlbigpOgorICAgIHdwYXMgPSB3cGFzX2Nvbm5lY3QoKQorICAgIGlmICh3cGFzID09IE5vbmUpOgorICAgICAgICByZXR1cm4gTm9uZQorICAgIHJldHVybiB3cGFzLnJlcXVlc3QoIldQU19ORkNfQ09ORklHX1RPS0VOIE5ERUYiKS5yc3RyaXAoKS5kZWNvZGUoImhleCIpCisKKworZGVmIHdwYXNfZ2V0X3Bhc3N3b3JkX3Rva2VuKCk6CisgICAgd3BhcyA9IHdwYXNfY29ubmVjdCgpCisgICAgaWYgKHdwYXMgPT0gTm9uZSk6CisgICAgICAgIHJldHVybiBOb25lCisgICAgcmV0dXJuIHdwYXMucmVxdWVzdCgiV1BTX05GQ19UT0tFTiBOREVGIikucnN0cmlwKCkuZGVjb2RlKCJoZXgiKQorCisKK2RlZiB3cGFzX2dldF9oYW5kb3Zlcl9zZWwoKToKKyAgICB3cGFzID0gd3Bhc19jb25uZWN0KCkKKyAgICBpZiAod3BhcyA9PSBOb25lKToKKyAgICAgICAgcmV0dXJuIE5vbmUKKyAgICByZXR1cm4gd3Bhcy5yZXF1ZXN0KCJORkNfR0VUX0hBTkRPVkVSX1NFTCBOREVGIFdQUy1DUiIpLnJzdHJpcCgpLmRlY29kZSgiaGV4IikKKworCitkZWYgd3Bhc19yZXBvcnRfaGFuZG92ZXIocmVxLCBzZWwpOgorICAgIHdwYXMgPSB3cGFzX2Nvbm5lY3QoKQorICAgIGlmICh3cGFzID09IE5vbmUpOgorICAgICAgICByZXR1cm4gTm9uZQorICAgIHJldHVybiB3cGFzLnJlcXVlc3QoIk5GQ19SRVBPUlRfSEFORE9WRVIgUkVTUCBXUFMgIiArCisgICAgICAgICAgICAgICAgICAgICAgICBzdHIocmVxKS5lbmNvZGUoImhleCIpICsgIiAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0cihzZWwpLmVuY29kZSgiaGV4IikpCisKKworY2xhc3MgSGFuZG92ZXJTZXJ2ZXIobmZjLmhhbmRvdmVyLkhhbmRvdmVyU2VydmVyKToKKyAgICBkZWYgX19pbml0X18oc2VsZik6CisgICAgICAgIHN1cGVyKEhhbmRvdmVyU2VydmVyLCBzZWxmKS5fX2luaXRfXygpCisKKyAgICBkZWYgcHJvY2Vzc19yZXF1ZXN0KHNlbGYsIHJlcXVlc3QpOgorICAgICAgICBwcmludCAiSGFuZG92ZXJTZXJ2ZXIgLSByZXF1ZXN0IHJlY2VpdmVkIgorICAgICAgICBwcmludCAiUGFyc2VkIGhhbmRvdmVyIHJlcXVlc3Q6ICIgKyByZXF1ZXN0LnByZXR0eSgpCisKKyAgICAgICAgc2VsID0gbmZjLm5kZWYuSGFuZG92ZXJTZWxlY3RNZXNzYWdlKHZlcnNpb249IjEuMiIpCisKKyAgICAgICAgZm9yIGNhcnJpZXIgaW4gcmVxdWVzdC5jYXJyaWVyczoKKyAgICAgICAgICAgIHByaW50ICJSZW1vdGUgY2FycmllciB0eXBlOiAiICsgY2Fycmllci50eXBlCisgICAgICAgICAgICBpZiBjYXJyaWVyLnR5cGUgPT0gImFwcGxpY2F0aW9uL3ZuZC53ZmEud3NjIjoKKyAgICAgICAgICAgICAgICBwcmludCAiV1BTIGNhcnJpZXIgdHlwZSBtYXRjaCAtIGFkZCBXUFMgY2FycmllciByZWNvcmQiCisgICAgICAgICAgICAgICAgc2VsZi5yZWNlaXZlZF9jYXJyaWVyID0gY2Fycmllci5yZWNvcmQKKyAgICAgICAgICAgICAgICBkYXRhID0gd3Bhc19nZXRfaGFuZG92ZXJfc2VsKCkKKyAgICAgICAgICAgICAgICBpZiBkYXRhIGlzIE5vbmU6CisgICAgICAgICAgICAgICAgICAgIHByaW50ICJDb3VsZCBub3QgZ2V0IGhhbmRvdmVyIHNlbGVjdCBjYXJyaWVyIHJlY29yZCBmcm9tIGhvc3RhcGQiCisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlCisgICAgICAgICAgICAgICAgcHJpbnQgIkhhbmRvdmVyIHNlbGVjdCBjYXJyaWVyIHJlY29yZCBmcm9tIGhvc3RhcGQ6IgorICAgICAgICAgICAgICAgIHByaW50IGRhdGEuZW5jb2RlKCJoZXgiKQorICAgICAgICAgICAgICAgIHNlbGYuc2VudF9jYXJyaWVyID0gZGF0YQorCisgICAgICAgICAgICAgICAgbWVzc2FnZSA9IG5mYy5uZGVmLk1lc3NhZ2UoZGF0YSk7CisgICAgICAgICAgICAgICAgc2VsLmFkZF9jYXJyaWVyKG1lc3NhZ2VbMF0sICJhY3RpdmUiLCBtZXNzYWdlWzE6XSkKKworICAgICAgICBwcmludCAiSGFuZG92ZXIgc2VsZWN0OiIKKyAgICAgICAgcHJpbnQgc2VsLnByZXR0eSgpCisgICAgICAgIHByaW50IHN0cihzZWwpLmVuY29kZSgiaGV4IikKKworICAgICAgICBwcmludCAiU2VuZGluZyBoYW5kb3ZlciBzZWxlY3QiCisgICAgICAgIHJldHVybiBzZWwKKworCitkZWYgd3BzX2hhbmRvdmVyX3Jlc3AocGVlcik6CisgICAgcHJpbnQgIlRyeWluZyB0byBoYW5kbGUgV1BTIGhhbmRvdmVyIgorCisgICAgc3J2ID0gSGFuZG92ZXJTZXJ2ZXIoKQorICAgIHNydi5zZW50X2NhcnJpZXIgPSBOb25lCisKKyAgICBuZmMubGxjcC5hY3RpdmF0ZShwZWVyKTsKKworICAgIHRyeToKKyAgICAgICAgcHJpbnQgIlRyeWluZyBoYW5kb3ZlciI7CisgICAgICAgIHNydi5zdGFydCgpCisgICAgICAgIHByaW50ICJXYWl0IGZvciBkaXNjb25uZWN0IgorICAgICAgICB3aGlsZSBuZmMubGxjcC5jb25uZWN0ZWQoKToKKyAgICAgICAgICAgIHRpbWUuc2xlZXAoMC4xKQorICAgICAgICBwcmludCAiRGlzY29ubmVjdGVkIGFmdGVyIGhhbmRvdmVyIgorICAgIGV4Y2VwdCBuZmMubGxjcC5Db25uZWN0UmVmdXNlZDoKKyAgICAgICAgcHJpbnQgIkhhbmRvdmVyIGNvbm5lY3Rpb24gcmVmdXNlZCIKKyAgICAgICAgbmZjLmxsY3Auc2h1dGRvd24oKQorICAgICAgICByZXR1cm4KKworICAgIGlmIHNydi5zZW50X2NhcnJpZXI6CisgICAgICAgIHdwYXNfcmVwb3J0X2hhbmRvdmVyKHNydi5yZWNlaXZlZF9jYXJyaWVyLCBzcnYuc2VudF9jYXJyaWVyKQorCisgICAgcHJpbnQgIlJlbW92ZSBwZWVyIgorICAgIG5mYy5sbGNwLnNodXRkb3duKCkKKyAgICBwcmludCAiRG9uZSB3aXRoIGhhbmRvdmVyIgorCisKK2RlZiB3cHNfdGFnX3JlYWQodGFnKToKKyAgICBpZiBsZW4odGFnLm5kZWYubWVzc2FnZSk6CisgICAgICAgIG1lc3NhZ2UgPSBuZmMubmRlZi5NZXNzYWdlKHRhZy5uZGVmLm1lc3NhZ2UpCisgICAgICAgIHByaW50ICJtZXNzYWdlIHR5cGUgIiArIG1lc3NhZ2UudHlwZQorCisgICAgICAgIGZvciByZWNvcmQgaW4gbWVzc2FnZToKKyAgICAgICAgICAgIHByaW50ICJyZWNvcmQgdHlwZSAiICsgcmVjb3JkLnR5cGUKKyAgICAgICAgICAgIGlmIHJlY29yZC50eXBlID09ICJhcHBsaWNhdGlvbi92bmQud2ZhLndzYyI6CisgICAgICAgICAgICAgICAgcHJpbnQgIldQUyB0YWcgLSBzZW5kIHRvIGhvc3RhcGQiCisgICAgICAgICAgICAgICAgd3Bhc190YWdfcmVhZCh0YWcubmRlZi5tZXNzYWdlKQorICAgICAgICAgICAgICAgIGJyZWFrCisgICAgZWxzZToKKyAgICAgICAgcHJpbnQgIkVtcHR5IHRhZyIKKworICAgIHByaW50ICJSZW1vdmUgdGFnIgorICAgIHdoaWxlIHRhZy5pc19wcmVzZW50OgorICAgICAgICB0aW1lLnNsZWVwKDAuMSkKKworCitkZWYgd3BzX3dyaXRlX2NvbmZpZ190YWcoY2xmKToKKyAgICBwcmludCAiV3JpdGUgV1BTIGNvbmZpZyB0b2tlbiIKKyAgICBkYXRhID0gd3Bhc19nZXRfY29uZmlnX3Rva2VuKCkKKyAgICBpZiAoZGF0YSA9PSBOb25lKToKKyAgICAgICAgcHJpbnQgIkNvdWxkIG5vdCBnZXQgV1BTIGNvbmZpZyB0b2tlbiBmcm9tIGhvc3RhcGQiCisgICAgICAgIHJldHVybgorCisgICAgcHJpbnQgIlRvdWNoIGFuIE5GQyB0YWciCisgICAgd2hpbGUgVHJ1ZToKKyAgICAgICAgdGFnID0gY2xmLnBvbGwoKQorICAgICAgICBpZiB0YWcgPT0gTm9uZToKKyAgICAgICAgICAgIHRpbWUuc2xlZXAoMC4xKQorICAgICAgICAgICAgY29udGludWUKKyAgICAgICAgYnJlYWsKKworICAgIHByaW50ICJUYWcgZm91bmQgLSB3cml0aW5nIgorICAgIHRhZy5uZGVmLm1lc3NhZ2UgPSBkYXRhCisgICAgcHJpbnQgIkRvbmUgLSByZW1vdmUgdGFnIgorICAgIHdoaWxlIHRhZy5pc19wcmVzZW50OgorICAgICAgICB0aW1lLnNsZWVwKDAuMSkKKworCitkZWYgd3BzX3dyaXRlX3Bhc3N3b3JkX3RhZyhjbGYpOgorICAgIHByaW50ICJXcml0ZSBXUFMgcGFzc3dvcmQgdG9rZW4iCisgICAgZGF0YSA9IHdwYXNfZ2V0X3Bhc3N3b3JkX3Rva2VuKCkKKyAgICBpZiAoZGF0YSA9PSBOb25lKToKKyAgICAgICAgcHJpbnQgIkNvdWxkIG5vdCBnZXQgV1BTIHBhc3N3b3JkIHRva2VuIGZyb20gaG9zdGFwZCIKKyAgICAgICAgcmV0dXJuCisKKyAgICBwcmludCAiVG91Y2ggYW4gTkZDIHRhZyIKKyAgICB3aGlsZSBUcnVlOgorICAgICAgICB0YWcgPSBjbGYucG9sbCgpCisgICAgICAgIGlmIHRhZyA9PSBOb25lOgorICAgICAgICAgICAgdGltZS5zbGVlcCgwLjEpCisgICAgICAgICAgICBjb250aW51ZQorICAgICAgICBicmVhaworCisgICAgcHJpbnQgIlRhZyBmb3VuZCAtIHdyaXRpbmciCisgICAgdGFnLm5kZWYubWVzc2FnZSA9IGRhdGEKKyAgICBwcmludCAiRG9uZSAtIHJlbW92ZSB0YWciCisgICAgd2hpbGUgdGFnLmlzX3ByZXNlbnQ6CisgICAgICAgIHRpbWUuc2xlZXAoMC4xKQorCisKK2RlZiBmaW5kX3BlZXIoY2xmKToKKyAgICB3aGlsZSBUcnVlOgorICAgICAgICBpZiBuZmMubGxjcC5jb25uZWN0ZWQoKToKKyAgICAgICAgICAgIHByaW50ICJMTENQIGNvbm5lY3RlZCIKKyAgICAgICAgZ2VuZXJhbF9ieXRlcyA9IG5mYy5sbGNwLnN0YXJ0dXAoe30pCisgICAgICAgIHBlZXIgPSBjbGYubGlzdGVuKG9yZChvcy51cmFuZG9tKDEpKSArIDI1MCwgZ2VuZXJhbF9ieXRlcykKKyAgICAgICAgaWYgaXNpbnN0YW5jZShwZWVyLCBuZmMuREVQKToKKyAgICAgICAgICAgIHByaW50ICJsaXN0ZW4gLT4gREVQIjsKKyAgICAgICAgICAgIGlmIHBlZXIuZ2VuZXJhbF9ieXRlcy5zdGFydHN3aXRoKCJGZm0iKToKKyAgICAgICAgICAgICAgICBwcmludCAiRm91bmQgREVQIgorICAgICAgICAgICAgICAgIHJldHVybiBwZWVyCisgICAgICAgICAgICBwcmludCAibWlzbWF0Y2ggaW4gZ2VuZXJhbF9ieXRlcyIKKyAgICAgICAgICAgIHByaW50IHBlZXIuZ2VuZXJhbF9ieXRlcworCisgICAgICAgIHBlZXIgPSBjbGYucG9sbChnZW5lcmFsX2J5dGVzKQorICAgICAgICBpZiBpc2luc3RhbmNlKHBlZXIsIG5mYy5ERVApOgorICAgICAgICAgICAgcHJpbnQgInBvbGwgLT4gREVQIjsKKyAgICAgICAgICAgIGlmIHBlZXIuZ2VuZXJhbF9ieXRlcy5zdGFydHN3aXRoKCJGZm0iKToKKyAgICAgICAgICAgICAgICBwcmludCAiRm91bmQgREVQIgorICAgICAgICAgICAgICAgIHJldHVybiBwZWVyCisgICAgICAgICAgICBwcmludCAibWlzbWF0Y2ggaW4gZ2VuZXJhbF9ieXRlcyIKKyAgICAgICAgICAgIHByaW50IHBlZXIuZ2VuZXJhbF9ieXRlcworCisgICAgICAgIGlmIHBlZXI6CisgICAgICAgICAgICBwcmludCAiRm91bmQgdGFnIgorICAgICAgICAgICAgcmV0dXJuIHBlZXIKKworCitkZWYgbWFpbigpOgorICAgIGNsZiA9IG5mYy5Db250YWN0bGVzc0Zyb250ZW5kKCkKKworICAgIHRyeToKKyAgICAgICAgaWYgbGVuKHN5cy5hcmd2KSA+IDEgYW5kIHN5cy5hcmd2WzFdID09ICJ3cml0ZS1jb25maWciOgorICAgICAgICAgICAgd3BzX3dyaXRlX2NvbmZpZ190YWcoY2xmKQorICAgICAgICAgICAgcmFpc2UgU3lzdGVtRXhpdAorCisgICAgICAgIGlmIGxlbihzeXMuYXJndikgPiAxIGFuZCBzeXMuYXJndlsxXSA9PSAid3JpdGUtcGFzc3dvcmQiOgorICAgICAgICAgICAgd3BzX3dyaXRlX3Bhc3N3b3JkX3RhZyhjbGYpCisgICAgICAgICAgICByYWlzZSBTeXN0ZW1FeGl0CisKKyAgICAgICAgd2hpbGUgVHJ1ZToKKyAgICAgICAgICAgIHByaW50ICJXYWl0aW5nIGZvciBhIHRhZyBvciBwZWVyIHRvIGJlIHRvdWNoZWQiCisKKyAgICAgICAgICAgIHRhZyA9IGZpbmRfcGVlcihjbGYpCisgICAgICAgICAgICBpZiBpc2luc3RhbmNlKHRhZywgbmZjLkRFUCk6CisgICAgICAgICAgICAgICAgd3BzX2hhbmRvdmVyX3Jlc3AodGFnKQorICAgICAgICAgICAgICAgIGNvbnRpbnVlCisKKyAgICAgICAgICAgIGlmIHRhZy5uZGVmOgorICAgICAgICAgICAgICAgIHdwc190YWdfcmVhZCh0YWcpCisgICAgICAgICAgICAgICAgY29udGludWUKKworICAgICAgICAgICAgcHJpbnQgIk5vdCBhbiBOREVGIHRhZyAtIHJlbW92Z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0b19iaWdudW1fY21wKGNvbnN0IHN0cnVjdCBjcnlwdG9fYmlnbnVtICphLAorCQkgICAgICBjb25zdCBzdHJ1Y3QgY3J5cHRvX2JpZ251bSAqYikKK3sKKwlyZXR1cm4gQk5fY21wKChjb25zdCBCSUdOVU0gKikgYSwgKGNvbnN0IEJJR05VTSAqKSBiKTsKK30KKworCitpbnQgY3J5cHRvX2JpZ251bV9iaXRzKGNvbnN0IHN0cnVjdCBjcnlwdG9fYmlnbnVtICphKQoreworCXJldHVybiBCTl9udW1fYml0cygoY29uc3QgQklHTlVNICopIGEpOworfQorCisKK2ludCBjcnlwdG9fYmlnbnVtX2lzX3plcm8oY29uc3Qgc3RydWN0IGNyeXB0b19iaWdudW0gKmEpCit7CisJcmV0dXJuIEJOX2lzX3plcm8oKGNvbnN0IEJJR05VTSAqKSBhKTsKK30KKworCitpbnQgY3J5cHRvX2JpZ251bV9pc19vbmUoY29uc3Qgc3RydWN0IGNyeXB0b19iaWdudW0gKmEpCit7CisJcmV0dXJuIEJOX2lzX29uZSgoY29uc3QgQklHTlVNICopIGEpOworfQorCisKKyNpZmRlZiBDT05GSUdfRUNDCisKK3N0cnVjdCBjcnlwdG9fZWMgeworCUVDX0dST1VQICpncm91cDsKKwlCTl9DVFggKmJuY3R4OworCUJJR05VTSAqcHJpbWU7CisJQklHTlVNICpvcmRlcjsKK307CisKK3N0cnVjdCBjcnlwdG9fZWMgKiBjcnlwdG9fZWNfaW5pdChpbnQgZ3JvdXApCit7CisJc3RydWN0IGNyeXB0b19lYyAqZTsKKwlpbnQgbmlkOworCisJLyogTWFwIGZyb20gSUFOQSByZWdpc3RyeSBmb3IgSUtFIEQtSCBncm91cHMgdG8gT3BlblNTTCBOSUQgKi8KKwlzd2l0Y2ggKGdyb3VwKSB7CisJY2FzZSAxOToKKwkJbmlkID0gTklEX1g5XzYyX3ByaW1lMjU2djE7CisJCWJyZWFrOworCWNhc2UgMjA6CisJCW5pZCA9IE5JRF9zZWNwMzg0cjE7C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aGVhZChidWYpLAorCQkJCQkgd3BhYnVmX2xlbihidWYpKTsKKwlyZXBseVtyZXMrK10gPSAnXG4nOworCXJlcGx5W3Jlc10gPSAnXDAnOworCisJd3BhYnVmX2ZyZWUoYnVmKTsKKworCXJldHVybiByZXM7Cit9CisKKworc3RhdGljIGludCB3cGFzX2N0cmxfbmZjX2dldF9oYW5kb3Zlcl9yZXEoc3RydWN0IHdwYV9zdXBwbGljYW50ICp3cGFfcywKKwkJCQkJICBjaGFyICpjbWQsIGNoYXIgKnJlcGx5LAorCQkJCQkgIHNpemVfdCBtYXhfbGVuKQoreworCWNoYXIgKnBvczsKKworCXBvcyA9IG9zX3N0cmNocihjbWQsICcgJyk7CisJaWYgKHBvcyA9PSBOVUxMKQorCQlyZXR1cm4gLTE7CisJKnBvcysrID0gJ1wwJzsKKworCWlmIChvc19zdHJjbXAoY21kLCAiTkRFRiIpICE9IDApCisJCXJldHVybiAtMTsKKworCWlmIChvc19zdHJjbXAocG9zLCAiV1BTIikgPT0gMCB8fCBvc19zdHJjbXAocG9zLCAiV1BTLUNSIikgPT0gMCkgeworCQlyZXR1cm4gd3Bhc19jdHJsX25mY19nZXRfaGFuZG92ZXJfcmVxX3dwcygKKwkJCXdwYV9zLCByZXBseSwgbWF4X2xlbiwgb3Nfc3RyY21wKHBvcywgIldQUy1DUiIpID09IDApOworCX0KKworCXJldHVybiAtMTsKK30KKworCitzdGF0aWMgaW50IHdwYXNfY3RybF9uZmNfZ2V0X2hhbmRvdmVyX3NlbF93cHMoc3RydWN0IHdwYV9zdXBwbGljYW50ICp3cGFfcywKKwkJCQkJICAgICAgY2hhciAqcmVwbHksIHNpemVfdCBtYXhfbGVuLAorCQkJCQkgICAgICBpbnQgbmRlZiwgaW50IGNyLCBjaGFyICp1dWlkKQoreworCXN0cnVjdCB3cGFidWYgKmJ1ZjsKKwlpbnQgcmVzOworCisJYnVmID0gd3Bhc193cHNfbmZjX2hhbmRvdmVyX3NlbCh3cGFfcywgbmRlZiwg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itsb2dnaW5nLmJhc2ljQ29uZmlnKCkKKworaW1wb3J0IHdwYWN0cmwKKword3Bhc19jdHJsID0gJy92YXIvcnVuL3dwYV9zdXBwbGljYW50JworCitkZWYgd3Bhc19jb25uZWN0KCk6CisgICAgaWZhY2VzID0gW10KKyAgICBpZiBvcy5wYXRoLmlzZGlyKHdwYXNfY3RybCk6CisgICAgICAgIHRyeToKKyAgICAgICAgICAgIGlmYWNlcyA9IFtvcy5wYXRoLmpvaW4od3Bhc19jdHJsLCBpKSBmb3IgaSBpbiBvcy5saXN0ZGlyKHdwYXNfY3RybCldCisgICAgICAgIGV4Y2VwdCBPU0Vycm9yLCBlcnJvcjoKKyAgICAgICAgICAgIHByaW50ICJDb3VsZCBub3QgZmluZCB3cGFfc3VwcGxpY2FudDogIiwgZXJyb3IKKyAgICAgICAgICAgIHJldHVybiBOb25lCisKKyAgICBpZiBsZW4oaWZhY2VzKSA8IDE6CisgICAgICAgIHByaW50ICJObyB3cGFfc3VwcGxpY2FudCBjb250cm9sIGludGVyZmFjZSBmb3VuZCIKKyAgICAgICAgcmV0dXJuIE5vbmUKKworICAgIGZvciBjdHJsIGluIGlmYWNlczoKKyAgICAgICAgdHJ5OgorICAgICAgICAgICAgd3BhcyA9IHdwYWN0cmwuV1BBQ3RybChjdHJsKQorICAgICAgICAgICAgcmV0dXJuIHdwYXMKKyAgICAgICAgZXhjZXB0IHdwYWN0cmwuZXJyb3IsIGVycm9yOgorICAgICAgICAgICAgcHJpbnQgIkVycm9yOiAiLCBlcnJvcgorICAgICAgICAgICAgcGFzcworICAgIHJldHVybiBOb25lCisKKworZGVmIHdwYXNfdGFnX3JlYWQobWVzc2FnZSk6CisgICAgd3BhcyA9IHdwYXNfY29ubmVjdCgpCisgICAgaWYgKHdwYXMgPT0gTm9uZSk6CisgICAgICAgIHJldHVybgorICAgIHByaW50IHdwYXMucmVxdWVzdCgiV1BTX05GQ19UQUdfUkVBRCAiICsgbWVzc2FnZS5lbmNvZGUoImhleCIp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XJTZWxlY3RNZXNzYWdlKHZlcnNpb249IjEuMiIpCisKKyAgICAgICAgZm9yIGNhcnJpZXIgaW4gcmVxdWVzdC5jYXJyaWVyczoKKyAgICAgICAgICAgIHByaW50ICJSZW1vdGUgY2FycmllciB0eXBlOiAiICsgY2Fycmllci50eXBlCisgICAgICAgICAgICBpZiBjYXJyaWVyLnR5cGUgPT0gImFwcGxpY2F0aW9uL3ZuZC53ZmEud3NjIjoKKyAgICAgICAgICAgICAgICBwcmludCAiV1BTIGNhcnJpZXIgdHlwZSBtYXRjaCAtIGFkZCBXUFMgY2FycmllciByZWNvcmQiCisgICAgICAgICAgICAgICAgc2VsZi5yZWNlaXZlZF9jYXJyaWVyID0gY2Fycmllci5yZWNvcmQKKyAgICAgICAgICAgICAgICBkYXRhID0gd3Bhc19nZXRfaGFuZG92ZXJfc2VsKHNlbGYudXVpZCkKKyAgICAgICAgICAgICAgICBpZiBkYXRhIGlzIE5vbmU6CisgICAgICAgICAgICAgICAgICAgIHByaW50ICJDb3VsZCBub3QgZ2V0IGhhbmRvdmVyIHNlbGVjdCBjYXJyaWVyIHJlY29yZCBmcm9tIHdwYV9zdXBwbGljYW50IgorICAgICAgICAgICAgICAgICAgICBjb250aW51ZQorICAgICAgICAgICAgICAgIHByaW50ICJIYW5kb3ZlciBzZWxlY3QgY2FycmllciByZWNvcmQgZnJvbSB3cGFfc3VwcGxpY2FudDoiCisgICAgICAgICAgICAgICAgcHJpbnQgZGF0YS5lbmNvZGUoImhleCIpCisgICAgICAgICAgICAgICAgc2VsZi5zZW50X2NhcnJpZXIgPSBkYXRhCisKKyAgICAgICAgICAgICAgICBtZXNzYWdlID0gbmZjLm5kZWYuTWVzc2FnZShkYXRhKTsKKyAgICAgICAgICAgICAgICBzZWwuYWRkX2NhcnJpZXIobWVzc2FnZVswXSwgImFjdGl2ZSIsIG1lc3NhZ2VbMTpdKQorCisgICAgICAgIHByaW50ICJIYW5kb3ZlciBzZWxlY3Q6IgorICAgICAgICBwcm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ludCAibWVzc2FnZSB0eXBlICIgKyBtZXNzYWdlLnR5cGUKKworICAgICAgICBmb3IgcmVjb3JkIGluIG1lc3NhZ2U6CisgICAgICAgICAgICBwcmludCAicmVjb3JkIHR5cGUgIiArIHJlY29yZC50eXBlCisgICAgICAgICAgICBpZiByZWNvcmQudHlwZSA9PSAiYXBwbGljYXRpb24vdm5kLndmYS53c2MiOgorICAgICAgICAgICAgICAgIHByaW50ICJXUFMgdGFnIC0gc2VuZCB0byB3cGFfc3VwcGxpY2FudCIKKyAgICAgICAgICAgICAgICB3cGFzX3RhZ19yZWFkKHRhZy5uZGVmLm1lc3NhZ2UpCisgICAgICAgICAgICAgICAgYnJlYWsKKyAgICBlbHNlOgorICAgICAgICBwcmludCAiRW1wdHkgdGFnIgorCisgICAgcHJpbnQgIlJlbW92ZSB0YWciCisgICAgd2hpbGUgdGFnLmlzX3ByZXNlbnQ6CisgICAgICAgIHRpbWUuc2xlZXAoMC4xKQorCisKK2RlZiB3cHNfd3JpdGVfY29uZmlnX3RhZyhjbGYpOgorICAgIHByaW50ICJXcml0ZSBXUFMgY29uZmlnIHRva2VuIgorICAgIGRhdGEgPSB3cGFzX2dldF9jb25maWdfdG9rZW4oKQorICAgIGlmIChkYXRhID09IE5vbmUpOgorICAgICAgICBwcmludCAiQ291bGQgbm90IGdldCBXUFMgY29uZmlnIHRva2VuIGZyb20gd3BhX3N1cHBsaWNhbnQiCisgICAgICAgIHJldHVybgorCisgICAgcHJpbnQgIlRvdWNoIGFuIE5GQyB0YWciCisgICAgd2hpbGUgVHJ1ZToKKyAgICAgICAgdGFnID0gY2xmLnBvbGwoKQorICAgICAgICBpZiB0YWcgPT0gTm9uZToKKyAgICAgICAgICAgIHRpbWUuc2xlZXAoMC4xKQorICAgICAgICAgICAgY29udGludWUKKyAgICAgICAgYnJlYWsKKworICAgIHByaW50ICJUYWcgZm91bmQgLSB3cml0aW5nIgorICAgIHRhZy5uZGVmLm1lc3NhZ2UgPSBkYXRhCisgICAgcHJpbnQgIkRvbmUgLSByZW1vdmUgdGFnIgorICAgIHdoaWxlIHRhZy5pc19wcmVzZW50OgorICAgICAgICB0aW1lLnNsZWVwKDAuMSkKKworCitkZWYgd3BzX3dyaXRlX2VyX2NvbmZpZ190YWcoY2xmLCB1dWlkKToKKyAgICBwcmludCAiV3JpdGUgV1BTIEVSIGNvbmZpZyB0b2tlbiIKKyAgICBkYXRhID0gd3Bhc19nZXRfZXJfY29uZmlnX3Rva2VuKHV1aWQpCisgICAgaWYgKGRhdGEgPT0gTm9uZSk6CisgICAgICAgIHByaW50ICJDb3VsZCBub3QgZ2V0IFdQUyBjb25maWcgdG9rZW4gZnJvbSB3cGFfc3VwcGxpY2FudCIKKyAgICAgICAgcmV0dXJuCisKKyAgICBwcmludCAiVG91Y2ggYW4gTkZDIHRhZyIKKyAgICB3aGlsZSBUcnVlOgorICAgICAgICB0YWcgPSBjbGYucG9sbCgpCisgICAgICAgIGlmIHRhZyA9PSBOb25lOgorICAgICAgICAgICAgdGltZS5zbGVlcCgwLjEpCisgICAgICAgICAgICBjb250aW51ZQorICAgICAgICBicmVhaworCisgICAgcHJpbnQgIlRhZyBmb3VuZCAtIHdyaXRpbmciCisgICAgdGFnLm5kZWYubWVzc2FnZSA9IGRhdGEKKyAgICBwcmludCAiRG9uZSAtIHJlbW92ZSB0YWciCisgICAgd2hpbGUgdGFnLmlzX3ByZXNlbnQ6CisgICAgICAgIHRpbWUuc2xlZXAoMC4xKQorCisKK2RlZiB3cHNfd3JpdGVfcGFzc3dvcmRfdGFnKGNsZik6CisgICAgcHJpbnQgIldyaXRlIFdQUyBwYXNzd29yZCB0b2tlbiIKKyAgICBkYXRhID0gd3Bhc19nZXRfcGFzc3dvcmRfdG9rZW4oKQorICAgIGlmIChkYXRhID09IE5vbmUpOgorICAgICAgICBwcmludCAiQ291bGQgbm90IGdldCBXUFMgcGFzc3dvcmQgdG9rZW4gZnJvbSB3cGFfc3VwcGxpY2FudCIKKyAgICAgICAgcmV0dXJuCisKKyAgICBwcmludCAiVG91Y2ggYW4gTkZDIHRhZyIKKyAgICB3aGlsZSBUcnVlOgorICAgICAgICB0YWcgPSBjbGYucG9sbCgpCisgICAgICAgIGlmIHRhZyA9PSBOb25lOgorICAgICAgICAgICAgdGltZS5zbGVlcCgwLjEpCisgICAgICAgICAgICBjb250aW51ZQorICAgICAgICBicmVhaworCisgICAgcHJpbnQgIlRhZyBmb3VuZCAtIHdyaXRpbmciCisgICAgdGFnLm5kZWYubWVzc2FnZSA9IGRhdGEKKyAgICBwcmludCAiRG9uZSAtIHJlbW92ZSB0YWciCisgICAgd2hpbGUgdGFnLmlzX3ByZXNlbnQ6CisgICAgICAgIHRpbWUuc2xlZXAoMC4xKQorCisKK2RlZiBmaW5kX3BlZXIoY2xmKToKKyAgICB3aGlsZSBUcnVlOgorICAgICAgICBpZiBuZmMubGxjcC5jb25uZWN0ZWQoKToKKyAgICAgICAgICAgIHByaW50ICJMTENQIGNvbm5lY3RlZCIKKyAgICAgICAgZ2VuZXJhbF9ieXRlcyA9IG5mYy5sbGNwLnN0YXJ0dXAoe30pCisgICAgICAgIHBlZXIgPSBjbGYubGlzdGVuKG9yZChvcy51cmFuZG9tKDEpKSArIDI1MCwgZ2VuZXJhbF9ieXRlcykKKyAgICAgICAgaWYgaXNpbnN0YW5jZShwZWVyLCBuZmMuREVQKToKKyAgICAgICAgICAgIHByaW50ICJsaXN0ZW4gLT4gREVQIjsKKyAgICAgICAgICAgIGlmIHBlZXIuZ2VuZXJhbF9ieXRlcy5zdGFydHN3aXRoKCJGZm0iKToKKyAgICAgICAgICAgICAgICBwcmludCAiRm91bmQgREVQIgorICAgICAgICAgICAgICAgIHJldHVybiBwZWVyCisgICAgICAgICAgICBwcmludCAibWlzbWF0Y2ggaW4gZ2VuZXJhbF9ieXRlcyIKKyAgICAgICAgICAgIHByaW50IHBlZXIuZ2VuZXJhbF9ieXRlcworCisgICAgICAgIHBlZXIgPSBjbGYucG9sbChnZW5lcmFsX2J5dGVzKQorICAgICAgICBpZiBpc2luc3RhbmNlKHBlZXIsIG5mYy5ERVApOgorICAgICAgICAgICAgcHJpbnQgInBvbGwgLT4gREVQIjsKKyAgICAgICAgICAgIGlmIHBlZXIuZ2VuZXJhbF9ieXRlcy5zdGFydHN3aXRoKCJGZm0iKToKKyAgICAgICAgICAgICAgICBwcmludCAiRm91bmQgREVQIgorICAgICAgICAgICAgICAgIHJldHVybiBwZWVyCisgICAgICAgICAgICBwcmludCAibWlzbWF0Y2ggaW4gZ2VuZXJhbF9ieXRlcyIKKyAgICAgICAgICAgIHByaW50IHBlZXIuZ2VuZXJhbF9ieXRlcworCisgICAgICAgIGlmIHBlZXI6CisgICAgICAgICAgICBwcmludCAiRm91bmQgdGFnIgorICAgICAgICAgICAgcmV0dXJuIHBlZXIKKworCitkZWYgbWFpbigpOgorICAgIGNsZiA9IG5mYy5Db250YWN0bGVzc0Zyb250ZW5kKCkKKworICAgIHRyeToKKyAgICAgICAgYXJnX3V1aWQgPSBOb25lCisgICAgICAgIGlmIGxlbihzeXMuYXJndikgPiAxOgorICAgICAgICAgICAgYXJnX3V1aWQgPSBzeXMuYXJndlsxXQorCisgICAgICAgIGlmIGxlbihzeXMuYXJndikgPiAxIGFuZCBzeXMuYXJndlsxXSA9PSAid3JpdGUtY29uZmlnIjoKKyAgICAgICAgICAgIHdwc193cml0ZV9jb25maWdfdGFnKGNsZikKKyAgICAgICAgICAgIHJhaXNlIFN5c3RlbUV4aXQKKworICAgICAgICBpZiBsZW4oc3lzLmFyZ3YpID4gMiBhbmQgc3lzLmFyZ3ZbMV0gPT0gIndyaXRlLWVyLWNvbmZpZyI6CisgICAgICAgICAgICB3cHNfd3JpdGVfZXJfY29uZmlnX3RhZyhjbGYsIHN5cy5hcmd2WzJdKQorICAgICAgICAgICAgcmFpc2UgU3lzdGVtRXhpdAorCisgICAgICAgIGlmIGxlbihzeXMuYXJndikgPiAxIGFuZCBzeXMuYXJndlsxXSA9PSAid3JpdGUtcGFzc3dvcmQiOgorICAgICAgICAgICAgd3BzX3dyaXRlX3Bhc3N3b3JkX3RhZyhjbGYpCisgICAgICAgICAgICByYWlzZSBTeXN0ZW1FeGl0CisKKyAgICAgICAgd2hpbGUgVHJ1ZToKKyAgICAgICAgICAgIHByaW50ICJXYWl0aW5nIGZvciBhIHRhZyBvciBwZWVyIHRvIGJlIHRvdWNoZWQiCisKKyAgICAgICAgICAgIHRhZyA9IGZpbmRfcGVlcihjbGYpCisgICAgICAgICAgICBpZiBpc2luc3RhbmNlKHRhZywgbmZjLkRFUCk6CisgICAgICAgICAgICAgICAgaWYgYXJnX3V1aWQgaXMgTm9uZToKKyAgICAgICAgICAgICAgICAgICAgd3BzX2hhbmRvdmVyX2luaXQodGFnKQorICAgICAgICAgICAgICAgIGVsaWYgYXJnX3V1aWQgaXMgImFwIjoKKyAgICAgICAgICAgICAgICAgICAgd3BzX2hhbmRvdmVyX3Jlc3AodGFnLCBOb25lKQorICAgICAgICAgICAgICAgIGVsc2U6CisgICAgICAgICAgICAgICAgICAgIHdwc19oYW5kb3Zlcl9yZXNwKHRhZywgYXJnX3V1aWQpCisgICAgICAgICAgICAgICAgY29udGludWUKKworICAgICAgICAgICAgaWYgdGFnLm5kZWY6CisgICAgICAgICAgICAgICAgd3BzX3RhZ19yZWFkKHRhZykKKyAgICAgICAgICAgICAgICBjb250aW51ZQorCisgICAgICAgICAgICBwcmludCAiTm90IGFuIE5ERUYgdGFnIC0gcmVtb3ZlIHRhZyIKKyAgICAgICAgICAgIHdoaWxlIHRhZy5pc19wcmVzZW50OgorICAgICAgICAgICAgICAgIHRpbWUuc2xlZXAoMC4xKQorCisgICAgZXhjZXB0IEtleWJvYXJkSW50ZXJydXB0OgorICAgICAgICByYWlzZSBTeXN0ZW1FeGl0CisgICAgZmluYWxseToKKyAgICAgICAgY2xmLmNsb3NlKCkKKworICAgIHJhaXNlIFN5c3RlbUV4aXQKKworaWYgX19uYW1lX18gPT0gJ19fbWFpbl9fJzoKKyAgICBtYWlu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