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FVDVF9PVVQpL3N5c3RlbS9saWIvdm5kay9saWJzdGFnZWZyaWdodF9zb2Z0XyopCiAKICMgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAjIE5FV0VSIENMRUFOIFNURVBTIE1VU1QgQkUgQVQgVEhFIEVORCBPRiBUSEUgTElTVApkaWZmIC0tZ2l0IGEvT1dORVJTIGIvT1dORVJTCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjhmNDA1ZTkKLS0tIC9kZXYvbnVsbAorKysgYi9PV05FUlMKQEAgLTAsMCArMSw0IEBACitlbGF1cmVudEBnb29nbGUuY29tCitldGFsdmFsYUBnb29nbGUuY29tCitsYWpvc0Bnb29nbGUuY29tCittYXJjb25lQGdvb2dsZS5jb20KZGlmZiAtLWdpdCBhL2NhbWVyYS9JQ2FtZXJhQ2xpZW50LmNwcCBiL2NhbWVyYS9JQ2FtZXJhQ2xpZW50LmNwcAppbmRleCA3ZTYyOTdjLi44NjIwZjM2IDEwMDY0NAotLS0gYS9jYW1lcmEvSUNhbWVyYUNsaWVudC5jcHAKKysrIGIvY2FtZXJhL0lDYW1lcmFDbGllbnQuY3BwCkBAIC0xOTIsMTIgKzE5MiwxNCBAQAogICAgICAgICAgICAgdGltZXN0YW1wcy5yZXNlcnZlKG4pOwogICAgICAgICAgICAgaGFuZGxlcy5yZXNlcnZlKG4pOwogICAgICAgICAgICAgZm9yICh1aW50MzJfdCBpID0gMDsgaSA8IG47IGkrKykgewotICAgICAgICAgICAgICAgIHJlcyA9IGRhdGEucmVhZEludDY0KCZ0aW1lc3RhbXBzW2ldKTsKKyAgICAgICAgICAgICAgICBuc2Vjc190IHQ7CisgICAgICAgICAgICAgICAgcmVzID0gZGF0YS5yZWFkSW50NjQoJnQpOwogICAgICAgICAgICAgICAgIGlmIChyZXMgIT0gT0spIHsKICAgICAgICAgICAgICAgICAgICAgQUxPR0UoIiVzOiBGYWlsZWQgdG8gcmVhZCB0aW1lc3RhbXBbJWRdOiAlcyAoJWQpIiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX0ZVTkNUSU9OX18sIGksIHN0cmVycm9yKC1yZXMpLCByZXMpOwogICAgICAgICAgICAgICAgICAgICByZXR1cm4gQkFEX1ZBTFVFOwogICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB0aW1lc3RhbXBzLnB1c2hfYmFjayh0KTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGZvciAodWludDMyX3QgaSA9IDA7IGkgPCBuOyBpKyspIHsKICAgICAgICAgICAgICAgICBuYXRpdmVfaGFuZGxlX3QqIGhhbmRsZSA9IGRhdGEucmVhZE5hdGl2ZUhhbmRsZSgpOwpkaWZmIC0tZ2l0IGEvY2FtZXJhL0lDYW1lcmFSZWNvcmRpbmdQcm94eUxpc3RlbmVyLmNwcCBiL2NhbWVyYS9JQ2FtZXJhUmVjb3JkaW5nUHJveHlMaXN0ZW5lci5jcHAKaW5kZXggYzk1NDI0MS4uNjZmYWY4ZiAxMDA2NDQKLS0tIGEvY2FtZXJhL0lDYW1lcmFSZWNvcmRpbmdQcm94eUxpc3RlbmVyLmNwcAorKysgYi9jYW1lcmEvSUNhbWVyYVJlY29yZGluZ1Byb3h5TGlzdGVuZXIuY3BwCkBAIC0xNDYsMTIgKzE0NiwxNCBAQAogICAgICAgICAgICAgdGltZXN0YW1wcy5yZXNlcnZlKG4pOwogICAgICAgICAgICAgaGFuZGxlcy5yZXNlcnZlKG4pOwogICAgICAgICAgICAgZm9yICh1aW50MzJfdCBpID0gMDsgaSA8IG47IGkrKykgewotICAgICAgICAgICAgICAgIHJlcyA9IGRhdGEucmVhZEludDY0KCZ0aW1lc3RhbXBzW2ldKTsKKyAgICAgICAgICAgICAgICBuc2Vjc190IHQ7CisgICAgICAgICAgICAgICAgcmVzID0gZGF0YS5yZWFkSW50NjQoJnQpOwogICAgICAgICAgICAgICAgIGlmIChyZXMgIT0gT0spIHs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oKSB7CiAgICAgTXV0ZXg6OkF1dG9sb2NrIGF1dG9Mb2NrKG1Mb2NrKTsKLQogICAgIGlmIChtSW5pdENoZWNrICE9IE9LKSB7CiAgICAgICAgIHJldHVybiBtSW5pdENoZWNrOwogICAgIH0KIAorICAgIGNsb3NlT3BlblNlc3Npb25zKCk7CisgICAgcmVwb3J0TWV0cmljcygpOwogICAgIHNldExpc3RlbmVyKE5VTEwpOwogICAgIG1Jbml0Q2hlY2sgPSBOT19JTklUOwogCkBAIC00NzEsNiArNDg0LDcgQEAKICAgICBpZiAoZXJyID09IE9LKSB7CiAgICAgICAgIERybVNlc3Npb25NYW5hZ2VyOjpJbnN0YW5jZSgpLT5hZGRTZXNzaW9uKGdldENhbGxpbmdQaWQoKSwKICAgICAgICAgICAgICAgICBtRHJtU2Vzc2lvbkNsaWVudCwgc2Vzc2lvbklkKTsKKyAgICAgICAgbU9wZW5TZXNzaW9ucy5wdXNoKHNlc3Npb25JZCk7CiAgICAgfQogICAgIHJldHVybiBlcnI7CiB9CkBAIC00ODYsNyArNTAwLDE0IEBACiAgICAgaWYgKHN0YXR1cy5pc09rKCkpIHsKICAgICAgICAgaWYgKHN0YXR1cyA9PSBTdGF0dXM6Ok9LKSB7CiAgICAgICAgICAgICBEcm1TZXNzaW9uTWFuYWdlcjo6SW5zdGFuY2UoKS0+cmVtb3ZlU2Vzc2lvbihzZXNzaW9uSWQpOworICAgICAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBtT3BlblNlc3Npb25zLnNpemUoKTsgaSsrKSB7CisgICAgICAgICAgICAgICAgaWYgKG1PcGVuU2Vzc2lvbnNbaV0gPT0gc2Vzc2lvbklkKSB7CisgICAgICAgICAgICAgICAgICAgIG1PcGVuU2Vzc2lvbnMucmVtb3ZlQXQoaSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KICAgICAgICAgfQorICAgICAgICByZXBvcnRNZXRy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oKSk7CisgICAgICBhbmFseXRpY3NJdGVtLnNldFBrZ05hbWUoYXBwX3BhY2thZ2VfbmFtZSk7CisgICAgfQorCisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBtZXRyaWNzR3JvdXAubWV0cmljX3NpemUoKTsgKytpKSB7CisgICAgICAgIGNvbnN0IE1ldHJpY3NHcm91cF9NZXRyaWMmIG1ldHJpYyA9IG1ldHJpY3NHcm91cC5tZXRyaWMoaSk7CisgICAgICAgIGlmICghbWV0cmljLmhhc19uYW1lKCkpIHsKKyAgICAgICAgICAgIEFMT0dFKCJNZXRyaWMgd2l0aCBubyBuYW1lLiIpOworICAgICAgICAgICAgcmV0dXJuIEJBRF9WQUxVRTsKKyAgICAgICAgfQorCisgICAgICAgIGlmICghbWV0cmljLmhhc192YWx1ZSgpKSB7CisgICAgICAgICAgICBBTE9HRSgiTWV0cmljIHdpdGggbm8gdmFsdWUuIik7CisgICAgICAgICAgICByZXR1cm4gQkFEX1ZBTFVFOworICAgICAgICB9CisKKyAgICAgICAgY29uc3QgTWV0cmljc0dyb3VwX01ldHJpY19NZXRyaWNWYWx1ZSYgdmFsdWUgPSBtZXRyaWMudmFsdWUoKTsKKyAgICAgICAgaWYgKHZhbHVlLmhhc19pbnRfdmFsdWUoKSkgeworICAgICAgICAgICAgYW5hbHl0aWNzSXRlbS5zZXRJbnQ2NChtZXRyaWMubmFtZSgpLmNfc3RyKCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlLmludF92YWx1ZSgpKTsKKyAgICAgICAgfSBlbHNlIGlmICh2YWx1ZS5oYXNfZG91YmxlX3ZhbHVlKCkpIHsKKyAgICAgICAgICAgIGFuYWx5dGljc0l0ZW0uc2V0RG91YmxlKG1ldHJpYy5uYW1lKCkuY19zdHIoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlLmRvdWJsZV92YWx1ZSgpKTsKKyAgICAgICAgfSBlbHNlIGlmICh2Y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ZXNzaW9uSWQpOworICAgICAgICBpZiAocmVzICE9IE9LKSB7CisgICAgICAgICAgICByZXR1cm4gcmVzOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIE9LOworfQorCitTdHJpbmc4IHNhbml0aXplKGNvbnN0IFN0cmluZzgmIGlucHV0KSB7CisgICAgLy8gRmlsdGVycyB0aGUgaW5wdXQgc3RyaW5nIGRvd24gdG8ganVzdCBhbHBoYW51bWVyaWMgY2hhcmFjdGVycy4KKyAgICBTdHJpbmc4IG91dHB1dDsKKyAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IGlucHV0LnNpemUoKTsgKytpKSB7CisgICAgICAgIGNoYXIgY2FuZGlkYXRlID0gaW5wdXRbaV07CisgICAgICAgIGlmICgoY2FuZGlkYXRlID49ICdhJyAmJiBjYW5kaWRhdGUgPD0gJ3onKSB8fAorICAgICAgICAgICAgICAgIChjYW5kaWRhdGUgPj0gJ0EnICYmIGNhbmRpZGF0ZSA8PSAnWicpIHx8CisgICAgICAgICAgICAgICAgKGNhbmRpZGF0ZSA+PSAnMCcgJiYgY2FuZGlkYXRlIDw9ICc5JykpIHsKKyAgICAgICAgICAgIG91dHB1dC5hcHBlbmQoJmNhbmRpZGF0ZSwgMSk7CisgICAgICAgIH0KKyAgICB9CisgICAgcmV0dXJuIG91dHB1dDsKK30KKworfSAgLy8gbmFtZXNwYWNlCisKK3N0YXR1c190IHJlcG9ydERybVBsdWdpbk1ldHJpY3MoY29uc3QgVmVjdG9yPHVpbnQ4X3Q+JiBzZXJpYWxpemVkTWV0cmljcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgU3RyaW5nOCYgdmVuZG9yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBTdHJpbmc4JiBkZXNjcmlwdGlvbikgeworICAgIE1ldHJpY3NHcm91cCByb290X21ldHJpY3NfZ3JvdXA7CisgICAgaWYgKCFyb290X21ldHJpY3NfZ3JvdXAuUG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JaWGxwWkRBeFwiIgotICAgICAgICAgICAgICAgICAgICAgICAgIlwia1wiOlwiU0dWc2JHOGdSbkpwWlc1a0lTRVwiIgorICAgICAgICAgICAgICAgICAgICAgICAgIlwia1wiOlwiU0dWc2JHOGdSbkpwWlc1a0lDRS1Qd1wiIgogICAgICAgICAgICAgICAgICAgICAgICAgIlwia3R5XCI6XCJvY3RcIiIKICAgICAgICAgICAgICAgICAgICAgICAgICJcImFsZ1wiOlwiQTEyOEtXMVwiIgogICAgICAgICAgICAgICAgICAgICAifSIKICAgICAgICAgICAgICAgICAgICAgInsiCiAgICAgICAgICAgICAgICAgICAgICAgICAiXCJrdHlcIjpcIm9jdFwiIgogICAgICAgICAgICAgICAgICAgICAgICAgIlwiYWxnXCI6XCJBMTI4S1cyXCIiCi0gICAgICAgICAgICAgICAgICAgICAgICAiXCJrXCI6XCJTR1ZzYkc4Z1JuSnBaVzVrSVFcIiIKKyAgICAgICAgICAgICAgICAgICAgICAgICJcImtcIjpcIlNHVnNiRzhnUm5KcFpXNWtJQ0VfXCIiCiAgICAgICAgICAgICAgICAgICAgICAgICAiXCJraWRcIjpcIlkyeGxZWEpyWlhsclpYbHBaREF5XCIiCiAgICAgICAgICAgICAgICAgICAgICJ9IgogICAgICAgICAgICAgICAgICAgICAieyIKQEAgLTMwMyw3ICszMDMsNyBAQAogICAgICAgICAgICAgICAgICAgICAieyIKICAgICAgICAgICAgICAgICAgICAgICAgICJcImFsZ1wiOlwiQTEyOEtXM1wiIgogICAgICAgICAgICAgICAgICAgICAgICAgIlwia2lkXCI6XCJZMnhsWVhKclpYbHJaWGxwWkRBelwiIgotICAgICAgICAgICAgICAgICAgICAgICAgIlwia1wiOlwiUjI5dlpDQmtZWGtoXCIiCisgICAgICAgICAgICAgICAgICAgICAgICAiXCJrXCI6XCJTR1ZzYkc4Z1B6NC1JRVp5YVdWdVpDQV9QZ1wiIgogICAgICAgICAgICAgICAgICAgICAgICAgIlwia3R5XCI6XCJvY3RcIiIKICAg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sYXlIZWlnaHQpLAorICAgICAgICBtUm90YXRpb25BbmdsZShhbmdsZSksIG1CeXRlc1BlclBpeGVsKGJwcCksIG1Sb3dCeXRlcyhicHAgKiB3aWR0aCksCisgICAgICAgIG1TaXplKDApLCBtSWNjU2l6ZSgwKSwgbVJlc2VydmVkKDApLCBtRGF0YSgwKSwgbUljY0RhdGEoMCkgeworICAgICAgICBpZiAoYWxsb2NhdGUpIHsKKyAgICAgICAgICAgIG1TaXplID0gbVJvd0J5dGVzICogbUhlaWdodDsKKyAgICAgICAgICAgIG1EYXRhID0gbmV3IHVpbnQ4X3RbbVNpemVdOworICAgICAgICAgICAgaWYgKG1EYXRhID09IE5VTEwpIHsKKyAgICAgICAgICAgICAgICBtU2l6ZSA9IDA7CisgICAgICAgICAgICB9CisgICAgICAgIH0KIAorICAgICAgICBpZiAoaWNjRGF0YSAhPSBOVUxMICYmIGljY1NpemUgPiAwKSB7CisgICAgICAgICAgICBtSWNjU2l6ZSA9IGljY1NpemU7CisgICAgICAgICAgICBtSWNjRGF0YSA9IG5ldyB1aW50OF90W2ljY1NpemVdOworICAgICAgICAgICAgaWYgKG1JY2NEYXRhICE9IE5VTEwpIHsKKyAgICAgICAgICAgICAgICBtZW1jcHkobUljY0RhdGEsIGljY0RhdGEsIGljY1NpemUpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBtSWNjU2l6ZSA9IDA7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvLyBEZWVwIGNvcHkgb2YgYm90aCB0aGUgaW5mb3JtYXRpb24gZmllbGRzIGFuZCB0aGUgZnJhbWUgZGF0YQogICAgIFZpZGVvRnJhbWUoY29uc3QgVmlkZW9GcmFtZSYgY29weSkgewotICAgICAgICBtV2lkdGggPSBjb3B5Lm1XaWR0aDsKLSAgICAgICAgbUhlaWdodCA9IGNvcHkubUhlaWdodDsKLSAgICAgICAgbURpc3BsYXlXaWR0aCA9IGNvcHkubURpc3BsYXlXaWR0aDsKLSAgICAgICAgbURpc3BsYXlIZWlnaHQgPSBjb3B5Lm1EaXNwbGF5SGVpZ2h0OworICAgICAgICBjb3B5SW5mb09ubHkoY29weSk7CisKICAgICAgICAgbVNpemUgPSBjb3B5Lm1TaXplOwogICAgICAgICBtRGF0YSA9IE5VTEw7ICAvLyBpbml0aWFsaXplIGl0IGZpcnN0CiAgICAgICAgIGlmIChtU2l6ZSA+IDAgJiYgY29weS5tRGF0YSAhPSBOVUxMKSB7CkBAIC00OCwyNiArNzUsOTkgQEAKICAgICAgICAgICAgICAgICBtU2l6ZSA9IDA7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KLSAgICAgICAgbVJvdGF0aW9uQW5nbGUgPSBjb3B5Lm1Sb3RhdGlvbkFuZ2xlOworCisgICAgICAgIG1JY2NTaXplID0gY29weS5tSWNjU2l6ZTsKKyAgICAgICAgbUljY0RhdGEgPSBOVUxMOyAgLy8gaW5pdGlhbGl6ZSBpdCBmaXJzdAorICAgICAgICBpZiAobUljY1NpemUgPiAwICYmIGNvcHkubUljY0RhdGEgIT0gTlVMTCkgeworICAgICAgICAgICAgbUljY0RhdGEgPSBuZXcgdWludDhfdFttSWNjU2l6ZV07CisgICAgICAgICAgICBpZiAobUljY0RhdGEgIT0gTlVMTCkgeworICAgICAgICAgICAgICAgIG1lbWNweShtSWNjRGF0YSwgY29weS5tSWNjRGF0YSwgbUljY1NpemUpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBtSWNjU2l6ZSA9IDA7CisgICAgICAgICAgICB9CisgICAgICAgIH0KICAgICB9CiAKICAgICB+VmlkZW9GcmFtZSgpIHsKICAgICAgICAgaWYgKG1EYXRhICE9IDApIHsKICAgICAgICAgICAgIGRlbGV0ZVtdIG1EYXRhOwogICAgICAgICB9CisgICAgICAgIGlmIChtSWNjRGF0YSAhPSAwKSB7CisgICAgICAgICAgICBkZWxldGVbXSBtSWNjRGF0YTsKKyAgICAgICAgfQorIC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lcnRpZXMgKnByb3BlcnRpZXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCAqbnVtTW9kdWxlcyk7Ci0gICAgc3RhdGljICBzcDxSYWRpbz4gYXR0YWNoKHJhZGlvX2hhbmRsZV90IGhhbmRsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3RydWN0IHJhZGlvX2JhbmRfY29uZmlnICpjb25maWcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgd2l0aEF1ZGlvLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzcDxSYWRpb0NhbGxiYWNrPiYgY2FsbGJhY2spOwotCi0KLSAgICAgICAgICAgIHZvaWQgZGV0YWNoKCk7Ci0KLSAgICAgICAgICAgIHN0YXR1c190IHNldENvbmZpZ3VyYXRpb24oY29uc3Qgc3RydWN0IHJhZGlvX2JhbmRfY29uZmlnICpjb25maWcpOwotCi0gICAgICAgICAgICBzdGF0dXNfdCBnZXRDb25maWd1cmF0aW9uKHN0cnVjdCByYWRpb19iYW5kX2NvbmZpZyAqY29uZmlnKTsKLQotICAgICAgICAgICAgc3RhdHVzX3Qgc2V0TXV0ZShib29sIG11dGUpOwotCi0gICAgICAgICAgICBzdGF0dXNfdCBnZXRNdXRlKGJvb2wgKm11dGUpOwotCi0gICAgICAgICAgICBzdGF0dXNfdCBzdGVwKHJhZGlvX2RpcmVjdGlvbl90IGRpcmVjdGlvbiwgYm9vbCBza2lwU3ViQ2hhbm5lbCk7Ci0KLSAgICAgICAgICAgIHN0YXR1c190IHNjYW4ocmFkaW9fZGlyZWN0aW9uX3QgZGlyZWN0aW9uLCBib29sIHNraXBTdWJDaGFubmVsKTsKLQotICAgICAgICAgICAgc3RhdHVzX3QgdHVuZSh1bnNpZ25lZCBpbnQgY2hhbm5lbCwgdW5zaWduZWQgaW50IHN1YkNoYW5uZWwpOwotCi0gICAgICAgICAgICBzdGF0dXNfdCBjYW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iwKICAgICBmaXJzdF92ZXJzaW9uOiAiMjYiLAogICAgIHVudmVyc2lvbmVkX3VudGlsOiAiY3VycmVudCIsCmRpZmYgLS1naXQgYS9tZWRpYS9saWJhYXVkaW8vRG94eWZpbGUgYi9tZWRpYS9saWJhYXVkaW8vRG94eWZpbGUKaW5kZXggZTJjNDk2MC4uNzI5OGQxMSAxMDA2NDQKLS0tIGEvbWVkaWEvbGliYWF1ZGlvL0RveHlmaWxlCisrKyBiL21lZGlhL2xpYmFhdWRpby9Eb3h5ZmlsZQpAQCAtNzQ0LDEyICs3NDQsMTIgQEAKICMgTm90ZTogSWYgdGhpcyB0YWcgaXMgZW1wdHkgdGhlIGN1cnJlbnQgZGlyZWN0b3J5IGlzIHNlYXJjaGVkLgogCiBJTlBVVCAgICAgICAgICAgICAgICAgID0gaW5jbHVkZS9hYXVkaW8vQUF1ZGlvLmggXAorICAgICAgICAgICAgICAgICAgICAgICAgIHNyYy9iaW5kaW5nL0FBdWRpb0NvbW1vbi5oIFwKICAgICAgICAgICAgICAgICAgICAgICAgICBzcmMvbGVnYWN5L0F1ZGlvU3RyZWFtVHJhY2suaCBcCiAgICAgICAgICAgICAgICAgICAgICAgICAgc3JjL2xlZ2FjeS9BdWRpb1N0cmVhbVJlY29yZC5oIFwKICAgICAgICAgICAgICAgICAgICAgICAgICBzcmMvbGVnYWN5L0FBdWRpb0xlZ2FjeS5oIFwKICAgICAgICAgICAgICAgICAgICAgICAgICBzcmMvY29yZS9BdWRpb1N0cmVhbUJ1aWxkZXIuaCBcCiAgICAgICAgICAgICAgICAgICAgICAgICAgc3JjL2NvcmUvQXVkaW9TdHJlYW0uaCBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgc3JjL3V0aWxpdHkvSGFuZGxlVHJhY2tlci5oIFwKICAgICAgICAgICAgICAgICAgICAgICAgICBzcmMvdXRpbGl0eS9Nb25vdG9uaWNDb3VudGVyLmggXAogICAgICAgICAgICAgICAgICAgICAgICAgIHNyYy91dGlsaXR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GRpc3BsYXlQZWFrTGV2ZWwocGVha0xldmVsKTsKICAgICAgICAgICAgIHBlYWtMZXZlbCA9IDAuMDsKKyAgICAgICAgICAgIG5leHRGcmFtZUNvdW50ICs9IEZSQU1FU19QRVJfTElORTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIFByaW50IHRpbWVzdGFtcHMuCisgICAgICAgIGludDY0X3QgZnJhbWVQb3NpdGlvbiA9IDA7CisgICAgICAgIGludDY0X3QgZnJhbWVUaW1lID0gMDsKKyAgICAgICAgYWF1ZGlvX3Jlc3VsdF90IHRpbWVSZXN1bHQ7CisgICAgICAgIHRpbWVSZXN1bHQgPSBBQXVkaW9TdHJlYW1fZ2V0VGltZXN0YW1wKGFhdWRpb1N0cmVhbSwgQ0xPQ0tfTU9OT1RPTklDLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmZnJhbWVQb3NpdGlvbiwgJmZyYW1lVGltZSk7CisKKyAgICAgICAgaWYgKHRpbWVSZXN1bHQgPT0gQUFVRElPX09LKSB7CisgICAgICAgICAgICBpZiAoZnJhbWVQb3NpdGlvbiA+IChwcmV2aW91c0ZyYW1lUG9zaXRpb24gKyBGUkFNRVNfUEVSX0xJTkUpKSB7CisgICAgICAgICAgICAgICAgaW50NjRfdCByZWFsVGltZSA9IGdldE5hbm9zZWNvbmRzKCk7CisgICAgICAgICAgICAgICAgaW50NjRfdCBmcmFtZXNSZWFkID0gQUF1ZGlvU3RyZWFtX2dldEZyYW1lc1JlYWQoYWF1ZGlvU3RyZWFtKTsKKworICAgICAgICAgICAgICAgIGRvdWJsZSBsYXRlbmN5TWlsbGlzID0gY2FsY3VsYXRlTGF0ZW5jeU1pbGxpcyhmcmFtZXNSZWFkLCByZWFsVGltZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJhbWVQb3NpdGlvbiwgZnJhbWVUaW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY3R1YWxTYW1wbGVSYXRlKTsKKworICAgICAgICAgICAgICAgIHByaW50ZigiLS0tIHRpbWVzdGFtcDogcmVzdWx0ID0gJTRkLCBwb3NpdGlvbiA9ICVsbGQsIGF0ICVsbGQgbmFub3MiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiwgbGF0ZW5jeSA9ICU3LjJmIG1zZWNcbiIsCisgICAgICAgICAgICAgICAgICAgICAgIHRpbWVSZXN1bHQsCisgICAgICAgICAgICAgICAgICAgICAgIChsb25nIGxvbmcpIGZyYW1lUG9zaXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgIChsb25nIGxvbmcpIGZyYW1lVGltZSwKKyAgICAgICAgICAgICAgICAgICAgICAgbGF0ZW5jeU1pbGxpcyk7CisgICAgICAgICAgICAgICAgcHJldmlvdXNGcmFtZVBvc2l0aW9uID0gZnJhbWVQb3NpdGlvbjsKKyAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KIApkaWZmIC0tZ2l0IGEvbWVkaWEvbGliYWF1ZGlvL2V4YW1wbGVzL2lucHV0X21vbml0b3Ivc3JjL2lucHV0X21vbml0b3JfY2FsbGJhY2suY3BwIGIvbWVkaWEvbGliYWF1ZGlvL2V4YW1wbGVzL2lucHV0X21vbml0b3Ivc3JjL2lucHV0X21vbml0b3JfY2FsbGJhY2suY3BwCmluZGV4IDlkZTJlYjAuLjg5Mzc5NWIgMTAwNjQ0Ci0tLSBhL21lZGlhL2xpYmFhdWRpby9leGFtcGxlcy9pbnB1dF9tb25pdG9yL3NyYy9pbnB1dF9tb25pdG9yX2NhbGxiYWNrLmNwcAorKysgYi9tZWRpYS9saWJhYXVkaW8vZXhhbXBsZXMvaW5wdXRfbW9uaXRvci9zcmMvaW5wdXRfbW9uaXRvcl9jYWxsYmFjay5jcHAKQEAgLTQxLDcgKzQxLDcgQEAKICAgICAvLyBNYWtlIHByaW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TQVZJTkc6CisgICAgICAgICAgICB0ZXh0ID0gIlBPV0VSX1NBVklORyI7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIGJyZWFrOworICAgIH0KKyAgICByZXR1cm4gdGV4dDsKK30KKworY29uc3QgY2hhciAqZ2V0RGlyZWN0aW9uVGV4dChhYXVkaW9fZGlyZWN0aW9uX3QgZGlyZWN0aW9uKSB7CisgICAgY29uc3QgY2hhciAqdGV4dCA9ICJ1bmtub3duIjsKKyAgICBzd2l0Y2ggKGRpcmVjdGlvbikgeworICAgICAgICBjYXNlIEFBVURJT19ESVJFQ1RJT05fSU5QVVQ6CisgICAgICAgICAgICB0ZXh0ID0gIklOUFVUIjsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIEFBVURJT19ESVJFQ1RJT05fT1VUUFVUOgorICAgICAgICAgICAgdGV4dCA9ICJPVVRQVVQiOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBicmVhazsKKyAgICB9CisgICAgcmV0dXJuIHRleHQ7Cit9CisKK3N0YXRpYyB2b2lkIGNvbnZlcnROYW5vc2Vjb25kc1RvVGltZXNwZWMoaW50NjRfdCBuYW5vc2Vjb25kcywgc3RydWN0IHRpbWVzcGVjICp0aW1lKSB7CisgICAgdGltZS0+dHZfc2VjID0gbmFub3NlY29uZHMgLyBOQU5PU19QRVJfU0VDT05EOworICAgIC8vIENhbGN1bGF0ZSB0aGUgZnJhY3Rpb25hbCBuYW5vc2Vjb25kcy4gQXZvaWRzIGV4cGVuc2l2ZSAlIG9wZXJhdGlvbi4KKyAgICB0aW1lLT50dl9uc2VjID0gbmFub3NlY29uZHMgLSAodGltZS0+dHZfc2VjICogTkFOT1NfUEVSX1NFQ09ORCk7CiB9CiAKIHN0YXRpYyBpbnQ2NF90IGdldE5hbm9zZWNvbmRzKGNsb2NraWRfdCBjbG9ja0lkID0gQ0xPQ0tf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0aW9uMTsKKyAgICBpbnQ2NF90IGRlbHRhVGltZSA9CisgICAgICAgICAgICAoTkFOT1NfUEVSX1NFQ09ORCAqIGRlbHRhRnJhbWVzIC8gc2FtcGxlUmF0ZSk7CisgICAgaW50NjRfdCB0aW1lQ3VycmVudEZyYW1lUGxheWVkID0gbmFub3NlY29uZHMxICsgZGVsdGFUaW1lOworICAgIGludDY0X3QgbGF0ZW5jeU5hbm9zID0gdGltZUN1cnJlbnRGcmFtZVBsYXllZCAtIG5hbm9zZWNvbmRzMjsKKyAgICBkb3VibGUgbGF0ZW5jeU1pbGxpcyA9IGxhdGVuY3lOYW5vcyAvIDEwMDAwMDAuMDsKKyAgICByZXR1cm4gbGF0ZW5jeU1pbGxpczsKK30KKworLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKy8vIFRoZXNlIEZ1dGV4IGNhbGxzIGFyZSBjb21tb24gb25saW5lIGV4YW1wbGVzLgorc3RhdGljIGFuZHJvaWQ6OnN0YXR1c190IHN5c19mdXRleCh2b2lkICphZGRyMSwgaW50IG9wLCBpbnQgdmFsMSwKKyAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgdGltZXNwZWMgKnRpbWVvdXQsIHZvaWQgKmFkZHIyLCBpbnQgdmFsMykgeworICAgIGFuZHJvaWQ6OnN0YXR1c190IHJlc3VsdCA9IChhbmRyb2lkOjpzdGF0dXNfdCkgc3lzY2FsbChTWVNfZnV0ZXgsIGFkZHIxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcCwgdmFsMSwgdGltZW91dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkcjIsIHZhbDMpOworICAgIHJldHVybiAocmVzdWx0ID09IDApID8gMCA6IC1lcnJubzsKK30KKworc3RhdGlj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AgIGludDY0X3QgICAgICAgIG5leHRGcmFtZVRvR2xpdGNoID0gRk9SQ0VEX1VOREVSUlVOX1BFUklPRF9GUkFNRVM7CiAgICAgaW50MzJfdCAgICAgICAgbWluTnVtRnJhbWVzID0gSU5UMzJfTUFYOwogICAgIGludDMyX3QgICAgICAgIG1heE51bUZyYW1lcyA9IDA7Ci0gICAgaW50ICAgICAgICAgICAgc2NoZWR1bGVyOworICAgIGludDMyX3QgICAgICAgIHRpbWVzdGFtcENvdW50ID0gMDsgLy8gaW4gdGltZXN0YW1wcworCisgICAgaW50ICAgICAgICAgICAgc2NoZWR1bGVyID0gMDsKICAgICBib29sICAgICAgICAgICBzY2hlZHVsZXJDaGVja2VkID0gZmFsc2U7CiAgICAgYm9vbCAgICAgICAgICAgZm9yY2VVbmRlcnJ1bnMgPSBmYWxzZTsKKworICAgIEFBdWRpb1NpbXBsZVBsYXllciBzaW1wbGVQbGF5ZXI7CisgICAgaW50MzJfdCAgICAgICAgICAgIGNhbGxiYWNrQ291bnQgPSAwOworICAgIFdha2VVcCAgICAgICAgICAgICB3YWtlcntBQVVESU9fT0t9OworCiB9IFNpbmVUaHJlYWRlZERhdGFfdDsKIAogLy8gQ2FsbGJhY2sgZnVuY3Rpb24gdGhhdCBmaWxscyB0aGUgYXVkaW8gb3V0cHV0IGJ1ZmZlci4KQEAgLTI0Nyw2ICsyNjUsNyBAQAogICAgICAgICByZXR1cm4gQUFVRElPX0NBTExCQUNLX1JFU1VMVF9TVE9QOwogICAgIH0KICAgICBTaW5lVGhyZWFkZWREYXRhX3QgKnNpbmVEYXRhID0gKFNpbmVUaHJlYWRlZERhdGFfdCAqKSB1c2VyRGF0YTsKKyAgICBzaW5lRGF0YS0+Y2FsbGJhY2tDb3VudCsrOwogCiAgICAgc2luZURhdGEtPmZyYW1lc1RvdGFsICs9IG51bUZyYW1lczsKIApAQCAtMjYzLDYgKzI4MiwxNyBAQAogICAgICAgICBzaW5lRGF0YS0+c2NoZWR1bGVyQ2hl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FhdWRpb19zdHJlYW1fc3RhdGVfdCBzdGF0ZTsKLSAgICAgICAgcmVzdWx0ID0gQUF1ZGlvU3RyZWFtX3dhaXRGb3JTdGF0ZUNoYW5nZShwbGF5ZXIuZ2V0U3RyZWFtKCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQUFVRElPX1NUUkVBTV9TVEFURV9DTE9TRUQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnN0YXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApOworICAgICAgICAvLyBTbGVlcCBhIHdoaWxlLiBXYWtlIHVwIGVhcmx5IGlmIHRoZXJlIGlzIGFuIGVycm9yLCBmb3IgZXhhbXBsZSBhIERJU0NPTk5FQ1QuCisgICAgICAgIGxvbmcgcmV0ID0gbXlEYXRhLndha2VyLndhaXQoQUFVRElPX09LLCBOQU5PU19QRVJfU0VDT05EKTsKKyAgICAgICAgaW50NjRfdCBtaWxsaXMgPSAoZ2V0TmFub3NlY29uZHMoQ0xPQ0tfTU9OT1RPTklDKSAtIHN0YXJ0ZWRBdE5hbm9zKSAvIE5BTk9TX1BFUl9NSUxMSVNFQ09ORDsKKyAgICAgICAgcmVzdWx0ID0gbXlEYXRhLndha2VyLmdldCgpOworICAgICAgICBwcmludGYoIndhaXQoKSByZXR1cm5zICVsZCwgYWF1ZGlvX3Jlc3VsdCA9ICVkLCBhdCAlNmQgbWlsbGlzIgorICAgICAgICAgICAgICAgIiwgc2Vjb25kID0gJWQsIGZyYW1lc1dyaXR0ZW4gPSAlOGQsIHVuZGVycnVucyA9ICVkXG4iLAorICAgICAgICAgICAgICAgcmV0LCByZXN1bHQsIChpbnQpIG1pbGxpcywKKyAgICAgICAgICAgICAgIHNlY29uZCwKKyAgICAgICAgICAgICAgIChpbnQpIEFBdWRpb1N0cmVhbV9nZXRGcmFtZXNXcml0dGVuKHBsYXllci5nZXRTdHJlYW0oKSksCisgICAgICAgICAgICAgICAoaW50KSBBQXVkaW9TdHJlYW1fZ2V0WFJ1bkNvdW50KHBsYXllci5nZXRTdHJlYW0oKSkpOwogICAgICAgICBpZiAocmVzdWx0ICE9IEFBVURJT19PSykgewotICAgICAgICAgICAgZnByaW50ZihzdGRlcnIsICJFUlJPUiAtIEFBdWRpb1N0cmVhbV93YWl0Rm9yU3RhdGVDaGFuZ2UoKSByZXR1cm5lZCAlZFxuIiwgcmVzdWx0KTsKLSAgICAgICAgICAgIGdvdG8gZXJyb3I7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKHN0YXRlICE9IEFBVURJT19TVFJFQU1fU1RBVEVfU1RBUlRJTkcgJiYgc3RhdGUgIT0gQUFVRElPX1NUUkVBTV9TVEFURV9TVEFSVEVEKSB7Ci0gICAgICAgICAgICBwcmludGYoIlN0cmVhbSBzdGF0ZSBpcyAlZCAlcyFcbiIsIHN0YXRlLCBBQXVkaW9fY29udmVydFN0cmVhbVN0YXRlVG9UZXh0KHN0YXRlKSk7CisgICAgICAgICAgICBpZiAocmVzdWx0ID09IEFBVURJT19FUlJPUl9ESVNDT05ORUNURUQpIHsKKyAgICAgICAgICAgICAgICBkaXNjb25uZWN0ZWQgPSB0cnVlOworICAgICAgICAgICAgfQogICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgIH0KLSAgICAgICAgcHJpbnRmKCJmcmFtZXNXcml0dGVuID0gJWQsIHVuZGVycnVucyA9ICVkXG4iLAotICAgICAgICAgICAgICAgKGludCkgQUF1ZGlvU3RyZWFtX2dldEZyYW1lc1dyaXR0ZW4ocGxheWVyLmdldFN0cmVhbSgpKSwKLSAgICAgICAgICAgICAgIChpbnQpIEFBdWRpb1N0cmVhbV9nZXRYUnVuQ291bnQocGxheWVyLmdldFN0cmVhbSgpKQotICAgICAgICApOwogICAgIH0KLSAgICBwcmludGYoIldva2UgdXAgbm93LlxuIik7CisgICAgcHJpbnRmKCJBQXVkaW8gcmVzdWx0ID0gJWQgPSAlc1xuIiwgcmVzdWx0LCBBQXVkaW9fY29udmVydFJlc3VsdFRvVGV4dChyZXN1bHQpKTsKIAotICAgIHByaW50ZigiY2FsbCBzdG9wKClcbiIpOworICAgIHByaW50ZigiY2FsbCBzdG9wKCkgY2FsbGJhY2sgIyA9ICVkXG4iLCBteURhdGEuY2FsbGJhY2tDb3VudCk7CiAgICAgcmVzdWx0ID0gcGxheWVyLnN0b3AoKTsKICAgICBpZiAocmVzdWx0ICE9IEFBVURJT19PSykgewogICAgICAgICBnb3RvIGVycm9yOwpAQCAtMTE2LDYgKzEyMCwxOCBAQAogICAgICAgICBnb3RvIGVycm9yOwogICAgIH0KIAorICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbXlEYXRhLnRpbWVzdGFtcENvdW50OyBpKyspIHsKKyAgICAgICAgVGltZXN0YW1wICp0aW1lc3RhbXAgPSAmbXlEYXRhLnRpbWVzdGFtcHNbaV07CisgICAgICAgIGJvb2wgcmV0cm8gPSAoaSA+IDAgJiYKKyAgICAgICAgICAgICAgICAgICAgICAoKHRpbWVzdGFtcC0+cG9zaXRpb24gPCAodGltZXN0YW1wIC0gMSktPnBvc2l0aW9uKQorICAgICAgICAgICAgICAgICAgICAgICB8fCAoKHRpbWVzdGFtcC0+bmFub3NlY29uZHMgPCAodGltZXN0YW1wIC0gMSktPm5hbm9zZWNvbmRzKSkpKTsKKyAgICAgICAgY29uc3QgY2hhciAqbWVzc2FnZSA9IHJldHJvID8gIiAgPD0gUkVUUk9HUkFERSEiIDogIiI7CisgICAgICAgIHByaW50ZigiVGltZXN0YW1wICUzZCA6ICU4bGxkLCAlOGxsZCAlc1xuIiwgaSwKKyAgICAgICAgICAgICAgIChsb25nIGxvbmcpIHRpbWVzdGFtcC0+cG9zaXRpb24sCisgICAgICAgICAgICAgICAobG9uZyBsb25nKSB0aW1lc3RhbXAtPm5hbm9zZWNvbmRzLAorICAgICAgICAgICAgICAgbWVzc2FnZSk7CisgICA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wogICAgIGlmIChtQUF1ZGlvU2VydmljZSAhPSAwKSB7CiAgICAgICAgIElJbnRlcmZhY2U6OmFzQmluZGVyKG1BQXVkaW9TZXJ2aWNlKS0+dW5saW5rVG9EZWF0aChtQUF1ZGlvQ2xpZW50KTsKQEAgLTc1LDE5ICs4MCwxOSBAQAogICAgIGJvb2wgbmVlZFRvUmVnaXN0ZXIgPSBmYWxzZTsKICAgICB7CiAgICAgICAgIE11dGV4OjpBdXRvbG9jayBfbChtU2VydmljZUxvY2spOwotICAgICAgICBpZiAobUFBdWRpb1NlcnZpY2UgPT0gMCkgeworICAgICAgICBpZiAobUFBdWRpb1NlcnZpY2UuZ2V0KCkgPT0gbnVsbHB0cikgewogICAgICAgICAgICAgc3A8SUJpbmRlcj4gYmluZGVyOwogICAgICAgICAgICAgc3A8SVNlcnZpY2VNYW5hZ2VyPiBzbSA9IGRlZmF1bHRTZXJ2aWNlTWFuYWdlcigpOwogICAgICAgICAgICAgLy8gVHJ5IHNldmVyYWwgdGltZXMgdG8gZ2V0IHRoZSBzZXJ2aWNlLgogICAgICAgICAgICAgaW50IHJldHJpZXMgPSA0OwogICAgICAgICAgICAgZG8gewogICAgICAgICAgICAgICAgIGJpbmRlciA9IHNtLT5nZXRTZXJ2aWNlKFN0cmluZzE2KEFBVURJT19TRVJWSUNFX05BTUUpKTsgLy8gVGhpcyB3aWxsIHdhaXQgYSB3aGlsZS4KLSAgICAgICAgICAgICAgICBpZiAoYmluZGVyICE9IDApIHsKKyAgICAgICAgICAgICAgICBpZiAoYmluZGVyLmdldCgpICE9IG51bGxwdHIpIHsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfSB3aGlsZSAocmV0cmllcy0tID4gMCk7CiAKLSAgICAgICAgICAgIGlmIChiaW5kZXIgIT0gMCkgeworICAgICAgICAgICAgaWYgKGJpbmRlci5nZXQoKSAhPSBudWxscHRyKSB7CiAgICAgICAgICAgICAgICAg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05PX1NFUlZJQ0U7CisgICAgY29uc3Qgc3A8SUFBdWRpb1NlcnZpY2U+IHNlcnZpY2UgPSBnZXRBQXVkaW9TZXJ2aWNlKCk7CisgICAgaWYgKHNlcnZpY2UuZ2V0KCkgPT0gbnVsbHB0cikgcmV0dXJuIEFBVURJT19FUlJPUl9OT19TRVJWSUNFOwogICAgIHJldHVybiBzZXJ2aWNlLT5mbHVzaFN0cmVhbShzdHJlYW1IYW5kbGUpOwogfQogCkBAIC0xOTAsOCArMTkyLDggQEAKIGFhdWRpb19yZXN1bHRfdCBBQXVkaW9CaW5kZXJDbGllbnQ6OnJlZ2lzdGVyQXVkaW9UaHJlYWQoYWF1ZGlvX2hhbmRsZV90IHN0cmVhbUhhbmRsZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGlkX3QgY2xpZW50VGhyZWFkSWQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludDY0X3QgcGVyaW9kTmFub3NlY29uZHMpIHsKLSAgICBjb25zdCBzcDxJQUF1ZGlvU2VydmljZT4gJnNlcnZpY2UgPSBnZXRBQXVkaW9TZXJ2aWNlKCk7Ci0gICAgaWYgKHNlcnZpY2UgPT0gMCkgcmV0dXJuIEFBVURJT19FUlJPUl9OT19TRVJWSUNFOworICAgIGNvbnN0IHNwPElBQXVkaW9TZXJ2aWNlPiBzZXJ2aWNlID0gZ2V0QUF1ZGlvU2VydmljZSgpOworICAgIGlmIChzZXJ2aWNlLmdldCgpID09IG51bGxwdHIpIHJldHVybiBBQVVESU9fRVJST1JfTk9fU0VSVklDRTsKICAgICByZXR1cm4gc2VydmljZS0+cmVnaXN0ZXJBdWRpb1RocmVhZChzdHJlYW1IYW5kbGUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xpZW50VGhyZWFkSWQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgIC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VFJFQU1fU1RBVEVfU1RPUFBJTkcpIHsKICAgICAgICAgICAgICAgICBzZXRTdGF0ZShBQVVESU9fU1RSRUFNX1NUQVRFX1NUT1BQRUQpOwogICAgICAgICAgICAgfQpAQCAtNDI2LDEwICs0NzcsMTQgQEAKICAgICAgICAgICAgIHNldFN0YXRlKEFBVURJT19TVFJFQU1fU1RBVEVfQ0xPU0VEKTsKICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICBjYXNlIEFBVURJT19TRVJWSUNFX0VWRU5UX0RJU0NPTk5FQ1RFRDoKKyAgICAgICAgICAgIC8vIFByZXZlbnQgaGFyZHdhcmUgZnJvbSBsb29waW5nIG9uIG9sZCBkYXRhIGFuZCBtYWtpbmcgYnV6emluZyBzb3VuZHMuCisgICAgICAgICAgICBpZiAoZ2V0RGlyZWN0aW9uKCkgPT0gQUFVRElPX0RJUkVDVElPTl9PVVRQVVQpIHsKKyAgICAgICAgICAgICAgICBtQXVkaW9FbmRwb2ludC5lcmFzZURhdGFNZW1vcnkoKTsKKyAgICAgICAgICAgIH0KICAgICAgICAgICAgIHJlc3VsdCA9IEFBVURJT19FUlJPUl9ESVNDT05ORUNURUQ7CiAgICAgICAgICAgICBzZXRTdGF0ZShBQVVESU9fU1RSRUFNX1NUQVRFX0RJU0NPTk5FQ1RFRCk7CiAgICAgICAgICAgICBBTE9HVygiV0FSTklORyAtIEF1ZGlvU3RyZWFtSW50ZXJuYWw6Om9uRXZlbnRGcm9tU2VydmVyKCkiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICIgQUFVRElPX1NFUlZJQ0VfRVZFTlRfRElTQ09OTkVDVEVEIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICIgQUFVRElPX1NFUlZJQ0VfRVZFTlRfRElTQ09OTkVDVEVEIC0gRklGTyBjbGVhcmVkIik7CiAgICAgICAgICAgICBicmVhazsKICAgICAgICAgY2FzZSBBQVVESU9fU0VSVklDRV9FVkVOVF9WT0xVTUU6CiAgICAgICAgICAg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OwogICAgICAgICAgICAgYnJlYWs7CiAKICAgICAgICAgY2FzZSBBQXVkaW9TZXJ2aWNlTWVzc2FnZTo6Y29kZTo6RVZFTlQ6CkBAIC00NjUsNyArNTUyLDcgQEAKICAgICAgICAgICAgIGJyZWFrOwogCiAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICBBTE9HRSgiV0FSTklORyAtIEF1ZGlvU3RyZWFtSW50ZXJuYWw6OnByb2Nlc3NDb21tYW5kcygpIFVucmVjb2duaXplZCB3aGF0ID0gJWQiLAorICAgICAgICAgICAgQUxPR0UoIldBUk5JTkcgLSBwcm9jZXNzQ29tbWFuZHMoKSBVbnJlY29nbml6ZWQgd2hhdCA9ICVkIiwKICAgICAgICAgICAgICAgICAgKGludCkgbWVzc2FnZS53aGF0KTsKICAgICAgICAgICAgIHJlc3VsdCA9IEFBVURJT19FUlJPUl9JTlRFUk5BTDsKICAgICAgICAgICAgIGJyZWFrOwpAQCAtNTE3LDEyICs2MDQsMTkgQEAKICAgICAgICAgICAgICAgICB3YWtlVGltZU5hbm9zICs9IG1XYWtldXBEZWxheU5hbm9zOwogICAgICAgICAgICAgfQogCisgICAgICAgICAgICBjdXJyZW50VGltZU5hbm9zID0gQXVkaW9DbG9jazo6Z2V0TmFub3NlY29uZHMoKTsKKyAgICAgICAgICAgIGludDY0X3QgZWFybGllc3RXYWtlVGltZSA9IGN1cnJlbnRUaW1lTmFub3MgKyBtTWluaW11bVNsZWVwTmFub3M7CisgICAgICAgICAgICAvLyBHdWFyYW50ZWUgYSBtaW5pbXVtIHNsZWVwIHRpbWUuCisgICAgICAgICAgICBpZiAod2FrZVRpbWVOYW5vcyA8IGVhcmxpZXN0V2FrZVRpbWUpIHsKKyAgICAgICAgICAgICAgICB3YWtlVGltZU5hbm9zID0gZWFybGllc3RXYWtlVGltZTsKKyAgICAgICAgICAgIH0KKwogICAgICAgICAgICAgaWYgKHdha2VUaW1lTmFub3MgPiBkZWFkbGluZU5hbm9zKSB7CiAg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iAgICAgICAgICAgICAgICAgLy8gQ2FsY3VsYXRlIGZyYW1lIHBvc2l0aW9uIGJhc2VkIG9mZiBvZiB0aGUgd3JpdGVDb3VudGVyIGJlY2F1c2UKICAgICAgICAgICAgICAgICAvLyB0aGUgcmVhZENvdW50ZXIgbWlnaHQgaGF2ZSBqdXN0IGFkdmFuY2VkIGluIHRoZSBiYWNrZ3JvdW5kLAogICAgICAgICAgICAgICAgIC8vIGNhdXNpbmcgdXMgdG8gc2xlZXAgdW50aWwgYSBsYXRlciBidXJzdC4KLSAgICAgICAgICAgICAgICBpbnQ2NF90IG5leHRSZWFkUG9zaXRpb24gPSBtQXVkaW9FbmRwb2ludC5nZXREYXRhV3JpdGVDb3VudGVyKCkgKyBtRnJhbWVzUGVyQnVyc3QKKyAgICAgICAgICAgICAgICBpbnQ2NF90IG5leHRQb3NpdGlvbiA9IG1BdWRpb0VuZHBvaW50LmdldERhdGFXcml0ZUNvdW50ZXIoKSArIG1GcmFtZXNQZXJCdXJzdAogICAgICAgICAgICAgICAgICAgICAgICAgLSBtQXVkaW9FbmRwb2ludC5nZXRCdWZmZXJTaXplSW5GcmFtZXMoKTsKLSAgICAgICAgICAgICAgICB3YWtlVGltZSA9IG1DbG9ja01vZGVsLmNvbnZlcnRQb3NpdGlvblRvVGltZShuZXh0UmVhZFBvc2l0aW9uKTsKKyAgICAgICAgICAgICAgICB3YWtlVGltZSA9IG1DbG9ja01vZGVsLmNvbnZlcnRQb3NpdGlvblRvVGltZShuZXh0UG9zaXRpb24pOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgZGVmYXVsdDoKQEAgLTI2Niw3ICsyOTAsNiBAQAogICAgIHJldHVybiBmcmFtZXNXcml0dGVuOwogfQogCi0KIGludDY0X3QgQXVkaW9TdHJlYW1JbnRlcm5hbFBsYXk6OmdldEZyYW1lc1JlYWQoKQogewogICAgIGludDY0X3QgZnJhbWVzUmVhZEhhcmR3YXJlOwpAQ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tU3RhcnQoKSA9PT4gbVBsYXllckJhc2UtPnN0YXJ0KCkgICBtUGxheWVyQmFzZS0+cGxheWVyU3RhcnQoKSA9PT4gcmVxdWVzdFN0YXJ0KCkKKyAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgIFwgICAgICAgICAgICAgICAgICAgICAgICAgICAvCisgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgLS0tLS0tIEF1ZGlvTWFuYWdlciAtLS0tLS0tCisgICAgY2xhc3MgTXlQbGF5ZXJCYXNlIDogcHVibGljIGFuZHJvaWQ6OlBsYXllckJhc2UgeworICAgIHB1YmxpYzoKKyAgICAgICAgZXhwbGljaXQgTXlQbGF5ZXJCYXNlKEF1ZGlvU3RyZWFtICpwYXJlbnQpOworCisgICAgICAgIHZpcnR1YWwgfk15UGxheWVyQmFzZSgpOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBSZWdpc3RlciBmb3Igdm9sdW1lIGNoYW5nZXMgYW5kIHJlbW90ZSBjb250cm9sLgorICAgICAgICAgKi8KKyAgICAgICAgdm9pZCByZWdpc3RlcldpdGhBdWRpb01hbmFnZXIoKTsKKworICAgICAgICAvKioKKyAgICAgICAgICogVW5SZWdpc3Rlci4KKyAgICAgICAgICovCisgICAgICAgIHZvaWQgdW5yZWdpc3RlcldpdGhBdWRpb01hbmFnZXIoKTsKKworICAgICAgICAvKioKKyAgICAgICAgICogSnVzdCBjYWxscyB1bnJlZ2lzdGVyV2l0aEF1ZGlvTWFuYWdlcigpLgorICAgICAgICAgKi8KKyAgICAgICAgdm9pZCBkZXN0cm95KCkgb3ZlcnJpZGU7CisKKyAgICAgICAgdm9pZCBjbGVhclBhcmVudFJlZmVyZW5jZSgpIHsgbVBhcmVudCA9IG51bGxwdHI7IH0KKworICAgICAgICBhbmRyb2lkOjpzdGF0dXNfdCBwbGF5ZXJTdGFydCgpIG92ZXJyaWRlIHsKKyAgICAgICAgICAgIC8vIG1QYXJlbnQgc2hvdWxkIE5PVCBiZSBudW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azo6QnVmZmVyICphdWRpb0J1ZmZlciA9IHN0YXRpY19jYXN0PEF1ZGlvVHJhY2s6OkJ1ZmZlciAqPihpbmZvKTsKLSAgICAgICAgICAgICAgICBpZiAoYXVkaW9CdWZmZXItPmZyYW1lQ291bnQgPT0gMCkgcmV0dXJuOworICAgICAgICAgICAgY2hlY2tGb3JEaXNjb25uZWN0UmVxdWVzdCgpOworCisgICAgICAgICAgICAvLyBOb3RlIHRoYXQgdGhpcyBjb2RlIGFzc3VtZXMgYW4gQXVkaW9UcmFjazo6QnVmZmVyIGlzIHRoZSBzYW1lIGFzCisgICAgICAgICAgICAvLyBBdWRpb1JlY29yZDo6QnVmZmVyCisgICAgICAgICAgICAvLyBUT0RPIGRlZmluZSBvdXIgb3duIEF1ZGlvQnVmZmVyIGFuZCBwYXNzIGl0IGZyb20gdGhlIHN1YmNsYXNzZXMuCisgICAgICAgICAgICBBdWRpb1RyYWNrOjpCdWZmZXIgKmF1ZGlvQnVmZmVyID0gc3RhdGljX2Nhc3Q8QXVkaW9UcmFjazo6QnVmZmVyICo+KGluZm8pOworICAgICAgICAgICAgaWYgKGdldFN0YXRlKCkgPT0gQUFVRElPX1NUUkVBTV9TVEFURV9ESVNDT05ORUNURUQgfHwgIW1DYWxsYmFja0VuYWJsZWQubG9hZCgpKSB7CisgICAgICAgICAgICAgICAgYXVkaW9CdWZmZXItPnNpemUgPSAwOyAvLyBzaWxlbmNlIHRoZSBidWZmZXIKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgaWYgKGF1ZGlvQnVmZmVyLT5mcmFtZUNvdW50ID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgIC8vIElmIHRoZSBjYWxsZXIgc3BlY2lmaWVkIGFuIGV4YWN0IHNpemUgdGhlbiB1c2UgYSBibG9jayBzaXplIGFkYXB0ZXIuCiAgICAgICAgICAgICAgICAgaWYgKG1CbG9ja0FkYXB0ZXIgIT0gbnVsbHB0cikgewpAQCAtODEsNDQgKzEwMSw1OSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1aW50OF90ICopIGF1ZGlvQnVmZmVyLT5yYXcsIGJ5dGVDb3VudCk7CiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgLy8gQ2FsbCB1c2luZyB0aGUgQUF1ZGlvIGNhbGxiYWNrIGludGVyZmFjZS4KLSAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2tSZXN1bHQgPSAoKmdldERhdGFDYWxsYmFja1Byb2MoKSkoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKEFBdWRpb1N0cmVhbSAqKSB0aGlzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldERhdGFDYWxsYmFja1VzZXJEYXRhKCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9CdWZmZXItPnJhdywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb0J1ZmZlci0+ZnJhbWVDb3VudAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7CisgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrUmVzdWx0ID0gY2FsbERhdGFDYWxsYmFja0ZyYW1lcygodWludDhfdCAqKWF1ZGlvQnVmZmVyLT5yYXcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb0J1ZmZlci0+ZnJhbWVDb3VudCk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGlmIChjYWxsYmFja1Jlc3VsdCA9PSBBQVVESU9fQ0FMTEJBQ0tfUkVTVUxUX0NPTlRJTlVFKSB7CiAgICAgICAgICAgICAgICAgICAgIGF1ZGlvQnVmZmVyLT5zaXplID0gYXVkaW9CdWZmZXItPmZyYW1lQ291bnQgKiBnZXRCeXRlc1BlckZyYW1lKCk7Ci0gICAgICAgICAgICAgICAgICAgIGluY3JlbWVudENsaWVudEZyYW1lQ291bnRlcihhdWRpb0J1ZmZlci0+ZnJhbWVDb3VudCk7CiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgYXVkaW9CdWZmZXItPnNpemUgPSAwOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICAvLy8gRkFMTCBUSFJPVUdICiAKLSAgICAgICAgICAgIC8vIFN0cmVhbSBnb3QgcmVyb3V0ZWQgc28gd2UgZGlzY29ubmVjdC4KLSAgICAgICAgY2FzZSBBQVVESU9fQ0FMTEJBQ0tfT1BFUkFUSU9OX0RJU0NPTk5FQ1RFRDogewotICAgICAgICAgICAgc2V0U3RhdGUoQUFVRElPX1NUUkVBTV9TVEFURV9ESVNDT05ORUNURUQpOwotICAgICAgICAgICAgQUxPR0QoInByb2Nlc3NDYWxsYmFja0NvbW1vbigpIHN0cmVhbSBkaXNjb25uZWN0ZWQiKTsKLSAgICAgICAgICAgIGlmIChnZXRFcnJvckNhbGxiYWNrUHJvYygpICE9IG51bGxwdHIpIHsKLSAgICAgICAgICAgICAgICAoKmdldEVycm9yQ2FsbGJhY2tQcm9jKCkpKAotICAgICAgICAgICAgICAgICAgICAgICAgKEFBdWRpb1N0cmVhbSAqKSB0aGlzLAotICAgICAgICAgICAgICAgICAgICAgICAgZ2V0RXJyb3JDYWxsYmFja1VzZXJEYXRhKCksCi0gICAgICAgICAgICAgICAgICAgICAgICBBQVVESU9fRVJST1JfRElTQ09OTkVDVEVECi0gICAgICAgICAgICAgICAgICAgICAgICApOworICAgICAgICAgICAgICAgIGlmICh1cGRhdGVTdGF0ZU1hY2hpbmUoKSAhPSBBQVVESU9fT0spIHsKKyAgICAgICAgICAgICAgICAgICAgZm9yY2VEaXNjb25uZWN0KCk7CisgICAgICAgICAgICAgICAgICAgIG1DYWxsYmFja0V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X1NUQVRFX0RJU0NPTk5FQ1RFRCkgeworICAgICAgICBzZXRTdGF0ZShBQVVESU9fU1RSRUFNX1NUQVRFX0RJU0NPTk5FQ1RFRCk7CisgICAgICAgIGlmIChnZXRFcnJvckNhbGxiYWNrUHJvYygpICE9IG51bGxwdHIpIHsKKyAgICAgICAgICAgICgqZ2V0RXJyb3JDYWxsYmFja1Byb2MoKSkoCisgICAgICAgICAgICAgICAgICAgIChBQXVkaW9TdHJlYW0gKikgdGhpcywKKyAgICAgICAgICAgICAgICAgICAgZ2V0RXJyb3JDYWxsYmFja1VzZXJEYXRhKCksCisgICAgICAgICAgICAgICAgICAgIEFBVURJT19FUlJPUl9ESVNDT05ORUNURUQKKyAgICAgICAgICAgICk7CisgICAgICAgIH0KKyAgICB9Cit9CisKIGFhdWRpb19yZXN1bHRfdCBBdWRpb1N0cmVhbUxlZ2FjeTo6Z2V0QmVzdFRpbWVzdGFtcChjbG9ja2lkX3QgY2xvY2tJZCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludDY0X3QgKmZyYW1lUG9zaXRpb24sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQ2NF90ICp0aW1lTmFub3NlY29uZHMsCkBAIC0xMzYsOCArMTcxLDIzIEBACiAgICAgICAgICAgICByZXR1cm4gQUFVRElPX0VSUk9SX0lMTEVHQUxfQVJHVU1FTlQ7CiAgICAgICAgICAgICBicmVhazsKICAgICB9Ci0gICAgc3RhdHVzX3Qgc3RhdHVzID0gZXh0ZW5kZWRUaW1lc3RhbXAtPmdldEJlc3RUaW1lc3RhbXAoZnJhbWVQb3NpdGlvbiwgdGltZU5hbm9zZWNvbmRzLCB0aW1lYmFzZSk7Ci0gICAgcmV0dXJuIEFBdWRpb0NvbnZlcnRfYW5kcm9pZFRvQUF1ZGlvUmVzdWx0KHN0YXR1cyk7CisgICAgRXh0ZW5kZWRUaW1lc3Rh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8gb3ZlcmZsb3dzIGFuZCB3ZSBsb3NlIG9sZCB2YWx1ZXMuCisgKiBJdCBpcyBhbHNvIE9LIGlmIHdlIHJlYWQgYW4gb2xkIHZhbHVlLgorICogVGhyZWFkIG1heSByZXR1cm4gYSBub24tYXRvbWljIHJlc3VsdCBpZiB0aGUgb3RoZXIgdGhyZWFkIGlzIHJhcGlkbHkgd3JpdGluZworICogbmV3IHZhbHVlcyBvbiBhbm90aGVyIGNvcmUuCisgKi8KK3RlbXBsYXRlIDxjbGFzcyBUPgorY2xhc3MgU2ltcGxlRG91YmxlQnVmZmVyIHsKK3B1YmxpYzoKKyAgICBTaW1wbGVEb3VibGVCdWZmZXIoKQorICAgICAgICAgICAgOiBtVmFsdWVzKCkge30KKworICAgIF9fYXR0cmlidXRlX18oKG5vX3Nhbml0aXplKCJpbnRlZ2VyIikpKQorICAgIHZvaWQgd3JpdGUoVCB2YWx1ZSkgeworICAgICAgICBpbnQgaW5kZXggPSBtQ291bnRlci5sb2FkKCkgJiAxOworICAgICAgICBtVmFsdWVzW2luZGV4XSA9IHZhbHVlOworICAgICAgICBtQ291bnRlcisrOyAvLyBJbmNyZW1lbnQgQUZURVIgdXBkYXRpbmcgc3RvcmFnZSwgT0sgaWYgaXQgd3JhcHMuCisgICAgfQorCisgICAgLyoqCisgICAgICogVGhpcyBzaG91bGQgb25seSBiZSBjYWxsZWQgYnkgdGhlIHNhbWUgdGhyZWFkIHRoYXQgY2FsbHMgd3JpdGUoKSBvciB3aGVuCisgICAgICogbm8gb3RoZXIgdGhyZWFkIGlzIGNhbGxpbmcgd3JpdGUuCisgICAgICovCisgICAgdm9pZCBjbGVhcigpIHsKKyAgICAgICAgbUNvdW50ZXIuc3RvcmUoMCk7CisgICAgfQorCisgICAgVCByZWFkKCkgY29uc3QgeworICAgICAgICBUIHJlc3VsdDsKKyAgICAgICAgaW50IGJlZm9yZTsKKyAgICAgICAgaW50IGFmdGVyOworICAgICAgICBpbnQgdGltZW91dCA9IDM7CisgICAgICAgIGRvIHsKKyAgICAgICAgICAgIC8vIENoZWNrIHRvIHNlZSBpZiBhIHdyaXRlIG9jY3VycmVkIHdoaWxlIHdlcmUgcmVhZGluZy4KKyAgICAgICAgICAgIGJlZm9yZSA9IG1Db3VudGVyLmxvYWQoKTsKKyAgICAgICAgICAgIGludCBpbmRleCA9IChiZWZvcmUgJiAxKSBeIDE7CisgICAgICAgICAgICByZXN1bHQgPSBtVmFsdWVzW2luZGV4XTsKKyAgICAgICAgICAgIGFmdGVyID0gbUNvdW50ZXIubG9hZCgpOworICAgICAgICB9IHdoaWxlICgoYWZ0ZXIgIT0gYmVmb3JlKSAmJiAoYWZ0ZXIgPiAwKSAmJiAoLS10aW1lb3V0ID4gMCkpOworICAgICAgICByZXR1cm4gcmVzdWx0OworICAgIH0KKworICAgIC8qKgorICAgICAqIEByZXR1cm4gdHJ1ZSBpZiBhdCBsZWFzdCBvbmUgdmFsdWUgaGFzIGJlZW4gd3JpdHRlbgorICAgICAqLworICAgIGJvb2wgaXNWYWxpZCgpIGNvbnN0IHsKKyAgICAgICAgcmV0dXJuIG1Db3VudGVyLmxvYWQoKSA+IDA7CisgICAgfQorCitwcml2YXRlOgorICAgIFQgICAgICAgICAgICAgICAgICAgIG1WYWx1ZXNbMl07CisgICAgc3RkOjphdG9taWM8aW50PiAgICAgbUNvdW50ZXJ7MH07Cit9OworCitjbGFzcyBUaW1lc3RhbXAgeworcHVibGljOgorICAgIFRpbWVzdGFtcCgpCisgICAgICAgICAgICA6IG1Qb3NpdGlvbigwKQorICAgICAgICAgICAgLCBtTmFub3NlY29uZHMoMCkge30KKyAgICBUaW1lc3RhbXAoaW50NjRfdCBwb3NpdGlvbiwgaW50NjRfdCBuYW5vc2Vjb25kcykKKyAgICAgICAgICAgIDogbVBvc2l0aW9uKHBvc2l0aW9uKQorICAgICAgICAgICAgLCBtTmFub3NlY29uZHMobmFub3NlY29uZHMpIHt9CisKKyAgICBpbnQ2NF90IGdldFBvc2l0aW9uKCk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BDb3VudCA8IE1BWF9USU1FU1RBTVBTKSB7CisgICAgICAgIFRpbWVzdGFtcEluZm8gKnRpbWVzdGFtcCA9ICZ0aW1lc3RhbXBEYXRhLT50aW1lc3RhbXBzW3RpbWVzdGFtcERhdGEtPnRpbWVzdGFtcENvdW50XTsKKyAgICAgICAgdGltZXN0YW1wLT5yZXN1bHQgPSBBQXVkaW9TdHJlYW1fZ2V0VGltZXN0YW1wKHN0cmVhbSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENMT0NLX01PTk9UT05JQywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZ0aW1lc3RhbXAtPnRpbWVzdGFtcFBvc2l0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnRpbWVzdGFtcC0+dGltZXN0YW1wTmFub3MpOworICAgICAgICB0aW1lc3RhbXAtPmZyYW1lc1RvdGFsID0gdGltZXN0YW1wRGF0YS0+ZnJhbWVzVG90YWw7CisgICAgICAgIHRpbWVzdGFtcC0+YXBwUG9zaXRpb24gPSAoZGlyZWN0aW9uID09IEFBVURJT19ESVJFQ1RJT05fT1VUUFVUKQorICAgICAgICAgICAgICAgID8gQUF1ZGlvU3RyZWFtX2dldEZyYW1lc1dyaXR0ZW4oc3RyZWFtKQorICAgICAgICAgICAgICAgIDogQUF1ZGlvU3RyZWFtX2dldEZyYW1lc1JlYWQoc3RyZWFtKTsKKyAgICAgICAgdGltZXN0YW1wLT5hcHBOYW5vc2Vjb25kcyA9IGdldE5hbm9zZWNvbmRzKCk7CisgICAgICAgIHRpbWVzdGFtcERhdGEtPnRpbWVzdGFtcENvdW50Kys7CisgICAgfQorCisgICAgaWYgKGRpcmVjdGlvbiA9PSBBQVVESU9fRElSRUNUSU9OX09VVFBVVCkgeworICAgICAgICB0aW1lc3RhbXBEYXRhLT5mcmFtZXNU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ocmVzdWx0KSk7CisgICAgICAgICAgICBnb3RvIGZpbmlzaDsKKyAgICAgICAgfQorCisgICAgICAgIGZvciAoaW50IHNlY29uZCA9IDA7IHNlY29uZCA8IE5VTV9TRUNPTkRTOyBzZWNvbmQrKykgeworICAgICAgICAgICAgLy8gR2l2ZSBBQXVkaW8gY2FsbGJhY2sgdGltZSB0byBydW4gaW4gdGhlIGJhY2tncm91bmQuCisgICAgICAgICAgICBzbGVlcCgxKTsKKworICAgICAgICAgICAgLy8gUGVyaW9kaWNhbGx5IHByaW50IHRoZSBwcm9ncmVzcyBzbyB3ZSBrbm93IGl0IGhhc24ndCBkaWVkLgorICAgICAgICAgICAgcHJpbnRmKCJmcmFtZXNXcml0dGVuID0gJWQsIFhSdW5zID0gJWRcbiIsCisgICAgICAgICAgICAgICAgICAgKGludCkgQUF1ZGlvU3RyZWFtX2dldEZyYW1lc1dyaXR0ZW4oYWF1ZGlvU3RyZWFtKSwKKyAgICAgICAgICAgICAgICAgICAoaW50KSBBQXVkaW9TdHJlYW1fZ2V0WFJ1bkNvdW50KGFhdWRpb1N0cmVhbSkKKyAgICAgICAgICAgICk7CisgICAgICAgIH0KKworICAgICAgICByZXN1bHQgPSBBQXVkaW9TdHJlYW1fcmVxdWVzdFN0b3AoYWF1ZGlvU3RyZWFtKTsKKyAgICAgICAgaWYgKHJlc3VsdCAhPSBBQVVESU9fT0spIHsKKyAgICAgICAgICAgIHByaW50ZigiQUF1ZGlvU3RyZWFtX3JlcXVlc3RTdG9wIHJldHVybmVkICVzXG4iLAorICAgICAgICAgICAgICAgICAgIEFBdWRpb19jb252ZXJ0UmVzdWx0VG9UZXh0KHJlc3VsdCkpOworICAgICAgICB9CisKKyAgICAgICAgcHJpbnRmKCJ0aW1lc3RhbXBDb3VudCA9ICVkXG4iLCBzVGltZXN0YW1wRGF0YS50aW1lc3RhbXBDb3VudCk7CisgICAgICAgIGludCBwcmludGVkID0gMDsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBzVGltZXN0YW1wRGF0YS50aW1lc3RhbXBDb3VudDsgaSsrKSB7CisgICAgICAgICAgICBUaW1lc3RhbXBJbmZvICp0aW1lc3RhbXAgPSAmc1RpbWVzdGFtcERhdGEudGltZXN0YW1wc1tpXTsKKyAgICAgICAgICAgIGJvb2wgcG9zQ2hhbmdlZCA9ICh0aW1lc3RhbXAtPnRpbWVzdGFtcFBvc2l0aW9uICE9ICh0aW1lc3RhbXAgLSAxKS0+dGltZXN0YW1wUG9zaXRpb24pOworICAgICAgICAgICAgYm9vbCB0aW1lQ2hhbmdlZCA9ICh0aW1lc3RhbXAtPnRpbWVzdGFtcE5hbm9zICE9ICh0aW1lc3RhbXAgLSAxKS0+dGltZXN0YW1wTmFub3MpOworICAgICAgICAgICAgaWYgKChwcmludGVkIDwgMjApICYmICgoaSA8IDEwKSB8fCBwb3NDaGFuZ2VkIHx8IHRpbWVDaGFuZ2VkKSkgeworICAgICAgICAgICAgICAgIHByaW50ZigiICAlM2QgOiBmcmFtZXMgJThsbGQsIHhmZXJkICU4bGxkIiwgaSwKKyAgICAgICAgICAgICAgICAgICAgICAgKGxvbmcgbG9uZykgdGltZXN0YW1wLT5mcmFtZXNUb3RhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgKGxvbmcgbG9uZykgdGltZXN0YW1wLT5hcHBQb3NpdGlvbik7CisgICAgICAgICAgICAgICAgaWYgKHRpbWVzdGFtcC0+cmVzdWx0ICE9IEFBVURJT19PSykgeworICAgICAgICAgICAgICAgICAgICBwcmludGYoIiwgcmVzdWx0ID0gJXNcbiIsIEFBdWRpb19jb252ZXJ0UmVzdWx0VG9UZXh0KHRpbWVzdGFtcC0+cmVzdWx0KSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgYm9vbCBuZWdhdGl2ZSA9IHRpbWVzdGFtcC0+dGltZXN0YW1wUG9zaXRpb24gPCAwOworICAgICAgICAgICAgICAgICAgICBib29sIHJldHJvID0gKGkgPiAwICYmICh0aW1lc3RhbXAtPnRpbWVzdGFtcFBvc2l0aW9uIDwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRpbWVzdGFtcCAtIDEpLT50aW1lc3RhbXBQb3NpdGlvbikpOworICAgICAgICAgICAgICAgICAgICBjb25zdCBjaGFyICptZXNzYWdlID0gbmVnYXRpdmUgPyAiIDw9TkVHQVRJVkUhIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAocmV0cm8gPyAiICA8PSBSRVRST0dSQURFISIgOiAiIik7CisKKyAgICAgICAgICAgICAgICAgICAgZG91YmxlIGxhdGVuY3kgPSBjYWxjdWxhdGVMYXRlbmN5TWlsbGlzKHRpbWVzdGFtcC0+dGltZXN0YW1wUG9zaXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lc3RhbXAtPnRpbWVzdGFtcE5hbm9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGltZXN0YW1wLT5hcHBQb3NpdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVzdGFtcC0+YXBwTmFub3NlY29uZHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY3R1YWxTYW1wbGVSYXRlKTsKKyAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCIsIFNUQU1QOiBwb3MgPSAlOGxsZCwgbmFub3MgPSAlOGxsZCwgbGF0ID0gJTcuMWYgbXNlYyAlc1xuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIChsb25nIGxvbmcpIHRpbWVzdGFtcC0+dGltZXN0YW1wUG9zaXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAobG9uZyBsb25nKSB0aW1lc3RhbXAtPnRpbWVzdGFtcE5hbm9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgbGF0ZW5jeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBwcmludGVkKys7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyBBdm9pZCByYWNlIGNvbmRpdGlvbnMgaW4gQXVkaW9GbGluZ2VyLgorICAgICAgICAvLyBUaGVyZSBpcyBub3JtYWxseSBhIGRlbGF5IGJldHdlZW4gYSByZWFsIHVzZXIgc3RvcHBpbmcgYW5kIHJlc3RhcnRpbmcgYSBzdHJlYW0uCisgICAgICAgIHNsZWVwKDEpOworICAgIH0KKworZmluaXNoOgorICAgIGlmIChhYXVkaW9TdHJlYW0gIT0gbnVsbHB0cikgeworICAgICAgICBBQXVkaW9TdHJlYW1fY2xvc2UoYWF1ZGlvU3RyZWFtKTsKKyAgICB9CisgICAgQUF1ZGlvU3RyZWFtQnVpbGRlcl9kZWxldGUoYWF1ZGlvQnVpbGRlcik7CisgICAgcHJpbnRmKCJyZXN1bHQgPSAlZCA9ICVzXG4iLCByZXN1bHQsIEFBdWRpb19jb252ZXJ0UmVzdWx0VG9UZXh0KHJlc3VsdCkpOworCisgICAgcmV0dXJuIHJlc3VsdDsKK30KKworaW50IG1haW4oaW50IGFyZ2MsIGNoYXIgKiphcmd2KSB7CisgICAgKHZvaWQpIGFyZ2M7CisgICAgKHZvaWQgKikgYXJndjsKKworICAgIGFhdWRpb19yZXN1bHRfdCByZXN1bHQgPSBBQVVESU9fT0s7CisKKyAgICAvLyBNYWtlIHByaW50ZiBwcmludCBpbW1lZGlhdGVseSBzbyB0aGF0IGRlYnVnIGluZm8gaXMgbm90IHN0dWNrCisgICAgLy8gaW4gYSBidWZmZXIgaWYgd2UgaGFuZyBvciBjcmFzaC4KKyAgICBzZXR2YnVmKHN0ZG91dCwgbnVsbHB0ciwgX0lPTkJGLCAoc2l6ZV90KSAwKTsKKworICAgIHByaW50ZigiVGVzdCBUaW1lc3RhbXBzIFYwLjEuM1xuIik7CisKKyAgICAvLyBMZWdhY3kKKyAgICBhYXVkaW9fcG9saWN5X3QgcG9saWN5ID0gQUFVRElPX1BPTElDWV9ORVZFUjsKKyAgICByZXN1bHQgPSB0ZXN0VGltZVN0YW1wcyhwb2xpY3ksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgQUFVRElPX1NIQVJJTkdfTU9ERV9TSEFSRUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgQUFVRElPX1BFUkZPUk1BTkNFX01PREVfTk9ORSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBQVVESU9fRElSRUNUSU9OX0lOUFVUKTsKKyAgICByZXN1bHQgPSB0ZXN0VGltZVN0YW1wcyhwb2xpY3ksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgQUFVRElPX1NIQVJJTkdfTU9ERV9TSEFSRUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgQUFVRElPX1BFUkZPUk1BTkNFX01PREVfTE9XX0xBVEVOQ1ksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgQUFVRElPX0RJUkVDVElPTl9JTlBVVCk7CisgICAgcmVzdWx0ID0gdGVzdFRpbWVTdGFtcHMocG9saWN5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFBVURJT19TSEFSSU5HX01PREVfU0hBUkVELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFBVURJT19QRVJGT1JNQU5DRV9NT0RFX05PTkUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgQUFVRElPX0RJUkVDVElPTl9PVVRQVVQpOworICAgIHJlc3VsdCA9IHRlc3RUaW1lU3RhbXBzKHBvbGljeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBQVVESU9fU0hBUklOR19NT0RFX1NIQVJFRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBQVVESU9fUEVSRk9STUFOQ0VfTU9ERV9MT1dfTEFURU5DWSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBQVVESU9fRElSRUNUSU9OX09VVFBVVCk7CisKKyAgICAvLyBNTUFQCisgICAgcG9saWN5ID0gQUFVRElPX1BPTElDWV9BTFdBWVM7CisgICAgcmVzdWx0ID0gdGVzdFRpbWVTdGFtcHMocG9saWN5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFBVURJT19TSEFSSU5HX01PREVfRVhDTFVTSVZFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFBVURJT19QRVJGT1JNQU5DRV9NT0RFX0xPV19MQVRFTkNZLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFBVURJT19ESVJFQ1RJT05fSU5QVVQpOworICAgIHJlc3VsdCA9IHRlc3RUaW1lU3RhbXBzKHBvbGljeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBQVVESU9fU0hBUklOR19NT0RFX0VYQ0xVU0lWRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBQVVESU9fUEVSRk9STUFOQ0VfTU9ERV9MT1dfTEFURU5DWSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBQVVESU9fRElSRUNUSU9OX09VVFBVVCk7CisgICAgcmVzdWx0ID0gdGVzdFRpbWVTdGFtcHMocG9saWN5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFBVURJT19TSEFSSU5HX01PREVfU0hBUkVELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFBVURJT19QRVJGT1JNQU5DRV9NT0RFX0xPV19MQVRFTkNZLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFBVURJT19ESVJFQ1RJT05fSU5QVVQpOworICAgIHJlc3VsdCA9IHRlc3RUaW1lU3RhbXBzKHBvbGljeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBQVVESU9fU0hBUklOR19NT0RFX1NIQVJFRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBQVVESU9fUEV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ICAgbURldmljZUNhbGxiYWNrID0gMDsKICAgICByZXR1cm4gTk9fRVJST1I7CiB9CiAKK3ZvaWQgQXVkaW9SZWNvcmQ6Om9uQXVkaW9EZXZpY2VVcGRhdGUoYXVkaW9faW9faGFuZGxlX3QgYXVkaW9JbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX3BvcnRfaGFuZGxlX3QgZGV2aWNlSWQpCit7CisgICAgc3A8QXVkaW9TeXN0ZW06OkF1ZGlvRGV2aWNlQ2FsbGJhY2s+IGNhbGxiYWNrOworICAgIHsKKyAgICAgICAgQXV0b011dGV4IGxvY2sobUxvY2spOworICAgICAgICBpZiAoYXVkaW9JbyAhPSBtSW5wdXQpIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICBjYWxsYmFjayA9IG1EZXZpY2VDYWxsYmFjay5wcm9tb3RlKCk7CisgICAgICAgIC8vIG9ubHkgdXBkYXRlIGRldmljZSBpZiB0aGUgcmVjb3JkIGlzIGFjdGl2ZSBhcyByb3V0ZSBjaGFuZ2VzIGR1ZSB0byBvdGhlciB1c2UgY2FzZXMgYXJlCisgICAgICAgIC8vIGlycmVsZXZhbnQgZm9yIHRoaXMgY2xpZW50CisgICAgICAgIGlmIChtQWN0aXZlKSB7CisgICAgICAgICAgICBtUm91dGVkRGV2aWNlSWQgPSBkZXZpY2VJZDsKKyAgICAgICAgfQorICAgIH0KKyAgICBpZiAoY2FsbGJhY2suZ2V0KCkgIT0gbnVsbHB0cikgeworICAgICAgICBjYWxsYmFjay0+b25BdWRpb0RldmljZVVwZGF0ZShtSW5wdXQsIG1Sb3V0ZWREZXZpY2VJZCk7CisgICAgfQorfQorCiAvLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAKIHZvaWQgQXVkaW9SZWNvcmQ6OkRlYXRoTm90aWZpZXI6OmJpbmRlckRpZWQoY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9yX2woaW9EZXNjLT5tSW9IYW5kbGUpOwogICAgICAgICAgICAgaWYgKG9sZERlc2MgPT0gMCkgewogICAgICAgICAgICAgICAgIG1Jb0Rlc2NyaXB0b3JzLmFkZChpb0Rlc2MtPm1Jb0hhbmRsZSwgaW9EZXNjKTsKQEAgLTUxMSwxMyArNTEzLDE5IEBACiAKICAgICAgICAgICAgIGlmIChpb0Rlc2MtPmdldERldmljZUlkKCkgIT0gQVVESU9fUE9SVF9IQU5ETEVfTk9ORSkgewogICAgICAgICAgICAgICAgIGRldmljZUlkID0gaW9EZXNjLT5nZXREZXZpY2VJZCgpOwotICAgICAgICAgICAgICAgIHNzaXplX3QgaW9JbmRleCA9IG1BdWRpb0RldmljZUNhbGxiYWNrcy5pbmRleE9mS2V5KGlvRGVzYy0+bUlvSGFuZGxlKTsKLSAgICAgICAgICAgICAgICBpZiAoaW9JbmRleCA+PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrcyA9IG1BdWRpb0RldmljZUNhbGxiYWNrcy52YWx1ZUF0KGlvSW5kZXgpOworICAgICAgICAgICAgICAgIGlmIChldmVudCA9PSBBVURJT19PVVRQVVRfT1BFTkVEIHx8IGV2ZW50ID09IEFVRElPX0lOUFVUX09QRU5FRCkgeworICAgICAgICAgICAgICAgICAgICBzc2l6ZV90IGlvSW5kZXggPSBtQXVkaW9EZXZpY2VDYWxsYmFja3MuaW5kZXhPZktleShpb0Rlc2MtPm1Jb0hhbmRsZSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChpb0luZGV4ID49IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrcyA9IG1BdWRpb0RldmljZUNhbGxiYWNrcy52YWx1ZUF0KGlvSW5kZXgpOworICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQotICAgICAgICAgICAgQUxPR1YoImlvQ29uZmlnQ2hhbmdlZCgpIG5ldyAlcyBvcGVuZWQgJWQgc2FtcGxpbmdSYXRlICV1LCBmb3JtYXQgJSN4IGNoYW5uZWwgbWFzayAlI3ggIgotICAgICAgICAgICAgICAgICAgICAiZnJhbWVDb3VudCAlenUgZGV2aWNlSWQgJWQiLCBldmVudCA9PSBBVURJT19PVVRQVVRfT1BFTkVEID8gIm91dHB1dCIgOiAiaW5wdXQiLAorICAgICAgICAgICAgQUxPR1YoImlvQ29uZmlnQ2hhbmdlZCgpIG5ldyAlcyAlcyAlZCBzYW1wbGluZ1JhdGUgJXUsIGZvcm1hdCAlI3ggY2hhbm5lbCBtYXNrICUjeCAiCisgICAgICAgICAgICAgICAgICAgICJmcmFtZUNvdW50ICV6dSBkZXZpY2VJZCAlZCIsCisgICAgICAgICAgICAgICAgICAgIGV2ZW50ID09IEFVRElPX09VVFBVVF9PUEVORUQgfHwgZXZlbnQgPT0gQVVESU9fT1VUUFVUX1JFR0lTVEVSRUQgPworICAgICAgICAgICAgICAgICAgICAgICAgICAgICJvdXRwdXQiIDogImlucHV0IiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudCA9PSBBVURJT19PVVRQVVRfT1BFTkVEIHx8IGV2ZW50ID09IEFVRElPX0lOUFVUX09QRU5FRCA/CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIm9wZW5lZCIgOiAicmVnaXN0ZXJlZCIsCiAgICAgICAgICAgICAgICAgICAgIGlvRGVzYy0+bUlvSGFuZGxlLCBpb0Rlc2MtPm1TYW1wbGluZ1JhdGUsIGlvRGVzYy0+bUZvcm1hdCwgaW9EZXNjLT5tQ2hhbm5lbE1hc2ssCiAgICAgICAgICAgICAgICAgICAgIGlvRGVzYy0+bUZyYW1lQ291bnQsIGlvRGVzYy0+Z2V0RGV2aWNlSWQoKSk7CiAgICAgICAgICAgICB9IGJyZWFrOwpAQCAtNTYzLDkgKzU3MSwyMyBAQAogICAgICAgICB9IGJyZWFrOwogICAgICAgICB9CiAgICAgfQorICAgIGJvb2wgY2FsbGJhY2tSZ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G9Ocyh0aW1lc3RhbXAubVRpbWUpOworICAgICAgICAgICAgICAgICAgICBjb25zdCBpbnQ2NF90IGF0ID0gYXVkaW9fdXRpbHNfbnNfZnJvbV90aW1lc3BlYygmdGltZXN0YW1wLm1UaW1lKTsKICAgICAgICAgICAgICAgICAgICAgY29uc3QgaW50NjRfdCBsYWcgPQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIChldHMubVRpbWVOc1tFeHRlbmRlZFRpbWVzdGFtcDo6TE9DQVRJT05fU0VSVkVSX0xBU1RLRVJORUxPS10gPCAwIHx8CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV0cy5tVGltZU5zW0V4dGVuZGVkVGltZXN0YW1wOjpMT0NBVElPTl9LRVJORUxfTEFTVEtFUk5FTE9LXSA8IDApCkBAIC0yNTc1LDggKzI2MDYsNyBAQAogICAgICAgICAgICAgICAgICAgICBpZiAoYXQgPCBsaW1pdCkgewogICAgICAgICAgICAgICAgICAgICAgICAgQUxPR1YoInRpbWVzdGFtcCBwYXVzZSBsYWc6JWxsZCBhZGp1c3RpbmcgZnJvbSAlbGxkIHRvICVsbGQiLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobG9uZyBsb25nKWxhZywgKGxvbmcgbG9uZylhdCwgKGxvbmcgbG9uZylsaW1pdCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0aW1lc3RhbXAubVRpbWUudHZfc2VjID0gbGltaXQgLyBOQU5PU19QRVJfU0VDT05EOwotICAgICAgICAgICAgICAgICAgICAgICAgdGltZXN0YW1wLm1UaW1lLnR2X25zZWMgPSBsaW1pdCAlIE5BTk9TX1BFUl9TRUNPTkQ7IC8vIGNvbXBpbGVyIG9wdC4KKyAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVzdGFtcC5tVGltZSA9IGNvbnZlcnROc1RvVGltZXNwZWMobGltaXQpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIC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W1lVXMgPCBtU3RhcnRVcykgeworICAgICAgICAgICAgICAgIGlmICh0aW1lc3RhbXBUaW1lVXMgPCBtU3RhcnRGcm9tWmVyb1VzKSB7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBXT1VMRF9CTE9DSzsgIC8vIHN0YWxlIHRpbWVzdGFtcCB0aW1lLCBvY2N1cnMgYmVmb3JlIHN0YXJ0LgogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBjb25zdCBpbnQ2NF90IGRlbHRhVGltZVVzID0gdGltZXN0YW1wVGltZVVzIC0gbVN0YXJ0VXM7CisgICAgICAgICAgICAgICAgY29uc3QgaW50NjRfdCBkZWx0YVRpbWVVcyA9IHRpbWVzdGFtcFRpbWVVcyAtIG1TdGFydEZyb21aZXJvVXM7CiAgICAgICAgICAgICAgICAgY29uc3QgaW50NjRfdCBkZWx0YVBvc2l0aW9uQnlVcyA9IChkb3VibGUpdGltZXN0YW1wLm1Qb3NpdGlvbiAqIDEwMDAwMDAKICAgICAgICAgICAgICAgICAgICAgICAgIC8gKChkb3VibGUpbVNhbXBsZVJhdGUgKiBtUGxheWJhY2tSYXRlLm1TcGVlZCk7CiAKQEAgLTI2NTMsMTAgKzI2ODMsMTAgQEAKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFdPVUxEX0JMT0NLOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBpZiAoZGVsdGFQb3NpdGlvbkJ5VXMgIT0gMCkgewotICAgICAgICAgICAgICAgICAgICBtU3RhcnRVcyA9IDA7IC8vIGRvbid0IGNoZWNrIGFnYWluLCB3ZSBnb3QgdmFsaWQgbm9uemVybyBwb3NpdGlvbi4KKyAgICAgICAgICAgICAgICAgICAgbVN0YXJ0RnJvbVplcm9VcyA9IDA7IC8vIGRvbid0IGNoZWNrIGFnYWluLCB3ZSBnb3QgdmFsaWQgbm9uemVybyBwb3NpdGlvbi4KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB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21fdGltZXNwZWMoJm1QcmV2aW91c1RpbWVzdGFtcC5tVGltZSk7CisgICAgICAgICAgICBpbnQ2NF90IGN1cnJlbnRUaW1lTmFub3MgPSBhdWRpb191dGlsc19uc19mcm9tX3RpbWVzcGVjKCZ0aW1lc3RhbXAubVRpbWUpOworCisgICAgICAgICAgICAvLyBGaXggc3RhbGUgdGltZSB3aGVuIGNoZWNraW5nIHRpbWVzdGFtcCByaWdodCBhZnRlciBzdGFydCgpLgorICAgICAgICAgICAgLy8KKyAgICAgICAgICAgIC8vIEZvciBvZmZsb2FkIGNvbXBhdGliaWxpdHksIHVzZSBhIGRlZmF1bHQgbGFnIHZhbHVlIGhlcmUuCisgICAgICAgICAgICAvLyBBbnkgdGltZSBkaXNjcmVwYW5jeSBiZXR3ZWVuIHRoaXMgdXBkYXRlIGFuZCB0aGUgcGF1c2UgdGltZXN0YW1wIGlzIGhhbmRsZWQKKyAgICAgICAgICAgIC8vIGJ5IHRoZSByZXRyb2dyYWRlIGNoZWNrIGFmdGVyd2FyZHMuCisgICAgICAgICAgICBjb25zdCBpbnQ2NF90IGxhZ05zID0gaW50NjRfdChtQWZMYXRlbmN5ICogMTAwMDAwMExMKTsKKyAgICAgICAgICAgIGNvbnN0IGludDY0X3QgbGltaXROcyA9IG1TdGFydE5zIC0gbGFnTnM7CisgICAgICAgICAgICBpZiAoY3VycmVudFRpbWVOYW5vcyA8IGxpbWl0TnMpIHsKKyAgICAgICAgICAgICAgICBBTE9HRCgiY29ycmVjdGluZyB0aW1lc3RhbXAgdGltZSBmb3IgcGF1c2UsICIKKyAgICAgICAgICAgICAgICAgICAgICAgICJjdXJyZW50VGltZU5hbm9zOiAlbGxkIDwgbGltaXROczogJWxsZCA8IG1TdGFydE5zOiAlbGxkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIChsb25nIGxvbmcpY3VycmVudFRpbWVOYW5vcywgKGxvbmcgbG9uZylsaW1pdE5zLCAobG9uZyBsb25nKW1TdGFydE5zKTsKKyAgICAgICAgICAgICAgICB0aW1lc3RhbXAubVRpbWUgPSBjb252ZXJ0TnNUb1RpbWVzcGVjKGxpbWl0TnMpOworICAgICAgICAgICAgICAgIGN1cnJlbnRUaW1lTmFub3MgPSBsaW1pdE5zOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyByZXRyb2dyYWRlIGNoZWNrCiAgICAgICAgICAgICBpZiAoY3VycmVudFRpbWVOYW5vcyA8IHByZXZpb3VzVGltZU5hbm9zKSB7CiAgICAgICAgICAgICAgICAgQUxPR1coInJldHJvZ3JhZGUgdGltZXN0YW1wIHRpbWUgY29ycmVjdGVkLCAlbGxkIDwgJWxsZCIsCiAgICAgICAgICAgICAgICAgICAgICAgICAobG9uZyBsb25nKWN1cnJlbnRUaW1lTmFub3MsIChsb25nIGxvbmcpcHJldmlvdXNUaW1lTmFub3MpOwogICAgICAgICAgICAgICAgIHRpbWVzdGFtcC5tVGltZSA9IG1QcmV2aW91c1RpbWVzdGFtcC5tVGltZTsKKyAgICAgICAgICAgICAgICAvLyBjdXJyZW50VGltZU5hbm9zIG5vdCB1c2VkIGJlbG93LgogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAvLyBMb29raW5nIGF0IHNpZ25lZCBkZWx0YSB3aWxsIHdvcmsgZXZlbiB3aGVuIHRoZSB0aW1lc3RhbXBzCkBAIC0yNzI2LDcgKzI3NzYsNyBAQAogI2lmIDAKICAgICAgICAgICAgIC8vIFVuY29tbWVudCB0aGlzIHRvIHZlcmlmeSBhdWRpbyB0aW1lc3RhbXAgcmF0ZS4KICAgICAgICAgICAgIGNvbnN0IGludDY0X3QgZGVsdGFUaW1lID0KLSAgICAgICAgICAgICAgICAgICAgY29udmVydFRpbWVzcGVjVG9Ocyh0aW1lc3RhbXAubVRpbWUpIC0gcHJldmlvdXNUaW1lTmFub3M7CisgICAgICAgICAgICAgICAgICAgIGF1ZGlvX3V0aWxzX25zX2Zyb21fdGltZXNwZWMoJnRpbWVzdGFtcC5tVGltZSkgLSBwcmV2aW91c1RpbWVOYW5vczsKICAgICAgICAgICAgIGlmIChkZWx0YVRpbWUgIT0gMCkgewogICAgICAgICAgICAgICAgIGNvbnN0IGludDY0X3QgY29tcHV0ZWRTYW1wbGVSYXRlID0KICAgICAgICAgICAgICAgICAgICAgICAgIGRlbHRhUG9zaXRpb24gKiAobG9uZyBsb25nKU5BTk9TX1BFUl9TRUNPTkQgLyBkZWx0YVRpbWU7CkBAIC0yODE4LDcgKzI4NjgsNyBAQAogICAgICAgICByZXR1cm4gQkFEX1ZBTFVFOwogICAgIH0KICAgICBBdXRvTXV0ZXggbG9jayhtTG9jayk7Ci0gICAgaWYgKG1EZXZpY2VDYWxsYmFjayA9PSBjYWxsYmFjaykgeworICAgIGlmIChtRGV2aWNlQ2FsbGJhY2sudW5zYWZlX2dldCgpID09IGNhbGxiYWNrLmdldCgpKSB7CiAgICAgICAgIEFMT0dXKCIlcyBhZGRpbmcgc2FtZSBjYWxsYmFjayEiLCBfX0ZVTkNUSU9OX18pOwogICAgICAgICByZXR1cm4gSU5WQUxJRF9PUEVSQVRJT047CiAgICAgfQpAQCAtMjgyNiw5ICsyODc2LDkgQEAKICAgICBpZiAobU91dHB1dCAhPSBBVURJT19JT19IQU5ETEVfTk9ORSkgewogICAgICAgICBpZiAobURldmljZUNhbGxiYWNrICE9IDApIHsKICAgICAgICAgICAgIEFMT0dXKCIlcyBjYWxsYmFjayBhbHJlYWR5IHByZXNlbnQhIiwgX19GVU5DVElPTl9fKTsKLSAgICAgICAgICAgIEF1ZGlvU3lzdGVtOjpyZW1vdmVBdWRpb0RldmljZUNhbGxiYWNrKG1EZXZpY2VDYWxsYmFjaywgbU91dHB1dCk7CisgICAgICAgICAgICBBdWRpb1N5c3RlbTo6cmVtb3ZlQXVkaW9EZXZpY2VDYWxsYmFjayh0aGlzLCBtT3V0cHV0KTsKICAgICAgICAgfQotICAgICAgICBzdGF0dXMgPSBBdWRpb1N5c3RlbTo6YWRkQXVkaW9EZXZpY2VDY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hhbmRsZV90IGRldmljZUlkKQoreworICAgIHNwPEF1ZGlvU3lzdGVtOjpBdWRpb0RldmljZUNhbGxiYWNrPiBjYWxsYmFjazsKKyAgICB7CisgICAgICAgIEF1dG9NdXRleCBsb2NrKG1Mb2NrKTsKKyAgICAgICAgaWYgKGF1ZGlvSW8gIT0gbU91dHB1dCkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGNhbGxiYWNrID0gbURldmljZUNhbGxiYWNrLnByb21vdGUoKTsKKyAgICAgICAgLy8gb25seSB1cGRhdGUgZGV2aWNlIGlmIHRoZSB0cmFjayBpcyBhY3RpdmUgYXMgcm91dGUgY2hhbmdlcyBkdWUgdG8gb3RoZXIgdXNlIGNhc2VzIGFyZQorICAgICAgICAvLyBpcnJlbGV2YW50IGZvciB0aGlzIGNsaWVudAorICAgICAgICBpZiAobVN0YXRlID09IFNUQVRFX0FDVElWRSkgeworICAgICAgICAgICAgbVJvdXRlZERldmljZUlkID0gZGV2aWNlSWQ7CisgICAgICAgIH0KKyAgICB9CisgICAgaWYgKGNhbGxiYWNrLmdldCgpICE9IG51bGxwdHIpIHsKKyAgICAgICAgY2FsbGJhY2stPm9uQXVkaW9EZXZpY2VVcGRhdGUobU91dHB1dCwgbVJvdXRlZERldmljZUlkKTsKKyAgICB9Cit9CisKIHN0YXR1c190IEF1ZGlvVHJhY2s6OnBlbmRpbmdEdXJhdGlvbihpbnQzMl90ICptc2VjLCBFeHRlbmRlZFRpbWVzdGFtcDo6TG9jYXRpb24gbG9jYXRpb24pCiB7CiAgICAgaWYgKG1zZWMgPT0gbnVsbHB0ciB8fApAQCAtMjkxMCw3ICsyOTgyLDcgQEAKICAgICBjYXNlIFNUQVRFX1NUT1BQRUQ6CiAgICAgICAgIGlmIChpc09mZmxvYWRlZE9yRGlyZWN0X2woKSkgewogICAgICAgICAgICAgLy8gY2hlY2sgaWYgd2UgaGF2ZSBzdGFydGVkIGluIHRoZSBwYXN0IHRvIHJldHVyb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c2VfdCAqY2xpZW50Q29uZmlnLAorICAgIHZvaWQgb25SZWNvcmRpbmdDb25maWd1cmF0aW9uVXBkYXRlKGludCBldmVudCwgY29uc3QgcmVjb3JkX2NsaWVudF9pbmZvX3QgKmNsaWVudEluZm8sCisgICAgICAgICAgICBjb25zdCBhdWRpb19jb25maWdfYmFzZV90ICpjbGllbnRDb25maWcsCiAgICAgICAgICAgICBjb25zdCBhdWRpb19jb25maWdfYmFzZV90ICpkZXZpY2VDb25maWcsIGF1ZGlvX3BhdGNoX2hhbmRsZV90IHBhdGNoSGFuZGxlKSB7CiAgICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKICAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElBdWRpb1BvbGljeVNlcnZpY2VDbGllbnQ6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7CiAgICAgICAgIGRhdGEud3JpdGVJbnQzMihldmVudCk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnQzMihzZXNzaW9uKTsKLSAgICAgICAgZGF0YS53cml0ZUludDMyKHNvdXJjZSk7CisgICAgICAgIHdyaXRlUmVjb3JkQ2xpZW50SW5mb0Zyb21QYXJjZWwoZGF0YSwgY2xpZW50SW5mbyk7CiAgICAgICAgIHdyaXRlQXVkaW9Db25maWdCYXNlVG9QYXJjZWwoZGF0YSwgY2xpZW50Q29uZmlnKTsKICAgICAgICAgd3JpdGVBdWRpb0NvbmZpZ0Jhc2VUb1BhcmNlbChkYXRhLCBkZXZpY2VDb25maWcpOwogICAgICAgICBkYXRhLndyaXRlSW50MzIocGF0Y2hIYW5kbGUpOwpAQCAtMTIzLDE0ICsxMzQsMTQgQEAKICAgICBjYXNlIFJFQ09SRElOR19DT05GSUdVUkFUSU9OX1VQREFURTogewogICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElBdWRpb1BvbGljeVNlcnZpY2VDbGllbnQsIGRhdGEsIHJlcGx5KTsKICAgICAgICAgICAgIGludCBldmVudCA9IChpbnQpIGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBhdWRpb19zZXNzaW9uX3Qgc2Vzc2lvbiA9IChhdWRpb19zZXNzaW9uX3QpIGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBhdWRpb19zb3VyY2VfdCBzb3VyY2UgPSAoYXVkaW9fc291cmNlX3QpIGRhdGEucmVhZEludDMyKCk7CisgICAgICAgICAgICByZWNvcmRfY2xpZW50X2luZm9fdCBjbGllbnRJbmZvOwogICAgICAgICAgICAgYXVkaW9fY29uZmlnX2Jhc2VfdCBjbGllbnRDb25maWc7CiAgICAgICAgICAgICBhdWRpb19jb25maWdfYmFzZV90IGRldmljZUNvbmZpZzsKKyAgICAgICAgICAgIHJlYWRSZWNvcmRDbGllbnRJbmZvRnJvbVBhcmNlbChkYXRhLCAmY2xpZW50SW5mbyk7CiAgICAgICAgICAgICByZWFkQXVkaW9Db25maWdCYXNlRnJvbVBhcmNlbChkYXRhLCAmY2xpZW50Q29uZmlnKTsKICAgICAgICAgICAgIHJlYWRBdWRpb0NvbmZpZ0Jhc2VGcm9tUGFyY2VsKGRhdGEsICZkZXZpY2VDb25maWcpOwogICAgICAgICAgICAgYXVkaW9fcGF0Y2hfaGFuZGxlX3QgcGF0Y2hIYW5kbGUgPSAoYXVkaW9fcGF0Y2hfaGFuZGxlX3QpIGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBvblJlY29yZGluZ0NvbmZpZ3VyYXRpb25VcGRhdGUoZXZlbnQsIHNlc3Npb24sIHNvdXJjZSwgJmNsaWVudENvbmZpZywgJmRldmljZUNvbmZpZywKKyAgICAgICAgICAgIG9uUmVjb3JkaW5nQ29uZmlndXJhdGlvblVwZGF0ZShldmVudCwgJmNsaWVudEluZm8sICZjbGllbnRDb25maWcsICZkZXZpY2VDb25maWcsCiAgICAgICAgICAgICAgICAgICAgIHBhdGNoSGFuZGxlKTsKICAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKIC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xiYWNrPiA+ID4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BdWRpb0RldmljZUNhbGxiYWNrczsKICAgICAgICAgLy8gY2FjaGVkIHZhbHVlcyBmb3IgcmVjb3JkaW5nIGdldElucHV0QnVmZmVyU2l6ZSgpIHF1ZXJpZXMKICAgICAgICAgc2l6ZV90ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUluQnVmZlNpemU7ICAgIC8vIHplcm8gaW5kaWNhdGVzIGNhY2hlIGlzIGludmFsaWQKQEAgLTQ0MCw4ICs0NDAsOSBAQAogICAgICAgICB2aXJ0dWFsIHZvaWQgb25BdWRpb1BvcnRMaXN0VXBkYXRlKCk7CiAgICAgICAgIHZpcnR1YWwgdm9pZCBvbkF1ZGlvUGF0Y2hMaXN0VXBkYXRlKCk7CiAgICAgICAgIHZpcnR1YWwgdm9pZCBvbkR5bmFtaWNQb2xpY3lNaXhTdGF0ZVVwZGF0ZShTdHJpbmc4IHJlZ0lkLCBpbnQzMl90IHN0YXRlKTsKLSAgICAgICAgdmlydHVhbCB2b2lkIG9uUmVjb3JkaW5nQ29uZmlndXJhdGlvblVwZGF0ZShpbnQgZXZlbnQsIGF1ZGlvX3Nlc3Npb25fdCBzZXNzaW9uLAotICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fc291cmNlX3Qgc291cmNlLCBjb25zdCBhdWRpb19jb25maWdfYmFzZV90ICpjbGllbnRDb25maWcsCisgICAgICAgIHZpcnR1YWwgdm9pZCBvblJlY29yZGluZ0NvbmZpZ3VyYXRpb25VcGRhdGUoaW50IGV2ZW50LAorICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgcmVjb3JkX2NsaWVudF9pbmZvX3QgKmNsaWVudEluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBhdWRpb19jb25maWdfYmFzZV90ICpjbGllbnRDb25maWcsCiAgICAgICAgICAgIC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F5YmFjayBvZiBwdXJlIFBDTQogICAgICAqIChtaXhhYmxlIHdpdGhvdXQgZW1iZWRkZWQgdGltaW5nKSBkYXRhIHJlbWFpbmluZyBpbiBBdWRpb1RyYWNrLgogICAgICAqCkBAIC05NzQsNiArOTg0LDggQEAKIAogICAgICAgICAgICAgdm9pZCAgICAgcmVzdGFydElmRGlzYWJsZWQoKTsKIAorICAgICAgICAgICAgdm9pZCAgICAgdXBkYXRlUm91dGVkRGV2aWNlSWRfbCgpOworCiAgICAgLy8gTmV4dCA0IGZpZWxkcyBtYXkgYmUgY2hhbmdlZCBpZiBJQXVkaW9UcmFjayBpcyByZS1jcmVhdGVkLCBidXQgYWx3YXlzICE9IDAKICAgICBzcDxJQXVkaW9UcmFjaz4gICAgICAgICBtQXVkaW9UcmFjazsKICAgICBzcDxJTWVtb3J5PiAgICAgICAgICAgICBtQ2Jsa01lbW9yeTsKQEAgLTEwODUsOCArMTA5NywxMCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHJlc2V0IGJ5IHN0b3AoKSBidXQgY29udGludWVzIG1vbm90b25pY2FsbHkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBhZnRlciBuZXcgSUF1ZGlvVHJhY2sgdG8gcmVzdG9yZSBtUG9zaXRpb24sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYW5kIGNvdWxkIGJlIGVhc2lseSB3aWRlbmVkIHRvIHVpbnQ2NF90Ci0gICAgaW50NjRfdCAgICAgICAgICAgICAgICAgbVN0YXJ0VXM7ICAgICAgICAgICAgICAgLy8gdGhlIHN0YXJ0IHRpbWUgYWZ0ZXIgZmx1c2ggb3Igc3RvcC4KKyAgICBpbnQ2NF90ICAgICAgICAgICAgICAgICBtU3RhcnRGcm9tWmVyb1VzOyAgICAgICAvLyB0aGUgc3RhcnQgdGltZSBhZnRlciBmbHVzaCBvciBzdG9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdoZW4gcG9zaXRpb24gc2hvdWxkIGJlIDAuCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gb25seSB1c2VkIGZvciBvZmZsb2FkZWQgYW5kIGRpcmVjdCB0cmFja3MuCisgICAgaW50NjRfdCAgICAgICAgICAgICAgICAgbVN0YXJ0TnM7ICAgICAgICAgICAgICAgLy8gdGhlIHRpbWUgd2hlbiBzdGFydCgpIGlzIGNhbGxlZC4KICAgICBFeHRlbmRlZFRpbWVzdGFtcCAgICAgICBtU3RhcnRFdHM7ICAgICAgICAgICAgICAvLyBFeHRlbmRlZCB0aW1lc3RhbXAgYXQgc3RhcnQgZm9yIG5vcm1hbAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEF1ZGlvVHJhY2tzLgogICAgIEF1ZGlvVGltZXN0YW1wICAgICAgICAgIG1TdGFydFRzOyAgICAgICAgICAgICAgIC8vIFRpbWVzdGFtcCBhdCBzdGFydCBmb3Igb2ZmbG9hZGVkIG9yIGRpcmVjdApAQCAtMTE2Myw3ICsxMTc3LDcgQEAKICAgICB1aWRfdCAgICAgICAgICAgICAgICAgICBtQ2xpZW50VWlkOwogICAgIHBpZF90ICAgICAgICAgICAgICAgICAgIG1DbGllbnRQaWQ7CiAKLSAgICBzcDxBdWRpb1N5c3RlbTo6QXVkaW9EZXZpY2VDYWxsYmFjaz4gbURldmljZUNhbGxiYWNrOworICAgIHdwPEF1ZGlvU3lzdGVtOjpBdWRpb0RldmljZUNhbGxiYWNrPiBtRGV2aWNlQ2FsbGJhY2s7CiAgICAgYXVkaW9fcG9ydF9oYW5kbGVfdCAgICAgbVBvcnRJZDsgIC8vIHVuaXF1ZSBJRCBhbGxvY2F0ZWQgYnkgYXVkaW8g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gICAobG9uZyBsb25nKXNhbXBsZVJhdGUgKiBrUG93ZXJMb2dTYW1wbGluZ0ludGVydmFsTXMgLyAxMDAwOworICAgICAgICAgICAgICAgIG1Qb3dlckxvZyA9IHBvd2VyX2xvZ19jcmVhdGUoCisgICAgICAgICAgICAgICAgICAgICAgICBzYW1wbGVSYXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgY2hhbm5lbENvdW50LAorICAgICAgICAgICAgICAgICAgICAgICAgZm9ybWF0LAorICAgICAgICAgICAgICAgICAgICAgICAga1Bvd2VyTG9nRW50cmllcywKKyAgICAgICAgICAgICAgICAgICAgICAgIGtQb3dlckxvZ0ZyYW1lc1BlckVudHJ5KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAvLyBtUG93ZXJMb2cgbWF5IGJlIE5VTEwgKG5vdCB0aGUgcmlnaHQgYnVpbGQsIGZvcm1hdCBub3QgYWNjZXB0ZWQsIGV0Yy4pLgorICAgIH0KKworICAgIC8vIER1bXAgdGhlIHBvd2VyIGxvZyB0byBmZC4KKyAgICB2b2lkIGR1bXAoaW50IGZkKSBjb25zdCB7CisgICAgICAgIC8vIE9LIGZvciBudWxsIG1Qb3dlckxvZworICAgICAgICAodm9pZClwb3dlcl9sb2dfZHVtcCgKKyAgICAgICAgICAgICAgICBtUG93ZXJMb2csIGZkLCAiICAgICAgIiAvKiBwcmVmaXggKi8sIGtQb3dlckxvZ0xpbmVzLCAwIC8qIGxpbWl0X25zICovKTsKKyAgICB9CisKKyAgICAvLyBMb2cgdGhlIGF1ZGlvIGRhdGEgY29udGFpbmVkIGluIGJ1ZmZlci4KKyAgICB2b2lkIGxvZyhjb25zdCB2b2lkICpidWZmZXIsIHNpemVfdCBzaXplSW5CeXRlcykgY29uc3QgeworICAgICAgICBpZiAobVBvd2VyTG9nICE9IG51bGxwdHIpIHsgLy8gbUZyYW1lU2l6ZSBpcyBhbHdheXMgbm9uemVybyBpZiBtUG93ZXJMb2cgZXhpc3RzLgor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aWQgZnJvbSB4bWwKKyAgICAgICAgY29uc3QgY2hhciogbGlicmFyeU5hbWUgPSB4bWxJbXBsLkF0dHJpYnV0ZSgibGlicmFyeSIpOworICAgICAgICBjb25zdCBjaGFyKiB1dWlkID0geG1sSW1wbC5BdHRyaWJ1dGUoInV1aWQiKTsKKyAgICAgICAgaWYgKGxpYnJhcnlOYW1lID09IG51bGxwdHIgfHwgdXVpZCA9PSBudWxscHRyKSB7CisgICAgICAgICAgICBBTE9HRSgiZWZmZWN0IG11c3QgaGF2ZSBhIGxpYnJhcnkgbmFtZSBhbmQgYSB1dWlkOiAlcyIsIGR1bXAoeG1sSW1wbCkpOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgLy8gQ29udmVydCBsaWJyYXJ5IG5hbWUgdG8gYSBwb2ludGVyIHRvIHRoZSBwcmV2aW91c2x5IGxvYWRlZCBsaWJyYXJ5CisgICAgICAgIGF1dG8qIGxpYnJhcnkgPSBmaW5kQnlOYW1lKGxpYnJhcnlOYW1lLCBsaWJyYXJpZXMpOworICAgICAgICBpZiAobGlicmFyeSA9PSBudWxscHRyKSB7CisgICAgICAgICAgICBBTE9HRSgiQ291bGQgbm90IGZpbmQgbGlicmFyeSByZWZlcmVuY2VkIGluOiAlcyIsIGR1bXAoeG1sSW1wbCkpOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgICAgIGVmZmVjdC5saWJyYXJ5ID0gbGlicmFyeTsKKworICAgICAgICBpZiAoIXN0cmluZ1RvVXVpZCh1dWlkLCAmZWZmZWN0LnV1aWQpKSB7CisgICAgICAgICAgICBBTE9HRSgiSW52YWxpZCB1dWlkIGluOiAlcyIsIGR1bXAoeG1sSW1wbCkpOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH07CisKKyAgICBpZiAoIXBhcnNlSW1wbCh4bWxFZmZlY3QsIGVmZmVjdCkpIHsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIC8vIEhhbmRsZSBwcm94eSBlZmZlY3RzCisgICAgZWZmZWN0LmlzUHJveHkgPSBmYWxzZTsKKyAgICBpZiAoc3RkOjpzdHJjbXAoeG1sRWZmZWN0Lk5hbWUoKSwgImVmZmVjdFByb3h5IikgPT0gMCkgeworICAgICAgICBlZmZlY3QuaXNQcm94eSA9IHRydWU7CisKKyAgICAgICAgLy8gRnVuY3Rpb24gdG8gcGFyc2UgbGliaHcgYW5kIGxpYnN3CisgICAgICAgIGF1dG8gcGFyc2VQcm94eSA9IFsmeG1sRWZmZWN0LCAmcGFyc2VJbXBsXShjb25zdCBjaGFyKiB0YWcsIEVmZmVjdEltcGwmIHByb3h5TGliKSB7CisgICAgICAgICAgICBhdXRvKiB4bWxQcm94eUxpYiA9IHhtbEVmZmVjdC5GaXJzdENoaWxkRWxlbWVudCh0YWcpOworICAgICAgICAgICAgaWYgKHhtbFByb3h5TGliID09IG51bGxwdHIpIHsKKyAgICAgICAgICAgICAgICBBTE9HRSgiZWZmZWN0UHJveHkgbXVzdCBjb250YWluIGEgPCVzPjogJXMiLCB0YWcsIGR1bXAoKnhtbFByb3h5TGliKSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIHBhcnNlSW1wbCgqeG1sUHJveHlMaWIsIHByb3h5TGliKTsKKyAgICAgICAgfTsKKyAgICAgICAgaWYgKCFwYXJzZVByb3h5KCJsaWJodyIsIGVmZmVjdC5saWJIdykgfHwgIXBhcnNlUHJveHkoImxpYnN3IiwgZWZmZWN0LmxpYlN3KSkgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgfQorCisgICAgZWZmZWN0cy0+cHVzaF9iYWNrKHN0ZDo6bW92ZShlZmZlY3QpKTsKKyAgICByZXR1cm4gdHJ1ZTsKK30KKworLyoqI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1dG8gcmVnaXN0ZXJGYWlsdXJlID0gWyZuYlNraXBwZWRFbGVtZW50c10oYm9vbCByZXN1bHQpIHsKKyAgICAgICAgbmJTa2lwcGVkRWxlbWVudHMgKz0gcmVzdWx0ID8gMCA6IDE7CisgICAgfTsKKyAgICBmb3IgKGF1dG8mIHhtbENvbmZpZyA6IGdldENoaWxkcmVuKGRvYywgImF1ZGlvX2VmZmVjdHNfY29uZiIpKSB7CisKKyAgICAgICAgLy8gUGFyc2UgbGlicmFyeQorICAgICAgICBmb3IgKGF1dG8mIHhtbExpYnJhcmllcyA6IGdldENoaWxkcmVuKHhtbENvbmZpZywgImxpYnJhcmllcyIpKSB7CisgICAgICAgICAgICBmb3IgKGF1dG8mIHhtbExpYnJhcnkgOiBnZXRDaGlsZHJlbih4bWxMaWJyYXJpZXMsICJsaWJyYXJ5IikpIHsKKyAgICAgICAgICAgICAgICByZWdpc3RlckZhaWx1cmUocGFyc2VMaWJyYXJ5KHhtbExpYnJhcnksICZjb25maWctPmxpYnJhcmllcykpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLy8gUGFyc2UgZWZmZWN0cworICAgICAgICBmb3IgKGF1dG8mIHhtbEVmZmVjdHMgOiBnZXRDaGlsZHJlbih4bWxDb25maWcsICJlZmZlY3RzIikpIHsKKyAgICAgICAgICAgIGZvciAoYXV0byYgeG1sRWZmZWN0IDogZ2V0Q2hpbGRyZW4oeG1sRWZmZWN0cykpIHsKKyAgICAgICAgICAgICAgICByZWdpc3RlckZhaWx1cmUocGFyc2VFZmZlY3QoeG1sRWZmZWN0LCBjb25maWctPmxpYnJhcmllcywgJmNvbmZpZy0+ZWZmZWN0cykpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLy8gUGFyc2UgcHJlIHByb2Nlc3NpbmcgY2hhaW5zCisgICAgICAgIGZvciAoYXV0byYgeG1sUHJlcHJvY2VzcyA6IGdldENoaWxkcmVuKHhtbENvbmZpZywgInByZXByb2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HRyeWluZyB0byB1c2UgYSBub24tY29uZmlndXJlZCBkb3dubWl4ZXIiKTsKKyAgICAgICAgcmV0dXJuIC1FTk9EQVRBOworICAgIH0KKworICAgIHBTcmMgPSAoTFZNX0ZMT0FUICopIGluQnVmZmVyLT5zMTY7CisgICAgcERzdCA9IChMVk1fRkxPQVQgKikgb3V0QnVmZmVyLT5zMTY7CisgICAgc2l6ZV90IG51bUZyYW1lcyA9IG91dEJ1ZmZlci0+ZnJhbWVDb3VudDsKKworICAgIGNvbnN0IGJvb2wgYWNjdW11bGF0ZSA9CisgICAgICAgICAgICAocER3bU1vZHVsZS0+Y29uZmlnLm91dHB1dENmZy5hY2Nlc3NNb2RlID09IEVGRkVDVF9CVUZGRVJfQUNDRVNTX0FDQ1VNVUxBVEUpOworICAgIGNvbnN0IHVpbnQzMl90IGRvd25taXhJbnB1dENoYW5uZWxNYXNrID0gcER3bU1vZHVsZS0+Y29uZmlnLmlucHV0Q2ZnLmNoYW5uZWxzOworCisgICAgc3dpdGNoKHBEb3dubWl4ZXItPnR5cGUpIHsKKworICAgICAgY2FzZSBET1dOTUlYX1RZUEVfU1RSSVA6CisgICAgICAgICAgaWYgKGFjY3VtdWxhdGUpIHsKKyAgICAgICAgICAgICAgd2hpbGUgKG51bUZyYW1lcykgeworICAgICAgICAgICAgICAgICAgcERzdFswXSA9IGNsYW1wX2Zsb2F0KHBEc3RbMF0gKyBwU3JjWzBdKTsKKyAgICAgICAgICAgICAgICAgIHBEc3RbMV0gPSBjbGFtcF9mbG9hdChwRHN0WzFdICsgcFNyY1sxXSk7CisgICAgICAgICAgICAgICAgICBwU3JjICs9IHBEb3dubWl4ZXItPmlucHV0X2NoYW5uZWxfY291bnQ7CisgICAgICAgICAgICAgICAgICBwRHN0ICs9IDI7CisgICAgICAgICAgICAgICAgICBudW1GcmFtZXMtLTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgIHdoaWxlIChudW1GcmFtZXMpIHsKKyAgICAgICAgICAgICAgICAgIHBEc3RbMF0gPSBwU3JjWzBdOworICAgICAgICAgICAgICAgICAgcERzdFsxXSA9IHBTcmNbMV07CisgICAgICAgICAgICAgICAgICBwU3JjICs9IHBEb3dubWl4ZXItPmlucHV0X2NoYW5uZWxfY291bnQ7CisgICAgICAgICAgICAgICAgICBwRHN0ICs9IDI7CisgICAgICAgICAgICAgICAgICBudW1GcmFtZXMtLTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgICAgICBicmVhazsKKworICAgICAgY2FzZSBET1dOTUlYX1RZUEVfRk9MRDoKKyNpZmRlZiBET1dOTUlYX0FMV0FZU19VU0VfR0VORVJJQ19ET1dOTUlYRVIKKyAgICAgICAgICAvLyBieXBhc3MgdGhlIG9wdGltaXplZCBkb3dubWl4IHJvdXRpbmVzIGZvciB0aGUgY29tbW9uIGZvcm1hdHMKKyAgICAgICAgICBpZiAoIURvd25taXhfZm9sZEdlbmVyaWMoCisgICAgICAgICAgICAgICAgICBkb3dubWl4SW5wdXRDaGFubmVsTWFzaywgcFNyYywgcERzdCwgbnVtRnJhbWVzLCBhY2N1bXVsYXRlKSkgeworICAgICAgICAgICAgICBBTE9HRSgiTXVsdGljaGFubmVsIGNvbmZpZ3VyYXRpb24gMHglIiBQUkl4MzIgIiBpcyBub3Qgc3VwcG9ydGVkIiwKKyAgICAgICAgICAgICAgICAgICAgZG93bm1peElucHV0Q2hhbm5lbE1hc2spOworICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgICB9CisgICAgICAgICAgYnJlYWs7CisjZW5kaWYKKyAgICAgICAgLy8gb3B0aW1pemUgZm9yIHRoZSBjb21tb24gZm9ybWF0cworICAgICAgICBzd2l0Y2goKGRvd25taXhfaW5wdXRfY2hhbm5lbF9tYXNrX3QpZG93bm1peElucHV0Q2hhbm5lbE1hc2spIHsKKyAgICAgICAgY2FzZSBDSEFOTkVMX01BU0tfUVVBRF9CQUNLOgorICAgICAgICBjYXNlIENIQU5ORUxfTUFTS19RVUFEX1NJREU6CisgICAgICAgICAgICBEb3dubWl4X2ZvbGRGcm9tUXVhZChwU3JjLCBwRHN0LCBudW1GcmFtZXMsIGFjY3VtdWxhdGUpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgQ0hBTk5FTF9NQVNLXzVQT0lOVDFfQkFDSzoKKyAgICAgICAgY2FzZSBDSEFOTkVMX01BU0tfNVBPSU5UMV9TSURFOgorICAgICAgICAgICAgRG93bm1peF9mb2xkRnJvbTVQb2ludDEocFNyYywgcERzdCwgbnVtRnJhbWVzLCBhY2N1bXVsYXRlKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIENIQU5ORUxfTUFTS183UE9JTlQxOgorICAgICAgICAgICAgRG93bm1peF9mb2xkRnJvbTdQb2ludDEocFNyYywgcERzdCwgbnVtRnJhbWVzLCBhY2N1bXVsYXRlKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgaWYgKCFEb3dubWl4X2ZvbGRHZW5lcmljKAorICAgICAgICAgICAgICAgICAgICBkb3dubWl4SW5wdXRDaGFubmVsTWFzaywgcFNyYywgcERzdCwgbnVtRnJhbWVzLCBhY2N1bXVsYXRlKSkgeworICAgICAgICAgICAgICAgIEFMT0dFKCJNdWx0aWNoYW5uZWwgY29uZmlndXJhdGlvbiAweCUiIFBSSXgzMiAiIGlzIG5vdCBzdXBwb3J0ZWQiLAorICAgICAgICAgICAgICAgICAgICAgIGRvd25taXhJbnB1dENoYW5uZWxNYXNrKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIGJyZWFrOworCisgICAgICBkZWZhdWx0OgorICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICByZXR1cm4gMDsKK30KKyN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7CisgICAgICAgICAgICAvLyBjZW50ZXJQbHVzTGZlQ29udHJpYiA9IEZDKC0zZEIpICsgTEZFKC0zZEIpCisgICAgICAgICAgICBjZW50ZXJQbHVzTGZlQ29udHJpYiA9IChwU3JjWzJdICogTUlOVVNfM19EQl9JTl9GTE9BVCkKKyAgICAgICAgICAgICAgICAgICAgKyAocFNyY1szXSAqIE1JTlVTXzNfREJfSU5fRkxPQVQpOworICAgICAgICAgICAgLy8gRkwgKyBjZW50ZXJQbHVzTGZlQ29udHJpYiArIFJMCisgICAgICAgICAgICBsdCA9IHBTcmNbMF0gKyBjZW50ZXJQbHVzTGZlQ29udHJpYiArIHBTcmNbNF07CisgICAgICAgICAgICAvLyBGUiArIGNlbnRlclBsdXNMZmVDb250cmliICsgUlIKKyAgICAgICAgICAgIHJ0ID0gcFNyY1sxXSArIGNlbnRlclBsdXNMZmVDb250cmliICsgcFNyY1s1XTsKKyAgICAgICAgICAgIC8vIGFjY3VtdWxhdGUgaW4gZGVzdGluYXRpb24KKyAgICAgICAgICAgIHBEc3RbMF0gPSBjbGFtcF9mbG9hdChwRHN0WzBdICsgKGx0IC8gMi4wZikpOworICAgICAgICAgICAgcERzdFsxXSA9IGNsYW1wX2Zsb2F0KHBEc3RbMV0gKyAocnQgLyAyLjBmKSk7CisgICAgICAgICAgICBwU3JjICs9IDY7CisgICAgICAgICAgICBwRHN0ICs9IDI7CisgICAgICAgICAgICBudW1GcmFtZXMtLTsKKyAgICAgICAgfQorICAgIH0gZWxzZSB7IC8vIHNhbWUgY29kZSBhcyBhYm92ZSBidXQgd2l0aG91dCBhZGRpbmcgYW5kIGNsYW1waW5nIHBEc3RbaV0gdG8gaXRzZWxmCisgICAgICAgIHdoaWxlIChudW1GcmFtZXMpIHsKKyAgICAgICAgICAgIC8vIGNlbnRlclBsdXNMZmVDb250cmliID0gRkMoLTNkQikgKyBMRkUoLTNkQikKKyAgICAgICAgICAgIGNlbnRlclBsdXNMZmVDb250cmliID0gKHBTcmNbMl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HNhbXBsZQorICAgIGlmIChhY2N1bXVsYXRlKSB7CisgICAgICAgIHdoaWxlIChudW1GcmFtZXMpIHsKKyAgICAgICAgICAgIC8vIGNlbnRlclBsdXNMZmVDb250cmliID0gRkMoLTNkQikgKyBMRkUoLTNkQikKKyAgICAgICAgICAgIGNlbnRlclBsdXNMZmVDb250cmliID0gKHBTcmNbMl0gKiBNSU5VU18zX0RCX0lOX1ExOV8xMikKKyAgICAgICAgICAgICAgICAgICAgKyAocFNyY1szXSAqIE1JTlVTXzNfREJfSU5fUTE5XzEyKTsKKyAgICAgICAgICAgIC8vIEZMICsgY2VudGVyUGx1c0xmZUNvbnRyaWIgKyBTTCArIFJMCisgICAgICAgICAgICBsdCA9IHBTcmNbMF0gKyBjZW50ZXJQbHVzTGZlQ29udHJpYiArIHBTcmNbNl0gKyBwU3JjWzRdOworICAgICAgICAgICAgLy8gRlIgKyBjZW50ZXJQbHVzTGZlQ29udHJpYiArIFNSICsgUlIKKyAgICAgICAgICAgIHJ0ID0gcFNyY1sxXSArIGNlbnRlclBsdXNMZmVDb250cmliICsgcFNyY1s3XSArIHBTcmNbNV07CisgICAgICAgICAgICAvL2FjY3VtdWxhdGUgaW4gZGVzdGluYXRpb24KKyAgICAgICAgICAgIHBEc3RbMF0gPSBjbGFtcF9mbG9hdChwRHN0WzBdICsgKGx0IC8gMi4wZikpOworICAgICAgICAgICAgcERzdFsxXSA9IGNsYW1wX2Zsb2F0KHBEc3RbMV0gKyAocnQgLyAyLjBmKSk7CisgICAgICAgICAgICBwU3JjICs9IDg7CisgICAgICAgICAgICBwRHN0ICs9IDI7CisgICAgICAgICAgICBudW1GcmFtZXMtLTsKKyAgICAgICAgfQorICAgIH0gZWxzZSB7IC8vIHNhbWUgY29kZSBhcyBhYm92ZSBidXQgd2l0aG91dCBhZGRpbmcgYW5kIGNsYW1waW5nIHBEc3RbaV0gdG8gaXRzZWxmCisgICAgICAgIHdoaWxlIChudW1GcmFtZXMpIHsKKyAgICAgICAgICAgIC8vIGNlbnRlclBsdXNMZmVDb250cmliID0gRkMoLTNkQikgKyBMRkUoLTNkQikKKyAgICAgICAgICAgIGNlbnRlclBsdXNMZmVDb250cmliID0gKHBTcmNbMl0gKiBNSU5VU18zX0RCX0lOX0ZMT0FUKQorICAgICAgICAgICAgICAgICAgICArIChwU3JjWzNdICogTUlOVVNfM19EQl9JTl9GTE9BVCk7CisgICAgICAgICAgICAvLyBGTCArIGNlbnRlclBsdXNMZmVDb250cmliICsgU0wgKyBSTAorICAgICAgICAgICAgbHQgPSBwU3JjWzBdICsgY2VudGVyUGx1c0xmZUNvbnRyaWIgKyBwU3JjWzZdICsgcFNyY1s0XTsKKyAgICAgICAgICAgIC8vIEZSICsgY2VudGVyUGx1c0xmZUNvbnRyaWIgKyBTUiArIFJSCisgICAgICAgICAgICBydCA9IHBTcmNbMV0gKyBjZW50ZXJQbHVzTGZlQ29udHJpYiArIHBTcmNbN10gKyBwU3JjWzVdOworICAgICAgICAgICAgLy8gc3RvcmUgaW4gZGVzdGluYXRpb24KKyAgICAgICAgICAgIHBEc3RbMF0gPSBjbGFtcF9mbG9hdChsdCAvIDIuMGYpOyAvLyBkaWZmZXJzIGZyb20gd2hlbiBhY2N1bXVsYXRlIGlzIHRydWUgYWJvdmUKKyAgICAgICAgICAgIHBEc3RbMV0gPSBjbGFtcF9mbG9hdChydCAvIDIuMGYpOyAvLyBkaWZmZXJzIGZyb20gd2hlbiBhY2N1bXVsYXRlIGlzIHRydWUgYWJvdmUKKyAgICAgICAgICAgIHBTcmMgKz0gODsKKyAgICAgICAgICAgIHBEc3QgKz0gMjsKKyAgICAgICAgICAgIG51bUZyYW1lcy0tOworICAgICAgICB9CisgICAgfQorfQorI2VuZGlmCiAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICAqIERvd25taXhfZm9sZEdlbmVyaWMoKQ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gICAgICAgLy8gbWl4IGluIHNpZGVzIGFuZCBiYWNrcworICAgICAgICAgICAgaWYgKGhhc1NpZGVzKSB7CisgICAgICAgICAgICAgICAgbHQgKz0gcFNyY1tpbmRleFNMXTsKKyAgICAgICAgICAgICAgICBydCArPSBwU3JjW2luZGV4U1JdOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGhhc0JhY2tzKSB7CisgICAgICAgICAgICAgICAgbHQgKz0gcFNyY1tpbmRleEJMXTsKKyAgICAgICAgICAgICAgICBydCArPSBwU3JjW2luZGV4QlJdOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbHQgKz0gY2VudGVyc0xmZUNvbnRyaWI7CisgICAgICAgICAgICBydCArPSBjZW50ZXJzTGZlQ29udHJpYjsKKyAgICAgICAgICAgIC8vIGFjY3VtdWxhdGUgaW4gZGVzdGluYXRpb24KKyAgICAgICAgICAgIHBEc3RbMF0gPSBjbGFtcF9mbG9hdChwRHN0WzBdICsgKGx0IC8gMi4wZikpOworICAgICAgICAgICAgcERzdFsxXSA9IGNsYW1wX2Zsb2F0KHBEc3RbMV0gKyAocnQgLyAyLjBmKSk7CisgICAgICAgICAgICBwU3JjICs9IG51bUNoYW47CisgICAgICAgICAgICBwRHN0ICs9IDI7CisgICAgICAgICAgICBudW1GcmFtZXMtLTsKKyAgICAgICAgfQorICAgIH0gZWxzZSB7CisgICAgICAgIHdoaWxlIChudW1GcmFtZXMpIHsKKyAgICAgICAgICAgIC8vIGNvbXB1dGUgY29udHJpYnV0aW9uIG9mIEZDLCBCQyBhbmQgTEZFCisgICAgICAgICAgICBjZW50ZXJzTGZlQ29udHJpYiA9IDA7CisgICAgICAgICAgICBpZiAoaGFzRkMpICB7IGNlbnRlcnNMZmVDb250cmliICs9IHBTcmNbaW5kZXhGQ107IH0KKyAgICAgICAgICAgIGlmIChoYXNMRkUpIHsgY2VudGVyc0xmZUNvbnRyaWIgKz0gcFNyY1tpbmRleExGRV07IH0KKyAgICAgICAgICAgIGlmIChoYXNCQykgIHsgY2VudGVyc0xmZUNvbnRyaWIgKz0gcFNyY1tpbmRleEJDXTsgfQorICAgICAgICAgICAgY2VudGVyc0xmZUNvbnRyaWIgKj0gTUlOVVNfM19EQl9JTl9GTE9BVDsKKyAgICAgICAgICAgIC8vIGFsd2F5cyBoYXMgRkwvRlIKKyAgICAgICAgICAgIGx0ID0gcFNyY1swXTsKKyAgICAgICAgICAgIHJ0ID0gcFNyY1sxXTsKKyAgICAgICAgICAgIC8vIG1peCBpbiBzaWRlcyBhbmQgYmFja3MKKyAgICAgICAgICAgIGlmIChoYXNTaWRlcykgeworICAgICAgICAgICAgICAgIGx0ICs9IHBTcmNbaW5kZXhTTF07CisgICAgICAgICAgICAgICAgcnQgKz0gcFNyY1tpbmRleFNSXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChoYXNCYWNrcykgeworICAgICAgICAgICAgICAgIGx0ICs9IHBTcmNbaW5kZXhCTF07CisgICAgICAgICAgICAgICAgcnQgKz0gcFNyY1tpbmRleEJSXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGx0ICs9IGNlbnRlcnNMZmVDb250cmliOworICAgICAgICAgICAgcnQgKz0gY2VudGVyc0xmZUNvbnRyaWI7CisgICAgICAgICAgICAvLyBzdG9yZSBpbiBkZXN0aW5hdGlvbgorICAgICAgICAgICAgcERzdFswXSA9IGNsYW1wX2Zsb2F0KGx0IC8gMi4wZik7IC8vIGRpZmZlcnMgZnJvbSB3aGVuIGFjY3VtdWxhdGUgaXMgdHJ1ZSBhYm92ZQorICAgICAgICAgICAgcERzdFsxXSA9IGNsYW1wX2Zsb2F0KHJ0IC8gMi4wZik7IC8vIGRpZmZlcnMgZnJvbSB3aGVuIGFjY3VtdWxhdGUgaXMgdHJ1ZSBhYm92ZQorICAgICAgICAgICAgcFNyYyArPSBudW1DaGFuOworICAgICAgICAgICAgcERzdCArPSAyOworICAgICAgICAgICAgbnVtRnJhbWVzLS07CisgICAgICAgIH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lY3RDb25maWdGaWxlKEFVRElPX0VGRkVDVF9WRU5ET1JfQ09ORklHX0ZJTEUpOworICAgIH0gZWxzZSBpZiAoYWNjZXNzKEFVRElPX0VGRkVDVF9ERUZBVUxUX0NPTkZJR19GSUxFLCBSX09LKSA9PSAwKSB7CisgICAgICAgIHJldHVybiBsb2FkRWZmZWN0Q29uZmlnRmlsZShBVURJT19FRkZFQ1RfREVGQVVMVF9DT05GSUdfRklMRSk7CisgICAgfQorICAgIHJldHVybiAwOworfQorCitpbnQgbG9hZEVmZmVjdENvbmZpZ0ZpbGUoY29uc3QgY2hhciAqcGF0aCkKK3sKKyAgICBjbm9kZSAqcm9vdDsKKyAgICBjaGFyICpkYXRhOworCisgICAgZGF0YSA9IGxvYWRfZmlsZShwYXRoLCBOVUxMKTsKKyAgICBpZiAoZGF0YSA9PSBOVUxMKSB7CisgICAgICAgIHJldHVybiAtRU5PREVWOworICAgIH0KKyAgICByb290ID0gY29uZmlnX25vZGUoIiIsICIiKTsKKyAgICBjb25maWdfbG9hZChyb290LCBkYXRhKTsKKyAgICBsb2FkTGlicmFyaWVzKHJvb3QpOworICAgIGxvYWRFZmZlY3RzKHJvb3QpOworICAgIGNvbmZpZ19mcmVlKHJvb3QpOworICAgIGZyZWUocm9vdCk7CisgICAgZnJlZShkYXRhKTsKKworICAgIHJldHVybiAwOworfQorCitpbnQgbG9hZExpYnJhcmllcyhjbm9kZSAqcm9vdCkKK3sKKyAgICBjbm9kZSAqbm9kZTsKKworICAgIG5vZGUgPSBjb25maWdfZmluZChyb290LCBMSUJSQVJJRVNfVEFHKTsKKyAgICBpZiAobm9kZSA9PSBOVUxMKSB7CisgICAgICAgIHJldHVybiAtRU5PRU5UOworICAgIH0KKyAgICBub2RlID0gbm9kZS0+Zmlyc3RfY2hpbGQ7CisgICAgd2hpbGUgKG5vZGUpIHsKKyAgICAgICAgbG9hZExpYnJhcnkobm9kZSwgbm9kZS0+bmFtZSk7CisgICAgICAgIG5vZGUgPSBub2RlL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X3QgbGVuOworCisgICAgaWYgKGxpYl9wYXRoX2luID09IE5VTEwgfHwgbGliX3BhdGhfb3V0ID09IE5VTEwpIHsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgc3RybGNweShsaWJfcGF0aF9vdXQsIGxpYl9wYXRoX2luLCBQQVRIX01BWCk7CisKKyAgICAvLyBUcnkgZXhhY3QgcGF0aCBmaXJzdAorICAgIHN0ciA9IHN0cnN0cihsaWJfcGF0aF9vdXQsICIvbGliL3NvdW5kZngvIik7CisgICAgaWYgKHN0ciA9PSBOVUxMKSB7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIC8vIEV4dHJhY3QgbGlicmFyeSBuYW1lIGZyb20gaW5wdXQgcGF0aAorICAgIGxlbiA9IHN0ciAtIGxpYl9wYXRoX291dDsKKyAgICBsaWJfbmFtZSA9IGxpYl9wYXRoX2luICsgbGVuICsgc3RybGVuKCIvbGliL3NvdW5kZngvIik7CisKKyAgICAvLyBUaGVuIHRyeSB3aXRoIGxpYnJhcnkgbmFtZSBhbmQgc3RhbmRhcmQgcGF0aCBuYW1lcyBpbiBvcmRlciBvZiBwcmVmZXJlbmNlCisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBrTGlicmFyeVBhdGhSb290U2l6ZTsgaSsrKSB7CisgICAgICAgIGNoYXIgcGF0aFtQQVRIX01BWF07CisKKyAgICAgICAgc25wcmludGYocGF0aCwKKyAgICAgICAgICAgICAgICAgUEFUSF9NQVgsCisgICAgICAgICAgICAgICAgICIlcy8lcyIsCisgICAgICAgICAgICAgICAgIGtMaWJyYXJ5UGF0aFJvb3RbaV0sCisgICAgICAgICAgICAgICAgIGxpYl9uYW1lKTsKKyAgICAgICAgaWYgKEZfT0sgPT0gYWNjZXNzKHBhdGgsIDApKSB7CisgICAgICAgICAgICBzdHJjcHkobGliX3BhdGhfb3V0LCBwYXRoKTsKKyAgICAgICAgICAgIEFMT0dXX0lGKHN0cm5jbXAobGliX3BhdGhfb3V0LCBsaWJfcGF0aF9pbiwgUEFUSF9NQVgpICE9IDAsCisgICAgICAgICAgICAgICAgImNoZWNrTGlicmFyeVBhdGgoKSBjb3JyZWN0ZWQgbGlicmFyeSBwYXRoICVzIHRvICVzIiwgbGliX3BhdGhfaW4sIGxpYl9wYXRoX291dCk7CisgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gLUVJTlZBTDsKK30KKworCisKK2ludCBsb2FkTGlicmFyeShjbm9kZSAqcm9vdCwgY29uc3QgY2hhciAqbmFtZSkKK3sKKyAgICBjbm9kZSAqbm9kZTsKKyAgICB2b2lkICpoZGwgPSBOVUxMOworICAgIGF1ZGlvX2VmZmVjdF9saWJyYXJ5X3QgKmRlc2M7CisgICAgbGlzdF9lbGVtX3QgKmU7CisgICAgbGliX2VudHJ5X3QgKmw7CisgICAgY2hhciBwYXRoW1BBVEhfTUFYXTsKKworICAgIG5vZGUgPSBjb25maWdfZmluZChyb290LCBQQVRIX1RBRyk7CisgICAgaWYgKG5vZGUgPT0gTlVMTCkgeworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBpZiAoY2hlY2tMaWJyYXJ5UGF0aCgoY29uc3QgY2hhciAqKW5vZGUtPnZhbHVlLCBwYXRoKSAhPSAwKSB7CisgICAgICAgIEFMT0dXKCJsb2FkTGlicmFyeSgpIGNvdWxkIG5vdCBmaW5kIGxpYnJhcnkgJXMiLCBwYXRoKTsKKyAgICAgICAgZ290byBlcnJvcjsKKyAgICB9CisKKyAgICBoZGwgPSBkbG9wZW4ocGF0aCwgUlRMRF9OT1cpOworICAgIGlmIChoZGwgPT0gTlVMTCkgeworICAgICAgICBBTE9HVygibG9hZExpYnJhcnkoKSBmYWlsZWQgdG8gb3BlbiAlcyIsIHBhdGgpOworICAgICAgICBnb3RvIGVycm9yOworICAgIH0KKworICAgIGRlc2MgPSAoYXVkaW9fZWZmZWN0X2x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BUaGlzIHdpbGwgZmluZCB0aGUgbGlicmFyeSBhbmQgVVVJRCB0YWdzIG9mIHRoZSBzdWIgZWZmZWN0IHBvaW50ZWQgYnkgdGhlCisvLyBub2RlLCBnZXRzIHRoZSBlZmZlY3QgZGVzY3JpcHRvciBhbmQgbGliX2VudHJ5X3QgYW5kIGFkZHMgdGhlIHN1YmVmZmVjdCAtCisvLyBzdWJfZW50cnlfdCB0byB0aGUgZ1N1YkVmZmVjdExpc3QKK2ludCBhZGRTdWJFZmZlY3QoY25vZGUgKnJvb3QpCit7CisgICAgQUxPR1YoImFkZFN1YkVmZmVjdCIpOworICAgIGNub2RlICpub2RlOworICAgIGVmZmVjdF91dWlkX3QgdXVpZDsKKyAgICBlZmZlY3RfZGVzY3JpcHRvcl90ICpkOworICAgIGxpYl9lbnRyeV90ICpsOworICAgIGxpc3RfZWxlbV90ICplOworICAgIG5vZGUgPSBjb25maWdfZmluZChyb290LCBMSUJSQVJZX1RBRyk7CisgICAgaWYgKG5vZGUgPT0gTlVMTCkgeworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgbCA9IGdldExpYnJhcnkobm9kZS0+dmFsdWUpOworICAgIGlmIChsID09IE5VTEwpIHsKKyAgICAgICAgQUxPR1coImFkZFN1YkVmZmVjdCgpIGNvdWxkIG5vdCBnZXQgbGlicmFyeSAlcyIsIG5vZGUtPnZhbHVlKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorICAgIG5vZGUgPSBjb25maWdfZmluZChyb290LCBVVUlEX1RBRyk7CisgICAgaWYgKG5vZGUgPT0gTlVMTCkgeworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgaWYgKHN0cmluZ1RvVXVpZChub2RlLT52YWx1ZSwgJnV1aWQpICE9IDApIHsKKyAgICAgICAgQUxPR1coImFkZFN1YkVmZmVjdCgpIGludmFsaWQgdXVpZCAlcyIsIG5vZGUtPnZhbHVlKTsKKyAgICAgICA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E5VTEw7CisgICAgICAgICAgIGZyZWUoc3ViZSk7CisgICAgICAgICAgIHJldHVybiAtRU5PRU5UOworICAgICAgIH0KKyAgICAgICBzdWJfZWZmZWN0X2VudHJ5X3QgKnN1YkVudHJ5ID0gKHN1Yl9lZmZlY3RfZW50cnlfdCopZ1N1YkVmZmVjdExpc3QtPnN1Yl9lbGVtLT5vYmplY3Q7CisgICAgICAgZWZmZWN0X2Rlc2NyaXB0b3JfdCAqc3ViRWZmZWN0RGVzYyA9IChlZmZlY3RfZGVzY3JpcHRvcl90Kikoc3ViRW50cnktPm9iamVjdCk7CisgICAgICAgLy8gU2luY2Ugd2UgcmV0dXJuIGEgZHVtbXkgZGVzY3JpcHRvciBmb3IgdGhlIHByb3h5IGR1cmluZworICAgICAgIC8vIGdldF9kZXNjcmlwdG9yIGNhbGwsd2UgcmVwbGFjZSBpdCB3aXRoIHRoZSBjb3JyZXNwb2RpbmcKKyAgICAgICAvLyBzdyBlZmZlY3QgZGVzY3JpcHRvciwgYnV0IHdpdGggUHJveHkgVVVJRAorICAgICAgIC8vIGNoZWNrIGZvciBTdyBkZXNjCisgICAgICAgIGlmICghKChzdWJFZmZlY3REZXNjLT5mbGFncyAmIEVGRkVDVF9GTEFHX0hXX0FDQ19NQVNLKSA9PQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVGRkVDVF9GTEFHX0hXX0FDQ19UVU5ORUwpKSB7CisgICAgICAgICAgICAgc3dTdWJlZnggPSB0cnVlOworICAgICAgICAgICAgICpkID0gKnN1YkVmZmVjdERlc2M7CisgICAgICAgICAgICAgZC0+dXVpZCA9IHV1aWQ7CisgICAgICAgICAgICAgQUxPR1YoImxvYWRFZmZlY3QoKSBDaGFuZ2VkIHRoZSBQcm94eSBkZXNjIik7CisgICAgICAgfSBlbHNlCisgICAgICAgICAgIGh3U3ViZWZ4ID0gdHJ1ZTsKKyAgICAgICBjb3VudC0tOworICAgICAgIG5vZGUgPSBub2RlLT5uZ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ZihlZmZlY3RfdXVpZF90KSkgPT0gMCkgewotICAgICAgICAgICAgICAgIGZvdW5kID0gMTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVmeCA9IGVmeC0+bmV4dDsKLSAgICAgICAgfQotICAgICAgICBlID0gZS0+bmV4dDsKLSAgICB9Ci0gICAgaWYgKCFmb3VuZCkgewotICAgICAgICBBTE9HVigiZmluZEVmZmVjdCgpIGVmZmVjdCBub3QgZm91bmQiKTsKLSAgICAgICAgcmV0ID0gLUVOT0VOVDsKLSAgICB9IGVsc2UgewotICAgICAgICBBTE9HVigiZmluZEVmZmVjdCgpIGZvdW5kIGVmZmVjdDogJXMgaW4gbGliICVzIiwgZC0+bmFtZSwgbC0+bmFtZSk7Ci0gICAgICAgICpsaWIgPSBsOwotICAgICAgICBpZiAoZGVzYykgewotICAgICAgICAgICAgKmRlc2MgPSBkOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuIHJldDsKLX0KLQotdm9pZCBkdW1wRWZmZWN0RGVzY3JpcHRvcihlZmZlY3RfZGVzY3JpcHRvcl90ICpkZXNjLCBjaGFyICpzdHIsIHNpemVfdCBsZW4sIGludCBpbmRlbnQpIHsKLSAgICBjaGFyIHNbMjU2XTsKLSAgICBjaGFyIHNzWzI1Nl07Ci0gICAgY2hhciBpZHRbaW5kZW50ICsgMV07Ci0KLSAgICBtZW1zZXQoaWR0LCAnICcsIGluZGVudCk7Ci0gICAgaWR0W2luZGVudF0gPSAwOwotCi0gICAgc3RyWzBdID0gMDsKLQotICAgIHNucHJpbnRmKHMsIHNpemVvZihzKSwgIiVzJXMgLyAlc1xuIiwgaWR0LCBkZXNjLT5uYW1lLCBkZXNjLT5pbXBsZW1lbnRvcik7Ci0gICAgc3RybGNhdChzdHIsIHMsIGxlbik7Ci0KLSAgICB1dWlkVG9TdHJpbmcoJmRlc2MtPnV1aWQsIHMsIHNpemVvZihzKSk7Ci0gICAgc25wc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AorCisKK2ludCBmaW5kRWZmZWN0KGNvbnN0IGVmZmVjdF91dWlkX3QgKnR5cGUsCisgICAgICAgICAgICAgICBjb25zdCBlZmZlY3RfdXVpZF90ICp1dWlkLAorICAgICAgICAgICAgICAgbGliX2VudHJ5X3QgKipsaWIsCisgICAgICAgICAgICAgICBlZmZlY3RfZGVzY3JpcHRvcl90ICoqZGVzYykKK3sKKyAgICBsaXN0X2VsZW1fdCAqZSA9IGdMaWJyYXJ5TGlzdDsKKyAgICBsaWJfZW50cnlfdCAqbCA9IE5VTEw7CisgICAgZWZmZWN0X2Rlc2NyaXB0b3JfdCAqZCA9IE5VTEw7CisgICAgaW50IGZvdW5kID0gMDsKKyAgICBpbnQgcmV0ID0gMDsKKworICAgIHdoaWxlIChlICYmICFmb3VuZCkgeworICAgICAgICBsID0gKGxpYl9lbnRyeV90ICopZS0+b2JqZWN0OworICAgICAgICBsaXN0X2VsZW1fdCAqZWZ4ID0gbC0+ZWZmZWN0czsKKyAgICAgICAgd2hpbGUgKGVmeCkgeworICAgICAgICAgICAgZCA9IChlZmZlY3RfZGVzY3JpcHRvcl90ICopZWZ4LT5vYmplY3Q7CisgICAgICAgICAgICBpZiAodHlwZSAhPSBOVUxMICYmIG1lbWNtcCgmZC0+dHlwZSwgdHlwZSwgc2l6ZW9mKGVmZmVjdF91dWlkX3QpKSA9PSAwKSB7CisgICAgICAgICAgICAgICAgZm91bmQgPSAxOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHV1aWQgIT0gTlVMTCAmJiBtZW1jbXAoJmQtPnV1aWQsIHV1aWQsIHNpemVvZihlZmZlY3RfdXVpZF90KSkgPT0gMCkgeworICAgICAgICAgICAgICAgIGZvdW5kID0gMTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVmeCA9IGVmeC0+bmV4dDsKKyAgICAgICAgfQorICAgICAgICBlID0gZS0+bmV4dDsKKyAgICB9CisgICAgaWYgKCFmb3VuZCkgeworICAgICAgICBBTE9HVigiZmluZEVmZmVjdCgpIGVmZmVjdCBub3QgZm91bmQiKTsKKyAgICAgICAgcmV0ID0gLUVOT0VOVDsKKyAgICB9IGVsc2UgeworICAgICAgICBBTE9HVigiZmluZEVmZmVjdCgpIGZvdW5kIGVmZmVjdDogJXMgaW4gbGliICVzIiwgZC0+bmFtZSwgbC0+bmFtZSk7CisgICAgICAgICpsaWIgPSBsOworICAgICAgICBpZiAoZGVzYykgeworICAgICAgICAgICAgKmRlc2MgPSBkOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIHJldDsKK30KKworaW50IHN0cmluZ1RvVXVpZChjb25zdCBjaGFyICpzdHIsIGVmZmVjdF91dWlkX3QgKnV1aWQpCit7CisgICAgaW50IHRtcFsxMF07CisKKyAgICBpZiAoc3NjYW5mKHN0ciwgIiUwOHgtJTA0eC0lMDR4LSUwNHgtJTAyeCUwMnglMDJ4JTAyeCUwMnglMDJ4IiwKKyAgICAgICAgICAgIHRtcCwgdG1wKzEsIHRtcCsyLCB0bXArMywgdG1wKzQsIHRtcCs1LCB0bXArNiwgdG1wKzcsIHRtcCs4LCB0bXArOSkgPCAxMCkgeworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgdXVpZC0+dGltZUxvdyA9ICh1aW50MzJfdCl0bXBbMF07CisgICAgdXVpZC0+dGltZU1pZCA9ICh1aW50MTZfdCl0bXBbMV07CisgICAgdXVpZC0+dGltZUhpQW5kVmVyc2lvbiA9ICh1aW50MTZfdCl0bXBbMl07CisgICAgdXVpZC0+Y2xvY2tTZXEgPSAodWludDE2X3QpdG1wWzNdOworICAgIHV1aWQtPm5vZGVbMF0gPSAodWludDhfdCl0bXBbNF07CisgICAgdXVpZC0+bm9kZVsxXSA9ICh1aW50OF90KXRtcFs1XTsKKyAgICB1dWlkLT5ub2RlWzJdID0gKHVpbnQ4X3QpdG1wWzZdOworICAgIHV1aWQtPm5vZGVbM10gPSAodWludDhfdCl0bXBbN107CisgICAgdXVpZC0+bm9kZVs0XSA9ICh1aW50OF90KXRtcFs4XTsKKyAgICB1dWlkLT5ub2RlWzVdID0gKHVpbnQ4X3QpdG1wWzldOworCisgICAgcmV0dXJuIDA7Cit9CisKK2ludCB1dWlkVG9TdHJpbmcoY29uc3QgZWZmZWN0X3V1aWRfdCAqdXVpZCwgY2hhciAqc3RyLCBzaXplX3QgbWF4TGVuKQoreworCisgICAgc25wcmludGYoc3RyLCBtYXhMZW4sICIlMDh4LSUwNHgtJTA0eC0lMDR4LSUwMnglMDJ4JTAyeCUwMnglMDJ4JTAyeCIsCisgICAgICAgICAgICB1dWlkLT50aW1lTG93LAorICAgICAgICAgICAgdXVpZC0+dGltZU1pZCwKKyAgICAgICAgICAgIHV1aWQtPnRpbWVIaUFuZFZlcnNpb24sCisgICAgICAgICAgICB1dWlkLT5jbG9ja1NlcSwKKyAgICAgICAgICAgIHV1aWQtPm5vZGVbMF0sCisgICAgICAgICAgICB1dWlkLT5ub2RlWzFdLAorICAgICAgICAgICAgdXVpZC0+bm9kZVsyXSwKKyAgICAgICAgICAgIHV1aWQtPm5vZGVbM10sCisgICAgICAgICAgICB1dWlkLT5ub2RlWzRdLAorICAgICAgICAgICAgdXVpZC0+bm9kZVs1XSk7CisKKyAgICByZXR1cm4gMDsKK30KKworCit2b2lkIGR1bXBFZmZlY3REZXNjcmlwdG9yKGVmZmVjdF9kZXNjcmlwdG9yX3QgKmRlc2MsIGNoYXIgKnN0ciwgc2l6ZV90IGxlbiwgaW50IGluZGVudCkgeworICAgIGNoYXIgc1syNTZdOworICAgIGNoYXIgc3NbMjU2XTsKKyAgICBjaGFyIGlkdFtpbmRlbnQgKyAxXTsKKworICAgIG1lbXNldChpZHQsICcgJywgaW5kZW50KTsKKyAgICBpZHRbaW5kZW50XSA9IDA7CisKKyAgICBzdHJbMF0gPSAwOworCisgICAgc25wcmludGYocywgc2l6ZW9mKHMpLCAiJ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cmd2WzFdLCAiLS14bWwiKSA9PSAwKSB7CisgICAgICAgIGxlZ2FjeUZvcm1hdCA9IGZhbHNlOworICAgICAgICBpZiAoYXJnYyA9PSAzKSB7CisgICAgICAgICAgICBmcHJpbnRmKHN0ZGVyciwgIkR1bXBpbmcgWE1MIGVmZmVjdCBjb25maWcgZmlsZTogJXNcbiIsIHBhdGgpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZnByaW50ZihzdGRlcnIsICJEdW1waW5nIGRlZmF1bHQgWE1MIGVmZmVjdCBjb25maWcgZmlsZS5cbiIpOworICAgICAgICB9CisgICAgfSBlbHNlIHsKKyAgICAgICAgZnByaW50ZihzdGRlcnIsICJJbnZhbGlkIGFyZ3VtZW50cy5cbiIKKyAgICAgICAgICAgICAgICAgICAgICAgICJVc2FnZTogJXMgWy0tbGVnYWN5fC0teG1sIFtGSUxFXV1cbiIsIGFyZ3ZbMF0pOworICAgICAgICByZXR1cm4gMTsKKyAgICB9CisKKyAgICBpZiAoIWxlZ2FjeUZvcm1hdCkgeworICAgICAgICBzc2l6ZV90IHJldCA9IEVmZmVjdExvYWRYbWxFZmZlY3RDb25maWcocGF0aCk7CisgICAgICAgIGlmIChyZXQgPCAwKSB7CisgICAgICAgICAgICBmcHJpbnRmKHN0ZGVyciwgImxvYWRYbWxFZmZlY3RDb25maWcgZmFpbGVkLCBzZWUgbG9nY2F0IGZvciBkZXRhaWwuXG4iKTsKKyAgICAgICAgICAgIHJldHVybiAyOworICAgICAgICB9CisgICAgICAgIGlmIChyZXQgPiAwKSB7CisgICAgICAgICAgICBmcHJpbnRmKHN0ZGVyciwgIlBhcnRpYWxseSBmYWlsZWQgdG8gbG9hZCBjb25maWcuIFNraXBwZWQgJXp1IGVsZW1lbnRzLCAiCisgICAgICAgICAgICAgICAgICAgICJzZWUgbG9nY2F0IGZvciBkZXRhaWwuXG4iLCAoc2l6ZV90KXJldCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBpZiAobGVnYWN5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gICAgIDEyOAogI2RlZmluZSBMVkRCRV9DQVBfRlNfNDgwMDAgICAgICAgICAgICAgICAyNTYKKyNpZiBkZWZpbmVkKEJVSUxEX0ZMT0FUKSAmJiBkZWZpbmVkKEhJR0hFUl9GUykKKyNkZWZpbmUgTFZEQkVfQ0FQX0ZTXzk2MDAwICAgICAgICAgICAgICAgNTEyCisjZGVmaW5lIExWREJFX0NBUF9GU18xOTIwMDAgICAgICAgICAgICAgIDEwMjQKKyNlbmRpZgogCiB0eXBlZGVmIGVudW0KIHsKQEAgLTIxMCw2ICsyMTQsMTAgQEAKICAgICBMVkRCRV9GU18zMjAwMCA9IDYsCiAgICAgTFZEQkVfRlNfNDQxMDAgPSA3LAogICAgIExWREJFX0ZTXzQ4MDAwID0gOCwKKyNpZiBkZWZpbmVkKEJVSUxEX0ZMT0FUKSAmJiBkZWZpbmVkKEhJR0hFUl9GUykKKyAgICBMVkRCRV9GU185NjAwMCA9IDksCisgICAgTFZEQkVfRlNfMTkyMDAwID0gMTAsCisjZW5kaWYKICAgICBMVkRCRV9GU19NQVggICA9IExWTV9NQVhJTlRfMzIKIH0gTFZEQkVfRnNfZW47CiAKQEAgLTQ1MCwxMiArNDU4LDE3IEBACiAvKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KKyNpZmRlZiBCVUlMRF9GTE9BVAorTFZEQkVfUmV0dXJuU3RhdHVzX2VuIExWREJFX1Byb2Nlc3MoTFZEQkVfSGFuZGxlX3QgICAgICAgICAgaEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICAgICAgKnBJbkRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICAqcE91dERhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDE2ICAgICAgICAgICBOdW1TYW1wbGVzKTsKKyNlbHNlCiBMVkRCRV9SZXR1cm5TdGF0dXNfZW4gTFZEQkVfUHJvY2VzcyhMVkRCRV9IYW5kbGVfdCAgICAgICAgICBoSW5zdGFuY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMTYgICAgICAqcEluRGF0YSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICpwT3V0RGF0YSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgICAgICAgICAgIE51bVNhbXBsZXMpOwotCisjZW5kaWYKIAogI2lmZGVmIF9fY3BsdXNwbHVzCiB9CmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQmFzcy9zcmMvTFZEQkVfQ29lZmZzLmggYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQmFzcy9zcmMvTFZEQkVfQ29lZmZzLmgKaW5kZXggYjFlYmFkZi4uZjMyZWQzMCAxMDA2NDQKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0Jhc3Mvc3JjL0xWREJFX0NvZWZmcy5oCisrKyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9CYXNzL3NyYy9MVkRCRV9Db2VmZnMuaApAQCAtMTksNiArMTksNyBAQAogI2RlZmluZSBfX0xWREJFX0NPRUZGU19IX18KIAogCisjaWZuZGVmIEJVSUxEX0ZMT0FUCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qIEdlbmVyYWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCkBAIC01MTQsNSArNTE1LDYzMiBAQAogI2RlZmluZSBNSVhfVENfRnM0NDEwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzMjA5NyAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuOTc5NTE1ICovCiAjZGVmaW5lIE1JWF9UQ19GczQ4MDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMyMTUwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC45ODExNTAgKi8KIAorI2Vsc2UgLypCVUlMRF9GTE9BVCovCiAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogR2VuZXJhbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjZGVmaW5lIExWREJFX1NDQUxFU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMCAgICAgICAgIC8qIEFzIGEgcG93ZXIgb2YgMiAqLworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogSGlnaCBQYXNzIEZpbHRlciBjb2VmZmljaWVudHMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisgLyogQ29lZmZpY2llbnRzIGZvciBjZW50cmUgZnJlcXVlbmN5IDU1SHogKi8KKyNkZWZpbmUgSFBGX0ZzODAwMF9GYzU1X0EwICAgICAgICAgICAgICAgICAgICAgICAgMC45NTg4NDlmCisjZGVmaW5lIEhQRl9GczgwMDBfRmM1NV9BMSAgICAgICAgICAgICAgICAgICAgICAgIC0xLjkxNzY5OGYKKyNkZWZpbmUgSFBGX0ZzODAwMF9GYzU1X0EyICAgICAgICAgICAgICAgICAgICAgICAgMC45NTg4NDlmCisjZGVmaW5lIEhQRl9GczgwMDBfRmM1NV9CMSAgICAgICAgICAgICAgICAgICAgICAgIC0xLjkzOTAwMWYKKyNkZWZpbmUgSFBGX0ZzODAwMF9GYzU1X0IyICAgICAgICAgICAgICAgICAgICAgICAgMC45NDA4MDdmCisjZGVmaW5lIEhQRl9GczExMDI1X0ZjNTVfQTAgICAgICAgICAgICAgICAgICAgICAgIDAuOTY2OTA5ZgorI2RlZmluZSBIUEZfRnMxMTAyNV9GYzU1X0ExICAgICAgICAgICAgICAgICAgICAgICAtMS45MzM4MThmCisjZGVmaW5lIEhQRl9GczExMDI1X0ZjNTVfQTIgICAgICAgICAgICAgICAgICAgICAgIDAuOTY2OTA5ZgorI2RlZmluZSBIUEZfRnMxMTAyNV9GYzU1X0IxICAgICAgICAgICAgICAgICAgICAgICAtMS45NTU3MzJmCisjZGVmaW5lIEhQRl9GczExMDI1X0ZjNTVfQjIgICAgICAgICAgICAgICAgICAgICAgIDAuOTU2NjkwZgorI2RlZmluZSBIUEZfRnMxMjAwMF9GYzU1X0EwICAgICAgICAgICAgICAgICAgICAgICAwLjk2ODY1MGYKKyNkZWZpbmUgSFBGX0ZzMTIwMDBfRmM1NV9BMSAgICAgICAgICAgICAgICAgICAgICAgLTEuOTM3MzAwZgorI2RlZmluZSBIUEZfRnMxMjAwMF9GYzU1X0EyICAgICAgICAgICAgICAgICAgICAgICAwLjk2ODY1MGYKKyNkZWZpbmUgSFBGX0ZzMTIwMDBfRmM1NV9CMSAgICAgICAgICAgICAgICAgICAgICAgLTEuOTU5MzI3ZgorI2RlZmluZSBIUEZfRnMxMjAwMF9GYzU1X0IyICAgICAgICAgICAgICAgICAgICAgICAwLjk2MDEzOGYKKyNkZWZpbmUgSFBGX0ZzMTYwMDBfRmM1NV9BMCAgICAgICAgICAgICAgICAgICAgICAgMC45NzM1ODhmCisjZGVmaW5lIEhQRl9GczE2MDAwX0ZjNTVfQTEgICAgICAgICAgICAgICAgICAgICAgIC0xLjk0NzE3NmYKKyNkZWZpbmUgSFBGX0ZzMTYwMDBfRmM1NV9BMiAgICAgICAgICAgICAgICAgICAgICAgMC45NzM1ODhmCisjZGVmaW5lIEhQRl9GczE2MDAwX0ZjNTVfQjEgICAgICAgICAgICAgICAgICAgICAgIC0xLjk2OTQ5NGYKKyNkZWZpbmUgSFBGX0ZzMTYwMDBfRmM1NV9CMiAgICAgICAgICAgICAgICAgICAgICAgMC45Njk5NTJmCisjZGVmaW5lIEhQRl9GczIyMDUwX0ZjNTVfQTAgICAgICAgICAgICAgICAgICAgICAgIDAuOTc3NjcxZgorI2RlZmluZSBIUEZfRnMyMjA1MF9GYzU1X0ExICAgICAgICAgICAgICAgICAgICAgICAtMS45NTUzNDNmCisjZGVmaW5lIEhQRl9GczIyMDUwX0ZjNTVfQTIgICAgICAgICAgICAgICAgICAgICAgIDAuOTc3NjcxZgorI2RlZmluZSBIUEZfRnMyMjA1MF9GYzU1X0IxICAgICAgICAgICAgICAgICAgICAgICAtMS45Nzc4NjNmCisjZGVmaW5lIEhQRl9GczIyMDUwX0ZjNTVfQjIgICAgICAgICAgICAgICAgICAgICAgIDAuOTc4MTA1ZgorI2RlZmluZSBIUEZfRnMyNDAwMF9GYzU1X0EwICAgICAgICAgICAgICAgICAgICAgICAwLjk3ODU1MWYKKyNkZWZpbmUgSFBGX0ZzMjQwMDBfRmM1NV9BMSAgICAgICAgICAgICAgICAgICAgICAgLTEuOTU3MTAyZgorI2RlZmluZSBIUEZfRnMyNDAwMF9GYzU1X0EyICAgICAgICAgICAgICAgICAgICAgICAwLjk3ODU1MWYKKyNkZWZpbmUgSFBGX0ZzMjQwMDBfRmM1NV9CMSAgICAgICAgICAgICAgICAgICAgICAgLTEuOTc5NjYyZgorI2RlZmluZSBIUEZfRnMyNDAwMF9GYzU1X0IyICAgICAgICAgICAgICAgICAgICAgICAwLjk3OTg2NmYKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfRmM1NV9BMCAgICAgICAgICAgICAgICAgICAgICAgMC45ODEwNDJmCisjZGVmaW5lIEhQRl9GczMyMDAwX0ZjNTVfQTEgICAgICAgICAgICAgICAgICAgICAgIC0xLjk2MjA4NGYKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfRmM1NV9BMiAgICAgICAgICAgICAgICAgICAgICAgMC45ODEwNDJmCisjZGVmaW5lIEhQRl9GczMyMDAwX0ZjNTVfQjEgICAgICAgICAgICAgICAgICAgICAgIC0xLjk4NDc0NmYKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfRmM1NV9CMiAgICAgICAgICAgICAgICAgICAgICAgMC45ODQ4NjFmCisjZGVmaW5lIEhQRl9GczQ0MTAwX0ZjNTVfQTAgICAgICAgICAgICAgICAgICAgICAgIDAuOTgzMDk3ZgorI2RlZmluZSBIUEZfRnM0NDEwMF9GYzU1X0ExICAgICAgICAgICAgICAgICAgICAgICAtMS45NjYxOTRmCisjZGVmaW5lIEhQRl9GczQ0MTAwX0ZjNTVfQTIgICAgICAgICAgICAgICAgICAgICAgIDAuOTgzMDk3ZgorI2RlZmluZSBIUEZfRnM0NDEwMF9GYzU1X0IxICAgICAgICAgICAgICAgICAgICAgICAtMS45ODg5MzFmCisjZGVmaW5lIEhQRl9GczQ0MTAwX0ZjNTVfQjIgICAgICAgICAgICAgICAgICAgICAgIDAuOTg4OTkyZgorI2RlZmluZSBIUEZfRnM0ODAwMF9GYzU1X0EwICAgICAgICAgICAgICAgICAgICAgICAwLjk4MzUzOWYKKyNkZWZpbmUgSFBGX0ZzNDgwMDBfRmM1NV9BMSAgICAgICAgICAgICAgICAgICAgICAgLTEuOTY3MDc5ZgorI2RlZmluZSBIUEZfRnM0ODAwMF9GYzU1X0EyICAgICAgICAgICAgICAgICAgICAgICAwLjk4MzUzOWYKKyNkZWZpbmUgSFBGX0ZzNDgwMDBfRmM1NV9CMSAgICAgICAgICAgICAgICAgICAgICAgLTEuOTg5ODMxZgorI2RlZmluZSBIUEZfRnM0ODAwMF9GYzU1X0IyICAgICAgICAgICAgICAgICAgICAgICAwLjk4OTg4MmYKKworI2lmZGVmIEhJR0hFUl9GUworI2RlZmluZSBIUEZfRnM5NjAwMF9GYzU1X0EwICAgICAgICAgICAgICAgICAgICAgICAwLjk4NjA0MGYKKyNkZWZpbmUgSFBGX0ZzOTYwMDBfRmM1NV9BMSAgICAgICAgICAgICAgICAgICAgICAgLTEuOTcyMDgwZgorI2RlZmluZSBIUEZfRnM5NjAwMF9GYzU1X0EyICAgICAgICAgICAgICAgICAgICAgICAwLjk4NjA0MGYKKyNkZWZpbmUgSFBGX0ZzOTYwMDBfRmM1NV9CMSAgICAgICAgICAgICAgICAgICAgICAgLTEuOTk0OTE1ZgorI2RlZmluZSBIUEZfRnM5NjAwMF9GYzU1X0IyICAgICAgICAgICAgICAgICAgICAgICAwLjk5NDkyOGYKKworI2RlZmluZSBIUEZfRnMxOTIwMDBfRmM1NV9BMCAgICAgICAgICAgICAgICAgICAgICAwLjk4NzI5NGYKKyNkZWZpbmUgSFBGX0ZzMTkyMDAwX0ZjNTVfQTEgICAgICAgICAgICAgICAgICAgICAgLTEuOTc0NTg4ZgorI2RlZmluZSBIUEZfRnMxOTIwMDBfRmM1NV9BMiAgICAgICAgICAgICAgICAgICAgICAwLjk4NzI5NGYKKyNkZWZpbmUgSFBGX0ZzMTkyMDAwX0ZjNTVfQjEgICAgICAgICAgICAgICAgICAgICAgLTEuOTk3NDU4ZgorI2RlZmluZSBIUEZfRnMxOTIwMDBfRmM1NV9CMiAgICAgICAgICAgICAgICAgICAgICAwLjk5NzQ2MWYKICNlbmRpZgorCisKKyAvKiBDb2VmZmljaWVudHMgZm9yIGNlbnRyZSBmcmVxdWVuY3kgNjZIeiAqLworI2RlZmluZSBIUEZfRnM4MDAwX0ZjNjZfQTAgICAgICAgICAgICAgICAgICAgICAgICAwLjk1MzAxNmYKKyNkZWZpbmUgSFBGX0ZzODAwMF9GYzY2X0ExICAgICAgICAgICAgICAgICAgICAgICAgLTEuOTA2MDMyZgorI2RlZmluZSBIUEZfRnM4MDAwX0ZjNjZfQTIgICAgICAgICAgICAgICAgICAgICAgICAwLjk1MzAxNmYKKyNkZWZpbmUgSFBGX0ZzODAwMF9GYzY2X0IxICAgICAgICAgICAgICAgICAgICAgICAgLTEuOTI2ODEwZgorI2RlZmluZSBIUEZfRnM4MDAwX0ZjNjZfQjIgICAgICAgICAgICAgICAgICAgICAgICAwLjkyOTM5NmYKKyNkZWZpbmUgSFBGX0ZzMTEwMjVfRmM2Nl9BMCAgICAgICAgICAgICAgICAgICAgICAgMC45NjI2MzhmCisjZGVmaW5lIEhQRl9GczExMDI1X0ZjNjZfQTEgICAgICAgICAgICAgICAgICAgICAgIC0xLjkyNTI3NWYKKyNkZWZpbmUgSFBGX0ZzMTEwMjVfRmM2Nl9BMiAgICAgICAgICAgICAgICAgICAgICAgMC45NjI2MzhmCisjZGVmaW5lIEhQRl9GczExMDI1X0ZjNjZfQjEgICAgICAgICAgICAgICAgICAgICAgIC0xLjk0Njg4MWYKKyNkZWZpbmUgSFBGX0ZzMTEwMjVfRmM2Nl9CMiAgICAgICAgICAgICAgICAgICAgICAgMC45NDgyNTZmCisjZGVmaW5lIEhQRl9GczEyMDAwX0ZjNjZfQTAgICAgICAgICAgICAgICAgICAgICAgIDAuOTY0NzE4ZgorI2RlZmluZSBIUEZfRnMxMjAwMF9GYzY2X0ExICAgICAgICAgICAgICAgICAgICAgICAtMS45Mjk0MzVmCisjZGVmaW5lIEhQRl9GczEyMDAwX0ZjNjZfQTIgICAgICAgICAgICAgICAgICAgICAgIDAuOTY0NzE4ZgorI2RlZmluZSBIUEZfRnMxMjAwMF9GYzY2X0IxICAgICAgICAgICAgICAgICAgICAgICAtMS45NTExOTZmCisjZGVmaW5lIEhQRl9GczEyMDAwX0ZjNjZfQjIgICAgICAgICAgICAgICAgICAgICAgIDAuOTUyMzU5ZgorI2RlZmluZSBIUEZfRnMxNjAwMF9GYzY2X0EwICAgICAgICAgICAgICAgICAgICAgICAwLjk3MDYyMmYKKyNkZWZpbmUgSFBGX0ZzMTYwMDBfRmM2Nl9BMSAgICAgICAgICAgICAgICAgICAgICAgLTEuOTQxMjQ0ZgorI2RlZmluZSBIUEZfRnMxNjAwMF9GYzY2X0EyICAgICAgICAgICAgICAgICAgICAgICAwLjk3MDYyMmYKKyNkZWZpbmUgSFBGX0ZzMTYwMDBfRmM2Nl9CMSAgICAgICAgICAgICAgICAgICAgICAgLTEuOTYzMzk0ZgorI2RlZmluZSBIUEZfRnMxNjAwMF9GYzY2X0IyICAgICAgICAgICAgICAgICAgICAgICAwLjk2NDA1MmYKKyNkZWZpbmUgSFBGX0ZzMjIwNTBfRmM2Nl9BMCAgICAgICAgICAgICAgICAgICAgICAgMC45NzU1MDlmCisjZGVmaW5lIEhQRl9GczIyMDUwX0ZjNjZfQTEgICAgICAgICAgICAgICAgICAgICAgIC0xLjk1MTAxOWYKKyNkZWZpbmUgSFBGX0ZzMjIwNTBfRmM2Nl9BMiAgICAgICAgICAgICAgICAgICAgICAgMC45NzU1MDlmCisjZGVmaW5lIEhQRl9GczIyMDUwX0ZjNjZfQjEgICAgICAgICAgICAgICAgICAgICAgIC0xLjk3MzQzNmYKKyNkZWZpbmUgSFBGX0ZzMjIwNTBfRmM2Nl9CMiAgICAgICAgICAgICAgICAgICAgICAgMC45NzM3ODRmCisjZGVmaW5lIEhQRl9GczI0MDAwX0ZjNjZfQTAgICAgICAgICAgICAgICAgICAgICAgIDAuOTc2NTYzZgorI2RlZmluZSBIUEZfRnMyNDAwMF9GYzY2X0ExICAgICAgICAgICAgICAgICAgICAgICAtMS45NTMxMjVmCisjZGVmaW5lIEhQRl9GczI0MDAwX0ZjNjZfQTIgICAgICAgICAgICAgICAgICAgICAgIDAuOTc2NTYzZgorI2RlZmluZSBIUEZfRnMyNDAwMF9GYzY2X0IxICAgICAgICAgICAgICAgICAgICAgICAtMS45NzU1OTRmCisjZGVmaW5lIEhQRl9GczI0MDAwX0ZjNjZfQjIgICAgICAgICAgICAgICAgICAgICAgIDAuOTc1ODg5ZgorI2RlZmluZSBIUEZfRnMzMjAwMF9GYzY2X0EwICAgICAgICAgICAgICAgICAgICAgICAwLjk3OTU0N2YKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfRmM2Nl9BMSAgICAgICAgICAgICAgICAgICAgICAgLTEuOTU5MDkzZgorI2RlZmluZSBIUEZfRnMzMjAwMF9GYzY2X0EyICAgICAgICAgICAgICAgICAgICAgICAwLjk3OTU0N2YKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfRmM2Nl9CMSAgICAgICAgICAgICAgICAgICAgICAgLTEuOTgxNjk1ZgorI2RlZmluZSBIUEZfRnMzMjAwMF9GYzY2X0IyICAgICAgICAgICAgICAgICAgICAgICAwLjk4MTg2MWYKKyNkZWZpbmUgSFBGX0ZzNDQxMDBfRmM2Nl9BMCAgICAgICAgICAgICAgICAgICAgICAgMC45ODIwMTBmCisjZGVmaW5lIEhQRl9GczQ0MTAwX0ZjNjZfQTEgICAgICAgICAgICAgICAgICAgICAgIC0xLjk2NDAxOWYKKyNkZWZpbmUgSFBGX0ZzNDQxMDBfRmM2Nl9BMiAgICAgICAgICAgICAgICAgICAgICAgMC45ODIwMTBmCisjZGVmaW5lIEhQRl9GczQ0MTAwX0ZjNjZfQjEgICAgICAgICAgICAgICAgICAgICAgIC0xLjk4NjcxOGYKKyNkZWZpbmUgSFBGX0ZzNDQxMDBfRmM2Nl9CMiAgICAgICAgICAgICAgICAgICAgICAgMC45ODY4MDVmCisjZGVmaW5lIEhQRl9GczQ4MDAwX0ZjNjZfQTAgICAgICAgICAgICAgICAgICAgICAgIDAuOTgyNTQwZgorI2RlZmluZSBIUEZfRnM0ODAwMF9GYzY2X0ExICAgICAgICAgICAgICAgICAgICAgICAtMS45NjUwNzlmCisjZGVmaW5lIEhQRl9GczQ4MDAwX0ZjNjZfQTIgICAgICAgICAgICAgICAgICAgICAgIDAuOTgyNTQwZgorI2RlZmluZSBIUEZfRnM0ODAwMF9GYzY2X0IxICAgICAgICAgICAgICAgICAgICAgICAtMS45ODc3OTdmCisjZGVmaW5lIEhQRl9GczQ4MDAwX0ZjNjZfQjIgICAgICAgICAgICAgICAgICAgICAgIDAuOTg3ODcxZgorCisjaWZkZWYgSElHSEVSX0ZTCisjZGVmaW5lIEhQRl9Gczk2MDAwX0ZjNjZfQTAgICAgICAgICAgICAgICAgICAgICAgIDAuOTg1NTM5ZgorI2RlZmluZSBIUEZfRnM5NjAwMF9GYzY2X0ExICAgICAgICAgICAgICAgICAgICAgICAtMS45NzEwNzdmCisjZGVmaW5lIEhQRl9Gczk2MDAwX0ZjNjZfQTIgICAgICAgICAgICAgICAgICAgICAgIDAuOTg1NTM5ZgorI2RlZmluZSBIUEZfRnM5NjAwMF9GYzY2X0IxICAgICAgICAgICAgICAgICAgICAgICAtMS45OTM4OThmCisjZGVmaW5lIEhQRl9Gczk2MDAwX0ZjNjZfQjIgICAgICAgICAgICAgICAgICAgICAgIDAuOTkzOTE3ZgorCisjZGVmaW5lIEhQRl9GczE5MjAwMF9GYzY2X0EwICAgICAgICAgICAgICAgICAgICAgIDAuOTg3MDQzZgorI2RlZmluZSBIUEZfRnMxOTIwMDBfRmM2Nl9BMSAgICAgICAgICAgICAgICAgICAgICAtMS45NzQwODZmCisjZGVmaW5lIEhQRl9GczE5MjAwMF9GYzY2X0EyICAgICAgICAgICAgICAgICAgICAgIDAuOTg3MDQzZgorI2RlZmluZSBIUEZfRnMxOTIwMDBfRmM2Nl9CMSAgICAgICAgICAgICAgICAgICAgICAtMS45OTY5NDlmCisjZGVmaW5lIEhQRl9GczE5MjAwMF9GYzY2X0IyICAgICAgICAgICAgICAgICAgICAgIDAuOTk2OTU0ZgorI2VuZGlmCisKKy8qIENvZWZmaWNpZW50cyBmb3IgY2VudHJlIGZyZXF1ZW5jeSA3OEh6ICovCisjZGVmaW5lIEhQRl9GczgwMDBfRmM3OF9BMCAgICAgICAgICAgICAgICAgICAgICAgIDAuOTQ2NjkzZgorI2RlZmluZSBIUEZfRnM4MDAwX0ZjNzhfQTEgICAgICAgICAgICAgICAgICAgICAgICAtMS44OTMzODdmCisjZGVmaW5lIEhQRl9GczgwMDBfRmM3OF9BMiAgICAgICAgICAgICAgICAgICAgICAgIDAuOTQ2NjkzZgorI2RlZmluZSBIUEZfRnM4MDAwX0ZjNzhfQjEgICAgICAgICAgICAgICAgICAgICAgICAtMS45MTM1MTdmCisjZGVmaW5lIEhQRl9GczgwMDBfRmM3OF9CMiAgICAgICAgICAgICAgICAgICAgICAgIDAuOTE3MTA1ZgorI2RlZmluZSBIUEZfRnMxMTAyNV9GYzc4X0EwICAgICAgICAgICAgICAgICAgICAgICAwLjk1Nzk5OWYKKyNkZWZpbmUgSFBGX0ZzMTEwMjVfRmM3OF9BMSAgICAgICAgICAgICAgICAgICAgICAgLTEuOTE1OTk4ZgorI2RlZmluZSBIUEZfRnMxMTAyNV9GYzc4X0EyICAgICAgICAgICAgICAgICAgICAgICAwLjk1Nzk5OWYKKyNkZWZpbmUgSFBGX0ZzMTEwMjVfRmM3OF9CMSAgICAgICAgICAgICAgICAgICAgICAgLTEuOTM3MjI5ZgorI2RlZmluZSBIUEZfRnMxMTAyNV9GYzc4X0IyICAgICAgICAgICAgICAgICAgICAgICAwLjkzOTE0MGYKKyNkZWZpbmUgSFBGX0ZzMTIwMDBfRmM3OF9BMCAgICAgICAgICAgICAgICAgICAgICAgMC45NjA0NDZmCisjZGVmaW5lIEhQRl9GczEyMDAwX0ZjNzhfQTEgICAgICAgICAgICAgICAgICAgICAgIC0xLjkyMDg5MmYKKyNkZWZpbmUgSFBGX0ZzMTIwMDBfRmM3OF9BMiAgICAgICAgICAgICAgICAgICAgICAgMC45NjA0NDZmCisjZGVmaW5lIEhQRl9GczEyMDAwX0ZjNzhfQjEgICAgICAgICAgICAgICAgICAgICAgIC0xLjk0MjMyNmYKKyNkZWZpbmUgSFBGX0ZzMTIwMDBfRmM3OF9CMiAgICAgICAgICAgICAgICAgICAgICAgMC45NDM5NDRmCisjZGVmaW5lIEhQRl9GczE2MDAwX0ZjNzhfQTAgICAgICAgICAgICAgICAgICAgICAgIDAuOTY3Mzk3ZgorI2RlZmluZSBIUEZfRnMxNjAwMF9GYzc4X0ExICAgICAgICAgICAgICAgICAgICAgICAtMS45MzQ3OTRmCisjZGVmaW5lIEhQRl9GczE2MDAwX0ZjNzhfQTIgICAgICAgICAgICAgICAgICAgICAgIDAuOTY3Mzk3ZgorI2RlZmluZSBIUEZfRnMxNjAwMF9GYzc4X0IxICAgICAgICAgICAgICAgICAgICAgICAtMS45NTY3NDBmCisjZGVmaW5lIEhQRl9GczE2MDAwX0ZjNzhfQjIgICAgICAgICAgICAgICAgICAgICAgIDAuOTU3NjU2ZgorI2RlZmluZSBIUEZfRnMyMjA1MF9GYzc4X0EwICAgICAgICAgICAgICAgICAgICAgICAwLjk3MzE1NmYKKyNkZWZpbmUgSFBGX0ZzMjIwNTBfRmM3OF9BMSAgICAgICAgICAgICAgICAgICAgICAgLTEuOTQ2MzEzZgorI2RlZmluZSBIUEZfRnMyMjA1MF9GYzc4X0EyICAgICAgICAgICAgICAgICAgICAgICAwLjk3MzE1NmYKKyNkZWZpbmUgSFBGX0ZzMjIwNTBfRmM3OF9CMSAgICAgICAgICAgICAgICAgICAgICAgLTEuOTY4NjA3ZgorI2RlZmluZSBIUEZfRnMyMjA1MF9GYzc4X0IyICAgICAgICAgICAgICAgICAgICAgICAwLjk2OTA5MmYKKyNkZWZpbmUgSFBGX0ZzMjQwMDBfRmM3OF9BMCAgICAgICAgICAgICAgICAgICAgICAgMC45NzQzOThmCisjZGVmaW5lIEhQRl9GczI0MDAwX0ZjNzhfQTEgICAgICAgICAgICAgICAgICAgICAgIC0xLjk0ODc5N2YKKyNkZWZpbmUgSFBGX0ZzMjQwMDBfRmM3OF9BMiAgICAgICAgICAgICAgICAgICAgICAgMC45NzQzOThmCisjZGVmaW5lIEhQRl9GczI0MDAwX0ZjNzhfQjEgICAgICAgICAgICAgICAgICAgICAgIC0xLjk3MTE1N2YKKyNkZWZpbmUgSFBGX0ZzMjQwMDBfRmM3OF9CMiAgICAgICAgICAgICAgICAgICAgICAgMC45NzE1NjhmCisjZGVmaW5lIEhQRl9GczMyMDAwX0ZjNzhfQTAgICAgICAgICAgICAgICAgICAgICAgIDAuOTc3OTE4ZgorI2RlZmluZSBIUEZfRnMzMjAwMF9GYzc4X0ExICAgICAgICAgICAgICAgICAgICAgICAtMS45NTU4MzZmCisjZGVmaW5lIEhQRl9GczMyMDAwX0ZjNzhfQTIgICAgICAgICAgICAgICAgICAgICAgIDAuOTc3OTE4ZgorI2RlZmluZSBIUEZfRnMzMjAwMF9GYzc4X0IxICAgICAgICAgICAgICAgICAgICAgICAtMS45NzgzNjdmCisjZGVmaW5lIEhQRl9GczMyMDAwX0ZjNzhfQjIgICAgICAgICAgICAgICAgICAgICAgIDAuOTc4NTk5ZgorI2RlZmluZSBIUEZfRnM0NDEwMF9GYzc4X0EwICAgICAgICAgICAgICAgICAgICAgICAwLjk4MDgyNGYKKyNkZWZpbmUgSFBGX0ZzNDQxMDBfRmM3OF9BMSAgICAgICAgICAgICAgICAgICAgICAgLTEuOTYxNjQ5ZgorI2RlZmluZSBIUEZfRnM0NDEwMF9GYzc4X0EyICAgICAgICAgICAgICAgICAgICAgICAwLjk4MDgyNGYKKyNkZWZpbmUgSFBGX0ZzNDQxMDBfRmM3OF9CMSAgICAgICAgICAgICAgICAgICAgICAgLTEuOTg0MzAzZgorI2RlZmluZSBIUEZfRnM0NDEwMF9GYzc4X0IyICAgICAgICAgICAgICAgICAgICAgICAwLjk4NDQyNWYKKyNkZWZpbmUgSFBGX0ZzNDgwMDBfRmM3OF9BMCAgICAgICAgICAgICAgICAgICAgICAgMC45ODE0NTBmCisjZGVmaW5lIEhQRl9GczQ4MDAwX0ZjNzhfQTEgICAgICAgICAgICAgICAgICAgICAgIC0xLjk2MjkwMGYKKyNkZWZpbmUgSFBGX0ZzNDgwMDBfRmM3OF9BMiAgICAgICAgICAgICAgICAgICAgICAgMC45ODE0NTBmCisjZGVmaW5lIEhQRl9GczQ4MDAwX0ZjNzhfQjEgICAgICAgICAgICAgICAgICAgICAgIC0xLjk4NTU3OGYKKyNkZWZpbmUgSFBGX0ZzNDgwMDBfRmM3OF9CMiAgICAgICAgICAgICAgICAgICAgICAgMC45ODU2ODFmCisKKyNpZmRlZiBISUdIR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gICAgMC45NDA0MTJmCisjZGVmaW5lIEhQRl9GczgwMDBfRmM5MF9CMSAgICAgICAgICAgICAgICAgICAgICAgLTEuOTAwMjMxZgorI2RlZmluZSBIUEZfRnM4MDAwX0ZjOTBfQjIgICAgICAgICAgICAgICAgICAgICAgIDAuOTA0OTc3ZgorI2RlZmluZSBIUEZfRnMxMTAyNV9GYzkwX0EwICAgICAgICAgICAgICAgICAgICAgIDAuOTUzMzgzZgorI2RlZmluZSBIUEZfRnMxMTAyNV9GYzkwX0ExICAgICAgICAgICAgICAgICAgICAgIC0xLjkwNjc2NmYKKyNkZWZpbmUgSFBGX0ZzMTEwMjVfRmM5MF9BMiAgICAgICAgICAgICAgICAgICAgICAwLjk1MzM4M2YKKyNkZWZpbmUgSFBGX0ZzMTEwMjVfRmM5MF9CMSAgICAgICAgICAgICAgICAgICAgICAtMS45Mjc1NzlmCisjZGVmaW5lIEhQRl9GczExMDI1X0ZjOTBfQjIgICAgICAgICAgICAgICAgICAgICAgMC45MzAxMTFmCisjZGVmaW5lIEhQRl9GczEyMDAwX0ZjOTBfQTAgICAgICAgICAgICAgICAgICAgICAgMC45NTYxOTNmCisjZGVmaW5lIEhQRl9GczEyMDAwX0ZjOTBfQTEgICAgICAgICAgICAgICAgICAgICAgLTEuOTEyMzg3ZgorI2RlZmluZSBIUEZfRnMxMjAwMF9GYzkwX0EyICAgICAgICAgICAgICAgICAgICAgIDAuOTU2MTkzZgorI2RlZmluZSBIUEZfRnMxMjAwMF9GYzkwX0IxICAgICAgICAgICAgICAgICAgICAgIC0xLjkzMzQ1OWYKKyNkZWZpbmUgSFBGX0ZzMTIwMDBfRmM5MF9CMiAgICAgICAgICAgICAgICAgICAgICAwLjkzNTYwM2YKKyNkZWZpbmUgSFBGX0ZzMTYwMDBfRmM5MF9BMCAgICAgICAgICAgICAgICAgICAgICAwLjk2NDE4M2YKKyNkZWZpbmUgSFBGX0ZzMTYwMDBfRmM5MF9BMSAgICAgICAgICAgICAgICAgICAgICAtMS45MjgzNjVmCisjZGVmaW5lIEhQRl9GczE2MDAwX0ZjOTBfQTIgICAgICAgICAgICAgICAgICAgICAgMC45NjQxODNmCisjZGVmaW5lIEhQRl9GczE2MDAwX0ZjOTBfQjEgICAgICAgICAgICAgICAgICAgICAgLTEuOTUwMDg3ZgorI2RlZmluZSBIUEZfRnMxNjAwMF9GYzkwX0IyICAgICAgICAgICAgICAgICAgICAgIDAuOTUxMzAzZgorI2RlZmluZSBIUEZfRnMyMjA1MF9GYzkwX0EwICAgICAgICAgICAgICAgICAgICAgIDAuOTcwODA5ZgorI2RlZmluZSBIUEZfRnMyMjA1MF9GYzkwX0ExICAgICAgICAgICAgICAgICAgICAgIC0xLjk0MTYxOGYKKyNkZWZpbmUgSFBGX0ZzMjIwNTBfRmM5MF9BMiAgICAgICAgICAgICAgICAgICAgICAwLjk3MDgwOWYKKyNkZWZpbmUgSFBGX0ZzMjIwNTBfRmM5MF9CMSAgICAgICAgICAgICAgICAgICAgICAtMS45NjM3NzhmCisjZGVmaW5lIEhQRl9GczIyMDUwX0ZjOTBfQjIgICAgICAgICAgICAgICAgICAgICAgMC45NjQ0MjNmCisjZGVmaW5lIEhQRl9GczI0MDAwX0ZjOTBfQTAgICAgICAgICAgICAgICAgICAgICAgMC45NzIyMzlmCisjZGVmaW5lIEhQRl9GczI0MDAwX0ZjOTBfQTEgICAgICAgICAgICAgICAgICAgICAgLTEuOTQ0NDc3ZgorI2RlZmluZSBIUEZfRnMyNDAwMF9GYzkwX0EyICAgICAgICAgICAgICAgICAgICAgIDAuOTcyMjM5ZgorI2RlZmluZSBIUEZfRnMyNDAwMF9GYzkwX0IxICAgICAgICAgICAgICAgICAgICAgIC0xLjk2NjcyMWYKKyNkZWZpbmUgSFBGX0ZzMjQwMDBfRmM5MF9CMiAgICAgICAgICAgICAgICAgICAgICAwLjk2NzI2NmYKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfRmM5MF9BMCAgICAgICAgICAgICAgICAgICAgICAwLjk3NjI5MmYKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfRmM5MF9BMSAgICAgICAgICAgICAgICAgICAgICAtMS45NTI1ODRmCisjZGVmaW5lIEhQRl9GczMyMDAwX0ZjOTBfQTIgICAgICAgICAgICAgICAgICAgICAgMC45NzYyOTJmCisjZGVmaW5lIEhQRl9GczMyMDAwX0ZjOTBfQjEgICAgICAgICAgICAgICAgICAgICAgLTEuOTc1MDQwZgorI2RlZmluZSBIUEZfRnMzMjAwMF9GYzkwX0IyICAgICAgICAgICAgICAgICAgICAgIDAuOTc1MzQ3ZgorI2RlZmluZSBIUEZfRnM0NDEwMF9GYzkwX0EwICAgICAgICAgICAgICAgICAgICAgIDAuOTc5NjQxZgorI2RlZmluZSBIUEZfRnM0NDEwMF9GYzkwX0ExICAgICAgICAgICAgICAgICAgICAgIC0xLjk1OTI4MmYKKyNkZWZpbmUgSFBGX0ZzNDQxMDBfRmM5MF9BMiAgICAgICAgICAgICAgICAgICAgICAwLjk3OTY0MWYKKyNkZWZpbmUgSFBGX0ZzNDQxMDBfRmM5MF9CMSAgICAgICAgICAgICAgICAgICAgICAtMS45ODE4ODhmCisjZGVmaW5lIEhQRl9GczQ0MTAwX0ZjOTBfQjIgICAgICAgICAgICAgICAgICAgICAgMC45ODIwNTBmCisjZGVmaW5lIEhQRl9GczQ4MDAwX0ZjOTBfQTAgICAgICAgICAgICAgICAgICAgICAgMC45ODAzNjJmCisjZGVmaW5lIEhQRl9GczQ4MDAwX0ZjOTBfQTEgICAgICAgICAgICAgICAgICAgICAgLTEuOTYwNzI0ZgorI2RlZmluZSBIUEZfRnM0ODAwMF9GYzkwX0EyICAgICAgICAgICAgICAgICAgICAgIDAuOTgwMzYyZgorI2RlZmluZSBIUEZfRnM0ODAwMF9GYzkwX0IxICAgICAgICAgICAgICAgICAgICAgIC0xLjk4MzM1OWYKKyNkZWZpbmUgSFBGX0ZzNDgwMDBfRmM5MF9CMiAgICAgICAgICAgICAgICAgICAgICAwLjk4MzQ5N2YKKworI2lmZGVmIEhJR0hFUl9GUworI2RlZmluZSBIUEZfRnM5NjAwMF9GYzkwX0EwICAgICAgICAgICAgICAgICAgICAgICAwLjk4NDQ0NmYKKyNkZWZpbmUgSFBGX0ZzOTYwMDBfRmM5MF9BMSAgICAgICAgICAgICAgICAgICAgICAgLTEuOTY4ODkyZgorI2RlZmluZSBIUEZfRnM5NjAwMF9GYzkwX0EyICAgICAgICAgICAgICAgICAgICAgICAwLjk4NDQ0NmYKKyNkZWZpbmUgSFBGX0ZzOTYwMDBfRmM5MF9CMSAgICAgICAgICAgICAgICAgICAgICAgLTEuOTkxNjgwZgorI2RlZmluZSBIUEZfRnM5NjAwMF9GYzkwX0IyICAgICAgICAgICAgICAgICAgICAgICAwLjk5MTcxNGYKKworI2RlZmluZSBIUEZfRnMxOTIwMDBfRmM5MF9BMCAgICAgICAgICAgICAgICAgICAgICAwLjk4NjQ5NmYKKyNkZWZpbmUgSFBGX0ZzMTkyMDAwX0ZjOTBfQTEgICAgICAgICAgICAgICAgICAgICAgLTEuOTcyOTkyZgorI2RlZmluZSBIUEZfRnMxOTIwMDBfRmM5MF9BMiAgICAgICAgICAgICAgICAgICAgICAwLjk4NjQ5NmYKKyNkZWZpbmUgSFBGX0ZzMTkyMDAwX0ZjOTBfQjEgICAgICAgICAgICAgICAgICAgICAgLTEuOTk1ODQwZgorI2RlZmluZSBIUEZfRnMxOTIwMDBfRmM5MF9CMiAgICAgICAgICAgICAgICAgICAgICAwLjk5NTg0OGYKKyNlbmRpZgorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIEJhbmQgUGFzcyBGaWx0ZXIgY29lZmZpY2llbnRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyogQ29lZmZpY2llbnRzIGZvciBjZW50cmUgZnJlcXVlbmN5IDU1SHogKi8KKyNkZWZpbmUgQlBGX0ZzODAwMF9GYzU1X0EwICAgICAgICAgICAgICAgICAgICAgICAwLjAwOTE5N2YKKyNkZWZpbmUgQlBGX0ZzODAwMF9GYzU1X0ExICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMGYKKyNkZWZpbmUgQlBGX0ZzODAwMF9GYzU1X0EyICAgICAgICAgICAgICAgICAgICAgICAtMC4wMDkxOTdmCisjZGVmaW5lIEJQRl9GczgwMDBfRmM1NV9CMSAgICAgICAgICAgICAgICAgICAgICAgLTEuOTc5NTQ1ZgorI2RlZmluZSBCUEZfRnM4MDAwX0ZjNTVfQjIgICAgICAgICAgICAgICAgICAgICAgIDAuOTgxMzkzZgorI2RlZmluZSBCUEZfRnMxMTAyNV9GYzU1X0EwICAgICAgICAgICAgICAgICAgICAgIDAuMDA2NjkxZgorI2RlZmluZSBCUEZfRnMxMTAyNV9GYzU1X0ExICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwZgorI2RlZmluZSBCUEZfRnMxMTAyNV9GYzU1X0EyICAgICAgICAgICAgICAgICAgICAgIC0wLjAwNjY5MWYKKyNkZWZpbmUgQlBGX0ZzMTEwMjVfRmM1NV9CMSAgICAgICAgICAgICAgICAgICAgICAtMS45ODU0ODhmCisjZGVmaW5lIEJQRl9GczExMDI1X0ZjNTVfQjIgICAgICAgICAgICAgICAgICAgICAgMC45ODY0NjRmCisjZGVmaW5lIEJQRl9GczEyMDAwX0ZjNTVfQTAgICAgICAgICAgICAgICAgICAgICAgMC4wMDYxNTBmCisjZGVmaW5lIEJQRl9GczEyMDAwX0ZjNTVfQTEgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDBmCisjZGVmaW5lIEJQRl9GczEyMDAwX0ZjNTVfQTIgICAgICAgICAgICAgICAgICAgICAgLTAuMDA2MTUwZgorI2RlZmluZSBCUEZfRnMxMjAwMF9GYzU1X0IxICAgICAgICAgICAgICAgICAgICAgIC0xLjk4NjczM2YKKyNkZWZpbmUgQlBGX0ZzMTIwMDBfRmM1NV9CMiAgICAgICAgICAgICAgICAgICAgICAwLjk4NzU1N2YKKyNkZWZpbmUgQlBGX0ZzMTYwMDBfRmM1NV9BMCAgICAgICAgICAgICAgICAgICAgICAwLjAwNDYyMGYKKyNkZWZpbmUgQlBGX0ZzMTYwMDBfRmM1NV9BMSAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMGYKKyNkZWZpbmUgQlBGX0ZzMTYwMDBfRmM1NV9BMiAgICAgICAgICAgICAgICAgICAgICAtMC4wMDQ2MjBmCisjZGVmaW5lIEJQRl9GczE2MDAwX0ZjNTVfQjEgICAgICAgICAgICAgICAgICAgICAgLTEuOTkwMTg5ZgorI2RlZmluZSBCUEZfRnMxNjAwMF9GYzU1X0IyICAgICAgICAgICAgICAgICAgICAgIDAuOTkwNjUzZgorI2RlZmluZSBCUEZfRnMyMjA1MF9GYzU1X0EwICAgICAgICAgICAgICAgICAgICAgIDAuMDAzMzU3ZgorI2RlZmluZSBCUEZfRnMyMjA1MF9GYzU1X0ExICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwZgorI2RlZmluZSBCUEZfRnMyMjA1MF9GYzU1X0EyICAgICAgICAgICAgICAgICAgICAgIC0wLjAwMzM1N2YKKyNkZWZpbmUgQlBGX0ZzMjIwNTBfRmM1NV9CMSAgICAgICAgICAgICAgICAgICAgICAtMS45OTI5NjRmCisjZGVmaW5lIEJQRl9GczIyMDUwX0ZjNTVfQjIgICAgICAgICAgICAgICAgICAgICAgMC45OTMyMDlmCisjZGVmaW5lIEJQRl9GczI0MDAwX0ZjNTVfQTAgICAgICAgICAgICAgICAgICAgICAgMC4wMDMwODVmCisjZGVmaW5lIEJQRl9GczI0MDAwX0ZjNTVfQTEgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDBmCisjZGVmaW5lIEJQRl9GczI0MDAwX0ZjNTVfQTIgICAgICAgICAgICAgICAgICAgICAgLTAuMDAzMDg1ZgorI2RlZmluZSBCUEZfRnMyNDAwMF9GYzU1X0IxICAgICAgICAgICAgICAgICAgICAgIC0xLjk5MzU1MmYKKyNkZWZpbmUgQlBGX0ZzMjQwMDBfRmM1NV9CMiAgICAgICAgICAgICAgICAgICAgICAwLjk5Mzc1OWYKKyNkZWZpbmUgQlBGX0ZzMzIwMDBfRmM1NV9BMCAgICAgICAgICAgICAgICAgICAgICAwLjAwMjMxNWYKKyNkZWZpbmUgQlBGX0ZzMzIwMDBfRmM1NV9BMSAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMGYKKyNkZWZpbmUgQlBGX0ZzMzIwMDBfRmM1NV9BMiAgICAgICAgICAgICAgICAgICAgICAtMC4wMDIzMTVmCisjZGVmaW5lIEJQRl9GczMyMDAwX0ZjNTVfQjEgICAgICAgICAgICAgICAgICAgICAgLTEuOTk1MTk5ZgorI2RlZmluZSBCUEZfRnMzMjAwMF9GYzU1X0IyICAgICAgICAgICAgICAgICAgICAgIDAuOTk1MzE2ZgorI2RlZmluZSBCUEZfRnM0NDEwMF9GYzU1X0EwICAgICAgICAgICAgICAgICAgICAgIDAuMDAxNjgxZgorI2RlZmluZSBCUEZfRnM0NDEwMF9GYzU1X0ExICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwZgorI2RlZmluZSBCUEZfRnM0NDEwMF9GYzU1X0EyICAgICAgICAgICAgICAgICAgICAgIC0wLjAwMTY4MWYKKyNkZWZpbmUgQlBGX0ZzNDQxMDBfRmM1NV9CMSAgICAgICAgICAgICAgICAgICAgICAtMS45OTY1MzdmCisjZGVmaW5lIEJQRl9GczQ0MTAwX0ZjNTVfQjIgICAgICAgICAgICAgICAgICAgICAgMC45OTY1OTlmCisjZGVmaW5lIEJQRl9GczQ4MDAwX0ZjNTVfQTAgICAgICAgICAgICAgICAgICAgICAgMC4wMDE1NDVmCisjZGVmaW5lIEJQRl9GczQ4MDAwX0ZjNTVfQTEgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDBmCisjZGVmaW5lIEJQRl9GczQ4MDAwX0ZjNTVfQTIgICAgICAgICAgICAgICAgICAgICAgLTAuMDAxNTQ1ZgorI2RlZmluZSBCUEZfRnM0ODAwMF9GYzU1X0IxICAgICAgICAgICAgICAgICAgICAgIC0xLjk5NjgyM2YKKyNkZWZpbmUgQlBGX0ZzNDgwMDBfRmM1NV9CMiAgICAgICAgICAgICAgICAgICAgICAwLjk5Njg3NWYKKworI2lmZGVmIEhJR0hFUl9GUworI2RlZmluZSBCUEZfRnM5NjAwMF9GYzU1X0EwICAgICAgICAgICAgICAgICAgICAgIDAuMDAwNzYyZgorI2RlZmluZSBCUEZfRnM5NjAwMF9GYzU1X0ExICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwZgorI2RlZmluZSBCUEZfRnM5NjAwMF9GYzU1X0EyICAgICAgICAgICAgICAgICAgICAgIC0wLjAwMDc2MmYKKyNkZWZpbmUgQlBGX0ZzOTYwMDBfRmM1NV9CMSAgICAgICAgICAgICAgICAgICAgICAtMS45OTg0NjFmCisjZGVmaW5lIEJQRl9Gczk2MDAwX0ZjNTVfQjIgICAgICAgICAgICAgICAgICAgICAgMC45OTg0NzdmCisKKyNkZWZpbmUgQlBGX0ZzMTkyMDAwX0ZjNTVfQTAgICAgICAgICAgICAgICAgICAgICAwLjAwMDM4MWYKKyNkZWZpbmUgQlBGX0ZzMTkyMDAwX0ZjNTVfQTEgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMGYKKyNkZWZpbmUgQ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jNjZfQTAgICAgICAgICAgICAgICAgICAgICAwLjAwODQ2OGYKKyNkZWZpbmUgQlBGX0ZzMTIwMDBfRmM2Nl9BMSAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwZgorI2RlZmluZSBCUEZfRnMxMjAwMF9GYzY2X0EyICAgICAgICAgICAgICAgICAgICAgLTAuMDA4NDY4ZgorI2RlZmluZSBCUEZfRnMxMjAwMF9GYzY2X0IxICAgICAgICAgICAgICAgICAgICAgLTEuOTgxNjg1ZgorI2RlZmluZSBCUEZfRnMxMjAwMF9GYzY2X0IyICAgICAgICAgICAgICAgICAgICAgMC45ODI4NjlmCisjZGVmaW5lIEJQRl9GczE2MDAwX0ZjNjZfQTAgICAgICAgICAgICAgICAgICAgICAwLjAwNjM2NGYKKyNkZWZpbmUgQlBGX0ZzMTYwMDBfRmM2Nl9BMSAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwZgorI2RlZmluZSBCUEZfRnMxNjAwMF9GYzY2X0EyICAgICAgICAgICAgICAgICAgICAgLTAuMDA2MzY0ZgorI2RlZmluZSBCUEZfRnMxNjAwMF9GYzY2X0IxICAgICAgICAgICAgICAgICAgICAgLTEuOTg2NDU3ZgorI2RlZmluZSBCUEZfRnMxNjAwMF9GYzY2X0IyICAgICAgICAgICAgICAgICAgICAgMC45ODcxMjRmCisjZGVmaW5lIEJQRl9GczIyMDUwX0ZjNjZfQTAgICAgICAgICAgICAgICAgICAgICAwLjAwNDYyNmYKKyNkZWZpbmUgQlBGX0ZzMjIwNTBfRmM2Nl9BMSAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwZgorI2RlZmluZSBCUEZfRnMyMjA1MF9GYzY2X0EyICAgICAgICAgICAgICAgICAgICAgLTAuMDA0NjI2ZgorI2RlZmluZSBCUEZfRnMyMjA1MF9GYzY2X0IxICAgICAgICAgICAgICAgICAgICAgLTEuOTkwMjg4ZgorI2RlZmluZSBCUEZfRnMyMjA1MF9GYzY2X0IyICAgICAgICAgICAgICAgICAgICAgMC45OTA2NDFmCisjZGVmaW5lIEJQRl9GczI0MDAwX0ZjNjZfQTAgICAgICAgICAgICAgICAgICAgICAwLjAwNDI1MmYKKyNkZWZpbmUgQlBGX0ZzMjQwMDBfRmM2Nl9BMSAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwZgorI2RlZmluZSBCUEZfRnMyNDAwMF9GYzY2X0EyICAgICAgICAgICAgICAgICAgICAgLTAuMDA0MjUyZgorI2RlZmluZSBCUEZfRnMyNDAwMF9GYzY2X0IxICAgICAgICAgICAgICAgICAgICAgLTEuOTkxMTAwZgorI2RlZmluZSBCUEZfRnMyNDAwMF9GYzY2X0IyICAgICAgICAgICAgICAgICAgICAgMC45OTEzOThmCisjZGVmaW5lIEJQRl9GczMyMDAwX0ZjNjZfQTAgICAgICAgICAgICAgICAgICAgICAwLjAwMzE5MmYKKyNkZWZpbmUgQlBGX0ZzMzIwMDBfRmM2Nl9BMSAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwZgorI2RlZmluZSBCUEZfRnMzMjAwMF9GYzY2X0EyICAgICAgICAgICAgICAgICAgICAgLTAuMDAzMTkyZgorI2RlZmluZSBCUEZfRnMzMjAwMF9GYzY2X0IxICAgICAgICAgICAgICAgICAgICAgLTEuOTkzMzc0ZgorI2RlZmluZSBCUEZfRnMzMjAwMF9GYzY2X0IyICAgICAgICAgICAgICAgICAgICAgMC45OTM1NDFmCisjZGVmaW5lIEJQRl9GczQ0MTAwX0ZjNjZfQTAgICAgICAgICAgICAgICAgICAgICAwLjAwMjMxOGYKKyNkZWZpbmUgQlBGX0ZzNDQxMDBfRmM2Nl9BMSAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwZgorI2RlZmluZSBCUEZfRnM0NDEwMF9GYzY2X0EyICAgICAgICAgICAgICAgICAgICAgLTAuMDAyMzE4ZgorI2RlZmluZSBCUEZfRnM0NDEwMF9GYzY2X0IxICAgICAgICAgICAgICAgICAgICAgLTEuOTk1MjIxZgorI2RlZmluZSBCUEZfRnM0NDEwMF9GYzY2X0IyICAgICAgICAgICAgICAgICAgICAgMC45OTUzMDlmCisjZGVmaW5lIEJQRl9GczQ4MDAwX0ZjNjZfQTAgICAgICAgICAgICAgICAgICAgICAwLjAwMjEzMWYKKyNkZWZpbmUgQlBGX0ZzNDgwMDBfRmM2Nl9BMSAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwZgorI2RlZmluZSBCUEZfRnM0ODAwMF9GYzY2X0EyICAgICAgICAgICAgICAgICAgICAgLTAuMDAyMTMxZgorI2RlZmluZSBCUEZfRnM0ODAwMF9GYzY2X0IxICAgICAgICAgICAgICAgICAgICAgLTEuOTk1NjE1ZgorI2RlZmluZSBCUEZfRnM0ODAwMF9GYzY2X0IyICAgICAgICAgICAgICAgICAgICAgMC45OTU2OTBmCisKKyNpZmRlZiBISUdIRVJfRlMKKyNkZWZpbmUgQlBGX0ZzOTYwMDBfRmM2Nl9BMCAgICAgICAgICAgICAgICAgICAgIDAuMDAxMDU1ZgorI2RlZmluZSBCUEZfRnM5NjAwMF9GYzY2X0ExICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDBmCisjZGVmaW5lIEJQRl9Gczk2MDAwX0ZjNjZfQTIgICAgICAgICAgICAgICAgICAgICAtMC4wMDEwNTVmCisjZGVmaW5lIEJQRl9Gczk2MDAwX0ZjNjZfQjEgICAgICAgICAgICAgICAgICAgICAtMS45OTc4NjhmCisjZGVmaW5lIEJQRl9Gczk2MDAwX0ZjNjZfQjIgICAgICAgICAgICAgICAgICAgICAwLjk5Nzg5MWYKKworI2RlZmluZSBCUEZfRnMxOTIwMDBfRmM2Nl9BMCAgICAgICAgICAgICAgICAgICAgMC4wMDA1MjhmCisjZGVmaW5lIEJQRl9GczE5MjAwMF9GYzY2X0ExICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMGYKKyNkZWZpbmUgQlBGX0ZzMTkyMDAwX0ZjNjZfQTIgICAgICAgICAgICAgICAgICAgLTAuMDAw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gorI2RlZmluZSBCUEZfRnMxOTIwMDBfRmM3OF9CMSAgICAgICAgICAgICAgICAgICAtMS45OTg0MzdmCisjZGVmaW5lIEJQRl9GczE5MjAwMF9GYzc4X0IyICAgICAgICAgICAgICAgICAgICAwLjk5ODQ0NGYKKyNlbmRpZgorCisvKiBDb2VmZmljaWVudHMgZm9yIGNlbnRyZSBmcmVxdWVuY3kgOTBIeiAqLworI2RlZmluZSBCUEZfRnM4MDAwX0ZjOTBfQTAgICAgICAgICAgICAgICAgICAgICAgIDAuMDIyNzYwZgorI2RlZmluZSBCUEZfRnM4MDAwX0ZjOTBfQTEgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwZgorI2RlZmluZSBCUEZfRnM4MDAwX0ZjOTBfQTIgICAgICAgICAgICAgICAgICAgICAgIC0wLjAyMjc2MGYKKyNkZWZpbmUgQlBGX0ZzODAwMF9GYzkwX0IxICAgICAgICAgICAgICAgICAgICAgICAtMS45NDkwNzNmCisjZGVmaW5lIEJQRl9GczgwMDBfRmM5MF9CMiAgICAgICAgICAgICAgICAgICAgICAgMC45NTM5NTNmCisjZGVmaW5lIEJQRl9GczExMDI1X0ZjOTBfQTAgICAgICAgICAgICAgICAgICAgICAgMC4wMTY2MTlmCisjZGVmaW5lIEJQRl9GczExMDI1X0ZjOTBfQTEgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDBmCisjZGVmaW5lIEJQRl9GczExMDI1X0ZjOTBfQTIgICAgICAgICAgICAgICAgICAgICAgLTAuMDE2NjE5ZgorI2RlZmluZSBCUEZfRnMxMTAyNV9GYzkwX0IxICAgICAgICAgICAgICAgICAgICAgIC0xLjk2Mzc5MWYKKyNkZWZpbmUgQlBGX0ZzMTEwMjVfRmM5MF9CMiAgICAgICAgICAgICAgICAgICAgICAwLjk2NjM3N2YKKyNkZWZpbmUgQlBGX0ZzMTIwMDBfRmM5MF9BMCAgICAgICAgICAgICAgICAgICAgICAwLjAxNTI4OWYKKyNkZWZpbmUgQlBGX0ZzMTIwMDBfRmM5MF9BMSAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMGYKKyNkZWZpbmUgQlBGX0ZzMTIwMDBfRmM5MF9BMiAgICAgICAgICAgICAgICAgICAgICAtMC4wMTUyODlmCisjZGVmaW5lIEJQRl9GczEyMDAwX0ZjOTBfQjEgICAgICAgICAgICAgICAgICAgICAgLTEuOTY2ODgyZgorI2RlZmluZSBCUEZfRnMxMjAwMF9GYzkwX0IyICAgICAgICAgICAgICAgICAgICAgIDAuOTY5MDY3ZgorI2RlZmluZSBCUEZfRnMxNjAwMF9GYzkwX0EwICAgICAgICAgICAgICAgICAgICAgIDAuMDExNTExZgorI2RlZmluZSBCUEZfRnMxNjAwMF9GYzkwX0ExICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwZgorI2RlZmluZSBCUEZfRnMxNjAwMF9GYzkwX0EyICAgICAgICAgICAgICAgICAgICAgIC0wLjAxMTUxMWYKKyNkZWZpbmUgQlBGX0ZzMTYwMDBfRmM5MF9CMSAgICAgICAgICAgICAgICAgICAgICAtMS45NzU0NzdmCisjZGVmaW5lIEJQRl9GczE2MDAwX0ZjOTBfQjIgICAgICAgICAgICAgICAgICAgICAgMC45NzY3MTFmCisjZGVmaW5lIEJQRl9GczIyMDUwX0ZjOTBfQTAgICAgICAgICAgICAgICAgICAgICAgMC4wMDgzNzlmCisjZGVmaW5lIEJQRl9GczIyMDUwX0ZjOTBfQTEgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDBmCisjZGVmaW5lIEJQRl9GczIyMDUwX0ZjOTBfQTIgICAgICAgICAgICAgICAgICAgICAgLTAuMDA4Mzc5ZgorI2RlZmluZSBCUEZfRnMyMjA1MF9GYzkwX0IxICAgICAgICAgICAgICAgICAgICAgIC0xLjk4MjM5NWYKKyNkZWZpbmUgQlBGX0ZzMjIwNTBfRmM5MF9CMiAgICAgICAgICAgICAgICAgICAgICAwLjk4MzA0N2YKKyNkZWZpbmUgQlBGX0ZzMjQwMDBfRmM5MF9BMCAgICAgICAgICAgICAgICAgICAgICAwLjAwNzcwNGYKKyNkZWZpbmUgQlBGX0ZzMjQwMDBfRmM5MF9BMSAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMGYKKyNkZWZpbmUgQlBGX0ZzMjQwMDBfRmM5MF9BMiAgICAgICAgICAgICAgICAgICAgICAtMC4wMDc3MDRmCisjZGVmaW5lIEJQRl9GczI0MDAwX0ZjOTBfQjEgICAgICAgICAgICAgICAgICAgICAgLTEuOTgzODYzZgorI2RlZmluZSBCUEZfRnMyNDAwMF9GYzkwX0IyICAgICAgICAgICAgICAgICAgICAgIDAuOTg0NDE0ZgorI2RlZmluZSBCUEZfRnMzMjAwMF9GYzkwX0EwICAgICAgICAgICAgICAgICAgICAgIDAuMDA1Nzg5ZgorI2RlZmluZSBCUEZfRnMzMjAwMF9GYzkwX0ExICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwZgorI2RlZmluZSBCUEZfRnMzMjAwMF9GYzkwX0EyICAgICAgICAgICAgICAgICAgICAgIC0wLjAwNTc4OWYKKyNkZWZpbmUgQlBGX0ZzMzIwMDBfRmM5MF9CMSAgICAgICAgICAgICAgICAgICAgICAtMS45ODc5NzdmCisjZGVmaW5lIEJQRl9GczMyMDAwX0ZjOTBfQjIgICAgICAgICAgICAgICAgICAgICAgMC45ODgyODhmCisjZGVmaW5lIEJQRl9GczQ0MTAwX0ZjOTBfQTAgICAgICAgICAgICAgICAgICAgICAgMC4wMDQyMDdmCisjZGVmaW5lIEJQRl9GczQ0MTAwX0ZjOTBfQTEgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDBmCisjZGVmaW5lIEJQRl9GczQ0MTAwX0ZjOTBfQTIgICAgICAgICAgICAgICAgICAgICAgLTAuMDA0MjA3ZgorI2RlZmluZSBCUEZfRnM0NDEwMF9GYzkwX0IxICAgICAgICAgICAgICAgICAgICAgIC0xLjk5MTMyNGYKKyNkZWZpbmUgQlBGX0ZzNDQx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LjAwMDk1OGYKKyNkZWZpbmUgQlBGX0ZzMTkyMDAwX0ZjOTBfQjEgICAgICAgICAgICAgICAgICAgIC0xLjk5ODA3NWYKKyNkZWZpbmUgQlBGX0ZzMTkyMDAwX0ZjOTBfQjIgICAgICAgICAgICAgICAgICAgICAwLjk5ODA4NWYKKyNlbmRpZgorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIEF1dG9tYXRpYyBHYWluIENvbnRyb2wgdGltZSBjb25zdGFudHMgYW5kIGdhaW4gc2V0dGluZ3MgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyogQUdDIFRpbWUgY29uc3RhbnRzICovCisjZGVmaW5lIEFHQ19BVFRBQ0tfRnM4MDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjg0MTM5NWYKKyNkZWZpbmUgQUdDX0FUVEFDS19GczExMDI1ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuODgyMjIzZgorI2RlZmluZSBBR0NfQVRUQUNLX0ZzMTIwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC44OTEyNTFmCisjZGVmaW5lIEFHQ19BVFRBQ0tfRnMxNjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjkxNzI3NmYKKyNkZWZpbmUgQUdDX0FUVEFDS19GczIyMDUwICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuOTM5MjY3ZgorI2RlZmluZSBBR0NfQVRUQUNLX0ZzMjQwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC45NDQwNjFmCisjZGVmaW5lIEFHQ19BVFRBQ0tfRnMzMjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjk1Nzc0NWYKKyNkZWZpbmUgQUdDX0FUVEFDS19GczQ0MTAwICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuOTY5MTU4ZgorI2RlZmluZSBBR0NfQVRUQUNLX0ZzNDgwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC45NzE2MjhmCisKKyNpZmRlZiBISUdIRVJfRlMKKyNkZWZpbmUgQUdDX0FUVEFDS19Gczk2MDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjk4NTcxMmYKKyNkZWZpbmUgQUdDX0FUVEFDS19GczE5MjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjk5MjgzMGYKKyNlbmRpZgorCisjZGVmaW5lIERFQ0FZX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMAorCisjZGVmaW5lIEFHQ19ERUNBWV9GczgwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDA0MmYKKyNkZWZpbmUgQUdDX0RFQ0FZX0ZzMTEwMjUgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDMwZgorI2RlZmluZSBBR0NfREVDQVlfRnMxMjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMjhmCisjZGVmaW5lIEFHQ19ERUNBWV9GczE2MDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAyMWYKKyNkZWZpbmUgQUdDX0RFQ0FZX0ZzMjIwNTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDE1ZgorI2RlZmluZSBBR0NfREVDQVlfRnMyNDAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMTRmCisjZGVmaW5lIEFHQ19ERUNBWV9GczMyMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAxMGYKKyNkZWZpbmUgQUdDX0RFQ0FZX0ZzNDQxMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDA4ZgorI2RlZmluZSBBR0NfREVDQVlfRnM0ODAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDdmCisKKyNpZmRlZiBISUdIRVJfRlMKKyNkZWZpbmUgQUdDX0RFQ0FZX0ZTOTYwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDM1ZgorI2RlZmluZSBBR0NfREVDQVlfRlMxOTIwMDAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAxNzVmCisjZW5kaWYKKworLyogQUdDIEdhaW4gc2V0dGluZ3MgKi8KKyNkZWZpbmUgQUdDX0dBSU5fU0NBTEUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzEgICAgICAgICAvKiBBcyBhIHBvd2VyIG9mIDIgKi8KKyNkZWZpbmUgQUdDX0dBSU5fU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQgICAgICAgICAvKiBBcyBhIHBvd2VyIG9mIDIgKi8KKyNkZWZpbmUgQUdDX1RBUkdFVExFVkVMICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuOTg4NTUzZgorI2RlZmluZSBBR0NfSFBGR0FJTl8wZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC40MTI1MzhmCisjZGVmaW5lIEFHQ19HQUlOXzBkQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMGYKKyNkZWZpbmUgQUdDX0hQRkdBSU5fMWRCICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuNTg0ODkzZgorI2RlZmluZSBBR0NfR0FJTl8xZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4xMjIwMThmCisjZGVmaW5lIEFHQ19IUEZHQUlOXzJkQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjc3ODI3OWYKKyNkZWZpbmUgQUdDX0dBSU5fMmRCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMjU4OTI1ZgorI2RlZmluZSBBR0NfSFBGR0FJTl8zZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC45OTUyNjJmCisjZGVmaW5lIEFHQ19HQUlOXzNkQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjQxMjUzOGYKKyNkZWZpbmUgQUdDX0hQRkdBSU5fNGRCICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuMjM4NzIxZgorI2RlZmluZSBBR0NfR0FJTl80ZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC41ODQ4OTNmCisjZGVmaW5lIEFHQ19IUEZHQUlOXzVkQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAxLjUxMTg4NmYKKyNkZWZpbmUgQUdDX0dBSU5fNWRCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuNzc4Mjc5ZgorI2RlZmluZSBBR0NfSFBGR0FJTl82ZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMS44MTgzODNmCisjZGVmaW5lIEFHQ19HQUlOXzZkQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjk5NTI2MmYKKyNkZWZpbmUgQUdDX0hQRkdBSU5fN2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIuMTYyMjc4ZgorI2RlZmluZSBBR0NfR0FJTl83ZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMS4yMzg3MjFmCisjZGVmaW5lIEFHQ19IUEZHQUlOXzhkQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAyLjU0ODEzNGYKKyNkZWZpbmUgQUdDX0dBSU5fOGRCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuNTExODg2ZgorI2RlZmluZSBBR0NfSFBGR0FJTl85ZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMi45ODEwNzJmCisjZGVmaW5lIEFHQ19HQUlOXzlkQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxLjgxODM4M2YKKyNkZWZpbmUgQUdDX0hQRkdBSU5fMTBkQiAgICAgICAgICAgICAgICAgICAgICAgICAgIDMuNDY2ODM2ZgorI2RlZmluZSBBR0NfR0FJTl8xMGRCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMi4xNjIyNzhmCisjZGVmaW5lIEFHQ19IUEZHQUlOXzExZEIgICAgICAgICAgICAgICAgICAgICAgICAgICA0LjAxMTg3MmYKKyNkZWZpbmUgQUdDX0dBSU5fMTFkQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIuNTQ4MTM0ZgorI2RlZmluZSBBR0NfSFBGR0FJTl8xMmRCICAgICAgICAgICAgICAgICAgICAgICAgICAgNC42MjM0MTNmCisjZGVmaW5lIEFHQ19HQUlOXzEyZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyLjk4MTA3MmYKKyNkZWZpbmUgQUdDX0hQRkdBSU5fMTNkQiAgICAgICAgICAgICAgICAgICAgICAgICAgIDUuMzA5NTczZgorI2RlZmluZSBBR0NfR0FJTl8xM2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMy40NjY4MzZmCisjZGVmaW5lIEFHQ19IUEZHQUlOXzE0ZEIgICAgICAgICAgICAgICAgICAgICAgICAgICA2LjA3OTQ1OGYKKyNkZWZpbmUgQUdDX0dBSU5fMTRkQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQuMDExODcyZgorI2RlZmluZSBBR0NfSFBGR0FJTl8xNWRCICAgICAgICAgICAgICAgICAgICAgICAgICAgNi45NDMyODJmCisjZGVmaW5lIEFHQ19HQUlOXzE1ZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0LjYyMzQxM2YKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiBWb2x1bWUgY29udHJvbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qIFZvbHVtZSBjb250cm9sIGdhaW4gKi8KKyNkZWZpbmUgVk9MVU1FX01BWCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBJbiBkQnMgKi8KKyNkZWZpbmUgVk9MVU1FX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBJbiBkQnMgKi8KKworLyogVm9sdW1lIGNvbnRyb2wgdGltZSBjb25zdGFudHMgKi8KKyNkZWZpbmUgVk9MX1RDX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjEgICAgICAgICAvKiBBcyBhIHBvd2VyIG9mIDIgKi8KKyNkZWZpbmUgVk9MX1RDX0ZzODAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMjQ2OTBmCisjZGVmaW5lIFZPTF9UQ19GczExMDI1ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDE3OTc3ZgorI2RlZmluZSBWT0xfVENfRnMxMjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAxNjUyOWYKKyNkZWZpbmUgVk9MX1RDX0ZzMTYwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMTI0MjJmCisjZGVmaW5lIFZPTF9UQ19GczIyMDUwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDA5MDI5ZgorI2RlZmluZSBWT0xfVENfRnMyNDAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwODI5OWYKKyNkZWZpbmUgVk9MX1RDX0ZzMzIwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDYyMzFmCisjZGVmaW5lIFZPTF9UQ19GczQ0MTAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDA0NTI1ZgorI2RlZmluZSBWT0xfVENfRnM0ODAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwNDE1OGYKKyNpZmRlZiBISUdIRVJfRlMKKyNkZWZpbmUgVk9MX1RDX0ZzOTYwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDIwNzlmCisjZGVmaW5lIFZPTF9UQ19GczE5MjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAxMDM5ZgorI2VuZGlmCisjZGVmaW5lIE1JWF9UQ19GczgwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI5MzY1ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC44OTYxNTEgKi8KKyNkZWZpbmUgTUlYX1RDX0ZzMTEwMjUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzAyMzAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjkyMjU0OCAqLworI2RlZmluZSBNSVhfVENfRnMxMjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzMDQyMiAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuOTI4NDE1ICovCisjZGVmaW5lIE1JWF9UQ19GczE2MDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMwOTc4ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC45NDUzODcgKi8KKyNkZWZpbmUgTUlYX1RDX0ZzMjIwNTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzE0NTEgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjk1OTgwNCAqLworI2RlZmluZSBNSVhfVENfRnMyNDAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzMTU1NCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuOTYyOTU2ICovCisjZGVmaW5lIE1JWF9UQ19GczMyMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMxODUwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC45NzE5NzMgKi8KKyNkZWZpbmUgTUlYX1RDX0ZzNDQxMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzIwOTcgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjk3OTUxNSAqLworI2RlZmluZSBNSVhfVENfRnM0ODAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzMjE1MCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuOTgxMTUwICovCisjaWZkZWYgSElHSEVSX0ZTCisjZGVmaW5lIE1JWF9UQ19Gczk2MDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMyNDU2ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC45OTA1MzAgKi8KKyNkZWZpbmUgTUlYX1RDX0ZzMTkyMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzI2MTEgICA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tcy0+Q2VudHJlRnJlcXVlbmN5ICogKDErTFZEQkVfRlNfMTkyMDAwKSkpOworI2Vsc2UKKyAgICAvKgorICAgICAqIENhbGN1bGF0ZSB0aGUgdGFibGUgb2Zmc2V0cworICAgICAqLworICAgIExWTV9VSU5UMTYgT2Zmc2V0ID0gKExWTV9VSU5UMTYpKChMVk1fVUlOVDE2KXBQYXJhbXMtPlNhbXBsZVJhdGUgKyBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX1VJTlQxNikocFBhcmFtcy0+Q2VudHJlRnJlcXVlbmN5ICogKDErTFZEQkVfRlNfNDgwMDApKSk7ICAgIAorI2VuZGlmCiAKICAgICAvKgogICAgICAqIFNldHVwIHRoZSBoaWdoIHBhc3MgZmlsdGVyCiAgICAgICovCi0gICAgTG9hZENvbnN0XzE2KDAsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIENsZWFyIHRoZSBoaXN0b3J5LCB2YWx1ZSAwICovCi0gICAgICAgICAgICAgICAgICh2b2lkICopJnBJbnN0YW5jZS0+cERhdGEtPkhQRlRhcHMsICAgICAgICAgICAgICAgIC8qIERlc3RpbmF0aW9uIENhc3QgdG8gdm9pZDogXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm8gZGVyZWZlcmVuY2luZyBpbiBmdW5jdGlvbiovCisjaWZuZGVmIEJVSUxEX0ZMT0FUCisgICAgTG9hZENvbnN0XzE2KDAsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIENsZWFyIHRoZSBoaXN0b3J5LCB2YWx1ZSAwICovCisgICAgICAgICAgICAgICAgICh2b2lkICopJnBJbnN0YW5jZS0+cERhdGEtPkhQRlRhcHMsICAgICAgICAgICAgIC8qIERlc3RpbmF0aW9uIENhc3QgdG8gdm9pZDogXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBubyBkZXJlZmVyZW5jaW5nIGluIGZ1bmN0aW9uKi8KICAgICAgICAgICAgICAgICAgc2l6ZW9mKHBJbnN0YW5jZS0+cERhdGEtPkhQRlRhcHMpL3NpemVvZihMVk1fSU5UMTYpKTsgICAvKiBOdW1iZXIgb2Ygd29yZHMgKi8KLSAgICBCUV8ySV9EMzJGMzJDbGxfVFJDX1dSQV8wMV9Jbml0KCZwSW5zdGFuY2UtPnBDb2VmLT5IUEZJbnN0YW5jZSwgICAgICAgICAvKiBJbml0aWFsaXNlIHRoZSBmaWx0ZXIgKi8KKyNlbHNlCisgICAgTG9hZENvbnN0X0Zsb2F0KDAsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogQ2xlYXIgdGhlIGhpc3RvcnksIHZhbHVlIDAgKi8KKyAgICAgICAgICAgICAgICAgICAodm9pZCAqKSZwSW5zdGFuY2UtPnBEYXRhLT5IUEZUYXBzLCAgICAgICAgICAvKiBEZXN0aW5hdGlvbiBDYXN0IHRvIHZvaWQ6IFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vIGRlcmVmZXJlbmNpbmcgaW4gZnVuY3Rpb24qLworICAgICAgICAgICAgICAgICAgICBzaXplb2YocEluc3RhbmNlLT5wRGF0YS0+SFBGVGFwcykgLyBzaXplb2YoTFZNX0ZMT0FUKSk7IC8qIE51bWJlciBvZiB3b3JkcyAqLworI2VuZGlmCisjaWZuZGVmIEJVSUxEX0ZMT0FUCisgICAgQlFfMklfRDMyRjMyQ2xsX1RSQ19XUkFfMDFfSW5pdCgmcEluc3RhbmNlLT5wQ29lZi0+SFBGSW5zdGFuY2UsICAgIC8qIEluaXRpYWxpc2UgdGhlIGZpbHRlciAqLwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBJbnN0YW5jZS0+cERhdGEtPkhQRlRhcHMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoQlFfQzMyX0NvZWZzX3QgKikmTFZEQkVfSFBGX1RhYmxlW09mZnNldF0pOworI2Vsc2UKKyAgICBCUV8ySV9EMzJGMzJDbGxfVFJDX1dSQV8wMV9Jbml0KCZwSW5zdGFuY2UtPnBDb2VmLT5IUEZJbnN0YW5jZSwgICAgLyogSW5pdGlhbGlzZSB0aGUgZmlsdGVyICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEluc3RhbmNlLT5wRGF0YS0+SFBGVGFwcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChCUV9GTE9BVF9Db2Vmc190ICopJkxWREJFX0hQRl9UYWJsZVtPZmZzZXRdKTsKKyNlbmRpZgogCiAKICAgICAvKgogICAgICAqIFNldHVwIHRoZSBiYW5kIHBhc3MgZmlsdGVyCiAgICAgICovCisjaWZuZGVmIEJVSUxEX0ZMT0FUCiAgICAgTG9hZENvbnN0XzE2KDAsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIENsZWFyIHRoZSBoaXN0b3J5LCB2YWx1ZSAwICovCi0gICAgICAgICAgICAgICAgICh2b2lkICopJnBJbnN0YW5jZS0+cERhdGEtPkJQRlRhcHMsICAgICAgICAgICAgICAgIC8qIERlc3RpbmF0aW9uIENhc3QgdG8gdm9pZDpcCisgICAgICAgICAgICAgICAgICh2b2lkICopJnBJbnN0YW5jZS0+cERhdGEtPkJQRlRhcHMsICAgICAgICAgICAgICAgIC8qIERlc3RpbmF0aW9uIENhc3QgdG8gdm9pZDogXAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm8gZGVyZWZlcmVuY2luZyBpbiBmdW5jdGlvbiovCiAgICAgICAgICAgICAgICAgIHNpemVvZihwSW5zdGFuY2UtPnBEYXRhLT5CUEZUYXBzKS9zaXplb2YoTFZNX0lOVDE2KSk7ICAgLyogTnVtYmVyIG9mIHdvcmRzICovCisjZWxzZQorICAgIExvYWRDb25zdF9GbG9hdCgwLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBDbGVhciB0aGUgaGlzdG9yeSwgdmFsdWUgMCAqLworICAgICAgICAgICAgICAgICAodm9pZCAqKSZwSW5zdGFuY2UtPnBEYXRhLT5CUEZUYXBzLCAgICAgICAgICAgICAvKiBEZXN0aW5hdGlvbiBDYXN0IHRvIHZvaWQ6IFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm8gZGVyZWZlcmVuY2luZyBpbiBmdW5jdGlvbiovCisgICAgICAgICAgICAgICAgIHNpemVvZihwSW5zdGFuY2UtPnBEYXRhLT5CUEZUYXBzKSAvIHNpemVvZihMVk1fRkxPQVQpKTsgICAvKiBOdW1iZXIgb2Ygd29yZHMgKi8KKyNlbmRpZgorI2lmbmRlZiBCVUlMRF9GTE9BVAogICAgIEJQXzFJX0QzMkYzMkNsbF9UUkNfV1JBXzAyX0luaXQoJnBJbnN0YW5jZS0+cENvZWYtPkJQRkluc3RhbmNlLCAgICAgICAgIC8qIEluaXRpYWxpc2UgdGhlIGZpbHRlciAqLwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBJbnN0YW5jZS0+cERhdGEtPkJQRlRhcHMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoQlBfQzMyX0NvZWZzX3QgKikmTFZEQkVfQlBGX1RhYmxlW09mZnNldF0pOwotCisjZWxzZQorICAgIEJQXzFJX0QzMkYzMkNsbF9UUkNfV1JBXzAyX0luaXQoJnBJbnN0YW5jZS0+cENvZWYtPkJQRkluc3RhbmNlLCAgICAvKiBJbml0aWFsaXNlIHRoZSBmaWx0ZXIgKi8KKyA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uTWl4ZXJTdHJlYW1bMF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZEQkVfVm9sdW1lVGFibGVbZEJPZmZzZXRdKTsKKyNlbmRpZgogICAgIH0KIAogICAgIHBJbnN0YW5jZS0+cERhdGEtPkJ5cGFzc1ZvbHVtZS5NaXhlclN0cmVhbVswXS5DYWxsYmFja1NldCA9IDE7CisjaWZuZGVmIEJVSUxEX0ZMT0FUCiAgICAgTFZDX01peGVyX1ZhclNsb3BlX1NldFRpbWVDb25zdGFudCgmcEluc3RhbmNlLT5wRGF0YS0+QnlwYXNzVm9sdW1lLk1peGVyU3RyZWFtWzBdLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkRCRV9NSVhFUl9UQywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9Gc19lbilwSW5zdGFuY2UtPlBhcmFtcy5TYW1wbGVSYXRlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKTsKKyNlbHNlCisgICAgTFZDX01peGVyX1ZhclNsb3BlX1NldFRpbWVDb25zdGFudCgmcEluc3RhbmNlLT5wRGF0YS0+QnlwYXNzVm9sdW1lLk1peGVyU3RyZWFtWzBdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkRCRV9NSVhFUl9UQywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9Gc19lbilwSW5zdGFuY2UtPlBhcmFtcy5TYW1wbGVSYXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKTsKKyNlbmRpZgogfQogCiAKQEAgLTMwOSw3ICszNzIsMTEgQEAKIHsKIAogICAgIExWREJFX0luc3RhbmNlX3QgICAgKnBJbnN0YW5jZSA9KExWREJFX0luc3RhbmNlX3QgICopaEluc3RhbmNlOworI2lmbmRlZiBCVUlMRF9GTE9BVAogICAgIExWTWl4ZXIzXzJTdF9zdCAgICAgKnBCeXBhc3NNaXhlcl9JbnN0YW5jZSA9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YXNzL3NyYy9MVkRCRV9Qcm9jZXNzLmMKaW5kZXggNjlkNzlkMi4uMTBlYTcwMCAxMDA2NDQKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0Jhc3Mvc3JjL0xWREJFX1Byb2Nlc3MuYworKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQmFzcy9zcmMvTFZEQkVfUHJvY2Vzcy5jCkBAIC0yNyw3ICsyNyw2IEBACiAjaW5jbHVkZSAiQUdDLmgiCiAjaW5jbHVkZSAiTFZEQkVfQ29lZmZzLmgiICAgICAgICAgICAgICAgLyogRmlsdGVyIGNvZWZmaWNpZW50cyAqLwogCi0KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICAgTFZEQkVfUHJvY2VzcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KQEAgLTcyLDEzNiArNzEsMjM2IEBACiAvKiAgICAgb3ZlcmFsbCBlbmQgdG8gZW5kIGdhaW4gaXMgb2RCLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZuZGVmIEJVSUxEX0ZMT0FUCitMVkRCRV9SZX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ZnRUb0ludDMyXzE2eDMyKHBJbnB1dCwgLyogU291cmNlIDE2LWJpdCBkYXRhICAgICovCisgICAgcFNjcmF0Y2gsIC8qIERlc3QuIDMyLWJpdCBkYXRhICAgICAqLworICAgIChMVk1fSU5UMTYpICgyICogTnVtU2FtcGxlcyksIC8qIExlZnQgYW5kIHJpZ2h0ICAgICAgICAqLworICAgIExWREJFX1NDQUxFU0hJRlQpOyAvKiBTaGlmdCBzY2FsZSAgICAgICAgICAgKi8KKworICAgIC8qCisgICAgICogQXBwbHkgdGhlIGhpZ2ggcGFzcyBmaWx0ZXIgaWYgc2VsZWN0ZWQKKyAgICAgKi8KKyAgICBpZiAocEluc3RhbmNlLT5QYXJhbXMuSFBGU2VsZWN0ID09IExWREJFX0hQRl9PTikgeworICAgICAgQlFfMklfRDMyRjMyQzMwX1RSQ19XUkFfMDEoJnBJbnN0YW5jZS0+cENvZWYtPkhQRkluc3RhbmNlLC8qIEZpbHRlciBpbnN0YW5jZSAgICAgICovCisgICAgICAoTFZNX0lOVDMyICopIHBTY3JhdGNoLCAvKiBTb3VyY2UgICAgICAgICAgICAgICAqLworICAgICAgKExWTV9JTlQzMiAqKSBwU2NyYXRjaCwgLyogRGVzdGluYXRpb24gICAgICAgICAgKi8KKyAgICAgIChMVk1fSU5UMTYpIE51bVNhbXBsZXMpOyAvKiBOdW1iZXIgb2Ygc2FtcGxlcyAgICAqLworICAgIH0KKworICAgIC8qCisgICAgICogQ3JlYXRlIHRoZSBtb25vIHN0cmVhbQorICAgICAqLworICAgIEZyb20yaVRvTW9ub18zMihwU2NyYXRjaCwgLyogU3RlcmVvIHNvdXJjZSAgICAgICAgICovCisgICAgcE1vbm8sIC8qIE1vbm8gZGVzdGluYXRpb24gICAgICAqLworICAgIChMVk1fSU5UMTYpIE51bVNhbXBsZXMpOyAvKiBOdW1iZXIgb2Ygc2FtcGxlcyAgICAgKi8KKworICAgIC8qCisgICAgICogQXBwbHkgdGhlIGJhbmQgcGFzcyBmaWx0ZXIKKyAgICAgKi8KKyAgICBCUF8xSV9EMzJGMzJDMzBfVFJDX1dSQV8wMigmcEluc3RhbmNlLT5wQ29lZi0+QlBGSW5zdGFuY2UsIC8qIEZpbHRlciBpbnN0YW5jZSAgICAgICAqLworICAgIChMVk1fSU5UMzIgKikgcE1vbm8sIC8qIFNvdXJjZSAgICAgICAgICAgICAgICAqLworICAgIChMVk1fSU5UMzIgKikgcE1vbm8sIC8qIERlc3RpbmF0aW9uICAgICAgICAgICAqLworICAgIChMVk1fSU5UMTYpIE51bVNhbXBsZXMpOyAvKiBOdW1iZXIgb2Ygc2FtcGxlcyAgICAgKi8KKworICAgIC8qCisgICAgICogQXBwbHkgdGhlIEFHQyBhbmQgbWl4CisgICAgICovCisgICAgQUdDX01JWF9WT0xfMlN0MU1vbl9EMzJfV1JBKCZwSW5zdGFuY2UtPnBEYXRhLT5BR0NJbnN0YW5jZSwgLyogSW5zdGFuY2UgcG9pbnRlciAgICAgICovCisgICAgcFNjcmF0Y2gsIC8qIFN0ZXJlbyBzb3VyY2UgICAgICAgICAqLworICAgIHBNb25vLCAvKiBNb25vIGJhbmQgcGFzcyBzb3VyY2UgKi8KKyAgICBwU2NyYXRjaCwgLyogU3RlcmVvIGRlc3RpbmF0aW9uICAgICovCisgICAgTnVtU2FtcGxlcyk7IC8qIE51bWJlciBvZiBzYW1wbGVzICAgICAqLworCisgICAgLyoKKyAgICAgKiBDb252ZXJ0IDMyLWJpdCBzYW1wbGVzIHRvIDE2LWJpdCBhbmQgc2F0dXJhdGUKKyAgICAgKiAoTm90IHJlcXVpcmVkIGZvciAxNi1iaXQgaW1wbGVtZW5hdGlvbnMpCisgICAgICovCisgICAgSW50MzJSU2hpZnRUb0ludDE2X1NhdF8zMngxNihwU2NyYXRjaCwgLyogU291cmNlIDMyLWJpdCBkYXRhICAgICovCisgICAgKExWTV9JTlQxNiAqKSBwU2NyYXRjaCwgLyogRGVzdC4gMTYtYml0IGRhdGEgICAgICovCisgICAgKExWTV9JTl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XhlclN0cmVhbVswXSkKLSAgICAgICAgICE9TFZDX01peGVyX0dldFRhcmdldCgmcEluc3RhbmNlLT5wRGF0YS0+QnlwYXNzTWl4ZXIuTWl4ZXJTdHJlYW1bMF0pKSkKLSAgICB7Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogQ29udmVydCAxNi1iaXQgc2FtcGxlcyB0byAzMi1iaXQgYW5kIHNjYWxlCi0gICAgICAgICAqIChGb3IgYSAxNi1iaXQgaW1wbGVtZW50YXRpb24gYXBwbHkgaGVhZHJvb20gbG9zcyBoZXJlKQotICAgICAgICAgKi8KLSAgICAgICAgSW50MTZMU2hpZnRUb0ludDMyXzE2eDMyKHBJbnB1dCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogU291cmNlIDE2LWJpdCBkYXRhICAgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2NyYXRjaCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIERlc3QuIDMyLWJpdCBkYXRhICAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNikoMipOdW1TYW1wbGVzKSwgICAgICAgICAgICAvKiBMZWZ0IGFuZCByaWdodCAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWREJFX1NDQUxFU0hJRlQpOyAgICAgICAgICAgICAgICAgICAgLyogU2hpZnQgc2NhbGUgICAgICAgICAgICovCi0KLQotICAgICAgICAvKgotICAgICAgICAgKiBBcHBseSB0aGUgaGlnaCBwYXNzIGZpbHRlciBpZiBzZWxlY3RlZAotICAgICAgICAgKi8KLSAgICAgICAgaWYgKHBJbnN0YW5jZS0+UGFyYW1zLkhQRlNlbGVjdCA9PSBMVkRCRV9IUEZfT04pCi0gICAgICAgIHsKLSAgICAgICAgICAgICAgQlFfMklfRDMyRjMyQzMwX1RSQ19XUkFfMDEoJnBJbnN0YW5jZS0+cENvZWYtPkhQRkluc3RhbmNlLC8qIEZpbHRlciBpbnN0YW5jZSAgICAgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDMyICopcFNjcmF0Y2gsICAgICAgICAgICAvKiBTb3VyY2UgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQzMiAqKXBTY3JhdGNoLCAgICAgICAgICAgLyogRGVzdGluYXRpb24gICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7ICAgICAgICAgIC8qIE51bWJlciBvZiBzYW1wbGVzICAgICovCi0gICAgICAgIH0KLQotCi0gICAgICAgIC8qCi0gICAgICAgICAqIENyZWF0ZSB0aGUgbW9ubyBzdHJlYW0KLSAgICAgICAgICovCi0gICAgICAgIEZyb20yaVRvTW9ub18zMihwU2NyYXRjaCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFN0ZXJlbyBzb3VyY2UgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgcE1vbm8sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBNb25vIGRlc3RpbmF0aW9uICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7ICAgICAgICAgICAgICAgICAgICAgICAgLyogTnVtYmVyIG9mIHNhbXBsZXMgICAgICovCi0KLQotICAgICAgICAvKgotICAgICAgICAgKiBBcHBseSB0aGUgYmFuZCBwYXNzIGZpbHRlcgotICAgICAgICAgKi8KLSAgICAgICAgQlBfMUlfRDMyRjMyQzMwX1RSQ19XUkFfMDIoJnBJbnN0YW5jZS0+cENvZWYtPkJQRkluc3RhbmNlLCAgICAgLyogRmlsdGVyIGluc3RhbmNlICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMzIgKilwTW9ubywgICAgICAgICAgICAgICAgIC8qIFNvdXJjZSAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDMyICopcE1vbm8sICAgICAgICAgICAgICAgICAvKiBEZXN0aW5hdGlvbiAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNilOdW1TYW1wbGVzKTsgICAgICAgICAgICAgLyogTnVtYmVyIG9mIHNhbXBsZXMgICAgICovCi0KLQotICAgICAgICAvKgotICAgICAgICAgKiBBcHBseSB0aGUgQUdDIGFuZCBtaXgKLSAgICAgICAgICovCi0gICAgICAgIEFHQ19NSVhfVk9MXzJTdDFNb25fRDMyX1dSQSgmcEluc3RhbmNlLT5wRGF0YS0+QUdDSW5zdGFuY2UsICAgIC8qIEluc3RhbmNlIHBvaW50ZXIgICAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNjcmF0Y2gsICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBTdGVyZW8gc291cmNlICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNb25vLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTW9ubyBiYW5kIHBhc3Mgc291cmNlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2NyYXRjaCwgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFN0ZXJlbyBkZXN0aW5hdGlvbiAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTnVtU2FtcGxlcyk7ICAgICAgICAgICAgICAgICAgICAgICAvKiBOdW1iZXIgb2Ygc2FtcGxlcyAgICAgKi8KLQotICAgICAgICAvKgotICAgICAgICAgKiBDb252ZXJ0IDMyLWJpdCBzYW1wbGVzIHRvIDE2LWJpdCBhbmQgc2F0dXJhdGUKLSAgICAgICAgICogKE5vdCByZXF1aXJlZCBmb3IgMTYtYml0IGltcGxlbWVuYXRpb25zKQotICAgICAgICAgKi8KLSAgICAgICAgSW50MzJSU2hpZnRUb0ludDE2X1NhdF8zMngxNihwU2NyYXRjaCwgICAgICAgICAgICAgICAgICAgICAgICAgLyogU291cmNlIDMyLWJpdCBkYXRhICAgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNiAqKXBTY3JhdGNoLCAgICAgICAgICAgIC8qIERlc3QuIDE2LWJpdCBkYXRhICAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpKDIqTnVtU2FtcGxlcyksICAgICAgICAvKiBMZWZ0IGFuZCByaWdodCAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkRCRV9TQ0FMRVNISUZUKTsgICAgICAgICAgICAgICAgLyogU2hpZnQgc2NhbGUgICAgICAgICAgICovCi0KLSAgICB9Ci0KLSAgICAvKiBCeXBhc3MgVm9sdW1lIHBhdGggaXMgcHJvY2Vzc2VkIHdoZW4gREJFIGlzIE9GRiBvciBkdXJpbmcgT24vT2ZmIHRyYW5zaXRpb25zICovCi0gICAgaWYgKChwSW5zdGFuY2UtPlBhcmFtcy5PcGVyYXRpbmdNb2RlID09IExWREJFX09GRil8fAotICAgICAgICAoTFZDX01peGVyX0dldEN1cnJlbnQoJnBJbnN0YW5jZS0+cERhdGEtPkJ5cGFzc01peGVyLk1peGVyU3RyZWFtWzFdKQotICAgICAgICAgIT1MVkNfTWl4ZXJfR2V0VGFyZ2V0KCZwSW5zdGFuY2UtPnBEYXRhLT5CeXBhc3NNaXhlci5NaXhlclN0cmVhbVsxXSkpKQotICAgIHsKLQotICAgICAgICAvKgotICAgICAgICAgKiBUaGUgYWxnb3JpdGhtIGlzIGRpc2FibGVkIGJ1dCB2b2x1bWUgbWFuYWdlbWVudCBpcyByZXF1aXJlZCB0byBjb21wZW5zYXRlIGZvcgotICAgICAgICAgKiBoZWFkcm9vbSBhbmQgdm9sdW1lIChpZiBlbmFibGVkKQotICAgICAgICAgKi8KLSAgICAgICAgTFZDX01peFNvZnRfMVN0X0QxNkMzMV9TQVQoJnBJbnN0YW5jZS0+cERhdGEtPkJ5cGFzc1ZvbHVtZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSW5EYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTY3JhdGNoVm9sLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpKDIqTnVtU2FtcGxlcykpOyAgICAgICAgICAgLyogTGVmdCBhbmQgcmlnaHQgICAgICAgICAgKi8KLQotICAgIH0KKyAgICBGcm9tMmlUb01vbm9fRmxvYXQoKExWTV9GTE9BVCAqKXBTY3JhdGNoLCAvKiBTdGVyZW8gc291cmNlICAgICAgICAgKi8KKyAgICAgICAgcE1vbm8sIC8qIE1vbm8gZGVzdGluYXRpb24gICAgICAqLworICAgICAgICAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOyAvKiBOdW1iZXIgb2Ygc2FtcGxlcyAgICAgKi8KIAogICAgIC8qCi0gICAgICogTWl4IERCRSBwcm9jZXNzZWQgcGF0aCBhbmQgYnlwYXNzIHZvbHVtZSBwYXRoCisgICAgICogQXBwbHkgdGhlIGJhbmQgcGFzcyBmaWx0ZXIKICAgICAgKi8KLSAgICBMVkNfTWl4U29mdF8yU3RfRDE2QzMxX1NBVCgmcEluc3RhbmNlLT5wRGF0YS0+QnlwYXNzTWl4ZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2ICopIHBTY3JhdGNoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNjcmF0Y2hWb2wsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwT3V0RGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpKDIqTnVtU2FtcGxlcykpOworICAgIEJQXzFJX0QzMkYzMkMzMF9UUkNfV1JBXzAyKCZwSW5zdGFuY2UtPnBDb2VmLT5CUEZJbnN0YW5jZSwgLyogRmlsdGVyIGluc3RhbmNlICAgICAgICovCisgICAgICAgIChMVk1fRkxPQVQgKilwTW9ubywgLyogU291cmNlICAgICAgICAgICAgICAgICovCisgICAgICAgIChMVk1fRkxPQVQgKilwTW9ubywgLyogRGVzdGluYXRpb24gICAgICAgICAgICovCisgICAgICAgIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7IC8qIE51bWJlciBvZiBzYW1wbGVzICAgICAqLwogCi0gICAgcmV0dXJuKExWREJFX1NVQ0NFU1MpOworICAgIC8qCisgICAgICogQXBwbHkgdGhlIEFHQyBhbmQgbWl4CisgICAgICovCisgICAgQUdDX01JWF9WT0xfMlN0MU1vbl9EMzJfV1JBKCZwSW5zdGFuY2UtPnBEYXRhLT5BR0NJbnN0YW5jZSwgLyogSW5zdGFuY2UgcG9pbnRlciAgICAgICovCisgICAgICAgIHBTY3JhdGNoLCAvKiBTdGVyZW8gc291cmNlICAgICAgICAgKi8KKyAgICAgICAgcE1vbm8sIC8qIE1vbm8gYmFuZCBwYXNzIHNvdXJjZSAqLworICAgICAgICBwU2NyYXRjaCwgLyogU3RlcmVvIGRlc3RpbmF0aW9uICAgICovCisgICAgICAgIE51bVNhbXBsZXMpOyAvKiBOdW1iZXIgb2Ygc2FtcGxlcyAgICAgKi8KKworICAgIGZvciAoaWkgPSAwOyBpaSA8IDIgKiBOdW1TYW1wbGVzOyBpaSsrKSB7CisgICAgICAvL1RPRE86IHJlcGxhY2Ugd2l0aCBleGlzdGluZyBjbGFtcGluZyBmdW5jdGlvbgorICAgICAgaWYocFNjcmF0Y2hbaWldIDwgLTEuMCkgeworICAgICAgICBwU2NyYXRjaFtpaV0gPSAtMS4wOworICAgICAgfSBlbHNlI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gICAgICAgIC8qIDE5MmtTL3MgY29lZmZpY2llbnRzICovCisgICAgIC1CUEZfRnMxOTIwMDBfRmM3OF9CMiwKKyAgICAgLUJQRl9GczE5MjAwMF9GYzc4X0IxfSwKKyNlbmRpZgogCiAgICAgLyogQ29lZmZpY2llbnRzIGZvciA5MEh6IGNlbnRyZSBmcmVxdWVuY3kgKi8KICAgICB7QlBGX0ZzODAwMF9GYzkwX0EwLCAgICAgICAgICAgICAgICAvKiA4a1MvcyBjb2VmZmljaWVudHMgKi8KQEAgLTM0Myw3ICs0MjksMTkgQEAKICAgICAgLUJQRl9GczQ0MTAwX0ZjOTBfQjF9LAogICAgIHtCUEZfRnM0ODAwMF9GYzkwX0EwLCAgICAgICAgICAgICAgICAvKiA0OGtTL3MgY29lZmZpY2llbnRzICovCiAgICAgIC1CUEZfRnM0ODAwMF9GYzkwX0IyLAotICAgICAtQlBGX0ZzNDgwMDBfRmM5MF9CMX19OworICAgICAtQlBGX0ZzNDgwMDBfRmM5MF9CMX0KKyNpZmRlZiBISUdIRVJfRlMKKyAgICAsCisgICAge0JQRl9Gczk2MDAwX0ZjOTBfQTAsICAgICAgICAgICAgICAgIC8qIDk2a1MvcyBjb2VmZmljaWVudHMgKi8KKyAgICAgLUJQRl9Gczk2MDAwX0ZjOTBfQjIsCisgICAgIC1CUEZfRnM5NjAwMF9GYzkwX0IxfSwKKyAgICB7QlBGX0ZzMTkyMDAwX0ZjOTBfQTAsICAgICAgICAgICAgICAgIC8qIDE5MmtTL3MgY29lZmZpY2llbnRzICovCisgICAgIC1CUEZfRnMxOTIwMDBfRmM5MF9CMiwKKyAgICAgLUJQRl9GczE5MjAwMF9GYzkwX0IxfQorI2VuZGlmCisKKworfTsKIAogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwpAQCAtMzUzLDcgKzQ1MSwxMSBAQAogLyoqKioqKioqKioqKioqK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RCLApAQCAtNDIyLDYgKzU0OCw3IEBACiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKiBkQiB0byBsaW5lYXIgY29udmVyc2lvbiB0YWJsZSAqLworI2lmbmRlZiBCVUlMRF9GTE9BVAogY29uc3QgTFZNX0lOVDE2IExWREJFX1ZvbHVtZVRhYmxlW10gPSB7CiAgICAgMHg0MDAwLCAgICAgICAgICAgICAvKiAtNmRCICovCiAgICAgMHg0N0ZCLCAgICAgICAgICAgICAvKiAtNWRCICovCkBAIC00MzAsOCArNTU3LDIyIEBACiAgICAgMHg2NUFELCAgICAgICAgICAgICAvKiAtMmRCICovCiAgICAgMHg3MjE1LCAgICAgICAgICAgICAvKiAtMWRCICovCiAgICAgMHg3RkZGfTsgICAgICAgICAgICAvKiAgMGRCICovCisjZWxzZSAvKkJVSUxEX0ZMT0FUKi8KK2NvbnN0IExWTV9GTE9BVCBMVkRCRV9Wb2x1bWVUYWJsZVtdID0geworICAgIDAuNTAwMDAwZiwgICAgICAgICAvKiAtNmRCICovCisgICAgMC41NjIzNDFmLCAgICAgICAgIC8qIC01ZEIgKi8KKyAgICAwLjYzMDk1N2YsICAgICAgICAgLyogLTRkQiAqLworICAgIDAuNzA3OTQ2ZiwgICAgICAgICAvKiAtM2RCICovCisgICAgMC43OTQzMjhmLCAgICAgICAgIC8qIC0yZEIgKi8KKyAgICAwLjg5MTI1MWYsICAgICAgICAgLyogLTFkQiAqLworICAgIDEuMDAwMDAwZn07ICAgICAgICAvKiAgMGRCICovCisjZW5kaWYgLypCVUlMRF9GTE9BVCovCiAKKyNpZm5kZWYgQlVJTERfRkxPQVQKIGNvbnN0IExWTV9JTlQxNiBMVkRCRV9Wb2x1bWVUQ1RhYmxlW10gPSB7CisjZWxzZSAvKkJVSUxEX0ZMT0FUKi8KK2NvbnN0IExWTV9GTE9BVCBMVkRCRV9Wb2x1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L2xpYmVmZmVjdHMvbHZtL2xpYi9CYXNzL3NyYy9MVkRCRV9UYWJsZXMuaApAQCAtMzEsNiArMzEsNyBAQAogI2luY2x1ZGUgIkJJUVVBRC5oIgogI2luY2x1ZGUgIkxWTV9UeXBlcy5oIgogCisjaWZuZGVmIEJVSUxEX0ZMT0FUCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICAgIENvZWZmaWNpZW50cyBjb25zdGFudCB0YWJsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCkBAIC03Niw4ICs3Nyw1NyBAQAogCiBleHRlcm4gY29uc3QgTFZNX0lOVDE2IExWREJFX1ZvbHVtZVRDVGFibGVbXTsKIAorI2Vsc2UgLypCVUlMRF9GTE9BVCovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogICAgQ29lZmZpY2llbnRzIGNvbnN0YW50IHRhYmxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKgorICogSGlnaCBQYXNzIEZpbHRlciBDb2VmZmljaWVudCB0YWJsZQorICovCitleHRlcm4gY29uc3QgQlFfRkxPQVRfQ29lZnNfdCBMVkRCRV9IUEZfVGFibGVbXTsKKworLyoKKyAqIEJhbmQgUGFzcyBGaWx0ZXIgY29lZmZpY2llbnQgdGFibGUKKyAqLworZXh0ZXJuIGNvbnN0IEJQX0ZMT0FUX0NvZWZzX3QgTFZEQkVfQlBGX1RhYmxlW107CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogICAgQUdDIGNvbnN0YW50IHRhYmxlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKiBBdHRhY2sgdGltZSAoc2lnbmFsIHRvbyBsYXJnZSkgKi8KK2V4dGVybiBjb25zdCBMVk1fRkxPQVQgTFZEQkVfQUdDX0FUVEFDS19UYWJsZVtdOworCisvKiBEZWNheSB0aW1lIChzaWduYWwgdG9vIHNtYWxsKSAqLworZXh0ZXJuIGNvbnN0IExWTV9GTE9BVCBMVkRCRV9BR0NfREVDQVlfVGFibGVbXTsKKworLyogR2FpbiBmb3IgdXNlIHdpdGhvdXQgdGhlIGhpZ2ggcGFzcyBmaWx0ZXIgKi8KK2V4dGVybiBjb25zdCBMVk1fRkxPQVQgTFZEQkVfQUdDX0dBSU5fVGFibGVbXTsKKworLyogR2FpbiBmb3IgdXNlIHdpdGggdGhlIGhpZ2ggcGFzcyBmaWx0ZXIgKi8KK2V4dGVybiBjb25zdCBMVk1fRkxPQVQgTFZEQkVfQUdDX0hQRkdBSU5fVGFibGVbXTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAgICBWb2x1bWUgY29udHJvbCBnYWluIGFuZCB0aW1lIGNvbnN0YW50IHRhYmxlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qIGRCIHRvIGxpbmVhciBjb252ZXJzaW9uIHRhYmxlICovCitleHRlcm4gY29uc3QgTFZNX0ZMT0FUIExWREJFX1ZvbHVtZVRhYmxlW107CitleHRlcm4gY29uc3QgTFZNX0ZMT0FUIExWREJFX1ZvbHVtZVRDVGFibGVbXTsKKworI2VuZGlmIC8qQlVJTERfRkxPQVQqLworCiBleHRlcm4gY29uc3QgTFZNX0lOVDE2IExWREJFX01peGVyVENUYWJsZVtdOwogCisKICNpZmRlZiBfX2NwbHVzcGx1cwogfQogI2VuZGlmIC8qIF9fY3BsdXNwbHVzICovCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQnVuZGxlL2xpYi9MVk0uaCBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9CdW5kbGUvbGliL0xWTS5oCmluZGV4IDFmZjJhMmMuLjliNmRhMzEgMTAwNjQ0Ci0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9CdW5kbGUvbGliL0xWTS5oCisrKyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9CdW5kbGUvbGliL0xWTS5oCkBAIC01MTQsMTEgKzUxNCwxOSBAQAogLyogICAgICBTVEVSRU8gICAgICAgICAgICAgIHRoZSBudW1iZXIgb2Ygc2FtcGxlIHBhaXJzIGluIHRoZSBibG9jayAgICAgICAgICAgICAgICAgICAgICovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmZGVmIEJVSUxEX0ZMT0FUCitMVk1fUmV0dXJuU3RhdHVzX2VuIExWTV9Qcm9jZXNzKExWTV9IYW5kbGVfdCAgICAgICAgICAgICAgICBoSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9GTE9BVCAgICAgICAgICAgICAqcEluRGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICAgICAgICAgICpwT3V0RGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiAgICAgICAgICAgICAgICAgIE51bVNhbXBsZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMzIgICAgICAgICAgICAgICAgICBBdWRpb1RpbWUpOworI2Vsc2UKIExWTV9SZXR1cm5TdGF0dXNfZW4gTFZNX1Byb2Nlc3MoTFZNX0hhbmRsZV90ICAgICAgICAgICAgICAgIGhJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICAgICAgICAgICAgICpwSW5EYXRhLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgKnBPdXREYXRhLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICAgICAgTnVtU2FtcGxlcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQzMiAgICAgICAgICAgICAgICAgIEF1ZGlvVGltZSk7CisjZW5kaWYKIAogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9CdW5kbGUvc3JjL0xWTV9CdWZmZXJzLmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQnVuZGxlL3NyYy9MVk1fQnVmZmVycy5jCmluZGV4IDZjYmVlN2QuLjBhM2MzMGUgMTAwNjQ0Ci0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9CdW5kbGUvc3JjL0xWTV9CdWZmZXJzLmMKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0J1bmRsZS9zcmMvTFZNX0J1ZmZlcnMuYwpAQCAtNDgsNyArNDgsMTUyIEBACiAvKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgTFZNX0J1ZmZlck1hbmFnZWRJbihMVk1fSGFuZGxlX3QgICAgICAgaEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9GTE9BVCAgICAqcEluRGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgKipwVG9Qcm9jZXNzLAorICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAqKnBQcm9jZXNzZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiAgICAgICAgICpwTnVtU2FtcGxlcykKK3sKIAorICAgIExWTV9JTlQxNiAgICAgICAgU2FtcGxlQ291bnQ7ICAgICAgICAgICAvKiBOdW1iZXIgb2Ygc2FtcGxlcyB0byBiZSBwcm9jZXNzZWQgdGhpcyBjYWxsICovCisgICAgTFZNX0lOVDE2ICAgICAgICBOdW1TYW1wbGVzOyAgICAgICAgICAgIC8qIE51bWJlciBvZiBzYW1wbGVzIGluIHNjcmF0Y2ggYnVmZmVyICovCisgICAgTFZNX0ZMT0FUICAgICAgICAqcFN0YXJ0OworICAgIExWTV9JbnN0YW5jZV90ICAgKnBJbnN0YW5jZSA9IChMVk1fSW5zdGFuY2VfdCAgKiloSW5zdGFuY2U7CisgICAgTFZNX0J1ZmZlcl90ICAgICAqcEJ1ZmZlcjsKKyAgICBMVk1fRkxPQVQgICAgICAgICpwRGVzdDsKKyAgICBMVk1fSU5UMTYgICAgICAgIE51bUNoYW5uZWxzID0gMjsKKworCisgICAgLyoKKyAgICAgKiBTZXQgdGhlIHByb2Nlc3NpbmcgYWRkcmVzcyBwb2ludGVycworICAgICAqLworICAgIHBCdWZmZXIgICAgID0gcEluc3RhbmNlLT5wQnVmZmVyTWFuYWdlbWVudDsKKyAgICBwRGVzdCAgICAgICA9IHBCdWZmZXItPnBTY3JhdGNoOworICAgICpwVG9Qcm9jZXNzID0gcEJ1ZmZlci0+cFNjcmF0Y2g7CisgICAgKnBQcm9jZXNzZWQgPSBwQnVmZmVyLT5wU2NyYXRjaDsKKworICAgIC8qCisgICAgICogQ2hlY2sgaWYgaXQgaXMgdGhlIGZpcnN0IGNhbGwgb2YgYSBibG9jaworICAgICAqLworICAgIGlmIChwSW5zdGFuY2UtPlNhbXBsZXNUb1Byb2Nlc3MgPT0gMCkKKyAgICB7CisgICAgICAgIC8qCisgICAgICAgICAqIEZpcnN0IGNhbGwgZm9yIGEgbmV3IGJsb2NrIG9mIHNhbXBsZXMKKyAgICAgICAgICovCisgICAgICAgIHBJbnN0YW5jZS0+U2FtcGxlc1RvUHJvY2VzcyA9IChMVk1fSU5UMTYpKCpwTnVtU2FtcGxlcyArIHBCdWZmZXItPkluRGVsYXlTYW1wbGVzKTsKKyAgICAgICAgcEluc3RhbmNlLT5wSW5wdXRTYW1wbGVzICAgID0gKExWTV9GTE9BVCAqKXBJbkRhdGE7CisgICAgICAgIHBCdWZmZXItPkJ1ZmZlclN0YXRlICAgICAgICA9IExWTV9GSVJTVENBTEw7CisgICAgfQorICAgIHBTdGFydCA9IHBJbnN0YW5jZS0+cElucHV0U2FtcGxlczsgICAgICAgICAgICAgICAgIC8qIFBvaW50ZXIgdG8gdGhlIGlucHV0IHNhbXBsZXMgKi8KKyAgICBwQnVmZmVyLT5TYW1wbGVzVG9PdXRwdXQgID0gMDsgICAgICAgICAgICAgICAgICAgICAvKiBTYW1wbGVzIHRvIG91dHB1dCBpcyBzYW1lIGFzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtYmVyIHJlYWQgZm9yIGlucGxhY2UgcHJvY2Vzc2luZyAqLworCisKKyAgICAvKgorICAgICAqIENhbGN1bGF0ZSB0aGUgbnVtYmVyIG9mIHNhbXBsZXMgdG8gcHJvY2VzcyB0aGlzIG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9GSVJTVExBU1RDQUxMOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgcEJ1ZmZlci0+QnVmZmVyU3RhdGUgPSBMVk1fTEFTVENBTEw7CisgICAgICAgIH0KKyAgICB9CisgICAgKnBOdW1TYW1wbGVzID0gKExWTV9VSU5UMTYpU2FtcGxlQ291bnQ7ICAvKiBTZXQgdGhlIG51bWJlciBvZiBzYW1wbGVzIHRvIHByb2Nlc3MgdGhpcyBjYWxsICovCisKKworICAgIC8qCisgICAgICogQ29weSBzYW1wbGVzIGZyb20gdGhlIGRlbGF5IGJ1ZmZlciBhcyByZXF1aXJlZAorICAgICAqLworICAgIGlmICgoKHBCdWZmZXItPkJ1ZmZlclN0YXRlID09IExWTV9GSVJTVENBTEwpIHx8CisgICAgICAgIChwQnVmZmVyLT5CdWZmZXJTdGF0ZSA9PSBMVk1fRklSU1RMQVNUQ0FMTCkpICYmCisgICAgICAgIChwQnVmZmVyLT5JbkRlbGF5U2FtcGxlcyAhPSAwKSkKKyAgICB7CisgICAgICAgIENvcHlfRmxvYXQoJnBCdWZmZXItPkluRGVsYXlCdWZmZXJbMF0sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBTb3VyY2UgKi8KKyAgICAgICAgICAgICAgICAgICBwRGVzdCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIERlc3RpbmF0aW9uICovCisgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNikoTnVtQ2hhbm5lbHMgKiBwQnVmZmVyLT5JbkRlbGF5U2FtcGxlcykpOyAgICAvKiBOdW1iZXIgb2YgZGVsYXkgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYW1wbGVzLCBsZWZ0IGFuZCByaWdodCAqLworICAgICAgICBOdW1TYW1wbGVzID0gKExWTV9JTlQxNikoTnVtU2FtcGxlcyAtIHBCdWZmZXItPkluRGVsYXlTYW1wbGVzKTsgLyogVXBkYXRlIHNhbXBsZSBjb3VudCAqLworICAgICAgICBwRGVzdCArPSBOdW1DaGFubmVscyAqIHBCdWZmZXItPkluRGVsYXlTYW1wbGVzOyAgICAgIC8qIFVwZGF0ZSB0aGUgZGVzdGluYXRpb24gcG9pbnRlciAqLworICAgIH0KKworCisgICAgLyoKKyAgICAgKiBDb3B5IHRoZSByZXN0IG9mIHRoZSBzYW1wbGVzIGZvciB0aGlzIGNhbGwgZnJvbSB0aGUgaW5wdXQgYnVmZmVyCisgICAgICovCisgICAgaWYgKE51bVNhbXBsZXMgPiAwKQorICAgIHsKKyAgICAgICAgQ29weV9GbG9hdChwU3RhcnQsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBTb3VyY2UgKi8KKyAgICAgICAgICAgICAgICAgICBwRGVzdCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBEZXN0aW5hdGlvbiAqLworICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpKE51bUNoYW5uZWxzICogTnVtU2FtcGxlcykpOyAgICAgIC8qIE51bWJlciBvZiBpbnB1dCBzYW1wbGVzICovCisgICAgICAgIHBTdGFydCArPSBOdW1DaGFubmVscyAqIE51bVNhbXBsZXM7ICAgICAgICAgICAgICAgICAgICAgLyogVXBkYXRlIHRoZSBpbnB1dCBwb2ludGVyICovCisKKyAgICAgICAgLyoKKyAgICAgICAgICogVXBkYXRlIHRoZSBpbnB1dCBkYXRhIHBvaW50ZXIgYW5kIHNhbXBsZXMgdG8gb3V0cHV0CisgICAgICAgICAqLworICAgICAgICAvKiBVcGRhdGUgc2FtcGxlcyB0byBvdXRwdXQgKi8KKyAgICAgICAgcEJ1ZmZlci0+U2FtcGxlc1RvT3V0cHV0ID0gKExWTV9JTlQxNikocEJ1ZmZlci0+U2FtcGxlc1RvT3V0cHV0ICsgTnVtU2FtcGxlcyk7CisgICAgfQorCisKKyAgICAvKgorICAgICAgKiBVcGRhdGUgdGhlIHNhbXBsZSBjb3VudCBhbmQgaW5wdXQgcG9pbnRlcgorICAgICAqLworICAgIC8qIFVwZGF0ZSB0aGUgY291bnQgb2Ygc2FtcGxlcyAqLworICAgIHBJbnN0YW5jZS0+U2FtcGxlc1RvUHJvY2VzcyAgPSAoTFZNX0lOVDE2KShwSW5zdGFuY2UtPlNhbXBsZXNUb1Byb2Nlc3MgLSBTYW1wbGVDb3VudCk7CisgICAgcEluc3RhbmNlLT5wSW5wdXRTYW1wbGVzICAgICA9IHBTdGFydDsgLyogVXBkYXRlIGlucHV0IHNhbXBsZSBwb2ludGVyICovCisKKworICAgIC8qCisgICAgICogU2F2ZSBzYW1wbGVzIHRvIHRoZSBkZWxheSBidWZmZXIgaWYgYW55IGxlZnQgdW5wcm9jZXNzZWQKKyAgICAgKi8KKyAgICBpZiAoKHBCdWZmZXItPkJ1ZmZlclN0YXRlID09IExWTV9GSVJTVExBU1RDQUxMKSB8fAorICAgICAgICAocEJ1ZmZlci0+QnVmZmVyU3RhdGUgPT0gTFZNX0xBU1RDQUxMKSkKKyAgICB7CisgICAgICAgIE51bVNhbXBsZXMgPSBwSW5zdGFuY2UtPlNhbXBsZXNUb1Byb2Nlc3M7CisgICAgICAgIHBTdGFydCAgICAgPSBwQnVmZmVyLT5wU2NyYXRjaDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFN0YXJ0IG9mIHRoZSBidWZmZXIgKi8KKyAgICAgICAgcFN0YXJ0ICAgICs9IE51bUNoYW5uZWxzICogU2FtcGxlQ291bnQ7IC8qIE9mZnNldCBieSB0aGUgbnVtYmVyIG9mIHByb2Nlc3NlZCBzYW1wbGVzICovCisgICAgICAgIGlmIChOdW1TYW1wbGVzICE9IDApCisgICAgICAgIHsKKyAgICAgICAgICAgIENvcHlfRmxvYXQocFN0YXJ0LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogU291cmNlICovCisgICAgICAgICAgICAgICAgICAgICAgICZwQnVmZmVyLT5JbkRlbGF5QnVmZmVyWzBdLCAgICAgICAgICAgICAgICAgICAgIC8qIERlc3RpbmF0aW9uICovCisgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpKE51bUNoYW5uZWxzICogTnVtU2FtcGxlcykpOyAgIC8qIE51bWJlciBvZiBpbnB1dCBzYW1wbGVzICovCisgICAgICAgIH0KKworCisgICAgICAgIC8qCisgICAgICAgICAqIFVwZGF0ZSB0aGUgZGVsYXkgc2FtcGxlIGNvdW50CisgICAgICAgICAqLworICAgICAgICBwQnVmZmVyLT5JbkRlbGF5U2FtcGxlcyAgICAgPSBOdW1TYW1wbGVzOyAgICAgICAvKiBOdW1iZXIgb2YgZGVsYXkgc2FtcGxlIHBhaXJzICovCisgICAgICAgIHBJbnN0YW5jZS0+U2FtcGxlc1RvUHJvY2VzcyA9IDA7ICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEFsbCBTYW1wbGVzIHVzZWQgKi8KKyAgICB9Cit9CisjZWxzZQogdm9pZCBMVk1fQnVmZmVyTWFuYWdlZEluKExWTV9IYW5kbGVfdCAgICAgICBoSW5zdGFuY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICAgICpwSW5EYXRhLAogICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAqKnBUb1Byb2Nlc3MsCkBAIC0xODksNyArMzM0LDcgQEAKICAgICAgICAgcEluc3RhbmNlLT5TYW1wbGVzVG9Qcm9jZXNzID0gMDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogQWxsIFNhbXBsZXMgdXNlZCAqLwogICAgIH0KIH0KLQorI2VuZGlmCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCkBAIC0yMTMsNyArMzU4LDQ3IEBACiAvKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgTFZNX0J1ZmZlclVubWFuYWdlZEluKExWTV9IYW5kbGVfdCAgICAgaEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAqKnBUb1Byb2Nlc3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICoqcFByb2Nlc3NlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgICAgICAgKnBOdW1TYW1wbGVzKQorewogCisgICAgTFZNX0luc3RhbmNlX3QgICAgKnBJbnN0YW5jZSA9IChMVk1fSW5zdGFuY2VfdCAgKiloSW5zdGFuY2U7CisKKworICAgIC8qCisgICAgICogQ2hlY2sgaWYgdGhpcyBpcyB0aGUgZmlyc3QgY2FsbCBvZiBhIGJsb2NrCisgICAgICovCisgICAgaWYgKHBJbnN0YW5jZS0+U2FtcGxlc1RvUHJvY2VzcyA9PSAwKQorICAgIHsKKyAgICAgICAgcEluc3RhbmNlLT5TYW1wbGVzVG9Qcm9jZXNzID0gKExWTV9JTlQxNikqcE51bVNhbXBsZXM7ICAgIC8qIEdldCB0aGUgbnVtYmVyIG9mIHNhbXBsZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbiBmaXJzdCBjYWxsICovCisgICAgICAgIHBJbnN0YW5jZS0+cElucHV0U2FtcGxlcyAgICA9ICpwVG9Qcm9jZXNzOyAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIEkvTyBwb2ludGVycyAqLworICAgICAgICBwSW5zdGFuY2UtPnBPdXRwdXRTYW1wbGVzICAgID0gKnBQcm9jZXNzZWQ7CisKKworICAgICAgICAvKgorICAgICAgICAgKiBTZXQgdGUgYmxvY2sgc2l6ZSB0byBwcm9jZXNzCisgICAgICAgICAqLworICAgICAgICBpZiAocEluc3RhbmNlLT5TYW1wbGVzVG9Qcm9jZXNzID4gcEluc3RhbmNlLT5JbnRlcm5hbEJsb2NrU2l6ZSkKKyAgICAgICAgeworICAgICAgICAgICAgKnBOdW1TYW1wbGVzID0gKExWTV9VSU5UMTYpcEluc3RhbmNlLT5JbnRlcm5hbEJsb2NrU2l6ZTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgICpwTnVtU2FtcGxlcyA9IChMVk1fVUlOVDE2KXBJbnN0YW5jZS0+U2FtcGxlc1RvUHJvY2VzczsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qCisgICAgICogU2V0IHRoZSBwcm9jZXNzIHBvaW50ZXJzCisgICAgICovCisgICAgKnBUb1Byb2Nlc3MgPSBwSW5zdGFuY2UtPnBJbnB1dFNhbXBsZXM7CisgICAgKnBQcm9jZXNzZWQgPSBwSW5zdGFuY2UtPnBPdXRwdXRTYW1wbGVzOworfQorI2Vsc2UKIHZvaWQgTFZNX0J1ZmZlclVubWFuYWdlZEluKExWTV9IYW5kbGVfdCAgICAgaEluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAqKnBUb1Byb2Nlc3MsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICoqcFByb2Nlc3NlZCwKQEAgLTI1Miw3ICs0MzcsNyBAQAogICAgICpwVG9Qcm9jZXNzID0gcEluc3RhbmNlLT5wSW5wdXRTYW1wbGVzOwogICAgICpwUHJvY2Vzc2VkID0gcEluc3RhbmNlLT5wT3V0cHV0U2FtcGxlczsKIH0KLQorI2VuZGlmCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCkBAIC0yNzgsNiArNDYzLDcgQEAKIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKKyNpZm5kZWYgQlVJTERfRkxPQVQKIHZvaWQgTFZNX0J1ZmZlck9wdGltaXNlZEluKExWTV9IYW5kbGVfdCAgICAgICAgIGhJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiAgICAgICpwSW5EYXRhLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgKipwVG9Qcm9jZXNzLApAQCAtNDE2LDcgKzYwMiw3IEBACiAgICAgICAgIH0KICAgICB9CiB9Ci0KKyNlbmRpZgogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICAgTFZNX0J1ZmZlckluICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwpAQCAtNDcxLDcgKzY1NywzNyBAQAogLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIExWTV9CdWZmZXJJbihMVk1fSGFuZGxlX3QgICAgICBoSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fRkxPQVQgICAqcEluRGF0YSwKKyAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICoqcFRvUHJvY2VzcywKKyAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICoqcFByb2Nlc3NlZCwKKyAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgICAgICAgICpwTnVtU2FtcGxlcykKK3sKIAorICAgIExWTV9JbnN0YW5jZV90ICAgICpwSW5zdGFuY2UgPSAoTFZNX0luc3RhbmNlX3QgICopaEluc3RhbmNlOworCisKKyAgICAvKgorICAgICAqIENoZWNrIHdoaWNoIG1vZGUsIG1hbmFnZWQgb3IgdW5tYW5hZ2VkCisgICAgICovCisgICAgaWYgKHBJbnN0YW5jZS0+SW5zdFBhcmFtcy5CdWZmZXJNb2RlID09IExWTV9NQU5BR0VEX0JVRkZFUlMpCisgICAgeworICAgICAgICBMVk1fQnVmZmVyTWFuYWdlZEluKGhJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSW5EYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUb1Byb2Nlc3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFByb2Nlc3NlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTnVtU2FtcGxlcyk7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIExWTV9CdWZmZXJVbm1hbmFnZWRJbihoSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVG9Qcm9jZXNzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFByb2Nlc3NlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBOdW1TYW1wbGVzKTsKKyAgICB9Cit9CisjZWxzZQogdm9pZCBMVk1fQnVmZmVySW4oTFZNX0hhbmRsZV90ICAgICAgaEluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICAgKnBJbkRhdGEsCiAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAqKnBUb1Byb2Nlc3MsCkBAIC01MDEsNyArNzE3LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBOdW1TYW1wbGVzKTsKICAgICB9CiB9Ci0KKyNlbmRpZgogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICAgTFZNX0J1ZmZlck1hbmFnZWRPdXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwpAQCAtNTIyLDcgKzczOCwxNTYgQEAKIC8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBMVk1fQnVmZmVyTWFuYWdlZE91dChMVk1fSGFuZGxlX3QgICAgICAgIGhJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICAgKnBPdXREYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDE2ICAgICAgICAqcE51bVNhbXBsZXMpCit7CiAKKyAgICBMVk1fSW5zdGFuY2VfdCAgKnBJbnN0YW5jZSAgPSAoTFZNX0luc3RhbmNlX3QgICopaEluc3RhbmNlOworICAgIExWTV9CdWZmZXJfdCAgICAqcEJ1ZmZlciAgICA9IHBJbnN0YW5jZS0+cEJ1ZmZlck1hbmFnZW1lbnQ7CisgICAgTFZNX0lOVDE2ICAgICAgIFNhbXBsZUNvdW50ID0gKExWTV9JTlQxNikqcE51bVNhbXBsZXM7CisgICAgTFZNX0lOVDE2ICAgICAgIE51bVNhbXBsZXM7CisgICAgTFZNX0ZMT0FUICAgICAgICpwU3RhcnQ7CisgICAgTFZNX0ZMT0FUICAgICAgICpwRGVzdDsKKworCisgICAgLyoKKyAgICAgKiBTZXQgdGhlIHBvaW50ZXJzCisgICAgICovCisgICAgTnVtU2FtcGxlcyA9IHBCdWZmZXItPlNhbXBsZXNUb091dHB1dDsKKyAgICBwU3RhcnQgICAgID0gcEJ1ZmZlci0+cFNjcmF0Y2g7CisKKworICAgIC8qCisgICAgICogY2hlY2sgaWYgaXQgaXMgdGhlIGZpcnN0IGNhbGwgb2YgYSBibG9jaworICAgICAgKi8KKyAgICBpZiAoKHBCdWZmZXItPkJ1ZmZlclN0YXRlID09IExWTV9GSVJTVENBTEwpIHx8CisgICAgICAgIChwQnVmZmVyLT5CdWZmZXJTdGF0ZSA9PSBMVk1fRklSU1RMQVNUQ0FMTCkpCisgICAgeworICAgICAgICAvKiBGaXJzdCBjYWxsIGZvciBhIG5ldyBibG9jayAqLworICAgICAgICBwSW5zdGFuY2UtPnBPdXRwdXRTYW1wbGVzID0gcE91dERhdGE7ICAgICAgICAgICAgICAgICAvKiBJbml0aWFsaXNlIHRoZSBkZXN0aW5hdGlvbiAqLworICAgIH0KKyAgICBwRGVzdCA9IHBJbnN0YW5jZS0+cE91dHB1dFNhbXBsZXM7ICAgICAgICAgICAgICAgICAgICAgICAgLyogU2V0IHRoZSBvdXRwdXQgYWRkcmVzcyAqLworCisKKyAgICAvKgorICAgICAqIElmIHRoZSBudW1iZXIgb2Ygc2FtcGxlcyBpcyBub24temVybyB0aGVuIHRoZXJlIGFyZSBzdGlsbCBzYW1wbGVzIHRvIHNlbmQgdG8KKyAgICAgKiB0aGUgb3V0cHV0IGJ1ZmZlcgorICAgICAqLworICAgIGlmICgoTnVtU2FtcGxlcyAhPSAwKSAmJgorICAgICAgICAocEJ1ZmZlci0+T3V0RGVsYXlTYW1wbGVzICE9IDApKQorICAgIHsKKyAgICAgICAgLyoKKyAgICAgICAgICogQ29weSB0aGUgZGVsYXllZCBvdXRwdXQgYnVmZmVyIHNhbXBsZXMgdG8gdGhlIG91dHB1dAorICAgICAgICAgKi8KKyAgICAgICAgaWYgKHBCdWZmZXItPk91dERlbGF5U2FtcGxlcyA8PSBOdW1TYW1wbGVzKQorICAgICAgICB7CisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogQ29weSBhbGwgb3V0cHV0IGRlbGF5IHNhbXBsZXMgdG8gdGhlIG91dHB1dAorICAgICAgICAgICAgICovCisgICAgICAgICAgICBDb3B5X0Zsb2F0KCZwQnVmZmVyLT5PdXREZWxheUJ1ZmZlclswXSwgICAgICAgICAgICAgICAgLyogU291cmNlICovCisgICAgICAgICAgICAgICAgICAgICAgIHBEZXN0LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRGV0c2luYXRpb24gKi8KKyAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNikoMiAqIHBCdWZmZXItPk91dERlbGF5U2FtcGxlcykpOyAvKiBOdW1iZXIgb2YgZGVsYXkgc2FtcGxlcyAqLworCisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogVXBkYXRlIHRoZSBwb2ludGVyIGFuZCBzYW1wbGUgY291bnRzCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHBEZXN0ICs9IDIgKiBwQnVmZmVyLT5PdXREZWxheVNhbXBsZXM7IC8qIE91dHB1dCBzYW1wbGUgcG9pbnRlciAqLworICAgICAgICAgICAgTnVtU2FtcGxlcyA9IChMVk1fSU5UMTYpKE51bVNhbXBsZXMgLSBwQnVmZmVyLT5PdXREZWxheVNhbXBsZXMpOyAvKiBTYW1wbGVzIGxlZnQgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0byBzZW5kICovCisgICAgICAgICAgICBwQnVmZmVyLT5PdXREZWxheVNhbXBsZXMgPSAwOyAvKiBObyBzYW1wbGVzIGxlZnQgaW4gdGhlIGJ1ZmZlciAqLworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAqIENvcHkgb25seSBzb21lIG9mIHRoZSBvdXB1dCBkZWxheSBzYW1wbGVzIHRvIHRoZSBvdXRwdXQKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgQ29weV9GbG9hdCgmcEJ1ZmZlci0+T3V0RGVsYXlCdWZmZXJbMF0sICAgICAgICAgICAgICAgICAgICAvKiBTb3VyY2UgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgcERlc3QsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRGV0c2luYXRpb24gKi8KKyAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNikoMiAqIE51bVNhbXBsZXMpKTsgICAgICAgLyogTnVtYmVyIG9mIGRlbGF5IHNhbXBsZXMgKi8KKworICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAqIFVwZGF0ZSB0aGUgcG9pbnRlciBhbmQgc2FtcGxlIGNvdW50cworICAgICAgICAgICAgICovCisgICAgICAgICAgICBwRGVzdCArPSAyICogTnVtU2FtcGxlczsgLyogT3V0cHV0IHNhbXBsZSBwb2ludGVyICovCisgICAgICAgICAgICAvKiBObyBzYW1wbGVzIGxlZnQgaW4gdGhlIGJ1ZmZlciAqLworICAgICAgICAgICAgcEJ1ZmZlci0+T3V0RGVsYXlTYW1wbGVzID0gKExWTV9JTlQxNikocEJ1ZmZlci0+T3V0RGVsYXlTYW1wbGVzIC0gTnVtU2FtcGxlcyk7CisKKyAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgKiBSZWFsaWduIHRoZSBkZWxheSBidWZmZXIgZGF0YSB0byBhdm9pZCB1c2luZyBjaXJjdWxhciBidWZmZXIgbWFuYWdlbWVudAorICAgICAgICAgICAgICovCisgICAgICAgICAgICBDb3B5X0Zsb2F0KCZwQnVmZmVyLT5PdXREZWxheUJ1ZmZlclsyICogTnVtU2FtcGxlc10sICAgICAgICAgLyogU291cmNlICovCisgICAgICAgICAgICAgICAgICAgICAgICZwQnVmZmVyLT5PdXREZWxheUJ1ZmZlclswXSwgICAgICAgICAgICAgICAgICAgIC8qIERlc3RpbmF0aW9uICovCisgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpKDIgKiBwQnVmZmVyLT5PdXREZWxheVNhbXBsZXMpKTsgLyogTnVtYmVyIG9mIHNhbXBsZXMgdG8gbW92ZSAqLworICAgICAgICAgICAgTnVtU2FtcGxlcyA9IDA7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBTYW1wbGVzIGxlZnQgdG8gc2VuZCAqLworICAgICAgICB9CisgICAgfQorCisKKyAgICAvKgorICAgICAqIENvcHkgdGhlIHByb2Nlc3NlZCByZXN1bHRzIHRvIHRoZSBvdXRwdXQKKyAgICAgKi8KKyAgICBpZiAoKE51bVNhbXBsZXMgIT0gMCkgJiYKKyAgICAgICAgKFNhbXBsZUNvdW50ICE9IDApKQorICAgIHsKKyAgICAgICAgaWYgKFNhbXBsZUNvdW50IDw9IE51bVNhbXBsZXMpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgKiBDb3B5IGFsbCBwcm9jZXNzZWQgc2FtcGxlcyB0byB0aGUgb3V0cHV0CisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIENvcHlfRmxvYXQocFN0YXJ0LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogU291cmNlICovCisgICAgICAgICAgICAgICAgICAgICAgIHBEZXN0LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIERldHNpbmF0aW9uICovCisgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpKDIgKiBTYW1wbGVDb3VudCkpOyAvKiBOdW1iZXIgb2YgcHJvY2Vzc2VkIHNhbXBsZXMgKi8KKyAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgKiBVcGRhdGUgdGhlIHBvaW50ZXIgYW5kIHNhbXBsZSBjb3VudHMKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcERlc3QgICAgICArPSAyICogU2FtcGxlQ291bnQ7ICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBPdXRwdXQgc2FtcGxlIHBvaW50ZXIgKi8KKyAgICAgICAgICAgIE51bVNhbXBsZXMgID0gKExWTV9JTlQxNikoTnVtU2FtcGxlcyAtIFNhbXBsZUNvdW50KTsgICAgLyogU2FtcGxlcyBsZWZ0IHRvIHNlbmQgKi8KKyAgICAgICAgICAgIFNhbXBsZUNvdW50ID0gMDsgLyogTm8gc2FtcGxlcyBsZWZ0IGluIHRoZSBidWZmZXIgKi8KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgKiBDb3B5IG9ubHkgc29tZSBwcm9jZXNzZWQgc2FtcGxlcyB0byB0aGUgb3V0cHV0CisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIENvcHlfRmxvYXQocFN0YXJ0LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogU291cmNlICovCisgICAgICAgICAgICAgICAgICAgICAgIHBEZXN0LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIERlc3RpbmF0aW9uICovCisgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpKDIgKiBOdW1TYW1wbGVzKSk7ICAgICAvKiBOdW1iZXIgb2YgcHJvY2Vzc2VkIHNhbXBsZXMgKi8KKyAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgKiBVcGRhdGUgdGhlIHBvaW50ZXJzIGFuZCBzYW1wbGUgY291bnRzCisgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgcFN0YXJ0ICAgICAgKz0gMiAqIE51bVNhbXBsZXM7ICAgICAgICAgICAgICAgICAgICAgICAgLyogUHJvY2Vzc2VkIHNhbXBsZSBwb2ludGVyICovCisgICAgICAgICAgICBwRGVzdCAgICAgICArPSAyICogTnVtU2FtcGxlczsgICAgICAgICAgICAgICAgICAgICAgICAvKiBPdXRwdXQgc2FtcGxlIHBvaW50ZXIgKi8KKyAgICAgICAgICAgIFNhbXBsZUNvdW50ICA9IChMVk1fSU5UMTYpKFNhbXBsZUNvdW50IC0gTnVtU2FtcGxlcyk7IC8qIFByb2Nlc3NlZCBzYW1wbGVzIGxlZnQgKi8KKyAgICAgICAgICAgIE51bVNhbXBsZXMgICA9IDA7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIENsZWFyIHRoZSBzYW1wbGUgY291bnQgKi8KKyAgICAgICAgfQorICAgIH0KKworCisgICAgLyoKKyAgICAgKiBDb3B5IHRoZSByZW1haW5pbmcgcHJvY2Vzc2VkIGRhdGEgdG8gdGhlIG91dHB1dCBkZWxheSBidWZmZXIKKyAgICAgKi8KKyAgICBpZiAoU2FtcGxlQ291bnQgIT0gMCkKKyAgICB7CisgICAgICAgIENvcHlfRmxvYXQocFN0YXJ0LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBTb3VyY2UgKi8KKyAgICAgICAgICAgICAgICAgICAmcEJ1ZmZlci0+T3V0RGVsYXlCdWZmZXJbMiAqIHBCdWZmZXItPk91dERlbGF5U2FtcGxlc10sIC8qIERlc3RpbmF0aW9uICovCisgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNikoMiAqIFNhbXBsZUNvdW50KSk7ICAgICAgICAgICAgICAgLyogTnVtYmVyIG9mIHByb2Nlc3NlZCBzYW1wbGVzICovCisgICAgICAgIC8qIFVwZGF0ZSB0aGUgYnVmZmVyIGNvdW50ICovCisgICAgICAgIHBCdWZmZXItPk91dERlbGF5U2FtcGxlcyA9IChMVk1fSU5UMTYpKHBCdWZmZXItPk91dERlbGF5U2FtcGxlcyArIFNhbXBsZUNvdW50KTsKKyAgICB9CisKKyAgICAvKgorICAgICAqIHBvaW50ZXJzLCBjb3VudHMgYW5kIHNldCBkZWZhdWx0IGJ1ZmZlciBwcm9jZXNzaW5nCisgICAgICovCisgICAgcEJ1ZmZlci0+U2FtcGxlc1RvT3V0cHV0ICA9IE51bVNhbXBsZXM7ICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFNhbXBsZXMgbGVmdCB0byBzZW5kICovCisgICAgcEluc3RhbmNlLT5wT3V0cHV0U2FtcGxlcyA9IHBEZXN0OyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIE91dHB1dCBzYW1wbGUgcG9pbnRlciAqLworICAgIHBCdWZmZXItPkJ1ZmZlclN0YXRlICAgICAgPSBMVk1fTUFYQkxPQ0tDQUxMOyAgICAgICAgICAgICAgICAgICAvKiBTZXQgZm9yIHRoZSBkZWZhdWx0IGNhbGwgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsb2NrIHNpemUgKi8KKyAgICAvKiBUaGlzIHdpbGwgdGVybWluYXRlIHRoZSBsb29wIHdoZW4gYWxsIHNhbXBsZXMgcHJvY2Vzc2VkICovCisgICAgKnBOdW1TYW1wbGVzID0gKExWTV9VSU5UMTYpcEluc3RhbmNlLT5TYW1wbGVzVG9Qcm9jZXNzOworfQorI2Vsc2UKIHZvaWQgTFZNX0J1ZmZlck1hbmFnZWRPdXQoTFZNX0hhbmRsZV90ICAgICAgICBoSW5zdGFuY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICpwT3V0RGF0YSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiAgICAgICAgKnBOdW1TYW1wbGVzKQpAQCAtNjcyLDcgKzEwMzcsNyBAQAogICAgIHBCdWZmZXItPkJ1ZmZlclN0YXRlICAgICAgPSBMVk1fTUFYQkxPQ0tDQUxMOyAgICAgICAgICAgICAgICAgICAvKiBTZXQgZm9yIHRoZSBkZWZhdWx0IGNhbGwgYmxvY2sgc2l6ZSAqLwogICAgICpwTnVtU2FtcGxlcyA9IChMVk1fVUlOVDE2KXBJbnN0YW5jZS0+U2FtcGxlc1RvUHJvY2VzczsgICAgICAgICAvKiBUaGlzIHdpbGwgdGVybWluYXRlIHRoZSBsb29wIHdoZW4gYWxsIHNhbXBsZXMgcHJvY2Vzc2VkICovCiB9Ci0KKyNlbmRpZgogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwpAQCAtNzQxLDYgKzExMDYsNyBAQAogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAorI2lmbmRlZiBCVUlMRF9GTE9BVAogdm9pZCBMVk1fQnVmZmVyT3B0aW1pc2VkT3V0KExWTV9IYW5kbGVfdCAgICBoSW5zdGFuY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiAgICAgICAgKnBOdW1TYW1wbGVzKQogewpAQCAtODA1LDcgKzExNzEsNyBAQAogICAgICAgICB9CiAgICAgfQogfQotCisjZW5kaWYKIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KQEAgLTg0Myw3ICsxMjA5LDMxIEBACiAvKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgTFZNX0J1ZmZlck91dChMVk1fSGFuZGxlX3QgICAgIGhJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICpwT3V0RGF0YSwKKyAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDE2ICAgICAgICpwTnVtU2FtcGxlcykKK3sKIAorICAgIExWTV9JbnN0YW5jZV90ICAgICpwSW5zdGFuY2UgID0gKExWTV9JbnN0YW5jZV90ICAqKWhJbnN0YW5jZTsKKworCisgICAgLyoKKyAgICAgKiBDaGVjayB3aGljaCBtb2RlLCBtYW5hZ2VkIG9yIHVubWFuYWdlZAorICAgICAqLworICAgIGlmIChwSW5zdGFuY2UtPkluc3RQYXJhbXMuQnVmZmVyTW9kZSA9PSBMVk1fTUFOQUdFRF9CVUZGRVJTKQorICAgIHsKKyAgICAgICAgTFZNX0J1ZmZlck1hbmFnZWRPdXQoaEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwT3V0RGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE51bVNhbXBsZXMpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBMVk1fQnVmZmVyVW5tYW5hZ2VkT3V0KGhJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTnVtU2FtcGxlcyk7CisgICAgfQorfQorI2Vsc2UKIHZvaWQgTFZNX0J1ZmZlck91dChMVk1fSGFuZGxlX3QgICAgIGhJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICpwT3V0RGF0YSwKICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDE2ICAgICAgICpwTnVtU2FtcGxlcykKQEAgLTg2Nyw0ICsxMjU3LDQgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTnVtU2FtcGxlcyk7CiAgICAgfQogfQotCisjZW5kaWYKZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9CdW5kbGUvc3JjL0xWTV9Db2VmZnMuaCBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9CdW5kbGUvc3JjL0xWTV9Db2VmZnMuaAppbmRleCAyNzEyYjJjLi4zNTM1NjBjIDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQnVuZGxlL3NyYy9MVk1fQ29lZmZzLmgKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0J1bmRsZS9zcmMvTFZNX0NvZWZmcy5oCkBAIC0yNiwxMCArMjYsNjU1IEBACiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAjZGVmaW5lIFRyZWJsZUJvb3N0Q29ybmVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDgwMDAKLSNkZWZpbmUgVHJlYmxlQm9vc3RNaW5SYXRlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQKLSNkZWZpbmUgVHJlYmxlQm9vc3RTdGVwcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE1CisjZGVmaW5lIFRyZWJsZUJvb3N0TWluUmF0ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQKKyNkZWZpbmUgVHJlYmxlQm9vc3RTdGVwcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNQogCisjaWZkZWYgQlVJTERfRkxPQVQKKy8qIENvZWZmaWNpZW50cyBmb3Igc2FtcGxlIHJhdGUgMjIwNTBIeiAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDEuMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4xX0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuMDM4NDM0CisjZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4xX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMzMxNTk5CisjZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4xX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4xX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMzcwMDMzCisjZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4xX0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMi4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjJfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMS4wODE1NTcKKyNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjJfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4yODg0NzUKKyNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjJfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjJfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4zNzAwMzMKKyNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjJfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAzLjAwMDAwMCBkQiAqLworI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluM19BMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAxLjEyOTk0MworI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluM19BMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjI0MDA5MAorI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluM19BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluM19CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjM3MDAzMworI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluM19CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDQuMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9GczIyMDUwX0dhaW40X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuMTg0MjMyCisjZGVmaW5lIEhQRl9GczIyMDUwX0dhaW40X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMTg1ODAxCisjZGVmaW5lIEhQRl9GczIyMDUwX0dhaW40X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczIyMDUwX0dhaW40X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMzcwMDMzCisjZGVmaW5lIEhQRl9GczIyMDUwX0dhaW40X0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgNS4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjVfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMS4yNDUxNDUKKyNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjVfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4xMjQ4ODcKKyNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjVfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjVfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4zNzAwMzMKKyNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjVfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICA2LjAwMDAwMCBkQiAqLworI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluNl9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAxLjMxMzQ5MQorI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluNl9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjA1NjU0MQorI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluNl9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluNl9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjM3MDAzMworI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluNl9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDcuMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9GczIyMDUwX0dhaW43X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuMzkwMTc3CisjZGVmaW5lIEhQRl9GczIyMDUwX0dhaW43X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjAyMDE0NAorI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluN19BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluN19CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjM3MDAzMworI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluN19CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDguMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9GczIyMDUwX0dhaW44X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuNDc2MjE5CisjZGVmaW5lIEhQRl9GczIyMDUwX0dhaW44X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjEwNjE4NworI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluOF9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluOF9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjM3MDAzMworI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluOF9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDkuMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9GczIyMDUwX0dhaW45X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuNTcyNzYxCisjZGVmaW5lIEhQRl9GczIyMDUwX0dhaW45X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjIwMjcyOAorI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluOV9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluOV9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjM3MDAzMworI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluOV9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDEwLjAwMDAwMCBkQiAqLworI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluMTBfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAxLjY4MTA4MgorI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluMTBfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4zMTEwNDkKKyNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjEwX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjEwX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4zNzAwMzMKKyNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjEwX0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxMS4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjExX0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgMS44MDI2MjAKKyNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjExX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuNDMyNTg4CisjZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4xMV9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4xMV9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMzcwMDMzCisjZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4xMV9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMTIuMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4xMl9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuOTM4OTg5CisjZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4xMl9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjU2ODk1NgorI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluMTJfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluMTJfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjM3MDAzMworI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluMTJfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDEzLjAwMDAwMCBkQiAqLworI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluMTNfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAyLjA5MTk5NworI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluMTNfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC43MjE5NjQKKyNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjEzX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjEzX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4zNzAwMzMKKyNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjEzX0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxNC4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjE0X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgMi4yNjM2NzQKKyNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjE0X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuODkzNjQxCisjZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4xNF9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4xNF9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMzcwMDMzCisjZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4xNF9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMTUuMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4xNV9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDIuNDU2MzAwCisjZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4xNV9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgIC0xLjA4NjI2NworI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluMTVfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluMTVfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjM3MDAzMworI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluMTVfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorLyogQ29lZmZpY2llbnRzIGZvciBzYW1wbGUgcmF0ZSAyNDAwMEh6ICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMS4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjFfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMS4wNDQ2NjIKKyNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjFfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4yMjMyODcKKyNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjFfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjFfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4yNjc5NDkKKyNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjFfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAyLjAwMDAwMCBkQiAqLworI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMl9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAxLjA5NDc3MworI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMl9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjE3MzE3NgorI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMl9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMl9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjI2Nzk0OQorI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMl9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDMuMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4zX0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuMTUwOTk5CisjZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4zX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMTE2OTUwCisjZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4zX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4zX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMjY3OTQ5CisjZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4zX0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgNC4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjRfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMS4yMTQwODYKKyNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjRfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wNTM4NjMKKyNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjRfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjRfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4yNjc5NDkKKyNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjRfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICA1LjAwMDAwMCBkQiAqLworI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluNV9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAxLjI4NDg3MAorI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluNV9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4wMTY5MjEKKyNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjVfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjVfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4yNjc5NDkKKyNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjVfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICA2LjAwMDAwMCBkQiAqLworI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluNl9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuMzY0MjkxCisjZGVmaW5lIEhQRl9GczI0MDAwX0dhaW42X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuMDk2MzQyCisjZGVmaW5lIEhQRl9GczI0MDAwX0dhaW42X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjZfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjI2Nzk0OQorI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluNl9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgNy4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjdfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMS40NTM0MDMKKyNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjdfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuMTg1NDU0CisjZGVmaW5lIEhQRl9GczI0MDAwX0dhaW43X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczI0MDAwX0dhaW43X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMjY3OTQ5CisjZGVmaW5lIEhQRl9GczI0MDAwX0dhaW43X0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgOC4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjhfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMS41NTMzODkKKyNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjhfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuMjg1NDQwCisjZGVmaW5lIEhQRl9GczI0MDAwX0dhaW44X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczI0MDAwX0dhaW44X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMjY3OTQ5CisjZGVmaW5lIEhQRl9GczI0MDAwX0dhaW44X0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgOS4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjlfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMS42NjU1NzQKKyNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjlfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuMzk3NjI1CisjZGVmaW5lIEhQRl9GczI0MDAwX0dhaW45X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczI0MDAwX0dhaW45X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMjY3OTQ5CisjZGVmaW5lIEhQRl9GczI0MDAwX0dhaW45X0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMTAuMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4xMF9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuNzkxNDQ5CisjZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4xMF9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjUyMzQ5OQorI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMTBfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMTBfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjI2Nzk0OQorI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMTBfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDExLjAwMDAwMCBkQiAqLworI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMTFfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAxLjkzMjY4MgorI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMTFfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC42NjQ3MzMKKyNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjExX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjExX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4yNjc5NDkKKyNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjExX0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxMi4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjEyX0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgMi4wOTExNDgKKyNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjEyX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuODIzMTk5CisjZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4xMl9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4xMl9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMjY3OTQ5CisjZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4xMl9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMTMuMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4xM19BMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDIuMjY4OTUwCisjZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4xM19BMSAgICAgICAgICAgICAgICAgICAgICAgICAgIC0xLjAwMTAwMQorI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMTNfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMTNfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjI2Nzk0OQorI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMTNfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDE0LjAwMDAwMCBkQiAqLworI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMTRfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAyLjQ2ODQ0NworI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMTRfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAtMS4yMDA0OTgKKyNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjE0X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjE0X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4yNjc5NDkKKyNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjE0X0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxNS4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjE1X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgMi42OTIyODcKKyNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjE1X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgLTEuNDI0MzM4CisjZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4xNV9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4xNV9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMjY3OTQ5CisjZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4xNV9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisvKiBDb2VmZmljaWVudHMgZm9yIHNhbXBsZSByYXRlIDMyMDAwSHogKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxLjAwMDAwMCBkQiAqLworI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluMV9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAxLjA2MTAwOQorI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluMV9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4wNjEwMDkKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjFfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjFfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4xX0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMi4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjJfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuMTI5NDYzCisjZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4yX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4xMjk0NjMKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjJfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4yX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjJfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMy4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjNfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuMjA2MjY3CisjZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4zX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4yMDYyNjcKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjNfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4zX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjNfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgNC4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjRfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMS4yOTI0NDcKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjRfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuMjkyNDQ3CisjZGVmaW5lIEhQRl9GczMyMDAwX0dhaW40X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczMyMDAwX0dhaW40X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjAwMDAwMAorI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluNF9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDUuMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9GczMyMDAwX0dhaW41X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuMzg5MTQwCisjZGVmaW5lIEhQRl9GczMyMDAwX0dhaW41X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjM4OTE0MAorI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluNV9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluNV9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjVfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICA2LjAwMDAwMCBkQiAqLworI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluNl9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMS40OTc2MzEKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjZfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjQ5NzYzMQorI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluNl9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjZfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjAwMDAwMAorI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluNl9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICA3LjAwMDAwMCBkQiAqLworI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluN19BMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMS42MTkzNjEKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjdfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjYxOTM2MQorI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluN19BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjdfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjAwMDAwMAorI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluN19CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICA4LjAwMDAwMCBkQiAqLworI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluOF9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMS43NTU5NDMKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjhfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjc1NTk0MworI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluOF9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjhfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjAwMDAwMAorI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluOF9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICA5LjAwMDAwMCBkQiAqLworI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluOV9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMS45MDkxOTEKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjlfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjkwOTE5MQorI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluOV9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjlfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjAwMDAwMAorI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluOV9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxMC4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjEwX0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIuMDgxMTM5CisjZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4xMF9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMS4wODExMzkKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjEwX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4xMF9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjEwX0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMTEuMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4xMV9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDIuMjc0MDY3CisjZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4xMV9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgIC0xLjI3NDA2NworI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluMTFfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluMTFfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjExX0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxMi4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjEyX0EwICAgICAgICAgICAgICAgICAgICAgICAgICAyLjQ5MDUzNgorI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluMTJfQTEgICAgICAgICAgICAgICAgICAgICAgICAgIC0xLjQ5MDUzNgorI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluMTJfQTIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4xMl9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4xMl9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxMy4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjEzX0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgMi43MzM0MTgKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjEzX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgLTEuNzMzNDE4CisjZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4xM19BMiAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4xM19CMSAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjAwMDAwMAorI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluMTNfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDE0LjAwMDAwMCBkQiAqLworI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluMTRfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAzLjAwNTkzNgorI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluMTRfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAtMi4wMDU5MzYKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjE0X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjE0X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4xNF9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMTUuMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4xNV9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgMy4zMTE3MDcKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjE1X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAtMi4zMTE3MDcKKyNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjE1X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluMTVfQjEgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjAwMDAwMAorI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluMTVfQjIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisvKiBDb2VmZmljaWVudHMgZm9yIHNhbXBsZSByYXRlIDQ0MTAwSHogKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxLjAwMDAwMCBkQiAqLworI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluMV9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAxLjA3NDM2NAorI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluMV9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4yOTMyNTcKKyNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjFfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjFfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuMjE4ODk0CisjZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4xX0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMi4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjJfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMS4xNTc4MDEKKyNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjJfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuMzc2Njk1CisjZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4yX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4yX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjIxODg5NAorI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluMl9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDMuMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4zX0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgMS4yNTE0MjAKKyNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjNfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC40NzAzMTMKKyNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjNfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluM19CMSAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjIxODg5NAorI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluM19CMiAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgNC4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjRfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMS4zNTY0NjEKKyNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjRfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuNTc1MzU1CisjZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW40X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW40X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjIxODg5NAorI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluNF9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDUuMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW41X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuNDc0MzIwCisjZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW41X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjY5MzIxMworI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluNV9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluNV9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4yMTg4OTQKKyNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjVfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICA2LjAwMDAwMCBkQiAqLworI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluNl9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuNjA2NTU5CisjZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW42X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuODI1NDUzCisjZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW42X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjZfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4yMTg4OTQKKyNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjZfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDcuMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW43X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgMS43NTQ5MzUKKyNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjdfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC45NzM4MjgKKyNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjdfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluN19CMSAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjIxODg5NAorI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluN19CMiAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgOC4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjhfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMS45MjE0MTQKKyNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjhfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTEuMTQwMzA4CisjZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW44X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW44X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjIxODg5NAorI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluOF9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDkuMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW45X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIuMTA4MjA4CisjZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW45X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0xLjMyNzEwMQorI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluOV9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluOV9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4yMTg4OTQKKyNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjlfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxMC4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjEwX0EwICAgICAgICAgICAgICAgICAgICAgICAgICAyLjMxNzc5MworI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluMTBfQTEgICAgICAgICAgICAgICAgICAgICAgICAgIC0xLjUzNjY4NworI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluMTBfQTIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4xMF9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuMjE4ODk0CisjZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4xMF9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxMS4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjExX0EwICAgICAgICAgICAgICAgICAgICAgICAgICAyLjU1Mjk1MgorI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluMTFfQTEgICAgICAgICAgICAgICAgICAgICAgICAgIC0xLjc3MTg0NgorI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluMTFfQTIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4xMV9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuMjE4ODk0CisjZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4xMV9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxMi4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjEyX0EwICAgICAgICAgICAgICAgICAgICAgICAgICAyLjgxNjgwNQorI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluMTJfQTEgICAgICAgICAgICAgICAgICAgICAgICAgIC0yLjAzNTY5OAorI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluMTJfQTIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4xMl9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuMjE4ODk0CisjZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4xMl9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxMy4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjEzX0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgMy4xMTI4NTIKKyNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjEzX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgLTIuMzMxNzQ2CisjZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4xM19BMiAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4xM19CMSAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjIxODg5NAorI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluMTNfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDE0LjAwMDAwMCBkQiAqLworI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluMTRfQTAgICAgICAgICAgICAgICAgICAgICAgICAgIDMuNDQ1MDIzCisjZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4xNF9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgLTIuNjYzOTE2CisjZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4xNF9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjE0X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4yMTg4OTQKKyNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjE0X0IyICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDE1LjAwMDAwMCBkQiAqLworI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluMTVfQTAgICAgICAgICAgICAgICAgICAgICAgICAgIDMuODE3NzI0CisjZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4xNV9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgLTMuMDM2NjE4CisjZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4xNV9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjE1X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4yMTg4OTQKKyNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjE1X0IyICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorLyogQ29lZmZpY2llbnRzIGZvciBzYW1wbGUgcmF0ZSA0ODAwMEh6ICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMS4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjFfQTAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuMDc3MzU3CisjZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4xX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4zNDUzMDYKKyNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjFfQTIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4xX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4yNjc5NDkKKyNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjFfQjIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMi4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjJfQTAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuMTY0MTUyCisjZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4yX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAtMC40MzIxMDEKKyNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjJfQTIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4yX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4yNjc5NDkKKyNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjJfQjIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMy4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjNfQTAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuMjYxNTM4CisjZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4zX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAtMC41Mjk0ODgKKyNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjNfQTIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4zX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4yNjc5NDkKKyNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjNfQjIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgNC4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjRfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAxLjM3MDgwNworI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluNF9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjYzODc1NworI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluNF9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW40X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuMjY3OTQ5CisjZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW40X0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICA1LjAwMDAwMCBkQiAqLworI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluNV9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuNDkzNDA5CisjZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW41X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuNzYxMzU5CisjZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW41X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjVfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4yNjc5NDkKKyNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjVfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDYuMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW42X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuNjMwOTcxCisjZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW42X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjg5ODkyMAorI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluNl9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluNl9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4yNjc5NDkKKyNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjZfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICA3LjAwMDAwMCBkQiAqLworI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluN19BMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAxLjc4NTMxOAorI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluN19BMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMS4wNTMyNjcKKyNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjdfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjdfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuMjY3OTQ5CisjZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW43X0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgOC4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjhfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAxLjk1ODQ5OAorI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluOF9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgIC0xLjIyNjQ0NworI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluOF9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW44X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuMjY3OTQ5CisjZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW44X0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICA5LjAwMDAwMCBkQiAqLworI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluOV9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgMi4xNTI4MDkKKyNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjlfQTEgICAgICAgICAgICAgICAgICAgICAgICAgIC0xLjQyMDc1OAorI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluOV9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjlfQjEgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjI2Nzk0OQorI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluOV9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxMC4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjEwX0EwICAgICAgICAgICAgICAgICAgICAgICAgIDIuMzcwODI5CisjZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4xMF9BMSAgICAgICAgICAgICAgICAgICAgICAgICAtMS42Mzg3NzgKKyNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjEwX0EyICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4xMF9CMSAgICAgICAgICAgICAgICAgICAgICAgICAtMC4yNjc5NDkKKyNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjEwX0IyICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMTEuMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4xMV9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgMi42MTU0NTIKKyNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjExX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAtMS44ODM0MDEKKyNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjExX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluMTFfQjEgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjI2Nzk0OQorI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluMTFfQjIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMTIuMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4xMl9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgMi44ODk5MjQKKyNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjEyX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAtMi4xNTc4NzMKKyNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjEyX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluMTJfQjEgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjI2Nzk0OQorI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluMTJfQjIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMTMuMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4xM19BMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDMuMTk3ODg2CisjZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4xM19BMSAgICAgICAgICAgICAgICAgICAgICAgICAgIC0yLjQ2NTgzNQorI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluMTNfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluMTNfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4yNjc5NDkKKyNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjEzX0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxNC4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjE0X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAzLjU0MzQyNQorI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluMTRfQTEgICAgICAgICAgICAgICAgICAgICAgICAgIC0yLjgxMTM3NAorI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluMTRfQTIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4xNF9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuMjY3OTQ5CisjZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4xNF9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxNS4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjE1X0EwICAgICAgICAgICAgICAgICAgICAgICAgIDMuOTMxMTI3CisjZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4xNV9BMSAgICAgICAgICAgICAgICAgICAgICAgICAtMy4xOTkwNzYKKyNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjE1X0EyICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4xNV9CMSAgICAgICAgICAgICAgICAgICAgICAgICAtMC4yNjc5NDkKKyNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjE1X0IyICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCiAKKyNpZmRlZiBISUdIRVJfRlMKKworLyogQ29lZmZpY2llbnRzIGZvciBzYW1wbGUgcmF0ZSA5NjAwMEh6ICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMS4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzOTYwMDBfR2FpbjFfQTAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuMDk2MjMzCisjZGVmaW5lIEhQRl9Gczk2MDAwX0dhaW4xX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAtMC42NzM1ODMKKyNkZWZpbmUgSFBGX0ZzOTYwMDBfR2FpbjFfQTIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9Gczk2MDAwX0dhaW4xX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAtMC41NzczNTAKKyNkZWZpbmUgSFBGX0ZzOTYwMDBfR2FpbjFfQjIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMi4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzOTYwMDBfR2FpbjJfQTAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuMjA0MjA4CisjZGVmaW5lIEhQRl9Gczk2MDAwX0dhaW4yX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAtMC43ODE1NTgKKyNkZWZpbmUgSFBGX0ZzOTYwMDBfR2FpbjJfQTIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9Gczk2MDAwX0dhaW4yX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAtMC41NzczNTAKKyNkZWZpbmUgSFBGX0ZzOTYwMDBfR2FpbjJfQjIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMy4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzOTYwMDBfR2FpbjNfQTAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuMzI1MzU4CisjZGVmaW5lIEhQRl9Gczk2MDAwX0dhaW4zX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAtMC45MDI3MDgKKyNkZWZpbmUgSFBGX0ZzOTYwMDBfR2FpbjNfQTIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9Gczk2MDAwX0dhaW4zX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAtMC41NzczNTAKKyNkZWZpbmUgSFBGX0ZzOTYwMDBfR2FpbjNfQjIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgNC4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzOTYwMDBfR2FpbjRfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAxLjQ2MTI5MQorI2RlZmluZSBIUEZfRnM5NjAwMF9HYWluNF9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgIC0xLjAzODY0MQorI2RlZmluZSBIUEZfRnM5NjAwMF9HYWluNF9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9Gczk2MDAwX0dhaW40X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuNTc3MzUwCisjZGVmaW5lIEhQRl9Gczk2MDAwX0dhaW40X0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICA1LjAwMDAwMCBkQiAqLworI2RlZmluZSBIUEZfRnM5NjAwMF9HYWluNV9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuNjEzODEwCisjZGVmaW5lIEhQRl9Gczk2MDAwX0dhaW41X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgLTEuMTkxMTYwCisjZGVmaW5lIEhQRl9Gczk2MDAwX0dhaW41X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzOTYwMDBfR2FpbjVfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC41NzczNTAKKyNkZWZpbmUgSFBGX0ZzOTYwMDBfR2FpbjVfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDYuMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9Gczk2MDAwX0dhaW42X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuNzg0OTM5CisjZGVmaW5lIEhQRl9Gczk2MDAwX0dhaW42X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0xLjM2MjI4OQorI2RlZmluZSBIUEZfRnM5NjAwMF9HYWluNl9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnM5NjAwMF9HYWluNl9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC41NzczNTAKKyNkZWZpbmUgSFBGX0ZzOTYwMDBfR2FpbjZfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDcuMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9Gczk2MDAwX0dhaW43X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuOTc2OTQ5CisjZGVmaW5lIEhQRl9Gczk2MDAwX0dhaW43X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0xLjU1NDI5OQorI2RlZmluZSBIUEZfRnM5NjAwMF9HYWluN19BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnM5NjAwMF9HYWluN19CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC41NzczNTAKKyNkZWZpbmUgSFBGX0ZzOTYwMDBfR2FpbjdfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICA4LjAwMDAwMCBkQiAqLworI2RlZmluZSBIUEZfRnM5NjAwMF9HYWluOF9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDIuMTkyMzg3CisjZGVmaW5lIEhQRl9Gczk2MDAwX0dhaW44X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgLTEuNzY5NzM4CisjZGVmaW5lIEhQRl9Gczk2MDAwX0dhaW44X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzOTYwMDBfR2FpbjhfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC41NzczNTAKKyNkZWZpbmUgSFBGX0ZzOTYwMDBfR2FpbjhfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgOS4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzOTYwMDBfR2FpbjlfQTAgICAgICAgICAgICAgICAgICAgICAgICAgIDIuNDM0MTEzCisjZGVmaW5lIEhQRl9Gczk2MDAwX0dhaW45X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAtMi4wMTE0NjQKKyNkZWZpbmUgSFBGX0ZzOTYwMDBfR2FpbjlfQTIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9Gczk2MDAwX0dhaW45X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAtMC41NzczNTAKKyNkZWZpbmUgSFBGX0ZzOTYwMDBfR2FpbjlfQjIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDEwLjAwMDAwMCBkQiAqLworI2RlZmluZSBIUEZfRnM5NjAwMF9HYWluMTBfQTAgICAgICAgICAgICAgICAgICAgICAgICAyLjcwNTMzNQorI2RlZmluZSBIUEZfRnM5NjAwMF9HYWluMTBfQTEgICAgICAgICAgICAgICAgICAgICAgICAtMi4yODI2ODUKKyNkZWZpbmUgSFBGX0ZzOTYwMDBfR2FpbjEwX0EyICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9Gczk2MDAwX0dhaW4xMF9CMSAgICAgICAgICAgICAgICAgICAgICAgICAtMC41NzczNTAKKyNkZWZpbmUgSFBGX0ZzOTYwMDBfR2FpbjEwX0IyICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMTEuMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9Gczk2MDAwX0dhaW4xMV9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgMy4wMDk2NTAKKyNkZWZpbmUgSFBGX0ZzOTYwMDBfR2FpbjExX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAtMi41ODcwMDAKKyNkZWZpbmUgSFBGX0ZzOTYwMDBfR2FpbjExX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnM5NjAwMF9HYWluMTFfQjEgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjU3NzM1MAorI2RlZmluZSBIUEZfRnM5NjAwMF9HYWluMTFfQjIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDEyLjAwMDAwMCBkQiAqLworI2RlZmluZSBIUEZfRnM5NjAwMF9HYWluMTJfQTAgICAgICAgICAgICAgICAgICAgICAgICAgIDMuMzUxMDk3CisjZGVmaW5lIEhQRl9Gczk2MDAwX0dhaW4xMl9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgLTIuOTI4NDQ3CisjZGVmaW5lIEhQRl9Gczk2MDAwX0dhaW4xMl9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzOTYwMDBfR2FpbjEyX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAtMC41NzczNTAKKyNkZWZpbmUgSFBGX0ZzOTYwMDBfR2FpbjEyX0IyICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMTMuMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9Gczk2MDAwX0dhaW4xM19BMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDMuNzM0MjA3CisjZGVmaW5lIEhQRl9Gczk2MDAwX0dhaW4xM19BMSAgICAgICAgICAgICAgICAgICAgICAgICAgIC0zLjMxMTU1OAorI2RlZmluZSBIUEZfRnM5NjAwMF9HYWluMTNfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnM5NjAwMF9HYWluMTNfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC41NzczNTAKKyNkZWZpbmUgSFBGX0ZzOTYwMDBfR2FpbjEzX0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxNC4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzOTYwMDBfR2FpbjE0X0EwICAgICAgICAgICAgICAgICAgICAgICAgIDQuMTY0MDY0CisjZGVmaW5lIEhQRl9Gczk2MDAwX0dhaW4xNF9BMSAgICAgICAgICAgICAgICAgICAgICAgICAtMy43NDE0MTQKKyNkZWZpbmUgSFBGX0ZzOTYwMDBfR2FpbjE0X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnM5NjAwMF9HYWluMTRfQjEgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjU3NzM1MAorI2RlZmluZSBIUEZfRnM5NjAwMF9HYWluMTRfQjIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMTUuMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9Gczk2MDAwX0dhaW4xNV9BMCAgICAgICAgICAgICAgICAgICAgICAgICA0LjY0NjM3MQorI2RlZmluZSBIUEZfRnM5NjAwMF9HYWluMTVfQTEgICAgICAgICAgICAgICAgICAgICAgICAgLTQuMjIzNzIxCisjZGVmaW5lIEhQRl9Gczk2MDAwX0dhaW4xNV9BMiAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnM5NjAwMF9HYWluMTVfQjEgICAgICAgICAgICAgICAgICAgICAgICAgLTAuNTc3MzUwCisjZGVmaW5lIEhQRl9Gczk2MDAwX0dhaW4xNV9CMiAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorCisvKiBDb2VmZmljaWVudHMgZm9yIHNhbXBsZSByYXRlIDE5MjAwMEh6ICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDEuMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9GczE5MjAwMF9HYWluMV9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgMS4xMDc4MjMKKyNkZWZpbmUgSFBGX0ZzMTkyMDAwX0dhaW4xX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAtMC44NzUxNTAKKyNkZWZpbmUgSFBGX0ZzMTkyMDAwX0dhaW4xX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnMxOTIwMDBfR2FpbjFfQjEgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjc2NzMyNworI2RlZmluZSBIUEZfRnMxOTIwMDBfR2FpbjFfQjIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDIuMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9GczE5MjAwMF9HYWluMl9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgMS4yMjg4MDMKKyNkZWZpbmUgSFBGX0ZzMTkyMDAwX0dhaW4yX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAtMC45OTYxMzAKKyNkZWZpbmUgSFBGX0ZzMTkyMDAwX0dhaW4yX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnMxOTIwMDBfR2FpbjJfQjEgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjc2NzMyNworI2RlZmluZSBIUEZfRnMxOTIwMDBfR2FpbjJfQjIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAzLjAwMDAwMCBkQiAqLworI2RlZmluZSBIUEZfRnMxOTIwMDBfR2FpbjNfQTAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuMzY0NTQ0CisjZGVmaW5lIEhQRl9GczE5MjAwMF9HYWluM19BMSAgICAgICAgICAgICAgICAgICAgICAgICAgLTEuMTMxODcxCisjZGVmaW5lIEhQRl9GczE5MjAwMF9HYWluM19BMiAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzMTkyMDAwX0dhaW4zX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAtMC43NjczMjcKKyNkZWZpbmUgSFBGX0ZzMTkyMDAwX0dhaW4zX0IyICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgNC4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzMTkyMDAwX0dhaW40X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAxLjUxNjg0OQorI2RlZmluZSBIUEZfRnMxOTIwMDBfR2FpbjRfQTEgICAgICAgICAgICAgICAgICAgICAgICAgIC0xLjI4NDE3NgorI2RlZmluZSBIUEZfRnMxOTIwMDBfR2FpbjRfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnMxOTIwMDBfR2FpbjRfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC43NjczMjcKKyNkZWZpbmUgSFBGX0ZzMTkyMDAwX0dhaW40X0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDUuMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9GczE5MjAwMF9HYWluNV9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuNjg3NzM3CisjZGVmaW5lIEhQRl9GczE5MjAwMF9HYWluNV9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgIC0xLjQ1NTA2NAorI2RlZmluZSBIUEZfRnMxOTIwMDBfR2FpbjVfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnMxOTIwMDBfR2FpbjVfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC43NjczMjcKKyNkZWZpbmUgSFBGX0ZzMTkyMDAwX0dhaW41X0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDYuMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9GczE5MjAwMF9HYWluNl9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAxLjg3OTQ3NworI2RlZmluZSBIUEZfRnMxOTIwMDBfR2FpbjZfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTEuNjQ2ODA0CisjZGVmaW5lIEhQRl9GczE5MjAwMF9HYWluNl9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnMxOTIwMDBfR2FpbjZfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuNzY3MzI3CisjZGVmaW5lIEhQRl9GczE5MjAwMF9HYWluNl9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDcuMDAwMDAwIGRCICovCisjZGVmaW5lIEhQRl9GczE5MjAwMF9HYWluN19BMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAyLjA5NDYxMworI2RlZmluZSBIUEZfRnMxOTIwMDBfR2FpbjdfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTEuODYxOTQwCisjZGVmaW5lIEhQRl9GczE5MjAwMF9HYWluN19BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnMxOTIwMDBfR2FpbjdfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuNzY3MzI3CisjZGVmaW5lIEhQRl9GczE5MjAwMF9HYWluN19CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgOC4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzMTkyMDAwX0dhaW44X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgMi4zMzU5OTkKKyNkZWZpbmUgSFBGX0ZzMTkyMDAwX0dhaW44X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgLTIuMTAzMzI2CisjZGVmaW5lIEhQRl9GczE5MjAwMF9HYWluOF9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczE5MjAwMF9HYWluOF9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjc2NzMyNworI2RlZmluZSBIUEZfRnMxOTIwMDBfR2FpbjhfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgOS4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzMTkyMDAwX0dhaW45X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAyLjYwNjgzOQorI2RlZmluZSBIUEZfRnMxOTIwMDBfR2FpbjlfQTEgICAgICAgICAgICAgICAgICAgICAgICAgIC0yLjM3NDE2NgorI2RlZmluZSBIUEZfRnMxOTIwMDBfR2FpbjlfQTIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczE5MjAwMF9HYWluOV9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuNzY3MzI3CisjZGVmaW5lIEhQRl9GczE5MjAwMF9HYWluOV9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxMC4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzMTkyMDAwX0dhaW4xMF9BMCAgICAgICAgICAgICAgICAgICAgICAgIDIuOTEwNzI2CisjZGVmaW5lIEhQRl9GczE5MjAwMF9HYWluMTBfQTEgICAgICAgICAgICAgICAgICAgICAgICAtMi42NzgwNTMKKyNkZWZpbmUgSFBGX0ZzMTkyMDAwX0dhaW4xMF9BMiAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBIUEZfRnMxOTIwMDBfR2FpbjEwX0IxICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjc2NzMyNworI2RlZmluZSBIUEZfRnMxOTIwMDBfR2FpbjEwX0IyICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDExLjAwMDAwMCBkQiAqLworI2RlZmluZSBIUEZfRnMxOTIwMDBfR2FpbjExX0EwICAgICAgICAgICAgICAgICAgICAgICAgICAzLjI1MTY5MworI2RlZmluZSBIUEZfRnMxOTIwMDBfR2FpbjExX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAtMy4wMTkwMjAKKyNkZWZpbmUgSFBGX0ZzMTkyMDAwX0dhaW4xMV9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzMTkyMDAwX0dhaW4xMV9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuNzY3MzI3CisjZGVmaW5lIEhQRl9GczE5MjAwMF9HYWluMTFfQjIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDEyLjAwMDAwMCBkQiAqLworI2RlZmluZSBIUEZfRnMxOTIwMDBfR2FpbjEyX0EwICAgICAgICAgICAgICAgICAgICAgICAgICAzLjYzNDI2NAorI2RlZmluZSBIUEZfRnMxOTIwMDBfR2FpbjEyX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAtMy40MDE1OTEKKyNkZWZpbmUgSFBGX0ZzMTkyMDAwX0dhaW4xMl9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgSFBGX0ZzMTkyMDAwX0dhaW4xMl9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuNzY3MzI3CisjZGVmaW5lIEhQRl9GczE5MjAwMF9HYWluMTJfQjIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxMy4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzMTkyMDAwX0dhaW4xM19BMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDQuMDYzNTE2CisjZGVmaW5lIEhQRl9GczE5MjAwMF9HYWluMTNfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAtMy44MzA4NDMKKyNkZWZpbmUgSFBGX0ZzMTkyMDAwX0dhaW4xM19BMiAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczE5MjAwMF9HYWluMTNfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC43NjczMjcKKyNkZWZpbmUgSFBGX0ZzMTkyMDAwX0dhaW4xM19CMiAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxNC4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzMTkyMDAwX0dhaW4xNF9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgNC41NDUxNDUKKyNkZWZpbmUgSFBGX0ZzMTkyMDAwX0dhaW4xNF9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgLTQuMzEyNDcyCisjZGVmaW5lIEhQRl9GczE5MjAwMF9HYWluMTRfQTIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczE5MjAwMF9HYWluMTRfQjEgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjc2NzMyNworI2RlZmluZSBIUEZfRnMxOTIwMDBfR2FpbjE0X0IyICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxNS4wMDAwMDAgZEIgKi8KKyNkZWZpbmUgSFBGX0ZzMTkyMDAwX0dhaW4xNV9BMCAgICAgICAgICAgICAgICAgICAgICAgICA1LjA4NTU0MgorI2RlZmluZSBIUEZfRnMxOTIwMDBfR2FpbjE1X0ExICAgICAgICAgICAgICAgICAgICAgICAgIC00Ljg1Mjg2OAorI2RlZmluZSBIUEZfRnMxOTIwMDBfR2FpbjE1X0EyICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIEhQRl9GczE5MjAwMF9HYWluMTVfQjEgICAgICAgICAgICAgICAgICAgICAgICAgLTAuNzY3MzI3CisjZGVmaW5lIEhQRl9GczE5MjAwMF9HYWluMTVfQjIgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKworI2VuZGlmCisKKyNlbHNlCiAvKiBDb2VmZmljaWVudHMgZm9yIHNhbXBsZSByYXRlIDIyMDUwSHogKi8KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxLjAwMDAwMCBkQiAqLwogI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluMV9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTM4MyAgICA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gICAgICAgICAgICAgICAgICAgICAgJnBJbnN0YW5jZS0+cFRFX1RhcHMtPlRyZWJsZUJvb3N0X1RhcHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZMVk1fVHJlYmxlQm9vc3RDb2Vmc1tPZmZzZXRdKTsKKworICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAqIENsZWFyIHRoZSB0YXBzCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIExvYWRDb25zdF9GbG9hdCgoTFZNX0ZMT0FUKTAsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFZhbHVlICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKikmcEluc3RhbmNlLT5wVEVfVGFwcy0+VHJlYmxlQm9vc3RfVGFwcywgIC8qIERlc3RpbmF0aW9uLlwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2FzdCB0byB2b2lkOiBubyBkZXJlZmVyZW5jaW5nIGluIGZ1bmN0aW9uICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9VSU5UMTYpKHNpemVvZihwSW5zdGFuY2UtPnBURV9UYXBzLT5UcmVibGVCb29zdF9UYXBzKSAvIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKExWTV9GTE9BVCkpKTsgLyogTnVtYmVyIG9mIHdvcmRzICovCisjZWxzZQogICAgICAgICAgICAgRk9fMklfRDE2RjMyQ3NzX0xTaHhfVFJDX1dSQV8wMV9Jbml0KCZwSW5zdGFuY2UtPnBURV9TdGF0ZS0+VHJlYmxlQm9vc3RfU3RhdGUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwSW5zdGFuY2UtPnBURV9UYXBzLT5UcmVibGVCb29zdF9UYXBzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmTFZNX1RyZWJsZUJvb3N0Q29lZnNbT2Zmc2V0XSk7CkBAIC0zMDksNiArMzM1LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKSZwSW5zdGFuY2UtPnBURV9UYXBzLT5UcmVibGVCb29zdF9UYXBzLCAgLyogRGVzdGluYXRpb24uXAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDYXN0IHRvIHZvaWQ6IG5vIGRlcmVmZXJlbmNpbmcgaW4gZnVuY3Rpb24gKi8KICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX1VJTlQxNikoc2l6ZW9mKHBJbnN0YW5jZS0+cFRFX1RhcHMtPlRyZWJsZUJvb3N0X1RhcHMpL3NpemVvZihMVk1fSU5UMTYpKSk7IC8qIE51bWJlciBvZiB3b3JkcyAqLworI2VuZGlmCiAgICAgICAgIH0KICAgICB9CiAgICAgZWxzZQpAQCAtMzQyLDYgKzM2OSw5IEBACiAgICAgTFZNX1VJTlQxNiAgICAgIGRCU2hpZnRzOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogNmRCIHNoaWZ0cyAqLwogICAgIExWTV9VSU5UMTYgICAgICBkQk9mZnNldDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFRhYmxlIG9mZnNldCAqLwogICAgIExWTV9JTlQxNiAgICAgICBWb2x1bWUgPSAwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFJlcXVpcmVkIHZvbHVtZSBpbiBkQnMgKi8KKyNpZmRlZiBCVUlMRF9GTE9BVAorICAgIExWTV9GTE9BVCAgICAgICAgVGVtcDsKKyNlbmRpZgogCiAgICAgLyoKICAgICAgKiBMaW1pdCB0aGUgZ2FpbiB0byB0aGUgbWF4aW11bSBhbGxvd2VkCkBAIC00MDEsMjIgKzQzMSw0NiBAQAogICAgICAqLwogICAgIGlm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ZS0+VkNfQmFsYW5jZU1peC5NaXhlclN0cmVhbVswXSxUYXJnZXRfRmxvYXQpOworICAgICAgICAgICAgTFZDX01peGVyX1ZhclNsb3BlX1NldFRpbWVDb25zdGFudCgmcEluc3RhbmNlLT5WQ19CYWxhbmNlTWl4Lk1peGVyU3RyZWFtWzBdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVkNfTUlYRVJfVElNRSxMb2NhbFBhcmFtcy5TYW1wbGVSYXRlLCAxKTsKKworICAgICAgICAgICAgTFZDX01peGVyX1NldFRhcmdldCgmcEluc3RhbmNlLT5WQ19CYWxhbmNlTWl4Lk1peGVyU3RyZWFtWzFdLFRhcmdldF9GbG9hdCk7CisgICAgICAgICAgICBMVkNfTWl4ZXJfVmFyU2xvcGVfU2V0VGltZUNvbnN0YW50KCZwSW5zdGFuY2UtPlZDX0JhbGFuY2VNaXguTWl4ZXJTdHJlYW1bMV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9WQ19NSVhFUl9USU1FLExvY2FsUGFyYW1zLlNhbXBsZVJhdGUsIDEpOworI2Vsc2UKICAgICAgICAgICAgIExWQ19NaXhlcl9TZXRUYXJnZXQoJnBJbnN0YW5jZS0+VkNfQmFsYW5jZU1peC5NaXhlclN0cmVhbVswXSxUYXJnZXQpOwogICAgICAgICAgICAgTFZDX01peGVyX1ZhclNsb3BlX1NldFRpbWVDb25zdGFudCgmcEluc3RhbmNlLT5WQ19CYWxhbmNlTWl4Lk1peGVyU3RyZWFtWzBdLExWTV9WQ19NSVhFUl9USU1FLExvY2FsUGFyYW1zLlNhbXBsZVJhdGUsMSk7CiAKICAgICAgICAgICAgIExWQ19NaXhlcl9TZXRUYXJnZXQoJnBJbnN0YW5jZS0+VkNfQmFsYW5jZU1peC5NaXhlclN0cmVhbVsxXSxUYXJnZXQpOwogICAgICAgICAgICAgTFZDX01peGVyX1ZhclNsb3BlX1N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NoU2l6ZSk7Ci0KKyNpZmRlZiBCVUlMRF9GTE9BVAorICAgICAgICBMb2FkQ29uc3RfRmxvYXQoMCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIENsZWFyIHRoZSBpbnB1dCBkZWxheSBidWZmZXIgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fRkxPQVQgKikmcEluc3RhbmNlLT5wQnVmZmVyTWFuYWdlbWVudC0+SW5EZWxheUJ1ZmZlciwKKyAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpKDIgKiBNSU5fSU5URVJOQUxfQkxPQ0tTSVpFKSk7CisjZWxzZQogICAgICAgICBMb2FkQ29uc3RfMTYoMCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIENsZWFyIHRoZSBpbnB1dCBkZWxheSBidWZmZXIgKi8KICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYgKikmcEluc3RhbmNlLT5wQnVmZmVyTWFuYWdlbWVudC0+SW5EZWxheUJ1ZmZlciwKICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpKDIgKiBNSU5fSU5URVJOQUxfQkxPQ0tTSVpFKSk7CisjZW5kaWYKICAgICAgICAgcEluc3RhbmNlLT5wQnVmZmVyTWFuYWdlbWVudC0+SW5EZWxheVNhbXBsZXMgPSBNSU5fSU5URVJOQUxfQkxPQ0tTSVpFOyAvKiBTZXQgdGhlIG51bWJlciBvZiBkZWxheSBzYW1wbGVzICovCiAgICAgICAgIHBJbnN0YW5jZS0+cEJ1ZmZlck1hbmFnZW1lbnQtPk91dERlbGF5U2FtcGxlcyA9IDA7ICAgICAgICAgICAgICAgICAgICAgLyogTm8gc2FtcGxlcyBpbiB0aGUgb3V0cHV0IGJ1ZmZlciAqLwogICAgICAgICBwSW5zdGFuY2UtPnBCdWZmZXJNYW5hZ2VtZW50LT5CdWZmZXJTdGF0ZSA9IExWTV9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lsaXRpZXMuU291cmNlRm9ybWF0ICAgID0gTFZFUU5CX0NBUF9TVEVSRU8gfCBMVkVRTkJfQ0FQX01PTk9JTlNURVJFTzsKQEAgLTg2OCw5ICs5MTAsMTQgQEAKICAgICAgICAgICAgICAgICBQU0FfTWVtVGFiLlJlZ2lvbltMVk1fUEVSU0lTVEVOVF9GQVNUX0NPRUZdLlNpemUpOwogCiAgICAgICAgICAgICAvKiBGYXN0IFRlbXBvcmFyeSAqLworI2lmZGVmIEJVSUxEX0ZMT0FUCiAgICAgICAgICAgICBwSW5zdGFuY2UtPnBQU0FJbnB1dCA9IEluc3RBbGxvY19BZGRNZW1iZXIoJkFsbG9jTWVtW0xWTV9URU1QT1JBUllfRkFTVF0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX1VJTlQzMikgTUFYX0lOVEVSTkFMX0JMT0NLU0laRSAqIHNpemVvZihMVk1fSU5UMTYpKTsKLQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fVUlOVDMyKSBNQVhfSU5URVJOQUxfQkxPQ0tTSVpFICogXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihMVk1fRkxPQVQpKTsKKyNlbHNlCisgICAgICAgICAgICBwSW5zdGFuY2UtPnBQU0FJbnB1dCA9IEluc3RBbGxvY19BZGRNZW1iZXIoJkFsbG9jTWVtW0xWTV9URU1QT1JBUllfRkFTVF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9VSU5UMzIpIE1BWF9JTlRFUk5BTF9CTE9DS1NJWkUgKiBzaXplb2YoTFZNX0lOVDE2KSk7CisjZW5kaWYKICAgICAgICAgICAgIFBTQV9NZW1UYWIuUmVnaW9uW0xWTV9URU1QT1JBUllfRk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0NLU0laRV07IC8qIElucHV0IGJ1ZmZlciBkZWxheSBsaW5lLCBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0IGFuZCByaWdodCAqLworICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgIEluRGVsYXlTYW1wbGVzOyAgICAgLyogTnVtYmVyIG9mIHNhbXBsZXMgaW4gdGhlIGlucHV0IGRlbGF5IGJ1ZmZlciAqLworCisgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICAgT3V0RGVsYXlCdWZmZXJbMiAqIE1JTl9JTlRFUk5BTF9CTE9DS1NJWkVdOyAvKiBPdXRwdXQgYnVmZmVyIGRlbGF5IFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZSAqLworICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgIE91dERlbGF5U2FtcGxlczsgICAgLyogTnVtYmVyIG9mIHNhbXBsZXMgaW4gdGhlIG91dHB1dCBkZWxheSBidWZmZXIsIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVmdCBhbmQgcmlnaHQgKi8KKyAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBTYW1wbGVzVG9PdXRwdXQ7ICAgIC8qIFNhbXBsZXMgdG8gd3JpdGUgdG8gdGhlIG91dHB1dCAqLworfSBMVk1fQnVmZmVyX3Q7CisjZWxzZQogdHlwZWRlZiBzdHJ1Y3QKIHsKICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAqcFNjcmF0Y2g7ICAgICAgICAgIC8qIEJ1bmRsZSBzY3JhdGNoIGJ1ZmZlciAqLwpAQCAtMTUwLDIyICsxNjcsMjggQEAKICAgICBMVk1fSU5UMTYgICAgICAg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JvbCBmbGFnICovCiAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgVkNfQVZMRml4ZWRWb2x1bWU7ICAvKiBBVkwgZml4ZWQgdm9sdW1lICovCkBAIC0yMzQsNyArMjc0LDExIEBACiAgICAgTFZQU0FfQ29udHJvbFBhcmFtc190ICAgUFNBX0NvbnRyb2xQYXJhbXM7ICAvKiBTcGVjdHJ1bSBBbmFseXplciBjb250cm9sIHBhcmFtZXRlcnMgKi8KICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBQU0FfR2Fpbk9mZnNldDsgICAgIC8qIFRvbmUgY29udHJvbCBmbGFnICovCiAgICAgTFZNX0NhbGxiYWNrICAgICAgICAgICAgQ2FsbEJhY2s7CisjaWZkZWYgQlVJTERfRkxPQVQKKyAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAqcFBTQUlucHV0OyAgICAgICAgIC8qIFBTQSBpbnB1dCBwb2ludGVyICovCisjZWxzZQogICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICpwUFNBSW5wdXQ7ICAgICAgICAgLyogUFNBIGlucHV0IHBvaW50ZXIgKi8KKyNlbmRpZgogCiAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICBOb1Ntb290aFZvbHVtZTsgICAgICAvKiBFbmFibGUgb3IgZGlzYWJsZSBzbW9vdGggdm9sdW1lIGNoYW5nZXMqLwogCkBAIC0yNjEsMTYgKzMwNSwyOCBAQAogCiB2b2lkICAgIExWTV9TZXRIZWFkcm9vbSggICAgTFZNX0luc3RhbmNlX3QgICAgICAgICAqcEluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9Db250cm9sUGFyYW1zX3QgICAgKnBQYXJhbXMpOwotCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgICAgTFZNX0J1ZmZlckluKCAgIExWTV9IYW5kbGVfdCAgICAgIGhJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9GTE9BVCAgICpwSW5EYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgKipwVG9Qcm9jZXNzLAorICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgKipwUHJvY2Vzc2VkLAorICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiAgICAgICAgKnBOdW1TYW1wbGVzKTsKKyNlbHNlCiB2b2lkICAgIExWTV9CdWZmZXJJbiggICBMVk1fSGFuZGxlX3QgICAgICBoSW5zdGFuY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMTYgICAqcEluRGF0YSwKICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICoqcFRvUHJvY2VzcywKICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICoqcFByb2Nlc3NlZCwKICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgICAgICAgICpwTnVtU2FtcGxlcyk7Ci0KKyNlbmRpZgorI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkICAgIExWTV9CdWZmZXJPdXQoICBMVk1fSGFuZGxlX3QgICAgIGhJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgKnBPdXREYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiAgICAgICAqcE51bVNhbXBsZXMpOworI2Vsc2UKIHZvaWQgICAgTFZNX0J1ZmZlck91dCggIExWTV9IYW5kbGVfdCAgICAgaEluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAqcE91dERhdGEsCiAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDE2ICAgICAgICpwTnVtU2FtcGxlcyk7CisjZW5kaWYKIAogTFZNX0lOVDMyIExWTV9BbGdvQ2FsbEJhY2soICAgICB2b2lkICAgICAgICAgICpwQnVuZGxlSGFuZGxlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICAgICpwRGF0YSwKZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9CdW5kbGUvc3JjL0xWTV9Qcm9jZXNzLmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQnVuZGxlL3NyYy9MVk1fUHJvY2Vzcy5jCmluZGV4IGY1YTAxZjMuLjRhMTlhMTMgMTAwNjQ0Ci0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9CdW5kbGUvc3JjL0xWTV9Qcm9jZXNzLmMKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0J1bmRsZS9zcmMvTFZNX1Byb2Nlc3MuYwpAQCAtNTEsNyArNTEsMjMxIEBACiAvKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQlVJTERfRkxPQVQKK0xWTV9SZXR1cm5TdGF0dXNfZW4gTFZNX1Byb2Nlc3MoTFZNX0hhbmRsZV90ICAgICAgICAgICAgICAgIGhJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICAgICAgICAgICAgICpwSW5EYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAgICAgKnBPdXREYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICAgICAgTnVtU2FtcGxlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQzMiAgICAgICAgICAgICAgICAgIEF1ZGlvVGltZSkKK3sKIAorICAgIExWTV9JbnN0YW5jZV90ICAgICAgKnBJbnN0YW5jZSAgPSAoTFZNX0luc3RhbmNlX3QgICopaEluc3RhbmNlOworICAgIExWTV9VSU5UMTYgICAgICAgICAgU2FtcGxlQ291bnQgPSBOdW1TYW1wbGVzOworICAgIExWTV9GTE9BVCAgICAgICAgICAgKnBJbnB1dCAgICAgPSAoTFZNX0ZMT0FUICopcEluRGF0YTsKKyAgICBMVk1fRkxPQVQgICAgICAgICAgICpwVG9Qcm9jZXNzID0gKExWTV9GTE9BVCAqKXBJbkRhdGE7CisgICAgTFZNX0ZMT0FUICAgICAgICAgICAqcFByb2Nlc3NlZCA9IHBPdXREYXRhOworICAgIExWTV9SZXR1cm5TdGF0dXNfZW4gIFN0YXR1czsKKworICAgIC8qCisgICAgICogQ2hlY2sgaWYgdGhlIG51bWJlciBvZiBzYW1wbGVzIGlzIHplcm8KKyAgICAgKi8KKyAgICBpZiAoTnVtU2FtcGxlcyA9PSAwKQorICAgIHsKKyAgICAgICAgcmV0dXJuKExWTV9TVUNDRVNTKTsKKyAgICB9CisKKworICAgIC8qCisgICAgICogQ2hlY2sgdmFsaWQgcG9pbnRzIGhhdmUgYmVlbiBnaXZlbgorICAgICAqLworICAgIGlmICgoaEluc3RhbmNlID09IExWTV9OVUxMKSB8fCAocEluRGF0YSA9PSBMVk1fTlVMTCkgfHwgKHBPdXREYXRhID09IExWTV9OVUxMKSkKKyAgICB7CisgICAgICAgIHJldHVybiAoTFZNX05VTExBRERSRVNTKTsKKyAgICB9CisKKyAgICAvKgorICAgICAqIEZvciB1bm1hbmFnZWQgbW9kZSBvbmx5CisgICAgICovCisgICAgaWYocEluc3RhbmNlLT5JbnN0UGFyYW1zLkJ1ZmZlck1vZGUgPT0gTFZNX1VOTUFOQUdFRF9CVUZGRVJTKQorICAgIHsKKyAgICAgICAgIC8qCisgICAgICAgICAqIENoZWNrIGlmIHRoZSBudW1iZXIgb2Ygc2FtcGxlcyBpcyBhIGdvb2QgbXVsdGlwbGUgKHVubWFuYWdlZCBtb2RlIG9ubHkpCisgICAgICAgICAqLworICAgICAgICBpZigoTnVtU2FtcGxlcyAlIHBJbnN0YW5jZS0+QmxpY2tTaXplTXVsdGlwbGUpICE9IDApCisgICAgICAgIHsKKyAgICAgICAgICAgIHJldHVybihMVk1fSU5WQUxJRE5VTVNBTVBMRVMpOworICAgICAgICB9CisKKyAgICAgICAgLyoKKyAgICAgICAgICogQ2hlY2sgdGhlIGJ1ZmZlciBhbGlnbm1lbnQKKyAgICAgICAgICovCisgICAgICAgIGlmKCgoKHVpbnRwdHJfdClwSW5EYXRhICUgNCkgIT0gMCkgfHwgKCgodWludHB0cl90KXBPdXREYXRhICUgNCkgIT0gMCkpCisgICAgICAgIHsKKyAgICAgICAgICAgIHJldHVybihMVk1fQUxJR05NRU5URVJST1IpOworICAgICAgICB9CisgICAgfQorCisKKyAgICAvKgorICAgICAqIFVwZGF0ZSBuZXcgcGFyYW1ldGVycyBpZiBuZWNlc3NhcnkKKyAgICAgKi8KKyAgICBpZiAocEluc3RhbmNlLT5Db250cm9sUGVuZGluZyA9PSBMVk1fVFJVRSkKKyAgICB7CisgICAgICAgIFN0YXR1cyA9IExWTV9BcHBseU5ld1NldHRpbmdzKGhJbnN0YW5jZSk7CisKKyAgICAgICAgaWYoU3RhdHVzICE9IExWTV9TVUNDRVNTKQorICAgICAgICB7CisgICAgICAgICAgICByZXR1cm4gU3RhdHVzOworICAgICAgICB9CisgICAgfQorCisKKyAgICAvKgorICAgICAqIENvbnZlcnQgZnJvbSBNb25vIGlmIG5lY2Vzc2FyeQorICAgICAqLworICAgIGlmIChwSW5zdGFuY2UtPlBhcmFtcy5Tb3VyY2VGb3JtYXQgPT0gTFZNX01PTk8pCisgICAgeworICAgICAgICBNb25vVG8ySV9GbG9hdChwSW5EYXRhLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogU291cmNlICovCisgICAgICAgICAgICAgICAgICAgICAgIHBPdXREYXRhLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBEZXN0aW5hdGlvbiAqLworICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOyAgICAgICAgICAgICAgICAgLyogTnVtYmVyIG9mIGlucHV0IHNhbXBsZXMgKi8KKyAgICAgICAgcElucHV0ICAgICA9IHBPdXREYXRhOworICAgICAgICBwVG9Qcm9jZXNzID0gcE91dERhdGE7CisgICAgfQorCisKKyAgICAvKgorICAgICAqIFByb2Nlc3MgdGhlIGRhdGEgd2l0aCBtYW5hZ2VkIGJ1ZmZlcnMKKyAgICAgKi8KKyAgICB3aGlsZSAoU2FtcGxlQ291bnQgIT0gMCkKKyAgICB7CisgICAgICAgIC8qCisgICAgICAgICAqIE1hbmFnZSB0aGUgaW5wdXQgYnVmZmVyIGFuZCBmcmFtZSBwcm9jZXNzaW5nCisgICAgICAgICAqLworICAgICAgICBMVk1fQnVmZmVySW4oaEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgcElucHV0LAorICAgICAgICAgICAgICAgICAgICAgJnBUb1Byb2Nlc3MsCisgICAgICAgICAgICAgICAgICAgICAmcFByb2Nlc3NlZCwKKyAgICAgICAgICAgICAgICAgICAgICZTYW1wbGVDb3VudCk7CisKKyAgICAgICAgLyoKKyAgICAgICAgICogT25seSBwcm9jZXNzIGRhdGEgd2hlbiBTYW1wbGVDb3VudCBpcyBub25lIHplcm8sIGEgemVybyBjb3VudCBjYW4gb2NjdXIgd2hlbgorICAgICAgICAgKiB0aGUgQnVmZmVySW4gcm91dGluZSBpcyB3b3JraW5nIGluIG1hbmFnZWQgbW9kZS4KKyAgICAgICAgICovCisgICAgICAgIGlmIChTYW1wbGVDb3VudCAhPSAwKQorICAgICAgICB7CisKKyAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgKiBBcHBseSBDb25jZXJ0U291bmQgaWYgcmVxdWlyZWQKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgaWYgKHBJbnN0YW5jZS0+Q1NfQWN0aXZlID09IExWTV9UUlVFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICh2b2lkKUxWQ1NfUHJvY2VzcyhwSW5zdGFuY2UtPmhDU0luc3RhbmNlLCAgICAgLyogQ29uY2VydCBTb3VuZCBpbnN0YW5jZSBoYW5kbGUgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRvUHJvY2VzcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFByb2Nlc3NlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2FtcGxlQ291bnQpOworICAgICAgICAgICAgICAgIHBUb1Byb2Nlc3MgPSBwUHJvY2Vzc2VkOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogQXBwbHkgdm9sdW1lIGlmIHJlcXVpcmVkCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGlmIChwSW5zdGFuY2UtPlZDX0FjdGl2ZSE9MCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBMVkNfTWl4U29mdF8xU3RfRDE2QzMxX1NBVCgmcEluc3RhbmNlLT5WQ19Wb2x1bWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVG9Qcm9jZXNzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFByb2Nlc3NlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpKDIgKiBTYW1wbGVDb3VudCkpOyAgICAgLyogTGVmdCBhbmQgcmlnaHQqLworICAgICAgICAgICAgICAgIHBUb1Byb2Nlc3MgPSBwUHJvY2Vzc2VkOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogQ2FsbCBOLUJhbmQgZXF1YWxpc2VyIGlmIGVuYWJsZWQKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgaWYgKHBJbnN0YW5jZS0+RVFOQl9BY3RpdmUgPT0gTFZNX1RSVUUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgTFZFUU5CX1Byb2Nlc3MocEluc3RhbmNlLT5oRVFOQkluc3RhbmNlLCAgICAvKiBOLUJhbmQgZXF1YWxpc2VyIGluc3RhbmNlIGhhbmRsZSAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUb1Byb2Nlc3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFByb2Nlc3NlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTYW1wbGVDb3VudCk7CisgICAgICAgICAgICAgICAgcFRvUHJvY2VzcyA9IHBQcm9jZXNzZWQ7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgKiBDYWxsIGJhc3MgZW5oYW5jZW1lbnQgaWYgZW5hYmxlZAorICAgICAgICAgICAgICovCisgICAgICAgICAgICBpZiAocEluc3RhbmNlLT5EQkVfQWN0aXZlID09IExWTV9UUlVFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIExWREJFX1Byb2Nlc3MocEluc3RhbmNlLT5oREJFSW5zdGFuY2UsICAgICAgIC8qIER5bmFtaWMgQmFzcyBFbmhhbmNlbWVudCBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5zdGFuY2UgaGFuZGxlICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVG9Qcm9jZXNzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFByb2Nlc3NlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNhbXBsZUNvdW50KTsKKyAgICAgICAgICAgICAgICBwVG9Qcm9jZXNzID0gcFByb2Nlc3NlZDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAqIEJ5cGFzcyBtb2RlIG9yIGV2ZXJ5dGhpbmcgb2ZmLCBzbyBjb3B5IHRoZSBpbnB1dCB0byB0aGUgb3V0cHV0CisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGlmIChwVG9Qcm9jZXNzICE9IHBQcm9jZXNzZWQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgQ29weV9GbG9hdChwVG9Qcm9jZXNzLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogU291cmNlICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwUHJvY2Vzc2VkLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRGVzdGluYXRpb24gKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpKDIgKiBTYW1wbGVDb3VudCkpOyAgICAgICAgICAvKiBMZWZ0IGFuZCByaWdodCAqLworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogQXBwbHkgdHJlYmxlIGJvb3N0IGlmIHJlcXVpcmVkCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGlmIChwSW5zdGFuY2UtPlRFX0FjdGl2ZSA9PSBMVk1fVFJVRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAqIEFwcGx5IHRoZSBmaWx0ZXIKKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBGT18ySV9EMTZGMzJDMTVfTFNoeF9UUkNfV1JBXzAxKCZwSW5zdGFuY2UtPnBURV9TdGF0ZS0+VHJlYmxlQm9vc3RfU3RhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFByb2Nlc3NlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUHJvY2Vzc2VkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpU2FtcGxlQ291bnQpOworCisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgKiBWb2x1bWUgYmFsYW5jZQorICAgICAgICAgICAgICovCisgICAgICAgICAgICBMVkNfTWl4U29mdF8xU3RfMmlfRDE2QzMxX1NBVCgmcEluc3RhbmNlLT5WQ19CYWxhbmNlTWl4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUHJvY2Vzc2VkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUHJvY2Vzc2VkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTYW1wbGVDb3VudCk7CisKKyAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgKiBQZXJmb3JtIFBhcmFtZXRyaWMgU3BlY3R1bSBBbmFseXNpcworICAgICAgICAgICAgICovCisgICAgICAgICAgICBpZiAoKHBJbnN0YW5jZS0+UGFyYW1zLlBTQV9FbmFibGUgPT0gTFZNX1BTQV9PTikgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBJbnN0YW5jZS0+SW5zdFBhcmFtcy5QU0FfSW5jbHVkZWQgPT0gTFZNX1BTQV9PTikpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZyb20yaVRvTW9ub19GbG9hdChwUHJvY2Vzc2VkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEluc3RhbmNlLT5wUFNBSW5wdXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KShTYW1wbGVDb3VudCkpOworCisgICAgICAgICAgICAgICAgICAgIExWUFNBX1Byb2Nlc3MocEluc3RhbmNlLT5oUFNBSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEluc3RhbmNlLT5wUFNBSW5wdXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9VSU5UMTYpKFNhbXBsZUNvdW50KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBdWRpb1RpbWUpOworICAgICAgICAgICAgfQorCisKKyAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgKiBEQyByZW1vdmFsCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIERDXzJJX0QxNl9UUkNfV1JBXzAxKCZwSW5zdGFuY2UtPkRDX1JlbW92YWxJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBQcm9jZXNzZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUHJvY2Vzc2VkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNilTYW1wbGVDb3VudCk7CisKKworICAgICAgICB9CisKKyAgICAgICAgLyoKKyAgICAgICAgICogTWFuYWdlIHRoZSBvdXRwdXQgYnVmZmVyCisgICAgICAgICAqLworICAgICAgICBMVk1fQnVmZmVyT3V0KGhJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICBwT3V0RGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAmU2FtcGxlQ291bnQpOworCisgICAgfQorCisgICAgcmV0dXJuKExWTV9TVUNDRVNTKTsKK30KKyNlbHNlCiBMVk1fUmV0dXJuU3RhdHVzX2VuIExWTV9Qcm9jZXNzKExWTV9IYW5kbGVfdCAgICAgICAgICAgICAgICBoSW5zdGFuY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiAgICAgICAgICAgICAqcEluRGF0YSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICpwT3V0RGF0YSwKQEAgLTI3MywzICs0OTcsNCBAQAogCiAgICAgcmV0dXJuKExWTV9TVUNDRVNTKTsKIH0KKyNlbmRpZgpcIE5vIG5ld2xpbmUgYXQgZW5kIG9mIGZpbGUKZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9CdW5kbGUvc3JjL0xWTV9UYWJsZXMuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9CdW5kbGUvc3JjL0xWTV9UYWJsZXMuYwppbmRleCBlMTRmOTA5Li4xOTlkZGRlIDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQnVuZGxlL3NyYy9MVk1fVGFibGVzLmMKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0J1bmRsZS9zcmMvTFZNX1RhYmxlcy5jCkBAIC0yOSw3ICsyOSwzNDIgQEAKIC8qICAgIFRyZWJsZSBCb29zdCBGaWx0ZXIgQ29lZmZpY2llbnRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZmRlZiBCVUlMRF9GTE9BVAogCitGT19GTE9BVF9MU2h4X0NvZWZzX3QgICAgTFZNX1RyZWJsZUJvb3N0Q29lZnNbXSA9IHsKKworICAgICAgICAgICAgICAgICAgICAvKiAyMmtIeiBzYW1wbGluZyByYXRlICovCisgICAgICAgICAgICAgICAgICAgIHtIUEZfRnMyMjA1MF9HYWluMV9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDEgKi8KKyAgICAgICAgICAgICAgICAgICAgIEhQRl9GczIyMDUwX0dhaW4xX0EwLAorICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczIyMDUwX0dhaW4xX0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9GczIyMDUwX0dhaW4yX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMiAqLworICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMjIwNTBfR2FpbjJfQTAsCisgICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMjIwNTBfR2FpbjJfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMjIwNTBfR2FpbjNfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyAzICovCisgICAgICAgICAgICAgICAgICAgICBIUEZfRnMyMjA1MF9HYWluM19BMCwKKyAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMyMjA1MF9HYWluM19CMX0sCisgICAgICAgICAgICAgICAgICAgIHtIUEZfRnMyMjA1MF9HYWluNF9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDQgKi8KKyAgICAgICAgICAgICAgICAgICAgIEhQRl9GczIyMDUwX0dhaW40X0EwLAorICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczIyMDUwX0dhaW40X0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9GczIyMDUwX0dhaW41X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgNSAqLworICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMjIwNTBfR2FpbjVfQTAsCisgICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMjIwNTBfR2FpbjVfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMjIwNTBfR2FpbjZfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyA2ICovCisgICAgICAgICAgICAgICAgICAgICBIUEZfRnMyMjA1MF9HYWluNl9BMCwKKyAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMyMjA1MF9HYWluNl9CMX0sCisgICAgICAgICAgICAgICAgICAgIHtIUEZfRnMyMjA1MF9HYWluN19BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDcgKi8KKyAgICAgICAgICAgICAgICAgICAgIEhQRl9GczIyMDUwX0dhaW43X0EwLAorICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczIyMDUwX0dhaW43X0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9GczIyMDUwX0dhaW44X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgOCAqLworICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMjIwNTBfR2FpbjhfQTAsCisgICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMjIwNTBfR2FpbjhfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMjIwNTBfR2FpbjlfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyA5ICovCisgICAgICAgICAgICAgICAgICAgICBIUEZfRnMyMjA1MF9HYWluOV9BMCwKKyAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMyMjA1MF9HYWluOV9CMX0sCisgICAgICAgICAgICAgICAgICAgIHtIUEZfRnMyMjA1MF9HYWluMTBfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyAxMCAqLworICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMjIwNTBfR2FpbjEwX0EwLAorICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczIyMDUwX0dhaW4xMF9CMX0sCisgICAgICAgICAgICAgICAgICAgIHtIUEZfRnMyMjA1MF9HYWluMTFfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyAxMSAqLworICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMjIwNTBfR2FpbjExX0EwLAorICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczIyMDUwX0dhaW4xMV9CMX0sCisgICAgICAgICAgICAgICAgICAgIHtIUEZfRnMyMjA1MF9HYWluMTJfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyAxMiAqLworICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMjIwNTBfR2FpbjEyX0EwLAorICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczIyMDUwX0dhaW4xMl9CMX0sCisgICAgICAgICAgICAgICAgICAgIHtIUEZfRnMyMjA1MF9HYWluMTNfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyAxMyAqLworICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMjIwNTBfR2FpbjEzX0EwLAorICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczIyMDUwX0dhaW4xM19CMX0sCisgICAgICAgICAgICAgICAgICAgIHtIUEZfRnMyMjA1MF9HYWluMTRfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyAxNCAqLworICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMjIwNTBfR2FpbjE0X0EwLAorICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczIyMDUwX0dhaW4xNF9CMX0sCisgICAgICAgICAgICAgICAgICAgIHtIUEZfRnMyMjA1MF9HYWluMTVfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyAxNSAqLworICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMjIwNTBfR2FpbjE1X0EwLAorICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczIyMDUwX0dhaW4xNV9CMX0sCisKKyAgICAgICAgICAgICAgICAgICAgLyogMjRrSHogc2FtcGxpbmcgcmF0ZSAqLworICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMjQwMDBfR2FpbjFfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyAxICovCisgICAgICAgICAgICAgICAgICAgICBIUEZfRnMyNDAwMF9HYWluMV9BMCwKKyAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMyNDAwMF9HYWluMV9CMX0sCisgICAgICAgICAgICAgICAgICAgIHtIUEZfRnMyNDAwMF9HYWluMl9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDIgKi8KKyAgICAgICAgICAgICAgICAgICAgIEhQRl9GczI0MDAwX0dhaW4yX0EwLAorICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczI0MDAwX0dhaW4yX0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9GczI0MDAwX0dhaW4zX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMyAqLworICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMjQwMDBfR2FpbjNfQTAsCisgICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMjQwMDBfR2FpbjNfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMjQwMDBfR2FpbjRfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyA0ICovCisgICAgICAgICAgICAgICAgICAgICBIUEZfRnMyNDAwMF9HYWluNF9BMCwKKyAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMyNDAwMF9HYWluNF9CMX0sCisgICAgICAgICAgICAgICAgICAgIHtIUEZfRnMyNDAwMF9HYWluNV9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDUgKi8KKyAgICAgICAgICAgICAgICAgICAgIEhQRl9GczI0MDAwX0dhaW41X0EwLAorICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczI0MDAwX0dhaW41X0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9GczI0MDAwX0dhaW42X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgNiAqLworICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMjQwMDBfR2FpbjZfQTAsCisgICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMjQwMDBfR2FpbjZfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMjQwMDBfR2FpbjdfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyA3ICovCisgICAgICAgICAgICAgICAgICAgICBIUEZfRnMyNDAwMF9HYWluN19BMCwKKyAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMyNDAwMF9HYWluN19CMX0sCisgICAgICAgICAgICAgICAgICAgIHtIUEZfRnMyNDAwMF9HYWluOF9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDggKi8KKyAgICAgICAgICAgICAgICAgICAgIEhQRl9GczI0MDAwX0dhaW44X0EwLAorICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczI0MDAwX0dhaW44X0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9GczI0MDAwX0dhaW45X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgOSAqLworICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMjQwMDBfR2FpbjlfQTAsCisgICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMjQwMDBfR2FpbjlfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMjQwMDBfR2FpbjEwX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTAgKi8KKyAgICAgICAgICAgICAgICAgICAgIEhQRl9GczI0MDAwX0dhaW4xMF9BMCwKKyAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMyNDAwMF9HYWluMTBfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMjQwMDBfR2FpbjExX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTEgKi8KKyAgICAgICAgICAgICAgICAgICAgIEhQRl9GczI0MDAwX0dhaW4xMV9BMCwKKyAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMyNDAwMF9HYWluMTFfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMjQwMDBfR2FpbjEyX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTIgKi8KKyAgICAgICAgICAgICAgICAgICAgIEhQRl9GczI0MDAwX0dhaW4xMl9BMCwKKyAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMyNDAwMF9HYWluMTJfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMjQwMDBfR2FpbjEzX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTMgKi8KKyAgICAgICAgICAgICAgICAgICAgIEhQRl9GczI0MDAwX0dhaW4xM19BMCwKKyAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMyNDAwMF9HYWluMTNfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMjQwMDBfR2FpbjE0X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTQgKi8KKyAgICAgICAgICAgICAgICAgICAgIEhQRl9GczI0MDAwX0dhaW4xNF9BMCwKKyAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMyNDAwMF9HYWluMTRfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMjQwMDBfR2FpbjE1X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTUgKi8KKyAgICAgICAgICAgICAgICAgICAgIEhQRl9GczI0MDAwX0dhaW4xNV9BMCwKKyAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMyNDAwMF9HYWluMTVfQjF9LAorCisgICAgICAgICAgICAgICAgICAgIC8qIDMya0h6IHNhbXBsaW5nIHJhdGUgKi8KKyAgICAgICAgICAgICAgICAgICAge0hQRl9GczMyMDAwX0dhaW4xX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMSAqLworICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMzIwMDBfR2FpbjFfQTAsCisgICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMzIwMDBfR2FpbjFfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMzIwMDBfR2FpbjJfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyAyICovCisgICAgICAgICAgICAgICAgICAgICBIUEZfRnMzMjAwMF9HYWluMl9BMCwKKyAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMzMjAwMF9HYWluMl9CMX0sCisgICAgICAgICAgICAgICAgICAgIHtIUEZfRnMzMjAwMF9HYWluM19BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDMgKi8KKyAgICAgICAgICAgICAgICAgICAgIEhQRl9GczMyMDAwX0dhaW4zX0EwLAorICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczMyMDAwX0dhaW4zX0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9GczMyMDAwX0dhaW40X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgNCAqLworICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMzIwMDBfR2FpbjRfQTAsCisgICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMzIwMDBfR2FpbjRfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMzIwMDBfR2FpbjVfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyA1ICovCisgICAgICAgICAgICAgICAgICAgICBIUEZfRnMzMjAwMF9HYWluNV9BMCwKKyAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMzMjAwMF9HYWluNV9CMX0sCisgICAgICAgICAgICAgICAgICAgIHtIUEZfRnMzMjAwMF9HYWluNl9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDYgKi8KKyAgICAgICAgICAgICAgICAgICAgIEhQRl9GczMyMDAwX0dhaW42X0EwLAorICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczMyMDAwX0dhaW42X0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9GczMyMDAwX0dhaW43X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgNyAqLworICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMzIwMDBfR2FpbjdfQTAsCisgICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMzIwMDBfR2FpbjdfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMzIwMDBfR2FpbjhfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyA4ICovCisgICAgICAgICAgICAgICAgICAgICBIUEZfRnMzMjAwMF9HYWluOF9BMCwKKyAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMzMjAwMF9HYWluOF9CMX0sCisgICAgICAgICAgICAgICAgICAgIHtIUEZfRnMzMjAwMF9HYWluOV9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDkgKi8KKyAgICAgICAgICAgICAgICAgICAgIEhQRl9GczMyMDAwX0dhaW45X0EwLAorICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczMyMDAwX0dhaW45X0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9GczMyMDAwX0dhaW4xMF9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDEwICovCisgICAgICAgICAgICAgICAgICAgICBIUEZfRnMzMjAwMF9HYWluMTBfQTAsCisgICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMzIwMDBfR2FpbjEwX0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9GczMyMDAwX0dhaW4xMV9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDExICovCisgICAgICAgICAgICAgICAgICAgICBIUEZfRnMzMjAwMF9HYWluMTFfQTAsCisgICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMzIwMDBfR2FpbjExX0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9GczMyMDAwX0dhaW4xMl9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDEyICovCisgICAgICAgICAgICAgICAgICAgICBIUEZfRnMzMjAwMF9HYWluMTJfQTAsCisgICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMzIwMDBfR2FpbjEyX0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9GczMyMDAwX0dhaW4xM19BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDEzICovCisgICAgICAgICAgICAgICAgICAgICBIUEZfRnMzMjAwMF9HYWluMTNfQTAsCisgICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMzIwMDBfR2FpbjEzX0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9GczMyMDAwX0dhaW4xNF9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDE0ICovCisgICAgICAgICAgICAgICAgICAgICBIUEZfRnMzMjAwMF9HYWluMTRfQTAsCisgICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMzIwMDBfR2FpbjE0X0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9GczMyMDAwX0dhaW4xNV9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDE1ICovCisgICAgICAgICAgICAgICAgICAgICBIUEZfRnMzMjAwMF9HYWluMTVfQTAsCisgICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMzIwMDBfR2FpbjE1X0IxfSwKKworICAgICAgICAgICAgICAgICAgICAvKiA0NGtIeiBzYW1wbGluZyByYXRlICovCisgICAgICAgICAgICAgICAgICAgIHtIUEZfRnM0NDEwMF9HYWluMV9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDEgKi8KKyAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ0MTAwX0dhaW4xX0EwLAorICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczQ0MTAwX0dhaW4xX0IxLH0sCisgICAgICAgICAgICAgICAgICAgIHtIUEZfRnM0NDEwMF9HYWluMl9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDIgKi8KKyAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ0MTAwX0dhaW4yX0EwLAorICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczQ0MTAwX0dhaW4yX0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9GczQ0MTAwX0dhaW4zX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMyAqLworICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzNDQxMDBfR2FpbjNfQTAsCisgICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzNDQxMDBfR2FpbjNfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzNDQxMDBfR2FpbjRfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyA0ICovCisgICAgICAgICAgICAgICAgICAgICBIUEZfRnM0NDEwMF9HYWluNF9BMCwKKyAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnM0NDEwMF9HYWluNF9CMX0sCisgICAgICAgICAgICAgICAgICAgIHtIUEZfRnM0NDEwMF9HYWluNV9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDUgKi8KKyAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ0MTAwX0dhaW41X0EwLAorICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczQ0MTAwX0dhaW41X0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9GczQ0MTAwX0dhaW42X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgNiAqLworICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzNDQxMDBfR2FpbjZfQTAsCisgICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzNDQxMDBfR2FpbjZfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzNDQxMDBfR2FpbjdfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyA3ICovCisgICAgICAgICAgICAgICAgICAgICBIUEZfRnM0NDEwMF9HYWluN19BMCwKKyAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnM0NDEwMF9HYWluN19CMX0sCisgICAgICAgICAgICAgICAgICAgIHtIUEZfRnM0NDEwMF9HYWluOF9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDggKi8KKyAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ0MTAwX0dhaW44X0EwLAorICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczQ0MTAwX0dhaW44X0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9GczQ0MTAwX0dhaW45X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgOSAqLworICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzNDQxMDBfR2FpbjlfQTAsCisgICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzNDQxMDBfR2FpbjlfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzNDQxMDBfR2FpbjEwX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTAgKi8KKyAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ0MTAwX0dhaW4xMF9BMCwKKyAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnM0NDEwMF9HYWluMTBfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzNDQxMDBfR2FpbjExX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTEgKi8KKyAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ0MTAwX0dhaW4xMV9BMCwKKyAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnM0NDEwMF9HYWluMTFfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzNDQxMDBfR2FpbjEyX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTIgKi8KKyAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ0MTAwX0dhaW4xMl9BMCwKKyAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnM0NDEwMF9HYWluMTJfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzNDQxMDBfR2FpbjEzX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTMgKi8KKyAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ0MTAwX0dhaW4xM19BMCwKKyAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnM0NDEwMF9HYWluMTNfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzNDQxMDBfR2FpbjE0X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTQgKi8KKyAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ0MTAwX0dhaW4xNF9BMCwKKyAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnM0NDEwMF9HYWluMTRfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzNDQxMDBfR2FpbjE1X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTUgKi8KKyAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ0MTAwX0dhaW4xNV9BMCwKKyAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnM0NDEwMF9HYWluMTVfQjF9LAorCisgICAgICAgICAgICAgICAgICAgIC8qIDQ4a0h6IHNhbXBsaW5nIHJhdGUgKi8KKyAgICAgICAgICAgICAgICAgICAge0hQRl9GczQ4MDAwX0dhaW4xX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMSAqLworICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzNDgwMDBfR2FpbjFfQTAsCisgICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzNDgwMDBfR2FpbjFfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzNDgwMDBfR2FpbjJfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyAyICovCisgICAgICAgICAgICAgICAgICAgICBIUEZfRnM0ODAwMF9HYWluMl9BMCwKKyAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnM0ODAwMF9HYWluMl9CMX0sCisgICAgICAgICAgICAgICAgICAgIHtIUEZfRnM0ODAwMF9HYWluM19BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDMgKi8KKyAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ4MDAwX0dhaW4zX0EwLAorICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczQ4MDAwX0dhaW4zX0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9GczQ4MDAwX0dhaW40X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgNCAqLworICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzNDgwMDBfR2FpbjRfQTAsCisgICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzNDgwMDBfR2FpbjRfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzNDgwMDBfR2FpbjVfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyA1ICovCisgICAgICAgICAgICAgICAgICAgICBIUEZfRnM0ODAwMF9HYWluNV9BMCwKKyAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnM0ODAwMF9HYWluNV9CMX0sCisgICAgICAgICAgICAgICAgICAgIHtIUEZfRnM0ODAwMF9HYWluNl9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDYgKi8KKyAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ4MDAwX0dhaW42X0EwLAorICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczQ4MDAwX0dhaW42X0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9GczQ4MDAwX0dhaW43X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgNyAqLworICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzNDgwMDBfR2FpbjdfQTAsCisgICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzNDgwMDBfR2FpbjdfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzNDgwMDBfR2FpbjhfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyA4ICovCisgICAgICAgICAgICAgICAgICAgICBIUEZfRnM0ODAwMF9HYWluOF9BMCwKKyAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnM0ODAwMF9HYWluOF9CMX0sCisgICAgICAgICAgICAgICAgICAgIHtIUEZfRnM0ODAwMF9HYWluOV9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDkgKi8KKyAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ4MDAwX0dhaW45X0EwLAorICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczQ4MDAwX0dhaW45X0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9GczQ4MDAwX0dhaW4xMF9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDEwICovCisgICAgICAgICAgICAgICAgICAgICBIUEZfRnM0ODAwMF9HYWluMTBfQTAsCisgICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzNDgwMDBfR2FpbjEwX0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9GczQ4MDAwX0dhaW4xMV9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDExICovCisgICAgICAgICAgICAgICAgICAgICBIUEZfRnM0ODAwMF9HYWluMTFfQTAsCisgICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzNDgwMDBfR2FpbjExX0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9GczQ4MDAwX0dhaW4xMl9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDEyICovCisgICAgICAgICAgICAgICAgICAgICBIUEZfRnM0ODAwMF9HYWluMTJfQTAsCisgICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzNDgwMDBfR2FpbjEyX0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9GczQ4MDAwX0dhaW4xM19BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDEzICovCisgICAgICAgICAgICAgICAgICAgICBIUEZfRnM0ODAwMF9HYWluMTNfQTAsCisgICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzNDgwMDBfR2FpbjEzX0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9GczQ4MDAwX0dhaW4xNF9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDE0ICovCisgICAgICAgICAgICAgICAgICAgICBIUEZfRnM0ODAwMF9HYWluMTRfQTAsCisgICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzNDgwMDBfR2FpbjE0X0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9GczQ4MDAwX0dhaW4xNV9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDE1ICovCisgICAgICAgICAgICAgICAgICAgICBIUEZfRnM0ODAwMF9HYWluMTVfQTAsCisgICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzNDgwMDBfR2FpbjE1X0IxfQorI2lmZGVmIEhJR0hFUl9GUworICAgICAgICAgICAgICAgICAgICAsCisgICAgICAgICAgICAgICAgICAgIC8qIDk2a0h6IHNhbXBsaW5nIHJhdGUgKi8KKyAgICAgICAgICAgICAgICAgICAge0hQRl9Gczk2MDAwX0dhaW4xX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMSAqLworICAgICAgICAgICAgICAgICAgICBIUEZfRnM5NjAwMF9HYWluMV9BMCwKKyAgICAgICAgICAgICAgICAgICAgLUhQRl9Gczk2MDAwX0dhaW4xX0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9Gczk2MDAwX0dhaW4yX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMiAqLworICAgICAgICAgICAgICAgICAgICBIUEZfRnM5NjAwMF9HYWluMl9BMCwKKyAgICAgICAgICAgICAgICAgICAgLUhQRl9Gczk2MDAwX0dhaW4yX0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9Gczk2MDAwX0dhaW4zX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMyAqLworICAgICAgICAgICAgICAgICAgICBIUEZfRnM5NjAwMF9HYWluM19BMCwKKyAgICAgICAgICAgICAgICAgICAgLUhQRl9Gczk2MDAwX0dhaW4zX0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9Gczk2MDAwX0dhaW40X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgNCAqLworICAgICAgICAgICAgICAgICAgICBIUEZfRnM5NjAwMF9HYWluNF9BMCwKKyAgICAgICAgICAgICAgICAgICAgLUhQRl9Gczk2MDAwX0dhaW40X0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9Gczk2MDAwX0dhaW41X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgNSAqLworICAgICAgICAgICAgICAgICAgICBIUEZfRnM5NjAwMF9HYWluNV9BMCwKKyAgICAgICAgICAgICAgICAgICAgLUhQRl9Gczk2MDAwX0dhaW41X0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9Gczk2MDAwX0dhaW42X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgNiAqLworICAgICAgICAgICAgICAgICAgICBIUEZfRnM5NjAwMF9HYWluNl9BMCwKKyAgICAgICAgICAgICAgICAgICAgLUhQRl9Gczk2MDAwX0dhaW42X0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9Gczk2MDAwX0dhaW43X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgNyAqLworICAgICAgICAgICAgICAgICAgICBIUEZfRnM5NjAwMF9HYWluN19BMCwKKyAgICAgICAgICAgICAgICAgICAgLUhQRl9Gczk2MDAwX0dhaW43X0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9Gczk2MDAwX0dhaW44X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgOCAqLworICAgICAgICAgICAgICAgICAgICBIUEZfRnM5NjAwMF9HYWluOF9BMCwKKyAgICAgICAgICAgICAgICAgICAgLUhQRl9Gczk2MDAwX0dhaW44X0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9Gczk2MDAwX0dhaW45X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgOSAqLworICAgICAgICAgICAgICAgICAgICBIUEZfRnM5NjAwMF9HYWluOV9BMCwKKyAgICAgICAgICAgICAgICAgICAgLUhQRl9Gczk2MDAwX0dhaW45X0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9Gczk2MDAwX0dhaW4xMF9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDEwICovCisgICAgICAgICAgICAgICAgICAgIEhQRl9Gczk2MDAwX0dhaW4xMF9BMCwKKyAgICAgICAgICAgICAgICAgICAgLUhQRl9Gczk2MDAwX0dhaW4xMF9CMX0sCisgICAgICAgICAgICAgICAgICAgIHtIUEZfRnM5NjAwMF9HYWluMTFfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyAxMSAqLworICAgICAgICAgICAgICAgICAgICBIUEZfRnM5NjAwMF9HYWluMTFfQTAsCisgICAgICAgICAgICAgICAgICAgIC1IUEZfRnM5NjAwMF9HYWluMTFfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzOTYwMDBfR2FpbjEyX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTIgKi8KKyAgICAgICAgICAgICAgICAgICAgSFBGX0ZzOTYwMDBfR2FpbjEyX0EwLAorICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzOTYwMDBfR2FpbjEyX0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9Gczk2MDAwX0dhaW4xM19BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDEzICovCisgICAgICAgICAgICAgICAgICAgIEhQRl9Gczk2MDAwX0dhaW4xM19BMCwKKyAgICAgICAgICAgICAgICAgICAgLUhQRl9Gczk2MDAwX0dhaW4xM19CMX0sCisgICAgICAgICAgICAgICAgICAgIHtIUEZfRnM5NjAwMF9HYWluMTRfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyAxNCAqLworICAgICAgICAgICAgICAgICAgICBIUEZfRnM5NjAwMF9HYWluMTRfQTAsCisgICAgICAgICAgICAgICAgICAgIC1IUEZfRnM5NjAwMF9HYWluMTRfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzOTYwMDBfR2FpbjE1X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTUgKi8KKyAgICAgICAgICAgICAgICAgICAgSFBGX0ZzOTYwMDBfR2FpbjE1X0EwLAorICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzOTYwMDBfR2FpbjE1X0IxfSwKKworICAgICAgICAgICAgICAgICAgICAvKiAxOTJrSHogc2FtcGxpbmcgcmF0ZSAqLworICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMTkyMDAwX0dhaW4xX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMSAqLworICAgICAgICAgICAgICAgICAgICBIUEZfRnMxOTIwMDBfR2FpbjFfQTAsCisgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMxOTIwMDBfR2FpbjFfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMTkyMDAwX0dhaW4yX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMiAqLworICAgICAgICAgICAgICAgICAgICBIUEZfRnMxOTIwMDBfR2FpbjJfQTAsCisgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMxOTIwMDBfR2FpbjJfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMTkyMDAwX0dhaW4zX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMyAqLworICAgICAgICAgICAgICAgICAgICBIUEZfRnMxOTIwMDBfR2FpbjNfQTAsCisgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMxOTIwMDBfR2FpbjNfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMTkyMDAwX0dhaW40X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgNCAqLworICAgICAgICAgICAgICAgICAgICBIUEZfRnMxOTIwMDBfR2FpbjRfQTAsCisgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMxOTIwMDBfR2FpbjRfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMTkyMDAwX0dhaW41X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgNSAqLworICAgICAgICAgICAgICAgICAgICBIUEZfRnMxOTIwMDBfR2FpbjVfQTAsCisgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMxOTIwMDBfR2FpbjVfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMTkyMDAwX0dhaW42X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgNiAqLworICAgICAgICAgICAgICAgICAgICBIUEZfRnMxOTIwMDBfR2FpbjZfQTAsCisgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMxOTIwMDBfR2FpbjZfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMTkyMDAwX0dhaW43X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgNyAqLworICAgICAgICAgICAgICAgICAgICBIUEZfRnMxOTIwMDBfR2FpbjdfQTAsCisgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMxOTIwMDBfR2FpbjdfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMTkyMDAwX0dhaW44X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgOCAqLworICAgICAgICAgICAgICAgICAgICBIUEZfRnMxOTIwMDBfR2FpbjhfQTAsCisgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMxOTIwMDBfR2FpbjhfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMTkyMDAwX0dhaW45X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgOSAqLworICAgICAgICAgICAgICAgICAgICBIUEZfRnMxOTIwMDBfR2FpbjlfQTAsCisgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMxOTIwMDBfR2FpbjlfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMTkyMDAwX0dhaW4xMF9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDEwICovCisgICAgICAgICAgICAgICAgICAgIEhQRl9GczE5MjAwMF9HYWluMTBfQTAsCisgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMxOTIwMDBfR2FpbjEwX0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9GczE5MjAwMF9HYWluMTFfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyAxMSAqLworICAgICAgICAgICAgICAgICAgICBIUEZfRnMxOTIwMDBfR2FpbjExX0EwLAorICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMTkyMDAwX0dhaW4xMV9CMX0sCisgICAgICAgICAgICAgICAgICAgIHtIUEZfRnMxOTIwMDBfR2FpbjEyX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTIgKi8KKyAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMTkyMDAwX0dhaW4xMl9BMCwKKyAgICAgICAgICAgICAgICAgICAgLUhQRl9GczE5MjAwMF9HYWluMTJfQjF9LAorICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMTkyMDAwX0dhaW4xM19BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDEzICovCisgICAgICAgICAgICAgICAgICAgIEhQRl9GczE5MjAwMF9HYWluMTNfQTAsCisgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMxOTIwMDBfR2FpbjEzX0IxfSwKKyAgICAgICAgICAgICAgICAgICAge0hQRl9GczE5MjAwMF9HYWluMTRfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyAxNCAqLworICAgICAgICAgICAgICAgICAgICBIUEZfRnMxOTIwMDBfR2FpbjE0X0EwLAorICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMTkyMDAwX0dhaW4xNF9CMX0sCisgICAgICAgICAgICAgICAgICAgIHtIUEZfRnMxOTIwMDBfR2FpbjE1X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTUgKi8KKyAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMTkyMDAwX0dhaW4xNV9BMCwKKyAgICAgICAgICAgICAgICAgICAgLUhQRl9GczE5MjAwMF9HYWluMTVfQjF9CisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgfTsKKyNlbHNlCiBGT19DMTZfTFNoeF9Db2Vmc190ICAgIExWTV9UcmVibGVCb29zdENvZWZzW10gPSB7CiAKICAgICAgICAgICAgICAgICAgICAgLyogMjJrSHogc2FtcGxpbmcgcmF0ZSAqLwpAQCAtMzQwLDggKzY3NSw5IEBACiAgICAgICAgICAgICAgICAgICAgIHtIUEZfRnM0ODAwMF9HYWluMTVfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyAxNSAqLwogICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzNDgwMDBfR2FpbjE1X0EwLAogICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczQ4MDAwX0dhaW4xNV9CMSwKLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ4MDAwX0dhaW4xNV9TaGlmdH19OwotCisgICAgICAgICAgICAgICAgICAgICBIUEZfRnM0ODAwMF9HYWluMTVfU2hpZnR9CisgICAgICAgICAgICAgICAgICAgIH07CisjZW5kaWYKIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KQEAgLTM1MCw2ICs2ODYsMTYgQEAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIC8qIGRCIHRvIGxpbmVhciBjb252ZXJzaW9uIHRhYmxlICovCisjaWZkZWYgQlVJTERfRkxPQVQKK2NvbnN0IExWTV9GTE9BVCBMVk1fVm9sdW1lVGFibGVbXSA9IHsKKyAgICAxLjAwMGYsICAgICAgICAgICAgIC8qICAwZEIgKi8KKyAgICAwLjg5MWYsICAgICAgICAgICAgIC8qIC0xZEIgKi8KKyAgICAwLjc5NGYsICAgICAgICAgICAgIC8qIC0yZEIgKi8KKyAgICAwLjcwOGYsICAgICAgICAgICAgIC8qIC0zZEIgKi8KKyAgICAwLjYzMWYsICAgICAgICAgICAgIC8qIC00ZEIgKi8KKyAgICAwLjU2MmYsICAgICAgICAgICAgIC8qIC01ZEIgKi8KKyAgICAwLjUwMWZ9OyAgICAgICAgICAgIC8qIC02ZEIgKi8KKyNlbHNlCiBjb25zdCBMVk1fSU5UMTYgTFZNX1ZvbHVtZVRhYmxlW10gPSB7CiAgICAgMHg3RkZGLCAgICAgICAgICAgICAvKiAgMGRCICovCiAgICAgMHg3MjE1LCAgICAgICAgICAgICAvKiAtMWRCICovCkBAIC0zNTgsNiArNzA0LDcgQEAKICAgICAweDUwQzMsICAgICAgICAgICAgIC8qIC00ZEIgKi8KICAgICAweDQ3RkIsICAgICAgICAgICAgIC8qIC01ZEIgKi8KICAgICAweDQwMDB9OyAgICAgICAgICAgIC8qIC02ZEIgKi8KKyNlbmRpZgogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9CdW5kbGUvc3JjL0xWTV9UYWJsZXMuaCBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9CdW5kbGUvc3JjL0xWTV9UYWJsZXMuaAppbmRleCBhNzYwMWZmLi40Y2Y3MTE5IDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQnVuZGxlL3NyYy9MVk1fVGFibGVzLmgKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0J1bmRsZS9zcmMvTFZNX1RhYmxlcy5oCkBAIC0zNywxNiArMzcsMjMgQEAKIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCisjaWZkZWYgQlVJTERfRkxPQVQKK2V4dGVybiBGT19GTE9BVF9MU2h4X0NvZWZzX3QgICAgIExWTV9UcmVibGVCb29zdENvZWZzW107CisjZWxzZQogZXh0ZXJuIEZPX0MxNl9MU2h4X0NvZWZzX3QgICAgIExWTV9UcmVibGVCb29zdENvZWZzW107Ci0KKyNlbmRpZgogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICAgIFZvbHVtZSBjb250cm9sIGdhaW4gYW5kIHRpbWUgY29uc3RhbnQgdGFibGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQorI2lmZGVmIEJVSUxEX0ZMT0FUCitleHRlcm4gY29uc3QgTFZNX0ZMT0FUIExWTV9Wb2x1bWVUYWJsZVtdOworI2Vsc2UKIGV4dGVybiBjb25zdCBMVk1fSU5UMTYgTFZNX1ZvbHVtZVRhYmxlW107CisjZW5kaWYKKwogZXh0ZXJuIGNvbnN0IExWTV9JTlQxNiBMVk1fTWl4ZXJUQ1RhYmxlW107CiAKIApkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9saWIvQUdDLmggYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL2xpYi9BR0MuaAppbmRleCAyMDgwZDY0Li45YTNkMzVkIDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL2xpYi9BR0MuaAorKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL2xpYi9BR0MuaApAQCAtMzcsNyArMzcsNyBAQAogLyogICAgVHlwZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCisjaWZuZGVmIEJVSUxEX0ZMT0FUCiB0eXBlZGVmIHN0cnVjdAogewogICAgIExWTV9JTlQzMiAgQUdDX0dhaW47ICAgICAgICAgICAgICAgICAgICAgICAgLyogVGhlIGN1cnJlbnQgQUdDIGdhaW4gKi8KQEAgLTUyLDIwICs1MiwzOSBAQAogICAgIExWTV9JTlQxNiAgVm9sdW1lVEM7ICAgICAgICAgICAgICAgICAgICAgICAgLyogVm9sdW1lIHVwZGF0ZSB0aW1lIGNvbnN0YW50ICovCiAKIH0gQUdDX01JWF9WT0xfMlN0MU1vbl9EMzJfdDsKKyNlbHNlCit0eXBlZGVmIHN0cnVjdAoreworICAgIExWTV9GTE9BVCAgQUdDX0dhaW47ICAgICAgICAgICAgICAgICAgICAgICAgLyogVGhlIGN1cnJlbnQgQUdDIGdhaW4gKi8KKyAgICBMVk1fRkxPQVQgIEFHQ19NYXhHYWluOyAgICAgICAgICAgICAgICAgICAgIC8qIFRoZSBtYXhpbXVtIEFHQyBnYWluICovCisgICAgTFZNX0ZMT0FUICBWb2x1bWU7ICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBUaGUgY3VycmVudCB2b2x1bWUgc2V0dGluZyAqLworICAgIExWTV9GTE9BVCAgVGFyZ2V0OyAgICAgICAgICAgICAgICAgICAgICAgICAgLyogVGhlIHRhcmdldCB2b2x1bWUgc2V0dGluZyAqLworICAgIExWTV9GTE9BVCAgQUdDX1RhcmdldDsgICAgICAgICAgICAgICAgICAgICAgLyogQUdDIHRhcmdldCBsZXZlbCAqLworICAgIExWTV9GTE9BVCAgQUdDX0F0dGFjazsgICAgICAgICAgICAgICAgICAgICAgLyogQUdDIGF0dGFjayBzY2FsZXIgKi8KKyAgICBMVk1fRkxPQVQgIEFHQ19EZWNheTsgICAgICAgICAgICAgICAgICAgICAgIC8qIEFHQyBkZWNheSBzY2FsZXIgKi8KKyAgICBMVk1fRkxPQVQgIFZvbHVtZVRDOyAgICAgICAgICAgICAgICAgICAgICAgIC8qIFZvbHVtZSB1cGRhdGUgdGltZSBjb25zdGFudCAqLwogCit9IEFHQ19NSVhfVk9MXzJTdDFNb25fRkxPQVRfdDsKKyNlbmRpZgogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogICAgRnVuY3Rpb24gUHJvdG90eXBlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBBR0NfTUlYX1ZPTF8yU3QxTW9uX0QzMl9XUkEoQUdDX01JWF9WT0xfMlN0MU1vbl9GTE9BVF90ICAqcEluc3RhbmNlLCAgICAgLyogSW5zdGFuY2UgcG9pbnRlciAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICAgICAgICAgICAgKnBTdFNyYywgICAgICAgIC8qIFN0ZXJlbyBzb3VyY2UgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9GTE9BVCAgICAgICAgICAgICpwTW9ub1NyYywgICAgICAvKiBNb25vIHNvdXJjZSAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICAgICAgKnBEc3QsICAgICAgICAgIC8qIFN0ZXJlbyBkZXN0aW5hdGlvbiAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiAgICAgICAgICAgICAgICAgbik7ICAgICAgICAgICAgIC8qIE51bWJlciBvZiBzYW1wbGVzICovCisjZWxzZQogdm9pZCBBR0NfTUlYX1ZPTF8yU3QxTW9uX0QzMl9XUkEoQUdDX01JWF9WT0xfMlN0MU1vbl9EMzJfdCAgKnBJbnN0YW5jZSwgICAgIC8qIEluc3RhbmNlIHBvaW50ZXIgKi8KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQzMiAgICAgICAgICAgICpwU3RTcmMsICAgICAgICAvKiBTdGVyZW8gc291cmNlICovCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMzIgICAgICAgICAgICAqcE1vbm9TcmMsICAgICAgLyogTW9ubyBzb3VyY2UgKi8KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgICAgICpwRHN0LCAgICAgICAgICAvKiBTdGVyZW8gZGVzdGluYXRpb24gKi8KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgICAgICAgICAgICAgICAgIG4pOyAgICAgICAgICAgICAvKiBOdW1iZXIgb2Ygc2FtcGxlcyAqLwotCisjZW5kaWYKICNpZmRlZiBfX2NwbHVzcGx1cwogfQogI2VuZGlmIC8qIF9fY3BsdXNwbHVzICovCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL2xpYi9CSVFVQUQuaCBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vbGliL0JJUVVBRC5oCmluZGV4IDdhYzdmYmQuLjNlZTdmNjMgMTAwNjQ0Ci0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vbGliL0JJUVVBRC5oCisrKyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vbGliL0JJUVVBRC5oCkBAIC0yNywxOSArMjcsMzQgQEAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgICBJTlNUQU5DRSBNRU1PUlkgVFlQRSBERUZJTklUSU9OCiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZmRlZiBCVUlMRF9GTE9BVAordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgICBMVk1fRkxPQVQgU3RvcmFnZVs2XTsKIAorfSBCaXF1YWRfRkxPQVRfSW5zdGFuY2VfdDsKKyNlbHNlCiB0eXBlZGVmIHN0cnVjdAogewogICAgIExWTV9JTlQzMiBTdG9yYWdlWzZdOwogCiB9IEJpcXVhZF9JbnN0YW5jZV90OwotCi0KKyNlbmRpZgogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICAgIENPRUZGSUNJRU5UIFRZUEUgREVGSU5JVElPTlMKICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKioqIEJpcXVhZCBjb2VmZmljaWVudHMgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZmRlZiBCVUlMRF9GTE9BVAordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgICBMVk1fRkxPQVQgIEEyOyAgIC8qICBhMiAgKi8KKyAgICBMVk1fRkxPQVQgIEExOyAgIC8qICBhMSAgKi8KKyAgICBMVk1fRkxPQVQgIEEwOyAgIC8qICBhMCAgKi8KKyAgICBMVk1fRkxPQVQgIEIyOyAgIC8qIC1iMiEgKi8KKyAgICBMVk1fRkxPQVQgIEIxOyAgIC8qIC1iMSEgKi8KK30gQlFfRkxPQVRfQ29lZnNfdDsKKyNlbHNlCiB0eXBlZGVmIHN0cnVjdAogewogICAgIExWTV9JTlQxNiBBMjsgICAvKiAgYTIgICovCkBAIC01Nyw4ICs3MiwxNyBAQAogICAgIExWTV9JTlQzMiAgQjI7ICAgLyogLWIyISAqLwogICAgIExWTV9JTlQzMiAgQjE7ICAgLyogLWIxISAqLwogfSBCUV9DMzJfQ29lZnNfdDsKKyNlbmRpZgogCiAvKioqIEZpcnN0IG9yZGVyIGNvZWZmaWNpZW50cyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZmRlZiBCVUlMRF9GTE9BVAordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgICBMVk1fRkxPQVQgQTE7ICAgLyogIGExICAqLworICAgIExWTV9GTE9BVCBBMDsgICAvKiAgYTAgICovCisgICAgTFZNX0ZMT0FUIEIxOyAgIC8qIC1iMSEgKi8KK30gRk9fRkxPQVRfQ29lZnNfdDsKKyNlbHNlCiB0eXBlZGVmIHN0cnVjdAogewogICAgIExWTV9JTlQxNiBBMTsgICAvKiAgYTEgICovCkBAIC03Miw4ICs5NiwxNyBAQAogICAgIExWTV9JTlQzMiAgQTA7ICAgLyogIGEwICAqLwogICAgIExWTV9JTlQzMiAgQjE7ICAgLyogLWIxISAqLwogfSBGT19DMzJfQ29lZnNfdDsKKyNlbmRpZgogCiAvKioqIEZpcnN0IG9yZGVyIGNvZWZmaWNpZW50cyB3aXRoIFNoaWZ0KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQlVJTERfRkxPQVQKK3R5cGVkZWYgc3RydWN0Cit7CisgICAgTFZNX0ZMT0FUIEExOyAgICAvKiAgYTEgICovCisgICAgTFZNX0ZMT0FUIEEwOyAgICAvKiAgYTAgICovCisgICAgTFZNX0ZMT0FUIEIxOyAgICAvKiAtYjEhICovCit9IEZPX0ZMT0FUX0xTaHhfQ29lZnNfdDsKKyNlbHNlCiB0eXBlZGVmIHN0cnVjdAogewogICAgIExWTV9JTlQxNiBBMTsgICAgLyogIGExICAqLwpAQCAtODEsOCArMTE0LDE2IEBACiAgICAgTFZNX0lOVDE2IEIxOyAgICAvKiAtYjEhICovCiAgICAgTFZNX0lOVDE2IFNoaWZ0OyAvKiBTaGlmdCAqLwogfSBGT19DMTZfTFNoeF9Db2Vmc190OwotCisjZW5kaWYKIC8qKiogQmFuZCBwYXNzIGNvZWZmaWNpZW50cyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmZGVmIEJVSUxEX0ZMT0FUCit0eXBlZGVmIHN0cnVjdAoreworICAgIExWTV9GTE9BVCAgQTA7ICAgLyogIGEwICAqLworICAgIExWTV9GTE9BVCAgQjI7ICAgLyogLWIyISAqLworICAgIExWTV9GTE9BVCAgQjE7ICAgLyogLWIxISAqLworfSBCUF9GTE9BVF9Db2Vmc190OworI2Vsc2UKIHR5cGVkZWYgc3RydWN0CiB7CiAgICAgTFZNX0lOVDE2IEEwOyAgIC8qICBhMCAgKi8KQEAgLTk2LDggKzEzNywxOCBAQAogICAgIExWTV9JTlQzMiAgQjI7ICAgLyogLWIyISAqLwogICAgIExWTV9JTlQzMiAgQjE7ICAgLyogLWIxISAqLwogfSBCUF9DMzJfQ29lZnNfdDsKKyNlbmRpZgogCiAvKioqIFBlYWtpbmcgY29lZmZpY2llbnRzICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZmRlZiBCVUlMRF9GTE9BVAordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgICBMVk1fRkxPQVQgQTA7ICAgLyogIGEwICAqLworICAgIExWTV9GTE9BVCBCMjsgICAvKiAtYjIhICovCisgICAgTFZNX0ZMT0FUIEIxOyAgIC8qIC1iMSEgKi8KKyAgICBMVk1fRkxPQVQgIEc7ICAgLyogR2FpbiAqLworfSBQS19GTE9BVF9Db2Vmc190OworI2Vsc2UKIHR5cGVkZWYgc3RydWN0CiB7CiAgICAgTFZNX0lOVDE2IEEwOyAgIC8qICBhMCAgKi8KQEAgLTExMywxNiArMTY0LDI2IEBACiAgICAgTFZNX0lOVDMyICBCMTsgICAvKiAtYjEhICovCiAgICAgTFZNX0lOVDE2ICBHOyAgIC8qIEdhaW4gKi8KIH0gUEtfQzMyX0NvZWZzX3Q7Ci0KKyNlbmRpZgogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICAgVEFQUyBUWVBFIERFRklOSVRJT05TCiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogLyoqKiBUeXBlcyB1c2VkIGZvciBmaXJzdCBvcmRlciBhbmQgc2hlbHZpbmcgZmlsdGVyICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQlVJTERfRkxPQVQKK3R5cGVkZWYgc3RydWN0Cit7CisgICAgTFZNX0ZMT0FUIFN0b3JhZ2VbICgxICogMikgXTsgIC8qIE9uZSBjaGFubmVsLCB0d28gdGFwcyBvZiBzaXplIExWTV9JTlQzMiAqLworfSBCaXF1YWRfMUlfT3JkZXIxX0ZMT0FUX1RhcHNfdDsKIAogdHlwZWRlZiBzdHJ1Y3QKIHsKKyAgICBMVk1fRkxPQVQgU3RvcmFnZVsgKDIgKiAyKSBdOyAgLyogVHdvIGNoYW5uZWxzLCB0d28gdGFwcyBvZiBzaXplIExWTV9JTlQzMiAqLworfSBCaXF1YWRfMklfT3JkZXIxX0ZMT0FUX1RhcHNfdDsKKyNlbHNlCit0eXBlZGVmIHN0cnVjdAorewogICAgIExWTV9JTlQzMiBTdG9yYWdlWyAoMSoyKSB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zJJX09yZGVyMl9UYXBzX3QgKnBUYXBzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCUV9DMTZfQ29lZnNfdCAgICAgICAgICAqcENvZWYpOworI2VuZGlmCiAKKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBCUV8ySV9EMTZGMzJDMTVfVFJDX1dSQV8wMSAoICAgICAgICAgICBCaXF1YWRfRkxPQVRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAgICAgICpwRGF0YUluLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAgICAgICpwRGF0YU91dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICBOclNhbXBsZXMpOworI2Vsc2UKIHZvaWQgQlFfMklfRDE2RjMyQzE1X1RSQ19XUkFfMDEgKCAgICAgICAgICAgQmlxdWFkX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICAqcERhdGFJbiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICAqcERhdGFPdXQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgTnJTYW1wbGVzKTsKKyNlbmRpZgogCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgQlFfMklfRDE2RjMyQzE0X1RSQ19XUkFfMDEgKCAgICAgICAgICAgQmlxdWFkX0ZMT0FUX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICAgICAgICAqcERhdGFJbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICAgICAgICAqcERhdGFPdXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgTnJTYW1wbGVzKTsKKyNlbHNlCiB2b2lkIEJRXzJJX0QxNkYzMkMxNF9UUkNfV1JBXzAxICggICAgICAgICAgIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgKnBEYXRhSW4sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgKnBEYXRhT3V0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgIE5yU2FtcGxlcyk7CiAKKyNlbmRpZgorCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgQlFfMklfRDE2RjMyQzEzX1RSQ19XUkFfMDEgKCAgICAgICAgICAgQmlxdWFkX0ZMT0FUX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICAgICAgICAqcERhdGFJbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICAgICAgICAqcERhdGFPdXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgTnJTYW1wbGVzKTsKKyNlbHNlCiB2b2lkIEJRXzJJX0QxNkYzMkMxM19UUkNfV1JBXzAxICggICAgICAgICAgIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgKnBEYXRhSW4sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgKnBEYXRhT3V0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgIE5yU2FtcGxlcyk7CiAKKyNlbmRpZgorCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgQlFfMklfRDE2RjE2Q3NzX1RSQ19XUkFfMDFfSW5pdCAoICAgQmlxdWFkX0ZMT0FUX0luc3RhbmNlX3QgICAgICAgICAqcEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCaXF1YWRfMklfT3JkZXIyX0ZMT0FUX1RhcHNfdCAgICpwVGFwcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQlFfRkxPQVRfQ29lZnNfdCAgICAgICAgICAgICpwQ29lZik7CisjZWxzZQogdm9pZCBCUV8ySV9EMTZGMTZDc3NfVFJDX1dSQV8wMV9Jbml0ICggICAgICBCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCaXF1YWRfMklfT3JkZXIyX1RhcHNfdCAqcFRhcHMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJRX0MxNl9Db2Vmc190ICAgICAgICAgICpwQ29lZik7CiAKKyNlbmRpZgorCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgQlFfMklfRDE2RjE2QzE1X1RSQ19XUkFfMDEoIEJpcXVhZF9GTE9BVF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAqcERhdGFJbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICpwRGF0YU91dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgIE5yU2FtcGxlcyk7CisjZWxzZQogdm9pZCBCUV8ySV9EMTZGMTZDMTVfVFJDX1dSQV8wMSggICAgICAgICAgICBCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgKnBEYXRhSW4sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAqcERhdGFPdXQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICBOclNhbXBsZXMpOwogCisjZW5kaWYKKworI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIEJRXzJJX0QxNkYxNkMxNF9UUkNfV1JBXzAxKCBCaXF1YWRfRkxPQVRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICAgKnBEYXRhSW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAqcERhdGFPdXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBOclNhbXBsZXMpOworI2Vsc2UKIHZvaWQgQlFfMklfRDE2RjE2QzE0X1RSQ19XUkFfMDEoICAgICAgICAgICAgQmlxdWFkX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICpwRGF0YUluLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgKnBEYXRhT3V0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgTnJTYW1wbGVzKTsKKyNlbmRpZgogCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgQlFfMUlfRDE2RjE2Q3NzX1RSQ19XUkFfMDFfSW5pdCAoICAgQmlxdWFkX0ZMT0FUX0luc3RhbmNlX3QgICAgICAgICAqcEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCaXF1YWRfMUlfT3JkZXIyX0ZMT0FUX1RhcHNfdCAgICpwVGFwcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQlFfRkxPQVRfQ29lZnNfdCAgICAgICAgICAgICpwQ29lZik7CisjZWxzZQogdm9pZCBCUV8xSV9EMTZGMTZDc3NfVFJDX1dSQV8wMV9Jbml0ICggICAgICBCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCaXF1YWRfMUlfT3JkZXIyX1RhcHNfdCAqcFRhcHMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJRX0MxNl9Db2Vmc190ICAgICAgICAgICpwQ29lZik7CiAKKyNlbmRpZgorCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgQlFfMUlfRDE2RjE2QzE1X1RSQ19XUkFfMDEgKCBCaXF1YWRfRkxPQVRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICpwRGF0YUluLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICpwRGF0YU91dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBOclNhbXBsZXMpOworI2Vsc2UKIHZvaWQgQlFfMUlfRDE2RjE2QzE1X1RSQ19XUkFfMDEoICAgICAgICAgICAgQmlxdWFkX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICpwRGF0YUluLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgKnBEYXRhT3V0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgTnJTYW1wbGVzKTsKIAorI2VuZGlmCisKKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBCUV8xSV9EMTZGMzJDc3NfVFJDX1dSQV8wMV9Jbml0ICggICBCaXF1YWRfRkxPQVRfSW5zdGFuY2VfdCAgICAgICAgICpwSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJpcXVhZF8xSV9PcmRlcjJfRkxPQVRfVGFwc190ICAgKnBUYXBzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCUV9GTE9BVF9Db2Vmc190ICAgICAgICAgICAgKnBDb2VmKTsKKyNlbHNlCiB2b2lkIEJRXzFJX0QxNkYzMkNzc19UUkNfV1JBXzAxX0luaXQgKCAgICAgIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJpcXVhZF8xSV9PcmRlcjJfVGFwc190ICpwVGFwcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQlFfQzE2X0NvZWZzX3QgICAgICAgICAgKnBDb2VmKTsKIAorI2VuZGlmCisKKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBCUV8xSV9EMTZGMzJDMTRfVFJDX1dSQV8wMSAoIEJpcXVhZF9GTE9BVF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICAqcERhdGFJbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAqcERhdGFPdXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgTnJTYW1wbGVzKTsKKyNlbHNlCiB2b2lkIEJRXzFJX0QxNkYzMkMxNF9UUkNfV1JBXzAxICggICAgICAgICAgIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgKnBEYXRhSW4sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgKnBEYXRhT3V0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgIE5yU2FtcGxlcyk7CiAKKyNlbmRpZgogLyoqKiAzMiBiaXQgZGF0YSBwYXRoICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBCUV8ySV9EMzJGMzJDbGxfVFJDX1dSQV8wMV9Jbml0ICggICAgICBCaXF1YWRfRkxPQVRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCaXF1YWRfMklfT3JkZXIyX0ZMT0FUX1RhcHNfdCAqcFRhcHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJRX0ZMT0FUX0NvZWZzX3QgICAgICAgICAgKnBDb2VmKTsKK3ZvaWQgQlFfMklfRDMyRjMyQzMwX1RSQ19XUkFfMDEgKCAgICAgICAgICAgQmlxdWFkX0ZMT0FUX0luc3RhbmNlX3QgICpwSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICAgICAgKnBEYXRhSW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICAgICAgKnBEYXRhT3V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgIE5yU2FtcGxlcyk7CisjZWxzZQogdm9pZCBCUV8ySV9EMzJGMzJDbGxfVFJDX1dSQV8wMV9Jbml0ICggICAgICBCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCaXF1YWRfMklfT3JkZXIyX1RhcHNfdCAqcFRhcHMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJRX0MzMl9Db2Vmc190ICAgICAgICAgICpwQ29lZik7CkBAIC0yMTUsMzMgKzM3NSw2NiBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgICAgICAgICAgICAgICAgICpwRGF0YUluLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgICAgICAgICAgICAgICAgICpwRGF0YU91dCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICBOclNhbXBsZXMpOworI2VuZGlmCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgICBGVU5DVElPTiBQUk9UT1RZUEVTOiBGSVJTVCBPUkRFUiBGSUxURVJTCiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogLyoqKiAxNiBiaXQgZGF0YSBwYXRoICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBGT18xSV9EMTZGMTZDc3NfVFJDX1dSQV8wMV9Jbml0KCAgICBCaXF1YWRfRkxPQVRfSW5zdGFuY2VfdCAgICAgICAgICpwSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJpcXVhZF8xSV9PcmRlcjFfRkxPQVRfVGFwc190ICAgKnBUYXBzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGT19GTE9BVF9Db2Vmc190ICAgICAgICAgICAgKnBDb2VmKTsKKyNlbHNlCiB2b2lkIEZPXzFJX0QxNkYxNkNzc19UUkNfV1JBXzAxX0luaXQoICAgICAgIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJpcXVhZF8xSV9PcmRlcjFfVGFwc190ICpwVGFwcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRk9fQzE2X0NvZWZzX3QgICAgICAgICAgKnBDb2VmKTsKKyNlbmRpZgogCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgRk9fMUlfRDE2RjE2QzE1X1RSQ19XUkFfMDEoIEJpcXVhZF9GTE9BVF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAqcERhdGFJbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICpwRGF0YU91dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgIE5yU2FtcGxlcyk7CisjZWxzZQogdm9pZCBGT18xSV9EMTZGMTZDMTVfVFJDX1dSQV8wMSggICAgICAgICAgICBCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgKnBEYXRhSW4sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAqcERhdGFPdXQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICBOclNhbXBsZXMpOworI2VuZGlmCiAKKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBGT18ySV9EMTZGMzJDc3NfTFNoeF9UUkNfV1JBXzAxX0luaXQoQmlxdWFkX0ZMT0FUX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJpcXVhZF8ySV9PcmRlcjFfRkxPQVRfVGFwc190ICpwVGFwcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZPX0ZMT0FUX0xTaHhfQ29lZnNfdCAgICAgKnBDb2VmKTsKKyNlbHNlCiB2b2lkIEZPXzJJX0QxNkYzMkNzc19MU2h4X1RSQ19XUkFfMDFfSW5pdChCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmlxdWFkXzJJX09yZGVyMV9UYXBzX3QgKnBUYXBzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRk9fQzE2X0xTaHhfQ29lZnNfdCAgICAgKnBDb2VmKTsKKyNlbmRpZgogCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgRk9fMklfRDE2RjMyQzE1X0xTaHhfVFJDX1dSQV8wMShCaXF1YWRfRkxPQVRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICpwRGF0YUluLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICpwRGF0YU91dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBOclNhbXBsZXMpOworI2Vsc2UKIHZvaWQgRk9fMklfRDE2RjMyQzE1X0xTaHhfVFJDX1dSQV8wMShCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICpwRGF0YUluLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICpwRGF0YU91dCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBOclNhbXBsZXMpOwotCisjZW5kaWYKIC8qKiogMzIgYml0IGRhdGEgcGF0aCAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgRk9fMUlfRDMyRjMyQ2xsX1RSQ19XUkFfMDFfSW5pdCggQmlxdWFkX0ZMT0FUX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmlxdWFkXzFJX09yZGVyMV9GTE9BVF9UYXBzX3QgKnBUYXBzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGT19GTE9BVF9Db2Vmc190ICAgICAgICAgICpwQ29lZik7Cit2b2lkIEZPXzFJX0QzMkYzMkMzMV9UUkNfV1JBXzAxKCBCaXF1YWRfRkxPQVRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICAgICAgICAgKnBEYXRhSW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAgICAgICAqcERhdGFPdXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgICBOclNhbXBsZXMpOworI2Vsc2UKIHZvaWQgRk9fMUlfRDMyRjMyQ2xsX1RSQ19XUkFfMDFfSW5pdCggICAgICAgQmlxdWFkX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmlxdWFkXzFJX09yZGVyMV9UYXBzX3QgKnBUYXBzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGT19DMzJfQ29lZnNfdCAgICAgICAgICAqcENvZWYpOwpAQCAtMjUwLDEzICs0NDMsMjggQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAgICAgICAgICAgKnBEYXRhSW4sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgICpwRGF0YU91dCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgTnJTYW1wbGVzKTsKLQorI2VuZGlmCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICAgRlVOQ1RJT04gUFJPVE9UWVBFUzogQkFORCBQQVNTIEZJTFRFUlMKICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKioqIDE2IGJpdCBkYXRhIHBhdGggKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQorI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIEJQXzFJX0QxNkYxNkNzc19UUkNfV1JBXzAxX0luaXQoIEJpcXVhZF9GTE9BVF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJpcXVhZF8xSV9PcmRlcjJfRkxPQVRfVGFwc190ICpwVGFwcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQlBfRkxPQVRfQ29lZnNfdCAgICAgICAgICAgICAgKnBDb2VmKTsKK3ZvaWQgQlBfMUlfRDE2RjE2QzE0X1RSQ19XUkFfMDEgKCAgICAgQmlxdWFkX0ZMT0FUX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICAgICAgICAgKnBEYXRhSW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICAgICAgICpwRGF0YU91dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICAgTnJTYW1wbGVzKTsKK3ZvaWQgQlBfMUlfRDE2RjMyQ2xsX1RSQ19XUkFfMDFfSW5pdCAoQmlxdWFkX0ZMT0FUX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmlxdWFkXzFJX09yZGVyMl9GTE9BVF9UYXBzX3QgKnBUYXBzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCUF9GTE9BVF9Db2Vmc190ICAgICAgICAgICAgICAqcENvZWYpOwordm9pZCBCUF8xSV9EMTZGMzJDMzBfVFJDX1dSQV8wMSAoICAgICAgICAgICBCaXF1YWRfRkxPQVRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAgICAgICpwRGF0YUluLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAgICAgICpwRGF0YU91dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICBOclNhbXBsZXMpOworI2Vsc2UKIHZvaWQgQlBfMUlfRDE2RjE2Q3NzX1RSQ19XUkFfMDFfSW5pdCAoICAgICAgQmlxdWFkX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmlxdWFkXzFJX09yZGVyMl9UYXBzX3QgKnBUYXBzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCUF9DMTZfQ29lZnNfdCAgICAgICAgICAqcENvZWYpOwpAQCAtMjc0LDEwICs0ODIsMTcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICAqcERhdGFJbiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICAqcERhdGFPdXQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgTnJTYW1wbGVzKTsKLQotCisjZW5kaWYKIC8qKiogMzIgYml0IGRhdGEgcGF0aCAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgQlBfMUlfRDMyRjMyQ2xsX1RSQ19XUkFfMDJfSW5pdCAoICAgICAgQmlxdWFkX0ZMT0FUX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmlxdWFkXzFJX09yZGVyMl9GTE9BVF9UYXBzX3QgKnBUYXBzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCUF9GTE9BVF9Db2Vmc190ICAgICAgICAgICpwQ29lZik7Cit2b2lkIEJQXzFJX0QzMkYzMkMzMF9UUkNfV1JBXzAyKCAgICAgICAgICAgIEJpcXVhZF9GTE9BVF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICAgICAgKnBEYXRhSW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICAgICAgKnBEYXRhT3V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgIE5yU2FtcGxlcyk7CisjZWxzZQogdm9pZCBCUF8xSV9EMzJGMzJDbGxfVFJDX1dSQV8wMl9Jbml0ICggICAgICBCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCaXF1YWRfMUlfT3JkZXIyX1RhcHNfdCAqcFRhcHMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJQX0MzMl9Db2Vmc190ICAgICAgICAgICpwQ29lZik7CkBAIC0yODYsNDIgKzUwMSw1OSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgICAgICAgICAgICAgICAgICpwRGF0YUluLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgICAgICAgICAgICAgICAgICpwRGF0YU91dCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICBOclNhbXBsZXMpOwotCisjZW5kaWYKIAogLyoqKiAzMiBiaXQgZGF0YSBwYXRoIFNURVJFTyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KKyNpZm5kZWYgQlVJTERfRkxPQVQKIHZvaWQgUEtfMklfRDMyRjMyQ2xsR3NzX1RSQ19XUkFfMDFfSW5pdCAoICAgQmlxdWFkX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmlxdWFkXzJJX09yZGVyMl9UYXBzX3QgKnBUYXBzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQS19DMzJfQ29lZnNfdCAgICAgICAgICAqcENvZWYpOwotCiB2b2lkIFBLXzJJX0QzMkYzMkMzMEcxMV9UUkNfV1JBXzAxICggICAgICAgIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgICAgICAgKnBEYXRhSW4sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgICAgICAgKnBEYXRhT3V0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgIE5yU2FtcGxlcyk7Ci0KKyNlbmRpZgorI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIFBLXzJJX0QzMkYzMkNzc0dzc19UUkNfV1JBXzAxX0luaXQgKCAgIEJpcXVhZF9GTE9BVF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJpcXVhZF8ySV9PcmRlcjJfRkxPQVRfVGFwc190ICpwVGFwcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUEtfRkxPQVRfQ29lZnNfdCAgICAgICAgICAqcENvZWYpOworI2Vsc2UKIHZvaWQgUEtfMklfRDMyRjMyQ3NzR3NzX1RSQ19XUkFfMDFfSW5pdCAoICAgQmlxdWFkX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmlxdWFkXzJJX09yZGVyMl9UYXBzX3QgKnBUYXBzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQS19DMTZfQ29lZnNfdCAgICAgICAgICAqcENvZWYpOwotCisjZW5kaWYKKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBQS18ySV9EMzJGMzJDMTRHMTFfVFJDX1dSQV8wMSggQmlxdWFkX0ZMT0FUX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICpwRGF0YUluLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICAgKnBEYXRhT3V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgTnJTYW1wbGVzKTsKKyNlbHNlCiB2b2lkIFBLXzJJX0QzMkYzMkMxNEcxMV9UUkNfV1JBXzAxICggICAgICAgIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgICAgICAgKnBEYXRhSW4sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgICAgICAgKnBEYXRhT3V0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgIE5yU2FtcGxlcyk7Ci0KKyNlbmRpZgogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICAgRlVOQ1RJT04gUFJPVE9UWVBFUzogREMgUkVNT1ZBTCBGSUxURVJTCiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogLyoqKiAxNiBiaXQgZGF0YSBwYXRoIFNURVJFTyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgRENfMklfRDE2X1RSQ19XUkFfMDFfSW5pdCAgICAgKCAgICAgICAgQmlxdWFkX0ZMT0FUX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSk7CiAKK3ZvaWQgRENfMklfRDE2X1RSQ19XUkFfMDEgICAgICAgICAgKCAgICAgICAgQmlxdWFkX0ZMT0FUX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICAgKnBEYXRhSW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICpwRGF0YU91dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgTnJTYW1wbGVzKTsKKyNlbHNlCiB2b2lkIERDXzJJX0QxNl9UUkNfV1JBXzAxX0luaXQgICAgICggICAgICAgIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UpOwogCiB2b2lkIERDXzJJX0QxNl9UUkNfV1JBXzAxICAgICAgICAgICggICAgICAgIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICpwRGF0YUluLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAqcERhdGFPdXQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgIE5yU2FtcGxlcyk7Ci0KKyNlbmRpZgogI2lmZGVmIF9fY3BsdXNwbHVzCiB9CiAjZW5kaWYgLyogX19jcGx1c3BsdXMgKi8KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vbGliL0NvbXBMaW0uaCBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vbGliL0NvbXBMaW0uaAppbmRleCA0Y2I4YWEyLi40OThmYWEzIDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL2xpYi9Db21wTGltLmgKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9saWIvQ29tcExpbS5oCkBAIC02NiwxMyArNjYsMTcgQEAKIC8qICBGdW5jdGlvbiBQcm90b3R5cGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQorI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIE5vbkxpbkNvbXBfRmxvYXQoTFZNX0ZMT0FUICAgICAgICBHYWluLAorICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgKnBEYXRhSW4sCisgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAqcERhdGFPdXQsCisgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAgICBCbG9ja0xlbmd0aCk7CisjZWxzZQogdm9pZCBOb25MaW5Db21wX0QxNihMVk1fSU5UMTYgICAgICAgIEdhaW4sCiAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgKnBTdGVyQmZJbiwKICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAqcFN0ZXJCZk91dCwKICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAgICBCbG9ja0xlbmd0aCk7Ci0KLQorI2VuZGlmCiAjaWZkZWYgX19jcGx1c3BsdXMKIH0KICNlbmRpZiAvKiBfX2NwbHVzcGx1cyAqLwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9saWIvRmlsdGVyLmggYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL2xpYi9GaWx0ZXIuaAppbmRleCAyMjk3MDFhLi4wYzg5NTVkIDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL2xpYi9GaWx0ZXIuaAorKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL2xpYi9GaWx0ZXIuaApAQCAtMzMsMTEgKzMzLDMyIEBACiAgICBERUZJTkVTCiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KICNkZWZpbmUgRklMVEVSX0xPU1MgICAgIDMyNzMwICAgICAgIC8qIC0wLjAxZEIgbG9zcyB0byBhdm9pZCB3cmFwcGluZyBkdWUgdG8gYmFuZCByaXBwbGUgKi8KLQorI2lmZGVmIEJVSUxEX0ZMT0FUCisjZGVmaW5lIEZJTFRFUl9MT1NTX0ZMT0FUICAgIDAuOTk4ODQ5ZgorI2VuZGlmCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICAgRlVOQ1RJT04gUFJPVE9UWVBFUwogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQlVJTERfRkxPQVQKIAorTFZNX0ZMT0FUIExWTV9Qb3dlcjEwKCAgIExWTV9GTE9BVCAgWCk7CisKK0xWTV9GTE9BVCBMVk1fUG9seW5vbWlhbChMVk1fVUlOVDE2IE4sCisgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAqcENvZWZmaWNpZW50cywKKyAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgIFgpOworI2lmZGVmIEhJR0hFUl9GUworTFZNX0ZMT0FUICAgTFZNX0dldE9tZWdhKExWTV9VSU5UMzIgIEZjLAorI2Vsc2UKK0xWTV9GTE9BVCAgIExWTV9HZXRPbWVnYShMVk1fVUlOVDE2ICBGYywKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9Gc19lbiAgIFNhbXBsZVJhdGUpOworCitMVk1fRkxPQVQgTFZNX0ZPX0xQRiggICAgTFZNX0ZMT0FUICB3LAorICAgICAgICAgICAgICAgICAgICAgICAgIEZPX0ZMT0FUX0NvZWZzX3QgICpwQ29lZmZzKTsKKworTFZNX0ZMT0FUIExWTV9GT19IUEYoICAgIExWTV9GTE9BVCAgdywKKyAgICAgICAgICAgICAgICAgICAgICAgICBGT19GTE9BVF9Db2Vmc190ICAqcENvZWZmcyk7CisjZWxzZQogTFZNX0lOVDMyIExWTV9Qb2x5bm9taWFsKExWTV9VSU5UMTYgTiwKICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICpwQ29lZmZpY2llbnRzLAogICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgWCk7CkBAIC01Miw3ICs3Myw3IEBACiAKIExWTV9JTlQzMiAgIExWTV9HZXRPbWVnYShMVk1fVUlOVDE2ICBGYywKICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRnNfZW4gICBTYW1wbGVSYXRlKTsKLQorI2VuZGlmCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KICNpZmRlZiBfX2NwbHVzcGx1cwogfQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9saWIvTFZNX1R5cGVzLmggYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL2xpYi9MVk1fVHlwZXMuaAppbmRleCA2OGM1NWY3Li5jYjE1YjYwIDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL2xpYi9MVk1fVHlwZXMuaAorKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL2xpYi9MVk1fVHlwZXMuaApAQCAtNDQsNiArNDQsOSBAQAogCiAjZGVmaW5lIExWTV9NQVhJTlRfOCAgICAgICAgICAgIDEyNyAgICAgICAgICAgICAgICAgLyogTWF4aW11bSBwb3NpdGl2ZSBpbnRlZ2VyIHNpemUgKi8KICNkZWZpbmUgTFZNX01BWElOVF8xNiAgICAgICAgICAgMzI3NjcKKyNpZmRlZiBCVUlMRF9GTE9BVAorI2RlZmluZSBMVk1fTUFYRkxPQVQgICAgICAgICAgICAxLjBmCisjZW5kaWYKICNkZWZpbmUgTFZNX01BWElOVF8zMiAgICAgICAgICAgMjE0NzQ4MzY0NwogI2RlZmluZSBMVk1fTUFYRU5VTSAgICAgICAgICAgICAyMTQ3NDgzNjQ3CiAKQEAgLTk1LDcgKzk4LDkgQEAKIHR5cGVkZWYgICAgIGludDMyX3QgICAgICAgICAgICAgTFZNX0lOVDMyOyAgICAgICAgICAvKiBTaWduZWQgMzItYml0IHdvcmQgKi8KIHR5cGVkZWYgICAgIHVpbnQzMl90ICAgICAgICAgICAgTFZNX1VJTlQzMjsgICAgICAgICAvKiBVbnNpZ25lZCAzMi1iaXQgd29yZCAqLwogCi0KKyNpZmRlZiBCVUlMRF9GTE9BVAordHlwZWRlZiAgICAgZmxvYXQgICAgICAgICAgICAgICBMVk1fRkxPQVQ7ICAgICAgICAgIC8qIHNpbmdsZSBwcmVjaXNzaW9uIGZsb2F0aW5nIHBvaW50Ki8KKyNlbmRpZgogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICBTdGFuZGFyZCBFbnVtZXJhdGVkIHR5cGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwpAQCAtMTMzLDYgKzEzOCwxMCBAQAogICAgIExWTV9GU18zMjAwMCA9IDYsCiAgICAgTFZNX0ZTXzQ0MTAwID0gNywKICAgICBMVk1fRlNfNDgwMDAgPSA4LAorI2lmZGVmIEhJR0hFUl9GUworICAgIExWTV9GU185NjAwMCA9IDksCisgICAgTFZNX0ZTXzE5MjAwMCA9IDEwLAorI2VuZGlmCiAgICAgTFZNX0ZTX0lOVkFMSUQgPSBMVk1fTUFYRU5VTS0xLAogICAgIExWTV9GU19EVU1NWSA9IExWTV9NQVhFTlVNCiB9IExWTV9Gc19lbjsKZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vbGliL01peGVyLmggYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL2xpYi9NaXhlci5oCmluZGV4IDg5ZGViMGQuLjA3YzUzY2QgMTAwNjQ0Ci0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vbGliL01peGVyLmgKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9saWIvTWl4ZXIuaApAQCAtMzAsNiArMzAsNDMgQEAKICAgIElOU1RBTkNFIE1FTU9SWSBUWVBFIERFRklOSVRJT04KICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCisjaWZkZWYgQlVJTERfRkxPQVQgLyogQlVJTERfRkxPQVQqLwordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgICBMVk1fRkxPQVQgICBBbHBoYTsgICAgICAgICAgICAgICAgICAgLyogVGltZSBjb25zdGFudC4gU2V0IGJ5IG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AgICAgICAgICAgIC8qIFBvaW50ZXIgdG8gdGhlIGNhbGxiYWNrIGZ1bmN0aW9uICovCit9IE1peF8xU3RfQ2xsX0ZMT0FUX3Q7Cit0eXBlZGVmIHN0cnVjdAoreworICAgIExWTV9GTE9BVCAgIEFscGhhMTsKKyAgICBMVk1fRkxPQVQgICBUYXJnZXQxOworICAgIExWTV9GTE9BVCAgIEN1cnJlbnQxOworICAgIExWTV9JTlQxNiAgIENhbGxiYWNrU2V0MTsKKyAgICBMVk1fSU5UMTYgICBDYWxsYmFja1BhcmFtMTsKKyAgICB2b2lkICAgICAgICAqcENhbGxiYWNrSGFuZGxlMTsKKyAgICB2b2lkICAgICAgICAqcEdlbmVyYWxQdXJwb3NlMTsKKyAgICBMVk1fQ2FsbGJhY2sgcENhbGxCYWNrMTsKKworICAgIExWTV9GTE9BVCAgIEFscGhhMjsgICAgICAgICAgICAgICAgICAgLyogV2FybmluZyB0aGUgYWRkcmVzcyBvZiB0aGlzIGxvY2F0aW9uIGlzIHBhc3NlZCBhcyBhIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvaW50ZXIgdG8gTWl4XzFTdF9DbGxfdCBpbiBzb21lIGZ1bmN0aW9ucyAqLworICAgIExWTV9GTE9BVCAgIFRhcmdldDI7CisgICAgTFZNX0ZMT0FUICAgQ3VycmVudDI7CisgICAgTFZNX0lOVDE2ICAgQ2FsbGJhY2tTZXQyOworICAgIExWTV9JTlQxNiAgIENhbGxiYWNrUGFyYW0yOworICAgIHZvaWQgICAgICAgICpwQ2FsbGJhY2tIYW5kbGUyOworICAgIHZvaWQgICAgICAgICpwR2VuZXJhbFB1cnBvc2UyOworICAgIExWTV9DYWxsYmFjayBwQ2FsbEJhY2syOworfSBNaXhfMlN0X0NsbF9GTE9BVF90OworI2Vsc2UKIHR5cGVkZWYgc3RydWN0CiB7CiAgICAgTFZNX0lOVDMyICAgQWxwaGE7ICAgICAgICAgICAgICAgICAgICAvKiBUaW1lIGNvbnN0YW50LiBTZXQgYnkgY2FsbGluZyBhcHBsaWNhdGlvbi4gIENhbiBiZSBjaGFuZ2VkIGF0IGFueSB0aW1lICovCkBAIC02NCw5ICsxMDEsMzUgQEAKIAogfSBNaXhfMlN0X0NsbF90OwogCisjZW5kaWYKIAogLyoqKiBHZW5lcmFsIGZ1bmN0aW9ucyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQlVJTERfRkxPQVQKIAorTFZNX0ZMT0FUIExWTV9NaXhlcl9UaW1lQ29uc3RhbnQoTFZNX1VJTlQzMiAgIHRjLAorI2lmZGVmIEhJR0hFUl9GUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQzMiAgIEZzLAorI2Vsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgICBGcywKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiAgIE51bUNoYW5uZWxzKTsKKwordm9pZCBNaXhTb2Z0XzFTdF9EMzJDMzFfV1JBKCAgICBNaXhfMVN0X0NsbF9GTE9BVF90ICAgICAgICpwSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9GTE9BVCAgICAgKnNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAqZHN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgIG4pOworCit2b2lkIE1peFNvZnRfMlN0X0QzMkMzMV9TQVQoICAgIE1peF8yU3RfQ2xsX0ZMT0FUX3QgICAgICAgKnBJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICAgICAqc3JjMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICAgICAqc3JjMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAqZHN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgIG4pOworCit2b2lkIE1peEluU29mdF9EMzJDMzFfU0FUKCAgICAgIE1peF8xU3RfQ2xsX0ZMT0FUX3QgICAgICAgKnBJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICAgICAqc3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICpkc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgbik7CisjZWxzZQogTFZNX1VJTlQzMiBMVk1fTWl4ZXJfVGltZUNvbnN0YW50KExWTV9VSU5UMzIgICB0YywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDE2ICAgRnMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiAgIE51bUNoYW5uZWxzKTsKQEAgLTg4LDEwICsxNTEsMjYgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAqZHN0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgIG4pOwogCisjZW5kaWYKKwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICAgIEZVTkNUSU9OIFBST1RPVFlQRVMgKExPVyBMRVZFTCBTVUJGVU5DVElPTlMpCiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQorI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIENvcmVfTWl4U29mdF8xU3RfRDMyQzMxX1dSQSggICBNaXhfMVN0X0NsbF9GTE9BVF90ICAgICAgICpwSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fRkxPQVQgICAgICpzcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICpkc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgIG4pOwordm9pZCBDb3JlX01peEhhcmRfMlN0X0QzMkMzMV9TQVQoICAgTWl4XzJTdF9DbGxfRkxPQVRfdCAgICAgICAqcEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICAgICAqc3JjMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9GTE9BVCAgICAgKnNyYzIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICpkc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgIG4pOwordm9pZCBDb3JlX01peEluU29mdF9EMzJDMzFfU0FUKCAgICAgTWl4XzFTdF9DbGxfRkxPQVRfdCAgICAgICAqcEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICAgICAqc3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAqZHN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICBuKTsKKyNlbHNlCiB2b2lkIENvcmVfTWl4U29mdF8xU3RfRDMyQzMxX1dSQSggICBNaXhfMVN0X0NsbF90ICAgICAgICpwSW5zdGFuY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMzIgICAgICpzcmMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgICpkc3QsCkBAIC0xMDcsNiArMTg2LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQzMiAgICAgKnNyYywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgKmRzdCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgbik7CisjZW5kaWYKICNpZmRlZiBfX2NwbHVzcGx1cwogfQogI2VuZGlmIC8qIF9fY3BsdXNwbHVzICovCkBAIC0xMTUsMTMgKzE5NSwzIEBACiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogI2VuZGlmIC8qIF9fTUlYRVJfSF9fICovCi0KLQotCi0KLQotCi0KLQotCi0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vbGliL1NjYWxhckFyaXRobWV0aWMuaCBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vbGliL1NjYWxhckFyaXRobWV0aWMuaAppbmRleCAzZDYyNzA0Li5jZGIzODM3IDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL2xpYi9TY2FsYXJBcml0aG1ldGljLmgKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9saWIvU2NhbGFyQXJpdGhtZXRpYy5oCkBAIC0zNCw3ICszNCwxMiBAQAogLyojIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyovCiAKIC8qIEFic29sdXRlIHZhbHVlIGluY2x1ZGluZyB0aGUgY29ybmVyIGNhc2UgZm9yIHRoZSBleHRyZW1lIG5lZ2F0aXZlIHZhbHVlICovCisKKyNpZmRlZiBCVUlMRF9GTE9BVAorTFZNX0ZMT0FUICAgQWJzX0Zsb2F0KExWTV9GTE9BVCAgICAgaW5wdXQpOworI2Vsc2UKIExWTV9JTlQzMiAgIEFic18zMihMVk1fSU5UMzIgICAgIGlucHV0KTsKKyNlbmRpZgogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICogIE5hbWUgICAgICAgIDogZEJfdG9fTGluMzIoKQpAQCAtNDgsOCArNTMsMTEgQEAKICAqICAgICAgICAgICAgICAgICAgKDE1LT4wMSkgPSBkZWNpbWFsIHBhcnQKICAqICBSZXR1cm5zICAgICA6IExpbiB2YWx1ZSBmb3JtYXQgMS4xNi4xNQogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KKyNpZmRlZiBCVUlMRF9GTE9BVAorTFZNX0ZMT0FUIGRCX3RvX0xpbkZsb2F0KExWTV9JTlQxNiAgICBkYl9maXgpOworI2Vsc2UKIExWTV9JTlQzMiBkQl90b19MaW4zMihMVk1fSU5UMTYgIGRiX2ZpeCk7CisjZW5kaWYKIAogI2lmZGVmIF9fY3BsdXNwbHVzCiB9CmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL2xpYi9WZWN0b3JBcml0aG1ldGljLmggYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL2xpYi9WZWN0b3JBcml0aG1ldGljLmgKaW5kZXggMmI3OTFiZC4uMGJhMjBhMyAxMDA2NDQKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9saWIvVmVjdG9yQXJpdGhtZXRpYy5oCisrKyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vbGliL1ZlY3RvckFyaXRobWV0aWMuaApAQCAtMjksNiArMjksMTEgQEAKICAgICBWQVJJT1VTIEZVTkNUSU9OUwogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBMb2FkQ29uc3RfRmxvYXQoICAgICAgICAgIGNvbnN0IExWTV9GTE9BVCB2YWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICpkc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2IG4gKTsKKyNlbHNlCiB2b2lkIExvYWRDb25zdF8xNiggICAgICAgICAgICBjb25zdCBMVk1fSU5UMTYgdmFsLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICpkc3QsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgbiApOwpAQCAtMzYsMTAgKzQxLDE3IEBACiB2b2lkIExvYWRDb25zdF8zMiggICAgICAgICAgICBjb25zdCBMVk1fSU5UMzIgdmFsLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICpkc3QsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgbiApOworI2VuZGlmCiAKKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBDb3B5X0Zsb2F0KCAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICpzcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgKmRzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBuICk7CisjZWxzZQogdm9pZCBDb3B5XzE2KCAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICpzcmMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgKmRzdCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBuICk7CisjZW5kaWYKIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICogbm90ZTogSW4gTXVsdDNzXzE2eDE2KCkgc2F0dXJhdGlvbiBvZiByZXN1bHQgaXMgbm90IHRha2VuIGNhcmUgd2hlbiAgICAgICAgICAgKgpAQCAtNDksMTAgKzYxLDE3IEBACiAgKiAgICAgICBUaGlzIGlzIHRoZSBvbmx5IGNhc2Ugd2hpY2ggd2lsbCBnaXZlIHdyb25nIHJlc3VsdC4gICAgICAgICAgICAgICAgICAgICAqCiAgKiAgICAgICBGb3IgbW9yZSBpbmZvcm1hdGlvbiByZWZlciB0byBWZWN0b3JfQXJpdGhtZXRpYy5kb2MgaW4gL2RvYyBmb2xkZXIgICAgICAqCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIE11bHQzc19GbG9hdCggICAgICAgICAgICBjb25zdCBMVk1fRkxPQVQgKnNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9GTE9BVCB2YWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgKmRzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBuKTsKKyNlbHNlCiB2b2lkIE11bHQzc18xNngxNiggICAgICAgICAgICBjb25zdCBMVk1fSU5UMTYgKnNyYywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiB2YWwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgKmRzdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAqZHN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2IG4pOworI2VuZGlmCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICAqIG5vdGU6IEluIE11bHQzc18zMngxNigpIHNhdHVyYXRpb24gb2YgcmVzdWx0IGlzIG5vdCB0YWtlbiBjYXJlIHdoZW4gICAgICAgICAgICoKQEAgLTY2LDIwICs4NSwzMSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2IHZhbCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgKmRzdCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBuKTsKLQorI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIERlbGF5TWl4X0Zsb2F0KGNvbnN0IExWTV9GTE9BVCAqc3JjLCAgICAgICAgICAgLyogU291cmNlIDEsIHRvIGJlIGRlbGF5ZWQgKi8KKyAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICpkZWxheSwgICAgICAgICAvKiBEZWxheSBidWZmZXIgKi8KKyAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2IHNpemUsICAgICAgICAgICAvKiBEZWxheSBzaXplICovCisgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAqZHN0LCAgICAgICAgICAgLyogU291cmNlL2Rlc3RpbmF0aW9uICovCisgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAqcE9mZnNldCwgICAgICAgLyogRGVsYXkgb2Zmc2V0ICovCisgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBuKSAgOyAgICAgICAgICAgIC8qIE51bWJlciBvZiBzdGVyZW8gc2FtcGxlcyAqLworI2Vsc2UKIHZvaWQgRGVsYXlNaXhfMTZ4MTYoICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiAqc3JjLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICpkZWxheSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBzaXplLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICpkc3QsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgKnBPZmZzZXQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgbik7Ci0KKyNlbmRpZgogdm9pZCBEZWxheVdyaXRlXzMyKCAgICAgICAgICAgY29uc3QgTFZNX0lOVDMyICAqc3JjLCAgICAgICAgICAgICAgIC8qIFNvdXJjZSAxLCB0byBiZSBkZWxheWVkICovCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICpkZWxheSwgICAgICAgICAgICAgLyogRGVsYXkgYnVmZmVyICovCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDE2IHNpemUsICAgICAgICAgICAgICAgLyogRGVsYXkgc2l6ZSAqLwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiAqcE9mZnNldCwgICAgICAgICAgIC8qIERlbGF5IG9mZnNldCAqLwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2IG4pOwotCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgQWRkMl9TYXRfRmxvYXQoICAgICAgICAgIGNvbnN0IExWTV9GTE9BVCAqc3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICpkc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgbiApOworI2Vsc2UKIHZvaWQgQWRkMl9TYXRfMTZ4MTYoICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiAqc3JjLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICpkc3QsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgbiApOwpAQCAtODcsNyArMTE3LDEzIEBACiB2b2lkIEFkZDJfU2F0XzMyeDMyKCAgICAgICAgICBjb25zdCBMVk1fSU5UMzIgICpzcmMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICpkc3QsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgbiApOwotCisjZW5kaWYKKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBNYWMzc19TYXRfRmxvYXQoICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICpzcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fRkxPQVQgdmFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICpkc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgbik7CisjZWxzZQogdm9pZCBNYWMzc19TYXRfMTZ4MTYoICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICpzcmMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMTYgdmFsLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICpkc3QsCkBAIC05Nyw3ICsxMzMsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2IHZhbCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgKmRzdCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBuKTsKLQorI2VuZGlmCiB2b2lkIERlbGF5QWxsUGFzc19TYXRfMzJ4MTZUbzMyKCAgICBMVk1fSU5UMzIgICpkZWxheSwgICAgICAgICAgICAgIC8qIERlbGF5IGJ1ZmZlciAqLwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiBzaXplLCAgICAgICAgICAgICAgICAvKiBEZWxheSBzaXplICovCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgY29lZmYsICAgICAgICAgICAgICAgIC8qIEFsbCBwYXNzIGZpbHRlciBjb2VmZmljaWVudCAqLwpAQCAtMTA5LDcgKzE0NSwxMiBAQAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICAgICBTSElGVCBGVU5DVElPTlMKICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgU2hpZnRfU2F0X0Zsb2F0IChjb25zdCAgIExWTV9JTlQxNiAgIHZhbCwKKyAgICAgICAgICAgICAgICAgICAgICBjb25zdCAgIExWTV9GTE9BVCAgICpzcmMsCisgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgKmRzdCwKKyAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICBuKTsKKyNlbHNlCiB2b2lkIFNoaWZ0X1NhdF92MTZ4djE2ICggICAgICBjb25zdCBMVk1fSU5UMTYgdmFsLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICpzcmMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgKmRzdCwKQEAgLTExOSwxMSArMTYwLDE1IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMzIgKnNyYywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAqZHN0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2IG4pOwotCisjZW5kaWYKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgICAgQVVESU8gRk9STUFUIENPTlZFUlNJT04gRlVOQ1RJT05TCiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQorI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIE1vbm9UbzJJX0Zsb2F0KCBjb25zdCBMVk1fRkxPQVQgICAgICpzcmMsCisgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICpkc3QsCisgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgbik7CisjZWxzZQogdm9pZCBNb25vVG8ySV8xNiggICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICpzcmMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgKmRzdCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBuKTsKQEAgLTEzMSwyOSArMTc2LDUyIEBACiB2b2lkIE1vbm9UbzJJXzMyKCAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMzIgICpzcmMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICpkc3QsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgbik7Ci0KKyNlbmRpZgorI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIEZyb20yaVRvTW9ub19GbG9hdCggICAgICAgICBjb25zdCBMVk1fRkxPQVQgICpzcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICpkc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgbik7CisjZWxzZQogdm9pZCBGcm9tMmlUb01vbm9fMzIoICAgICAgICAgY29uc3QgTFZNX0lOVDMyICAqc3JjLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAqZHN0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2IG4pOwotCisjZW5kaWYKKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBNU1RvMmlfU2F0X0Zsb2F0KCAgICAgICAgY29uc3QgTFZNX0ZMT0FUICpzcmNNLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICpzcmNTLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICpkc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgbiApOworI2Vsc2UKIHZvaWQgTVNUbzJpX1NhdF8xNngxNiggICAgICAgIGNvbnN0IExWTV9JTlQxNiAqc3JjTSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiAqc3JjUywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAqZHN0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2IG4gKTsKLQorI2VuZGlmCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgRnJvbTJpVG9NU19GbG9hdCggICAgICAgIGNvbnN0IExWTV9GTE9BVCAqc3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICpkc3RNLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICpkc3RTLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2IG4gKTsKKyNlbHNlCiB2b2lkIEZyb20yaVRvTVNfMTZ4MTYoICAgICAgICBjb25zdCBMVk1fSU5UMTYgKnNyYywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAqZHN0TSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAqZHN0UywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBuICk7Ci0KKyNlbmRpZgorI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIEpvaW5UbzJpX0Zsb2F0KCAgICAgICAgICBjb25zdCBMVk1fRkxPQVQgICpzcmNMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICAqc3JjUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgKmRzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBuICk7CisjZWxzZQogdm9pZCBGcm9tMmlUb01vbm9fMTYoICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICpzcmMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgKmRzdCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBuKTsKLQogdm9pZCBKb2luVG8yaV8zMngzMiggICAgICAgICAgY29uc3QgTFZNX0lOVDMyICAqc3JjTCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQzMiAgKnNyY1IsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICpkc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgbiApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAqZHN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2IG4gKTsKKyNlbmRpZgogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICAgIERBVEEgVFlQRSBDT05WRVJTSU9OIEZVTkNUSU9OUwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvQUdDX01JWF9WT0xfMlN0MU1vbl9EMzJfV1JBLmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9BR0NfTUlYX1ZPTF8yU3QxTW9uX0QzMl9XUkEuYwppbmRleCA5MjBiNTE1Li5mYTlmMDFmIDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9BR0NfTUlYX1ZPTF8yU3QxTW9uX0QzMl9XUkEuYworKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9BR0NfTUlYX1ZPTF8yU3QxTW9uX0QzMl9XUkEuYwpAQCAtMzMsNyArMzMsMTAgQEAKIAogI2RlZmluZSBWT0xfVENfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjEgICAgICAgICAgLyogQXMgYSBwb3dlciBvZiAyICovCiAjZGVmaW5lIERFQ0FZX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwICAgICAgICAgICAvKiBBcyBhIHBvd2VyIG9mIDIgKi8KLQorI2lmZGVmIEJVSUxEX0ZMT0FUCisjZGVmaW5lIFZPTF9UQ19GTE9BVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMi4wZiAgICAgICAgICAvKiBBcyBhIHBvd2VyIG9mIDIgKi8KKyNkZWZpbmUgREVDQVlfRkFDX0ZMT0FUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDY0LjBmICAgICAgICAgIC8qIEFzIGEgcG93ZXIgb2YgMiAqLworI2VuZGlmCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCkBAIC02OSw3ICs3Miw3IEBACiAvKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KKyNpZm5kZWYgQlVJTERfRkxPQVQKIHZvaWQgQUdDX01JWF9WT0xfMlN0MU1vbl9EMzJfV1JBKEFHQ19NSVhfVk9MXzJTdDFNb25fRDMyX3QgICpwSW5zdGFuY2UsICAgICAvKiBJbnN0YW5jZSBwb2ludGVyICovCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMzIgICAgICAgICAgICAqcFN0U3JjLCAgICAgICAgLyogU3RlcmVvIHNvdXJjZSAqLwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDMyICAgICAgICAgICAgKnBNb25vU3JjLCAgICAgIC8qIE1vbm8gc291cmNlICovCkBAIC0xOTMsNCArMTk2LDExMyBAQAogCiAgICAgcmV0dXJuOwogfQorI2Vsc2UKK3ZvaWQgQUdDX01JWF9WT0xfMlN0MU1vbl9EMzJfV1JBKEFHQ19NSVhfVk9MXzJTdDFNb25fRkxPQVRfdCAgKnBJbnN0YW5jZSwgICAgIC8qIEluc3RhbmNlIHBvaW50ZXIgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9GTE9BVCAgICAgICAgICAgICpwU3RTcmMsICAgICAgICAvKiBTdGVyZW8gc291cmNlICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fRkxPQVQgICAgICAgICAgICAqcE1vbm9TcmMsICAgICAgLyogTW9ubyBzb3VyY2UgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICAgICpwRHN0LCAgICAgICAgICAvKiBTdGVyZW8gZGVzdGluYXRpb24gKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgICAgICAgICAgICAgICAgIE51bVNhbXBsZXMpICAgICAvKiBOdW1iZXIgb2Ygc2FtcGxlcyAqLworewogCisgICAgLyoKKyAgICAgKiBHZW5lcmFsIHZhcmlhYmxlcworICAgICAqLworICAgIExWTV9VSU5UMTYgICAgICBpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFNhbXBsZSBpbmRleCAqLworICAgIExWTV9GTE9BVCAgICAgICBMZWZ0OyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIExlZnQgc2FtcGxlICovCisgICAgTFZNX0ZMT0FUICAgICAgIFJpZ2h0OyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogUmlnaHQgc2FtcGxlICovCisgICAgTFZNX0ZMT0FUICAgICAgIE1vbm87ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTW9ubyBzYW1wbGUgKi8KKyAgICBMVk1fRkxPQVQgICAgICAgQWJzUGVhazsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBBYnNvbHV0ZSBwZWFrIHNpZ25hbCAqLworICAgIExWTV9GTE9BVCAgICAgICBBR0NfTXVsdDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFNob3J0IEFHQyBnYWluICovCisgICAgTFZNX0ZMT0FUICAgICAgIFZvbF9NdWx0OyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogU2hvcnQgdm9sdW1lICovCisKKworICAgIC8qCisgICAgICogSW5zdGFuY2UgY29udHJvbCB2YXJpYWJsZXMKKyAgICAgKi8KKyAgICBMVk1fRkxPQVQgICAgICBBR0NfR2FpbiAgICAgID0gcEluc3RhbmNlLT5BR0NfR2FpbjsgICAgICAgICAvKiBHZXQgdGhlIGN1cnJlbnQgQUdDIGdhaW4gKi8KKyAgICBMVk1fRkxPQVQgICAgICBBR0NfTWF4R2FpbiAgID0gcEluc3RhbmNlLT5BR0NfTWF4R2FpbjsgICAgICAvKiBHZXQgbWF4aW11bSBBR0MgZ2FpbiAqLworICAgIExWTV9GTE9BVCAgICAgIEFHQ19BdHRhY2sgICAgPSBwSW5zdGFuY2UtPkFHQ19BdHRhY2s7ICAgICAgIC8qIEF0dGFjayBzY2FsZXIgKi8KKyAgICBMVk1fRkxPQVQgICAgICBBR0NfRGVjYXkgICAgID0gKHBJbnN0YW5jZS0+QUdDX0RlY2F5ICogKDEgPDwgKERFQ0FZX1NISUZUKSkpOy8qIERlY2F5IHNjYWxlciAqLworICAgIExWTV9GTE9BVCAgICAgIEFHQ19UYXJnZXQgICAgPSBwSW5zdGFuY2UtPkFHQ19UYXJnZXQ7ICAgICAgIC8qIEdldCB0aGUgdGFyZ2V0IGxldmVsICovCisgICAgTFZNX0ZMT0FUICAgICAgVm9sX0N1cnJlbnQgICA9IHBJbnN0YW5jZS0+Vm9sdW1lOyAgICAgICAgICAgLyogQWN0dWFsIHZvbHVtZSBzZXR0aW5nICovCisgICAgTFZNX0ZMT0FUICAgICAgVm9sX1RhcmdldCAgICA9IHBJbnN0YW5jZS0+VGFyZ2V0OyAgICAgICAgICAgLyogVGFyZ2V0IHZvbHVtZSBzZXR0aW5nICovCisgICAgTFZNX0ZMT0FUICAgICAgVm9sX1RDICAgICAgICA9IHBJbnN0YW5jZS0+Vm9sdW1lVEM7ICAgICAgICAgLyogVGltZSBjb25zdGFudCAqLworCisKKyAgICAvKgorICAgICAqIFByb2Nlc3Mgb24gYSBzYW1wbGUgYnkgc2FtcGxlIGJhc2lzCisgICAgICovCisgICAgZm9yIChpID0gMDsgaSA8IE51bVNhbXBsZXM7IGkrKykgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRm9yIGVhY2ggc2FtcGxlICovCisgICAgeworCisgICAgICAgIC8qCisgICAgICAgICAqIEdldCB0aGUgc2hvcnQgc2NhbGVycworICAgICAgICAgKi8KKyAgICAgICAgQUdDX011bHQgICAgPSAoTFZNX0ZMT0FUKShBR0NfR2Fpbik7ICAgICAgICAgICAgICAvKiBHZXQgdGhlIHNob3J0IEFHQyBnYWluICovCisgICAgICAgIFZvbF9NdWx0ICAgID0gKExWTV9GTE9BVCkoVm9sX0N1cnJlbnQpOyAgICAgICAgICAgLyogR2V0IHRoZSBzaG9ydCB2b2x1bWUgZ2FpbiAqLworCisKKyAgICAgICAgLyoKKyAgICAgICAgICogR2V0IHRoZSBpbnB1dCBzYW1wbGVzCisgICAgICAgICAqLworICAgICAgICBMZWZ0ICA9ICpwU3RTcmMrKzsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgbGVmdCBzYW1wbGUgKi8KKyAgICAgICAgUmlnaHQgPSAqcFN0U3JjKys7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHJpZ2h0IHNhbXBsZSAqLworICAgICAgICBNb25vICA9ICpwTW9ub1NyYysrOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgbW9ubyBzYW1wbGUgKi8KKworCisgICAgICAgIC8qCisgICAgICAgICAqIEFwcGx5IHRoZSBBR0MgZ2FpbiB0byB0aGUgbW9ubyBpbnB1dCBhbmQgbWl4IHdpdGggdGhlIHN0ZXJlbyBzaWduYWwKKyAgICAgICAgICovCisgICAgICAgIExlZnQgICs9IChNb25vICogQUdDX011bHQpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBNaXggaW4gdGhlIG1vbm8gc2lnbmFsICovCisgICAgICAgIFJpZ2h0ICs9IChNb25vICogQUdDX011bHQpOworCisgICAgICAgIC8qCisgICAgICAgICAqIEFwcGx5IHRoZSB2b2x1bWUgYW5kIHdyaXRlIHRvIHRoZSBvdXRwdXQgc3RyZWFtCisgICAgICAgICAqLworICAgICAgICBMZWZ0ICA9IExlZnQgICogVm9sX011bHQ7CisgICAgICAgIFJpZ2h0ID0gUmlnaHQgKiBWb2xfTXVsdDsKKyAgICAgICAgKnBEc3QrKyA9IExlZnQ7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBTYXZlIHRoZSByZXN1bHRzICovCisgICAgICAgICpwRHN0KysgPSBSaWdodDsKKworICAgICAgICAvKgorICAgICAgICAgKiBVcGRhdGUgdGhlIEFHQyBnYWluCisgICAgICAgICAqLworICAgICAgICBBYnNQZWFrID0gQWJzX0Zsb2F0KExlZnQpID4gQWJzX0Zsb2F0KFJpZ2h0KSA/IEFic19GbG9hdChMZWZ0KSA6IEFic19GbG9hdChSaWdodCk7CisgICAgICAgIGlmIChBYnNQZWFrID4gQUdDX1RhcmdldCkKKyAgICAgICAgeworICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAqIFRoZSBzaWduYWwgaXMgdG9vIGxhcmdlIHNvIGRlY3JlYXNlIHRoZSBnYWluCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIEFHQ19HYWluID0gQUdDX0dhaW4gKiBBR0NfQXR0YWNrOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAqIFRoZSBzaWduYWwgaXMgdG9vIHNtYWxsIHNvIGluY3JlYXNlIHRoZSBnYWluCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGlmIChBR0NfR2FpbiA+IEFHQ19NYXhHYWluKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEFHQ19HYWluIC09IChBR0NfRGVjYXkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEFHQ19HYWluICs9IChBR0NfRGVjYXkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLyoKKyAgICAgICAgICogVXBkYXRlIHRoZSBnYWluCisgICAgICAgICAqLworICAgICAgICBWb2xfQ3VycmVudCArPSAgKFZvbF9UYXJnZXQgLSBWb2xfQ3VycmVudCkgKiAoKExWTV9GTE9BVClWb2xfVEMgLyBWT0xfVENfRkxPQVQpOworICAgIH0KKworCisgICAgLyoKKyAgICAgKiBVcGRhdGUgdGhlIHBhcmFtZXRlcnMKKyAgICAgKi8KKyAgICBwSW5zdGFuY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lhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0FkZDJfU2F0XzMyeDMyLmMKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvQWRkMl9TYXRfMzJ4MzIuYwpAQCAtNTcsNCArNTcsMzMgQEAKICAgICByZXR1cm47CiB9CiAKKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBBZGQyX1NhdF9GbG9hdCggY29uc3QgTFZNX0ZMT0FUICAqc3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAqZHN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICBuICkKK3sKKyAgICBMVk1fRkxPQVQgVGVtcDsKKyAgICBMVk1fSU5UMTYgaWk7CisgICAgZm9yIChpaSA9IG47IGlpICE9IDA7IGlpLS0pCisgICAgeworICAgICAgICBUZW1wID0gKChMVk1fRkxPQVQpICpzcmMpICsgKChMVk1fRkxPQVQpICpkc3QpOworICAgICAgICBzcmMrKzsKKworICAgICAgICBpZiAoVGVtcCA+IDEuMDAwMDAwZikKKyAgICAgICAgeworICAgICAgICAgICAgKmRzdCA9IDEuMDAwMDAwZjsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChUZW1wIDwgLTEuMDAwMDAwZikKKyAgICAgICAgeworICAgICAgICAgICAgKmRzdCA9IC0xLjAwMDAwMGY7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICAqZHN0ID0gVGVtcDsKKyAgICAgICAgfQorICAgICAgICBkc3QrKzsKKyAgICB9CisgICAgcmV0dXJuOworfQorI2VuZGlmCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0JQXzFJX0QxNkYxNkMxNF9UUkNfV1JBXzAxLmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9CUF8xSV9EMTZGMTZDMTRfVFJDX1dSQV8wMS5jCmluZGV4IGY0YzU3NTcuLjg4Zjk5ODYgMTAwNjQ0Ci0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0JQXzFJX0QxNkYxNkMxNF9UUkNfV1JBXzAxLmMKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvQlBfMUlfRDE2RjE2QzE0X1RSQ19XUkFfMDEuYwpAQCAtMzMsNyArMzMsNTEgQEAKICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMl0gaXMgeShuLTEpTCBpbiBRMCBmb3JtYXQKICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbM10gaXMgeShuLTIpTCBpbiBRMCBmb3JtYXQKICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBCUF8xSV9EMTZGMTZDMTRfVFJDX1dSQV8wMSAoIEJpcXVhZF9GTE9BVF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICAgKnBEYXRhSW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICAgKnBEYXRhT3V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgIE5yU2FtcGxlcykKIAorCisgICAgeworICAgICAgICBMVk1fRkxPQVQgeW5MOworICAgICAgICBMVk1fSU5UMTYgaWk7CisgICAgICAgIFBGaWx0ZXJfU3RhdGVfRkxPQVQgcEJpcXVhZFN0YXRlID0gKFBGaWx0ZXJfU3RhdGVfRkxPQVQpIHBJbnN0YW5jZTsKKworICAgICAgICAgZm9yIChpaSA9IE5yU2FtcGxlczsgaWkgIT0gMDsgaWktLSkKKyAgICAgICAgIHsKKworCisgICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBQUk9DRVNTSU5HIE9GIFRIRSBMRUZUIENIQU5ORUwKKyAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyAgICAgICAgICAgIC8vIHluTD0gKEEwICAqICh4KG4pTCAgLSB4KG4tMilMICApICkKKyAgICAgICAgICAgIHluTCA9IHBCaXF1YWRTdGF0ZS0+Y29lZnNbMF0gKiAoKCpwRGF0YUluKS1wQmlxdWFkU3RhdGUtPnBEZWxheXNbMV0pOworCisgICAgICAgICAgICAvLyB5bkwrPSAoKC1CMiAgKiB5KG4tMilMICApICkKKyAgICAgICAgICAgIHluTCArPSBwQmlxdWFkU3RhdGUtPmNvZWZzWzFdICogcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzNdOworCisgICAgICAgICAgICAvLyB5bkwrPSAoKC1CMSAgKiB5KG4tMSlMICApICkKKyAgICAgICAgICAgIHluTCArPSBwQmlxdWFkU3RhdGUtPmNvZWZzWzJdICogcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzJdOworCisgICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBVUERBVElORyBUSEUgREVMQVlTCisgICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbM10gPSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMl07IC8vIHkobi0yKUw9eShuLTEpTAorICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzFdID0gcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzBdOyAvLyB4KG4tMilMPXgobi0xKUwKKyAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXSA9IHluTDsgLy8gVXBkYXRlIHkobi0xKUwKKyAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXSA9ICgqcERhdGFJbisrKTsgLy8gVXBkYXRlIHgobi0xKUwKKworICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgV1JJVElORyBUSEUgT1VUUFVUCisgICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgICAgICAgICAqcERhdGFPdXQrKz15bkw7IC8vIFdyaXRlIExlZnQgb3V0cHV0CisKKyAgICAgICAgfQorCisgICAgfQorI2Vsc2UKIHZvaWQgQlBfMUlfRDE2RjE2QzE0X1RSQ19XUkFfMDEgKCBCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICpwRGF0YUluLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICpwRGF0YU91dCwKQEAgLTc4LDQgKzEyMiw1IEBACiAgICAgICAgIH0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bW1vbi9zcmMvQlBfMUlfRDE2RjMyQzMwX1RSQ19XUkFfMDEuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0JQXzFJX0QxNkYzMkMzMF9UUkNfV1JBXzAxLmMKaW5kZXggYmExYTQyZi4uM2FiZGQ0MyAxMDA2NDQKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvQlBfMUlfRDE2RjMyQzMwX1RSQ19XUkFfMDEuYworKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9CUF8xSV9EMTZGMzJDMzBfVFJDX1dSQV8wMS5jCkBAIC0zMyw3ICszMyw0OCBAQAogIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXSBpcyB5KG4tMSlMIGluIFExNiBmb3JtYXQKICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbM10gaXMgeShuLTIpTCBpbiBRMTYgZm9ybWF0CiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgQlBfMUlfRDE2RjMyQzMwX1RSQ19XUkFfMDEgKCBCaXF1YWRfRkxPQVRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICpwRGF0YUluLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICpwRGF0YU91dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBOclNhbXBsZXMpCit7CisgICAgTFZNX0ZMT0FUIHluTCx0ZW1wbDsKKyAgICBMVk1fSU5UMTYgaWk7CisgICAgUEZpbHRlcl9TdGF0ZV9GTE9BVCBwQmlxdWFkU3RhdGUgPSAoUEZpbHRlcl9TdGF0ZV9GTE9BVClwSW5zdGFuY2U7CiAKKyAgICBmb3IgKGlpID0gTnJTYW1wbGVzOyBpaSAhPSAwOyBpaS0tKQorICAgIHsKKyAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgIFBST0NFU1NJTkcgT0YgVEhFIExFRlQgQ0hBTk5FTAorICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgICAgIC8vIHluTD0gKEEwICogKHgobilMIC0geChuLTIpTCApKQorICAgICAgICB0ZW1wbCA9IChMVk1fRkxPQVQpICpwRGF0YUluIC0gcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzFdOworICAgICAgICB5bkwgPSBwQmlxdWFkU3RhdGUtPmNvZWZzWzBdICogdGVtcGw7CisKKyAgICAgICAgLy8geW5MKz0gKCgtQjIgICogeShuLTIpTCAgKSApCisgICAgICAgIHRlbXBsID0gcEJpcXVhZFN0YXRlLT5jb2Vmc1sxXSAqIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1szXTsKKyAgICAgICAgeW5MICs9IHRlbXBsOworCisgICAgICAgIC8vIHluTCs9ICgoLUIxICAqIHkobi0xKUwgICkpCisgICAgICAgIHRlbXBsID0gcEJpcXVhZFN0YXRlLT5jb2Vmc1syXSAqIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXTsKKyAgICAgICAgeW5MICs9IHRlbXBsOworCisgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgVVBEQVRJTkcgVEhFIERFTEFZUworICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1szXSA9IHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXTsgLy8geShuLTIpTD15KG4tMSlMCisgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1sxXSA9IHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXTsgLy8geChuLTIpTD14KG4tMSlMCisgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXSA9IHluTDsgLy8gVXBkYXRlIHkobi0xKUwgaW4gUTE2CisgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXSA9ICgqcERhdGFJbisrKTsgLy8gVXBkYXRlIHgobi0xKUwgaW4gUTAKKworICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgIFdSSVRJTkcgVEhFIE9VVFBVVAorICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgICAgICpwRGF0YU91dCsrID0gKHluTCk7IC8vIFdyaXRlIExlZnQgb3V0cHV0CisgICAgICAgIH0KK30KKyNlbHNlCiB2b2lkIEJQXzFJX0QxNkYzMkMzMF9UUkNfV1JBXzAxICggQmlxdWFkX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAqcERhdGFJbiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAqcERhdGFPdXQsCkBAIC04MCw0ICsxMjEsNCBAQAogICA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FURV9IXyovCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9CUF8xSV9EMzJGMzJDMzBfVFJDX1dSQV8wMi5jIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvQlBfMUlfRDMyRjMyQzMwX1RSQ19XUkFfMDIuYwppbmRleCBiMDljMWFhLi5hYmRiMmY3IDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9CUF8xSV9EMzJGMzJDMzBfVFJDX1dSQV8wMi5jCisrKyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0JQXzFJX0QzMkYzMkMzMF9UUkNfV1JBXzAyLmMKQEAgLTMzLDcgKzMzLDUyIEBACiAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzJdIGlzIHkobi0xKUwgaW4gUTAgZm9ybWF0CiAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzNdIGlzIHkobi0yKUwgaW4gUTAgZm9ybWF0CiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgQlBfMUlfRDMyRjMyQzMwX1RSQ19XUkFfMDIgKCBCaXF1YWRfRkxPQVRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICpwRGF0YUluLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICpwRGF0YU91dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBOclNhbXBsZXMpCisgICAgeworICAgICAgICBMVk1fRkxPQVQgeW5MLHRlbXBsOworICAgICAgICBMVk1fSU5UMTYgaWk7CisgICAgICAgIFBGaWx0ZXJfU3RhdGVfRkxPQVQgcEJpcXVhZFN0YXRlID0gKFBGaWx0ZXJfU3RhdGVfRkxPQVQpIHBJbnN0YW5jZTsKIAorICAgICAgICBmb3IgKGlpID0gTnJTYW1wbGVzOyBpaSAhPSAwOyBpaS0tKQorICAgICAgICB7CisKKworICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgUFJPQ0VTU0lORyBPRiBUSEUgTEVGVCBDSEFOTkVMCisgICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgICAgICAgICAvLyB5bkw9IChBMCAgKiAoeChuKUwgIC0geChuLTIpTCAgKSApCisgICAgICAgICAgICB0ZW1wbCA9ICgqcERhdGFJbikgLSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMV07CisgICAgICAgICAgICB5bkwgPSBwQmlxdWFkU3RhdGUtPmNvZWZzWzBdICogdGVtcGw7CisKKyAgICAgICAgICAgIC8vIHluTCs9ICgoLUIyICAqIHkobi0yKUwgICkgKQorICAgICAgICAgICAgdGVtcGwgPSBwQmlxdWFkU3RhdGUtPmNvZWZzWzFdICogcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzNdOworICAgICAgICAgICAgeW5MICs9IHRlbXBsOworCisgICAgICAgICAgICAvLyB5bkwrPSAoKC1CMSAgKiB5KG4tMSlMICApICkKKyAgICAgICAgICAgIHRlbXBsID0gcEJpcXVhZFN0YXRlLT5jb2Vmc1syXSAqIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXTsKKyAgICAgICAgICAgIHluTCArPSB0ZW1wbDsKKworICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgVVBEQVRJTkcgVEhFIERFTEFZUworICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzNdID0gcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzJdOyAvLyB5KG4tMilMPXkobi0xKUwKKyAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1sxXSA9IHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXTsgLy8geChuLTIpTD14KG4tMSlMCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMl0gPSB5bkw7IC8vIFVwZGF0ZSB5KG4tMSlMCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMF0gPSAoKnBEYXRhSW4rKyk7IC8vIFVwZGF0ZSB4KG4tMSlMCisKKyAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdSSVRJTkcgVEhFIE9VVFBVVAorICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworICAgICAgICAgICAgKnBEYXRhT3V0KysgPSB5bkw7IC8vIFdyaXRlIExlZnQgb3V0cHV0IGluIFEwCisKKyAgICAgICAgfQorCisgICAgfQorI2Vsc2UKIHZvaWQgQlBfMUlfRDMyRjMyQzMwX1RSQ19XUkFfMDIgKCBCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAqcEluc3Rhbm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ICBCaXF1YWRfRkxPQVRfSW5zdGFuY2VfdCAgICAgICAgICpwSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJpcXVhZF8xSV9PcmRlcjJfRkxPQVRfVGFwc190ICAgKnBUYXBzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCUF9GTE9BVF9Db2Vmc190ICAgICAgICAgICAgKnBDb2VmKQoreworICAgIFBGaWx0ZXJfU3RhdGVfRkxPQVQgcEJpcXVhZFN0YXRlID0gKFBGaWx0ZXJfU3RhdGVfRkxPQVQpIHBJbnN0YW5jZTsKKyAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXMgICAgICAgPShMVk1fRkxPQVQgKikgcFRhcHM7CisKKyAgICBwQmlxdWFkU3RhdGUtPmNvZWZzWzBdID0gcENvZWYtPkEwOworCisgICAgcEJpcXVhZFN0YXRlLT5jb2Vmc1sxXSA9IHBDb2VmLT5CMjsKKworICAgIHBCaXF1YWRTdGF0ZS0+Y29lZnNbMl0gPSBwQ29lZi0+QjE7Cit9CisjZWxzZQogdm9pZCBCUF8xSV9EMzJGMzJDbGxfVFJDX1dSQV8wMl9Jbml0ICggICBCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAgICpwSW5zdGFuY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJpcXVhZF8xSV9PcmRlcjJfVGFwc190ICAgKnBUYXBzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCUF9DMzJfQ29lZnNfdCAgICAgICAgICAgICpwQ29lZikKQEAgLTUwLDYgKzY1LDcgQEAKIAogICBwQmlxdWFkU3RhdGUtPmNvZWZzWzJdPXBDb2VmLT5CMTsKIH0KKyNlbmRpZgogLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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U91dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBOclNhbXBsZXMpCisgICAgeworICAgICAgICBMVk1fRkxPQVQgIHluTDsKKyAgICAgICAgTFZNX0lOVDE2IGlpOworICAgICAgICBQRmlsdGVyX1N0YXRlX0ZMT0FUIHBCaXF1YWRTdGF0ZSA9IChQRmlsdGVyX1N0YXRlX0ZMT0FUKSBwSW5zdGFuY2U7CiAKKyAgICAgICAgIGZvciAoaWkgPSBOclNhbXBsZXM7IGlpICE9IDA7IGlpLS0pCisgICAgICAgICB7CisKKworICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgUFJPQ0VTU0lORyBPRiBUSEUgTEVGVCBDSEFOTkVMCisgICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgICAgICAgICAvLyB5bkw9QTIgICogeChuLTIpTAorICAgICAgICAgICAgeW5MID0gKExWTV9GTE9BVClwQmlxdWFkU3RhdGUtPmNvZWZzWzBdICogcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzFdOworCisgICAgICAgICAgICAvLyB5bkwrPUExICogeChuLTEpTAorICAgICAgICAgICAgeW5MICs9IChMVk1fRkxPQVQpcEJpcXVhZFN0YXRlLT5jb2Vmc1sxXSAqIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXTsKKworICAgICAgICAgICAgLy8geW5MKz1BMCAqIHgobilMCisgICAgICAgICAgICB5bkwgKz0gKExWTV9GTE9BVClwQmlxdWFkU3RhdGUtPmNvZWZzWzJdICogKCpwRGF0YUluKTsKKworICAgICAgICAgICAgLy8geW5MKz0gICgtQjIgICogeShuLTIpTCApCisgICAgICAgICAgICB5bkwgKz0gKExWTV9GTE9BVClwQmlxdWFkU3RhdGUtPmNvZWZzWzNdICogcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzNdOworCisgICAgICAgICAgICAvLyB5bkwrPSAoLUIxICAqIHkobi0xKUwgICkKKyAgICAgICAgICAgIHluTCArPSAoTFZNX0ZMT0FUKXBCaXF1YWRTdGF0ZS0+Y29lZnNbNF0gKiBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMl07CisKKyAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVQREFUSU5HIFRIRSBERUxBWVMKKyAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1szXSA9IHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXTsgLy8geShuLTIpTD15KG4tMSlMCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMV0gPSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMF07IC8vIHgobi0yKUw9eChuLTEpTAorICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzJdID0geW5MOyAvLyBVcGRhdGUgeShuLTEpTAorICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzBdID0gKCpwRGF0YUluKyspOyAvLyBVcGRhdGUgeChuLTEpTAorCisgICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBXUklUSU5HIFRIRSBPVVRQVVQKKyAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyAgICAgICAgICAgICpwRGF0YU91dCsrID0gKExWTV9GTE9BVCl5bkw7IC8vIFdyaXRlIExlZnQgb3V0cHV0IGluIFEwCisKKworICAgICAgICB9CisKKyAgICB9CisjZWxzZQogdm9pZCBCUV8xSV9EMTZGMTZDMTVfVFJDX1dSQV8wMSAoIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgKnBEYXRhSW4sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgKnBEYXRhT3V0LApAQCAtODIsNCArMTMxLDQgQEAKICAgICAgICAgfQogCiAgICAgfQotCisjZW5kaWYKZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0JRXzFJX0QxNkYxNkNzc19UUkNfV1JBXzAxX0luaXQuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0JRXzFJX0QxNkYxNkNzc19UUkNfV1JBXzAxX0luaXQuYwppbmRleCBiYWYwYzFhLi4zZDViZWZhIDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9CUV8xSV9EMTZGMTZDc3NfVFJDX1dSQV8wMV9Jbml0LmMKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvQlFfMUlfRDE2RjE2Q3NzX1RSQ19XUkFfMDFfSW5pdC5jCkBAIC0zNyw2ICszNywyNiBAQAogLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICAgdm9pZC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zMiw3ICszMiw1NCBAQAogIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXSBpcyB5KG4tMSlMIGluIFExNiBmb3JtYXQKICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbM10gaXMgeShuLTIpTCBpbiBRMTYgZm9ybWF0CiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgQlFfMUlfRDE2RjMyQzE0X1RSQ19XUkFfMDEgKCBCaXF1YWRfRkxPQVRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICpwRGF0YUluLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICpwRGF0YU91dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBOclNhbXBsZXMpCisgICAgeworICAgICAgICBMVk1fRkxPQVQgIHluTDsKKyAgICAgICAgTFZNX0lOVDE2IGlpOworICAgICAgICBQRmlsdGVyX1N0YXRlX0ZMT0FUIHBCaXF1YWRTdGF0ZSA9IChQRmlsdGVyX1N0YXRlX0ZMT0FUKSBwSW5zdGFuY2U7CiAKKyAgICAgICAgIGZvciAoaWkgPSBOclNhbXBsZXM7IGlpICE9IDA7IGlpLS0pCisgICAgICAgICB7CisKKworICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgUFJPQ0VTU0lORyBPRiBUSEUgTEVGVCBDSEFOTkVMCisgICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgICAgICAgICAvLyB5bkw9QTIgICogeChuLTIpTAorICAgICAgICAgICAgeW5MID0gKExWTV9GTE9BVClwQmlxdWFkU3RhdGUtPmNvZWZzWzBdICogcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzFdOworCisgICAgICAgICAgICAvLyB5bkwrPUExICAqIHgobi0xKUwKKyAgICAgICAgICAgIHluTCArPSAoTFZNX0ZMT0FUKXBCaXF1YWRTdGF0ZS0+Y29lZnNbMV0gKiBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMF07CisKKyAgICAgICAgICAgIC8vIHluTCs9QTAgICogeChuKUwKKyAgICAgICAgICAgIHluTCArPSAoTFZNX0ZMT0FUKXBCaXF1YWRTdGF0ZS0+Y29lZnNbMl0gKiAoKnBEYXRhSW4pOworCisgICAgICAgICAgICAvLyB5bkwrPSAoICgtQjIgICogeShuLTIpTCApCisgICAgICAgICAgICB5bkwgKz0gcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzNdICogcEJpcXVhZFN0YXRlLT5jb2Vmc1szXTsKKworICAgICAgICAgICAgLy8geW5MKz0gLUIxICAqIHkobi0xKUwKKyAgICAgICAgICAgIHluTCArPSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMl0gKiBwQmlxdWFkU3RhdGUtPmNvZWZzWzRdOworCisgICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBVUERBVElORyBUSEUgREVMQVlTCisgICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbM10gPSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMl07ICAvLyB5KG4tMilMPXkobi0xKUwKKyAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1sxXSA9IHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXTsgIC8vIHgobi0yKUw9eChuLTEpTAorICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzJdID0geW5MOyAgICAgICAgICAgICAgICAgICAgLy8gVXBkYXRlIHkobi0xKUwKKyAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXSA9ICgqcERhdGFJbisrKTsgICAgICAgICAgICAgIC8vIFVwZGF0ZSB4KG4tMSlMCisKKyAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdSSVRJTkcgVEhFIE9VVFBVVAorICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworICAgICAgICAgICAgKnBEYXRhT3V0KysgPSAoTFZNX0ZMT0FUKSh5bkwpOyAvLyBXcml0ZSBMZWZ0IG91dHB1dAorCisgICAgICAgIH0KKyAgICB9CisjZWxzZQogdm9pZCBCUV8xSV9EMTZGMzJDMTRfVFJDX1dSQV8wMSAoIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgKnBEYXRhSW4sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgKnBEYXRhT3V0LApAQCAtODEsNCArMTI4LDQgQEAKIAogICAgICAgICB9CiAgICAgfQotCisjZW5kaWYKZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZ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MkNzc19UUkNfV1JBXzAxX2luaXQuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0JRXzFJX0QxNkYzMkNzc19UUkNfV1JBXzAxX2luaXQuYwppbmRleCAxZDZiZTRlLi5mZWFlMjBkIDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9CUV8xSV9EMTZGMzJDc3NfVFJDX1dSQV8wMV9pbml0LmMKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvQlFfMUlfRDE2RjMyQ3NzX1RSQ19XUkFfMDFfaW5pdC5jCkBAIC0zOCw2ICszOCwyNyBAQAogLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICAgdm9pZCByZXR1cm4gY29kZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIEJRXzFJX0QxNkYzMkNzc19UUkNfV1JBXzAxX0luaXQgKCAgIEJpcXVhZF9GTE9BVF9JbnN0YW5jZV90ICAgICAgICAgKnBJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmlxdWFkXzFJX09yZGVyMl9GTE9BVF9UYXBzX3QgICAqcFRhcHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJRX0ZMT0FUX0NvZWZzX3QgICAgICAgICAgICAqcENvZWYpCit7CisgICAgTFZNX0ZMT0FUIHRlbXA7CisgICAgUEZpbHRlcl9TdGF0ZV9GTE9BV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2RjMyQ3NzX1RSQ19XUkFfMDFfSW5pdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAKZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0JRXzJJX0QxNkYxNkMxNF9UUkNfV1JBXzAxLmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9CUV8ySV9EMTZGMTZDMTRfVFJDX1dSQV8wMS5jCmluZGV4IDk3MmU3MDQuLjliMGZkZTMgMTAwNjQ0Ci0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0JRXzJJX0QxNkYxNkMxNF9UUkNfV1JBXzAxLmMKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvQlFfMklfRDE2RjE2QzE0X1RSQ19XUkFfMDEuYwpAQCAtMzcsNyArMzcsODEgQEAKICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNl0gaXMgeShuLTIpTCBpbiBRMCBmb3JtYXQKICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbN10gaXMgeShuLTIpUiBpbiBRMCBmb3JtYXQKICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBCUV8ySV9EMTZGMTZDMTRfVFJDX1dSQV8wMSAoIEJpcXVhZF9GTE9BVF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICAgKnBEYXRhSW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICAgKnBEYXRhT3V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgIE5yU2FtcGxlcykKKyAgICB7CisgICAgICAgIExWTV9GTE9BVCAgeW5MLHluUjsKKyAgICAgICAgTFZNX0lOVDE2IGlpOworICAgICAgICBQRmlsdGVyX1N0YXRlX0ZMT0FUIHBCaXF1YWRTdGF0ZSA9IChQRmlsdGVyX1N0YXRlX0ZMT0FUKSBwSW5zdGFuY2U7CiAKKyAgICAgICAgIGZvciAoaWkgPSBOclNhbXBsZXM7IGlpICE9IDA7IGlpLS0pCisgICAgICAgICB7CisKKyAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBST0NFU1NJTkcgT0YgVEhFIExFRlQgQ0hBTk5FTAorICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworICAgICAgICAgICAgLy8geW5MPUEyICAqIHgobi0yKUwKKyAgICAgICAgICAgIHluTCA9IChMVk1fRkxPQVQpcEJpcXVhZFN0YXRlLT5jb2Vmc1swXSAqIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXTsKKworICAgICAgICAgICAgLy8geW5MKz1BMSAgKiB4KG4tMSlMCisgICAgICAgICAgICB5bkwgKz0gKExWTV9GTE9BVClwQmlxdWFkU3RhdGUtPmNvZWZzWzFdICogcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzBdOworCisgICAgICAgICAgICAvLyB5bkwrPUEwICAqIHgobilMCisgICAgICAgICAgICB5bkwgKz0gKExWTV9GTE9BVClwQmlxdWFkU3RhdGUtPmNvZWZzWzJdICogKCpwRGF0YUluKTsKKworICAgICAgICAgICAgLy8geW5MKz0gKCAtQjIgICogeShuLTIpTCAgKQorICAgICAgICAgICAgeW5MICs9IChMVk1fRkxPQVQpcEJpcXVhZFN0YXRlLT5jb2Vmc1szXSAqIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s2XTsKKworICAgICAgICAgICAgLy8geW5MKz0oIC1CMSAgKiB5KG4tMSlMICkKKyAgICAgICAgICAgIHluTCArPSAoTFZNX0ZMT0FUKXBCaXF1YWRTdGF0ZS0+Y29lZnNbNF0gKiBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNF07CisKKworCisgICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBQUk9DRVNTSU5HIE9GIFRIRSBSSUdIVCBDSEFOTkVMCisgICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgICAgICAgICAvLyB5blI9QTIgICogeChuLTIpUgorICAgICAgICAgICAgeW5SID0gKExWTV9GTE9BVClwQmlxdWFkU3RhdGUtPmNvZWZzWzBdICogcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzNdOworCisgICAgICAgICAgICAvLyB5blIrPUExICAqIHgobi0xKVIKKyAgICAgICAgICAgIHluUiArPSAoTFZNX0ZMT0FUKXBCaXF1YWRTdGF0ZS0+Y29lZnNbMV0gKiBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMV07CisKKyAgICAgICAgICAgIC8vIHluUis9QTAgICogeChuKVIKKyAgICAgICAgICAgIHluUiArPSAoTFZNX0ZMT0FUKXBCaXF1YWRTdGF0ZS0+Y29lZnNbMl0gKiAoKihwRGF0YUluKzEpKTsKKworICAgICAgICAgICAgLy8geW5SKz0gKCAtQjIgICogeShuLTIpUiAgKQorICAgICAgICAgICAgeW5SICs9IChMVk1fRkxPQVQpcEJpcXVhZFN0YXRlLT5jb2Vmc1szXSAqIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s3XTsKKworICAgICAgICAgICAgLy8geW5SKz0oIC1CMSAgKiB5KG4tMSlSICApCisgICAgICAgICAgICB5blIgKz0gKExWTV9GTE9BVClwQmlxdWFkU3RhdGUtPmNvZWZzWzRdICogcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzVdOworCisKKyAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVQREFUSU5HIFRIRSBERUxBWVMKKyAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s3XSA9IHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s1XTsgIC8vIHkobi0yKVI9eShuLTEpUgorICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzZdID0gcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzRdOyAgLy8geShuLTIpTD15KG4tMSlMCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbM10gPSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMV07ICAvLyB4KG4tMilSPXgobi0xKVIKKyAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXSA9IHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXTsgIC8vIHgobi0yKUw9eChuLTEpTAorICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzVdID0geW5SOyAgICAgICAgICAgICAgICAgICAgICAgLy8gVXBkYXRlIHkobi0xKVIKKyAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s0XSA9IHluTDsgICAgICAgICAgICAgICAgICAgICAgIC8vIFVwZGF0ZSB5KG4tMSlMCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMF0gPSAoKnBEYXRhSW4rKyk7ICAgICAgICAgICAgICAvLyBVcGRhdGUgeChuLTEpTAorICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzFdID0gKCpwRGF0YUluKyspOyAgICAgICAgICAgICAgLy8gVXBkYXRlIHgobi0xKVIKKworICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgV1JJVElORyBUSEUgT1VUUFVUCisgICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgICAgICAgICAqcERhdGFPdXQrKyA9IChMVk1fRkxPQVQpeW5MOyAvLyBXcml0ZSBMZWZ0IG91dHB1dAorICAgICAgICAgICAgKnBEYXRhT3V0KysgPSAoTFZNX0ZMT0FUKXluUjsgLy8gV3JpdGUgUmlnaHQgb3VwdXQKKworCisgICAgICAgIH0KKworICAgIH0KKyNlbHNlCiB2b2lkIEJRXzJJX0QxNkYxNkMxNF9UUkNfV1JBXzAxICggQmlxdWFkX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAqcERhdGFJbiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAqcERhdGFPdXQsCkBAIC0xMTIsMyArMTg2LDQgQEAKIAogICAgIH0KIAorI2VuZGlmClwgTm8gbmV3bGluZSBhdCBlbmQgb2YgZmlsZQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvQlFfMklfRDE2RjE2QzE1X1RSQ19XUkFfMDEuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0JRXzJJX0QxNkYxNkMxNV9UUkNfV1JBXzAxLmMKaW5kZXggZTA1NjM3My4uZjI0ZGI4ZiAxMDA2NDQKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvQlFfMklfRDE2RjE2QzE1X1RSQ19XUkFfMDEuYworKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9CUV8ySV9EMTZGMTZDMTVfVFJDX1dSQV8wMS5jCkBAIC0zNyw3ICszNyw4MSBAQAogIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s2XSBpcyB5KG4tMilMIGluIFEwIGZvcm1hdAogIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s3XSBpcyB5KG4tMilSIGluIFEwIGZvcm1hdAogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIEJRXzJJX0QxNkYxNkMxNV9UUkNfV1JBXzAxICggQmlxdWFkX0ZMT0FUX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAqcERhdGFJbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAqcERhdGFPdXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgTnJTYW1wbGVzKQorICAgIHsKKyAgICAgICAgTFZNX0ZMT0FUICB5bkwseW5SOworICAgICAgICBMVk1fSU5UMTYgaWk7CisgICAgICAgIFBGaWx0ZXJfU3RhdGVfRkxPQVQgcEJpcXVhZFN0YXRlID0gKFBGaWx0ZXJfU3RhdGVfRkxPQVQpIHBJbnN0YW5jZTsKIAorICAgICAgICAgZm9yIChpaSA9IE5yU2FtcGxlczsgaWkgIT0gMDsgaWktLSkKKyAgICAgICAgIHsKKworCisgICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBQUk9DRVNTSU5HIE9GIFRIRSBMRUZUIENIQU5ORUwKKyAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyAgICAgICAgICAgIC8vIHluTD1BMiAgKiB4KG4tMilMCisgICAgICAgICAgICB5bkwgPSAoTFZNX0ZMT0FUKXBCaXF1YWRTdGF0ZS0+Y29lZnNbMF0gKiBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMl07CisKKyAgICAgICAgICAgIC8vIHluTCs9QTEgICogeChuLTEpTAorICAgICAgICAgICAgeW5MICs9IChMVk1fRkxPQVQpcEJpcXVhZFN0YXRlLT5jb2Vmc1sxXSAqIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXTsKKworICAgICAgICAgICAgLy8geW5MKz1BMCAgKiB4KG4pTAorICAgICAgICAgICAgeW5MICs9IChMVk1fRkxPQVQpcEJpcXVhZFN0YXRlLT5jb2Vmc1syXSAqICgqcERhdGFJbik7CisKKyAgICAgICAgICAgIC8vIHluTCs9ICggLUIyICAqIHkobi0yKUwKKyAgICAgICAgICAgIHluTCArPSAoTFZNX0ZMT0FUKXBCaXF1YWRTdGF0ZS0+Y29lZnNbM10gKiBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNl07CisKKyAgICAgICAgICAgIC8vIHluTCs9KCAtQjEgICogeShuLTEpTAorICAgICAgICAgICAgeW5MICs9IChMVk1fRkxPQVQpcEJpcXVhZFN0YXRlLT5jb2Vmc1s0XSAqIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s0XTsKKworCisKKyAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBST0NFU1NJTkcgT0YgVEhFIFJJR0hUIENIQU5ORUwKKyAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyAgICAgICAgICAgIC8vIHluUj1BMiAgKiB4KG4tMilSCisgICAgICAgICAgICB5blIgPSAoTFZNX0ZMT0FUKXBCaXF1YWRTdGF0ZS0+Y29lZnNbMF0gKiBwQmlxdWFkU3RhdGUtPnBEZWxheXNbM107CisKKyAgICAgICAgICAgIC8vIHluUis9QTEgICogeChuLTEpUgorICAgICAgICAgICAgeW5SICs9IChMVk1fRkxPQVQpcEJpcXVhZFN0YXRlLT5jb2Vmc1sxXSAqIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1sxXTsKKworICAgICAgICAgICAgLy8geW5SKz1BMCAgKiB4KG4pUgorICAgICAgICAgICAgeW5SICs9IChMVk1fRkxPQVQpcEJpcXVhZFN0YXRlLT5jb2Vmc1syXSAqICgqKHBEYXRhSW4rMSkpOworCisgICAgICAgICAgICAvLyB5blIrPSAoIC1CMiAgKiB5KG4tMilSICApCisgICAgICAgICAgICB5blIgKz0gKExWTV9GTE9BVClwQmlxdWFkU3RhdGUtPmNvZWZzWzNdICogcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzddOworCisgICAgICAgICAgICAvLyB5blIrPSggLUIxICAqIHkobi0xKVIgICkKKyAgICAgICAgICAgIHluUiArPSAoTFZNX0ZMT0FUKXBCaXF1YWRTdGF0ZS0+Y29lZnNbNF0gKiBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNV07CisKKworICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgVVBEQVRJTkcgVEhFIERFTEFZUworICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzddID0gcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzVdOyAgLy8geShuLTIpUj15KG4tMSlSCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNl0gPSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNF07ICAvLyB5KG4tMilMPXkobi0xKUwKKyAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1szXSA9IHBCaXF1YWRTdGF0ZS0+cERlbGF5c1sxXTsgIC8vIHgobi0yKVI9eChuLTEpUgorICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzJdID0gcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzBdOyAgLy8geChuLTIpTD14KG4tMSlMCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNV0gPSB5blI7ICAgICAgICAgICAgICAgICAgICAgICAvLyBVcGRhdGUgeShuLTEpUgorICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzRdID0geW5MOyAgICAgICAgICAgICAgICAgICAgICAgLy8gVXBkYXRlIHkobi0xKUwKKyAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXSA9ICgqcERhdGFJbisrKTsgICAgICAgICAgICAgIC8vIFVwZGF0ZSB4KG4tMSlMCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMV0gPSAoKnBEYXRhSW4rKyk7ICAgICAgICAgICAgICAvLyBVcGRhdGUgeChuLTEpUgorCisgICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBXUklUSU5HIFRIRSBPVVRQVVQKKyAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyAgICAgICAgICAgICpwRGF0YU91dCsrID0gKExWTV9GTE9BVCl5bkw7IC8vIFdyaXRlIExlZnQgb3V0cHV0CisgICAgICAgICAgICAqcERhdGFPdXQrKyA9IChMVk1fRkxPQVQpeW5SOyAvLyBXcml0ZSBSaWdodCBvdXB1dAorCisgICAgICAgIH0KKworICAgIH0KKyNlbHNlCiB2b2lkIEJRXzJJX0QxNkYxNkMxNV9UUkNfV1JBXzAxICggQmlxdWFkX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAqcERhdGFJbiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAqcERhdGFPdXQsCkBAIC0xMTEsNCArMTg1LDQgQEAKICAgICAgICAgfQogCiAgICAgfQotCisjZW5kaWYKZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0JRXzJJX0QxNkYxNkNzc19UUkNfV1JBXzAxX0luaXQuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0JRXzJJX0QxNkYxNkNzc19UUkNfV1JBXzAxX0luaXQuYwppbmRleCAwYThhYzM1Li4zOWUxYmRhIDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9CUV8ySV9EMTZGMTZDc3NfVFJDX1dSQV8wMV9Jbml0LmMKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvQlFfMklfRDE2RjE2Q3NzX1RSQ19XUkFfMDFfSW5pdC5jCkBAIC0zOCw2ICszOCwyNyBAQAogLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICAgdm9pZCByZXR1cm4gY29kZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIEJRXzJJX0QxNkYxNkNzc19UUkNfV1JBXzAxX0luaXQgKCAgIEJpcXVhZF9GTE9BVF9JbnN0YW5jZV90ICAgICAgICAgKnBJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmlxdWFkXzJJX09yZGVyMl9GTE9BVF9UYXBzX3QgICAqcFRhcHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJRX0ZMT0FUX0NvZWZzX3QgICAgICAgICAgICAqcENvZWYpCit7CisgICAgTFZNX0ZMT0FUIHRlbXA7CisgICAgUEZpbHRlcl9TdGF0ZV9GTE9BVCBwQmlxdWFkU3RhdGUgPSAoUEZpbHRlcl9TdGF0ZV9GTE9BVCkgcEluc3RhbmNlOworICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5cyAgICAgID0gKExWTV9GTE9BVCAqKSBwVGFwcyAgICAgICAgICAgIDsKKworICAgIHRlbXAgPSBwQ29lZi0+QTI7CisgICAgcEJpc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WN0cy9sdm0vbGliL0NvbW1vbi9zcmMvQlFfMklfRDE2RjMyQzEzX1RSQ19XUkFfMDEuYwppbmRleCA0YTBjY2U0Li42MWMwN2M3IDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9CUV8ySV9EMTZGMzJDMTNfVFJDX1dSQV8wMS5jCisrKyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0JRXzJJX0QxNkYzMkMxM19UUkNfV1JBXzAxLmMKQEAgLTM3LDcgKzM3LDc5IEBACiAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzZdIGlzIHkobi0yKUwgaW4gUTE2IGZvcm1hdAogIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s3XSBpcyB5KG4tMilSIGluIFExNiBmb3JtYXQKICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBCUV8ySV9EMTZGMzJDMTNfVFJDX1dSQV8wMSAoICAgICAgICAgICBCaXF1YWRfRkxPQVRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAgICAgICpwRGF0YUluLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAgICAgICpwRGF0YU91dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICBOclNhbXBsZXMpCisgICAgeworICAgICAgICBMVk1fRkxPQVQgIHluTCx5blI7CisgICAgICAgIExWTV9JTlQxNiBpaTsKKyAgICAgICAgUEZpbHRlcl9TdGF0ZV9GTE9BVCBwQmlxdWFkU3RhdGUgPSAoUEZpbHRlcl9TdGF0ZV9GTE9BVCkgcEluc3RhbmNlOwogCisgICAgICAgIGZvciAoaWkgPSBOclNhbXBsZXM7IGlpICE9IDA7IGlpLS0pCisgICAgICAgIHsKKworICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgUFJPQ0VTU0lORyBPRiBUSEUgTEVGVCBDSEFOTkVMCisgICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgICAgICAgICAvKiB5bkw9QTIgKiB4KG4tMilMICovCisgICAgICAgICAgICB5bkwgPSAoTFZNX0ZMT0FUKXBCaXF1YWRTdGF0ZS0+Y29lZnNbMF0gKiBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMl07CisKKyAgICAgICAgICAgIC8qIHluTCs9QTEqIHgobi0xKUwgKi8KKyAgICAgICAgICAgIHluTCArPSAoTFZNX0ZMT0FUKXBCaXF1YWRTdGF0ZS0+Y29lZnNbMV0gKiBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMF07CisKKyAgICAgICAgICAgIC8qIHluTCs9QTAqIHgobilMICAgKi8KKyAgICAgICAgICAgIHluTCArPSAoTFZNX0ZMT0FUKXBCaXF1YWRTdGF0ZS0+Y29lZnNbMl0gKiAoKnBEYXRhSW4pOworCisgICAgICAgICAgICAvKiB5bkwrPS1CMip5KG4tMilMICovCisgICAgICAgICAgICB5bkwgKz0gcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzZdICogcEJpcXVhZFN0YXRlLT5jb2Vmc1szXTsKKworICAgICAgICAgICAgLyogeW5MKz0tQjEqeShuLTEpTCAqLworICAgICAgICAgICAgeW5MICs9IHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s0XSAqIHBCaXF1YWRTdGF0ZS0+Y29lZnNbNF07CisKKyAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBST0NFU1NJTkcgT0YgVEhFIFJJR0hUIENIQU5ORUwKKyAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyAgICAgICAgICAgIC8qIHluUj1BMiAqIHgobi0yKVIgKi8KKyAgICAgICAgICAgIHluUiA9IChMVk1fRkxPQVQpcEJpcXVhZFN0YXRlLT5jb2Vmc1swXSAqIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1szXTsKKworICAgICAgICAgICAgLyogeW5SKz1BMSogeChuLTEpUiAqLworICAgICAgICAgICAgeW5SICs9IChMVk1fRkxPQVQpcEJpcXVhZFN0YXRlLT5jb2Vmc1sxXSAqIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1sxXTsKKworICAgICAgICAgICAgLyogeW5SKz1BMCogeChuKVIgICAqLworICAgICAgICAgICAgeW5SICs9IChMVk1fRkxPQVQpcEJpcXVhZFN0YXRlLT5jb2Vmc1syXSAqICgqKHBEYXRhSW4rMSkpOworCisgICAgICAgICAgICAvKiB5blIrPS1CMiAqIHkobi0yKVIgKi8KKyAgICAgICAgICAgIHluUiArPSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbN10gKiBwQmlxdWFkU3RhdGUtPmNvZWZzWzNdOworCisgICAgICAgICAgICAvKiB5blIrPS1CMSAqIHkobi0xKVIgKi8KKyAgICAgICAgICAgIHluUiArPSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNV0gKiBwQmlxdWFkU3RhdGUtPmNvZWZzWzRdOworCisgICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBVUERBVElORyBUSEUgREVMQVlTCisgICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbN10gPSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNV07ICAvKiB5KG4tMilSPXkobi0xKVIqLworICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzZdID0gcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzRdOyAgLyogeShuLTIpTD15KG4tMSlMKi8KKyAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1szXSA9IHBCaXF1YWRTdGF0ZS0+cERlbGF5c1sxXTsgIC8qIHgobi0yKVI9eChuLTEpUiovCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMl0gPSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMF07ICAvKiB4KG4tMilMPXgobi0xKUwqLworICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzVdID0geW5SOyAgICAgICAgICAgICAgICAgICAgICAgLyogVXBkYXRlIHkobi0xKVIgKi8KKyAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s0XSA9IHluTDsgICAgICAgICAgICAgICAgICAgICAgIC8qIFVwZGF0ZSB5KG4tMSlMICovCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMF0gPSAoKnBEYXRhSW4pOyAgICAgICAgICAgICAgICAvKiBVcGRhdGUgeChuLTEpTCAqLworICAgICAgICAgICAgcERhdGFJbisrOworICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzFdID0gKCpwRGF0YUluKTsgICAgICAgICAgICAgICAgLyogVXBkYXRlIHgobi0xKVIgKi8KKyAgICAgICAgICAgIHBEYXRhSW4rKzsKKworICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgV1JJVElORyBUSEUgT1VUUFVUCisgICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgICAgICAgICAqcERhdGFPdXQgPSAoTFZNX0ZMT0FUKSh5bkwpOyAvKiBXcml0ZSBMZWZ0IG91dHB1dCAqLworICAgICAgICAgICAgcERhdGFPdXQrKzsKKyAgICAgICAgICAgICpwRGF0YU91dCA9IChMVk1fRkxPQVQpKHluUik7IC8qIFdyaXRlIFJpZ2h0IG91cHV0ICovCisgICAgICAgICAgICBwRGF0YU91dCsrOworICAgICAgICB9CisgICAgfQorI2Vsc2UKIHZvaWQgQlFfMklfRDE2RjMyQzEzX1RSQ19XUkFfMDEgKCAgICAgICAgICAgQmlxdWFkX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICAqcERhdGFJbiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICAqcERhdGFPdXQsCkBAIC0xMTUsNCArMTg3LDQgQEAKICAgICAgICAgfQogCiAgICAgfQotCisjZW5kaWYKZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0JRXzJJX0QxNkYzMkMxNF9UUkNfV1JBXzAxLmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9CUV8ySV9EMTZGMzJDMTRfVFJDX1dSQV8wMS5jCmluZGV4IDA1MmUyYTAuLmNmMTllMDYgMTAwNjQ0Ci0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0JRXzJJX0QxNkYzMkMxNF9UUkNfV1JBXzAxLmMKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvQlFfMklfRDE2RjMyQzE0X1RSQ19XUkFfMDEuYwpAQCAtMzYsNyArMzYsODIgQEAKICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNl0gaXMgeShuLTIpTCBpbiBRMTYgZm9ybWF0CiAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzddIGlzIHkobi0yKVIgaW4gUTE2IGZvcm1hdAogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIEJRXzJJX0QxNkYzMkMxNF9UUkNfV1JBXzAxICggICAgICAgICAgIEJpcXVhZF9GTE9BVF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICAgICAgKnBEYXRhSW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICAgICAgKnBEYXRhT3V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgIE5yU2FtcGxlcykKKyAgICB7CisgICAgICAgIExWTV9GTE9BVCAgeW5MLHluUjsKKyAgICAgICAgTFZNX0lOVDE2IGlpOworICAgICAgICBQRmlsdGVyX1N0YXRlX0ZMT0FUIHBCaXF1YWRTdGF0ZSA9IChQRmlsdGVyX1N0YXRlX0ZMT0FUKSBwSW5zdGFuY2U7CiAKKyAgICAgICAgZm9yIChpaSA9IE5yU2FtcGxlczsgaWkgIT0gMDsgaWktLSkKKyAgICAgICAgeworCisKKyAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBST0NFU1NJTkcgT0YgVEhFIExFRlQgQ0hBTk5FTAorICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworICAgICAgICAgICAgLyogeW5MPUEyICAqIHgobi0yKUwgKi8KKyAgICAgICAgICAgIHluTCA9IChMVk1fRkxPQVQpcEJpcXVhZFN0YXRlLT5jb2Vmc1swXSAqIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXTsKKworICAgICAgICAgICAgLyogeW5MKz1BMSAgKiB4KG4tMSlMICovCisgICAgICAgICAgICB5bkwgKz0gKExWTV9GTE9BVClwQmlxdWFkU3RhdGUtPmNvZWZzWzFdICogcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzBdOworCisgICAgICAgICAgICAvKiB5bkwrPUEwICAqIHgobilMICovCisgICAgICAgICAgICB5bkwgKz0gKExWTV9GTE9BVClwQmlxdWFkU3RhdGUtPmNvZWZzWzJdICogKCpwRGF0YUluKTsKKworICAgICAgICAgICAgLyogeW5MKz0gKCAoLUIyICAqIHkobi0yKUwgICkpKi8KKyAgICAgICAgICAgIHluTCArPSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNl0gKiBwQmlxdWFkU3RhdGUtPmNvZWZzWzNdOworCisKKyAgICAgICAgICAgIC8qIHluTCs9KCAoLUIxICAqIHkobi0xKUwgICkpICAqLworICAgICAgICAgICAgeW5MICs9IHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s0XSAqIHBCaXF1YWRTdGF0ZS0+Y29lZnNbNF07CisKKyAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBST0NFU1NJTkcgT0YgVEhFIFJJR0hUIENIQU5ORUwKKyAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyAgICAgICAgICAgIC8qIHluUj1BMiAgKiB4KG4tMilSICovCisgICAgICAgICAgICB5blIgPSAoTFZNX0ZMT0FUKXBCaXF1YWRTdGF0ZS0+Y29lZnNbMF0gKiBwQmlxdWFkU3RhdGUtPnBEZWxheXNbM107CisKKyAgICAgICAgICAgIC8qIHluUis9QTEgICogeChuLTEpUiAqLworICAgICAgICAgICAgeW5SICs9IChMVk1fRkxPQVQpcEJpcXVhZFN0YXRlLT5jb2Vmc1sxXSAqIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1sxXTsKKworICAgICAgICAgICAgLyogeW5SKz1BMCAgKiB4KG4pUiAqLworICAgICAgICAgICAgeW5SICs9IChMVk1fRkxPQVQpcEJpcXVhZFN0YXRlLT5jb2Vmc1syXSAqICgqKHBEYXRhSW4rMSkpOworCisgICAgICAgICAgICAvKiB5blIrPSAoICgtQjIgICogeShuLTIpUiAgKSkqLworICAgICAgICAgICAgeW5SICs9IHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s3XSAqIHBCaXF1YWRTdGF0ZS0+Y29lZnNbM107CisKKyAgICAgICAgICAgIC8qIHluUis9KCAoLUIxICAqIHkobi0xKVIgICkpICAqLworICAgICAgICAgICAgeW5SICs9IHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s1XSAqIHBCaXF1YWRTdGF0ZS0+Y29lZnNbNF07CisKKyAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVQREFUSU5HIFRIRSBERUxBWVMKKyAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s3XSA9IHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s1XTsgIC8qIHkobi0yKVI9eShuLTEpUiovCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNl0gPSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNF07ICAvKiB5KG4tMilMPXkobi0xKUwqLworICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzNdID0gcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzFdOyAgLyogeChuLTIpUj14KG4tMSlSKi8KKyAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXSA9IHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXTsgIC8qIHgobi0yKUw9eChuLTEpTCovCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNV0gPSB5blI7ICAgICAgICAgICAgICAgICAgICAvKiBVcGRhdGUgeShuLTEpUiAqLworICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzRdID0geW5MOyAgICAgICAgICAgICAgICAgICAgLyogVXBkYXRlIHkobi0xKUwgKi8KKyAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXSA9ICgqcERhdGFJbik7ICAgICAgICAgICAgICAgIC8qIFVwZGF0ZSB4KG4tMSlMICovCisgICAgICAgICAgICBwRGF0YUluKys7CisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMV0gPSAoKnBEYXRhSW4pOyAgICAgICAgICAgICAgICAvKiBVcGRhdGUgeChuLTEpUiAqLworICAgICAgICAgICAgcERhdGFJbisrOworCisgICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBXUklUSU5HIFRIRSBPVVRQVVQKKyAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyAgICAgICAgICAgICpwRGF0YU91dCA9IChMVk1fRkxPQVQpKHluTCk7IC8qIFdyaXRlIExlZnQgb3V0cHV0ICovCisgICAgICAgICAgICBwRGF0YU91dCsrOworICAgICAgICAgICAgKnBEYXRhT3V0ID0gKExWTV9GTE9BVCkoeW5SKTsgLyogV3JpdGUgUmlnaHQgb3VwdXQgKi8KKyAgICAgICAgICAgIHBEYXRhT3V0Kys7CisgICAgICAgIH0KKworICAgIH0KKyNlbHNlCiB2b2lkIEJRXzJJX0QxNkYzMkMxNF9UUkNfV1JBXzAxICggICAgICAgICAgIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgKnBEYXRhSW4sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgKnBEYXRhT3V0LApAQCAtMTE0LDQgKzE4OSw0IEBACiAgICAgICAgIH0KIAogICAgIH0KLQorI2VuZGlmCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9CUV8ySV9EMTZGMzJDMTVfVFJDX1dSQV8wMS5jIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvQlFfMklfRDE2RjMyQzE1X1RSQ19XUkFfMDEuYwppbmRleCA4Yzc0MWUxLi4yNjExYjE5IDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9CUV8ySV9EMTZGMzJDMTVfVFJDX1dSQV8wMS5jCisrKyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0JRXzJJX0QxNkYzMkMxNV9UUkNfV1JBXzAxLmMKQEAgLTM2LDcgKzM2LDg0IEBACiAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzZdIGlzIHkobi0yKUwgaW4gUTE2IGZvcm1hdAogIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s3XSBpcyB5KG4tMilSIGluIFExNiBmb3JtYXQKICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBCUV8ySV9EMTZGMzJDMTVfVFJDX1dSQV8wMSAoICAgICAgICAgICBCaXF1YWRfRkxPQVRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAgICAgICpwRGF0YUluLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAgICAgICpwRGF0YU91dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICBOclNhbXBsZXMpCisgICAgeworICAgICAgICBMVk1fRkxPQVQgIHluTCx5blI7CisgICAgICAgIExWTV9JTlQxNiBpaTsKKyAgICAgICAgUEZpbHRlcl9TdGF0ZV9GTE9BVCBwQmlxdWFkU3RhdGUgPSAoUEZpbHRlcl9TdGF0ZV9GTE9BVCkgcEluc3RhbmNlOwogCisgICAgICAgICBmb3IgKGlpID0gTnJTYW1wbGVzOyBpaSAhPSAwOyBpaS0tKQorICAgICAgICAgeworCisKKyAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBST0NFU1NJTkcgT0YgVEhFIExFRlQgQ0hBTk5FTAorICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworICAgICAgICAgICAgLyogeW5MPUEyICAqIHgobi0yKUwgKi8KKyAgICAgICAgICAgIHluTCA9IChMVk1fRkxPQVQpcEJpcXVhZFN0YXRlLT5jb2Vmc1swXSAqIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXTsKKworICAgICAgICAgICAgLyogeW5MKz1BMSAgKiB4KG4tMSlMICovCisgICAgICAgICAgICB5bkwgKz0gKExWTV9GTE9BVClwQmlxdWFkU3RhdGUtPmNvZWZzWzFdICogcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzBdOworCisgICAgICAgICAgICAvKiB5bkwrPUEwICAqIHgobilMICovCisgICAgICAgICAgICB5bkwgKz0gKExWTV9GTE9BVClwQmlxdWFkU3RhdGUtPmNvZWZzWzJdICogKCpwRGF0YUluKTsKKworICAgICAgICAgICAgLyogeW5MKz0gKCAoLUIyICAqIHkobi0yKUwgKSAgKi8KKyAgICAgICAgICAgIHluTCArPSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNl0gKiBwQmlxdWFkU3RhdGUtPmNvZWZzWzNdOworCisKKyAgICAgICAgICAgIC8qIHluTCs9KCAoLUIxICAqIHkobi0xKUwgICkpICAqLworICAgICAgICAgICAgeW5MICs9IHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s0XSAqIHBCaXF1YWRTdGF0ZS0+Y29lZnNbNF07CisKKworICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgUFJPQ0VTU0lORyBPRiBUSEUgUklHSFQgQ0hBTk5FTAorICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworICAgICAgICAgICAgLyogeW5SPUEyICAqIHgobi0yKVIgKi8KKyAgICAgICAgICAgIHluUiA9IChMVk1fRkxPQVQpcEJpcXVhZFN0YXRlLT5jb2Vmc1swXSAqIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1szXTsKKworICAgICAgICAgICAgLyogeW5SKz1BMSAgKiB4KG4tMSlSICovCisgICAgICAgICAgICB5blIgKz0gKExWTV9GTE9BVClwQmlxdWFkU3RhdGUtPmNvZWZzWzFdICogcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzFdOworCisgICAgICAgICAgICAvKiB5blIrPUEwICAqIHgobilSICovCisgICAgICAgICAgICB5blIgKz0gKExWTV9GTE9BVClwQmlxdWFkU3RhdGUtPmNvZWZzWzJdICogKCoocERhdGFJbisxKSk7CisKKyAgICAgICAgICAgIC8qIHluUis9ICggKC1CMiAgKiB5KG4tMilSICkgKi8KKyAgICAgICAgICAgIHluUiArPSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbN10gKiBwQmlxdWFkU3RhdGUtPmNvZWZzWzNdOworCisKKyAgICAgICAgICAgIC8qIHluUis9KCAoLUIxICAqIHkobi0xKVIgICkpIGluIFExNSAqLworICAgICAgICAgICAgeW5SICs9IHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s1XSAqIHBCaXF1YWRTdGF0ZS0+Y29lZnNbNF07CisKKyAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVQREFUSU5HIFRIRSBERUxBWVMKKyAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s3XSA9IHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s1XTsgLyogeShuLTIpUj15KG4tMSlSKi8KKyAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s2XSA9IHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s0XTsgLyogeShuLTIpTD15KG4tMSlMKi8KKyAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1szXSA9IHBCaXF1YWRTdGF0ZS0+cERlbGF5c1sxXTsgLyogeChuLTIpUj14KG4tMSlSKi8KKyAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXSA9IHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXTsgLyogeChuLTIpTD14KG4tMSlMKi8KKyAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s1XSA9IHluUjsgLyogVXBkYXRlIHkobi0xKVIqLworICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzRdID0geW5MOyAvKiBVcGRhdGUgeShuLTEpTCovCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMF0gPSAoKnBEYXRhSW4pOyAvKiBVcGRhdGUgeChuLTEpTCovCisgICAgICAgICAgICBwRGF0YUluKys7CisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMV0gPSAoKnBEYXRhSW4pOyAvKiBVcGRhdGUgeChuLTEpUiovCisgICAgICAgICAgICBwRGF0YUluKys7CisKKyAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdSSVRJTkcgVEhFIE9VVFBVVAorICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworICAgICAgICAgICAgKnBEYXRhT3V0ID0gKExWTV9GTE9BVCkoeW5MKTsgLyogV3JpdGUgTGVmdCBvdXRwdXQqLworICAgICAgICAgICAgcERhdGFPdXQrKzsKKyAgICAgICAgICAgICpwRGF0YU91dCA9IChMVk1fRkxPQVQpKHluUik7IC8qIFdyaXRlIFJpZ2h0IG91cHV0Ki8KKyAgICAgICAgICAgIHBEYXRhT3V0Kys7CisgICAgICAgIH0KKworICAgIH0KKyNlbHNlCiB2b2lkIEJRXzJJX0QxNkYzMkMxNV9UUkNfV1JBXzAxICggICAgICAgICAgIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgKnBEYXRhSW4sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgKnBEYXRhT3V0LApAQCAtMTE0LDQgKzE5MSw0IEBACiAgICAgICAgIH0KIAogICAgIH0KLQorI2VuZGlmCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9CUV8ySV9EMTZGMzJDc3NfVFJDX1dSQV8wMV9Qcml2YXRlLmggYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3Ny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MkNzc19UUkNfV1JBXzAxX2luaXQuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0JRXzJJX0QxNkYzMkNzc19UUkNfV1JBXzAxX2luaXQuYwppbmRleCA0NTkxZWUwLi40ZDliYmZlIDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9CUV8ySV9EMTZGMzJDc3NfVFJDX1dSQV8wMV9pbml0LmMKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvQlFfMklfRDE2RjMyQ3NzX1RSQ19XUkFfMDFfaW5pdC5jCkBAIC0zNyw2ICszNywyNiBAQAogLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICAgdm9pZCByZXR1cm4gY29kZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIEJRXzJJX0QxNkYzMkNzc19UUkNfV1JBXzAxX0luaXQgKCAgIEJpcXVhZF9GTE9BVF9JbnN0YW5jZV90ICAgICAgICAgKnBJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmlxdWFkXzJJX09yZGVyMl9GTE9BVF9UYXBzX3QgICAqcFRhcHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJRX0ZMT0FUX0NvZWZzX3QgICAgICAgICAgICAqcENvZWYpCit7CisgICAgTFZNX0ZMT0FUIHRlbXA7CisgICAgUEZpbHRlcl9TdGF0ZV9GTE9BVCBw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EMTZGMzJDc3NfVFJDX1dSQV8wMV9Jbml0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIApkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvQlFfMklfRDMyRjMyQzMwX1RSQ19XUkFfMDEuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0JRXzJJX0QzMkYzMkMzMF9UUkNfV1JBXzAxLmMKaW5kZXggZmQ4MjEyZTQuLjk2MGRlNzkgMTAwNjQ0Ci0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0JRXzJJX0QzMkYzMkMzMF9UUkNfV1JBXzAxLmMKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvQlFfMklfRDMyRjMyQzMwX1RSQ19XUkFfMDEuYwpAQCAtMzYsNyArMzYsOTQgQEAKICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNl0gaXMgeShuLTIpTCBpbiBRMCBmb3JtYXQKICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbN10gaXMgeShuLTIpUiBpbiBRMCBmb3JtYXQKICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBCUV8ySV9EMzJGMzJDMzBfVFJDX1dSQV8wMSAoICAgICAgICAgICBCaXF1YWRfRkxPQVRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAgICAgICpwRGF0YUluLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAgICAgICpwRGF0YU91dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICBOclNhbXBsZXMpCiAKKworICAgIHsKKyAgICAgICAgTFZNX0ZMT0FUIHluTCx5blIsdGVtcGwsdGVtcGQ7CisgICAgICAgIExWTV9JTlQxNiBpaTsKKyAgICAgICAgUEZpbHRlcl9TdGF0ZV9GTE9BVCBwQmlxdWFkU3RhdGUgPSAoUEZpbHRlcl9TdGF0ZV9GTE9BVCkgcEluc3RhbmNlOworCisgICAgICAgICBmb3IgKGlpID0gTnJTYW1wbGVzOyBpaSAhPSAwOyBpaS0tKQorICAgICAgICAgeworCisKKyAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBST0NFU1NJTkcgT0YgVEhFIExFRlQgQ0hBTk5FTAorICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworICAgICAgICAgICAgLyogeW5MPSAoIEEyICAqIHgobi0yKUwgICkgKi8KKyAgICAgICAgICAgIHluTCA9IHBCaXF1YWRTdGF0ZS0+Y29lZnNbMF0gKiBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMl07CisKKyAgICAgICAgICAgIC8qIHluTCs9ICggQTEgICogeChuLTEpTCAgKSovCisgICAgICAgICAgICB0ZW1wbCA9IHBCaXF1YWRTdGF0ZS0+Y29lZnNbMV0gKiBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMF07CisgICAgICAgICAgICB5bkwgKz0gdGVtcGw7CisKKyAgICAgICAgICAgIC8qIHluTCs9ICggQTAgICogeChuKUwgICkgKi8KKyAgICAgICAgICAgIHRlbXBsID0gcEJpcXVhZFN0YXRlLT5jb2Vmc1syXSAqICgqcERhdGFJbik7CisgICAgICAgICAgICB5bkwgKz0gdGVtcGw7CisKKyAgICAgICAgICAgICAvKiB5bkwrPSAoLUIyICAqIHkobi0yKUwgICkgKi8KKyAgICAgICAgICAgIHRlbXBsID0gcEJpcXVhZFN0YXRlLT5jb2Vmc1szXSAqIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s2XTsKKyAgICAgICAgICAgIHluTCArPSB0ZW1wbDsKKworICAgICAgICAgICAgLyogeW5MKz0gKC1CMSAgKiB5KG4tMSlMICApKi8KKyAgICAgICAgICAgIHRlbXBsID0gcEJpcXVhZFN0YXRlLT5jb2Vmc1s0XSAqIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s0XTsKKyAgICAgICAgICAgIHluTCArPSB0ZW1wbDsKKworICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgUFJPQ0VTU0lORyBPRiBUSEUgUklHSFQgQ0hBTk5FTAorICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworICAgICAgICAgICAgLyogeW5SPSAoIEEyICAqIHgobi0yKVIgICkgKi8KKyAgICAgICAgICAgIHluUiA9IHBCaXF1YWRTdGF0ZS0+Y29lZnNbMF0gKiBwQmlxdWFkU3RhdGUtPnBEZWxheXNbM107CisKKyAgICAgICAgICAgIC8qIHluUis9ICggQTEgICogeChuLTEpUiAgKSAqLworICAgICAgICAgICAgdGVtcGwgPSBwQmlxdWFkU3RhdGUtPmNvZWZzWzFdICogcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzFdOworICAgICAgICAgICAgeW5SICs9IHRlbXBsOworCisgICAgICAgICAgICAvKiB5blIrPSAoIEEwICAqIHgobilSICApICovCisgICAgICAgICAgICB0ZW1wZCA9KiAocERhdGFJbisxKTsKKyAgICAgICAgICAgIHRlbXBsID0gcEJpcXVhZFN0YXRlLT5jb2Vmc1syXSAqIHRlbXBkOworICAgICAgICAgICAgeW5SICs9IHRlbXBsOworCisgICAgICAgICAgICAvKiB5blIrPSAoLUIyICAqIHkobi0yKVIgICkgKi8KKyAgICAgICAgICAgIHRlbXBsID0gcEJpcXVhZFN0YXRlLT5jb2Vmc1szXSAqIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s3XTsKKyAgICAgICAgICAgIHluUiArPSB0ZW1wbDsKKworICAgICAgICAgICAgLyogeW5SKz0gKC1CMSAgKiB5KG4tMSlSICApICAqLworICAgICAgICAgICAgdGVtcGwgPSBwQmlxdWFkU3RhdGUtPmNvZWZzWzRdICogcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzVdOworICAgICAgICAgICAgeW5SICs9IHRlbXBsOworCisgICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBVUERBVElORyBUSEUgREVMQVlTCisgICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbN10gPSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNV07IC8qIHkobi0yKVI9eShuLTEpUiovCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNl0gPSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNF07IC8qIHkobi0yKUw9eShuLTEpTCovCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbM10gPSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMV07IC8qIHgobi0yKVI9eChuLTEpUiovCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMl0gPSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMF07IC8qIHgobi0yKUw9eChuLTEpTCovCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNV0gPSAoTFZNX0ZMT0FUKXluUjsgLyogVXBkYXRlIHkobi0xKVIgKi8KKyAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s0XSA9IChMVk1fRkxPQVQpeW5MOyAvKiBVcGRhdGUgeShuLTEpTCAqLworICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzBdID0gKCpwRGF0YUluKTsgLyogVXBkYXRlIHgobi0xKUwgKi8KKyAgICAgICAgICAgIHBEYXRhSW4rKzsKKyAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1sxXSA9ICgqcERhdGFJbik7IC8qIFVwZGF0ZSB4KG4tMSlSICovCisgICAgICAgICAgICBwRGF0YUluKys7CisKKyAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdSSVRJTkcgVEhFIE9VVFBVVAorICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworICAgICAgICAgICAgKnBEYXRhT3V0ID0gKExWTV9GTE9BVCl5bkw7IC8qIFdyaXRlIExlZnQgb3V0cHV0ICovCisgICAgICAgICAgICBwRGF0YU91dCsrOworICAgICAgICAgICAgKnBEYXRhT3V0ID0gKExWTV9GTE9BVCl5blI7IC8qIFdyaXRlIFJpZ2h0IG91cHV0ICovCisgICAgICAgICAgICBwRGF0YU91dCsrOworCisKKyAgICAgICAgfQorCisgICAgfQorI2Vsc2UKIHZvaWQgQlFfMklfRDMyRjMyQzMwX1RSQ19XUkFfMDEgKCAgICAgICAgICAgQmlxdWFkX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAgICAgICAgICAgICAgICAqcERhdGFJbiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAgICAgICAgICAgICAgICAqcERhdGFPdXQsCkBAIC0xMjMsNCArMjEwLDQgQEAKICAgICAgICAgfQogCiAgICAgfQotCisjZW5kaWYgLypCVUlMRF9GTE9BVCovCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9CUV8ySV9EMzJGMzJDbGxfVFJDX1dSQV8wMV9Jbml0LmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9CUV8ySV9EMzJGMzJDbGxfVFJDX1dSQV8wMV9Jbml0LmMKaW5kZXggMTcwOWY3MS4uZmZmMDVlZCAxMDA2NDQKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvQlFfMklfRDMyRjMyQ2xsX1RSQ19XUkFfMDFfSW5pdC5jCisrKyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0JRXzJJX0QzMkYzMkNsbF9UUkNfV1JBXzAxX0luaXQuYwpAQCAtMzcsNiArMzcsMjYgQEAKIC8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiAgIHZvaWQgcmV0dXJuIGNvZGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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ICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgbiApCit7CisgICAgTFZNX0lOVDE2IGlpOwogCisgICAgaWYgKHNyYyA+IGRzdCkKKyAgICB7CisgICAgICAgIGZvciAoaWkgPSBuOyBpaSAhPSAwOyBpaS0tKQorICAgICAgICB7CisgICAgICAgICAgICAqZHN0ID0gKnNyYzsKKyAgICAgICAgICAgIGRzdCsrOworICAgICAgICAgICAgc3JjKys7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgc3JjICs9IG4gLSAxOworICAgICAgICBkc3QgKz0gbiAtIDE7CisgICAgICAgIGZvciAoaWkgPSBuOyBpaSAhPSAwOyBpaS0tKQorICAgICAgICB7CisgICAgICAgICAgICAqZHN0ID0gKnNyYzsKKyAgICAgICAgICAgIGRzdC0tOworICAgICAgICAgICAgc3JjLS07CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm47Cit9CisjZW5kaWYKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvQ29yZV9NaXhIYXJkXzJTdF9EMzJDMzFfU0FULmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9Db3JlX01peEhhcmRfMlN0X0QzMkMzMV9TQVQuYwppbmRleCBiZjY5ZTM1Li5lYTk4MDQxIDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9Db3JlX01peEhhcmRfMlN0X0QzMkMzMV9TQVQuYworKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9Db3JlX01peEhhcmRfMlN0X0QzMkMzMV9TQVQuYwpAQCAtMjUsNyArMjUsMzcgQEAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgICBGVU5DVElPTiBDT1JFX01JWEhBUkRfMlNUX0QzMkMzMV9TQVQKICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIENvcmVfTWl4SGFyZF8yU3RfRDMyQzMxX1NBVCggICBNaXhfMlN0X0NsbF9GTE9BVF90ICAgICAgICpwSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fRkxPQVQgICAgICpzcmMxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICAgICAqc3JjMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgKmRzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgbikKK3sKKyAgICBMVk1fRkxPQVQgIFRlbXAxLFRlbXAyLFRlbXAzOworICAgIExWTV9JTlQxNiBpaTsKKyAgICBMVk1fRkxPQVQgQ3VycmVudDFTaG9ydDsKKyAgICBMVk1fRkxPQVQgQ3VycmVudDJTaG9ydDsKIAorICAgIEN1cnJlbnQxU2hvcnQgPSAocEluc3RhbmNlLT5DdXJyZW50MSk7CisgICAgQ3VycmVudDJTaG9ydCA9IChwSW5zdGFuY2UtPkN1cnJlbnQyKTsKKworICAgIGZvciAoaWkgPSBuOyBpaSAhPSAwOyBpaS0tKXsKKyAgICAgICAgVGVtcDEgPSAqc3JjMSsrOworICAgICAgICBUZW1wMyA9IFRlbXAxICogQ3VycmVudDFTaG9ydDsKKyAgICAgICAgVGVtcDIgPSAqc3JjMisrOworICAgICAgICBUZW1wMSA9IFRlbXAyICogQ3VycmVudDJTaG9ydDsKKyAgICAgICAgVGVtcDIgPSAoVGVtcDEgLyAyLjBmKSArIChUZW1wMyAvIDIuMGYpOworICAgICAgICBpZiAoVGVtcDIgPiAwLjVmKQorICAgICAgICAgICAgVGVtcDIgPSAxLjBmOworICAgICAgICBlbHNlIGlmIChUZW1wMiA8IC0wLjVmICkKKyAgICAgICAgICAgIFRlbXAyID0gLTEuMGY7CisgICAgICAgIGVsc2UKKyAgICAgICAgICAgIFRlbXAyID0gKFRlbXAyICogMik7CisgICAgICAgICAgICAqZHN0KysgPSBUZW1wMjsKKyAgICB9Cit9CisjZWxzZQogdm9pZCBDb3JlX01peEhhcmRfMlN0X0QzMkMzMV9TQVQoICAgTWl4XzJTdF9DbGxfdCAgICAgICAqcEluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDMyICAgICAqc3JjMSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQzMiAgICAgKnNyYzIsCkBAIC01NSw2ICs4NSw1IEBACiAgICAgICAgICAgICAqZHN0KysgPSBUZW1wMjsKICAgICB9CiB9Ci0KLQorI2VuZGlmCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0NvcmVfTWl4SW5Tb2Z0X0QzMkMzMV9TQVQuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0NvcmVfTWl4SW5Tb2Z0X0QzMkMzMV9TQVQuYwppbmRleCAzNDcxZjA1Li4yODE0ZjE5IDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9Db3JlX01peEluU29mdF9EMzJDMzFfU0FULmMKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvQ29yZV9NaXhJblNvZnRfRDMyQzMxX1NBVC5jCkBAIC0yNiw2ICsyNiw3MCBAQAogICAgRlVOQ1RJT04gQ09SRV9NSVhTT0ZUXzFTVF9EMzJDMzFfV1JBCiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAorI2lmZGVmIEJVSUxEX0ZMT0FUIC8qIEJVSUxEX0ZMT0FUICovCit2b2lkIENvcmVfTWl4SW5Tb2Z0X0QzMkMzMV9TQVQoICAgICBNaXhfMVN0X0NsbF9GTE9BVF90ICAgICAgICpwSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fRkxPQVQgICAgICpzcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICpkc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgIG4pCit7CisgICAgTFZNX0ZMT0FUICAgIFRlbXAxLFRlbXAyLFRlbXAzOworICAgIExWTV9JTlQxNiAgICAgT3V0TG9vcDsKKyAgICBMVk1fSU5UMTYgICAgIEluTG9vcDsKKyAgICBMVk1fRkxPQVQgICAgVGFyZ2V0VGltZXNPbmVNaW5BbHBoYTsKKyAgICBMVk1fRkxPQVQgICAgQ3VycmVudFRpbWVzQWxwaGE7CisgICAgTFZNX0lOVDE2ICAgICBpaSxqajsKKworCisgICAgSW5Mb29wID0gKExWTV9JTlQxNikobiA+PiAyKTsgLyogUHJvY2VzcyBwZXIgNCBzYW1wbGVzICovCisgICAgT3V0TG9vcCA9IChMVk1fSU5UMTYpKG4gLSAoSW5Mb29wIDw8IDIpKTsKKworICAgIFRhcmdldFRpbWVzT25lTWluQWxwaGEgPSAoKDEuMGYgLXBJbnN0YW5jZS0+QWxwaGEpICogcEluc3RhbmNlLT5UYXJnZXQpOworICAgIGlmIChwSW5zdGFuY2UtPlRhcmdldCA+PSBwSW5zdGFuY2UtPkN1cnJlbnQpeworICAgICAgICBUYXJnZXRUaW1lc09uZU1pbkFscGhhICs9KExWTV9GTE9BVCkoMi4wZiAvIDIxNDc0ODM2NDcuMGYpOyAvKiBDZWlsKi8KKyAgICB9CisKKyAgICBpZiAoT3V0TG9vcCl7CisKKyAgICAgICAgQ3VycmVudFRpbWVzQWxwaGEgPSBwSW5zdGFuY2UtPkN1cnJlbnQgKiBwSW5zdGFuY2UtPkFscGhhOworICAgICAgICBwSW5zdGFuY2UtPkN1cnJlbnQgPSBUYXJnZXRUaW1lc09uZU1pbkFscGhhICsgQ3VycmVudFRpbWVzQWxwaGE7CisKKyAgICAgICAgZm9yIChpaSA9IE91dExvb3A7IGlpICE9IDA7IGlpLS0peworICAgICAgICBUZW1wMSA9ICpzcmMrKzsKKyAgICAgICAgVGVtcDIgPSAqZHN0OworCisgICAgICAgIFRlbXAzID0gVGVtcDEgKiAocEluc3RhbmNlLT5DdXJyZW50KTsKKyAgICAgICAgVGVtcDEgPSBUZW1wMiArIFRlbXAzOworCisgICAgICAgIGlmIChUZW1wMSA+IDEuMGYpCisgICAgICAgICAgICBUZW1wMSA9IDEuMGY7CisgICAgICAgIGVsc2UgaWYgKFRlbXAxIDwgLTEuMGYpCisgICAgICAgICAgICBUZW1wMSA9IC0xLjBmOworCisgICAgICAgICpkc3QrKyA9IFRlbXAxOworICAgICAgICB9CisgICAgfQorCisgICAgZm9yIChpaSA9IEluTG9vcDsgaWkgIT0gMDsgaWktLSl7CisKKyAgICAgICAgQ3VycmVudFRpbWVzQWxwaGEgPSBwSW5zdGFuY2UtPkN1cnJlbnQgKiBwSW5zdGFuY2UtPkFscGhhOworICAgICAgICBwSW5zdGFuY2UtPkN1cnJlbnQgPSBUYXJnZXRUaW1lc09uZU1pbkFscGhhICsgQ3VycmVudFRpbWVzQWxwaGE7CisKKyAgICAgICAgZm9yIChqaiA9IDQ7IGpqIT0wIDsgamotLSl7CisgICAgICAgICAgICBUZW1wMSA9ICpzcmMrKzsKKyAgICAgICAgICAgIFRlbXAyID0gKmRzdDsKKworICAgICAgICAgICAgVGVtcDMgPSBUZW1wMSAqIChwSW5zdGFuY2UtPkN1cnJlbnQpOworICAgICAgICAgICAgVGVtcDEgPSBUZW1wMiArIFRlbXAzOworCisgICAgICAgICAgICBpZiAoVGVtcDEgPiAxLjBmKQorICAgICAgICAgICAgICAgIFRlbXAxID0gMS4wZjsKKyAgICAgICAgICAgIGVsc2UgaWYgKFRlbXAxIDwgLTEuMGYpCisgICAgICAgICAgICAgICAgVGVtcDEgPSAtMS4wZjsKKyAgICAgICAgICAgICpkc3QrKyA9IFRlbXAxOworICAgICAgICB9CisgICAgfQorfQorI2Vsc2UKIHZvaWQgQ29yZV9NaXhJblNvZnRfRDMyQzMxX1NBVCggICAgIE1peF8xU3RfQ2xsX3QgICAgICAgKnBJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQzMiAgICAgKnNyYywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgKmRzdCwKQEAgLTg5LDYgKzE1Myw1IEBACiAgICAgICAgIH0KICAgICB9CiB9Ci0KLQorI2VuZGlmCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0NvcmVfTWl4U29mdF8xU3RfRDMyQzMxX1dSQS5jIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvQ29yZV9NaXhTb2Z0XzFTdF9EMzJDMzFfV1JBLmMKaW5kZXggNzA5YzMwNC4uODE0Y2NlZSAxMDA2NDQKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvQ29yZV9NaXhTb2Z0XzFTdF9EMzJDMzFfV1JBLmMKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvQ29yZV9NaXhTb2Z0XzFTdF9EMzJDMzFfV1JBLmMKQEAgLTI1LDcgKzI1LDc5IEBACiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICAgRlVOQ1RJT04gQ09SRV9NSVhTT0ZUXzFTVF9EMzJDMzFfV1JBCiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBDb3JlX01peFNvZnRfMVN0X0QzMkMzMV9XUkEoICAgTWl4XzFTdF9DbGxfRkxPQVRfdCAgICAgICAqcEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICAgICAqc3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAqZHN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICBuKQoreworICAgIExWTV9GTE9BVCBUZW1wMSxUZW1wMjsKKyAgICBMVk1fSU5UMTYgT3V0TG9vcDsKKyAgICBMVk1fSU5UMTYgSW5Mb29wOworICAgIExWTV9GTE9BVCBUYXJnZXRUaW1lc09uZU1pbkFscGhhOworICAgIExWTV9GTE9BVCBDdXJyZW50VGltZXNBbHBoYTsKIAorICAgIExWTV9JTlQxNiBpaTsKKworICAgIEluTG9vcCA9IChMVk1fSU5UMTYpKG4gPj4gMik7IC8qIFByb2Nlc3MgcGVyIDQgc2FtcGxlcyAqLworICAgIE91dExvb3AgPSAoTFZNX0lOVDE2KShuIC0gKEluTG9vcCA8PCAyKSk7CisKKyAgICBUYXJnZXRUaW1lc09uZU1pbkFscGhhID0gKDEuMGYgLSBwSW5zdGFuY2UtPkFscGhhKSAqIHBJbnN0YW5jZS0+VGFyZ2V0OyAvKiBmbG9hdCAqIGZsb2F0IGluIGZsb2F0ICovCisgICAgaWYgKHBJbnN0YW5jZS0+VGFyZ2V0ID49IHBJbnN0YW5jZS0+Q3VycmVudCkKKyAgICB7CisgICAgICAgIFRhcmdldFRpbWVzT25lTWluQWxwaGEgKz0gKExWTV9GTE9BVCkoMi4wZiAvIDIxNDc0ODM2NDcuMGYpOyAvKiBDZWlsKi8KKyAgICB9CisKKyAgICBpZiAoT3V0TG9vcCAhPSAwKQorICAgIHsKKyAgICAgICAgQ3VycmVudFRpbWVzQWxwaGEgPSAocEluc3RhbmNlLT5DdXJyZW50ICogcEluc3RhbmNlLT5BbHBoYSk7CisgICAgICAgIHBJbnN0YW5jZS0+Q3VycmVudCA9IFRhcmdldFRpbWVzT25lTWluQWxwaGEgKyBDdXJyZW50VGltZXNBbHBoYTsKKworICAgICAgICBmb3IgKGlpID0gT3V0TG9vcDsgaWkgIT0gMDsgaWktLSkKKyAgICAgICAgeworICAgICAgICAgICAgVGVtcDEgPSAqc3JjOworICAgICAgICAgICAgc3JjKys7CisKKyAgICAgICAgICAgIFRlbXAyID0gVGVtcDEgKiAocEluc3RhbmNlLT5DdXJyZW50KTsKKyAgICAgICAgICAgICpkc3QgPSBUZW1wMjsKKyAgICAgICAgICAgIGRzdCsrOworICAgICAgICB9CisgICAgfQorCisgICAgZm9yIChpaSA9IEluTG9vcDsgaWkgIT0gMDsgaWktLSkKKyAgICB7CisgICAgICAgIEN1cnJlbnRUaW1lc0FscGhhID0gcEluc3RhbmNlLT5DdXJyZW50ICogcEluc3RhbmNlLT5BbHBoYTsKKyAgICAgICAgcEluc3RhbmNlLT5DdXJyZW50ID0gVGFyZ2V0VGltZXNPbmVNaW5BbHBoYSArIEN1cnJlbnRUaW1lc0FscGhhOworCisgICAgICAgICAgICBUZW1wMSA9ICpzcmM7CisgICAgICAgICAgICBzcmMrKzsKKworICAgICAgICAgICAgVGVtcDIgPSBUZW1wMSAqIChwSW5zdGFuY2UtPkN1cnJlbnQpOworICAgICAgICAgICAgKmRzdCA9IFRlbXAyOworICAgICAgICAgICAgZHN0Kys7CisKKyAgICAgICAgICAgIFRlbXAxID0gKnNyYzsKKyAgICAgICAgICAgIHNyYysrOworCisgICAgICAgICAgICBUZW1wMiA9IFRlbXAxICogKHBJbnN0YW5jZS0+Q3VycmVudCk7CisgICAgICAgICAgICAqZHN0ID0gVGVtcDI7CisgICAgICAgICAgICBkc3QrKzsKKworICAgICAgICAgICAgVGVtcDEgPSAqc3JjOworICAgICAgICAgICAgc3JjKys7CisKKyAgICAgICAgICAgIFRlbXAyID0gVGVtcDEgKiAocEluc3RhbmNlLT5DdXJyZW50KTsKKyAgICAgICAgICAgICpkc3QgPSBUZW1wMjsKKyAgICAgICAgICAgIGRzdCsrOworCisgICAgICAgICAgICBUZW1wMSA9ICpzcmM7CisgICAgICAgICAgICBzcmMrKzsKKyAgICAgICAgICAgIFRlbXAyID0gVGVtcDEgKiAocEluc3RhbmNlLT5DdXJyZW50KTsKKyAgICAgICAgICAgICpkc3QgPSBUZW1wMjsKKyAgICAgICAgICAgIGRzdCsrOworICAgIH0KK30KKyNlbHNlCiB2b2lkIENvcmVfTWl4U29mdF8xU3RfRDMyQzMxX1dSQSggICBNaXhfMVN0X0NsbF90ICAgICAgICpwSW5zdGFuY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMzIgICAgICpzcmMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgICpkc3QsCkBAIC05OCw2ICsxNzAsNSBAQAogICAgICAgICAgICAgZHN0Kys7CiAgICAgfQogfQotCi0KKyNlbmRpZgogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9EQ18ySV9EMTZfVFJDX1dSQV8wMS5jIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvRENfMklfRDE2X1RSQ19XUkFfMDEuYwppbmRleCA0OWZhMTg0Li5kMjYxYzllIDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9EQ18ySV9EMTZfVFJDX1dSQV8wMS5jCisrKyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0RDXzJJX0QxNl9UUkNfV1JBXzAxLmMKQEAgLTE4LDcgKzE4LDUzIEBACiAjaW5jbHVkZSAiQklRVUFELmgiCiAjaW5jbHVkZSAiRENfMklfRDE2X1RSQ19XUkFfMDFfUHJpdmF0ZS5oIgogI2luY2x1ZGUgIkxWTV9NYWNyb3MuaCIKKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBEQ18ySV9EMTZfVFJDX1dSQV8wMSggQmlxdWFkX0ZMT0FUX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICpwRGF0YUluLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICAgKnBEYXRhT3V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgTnJTYW1wbGVzKQorICAgIHsKKyAgICAgICAgTFZNX0ZMT0FUIExlZnREQyxSaWdodERDOworICAgICAgICBMVk1fRkxPQVQgRGlmZjsKKyAgICAgICAgTFZNX0lOVDMyIGo7CisgICAgICAgIFBGaWx0ZXJfRkxPQVRfU3RhdGUgcEJpcXVhZFN0YXRlID0gKFBGaWx0ZXJfRkxPQVRfU3RhdGUpIHBJbnN0YW5jZTsKIAorICAgICAgICBMZWZ0REMgPSBwQmlxdWFkU3RhdGUtPkxlZnREQzsKKyAgICAgICAgUmlnaHREQyA9IHBCaXF1YWRTdGF0ZS0+UmlnaHREQzsKKyAgICAgICAgZm9yKGogPSBOclNhbXBsZXMtMTsgaiA+PSAwOyBqLS0pCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIFN1YnRyYWN0IERDIGFuIHNhdHVyYXRlICovCisgICAgICAgICAgICBEaWZmID0qIChwRGF0YUluKyspIC0gKExlZnREQyk7CisgICAgICAgICAgICBpZiAoRGlmZiA+IDEuMGYpIHsKKyAgICAgICAgICAgICAgICBEaWZmID0gMS4wZjsgfQorICAgICAgICAgICAgZWxzZSBpZiAoRGlmZiA8IC0xLjBmKSB7CisgICAgICAgICAgICAgICAgRGlmZiA9IC0xLjBmOyB9CisgICAgICAgICAgICAqKHBEYXRhT3V0KyspID0gKExWTV9GTE9BVClEaWZmOworICAgICAgICAgICAgaWYgKERpZmYgPCAwKSB7CisgICAgICAgICAgICAgICAgTGVmdERDIC09IERDX0ZMT0FUX1NURVA7IH0KKyAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgIExlZnREQyArPSBEQ19GTE9BVF9TVEVQOyB9CisKKworICAgICAgICAgICAgLyogU3VidHJhY3QgREMgYW4gc2F0dXJhdGUgKi8KKyAgICAgICAgICAgIERpZmYgPSogKHBEYXRhSW4rKykgLSAoUmlnaHREQyk7CisgICAgICAgICAgICBpZiAoRGlmZiA+IDEuMGYpIHsKKyAgICAgICAgICAgICAgICBEaWZmID0gMS4wZjsgfQorICAgICAgICAgICAgZWxzZSBpZiAoRGlmZiA8IC0xLjBmKSB7CisgICAgICAgICAgICAgICAgRGlmZiA9IC0xLjBmOyB9CisgICAgICAgICAgICAqKHBEYXRhT3V0KyspID0gKExWTV9GTE9BVClEaWZmOworICAgICAgICAgICAgaWYgKERpZmYgPCAwKSB7CisgICAgICAgICAgICAgICAgUmlnaHREQyAtPSBEQ19GTE9BVF9TVEVQOyB9CisgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICBSaWdodERDICs9IERDX0ZMT0FUX1NURVA7IH0KKworICAgICAgICB9CisgICAgICAgIHBCaXF1YWRTdGF0ZS0+TGVmdERDID0gTGVmdERDOworICAgICAgICBwQmlxdWFkU3RhdGUtPlJpZ2h0REMgPSBSaWdodERDOworCisKKyAgICB9CisjZWxzZQogdm9pZCBEQ18ySV9EMTZfVFJDX1dSQV8wMSggQmlxdWFkX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICpwRGF0YUluLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgKnBEYXRhT3V0LApAQCAtNjQsNCArMTEwLDQgQEAKIAogCiAgICAgfQotCisjZW5kaWYKZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0RDXzJJX0QxNl9UUkNfV1JBXzAxX0luaXQuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0RDXzJJX0QxNl9UUkNfV1JBXzAxX0luaXQuYwppbmRleCA0NjhhODhkLi40ZjRmY2Q4IDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9EQ18ySV9EMTZfVFJDX1dSQV8wMV9Jbml0LmMKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zc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9VSU5UMzIpKChMVk1fSU5UMzIpKCpkc3QpIC0gKExWTV9JTlQzMilkZWxheVtPZmZzZXRdKSA+PiAxKTsKKyAgICAgICAgKmRzdCA9IHRlbXA7CisgICAgICAgIGRzdCsrOworCisgICAgICAgIGRlbGF5W09mZnNldF0gPSAqc3JjOworICAgICAgICBPZmZzZXQrKzsKKyAgICAgICAgc3JjKys7CisKKyAgICAgICAgLyogTWFrZSB0aGUgcmV2ZXJiIGRlbGF5IGJ1ZmZlciBhIGNpcmN1bGFyIGJ1ZmZlciAqLworICAgICAgICBpZiAoT2Zmc2V0ID49IHNpemUpCisgICAgICAgIHsKKyAgICAgICAgICAgIE9mZnNldCA9IDA7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKiBVcGRhdGUgdGhlIG9mZnNldCAqLworICAgICpwT2Zmc2V0ID0gT2Zmc2V0OworCisgICAgcmV0dXJuOworfQorI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIERlbGF5TWl4X0Zsb2F0KGNvbnN0IExWTV9GTE9BVCAqc3JjLCAgICAgICAgICAgLyogU291cmNlIDEsIHRvIGJlIGRlbGF5ZWQgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICpkZWxheSwgICAgICAgICAvKiBEZWxheSBidWZmZXIgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2IHNpemUsICAgICAgICAgICAvKiBEZWxheSBzaXplICovCisgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAqZHN0LCAgICAgICAgICAgLyogU291cmNlL2Rlc3RpbmF0aW9uICovCisgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAqcE9mZnNldCwgICAgICAgLyogRGVsYXkgb2Zmc2V0ICovCisgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBuKSAgICAgICAgICAgICAgLyogTnVtYmVyIG9mIHN0ZXJlbyBzYW1wbGVzICovCit7CisgICAgTFZNX0lOVDE2ICAgaTsKKyAgICBMVk1fSU5UMTYgICBPZmZzZXQgID0gKnBPZmZzZXQ7CisgICAgTFZNX0ZMT0FUICAgdGVtcDsKKwogICAgIGZvciAoaT0wOyBpPG47IGkrKykKICAgICB7CiAgICAgICAgIC8qIExlZnQgY2hhbm5lbCAqLwotICAgICAgICB0ZW1wICAgICAgICAgICAgPSAoTFZNX0lOVDE2KSgoTFZNX1VJTlQzMikoKExWTV9JTlQzMikoKmRzdCkgKyAoTFZNX0lOVDMyKWRlbGF5W09mZnNldF0pID4+IDEpOworICAgICAgICB0ZW1wICAgICAgICAgICAgPSAoTFZNX0ZMT0FUKSgoTFZNX0ZMT0FUKSgqZHN0ICsgKExWTV9GTE9BVClkZWxheVtPZmZzZXRdKSAvIDIuMGYpOwogICAgICAgICAqZHN0ICAgICAgICAgICAgPSB0ZW1wOwogICAgICAgICBkc3QrKzsKIApAQCAtNDksNyArOTQsNyBAQAogCiAKICAgICAgICAgLyogUmlnaHQgY2hhbm5lbCAqLwotICAgICAgICB0ZW1wICAgICAgICAgICAgPSAoTFZNX0lOVDE2KSgoTFZNX1VJTlQzMikoKExWTV9JTlQzMikoKmRzdCkgLSAoTFZNX0lOVDMyKWRlbGF5W09mZnNldF0pID4+IDEpOworICAgICAgICB0ZW1wICAgICAgICAgICAgPSAoTFZNX0ZMT0FUKSgoTFZNX0ZMT0FUKSgqZHN0IC0gKExWTV9GTE9BVClkZWxheVtPZmZzZXRdKSAvIDIuMGYpOwogICAgICAgICAqZHN0ICAgICAgICAgICAgPSB0ZW1wOwogICAgICAgICBkc3QrKzsKIApAQCAtNjksNSArMTE0LDUgQEAKIAogICAgIHJldHVybjsKIH0KLQorI2VuZGlmCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0ZPXzFJX0QxNkYxNkMxNV9UUkNfV1JBXzAxLmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9GT18xSV9EMTZGMTZDMTVfVFJDX1dSQV8wMS5jCmluZGV4IGRlNzczNjEuLjAzOWM4OGMgMTAwNjQ0Ci0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0ZPXzFJX0QxNkYxNkMxNV9UUkNfV1JBXzAxLmMKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvRk9fMUlfRDE2RjE2QzE1X1RSQ19XUkFfMDEuYwpAQCAtMzEsNiArMzEsNDYgQEAKICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMV0gaXMgeShuLTEpTCBpbiBRMCBmb3JtYXQKICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAorI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIEZPXzFJX0QxNkYxNkMxNV9UUkNfV1JBXzAxKCBCaXF1YWRfRkxPQVRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICAgKnBEYXRhSW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAqcERhdGFPdXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBOclNhbXBsZXMpCisgICAgeworICAgICAgICBMVk1fRkxPQVQgIHluTDsKKyAgICAgICAgTFZNX0lOVDE2IGlpOworICAgICAgICBQRmlsdGVyX1N0YXRlX0ZMT0FUIHBCaXF1YWRTdGF0ZSA9IChQRmlsdGVyX1N0YXRlX0ZMT0FUKSBwSW5zdGFuY2U7CisKKyAgICAgICAgIGZvciAoaWkgPSBOclNhbXBsZXM7IGlpICE9IDA7IGlpLS0pCisgICAgICAgICB7CisKKyAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBST0NFU1NJTkcgT0YgVEhFIExFRlQgQ0hBTk5FTAorICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworICAgICAgICAgICAgLy8geW5MPUExICAqIHgobi0xKUwKKyAgICAgICAgICAgIHluTCA9IChMVk1fRkxPQVQpcEJpcXVhZFN0YXRlLT5jb2Vmc1swXSAqIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXTsKKworICAgICAgICAgICAgLy8geW5MKz1BMCAgKiB4KG4pTAorICAgICAgICAgICAgeW5MICs9IChMVk1fRkxPQVQpcEJpcXVhZFN0YXRlLT5jb2Vmc1sxXSAqICgqcERhdGFJbik7CisKKyAgICAgICAgICAgIC8vIHluTCs9ICAoLUIxICAqIHkobi0xKUwKKyAgICAgICAgICAgIHluTCArPSAoTFZNX0ZMT0FUKXBCaXF1YWRTdGF0ZS0+Y29lZnNbMl0gKiBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMV07CisKKyAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVQREFUSU5HIFRIRSBERUxBWVMKKyAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1sxXSA9IHluTDsgLy8gVXBkYXRlIHkobi0xKUwKKyAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXSA9ICgqcERhdGFJbisrKTsgLy8gVXBkYXRlIHgobi0xKUwKKworICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgV1JJVElORyBUSEUgT1VUUFVUCisgICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgICAgICAgICAqcERhdGFPdXQrKyA9IChMVk1fRkxPQVQpeW5MOyAvLyBXcml0ZSBMZWZ0IG91dHB1dAorCisgICAgICAgIH0KKworICAgIH0KKyNlbHNlCiB2b2lkIEZPXzFJX0QxNkYxNkMxNV9UUkNfV1JBXzAxKCBCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgKnBEYXRhSW4sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAqcERhdGFPdXQsCkBAIC03MSw0ICsxMTEsNCBAQAogICAgICAgICB9CiAKICAgICB9Ci0KKyNlbmRpZgpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvRk9fMUlfRDE2RjE2Q3NzX1RSQ19XUkFfMDFfSW5pdC5jIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvRk9fMUlfRDE2RjE2Q3NzX1RSQ19XUkFfMDFfSW5pdC5jCmluZGV4IDk2MjUyY2MuLmIyMWI4YTQgMTAwNjQ0Ci0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0ZPXzFJX0QxNkYxNkNzc19UUkNfV1JBXzAxX0luaXQuYworKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9GT18xSV9EMTZGMTZDc3NfVFJDX1dSQV8wMV9Jbml0LmMKQEAgLTM4LDYgKzM4LDIyIEBACiAvKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogICB2b2lkIHJldHVybiBjb2RlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgRk9fMUlfRDE2RjE2Q3NzX1RSQ19XUkFfMDFfSW5pdCggICAgQmlxdWFkX0ZMT0FUX0luc3RhbmNlX3QgICAgICAgICAqcEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCaXF1YWRfMUlfT3JkZXIxX0ZMT0FUX1RhcHNfdCAgICpwVGFwcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRk9fRkxPQVRfQ29lZnNfdCAgICAgICAgICAgICpwQ29lZikKK3sKKyAgICBMVk1fRkxPQVQgdGVtcDsKKyAgICBQRmlsdGVyX1N0YXRlX0ZMT0FUIHBCaXF1YWRTdGF0ZSA9IChQRmlsdGVyX1N0YXRlX0ZMT0FUKSAgcEluc3RhbmNlOworICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5cyAgICAgID0gKExWTV9GTE9BVCAqKXBUYXBzOworICAgIHRlbXAgPSBwQ29lZi0+QTE7C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ThlYiAxMDA2NDQKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvRk9fMUlfRDMyRjMyQzMxX1RSQ19XUkFfMDEuYworKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9GT18xSV9EMzJGMzJDMzFfVFJDX1dSQV8wMS5jCkBAIC0zMSw3ICszMSw0NyBAQAogIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXSBpcyB4KG4tMSlMIGluIFEwIGZvcm1hdAogIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1sxXSBpcyB5KG4tMSlMIGluIFEwIGZvcm1hdAogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIEZPXzFJX0QzMkYzMkMzMV9UUkNfV1JBXzAxKCBCaXF1YWRfRkxPQVRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICAgKnBEYXRhSW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAqcERhdGFPdXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBOclNhbXBsZXMpCisgICAgeworICAgICAgICBMVk1fRkxPQVQgIHluTCx0ZW1wbDsKKyAgICAgICAgTFZNX0lOVDE2ICBpaTsKKyAgICAgICAgUEZpbHRlcl9TdGF0ZV9GTE9BVCBwQmlxdWFkU3RhdGUgPSAoUEZpbHRlcl9TdGF0ZV9GTE9BVCkgcEluc3RhbmNlOwogCisgICAgICAgIGZvciAoaWkgPSBOclNhbXBsZXM7IGlpICE9IDA7IGlpLS0pCisgICAgICAgIHsKKworICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgUFJPQ0VTU0lORyBPRiBUSEUgTEVGVCBDSEFOTkVMCisgICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgICAgICAgICAvLyB5bkw9QTEgICogeChuLTEpTAorICAgICAgICAgICAgeW5MID0gcEJpcXVhZFN0YXRlLT5jb2Vmc1swXSAqIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXTsKKworICAgICAgICAgICAgLy8geW5MKz1BMCAgKiB4KG4pTAorICAgICAgICAgICAgdGVtcGwgPSBwQmlxdWFkU3RhdGUtPmNvZWZzWzFdICogKCpwRGF0YUluKTsKKyAgICAgICAgICAgIHluTCArPSB0ZW1wbDsKKworICAgICAgICAgICAgLy8geW5MKz0gICgtQjEgICogeShuLTEpTAorICAgICAgICAgICAgdGVtcGwgPSBwQmlxdWFkU3RhdGUtPmNvZWZzWzJdICogcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzFdOworICAgICAgICAgICAgeW5MICs9IHRlbXBsOworCisgICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBVUERBVElORyBUSEUgREVMQVlTCisgICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMV0gPSB5bkw7IC8vIFVwZGF0ZSB5KG4tMSlMCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMF0gPSAoKnBEYXRhSW4rKyk7IC8vIFVwZGF0ZSB4KG4tMSlMCisKKyAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdSSVRJTkcgVEhFIE9VVFBVVAorICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworICAgICAgICAgICAgKnBEYXRhT3V0KysgPSAoTFZNX0ZMT0FUKXluTDsgLy8gV3JpdGUgTGVmdCBvdXRwdXQgaW4gUTAKKyAgICAgICAgfQorCisgICAgfQorI2Vsc2UKIHZvaWQgRk9fMUlfRDMyRjMyQzMxX1RSQ19XUkFfMDEoIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgICAgICAgICAgICAqcERhdGFJbiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgICpwRGF0YU91dCwKQEAgLTcxLDQgKzExMSw0IEBACiAgICAgICAgIH0KIAogICAgIH0KLQorI2VuZGlmCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9GT18xSV9EMzJGMzJDbGxfVFJDX1dSQV8wMV9Jbml0LmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9GT18xSV9EMzJGMzJDbGxfVFJDX1dSQV8wMV9Jbml0LmMKaW5kZXggMTM2ZTRmNi4uZjMzZDI0ZCAxMDA2NDQKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvRk9fMUlfRDMyRjMyQ2xsX1RSQ19XUkFfMDFfSW5pdC5jCisrKyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0ZPXzFJX0QzMkYzMkNsbF9UUkNfV1JBXzAxX0luaXQuYwpAQCAtMzcsNiArMzcsMjMgQEAKIC8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiAgIHZvaWQgcmV0dXJuIGNvZGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBGT18xSV9EMzJGMzJDbGxfVFJDX1dSQV8wMV9Jbml0KCBCaXF1YWRfRkxPQVRfSW5zdGFuY2VfdCAgICAgICAgICpwSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJpcXVhZF8xSV9PcmRlcjFfRkxPQVRfVGFwc190ICAgKnBUYXBzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGT19GTE9BVF9Db2Vmc190ICAgICAgICAgICAgKnBDb2VmKQoreworICAgIExWTV9GTE9BVCB0ZW1wOworICAgIFBGaWx0ZXJfU3RhdGVfRkxPQVQgcEJpcXVhZFN0YXRlID0gKFBGaWx0ZXJfU3RhdGVfRkxPQVQpICBwSW5zdGFuY2U7CisgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzICAgICAgPSAoTFZNX0ZMT0FUICopICAgIHBUYXBzOworCisgICAgdGVtcCA9IHBDb2VmLT5BMTsKKyAgICBwQmlxdWFkU3RhdGUtPmNvZWZzWzBdID0gdGVtcDsKKyAgICB0ZW1wID0gcENvZWYtPkEwOworICAgIHBCaXF1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VFJDX1dSQV8wMS5jCkBAIC0zMiw3ICszMiw5MiBAQAogcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzJdIGlzIHgobi0xKVIgaW4gUTE1IGZvcm1hdAogcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzNdIGlzIHkobi0xKVIgaW4gUTMwIGZvcm1hdAogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIEZPXzJJX0QxNkYzMkMxNV9MU2h4X1RSQ19XUkFfMDEoQmlxdWFkX0ZMT0FUX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAqcERhdGFJbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAqcERhdGFPdXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgTnJTYW1wbGVzKQorICAgIHsKKyAgICAgICAgTFZNX0ZMT0FUICAgeW5MLHluUjsKKyAgICAgICAgTFZNX0ZMT0FUICAgVGVtcDsKKyAgICAgICAgTFZNX0ZMT0FUICAgTmVnU2F0VmFsdWU7CisgICAgICAgIExWTV9JTlQxNiAgIGlpOwogCisgICAgICAgIFBGaWx0ZXJfRmxvYXRfU3RhdGUgcEJpcXVhZFN0YXRlID0gKFBGaWx0ZXJfRmxvYXRfU3RhdGUpIHBJbnN0YW5jZTsKKworICAgICAgICBOZWdTYXRWYWx1ZSA9IC0xLjBmOworCisgICAgICAgIGZvciAoaWkgPSBOclNhbXBsZXM7IGlpICE9IDA7IGlpLS0pCisgICAgICAgIHsKKworICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgUFJPQ0VTU0lORyBPRiBUSEUgTEVGVCBDSEFOTkVMCisgICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyAgICAgICAgICAgIC8vIHluTCA9QTEgICogeChuLTEpTAorICAgICAgICAgICAgeW5MID0gKExWTV9GTE9BVClwQmlxdWFkU3RhdGUtPmNvZWZzWzBdICogcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzBdOworICAgICAgICAgICAgLy8geW5SID1BMSAgKiB4KG4tMSlSCisgICAgICAgICAgICB5blIgPSAoTFZNX0ZMT0FUKXBCaXF1YWRTdGF0ZS0+Y29lZnNbMF0gKiBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMl07CisKKworICAgICAgICAgICAgLy8geW5MKz1BMCAgKiB4KG4pTAorICAgICAgICAgICAgeW5MICs9IChMVk1fRkxPQVQpcEJpcXVhZFN0YXRlLT5jb2Vmc1sxXSAqICgqcERhdGFJbik7CisgICAgICAgICAgICAvLyB5blIrPUEwICAqIHgobilMCisgICAgICAgICAgICB5blIgKz0gKExWTV9GTE9BVClwQmlxdWFkU3RhdGUtPmNvZWZzWzFdICogKCoocERhdGFJbisxKSk7CisKKworICAgICAgICAgICAgLy8geW5MICs9ICAoLUIxICAqIHkobi0xKUwgICkKKyAgICAgICAgICAgIFRlbXAgPSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMV0gKiBwQmlxdWFkU3RhdGUtPmNvZWZzWzJdOworICAgICAgICAgICAgeW5MICs9IFRlbXA7CisgICAgICAgICAgICAvLyB5blIgKz0gICgtQjEgICogeShuLTEpUiApICkKKyAgICAgICAgICAgIFRlbXAgPSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbM10gKiBwQmlxdWFkU3RhdGUtPmNvZWZzWzJdOworICAgICAgICAgICAgeW5SICs9IFRlbXA7CisKKworICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgVVBEQVRJTkcgVEhFIERFTEFZUworICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzFdID0geW5MOyAvLyBVcGRhdGUgeShuLTEpTAorICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzBdID0gKCpwRGF0YUluKyspOyAvLyBVcGRhdGUgeChuLTEpTAorCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbM10gPSB5blI7IC8vIFVwZGF0ZSB5KG4tMSlSCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMl0gPSAoKnBEYXRhSW4rKyk7IC8vIFVwZGF0ZSB4KG4tMSlSCisKKyAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdSSVRJTkcgVEhFIE9VVFBVVAorICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisgICAgICAgICAgICAvKlNhdHVyYXRlIHJlc3VsdHMqLworICAgICAgICAgICAgaWYoeW5MID4gMS4wZikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB5bkwgPSAxLjBmOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKHluTCA8IE5lZ1NhdFZhbHVlKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeW5MID0gTmVnU2F0VmFsdWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZih5blIgPiAxLjBmKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHluUiA9IDEuMGY7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYoeW5SIDwgTmVnU2F0VmFsdWUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB5blIgPSBOZWdTYXRWYWx1ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICpwRGF0YU91dCsrID0gKExWTV9GTE9BVCl5bkw7CisgICAgICAgICAgICAqcERhdGFPdXQrKyA9IChMVk1fRkxPQVQpeW5SOworICAgICAgICB9CisKKyAgICB9CisjZWxzZQogdm9pZCBGT18ySV9EMTZGMzJDMTVfTFNoeF9UUkNfV1JBXzAxKEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgKnBEYXRhSW4sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgKnBEYXRhT3V0LApAQCAtMTI1LDQgKzIxMCw0IEBACiAgICAgICAgIH0KIAogICAgIH0KLQorI2VuZGlmCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9GT18ySV9EMTZGMzJDc3NfTFNoeF9UUkNfV1JBXzAxX0luaXQuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0ZPXzJJX0QxNkYzMk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WU4Yi4uMmM2ZTZjMyAxMDA2NDQKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvRnJvbTJpVG9NU18xNngxNi5jCisrKyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0Zyb20yaVRvTVNfMTZ4MTYuYwpAQCAtNTMsNSArNTMsMzQgQEAKIAogICAgIHJldHVybjsKIH0KKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBGcm9tMmlUb01TX0Zsb2F0KCBjb25zdCBMVk1fRkxPQVQgICpzcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgKmRzdE0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgKmRzdFMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgbiApCit7CisgICAgTFZNX0ZMT0FUIHRlbXAxLGxlZnQscmlnaHQ7CisgICAgTFZNX0lOVDE2IGlpOworICAgIGZvciAoaWkgPSBuOyBpaSAhPSAwOyBpaS0tKQorICAgIHsKKyAgICAgICAgbGVmdCA9IChMVk1fRkxPQVQpKnNyYzsKKyAgICAgICAgc3JjKys7CiAKKyAgICAgICAgcmlnaHQgPSAoTFZNX0ZMT0FUKSpzcmM7CisgICAgICAgIHNyYysrOworCisgICAgICAgIC8qIENvbXB1dGUgTSBzaWduYWwqLworICAgICAgICB0ZW1wMSA9ICAobGVmdCArIHJpZ2h0KSAvIDIuMGY7CisgICAgICAgICpkc3RNID0gKExWTV9GTE9BVCl0ZW1wMTsKKyAgICAgICAgZHN0TSsrOworCisgICAgICAgIC8qIENvbXB1dGUgUyBzaWduYWwqLworICAgICAgICB0ZW1wMSA9ICAobGVmdCAtIHJpZ2h0KSAvIDIuMGY7CisgICAgICAgICpkc3RTID0gKExWTV9GTE9BVCl0ZW1wMTsKKyAgICAgICAgZHN0UysrOworICAgIH0KKworICAgIHJldHVybjsKK30KKyNlbmRpZgogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9Gcm9tMmlUb01vbm9fMzIuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0Zyb20yaVRvTW9ub18zMi5jCmluZGV4IDhiYjI5MmYuLmFjMWVlYTggMTAwNjQ0Ci0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0Zyb20yaVRvTW9ub18zMi5jCisrKyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0Zyb20yaVRvTW9ub18zMi5jCkBAIC00Niw1ICs0NiwyNyBAQAogCiAgICAgcmV0dXJuOwogfQorI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIEZyb20yaVRvTW9ub19GbG9hdCggY29uc3QgTFZNX0ZMT0FUICpzcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICpkc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2IG4pCit7CisgICAgTFZNX0lOVDE2IGlpOworICAgIExWTV9GTE9BVCBUZW1wOwogCisgICAgZm9yIChpaSA9IG47IGlpICE9IDA7IGlpLS0pCisgICAgeworICAgICAgICBUZW1wID0gKCpzcmMpOworICAgICAgICBzcmMrKzsKKworICAgICAgICBUZW1wICs9ICgqc3JjKTsKKyAgICAgICAgc3JjKys7CisKKyAgICAgICAgKmRzdCA9IFRlbXAgLyAyLjBmOworICAgICAgICBkc3QrKzsKKyAgICB9CisKKyAgICByZXR1cm47Cit9CisjZW5kaWYKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvSm9pblRvMmlfMzJ4MzIuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0pvaW5UbzJpXzMyeDMyLmMKaW5kZXggOWI5MzhiZC4uZWJjNDc3ZSAxMDA2NDQKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvSm9pblRvMmlfMzJ4MzIuYworKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9Kb2luVG8yaV8zMngzMi5jCkBAIC00OSw2ICs0OSwzMSBAQAogCiAgICAgcmV0dXJuOwogfQorI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIEpvaW5UbzJpX0Zsb2F0KCBjb25zdCBMVk1fRkxPQVQgICAgKnNyY0wsCisgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fRkxPQVQgICAgKnNyY1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgKmRzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICBuICkKK3sKKyAgICBMVk1fSU5UMTYgaWk7CiAKKyAgICBzcmNMICs9IG4gLSAxOworICAgIHNyY1IgKz0gbiAtIDE7CisgICAgZHN0ICArPSAoKDIgKiBuKSAtIDEpOworCisgICAgZm9yIChpaSA9IG47IGlpICE9IDA7IGlpLS0pCisgICAgeworICAgICAgICAqZHN0ID0gKnNyY1I7CisgICAgICAgIGRzdC0tOworICAgICAgICBzcmNSLS07CisKKyAgICAgICAgKmRzdCA9ICpzcmNMOworICAgICAgICBkc3QtLTsKKyAgICAgICAgc3JjTC0tOworICAgIH0KKworICAgIHJldHVybjsKK30KKyNlbmRpZgogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xWQ19Db3JlX01peEhhcmRfMVN0XzJpX0QxNkMzMV9TQVQuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xWQ19Db3JlX01peEhhcmRfMVN0XzJpX0QxNkMzMV9TQVQuYwppbmRleCAzZDM5YjkzLi5lYjU3NTVlIDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVkNfQ29yZV9NaXhIYXJkXzFTdF8yaV9EMTZDMzFfU0FULmMKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTFZDX0NvcmVfTWl4SGFyZF8xU3RfMmlfRDE2QzMxX1NBVC5jCkBAIC0yNyw3ICsyNywzOSBAQAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICAgIEZVTkNUSU9OIExWQ19Db3JlX01peEhhcmRfMVN0XzJpX0QxNkMzMV9TQVQKICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIExWQ19Db3JlX01peEhhcmRfMVN0XzJpX0QxNkMzMV9TQVQoIExWTWl4ZXIzX0ZMT0FUX3N0ICAgICAgICAqcHRySW5zdGFuY2UxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1peGVyM19GTE9BVF9zdCAgICAgICAgKnB0ckluc3RhbmNlMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICAgICpzcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAqZHN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgbikKK3sKKyAgICBMVk1fRkxPQVQgIFRlbXA7CisgICAgTFZNX0lOVDE2IGlpOworICAgIE1peF9Qcml2YXRlX0ZMT0FUX3N0ICAqcEluc3RhbmNlMSA9IChNaXhfUHJpdmF0ZV9GTE9BVF9zdCAqKShwdHJJbnN0YW5jZTEtPlByaXZhdGVQYXJhbXMpOworICAgIE1peF9Qcml2YXRlX0ZMT0FUX3N0ICAqcEluc3RhbmNlMiA9IChNaXhfUHJpdmF0ZV9GTE9BVF9zdCAqKShwdHJJbnN0YW5jZTItPlByaXZhdGVQYXJhbXMpOworICAgIGZvciAoaWkgPSBuOyBpaSAhPSAwOyBpaS0tKQorICAgIHsKKyAgICAgICAgVGVtcCA9ICgoTFZNX0ZMT0FUKSooc3JjKyspICogKExWTV9GTE9BVClwSW5zdGFuY2UxLT5DdXJyZW50KTsKKyAgICAgICAgaWYgKFRlbXAgPiAxLjBmKQorICAgICAgICAgICAgKmRzdCsrID0gMS4wZjsKKyAgICAgICAgZWxzZSBpZiAoVGVtcCA8IC0xLjBmKQorICAgICAgICAgICAgKmRzdCsrID0gLTEuMGY7CisgICAgICAgIGVsc2UKKyAgICAgICAgICAgICpkc3QrKyA9IChMVk1fRkxPQVQpVGVtcDsKIAorICAgICAgICBUZW1wID0gKChMVk1fRkxPQVQpKihzcmMrKykgKiAoTFZNX0ZMT0FUKXBJbnN0YW5jZTItPkN1cnJlbnQpOworICAgICAgICBpZiAoVGVtcCA+IDEuMGYpCisgICAgICAgICAgICAqZHN0KysgPSAxLjBmOworICAgICAgICBlbHNlIGlmIChUZW1wIDwgLTEuMGYpCisgICAgICAgICAgICAqZHN0KysgPSAtMS4wZjsKKyAgICAgICAgZWxzZQorICAgICAgICAgICAgKmRzdCsrID0gKExWTV9GTE9BVClUZW1wOworICAgIH0KKworCit9CisjZWxzZQogdm9pZCBMVkNfQ29yZV9NaXhIYXJkXzFTdF8yaV9EMTZDMzFfU0FUKCBMVk1peGVyM19zdCAgICAgICAgKnB0ckluc3RhbmNlMSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNaXhlcjNfc3QgICAgICAgICpwdHJJbnN0YW5jZTIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiAgICAqc3JjLApAQCAtNjYsNCArOTgsNSBAQAogCiAKIH0KKyNlbmRpZgogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVkNfQ29yZV9NaXhIYXJkXzJTdF9EMTZDMzFfU0FULmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVkNfQ29yZV9NaXhIYXJkXzJTdF9EMTZDMzFfU0FULmMKaW5kZXggMmRhZjc0YS4uZWMwYmFhZiAxMDA2NDQKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTFZDX0NvcmVfTWl4SGFyZF8yU3RfRDE2QzMxX1NBVC5jCisrKyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xWQ19Db3JlX01peEhhcmRfMlN0X0QxNkMzMV9TQVQuYwpAQCAtMjQsNyArMjQsMzcgQEAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgICBGVU5DVElPTiBMVkNvcmVfTUlYSEFSRF8yU1RfRDE2QzMxX1NBVAogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgTFZDX0NvcmVfTWl4SGFyZF8yU3RfRDE2QzMxX1NBVCggTFZNaXhlcjNfRkxPQVRfc3QgKnB0ckluc3RhbmNlMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTWl4ZXIzX0ZMT0FUX3N0ICAgICAgICAgKnB0ckluc3RhbmNlMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9GTE9BVCAgICAgKnNyYzEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fRkxPQVQgICAgICpzcmMyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAqZHN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICBuKQoreworICAgIExWTV9GTE9BVCAgVGVtcDsKKyAgICBMVk1fSU5UMTYgaWk7CisgICAgTFZNX0ZMT0FUIEN1cnJlbnQxOworICAgIExWTV9GTE9BVCBDdXJyZW50MjsKKyAgICBNaXhfUHJpdmF0ZV9GTE9BVF9zdCAgKnBJbnN0YW5jZTEgPSAoTWl4X1ByaXZhdGVfRkxPQVRfc3QgKikocHRySW5zdGFuY2UxLT5Qcml2YXRlUGFyYW1zKTsKKyAgICBNaXhfUHJpdmF0ZV9GTE9BVF9zdCAgKnBJbnN0YW5jZTIgPSAoTWl4X1ByaXZhdGVfRkxPQVRfc3QgKikocHRySW5zdGFuY2UyLT5Qcml2YXRlUGFyYW1zKTsKIAorCisgICAgQ3VycmVudDEgPSAocEluc3RhbmNlMS0+Q3VycmVudCk7CisgICAgQ3VycmVudDIgPSAocEluc3RhbmNlMi0+Q3VycmVudCk7CisKKyAgICBmb3IgKGlpID0gbjsgaWkgIT0gMDsgaWktLSl7CisgICAgICAgIFRlbXAgPSAoKChMVk1fRkxPQVQpKihzcmMxKyspICogKExWTV9GTE9BVClDdXJyZW50MSkpICsKKyAgICAgICAgICAgICAgICgoKExWTV9GTE9BVCkqKHNyYzIrKykgKiAoTFZNX0ZMT0FUKUN1cnJlbnQyKSk7CisgICAgICAgIGlmIChUZW1wID4gMS4wZikKKyAgICAgICAgICAgICpkc3QrKyA9IDEuMGY7CisgICAgICAgIGVsc2UgaWYgKFRlbXAgPCAtMS4wZikKKyAgICAgICAgICAgICpkc3QrKyA9IC0xLjBmOworICAgICAgICBlbHNlCisgICAgICAgICAgICAqZHN0KysgPSBUZW1wOworICAgIH0KK30KKyNlbHNlCiB2b2lkIExWQ19Db3JlX01peEhhcmRfMlN0X0QxNkMzMV9TQVQoIExWTWl4ZXIzX3N0ICpwdHJJbnN0YW5jZTEsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1peGVyM19zdCAgICAgICAgICpwdHJJbnN0YW5jZTIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMTYgICAgICpzcmMxLApAQCAtNTQsNiArODQsNSBAQAogICAgICAgICAgICAgKmRzdCsrID0gKExWTV9JTlQxNilUZW1wOwogICAgIH0KIH0KLQotCisjZW5kaWYKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTFZDX0NvcmVfTWl4SW5Tb2Z0X0QxNkMzMV9TQVQuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xWQ19Db3JlX01peEluU29mdF9EMTZDMzFfU0FULmMKaW5kZXggY2FhMDk1MS4uZDI2OTRjYyAxMDA2NDQKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTFZDX0NvcmVfTWl4SW5Tb2Z0X0QxNkMzMV9TQVQuYworKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVkNfQ29yZV9NaXhJblNvZnRfRDE2QzMxX1NBVC5jCkBAIC0yNSw3ICsyNSw5NiBAQAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICAgIEZVTkNUSU9OIExWQ29yZV9NSVhTT0ZUXzFTVF9EMTZDMzFfV1JBCiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBMVkNfQ29yZV9NaXhJblNvZnRfRDE2QzMxX1NBVCggTFZNaXhlcjNfRkxPQVRfc3QgKnB0ckluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICAgICAqc3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAqZHN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICBuKQorewogCisgICAgTFZNX0lOVDE2ICAgT3V0TG9vcDsKKyAgICBMVk1fSU5UMTYgICBJbkxvb3A7CisgICAgTFZNX0lOVDMyICAgaWksamo7CisgICAgTWl4X1ByaXZhdGVfRkxPQVRfc3QgICpwSW5zdGFuY2UgPSAoTWl4X1ByaXZhdGVfRkxPQVRfc3QgKikocHRySW5zdGFuY2UtPlByaXZhdGVQYXJhbXMpOworICAgIExWTV9GTE9BVCAgIERlbHRhID0gcEluc3RhbmNlLT5EZWx0YTsKKyAgICBMVk1fRkxPQVQgICBDdXJyZW50ID0gcEluc3RhbmNlLT5DdXJyZW50OworICAgIExWTV9GTE9BVCAgIFRhcmdldCA9IHBJbnN0YW5jZS0+VGFyZ2V0OworICAgIExWTV9GTE9BVCAgIFRlbXA7CisKKyAgICBJbkxvb3AgPSAoTFZNX0lOVDE2KShuID4+IDIpOyAvKiBQcm9jZXNzIHBlciA0IHNhbXBsZXMgKi8KKyAgICBPdXRMb29wID0gKExWTV9JTlQxNikobiAtIChJbkxvb3AgPDwgMikpOworCisgICAgaWYoQ3VycmVudCA8IFRhcmdldCl7CisgICAgICAgIGlmIChPdXRMb29wKXsKKyAgICAgICAgICAgIFRlbXAgPSBDdXJyZW50ICsgRGVsdGE7CisgICAgICAgICAgICBDdXJyZW50ID0gVGVtcDsKKyAgICAgICAgICAgIGlmIChDdXJyZW50ID4gVGFyZ2V0KQorICAgICAgICAgICAgICAgIEN1cnJlbnQgPSBUYXJnZXQ7CisKKyAgICAgICAgICAgZm9yIChpaSA9IE91dExvb3A7IGlpICE9IDA7IGlpLS0peworICAgICAgICAgICAgICAgIFRlbXAgPSAoKExWTV9GTE9BVCkqZHN0KSArICgoKExWTV9GTE9BVCkqKHNyYysrKSAqIEN1cnJlbnQpKTsKKyAgICAgICAgICAgICAgICBpZiAoVGVtcCA+IDEuMGYpCisgICAgICAgICAgICAgICAgICAgICpkc3QrKyA9IDEuMGY7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoVGVtcCA8IC0xLjBmKQorICAgICAgICAgICAgICAgICAgICAqZHN0KysgPSAtMS4wZjsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICpkc3QrKyA9IChMVk1fRkxPQVQpVGVtcDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGZvciAoaWkgPSBJbkxvb3A7IGlpICE9IDA7IGlpLS0peworICAgICAgICAgICAgVGVtcCA9IEN1cnJlbnQgKyBEZWx0YTsKKyAgICAgICAgICAgIEN1cnJlbnQgPSBUZW1wOworICAgICAgICAgICAgaWYgKEN1cnJlbnQgPiBUYXJnZXQpCisgICAgICAgICAgICAgICAgQ3VycmVudCA9IFRhcmdldDsKKworICAgICAgICAgICAgZm9yIChqaiA9IDQ7IGpqICE9IDAgOyBqai0tKXsKKyAgICAgICAgICAgICAgICBUZW1wID0gKChMVk1fRkxPQVQpKmRzdCkgKyAoKChMVk1fRkxPQVQpKihzcmMrKykgKiBDdXJyZW50KSk7CisgICAgICAgICAgICAgICAgaWYgKFRlbXAgPiAxLjBmKQorICAgICAgICAgICAgICAgICAgICAqZHN0KysgPSAxLjBmOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKFRlbXAgPCAtMS4wZikKKyAgICAgICAgICAgICAgICAgICAgKmRzdCsrID0gLTEuMGY7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAqZHN0KysgPSAoTFZNX0ZMT0FUKVRlbXA7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZXsKKyAgICAgICAgaWYgKE91dExvb3ApeworICAgICAgICAgICAgQ3VycmVudCAtPSBEZWx0YTsKKyAgICAgICAgICAgIGlmIChDdXJyZW50IDwgVGFyZ2V0KQorICAgICAgICAgICAgICAgIEN1cnJlbnQgPSBUYXJnZXQ7CisKKyAgICAgICAgICAgIGZvciAoaWkgPSBPdXRMb29wOyBpaSAhPSAwOyBpaS0tKXsKKyAgICAgICAgICAgICAgICBUZW1wID0gKChMVk1fRkxPQVQpKmRzdCkgKyAoKChMVk1fRkxPQVQpKihzcmMrKykgKiBDdXJyZW50KSk7CisgICAgICAgICAgICAgICAgaWYgKFRlbXAgPiAxLjBmKQorICAgICAgICAgICAgICAgICAgICAqZHN0KysgPSAxLjBmOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKFRlbXAgPCAtMS4wZikKKyAgICAgICAgICAgICAgICAgICAgKmRzdCsrID0gLTEuMGY7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAqZHN0KysgPSAoTFZNX0ZMT0FUKVRlbXA7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBmb3IgKGlpID0gSW5Mb29wOyBpaSAhPSAwOyBpaS0tKXsKKyAgICAgICAgICAgIEN1cnJlbnQgLT0gRGVsdGE7CisgICAgICAgICAgICBpZiAoQ3VycmVudCA8IFRhcmdldCkKKyAgICAgICAgICAgICAgICBDdXJyZW50ID0gVGFyZ2V0OworCisgICAgICAgICAgICBmb3IgKGpqID0gNDsgamogIT0gMCA7IGpqLS0peworICAgICAgICAgICAgICAgIFRlbXAgPSAoKExWTV9GTE9BVCkqZHN0KSArICgoKExWTV9GTE9BVCkqKHNyYysrKSAqIEN1cnJlbnQpKTsKKyAgICAgICAgICAgICAgICBpZiAoVGVtcCA+IDEuMGYpCisgICAgICAgICAgICAgICAgICAgICpkc3QrKyA9IDEuMGY7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoVGVtcCA8IC0xLjBmKQorICAgICAgICAgICAgICAgICAgICAqZHN0KysgPSAtMS4wZjsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICpkc3QrKyA9IChMVk1fRkxPQVQpVGVtcDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICBwSW5zdGFuY2UtPkN1cnJlbnQgPSBDdXJyZW50OworfQorI2Vsc2UKIHZvaWQgTFZDX0NvcmVfTWl4SW5Tb2Z0X0QxNkMzMV9TQVQoIExWTWl4ZXIzX3N0ICpwdHJJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiAgICAgKnNyYywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgKmRzdCwKQEAgLTEyMyw2ICsyMTIsNSBAQAogICAgIH0KICAgICBwSW5zdGFuY2UtPkN1cnJlbnQ9Q3VycmVudDsKIH0KLQotCisjZW5kaWYKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTFZDX0NvcmVfTWl4U29mdF8xU3RfMmlfRDE2QzMxX1dSQS5jIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTFZDX0NvcmVfTWl4U29mdF8xU3RfMmlfRDE2QzMxX1dSQS5jCmluZGV4IDA5ZWM0MjcuLjY1NmExMTcgMTAwNjQ0Ci0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xWQ19Db3JlX01peFNvZnRfMVN0XzJpX0QxNkMzMV9XUkEuYworKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVkNfQ29yZV9NaXhTb2Z0XzFTdF8yaV9EMTZDMzFfV1JBLmMKQEAgLTI2LDcgKzI2LDEyNyBAQAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICAgIEZVTkNUSU9OIExWQ19Db3JlX01peFNvZnRfMVN0XzJpX0QxNkMzMV9XUkEKICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmZGVmIEJVSUxEX0ZMT0FUCitzdGF0aWMgTFZNX0ZMT0FUIEFERDJfU0FUX0ZMT0FUKExWTV9GTE9BVCBhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgYiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUIGMpCit7CisgICAgTFZNX0ZMT0FUIHRlbXA7CisgICAgdGVtcCA9IGEgKyBiIDsKKyAgICBpZiAodGVtcCA8IC0xLjBmKQorICAgICAgICBjID0gLTEuMGY7CisgICAgZWxzZSBpZiAodGVtcCA+IDEuMGYpCisgICAgICAgIGMgPSAxLjBmOworICAgIGVsc2UKKyAgICAgICAgYyA9IHRlbXA7CisgICAgcmV0dXJuIGM7Cit9Cit2b2lkIExWQ19Db3JlX01peFNvZnRfMVN0XzJpX0QxNkMzMV9XUkEoIExWTWl4ZXIzX0ZMT0FUX3N0ICAgICAgICAqcHRySW5zdGFuY2UxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1peGVyM19GTE9BVF9zdCAgICAgICAgKnB0ckluc3RhbmNlMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICAgICpzcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAqZHN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgbikKK3sKKyAgICBMVk1fSU5UMTYgICBPdXRMb29wOworICAgIExWTV9JTlQxNiAgIEluTG9vcDsKKyAgICBMVk1fSU5UMzIgICBpaTsKKyAgICBNaXhfUHJpdmF0ZV9GTE9BVF9zdCAgKnBJbnN0YW5jZUwgPSAoTWl4X1ByaXZhdGVfRkxPQVRfc3QgKikocHRySW5zdGFuY2UxLT5Qcml2YXRlUGFyYW1zKTsKKyAgICBNaXhfUHJpdmF0ZV9GTE9BVF9zdCAgKnBJbnN0YW5jZVIgPSAoTWl4X1ByaXZhdGVfRkxPQVRfc3QgKikocHRySW5zdGFuY2UyLT5Qcml2YXRlUGFyYW1zKTsKIAorICAgIExWTV9GTE9BVCAgIERlbHRhTCA9IHBJbnN0YW5jZUwtPkRlbHRhOworICAgIExWTV9GTE9BVCAgIEN1cnJlbnRMID0gcEluc3RhbmNlTC0+Q3VycmVudDsKKyAgICBMVk1fRkxPQVQgICBUYXJnZXRMID0gcEluc3RhbmNlTC0+VGFyZ2V0OworCisgICAgTFZNX0ZMT0FUICAgRGVsdGFSID0gcEluc3RhbmNlUi0+RGVsdGE7CisgICAgTFZNX0ZMT0FUICAgQ3VycmVudFIgPSBwSW5zdGFuY2VSLT5DdXJyZW50OworICAgIExWTV9GTE9BVCAgIFRhcmdldFIgPSBwSW5zdGFuY2VSLT5UYXJnZXQ7CisKKyAgICBMVk1fRkxPQVQgICBUZW1wID0gMDsKKworICAgIEluTG9vcCA9IChMVk1fSU5UMTYpKG4gPj4gMik7IC8qIFByb2Nlc3MgcGVyIDQgc2FtcGxlcyAqLworICAgIE91dExvb3AgPSAoTFZNX0lOVDE2KShuIC0gKEluTG9vcCA8PCAyKSk7CisKKyAgICBpZiAoT3V0TG9vcCkKKyAgICB7CisgICAgICAgIGlmKEN1cnJlbnRMIDwgVGFyZ2V0TCkKKyAgICAgICAgeworICAgICAgICAgICAgQUREMl9TQVRfRkxPQVQoQ3VycmVudEwsIERlbHRhTCwgVGVtcCk7CisgICAgICAgICAgICBDdXJyZW50TCA9IFRlbXA7CisgICAgICAgICAgICBpZiAoQ3VycmVudEwgPiBUYXJnZXRMKQorICAgICAgICAgICAgICAgIEN1cnJlbnRMID0gVGFyZ2V0TDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIEN1cnJlbnRMIC09IERlbHRhTDsKKyAgICAgICAgICAgIGlmIChDdXJyZW50TCA8IFRhcmdldEwpCisgICAgICAgICAgICAgICAgQ3VycmVudEwgPSBUYXJnZXRMOworICAgICAgICB9CisKKyAgICAgICAgaWYoQ3VycmVudFIgPCBUYXJnZXRSKQorICAgICAgICB7CisgICAgICAgICAgICBBREQyX1NBVF9GTE9BVChDdXJyZW50UiwgRGVsdGFSLCBUZW1wKTsKKyAgICAgICAgICAgIEN1cnJlbnRSID0gVGVtcDsKKyAgICAgICAgICAgIGlmIChDdXJyZW50UiA+IFRhcmdldFIpCisgICAgICAgICAgICAgICAgQ3VycmVudFIgPSBUYXJnZXRSOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgQ3VycmVudFIgLT0gRGVsdGFSOworICAgICAgICAgICAgaWYgKEN1cnJlbnRSIDwgVGFyZ2V0UikKKyAgICAgICAgICAgICAgICBDdXJyZW50UiA9IFRhcmdldFI7CisgICAgICAgIH0KKworICAgICAgICBmb3IgKGlpID0gT3V0TG9vcCAqIDI7IGlpICE9IDA7IGlpIC09IDIpCisgICAgICAgIHsKKyAgICAgICAgICAgICooZHN0KyspID0gKExWTV9GTE9BVCkoKChMVk1fRkxPQVQpKihzcmMrKykgKiAoTFZNX0ZMT0FUKUN1cnJlbnRMKSk7CisgICAgICAgICAgICAqKGRzdCsrKSA9IChMVk1fRkxPQVQpKCgoTFZNX0ZMT0FUKSooc3JjKyspICogKExWTV9GTE9BVClDdXJyZW50UikpOworICAgICAgICB9CisgICAgfQorCisgICAgZm9yIChpaSA9IEluTG9vcCAqIDI7IGlpICE9IDA7IGlpLT0yKQorICAgIHsKKyAgICAgICAgaWYoQ3VycmVudEwgPCBUYXJnZXRMKQorICAgICAgICB7CisgICAgICAgICAgICBBREQyX1NBVF9GTE9BVChDdXJyZW50TCwgRGVsdGFMLCBUZW1wKTsKKyAgICAgICAgICAgIEN1cnJlbnRMID0gVGVtcDsKKyAgICAgICAgICAgIGlmIChDdXJyZW50TCA+IFRhcmdldEwpCisgICAgICAgICAgICAgICAgQ3VycmVudEwgPSBUYXJnZXRMOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgQ3VycmVudEwgLT0gRGVsdGFMOworICAgICAgICAgICAgaWYgKEN1cnJlbnRMIDwgVGFyZ2V0TCkKKyAgICAgICAgICAgICAgICBDdXJyZW50TCA9IFRhcmdldEw7CisgICAgICAgIH0KKworICAgICAgICBpZihDdXJyZW50UiA8IFRhcmdldFIpCisgICAgICAgIHsKKyAgICAgICAgICAgIEFERDJfU0FUX0ZMT0FUKEN1cnJlbnRSLCBEZWx0YVIsIFRlbXApOworICAgICAgICAgICAgQ3VycmVudFIgPSBUZW1wOworICAgICAgICAgICAgaWYgKEN1cnJlbnRSID4gVGFyZ2V0UikKKyAgICAgICAgICAgICAgICBDdXJyZW50UiA9IFRhcmdldFI7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBDdXJyZW50UiAtPSBEZWx0YVI7CisgICAgICAgICAgICBpZiAoQ3VycmVudFIgPCBUYXJnZXRSKQorICAgICAgICAgICAgICAgIEN1cnJlbnRSID0gVGFyZ2V0UjsKKyAgICAgICAgfQorCisgICAgICAgICooZHN0KyspID0gKExWTV9GTE9BVCkoKChMVk1fRkxPQVQpKihzcmMrKykgKiAoTFZNX0ZMT0FUKUN1cnJlbnRMKSk7CisgICAgICAgICooZHN0KyspID0gKExWTV9GTE9BVCkoKChMVk1fRkxPQVQpKihzcmMrKykgKiAoTFZNX0ZMT0FUKUN1cnJlbnRSKSk7CisgICAgICAgICooZHN0KyspID0gKExWTV9GTE9BVCkoKChMVk1fRkxPQVQpKihzcmMrKykgKiAoTFZNX0ZMT0FUKUN1cnJlbnRMKSk7CisgICAgICAgICooZHN0KyspID0gKExWTV9GTE9BVCkoKChMVk1fRkxPQVQpKihzcmMrKykgKiAoTFZNX0ZMT0FUKUN1cnJlbnRSKSk7CisgICAgICAgICooZHN0KyspID0gKExWTV9GTE9BVCkoKChMVk1fRkxPQVQpKihzcmMrKykgKiAoTFZNX0ZMT0FUKUN1cnJlbnRMKSk7CisgICAgICAgICooZHN0KyspID0gKExWTV9GTE9BVCkoKChMVk1fRkxPQVQpKihzcmMrKykgKiAoTFZNX0ZMT0FUKUN1cnJlbnRSKSk7CisgICAgICAgICooZHN0KyspID0gKExWTV9GTE9BVCkoKChMVk1fRkxPQVQpKihzcmMrKykgKiAoTFZNX0ZMT0FUKUN1cnJlbnRMKSk7CisgICAgICAgICooZHN0KyspID0gKExWTV9GTE9BVCkoKChMVk1fRkxPQVQpKihzcmMrKykgKiAoTFZNX0ZMT0FUKUN1cnJlbnRSKSk7CisgICAgfQorICAgIHBJbnN0YW5jZUwtPkN1cnJlbnQgPSBDdXJyZW50TDsKKyAgICBwSW5zdGFuY2VSLT5DdXJyZW50ID0gQ3VycmVudFI7CisKK30KKyNlbHNlCiB2b2lkIExWQ19Db3JlX01peFNvZnRfMVN0XzJpX0QxNkMzMV9XUkEoIExWTWl4ZXIzX3N0ICAgICAgICAqcHRySW5zdGFuY2UxLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1peGVyM19zdCAgICAgICAgKnB0ckluc3RhbmNlMiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICAgICpzcmMsCkBAIC0xNDAsNCArMjYwLDUgQEAKICAgICBwSW5zdGFuY2VSLT5DdXJyZW50PUN1cnJlbnRSOwogCiB9CisjZW5kaWYKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTFZDX0NvcmVfTWl4U29mdF8xU3RfRDE2QzMxX1dSQS5jIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTFZDX0NvcmVfTWl4U29mdF8xU3RfRDE2QzMxX1dSQS5jCmluZGV4IGYxYTljYTMuLmI1ZTdmNWMgMTAwNjQ0Ci0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xWQ19Db3JlX01peFNvZnRfMVN0X0QxNkMzMV9XUkEuYworKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVkNfQ29yZV9NaXhTb2Z0XzFTdF9EMTZDMzFfV1JBLmMKQEAgLTI2LDcgKzI2LDg2IEBACiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICAgRlVOQ1RJT04gTFZDb3JlX01JWFNPRlRfMVNUX0QxNkMzMV9XUkEKICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIExWQ19Db3JlX01peFNvZnRfMVN0X0QxNkMzMV9XUkEoIExWTWl4ZXIzX0ZMT0FUX3N0ICpwdHJJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9GTE9BVCAgICAgKnNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgKmRzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgbikKK3sKKyAgICBMVk1fSU5UMTYgICBPdXRMb29wOworICAgIExWTV9JTlQxNiAgIEluTG9vcDsKKyAgICBMVk1fSU5UMzIgICBpaTsKKyAgICBNaXhfUHJpdmF0ZV9GTE9BVF9zdCAgKnBJbnN0YW5jZT0oTWl4X1ByaXZhdGVfRkxPQVRfc3QgKikocHRySW5zdGFuY2UtPlByaXZhdGVQYXJhbXMpOworICAgIExWTV9GTE9BVCAgIERlbHRhPSAoTFZNX0ZMT0FUKXBJbnN0YW5jZS0+RGVsdGE7CisgICAgTFZNX0ZMT0FUICAgQ3VycmVudCA9IChMVk1fRkxPQVQpcEluc3RhbmNlLT5DdXJyZW50OworICAgIExWTV9GTE9BVCAgIFRhcmdldD0gKExWTV9GTE9BVClwSW5zdGFuY2UtPlRhcmdldDsKKyAgICBMVk1fRkxPQVQgICBUZW1wOwogCisgICAgSW5Mb29wID0gKExWTV9JTlQxNikobiA+PiAyKTsgLyogUHJvY2VzcyBwZXIgNCBzYW1wbGVzICovCisgICAgT3V0TG9vcCA9IChMVk1fSU5UMTYpKG4gLSAoSW5Mb29wIDw8IDIpKTsKKworICAgIGlmKEN1cnJlbnQ8VGFyZ2V0KXsKKyAgICAgICAgaWYgKE91dExvb3ApeworCisgICAgICAgICAgICBUZW1wID0gQ3VycmVudCArIERlbHRhOworICAgICAgICAgICAgaWYgKFRlbXAgPiAxLjBmKQorICAgICAgICAgICAgICAgIFRlbXAgPSAxLjBmOworICAgICAgICAgICAgZWxzZSBpZiAoVGVtcCA8IC0xLjBmKQorICAgICAgICAgICAgICAgIFRlbXAgPSAtMS4wZjsKKworICAgICAgICAgICAgQ3VycmVudD1UZW1wOworICAgICAgICAgICAgaWYgKEN1cnJlbnQgPiBUYXJnZXQpCisgICAgICAgICAgICAgICAgQ3VycmVudCA9IFRhcmdldDsKKworICAgICAgICAgICAgZm9yIChpaSA9IE91dExvb3A7IGlpICE9IDA7IGlpLS0peworICAgICAgICAgICAgICAgICooZHN0KyspID0gKCgoTFZNX0ZMT0FUKSooc3JjKyspICogKExWTV9GTE9BVClDdXJyZW50KSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBmb3IgKGlpID0gSW5Mb29wOyBpaSAhPSAwOyBpaS0tKXsKKworICAgICAgICAgICAgVGVtcCA9IEN1cnJlbnQgKyBEZWx0YTsKKworICAgICAgICAgICAgaWYgKFRlbXAgPiAxLjBmKQorICAgICAgICAgICAgICAgIFRlbXAgPSAxLjBmOworICAgICAgICAgICAgZWxzZSBpZiAoVGVtcCA8IC0xLjBmKQorICAgICAgICAgICAgICAgIFRlbXAgPSAtMS4wZjsKKworICAgICAgICAgICAgQ3VycmVudD1UZW1wOworICAgICAgICAgICAgaWYgKEN1cnJlbnQgPiBUYXJnZXQpCisgICAgICAgICAgICAgICAgQ3VycmVudCA9IFRhcmdldDsKKworICAgICAgICAgICAgKihkc3QrKykgPSAoKChMVk1fRkxPQVQpKihzcmMrKykgKiBDdXJyZW50KSApOworICAgICAgICAgICAgKihkc3QrKykgPSAoKChMVk1fRkxPQVQpKihzcmMrKykgKiBDdXJyZW50KSApOworICAgICAgICAgICAgKihkc3QrKykgPSAoKChMVk1fRkxPQVQpKihzcmMrKykgKiBDdXJyZW50KSApOworICAgICAgICAgICAgKihkc3QrKykgPSAoKChMVk1fRkxPQVQpKihzcmMrKykgKiBDdXJyZW50KSApOworICAgICAgICB9CisgICAgfQorICAgIGVsc2V7CisgICAgICAgIGlmIChPdXRMb29wKXsKKyAgICAgICAgICAgIEN1cnJlbnQgLT0gRGVsdGE7CisgICAgICAgICAgICBpZiAoQ3VycmVudCA8IFRhcmdldCkKKyAgICAgICAgICAgICAgICBDdXJyZW50ID0gVGFyZ2V0OworCisgICAgICAgICAgICBmb3IgKGlpID0gT3V0TG9vcDsgaWkgIT0gMDsgaWktLSl7CisgICAgICAgICAgICAgICAgKihkc3QrKykgPSAoKChMVk1fRkxPQVQpKihzcmMrKykgKiBDdXJyZW50KSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBmb3IgKGlpID0gSW5Mb29wOyBpaSAhPSAwOyBpaS0tKXsKKyAgICAgICAgICAgIEN1cnJlbnQgLT0gRGVsdGE7CisgICAgICAgICAgICBpZiAoQ3VycmVudCA8IFRhcmdldCkKKyAgICAgICAgICAgICAgICBDdXJyZW50ID0gVGFyZ2V0OworCisgICAgICAgICAgICAqKGRzdCsrKSA9ICgoKExWTV9GTE9BVCkqKHNyYysrKSAqIEN1cnJlbnQpKTsKKyAgICAgICAgICAgICooZHN0KyspID0gKCgoTFZNX0ZMT0FUKSooc3JjKyspICogQ3VycmVudCkpOworICAgICAgICAgICAgKihkc3QrKykgPSAoKChMVk1fRkxPQVQpKihzcmMrKykgKiBDdXJyZW50KSk7CisgICAgICAgICAgICAqKGRzdCsrKSA9ICgoKExWTV9GTE9BVCkqKHNyYysrKSAqIEN1cnJlbnQpKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBwSW5zdGFuY2UtPkN1cnJlbnQ9Q3VycmVudDsKK30KKyNlbHNlCiB2b2lkIExWQ19Db3JlX01peFNvZnRfMVN0X0QxNkMzMV9XUkEoIExWTWl4ZXIzX3N0ICpwdHJJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiAgICAgKnNyYywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgKmRzdCwKQEAgLTEwMSw2ICsxODAsNSBAQAogICAgIH0KICAgICBwSW5zdGFuY2UtPkN1cnJlbnQ9Q3VycmVudDsKIH0KLQotCisjZW5kaWYKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTFZDX01peEluU29mdF9EMTZDMzFfU0FULmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVkNfTWl4SW5Tb2Z0X0QxNkMzMV9TQVQuYwppbmRleCAwMDUyZGQ3Li4xOTJmMTI2IDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVkNfTWl4SW5Tb2Z0X0QxNkMzMV9TQVQuYworKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVkNfTWl4SW5Tb2Z0X0QxNkMzMV9TQVQuYwpAQCAtMzMsNyArMzMsODAgQEAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgICBGVU5DVElPTiBNSVhJTlNPRlRfRDE2QzMxX1NBVAogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgTFZDX01peEluU29mdF9EMTZDMzFfU0FUKCBMVk1peGVyM18xU3RfRkxPQVRfc3QgKnB0ckluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAqc3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAqZHN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICBuKQoreworICAgIGNoYXIgICAgICAgIEhhcmRNaXhpbmcgPSBUUlVFOworICAgIExWTV9GTE9BVCAgIFRhcmdldEdhaW47CisgICAgTWl4X1ByaXZhdGVfRkxPQVRfc3QgICpwSW5zdGFuY2UgPSBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChNaXhfUHJpdmF0ZV9GTE9BVF9zdCAqKShwdHJJbnN0YW5jZS0+TWl4ZXJTdHJlYW1bMF0uUHJpdmF0ZVBhcmFtcyk7CiAKKyAgICBpZihuIDw9IDApICAgIHJldHVybjsKKworICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICBTT0ZUIE1JWElORworICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgaWYgKHBJbnN0YW5jZS0+Q3VycmVudCAhPSBwSW5zdGFuY2UtPlRhcmdldCkKKyAgICB7CisgICAgICAgIGlmKHBJbnN0YW5jZS0+RGVsdGEgPT0gMS4wZil7CisgICAgICAgICAgICBwSW5zdGFuY2UtPkN1cnJlbnQgPSBwSW5zdGFuY2UtPlRhcmdldDsKKyAgICAgICAgICAgIFRhcmdldEdhaW4gPSBwSW5zdGFuY2UtPlRhcmdldDsKKyAgICAgICAgICAgIExWQ19NaXhlcl9TZXRUYXJnZXQoJihwdHJJbnN0YW5jZS0+TWl4ZXJTdHJlYW1bMF0pLCBUYXJnZXRHYWluKTsKKyAgICAgICAgfWVsc2UgaWYgKEFic19GbG9hdChwSW5zdGFuY2UtPkN1cnJlbnQgLSBwSW5zdGFuY2UtPlRhcmdldCkgPCBwSW5zdGFuY2UtPkRlbHRhKXsKKyAgICAgICAgICAgIHBJbnN0YW5jZS0+Q3VycmVudCA9IHBJbnN0YW5jZS0+VGFyZ2V0OyAvKiBEaWZmZXJlbmNlIGlzIG5vdCBzaWduaWZpY2FudCBhbnltb3JlLiBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTWFrZSB0aGVtIGVxdWFsLiAqLworICAgICAgICAgICAgVGFyZ2V0R2FpbiA9IHBJbnN0YW5jZS0+VGFyZ2V0OworICAgICAgICAgICAgTFZDX01peGVyX1NldFRhcmdldCgmKHB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVswXSksIFRhcmdldEdhaW4pOworICAgICAgICB9ZWxzZXsKKyAgICAgICAgICAgIC8qIFNvZnQgbWl4aW5nIGhhcyB0byBiZSBhcHBsaWVkICovCisgICAgICAgICAgICBIYXJkTWl4aW5nID0gRkFMU0U7CisgICAgICAgICAgICBMVkNfQ29yZV9NaXhJblNvZnRfRDE2QzMxX1NBVCgmKHB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVswXSksIHNyYywgZHN0LCBuKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICBIQVJEIE1JWElORworICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyAgICBpZiAoSGFyZE1peGluZyl7CisgICAgICAgIGlmIChwSW5zdGFuY2UtPlRhcmdldCAhPSAwKXsgLyogTm90aGluZyB0byBkbyBpbiBjYXNlIFRhcmdldCA9IDAgKi8KKyAgICAgICAgICAgIGlmICgocEluc3RhbmNlLT5UYXJnZXQpID09IDEuMGYpeworICAgICAgICAgICAgICAgIEFkZDJfU2F0X0Zsb2F0KHNyYywgZHN0LCBuKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgTWFjM3NfU2F0X0Zsb2F0KHNyYywgKHBJbnN0YW5jZS0+VGFyZ2V0KSwgZHN0LCBuKTsKKyAgICAgICAgICAgICAgICAvKiBJbiBjYXNlIHRoZSBMVkNvcmUgZnVuY3Rpb24gd291bGQgaGF2ZSBjaGFuZ2VkIHRoZSBDdXJyZW50IHZhbHVlICovCisgICAgICAgICAgICAgICAgcEluc3RhbmNlLT5DdXJyZW50ID0gcEluc3RhbmNlLT5UYXJnZXQ7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKworICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICBDQUxMIEJBQ0sKKyAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisgICAgaWYgKHB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVswXS5DYWxsYmFja1NldCl7CisgICAgICAgIGlmIChBYnNfRmxvYXQocEluc3RhbmNlLT5DdXJyZW50IC0gcEluc3RhbmNlLT5UYXJnZXQpIDwgcEluc3RhbmNlLT5EZWx0YSl7CisgICAgICAgICAgICBwSW5zdGFuY2UtPkN1cnJlbnQgPSBwSW5zdGFuY2UtPlRhcmdldDsgLyogRGlmZmVyZW5jZSBpcyBub3Qgc2lnbmlmaWNhbnQgYW55bW9yZS4gXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1ha2UgdGhlbSBlcXVhbC4gKi8KKyAgICAgICAgICAgIFRhcmdldEdhaW4gPSBwSW5zdGFuY2UtPlRhcmdldDsKKyAgICAgICAgICAgIExWQ19NaXhlcl9TZXRUYXJnZXQocHRySW5zdGFuY2UtPk1peGVyU3RyZWFtLCBUYXJnZXRHYWluKTsKKyAgICAgICAgICAgIHB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVswXS5DYWxsYmFja1NldCA9IEZBTFNFOworICAgICAgICAgICAgaWYgKHB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVswXS5wQ2FsbEJhY2sgIT0gMCl7CisgICAgICAgICAgICAgICAgKCpwdHJJbnN0YW5jZS0+TWl4ZXJTdHJlYW1bMF0ucENhbGxCYWNrKSAoIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVswXS5wQ2FsbGJhY2tIYW5kbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdHJJbnN0YW5jZS0+TWl4ZXJTdHJlYW1bMF0ucEdlbmVyYWxQdXJwb3NlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHRySW5zdGFuY2UtPk1peGVyU3RyZWFtWzBdLkNhbGxiYWNrUGFyYW0gKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworfQorI2Vsc2UKIHZvaWQgTFZDX01peEluU29mdF9EMTZDMzFfU0FUKCBMVk1peGVyM18xU3Rfc3QgKnB0ckluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICpzcmMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgKmRzdCwKQEAgLTEwOCw1ICsxODEsNSBAQAogICAgIH0KIAogfQotCisjZW5kaWYKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTFZDX01peFNvZnRfMVN0XzJpX0QxNkMzMV9TQVQuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xWQ19NaXhTb2Z0XzFTdF8yaV9EMTZDMzFfU0FULmMKaW5kZXggZjQ0M2M4Zi4uYmQ1YTkyNSAxMDA2NDQKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTFZDX01peFNvZnRfMVN0XzJpX0QxNkMzMV9TQVQuYworKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVkNfTWl4U29mdF8xU3RfMmlfRDE2QzMxX1NBVC5jCkBAIC0zMyw3ICszMywxMzggQEAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgICBGVU5DVElPTiBMVkNfTWl4U29mdF8xU3RfMmlfRDE2QzMxX1NBVAogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgTFZDX01peFNvZnRfMVN0XzJpX0QxNkMzMV9TQVQoIExWTWl4ZXIzXzJTdF9GTE9BVF9zdCAqcHRySW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fRkxPQVQgICAgICAgICAgICAgKnNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAqZHN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgIG4pCit7CisgICAgY2hhciAgICAgICAgSGFyZE1peGluZyA9IFRSVUU7CisgICAgTFZNX0ZMT0FUICAgVGFyZ2V0R2FpbjsKKyAgICBNaXhfUHJpdmF0ZV9GTE9BVF9zdCAgKnBJbnN0YW5jZTEgPSBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTWl4X1ByaXZhdGVfRkxPQVRfc3QgKikocHRySW5zdGFuY2UtPk1peGVyU3RyZWFtWzBdLlByaXZhdGVQYXJhbXMpOworICAgIE1peF9Qcml2YXRlX0ZMT0FUX3N0ICAqcEluc3RhbmNlMiA9IFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChNaXhfUHJpdmF0ZV9GTE9BVF9zdCAqKShwdHJJbnN0YW5jZS0+TWl4ZXJTdHJlYW1bMV0uUHJpdmF0ZVBhcmFtcyk7CiAKKyAgICBpZihuIDw9IDApICAgIHJldHVybjsKKworICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICBTT0ZUIE1JWElORworICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgaWYgKChwSW5zdGFuY2UxLT5DdXJyZW50ICE9IHBJbnN0YW5jZTEtPlRhcmdldCkgfHwgKHBJbnN0YW5jZTItPkN1cnJlbnQgIT0gcEluc3RhbmNlMi0+VGFyZ2V0KSkKKyAgICB7CisgICAgICAgIGlmKHBJbnN0YW5jZTEtPkRlbHRhID09IDEuMGYpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBJbnN0YW5jZTEtPkN1cnJlbnQgPSBwSW5zdGFuY2UxLT5UYXJnZXQ7CisgICAgICAgICAgICBUYXJnZXRHYWluID0gcEluc3RhbmNlMS0+VGFyZ2V0OworICAgICAgICAgICAgTFZDX01peGVyX1NldFRhcmdldCgmKHB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVswXSksIFRhcmdldEdhaW4pOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKEFic19GbG9hdChwSW5zdGFuY2UxLT5DdXJyZW50IC0gcEluc3RhbmNlMS0+VGFyZ2V0KSA8IHBJbnN0YW5jZTEtPkRlbHRhKQorICAgICAgICB7CisgICAgICAgICAgICBwSW5zdGFuY2UxLT5DdXJyZW50ID0gcEluc3RhbmNlMS0+VGFyZ2V0OyAvKiBEaWZmZXJlbmNlIGlzIG5vdCBzaWduaWZpY2FudCBhbnltb3JlLiBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNYWtlIHRoZW0gZXF1YWwuICovCisgICAgICAgICAgICBUYXJnZXRHYWluID0gcEluc3RhbmNlMS0+VGFyZ2V0OworICAgICAgICAgICAgTFZDX01peGVyX1NldFRhcmdldCgmKHB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVswXSksIFRhcmdldEdhaW4pOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLyogU29mdCBtaXhpbmcgaGFzIHRvIGJlIGFwcGxpZWQgKi8KKyAgICAgICAgICAgIEhhcmRNaXhpbmcgPSBGQUxTRTsKKyAgICAgICAgfQorCisgICAgICAgIGlmKEhhcmRNaXhpbmcgPT0gVFJVRSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYocEluc3RhbmNlMi0+RGVsdGEgPT0gMS4wZikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwSW5zdGFuY2UyLT5DdXJyZW50ID0gcEluc3RhbmNlMi0+VGFyZ2V0OworICAgICAgICAgICAgICAgIFRhcmdldEdhaW4gPSBwSW5zdGFuY2UyLT5UYXJnZXQ7CisgICAgICAgICAgICAgICAgTFZDX01peGVyX1NldFRhcmdldCgmKHB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVsxXSksIFRhcmdldEdhaW4pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAoQWJzX0Zsb2F0KHBJbnN0YW5jZTItPkN1cnJlbnQgLSBwSW5zdGFuY2UyLT5UYXJnZXQpIDwgcEluc3RhbmNlMi0+RGVsdGEpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcEluc3RhbmNlMi0+Q3VycmVudCA9IHBJbnN0YW5jZTItPlRhcmdldDsgLyogRGlmZmVyZW5jZSBpcyBub3Qgc2lnbmlmaWNhbnQgYW55bW9yZS4gXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1ha2UgdGhlbSBlcXVhbC4gKi8KKyAgICAgICAgICAgICAgICBUYXJnZXRHYWluID0gcEluc3RhbmNlMi0+VGFyZ2V0OworICAgICAgICAgICAgICAgIExWQ19NaXhlcl9TZXRUYXJnZXQoJihwdHJJbnN0YW5jZS0+TWl4ZXJTdHJlYW1bMV0pLCBUYXJnZXRHYWluKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBTb2Z0IG1peGluZyBoYXMgdG8gYmUgYXBwbGllZCAqLworICAgICAgICAgICAgICAgIEhhcmRNaXhpbmcgPSBGQUxTRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmKEhhcmRNaXhpbmcgPT0gRkFMU0UpCisgICAgICAgIHsKKyAgICAgICAgICAgICBMVkNfQ29yZV9NaXhTb2Z0XzFTdF8yaV9EMTZDMzFfV1JBKCAmKHB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVswXSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJihwdHJJbnN0YW5jZS0+TWl4ZXJTdHJlYW1bMV0pLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNyYywgZHN0LCBuKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICBIQVJEIE1JWElORworICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyAgICBpZiAoSGFyZE1peGluZykKKyAgICB7CisgICAgICAgIGlmICgocEluc3RhbmNlMS0+VGFyZ2V0ID09IDEuMGYpICYmIChwSW5zdGFuY2UyLT5UYXJnZXQgPT0gMS4wZikpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKHNyYyAhPSBkc3QpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgQ29weV9GbG9hdChzcmMsIGRzdCwgbik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBMVkNfQ29yZV9NaXhIYXJkXzFTdF8yaV9EMTZDMzFfU0FUKCYocHRySW5zdGFuY2UtPk1peGVyU3RyZWFtWzBdKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJihwdHJJbnN0YW5jZS0+TWl4ZXJTdHJlYW1bMV0pLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcmMsIGRzdCwgbik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgQ0FMTCBCQUNLCisgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworICAgIGlmIChwdHJJbnN0YW5jZS0+TWl4ZXJTdHJlYW1bMF0uQ2FsbGJhY2tTZXQpCisgICAgeworICAgICAgICBpZiAoQWJzX0Zsb2F0KHBJbnN0YW5jZTEtPkN1cnJlbnQgLSBwSW5zdGFuY2UxLT5UYXJnZXQpIDwgcEluc3RhbmNlMS0+RGVsdGEpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBJbnN0YW5jZTEtPkN1cnJlbnQgPSBwSW5zdGFuY2UxLT5UYXJnZXQ7IC8qIERpZmZlcmVuY2UgaXMgbm90IHNpZ25pZmljYW50IGFueW1vcmUuIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1ha2UgdGhlbSBlcXVhbC4gKi8KKyAgICAgICAgICAgIFRhcmdldEdhaW4gPSBwSW5zdGFuY2UxLT5UYXJnZXQ7CisgICAgICAgICAgICBMVkNfTWl4ZXJfU2V0VGFyZ2V0KCZwdHJJbnN0YW5jZS0+TWl4ZXJTdHJlYW1bMF0sIFRhcmdldEdhaW4pOworICAgICAgICAgICAgcHRySW5zdGFuY2UtPk1peGVyU3RyZWFtWzBdLkNhbGxiYWNrU2V0ID0gRkFMU0U7CisgICAgICAgICAgICBpZiAocHRySW5zdGFuY2UtPk1peGVyU3RyZWFtWzBdLnBDYWxsQmFjayAhPSAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICgqcHRySW5zdGFuY2UtPk1peGVyU3RyZWFtWzBdLnBDYWxsQmFjaykgKCBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdHJJbnN0YW5jZS0+TWl4ZXJTdHJlYW1bMF0ucENhbGxiYWNrSGFuZGxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHRySW5zdGFuY2UtPk1peGVyU3RyZWFtWzBdLnBHZW5lcmFsUHVycG9zZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVswXS5DYWxsYmFja1BhcmFtICk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgaWYgKHB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVsxXS5DYWxsYmFja1NldCkKKyAgICB7CisgICAgICAgIGlmIChBYnNfRmxvYXQocEluc3RhbmNlMi0+Q3VycmVudCAtIHBJbnN0YW5jZTItPlRhcmdldCkgPCBwSW5zdGFuY2UyLT5EZWx0YSkKKyAgICAgICAgeworICAgICAgICAgICAgcEluc3RhbmNlMi0+Q3VycmVudCA9IHBJbnN0YW5jZTItPlRhcmdldDsgLyogRGlmZmVyZW5jZSBpcyBub3Qgc2lnbmlmaWNhbnQgYW55bW9yZS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1ha2UgdGhlbSBlcXVhbC4gKi8KKyAgICAgICAgICAgIFRhcmdldEdhaW4gPSBwSW5zdGFuY2UyLT5UYXJnZXQ7CisgICAgICAgICAgICBMVkNfTWl4ZXJfU2V0VGFyZ2V0KCZwdHJJbnN0YW5jZS0+TWl4ZXJTdHJlYW1bMV0sIFRhcmdldEdhaW4pOworICAgICAgICAgICAgcHRySW5zdGFuY2UtPk1peGVyU3RyZWFtWzFdLkNhbGxiYWNrU2V0ID0gRkFMU0U7CisgICAgICAgICAgICBpZiAocHRySW5zdGFuY2UtPk1peGVyU3RyZWFtWzFdLnBDYWxsQmFjayAhPSAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICgqcHRySW5zdGFuY2UtPk1peGVyU3RyZWFtWzFdLnBDYWxsQmFjaykgKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHRySW5zdGFuY2UtPk1peGVyU3RyZWFtWzFdLnBDYWxsYmFja0hhbmRsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVsxXS5wR2VuZXJhbFB1cnBvc2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdHJJbnN0YW5jZS0+TWl4ZXJTdHJlYW1bMV0uQ2FsbGJhY2tQYXJhbSApOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorfQorI2Vsc2UKIHZvaWQgTFZDX01peFNvZnRfMVN0XzJpX0QxNkMzMV9TQVQoIExWTWl4ZXIzXzJTdF9zdCAqcHRySW5zdGFuY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICAgICAgICAgICAgICpzcmMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICpkc3QsCkBAIC0xNDgsNSArMjc5LDUgQEAKICAgICAgICAgfQogICAgIH0KIH0KLQorI2VuZGlmCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xWQ19NaXhTb2Z0XzFTdF9EMTZDMzFfU0FULmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVkNfTWl4U29mdF8xU3RfRDE2QzMxX1NBVC5jCmluZGV4IGM4ZGNhZDcuLjEwMTdkZTMgMTAwNjQ0Ci0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xWQ19NaXhTb2Z0XzFTdF9EMTZDMzFfU0FULmMKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTFZDX01peFNvZnRfMVN0X0QxNkMzMV9TQVQuYwpAQCAtMzMsNyArMzMsNzcgQEAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgICBGVU5DVElPTiBMVk1peGVyM19NSVhTT0ZUXzFTVF9EMTZDMzFfU0FUCiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBMVkNfTWl4U29mdF8xU3RfRDE2QzMxX1NBVCggTFZNaXhlcjNfMVN0X0ZMT0FUX3N0ICpwdHJJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fRkxPQVQgICAgICAgICAgICAgKnNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICAgKmRzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgbikKK3sKKyAgICBjaGFyICAgICAgICBIYXJkTWl4aW5nID0gVFJVRTsKKyAgICBMVk1fRkxPQVQgICBUYXJnZXRHYWluOworICAgIE1peF9Qcml2YXRlX0ZMT0FUX3N0ICAqcEluc3RhbmNlID0gXAorICAgICAgICAgICAgICAgICAgICAgICAgICAoTWl4X1ByaXZhdGVfRkxPQVRfc3QgKikocHRySW5zdGFuY2UtPk1peGVyU3RyZWFtWzBdLlByaXZhdGVQYXJhbXMpOwogCisgICAgaWYobiA8PSAwKSAgICByZXR1cm47CisKKyAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgU09GVCBNSVhJTkcKKyAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworICAgIGlmIChwSW5zdGFuY2UtPkN1cnJlbnQgIT0gcEluc3RhbmNlLT5UYXJnZXQpCisgICAgeworICAgICAgICBpZihwSW5zdGFuY2UtPkRlbHRhID09IDEuMGYpeworICAgICAgICAgICAgcEluc3RhbmNlLT5DdXJyZW50ID0gcEluc3RhbmNlLT5UYXJnZXQ7CisgICAgICAgICAgICBUYXJnZXRHYWluID0gcEluc3RhbmNlLT5UYXJnZXQ7CisgICAgICAgICAgICBMVkNfTWl4ZXJfU2V0VGFyZ2V0KCYocHRySW5zdGFuY2UtPk1peGVyU3RyZWFtWzBdKSwgVGFyZ2V0R2Fpbik7CisgICAgICAgIH1lbHNlIGlmIChBYnNfRmxvYXQocEluc3RhbmNlLT5DdXJyZW50IC0gcEluc3RhbmNlLT5UYXJnZXQpIDwgcEluc3RhbmNlLT5EZWx0YSl7CisgICAgICAgICAgICBwSW5zdGFuY2UtPkN1cnJlbnQgPSBwSW5zdGFuY2UtPlRhcmdldDsgLyogRGlmZmVyZW5jZSBpcyBub3Qgc2lnbmlmaWNhbnQgYW55bW9yZS4gXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1ha2UgdGhlbSBlcXVhbC4gKi8KKyAgICAgICAgICAgIFRhcmdldEdhaW4gPSBwSW5zdGFuY2UtPlRhcmdldDsKKyAgICAgICAgICAgIExWQ19NaXhlcl9TZXRUYXJnZXQoJihwdHJJbnN0YW5jZS0+TWl4ZXJTdHJlYW1bMF0pLCBUYXJnZXRHYWluKTsKKyAgICAgICAgfWVsc2V7CisgICAgICAgICAgICAvKiBTb2Z0IG1peGluZyBoYXMgdG8gYmUgYXBwbGllZCAqLworICAgICAgICAgICAgSGFyZE1peGluZyA9IEZBTFNFOworICAgICAgICAgICAgTFZDX0NvcmVfTWl4U29mdF8xU3RfRDE2QzMxX1dSQSgmKHB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVswXSksIHNyYywgZHN0LCBuKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICBIQVJEIE1JWElORworICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyAgICBpZiAoSGFyZE1peGluZyl7CisgICAgICAgIGlmIChwSW5zdGFuY2UtPlRhcmdldCA9PSAwKQorICAgICAgICAgICAgTG9hZENvbnN0X0Zsb2F0KDAuMCwgZHN0LCBuKTsKKyAgICAgICAgZWxzZSB7CisgICAgICAgICAgICBpZiAoKHBJbnN0YW5jZS0+VGFyZ2V0KSAhPSAxLjBmKQorICAgICAgICAgICAgICAgIE11bHQzc19GbG9hdChzcmMsIChwSW5zdGFuY2UtPlRhcmdldCksIGRzdCwgbik7CisgICAgICAgICAgICBlbHNlIGlmKHNyYyAhPSBkc3QpCisgICAgICAgICAgICAgICAgQ29weV9GbG9hdChzcmMsIGRzdCwgbik7CisgICAgICAgIH0KKworICAgIH0KKworICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICBDQUxMIEJBQ0sKKyAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisgICAgaWYgKHB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVswXS5DYWxsYmFja1NldCl7CisgICAgICAgIGlmIChBYnNfRmxvYXQocEluc3RhbmNlLT5DdXJyZW50IC0gcEluc3RhbmNlLT5UYXJnZXQpIDwgcEluc3RhbmNlLT5EZWx0YSl7CisgICAgICAgICAgICBwSW5zdGFuY2UtPkN1cnJlbnQgPSBwSW5zdGFuY2UtPlRhcmdldDsgLyogRGlmZmVyZW5jZSBpcyBub3Qgc2lnbmlmaWNhbnQgYW55bW9yZS4gXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1ha2UgdGhlbSBlcXVhbC4gKi8KKyAgICAgICAgICAgIFRhcmdldEdhaW4gPSBwSW5zdGFuY2UtPlRhcmdldDsKKyAgICAgICAgICAgIExWQ19NaXhlcl9TZXRUYXJnZXQocHRySW5zdGFuY2UtPk1peGVyU3RyZWFtLCBUYXJnZXRHYWluKTsKKyAgICAgICAgICAgIHB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVswXS5DYWxsYmFja1NldCA9IEZBTFNFOworICAgICAgICAgICAgaWYgKHB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVswXS5wQ2FsbEJhY2sgIT0gMCl7CisgICAgICAgICAgICAgICAgKCpwdHJJbnN0YW5jZS0+TWl4ZXJTdHJlYW1bMF0ucENhbGxCYWNrKSAoIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVswXS5wQ2FsbGJhY2tIYW5kbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdHJJbnN0YW5jZS0+TWl4ZXJTdHJlYW1bMF0ucEdlbmVyYWxQdXJwb3NlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHRySW5zdGFuY2UtPk1peGVyU3RyZWFtWzBdLkNhbGxiYWNrUGFyYW0gKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KK30KKyNlbHNlCiB2b2lkIExWQ19NaXhTb2Z0XzFTdF9EMTZDMzFfU0FUKCBMVk1peGVyM18xU3Rfc3QgKnB0ckluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiAgICAgICAgICAgICAqc3JjLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAqZHN0LApAQCAtMTA3LDUgKzE3Nyw1IEBACiAgICAgICAgIH0KICAgICB9CiB9Ci0KKyNlbmRpZi8qQlVJTERfRkxPQVQqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVkNfTWl4U29mdF8yU3RfRDE2QzMxX1NBVC5jIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTFZDX01peFNvZnRfMlN0X0QxNkMzMV9TQVQuYwppbmRleCA3MjQwNzA1Li4zYzkwMDcxIDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVkNfTWl4U29mdF8yU3RfRDE2QzMxX1NBVC5jCisrKyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xWQ19NaXhTb2Z0XzJTdF9EMTZDMzFfU0FULmMKQEAgLTI1LDcgKzI1LDQ5IEBACiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICAgRlVOQ1RJT04gTFZDX01peFNvZnRfMlN0X0QxNkMzMV9TQVQuYwogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgTFZDX01peFNvZnRfMlN0X0QxNkMzMV9TQVQoIExWTWl4ZXIzXzJTdF9GTE9BVF9zdCAqcHRySW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCAgIExWTV9GTE9BVCAgICAgICAqc3JjMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAqc3JjMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAqZHN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgIG4pCit7CisgICAgTWl4X1ByaXZhdGVfRkxPQVRfc3QgICpwSW5zdGFuY2UxID0gXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTWl4X1ByaXZhdGVfRkxPQVRfc3QgKikocHRySW5zdGFuY2UtPk1peGVyU3RyZWFtWzBdLlByaXZhdGVQYXJhbXMpOworICAgIE1peF9Qcml2YXRlX0ZMT0FUX3N0ICAqcEluc3RhbmNlMiA9IFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKE1peF9Qcml2YXRlX0ZMT0FUX3N0ICopKHB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVsxXS5Qcml2YXRlUGFyYW1zKTsKIAorICAgIGlmKG4gPD0gMCkgICAgcmV0dXJuOworCisgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgIFNPRlQgTUlYSU5HCisgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyAgICBpZiAoKHBJbnN0YW5jZTEtPkN1cnJlbnQgPT0gcEluc3RhbmNlMS0+VGFyZ2V0KSAmJiAocEluc3RhbmNlMS0+Q3VycmVudCA9PSAwKSl7CisgICAgICAgIExWQ19NaXhTb2Z0XzFTdF9EMTZDMzFfU0FUKChMVk1peGVyM18xU3RfRkxPQVRfc3QgKikoJnB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVsxXSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcmMyLCBkc3QsIG4pOworICAgIH0KKyAgICBlbHNlIGlmICgocEluc3RhbmNlMi0+Q3VycmVudCA9PSBwSW5zdGFuY2UyLT5UYXJnZXQpICYmIChwSW5zdGFuY2UyLT5DdXJyZW50ID09IDApKXsKKyAgICAgICAgTFZDX01peFNvZnRfMVN0X0QxNkMzMV9TQVQoKExWTWl4ZXIzXzFTdF9GTE9BVF9zdCAqKSgmcHRySW5zdGFuY2UtPk1peGVyU3RyZWFtWzBdKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNyYzEsIGRzdCwgbik7CisgICAgfQorICAgIGVsc2UgaWYgKChwSW5zdGFuY2UxLT5DdXJyZW50ICE9IHBJbnN0YW5jZTEtPlRhcmdldCkgfHwgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBJbnN0YW5jZTItPkN1cnJlbnQgIT0gcEluc3RhbmNlMi0+VGFyZ2V0KSkKKyAgICB7CisgICAgICAgIExWQ19NaXhTb2Z0XzFTdF9EMTZDMzFfU0FUKChMVk1peGVyM18xU3RfRkxPQVRfc3QgKikoJnB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVswXSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNyYzEsIGRzdCwgbik7CisgICAgICAgIExWQ19NaXhJblNvZnRfRDE2QzMxX1NBVCgoTFZNaXhlcjNfMVN0X0ZMT0FUX3N0ICopKCZwdHJJbnN0YW5jZS0+TWl4ZXJTdHJlYW1bMV0pLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNyYzIsIGRzdCwgbik7CisgICAgfQorICAgIGVsc2V7CisgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgSEFSRCBNSVhJTkcKKyAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyAgICAgICAgTFZDX0NvcmVfTWl4SGFyZF8yU3RfRDE2QzMxX1NBVCggJnB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVsxXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3JjMSwgc3JjMiwgZHN0LCBuKTsKKyAgICB9Cit9CisjZWxzZQogdm9pZCBMVkNfTWl4U29mdF8yU3RfRDE2QzMxX1NBVCggTFZNaXhlcjNfMlN0X3N0ICpwdHJJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0ICAgTFZNX0lOVDE2ICAgICAgICpzcmMxLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgIC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RpbyBTdHJlYW1zICovCiB9IExWTWl4ZXIzXzNTdF9zdDsKLQorI2VuZGlmCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICAgRlVOQ1RJT04gUFJPVE9UWVBFUyAoSElHSCBMRVZFTCBGVU5DVElPTlMpCiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KQEAgLTc1LDU3ICsxMDEsMTE1IEBACiAvKiB0aGVuIHRoZSBjYWxjdWxhdGlvbiB3aWxsIGdpdmUgYW4gaW5jb3JyZWN0IHZhbHVlIGZvciBhbHBoYSwgc2VlIHRoZSBtaXhlciAgICAgKi8KIC8qIGRvY3VtZW50YXRpb24gZm9yIGZ1cnRoZXIgZGV0YWlscy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgTFZDX01peGVyX1NldFRhcmdldCggTFZNaXhlcjNfRkxPQVRfc3QgKnBTdHJlYW0sCisgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgVGFyZ2V0R2Fpbik7CisjZWxzZQogdm9pZCBMVkNfTWl4ZXJfU2V0VGFyZ2V0KCBMVk1peGVyM19zdCAqcFN0cmVhbSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAgICAgICBUYXJnZXRHYWluKTsKLQorI2VuZGlmCisjaWZkZWYgQlVJTERfRkxPQVQKK0xWTV9GTE9BVCBMVkNfTWl4ZXJfR2V0VGFyZ2V0KCBMVk1peGVyM19GTE9BVF9zdCAqcFN0cmVhbSk7CisjZWxzZQogTFZNX0lOVDMyIExWQ19NaXhlcl9HZXRUYXJnZXQoIExWTWl4ZXIzX3N0ICpwU3RyZWFtKTsKKyNlbmRpZgogCisjaWZkZWYgQlVJTERfRkxPQVQKK0xWTV9GTE9BVCBMVkNfTWl4ZXJfR2V0Q3VycmVudCggTFZNaXhlcjNfRkxPQVRfc3QgKnBTdHJlYW0pOworI2Vsc2UKIExWTV9JTlQzMiBMVkNfTWl4ZXJfR2V0Q3VycmVudCggTFZNaXhlcjNfc3QgKnBTdHJlYW0pOworI2VuZGlmCiAKKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBMVkNfTWl4ZXJfSW5pdCggTFZNaXhlcjNfRkxPQVRfc3QgKnBTdHJlYW0sCisgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgIFRhcmdldEdhaW4sCisgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgIEN1cnJlbnRHYWluKTsKKyNlbHNlCiB2b2lkIExWQ19NaXhlcl9Jbml0KCBMVk1peGVyM19zdCAqcFN0cmVhbSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAgICAgICBUYXJnZXRHYWluLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgICAgICAgIEN1cnJlbnRHYWluKTsKKyNlbmRpZgogCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgTFZDX01peGVyX1NldFRpbWVDb25zdGFudCggTFZNaXhlcjNfRkxPQVRfc3QgKnBTdHJlYW0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgVGNfbWlsbGlzZWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9Gc19lbiAgICAgICAgICAgRnMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgTnVtQ2hhbm5lbHMpOworI2Vsc2UKIHZvaWQgTFZDX01peGVyX1NldFRpbWVDb25zdGFudCggTFZNaXhlcjNfc3QgKnBTdHJlYW0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgVGNfbWlsbGlzZWMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9Gc19lbiAgICAgICAgICAgRnMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgTnVtQ2hhbm5lbHMpOworI2VuZGlmCiAKKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBMVkNfTWl4ZXJfVmFyU2xvcGVfU2V0VGltZUNvbnN0YW50KCBMVk1peGVyM19GTE9BVF9zdCAqcFN0cmVhbSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAgICAgICBUY19taWxsaXNlYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZzX2VuICAgICAgICAgICBGcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICBOdW1DaGFubmVscyk7CisjZWxzZQogdm9pZCBMVkNfTWl4ZXJfVmFyU2xvcGVfU2V0VGltZUNvbnN0YW50KCBMVk1peGVyM19zdCAqcFN0cmVhbSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgICAgICAgIFRjX21pbGxpc2VjLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9Gc19lbiAgICAgICAgICAgRnMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICBOdW1DaGFubmVscyk7CisjZW5kaWYKIAogLyoqKiAxNiBiaXQgZnVuY3Rpb25zICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBMVkNfTWl4U29mdF8xU3RfRDE2QzMxX1NBVCggTFZNaXhlcjNfMVN0X0ZMT0FUX3N0ICpwSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fRkxPQVQgICAgICAgICAgICpzcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICpkc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgIG4pOworI2Vsc2UKIHZvaWQgTFZDX01peFNvZnRfMVN0X0QxNkMzMV9TQVQoIExWTWl4ZXIzXzFTdF9zdCAqcEluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiAgICAgICAgICAgKnNyYywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICpkc3QsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICBuKTsKKyNlbmRpZgogCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgTFZDX01peEluU29mdF9EMTZDMzFfU0FUKCBMVk1peGVyM18xU3RfRkxPQVRfc3QgKnBJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICpzcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICAqZHN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgbik7CisjZWxzZQogdm9pZCBMVkNfTWl4SW5Tb2Z0X0QxNkMzMV9TQVQoIExWTWl4ZXIzXzFTdF9zdCAqcEluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgKnNyYywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICpkc3QsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICBuKTsKKyNlbmRpZgogCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgTFZDX01peFNvZnRfMlN0X0QxNkMzMV9TQVQoIExWTWl4ZXIzXzJTdF9GTE9BVF9zdCAqcEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICAgICAgICAgICAgICpzcmMxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICpzcmMyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICpkc3QsICAvKiBkc3QgY2Fubm90IGJlIGVxdWFsIHRvIHNyYzIgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICBuKTsKKyNlbHNlCiB2b2lkIExWQ19NaXhTb2Z0XzJTdF9EMTZDMzFfU0FUKCBMVk1peGVyM18yU3Rfc3QgKnBJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICAgICAgICAgICAgICpzcmMxLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgKnNyYzIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAqZHN0LCAgLyogZHN0IGNhbm5vdCBiZSBlcXVhbCB0byBzcmMyICovCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICBuKTsKLQorI2VuZGlmCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qIEZvciBhcHBseWluZyBkaWZmZXJlbnQgZ2FpbnMgdG8gTGVmdCBhbmQgcmlnaHQgY2hlbm5hbHMgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogTWl4ZXJTdHJlYW1bMF0gYXBwbGllcyB0byBMZWZ0IGNoYW5uZWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiBNaXhlclN0cmVhbVsxXSBhcHBsaWVzIHRvIFJpZ2h0IGNoYW5uZWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qIEdhaW4gdmFsdWVzIHNob3VsZCBub3QgYmUgbW9yZSB0aGF0IDEuMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgTFZDX01peFNvZnRfMVN0XzJpX0QxNkMzMV9TQVQoIExWTWl4ZXIzXzJTdF9GTE9BVF9zdCAgICAgICAgICpwSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCAgIExWTV9GTE9BVCAgICAgICAgICAgKnNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgKmRzdCwgICAvKiBkc3QgY2FuIGJlIGVxdWFsIHRvIHNyYyAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICBuKTsgICAgIC8qIE51bWJlciBvZiBzdGVyZW8gc2FtcGxlcyAqLworI2Vsc2UKIHZvaWQgTFZDX01peFNvZnRfMVN0XzJpX0QxNkMzMV9TQVQoIExWTWl4ZXIzXzJTdF9zdCAgICAgICAgICpwSW5zdGFuY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0ICAgTFZNX0lOVDE2ICAgICAgICAgICAqc3JjLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgKmRzdCwgICAvKiBkc3QgY2FuIGJlIGVxdWFsIHRvIHNyYyAqLwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgbik7ICAgICAvKiBOdW1iZXIgb2Ygc3RlcmVvIHNhbXBsZXMgKi8KLQotCisjZW5kaWYKICNpZmRlZiBfX2NwbHVzcGx1cwogfQogI2VuZGlmIC8qIF9fY3BsdXNwbHVzICovCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVkNfTWl4ZXJfR2V0Q3VycmVudC5jIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTFZDX01peGVyX0dldEN1cnJlbnQuYwppbmRleCBiNWFlMjY0Li41OTkwNDEyIDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVkNfTWl4ZXJfR2V0Q3VycmVudC5jCisrKyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xWQ19NaXhlcl9HZXRDdXJyZW50LmMKQEAgLTMxLDcgKzMxLDE1IEBACiAvKiAgQ3VycmVudEdhaW4gICAgICAtIEN1cnJlbnRHYWluIHZhbHVlIGluIFEgMTYuMTUgZm9ybWF0ICAgICAgICAgICAgICAqLwogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KKyNpZmRlZiBCVUlMRF9GTE9BVAorTFZNX0ZMT0FUIExWQ19NaXhlcl9HZXRDdXJyZW50KCBMVk1peGVyM19GTE9BVF9zdCAqcFN0cmVhbSkKK3sKKyAgICBMVk1fRkxPQVQgICAgICAgQ3VycmVudEdhaW47CisgICAgTWl4X1ByaXZhdGVfRkxPQVRfc3QgICpwSW5zdGFuY2UgPSAoTWl4X1ByaXZhdGVfRkxPQVRfc3QgKilwU3RyZWFtLT5Qcml2YXRlUGFyYW1zOworICAgIEN1cnJlbnRHYWluID0gcEluc3RhbmNlLT5DdXJyZW50OyAgLy8gQ3VycmVudEdhaW4KKyAgICByZXR1cm4gQ3VycmVudEdhaW47Cit9CisjZWxzZQogTFZNX0lOVDMyIExWQ19NaXhlcl9HZXRDdXJyZW50KCBMVk1peGVyM19zdCAqcFN0cmVhbSkKIHsKICAgICBMVk1fSU5UMzIgICAgICAgQ3VycmVudEdhaW47CkBAIC0zOSwzICs0Nyw0IEBACiAgICAgQ3VycmVudEdhaW49cEluc3RhbmNlLT5DdXJyZW50Pj4oMTYtcEluc3RhbmNlLT5TaGlmdCk7ICAvLyBDdXJyZW50R2FpbiBpbiBRMTYuMTUgZm9ybWF0CiAgICAgcmV0dXJuIEN1cnJlbnRHYWluOwogfQorI2VuZGlmCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVkNfTWl4ZXJfR2V0VGFyZ2V0LmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVkNfTWl4ZXJfR2V0VGFyZ2V0LmMKaW5kZXggZGMyZjhlOS4uYzY3NDU1YSAxMDA2NDQKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTFZDX01peGVyX0dldFRhcmdldC5jCisrKyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xWQ19NaXhlcl9HZXRUYXJnZXQuYwpAQCAtMzAsNyArMzAsMTYgQEAKIC8qICBUYXJnZXRHYWluICAgICAgLSBUYXJnZXRHYWluIHZhbHVlIGluIFEgMTYuMTUgZm9ybWF0ICAgICAgICAgICAgICAgICovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQorI2lmZGVmIEJVSUxEX0ZMT0FUCitMVk1fRkxPQVQgTFZDX01peGVyX0dldFRhcmdldCggTFZNaXhlcjNfRkxPQVRfc3QgKnBTdHJlYW0pCit7CisgICAgTFZNX0ZMT0FUICAgICAgIFRhcmdldEdhaW47CisgICAgTWl4X1ByaXZhdGVfRkxPQVRfc3QgICpwSW5zdGFuY2UgPSAoTWl4X1ByaXZhdGVfRkxPQVRfc3QgKilwU3RyZWFtLT5Qcml2YXRlUGFyYW1zOworICAgIAorICAgIFRhcmdldEdhaW4gPSBwSW5zdGFuY2UtPlRhcmdldDsgIC8vIFRhcmdldEdhaW4KKyAgICByZXR1cm4gVGFyZ2V0R2FpbjsKK30KKyNlbHNlCiBMVk1fSU5UMzIgTFZDX01peGVyX0dldFRhcmdldCggTFZNaXhlcjNfc3QgKnBTdHJlYW0pCiB7CiAgICAgTFZNX0lOVDMyICAgICAgIFRhcmdldEdhaW47CkBAIC00MCwzICs0OSw0IEBACiAKICAgICByZXR1cm4gVGFyZ2V0R2FpbjsKIH0KKyNlbmRpZgpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTFZDX01peGVyX0luaXQuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xWQ19NaXhlcl9Jbml0LmMKaW5kZXggNDQ5ZTdiMS4uNzM3ZTI2YiAxMDA2NDQKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTFZDX01peGVyX0luaXQuYworKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVkNfTWl4ZXJfSW5pdC5jCkBAIC00NCw3ICs0NCwxOSBAQAogLyogIHZvaWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgTFZDX01peGVyX0luaXQoIExWTWl4ZXIzX0ZMT0FUX3N0ICpwU3RyZWFtLAorICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICBUYXJnZXRHYWluLAorICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICBDdXJyZW50R2FpbikKK3sKKyAgICBMVk1fRkxPQVQgTWF4R2FpbiA9IFRhcmdldEdhaW47CisgICAgTWl4X1ByaXZhdGVfRkxPQVRfc3QgKnBJbnN0YW5jZSA9IChNaXhfUHJpdmF0ZV9GTE9BVF9zdCAqKXBTdHJlYW0tPlByaXZhdGVQYXJhbXM7CisgICAgaWYoQ3VycmVudEdhaW4gPiBNYXhHYWluK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mNsdWRlICJWZWN0b3JBcml0aG1ldGljLmgiCiAKIC8qIEluc3RhbmNlIHBhcmFtZXRlciBzdHJ1Y3R1cmUgKi8KKyNpZmRlZiBCVUlMRF9GTE9BVAordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgICAvKiBHZW5lcmFsICovCisgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICAgICAgICAgICBUYXJnZXQ7ICAgICAgICAgICAvKm51bWJlciBzcGVjaWZ5aW5nIHZhbHVlIG9mIFRhcmdldCBHYWluICovCisgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICAgICAgICAgICBDdXJyZW50OyAgICAgICAgICAvKm51bWJlciBzcGVjaWZ5aW5nIHZhbHVlIG9mIEN1cnJlbnQgR2FpbiAqLworICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICAgICAgICAgRGVsdGE7ICAgICAgICAgICAgLypudW1iZXIgc3BlY2lmeWluZyB2YWx1ZSBvZiBEZWx0YSBHYWluICovCit9IE1peF9Qcml2YXRlX0ZMT0FUX3N0OworI2Vsc2UKIHR5cGVkZWYgc3RydWN0CiB7CiAgICAgLyogR2VuZXJhbCAqLwpAQCAtMzQsOCArNDMsNyBAQAogICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgICAgICAgICAgU2hpZnQ7ICAgICAgICAgICAgICAgICAgLyogTGVmdCBTaGlmdCBmb3IgSW50ZWdlciBwYXJ0IG9mIEdhaW4gKi8KICAgICBMVk1fSU5UMzIgICAgICAgICAgICAgICAgICAgICAgIERlbHRhOyAgICAgICAgICAgICAgICAgIC8qIDMyIGJpdCBudW1iZXIgc3BlY2lmeWluZyB0aGUgZnJhY3Rpb25hbCB2YWx1ZSBvZiBEZWx0YSBHYWluICovCiB9IE1peF9Qcml2YXRlX3N0OwotCi0KKyNlbmRpZgogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICAgREVGSU5JVElPTlMKQEAgLTQ5LDIzICs1Nyw0MyBAQAogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIC8qKiogMTYgYml0IGZ1bmN0aW9ucyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgTFZDX0NvcmVfTWl4SW5Tb2Z0X0QxNkMzMV9TQVQoIExWTWl4ZXIzX0ZMT0FUX3N0ICpwdHJJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9GTE9BVCAgICAgKnNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgKmRzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgbik7CisjZWxzZQogdm9pZCBMVkNfQ29yZV9NaXhJblNvZnRfRDE2QzMxX1NBVCggTFZNaXhlcjNfc3QgKnBJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiAgICAgKnNyYywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgKmRzdCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgbik7Ci0KKyNlbmRpZgorI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIExWQ19Db3JlX01peFNvZnRfMVN0X0QxNkMzMV9XUkEoIExWTWl4ZXIzX0ZMT0FUX3N0ICpwdHJJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICAgICAqc3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICpkc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgbik7CisjZWxzZQogdm9pZCBMVkNfQ29yZV9NaXhTb2Z0XzFTdF9EMTZDMzFfV1JBKCBMVk1peGVyM19zdCAqcEluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICAgICAqc3JjLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAqZHN0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICBuKTsKLQorI2VuZGlmCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgTFZDX0NvcmVfTWl4SGFyZF8yU3RfRDE2QzMxX1NBVCggTFZNaXhlcjNfRkxPQVRfc3QgKnBJbnN0YW5jZTEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTWl4ZXIzX0ZMT0FUX3N0ICAgICAgICAgKnBJbnN0YW5jZTIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9GTE9BVCAgICAgKnNyYzEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9GTE9BVCAgICAgKnNyYzIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgKmRzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICBuKTsKKyNlbHNlCiB2b2lkIExWQ19Db3JlX01peEhhcmRfMlN0X0QxNkMzMV9TQVQoIExWTWl4ZXIzX3N0ICpwSW5zdGFuY2UxLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNaXhlcjNfc3QgICAgICAgICAqcEluc3RhbmNlMiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiAgICAgKnNyYzEsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMTYgICAgICpzcmMyLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAqZHN0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICBuKTsKKyNlbmRpZgogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qIEZvciBhcHBseWluZyBkaWZmZXJlbnQgZ2FpbnMgdG8gTGVmdCBhbmQgcmlnaHQgY2hlbm5hbHMgICAgICAgICAgICAgICAgICAgICAgICAqLwpAQCAtNzMsMTIgKzEwMSwxOSBAQAogLyogcHRySW5zdGFuY2UyIGFwcGxpZXMgdG8gUmlnaHQgY2hhbm5lbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiBHYWluIHZhbHVlcyBzaG91bGQgbm90IGJlIG1vcmUgdGhhdCAxLjAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgTFZDX0NvcmVfTWl4U29mdF8xU3RfMmlfRDE2QzMxX1dSQSggTFZNaXhlcjNfRkxPQVRfc3QgICAgICAgICpwdHJJbnN0YW5jZTEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTWl4ZXIzX0ZMT0FUX3N0ICAgICAgICAqcHRySW5zdGFuY2UyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fRkxPQVQgICAgKnNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICpkc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICBuKTsKKyNlbHNlCiB2b2lkIExWQ19Db3JlX01peFNvZnRfMVN0XzJpX0QxNkMzMV9XUkEoIExWTWl4ZXIzX3N0ICAgICAgICAqcHRySW5zdGFuY2UxLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1peGVyM19zdCAgICAgICAgKnB0ckluc3RhbmNlMiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICAgICpzcmMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAqZHN0LCAgIC8qIGRzdCBjYW4gYmUgZXF1YWwgdG8gc3JjICovCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICBuKTsgICAgIC8qIE51bWJlciBvZiBzdGVyZW8gc2FtcGxlcyAqLworI2VuZGlmCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogLyogRm9yIGFwcGx5aW5nIGRpZmZlcmVudCBnYWlucyB0byBMZWZ0IGFuZCByaWdodCBjaGVubmFscyAgICAgICAgICAgICAgICAgICAgICAgICovCkBAIC04NiwxNiArMTIxLDIyIEBACiAvKiBwdHJJbnN0YW5jZTIgYXBwbGllcyB0byBSaWdodCBjaGFubmVsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qIEdhaW4gdmFsdWVzIHNob3VsZCBub3QgYmUgbW9yZSB0aGF0IDEuMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgTFZDX0NvcmVfTWl4SGFyZF8xU3RfMmlfRDE2QzMxX1NBVCggTFZNaXhlcjNfRkxPQVRfc3QgICAgICAgICpwdHJJbnN0YW5jZTEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTWl4ZXIzX0ZMT0FUX3N0ICAgICAgICAqcHRySW5zdGFuY2UyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fRkxPQVQgICAgKnNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICpkc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICBuKTsKKyNlbHNlCiB2b2lkIExWQ19Db3JlX01peEhhcmRfMVN0XzJpX0QxNkMzMV9TQVQoIExWTWl4ZXIzX3N0ICAgICAgICAqcHRySW5zdGFuY2UxLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1peGVyM19zdCAgICAgICAgKnB0ckluc3RhbmNlMiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICAgICpzcmMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAqZHN0LCAgICAvKiBkc3QgY2FuIGJlIGVxdWFsIHRvIHNyYyAqLwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgbik7ICAgICAgLyogTnVtYmVyIG9mIHN0ZXJlbyBzYW1wbGVzICovCi0KLQorI2VuZGlmCiAKIC8qKiogMzIgYml0IGZ1bmN0aW9ucyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCisjaWZuZGVmIEJVSUxEX0ZMT0FUCiB2b2lkIExWQ19Db3JlX01peEluU29mdF9EMzJDMzFfU0FUKCBMVk1peGVyM19zdCAqcEluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDMyICAgICAqc3JjLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAqZHN0LApAQCAtMTEyLDcgKzE1Myw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMzIgICAgICpzcmMyLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAqZHN0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICBuKTsKLQorI2VuZGlmCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogI2VuZGlmIC8vI2lmbmRlZiBfX0xWQ19NSVhFUl9QUklWQVRFX0hfXwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTFZDX01peGVyX1NldFRhcmdldC5jIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTFZDX01peGVyX1NldFRhcmdldC5jCmluZGV4IDVlZmE1MDEuLjU3NzE3OWQgMTAwNjQ0Ci0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xWQ19NaXhlcl9TZXRUYXJnZXQuYworKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVkNfTWl4ZXJfU2V0VGFyZ2V0LmMKQEAgLTQzLDcgKzQzLDE0IEBACiAvKiAgdm9pZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBMVkNfTWl4ZXJfU2V0VGFyZ2V0KExWTWl4ZXIzX0ZMT0FUX3N0ICpwU3RyZWFtLAorICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgIFRhcmdldEdhaW4pCit7CisgICAgTWl4X1ByaXZhdGVfRkxPQVRfc3QgKnBJbnN0YW5jZSA9IChNaXhfUHJpdmF0ZV9GTE9BVF9zdCAqKXBTdHJlYW0tPlByaXZhdGVQYXJhbXM7CisgICAgcEluc3RhbmNlLT5UYXJnZXQgPSBUYXJnZXRHYWluOyAgICAgICAgICAgICAgIC8vIFVwZGF0ZSBnYWluIFRhcmdldAorfQorI2Vsc2UKIHZvaWQgTFZDX01peGVyX1NldFRhcmdldChMVk1peGVyM19zdCAqcFN0cmVhbSwKICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgVGFyZ2V0R2FpbikKIHsKQEAgLTY0LDMgKzcxLDQgQEAKICAgICBwSW5zdGFuY2UtPkN1cnJlbnQ9Q3VycmVudEdhaW48PCgxNi1TaGlmdCk7ICAgICAgICAgICAgIC8vIFVwZGF0ZSBmcmFjdGlvbmFsIGdhaW4gQ3VycmVudAogICAgIHBJbnN0YW5jZS0+U2hpZnQ9U2hpZnQ7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVXBkYXRlIFNoaWZ0CiB9CisjZW5kaWYKZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xWQ19NaXhlcl9TZXRUaW1lQ29uc3RhbnQuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xWQ19NaXhlcl9TZXRUaW1lQ29uc3RhbnQuYwppbmRleCA0YzFjOGIyLi40OGY1ZDU0IDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVkNfTWl4ZXJfU2V0VGltZUNvbnN0YW50LmMKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTFZDX01peGVyX1NldFRpbWVDb25zdGFudC5jCkBAIC00NCw3ICs0NCw1MSBAQAogLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICB2b2lkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIExWQ19NaXhlcl9TZXRUaW1lQ29uc3RhbnQoTFZNaXhlcjNfRkxPQVRfc3QgKnBTdHJlYW0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAgICAgICBUY19taWxsaXNlYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRnNfZW4gICAgICAgICAgIEZzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgTnVtQ2hhbm5lbHMpCit7CisjaWZkZWYgSElHSEVSX0ZTCisgICAgTFZNX0ZMT0FUICAgRGVsdGFUYWJsZVsxMV0gPSB7MC41MDAwMDBmLC8qODAwMCovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4zNjI4MTJmLC8qMTEwMjUqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMzMzMzMzZiwvKjEyMDAwKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjI1MDAwMGYsLyoxNjAwMCovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4xODE0MDZmLC8qMjIwNTAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMTY2NjY2ZiwvKjI0MDAwKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjEyNTAwMGYsLyozMjAwMCovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wOTA3MDNmLC8qNDQxMDAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDgzMzMzZiwvKjQ4MDAwKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjA0MTY2N2YsLyo5NjAwMCovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMjA4MzNmfTsvKjE5MjAwMCovCisjZWxzZQorICAgIExWTV9GTE9BVCAgIERlbHRhVGFibGVbOV0gPSB7MC41MDAwMDBmLC8qODAwMCovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjM2MjgxMmYsLyoxMTAyNSovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjMzMzMzM2YsLyoxMjAwMCovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjI1MDAwMGYsLyoxNjAwMCovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjE4MTQwNmYsLyoyMjA1MCovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjE2NjY2NmYsLyoyNDAwMCovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjEyNTAwMGYsLyozMjAwMCovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjA5MDcwM2YsLyo0NDEwMCovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjA4MzMzM2Z9Oy8qNDgwMDAqLworI2VuZGlmCiAKKyAgICBNaXhfUHJpdmF0ZV9GTE9BVF9zdCAqcEluc3RhbmNlID0gKE1peF9Qcml2YXRlX0ZMT0FUX3N0ICopcFN0cmVhbS0+UHJpdmF0ZVBhcmFtczsKKyAgICBMVk1fRkxPQVQgRGVsdGEgPSBEZWx0YVRhYmxlW0ZzXTsKKyAgICBEZWx0YSA9IERlbHRhIC8gKE51bUNoYW5uZWxzKTsKKworICAgIGlmKFRjX21pbGxpc2VjID09IDApCisgICAgICAgIERlbHRhID0gMS4wMDAwMDBmOworICAgIGVsc2UKKyAgICAgICAgRGVsdGEgPSBEZWx0YSAvIFRjX21pbGxpc2VjOworCisgICAgaWYoRGVsdGEgPT0gMCkKKyAgICAgICAgRGVsdGEgPSAwLjAwMDAwMDAwMDVmOyAgLyogSWYgVGltZSBDb25zdGFudCBpcyBzbyBsYXJnZSB0aGF0IERlbHRhIGlzIDAsIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhc3NpZ24gbWluaW11bSB2YWx1ZSB0byBEZWx0YSAqLworICAgIHBJbnN0YW5jZS0+RGVsdGEgPSBEZWx0YTsgIC8vIERlbHRhPSgyMTQ3NDgzNjQ3KjQqMTAwMCkvKE51bUNoYW5uZWxzKlNhbXBsZVJhdGUqV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ICAgICAgICAgICAgICAgICAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBMVkNfTWl4ZXJfVmFyU2xvcGVfU2V0VGltZUNvbnN0YW50KCBMVk1peGVyM19GTE9BVF9zdCAqcFN0cmVhbSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAgICAgICBUY19taWxsaXNlYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZzX2VuICAgICAgICAgICBGcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICBOdW1DaGFubmVscykKK3sKKyNpZmRlZiBISUdIRVJfRlMKKyAgICAgTFZNX0ZMT0FUICAgRGVsdGFUYWJsZVsxMV0gPSB7MC41MDAwMDBmLC8qODAwMCovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMzYyODEyZiwvKjExMDI1Ki8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4zMzMzMzNmLC8qMTIwMDAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjI1MDAwMGYsLyoxNjAwMCovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMTgxNDA2ZiwvKjIyMDUwKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4xNjY2NjZmLC8qMjQwMDAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjEyNTAwMGYsLyozMjAwMCovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDkwNzAzZiwvKjQ0MTAwKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wODMzMzNmLC8qNDgwMDAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjA0MTY2NmYsLyo5NjAwMCovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDIwODMzZn07LyoxOTIwMDAqLworI2Vsc2UKKyAgICBMVk1fRkxPQVQgICBEZWx0YVRhYmxlWzldID0gezAuNTAwMDAwZiwvKjgwMDAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4zNjI4MTJmLC8qMTEwMjUqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4zMzMzMzNmLC8qMTIwMDAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4yNTAwMDBmLC8qMTYwMDAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4xODE0MDZmLC8qMjIwNTAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4xNjY2NjZmLC8qMjQwMDAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4xMjUwMDBmLC8qMzIwMDAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wOTA3MDNmLC8qNDQxMDAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wODMzMzNmfTsvKjQ4MDAwKi8KKyNlbmRpZgorICAgIExWTV9GTE9BVCBUY19taWxsaXNlY19mbG9hdDsKKyAgICBNaXhfUHJpdmF0ZV9GTE9BVF9zdCAqcEluc3RhbmNlID0gKE1peF9Qcml2YXRlX0ZMT0FUX3N0ICopcFN0cmVhbS0+UHJpdmF0ZVBhcmFtczsKKyAgICBMVk1fRkxPQVQgRGVsdGEgPSBEZWx0YVRhYmxlW0ZzXTsKIAorICAgIExWTV9GTE9BVCAgIEN1cnJlbnQ7CisgICAgTFZNX0ZMT0FUICAgVGFyZ2V0OworCisgICAgRGVsdGE9RGVsdGEgLyAoTnVtQ2hhbm5lbHMpOworCisgICAgLyogIEdldCBnYWluIHZhbHVlcyAgKi8KKyAgICBDdXJyZW50ID0gcEluc3RhbmNlLT5DdXJyZW50OworICAgIFRhcmdldCA9IHBJbnN0YW5jZS0+VGFyZ2V0OworCisgICAgaWYgKEN1cnJlbnQgIT0gVGFyZ2V0KQorICAgIHsKKyAgICAgICAgVGNfbWlsbGlzZWNfZmxvYXQgPSAoTFZNX0ZMT0FUKShUY19taWxsaXNlYykgLyAoQ3VycmVudCAtIFRhcmdldCk7CisgICAgICAgIGlmIChUY19taWxsaXNlY19mbG9hdCA8IDApCisgICAgICAgICAgICBUY19taWxsaXNlY19mbG9hdCA9IC1UY19taWxsaXNlY19mbG9hdDsKKworICAgICAgICBpZihUY19taWxsaXNlYyA9PSAwKQorICAgICAgICAgICAgRGVsdGEgPSAxLjAwMDAwMGY7CisgICAgICAgIGVsc2UKKyAgICAgICAgICAgIERlbHRhID0gRGVsdGEgLyBUY19taWxsaXNlY19mbG9hdDsKKworICAgICAgICBpZihEZWx0YSA9PSAwKQorICAgICAgICAgICAgRGVsdGEgPSAwLjAwMDAwMDAwMDVmOyAvKiBJZiBUaW1lIENvbnN0YW50IGlzIHNvIGxhcmdlIHRoYXQgRGVsdGEgaXMgMCwgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhc3NpZ24gbWluaW11bSB2YWx1ZSB0byBEZWx0YSAqLworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBEZWx0YSA9IDAuMDAwMDAwMDAwNWY7ICAvKiBNaW5pbXVtIHZhbHVlIGZvciBwcm9wZXIgY2FsbC1iYWNrcyBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChzZXR0aW5nIGl0IHRvIHplcm8gaGFzIHNvbWUgcHJvYmxlbXMsIHRvIGJlIGNvcnJlY3RlZCkgKi8KKyAgICB9CisKKyAgICBwSW5zdGFuY2UtPkRlbHRhID0gRGVsdGE7ICAgICAvLyBEZWx0YT0oMjE0NzQ4MzY0Nyo0KjEwMDApLyhOdW1DaGFubmVscypTYW1wbGVSYXRlKlRjX21pbGxpc2VjKQorfQorI2Vsc2UKIHZvaWQgTFZDX01peGVyX1ZhclNsb3BlX1NldFRpbWVDb25zdGFudCggTFZNaXhlcjNfc3QgKnBTdHJlYW0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAgICAgICBUY19taWxsaXNlYywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRnNfZW4gICAgICAgICAgIEZzLApAQCAtOTMsMyArMTU4LDQgQEAKIAogICAgIHBJbnN0YW5jZS0+RGVsdGE9RGVsdGE7ICAgICAvLyBEZWx0YT0oMjE0NzQ4MzY0Nyo0KjEwMDApLyhOdW1DaGFubmVscypTYW1wbGVSYXRlKlRjX21pbGxpc2VjKSBpbiBRIDAuMzEgZm9ybWF0CiB9CisjZW5kaWYKZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xWTV9GT19IUEYuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xWTV9GT19IUEYuYwppbmRleCA2ZDhmZTQ2Li45MDk0NjIyIDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVk1fRk9fSFBGLmMKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTFZNX0ZPX0hQRi5jCkBAIC01Myw3ICs1Myw3IEBACiAvKiAgIEE5ICAgICAgICAgICAgIDE5NDY2OTU3NyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogICBBMTAgICAgICAgICAgICA4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgWSA9IChBMCArIEExKlggKyBBMipYMiArIEEzKlgzICsghS4uICsgQU4qeE4pIDw8IEFOKzEgICAgICAgICAgICAgICAgICAqLworLyogIFkgPSAoQTAgKyBBMSpYICsgQTIqWDIgKyBBMypYMyArIO+/vS4uICsgQU4qeE4pIDw8IEFOKzEgICAgICAgICAgICAgICAgICAqLwogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwpAQCAtNjgsNyArNjgsMzYgQEAKIC8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKyNpZmRlZiBCVUlMRF9GTE9BVAorTFZNX0ZMT0FUIExWTV9GT19IUEYoICAgTFZNX0ZMT0FUICAgICAgIHcsCisgICAgICAgICAgICAgICAgICAgICAgICBGT19GTE9BVF9Db2Vmc190ICAqcENvZWZmcykKK3sKKyAgICBMVk1fRkxPQVQgWSxDb2VmZmljaWVudHNbMTNdID0gey0wLjk5OTk5NmYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjk5OTgwMWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC40OTc4MjRmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4zMjI5MzdmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuMTgwODgwZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDg3NjU4ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjAzMjEwMmYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwODE2M2YsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4wMDEyNTJmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwODlmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwfTsKKyAgICBZPUxWTV9Qb2x5bm9taWFsKChMVk1fVUlOVDE2KTksIENvZWZmaWNpZW50cywgdyk7CiAKKyAgICBwQ29lZmZzLT5CMSA9IC1ZOyAgICAgICAgIC8qIFN0b3JlIC1CMSBpbiBmaWx0ZXIgc3RydWN0dXJlIGluc3RlYWQgb2YgQjEhKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBBMD0oMS1CMSkvMj0gQjEvMiAtIDAuNSovCisgICAgWSA9IFkgLyAyLjBmOyAgICAgICAgICAgICAgICAgLyogQTA9WT1CMS8yKi8KKyAgICBZID0gWSAtIDAuNWY7ICAgICAgICAgLyogQTA9WT0oQjEvMiAtIDAuNSkqLworCisgICAgcENvZWZmcy0+QTAgPSBZICogRklMVEVSX0xPU1NfRkxPQVQ7ICAgICAgICAgICAgICAgICAgLyogQXBwbHkgbG9zcyB0byBhdm9pZCBvdmVyZmxvdyovCisgICAgcENvZWZmcy0+QTEgPSAtcENvZWZmcy0+QTA7ICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogU3RvcmUgQTE9LUEwKi8KKworICAgIHJldHVybiAxOworfQorI2Vsc2UKIExWTV9JTlQzMiBMVk1fRk9fSFBGKCAgIExWTV9JTlQzMiAgICAgICB3LAogICAgICAgICAgICAgICAgICAgICAgICAgRk9fQzMyX0NvZWZzX3QgICpwQ29lZmZzKQogewpAQCAtOTcsNCArMTI2LDQgQEAKIAogICAgIHJldHVybiAxOwogfQotCisjZW5kaWYKZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xWTV9GT19MUEYuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xWTV9GT19MUEYuYwppbmRleCA4NmVjOTUxLi45ZmU2N2Y4IDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVk1fRk9fTFBGLmMKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTFZNX0ZPX0xQRi5jCkBAIC01Myw3ICs1Myw3IEBACiAvKiAgIEE5ICAgICAgICAgICAgIDE5NDY2OTU3NyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogICBBMTAgICAgICAgICAgICA4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgWSA9IChBMCArIEExKlggKyBBMipYMiArIEEzKlgzICsghS4uICsgQU4qeE4pIDw8IEFOKzEgICAgICAgICAgICAgICAgICAqLworLyogIFkgPSAoQTAgKyBBMSpYICsgQTIqWDIgKyBBMypYMyArIO+/vS4uICsgQU4qeE4pIDw8IEFOKzEgICAgICAgICAgICAgICAgICAqLwogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwpAQCAtNjgsNyArNjgsMzMgQEAKIC8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKyNpZmRlZiBCVUlMRF9GTE9BVAorTFZNX0ZMT0FUIExWTV9GT19MUEYoICAgTFZNX0ZMT0FUICAgICAgIHcsCisgICAgICAgICAgICAgICAgICAgICAgICBGT19GTE9BVF9Db2Vmc190ICAqcENvZWZmcykKK3sKKyAgICBMVk1fRkxPQVQgWSxDb2VmZmljaWVudHNbMTNdID0gey0wLjk5OTk5NmYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjk5OTgwMWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC40OTc4MjRmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4zMjI5MzdmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuMTgwODgwZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDg3NjU4ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjAzMjEwMmYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwODE2M2YsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4wMDEyNTJmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwODlmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMH07CisgICAgWT1MVk1fUG9seW5vbWlhbCgoTFZNX1VJTlQxNik5LCBDb2VmZmljaWVudHMsIHcpOworICAgIHBDb2VmZnMtPkIxID0gLVk7ICAgICAvLyBTdG9yZSAtQjEgaW4gZmlsdGVyIHN0cnVjdHVyZSBpbnN0ZWFkIG9mIEIxIQorICAgICAgICAgICAgICAgICAgICAgICAgLy8gQTA9KDErQjEpLzI9IEIxLzIgKyAwLjUKKyAgICBZID0gWSAvIDIuMGY7ICAgICAgICAgICAgIC8vIEEwPVk9QjEvMgorICAgIFkgPSBZICsgMC41ZjsgICAgIC8vIEEwPVk9KEIxLzIgKyAwLjUpCiAKKyAgICBwQ29lZmZzLT5BMCA9IFkgKiBGSUxURVJfTE9TU19GTE9BVDsKKyAgICBwQ29lZmZzLT5BMSA9IHBDb2VmZnMtPkEwOworCisgICAgcmV0dXJuIDE7Cit9CisjZWxzZQogTFZNX0lOVDMyIExWTV9GT19MUEYoICAgTFZNX0lOVDMyICAgICAgIHcsCiAgICAgICAgICAgICAgICAgICAgICAgICBGT19DMzJfQ29lZnNfdCAgKnBDb2VmZnMpCiB7CkBAIC05NCw0ICsxMjAsNCBAQAogICAgIHBDb2VmZnMtPkExPXBDb2VmZnMtPkEwOwogICAgIHJldHVybiAxOwogfQotCisjZW5kaWYKZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xWTV9HZXRPbWVnYS5jIGIvbWVkaWEvbGliZWZmZWN0cy9s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mCiAKKyNpZmRlZiBISUdIRVJfRlMKKyNkZWZpbmUgTFZWRExfMlBpQnlfOTYwMDBfZiAgICAgICAwLjAwMDA2NTQ1MGYKKyNkZWZpbmUgTFZWRExfMlBpQnlfMTkyMDAwX2YgICAgICAwLjAwMDAzMjcyNWYKKyNlbmRpZgorY29uc3QgTFZNX0ZMT0FUICAgICBMVlZETF8yUGlPbkZzVGFibGVbXSA9ICB7TFZWRExfMlBpQnlfODAwMF9mLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZWRExfMlBpQnlfMTEwMjVfZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWVkRMXzJQaUJ5XzEyMDAwX2YsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVlZETF8yUGlCeV8xNjAwMF9mLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZWRExfMlBpQnlfMjIwNTBfZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWVkRMXzJQaUJ5XzI0MDAwX2YsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVlZETF8yUGlCeV8zMjAwMF9mLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZWRExfMlBpQnlfNDQxMDBfZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWVkRMXzJQaUJ5XzQ4MDAwX2YKKyNpZmRlZiBISUdIRVJfRlMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLExWVkRMXzJQaUJ5Xzk2MDAwX2YKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLExWVkRMXzJQaUJ5XzE5MjAwMF9mCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworI2VuZGlmCiAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwogLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICAgTFZNX0dldE9tZWdhICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCkBAIC01OSw3ICs4OCwyMCBAQAogLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICAgdz0yKnBpKkZjL0ZzIGluIFEyLjI5IGZvcm1hdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCisjaWZkZWYgQlVJTERfRkxPQVQKKyNpZmRlZiBISUdIRVJfRlMKK0xWTV9GTE9BVCBMVk1fR2V0T21lZ2EoTFZNX1VJTlQzMiAgICAgICAgICAgICAgICAgIEZjLAorICAgICAgICAgICAgICAgICAgICAgICBMVk1fRnNfZW4gICAgICAgICAgICAgICAgICAgRnMpCisjZWxzZQorTFZNX0ZMT0FUIExWTV9HZXRPbWVnYShMVk1fVUlOVDE2ICAgICAgICAgICAgICAgICAgRmMsCisgICAgICAgICAgICAgICAgICAgICAgIExWTV9Gc19lbiAgICAgICAgICAgICAgICAgICBGcykKKyNlbmRpZgoreworICAgIExWTV9GTE9BVCAgIHc7CisgICAgdyA9IChMVk1fRkxPQVQpRmMgKiBMVlZETF8yUGlPbkZzVGFibGVbRnNd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0FUICovCisjZGVmaW5lIEFMUEhBX0Zsb2F0XzAgICAgICAgICAgICAgICAgICAgICAgICAwLjk5OTk5OWYKKyNkZWZpbmUgQUxQSEFfRmxvYXRfMSAgICAgICAgICAgICAgICAgICAgICAgIDAuOTk5OTk4ZgorI2RlZmluZSBBTFBIQV9GbG9hdF8yICAgICAgICAgICAgICAgICAgICAgICAgMC45OTk5OTdmCisjZGVmaW5lIEFMUEhBX0Zsb2F0XzMgICAgICAgICAgICAgICAgICAgICAgICAwLjk5OTk5NmYKKyNkZWZpbmUgQUxQSEFfRmxvYXRfNCAgICAgICAgICAgICAgICAgICAgICAgIDAuOTk5OTk1ZgorI2RlZmluZSBBTFBIQV9GbG9hdF81ICAgICAgICAgICAgICAgICAgICAgICAgMC45OTk5OTJmCisjZGVmaW5lIEFMUEhBX0Zsb2F0XzYgICAgICAgICAgICAgICAgICAgICAgICAwLjk5OTk4OWYKKyNkZWZpbmUgQUxQSEFfRmxvYXRfNyAgICAgICAgICAgICAgICAgICAgICAgIDAuOTk5OTg1ZgorI2RlZmluZSBBTFBIQV9GbG9hdF84ICAgICAgICAgICAgICAgICAgICAgICAgMC45OTk5NzlmCisjZGVmaW5lIEFMUEhBX0Zsb2F0XzkgICAgICAgICAgICAgICAgICAgICAgICAwLjk5OTk3MGYKKyNkZWZpbmUgQUxQSEFfRmxvYXRfMTAgICAgICAgICAgICAgICAgICAgICAgIDAuOTk5OTU3ZgorI2RlZmluZSBBTFBIQV9GbG9hdF8xMSAgICAgICAgICAgICAgICAgICAgICAgMC45OTk5MzlmCisjZGVmaW5lIEFMUEhBX0Zsb2F0XzEyICAgICAgICAgICAgICAgICAgICAgICAwLjk5OTkxNGYKKyNkZWZpbmUgQUxQSEFfRmxvYXRfMTMgICAgICAgICAgICAgICAgICAgICAgIDAuOTk5ODc5ZgorI2RlZmluZSBBTFBIQV9GbG9hdF8xNCAgICAgICAgICAgICAgICAgICAgICAgMC45OTk4MjlmCisjZGVmaW5lIEFMUEhBX0Zsb2F0XzE1ICAgICAgICAgICAgICAgICAgICAgICAwLjk5OTc1OGYKKyNkZWZpbmUgQUxQSEFfRmxvYXRfMTYgICAgICAgICAgICAgICAgICAgICAgIDAuOTk5NjU4ZgorI2RlZmluZSBBTFBIQV9GbG9hdF8xNyAgICAgICAgICAgICAgICAgICAgICAgMC45OTk1MTZmCisjZGVmaW5lIEFMUEhBX0Zsb2F0XzE4ICAgICAgICAgICAgICAgICAgICAgICAwLjk5OTMxNmYKKyNkZWZpbmUgQUxQSEFfRmxvYXRfMTkgICAgICAgICAgICAgICAgICAgICAgIDAuOTk5MDMzZgorI2RlZmluZSBBTFBIQV9GbG9hdF8yMCAgICAgICAgICAgICAgICAgICAgICAgMC45OTg2MzNmCisjZGVmaW5lIEFMUEhBX0Zsb2F0XzIxICAgICAgICAgICAgICAgICAgICAgICAwLjk5ODA2N2YKKyNkZWZpbmUgQUxQSEFfRmxvYXRfMjIgICAgICAgICAgICAgICAgICAgICAgIDAuOTk3MjY4ZgorI2RlZmluZSBBTFBIQV9GbG9hdF8yMyAgICAgICAgICAgICAgICAgICAgICAgMC45OTYxMzlmCisjZGVmaW5lIEFMUEhBX0Zsb2F0XzI0ICAgICAgICAgICAgICAgICAgICAgICAwLjk5NDU0NWYKKyNkZWZpbmUgQUxQSEFfRmxvYXRfMjUgICAgICAgICAgICAgICAgICAgICAgIDAuOTkyMjk1ZgorI2RlZmluZSBBTFBIQV9GbG9hdF8yNiAgICAgICAgICAgICAgICAgICAgICAgMC45ODkxMjNmCisjZGVmaW5lIEFMUEhBX0Zsb2F0XzI3ICAgICAgICAgICAgICAgICAgICAgICAwLjk4NDY1NGYKKyNkZWZpbmUgQUxQSEFfRmxvYXRfMjggICAgICAgICAgICAgICAgICAgICAgIDAuOTc4MzcwZgorI2RlZmluZSBBTFBIQV9GbG9hdF8yOSAgICAgICAgICAgICAgICAgICAgICAgMC45Njk1NTNmCisjZGVmaW5lIEFMUEhBX0Zsb2F0XzMwICAgICAgICAgICAgICAgICAgICAgICAwLjk1NzIyMWYKKyNkZWZpbmUgQUxQSEFfRmxvYXRfMzEgICAgICAgICAgICAgICAgICAgICAgIDAuOTQwMDUxZgorI2RlZmluZSBBTFBIQV9GbG9hdF8zMiAgICAgICAgICAgICAgICAgICAgICAgMC45MTYyOTdmCisjZGVmaW5lIEFMUEhBX0Zsb2F0XzMzICAgICAgICAgICAgICAgICAgICAgICAwLjg4MzcyOWYKKyNkZWZpbmUgQUxQSEFfRmxvYXRfMzQgICAgICAgICAgICAgICAgICAgICAgIDAuODM5NjQ1ZgorI2RlZmluZSBBTFBIQV9GbG9hdF8zNSAgICAgICAgICAgICAgICAgICAgICAgMC43ODEwMzZmCisjZGVmaW5lIEFMUEhBX0Zsb2F0XzM2ICAgICAgICAgICAgICAgICAgICAgICAwLjcwNTA3OGYKKyNkZWZpbmUgQUxQSEFfRmxvYXRfMzcgICAgICAgICAgICAgICAgICAgICAgIDAuNjEwMTA4ZgorI2RlZmluZSBBTFBIQV9GbG9hdF8zOCAgICAgICAgICAgICAgICAgICAgICAgMC40OTcyMzlmCisjZGVmaW5lIEFMUEhBX0Zsb2F0XzM5ICAgICAgICAgICAgICAgICAgICAgICAwLjM3MjM0M2YKKyNkZWZpbmUgQUxQSEFfRmxvYXRfNDAgICAgICAgICAgICAgICAgICAgICAgIDAuMjQ3MzUxZgorI2RlZmluZSBBTFBIQV9GbG9hdF80MSAgICAgICAgICAgICAgICAgICAgICAgMC4xMzg3MjJmCisjZGVmaW5lIEFMUEhBX0Zsb2F0XzQyICAgICAgICAgICAgICAgICAgICAgICAwLjA2MTIzNGYKKyNkZWZpbmUgQUxQSEFfRmxvYXRfNDMgICAgICAgICAgICAgICAgICAgICAgIDAuMDE5MjY3ZgorI2RlZmluZSBBTFBIQV9GbG9hdF80NCAgICAgICAgICAgICAgICAgICAgICAgMC4wMDM3NTZmCisjZGVmaW5lIEFMUEhBX0Zsb2F0XzQ1ICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDM3MmYKKyNkZWZpbmUgQUxQSEFfRmxvYXRfNDYgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDE0ZgorI2RlZmluZSBBTFBIQV9GbG9hdF80NyAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDBmCisjZGVmaW5lIEFMUEhBX0Zsb2F0XzQ4ICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMGYKKyNkZWZpbmUgQUxQSEFfRmxvYXRfNDkgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwZgorI2RlZmluZSBBTFBIQV9GbG9hdF81MCAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDBmCisjZW5kaWYKIAogI2VuZGlmCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVk1fTWl4ZXJfVGltZUNvbnN0YW50LmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVk1fTWl4ZXJfVGltZUNvbnN0YW50LmMKaW5kZXggODA5ZDkwNC4uMThiMjc4MiAxMDA2NDQKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTFZNX01peGVyX1RpbWVDb25zdGFudC5jCisrKyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xWTV9NaXhlcl9UaW1lQ29uc3RhbnQuYwpAQCAtNTcsNyArNTcsMTEwIEBACiAvKiAgQWxwaGEgICAtIHRoZSBmaWx0ZXIgY29lZmZpY2llbnQgUTMxIGZvcm1hdCAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQlVJTERfRkxPQVQKK0xWTV9GTE9BVCBMVk1fTWl4ZXJfVGltZUNvbnN0YW50KExWTV9VSU5UMzIgICB0YywKKyNpZmRlZiBISUdIRVJfRlMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDMyICAgRnMsCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgICBGcywKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgICBOdW1DaGFubmVscykKK3sKIAorICAgIExWTV9VSU5UMzIgIFByb2R1Y3Q7CisgICAgTFZNX0ZMT0FUICBQcm9kdWN0RmxvYXQ7CisgICAgTFZNX0lOVDE2ICAgSW50ZXJwb2xhdGVTaG9ydDsKKyAgICBMVk1fRkxPQVQgICBJbnRlcnBvbGF0ZTsKKyAgICBMVk1fVUlOVDE2ICBTaGlmdDsKKyAgICBMVk1fRkxPQVQgICBEaWZmOworICAgIExWTV9GTE9BVCAgVGFibGVbXSA9IHtBTFBIQV9GbG9hdF8wLCAgICAgICAgICAgICAvKiBMb2cgc3BhY2VkIGxvb2stdXAgdGFibGUgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfRmxvYXRfMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfRmxvYXRfMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfRmxvYXRfMywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfRmxvYXRfNCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfRmxvYXRfNSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfRmxvYXRfNiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfRmxvYXRfNywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfRmxvYXRfOCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfRmxvYXRfOSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfRmxvYXRfMTAsCisgICAgICAgICAgICAgICAgICAgICAgICAgIEFMUEhBX0Zsb2F0XzExLAorICAgICAgICAgICAgICAgICAgICAgICAgICBBTFBIQV9GbG9hdF8xMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfRmxvYXRfMTMsCisgICAgICAgICAgICAgICAgICAgICAgICAgIEFMUEhBX0Zsb2F0XzE0LAorICAgICAgICAgICAgICAgICAgICAgICAgICBBTFBIQV9GbG9hdF8xNSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfRmxvYXRfMTYsCisgICAgICAgICAgICAgICAgICAgICAgICAgIEFMUEhBX0Zsb2F0XzE3LAorICAgICAgICAgICAgICAgICAgICAgICAgICBBTFBIQV9GbG9hdF8xOCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfRmxvYXRfMTksCisgICAgICAgICAgICAgICAgICAgICAgICAgIEFMUEhBX0Zsb2F0XzIwLAorICAgICAgICAgICAgICAgICAgICAgICAgICBBTFBIQV9GbG9hdF8yMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfRmxvYXRfMjIsCisgICAgICAgICAgICAgICAgICAgICAgICAgIEFMUEhBX0Zsb2F0XzIzLAorICAgICAgICAgICAgICAgICAgICAgICAgICBBTFBIQV9GbG9hdF8yNCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfRmxvYXRfMjUsCisgICAgICAgICAgICAgICAgICAgICAgICAgIEFMUEhBX0Zsb2F0XzI2LAorICAgICAgICAgICAgICAgICAgICAgICAgICBBTFBIQV9GbG9hdF8yNywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfRmxvYXRfMjgsCisgICAgICAgICAgICAgICAgICAgICAgICAgIEFMUEhBX0Zsb2F0XzI5LAorICAgICAgICAgICAgICAgICAgICAgICAgICBBTFBIQV9GbG9hdF8zMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfRmxvYXRfMzEsCisgICAgICAgICAgICAgICAgICAgICAgICAgIEFMUEhBX0Zsb2F0XzMyLAorICAgICAgICAgICAgICAgICAgICAgICAgICBBTFBIQV9GbG9hdF8zMywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfRmxvYXRfMzQsCisgICAgICAgICAgICAgICAgICAgICAgICAgIEFMUEhBX0Zsb2F0XzM1LAorICAgICAgICAgICAgICAgICAgICAgICAgICBBTFBIQV9GbG9hdF8zNiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfRmxvYXRfMzcsCisgICAgICAgICAgICAgICAgICAgICAgICAgIEFMUEhBX0Zsb2F0XzM4LAorICAgICAgICAgICAgICAgICAgICAgICAgICBBTFBIQV9GbG9hdF8zOSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfRmxvYXRfNDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgIEFMUEhBX0Zsb2F0XzQxLAorICAgICAgICAgICAgICAgICAgICAgICAgICBBTFBIQV9GbG9hdF80MiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfRmxvYXRfNDMsCisgICAgICAgICAgICAgICAgICAgICAgICAgIEFMUEhBX0Zsb2F0XzQ0LAorICAgICAgICAgICAgICAgICAgICAgICAgICBBTFBIQV9GbG9hdF80NSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfRmxvYXRfNDYsCisgICAgICAgICAgICAgICAgICAgICAgICAgIEFMUEhBX0Zsb2F0XzQ3LAorICAgICAgICAgICAgICAgICAgICAgICAgICBBTFBIQV9GbG9hdF80OCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfRmxvYXRfNDksCisgICAgICAgICAgICAgICAgICAgICAgICAgIEFMUEhBX0Zsb2F0XzUwfTsKKworICAgIC8qIENhbGN1bGF0ZSB0aGUgcHJv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gMV0pOworICAgIERpZmYgPSBEaWZmICogSW50ZXJwb2xhdGU7CisgICAgUHJvZHVjdEZsb2F0ID0gVGFibGVbU2hpZnQgKyAxXSArIERpZmY7CisKKyAgICByZXR1cm4gUHJvZHVjdEZsb2F0OworfQorI2Vsc2UKIExWTV9VSU5UMzIgTFZNX01peGVyX1RpbWVDb25zdGFudChMVk1fVUlOVDMyICAgdGMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiAgIEZzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgICBOdW1DaGFubmVscykKQEAgLTE1NCwzICsyNTcsNCBAQAogCiAgICAgcmV0dXJuIFByb2R1Y3Q7CiB9CisjZW5kaWYKZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xWTV9Qb2x5bm9taWFsLmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVk1fUG9seW5vbWlhbC5jCmluZGV4IGE2ZDdkYjIuLmNkNTc3NjcgMTAwNjQ0Ci0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xWTV9Qb2x5bm9taWFsLmMKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTFZNX1BvbHlub21pYWwuYwpAQCAtMjUsNyArMjUsNyBAQAogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiAgIFRoaXMgZnVuY3Rpb24gcGVyZm9ybXMgcG9seW5vbWlhbCBleHBhbnNpb24gICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFkgPSAoQTAgKyBBMSpYICsgQTIqWDIgKyBBMypYMyArIIUuLiArIEFOKnhOKSA8PCBBTisxICAgICAgICAgICAgICAgICAgKi8KKy8qICBZID0gKEEwICsgQTEqWCArIEEyKlgyICsgQTMqWDMgKyDvv70uLiArIEFOKnhOKSA8PCBBTisxICAgICAgICAgICAgICAgICAgKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiAgTFZNX0lOVDMyIExWTV9Qb2x5bm9taWFsKExWTV9VSU5UMTYgICAgTiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgKnBDb2VmZmljaWVudHMsICAgICAgICAgICAgICAgICAgKi8KQEAgLTQwLDcgKzQwLDQ4IEBACiAvKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogICBUaGUgcmVzdWx0IG9mIHRoZSBwb2x5bm9taWFsIGV4cGFuc2lvbiBpbiBRMS4zMSBmb3JtYXQgICAgICAgICAgICAgICAgKi8KIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisjaWZkZWYgQlVJTERfRkxPQVQKK0xWTV9GTE9BVCBMVk1fUG9seW5vbWlhbChMVk1fVUlOVDE2ICAgIE4sCisgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICpwQ29lZmZpY2llbnRzLAorICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICBYKQoreworICAgIExWTV9JTlQzMiBpOworICAgIExWTV9GTE9BVCBZLEEsWFRlbXAsVGVtcCxzaWduOwogCisgICAgWSA9ICpwQ29lZmZpY2llbnRzOyAvKiBZPUEwKi8KKyAgICBwQ29lZmZpY2llbnRzKys7CisKKyAgICBpZihYID09IC0xLjBmKQorICAgIHsKKyAgICAgICAgVGVtcCA9IC0xOworICAgICAgICBzaWduID0gVGVtcDsKKyAgICAgICAgZm9yKGkgPSAxOyBpIDw9IE47IGkrKykKKyAgICAgICAgeworICAgICAgICAgICAgWSArPSAoKCpwQ29lZmZpY2llbnRzKSAqIHNpZ24pOworICAgICAgICAgICAgcENvZWZmaWNpZW50cysrOworICAgICAgICAgICAgc2lnbiAqPSBUZW1wOworICAgICAgICB9CisKKworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBYVGVtcCA9IFg7CisgICAgICAgIGZvcihpID0gTi0xOyBpID49IDA7IGktLSkKKyAgICAgICAgeworICAgICAgICAgICAgQSA9ICpwQ29lZmZpY2llbnRzOworICAgICAgICAgICAgcENvZWZmaWNpZW50cysrOworCisgICAgICAgICAgICBUZW1wID0gQSAqIFhUZW1wOworICAgICAgICAgICAgWSArPSBUZW1wOworCisgICAgICAgICAgICBUZW1wID0gWFRlbXAgKiBYOworICAgICAgICAgICAgWFRlbXAgPSBUZW1wOworICAgICAgICB9CisgICAgfQorICAgIHJldHVybiBZOworfQorI2Vsc2UKIExWTV9JTlQzMiBMVk1fUG9seW5vbWlhbChMVk1fVUlOVDE2ICAgIE4sCiAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICpwQ29lZmZpY2llbnRzLAogICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICBYKQpAQCAtOTMsNCArMTM0LDQgQEAKICAgICB9CiAgICAgcmV0dXJuIFk7CiB9Ci0KKyNlbmRpZgpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTFZNX1Bvd2VyMTAuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xWTV9Qb3dlcjEwLmMKaW5kZXggNmNhMTA3Ny4uODc4NTU5NCAxMDA2NDQKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTFZNX1Bvd2VyMTAuYworKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVk1fUG93ZXIxMC5jCkBAIC00NCw3ICs0NCw3IEBACiAvKiAgIEExMSAgICAgICAgICAgIDUwNDc3MjQ0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogICBBMTIgICAgICAgICAgICAtMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgWSA9IChBMCArIEExKlggKyBBMipYMiArIEEzKlgzICsghS4uICsgQU4qeE4pIDw8IEFOKzEgICAgICAgICAgICAgICAgICAqLworLyogIFkgPSAoQTAgKyBBMSpYICsgQTIqWDIgKyBBMypYMyArIO+/vS4uICsgQU4qeE4pIDw8IEFOKzEgICAgICAgICAgICAgICAgICAqLwogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwpAQCAtNTQsNyArNTQsMjggQEAKIC8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiAgIFRoZSByZXN1bHQgb2YgdGhlIDEweCBleHBhbnNpb24gaW4gUTguMjQgZm9ybWF0ICAgICAgICAgICAgICAgICAgICAgICAqLwogLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQorI2lmZGVmIEJVSUxEX0ZMT0FUCitMVk1fRkxPQVQgTFZNX1Bvd2VyMTAoTFZNX0ZMT0FUICAgICBYKQoreworICAgIExWTV9GTE9BVCBZLENvZWZmaWNpZW50c1sxM109ezAuOTk5OTA2ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyLjMwMjQ3NWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMi42NTI3NjVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIuMDM1NDk0ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxLjE2NTY2N2YsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC41Mzc2NzZmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMjEzMTkyZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjA2OTYwM2YsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMTY1NTNmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDA0MzczZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMTgxN2YsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAzNjdmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB9OworICAgIFk9TFZNX1BvbHlub21pYWwoKExWTV9VSU5UMTYpMTEsCisgICAgICAgICAgICAgICAgICAgICBDb2VmZmljaWVudHMsCisgICAgICAgICAgICAgICAgICAgICBYKTsKKyAgICByZXR1cm4gWTsKK30KKyNlbHNlCiBMVk1fSU5UMzIgTFZNX1Bvd2VyMTAoTFZNX0lOVDMyICAgICBYKQogewogICAgIExWTV9JTlQzMiBZLENvZWZmaWNpZW50c1sxM109eyAgMTY3NzU2MzYsCkBAIC03NSw0ICs5Niw0IEBACiAgICAgICAgICAgICAgICAgICAgICAgICBYKTsKICAgICByZXR1cm4gWTsKIH0KLQorI2VuZGlmCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9Mb2FkQ29uc3RfMzIuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xvYWRDb25zdF8zMi5jCmluZGV4IDJmMWU1OTEuLjllMTRjM2IgMTAwNjQ0Ci0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xvYWRDb25zdF8zMi5jCisrKyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xvYWRDb25zdF8zMi5jCkBAIC0yNCw3ICsyNCwyMiBAQAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICAgIEZVTkNUSU9OIExvYWRDb25zdF8zMgogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgTG9hZENvbnN0X0Zsb2F0KGNvbnN0IExWTV9GTE9BVCAgIHZhbCwKKyAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgKmRzdCwKKyAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBuICkKK3sKKyAgICBMVk1fSU5UMTYgaWk7CiAKKyAgICBmb3IgKGlpID0gbjsgaWkgIT0gMDsgaWktLSkKKyAgICB7CisgICAgICAgICpkc3QgPSB2YWw7CisgICAgICAgIGRzdCsrOworICAgIH0KKworICAgIHJldHVybjsKK30KKyNlbHNlCiB2b2lkIExvYWRDb25zdF8zMihjb25zdCBMVk1fSU5UMzIgICB2YWwsCiAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICpkc3QsCiAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgbiApCkBAIC0zOSw1ICs1NCw2IEBACiAKICAgICByZXR1cm47CiB9CisjZW5kaWYKIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9NU1RvMmlfU2F0XzE2eDE2LmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9NU1RvMmlfU2F0XzE2eDE2LmMKaW5kZXggMjYyOTdlNy4uMDJjOTA2YSAxMDA2NDQKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTVNUbzJpX1NhdF8xNngxNi5jCisrKyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL01TVG8yaV9TYXRfMTZ4MTYuYwpAQCAtNzcsNCArNzcsNTggQEAKIAogICAgIHJldHVybjsKIH0KKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBNU1RvMmlfU2F0X0Zsb2F0KGNvbnN0IExWTV9GTE9BVCAgKnNyY00sCisgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICAqc3JjUywKKyAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICpkc3QsCisgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICBuICkKK3sKKyAgICBMVk1fRkxPQVQgdGVtcCxtVmFsLHNWYWw7CisgICAgTFZNX0lOVDE2IGlpOworCisKKyAgICBmb3IgKGlpID0gbjsgaWkgIT0gMDsgaWktLSkKKyAgICB7CisgICAgICAgIG1WYWwgPSAoTFZNX0ZMT0FUKSpzcmNNOworICAgICAgICBzcmNNKys7CisKKyAgICAgICAgc1ZhbCA9IChMVk1fRkxPQVQpKnNyY1M7CisgICAgICAgIHNyY1MrKzsKKworICAgICAgICB0ZW1wID0gbVZhbCArIHNWYWw7CisKKyAgICAgICAgaWYgKHRlbXAgPiAxLjBmKQorICAgICAgICB7CisgICAgICAgICAgICAqZHN0ID0gMS4wZjsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmICh0ZW1wIDwgLTEuMGYpCisgICAgICAgIHsKKyAgICAgICAgICAgICpkc3QgPSAtMS4wZjsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgICpkc3QgPSAoTFZNX0ZMT0FUKXRlbXA7CisgICAgICAgIH0KKyAgICAgICAgZHN0Kys7CisKKyAgICAgICAgdGVtcCA9IG1WYWwgLSBzVmFsOworCisgICAgICAgIGlmICh0ZW1wID4gMS4wZikKKyAgICAgICAgeworICAgICAgICAgICAgKmRzdCA9IDEuMGY7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAodGVtcCA8IC0xLjBmKQorICAgICAgICB7CisgICAgICAgICAgICAqZHN0ID0gLSAxLjBmOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgKmRzdCA9IChMVk1fRkxPQVQpdGVtcDsKKyAgICAgICAgfQorICAgICAgICBkc3QrKzsKKyAgICB9CisKKyAgICByZXR1cm47Cit9CisjZW5kaWYKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmM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ICAgICAgICAgICpkc3QgPSAtMS4wMDAwMDBmOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgKmRzdCA9IFRlbXA7CisgICAgICAgIH0KKyAgICAgICAgZHN0Kys7CisgICAgfQorCisgICAgcmV0dXJuOworfQorI2VuZGlmCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9NaXhJblNvZnRfRDMyQzMxX1NBVC5jIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTWl4SW5Tb2Z0X0QzMkMzMV9TQVQuYwppbmRleCA3M2MyNmVkLi4xNmUzNjdiIDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9NaXhJblNvZnRfRDMyQzMxX1NBVC5jCisrKyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL01peEluU29mdF9EMzJDMzFfU0FULmMKQEAgLTMyLDcgKzMyLDcxIEBACiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICAgRlVOQ1RJT04gTUlYSU5TT0ZUX0QzMkMzMV9TQVQKICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIE1peEluU29mdF9EMzJDMzFfU0FUKCBNaXhfMVN0X0NsbF9GTE9BVF90ICAgICAgICAqcEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICAgICAgKnNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICpkc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICBuKQoreworICAgIGNoYXIgSGFyZE1peGluZyA9IFRSVUU7CiAKKyAgICBpZihuIDw9IDApICAgIHJldHVybjsKKworICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICBTT0ZUIE1JWElORworICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgaWYgKHBJbnN0YW5jZS0+Q3VycmVudCAhPSBwSW5zdGFuY2UtPlRhcmdldCkKKyAgICB7CisgICAgICAgIGlmKHBJbnN0YW5jZS0+QWxwaGEgPT0gMCl7CisgICAgICAgICAgICBwSW5zdGFuY2UtPkN1cnJlbnQgPSBwSW5zdGFuY2UtPlRhcmdldDsKKyAgICAgICAgfWVsc2UgaWYgKChwSW5zdGFuY2UtPkN1cnJlbnQtcEluc3RhbmNlLT5UYXJnZXQgPCBQT0lOVF9aRVJPX09ORV9EQl9GTE9BVCkgJiYKKyAgICAgICAgICAgICAgICAgKHBJbnN0YW5jZS0+Q3VycmVudC1wSW5zdGFuY2UtPlRhcmdldCA+IC1QT0lOVF9aRVJPX09ORV9EQl9GTE9BVCkpeworICAgICAgICAgICAgcEluc3RhbmNlLT5DdXJyZW50ID0gcEluc3RhbmNlLT5UYXJnZXQ7IC8qIERpZmZlcmVuY2UgaXMgbm90IHNpZ25pZmljYW50IGFueW1vcmUuIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNYWtlIHRoZW0gZXF1YWwuICovCisgICAgICAgIH1lbHNleworICAgICAgICAgICAgLyogU29mdCBtaXhpbmcgaGFzIHRvIGJlIGFwcGxpZWQgKi8KKyAgICAgICAgICAgIEhhcmRNaXhpbmcgPSBGQUxTRTsKKyAgICAgICAgICAgIENvcmVfTWl4SW5Tb2Z0X0QzMkMzMV9TQVQocEluc3RhbmNlLCBzcmMsIGRzdCwgbik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgSEFSRCBNSVhJTkcKKyAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisgICAgaWYgKEhhcmRNaXhpbmcpeworICAgICAgICBpZiAocEluc3RhbmNlLT5UYXJnZXQgIT0gMCl7IC8qIE5vdGhpbmcgdG8gZG8gaW4gY2FzZSBUYXJnZXQgPSAwICovCisgICAgICAgICAgICBpZiAoKHBJbnN0YW5jZS0+VGFyZ2V0KSA9PSAxLjBmKQorICAgICAgICAgICAgICAgIEFkZDJfU2F0X0Zsb2F0KHNyYywgZHN0LCBuKTsKKyAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgQ29yZV9NaXhJblNvZnRfRDMyQzMxX1NBVChwSW5zdGFuY2UsIHNyYywgZHN0LCBuKTsKKyAgICAgICAgICAgICAgICBwSW5zdGFuY2UtPkN1cnJlbnQgPSBwSW5zdGFuY2UtPlRhcmdldDsgLyogSW4gY2FzZSB0aGUgY29yZSBmdW5jdGlvbiB3b3VsZCBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhdmUgY2hhbmdlZCB0aGUgQ3VycmVudCB2YWx1ZSAqLworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgIENBTEwgQkFDSworICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgLyogQ2FsbCBiYWNrIGJlZm9yZSB0aGUgaGFyZCBtaXhpbmcsIGJlY2F1c2UgaW4gdGhpcyBjYXNlLCBoYXJkIG1peGluZyBtYWtlcworICAgICAgIHVzZSBvZiB0aGUgY29yZSBzb2Z0IG1peCBmdW5jdGlvbiB3aGljaCBjYW4gY2hhbmdlIHRoZSBDdXJyZW50IHZhbHVlISAgICAgICovCisKKyAgICBpZiAocEluc3RhbmNlLT5DYWxsYmFja1NldCl7CisgICAgICAgIGlmICgocEluc3RhbmNlLT5DdXJyZW50IC0gcEluc3RhbmNlLT5UYXJnZXQgPCBQT0lOVF9aRVJPX09ORV9EQl9GTE9BVCkgJiYKKyAgICAgICAgICAgIChwSW5zdGFuY2UtPkN1cnJlbnQgLSBwSW5zdGFuY2UtPlRhcmdldCA+IC1QT0lOVF9aRVJPX09ORV9EQl9GTE9BVCkpeworICAgICAgICAgICAgcEluc3RhbmNlLT5DdXJyZW50ID0gcEluc3RhbmNlLT5UYXJnZXQ7IC8qIERpZmZlcmVuY2UgaXMgbm90IHNpZ25pZmljYW50IGFueW1vcmUuIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNYWtlIHRoZW0gZXF1YWwuICovCisgICAgICAgICAgICBwSW5zdGFuY2UtPkNhbGxiYWNrU2V0ID0gRkFMU0U7CisgICAgICAgICAgICBpZiAocEluc3RhbmNlLT5wQ2FsbEJhY2sgIT0gMCl7CisgICAgICAgICAgICAgICAgKCpwSW5zdGFuY2UtPnBDYWxsQmFjaykgKCBwSW5zdGFuY2UtPnBDYWxsYmFja0hhbmRsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJbnN0YW5jZS0+cEdlbmVyYWxQdXJwb3NlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEluc3RhbmNlLT5DYWxsYmFja1BhcmFtICk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9Cit9CisjZWxzZQogdm9pZCBNaXhJblNvZnRfRDMyQzMxX1NBVCggTWl4XzFTdF9DbGxfdCAgICAgICAgKnBJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQzMiAgICAgICpzcmMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgICAqZHN0LApAQCAtOTEsNSArMTU1LDUgQEAKICAgICAgICAgfQogICAgIH0KIH0KLQorI2VuZGlmCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL01peFNvZnRfMVN0X0QzMkMzMV9XUkEuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL01peFNvZnRfMVN0X0QzMkMzMV9XUkEuYwppbmRleCBjYTg4YjA0Li44NjkyOTNiIDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9NaXhTb2Z0XzFTdF9EMzJDMzFfV1JBLmMKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTWl4U29mdF8xU3RfRDMyQzMxX1dSQS5jCkBAIC0zNCw3ICszNCw2OCBAQAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICAgIEZVTkNUSU9OIE1JWFNPRlRfMVNUX0QzMkMzMV9XUkEKICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIE1peFNvZnRfMVN0X0QzMkMzMV9XUkEoICAgIE1peF8xU3RfQ2xsX0ZMT0FUX3QgICAgICAgKnBJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICAgICAqc3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICpkc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgbikKK3sKKyAgICBjaGFyIEhhcmRNaXhpbmcgPSBUUlVFOwogCisgICAgaWYobiA8PSAwKSAgICByZXR1cm47CisKKyAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgU09GVCBNSVhJTkcKKyAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworICAgIGlmIChwSW5zdGFuY2UtPkN1cnJlbnQgIT0gcEluc3RhbmNlLT5UYXJnZXQpCisgICAgeworICAgICAgICBpZihwSW5zdGFuY2UtPkFscGhhID09IDApeworICAgICAgICAgICAgcEluc3RhbmNlLT5DdXJyZW50ID0gcEluc3RhbmNlLT5UYXJnZXQ7CisgICAgICAgIH1lbHNlIGlmICgocEluc3RhbmNlLT5DdXJyZW50IC0gcEluc3RhbmNlLT5UYXJnZXQgPCBQT0lOVF9aRVJPX09ORV9EQl9GTE9BVCkgJiYKKyAgICAgICAgICAgICAgICAgKHBJbnN0YW5jZS0+Q3VycmVudCAtIHBJbnN0YW5jZS0+VGFyZ2V0ID4gLVBPSU5UX1pFUk9fT05FX0RCX0ZMT0FUKSl7CisgICAgICAgICAgICBwSW5zdGFuY2UtPkN1cnJlbnQgPSBwSW5zdGFuY2UtPlRhcmdldDsgLyogRGlmZmVyZW5jZSBpcyBub3Qgc2lnbmlmaWNhbnQgYW55bW9yZS4gXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1ha2UgdGhlbSBlcXVhbC4gKi8KKyAgICAgICAgfWVsc2V7CisgICAgICAgICAgICAvKiBTb2Z0IG1peGluZyBoYXMgdG8gYmUgYXBwbGllZCAqLworICAgICAgICAgICAgSGFyZE1peGluZyA9IEZBTFNFOworICAgICAgICAgICAgQ29yZV9NaXhTb2Z0XzFTdF9EMzJDMzFfV1JBKHBJbnN0YW5jZSwgc3JjLCBkc3QsIG4pOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgIEhBUkQgTUlYSU5HCisgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworICAgIGlmIChIYXJkTWl4aW5nKXsKKyAgICAgICAgaWYgKHBJbnN0YW5jZS0+VGFyZ2V0ID09IDApCisgICAgICAgICAgICBMb2FkQ29uc3RfRmxvYXQoMCwgZHN0LCBuKTsKKyAgICAgICAgZWxzZSBpZiAoKHBJbnN0YW5jZS0+VGFyZ2V0KSA9PSAxLjBmKXsKKyAgICAgICAgICAgIGlmIChzcmMgIT0gZHN0KQorICAgICAgICAgICAgICAgIENvcHlfRmxvYXQoKExWTV9GTE9BVCopc3JjLCAoTFZNX0ZMT0FUKilkc3QsIChMVk1fSU5UMTYpKG4pKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgICBNdWx0M3NfRmxvYXQoc3JjLCBwSW5zdGFuY2UtPkN1cnJlbnQsIGRzdCwgbik7CisgICAgfQorCisgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgIENBTEwgQkFDSworICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyAgICBpZiAocEluc3RhbmNlLT5DYWxsYmFja1NldCl7CisgICAgICAgIGlmICgocEluc3RhbmNlLT5DdXJyZW50IC0gcEluc3RhbmNlLT5UYXJnZXQgPCBQT0lOVF9aRVJPX09ORV9EQl9GTE9BVCkgJiYKKyAgICAgICAgICAgIChwSW5zdGFuY2UtPkN1cnJlbnQgLSBwSW5zdGFuY2UtPlRhcmdldCA+IC1QT0lOVF9aRVJPX09ORV9EQl9GTE9BVCkpeworICAgICAgICAgICAgcEluc3RhbmNlLT5DdXJyZW50ID0gcEluc3RhbmNlLT5UYXJnZXQ7IC8qIERpZmZlcmVuY2UgaXMgbm90IHNpZ25pZmljYW50IGFueW1vcmUuIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNYWtlIHRoZW0gZXF1YWwuICovCisgICAgICAgICAgICBwSW5zdGFuY2UtPkNhbGxiYWNrU2V0ID0gRkFMU0U7CisgICAgICAgICAgICBpZiAocEluc3RhbmNlLT5wQ2FsbEJhY2sgIT0gMCl7CisgICAgICAgICAgICAgICAgKCpwSW5zdGFuY2UtPnBDYWxsQmFjaykgKCBwSW5zdGFuY2UtPnBDYWxsYmFja0hhbmRsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJbnN0YW5jZS0+cEdlbmVyYWxQdXJwb3NlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEluc3RhbmNlLT5DYWxsYmFja1BhcmFtICk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9Cit9CisjZWxzZQogdm9pZCBNaXhTb2Z0XzFTdF9EMzJDMzFfV1JBKCAgICBNaXhfMVN0X0NsbF90ICAgICAgICpwSW5zdGFuY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQzMiAgICAgKnNyYywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAqZHN0LApAQCAtOTEsNSArMTUyLDUgQEAKICAgICAgICAgfQogICAgIH0KIH0KLQorI2VuZGlmCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL01peFNvZnRfMlN0X0QzMkMzMV9TQVQuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL01peFNvZnRfMlN0X0QzMkMzMV9TQVQuYwppbmRleCAyZTBhMDk5Li42ZmMxYjkyIDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9NaXhTb2Z0XzJTdF9EMzJDMzFfU0FULmMKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTWl4U29mdF8yU3RfRDMyQzMxX1NBVC5jCkBAIC0yNiw3ICsyNiw0NCBAQAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICAgIEZVTkNUSU9OIE1JWFNPRlRfMlNUX0QzMkMzMV9TQVQKICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIE1peFNvZnRfMlN0X0QzMkMzMV9TQVQoICAgIE1peF8yU3RfQ2xsX0ZMT0FUX3QgICAgICAgKnBJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICAgICAqc3JjMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICAgICAqc3JjMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAqZHN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgIG4pCit7CiAKKyAgICBpZihuIDw9IDApICAgIHJldHVybjsKKworICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICBTT0ZUIE1JWElORworICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgaWYgKChwSW5zdGFuY2UtPkN1cnJlbnQxICE9IHBJbnN0YW5jZS0+VGFyZ2V0MSkgfHwgKHBJbnN0YW5jZS0+Q3VycmVudDIgIT0gcEluc3RhbmNlLT5UYXJnZXQyKSkKKyAgICB7CisgICAgICAgIE1peFNvZnRfMVN0X0QzMkMzMV9XUkEoKE1peF8xU3RfQ2xsX0ZMT0FUX3QqKXBJbnN0YW5jZSwgc3JjMSwgZHN0LCBuKTsKKyAgICAgICAgTWl4SW5Tb2Z0X0QzMkMzMV9TQVQoKHZvaWQgKikmcEluc3RhbmNlLT5BbHBoYTIsIC8qIENhc3QgdG8gdm9pZDogXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBubyBkZXJlZmVyZW5jaW5nIGluIGZ1bmN0aW9uKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNyYzIsIGRzdCwgbik7CisgICAgfQorCisgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgIEhBUkQgTUlYSU5HCisgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworICAgIGVsc2UKKyAgICB7CisgICAgICAgIGlmIChwSW5zdGFuY2UtPkN1cnJlbnQxID09IDApCisgICAgICAgICAgICBNaXhTb2Z0XzFTdF9EMzJDMzFfV1JBKCh2b2lkICopICZwSW5zdGFuY2UtPkFscGhhMiwgLyogQ2FzdCB0byB2b2lkOiBubyBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVyZWZlcmVuY2luZyBpbiBmdW5jdGlvbiovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcmMyLCBkc3QsIG4pOworICAgICAgICBlbHNlIGlmIChwSW5zdGFuY2UtPkN1cnJlbnQyID09IDApCisgICAgICAgICAgICBNaXhTb2Z0XzFTdF9EMzJDMzFfV1JBKChNaXhfMVN0X0NsbF9GTE9BVF90KikgcEluc3RhbmNlLCBzcmMxLCBkc3QsIG4pOworICAgICAgICBlbHNlCisgICAgICAgICAgICBDb3JlX01peEhhcmRfMlN0X0QzMkMzMV9TQVQocEluc3RhbmNlLCBzcmMxLCBzcmMyLCBkc3QsIG4pOworICAgIH0KK30KKyNlbHNlCiB2b2lkIE1peFNvZnRfMlN0X0QzMkMzMV9TQVQoICAgIE1peF8yU3RfQ2xsX3QgICAgICAgKnBJbnN0YW5jZSwKICAgICA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gc2lnbmFsID0gKDEwXigwLjAxLzIwKSAtMSkgKiAyXjMxICovCisjZW5kaWYKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgICBERUZJTklUSU9OUwogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9Nb25vVG8ySV8zMi5jIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTW9ub1RvMklfMzIuYwppbmRleCBjMDllYzBmLi43OTZhMTVjIDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9Nb25vVG8ySV8zMi5jCisrKyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL01vbm9UbzJJXzMyLmMKQEAgLTQ1LDUgKzQ1LDI2IEBACiAKICAgICByZXR1cm47CiB9CisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgTW9ub1RvMklfRmxvYXQoIGNvbnN0IExWTV9GTE9BVCAgKnNyYywKKyAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgKmRzdCwKKyAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBuKQoreworICAgIExWTV9JTlQxNiBpaTsKKyAgICBzcmMgKz0gKG4gLSAxKTsKKyAgICBkc3QgKz0gKChuICogMikgLSAxKTsKIAorICAgIGZvciAoaWkgPSBuOyBpaSAhPSAwOyBpaS0tKQorICAgIHsKKyAgICAgICAgKmRzdCA9ICpzcmM7CisgICAgICAgIGRzdC0tOworCisgICAgICAgICpkc3QgPSAqc3JjOworICAgICAgICBkc3QtLTsKKyAgICAgICAgc3JjLS07CisgICAgfQorCisgICAgcmV0dXJuOworfQorI2VuZGlmCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL011bHQzc18zMngxNi5jIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTXVsdDNzXzMyeDE2LmMKaW5kZXggYTVkYzUwZi4uYzc1ODU2MCAxMDA2NDQKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTXVsdDNzXzMyeDE2LmMKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTXVsdDNzXzMyeDE2LmMKQEAgLTQ3LDUgKzQ3LDIzIEBACiAKICAgICByZXR1cm47CiB9CisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgTXVsdDNzX0Zsb2F0KCBjb25zdCBMVk1fRkxPQVQgKnNyYywKKyAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fRkxPQVQgdmFsLAorICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAqZHN0LAorICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBuKQoreworICAgIExWTV9JTlQxNiBpaTsKKyAgICBMVk1fRkxPQVQgdGVtcDsKIAorICAgIGZvciAoaWkgPSBuOyBpaSAhPSAwOyBpaS0tKQorICAgIHsKKyAgICAgICAgdGVtcCA9ICgqc3JjKSAqIHZhbDsKKyAgICAgICAgc3JjKys7CisgICAgICAgICpkc3QgPSB0ZW1wOworICAgICAgICBkc3QrKzsKKyAgICB9CisgICAgcmV0dXJuOworfQorI2VuZGlmCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL05vbkxpbkNvbXBfRDE2LmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9Ob25MaW5Db21wX0QxNi5jCmluZGV4IDczMzQzY2QuLjUxNTZlZGMgMTAwNjQ0Ci0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL05vbkxpbkNvbXBfRDE2LmMKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTm9uTGluQ29tcF9EMTYuYwpAQCAtMTE0LDQgKzExNCw1NCBAQAogICAgIH0KIAogfQorI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIE5vbkxpbkNvbXBfRmxvYXQoTFZNX0ZMT0FUICAgICAgICBHYWluLAorICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgKnBEYXRhSW4sCisgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAqcERhdGFPdXQsCisgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAgICBCbG9ja0xlbmd0aCkKK3sKIAorICAgIExWTV9GTE9BVCAgICAgICAgICAgIFNhbXBsZTsgICAgICAgICAgICAgICAgICAgIC8qIElucHV0IHNhbXBsZXMgKi8KKyAgICBMVk1fSU5UMzIgICAgICAgICAgICBTYW1wbGVObzsgICAgICAgICAgICAgICAgLyogU2FtcGxlIGluZGV4ICovCisgICAgTFZNX0ZMT0FUICAgICAgICAgICAgVGVtcDsKKworCisgICAgLyoKKyAgICAgKiBQcm9jZXNzIGEgYmxvY2sgb2Ygc2FtcGxlcworICAgICAqLworICAgIGZvcihTYW1wbGVObyA9IDA7IFNhbXBsZU5vIDwgQmxvY2tMZW5ndGg7IFNhbXBsZU5vKyspCisgICAgeworICAgICAgICAvKgorICAgICAgICAgKiBSZWFkIHRoZSBpbnB1dAorICAgICAgICAgKi8KKyAgICAgICAgU2FtcGxlID0gKnBEYXRhSW47CisgICAgICAgIHBEYXRhSW4rKzsKKworCisgICAgICAgIC8qCisgICAgICAgICAqIEFwcGx5IHRoZSBjb21wYW5kZXIsIHRoaXMgY29tcHJlc3NlcyB0aGUgc2lnbmFsIGF0IHRoZSBleHBlbnNlIG9mCisgICAgICAgICAqIGhhcm1vbmljIGRpc3RvcnRpb24uIFRoZSBhbW91bnQgb2YgY29tcHJlc3Npb24gaXMgY29udHJvbCBieSB0aGUKKyAgICAgICAgICogZ2FpbiBmYWN0b3IKKyAgICAgICAgICovCisgICAgICAgIGlmIChTYW1wbGUgIT0gLTEuMGYpCisgICAgICAgIHsKKyAgICAgICAgICAgIFRlbXAgPSAoKFNhbXBsZSAqIFNhbXBsZSkpOworICAgICAgICAgICAgaWYoU2FtcGxlID4gMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBTYW1wbGUgPSAoU2FtcGxlICsgKChHYWluICogKFNhbXBsZSAtIFRlbXApKSApKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBTYW1wbGUgPSAoU2FtcGxlICsgKChHYWluICogKFNhbXBsZSArIFRlbXApKSApKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisKKyAgICAgICAgLyoKKyAgICAgICAgICogU2F2ZSB0aGUgb3V0cHV0CisgICAgICAgICAqLworICAgICAgICAqcERhdGFPdXQgPSBTYW1wbGU7CisgICAgICAgIHBEYXRhT3V0Kys7CisgICAgfQorfQorI2VuZGlmCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9QS18ySV9EMzJGMzJDMTRHMTFfVFJDX1dSQV8wMS5jIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvUEtfMklfRDMyRjMyQzE0RzExX1RSQ19XUkFfMDEuYwppbmRleCBjOGMxNTI3Li45YzE3YTA1IDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9QS18ySV9EMzJGMzJDMTRHMTFfVFJDX1dSQV8wMS5jCisrKyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL1BLXzJJX0QzMkYzMkMxNEcxMV9UUkNfV1JBXzAxLmMKQEAgLTM4LDYgKzM4LDg4IEBACiAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzZdIGlzIHkobi0yKUwgaW4gUTAgZm9ybWF0CiAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzddIGlzIHkobi0yKVIgaW4gUTAgZm9ybWF0CiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgUEtfMklfRDMyRjMyQzE0RzExX1RSQ19XUkFfMDEgKCBCaXF1YWRfRkxPQVRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICpwRGF0YUluLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICpwRGF0YU91dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBOclNhbXBsZXMpCisgICAgeworICAgICAgICBMVk1fRkxPQVQgeW5MLHluUix5bkxPLHluUk8sdGVtcGw7CisgICAgICAgIExWTV9JTlQxNiBpaTsKKyAgICAgICAgUEZpbHRlcl9TdGF0ZV9GbG9hdCBwQmlxdWFkU3RhdGUgPSAoUEZpbHRlcl9TdGF0ZV9GbG9hdCkgcEluc3RhbmNlOworCisgICAgICAgICBmb3IgKGlpID0gTnJTYW1wbGVzOyBpaSAhPSAwOyBpaS0tKQorICAgICAgICAgeworCisKKyAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBST0NFU1NJTkcgT0YgVEhFIExFRlQgQ0hBTk5FTAorICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworICAgICAgICAgICAgLyogeW5MPSAoQTAgICogKHgobilMIC0geChuLTIpTCAgKSApKi8KKyAgICAgICAgICAgIHRlbXBsID0gKCpwRGF0YUluKSAtIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXTsKKyAgICAgICAgICAgIHluTCA9IHRlbXBsICogcEJpcXVhZFN0YXRlLT5jb2Vmc1swXTsKKworICAgICAgICAgICAgLyogeW5MKz0gKCgtQjIgICogeShuLTIpTCAgKSkgKi8KKyAgICAgICAgICAgIHRlbXBsID0gcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzZdICogcEJpcXVhZFN0YXRlLT5jb2Vmc1sxXTsKKyAgICAgICAgICAgIHluTCArPSB0ZW1wbDsKKworICAgICAgICAgICAgLyogeW5MKz0gKCgtQjEgKiB5KG4tMSlMICApICkgKi8KKyAgICAgICAgICAgIHRlbXBsID0gcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzRdICogcEJpcXVhZFN0YXRlLT5jb2Vmc1syXTsKKyAgICAgICAgICAgIHluTCArPSB0ZW1wbDsKKworICAgICAgICAgICAgLyogeW5MTz0gKChHYWluICogeW5MICkpICovCisgICAgICAgICAgICB5bkxPID0geW5MICogcEJpcXVhZFN0YXRlLT5jb2Vmc1szXTsKKworICAgICAgICAgICAgLyogeW5MTz0oIHluTE8gKyB4KG4pTCAgKSovCisgICAgICAgICAgICB5bkxPICs9ICgqcERhdGFJbik7CisKKyAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBST0NFU1NJTkcgT0YgVEhFIFJJR0hUIENIQU5ORUwKKyAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyAgICAgICAgICAgIC8qIHluUj0gKEEwICAqICh4KG4pUiAgLSB4KG4tMilSICApICkgKi8KKyAgICAgICAgICAgIHRlbXBsID0gKCoocERhdGFJbiArIDEpKSAtIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1szXTsKKyAgICAgICAgICAgIHluUiA9IHRlbXBsICogcEJpcXVhZFN0YXRlLT5jb2Vmc1swXTsKKworICAgICAgICAgICAgLyogeW5SKz0gKCgtQjIgICogeShuLTIpUiAgKSApICAqLworICAgICAgICAgICAgdGVtcGwgPSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbN10gKiBwQmlxdWFkU3RhdGUtPmNvZWZzWzFdOworICAgICAgICAgICAgeW5SICs9IHRlbXBsOworCisgICAgICAgICAgICAvKiB5blIrPSAoKC1CMSAgKiB5KG4tMSlSICApICkgICAqLworICAgICAgICAgICAgdGVtcGwgPSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNV0gKiBwQmlxdWFkU3RhdGUtPmNvZWZzWzJdOworICAgICAgICAgICAgeW5SICs9IHRlbXBsOworCisgICAgICAgICAgICAvKiB5blJPPSAoKEdhaW4gICogeW5SICkpICovCisgICAgICAgICAgICB5blJPID0geW5SICogcEJpcXVhZFN0YXRlLT5jb2Vmc1szXTsKKworICAgICAgICAgICAgLyogeW5STz0oIHluUk8gKyB4KG4pUiAgKSovCisgICAgICAgICAgICB5blJPICs9ICgqKHBEYXRhSW4rMSkpOworCisgICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBVUERBVElORyBUSEUgREVMQVlTCisgICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbN10gPSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNV07IC8qIHkobi0yKVI9eShuLTEpUiovCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNl0gPSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNF07IC8qIHkobi0yKUw9eShuLTEpTCovCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbM10gPSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMV07IC8qIHgobi0yKVI9eChuLTEpUiovCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMl0gPSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMF07IC8qIHgobi0yKUw9eChuLTEpTCovCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNV0gPSB5blI7IC8qIFVwZGF0ZSB5KG4tMSlSICovCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNF0gPSB5bkw7IC8qIFVwZGF0ZSB5KG4tMSlMICovCisgICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMF0gPSAoKnBEYXRhSW4pOyAvKiBVcGRhdGUgeChuLTEpTCAqLworICAgICAgICAgICAgcERhdGFJbisrOworICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzFdID0gKCpwRGF0YUluKTsgLyogVXBkYXRlIHgobi0xKVIgKi8KKyAgICAgICAgICAgIHBEYXRhSW4rKzsKKworICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgV1JJVElORyBUSEUgT1VUUFVUCisgICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgICAgICAgICAqcERhdGFPdXQgPSB5bkxPOyAvKiBXcml0ZSBMZWZ0IG91dHB1dCovCisgICAgICAgICAgICBwRGF0YU91dCsrOworICAgICAgICAgICAgKnBEYXRhT3V0ID0geW5STzsgLyogV3JpdGUgUmlnaHQgb3VwdXQqLworICAgICAgICAgICAgcERhdGFPdXQrKzsKKworICAgICAgICB9CisKKyAgICB9CisjZWxzZQogdm9pZCBQS18ySV9EMzJGMzJDMTRHMTFfVFJDX1dSQV8wMSAoIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAgICAgICAgICAgKnBEYXRhSW4sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAgICAgICAgICAgKnBEYXRhT3V0LApAQCAtMTE4LDQgKzIwMCw0IEBACiAgICAgICAgIH0KIAogICAgIH0KLQorI2VuZGlmCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9QS18ySV9EMzJGMzJDMzBHMTFfVFJDX1dSQV8wMS5jIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvUEtfMklfRDMyRjMyQzMwRzExX1RSQ19XUkFfMDEuYwppbmRleCA2N2E1NzBiLi5mNzA1Y2JmIDEwMDY0NA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DVElPTiBTaGlmdF9TYXRfdjE2eHYxNgogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KKyNpZm5kZWYgQlVJTERfRkxPQVQKIHZvaWQgU2hpZnRfU2F0X3YxNnh2MTYgKGNvbnN0ICAgTFZNX0lOVDE2ICAgdmFsLAogICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgICBMVk1fSU5UMTYgICAqc3JjLAogICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgKmRzdCwKQEAgLTc3LDUgKzc3LDUgQEAKICAgICB9CiAgICAgcmV0dXJuOwogfQotCisjZW5kaWYKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvU2hpZnRfU2F0X3YzMnh2MzIuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL1NoaWZ0X1NhdF92MzJ4djMyLmMKaW5kZXggZmJkMTMyZS4uZmFjOWRlNyAxMDA2NDQKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvU2hpZnRfU2F0X3YzMnh2MzIuYworKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9TaGlmdF9TYXRfdjMyeHYzMi5jCkBAIC0yNCw3ICsyNCw2MiBAQAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICAgIEZVTkNUSU9OIFNoaWZ0X1NhdF92MzJ4djMyCiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCBTaGlmdF9TYXRfRmxvYXQgKGNvbnN0ICAgTFZNX0lOVDE2ICAgdmFsLAorICAgICAgICAgICAgICAgICAgICAgIGNvbnN0ICAgTFZNX0ZMT0FUICAgKnNyYywKKyAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAqZHN0LAorICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgIG4pCit7CisgICAgTFZNX0ZMT0FUICAgdGVtcDsKKyAgICBMVk1fSU5UMzIgICBpaSxpajsKKyAgICBMVk1fSU5UMTYgICBSU2hpZnQ7CiAKKyAgICBpZih2YWwgPiAwKQorICAgIHsKKyAgICAgICAgZm9yIChpaSA9IG47IGlpICE9IDA7IGlpLS0pCisgICAgICAgIHsKKyAgICAgICAgICAgIHRlbXAgPSAoTFZNX0ZMT0FUKSpzcmM7CisgICAgICAgICAgICBzcmMrKzsKKyAgICAgICAgICAgIGZvcihpaiA9IDA7IGlqIDwgdmFsOyBpaisrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHRlbXAgPSB0ZW1wICogMjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYodGVtcCA+IDEuMCkKKyAgICAgICAgICAgICAgICB0ZW1wID0gMS4wOworICAgICAgICAgICAgaWYodGVtcCA8IC0xLjApCisgICAgICAgICAgICAgICAgdGVtcCA9IC0xLjA7CisKKyAgICAgICAgICAgICpkc3QgPSAoTFZNX0ZMT0FUKXRlbXA7CisgICAgICAgICAgICBkc3QrKzsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlIGlmKHZhbCA8IDApCisgICAgeworICAgICAgICBSU2hpZnQ9KExWTV9JTlQxNikoLXZhbCk7CisKKyAgICAgICAgZm9yIChpaSA9IG47IGlpICE9IDA7IGlpLS0pCisgICAgICAgIHsKKyAgICAgICAgICAgIHRlbXAgPSAoTFZNX0ZMT0FUKSpzcmM7CisgICAgICAgICAgICBzcmMrKzsKKyAgICAgICAgICAgIGZvcihpaiA9IDA7IGlqIDwgUlNoaWZ0OyBpaisrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHRlbXAgPSB0ZW1wIC8gMjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgICpkc3QgPSAoTFZNX0ZMT0FUKXRlbXA7CisgICAgICAgICAgICBkc3QrKzsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBpZihzcmMgIT0gZHN0KQorICAgICAgICB7CisgICAgICAgICAgICBDb3B5X0Zsb2F0KHNyYywgZHN0LCBuKTsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm47Cit9CisjZWxzZQogdm9pZCBTaGlmdF9TYXRfdjMyeHYzMiAoY29uc3QgICBMVk1fSU5UMTYgICB2YWwsCiAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCAgIExWTV9JTlQzMiAgICpzcmMsCiAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAqZHN0LApAQCAtNzksNSArMTM0LDUgQEAKICAgICB9CiAgICAgcmV0dXJuOwogfQotCisjZW5kaWYKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvZEJfdG9fTGluMzIuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL2RCX3RvX0xpbjMyLmMKaW5kZXggYWMwMzQzZi4uOWE3MjZmMiAxMDA2NDQKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvZEJfdG9fTGluMzIuYworKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW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ACiB7CiAgICAgLyogR2VuZXJhbCBwYXJhbWV0ZXJzICovCiAgICAgTFZNX1VJTlQxNiAgICAgICAgICAgICAgICAgIFNhbXBsZVJhdGU7CisKICAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICAgICAgU291cmNlRm9ybWF0OwogICAgIExWTV9VSU5UMTYgICAgICAgICAgICAgICAgICBNYXhCbG9ja1NpemU7CiAgICAgTFZNX1VJTlQxNiAgICAgICAgICAgICAgICAgIE1heEJhbmRzOwpAQCAtNDYwLDExICs0NjksMTcgQEAKIC8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQorI2lmZGVmIEJVSUxEX0ZMT0FUCitMVkVRTkJfUmV0dXJuU3RhdHVzX2VuIExWRVFOQl9Qcm9jZXNzKExWRVFOQl9IYW5kbGVfdCAgICAgICBoSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9GTE9BVCAgICAgICAqcEluRGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICpwT3V0RGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiAgICAgICAgICAgIE51bVNhbXBsZXMpOworI2Vsc2UKIExWRVFOQl9SZXR1cm5TdGF0dXNfZW4gTFZFUU5CX1Byb2Nlc3MoTFZFUU5CX0hhbmRsZV90ICAgICAgIGhJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICAgICAgICpwSW5EYXRhLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgKnBPdXREYXRhLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgTnVtU2FtcGxlcyk7CisjZW5kaWYKIAogCiAKZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9FcS9zcmMvTFZFUU5CX0NhbGNDb2VmLmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvRXEvc3JjL0xWRVFOQl9DYWxjQ29lZi5jCmluZGV4IGZkZGVkYjkuLmZmNTJiN2YgMTAwNjQ0Ci0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9FcS9zcmMvTFZFUU5CX0NhbGNDb2VmLmMKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0VxL3NyYy9MVkVRTkJfQ2FsY0NvZWYuYwpAQCAtMjIsNyArMjIsOSBAQAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKICNpbmNsdWRlICJMVkVRTkJfUHJpdmF0ZS5oIgotCisjaWZkZWYgQlVJTERfRkxPQVQKKyNpbmNsdWRlIDxtYXRoLmg+CisjZW5kaWYKIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KQEAgLTc3LDYgKzc5LDcgQEAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAKKyNpZm5kZWYgQlVJTERfRkxPQVQKIExWRVFOQl9SZXR1cm5TdGF0dXNfZW4gTFZFUU5CX0RvdWJsZVByZWNDb2VmcyhMVk1fVUlOVDE2ICAgICAgICBGcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfQmFuZERlZl90ICAqcEZpbHRlckRlZmluaXRpb24sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUEtfQzMyX0NvZWZzX3QgICAgKnBDb2VmZmljaWVudHMpCkBAIC0xNjgsNyArMTcxLDcgQEAKICAgICByZXR1cm4oTFZFUU5CX1NVQ0NFU1MpOwogCiB9Ci0KKyNlbmRpZgogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwpAQCAtMjA1LDcgKzIwOCw2NyBAQAogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAorI2lmZGVmIEJVSUxEX0ZMT0FUCitMVkVRTkJfUmV0dXJuU3RhdHVzX2VuIExWRVFOQl9TaW5nbGVQcmVjQ29lZnMoTFZNX1VJTlQxNiAgICAgICAgRnMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX0JhbmREZWZfdCAgKnBGaWx0ZXJEZWZpbml0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBLX0ZMT0FUX0NvZWZzX3QgICpwQ29lZmZpY2llbnRzKQorewogCisgICAgZXh0ZXJuIExWTV9GTE9BVCAgICBMVkVRTkJfR2FpblRhYmxlW107CisgICAgZXh0ZXJuIExWTV9GTE9BVCAgICBMVkVRTkJfVHdvUGlPbkZzVGFibGVbXTsKKyAgICBleHRlcm4gTFZNX0ZMT0FUICAgIExWRVFOQl9EVGFibGVbXTsKKworCisgICAgLyoKKyAgICAgKiBHZXQgdGhlIGZpbHRlciBkZWZpbml0aW9uCisgICAgICovCisgICAgTFZNX0lOVDE2ICAgICAgICAgICBHYWluICAgICAgICA9IHBGaWx0ZXJEZWZpbml0aW9uLT5HYWluOworICAgIExWTV9VSU5UMTYgICAgICAgICAgRnJlcXVlbmN5ICAgPSBwRmlsdGVyRGVmaW5pdGlvbi0+RnJlcXVlbmN5OworICAgIC8qIEFzIG1lbnRpb25lZCBpbiBlZmZlY3RidW5kbGUuaCAqLworICAgIExWTV9GTE9BVCAgICAgICAgICAgUUZhY3RvciAgICAgPSAoTFZNX0ZMT0FUKXBGaWx0ZXJEZWZpbml0aW9uLT5RRmFjdG9yIC8gMTAwLjBmOworCisKKyAgICAvKgorICAgICAqIEludGVybWVkaWF0ZSB2YXJpYWJsZXMgYW5kIHRlbXBvcmFyeSB2YWx1ZXMKKyAgICAgKi8KKyAgICBMVk1fRkxPQVQgICAgICAgICAgIFQwOworICAgIExWTV9GTE9BVCAgICAgICAgICAgRDsKKyAgICBMVk1fRkxPQVQgICAgICAgICAgIEEwOworICAgIExWTV9GTE9BVCAgICAgICAgICAgQjE7CisgICAgTFZNX0ZMT0FUICAgICAgICAgICBCMjsKKworICAgIC8qCisgICAgICogQ2FsY3VsYXRpbmcgdGhlIGludGVybWVkaWF0ZSB2YWx1ZXMKKyAgICAgKi8KKyAgICBUMCA9IEZyZXF1ZW5jeSAqIExWRVFOQl9Ud29QaU9uRnNUYWJsZVtGc107ICAgICAgICAvKiBUMCA9IDIgKiBQaSAqIEZjIC8gRnMgKi8KKyAgICBpZiAoR2FpbiA+PSAwKQorICAgIHsKKyAgICAgICAgRCA9IExWRVFOQl9EVGFibGVbMTVdOyAgICAgICAgICAgICAgICAgICAgICAgICAvKiBEID0gMSAgICAgICAgICAgIGlmIEdhaW5kQiA+PSAwICovCisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIEQgPSBMVkVRTkJfRFRhYmxlW0dhaW4gKyAxNV07ICAgICAgICAgICAgICAgICAgICAvKiBEID0gMSAvICgxICsgRykgIGlmIEdhaW5kQiA8ICAwICovCisgICAgfQorCisgICAgLyoKKyAgICAgKiBDYWxjdWxhdGUgdGhlIEIyLEIxLEEwIGNvZWZmaWNpZW50cworICAgICAqLworICAgIEIyID0gLTAuNSAqICgyICogUUZhY3RvciAtIEQgKiBUMCkgLyAoMiAqIFFGYWN0b3IgKyBEICogVDApOworICAgIEIxID0gKDAuNSAtIEIyKSAqIGNvcyhUMCk7CisgICAgQTAgPSAoMC41ICsgQjIpIC8gMi4wOworCisgICAgLyoKKyAgICAgKiBXcml0ZSBjb2VmZiBpbnRvIHRoZSBkYXRhIHN0cnVjdHVyZQorICAgICAqLworICAgIC8qIGFsbCB0aGUgY29lZmZpY2llbnRzIGFyZSBtdWx0aXBsaWVkIHdpdGggMiB0byBtYWtlIHRoZW0gYWxpZ24gd2l0aCBmaXhlZCBwb2ludCB2YWx1ZXMqLworICAgIHBDb2VmZmljaWVudHMtPkEwID0gMiAqIEEwOworICAgIHBDb2VmZmljaWVudHMtPkIxID0gMiAqIEIxOworICAgIHBDb2VmZmljaWVudHMtPkIyID0gMiAqIEIyOworICAgIHBDb2VmZmljaWVudHMtPkcgID0gTFZFUU5CX0dhaW5UYWJsZVtHYWluICsgMTVdOworCisgICAgcmV0dXJuKExWRVFOQl9TVUNDRVNTKTsKK30KKyNlbHNlCiBMVkVRTkJfUmV0dXJuU3RhdHVzX2VuIExWRVFOQl9TaW5nbGVQcmVjQ29lZnMoTFZNX1VJTlQxNiAgICAgICAgRnMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX0JhbmREZWZfdCAgKnBGaWx0ZXJEZWZpbml0aW9uLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBLX0MxNl9Db2Vmc190ICAgICpwQ29lZmZpY2llbnRzKQpAQCAtMjk2LDMgKzM1OSw0IEBACiAgICAgcmV0dXJuKExWRVFOQl9TVUNDRVNTKTsKIAogfQorI2VuZGlmClwgTm8gbmV3bGluZSBhdCBlbmQgb2YgZmlsZQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0VxL3NyYy9MVkVRTkJfQ29lZmZzLmggYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvRXEvc3JjL0xWRVFOQl9Db2VmZnMuaAppbmRleCA5NTIxMmYyLi5mMGRlYjZjIDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvRXEvc3JjL0xWRVFOQl9Db2VmZnMuaAorKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvRXEvc3JjL0xWRVFOQl9Db2VmZnMuaApAQCAtMjUsNyArMjUsMzkgQEAKIC8qIEdhaW4gdGFibGUgZm9yICgxMF4oR2Fpbi8yMCkgLSAxKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQorI2lmZGVmIEJVSUxEX0ZMT0FUCisjZGVmaW5lIExWRVFOQl9HYWluX05lZzE1X2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC44MjIxNzJmCisjZGVmaW5lIExWRVFOQl9HYWluX05lZzE0X2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC44MDA0NzRmCisjZGVmaW5lIExWRVFOQl9HYWluX05lZzEzX2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC43NzYxMjhmCisjZGVmaW5lIExWRVFOQl9HYWluX05lZzEyX2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC43NDg4MTFmCisjZGVmaW5lIExWRVFOQl9HYWluX05lZzExX2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC43MTgxNjJmCisjZGVmaW5lIExWRVFOQl9HYWluX05lZzEwX2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC42ODM3NzJmCisjZGVmaW5lIExWRVFOQl9HYWluX05lZzlfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC42NDUxODdmCisjZGVmaW5lIExWRVFOQl9HYWluX05lZzhfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC42MDE4OTNmCisjZGVmaW5lIExWRVFOQl9HYWluX05lZzdfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC41NTMzMTZmCisjZGVmaW5lIExWRVFOQl9HYWluX05lZzZfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC40OTg4MTNmCisjZGVmaW5lIExWRVFOQl9HYWluX05lZzVfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC40Mzc2NTlmCisjZGVmaW5lIExWRVFOQl9HYWluX05lZzRfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4zNjkwNDNmCisjZGVmaW5lIExWRVFOQl9HYWluX05lZzNfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4yOTIwNTRmCisjZGVmaW5lIExWRVFOQl9HYWluX05lZzJfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4yMDU2NzJmCisjZGVmaW5lIExWRVFOQl9HYWluX05lZzFfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4xMDg3NDlmCisjZGVmaW5lIExWRVFOQl9HYWluXzBfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDBmCisjZGVmaW5lIExWRVFOQl9HYWluXzFfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4xMjIwMThmCisjZGVmaW5lIExWRVFOQl9HYWluXzJfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4yNTg5MjVmCisjZGVmaW5lIExWRVFOQl9HYWluXzNfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC40MTI1MzhmCisjZGVmaW5lIExWRVFOQl9HYWluXzRfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC41ODQ4OTNmCisjZGVmaW5lIExWRVFOQl9HYWluXzVfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC43NzgyNzlmCisjZGVmaW5lIExWRVFOQl9HYWluXzZfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC45OTUyNjJmCisjZGVmaW5lIExWRVFOQl9HYWluXzdfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMS4yMzg3MjFmCisjZGVmaW5lIExWRVFOQl9HYWluXzhfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMS41MTE4ODZmCisjZGVmaW5lIExWRVFOQl9HYWluXzlfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMS44MTgzODNmCisjZGVmaW5lIExWRVFOQl9HYWluXzEwX2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMi4xNjIyNzhmCisjZGVmaW5lIExWRVFOQl9HYWluXzExX2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMi41NDgxMzRmCisjZGVmaW5lIExWRVFOQl9HYWluXzEyX2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMi45ODEwNzJmCisjZGVmaW5lIExWRVFOQl9HYWluXzEzX2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMy40NjY4MzZmCisjZGVmaW5lIExWRVFOQl9HYWluXzE0X2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNC4wMTE4NzJmCisjZGVmaW5lIExWRVFOQl9HYWluXzE1X2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNC42MjM0MTNmCisjZWxzZQogI2RlZmluZSBMVkVRTkJfR0FJTlNISUZUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMSAgICAgICAgIC8qIEFzIGEgcG93ZXIgb2YgMiAqLwogI2RlZmluZSBMVkVRTkJfR2Fpbl9OZWcxNV9kQiAgICAgICAgICAgICAgICAgICAgICAgICAgICgtMTY4NCkgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjgyMjE3MiAqLwogI2RlZmluZSBMVkVRTkJfR2Fpbl9OZWcxNF9kQiAgICAgICAgICAgICAgICAgICAgICAgICAgICgtMTYzOSkgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjgwMDQ3NCAqLwpAQCAtNTgsMTQgKzkwLDMwIEBACiAjZGVmaW5lIExWRVFOQl9HYWluXzEzX2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA3MTAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMy40NjY4MzYgKi8KICNkZWZpbmUgTFZFUU5CX0dhaW5fMTRfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDgyMTYgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSA0LjAxMTg3MiAqLwogI2RlZmluZSBMVkVRTkJfR2Fpbl8xNV9kQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOTQ2OSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDQuNjIzNDEzICovCi0KKyNlbmRpZgogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qIEZyZXF1ZW5jeSB0YWJsZSBmb3IgMipQaS9GcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZmRlZiBCVUlMRF9GTE9BVAorI2RlZmluZSBMVkVRTkJfMlBpT25fODAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDA3ODVmCisjZGVmaW5lIExWRVFOQl8yUGlPbl8xMTAyNSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDU3MGYKKyNkZWZpbmUgTFZFUU5CXzJQaU9uXzEyMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwNTI0ZgorI2RlZmluZSBMVkVRTkJfMlBpT25fMTYwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAzOTNmCisjZGVmaW5lIExWRVFOQl8yUGlPbl8yMjA1MCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDI4NWYKKyNkZWZpbmUgTFZFUU5CXzJQaU9uXzI0MDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMjYyZgorI2RlZmluZSBMVkVRTkJfMlBpT25fMzIwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAxOTZmCisjZGVmaW5lIExWRVFOQl8yUGlPbl80NDEwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDE0MmYKKyNkZWZpbmUgTFZFUU5CXzJQaU9uXzQ4MDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMTMxZgogCisjaWZkZWYgSElHSEVSX0ZTCisjZGVmaW5lIExWRVFOQl8yUGlPbl85NjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDA2NWYKKyNkZWZpbmUgTFZFUU5CXzJQaU9uXzE5MjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDMzZgorI2VuZGlmCisKKyNlbHNlCiAjZGVmaW5lIExWRVFOQl9GUkVRU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI1ICAgICAgICAgLyogQXMgYSBwb3dlciBvZiAyICovCiAjZGVmaW5lIExWRVFOQl8yUGlPbl84MDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI2MzU0ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDA3ODUgKi8KICNkZWZpbmUgTFZFUU5CXzJQaU9uXzExMDI1ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTkxMjMgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDU3MCAqLwpAQCAtNzYsMTQgKzEyNCwzMSBAQAogI2RlZmluZSBMVkVRTkJfMlBpT25fMzIwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNjU4OCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMTk2ICovCiAjZGVmaW5lIExWRVFOQl8yUGlPbl80NDEwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0NzgxICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAxNDIgKi8KICNkZWZpbmUgTFZFUU5CXzJQaU9uXzQ4MDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQzOTIgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDEzMSAqLwotCisjZW5kaWYKIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiA1MEQgdGFibGUgZm9yIDUwIC8gKCAxICsgR2FpbiApICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KKyNpZmRlZiBCVUlMRF9GTE9BVAorI2RlZmluZSBMVkVRTkJfMTAwRF9OZWcxNV9kQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNS42MjM0MTNmCisjZGVmaW5lIExWRVFOQl8xMDBEX05lZzE0X2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1LjAxMTg3MmYKKyNkZWZpbmUgTFZFUU5CXzEwMERfTmVnMTNfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQuNDY2ODM2ZgorI2RlZmluZSBMVkVRTkJfMTAwRF9OZWcxMl9kQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMy45ODEwNzJmCisjZGVmaW5lIExWRVFOQl8xMDBEX05lZzExX2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzLjU0ODEzNGYKKyNkZWZpbmUgTFZFUU5CXzEwMERfTmVnMTBfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMuMTYyMjc4ZgorI2RlZmluZSBMVkVRTkJfMTAwRF9OZWc5X2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMi44MTgzODNmCisjZGVmaW5lIExWRVFOQl8xMDBEX05lZzhfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyLjUxMTg4NmYKKyNkZWZpbmUgTFZFUU5CXzEwMERfTmVnN19kQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIuMjM4NzIxZgorI2RlZmluZSBMVkVRTkJfMTAwRF9OZWc2X2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMS45OTUyNjJmCisjZGVmaW5lIExWRVFOQl8xMDBEX05lZzVfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxLjc3ODI3OWYKKyNkZWZpbmUgTFZFUU5CXzEwMERfTmVnNF9kQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuNTg0ODkzZgorI2RlZmluZSBMVkVRTkJfMTAwRF9OZWczX2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMS40MTI1MzhmCisjZGVmaW5lIExWRVFOQl8xMDBEX05lZzJfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxLjI1ODkyNWYKKyNkZWZpbmUgTFZFUU5CXzEwMERfTmVnMV9kQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuMTIyMDE4ZgorI2RlZmluZSBMVkVRTkJfMTAwRF8wX2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMS4wMDAwMDBmCisjZWxzZQogI2RlZmluZSBMVkVRTkJfMTAwRFNISUZUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNSAgICAgICAgIC8qIEFzIGEgcG93ZXIgb2YgMiAqLwogI2RlZmluZSBMVkVRTkJfMTAwRF9OZWcxNV9kQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNzk5NSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDUuNjIzNDEzICovCiAjZGVmaW5lIExWRVFOQl8xMDBEX05lZzE0X2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE2MDM4ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgNS4wMTE4NzIgKi8KQEAgLTEwMSw2ICsxNjYsNiBAQAogI2RlZmluZSBMVkVRTkJfMTAwRF9OZWcyX2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDAyOSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDEuMjU4OTI1ICovCiAjZGVmaW5lIExWRVFOQl8xMDBEX05lZzFfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzNTkwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMS4xMjIwMTggKi8KICNkZWZpbmUgTFZFUU5CXzEwMERfMF9kQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMyMDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAxLjAwMDAwMCAqLwotCisjZW5kaWYKIAogI2VuZGlmCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvRXEvc3JjL0xWRVFOQl9Db250cm9sLmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvRXEvc3JjL0xWRVFOQl9Db250cm9sLmMKaW5kZXggMTBlN2Q3NC4uYzI5MGFlYyAxMDA2NDQKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0Vx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WZkZWYgQlVJTERfRkxPQVQKKyAgICAgICAgICAgIGNhc2UgICAgTFZFUU5CX1NpbmdsZVByZWNpc2lvbl9GbG9hdDoKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBQS19GTE9BVF9Db2Vmc190ICAgICAgQ29lZmZpY2llbnRzOworICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICogQ2FsY3VsYXRlIHRoZSBzaW5nbGUgcHJlY2lzaW9uIGNvZWZmaWNpZW50cworICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIExWRVFOQl9TaW5nbGVQcmVjQ29lZnMoKExWTV9VSU5UMTYpcEluc3RhbmNlLT5QYXJhbXMuU2FtcGxlUmF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwSW5zdGFuY2UtPnBCYW5kRGVmaW5pdGlvbnNbaV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmQ29lZmZpY2llbnRzKTsKKyAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAqIFNldCB0aGUgY29lZmZpY2llbnRzCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgUEtfMklfRDMyRjMyQ3NzR3NzX1RSQ19XUkFfMDFfSW5pdCgmcEluc3RhbmNlLT5wRVFOQl9GaWx0ZXJTdGF0ZV9GbG9hdFtpXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwSW5zdGFuY2UtPnBFUU5CX1RhcHNfRmxvYXRbaV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmQ29lZmZpY2llbnRzKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyNlbHNlCiAgICAgICAgICAgICBjYXNlICAgIExWRVFOQl9Eb3VibGVQcmVjaXNpb246CiAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgUEtfQzMyX0NvZWZzX3QgICAgICBDb2VmZmljaWVudHM7CkBAIC0yNjksNiArMjk2LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZDb2VmZmljaWVudHMpOwogICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgfQorI2VuZGlmCiAgICAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICB9CkBAIC0yODgsNyArMzE2LDcgQEAKIC8qICBwSW5zdGFuY2UgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGluc3RhbmNlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQorI2lmbmRlZiBCVUlMRF9GTE9BVAogdm9pZCAgICBMVkVRTkJfQ2xlYXJGaWx0ZXJIaXN0b3J5KExWRVFOQl9JbnN0YW5jZV90ICAgICAqcEluc3RhbmNlKQogewogICAgIExWTV9JTlQxNiAgICAgICAqcFRhcEFkZHJlc3M7CkBAIC0zMDUsOCArMzMzLDI0IEBACiAgICAgICAgICAgICAgICAgICAgICBOdW1UYXBzKTsgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIE51bWJlciBvZiB3b3JkcyAqLwogICAgIH0KIH0KKyNlbHNlCit2b2lkICAgIExWRVFOQl9DbGVhckZpbHRlckhpc3RvcnkoTFZFUU5CX0luc3RhbmNlX3QgICAgICpwSW5zdGFuY2UpCit7CisgICAgTFZNX0ZMT0FUICAgICAgICpwVGFwQWRkcmVzczsKKyAgICBMVk1fSU5UMTYgICAgICAgTnVtVGFwczsKIAorICAgIHBUYXBBZGRyZXNzID0gKExWTV9GTE9BVCAqKXBJbnN0YW5jZS0+cEVRTkJfVGFwc19GbG9hdDsKKyAgICBOdW1UYXBzICAgICA9IChMVk1fSU5UMTYpKChwSW5zdGFuY2UtPkNhcGFiaWxpdGllcy5NYXhCYW5kcyAqIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihCaXF1YWRfMklfT3JkZXIyX0ZMT0FUX1RhcHNfdCkpIC8gc2l6ZW9mKExWTV9GTE9BVCkpOwogCisgICAgaWYgKE51bVRhcHMgIT0gMCkKKyAgICB7CisgICAgICAgIExvYWRDb25zdF9GbG9hdCgwLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIENsZWFyIHRoZSBoaXN0b3J5LCB2YWx1ZSAwICovCisgICAgICAgICAgICAgICAgICAgICAgICBwVGFwQWRkcmVzcywgICAgICAgICAgICAgICAgICAgICAgIC8qIERlc3RpbmF0aW9uICovCisgICAgICAgICAgICAgICAgICAgICAgICBOdW1UYXBzKTsgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIE51bWJlciBvZiB3b3JkcyAqLworICAgIH0KK30KKyNlbmRpZgogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICBMVkVRTkJfQ29udHJvbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwpAQCAtNDIyLDkgKzQ2NiwxMyBAQAogICAgICAgICB7CiAgICAgICAgICAgICBpZihwUGFyYW1zLT5PcGVyYXRpbmdNb2RlID09IExWRVFOQl9PTikKICAgICAgICAgICAgI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ZFUU5CX0luaXQuYworKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvRXEvc3JjL0xWRVFOQl9Jbml0LmMKQEAgLTk3LDYgKzk3LDIxIEBACiAgICAgICAgICAqLwogICAgICAgICBJbnN0QWxsb2NfSW5pdCgmQWxsb2NNZW0sCiAgICAgICAgICAgICAgICAgICAgICAgIExWTV9OVUxMKTsKKyNpZmRlZiBCVUlMRF9GTE9BVAorICAgICAgICBJbnN0QWxsb2NfQWRkTWVtYmVyKCZBbGxvY01lbSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBMb3cgcGFzcyBmaWx0ZXIgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoQmlxdWFkXzJJX09yZGVyMl9GTE9BVF9UYXBzX3QpKTsKKyAgICAgICAgSW5zdEFsbG9jX0FkZE1lbWJlcigmQWxsb2NNZW0sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogSGlnaCBwYXNzIGZpbHRlciAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihCaXF1YWRfMklfT3JkZXIyX0ZMT0FUX1RhcHNfdCkpOworICAgICAgICAvKiBFcXVhbGlzZXIgQmlxdWFkIFRhcHMgKi8KKyAgICAgICAgSW5zdEFsbG9jX0FkZE1lbWJlcigmQWxsb2NNZW0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBDYXBhYmlsaXRpZXMtPk1heEJhbmRzICogc2l6ZW9mKEJpcXVhZF8ySV9PcmRlcjJfRkxPQVRfVGFwc190KSkpOworICAgICAgICAvKiBGaWx0ZXIgZGVmaW5pdGlvbnMgKi8KKyAgICAgICAgSW5zdEFsbG9jX0FkZE1lbWJlcigmQWxsb2NNZW0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBDYXBhYmlsaXRpZXMtPk1heEJhbmRzICogc2l6ZW9mKExWRVFOQl9CYW5kRGVmX3QpKSk7CisgICAgICAgIC8qIEJpcXVhZCB0eXBlcyAqLworICAgICAgICBJbnN0QWxsb2NfQWRkTWVtYmVyKCZBbGxvY01lbSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAocENhcGFiaWxpdGllcy0+TWF4QmFuZHMgKiBzaXplb2YoTFZFUU5CX0JpcXVhZFR5cGVfZW4pKSk7CisjZWxzZQogICAgICAgICBJbnN0QWxsb2NfQWRkTWVtYmVyKCZBbGxvY01lbSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBMb3cgcGFzcyBmaWx0ZXIgKi8KICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoQmlxdWFkXzJJX09yZGVyMl9UYXBzX3QpKTsKICAgICAgICAgSW5zdEFsbG9jX0FkZE1lbWJlcigmQWxsb2NNZW0sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogSGlnaCBwYXNzIGZpbHRlciAqLwpAQCAtMTA3LDYgKzEyMiw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBDYXBhYmlsaXRpZXMtPk1heEJhbmRzICogc2l6ZW9mKExWRVFOQl9CYW5kRGVmX3QpKSk7ICAgICAgICAvKiBGaWx0ZXIgZGVmaW5pdGlvbnMgKi8KICAgICAgICAgSW5zdEFsbG9jX0FkZE1lbWJlcigmQWxsb2NNZW0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBDYXBhYmlsaXRpZXMtPk1heEJhbmRzICogc2l6ZW9mKExWRVFOQl9CaXF1YWRUeXBlX2VuKSkpOyAgICAvKiBCaXF1YWQgdHlwZXMgKi8KKyNlbmRpZgogICAgICAgICBwTWVtb3J5VGFibGUtPlJlZ2lvbltMVkVRTkJfTUVNUkVHSU9OX1BFUlNJU1RFTlRfREFUQV0uU2l6ZSAgICAgICAgID0gSW5zdEFsbG9jX0dldFRvdGFsKCZBbGxvY01lbSk7CiAgICAgICAgIHBNZW1vcnlUYWJsZS0+UmVnaW9uW0xWRVFOQl9NRU1SRUdJT05fUEVSU0lTVEVOVF9EQVRBXS5BbGlnbm1lbnQgICAgPSBMVkVRTkJfREFUQV9BTElHTjsKICAgICAgICAgcE1lbW9yeVRhYmxlLT5SZWdpb25bTFZFUU5CX01FTVJFR0lPTl9QRVJTSVNURU5UX0RBVEFdLlR5cGUgICAgICAgICA9IExWRVFOQl9QRVJTSVNURU5UX0RBVEE7CkBAIC0xMTcsMTIgKzEzMywyMiBAQAogICAgICAgICAgKi8KICAgICAgICAgSW5zdEFsbG9jX0luaXQoJkFsbG9jTWVtLAogICAgICAgICAgICAgICAgICAgICAgICBMVk1fTlVMTCk7CisjaWZkZWYgQlVJTERfRkxPQVQKKyAgICAgICAgSW5zdEFsbG9jX0FkZE1lbWJlcigmQWxsb2NNZW0sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTG93IHBhc3MgZmlsdGVyICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKEJpcXVhZF9GTE9BVF9JbnN0YW5jZV90KSk7CisgICAgICAgIEluc3RBbGxvY19BZGRNZW1iZXIoJkFsbG9jTWVtLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEhpZ2ggcGFzcyBmaWx0ZXIgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoQmlxdWFkX0ZMT0FUX0luc3RhbmNlX3QpKTsKKyAgICAgICAgLyogRXF1YWxpc2VyIEJpcXVhZCBJbnN0YW5jZSAqLworICAgICAgICBJbnN0QWxsb2NfQWRkTWVtYmVyKCZBbGxvY01lbSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2FwYWJpbGl0aWVzLT5NYXhCYW5kcyAqIHNpemVvZihCaXF1YWRfRkxPQVRfSW5zdGFuY2VfdCkpOworI2Vsc2UKICAgICAgICAgSW5zdEFsbG9jX0FkZE1lbWJlcigmQWxsb2NNZW0sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTG93IHBhc3MgZmlsdGVyICovCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKEJpcXVhZF9JbnN0YW5jZV90KSk7CiAgICAgICAgIEluc3RBbGxvY19BZGRNZW1iZXIoJkFsbG9jTWVtLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEhpZ2ggcGFzcyBmaWx0ZXIgKi8KICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoQmlxdWFkX0luc3RhbmNlX3QpKTsKICAgICAgICAgSW5zdEFsbG9jX0FkZE1lbWJlcigmQWxsb2NNZW0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENhcGFiaWxpdGllcy0+TWF4QmFuZHMgKiBzaXplb2YoQmlxdWFkX0luc3RhbmNlX3QpKTsgLyogRXF1YWxpc2VyIEJpcXVhZCBJbnN0YW5jZSAqLworI2VuZGlmCiAgICAgICAgIHBNZW1vcnlUYWJsZS0+UmVnaW9uW0xWRVFOQl9NRU1SRUdJT05fUEVSU0lTVEVOVF9DT0VGXS5TaXplICAgICAgICAgPSBJbnN0QWxsb2NfR2V0VG90YWwoJkFsbG9jTWVtKTsKICAgICAgICAgcE1lbW9yeVRhYmxlLT5SZWdpb25bTFZFUU5CX01FTVJFR0lPTl9QRVJTSVNURU5UX0NPRUZdLkFsaWdubWVudCAgICA9IExWRVFOQl9DT0VGX0FMSUdOOwogICAgICAgICBwTWVtb3J5VGFibGUtPlJlZ2lvbltMVkVRTkJfTUVNUkVHSU9OX1BFUlNJU1RFTlRfQ09FRl0uVHlwZSAgICAgICAgID0gTFZFUU5CX1BFUlNJU1RFTlRfQ09FRjsKQEAgLTEzMyw4ICsxNTksMTQgQEAKICAgICAgICAgICovCiAgICAgICAgIEluc3RBbGxvY19Jbml0KCZBbGxvY01lbSwKICAgICAgICAgICAgICAgICAgICAgICAgTFZNX05VTEwpOworI2lmZGVmIEJVSUxEX0ZMT0FUCisgICAgICAgIEluc3RBbGxvY19BZGRNZW1iZXIoJkFsbG9jTWVtLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIExvdyBwYXNzIGZpbHRlciAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl9TQ1JBVENIQlVGRkVSUyAqIHNpemVvZihMVk1fRkxPQVQpICogXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENhcGFiaWxpdGllcy0+TWF4QmxvY2tTaXplKTsKKyNlbHNlCiAgICAgICAgIEluc3RBbGxvY19BZGRNZW1iZXIoJkFsbG9jTWVtLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIExvdyBwYXNzIGZpbHRlciAqLwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl9TQ1JBVENIQlVGRkVSUypzaXplb2YoTFZNX0lOVDE2KSpwQ2FwYWJpbGl0aWVzLT5NYXhCbG9ja1NpemUpOworI2VuZGlmCiAgICAgICAgIHBNZW1vcnlUYWJsZS0+UmVnaW9uW0xWRVFOQl9NRU1SRUdJT05fU0NSQVRDSF0uU2l6ZSAgICAgICAgICAgICAgPSBJbnN0QWxsb2NfR2V0VG90YWwoJkFsbG9jTWVtKTsKICAgICAgICAgcE1lbW9yeVRhYmxlLT5SZWdpb25bTFZFUU5CX01FTVJFR0lPTl9TQ1JBVENIXS5BbGlnbm1lbnQgICAgICAgICA9IExWRVFOQl9TQ1JBVENIX0FMSUdOOwogICAgICAgICBwTWVtb3J5VGFibGUtPlJlZ2lvbltMVkVRTkJfTUVNUkVHSU9OX1NDUkFUQ0hdLlR5cGUgICAgICAgICAgICAgID0gTFZFUU5CX1NDUkFUQ0g7CkBAIC0yNDgsOCArMjgwLDE1IEBACiAgICAgSW5zdEFsbG9jX0luaXQoJkFsbG9jTWVtLAogICAgICAgICAgICAgICAgICAgIHBNZW1vcnlUYWJsZS0+UmVnaW9uW0xWRVFOQl9NRU1SRUdJT05fUEVSU0lTVEVOVF9DT0VGXS5wQmFzZUFkZHJlc3MpOwogCisjaWZkZWYgQlVJTERfRkxPQVQKKyAgICAvKiBFcXVhbGlzZXIgQmlxdWFkIEluc3RhbmNlICovCisgICAgcEluc3RhbmNlLT5wRVFOQl9GaWx0ZXJTdGF0ZV9GbG9hdCA9IEluc3RBbGxvY19BZGRNZW1iZXIoJkFsbG9jTWVtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBDYXBhYmlsaXRpZXMtPk1heEJhbmRzICogXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihCaXF1YWRfRkxPQVRfSW5zdGFuY2VfdCkpOworI2Vsc2UKICAgICBwSW5zdGFuY2UtPnBFUU5CX0ZpbHRlclN0YXRlID0gSW5zdEFsbG9jX0FkZE1lbWJlcigmQWxsb2NNZW0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENhcGFiaWxpdGllcy0+TWF4QmFuZHMgKiBzaXplb2YoQmlxdWFkX0luc3RhbmNlX3QpKTsgLyogRXF1YWxpc2VyIEJpcXVhZCBJbnN0YW5jZSAqLworI2VuZGlmCiAKIAogCkBAIC0yNTksOSArMjk4LDE1IEBACiAgICAgSW5zdEFsbG9jX0luaXQoJkFsbG9jTWVtLAogICAgICAgICAgICAgICAgICAgIHBNZW1vcnlUYWJsZS0+UmVnaW9uW0xWRVFOQl9NRU1SRUdJT05fUEVSU0lTVEVOVF9EQVRBXS5wQmFzZUFkZHJlc3MpOwogCisjaWZkZWYgQlVJTERfRkxPQVQKKyAgICBNZW1TaXplID0gKHBDYXBhYmlsaXRpZXMtPk1heEJhbmRzICogc2l6ZW9mKEJpcXVhZF8ySV9PcmRlcjJfRkxPQVRfVGFwc190KSk7CisgICAgcEluc3RhbmNlLT5wRVFOQl9UYXBzX0Zsb2F0ID0gKEJpcXVhZF8ySV9PcmRlcjJfRkxPQVRfVGFwc190ICopSW5zdEFsbG9jX0FkZE1lbWJlcigmQWxsb2NNZW0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNZW1TaXplKTsKKyNlbHNlCiAgICAgTWVtU2l6ZSA9IChwQ2FwYWJpbGl0aWVzLT5NYXhCYW5kcyAqIHNpemVvZihCaXF1YWRfMklfT3JkZXIyX1RhcHNfdCkpOwogICAgIHBJbnN0YW5jZS0+cEVRTkJfVGFwcyA9IChCaXF1YWRfMklfT3JkZXIyX1RhcHNfdCAqKUluc3RBbGxvY19BZGRNZW1iZXIoJkFsbG9jTWVtLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTWVtU2l6ZSk7CisjZW5kaWYKICAgICBNZW1TaXplID0gKHBDYXBhYmlsaXRpZXMtPk1heEJhbmRzICogc2l6ZW9mKExWRVFOQl9CYW5kRGVmX3QpKTsKICAgICBwSW5zdGFuY2UtPnBCYW5kRGVmaW5pdGlvbnMgID0gKExWRVFOQl9CYW5kRGVmX3QgKilJbnN0QWxsb2NfQWRkTWVtYmVyKCZBbGxvY01lbSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1lbVNpemUpOwpAQCAtMjc5LDggKzMyNCwxMyBAQAogICAgIEluc3RBbGxvY19Jbml0KCZBbGxvY01lbSwKICAgICAgICAgICAgICAgICAgICBwTWVtb3J5VGFibGUtPlJlZ2lvbltMVkVRTkJfTUVNUkVHSU9OX1NDUkFUQ0hdLnBCYXNlQWRkcmVzcyk7CiAKKyNpZmRlZiBCVUlMRF9GTE9BVAorICAgIHBJbnN0YW5jZS0+cEZhc3RUZW1wb3JhcnkgPSAoTFZNX0ZMT0FUICopSW5zdEFsbG9jX0FkZE1lbWJlcigmQWxsb2NNZW0sCisgIC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vZWZmaWNpZW50cyhMVkVRTkJfSW5zdGFuY2VfdCAgICAqcEluc3RhbmNlKTsKIAogdm9pZCAgICBMVkVRTkJfQ2xlYXJGaWx0ZXJIaXN0b3J5KExWRVFOQl9JbnN0YW5jZV90ICpwSW5zdGFuY2UpOwotCisjaWZkZWYgQlVJTERfRkxPQVQKK0xWRVFOQl9SZXR1cm5TdGF0dXNfZW4gTFZFUU5CX1NpbmdsZVByZWNDb2VmcyhMVk1fVUlOVDE2ICAgICAgICBGcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfQmFuZERlZl90ICAqcEZpbHRlckRlZmluaXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUEtfRkxPQVRfQ29lZnNfdCAgICAqcENvZWZmaWNpZW50cyk7CisjZWxzZQogTFZFUU5CX1JldHVyblN0YXR1c19lbiBMVkVRTkJfU2luZ2xlUHJlY0NvZWZzKExWTV9VSU5UMTYgICAgICAgIEZzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl9CYW5kRGVmX3QgICpwRmlsdGVyRGVmaW5pdGlvbiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQS19DMTZfQ29lZnNfdCAgICAqcENvZWZmaWNpZW50cyk7CkBAIC0xMjIsNiArMTQzLDcgQEAKIExWRVFOQl9SZXR1cm5TdGF0dXNfZW4gTFZFUU5CX0RvdWJsZVByZWNDb2VmcyhMVk1fVUlOVDE2ICAgICAgICBGcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfQmFuZERlZl90ICAqcEZpbHRlckRlZmluaXRpb24sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUEtfQzMyX0NvZWZzX3QgICAgKnBDb2VmZmljaWVudHMpOworI2VuZGlmCiAKIExWTV9JTlQzMiBMVkVRTkJfQnlwYXNzTWl4ZXJDYWxsQmFjayAodm9pZCogaEluc3RhbmNlLCB2b2lkICpwR2VuZXJhbFB1cnBvc2UsIExWTV9JTlQxNiBDYWxsYmFja1BhcmFtKTsKIApkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0VxL3NyYy9MVkVRTkJfUHJvY2Vzcy5jIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0VxL3NyYy9MVkVRTkJfUHJvY2Vzcy5jCmluZGV4IDU4ZjU4ZWQuLjYzMjgxODEgMTAwNjQ0Ci0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9FcS9zcmMvTFZFUU5CX1Byb2Nlc3MuYworKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvRXEvc3JjL0xWRVFOQl9Qcm9jZXNzLmMKQEAgLTU3LDcgKzU3LDEyMSBAQAogLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmZGVmIEJVSUxEX0ZMT0FUCitMVkVRTkJfUmV0dXJuU3RhdHVzX2VuIExWRVFOQl9Qcm9jZXNzKExWRVFOQl9IYW5kbGVfdCAgICAgICBoSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9GTE9BVCAgICAgICAqcEluRGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICpwT3V0RGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiAgICAgICAgICAgIE51bVNhbXBsZXMpCit7CiAKKyAgICBMVk1fVUlOVDE2ICAgICAgICAgIGk7CisgICAgQmlxdWFkX0ZMT0FUX0luc3RhbmNlX3QgICAqcEJpcXVhZDsKKyAgICBMVkVRTkJfSW5zdGFuY2VfdCAgICpwSW5zdGFuY2UgPSAoTFZFUU5CX0luc3RhbmNlX3QgICopaEluc3RhbmNlOworICAgIExWTV9GTE9BVCAgICAgICAgICAgKnBTY3JhdGNoOworCisKKyAgICAgLyogQ2hlY2sgZm9yIE5VTEwgcG9pbnRlcnMgKi8KKyAgICBpZigoaEluc3RhbmNlID09IExWTV9OVUxMKSB8fCAocEluRGF0YSA9PSBMVk1fTlVMTCkgfHwgKHBPdXREYXRhID09IExWTV9OVUxMKSkKKyAgICB7CisgICAgICAgIHJldHVybiBMVkVRTkJfTlVMTEFERFJFU1M7CisgICAgfQorCisgICAgLyogQ2hlY2sgaWYgdGhlIGlucHV0IGFuZCBvdXRwdXQgZGF0YSBidWZmZXJzIGFyZSAzMi1iaXQgYWxpZ25lZCAqLworICAgIGlmICgoKCh1aW50cHRyX3QpcEluRGF0YSAlIDQpICE9IDApIHx8ICgoKHVpbnRwdHJfdClwT3V0RGF0YSAlIDQpICE9IDApKQorICAgIHsKKyAgICAgICAgcmV0dXJuIExWRVFOQl9BTElHTk1FTlRFUlJPUjsKKyAgICB9CisKKyAgICBwU2NyYXRjaCAgPSAoTFZNX0ZMT0FUICopcEluc3RhbmNlLT5wRmFzdFRlbXBvcmFyeTsKKworICAgIC8qCisgICAgKiBDaGVjayB0aGUgbnVtYmVyIG9mIHNhbXBsZXMgaXMgbm90IHRvbyBsYXJnZQorICAgICovCisgICAgaWYgKE51bVNhbXBsZXMgPiBwSW5zdGFuY2UtPkNhcGFiaWxpdGllcy5NYXhCbG9ja1NpemUpCisgICAgeworICAgICAgICByZXR1cm4oTFZFUU5CX1RPT01BTllTQU1QTEVTKTsKKyAgICB9CisKKyAgICBpZiAocEluc3RhbmNlLT5QYXJhbXMuT3BlcmF0aW5nTW9kZSA9PSBMVkVRTkJfT04pCisgICAgeworICAgICAgICAvKgorICAgICAgICAgKiBDb3B5IGlucHV0IGRhdGEgaW4gdG8gc2NyYXRjaCBidWZmZXIKKyAgICAgICAgICovCisKKyAgICAgICAgQ29weV9GbG9hdCgoTFZNX0ZMT0FUICopcEluRGF0YSwgICAgICAvKiBTb3VyY2UgKi8KKyAgICAgICAgICAgICAgICAgICBwU2NyYXRjaCwgICAgICAgICAgICAgICAgICAvKiBEZXN0aW5hdGlvbiAqLworICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpKDIgKiBOdW1TYW1wbGVzKSk7IC8qIExlZnQgYW5kIFJpZ2h0ICovCisgICAgICAgIC8qCisgICAgICAgICAqIEZvciBlYWNoIHNlY3Rpb24gZXhlY3RlIHRoZSBmaWx0ZXIgdW5sZXNzIHRoZSBnYWluIGlzIDBkQgorICAgICAgICAgKi8KKyAgICAgICAgaWYgKHBJbnN0YW5jZS0+TkJhbmRzICE9IDApCisgICAgICAgIHsKKyAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBwSW5zdGFuY2UtPk5CYW5kczsgaSsrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICogQ2hlY2sgaWYgYmFuZCBpcyBub24temVybyBkQiBnYWluCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgaWYgKHBJbnN0YW5jZS0+cEJhbmREZWZpbml0aW9uc1tpXS5HYWluICE9IDApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAgICAgKiBHZXQgdGhlIGFkZHJlc3Mgb2YgdGhlIGJpcXVhZCBpbnN0YW5jZQorICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgcEJpcXVhZCA9ICZwSW5zdGFuY2UtPnBFUU5CX0ZpbHRlclN0YXRlX0Zsb2F0W2ldOworCisKKyAgICAgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgICAgICogU2VsZWN0IHNpbmdsZSBvciBkb3VibGUgcHJlY2lzaW9uIGFzIHJlcXVpcmVkCisgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHBJbnN0YW5jZS0+cEJpcXVhZFR5cGVbaV0pCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgTFZFUU5CX1NpbmdsZVByZWNpc2lvbl9GbG9hdDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBQS18ySV9EMzJGMzJDMTRHMTFfVFJDX1dSQV8wMShwQmlxdWFkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fRkxPQVQgKilwU2NyYXRjaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0ZMT0FUICopcFNjcmF0Y2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNilOdW1TYW1wbGVzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworCisgICAgICAgIGlmKHBJbnN0YW5jZS0+YkluT3BlcmF0aW5nTW9kZVRyYW5zaXRpb24gPT0gTFZNX1RSVUUpeworICAgICAgICAgICAgTFZDX01peFNvZnRfMlN0X0QxNkMzMV9TQVQoJnBJbnN0YW5jZS0+QnlwYXNzTWl4ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0ZMT0FUICopcFNjcmF0Y2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0ZMT0FUICopcEluRGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fRkxPQVQgKilwU2NyYXRjaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpKDIgKiBOdW1TYW1wbGVzKSk7CisgICAgICAgICAgICBDb3B5X0Zsb2F0KChMVk1fRkxPQVQqKXBTY3JhdGNoLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFNvdXJjZSAqLworICAgICAgICAgICAgICAgICAgICAgICBwT3V0RGF0YSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBEZXN0aW5hdGlvbiAqLworICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KSgyICogTnVtU2FtcGxlcykpOyAgICAgICAgICAgICAgICAgICAgIC8qIExlZnQgYW5kIFJpZ2h0IHNhbXBsZXMgKi8KKyAgICAgICAgfQorICAgICAgICBlbHNleworICAgICAgICAgICAgQ29weV9GbG9hdChwU2NyYXRjaCwgICAgICAgICAgICAgIC8qIFNvdXJjZSAqLworICAgICAgICAgICAgICAgICAgICAgICBwT3V0RGF0YSwgICAgICAgICAgICAgIC8qIERlc3RpbmF0aW9uICovCisgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYgKSgyICogTnVtU2FtcGxlcykpOyAvKiBMZWZ0IGFuZCBSaWdodCAqLworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIC8qCisgICAgICAgICAqIE1vZGUgaXMgT0ZGIHNvIGNvcHkgdGhlIGRhdGEgaWYgbmVjZXNzYXJ5CisgICAgICAgICAqLworICAgICAgICBpZiAocEluRGF0YSAhPSBwT3V0RGF0YSkKKyAgICAgICAgeworICAgICAgICAgICAgQ29weV9GbG9hdChwSW5EYXRhLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFNvdXJjZSAqLworICAgICAgICAgICAgICAgICAgICAgICBwT3V0RGF0YSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIERlc3RpbmF0aW9uICovCisgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpKDIgKiBOdW1TYW1wbGVzKSk7ICAgICAgICAgICAgICAgICAvKiBMZWZ0IGFuZCBSaWdodCBzYW1wbGVzICovCisgICAgICAgIH0KKyAgICB9CisgICAgcmV0dXJuKExWRVFOQl9TVUNDRVNTKTsKKworfQorI2Vsc2UKIExWRVFOQl9SZXR1cm5TdGF0dXNfZW4gTFZFUU5CX1Byb2Nlc3MoTFZFUU5CX0hhbmRsZV90ICAgICAgIGhJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICAgICAgICpwSW5EYXRhLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgKnBPdXREYXRhLApAQCAtMTk4LDMgKzMxMiw0IEBACiAgICAgcmV0dXJuKExWRVFOQl9TVUNDRVNTKTsKIAogfQorI2VuZGlmClwgTm8gbmV3bGluZSBhdCBlbmQgb2YgZmlsZQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0VxL3NyYy9MVkVRTkJfVGFibGVzLmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvRXEvc3JjL0xWRVFOQl9UYWJsZXMuYwppbmRleCA4ZTJlMGU4Li41NjMxODFjIDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvRXEvc3JjL0xWRVFOQl9UYWJsZXMuYworKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvRXEvc3JjL0xWRVFOQl9UYWJsZXMuYwpAQCAtMzYsNiArMzYsMjAgQEAKICAqIFNhbXBsZSByYXRlIHRhYmxlIGZvciBjb252ZXJ0aW5nIGJldHdlZW4gdGhlIGVudW1lcmF0ZWQgdHlwZSBhbmQgdGhlIGFjdHVhbAogICogZnJlcXVlbmN5CiAgKi8KKyNpZiBkZWZpbmVkKEJVSUxEX0ZMT0FUKSAmJiBkZWZpbmVkKEhJR0hFUl9GUykKK2NvbnN0IExWTV9VSU5UMzIgICAgTFZFUU5CX1NhbXBsZVJhdGVUYWJbXSA9IHs4MDAwLCAgICAgICAgICAgICAgICAgICAgLyogOGtTL3MgICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTEwMjUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTIwMDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTYwMDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjIwNTAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjQwMDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzIwMDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDQxMDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDgwMDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOTYwMDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTkyMDAwCit9OworI2Vsc2UKIGNvbnN0IExWTV9VSU5UMTYgICAgTFZFUU5CX1NhbXBsZVJhdGVUYWJbXSA9IHs4MDAwLCAgICAgICAgICAgICAgICAgICAgLyogOGtTL3MgICovCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTEwMjUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTIwMDAsCkBAIC00NCw4ICs1OCw5IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjQwMDAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzIwMDAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDQxMDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDgwMDB9OyAgICAgICAgICAgICAgICAgIC8qIDQ4a1MvcyAqLwotCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDgwMDAKK307CisjZW5kaWYKIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCkBAIC01Niw2ICs3MSwyMiBAQAogLyoKICAqIFRhYmxlIGZvciAyICogUGkgLyBGcwogICovCisjaWZkZWYgQlVJTERfRkxPQVQKK2NvbnN0IExWTV9GTE9BVCAgICAgTFZFUU5CX1R3b1BpT25Gc1RhYmxlW10gPSB7TFZFUU5CXzJQaU9uXzgwMDAsICAgICAgLyogOGtTL3MgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CXzJQaU9uXzExMDI1LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfMlBpT25fMTIwMDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl8yUGlPbl8xNjAwMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CXzJQaU9uXzIyMDUwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfMlBpT25fMjQwMDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl8yUGlPbl8zMjAwMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CXzJQaU9uXzQ0MTAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfMlBpT25fNDgwMDAKKyNpZmRlZiBISUdIRVJfRlMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAsTFZFUU5CXzJQaU9uXzk2MDAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLExWRVFOQl8yUGlPbl8xOTIwMDAKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworI2Vsc2UKIGNvbnN0IExWTV9JTlQxNiAgICAgTFZFUU5CX1R3b1BpT25Gc1RhYmxlW10gPSB7TFZFUU5CXzJQaU9uXzgwMDAsICAgICAgLyogOGtTL3MgKi8KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CXzJQaU9uXzExMDI1LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfMlBpT25fMTIwMDAsCkBAIC02NSwxMCArOTYsNDQgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CXzJQaU9uXzMyMDAwLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfMlBpT25fNDQxMDAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl8yUGlPbl80ODAwMH07ICAgIC8qIDQ4a1MvcyAqLworI2VuZGlmCiAKIC8qCiAgKiBHYWluIHRhYmxlCiAgKi8KKyNpZmRlZiBCVUlMRF9GTE9BVAorY29uc3QgTFZNX0ZMT0FUICAgICBMVkVRTkJfR2FpblRhYmxlW10gPSB7TFZFUU5CX0dhaW5fTmVnMTVfZEIsICAgICAgICAvKiAtMTVkQiBnYWluICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfR2Fpbl9OZWcxNF9kQiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl9HYWluX05lZzEzX2RCLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX0dhaW5fTmVnMTJfZEIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfR2Fpbl9OZWcxMV9kQiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl9HYWluX05lZzEwX2RCLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX0dhaW5fTmVnOV9kQiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl9HYWluX05lZzhfZEIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfR2Fpbl9OZWc3X2RCLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX0dhaW5fTmVnNl9kQiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl9HYWluX05lZzVfZEIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfR2Fpbl9OZWc0X2RCLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX0dhaW5fTmVnM19kQiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl9HYWluX05lZzJfZEIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfR2Fpbl9OZWcxX2RCLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX0dhaW5fMF9kQiwgICAgICAgICAgICAvKiAwZEIgZ2FpbiAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX0dhaW5fMV9kQiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl9HYWluXzJfZEIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfR2Fpbl8zX2RCLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX0dhaW5fNF9kQiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl9HYWluXzVfZEIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfR2Fpbl82X2RCLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX0dhaW5fN19kQiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl9HYWluXzhfZEIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfR2Fpbl85X2RCLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX0dhaW5fMTBfZEIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfR2Fpbl8xMV9kQiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl9HYWluXzEyX2RCLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX0dhaW5fMTNfZEIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfR2Fpbl8xNF9kQiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl9HYWluXzE1X2RCfTsgICAgICAgICAgLyogKzE1ZEIgZ2FpbiAqLworI2Vsc2UKIGNvbnN0IExWTV9JTlQxNiAgICAgTFZFUU5CX0dhaW5UYWJsZVtdID0ge0xWRVFOQl9HYWluX05lZzE1X2RCLCAgICAgICAgLyogLTE1ZEIgZ2FpbiAqLwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX0dhaW5fTmVnMTRfZEIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfR2Fpbl9OZWcxM19kQiwKQEAgLTEwMSwxMCArMTY2LDI4IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfR2Fpbl8xNF9kQiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl9HYWluXzE1X2RCfTsgICAgICAgICAgLyogKzE1ZEIgZ2FpbiAqLwogCi0KKyNlbmRpZgogLyoKICAqIEQgdGFibGUgZm9yIDEwMCAvIChHYWluICsgMSkKICAqLworI2lmZGVmIEJVSUxEX0ZMT0FUCitjb25zdCBMVk1fRkxPQVQgICAgTFZFUU5CX0RUYWJsZVtdID0ge0xWRVFOQl8xMDBEX05lZzE1X2RCLCAgICAgICAgICAgIC8qIC0xNWRCIGdhaW4gKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CXzEwMERfTmVnMTRfZEIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl8xMDBEX05lZzEzX2RCLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfMTAwRF9OZWcxMl9kQiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CXzEwMERfTmVnMTFfZEIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl8xMDBEX05lZzEwX2RCLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfMTAwRF9OZWc5X2RCLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfMTAwRF9OZWc4X2RCLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfMTAwRF9OZWc3X2RCLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfMTAwRF9OZWc2X2RCLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfMTAwRF9OZWc1X2RCLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfMTAwRF9OZWc0X2RCLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfMTAwRF9OZWczX2RCLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfMTAwRF9OZWcyX2RCLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfMTAwRF9OZWcxX2RCLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfMTAwRF8wX2RCfTsgICAgICAgICAgICAgICAvKiAwZEIgZ2FpbiAqLworI2Vsc2UKIGNvbnN0IExWTV9JTlQxNiAgICBMVkVRTkJfRFRhYmxlW10gPSB7TFZFUU5CXzEwMERfTmVnMTVfZEIsICAgICAgICAgICAgLyogLTE1ZEIgZ2FpbiAqLwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfMTAwRF9OZWcxNF9kQiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CXzEwMERfTmVnMTNfZEIsCkBAIC0xMjIsNyArMjA1LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CXzEwMERfTmVnMV9kQiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CXzEwMERfMF9kQn07ICAgICAgICAgICAgICAgLyogMGRCIGdhaW4gKi8KIAotCisjZW5kaWYKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogICAgRmlsdGVyIHBvbHlub21pYWwgY29lZmZpY2llbnRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9SZXZlcmIvbGliL0xWUkVWLmggYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvUmV2ZXJiL2xpYi9MVlJFVi5oCmluZGV4IDI4ZTMzNjkuLjljMmUyOTcgMTAwNjQ0Ci0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9SZXZlcmIvbGliL0xWUkVWLmgKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL1JldmVyYi9saWIvTFZSRVYuaApAQCAtMTA3LDggKzEwNywxNCBAQAogCiAgICAgLyogUGFyYW1ldGVycyBmb3IgUkVWICovCiAgICAgTFZNX1VJTlQxNiAgICAgICAgICAgICAgICAgIExldmVsOyAgICAgICAgICAgICAgICAgIC8qIExldmVsLCAwIHRvIDEwMCByZXByZXNlbnRpbmcgcGVyY2VudGFnZSBvZiByZXZlcmIgKi8KKyNpZm5kZWYgSElHSEVSX0ZTCiAgICAgTFZNX1VJTlQxNiAgICAgICAgICAgICAgICAgIExQRjsgICAgICAgICAgICAgICAgICAgIC8qIExvdyBwYXNzIGZpbHRlciwgaW4gSHogKi8KICAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICAgICAgSFBGOyAgICAgICAgICAgICAgICAgICAgLyogSGlnaCBwYXNzIGZpbHRlciwgaW4gSHogKi8KKyNlbHNlCisgICAgTFZNX1VJTlQzMiAgICAgICAgICAgICAgICAgIExQRjsgICAgICAgICAgICAgICAgICAgIC8qIExvdyBwYXNzIGZpbHRlciwgaW4gSHogKi8KKyAgICBMVk1fVUlOVDMyICAgICAgICAgICAgICAgICAgSFBGOyAgICAgICAgICAgICAgICAgICAgLyogSGlnaCBwYXNzIGZpbHRlciwgaW4gSHogKi8KKyNlbmRpZgorCiAgICAgTFZNX1VJTlQxNiAgICAgICAgICAgICAgICAgIFQ2MDsgICAgICAgICAgICAgICAgICAgIC8qIERlY2F5IHRpbWUgY29uc3RhbnQsIGluIG1zICovCiAgICAgTFZNX1VJTlQxNiAgICAgICAgICAgICAgICAgIERlbnNpdHk7ICAgICAgICAgICAgICAgIC8qIEVjaG8gZGVuc2l0eSwgMCB0byAxMDAgZm9yIG1pbmltdW0gdG8gbWF4aW11bSBkZW5zaXR5ICovCiAgICAgTFZNX1VJTlQxNiAgICAgICAgICAgICAgICAgIERhbXBpbmc7ICAgICAgICAgICAgICAgIC8qIERhbXBpbmcgKi8KQEAgLTI5NywxMSArMzAzLDE3IEBACiAvKiAgMS4gVGhlIGlucHV0IGFuZCBvdXRwdXQgYnVmZmVycyBtdXN0IGJlIDMyLWJpdCBhbGlnbmVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQlVJTERfRkxPQVQKK0xWUkVWX1JldHVyblN0YXR1c19lbiBMVlJFVl9Qcm9jZXNzKExWUkVWX0hhbmRsZV90ICAgICAgaEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICAgICAqcEluRGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgKnBPdXREYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX1VJTlQxNiAgICAgICAgICBOdW1TYW1wbGVzKTsKKyNlbHNlCiBMVlJFVl9SZXR1cm5TdGF0dXNfZW4gTFZSRVZfUHJvY2VzcyhMVlJFVl9IYW5kbGVfdCAgICAgIGhJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQzMiAgICAgKnBJbkRhdGEsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgICAgICAgIC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JzdENvbnRyb2wgICAgICAgID09IExWTV9UUlVFKSkKKyAgICB7CisgICAgICAgIExWTV9GTE9BVCAgICAgICBPbWVnYTsKKyAgICAgICAgRk9fRkxPQVRfQ29lZnNfdCAgQ29lZmZzOworCisgICAgICAgIE9tZWdhID0gTFZNX0dldE9tZWdhKHBQcml2YXRlLT5OZXdQYXJhbXMuSFBGLCBwUHJpdmF0ZS0+TmV3UGFyYW1zLlNhbXBsZVJhdGUpOworICAgICAgICBMVk1fRk9fSFBGKE9tZWdhLCAmQ29lZmZzKTsKKyAgICAgICAgRk9fMUlfRDMyRjMyQ2xsX1RSQ19XUkFfMDFfSW5pdCggJnBQcml2YXRlLT5wRmFzdENvZWYtPkhQQ29lZnMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwUHJpdmF0ZS0+cEZhc3REYXRhLT5IUFRhcHMsICZDb2VmZnMpOworICAgICAgICBMb2FkQ29uc3RfRmxvYXQoMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopJnBQcml2YXRlLT5wRmFzdERhdGEtPkhQVGFwcywgLyogRGVzdGluYXRpb24gQ2FzdCB0byB2b2lkOiBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vIGRlcmVmZXJlbmNpbmcgaW4gZnVuY3Rpb24qLworICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKEJpcXVhZF8xSV9PcmRlcjFfRkxPQVRfVGFwc190KSAvIHNpemVvZihMVk1fRkxPQVQpKTsKKyAgICB9CisKKworICAgIC8qCisgICAgICogVXBkYXRlIHRoZSBsb3cgcGFzcyBmaWx0ZXIgY29lZmZpY2llbnRzCisgICAgICovCisgICAgaWYoKHBQcml2YXRlLT5OZXdQYXJhbXMuTFBGICAgICAgICAhPSBwUHJpdmF0ZS0+Q3VycmVudFBhcmFtcy5MUEYpICAgICAgICB8fAorICAgICAgIChwUHJpdmF0ZS0+TmV3UGFyYW1zLlNhbXBsZVJhdGUgIT0gcFByaXZhdGUtPkN1cnJlbnRQYXJhbXMuU2FtcGxlUmF0ZSkgfHwKKyAgICAgICAocFByaXZhdGUtPmJGaXJzdENvbnRyb2wgICAgICAgID09IExWTV9UUlVFKSkKKyAgICB7CisgICAgICAgIExWTV9GTE9BVCAgICAgICBPbWVnYTsKKyAgICAgICAgRk9fRkxPQVRfQ29lZnNfdCAgQ29lZmZzOworCisgICAgICAgIENvZWZmcy5BMCA9IDE7CisgICAgICAgIENvZWZmcy5BMSA9IDA7CisgICAgICAgIENvZWZmcy5CMSA9IDA7CisgICAgICAgIGlmKHBQcml2YXRlLT5OZXdQYXJhbXMuTFBGIDw9IChMVk1fRnNUYWJsZVtwUHJpdmF0ZS0+TmV3UGFyYW1zLlNhbXBsZVJhdGVdID4+IDEpKQorICAgICAgICB7CisgICAgICAgICAgICBPbWVnYSA9IExWTV9HZXRPbWVnYShwUHJpdmF0ZS0+TmV3UGFyYW1zLkxQRiwgcFByaXZhdGUtPk5ld1BhcmFtcy5TYW1wbGVSYXRlKTsKKworICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAqIERvIG5vdCBhcHBseSBmaWx0ZXIgaWYgdyA9MipwaSpmYy9mcyA+PSAyLjkKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgaWYoT21lZ2EgPD0gKExWTV9GTE9BVClMVlJFVl8yXzlfSU5RMjkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgTFZNX0ZPX0xQRihPbWVnYSwgJkNvZWZmcyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgRk9fMUlfRDMyRjMyQ2xsX1RSQ19XUkFfMDFfSW5pdCggJnBQcml2YXRlLT5wRmFzdENvZWYtPkxQQ29lZnMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwUHJpdmF0ZS0+cEZhc3REYXRhLT5MUFRhcHMsICZDb2VmZnMpOworICAgICAgICBMb2FkQ29uc3RfRmxvYXQoMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopJnBQcml2YXRlLT5wRmFzdERhdGEtPkxQVGFwcywgLyogRGVzdGluYXRpb24gQ2FzdCB0byB2b2lkOiBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vIGRlcmVmZXJlbmNpbmcgaW4gZnVuY3Rpb24qLworICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKEJpcXVhZF8xSV9PcmRlcjFfRkxPQVRfVGFwc190KSAvIHNpemVvZihMVk1fRkxPQVQpKTsKKyAgICB9CisKKworICAgIC8qCisgICAgICogQ2FsY3VsYXRlIHRoZSByb29tIHNpemUgcGFyYW1ldGVyCisgICAgICovCisgICAgaWYoIHBQcml2YXRlLT5OZXdQYXJhbXMuUm9vbVNpemUgIT0gcFByaXZhdGUtPkN1cnJlbnRQYXJhbXMuUm9vbVNpemUpCisgICAgeworICAgICAgICAvKiBSb29tIHNpemUgcmFuZ2UgaXMgMTBtcyB0byAyMDBtcworICAgICAgICAgKiAwJSAgIC0tIDEwbXMKKyAgICAgICAgICogNTAlICAtLSA2NW1zCisgICAgICAgICAqIDEwMCUgLS0gMTIwbXMKKyAgICAgICAgICovCisgICAgICAgIHBQcml2YXRlLT5Sb29tU2l6ZUlubXMgPSAxMCArICgoKHBQcml2YXRlLT5OZXdQYXJhbXMuUm9vbVNpemUqMTEpICsgNSkgLyAxMCk7CisgICAgfQorCisKKyAgICAvKgorICAgICAqIFVwZGF0ZSB0aGUgVCBkZWxheSBudW1iZXIgb2Ygc2FtcGxlcyBhbmQgdGhlIGFsbCBwYXNzIGRlbGF5IG51bWJlciBvZiBzYW1wbGVzCisgICAgICovCisgICAgaWYoIChwUHJpdmF0ZS0+TmV3UGFyYW1zLlJvb21TaXplICAgIT0gcFByaXZhdGUtPkN1cnJlbnRQYXJhbXMuUm9vbVNpemUpICAgfHwKKyAgICAgICAgKHBQcml2YXRlLT5OZXdQYXJhbXMuU2FtcGxlUmF0ZSAhPSBwUHJpdmF0ZS0+Q3VycmVudFBhcmFtcy5TYW1wbGVSYXRlKSB8fAorICAgICAgICAocFByaXZhdGUtPmJGaXJzdENvbnRyb2wgICAgICAgID09IExWTV9UUlVFKSkKKyAgICB7CisKKyAgICAgICAgTFZNX1VJTlQzMiAgVGVtcDsKKyAgICAgICAgTFZNX0lOVDMyICAgQVBEZWxheVNpemU7CisgICAgICAgIExWTV9JTlQzMiAgIEZzID0gTFZNX0dldEZzRnJvbVRhYmxlKHBQcml2YXRlLT5OZXdQYXJhbXMuU2FtcGxlUmF0ZSk7CisgICAgICAgIExWTV9VSU5UMzIgIERlbGF5TGVuZ3RoU2FtcGxlcyA9IChMVk1fVUlOVDMyKShGcyAqIHBQcml2YXRlLT5Sb29tU2l6ZUlubXMpOworICAgICAgICBMVk1fSU5UMTYgICBpOworICAgICAgICBMVk1fRkxPQVQgICBTY2FsZVRhYmxlW10gID0ge0xWUkVWX1RfM19Qb3dlcl9taW51czBfb25fNCwgTFZSRVZfVF8zX1Bvd2VyX21pbnVzMV9vbl80LCBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZSRVZfVF8zX1Bvd2VyX21pbnVzMl9vbl80LCBMVlJFVl9UXzNfUG93ZXJfbWludXMzX29uXzR9OworICAgICAgICBMVk1fSU5UMTYgICBNYXhUX0RlbGF5W10gID0ge0xWUkVWX01BWF9UMF9ERUxBWSwgTFZSRVZfTUFYX1QxX0RFTEFZLCBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZSRVZfTUFYX1QyX0RFTEFZLCBMVlJFVl9NQVhfVDNfREVMQVl9OworICAgICAgICBMVk1fSU5UMTYgICBNYXhBUF9EZWxheVtdID0ge0xWUkVWX01BWF9BUDBfREVMQVksIExWUkVWX01BWF9BUDFfREVMQVksIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVlJFVl9NQVhfQVAyX0RFTEFZLCBMVlJFVl9NQVhfQVAzX0RFTEFZfTsKKworCisgICAgICAgIC8qCisgICAgICAgICAqIEZvciBlYWNoIGRlbGF5IGxpbmUKKyAgICAgICAgICovCisgICAgICAgIGZvciAoaSA9IDA7IGkgPCBOdW1iZXJPZkRlbGF5TGluZXM7IGkrKykKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKGkgIT0gMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBMVk1fRkxPQVQgVGVtcDE7ICAvKiB0byBhdm9pZCBRQUMgd2FybmluZyBvbiB0eXBlIGNvbnZlcnNpb24gKi8KKworICAgICAgICAgICAgICAgIFRlbXAxPShMVk1fRkxPQVQpRGVsYXlMZW5ndGhTYW1wbGVzOworICAgICAgICAgICAgICAgIFRlbXAgPSAoTFZNX1VJTlQzMikoVGVtcDEgKiBTY2FsZVRhYmxlW2ldKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFRlbXAgPSBEZWxheUxlbmd0aFNhbXBsZXM7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBBUERlbGF5U2l6ZSA9IFRlbXAgIC8gMTUwMDsKKworCisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogU2V0IHRoZSBmaXhlZCBkZWxheQorICAgICAgICAgICAgICovCisKKyNpZmRlZiBISUdIRVJfRlMKKyAgICAgICAgICAgIFRlbXAgID0gKE1heFRfRGVsYXlbaV0gLSBNYXhBUF9EZWxheVtpXSkgKiBGcyAvIDE5MjAwMDsKKyNlbHNlCisgICAgICAgICAgICBUZW1wICA9IChNYXhUX0RlbGF5W2ldIC0gTWF4QVBfRGVsYXlbaV0pICogRnMgLyA0ODAwMDsKKyNlbmRpZgorICAgICAgICAgICAgcFByaXZhdGUtPkRlbGF5X0FQW2ldID0gcFByaXZhdGUtPlRbaV0gLSBUZW1wOworCisKKyAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgKiBTZXQgdGhlIHRhcCBzZWxlY3Rpb24KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgaWYgKHBQcml2YXRlLT5BQl9TZWxlY3Rpb24pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogU21vb3RoIGZyb20gdGFwIEEgdG8gdGFwIEIgKi8KKyAgICAgICAgICAgICAgICBwUHJpdmF0ZS0+cE9mZnNldEJbaV0gICAgICAgICAgICAgPSAmcFByaXZhdGUtPnBEZWxheV9UW2ldW3BQcml2YXRlLT5UW2ldIC0gXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGVtcCAtIEFQRGVsYXlTaXplXTsKKyAgICAgICAgICAgICAgICBwUHJpdmF0ZS0+Ql9EZWxheVNpemVbaV0gICAgICAgICAgPSBBUERlbGF5U2l6ZTsKKyAgICAgICAgICAgICAgICBwUHJpdmF0ZS0+TWl4ZXJfQVBUYXBzW2ldLlRhcmdldDEgPSAwOworICAgICAgICAgICAgICAgIHBQcml2YXRlLT5NaXhlcl9BUFRhcHNbaV0uVGFyZ2V0MiA9IDEuMGY7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogU21vb3RoIGZyb20gdGFwIEIgdG8gdGFwIEEgKi8KKyAgICAgICAgICAgICAgICBwUHJpdmF0ZS0+cE9mZnNldEFbaV0gICAgICAgICAgICAgPSAmcFByaXZhdGUtPnBEZWxheV9UW2ldW3BQcml2YXRlLT5UW2ldIC0gXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGVtcCAtIEFQRGVsYXlTaXplXTsKKyAgICAgICAgICAgICAgICBwUHJpdmF0ZS0+QV9EZWxheVNpemVbaV0gICAgICAgICAgPSBBUERlbGF5U2l6ZTsKKyAgICAgICAgICAgICAgICBwUHJpdmF0ZS0+TWl4ZXJfQVBUYXBzW2ldLlRhcmdldDIgPSAwOworICAgICAgICAgICAgICAgIHBQcml2YXRlLT5NaXhlcl9BUFRhcHNbaV0uVGFyZ2V0MSA9IDEuMGY7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgKiBTZXQgdGhlIG1heGltdW0gYmxvY2sgc2l6ZSB0byB0aGUgc21hbGxlc3QgZGVsYXkgc2l6ZQorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwUHJpdmF0ZS0+TWF4QmxrTGVuICAgPSBUZW1wOworICAgICAgICAgICAgaWYgKHBQcml2YXRlLT5NYXhCbGtMZW4gPiBwUHJpdmF0ZS0+QV9EZWxheVNpemVbaV0pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcFByaXZhdGUtPk1heEJsa0xlbiA9IHBQcml2YXRlLT5BX0RlbGF5U2l6ZVtpXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChwUHJpdmF0ZS0+TWF4QmxrTGVuID4gcFByaXZhdGUtPkJfRGVsYXlTaXplW2ldKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBQcml2YXRlLT5NYXhCbGtMZW4gPSBwUHJpdmF0ZS0+Ql9EZWxheVNpemVbaV07CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgaWYgKHBQcml2YXRlLT5BQl9TZWxlY3Rpb24pCisgICAgICAgIHsKKyAgICAgICAgICAgIHBQcml2YXRlLT5BQl9TZWxlY3Rpb24gPSAwOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgcFByaXZhdGUtPkFCX1NlbGVjdGlvbiA9IDE7CisgICAgICAgIH0KKworCisgICAgICAgIC8qCisgICAgICAgICAqIExpbWl0IHRoZSBtYXhpbXVtIGJsb2NrIGxlbmd0aAorICAgICAgICAgKi8KKyAgICAgICAgLyogSnVzdCBhcyBhIHByZWNhdXNpb24sIGJ1dCBubyBwcm9ibGVtIGlmIHdlIHJlbW92ZSB0aGlzIGxpbmUgICAgICAqLworICAgICAgICBwUHJpdmF0ZS0+TWF4QmxrTGVuID0gcFByaXZhdGUtPk1heEJsa0xlbiAtIDI7CisgICAgICAgIGlmKHBQcml2YXRlLT5NYXhCbGtMZW4gPiBwUHJpdmF0ZS0+SW5zdGFuY2VQYXJhbXMuTWF4QmxvY2tTaXplKQorICAgICAgICB7CisgICAgICAgICAgICBwUHJpdmF0ZS0+TWF4QmxrTGVuID0gKExWTV9JTlQzMilwUHJpdmF0ZS0+SW5zdGFuY2VQYXJhbXMuTWF4QmxvY2tTaXplOworICAgICAgICB9CisgICAgfQorCisKKworICAgIC8qCisgICAgICogVXBkYXRlIHRoZSBsb3cgcGFzcyBmaWx0ZXIgY29lZmZpY2llbnQKKyAgICAgKi8KKyAgICBpZiggKHBQcml2YXRlLT5OZXdQYXJhbXMuRGFtcGluZyAgICAhPSBwUHJpdmF0ZS0+Q3VycmVudFBhcmFtcy5EYW1waW5nKSAgICB8fAorICAgICAgICAocFByaXZhdGUtPk5ld1BhcmFtcy5TYW1wbGVSYXRlICE9IHBQcml2YXRlLT5DdXJyZW50UGFyYW1zLlNhbXBsZVJhdGUpIHx8CisgICAgICAgIChwUHJpdmF0ZS0+YkZpcnN0Q29udHJvbCAgICAgICAgPT0gTFZNX1RSVUUpKQorICAgIHsKKworICAgICAgICBMVk1fSU5UMzIgICAgICAgVGVtcDsKKyAgICAgICAgTFZNX0ZMT0FUICAgICAgIE9tZWdhOworICAgICAgICBGT19GTE9BVF9Db2Vmc190ICBDb2VmZnM7CisgICAgICAgIExWTV9JTlQxNiAgICAgICBpOworICAgICAgICBMVk1fSU5UMTYgICAgICAgRGFtcGluZyAgICAgID0gKExWTV9JTlQxNikoKHBQcml2YXRlLT5OZXdQYXJhbXMuRGFtcGluZyAqIDEwMCkgKyAxMDAwKTsKKyAgICAgICAgTFZNX0ZMT0FUICAgICAgIFNjYWxlVGFibGVbXSA9IHtMVlJFVl9UXzNfUG93ZXJfMF9vbl80LCBMVlJFVl9UXzNfUG93ZXJfMV9vbl80LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWUkVWX1RfM19Qb3dlcl8yX29uXzQsIExWUkVWX1RfM19Qb3dlcl8zX29uXzR9OworCisKKyAgICAgICAgLyoKKyAgICAgICAgICogRm9yIGVhY2ggZmlsdGVyCisgICAgICAgICAqLworICAgICAgICBmb3IgKGkgPSAwOyBpIDwgTnVtYmVyT2ZEZWxheUxpbmVzOyBpKyspCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChpICE9IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVGVtcCA9IChMVk1fSU5UMzIpKFNjYWxlVGFibGVbaV0gKiBEYW1waW5nKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBUZW1wID0gRGFtcGluZzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmKFRlbXAgPD0gKExWTV9JTlQzMikoTFZNX0ZzVGFibGVbcFByaXZhdGUtPk5ld1BhcmFtcy5TYW1wbGVSYXRlXSA+PiAxKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBPbWVnYSA9IExWTV9HZXRPbWVnYShUZW1wLCBwUHJpdmF0ZS0+TmV3UGFyYW1zLlNhbXBsZVJhdGUpOworICAgICAgICAgICAgICAgIExWTV9GT19MUEYoT21lZ2EsICZDb2VmZnMpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIENvZWZmcy5BMCA9IDE7CisgICAgICAgICAgICAgICAgQ29lZmZzLkExID0gMDsKKyAgICAgICAgICAgICAgICBDb2VmZnMuQjEgPSAwOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRk9fMUlfRDMyRjMyQ2xsX1RSQ19XUkFfMDFfSW5pdCgmcFByaXZhdGUtPnBGYXN0Q29lZi0+UmV2TFBDb2Vmc1tpXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBQcml2YXRlLT5wRmFzdERhdGEtPlJldkxQVGFwc1tpXSwgJkNvZWZmcyk7CisgICAgICAgIH0KKyAgICB9CisKKworICAgIC8qCisgICAgICogVXBkYXRlIEFsbC1wYXNzIGZpbHRlciBtaXhlciB0aW1lIGNvbnN0YW50cworICAgICAqLworICAgIGlmKCAocFByaXZhdGUtPk5ld1BhcmFtcy5Sb29tU2l6ZSAgICE9IHBQcml2YXRlLT5DdXJyZW50UGFyYW1zLlJvb21TaXplKSAgIHx8CisgICAgICAgIChwUHJpdmF0ZS0+TmV3UGFyYW1zLlNhbXBsZVJhdGUgIT0gcFByaXZhdGUtPkN1cnJlbnRQYXJhbXMuU2FtcGxlUmF0ZSkgfHwKKyAgICAgICAgKHBQcml2YXRlLT5OZXdQYXJhbXMuRGVuc2l0eSAgICAhPSBwUHJpdmF0ZS0+Q3VycmVudFBhcmFtcy5EZW5zaXR5KSkKKyAgICB7CisgICAgICAgIExWTV9JTlQxNiAgIGk7CisgICAgICAgIExWTV9GTE9BVCAgIEFscGhhOworICAgICAgICBMVk1fRkxPQVQgICBBbHBoYVRhcDsKKworICAgICAgICBBbHBoYSA9IExWTV9NaXhlcl9UaW1lQ29uc3RhbnQoTFZSRVZfQUxMUEFTU19UQywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9HZXRGc0Zyb21UYWJsZShwUHJpdmF0ZS0+TmV3UGFyYW1zLlNhbXBsZVJhdGUpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSk7CisKKyAgICAgICAgQWxwaGFUYXAgPSBMVk1fTWl4ZXJfVGltZUNvbnN0YW50KExWUkVWX0FMTFBBU1NfVEFQX1RDLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0dldEZzRnJvbVRhYmxlKHBQcml2YXRlLT5OZXdQYXJhbXMuU2FtcGxlUmF0ZSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxKTsKKworICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNDsgaSsrKQorICAgICAgICB7CisgICAgICAgICAgICBwUHJpdmF0ZS0+TWl4ZXJfQVBUYXBzW2ldLkFscGhhMSAgICAgICA9IEFscGhhVGFwOworICAgICAgICAgICAgcFByaXZhdGUtPk1peGVyX0FQVGFwc1tpXS5BbHBoYTIgICAgICAgPSBBbHBoYVRhcDsKKyAgICAgICAgICAgIHBQcml2YXRlLT5NaXhlcl9TR0ZlZWRiYWNrW2ldLkFscGhhICAgID0gQWxwaGE7CisgICAgICAgICAgICBwUHJpdmF0ZS0+TWl4ZXJfU0dGZWVkZm9yd2FyZFtpXS5BbHBoYSA9IEFscGhhOworICAgICAgICB9CisgICAgfQorCisKKyAgICAvKgorICAgICAqIFVwZGF0ZSB0aGUgZmVlZCBiYWNrIGdhaW4KKyAgICAgKi8KKyAgICBpZiggKHBQcml2YXRlLT5OZXdQYXJhbXMuUm9vbVNpemUgICAhPSBwUHJpdmF0ZS0+Q3VycmVudFBhcmFtcy5Sb29tU2l6ZSkgICB8fAorICAgICAgICAocFByaXZhdGUtPk5ld1BhcmFtcy5TYW1wbGVSYXRlICE9IHBQcml2YXRlLT5DdXJyZW50UGFyYW1zLlNhbXBsZVJhdGUpIHx8CisgICAgICAgIChwUHJpdmF0ZS0+TmV3UGFyYW1zLlQ2MCAgICAgICAgIT0gcFByaXZhdGUtPkN1cnJlbnRQYXJhbXMuVDYwKSAgICAgICAgfHwKKyAgICAgICAgKHBQcml2YXRlLT5iRmlyc3RDb250cm9sICAgICAgICA9PSBMVk1fVFJVRSkpCisgICAgeworCisgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgIEdbNF07ICAgICAgICAgICAgICAgICAgICAgICAvKiBGZWVkYmFjayBnYWluIChRNy4yNCkgKi8KKworICAgICAgICBpZihwUHJpdmF0ZS0+TmV3UGFyYW1zLlQ2MCA9PSAwKQorICAgICAgICB7CisgICAgICAgICAgICBHWzNdID0gMDsKKyAgICAgICAgICAgIEdbMl0gPSAwOworICAgICAgICAgICAgR1sxXSA9IDA7CisgICAgICAgICAgICBHWzBdID0gMDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIExWTV9GTE9BVCAgIFRlbXAxOworICAgICAgICAgICAgTFZNX0ZMT0FUICAgVGVtcDI7CisgICAgICAgICAgICBMVk1fSU5UMTYgICBpOworICAgICAgICAgICAgTFZNX0ZMT0FUICAgU2NhbGVUYWJsZVtdID0ge0xWUkVWX1RfM19Qb3dlcl9taW51czBfb25fNCwgTFZSRVZfVF8zX1Bvd2VyX21pbnVzMV9vbl80LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWUkVWX1RfM19Qb3dlcl9taW51czJfb25fNCwgTFZSRVZfVF8zX1Bvd2VyX21pbnVzM19vbl80fTsKKworCisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogRm9yIGVhY2ggZGVsYXkgbGluZQorICAgICAgICAgICAgICovCisgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgTnVtYmVyT2ZEZWxheUxpbmVzOyBpKyspCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVGVtcDEgPSAoMyAqIHBQcml2YXRlLT5Sb29tU2l6ZUlubXMgKiBTY2FsZVRhYmxlW2ldKSAvIHBQcml2YXRlLT5OZXdQYXJhbXMuVDYwOworICAgICAgICAgICAgICAgIGlmKFRlbXAxID49ICg0KSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEdbaV0gPSAwOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmKChUZW1wMSA+PSAoMikpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgVGVtcDIgPSBMVk1fUG93ZXIxMCgtKFRlbXAxIC8gMi4wZikpOworICAgICAgICAgICAgICAgICAgICBUZW1wMSA9IExWTV9Qb3dlcjEwKC0oVGVtcDEgLyAyLjBmKSk7CisgICAgICAgICAgICAgICAgICAgIFRlbXAxID0gVGVtcDEgKiBUZW1wMjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgVGVtcDEgPSBMVk1fUG93ZXIxMCgtKFRlbXAxKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChOdW1iZXJPZkRlbGF5TGluZXMgPT0gMSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEdbaV0gPSBUZW1wMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgVGVtcEc7CisgICAgICAgICAgICAgICAgICAgIFRlbXBHID0gVGVtcDEgKiBPTkVfT1ZFUl9TUVJUX1RXTzsKKyAgICAgICAgICAgICAgICAgICAgR1tpXT1UZW1wRzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvKiBTZXQgdXAgdGhlIGZlZWRiYWNrIG1peGVycyBmb3IgZm91ciBkZWxheSBsaW5lcyAqLworICAgICAgICBwUHJpdmF0ZS0+RmVlZGJhY2tNaXhlclswXS5UYXJnZXQ9R1swXTsKKyAgICAgICAgcFByaXZhdGUtPkZlZWRiYWNrTWl4ZXJbMV0uVGFyZ2V0PUdbMV07CisgICAgICAgIHBQcml2YXRlLT5GZWVkYmFja01peGVyWzJdLlRhcmdldD1HWzJdOworICAgICAgICBwUHJpdmF0ZS0+RmVlZGJhY2tNaXhlclszXS5UYXJnZXQ9R1szXTsKKyAgICB9CisKKworICAgIC8qCisgICAgICogQ2FsY3VsYXRlIHRoZSBnYWluIGNvcnJlY3Rpb24KKyAgICAgKi8KKyAgICBpZigocFByaXZhdGUtPk5ld1BhcmFtcy5Sb29tU2l6ZSAhPSBwUHJpdmF0ZS0+Q3VycmVudFBhcmFtcy5Sb29tU2l6ZSkgfHwKKyAgICAgICAocFByaXZhdGUtPk5ld1BhcmFtcy5MZXZlbCAgICAhPSBwUHJpdmF0ZS0+Q3VycmVudFBhcmFtcy5MZXZlbCkgICAgfHwKKyAgICAgICAocFByaXZhdGUtPk5ld1BhcmFtcy5UNjAgICAgICAhPSBwUHJpdmF0ZS0+Q3VycmVudFBhcmFtcy5UNjApICkKKyAgICB7CisgICAgICAgIExWTV9JTlQzMiBJbmRleD0wOworICAgICAgICBMVk1fRkxPQVQgSW5kZXhfRkxPQVQ7CisgICAgICAgIExWTV9JTlQzMiBpPTA7CisgICAgICAgIExWTV9GTE9BVCBHYWluPTA7CisgICAgICAgIExWTV9JTlQzMiBSb29tU2l6ZT0wOworICAgICAgICBMVk1fRkxPQVQgVDYwOworICAgICAgICBMVk1fRkxPQVQgQ29lZnNbNV07CisKKworICAgICAgICBpZihwUHJpdmF0ZS0+TmV3UGFyYW1zLlJvb21TaXplID09IDApCisgICAgICAgIHsKKyAgICAgICAgICAgIFJvb21TaXplID0gMTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIFJvb21TaXplID0gKExWTV9JTlQzMilwUHJpdmF0ZS0+TmV3UGFyYW1zLlJvb21TaXplOworICAgICAgICB9CisKKworICAgICAgICBpZihwUHJpdmF0ZS0+TmV3UGFyYW1zLlQ2MCA8IDEwMCkKKyAgICAgICAgeworICAgICAgICAgICAgVDYwID0gMTAwICogTFZSRVZfVDYwX1NDQUxFOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgVDYwID0gcFByaXZhdGUtPk5ld1BhcmFtcy5UNjAgKiBMVlJFVl9UNjBfU0NBTEU7CisgICAgICAgIH0KKworICAgICAgICAvKiBGaW5kIHRoZSBuZWFyZXN0IHJvb20gc2l6ZSBpbiB0YWJsZSAqLworICAgICAgICBmb3IoaSA9IDA7IGkgPCAyNDsgaSsrKQorICAgICAgICB7CisgICAgICAgICAgICBpZihSb29tU2l6ZSA8PSBMVlJFVl9HYWluUG9seVRhYmxlW2ldWzBdKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEluZGV4ID0gaTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisKKyAgICAgICAgaWYoUm9vbVNpemUgPT0gTFZSRVZfR2FpblBvbHlUYWJsZVtJbmRleF1bMF0pCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIFRha2UgdGFibGUgdmFsdWVzIGlmIHRoZSByb29tIHNpemUgaXMgaW4gdGFibGUgKi8KKyAgICAgICAgICAgIGZvcihpID0gMTsgaSA8IDU7IGkrKykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBDb2Vmc1tpLTFdID0gTFZSRVZfR2FpblBvbHlUYWJsZVtJbmRleF1baV07CisgICAgICAgICAgICB9CisgICAgICAgICAgICBDb2Vmc1s0XSA9IDA7CisgICAgICAgICAgICBHYWluID0gTFZNX1BvbHlub21pYWwoMywgQ29lZnMsIFQ2MCk7ICAgICAgIC8qIFEuMjQgcmVzdWx0ICovCisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICAvKiBJbnRlcnBvbGF0ZSB0aGUgZ2FpbiBiZXR3ZWVuIG5lYXJlc3Qgcm9vbSBzaXplcyAqLworCisgICAgICAgICAgICBMVk1fRkxPQVQgR2FpbjEsR2FpbjI7CisgICAgICAgICAgICBMVk1fSU5UMzIgVG90X0Rpc3QsRGlzdDsKKworICAgICAgICAgICAgVG90X0Rpc3QgPSAoTFZNX1VJTlQzMilMVlJFVl9HYWluUG9seVRhYmxlW0luZGV4XVswXSAtIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9VSU5UMzIpTFZSRVZfR2FpblBvbHlUYWJsZVtJbmRleC0xXVswXTsKKyAgICAgICAgICAgIERpc3QgPSBSb29tU2l6ZSAtIChMVk1fVUlOVDMyKUxWUkVWX0dhaW5Qb2x5VGFibGVbSW5kZXggLSAxXVswXTsKKworCisgICAgICAgICAgICAvKiBHZXQgZ2FpbiBmb3IgZmlyc3QgKi8KKyAgICAgICAgICAgIGZvcihpID0gMTsgaSA8IDU7IGkrKykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBDb2Vmc1tpLTFdID0gTFZSRVZfR2FpblBvbHlUYWJsZVtJbmRleC0xXVtpXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIENvZWZzWzRdID0gMDsKKworICAgICAgICAgICAgR2FpbjEgPSBMVk1fUG9seW5vbWlhbCgzLCBDb2VmcywgVDYwKTsgICAgICAvKiBRLjI0IHJlc3VsdCAqLworCisgICAgICAgICAgICAvKiBHZXQgZ2FpbiBmb3Igc2Vjb25kICovCisgICAgICAgICAgICBmb3IoaSA9IDE7IGkgPCA1OyBpKyspCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgQ29lZnNbaS0xXSA9IExWUkVWX0dhaW5Qb2x5VGFibGVbSW5kZXhdW2ldOworICAgICAgICAgICAgfQorICAgICAgICAgICAgQ29lZnNbNF0gPSAwOworCisgICAgICAgICAgICBHYWluMiA9IExWTV9Qb2x5bm9taWFsKDMsIENvZWZzLCBUNjApOyAgICAgIC8qIFEuMjQgcmVzdWx0ICovCisKKyAgICAgICAgICAgIC8qIExpbmVhciBJbnRlcnBvbGF0ZSB0aGUgZ2FpbiAqLworICAgICAgICAgICAgR2FpbiA9IEdhaW4xICsgKCgoR2FpbjIgLSBHYWluMSkgKiBEaXN0KSAvIChUb3RfRGlzdCkpOworICAgICAgICB9CisKKworICAgICAgICAvKgorICAgICAgICAgKiBHZXQgdGhlIGludmVyc2Ugb2YgZ2FpbjogUS4xNQorICAgICAgICAgKiBHYWluIGlzIG1vc3RseSBhYm92ZSBvbmUgZXhjZXB0IGZldyBjYXNlcywgdGFrZSBvbmx5IGdhaW5zIGFib3ZlIDEKKyAgICAgICAgICovCisgICAgICAgIGlmKEdhaW4gPCAxKQorICAgICAgICB7CisgICAgICAgICAgICBwUHJpdmF0ZS0+R2FpbiA9IDE7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBwUHJpdmF0ZS0+R2FpbiA9IDEgLyBHYWluOworICAgICAgICB9CisKKyAgICAgICAgSW5kZXhfRkxPQVQgPSAxMDAuMGYgLyAoTFZNX0ZMT0FUKSgxMDAgKyBwUHJpdmF0ZS0+TmV3UGFyYW1zLkxldmVsKTsKKyAgICAgICAgcFByaXZhdGUtPkdhaW4gPSBwUHJpdmF0ZS0+R2FpbiAqIEluZGV4X0ZMT0FUOworICAgICAgICBwUHJpdmF0ZS0+R2Fpbk1peGVyLlRhcmdldCA9IChwUHJpdmF0ZS0+R2FpbipJbmRleF9GTE9BVCkgLyAyOworICAgIH0KKworCisgICAgLyoKKyAgICAgKiBVcGRhdGUgdGhlIGFsbCBwYXNzIGNvbWIgZmlsdGVyIGNvZWZmaWNpZW50CisgICAgICovCisgICAgaWYoIChwUHJpdmF0ZS0+TmV3UGFyYW1zLkRlbnNpdHkgIT0gcFByaXZhdGUtPkN1cnJlbnRQYXJhbXMuRGVuc2l0eSkgfHwKKyAgICAgICAgKHBQcml2YXRlLT5iRmlyc3RDb250cm9sICAgICA9PSBMVk1fVFJVRSkpCisgICAgeworICAgICAgICBMVk1fSU5UMTYgICBpOworICAgICAgICBMVk1fRkxPQVQgICBiID0gKExWTV9GTE9BVClwUHJpdmF0ZS0+TmV3UGFyYW1zLkRlbnNpdHkgKiBMVlJFVl9CXzhfb25fMTAwMDsKKworICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNDsgaSsrKQorICAgICAgICB7CisgICAgICAgICAgICBwUHJpdmF0ZS0+TWl4ZXJfU0dGZWVkYmFja1tpXS5UYXJnZXQgICAgPSBiOworICAgICAgICAgICAgcFByaXZhdGUtPk1peGVyX1NHRmVlZGZvcndhcmRbaV0uVGFyZ2V0ID0gYjsKKyAgICAgICAgfQorICAgIH0KKworCisgICAgLyoKKyAgICAgKiBVcGRhdGUgdGhlIGJ5cGFzcyBtaXhlciB0aW1lIGNvbnN0YW50CisgICAgICovCisgICAgaWYoKHBQcml2YXRlLT5OZXdQYXJhbXMuU2FtcGxlUmF0ZSAgICE9IHBQcml2YXRlLT5DdXJyZW50UGFyYW1zLlNhbXBsZVJhdGUpICAgfHwKKyAgICAgICAocFByaXZhdGUtPmJGaXJzdENvbnRyb2wgICAgICAgICAgPT0gTFZNX1RSVUUpKQorICAgIHsKKyAgICAgICAgTFZNX1VJTlQxNiAgIE51bUNoYW5uZWxzID0gMTsgICAgICAgICAgICAgICAgICAgICAgIC8qIEFzc3VtZSBNT05PIGZvcm1hdCAqLworICAgICAgICBMVk1fRkxPQVQgICAgQWxwaGE7CisKKyAgICAgICAgQWxwaGEgPSBMVk1fTWl4ZXJfVGltZUNvbnN0YW50KExWUkVWX0ZFRURCQUNLTUlYRVJfVEMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fR2V0RnNGcm9tVGFibGUocFByaXZhdGUtPk5ld1BhcmFtcy5TYW1wbGVSYXRlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE51bUNoYW5uZWxzKTsKKyAgICAgICAgcFByaXZhdGUtPkZlZWRiYWNrTWl4ZXJbMF0uQWxwaGEgPSBBbHBoYTsKKyAgICAgICAgcFByaXZhdGUtPkZlZWRiYWNrTWl4ZXJbMV0uQWxwaGEg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FByaXZhdGUtPkJ5cGFzc01peGVyLlRhcmdldDEgPSAweDAwMDAwMDAwOworICAgICAgICBpZiAoKHBQcml2YXRlLT5OZXdQYXJhbXMuTGV2ZWwgPT0gMCkgJiYgKHBQcml2YXRlLT5iRmlyc3RDb250cm9sID09IExWTV9GQUxTRSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBQcml2YXRlLT5CeXBhc3NNaXhlci5DYWxsYmFja1NldDIgPSBMVk1fVFJVRTsKKyAgICAgICAgfQorICAgICAgICBpZiAocFByaXZhdGUtPk5ld1BhcmFtcy5MZXZlbCAhPSAwKQorICAgICAgICB7CisgICAgICAgICAgICBwUHJpdmF0ZS0+YkRpc2FibGVSZXZlcmIgPSBMVk1fRkFMU0U7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBpZihwUHJpdmF0ZS0+TmV3UGFyYW1zLk9wZXJhdGluZ01vZGUgIT0gcFByaXZhdGUtPkN1cnJlbnRQYXJhbXMuT3BlcmF0aW5nTW9kZSkKKyAgICB7CisgICAgICAgIGlmKHBQcml2YXRlLT5OZXdQYXJhbXMuT3BlcmF0aW5nTW9kZSA9PSBMVk1fTU9ERV9PTikKKyAgICAgICAgeworICAgICAgICAgICAgcFByaXZhdGUtPkJ5cGFzc01peGVyLlRhcmdldDIgPSAoTFZNX0ZMT0FUKShwUHJpdmF0ZS0+TmV3UGFyYW1zLkxldmVsICkgLyAxMDAuMGY7CisgICAgICAgICAgICBwUHJpdmF0ZS0+QnlwYXNzTWl4ZXIuVGFyZ2V0MSA9IDB4MDAwMDAwMDA7CisKKyAgICAgICAgICAgIHBQcml2YXRlLT5CeXBhc3NNaXhlci5DYWxsYmFja1NldDIgPSBMVk1fRkFMU0U7CisgICAgICAgICAgICBPcGVyYXRpbmdNb2RlICAgICAgICAgICAgICAgICAgICAgID0gTFZNX01PREVfT047CisgICAgICAgICAgICBpZiAocFByaXZhdGUtPk5ld1BhcmFtcy5MZXZlbCA9PSAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBQcml2YXRlLT5iRGlzYWJsZVJldmVyYiA9IExWTV9UUlVFOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBQcml2YXRlLT5iRGlzYWJsZVJldmVyYiA9IExWTV9GQUxTRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChwUHJpdmF0ZS0+YkZpcnN0Q29udHJvbCA9PSBMVk1fRkFMU0UpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBQcml2YXRlLT5CeXBhc3NNaXhlci5UYXJnZXQyID0gMHgwMDAwMDAwMDsKKyAgICAgICAgICAgIHBQcml2YXRlLT5CeXBhc3NNaXhlci5UYXJnZXQxID0gMHgwMDAwMDAwMDsKKyAgICAgICAgICAgIHBQcml2YXRlLT5CeXBhc3NNaXhlci5DYWxsYmFja1NldDIgPSBMVk1fVFJVRTsKKyAgICAgICAgICAgIHBQcml2YXRlLT5HYWluTWl4ZXIuVGFyZ2V0ICAgID0gMC4wMzEyNWY7CisgICAgICAgICAgICBPcGVyYXRpbmdNb2RlID0gTFZNX01PREVfT047CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBPcGVyYXRpbmdNb2RlID0gTFZNX01PREVfT0ZGOworICAgICAgICB9CisgICAgfQorCisKKyAgICAvKiAgSWYgaXQgaXMgdGhlIGZpcnN0IGNhbGwgdG8gQXBwbHlOZXcgc2V0dGluZ3MgZm9yY2UgdGhlIGN1cnJlbnQgdG8gdGhlIHRhcmdldCBcCisgICAgICAgIHRvIGJlZ2luIGltbWVkaWF0ZSBwbGF5YmFjayBvZiB0aGUgZWZmZWN0ICovCisgICAgaWYocFByaXZhdGUtPmJGaXJzdENvbnRyb2wgPT0gTFZNX1RSVUUpCisgICAgeworICAgICAgICBwUHJpdmF0ZS0+QnlwYXNzTWl4ZXIuQ3VycmVudDEgPSBwUHJpdmF0ZS0+QnlwYXNzTWl4ZXIuVGFyZ2V0MTsKKyAgICAgICAgcFByaXZhdGUtPkJ5cGFzc01peGVyLkN1cnJlbnQyID0gcFByaXZhdGUtPkJ5cGFzc01peGVyLlRhcmdldDI7CisgICAgfQorCisKKyAgICAvKgorICAgICAqIENvcHkgdGhlIG5ldyBwYXJhbWV0ZXJzCisgICAgICovCisgICAgcFByaXZhdGUtPkN1cnJlbnRQYXJhbXMgPSBwUHJpdmF0ZS0+TmV3UGFyYW1zOworICAgIHBQcml2YXRlLT5DdXJyZW50UGFyYW1zLk9wZXJhdGluZ01vZGUgPSBPcGVyYXRpbmdNb2RlOworCisKKyAgICAvKgorICAgICAqIFVwZGF0ZSBmbGFnCisgICAgICovCisgICAgaWYocFByaXZhdGUtPmJGaXJzdENvbnRyb2wgPT0gTFZNX1RSVUUpCisgICAgeworICAgICAgICBwUHJpdmF0ZS0+YkZpcnN0Q29udHJvbCA9IExWTV9GQUxTRTsKKyAgICB9CisKKworICAgIHJldHVybiBMVlJFVl9TVUNDRVNTOworfQorI2VuZGlmIC8qQlVJTERfRkxPQVQqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICBCeXBhc3NNaXhlcl9DYWxsYmFjayAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL1JldmVyYi9zcmMvTFZSRVZfQ2xlYXJBdWRpb0J1ZmZlcnMuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9SZXZlcmIvc3JjL0xWUkVWX0NsZWFyQXVkaW9CdWZmZXJzLmMKaW5kZXggNmJiMWU4OC4uOTQ5MTAxNiAxMDA2NDQKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL1JldmVyYi9zcmMvTFZSRVZfQ2xlYXJBdWRpb0J1ZmZlcnMuYworKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvUmV2ZXJiL3NyYy9MVlJFVl9DbGVhckF1ZGlvQnVmZmVycy5jCkBAIC02MSwxNiArNjEsMjYgQEAKICAgICAgKiBDbGVhciBhbGwgZmlsdGVyIHRhcCBkYXRhLCBkZWxheS1saW5lcyBhbmQgb3RoZXIgc2lnbmFsIHJlbGF0ZWQgZGF0YQogICAgICAqLwogCi0KKyNpZmRlZiBCVUlMRF9GTE9BVAorICAgIExvYWRDb25zdF9GbG9hdCgwLAorICAgICAgICAgICAgICAgICAgICAodm9pZCAqKSZwTFZSRVZfUHJpdmF0ZS0+cEZhc3REYXRhLT5IUFRhcHMsIC8qIERlc3RpbmF0aW9uIENhc3QgdG8gdm9pZDogXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vIGRlcmVmZXJlbmNpbmcgaW4gZnVuY3Rpb24qLworICAgICAgICAgICAgICAgICAgICAyKTsKKyAgICBMb2FkQ29uc3RfRmxvYXQoMCwKKyAgICAgICAgICAgICAgICAgICAgKHZvaWQgKikmcExWUkVWX1ByaXZhdGUtPnBGYXN0RGF0YS0+TFBUYXBzLCAvKiBEZXN0aW5hdGlvbiBDYXN0IHRvIHZvaWQ6IFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBubyBkZXJlZmVyZW5jaW5nIGluIGZ1bmN0aW9uKi8KKyAgICAgICAgICAgICAgICAgICAgMik7CisjZWxzZQogICAgIExvYWRDb25zdF8zMigwLAogICAgICAgICAodm9pZCAqKSZwTFZ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S0+UmVnaW9uW0xWTV9QRVJTSVNURU5UX1NMT1dfREFUQV0ucEJhc2VBZGRyZXNzLAorICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KSgocE1lbW9yeVRhYmxlLT5SZWdpb25bTFZNX1BFUlNJU1RFTlRfU0xPV19EQVRBXS5TaXplKSAvIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoTFZNX0ZMT0FUKSkpOworICAgIExvYWRDb25zdF9GbG9hdCgwLAorICAgICAgICAgICAgICAgICAgICAoTFZNX0ZMT0FUICopcE1lbW9yeVRhYmxlLT5SZWdpb25bTFZNX1BFUlNJU1RFTlRfRkFTVF9EQVRBXS5wQmFzZUFkZHJlc3MsCisgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpKChwTWVtb3J5VGFibGUtPlJlZ2lvbltMVk1fUEVSU0lTVEVOVF9GQVNUX0RBVEFdLlNpemUpIC8gXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihMVk1fRkxPQVQpKSk7CisgICAgTG9hZENvbnN0X0Zsb2F0KDAsCisgICAgICAgICAgICAgICAgICAgIChMVk1fRkxPQVQgKilwTWVtb3J5VGFibGUtPlJlZ2lvbltMVk1fUEVSU0lTVEVOVF9GQVNUX0NPRUZdLnBCYXNlQWRkcmVzcywKKyAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNikoKHBNZW1vcnlUYWJsZS0+UmVnaW9uW0xWTV9QRVJTSVNURU5UX0ZBU1RfQ09FRl0uU2l6ZSkgLyBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKExWTV9GTE9BVCkpKTsKKyAgICBMb2FkQ29uc3RfRmxvYXQoMCwKKyAgICAgICAgICAgICAgICAgICAgKExWTV9GTE9BVCAqKXBNZW1vcnlUYWJsZS0+UmVnaW9u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HsKKyAgICAgICAgcExWUkVWX1ByaXZhdGUtPnBEZWxheV9UWzNdICAgICA9IEluc3RBbGxvY19BZGRNZW1iZXIoJkZhc3REYXRhLCBMVlJFVl9NQVhfVDNfREVMQVkgKiBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihMVk1fRkxPQVQpKTsKKyAgICAgICAgcExWUkVWX1ByaXZhdGUtPnBEZWxheV9UWzJdICAgICA9IEluc3RBbGxvY19BZGRNZW1iZXIoJkZhc3REYXRhLCBMVlJFVl9NQVhfVDJfREVMQVkgKiBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihMVk1fRkxPQVQpKTsKKyAgICAgICAgcExWUkVWX1ByaXZhdGUtPnBEZWxheV9UWzFdICAgICA9IEluc3RBbGxvY19BZGRNZW1iZXIoJkZhc3REYXRhLCBMVlJFVl9NQVhfVDFfREVMQVkgKiBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihMVk1fRkxPQVQpKTsKKyAgICAgICAgcExWUkVWX1ByaXZhdGUtPnBEZWxheV9UWzBdICAgICA9IEluc3RBbGxvY19BZGRNZW1iZXIoJkZhc3REYXRhLCBMVlJFVl9NQVhfVDBfREVMQVkgKiBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihMVk1fRkxPQVQpKTsKIAorICAgICAgICBmb3IoaSA9IDA7IGkgPCA0OyBpKyspCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIFNjcmF0Y2ggZm9yIGVhY2ggZGVsYXkgbGluZSBvdXRwdXQgKi8KKyAgICAgICAgICAgIHBMVlJFVl9Qcml2YXRlLT5wU2NyYXRjaERlbGF5TGluZVtpXSA9IEluc3RBbGxvY19BZGRNZW1iZXIoJlRlbXBvcmFyeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKExWTV9GTE9BVCkgKiBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1heEJsb2NrU2l6ZSk7CisgICAgICAgIH0KKworICAgICAgICBMb2FkQ29uc3RfRmxvYXQoMCwgcExWUkVWX1ByaXZhdGUtPnBEZWxheV9UWzNdLCBMVlJFVl9NQVhfVDNfREVMQVkpOworICAgICAgICBMb2FkQ29uc3RfRmxvYXQoMCwgcExWUkVWX1ByaXZhdGUtPnBEZWxheV9UWzJdLCBMVlJFVl9NQVhfVDJfREVMQVkpOworICAgICAgICBMb2FkQ29uc3RfRmxvYXQoMCwgcExWUkVWX1ByaXZhdGUtPnBEZWxheV9UWzFdLCBMVlJFVl9NQVhfVDFfREVMQVkpOworICAgICAgICBMb2FkQ29uc3RfRmxvYXQoMCwgcExWUkVWX1ByaXZhdGUtPnBEZWxheV9UWzBdLCBMVlJFVl9NQVhfVDBfREVMQVkpOworICAgIH0KKworICAgIGlmKHBJbnN0YW5jZVBhcmFtcy0+TnVtRGVsYXlzID09IExWUkVWX0RFTEFZTElORVNfMikKKyAgICB7CisgICAgICAgIHBMVlJFVl9Qcml2YXRlLT5wRGVsYXlfVFsxXSAgPSBJbnN0QWxsb2NfQWRkTWVtYmVyKCZGYXN0RGF0YSwgTFZSRVZfTUFYX1QxX0RFTEFZICogXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoTFZNX0ZMT0FUKSk7CisgICAgICAgIHBMVlJFVl9Qcml2YXRlLT5wRGVsYXlfVFswXSAgPSBJbnN0QWxsb2NfQWRkTWVtYmVyKCZGYXN0RGF0YSwgTFZSRVZfTUFYX1QwX0RFTEFZICogXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoTFZNX0ZMT0FUKSk7CisKKyAgICAgICAgZm9yKGkgPSAwOyBpIDwgMjsgaSsrKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBTY3JhdGNoIGZvciBlYWNoIGRlbGF5IGxpbmUgb3V0cHV0ICovCisgICAgICAgICAgICBwTFZSRVZfUHJpdmF0ZS0+cFNjcmF0Y2hEZWxheUxpbmVbaV0gPSBJbnN0QWxsb2NfQWRkTWVtYmVyKCZUZW1wb3JhcnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihMVk1fRkxPQVQpICogXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNYXhCbG9ja1NpemUpOworICAgICAgICB9CisKKyAgICAgICAgTG9hZENvbnN0X0Zsb2F0KDAsIHBMVlJFVl9Qcml2YXRlLT5wRGVsYXlfVFsxXSwgKExWTV9JTlQxNilMVlJFVl9NQVhfVDFfREVMQVkpOworICAgICAgICBMb2FkQ29uc3RfRmxvYXQoMCwgcExWUkVWX1ByaXZhdGUtPnBEZWxheV9UWzBdLCAoTFZNX0lOVDE2KUxWUkVWX01BWF9UMF9ERUxBWSk7CisgICAgfQorCisgICAgaWYocEluc3RhbmNlUGFyYW1zLT5OdW1EZWxheXMgPT0gTFZSRVZfREVMQVlMSU5FU18xKQorICAgIHsKKyAgICAgICAgcExWUkVWX1ByaXZhdGUtPnBEZWxheV9UWzBdICA9IEluc3RBbGxvY19BZGRNZW1iZXIoJkZhc3REYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVlJFVl9NQVhfVDBfREVMQVkgKiBzaXplb2YoTFZNX0ZMT0FUKSk7CisKKyAgICAgICAgZm9yKGkgPSAwOyBpIDwgMTsgaSsrKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBTY3JhdGNoIGZvciBlYWNoIGRlbGF5IGxpbmUgb3V0cHV0ICovCisgICAgICAgICAgICBwTFZSRVZfUHJpdmF0ZS0+cFNjcmF0Y2hEZWxheUxpbmVbaV0gPSBJbnN0QWxsb2NfQWRkTWVtYmVyKCZUZW1wb3JhcnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihMVk1fRkxPQVQpICogXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNYXhCbG9ja1NpemUpOworICAgICAgICB9CisKKyAgICAgICAgTG9hZENvbnN0X0Zsb2F0KDAsIHBMVlJFVl9Qcml2YXRlLT5wRGVsYXlfVFswXSwgKExWTV9JTlQxNilMVlJFVl9NQVhfVDBfREVMQVkpOworICAgIH0KKyNlbmRpZgogICAgIC8qIEFsbC1wYXNzIGRlbGF5IGJ1ZmZlciBhZGRyZXNzZXMgYW5kIHNpemVzICovCiAgICAgcExWUkVWX1ByaXZhdGUtPlRbMF0gICAgICAgICA9IExWUkVWX01BWF9UMF9ERUxBWTsKICAgICBwTFZSRVZfUHJpdmF0ZS0+VFsxXSAgICAgICAgID0gTFZSRVZfTUFYX1QxX0RFTEFZOwpAQCAtMjAwLDEwICsyNzgsMTkgQEAKIAogCiAgICAgcExWUkVWX1ByaXZhdGUtPnBGYXN0Q29lZiAgICAgICA9IEluc3RBbGxvY19BZGRNZW1iZXIoJkZhc3RDb2VmLCBzaXplb2YoTFZSRVZfRmFzdENvZWZfc3QpKTsgICAgICAgICAgICAgICAgICAgICAgICAvKiBGYXN0IGNvZWZmaWNpZW50IG1lbW9yeSBiYXNlIGFkZHJlc3MgKi8KKyNpZm5kZWYgQlVJTERfRkxP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WRkTWVtYmVyKCZUZW1wb3JhcnksIHNpemVvZihMVk1fSU5UMzIpICogTWF4QmxvY2tTaXplKTsgICAgICAvKiBBIFNjcmF0Y2ggYnVmZmVyIGZvciBlYWNoIGRlbGF5IGxpbmUgKi8KKyNlbHNlCisgICAgICAgICAgICAgICAgLyogQSBTY3JhdGNoIGJ1ZmZlciBmb3IgZWFjaCBkZWxheSBsaW5lICovCisgICAgICAgICAgICAgICAgSW5zdEFsbG9jX0FkZE1lbWJlcigmVGVtcG9yYXJ5LCBzaXplb2YoTFZNX0ZMT0FUKSAqIE1heEJsb2NrU2l6ZSk7CisjZW5kaWYKICAgICAgICAgICAgIH0KICAgICAgICAgfQogCkBAIC0yMTAsNyArMjM3LDEyIEBACiAgICAgICAgIHsKICAgICAgICAgICAgIGZvcihpPTA7IGk8MjsgaSsrKQogICAgICAgICAgICAgeworI2lmbmRlZiBCVUlMRF9GTE9BVAogICAgICAgICAgICAgICAgIEluc3RBbGxvY19BZGRNZW1iZXIoJlRlbXBvcmFyeSwgc2l6ZW9mKExWTV9JTlQzMikgKiBNYXhCbG9ja1NpemUpOyAgICAgIC8qIEEgU2NyYXRjaCBidWZmZXIgZm9yIGVhY2ggZGVsYXkgbGluZSAqLworI2Vsc2UKKyAgICAgICAgICAgICAgICAvKiBBIFNjcmF0Y2ggYnVmZmVyIGZvciBlYWNoIGRlbGF5IGxpbmUgKi8KKyAgICAgICAgICAgICAgICBJbnN0QWxsb2NfQWRkTWVtYmVyKCZUZW1wb3JhcnksIHNpemVvZihMVk1fRkxPQVQpICogTWF4QmxvY2tTaXplKTsKKyNlbmRpZgogICAgICAgICAgICAgfQogICAgICAgICB9CiAKQEAgLTIxOCw3ICsyNTAsMTIgQEAKICAgICAgICAgewogICAgICAgICAgICAgZm9yKGk9MDsgaTwxOyBpKyspCiAgICAgICAgICAgICB7CisjaWZuZGVmIEJVSUxEX0ZMT0FUCiAgICAgICAgICAgICAgICAgSW5zdEFsbG9jX0FkZE1lbWJlcigmVGVtcG9yYXJ5LCBzaXplb2YoTFZNX0lOVDMyKSAqIE1heEJsb2NrU2l6ZSk7ICAgICAgLyogQSBTY3JhdGNoIGJ1ZmZlciBmb3IgZWFjaCBkZWxheSBsaW5lICovCisjZWxzZQorICAgICAgICAgICAgICAgIC8qIEEgU2NyYXRjaCBidWZmZXIgZm9yIGVhY2ggZGVsYXkgbGluZSAqLworICAgICAgICAgICAgICAgIEluc3RBbGxvY19BZGRNZW1iZXIoJlRlbXBvcmFyeSwgc2l6ZW9mKExWTV9GTE9BVCkgKiBNYXhCbG9ja1NpemUpOworI2VuZGlmCiAgICAgICAgICAgICB9CiAgICAgICAgIH0KIApkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL1JldmVyYi9zcmMvTFZSRVZfUHJpdmF0ZS5oIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL1JldmVyYi9zcmMvTFZSRVZfUHJpdmF0ZS5oCmluZGV4IGZiZmE0MzcuLmZmNzQ3NWUgMTAwNjQ0Ci0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9SZXZlcmIvc3JjL0xWUkVWX1ByaXZhdGUuaAorKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvUmV2ZXJiL3NyYy9MVlJFVl9Qcml2YXRlLmgKQEAgLTQyLDE2ICs0MiwyNyBAQAogLyogIERlZmluZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmbmRlZiBCVUlMRF9GTE9BVAogLyogR2VuZXJhbCAqLwogI2RlZmluZSBPTkVfT1ZFUl9TUVJUX1RXTyAgICAgICAgICAgICAgIDIzMTcwICAgICAgICAgICAvKiAxL3NxcnQoMikgKiAyXjE1ICovCiAjZGVmaW5lIExWUkVWX0JfOF9vbl8xMDAwICAgICAgICAgICAgMTcxNzk4NjkgICAgICAgICAgIC8qIDAuOCAqIDJeMzEgKi8KICNkZWZpbmUgTFZSRVZfSEVBRFJPT00gICAgICAgICAgICAgICAgICAgODE5MiAgICAgICAgICAgLyogLTEyZEIgKiAyXjE1ICovCiAjZGVmaW5lIExWUkVWXzJfOV9JTlEyOSAgICAgICAgICAgMTU4Mzc2OTE5MEwgICAgICAgICAgIC8qIDIuOSBpbiBRMjkgZm9ybWF0ICovCiAjZGVmaW5lIExWUkVWX01JTjNEQiAgICAgICAgICAgICAgICAgICAweDVBODIgICAgICAgICAgIC8qIC0zZEIgaW4gUTE1IGZvcm1hdCAqLworI2Vsc2UKKy8qIEdlbmVyYWwgKi8KKyNkZWZpbmUgT05FX09WRVJfU1FSVF9UV08gICAgICAgICAgICAwLjcwNzEwN2YgICAgICAgICAgIC8qIDEvc3FydCgyKSAqIDJeMTUgKi8KKyNkZWZpbmUgTFZSRVZfQl84X29uXzEwMDAgICAgICAgICAgICAgICAwLjAwOGYgICAgICAgICAgIC8qIDAuOCAqIDJeMzEgKi8KKyNkZWZpbmUgTFZSRVZfSEVBRFJPT00gICAgICAgICAgICAgICAgICAgMC4yNWYgICAgICAgICAgIC8qIC0xMmRCICogMl4xNSAqLworI2RlZmluZSBMVlJFVl8yXzlfSU5RMjkgICAgICAgICAgICAgICAgICAgMi45ZiAgICAgICAgICAgLyogMi45IGluIFEyOSBmb3JtYXQgKi8KKyNkZWZpbmUgTFZSRVZfTUlOM0RCICAgICAgICAgICAgICAgIDAuNzA3OTQ1N2YgICAgICAgICAgIC8qIC0zZEIgaW4gUTE1IGZvcm1hdCAqLworI2VuZGlmCiAKIC8qIEludGVuYWwgY29uc3RhbnRzICovCiAjZGVmaW5lIExWUkVWX0xQX1BvbHlfT3JkZXIgICAgICAgICAgICAgICAgIDQKICNkZWZpbmUgTFZSRVZfTFBfUG9seV9TaGlmdCAgICAgICAgICAgICAgICAgNQorCisjaWZuZGVmIEJVSUxEX0ZMT0FUCiAjZGVmaW5lIExWUkVWX1RfM19Qb3dlcl8wX29uXzQgICAgICAgICAgMzI3NjgKICNkZWZpbmUgTFZSRVZfVF8zX1Bvd2VyXzFfb25fNCAgICAgICAgICA0MzEyNQogI2RlZmluZSBMVlJFVl9UXzNfUG93ZXJfMl9vbl80ICAgICAgICAgIDU2NzU1CkBAIC02MSwxNCArNzIsNDcgQEAKICNkZWZpbmUgTFZSRVZfVF8zX1Bvd2VyX21pbnVzMV9vbl80ICAgICAyNDg5OCAgICAgICAgICAgLyogM14oLTEvNCkgKiAyXjE1ICovCiAjZGVmaW5lIExWUkVWX1RfM19Qb3dlcl9taW51czJfb25fNCAgICAgMTg5MTkgICAgICAgICAgIC8qIDNeKC0yLzQpICogMl4xNSAqLwogI2RlZmluZSBMVlJFVl9UXzNfUG93ZXJfbWludXMzX29uXzQgICAgIDE0Mzc1ICAgICAgICAgICAvKiAzXigtMy80KSAqIDJeMTUgKi8KLSNkZWZpbmUgTFZSRVZfTUFYX1QzX0RFTEFZICAgICAgICAgICAgICAgMjUyNyAgICAgICAgICAgLyogKCg0ODAwMCAqIDEyMCAqIExWUkVWX1RfM19Qb3dlcl9taW51czNfb25fNCkgPj4gMTUpIC8gMTAwMCAqLwotI2RlZmluZSBMVlJFVl9NQVhfVDJfREVMQVkgICAgICAgICAgICAgICAzMzI2ICAgICAgICAgICAvKiAoKDQ4MDAwICogMTIwICogTFZSRVZfVF8zX1Bvd2VyX21pbnVzMl9vbl80KSA+PiAxNSkgLyAxMDAwICovCi0jZGVmaW5lIExWUkVWX01BWF9UMV9ERUxBWSAgICAgICAgICAgICAgIDQzNzcgICAgICAgICAgIC8qICgoNDgwMDAgKiAxMjAgKiBMVlJFVl9UXzNfUG93ZXJfbWludXMxX29uXzQpID4+IDE1KSAvIDEwMDAgKi8KLSNkZWZpbmUgTFZSRVZfTUFYX1QwX0RFTEFZICAgICAgICAgICAgICAgNTc2MCAgICAgICAgICAgLyogKCg0ODAwMCAqIDEyMCAqIExWUkVWX1RfM19Qb3dlcl9taW51czBfb25fNCkgPj4gMTUpIC8gMTAwMCAqLwotI2RlZmluZSBMVlJFVl9NQVhfQVAzX0RFTEFZICAgICAgICAgICAgICAxNjg1ICAgICAgICAgICAvKiAoKDQ4MDAwICogMTIwICogTFZSRVZfVF8zX1Bvd2VyX21pbnVzM19vbl80KSA+PiAxNSkgLyAxNTAwICovCi0jZGVmaW5lIExWUkVWX01BWF9BUDJfREVMQVkgICAgICAgICAgICAgIDIyMTggICAgICAgICAgIC8qICgoNDgwMDAgKiAxMjAgKiBMVlJFVl9UXzNfUG93ZXJfbWludXMyX29uXzQpID4+IDE1KSAvIDE1MDAgKi8KLSNkZWZpbmUgTFZSRVZfTUFYX0FQMV9ERUxBWSAgICAgICAgICAgICAgMjkxOCAgICAgICAgICAgLyogKCg0ODAwMCAqIDEyMCAqIExWUkVWX1RfM19Qb3dlcl9taW51czFfb25fNCkgPj4gMTUpIC8gMTUwMCAqLwotI2RlZmluZSBMVlJFVl9NQVhfQVAwX0RFTEFZICAgICAgICAgICAgICAzODQwICAgICAgICAgICAvKiAoKDQ4MDAwICogMTIwICogTFZSRVZfVF8zX1Bvd2VyX21pbnVzMF9vbl80KSA+PiAxNSkgLyAxNTAwICovCisjZWxzZS8qQlVJTERfRkxPQVQqLworI2RlZmluZSBMVlJFVl9UNjBfU0NBTEUgICAgICAgICAgICAgICAgMC4wMDAxNDJmICAgICAgICAgICAvKigxLzcwMDApICovCisKKyNkZWZpbmUgTFZSRVZfVF8zX1Bvd2VyXzBfb25fNCAgICAgICAgICAgICAgMS4wZgorI2RlZmluZSBMVlJFVl9UXzNfUG93ZXJfMV9vbl80ICAgICAgICAgMS4zMTYwNzRmCisjZGVmaW5lIExWUkVWX1RfM19Qb3dlcl8yX29uXzQgICAgICAgICAxLjczMjA1MWYKKyNkZWZpbmUgTFZSRVZfVF8zX1Bvd2VyXzNfb25fNCAgICAgICAgIDIuMjc5NTA3ZgorI2RlZmluZSBMVlJFVl9UXzNfUG93ZXJfbWludXMwX29uXzQgICAgICAgICAxLjBmICAgICAgICAvKiAzXigtMC80KSAqIDJeMTUgKi8KKyNkZWZpbmUgTFZSRVZfVF8zX1Bvd2VyX21pbnVzMV9vbl80ICAgIDAuNzU5ODM2ZiAgICAgICAgLyogM14oLTEvNCkgKiAyXjE1ICovCisjZGVmaW5lIExWUkVWX1RfM19Qb3dlcl9taW51czJfb25fNCAgICAwLjU3NzM1MGYgICAgICAgIC8qIDNeKC0yLzQpICogMl4xNSAqLworI2RlZmluZSBMVlJFVl9UXzNfUG93ZXJfbWludXMzX29uXzQgICAgMC40Mzg2OTFmICAgICAgICAvKiAzXigtMy80KSAqIDJeMTUgKi8KKyNlbmRpZgorCisjaWZuZGVmIEhJR0hFUl9GUworI2RlZmluZSBMVlJFVl9NQVhfVDNfREVMQVkgICAgICAgICAgICAgICAgMjUyNyAgICAgICAgICAgLyogKCg0ODAwMCAqIDEyMCAqIExWUkVWX1RfM19Qb3dlcl9taW51czNfb25fNCkgPj4gMTUpIC8gMTAwMCAqLworI2RlZmluZSBMVlJFVl9NQVhfVDJfREVMQVkgICAgICAgICAgICAgICAgMzMyNiAgICAgICAgICAgLyogKCg0ODAwMCAqIDEyMCAqIExWUkVWX1RfM19Qb3dlcl9taW51czJfb25fNCkgPj4gMTUpIC8gMTAwMCAqLworI2RlZmluZSBMVlJFVl9NQVhfVDFfREVMQVkgICAgICAgICAgICAgICAgNDM3NyAgICAgICAgICAgLyogKCg0ODAwMCAqIDEyMCAqIExWUkVWX1RfM19Qb3dlcl9taW51czFfb25fNCkgPj4gMTUpIC8gMTAwMCAqLworI2RlZmluZSBMVlJFVl9NQVhfVDBfREVMQVkgICAgICAgICAgICAgICAgNTc2MCAgICAgICAgICAgLyogKCg0ODAwMCAqIDEyMCAqIExWUkVWX1RfM19Qb3dlcl9taW51czBfb25fNCkgPj4gMTUpIC8gMTAwMCAqLworI2RlZmluZSBMVlJFVl9NQVhfQVAzX0RFTEFZICAgICAgICAgICAgICAgMTY4NSAgICAgICAgICAgLyogKCg0ODAwMCAqIDEyMCAqIExWUkVWX1RfM19Qb3dlcl9taW51czNfb25fNCkgPj4gMTUpIC8gMTUwMCAqLworI2RlZmluZSBMVlJFVl9NQVhfQVAyX0RFTEFZICAgICAgICAgICAgICAgMjIxOCAgICAgICAgICAgLyogKCg0ODAwMCAqIDEyMCAqIExWUkVWX1RfM19Qb3dlcl9taW51czJfb25fNCkgPj4gMTUpIC8gMTUwMCAqLworI2RlZmluZSBMVlJFVl9NQVhfQVAxX0RFTEFZICAgICAgICAgICAgICAgMjkxOCAgICAgICAgICAgLyogKCg0ODAwMCAqIDEyMCAqIExWUkVWX1RfM19Qb3dlcl9taW51czFfb25fNCkgPj4gMTUpIC8gMTUwMCAqLworI2RlZmluZSBMVlJFVl9NQVhfQVAwX0RFTEFZICAgICAgICAgICAgICAgMzg0MCAgICAgICAgICAgLyogKCg0ODAwMCAqIDEyMCAqIExWUkVWX1RfM19Qb3dlcl9taW51czBfb25fNCkgPj4gMTUpIC8gMTUwMCAqLworI2Vsc2UKKyAgICAvKiAoKDE5MjAwMCAqIDEyMCAqIExWUkVWX1RfM19Qb3dlcl9taW51czNfb25fNCkgPj4gMTUpIC8gMTAwMCAqLworI2RlZmluZSBMVlJFVl9NQVhfVDNfREVMQVkgICAgICAgICAgICAgICAxMDEwOAorICAgIC8qICgoMTkyMDAwICogMTIwICogTFZSRVZfVF8zX1Bvd2VyX21pbnVzMl9vbl80KSA+PiAxNSkgLyAxMDAwICovCisjZGVmaW5lIExWUkVWX01BWF9UMl9ERUxBWSAgICAgICAgICAgICAgIDEzMzA0CisgICAgLyogKCgxOTIwMDAgKiAxMjAgKiBMVlJFVl9UXzNfUG93ZXJfbWludXMxX29uXzQpID4+IDE1KSAvIDEwMDAgKi8KKyNkZWZpbmUgTFZSRVZfTUFYX1QxX0RFTEFZICAgICAgICAgICAgICAgMTc1MDgKKyAgICAvKiAoKDE5MjAwMCAqIDEyMCAqIExWUkVWX1RfM19Qb3dlcl9taW51czBfb25fNCkgPj4gMTUpIC8gMTAwMCAqLworI2RlZmluZSBMVlJFVl9NQVhfVDBfREVMQVkgICAgICAgICAgICAgICAyMzA0MAorICAgIC8qICgoMTkyMDAwICogMTIwICogTFZSRVZfVF8zX1Bvd2VyX21pbnVzM19vbl80KSA+PiAxNSkgLyAxNTAwICovCisjZGVmaW5lIExWUkVWX01BWF9BUDNfREVMQVkgICAgICAgICAgICAgICA2NzQwCisgICAgLyogKCgxOTIwMDAgKiAxMjAgKiBMVlJFVl9UXzNfUG93ZXJfbWludXMyX29uXzQpID4+IDE1KSAvIDE1MDAgKi8KKyNkZWZpbmUgTFZSRVZfTUFYX0FQMl9ERUxBWSAgICAgICAgICAgICAgIDg4NzIKKyAgICAvKiAoKDE5MjAwMCAqIDEyMCAqIExWUkVWX1RfM19Qb3dlcl9taW51czFfb25fNCkgPj4gMTUpIC8gMTUwMCAqLworI2RlZmluZSBMVlJFVl9NQVhfQVAxX0RFTEFZICAgICAgICAgICAgICAxMTY3MgorICAgIC8qICgoMTkyMDAwICogMTIwICogTFZSRVZfVF8zX1Bvd2VyX21pbnVzMF9vbl80KSA+PiAxNSkgLyAxNTAwICovCisjZGVmaW5lIExWUkVWX01BWF9BUDBfREVMQVkgICAgICAgICAgICAgIDE1MzYwCisjZW5kaWYKKwogI2RlZmluZSBMVlJFVl9CWVBBU1NNSVhFUl9UQyAgICAgICAgICAgICAxMDAwICAgICAgICAgICAvKiBCeXBhc3MgbWl4ZXIgdGltZSBjb25zdGFudCovCiAjZGVmaW5lIExWUkVWX0FMTFBBU1NfVEMgICAgICAgICAgICAgICAgIDEwMDAgICAgICAgICAgIC8qIEFsbC1wYXNzIGZpbHRlciB0aW1lIGNvbnN0YW50ICovCiAjZGVmaW5lIExWUkVWX0FMTFBBU1NfVEFQX1RDICAgICAgICAgICAgIDEwMDAwICAgICAgICAgICAvKiBBbGwtcGFzcyBmaWx0ZXIgZGVseSB0YXAgY2hhbmdlICovCkBAIC03Niw3ICsxMjAsMTIgQEAKICNkZWZpbmUgTFZSRVZfT1VUUFVUR0FJTl9TSElGVCAgICAgICAgICAgICAgNSAgICAgICAgICAgLyogQml0cyBzaGlmdCBmb3Igb3V0cHV0IGdhaW4gY29ycmVjdGlvbiAqLwogCiAvKiBQYXJhbWV0ZXIgbGltaXRzICovCisjaWZuZGVmIEhJR0hFUl9GUwogI2RlZmluZSBMVlJFVl9OVU1fRlMgICAgICAgICAgICAgICAgICAgICAgICA5ICAgICAgICAgICAvKiBOdW1iZXIgb2Ygc3VwcG9ydGVkIHNhbXBsZSByYXRlcyAqLworI2Vsc2UKKyNkZWZpbmUgTFZSRVZfTlVNX0ZTICAgICAgICAgICAgICAgICAgICAgICAxMSAgICAgICAgICAgLyogTnVtYmVyIG9mIHN1cHBvcnRlZCBzYW1wbGUgcmF0ZXMgKi8KKyNlbmRpZgorCiAjZGVmaW5lIExWUkVWX01BWEJMS1NJWkVfTElNSVQgICAgICAgICAgICAgNjQgICAgICAgICAgIC8qIE1heGltdW0gYmxvY2sgc2l6ZSBsb3cgbGltaXQgKi8KICNkZWZpbmUgTFZSRVZfTUFYX0xFVkVMICAgICAgICAgICAgICAgICAgIDEwMCAgICAgICAgICAgLyogTWF4aW11bSBsZXZlbCwgMTAwJSAqLwogI2RlZmluZSBMVlJFVl9NSU5fTFBGX0NPUk5FUiAgICAgICAgICAgICAgIDUwICAgICAgICAgICAvKiBMb3cgcGFzcyBmaWx0ZXIgbGltaXRzICovCkBAIC05NSw2ICsxNDQsNyBAQAogLyogIFN0cnVjdHVyZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmbmRlZiBCVUlMRF9GTE9BVAogLyogRmFzdCBkYXRhIHN0cnVjdHVyZSAqLwogdHlwZWRlZiBzdHJ1Y3QKIHsKQEAgLTE2MSw3ICsyMTEsODEgQEAKIAogfSBMVlJFVl9JbnN0YW5jZV9zdDsKIAorI2Vsc2UgLyogQlVJTERfRkxPQVQgKi8KIAorLyogRmFzdCBkYXRhIHN0cnVjdHVyZSAqLwordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgICBCaXF1YWRfMUlfT3JkZXIxX0ZMT0FUX1RhcHNfdCBIUFRhcHM7ICAgICAgICAgICAgICAgICAgICAgLyogSGlnaCBwYXNzIGZpbHRlciB0YXBzICovCisgICAgQmlxdWFkXzFJX09yZGVyMV9GTE9BVF9UYXBzX3QgTFBUYXBzOyAgICAgICAgICAgICAgICAgICAgIC8qIExvdyBwYXNzIGZpbHRlciB0YXBzICovCisgICAgQmlxdWFkXzFJX09yZGVyMV9GTE9BVF9UYXBzX3QgUmV2TFBUYXBzWzRdOyAgICAgICAgICAgICAgIC8qIFJldmVyYiBsb3cgcGFzcyBmaWx0ZXJzIHRhcHMgKi8KKworfSBMVlJFVl9GYXN0RGF0YV9zdDsKKworCisvKiBGYXN0IGNvZWZmaWNpZW50IHN0cnVjdHVyZSAqLwordHlwZWRlZiBzdHJ1Y3QKK3sKKworICAgIEJpcXVhZF9GTE9BVF9JbnN0YW5jZV90ICAgICAgIEhQQ29lZnM7ICAgICAgICAgICAgICAvKiBIaWdoIHBhc3MgZmlsdGVyIGNvZWZmaWNpZW50cyAqLworICAgIEJpcXVhZF9GTE9BVF9JbnN0YW5jZV90ICAgICAgIExQQ29lZnM7ICAgICAgICAgICAgICAvKiBMb3cgcGFzcyBmaWx0ZXIgY29lZmZpY2llbnRzICovCisgICAgQmlxdWFkX0ZMT0FUX0luc3RhbmNlX3QgICAgICAgUmV2TFBDb2Vmc1s0XTsgICAgICAgIC8qIFJldmVyYiBsb3cgcGFzcyBmaWx0ZXJzIGNvZWZmaWNpZW50cyAqLworCit9IExWUkVWX0Zhc3RDb2VmX3N0OwordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgICAvKiBHZW5lcmFsICovCisgICAgTFZSRVZfSW5zdGFuY2VQYXJhbXNfc3QgSW5zdGFuY2VQYXJhbXM7ICAgICAgICAgICAvKiBJbml0aWFsaXNhdGlvbiB0aW1lIGluc3RhbmNlIHBhcmFtZXRlcnMgKi8KKyAgICBMVlJFVl9NZW1vcnlUYWJsZV9zdCAgICBNZW1vcnlUYWJsZTsgICAgICAgICAgICAgIC8qIE1lbW9yeSB0YWJsZSAqLworICAgIExWUkVWX0NvbnRyb2xQYXJhbXNfc3QgIEN1cnJlbnRQYXJhbXM7ICAgICAgICAgICAgLyogUGFyYW1ldGVycyBiZWluZyB1c2VkICovCisgICAgTFZSRVZfQ29udHJvbFBhcmFtc19zdCAgTmV3UGFyYW1zOyAgICAgICAgICAgICAgICAvKiBOZXcgcGFyYW1ldGVycyBmcm9tIHRoZSBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYWxsaW5nIGFwcGxpY2F0aW9uICovCisgICAgTFZNX0NIQVIgICAgICAgICAgICAgICAgYkNvbnRyb2xQZW5kaW5nOyAgICAgICAgICAvKiBGbGFnIHRvIGluZGljYXRlIG5ldyBwYXJhbWV0ZXJzIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZSBhdmFpbGFibGUgKi8KKyAgICBMVk1fQ0hBUiAgICAgICAgICAgICAgICBiRmlyc3RDb250cm9sOyAgICAgICAgICAgIC8qIEZsYWcgdG8gaW5kaWNhdGUgdGhhdCB0aGUgY29udHJvbCBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBpcyBjYWxsZWQgZm9yIHRoZSBmaXJzdCB0aW1lICovCisgICAgTFZNX0NIQVIgICAgICAgICAgICAgICAgYkRpc2FibGVSZXZlcmI7ICAgICAgICAgICAvKiBGbGFnIHRvIGluZGljYXRlIHRoYXQgdGhlIG1peCBsZXZlbCBpcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCUgYW5kIHRoZSByZXZlcmIgY2FuIGJlIGRpc2FibGVkICovCisgICAgTFZNX0lOVDMyICAgICAgICAgICAgICAgUm9vbVNpemVJbm1zOyAgICAgICAgICAgICAvKiBSb29tIHNpemUgaW4gbXNlYyAqLworICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgIE1heEJsa0xlbjsgICAgICAgICAgICAgICAgLyogTWF4aW11bSBibG9jayBzaXplIGZvciBpbnRlcm5hbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvY2Vzc2luZyAqLworCisgICAgLyogQWxpZ25lZCBtZW1vcnkgcG9pbnRlcnMgKi8KKyAgICBMVlJFVl9GYXN0RGF0YV9zdCAgICAgICAqcEZhc3REYXRhOyAgICAgICAgICAgICAgIC8qIEZhc3QgZGF0YSBtZW1vcnkgYmFzZSBhZGRyZXNzICovCisgICAgTFZSRVZfRmFzdENvZWZfc3QgICAgICAgKnBGYXN0Q29lZjsgICAgICAgICAgICAgICAvKiBGYXN0IGNvZWZmaWNpZW50IG1lbW9yeSBiYXNlIGFkZHJlc3MgKi8KKyAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAqcFNjcmF0Y2hEZWxheUxpbmVbNF07ICAgIC8qIERlbGF5IGxpbmUgc2NyYXRjaCBtZW1vcnkgKi8KKyAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAqcFNjcmF0Y2g7ICAgICAgICAgICAgICAgIC8qIE11bHRpIHVzc2dlIHNjcmF0Y2ggKi8KKyAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAqcElucHV0U2F2ZTsgICAgICAgICAgICAgIC8qIFJldmVyYiBibG9jayBpbnB1dCBzYXZlIGZvciBkcnkvd2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtaXhpbmcqLworCisgICAgLyogRmVlZGJhY2sgbWF0cml4ICovCisgICAgTWl4XzFTdF9DbGxfRkxPQVRfdCAgICAgRmVlZGJhY2tNaXhlcls0XTsgICAgICAgICAvKiBNaXhlciBmb3IgUG9wIGFuZCBDbGljayBTdXByZXNzaW9uIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhdXNlZCBieSBmZWVkYmFjayBHYWluICovCisKKworICAgIC8qIEFsbC1QYXNzIEZpbHRlciAqLworICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgIFRbNF07ICAgICAgICAgICAgICAgICAgICAgLyogTWF4aW11bSBkZWxheSBzaXplIG9mIGJ1ZmZlciAqLworICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICpwRGVsYXlfVFs0XTsgICAgICAgICAgICAgLyogUG9pbnRlciB0byBkZWxheSBidWZmZXJzICovCisgICAgTFZNX0lOVDMyICAgICAgICAgICAgICAgRGVsYXlfQVBbNF07ICAgICAgICAgICAgICAvKiBPZmZzZXQgdG8gQVAgZGVsYXkgYnVmZmVyIHN0YXJ0ICovCisgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgQUJfU2VsZWN0aW9uOyAgICAgICAgICAgICAvKiBTbW9vdGggZnJvbSB0YXAgQSB0byBCIHdoZW4gMSBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdGhlcndpc2UgQiB0byBBICovCisgICAgTFZNX0lOVDMyICAgICAgICAgICAgICAgQV9EZWxheVNpemVbNF07ICAgICAgICAgICAvKiBBIGRlbGF5IGxlbmd0aCBpbiBzYW1wbGVzICovCisgICAgTFZNX0lOVDMyICAgICAgICAgICAgICAgQl9EZWxheVNpemVbNF07ICAgICAgICAgICAvKiBCIGRlbGF5IGxlbmd0aCBpbiBzYW1wbGVzICovCisgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICAgKnBPZmZzZXRBWzRdOyAgICAgICAgICAgICAvKiBPZmZzZXQgZm9yIHRoZSBBIGRlbGF5IHRhcCAqLworICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICpwT2Zmc2V0Qls0XTsgICAgICAgICAgICAgLyogT2Zmc2V0IGZvciB0aGUgQiBkZWxheSB0YXAgKi8KKyAgICBNaXhfMlN0X0NsbF9GTE9BVF90ICAgICBNaXhlcl9BUFRhcHNbNF07ICAgICAgICAgIC8qIFNtb290aGVkIEFQIGRlbGF5IG1peGVyICovCisgICAgTWl4XzFTdF9DbGxfRkxPQVRfdCAgICAgTWl4ZXJfU0dGZWVkYmFja1s0XTsgICAgICAvKiBTbW9vdGhlZCBTQWZlZWRiYWNrIGdhaW4gKi8KKyAgICBNaXhfMVN0X0NsbF9GTE9BVF90ICAgICBNaXhlcl9TR0ZlZWRmb3J3YXJkWzRdOyAgIC8qIFNtb290aGVkIEFQIGZlZWRmb3J3YXJkIGdhaW4gKi8KKworICAgIC8qIE91dHB1dCBnYWluICovCisgICAgTWl4XzJTdF9DbGxfRkxPQVRfdCAgICAgQnlwYXNzTWl4ZXI7ICAgICAgICAgICAgICAvKiBEcnkvd2V0IG1peGVyICovCisgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICAgR2FpbjsgICAgICAgICAgICAgICAgICAgICAvKiBHYWluIGFwcGxpZWQgdG8gb3V0cHV0IHRvIG1haW50YWluCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdmVyYWdlIHNpZ25hbCBwb3dlciAqLworICAgIE1peF8xU3RfQ2xsX0ZMT0FUX3QgICAgIEdhaW5NaXhlcjsgICAgICAgICAgICAgICAgLyogR2FpbiBzbW9vdGhpbmcgKi8KKworfSBMVlJFVl9JbnN0YW5jZV9zdDsKKworI2VuZGlmCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogIEZ1bmN0aW9uIHByb3RvdHlwZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCkBAIC0xNjksMTIgKzI5MywxNyBAQAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIExWUkVWX1JldHVyblN0YXR1c19lbiAgIExWUkVWX0FwcGx5TmV3U2V0dGluZ3MoTFZSRVZfSW5zdGFuY2Vfc3QgICAgICpwUHJpdmF0ZSk7Ci0KKyNpZmRlZiBCVUlMRF9GTE9BVAordm9pZCAgICAgICAgICAgICAgICAgICAgUmV2ZXJiQmxvY2soTFZNX0ZMT0FUICAgICAgICAgICAqcElucHV0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICAqcE91dHB1dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWUkVWX0luc3RhbmNlX3N0ICAgKnBQcml2YXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiAgICAgICAgICBOdW1TYW1wbGVzKTsKKyNlbHNlCiB2b2lkICAgICAgICAgICAgICAgICAgICBSZXZlcmJCbG9jayhMVk1fSU5UMzIgICAgICAgICAgICpwSW5wdXQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgICAgICAgICpwT3V0cHV0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZSRVZfSW5zdGFuY2Vfc3QgICAqcFByaXZhdGUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDE2ICAgICAgICAgIE51bVNhbXBsZXMpOwotCisjZW5kaWYKIExWTV9JTlQzMiAgICAgICAgICAgICAgIEJ5cGFzc01peGVyX0NhbGxiYWNrKHZvaWQgICAgICAgKnBDYWxsYmFja0RhdGEsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICpwR2VuZXJhbFB1cnBvc2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgIEdlbmVyYWxQdXJwb3NlICk7CmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvUmV2ZXJiL3NyYy9MVlJFVl9Qcm9jZXNzLmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvUmV2ZXJiL3NyYy9MVlJFVl9Qcm9jZXNzLmMKaW5kZXggNWM3YThhMC4uNTY2ZDg0ZiAxMDA2NDQKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL1JldmVyYi9zcmMvTFZSRVZfUHJvY2Vzcy5jCisrKyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9SZXZlcmIvc3JjL0xWUkVWX1Byb2Nlc3MuYwpAQCAtNDYsMTQgKzQ2LDI2IEBACiAvKiAgMS4gVGhlIGlucHV0IGFuZCBvdXRwdXQgYnVmZmVycyBtdXN0IGJlIDMyLWJpdCBhbGlnbmVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQlVJTERfRkxPQVQKK0xWUkVWX1JldHVyblN0YXR1c19lbiBMVlJFVl9Qcm9jZXNzKExWUkVWX0hhbmRsZV90ICAgICAgaEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICAgICAqcEluRGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgKnBPdXREYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX1VJTlQxNiAgICBOdW1TYW1wbGVzKQorI2Vsc2UKIExWUkVWX1JldHVyblN0YXR1c19lbiBMVlJFVl9Qcm9jZXNzKExWUkVWX0hhbmRsZV90ICAgICAgaEluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDMyICAgICAqcEluRGF0YSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgKnBPdXREYXRhLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX1VJTlQxNiAgICBOdW1TYW1wbGVzKQorI2VuZGlmCiB7CiAgICBMVlJFVl9JbnN0YW5jZV9zdCAgICAgKnBMVlJFVl9Qcml2YXRlID0gKExWUkVWX0luc3RhbmNlX3N0ICopaEluc3RhbmNlOworI2lmZGVmIEJVSUxEX0ZMT0FUCisgICBMVk1fRkxPQVQgICAgICAgICAgICAgKnBJbnB1dCAgPSAoTFZNX0ZMT0FUICopcEluRGF0YTsKKyAgIExWTV9GTE9BVCAgICAgICAgICAgICAqcE91dHB1dCA9IHBPdXREYXRhOworI2Vsc2UKICAgIExWTV9JTlQzMiAgICAgICAgICAgICAqcElucHV0ICA9IChMVk1fSU5UMzIgKilwSW5EYXRhOwogICAgTFZNX0lOVDMyICAgICAgICAgICAgICpwT3V0cHV0ID0gcE91dERhdGE7CisjZW5kaWYKICAgIExWTV9JTlQzMiAgICAgICAgICAgICBTYW1wbGVzVG9Qcm9jZXNzLCBSZW1haW5pbmdTYW1wbGVzOwogICAgTFZNX0lOVDMyICAgICAgICAgICAgIGZvcm1hdCA9IDE7CiAKQEAgLTEwNSw3ICsxMTcsNyBAQAogICAgICAgICAgICAgLyoKICAgICAgICAgICAgICAqIENvcHkgdGhlIGRhdGEgdG8gdGhlIG91dHB1dCBidWZmZXIsIGNvbnZlcnQgdG8gc3RlcmVvIGlzIHJlcXVpcmVkCiAgICAgICAgICAgICAgKi8KLQorI2lmbmRlZiBCVUlMRF9GTE9BVAogICAgICAgICAgICAgaWYocExWUkVWX1ByaXZhdGUtPkN1cnJlbnRQYXJhbXMuU291cmNlRm9ybWF0ID09IExWTV9NT05PKXsKICAgICAgICAgICAgICAgICBNb25vVG8ySV8zMihwSW5wdXQsIHBPdXRwdXQsIE51bVNhbXBsZXMpOwogICAgICAgICAgICAgfSBlbHNlIHsKQEAgLTExMyw2ICsxMjUsMTUgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYgKilwT3V0cHV0LAogICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNikoTnVtU2FtcGxlcyA8PCAyKSk7IC8vIDMyIGJpdCBkYXRhLCBzdGVyZW8KICAgICAgICAgICAgIH0KKyNlbHNlCisgICAgICAgICAgICBpZihwTFZSRVZfUHJpdmF0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gIHBPdXRwdXQgPSAoTFZNX0lOVDMyICopKHBPdXRwdXQrKFNhbXBsZXNUb1Byb2Nlc3MqMikpOworI2VuZGlmCiAgICAgfQogCiAgICAgcmV0dXJuIExWUkVWX1NVQ0NFU1M7CkBAIC0xNzUsNyArMjAwLDcgQEAKIC8qICAxLiBUaGUgaW5wdXQgYW5kIG91dHB1dCBidWZmZXJzIG11c3QgYmUgMzItYml0IGFsaWduZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQorI2lmbmRlZiBCVUlMRF9GTE9BVAogdm9pZCBSZXZlcmJCbG9jayhMVk1fSU5UMzIgKnBJbnB1dCwgTFZNX0lOVDMyICpwT3V0cHV0LCBMVlJFVl9JbnN0YW5jZV9zdCAqcFByaXZhdGUsIExWTV9VSU5UMTYgTnVtU2FtcGxlcykKIHsKICAgICBMVk1fSU5UMTYgICBqLCBzaXplOwpAQCAtNDc5LDcgKzUwNCwzMjIgQEAKIAogICAgIHJldHVybjsKIH0KKyNlbHNlCit2b2lkIFJldmVyYkJsb2NrKExWTV9GTE9BVCAqcElucHV0LCBMVk1fRkxPQVQgKnBPdXRwdXQsCisgICAgICAgICAgICAgICAgIExWUkVWX0luc3RhbmNlX3N0ICpwUHJpdmF0ZSwgTFZNX1VJTlQxNiBOdW1TYW1wbGVzKQoreworICAgIExWTV9JTlQxNiAgIGosIHNpemU7CisgICAgTFZNX0ZMT0FUICAgKnBEZWxheUxpbmU7CisgICAgTFZNX0ZMT0FUICAgKnBEZWxheUxpbmVJbnB1dCA9IHBQcml2YXRlLT5wU2NyYXRjaDsKKyAgICBMVk1fRkxPQVQgICAqcFNjcmF0Y2ggPSBwUHJpdmF0ZS0+cFNjcmF0Y2g7CisgICAgTFZNX0ZMT0FUICAgKnBJbjsKKyAgICBMVk1fRkxPQVQgICAqcFRlbXAgPSBwUHJpdmF0ZS0+cElucHV0U2F2ZTsKKyAgICBMVk1fSU5UMzIgICBOdW1iZXJPZkRlbGF5TGluZXM7CisKKyAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICogQWxsIGNhbGN1bGF0aW9ucyB3aWxsIGdvIGludG8gdGhlIGJ1ZmZlciBwb2ludGVkIHRvIGJ5IHBUZW1wLCB0aGlzIHdpbGwgICAgKgorICAgICAqIHRoZW4gYmUgbWl4ZWQgd2l0aCB0aGUgb3JpZ2luYWwgaW5wdXQgdG8gY3JlYXRlIHRoZSBmaW5hbCBvdXRwdXQuICAgICAgICAgICoKKyAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgICAgICogV2hlbiBJTlBMQUNFIHByb2Nlc3NpbmcgaXMgc2VsZWN0ZWQgdGhpcyBtdXN0IGJlIGEgdGVtcG9yYXJ5IGJ1ZmZlciBhbmQgICAgKgorICAgICAqIGhlbmNlIHRoaXMgaXMgdGhlIHdvcnN0IGNhc2UsIHNvIGZvciBzaW1wbGljaXR5IHRoaXMgd2lsbCBBTFdBWVMgYmUgc28gICAgICoKKyAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgICAgICogVGhlIGlucHV0IGJ1ZmZlciB3aWxsIHJlbWFpbiB1bnRvdWNoZWQgdW50aWwgdGhlIG91dHB1dCBvZiB0aGUgbWl4ZXIgaWYgICAgKgorICAgICAqIElOUExBQ0UgcHJvY2Vzc2luZyBpcyBzZWxlY3RlZC4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgICAgICogVGhlIHRlbXAgYnVmZmVyIHdpbGwgYWx3YXlzIGJlIE51bVNhbXBsZXMgaW4gc2l6ZSByZWdhcmRsZXNzIG9mIE1PTk8gb3IgICAgKgorICAgICAqIFNURVJFTyBpbnB1dC4gSW4gdGhlIGNhc2Ugb2Ygc3RlcmVvIGlucHV0IGFsbCBwcm9jZXNzaW5nIGlzIGRvbmUgaW4gTU9OTyAgICoKKyAgICAgKiBhbmQgdGhlIGZpbmFsIG91dHB1dCBpcyBjb252ZXJ0ZWQgdG8gU1RFUkVPIGFmdGVyIHRoZSBtaXhlciAgICAgICAgICAgICAgICAqCisgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworICAgIGlmKHBQcml2YXRlLT5JbnN0YW5jZVBhcmFtcy5OdW1EZWxheXMgPT0gTFZSRVZfREVMQVlMSU5FU180KQorICAgIHsKKyAgICAgICAgTnVtYmVyT2ZEZWxheUxpbmVzID0gNDsKKyAgICB9CisgICAgZWxzZSBpZihwUHJpdmF0ZS0+SW5zdGFuY2VQYXJhbXMuTnVtRGVsYXlzID09IExWUkVWX0RFTEFZTElORVNfMikKKyAgICB7CisgICAgICAgIE51bWJlck9mRGVsYXlMaW5lcyA9IDI7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIE51bWJlck9mRGVsYXlMaW5lcyA9IDE7CisgICAgfQorCisgICAgaWYocFByaXZhdGUtPkN1cnJlbnRQYXJhbXMuU291cmNlRm9ybWF0ID09IExWTV9NT05PKQorICAgIHsKKyAgICAgICAgcEluID0gcElucHV0OworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICAvKgorICAgICAgICAgKiAgU3RlcmVvIHRvIG1vbm8gY29udmVyc2lvbgorICAgICAgICAgKi8KKworICAgICAgICBGcm9tMmlUb01vbm9fRmxvYXQocElucHV0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRlbXAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOworICAgICAgICBwSW4gPSBwVGVtcDsKKyAgICB9CisKKyAgICBNdWx0M3NfRmxvYXQocEluLAorICAgICAgICAgICAgICAgICAoTFZNX0ZMT0FUKUxWUkVWX0hFQURST09NLAorICAgICAgICAgICAgICAgICBwVGVtcCwKKyAgICAgICAgICAgICAgICAgKExWTV9JTlQxNilOdW1TYW1wbGVzKTsKKworICAgIC8qCisgICAgICogIEhpZ2ggcGFzcyBmaWx0ZXIKKyAgICAgKi8KKyAgICBGT18xSV9EMzJGMzJDMzFfVFJDX1dSQV8wMSgmcFByaXZhdGUtPnBGYXN0Q29lZi0+SFBDb2VmcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVGVtcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVGVtcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOworICAgIC8qCisgICAgICogIExvdyBwYXNzIGZpbHRlcgorICAgICAqLworICAgIEZPXzFJX0QzMkYzMkMzMV9UUkNfV1JBXzAxKCZwUHJpdmF0ZS0+cEZhc3RDb2VmLT5MUENvZWZzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZW1wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZW1wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7CisgICAgCisgICAgLyoKKyAgICAgKiAgUHJvY2VzcyBhbGwgZGVsYXkgbGluZXMKKyAgICAgKi8KKworICAgIGZvcihqID0gMDsgaiA8IE51bWJlck9mRGVsYXlMaW5lczsgaisrKQorICAgIHsKKyAgICAgICAgcERlbGF5TGluZSA9IHBQcml2YXRlLT5wU2NyYXRjaERlbGF5TGluZVtqXTsKKworICAgICAgICAvKgorICAgICAgICAgKiBBbGwtcGFzcyBmaWx0ZXIgd2l0aCBwb3AgYW5kIGNsaWNrIHN1cHByZXNzaW9uCisgICAgICAgICAqLworICAgICAgICAvKiBHZXQgdGhlIHNtb290aGVkLCBkZWxheWVkIG91dHB1dC4gUHV0IGl0IGluIHRoZSBvdXRwdXQgYnVmZmVyICovCisgICAgICAgIE1peFNvZnRfMlN0X0QzMkMzMV9TQVQoJnBQcml2YXRlLT5NaXhlcl9BUFRhcHNbal0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFByaXZhdGUtPnBPZmZzZXRBW2pdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBQcml2YXRlLT5wT2Zmc2V0QltqXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRGVsYXlMaW5lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7CisgICAgICAgIC8qIFJlLWFsaWduIHRoZSBhbGwgcGFzcyBmaWx0ZXIgZGVsYXkgYnVmZmVyIGFuZCBjb3B5aW5nIHRoZSBmaXhlZCBkZWxheSBkYXRhIFwKKyAgICAgICAgICAgdG8gdGhlIEFQIGRlbGF5IGluIHRoZSBwcm9jZXNzICovCisgICAgICAgIENvcHlfRmxvYXQoJnBQcml2YXRlLT5wRGVsYXlfVFtqXVtOdW1TYW1wbGVzXSwKKyAgICAgICAgICAgICAgICAgICBwUHJpdmF0ZS0+cERlbGF5X1Rbal0sCisgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNikocFByaXZhdGUtPlRbal0gLSBOdW1TYW1wbGVzKSk7ICAgICAgICAgLyogMzItYml0IGRhdGEgKi8KKyAgICAgICAgLyogQXBwbHkgdGhlIHNtb290aGVkIGZlZWRiYWNrIGFuZCBzYXZlIHRvIGZpeGVkIGRlbGF5IGlucHV0IChjdXJyZW50bHkgZW1wdHkpICovCisgICAgICAgIE1peFNvZnRfMVN0X0QzMkMzMV9XUkEoJnBQcml2YXRlLT5NaXhlcl9TR0ZlZWRiYWNrW2pdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBEZWxheUxpbmUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBQcml2YXRlLT5wRGVsYXlfVFtqXVtwUHJpdmF0ZS0+VFtqXSAtIE51bVNhbXBsZXNdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7CisgICAgICAgIC8qIFN1bSBpbnRvIHRoZSBBUCBkZWxheSBsaW5lICovCisgICAgICAgIE1hYzNzX1NhdF9GbG9hdCgmcFByaXZhdGUtPnBEZWxheV9UW2pdW3BQcml2YXRlLT5UW2pdIC0gTnVtU2FtcGxlc10sCisgICAgICAgICAgICAgICAgICAgICAgICAtMS4wZiwgICAgLyogSW52ZXJ0IHNpbmNlIHRoZSBmZWVkYmFjayBjb2VmZmljaWVudCBpcyBuZWdhdGl2ZSAqLworICAgICAgICAgICAgICAgICAgICAgICAgJnBQcml2YXRlLT5wRGVsYXlfVFtqXVtwUHJpdmF0ZS0+RGVsYXlfQVBbal0gLSBOdW1TYW1wbGVzXSwKKyAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7CisgICAgICAgIC8qIEFwcGx5IHNtb290aGVkIGZlZWRmb3J3YXJkIHNhbmQgc2F2ZSB0byBmaXhlZCBkZWxheSBpbnB1dCAoY3VycmVudGx5IGVtcHR5KSAqLworICAgICAgICBNaXhTb2Z0XzFTdF9EMzJDMzFfV1JBKCZwUHJpdmF0ZS0+TWl4ZXJfU0dGZWVkZm9yd2FyZFtqXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcFByaXZhdGUtPnBEZWxheV9UW2pdW3BQcml2YXRlLT5EZWxheV9BUFtqXSAtIE51bVNhbXBsZXNdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwUHJpdmF0ZS0+cERlbGF5X1Rbal1bcFByaXZhdGUtPlRbal0gLSBOdW1TYW1wbGVzXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOworICAgICAgICAvKiBTdW0gaW50byB0aGUgQVAgb3V0cHV0ICovCisgICAgICAgIE1hYzNzX1NhdF9GbG9hdCgmcFByaXZhdGUtPnBEZWxheV9UW2pdW3BQcml2YXRlLT5UW2pdIC0gTnVtU2FtcGxlc10sCisgICAgICAgICAgICAgICAgICAgICAgICAxLjBmLAorICAgICAgICAgICAgICAgICAgICAgICAgcERlbGF5TGluZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7CisKKyAgICAgICAgLyoKKyAgICAgICAgICogIEZlZWRiYWNrIGdhaW4KKyAgICAgICAgICovCisgICAgICAgIE1peFNvZnRfMVN0X0QzMkMzMV9XUkEoJnBQcml2YXRlLT5GZWVkYmFja01peGVyW2pdLCBwRGVsYXlMaW5lLCBwRGVsYXlMaW5lLCBOdW1TYW1wbGVzKTsKKworICAgICAgICAvKgorICAgICAgICAgKiAgTG93IHBhc3MgZmlsdGVyCisgICAgICAgICAqLworICAgICAgICBGT18xSV9EMzJGMzJDMzFfVFJDX1dSQV8wMSgmcFByaXZhdGUtPnBGYXN0Q29lZi0+UmV2TFBDb2Vmc1tqXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERlbGF5TGluZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERlbGF5TGluZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNilOdW1TYW1wbGVzKTsKKyAgICB9CisKKyAgICAvKgorICAgICAqICBBcHBseSByb3RhdGlvbiBtYXRyaXggYW5kIGRlbGF5IHNhbXBsZXMKKyAgICAgKi8KKyAgICBmb3IoaiA9IDA7IGogPCBOdW1iZXJPZkRlbGF5TGluZXM7IGorKykKKyAgICB7CisKKyAgICAgICAgQ29weV9GbG9hdChwVGVtcCwKKyAgICAgICAgICAgICAgICAgICBwRGVsYXlMaW5lSW5wdXQsCisgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNikoTnVtU2FtcGxlcykpOworICAgICAgICAvKgorICAgICAgICAgKiAgUm90YXRpb24gbWF0cml4IG1peAorICAgICAgICAgKi8KKyAgICAgICAgc3dpdGNoKGopCisgICAgICAgIHsKKyAgICAgICAgICAgIGNhc2UgMzoKKyAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAqICBBZGQgZGVsYXkgbGluZSAxIGFuZCAyIGNvbnRyaWJ1dGlvbgorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICBNYWMzc19TYXRfRmxvYXQocFByaXZhdGUtPnBTY3JhdGNoRGVsYXlMaW5lWzFdLCAtMS4wZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBEZWxheUxpbmVJbnB1dCwgKExWTV9JTlQxNilOdW1TYW1wbGVzKTsKKyAgICAgICAgICAgICAgICAgTWFjM3NfU2F0X0Zsb2F0KHBQcml2YXRlLT5wU2NyYXRjaERlbGF5TGluZVsyXSwgLTEuMGYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRGVsYXlMaW5lSW5wdXQsIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7CisKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgMjoKKworICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICogIEFkZCBkZWxheSBsaW5lIDAgYW5kIDMgY29udHJpYnV0aW9uCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgIE1hYzNzX1NhdF9GbG9hdChwUHJpdmF0ZS0+cFNjcmF0Y2hEZWxheUxpbmVbMF0sIC0xLjBmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERlbGF5TGluZUlucHV0LCAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOworICAgICAgICAgICAgICAgICBNYWMzc19TYXRfRmxvYXQocFByaXZhdGUtPnBTY3JhdGNoRGVsYXlMaW5lWzNdLCAtMS4wZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBEZWxheUxpbmVJbnB1dCwgKExWTV9JTlQxNilOdW1TYW1wbGVzKTsKKworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAxOgorICAgICAgICAgICAgICAgIGlmKHBQcml2YXRlLT5JbnN0YW5jZVBhcmFtcy5OdW1EZWxheXMgPT0gTFZSRVZfREVMQVlMSU5FU180KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgICAgICogIEFkZCBkZWxheSBsaW5lIDAgYW5kIDMgY29udHJpYnV0aW9uCisgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICBNYWMzc19TYXRfRmxvYXQocFByaXZhdGUtPnBTY3JhdGNoRGVsYXlMaW5lWzBdLCAtMS4wZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBEZWxheUxpbmVJbnB1dCwgKExWTV9JTlQxNilOdW1TYW1wbGVzKTsKKyAgICAgICAgICAgICAgICAgICAgQWRkMl9TYXRfRmxvYXQocFByaXZhdGUtPnBTY3JhdGNoRGVsYXlMaW5lWzNdLCBwRGVsYXlMaW5lSW5wdXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7CisKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgICAgICogIEFkZCBkZWxheSBsaW5lIDAgYW5kIDEgY29udHJpYnV0aW9uCisgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICAgTWFjM3NfU2F0X0Zsb2F0KHBQcml2YXRlLT5wU2NyYXRjaERlbGF5TGluZVswXSwgLTEuMGYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERlbGF5TGluZUlucHV0LCAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOworICAgICAgICAgICAgICAgICAgICAgTWFjM3NfU2F0X0Zsb2F0KHBQcml2YXRlLT5wU2NyYXRjaERlbGF5TGluZVsxXSwgLTEuMGYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERlbGF5TGluZUlucHV0LCAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOworCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAwOgorICAgICAgICAgICAgICAgIGlmKHBQcml2YXRlLT5JbnN0YW5jZVBhcmFtcy5OdW1EZWxheXMgPT0gTFZSRVZfREVMQVlMSU5FU180KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgICAgICogIEFkZCBkZWxheSBsaW5lIDEgYW5kIDIgY29udHJpYnV0aW9uCisgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICBNYWMzc19TYXRfRmxvYXQocFByaXZhdGUtPnBTY3JhdGNoRGVsYXlMaW5lWzFdLCAtMS4wZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBEZWxheUxpbmVJbnB1dCwgKExWTV9JTlQxNilOdW1TYW1wbGVzKTsKKyAgICAgICAgICAgICAgICAgICAgQWRkMl9TYXRfRmxvYXQocFByaXZhdGUtPnBTY3JhdGNoRGVsYXlMaW5lWzJdLCBwRGVsYXlMaW5lSW5wdXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7CisKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSBpZihwUHJpdmF0ZS0+SW5zdGFuY2VQYXJhbXMuTnVtRGVsYXlzID09IExWUkVWX0RFTEFZTElORVNfMikKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICAgICAqICBBZGQgZGVsYXkgbGluZSAwIGFuZCAxIGNvbnRyaWJ1dGlvbgorICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgQWRkMl9TYXRfRmxvYXQocFByaXZhdGUtPnBTY3JhdGNoRGVsYXlMaW5lWzBdLCBwRGVsYXlMaW5lSW5wdXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7CisgICAgICAgICAgICAgICAgICAgIE1hYzNzX1NhdF9GbG9hdChwUHJpdmF0ZS0+cFNjcmF0Y2hEZWxheUxpbmVbMV0sIC0xLjBmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERlbGF5TGluZUlucHV0LCAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOworCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICAgICAqICBBZGQgZGVsYXkgbGluZSAwIGNvbnRyaWJ1dGlvbgorICAgICAgICAgICAgICAgICAgICAgKi8KKworICAgICAgICAgICAgICAgICAgICAvKiAgICAgICAgICAgICBTT1VSQ0UgICAgICAgICAgICAgICAgICAgICAgICAgIERFU1RJTkFUSU9OKi8KKyAgICAgICAgICAgICAgICAgICAgQWRkMl9TYXRfRmxvYXQocFByaXZhdGUtPnBTY3JhdGNoRGVsYXlMaW5lWzBdLCBwRGVsYXlMaW5lSW5wdXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIC8qCisgICAgICAgICAqICBEZWxheSBzYW1wbGVzCisgICAgICAgICAqLworICAgICAgICBDb3B5X0Zsb2F0KHBEZWxheUxpbmVJbnB1dCwKKyAgICAgICAgICAgICAgICAgICAmcFByaXZhdGUtPnBEZWxheV9UW2pdW3BQcml2YXRlLT5UW2pdIC0gTnVtU2FtcGxlc10sCisgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNikoTnVtU2FtcGxlcykpOyAgICAgICAgICAgICAgLyogMzItYml0IGRhdGEgKi8KKyAgICB9CiAKIAorICAgIC8qCisgICAgICogIENyZWF0ZSBzdGVyZW8gb3V0cHV0CisgICAgICovCisgICAgc3dpdGNoKHBQcml2YXRlLT5JbnN0YW5jZVBhcmFtcy5OdW1EZWxheXMpCisgICAgeworICAgICAgICBjYXNlIExWUkVWX0RFTEFZTElORVNfNDoKKyAgICAgICAgICAgICBBZGQyX1NhdF9GbG9hdChwUHJpdmF0ZS0+cFNjcmF0Y2hEZWxheUxpbmVbM10sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFByaXZhdGUtPnBTY3JhdGNoRGVsYXlMaW5lWzBdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7CisgICAgICAgICAgICAgQWRkMl9TYXRfRmxvYXQocFByaXZhdGUtPnBTY3JhdGNoRGVsYXlMaW5lWzJdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBQcml2YXRlLT5wU2NyYXRjaERlbGF5TGluZVsxXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOworCisKKyAgICAgICAgICAgIEpvaW5UbzJpX0Zsb2F0KHBQcml2YXRlLT5wU2NyYXRjaERlbGF5TGluZVswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBQcml2YXRlLT5wU2NyYXRjaERlbGF5TGluZVsxXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZW1wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNilOdW1TYW1wbGVzKTsKKworCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBMVlJFVl9ERUxBWUxJTkVTXzI6CisKKyAgICAgICAgICAgICBDb3B5X0Zsb2F0KHBQcml2YXRlLT5wU2NyYXRjaERlbGF5TGluZVsxXSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBTY3JhdGNoLAorICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNikoTnVtU2FtcGxlcykpOworCisgICAgICAgICAgICAgTWFjM3NfU2F0X0Zsb2F0KHBQcml2YXRlLT5wU2NyYXRjaERlbGF5TGluZVswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMS4wZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2NyYXRjaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOworCisgICAgICAgICAgICAgQWRkMl9TYXRfRmxvYXQocFByaXZhdGUtPnBTY3JhdGNoRGVsYXlMaW5lWzFdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBQcml2YXRlLT5wU2NyYXRjaERlbGF5TGluZVswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOworCisKKyAgICAgICAgICAgICBKb2luVG8yaV9GbG9hdChwUHJpdmF0ZS0+cFNjcmF0Y2hEZWxheUxpbmVbMF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNjcmF0Y2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRlbXAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNilOdW1TYW1wbGVzKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIExWUkVWX0RFTEFZTElORVNfMToKKyAgICAgICAgICAgIE1vbm9UbzJJX0Zsb2F0KHBQcml2YXRlLT5wU2NyYXRjaERlbGF5TGluZVswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZW1wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNilOdW1TYW1wbGVzKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgYnJlYWs7CisgICAgfQorCisKKyAgICAvKgorICAgICAqICBEcnkvd2V0IG1peGVyCisgICAgICovCisKKyAgICBzaXplID0gKExWTV9JTlQxNikoTnVtU2FtcGxlcyA8PCAxKTsKKyAgICBNaXhTb2Z0XzJTdF9EMzJDMzFfU0FUKCZwUHJpdmF0ZS0+QnlwYXNzTWl4ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwVGVtcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZW1wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcE91dHB1dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemUpOworCisgICAgLyogQXBwbHkgR2FpbiovCisKKyAgICBTaGlmdF9TYXRfRmxvYXQoTFZSRVZfT1VUUFVUR0FJTl9TSElGVCwKKyAgICAgICAgICAgICAgICAgICAgcE91dHB1dCwKKyAgICAgICAgICAgICAgICAgICAgcE91dHB1dCwKKyAgICAgICAgICAgICAgICAgICAgc2l6ZSk7CisKKyAgICBNaXhTb2Z0XzF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bmQgUm9vbXMKQEAgLTY5LDYgKzkzLDcgQEAKICAgKi8KIAogLyogTm9ybWFsaXppbmcgb3V0cHV0IGluY2x1ZGluZyBSZXZlcmIgTGV2ZWwgcGFydCAob25seSBzaGlmdCB1cCkqLworI2lmbmRlZiBCVUlMRF9GTE9BVAogY29uc3QgTFZNX0lOVDMyIExWUkVWX0dhaW5Qb2x5VGFibGVbMjRdWzVdPXt7MSwxNzU0NzQzNCwxMjg4Njc0MzQsLTEyMDk4ODg5Niw1MDc2MTIyOCx9LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7MiwxODI1Njg2OSwxNzI2NjY5MDIsLTE5MzE2OTI5Miw4ODM0NTc0NCx9LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7MywxNjU5MTMxMSwxMzkyNTAxNTEsLTE0OTY2NzIzNCw2Njc3MDA1OSx9LApAQCAtOTQsNiArMTE5LDMyIEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHs5MCwxNjAwMzMyMiw0ODMyMzY2MSwtMzU2MDczNzgsMTMxNTM4NzIsfSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezEwMCwxNTk1NTIyMyw0ODU1ODIwMSwtMzM3MDY4NjUsMTE3MTU3OTIsfSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKLQorI2Vsc2UKK2NvbnN0IExWTV9GTE9BVCBMVlJFVl9HYWluUG9seVRhYmxlWzI0XVs1XT17ezEsMS4wNDU5MDlmLDcuNjgxMDk4ZiwtNy4yMTE1MDBmLDMuMDI1NjA1Zix9LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7MiwxLjA4ODE5NGYsMTAuMjkxNzQ5ZiwtMTEuNTEzNzg3Ziw1LjI2NTgxN2YsfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezMsMC45ODg5MTlmLDguMjk5OTU2ZiwtOC45MjA4NjJmLDMuOTc5ODA2Zix9LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7NCwxLjAzNTkyN2YsMTAuMTgyNTY3ZiwtMTAuMzQ2MTM0Ziw0LjU0NjUzM2YsfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezUsMS4xMzAzMTNmLDEyLjUzODcyN2YsLTEzLjYyNzAyM2YsNi4xNjUyMDhmLH0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHs2LDEuMDYwNzQzZiw4LjA5MTcxM2YsLTguNTg4MDc5ZiwzLjgzNDIzMGYsfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezcsMS4wNDAzODFmLDEwLjQwNjU2NmYsLTExLjE3NjY1MGYsNS4wNzUxMzJmLH0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHs4LDEuMDI2OTQ0Ziw4LjM4NzMwMmYsLTguNjg5Nzk2ZiwzLjg5NTg2M2YsfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezksMS4wMTMzMTJmLDkuNzI3MjM2ZiwtMTAuNTM0MTY1Ziw0Ljc0MjI3MmYsfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezEwLDAuOTk2MDk1Ziw4LjQ5MjI0OWYsLTcuOTQ3Njc3ZiwzLjQ3ODkxN2YsfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezEzLDEuMDc5MzQ2Ziw4Ljg5NDQyNWYsLTkuNjQxNzY4Ziw0LjQzNDQ0MmYsfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezE1LDAuOTk0MzI3Ziw3LjQ0MTMzNWYsLTguMDAzOTc5ZiwzLjU4MTE3N2YsfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezE3LDAuOTkxMDY3Ziw3LjIwODM3M2YsLTcuMjU3ODU5ZiwzLjE2Nzc3NGYsfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezIwLDEuMDMzNDQ1Ziw3LjQ3NjM3MWYsLTcuNTQ2OTYwZiwzLjM2OTcwM2YsfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezI1LDAuOTgyODMwZiw1LjkxMzg2N2YsLTUuNjM4NDQ4ZiwyLjQyMDkzMmYsfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezMwLDAuOTI4NzgyZiw1LjAzNTM0M2YsLTQuNDkyMTA0ZiwxLjg0NDkwNGYsfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezQwLDAuOTUzNzE0Ziw1LjA2MDIzMmYsLTQuNDcyMjA0ZiwxLjgyOTY0MmYsfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezUwLDAuODk5MjU4Ziw0LjI3MzM1N2YsLTMuNTM3NDkyZiwxLjM4NzU3NmYsfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezYwLDAuOTQzNTg0Ziw0LjA5MzIyOGYsLTMuNDY5NjU4ZiwxLjQxMDkxMWYsfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezcwLDAuOTI2MDIxZiwzLjk3MzEyNWYsLTMuMzMxOTg1ZiwxLjM0NDY5MGYsfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezc1LDAuODk0ODUzZiwyLjg3MTc0N2YsLTEuNDM4NzU4ZiwwLjMxMTg1NmYsfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezgwLDAuOTM1MTIyZiwyLjk5MTg1N2YsLTIuMDM4ODgyZiwwLjY4NjM5NWYsfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezkwLDAuOTUzODcyZiwyLjg4MDMxNWYsLTIuMTIyMzY1ZiwwLjc4NDAzMmYsfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezEwMCwwLjk1MTAwNWYsMi44OTQyOTRmLC0yLjAwOTA4NmYsMC42OTgzMTZmLH0sCit9OworI2VuZGlmCiAvKiBFbmQgb2YgZmlsZSAqLwogCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvUmV2ZXJiL3NyYy9MVlJFVl9UYWJsZXMuaCBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9SZXZlcmIvc3JjL0xWUkVWX1RhYmxlcy5oCmluZGV4IDVmOTkzYmQuLjA2NTgxODYgMTAwNjQ0Ci0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9SZXZlcmIvc3JjL0xWUkVWX1RhYmxlcy5oCisrKyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9SZXZlcmIvc3JjL0xWUkVWX1RhYmxlcy5oCkBAIC0zNywxMCArMzcsMTkgQEAKIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKKyNpZm5kZWYgSElHSEVSX0ZTCiBleHRlcm4gY29uc3QgICAgTFZNX1VJTlQxNiAgTFZNX0ZzVG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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQlVJTERfRkxPQVQKK0xWUFNBX1JFVFVSTiBMVlBTQV9Qcm9jZXNzICAgICAgICAgICAoIHBMVlBTQV9IYW5kbGVfdCAgICAgIGhJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgKnBMVlBTQV9JbnB1dFNhbXBsZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDE2ICAgICAgICAgICBJbnB1dEJsb2NrU2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWUFNBX1RpbWUgICAgICAgICAgIEF1ZGlvVGltZSAgICAgICAgICAgICApOworI2Vsc2UKIExWUFNBX1JFVFVSTiBMVlBTQV9Qcm9jZXNzICAgICAgICAgICAoIHBMVlBTQV9IYW5kbGVfdCAgICAgIGhJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgKnBMVlBTQV9JbnB1dFNhbXBsZXMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDE2ICAgICAgICAgICBJbnB1dEJsb2NrU2l6ZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWUFNBX1RpbWUgICAgICAgICAgIEF1ZGlvVGltZSAgICAgICAgICAgICApOwotCisjZW5kaWYKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogRlVOQ1RJT046ICAgICAgICAgICAgTFZQU0FfR2V0U3BlY3RydW0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9TcGVjdHJ1bUFuYWx5emVyL3NyYy9MVlBTQV9Db250cm9sLmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvU3BlY3RydW1BbmFseXplci9zcmMvTFZQU0FfQ29udHJvbC5jCmluZGV4IGNkNWY2OWMuLmY2YzRlYTcgMTAwNjQ0Ci0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9TcGVjdHJ1bUFuYWx5emVyL3NyYy9MVlBTQV9Db250cm9sLmMKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL1NwZWN0cnVtQW5hbHl6ZXIvc3JjL0xWUFNBX0NvbnRyb2wuYwpAQCAtMjgsNiArMjgsMTUgQEAKIExWUFNBX1JFVFVSTiBMVlBTQV9TZXRRUEZDb2VmZmljaWVudHMoIExWUFNBX0luc3RhbmNlUHJfdCAgICAgICAgKnBJbnN0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZQU0FfQ29udHJvbFBhcmFtc190ICAgICAgKnBQYXJhbXMgICk7CiAKKyNpZmRlZiBCVUlMRF9GTE9BVAorTFZQU0FfUkVUVVJOIExWUFNBX0JQU2luZ2xlUHJlY0NvZWZzKCAgTFZNX1VJTlQxNiAgICAgICAgICAgICBGcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWUFNBX0ZpbHRlclBhcmFtX3QgICAqcEZpbHRlclBhcmFtcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJQX0ZMT0FUX0NvZWZzX3QgICAgICAgICpwQ29lZmZpY2llbnRzKTsKKworTFZQU0FfUkVUVVJOIExWUFNBX0JQRG91YmxlUHJlY0NvZWZzKCAgTFZNX1VJTlQxNiAgICAgICAgICAgIEZzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZQU0FfRmlsdGVyUGFyYW1fdCAgKnBGaWx0ZXJQYXJhbXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCUF9GTE9BVF9Db2Vmc190ICAgICAgICpwQ29lZmZpY2llbnRzKTsKKyNlbHNlCiBMVlBTQV9SRVRVUk4gTFZQU0FfQlBTaW5nbGVQcmVjQ29lZnMoICBMVk1fVUlOVDE2ICAgICAgICAgICAgIEZzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZQU0FfRmlsdGVyUGFyYW1fdCAgICpwRmlsdGVyUGFyYW1zLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQlBfQzE2X0NvZWZzX3QgICAgICAgICpwQ29lZmZpY2llbnRzKTsKQEAgLTM5LDcgKzQ4LDcgQEAKIExWUFNBX1JFVFVSTiBMVlBTQV9CUERvdWJsZVByZWNDb2VmcyggIExWTV9VSU5UMTYgICAgICAgICAgICAgIEZzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZQU0FfRmlsdGVyUGFyYW1fdCAgICAgKnBGaWx0ZXJQYXJhbXMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCUF9DMzJfQ29lZnNfdCAgICAgICAgICAqcENvZWZmaWNpZW50cyk7Ci0KKyNlbmRpZgogTFZQU0FfUkVUVVJOIExWUFNBX1NldEJQRkNvZWZmaWNpZW50cyggTFZQU0FfSW5zdGFuY2VQcl90ICAgICAgICAqcEluc3QsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVlBTQV9Db250cm9sUGFyYW1zX3QgICAgICAqcFBhcmFtcyAgKTsKIApAQCAtMTc5LDcgKzE4OCwxMSBAQAogICAgIExWTV9VSU5UMTYgRnJlcTsKICAgICBMVlBTQV9Db250cm9sUGFyYW1zX3QgICBQYXJhbXM7CiAgICAgZXh0ZXJuIExWTV9JTlQxNiAgICAgICAgTFZQU0FfblNhbXBsZXNCdWZmZXJVcGRhdGVbXTsKKyNpZm5kZWYgSElHSEVSX0ZTCiAgICAgZXh0ZXJuIExWTV9VSU5UMTYgICAgICAgTFZQU0FfU2FtcGxlUmF0ZVRhYltdOworI2Vsc2UKKyAgICBleHRlcm4gTFZNX1VJTlQzMiAgICAgICBMVlBTQV9TYW1wbGVSYXRlVGFiW107CisjZW5kaWYKICAgICBleHRlcm4gTFZNX1VJTlQxNiAgICAgICBMVlBTQV9Eb3duU2FtcGxpbmdGYWN0b3JbXTsKIAogCkBAIC0yNjcsOCArMjgwLDExIEBACiBMVlBTQV9SRVRVUk4gTFZQU0FfU2V0QlBGaWx0ZXJzVHlwZSAoICAgTFZQU0FfSW5zdGFuY2VQcl90ICAgICAgICAqcEluc3QsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZQU0FfQ29udHJvbFBhcmFtc190ICAgICAgKnBQYXJhbXMgICkKIHsKLQorI2lmbmRlZiBISUdIRVJfRlMKICAgICBleHRlcm4gTFZNX1VJTlQxNiAgIExWUFNBX1NhbXBsZVJhdGVUYWJbXTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFNhbXBsZSByYXRlIHRhYmxlICovCisjZWxzZQorICAgIGV4dGVybiBMVk1fVUlOVDMyICAgTFZQU0FfU2FtcGxlUmF0ZVRhYltdOyAgICAgICAgICAgICAgICAgLyogU2FtcGxlIHJhdGUgdGFibGUgKi8KKyNlbmRpZgogICAgIExWTV9VSU5UMTYgICAgICAgICAgaWk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRmlsdGVyIGJhbmQgaW5kZXggKi8KICAgICBMVk1fVUlOVDMyICAgICAgICAgIGZzID0gKExWTV9VSU5UMzIpTFZQU0FfU2FtcGxlUmF0ZVRhYlsoTFZNX1VJTlQxNilwUGFyYW1zLT5Gc107ICAgICAgLyogU2FtcGxlIHJhdGUgKi8KICAgICBMVk1fVUlOVDMyICAgICAgICAgIGZjOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEZpbHRlciBjZW50cmUgZnJlcXVlbmN5ICovCkBAIC0zNDIsMjYgKzM1OCw0MiBAQAogICAgICAgICB7CiAgICAgICAgICAgICBjYXNlICAgIExWUFNBX0RvdWJsZVByZWNpc2lvbkZpbHRlcjoKICAgICAgICAgICAgIHsKKyNpZm5kZWYgQlVJTERfRkxPQVQKICAgICAgICAgICAgICAgICBCUF9DMzJfQ29lZnNfdCAgICAgIENvZWZmaWNpZW50czsKIAogICAgICAgICAgICAgICAgIC8qCiAgICAgICAgICAgICAgICAgICogQ2FsY3VsYXRlIHRoZSBkb3VibGUgcHJlY2lzaW9uIGNvZWZmaWNpZW50cwogICAgICAgICAgICAgICAgICAqLwogICAgICAgICAgICAgICAgIExWUFNBX0JQRG91YmxlUHJlY0NvZWZzKChMVk1fVUlOVDE2KXBQYXJhbXMtPkZzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBJbnN0LT5wRmlsdGVyc1BhcmFtc1tpaV0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmQ29lZmZpY2llbnRzKTsKLQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwSW5zdC0+cEZpbHRlcnNQYXJhbXNbaWldLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZDb2VmZmljaWVudHMpOwogICAgICAgICAgICAgICAgIC8qCiAgICAgICAgICAgICAgICAgICogU2V0IHRoZSBjb2VmZmljaWVudHMKICAgICAgICAgICAgICAgICAgKi8KICAgICAgICAgICAgICAgICBCUF8xSV9EMTZGMzJDbGxfVFJDX1dSQV8wMV9Jbml0ICggJnBJbnN0LT5wQlBfSW5zdGFuY2VzW2lpXSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBJbnN0LT5wQlBfVGFwc1tpaV0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZDb2VmZmljaWVudHMpOworI2Vsc2UKKyAgICAgICAgICAgICAgICBCUF9GTE9BVF9Db2Vmc190ICAgICAgQ29lZmZpY2llbnRzOworICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICogQ2FsY3VsYXRlIHRoZSBkb3VibGUgcHJlY2lzaW9uIGNvZWZmaWNpZW50cworICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIExWUFNBX0JQRG91YmxlUHJlY0NvZWZzKChMVk1fVUlOVDE2KXBQYXJhbXMtPkZzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwSW5zdC0+cEZpbHRlcnNQYXJhbXNbaWldLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZDb2VmZmljaWVudHMpOworICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICogU2V0IHRoZSBjb2VmZmljaWVudHMKKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBCUF8xSV9EMTZGMzJDbGxfVFJDX1dSQV8wMV9Jbml0ICggJnBJbnN0LT5wQlBfSW5zdGFuY2VzW2lpXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBJbnN0LT5wQlBfVGFwc1tpaV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZDb2VmZmljaWVudHMpOworI2VuZGlmCiAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIGNhc2UgICAgTFZQU0FfU2ltcGxlUHJlY2lzaW9uRmlsdGVyOgogICAgICAgICAgICAgeworI2lmbmRlZiBCVUlMRF9GTE9BVAogICAgICAgICAgICAgICAgIEJQX0MxNl9Db2Vmc190ICAgICAgQ29lZmZpY2llbnRzOwogCiAgICAgICAgICAgICAgICAgLyoKQEAgLTM3NCw5ICs0MDYsMjYgQEAKICAgICAgICAgICAgICAgICAvKgogICAgICAgICAgICAgICAgICAqIFNldCB0aGUgY29lZmZpY2llbnRzCiAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgQlBfMUlfRDE2RjE2Q3NzX1RSQ19XUkFfMDFfSW5pdCAoICZwSW5zdC0+cEJQX0luc3RhbmNlc1tpaV0sCisgICAgICAgICAgICAgICAgQlBfMUlfRDE2RjE2Q3NzX1RSQ19XUkFfMDFfSW5pdCAoJnBJbnN0LT5wQlBfSW5zdGFuY2VzW2lpXSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBJbnN0LT5wQlBfVGFwc1tpaV0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZDb2VmZmljaWVudHMpOworI2Vsc2UKKyAgICAgICAgICAgICAgICBCUF9GTE9BVF9Db2Vmc190ICAgICAgQ29lZmZpY2llbnRzOworCisgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgKiBDYWxjdWxhdGUgdGhlIHNpbmdsZSBwcmVjaXNpb24gY29lZmZpY2llbnRzCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgTFZQU0FfQlBTaW5nbGVQcmVjQ29lZnMoKExWTV9VSU5UMTYpcFBhcmFtcy0+RnMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBJbnN0LT5wRmlsdGVyc1BhcmFtc1tpaV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJkNvZWZmaWNpZW50cyk7CisKKyAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAqIFNldCB0aGUgY29lZmZpY2llbnRzCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgQlBfMUlfRDE2RjE2Q3NzX1RSQ19XUkFfMDFfSW5pdCAoJnBJbnN0LT5wQlBfSW5zdGFuY2VzW2lpXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBJbnN0LT5wQlBfVGFwc1tpaV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZDb2VmZmljaWVudHMpOworI2VuZGlmCiAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KQEAgLTQwOSwxOCArNDU4LDMxIEBACiB7CiAgICAgTFZNX1VJTlQxNiAgICAgaWk7CiAgICAgTFZNX0ZzX2VuICAgICAgRnMgPSBwUGFyYW1zLT5GczsKKyNpZm5kZWYgQlVJTERfRkxPQVQKICAgICBRUERfQzMyX0NvZWZzICAqcENvZWZmaWNpZW50czsKICAgICBleHRlcm4gICAgICAgICBRUERfQzMyX0NvZWZzICAgICBMVlBTQV9RUERfQ29lZnNbXTsKIAotCiAgICAgcENvZWZmaWNpZW50cyA9ICZMVlBTQV9RUERfQ29lZnNbKHBQYXJhbXMtPkxldmVsRGV0ZWN0aW9uU3BlZWQgKiBMVlBTQV9OUl9TVVBQT1JURURfUkFURSkgKyBGc107CisjZWxzZQorICAgIFFQRF9GTE9BVF9Db2VmcyAgKnBDb2VmZmljaWVudHM7CisgICAgZXh0ZXJuICAgICAgICAgUVBEX0ZMT0FUX0NvZWZzICAgICBMVlBTQV9RUERfRmxvYXRfQ29lZnNbXTsKKworICAgIHBDb2VmZmljaWVudHMgPSAmTFZQU0FfUVBEX0Zsb2F0X0NvZWZzWyhwUGFyYW1zLT5MZXZlbERldGVjdGlvblNwZWVkICogXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZQU0FfTlJfU1VQUE9SVEVEX1JBVEUpICsgRnNdOworI2VuZGlmCiAKIAogICAgIGZvciAoaWkgPSAwOyBpaSA8IHBJbnN0LT5uUmVsZXZhbnRGaWx0ZXJzOyBpaSsrKQogICAgIHsKLSAgICAgICAgICAgIExWUFNBX1FQRF9Jbml0ICgmcEluc3QtPnBRUERfU3RhdGVzW2lpXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEluc3QtPnBRUERfVGFwc1tpaV0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcENvZWZmaWNpZW50cyApOworI2lmbmRlZiBCVUlMRF9GTE9BVAorICAgICAgICBMVlBTQV9RUERfSW5pdCAoJnBJbnN0LT5wUVBEX1N0YXRlc1tpaV0sCisgICAgICAgICAgICAgICAgICAgICAgICAmcEluc3QtPnBRUERfVGFwc1tpaV0sCisgICAgICAgICAgICAgICAgICAgICAgICBwQ29lZmZpY2llbnRzICk7CisjZWxzZQorICAgICAgICBMVlBTQV9RUERfSW5pdF9GbG9hdCAoJnBJbnN0LT5wUVBEX1N0YXRlc1tpaV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEluc3QtPnBRUERfVGFwc1tpaV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ29lZmZpY2llbnRzICk7CisjZW5kaWYKICAgICB9CiAKICAgICByZXR1cm4oTFZQU0FfT0spOwpAQCAtNDYwLDYgKzUyMiw4NyBAQAogLyogICAgIG9mIHRoZSBuIGJhbmRzIGVxdWFsaXplciAoTFZFUU5CICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmZGVmIEJVSUxEX0ZMT0FUCitMVlBTQV9SRVRVUk4gTFZQU0FfQlBTaW5nbGVQcmVjQ29lZnMoICAgIExWTV9VSU5UMTYgICAgICAgICAgICAgIEZzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVlBTQV9GaWx0ZXJQYXJhbV90ICAgICAqcEZpbHRlclBhcmFtcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQlBfRkxPQVRfQ29lZnNfdCAgICAgICAgKnBDb2VmZmljaWVudHMpCit7CisKKyAgICBleHRlcm4gTFZNX0ZMT0FUICAgIExWUFNBX0Zsb2F0X1R3b1BpT25Gc1RhYmxlW107CisgICAgZXh0ZXJuIExWTV9GTE9BVCAgICBMVlBTQV9GbG9hdF9Db3NDb2VmW107CisKKworICAgIC8qCisgICAgICogSW50ZXJtZWRpYXRlIHZhcmlhYmxlcyBhbmQgdGVtcG9yYXJ5IHZhbHVlcworICAgICAqLworICAgIExWTV9GTE9BVCAgICAgICAgICAgVDA7CisgICAgTFZNX0ZMT0FUICAgICAgICAgICBEOworICAgIExWTV9GTE9BVCAgICAgICAgICAgQTA7CisgICAgTFZNX0ZMT0FUICAgICAgICAgICBCMTsKKyAgICBMVk1fRkxPQVQgICAgICAgICAgIEIyOworICAgIExWTV9GTE9BVCAgICAgICAgICAgRHQwOworICAgIExWTV9GTE9BVCAgICAgICAgICAgQjJfRGVuOworICAgIExWTV9GTE9BVCAgICAgICAgICAgQjJfTnVtOworICAgIExWTV9GTE9BVCAgICAgICAgICAgQ09TX1QwOworICAgIExWTV9GTE9BVCAgICAgICAgICAgY29lZjsKKyAgICBMVk1fRkxPQVQgICAgICAgICAgIGZhY3RvcjsKKyAgICBMVk1fRkxPQVQgICAgICAgICAgIHQwOworICAgIExWTV9JTlQxNiAgICAgICAgICAgaTsKKworCisgICAgLyoKKyAgICAgKiBHZXQgdGhlIGZpbHRlciBkZWZpbml0aW9uCisgICAgICovCisgICAgTFZNX0ZMT0FUICAgICAgICAgIEZyZXF1ZW5jeSAgID0gKExWTV9GTE9BVCkocEZpbHRlclBhcmFtcy0+Q2VudGVyRnJlcXVlbmN5KTsKKyAgICBMVk1fRkxPQVQgICAgICAgICAgUUZhY3RvciAgICAgPSAoKExWTV9GTE9BVCkocEZpbHRlclBhcmFtcy0+UUZhY3RvcikpIC8gMTAwOworCisgICAgLyoKKyAgICAgKiBDYWxjdWxhdGluZyB0aGUgaW50ZXJtZWRpYXRlIHZhbHVlcworICAgICAqLworICAgIFQwID0gRnJlcXVlbmN5ICogTFZQU0FfRmxvYXRfVHdvUGlPbkZzVGFibGVbRnNdOyAgIC8qIFQwID0gMiAqIFBpICogRmMgLyBGcyAqLworICAgIEQgPSAzMjAwOyAgICAgICAgICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMS4wMDAwMDAgKDEqMTAwKjJeNSkgKi8KKyAgICAgICAgICAgICAgICAgICAgLyogRm9yY2UgRCA9IDEgOiB0aGUgZnVuY3Rpb24gd2FzIG9yaWdpbmFsbHkgdXNlZCBmb3IgYSBwZWFraW5nIGZpbHRlci4KKyAgICAgICAgICAgICAgICAgICAgICAgVGhlIEQgcGFyYW1ldGVyIGRvIG5vdCBleGlzdCBmb3IgYSBCYW5kUGFzcyBmaWx0ZXIgY29lZmZpY2llbnRzICovCisKKyAgICAvKgorICAgICAqIENhbGN1bGF0ZSB0aGUgQjIgY29lZmZpY2llbnQKKyAgICAgKi8KKyAgICBEdDAgPSAgVDAgLyAyMDQ4IDsKKyAgICBCMl9EZW4gPSBRRmFjdG9yICsgRHQwOworICAgIEIyX051bSA9IER0MCAtIFFGYWN0b3I7CisgICAgQjIgPSBCMl9OdW0gLyAoMiAqIEIyX0Rlbik7CisKKyAgICAvKgorICAgICAqIENhbGN1bGF0ZSB0aGUgY29zaW5lIGJ5IGEgcG9seW5vbWlhbCBleHBhbnNpb24gdXNpbmcgdGhlIGVxdWF0aW9uOgorICAgICAqCisgICAgICogIENvcyArPSBjb2VmKG4pICogdDBebiAgICAgICAgICAgICAgICAgICBGb3IgbiA9IDAgdG8gNgorICAgICAqLworICAgIFQwID0gKFQwIC8gMjA0OCkgKiAwLjYzNjU4NTU4ZjsgICAgICAgICAgICAgIC8qIFNjYWxlIHRvIDEuMCBpbiAxNi1iaXQgZm9yIHJhbmdlIDAgdG8gZnMvMiAqLworICAgIHQwID0gVDAgOworICAgIGZhY3RvciA9IDEuMGY7ICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEluaXRpYWxpc2UgdG8gMS4wIGZvciB0aGUgYTAgY29lZmZpY2llbnQgKi8KKyAgICBDT1NfVDAgPSAwLjBmOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEluaXRpYWxpc2UgdGhlIGVycm9yIHRvIHplcm8gKi8KKyAgICBmb3IgKGkgPSAxOyBpIDwgNzsgaSsrKQorICAgIHsKKyAgICAgICAgY29lZiAgICA9IExWUFNBX0Zsb2F0X0Nvc0NvZWZbaV07ICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgbnRoIGNvZWZmaWNpZW50ICovCisgICAgICAgIENPU19UMCArPSAoZmFjdG9yICogY29lZik7ICAgICAgICAgLyogVGhlIG50aCBwYXJ0aWFsIHN1bSAqLworICAgICAgICBmYWN0b3IgID0gKGZhY3RvciAqIHQwKSA7ICAgICAgICAgICAvKiBDYWxjdWxhdGUgdDBebiAqLworICAgIH0KKyAgICBDT1NfVDAgPSBDT1NfVDAgKiA4OyAgICAvKkxWUFNBX0Nvc0NvZWZfZmxvYXRbMF0qLyAgICAgIC8qIENvcnJlY3QgdGhlIHNjYWxpbmcgKi8KKworCisgICAgQjEgPSAoKExWTV9GTE9BVCkwLjUgLSBCMikgKiAoQ09TX1QwKTsgICAgLyogQjEgPSAoMC41IC0gYjIpICogY29zKHQwKSAqLworICAgIEEwID0gKChMVk1fRkxPQVQpMC41ICsgQjIpIC8gMjsgICAgICAgICAgICAgICAgICAgICAgICAvKiBBMCA9ICgwLjUgKyBiMikgLyAyICovCisKKyAgICAvKgorICAgICAqIFdyaXRlIGNvZWZmIGludG8gdGhlIGRhdGEgc3RydWN0dXJlCisgICAgICovCisgICAgcENvZWZmaWNpZW50cy0+QTAgPSBBMCAqIDI7CisgICAgcENvZWZmaWNpZW50cy0+QjEgPSBCMSAqIDI7CisgICAgcENvZWZmaWNpZW50cy0+QjIgPSBCMiAqIDI7CisKKyAgICByZXR1cm4oTFZQU0FfT0spOworfQorI2Vsc2UKIExWUFNBX1JFVFVSTiBMVlBTQV9CUFNpbmdsZVByZWNDb2VmcyggICAgTFZNX1VJTlQxNiAgICAgICAgICAgICAgRnMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWUFNBX0ZpbHRlclBhcmFtX3QgICAgKnBGaWx0ZXJQYXJhbXMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJQX0MxNl9Db2Vmc190ICAgICAgICAgKnBDb2VmZmljaWVudHMpCkBAIC01NDEsNyArNjg0LDcgQEAKIAogICAgIHJldHVybihMVlBTQV9PSyk7CiB9Ci0KKyNlbmRpZgogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICAgTFZQU0FfQlBEb3VibGVQcmVjQ29lZnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwpAQCAtNTg0LDYgKzcyNyw5MCBAQAogLyogICAgIG9mIHRoZSBuIGJhbmRzIGVxdWFsaXplciAoTFZFUU5CICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmZGVmIEJVSUxEX0ZMT0FUCitMVlBTQV9SRVRVUk4gTFZQU0FfQlBEb3VibGVQcmVjQ29lZnMoICAgTFZNX1VJTlQxNiAgICAgICAgICAgIEZzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWUFNBX0ZpbHRlclBhcmFtX3QgICAqcEZpbHRlclBhcmFtcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCUF9GTE9BVF9Db2Vmc190ICAgICAgKnBDb2VmZmljaWVudHMpCit7CisKKyAgICBleHRlcm4gTFZNX0ZMT0FUICAgIExWUFNBX0Zsb2F0X1R3b1BpT25Gc1RhYmxlW107CisgICAgZXh0ZXJuIExWTV9GTE9BVCAgICBMVlBTQV9GbG9hdF9EUENvc0NvZWZbXTsKKworICAgIC8qCisgICAgICogSW50ZXJtZWRpYXRlIHZhcmlhYmxlcyBhbmQgdGVtcG9yYXJ5IHZhbHVlcworICAgICAqLworICAgIExWTV9GTE9BVCAgICAgICAgICAgVDA7CisgICAgTFZNX0ZMT0FUICAgICAgICAgICBEOworICAgIExWTV9GTE9BVCAgICAgICAgICAgQTA7CisgICAgTFZNX0ZMT0FUICAgICAgICAgICBCMTsKKyAgICBMVk1fRkxPQVQgICAgICAgICAgIEIyOworICAgIExWTV9GTE9BVCAgICAgICAgICAgRHQwOworICAgIExWTV9GTE9BVCAgICAgICAgICAgQjJfRGVuOworICAgIExWTV9GTE9BVCAgICAgICAgICAgQjJfTnVtOworICAgIExWTV9GTE9BVCAgICAgICAgICAgQ29zRXJyOworICAgIExWTV9GTE9BVCAgICAgICAgICAgY29lZjsKKyAgICBMVk1fRkxPQVQgICAgICAgICAgIGZhY3RvcjsKKyAgICBMVk1fRkxPQVQgICAgICAgICAgIHQwOworICAgIExWTV9JTlQxNiAgICAgICAgICAgaTsKKworICAgIC8qCisgICAgICogR2V0IHRoZSBmaWx0ZXIgZGVmaW5pdGlvbgorICAgICAqLworICAgIExWTV9GTE9BVCAgICAgICAgICBGcmVxdWVuY3kgICA9IChMVk1fRkxPQVQpKHBGaWx0ZXJQYXJhbXMtPkNlbnRlckZyZXF1ZW5jeSk7CisgICAgTFZNX0ZMT0FUICAgICAgICAgIFFGYWN0b3IgICAgID0gKChMVk1fRkxPQVQpKHBGaWx0ZXJQYXJhbXMtPlFGYWN0b3IpKSAvIDEwMDsKKworCisgICAgLyoKKyAgICAgKiBDYWxjdWxhdGluZyB0aGUgaW50ZXJtZWRpYXRlIHZhbHVlcworICAgICAqLworICAgIFQwID0gRnJlcXVlbmN5ICogTFZQU0FfRmxvYXRfVHdvUGlPbkZzVGFibGVbRnNdOyAgIC8qIFQwID0gMiAqIFBpICogRmMgLyBGcyAqLworICAgIEQgPSAzMjAwOyAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAxLjAwMDAwMCAoMSoxMDAqMl41KSAqLworICAgICAgICAgICAgICAgICAvKiBGb3JjZSBEID0gMSA6IHRoZSBmdW5jdGlvbiB3YXMgb3JpZ2luYWxseSB1c2VkIGZvciBhIHBlYWtpbmcgZmlsdGVyLgorICAgICAgICAgICAgICAgICAgICBUaGUgRCBwYXJhbWV0ZXIgZG8gbm90IGV4aXN0IGZvciBhIEJhbmRQYXNzIGZpbHRlciBjb2VmZmljaWVudHMgKi8KKworICAgIC8qCisgICAgICogQ2FsY3VsYXRlIHRoZSBCMiBjb2VmZmljaWVudAorICAgICAqLworICAgIER0MCA9ICBUMCAvIDIwNDggOworICAgIEIyX0RlbiA9IFFGYWN0b3IgKyBEdDA7CisgICAgQjJfTnVtID0gRHQwIC0gUUZhY3RvcjsKKyAgICBCMiA9IEIyX051bSAvICgyICogQjJfRGVuKTsKKworICAgIC8qCisgICAgICogQ2FsY3VsYXRlIHRoZSBjb3NpbmUgZXJyb3IgYnkgYSBwb2x5bm9taWFsIGV4cGFuc2lvbiB1c2luZyB0aGUgZXF1YXRpb246CisgICAgICoKKyAgICAgKiAgQ29zRXJyICs9IGNvZWYobikgKiB0MF5uICAgICAgICAgICAgICAgIEZvciBuID0gMCB0byA0CisgICAgICovCisgICAgVDAgPSBUMCAqIDAuOTk0NzUwZjsgICAgICAgICAgICAgICAgICAgIC8qIFNjYWxlIHRvIDEuMCBpbiAxNi1iaXQgZm9yIHJhbmdlIDAgdG8gZnMvNTAgKi8KKyAgICB0MCA9IFQwOworICAgIGZhY3RvciA9IDEuMGY7ICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEluaXRpYWxpc2UgdG8gMS4wIGZvciB0aGUgYTAgY29lZmZpY2llbnQgKi8KKyAgICBDb3NFcnIgPSAwLjBmOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEluaXRpYWxpc2UgdGhlIGVycm9yIHRvIHplcm8gKi8KKyAgICBmb3IgKGkgPSAxOyBpIDwgNTsgaSsrKQorICAgIHsKKyAgICAgICAgY29lZiA9IExWUFNBX0Zsb2F0X0RQQ29zQ29lZltpXTsgICAgICAgICAgICAgIC8qIEdldCB0aGUgbnRoIGNvZWZmaWNpZW50ICovCisgICAgICAgIENvc0VyciArPSBmYWN0b3IgKiBjb2VmOyAgICAgICAgIC8qIFRoZSBudGggcGFydGlhbCBzdW0gKi8KKyAgICAgICAgZmFjdG9yID0gZmFjdG9yICogdDA7ICAgICAgICAgICAvKiBDYWxjdWxhdGUgdDBebiAqLworICAgIH0KKyAgICBDb3NFcnIgPSBDb3NFcnIgKiAyOyAgICAgICAgICAvKiBDb3JyZWN0IHRoZSBzY2FsaW5nICovCisKKyAgICAvKgorICAgICAqIENhbGN1bGF0ZSB0aGUgQjEgYW5kIEEwIGNvZWZmaWNpZW50cworICAgICAqLworICAgIEIxID0gKChMVk1fRkxPQVQpMC41IC0gQjIpOyAgICAgICAgICAgICAgICAgICAgIC8qIEIxID0gKDAuNSAtIGIyKSAqLworICAgIEEwID0gQjEgKiBDb3NFcnIgOyAgICAvKiBUZW1wb3Jhcnkgc3RvcmFnZSBmb3IgKDAuNSAtIGIyKSAqIGNvc2Vycih0MCkgKi8KKyAgICBCMSAtPSBBMDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEIxID0gKDAuNSAtIGIyKSAqICgxIC0gY29zZXJyKHQwKSkgICovCisgICAgQTAgPSAoKExWTV9GTE9BVCkwLjUgICsgQjIpIC8gMjsgICAgICAgICAgICAgICAgLyogQTAgPSAoMC41ICsgYjIpIC8gMiAqLworCisgICAgLyoKKyAgICAgKiBXcml0ZSBjb2VmZiBpbnRvIHRoZSBkYXRhIHN0cnVjdHVyZQorICAgICAqLworICAgIHBDb2VmZmljaWVudHMtPkEwID0gQTA7CisgICAgcENvZWZmaWNpZW50cy0+QjEgPSBCMTsKKyAgICBwQ29lZmZpY2llbnRzLT5CMiA9IEIyOworCisgICAgcmV0dXJuKExWUFNBX09LKTsKK30KKyNlbHNlCiBMVlBTQV9SRVRVUk4gTFZQU0FfQlBEb3VibGVQcmVjQ29lZnMoICAgTFZNX1VJTlQxNiAgICAgICAgICAgIEZzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWUFNBX0ZpbHRlclBhcmFtX3QgICpwRmlsdGVyUGFyYW1zLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJQX0MzMl9Db2Vmc190ICAgICAgICpwQ29lZmZpY2llbnRzKQpAQCAtNjY2LDcgKzg5Myw3IEBACiAKICAgICByZXR1cm4oTFZQU0FfT0spOwogfQotCisjZW5kaWYKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogRlVOQ1RJT046ICAgICAgICAgICAgTFZQU0FfQ2xlYXJGaWx0ZXJIaXN0b3J5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KQEAgLTY5MCwxMSArOTE3LDE3IEBACiAKICAgICAvKiBCYW5kIFBhc3MgZmlsdGVycyB0YXBzICovCiAgICAgcFRhcEFkZHJlc3MgPSAoTFZNX0lOVDggKilwSW5zdC0+cEJQX1RhcHM7CisjaWZkZWYgQlVJTERfRkxPQVQKKyAgICBmb3IoaSA9IDA7IGkgPCBwSW5zdC0+bkJhbmRzICogc2l6ZW9mKEJpcXVhZF8xSV9PcmRlcjJfRkxPQVRfVGFwc190KTsgaSsrKQorICAgIHsKKyAgICAgICAgcFRhcEFkZHJlc3NbaV0gPSAwOworICAgIH0KKyNlbHNlCiAgICAgZm9yKGkgPSAwOyBpIDwgcEluc3QtPm5CYW5kcyA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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoUVBEX0ZMT0FUX1N0YXRlX3QpICk7CisjZW5kaWYKIAorI2lmbmRlZiBCVUlMRF9GTE9BVAogICAgIHBMVlBTQV9JbnN0LT5wQlBfVGFwcyAgICAgICAgICAgICAgID0gSW5zdEFsbG9jX0FkZE1lbWJlciggJkRhdGEsIHBJbml0UGFyYW1zLT5uQmFuZHMgKiBzaXplb2YoQmlxdWFkXzFJX09yZGVyMl9UYXBzX3QpICk7CiAgICAgcExWUFNBX0luc3QtPnBRUERfVGFwcyAgICAgICAgICAgICAgPSBJbnN0QWxsb2NfQWRkTWVtYmVyKCAmRGF0YSwgcEluaXRQYXJhbXMtPm5CYW5kcyAqIHNpemVvZihRUERfVGFwc190KSApOwogCisjZWxzZQorICAgIHBMVlBTQV9JbnN0LT5wQlBfVGFwcyAgICAgICAgICAgICAgID0gSW5zdEFsbG9jX0FkZE1lbWJlciggJkRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSW5pdFBhcmFtcy0+bkJhbmRzICogXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKEJpcXVhZF8xSV9PcmRlcjJfRkxPQVRfVGFwc190KSk7CisgICAgcExWUFNBX0luc3QtPnBRUERfVGFwcyAgICAgICAgICAgICAgPSBJbnN0QWxsb2NfQWRkTWVtYmVyKCAmRGF0YSwgcEluaXRQYXJhbXMtPm5CYW5kcyAqIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihRUERfRkxPQVRfVGFwc190KSApOworI2VuZGlmCiAKICAgICAvKiBDb3B5IGZpbHRlcnMgcGFyYW1ldGVycyBpbiB0aGUgcHJpdmF0ZSBpbnN0YW5jZSAqLwogICAgIG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NBX05SX1NVUFBPUlRFRF9SQVRFICAgICAgICAgIDkgICAgICAvKiBGcm9tIDgwMDBIeiB0byA0ODAwMEh6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisjaWZuZGVmIEhJR0hFUl9GUworI2RlZmluZSBMVlBTQV9OUl9TVVBQT1JURURfUkFURSAgICAgICAgICA5ICAgICAgLyogRnJvbSA4MDAwSHogdG8gNDgwMDBIeiovCisjZWxzZQorI2RlZmluZSBMVlBTQV9OUl9TVVBQT1JURURfUkFURSAgICAgICAgICAxMSAgICAgIC8qIEZyb20gODAwMEh6IHRvIDE5MjAwMEh6Ki8KKyNlbmRpZgogI2RlZmluZSBMVlBTQV9OUl9TVVBQT1JURURfU1BFRUQgICAgICAgICAzICAgICAgLyogTE9XLCBNRURJVU0sIEhJR0ggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogCiAjZGVmaW5lIExWUFNBX01BWEJVRkZFUkRVUkFUSU9OICAgICAgICAgIDQwMDAgICAvKiBNYXhpbXVtIGxlbmd0aCBpbiBtcyBvZiB0aGUgbGV2ZWxzIGJ1ZmZlciAgICAgICAgICAgICAgICAgICAgICAgICovCkBAIC05MywxMiArOTYsMjcgQEAKICAgICBMVlBTQV9NZW1UYWJfdCAgICAgICAgICAgICAgTWVtb3J5VGFibGU7CiAKICAgICBMVlBTQV9CUEZpbHRlclByZWNpc2lvbl9lbiAqcEJQRmlsdGVyc1ByZWNpc2lvbjsgICAgICAgICAgICAgICAgLyogUG9pbnRzIGEgbkJhbmRzIGVsZW1lbnRzIGFycmF5IHRoYXQgY29udGFpbnMgdGhlIGZpbHRlciBwcmVjaXNpb24gZm9yIGVhY2ggYmFuZCAgICAgICAgICAgICAgKi8KKyNpZm5kZWYgQlVJTERfRkxPQVQKICAgICBCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAgICAqcEJQX0luc3RhbmNlczsgICAgICAgICAgICAgICAgICAgICAgLy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ICAgLyogQ29weSBvZiB0aGUgZmlsdGVycyBwYXJhbWV0ZXJzIGZyb20gdGhlIGlucHV0IHBhcmFtZXRlcnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIAogCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvU3BlY3RydW1BbmFseXplci9zcmMvTFZQU0FfUHJvY2Vzcy5jIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL1NwZWN0cnVtQW5hbHl6ZXIvc3JjL0xWUFNBX1Byb2Nlc3MuYwppbmRleCA5ZTI5ZjY4Li5lYTVmNzRhIDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvU3BlY3RydW1BbmFseXplci9zcmMvTFZQU0FfUHJvY2Vzcy5jCisrKyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9TcGVjdHJ1bUFuYWx5emVyL3NyYy9MVlBTQV9Qcm9jZXNzLmMKQEAgLTQzLDYgKzQzLDk2IEBACiAvKiAgb3RoZXJ3aXNlICAgICAgICAgICBFcnJvciBkdWUgdG8gYmFkIHBhcmFtZXRlcnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQlVJTERfRkxPQVQKK0xWUFNBX1JFVFVSTiBMVlBTQV9Qcm9jZXNzICAgICAgICAgICAoIHBMVlBTQV9IYW5kbGVfdCAgICAgIGhJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgKnBMVlBTQV9JbnB1dFNhbXBsZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDE2ICAgICAgICAgICBJbnB1dEJsb2NrU2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWUFNBX1RpbWUgICAgICAgICAgIEF1ZGlvVGltZSAgICAgICAgICAgICkKKworeworICAgIExWUFNBX0luc3RhbmNlUHJfdCAgICAgKnBMVlBTQV9JbnN0ID0gKExWUFNBX0luc3RhbmNlUHJfdCopaEluc3RhbmNlOworICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICpwU2NyYXRjaDsKKyAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBpaTsKKyAgICBMVk1fSU5UMzIgICAgICAgICAgICAgICBBdWRpb1RpbWVJbmM7CisgICAgZXh0ZXJuIExWTV9VSU5UMzIgICAgICAgTFZQU0FfU2FtcGxlUmF0ZUludlRhYltdOworICAgIExWTV9VSU5UOCAgICAgICAgICAgICAgICpwV3JpdGVfU2F2ZTsgICAgICAgICAvKiBQb3NpdGlvbiBvZiB0aGUgd3JpdGUgcG9pbnRlcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdCB0aGUgYmVnaW5uaW5nIG9mIHRoZSBwcm9jZXNzICAqLworCisgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgIENIRUNLIFBBUkFNRVRFUlMKKyAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworICAgIGlmKGhJbnN0YW5jZSA9PSBMVk1fTlVMTCB8fCBwTFZQU0FfSW5wdXRTYW1wbGVzID09IExWTV9OVUxMKQorICAgIHsKKyAgICAgICAgcmV0dXJuKExWUFNBX0VSUk9SX05VTExBRERSRVNTKTsKKyAgICB9CisgICAgaWYoSW5wdXRCbG9ja1NpemUgPT0gMCB8fCBJbnB1dEJsb2NrU2l6ZSA+IHBMVlBTQV9JbnN0LT5NYXhJbnB1dEJsb2NrU2l6ZSkKKyAgICB7CisgICAgICAgIHJldHVybihMVlBTQV9FUlJPUl9JTlZBTElEUEFSQU0pOworICAgIH0KKworICAgIHBTY3JhdGNoID0gKExWTV9GTE9BVCopcExWUFNBX0luc3QtPk1lbW9yeVRhYmxlLlJlZ2lvbltMVlBTQV9NRU1SRUdJT05fU0NSQVRDSF0ucEJhc2VBZGRyZXNzOworICAgIHBXcml0ZV9TYXZlID0gcExWUFNBX0luc3QtPnBTcGVjdHJhbERhdGFCdWZmZXJXcml0ZVBvaW50ZXI7CisKKyAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgQVBQTFkgTkVXIFNFVFRJTkdTIElGIE5FRURFRAorICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgaWYgKHBMVlBTQV9JbnN0LT5iQ29udHJvbFBlbmRpbmcgPT0gTFZNX1RSVUUpCisgICAgeworICAgICAgICBwTFZQU0FfSW5zdC0+YkNvbnRyb2xQZW5kaW5nID0gMDsKKyAgICAgICAgTFZQU0FfQXBwbHlOZXdTZXR0aW5ncyggcExWUFNBX0luc3QpOworICAgIH0KKworICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICBQUk9DRVNTIFNBTVBMRVMKKyAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworICAgIC8qIFB1dCBzYW1wbGVzIGluIHJhbmdlIFstMC41OzAuNVsgZm9yIEJQIGZpbHRlcnMgKHNlZSBCaXF1YWRzIGRvY3VtZW50YXRpb24pICovCisgICAgQ29weV9GbG9hdChwTFZQU0FfSW5wdXRTYW1wbGVzLCBwU2NyYXRjaCwgKExWTV9JTlQxNilJbnB1dEJsb2NrU2l6ZSk7CisgICAgU2hpZnRfU2F0X0Zsb2F0KC0xLCBwU2NyYXRjaCwgcFNjcmF0Y2gsIChMVk1fSU5UMTYpSW5wdXRCbG9ja1NpemUpOworCisgICAgZm9yIChpaSA9IDA7IGlpIDwgcExWUFNBX0luc3QtPm5SZWxldmFudEZpbHRlcnM7IGlpKyspCisgICAgeworICAgICAgICBzd2l0Y2gocExWUFNBX0luc3QtPnBCUEZpbHRlcnNQcmVjaXNpb25baWldKQorICAgICAgICB7CisgICAgICAgICAgICBjYXNlIExWUFNBX1NpbXBsZVByZWNpc2lvbkZpbHRlcjoKKyAgICAgICAgICAgICAgICBCUF8xSV9EMTZGMTZDMTRfVFJDX1dSQV8wMSAgKCAmcExWUFNBX0luc3QtPnBCUF9JbnN0YW5jZXNbaWldLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTY3JhdGNoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTY3JhdGNoICsgSW5wdXRCbG9ja1NpemUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNilJbnB1dEJsb2NrU2l6ZSk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGNhc2UgTFZQU0FfRG91YmxlUHJlY2lzaW9uRmlsdGVyOgorICAgICAgICAgICAgICAgIEJQXzFJX0QxNkYzMkMzMF9UUkNfV1JBXzAxICAoICZwTFZQU0FfSW5zdC0+cEJQX0luc3RhbmNlc1tpaV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNjcmF0Y2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNjcmF0Y2ggKyBJbnB1dEJsb2NrU2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KUlucHV0QmxvY2tTaXplKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworCisgICAgICAgIExWUFNBX1FQRF9Qcm9jZXNzX0Zsb2F0ICAgKCBwTFZQU0FfSW5zdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTY3JhdGNoICsgSW5wdXRCbG9ja1NpemUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KUlucHV0QmxvY2tTaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWkpOworICAgIH0KKworICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICBVUERBVEUgU3BlY3RyYWxEYXRhQnVmZmVyQXVkaW9UaW1lCisgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworICAgIGlmKHBMVlBTQV9JbnN0LT5wU3BlY3RyYWxEYXRhQnVmZmVyV3JpdGVQb2ludGVyICE9IHBXcml0ZV9TYXZlKQorICAgIHsKKyAgICAgICAgTVVMMzJ4MzJJTlRPMzIoKEF1ZGlvVGltZSArIChMVk1fSU5UMzIpKChMVk1fSU5UMzIpcExWUFNBX0luc3QtPkxvY2FsU2FtcGxlc0NvdW50KjEwMDApKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMzIpTFZQU0FfU2FtcGxlUmF0ZUludlRhYltwTFZQU0FfSW5zdC0+Q3VycmVudFBhcmFtcy5Gc10sCisgICAgICAgICAgICAgICAgICAgICAgICBBdWRpb1RpbWVJbmMsCisgICAgICAgICAgICAgICAgICAgICAgICBMVlBTQV9Gc0ludmVydFNoaWZ0KQorICAgICAgICBwTFZQU0FfSW5zdC0+U3BlY3RyYWxEYXRhQnVmZmVyQXVkaW9UaW1lID0gQXVkaW9UaW1lICsgQXVkaW9UaW1lSW5jOworICAgIH0KKworICAgIHJldHVybihMVlBTQV9PSyk7Cit9CisjZWxzZQogTFZQU0FfUkVUVVJOIExWUFNBX1Byb2Nlc3MgICAgICAgICAgICggcExWUFNBX0hhbmRsZV90ICAgICAgaEluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAqcExWUFNBX0lucHV0U2FtcGxlcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgICAgICAgICAgIElucHV0QmxvY2tTaXplLApAQCAtMTMwLDcgKzIyMCw3IEBACiAKICAgICByZXR1cm4oTFZQU0FfT0spOwogfQotCisjZW5kaWYKIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvU3BlY3RydW1BbmFseXplci9zcmMvTFZQU0FfUVBELmggYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvU3BlY3RydW1BbmFseXplci9zcmMvTFZQU0FfUVBELmgKaW5kZXggODM2YmZkNy4uOTlkODQ0YiAxMDA2NDQKLS0tIGEvb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RfQ29lZnMsICpQUVBEX0ZMT0FUX0NvZWZzOworI2VuZGlmCisKKwogdHlwZWRlZiBzdHJ1Y3QKIHsKICAgICBMVk1fSU5UMzIgU3RvcmFnZVsxXTsKIAogfSBRUERfVGFwc190LCAqcFFQRF9UYXBzX3Q7CiAKKyNpZmRlZiBCVUlMRF9GTE9BVAordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgICBMVk1fRkxPQVQgU3RvcmFnZVsxXTsKKworfSBRUERfRkxPQVRfVGFwc190LCAqcFFQRF9GTE9BVF9UYXBzX3Q7CisKKyNlbmRpZgogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiBGVU5DVElPTjogICAgICAgICAgICBMVlBTQV9RUERfUHJvY2VzcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwpAQCAtNjIsNiArODksMTIgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bVNhbXBsZXMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgICAgICAgICBCYW5kSW5kZXgpOwogCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgTFZQU0FfUVBEX1Byb2Nlc3NfRmxvYXQgKCAgICAgIHZvaWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKmhJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICAgICAgICAgICAgKnBJblNhbXBzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtU2FtcGxlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgICAgICAgIEJhbmRJbmRleCk7CisjZW5kaWYKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogRlVOQ1RJT046ICAgICAgICAgICAgTFZQU0FfUVBEX0luaXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KQEAgLTgwLDggKzExMywxMiBAQAogdm9pZCBMVlBTQV9RUERfSW5pdCAoICAgUVBEX1N0YXRlX3QgICAgICAgKnBJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgIFFQRF9UYXBzX3QgICAgICAgICpwVGFwcywKICAgICAgICAgICAgICAgICAgICAgICAgIFFQRF9DMzJfQ29lZnMgICAgICpwQ29lZiAgICAgKTsKKyNpZmRlZiBCVUlMRF9GTE9BVAogCi0KK3ZvaWQgTFZQU0FfUVBEX0luaXRfRmxvYXQgKCAgIFFQRF9GTE9BVF9TdGF0ZV90ICAgICAgICpwSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBRUERfRkxPQVRfVGFwc190ICAgICAgICAqcFRhcHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBRUERfRkxPQVRfQ29lZnMgICAgICAgICAqcENvZWYgICAgICk7CisjZW5kaWYKICNpZmRlZiBfX2NwbHVzcGx1cwogfQogI2VuZGlmIC8qIF9fY3BsdXNwbHVzICovCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY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L3NyYy9MVlBTQV9RUERfUHJvY2Vzcy5jIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL1NwZWN0cnVtQW5hbHl6ZXIvc3JjL0xWUFNBX1FQRF9Qcm9jZXNzLmMKaW5kZXggNjcxOTdjMS4uZTIzMzE3MiAxMDA2NDQKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL1NwZWN0cnVtQW5hbHl6ZXIvc3JjL0xWUFNBX1FQRF9Qcm9jZXNzLmMKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL1NwZWN0cnVtQW5hbHl6ZXIvc3JjL0xWUFNBX1FQRF9Qcm9jZXNzLmMKQEAgLTM1LDEyICszNSwxNiBAQAogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiB2b2lkIExWUFNBX1FQRF9Xcml0ZVBlYWsoICAgcExWUFNBX0luc3RhbmNlUHJfdCAgICAgICBwTFZQU0FfSW5zdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDggICAgICAgICAgICAgKipwcFdyaXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgIEJhbmRJbmRleCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBWYWx1ZSAgICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQ4ICAgICAgICAgICAgICAgICAqKnBwV3JpdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICBCYW5kSW5kZXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICBWYWx1ZSAgICk7CiAKLQotCisjaWZkZWYgQlVJTERfRkxPQVQKK3ZvaWQgTFZQU0FfUVBEX1dyaXRlUGVha19GbG9hdCggICBwTFZQU0FfSW5zdGFuY2VQcl90ICAgICAgIHBMVlBTQV9JbnN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UOCAgICAgICAgICAgICAqKnBwV3JpdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgQmFuZEluZGV4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgIFZhbHVlICAgKTsKKyNlbmRpZgogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiBGVU5DVElPTjogICAgICAgICAgICBMVlBTQV9RUERfUHJvY2VzcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwpAQCAtNTQsNiArNTgsNyBAQAogLyogUkVUVVJOUzogICAgICAgICAgICAgdm9pZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmbmRlZiBCVUlMRF9GTE9BVAogdm9pZCBMVlBTQV9RUERfUHJvY2VzcyAoICAgICAgICAgICAgdm9pZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqaEluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICAgICAgICAqcEluU2FtcHMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgICAgICAgICBudW1TYW1wbGVzLApAQCAtMTczLDcgKzE3OCwxMzEgQEAKICAgICAgICAgcExWUFNBX0luc3QtPkRvd25TYW1wbGluZ0NvdW50ID0gKExWTV9VSU5UMTYpKC1paSk7CiAgICAgfQogfQorI2Vsc2UKK3ZvaWQgTFZQU0FfUVBEX1Byb2Nlc3NfRmxvYXQgKCAgICAgIHZvaWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKmhJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICAgICAgICAgICAgKnBJblNhbXBzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtU2FtcGxlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgICAgICAgIEJhbmRJbmRleCkKK3sKIAorICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICBQQVJBTUVURVJTCisgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyAgICBMVlBTQV9JbnN0YW5jZVByX3QgICAgICpwTFZQU0FfSW5zdCA9IChMVlBTQV9JbnN0YW5jZVByX3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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICBJTklUSUFMSVpBVElPTgorICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgLyogQ29ycmVjdCB0aGUgcG9pbnRlciB0byB0YWtlIHRoZSBmaXJzdCBkb3duIHNhbXBsZWQgc2lnbmFsIHNhbXBsZSAqLworICAgIHBJblNhbXBzICs9IHBMVlBTQV9JbnN0LT5Eb3duU2FtcGxpbmdDb3VudDsKKyAgICAvKiBDb3JyZWN0IGFsc28gdGhlIG51bWJlciBvZiBzYW1wbGVzICovCisgICAgaWkgPSAoTFZNX0lOVDE2KShpaSAtIChMVk1fSU5UMTYpcExWUFNBX0luc3QtPkRvd25TYW1wbGluZ0NvdW50KTsKKworICAgIHdoaWxlIChpaSA+IDApCisgICAgeworICAgICAgICAvKiBBcHBseSBwb3N0IGdhaW4gKi8KKyAgICAgICAgLyogLSAxIHRvIGNvbXBlbnNhdGUgc2NhbGluZyBpbiBwcm9jZXNzIGZ1bmN0aW9uKi8KKyAgICAgICAgWDAgPSAoKnBJblNhbXBzKSAqIHBMVlBTQV9JbnN0LT5wUG9zdEdhaW5zW0JhbmRJbmRleF07CisgICAgICAgIHBJblNhbXBzID0gcEluU2FtcHMgKyBEb3duU2FtcGxpbmdGYWN0b3I7CisKKyAgICAgICAgLyogU2F0dXJhdGUgYW5kIHRha2UgYWJzb2x1dGUgdmFsdWUgKi8KKyAgICAgICAgaWYoWDAgPCAwLjBmKQorICAgICAgICAgICAgWDAgPSAtWDA7CisgICAgICAgIGlmIChYMCA+IDEuMGYpCisgICAgICAgICAgICBYZzAgPSAxLjBmOworICAgICAgICBlbHNlCisgICAgICAgICAgICBYZzAgPVgwOworCisKKyAgICAgICAgLyogUXVhc2kgcGVhayBmaWx0ZXIgY2FsY3VsYXRpb24gKi8KKyAgICAgICAgRDAgID0gWGcwIC0gVjA7CisKKyAgICAgICAgdGVtcDIgPSBEMDsKKworICAgICAgICBhY2N1ID0gdGVtcDIgKiBLcDsKKyAgICAgICAgRDAgICAgPSBEMCAvIDIuMGY7CisgICAgICAgIGlmIChEMCA8IDAuMGYpeworICAgICAgICAgICAgRDAgPSAtRDA7CisgICAgICAgIH0KKworICAgICAgICB0ZW1wMiA9IEQwOworCisgICAgICAgIHRlbXAgPSBEMCAqIEttOworICAgICAgICBhY2N1ICs9IHRlbXAgKyBYZzA7CisKKyAgICAgICAgaWYgKGFjY3UgPiAxLjBmKQorICAgICAgICAgICAgYWNjdSA9IDEuMGY7CisgICAgICAgIGVsc2UgaWYoYWNjdSA8IDAuMGYpCisgICAgICAgICAgICBhY2N1ID0gMC4wZjsKKworICAgICAgICBWMCA9IGFjY3U7CisKKyAgICAgICAgaWYoKChwTFZQU0FfSW5zdC0+blNhbXBsZXNCdWZmZXJVcGRhdGUgLSBCdWZmZXJVcGRhdGVTYW1wbGVzQ291bnQpIDwgRG93blNhbXBsaW5nRmFjdG9yKSkKKyAgICAgICAgeworICAgICAgICAgICAgTFZQU0FfUVBEX1dyaXRlUGVha19GbG9hdCggcExWUFNBX0luc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcFdyaXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmFuZEluZGV4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVjApOworCisgICAgICAgICAgICBCdWZmZXJVcGRhdGVTYW1wbGVzQ291bnQgLT0gcExWUFNBX0luc3QtPm5TYW1wbGVzQnVmZmVyVXBkYXRlOworICAgICAgICAgICAgcExWUFNBX0luc3QtPkxvY2FsU2FtcGxlc0NvdW50ID0gKExWTV9VSU5UMTYpKG51bVNhbXBsZXMgLSBpaSk7CisgICAgICAgIH0KKyAgICAgICAgQnVmZmVyVXBkYXRlU2Ftc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lbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcExWUFNBX0luc3QtPm5TYW1wbGVzQnVmZmVyVXBkYXRlID0gMjIwOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHBMVlBTQV9JbnN0LT5wU3BlY3RyYWxEYXRhQnVmZmVyV3JpdGVQb2ludGVyID0gcFdyaXRlOworICAgICAgICBwTFZQU0FfSW5zdC0+QnVmZmVyVXBkYXRlU2FtcGxlc0NvdW50ID0gQnVmZmVyVXBkYXRlU2FtcGxlc0NvdW50OworICAgICAgICBwTFZQU0FfSW5zdC0+RG93blNhbXBsaW5nQ291bnQgPSAoTFZNX1VJTlQxNikoLWlpKTsKKyAgICB9Cit9CisjZW5kaWYKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogRlVOQ1RJT046ICAgICAgICAgICAgTFZQU0FfUVBEX1dyaXRlUGVhayAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KQEAgLTIwOSw0ICszMzgsMjMgQEAKICAgICAqcHBXcml0ZSA9IHBXcml0ZTsKIAogfQorI2lmZGVmIEJVSUxEX0ZMT0FUCit2b2lkIExWUFNBX1FQRF9Xcml0ZVBlYWtfRmxvYXQoICAgcExWUFNBX0luc3RhbmNlUHJfdCAgICAgcExWUFNBX0luc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQ4ICAgICAgICAgICAgICAgKipwcFdyaXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgIEJhbmRJbmRleCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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iBTYW1wbGUgcmF0ZSB0YWJsZSBmb3IgY29udmVydGluZyBiZXR3ZWVuIHRoZSBlbnVtZXJhdGVkIHR5cGUgYW5kIHRoZSBhY3R1YWwKICAqIGZyZXF1ZW5jeQogICovCisjaWZuZGVmIEhJR0hFUl9GUwogY29uc3QgTFZNX1VJTlQxNiAgICBMVlBTQV9TYW1wbGVSYXRlVGFiW10gPSB7ICAgODAwMCwgICAgICAgICAgICAgICAgICAgIC8qIDhrUy9zICAqLwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTEwMjUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMjAwMCwKQEAgLTQzLDYgKzQ0LDE5IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzMjAwMCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ0MTAwLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDgwMDB9OyAgICAgICAgICAgICAgICAgIC8qIDQ4a1MvcyAqLworI2Vsc2UKK2NvbnN0IExWTV9VSU5UMzIgICAgTFZQU0FfU2FtcGxlUmF0ZVRhYltdID0geyAgIDgwMDAsICAgICAgICAgICAgICAgICAgICAvKiA4a1MvcyAgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDExMDI1LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTIwMDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNjAwMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIyMDUwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjQwMDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzMjAwMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ0MTAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDgwMDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA5NjAwMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTkyMDAwfTsgICAgICAgICAgICAgICAgICAvKiAxOTJrUy9zICovCisjZW5kaWYKIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCkBAIC02Miw3ICs3NiwxMiBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDg5NDc4LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDY3MTA5LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ4Njk2LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ0NzM5fTsgICAgICAgICAgICAgICAgICAvKiA0OGtTL3MgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0NDczOQorI2lmZGVmIEhJR0hFUl9GUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICwyMjM2OQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICwxMTE4NSAgICAgICAgICAgICAgICAgIC8qIDE5MmtTL3MgKi8KKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OwogCiAKIApAQCAtODQsNyArMTAzLDEyIEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ4MCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNjQwLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA4ODIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDk2MH07ICAgICAgICAgICAgICAgICAgLyogNDhrUy9zICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDk2MAorI2lmZGVmIEhJR0hFUl9GUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAsMTkyMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAsMzg0MCAgICAgICAgICAgICAgICAgIC8qIDE5MmtTL3MgKi8KKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICBEb3duIHNhbXBsaW5nIGZhY3RvcnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCkBAIC0xMDIsNyArMTI2LDEyIEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE2LCAgICAgICAgICAgICAgICAgICAvKiAyNDAwMCBTL3MgICovCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIxLCAgICAgICAgICAgICAgICAgICAvKiAzMjAwMCBTL3MgICovCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMwLCAgICAgICAgICAgICAgICAgICAvKiA0NDEwMCBTL3MgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMyfTsgICAgICAgICAgICAgICAgICAvKiA0ODAwMCBTL3MgICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMyICAgICAgICAgICAgICAgICAgICAvKiA0ODAwMCBTL3MgICovCisjaWZkZWYgSElHSEVSX0ZTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLDY0ICAgICAgICAgICAgICAgICAgIC8qIDk2MDAwIFMvcyAgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAsMTI4ICAgICAgICAgICAgICAgICAgLyoxOTIwMDAgUy9zICAqLworI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CiAKIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KQEAgLTEyMiw4ICsxNTEsMzAgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA4Nzg1LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDY1ODgsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDc4MSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0MzkyfTsgICAgLyogNDhrUy9zICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDM5MgorI2lmZGVmIEhJR0hFUl9GUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLDIxOTYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICwxMDk4ICAgIC8qIDE5MmtTL3MgKi8KKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKIAorI2lmZGVmIEJVSUxEX0ZMT0FUCitjb25zdCBMVk1fRkxPQVQgICAgIExWUFNBX0Zsb2F0X1R3b1BpT25Gc1RhYmxlW10gPSB7ICAwLjgwNDI4NDdmLCAgICAgIC8qIDhrUy9zICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjU4MzYwNTRmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC41MzYxNzk2ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuNDAyMTQyM2YsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjI5MTc4NzRmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4yNjgxMDUxZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMjAxMDU1OWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjE0NTkwODlmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4xMzQwMzcyZgorI2lmZGVmIEhJR0hFUl9GUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAsMC4wNjcwMTg2ZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAsMC4wMzM1MDkzZiAgICAvKiAxOTJrUy9zICovCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisKKyNlbmRpZgogLyoKICAqIEdhaW4gdGFibGUKICAqLwpAQCAtMTU5LDYgKzIxMCwzOSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDI2NCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTE1NzZ9OyAgICAgICAgLyogKzE1ZEIgZ2FpbiAqLwogCisjaWZkZWYgQlVJTERfRkxPQVQKK2NvbnN0IExWTV9GTE9BVCAgTFZQU0FfRmxvYXRfR2FpblRhYmxlW109eyAgMC4xNzc3MzQzNzVmLCAgICAgICAgICAvKiAtMTVkQiBnYWluICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMTk5MjE4NzUwZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4yMjM2MzI4MTJmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjI1MDk3NjU2MmYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMjgxNzM4MjgxZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4zMTU5MTc5NjhmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjM1NDQ5MjE4N2YsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMzk3OTQ5MjE4ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC40NDYyODkwNjJmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjUwMDk3NjU2MmYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuNTYyMDExNzE4ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC42MzA4NTkzNzVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjcwNzUxOTUzMWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuNzkzOTQ1MzEyZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC44OTExMTMyODFmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxLjAwMDAwMDAwMGYsICAgICAgICAgLyogMGRCIGdhaW4gKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMS4xMjE1ODIwMzFmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxLjI1ODc4OTA2MmYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuNDEyMTA5Mzc1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMS41ODQ0NzI2NTZmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxLjc3NzgzMjAzMWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIuMDAwMDAwMDAwZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMi4yMzgyODEyNTBmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyLjUxMTcxODc1MGYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIuODE4MzU5Mzc1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMy4xNjIxMDkzNzVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzLjU0Nzg1MTU2MmYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMuOTgwOTU3MDMxZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNC40NjY3OTY4NzVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1LjAxMTcxODc1MGYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDUuNjUyMzQzNzUwZn07ICAgICAgICAvKiArMTVkQiBnYWluICovCisjZW5kaWYKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogIENvc29uZSBwb2x5bm9taWFsIGNvZWZmaWNpZW50cyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KQEAgLTE4MSw3ICsyNjUsMTUgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMjY3MSwgICAgICAgICAgICAgICAgICAgICAgICAgLyogYTMgKi8KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyMzczMCwgICAgICAgICAgICAgICAgICAgICAgICAgLyogYTQgKi8KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtOTQ5MH07ICAgICAgICAgICAgICAgICAgICAgICAgLyogYTUgKi8KLQorI2lmZGVmIEJVSUxEX0ZMT0FUCitjb25zdCBMVk1fRkxPQVQgICAgIExWUFNBX0Zsb2F0X0Nvc0NvZWZbXSA9IHsgMywgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFNoaWZ0cyAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMTI1MDAzOGYsICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBhMCAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjAwMTA5ODZmLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGExICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuNjAxOTc3NWYsICAgICAgICAgICAgICAgICAgICAgICAgLyogYTIgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4wODE1MTQ5ZiwgICAgICAgICAgICAgICAgICAgICAgICAgLyogYTMgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjcyNDIwNDJmLCAgICAgICAgICAgICAgICAgICAgICAgICAvKiBhNCAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjI4OTYyMDZmfTsgICAgICAgICAgICAgICAgICAgICAgICAvKiBhNSAqLworI2VuZGlmCiAvKgogICogQ29lZmZpY2llbnRzIGZvciBjYWxjdWxhdGluZyB0aGUgY29zaW5lIGVycm9yIHdpdGggdGhlIGVxdWF0aW9uOgogICoKQEAgLTIwMSw3ICsyOTMsMTMgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTYsICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBhMSAqLwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNjU4NiwgICAgICAgICAgICAgICAgICAgICAgIC8qIGEyICovCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC00NH07ICAgICAgICAgICAgICAgICAgICAgICAgLyogYTMgKi8KLQorI2lmZGVmIEJVSUxEX0ZMT0FUCitjb25zdCBMVk1fRkxPQVQgICAgTFZQU0FfRmxvYXRfRFBDb3NDb2VmW10gPSB7MS4wZiwgICAgICAgICAgICAgICAgICAgICAgICAvKiBTaGlmdHMgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjBmLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIGEwICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuMDAwMDgzMTFmLCAgICAgICAgICAgICAgICAgLyogYTEgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjUwNjE3OTk5ZiwgICAgICAgICAgICAgICAgIC8qIGEyICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuMDAxMzQyODFmfTsgICAgICAgICAgICAgICAgLyogYTMgKi8KKyNlbmRpZgogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiAgUXVhc2kgcGVhayBmaWx0ZXIgY29lZmZpY2llbnRzIHRhYmxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwpAQCAtMjM5LDMgKzMzNyw1NCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7MHhBMzc1QjJDNiwweDFFOTQzQkJDfSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezB4QTJFMUU5NTAsMHgxRTJBNTMyRX19OyAvKiA0OGtTL3MgKi8KIAorI2lmZGVmIEJVSUxEX0ZMT0FUCitjb25zdCBRUERfRkxPQVRfQ29lZnMgICAgIExWUFNBX1FQRF9GbG9hdF9Db2Vmc1tdID0geworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDhrUy9zICAqLyAgICAvKiBMVlBTQV9TUEVFRF9MT1cgICAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7LTAuOTkzNjgzMTk4OTMyNTU4M2YsMC4wMDYyMTM1NTY1MDk0NjUwZn0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHstMC45OTM1ODMzMzMyMTI4ODIzZiwwLjAwNjMxMTU0OTMzOTQ0MzRmfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgey0wLjk5MzI2Mzg0NTc5NzYyODJmLDAuMDA2NjI0OTkzNDAyNTEwOWZ9LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7LTAuOTkzNjgzMTk4OTMyNTU4M2YsMC4wMDYyMTM1NTY1MDk0NjUwZn0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHstMC45OTMxMjY5NjE4NjgyNTYzZiwwLjAwNjc1OTI2NDk3MjA2MDlmfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgey0wLjk5MzI2Mzg0NTc5NzYyODJmLDAuMDA2NjI0OTkzNDAyNTEwOWZ9LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7LTAuOTkzMzY4NjYzMzU5NDMzNGYsMC4wMDY1MjIxNjcwMDgzNzAyZn0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHstMC45OTMxMjY5NjE4NjgyNTYzZiwwLjAwNjc1OTI2NDk3MjA2MDlmfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDQ4a1MvcyAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7LTAuOTkzMjYzODQ1Nzk3NjI4MmYsMC4wMDY2MjQ5OTM0MDI1MTA5Zn0sCisjaWZkZWYgSElHSEVSX0ZTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHstMC45OTMyNjM4NDU3OTc2MjgyZiwwLjAwNjYyNDk5MzQwMjUxMDlmfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgey0wLjk5MzI2Mzg0NTc5NzYyODJmLDAuMDA2NjI0OTkzNDAyNTEwOWZ9LAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDhrUy9zICAqLyAgICAvKiBMVlBTQV9TUEVFRF9NRURJVU0gICAgICAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7LTAuOTU2ODA3OTQyNTk1MzMyOWYsMC4wNDE4NzQyNjY2OTUyMzEyZn0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHstMC45NTYxNDEzMDQ2OTAzOTA4ZiwwLjA0MjUwOTA4MjIzOTEyMTJmfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgey0wLjk1NDAxMTk1NjIyOTgwNTlmLDAuMDQ0NTM0MzgxOTQ0Njg2MmZ9LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7LTAuOTU2ODA3OTQyNTk1MzMyOWYsMC4wNDE4NzQyNjY2OTUyMzEyZn0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHstMC45NTMxMDExOTEyMDQwNDEyZiwwLjA0NTM5OTUyMzgwNTgyNjlmfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgey0wLjk1NDAxMTk1NjIyOTgwNTlmLDAuMDQ0NTM0MzgxOTQ0Njg2MmZ9LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7LTAuOTU0NzA5OTk1NTM3OTk2M2YsMC4wNDM4NzA4NTU1ODg0NjU5Zn0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3sweDg2MDBDN0I5LDB4MDVDRkE2Q0Z9LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7LTAuOTUzMTAxMTkxMjA0MDQxMmYsMC4wNDUzOTk1MjM4MDU4MjY5Zn0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiA0OGtTL3MgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgey0wLjk1NDAxMTk1NjIyOTgwNTlmLDAuMDQ0NTM0MzgxOTQ0Njg2MmZ9LAorI2lmZGVmIEhJR0hFUl9GUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7LTAuOTU0MDExOTU2MjI5ODA1OWYsMC4wNDQ1MzQzODE5NDQ2ODYyZn0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHstMC45NTQwMTE5NTYyMjk4MDU5ZiwwLjA0NDUzNDM4MTk0NDY4NjJmfSwKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogOGtTL3MgICovICAgLyogTFZQU0FfU1BFRURfSElHSCAgICAgICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHstMC43NDE1MTg2NzkwNzQ5NDMxZiwwLjIyNTQ0MDkwMjYzNTQ1NTFmfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgey0wLjczODE0NTEyMDQ0MTkxMzZmLDAuMjI3OTIwOTY1MjkxNTU5N2Z9LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7LTAuNzI3NDgwNzMxOTA0NTA2N2YsMC4yMzU2NjY2NTQwNzI3MDE5Zn0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHstMC43NDE1MTg2NzkwNzQ5NDMxZiwwLjIyNTQ0MDkwMjYzNTQ1NTFmfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgey0wLjcyMjk3MDYzMTkwNDkwMDFmLDAuMjM4ODk4NzIyNDU0OTA1NWZ9LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7LTAuNzI3NDgwNzMxOTA0NTA2N2YsMC4yMzU2NjY2NTQwNzI3MDE5Zn0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHstMC43MzA5NTgxMzUzMzI5MTIyZiwwLjIzMzE1NjgyMjYyMTgyMjRmfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgey0wLjcyMjk3MDYzMTkwNDkwMDFmLDAuMjM4ODk4NzIyNDU0OTA1NWZ9LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDQ4a1MvcyAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7LTAuNzI3NDgwNzMxOTA0NTA2N2YsMC4yMzU2NjY2NTQwNzI3MDE5Zn0KKyNpZmRlZiBISUdIRVJfRlMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAsey0wLjcyNzQ4MDczMTkwNDUwNjdmLDAuMjM1NjY2NjU0MDcyNzAxOWZ9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLHstMC43Mjc0ODA3MzE5MDQ1MDY3ZiwwLjIzNTY2NjY1NDA3MjcwMTlmfQorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyNlbmRpZgpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL1N0ZXJlb1dpZGVuaW5nL2xpYi9MVkNTLmggYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvU3RlcmVvV2lkZW5pbmcvbGliL0xWQ1MuaAppbmRleCAwZDYyMjc0Li5lNzU2OTVlIDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvU3RlcmVvV2lkZW5pbmcvbGliL0xWQ1MuaAorKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvU3RlcmVvV2lkZW5pbmcvbGliL0xWQ1MuaApAQCAtMzc0LDEyICszNzQsMTcgQEAKIC8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQorI2lmZGVmIEJVSUxEX0ZMT0FUCitMVkNTX1JldHVyblN0YXR1c19lbiBMVkNTX1Byb2Nlc3MoTFZDU19IYW5kbGVfdCAgICAgICAgICAgICBoSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICAgICAgICAgICAqcEluRGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAgICpwT3V0RGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICAgIE51bVNhbXBsZXMpOworI2Vsc2UKIExWQ1NfUmV0dXJuU3RhdHVzX2VuIExWQ1NfUHJvY2VzcyhMVkNTX0hhbmRsZV90ICAgICAgICAgICAgIGhJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMTYgICAgICAgICAgICpwSW5EYXRhLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgKnBPdXREYXRhLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgICAgICAgICAgICAgICAgTnVtU2FtcGxlcyk7Ci0KKyNlbmRpZgogCiAjaWZkZWYgX19jcGx1c3BsdXMKIH0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9TdGVyZW9XaWRlbmluZy9zcmMvTFZDU19CeXBhc3NNaXguYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9TdGVyZW9XaWRlbmluZy9zcmMvTFZDU19CeXBhc3NNaXguYwppbmRleCAzZTQ4YzdlLi4yOWUzYzllIDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvU3RlcmVvV2lkZW5pbmcvc3JjL0xWQ1NfQnlwYXNzTWl4LmMKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL1N0ZXJlb1dpZGVuaW5nL3NyYy9MVkNTX0J5cGFzc01peC5jCkBAIC03MCwxMSArNzAsMTcgQEAKIHsKIAogICAgIExWTV9VSU5UMTYgICAgICAgICAgT2Zmc2V0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WluIGZvciB0aGUgZWZmZWN0IGxldmVsCiAgICAgICovCiAgICAgewotCisjaWZuZGVmIEJVSUxEX0ZMT0FUCiAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgR2FpbkNvcnJlY3Q7CiAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgR2FpbjE7CiAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgR2FpbjI7CkBAIC0xNzIsNiArMjA1LDQzIEBACiAgICAgICAgIExWQ19NaXhlcl9WYXJTbG9wZV9TZXRUaW1lQ29uc3RhbnQoJnBDb25maWctPk1peGVyX0luc3RhbmNlLk1peGVyU3RyZWFtWzBdLExWQ1NfQllQQVNTX01JWEVSX1RDLHBQYXJhbXMtPlNhbXBsZVJhdGUsMik7CiAgICAgICAgIExWQ19NaXhlcl9TZXRUYXJnZXQoJnBDb25maWctPk1peGVyX0luc3RhbmNlLk1peGVyU3RyZWFtWzFdLEdhaW4yPj4xNik7CiAgICAgICAgIExWQ19NaXhlcl9WYXJTbG9wZV9TZXRUaW1lQ29uc3RhbnQoJnBDb25maWctPk1peGVyX0luc3RhbmNlLk1peGVyU3RyZWFtWzFdLExWQ1NfQllQQVNTX01JWEVSX1RDLHBQYXJhbXMtPlNhbXBsZVJhdGUsMik7CisjZWxzZQorICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgIEdhaW5Db3JyZWN0OworICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgIEdhaW4xOworICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgIEdhaW4yOworCisgICAgICAgIEdhaW4xID0gTFZDX01peGVyX0dldFRhcmdldCgmcENvbmZpZy0+TWl4ZXJfSW5zdGFuY2UuTWl4ZXJTdHJlYW1bMF0pOworICAgICAgICBHYWluMiA9IExWQ19NaXhlcl9HZXRUYXJnZXQoJnBDb25maWctPk1peGVyX0luc3RhbmNlLk1peGVyU3RyZWFtWzFdKTsKKyAgICAgICAgLyoKKyAgICAgICAgICogQ2FsY3VsYXRlIHRoZSBnYWluIGNvcnJlY3Rpb24KKyAgICAgICAgICovCisgICAgICAgIGlmIChwSW5zdGFuY2UtPlBhcmFtcy5Db21wcmVzc29yTW9kZSA9PSBMVk1fTU9ERV9PTikKKyAgICAgICAgeworICAgICAgICBHYWluQ29ycmVjdCA9IChMVk1fRkxPQVQpKCAgcEluc3RhbmNlLT5Wb2xDb3JyZWN0LkdhaW5NaW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gKCgoTFZNX0ZMT0FUKXBJbnN0YW5jZS0+Vm9sQ29ycmVjdC5HYWluTWluICogXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChMVk1fRkxPQVQpcEluc3RhbmNlLT5UcmFuc2l0aW9uR2FpbikpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAoKChMVk1fRkxPQVQpcEluc3RhbmNlLT5Wb2xDb3JyZWN0LkdhaW5GdWxsICogXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKExWTV9GTE9BVClwSW5zdGFuY2UtPlRyYW5zaXRpb25HYWluKSkpKTsKKworICAgICAgICAvKgorICAgICAgICAgKiBBcHBseSB0aGUgZ2FpbiBjb3JyZWN0aW9uCisgICAgICAgICAqLworICAgICAgICBHYWluMSA9IChHYWluMSAqIEdhaW5Db3JyZWN0KTsKKyAgICAgICAgR2FpbjIgPSAoR2FpbjIgKiBHYWluQ29ycmVjdCk7CisKKyAgICAgICAgfQorCisgICAgICAgIC8qCisgICAgICAgICAqIFNldCB0aGUgZ2FpbiB2YWx1ZXMKKyAgICAgICAgICovCisgICAgICAgIHBDb25maWctPk91dHB1dF9TaGlmdCA9IHBDb25maWctPk91dHB1dF9TaGlmdDsKKyAgICAgICAgTFZDX01peGVyX1NldFRhcmdldCgmcENvbmZpZy0+TWl4ZXJfSW5zdGFuY2UuTWl4ZXJTdHJlYW1bMF0sR2FpbjEpOworICAgICAgICBMVkNfTWl4ZXJfVmFyU2xvcGVfU2V0VGltZUNvbnN0YW50KCZwQ29uZmlnLT5NaXhlcl9JbnN0YW5jZS5NaXhlclN0cmVhbVswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkNTX0JZUEFTU19NSVhFUl9UQywgcFBhcmFtcy0+U2FtcGxlUmF0ZSwgMik7CisgICAgICAgIExWQ19NaXhlcl9TZXRUYXJnZXQoJnBDb25maWctPk1peGVyX0luc3RhbmNlLk1peGVyU3RyZWFtWzFdLEdhaW4yKTsKKyAgICAgICAgTFZDX01peGVyX1ZhclNsb3BlX1NldFRpbWVDb25zdGFudCgmcENvbmZpZy0+TWl4ZXJfSW5zdGFuY2UuTWl4ZXJTdHJlYW1bMV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZDU19CWVBBU1NfTUlYRVJfVEMsIHBQYXJhbXMtPlNhbXBsZVJhdGUsIDIpOworI2VuZGlmCiAgICAgfQogCiAgICAgcmV0dXJuKExWQ1NfU1VDQ0VTUyk7CkBAIC0yMDYsOSArMjc2LDE1IEBACiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiBMVkNTX1JldHVyblN0YXR1c19lbiBMVkNTX0J5cGFzc01peGVyKExWQ1NfSGFuZGxlX3QgICAgICAgICBoSW5zdGFuY2UsCisjaWZuZGVmIEJVSUxEX0ZMT0FUCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiAgICAgICAqcFByb2Nlc3NlZCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICAgICAgICpwVW5wcm9jZXNzZWQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAqcE91dERhdGEsCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fRkxPQVQgICAgICAgKnBQcm9jZXNzZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9GTE9BVCAgICAgICAqcFVucHJvY2Vzc2VkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICAgKnBPdXREYXRhLAorI2VuZGlmCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgICAgICAgICAgICBOdW1TYW1wbGVzKQogewogCkBAIC0yMjMsNiArMjk5LDcgQEAKICAgICAgICAgLyoKICAgICAgICAgICogQXBwbHkgdGhlIGJ5cGFzcyBtaXgKICAgICAgICAgICovCisjaWZuZGVmIEJVSUxEX0ZMT0FUCiAgICAgICAgIExWQ19NaXhTb2Z0XzJTdF9EMTZDMzFfU0FUKCZwQ29uZmlnLT5NaXhlcl9JbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUHJvY2Vzc2VkLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYgKikgcFVucHJvY2Vzc2VkLApAQCAtMjM2LDYgKzMxMywyMCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KilwT3V0RGF0YSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNiopcE91dERhdGEsCiAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpKDIqTnVtU2FtcGxlcykpOyAgICAgICAgICAvKiBMZWZ0IGFuZCByaWdodCovCisjZWxzZQorICAgICAgICBMVkNfTWl4U29mdF8yU3RfRDE2QzMxX1NBVCgmcENvbmZpZy0+TWl4ZXJfSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBQcm9jZXNzZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fRkxPQVQgKikgcFVucHJvY2Vzc2VkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwT3V0RGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNikoMiAqIE51bVNhbXBsZXMpKTsKKyAgICAgICAgLyoKKyAgICAgICAgICogQXBwbHkgb3V0cHV0IGdhaW4gY29ycmVjdGlvbiBzaGlmdAorICAgICAgICAgKi8KKyAgICAgICAgU2hpZnRfU2F0X0Zsb2F0KChMVk1fSU5UMTYpcENvbmZpZy0+T3V0cHV0X1NoaWZ0LAorICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9GTE9BVCopcE91dERhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0ZMT0FUKilwT3V0RGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpKDIgKiBOdW1TYW1wbGVzKSk7ICAgICAgICAgIC8qIExlZnQgYW5kIHJpZ2h0Ki8KKyNlbmRpZgogICAgIH0KIAogICAgIHJldHVybihMVkNTX1NVQ0NFU1MpOwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL1N0ZXJlb1dpZGVuaW5nL3NyYy9MVkNTX0J5cGFzc01peC5oIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL1N0ZXJlb1dpZGVuaW5nL3NyYy9MVkNTX0J5cGFzc01peC5oCmluZGV4IGQxZWY3MGEuLmY2OWJhMzggMTAwNjQ0Ci0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9TdGVyZW9XaWRlbmluZy9zcmMvTFZDU19CeXBhc3NNaXguaAorKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvU3R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ZWQgKi8KKyAgICBMVk1fRkxPQVQgICAgICAgICAgICAgIExvc3M7ICAgICAgICAgICAgICAgICAgICAgICAvKiBMb3NzIHJlcXVpcmVkICovCisgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICBVbnByb2NMb3NzOyAgICAgICAgICAgICAgICAgLyogVW5wcm9jZXNzZWQgcGF0aCBsb3NzICovCit9IEdhaW5fdDsKKyNlbmRpZgogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICAgIEZ1bmN0aW9uIHByb3RvdHlwZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KQEAgLTY3LDEzICs3OCwxOSBAQAogTFZDU19SZXR1cm5TdGF0dXNfZW4gTFZDU19CeXBhc3NNaXhJbml0KExWQ1NfSGFuZGxlX3QgICAgICAgaEluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWQ1NfUGFyYW1zX3QgICAgKnBQYXJhbXMpOwogCi0KKyNpZm5kZWYgQlVJTERfRkxPQVQKIExWQ1NfUmV0dXJuU3RhdHVzX2VuIExWQ1NfQnlwYXNzTWl4ZXIoTFZDU19IYW5kbGVfdCAgICAgICAgIGhJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICAgICAgICpwUHJvY2Vzc2VkLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMTYgICAgICAgKnVuUHJvY2Vzc2VkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgKnBPdXREYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDE2ICAgICAgTnVtU2FtcGxlcyk7Ci0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICpwT3V0RGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiAgICAgIE51bVNhbXBsZXMpOworI2Vsc2UKK0xWQ1NfUmV0dXJuU3RhdHVzX2VuIExWQ1NfQnlwYXNzTWl4ZXIoTFZDU19IYW5kbGVfdCAgICAgICAgIGhJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICAgICAgICpwUHJvY2Vzc2VkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fRkxPQVQgICAgICAgKnVuUHJvY2Vzc2VkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgKnBPdXREYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDE2ICAgICAgTnVtU2FtcGxlcyk7CisjZW5kaWYKICNpZmRlZiBfX2NwbHVzcGx1cwogfQogI2VuZGlmIC8qIF9fY3BsdXNwbHVzICovCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvU3RlcmVvV2lkZW5pbmcvc3JjL0xWQ1NfQ29udHJvbC5jIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL1N0ZXJlb1dpZGVuaW5nL3NyYy9MVkNTX0NvbnRyb2wuYwppbmRleCBjZTZkNDEwLi4zYmY2ZWM2IDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvU3RlcmVvV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SW5zdGFuY2UtPkJ5cGFzc01peC5NaXhlcl9JbnN0YW5jZS5NaXhlclN0cmVhbVsxXSwKKyAgICAgICAgICAgICAgICAgICAgTFZDU19CWVBBU1NfTUlYRVJfVEMsIHBQYXJhbXMtPlNhbXBsZVJhdGUsIDIpOworI2VuZGlmCiAgICAgICAgIH0KIAogCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvU3RlcmVvV2lkZW5pbmcvc3JjL0xWQ1NfRXF1YWxpc2VyLmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvU3RlcmVvV2lkZW5pbmcvc3JjL0xWQ1NfRXF1YWxpc2VyLmMKaW5kZXggMjViMGQ4Ni4uZWM1MzEyZSAxMDA2NDQKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL1N0ZXJlb1dpZGVuaW5nL3NyYy9MVkNTX0VxdWFsaXNlci5jCisrKyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9TdGVyZW9XaWRlbmluZy9zcmMvTFZDU19FcXVhbGlzZXIuYwpAQCAtNTMsNyArNTMsNzIgQEAKIC8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZmRlZiBCVUlMRF9GTE9BVAorTFZDU19SZXR1cm5TdGF0dXNfZW4gTFZDU19FcXVhbGlzZXJJbml0KExWQ1NfSGFuZGxlX3QgICAgICAgaEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWQ1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gICAgICAgLyogVmFsdWUgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopJnBEYXRhLT5FcXVhbGlzZXJCaXF1YWRUYXBzLCAgIC8qIERlc3RpbmF0aW9uIENhc3QgdG8gdm9pZDpcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBubyBkZXJlZmVyZW5jaW5nIGluIGZ1bmN0aW9uKi8KKyAgICAgICAgICAgICAgICAgICAgICAgIC8qIE51bWJlciBvZiB3b3JkcyAqLworICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9VSU5UMTYpKHNpemVvZihwRGF0YS0+RXF1YWxpc2VyQmlxdWFkVGFwcykgLyBzaXplb2YoTFZNX0ZMT0FUKSkpOworCisgICAgICAgIEJRXzJJX0QxNkYzMkNzc19UUkNfV1JBXzAxX0luaXQoJnBDb2VmZmljaWVudHMtPkVxdWFsaXNlckJpcXVhZEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwRGF0YS0+RXF1YWxpc2VyQmlxdWFkVGFwcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmQ29lZmZzKTsKKworICAgICAgICAvKiBDYWxsYmFja3MgKi8KKyAgICAgICAgc3dpdGNoKHBFcXVhbGlzZXJDb2VmVGFibGVbT2Zmc2V0XS5TY2FsZSkKKyAgICAgICAgeworICAgICAgICAgICAgY2FzZSAxMzoKKyAgICAgICAgICAgICAgICBwQ29uZmlnLT5wQmlxdWFkQ2FsbEJhY2sgID0gQlFfMklfRDE2RjMyQzEzX1RSQ19XUkFfMDE7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDE0OgorICAgICAgICAgICAgICAgIHBDb25maWctPnBCaXF1YWRDYWxsQmFjayAgPSBCUV8ySV9EMTZGMzJDMTRfVFJDX1dSQV8wMTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgMTU6CisgICAgICAgICAgICAgICAgcENvbmZpZy0+cEJpcXVhZENhbGxCYWNrICA9IEJRXzJJX0QxNkYzMkMxNV9UUkNfV1JBXzAxOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuKExWQ1NfU1VDQ0VTUyk7Cit9CisjZWxzZQogTFZDU19SZXR1cm5TdGF0dXNfZW4gTFZDU19FcXVhbGlzZXJJbml0KExWQ1NfSGFuZGxlX3QgICAgICAgaEluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWQ1NfUGFyYW1zX3QgICAgICAgKnBQYXJhbXMpCiB7CkBAIC0xMTIsNyArMTc3LDcgQEAKIAogICAgIHJldHVybihMVkNTX1NVQ0NFU1MpOwogfQotCisjZW5kaWYKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgIExWQ1NfRXF1YWxpc2VyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KQEAgLTEzMiw3ICsxOTcsMzcgQEAKIC8qICAxLiAgQWx3YXlzIHByb2Nlc3NlcyBpbiBwbGFjZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZmRlZiBCVUlMRF9GTE9BVAorTFZDU19SZXR1cm5TdGF0dXNfZW4gTFZDU19FcXVhbGlzZXIoTFZDU19IYW5kbGVfdCAgICAgICBoSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICpwSW5wdXRPdXRwdXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDE2ICAgICAgICAgIE51bVNhbXBsZXMpCit7CiAKKyAgICBMVkNTX0luc3RhbmNlX3QgICAgICpwSW5zdGFuY2UgPSAoTFZDU19JbnN0YW5jZV90ICAqKWhJbnN0YW5jZTsKKyAgICBMVkNTX0VxdWFsaXNlcl90ICAgICpwQ29uZmlnICAgPSAoTFZDU19FcXVhbGlzZXJfdCAgKikmcEluc3RhbmNlLT5FcXVhbGlzZXI7CisgICAgTFZDU19Db2VmZmljaWVudF90ICAqcENvZWZmaWNpZW50czsKKworCisgICAgcENvZWZmaWNpZW50cyA9IChMVkNTX0NvZWZmaWNpZW50X3QgKikgXAorICAgICAgICAgICAgICAgICAgcEluc3RhbmNlLT5NZW1vcnlUYWJsZS5SZWdpb25bTFZDU19NRU1SRUdJT05fUEVSU0lTVEVOVF9GQVNUX0NPRUZdLnBCYXNlQWRkcmVzczsKKworCisgICAgLyoKKyAgICAgKiBDaGVjayBpZiB0aGUgZXF1YWxpc2VyIGlzIHJlcXVpcmVkCisgICAgICovCisgICAgaWYgKChwSW5zdGFuY2UtPlBhcmFtcy5PcGVyYXRpbmdNb2RlICYgTFZDU19FUVVBTElTRVJTV0lUQ0gpICE9IDApCisgICAgeworICAgICAgICAvKiBBcHBseSBmaWx0ZXIgdG8gdGhlIGxlZnQgYW5kIHJpZ2h0IGNoYW5uZWxzICovCisgICAgICAgIChwQ29uZmlnLT5wQmlxdWFkQ2FsbEJhY2spKChCaXF1YWRfRkxPQVRfSW5zdGFuY2VfdCopIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcENvZWZmaWNpZW50cy0+RXF1YWxpc2VyQmlxdWFkSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9GTE9BVCAqKXBJbnB1dE91dHB1dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0ZMT0FUICopcElucHV0T3V0cHV0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7CisgICAgfQorCisgICAgcmV0dXJuKExWQ1NfU1VDQ0VTUyk7Cit9CisjZWxzZQogTFZDU19SZXR1cm5TdGF0dXNfZW4gTFZDU19FcXVhbGlzZXIoTFZDU19IYW5kbGVfdCAgICAgICBoSW5zdGFuY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICpwSW5wdXRPdXRwdXQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDE2ICAgICAgICAgIE51bVNhbXBsZXMpCkBAIC0xNTcsNCArMjUyLDQgQEAKIAogICAgIHJldHVybihMVkNTX1NVQ0NFU1MpOwogfQotCisjZW5kaWYKZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9TdGVyZW9XaWRlbmluZy9zcmMvTFZDU19FcXVhbGlzZXIuaCBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9TdGVyZW9XaWRlbmluZy9zcmMvTFZDU19FcXVhbGlzZXIuaAppbmRleCBjZjk2ZjViLi4wZTc1NmU3IDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvU3RlcmVvV2lkZW5pbmcvc3JjL0xWQ1NfRXF1YWxpc2VyLmgKKysrIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL1N0ZXJlb1dpZGVuaW5nL3NyYy9MVkNTX0VxdWFsaXNlci5oCkBAIC0zMiw4ICszMiwxMSBAQAogLyogRXF1YWxpc2VyIHN0cnVjdHVyZSAqLwogdHlwZWRlZiBzdHJ1Y3QKIHsKKyNpZm5kZWYgQlVJTERfRkxPQVQKICAgICB2b2lkICgqcEJpcXVhZENhbGxCYWNrKSAoQmlxdWFkX0luc3RhbmNlX3QqLCBMVk1fSU5UMTYqLCBMVk1fSU5UMTYqLCBMVk1fSU5UMTYpOwotCisjZWxzZQorICAgIHZvaWQgKCpwQmlxdWFkQ2FsbEJhY2spIChCaXF1YWRfRkxPQVRfSW5zdGFuY2VfdCosIExWTV9GTE9BVCosIExWTV9GTE9BVCosIExWTV9JTlQxNik7CisjZW5kaWYKIH0gTFZDU19FcXVhbGlzZXJfdDsKIAogCkBAIC00NSwxMiArNDgsMTUgQEAKIAogTFZDU19SZXR1cm5TdGF0dXNfZW4gTFZDU19FcXVhbGlzZXJJbml0KExWQ1NfSGFuZGxlX3QgICAgICAgaEluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWQ1NfUGFyYW1zX3QgICAgICAgKnBQYXJhbXMpOwotCisjaWZuZGVmIEJVSUxEX0ZMT0FUCiBMVkNTX1JldHVyblN0YXR1c19lbiBMVkNTX0VxdWFsaXNlcihMVkNTX0hhbmRsZV90ICAgICAgICAgICAgaEluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICpwSW5wdXRPdXRwdXQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICAgIE51bVNhbXBsZXMpOwotCi0KKyNlbHNlCitMVkNTX1JldHVyblN0YXR1c19lbiBMVkNTX0VxdWFsaXNlcihMVkNTX0hhbmRsZV90ICAgICAgICAgICAgaEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICAgICpwSW5wdXRPdXRwdXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICAgIE51bVNhbXBsZXMpOworI2VuZGlmCiAjaWZkZWYgX19jcGx1c3BsdXMKIH0KICNlbmRpZiAvKiBfX2NwbHVzcGx1cyAqLwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL1N0ZXJlb1dpZGVuaW5nL3NyYy9MVkNTX0hlYWRwaG9uZV9Db2VmZnMuaCBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9TdGVyZW9XaWRlbmluZy9zcmMvTFZDU19IZWFkcGhvbmVfQ29lZmZzLmgKaW5kZXggM2U2NDBjYi4uNGY1MjIxYSAxMDA2NDQKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL1N0ZXJlb1dpZGVuaW5nL3NyYy9MVkNTX0hlYWRwaG9uZV9Db2VmZnMuaAorKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvU3RlcmVvV2lkZW5pbmcvc3JjL0xWQ1NfSGVhZHBob25lX0NvZWZmcy5oCkBAIC0yNCw3ICsyNCw0NjMgQEAKIC8qIFRoZSBTdGVyZW8gRW5oYW5jZXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZmRlZiBCVUlMRF9GTE9BVAorLyogU3RlcmVvIEVuaGFuY2VyIGNvZWZmaWNpZW50cyBmb3IgODAwMCBIeiBzYW1wbGUgcmF0ZSwgc2NhbGVkIHdpdGggMC4xNjEyNTggKi8KKyNkZWZpbmUgQ1NfTUlERExFXzgwMDBfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjIyNzcyMAorI2RlZmluZSBDU19NSURETEVfODAwMF9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuMjE1MTI1CisjZGVmaW5lIENTX01JRERMRV84MDAwX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgQ1NfTUlERExFXzgwMDBfQjEgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjkyMTg5OQorI2RlZmluZSBDU19NSURETEVfODAwMF9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIENTX01JRERMRV84MDAwX1NDQUxFICAgICAgICAgICAgICAgICAgICAgICAgMTUKKyNkZWZpbmUgQ1NfU0lERV84MDAwX0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLjYxMTQ0MQorI2RlZmluZSBDU19TSURFXzgwMDBfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuMzgwMzQ0CisjZGVmaW5lIENTX1NJREVfODAwMF9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4yMzEwOTcKKyNkZWZpbmUgQ1NfU0lERV84MDAwX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjYyMjQ3MAorI2RlZmluZSBDU19TSURFXzgwMDBfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuMTMwNzU5CisjZGVmaW5lIENTX1NJREVfODAwMF9TQ0FMRSAgICAgICAgICAgICAgICAgICAgICAgICAxNQogCisvKiBTdGVyZW8gRW5oYW5jZXIgY29lZmZpY2llbnRzIGZvciAxMTAyNUh6IHNhbXBsZSByYXRlLCBzY2FsZWQgd2l0aCAwLjE2Mjk0MyAqLworI2RlZmluZSBDU19NSURETEVfMTEwMjVfQTAgICAgICAgICAgICAgICAgICAgICAgIDAuMjMwODM4CisjZGVmaW5lIENTX01JRERMRV8xMTAyNV9BMSAgICAgICAgICAgICAgICAgICAgICAtMC4yMjE1NTkKKyNkZWZpbmUgQ1NfTUlERExFXzExMDI1X0EyICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBDU19NSURETEVfMTEwMjVfQjEgICAgICAgICAgICAgICAgICAgICAgLTAuOTQzMDU2CisjZGVmaW5lIENTX01JRERMRV8xMTAyNV9CMiAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgQ1NfTUlERExFXzExMDI1X1NDQUxFICAgICAgICAgICAgICAgICAgICAxNQorI2RlZmluZSBDU19TSURFXzExMDI1X0EwICAgICAgICAgICAgICAgICAgICAgICAgIDAuNTU3MzcyCisjZGVmaW5lIENTX1NJREVfMTEwMjVfQTEgICAgICAgICAgICAgICAgICAgICAgICAtMC4zOTE0OTAKKyNkZWZpbmUgQ1NfU0lERV8xMTAyNV9BMiAgICAgICAgICAgICAgICAgICAgICAgIC0wLjE2NTg4MQorI2RlZmluZSBDU19TSURFXzExMDI1X0IxICAgICAgICAgICAgICAgICAgICAgICAgLTAuODgwNjA4CisjZGVmaW5lIENTX1NJREVfMTEwMjVfQjIgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMzIzOTcKKyNkZWZpbmUgQ1NfU0lERV8xMTAyNV9TQ0FMRSAgICAgICAgICAgICAgICAgICAgICAxNQorCisvKiBTdGVyZW8gRW5oYW5jZXIgY29lZmZpY2llbnRzIGZvciAxMjAwMEh6IHNhbXBsZSByYXRlLCBzY2FsZWQgd2l0aCAwLjE2MjE5MSAqLworI2RlZmluZSBDU19NSURETEVfMTIwMDBfQTAgICAgICAgICAgICAgICAgICAgICAgICAwLjIyOTkzMgorI2RlZmluZSBDU19NSURETEVfMTIwMDBfQTEgICAgICAgICAgICAgICAgICAgICAgIC0wLjIyMTQzNgorI2RlZmluZSBDU19NSURETEVfMTIwMDBfQTIgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBDU19NSURETEVfMTIwMDBfQjEgICAgICAgICAgICAgICAgICAgICAgIC0wLjk0NzYxNgorI2RlZmluZSBDU19NSURETEVfMTIwMDBfQjIgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBDU19NSURETEVfMTIwMDBfU0NBTEUgICAgICAgICAgICAgICAgICAgICAgICAxNQorI2RlZmluZSBDU19TSURFXzEyMDAwX0EwICAgICAgICAgICAgICAgICAgICAgICAgIDAuNTU4Mzk4CisjZGVmaW5lIENTX1NJREVfMTIwMDBfQTEgICAgICAgICAgICAgICAgICAgICAgICAtMC4zOTIyMTEKKyNkZWZpbmUgQ1NfU0lERV8xMjAwMF9BMiAgICAgICAgICAgICAgICAgICAgICAgIC0wLjE2NjE4NworI2RlZmluZSBDU19TSURFXzEyMDAwX0IxICAgICAgICAgICAgICAgICAgICAgICAgLTAuODkyNTUwCisjZGVmaW5lIENTX1NJREVfMTIwMDBfQjIgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMzI4NTYKKyNkZWZpbmUgQ1NfU0lERV8xMjAwMF9TQ0FMRSAgICAgICAgICAgICAgICAgICAgICAgICAgMTUKKworLyogU3RlcmVvIEVuaGFuY2VyIGNvZWZmaWNpZW50cyBmb3IgMTYwMDBIeiBzYW1wbGUgcmF0ZSwgc2NhbGVkIHdpdGggMC4xNjIzNzEgKi8KKyNkZWZpbmUgQ1NfTUlERExFXzE2MDAwX0EwICAgICAgICAgICAgICAgICAgICAgICAwLjIzMDYzOAorI2RlZmluZSBDU19NSURETEVfMTYwMDBfQTEgICAgICAgICAgICAgICAgICAgICAgLTAuMjI0MjMyCisjZGVmaW5lIENTX01JRERMRV8xNjAwMF9BMiAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgQ1NfTUlERExFXzE2MDAwX0IxICAgICAgICAgICAgICAgICAgICAgIC0wLjk2MDU1MAorI2RlZmluZSBDU19NSURETEVfMTYwMDBfQjIgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIENTX01JRERMRV8xNjAwMF9TQ0FMRSAgICAgICAgICAgICAgICAgICAgICAgIDE1CisjZGVmaW5lIENTX1NJREVfMTYwMDBfQTAgICAgICAgICAgICAgICAgICAgICAgICAgMC40OTk2OTUKKyNkZWZpbmUgQ1NfU0lERV8xNjAwMF9BMSAgICAgICAgICAgICAgICAgICAgICAgIC0wLjM1NTU0MworI2RlZmluZSBDU19TSURFXzE2MDAwX0EyICAgICAgICAgICAgICAgICAgICAgICAgLTAuMTQ0MTUyCisjZGVmaW5lIENTX1NJREVfMTYwMDBfQjEgICAgICAgICAgICAgICAgICAgICAgICAtMS4wNTA3ODgKKyNkZWZpbmUgQ1NfU0lERV8xNjAwMF9CMiAgICAgICAgICAgICAgICAgICAgICAgICAwLjE0NDEwNAorI2RlZmluZSBDU19TSURFXzE2MDAwX1NDQUxFICAgICAgICAgICAgICAgICAgICAgICAgICAxNAorCisvKiBTdGVyZW8gRW5oYW5jZXIgY29lZmZpY2llbnRzIGZvciAyMjA1MEh6IHNhbXBsZSByYXRlLCBzY2FsZWQgd2l0aCAwLjE2MDc4MSAqLworI2RlZmluZSBDU19NSURETEVfMjIwNTBfQTAgICAgICAgICAgICAgICAgICAgICAgIDAuMjI4NzQ5CisjZGVmaW5lIENTX01JRERMRV8yMjA1MF9BMSAgICAgICAgICAgICAgICAgICAgICAtMC4yMjQxMjgKKyNkZWZpbmUgQ1NfTUlERExFXzIyMDUwX0EyICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBDU19NSURETEVfMjIwNTBfQjEgICAgICAgICAgICAgICAgICAgICAgLTAuOTcxMjYyCisjZGVmaW5lIENTX01JRERMRV8yMjA1MF9CMiAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgQ1NfTUlERExFXzIyMDUwX1NDQUxFICAgICAgICAgICAgICAgICAgICAgICAgMTUKKyNkZWZpbmUgQ1NfU0lERV8yMjA1MF9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgMC40NDAxMTIKKyNkZWZpbmUgQ1NfU0lERV8yMjA1MF9BMSAgICAgICAgICAgICAgICAgICAgICAgICAtMC4yNjEwOTYKKyNkZWZpbmUgQ1NfU0lERV8yMjA1MF9BMiAgICAgICAgICAgICAgICAgICAgICAgICAtMC4xNzkwMTYKKyNkZWZpbmUgQ1NfU0lERV8yMjA1MF9CMSAgICAgICAgICAgICAgICAgICAgICAgICAtMS4xMTY3ODYKKyNkZWZpbmUgQ1NfU0lERV8yMjA1MF9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgMC4xODI1MDcKKyNkZWZpbmUgQ1NfU0lERV8yMjA1MF9TQ0FMRSAgICAgICAgICAgICAgICAgICAgICAgICAgMTQKKworLyogU3RlcmVvIEVuaGFuY2VyIGNvZWZmaWNpZW50cyBmb3IgMjQwMDBIeiBzYW1wbGUgcmF0ZSwgc2NhbGVkIHdpdGggMC4xNjE4ODIgKi8KKyNkZWZpbmUgQ1NfTUlERExFXzI0MDAwX0EwICAgICAgICAgICAgICAgICAgICAgICAgIDAuMjMwMzk1CisjZGVmaW5lIENTX01JRERMRV8yNDAwMF9BMSAgICAgICAgICAgICAgICAgICAgICAgIC0wLjIyNjExNworI2RlZmluZSBDU19NSURETEVfMjQwMDBfQTIgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgQ1NfTUlERExFXzI0MDAwX0IxICAgICAgICAgICAgICAgICAgICAgICAgLTAuOTczNTczCisjZGVmaW5lIENTX01JRERMRV8yNDAwMF9CMiAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBDU19NSURETEVfMjQwMDBfU0NBTEUgICAgICAgICAgICAgICAgICAgICAgICAxNQorI2RlZmluZSBDU19TSURFXzI0MDAwX0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgMC40MTQ3NzAKKyNkZWZpbmUgQ1NfU0lERV8yNDAwMF9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgLTAuMjg3MTgyCisjZGVmaW5lIENTX1NJREVfMjQwMDBfQTIgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjEyNzU4OAorI2RlZmluZSBDU19TSURFXzI0MDAwX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAtMS4yMjk2NDgKKyNkZWZpbmUgQ1NfU0lERV8yNDAwMF9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMjgyMTc3CisjZGVmaW5lIENTX1NJREVfMjQwMDBfU0NBTEUgICAgICAgICAgICAgICAgICAgICAgICAgIDE0CisKKy8qIFN0ZXJlbyBFbmhhbmNlciBjb2VmZmljaWVudHMgZm9yIDMyMDAwSHogc2FtcGxlIHJhdGUsIHNjYWxlZCB3aXRoIDAuMTYwMzIyICovCisjZGVmaW5lIENTX01JRERMRV8zMjAwMF9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgMC4yMjg0MDAKKyNkZWZpbmUgQ1NfTUlERExFXzMyMDAwX0ExICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjIyNTIxNAorI2RlZmluZSBDU19NSURETEVfMzIwMDBfQTIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIENTX01JRERMRV8zMjAwMF9CMSAgICAgICAgICAgICAgICAgICAgICAgICAtMC45ODAxMjYKKyNkZWZpbmUgQ1NfTUlERExFXzMyMDAwX0IyICAgICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBDU19NSURETEVfMzIwMDBfU0NBTEUgICAgICAgICAgICAgICAgICAgICAgICAxNQorI2RlZmluZSBDU19TSURFXzMyMDAwX0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMzY0NTc5CisjZGVmaW5lIENTX1NJREVfMzIwMDBfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAtMC4yMDczNTUKKyNkZWZpbmUgQ1NfU0lERV8zMjAwMF9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjE1NzIyNAorI2RlZmluZSBDU19TSURFXzMyMDAwX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgLTEuMjc0MjMxCisjZGVmaW5lIENTX1NJREVfMzIwMDBfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4zMTI0OTUKKyNkZWZpbmUgQ1NfU0lERV8zMjAwMF9TQ0FMRSAgICAgICAgICAgICAgICAgICAgICAgICAgMTQKKworLyogU3RlcmVvIEVuaGFuY2VyIGNvZWZmaWNpZW50cyBmb3IgNDQxMDBIeiBzYW1wbGUgcmF0ZSwgc2NhbGVkIHdpdGggMC4xNjM4MzQgKi8KKyNkZWZpbmUgQ1NfTUlERExFXzQ0MTAwX0EwICAgICAgICAgICAgICAgICAgICAgMC4yMzM1OTMKKyNkZWZpbmUgQ1NfTUlERExFXzQ0MTAwX0ExICAgICAgICAgICAgICAgICAgICAtMC4yMzEyMjUKKyNkZWZpbmUgQ1NfTUlERExFXzQ0MTAwX0EyICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgQ1NfTUlERExFXzQ0MTAwX0IxICAgICAgICAgICAgICAgICAgICAtMC45ODU1NDUKKyNkZWZpbmUgQ1NfTUlERExFXzQ0MTAwX0IyICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgQ1NfTUlERExFXzQ0MTAwX1NDQUxFICAgICAgICAgICAgICAgICAgICAgICAgMTUKKyNkZWZpbmUgQ1NfU0lERV80NDEwMF9BMCAgICAgICAgICAgICAgICAgICAgICAgMC4yODQ1NzMKKyNkZWZpbmUgQ1NfU0lERV80NDEwMF9BMSAgICAgICAgICAgICAgICAgICAgICAtMC4yNTg5MTAKKyNkZWZpbmUgQ1NfU0lERV80NDEwMF9BMiAgICAgICAgICAgICAgICAgICAgICAtMC4wMjU2NjIKKyNkZWZpbmUgQ1NfU0lERV80NDEwMF9CMSAgICAgICAgICAgICAgICAgICAgICAtMS41NzIyNDgKKyNkZWZpbmUgQ1NfU0lERV80NDEwMF9CMiAgICAgICAgICAgICAgICAgICAgICAgMC41ODgzOTkKKyNkZWZpbmUgQ1NfU0lERV80NDEwMF9TQ0FMRSAgICAgICAgICAgICAgICAgIDE0CisKKy8qIFN0ZXJlbyBFbmhhbmNlciBjb2VmZmljaWVudHMgZm9yIDQ4MDAwSHogc2FtcGxlIHJhdGUsIHNjYWxlZCB3aXRoIDAuMTY0NDAyICovCisjZGVmaW5lIENTX01JRERMRV80ODAwMF9BMCAgICAgICAgICAgICAgICAgICAgIDAuMjM0NDQ1CisjZGVmaW5lIENTX01JRERMRV80ODAwMF9BMSAgICAgICAgICAgICAgICAgICAgLTAuMjMyMjYxCisjZGVmaW5lIENTX01JRERMRV80ODAwMF9BMiAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIENTX01JRERMRV80ODAwMF9CMSAgICAgICAgICAgICAgICAgICAgLTAuOTg2NzEzCisjZGVmaW5lIENTX01JRERMRV80ODAwMF9CMiAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIENTX01JRERMRV80ODAwMF9TQ0FMRSAgICAgICAgICAgICAgICAgICAgICAgIDE1CisjZGVmaW5lIENTX1NJREVfNDgwMDBfQTAgICAgICAgICAgICAgICAgICAgICAwLjI3MjYwNgorI2RlZmluZSBDU19TSURFXzQ4MDAwX0ExICAgICAgICAgICAgICAgICAgICAtMC4yNjY5NTIKKyNkZWZpbmUgQ1NfU0lERV80ODAwMF9BMiAgICAgICAgICAgICAgICAgICAgLTAuMDA1NjU0CisjZGVmaW5lIENTX1NJREVfNDgwMDBfQjEgICAgICAgICAgICAgICAgICAgIC0xLjYxNzE0MQorI2RlZmluZSBDU19TSURFXzQ4MDAwX0IyICAgICAgICAgICAgICAgICAgICAgMC42MzA0MDUKKyNkZWZpbmUgQ1NfU0lERV80ODAwMF9TQ0FMRSAgICAgICAgICAgICAgICAgICAgICAgICAgMTQKKworI2lmZGVmIEhJR0hFUl9GUworLyogU3RlcmVvIEVuaGFuY2VyIGNvZWZmaWNpZW50cyBmb3IgOTYwMDBIeiBzYW1wbGUgcmF0ZSwgc2NhbGVkIHdpdGggIDAuMTY1Ki8KKy8qIGhpZ2ggcGFzcyBmaWx0ZXIgd2l0aCBjdXRvZmYgZnJlcXVlbmN5IDEwMi4xOCBIeiovCisjZGVmaW5lIENTX01JRERMRV85NjAwMF9BMCAgICAgICAgICAgICAgICAgICAgIDAuMjM1NTMyCisjZGVmaW5lIENTX01JRERMRV85NjAwMF9BMSAgICAgICAgICAgICAgICAgICAgLTAuMjM0NDMyCisjZGVmaW5lIENTX01JRERMRV85NjAwMF9BMiAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIENTX01JRERMRV85NjAwMF9CMSAgICAgICAgICAgICAgICAgICAgLTAuOTkzMzM0CisjZGVmaW5lIENTX01JRERMRV85NjAwMF9CMiAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIENTX01JRERMRV85NjAwMF9TQ0FMRSAgICAgICAgICAgICAgICAgICAgICAgIDE1CisvKiBiYW5kcGFzcyBmaWx0ZXIgd2l0aCBmYzEgMjcwIGFuZCBmYzIgMzcwMywgZGVzaWduZWQgdXNpbmcgMm5kIG9yZGVyIGJ1dHRlcndvcnRoICovCisjZGVmaW5lIENTX1NJREVfOTYwMDBfQTAgICAgICAgICAgICAgICAgICAgICAwLjAxNjcyNworI2RlZmluZSBDU19TSURFXzk2MDAwX0ExICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgQ1NfU0lERV85NjAwMF9BMiAgICAgICAgICAgICAgICAgICAgLTAuMDE2NzI3CisjZGVmaW5lIENTX1NJREVfOTYwMDBfQjEgICAgICAgICAgICAgICAgICAgIC0xLjc5MzM3MgorI2RlZmluZSBDU19TSURFXzk2MDAwX0IyICAgICAgICAgICAgICAgICAgICAgMC43OTcyMzYKKyNkZWZpbmUgQ1NfU0lERV85NjAwMF9TQ0FMRSAgICAgICAgICAgICAgICAgICAgICAgIDE0CisKKy8qIFN0ZXJlbyBFbmhhbmNlciBjb2VmZmljaWVudHMgZm9yIDE5MjAwMEh6IHNhbXBsZSByYXRlLCBzY2FsZWQgd2l0aCAgMC4xNjg5Ki8KKyNkZWZpbmUgQ1NfTUlERExFXzE5MjAwMF9BMCAgICAgICAgICAgICAgICAgICAgIDAuMjQxMjE5CisjZGVmaW5lIENTX01JRERMRV8xOTIwMDBfQTEgICAgICAgICAgICAgICAgICAgIC0wLjI0MDY1NgorI2RlZmluZSBDU19NSURETEVfMTkyMDAwX0EyICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgQ1NfTUlERExFXzE5MjAwMF9CMSAgICAgICAgICAgICAgICAgICAgLTAuOTk2NjYxCisjZGVmaW5lIENTX01JRERMRV8xOTIwMDBfQjIgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBDU19NSURETEVfMTkyMDAwX1NDQUxFICAgICAgICAgICAgICAgICAgICAgICAgMTUKKy8qIGJhbmRwYXNzIGZpbHRlciB3aXRoIGZjMSAyNzAgYW5kIGZjMiAzNzAzLCBkZXNpZ25lZCB1c2luZyAybmQgb3JkZXIgYnV0dGVyd29ydGggKi8KKyNkZWZpbmUgQ1NfU0lERV8xOTIwMDBfQTAgICAgICAgICAgICAgICAgICAgICAwLjAwODk5MQorI2RlZmluZSBDU19TSURFXzE5MjAwMF9BMSAgICAgICAgICAgICAgICAgICAgLTAuMDAwMDAwCisjZGVmaW5lIENTX1NJREVfMTkyMDAwX0EyICAgICAgICAgICAgICAgICAgICAtMC4wMDg5OTEKKyNkZWZpbmUgQ1NfU0lERV8xOTIwMDBfQjEgICAgICAgICAgICAgICAgICAgIC0xLjg5MjUwOQorI2RlZmluZSBDU19TSURFXzE5MjAwMF9CMiAgICAgICAgICAgICAgICAgICAgIDAuODkzNTI0CisjZGVmaW5lIENTX1NJREVfMTkyMDAwX1NDQUxFICAgICAgICAgICAgICAgICAgICAgICAxNAorI2VuZGlmCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogVGhlIFJldmVyYiBVbml0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKiBSZXZlcmIgZGVsYXkgc2V0dGluZ3MgaW4gc2FtcGxlcyAqLworI2RlZmluZSBMVkNTX1NURVJFT0RFTEFZX0NTXzhLSFogICAgICAgICAgICAgICAgICAgICA5MyAgICAgICAgIC8qIFNhbXBsZSByYXRlIDhrUy9zICovCisjZGVmaW5lIExWQ1NfU1RFUkVPREVMQVlfQ1NfMTFLSFogICAgICAgICAgICAgICAgICAgMTI4ICAgICAgICAgLyogU2FtcGxlIHJhdGUgMTFrUy9zICovCisjZGVmaW5lIExWQ1NfU1RFUkVPREVMQVlfQ1NfMTJLSFogICAgICAgICAgICAgICAgICAgMTM5ICAgICAgICAgLyogU2FtcGxlIHJhdGUgMTJrUy9zICovCisjZGVmaW5lIExWQ1NfU1RFUkVPREVMQVlfQ1NfMTZLSFogICAgICAgICAgICAgICAgICAgMTg2ICAgICAgICAgLyogU2FtcGxlIHJhdGUgMTZrUy9zICovCisjZGVmaW5lIExWQ1NfU1RFUkVPREVMQVlfQ1NfMjJLSFogICAgICAgICAgICAgICAgICAgMjU2ICAgICAgICAgLyogU2FtcGxlIHJhdGUgMjJrUy9zICovCisjZGVmaW5lIExWQ1NfU1RFUkVPREVMQVlfQ1NfMjRLSFogICAgICAgICAgICAgICAgICAgMjc5ICAgICAgICAgLyogU2FtcGxlIHJhdGUgMjRrUy9zICovCisjZGVmaW5lIExWQ1NfU1RFUkVPREVMQVlfQ1NfMzJLSFogICAgICAgICAgICAgICAgICAgMzcyICAgICAgICAgLyogU2FtcGxlIHJhdGUgMzJrUy9zICovCisjZGVmaW5lIExWQ1NfU1RFUkVPREVMQVlfQ1NfNDRLSFogICAgICAgICAgICAgICAgICAgNTEyICAgICAgICAgLyogU2FtcGxlIHJhdGUgNDRrUy9zICovCisjZGVmaW5lIExWQ1NfU1RFUkVPREVMQVlfQ1NfNDhLSFogICAgICAgICAgICAgICAgICAgNTEyICAgICAgICAgLyogU2FtcGxlIHJhdGUgNDhrUy9zICovCisKKy8qIFJldmVyYiBjb2VmZmljaWVudHMgZm9yIDgwMDAgSHogc2FtcGxlIHJhdGUsIHNjYWxlZCB3aXRoIDEuMDM4MDMwICovCisjZGVmaW5lIENTX1JFVkVSQl84MDAwX0EwICAgICAgICAgICAgICAgICAgICAgICAgICAwLjY2NzI3MQorI2RlZmluZSBDU19SRVZFUkJfODAwMF9BMSAgICAgICAgICAgICAgICAgICAgICAgICAtMC42NjcyNzEKKyNkZWZpbmUgQ1NfUkVWRVJCXzgwMDBfQTIgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIENTX1JFVkVSQl84MDAwX0IxICAgICAgICAgICAgICAgICAgICAgICAgIC0wLjY2ODE3OQorI2RlZmluZSBDU19SRVZFUkJfODAwMF9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDA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TIwMDBfU0NBTEUgICAgICAgICAgICAgICAgMTUKKworLyogUmV2ZXJiIGNvZWZmaWNpZW50cyBmb3IgMTYwMDBIeiBzYW1wbGUgcmF0ZSwgc2NhbGVkIHdpdGggMS4wMzgwMzAgKi8KKyNkZWZpbmUgQ1NfUkVWRVJCXzE2MDAwX0EwICAgICAgICAgICAgICAgICAgICAgIDAuNzI4MjcyCisjZGVmaW5lIENTX1JFVkVSQl8xNjAwMF9BMSAgICAgICAgICAgICAgICAgICAgIC0wLjcyODI3MgorI2RlZmluZSBDU19SRVZFUkJfMTYwMDBfQTIgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgQ1NfUkVWRVJCXzE2MDAwX0IxICAgICAgICAgICAgICAgICAgICAgLTAuODIwNjc5CisjZGVmaW5lIENTX1JFVkVSQl8xNjAwMF9CMiAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBDU19SRVZFUkJfMTYwMDBfU0NBTEUgICAgICAgICAgICAgICAgICAgICAgICAxNQorCisvKiBSZXZlcmIgY29lZmZpY2llbnRzIGZvciAyMjA1MEh6IHNhbXBsZSByYXRlLCBzY2FsZWQgd2l0aCAxLjAzODAzMCAqLworI2RlZmluZSBDU19SRVZFUkJfMjIwNTBfQTAgICAgICAgICAgICAgICAgICAgICAwLjUxNjM5NgorI2RlZmluZSBDU19SRVZFUkJfMjIwNTBfQTEgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBDU19SRVZFUkJfMjIwNTBfQTIgICAgICAgICAgICAgICAgICAgIC0wLjUxNjM5NgorI2RlZmluZSBDU19SRVZFUkJfMjIwNTBfQjEgICAgICAgICAgICAgICAgICAgIC0wLjUxODUxMgorI2RlZmluZSBDU19SRVZFUkJfMjIwNTBfQjIgICAgICAgICAgICAgICAgICAgIC0wLjI5MDk5MAorI2RlZmluZSBDU19SRVZFUkJfMjIwNTBfU0NBTEUgICAgICAgICAgICAgICAgICAgICAgICAxNQorCisKKy8qIFJldmVyYiBjb2VmZmljaWVudHMgZm9yIDI0MDAwSHogc2FtcGxlIHJhdGUsIHNjYWxlZCB3aXRoIDEuMDM4MDMwICovCisjZGVmaW5lIENTX1JFVkVSQl8yNDAwMF9BMCAgICAgICAgICAgICAgICAgICAgICAgMC40Nzk1NjUKKyNkZWZpbmUgQ1NfUkVWRVJCXzI0MDAwX0ExICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBDU19SRVZFUkJfMjQwMDBfQTIgICAgICAgICAgICAgICAgICAgICAgLTAuNDc5NTY1CisjZGVmaW5lIENTX1JFVkVSQl8yNDAwMF9CMSAgICAgICAgICAgICAgICAgICAgICAtMC42Mzc3NDUKKyNkZWZpbmUgQ1NfUkVWRVJCXzI0MDAwX0IyICAgICAgICAgICAgICAgICAgICAgIC0wLjE5ODkxMgorI2RlZmluZSBDU19SRVZFUkJfMjQwMDBfU0NBTEUgICAgICAgICAgICAgICAgICAgICAgICAxNQorCisvKiBSZXZlcmIgY29lZmZpY2llbnRzIGZvciAzMjAwMEh6IHNhbXBsZSByYXRlLCBzY2FsZWQgd2l0aCAxLjAzODAzMCAqLworI2RlZmluZSBDU19SRVZFUkJfMzIwMDBfQTAgICAgICAgICAgICAgICAgICAgICAgMC4zODAzNDkKKyNkZWZpbmUgQ1NfUkVWRVJCXzMyMDAwX0ExICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIENTX1JFVkVSQl8zMjAwMF9BMiAgICAgICAgICAgICAgICAgICAgIC0wLjM4MDM0OQorI2RlZmluZSBDU19SRVZFUkJfMzIwMDBfQjEgICAgICAgICAgICAgICAgICAgICAtMC45NTA4NzMKKyNkZWZpbmUgQ1NfUkVWRVJCXzMyMDAwX0IyICAgICAgICAgICAgICAgICAgICAgIDAuMDQ5MTI3CisjZGVmaW5lIENTX1JFVkVSQl8zMjAwMF9TQ0FMRSAgICAgICAgICAgICAgICAgICAgICAgIDE1CisKKy8qIFJldmVyYiBjb2VmZmljaWVudHMgZm9yIDQ0MTAwSHogc2FtcGxlIHJhdGUsIHNjYWxlZCB3aXRoIDEuMDM4MDMwICovCisjZGVmaW5lIENTX1JFVkVSQl80NDEwMF9BMCAgICAgICAgICAgICAgICAgICAgICAgICAwLjI5NzM4OQorI2RlZmluZSBDU19SRVZFUkJfNDQxMDBfQTEgICAgICAgICAgICAgICAgICAgICAgICAgMC4wMDAwMDAKKyNkZWZpbmUgQ1NfUkVWRVJCXzQ0MTAwX0EyICAgICAgICAgICAgICAgICAgICAgICAgLTAuMjk3Mzg5CisjZGVmaW5lIENTX1JFVkVSQl80NDEwMF9CMSAgICAgICAgICAgICAgICAgICAgICAgIC0xLjIwMDQyMworI2RlZmluZSBDU19SRVZFUkJfNDQxMDBfQjIgICAgICAgICAgICAgICAgICAgICAgICAgMC4yNTY1MjkKKyNkZWZpbmUgQ1NfUkVWRVJCXzQ0MTAwX1NDQUxFICAgICAgICAgICAgICAgICAgICAgICAgMTQKKworLyogUmV2ZXJiIGNvZWZmaWNpZW50cyBmb3IgNDgwMDBIeiBzYW1wbGUgcmF0ZSwgc2NhbGVkIHdpdGggMS4wMzgwMzAgKi8KKyNkZWZpbmUgQ1NfUkVWRVJCXzQ4MDAwX0EwICAgICAgICAgICAgICAgICAgICAgICAwLjI3ODY2MQorI2RlZmluZSBDU19SRVZFUkJfNDgwMDBfQTEgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIENTX1JFVkVSQl80ODAwMF9BMiAgICAgICAgICAgICAgICAgICAgICAtMC4yNzg2NjEKKyNkZWZpbmUgQ1NfUkVWRVJCXzQ4MDAwX0IxICAgICAgICAgICAgICAgICAgICAgIC0xLjI1NDk5MworI2RlZmluZSBDU19SRVZFUkJfNDgwMDBfQjIgICAgICAgICAgICAgICAgICAgICAgIDAuMzAzMzQ3CisjZGVmaW5lIENTX1JFVkVSQl80ODAwMF9TQ0FMRSAgICAgICAgICAgICAgICAgICAgICAgIDE0CisKKyNpZmRlZiBISUdIRVJfRlMKKy8qIFJldmVyYiBjb2VmZmljaWVudHMgZm9yIDk2MDAwSHogc2FtcGxlIHJhdGUsIHNjYWxlZCB3aXRoIDAuOCAqLworLyogQmFuZCBwYXNzIGZpbHRlciB3aXRoIGZjMT01MDAgYW5kIGZjMj04MDAwKi8KKyNkZWZpbmUgQ1NfUkVWRVJCXzk2MDAwX0EwICAgICAgICAgICAgICAgICAgICAgICAwLjE2MDI0ODgKKyNkZWZpbmUgQ1NfUkVWRVJCXzk2MDAwX0ExICAgICAgICAgICAgICAgICAgICAgICAwLjAwMDAwMAorI2RlZmluZSBDU19SRVZFUkJfOTYwMDBfQTIgICAgICAgICAgICAgICAgICAgICAgLTAuMTYwMjQ4OAorI2RlZmluZSBDU19SRVZFUkJfOTYwMDBfQjEgICAgICAgICAgICAgICAgICAgICAgLTEuNTg1NDEzCisjZGVmaW5lIENTX1JFVkVSQl85NjAwMF9CMiAgICAgICAgICAgICAgICAgICAgICAgMC41OTkzNzcKKyNkZWZpbmUgQ1NfUkVWRVJCXzk2MDAwX1NDQUxFICAgICAgICAgICAgICAgICAgICAgICAgMTQKKworLyogUmV2ZXJiIGNvZWZmaWNpZW50cyBmb3IgMTkyMDAwSHogc2FtcGxlIHJhdGUsIHNjYWxlZCB3aXRoIDAuOCAqLworLyogQmFuZCBwYXNzIGZpbHRlciB3aXRoIGZjMT01MDAgYW5kIGZjMj04MDAwKi8KKyNkZWZpbmUgQ1NfUkVWRVJCXzE5MjAwMF9BMCAgICAgICAgICAgICAgICAgICAgICAgMC4wODc4MzY5CisjZGVmaW5lIENTX1JFVkVSQl8xOTIwMDBfQTEgICAgICAgICAgICAgICAgICAgICAgIDAuMDAwMDAwCisjZGVmaW5lIENTX1JFVkVSQl8xOTIwMDBfQTIgICAgICAgICAgICAgICAgICAgICAgLTAuMDg3ODM2OQorI2RlZmluZSBDU19SRVZFUkJfMTkyMDAwX0IxICAgICAgICAgICAgICAgICAgICAgIC0xLjc3NjU3NjQKKyNkZWZpbmUgQ1NfUkVWRVJCXzE5MjAwMF9CMiAgICAgICAgICAgICAgICAgICAgICAgMC43ODA0MDc2CisjZGVmaW5lIENTX1JFVkVSQl8xOTIwMDBfU0NBTEUgICAgICAgICAgICAgICAgICAgICAgICAxNAorCisjZW5kaWYKKworCisvKiBSZXZlcmIgR2FpbiBTZXR0aW5ncyAqLworI2RlZmluZSBMVkNTX0hFQURQSE9ORV9ERUxBWUdBSU4gICAgICAgICAgICAgICAwLjgwMDAwMCAgICAgICAgIC8qIEFsZ29yaXRobSBkZWxheSBwYXRoIGdhaW4gKi8KKyNkZWZpbmUgTFZDU19IRUFEUEhPTkVfT1VUUFVUR0FJTiAgICAgICAgICAgICAgMS4wMDAwMDAgICAgICAgICAvKiBBbGdvcml0aG0gb3V0cHV0IGdhaW4gKi8KKyNkZWZpbmUgTFZDU19IRUFEUEhPTkVfUFJPQ0dBSU4gICAgICAgICAgICAgICAgICAgMTg0MDMgICAgICAgICAvKiBQcm9jZXNzZWQgcGF0aCBnYWluICovCisjZGVmaW5lIExWQ1NfSEVBRFBIT05FX1VOUFJPQ0dBSU4gICAgICAgICAgICAgICAgIDE4NDAzICAgICAgICAgLyogVW5wcm9jZXNzZWQgcGF0aCBnYWluICovCisjZGVmaW5lIExWQ1NfSEVBRFBIT05FX0dBSU5DT1JSRUNUICAgICAgICAgICAgIDEuMDA5MzQzICAgICAgICAgLyogRGVsYXkgbWl4ZXIgZ2FpbiBjb3JyZWN0aW9uICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogVGhlIEVxdWFsaXNlciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKiBFcXVhbGlzZXIgY29lZmZpY2llbnRzIGZvciA4MDAwIEh6IHNhbXBsZSByYXRlLCBcCisgICBDUyBzY2FsZWQgd2l0aCAxLjAzODQ5NyBhbmQgQ1NFWCBzY2FsZWQgd2l0aCAwLjc3NTQ4MCAqLworI2RlZmluZSBDU19FUVVBTElTRVJfODAwMF9BMCAgICAgICAgICAgICAgICAgICAgIDEuMjYzMzEyCisjZGVmaW5lIENTX0VRVUFMSVNFUl84MDAwX0ExICAgICAgICAgICAgICAgICAgICAtMC42MDE3NDgKKyNkZWZpbmUgQ1NfRVFVQUxJU0VSXzgwMDBfQTIgICAgICAgICAgICAgICAgICAgIC0wLjI4MDY4MQorI2RlZmluZSBDU19FUVVBTElTRVJfODAwMF9CMSAgICAgICAgICAgICAgICAgICAgLTAuNDc1ODY1CisjZGVmaW5lIENTX0VRVUFMSVNFUl84MDAwX0IyICAgICAgICAgICAgICAgICAgICAtMC40MDgxNTQKKyNkZWZpbmUgQ1NfRVFVQUxJU0VSXzgwMDBfU0NBTEUgICAgICAgICAgICAgICAgICAgICAgMTQKKyNkZWZpbmUgQ1NFWF9FUVVBTElTRVJfODAwMF9BMCAgICAgICAgICAgICAgICAgICAgMC45NDMzNTcKKyNkZWZpbmUgQ1NFWF9FUVVBTElTRVJfODAwMF9BMSAgICAgICAgICAgICAgICAgICAtMC40NDkzNDUKKyNkZWZpbmUgQ1NFWF9FUVVBTElTRVJfODAwMF9BMiAgICAgICAgICAgICAgICAgICAtMC4yMDk1OTQKKyNkZWZpbmUgQ1NFWF9FUVVBTElTRVJfODAwMF9CMSAgICAgICAgICAgICAgICAgICAtMC40NzU4NjUKKyNkZWZpbmUgQ1NFWF9FUVVBTElTRVJfODAwMF9CMiAgICAgICAgICAgICAgICAgICAtMC40MDgxNTQKKyNkZWZpbmUgQ1NFWF9FUVVBTElTRVJfODAwMF9TQ0FMRSAgICAgICAgICAgICAgICAgICAgMTUKKworLyogRXF1YWxpc2VyIGNvZWZmaWNpZW50cyBmb3IgMTEwMjVIeiBzYW1wbGUgcmF0ZSwgXAorICAgQ1Mgc2NhbGVkIHdpdGggMS4wMjc3NjEgYW5kIENTRVggc2NhbGVkIHdpdGggMC43Njc0NjMgKi8KKyNkZWZpbmUgQ1NfRVFVQUxJU0VSXzExMDI1X0EwICAgICAgICAgICAgICAgICAgICAxLjEwMTE0NQorI2RlZmluZSBDU19FUVVBTElTRVJfMTEwMjVfQTEgICAgICAgICAgICAgICAgICAgIDAuMTM5MDIwCisjZGVmaW5lIENTX0VRVUFMSVNFUl8xMTAyNV9BMiAgICAgICAgICAgICAgICAgICAtMC44NjQ0MjMKKyNkZWZpbmUgQ1NfRVFVQUxJU0VSXzExMDI1X0IxICAgICAgICAgICAgICAgICAgICAwLjAyNDU0MQorI2RlZmluZSBDU19FUVVBTElTRVJfMTEwMjVfQjIgICAgICAgICAgICAgICAgICAgLTAuOTA4OTMwCisjZGVmaW5lIENTX0VRVUFMSVNFUl8xMTAyNV9TQ0FMRSAgICAgICAgICAgICAgICAgICAgIDE0CisjZGVmaW5lIENTRVhfRVFVQUxJU0VSXzExMDI1X0EwICAgICAgICAgICAgICAgICAgICAwLjk3NjA1OAorI2RlZmluZSBDU0VYX0VRVUFMSVNFUl8xMTAyNV9BMSAgICAgICAgICAgICAgICAgICAtMC42OTUzMjYKKyNkZWZpbmUgQ1NFWF9FUVVBTElTRVJfMTEwMjVfQTIgICAgICAgICAgICAgICAgICAgLTAuMDkwODA5CisjZGVmaW5lIENTRVhfRVFVQUxJU0VSXzExMDI1X0IxICAgICAgICAgICAgICAgICA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ElTRVJfMTYwMDBfQjIgICAgICAgICAgICAgICAgIC0wLjQyNTg5MworI2RlZmluZSBDU0VYX0VRVUFMSVNFUl8xNjAwMF9TQ0FMRSAgICAgICAgICAgICAgICAgICAxNAorCisvKiBFcXVhbGlzZXIgY29lZmZpY2llbnRzIGZvciAyMjA1MEh6IHNhbXBsZSByYXRlLCBcCisgICBDUyBzY2FsZWQgd2l0aCAxLjA0MTU3NiBhbmQgQ1NFWCBzY2FsZWQgd2l0aCAwLjc3Nzc3OSAqLworI2RlZmluZSBDU19FUVVBTElTRVJfMjIwNTBfQTAgICAgICAgICAgICAgICAgICAgMS4zODg2MDUKKyNkZWZpbmUgQ1NfRVFVQUxJU0VSXzIyMDUwX0ExICAgICAgICAgICAgICAgICAgLTEuMzA1Nzk5CisjZGVmaW5lIENTX0VRVUFMSVNFUl8yMjA1MF9BMiAgICAgICAgICAgICAgICAgICAwLjAzOTkyMgorI2RlZmluZSBDU19FUVVBTElTRVJfMjIwNTBfQjEgICAgICAgICAgICAgICAgICAtMC43MTk0OTQKKyNkZWZpbmUgQ1NfRVFVQUxJU0VSXzIyMDUwX0IyICAgICAgICAgICAgICAgICAgLTAuMjQzMjQ1CisjZGVmaW5lIENTX0VRVUFMSVNFUl8yMjA1MF9TQ0FMRSAgICAgICAgICAgICAgICAgICAgIDE0CisjZGVmaW5lIENTRVhfRVFVQUxJU0VSXzIyMDUwX0EwICAgICAgICAgICAgICAgICAgIDEuMjcyOTEwCisjZGVmaW5lIENTRVhfRVFVQUxJU0VSXzIyMDUwX0ExICAgICAgICAgICAgICAgICAgLTEuMzQxMDE0CisjZGVmaW5lIENTRVhfRVFVQUxJU0VSXzIyMDUwX0EyICAgICAgICAgICAgICAgICAgIDAuMTY3NDYyCisjZGVmaW5lIENTRVhfRVFVQUxJU0VSXzIyMDUwX0IxICAgICAgICAgICAgICAgICAgLTAuNjE0MjE5CisjZGVmaW5lIENTRVhfRVFVQUxJU0VSXzIyMDUwX0IyICAgICAgICAgICAgIC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ICAgICAgICAgICAgICAgIDEzCisKKy8qIEVxdWFsaXNlciBjb2VmZmljaWVudHMgZm9yIDQ4MDAwSHogc2FtcGxlIHJhdGUsIFwKKyAgIENTIHNjYWxlZCB3aXRoIDEuMDE4NjM1IGFuZCBDU0VYIHNjYWxlZCB3aXRoIDAuNzYwNjQ4ICovCisjZGVmaW5lIENTX0VRVUFMSVNFUl80ODAwMF9BMCAgICAgICAgICAgICAgICAgICAgMS42NDExNzcKKyNkZWZpbmUgQ1NfRVFVQUxJU0VSXzQ4MDAwX0ExICAgICAgICAgICAgICAgICAgIC0yLjM2NDY4NworI2RlZmluZSBDU19FUVVBTElTRVJfNDgwMDBfQTIgICAgICAgICAgICAgICAgICAgIDAuNzU5OTEwCisjZGVmaW5lIENTX0VRVUFMSVNFUl80ODAwMF9CMSAgICAgICAgICAgICAgICAgICAtMS4xNjY3NzQKKyNkZWZpbmUgQ1NfRVFVQUxJU0VSXzQ4MDAwX0IyICAgICAgICAgICAgICAgICAgICAwLjE3ODA3NAorI2RlZmluZSBDU19FUVVBTElTRVJfNDgwMDBfU0NBTEUgICAgICAgICAgICAgICAgICAgICAxMworI2RlZmluZSBDU0VYX0VRVUFMSVNFUl80ODAwMF9BMCAgICAgICAgICAgICAgICAgIDIuMDk5NjU1CisjZGVmaW5lIENTRVhfRVFVQUxJU0VSXzQ4MDAwX0ExICAgICAgICAgICAgICAgICAtMy4wNjUyMjAKKyNkZWZpbmUgQ1NFWF9FUVVBTElTRVJfNDgwMDBfQTIgICAgICAgICAgICAgICAgICAxLjAxMDQxNworI2RlZmluZSBDU0VYX0VRVUFMSVNFUl80ODAwMF9CMSAgICAgICAgICAgICAgICAgLTAuNjM0MDIxCisjZGVmaW5lIENTRVhfRVFVQUxJU0VSXzQ4MDAwX0IyICAgICAgICAgICAgICAgICAtMC4zNDczMzIKKyNkZWZpbmUgQ1NFWF9FUVVBTElTRVJfNDgwMDBfU0NBTEUgICAgICAgICAgICAgICAgICAgMTMKKworCisjaWZkZWYgSElHSEVSX0ZTCisjZGVmaW5lIENTX0VRVUFMSVNFUl85NjAwMF9BMCAgICAgICAgICAgICAgICAgICAgMS43ODQ0OTcKKyNkZWZpbmUgQ1NfRVFVQUxJU0VSXzk2MDAwX0ExICAgICAgICAgICAgICAgICAgIC0zLjAwMTQzNQorI2RlZmluZSBDU19FUVVBTElTRVJfOTYwMDBfQTIgICAgICAgICAgICAgICAgICAgIDEuMjI4NDIyCisjZGVmaW5lIENTX0VRVUFMSVNFUl85NjAwMF9CMSAgICAgICAgICAgICAgICAgICAtMS40Nzc4MDQKKyNkZWZpbmUgQ1NfRVFVQUxJU0VSXzk2MDAwX0IyICAgICAgICAgICAgICAgICAgICAwLjQ4MTM2OQorI2RlZmluZSBDU19FUVVBTElTRVJfOTYwMDBfU0NBTEUgICAgICAgICAgICAgICAgICAgICAxMworI2RlZmluZSBDU0VYX0VRVUFMSVNFUl85NjAwMF9BMCAgICAgICAgICAgICAgICAgIDIuNzU3MworI2RlZmluZSBDU0VYX0VRVUFMSVNFUl85NjAwMF9BMSAgICAgICAgICAgICAgICAgLTQuNjcyMQorI2RlZmluZSBDU0VYX0VRVUFMSVNFUl85NjAwMF9BMiAgICAgICAgICAgICAgICAgIDEuOTMxNworI2RlZmluZSBDU0VYX0VRVUFMSVNFUl85NjAwMF9CMSAgICAgICAgICAgICAgICAgLTAuOTcxNzE4CisjZGVmaW5lIENTRVhfRVFVQUxJU0VSXzk2MDAwX0IyICAgICAgICAgICAgICAgICAtMC4wMjEyMTYKKyNkZWZpbmUgQ1NFWF9FUVVBTElTRVJfOTYwMDBfU0NBTEUgICAgICAgICAgICAgICAgICAgMTMKKworI2RlZmluZSBDU19FUVVBTElTRVJfMTkyMDAwX0EwICAgICAgICAgICAgICAgICAgICAxLjg4OTU4MgorI2RlZmluZSBDU19FUVVBTElTRVJfMTkyMDAwX0ExICAgICAgICAgICAgICAgICAgIC0zLjQ1NjE0MAorI2RlZmluZSBDU19FUVVBTElTRVJfMTkyMDAwX0EyICAgICAgICAgICAgICAgICAgICAxLjU2OTg2NAorI2RlZmluZSBDU19FUVVBTElTRVJfMTkyMDAwX0IxICAgICAgICAgICAgICAgICAgIC0xLjcwMDc5OAorI2RlZmluZSBDU19FUVVBTElTRVJfMTkyMDAwX0IyICAgICAgICAgICAgICAgICAgICAwLjcwMTgyNAorI2RlZmluZSBDU19FUVVBTElTRVJfMTkyMDAwX1NDQUxFICAgICAgICAgICAgICAgICAgICAgMTMKKyNkZWZpbmUgQ1NFWF9FUVVBTElTRVJfMTkyMDAwX0EwICAgICAgICAgICAgICAgICAgMy40MjczCisjZGVmaW5lIENTRVhfRVFVQUxJU0VSXzE5MjAwMF9BMSAgICAgICAgICAgICAgICAgLTYuMjkzNgorI2RlZmluZSBDU0VYX0VRVUFMSVNFUl8xOTIwMDBfQTIgICAgICAgICAgICAgICAgICAyLjg3MjAKKyNkZWZpbmUgQ1NFWF9FUVVBTElTRVJfMTkyMDAwX0IxICAgICAgICAgICAgICAgICAtMS4zMTA3NAorI2RlZmluZSBDU0VYX0VRVUFMSVNFUl8xOTIwMDBfQjIgICAgICAgICAgICAgICAgIDAuMzEzMTIKKyNkZWZpbmUgQ1NFWF9FUVVBTElTRVJfMTkyMDAwX1NDQUxFICAgICAgICAgICAgICAgICAgIDEzCisjZW5kaWYKKworCisjZGVmaW5lIExWQ1NfSEVBRFBIT05FX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgICAyICAgICAgICAgICAgICAvKiBPdXRwdXQgU2hpZnQgKi8KKyNkZWZpbmUgTFZDU19IRUFEUEhPTkVfU0hJRlRMT1NTICAgICAgICAgICAgICAgICAgMC44NDc3NzM1ICAgICAgICAgIC8qIE91dHB1dCBTaGlmdCBsb3NzICovCisjZGVmaW5lIExWQ1NfSEVBRFBIT05FX0dBSU4gICAgICAgICAgICAgICAgICAgICAgIDAuMjA4NzQ2NSAgICAgICAgICAvKiBVbnByb2Nlc3NlZCBwYXRoIGdhaW4gKi8KKyNkZWZpbmUgTFZDU19FWF9IRUFEUEhPTkVfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgIDMgICAgICAgICAgICAgIC8qIEVYIE91dHB1dCBTaGlmdCAqLworI2RlZmluZSBMVkNTX0VYX0hFQURQSE9ORV9TSElGVExPU1MgICAgICAgICAgICAgICAwLjU2OTIyNSAgICAgICAgICAgLyogRVggT3V0cHV0IFNoaWZ0IGxvc3MgKi8KKyNkZWZpbmUgTFZDU19FWF9IRUFEUEhPTkVfR0FJTiAgICAgICAgICAgICAgICAgICAgMC4wNzc5NDQyNSAgICAgICAgIC8qIEVYIFVucHJvY2Vzc2VkIHBhdGggZ2FpbiAqLworI2Vsc2UKIC8qIFN0ZXJlbyBFbmhhbmNlciBjb2VmZmljaWVudHMgZm9yIDgwMDAgSHogc2FtcGxlIHJhdGUsIHNjYWxlZCB3aXRoIDAuMTYxMjU4ICovCiAjZGVmaW5lIENTX01JRERMRV84MDAwX0EwICAgICAgICAgICAgICAgICAgICAgICAgICA3NDYyICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4yMjc3MjAgKi8KICNkZWZpbmUgQ1NfTUlERExFXzgwMDBfQTEgICAgICAgICAgICAgICAgICAgICAgICAoLTcwNDkpICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4yMTUxMjUgKi8KQEAgLTM5NCw1ICs4NTAsNiBAQAogI2RlZmluZSBMVkNTX0VYX0hFQURQSE9ORV9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgMyAgICAgICAgICAgICAgLyogRVggT3V0cHV0IFNoaWZ0ICovCiAjZGVmaW5lIExWQ1NfRVhfSEVBRFBIT05FX1NISUZUTE9TUyAgICAgICAgICAgICAgIDE4NjAwICAgICAgICAgICAgICAvKiBFWCBPdXRwdXQgU2hpZnQgbG9zcyAqLwogI2RlZmluZSBMVkNTX0VYX0hFQURQSE9ORV9HQUlOICAgICAgICAgICAgICAgICAgICAgNTEwOCAgICAgICAgICAgICAgLyogR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saWJlZmZlY3RzL2x2bS9saWIvU3RlcmVvV2lkZW5pbmcvc3JjL0xWQ1NfUHJpdmF0ZS5oCisrKyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9TdGVyZW9XaWRlbmluZy9zcmMvTFZDU19Qcml2YXRlLmgKQEAgLTk1LDEwICs5NSwxNyBAQAogLyogVm9sdW1lIGNvcnJlY3Rpb24gc3RydWN0dXJlICovCiB0eXBlZGVmIHN0cnVjdAogeworI2lmZGVmIEJVSUxEX0ZMT0FUCisgICAgTFZNX0ZMT0FUICAgQ29tcEZ1bGw7ICAgICAgICAgICAgICAgICAgICAgICAvKiBQb3N0IENTIGNvbXByZXNzaW9uIDEwMCUgZWZmZWN0ICovCisgICAgTFZNX0ZMT0FUICAgQ29tcE1pbjsgICAgICAgICAgICAgICAgICAgICAgICAvKiBQb3N0IENTIGNvbXByZXNzaW9uIDAlIGVmZmVjdCAqLworICAgIExWTV9GTE9BVCAgIEdhaW5GdWxsOyAgICAgICAgICAgICAgICAgICAgICAgLyogQ1MgZ2FpbiBjb3JyZWN0IDEwMCUgZWZmZWN0ICovCisgICAgTFZNX0ZMT0FUICAgR2Fpbk1pbjsgICAgICAgICAgICAgICAgICAgICAgICAvKiBDUyBnYWluIGNvcnJlY3QgMCUgZWZmZWN0ICovCisjZWxzZQogICAgIExWTV9JTlQxNiAgIENvbXBGdWxsOyAgICAgICAgICAgICAgICAgICAgICAgLyogUG9zdCBDUyBjb21wcmVzc2lvbiAxMDAlIGVmZmVjdCAqLwogICAgIExWTV9JTlQxNiAgIENvbXBNaW47ICAgICAgICAgICAgICAgICAgICAgICAgLyogUG9zdCBDUyBjb21wcmVzc2lvbiAwJSBlZmZlY3QgKi8KICAgICBMVk1fSU5UMTYgICBHYWluRnVsbDsgICAgICAgICAgICAgICAgICAgICAgIC8qIENTIGdhaW4gY29ycmVjdCAxMDAlIGVmZmVjdCAqLwogICAgIExWTV9JTlQxNiAgIEdhaW5NaW47ICAgICAgICAgICAg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8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQlVJTERfRkxPQVQKK0xWQ1NfUmV0dXJuU3RhdHVzX2VuIExWQ1NfUHJvY2Vzc19DUyhMVkNTX0hhbmRsZV90ICAgICAgICAgICAgICBoSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICAgICAgICAgICAgKnBJbkRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICAgICAgKnBPdXREYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgICAgICAgICAgICAgICAgIE51bVNhbXBsZXMpCit7CisgICAgY29uc3QgTFZNX0ZMT0FUICAgICAqcElucHV0OworICAgIExWQ1NfSW5zdGFuY2VfdCAgICAgKnBJbnN0YW5jZSA9IChMVkNTX0luc3RhbmNlX3QgICopaEluc3RhbmNlOworICAgIExWTV9GTE9BVCAgICAgICAgICAgKnBTY3JhdGNoOworICAgIExWQ1NfUmV0dXJuU3RhdHVzX2VuIGVycjsKIAorICAgIHBTY3JhdGNoICA9IChMVk1fRkxPQVQgKikgXAorICAgICAgICAgICAgICAgICAgcEluc3RhbmNlLT5NZW1vcnlUYWJsZS5SZWdpb25bTFZDU19NRU1SRUdJT05fVEVNUE9SQVJZX0ZBU1RdLnBCYXNlQWRkcmVzczsKKworICAgIC8qCisgICAgICogQ2hlY2sgaWYgdGhlIHByb2Nlc3NpbmcgaXMgaW5wbGFjZQorICAgICAqLworICAgIGlmIChwSW5EYXRhID09IHBPdXREYXRhKQorICAgIHsKKyAgICAgICAgLyogUHJvY2Vzc2luZyBpbnBsYWNlICovCisgICAgICAgIHBJbnB1dCA9IHBTY3JhdGNoICsgKDIgKiBOdW1TYW1wbGVzKTsKKyAgICAgICAgQ29weV9GbG9hdCgoTFZNX0ZMT0FUICopcEluRGF0YSwgICAgICAgICAgIC8qIFNvdXJjZSAqLworICAgICAgICAgICAgICAgICAgIChMVk1fRkxPQVQgKilwSW5wdXQsICAgICAgICAgICAgLyogRGVzdGluYXRpb24gKi8KKyAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KSgyICogTnVtU2FtcGxlcykpOyAgICAgLyogTGVmdCBhbmQgcmlnaHQgKi8KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgLyogUHJvY2Vzc2luZyBvdXRwbGFjZSAqLworICAgICAgICBwSW5wdXQgPSBwSW5EYXRhOworICAgIH0KKworICAgIC8qCisgICAgICogQ2FsbCB0aGUgc3RlcmVvIGVuaGFuY2VyCisgICAgICovCisgICAgZXJyID0gTFZDU19TdGVyZW9FbmhhbmNlcihoSW5zdGFuY2UsICAgICAgICAgICAgICAvKiBJbnN0YW5jZSBoYW5kbGUgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJbkRhdGEsICAgICAgICAgICAgICAgICAgICAvKiBQb2ludGVyIHRvIHRoZSBpbnB1dCBkYXRhICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwT3V0RGF0YSwgICAgICAgICAgICAgICAgICAgLyogUG9pbnRlciB0byB0aGUgb3V0cHV0IGRhdGEgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE51bVNhbXBsZXMpOyAgICAgICAgICAgICAgICAvKiBOdW1iZXIgb2Ygc2FtcGxlcyB0byBwcm9jZXNzICovCisKKyAgICAvKgorICAgICAqIENhbGwgdGhlIHJldmVyYiBnZW5lcmF0b3IKKyAgICAgKi8KKyAgICBlcnIgPSBMVkNTX1JldmVyYkdlbmVyYXRvcihoSW5zdGFuY2UsICAgICAgICAgICAgIC8qIEluc3RhbmNlIGhhbmRsZSAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBPdXREYXRhLCAgICAgICAgICAgICAgICAgIC8qIFBvaW50ZXIgdG8gdGhlIGlucHV0IGRhdGEgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwT3V0RGF0YSwgICAgICAgICAgICAgICAgICAvKiBQb2ludGVyIHRvIHRoZSBvdXRwdXQgZGF0YSAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE51bVNhbXBsZXMpOyAgICAgICAgICAgICAgIC8qIE51bWJlciBvZiBzYW1wbGVzIHRvIHByb2Nlc3MgKi8KKyAgICAKKyAgICAvKgorICAgICAqIENhbGwgdGhlIGVxdWFsaXNlcgorICAgICAqLworICAgIGVyciA9IExWQ1NfRXF1YWxpc2VyKGhJbnN0YW5jZSwgICAgICAgICAgICAgICAgICAgLyogSW5zdGFuY2UgaGFuZGxlICovCisgICAgICAgICAgICAgICAgICAgICAgICAgcE91dERhdGEsICAgICAgICAgICAgICAgICAgICAgICAgLyogUG9pbnRlciB0byB0aGUgaW5wdXQgZGF0YSAqLworICAgICAgICAgICAgICAgICAgICAgICAgIE51bVNhbXBsZXMpOyAgICAgICAgICAgICAgICAgICAgIC8qIE51bWJlciBvZiBzYW1wbGVzIHRvIHByb2Nlc3MgKi8KKworICAgIC8qCisgICAgICogQ2FsbCB0aGUgYnlwYXNzIG1peGVyCisgICAgICovCisgICAgZXJyID0gTFZDU19CeXBhc3NNaXhlcihoSW5zdGFuY2UsICAgICAgICAgICAgICAgICAvKiBJbnN0YW5jZSBoYW5kbGUgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBPdXREYXRhLCAgICAgICAgICAgICAgICAgICAgICAvKiBQb2ludGVyIHRvIHRoZSBwcm9jZXNzZWQgZGF0YSAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgcElucHV0LCAgICAgICAgICAgICAgICAgICAgICAgIC8qIFBvaW50ZXIgdG8gdGhlIGlucHV0ICh1bnByb2Nlc3NlZCkgZGF0YSAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgcE91dERhdGEsICAgICAgICAgICAgICAgICAgICAgIC8qIFBvaW50ZXIgdG8gdGhlIG91dHB1dCBkYXRhICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICBOdW1TYW1wbGVzKTsgICAgICAgICAgICAgICAgICAgLyogTnVtYmVyIG9mIHNhbXBsZXMgdG8gcHJvY2VzcyAqLworCisgICAgaWYoZXJyICE9IExWQ1NfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIHJldHVybiBlcnI7CisgICAgfQorCisgICAgcmV0dXJuKExWQ1NfU1VDQ0VTUyk7Cit9CisjZWxzZQogTFZDU19SZXR1cm5TdGF0dXNfZW4gTFZDU19Qcm9jZXNzX0NTKExWQ1NfSGFuZGxlX3QgICAgICAgICAgICAgIGhJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMTYgICAgICAgICAgICAqcEluRGF0YSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAqcE91dERhdGEsCkBAIC0xMzMsNyArMjAzLDcgQEAKIAogICAgIHJldHVybihMVkNTX1NVQ0NFU1MpOwogfQotCisjZW5kaWYKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgIExWQ1NfUHJvY2VzcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KQEAgLTE2MCw3ICsyMzAsMTcwIEBACiAvKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQlVJTERfRkxPQVQKK0xWQ1NfUmV0dXJuU3RhdHVzX2VuIExWQ1NfUHJvY2VzcyhMVkNTX0hhbmRsZV90ICAgICAgICAgICAgIGhJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fRkxPQVQgICAgICAgICAgICpwSW5EYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICAgKnBPdXREYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgICAgICAgICAgICAgICAgTnVtU2FtcGxlcykKK3sKIAorICAgIExWQ1NfSW5zdGFuY2VfdCAqcEluc3RhbmNlID0gKExWQ1NfSW5zdGFuY2VfdCAgKiloSW5zdGFuY2U7CisgICAgTFZDU19SZXR1cm5TdGF0dXNfZW4gZXJyOworCisgICAgLyoKKyAgICAgKiBDaGVjayB0aGUgbnVtYmVyIG9mIHNhbXBsZXMgaXMgbm90IHRvbyBsYXJnZQorICAgICAqLworICAgIGlmIChOdW1TYW1wbGVzID4gcEluc3RhbmNlLT5DYXBhYmlsaXRpZXMuTWF4QmxvY2tTaXplKQorICAgIHsKKyAgICAgICAgcmV0dXJuKExWQ1NfVE9PTUFOWVNBTVBMRVMpOworICAgIH0KKworICAgIC8qCisgICAgICogQ2hlY2sgaWYgdGhlIGFsZ29yaXRobSBpcyBlbmFibGVkCisgICAgICovCisgICAgaWYgKHBJbnN0YW5jZS0+UGFyYW1zLk9wZXJhdGluZ01vZGUgIT0gTFZDU19PRkYpCisgICAgeworICAgICAgICAvKgorICAgICAgICAgKiBDYWxsIENTIHByb2Nlc3MgZnVuY3Rpb24KKyAgICAgICAgICovCisgICAgICAgICAgICBlcnIgPSBMVkNTX1Byb2Nlc3NfQ1MoaEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJbkRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE91dERhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTnVtU2FtcGxlcyk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIAorICAgICAgICAvKgorICAgICAgICAgKiBDb21wcmVzcyB0byByZWR1Y2UgZXhwYW5zaW9uIGVmZmVjdCBvZiBDb25jZXJ0IFNvdW5kIGFuZCBjb3JyZWN0IHZvbHVtZQorICAgICAgICAgKiBkaWZmZXJlbmNlcyBmb3IgZGlmZmVyZW5jZSBzZXR0aW5ncy4gTm90IGFwcGxpZWQgaW4gdGVzdCBtb2RlcworICAgICAgICAgKi8KKyAgICAgICAgaWYgKChwSW5zdGFuY2UtPlBhcmFtcy5PcGVyYXRpbmdNb2RlID09IExWQ1NfT04pJiYgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwSW5zdGFuY2UtPlBhcmFtcy5Db21wcmVzc29yTW9kZSA9PSBMVk1fTU9ERV9PTikpCisgICAgICAgIHsKKyAgICAgICAgICAgIExWTV9GTE9BVCBHYWluID0gcEluc3RhbmNlLT5Wb2xDb3JyZWN0LkNvbXBNaW47CisgICAgICAgICAgICBMVk1fRkxPQVQgQ3VycmVudDE7CisKKyAgICAgICAgICAgIEN1cnJlbnQxID0gTFZDX01peGVyX0dldEN1cnJlbnQoJnBJbnN0YW5jZS0+QnlwYXNzTWl4Lk1peGVyX0luc3RhbmNlLk1peGVyU3RyZWFtWzBdKTsKKyAgICAgICAgICAgIEdhaW4gPSAoTFZNX0ZMT0FUKSggIHBJbnN0YW5jZS0+Vm9sQ29ycmVjdC5Db21wTWluCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSAoKChMVk1fRkxPQVQpcEluc3RhbmNlLT5Wb2xDb3JyZWN0LkNvbXBNaW4gICogKEN1cnJlbnQxKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAoKChMVk1fRkxPQVQpcEluc3RhbmNlLT5Wb2xDb3JyZWN0LkNvbXBGdWxsICogKEN1cnJlbnQxKSkpKTsKKworICAgICAgICAgICAgaWYoTnVtU2FtcGxlcyA8IExWQ1NfQ09NUEdBSU5GUkFNRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBOb25MaW5Db21wX0Zsb2F0KEdhaW4sICAgICAgICAgICAgICAgICAgICAvKiBDb21wcmVzc29yIGdhaW4gc2V0dGluZyAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE91dERhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwT3V0RGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMzIpKDIgKiBOdW1TYW1wbGVzKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICBHYWluU3RlcDsKKyAgICAgICAgICAgICAgICBMVk1fRkxPQVQgIEZpbmFsR2FpbjsKKyAgICAgICAgICAgICAgICBMVk1fSU5UMTYgIFNhbXBsZVRvUHJvY2VzcyA9IE51bVNhbXBsZXM7CisgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAqcE91dFB0cjsKKworICAgICAgICAgICAgICAgIC8qIExhcmdlIGNoYW5nZXMgaW4gR2FpbiBjYW4gY2F1c2UgY2xpY2tzIGluIG91dHB1dAorICAgICAgICAgICAgICAgICAgIFNwbGl0IGRhdGEgaW50byBzbWFsbCBibG9ja3MgYW5kIHVzZSBpbnRlcnBvbGF0ZWQgZ2FpbiB2YWx1ZXMgKi8KKworICAgICAgICAgICAgICAgIEdhaW5TdGVwID0gKExWTV9GTE9BVCkoKChHYWluLXBJbnN0YW5jZS0+Q29tcHJlc3NHYWluKSAqIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWQ1NfQ09NUEdBSU5GUkFNRSkgLyBOdW1TYW1wbGVzKTsKKworICAgICAgICAgICAgICAgIGlmKChHYWluU3RlcCA9PSAwKSAmJiAocEluc3RhbmNlLT5Db21wcmVzc0dhaW4gPCBHYWluKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEdhaW5TdGVwID0gMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYoKEdhaW5TdGVwID09IDApICYmIChwSW5zdGFuY2UtPkNvbXByZXNzR2FpbiA+IEdhaW4pKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBHYWluU3RlcCA9IC0xOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgRmluYWxHYWluID0gR2FpbjsKKyAgICAgICAgICAgICAgICBHYWluID0gcEluc3RhbmNlLT5Db21wcmVzc0dhaW47CisgICAgICAgICAgICAgICAgcE91dFB0ciA9IHBPdXREYXRhOworCisgICAgICAgICAgICAgICAgd2hpbGUoU2FtcGxlVG9Qcm9jZXNzID4gMCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEdhaW4gPSAoTFZNX0ZMT0FUKShHYWluICsgR2FpblN0ZXApOworICAgICAgICAgICAgICAgICAgICBpZigoR2FpblN0ZXAgPiAwKSAmJiAoRmluYWxHYWluIDw9IEdhaW4pKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBHYWluID0gRmluYWxHYWluOworICAgICAgICAgICAgICAgICAgICAgICAgR2FpblN0ZXAgPSAwOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaWYoKEdhaW5TdGVwIDwgMCkgJiYgKEZpbmFsR2FpbiA+IEdhaW4pKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBHYWluID0gRmluYWxHYWluOworICAgICAgICAgICAgICAgICAgICAgICAgR2FpblN0ZXAgPSAwOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaWYoU2FtcGxlVG9Qcm9jZXNzID4gTFZDU19DT01QR0FJTkZSQU1FKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBOb25MaW5Db21wX0Zsb2F0KEdhaW4sICAgICAgICAgICAgICAgICAgICAvKiBDb21wcmVzc29yIGdhaW4gc2V0dGluZyAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwT3V0UHRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwT3V0UHRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDMyKSgyICogTFZDU19DT01QR0FJTkZSQU1FKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBwT3V0UHRyICs9ICgyICogTFZDU19DT01QR0FJTkZSQU1FKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIFNhbXBsZVRvUHJvY2VzcyA9IChMVk1fSU5UMTYpKFNhbXBsZVRvUHJvY2VzcyAtIExWQ1NfQ09NUEdBSU5GUkFNRSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBOb25MaW5Db21wX0Zsb2F0KEdhaW4sICAgICAgICAgICAgICAgICAgICAvKiBDb21wcmVzc29yIGdhaW4gc2V0dGluZyAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwT3V0UHRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwT3V0UHRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDMyKSgyICogU2FtcGxlVG9Qcm9jZXNzKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBTYW1wbGVUb1Byb2Nlc3MgPSAwOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8qIFN0b3JlIGdhaW4gdmFsdWUqLworICAgICAgICAgICAgcEluc3RhbmNlLT5Db21wcmVzc0dhaW4gPSBHYWluOworICAgICAgICB9CisKKworICAgICAgICBpZihwSW5zdGFuY2UtPmJJbk9wZXJhdGluZ01vZGVUcmFuc2l0aW9uID09IExWTV9UUlVFKXsKKworICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAqIFJlLWluaXQgYnlwYXNzIG1peCB3aGVuIHRpbWVyIGhhcyBjb21wbGV0ZWQKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgaWYgKChwSW5zdGFuY2UtPmJUaW1lckRvbmUgPT0gTFZNX1RSVUUpICYmCisgICAgICAgICAgICAgICAgKHBJbnN0YW5jZS0+QnlwYXNzTWl4Lk1peGVyX0luc3RhbmNlLk1peGVyU3RyZWFtWzFdLkNhbGxiYWNrU2V0ID09IDApKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGVyciA9IExWQ1NfQnlwYXNzTWl4SW5pdChoSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwSW5zdGFuY2UtPlBhcmFtcyk7CisKKyAgICAgICAgICAgICAgICBpZihlcnIgIT0gTFZDU19TVUNDRVNTKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVycjsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgTFZNX1RpbWVyICggJnBJbnN0YW5jZS0+VGltZXJJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGlmIChwSW5EYXRhICE9IHBPdXREYXRhKQorICAgICAgICB7CisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogVGhlIGFsZ29yaXRobSBpcyBkaXNhYmxlZCBzbyBqdXN0IGNvcHkgdGhlIGRhdGEKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgQ29weV9GbG9hdCgoTFZNX0ZMT0FUICopcEluRGF0YSwgICAgICAgICAgICAgICAvKiBTb3VyY2UgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgKExWTV9GTE9BVCAqKXBPdXREYXRhLCAgICAgICAgICAgICAgICAgIC8qIERlc3RpbmF0aW9uICovCisgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpKDIgKiBOdW1TYW1wbGVzKSk7ICAgICAgICAgICAgIC8qIExlZnQgYW5kIHJpZ2h0ICovCisgICAgICAgIH0KKyAgICB9CisKKworICAgIHJldHVybihMVkNTX1NVQ0NFU1MpOworfQorI2Vsc2UKIExWQ1NfUmV0dXJuU3RhdHVzX2VuIExWQ1NfUHJvY2VzcyhMVkNTX0hhbmRsZV90ICAgICAgICAgICAgIGhJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMTYgICAgICAgICAgICpwSW5EYXRhLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgKnBPdXREYXRhLApAQCAtMzIxLDE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AgKnBQYXJhbXMpCit7CiAKKyAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICBEZWxheTsKKyAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICBPZmZzZXQ7CisgICAgTFZDU19JbnN0YW5jZV90ICAgICAgICAgKnBJbnN0YW5jZSA9IChMVkNTX0luc3RhbmNlX3QgICopaEluc3RhbmNlOworICAgIExWQ1NfUmV2ZXJiR2VuZXJhdG9yX3QgICpwQ29uZmlnICAgPSAoTFZDU19SZXZlcmJHZW5lcmF0b3JfdCAqKSZwSW5zdGFuY2UtPlJldmVyYmVyYXRpb247CisgICAgTFZDU19EYXRhX3QgICAgICAgICAgICAgKnBEYXRhOworICAgIExWQ1NfQ29lZmZpY2llbnRfdCAgICAgICpwQ29lZmZpY2llbnRzOworICAgIEJRX0ZMT0FUX0NvZWZzX3QgICAgICAgICBDb2VmZnM7CisgICAgY29uc3QgQmlxdWFkQTAxMkIxMkNvZWZzU1BfdCAgKnBSZXZlcmJDb2VmVGFibGU7CisKKworICAgIHBEYXRhID0gKExWQ1NfRGF0YV90ICopIFwKKyAgICAgICAgICAgICAgICAgcEluc3RhbmNlLT5NZW1vcnlUYWJsZS5SZWdpb25bTFZDU19NRU1SRUdJT05fUEVSU0lTVEVOVF9GQVNUX0RBVEFdLnBCYXNlQWRkcmVzczsKKworICAgIHBDb2VmZmljaWVudHMgPSAoTFZDU19Db2VmZmljaWVudF90ICopIFwKKyAgICAgICAgICAgICAgICAgcEluc3RhbmNlLT5NZW1vcnlUYWJsZS5SZWdpb25bTFZDU19NRU1SRUdJT05fUEVSU0lTVEVOVF9GQVNUX0NPRUZdLnBCYXNlQWRkcmVzczsKKworICAgIC8qCisgICAgICogSW5pdGlhbGlzZSB0aGUgZGVsYXkgYW5kIGZpbHRlcnMgaWY6CisgICAgICogIC0gdGhlIHNhbXBsZSByYXRlIGhhcyBjaGFuZ2VkCisgICAgICogIC0gdGhlIHNwZWFrZXIgdHlwZSBoYXMgY2hhbmdlZCB0byBvciBmcm9tIHRoZSBtb2JpbGUgc3BlYWtlcgorICAgICAqLworICAgIGlmKHBJbnN0YW5jZS0+UGFyYW1zLlNhbXBsZVJhdGUgIT0gcFBhcmFtcy0+U2FtcGxlUmF0ZSApICAgICAgLyogU2FtcGxlIHJhdGUgY2hhbmdlIHRlc3QgKi8KKworICAgIHsKKyAgICAgICAgLyoKKyAgICAgICAgICogU2V0dXAgdGhlIGRlbGF5CisgICAgICAgICAqLworICAgICAgICBEZWxheSA9IChMVk1fVUlOVDE2KUxWQ1NfU3RlcmVvRGVsYXlDU1soTFZNX1VJTlQxNilwUGFyYW1zLT5TYW1wbGVSYXRlXTsKKworCisgICAgICAgIHBDb25maWctPkRlbGF5U2l6ZSAgICAgID0gKExWTV9JTlQxNikoMiAqIERlbGF5KTsKKyAgICAgICAgcENvbmZpZy0+RGVsYXlPZmZzZXQgICAgPSAwOworICAgICAgICBMb2FkQ29uc3RfRmxvYXQoMCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFZhbHVlICovCisgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0ZMT0FUICopJnBDb25maWctPlN0ZXJlb1NhbXBsZXNbMF0sICAgICAgLyogRGVzdGluYXRpb24gKi8KKyAgICAgICAgICAgICAgICAgICAgICAgIC8qIE51bWJlciBvZiB3b3JkcyAqLworICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9VSU5UMTYpKHNpemVvZihwQ29uZmlnLT5TdGVyZW9TYW1wbGVzKSAvIHNpemVvZihMVk1fRkxPQVQpKSk7CisgICAgICAgIC8qCisgICAgICAgICAqIFNldHVwIHRoZSBmaWx0ZXJzCisgICAgICAgICAqLworICAgICAgICBPZmZzZXQgPSAoTFZNX1VJTlQxNilwUGFyYW1zLT5TYW1wbGVSYXRlOworICAgICAgICBwUmV2ZXJiQ29lZlRhYmxlID0gKEJpcXVhZEEwMTJCMTJDb2Vmc1NQX3QqKSZMVkNTX1JldmVyYkNvZWZUYWJsZVswXTsKKworICAgICAgICAvKiBDb252ZXJ0IGluY29taW5nIGNvZWZmaWNpZW50cyB0byB0aGUgcmVxdWlyZWQgZm9ybWF0L29yZGVyaW5nICovCisgICAgICAgIENvZWZmcy5BMCA9IChMVk1fRkxPQVQpcFJldmVyYkNvZWZUYWJsZVtPZmZzZXRdLkEwOworICAgICAgICBDb2VmZnMuQTEgPSAoTFZNX0ZMT0FUKXBSZXZlcmJDb2VmVGFibGVbT2Zmc2V0XS5BMTsKKyAgICAgICAgQ29lZmZzLkEyID0gKExWTV9GTE9BVClwUmV2ZXJiQ29lZlRhYmxlW09mZnNldF0uQTI7CisgICAgICAgIENvZWZmcy5CMSA9IChMVk1fRkxPQVQpLXBSZXZlcmJDb2VmVGFibGVbT2Zmc2V0XS5CMTsKKyAgICAgICAgQ29lZmZzLkIyID0gKExWTV9GTE9BVCktcFJldmVyYkNvZWZUYWJsZVtPZmZzZXRdLkIyOworCisgICAgICAgIExvYWRDb25zdF9GbG9hdCgwLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFZhbHVlICovCisgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKSZwRGF0YS0+UmV2ZXJiQmlxdWFkVGFwcywgIC8qIERlc3RpbmF0aW9uIENhc3QgdG8gdm9pZDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBubyBkZXJlZmVyZW5jaW5nIGluIGZ1bmN0aW9uKi8KKyAgICAgICAgICAgICAgICAgICAgICAgIC8qIE51bWJlciBvZiB3b3JkcyAqLworICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9VSU5UMTYpKHNpemVvZihwRGF0YS0+UmV2ZXJiQmlxdWFkVGFwcykgLyBzaXplb2YoTFZNX0ZMT0FUKSkpOworCisgICAgICAgIEJRXzJJX0QxNkYxNkNzc19UUkNfV1JBXzAxX0luaXQoJnBDb2VmZmljaWVudHMtPlJldmVyYkJpcXVhZEluc3RhbmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwRGF0YS0+UmV2ZXJiQmlxdWFkVGFwcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmQ29lZmZzKTsKKworICAgICAgICAvKiBDYWxsYmFja3MgKi8KKyAgICAgICAgc3dpdGNoKHBSZXZlcmJDb2VmVGFibGVbT2Zmc2V0XS5TY2FsZSkKKyAgICAgICAgeworICAgICAgICAgICAgY2FzZSAxNDoKKyAgICAgICAgICAgICAgICBwQ29uZmlnLT5wQmlxdWFkQ2FsbEJhY2sgID0gQlFfMklfRDE2RjE2QzE0X1RSQ19XUkFfMDE7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDE1OgorICAgICAgICAgICAgICAgIHBDb25maWctPnBCaXF1YWRDYWxsQmFjayAgPSBCUV8ySV9EMTZGMTZDMTVfVFJDX1dSQV8wMTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisKKyAgICAgICAgLyoKKyAgICAgICAgICogU2V0dXAgdGhlIG1peGVyCisgICAgICAgICAqLworICAgICAgICBwQ29uZmlnLT5Qcm9jR2FpbiA9IChMVk1fVUlOVDE2KShIRUFEUEhPTkVHQUlOUFJPQyk7CisgICAgICAgIHBDb25maWctPlVucHJvY0dhaW4gID0gKExWTV9VSU5UMTYpKEhFQURQSE9ORUdBSU5VTlBST0MpOworICAgIH0KKworICAgIGlmKHBJbnN0YW5jZS0+UGFyYW1zLlJldmVyYkxldmVsICE9IHBQYXJhbXMtPlJldmVyYkxldmVsKQorICAgIHsKKyAgICAgICAgTFZNX0lOVDMyICAgUmV2ZXJiUGVyY2VudGFnZSA9IDgzODg2OyAgICAgIC8vIDEgUGVyY2VudCBSZXZlcmIgaS5lIDEvMTAwIGluIFEgMjMgZm9ybWF0CisgICAgICAgIFJldmVyYlBlcmNlbnRhZ2UgKj0gcFBhcmFtcy0+UmV2ZXJiTGV2ZWw7ICAvLyBBY3R1YWwgUmV2ZXJiIExldmVsIGluIFEgMjMgZm9ybWF0CisgICAgICAgIHBDb25maWctPlJldmVyYkxldmVsID0gKChMVk1fRkxPQVQpKFJldmVyYlBlcmNlbnRhZ2U+PjgpKSAvIDMyNzY3LjBmOworICAgIH0KKyAgICByZXR1cm4oTFZDU19TVUNDRVNTKTsKK30KKyNlbHNlCiBMVkNTX1JldHVyblN0YXR1c19lbiBMVkNTX1JldmVyYkdlbmVyYXRvckluaXQoTFZDU19IYW5kbGVfdCAgICAgaEluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWQ1NfUGFyYW1zX3QgICAgICpwUGFyYW1zKQogewpAQCAtMTQwLDcgKzIzMSw3IEBACiAKICAgICByZXR1cm4oTFZDU19TVUNDRVNTKTsKIH0KLQorI2VuZGlmCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICBMVkNTX1JldmVyYiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCkBAIC0xNzksNyArMjcwLDkxIEBACiAvKiAgMi4gIFRoZSBHYWluIGlzIGNvbWJpbmVkIHdpdGggdGhlIExQRiBhbmQgaW5jb3Jwb3JhdGVkIGluIHRvIHRoZSBjb2VmZmljaWVudHMgICAqLwogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQlVJTERfRkxPQVQKK0xWQ1NfUmV0dXJuU3RhdHVzX2VuIExWQ1NfUmV2ZXJiR2VuZXJhdG9yKExWQ1NfSGFuZGxlX3QgICAgICAgICBoSW5zdGFuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fRkxPQVQgICAgICAgKnBJbkRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICAgKnBPdXREYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiAgICAgICAgICAgIE51bVNhbXBsZXMpCit7CiAKKyAgICBMVkNTX0luc3RhbmNlX3QgICAgICAgICAqcEluc3RhbmNlID0gKExWQ1NfSW5zdGFuY2VfdCAgKiloSW5zdGFuY2U7CisgICAgTFZDU19SZXZlcmJHZW5lcmF0b3JfdCAgKnBDb25maWcgICA9IChMVkNTX1JldmVyYkdlbmVyYXRvcl90ICopJnBJbnN0YW5jZS0+UmV2ZXJiZXJhdGlvbjsKKyAgICBMVkNTX0NvZWZmaWNpZW50X3QgICAgICAqcENvZWZmaWNpZW50czsKKyAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAqcFNjcmF0Y2g7CisKKyAgICBwQ29lZmZpY2llbnRzID0gKExWQ1NfQ29lZmZpY2llbnRfdCAqKVwKKyAgICAgICAgICAgICAgICAgICBwSW5zdGFuY2UtPk1lbW9yeVRhYmxlLlJlZ2lvbltMVkNTX01FTVJFR0lPTl9QRVJTSVNURU5UX0ZBU1RfQ09FRl0ucEJhc2VBZGRyZXNzOworCisgICAgcFNjcmF0Y2ggID0gKExWTV9GTE9BVCAqKVwKKyAgICAgICAgICAgICAgICAgICAgcEluc3RhbmNlLT5NZW1vcnlUYWJsZS5SZWdpb25bTFZDU19NRU1SRUdJT05fVEVNUE9SQVJZX0ZBU1RdLnBCYXNlQWRkcmVzczsKKworICAgIC8qCisgICAgICogQ29weSB0aGUgZGF0YSB0byB0aGUgb3V0cHV0IGluIG91dHBsYWNlIHByb2Nlc3NpbmcKKyAgICAgKi8KKyAgICBpZiAocEluRGF0YSAhPSBwT3V0RGF0YSkKKyAgICB7CisgICAgICAgIC8qCisgICAgICAgICAqIFJldmVyYiBub3QgcmVxdWlyZWQgc28ganVzdCBjb3B5IHRoZSBkYXRhCisgICAgICAgICAqLworICAgICAgICBDb3B5X0Zsb2F0KChMVk1fRkxPQVQgKilwSW5EYXRhLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFNvdXJjZSAqLworICAgICAgICAgICAgICAgICAgIChMVk1fRkxPQVQgKilwT3V0RGF0YSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIERlc3RpbmF0aW9uICovCisgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNikoMiAqIE51bVNhbXBsZXMpKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBMZWZ0IGFuZCByaWdodCAqLworICAgIH0KKworCisgICAgLyoKKyAgICAgKiBDaGVjayBpZiB0aGUgcmV2ZXJiIGlzIHJlcXVpcmVkCisgICAgICovCisgICAgLyogRGlzYWJsZSB3aGVuIENTNE1TIGluIHN0ZXJlbyBtb2RlICovCisgICAgaWYgKCgocEluc3RhbmNlLT5QYXJhbXMuU3BlYWtlclR5cGUgPT0gTFZDU19IRUFEUEhPTkUpIHx8IFwKKyAgICAgICAgIChwSW5zdGFuY2UtPlBhcmFtcy5TcGVha2VyVHlwZSA9PSBMVkNTX0VYX0hFQURQSE9ORVMpIHx8CisgICAgICAgICAocEluc3RhbmNlLT5QYXJhbXMuU291cmNlRm9ybWF0ICE9IExWQ1NfU1RFUkVPKSkgICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBGb3IgdmFsaWRhdGlvbiB0ZXN0aW5nICovCisgICAgICAgICgocEluc3RhbmNlLT5QYXJhbXMuT3BlcmF0aW5nTW9kZSAmIExWQ1NfUkVWRVJCU1dJVENIKSAhPTApKQorICAgIHsKKyAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworICAgICAgICAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgIC8qIENvcHkgdGhlIGlucHV0IGRhdGEgdG8gc2NyYXRjaCBtZW1vcnkgYW5kIGZpbHRlciBpdCAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyAgICAgICAgLyoKKyAgICAgICAgICogQ29weSB0aGUgaW5wdXQgZGF0YSB0byB0aGUgc2NyYXRjaCBtZW1vcnkKKyAgICAgICAgICovCisgICAgICAgIENvcHlfRmxvYXQoKExWTV9GTE9BVCAqKXBJbkRhdGEsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFNvdXJjZSAqLworICAgICAgICAgICAgICAgICAgIChMVk1fRkxPQVQgKilwU2NyYXRjaCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBEZXN0aW5hdGlvbiAqLworICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpKDIgKiBOdW1TYW1wbGVzKSk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIExlZnQgYW5kIHJpZ2h0ICovCisKKyAgICAgICAgLyoKKyAgICAgICAgICogRmlsdGVyIHRoZSBkYXRhCisgICAgICAgICAqLworICAgICAgICAocENvbmZpZy0+cEJpcXVhZENhbGxCYWNrKSgoQmlxdWFkX0ZMT0FUX0luc3RhbmNlX3QqKSZwQ29lZmZpY2llbnRzLT5SZXZlcmJCaXF1YWRJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9GTE9BVCAqKXBTY3JhdGNoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0ZMT0FUICopcFNjcmF0Y2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7CisKKyAgICAgICAgTXVsdDNzX0Zsb2F0KCAoTFZNX0ZMT0FUICopcFNjcmF0Y2gsCisgICAgICAgICAgICAgICAgICAgICAgcENvbmZpZy0+UmV2ZXJiTGV2ZWwsCisgICAgICAgICAgICAgICAgICAgICAgKExWTV9GTE9BVCAqKXBTY3JhdGNoLAorICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpKDIgKiBOdW1TYW1wbGVzKSk7CisKKworICAgICAgICAvKgorICAgICAgICAgKiBBcHBseSB0aGUgZGVsYXkgbWl4CisgICAgICAgICAqLworICAgICAgICBEZWxheU1peF9GbG9hdCgoTFZNX0ZMT0FUICopcFNjcmF0Y2gsCisgICAgICAgICAgICAgICAgICAgICAgICZwQ29uZmlnLT5TdGVyZW9TYW1wbGVzWzBdLAorICAgICAgICAgICAgICAgICAgICAgICBwQ29uZmlnLT5EZWxheVNpemUsCisgICAgICAgICAgICAgICAgICAgICAgIHBPdXREYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAmcENvbmZpZy0+RGVsYXlPZmZzZXQsCisgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7CisKKworICAgIH0KKworICAgIHJldHVybihMVkNTX1NVQ0NFU1MpOworfQorI2Vsc2UKIEx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syKkxWQ1NfU1RFUkVPREVMQVlfQ1NfNDhLSFpdOwotCiAgICAgLyogUmV2ZXJiIExldmVsICovCiAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgIFJldmVyYkxldmVsOwotCiAgICAgLyogRmlsdGVyICovCiAgICAgdm9pZCAgICAgICAgICAgICAgICAgICAgICAgICgqcEJpcXVhZENhbGxCYWNrKSAoQmlxdWFkX0luc3RhbmNlX3QqLCBMVk1fSU5UMTYqLCBMVk1fSU5UMTYqLCBMVk1fSU5UMTYpOwotCisjZWxzZQorICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgICAgICBTdGVyZW9TYW1wbGVzWzIgKiBMVkNTX1NURVJFT0RFTEFZX0NTXzQ4S0haXTsKKyAgICAvKiBSZXZlcmIgTGV2ZWwgKi8KKyAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAgICAgUmV2ZXJiTGV2ZWw7CisgICAgLyogRmlsdGVyICovCisgICAgdm9pZCAgICAgICAgICAgICAgICAgICAgICAgICgqcEJpcXVhZENhbGxCYWNrKSAoQmlxdWFkX0ZMT0FUX0luc3RhbmNlX3QqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9GTE9BVCosIExWTV9GTE9BVCosIExWTV9JTlQxNik7CisjZW5kaWYKIH0gTFZDU19SZXZlcmJHZW5lcmF0b3JfdDsKIAogCkBAIC03NywxMiArODMsMTcgQEAKIAogTFZDU19SZXR1cm5TdGF0dXNfZW4gTFZDU19SZXZlcmJHZW5lcmF0b3JJbml0KExWQ1NfSGFuZGxlX3QgICAgIGhJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkNTX1BhcmFtc190ICAqcFBhcmFtcyk7Ci0KKyNpZmRlZiBCVUlMRF9GTE9BVAorTFZDU19SZXR1cm5TdGF0dXNfZW4gTFZDU19SZXZlcmJHZW5lcmF0b3IoTFZDU19IYW5kbGVfdCAgICAgICAgIGhJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9GTE9BVCAgICAgICAqcElucHV0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICpwT3V0cHV0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiAgICAgICAgICAgIE51bVNhbXBsZXMpOworI2Vsc2UKIExWQ1NfUmV0dXJuU3RhdHVzX2VuIExWQ1NfUmV2ZXJiR2VuZXJhdG9yKExWQ1NfSGFuZGxlX3QgICAgICAgICBoSW5zdGFuY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMTYgICAgICAgKnBJbnB1dCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAqcE91dHB1dCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgICAgICAgICAgICBOdW1TYW1wbGVzKTsKLQorI2VuZGlmCiAjaWZkZWYgX19jcGx1c3BsdXMKIH0KICNlbmRpZiAvKiBfX2NwbHVzcGx1cyAqLwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL1N0ZXJlb1dpZGVuaW5nL3NyYy9MVkNTX1N0ZXJlb0VuaGFuY2VyLmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvU3RlcmVvV2lkZW5pbmcvc3JjL0xWQ1NfU3RlcmVvRW5oYW5jZXIuYwppbmRleCBiOWI4YjA1Li4yOTkyYzM1IDEwMDY0NAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvU3RlcmVvV2lkZW5pbmcvc3JjL0xWQ1NfU3RlcmVvRW5oYW5jZXIuYworKysgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvU3RlcmVvV2lkZW5pbmcvc3JjL0xWQ1NfU3RlcmVvRW5oYW5jZXIuYwpAQCAtNDksNyArNDksMTAzIEBACiAvKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQlVJTERfRkxPQVQKK0xWQ1NfUmV0dXJuU3RhdHVzX2VuIExWQ1NfU0VuaGFuY2VySW5pdChMVkNTX0hhbmRsZV90ICAgICAgIGhJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkNTX1BhcmFtc190ICAgICAgICpwUGFyYW1zKQorewogCisgICAgTFZNX1VJTlQxNiAgICAgICAgICAgICAgT2Zmc2V0OworICAgIExWQ1NfSW5zdGFuY2VfdCAgICAgICAgICpwSW5zdGFuY2UgPSAoTFZDU19JbnN0YW5jZV90ICAqKWhJbnN0YW5jZTsKKyAgICBMVkNTX1N0ZXJlb0VuaGFuY2VyX3QgICAqcENvbmZpZyAgID0gKExWQ1NfU3RlcmVvRW5oYW5jZXJfdCAqKSZwSW5zdGFuY2UtPlN0ZXJlb0VuaGFuY2VyOworICAgIExWQ1NfRGF0YV90ICAgICAgICAgICAgICpwRGF0YTsKKyAgICBMVkNTX0NvZWZmaWNpZW50X3QgICAgICAqcENvZWZmaWNpZW50OworICAgIEZPX0ZMT0FUX0NvZWZzX3QgICAgICAgICAgQ29lZmZzTWlkOworICAgIEJRX0ZMT0FUX0NvZWZ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8KKyAgICAgICAgQ29lZmZzTWlkLkEwID0gKExWTV9GTE9BVCkgTFZDU19TRU1pZENvZWZUYWJsZVtPZmZzZXRdLkEwOworICAgICAgICBDb2VmZnNNaWQuQTEgPSAoTFZNX0ZMT0FUKSBMVkNTX1NFTWlkQ29lZlRhYmxlW09mZnNldF0uQTE7CisgICAgICAgIENvZWZmc01pZC5CMSA9IChMVk1fRkxPQVQpLUxWQ1NfU0VNaWRDb2VmVGFibGVbT2Zmc2V0XS5CMTsKKworICAgICAgICAvKiBDbGVhciB0aGUgdGFwcyAqLworICAgICAgICBMb2FkQ29uc3RfRmxvYXQoMCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogVmFsdWUgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopJnBEYXRhLT5TRUJpcXVhZFRhcHNNaWQsICAgIC8qIERlc3RpbmF0aW9uIENhc3QgdG8gdm9pZDpcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vIGRlcmVmZXJlbmNpbmcgaW4gZnVuY3Rpb24qLworICAgICAgICAgICAgICAgICAgICAgICAgLyogTnVtYmVyIG9mIHdvcmRzICovCisgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX1VJTlQxNikoc2l6ZW9mKHBEYXRhLT5TRUJpcXVhZFRhcHNNaWQpIC8gc2l6ZW9mKExWTV9GTE9BVCkpKTsKKworICAgICAgICBGT18xSV9EMTZGMTZDc3NfVFJDX1dSQV8wMV9Jbml0KCZwQ29lZmZpY2llbnQtPlNFQmlxdWFkSW5zdGFuY2VNaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBEYXRhLT5TRUJpcXVhZFRhcHNNaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJkNvZWZmc01pZCk7CisKKyAgICAgICAgLyogQ2FsbGJhY2tzICovCisgICAgICAgIGlmKEx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WRlLCAvKiBEZXN0aW5hdGlvbiBDYXN0IHRvIHZvaWQ6XAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vIGRlcmVmZXJlbmNpbmcgaW4gZnVuY3Rpb24qLworICAgICAgICAgICAgICAgICAgICAgICAgLyogTnVtYmVyIG9mIHdvcmRzICovCisgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX1VJTlQxNikoc2l6ZW9mKHBEYXRhLT5TRUJpcXVhZFRhcHNTaWRlKSAvIHNpemVvZihMVk1fRkxPQVQpKSk7CisgICAgICAgIC8qIENhbGxiYWNrcyAqLworICAgICAgICBzd2l0Y2gocFNFU2lkZUNvZWZzW09mZnNldF0uU2NhbGUpCisgICAgICAgIHsKKyAgICAgICAgICAgIGNhc2UgMTQ6CisgICAgICAgICAgICAgICAgQlFfMUlfRDE2RjMyQ3NzX1RSQ19XUkFfMDFfSW5pdCgmcENvZWZmaWNpZW50LT5TRUJpcXVhZEluc3RhbmNlU2lkZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwRGF0YS0+U0VCaXF1YWRUYXBzU2lkZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZDb2VmZnNTaWRlKTsKKworICAgICAgICAgICAgICAgIHBDb25maWctPnBCaXF1YWRDYWxsQmFja19TaWRlICA9IEJRXzFJX0QxNkYzMkMxNF9UUkNfV1JBXzAxOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAxNToKKyAgICAgICAgICAgICAgICBCUV8xSV9EMTZGMTZDc3NfVFJDX1dSQV8wMV9Jbml0KCZwQ29lZmZpY2llbnQtPlNFQmlxdWFkSW5zdGFuY2VTaWRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBEYXRhLT5TRUJpcXVhZFRhcHNTaWRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJkNvZWZmc1NpZGUpOworCisgICAgICAgICAgICAgICAgcENvbmZpZy0+cEJpcXVhZENhbGxCYWNrX1NpZGUgID0gQlFfMUlfRDE2RjE2QzE1X1RSQ19XUkFfMDE7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgIH0KKworCisgICAgcmV0dXJuKExWQ1NfU1VDQ0VTUyk7Cit9CisjZWxzZQogTFZDU19SZXR1cm5TdGF0dXNfZW4gTFZDU19TRW5oYW5jZXJJbml0KExWQ1NfSGFuZGxlX3QgICAgICAgaEluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWQ1NfUGFyYW1zX3QgICAgICAgKnBQYXJhbXMpCiB7CkBAIC0xMzgsNyArMjM0LDcgQEAKIAogICAgIHJldHVybihMVkNTX1NVQ0NFU1MpOwogfQotCisjZW5kaWYKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgIExWQ1NfU3RlcmVvRW5oYW5jZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KQEAgLTE3Nyw3ICsyNzMsOTAgQEAKIC8qICAxLiAgVGhlIHNpZGUgZmlsdGVyIGlzIG5vdCB1c2VkIGluIE1vYmlsZSBTcGVha2VyIG1vZGUgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZmRlZiBCVUlMRF9GTE9BVAorTFZDU19SZXR1cm5TdGF0dXNfZW4gTFZDU19TdGVyZW9FbmhhbmNlcihMVkNTX0hhbmRsZV90ICAgICAgICAgIGhJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICAgICAgICAqcEluRGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICAqcE91dERhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgICAgICAgICAgICAgTnVtU2FtcGxlcykKK3sKIAorICAgIExWQ1NfSW5zdGFuY2VfdCAgICAgICAgICpwSW5zdGFuY2UgPSAoTFZDU19JbnN0YW5jZV90ICAqKWhJbnN0YW5jZTsKKyAgICBMVkNTX1N0ZXJlb0VuaGFuY2VyX3QgICAqcENvbmZpZyAgID0gKExWQ1NfU3RlcmVvRW5oYW5jZXJfdCAqKSZwSW5zdGFuY2UtPlN0ZXJlb0VuaGFuY2VyOworICAgIExWQ1NfQ29lZmZpY2llbnRfdCAgICAgICpwQ29lZmZpY2llbnQ7CisgICAgTFZNX0ZMT0FUICAgICAgICAgICAgICAgKnBTY3JhdGNoOworCisgICAgcENvZWZmaWNpZW50ID0gKExWQ1NfQ29lZmZpY2llbnRfdCAqKSBcCisgICAgICAgICAgICAgICAgICAgcEluc3RhbmNlLT5NZW1vcnlUYWJsZS5SZWdpb25bTFZDU19NRU1SRUdJT05fUEVSU0lTVEVOVF9GQVNUX0NPRUZdLnBCYXNlQWRkcmVzczsKKworICAgIHBTY3JhdGNoICA9IChMVk1fRkxPQVQgKikgXAorICAgICAgICAgICAgICAgICAgICBwSW5zdGFuY2UtPk1lbW9yeVRhYmxlLlJlZ2lvbltMVkNTX01FTVJFR0lPTl9URU1QT1JBUllfRkFTVF0ucEJhc2VBZGRyZXNzOworICAgIC8qCisgICAgICogQ2hlY2sgaWYgdGhlIFN0ZXJlbyBFbmhhbmNlciBpcyBlbmFibGVkCisgICAgICovCisgICAgaWYgKChwSW5zdGFuY2UtPlBhcmFtcy5PcGVyYXRpbmdNb2RlICYgTFZDU19TVEVSRU9FTkhBTkNFU1dJVENIKSAhPSAwKQorICAgICAgICB7CisgICAgICAgIC8qCisgICAgICAgICAqIENvbnZlcnQgZnJvbSBzdGVyZW8gdG8gbWlkZGxlIGFuZCBzaWRlCisgICAgICAgICAqLworICAgICAgICBGcm9tMmlUb01TX0Zsb2F0KHBJbkRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgcFNjcmF0Y2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgcFNjcmF0Y2ggKyBOdW1TYW1wbGVzLAorICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7CisKKyAgICAgICAgLyoKKyAgICAgICAgICogQXBwbHkgZmlsdGVyIHRvIHRoZSBtaWRkbGUgc2lnbmFsCisgICAgICAgICAqLworICAgICAgICBpZiAocEluc3RhbmNlLT5PdXRwdXREZXZpY2UgPT0gTFZDU19IRUFEUEhPTkUpCisgICAgICAgIHsKKyAgICAgICAgICAgIChwQ29uZmlnLT5wQmlxdWFkQ2FsbEJhY2tfTWlkKSgoQmlxdWFkX0ZMT0FUX0luc3RhbmNlX3QqKVwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBDb2VmZmljaWVudC0+U0VCaXF1YWRJbnN0YW5jZU1pZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9GTE9BVCAqKXBTY3JhdGNoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0ZMT0FUICopcFNjcmF0Y2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBNdWx0M3NfRmxvYXQocFNjcmF0Y2gsICAgICAgICAgICAgICAvKiBTb3VyY2UgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0ZMT0FUKXBDb25maWctPk1pZEdhaW4sICAgICAgLyogR2FpbiAqLworICAgICAgICAgICAgICAgICAgICAgICAgIHBTY3JhdGNoLCAgICAgICAgICAgICAgLyogRGVzdGluYXRpb24gKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOyAgICAgICAgICAgLyogTnVtYmVyIG9mIHNhbXBsZXMgKi8KKyAgICAgICAgfQorCisgICAgICAgIC8qCisgICAgICAgICAqIEFwcGx5IHRoZSBmaWx0ZXIgdGhlIHNpZGUgc2lnbmFsIG9ubHkgaW4gc3RlcmVvIG1vZGUgZm9yIGhlYWRwaG9uZXMKKyAgICAgICAgICogYW5kIGluIGFsbCBtb2RlcyBmb3IgbW9iaWxlIHNwZWFrZXJzCisgICAgICAgICAqLworICAgICAgICBpZiAocEluc3RhbmNlLT5QYXJhbXMuU291cmNlRm9ybWF0ID09IExWQ1NfU1RFUkVPKQorICAgICAgICB7CisgICAgICAgICAgICAocENvbmZpZy0+cEJpcXVhZENhbGxCYWNrX1NpZGUpKChCaXF1YWRfRkxPQVRfSW5zdGFuY2VfdCopIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBDb2VmZmljaWVudC0+U0VCaXF1YWRJbnN0YW5jZVNpZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fRkxPQVQgKikocFNjcmF0Y2ggKyBOdW1TYW1wbGVzKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9GTE9BVCAqKShwU2NyYXRjaCArIE51bVNhbXBsZXMpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOworICAgICAgICB9CisKKyAgICAgICAgLyoKKyAgICAgICAgICogQ29udmVydCBmcm9tIG1pZGRsZSBhbmQgc2lkZSB0byBzdGVyZW8KKyAgICAgICAgICovCisgICAgICAgIE1TVG8yaV9TYXRfRmxvYXQocFNjcmF0Y2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgcFNjcmF0Y2ggKyBOdW1TYW1wbGVzLAorICAgICAgICAgICAgICAgICAgICAgICAgIHBPdXREYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7CisKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgLyoKKyAgICAgICAgICogVGhlIHN0ZXJlbyBlbmhhbmNlciBpcyBkaXNhYmxlZCBzbyBqdXN0IGNvcHkgdGhlIGRhdGEKKyAgICAgICAgICovCisgICAgICAgIENvcHlfRmxvYXQoKExWTV9GTE9BVCAqKXBJbkRhdGEsICAgICAgICAgICAvKiBTb3VyY2UgKi8KKyAgICAgICAgICAgICAgICAgICAoTFZNX0ZMT0FUICopcE91dERhdGEsICAgICAgICAgIC8qIERlc3RpbmF0aW9uICovCisgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNikoMiAqIE51bVNhbXBsZXMpKTsgICAgIC8qIExlZnQgYW5kIHJpZ2h0ICovCisgICAgfQorCisgICAgcmV0dXJuKExWQ1NfU1VDQ0VTUyk7Cit9CisjZWxzZQogTFZDU19SZXR1cm5TdGF0dXNfZW4gTFZDU19TdGVyZW9FbmhhbmNlcihMVkNTX0hhbmRsZV90ICAgICAgICAgIGhJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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GxCYWNrX1NpZGUpKEJpcXVhZF9JbnN0YW5jZV90KiwgTFZNX0lOVDE2KiwgTFZNX0lOVDE2KiwgTFZNX0lOVDE2KTsKKyAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICBNaWRHYWluOyAgICAgICAgICAgIC8qIE1pZGRsZSBnYWluIGluIG1vYmlsZSBzcGVha2VyIG1vZGUgKi8KKyNlbHNlCisgICAgLyoKKyAgICAgKiBNaWRkbGUgZmlsdGVyCisgICAgICovCisgICAgdm9pZCAgICAgICAgICAgICAgICAgICAgKCpwQmlxdWFkQ2FsbEJhY2tfTWlkKShCaXF1YWRfRkxPQVRfSW5zdGFuY2VfdCosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQqLCBMVk1fRkxPQVQqLCBMVk1fSU5UMTYpOwogCi0gICAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICBNaWRHYWluOyAgICAgICAgICAgIC8qIE1pZGRsZSBnYWluIGluIG1vYmlsZSBzcGVha2VyIG1vZGUgKi8KLQorICAgIC8qCisgICAgICogU2lkZSBmaWx0ZXIKKyAgICAgKi8KKyAgICB2b2lkICAgICAgICAgICAgICAgICAgICAoKnBCaXF1YWRDYWxsQmFja19TaWRlKShCaXF1YWRfRkxPQVRfSW5zdGFuY2VfdCosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQqLCBMVk1fRkxPQVQqLCBMVk1fSU5UMTYpOworICAgIExWTV9GTE9BVCAgICAgICAgICAgICAgTWlkR2FpbjsgICAgICAgICAgICAvKiBNaWRkbGUgZ2FpbiBpbiBtb2JpbGUgc3BlYWtlciBtb2RlICovCisjZW5kaWYKIH0gTFZDU19TdGVyZW9FbmhhbmNlcl90OwogCiAKQEAgLTY3LDEyICs4MCwxNyBAQAogTFZDU19SZXR1cm5TdGF0dXNfZW4gTFZDU19TRW5oYW5jZXJJbml0KExWQ1NfSGFuZGxlX3QgICAgICAgIGhJbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkNTX1BhcmFtc190ICAgICAgICAqcFBhcmFtcyk7CiAKKyNpZm5kZWYgQlVJTERfRkxPQVQKIExWQ1NfUmV0dXJuU3RhdHVzX2VuIExWQ1NfU3RlcmVvRW5oYW5jZXIoTFZDU19IYW5kbGVfdCAgICAgICAgaEluc3RhbmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMTYgICAgKnBJbkRhdGEsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICpwT3V0RGF0YSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiAgICAgICAgICAgIE51bVNhbXBsZXMpOwotCi0KKyNlbHNlCitMVkNTX1JldHVyblN0YXR1c19lbiBMVkNTX1N0ZXJlb0VuaGFuY2VyKExWQ1NfSGFuZGxlX3QgICAgICAgIGhJbnN0YW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0ZMT0FUICAgICpwSW5EYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRkxPQVQgICAgICAgICAgICAqcE91dERhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgICAgICAgICAgICBOdW1TYW1wbGVzKTsKKyNlbmRpZgogI2lmZGVmIF9fY3BsdXNwbHVzCiB9CiAjZW5kaWYgLyogX19jcGx1c3BsdXMgKi8KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9TdGVyZW9XaWRlbmluZy9zcmMvTFZDU19UYWJsZXMuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9TdGVyZW9XaWRlbmluZy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w2ICs0NTYsMjQgQEAKIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogY29uc3QgTFZDU19Wb2xDb3JyZWN0X3QgTFZDU19Wb2xDb3JyZWN0VGFibGVbXSA9IHsKKyNpZmRlZiBCVUlMRF9GTE9BVAorICAgIHswLjQzMzM2MmYsICAgICAgICAgIC8qIEhlYWRwaG9uZSwgc3RlcmVvIG1vZGUgKi8KKyAgICAgMC4wMDAwMDBmLAorICAgICAxLjAwMDAyNGYsCisgICAgIDEuNDEyNjQwZn0sCisgICAgezAuNDMzMzYyZiwgICAgICAgICAgLyogRVggSGVhZHBob25lLCBzdGVyZW8gbW9kZSAqLworICAgICAwLjAwMDAwMGYsCisgICAgIDEuMDAwMDI0ZiwKKyAgICAgMS40MTI2NDBmfSwKKyAgICB7MS4wMDAwMDBmLCAgICAgICAgIC8qIEhlYWRwaG9uZSwgbW9ubyBtb2RlICovCisgICAgIDAuMDAwMDAwZiwKKyAgICAgMS4wMDAwMjRmLAorICAgICAxLjQxMjY0MGZ9LAorICAgIHsxLjAwMDAwMGYsICAgICAgICAgLyogRVggSGVhZHBob25lLCBtb25vIG1vZGUgKi8KKyAgICAgMC4wMDAwMDBmLAorICAgICAxLjAwMDAyNGYsCisgICAgIDEuNDEyNjQwZn0KKyNlbHNlCiAgICAgezE0MjAwLCAgICAgICAgICAvKiBIZWFkcGhvbmUsIHN0ZXJlbyBtb2RlICovCiAgICAgIDAsCiAgICAgIDQwOTYsCkBAIC00MDEsNiArNDkwLDcgQEAKICAgICAgMCwKICAgICAgNDA5NiwKICAgICAgNTc4Nn0KKyNlbmRpZgogfTsKIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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wMDAsCisJCQkJCQkJCQkJICBMVkNTX1ZPTF9UQ19GczE2MDAwLAorCQkJCQkJCQkJCSAgTFZDU19WT0xfVENfRnMyMjA1MCwKKwkJCQkJCQkJCQkgIExWQ1NfVk9MX1RDX0ZzMjQwMDAsCisJCQkJCQkJCQkJICBMVkNTX1ZPTF9UQ19GczMyMDAwLAorCQkJCQkJCQkJCSAgTFZDU19WT0xfVENfRnM0NDEwMCwKKwkJCQkJCQkJCQkgIExWQ1NfVk9MX1RDX0ZzNDgwMDAsCisJCQkJCQkJCQkJICBMVkNTX1ZPTF9UQ19Gczk2MDAwLAorCQkJCQkJCQkJCSAgTFZDU19WT0xfVENfRnMxOTIwMDAKK307CisjZWxzZQogY29uc3QgTFZNX0lOVDE2IExWQ1NfVm9sdW1lVENUYWJsZVs5XSA9IHtMVkNTX1ZPTF9UQ19GczgwMDAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZDU19WT0xfVENfRnMxMTAyNSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkNTX1ZPTF9UQ19GczEyMDAwLApAQCAtNDI4LDE1ICs1MzUsMzAgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkNTX1ZPTF9UQ19GczI0MDAwLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWQ1NfVk9MX1RDX0ZzMzIwMDAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZDU19WT0xfVENfRnM0NDEwMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkNTX1ZPTF9UQ19GczQ4MDAwfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkNTX1ZPTF9UQ19GczQ4MDAwCit9OworI2VuZGlmCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogIFNhbXBsZSByYXRlIHRhYmxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1jb25zdCBMVk1fSU5UMzIgICBMVkNTX1NhbXBsZVJhdGVUYWJsZVs5XSA9IHs4MDAwLAorI2lmIGRlZmluZWQoQlVJTERfRkxPQVQpICYmIGRlZmluZWQoSElHSEVSX0ZTKQorY29uc3QgTFZNX0lOVDMyICAgTFZDU19TYW1wbGVSYXRlVGFibGVbMTFdID0gezgwMDAsCisJCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTEwMjUsCisJCQkJCQkJCQkJCSAgMTIwMDAsCisJCQkJCQkJCQkJCSAgMTYwMDAsCisJCQkJCQkJCQkJCSAgMjIwNTAsCisJCQkJCQkJCQkJCSAgMjQwMDAsCisJCQkJCQkJCQkJCSAgMzIwMDAsCisJCQkJCQkJCQkJCSAgNDQxMDAsCisJCQkJCQkJCQkJCSAgNDgwMDAsCisJCQkJCQkJCQkJCSAgOTYwMDAsCisJCQkJCQkJCQkJCSAgMTkyMDAwCit9OworI2Vsc2UKK2NvbnN0IExWTV9JTlQxNiAgIExWQ1NfU2FtcGxlUmF0ZVRhYmxlWzldID0gezgwMDAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDExMDI1LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMjAwMCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTYwMDAsCkBAIC00NDQsNSArNTY2LDYgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjQwMDAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMyMDAwLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0NDEwMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDgwMDB9OwotCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ4MDAwCit9OworI2VuZGlmCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS93cmFwcGVyL0FuZHJvaWQubWsgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS93cmFwcGVyL0FuZHJvaWQubWsKaW5kZXggZWZkMzBmYi4uZjEwNmFhZSAxMDA2NDQKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vd3JhcHBlci9BbmRyb2lkLm1rCisrKyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL3dyYXBwZXIvQW5kcm9pZC5tawpAQCAtMTAsNyArMTAsNyBAQAogTE9DQUxfU1JDX0ZJTEVTOj0gXAogCUJ1bmRsZS9FZmZlY3RCdW5kbGUuY3BwCiAKLUxPQ0FMX0NGTEFHUyArPSAtZnZpc2liaWxpdHk9aGlkZGVuCitMT0NBTF9DRkxBR1MgKz0gLWZ2aXNpYmlsaXR5PWhpZGRlbiAtREJVSUxEX0ZMT0FUIC1ESElHSEVSX0ZTCiBMT0NBTF9DRkxBR1MgKz0gLVdhbGwgLVdlcnJvcgogCiBMT0NBTF9NT0RVTEU6PSBsaWJidW5kbGV3cmFwcGVyCkBAIC00Myw3ICs0Myw3IEBACi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WYgKHBDb250ZXh0LT5wQnVuZGxlZENvbnRleHQtPnBPdXRwdXRCdWZmZXIgIT0gTlVMTCkgeworICAgICAgICAgICAgZnJlZShwQ29udGV4dC0+cEJ1bmRsZWRDb250ZXh0LT5wT3V0cHV0QnVmZmVyKTsKKyAgICAgICAgfQorI2VuZGlmCiAgICAgICAgIGRlbGV0ZSBwQ29udGV4dC0+cEJ1bmRsZWRDb250ZXh0OwogICAgICAgICBwQ29udGV4dC0+cEJ1bmRsZWRDb250ZXh0ID0gTFZNX05VTEw7CiAgICAgfQpAQCAtNzIxLDcgKzczNCw0NyBAQAogICAgIHJldHVybiAwOwogfSAgIC8qIGVuZCBMdm1CdW5kbGVfaW5pdCAqLwogCisjaWZkZWYgQlVJTERfRkxPQVQKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICBGVU5DVElPTiBJTlQxNkxUT0ZMT0FUCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8vIFRvZG86IG5lZWQgdG8gd3JpdGUgZnVuY3Rpb24gZGVzY3JpcHRvcgorc3RhdGljIHZvaWQgSW50MTZUb0Zsb2F0KGNvbnN0IExWTV9JTlQxNiAqc3JjLCBMVk1fRkxPQVQgKmRzdCwgc2l6ZV90IG4pIHsKKyAgICBzaXplX3QgaWk7CisgICAgc3JjICs9IG4tMTsKKyAgICBkc3QgKz0gbi0xOworICAgIGZvciAoaWkgPSBuOyBpaSAhPSAwOyBpaS0tKSB7CisgICAgICAgICpkc3QgPSAoKExWTV9GTE9BVCkoKExWTV9JTlQxNikqc3JjKSkgLyAzMjc2OC4wZjsKKyAgICAgICAgc3JjLS07CisgICAgICAgIGRzdC0tOworICAgIH0KKyAgICByZXR1cm47Cit9CisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgRlVOQ1RJT04gRkxPQVRUT0lOVDE2X1NBVAorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvLyBUb2RvIDogTmVlZCB0byB3cml0ZSBmdW5jdGlvbiBkZXNjcmlwdG9yCitzdGF0aWMgdm9pZCBGbG9hdFRvSW50MTZfU0FUKGNvbnN0IExWTV9GTE9BVCAqc3JjLCBMVk1fSU5UMTYgKmRzdCwgc2l6ZV90IG4pIHsKKyAgICBzaXplX3QgaWk7CisgICAgTFZNX0lOVDMyIHRlbXA7CiAKKyAgICBzcmMgKz0gbi0xOworICAgIGRzdCArPSBuLTE7CisgICAgZm9yIChpaSA9IG47IGlpICE9IDA7IGlpLS0pIHsKKyAgICAgICAgdGVtcCA9IChMVk1fSU5UMzIpKCgqc3JjKSAqIDMyNzY4LjBmKTsKKyAgICAgICAgaWYgKHRlbXAgPj0gMzI3NjcpIHsKKyAgICAgICAgICAgICpkc3QgPSAzMjc2NzsKKyAgICAgICAgfSBlbHNlIGlmICh0ZW1wIDw9IC0zMjc2OCkgeworICAgICAgICAgICAgKmRzdCA9IC0zMjc2ODsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICpkc3QgPSAoTFZNX0lOVDE2KXRlbXA7CisgICAgICAgIH0KKyAgICAgICAgc3JjLS07CisgICAgICAgIGRzdC0tOworICAgIH0KKyAgICByZXR1cm47Cit9CisjZW5kaWYKIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogLy8gTHZtQnVuZGxlX3Byb2Nlc3MoKQogLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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Db250ZXh0LT5mcmFtZUNvdW50IDwgZnJhbWVDb3VudCkgeworICAgICAgICBpZiAocENvbnRleHQtPnBCdW5kbGVkQ29udGV4dC0+cElucHV0QnVmZmVyICE9IE5VTEwpIHsKKyAgICAgICAgICAgIGZyZWUocENvbnRleHQtPnBCdW5kbGVkQ29udGV4dC0+cElucHV0QnVmZmVyKTsKKyAgICAgICAgfQorICAgICAgICBwQ29udGV4dC0+cEJ1bmRsZWRDb250ZXh0LT5wSW5wdXRCdWZmZXIgPSAoTFZNX0ZMT0FUICopbWFsbG9jKGZyYW1lQ291bnQgKiBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKExWTV9GTE9BVCkgKiBGQ0NfMik7CisgICAgfQorCisgICAgaWYgKHBDb250ZXh0LT5wQnVuZGxlZENvbnRleHQtPnBPdXRwdXRCdWZmZXIgPT0gTlVMTCB8fAorICAgICAgICAgICAgcENvbnRleHQtPnBCdW5kbGVkQ29udGV4dC0+ZnJhbWVDb3VudCA8IGZyYW1lQ291bnQpIHsKKyAgICAgICAgaWYgKHBDb250ZXh0LT5wQnVuZGxlZENvbnRleHQtPnBPdXRwdXRCdWZmZXIgIT0gTlVMTCkgeworICAgICAgICAgICAgZnJlZShwQ29udGV4dC0+cEJ1bmRsZWRDb250ZXh0LT5wT3V0cHV0QnVmZmVyKTsKKyAgICAgICAgfQorICAgICAgICBwQ29udGV4dC0+cEJ1bmRsZWRDb250ZXh0LT5wT3V0cHV0QnVmZmVyID0gKExWTV9GTE9BVCAqKW1hbGxvYyhmcmFtZUNvdW50ICogXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoTFZNX0ZMT0FUKSAqIEZDQ18yKTsKKyAgICB9CisKKyAgICBpZiAoKHBDb250ZXh0LT5wQnVuZGxlZENvbnRleHQtPnBJ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xlICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcElucHV0QnVmZiwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBJbnB1dCBidWZmZXIgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwT3V0cHV0QnVmZiwgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIE91dHB1dCBidWZmZXIgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX1VJTlQxNilmcmFtZUNvdW50LCAgICAgICAgICAgICAgIC8qIE51bWJlciBvZiBzYW1wbGVzIHRvIHJlYWQgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEF1ZG8gVGltZSAqLworCisgICAgTFZNX0VSUk9SX0NIRUNLKEx2bVN0YXR1cywgIkxWTV9Qcm9jZXNzIiwgIkx2bUJ1bmRsZV9wcm9jZXNzIikKKyAgICBpZihMdm1TdGF0dXMgIT0gTFZNX1NVQ0NFU1MpIHJldHVybiAtRUlOVkFMOworCisgICAgLyogQ29udmVydGluZyBvdXRwdXQgZGF0YSBmcm9tIGZsb2F0IHBvaW50IHRvIGZpeGVkIHBvaW50ICovCisgICAgRmxvYXRUb0ludDE2X1NBVChwT3V0cHV0QnVmZiwgcE91dFRtcCwgKExWTV9VSU5UMTYpZnJhbWVDb3VudCAqIDIpOworICAgICNpZmRlZiBMVk1fUENNCisgICAgZndyaXRlKHBPdXRUbXAsIGZyYW1lQ291bnQqc2l6ZW9mKExWTV9JTlQxNikgKiBGQ0NfMiwgMSwgcENvbnRleHQtPnBCdW5kbGVkQ29udGV4dC0+UGNtT3V0UHRyKTsKKyAgICBmZmx1c2gocENvbnRleHQtPnBCdW5kbGVkQ29udGV4dC0+UGNtT3V0UHRyKTsKKyAgICAjZW5kaWYKKworICAgIGlmIChwQ29udGV4dC0+Y29uZmlnLm91dHB1dENmZy5hY2Nlc3NNb2RlID09IEVGRkVDVF9CV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SBwQ29udGV4dC0+cEJ1bmRsZWRDb250ZXh0LT5iVmlydHVhbGl6ZXJFbmFibGVkID09IExWTV9UUlVFOworCiAgICAgLy9FUSBjb250cmlidXRpb24KLSAgICBpZiAocENvbnRleHQtPnBCdW5kbGVkQ29udGV4dC0+YkVxdWFsaXplckVuYWJsZWQgPT0gTFZNX1RSVUUpIHsKKyAgICBpZiAoZXFFbmFibGVkKSB7CiAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgRklWRUJBTkRfTlVNQkFORFM7IGkrKykgewogICAgICAgICAgICAgZmxvYXQgYmFuZEZhY3RvciA9IHBDb250ZXh0LT5wQnVuZGxlZENvbnRleHQtPmJhbmRHYWluZEJbaV0vMTUuMDsKICAgICAgICAgICAgIGZsb2F0IGJhbmRDb2VmZmljaWVudCA9IExpbWl0TGV2ZWxfYmFuZEVuZXJneUNvZWZmaWNpZW50W2ldOwpAQCAtODkzLDM1ICsxMDQyLDM3IEBACiAgICAgICAgIH0KICAgICAgICAgYmFuZEZhY3RvclN1bSAtPSAxLjA7CiAgICAgICAgIGlmIChiYW5kRmFjdG9yU3VtID4gMCkKLSAgICAgICAgICAgIGNyb3NzQ29ycmVjdGlvbiA9IGJhbmRGYWN0b3JTdW0gKiAwLjc7CisgICAgICAgICAgY3Jvc3NDb3JyZWN0aW9uID0gYmFuZEZhY3RvclN1bSAqIDAuNzsKICAgICB9CiAKICAgICAvL0Jhc3NCb29zdCBjb250cmlidXRpb24KLSAgICBpZiAocENvbnRleHQtPnBCdW5kbGVkQ29udGV4dC0+YkJhc3NFbmFibGVkID09IExWTV9UUlVFKSB7CisgICAgaWYgKGJiRW5hYmxlZCkgewogICAgICAgICBmbG9hdCBib29zdEZhY3RvciA9IChwQ29udGV4dC0+cEJ1bmRsZWRDb250ZXh0LT5CYXNzU3RyZW5ndGhTYXZlZCkvMTAwMC4wOwogICAgICAgICBmbG9hdCBib29zdENvZWZmaWNpZW50ID0gTGltaXRMZXZlbF9iYXNzQm9vc3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ljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKICAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgogICovCi0KKyNpZm5kZWYgTFZNX0ZMT0FUCit0eXBlZGVmIGZsb2F0IExWTV9GTE9BVDsKKyNlbmRpZgogI2RlZmluZSBMT0dfVEFHICJSZXZlcmIiCiAjZGVmaW5lIEFSUkFZX1NJWkUoYXJyYXkpIChzaXplb2YgKGFycmF5KSAvIHNpemVvZiAoYXJyYXkpWzBdKQogLy8jZGVmaW5lIExPR19OREVCVUcgMApAQCAtMTUyLDYgKzE1NCw4IEBACiAgICAgTFZNX0ZzX2VuICAgICAgICAgICAgICAgICAgICAgICBTYW1wbGVSYXRlOwogICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgICAgICAgICAgKkluRnJhbWVzMzI7CiAgICAgTFZNX0lOVDMyICAgICAgICAgICAgICAgICAgICAgICAqT3V0RnJhbWVzMzI7CisgICAgc2l6ZV90ICAgICAgICAgICAgICAgICAgICAgICAgICBidWZmZXJTaXplSW47CisgICAgc2l6ZV90ICAgICAgICAgICAgICAgICAgICAgICAgICBidWZmZXJTaXplT3V0OwogICAgIGJvb2wgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXV4aWxpYXJ5OwogICAgIGJvb2wgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlc2V0OwogICAgIHVpbnQxNl90ICAgICAgICAgICAgICAgICAgICAgICAgY3VyUHJlc2V0OwpAQCAtMTcyLDggKzE3NiwxMSBAQAogCiAjZGVmaW5lIFJFVkVSQl9ERUZBVUxUX1BSRVNFVCBSRVZFUkJfUFJFU0VUX05PTkUKIAotCisjaWZkZWYgQlVJTERfRkxPQVQKKyNkZWZpbmUgUkVWRVJCX1NFTkRfTEVWRUwgICAwLjc1ZiAvLyAwLjc1IGluIDQuMTIgZm9ybWF0CisjZWxzZQogI2RlZmluZSBSRVZFUkJfU0VORF9MRVZFTCAgICgweDBDM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leHQtPmJ1ZmZlclNpemVPdXQpOwogCiAgICAgQUxPR1YoIlx0RWZmZWN0Q3JlYXRlICVwLCBzaXplICV6dSIsIHBDb250ZXh0LCBzaXplb2YoUmV2ZXJiQ29udGV4dCkpOwogICAgIEFMT0dWKCJcdEVmZmVjdENyZWF0ZSBlbmRcbiIpOwpAQCAtMjkzLDYgKzMwNyw4IEBACiAgICAgI2VuZGlmCiAgICAgZnJlZShwQ29udGV4dC0+SW5GcmFtZXMzMik7CiAgICAgZnJlZShwQ29udGV4dC0+T3V0RnJhbWVzMzIpOworICAgIHBDb250ZXh0LT5idWZmZXJTaXplSW4gPSAwOworICAgIHBDb250ZXh0LT5idWZmZXJTaXplT3V0ID0gMDsKICAgICBSZXZlcmJfZnJlZShwQ29udGV4dCk7CiAgICAgZGVsZXRlIHBDb250ZXh0OwogICAgIHJldHVybiAwOwpAQCAtMzg5LDYgKzQwNSw0NiBAQAogfQogI2VuZGlmCiAKKyNpZmRlZiBCVUlMRF9GTE9BVAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgIEZVTkNUSU9OIElOVDE2TFRPRkxPQVQKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLy8gVG9kbzogbmVlZCB0byB3cml0ZSBmdW5jdGlvbiBkZXNjcmlwdG9yCitzdGF0aWMgdm9pZCBJbnQxNlRvRmxvYXQoY29uc3QgTFZNX0lOVDE2ICpzcmMsIExWTV9GTE9BVCAqZHN0LCBzaXplX3QgbikgeworICAgIHNpemVfdCBpaTsKKyAgICBzcmMgKz0gbi0xOworICAgIGRzdCArPSBuLTE7CisgICAgZm9yIChpaSA9IG47IGlpICE9IDA7IGlpLS0pIHsKKyAgICAgICAgKmRzdCA9ICgoTFZNX0ZMT0FUKSgoTFZNX0lOVDE2KSpzcmMpKSAvIDMyNzY4LjBmOworICAgICAgICBzcmMtLTsKKyAgICAgICAgZHN0LS07CisgICAgfQorICAgIHJldHVybjsKK30KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICBGVU5DVElPTiBGTE9BVFRPSU5UMTZfU0FUCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8vIFRvZG8gOiBOZWVkIHRvIHdyaXRlIGZ1bmN0aW9uIGRlc2NyaXB0b3IKK3N0YXRpYyB2b2lkIEZsb2F0VG9JbnQxNl9TQVQoY29uc3QgTFZNX0ZMT0FUICpzcmMsIExWTV9JTlQxNiAqZHN0LCBzaXplX3QgbikgeworICAgIHNpemVfdCBpaTsKKyAgICBMVk1fSU5UMzIgdGVtcDsKKworICAgIGZvciAoaWkgPSAwOyBpaSA8IG47IGlpKyspIHsKKyAgICAgICAgdGVtcCA9IChMVk1fSU5UMzIpKCgqc3JjKSAqIDMyNzY4LjBmKTsKKyAgICAgICAgaWYgKHRlbXAgPj0gMzI3NjcpIHsKKyAgICAgICAgICAgICpkc3QgPSAzMjc2NzsKKyAgICAgICAgfSBlbHNlIGlmICh0ZW1wIDw9IC0zMjc2OCkgeworICAgICAgICAgICAgKmRzdCA9IC0zMjc2ODsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICpkc3QgPSAoTFZNX0lOVDE2KXRlbXA7CisgICAgICAgIH0KKyAgICAgICAgc3JjKys7CisgICAgICAgIGRzdCsrOworICAgIH0KKyAgICByZXR1cm47Cit9CisjZW5kaWYKKwogc3RhdGljIGlubGluZSBpbnQxNl90IGNsYW1wMTYoaW50MzJfdCBzYW1wbGUpCiB7CiAgICAgaWYgKChzYW1wbGU+PjE1KSBeIChzYW1wbGU+PjMxKSkKQEAgLTQyMiw4ICs0NzgsMzEgQEAKICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBzYW1wbGVzUGVyRnJhbWUgPSAxOwogICAgIExWUkVWX1JldHVyblN0YXR1c19lbiAgIEx2bVN0YXR1cyA9IExWUkVWX1NVQ0NFU1M7ICAgICAgICAgICAgICAvKiBGdW5jdGlvbiBjYWxsIHN0YXR1cyAqLwogICAgIExWTV9JTlQxNiAqT3V0RnJhbWVzMTY7CisjaWZkZWYgQlVJTERfRkxPQVQKKyAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAqcElucHV0QnVmZjsKKyAgICBMVk1fRkxPQVQgICAgICAgICAgICAgICAqcE91dHB1dEJ1ZmY7CisjZW5kaWYKIAotCisjaWZkZWYgQlVJTERfRkxPQVQKKyAgICBpZiAocENvbnRleHQtPkluRnJhbWVzMzIgPT0gTlVMTCB8fAorICAgICAgICAgICAgcENvbnRleHQtPmJ1ZmZlclNpemVJbiA8IGZyYW1lQ291bnQgKiBzaXplb2YoZmxvYXQpICogMikgeworICAgICAgICBpZiAocENvbnRleHQtPkluRnJhbWVzMzIgIT0gTlVMTCkgeworICAgICAgICAgICAgZnJlZShwQ29udGV4dC0+SW5GcmFtZXMzMik7CisgICAgICAgIH0KKyAgICAgICAgcENvbnRleHQtPmJ1ZmZlclNpemVJbiA9IGZyYW1lQ291bnQgKiBzaXplb2YoZmxvYXQpICogMjsKKyAgICAgICAgcENvbnRleHQtPkluRnJhbWVzMzIgPSAoTFZNX0lOVDMyICopbWFsbG9jKHBDb250ZXh0LT5idWZmZXJTaXplSW4pOworICAgIH0KKyAgICBpZiAocENvbnRleHQtPk91dEZyYW1lczMyID09IE5VTEwgfHwKKyAgICAgICAgICAgIHBDb250ZXh0LT5idWZmZXJTaXplT3V0IDwgZnJhbWVDb3VudCAqIHNpemVvZihmbG9hdCkgKiAyKSB7CisgICAgICAgIGlmIChwQ29udGV4dC0+T3V0RnJhbWVzMzIgIT0gTlVMTCkgeworICAgICAgICAgIC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I2VuZGlmCiAgICAgfSBlbHNlIHsKICAgICAgICAgaWYocENvbnRleHQtPmJFbmFibGVkID09IExWTV9GQUxTRSAmJiBwQ29udGV4dC0+U2FtcGxlc1RvRXhpdENvdW50ID4gMCkgeworI2lmZGVmIEJVSUxEX0ZMT0FUCisgICAgICAgICAgICBtZW1zZXQocElucHV0QnVmZiwgMCwgZnJhbWVDb3VudCAqIHNpemVvZihMVk1fRkxPQVQpICogc2FtcGxlc1BlckZyYW1lKTsKKyNlbHNlCiAgICAgICAgICAgICBtZW1zZXQocENvbnRleHQtPkluRnJhbWVzMzIsMCxmcmFtZUNvdW50ICogc2l6ZW9mKExWTV9JTlQzMikgKiBzYW1wbGVzUGVyRnJhbWUpOworI2VuZGlmCiAgICAgICAgICAgICBBTE9HVigiXHRaZXJvaW5nICVkIHNhbXBsZXMgcGVyIGZyYW1lIGF0IHRoZSBlbmQgb2YgY2FsbCIsIHNhbXBsZXNQZXJGcmFtZSk7CiAgICAgICAgIH0KIAogICAgICAgICAvKiBQcm9jZXNzIHRoZSBzYW1wbGVzLCBwcm9kdWNpbmcgYSBzdGVyZW8gb3V0cHV0ICovCisjaWZkZWYgQlVJTERfRkxPQVQKKyAgICAgICAgTHZtU3RhdHVzID0gTFZSRVZfUHJvY2VzcyhwQ29udGV4dC0+aEluc3RhbmNlLCAgICAgIC8qIEluc3RhbmNlIGhhbmRsZSAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJbnB1dEJ1ZmYsICAgICAvKiBJbnB1dCBidWZmZXIgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwT3V0cHV0QnVmZiwgICAgLyogT3V0cHV0IGJ1ZmZlciAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyYW1lQ291bnQpOyAgICAgICAgICAgICAgLyogTnVtYmVyIG9mIHNhbXBsZXMgdG8gcmVhZCAqLworI2Vsc2UKICAgICAgICAgTHZtU3RhdHVzID0gTFZSRVZfUHJvY2VzcyhwQ29udGV4dC0+aEluc3RhbmNlLCAgICAgIC8qIEluc3RhbmNlIGhhbmRsZSAqLwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBDb250ZXh0LT5JbkZyYW1lczMyLCAgICAgLyogSW5wdXQgYnVmZmVyICovCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENvbnRleHQtPk91dEZyYW1lczMyLCAgICAvKiBPdXRwdXQgYnVmZmVyICovCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJhbWVDb3VudCk7ICAgICAgICAgICAgICAvKiBOdW1iZXIgb2Ygc2FtcGxlcyB0byByZWFkICovCi0gICAgfQorI2VuZGlmCisgICAgICAgIH0KIAogICAgIExWTV9FUlJPUl9DSEVDSyhMdm1TdGF0dXMsICJMVlJFVl9Qcm9jZXNzIiwgInByb2Nlc3MiKQogICAgIGlmKEx2bVN0YXR1cyAhPSBMVlJFVl9TVUNDRVNTKSByZXR1cm4gLUVJTlZBTDsKIAogICAgIC8vIENvbnZlcnQgdG8gMTYgYml0cwogICAgIGlmIChwQ29udGV4dC0+YXV4aWxpYXJ5KSB7CisjaWZkZWYgQlVJTERfRkxPQVQKKyAgICAgICAgRmxvYXRUb0ludDE2X1NBVChwT3V0cHV0QnVmZiwgT3V0RnJhbWVzMTYsIChzaXplX3QpZnJhbWVDb3VudCAqIDIpOworI2Vsc2UKICAgICAgICAgZm9yIChpbnQgaT0wOyBpIDwgZnJhbWVDb3VudCoyOyBpKyspIHsgLy9hbHdheXMgc3RlcmVvIGhlcmUKICAgICAgICAgICAgIE91dEZyYW1lczE2W2ldID0gY2xhbXAxNihwQ29udGV4dC0+T3V0RnJhbWVzMzJbaV0+PjgpOwogICAgICAgICB9Ci0gICAgfSBlbHNlIHsKLSAgICAgICAgZm9yIChpbnQgaT0wOyBpIDwgZnJhbWVDb3VudCoyOyBpKyspIHsgLy9hbHdheXMgc3RlcmVvIGhlcmUKLSAgICAgICAgICAgIE91dEZyYW1lczE2W2ldID0gY2xhbXAxNigocENvbnRleHQtPk91dEZyYW1lczMyW2ldPj44KSArIChMVk1fSU5UMzIpcEluW2ldKTsKLSAgICAgICAgfQorI2VuZGlmCisgICAgICAgIH0gZWxzZSB7CisjaWZkZWYgQlVJTERfRkxPQVQKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgZnJhbWVDb3VudCAqIDI7IGkrKykgey8vYWx3YXlzIHN0ZXJlbyBoZXJlCisgICAgICAgICAgICAgICAgLy9wT3V0cHV0QnVmZiBhbmQgT3V0RnJhbWVzMTYgcG9pbnQgdG8gdGhlIHNhbWUgYnVmZmVyLCBzbyBiZXR0ZXIgdG8KKyAgICAgICAgICAgICAgICAvL2FjY3VtdWxhdGUgaW4gcElucHV0QnVmZiwgd2hpY2ggaXMgYXZhaWxhYmxlCisgICAgICAgICAgICAgICAgcElucHV0QnVmZltpXSA9IHBPdXRwdXRCdWZmW2ldICsgKExWTV9GTE9BVClwSW5baV0gLyAzMjc2OC4wZjsKKyAgICAgICAgICAgIH0KIAorICAgICAgICAgICAgRmxvYXRUb0ludDE2X1NBVChwSW5wdXRCdWZmLCBPdXRGcmFtZXMxNiwgKHNpemVfdClmcmFtZUNvdW50ICogMik7CisjZWxzZQorICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpIDwgZnJhbWVDb3VudCoyOyBpKyspIHsgLy9hbHdheXMgc3RlcmVvIGhlcmUKKyAgICAgICAgICAgICAgICBPdXRGcmFtZXMxNltpXSA9IGNsYW1wMTYoKHBDb250ZXh0LT5PdXRGcmFtZXMzMltpXT4+OCkgKyAoTFZNX0lOVDMyKXBJbltpXSk7CisgICAgICAgICAgICB9CisjZW5kaWYKICAgICAgICAgLy8gYXBwbHkgdm9sdW1lIHdpdGggcmFtcCBpZiBuZWVkZWQKICAgICAgICAgaWYgKChwQ29udGV4dC0+bGVmdFZvbHVtZSAhPSBwQ29udGV4dC0+cHJldkxlZnRWb2x1bWU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XApIFJldmVyYkdldFJvb21IZkxldmVsKCkgaGFzIHdyb25nIGxldmVsIC0+ICVkICVkXG4iLAogICAgICAgICAgICAgICAgQWN0aXZlUGFyYW1zLkxldmVsLCBsZXZlbCk7CiAgICAgfQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliaGVpZi9BbmRyb2lkLmJwIGIvbWVkaWEvbGliaGVpZi9BbmRyb2lkLmJwCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjdkNWE0ZWIKLS0tIC9kZXYvbnVsbAorKysgYi9tZWRpYS9saWJoZWlmL0FuZHJvaWQuYnAKQEAgLTAsMCArMSwyMyBAQAorY2NfbGlicmFyeV9zaGFyZWQgeworICAgIG5hbWU6ICJsaWJoZWlmIiwKKworICAgIHNyY3M6IFsKKyAgICAgICAgIkhlaWZEZWNvZGVySW1wbC5jcHAiLAorICAgIF0sCisKKyAgICBzaGFyZWRfbGliczogWworICAgICAgICAibGliYmluZGVyIiwKKyAgICAgICAgImxpYmxvZyIsCisgICAgICAgICJsaWJ1dGlscyIsCisgICAgICAgICJsaWJtZWRpYSIsCisgICAgXSwKKworICAgIGNmbGFnczogWworICAgICAgICAiLVdlcnJvciIsCisgICAgICAgICItV2FsbCIsCisgICAgXSwKKworICAgIGluY2x1ZGVfZGlyczogW10sCisKKyAgICBleHBvcnRfaW5jbHVkZV9kaXJzOiBbImluY2x1ZGUiXSwKK30KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmhlaWYvSGVpZkRlY29kZXJJbXBsLmNwcCBiL21lZGlhL2xpYmhlaWYvSGVpZkRlY29kZXJJbXBsLmNwcApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi41NzIwOWUyCi0tLSAvZGV2L251bGwKKysrIGIvbWVkaWEvbGliaGVpZi9IZWlmRGVjb2RlckltcGwuY3BwCkBAIC0wLDAgKzEsNDQ0IEBACisvKgorICogQ29weXJpZ2h0IChDKSAyMDE3IFRo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QnVmZmVyU2l6ZSgwKSB7fQorCisgICAgfkhlaWZEYXRhU291cmNlKCkgb3ZlcnJpZGUge30KKworICAgIC8qCisgICAgICogSW5pdGlhbGl6ZXMgaW50ZXJuYWwgcmVzb3VyY2VzLgorICAgICAqLworICAgIGJvb2wgaW5pdCgpOworCisgICAgc3A8SU1lbW9yeT4gZ2V0SU1lbW9yeSgpIG92ZXJyaWRlIHsgcmV0dXJuIG1NZW1vcnk7IH0KKyAgICBzc2l6ZV90IHJlYWRBdChvZmY2NF90IG9mZnNldCwgc2l6ZV90IHNpemUpIG92ZXJyaWRlOworICAgIHN0YXR1c190IGdldFNpemUob2ZmNjRfdCogc2l6ZSkgb3ZlcnJpZGUgOworICAgIHZvaWQgY2xvc2UoKSB7fQorICAgIHVpbnQzMl90IGdldEZsYWdzKCkgb3ZlcnJpZGUgeyByZXR1cm4gMDsgfQorICAgIFN0cmluZzggdG9TdHJpbmcoKSBvdmVycmlkZSB7IHJldHVybiBTdHJpbmc4KCJIZWlmRGF0YVNvdXJjZSIpOyB9CisgICAgc3A8RGVjcnlwdEhhbmRsZT4gRHJtSW5pdGlhbGl6YXRpb24oY29uc3QgY2hhciopIG92ZXJyaWRlIHsKKyAgICAgICAgcmV0dXJuIG51bGxwdHI7CisgICAgfQorCitwcml2YXRlOgorICAgIGVudW0geworICAgICAgICAvKgorICAgICAgICAgKiBCdWZmZXIgc2l6ZSBmb3IgcGFzc2luZyB0aGUgcmVhZCBkYXRhIHRvIG1lZGlhc2VydmVyLiBTZXQgdG8gNjRLCisgICAgICAgICAqICh3aGljaCBpcyB3aGF0IE1lZGlhRGF0YVNvdXJjZSBKYXZhIEFQSSdzIGpuaSBpbXBsZW1lbnRhdGlvbiB1c2VzKS4KKyAgICAgICAgICovCisgICAgICAgIGtCdWZmZXJTaXplID0gNjQgKiAxMDI0LAorICAgICAgICAvKgorICAgICAgICAgKiBJbml0aWFsIGFuZCBtYXggY2FjaGUgYnVmZmVyIHNpemUuCisgICAgICAgICA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TaXplOworICAgIHJldHVybiB0cnVlOworfQorCitzc2l6ZV90IEhlaWZEYXRhU291cmNlOjpyZWFkQXQob2ZmNjRfdCBvZmZzZXQsIHNpemVfdCBzaXplKSB7CisgICAgQUxPR1YoInJlYWRBdDogb2Zmc2V0PSVsbGQsIHNpemU9JXp1IiwgKGxvbmcgbG9uZylvZmZzZXQsIHNpemUpOworCisgICAgaWYgKG9mZnNldCA8IG1DYWNoZWRPZmZzZXQpIHsKKyAgICAgICAgLy8gdHJ5IHNlZWssIHRoZW4gcmV3aW5kL3NraXAsIGZhaWwgaWYgbm9uZSB3b3JrZWQKKyAgICAgICAgaWYgKG1TdHJlYW0tPnNlZWsob2Zmc2V0KSkgeworICAgICAgICAgICAgQUxPR1YoInJlYWRBdDogc2VlayB0byBvZmZzZXQ9JWxsZCIsIChsb25nIGxvbmcpb2Zmc2V0KTsKKyAgICAgICAgICAgIG1DYWNoZWRPZmZzZXQgPSBvZmZzZXQ7CisgICAgICAgICAgICBtQ2FjaGVkU2l6ZSA9IDA7CisgICAgICAgICAgICBtRU9TID0gZmFsc2U7CisgICAgICAgIH0gZWxzZSBpZiAobVN0cmVhbS0+cmV3aW5kKCkpIHsKKyAgICAgICAgICAgIEFMT0dWKCJyZWFkQXQ6IHJld2luZCB0byBvZmZzZXQ9MCIpOworICAgICAgICAgICAgbUNhY2hlZE9mZnNldCA9IDA7CisgICAgICAgICAgICBtQ2FjaGVkU2l6ZSA9IDA7CisgICAgICAgICAgICBtRU9TID0gZmFsc2U7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBBTE9HRSgicmVhZEF0OiBjb3VsZG4ndCBzZWVrIG9yIHJld2luZCEiKTsKKyAgICAgICAgICAgIG1FT1MgPSB0cnVlOworICAgICAgICB9CisgICAgfQorCisgICAgaWYgKG1FT1MgJiYgKG9mZnNldCA8IG1DYWNoZWRPZmZzZXQgfHwKKyAgICAgICAgICAgICAgICAgb2Zmc2V0ID49IChvZmY2NF90KShtQ2FjaG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IGJ5dGVzVG9Ta2lwKTsKKyAgICAgICAgICAgIGlmIChieXRlc1NraXBwZWQgIT0gYnl0ZXNUb1NraXApIHsKKyAgICAgICAgICAgICAgICAvLyBieXRlc1NraXBwZWQgaXMgaW52YWxpZCwgdGhlcmUgaXMgbm90IGVub3VnaCBieXRlcyB0byByZWFjaAorICAgICAgICAgICAgICAgIC8vIHRoZSByZXF1ZXN0ZWQgb2Zmc2V0LgorICAgICAgICAgICAgICAgIEFMT0dFKCJyZWFkQXQ6IHNraXAgZmFpbGVkLCBFT1MiKTsKKworICAgICAgICAgICAgICAgIG1FT1MgPSB0cnVlOworICAgICAgICAgICAgICAgIG1DYWNoZWRPZmZzZXQgPSBuZXdDYWNoZWRPZmZzZXQ7CisgICAgICAgICAgICAgICAgbUNhY2hlZFNpemUgPSAwOworICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9FTkRfT0ZfU1RSRUFNOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLy8gc2V0IGNhY2hlIHNpemUgdG8gMCwgc2luY2Ugd2UncmUgbm90IGtlZXBpbmcgYW55IG9sZCBjYWNoZQorICAgICAgICAgICAgbmV3Q2FjaGVkU2l6ZSA9IDA7CisgICAgICAgIH0KKworICAgICAgICBpZiAobmV3Q2FjaGUuZ2V0KCkgIT0gbnVsbHB0cikgeworICAgICAgICAgICAgbUNhY2hlLnJlc2V0KG5ld0NhY2hlLnJlbGVhc2UoKSk7CisgICAgICAgICAgICBtQ2FjaGVCdWZmZXJTaXplID0gbmV3Q2FjaGVCdWZmZXJTaXplOworICAgICAgICB9CisgICAgICAgIG1DYWNoZWRPZmZzZXQgPSBuZXdDYWNoZWRPZmZzZXQ7CisgICAgICAgIG1DYWNoZWRTaXplID0gbmV3Q2FjaGVkU2l6ZTsKKworICAgICAgICBBTE9HVigicmVhZEF0OiByb2xsaW5nIGNhY2hlIHdpbmRvdyB0byAoJWxsZCwgJXp1KSwgY2FjaGUgYnVmZmVyIHNpemUgJXp1IiwKKy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ib29sIEhlaWZEZWNvZGVySW1wbDo6aW5pdChIZWlmU3RyZWFtKiBzdHJlYW0sIEhlaWZGcmFtZUluZm8qIGZyYW1lSW5mbykgeworICAgIG1GcmFtZURlY29kZWQgPSBmYWxzZTsKKyAgICBzcDxIZWlmRGF0YVNvdXJjZT4gZGF0YVNvdXJjZSA9IG5ldyBIZWlmRGF0YVNvdXJjZShzdHJlYW0pOworICAgIGlmICghZGF0YVNvdXJjZS0+aW5pdCgpKSB7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisgICAgbURhdGFTb3VyY2UgPSBkYXRhU291cmNlOworCisgICAgbVJldHJpZXZlciA9IG5ldyBNZWRpYU1ldGFkYXRhUmV0cmlldmVyKCk7CisgICAgc3RhdHVzX3QgZXJyID0gbVJldHJpZXZlci0+c2V0RGF0YVNvdXJjZShtRGF0YVNvdXJjZSwgInZpZGVvL21wNCIpOworICAgIGlmIChlcnIgIT0gT0spIHsKKyAgICAgICAgQUxPR0UoImZhaWxlZCB0byBzZXQgZGF0YSBzb3VyY2UhIik7CisKKyAgICAgICAgbVJldHJpZXZlci5jbGVhcigpOworICAgICAgICBtRGF0YVNvdXJjZS5jbGVhcigpOworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorICAgIEFMT0dWKCJzdWNjZXNzZnVsbHkgc2V0IGRhdGEgc291cmNlLiIpOworCisgICAgY29uc3QgY2hhciogaGFzVmlkZW8gPSBtUmV0cmlldmVyLT5leHRyYWN0TWV0YWRhdGEoTUVUQURBVEFfS0VZX0hBU19WSURFTyk7CisgICAgaWYgKCFoYXNWaWRlbyB8fCBzdHJjYXNlY21wKGhhc1ZpZGVvLCAieWVzIikpIHsKKyAgICAgICAgQUxPR0UoIm5vIHZpZGVvOiAlcyIsIGhhc1ZpZGVvID8gaGFzVmlkZW8gOiAibnVsbCIpOworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgbUZyYW1lTWVtb3J5ID0gbVJldHJpZXZlci0+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mFtZS0+bVJvdGF0aW9uQW5nbGUsCisgICAgICAgICAgICAgICAgdmlkZW9GcmFtZS0+bUJ5dGVzUGVyUGl4ZWwsCisgICAgICAgICAgICAgICAgdmlkZW9GcmFtZS0+bUljY1NpemUsCisgICAgICAgICAgICAgICAgdmlkZW9GcmFtZS0+Z2V0RmxhdHRlbmVkSWNjRGF0YSgpKTsKKyAgICB9CisgICAgcmV0dXJuIHRydWU7Cit9CisKK2Jvb2wgSGVpZkRlY29kZXJJbXBsOjpnZXRFbmNvZGVkQ29sb3IoSGVpZkVuY29kZWRDb2xvciogLypvdXRDb2xvciovKSBjb25zdCB7CisgICAgQUxPR1coImdldEVuY29kZWRDb2xvcjogbm90IGltcGxlbWVudGVkISIpOworICAgIHJldHVybiBmYWxzZTsKK30KKworYm9vbCBIZWlmRGVjb2RlckltcGw6OnNldE91dHB1dENvbG9yKEhlaWZDb2xvckZvcm1hdCBoZWlmQ29sb3IpIHsKKyAgICBzd2l0Y2goaGVpZkNvbG9yKSB7CisgICAgICAgIGNhc2Uga0hlaWZDb2xvckZvcm1hdF9SR0I1NjU6CisgICAgICAgIHsKKyAgICAgICAgICAgIG1PdXRwdXRDb2xvciA9IEhBTF9QSVhFTF9GT1JNQVRfUkdCXzU2NTsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIGNhc2Uga0hlaWZDb2xvckZvcm1hdF9SR0JBXzg4ODg6CisgICAgICAgIHsKKyAgICAgICAgICAgIG1PdXRwdXRDb2xvciA9IEhBTF9QSVhFTF9GT1JNQVRfUkdCQV84ODg4OworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICAgICAgY2FzZSBrSGVpZkNvbG9yRm9ybWF0X0JHUkFfODg4ODoKKyAgICAgICAgeworICAgICAgICAgICAgbU91dHB1dENvbG9yID0gSEFMX1BJWEVMX0ZPUk1BVF9CR1JBXzg4ODg7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsK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0gbnVsbHB0cikgeworICAgICAgICAgICAgbUljY0RhdGEucmVzZXQobnVsbHB0cik7CisgICAgICAgIH0KKyAgICAgICAgbUljY1NpemUgPSBpY2NTaXplOworICAgICAgICBpZiAoaWNjU2l6ZSA+IDApIHsKKyAgICAgICAgICAgIG1JY2NEYXRhLnJlc2V0KG5ldyB1aW50OF90W2ljY1NpemVdKTsKKyAgICAgICAgICAgIGlmIChtSWNjRGF0YS5nZXQoKSAhPSBudWxscHRyKSB7CisgICAgICAgICAgICAgICAgbWVtY3B5KG1JY2NEYXRhLmdldCgpLCBpY2NEYXRhLCBpY2NTaXplKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbUljY1NpemUgPSAwOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLy8gSW50ZW50aW9uYWwgcHVibGljIGFjY2VzcyBtb2RpZmllcnM6CisgICAgdWludDMyX3QgbVdpZHRoOworICAgIHVpbnQzMl90IG1IZWlnaHQ7CisgICAgaW50MzJfdCAgbVJvdGF0aW9uQW5nbGU7ICAgICAgICAgICAvLyBSb3RhdGlvbiBhbmdsZSwgY2xvY2t3aXNlLCBzaG91bGQgYmUgbXVsdGlwbGUgb2YgOTAKKyAgICB1aW50MzJfdCBtQnl0ZXNQZXJQaXhlbDsgICAgICAgICAgIC8vIE51bWJlciBvZiBieXRlcyBmb3Igb25lIHBpeGVsCisgICAgdWludDMyX3QgbUljY1NpemU7ICAgICAgICAgICAgICAgICAvLyBOdW1iZXIgb2YgYnl0ZXMgaW4gbUljY0RhdGEKKyAgICBzdGQ6OnVuaXF1ZV9wdHI8dWludDhfdD4gbUljY0RhdGE7IC8vIEFjdHVhbCBJQ0MgZGF0YSwgbWVtb3J5IGlzIG93bmVkIGJ5IHRoaXMgc3RydWN0dXJlCit9OworCisvKgorICogQWJzdHJhY3QgaW50ZXJmYWNlIHRvIHByb3ZpZGUgZGF0YSB0byBIZWlmRGVjb2Rlci4KKyAqLworc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0Y2hlcywgJnN0YXR1cyk7Ci0gICAgICAgICAgICBib29sIGdvb2RtYXRjaCA9IHRydWU7Ci0gICAgICAgICAgICBpbnQgaGlnaGVzdCA9IDA7CiAgICAgICAgICAgICBjb25zdCBVQ2hhcnNldE1hdGNoKiBiZXN0Q29tYmluZWRNYXRjaCA9IGdldFByZWZlcnJlZChidWYsIHN0cmxlbihidWYpLAogICAgICAgICAgICAgICAgICAgICB1Y21hLCBtYXRjaGVzLCAmZ29vZG1hdGNoLCAmaGlnaGVzdCk7CiAKQEAgLTE4MCw4ICsxODAsMjQgQEAKICAgICAgICAgICAgICAgICAgICAgIXN0cmNtcChuYW1lLCAiZ2VucmUiKSB8fAogICAgICAgICAgICAgICAgICAgICAhc3RyY21wKG5hbWUsICJhbGJ1bSIpIHx8CiAgICAgICAgICAgICAgICAgICAgICFzdHJjbXAobmFtZSwgInRpdGxlIikpKSB7Ci0gICAgICAgICAgICAgICAgLy8gdXNlIGVuY29kaW5nIGRldGVybWluZWQgZnJvbSB0aGUgY29tYmluYXRpb24gb2YgYXJ0aXN0L2FsYnVtL3RpdGxlIGV0Yy4KLSAgICAgICAgICAgICAgICBlbmMgPSBjb21iaW5lZGVuYzsKKyAgICAgICAgICAgICAgICBpZiAoIWdvb2RtYXRjaCAmJiBoaWdoZXN0IDwgMCkgeworICAgICAgICAgICAgICAgICAgICAvLyBHaXZlIGl0IG9uZSBtb3JlIGNoYW5jZSBpZiB0aGVyZSBpcyBubyBnb29kIG1hdGNoLgorICAgICAgICAgICAgICAgICAgICBBTE9HVigiVHJ5aW5nIHRvIGRldGVjdCAlcyBzZXBhcmF0ZWx5IiwgbmFtZSk7CisgICAgICAgICAgICAgICAgICAgIGludDMyX3QgbWF0Y2hlczsKKyAgICAgICAgICAgICAgICAgICAgYm9vbCBnb29kbWF0Y2hTaW5nbGUgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBpbnQgaGlnaGVzdFNpbmdsZSA9IDA7CisgICAgICAgICAgICAgICAgICAgIHVjc2RldF9zZXRUZXh0KGNzZCwgcywgaW5wdXRMZW5ndGgsICZzdGF0dXMpOworICAgICAgICAgICAgICAgICAgICBjb25zdCBVQ2hhcnNldE1hdGNoKiogdWNtYSA9IHVjc2RldF9kZXRlY3RBbGwoY3NkLCAmbWF0Y2hlcywgJnN0YXR1cyk7CisgICAgICAgICAgICAgICAgICAgIGNvbnN0IFVDaGFyc2V0TWF0Y2gqIGJlc3RTaW5nbGVNYXRjaCA9IGdldFByZWZlcnJlZChzLCBpbnB1dExlbmd0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB1Y21hLCBtYXRjaGVzLCAmZ29vZG1hdGNoU2luZ2xlLCAmaGlnaGVzdFNpbmdsZSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChnb29kbWF0Y2hTaW5nbGUgfHwgaGlnaGVzdFNpbmdsZSA+IGhpZ2hlc3QpCisgICAgICAgICAgICAgICAgICAgICAgICBlbmMgPSB1Y3NkZXRfZ2V0TmFtZShiZXN0U2luZ2xlTWF0Y2gsICZzdGF0dXMpOworICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICBlbmMgPSBjb21iaW5lZGVuYzsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAvLyB1c2UgZW5jb2RpbmcgZGV0ZXJtaW5lZCBmcm9tIHRoZSBjb21iaW5hdGlvbiBvZiBhcnRpc3QvYWxidW0vdGl0bGUgZXRjLgorICAgICAgICAgICAgICAgICAgICBlbmMgPSBjb21iaW5lZGVuYzsKKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgIGlmIChpc1ByaW50YWJsZUFzY2lpKHMsIGlucHV0TGVuZ3RoKSkgewogICAgICAgICAgICAgICAgICAgICBlbmMgPSAiVVRGLTgiOwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlibWVkaWEvSU1lZGlhQ29kZWNTZ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F0YVNvdXJjZShjb25zdCBzcDxJRGF0YVNvdXJjZT4mIHNvdXJjZSwgY29uc3QgY2hhciAqbWltZSkKICAgICB7CiAgICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKICAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElNZWRpYU1ldGFkYXRhUmV0cmlldmVyOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOwogICAgICAgICBkYXRhLndyaXRlU3Ryb25nQmluZGVyKElJbnRlcmZhY2U6OmFzQmluZGVyKHNvdXJjZSkpOworCisgICAgICAgIGlmIChtaW1lICE9IE5VTEwpIHsKKyAgICAgICAgICAgIGRhdGEud3JpdGVJbnQzMigxKTsKKyAgICAgICAgICAgIGRhdGEud3JpdGVDU3RyaW5nKG1pbWUpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZGF0YS53cml0ZUludDMyKDApOworICAgICAgICB9CiAgICAgICAgIHJlbW90ZSgpLT50cmFuc2FjdChTRVRfREFUQV9TT1VSQ0VfQ0FMTEJBQ0ssIGRhdGEsICZyZXBseSk7CiAgICAgICAgIHJldHVybiByZXBseS5yZWFkSW50MzIoKTsKICAgICB9CiAKLSAgICBzcDxJTWVtb3J5PiBnZXRGcmFtZUF0VGltZShpbnQ2NF90IHRpbWVVcywgaW50IG9wdGlvbikKKyAgICBzcDxJTWVtb3J5PiBnZXRGcmFtZUF0VGltZShpbnQ2NF90IHRpbWVVcywgaW50IG9wdGlvbiwgaW50IGNvbG9yRm9ybWF0LCBib29sIG1ldGFPbmx5KQogICAgIHsKLSAgICAgICAgQUxPR1YoImdldFRpbWVBdFRpbWU6IHRpbWUoJSIgUFJJZDY0ICIgdXMpIGFuZCBvcHRpb24oJWQpIiwgdGltZVVzLCBvcHRpb24pOworICAgICAgICBBTE9HVigiZ2V0VGltZUF0VGltZTogdGltZSglIiBQUklkNjQgIiB1cyksIG9wdGlvbiglZCksIGNvbG9yRm9ybWF0KCVkKSBtZXRhT25seSglZCkiLAorICAgICAgICAgICAgICAgIHRpbWVVcywgb3B0aW9uLCBjb2xvckZvcm1hdCwgbWV0YU9ubHkpOwogICAgICAgICBQYXJjZWwgZGF0YSwgcmVwbHk7CiAgICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJTWVkaWFNZXRhZGF0YVJldHJpZXZlcjo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKICAgICAgICAgZGF0YS53cml0ZUludDY0KHRpbWVVcyk7CiAgICAgICAgIGRhdGEud3JpdGVJbnQzMihvcHRpb24pOworICAgICAgICBkYXRhLndyaXRlSW50MzIoY29sb3JGb3JtYXQpOworICAgICAgICBkYXRhLndyaXRlSW50MzIobWV0YU9ubHkpOwogI2lmbmRlZiBESVNBQkxFX0dST1VQX1NDSEVEVUxFX0hBQ0sKICAgICAgICAgc2VuZFNjaGVkUG9saWN5KGRhdGEpOwogI2VuZGlmCkBAIC0yNTgsNyArMjY4LDEyIEBACiAgICAgICAgICAgICBpZiAoc291cmNlID09IE5VTEwpIHsKICAgICAgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihCQURfVkFMVUUpOwogICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzZXREYXRhU291cmNlKHNvdXJjZSkpOworICAgICAgICAgICAgICAgIGludDMyX3QgaGFzTWltZSA9IGRhdGEucmVhZEludDMyKCk7CisgICAgICAgICAgICAgICAgY29uc3QgY2hhciAqbWltZSA9IE5VTEw7CisgICAgICAgICAgICAgICAgaWYgKGhhc01pbWUpIHsKKyAgICAgICAgICAgICAgICAgICAgbWltZSA9IGRhdGEucmVhZENTdHJpbmcoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc2V0RGF0YVNvdXJjZShzb3VyY2UsIG1pbWUpKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIHJldHVybiBOT19FUl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0YXR1cyA9IHJlbW90ZSgpLT50cmFuc2FjdChMSVNUX1NFUlZJQ0VfQVRUUklCVVRFUywgZGF0YSwgJnJlcGx5KTsKKyAgICAgICAgaWYgKHN0YXR1cyAhPSBOT19FUlJPUikgeworICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gcmVhZEZyb21QYXJjZWwoYXR0cmlidXRlcywgcmVwbHkpOworICAgIH0KKworICAgIHN0YXR1c190IGdldE5vZGVQcmVmaXgoc3RkOjpzdHJpbmcqIHByZWZpeCkgb3ZlcnJpZGUgeworICAgICAgICBQYXJjZWwgZGF0YSwgcmVwbHk7CisgICAgICAgIHN0YXR1c190IHN0YXR1czsKKyAgICAgICAgc3RhdHVzID0gZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElPTVhTdG9yZTo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKKyAgICAgICAgaWYgKHN0YXR1cyAhPSBOT19FUlJPUikgeworICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICAgICAgfQorICAgICAgICBzdGF0dXMgPSByZW1vdGUoKS0+dHJhbnNhY3QoR0VUX05PREVfUFJFRklYLCBkYXRhLCAmcmVwbHkpOworICAgICAgICBpZiAoc3RhdHVzICE9IE5PX0VSUk9SKSB7CisgICAgICAgICAgICByZXR1cm4gc3RhdHVzOworICAgICAgICB9CisgICAgICAgIHJldHVybiByZWFkRnJvbVBhcmNlbChwcmVmaXgsIHJlcGx5KTsKKyAgICB9CisKKyAgICBzdGF0dXNfdCBsaXN0Um9sZXMoc3RkOjp2ZWN0b3I8Um9sZUluZm8+KiByb2xlTGlzdCkgb3ZlcnJpZGUgeworICAgICAgICBQYXJjZWwgZGF0YSwgcmVwbHk7CisgICAgICAgIHN0YXR1c190IHN0YXR1czsKKyAgICAgICAgc3RhdHVzID0gZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElPTVhTdG9yZTo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKKyAgICAgICAgaWYgKHN0YXR1cyAhPSBOT19FUlJPUikgeworICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICAgICAgfQorICAgICAgICBzdGF0dXMgPSByZW1vdGUoKS0+dHJhbnNhY3QoTElTVF9ST0xFUywgZGF0YSwgJnJlcGx5KTsKKyAgICAgICAgaWYgKHN0YXR1cyAhPSBOT19FUlJPUikgeworICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gcmVhZEZyb21QYXJjZWwocm9sZUxpc3QsIHJlcGx5KTsKKyAgICB9CisKKyAgICBzdGF0dXNfdCBnZXRPbXgoY29uc3Qgc3RkOjpzdHJpbmcmIG5hbWUsIHNwPElPTVg+KiBvbXgpIG92ZXJyaWRlIHsKKyAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OworICAgICAgICBzdGF0dXNfdCBzdGF0dXM7CisgICAgICAgIHN0YXR1cyA9IGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJT01YU3RvcmU6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7CisgICAgICAgIGlmIChzdGF0dXMgIT0gTk9fRVJST1IpIHsKKyAgICAgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgICAgIH0KKyAgICAgICAgc3RhdHVzID0gd3JpdGVUb1BhcmNlbChuYW1lLCAmZGF0YSk7CisgICAgICAgIGlmIChzdGF0dXMgIT0gTk9fRVJST1IpIHsKKyAgICAgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgICAgIH0KKyAgICAgICAgc3RhdHVzID0gcmVtb3RlKCktPnRyYW5zYWN0KEdFVF9PTVgsIGRhdGEsICZyZXBseSk7CisgICAgICAgIGlmIChzdGF0dXMgIT0gTk9fRVJST1IpIHsKKyAgICAgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHJlcGx5LnJlYWRTdH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AhPSBOT19FUlJPUikgeworICAgICAgICAgICAgICAgIEFMT0dFKCJsaXN0U2VydmljZUF0dHJpYnV0ZXMoKSBmYWlscyB3aXRoIHN0YXR1cyAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0aWNfY2FzdDxpbnQ+KHN0YXR1cykpOworICAgICAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHN0YXR1cyA9IHdyaXRlVG9QYXJjZWwoYXR0cmlidXRlcywgcmVwbHkpOworICAgICAgICAgICAgaWYgKHN0YXR1cyAhPSBOT19FUlJPUikgeworICAgICAgICAgICAgICAgIEFMT0dFKCJsaXN0U2VydmljZUF0dHJpYnV0ZXMoKSBmYWlscyB0byBzZW5kIHJlcGx5Iik7CisgICAgICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOworICAgICAgICB9CisgICAgICAgIGNhc2UgR0VUX05PREVfUFJFRklYOiB7CisgICAgICAgICAgICBDSEVDS19PTVhfSU5URVJGQUNFKElPTVhTdG9yZSwgZGF0YSwgcmVwbHkpOworICAgICAgICAgICAgc3RhdHVzX3Qgc3RhdHVzOworICAgICAgICAgICAgc3RkOjpzdHJpbmcgcHJlZml4OworCisgICAgICAgICAgICBzdGF0dXMgPSBnZXROb2RlUHJlZml4KCZwcmVmaXgpOworICAgICAgICAgICAgaWYgKHN0YXR1cyAhPSBOT19FUlJPUikgeworICAgICAgICAgICAgICAgIEFMT0dFKCJnZXROb2RlUHJlZml4KCkgZmFpbHMgd2l0aCBzdGF0dXMgJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGljX2Nhc3Q8aW50PihzdGF0dXMpKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzdGF0dXMgPSB3cml0ZVRvUGFyY2VsKHByZWZpeCwgcmVwbHkpOworICAgICAgICAgICAgaWYgKHN0YXR1cyAhPSBOT19FUlJPUikgeworICAgICAgICAgICAgICAgIEFMT0dFKCJnZXROb2RlUHJlZml4KCkgZmFpbHMgdG8gc2VuZCByZXBseSIpOworICAgICAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKKyAgICAgICAgfQorICAgICAgICBjYXNlIExJU1RfUk9MRVM6IHsKKyAgICAgICAgICAgIENIRUNLX09NWF9JTlRFUkZBQ0UoSU9NWFN0b3JlLCBkYXRhLCByZXBseSk7CisgICAgICAgICAgICBzdGF0dXNfdCBzdGF0dXM7CisgICAgICAgICAgICBzdGQ6OnZlY3RvcjxSb2xlSW5mbz4gcm9sZUxpc3Q7CisKKyAgICAgICAgICAgIHN0YXR1cyA9IGxpc3RSb2xlcygmcm9sZUxpc3QpOworICAgICAgICAgICAgaWYgKHN0YXR1cyAhPSBOT19FUlJPUikgeworICAgICAgICAgICAgICAgIEFMT0dFKCJsaXN0Um9sZXMoKSBmYWlscyB3aXRoIHN0YXR1cyAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0aWNfY2FzdDxpbnQ+KHN0YXR1cykpOworICAgICAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHN0YXR1cyA9IHdyaXRlVG9QYXJjZWwocm9sZUxpc3QsIHJlcGx5KTsKKyAgICAgICAgICAgIGlmIChzdGF0dXMgIT0gTk9fRVJST1IpIHsKKyAgICAgICAgICAgICAgICBBTE9HRSgibGlzdFJvbGVzKCkgZmFpbHMgdG8gc2VuZCByZXBseSIpOworICAgICAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKKyAgICAgICAgfQorICAgICAgICBjYXNlIEdFVF9PTVg6IHsKKyAgICAgICAgICAgIENIRUNLX09NWF9JTlRFUkZBQ0UoSU9NWFN0b3JlLCBkYXRhLCByZXBseSk7CisgICAgICAgICAgICBzdGF0dXNfdCBzdGF0dXM7CisgICAgICAgICAgICBzdGQ6OnN0cmluZyBuYW1lOworICAgICAgICAgICAgc3A8SU9NWD4gb214OworCisgICAgICAgICAgICBzdGF0dXMgPSByZWFkRnJvbVBhcmNlbCgmbmFtZSwgZGF0YSk7CisgICAgICAgICAgICBpZiAoc3RhdHVzICE9IE5PX0VSUk9SKSB7CisgICAgICAgICAgICAgICAgQUxPR0UoImdldE9teCgpIGZhaWxzIHRvIHJldHJpZXZlIG5hbWUiKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzdGF0dXMgPSBnZXRPbXgobmFtZSwgJm9teCk7CisgICAgICAgICAgICBpZiAoc3RhdHVzICE9IE5PX0VSUk9SKSB7CisgICAgICAgICAgICAgICAgQUxPR0UoImdldE9teCgpIGZhaWxzIHdpdGggc3RhdHVzICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRpY19jYXN0PGludD4oc3RhdHVzKSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc3RhdHVzID0gcmVwbHktPndyaXRlU3Ryb25nQmluZGVyKElJbnRlcmZhY2U6OmFzQmluZGVyKG9teCkpOworICAgICAgICAgICAgaWYgKHN0YXR1cyAhPSBOT19FUlJPUikgeworICAgICAgICAgICAgICAgIEFMT0dFKCJnZXRPbXgoKSBmYWlscyB0byBzZW5kIHJlcGx5Iik7CisgICAgICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOworICAgICAgICB9CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICByZXR1cm4gQkJpbmRlc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WxsIGJlIHJlcGxhY2VkLgorICAgICAgICAgKgorICAgICAgICAgKiBBIHBhaXIgYWRkZWQgYnkgdGhpcyBmdW5jdGlvbiB3aWxsIGJlIGFjY2Vzc2libGUgYnkKKyAgICAgICAgICogYENhcGFiaWxpdGllczo6Z2V0RGV0YWlscygpYC4gQ2FsbCBgQU1lc3NhZ2U6OmdldFN0cmluZygpYCB3aXRoIHRoZQorICAgICAgICAgKiBzYW1lIGtleSB0byByZXRyaWV2ZSB0aGUgdmFsdWUuCisgICAgICAgICAqCisgICAgICAgICAqIEBwYXJhbSBrZXkgVGhlIGtleS4KKyAgICAgICAgICogQHBhcmFtIHZhbHVlIFRoZSBzdHJpbmcgdmFsdWUuCisgICAgICAgICAqLworICAgICAgICB2b2lkIGFkZERldGFpbChjb25zdCBjaGFyKiBrZXksIGNvbnN0IGNoYXIqIHZhbHVlKTsKKyAgICAgICAgLyoqCisgICAgICAgICAqIEFkZCBhIGtleS12YWx1ZSBwYWlyIHRvIHRoZSBsaXN0IG9mIGRldGFpbHMuIElmIHRoZSBrZXkgYWxyZWFkeQorICAgICAgICAgKiBleGlzdHMsIHRoZSBvbGQgdmFsdWUgd2lsbCBiZSByZXBsYWNlZC4KKyAgICAgICAgICoKKyAgICAgICAgICogQSBwYWlyIGFkZGVkIGJ5IHRoaXMgZnVuY3Rpb24gd2lsbCBiZSBhY2Nlc3NpYmxlIGJ5CisgICAgICAgICAqIGBDYXBhYmlsaXRpZXM6OmdldERldGFpbHMoKWAuIENhbGwgYEFNZXNzYWdlOjpnZXRJbnQzMigpYCB3aXRoIHRoZQorICAgICAgICAgKiBzYW1lIGtleSB0byByZXRyaWV2ZSB0aGUgdmFsdWUuCisgICAgICAgICAqCisgICAgICAgICAqIEBwYXJhbSBrZXkgVGhlIGtleS4KKyAgICAgICAgICogQHBhcmFtIHZhbHVlIFRoZSBgaW50MzJfdGAgdmFsdWUuCisgICAgICAgICAqLworICAgICAgICB2b2lkIGFkZERldGFpbChjb25zdCBjaGFyKiBrZXksIGludDMyX3QgdmFsdWUpOworICAgICAgICAvKioKKyAgICAgICAgICogQWRkIGEgcHJvZmlsZS1sZXZlbCBwYWlyLiBJZiB0aGlzIHByb2ZpbGUtbGV2ZWwgcGFpciBhbHJlYWR5IGV4aXN0cywKKyAgICAgICAgICogaXQgd2lsbCBiZSBpZ25vcmVkLgorICAgICAgICAgKgorICAgICAgICAgKiBAcGFyYW0gcHJvZmlsZSBUaGUgInByb2ZpbGUiIGNvbXBvbmVudC4KKyAgICAgICAgICogQHBhcmFtIGxldmVsIFRoZSAibGV2ZWwiIGNvbXBvbmVudC4KKyAgICAgICAgICovCiAgICAgICAgIHZvaWQgYWRkUHJvZmlsZUxldmVsKHVpbnQzMl90IHByb2ZpbGUsIHVpbnQzMl90IGxldmVsKTsKKyAgICAgICAgLyoqCisgICAgICAgICAqIEFkZCBhIGNvbG9yIGZvcm1hdC4gSWYgdGhpcyBjb2xvciBmb3JtYXQgYWxyZWFkeSBleGlzdHMsIGl0IHdpbGwgYmUKKyAgICAgICAgICogaWdub3JlZC4KKyAgICAgICAgICoKKyAgICAgICAgICogQHBhcmFtIGZvcm1hdCBUaGUgY29sb3IgZm9ybWF0LgorICAgICAgICAgKi8KICAgICAgICAgdm9pZCBhZGRDb2xvckZvcm1hdCh1aW50MzJfdCBmb3JtYXQpOworICAgICAgICAvKioKKyAgICAgICAgICogQWRkIGZsYWdzLiBUaGUgdW5kZXJseWluZyBvcGVyYXRpb24gaXMgYml0d2lzZS1vci4gSW4gb3RoZXIgd29yZHMsCisgICAgICAgICAqIGJpdHMgdGhhdCBoYXZlIGFscmVhZHkgYmVlbiBzZXQgd2lsbCBiZSBpZ25vcmVkLgorICAgICAgICAgKgorICAgICAgICAgKiBAcGFyYW0gZmxhZ3MgVGhlIGFkZGl0aW9uYWwgZmxhZ3MuCisgICAgICAgICAqLwogICAgICAgICB2b2lkIGFkZEZsYWdzKHVpbnQzMl90IGZsYWdzKTsKKyAgICBwcml2YXRlOgorICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGFzc29jaWF0ZWQgYENhcGFiaWxpdGllc2Agb2JqZWN0LgorICAgICAgICAgKi8KKyAgICAgICAgQ2FwYWJpbGl0aWVzKiBtQ2FwOworICAgICAgICAvKioKKyAgICAgICAgICogQ29uc3RydWN0IGEgd3JpdGVyIGZvciB0aGUgZ2l2ZW4gYENhcGFiaWxpdGllc2Agb2JqZWN0LgorICAgICAgICAgKgorICAgICAgICAgKiBAcGFyYW0gY2FwIFRoZSBgQ2FwYWJpbGl0aWVzYCBvYmplY3QgdG8gYmUgd3JpdHRlbiB0by4KKyAgICAgICAgICovCisgICAgICAgIENhcGFiaWxpdGllc1dyaXRlcihDYXBhYmlsaXRpZXMqIGNhcCk7CisKKyAgICAgICAgZnJpZW5kIE1lZGlhQ29kZWNJbmZvV3JpdGVyOwogICAgIH07CiAKICAgICBib29sIGlzRW5jb2RlcigpIGNvbnN0OwotICAgIGJvb2wgaGFzUXVpcmsoY29uc3QgY2hhciAqbmFtZSkgY29uc3Q7CiAgICAgdm9pZCBnZXRTdXBwb3J0ZWRNaW1lcyhWZWN0b3I8QVN0cmluZz4gKm1pbWVzKSBjb25zdDsKICAgICBjb25zdCBzcDxDYXBhYmlsaXRpZXM+IGdldENhcGFiaWxpdGllc0Zvcihjb25zdCBjaGFyICptaW1lKSBjb25zdDsKICAgICBjb25zdCBjaGFyICpnZXRDb2RlY05hbWUoKSBjb25zdDsKIAogICAgIC8qKgorICAgICAqIFJldHVybiB0aGUgbmFtZSBvZiB0aGUgc2VydmljZSB0aGF0IGhvc3RzIHRoZSBjb2RlYy4gVGhpcyB2YWx1ZSBpcyBub3QKKyAgICAgKiB2aXNpYmxlIGF0IHRoZSBKYXZhIGxldmVsLgorICAgICAqCisgICAgICogQ3VycmVudGx5LCB0aGlzIGlzIHRoZSAiaW5zdGFuY2UgbmFtZSIgb2YgdGhlIElPbXggc2VydmljZS4KKyAgICAgKi8KKyAgICBjb25zdCBjaGFyICpnZXR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AgICAgcmV0dXJuIHByb3A7CiB9CiAKKy8vIHVzZWQgd2l0aGluIHRoZSBzdW1tYXJpemVyczsgcmV0dXJuIHdoZXRoZXIgcHJvcGVydHkgZXhpc3RlZAorYm9vbCBNZWRpYUFuYWx5dGljc0l0ZW06OnJlbW92ZVByb3AoY29uc3QgY2hhciAqbmFtZSkgeworICAgIHNpemVfdCBsZW4gPSBzdHJsZW4obmFtZSk7CisgICAgc2l6ZV90IGkgPSBmaW5kUHJvcEluZGV4KG5hbWUsIGxlbik7CisgICAgaWYgKGkgPCBtUHJvcENvdW50KSB7CisgICAgICAgIFByb3AgKnByb3AgPSAmbVByb3BzW2ldOworICAgICAgICBjbGVhclByb3AocHJvcCk7CisgICAgICAgIGlmIChpICE9IG1Qcm9wQ291bnQtMSkgeworICAgICAgICAgICAgLy8gaW4gdGhlIG1pZGRsZSwgYnJpbmcgbGFzdCBvbmUgZG93biB0byBmaWxsIGdhcAorICAgICAgICAgICAgY29weVByb3AocHJvcCwgJm1Qcm9wc1ttUHJvcENvdW50LTFdKTsKKyAgICAgICAgICAgIGNsZWFyUHJvcCgmbVByb3BzW21Qcm9wQ291bnQtMV0pOworICAgICAgICB9CisgICAgICAgIG1Qcm9wQ291bnQtLTsKKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorICAgIHJldHVybiBmYWxzZTsKK30KKwogLy8gc2V0IHRoZSB2YWx1ZXMKIHZvaWQgTWVkaWFBbmFseXRpY3NJdGVtOjpzZXRJbnQzMihNZWRpYUFuYWx5dGljc0l0ZW06OkF0dHIgbmFtZSwgaW50MzJfdCB2YWx1ZSkgewogICAgIFByb3AgKnByb3AgPSBhbGxvY2F0ZVByb3AobmFtZSk7CkBAIC01NjgsNiArNjA5LDEwIEBACiAgICAgLy8gaW50byAndGhpcycgb2JqZWN0CiAgICAgLy8gLi4gd2UgbWFrZSBhIGNvcHkgb2YgdGhlIHN0cmluZyB0byBwdXQgYXdheS4KICAgICBtS2V5ID0gZGF0YS5yZW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PmdldFNlcnZpY2UoU3RyaW5nMTYoc2VydmljZW5hbWUpKTsKICAgICAgICAgICAgICAgICBpZiAoYmluZGVyICE9IE5VTEwpIHsKICAgICAgICAgICAgICAgICAgICAgc0FuYWx5dGljc1NlcnZpY2UgPSBpbnRlcmZhY2VfY2FzdDxJTWVkaWFBbmFseXRpY3NTZXJ2aWNlPihiaW5kZXIpOworICAgICAgICAgICAgICAgICAgICBpZiAoc05vdGlmaWVyICE9IE5VTEwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNOb3RpZmllciA9IE5VTEw7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgc05vdGlmaWVyID0gbmV3IE1lZGlhTWV0cmljc0RlYXRoTm90aWZpZXIoKTsKKyAgICAgICAgICAgICAgICAgICAgYmluZGVyLT5saW5rVG9EZWF0aChzTm90aWZpZXIpOwogICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgIGJhZG5lc3MgPSAiZGlkIG5vdCBmaW5kIHNlcnZpY2UiOwogICAgICAgICAgICAgICAgIH0KQEAgLTgxNiw4ICs5MzEsOCBAQAogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICBpZiAoc0FuYWx5dGljc1NlcnZpY2UgPT0gTlVMTCkgewotICAgICAgICAgICAgICAgIGlmICh0cmllc19yZW1haW5pbmcgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIHRyaWVzX3JlbWFpbmluZy0tOworICAgICAgICAgICAgICAgIGlmIChyZW1haW5pbmdCaW5kQXR0ZW1wdHMgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIHJlbWFpbmluZ0JpbmRBdHRlbXB0cy0tOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBpZiAoREVCVUdfU0VSVklDRUFDQ0VTUykgewogICAgICAgICAgICAgICAgICAgICBBTE9HRCgiVW5hYmxlIHRvIGJpbmQgdG8gc2VydmljZSAlczogJXMiLCB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kZXggNmEwOTIyNy4uZGYzNjA0NiAxMDA2NDQKLS0tIGEvbWVkaWEvbGlibWVkaWFwbGF5ZXJzZXJ2aWNlL251cGxheWVyL051UGxheWVyLmNwcAorKysgYi9tZWRpYS9saWJtZWRpYXBsYXllcnNlcnZpY2UvbnVwbGF5ZXIvTnVQbGF5ZXIuY3BwCkBAIC0xMTcxLDcgKzExNzEsNyBAQAogICAgICAgICAgICAgICAgIGlmIChtU291cmNlICE9IG51bGxwdHIpIHsKICAgICAgICAgICAgICAgICAgICAgaWYgKGF1ZGlvKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobVZpZGVvRGVjb2RlckVycm9yIHx8IG1Tb3VyY2UtPmdldEZvcm1hdChmYWxzZSAvKiBhdWRpbyAqLykgPT0gTlVMTAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBtU3VyZmFjZSA9PSBOVUxMKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IG1TdXJmYWNlID09IE5VTEwgfHwgbVZpZGVvRGVjb2RlciA9PSBOVUxMKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gV2hlbiBib3RoIGF1ZGlvIGFuZCB2aWRlbyBoYXZlIGVycm9yLCBvciB0aGlzIHN0cmVhbSBoYXMgb25seSBhdWRpbwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdoaWNoIGhhcyBlcnJvciwgbm90aWZ5IGNsaWVudCBvZiBlcnJvci4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICBub3RpZnlMaXN0ZW5lcihNRURJQV9FUlJPUiwgTUVESUFfRVJST1JfVU5LTk9XTiwgZXJyKTsKQEAgLTExODIsNyArMTE4Miw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICBtQXVkaW9EZWNvZGVyRXJyb3IgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1BdWRpb0RlY29kZXJFcnJvciB8fCBtU291cmNlLT5nZXRGb3JtYXQodHJ1ZSAvKiBhdWRpbyAqLykgPT0gTlVMTAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBtQXVkaW9TaW5rID09IE5VTEwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgbUF1ZGlvU2luayA9PSBOVUxMIHx8IG1BdWRpb0RlY29kZXIgPT0gTlVMTCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFdoZW4gYm90aCBhdWRpbyBhbmQgdmlkZW8gaGF2ZSBlcnJvciwgb3IgdGhpcyBzdHJlYW0gaGFzIG9ubHkgdmlkZW8KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB3aGljaCBoYXMgZXJyb3IsIG5vdGlmeSBjbGllbnQgb2YgZXJyb3IuCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm90aWZ5TGlzdGVuZXIoTUVESUFfRVJST1IsIE1FRElBX0VSUk9SX1VOS05PV04sIGVycik7CmRpZmYgLS1naXQgYS9tZWRpYS9saWJtZWRpYXBsYXllcnNlcnZpY2UvbnVwbGF5ZXIvTnVQbGF5ZXJEZWNvZGVyLmNwcCBiL21lZGlhL2xpYm1lZGlhcGxheWVyc2VydmljZS9udXBsYXllci9OdVBsYXllckRlY29kZXIuY3BwCmluZGV4IDhmZTI1NWIuLmFjMTg3Y2MgMTAwNjQ0Ci0tLSBhL21lZGlhL2xpYm1lZGlhcGxheWVyc2VydmljZS9udXBsYXllci9OdVBsYXllckRlY29kZXIuY3BwCisrKyBiL21lZGlhL2xpYm1lZGlhcGxheWVyc2VydmljZS9udXBsYXllci9OdVBsYXllckRlY29kZXIuY3BwCkBAIC0zNDMsNyArMzQzLDcgQEAKICAgICAgICAgICAgIGZvcm1hdCwgbVN1cmZhY2UsIGNyeXB0bywgMCAvKiBmbGFncyAqLyk7CiAKICAgICBpZiAoZXJyICE9IE9LKSB7Ci0gICAgICAgI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4gbG9vcGluZwogICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgfQotCisgICAgICAgICAgICAgICAgaWYgKHByb3BlcnR5X2dldF9ib29sKCJwZXJzaXN0LmRlYnVnLnNmLnN0YXRzIiwgZmFsc2UpKSB7CisgICAgICAgICAgICAgICAgICAgIFZlY3RvcjxTdHJpbmcxNj4gYXJnczsKKyAgICAgICAgICAgICAgICAgICAgZHVtcCgtMSwgYXJncyk7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIG1QbGF5ZXItPnBhdXNlKCk7CiAgICAgICAgICAgICAgICAgbVN0YXRlID0gU1RBVEVfUEFVU0VEOwogICAgICAgICAgICAgfQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlibWVkaWFwbGF5ZXJzZXJ2aWNlL251cGxheWVyL051UGxheWVyRHJpdmVyLmggYi9tZWRpYS9saWJtZWRpYXBsYXllcnNlcnZpY2UvbnVwbGF5ZXIvTnVQbGF5ZXJEcml2ZXIuaAppbmRleCBjNWRkY2IwLi5kMGNmMWRkIDEwMDY0NAotLS0gYS9tZWRpYS9saWJtZWRpYXBsYXllcnNlcnZpY2UvbnVwbGF5ZXIvTnVQbGF5ZXJEcml2ZXIuaAorKysgYi9tZWRpYS9saWJtZWRpYXBsYXllcnNlcnZpY2UvbnVwbGF5ZXIvTnVQbGF5ZXJEcml2ZXIuaApAQCAtMTMyLDExICsxMzIsMTMgQEAKICAgICB1aW50MzJfdCBtUGxheWVyRmxhZ3M7CiAKICAgICBNZWRpYUFuYWx5dGljc0l0ZW0gKm1BbmFseXRpY3NJdGVtOworICAgIHVpZF90IG1DbGllbnRVaWQ7CiAKICAgICBib29sIG1BdEVPUzsKICAgICBib29sIG1Mb29waW5nOwogICAgIGJvb2wgbUF1dG9Mb29wOwogCisKICAgICB2b2lkIHVwZGF0ZU1ldHJpY3MoY29uc3QgY2hhciAqd2hlcmUpOwogICAgIHZvaWQgbG9nTWV0cmljcyhjb25zd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2gpCi17Ci0gICAgaWYgKCFtRW5hYmxlZCkgewotICAgICAgICByZXR1cm47Ci0gICAgfQotICAgIEhpc3RUc0VudHJ5IGRhdGE7Ci0gICAgZGF0YS5oYXNoID0gaGFzaDsKLSAgICBkYXRhLnRzID0gZ2V0X21vbm90b25pY19ucygpOwotICAgIGlmIChkYXRhLnRzID4gMCkgewotICAgICAgICBsb2coRVZFTlRfSElTVE9HUkFNX0ZMVVNILCAmZGF0YSwgc2l6ZW9mKGRhdGEpKTsKKyAgICAgICAgbG9nKGV2ZW50LCAmZGF0YSwgc2l6ZW9mKGRhdGEpKTsKICAgICB9IGVsc2UgewogICAgICAgICBBTE9HRSgiRmFpbGVkIHRvIGdldCB0aW1lc3RhbXAiKTsKICAgICB9CkBAIC03NzEsMTUgKzc2MywxNSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOQkxvZzo6RXZlbnQ6OkVWRU5UX0hJU1RPR1JBTV9FTlRSWV9UU307CiBjb25zdCBzdGQ6OnNldDxOQkxvZzo6RXZlbnQ+IE5CTG9nOjpSZWFkZXI6OmVuZGluZ1R5cGVzICAge05CTG9nOjpFdmVudDo6RVZFTlRfRU5EX0ZNVCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTkJMb2c6OkV2ZW50OjpFVkVOVF9ISVNUT0dSQU1fRU5UUllfVFMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5CTG9nOjpFdmVudDo6RVZFTlRfSElTVE9HUkFNX0ZMVVNIfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTkJMb2c6OkV2ZW50OjpFVkVOVF9BVURJT19TVEFURX07CisKIE5CTG9nOjpSZWFkZXI6OlJlYWRlcihjb25zdCB2b2lkICpzaGFyZW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gIHNpemVfdCBsb3N0ID0gc25hcHNob3QubG9zdCgpICsgKHNuYXBzaG90LmJlZ2luKCkgLSBFbnRyeUl0ZXJhdG9yKHNuYXBzaG90LmRhdGEoKSkpOwogICAgIGlmIChsb3N0ID4gMCkgewogICAgICAgICBib2R5LmFwcGVuZEZvcm1hdCgid2FybmluZzogbG9zdCAlenUgYnl0ZXMgd29ydGggb2YgZXZlbnRzIiwgbG9zdCk7CkBAIC05NzMsODUgKzg4OCw5IEBACiAgICAgICAgIC8vICAgICAgbG9nIHRvIHB1c2ggaXQgb3V0LiAgQ29uc2lkZXIga2VlcGluZyB0aGUgdGltZXN0YW1wL2JvZHkgYmV0d2VlbiBjYWxscyB0byBjb3B5RW50cnlEYXRhQXQoKS4KICAgICAgICAgZHVtcExpbmUodGltZXN0YW1wLCBib2R5KTsKICAgICB9Ci0jaWYgMAotICAgIHNpemVfdCB3aWR0aCA9IDE7Ci0gICAgd2hpbGUgKG1heFNlYyA+PSAxMCkgewotICAgICAgICArK3dpZHRoOwotICAgICAgICBtYXhTZWMgLz0gMTA7Ci0gICAgfQotICAgIGlmIChtYXhTZWMgPj0gMCkgewotICAgICAgICB0aW1lc3RhbXAuYXBwZW5kRm9ybWF0KCJbJSpzXSIsIChpbnQpIHdpZHRoICsgNCwgIiIpOwotICAgIH0KLSAgICBib29sIGRlZmVycmVkVGltZXN0YW1wID0gZmFsc2U7Ci0jZW5kaWYKIAogICAgIGZvciAoYXV0byBlbnRyeSA9IHNuYXBzaG90LmJlZ2luKCk7IGVudHJ5ICE9IHNuYXBzaG90LmVuZCgpOykgewogICAgICAgICBzd2l0Y2ggKGVudHJ5LT50eXBlKSB7Ci0jaWYgMAotICAgICAgICBjYXNlIEVWRU5UX1NUUklORzoKLSAgICAgICAgICAgIGJvZHkuYXBwZW5kRm9ybWF0KCIlLipzIiwgKGludCkgZW50cnkubGVuZ3RoKCksIGVudHJ5LmRhdGEoKSk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBFVkVOVF9USU1FU1RBTVA6IHsKLSAgICAgICAgICAgIC8vIGFscmVhZHkgY2hlY2tlZCB0aGF0IGxlbmd0aCA9PSBzaXplb2Yoc3RydWN0IHRpbWVzcGVjKTsKLSAgICAgICAgICAgIGVudHJ5LmNvcHlEYXRhKChjb25zdCB1aW50OF90KikgJnRzKTsKLSAgICAgICAgICAgIGxvbmcgcHJldk5zZWMgPSB0cy50dl9uc2VjOwotICAgICAgICAgICAgbG9uZyBkZWx0YU1pbiA9IExPTkdfTUFYOwotICAgICAgICAgICAgbG9uZyBkZWx0YU1heCA9IC0xOwotICAgICAgICAgICAgbG9uZyBkZWx0YVRvdGFsID0gMDsKLSAgICAgICAgICAgIGF1dG8gYXV4KGVudHJ5KTsKLSAgICAgICAgICAgIGZvciAoOzspIHsKLSAgICAgICAgICAgICAgICArK2F1eDsKLSAgICAgICAgICAgICAgICBpZiAoZW5kIC0gYXV4ID49IDAgfHwgYXV4LnR5cGUoKSAhPSBFVkVOVF9USU1FU1RBTVApIHsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHN0cnVjdCB0aW1lc3BlYyB0c05leHQ7Ci0gICAgICAgICAgICAgICAgYXV4LmNvcHlEYXRhKChjb25zdCB1aW50OF90KikgJnRzTmV4dCk7Ci0gICAgICAgICAgICAgICAgaWYgKHRzTmV4dC50dl9zZWMgIT0gdHMudHZfc2VjKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBsb25nIGRlbHRhID0gdHNOZXh0LnR2X25zZWMgLSBwcmV2TnNlYzsKLSAgICAgICAgICAgICAgICBpZiAoZGVsdGEgPCAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoZGVsdGEgPCBkZWx0YU1pbikgewotICAgICAgICAgICAgICAgICAgICBkZWx0YU1pbiA9IGRlbHRhOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoZGVsdGEgPiBkZWx0YU1heCkgewotICAgICAgICAgICAgICAgICAgICBkZWx0YU1heCA9IGRlbHRhOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBkZWx0YVRvdGFsICs9IGRlbHRhOwotICAgICAgICAgICAgICAgIHByZXZOc2VjID0gdHNOZXh0LnR2X25zZWM7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBzaXplX3QgbiA9IChhdXggLSBlbnRyeSkgLyAoc2l6ZW9mKHN0cnVjdCB0aW1lc3BlYykgKyAzIC8qRW50cnk6OmtPdmVyaGVhZD8qLyk7Ci0gICAgICAgICAgICBpZiAoZGVmZXJyZWRUaW1lc3RhbXApIHsKLSAgICAgICAgICAgICAgICBkdW1wTGluZSh0aW1lc3RhbXAsIGJvZHkpOwotICAgICAgICAgICAgICAgIGRlZmVycmVkVGltZXN0YW1wID0gZmFsc2U7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICB0aW1lc3RhbXAuY2xlYXIoKTsKLSAgICAgICAgICAgIGlmIChuID49IGtTcXVhc2hUaW1lc3RhbXApIHsKLSAgICAgICAgICAgICAgICB0aW1lc3RhbXAuYXBwZW5kRm9ybWF0KCJbJWQuJTAzZCB0byAuJS4wM2QgYnkgLiUuMDNkIHRvIC4lLjAzZF0iLAotICAgICAgICAgICAgICAgICAgICAgICAgKGludCkgdHMudHZfc2VjLCAoaW50KSAodHMudHZfbnNlYyAvIDEwMDAwMDApLAotICAgICAgICAgICAgICAgICAgICAgICAgKGludCkgKCh0cy50dl9uc2VjICsgZGVsdGFUb3RhbCkgLyAxMDAwMDAwKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIChpbnQpIChkZWx0YU1pbiAvIDEwMDAwMDApLCAoaW50KSAoZGVsdGFNYXggLyAxMDAwMDAwKSk7Ci0gICAgICAgICAgICAgICAgZW50cnkgPSBhdXg7Ci0gICAgICAgICAgICAgICAgLy8gYWR2YW5jZSA9IDA7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICB0aW1lc3RhbXAuYXBwZW5kRm9ybWF0KCJbJWQuJTAzZF0iLCAoaW50KSB0cy50dl9zZWMsCi0gICAgICAgICAgICAgICAgICAgIChpbnQpICh0cy50dl9uc2VjIC8gMTAwMDAwMCkpOwotICAgICAgICAgICAgZGVmZXJyZWRUaW1lc3RhbXAgPSB0cnVlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgRVZFTlRfSU5URUdFUjoKLSAgICAgICAgICAgIGFwcGVuZEludCgmYm9keSwgZW50cnkuZGF0YSgpKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIEVWRU5UX0ZMT0FUOgotICAgICAgICAgICAgYXBwZW5kRmxvYXQoJmJvZHksIGVudHJ5LmRhdGEoKSk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBFVkVOVF9QSUQ6Ci0gICAgICAgICAgICBhcHBlbmRQSUQoJmJvZHksIGVudHJ5LmRhdGEoKSwgZW50cnkubGVuZ3RoKCkpOwotICAgICAgICAgICAgYnJlYWs7Ci0jZW5kaWYKICAgICAgICAgY2FzZSBFVkVOVF9TVEFSVF9GTVQ6CiAgICAgICAgICAgICBlbnRyeSA9IGhhbmRsZUZvcm1hdChGb3JtYXRFbnRyeShlbnRyeSksICZ0aW1lc3RhbXAsICZib2R5KTsKICAgICAgICAgICAgIGJyZWFrOwpAQCAtMTA2Myw0MCArOTAyLDEyIEBACiAgICAgICAgICAgICBtZW1jcHkoJmhhc2gsICYoZGF0YS0+aGFzaCksIHNpemVvZihoYXNoKSk7CiAgICAgICAgICAgICBpbnQ2NF90IHRzOwogICAgICAgICAgICAgbWVtY3B5KCZ0cywgJmRhdGEtPnRzLCBzaXplb2YodHMpKTsKLSAgICAgICAgICAgIGNvbnN0IHN0ZDo6cGFpcjxsb2dfaGFzaF90LCBpbnQ+IGtleShoYXNoLCBkYXRhLT5hdXRob3IpOwotICAgICAgICAgICAgLy8gVE9ETyBtaWdodCB3YW50IHRvIGZpbHRlciBleGNlc3NpdmVseSBoaWdoIG91dGxpZXJzLCB3aGljaCBhcmUgdXN1YWxseSBjYXVzZWQKLSAgICAgICAgICAgIC8vIGJ5IHRoZSB0aHJlYWQgYmVpbmcgaW5hY3RpdmUuCi0gICAgICAgICAgICBtSGlzdHNba2V5XS5wdXNoX2JhY2sodHMpOworICAgICAgICAgICAgcGVyZm9ybWFuY2VBbmFseXNpcy5sb2dUc0VudHJ5KHRzKTsKICAgICAgICAgICAgICsrZW50cnk7CiAgICAgICAgICAgICBicmVhazsKICAgICAgICAgfQotICAgICAgICAvLyBkcmF3cyBoaXN0b2dyYW1zIHN0b3JlZCBpbiBnbG9iYWwgUmVhZGVyOjptSGlzdHMgYW5kIGVyYXNlcyB0aGVtCi0gICAgICAgIGNhc2UgRVZFTlRfSElTVE9HUkFNX0ZMVVNIOiB7Ci0gICAgICAgICAgICBIaXN0b2dyYW1FbnRyeSBoaXN0RW50cnkoZW50cnkpOwotICAgICAgICAgICAgLy8gTG9nIHRpbWVzdGFtcAotICAgICAgICAgICAgLy8gVGltZXN0YW1wIG9mIGNhbGwgdG8gZHJhd0hpc3RvZ3JhbSwgbm90IHdoZW4gYXVkaW8gd2FzIGdlbmVyYXRlZAotICAgICAgICAgICAgY29uc3QgaW50NjRfdCB0cyA9IGhpc3RFbnRyeS50aW1lc3RhbXAoKTsKLSAgICAgICAgICAgIHRpbWVzdGFtcC5jbGVhcigpOwotICAgICAgICAgICAgdGltZXN0YW1wLmFwcGVuZEZvcm1hdCgiWyVkLiUwM2RdIiwgKGludCkgKHRzIC8gKDEwMDAgKiAxMDAwICogMTAwMCkpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpbnQpICgodHMgLyAoMTAwMCAqIDEwMDApKSAlIDEwMDApKTsKLSAgICAgICAgICAgIC8vIExvZyBoaXN0b2dyYW1zCi0gICAgICAgICAgICBzZXRGaW5kR2xpdGNoKHRydWUpOwotICAgICAgICAgICAgYm9keS5hcHBlbmRGb3JtYXQoIkhpc3RvZ3JhbSBmbHVzaCAtICIpOwotICAgICAgICAgICAgaGFuZGxlQXV0aG9yKGhpc3RFbnRyeSwgJmJvZHkpOwotICAgICAgICAgICAgZm9yIChhdXRvIGhpc3QgPSBtSGlzdHMuYmVnaW4oKTsgaGlzdCAhPSBtSGlzdHMuZW5kKCk7KSB7Ci0gICAgICAgICAgICAgICAgaWYgKGhpc3QtPmZpcnN0LnNlY29uZCA9PSBoaXN0RW50cnkuYXV0aG9yKCkpIHsKLSAgICAgICAgICAgICAgICAgICAgYm9keS5hcHBlbmRGb3JtYXQoIiVYIiwgKGludCloaXN0LT5maXJzdC5maXJzdCk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChmaW5kR2xpdGNoKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBhbGVydElmR2xpdGNoKGhpc3QtPnNlY29uZCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgLy8gc2V0IGZpbGUgdG8gZW1wdHkgYW5kIHdyaXRlIGRhdGEgZm9yIGFsbCBoaXN0b2dyYW1zIGluIHRoaXMgc2V0Ci0gICAgICAgICAgICAgICAgICAgIHdyaXRlSGlzdFRvRmlsZShoaXN0LT5zZWNvbmQsIGhpc3QgIT0gbUhpc3RzLmJlZ2luKCkpOwotICAgICAgICAgICAgICAgICAgICBkcmF3SGlzdG9ncmFtKCZib2R5LCBoaXN0LT5zZWNvbmQsIHRydWUsIGluZGVudCk7Ci0gICAgICAgICAgICAgICAgICAgIGhpc3QgPSBtSGlzdHMuZXJhc2UoaGlzdCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgKyto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M2NDBCRjEKLSAgICAgICAgICAgIFsgMV1bIDFdWyAxXVsgM11bNTRdWzY5XVsgMV1bIDJdWyAxXQotICAgICAgICA2NHwgICAgICAgICAgICAgICAgICAgICAgW10KLSAgICAgICAgMzJ8ICAgICAgICAgICAgICAgICAgW10gIFtdCi0gICAgICAgIDE2fCAgICAgICAgICAgICAgICAgIFtdICBbXQotICAgICAgICAgOHwgICAgICAgICAgICAgICAgICBbXSAgW10KLSAgICAgICAgIDR8ICAgICAgICAgICAgICAgICAgW10gIFtdCi0gICAgICAgICAyfF9fX19fX19fX19fX19fW11fX1tdX19bXV9fX19fX1tdX19fXwotICAgICAgICAgICAgICA0ICAgNSAgIDYgICA4ICAgOSAgMTAgIDExICAxMyAgMTUKLU5vdGljZSB0aGF0IGFsbCB2YWx1ZXMgdGhhdCBmYWxsIGluIHRoZSBzYW1lIHJvdyBoYXZlIHRoZSBzYW1lIGhlaWdodCAoNjUgYW5kIDEyNyBhcmUgZGlzcGxheWVkCi1pZGVudGljYWxseSkuIFRoYXQncyB3aHkgZXhhY3QgY291bnRzIGFyZSBhZGRlZCBhdCB0aGUgdG9wLgotKi8KLXZvaWQgTkJMb2c6OlJlYWRlcjo6ZHJhd0hpc3RvZ3JhbShTdHJpbmc4ICpib2R5LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHN0ZDo6dmVjdG9yPGludDY0X3Q+ICZzYW1wbGVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgbG9nU2NhbGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGluZGVudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgbWF4SGVpZ2h0KSB7Ci0gICAgLy8gdGhpcyBhdm9pZHMgc29tZSBjb3JuZXIgY2FzZXMKLSAgICBpZiAoc2FtcGxlcy5zaXplKCkgPD0gMSkgewotICAgICAgICByZXR1cm47Ci0gICAgfQotICAgIC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ZGUoa1BvcnRJbmRleElucHV0LCBJT01YOjprUG9ydE1vZGVQcmVzZXRTZWN1cmVCdWZmZXIpOwotCi0gICAgICAgICAgICBpZiAoZXJyICE9IE9LKSB7Ci0gICAgICAgICAgICAgICAgQUxPR0koImZhbGxpbmcgYmFjayB0byBub24tbmF0aXZlX2hhbmRsZXMiKTsKLSAgICAgICAgICAgICAgICBzZXRQb3J0TW9kZShrUG9ydEluZGV4SW5wdXQsIElPTVg6OmtQb3J0TW9kZVByZXNldEJ5dGVCdWZmZXIpOwotICAgICAgICAgICAgICAgIGVyciA9IE9LOyAvLyBpZ25vcmUgZXJyb3IgZm9yIG5vdwotICAgICAgICAgICAgfQorICAgICAgICBpZiAoZXJyICE9IE9LKSB7CisgICAgICAgICAgICBBTE9HSSgiZmFsbGluZyBiYWNrIHRvIG5vbi1uYXRpdmVfaGFuZGxlcyIpOworICAgICAgICAgICAgc2V0UG9ydE1vZGUoa1BvcnRJbmRleElucHV0LCBJT01YOjprUG9ydE1vZGVQcmVzZXRCeXRlQnVmZmVyKTsKKyAgICAgICAgICAgIGVyciA9IE9LOyAvLyBpZ25vcmUgZXJyb3IgZm9yIG5vdwogICAgICAgICB9CiAgICAgfQogICAgIGlmIChoYXZlTmF0aXZlV2luZG93KSB7CkBAIC00MTc0LDExICs0MTcwLDEyIEBACiAvLyBzdGF0aWMKIGludCAvKiBPTVhfVklERU9fQVZDTEVWRUxUWVBFICovIEFDb2RlYzo6Z2V0QVZDTGV2ZWxGb3IoCiAgICAgICAgIGludCB3aWR0aCwgaW50IGhlaWdodCwgaW50IHJhdGUsIGludCBiaXRyYXRlLAotICAgICAgICBPTVhfVklERU9fQVZDUFJPRklMRVRZUEUgcHJvZmlsZSkgeworICAgICAgICBPTVhfVklERU9fQVZDUFJPRklMRUVYVFRZUEUgcHJvZmlsZSkgewogICAgIC8vIGNvbnZlcnQgYml0cmF0ZSB0byBtYWluL2Jhc2VsaW5lIHByb2ZpbGUga2JwcyBlcXVpdmFsZW50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FT19QaWN0dXJlVHlwZVAgfCBPTVhfVklERU9fUGljdHVyZVR5cGVCOworICAgICAgICAgICAgT01YX1ZJREVPX1BpY3R1cmVUeXBlSSB8IE9NWF9WSURFT19QaWN0dXJlVHlwZVA7CiAgICAgICAgIGgyNjR0eXBlLm5SZWZJZHgxMEFjdGl2ZU1pbnVzMSA9IDA7CiAgICAgICAgIGgyNjR0eXBlLm5SZWZJZHgxMUFjdGl2ZU1pbnVzMSA9IDA7CiAgICAgICAgIGgyNjR0eXBlLmJFbnRyb3B5Q29kaW5nQ0FCQUMgPSBPTVhfVFJVRTsKQEAgLTQ4NDMsOSArNDg0NSw5IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVjdC5uVG9wIDwgMCB8fAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlY3QubkxlZnQgKyByZWN0Lm5XaWR0aCA+IHZpZGVvRGVmLT5uRnJhbWVXaWR0aCB8fAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlY3QublRvcCArIHJlY3QubkhlaWdodCA+IHZpZGVvRGVmLT5uRnJhbWVIZWlnaHQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBBTE9HRSgiV3JvbmcgY3JvcHBlZCByZWN0ICglZCwgJWQpIC0gKCV1LCAldSkgdnMuIGZyYW1lICgldSwgJXUpIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBTE9HRSgiV3JvbmcgY3JvcHBlZCByZWN0ICglZCwgJWQsICV1LCAldSkgdnMuIGZyYW1lICgldSwgJXUpIiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlY3QubkxlZnQsIHJlY3QublRvcCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlY3QubkxlZnQgKyByZWN0Lm5XaWR0aCwgcmVjdC5uVG9wICsgcmVjdC5uSGVpZ2h0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVjdC5uV2lk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N0YW5jZSgpOwotICAgICAgICBpZiAobGlzdCAhPSBOVUxMICYmIGxpc3QtPmZpbmRDb2RlY0J5TmFtZShjb21wb25lbnROYW1lLmNfc3RyKCkpID49IDApIHsKLSAgICAgICAgICAgIG1hdGNoaW5nQ29kZWNzLmFkZChjb21wb25lbnROYW1lKTsKKyAgICAgICAgaWYgKGxpc3QgPT0gbnVsbHB0cikgeworICAgICAgICAgICAgQUxPR0UoIlVuYWJsZSB0byBvYnRhaW4gTWVkaWFDb2RlY0xpc3Qgd2hpbGUgIgorICAgICAgICAgICAgICAgICAgICAiYXR0ZW1wdGluZyB0byBjcmVhdGUgY29kZWMgXCIlc1wiIiwKKyAgICAgICAgICAgICAgICAgICAgY29tcG9uZW50TmFtZS5jX3N0cigpKTsKKyAgICAgICAgICAgIG1Db2RlYy0+c2lnbmFsRXJyb3IoT01YX0Vycm9yVW5kZWZpbmVkLCBOT19JTklUKTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgfQorICAgICAgICBzc2l6ZV90IGluZGV4ID0gbGlzdC0+ZmluZENvZGVjQnlOYW1lKGNvbXBvbmVudE5hbWUuY19zdHIoKSk7CisgICAgICAgIGlmIChpbmRleCA8IDApIHsKKyAgICAgICAgICAgIEFMT0dFKCJVbmFibGUgdG8gZmluZCBjb2RlYyBcIiVzXCIiLAorICAgICAgICAgICAgICAgICAgICBjb21wb25lbnROYW1lLmNfc3RyKCkpOworICAgICAgICAgICAgbUNvZGVjLT5zaWduYWxFcnJvcihPTVhfRXJyb3JJbnZhbGlkQ29tcG9uZW50LCBOQU1FX05PVF9GT1VORCk7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgc3A8TWVkaWFDb2RlY0luZm8+IGluZm8gPSBsaXN0LT5nZXRDb2RlY0luZm8oaW5kZXgpOworICAgICAgICBpZiAoaW5mbyA9PSBudWxscHRyKSB7CisgICAgICAgICAgICBBTE9HRSgiVW5leHBlY3RlZCBlcnJvciAoaW5kZXggb3V0LW9mLWJvdW5kKSB3aGlsZSAiCisgICAgICAgICAgICAgICAgICAgICJyZXRyaWV2aW5nIGluZm9ybWF0aW9uIGZvciBjb2RlYyBcIiVzXCIiLAorICAgICAgICAgICAgICAgICAgICBjb21wb25lbnROYW1lLmNfc3RyKCkpOworICAgICAgICAgICAgbUNvZGVjLT5zaWduYWxFcnJvcihPTVhfRXJyb3JVbmRlZmluZWQsIFVOS05PV05fRVJST1IpOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgICAgIG1hdGNoaW5nQ29kZWNzLmFkZChpbmZvLT5nZXRDb2RlY05hbWUoKSk7CisgICAgICAgIG93bmVycy5hZGQoaW5mby0+Z2V0T3duZXJOYW1lKCkgPT0gbnVsbHB0ciA/CisgICAgICAgICAgICAgICAgImRlZmF1bHQiIDogaW5mby0+Z2V0T3duZXJOYW1lKCkpOwogICAgIH0gZWxzZSB7CiAgICAgICAgIENIRUNLKG1zZy0+ZmluZFN0cmluZygibWltZSIsICZtaW1lKSk7CiAKQEAgLTYzNzQsMTAgKzYzODksMTIgQEAKICAgICAgICAgICAgICAgICBtaW1lLmNfc3RyKCksCiAgICAgICAgICAgICAgICAgZW5jb2RlciwgLy8gY3JlYXRlRW5jb2RlcgogICAgICAgICAgICAgICAgIDAsICAgICAgIC8vIGZsYWdzCi0gICAgICAgICAgICAgICAgJm1hdGNoaW5nQ29kZWNzKTsKKyAgICAgICAgICAgICAgICAmbWF0Y2hpbmdDb2RlY3MsCisgICAgICAgICAgICAgICAgJm93bmVycyk7CiAgICAgfQogCiAgICAgc3A8Q29kZWNPYnNlcnZlcj4gb2JzZXJ2ZXIgPSBuZXcgQ29kZWNPYnNlcnZlcjsKKyAgICBzcDxJT01YPiBvbXg7CiAgICAgc3A8SU9NWE5vZGU+IG9teE5vZGU7CiAKICAgICBzdGF0dXNfdCBlcnIgPSBOQU1FX05PVF9GT1VORDsKQEAgLTYzODUsNiArNjQwMiwxNCBAQAogICAgICAgICAgICAgKyttYXRjaEluZGV4KSB7CiAgICAgICAgIGNvbXBvbmVudE5hbWUgPSBtYXRjaGluZ0NvZGVjc1ttYXRjaEluZGV4XTsKIAorICAgICAgICBPTVhDbGllbnQgY2xpZW50OworICAgICAgICBib29sIHRyZWJsZUZsYWc7CisgICAgICAgIGlmIChjbGllbnQuY29ubmVjdChvd25lcnNbbWF0Y2hJbmRleF0uY19zdHIoKSwgJnRyZWJsZUZsYWcpICE9IE9LKSB7CisgICAgICAgICAgICBtQ29kZWMtPnNpZ25hbEVycm9yKE9NWF9FcnJvclVuZGVmaW5lZCwgTk9fSU5JVCk7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgb214ID0gY2xpZW50LmludGVyZmFjZSgpOworCiAgICAgICAgIHBpZF90IHRpZCA9IGdldHRpZCgpOwogICAgICAgICBpbnQgcHJldlByaW9yaXR5ID0gYW5kcm9pZEdldFRocmVhZFByaW9yaXR5KHRpZCk7CiAgICAgICAgIGFuZHJvaWRTZXRUaHJlYWRQcmlvcml0eSh0aWQsIEFORFJPSURfUFJJT1JJVFlfRk9SRUdST1VORCk7CkBAIC02MzkyLDYgKzY0MTcsNyBAQAogICAgICAgICBhbmRyb2lkU2V0VGhyZWFkUHJpb3JpdHkodGlkLCBwcmV2UHJpb3JpdHkpOwogCiAgICAgICAgIGlmIChlcnIgPT0gT0spIHsKKyAgICAgICAgICAgIG1Db2RlYy0+c2V0VHJlYmxlRmxhZyh0cmVibGVGbGFnKTsKICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgQUxPR1coIkFsbG9jYXRpbmcgY29tcG9uZW50ICclcycgZmFpbGVkLCB0cnkgbmV4dCBvbmUuIiwgY29tcG9uZW50TmFtZS5jX3N0cigpKTsKQEAgLTgyMTUsMTYgKzgyNDEsMTUgQEAKIH0KIAogc3RhdHVzX3QgQUNvZGVjOjpxdWVy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vIEVuY29kZXJzIG11c3QgZXhwbGljaXRseSBzdXBwb3J0IGNvbnN0cmFpbmVkIHByb2ZpbGVzLgorICAgICAgICAgICAgaWYgKCFpc0VuY29kZXIgJiYgc3RyY2FzZWNtcChtaW1lLCBNRURJQV9NSU1FVFlQRV9WSURFT19BVkMpID09IDApIHsKKyAgICAgICAgICAgICAgICBpZiAocGFyYW0uZVByb2ZpbGUgPT0gT01YX1ZJREVPX0FWQ1Byb2ZpbGVIaWdoKSB7CisgICAgICAgICAgICAgICAgICAgIGNhcHMtPmFkZFByb2ZpbGVMZXZlbChPTVhfVklERU9fQVZDUHJvZmlsZUNvbnN0cmFpbmVkSGlnaCwgcGFyYW0uZUxldmVsKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHBhcmFtLmVQcm9maWxlID09IE9NWF9WSURFT19BVkNQcm9maWxlQmFzZWxpbmUpIHsKKyAgICAgICAgICAgICAgICAgICAgY2Fwcy0+YWRkUHJvZmlsZUxldmVsKE9NWF9WSURFT19BVkNQcm9maWxlQ29uc3RyYWluZWRCYXNlbGluZSwgcGFyYW0uZUxldmVsKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIGlmIChpbmRleCA9PSBrTWF4SW5kaWNlc1RvQ2hlY2spIHsKICAgICAgICAgICAgICAgICBBTE9HVygiWyVzXSBzdG9wcGluZyBjaGVja2luZyBwcm9maWxlcyBhZnRlciAldTogJXgvJXgiLAotICAgICAgICAgICAgICAgICAgICAgICAgbmFtZS5jX3N0cigpLCBpbmRleCwKKyAgICAgICAgICAgICAgICAgICAgICAgIG5hbWUsIGluZGV4LAogICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW0uZVByb2ZpbGUsIHBhcmFtLmVMZXZlbCk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KQEAgLTgyNzcsNyArODMxMiw2IEBACiAgICAgICAgIE9NWF9WSURFT19QQVJBTV9QT1JURk9STUFUVFlQRSBwb3J0Rm9ybWF0OwogICAgICAgICBJbml0T01YUGFyYW1zKCZwb3J0Rm9ybWF0KTsKICAgICAgICAgcG9ydEZvcm1hdC5uUG9ydEluZGV4ID0gaXNFbmNvZGVyID8ga1BvcnRJbmRleElucHV0IDoga1BvcnRJbmRleE91dHB1dDsKLSAgICAgICAgVmVjdG9yPHVpbnQzMl90PiBzdXBwb3J0ZWRDb2xvcnM7IC8vIHNoYWRvdyBjb3B5IHRvIGNoZWNrIGZvciBkdXBsaWNhdGVzCiAgICAgICAgIGZvciAoT01YX1UzMiBpbmRleCA9IDA7IGluZGV4IDw9IGtNYXhJbmRpY2VzVG9DaGVjazsgKytpbmRleCkgewogICAgICAgICAgICAgcG9ydEZvcm1hdC5uSW5kZXggPSBpbmRleDsKICAgICAgICAgICAgIHN0YXR1c190IGVyciA9IG9teE5vZGUtPmdldFBhcmFtZXRlcigKQEAgLTgyOTEsMjggKzgzMjUsMTcgQEAKICAgICAgICAgICAgIGlmIChJc0ZsZXhpYmxlQ29sb3JGb3JtYXQoCiAgICAgICAgICAgICAgICAgICAgIG9teE5vZGUsIHBvcnRGb3JtYXQuZUNvbG9yRm9ybWF0LCBmYWxzZSAvKiB1c2luZ05hdGl2ZVdpbmRvdyAqLywKICAgICAgICAgICAgICAgICAgICAgJmZsZXhpYmxlRXF1aXZhbGVudCkpIHsKLSAgICAgICAgICAgICAgICBib29sIG1hcmtlZCA9IGZhbHNlOwotICAgICAgICAgICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgc3VwcG9ydGVkQ29sb3JzLnNpemUoKTsgKytpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChzdXBwb3J0ZWRDb2xvcnNbaV0gPT0gZmxleGlibGVFcXVpdmFsZW50KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtYXJrZWQgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKCFtYXJrZWQpIHsKLSAgICAgICAgICAgICAgICAgICAgc3VwcG9ydGVkQ29sb3JzLnB1c2goZmxleGlibGVFcXVpdmFsZW50KTsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci0+YWRkQ29sb3JGb3JtYXQoZmxleGlibGVFcXVpdmFsZW50KTsKLSAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY2Fwcy0+YWRkQ29sb3JGb3JtYXQoZmxleGlibGVFcXVpdmFsZW50KTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHN1cHBvcnRlZENvbG9ycy5wdXNoKHBvcnRGb3JtYXQuZUNvbG9yRm9ybWF0KTsKLSAgICAgICAgICAgIGJ1aWxkZXItPmFkZENvbG9yRm9ybWF0KHBvcnRGb3JtYXQuZUNvbG9yRm9ybWF0KTsKKyAgICAgICAgICAgIGNhcHMtPmFkZENvbG9yRm9ybWF0KHBvcnRGb3JtYXQuZUNvbG9yRm9ybWF0KTsKIAogICAgICAgICAgICAgaWYgKGluZGV4ID09IGtNYXhJbmRpY2VzVG9DaGVjaykgewogICAgICAgICAgICAgICAgIEFMT0dXKCJbJXNdIHN0b3BwaW5nIGNoZWNraW5nIGZvcm1hdHMgYWZ0ZXIgJXU6ICVzKCV4KSIsCi0gICAgICAgICAgICAgICAgICAgICAgICBuYW1lLmNfc3RyKCksIGluZGV4LAorICAgICAgICAgICAgICAgICAgICAgICAgbmFtZSwgaW5kZXgsCiAgICAgICAgICAgICAgICAgICAgICAgICBhc1N0cmluZyhwb3J0Rm9ybWF0LmVDb2xvckZvcm1hdCksIHBvcnRGb3JtYXQuZUNvbG9yRm9ybWF0KTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQotICAgIH0gZWxzZSBpZiAobWltZS5lcXVhbHNJZ25vcmVDYXNlKE1FRElBX01JTUVUWVBFX0FVRElPX0FBQykpIHsKKyAgICB9IGVsc2UgaWYgKHN0cmNhc2VjbXAobWltZSwgTUVESUFfTUlNRVRZUEVfQVVESU9fQUFDKSA9PSAwKSB7CiAgICAgICAgIC8vIE1vcmUgYXVkaW8gY29kZWNzIGlmIHRoZXkgaGF2ZSBwcm9maWxlcy4KICAgICAgICAgT01YX0FVRElPX1BBUkFNX0FORFJPSURfUFJPRklMRVRZUEUgcGFyYW07CiAgICAgICAgIEluaXRPTVhQYXJhbXMoJnBhcmFtKTsKQEAgLTgzMjYsMTEgKzgzNDksMTEgQEAKICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIC8vIEZvciBhdWRpbywgbGV2ZWwgaXMgaWdub3JlZC4KLSAgICAgICAgICAgIGJ1aWxkZXItPmFkZFByb2ZpbGVMZXZlbChwYXJhbS5lUHJvZmlsZSwgMCAvKiBsZXZlbCAqLyk7CisgICAgICAgICAgICBjYXBzLT5hZGRQcm9maWxlTGV2ZWwocGFyYW0uZVByb2ZpbGUsIDAgLyogbGV2ZWwgKi8pOwogCiAgICAgICAgICAgICBpZiAoaW5kZXggPT0ga01heEluZGljZXNUb0NoZWNrKSB7CiAgICAgICAgICAgICAgICAgQUxPR1coIlslc10gc3RvcHBpbmcgY2hlY2tpbmcgcHJvZmlsZXMgYWZ0ZXIgJXU6ICV4IiwKLSAgICAgICAgICAgICAgICAgICAgICAgIG5hbWUuY19zdHIoKSwgaW5kZXgsCisgICAgICAgICAgICAgICAgICAgICAgICBuYW1lLCBpbmRleCwKICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtLmVQcm9maWxlKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQpAQCAtODMzOCw3ICs4MzYxLDcgQEAKICAgICAgICAgLy8gTk9URTogV2l0aG91dCBBbmRyb2lkIGV4dGVuc2lvbnMsIE9NWCBkb2VzIG5vdCBwcm92aWRlIGEgd2F5IHRvIHF1ZXJ5CiAgICAgICAgIC8vIEFBQyBwcm9maWxlIHN1cHBvcnQKICAgICAgICAgaWYgKH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6ZSA9IHNpemUKKyAgICAgICAgfTsKKworICAgICAgICBEZXN0aW5hdGlvbkJ1ZmZlciBkc3RCdWZmZXI7CisgICAgICAgIGlmIChzZWN1cmUpIHsKKyAgICAgICAgICAgIGRzdEJ1ZmZlci50eXBlID0gQnVmZmVyVHlwZTo6TkFUSVZFX0hBTkRMRTsKKyAgICAgICAgICAgIGRzdEJ1ZmZlci5zZWN1cmVNZW1vcnkgPSBoaWRsX2hhbmRsZShzZWN1cmVIYW5kbGUpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZHN0QnVmZmVyLnR5cGUgPSBCdWZmZXJUeXBlOjpTSEFSRURfTUVNT1JZOworICAgICAgICAgICAgZHN0QnVmZmVyLm5vbnNlY3VyZU1lbW9yeSA9IHNyY0J1ZmZlcjsKKyAgICAgICAgfQorCisgICAgICAgIFN0YXR1cyBzdGF0dXMgPSBTdGF0dXM6Ok9LOworICAgICAgICBoaWRsX3N0cmluZyBkZXRhaWxlZEVycm9yOworCisgICAgICAgIGF1dG8gcmV0dXJuVm9pZCA9IG1EZXNjcmFtYmxlci0+ZGVzY3JhbWJsZSgKKyAgICAgICAgICAgICAgICBrZXkgIT0gTlVMTCA/IChTY3JhbWJsaW5nQ29udHJvbClrZXlbMF0gOiBTY3JhbWJsaW5nQ29udHJvbDo6VU5TQ1JBTUJMRUQsCisgICAgICAgICAgICAgICAgaGlkbFN1YlNhbXBsZXMsCisgICAgICAgICAgICAgICAgc3JjQnVmZmVyLAorICAgICAgICAgICAgICAgIDAsCisgICAgICAgICAgICAgICAgZHN0QnVmZmVyLAorICAgICAgICAgICAgICAgIDAsCisgICAgICAgICAgICAgICAgWyZzdGF0dXMsICZyZXN1bHQsICZkZXRhaWxlZEVycm9yXSAoCisgICAgICAgICAgICAgICAgICAgICAgICBTdGF0dXMgX3N0YXR1cywgdWludDMyX3QgX2J5dGVzV3JpdHRlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGhpZGxfc3RyaW5nJiBfZGV0YWlsZWRFcnJvcikgeworICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBfc3RhdHVzOworICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSAoc3NpemVfdClfYnl0ZXNXcml0dGVuOworICAgICAgICAgICAgICAgICAgICBkZXRhaWxlZEVycm9yID0gX2RldGFpbGVkRXJyb3I7CisgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgaWYgKCFyZXR1cm5Wb2lkLmlzT2soKSB8fCBzdGF0dXMgIT0gU3RhdHVzOjpPSyB8fCByZXN1bHQgPCAwKSB7CisgICAgICAgICAgICBBTE9HRSgiZGVzY3JhbWJsZSBmYWlsZWQsIHRyYW5zPSVzLCBzdGF0dXM9JWQsIHJlc3VsdD0lemQiLAorICAgICAgICAgICAgICAgICAgICByZXR1cm5Wb2lkLmRlc2NyaXB0aW9uKCkuY19zdHIoKSwgc3RhdHVzLCByZXN1bHQpOworICAgICAgICAgICAgcmV0dXJuIFVOS05PV05fRVJST1I7CisgICAgICAgIH0KKworICAgICAgICBBTE9HVigiZGVzY3JhbWJsZSBzdWNjZWVkZWQsICV6ZCBieXRlcyIsIHJlc3VsdCk7CisKKyAgICAgICAgaWYgKGRzdEJ1ZmZlci50eXBlID09IEJ1ZmZlclR5cGU6OlNIQVJFRF9NRU1PUlkpIHsKKyAgICAgICAgICAgIG1lbWNweShpdC0+bUNvZGVjQnVmZmVyLT5iYXNlKCksCiAgICAgICAgICAgICAgICAgICAgICh1aW50OF90KilpdC0+bVNoYXJlZEVuY3J5cHRlZEJ1ZmZlci0+cG9pbnRlcigpLCByZXN1bHQpOwogICAgICAgICB9CiAgICAgfQogCi0gICAgaWYgKHJlc3VsdCA8IDApIHsKLSAgICAgICAgcmV0dXJuIHJlc3VsdDsKLSAgICB9Ci0KLSAgICBpZiAoZGVzdGluYXRpb24ubVR5cGUgPT0gSUNyeXB0bzo6a0Rlc3RpbmF0aW9uVHlwZVNoYXJlZE1lbW9yeSkgewotICAgICAg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EAgLTI5LDYgKzMwLDcgQEAKICAgICAgICAgIkZyYW1lUmVuZGVyVHJhY2tlci5jcHAiLAogICAgICAgICAiSFRUUEJhc2UuY3BwIiwKICAgICAgICAgIkhldmNVdGlscy5jcHAiLAorICAgICAgICAiSXRlbVRhYmxlLmNwcCIsCiAgICAgICAgICJKUEVHU291cmNlLmNwcCIsCiAgICAgICAgICJNUDNFeHRyYWN0b3IuY3BwIiwKICAgICAgICAgIk1QRUcyVFNXcml0ZXIuY3BwIiwKQEAgLTQ5LDYgKzUxLDcgQEAKICAgICAgICAgIk51Q2FjaGVkU291cmNlMi5jcHAiLAogICAgICAgICAiTnVNZWRpYUV4dHJhY3Rvci5jcHAiLAogICAgICAgICAiT01YQ2xpZW50LmNwcCIsCisgICAgICAgICJPbXhJbmZvQnVpbGRlci5jcHAiLAogICAgICAgICAiT2dnRXh0cmFjdG9yLmNwcCIsCiAgICAgICAgICJTYW1wbGVJdGVyYXRvci5jcHAiLAogICAgICAgICAiU2FtcGxlVGFibGUuY3BwIiwKQEAgLTY3LDExICs3MCw2IEBACiAgICAgICAgICJhdmNfdXRpbHMuY3BwIiwKICAgICBdLAogCi0gICAgaW5jbHVkZV9kaXJzOiBbCi0gICAgICAgICJmcmFtZXdvcmtzL25hdGl2ZS9pbmNsdWRlL21lZGlhL29wZW5tYXgiLAotICAgICAgICAiZnJhbWV3b3Jrcy9uYXRpdmUvaW5jbHVkZS9tZWRpYS9oYXJkd2FyZSIsCi0gICAgXSwKLQogICAgIHNoYXJlZF9saWJzOiBbCiAgICAgICAgICJsaWJhdWRpb3V0aWxzIiwKICAgICAgICAgImxpYmJpbmRlciIsCkBAIC05NiwxNiArOTQsMjAgQEAKICAgICAgICAgImxpYm5hdGl2ZXdpbmRvdyIsCiAKICAgICAgICAgImxpYm1lZGlhX2hlbHBlciIsCisgICAgICAgICJsaWJzdGFnZWZyaWdodF9vbXhfdXRpbHMiLAogICAgICAgICAibGlic3RhZ2VmcmlnaHRfZmxhY2RlYyIsCiAgICAgICAgICJsaWJzdGFnZWZyaWdodF9mb3VuZGF0aW9uIiwKKyAgICAgICAgImxpYnN0YWdlZnJpZ2h0X3htbHBhcnNlciIsCiAgICAgICAgICJsaWJkbCIsCiAgICAgICAgICJsaWJSU2NwcCIsCiAgICAgICAgICJsaWJoaWRsYmFzZSIsCiAgICAgICAgICJsaWJoaWRsbWVtb3J5IiwKICAgICAgICAgImFuZHJvaWQuaGlkbC5hbGxvY2F0b3JAMS4wIiwKICAgICAgICAgImFuZHJvaWQuaGlkbC5tZW1vcnlAMS4wIiwKKyAgICAgICAgImFuZHJvaWQuaGlkbC50b2tlbkAxLjAtdXRpbHMiLAorICAgICAgICAiYW5kcm9pZC5oYXJkd2FyZS5jYXNAMS4wIiwKKyAgICAgICAgImFuZHJvaWQuaGFyZHdhcmUuY2FzLm5hdGl2ZUAxLjAiLAogICAgICAgICAiYW5kcm9pZC5oYXJkd2FyZS5tZWRpYS5vbXhAMS4wIiwKLSAgICAgICAgImxpYnN0YWdlZnJpZ2h0X3htbHBhcnNlckAxLjAiLAogICAgIF0sCiAKICAgICBzdGF0aWNfbGliczogWwpAQCAtMTE0LDcgKzExNiw2IEBACiAgICAgICAgICJsaWJzdGFnZWZyaWdodF9hYWNlbmMiLAogICAgICAgICAibGlic3RhZ2VmcmlnaHRfbWF0cm9za2EiLAogICAgICAgICAibGlic3RhZ2VmcmlnaHRfbWVkaWFmaWx0ZXIiLAotICAgICAgICAibGlic3RhZ2VmcmlnaHRfb214X3V0aWxzIiwKICAgICAgICAgImxpYnN0YWdlZnJpZ2h0X3dlYm0iLAogICAgICAgICAibGlic3RhZ2VmcmlnaHRfdGltZWR0ZXh0IiwKICAgICAgICAgImxpYnZweCIsCkBAIC0xMjQsOSArMTI1LDEyIEBACiAgICAgICAgICJsaWJGTEFDIiwKICAgICBdLAogCi0gICAgZXhwb3J0X3NoYXJlZF9saWJfaGVhZGVyczogWyJsaWJtZWRpYSJdLAorICAgIGV4cG9ydF9zaGFyZ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xpYnN0YWdlZnJpZ2h0L0RhdGFTb3VyY2UuY3BwCmluZGV4IGE1NzYwZDEuLmMyMjA1M2UgMTAwNjQ0Ci0tLSBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L0RhdGFTb3VyY2UuY3BwCisrKyBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L0RhdGFTb3VyY2UuY3BwCkBAIC05Miw2ICs5Miw0OCBAQAogICAgIHJldHVybiB0cnVlOwogfQogCitib29sIERhdGFTb3VyY2U6OmdldFVJbnQxNlZhcihvZmY2NF90IG9mZnNldCwgdWludDE2X3QgKngsIHNpemVfdCBzaXplKSB7CisgICAgaWYgKHNpemUgPT0gMikgeworICAgICAgICByZXR1cm4gZ2V0VUludDE2KG9mZnNldCwgeCk7CisgICAgfQorICAgIGlmIChzaXplID09IDEpIHsKKyAgICAgICAgdWludDhfdCB0bXA7CisgICAgICAgIGlmIChyZWFkQXQob2Zmc2V0LCAmdG1wLCAxKSA9PSAxKSB7CisgICAgICAgICAgICAqeCA9IHRtcDsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgfQorICAgIHJldHVybiBmYWxzZTsKK30KKworYm9vbCBEYXRhU291cmNlOjpnZXRVSW50MzJWYXIob2ZmNjRfdCBvZmZzZXQsIHVpbnQzMl90ICp4LCBzaXplX3Qgc2l6ZSkgeworICAgIGlmIChzaXplID09IDQpIHsKKyAgICAgICAgcmV0dXJuIGdldFVJbnQzMihvZmZzZXQsIHgpOworICAgIH0KKyAgICBpZiAoc2l6ZSA9PSAyKSB7CisgICAgICAgIHVpbnQxNl90IHRtcDsKKyAgICAgICAgaWYgKGdldFVJbnQxNihvZmZzZXQsICZ0bXApKSB7CisgICAgICAgICAgICAqeCA9IHRtcDsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgfQorICAgIHJldHVybiBmYWxzZTsKK30KKworYm9vbCBEYXRhU291cmNlOjpnZXRVSW50NjRWYXIob2ZmNj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3BhY2UgaGVpZiB7CisKKy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLworLy8KKy8vICBzdHJ1Y3QgdG8ga2VlcCB0cmFjayBvZiBvbmUgaW1hZ2UgaXRlbQorLy8KKworc3RydWN0IEltYWdlSXRlbSB7CisgICAgZnJpZW5kIHN0cnVjdCBJdGVtUmVmZXJlbmNlOworICAgIGZyaWVuZCBzdHJ1Y3QgSXRlbVByb3BlcnR5OworCisgICAgSW1hZ2VJdGVtKCkgOiBJbWFnZUl0ZW0oMCkge30KKyAgICBJbWFnZUl0ZW0odWludDMyX3QgX3R5cGUpIDogdHlwZShfdHlwZSksCisgICAgICAgICAgICByb3dzKDApLCBjb2x1bW5zKDApLCB3aWR0aCgwKSwgaGVpZ2h0KDApLCByb3RhdGlvbigwKSwKKyAgICAgICAgICAgIG9mZnNldCgwKSwgc2l6ZSgwKSwgbmV4dFRpbGVJbmRleCgwKSB7fQorCisgICAgYm9vbCBpc0dyaWQoKSBjb25zdCB7CisgICAgICAgIHJldHVybiB0eXBlID09IEZPVVJDQygnZycsICdyJywgJ2knLCAnZCcpOworICAgIH0KKworICAgIHN0YXR1c190IGdldE5leHRUaWxlSXRlbUlkKHVpbnQzMl90ICpuZXh0VGlsZUl0ZW1JZCwgYm9vbCByZXNldCkgeworICAgICAgICBpZiAocmVzZXQpIHsKKyAgICAgICAgICAgIG5leHRUaWxlSW5kZXggPSAwOworICAgICAgICB9CisgICAgICAgIGlmIChuZXh0VGlsZUluZGV4ID49IGRpbWdSZWZzLnNpemUoKSkgeworICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0VORF9PRl9TVFJFQU07CisgICAgICAgIH0KKyAgICAgICAgKm5leHRUaWxlSXRlbUlkID0gZGltZ1JlZnNbbmV4dFRpbGVJbmRleCsrXTsKKyAgICAgICAgcmV0dXJuIE9LOworICAgIH0KKworICAgIHVpbnQzMl90IHR5cGU7CisgICAgaW50MzJfdCByb3dzOworICAgIGludDMyX3QgY29sdW1uczsKKyAgICBpbnQzMl90IHdpZHRoOworICAgIGludDMyX3QgaGVpZ2h0OworICAgIGludDMyX3Qgcm90YXRpb247CisgICAgb2ZmNjRfdCBvZmZzZXQ7CisgICAgc2l6ZV90IHNpemU7CisgICAgc3A8QUJ1ZmZlcj4gaHZjYzsKKyAgICBzcDxBQnVmZmVyPiBpY2M7CisKKyAgICBWZWN0b3I8dWludDMyX3Q+IHRodW1ibmFpbHM7CisgICAgVmVjdG9yPHVpbnQzMl90PiBkaW1nUmVmczsKKyAgICBzaXplX3QgbmV4dFRpbGVJbmRleDsKK307CisKKworLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCisvLworLy8gIElTTyBib3hlcworLy8KKworc3RydWN0IEJveCB7Citwcm90ZWN0ZWQ6CisgICAgQm94KGNvbnN0IHNwPERhdGFTb3VyY2U+IHNvdXJjZSwgdWludDMyX3QgdHlwZSkgOgorICAgICAgICBtRGF0YVNvdXJjZShzb3VyY2UpLCBtVHlwZSh0eXBlKSB7fQorCisgICAgdmlydHVhbCB+Qm94KCkge30KKworICAgIHZpcnR1YWwgc3RhdHVzX3Qgb25DaHVua0RhdGEoCisgICAgICAgICAgICB1aW50MzJfdCAvKnR5cGUqLywgb2ZmNjRfdCAvKm9mZnNldCovLCBzaXplX3QgLypzaXplKi8pIHsKKyAgICAgICAgcmV0dXJuIE9LOworICAgIH0KKworICAgIGlubGluZSB1aW50MzJfdCB0eXBlKCkgY29uc3QgeyByZXR1cm4gbVR5cGU7IH0KKworICAgIGlubGluZSBzcDxEYXRhU291cmNlPiBzb3VyY2UoKSBjb25zdCB7IHJldHVybiBtRGF0YVNvdXJjZTsgfQorCisgICAgc3RhdHVzX3QgcGFyc2VDaHVuayhvZmY2NF90ICpvZmZzZXQpOworCisg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STUVEOworICAgICAgICB9CisgICAgfSBlbHNlIGlmIChjaHVua19zaXplID09IDApIHsKKyAgICAgICAgLy8gVGhpcyBzaG91bGRuJ3QgaGFwcGVuIHNpbmNlIHdlIHNob3VsZCBuZXZlciBiZSB0b3AgbGV2ZWwKKyAgICAgICAgQUxPR0UoImludmFsaWQgY2h1bmsgc2l6ZSAwIGZvciBub24tdG9wIGxldmVsIGJveCIpOworICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOworICAgIH0gZWxzZSBpZiAoY2h1bmtfc2l6ZSA8IDgpIHsKKyAgICAgICAgLy8gVGhlIHNtYWxsZXN0IHZhbGlkIGNodW5rIGlzIDggYnl0ZXMgbG9uZy4KKyAgICAgICAgQUxPR0UoImludmFsaWQgY2h1bmsgc2l6ZTogJWxsZCIsIChsb25nIGxvbmcpY2h1bmtfc2l6ZSk7CisgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7CisgICAgfQorCisgICAgY2hhciBjaHVua1s1XTsKKyAgICBNYWtlRm91ckNDU3RyaW5nKGNodW5rX3R5cGUsIGNodW5rKTsKKyAgICBBTE9HVigiY2h1bms6ICVzIEAgJWxsZCIsIGNodW5rLCAobG9uZyBsb25nKSpvZmZzZXQpOworCisgICAgb2ZmNjRfdCBjaHVua19kYXRhX3NpemUgPSBjaHVua19zaXplIC0gKGRhdGFfb2Zmc2V0IC0gKm9mZnNldCk7CisgICAgaWYgKGNodW5rX2RhdGFfc2l6ZSA8IDApIHsKKyAgICAgICAgQUxPR0UoImIvMjM1NDA5MTQiKTsKKyAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKKyAgICB9CisKKyAgICBzdGF0dXNfdCBlcnIgPSBvbkNodW5rRGF0YShjaHVua190eXBlLCBkYXRhX29mZnNldCwgY2h1bmtfZGF0YV9zaXplKTsKKworICAgIGlmIChlcnIgIT0gT0spIHsKKyAgICAgICAgcmV0dXJuIGVycjsKKyAgICB9CisgICAgKm9mZnNldCAr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ICAgaWYgKGVyciAhPSBPSykgeworICAgICAgICByZXR1cm4gZXJyOworICAgIH0KKworICAgIHNpemVfdCBpdGVtSWRTaXplID0gKHZlcnNpb24oKSA9PSAwKSA/IDIgOiA0OworICAgIGlmIChzaXplIDwgaXRlbUlkU2l6ZSkgeworICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOworICAgIH0KKyAgICB1aW50MzJfdCBpdGVtSWQ7CisgICAgaWYgKCFzb3VyY2UoKS0+Z2V0VUludDMyVmFyKG9mZnNldCwgJml0ZW1JZCwgaXRlbUlkU2l6ZSkpIHsKKyAgICAgICAgcmV0dXJuIEVSUk9SX0lPOworICAgIH0KKworICAgIEFMT0dWKCJwcmltYXJ5IGlkICVkIiwgaXRlbUlkKTsKKyAgICAqcHJpbWFyeUl0ZW1JZCA9IGl0ZW1JZDsKKworICAgIHJldHVybiBPSzsKK30KKworLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCisvLworLy8gIEl0ZW1Mb2NhdGlvbiByZWxhdGVkIGJveGVzCisvLworCitzdHJ1Y3QgRXh0ZW50RW50cnkgeworICAgIHVpbnQ2NF90IGV4dGVudEluZGV4OworICAgIHVpbnQ2NF90IGV4dGVudE9mZnNldDsKKyAgICB1aW50NjRfdCBleHRlbnRMZW5ndGg7Cit9OworCitzdHJ1Y3QgSXRlbUxvYyB7CisgICAgSXRlbUxvYygpIDogSXRlbUxvYygwLCAwLCAwLCAwKSB7fQorICAgIEl0ZW1Mb2ModWludDMyX3QgaXRlbV9pZCwgdWludDE2X3QgY29uc3RydWN0aW9uX21ldGhvZCwKKyAgICAgICAgICAgIHVpbnQxNl90IGRhdGFfcmVmZXJlbmNlX2luZGV4LCB1aW50NjRfdCBiYXNlX29mZnNldCkgOgorICAgICAgICBpdGVtSWQoaXRlbV9pZCksCisgICAgICAgIGNvbnN0cnVjdGlvbk1ldGhvZChjb25zdHJ1Y3Rpb25fbWV0aG9kKSwKKyAgICAgICAgZGF0YVJlZmVyZW5jZUluZGV4KGRhdGFfcmVmZXJlbmNlX2luZGV4KSwKKyAgICAgICAgYmFzZU9mZnNldChiYXNlX29mZnNldCkge30KKworICAgIHZvaWQgYWRkRXh0ZW50KGNvbnN0IEV4dGVudEVudHJ5JiBleHRlbnQpIHsKKyAgICAgICAgZXh0ZW50cy5wdXNoX2JhY2soZXh0ZW50KTsKKyAgICB9CisKKyAgICBzdGF0dXNfdCBnZXRMb2Mob2ZmNjRfdCAqb2Zmc2V0LCBzaXplX3QgKnNpemUsCisgICAgICAgICAgICBvZmY2NF90IGlkYXRPZmZzZXQsIHNpemVfdCBpZGF0U2l6ZSkgY29uc3QgeworICAgICAgICAvLyBUT0RPOiBmaXggZXh0ZW50IGhhbmRsaW5nLCBmaXggY29uc3RydWN0aW9uTWV0aG9kID0gMgorICAgICAgICBDSEVDSyhleHRlbnRzLnNpemUoKSA9PSAxKTsKKyAgICAgICAgaWYgKGNvbnN0cnVjdGlvbk1ldGhvZCA9PSAwKSB7CisgICAgICAgICAgICAqb2Zmc2V0ID0gYmFzZU9mZnNldCArIGV4dGVudHNbMF0uZXh0ZW50T2Zmc2V0OworICAgICAgICAgICAgKnNpemUgPSBleHRlbnRzWzBdLmV4dGVudExlbmd0aDsKKyAgICAgICAgICAgIHJldHVybiBPSzsKKyAgICAgICAgfSBlbHNlIGlmIChjb25zdHJ1Y3Rpb25NZXRob2QgPT0gMSkgeworICAgICAgICAgICAgaWYgKGJhc2VPZmZzZXQgKyBleHRlbnRzWzBdLmV4dGVudE9mZnNldCArIGV4dGVudHNbMF0uZXh0ZW50TGVuZ3RoCisgICAgICAgICAgICAgICAgICAgID4gaWRhdFNpemUpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOworICAgICAgICAgICAgfQorICAgICAgICAgICAgKm9mZnNldCA9IGJhc2VPZmZzZXQgKyBleHRlbnR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IH0KKyAgICBLZXllZFZlY3Rvcjx1aW50MzJfdCwgSXRlbUxvYz4gKm1JdGVtTG9jczsKKyAgICBib29sIG1IYXNDb25zdHJ1Y3RNZXRob2QxOworfTsKKworc3RhdHVzX3QgSWxvY0JveDo6cGFyc2Uob2ZmNjRfdCBvZmZzZXQsIHNpemVfdCBzaXplKSB7CisgICAgc3RhdHVzX3QgZXJyID0gcGFyc2VGdWxsQm94SGVhZGVyKCZvZmZzZXQsICZzaXplKTsKKyAgICBpZiAoZXJyICE9IE9LKSB7CisgICAgICAgIHJldHVybiBlcnI7CisgICAgfQorICAgIGlmICh2ZXJzaW9uKCkgPiAyKSB7CisgICAgICAgIEFMT0dFKCIlczogaW52YWxpZCB2ZXJzaW9uICVkIiwgX19GVU5DVElPTl9fLCB2ZXJzaW9uKCkpOworICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOworICAgIH0KKworICAgIGlmIChzaXplIDwgMikgeworICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOworICAgIH0KKyAgICB1aW50OF90IG9mZnNldF9zaXplOworICAgIGlmICghc291cmNlKCktPnJlYWRBdChvZmZzZXQrKywgJm9mZnNldF9zaXplLCAxKSkgeworICAgICAgICByZXR1cm4gRVJST1JfSU87CisgICAgfQorICAgIHVpbnQ4X3QgbGVuZ3RoX3NpemUgPSAob2Zmc2V0X3NpemUgJiAweEYpOworICAgIG9mZnNldF9zaXplID4+PSA0OworCisgICAgdWludDhfdCBiYXNlX29mZnNldF9zaXplOworICAgIGlmICghc291cmNlKCktPnJlYWRBdChvZmZzZXQrKywgJmJhc2Vfb2Zmc2V0X3NpemUsIDEpKSB7CisgICAgICAgIHJldHVybiBFUlJPUl9JTzsKKyAgICB9CisgICAgdWludDhfdCBpbmRleF9zaXplID0gMDsKKyAgICBpZiAodmVyc2lvbigpID09IDEgfHwgdmVyc2lvbigpID09IDIpIHsKKyAgICAgICAgaW5kZXhfc2l6ZSA9IChiYXNlX29mZnNldF9zaXplICYgMHhGKTsKKyAgICB9CisgICAgYmFzZV9vZmZzZXRfc2l6ZSA+Pj0gNDsKKyAgICBzaXplIC09IDI7CisKKyAgICBpZiAoIWlzU2l6ZUZpZWxkVmFsaWQob2Zmc2V0X3NpemUpCisgICAgICAgICAgICB8fCAhaXNTaXplRmllbGRWYWxpZChsZW5ndGhfc2l6ZSkKKyAgICAgICAgICAgIHx8ICFpc1NpemVGaWVsZFZhbGlkKGJhc2Vfb2Zmc2V0X3NpemUpCisgICAgICAgICAgICB8fCAhaXNTaXplRmllbGRWYWxpZCgoaW5kZXhfc2l6ZSkpKSB7CisgICAgICAgIEFMT0dFKCIlczogb2Zmc2V0IHNpemUgbm90IHZhbGlkOiAlZCwgJWQsICVkLCAlZCIsIF9fRlVOQ1RJT05fXywKKyAgICAgICAgICAgICAgICBvZmZzZXRfc2l6ZSwgbGVuZ3RoX3NpemUsIGJhc2Vfb2Zmc2V0X3NpemUsIGluZGV4X3NpemUpOworICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOworICAgIH0KKworICAgIHVpbnQzMl90IGl0ZW1fY291bnQ7CisgICAgc2l6ZV90IGl0ZW1GaWVsZFNpemUgPSB2ZXJzaW9uKCkgPCAyID8gMiA6IDQ7CisgICAgaWYgKHNpemUgPCBpdGVtRmllbGRTaXplKSB7CisgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7CisgICAgfQorICAgIGlmICghc291cmNlKCktPmdldFVJbnQzMlZhcihvZmZzZXQsICZpdGVtX2NvdW50LCBpdGVtRmllbGRTaXplKSkgeworICAgICAgICByZXR1cm4gRVJST1JfSU87CisgICAgfQorCisgICAgQUxPR1YoIml0ZW1fY291bnQgJWxsZCIsIChsb25nIGxvbmcpIGl0ZW1fY291bnQpOworICAgIG9mZnNldCArPSBpdGVtRmllbGRTaXplOworICAgIHNpemUgLT0gaXRlbUZpZWxkU2l6ZTsKKworICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgaXRlbV9jb3VudDsgaSsrKSB7CisgICAgICAgIHVpbnQzMl90IGl0ZW1faWQ7CisgICAgICAgIGlmICghc291cmNlKCktPmdldFVJbnQzMlZhcihvZmZzZXQsICZpdGVtX2lkLCBpdGVtRmllbGRTaXplKSkgeworICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOworICAgICAgICB9CisgICAgICAgIEFMT0dWKCJpdGVtWyV6dV06IGlkICVsbGQiLCBpLCAobG9uZyBsb25nKWl0ZW1faWQpOworICAgICAgICBvZmZzZXQgKz0gaXRlbUZpZWxkU2l6ZTsKKworICAgICAgICB1aW50OF90IGNvbnN0cnVjdGlvbl9tZXRob2QgPSAwOworICAgICAgICBpZiAodmVyc2lvbigpID09IDEgfHwgdmVyc2lvbigpID09IDIpIHsKKyAgICAgICAgICAgIHVpbnQ4X3QgYnVmWzJdOworICAgICAgICAgICAgaWYgKCFzb3VyY2UoKS0+cmVhZEF0KG9mZnNldCwgYnVmLCAyKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGNvbnN0cnVjdGlvbl9tZXRob2QgPSAoYnVmWzFdICYgMHhGKTsKKyAgICAgICAgICAgIEFMT0dWKCJjb25zdHJ1Y3Rpb25fbWV0aG9kICVkIiwgY29uc3RydWN0aW9uX21ldGhvZCk7CisgICAgICAgICAgICBpZiAoY29uc3RydWN0aW9uX21ldGhvZCA9PSAxKSB7CisgICAgICAgICAgICAgICAgbUhhc0NvbnN0cnVjdE1ldGhvZDEgPSB0cnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBvZmZzZXQgKz0gMjsKKyAgICAgICAgfQorCisgICAgICAgIHVpbnQxNl90IGRhdGFfcmVmZXJlbmNlX2luZGV4OworICAgICAgICBpZiAoIXNvdXJjZSgpLT5nZXRVSW50MTYob2Zmc2V0LCAmZGF0YV9yZWZlcmVuY2VfaW5kZXgpKSB7CisgICAgICAgICAgICByZXR1cm4gRVJST1JfSU87CisgICAgICAgIH0KKyAgICAgICAgQUxPR1YoImRhdGFfcmVmZXJlbmNlX2luZGV4ICVkIiwgZGF0YV9yZWZlcmVuY2VfaW5kZXgpOworICAgICAgICBpZiAoZGF0YV9yZWZlcmVuY2VfaW5kZXggIT0gMCkgeworICAgICAgICAgICAgLy8gd2UgZG9uJ3Qgc3VwcG9ydCByZWZlcmVuY2UgdG8gb3RoZXIgZmlsZXMKKyAgICAgICAgICAgIHJldHVybiBFUlJPUl9VTlNVUFBPUlRFRDsKKyAgICAgICAgfQorICAgICAgICBvZmZzZXQgKz0gMjsKKworICAgICAgICB1aW50NjRfdCBiYXNlX29mZnNldCA9IDA7CisgICAgICAgIGlmIChiYXNlX29mZnNldF9zaXplICE9IDApIHsKKyAgICAgICAgICAgIGlmICghc291cmNlKCktPmdldFVJbnQ2NFZhcihvZmZzZXQsICZiYXNlX29mZnNldCwgYmFzZV9vZmZzZXRfc2l6ZSkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfSU87CisgICAgICAgICAgICB9CisgICAgICAgICAgICBvZmZzZXQgKz0gYmFzZV9vZmZzZXRfc2l6ZTsKKyAgICAgICAgfQorICAgICAgICBBTE9HVigiYmFzZV9vZmZzZXQgJWxsZCIsIChsb25nIGxvbmcpIGJhc2Vfb2Zmc2V0KTsKKworICAgICAgICBzc2l6ZV90IGluZGV4ID0gbUl0ZW1Mb2NzLT5hZGQoaXRlbV9pZCwgSXRlbUxvYygKKyAgICAgICAgICAgICAgICBpdGVtX2lkLCBjb25zdHJ1Y3Rpb25fbWV0aG9kLCBkYXRhX3JlZmVyZW5jZV9pbmRleCwgYmFzZV9vZmZzZXQpKTsKKyAgICAgICAgSXRlbUxvYyAmaXRlbSA9IG1JdGVtTG9jcy0+ZWRpdFZhbHVlQXQoaW5kZXgpOworCisgICAgICAgIHVpbnQxNl90IGV4dGVudF9jb3VudDsKKyAgICAgICAgaWYgKCFzb3VyY2UoKS0+Z2V0VUludDE2KG9mZnNldCwgJmV4dGVudF9jb3VudCkpIHsKKyAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKKyAgICAgICAgfQorICAgICAgICBBTE9HVigiZXh0ZW50X2NvdW50ICVkIiwgZXh0ZW50X2NvdW50KTsKKworICAgICAgICBpZiAoZXh0ZW50X2NvdW50ID4gMSAmJiAob2Zmc2V0X3NpemUgPT0gMCB8fCBsZW5ndGhfc2l6ZSA9PSAwKSkgeworICAgICAgICAgICAgLy8gaWYgdGhlIGl0ZW0gaXMgZGl2aWRlYyBpbnRvIG1vcmUgdGhhbiBvbmUgZXh0ZW50cywgb2Zmc2V0IGFuZAorICAgICAgICAgICAgLy8gbGVuZ3RoIG11c3QgYmUgcHJlc2VudC4KKyAgICAgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7CisgICAgICAgIH0KKyAgICAgICAgb2Zmc2V0ICs9IDI7CisKKyAgICAgICAgZm9yIChzaXplX3QgaiA9IDA7IGogPCBleHRlbnRfY291bnQ7IGorKykgeworICAgICAgICAgICAgdWludDY0X3QgZXh0ZW50X2luZGV4ID0gMTsgLy8gZGVmYXVsdD0xCisgICAgICAgICAgICBpZiAoKHZlcnNpb24oKSA9PSAxIHx8IHZlcnNpb24oKSA9PSAyKSAmJiAoaW5kZXhfc2l6ZSA+IDApKSB7CisgICAgICAgICAgICAgICAgaWYgKCFzb3VyY2UoKS0+Z2V0VUludDY0VmFyKG9mZnNldCwgJmV4dGVudF9pbmRleCwgaW5kZXhfc2l6ZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvLyBUT0RPOiBhZGQgc3VwcG9ydCBmb3IgdGhpcyBtb2RlCisgICAgICAgICAgICAgICAgb2Zmc2V0ICs9IGluZGV4X3NpemU7CisgICAgICAgICAgICAgICAgQUxPR1YoImV4dGVudF9pbmRleCAlbGxkIiwgKGxvbmcgbG9uZylleHRlbnRfaW5kZXgpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB1aW50NjRfdCBleHRlbnRfb2Zmc2V0ID0gMDsgLy8gZGVmYXVsdD0wCisgICAgICAgICAgICBpZiAob2Zmc2V0X3NpemUgPiAwKSB7CisgICAgICAgICAgICAgICAgaWYgKCFzb3VyY2UoKS0+Z2V0VUludDY0VmFyKG9mZnNldCwgJmV4dGVudF9vZmZzZXQsIG9mZnNldF9zaXplKSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfSU87CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIG9mZnNldCArPSBvZmZzZXRfc2l6ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEFMT0dWKCJleHRlbnRfb2Zmc2V0ICVsbGQiLCAobG9uZyBsb25nKWV4dGVudF9vZmZzZXQpOworCisgICAgICAgICAgICB1aW50NjRfdCBleHRlbnRfbGVuZ3RoID0gMDsgLy8gdGhpcyBpbmRpY2F0ZXMgZnVsbCBsZW5ndGggb2YgZmlsZQorICAgICAgICAgICAgaWYgKGxlbmd0aF9zaXplID4gMCkgeworICAgICAgICAgICAgICAgIGlmICghc291cmNlKCktPmdldFVJbnQ2NFZhcihvZmZzZXQsICZleHRlbnRfbGVuZ3RoLCBsZW5ndGhfc2l6ZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBvZmZzZXQgKz0gbGVuZ3RoX3NpemU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBBTE9HVigiZXh0ZW50X2xlbmd0aCAlbGxkIiwgKGxvbmcgbG9uZylleHRlbnRfbGVuZ3RoKTsKKworICAgICAgICAgICAgaXRlbS5hZGRFeHRlbnQoeyBleHRlbnRfaW5kZXgsIGV4dGVudF9vZmZzZXQsIGV4dGVudF9sZW5ndGggfSk7CisgICAgICAgIH0KKyAgICB9CisgICAgcmV0dXJuIE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maW1hZ2UgPSBpdGVtSWRUb0ltYWdlTWFwLmVkaXRWYWx1ZUF0KGltYWdlSW5kZXgpOworICAgICAgICAgICAgaWYgKCFpbWFnZS5kaW1nUmVmcy5lbXB0eSgpKSB7CisgICAgICAgICAgICAgICAgQUxPR1coImRpbWdSZWZzIGlmIG5vdCBjbGVhbiEiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGltYWdlLmRpbWdSZWZzLmFwcGVuZFZlY3RvcihtUmVmcyk7CisgICAgICAgIH0gZWxzZSBpZiAodHlwZSgpID09IEZPVVJDQygndCcsICdoJywgJ20nLCAnYicpKSB7CisgICAgICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IG1SZWZzLnNpemUoKTsgaSsrKSB7CisgICAgICAgICAgICAgICAgaW1hZ2VJbmRleCA9IGl0ZW1JZFRvSW1hZ2VNYXAuaW5kZXhPZktleShtUmVmc1tpXSk7CisKKyAgICAgICAgICAgICAgICAvLyBpZ25vcmUgbm9uLWltYWdlIGl0ZW1zCisgICAgICAgICAgICAgICAgaWYgKGltYWdlSW5kZXggPCAwKSB7CisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBBTE9HVigiSW1hZ2UgaXRlbSBpZCAlZCB1c2VzIHRodW1ibmFpbCBpdGVtIGlkICVkIiwgbVJlZnNbaV0sIG1JdGVtSWQpOworICAgICAgICAgICAgICAgIEltYWdlSXRlbSAmaW1hZ2UgPSBpdGVtSWRUb0ltYWdlTWFwLmVkaXRWYWx1ZUF0KGltYWdlSW5kZXgpOworICAgICAgICAgICAgICAgIGlmICghaW1hZ2UudGh1bWJuYWlscy5lbXB0eSgpKSB7CisgICAgICAgICAgICAgICAgICAgIEFMT0dXKCJhbHJlYWR5IGhhcyB0aHVtYm5haWxzISIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpbWFnZS50aHVtYm5haWxzLnB1c2hfYmFjayhtSXRlbUlkKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIEFMT0dXKCJpZ25vcmluZyB1bnN1cHBvcnRlZCByZWYgdHlwZSAweCV4IiwgdHlwZSgpKTsKKyAgICAgICAgfQorICAgIH0KKworcHJpdmF0ZToKKyAgICB1aW50MzJfdCBtSXRlbUlkOworICAgIHVpbnQzMl90IG1SZWZJZFNpemU7CisgICAgVmVjdG9yPHVpbnQzMl90PiBtUmVmczsKKworICAgIERJU0FMTE9XX0VWSUxfQ09OU1RSVUNUT1JTKEl0ZW1SZWZlcmVuY2UpOworfTsKKworc3RhdHVzX3QgSXRlbVJlZmVyZW5jZTo6cGFyc2Uob2ZmNjRfdCBvZmZzZXQsIHNpemVfdCBzaXplKSB7CisgICAgaWYgKHNpemUgPCBtUmVmSWRTaXplICsgMikgeworICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOworICAgIH0KKyAgICBpZiAoIXNvdXJjZSgpLT5nZXRVSW50MzJWYXIob2Zmc2V0LCAmbUl0ZW1JZCwgbVJlZklkU2l6ZSkpIHsKKyAgICAgICAgcmV0dXJuIEVSUk9SX0lPOworICAgIH0KKyAgICBvZmZzZXQgKz0gbVJlZklkU2l6ZTsKKworICAgIHVpbnQxNl90IGNvdW50OworICAgIGlmICghc291cmNlKCktPmdldFVJbnQxNihvZmZzZXQsICZjb3VudCkpIHsKKyAgICAgICAgcmV0dXJuIEVSUk9SX0lPOworICAgIH0KKyAgICBvZmZzZXQgKz0gMjsKKyAgICBzaXplIC09IChtUmVmSWRTaXplICsgMik7CisKKyAgICBpZiAoc2l6ZSA8IGNvdW50ICogbVJlZklkU2l6ZSkgeworICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOworICAgIH0KKworICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgY291bnQ7IGkrKykgeworICAgICAgICB1aW50MzJfdCByZWZJdGVtSWQ7CisgICAgICAgIGlmIC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JXp1IiwgX19GVU5DVElPTl9fLCAobG9uZyBsb25nKW9mZnNldCwgc2l6ZSk7CisKKyAgICBtSFZDQyA9IG5ldyBBQnVmZmVyKHNpemUpOworCisgICAgaWYgKG1IVkNDLT5kYXRhKCkgPT0gTlVMTCkgeworICAgICAgICBBTE9HRSgiYi8yODQ3MTIwNiIpOworICAgICAgICByZXR1cm4gTk9fTUVNT1JZOworICAgIH0KKworICAgIGlmIChzb3VyY2UoKS0+cmVhZEF0KG9mZnNldCwgbUhWQ0MtPmRhdGEoKSwgc2l6ZSkgPCAoc3NpemVfdClzaXplKSB7CisgICAgICAgIHJldHVybiBFUlJPUl9JTzsKKyAgICB9CisKKyAgICBBTE9HVigicHJvcGVydHkgaHZjQyIpOworCisgICAgcmV0dXJuIE9LOworfQorCitzdHJ1Y3QgSXJvdEJveCA6IHB1YmxpYyBCb3gsIHB1YmxpYyBJdGVtUHJvcGVydHkgeworICAgIElyb3RCb3goY29uc3Qgc3A8RGF0YVNvdXJjZT4gc291cmNlKSA6CisgICAgICAgIEJveChzb3VyY2UsIEZPVVJDQygnaScsICdyJywgJ28nLCAndCcpKSwgbUFuZ2xlKDApIHt9CisKKyAgICBzdGF0dXNfdCBwYXJzZShvZmY2NF90IG9mZnNldCwgc2l6ZV90IHNpemUpIG92ZXJyaWRlOworCisgICAgdm9pZCBhdHRhY2hUbyhJbWFnZUl0ZW0gJmltYWdlKSBjb25zdCBvdmVycmlkZSB7CisgICAgICAgIGltYWdlLnJvdGF0aW9uID0gbUFuZ2xlICogOTA7CisgICAgfQorCitwcml2YXRlOgorICAgIHVpbnQ4X3QgbUFuZ2xlOworfTsKKworc3RhdHVzX3QgSXJvdEJveDo6cGFyc2Uob2ZmNjRfdCBvZmZzZXQsIHNpemVfdCBzaXplKSB7CisgICAgQUxPR1YoIiVzOiBvZmZzZXQgJWxsZCwgc2l6ZSAlenUiLCBfX0ZVTkNUSU9OX18sIChsb25nIGxvbmcpb2Zmc2V0LCBzaXplKTsKKworICA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NvbG91cl90eXBlKSkgeworICAgICAgICByZXR1cm4gRVJST1JfSU87CisgICAgfQorICAgIG9mZnNldCArPSA0OworICAgIHNpemUgLT0gNDsKKyAgICBpZiAoY29sb3VyX3R5cGUgPT0gRk9VUkNDKCduJywgJ2MnLCAnbCcsICd4JykpIHsKKyAgICAgICAgcmV0dXJuIE9LOworICAgIH0KKyAgICBpZiAoKGNvbG91cl90eXBlICE9IEZPVVJDQygncicsICdJJywgJ0MnLCAnQycpKSAmJgorICAgICAgICAoY29sb3VyX3R5cGUgIT0gRk9VUkNDKCdwJywgJ3InLCAnbycsICdmJykpKSB7CisgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7CisgICAgfQorCisgICAgbUlDQ0RhdGEgPSBuZXcgQUJ1ZmZlcihzaXplKTsKKyAgICBpZiAobUlDQ0RhdGEtPmRhdGEoKSA9PSBOVUxMKSB7CisgICAgICAgIEFMT0dFKCJiLzI4NDcxMjA2Iik7CisgICAgICAgIHJldHVybiBOT19NRU1PUlk7CisgICAgfQorCisgICAgaWYgKHNvdXJjZSgpLT5yZWFkQXQob2Zmc2V0LCBtSUNDRGF0YS0+ZGF0YSgpLCBzaXplKSAhPSAoc3NpemVfdClzaXplKSB7CisgICAgICAgIHJldHVybiBFUlJPUl9JTzsKKyAgICB9CisKKyAgICBBTE9HVigicHJvcGVydHkgQ29scjogc2l6ZSAlemQiLCBzaXplKTsKKyAgICByZXR1cm4gT0s7Cit9CisKK3N0cnVjdCBJcG1hQm94IDogcHVibGljIEZ1bGxCb3ggeworICAgIElwbWFCb3goY29uc3Qgc3A8RGF0YVNvdXJjZT4gc291cmNlLCBWZWN0b3I8QXNzb2NpYXRpb25FbnRyeT4gKmFzc29jaWF0aW9ucykgOgorICAgICAgICBGdWxsQm94KHNvdXJjZSwgRk9VUkNDKCdpJywgJ3AnLCAnbScsICdhJykpLCBtQXNzb2NpYXRpb25zKGFzc29jaWF0aW9ucykge30KKworICAgIHN0YXR1c190IHBhcnNlKG9mZjY0X3Qgb2Zmc2V0LCBzaXplX3Qgc2l6ZSk7Citwcml2YXRlOgorICAgIFZlY3RvcjxBc3NvY2lhdGlvbkVudHJ5PiAqbUFzc29jaWF0aW9uczsKK307CisKK3N0YXR1c190IElwbWFCb3g6OnBhcnNlKG9mZjY0X3Qgb2Zmc2V0LCBzaXplX3Qgc2l6ZSkgeworICAgIHN0YXR1c190IGVyciA9IHBhcnNlRnVsbEJveEhlYWRlcigmb2Zmc2V0LCAmc2l6ZSk7CisgICAgaWYgKGVyciAhPSBPSykgeworICAgICAgICByZXR1cm4gZXJyOworICAgIH0KKworICAgIGlmIChzaXplIDwgNCkgeworICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOworICAgIH0KKyAgICB1aW50MzJfdCBlbnRyeUNvdW50OworICAgIGlmICghc291cmNlKCktPmdldFVJbnQzMihvZmZzZXQsICZlbnRyeUNvdW50KSkgeworICAgICAgICByZXR1cm4gRVJST1JfSU87CisgICAgfQorICAgIG9mZnNldCArPSA0OworICAgIHNpemUgLT0gNDsKKworICAgIGZvciAoc2l6ZV90IGsgPSAwOyBrIDwgZW50cnlDb3VudDsgKytrKSB7CisgICAgICAgIHVpbnQzMl90IGl0ZW1JZCA9IDA7CisgICAgICAgIHNpemVfdCBpdGVtSWRTaXplID0gKHZlcnNpb24oKSA8IDEpID8gMiA6IDQ7CisKKyAgICAgICAgaWYgKHNpemUgPCBpdGVtSWRTaXplICsgMSkgeworICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKKyAgICAgICAgfQorCisgICAgICAgIGlmICghc291cmNlKCktPmdldFVJbnQzMlZhcihvZmZzZXQsICZpdGVtSWQsIGl0ZW1JZFNpemUpKSB7CisgICAgICAgICAgICByZXR1cm4gRVJST1JfSU87CisgICAgICAgIH0KKyAgICAgICAgb2Zmc2V0ICs9IGl0ZW1JZFNpemU7CisgICAgICAgIHNpemUgLT0gaXRlbUlkU2l6ZTsKKworICAgICAgICB1aW50OF90IGFzc29jaWF0aW9uQ291bnQ7CisgICAgICAgIGlmICghc291cmNlKCktPnJlYWRBdChvZmZzZXQsICZhc3NvY2lhdGlvbkNvdW50LCAxKSkgeworICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOworICAgICAgICB9CisgICAgICAgIG9mZnNldCsrOworICAgICAgICBzaXplLS07CisKKyAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBhc3NvY2lhdGlvbkNvdW50OyArK2kpIHsKKyAgICAgICAgICAgIHNpemVfdCBwcm9wSW5kZXhTaXplID0gKGZsYWdzKCkgJiAxKSA/IDIgOiAxOworICAgICAgICAgICAgaWYgKHNpemUgPCBwcm9wSW5kZXhTaXplKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHVpbnQxNl90IHByb3BJbmRleDsKKyAgICAgICAgICAgIGlmICghc291cmNlKCktPmdldFVJbnQxNlZhcihvZmZzZXQsICZwcm9wSW5kZXgsIHByb3BJbmRleFNpemUpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOworICAgICAgICAgICAgfQorICAgICAgICAgICAgb2Zmc2V0ICs9IHByb3BJbmRleFNpemU7CisgICAgICAgICAgICBzaXplIC09IHByb3BJbmRleFNpemU7CisgICAgICAgICAgICB1aW50MTZfdCBiaXRtYXNrID0gKDEgPDwgKDggKiBwcm9wSW5kZXhTaXplIC0gMSkpOworICAgICAgICAgICAgQXNzb2NpYXRpb25FbnRyeSBlbnRyeSA9IHsKKyAgICAgICAgICAgICAgICAgICAgLml0ZW1JZCA9IGl0ZW1JZCwKKyAgICAgICAgICAgICAgICAgICAgLmVzc2VudGlhbCA9ICEhKHByb3BJbmRleCAmIGJpdG1hc2spLAorICAgICAgICAgICAgICAgICAgICAuaW5kZXggPSAodWludDE2X3QpIChwcm9wSW5kZXggJiB+Yml0bWFzaykKKyAgICAgICAgICA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ZW1Qcm9wZXJ0aWVzLT5wdXNoX2JhY2sobmV3IEl0ZW1Qcm9wZXJ0eSgpKTsKKyAgICByZXR1cm4gcGFyc2VDaHVua3Mob2Zmc2V0LCBzaXplKTsKK30KKworc3RhdHVzX3QgSXBjb0JveDo6b25DaHVua0RhdGEodWludDMyX3QgdHlwZSwgb2ZmNjRfdCBvZmZzZXQsIHNpemVfdCBzaXplKSB7CisgICAgc3A8SXRlbVByb3BlcnR5PiBpdGVtUHJvcGVydHk7CisgICAgc3dpdGNoKHR5cGUpIHsKKyAgICAgICAgY2FzZSBGT1VSQ0MoJ2gnLCAndicsICdjJywgJ0MnKToKKyAgICAgICAgeworICAgICAgICAgICAgaXRlbVByb3BlcnR5ID0gbmV3IEh2Y2NCb3goc291cmNlKCkpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgY2FzZSBGT1VSQ0MoJ2knLCAncycsICdwJywgJ2UnKToKKyAgICAgICAgeworICAgICAgICAgICAgaXRlbVByb3BlcnR5ID0gbmV3IElzcGVCb3goc291cmNlKCkpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgY2FzZSBGT1VSQ0MoJ2knLCAncicsICdvJywgJ3QnKToKKyAgICAgICAgeworICAgICAgICAgICAgaXRlbVByb3BlcnR5ID0gbmV3IElyb3RCb3goc291cmNlKCkpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgY2FzZSBGT1VSQ0MoJ2MnLCAnbycsICdsJywgJ3InKToKKyAgICAgICAgeworICAgICAgICAgICAgaXRlbVByb3BlcnR5ID0gbmV3IENvbHJCb3goc291cmNlKCkpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgeworICAgICAgICAgICAgLy8gcHVzaCBkdW1teSB0byBtYWludGFpbiBjb3JyZWN0IGl0ZW0gcHJvcGVydHkgaW5kZXgKKyAgICAgICAgICAg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mc2V0LCBzaXplX3Qgc2l6ZSkgeworICAgIEFMT0dWKCIlczogb2Zmc2V0ICVsbGQsIHNpemUgJXp1IiwgX19GVU5DVElPTl9fLCAobG9uZyBsb25nKW9mZnNldCwgc2l6ZSk7CisKKyAgICBzdGF0dXNfdCBlcnIgPSBwYXJzZUNodW5rcyhvZmZzZXQsIHNpemUpOworICAgIGlmIChlcnIgIT0gT0spIHsKKyAgICAgICAgcmV0dXJuIGVycjsKKyAgICB9CisgICAgcmV0dXJuIE9LOworfQorCitzdGF0dXNfdCBJcHJwQm94OjpvbkNodW5rRGF0YSh1aW50MzJfdCB0eXBlLCBvZmY2NF90IG9mZnNldCwgc2l6ZV90IHNpemUpIHsKKyAgICBzd2l0Y2godHlwZSkgeworICAgICAgICBjYXNlIEZPVVJDQygnaScsICdwJywgJ2MnLCAnbycpOgorICAgICAgICB7CisgICAgICAgICAgICBJcGNvQm94IGlwY29Cb3goc291cmNlKCksIG1Qcm9wZXJ0aWVzKTsKKyAgICAgICAgICAgIHJldHVybiBpcGNvQm94LnBhcnNlKG9mZnNldCwgc2l6ZSk7CisgICAgICAgIH0KKyAgICAgICAgY2FzZSBGT1VSQ0MoJ2knLCAncCcsICdtJywgJ2EnKToKKyAgICAgICAgeworICAgICAgICAgICAgSXBtYUJveCBpcG1hQm94KHNvdXJjZSgpLCBtQXNzb2NpYXRpb25zKTsKKyAgICAgICAgICAgIHJldHVybiBpcG1hQm94LnBhcnNlKG9mZnNldCwgc2l6ZSk7CisgICAgICAgIH0KKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgeworICAgICAgICAgICAgQUxPR1coIlVucmVjb2duaXplZCBib3guIik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gT0s7Cit9CisKKy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLworLy8KKy8vIC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zZXQgPSBuZXdPZmZzZXQ7CisgICAgICAgICAgICAqc2l6ZSA9IHN0b3BPZmZzZXQgLSBuZXdPZmZzZXQ7CisKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIGlmICgrK2xlbiA+PSBzaXplb2YodG1wKSkgeworICAgICAgICAgICAgb3V0LT5hcHBlbmQodG1wLCBsZW4pOworICAgICAgICAgICAgbGVuID0gMDsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gZmFsc2U7Cit9CisKK3N0YXR1c190IEluZmVCb3g6OnBhcnNlKG9mZjY0X3Qgb2Zmc2V0LCBzaXplX3Qgc2l6ZSwgSXRlbUluZm8gKml0ZW1JbmZvKSB7CisgICAgc3RhdHVzX3QgZXJyID0gcGFyc2VGdWxsQm94SGVhZGVyKCZvZmZzZXQsICZzaXplKTsKKyAgICBpZiAoZXJyICE9IE9LKSB7CisgICAgICAgIHJldHVybiBlcnI7CisgICAgfQorCisgICAgaWYgKHZlcnNpb24oKSA9PSAwIHx8IHZlcnNpb24oKSA9PSAxKSB7CisgICAgICAgIGlmIChzaXplIDwgNCkgeworICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKKyAgICAgICAgfQorICAgICAgICB1aW50MTZfdCBpdGVtX2lkOworICAgICAgICBpZiAoIXNvdXJjZSgpLT5nZXRVSW50MTYob2Zmc2V0LCAmaXRlbV9pZCkpIHsKKyAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKKyAgICAgICAgfQorICAgICAgICBBTE9HVigiaXRlbV9pZCAlZCIsIGl0ZW1faWQpOworICAgICAgICB1aW50MTZfdCBpdGVtX3Byb3RlY3Rpb25faW5kZXg7CisgICAgICAgIGlmICghc291cmNlKCktPmdldFVJbnQxNihvZmZzZXQgKyAyLCAmaXRlbV9wcm90ZWN0aW9uX2luZGV4KSkgeworICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOworICAgICAgICB9CisgICAgICAgIG9mZnNldCArPSA0OworICAgICAgICBzaXplIC09IDQ7CisKKyAgICAgICAgU3RyaW5nOCBpdGVtX25hbWU7CisgICAgICAgIGlmICghcGFyc2VOdWxsVGVybWluYXRlZFN0cmluZygmb2Zmc2V0LCAmc2l6ZSwgJml0ZW1fbmFtZSkpIHsKKyAgICAgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7CisgICAgICAgIH0KKworICAgICAgICBTdHJpbmc4IGNvbnRlbnRfdHlwZTsKKyAgICAgICAgaWYgKCFwYXJzZU51bGxUZXJtaW5hdGVkU3RyaW5nKCZvZmZzZXQsICZzaXplLCAmY29udGVudF90eXBlKSkgeworICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKKyAgICAgICAgfQorCisgICAgICAgIFN0cmluZzggY29udGVudF9lbmNvZGluZzsKKyAgICAgICAgaWYgKCFwYXJzZU51bGxUZXJtaW5hdGVkU3RyaW5nKCZvZmZzZXQsICZzaXplLCAmY29udGVudF9lbmNvZGluZykpIHsKKyAgICAgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7CisgICAgICAgIH0KKworICAgICAgICBpZiAodmVyc2lvbigpID09IDEpIHsKKyAgICAgICAgICAgIHVpbnQzMl90IGV4dGVuc2lvbl90eXBlOworICAgICAgICAgICAgaWYgKCFzb3VyY2UoKS0+Z2V0VUludDMyKG9mZnNldCwgJmV4dGVuc2lvbl90eXBlKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG9mZnNldCsrOworICAgICAgICAgICAgc2l6ZS0tOworICAgICAgICAgICAgLy8gVE9ETzogaGFuZGxlIHRoaXMgY2FzZQorICAgICAgICB9CisgICAgfSBlbHNlIHsgLy8gdmVyc2lvbiA+PSAyCisgICAgICAgIHVpbnQzMl90IGl0ZW1faWQ7CisgICAgICAgIHNpemVfdCBpdGVtSWRTaXplID0gKHZlcnNpb24oKSA9PSAyKSA/IDIgOiA0OworICAgICAgICBpZiAoc2l6ZSA8IGl0ZW1JZFNpemUgKyA2KSB7CisgICAgICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOworICAgICAgICB9CisgICAgICAgIGlmICghc291cmNlKCktPmdldFVJbnQzMlZhcihvZmZzZXQsICZpdGVtX2lkLCBpdGVtSWRTaXplKSkgeworICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOworICAgICAgICB9CisgICAgICAgIEFMT0dWKCJpdGVtX2lkICVkIiwgaXRlbV9pZCk7CisgICAgICAgIG9mZnNldCArPSBpdGVtSWRTaXplOworICAgICAgICB1aW50MTZfdCBpdGVtX3Byb3RlY3Rpb25faW5kZXg7CisgICAgICAgIGlmICghc291cmNlKCktPmdldFVJbnQxNihvZmZzZXQsICZpdGVtX3Byb3RlY3Rpb25faW5kZXgpKSB7CisgICAgICAgICAgICByZXR1cm4gRVJST1JfSU87CisgICAgICAgIH0KKyAgICAgICAgQUxPR1YoIml0ZW1fcHJvdGVjdGlvbl9pbmRleCAlZCIsIGl0ZW1fcHJvdGVjdGlvbl9pbmRleCk7CisgICAgICAgIG9mZnNldCArPSAyOworICAgICAgICB1aW50MzJfdCBpdGVtX3R5cGU7CisgICAgICAgIGlmICghc291cmNlKCktPmdldFVJbnQzMihvZmZzZXQsICZpdGVtX3R5cGUpKSB7CisgICAgICAgICAgICByZXR1cm4gRVJST1JfSU87CisgICAgICAgIH0KKworICAgICAgICBpdGVtSW5mby0+aXRlbUlkID0gaXRlbV9pZDsKKyAgICAgICAgaXRlbUluZm8tPml0ZW1UeXBlID0gaXRlbV90eXBlOworCisgICAgICAgIGNoYXIgaXRlbVR5cGVTdHJpbmdbNV07CisgICAgICAgIE1ha2VGb3VyQ0NTdHJpbmcoaXRlbV90eXBlLCBpdGVtVHlwZVN0cmluZyk7CisgICAgICAgIEFMT0dWKCJpdGVtX3R5cGUgJXMiLCBpdGVtVHlwZVN0cmluZyk7CisgICAgICAgIG9mZnNldCArPSA0OworICAgICAgICBzaXplIC09IGl0ZW1JZFNpemUgKyA2OworCisgICAgICAgIFN0cmluZzggaXRlbV9uYW1lOworICAgICAgICBpZiAoIXBhcnNlTnVsbFRlcm1pbmF0ZWRTdHJpbmcoJm9mZnNldCwgJnNpemUsICZpdGVtX25hbWUpKSB7CisgICAgICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOworICAgICAgICB9CisgICAgICAgIEFMT0dWKCJpdGVtX25hbWUgJXMiLCBpdGVtX25hbWUuY19zdHIoKSk7CisKKyAgICAgICAgaWYgKGl0ZW1fdHlwZSA9PSBGT1VSQ0MoJ20nLCAnaScsICdtJywgJ2UnKSkgeworICAgICAgICAgICAgU3RyaW5nOCBjb250ZW50X3R5cGU7CisgICAgICAgICAgICBpZiAoIXBhcnNlTnVsbFRlcm1pbmF0ZWRTdHJpbmcoJm9mZnNldCwgJnNpemUsICZjb250ZW50X3R5cGUpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgU3RyaW5nOCBjb250ZW50X2VuY29kaW5nOworICAgICAgICAgICAgaWYgKCFwYXJzZU51bGxUZXJtaW5hdGVkU3RyaW5nKCZvZmZzZXQsICZzaXplLCAmY29udGVudF9lbmNvZGluZykpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgaWYgKGl0ZW1fdHlwZSA9PSBGT1VSQ0MoJ3UnLCAncicsICdpJywgJyAnKSkgeworICAgICAgICAgICAgU3RyaW5nOCBpdGVtX3VyaV90eXBlOworICAgICAgICAgICAgaWYgKCFwYXJzZU51bGxUZXJtaW5hdGVkU3RyaW5nKCZvZmZzZXQsICZzaXplLCAmaXRlbV91cmlfdHlwZSkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIHJldHVybiBPSzsKK30KKworc3RydWN0IElpbmZCb3ggOiBwdWJsaWMgRnVsbEJveCB7CisgICAgSWluZkJveChjb25zdCBzcDxEYXRhU291cmNlPiBzb3VyY2UsIFZlY3RvcjxJdGVtSW5mbz4gKml0ZW1JbmZvcykgOgorICAgICAgICBGdWxsQm94KHNvdXJjZSwgRk9VUkNDKCdpJywgJ2knLCAnbicsICdmJykpLAorICAgICAgICBtSXRlbUluZm9zKGl0ZW1JbmZvcyksIG1IYXNHcmlkcyhmYWxzZSkge30KKworICAgIHN0YXR1c190IHBhcnNlKG9mZjY0X3Qgb2Zmc2V0LCBzaXplX3Qgc2l6ZSk7CisKKyAgICBib29sIGhhc0dyaWRzKCkgeyByZXR1cm4gbUhhc0dyaWRzOyB9CisKK3Byb3RlY3RlZDoKKyAgICBzdGF0dXNfdCBvbkNodW5rRGF0YSh1aW50MzJfdCB0eXBlLCBvZmY2NF90IG9mZnNldCwgc2l6ZV90IHNpemUpIG92ZXJyaWRlOworCitwcml2YXRlOgorICAgIFZlY3RvcjxJdGVtSW5mbz4gKm1JdGVtSW5mb3M7CisgICAgYm9vbCBtSGFzR3JpZHM7Cit9OworCitzdGF0dXNfdCBJaW5mQm94OjpwYXJzZShvZmY2NF90IG9mZnNldCwgc2l6ZV90IHNpemUpIHsKKyAgICBBTE9HVigiJXM6IG9mZnNldCAlbGxkLCBzaXplICV6dSIsIF9fRlVOQ1RJT05fXywgKGxvbmcgbG9uZylvZmZzZXQsIHNpemUpOworCisgICAgc3RhdHVzX3QgZXJyID0gcGFyc2VGdWxsQm94SGVhZGVyKCZvZmZzZXQsICZzaXplKTsKKyAgICBpZiAoZXJyICE9IE9LKSB7CisgICAgICAgIHJldHVybiBlcnI7CisgICAgfQorCisgICAgc2l6ZV90IGVudHJ5Q291bnRTaXplID0gdmVyc2lvbigpID09IDAgPyAyIDogNDsKKyAgICBpZiAoc2l6ZSA8IGVudHJ5Q291bnRTaXplKSB7CisgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7CisgICAgfQorICAgIHVpbnQzMl90IGVudHJ5X2NvdW50OworICAgIGlmICghc291cmNlKCktPmdldFVJbnQzMlZhcihvZmZzZXQsICZlbnRyeV9jb3VudCwgZW50cnlDb3VudFNpemUpKSB7CisgICAgICAgIHJldHVybiBFUlJPUl9JTzsKKyAgICB9CisgICAgQUxPR1YoImVudHJ5X2NvdW50ICVkIiwgZW50cnlfY291bnQpOworCisgICAgb2ZmNjRfdCBzdG9wT2Zmc2V0ID0gb2Zmc2V0ICsgc2l6ZTsKKyAgICBvZmZzZXQgKz0gZW50cnlDb3VudFNpemU7CisgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBlbnRyeV9jb3VudCAmJiBvZmZzZXQgPCBzdG9wT2Zmc2V0OyBpKyspIHsKKyAgICAgICAgQUxPR1YoImVudHJ5ICV6dSIsIGkpOworICAgICAgICBzdGF0dXNfdCBlcnIgPSBwYXJzZUNodW5rKCZvZmZzZXQpOworICAgICAgICBpZiAoZXJyICE9IE9LKSB7CisgICAgICAgICAgICByZXR1cm4gZXJyOworICAgICAgICB9CisgICAgfQorICAgIGlmIChvZmZzZXQgIT0gc3RvcE9mZnNldCkgeworICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOworICAgIH0KKworICAgIHJldHVybiBPSzsKK30KKworc3RhdHVzX3QgSWluZkJveDo6b25DaHVua0RhdGEodWludDMyX3QgdHlwZSwgb2ZmNjRfdCBvZmZzZXQsIHNpemVfdCBzaXplKSB7CisgICAgaWYgKHR5cGUgIT0gRk9VUkNDKCdpJywgJ24nLCAnZicsICdlJykpIHsKKyAgICAgICAgcmV0dXJuIE9LOworICAgIH0KKworICAgIEluZmVCb3ggaW5mZUJveChzb3VyY2UoKSk7CisgICAgSXRlbUluZm8gaXRlbUluZm87CisgICAgc3RhdHVzX3QgZXJyID0gaW5mZUJveC5wYXJzZShvZmZzZXQsIHNp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AgICAgICAgcmV0dXJuIHBhcnNlSWxvY0JveChkYXRhX29mZnNldCwgY2h1bmtfZGF0YV9zaXplKTsKKyAgICAgICAgfQorICAgICAgICBjYXNlIEZPVVJDQygnaScsICdpJywgJ24nLCAnZicpOgorICAgICAgICB7CisgICAgICAgICAgICByZXR1cm4gcGFyc2VJaW5mQm94KGRhdGFfb2Zmc2V0LCBjaHVua19kYXRhX3NpemUpOworICAgICAgICB9CisgICAgICAgIGNhc2UgRk9VUkNDKCdpJywgJ3AnLCAncicsICdwJyk6CisgICAgICAgIHsKKyAgICAgICAgICAgIHJldHVybiBwYXJzZUlwcnBCb3goZGF0YV9vZmZzZXQsIGNodW5rX2RhdGFfc2l6ZSk7CisgICAgICAgIH0KKyAgICAgICAgY2FzZSBGT1VSQ0MoJ3AnLCAnaScsICd0JywgJ20nKToKKyAgICAgICAgeworICAgICAgICAgICAgcmV0dXJuIHBhcnNlUGl0bUJveChkYXRhX29mZnNldCwgY2h1bmtfZGF0YV9zaXplKTsKKyAgICAgICAgfQorICAgICAgICBjYXNlIEZPVVJDQygnaScsICdkJywgJ2EnLCAndCcpOgorICAgICAgICB7CisgICAgICAgICAgICByZXR1cm4gcGFyc2VJZGF0Qm94KGRhdGFfb2Zmc2V0LCBjaHVua19kYXRhX3NpemUpOworICAgICAgICB9CisgICAgICAgIGNhc2UgRk9VUkNDKCdpJywgJ3InLCAnZScsICdmJyk6CisgICAgICAgIHsKKyAgICAgICAgICAgIHJldHVybiBwYXJzZUlyZWZCb3goZGF0YV9vZmZzZXQsIGNodW5rX2RhdGFfc2l6ZSk7CisgICAgICAgIH0KKyAgICAgICAgY2FzZSBGT1VSQ0MoJ2knLCAncCcsICdyJywgJ28nKToKKyAgICAgICAgeworICAgICAgICAgICAgQUxPR1coImlwcm8gYm94IG5vdCBzdXBwb3J0ZWQhIik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBkZWZhdWx0OgorICAgICAgICB7CisgICAgICAgICAgICBB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AgfQorCisgICAgbUJveGVzU2Vlbi5pbnNlcnQodHlwZSk7CisKKyAgICAvLyBuZWVkIGF0IGxlYXN0ICdpcHJwJywgJ2lsb2MnLCAncGl0bScsICdpaW5mJzsKKyAgICAvLyBuZWVkICdpZGF0JyBpZiBhbnkgaXRlbXMgdXNlZCBjb25zdHJ1Y3Rpb25fbWV0aG9kIG9mIDI7CisgICAgLy8gbmVlZCAnaXJlZicgaWYgdGhlcmUgYXJlIGdyaWRzLgorICAgIGlmICghc3RkOjppbmNsdWRlcygKKyAgICAgICAgICAgIG1Cb3hlc1NlZW4uYmVnaW4oKSwgbUJveGVzU2Vlbi5lbmQoKSwKKyAgICAgICAgICAgIG1SZXF1aXJlZEJveGVzLmJlZ2luKCksIG1SZXF1aXJlZEJveGVzLmVuZCgpKSkgeworICAgICAgICByZXR1cm4gT0s7CisgICAgfQorCisgICAgQUxPR1YoImJ1aWxkaW5nIGltYWdlIHRhYmxlLi4uIik7CisKKyAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IG1JdGVtSW5mb3Muc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgY29uc3QgSXRlbUluZm8gJmluZm8gPSBtSXRlbUluZm9zW2ldOworCisKKyAgICAgICAgLy8gaWdub3JlIG5vbi1pbWFnZSBpdGVtcworICAgICAgICBpZiAoaW5mby5pdGVtVHlwZSAhPSBGT1VSQ0MoJ2cnLCAncicsICdpJywgJ2QnKSAmJgorICAgICAgICAgICAgaW5mby5pdGVtVHlwZSAhPSBGT1VSQ0MoJ2gnLCAndicsICdjJywgJzEnKSkgeworICAgICAgICAgICAgY29udGludWU7CisgICAgICAgIH0KKworICAgICAgICBzc2l6ZV90IGltYWdlSW5kZXggPSBtSXRlbUlkVG9JbWFnZU1hcC5pbmRleE9mS2V5KGluZm8uaXRlbUlkKTsKKyAgICAgICAgaWYgKGltYWdlSW5kZXggPj0gMCkgeworICAgICAgICAgICAgQUxPR1coImlnbm9yaW5nIGR1cGxpY2F0ZSBpbWFnZSBpdGVtIGlkICVkIiwgaW5mby5pdGVtSWQpOworICAgICAgICAgICAgY29udGludWU7CisgICAgICAgIH0KKworICAgICAgICBzc2l6ZV90IGlsb2NJbmRleCA9IG1JdGVtTG9jcy5pbmRleE9mS2V5KGluZm8uaXRlbUlkKTsKKyAgICAgICAgaWYgKGlsb2NJbmRleCA8IDApIHsKKyAgICAgICAgICAgIEFMT0dFKCJpbG9jIG1pc3NpbmcgZm9yIGltYWdlIGl0ZW0gaWQgJWQiLCBpbmZvLml0ZW1JZCk7CisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgfQorICAgICAgICBjb25zdCBJdGVtTG9jICZpbG9jID0gbUl0ZW1Mb2NzW2lsb2NJbmRleF07CisKKyAgICAgICAgb2ZmNjRfdCBvZmZzZXQ7CisgICAgICAgIHNpemVfdCBzaXplOworICAgICAgICBpZiAoaWxvYy5nZXRMb2MoJm9mZnNldCwgJnNpemUsIG1JZGF0T2Zmc2V0LCBtSWRhdFNpemUpICE9IE9LKSB7CisgICAgICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOworICAgICAgICB9CisKKyAgICAgICAgSW1hZ2VJdGVtIGltYWdlKGluZm8uaXRlbVR5cGUpOworCisgICAgICAgIEFMT0dWKCJhZGRpbmcgJXM6IGl0ZW1JZCAlZCIsIGltYWdlLmlzR3JpZCgpID8gImdyaWQiIDogImltYWdlIiwgaW5mby5pdGVtSWQpOworCisgICAgICAgIGlmIChpbWFnZS5pc0dyaWQoKSkgeworICAgICAgICAgICAgLy8gSW1hZ2VHcmlkIHN0cnVjdCBpcyBhdCBsZWFzdCA4LWJ5dGUsIGF0IG1vc3QgMTItYnl0ZSAoaWYgZmxhZ3MmMSkKKyAgICAgICAgICAgIGlmIChzaXplIDwgOCB8fCBzaXplID4gMTIpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdWludDhfdCBidWZbMTJdOworICAgICAgICAgICAgaWYgKCFtRGF0YVNvdXJjZS0+cmVhZEF0KG9mZnNldCwgYnVmLCBzaXplKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaW1hZ2Uucm93cyA9IGJ1ZlsyXSArIDE7CisgICAgICAgICAgICBpbWFnZS5jb2x1bW5zID0gYnVmWzNdICsgMTsKKworICAgICAgICAgICAgQUxPR1YoInJvd3MgJWQsIGNvbHVtYW5zICVkIiwgaW1hZ2Uucm93cywgaW1hZ2UuY29sdW1ucyk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpbWFnZS5vZmZzZXQgPSBvZmZzZXQ7CisgICAgICAgICAgICBpbWFnZS5zaXplID0gc2l6ZTsKKyAgICAgICAgfQorICAgICAgICBtSXRlbUlkVG9JbWFnZU1hcC5hZGQoaW5mby5pdGVtSWQsIGltYWdlKTsKKyAgICB9CisKKyAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IG1Bc3NvY2lhdGlvbnMuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgYXR0YWNoUHJvcGVydHkobUFzc29jaWF0aW9uc1tpXSk7CisgICAgfQorCisgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBtSXRlbVJlZmVyZW5jZXMuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgbUl0ZW1SZWZlcmVuY2VzW2ldLT5hcHBseShtSXRlbUlkVG9JbWFnZU1hcCk7CisgICAgfQorCisgICAgbUltYWdlSXRlbXNWYWxpZCA9IHRydWU7CisgICAgcmV0dXJuIE9LOworfQorCit2b2lkIEl0ZW1UYWJsZTo6YXR0YWNoUHJvcGVydHkoY29uc3QgQXNzb2NpYXRpb25FbnRyeSAmYXNzb2NpYXRpb24pIHsKKyAgICBzc2l6ZV90IGltYWdlSW5kZXggPSBtSXRlbUlkVG9JbWFnZU1hcC5pbmRleE9mS2V5KGFzc29jaWF0aW9uLml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2l6ZSwgaW1hZ2UtPndpZHRoICogaW1hZ2UtPmhlaWdodCAqIDEuNSk7CisKKyAgICBpZiAoIWltYWdlLT50aHVtYm5haWxzLmVtcHR5KCkpIHsKKyAgICAgICAgc3NpemVfdCB0aHVtYm5haWxJbmRleCA9IG1JdGVtSWRUb0ltYWdlTWFwLmluZGV4T2ZLZXkoaW1hZ2UtPnRodW1ibmFpbHNbMF0pOworICAgICAgICBpZiAodGh1bWJuYWlsSW5kZXggPj0gMCkgeworICAgICAgICAgICAgY29uc3QgSW1hZ2VJdGVtICZ0aHVtYm5haWwgPSBtSXRlbUlkVG9JbWFnZU1hcFt0aHVtYm5haWxJbmRleF07CisKKyAgICAgICAgICAgIG1ldGEtPnNldEludDMyKGtLZXlUaHVtYm5haWxXaWR0aCwgdGh1bWJuYWlsLndpZHRoKTsKKyAgICAgICAgICAgIG1ldGEtPnNldEludDMyKGtLZXlUaHVtYm5haWxIZWlnaHQsIHRodW1ibmFpbC5oZWlnaHQpOworICAgICAgICAgICAgbWV0YS0+c2V0RGF0YShrS2V5VGh1bWJuYWlsSFZDQywga1R5cGVIVkNDLAorICAgICAgICAgICAgICAgICAgICB0aHVtYm5haWwuaHZjYy0+ZGF0YSgpLCB0aHVtYm5haWwuaHZjYy0+c2l6ZSgpKTsKKyAgICAgICAgICAgIEFMT0dWKCJ0aHVtYm5haWwgbWV0YTogJWR4JWQsIGluZGV4ICV6ZCIsCisgICAgICAgICAgICAgICAgICAgIHRodW1ibmFpbC53aWR0aCwgdGh1bWJuYWlsLmhlaWdodCwgdGh1bWJuYWlsSW5kZXgpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgQUxPR1coIlJlZmVyZW5jZWQgdGh1bWJuYWlsIGRvZXMgbm90IGV4aXN0ISIpOworICAgICAgICB9CisgICAgfQorCisgICAgaWYgKGltYWdlLT5pc0dyaWQoKSkgeworICAgICAgICBzc2l6ZV90IHRpbGVJbmRleCA9IG1JdGVtSWRUb0ltYWdlTWFwLmlu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AgIHByaW50ZigiICIpOwotCi0gICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgbjsgKytpKSB7Ci0gICAgICAgICAgICBpZiAoaXNwcmludChkYXRhW29mZnNldCArIGldKSkgewotICAgICAgICAgICAgICAgIHByaW50ZigiJWMiLCBkYXRhW29mZnNldCArIGldKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgcHJpbnRmKCIuIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBwcmludGYoIlxuIik7Ci0KLSAgICAgICAgb2Zmc2V0ICs9IDE2OwotICAgIH0KLX0KLQogc3RhdGljIGNvbnN0IGNoYXIgKkZvdXJDQzJNSU1FKHVpbnQzMl90IGZvdXJjYykgewogICAgIHN3aXRjaCAoZm91cmNjKSB7CiAgICAgICAgIGNhc2UgRk9VUkNDKCdtJywgJ3AnLCAnNCcsICdhJyk6CkBAIC0zNzcsNiArMzQ1LDcgQEAKICAgICAgIG1Jbml0Q2hlY2soTk9fSU5JVCksCiAgICAgICBtSGVhZGVyVGltZXNjYWxlKDApLAogICAgICAgbUlzUVQoZmFsc2UpLAorICAgICAgbUlzSEVJRihmYWxzZSksCiAgICAgICBtRmlyc3RUcmFjayhOVUxMKSwKICAgICAgIG1MYXN0VHJhY2soTlVMTCksCiAgICAgICBtRmlsZU1ldGFEYXRhKG5ldyBNZXRhRGF0YSksCkBAIC0zODUsNiArMzU0LDEwIEBACiB9CiAKIE1QRUc0RXh0cmFjdG9yOjp+TVBFRzRFeHRyYWN0b3IoKSB7CisgICAgcmVsZWFzZSgpOworfQorCit2b2lkIE1QRUc0RXh0cmFjdG9yOjpyZWxlYXNlKCkgewogICAgIFRyYWNrICp0cmFjayA9IG1GaXJzdFRyYWNrOwogICAgIHdoaWxlICh0cmFjaykgewogICAgICAgICBUcmFjayAqbmV4dCA9IHRyYWNrLT5uZXh0OwpAQCAtNDA2LDYgKzM3OSwxMiBAQAogICAgIGZv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CkgJiYgbUl0ZW1UYWJsZS0+aXNWYWxpZCgpKSkpIHsKICAgICAgICAgb2ZmNjRfdCBvcmlnX29mZnNldCA9IG9mZnNldDsKICAgICAgICAgZXJyID0gcGFyc2VDaHVuaygmb2Zmc2V0LCAwKTsKIApAQCAtNTgwLDYgKzU1MiwyOSBAQAogICAgICAgICBtRmlsZU1ldGFEYXRhLT5zZXREYXRhKGtLZXlQc3NoLCAncHNzaCcsIGJ1ZiwgcHNzaHNpemUpOwogICAgICAgICBmcmVlKGJ1Zik7CiAgICAgfQorCisgICAgaWYgKG1Jc0hFSUYpIHsKKyAgICAgICAgc3A8TWV0YURhdGE+IG1ldGEgPSBtSXRlbVRhYmxlLT5nZXRJbWFnZU1ldGEoKTsKKyAgICAgICAgaWYgKG1ldGEgPT0gTlVMTCkgeworICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKKyAgICAgICAgfQorCisgICAgICAgIFRyYWNrICp0cmFjayA9IG1MYXN0VHJhY2s7CisgICAgICAgIGlmICh0cmFjayAhPSBOVUxMKSB7CisgICAgICAgICAgICBBTE9HVygidHJhY2sgaXMgc2V0IGJlZm9yZSBtZXRhZGF0YSBpcyBmdWxseSBwcm9jZXNzZWQiKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHRyYWNrID0gbmV3IFRyYWNrOworICAgICAgICAgICAgdHJhY2stPm5leHQgPSBOVUxMOworICAgICAgICAgICAgbUZpcnN0VHJhY2sgPSBtTGFzdFRyYWNrID0gdHJhY2s7CisgICAgICAgIH0KKworICAgICAgICB0cmFjay0+bWV0YSA9IG1ldGE7CisgICAgICAgIHRyYWNrLT5tZXRhLT5zZXRJbnQzMihrS2V5VHJhY2tJRCwgMCk7CisgICAgICAgIHRyYWNrLT5pbmNsdWRlc19leHBlbnNpdmVfbWV0YWRhdGEgPSBmYWxzZTsKKyAgICAgICAgdHJhY2stPnNraXBUcmFjayA9IGZhbHNlOworICAgICAgICB0cmFjay0+dGltZXNjYWxlID0gMDsKKyAgICB9CisKICAgICByZXR1cm4gbUluaXRDaGVjazsKIH0KIApAQCAtOTY2LDggKzk2MSw5IEBACiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgICAgICBpZiAobUxhc3RUcmFjayA9PSBOVUxMKQorICAgICAgICAgICAgICAgIGlmIChtTGFzdFRyYWNrID09IE5VTEwpIHsKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKKyAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICBtTGFzdFRyYWNrLT5zYW1wbGVUYWJsZSA9IG5ldyBTYW1wbGVUYWJsZShtRGF0YVNvdXJjZSk7CiAgICAgICAgICAgICB9CkBAIC0xMTM5LDggKzExMzUsOSBAQAogICAgICAgICAgICAgb3JpZ2luYWxfZm91cmNjID0gbnRvaGwob3JpZ2luYWxfZm91cmNjKTsKICAgICAgICAgICAgIEFMT0dWKCJyZWFkIG9yaWdpbmFsIGZvcm1hdDogJWQiLCBvcmlnaW5hbF9mb3VyY2MpOwogCi0gICAgICAgICAgICBpZiAobUxhc3RUcmFjayA9PSBOVUxMKQorICAgICAgICAgICAgaWYgKG1MYXN0VHJhY2sgPT0gTlVMTCkgewogICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7CisgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIG1MYXN0VHJhY2stPm1ldGEtPnNldENTdHJpbmcoa0tleU1JTUVUeXBlLCBGb3VyQ0MyTUlNRShvcmlnaW5hbF9mb3VyY2MpKTsKICAgICAgICAgICAgIHVpbnQzMl90IG51bV9jaGFubmVscyA9IDA7CkBAIC0xNTgwLDggKzE1NzcsOSBAQAogICAgICAgICBjYXNlIEZPVVJDQygncycsICd0JywgJ2MnLCAnbycpOgogICAgICAgICBjYXNlIEZPVVJDQygnYycsICdvJywgJzYnLCAnNCcpOgogICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoKG1MYXN0VHJhY2sgPT0gTlVMTCkgfHwgKG1MYXN0VHJhY2stPnNhbXBsZVRhYmxlID09IE5VTEwpKQorICAgICAgICAgICAgaWYgKChtTGFzdFRyYWNrID09IE5VTEwpIHx8IChtTGFzdFRyYWNrLT5zYW1wbGVUYWJsZSA9PSBOVUxMKSkgewogICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7CisgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIHN0YXR1c190IGVyciA9CiAgICAgICAgICAgICAgICAgbUxhc3RUcmFjay0+c2FtcGxlVGFibGUtPnNldENodW5rT2Zmc2V0UGFyYW1zKApAQCAtMTYxNyw4ICsxNjE1LDkgQEAKICAgICAgICAgY2FzZSBGT1VSQ0MoJ3MnLCAndCcsICdzJywgJ3onKToKICAgICAgICAgY2FzZSBGT1VSQ0MoJ3MnLCAndCcsICd6JywgJzInKToKICAgICAgICAgewotICAgICAgICAgICAgaWYgKChtTGFzdFRyYWNrID09IE5VTEwpIHx8IChtTGFzdFRyYWNrLT5zYW1wbGVUYWJsZSA9PSBOVUxMKSkKKyAgICAgICAgICAgIGlmICgobUxhc3RUcmFjayA9PSBOVUxMKSB8fCAobUxhc3RUcmFjay0+c2FtcGxlVGFibGUgPT0gTlVMTCkpIHsKICAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOworICAgICAgICAgICAgfQogCiAgICAgICAgICAgICBzdGF0dXNfdCBlcnIgPQogICAgICAgICAgICAgICAgIG1MYXN0VHJhY2stPnNhbXBsZVRhYmxlLT5zZXRTYW1wbGVTaXplUGFyYW1zKApAQCAtMTc3OSwzNSArMTc3OCw0OSBAQAogICAgICAgICB7CiAgICAgICAgICAgICAqb2Zmc2V0ICs9IGNodW5rX3NpemU7CiAKLSAgICAgICAgICAgIC8vIEJlc3QgY2FzZSB0aGUgdG90YWwgZGF0YSBsZW5ndGggaW5zaWRlICJceEE5eHl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gICAgICAgICAgaWYgKCFidWZmZXIpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gTk9fTUVNT1JZOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAobURhdGFTb3VyY2UtPnJlYWRBdCgKKyAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFfb2Zmc2V0ICsgNCwgJmJ1ZmZlclswXSwgbGVuKSA8IGxlbikgeworICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbGVuID0gc3RybGVuKCZidWZmZXJbMF0pOworICAgICAgICAgICAgaWYgKGxlbiA8IDQpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLy8gQWRkIGEgdHJhaWxpbmcgc2xhc2ggaWYgdGhlcmUgd2Fzbid0IG9uZS4KKyAgICAgICAgICAgIGlmIChidWZmZXJbbGVuIC0gMV0gIT0gJy8nKSB7CisgICAgICAgICAgICAgICAgYnVmZmVyW2xlbl0gPSAnLyc7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtRmlsZU1ldGFEYXRhLT5zZXRDU3RyaW5nKGtLZXlMb2NhdGlvbiwgJmJ1ZmZlclswXSk7CiAgICAgICAgICAgICBicmVhazsKICAgICAgICAgfQogCkBAIC0yMDIzLDYgKzIwMzYsMjggQEAKICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICB9CiAKKyAgICAgICAgY2FzZSBGT1VSQ0MoJ2knLCAnbCcsICdvJywgJ2MnKToKKyAgICAgICAgY2FzZSBGT1VSQ0MoJ2knLCAnaScsICduJywgJ2YnKToKKyAgICAgICAgY2FzZSBGT1VSQ0MoJ2knLCAncCcsICdyJywgJ3AnKToKKyAgICAgICAgY2FzZSBGT1VSQ0MoJ3AnLCAnaScsICd0JywgJ20nKToKKyAgICAgICAgY2FzZSBGT1VSQ0MoJ2knLCAnZCcsICdhJywgJ3QnKToKKyAgICAgICAgY2FzZSBGT1VSQ0MoJ2knLCAncicsICdlJywgJ2YnKToKKyAgICAgICAgY2FzZSBGT1VSQ0MoJ2knLCAncCcsICdyJywgJ28nKToKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKG1Jc0hFSUYpIHsKKyAgICAgICAgICAgICAgICBpZiAobUl0ZW1UYWJsZSA9PSBOVUxMKSB7CisgICAgICAgICAgICAgICAgICAgIG1JdGVtVGFibGUgPSBuZXcgSXRlbVRhYmxlKG1EYXRhU291cmNlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0gbUl0ZW1UYWJsZS0+cGFyc2UoCisgICAgICAgICAgICAgICAgICAgICAgICBjaHVua190eXBlLCBkYXRhX29mZnNldCwgY2h1bmtfZGF0YV9zaXplKTsKKyAgICAgICAgICAgICAgICBpZiAoZXJyICE9IE9LKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBlcnI7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgKm9mZnNldCArPSBjaHVua19zaXplOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKwogICAgICAgICBjYXNlIEZPVVJDQygnbScsICdlJywgJ2EnLCAnbicpOgogICAgICAgICBjYXNlIEZPVVJDQygnbicsICdhJywgJ20nLCAnZScpOgogICAgICAgICBjYXNlIEZPVVJDQygnZCcsICdhJywgJ3QnLCAnYScpOgpAQCAtMjM3MCw2ICsyNDA1LDcgQEAKIAogICAgICAgICAgICAgb2ZmNjRfdCBzdG9wX29mZnNldCA9ICpvZmZzZXQgKyBjaHVua19zaXplOwogICAgICAgICAgICAgdWludDMyX3QgbnVtQ29tcGF0aWJsZUJyYW5kcyA9IChjaHVua19kYXRhX3NpemUgLSA4KSAvIDQ7CisgICAgICAgICAgICBzdGQ6OnNldDx1aW50MzJfdD4gYnJhbmRTZXQ7CiAgICAgICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IG51bUNvbXBhdGlibGVCcmFuZHMgKyAyOyArK2kpIHsKICAgICAgICAgICAgICAgICBpZiAoaSA9PSAxKSB7CiAgICAgICAgICAgICAgICAgICAgIC8vIFNraXAgdGhpcyBpbmRleCwgaXQgcmVmZXJzIHRvIHRoZSBtaW5vclZlcnNpb24sCkBAIC0yMzgzLDEwICsyNDE5LDE1IEBACiAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgYnJhbmQgPSBudG9obChicmFuZCk7Ci0gICAgICAgICAgICAgICAgaWYgKGJyYW5kID09IEZPVVJDQygncScsICd0JywgJyAnLCAnICcpKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1Jc1FUID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyYW5kU2V0Lmluc2VydChicmFuZCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChicmFuZFNldC5jb3VudChGT1VSQ0MoJ3EnLCAndCcsICcgJywgJyAnKSkgPiAwKSB7CisgICAgICAgICAgICAgICAgbUlzUVQgPSB0cnVlOworICAgICAgICAgICAgfSBlbHNlIGlmIChicmFuZFNldC5jb3VudChGT1VSQ0MoJ20nLCAnaScsICdmJywgJzEnKSkgPiAwCisgICAgICAgICAgICAgICAgICAgICYmIGJyYW5kU2V0LmNvdW50KEZPVVJDQygnaCcsICdlJywgJ2knLCAnYycpKSA+IDApIHsKKyAgICAgICAgICAgICAgICBtSXNIRUlGID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBBTE9HVigiaWRlbnRpZmllZCBIRUlGIGltYWdlIik7CiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICpvZmZzZXQgPSBzdG9wX29mZnNldDsKQEAgLTMzMzUsNyArMzM3Niw3IEBACiAKICAgICBzcDxNUEVHNFNvdXJjZT4gc291cmNlID0gIG5ldyBNUEVHNFNvdXJjZSh0a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WdtZW50SGVhZGVySW5mbykpOwogCkBAIC00NTI0LDc3ICs0NTY4LDkzIEBACiAgICAgaW50NjRfdCBzZWVrVGltZVVzOwogICAgIFJlYWRPcHRpb25zOjpTZWVrTW9kZSBtb2RlOwogICAgIGlmIChvcHRpb25zICYmIG9wdGlvbnMtPmdldFNlZWtUbygmc2Vla1RpbWVVcywgJm1vZGUpKSB7Ci0gICAgICAgIHVpbnQzMl90IGZpbmRGbGFncyA9IDA7Ci0gICAgICAgIHN3aXRjaCAobW9kZSkgewotICAgICAgICAgICAgY2FzZSBSZWFkT3B0aW9uczo6U0VFS19QUkVWSU9VU19TWU5DOgotICAgICAgICAgICAgICAgIGZpbmRGbGFncyA9IFNhbXBsZVRhYmxlOjprRmxhZ0JlZm9yZTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgUmVhZE9wdGlvbnM6OlNFRUtfTkVYVF9TWU5DOgotICAgICAgICAgICAgICAgIGZpbmRGbGFncyA9IFNhbXBsZVRhYmxlOjprRmxhZ0FmdGVyOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSBSZWFkT3B0aW9uczo6U0VFS19DTE9TRVNUX1NZTkM6Ci0gICAgICAgICAgICBjYXNlIFJlYWRPcHRpb25zOjpTRUVLX0NMT1NFU1Q6Ci0gICAgICAgICAgICAgICAgZmluZEZsYWdzID0gU2FtcGxlVGFibGU6OmtGbGFnQ2xvc2VzdDsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICAgICAgQ0hFQ0soISJTaG91bGQgbm90IGJlIGhlcmUuIik7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KKyAgICAgICAgaWYgKG1Jc0hFSUYpIHsKKyAgICAgICAgICAgIENIRUNLKG1TYW1wbGVUYWJsZSA9PSBOVUxMKTsKKyAgICAgICAgICAgIENIRUNLKG1JdGVtVGF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ICAgICAgICByZXR1cm4gZXJyOwotICAgICAgICB9CisgICAgICAgICAgICBpZiAoZXJyICE9IE9LKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGVycjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHVpbnQzMl90IGZpbmRGbGFncyA9IDA7CisgICAgICAgICAgICBzd2l0Y2ggKG1vZGUpIHsKKyAgICAgICAgICAgICAgICBjYXNlIFJlYWRPcHRpb25zOjpTRUVLX1BSRVZJT1VTX1NZTkM6CisgICAgICAgICAgICAgICAgICAgIGZpbmRGbGFncyA9IFNhbXBsZVRhYmxlOjprRmxhZ0JlZm9yZTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBSZWFkT3B0aW9uczo6U0VFS19ORVhUX1NZTkM6CisgICAgICAgICAgICAgICAgICAgIGZpbmRGbGFncyA9IFNhbXBsZVRhYmxlOjprRmxhZ0FmdGVyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFJlYWRPcHRpb25zOjpTRUVLX0NMT1NFU1RfU1lOQzoKKyAgICAgICAgICAgICAgICBjYXNlIFJlYWRPcHRpb25zOjpTRUVLX0NMT1NFU1Q6CisgICAgICAgICAgICAgICAgICAgIGZpbmRGbGFncyA9IFNhbXBsZVRhYmxlOjprRmxhZ0Nsb3Nlc3Q7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgIENIRUNLKCEiU2hvdWxkIG5vdCBiZSBoZXJlLiIpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KIAotICAgICAgICBpZiAobW9kZSA9PSBSZWFkT3B0aW9uczo6U0VFS19DTE9TRVNUKSB7Ci0gICAgICAgICAgICB0YXJnZXRTYW1wbGVUaW1lVXMgPSAoc2FtcGxlVGltZSAqIDEwMDAwMDBsbCkgLyBtVGltZXNjYWxlOwotICAgICAgICB9CisgICAgICAgICAgICB1aW50MzJfdCBzYW1wbGVJbmRleDsKKyAgICAgICAgICAgIHN0YXR1c190IGVyciA9IG1TYW1wbGVUYWJsZS0+ZmluZFNhbXBsZUF0VGltZSgKKyAgICAgICAgICAgICAgICAgICAgc2Vla1RpbWVVcywgMTAwMDAwMCwgbVRpbWVzY2FsZSwKKyAgICAgICAgICAgICAgICAgICAgJnNhbXBsZUluZGV4LCBmaW5kRmxhZ3MpOworCisgICAgICAgICAgICBpZiAobW9kZSA9PSBSZWFkT3B0aW9uczo6U0VFS19DTE9TRVNUKSB7CisgICAgICAgICAgICAgICAgLy8gV2UgZm91bmQgdGhlIGNsb3Nlc3Qgc2FtcGxlIGFscmVhZHksIG5vdyB3ZSB3YW50IHRoZSBzeW5jCisgICAgICAgICAgICAgICAgLy8gc2FtcGxlIHByZWNlZGluZyBpdCAob3IgdGhlIHNhbXBsZSBpdHNlbGYgb2YgY291cnNlKSwgZXZlbgorICAgICAgICAgICAgICAgIC8vIGlmIHRoZSBzdWJzZXF1ZW50IHN5bmMgc2FtcGxlIGlzIGNsb3Nlci4KKyAgICAgICAgICAgICAgICBmaW5kRmxhZ3MgPSBTYW1wbGVUYWJsZTo6a0ZsYWdCZWZvcmU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHVpbnQzMl90IHN5bmNTYW1wbGVJbmRleDsKKyAgICAgICAgICAgIGlmIChlcnIgPT0gT0spIHsKKyAgICAgICAgICAgICAgICBlcnIgPSBtU2FtcGxlVGFibGUtPmZpbmRTeW5jU2FtcGxlTmVhcigKKyAgICAgICAgICAgICAgICAgICAgICAgIHNhbXBsZUluZGV4LCAmc3luY1NhbXBsZUluZGV4LCBmaW5kRmxhZ3MpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB1aW50MzJfdCBzYW1wbGVUaW1lOworICAgICAgICAgICAgaWYgKGVyciA9PSBPSykgeworICAgICAgICAgICAgICAgIGVyciA9IG1TYW1wbGVUYWJsZS0+Z2V0TWV0YURhdGFGb3JTYW1wbGUoCisgICAgICAgICAgICAgICAgICAgICAgICBzYW1wbGVJbmRleCwgTlVMTCwgTlVMTCwgJnNhbXBsZVRpbWUpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoZXJyICE9IE9LKSB7CisgICAgICAgICAgICAgICAgaWYgKGVyciA9PSBFUlJPUl9PVVRfT0ZfUkFOR0UpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gQW4gYXR0ZW1wdCB0byBzZWVrIHBhc3QgdGhlIGVuZCBvZiB0aGUgc3RyZWFtIHdvdWxkCisgICAgICAgICAgICAgICAgICAgIC8vIG5vcm1hbGx5IGNhdXNlIHRoaXMgRVJST1JfT1VUX09GX1JBTkdFIGVycm9yLiBQcm9wYWdhdGluZworICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIGFsbCB0aGUgd2F5IHRvIHRoZSBNZWRpYVBsYXllciB3b3VsZCBjYXVzZSBhYm5vcm1hbAorICAgICAgICAgICAgICAgICAgICAvLyB0ZXJtaW5hdGlvbi4gTGVnYWN5IGJlaGF2aW91ciBhcHBlYXJzIHRvIGJlIHRvIGJlaGF2ZSBhcyBpZgorICAgICAgICAgICAgICAgICAgICAvLyB3ZSBoYWQgc2Vla2VkIHRvIHRoZSBlbmQgb2Ygc3RyZWFtLCBlbmRpbmcgbm9ybWFsbHkuCisgICAgICAgICAgICAgICAgICAgIGVyciA9IEVSUk9SX0VORF9PRl9TVFJFQU07CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIEFMT0dWKCJlbmQgb2Ygc3RyZWFtIik7CisgICAgICAgICAgICAgICAgcmV0dXJuIGVycjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKG1vZGUgPT0gUmVhZE9wdGlvbnM6OlNFRUtfQ0xPU0VTVCkgeworICAgICAgICAgICAgICAgIHRhcmdldFNhbXBsZVRpbWVVcyA9IChzYW1wbGVUaW1lICogMTAwMDAwMGxsKSAvIG1UaW1lc2NhbGU7CisgICAgICAgICAgICB9CiAKICNpZiAwCi0gICAgICAgIHVpbnQzMl90IHN5bmNTYW1wbGVUaW1lOwotICAgICAgICBDSEVDS19FUShPSywgbVNhbXBsZVRhYmxlLT5nZXRNZXRhRGF0YUZvclNhbXBsZSgKLSAgICAgICAgICAgICAgICAgICAgc3luY1NhbXBsZUluZGV4LCBOVUxMLCBOVUxMLCAmc3luY1NhbXBsZVRpbWUpKTsKKyAgICAgICAgICAgIHVpbnQzMl90IHN5bmNTYW1wbGVUaW1lOworICAgICAgICAgICAgQ0hFQ0tfRVEoT0ssIG1TYW1wbGVUYWJsZS0+Z2V0TWV0YURhdGFGb3JTYW1wbGUoCisgICAgICAgICAgICAgICAgICAgICAgICBzeW5jU2FtcGxlSW5kZXgsIE5VTEwsIE5VTEwsICZzeW5jU2FtcGxlVGltZSkpOwogCi0gICAgICAgIEFMT0dJKCJzZWVrIHRvIHRpbWUgJWxsZCB1cyA9PiBzYW1wbGUgYXQgdGltZSAlbGxkIHVzLCAiCi0gICAgICAgICAgICAgInN5bmMgc2FtcGxlIGF0IHRpbWUgJWxsZCB1cyIsCi0gICAgICAgICAgICAgc2Vla1RpbWVVcywKLSAgICAgICAgICAgICBzYW1wbGVUaW1lICogMTAwMDAwMGxsIC8gbVRpbWVzY2FsZSwKLSAgICAgICAgICAgICBzeW5jU2FtcGxlVGltZSAqIDEwMDAwMDBsbCAvIG1UaW1lc2NhbGUpOworICAgICAgICAgICAgQUxPR0koInNlZWsgdG8gdGltZSAlbGxkIHVzID0+IHNhbXBsZSBhdCB0aW1lICVsbGQgdXMsICIKKyAgICAgICAgICAgICAgICAgInN5bmMgc2FtcGxlIGF0IHRpbWUgJWxsZCB1cyIsCisgICAgICAgICAgICAgICAgIHNlZWtUaW1lVXMsCisgICAgICAgICAgICAgICAgIHNhbXBsZVRpbWUgKiAxMDAwMDAwbGwgLyBtVGltZXNjYWxlLAorICAgICAgICAgICAgICAgICBzeW5jU2FtcGxlVGltZSAqIDEwMDAwMDBsbCAvIG1UaW1lc2NhbGUpOwogI2VuZGlmCiAKLSAgICAgICAgbUN1cnJlbnRTYW1wbGVJbmRleCA9IHN5bmNTYW1wbGVJbmRleDsKKyAgICAgICAgICAgIG1DdXJyZW50U2FtcGxlSW5kZXggPSBzeW5jU2FtcGxlSW5kZXg7CisgICAgICAgIH0KKwogICAgICAgICBpZiAobUJ1ZmZlciAhPSBOVUxMKSB7CiAgICAgICAgICAgICBtQnVmZmVyLT5yZWxlYXNlKCk7CiAgICAgICAgICAgICBtQnVmZmVyID0gTlVMTDsKQEAgLTQ2MTEsOSArNDY3MSwxOSBAQAogICAgIGlmIChtQnVmZmVyID09IE5VTEwpIHsKICAgICAgICAgbmV3QnVmZmVyID0gdHJ1ZTsKIAotICAgICAgICBzdGF0dXNfdCBlcnIgPQotICAgICAgICAgICAgbVNhbXBsZVRhYmxlLT5nZXRNZXRhRGF0YUZvclNhbXBsZSgKKyAgICAgICAgc3RhdHVzX3QgZXJyOworICAgICAgICBpZiAoIW1Jc0hFSUYpIHsKKyAgICAgICAgICAgIGVyciA9IG1TYW1wbGVUYWJsZS0+Z2V0TWV0YURhdGFGb3JTYW1wbGUoCiAgICAgICAgICAgICAgICAgICAgIG1DdXJyZW50U2FtcGxlSW5kZXgsICZvZmZzZXQsICZzaXplLCAmY3RzLCAmaXNTeW5jU2FtcGxlLCAmc3R0cyk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBlcnIgPSBtSXRlbVRhYmxlLT5nZXRJbWFnZU9mZnNldEFuZFNpemUoCisgICAgICAgICAgICAgICAgICAgIG9wdGlvbnMgJiYgb3B0aW9ucy0+Z2V0U2Vla1RvKCZzZWVrVGltZVVzLCAmbW9kZSkgPworICAgICAgICAgICAgICAgICAgICAgICAgICAgICZtQ3VycmVudFNhbXBsZUluZGV4IDogTlVMTCwgJm9mZnNldCwgJnNpemUpOworCisgIC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ZWlnaHQpOworICAgICAgICAgICAgfQogICAgICAgICB9CiAKICAgICAgICAgLy8gUHJldmVudCBwb3NzaWJsZSBpbnRlZ2VyIG92ZXJmbG93IGluIGRvd25zdHJlYW0gY29kZS4KQEAgLTE0MTYsNiArMTQzOCwxMiBAQAogCiAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIENPTkZJR1VSSU5HOgogICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhY3Rpb25Db2RlID09IEFDVElPTl9DT0RFX0ZBVEFMKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BbmFseXRpY3NJdGVtLT5zZXRJbnQzMihrQ29kZWNFcnJvciwgZXJyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUFuYWx5dGljc0l0ZW0tPnNldEludDMyKGtDb2RlY0Vycm9yU3RhdGUsIG1TdGF0ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsdXNoQW5hbHl0aWNzSXRlbSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbml0QW5hbHl0aWNzSXRlbSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRTdGF0ZShhY3Rpb25Db2RlID09IEFDVElPTl9DT0RFX0ZBVEFMID8KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVOSU5JVElBTElaRUQgOiBJTklUSUFMSVpFRCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CkBAIC0xNDIzLDYgKzE0NTEsMTIgQEAKIAogICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBTVEFSVElORzoKICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYWN0aW9uQ29kZSA9PSBBQ1RJT05fQ09ERV9GQVRBTCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQW5hbHl0aWNzSXRlbS0+c2V0SW50MzIoa0NvZGVjRXJyb3IsIGVycik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BbmFseXRpY3NJdGVtLT5zZXRJbnQzMihrQ29kZWNFcnJvclN0YXRlLCBtU3RhdGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbHVzaEFuYWx5dGljc0l0ZW0oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5pdEFuYWx5dGljc0l0ZW0oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0U3RhdGUoYWN0aW9uQ29kZSA9PSBBQ1RJT05fQ09ERV9GQVRBTCA/CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBVTklOSVRJQUxJWkVEIDogQ09ORklHVVJFRCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CkBAIC0xNDU5LDYgKzE0OTMsMTEgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgRkxVU0hJTkc6CiAgICAgICAgICAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFjdGlvbkNvZGUgPT0gQUNUSU9OX0NPREVfRkFUQUwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUFuYWx5dGljc0l0ZW0tPnNldEludDMyKGtDb2RlY0Vycm9yLCBlcnIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQW5hbHl0aWNzSXRlbS0+c2V0SW50MzIoa0NvZGVjRXJyb3JTdGF0ZSwgbVN0YXRlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmx1c2hBbmFseXRpY3NJdGVtKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaXRBbmFseXRpY3NJdGVtKCk7CisKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0U3RhdGUoVU5JTklUSUFMSVpFRCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0U3RhdGUoCkBAIC0xNDg3LDYgKzE1MjYsMTAgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0U3RhdGUoSU5JVElBTElaRUQpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQW5hbHl0aWNzSXRlbS0+c2V0SW50MzIoa0NvZGVjRXJyb3IsIGVycik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BbmFseXRpY3NJdGVtLT5zZXRJbnQzMihrQ29kZWNFcnJvclN0YXRlLCBtU3RhdGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbHVzaEFuYWx5dGljc0l0ZW0oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5pdEFuYWx5dGljc0l0ZW0oKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0U3RhdGUoVU5JTklUSUFMSVpFRCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KQEAgLTE1OTEsNiArMTYzNCwxOSBAQAogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIHNldFN0YXRlKENPTkZJR1VSRUQpOwogICAgICAgICAgICAgICAgICAgICAobmV3IEFNZXNzYWdlKS0+cG9zdFJlcGx5KG1SZXBseUlEKTsKKworICAgICAgICAgICAgICAgICAgICAvLyBhdWdtZW50IG91ciBtZWRpYSBtZXRyaWNzIGluZm8sIG5vdyB0aGF0IHdlIGtub3cgbW9yZSB0aGluZ3MKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1BbmFseXRpY3NJdGVtICE9IE5VTEwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNwPEFNZXNzYWdlPiBmb3JtYXQ7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUNvbmZpZ3VyZU1zZyAhPSBOVUxMICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUNvbmZpZ3VyZU1zZy0+ZmluZE1lc3NhZ2UoImZvcm1hdCIsICZmb3JtYXQpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZvcm1hdCBpbmNsdWRlczogbWltZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBU3RyaW5nIG1pbWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmb3JtYXQtPmZpbmRTdHJpbmcoIm1pbWUiLCAmbWltZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BbmFseXRpY3NJdGVtLT5zZXRDU3RyaW5nKGtDb2RlY01pbWUsIG1pbWUuY19zdHIoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgfQogCkBAIC0yODE2LDYgKzI4NzIsOSBAQAogICAgICAgICBNdXRleDo6QXV0b2xvY2sgYWwobUJ1ZmZlckxvY2spOwogICAgICAgICBpbmZvLT5tT3duZWRCeUNsaWVudCA9IGZhbHNlOwogICAgICAgICBpbmZvLT5tRGF0YS5jbGVhcigpOworICAgICAgICBpZiAobUFuYWx5dGljc0l0ZW0gIT0gTlVMTCkgeworICAgICAgICAgICAgbUFuYWx5dGljc0l0ZW0tPmFkZEludDY0KGtDb2RlY0J5dGVzSW4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tSW5pdENoZWNrICE9IE9LKSB7Ci0gICAgICAgIHJldHVybjsgIC8vIHRoaXMgbWF5IGZhaWwgaWYgSU1lZGlhUGxheWVyU2VydmljZSBpcyBub3QgYXZhaWxhYmxlLgotICAgIH0KLSAgICBwYXJzZVhNTEZpbGUoY29kZWNzX3htbCk7Ci0KLSAgICBpZiAobUluaXRDaGVjayAhPSBPSykgewotICAgICAgICBpZiAoaWdub3JlX2Vycm9ycykgewotICAgICAgICAgICAgbUluaXRDaGVjayA9IE9LOwotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0gICAgICAgIG1Db2RlY0luZm9zLmNsZWFyKCk7Ci0gICAgICAgIHJldHVybjsKLSAgICB9Ci0KLSAgICBWZWN0b3I8TWVkaWFSZXNvdXJjZVBvbGljeT4gcG9saWNpZXM7Ci0gICAgQVN0cmluZyB2YWx1ZTsKLSAgICBpZiAobUdsb2JhbFNldHRpbmdzLT5maW5kU3RyaW5nKGtQb2xpY3lTdXBwb3J0c011bHRpcGxlU2VjdXJlQ29kZWNzLCAmdmFsdWUpKSB7Ci0gICAgICAgIHBvbGljaWVzLnB1c2hfYmFjaygKLSAgICAgICAgICAgICAgICBNZWRpYVJlc291cmNlUG9saWN5KAotICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nOChrUG9saWN5U3VwcG9ydHNNdWx0aXBsZVNlY3VyZUNvZGVjcyksCi0gICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmc4KHZhbHVlLmNfc3RyKCkpKSk7Ci0gICAgfQotICAgIGlmIChtR2xvYmFsU2V0dGluZ3MtPmZpbmRTdHJpbmcoa1BvbGljeVN1cHBvcnRzU2VjdXJlV2l0aE5vblNlY3VyZUNvZGVjLCAmdmFsdWUpKSB7Ci0gICAgICAgIHBvbGljaWVzLnB1c2hfYmFjaygKLSAgICAgICAgICAgICAgICBNZWRpYVJlc291cmNlUG9saWN5KAotICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nOChrUG9saWN5U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ZGlhPyIsCi0gICAgICAgICAgICAgICAgICBpbmZvLm1OYW1lLmNfc3RyKCkpOwotCi0gICAgICAgICAgICBtQ29kZWNJbmZvcy5yZW1vdmVBdChpKTsKLSNpZiBMT0dfTkRFQlVHID09IDAKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGZvciAoc2l6ZV90IHR5cGVfaXggPSAwOyB0eXBlX2l4IDwgaW5mby5tQ2Fwcy5zaXplKCk7ICsrdHlwZV9peCkgewotICAgICAgICAgICAgICAgIEFTdHJpbmcgbWltZSA9IGluZm8ubUNhcHMua2V5QXQodHlwZV9peCk7Ci0gICAgICAgICAgICAgICAgY29uc3Qgc3A8TWVkaWFDb2RlY0luZm86OkNhcGFiaWxpdGllcz4gJmNhcHMgPSBpbmZvLm1DYXBzLnZhbHVlQXQodHlwZV9peCk7Ci0KLSAgICAgICAgICAgICAgICBBTE9HVigiJXMgY29kZWMgaW5mbyBmb3IgJXM6ICVzIiwgaW5mby5tTmFtZS5jX3N0cigpLCBtaW1lLmNfc3RyKCksCi0gICAgICAgICAgICAgICAgICAgICAgICBjYXBzLT5nZXREZXRhaWxzKCktPmRlYnVnU3RyaW5nKCkuY19zdHIoKSk7Ci0gICAgICAgICAgICAgICAgQUxPR1YoIiAgICBmbGFncz0lZCIsIGNhcHMtPmdldEZsYWdzKCkpOwotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgVmVjdG9yPHVpbnQzMl90PiBjb2xvckZvcm1hdHM7Ci0gICAgICAgICAgICAgICAgICAgIGNhcHMtPmdldFN1cHBvcnRlZENvbG9yRm9ybWF0cygmY29sb3JGb3JtYXRzKTsKLSAgICAgICAgICAgICAgICAgICAgQVN0cmluZyBuaWNlOwotICAgICAgICAgICAgICAgICAgICBmb3IgKHNpemVfdCBpeCA9IDA7IGl4IDwgY29sb3JGb3JtYXRzLnNpemUoKTsgaXgrKykgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGl4ID4gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5pY2UuYXBwZW5kKCIsICIpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgbmljZS5hcHBlbmQoY29sb3JGb3JtYXRzLml0ZW1BdChpeCkpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dWKCIgICAgY29sb3JzPVslc10iLCBuaWNlLmNfc3RyKCkpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIFZlY3RvcjxNZWRpYUNvZGVjSW5mbzo6UHJvZmlsZUxldmVsPiBwcm9maWxlTGV2ZWxzOwotICAgICAgICAgICAgICAgICAgICBjYXBzLT5nZXRTdXBwb3J0ZWRQcm9maWxlTGV2ZWxzKCZwcm9maWxlTGV2ZWxzKTsKLSAgICAgICAgICAgICAgICAgICAgQVN0cmluZyBuaWNlOwotICAgICAgICAgICAgICAgICAgICBmb3IgKHNpemVfdCBpeCA9IDA7IGl4IDwgcHJvZmlsZUxldmVscy5zaXplKCk7IGl4KyspIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpeCA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBuaWNlLmFwcGVuZCgiLCAiKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IE1lZGlhQ29kZWNJbmZvOjpQcm9maWxlTGV2ZWwgJnBsID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9maWxlTGV2ZWxzLml0ZW1BdChpeCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBuaWNlLmFwcGVuZChwbC5tUHJvZmlsZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBuaWNlLmFwcGVuZCgiLyIpOwotICAgICAgICAgICAgICAgICAgICAgICAgbmljZS5hcHBlbmQocGwubUxldmVsKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBBTE9HVigiICAgIGxldmVscz1bJXNdIiwgbmljZS5jX3N0cigpKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBBU3RyaW5nIHF1aXJrczsKLSAgICAgICAgICAgICAgICAgICAgZm9yIChzaXplX3QgaXggPSAwOyBpeCA8IGluZm8ubVF1aXJrcy5zaXplKCk7IGl4KyspIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpeCA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWlya3MuYXBwZW5kKCIsICIpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgcXVpcmtzLmFwcGVuZChpbmZvLm1RdWlya3NbaXhdKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBBTE9HVigiICAgIHF1aXJrcz1bJXNdIiwgcXVpcmtzLmNfc3RyKCkpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSNlbmRpZgotICAgICAgICB9Ci0gICAgfQotCi0jaWYgMAotICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgbUNvZGVjSW5mb3Muc2l6ZSgpOyArK2kpIHsKLSAgICAgICAgY29uc3QgQ29kZWNJbmZvICZpbmZvID0gbUNvZGVjSW5mb3MuaXRlbUF0KGkpOwotCi0gICAgICAgIEFTdHJpbmcgbGluZSA9IGluZm8ubU5hbWU7Ci0gICAgICAgIGxpbmUuYXBwZW5kKCIgc3VwcG9ydHMgIik7Ci0gICAgICAgIGZvciAoc2l6ZV90IGogPSAwOyBqIDwgbVR5cGVzLnNpemUoKTsgKytqKSB7Ci0gICAgICAgICAgICB1aW50MzJfdCB2YWx1ZSA9IG1UeXBlcy52YWx1ZUF0KGopOwotCi0gICAgICAgICAgICBpZiAoaW5mby5tVHlwZX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nhc3Q8TWVkaWFDb2RlY0xpc3QgKj4obWUpLT5lbmRFbGVtZW50SGFuZGxlcihuYW1lKTsKLX0KLQotc3RhdHVzX3QgTWVkaWFDb2RlY0xpc3Q6OmluY2x1ZGVYTUxGaWxlKGNvbnN0IGNoYXIgKiphdHRycykgewotICAgIGNvbnN0IGNoYXIgKmhyZWYgPSBOVUxMOwotICAgIHNpemVfdCBpID0gMDsKLSAgICB3aGlsZSAoYXR0cnNbaV0gIT0gTlVMTCkgewotICAgICAgICBpZiAoIXN0cmNtcChhdHRyc1tpXSwgImhyZWYiKSkgewotICAgICAgICAgICAgaWYgKGF0dHJzW2kgKyAxXSA9PSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBocmVmID0gYXR0cnNbaSArIDFdOwotICAgICAgICAgICAgKytpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgIH0KLSAgICAgICAgKytpOwotICAgIH0KLQotICAgIC8vIEZvciBzZWN1cml0eSByZWFzb25zIGFuZCBmb3Igc2ltcGxpY2l0eSwgZmlsZSBuYW1lcyBjYW4gb25seSBjb250YWluCi0gICAgLy8gW2EtekEtWjAtOV8uXSBhbmQgbXVzdCBzdGFydCB3aXRoICBtZWRpYV9jb2RlY3NfIGFuZCBlbmQgd2l0aCAueG1sCi0gICAgZm9yIChpID0gMDsgaHJlZltpXSAhPSAnXDAnOyBpKyspIHsKLSAgICAgICAgaWYgKGhyZWZbaV0gPT0gJy4nIHx8IGhyZWZbaV0gPT0gJ18nIHx8Ci0gICAgICAgICAgICAgICAgKGhyZWZbaV0gPj0gJzAnICYmIGhyZWZbaV0gPD0gJzknKSB8fAotICAgICAgICAgICAgICAgIChocmVmW2ldID49ICdBJyAmJiBocmVmW2ldIDw9ICdaJykgfHwKLSAgICAgICAgICAgICAgICAoaHJlZltpXSA+PSAnYSc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TkNMVURFOwotICAgICAgICB9Ci0gICAgICAgICsrbURlcHRoOwotICAgICAgICByZXR1cm47Ci0gICAgfQotCi0gICAgc3dpdGNoIChtQ3VycmVudFNlY3Rpb24pIHsKLSAgICAgICAgY2FzZSBTRUNUSU9OX1RPUExFVkVMOgotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoIXN0cmNtcChuYW1lLCAiRGVjb2RlcnMiKSkgewotICAgICAgICAgICAgICAgIG1DdXJyZW50U2VjdGlvbiA9IFNFQ1RJT05fREVDT0RFUlM7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKCFzdHJjbXAobmFtZSwgIkVuY29kZXJzIikpIHsKLSAgICAgICAgICAgICAgICBtQ3VycmVudFNlY3Rpb24gPSBTRUNUSU9OX0VOQ09ERVJTOwotICAgICAgICAgICAgfSBlbHNlIGlmICghc3RyY21wKG5hbWUsICJTZXR0aW5ncyIpKSB7Ci0gICAgICAgICAgICAgICAgbUN1cnJlbnRTZWN0aW9uID0gU0VDVElPTl9TRVRUSU5HUzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBTRUNUSU9OX1NFVFRJTkdTOgotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoIXN0cmNtcChuYW1lLCAiU2V0dGluZyIpKSB7Ci0gICAgICAgICAgICAgICAgbUluaXRDaGVjayA9IGFkZFNldHRpbmdGcm9tQXR0cmlidXRlcyhhdHRycyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgU0VDVElPTl9ERUNPREVSUzoKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKCFzdHJjbXAobmFtZSwgIk1lZGlhQ29kZWMiKSkgewotICAgICAgICAgICAgICAgIG1Jbml0Q2hlY2sgPQotICAgICAgICAgICAgICAgICAgICBhZGRNZWRpYUNvZGVjRnJvbUF0dHJpYnV0ZXMoZmFsc2UgLyogZW5jb2RlciAqLywgYXR0cnMpOwotCi0gICAgICAgICAgICAgICAgbUN1cnJlbnRTZWN0aW9uID0gU0VDVElPTl9ERUNPREVSOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIFNFQ1RJT05fRU5DT0RFUlM6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICghc3RyY21wKG5hbWUsICJNZWRpYUNvZGVjIikpIHsKLSAgICAgICAgICAgICAgICBtSW5pdENoZWNrID0KLSAgICAgICAgICAgICAgICAgICAgYWRkTWVkaWFDb2RlY0Zyb21BdHRyaWJ1dGVzKHRydWUgLyogZW5jb2RlciAqLywgYXR0cnMpOwotCi0gICAgICAgICAgICAgICAgbUN1cnJlbnRTZWN0aW9uID0gU0VDVElPTl9FTkNPREVSOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIFNFQ1RJT05fREVDT0RFUjoKLSAgICAgICAgY2FzZSBTRUNUSU9OX0VOQ09ERVI6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICghc3RyY21wKG5hbWUsICJRdWlyayIpKSB7Ci0gICAgICAgICAgICAgICAgbUluaXRDaGVjayA9IGFkZFF1aXJrKGF0dHJzKTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAoIXN0cmNtcChuYW1lLCAiVHlwZSIpKSB7Ci0gICAgICAgICAgICAgICAgbUluaXRDaGVjayA9IGFkZFR5cGVGcm9tQXR0cmlidXRlcyhhdHRycyk7Ci0gICAgICAgICAgICAgICAgbUN1cnJlbnRTZWN0aW9uID0KLSAgICAgICAgICAgICAgICAgICAgKG1DdXJyZW50U2VjdGlvbiA9PSBTRUNUSU9OX0RFQ09ERVIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFNFQ1RJT05fREVDT0RFUl9UWVBFIDogU0VDVElPTl9FTkNPREVSX1RZUEUpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGluVHlwZSA9IGZhbHNlOwotICAgICAgICAvLyBmYWxsIHRocm91Z2gKLQotICAgICAgICBjYXNlIFNFQ1RJT05fREVDT0RFUl9UWVBFOgotICAgICAgICBjYXNlIFNFQ1RJT05fRU5DT0RFUl9UWVBFOgotICAgICAgICB7Ci0gICAgICAgICAgICAvLyBpZ25vcmUgbGltaXRzIGFuZCBmZWF0dXJlcyBzcGVjaWZpZWQgb3V0c2lkZSBvZiB0eXBlCi0gICAgICAgICAgICBib29sIG91dHNpZGUgPSAhaW5UeXBlICYmICFtQ3VycmVudEluZm8tPm1IYXNTb2xlTWltZTsKLSAgICAgICAgICAgIGlmIChvdXRzaWRlICYmICghc3RyY21wKG5hbWUsICJMaW1pdCIpIHx8ICFzdHJjbXAobmFtZSwgIkZlYXR1cmUiKSkpIHsKLSAgICAgICAgICAgICAgICBBTE9HVygiaWdub3JpbmcgJXMgc3BlY2lmaWVkIG91dHNpZGUgb2YgYSBUeXBlIiwgbmFtZSk7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKCFzdHJjbXAobmFtZSwgIkxpbWl0IikpIHsKLSAgICAgICAgICAgICAgICBtSW5pdENoZWNrID0gYWRkTGltaXQoYXR0cnMpOwotICAgICAgICAgICAgfSBlbHNlIGlmICghc3RyY21wKG5hbWUsICJGZWF0dXJlIikpIHsKLSAgICAgICAgICAgICAgICBtSW5pdENoZWNrID0gYWRkRmVhdHVyZShhdHRycyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICBicmVhazsKLSAgICB9Ci0KLSAgICArK21EZXB0aDsKLX0KLQotdm9pZCBNZWRpYUNvZGVjTGlzdDo6ZW5kRWxlbWVudEhhbmRsZXIoY29uc3QgY2hhciAqbmFtZSkgewotICAgIGlmIChtSW5pdENoZWNrICE9IE9LKSB7Ci0gICAgICAgIHJldHVybjsKLSAgICB9Ci0KLSAgICBzd2l0Y2ggKG1DdXJyZW50U2VjdGlvbikgewotICAgICAgICBjYXNlIFNFQ1RJT05fU0VUVElOR1M6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICghc3RyY21wKG5hbWUsICJTZXR0aW5ncyIpKSB7Ci0gICAgICAgICAgICAgICAgbUN1cnJlbnRTZWN0aW9uID0gU0VDVElPTl9UT1BMRVZFTDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBTRUNUSU9OX0RFQ09ERVJTOgotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoIXN0cmNtcChuYW1lLCAiRGVjb2RlcnMiKSkgewotICAgICAgICAgICAgICAgIG1DdXJyZW50U2VjdGlvbiA9IFNFQ1RJT05fVE9QTEVWRUw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgU0VDVElPTl9FTkNPREVSUzoKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKCFzdHJjbXAobmFtZSwgIkVuY29kZXJzIikpIHsKLSAgICAgICAgICAgICAgICBtQ3VycmVudFNlY3Rpb24gPSBTRUNUSU9OX1RPUExFVkVMOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIFNFQ1RJT05fREVDT0RFUl9UWVBFOgotICAgICAgICBjYXNlIFNFQ1RJT05fRU5DT0RFUl9UWVBFOgotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoIXN0cmNtcChuYW1lLCAiVHlwZSIpKSB7Ci0gICAgICAgICAgICAgICAgbUN1cnJlbnRTZWN0aW9uID0KLSAgICAgICAgICAgICAgICAgICAgKG1DdXJyZW50U2VjdGlvbiA9PSBTRUNUSU9OX0RFQ09ERVJfVFlQRQotICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gU0VDVElPTl9ERUNPREVSIDogU0VDVElPTl9FTkNPREVSKTsKLQotICAgICAgICAgICAgICAgIG1DdXJyZW50SW5mby0+Y29tcGxldGUoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBTRUNUSU9OX0RFQ09ERVI6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICghc3RyY21wKG5hbWUsICJNZWRpYUNvZGVjIikpIHsKLSAgICAgICAgICAgICAgICBtQ3VycmVudFNlY3Rpb24gPSBTRUNUSU9OX0RFQ09ERVJTOwotICAgICAgICAgICAgICAgIG1DdXJyZW50SW5mby0+Y29tcGxldGUoKTsKLSAgICAgICAgICAgICAgICBtQ3VycmVudEluZm8gPSBOVUxMOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIFNFQ1RJT05fRU5DT0RFUjoKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKCFzdHJjbXAobmFtZSwgIk1lZGlhQ29kZWMiKSkgewotICAgICAgICAgICAgICAgIG1DdXJyZW50U2VjdGlvbiA9IFNFQ1RJT05fRU5DT0RFUlM7Ci0gICAgICAgICAgICAgICAgbUN1cnJlbnRJbmZvLT5jb21wbGV0ZSgpOzsKLSAgICAgICAgICAgICAgICBtQ3VycmVudEluZm8gPSBOVUxMOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIFNFQ1RJT05fSU5DTFVERToKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKCFzdHJjbXAobmFtZSwgIkluY2x1ZGUiKSAmJiBtUGFzdFNlY3Rpb25zLnNpemUoKSA+IDApIHsKLSAgICAgICAgICAgICAgICBtQ3VycmVudFNlY3Rpb24gPSBtUGFzdFNlY3Rpb25zLnRvcCgpOwotICAgICAgICAgICAgICAgIG1QYXN0U2VjdGlvbnMucG9wKCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICBicmVhazsKLSAgICB9Ci0KLSAgICAtLW1EZXB0aDsKLX0KLQotc3RhdHVzX3QgTWVkaWFDb2RlY0xpc3Q6OmFkZFNldHRpbmdGcm9tQXR0cmlidXRlcyhjb25zdCBjaGFyICoqYXR0cnMpIHsKLSAgICBjb25zdCBjaGFyICpuYW1lID0gTlVMTDsKLSAgICBjb25zdCBjaGFyICp2YWx1ZSA9IE5VTEw7Ci0gICAgY29uc3QgY2hhciAqdXBkYXRlID0gTlVMTDsKLQotICAgIHNpemVfdCBpID0gMDsKLSAgICB3aGlsZSAoYXR0cnNbaV0gIT0gTlVMTCkgewotICAgICAgICBpZiAoIXN0cmNtcChhdHRyc1tpXSwgIm5hbWUiKSkgewotICAgICAgICAgICAgaWYgKGF0dHJzW2kgKyAxXSA9PSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBuYW1lID0gYXR0cnNbaSArIDFdOwotICAgICAgICAgICAgKytpOwotICAgICAgICB9IGVsc2UgaWYgKCFzdHJjbXAoYXR0cnNbaV0sICJ2YWx1ZSIpKSB7Ci0gICAgICAgICAgICBpZiAoYXR0cnNbaSArIDFdID09IE5VTEwpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHZhbHVlID0gYXR0cnNbaSArIDFdOwotICAgICAgICAgICAgKytpOwotICAgICAgICB9IGVsc2UgaWYgKCFzdHJjbXAoYXR0cnNbaV0sICJ1cGRhdGUiKSkgewotICAgICAgICAgICAgaWYgKGF0dHJzW2kgKyAxXSA9PSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIC1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QXR0cmlidXRlcygKLSAgICAgICAgYm9vbCBlbmNvZGVyLCBjb25zdCBjaGFyICoqYXR0cnMpIHsKLSAgICBjb25zdCBjaGFyICpuYW1lID0gTlVMTDsKLSAgICBjb25zdCBjaGFyICp0eXBlID0gTlVMTDsKLSAgICBjb25zdCBjaGFyICp1cGRhdGUgPSBOVUxMOwotCi0gICAgc2l6ZV90IGkgPSAwOwotICAgIHdoaWxlIChhdHRyc1tpXSAhPSBOVUxMKSB7Ci0gICAgICAgIGlmICghc3RyY21wKGF0dHJzW2ldLCAibmFtZSIpKSB7Ci0gICAgICAgICAgICBpZiAoYXR0cnNbaSArIDFdID09IE5VTEwpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG5hbWUgPSBhdHRyc1tpICsgMV07Ci0gICAgICAgICAgICArK2k7Ci0gICAgICAgIH0gZWxzZSBpZiAoIXN0cmNtcChhdHRyc1tpXSwgInR5cGUiKSkgewotICAgICAgICAgICAgaWYgKGF0dHJzW2kgKyAxXSA9PSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICB0eXBlID0gYXR0cnNbaSArIDFdOwotICAgICAgICAgICAgKytpOwotICAgICAgICB9IGVsc2UgaWYgKCFzdHJjbXAoYXR0cnNbaV0sICJ1cGRhdGUiKSkgewotICAgICAgICAgICAgaWYgKGF0dHJzW2kgKyAxXSA9PSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICB1cGRhdGUgPSBhdHRyc1tpICsgMV07Ci0gICAgICAgICAgICArK2k7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgfQotCi0gICAgICAgICsraTsKLSAgICB9Ci0KLSAgICBpZiAobmFtZSA9PSBOVUxMKSB7Ci0gICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgIH0KLQotICAgIG1VcGRhdGUgPSAodXBkYXRlICE9IE5VTEwpICYmIHBhcnNlQm9vbGVhbih1cGRhdGUpOwotICAgIHNzaXplX3QgaW5kZXggPSAtMTsKLSAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IG1Db2RlY0luZm9zLnNpemUoKTsgKytpKSB7Ci0gICAgICAgIGlmIChBU3RyaW5nKG5hbWUpID09IG1Db2RlY0luZm9zW2ldLT5nZXRDb2RlY05hbWUoKSkgewotICAgICAgICAgICAgaW5kZXggPSBpOwotICAgICAgICB9Ci0gICAgfQotICAgIGlmIChtVXBkYXRlICE9IChpbmRleCA+PSAwKSkgewotICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICB9Ci0KLSAgICBpZiAoaW5kZXggPj0gMCkgewotICAgICAgICAvLyBleGlzdGluZyBjb2RlYwotICAgICAgICBtQ3VycmVudEluZm8gPSBtQ29kZWNJbmZvcy5lZGl0SXRlbUF0KGluZGV4KTsKLSAgICAgICAgaWYgKHR5cGUgIT0gTlVMTCkgewotICAgICAgICAgICAgLy8gZXhpc3RpbmcgdHlwZQotICAgICAgICAgICAgaWYgKG1Db2RlY0luZm9zW2luZGV4XS0+Z2V0Q2FwYWJpbGl0aWVzRm9yKHR5cGUpID09IE5VTEwpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG1DdXJyZW50SW5mby0+dXBkYXRlTWltZSh0eXBlKTsKLSAgICAgICAgfQotICAgIH0gZWxzZSB7Ci0gICAgICAgIC8vIG5ldyBjb2RlYwotICAgICAgICBtQ3VycmVudEluZm8gPSBuZXcgTWVkaWFDb2RlY0luZm8obmFtZSwgZW5jb2RlciwgdHlwZSk7Ci0gICAgICAgIC8vIFRoZSBuZXh0IHN0ZXAgaW52b2x2ZXMgdHJ5aW5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yA9PSBOVUxMKSB7Ci0gICAgICAgIEFMT0dFKCJNZWRpYUNvZGVjOjpRdWVyeUNhcGFiaWxpdGllcyByZXR1cm5lZCBPSyBidXQgbm8gY2FwYWJpbGl0aWVzIGZvciAnJXMnOiclcyc6JyVzJyIsCi0gICAgICAgICAgICAgICAgbUN1cnJlbnRJbmZvLT5tTmFtZS5jX3N0cigpLCB0eXBlLAotICAgICAgICAgICAgICAgIG1DdXJyZW50SW5mby0+bUlzRW5jb2RlciA/ICJlbmNvZGVyIiA6ICJkZWNvZGVyIik7Ci0gICAgICAgIHJldHVybiBVTktOT1dOX0VSUk9SOwotICAgIH0KLQotICAgIHJldHVybiBtQ3VycmVudEluZm8tPmluaXRpYWxpemVDYXBhYmlsaXRpZXMoY2Fwcyk7Ci19Ci0KLXN0YXR1c190IE1lZGlhQ29kZWNMaXN0OjphZGRRdWlyayhjb25zdCBjaGFyICoqYXR0cnMpIHsKLSAgICBjb25zdCBjaGFyICpuYW1lID0gTlVMTDsKLQotICAgIHNpemVfdCBpID0gMDsKLSAgICB3aGlsZSAoYXR0cnNbaV0gIT0gTlVMTCkgewotICAgICAgICBpZiAoIXN0cmNtcChhdHRyc1tpXSwgIm5hbWUiKSkgewotICAgICAgICAgICAgaWYgKGF0dHJzW2kgKyAxXSA9PSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBuYW1lID0gYXR0cnNbaSArIDFdOwotICAgICAgICAgICAgKytpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgIH0KLQotICAgICAgICArK2k7Ci0gICAgfQotCi0gICAgaWYgKG5hbWUgPT0gTlVMTCkgewotICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICB9Ci0KLSAgICBtQ3VycmVudEluZm8tPmFkZFF1aXJrKG5hbWUpOwotICAgIHJldHVybiBPSzsKLX0KLQotc3RhdHVzX3QgTWVkaWFDb2RlY0xpc3Q6OmFkZFR5cGVGcm9tQXR0cmlidXRlcyhjb25zdCBjaGFyICoqYXR0cnMpIHsKLSAgICBjb25zdCBjaGFyICpuYW1lID0gTlVMTDsKLSAgICBjb25zdCBjaGFyICp1cGRhdGUgPSBOVUxMOwotCi0gICAgc2l6ZV90IGkgPSAwOwotICAgIHdoaWxlIChhdHRyc1tpXSAhPSBOVUxMKSB7Ci0gICAgICAgIGlmICghc3RyY21wKGF0dHJzW2ldLCAibmFtZSIpKSB7Ci0gICAgICAgICAgICBpZiAoYXR0cnNbaSArIDFdID09IE5VTEwpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG5hbWUgPSBhdHRyc1tpICsgMV07Ci0gICAgICAgICAgICArK2k7Ci0gICAgICAgIH0gZWxzZSBpZiAoIXN0cmNtcChhdHRyc1tpXSwgInVwZGF0ZSIpKSB7Ci0gICAgICAgICAgICBpZiAoYXR0cnNbaSArIDFdID09IE5VTEwpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHVwZGF0ZSA9IGF0dHJzW2kgKyAxXTsKLSAgICAgICAgICAgICsraTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICB9Ci0KLSAgICAgICAgKytpOwotICAgIH0KLQotICAgIGlmIChuYW1lID09IE5VTEwpIHsKLSAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgfQotCi0gICAgYm9vbCBpc0V4aXN0aW5nVHlwZSA9IChtQ3VycmVudEluZm8tPmdldENhcGFiaWxpdGllc0ZvcihuYW1lKSAhPSBOVUxMKTsKLSAgICBpZiAobVVwZGF0ZSAhPSBpc0V4aXN0aW5nVHlwZSkgewotICAgICAgICByZXR1cm4gLUVJTlZBTDsK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WluKTsKLSAgICAgICAgfSBlbHNlIGlmIChtc2ctPmNvbnRhaW5zKCJtaW4iKSB8fCBtc2ctPmNvbnRhaW5zKCJtYXgiKSkgewotICAgICAgICAgICAgcmV0dXJuIGxpbWl0RXJyb3IobmFtZSwgImhhcyBvbmx5ICdtaW4nIG9yICdtYXgnIGF0dHJpYnV0ZSIpOwotICAgICAgICB9IGVsc2UgaWYgKG1zZy0+ZmluZFN0cmluZygidmFsdWUiLCAmbWF4KSkgewotICAgICAgICAgICAgbWluID0gbWF4OwotICAgICAgICAgICAgbWluLmFwcGVuZCgiLSIpOwotICAgICAgICAgICAgbWluLmFwcGVuZChtYXgpOwotICAgICAgICAgICAgaWYgKG1zZy0+Y29udGFpbnMoInJhbmdlIikpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gbGltaXRFcnJvcihuYW1lLCAiaGFzIGJvdGggJ3JhbmdlJyBhbmQgJ3ZhbHVlJyBhdHRyaWJ1dGVzIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBtc2ctPnNldFN0cmluZygicmFuZ2UiLCBtaW4pOwotICAgICAgICB9Ci0KLSAgICAgICAgQVN0cmluZyByYW5nZSwgc2NhbGUgPSAibGluZWFyIiwgZGVmLCBpbl87Ci0gICAgICAgIGlmICghbXNnLT5maW5kU3RyaW5nKCJyYW5nZSIsICZyYW5nZSkpIHsKLSAgICAgICAgICAgIHJldHVybiBsaW1pdEVycm9yKG5hbWUsICJ3aXRoIG5vICdyYW5nZScsICd2YWx1ZScgb3IgJ21pbicvJ21heCcgYXR0cmlidXRlcyIpOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKChuYW1lID09ICJxdWFsaXR5IiB8fCBuYW1lID09ICJjb21wbGV4aXR5IikgXgotICAgICAgICAgICAgICAgIChmb3VuZCA9IG1zZy0+ZmluZFN0cmluZygiZGVmYXVsdCIsICZkZWYpKSkgewotICAgICAgICAgICAgcmV0dXJuIGxpbWl0Rm91bmRNaXNzaW5nQXR0cihuYW1lLCAiZGVmYXVsdCIsIGZvdW5kKTsKLSAgICAgICAgfQotICAgICAgICBpZiAobmFtZSAhPSAicXVhbGl0eSIgJiYgbXNnLT5maW5kU3RyaW5nKCJzY2FsZSIsICZzY2FsZSkpIHsKLSAgICAgICAgICAgIHJldHVybiBsaW1pdEZvdW5kTWlzc2luZ0F0dHIobmFtZSwgInNjYWxlIik7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKChuYW1lID09ICJhc3BlY3QtcmF0aW8iKSBeIChmb3VuZCA9IG1zZy0+ZmluZFN0cmluZygiaW4iLCAmaW5fKSkpIHsKLSAgICAgICAgICAgIHJldHVybiBsaW1pdEZvdW5kTWlzc2luZ0F0dHIobmFtZSwgImluIiwgZm91bmQpOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKG5hbWUgPT0gImFzcGVjdC1yYXRpbyIpIHsKLSAgICAgICAgICAgIGlmICghKGluXyA9PSAicGl4ZWxzIikgJiYgIShpbl8gPT0gImJsb2NrcyIpKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGxpbWl0SW52YWxpZEF0dHIobmFtZSwgImluIiwgaW5fKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGluXy5lcmFzZSg1LCAxKTsgLy8gKHBpeGVsfGJsb2NrKS1hc3BlY3QtcmF0aW8KLSAgICAgICAgICAgIGluXy5hcHBlbmQoIi0iKTsKLSAgICAgICAgICAgIGluXy5hcHBlbmQobmFtZSk7Ci0gICAgICAgICAgICBuYW1lID0gaW5fOwotICAgICAgICB9Ci0gICAgICAgIGlmIChuYW1lID09ICJxdWFsaXR5IikgewotICAgICAgICAgICAgbUN1cnJlbnRJbmZvLT5hZGREZXRhaWwoInF1YWxpdHktc2NhbGUiLCBzY2FsZSk7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKG5hbWUgPT0gInF1YWxpdHkiIHx8IG5hbWUgPT0gImNvbXBsZXhpdHkiKSB7Ci0gICAgICAgICAgICBBU3RyaW5nI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LmFwcGVuZCgiLXJhbmdlcyIpOwotICAgICAgICAgICAgbUN1cnJlbnRJbmZvLT5hZGREZXRhaWwodGFnLCByYW5nZXMpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgQUxPR1coIklnbm9yaW5nIHVucmVjb2duaXplZCBsaW1pdCAnJXMnIiwgbmFtZS5jX3N0cigpKTsKLSAgICAgICAgfQotICAgIH0KLSAgICByZXR1cm4gT0s7Ci19Ci0KLXN0YXR1c190IE1lZGlhQ29kZWNMaXN0OjphZGRGZWF0dXJlKGNvbnN0IGNoYXIgKiphdHRycykgewotICAgIHNpemVfdCBpID0gMDsKLSAgICBjb25zdCBjaGFyICpuYW1lID0gTlVMTDsKLSAgICBpbnQzMl90IG9wdGlvbmFsID0gLTE7Ci0gICAgaW50MzJfdCByZXF1aXJlZCA9IC0xOwotICAgIGNvbnN0IGNoYXIgKnZhbHVlID0gTlVMTDsKLQotICAgIHdoaWxlIChhdHRyc1tpXSAhPSBOVUxMKSB7Ci0gICAgICAgIGlmIChhdHRyc1tpICsgMV0gPT0gTlVMTCkgewotICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgIH0KLQotICAgICAgICAvLyBhdHRyaWJ1dGVzIHdpdGggdmFsdWVzCi0gICAgICAgIGlmICghc3RyY21wKGF0dHJzW2ldLCAibmFtZSIpKSB7Ci0gICAgICAgICAgICBuYW1lID0gYXR0cnNbaSArIDFdOwotICAgICAgICAgICAgKytpOwotICAgICAgICB9IGVsc2UgaWYgKCFzdHJjbXAoYXR0cnNbaV0sICJvcHRpb25hbCIpIHx8ICFzdHJjbXAoYXR0cnNbaV0sICJyZXF1aXJlZCIpKSB7Ci0gICAgICAgICAgICBpbnQgdmFsdWUgPSAoaW50KXBhcnNlQm9vbGVhbihhdHRyc1tpICsgMV0pOwotICAgICAgICAgICAgaWYgKCFzdHJjbXAoYXR0cnNbaV0sICJvcHRpb25hbCIpKSB7Ci0gICAgICAgICAgICAgICAgb3B0aW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iBsaXN0ID0gZ2V0SW5zdGFuY2UoKTsKLSAgICBpZiAobGlzdCA9PSBOVUxMKSB7CisgICAgaWYgKGxpc3QgPT0gbnVsbHB0cikgewogICAgICAgICByZXR1cm47CiAgICAgfQogCkBAIC0xMTg3LDQ1ICszMDUsMjcgQEAKICAgICAgICAgaW5kZXggPSBtYXRjaEluZGV4ICsgMTsKIAogICAgICAgICBjb25zdCBzcDxNZWRpYUNvZGVjSW5mbz4gaW5mbyA9IGxpc3QtPmdldENvZGVjSW5mbyhtYXRjaEluZGV4KTsKLSAgICAgICAgQ0hFQ0soaW5mbyAhPSBOVUxMKTsKKyAgICAgICAgQ0hFQ0soaW5mbyAhPSBudWxscHRyKTsKICAgICAgICAgQVN0cmluZyBjb21wb25lbnROYW1lID0gaW5mby0+Z2V0Q29kZWNOYW1lKCk7CiAKICAgICAgICAgaWYgKChmbGFncyAmIGtIYXJkd2FyZUNvZGVjc09ubHkpICYmIGlzU29mdHdhcmVDb2RlYyhjb21wb25lbnROYW1lKSkgewogICAgICAgICAgICAgQUxPR1YoInNraXBwaW5nIFNXIGNvZGVjICclcyciLCBjb21wb25lbnROYW1lLmNfc3RyKCkpOwogICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgbWF0Y2hlcy0+cHVzaChjb21wb25lbnROYW1lKTsKKyAgICAgICAgICAgIGlmIChvd25lcnMgIT0gbnVsbHB0cikgeworICAgICAgICAgICAgICAgIG93bmVycy0+cHVzaChBU3RyaW5nKGluZm8tPmdldE93bmVyTmFtZSgpKSk7CisgICAgICAgICAgICB9CiAgICAgICAgICAgICBBTE9HVigibWF0Y2hpbmcgJyVzJyIsIGNvbXBvbmVudE5hbWUuY19zdHIoKSk7CiAgICAgICAgIH0KICAgICB9CiAKLSAgICBpZiAoZmxhZ3MgJiBrUHJlZmVyU29mdHdhcmVDb2RlY3MgfHwgcHJvcGVydHlfZ2V0X2Jvb2woImRlYnVnLnN0YWdlZnJpZ2h0LnN3Y29kZWMiLCBmYWxzZ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ICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZS52YWx1ZSA9PSAiMSIgPyAxIDogMCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAvLyBOb24tZmVhdHVyZSBhdHRyaWJ1dGVzCisgICAgICAgICAgICBjYXBzLT5hZGREZXRhaWwoCisgICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZS5rZXkuY19zdHIoKSwgYXR0cmlidXRlLnZhbHVlLmNfc3RyKCkpOworICAgICAgICB9CisgICAgfQorICAgIHJldHVybiBPSzsKK30KKworfSAgLy8gdW5uYW1lZCBuYW1lc3BhY2UKKworT214SW5mb0J1aWxkZXI6Ok9teEluZm9CdWlsZGVyKCkgeworfQorCitzdGF0dXNfdCBPbXhJbmZvQnVpbGRlcjo6YnVpbGRNZWRpYUNvZGVjTGlzdChNZWRpYUNvZGVjTGlzdFdyaXRlciogd3JpdGVyKSB7CisgICAgYm9vbCB0cmVibGU7CisgICAgc3A8SU9NWD4gb214OworICAgIHN0ZDo6dmVjdG9yPElPTVhTdG9yZTo6Um9sZUluZm8+IHJvbGVzOworCisgICAgdHJlYmxlID0gcHJvcGVydHlfZ2V0X2Jvb2woInBlcnNpc3QubWVkaWEudHJlYmxlX29teCIsIHRydWUpOworICAgIGlmICh0cmVibGUpIHsKKyAgICAgICAgdXNpbmcgbmFtZXNwYWNlIDo6YW5kcm9pZDo6aGFyZHdhcmU6Om1lZGlhOjpvbXg6OlYxXzA7CisgICAgICAgIHVzaW5nIDo6YW5kcm9pZDo6aGFyZHdhcmU6OmhpZGxfdmVjOworICAgICAgICB1c2luZyA6OmFuZHJvaWQ6OmhhcmR3YXJlOjpoaWRsX3N0cmluZzsKKworICAgICAgICAvLyBPYnRhaW4gSU9teFN0b3JlCisgICAgICAgIHNwPElPbXhTdG9yZT4gb214U3RvcmUgPSBJT214U3RvcmU6OmdldFNlcnZpY2UoKTsKKyAgICAgICAgaWYgKG9teFN0b3JlID09IG51bGxwdHIpIHsKKyAgICAgICAgICAgIEFMT0dFKCJDYW5ub3QgY29ubmVjdCB0byBhbiBJT214U3RvcmUgaW5zdGFuY2UuIik7CisgICAgICAgICAgICByZXR1cm4gTk9fSU5JVDsKKyAgICAgICAgfQorCisgICAgICAgIC8vIExpc3Qgc2VydmljZSBhdHRyaWJ1dGVzIChnbG9iYWwgc2V0dGluZ3MpCisgICAgICAgIFN0YXR1cyBzdGF0dXM7CisgICAgICAgIGhpZGxfdmVjPElPbXhTdG9yZTo6U2VydmljZUF0dHJpYnV0ZT4gc2VydmljZUF0dHJpYnV0ZXM7CisgICAgICAgIGF1dG8gdHJhbnNTdGF0dXMgPSBvbXhTdG9yZS0+bGlzdFNlcnZpY2VBdHRyaWJ1dGVzKAorICAgICAgICAgICAgICAgIFsmc3RhdHVzLCAmc2VydmljZUF0dHJpYnV0ZXNdCisgICAgICAgICAgICAgICAgKFN0YXR1cyBpblN0YXR1cywgY29uc3QgaGlkbF92ZWM8SU9teFN0b3JlOjpTZXJ2aWNlQXR0cmlidXRlPiYKKyAgICAgICAgICAgICAgICAgICAgICAgIGluQXR0cmlidXRlcykgeworICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBpblN0YXR1czsKKyAgICAgICAgICAgICAgICAgICAgc2VydmljZUF0dHJpYnV0ZXMgPSBpbkF0dHJpYnV0ZXM7CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgIGlmICghdHJhbnNTdGF0dXMuaXNPaygpKSB7CisgICAgICAgICAgICBBTE9HRSgiRmFpbCB0byBvYnRhaW4gZ2xvYmFsIHNldHRpbmdzIGZyb20gSU9teFN0b3JlLiIpOworICAgICAgICAgICAgcmV0dXJuIE5PX0lOSVQ7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHN0YXR1cyAhPSBTdGF0dXM6Ok9LKSB7CisgICAgICAgICAgICBBTE9HRSgiSU9teFN0b3JlIHJlcG9ydHMgcGFyc2luZyBlcnJvci4iKTsKKyAgICAgICAgICAgIHJldHVybiBOT19JTklUOworICAgICAgICB9CisgICAgICAgIGZvciAoY29uc3QgYXV0byYgcCA6IHNlcnZpY2VBdHRyaWJ1dGVzKSB7CisgICAgICAgICAgICB3cml0ZXItPmFkZEdsb2JhbFNldHRpbmcoCisgICAgICAgICAgICAgICAgICAgIHAua2V5LmNfc3RyKCksIHAudmFsdWUuY19zdHIoKSk7CisgICAgICAgIH0KKworICAgICAgICAvLyBMaXN0IHJvbGVzIGFuZCBjb252ZXJ0IHRvIElPTVhTdG9yZSdzIGZvcm1hdAorICAgICAgICB0cmFuc1N0YXR1cyA9IG9teFN0b3JlLT5saXN0Um9sZXMoCisgICAgICAgICAgICAgICAgWyZyb2xlc10KKyAgICAgICAgICAgICAgICAoY29uc3QgaGlkbF92ZWM8SU9teFN0b3JlOjpSb2xlSW5mbz4mIGluUm9sZUxpc3QpIHsKKyAgICAgICAgICAgICAgICAgICAgcm9sZXMucmVzZXJ2ZShpblJvbGVMaXN0LnNpemUoKSk7CisgICAgICAgICAgICAgICAgICAgIGZvciAoY29uc3QgYXV0byYgaW5Sb2xlIDogaW5Sb2xlTGlzdCkgeworICAgICAgICAgICAgICAgICAgICAgICAgSU9NWFN0b3JlOjpSb2xlSW5mbyByb2xlOworICAgICAgICAgICAgICAgICAgICAgICAgcm9sZS5yb2xlID0gaW5Sb2xlLnJvbGU7CisgICAgICAgICAgICAgICAgICAgICAgICByb2xlLnR5cGUgPSBpblJvbGUudHlwZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJvbGUuaXNFbmNvZGVyID0gaW5Sb2xlLmlzRW5jb2RlcjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJvbGUucHJlZmVyUGxhdGZvcm1Ob2RlcyA9IGluUm9sZS5wcmVmZXJQbGF0Zm9ybU5vZGVzOworICAgICAgICAgICAgICAgICAgICAgICAgc3RkOjp2ZWN0b3I8SU9NWFN0b3JlOjpOb2RlSW5mbz4mIG5vZGVzID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm9sZS5ub2RlczsKKyAgICAgICAgICAgICAgICAgICAgICAgIG5vZGVzLnJlc2VydmUoaW5Sb2xlLm5vZGVzLnNpemUoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGNvbnN0IGF1dG8mIGluTm9kZSA6IGluUm9sZS5ub2RlcykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIElPTVhTdG9yZTo6Tm9kZUluZm8gbm9kZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBub2RlLm5hbWUgPSBpbk5vZGUubmFtZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBub2RlLm93bmVyID0gaW5Ob2RlLm93bmVyOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0ZDo6dmVjdG9yPElPTVhTdG9yZTo6QXR0cmlidXRlPiYgYXR0cmlidXRlcyA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBub2RlLmF0dHJpYnV0ZXM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0cmlidXRlcy5yZXNlcnZlKGluTm9kZS5hdHRyaWJ1dGVzLnNpemUoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChjb25zdCBhdXRvJiBpbkF0dHIgOiBpbk5vZGUuYXR0cmlidXRlcykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJT01YU3RvcmU6OkF0dHJpYnV0ZSBhdHRyOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRyLmtleSA9IGluQXR0ci5rZXk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dHIudmFsdWUgPSBpbkF0dHIudmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZXMucHVzaF9iYWNrKHN0ZDo6bW92ZShhdHRyKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vZGVzLnB1c2hfYmFjayhzdGQ6Om1vdmUobm9kZSkpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgcm9sZXMucHVzaF9iYWNrKHN0ZDo6bW92ZShyb2xlKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgaWYgKCF0cmFuc1N0YXR1cy5pc09rKCkpIHsKKyAgICAgICAgICAgIEFMT0dFKCJGYWlsIHRvIG9idGFpbiBjb2RlYyByb2xlcyBmcm9tIElPbXhTdG9yZS4iKTsKKyAgICAgICAgICAgIHJldHVybiBOT19JTklUOworICAgICAgICB9CisgICAgfSBlbHNlIHsKKyAgICAgICAgLy8gT2J0YWluIElPTVhTdG9yZQorICAgICAgICBzcDxJU2VydmljZU1hbmFnZXI+IHNtID0gZGVmYXVsdFNlcnZpY2VNYW5hZ2VyKCk7CisgICAgICAgIGlmIChzbSA9PSBudWxscHRyKSB7CisgICAgICAgICAgICBBTE9HRSgiQ2Fubm90IG9idGFpbiB0aGUgZGVmYXVsdCBzZXJ2aWNlIG1hbmFnZXIuIik7CisgICAgICAgICAgICByZXR1cm4gTk9fSU5JVDsKKyAgICAgICAgfQorICAgICAgICBzcDxJQmluZGVyPiBjb2RlY0JpbmRlciA9IHNtLT5nZXRTZXJ2aWNlKFN0cmluZzE2KCJtZWRpYS5jb2RlYyIpKTsKKyAgICAgICAgaWYgKGNvZGVjQmluZGVyID09IG51bGxwdHIpIHsKKyAgICAgICAgICAgIEFMT0dFKCJDYW5ub3Qgb2J0YWluIHRoZSBtZWRpYSBjb2RlYyBzZXJ2aWNlLiIpOworICAgICAgICAgICAgcmV0dXJuIE5PX0lOSVQ7CisgICAgICAgIH0KKyAgICAgICAgc3A8SU1lZGlhQ29kZWNTZXJ2aWNlPiBjb2RlY1NlcnZpY2UgPQorICAgICAgICAgICAgICAgIGludGVyZmFjZV9jYXN0PElNZWRpYUNvZGVjU2VydmljZT4oY29kZWNCaW5kZXIpOworICAgICAgICBpZiAoY29kZWNTZXJ2aWNlID09IG51bGxwdHIpIHsKKyAgICAgICAgICAgIEFMT0dFKCJXcm9uZyB0eXBlIG9mIG1lZGlhIGNvZGVjIHNlcnZpY2Ugb2J0YWluZWQuIik7CisgICAgICAgICAgICByZXR1cm4gTk9fSU5JVDsKKyAgICAgICAgfQorICAgICAgICBvbXggPSBjb2RlY1NlcnZpY2UtPmdldE9NWCgpOworICAgICAgICBpZiAob214ID09IG51bGxwdHIpIHsKKyAgICAgICAgICAgIEFMT0dFKCJDYW5ub3QgY29ubmVjdCB0byBhbiBJT01YIGluc3RhbmNlLiIpOworICAgICAgICB9CisgICAgICAgIHNwPElPTVhTdG9yZT4gb214U3RvcmUgPSBjb2RlY1NlcnZpY2UtPmdldE9NWFN0b3JlKCk7CisgICAgICAgIGlmIChvbXhTdG9yZSA9PSBudWxscHRyKSB7CisgICAgICAgICAgICBBTE9HRSgiQ2Fubm90IGNvbm5lY3QgdG8gYW4gSU9NWFN0b3JlIGluc3RhbmNlLiIpOworICAgICAgICAgICAgcmV0dXJuIE5PX0lOSVQ7CisgICAgICAgIH0KKworICAgICAgICAvLyBMaXN0IHNlcnZpY2UgYXR0cmlidXRlcyAoZ2xvYmFsIHNldHRpbmdzKQorICAgICAgICBzdGQ6OnZlY3RvcjxJT01YU3RvcmU6OkF0dHJpYnV0ZT4gc2VydmljZUF0dHJpYnV0ZXM7CisgICAgICAgIHN0YXR1c190IHN0YXR1cyA9IG9teFN0b3JlLT5saXN0U2VydmljZUF0dHJpYnV0ZXMoJnNlcnZpY2VBdHRyaWJ1dGVzKTsKKyAgICAgICAgaWYgKHN0YXR1cyAhPSBPSykgeworICAgICAgICAgICAgQUxPR0UoIkZhaWwgdG8gb2J0YWluIGdsb2JhbCBzZXR0aW5ncyBmcm9tIElPTVhTdG9yZS4iKTsKKyAgICAgICAgICAgIHJldHVybiBOT19JTklUOworICAgICAgICB9CisgICAgICAgIGZvciAoY29uc3QgYXV0byYgcC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dG8gYzJpID0gc3dDb2RlY05hbWUySW5mby5maW5kKG5vZGVOYW1lKTsKKyAgICAgICAgICAgICAgICBpZiAoYzJpID09IHN3Q29kZWNOYW1lMkluZm8uZW5kKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gQ3JlYXRlIGEgbmV3IE1lZGlhQ29kZWNJbmZvIGZvciBhIG5ldyBub2RlLgorICAgICAgICAgICAgICAgICAgICBjMmkgPSBzd0NvZGVjTmFtZTJJbmZvLmluc2VydChzdGQ6Om1ha2VfcGFpcigKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBub2RlTmFtZSwgd3JpdGVyLT5hZGRNZWRpYUNvZGVjSW5mbygpKSkuZmlyc3Q7CisgICAgICAgICAgICAgICAgICAgIGluZm8gPSBjMmktPnNlY29uZC5nZXQoKTsKKyAgICAgICAgICAgICAgICAgICAgaW5mby0+c2V0TmFtZShub2RlTmFtZS5jX3N0cigpKTsKKyAgICAgICAgICAgICAgICAgICAgaW5mby0+c2V0T3duZXIobm9kZS5vd25lci5jX3N0cigpKTsKKyAgICAgICAgICAgICAgICAgICAgaW5mby0+c2V0RW5jb2Rlcihpc0VuY29kZXIpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFRoZSBub2RlIGhhcyBiZWVuIHNlZW4gYmVmb3JlLiBTaW1wbHkgcmV0cmlldmUgdGhlCisgICAgICAgICAgICAgICAgICAgIC8vIGV4aXN0aW5nIE1lZGlhQ29kZWNJbmZvV3JpdGVyLgorICAgICAgICAgICAgICAgICAgICBpbmZvID0gYzJpLT5zZWNvbmQuZ2V0KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBhdXRvIGMyaSA9IGh3Q29kZWNOYW1lMkluZm8uZmluZChub2RlTmFtZSk7CisgICAgICAgICAgICAgICAgaWYgKGMyaSA9PSBod0NvZGVjTmFtZTJJbmZvLmVuZCgpKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIENyZWF0ZSBhIG5ldyBNZWRpYUNvZGVjSW5mbyBmb3IgYSBuZXcgbm9kZS4KKyAgICAgICAgICAgICAgICAgICAgaWYgKCFwcmVmZXJQbGF0Zm9ybU5vZGVzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjMmkgPSBod0NvZGVjTmFtZTJJbmZvLmluc2VydChzdGQ6Om1ha2VfcGFpcigKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9kZU5hbWUsIHdyaXRlci0+YWRkTWVkaWFDb2RlY0luZm8oKSkpLmZpcnN0OworICAgICAgICAgICAgICAgICAgICAgICAgaW5mbyA9IGMyaS0+c2Vjb25kLmdldCgpOworICAgICAgICAgICAgICAgICAgICAgICAgaW5mby0+c2V0TmFtZShub2RlTmFtZS5jX3N0cigpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGluZm8tPnNldE93bmVyKG5vZGUub3duZXIuY19zdHIoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpbmZvLT5zZXRFbmNvZGVyKGlzRW5jb2Rlcik7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBJZiBwcmVmZXJQbGF0Zm9ybU5vZGVzIGlzIHRydWUsIHRoaXMgbm9kZSBtdXN0IGJlCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBhZGRlZCBhZnRlciBhbGwgc29mdHdhcmUgbm9kZXMuCisgICAgICAgICAgICAgICAgICAgICAgICBod0NvZGVjcy5wdXNoX2JhY2soJm5vZGUpOworICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAvLyBUaGUgbm9kZSBoYXMgYmVlbiBzZWVuIGJlZm9yZS4gU2ltcGx5IHJldHJpZXZlIHRoZQorICAgICAgICAgICAgICAgICAgICAvLyBleGlzdGluZyBNZWRpYUNvZGVjSW5mb1dyaXRlci4KKyAgICAgICAgICAgICAgICAgICAgaW5mbyA9IGMyaS0+c2Vjb25kLmdldCgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHN0ZDo6dW5pcXVlX3B0cjxNZWRpYUNvZGVjSW5mbzo6Q2FwYWJpbGl0aWVzV3JpdGVyPiBjYXBzID0KKyAgICAgICAgICAgICAgICAgICAgaW5mby0+YWRkTWltZSh0eXBlTmFtZS5jX3N0cigpKTsKKyAgICAgICAgICAgIGlmIChxdWVyeUNhcGFiaWxpdGllcygKKyAgICAgICAgICAgICAgICAgICAgbm9kZSwgdHlwZU5hbWUuY19zdHIoKSwgaXNFbmNvZGVyLCBjYXBzLmdldCgpKSAhPSBPSykgeworICAgICAgICAgICAgICAgIEFMT0dXKCJGYWlsIHRvIGFkZCBtaW1lICVzIHRvIGNvZGVjICVzIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVOYW1lLmNfc3RyKCksIG5vZGVOYW1lLmNfc3RyKCkpOworICAgICAgICAgICAgICAgIGluZm8tPnJlbW92ZU1pbWUodHlwZU5hbWUuY19zdHIoKSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyBJZiBwcmVmZXJQbGF0Zm9ybU5vZGVzIGlzIHRydWUsIGhhcmR3YXJlIG5vZGVzIHdpbGwgbm90IGhhdmUgYmVlbgorICAgICAgICAvLyBhZGRlZCBpbiB0aGUgbG9vcCBhYm92ZSwgYnV0IHJhdGhlciBzYXZlZCBpbiBod0NvZGVjcy4gVGhleSBhcmUKKyAgICAgICAgLy8gZ29pbmcgdG8gYmUgYWRkZWQgaGVyZS4KKyAgICAgICAgaWYgKHByZWZlclBsYXRmb3JtTm9kZXMpIHsKKyAgICAgICAgICAgIGZvciAoY29uc3QgYXV0byYgbm9kZSA6IGh3Q29kZWNzKSB7CisgICAgICAgICAgICAgICAgTWVkaWFDb2RlY0luZm9Xcml0ZXIqIGluZm87CisgICAgICAgICAgICAgICAgY29uc3QgYXV0byYgbm9kZU5hbWUgPSBub2RlLT5uYW1lOworICAgICAgICAgICAgICAgIGF1dG8gYzJpID0gaHdDb2RlY05hbWUySW5mby5maW5kKG5vZGVOYW1lKTsKKyAgICAgICAgICAgICAgICBpZiAoYzJpID09IGh3Q29kZWNOYW1lMkluZm8uZW5kKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gQ3JlYXRlIGEgbmV3IE1lZGlhQ29kZWNJbmZvIGZvciBhIG5ldyBub2RlLgorICAgICAgICAgICAgICAgICAgICBjMmkgPSBod0NvZGVjTmFtZTJJbmZvLmluc2VydChzdGQ6Om1ha2VfcGFpcigKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBub2RlTmFtZSwgd3JpdGVyLT5hZGRNZWRpYUNvZGVjSW5mbygpKSkuZmlyc3Q7CisgICAgICAgICAgICAgICAgICAgIGluZm8gPSBjMmktPnNlY29uZC5nZXQoKTsKKyAgICAgICAgICAgICAgICAgICAgaW5mby0+c2V0TmFtZShub2RlTmFtZS5jX3N0cigpKTsKKyAgICAgICAgICAgICAgICAgICAgaW5mby0+c2V0T3duZXIobm9kZS0+b3duZXIuY19zdHIoKSk7CisgICAgICAgICAgICAgICAgICAgIGluZm8tPnNldEVuY29kZXIoaXNFbmNvZGVyKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAvLyBUaGUgbm9kZSBoYXMgYmVlbiBzZWVuIGJlZm9yZS4gU2ltcGx5IHJldHJpZXZlIHRoZQorICAgICAgICAgICAgICAgICAgICAvLyBleGlzdGluZyBNZWRpYUNvZGVjSW5mb1dyaXRlci4KKyAgICAgICAgICAgICAgICAgICAgaW5mbyA9IGMyaS0+c2Vjb25kLmdldCgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBzdGQ6OnVuaXF1ZV9wdHI8TWVkaWFDb2RlY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gMjsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIGNhc2UgSEFMX1BJWEVMX0ZPUk1BVF9SR0JBXzg4ODg6CisgICAgICAgIHsKKyAgICAgICAgICAgICpvbXhDb2xvckZvcm1hdCA9IE9NWF9DT0xPUl9Gb3JtYXQzMkJpdFJHQkE4ODg4OworICAgICAgICAgICAgKmJwcCA9IDQ7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICBjYXNlIEhBTF9QSVhFTF9GT1JNQVRfQkdSQV84ODg4OgorICAgICAgICB7CisgICAgICAgICAgICAqb214Q29sb3JGb3JtYXQgPSBPTVhfQ09MT1JfRm9ybWF0MzJiaXRCR1JBODg4ODsKKyAgICAgICAgICAgICpicHAgPSA0OworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgeworICAgICAgICAgICAgQUxPR0UoIlVuc3VwcG9ydGVkIGNvbG9yIGZvcm1hdDogJWQiLCBjb2xvckZvcm1hdCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gZmFsc2U7Cit9CisKIHN0YXRpYyBWaWRlb0ZyYW1lICpleHRyYWN0VmlkZW9GcmFtZSgKICAgICAgICAgY29uc3QgQVN0cmluZyAmY29tcG9uZW50TmFtZSwKICAgICAgICAgY29uc3Qgc3A8TWV0YURhdGE+ICZ0cmFja01ldGEsCiAgICAgICAgIGNvbnN0IHNwPElNZWRpYVNvdXJjZT4gJnNvdXJjZSwKICAgICAgICAgaW50NjRfdCBmcmFtZVRpbWVVcywKLSAgICAgICAgaW50IHNlZWtNb2RlKSB7Ci0KKyAgICAgICAgaW50IHNlZWtNb2RlLAorICAgICAgICBpbnQgY29sb3JGb3JtYXQsCisgICAgICAgIGJvb2wgbWV0YU9ubHkpIHsKICAgICBzcDxNZXRhRGF0YT4gZm9ybWF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vcHRpb25zOworICAgIHNwPE1ldGFEYXRhPiBvdmVycmlkZU1ldGE7CisgICAgaWYgKGZyYW1lVGltZVVzIDwgMCkgeworICAgICAgICB1aW50MzJfdCB0eXBlOworICAgICAgICBjb25zdCB2b2lkICpkYXRhOworICAgICAgICBzaXplX3Qgc2l6ZTsKKyAgICAgICAgaW50NjRfdCB0aHVtYk5haWxUaW1lOworICAgICAgICBpbnQzMl90IHRodW1ibmFpbFdpZHRoLCB0aHVtYm5haWxIZWlnaHQ7CisKKyAgICAgICAgLy8gaWYgd2UgaGF2ZSBhIHN0YW5kLWFsb25lIHRodW1ibmFpbCwgc2V0IHVwIHRoZSBvdmVycmlkZSBtZXRhLAorICAgICAgICAvLyBhbmQgc2V0IHNlZWtUbyB0aW1lIHRvIC0xLgorICAgICAgICBpZiAodHJhY2tNZXRhLT5maW5kSW50MzIoa0tleVRodW1ibmFpbFdpZHRoLCAmdGh1bWJuYWlsV2lkdGgpCisgICAgICAgICAmJiB0cmFja01ldGEtPmZpbmRJbnQzMihrS2V5VGh1bWJuYWlsSGVpZ2h0LCAmdGh1bWJuYWlsSGVpZ2h0KQorICAgICAgICAgJiYgdHJhY2tNZXRhLT5maW5kRGF0YShrS2V5VGh1bWJuYWlsSFZDQywgJnR5cGUsICZkYXRhLCAmc2l6ZSkpeworICAgICAgICAgICAgb3ZlcnJpZGVNZXRhID0gbmV3IE1ldGFEYXRhKCp0cmFja01ldGEpOworICAgICAgICAgICAgb3ZlcnJpZGVNZXRhLT5yZW1vdmUoa0tleURpc3BsYXlXaWR0aCk7CisgICAgICAgICAgICBvdmVycmlkZU1ldGEtPnJlbW92ZShrS2V5RGlzcGxheUhlaWdodCk7CisgICAgICAgICAgICBvdmVycmlkZU1ldGEtPnNldEludDMyKGtLZXlXaWR0aCwgdGh1bWJuYWlsV2lkdGgpOworICAgICAgICAgICAgb3ZlcnJpZGVNZXRhLT5zZXRJbnQzMihrS2V5SGVpZ2h0LCB0aHVtYm5haWxIZWlnaHQp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3dzLCAmdG1wUm93cykgJiYgdG1wUm93cyA+IDAKKyAgICAgICAgICYmIHRyYWNrTWV0YS0+ZmluZEludDMyKGtLZXlHcmlkQ29scywgJnRtcENvbHMpICYmIHRtcENvbHMgPiAwKSB7CisgICAgICAgICAgICBpbnQzMl90IHdpZHRoLCBoZWlnaHQ7CisgICAgICAgICAgICBDSEVDSyh0cmFja01ldGEtPmZpbmRJbnQzMihrS2V5V2lkdGgsICZ3aWR0aCkpOworICAgICAgICAgICAgQ0hFQ0sodHJhY2tNZXRhLT5maW5kSW50MzIoa0tleUhlaWdodCwgJmhlaWdodCkpOworCisgICAgICAgICAgICBpZiAod2lkdGggPD0gZ3JpZFdpZHRoICogdG1wQ29scyAmJiBoZWlnaHQgPD0gZ3JpZEhlaWdodCAqIHRtcFJvd3MpIHsKKyAgICAgICAgICAgICAgICBBTE9HVigiZ3JpZDogJWR4JWQsIHNpemU6ICVkeCVkLCBwaWN0dXJlIHNpemU6ICVkeCVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHRtcENvbHMsIHRtcFJvd3MsIGdyaWRXaWR0aCwgZ3JpZEhlaWdodCwgd2lkdGgsIGhlaWdodCk7CisKKyAgICAgICAgICAgICAgICBvdmVycmlkZU1ldGEgPSBuZXcgTWV0YURhdGEoKnRyYWNrTWV0YSk7CisgICAgICAgICAgICAgICAgb3ZlcnJpZGVNZXRhLT5zZXRJbnQzMihrS2V5V2lkdGgsIGdyaWRXaWR0aCk7CisgICAgICAgICAgICAgICAgb3ZlcnJpZGVNZXRhLT5zZXRJbnQzMihrS2V5SGVpZ2h0LCBncmlkSGVpZ2h0KTsKKyAgICAgICAgICAgICAgICBncmlkQ29scyA9IHRtcENvbHM7CisgICAgICAgICAgICAgICAgZ3JpZFJvd3MgPSB0bXBSb3dzOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBBTE9HRSgiYmFkIGdyaWQ6ICVkeCVkLCBzaXplOiAlZHglZCwgcGljdHVyZS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OYWlsVGltZSA8IDApIHsKLSAgICAgICAgICAgIHRodW1iTmFpbFRpbWUgPSAwOwotICAgICAgICB9Ci0gICAgICAgIG9wdGlvbnMuc2V0U2Vla1RvKHRodW1iTmFpbFRpbWUsIG1vZGUpOwotICAgIH0gZWxzZSB7Ci0gICAgICAgIHRodW1iTmFpbFRpbWUgPSAtMTsKLSAgICAgICAgb3B0aW9ucy5zZXRTZWVrVG8oZnJhbWVUaW1lVXMsIG1vZGUpOwotICAgIH0KLQogICAgIGVyciA9IHNvdXJjZS0+c3RhcnQoKTsKICAgICBpZiAoZXJyICE9IE9LKSB7CiAgICAgICAgIEFMT0dXKCJzb3VyY2UgZmFpbGVkIHRvIHN0YXJ0OiAlZCAoJXMpIiwgZXJyLCBhc1N0cmluZyhlcnIpKTsKQEAgLTI1OCw2ICszOTQsOSBAQAogICAgIGJvb2wgZmlyc3RTYW1wbGUgPSB0cnVlOwogICAgIGludDY0X3QgdGFyZ2V0VGltZVVzID0gLTFsbDsKIAorICAgIFZpZGVvRnJhbWUgKmZyYW1lID0gTlVMTDsKKyAgICBpbnQzMl90IHRpbGVzRGVjb2RlZCA9IDA7CisKICAgICBkbyB7CiAgICAgICAgIHNpemVfdCBpbnB1dEluZGV4ID0gLTE7CiAgICAgICAgIGludDY0X3QgcHRzVXMgPSAwbGw7CkBAIC0yODIsNiArNDIxLDkgQEAKICAgICAgICAgICAgIGlmIChlcnIgIT0gT0spIHsKICAgICAgICAgICAgICAgICBBTE9HVygiSW5wdXQgRXJyb3Igb3IgRU9TIik7CiAgICAgICAgICAgICAgICAgaGF2ZU1vcmVJbnB1dHMgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBpZiAoZXJyID09IEVSUk9SX0VORF9PRl9TVFJFQU0pIHsKKyAgICAgICAgICAgICAgICAgICAgZXJyID0gT0s7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgaWYgKGZpcnN0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aXplPSV6dSB0cz0lIiBQUklkNjQgIiB1cyBmbGFncz0leCIsCiAgICAgICAgICAgICAgICAgICAgIGNvZGVjQnVmZmVyLT5zaXplKCksIHB0c1VzLCBmbGFncyk7CiAgICAgICAgICAgICBlcnIgPSBkZWNvZGVyLT5xdWV1ZUlucHV0QnVmZmVyKApAQCAtMzUwLDEzICs0OTQsODAgQEAKICAgICAgICAgICAgICAgICAgICAgQUxPR1YoIlRpbWVkLW91dCB3YWl0aW5nIGZvciBvdXRwdXQuLiByZXRyaWVzIGxlZnQgPSAlenUiLCByZXRyaWVzTGVmdCk7CiAgICAgICAgICAgICAgICAgICAgIGVyciA9IE9LOwogICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyID09IE9LKSB7CisJICAgICAgICAgICAgaWYgKG91dHB1dEZvcm1hdCA9PSBOVUxMKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBkZWNvZGVyLT5yZWxlYXNlT3V0cHV0QnVmZmVyKGluZGV4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVyciA9IEVSUk9SX01BTEZPUk1FRDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisKICAgICAgICAgICAgICAgICAgICAgLy8gSWYgd2UncmUgc2Vla2luZyB3aXRoIENMT1NFU1Qgb3B0aW9uIGFuZCBvYnRhaW5lZCBhIHZhbGlkIHRhcmdldFRpbWVVcwogICAgICAgICAgICAgICAgICAgICAvLyBmcm9tIHRoZSBleHRyYWN0b3IsIGRlY29kZSB0byB0aGUgc3BlY2lmaWVkIGZyYW1lLiBPdGhlcndpc2Ugd2UncmUgZG9uZS4KLSAgICAgICAgICAgICAgICAgICAgZG9uZSA9ICh0YXJnZXRUaW1lVXMgPCAwbGwpIHx8ICh0aW1lVXMgPj0gdGFyZ2V0VGltZVVzKTsKICAgICAgICAgICAgICAgICAgICAgQUxPR1YoIlJlY2VpdmVkIGFuIG91dHB1dCBidWZmZXIsIHRpbWVVcz0lbGxkIiwgKGxvbmcgbG9uZyl0aW1lVXMpOwotICAgICAgICAgICAgICAgICAgICBpZiAoIWRvbmUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGVyciA9IGRlY29kZXItPnJlbGVhc2VPdXRwdXRCdWZmZXIoaW5kZXgpOworICAgICAgICAgICAgICAgICAgICBzcDxNZWRpYUNvZGVjQnVmZmVyPiB2aWRlb0ZyYW1lQnVmZmVyID0gb3V0cHV0QnVmZmVycy5pdGVtQXQoaW5kZXgpOworCisgICAgICAgICAgICAgICAgICAgIGludDMyX3Qgd2lkdGgsIGhlaWdodDsKKyAgICAgICAgICAgICAgICAgICAgQ0hFQ0sob3V0cHV0Rm9ybWF0LT5maW5kSW50MzIoIndpZHRoIiwgJndpZHRoKSk7CisgICAgICAgICAgICAgICAgICAgIENIRUNLKG91dHB1dEZvcm1hdC0+ZmluZEludDMyKCJoZWlnaHQiLCAmaGVpZ2h0KSk7CisKKyAgICAgICAgICAgICAgICAgICAgaW50MzJfdCBjcm9wX2xlZnQsIGNyb3BfdG9wLCBjcm9wX3JpZ2h0LCBjcm9wX2JvdHRvbTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFvdXRwdXRGb3JtYXQtPmZpbmRSZWN0KCJjcm9wIiwgJmNyb3BfbGVmdCwgJmNyb3BfdG9wLCAmY3JvcF9yaWdodCwgJmNyb3BfYm90dG9tKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgY3JvcF9sZWZ0ID0gY3JvcF90b3AgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgY3JvcF9yaWdodCA9IHdpZHRoIC0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNyb3BfYm90dG9tID0gaGVpZ2h0IC0gMTsKICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmIChmcmFtZSA9PSBOVUxMKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmcmFtZSA9IGFsbG9jVmlkZW9GcmFtZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhY2tNZXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY3JvcF9yaWdodCAtIGNyb3BfbGVmdCArIDEpICogZ3JpZENvbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjcm9wX2JvdHRvbSAtIGNyb3BfdG9wICsgMSkgKiBncmlkUm93cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHN0QnBwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYWxzZSAvKm1ldGFPbmx5Ki8pOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaW50MzJfdCBzcmNGb3JtYXQ7CisgICAgICAgICAgICAgICAgICAgIENIRUNLKG91dHB1dEZvcm1hdC0+ZmluZEludDMyKCJjb2xvci1mb3JtYXQiLCAmc3JjRm9ybWF0KSk7CisKKyAgICAgICAgICAgICAgICAgICAgQ29sb3JDb252ZXJ0ZXIgY29udmVydGVyKChPTVhfQ09MT1JfRk9STUFUVFlQRSlzcmNGb3JtYXQsIGRzdEZvcm1hdCk7CisKKyAgICAgICAgICAgICAgICAgICAgaW50MzJfdCBkc3RMZWZ0LCBkc3RUb3AsIGRzdFJpZ2h0LCBkc3RCb3R0b207CisgICAgICAgICAgICAgICAgICAgIGlmIChudW1UaWxlcyA9PSAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBkc3RMZWZ0ID0gY3JvcF9sZWZ0OworICAgICAgICAgICAgICAgICAgICAgICAgZHN0VG9wID0gY3JvcF90b3A7CisgICAgICAgICAgICAgICAgICAgICAgICBkc3RSaWdodCA9IGNyb3BfcmlnaHQ7CisgICAgICAgICAgICAgICAgICAgICAgICBkc3RCb3R0b20gPSBjcm9wX2JvdHRvbTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRzdExlZnQgPSB0aWxlc0RlY29kZWQgJSBncmlkQ29scyAqIHdpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgZHN0VG9wID0gdGlsZXNEZWNvZGVkIC8gZ3JpZENvbHMgKiBoZWlnaHQ7CisgICAgICAgICAgICAgICAgICAgICAgICBkc3RSaWdodCA9IGRzdExlZnQgKyB3aWR0aCAtIDE7CisgICAgICAgICAgICAgICAgICAgICAgICBkc3RCb3R0b20gPSBkc3RUb3AgKyBoZWlnaHQgLSAxOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgZG9uZSA9ICh0YXJnZXRUaW1lVXMgPCAwbGwpIHx8ICh0aW1lVXMgPj0gdGFyZ2V0VGltZVVzKTsKKworICAgICAgICAgICAgICAgICAgICBpZiAoZG9uZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbnZlcnRlci5pc1ZhbGlkKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlcnIgPSBjb252ZXJ0ZXIuY29udmVydCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjb25zdCB1aW50OF90ICopdmlkZW9GcmFtZUJ1ZmZlci0+ZGF0YSgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGgsIGhlaWdodCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNyb3BfbGVmdCwgY3JvcF90b3AsIGNyb3BfcmlnaHQsIGNyb3BfYm90dG9tLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJhbWUtPm1EYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJhbWUtPm1XaWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyYW1lLT5tSGVpZ2h0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHN0TGVmdCwgZHN0VG9wLCBkc3RSaWdodCwgZHN0Qm90dG9tKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgQUxPR0UoIlVuYWJsZSB0byBjb252ZXJ0IGZyb20gZm9ybWF0IDB4JTA4eCB0byAweCUwOHgiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3JjRm9ybWF0LCBkc3RGb3JtYXQpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXJyID0gRVJST1JfVU5TVVBQT1JURUQ7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobnVtVGlsZXMgPiAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGlsZXNEZWNvZGVkKys7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9uZSAmPSAodGlsZXNEZWNvZGVkID49IG51bVRpbGVzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGRlY29kZXItPnJlbGVhc2VPdXRwdXRCdWZmZXIoaW5kZXgpOwogICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgIEFMT0dXKCJSZWNlaXZlZCBlcnJvciAlZCAoJXMpIGluc3RlYWQgb2Ygb3V0cHV0IiwgZXJyLCBhc1N0cmluZyhlcnIpKTsKICAgICAgICAgICAgICAgICAgICAgZG9uZSA9IHRydWU7CkBAIC0zNjYsMTAyICs1NzcsMTEgQEAKICAgICAgICAgfQogICAgIH0gd2hpbGUgKGVyciA9PSBPSyAmJiAhZG9uZSk7CiAKLSAgICBpZiAoZXJyICE9IE9LIHx8IHNpemUgPD0gMCB8fCBvdXRwdXRGb3JtYXQgPT0gTlVMTCkgewotICAgICAgICBBTE9HRSgiRmFpbGVkIHRvIGRlY29kZSB0aHVtYm5haWwgZnJhbWUiKTsKLSAgICAgICAgc291cmNl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JIZWlnaHQgIT0gMCkgewotICAgICAgICBmcmFtZS0+bURpc3BsYXlXaWR0aCA9IChmcmFtZS0+bURpc3BsYXlXaWR0aCAqIHNhcldpZHRoKSAvIHNhckhlaWdodDsKLSAgICB9IGVsc2UgewotICAgICAgICBpbnQzMl90IHdpZHRoLCBoZWlnaHQ7Ci0gICAgICAgIGlmICh0cmFja01ldGEtPmZpbmRJbnQzMihrS2V5RGlzcGxheVdpZHRoLCAmd2lkdGgpCi0gICAgICAgICAgICAgICAgJiYgdHJhY2tNZXRhLT5maW5kSW50MzIoa0tleURpc3BsYXlIZWlnaHQsICZoZWlnaHQpCi0gICAgICAgICAgICAgICAgJiYgZnJhbWUtPm1EaXNwbGF5V2lkdGggPiAwICYmIGZyYW1lLT5tRGlzcGxheUhlaWdodCA+IDAKLSAgICAgICAgICAgICAgICAmJiB3aWR0aCA+IDAgJiYgaGVpZ2h0ID4gMCkgewotICAgICAgICAgICAgaWYgKGZyYW1lLT5tRGlzcGxheUhlaWdodCAqIChpbnQ2NF90KXdpZHRoIC8gaGVpZ2h0ID4gKGludDY0X3QpZnJhbWUtPm1EaXNwbGF5V2lkdGgpIHsKLSAgICAgICAgICAgICAgICBmcmFtZS0+bURpc3BsYXlIZWlnaHQgPQotICAgICAgICAgICAgICAgICAgICAgICAgKGludDMyX3QpKGhlaWdodCAqIChpbnQ2NF90KWZyYW1lLT5tRGlzcGxheVdpZHRoIC8gd2lkdGgpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBmcmFtZS0+bURpc3BsYXlXaWR0aCA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAoaW50MzJfdCkoZnJhbWUtPm1EaXNwbGF5SGVpZ2h0ICogKGludDY0X3Qpd2lkdGggLyBoZWlnaHQpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgQUxPR1YoInRodW1iTmFpbCB3aWR0aCBhbmQgaGVpZ2h0IGFyZSBvdmVycmlkZGVuIHRvICVkIHggJWQiL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BPTVhfQVVESU9fUEFSQU1fUE9SVEZPUk1BVFRZUEUgKmZvcm1hdFBhcmFtcyA9CisgICAgICAgICAgICAgICAgKE9NWF9BVURJT19QQVJBTV9QT1JURk9STUFUVFlQRSAqKXBhcmFtczsKKworICAgICAgICAgICAgaWYgKCFpc1ZhbGlkT01YUGFyYW0oZm9ybWF0UGFyYW1zKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JCYWRQYXJhbWV0ZXI7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChmb3JtYXRQYXJhbXMtPm5Qb3J0SW5kZXggPiAxKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvclVuZGVmaW5lZDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKGZvcm1hdFBhcmFtcy0+bkluZGV4ID4gMCkgeworICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JOb01vcmU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZvcm1hdFBhcmFtcy0+ZUVuY29kaW5nID0KKyAgICAgICAgICAgICAgICAoZm9ybWF0UGFyYW1zLT5uUG9ydEluZGV4ID09IDApCisgICAgICAgICAgICAgICAgICAgID8gT01YX0FVRElPX0NvZGluZ0FBQyA6IE9NWF9BVURJT19Db2RpbmdQQ007CisKKyAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JOb25lOworICAgICAgICB9CisKICAgICAgICAgY2FzZSBPTVhfSW5kZXhQYXJhbUF1ZGlvQWFjOgogICAgICAgICB7CiAgICAgICAgICAgICBPTVhfQVVESU9fUEFSQU1fQUFDUFJPRklMRVRZUEUgKmFhY1BhcmFtcyA9CkBAIC0zNDIsNiArMzY2LDI5IEBACiAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9uZTsKICAgICAgICAgfQogCisgICAgICAgIGNhc2UgT01YX0luZGV4UGFyYW1BdWRpb1BvcnRGb3JtYXQ6CisgICAgICAgIHsKKyAgICAgICAgICAgIGNvbnN0IE9NWF9BVURJT19QQVJBTV9QT1JURk9STUFUVFlQRSAqZm9ybWF0UGFyYW1zID0KKyAgICAgICAgICAgICAgICAoY29uc3QgT01YX0FVRElPX1BBUkFNX1BPUlRGT1JNQVRUWVBFICopcGFyYW1zOworCisgICAgICAgICAgICBpZiAoIWlzVmFsaWRPTVhQYXJhbShmb3JtYXRQYXJhbXMpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvckJhZFBhcmFtZXRlcjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKGZvcm1hdFBhcmFtcy0+blBvcnRJbmRleCA+IDEpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoKGZvcm1hdFBhcmFtcy0+blBvcnRJbmRleCA9PSAwCisgICAgICAgICAgICAgICAgICAgICAgICAmJiBmb3JtYXRQYXJhbXMtPmVFbmNvZGluZyAhPSBPTVhfQVVESU9fQ29kaW5nQUFDKQorICAgICAgICAgICAgICAgIHx8IChmb3JtYXRQYXJhbXMtPm5Qb3J0SW5kZXggPT0gMQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgZm9ybWF0UGFyYW1zLT5lRW5jb2RpbmcgIT0gT01YX0FVRElPX0NvZGluZ1BDTSkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9uZTsKKyAgICAgICAgfQorCiAgICAgICAgIGNhc2UgT01YX0luZGV4UGFyYW1BdWRpb0FhYzoKICAgICAgICAgewogICAgICAgICAgICAgY29uc3QgT01YX0FVRElPX1BBUkFNX0FBQ1BST0ZJTEVUWVBFICphYWNQYXJhbXMgPQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29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Uk1BVFRZUEUgKmZvcm1hdFBhcmFtcyA9CisgICAgICAgICAgICAgICAgKE9NWF9BVURJT19QQVJBTV9QT1JURk9STUFUVFlQRSAqKXBhcmFtczsKKworICAgICAgICAgICAgaWYgKCFpc1ZhbGlkT01YUGFyYW0oZm9ybWF0UGFyYW1zKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JCYWRQYXJhbWV0ZXI7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChmb3JtYXRQYXJhbXMtPm5Qb3J0SW5kZXggPiAxKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvclVuZGVmaW5lZDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKGZvcm1hdFBhcmFtcy0+bkluZGV4ID4gMCkgeworICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JOb01vcmU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZvcm1hdFBhcmFtcy0+ZUVuY29kaW5nID0KKyAgICAgICAgICAgICAgICAoZm9ybWF0UGFyYW1zLT5uUG9ydEluZGV4ID09IDApCisgICAgICAgICAgICAgICAgICAgID8gT01YX0FVRElPX0NvZGluZ0FNUiA6IE9NWF9BVURJT19Db2RpbmdQQ007CisKKyAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JOb25lOworICAgICAgICB9CisKICAgICAgICAgY2FzZSBPTVhfSW5kZXhQYXJhbUF1ZGlvQW1yOgogICAgICAgICB7CiAgICAgICAgICAgICBPTVhfQVVESU9fUEFSQU1fQU1SVFlQRSAqYW1yUGFyYW1zID0KQEAgLTIzNiw2ICsyNjAsMjkgQEAKICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JOb25lOwogICAgICAgICB9CiAKKyAgICAgICAgY2FzZSBPTVhfSW5kZXhQYXJhbUF1ZGlvUG9ydEZvcm1hdDoKKyAgICAgICAgeworICAgICAgICAgICAgY29uc3QgT01YX0FVRElPX1BBUkFNX1BPUlRGT1JNQVRUWVBFICpmb3JtYXRQYXJhbXMgPQorICAgICAgICAgICAgICAgIChjb25zdCBPTVhfQVVESU9fUEFSQU1fUE9SVEZPUk1BVFRZUEUgKilwYXJhbXM7CisKKyAgICAgICAgICAgIGlmICghaXNWYWxpZE9NWFBhcmFtKGZvcm1hdFBhcmFtcykpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yQmFkUGFyYW1ldGVyOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoZm9ybWF0UGFyYW1zLT5uUG9ydEluZGV4ID4gMSkgeworICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JVbmRlZmluZWQ7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmICgoZm9ybWF0UGFyYW1zLT5uUG9ydEluZGV4ID09IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIGZvcm1hdFBhcmFtcy0+ZUVuY29kaW5nICE9IE9NWF9BVURJT19Db2RpbmdBTVIpCisgICAgICAgICAgICAgICAgfHwgKGZvcm1hdFBhcmFtcy0+blBvcnRJbmRleCA9PSAxCisgICAgICAgICAgICAgICAgICAgICAgICAmJiBmb3JtYXRQYXJhbXMtPmVFbmNvZGluZyAhPSBPTVhfQVVESU9fQ29kaW5nUENNKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JVbmRlZmluZWQ7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JOb25lOworICAgICAgICB9CisKICAgICAgICAgY2FzZSBPTVhfSW5kZXhQYXJhbUF1ZGlvQW1yOgogICAgICAgICB7CiAgICAgICAgICAgICBjb25zdCBPTVhfQVVESU9fUEFSQU1fQU1SVFlQRSAqYWFjUGFyYW1zID0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hbXJuYi9kZWMvU29mdEFNUi5oIGIvbWVkaWEvbGlic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CYXNlbGluZSwgT01YX1ZJREVPX0FWQ0xldmVsNDEgfSwKIAorICAgIHsgT01YX1ZJREVPX0FWQ1Byb2ZpbGVCYXNlbGluZSwgT01YX1ZJREVPX0FWQ0xldmVsNDEgfSwKKworICAgIHsgT01YX1ZJREVPX0FWQ1Byb2ZpbGVNYWluLCBPTVhfVklERU9fQVZDTGV2ZWw0MSB9LAogfTsKIAogc3RhdGljIHNpemVfdCBHZXRDUFVDb3JlQ291bnQoKSB7CkBAIC02MjksOCArNjA2LDEwIEBACiAgICAgICAgIGxldmVsID0gMzA7CiAgICAgfSBlbHNlIGlmIChkaXNwbGF5U2l6ZVkgPiAoMzUyICogMjg4KSkgewogICAgICAgICBsZXZlbCA9IDIxOwotICAgIH0gZWxzZSB7CisgICAgfSBlbHNlIGlmIChkaXNwbGF5U2l6ZVkgPiAoMTc2ICogMTQ0KSkgewogICAgICAgICBsZXZlbCA9IDIwOworICAgIH0gZWxzZSB7CisgICAgICAgIGxldmVsID0gMTA7CiAgICAgfQogICAgIG1BVkNFbmNMZXZlbCA9IE1BWChsZXZlbCwgbUFWQ0VuY0xldmVsKTsKIApAQCAtOTYzLDcgKzk0Miw4IEBACiAgICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvclVuZGVmaW5lZDsKICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgYXZjUGFyYW1zLT5lUHJvZmlsZSA9IE9NWF9WSURFT19BVkNQcm9maWxlQmFzZWxpbmU7CisgICAgICAgICAgICAvLyBUT0RPOiBtYWludGFpbiBwcm9maWxlCisgICAgICAgICAgICBhdmNQYXJhbXMtPmVQcm9maWxlID0gKE9NWF9WSURFT19BVkNQUk9GSUxFVFlQRSlPTVhfVklERU9fQVZDUHJvZmlsZUNvbnN0cmFpbmVkQmFzZWxpbmU7CiAgICAgICAgICAgICBhdmNQYXJhbXMtPmVMZXZlbCA9IG9teExldmVsOwogICAgICAgICAgICAgYXZjUGFyYW1zLT5uUmVmRnJhbWVzID0gMT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gICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZvcm1hdFBhcmFtcy0+ZUVuY29kaW5nID0KKyAgICAgICAgICAgICAgICAoZm9ybWF0UGFyYW1zLT5uUG9ydEluZGV4ID09IDApCisgICAgICAgICAgICAgICAgICAgID8gT01YX0FVRElPX0NvZGluZ0ZMQUMgOiBPTVhfQVVESU9fQ29kaW5nUENNOworCisgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9uZTsKKyAgICAgICAgfQogICAgICAgICBjYXNlIE9NWF9JbmRleFBhcmFtQXVkaW9GbGFjOgogICAgICAgICB7CiAgICAgICAgICAgICBPTVhfQVVESU9fUEFSQU1fRkxBQ1RZUEUgKmZsYWNQYXJhbXMgPQpAQCAtMjE5LDYgKzI0MiwyOSBAQAogICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvck5vbmU7CiAgICAgICAgIH0KIAorICAgICAgICBjYXNlIE9NWF9JbmRleFBhcmFtQXVkaW9Qb3J0Rm9ybWF0OgorICAgICAgICB7CisgICAgICAgICAgICBjb25zdCBPTVhfQVVESU9fUEFSQU1fUE9SVEZPUk1BVFRZUEUgKmZvcm1hdFBhcmFtcyA9CisgICAgICAgICAgICAgICAgKGNvbnN0IE9NWF9BVURJT19QQVJBTV9QT1JURk9STUFUVFlQRSAqKXBhcmFtczsKKworICAgICAgICAgICAgaWYgKCFpc1ZhbGlkT01YUGFyYW0oZm9ybWF0UGFyYW1zKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JCYWRQYXJhbWV0ZXI7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChmb3JtYXRQYXJhbXMtPm5Qb3J0SW5kZXggPiAxKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvclVuZGVmaW5lZDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKChmb3JtYXRQYXJhbXMtPm5Qb3J0SW5kZXggPT0gMAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgZm9ybWF0UGFyYW1zLT5lRW5jb2RpbmcgIT0gT01YX0FVRElPX0NvZGluZ0ZMQUMpCisgICAgICAgICAgICAgICAgfHwgKGZvcm1hdFBhcmFtcy0+blBvcnRJbmRleCA9PSAxCisgICAgICAgICAgICAgICAgICAgICAgICAmJiBmb3JtYXRQYXJhbXMtPmVFbmNvZGluZyAhPSBPTVhfQVVESU9fQ29kaW5nUENNKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JVbmRlZmluZWQ7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JOb25lOworICAgICAgICB9CisKICAgICAgICAgY2FzZSBPTVhfSW5kZXhQYXJhbUF1ZGlvUGNtOgogICAgICAgICB7CiAgICAgICAgICAgICBjb25zdCBPTVhfQVVESU9fUEFSQU1fUENNTU9ERVRZUEUgKnBjbVBhcmFtcyA9CkBAIC0yNTYsMTAgKzMwMiwyNyBAQAogICAgIHdoaWxlICghaW5RdWV1ZS5lbXB0eSgpICYmICFvdXRRdWV1ZS5lbXB0eSgpKSB7CiAgICAgICAgIEJ1ZmZlckluZm8gKmluSW5mbyA9ICppblF1ZXVlLmJlZ2luKCk7CiAgICAgICAgIE9NWF9CVUZGRVJIRUFERVJUWVBFICppbkhlYWRlciA9IGluSW5mby0+bUhlYWRlcjsKKyAgICAgICAgQnVmZmVySW5mbyAqb3V0SW5mbyA9ICpvdXRRdWV1ZS5iZWdpbigpOworICAgICAgICBPTVhfQlVGRkVSSEVBREVSVFlQRSAqb3V0SGVhZGVyID0gb3V0SW5mby0+bUhlYWRlcjsKICAgICAgICAgdWludDhfdCogaW5CdWZmZXIgPSBpbkhlYWRlci0+cEJ1ZmZlciArIGluSGVhZGVyLT5uT2Zmc2V0OwogICAgICAgICB1aW50MzJfdCBpbkJ1ZmZlckxlbmd0aCA9IGluSGVhZGVyLT5uRmlsbGVkTGVuOwogICAgICAgICBib29sIGVuZE9mSW5wdXQgPSAoaW5IZWFkZXItPm5GbGFncyAmIE9NWF9CVUZGRVJGTEFHX0VPUykgIT0gMDsKIAorICAgICAgICBpZiAoaW5IZWFkZXItPm5GaWxsZWRMZW4gPT0gMCkgeworICAgICAgICAgICAgaWYgKGVuZE9mSW5wdXQpIHsKKyAgICAgICAgICAgICAgICBvdXRIZWFkZXItPm5GaWxsZWRMZW4gPSAwOworICAgICAgICAgICAgICAgIG91dEhlYWRlci0+bkZsYWdzID0gT01YX0JVRkZFUkZMQUdfRU9TOworICAgICAgICAgICAgICAgIG91dEluZm8tPm1Pd25lZEJ5VXMgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBvdXRRdWV1ZS5lcmFzZShvdXRRdWV1ZS5iZWdpbigpKTsKKyAgICAgICAgICAgICAgICBub3RpZnlGaWxsQnVmZmVyRG9uZShvdXRIZWFkZXIpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBBTE9HRSgib25RdWV1ZUZpbGxlZDogZW1wdHlJbnB1dEJ1ZmZlciByZWNlaXZlZCIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaW5JbmZvLT5tT3duZWRCeVVzID0gZmFsc2U7CisgICAgICAgICAgICBpblF1ZXVlLmVyYXNlKGluUXVldWUuYmVnaW4oKSk7CisgICAgICAgICAgICBub3RpZnlFbXB0eUJ1ZmZlckRvbmUoaW5IZWFkZXIpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CiAgICAgICAgIGlmIChtSW5wdXRCdWZmZXJDb3VudCA9PSAwICYmICEoaW5IZWFkZXItPm5GbGFncyAmIE9NWF9CVUZGRVJGTEFHX0NPREVDQ09ORklHKSkgewogICAgICAgICAgICAgQUxPR0UoIm9uUXVldWVGaWxsZWQ6IGZpcnN0IGJ1ZmZlciBzaG91bGQgaGF2ZSBPTVhfQlVGRkVSRkxBR19DT0RFQ0NPTkZJRyBzZXQiKTsKICAgICAgICAgICAgIGluSGVhZGVyLT5uRmxhZ3M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tPm5Qb3J0SW5kZXggPT0gMCkKKyAgICAgICAgICAgICAgICAgICAgPyBPTVhfQVVESU9fQ29kaW5nUENNIDogT01YX0FVRElPX0NvZGluZ0ZMQUM7CisKKyAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JOb25lOworICAgICAgICB9CisKICAgICAgICAgY2FzZSBPTVhfSW5kZXhQYXJhbUF1ZGlvUGNtOgogICAgICAgICB7CiAgICAgICAgICAgICBPTVhfQVVESU9fUEFSQU1fUENNTU9ERVRZUEUgKnBjbVBhcmFtcyA9CkBAIC0xNjMsNyArMTg3LDcgQEAKICAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yQmFkUGFyYW1ldGVyOwogICAgICAgICAgICAgfQogCi0gICAgICAgICAgICBpZiAocGNtUGFyYW1zLT5uUG9ydEluZGV4ID4gMSkgeworICAgICAgICAgICAgaWYgKHBjbVBhcmFtcy0+blBvcnRJbmRleCAhPSAwKSB7CiAgICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvclVuZGVmaW5lZDsKICAgICAgICAgICAgIH0KIApAQCAtMTg5LDYgKzIxMywxMCBAQAogICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JCYWRQYXJhbWV0ZXI7CiAgICAgICAgICAgICB9CiAKKyAgICAgICAgICAgIGlmIChmbGFjUGFyYW1zLT5uUG9ydEluZGV4ICE9IDEpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOworICAgICAgICAgICAgfQorCiAgICAgICAgICAgICBmbGFjUGFyYW1zLT5uQ29tcHJlc3Npb25MZXZlbCA9IG1Db21wcmVzc2lvbkxldmVsOwogICAgICAgICAgICAgZmxhY1BhcmFtcy0+bkNoYW5uZWxzID0gbU51bUNoYW5uZWxzOwogICAgICAgICAgICAgZmxhY1BhcmFtcy0+blNhbXBsZVJhdGUgPSBtU2FtcGxlUmF0ZTsKQEAgLTIwMyw2ICsyMzEsMjkgQEAKIE9NWF9FUlJPUlRZUEUgU29mdEZsYWNFbmNvZGVyOjppbnRlcm5hbFNldFBhcmFtZXRlcigKICAgICAgICAgT01YX0lOREVYVFlQRSBpbmRleCwgY29uc3QgT01YX1BUUiBwYXJhbXMpIHsKICAgICBzd2l0Y2ggKGluZGV4KSB7CisgICAgICAgIGNhc2UgT01YX0luZGV4UGFyYW1BdWRpb1BvcnRGb3JtYXQ6CisgICAgICAgIHsKKyAgICAgICAgICAgIGNvbnN0IE9NWF9BVURJT19QQVJBTV9QT1JURk9STUFUVFlQRSAqZm9ybWF0UGFyYW1zID0KKyAgICAgICAgICAgICAgICAoY29uc3QgT01YX0FVRElPX1BBUkFNX1BPUlRGT1JNQVRUWVBFICopcGFyYW1zOworCisgICAgICAgICAgICBpZiAoIWlzVmFsaWRPTVhQYXJhbShmb3JtYXRQYXJhbXMpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvckJhZFBhcmFtZXRlcjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKGZvcm1hdFBhcmFtcy0+blBvcnRJbmRleCA+IDEpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoKGZvcm1hdFBhcmFtcy0+blBvcnRJbmRleCA9PSAwCisgICAgICAgICAgICAgICAgICAgICAgICAmJiBmb3JtYXRQYXJhbXMtPmVFbmNvZGluZyAhPSBPTVhfQVVESU9fQ29kaW5nUENNKQorICAgICAgICAgICAgICAgIHx8IChmb3JtYXRQYXJhbXMtPm5Qb3J0SW5kZXggPT0gMQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgZm9ybWF0UGFyYW1zLT5lRW5jb2RpbmcgIT0gT01YX0FVRElPX0NvZGluZ0ZMQUMpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvclVuZGVmaW5lZDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvck5vbmU7CisgICAgICAgIH0KKwogICAgICAgICBjYXNlIE9NWF9JbmRleFBhcmFtQXVkaW9QY206CiAgICAgICAgIHsKICAgICAgICAgICAgIEFMT0dWKCJTb2Z0RmxhY0VuY29kZXI6OmludGVybmFsU2V0UGFyYW1ldGVyKE9NWF9JbmRleFBhcmFtQXVkaW9QY20pIik7CkBAIC0yMTIsNyArMjYzLDcgQEAKICAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yQmFkUGFyYW1ldGVyOwogICAgICAgICAgICAgfQogCi0gICAgICAgICAgICBpZiAocGNtUGFyYW1zLT5uUG9ydEluZGV4ICE9IDAgJiYgcGNtUGFyYW1zLT5uUG9ydEluZGV4ICE9IDEpIHsKKyAgICAgICAgICAgIGlmIChwY21QYXJhbXMtPm5Qb3J0SW5kZXggIT0gMCkgewogICAgICAgICAgICAgICAgIEFMT0dFKCJTb2Z0RmxhY0VuY29kZXI6OmludGVybmFsU2V0UGFyYW1ldGVyKCkgRXJyb3IgIzEiKTsKICAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOwogICAgICAgICAgICAgfQpAQCAtMjU4LDYgKzMwOSwxMCBAQAogICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JCYWRQYXJhbWV0ZXI7CiAgICAgICAgICAgICB9CiAKKyAgICAgICAgICAgIGlmIChmbGFjUGFyYW1zLT5uUG9ydEluZGV4ICE9IDEpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOworICAgICAgICAgICAgfQorCiAgICAgICAgICAgICBtQ29tcHJlc3Npb25MZXZlbCA9IGZsYWNQYXJhbXMtPm5Db21wcmVzc2lvbkxldmVsOyAvLyByYW5nZSBjbGFtcGluZyBkb25lIGluc2lkZSBlbmNvZGVyCiAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9uZTsKICAgICAgICAgfQpkaW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QQVJBTV9QT1JURk9STUFUVFlQRSAqZm9ybWF0UGFyYW1zID0KKyAgICAgICAgICAgICAgICAoT01YX0FVRElPX1BBUkFNX1BPUlRGT1JNQVRUWVBFICopcGFyYW1zOworCisgICAgICAgICAgICBpZiAoIWlzVmFsaWRPTVhQYXJhbShmb3JtYXRQYXJhbXMpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvckJhZFBhcmFtZXRlcjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKGZvcm1hdFBhcmFtcy0+blBvcnRJbmRleCA+IDEpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoZm9ybWF0UGFyYW1zLT5uSW5kZXggPiAwKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvck5vTW9yZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZm9ybWF0UGFyYW1zLT5lRW5jb2RpbmcgPQorICAgICAgICAgICAgICAgIChmb3JtYXRQYXJhbXMtPm5Qb3J0SW5kZXggPT0gMCkKKyAgICAgICAgICAgICAgICAgICAgPyBPTVhfQVVESU9fQ29kaW5nRzcxMSA6IE9NWF9BVURJT19Db2RpbmdQQ007CisKKyAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JOb25lOworICAgICAgICB9CisKICAgICAgICAgY2FzZSBPTVhfSW5kZXhQYXJhbUF1ZGlvUGNtOgogICAgICAgICB7CiAgICAgICAgICAgICBPTVhfQVVESU9fUEFSQU1fUENNTU9ERVRZUEUgKnBjbVBhcmFtcyA9CkBAIC0xNzMsNiArMTk3LDI5IEBACiAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9uZTsKICAgICAgICAgfQogCisgICAgICAgIGNhc2UgT01YX0luZGV4UGFyYW1BdWRpb1BvcnRGb3JtYXQ6CisgICAgICAgIHsKKyAgICAgICAgICAgIGNvbnN0IE9NWF9BVURJT19QQVJBTV9QT1JURk9STUFUVFlQRSAqZm9ybWF0UGFyYW1zID0KKyAgICAgICAgICAgICAgICAoY29uc3QgT01YX0FVRElPX1BBUkFNX1BPUlRGT1JNQVRUWVBFICopcGFyYW1zOworCisgICAgICAgICAgICBpZiAoIWlzVmFsaWRPTVhQYXJhbShmb3JtYXRQYXJhbXMpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvckJhZFBhcmFtZXRlcjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKGZvcm1hdFBhcmFtcy0+blBvcnRJbmRleCA+IDEpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoKGZvcm1hdFBhcmFtcy0+blBvcnRJbmRleCA9PSAwCisgICAgICAgICAgICAgICAgICAgICAgICAmJiBmb3JtYXRQYXJhbXMtPmVFbmNvZGluZyAhPSBPTVhfQVVESU9fQ29kaW5nRzcxMSkKKyAgICAgICAgICAgICAgICB8fCAoZm9ybWF0UGFyYW1zLT5uUG9ydEluZGV4ID09IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIGZvcm1hdFBhcmFtcy0+ZUVuY29kaW5nICE9IE9NWF9BVURJT19Db2RpbmdQQ00pKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvclVuZGVmaW5lZDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvck5vbmU7CisgICAgICAgIH0KKwogICAgICAgICBjYXNlIE9NWF9JbmRleFBhcmFtU3RhbmRhcmRDb21wb25lbnRSb2xlOgogICAgICAgICB7CiAgICAgICAgICAgICBjb25zdCBPTVhfUEFSQU1fQ09NUE9ORU5UUk9MRVRZUEUgKnJvbGVQYXJhbXMgPQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2Vmcml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xpZE9NWFBhcmFtKGZvcm1hdFBhcmFtcykpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yQmFkUGFyYW1ldGVyOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoZm9ybWF0UGFyYW1zLT5uUG9ydEluZGV4ID4gMSkgeworICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JVbmRlZmluZWQ7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChmb3JtYXRQYXJhbXMtPm5JbmRleCA+IDApIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9Nb3JlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBmb3JtYXRQYXJhbXMtPmVFbmNvZGluZyA9CisgICAgICAgICAgICAgICAgKGZvcm1hdFBhcmFtcy0+blBvcnRJbmRleCA9PSAwKQorICAgICAgICAgICAgICAgICAgICA/IE9NWF9BVURJT19Db2RpbmdHU01GUiA6IE9NWF9BVURJT19Db2RpbmdQQ007CisKKyAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JOb25lOworICAgICAgICB9CisKICAgICAgICAgY2FzZSBPTVhfSW5kZXhQYXJhbUF1ZGlvUGNtOgogICAgICAgICB7CiAgICAgICAgICAgICBPTVhfQVVESU9fUEFSQU1fUENNTU9ERVRZUEUgKnBjbVBhcmFtcyA9CkBAIC0xNjQsNiArMTg4LDI5IEBACiAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9uZTsKICAgICAgICAgfQogCisgICAgICAgIGNhc2UgT01YX0luZGV4UGFyYW1BdWRpb1BvcnRGb3JtYXQ6CisgICAgICAgIHsKKyAgICAgICAgICAgIGNvbnN0IE9NWF9BVURJT19QQVJBTV9QT1JURk9STUFUVFlQRSAqZm9ybWF0UGFyYW1zID0KKyAgICAgICAgICAgICAgICAoY29uc3QgT01YX0FVRElPX1BBUkFNX1BPUlRGT1JNQVRUWVBFICopcGFyYW1zOworCisgICAgICAgICAgICBpZiAoIWlzVmFsaWRPTVhQYXJhbShmb3JtYXRQYXJhbXMpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvckJhZFBhcmFtZXRlcjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKGZvcm1hdFBhcmFtcy0+blBvcnRJbmRleCA+IDEpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoKGZvcm1hdFBhcmFtcy0+blBvcnRJbmRleCA9PSAwCisgICAgICAgICAgICAgICAgICAgICAgICAmJiBmb3JtYXRQYXJhbXMtPmVFbmNvZGluZyAhPSBPTVhfQVVESU9fQ29kaW5nR1NNRlIpCisgICAgICAgICAgICAgICAgfHwgKGZvcm1hdFBhcmFtcy0+blBvcnRJbmRleCA9PSAxCisgICAgICAgICAgICAgICAgICAgICAgICAmJiBmb3JtYXRQYXJhbXMtPmVFbmNvZGluZyAhPSBPTVhfQVVESU9fQ29kaW5nUENNKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JVbmRlZmluZWQ7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JOb25lOworICAgICAgICB9CisKICAgICAgICAgY2FzZSBPTVhfSW5kZXhQYXJhbVN0YW5kYXJkQ29tcG9uZW50Um9sZToKICAgICAgICAgewogICAgICAgICAgICAgY29uc3QgT01YX1BBUkFNX0NPTVBPTkVOVFJPTEVUWVBFICpyb2xlUGFyYW1zID0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9nc20vZGVjL1NvZnRHU00uaCBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9nc20vZGVjL1NvZnRHU00uaAppbmRleCAwMzAzZGVhLi5lZjg2OTE1IDEwMDY0NAotLS0gYS9tZWRpYS9saWJzdGFnZW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kaW5nID0KKyAgICAgICAgICAgICAgICAoZm9ybWF0UGFyYW1zLT5uUG9ydEluZGV4ID09IDApCisgICAgICAgICAgICAgICAgICAgID8gT01YX0FVRElPX0NvZGluZ01QMyA6IE9NWF9BVURJT19Db2RpbmdQQ007CisKKyAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JOb25lOworICAgICAgICB9CisKICAgICAgICAgY2FzZSBPTVhfSW5kZXhQYXJhbUF1ZGlvUGNtOgogICAgICAgICB7CiAgICAgICAgICAgICBPTVhfQVVESU9fUEFSQU1fUENNTU9ERVRZUEUgKnBjbVBhcmFtcyA9CkBAIC0yMDgsNiArMjMyLDI5IEBACiAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9uZTsKICAgICAgICAgfQogCisgICAgICAgIGNhc2UgT01YX0luZGV4UGFyYW1BdWRpb1BvcnRGb3JtYXQ6CisgICAgICAgIHsKKyAgICAgICAgICAgIGNvbnN0IE9NWF9BVURJT19QQVJBTV9QT1JURk9STUFUVFlQRSAqZm9ybWF0UGFyYW1zID0KKyAgICAgICAgICAgICAgICAoY29uc3QgT01YX0FVRElPX1BBUkFNX1BPUlRGT1JNQVRUWVBFICopcGFyYW1zOworCisgICAgICAgICAgICBpZiAoIWlzVmFsaWRPTVhQYXJhbShmb3JtYXRQYXJhbXMpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvckJhZFBhcmFtZXRlcjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKGZvcm1hdFBhcmFtcy0+blBvcnRJbmRleCA+IDEpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoKGZvcm1hdFBhcmFtcy0+blBvcnRJbmRleCA9PSAwCisgICAgICAgICAgICAgICAgICAgICAgICAmJiBmb3JtYXRQYXJhbXMtPmVFbmNvZGluZyAhPSBPTVhfQVVESU9fQ29kaW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WdodC9jb2RlY3Mvb3B1cy9kZWMvU29mdE9wdXMuY3BwCkBAIC02Miw2ICs2Miw3IEBACiAgICAgICBtU2Vla1ByZVJvbGwoMCksCiAgICAgICBtQW5jaG9yVGltZVVzKDApLAogICAgICAgbU51bUZyYW1lc091dHB1dCgwKSwKKyAgICAgIG1IYXZlRU9TKGZhbHNlKSwKICAgICAgIG1PdXRwdXRQb3J0U2V0dGluZ3NDaGFuZ2UoTk9ORSkgewogICAgIGluaXRQb3J0cygpOwogICAgIENIRUNLX0VRKGluaXREZWNvZGVyKCksIChzdGF0dXNfdClPSyk7CkBAIC0xMjksNiArMTMwLDMxIEBACiBPTVhfRVJST1JUWVBFIFNvZnRPcHVzOjppbnRlcm5hbEdldFBhcmFtZXRlcigKICAgICAgICAgT01YX0lOREVYVFlQRSBpbmRleCwgT01YX1BUUiBwYXJhbXMpIHsKICAgICBzd2l0Y2ggKChpbnQpaW5kZXgpIHsKKyAgICAgICAgY2FzZSBPTVhfSW5kZXhQYXJhbUF1ZGlvUG9ydEZvcm1hdDoKKyAgICAgICAgeworICAgICAgICAgICAgT01YX0FVRElPX1BBUkFNX1BPUlRGT1JNQVRUWVBFICpmb3JtYXRQYXJhbXMgPQorICAgICAgICAgICAgICAgIChPTVhfQVVESU9fUEFSQU1fUE9SVEZPUk1BVFRZUEUgKilwYXJhbXM7CisKKyAgICAgICAgICAgIGlmICghaXNWYWxpZE9NWFBhcmFtKGZvcm1hdFBhcmFtcykpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yQmFkUGFyYW1ldGVyOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoZm9ybWF0UGFyYW1zLT5uUG9ydEluZGV4ID4gMSkgeworICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JVbmRlZmluZWQ7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChmb3JtYXRQYXJhbXMtPm5JbmRleCA+IDApIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9Nb3JlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBmb3JtYXRQYXJhbXMtPmVFbmNvZGluZyA9CisgICAgICAgICAgICAgICAgKGZvcm1hdFBhcmFtcy0+blBvcnRJbmRleCA9PSAwKQorICAgICAgICAgICAgICAgICAgICA/IChPTVhfQVVESU9fQ09ESU5HVFlQRSlPTVhfQVVESU9fQ29kaW5nQW5kcm9pZE9QVVMgOgorICAgICAgICAgICAgICAgICAgICAgICBPTVhfQVVESU9fQ29kaW5nUENNOworCisgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9uZTsKKyAgICAgICAgfQorCiAgICAgICAgIGNhc2UgT01YX0luZGV4UGFyYW1BdWRpb0FuZHJvaWRPcHVzOgogICAgICAgICB7CiAgICAgICAgICAgICBPTVhfQVVESU9fUEFSQU1fQU5EUk9JRF9PUFVTVFlQRSAqb3B1c1BhcmFtcyA9CkBAIC0yMTIsNiArMjM4LDMwIEBACiAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9uZTsKICAgICAgICAgfQogCisgICAgICAgIGNhc2UgT01YX0luZGV4UGFyYW1BdWRpb1BvcnRGb3JtYXQ6CisgICAgICAgIHsKKyAgICAgICAgICAgIGNvbnN0IE9NWF9BVURJT19QQVJBTV9QT1JURk9STUFUVFlQRSAqZm9ybWF0UGFyYW1zID0KKyAgICAgICAgICAgICAgICAoY29uc3QgT01YX0FVRElPX1BBUkFNX1BPUlRGT1JNQVRUWVBFICopcGFyYW1zOworCisgICAgICAgICAgICBpZiAoIWlzVmFsaWRPTVhQYXJhbShmb3JtYXRQYXJhbXMpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvckJhZFBhcmFtZXRlcjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKGZvcm1hdFBhcmFtcy0+blBvcnRJbmRleCA+IDEpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoKGZvcm1hdFBhcmFtcy0+blBvcnRJbmRleCA9PSAwCisgICAgICAgICAgICAgICAgICAgICAgICAmJiBmb3JtYXRQYXJhbXMtPmVFbmNvZGluZyAhPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgKE9NWF9BVURJT19DT0RJTkdUWVBFKU9NWF9BVURJT19Db2RpbmdBbmRyb2lkT1BVUykKKyAgICAgICAgICAgICAgICB8fCAoZm9ybWF0UGFyYW1zLT5uUG9ydEluZGV4ID09IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIGZvcm1hdFBhcmFtcy0+ZUVuY29kaW5nICE9IE9NWF9BVURJT19Db2RpbmdQQ00pKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvclVuZGVmaW5lZDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvck5vbmU7CisgICAgICAgIH0KKwogICAgICAgICBjYXNlIE9NWF9JbmRleFBhcmFtQXVkaW9BbmRyb2lkT3B1czoKICAgICAgICAgewogICAgICAgICAgICAgY29uc3QgT01YX0FVRElPX1BBUkFNX0FORFJPSURfT1BVU1RZUEUgKm9wdXNQYXJhbXMgPQpAQCAtMzM1LDcgKzM4NSwzMSBAQAogICAgIHJldHVybiBzdGF0aWNfY2FzdDxkb3VibGU+KG5zKSAqIGtSYXRlIC8gMTAwMDAwMDAwMDsKIH0KIAotdm9pZCBTb2Z0T3B1czo6b25RdWV1ZUZpbGxlZChPTVhfVTMyIHBvcnRJbmRleCkgewordm9pZCBTb2Z0T3B1czo6aGFuZGxlRU9TKCkgeworICAgIExpc3Q8QnVmZmVySW5mbyAqPiAmaW5RdWV1ZSA9IGdldFBvcnRRdWV1ZSgwKTsKKyAgICBMaXN0PEJ1ZmZlckluZm8gKj4gJm91dFF1ZXVlID0gZ2V0UG9ydFF1ZXVlKDEpOworICAgIENIRUNL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PSAwICYmIG1JbnB1dEJ1ZmZlckNvdW50IDwgMykgewotICAgICAgICBCdWZmZXJJbmZvICppbmZvID0gKmluUXVldWUuYmVnaW4oKTsKLSAgICAgICAgT01YX0JVRkZFUkhFQURFUlRZUEUgKmhlYWRlciA9IGluZm8tPm1IZWFkZXI7Ci0KLSAgICAgICAgY29uc3QgdWludDhfdCAqZGF0YSA9IGhlYWRlci0+cEJ1ZmZlciArIGhlYWRlci0+bk9mZnNldDsKLSAgICAgICAgc2l6ZV90IHNpemUgPSBoZWFkZXItPm5GaWxsZWRMZW47Ci0KLSAgICAgICAgaWYgKG1JbnB1dEJ1ZmZlckNvdW50ID09IDApIHsKLSAgICAgICAgICAgIENIRUNLKG1IZWFkZXIgPT0gTlVMTCk7Ci0gICAgICAgICAgICBtSGVhZGVyID0gbmV3IE9wdXNIZWFkZXIoKTsKLSAgICAgICAgICAgIG1lbXNldChtSGVhZGVyLCAwLCBzaXplb2YoKm1IZWFkZXIpKTsKLSAgICAgICAgICAgIGlmICghUGFyc2VPcHVzSGVhZGVyKGRhdGEsIHNpemUsIG1IZWFkZXIpKSB7Ci0gICAgICAgICAgICAgICAgQUxPR1YoIlBhcnNpbmcgT3B1cyBIZWFkZXIgZmFpbGVkLiIpOwotICAgICAgICAgICAgICAgIG5vdGlmeShPTVhfRXZlbnRFcnJvciwgT01YX0Vycm9yVW5kZWZpbmVkLCAwLCBOVUxMKTsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHVpbnQ4X3QgY2hhbm5lbF9tYXBwaW5nW2tNYXhDaGFubmVsc10gPSB7MH07Ci0gICAgICAgICAgICBpZiAobUhlYWRlci0+Y2hhbm5lbHMgPD0ga01heENoYW5uZWxzV2l0aERlZmF1bHRMYXlvdXQpIHsKLSAgICAgICAgICAgICAgICBtZW1jcHkoJmNoYW5uZWxfbWFwcGluZywKLSAgICAgICAgICAgICAgICAgICAgICAga0RlZmF1bHRPcHVzQ2hhbm5lbExheW91dCwKLSAgICAgICAgICAgICAgICAgICAgICAga01heENoYW5uZWxzV2l0aERlZmF1bHRMYXlvdXQpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBtZW1jcHkoJmNoYW5uZWxfbWFwcGluZywKLSAgICAgICAgICAgICAgICAgICAgICAgbUhlYWRlci0+c3RyZWFtX21hcCwKLSAgICAgICAgICAgICAgICAgICAgICAgbUhlYWRlci0+Y2hhbm5lbHMpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpbnQgc3RhdHVzID0gT1BVU19JTlZBTElEX1NUQVRFOwotICAgICAgICAgICAgbURlY29kZXIgPSBvcHVzX211bHRpc3RyZWFtX2RlY29kZXJfY3JlYXRlKGtSYXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1IZWFkZXItPmNoYW5uZWxzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1IZWFkZXItPm51bV9zdHJlYW1zLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1IZWFkZXItPm51bV9jb3VwbGVkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxfbWFwcGluZywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmc3RhdHVzKTsKLSAgICAgICAgICAgIGlmICghbURlY29kZXIgfHwgc3RhdHVzICE9IE9QVVNfT0spIHsKLSAgICAgICAgICAgICAgICBBTE9HVigib3B1c19tdWx0aXN0cmVhbV9kZWNvZGVyX2NyZWF0ZSBmYWlsZWQgc3RhdHVzPSVzIiwKLSAgICAgICAgICAgICAgICAgICAgICBvcHVzX3N0cmVycm9yKHN0YXR1cykpOwotICAgICAgICAgICAgICAgIG5vdGlmeShPTVhfRXZlbnRFcnJvciwgT01YX0Vycm9yVW5kZWZpbmVkLCAwLCBOVUxMKTsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBzdGF0dXMgPQotICAgICAgICAgICAgICAgIG9wdXNfbXVsdGlzdHJlYW1fZGVjb2Rlcl9jdGwobURlY29kZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPUFVTX1NFVF9HQUlOKG1IZWFkZXItPmdhaW5fZGIpKTsKLSAgICAgICAgICAgIGlmIChzdGF0dXMgIT0gT1BVU19PSykgewotICAgICAgICAgICAgICAgIEFMT0dWKCJGYWlsZWQgdG8gc2V0IE9QVVMgaGVhZGVyIGdhaW47IHN0YXR1cz0lcyIsCi0gICAgICAgICAgICAgICAgICAgICAgb3B1c19zdHJlcnJvcihzdGF0dXMpKTsKLSAgICAgICAgICAgICAgICBub3RpZnkoT01YX0V2ZW50RXJyb3IsIE9NWF9FcnJvclVuZGVmaW5lZCwgMCwgTlVMTCk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgaWYgKG1JbnB1dEJ1ZmZlckNvdW50ID09IDEpIHsKLSAgICAgICAgICAgIG1Db2RlY0RlbGF5ID0gbnNfdG9fc2FtcGxlcygKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocmVpbnRlcnByZXRfY2FzdDxpbnQ2NF90Kj4oaGVhZGVyLT5wQnVmZmVyICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyLT5uT2Zmc2V0KSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrUmF0ZSk7Ci0gICAgICAgICAgICBtU2FtcGxlc1RvRGlzY2FyZCA9IG1Db2RlY0RlbGF5OwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgbVNlZW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R19DT0RFQ0NPTkZJRykgeworICAgICAgICBpZiAobUlucHV0QnVmZmVyQ291bnQgPCAzKSB7CisgICAgICAgICAgICBjb25zdCB1aW50OF90ICpkYXRhID0gaW5IZWFkZXItPnBCdWZmZXIgKyBpbkhlYWRlci0+bk9mZnNldDsKKyAgICAgICAgICAgIHNpemVfdCBzaXplID0gaW5IZWFkZXItPm5GaWxsZWRMZW47CisKKyAgICAgICAgICAgIGlmICgoaW5IZWFkZXItPm5GbGFncyAmIE9NWF9CVUZGRVJGTEFHX0VPUykgJiYgc2l6ZSA9PSAwKSB7CisgICAgICAgICAgICAgICAgaGFuZGxlRU9TKCk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAobUlucHV0QnVmZmVyQ291bnQgPT0gMCkgeworICAgICAgICAgICAgICAgIENIRUNLKG1IZWFkZXIgPT0gTlVMTCk7CisgICAgICAgICAgICAgICAgbUhlYWRlciA9IG5ldyBPcHVzSGVhZGVyKCk7CisgICAgICAgICAgICAgICAgbWVtc2V0KG1IZWFkZXIsIDAsIHNpemVvZigqbUhlYWRlcikpOworICAgICAgICAgICAgICAgIGlmICghUGFyc2VPcHVzSGVhZGVyKGRhdGEsIHNpemUsIG1IZWFkZXIpKSB7CisgICAgICAgICAgICAgICAgICAgIEFMT0dWKCJQYXJzaW5nIE9wdXMgSGVhZGVyIGZhaWxlZC4iKTsKKyAgICAgICAgICAgICAgICAgICAgbm90aWZ5KE9NWF9FdmVudEVycm9yLCBPTVhfRXJyb3JVbmRlZmluZWQsIDAsIE5VTEwpOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgdWludDhfdCBjaGFubmVsX21hcHBpbmdba01heENoYW5uZWxzXSA9IHswfTsKKyAgICAgICAgICAgICAgICBpZiAobUhlYWRlci0+Y2hhbm5lbHMgPD0ga01heENoYW5uZWxzV2l0aERlZmF1bHRMYXlvdXQpIHsKKyAgICAgICAgICAgICAgICAgICAgbWVtY3B5KCZjaGFubmVsX21hcHBpbmcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBrRGVmYXVsdE9wdXNDaGFubmVsTGF5b3V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAga01heENoYW5uZWxzV2l0aERlZmF1bHRMYXlvdXQpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIG1lbWNweSgmY2hhbm5lbF9tYXBwaW5nLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgbUhlYWRlci0+c3RyZWFtX21hcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1IZWFkZXItPmNoYW5uZWxzKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpbnQgc3RhdHVzID0gT1BVU19JTlZBTElEX1NUQVRFOworICAgICAgICAgICAgICAgIG1EZWNvZGVyID0gb3B1c19tdWx0aXN0cmVhbV9kZWNvZGVyX2NyZWF0ZShrUmF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUhlYWRlci0+Y2hhbm5lbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1IZWFkZXItPm51bV9zdHJlYW1zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSGVhZGVyLT5udW1fY291cGxlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhbm5lbF9tYXBwaW5nLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmc3RhdHVzKTsKKyAgICAgICAgICAgICAgICBpZiAoIW1EZWNvZGVyIHx8IHN0YXR1cyAhPSBPUFVTX09LKSB7CisgICAgICAgICAgICAgICAgICAgIEFMT0dWKCJvcHVzX211bHRpc3RyZWFtX2RlY29kZXJfY3JlYXRlIGZhaWxlZCBzdGF0dXM9JXMiLAorICAgICAgICAgICAgICAgICAgICAgICAgICBvcHVzX3N0cmVycm9yKHN0YXR1cykpOworICAgICAgICAgICAgICAgICAgICBub3RpZnkoT01YX0V2ZW50RXJyb3IsIE9NWF9FcnJvclVuZGVmaW5lZCwgMCwgTlVMTCk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc3RhdHVzID0KKyAgICAgICAgICAgICAgICAgICAgb3B1c19tdWx0aXN0cmVhbV9kZWNvZGVyX2N0bChtRGVjb2RlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPUFVTX1NFVF9HQUlOKG1IZWFkZXItPmdhaW5fZGIpKTsKKyAgICAgICAgICAgICAgICBpZiAoc3RhdHVzICE9IE9QVVNfT0spIHsKKyAgICAgICAgICAgICAgICAgICAgQUxPR1YoIkZhaWxlZCB0byBzZXQgT1BVUyBoZWFkZXIgZ2Fpbjsgc3RhdHVzPSVzIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgb3B1c19zdHJlcnJvcihzdGF0dXMpKTsKKyAgICAgICAgICAgICAgICAgICAgbm90aWZ5KE9NWF9FdmVudEVycm9yLCBPTVhfRXJyb3JVbmRlZmluZWQsIDAsIE5VTEwpOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIGlmIChtSW5wdXRCdWZmZXJDb3VudCA9PSAxKSB7CisgICAgICAgICAgICAgICAgbUNvZGVjRGVsYXkgPSBuc190b19zYW1wbGVzKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocmVpbnRlcnByZXRfY2FzdDxpbnQ2NF90Kj4oaW5IZWFkZXItPnBCdWZmZXIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5IZWFkZXItPm5PZmZzZXQpKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrUmF0ZSk7CisgICAgICAgICAgICAgICAgbVNhbXBsZXNUb0Rpc2NhcmQgPSBtQ29kZWNEZWxheTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbVNlZWtQcmVSb2xsID0gbnNfdG9fc2FtcGxlcygKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihyZWludGVycHJldF9jYXN0PGludDY0X3QqPihpbkhlYWRlci0+cEJ1ZmZlciArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5IZWFkZXItPm5PZmZzZXQpKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga1JhdGUpOworICAgICAgICAgICAgICAgIG5vdGlmeShPTVhfRXZlbnRQb3J0U2V0dGluZ3NDaGFuZ2VkLCAxLCAwLCBOVUxMKTsKKyAgICAgICAgICAgICAgICBtT3V0cHV0UG9ydFNldHRpbmdzQ2hhbmdlID0gQVdBSVRJTkdfRElTQUJMRUQ7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChpbkhlYWRlci0+bkZsYWdzICYgT01YX0JVRkZFUkZMQUdfRU9TKSB7CisgICAgICAgICAgICAgICAgaGFuZGxlRU9TKCk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorCiAgICAgICAgICAgICBpblF1ZXVlLmVyYXNlKGluUXVldWUuYmVnaW4oKSk7CiAgICAgICAgICAgICBpbkluZm8tPm1Pd25lZEJ5VXMgPSBmYWxzZTsKICAgICAgICAgICAgIG5vdGlmeUVtcHR5QnVmZmVyRG9uZShpbkhlYWRlcik7Ci0gICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICArK21JbnB1dEJ1ZmZlckNvdW50OworCisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIElnbm9yZSBDU0QgcmUtc3VibWlzc2lvbnMuCisgICAgICAgIGlmIChtSW5wdXRCdWZmZXJDb3VudCA+PSAzICYmIChpbkhlYWRlci0+bkZsYWdzICYgT01YX0JVRkZFUkZMQUdfQ09ERUNDT05GSUcpKSB7CisgICAgICAgICAgICBpZiAoaW5IZWFkZXItPm5GbGFncyAmIE9NWF9CVUZGRVJGTEFHX0VPUykgeworICAgICAgICAgICAgICAgIGhhbmRsZUVPUygpOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaW5RdWV1ZS5lcmFzZShpblF1ZXVlLmJlZ2luKCkpOworICAgICAgICAgICAgaW5JbmZvLT5tT3duZWRCeVVzID0gZmFsc2U7CisgICAgICAgICAgICBub3RpZnlFbXB0eUJ1ZmZlckRvbmUoaW5IZWFkZXIpOworICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgIH0KIAogICAgICAgICBCdWZmZXJJbmZvICpvdXRJbmZvID0gKm91dFF1ZXVlLmJlZ2luKCk7CiAgICAgICAgIE9NWF9CVUZGRVJIRUFERVJUWVBFICpvdXRIZWFkZXIgPSBvdXRJbmZvLT5tSGVhZGVyOwogCiAgICAgICAgIGlmICgoaW5IZWFkZXItPm5GbGFncyAmIE9NWF9CVUZGRVJGTEFHX0VPUykgJiYgaW5IZWFkZXItPm5GaWxsZWRMZW4gPT0gMCkgewotICAgICAgICAgICAgaW5RdWV1ZS5lcmFzZShpblF1ZXVlLmJlZ2luKCkpOwotICAgICAgICAgICAgaW5JbmZvLT5tT3duZWRCeVVzID0gZmFsc2U7Ci0gICAgICAgICAgICBub3RpZnlFbXB0eUJ1ZmZlckRvbmUoaW5IZWFkZXIpOwotCi0gICAgICAgICAgICBvdXRIZWFkZXItPm5GaWxsZWRMZW4gPSAwOwotICA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mJlZ2luKCkpOwotICAgICAgICAgICAgaW5JbmZvID0gTlVMTDsKLSAgICAgICAgICAgIG5vdGlmeUVtcHR5QnVmZmVyRG9uZShpbkhlYWRlcik7Ci0gICAgICAgICAgICBpbkhlYWRlciA9IE5VTEw7CisgICAgICAgICAgICBvdXRIZWFkZXItPm5GbGFncyA9IDA7CiAgICAgICAgIH0KIAorICAgICAgICBpbkluZm8tPm1Pd25lZEJ5VXMgPSBmYWxzZTsKKyAgICAgICAgaW5RdWV1ZS5lcmFzZShpblF1ZXVlLmJlZ2luKCkpOworICAgICAgICBub3RpZnlFbXB0eUJ1ZmZlckRvbmUoaW5IZWFkZXIpOworICAgICAgICArK21JbnB1dEJ1ZmZlckNvdW50OworCiAgICAgICAgIG91dEluZm8tPm1Pd25lZEJ5VXMgPSBmYWxzZTsKICAgICAgICAgb3V0UXVldWUuZXJhc2Uob3V0UXVldWUuYmVnaW4oKSk7Ci0gICAgICAgIG91dEluZm8gPSBOVUxMOwogICAgICAgICBub3RpZnlGaWxsQnVmZmVyRG9uZShvdXRIZWFkZXIpOwotICAgICAgICBvdXRIZWFkZXIgPSBOVUxMOwotCi0gICAgICAgICsrbUlucHV0QnVmZmVyQ291bnQ7CiAgICAgfQogfQogCkBAIC01MjYsNiArNjAxLDcgQEAKICAgICAgICAgb3B1c19tdWx0aXN0cmVhbV9kZWNvZGVyX2N0bChtRGVjb2RlciwgT1BVU19SRVNFVF9TVEFURSk7CiAgICAgICAgIG1BbmNob3JUaW1lVXMgPSAwOwogICAgICAgICBtU2FtcGxlc1RvRGlzY2FyZCA9IG1TZWVrUHJlUm9sbDsKKyAgICAgICAgbUhhdmVFT1MgPSBmYWxzZTsKICAgICB9CiB9CiAKQEAgLTU0Miw2ICs2MTgsNyBAQAogICAgIH0KIAogICAgIG1PdXRwdXRQb3J0U2V0dGluZ3NDaGFuZ2UgPSBOT05FOworICAgIG1IYXZlRU9TID0gZmFsc2U7CiB9CiAKIHZvaWQgU29mdE9wdXM6Om9u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ICAgICAgICAoT01YX0FVRElPX1BBUkFNX1BPUlRGT1JNQVRUWVBFICopcGFyYW1zOworCisgICAgICAgICAgICBpZiAoIWlzVmFsaWRPTVhQYXJhbShmb3JtYXRQYXJhbXMpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvckJhZFBhcmFtZXRlcjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKGZvcm1hdFBhcmFtcy0+blBvcnRJbmRleCA+IDEpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoZm9ybWF0UGFyYW1zLT5uSW5kZXggPiAwKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvck5vTW9yZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZm9ybWF0UGFyYW1zLT5lRW5jb2RpbmcgPSBPTVhfQVVESU9fQ29kaW5nUENNOworCisgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9uZTsKKyAgICAgICAgfQorCiAgICAgICAgIGNhc2UgT01YX0luZGV4UGFyYW1BdWRpb1BjbToKICAgICAgICAgewogICAgICAgICAgICAgT01YX0FVRElPX1BBUkFNX1BDTU1PREVUWVBFICpwY21QYXJhbXMgPQpAQCAtMTUzLDYgKzE3NSwyNiBAQAogICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvck5vbmU7CiAgICAgICAgIH0KIAorICAgICAgICBjYXNlIE9NWF9JbmRleFBhcmFtQXVkaW9Qb3J0Rm9ybWF0OgorICAgICAgICB7CisgICAgICAgICAgICBjb25zdCBPTVhfQVVESU9fUEFSQU1fUE9SVEZPUk1BVFRZUEUgKmZvcm1hdFBhcmFtcyA9CisgICAgICAgICAgICAgICAgKGNvbnN0IE9NWF9BVURJT19QQVJBTV9QT1JURk9STUFUVFlQRSAqKXBhcmFtczsKKworICAgICAgICAgICAgaWYgKCFpc1Zh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kluZGV4ID4gMCkgeworICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JOb01vcmU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZvcm1hdFBhcmFtcy0+ZUVuY29kaW5nID0KKyAgICAgICAgICAgICAgICAoZm9ybWF0UGFyYW1zLT5uUG9ydEluZGV4ID09IDApCisgICAgICAgICAgICAgICAgICAgID8gT01YX0FVRElPX0NvZGluZ1ZPUkJJUyA6IE9NWF9BVURJT19Db2RpbmdQQ007CisKKyAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JOb25lOworICAgICAgICB9CisKICAgICAgICAgY2FzZSBPTVhfSW5kZXhQYXJhbUF1ZGlvVm9yYmlzOgogICAgICAgICB7CiAgICAgICAgICAgICBPTVhfQVVESU9fUEFSQU1fVk9SQklTVFlQRSAqdm9yYmlzUGFyYW1zID0KQEAgLTIyMSw2ICsyNDUsMjkgQEAKICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JOb25lOwogICAgICAgICB9CiAKKyAgICAgICAgY2FzZSBPTVhfSW5kZXhQYXJhbUF1ZGlvUG9ydEZvcm1hdDoKKyAgICAgICAgeworICAgICAgICAgICAgY29uc3QgT01YX0FVRElPX1BBUkFNX1BPUlRGT1JNQVRUWVBFICpmb3JtYXRQYXJhbXMgPQorICAgICAgICAgICAgICAgIChjb25zdCBPTVhfQVVESU9fUEFSQU1fUE9SVEZPUk1BVFRZUEUgKilwYXJhbXM7CisKKyAgICAgICAgICAgIGlmICghaXNWYWxpZE9NWFBhcmFtKGZvcm1hdFBhcmFtcykpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yQmFkUGFyYW1ldGVyOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoZm9ybWF0UGFyYW1zLT5uUG9ydEluZGV4ID4gMSkgeworICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JVbmRlZmluZWQ7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmICgoZm9ybWF0UGFyYW1zLT5uUG9ydEluZGV4ID09IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIGZvcm1hdFBhcmFtcy0+ZUVuY29kaW5nICE9IE9NWF9BVURJT19Db2RpbmdWT1JCSVMpCisgICAgICAgICAgICAgICAgfHwgKGZvcm1hdFBhcmFtcy0+blBvcnRJbmRleCA9PSAxCisgICAgICAgICAgICAgICAgICAgICAgICAmJiBmb3JtYXRQYXJhbXMtPmVFbmNvZGluZyAhPSBPTVhfQVVESU9fQ29kaW5nUENNKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JVbmRlZmluZWQ7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JOb25lOworICAgICAgICB9CisKICAgICAgICAgY2FzZSBPTVhfSW5kZXhQYXJhbUF1ZGlvVm9yYmlzOgogICAgICAgICB7CiAgICAgICAgICAgICBjb25zdCBPTVhfQVVESU9fUEFSQU1fVk9SQklTVFlQRSAqdm9yYmlzUGFyYW1zID0KQEAgLTI2Miw3ICszMDksMzMgQEAKICAgICBvZ2dwYWNrX3JlYWRpbml0KGJpdHMsIHJlZik7CiB9CiAKLXZvaWQgU29mdFZvcmJpczo6b25RdWV1ZUZpbGxlZChPTVhfVTMyIHBvcnRJbmRleCkgewordm9pZCBTb2Z0Vm9yYmlzOjpoYW5kbGVFT1MoKSB7CisgICAgTGlzdDxCdWZmZXJJbmZvICo+ICZpblF1ZXVlID0gZ2V0UG9ydFF1ZXVlKDApOworICAgIExpc3Q8QnVmZmVySW5mbyAqPiAmb3V0UXVldWUgPSBnZXRQb3J0UXVldWUoMSk7CisKKyAgICBDSEVDSyghaW5RdWV1ZS5lbXB0eSgpICYmICFvdXRRdWV1ZS5lbXB0eSgpKTsKKworICAgIG1TYXdJbnB1dEVvcyA9IHRydWU7CisKKyAgICBCdWZmZXJJbmZvICpvdXRJbmZvID0gKm91dFF1ZXVlLmJlZ2lu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NfdW5wYWNrX2luZm8obVZpLCAmYml0cyk7Ci0gICAgICAgICAgICBpZiAocmV0ICE9IDApIHsKLSAgICAgICAgICAgICAgICBub3RpZnkoT01YX0V2ZW50RXJyb3IsIE9NWF9FcnJvclVuZGVmaW5lZCwgcmV0LCBOVUxMKTsKLSAgICAgICAgICAgICAgICBtU2lnbmFsbGVkRXJyb3IgPSB0cnVlOwotICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGludCByZXQgPSBfdm9yYmlzX3VucGFja19ib29rcyhtVmksICZiaXRzKTsKLSAgICAgICAgICAgIGlmIChyZXQgIT0gMCkgewotICAgICAgICAgICAgICAgIG5vdGlmeShPTVhfRXZlbnRFcnJvciwgT01YX0Vycm9yVW5kZWZpbmVkLCByZXQsIE5VTEwpOwotICAgICAgICAgICAgICAgIG1TaWduYWxsZWRFcnJvciA9IHRydWU7Ci0gICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBDSEVDSyhtU3RhdGUgPT0gTlVMTCk7Ci0gICAgICAgICAgICBtU3RhdGUgPSBuZXcgdm9yYmlzX2RzcF9zdGF0ZTsKLSAgICAgICAgICAgIENIRUNLX0VRKDAsIHZvcmJpc19kc3BfaW5pdChtU3RhdGUsIG1WaSkpOwotCi0gICAgICAgICAgICBpZiAobVZpLT5yYXRlICE9IGtEZWZhdWx0U2FtcGxpbmdSYXRlIHx8Ci0gICAgICAgICAgICAgICAgICAgIG1WaS0+Y2hhbm5lbHMgIT0ga0RlZmF1bHRDaGFubmVsQ291bnQpIHsKLSAgICAgICAgICAgICAgICBBTE9HVigidm9yYmlzOiByYXRlL2NoYW5uZWxzIGNoYW5nZWQ6ICVsZC8lZCIsIG1WaS0+cmF0ZSwgbVZpLT5jaGFubmVscyk7Ci0gICAgICAgICAgICAgICAgbm90aWZ5KE9NWF9FdmVudFBvcnRTZXR0aW5n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YWRlci0+bkZpbGxlZExlbjsKKworICAgICAgICAgICAgICAgIGlmICgoaW5IZWFkZXItPm5GbGFncyAmIE9NWF9CVUZGRVJGTEFHX0VPUykgJiYgc2l6ZSA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgIGhhbmRsZUVPUygpOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKHNpemUgPCA3KSB7CisgICAgICAgICAgICAgICAgICAgIEFMT0dFKCJUb28gc21hbGwgaW5wdXQgYnVmZmVyOiAlenUgYnl0ZXMiLCBzaXplKTsKKyAgICAgICAgICAgICAgICAgICAgYW5kcm9pZF9lcnJvcldyaXRlTG9nKDB4NTM0ZTQ1NTQsICIyNzgzMzYxNiIpOworICAgICAgICAgICAgICAgICAgICBub3RpZnkoT01YX0V2ZW50RXJyb3IsIE9NWF9FcnJvclVuZGVmaW5lZCwgMCwgTlVMTCk7CisgICAgICAgICAgICAgICAgICAgIG1TaWduYWxsZWRFcnJvciA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBvZ2dfYnVmZmVyIGJ1ZjsKKyAgICAgICAgICAgICAgICBvZ2dfcmVmZXJlbmNlIHJlZjsKKyAgICAgICAgICAgICAgICBvZ2dwYWNrX2J1ZmZlciBiaXRzOworCisgICAgICAgICAgICAgICAgbWFrZUJpdFJlYWRlcigoY29uc3QgdWludDhfdCAqKWRhdGEgKyA3LCBzaXplIC0gNywgJmJ1ZiwgJnJlZiwgJmJpdHMpOworCisgICAgICAgICAgICAgICAgaWYgKG1JbnB1dEJ1ZmZlckNvdW50ID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgQ0hFQ0sobVZpID09IE5VTEwpOworICAgICAgICAgICAgICAgICAgICBtVmkgPSBuZXcgdm9yYmlzX2luZm87CisgICAgICAgICAgICAgICAgICAgIHZvcmJpc19pbmZvX2luaXQobVZpKTsKKworICAgICAgICAgICAgICAgICAgICBpbnQgcmV0ID0gX3ZvcmJpc191bnBhY2tfaW5mbyhtVmksICZiaXRzKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHJldCAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBub3RpZnkoT01YX0V2ZW50RXJyb3IsIE9NWF9FcnJvclVuZGVmaW5lZCwgcmV0LCBOVUxMKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1TaWduYWxsZWRFcnJvciA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBpbnQgcmV0ID0gX3ZvcmJpc191bnBhY2tfYm9va3MobVZpLCAmYml0cyk7CisgICAgICAgICAgICAgICAgICAgIGlmIChyZXQgIT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbm90aWZ5KE9NWF9FdmVudEVycm9yLCBPTVhfRXJyb3JVbmRlZmluZWQsIHJldCwgTlVMTCk7CisgICAgICAgICAgICAgICAgICAgICAgICBtU2lnbmFsbGVkRXJyb3IgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgQ0hFQ0sobVN0YXRlID09IE5VTEwpOworICAgICAgICAgICAgICAgICAgICBtU3RhdGUgPSBuZXcgdm9yYmlzX2RzcF9zdGF0ZTsKKyAgICAgICAgICAgICAgICAgICAgQ0hFQ0tfRVEoMCwgdm9yYmlzX2RzcF9pbml0KG1TdGF0ZSwgbVZpKSk7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1WaS0+cmF0ZSAhPSBrRGVmYXVsdFNhbXBsaW5nUmF0ZSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1WaS0+Y2hhbm5lbHMgIT0ga0RlZmF1bHRDaGFubmVsQ291bnQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIEFMT0dWKCJ2b3JiaXM6IHJhdGUvY2hhbm5lbHMgY2hhbmdlZDogJWxkLyVkIiwgbVZpLT5yYXRlLCBtVmktPmNoYW5uZWxzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG5vdGlmeShPTVhfRXZlbnRQb3J0U2V0dGluZ3NDaGFuZ2VkLCAxLCAwLCBOVUxMKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1PdXRwdXRQb3J0U2V0dGluZ3NDaGFuZ2UgPSBBV0FJVElOR19ESVNBQkxFRDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChpbkhlYWRlci0+bkZsYWdzICYgT01YX0JVRkZFUkZMQUdfRU9TKSB7CisgICAgICAgICAgICAgICAgICAgIGhhbmRsZUVPUygpOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaW5RdWV1ZS5lcmFzZShpblF1ZXVlLmJlZ2luKCkpOworICAgICAgICAgICAgICAgIGluSW5mby0+bU93bmVkQnlVcyA9IGZhbHNlOworICAgICAgICAgICAgICAgIG5vdGlmeUVtcHR5QnVmZmVyRG9uZShpbkhlYWRlcik7CisgICAgICAgICAgICAgICAgKyttSW5wdXRCdWZmZXJDb3VudDsKKworICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgfQorCiAgICAgICAgICAgICBpZiAoaW5IZWFkZXItPm5GbGFncyAmIE9NWF9CVUZGRVJGTEFHX0VPUykgewogICAgICAgICAgICAgICAgIG1TYXdJbnB1dEVvcyA9IHRydWU7CiAgICAgICAgICAgICB9CkBAIC0zNTksOCArNDM3LDcgQEAKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBtZW1jcHkoJm51bVBhZ2VTYW1wbGVzLAotICAgICAgICAgICAgICAgICAgICAgICBpbkhlYWRlci0+cEJ1ZmZlcgotICAgICAgICAgICAgICAgICAgICAgICAgKyBpbkhlYWRlci0+bk9mZnNldCArIGluSGVhZGVyLT5uRmlsbGVkTGVuIC0gNCwKKyAgICAgICAgICAgICAgICAgICAgICAgaW5IZWFkZXItPnBCdWZmZXIgKyBpbkhlYWRlci0+bk9mZnNldCArIGluSGVhZGVyLT5uRmlsbGVkTGVuIC0gNCwKICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKG51bVBhZ2VTYW1wbGVzKSk7CiAKICAgICAgICAgICAgICAgICBpZiAoaW5IZWFkZXItPm5PZmZzZXQgPT0gMCkgewpAQCAtMzk5LDYgKzQ3NiwxNCBAQAogICAgICAgICBpbnQgbnVtRnJhbWVzID0gMDsKIAogICAgICAgICBvdXRIZWFkZXItPm5GbGFncyA9IDA7CisKKyAgICAgICAgaWYgKG1TdGF0ZSA9PSBudWxscHRyIHx8IG1WaSA9PSBudWxscHRyKSB7CisgICAgICAgICAgICBub3RpZnkoT01YX0V2ZW50RXJyb3IsIE9NWF9FcnJvclN0cmVhbUNvcnJ1cHQsIDAsIE5VTEwpOworICAgICAgICAgICAgbVNpZ25hbGxlZEVycm9yID0gdHJ1ZTsKKyAgICAgICAgICAgIEFMT0dFKCJvblF1ZXVlRmlsbGVkLCBpbnB1dCBkb2VzIG5vdCBoYXZlIENTRCIpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKICAgICAgICAgaW50IGVyciA9IHZvcmJpc19kc3Bfc3ludGhlc2lzKG1TdGF0ZSwgJnBhY2ssIDEpOwogICAgICAgICBpZiAoZXJyICE9IDApIHsKICAgICAgICAgICAgIC8vIEZJWE1FIHRlbXBvcmFyeSB3b3JrYXJvdW5kIGZvciBsb2cgc3BhbQpAQCAtNDQ4LDE4ICs1MzMsMTMgQEAKICAgICAgICAgaWYgKGluSGVhZGVyKSB7CiAgICAgICAgICA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UgLyAyLAorICAgICAgICAgICAgICAgICh1aW50OCAqKWRzdF9wdHIsIGRzdC5tU3RyaWRlLCBzcmMuY3JvcFdpZHRoKCksIHNyYy5jcm9wSGVpZ2h0KCksIGxpYnl1djo6Rk9VUkNDX0FCR1IpOworICAgICAgICBicmVhazsKKworICAgIGNhc2UgT01YX0NPTE9SX0Zvcm1hdDMyYml0QkdSQTg4ODg6CisgICAgICAgIGxpYnl1djo6Q29udmVydEZyb21JNDIwKHNyY195LCBzcmMubVN0cmlkZSwgc3JjX3UsIHNyYy5tU3RyaWRlIC8gMiwgc3JjX3YsIHNyYy5tU3RyaWRlIC8gMiwKKyAgICAgICAgICAgICAgICAodWludDggKilkc3RfcHRyLCBkc3QubVN0cmlkZSwgc3JjLmNyb3BXaWR0aCgpLCBzcmMuY3JvcEhlaWdodCgpLCBsaWJ5dXY6OkZPVVJDQ19BUkdCKTsKKyAgICAgICAgYnJlYWs7CisKKyAgICBkZWZhdWx0OgorICAgICAgICByZXR1cm4gRVJST1JfVU5TVVBQT1JURUQ7CisgICAgfQogCiAgICAgcmV0dXJuIE9LOwogfQogCit2b2lkIENvbG9yQ29udmVydGVyOjp3cml0ZVRvRHN0KAorICAgICAgICB2b2lkICpkc3RfcHRyLCB1aW50OF90ICprQWRqdXN0ZWRDbGlwLCBib29sIHVuY3JvcHBlZCwKKyAgICAgICAgc2lnbmVkIHIxLCBzaWduZWQgZzEsIHNpZ25lZCBiMSwKKyAgICAgICAgc2lnbmVkIHIyLCBzaWduZWQgZzIsIHNpZ25lZCBiMikgeworICAgIHN3aXRjaCAobURzdEZvcm1hdCkgeworICAgIGNhc2UgT01YX0NPTE9SX0Zvcm1hdDE2Yml0UkdCNTY1OgorICAgIHsKKyAgICAgICAgdWludDMyX3QgcmdiMSA9CisgICAgICAgICAgICAoKGtBZGp1c3RlZENsaXBbcjFdID4+IDMpIDw8IDExKQorICAgICAgICAgICAgfCAoKGtBZGp1c3RlZENsaXBbZzFdID4+IDIpIDw8IDUpCisgICAgICAgICAgICB8IChrQWRqdXN0ZWRDbGlwW2IxXSA+PiAzKTsKKworICAgICAgICBpZiAodW5jcm9wcGVkKSB7CisgICAgICAgICAgICB1aW50MzJfdCByZ2IyID0KKyAgICAgICAgICAgICAgICAoKGtBZGp1c3RlZENsaXBbcjJdID4+IDMpIDw8IDExKQorICAgICAgICAgICAgICAgIHwgKChrQWRqdXN0ZWRDbGlwW2cyXSA+PiAyKSA8PCA1KQorICAgICAgICAgICAgICAgIHwgKGtBZGp1c3RlZENsaXBbYjJdID4+IDMpOworCisgICAgICAgICAgICAqKHVpbnQzMl90ICopZHN0X3B0ciA9IChyZ2IyIDw8IDE2KSB8IHJnYjE7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAqKHVpbnQxNl90ICopZHN0X3B0ciA9IHJnYjE7CisgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgT01YX0NPTE9SX0Zvcm1hdDMyQml0UkdCQTg4ODg6CisgICAgeworICAgICAgICAoKHVpbnQzMl90ICopZHN0X3B0cilbMF0gPQorICAgICAgICAgICAgICAgIChrQWRqdXN0ZWRDbGlwW3IxXSkKKyAgICAgICAgICAgICAgICB8IChrQWRqdXN0ZWRDbGlwW2cxXSA8PCA4KQorICAgICAgICAgICAgICAgIHwgKGtBZGp1c3RlZENsaXBbYjFdIDw8IDE2KQorICAgICAgICAgICAgICAgIHwgKDB4RkYgPDwgMjQpOworCisgICAgICAgIGlmICh1bmNyb3BwZWQpIHsKKyAgICAgICAgICAgICgodWludDMyX3QgKilkc3RfcHRyKVsxXSA9CisgICAgICAgICAgICAgICAgICAgIChrQWRqdXN0ZWRDbGlwW3IyXSkKKyAgICAgICAgICAgICAgICAgICAgfCAoa0FkanVzdGVkQ2xpcFtnMl0gPDwgOCkKKyAgICAgICAgICAgICAgICAgICAgfCAoa0FkanVzdGVkQ2xpcFtiMl0gPDwgMTYpCisgICAgICAgICAgICAgICAgICAgIHwgKDB4RkYgPDwgMjQpOworICAgICAgICB9CisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE9NWF9DT0xPUl9Gb3JtYXQzMmJpdEJHUkE4ODg4OgorICAgIHsKKyAgICAgICAgKCh1aW50MzJfdCAqKWRzdF9wdHIpWzBdID0KKyAgICAgICAgICAgICAgICAoa0FkanVzdGVkQ2xpcFtiMV0pCisgICAgICAgICAgICAgICAgfCAoa0FkanVzdGVkQ2xpcFtnMV0gPDwgOCkKKyAgICAgICAgICAgICAgICB8IChrQWRqdXN0ZWRDbGlwW3IxXSA8PCAxNikKKyAgICAgICAgICAgICAgICB8ICgweEZGIDw8IDI0KTsKKworICAgICAgICBpZiAodW5jcm9wcGVkKSB7CisgICAgICAgICAgICAoKHVpbnQzMl90ICopZHN0X3B0cilbMV0gPQorICAgICAgICAgICAgICAgICAgICAoa0FkanVzdGVkQ2xpcFtiMl0pCisgICAgICAgICAgICAgICAgICAgIHwgKGtBZGp1c3RlZENsaXBbZzJdIDw8IDgpCisgICAgICAgICAgICAgICAgICAgIHwgKGtBZGp1c3RlZENsaXBbcjJdIDw8IDE2KQorICAgICAgICAgICAgICAgICAgICB8ICgweEZGIDw8IDI0KTsKKyAgICAgICAgfQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgZGVmYXVsdDoKKyAgICAgICAgYnJlYWs7CisgICAgfQorfQogc3RhdHVzX3QgQ29sb3JDb252ZXJ0ZXI6OmNvbnZlcnRZVVY0MjBQbGFuYXIoCiAgICAgICAgIGNvbnN0IEJpdG1hcFBhcmFtcyAmc3JjLCBjb25zdCBCaXRtYXBQYXJhbXMgJmRzdCkgewogICAgIGlmICghKChzcmMubUNyb3BMZWZ0ICYgMSkgPT0gMApAQCAtMjQyLDE4ICszNDYsMTggQEAKIAogICAgIHVpbnQ4X3QgKmtBZGp1c3RlZENsaXAgPSBpbml0Q2xpcCgpOwogCi0gICAgdWludDE2X3QgKmRzdF9wdHIgPSAodWludDE2X3QgKilkc3QubUJpdHMKL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ICsreSkgewogICAgICAgICBmb3IgKHNpemVfdCB4ID0gMDsgeCA8IHNyYy5jcm9wV2lkdGgoKTsgeCArPSAyKSB7CkBAIC0yOTYsMzEgKzQwMCwxOSBAQAogICAgICAgICAgICAgc2lnbmVkIGcyID0gKHRtcDIgKyB2X2cgKyB1X2cpIC8gMjU2OwogICAgICAgICAgICAgc2lnbmVkIHIyID0gKHRtcDIgKyB2X3IpIC8gMjU2OwogCi0gICAgICAgICAgICB1aW50MzJfdCByZ2IxID0KLSAgICAgICAgICAgICAgICAoKGtBZGp1c3RlZENsaXBbcjFdID4+IDMpIDw8IDExKQotICAgICAgICAgICAgICAgIHwgKChrQWRqdXN0ZWRDbGlwW2cxXSA+PiAyKSA8PCA1KQotICAgICAgICAgICAgICAgIHwgKGtBZGp1c3RlZENsaXBbYjFdID4+IDMpOwotCi0gICAgICAgICAgICB1aW50MzJfdCByZ2IyID0KLSAgICAgICAgICAgICAgICAoKGtBZGp1c3RlZENsaXBbcjJdID4+IDMpIDw8IDExKQotICAgICAgICAgICAgICAgIHwgKChrQWRqdXN0ZWRDbGlwW2cyXSA+PiAyKSA8PCA1KQotICAgICAgICAgICAgICAgIHwgKGtBZGp1c3RlZENsaXBbYjJdID4+IDMpOwotCi0gICAgICAgICAgICBpZiAoeCArIDEgPCBzcmMuY3JvcFdpZHRoKCkpIHsKLSAgICAgICAgICAgICAgICAqKHVpbnQzMl90ICopKCZkc3RfcHRyW3hdKSA9IChyZ2IyIDw8IDE2KSB8IHJnYjE7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGRzdF9wdHJbeF0gPSByZ2IxOwotICAgICAgICAgICAgfQorICAgICAgICAgICAgYm9vbCB1bmNyb3BwZWQgPSB4ICsgMSA8IHNyYy5jcm9wV2lkdGgoKTsKKyAgICAgICAgICAgICh2b2lkKXdyaXRlVG9Ec3QoZHN0X3B0ciArIHggKiBkc3QubUJwcCwKKyAgICAgICAgICAgICAgICAgICAga0FkanVzdG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DI2ICsgYyAtICdhJzsKICAgICAgICAgfSBlbHNlIGlmIChjID49ICcwJyAmJiBjIDw9ICc5JykgewogICAgICAgICAgICAgdmFsdWUgPSA1MiArIGMgLSAnMCc7Ci0gICAgICAgIH0gZWxzZSBpZiAoYyA9PSAnKycpIHsKKyAgICAgICAgfSBlbHNlIGlmIChjID09ICcrJyB8fCBjID09ICctJykgewogICAgICAgICAgICAgdmFsdWUgPSA2MjsKLSAgICAgICAgfSBlbHNlIGlmIChjID09ICcvJykgeworICAgICAgICB9IGVsc2UgaWYgKGMgPT0gJy8nIHx8IGMgPT0gJ18nKSB7CiAgICAgICAgICAgICB2YWx1ZSA9IDYzOwogICAgICAgICB9IGVsc2UgaWYgKGMgIT0gJz0nKSB7CiAgICAgICAgICAgICByZXR1cm4gTlVMTDsKQEAgLTE0NCw0ICsxNDQsMjYgQEAKICAgICB9CiB9CiAKK3ZvaWQgZW5jb2RlQmFzZTY0VXJsKAorICAgICAgICBjb25zdCB2b2lkICpfZGF0YSwgc2l6ZV90IHNpemUsIEFTdHJpbmcgKm91dCkgeworICAgIGVuY29kZUJhc2U2NChfZGF0YSwgc2l6ZSwgb3V0KTsKKworICAgIGlmICgoLTEgIT0gb3V0LT5maW5kKCIrIikpIHx8ICgtMSAhPSBvdXQtPmZpbmQoIi8iKSkpIHsKKyAgICAgICAgc2l6ZV90IG91dExlbiA9IG91dC0+c2l6ZSgpOworICAgICAgICBjaGFyICpiYXNlNjR1cmwgPSBuZXcgY2hhcltvdXRMZW5dOworICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IG91dExlbjsgKytpKSB7CisgICAgICAgICAgICBpZiAob3V0LT5jX3N0cigpW2ldID09ICcrJykKKyAgICAgICAgICAgICAgICBiYXNlNjR1cmxbaV0gPSAnLSc7CisgICAgICAgICAgICBlbHNlIGlmIChvdXQtPmNfc3RyKClbaV0gPT0gJy8nKQorICAgICAgICAgICAgICAgIGJhc2U2NHVybFtpXSA9ICdfJzsKKyAgIC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BJRCwgc3RhdHVzLmV4Y2VwdGlvbkNvZGUoKSk7CisgICAgICAgIERlc3RpbmF0aW9uQnVmZmVyIGRzdEJ1ZmZlcjsKKyAgICAgICAgZHN0QnVmZmVyLnR5cGUgPSBCdWZmZXJUeXBlOjpTSEFSRURfTUVNT1JZOworICAgICAgICBkc3RCdWZmZXIubm9uc2VjdXJlTWVtb3J5ID0gbURlc2NyYW1ibGVyU3JjQnVmZmVyOworCisgICAgICAgIGF1dG8gcmV0dXJuVm9pZCA9IG1EZXNjcmFtYmxlci0+ZGVzY3JhbWJsZSgKKyAgICAgICAgICAgICAgICAoU2NyYW1ibGluZ0NvbnRyb2wpIHNjdHJsLAorICAgICAgICAgICAgICAgIHN1YlNhbXBsZXMsCisgICAgICAgICAgICAgICAgbURlc2NyYW1ibGVyU3JjQnVmZmVyLAorICAgICAgICAgICAgICAgIHNyY09mZnNldCwKKyAgICAgICAgICAgICAgICBkc3RCdWZmZXIsCisgICAgICAgICAgICAgICAgZHN0T2Zmc2V0LAorICAgICAgICAgICAgICAgIFsmc3RhdHVzLCAmYnl0ZXNXcml0dGVuLCAmZGV0YWlsZWRFcnJvcl0gKAorICAgICAgICAgICAgICAgICAgICAgICAgU3RhdHVzIF9zdGF0dXMsIHVpbnQzMl90IF9ieXRlc1dyaXR0ZW4sCisgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBoaWRsX3N0cmluZyYgX2RldGFpbGVkRXJyb3IpIHsKKyAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gX3N0YXR1czsKKyAgICAgICAgICAgICAgICAgICAgYnl0ZXNXcml0dGVuID0gX2J5dGVzV3JpdHRlbjsKKyAgICAgICAgICAgICAgICAgICAgZGV0YWlsZWRFcnJvciA9IF9kZXRhaWxlZEVycm9yOworICAgICAgICAgICAgICAgIH0pOworCisgICAgICAgIGlmICghcmV0dXJuVm9pZC5pc09rKCkpIHsKKyAgICAgICAgICAgIEFMT0dFKCJbc3RyZWFtICVkXSBkZXNjcmF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zZWNvbmQucXVpcmtTZXQpIHsKICAgICAgICAgICAgICAgICBpZiAocXVpcmsgPT0gInJlcXVpcmVzLWFsbG9jYXRlLW9uLWlucHV0LXBvcnRzIikgewotICAgICAgICAgICAgICAgICAgICBxdWlya3MgfD0ga1JlcXVpcmVzQWxsb2NhdGVCdWZmZXJPbklucHV0UG9ydHM7CisgICAgICAgICAgICAgICAgICAgIHF1aXJrcyB8PSBPTVhOb2RlSW5zdGFuY2U6OgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtSZXF1aXJlc0FsbG9jYXRlQnVmZmVyT25JbnB1dFBvcnRzOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBpZiAocXVpcmsgPT0gInJlcXVpcmVzLWFsbG9jYXRlLW9uLW91dHB1dC1wb3J0cyIpIHsKLSAgICAgICAgICAgICAgICAgICAgcXVpcmtzIHw9IGtSZXF1aXJlc0FsbG9jYXRlQnVmZmVyT25PdXRwdXRQb3J0czsKKyAgICAgICAgICAgICAgICAgICAgcXVpcmtzIHw9IE9NWE5vZGVJbnN0YW5jZTo6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAga1JlcXVpcmVzQWxsb2NhdGVCdWZmZXJPbk91dHB1dFBvcnRzOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGluc3RhbmNlLT5zZXRRdWlya3MocXVpcmtzKTsKZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L29teC8xLjAvT214U3RvcmUuY3BwIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvb214LzEuMC9PbXhTdG9yZS5jcHAKaW5kZXggMGUzN2FmOS4uNDQ3YWY2ZiAxMDA2NDQKLS0tIGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvb214LzEuMC9PbXhTdG9yZS5jcHAKKysrIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvb214LzEuMC9PbXhTdG9yZS5jcHAKQEAgLTE5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7CisgICAgICAgICAgICBBTE9HRSgiVFdPbXhOb2RlV3JhcHBlciBmYWlsZWQgdG8gZGlzcGF0Y2ggbWVzc2FnZSAiCisgICAgICAgICAgICAgICAgICAgICJPTVhfRXZlbnREYXRhU3BhY2VDaGFuZ2VkOiAiCisgICAgICAgICAgICAgICAgICAgICJkYXRhU3BhY2UgPSAlbGQsIGFzcGVjdHMgPSAlbGQsIHBpeGVsRm9ybWF0ID0gJWxkIiwKKyAgICAgICAgICAgICAgICAgICAgc3RhdGljX2Nhc3Q8bG9uZz4oZGF0YVNwYWNlKSwKKyAgICAgICAgICAgICAgICAgICAgc3RhdGljX2Nhc3Q8bG9uZz4oYXNwZWN0cyksCisgICAgICAgICAgICAgICAgICAgIHN0YXRpY19jYXN0PGxvbmc+KHBpeGVsRm9ybWF0KSk7CisgICAgICAgIH0KICAgICB9CiB9OwogCkBAIC0xNDQsMTAgKzE1MCwxMyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgb3V0UGFyYW1zLmRhdGEoKSArIG91dFBhcmFtcy5zaXplKCksCiAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMpOwogICAgICAgICAgICAgfSk7Ci0gICAgb214Tm9kZS0+Z2V0UGFyYW1ldGVyKAorICAgIGF1dG8gdHJhbnNTdGF0dXMgPSBvbXhOb2RlLT5nZXRQYXJhbWV0ZXIoCiAgICAgICAgICAgICBzdGF0aWNfY2FzdDx1aW50MzJfdD4oT01YX0luZGV4UGFyYW1Db25zdW1lclVzYWdlQml0cyksCiAgICAgICAgICAgICBpbkhpZGxCeXRlcygmY29uc3VtZXJVc2FnZSwgc2l6ZW9mKGNvbnN1bWVyVXNhZ2UpKSwKICAgICAgICAgICAgIF9oaWRsX2NiKTsKKyAgICBpZiAoIXRyYW5zU3RhdHVzLmlzT2soKSkgeworICAgICAgICByZXR1cm4gdG9TdGF0dXMoRkFJTEVEX1RSQU5TQUNUSU9OKTsKKyAgICB9CiAgICAgaWYgKGZuU3RhdHVzICE9IE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WMgeworY2NfbGlicmFyeV9zaGFyZWQgewogICAgIG5hbWU6ICJsaWJzdGFnZWZyaWdodF9vbXhfdXRpbHMiLAorICAgIHZlbmRvcl9hdmFpbGFibGU6IHRydWUsCisgICAgdm5kazogeworICAgICAgICBlbmFibGVkOiB0cnVlLAorICAgIH0sCiAgICAgc3JjczogWyJPTVhVdGlscy5jcHAiXSwKLSAgICBpbmNsdWRlX2RpcnM6IFsKLSAgICAgICAgImZyYW1ld29ya3MvYXYvbWVkaWEvbGlic3RhZ2VmcmlnaHQiLAotICAgICAgICAiZnJhbWV3b3Jrcy9uYXRpdmUvaW5jbHVkZS9tZWRpYS9oYXJkd2FyZSIsCi0gICAgICAgICJmcmFtZXdvcmtzL25hdGl2ZS9pbmNsdWRlL21lZGlhL29wZW5tYXgiLAorICAgIGV4cG9ydF9pbmNsdWRlX2RpcnM6IFsKKyAgICAgICAgImluY2x1ZGUiLAogICAgIF0sCi0gICAgc2hhcmVkX2xpYnM6IFsibGlibWVkaWEiXSwKKyAgICBoZWFkZXJfbGliczogWworICAgICAgICAibWVkaWFfcGx1Z2luX2hlYWRlcnMiLAorICAgIF0sCisgICAgZXhwb3J0X2hlYWRlcl9saWJfaGVhZGVyczogWworICAgICAgICAibWVkaWFfcGx1Z2luX2hlYWRlcnMiLAorICAgIF0sCisgICAgc2hhcmVkX2xpYnM6IFsKKyAgICAgICAgImxpYm1lZGlhX29teCIsCisgICAgICAgICJsaWJsb2ciLAorICAgIF0sCisgICAgZXhwb3J0X3NoYXJlZF9saWJfaGVhZGVyczogWworICAgICAgICAibGlibWVkaWFfb214IiwKKyAgICBdLAogICAgIHNhbml0aXplOiB7CiAgICAgICAgIG1pc2NfdW5kZWZpbmVkOiBbCiAgICAgICAgICAgICAic2lnbmVkLWludGVnZXItb3ZlcmZsb3ciLApkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvb214L0JXR3JhcGhpY0J1ZmZlclNvdXJjZS5jcHAgYi9tZWR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AgICAgICAgICAgICAvLyBzbmFwIHRvIG5lYXJlc3QgY2FwdHVyZSBwb2ludAogICAgICAgICAgICAgaW50NjRfdCBuRnJhbWVzID0gc3RkOjpsbHJvdW5kKAotICAgICAgICAgICAgICAgICAgICAodGltZVVzIC0gbVByZXZDYXB0dXJlVXMpICogbUNhcHR1cmVGcHMpOworICAgICAgICAgICAgICAgICAgICAodGltZVVzIC0gbVByZXZDYXB0dXJlVXMpICogbUNhcHR1cmVGcHMgLyAxMDAwMDAwKTsKICAgICAgICAgICAgIGlmIChuRnJhbWVzIDw9IDApIHsKICAgICAgICAgICAgICAgICAvLyBza2lwIHRoaXMgZnJhbWUgYXMgaXQncyB0b28gY2xvc2UgdG8gcHJldmlvdXMgY2FwdHVyZQogICAgICAgICAgICAgICAgIEFMT0dWKCJza2lwcGluZyBmcmFtZSwgdGltZVVzICVsbGQiLCBzdGF0aWNfY2FzdDxsb25nIGxvbmc+KHRpbWVVcykpOwpAQCAtNzQxLDkgKzc0MSw5IEBACiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBtRnJhbWVDb3VudCArPSBuRnJhbWVzOwogICAgICAgICAgICAgbVByZXZDYXB0dXJlVXMgPSBtQmFzZUNhcHR1cmVVcyArIHN0ZDo6bGxyb3VuZCgKLSAgICAgICAgICAgICAgICAgICAgbUZyYW1lQ291bnQgLyBtQ2FwdHVyZUZwcyk7CisgICAgICAgICAgICAgICAgICAgIG1GcmFtZUNvdW50ICogMTAwMDAwMCAvIG1DYXB0dXJlRnBzKTsKICAgICAgICAgICAgIG1QcmV2RnJhbWVVcyA9IG1CYXNlRnJhbWVVcyArIHN0ZDo6bGxyb3VuZCgKLSAgICAgICAgICAgICAgICAgICAgbUZyYW1lQ291bnQgLyBtRnBzKTsKKyAgICAgICAgICAgICAgICAgICAgbUZyYW1lQ291bnQgKiAxMDAwMDAwIC8gbUZwcyk7CiAgICAgICAgIH0KIAogICAgICAgICBBTE9HVigidGltZVVzICVsbGQsIGNhcHR1cmVVc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vcjsKLSAgICBpZiAobVBhcnNlci5nZXRRdWlya3MobmFtZSwgJnF1aXJrVmVjdG9yKSA9PSBPSykgeworCisgICAgLy8gRmluZCBxdWlya3MgZnJvbSBtUGFyc2VyCisgICAgY29uc3QgYXV0byYgY29kZWMgPSBtUGFyc2VyLmdldENvZGVjTWFwKCkuZmluZChuYW1lKTsKKyAgICBpZiAoY29kZWMgPT0gbVBhcnNlci5nZXRDb2RlY01hcCgpLmNlbmQoKSkgeworICAgICAgICBBTE9HVygiRmFpbGVkIHRvIG9idGFpbiBxdWlya3MgZm9yIG9teCBjb21wb25lbnQgJyVzJyBmcm9tIFhNTCBmaWxlcyIsCisgICAgICAgICAgICAgICAgbmFtZSk7CisgICAgfSBlbHNlIHsKICAgICAgICAgdWludDMyX3QgcXVpcmtzID0gMDsKLSAgICAgICAgZm9yIChjb25zdCBBU3RyaW5nIHF1aXJrIDogcXVpcmtWZWN0b3IpIHsKKyAgICAgICAgZm9yIChjb25zdCBhdXRvJiBxdWlyayA6IGNvZGVjLT5zZWNvbmQucXVpcmtTZXQpIHsKICAgICAgICAgICAgIGlmIChxdWlyayA9PSAicmVxdWlyZXMtYWxsb2NhdGUtb24taW5wdXQtcG9ydHMiKSB7Ci0gICAgICAgICAgICAgICAgcXVpcmtzIHw9IGtSZXF1aXJlc0FsbG9jYXRlQnVmZmVyT25JbnB1dFBvcnRzOworICAgICAgICAgICAgICAgIHF1aXJrcyB8PSBPTVhOb2RlSW5zdGFuY2U6OgorICAgICAgICAgICAgICAgICAgICAgICAga1JlcXVpcmVzQWxsb2NhdGVCdWZmZXJPbklucHV0UG9ydHM7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAocXVpcmsgPT0gInJlcXVpcmVzLWFsbG9jYXRlLW9uLW91dHB1dC1wb3J0cyIpIHsKLSAgICAgICAgICAgICAgICBxdWlya3MgfD0ga1JlcXVpcmVzQWxsb2NhdGVCdWZmZXJPbk91dHB1dFBvcnRzOworICAgICAgICAgICAgIC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DEsMTcgKzQyLDMxIEBACiB1c2luZyA6OmFuZHJvaWQ6OndwOwogCiBzdHJ1Y3QgT214U3RvcmUgOiBwdWJsaWMgSU9teFN0b3JlIHsKLSAgICBPbXhTdG9yZSgpOworICAgIE9teFN0b3JlKAorICAgICAgICAgICAgY29uc3QgY2hhciogb3duZXIgPSAiZGVmYXVsdCIsCisgICAgICAgICAgICBjb25zdCBjaGFyKiBjb25zdCogc2VhcmNoRGlycworICAgICAgICAgICAgICAgID0gTWVkaWFDb2RlY3NYbWxQYXJzZXI6OmRlZmF1bHRTZWFyY2hEaXJzLAorICAgICAgICAgICAgY29uc3QgY2hhciogbWFpblhtbE5hbWUKKyAgICAgICAgICAgICAgICA9IE1lZGlhQ29kZWNzWG1sUGFyc2VyOjpkZWZhdWx0TWFpblhtbE5hbWUsCisgICAgICAgICAgICBjb25zdCBjaGFyKiBwZXJmb3JtYW5jZVhtbE5hbWUKKyAgICAgICAgICAgICAgICA9IE1lZGlhQ29kZWNzWG1sUGFyc2VyOjpkZWZhdWx0UGVyZm9ybWFuY2VYbWxOYW1lLAorICAgICAgICAgICAgY29uc3QgY2hhciogcHJvZmlsaW5nUmVzdWx0c1htbFBhdGgKKyAgICAgICAgICAgICAgICA9IE1lZGlhQ29kZWNzWG1sUGFyc2VyOjpkZWZhdWx0UHJvZmlsaW5nUmVzdWx0c1htbFBhdGgpOworCiAgICAgdmlydHVhbCB+T214U3RvcmUoKTsKIAotICAgIC8vIE1ldGhvZHMgZnJvbSBJT214CisgICAgLy8gTWV0aG9kcyBmcm9tIElPbXhTdG9yZQogICAgIFJldHVybjx2b2lkPiBsaXN0U2VydmljZUF0dHJpYnV0ZXMobGlzdFNlcnZpY2VBdHRyaWJ1dGVzX2NiKSBvdmVycmlkZTsKICAgICBSZXR1cm48dm9pZD4gZ2V0Tm9kZVByZWZpeChnZXROb2RlUHJlZml4X2NiKSBvdmVycmlkZTsKICAgICBSZXR1cm48dm9pZD4gbGlzdFJvbGVzKGxpc3RSb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N0IGNoYXIqIHMyLCBzaXplX3QgY291bnQpIHsKKyAgICByZXR1cm4gc3RybmNtcChzMSwgczIsIGNvdW50KSA9PSAwOworfQorCitib29sIHN0ckVxKGNvbnN0IGNoYXIqIHMxLCBjb25zdCBjaGFyKiBzMikgeworICAgIHJldHVybiBzdHJjbXAoczEsIHMyKSA9PSAwOworfQorCitib29sIHN0cmlFcShjb25zdCBjaGFyKiBzMSwgY29uc3QgY2hhciogczIpIHsKKyAgICByZXR1cm4gc3RyY2FzZWNtcChzMSwgczIpID09IDA7Cit9CisKK2Jvb2wgc3RySGFzUHJlZml4KGNvbnN0IGNoYXIqIHRlc3QsIGNvbnN0IGNoYXIqIHByZWZpeCkgeworICAgIHJldHVybiBzdHJuRXEodGVzdCwgcHJlZml4LCBzdHJsZW4ocHJlZml4KSk7Cit9CisKK2Jvb2wgcGFyc2VCb29sZWFuKGNvbnN0IGNoYXIqIHMpIHsKKyAgICByZXR1cm4gc3RyaUVxKHMsICJ5IikgfHwKKyAgICAgICAgICAgIHN0cmlFcShzLCAieWVzIikgfHwKKyAgICAgICAgICAgIHN0cmlFcShzLCAidCIpIHx8CisgICAgICAgICAgICBzdHJpRXEocywgInRydWUiKSB8fAorICAgICAgICAgICAgc3RyaUVxKHMsICIxIik7Cit9CisKK3N0YXR1c190IGxpbWl0Rm91bmRNaXNzaW5nQXR0cihjb25zdCBjaGFyKiBuYW1lLCBjb25zdCBjaGFyICphdHRyLCBib29sIGZvdW5kID0gdHJ1ZSkgeworICAgIEFMT0dFKCJsaW1pdCAnJXMnIHdpdGggJXMnJXMnIGF0dHJpYnV0ZSIsIG5hbWUsCisgICAgICAgICAgICAoZm91bmQgPyAiIiA6ICJubyAiKSwgYXR0cik7CisgICAgcmV0dXJuIC1FSU5WQUw7Cit9CisKK3N0YXR1c190IGxpbWl0RXJyb3IoY29uc3QgY2hhciogbmFtZSwgY29uc3QgY2hhciAqbXNnKSB7CisgICAgQUxPR0UoImxpbWl0ICclcycgJXMiLCBu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gZmFpbGVkLiIpOworCisgICAgOjpYTUxfU2V0VXNlckRhdGEocGFyc2VyLCB0aGlzKTsKKyAgICA6OlhNTF9TZXRFbGVtZW50SGFuZGxlcigKKyAgICAgICAgICAgIHBhcnNlciwgU3RhcnRFbGVtZW50SGFuZGxlcldyYXBwZXIsIEVuZEVsZW1lbnRIYW5kbGVyV3JhcHBlcik7CisKKyAgICBzdGF0aWMgY29uc3RleHByIGludCBCVUZGX1NJWkUgPSA1MTI7CisgICAgd2hpbGUgKG1QYXJzaW5nU3RhdHVzID09IE9LKSB7CisgICAgICAgIHZvaWQgKmJ1ZmYgPSA6OlhNTF9HZXRCdWZmZXIocGFyc2VyLCBCVUZGX1NJWkUpOworICAgICAgICBpZiAoYnVmZiA9PSBudWxscHRyKSB7CisgICAgICAgICAgICBBTE9HRSgiZmFpbGVkIGluIGNhbGwgdG8gWE1MX0dldEJ1ZmZlcigpIik7CisgICAgICAgICAgICBtUGFyc2luZ1N0YXR1cyA9IFVOS05PV05fRVJST1I7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGludCBieXRlc19yZWFkID0gOjpmcmVhZChidWZmLCAxLCBCVUZGX1NJWkUsIGZpbGUpOworICAgICAgICBpZiAoYnl0ZXNfcmVhZCA8IDApIHsKKyAgICAgICAgICAgIEFMT0dFKCJmYWlsZWQgaW4gY2FsbCB0byByZWFkIik7CisgICAgICAgICAgICBtUGFyc2luZ1N0YXR1cyA9IEVSUk9SX0lPOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBYTUxfU3RhdHVzIHN0YXR1cyA9IDo6WE1MX1BhcnNlQnVmZmVyKHBhcnNlciwgYnl0ZXNfcmVhZCwgYnl0ZXNfcmVhZCA9PSAwKTsKKyAgICAgICAgaWYgKHN0YXR1cyAhPSBYTUxfU1RBVFVTX09LKSB7CisgICAgICAgICAgICBBTE9HRSgibWFsZm9ybWVkICglcykiLCA6OlhNTF9FcnJvclN0cmluZyg6OlhNTF9HZXRFcnJvckNvZGUocGFyc2VyKSkpOworICAgICAgICAgICAgbVBhcnNpbmdTdGF0dXMgPSBFUlJPUl9NQUxGT1JNRUQ7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChieXRlc19yZWFkID09IDApIHsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorCisgICAgOjpYTUxfUGFyc2VyRnJlZShwYXJzZXIpOworCisgICAgZmNsb3NlKGZpbGUpOworICAgIGZpbGUgPSBudWxscHRyOworfQorCisvLyBzdGF0aWMKK3ZvaWQgTWVkaWFDb2RlY3NYbWxQYXJzZXI6OlN0YXJ0RWxlbWVudEhhbmRsZXJXcmFwcGVyKAorICAgICAgICB2b2lkICptZSwgY29uc3QgY2hhciAqbmFtZSwgY29uc3QgY2hhciAqKmF0dHJzKSB7CisgICAgc3RhdGljX2Nhc3Q8TWVkaWFDb2RlY3NYbWxQYXJzZXIqPihtZSktPnN0YXJ0RWxlbWVudEhhbmRsZXIobmFtZSwgYXR0cnMpOworfQorCisvLyBzdGF0aWMKK3ZvaWQgTWVkaWFDb2RlY3NYbWxQYXJzZXI6OkVuZEVsZW1lbnRIYW5kbGVyV3JhcHBlcih2b2lkICptZSwgY29uc3QgY2hhciAqbmFtZSkgeworICAgIHN0YXRpY19jYXN0PE1lZGlhQ29kZWNzWG1sUGFyc2VyKj4obWUpLT5lbmRFbGVtZW50SGFuZGxlcihuYW1lKTsKK30KKworc3RhdHVzX3QgTWVkaWFDb2RlY3NYbWxQYXJzZXI6OmluY2x1ZGVYTUxGaWxlKGNvbnN0IGNoYXIgKiphdHRycykgeworICAgIGNvbnN0IGNoYXIgKmhyZWYgPSBudWxscHRyOworICAgIHNpemVfdCBpID0gMDsKKyAgICB3aGlsZSAoYXR0cnNbaV0gIT0gbnVsbHB0cikgeworICAgICAgICBpZiAoc3RyRXEoYXR0cnNbaV0sICJocmVmIikpIHsKKyAgICAgICAgICAgIGlmIChhdHRyc1srK2ldID09IG51bGxwdHIpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGhyZWYgPSBhdHRyc1tpXTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIEFMT0dFKCJpbmNsdWRlWE1MRmlsZTogdW5yZWNvZ25pemVkIGF0dHJpYnV0ZTogJXMiLCBhdHRyc1tpXSk7CisgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgfQorICAgICAgICArK2k7CisgICAgfQorCisgICAgLy8gRm9yIHNlY3VyaXR5IHJlYXNvbnMgYW5kIGZvciBzaW1wbGljaXR5LCBmaWxlIG5hbWVzIGNhbiBvbmx5IGNvbnRhaW4KKyAgICAvLyBbYS16QS1aMC05Xy5dIGFuZCBtdXN0IHN0YXJ0IHdpdGggIG1lZGlhX2NvZGVjc18gYW5kIGVuZCB3aXRoIC54bWwKKyAgICBmb3IgKGkgPSAwOyBocmVmW2ldICE9ICdcMCc7IGkrKykgeworICAgICAgICBpZiAoaHJlZltpXSA9PSAnLicgfHwgaHJlZltpXSA9PSAnXycgfHwKKyAgICAgICAgICAgICAgICAoaHJlZltpXSA+PSAnMCcgJiYgaHJlZltpXSA8PSAnOScpIHx8CisgICAgICAgICAgICAgICAgKGhyZWZbaV0gPj0gJ0EnICYmIGhyZWZbaV0gPD0gJ1onKSB8fAorICAgICAgICAgICAgICAgIChocmVmW2ldID49ICdhJyAmJiBocmVmW2ldIDw9ICd6JykpIHsKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICB9CisgICAgICAgIEFMT0dFKCJpbnZhbGlkIGluY2x1ZGUgZmlsZSBuYW1lOiAlcyIsIGhyZWYpOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBzdGQ6OnN0cmluZyBmaWxlbmFtZSA9IGhyZWY7CisgICAgaWYgKGZpbGVuYW1lLmNvbXBhcmUoMCwgMTMsICJtZWRpYV9jb2RlY3NfIikgIT0gMCB8fAorICAgICAgICAgICAgZmlsZW5hbWUuY29tcGFyZShmaWxlbmFtZS5zaXplKCkgLSA0LCA0LCAiLnhtbCIpICE9IDApIHsKKyAgICAgICAgQUxPR0UoImludmFsaWQgaW5jbHVkZSBmaWxlIG5hbWU6ICVzIiwgaHJlZik7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyAgICBmaWxlbmFtZS5pbnNlcnQoMCwgbUhyZWZCYXNlKTsKKworICAgIHBhcnNlWE1MRmlsZShmaWxlbmFtZS5jX3N0cigpKTsKKyAgICByZXR1cm4gbVBhcnNpbmdTdGF0dXM7Cit9CisKK3ZvaWQgTWVkaWFDb2RlY3NYbWxQYXJzZXI6OnN0YXJ0RWxlbWVudEhhbmRsZXIoCisgICAgICAgIGNvbnN0IGNoYXIgKm5hbWUsIGNvbnN0IGNoYXIgKiphdHRycykgeworICAgIGlmIChtUGFyc2luZ1N0YXR1cyAhPSBPSykgeworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgYm9vbCBpblR5cGUgPSB0cnVlOworCisgICAgaWYgKHN0ckVxKG5hbWUsICJJbmNsdWRlIikpIHsKKyAgICAgICAgbVBhcnNpbmdTdGF0dXMgPSBpbmNsdWRlWE1MRmlsZShhdHRycyk7CisgICAgICAgIGlmIChtUGFyc2luZ1N0YXR1cyA9PSBPSykgeworICAgICAgICAgICAgbVNlY3Rpb25TdGFjay5wdXNoX2JhY2sobUN1cnJlbnRTZWN0aW9uKTsKKyAgICAgICAgICAgIG1DdXJyZW50U2VjdGlvbiA9IFNFQ1RJT05fSU5DTFVERTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgc3dpdGNoIChtQ3VycmVudFNlY3Rpb24pIHsKKyAgICAgICAgY2FzZSBTRUNUSU9OX1RPUExFVkVMOgorICAgICAgICB7CisgICAgICAgICAgICBpZiAoc3RyRXEobmFtZSwgIkRlY29kZXJzIikpIHsKKyAgICAgICAgICAgICAgICBtQ3VycmVudFNlY3Rpb24gPSBTRUNUSU9OX0RFQ09ERVJTOworICAgICAgICAgICAgfSBlbHNlIGlmIChzdHJFcShuYW1lLCAiRW5jb2RlcnMiKSkgeworICAgICAgICAgICAgICAgIG1DdXJyZW50U2VjdGlvbiA9IFNFQ1RJT05fRU5DT0RFUlM7CisgICAgICAgICAgICB9IGVsc2UgaWYgKHN0ckVxKG5hbWUsICJTZXR0aW5ncyIpKSB7CisgICAgICAgICAgICAgICAgbUN1cnJlbnRTZWN0aW9uID0gU0VDVElPTl9TRVRUSU5HUzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgY2FzZSBTRUNUSU9OX1NFVFRJTkdTOgorICAgICAgICB7CisgICAgICAgICAgICBpZiAoc3RyRXEobmFtZSwgIlNldHRpbmciKSkgeworICAgICAgICAgICAgICAgIG1QYXJzaW5nU3RhdHVzID0gYWRkU2V0dGluZ0Zyb21BdHRyaWJ1dGVzKGF0dHJzKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgY2FzZSBTRUNUSU9OX0RFQ09ERVJTOgorICAgICAgICB7CisgICAgICAgICAgICBpZiAoc3RyRXEobmFtZSwgIk1lZGlhQ29kZWMiKSkgeworICAgICAgICAgICAgICAgIG1QYXJzaW5nU3RhdHVzID0KKyAgICAgICAgICAgICAgICAgICAgYWRkTWVkaWFDb2RlY0Zyb21BdHRyaWJ1dGVzKGZhbHNlIC8qIGVuY29kZXIgKi8sIGF0dHJzKTsKKworICAgICAgICAgICAgICAgIG1DdXJyZW50U2VjdGlvbiA9IFNFQ1RJT05fREVDT0RFUjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgY2FzZSBTRUNUSU9OX0VOQ09ERVJTOgorICAgICAgICB7CisgICAgICAgICAgICBpZiAoc3RyRXEobmFtZSwgIk1lZGlhQ29kZWMiKSkgeworICAgICAgICAgICAgICAgIG1QYXJzaW5nU3RhdHVzID0KKyAgICAgICAgICAgICAgICAgICAgYWRkTWVkaWFDb2RlY0Zyb21BdHRyaWJ1dGVzKHRydWUgLyogZW5jb2RlciAqLywgYXR0cnMpOworCisgICAgICAgICAgICAgICAgbUN1cnJlbnRTZWN0aW9uID0gU0VDVElPTl9FTkNPREVSOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIFNFQ1RJT05fREVDT0RFUjoKKyAgICAgICAgY2FzZSBTRUNUSU9OX0VOQ09ERVI6CisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChzdHJFcShuYW1lLCAiUXVpcmsiKSkgeworICAgICAgICAgICAgICAgIG1QYXJzaW5nU3RhdHVzID0gYWRkUXVpcmsoYXR0cnMpOworICAgICAgICAgICAgfSBlbHNlIGlmIChzdHJFcShuYW1lLCAiVHlwZSIpKSB7CisgICAgICAgICAgICAgICAgbVBhcnNpbmdTdGF0dXMgPSBhZGRUeXBlRnJvbUF0dHJpYnV0ZXMoYXR0cnMsCisgICAgICAgICAgICAgICAgICAgICAgICAobUN1cnJlbnRTZWN0aW9uID09IFNFQ1RJT05fRU5DT0RFUikpOworICAgICAgICAgICAgICAgIG1DdXJyZW50U2VjdGlvbiA9CisgICAgICAgICAgICAgICAgICAgICAgICAobUN1cnJlbnRTZWN0aW9uID09IFNFQ1RJT05fREVDT0RFUiA/CisgICAgICAgICAgICAgICAgICAgICAgICBTRUNUSU9OX0RFQ09ERVJfVFlQRSA6IFNFQ1RJT05fRU5DT0RFUl9UWVBFKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpblR5cGUgPSBmYWxzZTsKKyAgICAgICAgLy8gZmFsbCB0aHJvdWdoCisKKyAgICAgICAgY2FzZSBTRUNUSU9OX0RFQ09ERVJfVFlQRToKKyAgICAgICAgY2FzZSBTRUNUSU9OX0VOQ09ERVJfVFlQRToKKyAgICAgICAgeworICAgICAgICAgICAgLy8gaWdub3JlIGxpbWl0cyBhbmQgZmVhdHVyZXMgc3BlY2lmaWVkIG91dHNpZGUgb2YgdHlwZQorICAgICAgICAgICAgYm9vbCBvdXRzaWRlID0gIWluVHlwZSAmJgorICAgICAgICAgICAgICAgICAgICBtQ3VycmVudFR5cGUgPT0gbUN1cnJlbnRDb2RlYy0+c2Vjb25kLnR5cGVNYXAuZW5kKCk7CisgICAgICAgICAgICBpZiAob3V0c2lkZSAmJgorICAgICAgICAgICAgICAgICAgICAoc3RyRXEobmFtZSwgIkxpbWl0IikgfHwgc3RyRXEobmFtZSwgIkZlYXR1cmUiKSkpIHsKKyAgICAgICAgICAgICAgICBBTE9HVygiaWdub3JpbmcgJXMgc3BlY2lmaWVkIG91dHNpZGUgb2YgYSBUeXBlIiwgbmFtZSk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKHN0ckVxKG5hbWUsICJMaW1pdCIpKSB7CisgICAgICAgICAgICAgICAgbVBhcnNpbmdTdGF0dXMgPSBhZGRMaW1pdChhdHRycyk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKHN0ckVxKG5hbWUsICJGZWF0dXJlIikpIHsKKyAgICAgICAgICAgICAgICBtUGFyc2luZ1N0YXR1cyA9IGFkZEZlYXR1cmUoYXR0cnMpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgYnJlYWs7CisgICAgfQorCit9CisKK3ZvaWQgTWVkaWFDb2RlY3NYbWxQYXJzZXI6OmVuZEVsZW1lbnRIYW5kbGVyKGNvbnN0IGNoYXIgKm5hbWUpIHsKKyAgICBpZiAobVBhcnNpbmdTdGF0dXMgIT0gT0spIHsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIHN3aXRjaCAobUN1cnJlbnRTZWN0aW9uKSB7CisgICAgICAgIGNhc2UgU0VDVElPTl9TRVRUSU5HUzoKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKHN0ckVxKG5hbWUsICJTZXR0aW5ncyIpKSB7CisgICAgICAgICAgICAgICAgbUN1cnJlbnRTZWN0aW9uID0gU0VDVElPTl9UT1BMRVZFTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgY2FzZSBTRUNUSU9OX0RFQ09ERVJTOgorICAgICAgICB7CisgICAgICAgICAgICBpZiAoc3RyRXEobmFtZSwgIkRlY29kZXJzIikpIHsKKyAgICAgICAgICAgICAgICBtQ3VycmVudFNlY3Rpb24gPSBTRUNUSU9OX1RPUExFVkVMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIFNFQ1RJT05fRU5DT0RFUlM6CisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChzdHJFcShuYW1lLCAiRW5jb2RlcnMiKSkgeworICAgICAgICAgICAgICAgIG1DdXJyZW50U2VjdGlvbiA9IFNFQ1RJT05fVE9QTEVWRUw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGNhc2UgU0VDVElPTl9ERUNPREVSX1RZUEU6CisgICAgICAgIGNhc2UgU0VDVElPTl9FTkNPREVSX1RZUEU6CisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChzdHJFcShuYW1lLCAiVHlwZSIpKSB7CisgICAgICAgICAgICAgICAgbUN1cnJlbnRTZWN0aW9uID0KKyAgICAgICAgICAgICAgICAgICAgICAgIChtQ3VycmVudFNlY3Rpb24gPT0gU0VDVElPTl9ERUNPREVSX1RZUEUgPworICAgICAgICAgICAgICAgICAgICAgICAgU0VDVElPTl9ERUNPREVSIDogU0VDVElPTl9FTkNPREVSKTsKKworICAgICAgICAgICAgICAgIG1DdXJyZW50VHlwZSA9IG1DdXJyZW50Q29kZWMtPnNlY29uZC50eXBlTWFwLmVuZCgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIFNFQ1RJT05fREVDT0RFUjoKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKHN0ckVxKG5hbWUsICJNZWRpYUNvZGVjIikpIHsKKyAgICAgICAgICAgICAgICBtQ3VycmVudFNlY3Rpb24gPSBTRUNUSU9OX0RFQ09ERVJTOworICAgICAgICAgICAgICAgIG1DdXJyZW50TmFtZS5jbGVhcigpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIFNFQ1RJT05fRU5DT0RFUjoKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKHN0ckVxKG5hbWUsICJNZWRpYUNvZGVjIikpIHsKKyAgICAgICAgICAgICAgICBtQ3VycmVudFNlY3Rpb24gPSBTRUNUSU9OX0VOQ09ERVJTOworICAgICAgICAgICAgICAgIG1DdXJyZW50TmFtZS5jbGVhcigpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIFNFQ1RJT05fSU5DTFVERToKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKHN0ckVxKG5hbWUsICJJbmNsdWRlIikgJiYgKG1TZWN0aW9uU3RhY2suc2l6ZSgpID4gMCkpIHsKKyAgICAgICAgICAgICAgICBtQ3VycmVudFNlY3Rpb24gPSBtU2VjdGlvblN0YWNrLmJhY2soKTsKKyAgICAgICAgICAgICAgICBtU2VjdGlvblN0YWNrLnBvcF9iYWNrKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBicmVhazsKKyAgICB9CisKK30KKworc3RhdHVzX3QgTWVkaWFDb2RlY3NYbWxQYXJzZXI6OmFkZFNldHRpbmdGcm9tQXR0cmlidXRlcyhjb25zdCBjaGFyICoqYXR0cnMpIHsKKyAgICBjb25zdCBjaGFyICpuYW1lID0gbnVsbHB0cjsKKyAgICBjb25zdCBjaGFyICp2YWx1ZSA9IG51bGxwdHI7CisgICAgY29uc3QgY2hhciAqdXBkYXRlID0gbnVsbHB0cjsKKworICAgIHNpemVfdCBpID0gMDsKKyAgICB3aGlsZSAoYXR0cnNbaV0gIT0gbnVsbHB0cikgeworICAgICAgICBpZiAoc3RyRXEoYXR0cnNbaV0sICJuYW1lIikpIHsKKyAgICAgICAgICAgIGlmIChhdHRyc1srK2ldID09IG51bGxwdHIpIHsKKyAgICAgICAgICAgICAgICBBTE9HRSgiYWRkU2V0dGluZ0Zyb21BdHRyaWJ1dGVzOiBuYW1lIGlzIG51bGwiKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG5hbWUgPSBhdHRyc1tpXTsKKyAgICAgICAgfSBlbHNlIGlmIChzdHJFcShhdHRyc1tpXSwgInZhbHVlIikpIHsKKyAgICAgICAgICAgIGlmIChhdHRyc1srK2ldID09IG51bGxwdHIpIHsKKyAgICAgICAgICAgICAgICBBTE9HRSgiYWRkU2V0dGluZ0Zyb21BdHRyaWJ1dGVzOiB2YWx1ZSBpcyBudWxsIik7CisgICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB2YWx1ZSA9IGF0dHJzW2ldOworICAgICAgICB9IGVsc2UgaWYgKHN0ckVxKGF0dHJzW2ldLCAidXBkYXRlIikpIHsKKyAgICAgICAgICAgIGlmIChhdHRyc1srK2ldID09IG51bGxwdHIpIHsKKyAgICAgICAgICAgICAgICBBTE9HRSgiYWRkU2V0dGluZ0Zyb21BdHRyaWJ1dGVzOiB1cGRhdGUgaXMgbnVsbCIpOworICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdXBkYXRlID0gYXR0cnNbaV07CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBBTE9HRSgiYWRkU2V0dGluZ0Zyb21BdHRyaWJ1dGVzOiB1bnJlY29nbml6ZWQgYXR0cmlidXRlOiAlcyIsIGF0dHJzW2ldKTsKKyAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICB9CisgICAgICAgICsraTsKKyAgICB9CisKKyAgICBpZiAobmFtZSA9PSBudWxscHRyIHx8IHZhbHVlID09IG51bGxwdHIpIHsKKyAgICAgICAgQUxPR0UoImFkZFNldHRpbmdGcm9tQXR0cmlidXRlczogbmFtZSBvciB2YWx1ZSB1bnNwZWNpZmllZCIpOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICAvLyBCb29sZWFuIHZhbHVlcyBhcmUgY29udmVydGVkIHRvICIwIiBvciAiMSIuCisgICAgaWYgKHN0ckhhc1ByZWZpeChuYW1lLCAic3VwcG9ydHMtIikpIHsKKyAgICAgICAgdmFsdWUgPSBwYXJzZUJvb2xlYW4odmFsdWUpID8gIjEiIDogIjAiOworICAgIH0KKworICAgIG1VcGRhdGUgPSAodXBkYXRlICE9IG51bGxwdHIpICYmIHBhcnNlQm9vbGVhbih1cGRhdGUpOworICAgIGF1dG8gYXR0cmlidXRlID0gbVNlcnZpY2VBdHRyaWJ1dGVNYXAuZmluZChuYW1lKTsKKyAgICBpZiAoYXR0cmlidXRlID09IG1TZXJ2aWNlQXR0cmlidXRlTWFwLmVuZCgpKSB7IC8vIE5ldyBhdHRyaWJ1dGUgbmFtZQorICAgICAgICBpZiAobVVwZGF0ZSkgeworICAgICAgICAgICAgQUxPR0UoImFkZFNldHRpbmdGcm9tQXR0cmlidXRlczogdXBkYXRpbmcgbm9uLWV4aXN0aW5nIHNldHRpbmciKTsKKyAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICB9CisgICAgICAgIG1TZX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ikgeworICAgICAgICAgICAgICAgIEFMT0dFKCJhZGRNZWRpYUNvZGVjRnJvbUF0dHJpYnV0ZXM6IHR5cGUgaXMgbnVsbCIpOworICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdHlwZSA9IGF0dHJzW2ldOworICAgICAgICB9IGVsc2UgaWYgKHN0ckVxKGF0dHJzW2ldLCAidXBkYXRlIikpIHsKKyAgICAgICAgICAgIGlmIChhdHRyc1srK2ldID09IG51bGxwdHIpIHsKKyAgICAgICAgICAgICAgICBBTE9HRSgiYWRkTWVkaWFDb2RlY0Zyb21BdHRyaWJ1dGVzOiB1cGRhdGUgaXMgbnVsbCIpOworICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdXBkYXRlID0gYXR0cnNbaV07CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBBTE9HRSgiYWRkTWVkaWFDb2RlY0Zyb21BdHRyaWJ1dGVzOiB1bnJlY29nbml6ZWQgYXR0cmlidXRlOiAlcyIsIGF0dHJzW2ldKTsKKyAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICB9CisgICAgICAgICsraTsKKyAgICB9CisKKyAgICBpZiAobmFtZSA9PSBudWxscHRyKSB7CisgICAgICAgIEFMT0dFKCJhZGRNZWRpYUNvZGVjRnJvbUF0dHJpYnV0ZXM6IG5hbWUgbm90IGZvdW5kIik7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIG1VcGRhdGUgPSAodXBkYXRlICE9IG51bGxwdHIpICYmIHBhcnNlQm9vbGVhbih1cGRhdGUpOworICAgIG1DdXJyZW50Q29kZWMgPSBtQ29kZWNNYXAuZmluZChuYW1lKTsKKyAgICBpZiAobUN1cnJlbnRDb2RlYyA9PSBtQ29kZWNNYXAuZW5kKCkpIHsgLy8gTmV3IGNvZGVjIG5hbWUKKyAgICAgICAgaWYgKG1VcGRhdGUpIHsKKyAgICAgICAgICAgIEFMT0dFKCJhZGRNZWRpYUNvZGVjRnJvbUF0dHJpYnV0ZXM6IHVwZGF0aW5nIG5vbi1leGlzdGluZyBjb2RlYyIpOworICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgIH0KKyAgICAgICAgLy8gQ3JlYXRlIGEgbmV3IGNvZGVjIGluIG1Db2RlY01hcAorICAgICAgICBtQ3VycmVudENvZGVjID0gbUNvZGVjTWFwLmluc2VydCgKKyAgICAgICAgICAgICAgICBDb2RlYyhuYW1lLCBDb2RlY1Byb3BlcnRpZXMoKSkpLmZpcnN0OworICAgICAgICBpZiAodHlwZSAhPSBudWxscHRyKSB7CisgICAgICAgICAgICBtQ3VycmVudFR5cGUgPSBtQ3VycmVudENvZGVjLT5zZWNvbmQudHlwZU1hcC5pbnNlcnQoCisgICAgICAgICAgICAgICAgICAgIFR5cGUodHlwZSwgQXR0cmlidXRlTWFwKCkpKS5maXJzdDsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIG1DdXJyZW50VHlwZSA9IG1DdXJyZW50Q29kZWMtPnNlY29uZC50eXBlTWFwLmVuZCgpOworICAgICAgICB9CisgICAgICAgIG1DdXJyZW50Q29kZWMtPnNlY29uZC5pc0VuY29kZXIgPSBlbmNvZGVyOworICAgICAgICBtQ3VycmVudENvZGVjLT5zZWNvbmQub3JkZXIgPSBtQ29kZWNDb3VudGVyKys7CisgICAgfSBlbHNlIHsgLy8gRXhpc3RpbmcgY29kZWMgbmFtZQorICAgICAgICBpZiAoIW1VcGRhdGUpIHsKKyAgICAgICAgICAgIEFMT0dFKCJhZGRNZWRpYUNvZGVjRnJvbUF0dHJpYnV0ZXM6IGFkZGluZyBleGlzdGluZyBjb2RlYyIpOworICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHR5cGUgIT0gbnVsbHB0cikgeworICAgICAgICAgICAgbUN1cnJlbnRUeXBlID0gbUN1cnJlbnRDb2RlYy0+c2Vjb25kLnR5cGVNYXAuZmluZCh0eXBlKTsKKyAgICAgICAgICAgIGlmIChtQ3VycmVudFR5cGUgPT0gbUN1cnJlbnRDb2RlYy0+c2Vjb25kLnR5cGVNYXAuZW5kKCkpIHsKKyAgICAgICAgICAgICAgICBBTE9HRSgiYWRkTWVkaWFDb2RlY0Zyb21BdHRyaWJ1dGVzOiB1cGRhdGluZyBub24tZXhpc3RpbmcgdHlwZSIpOworICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLy8gVGhpcyBzaG91bGQgaGFwcGVuIG9ubHkgd2hlbiB0aGUgY29kZWMgaGFzIGF0IG1vc3Qgb25lIHR5cGUuCisgICAgICAgICAgICBtQ3VycmVudFR5cGUgPSBtQ3VycmVudENvZGVjLT5zZWNvbmQudHlwZU1hcC5iZWdpbigpOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIE9LOworfQorCitzdGF0dXNfdCBNZWRpYUNvZGVjc1htbFBhcnNlcjo6YWRkUXVpcmsoY29uc3QgY2hhciAqKmF0dHJzKSB7CisgICAgY29uc3QgY2hhciAqbmFtZSA9IG51bGxwdHI7CisKKyAgICBzaXplX3QgaSA9IDA7CisgICAgd2hpbGUgKGF0dHJzW2ldICE9IG51bGxwdHIpIHsKKyAgICAgICAgaWYgKHN0ckVxKGF0dHJzW2ldLCAibmFtZSIpKSB7CisgICAgICAgICAgICBpZiAoYXR0cnNbKytpXSA9PSBudWxscHRyKSB7CisgICAgICAgICAgICAgICAgQUxPR0UoImFkZFF1aXJrOiBuYW1lIGlzIG51bGwiKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG5hbWUgPSBhdHRyc1tpXTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIEFMT0dFKCJhZGRRdWlyazogdW5yZWNvZ25pemVkIGF0dHJpYnV0ZTogJXMiLCBhdHRyc1tpXSk7CisgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgfQorICAgICAgICArK2k7CisgICAgfQorCisgICAgaWYgKG5hbWUgPT0gbnVsbHB0cikgeworICAgICAgICBBTE9HRSgiYWRkUXVpcms6IG5hbWUgbm90IGZvdW5kIik7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIG1DdXJyZW50Q29kZWMtPnNlY29uZC5xdWlya1NldC5lbXBsYWNlKG5hbWUpOworICAgIHJldHVybiBPSzsKK30KKworc3RhdHVzX3QgTWVkaWFDb2RlY3NYbWxQYXJzZXI6OmFkZFR5cGVGcm9tQXR0cmlidXRlcyhjb25zdCBjaGFyICoqYXR0cnMsIGJvb2wgZW5jb2RlcikgeworICAgIGNvbnN0IGNoYXIgKm5hbWUgPSBudWxscHRyOworICAgIGNvbnN0IGNoYXIgKnVwZGF0ZSA9IG51bGxwdHI7CisKKyAgICBzaXplX3QgaSA9IDA7CisgICAgd2hpbGUgKGF0dHJzW2ldICE9IG51bGxwdHIpIHsKKyAgICAgICAgaWYgKHN0ckVxKGF0dHJzW2ldLCAibmFtZSIpKSB7CisgICAgICAgICAgICBpZiAoYXR0cnNbKytpXSA9PSBudWxscHRyKSB7CisgICAgICAgICAgICAgICAgQUxPR0UoImFkZFR5cGVGcm9tQXR0cmlidXRlczogbmFtZSBpcyBudWxsIik7CisgICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBuYW1lID0gYXR0cnNbaV07CisgICAgICAgIH0gZWxzZSBpZiAoc3RyRXEoYXR0cnNbaV0sICJ1cGRhdGUiKSkgeworICAgICAgICAgICAgaWYgKGF0dHJzWysraV0gPT0gbnVsbHB0cikgeworICAgICAgICAgICAgICAgIEFMT0dFKCJhZGRUeXBlRnJvbUF0dHJpYnV0ZXM6IHVwZGF0ZSBpcyBudWxsIik7CisgICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB1cGRhdGUgPSBhdHRyc1tpXTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIEFMT0dFKCJhZGRUeXBlRnJvbUF0dHJpYnV0ZXM6IHVucmVjb2duaXplZCBhdHRyaWJ1dGU6ICVzIiwgYXR0cnNbaV0pOworICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgIH0KKyAgICAgICAgKytpOworICAgIH0KKworICAgIGlmIChuYW1lID09IG51bGxwdHIpIHsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgbUN1cnJlbnRDb2RlYy0+c2Vjb25kLmlzRW5jb2RlciA9IGVuY29kZXI7CisgICAgbUN1cnJlbnRUeXBlID0gbUN1cnJlbnRDb2RlYy0+c2Vjb25kLnR5cGVNYXAuZmluZChuYW1lKTsKKyAgICBpZiAoIW1VcGRhdGUpIHsKKyAgICAgICAgaWYgKG1DdXJyZW50VHlwZSAhPSBtQ3VycmVudENvZGVjLT5zZWNvbmQudHlwZU1hcC5lbmQoKSkgeworICAgICAgICAgICAgQUxPR0UoImFkZFR5cGVGcm9tQXR0cmlidXRlczogcmUtZGVmaW5pbmcgZXhpc3RpbmcgdHlwZSB3aXRob3V0IHVwZGF0ZSIpOworICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgIH0KKyAgICAgICAgbUN1cnJlbnRUeXBlID0gbUN1cnJlbnRDb2RlYy0+c2Vjb25kLnR5cGVNYXAuaW5zZXJ0KAorICAgICAgICAgICAgICAgIFR5cGUobmFtZSwgQXR0cmlidXRlTWFwKCkpKS5maXJzdDsKKyAgICB9IGVsc2UgaWYgKG1DdXJyZW50VHlwZSA9PSBtQ3VycmVudENvZGVjLT5zZWNvbmQudHlwZU1hcC5lbmQoKSkgeworICAgICAgICBBTE9HRSgiYWRkVHlwZUZyb21BdHRyaWJ1dGVzOiB1cGRhdGluZyBub24tZXhpc3RpbmcgdHlwZSIpOworICAgIH0KKyAgICByZXR1cm4gT0s7Cit9CisKK3N0YXR1c190IE1lZGlhQ29kZWNzWG1sUGFyc2VyOjphZGRMaW1pdChjb25zdCBjaGFyICoqYXR0cnMpIHsKKyAgICBjb25zdCBjaGFyKiBhX25hbWUgPSBudWxscHRyOworICAgIGNvbnN0IGNoYXIqIGFfZGVmYXVsdCA9IG51bGxwdHI7CisgICAgY29uc3QgY2hhciogYV9pbiA9IG51bGxwdHI7CisgICAgY29uc3QgY2hhciogYV9tYXggPSBudWxscHRyOworICAgIGNvbnN0IGNoYXIqIGFfbWluID0gbnVsbHB0cjsKKyAgICBjb25zdCBjaGFyKiBhX3JhbmdlID0gbnVsbHB0cjsKKyAgICBjb25zdCBjaGFyKiBhX3JhbmdlcyA9IG51bGxwdHI7CisgICAgY29uc3QgY2hhciogYV9zY2FsZSA9IG51bGxwdHI7CisgICAgY29uc3QgY2hhciogYV92YWx1ZSA9IG51bGxwdHI7CisKKyAgICBzaXplX3QgaSA9IDA7CisgICAgd2hpbGUgKGF0dHJzW2ldICE9IG51bGxwdHIpIHsKKyAgICAgICAgaWYgKHN0ckVxKGF0dHJzW2ldLCAibmFtZSIpKSB7CisgICAgICAgICAgICBpZiAoYXR0cnNbKytpXSA9PSBudWxscHRyKSB7CisgICAgICAgICAgICAgICAgQUxPR0UoImFkZExpbWl0OiBuYW1lIGlzIG51bGwiKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGFfbmFtZSA9IGF0dHJzW2ldOworICAgICAgICB9IGVsc2UgaWYgKHN0ckVxKGF0dHJzW2ldLCAiZGVmYXVsdCIpKSB7CisgICAgICAgICAgICBpZiAoYXR0cnNbKytpXSA9PSBudWxscHRyKSB7CisgICAgICAgICAgICAgICAgQUxPR0UoImFkZExpbWl0OiBkZWZhdWx0IGlzIG51bGwiKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGFfZGVmYXVsdCA9IGF0dHJzW2ldOworICAgICAgICB9IGVsc2UgaWYgKHN0ckVxKGF0dHJzW2ldLCAiaW4iKSkgeworICAgICAgICAgICAgaWYgKGF0dHJzWysraV0gPT0gbnVsbHB0cikgeworICAgICAgICAgICAgICAgIEFMT0dFKCJhZGRMaW1pdDogaW4gaXMgbnVsbCIpOworICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYV9pbiA9IGF0dHJzW2ldOworICAgICAgICB9IGVsc2UgaWYgKHN0ckVxKGF0dHJzW2ldLCAibWF4IikpIHsKKyAgICAgICAgICAgIGlmIChhdHRyc1srK2ldID09IG51bGxwdHIpIHsKKyAgICAgICAgICAgICAgICBBTE9HRSgiYWRkTGltaXQ6IG1heCBpcyBudWxsIik7CisgICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBhX21heCA9IGF0dHJzW2ldOworICAgICAgICB9IGVsc2UgaWYgKHN0ckVxKGF0dHJzW2ldLCAibWluIikpIHsKKyAgICAgICAgICAgIGlmIChhdHRyc1srK2ldID09IG51bGxwdHIpIHsKKyAgICAgICAgICAgICAgICBBTE9HRSgiYWRkTGltaXQ6IG1pbiBpcyBudWxsIik7CisgICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBhX21pbiA9IGF0dHJzW2ldOworICAgICAgICB9IGVsc2UgaWYgKHN0ckVxKGF0dHJzW2ldLCAicmFuZ2UiKSkgeworICAgICAgICAgICAgaWYgKGF0dHJzWysraV0gPT0gbnVsbHB0cikgeworICAgICAgICAgICAgICAgIEFMT0dFKCJhZGRMaW1pdDogcmFuZ2UgaXMgbnVsbCIpOworICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYV9yYW5nZSA9IGF0dHJzW2ldOworICAgICAgICB9IGVsc2UgaWYgKHN0ckVxKGF0dHJzW2ldLCAicmFuZ2VzIikpIHsKKyAgICAgICAgICAgIGlmIChhdHRyc1srK2ldID09IG51bGxwdHIpIHsKKyAgICAgICAgICAgICAgICBBTE9HRSgiYWRkTGltaXQ6IHJhbmdlcyBpcyBudWxsIik7CisgICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBhX3JhbmdlcyA9IGF0dHJzW2ldOworICAgICAgICB9IGVsc2UgaWYgKHN0ckVxKGF0dHJzW2ldLCAic2NhbGUiKSkgeworICAgICAgICAgICAgaWYgKGF0dHJzWysraV0gPT0gbnVsbHB0cikgeworICAgICAgICAgICAgICAgIEFMT0dFKCJhZGRMaW1pdDogc2NhbGUgaXMgbnVsbCIpOworICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYV9zY2FsZSA9IGF0dHJzW2ldOworICAgICAgICB9IGVsc2UgaWYgKHN0ckVxKGF0dHJzW2ldLCAidmFsdWUiKSkgeworICAgICAgICAgICAgaWYgKGF0dHJzWysraV0gPT0gbnVsbHB0cikgeworICAgICAgICAgICAgICAgIEFMT0dFKCJhZGRMaW1pdDogdmFsdWUgaXMgbnVsbCIpOworICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYV92YWx1ZSA9IGF0dHJzW2ldOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgQUxPR0UoImFkZExpbWl0OiB1bnJlY29nbml6ZWQgbGltaXQ6ICVzIiwgYXR0cnNbaV0pOworICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgIH0KKyAgICAgICAgKytpOworICAgIH0KKworICAgIGlmIChhX25hbWUgPT0gbnVsbHB0cikgeworICAgICAgICBBTE9HRSgibGltaXQgd2l0aCBubyAnbmFtZScgYXR0cmlidXRlIik7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIC8vIHNpemUsIGJsb2NrcywgYml0cmF0ZSwgZnJhbWUtcmF0ZSwgYmxvY2tzLXBlci1zZWNvbmQsIGFzcGVjdC1yYXRpbywKKyAgICAvLyBtZWFzdXJlZC1mcmFtZS1yYXRlLCBtZWFzdXJlZC1ibG9ja3MtcGVyLXNlY29uZDogcmFuZ2UKKyAgICAvLyBxdWFsaXR5OiByYW5nZSArIGRlZmF1bHQgKyBbc2NhbGVdCisgICAgLy8gY29tcGxleGl0eTogcmFuZ2UgKyBkZWZhdWx0CisgICAgaWYgKG1DdXJyZW50VHlwZSA9PSBtQ3VycmVudENvZGVjLT5zZWNvbmQudHlwZU1hcC5lbmQoKSkgeworICAgICAgICBBTE9HVygiaWdub3JpbmcgbnVsbCB0eXBlIik7CisgICAgICAgIHJldHVybiBPSzsKKyAgICB9CisKKyAgICBzdGQ6OnN0cmluZyByYW5nZTsKKyAgICBpZiAoc3RyRXEoYV9uYW1lLCAiYXNwZWN0LXJhdGlvIikgfHwKKyAgICAgICAgICAgIHN0ckVxKGFfbmFtZSwgImJpdHJhdGUiKSB8fAorICAgICAgICAgICAgc3RyRXEoYV9uYW1lLCAiYmxvY2stY291bnQiKSB8fAorICAgICAgICAgICAgc3RyRXEoYV9uYW1lLCAiYmxvY2tzLXBlci1zZWNvbmQiKSB8fAorICAgICAgICAgICAgc3RyRXEoYV9uYW1lLCAiY29tcGxleGl0eSIpIHx8CisgICAgICAgICAgICBzdHJFcShhX25hbWUsICJmcmFtZS1yYXRlIikgfHwKKyAgICAgICAgICAgIHN0ckVxKGFfbmFtZSwgInF1YWxpdHkiKSB8fAorICAgICAgICAgICAgc3RyRXEoYV9uYW1lLCAic2l6ZSIpIHx8CisgICAgICAgICAgICBzdHJFcShhX25hbWUsICJtZWFzdXJlZC1ibG9ja3MtcGVyLXNlY29uZCIpIHx8CisgICAgICAgICAgICBzdHJIYXNQcmVmaXgoYV9uYW1lLCAibWVhc3VyZWQtZnJhbWUtcmF0ZS0iKSkgeworICAgICAgICAvLyAicmFuZ2UiIGlzIHNwZWNpZmllZCBpbiBleGFjdGx5IG9uZSBvZiB0aGUgZm9sbG93aW5nIGZvcm1zOgorICAgICAgICAvLyAxKSBtaW4tbWF4CisgICAgICAgIC8vIDIpIHZhbHVlLXZhbHVlCisgICAgICAgIC8vIDMpIHJhbmdlCisgICAgICAgIGlmIChhX21pbiAhPSBudWxscHRyICYmIGFfbWF4ICE9IG51bGxwdHIpIHsKKyAgICAgICAgICAgIC8vIG1pbi1tYXgKKyAgICAgICAgICAgIGlmIChhX3JhbmdlICE9IG51bGxwdHIgfHwgYV92YWx1ZSAhPSBudWxscHRyKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGxpbWl0RXJyb3IoYV9uYW1lLCAiaGFzICdtaW4nIGFuZCAnbWF4JyBhcyB3ZWxsIGFzICdyYW5nZScgb3IgIgorICAgICAgICAgICAgICAgICAgICAgICAgIid2YWx1ZScgYXR0cmlidXRlcyIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmFuZ2UgPSBhX21pbjsKKyAgICAgICAgICAgIHJhbmdlICs9ICctJzsKKyAgICAgICAgICAgIHJhbmdlICs9IGFfbWF4OworICAgICAgICB9IGVsc2UgaWYgKGFfbWluICE9IG51bGxwdHIgfHwgYV9tYXggIT0gbnVsbHB0cikgeworICAgICAgICAgICAgcmV0dXJuIGxpbWl0RXJyb3IoYV9uYW1lLCAiaGFzIG9ubHkgJ21pbicgb3IgJ21heCcgYXR0cmlidXRlIik7CisgICAgICAgIH0gZWxzZSBpZiAoYV92YWx1ZSAhPSBudWxscHRyKSB7CisgICAgICAgICAgICAvLyB2YWx1ZS12YWx1ZQorICAgICAgICAgICAgaWYgKGFfcmFuZ2UgIT0gbnVsbHB0cikgeworICAgICAgICAgICAgICAgIHJldHVybiBsaW1pdEVycm9yKGFfbmFtZSwgImhhcyBib3RoICdyYW5nZScgYW5kICd2YWx1ZScgYXR0cmlidXRlcyIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmFuZ2UgPSBhX3ZhbHVlOworICAgICAgICAgICAgcmFuZ2UgKz0gJy0nOworICAgICAgICAgICAgcmFuZ2UgKz0gYV92YWx1ZTsKKyAgICAgICAgfSBlbHNlIGlmIChhX3JhbmdlID09IG51bGxwdHIpIHsKKyAgICAgICAgICAgIHJldHVybiBsaW1pdEVycm9yKGFfbmFtZSwgIndpdGggbm8gJ3JhbmdlJywgJ3ZhbHVlJyBvciAnbWluJy8nbWF4JyBhdHRyaWJ1dGVzIik7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAvLyByYW5nZQorICAgICAgICAgICAgcmFuZ2UgPSBhX3JhbmdlOworICAgICAgICB9CisKKyAgICAgICAgLy8gImFzcGVjdC1yYXRpbyIgcmVxdWlyZXMgc29tZSBzcGVjaWFsIHRyZWF0bWVudC4KKyAgICAgICAgaWYgKHN0ckVxKGFfbmFtZSwgImFzcGVjdC1yYXRpbyIpKSB7CisgICAgICAgICAgICAvLyAiYXNwZWN0LXJhdGlvIiBtdXN0IGhhdmUgImluIi4KKyAgICAgICAgICAgIGlmIChhX2luID09IG51bGxwdHIpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbGltaXRGb3VuZE1pc3NpbmdBdHRyKGFfbmFtZSwgImluIiwgZmFsc2UpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLy8gImluIiBtdXN0IGJlIGVpdGhlciAicGl4ZWxzIiBvciAiYmxvY2tzIi4KKyAgICAgICAgICAgIGlmICghc3RyRXEoYV9pbiwgInBpeGVscyIpICYmICFzdHJFcShhX2luLCAiYmxvY2tzIikpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbGltaXRJbnZhbGlkQXR0cihhX25hbWUsICJpbiIsIGFfaW4pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLy8gbmFtZSB3aWxsIGJlICJwaXhlbC1hc3BlY3QtcmF0aW8tcmFuZ2UiIG9yCisgICAgICAgICAgICAvLyAiYmxvY2stYXNwZWN0LXJhdGlvLXJhbmdlIi4KKyAgICAgICAgICAgIG1DdXJyZW50VHlwZS0+c2Vjb25kWworICAgICAgICAgICAgICAgICAgICBzdGQ6OnN0cmluZyhhX2luKS5zdWJzdHIoMCwgc3RybGVuKGFfaW4pIC0gMSkgKworICAgICAgICAgICAgICAgICAgICAiLWFzcGVjdC1yYXRpby1yYW5nZSJdID0gcmFuZ2U7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAvLyBGb3IgZXZlcnl0aGluZyBlbHNlIChhcGFydCBmcm9tICJhc3BlY3QtcmF0aW8iKSwgc2ltcGx5IGFwcGVuZAorICAgICAgICAgICAgLy8gIi1yYW5nZSIgdG8gdGhlIG5hbWUgZm9yIHRoZSByYW5nZS10eXBlIHByb3BlcnR5LgorICAgICAgICAgICAgbUN1cnJlbnRUeXBlLT5zZWNvbmRbc3RkOjpzdHJpbmcoYV9uYW1lKSArICItcmFuZ2UiXSA9IHJhbmdlOworCisgICAgICAgICAgICAvLyBPbmx5ICJxdWFsaXR5IiBtYXkgaGF2ZSAic2NhbGUiLgorICAgICAgICAgICAgaWYgKCFzdHJFcShhX25hbWUsICJxdWFsaXR5IikgJiYgYV9zY2FsZSAhPSBudWxscHRyKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGxpbWl0Rm91bmRNaXNzaW5nQXR0cihhX25hbWUsICJzY2FsZSIpOworICAgICAgICAgICAgfSBlbHNlIGlmIChzdHJFcShhX25hbWUsICJxdWFsaXR5IikpIHsKKyAgICAgICAgICAgICAgICAvLyBUaGUgZGVmYXVsdCB2YWx1ZSBvZiAicXVhbGl0eS1zY2FsZSIgaXMgImxpbmVhciIuCisgICAgICAgICAgICAgICAgbUN1cnJlbnRUeXBlLT5zZWNvbmRbInF1YWxpdHktc2NhbGUiXSA9IGFfc2NhbGUgPT0gbnVsbHB0ciA/CisgICAgICAgICAgICAgICAgICAgICAgICAibGluZWFyIiA6IGFfc2NhbGU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vICJxdWFsaXR5IiBhbmQgImNvbXBsZXhpdHkiIG11c3QgaGF2ZSAiZGVmYXVsdCIuCisgICAgICAgICAgICAvLyBPdGhlciBsaW1pdHMgbXVzdCBub3QgaGF2ZSAiZGVmYXVsdCIuCisgICAgICAgICAgICBpZiAoc3RyRXEoYV9uYW1lLCAicXVhbGl0eSIpIHx8IHN0ckVxKGFfbmFtZSwgImNvbXBsZXhpdHkiKSkgeworICAgICAgICAgICAgICAgIGlmIChhX2RlZmF1bHQgPT0gbnVsbHB0cikgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gbGltaXRGb3VuZE1pc3NpbmdBdHRyKGFfbmFtZSwgImRlZmF1bHQiLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIC8vIG5hbWUgd2lsbCBiZSAicXVhbGl0eS1kZWZhdWx0IiBvciAiY29tcGxleGl0eS1kZWZhdWx0Ii4KKyAgICAgICAgICAgICAgICBtQ3VycmVudFR5cGUtPnNlY29uZFtzdGQ6OnN0cmluZyhhX25hbWUpICsgIi1kZWZhdWx0Il0gPSBhX2RlZmF1bHQ7CisgICAgICAgICAgICB9IGVsc2UgaWYgKGFfZGVmYXVsdCAhPSBudWxscHRyKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGxpbWl0Rm91bmRNaXNzaW5nQXR0cihhX25hbWUsICJkZWZhdWx0IiwgdHJ1ZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9IGVsc2UgeworICAgICAgICBpZiAoYV9kZWZhdWx0ICE9IG51bGxwdHIpIHsKKyAgICAgICAgICAgIHJldHVybiBsaW1pdEZvdW5kTWlzc2luZ0F0dHIoYV9uYW1lLCAiZGVmYXVsdCIpOworICAgICAgICB9CisgICAgICAgIGlmIChhX2luICE9IG51bGxwdHIpIHsKKyAgICAgICAgICAgIHJldHVybiBsaW1pdEZvdW5kTWlzc2luZ0F0dHIoYV9uYW1lLCAiaW4iKTsKKyAgICAgICAgfQorICAgICAgICBpZiAoYV9zY2FsZSAhPSBudWxscHRyKSB7CisgICAgICAgICAgICByZXR1cm4gbGltaXRGb3VuZE1pc3NpbmdBdHRyKGFfbmFtZSwgInNjYWxlIik7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGFfcmFuZ2UgIT0gbnVsbHB0cikgeworICAgICAgICAgICAgcmV0dXJuIGxpbWl0Rm91bmRNaXNzaW5nQXR0cihhX25hbWUsICJyYW5nZSIpOworICAgICAgICB9CisgICAgICAgIGlmIChhX21pbiAhPSBudWxscHRyKSB7CisgICAgICAgICAgICByZXR1cm4gbGltaXRGb3VuZE1pc3NpbmdBdHRyKGFfbmFtZSwgIm1pbiIpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKGFfbWF4ICE9IG51bGxwdHIpIHsKKyAgICAgICAgICAgIC8vICJtYXgiIG11c3QgZXhpc3QgaWYgYW5kIG9ubHkgaWYgbmFtZSBpcyAiY2hhbm5lbC1jb3VudCIgb3IKKyAgICAgICAgICAgIC8vICJjb25jdXJyZW50LWluc3RhbmNlcyIuCisgICAgICAgICAgICAvLyAibWluIiBpcyBub3QgbmNlc3NhcnkuCisgICAgICAgICAgICBpZiAoc3RyRXEoYV9uYW1lLCAiY2hhbm5lbC1jb3VudCIpIHx8CisgICAgICAgICAgICAgICAgICAgIHN0ckVxKGFfbmFtZSwgImNvbmN1cnJlbnQtaW5zdGFuY2VzIikpIHsKKyAgICAgICAgICAgICAgICBtQ3VycmVudFR5cGUtPnNlY29uZFtzdGQ6OnN0cmluZygibWF4LSIpICsgYV9uYW1lXSA9IGFfbWF4OworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbGltaXRGb3VuZE1pc3NpbmdBdHRyKGFfbmFtZSwgIm1heCIsIGZhbHNlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIGlmIChzdHJFcShhX25hbWUsICJjaGFubmVsLWNvdW50IikgfHwKKyAgICAgICAgICAgICAgICBzdHJFcShhX25hbWUsICJjb25jdXJyZW50LWluc3RhbmNlcyIpKSB7CisgICAgICAgICAgICByZXR1cm4gbGltaXRGb3VuZE1pc3NpbmdBdHRyKGFfbmFtZSwgIm1heCIpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKGFfcmFuZ2VzICE9IG51bGxwdHIpIHsKKyAgICAgICAgICAgIC8vICJyYW5nZXMiIG11c3QgZXhpc3QgaWYgYW5kIG9ubHkgaWYgbmFtZSBpcyAic2FtcGxlLXJhdGUiLgorICAgICAgICAgICAgaWYgKHN0ckVxKGFfbmFtZSwgInNhbXBsZS1yYXRlIikpIHsKKyAgICAgICAgICAgICAgICBtQ3VycmVudFR5cGUtPnNlY29uZFsic2FtcGxlLXJhdGUtcmFuZ2VzIl0gPSBhX3JhbmdlczsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGxpbWl0Rm91bmRNaXNzaW5nQXR0cihhX25hbWUsICJyYW5nZXMiLCBmYWxzZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSBpZiAoc3RyRXEoYV9uYW1lLCAic2FtcGxlLXJhdGUiKSkgeworICAgICAgICAgICAgcmV0dXJuIGxpbWl0Rm91bmRNaXNzaW5nQXR0cihhX25hbWUsICJyYW5nZXMiKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChhX3ZhbHVlICE9IG51bGxwdHIpIHsKKyAgICAgICAgICAgIC8vICJ2YWx1ZSIgbXVzdCBleGlzdCBpZiBhbmQgb25seSBpZiBuYW1lIGlzICJhbGlnbm1lbnQiIG9yCisgICAgICAgICAgICAvLyAiYmxvY2stc2l6ZSIuCisgICAgICAgICAgICBpZiAoc3RyRXEoYV9uYW1lLCAiYWxpZ25tZW50IikgfHwgc3RyRXEoYV9uYW1lLCAiYmxvY2stc2l6ZSIpKSB7CisgICAgICAgICAgICAgICAgbUN1cnJlbnRUeXBlLT5zZWNvbmRbYV9uYW1lXSA9IGFfdmFsdWU7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHJldHVybiBsaW1pdEZvdW5kTWlzc2luZ0F0dHIoYV9uYW1lLCAidmFsdWUiLCBmYWxzZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSBpZiAoc3RyRXEoYV9uYW1lLCAiYWxpZ25tZW50IikgfHwgc3RyRXEoYV9uYW1lLCAiYmxvY2stc2l6ZSIpKSB7CisgICAgICAgICAgICByZXR1cm4gbGltaXRGb3VuZE1pc3NpbmdBdHRyKGFfbmFtZSwgInZhbHVlIiwgZmFsc2UpOworICAgICAgICB9CisKKyAgICB9CisKKyAgICByZXR1cm4gT0s7Cit9CisKK3N0YXR1c190IE1lZGlhQ29kZWNzWG1sUGFyc2VyOjphZGRGZWF0dXJlKGNvbnN0IGNoYXIgKiphdHRycykgeworICAgIHNpemVfdCBpID0gMDsKKyAgICBjb25zdCBjaGFyICpuYW1lID0gbnVsbHB0cjsKKyAgICBpbnQzMl90IG9wdGlvbmFsID0gLTE7CisgICAgaW50MzJfdCByZXF1aXJlZCA9IC0xOworICAgIGNvbnN0IGNoYXIgKnZhbHVlID0gbnVsbHB0cjsKKworICAgIHdoaWxlIChhdHRyc1tpXSAhPSBudWxscHRyKSB7CisgICAgICAgIGlmIChzdHJFcShhdHRyc1tpXSwgIm5hbWUiKSkgeworICAgICAgICAgICAgaWYgKGF0dHJzWysraV0gPT0gbnVsbHB0cikgeworICAgICAgICAgICAgICAgIEFMT0dFKCJhZGRGZWF0dXJlOiBuYW1lIGlzIG51bGwiKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG5hbWUgPSBhdHRyc1tpXTsKKyAgICAgICAgfSBlbHNlIGlmIChzdHJFcShhdHRyc1tpXSwgIm9wdGlvbmFsIikpIHsKKyAgICAgICAgICAgIGlmIChhdHRyc1srK2ldID09IG51bGxwdHIpIHsKKyAgICAgICAgICAgICAgICBBTE9HRSgiYWRkRmVhdHVyZTogb3B0aW9uYWwgaXMgbnVsbCIpOworICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgb3B0aW9uYWwgPSBwYXJzZUJvb2xlYW4oYXR0cnNbaV0pID8gMSA6IDA7CisgICAgICAgIH0gZWxzZSBpZiAoc3RyRXEoYXR0cnNbaV0sICJyZXF1aXJlZCIpKSB7CisgICAgICAgICAgICBpZiAoYXR0cnNbKytpXSA9PSBudWxscHRyKSB7CisgICAgICAgICAgICAgICAgQUxPR0UoImFkZEZlYXR1cmU6IHJlcXVpcmVkIGlzIG51bGwiKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJlcXVpcmVkID0gcGFyc2VCb29sZWFuKGF0dHJzW2ldKSA/IDEgOiAwOworICAgICAgICB9IGVsc2UgaWYgKHN0ckVxKGF0dHJzW2ldLCAidmFsdWUiKSkgeworICAgICAgICAgICAgaWYgKGF0dHJzWysraV0gPT0gbnVsbHB0cikgeworICAgICAgICAgICAgICAgIEFMT0dFKCJhZGRGZWF0dXJlOiB2YWx1ZSBpcyBudWxsIik7CisgICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB2YWx1ZSA9IGF0dHJzW2ldOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgQUxPR0UoImFkZEZlYXR1cmU6IHVucmVjb2duaXplZCBhdHRyaWJ1dGU6ICVzIiwgYXR0cnNbaV0pOworICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgIH0KKyAgICAgICAgKytpOworICAgIH0KKworICAgIC8vIEV2ZXJ5IGZlYXR1cmUgbXVzdCBoYXZlIGEgbmFtZS4KKyAgICBpZiAobmFtZSA9PSBudWxscHRyKSB7CisgICAgICAgIEFMT0dFKCJmZWF0dXJlIHdpdGggbm8gJ25hbWUnIGF0dHJpYnV0ZSIpOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBpZiAobUN1cnJlbnRUeXBlID09IG1DdXJyZW50Q29kZWMtPnNlY29uZC50eXBlTWFwLmVuZCgpKSB7CisgICAgICAgIEFMT0dXKCJpZ25vcmluZyBudWxsIHR5cGUiKTsKKyAgICAgICAgcmV0dXJuIE9LOworICAgIH0KKworICAgIGlmICgob3B0aW9uYWwgIT0gLTEpIHx8IChyZXF1aXJlZCAhPSAtMSkpIHsKKyAgICAgICAgaWYgKG9wdGlvbmFsID09IHJlcXVpcmVkKSB7CisgICAgICAgICAgICBBTE9HRSgiZmVhdHVyZSAnJXMnIGlzIGJvdGgvbmVpdGhlciBvcHRpb25hbCBhbmQgcmVxdWlyZWQiLCBuYW1lKTsKKyAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICB9CisgICAgICAgIGlmICgob3B0aW9uYWwgPT0gMSkgfHwgKHJlcXVpcmVkID09IDEpKSB7CisgICAgICAgICAgICBpZiAodmFsdWUgIT0gbnVsbHB0cikgeworICAgICAgICAgICAgICAgIEFMT0dFKCJmZWF0dXJlICclcycgY2Fubm90IGhhdmUgZXh0cmEgJ3ZhbHVlJyIsIG5hbWUpOworICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbUN1cnJlbnRUeXBlLT5zZWNvbmRbc3RkOjpzdHJpbmcoImZlYXR1cmUtIikgKyBuYW1lXSA9CisgICAgICAgICAgICAgICAgICAgIG9wdGlvbmFsID09IDEgPyAiMCIgOiAiMSI7CisgICAgICAgICAgICBy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IHsKKyAgICByZXR1cm4gbVBhcnNpbmdTdGF0dXM7Cit9CisKK3ZvaWQgTWVkaWFDb2RlY3NYbWxQYXJzZXI6OmdlbmVyYXRlUm9sZU1hcCgpIGNvbnN0IHsKKyAgICBmb3IgKGNvbnN0IGF1dG8mIGNvZGVjIDogbUNvZGVjTWFwKSB7CisgICAgICAgIGNvbnN0IGF1dG8mIGNvZGVjTmFtZSA9IGNvZGVjLmZpcnN0OworICAgICAgICBib29sIGlzRW5jb2RlciA9IGNvZGVjLnNlY29uZC5pc0VuY29kZXI7CisgICAgICAgIHNpemVfdCBvcmRlciA9IGNvZGVjLnNlY29uZC5vcmRlcjsKKyAgICAgICAgY29uc3QgYXV0byYgdHlwZU1hcCA9IGNvZGVjLnNlY29uZC50eXBlTWFwOworICAgICAgICBmb3IgKGNvbnN0IGF1dG8mIHR5cGUgOiB0eXBlTWFwKSB7CisgICAgICAgICAgICBjb25zdCBhdXRvJiB0eXBlTmFtZSA9IHR5cGUuZmlyc3Q7CisgICAgICAgICAgICBjb25zdCBjaGFyKiByb2xlTmFtZSA9IEdldENvbXBvbmVudFJvbGUoaXNFbmNvZGVyLCB0eXBlTmFtZS5kYXRhKCkpOworICAgICAgICAgICAgaWYgKHJvbGVOYW1lID09IG51bGxwdHIpIHsKKyAgICAgICAgICAgICAgICBBTE9HRSgiQ2Fubm90IGZpbmQgdGhlIHJvbGUgZm9yICVzIG9mIHR5cGUgJXMiLAorICAgICAgICAgICAgICAgICAgICAgICAgaXNFbmNvZGVyID8gImFuIGVuY29kZXIiIDogImEgZGVjb2RlciIsCisgICAgICAgICAgICAgICAgICAgICAgICB0eXBlTmFtZS5kYXRhKCkpOworICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgY29uc3QgYXV0byYgdHlwZUF0dHJpYnV0ZU1hcCA9IHR5cGUuc2Vjb25kOworCisgICAgICAgICAgICBhdXRvIHJvbGVJdGVyYXRvciA9IG1Sb2xlTWFwLmZpbmQocm9sZU5hbWUpOworICAgICAgICAgICAgc3RkOjptdWx0aW1hcDxzaXplX3QsIE5vZGVJbmZvPiogbm9kZUxpc3Q7CisgICAgICAgICAgICBpZiAocm9sZUl0ZXJhdG9yID09IG1Sb2xlTWFwLmVuZCgpKSB7CisgICAgICAgICAgICAgICAgUm9sZVByb3BlcnRpZXMgcm9sZVByb3BlcnRpZXM7CisgICAgICAgICAgICAgICAgcm9sZVByb3BlcnRpZXMudHlwZSA9IHR5cGVOYW1lOworICAgICAgICAgICAgICAgIHJvbGVQcm9wZXJ0aWVzLmlzRW5jb2RlciA9IGlzRW5jb2RlcjsKKyAgICAgICAgICAgICAgICBhdXRvIGluc2VydFJlc3VsdCA9IG1Sb2xlTWFwLmluc2VydCgKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0ZDo6bWFrZV9wYWlyKHJvbGVOYW1lLCByb2xlUHJvcGVydGllcykpOworICAgICAgICAgICAgICAgIGlmICghaW5zZXJ0UmVzdWx0LnNlY29uZCkgeworICAgICAgICAgICAgICAgICAgICBBTE9HRSgiQ2Fubm90IGFkZCByb2xlICVzIiwgcm9sZU5hbWUpOworICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbm9kZUxpc3QgPSAmaW5zZXJ0UmVzdWx0LmZpcnN0LT5zZWNvbmQubm9kZUxpc3Q7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGlmIChyb2xlSXRlcmF0b3ItPnNlY29uZC50eXBlICE9IHR5cGVOYW1lKSB7CisgICAgICAgICAgICAgICAgICAgIEFMT0dFKCJSb2xlICVzIGhhcyBtaXNtYXRjaGluZyB0eXBlczogJXMgYW5kICVzIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByb2xlTmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByb2xlSXRlcmF0b3ItPnNlY29uZC50eXBlLmRhdGEoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlTmFtZS5kYXRhKCkpOworICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKHJvbGVJdGVyYXRvci0+c2Vjb25kLmlzRW5jb2RlciAhPSBpc0VuY29kZXIpIHsKKyAgICAgICAgICAgICAgICAgICAgQUxPR0UoIlJvbGUgJXMgY2Fubm90IGJlIGJvdGggYW4gZW5jb2RlciBhbmQgYSBkZWNvZGVyIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByb2xlTmFtZSk7CisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBub2RlTGlzdCA9ICZyb2xlSXRlcmF0b3ItPnNlY29uZC5ub2RlTGlzdDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgTm9kZUluZm8gbm9kZUluZm87CisgICAgICAgICAgICBub2RlSW5mby5uYW1lID0gY29kZWNOYW1lOworICAgICAgICAgICAgbm9kZUluZm8uYXR0cmlidXRlTGlzdC5yZXNlcnZlKHR5cGVBdHRyaWJ1dGVNYXAuc2l6ZSgpKTsKKyAgICAgICAgICAgIGZvciAoY29uc3QgYXV0byYgYXR0cmlidXRlIDogdHlwZUF0dHJpYnV0ZU1hcCkgeworICAgICAgICAgICAgICAgIG5vZGVJbmZvLmF0dHJpYnV0ZUxpc3QucHVzaF9iYWNrKAorICAgICAgICAgICAgICAgICAgICAgICAgQXR0cmlidXRle2F0dHJpYnV0ZS5maXJzdCwgYXR0cmlidXRlLnNlY29uZH0pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbm9kZUxpc3QtPmluc2VydChzdGQ6Om1ha2VfcGFpcigKKyAgICAgICAgICAgICAgICAgICAgc3RkOjptb3ZlKG9yZGVyKSwgc3RkOjptb3ZlKG5vZGVJbmZvKSkpOworICAgICAgICB9CisgICAgfQorfQorCit2b2l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uc3Q7CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm4gYSBtYXAgZm9yIGNvZGVjcyBhbmQgdGhlaXIgcHJvcGVydGllcy4KKyAgICAgKi8KKyAgICBjb25zdCBDb2RlY01hcCYgZ2V0Q29kZWNNYXAoKSBjb25zdDsKKworICAgIC8qKgorICAgICAqIFJldHVybiBhIG1hcCBmb3Igcm9sZXMgYW5kIHRoZWlyIHByb3BlcnRpZXMuCisgICAgICogVGhpcyBtYXAgaXMgZ2VuZXJhdGVkIGZyb20gdGhlIENvZGVjTWFwLgorICAgICAqLworICAgIGNvbnN0IFJvbGVNYXAmIGdldFJvbGVNYXAoKSBjb25zdDsKKworICAgIC8qKgorICAgICAqIFJldHVybiBhIGNvbW1vbiBwcmVmaXggb2YgYWxsIG5vZGUgbmFtZXMuCisgICAgICoKKyAgICAgKiBUaGUgcHJlZml4IGlzIG5vdCBwcm92aWRlZCBpbiB0aGUgeG1sLCBzbyBpdCBoYXMgdG8gYmUgY29tcHV0ZWQgYnkgdGFraW5nCisgICAgICogdGhlIGxvbmdlc3QgY29tbW9uIHByZWZpeCBvZiBhbGwgbm9kZSBuYW1lcy4KKyAgICAgKi8KKyAgICBjb25zdCBjaGFyKiBnZXRDb21tb25QcmVmaXgoKSBjb25zdDsKKworICAgIHN0YXR1c190IGdldFBhcnNpbmdTdGF0dXMoKSBjb25zdDsKKworcHJpdmF0ZToKKyAgICBlbnVtIFNlY3Rpb24geworICAgICAgICBTRUNUSU9OX1RPUExFVkVMLAorICAgICAgICBTRUNUSU9OX1NFVFRJTkdTLAorICAgICAgICBTRUNUSU9OX0RFQ09ERVJTLAorICAgICAgICBTRUNUSU9OX0RFQ09ERVIsCisgICAgICAgIFNFQ1RJT05fREVDT0RFUl9UWVBFLAorICAgICAgICBTRUNUSU9OX0VOQ09ERVJTLAorICAgICAgICBTRUNUSU9OX0VOQ09ERVIsCisgICAgICAgIFNFQ1RJT05fRU5DT0RFUl9UWVBFLAorICAgICAgICBTRUNUSU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sKKyAgICAgICAgc3dpdGNoIChldmVudC0+dHlwZSkgeworICAgICAgICBjYXNlIEZVTkNUSU9ORlNfQklORDoKKyAgICAgICAgY2FzZSBGVU5DVElPTkZTX0VOQUJMRToKKyAgICAgICAgY2FzZSBGVU5DVElPTkZTX1JFU1VNRToKKyAgICAgICAgICAgIHJldCA9IDA7CisgICAgICAgICAgICBlcnJubyA9IDA7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBGVU5DVElPTkZTX1NVU1BFTkQ6CisgICAgICAgIGNhc2UgRlVOQ1RJT05GU19VTkJJTkQ6CisgICAgICAgIGNhc2UgRlVOQ1RJT05GU19ESVNBQkxFOgorICAgICAgICAgICAgZXJybm8gPSBFU0hVVERPV047CisgICAgICAgICAgICByZXQgPSAtMTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIEZVTkNUSU9ORlNfU0VUVVA6CisgICAgICAgICAgICBpZiAoaGFuZGxlQ29udHJvbFJlcXVlc3QoJmV2ZW50LT51LnNldHVwKSA9PSAtMSkKKyAgICAgICAgICAgICAgICByZXQgPSAtMTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgTE9HKERFQlVHKSA8PCAiTXRwIEV2ZW50ICIgPDwgZXZlbnQtPnR5cGUgPDwgIiAodW5rbm93bikiOworICAgICAgICB9CisgICAgfQorICAgIHJldHVybiByZXQ7Cit9CisKK2ludCBNdHBGZnNIYW5kbGU6OmhhbmRsZUNvbnRyb2xSZXF1ZXN0KGNvbnN0IHN0cnVjdCB1c2JfY3RybHJlcXVlc3QgKnNldHVwKSB7CisgICAgdWludDhfdCB0eXBlID0gc2V0dXAtPmJSZXF1ZXN0VHlwZTsKKyAgICB1aW50OF90IGNvZGUgPSBzZXR1cC0+YlJlcXVlc3Q7CisgICAgdWludDE2X3QgbGVuZ3RoID0gc2V0dXAtPndMZW5ndGg7CisgICAgdWludDE2X3QgaW5kZXggPSBzZXR1cC0+d0luZGV4OworICAgIHVpbnQxNl90IHZhbHVlID0gc2V0dXAtPndWYWx1ZTsKKyAgICBzdGQ6OnZlY3RvcjxjaGFyPiBidWY7CisgICAgYnVmLnJlc2l6ZShsZW5ndGgpOworCisgICAgaWYgKCEodHlwZSAmIFVTQl9ESVJfSU4pKSB7CisgICAgICAgIGlmICg6OnJlYWQobUNvbnRyb2wsIGJ1Zi5kYXRhKCksIGxlbmd0aCkgIT0gbGVuZ3RoKSB7CisgICAgICAgICAgICBQTE9HKERFQlVHKSA8PCAiTXRwIGVycm9yIGN0cmxyZXEgcmVhZCBkYXRhIjsKKyAgICAgICAgfQorICAgIH0KKworICAgIGlmICgodHlwZSAmIFVTQl9UWVBFX01BU0spID09IFVTQl9UWVBFX0NMQVNTICYmIGluZGV4ID09IDAgJiYgdmFsdWUgPT0gMCkgeworICAgICAgICBzd2l0Y2goY29kZSkgeworICAgICAgICBjYXNlIE1UUF9SRVFfR0VUX0RFVklDRV9TVEFUVVM6CisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChsZW5ndGggPCBzaXplb2Yoc3RydWN0IG10cF9kZXZpY2Vfc3RhdHVzKSkgeworICAgICAgICAgICAgICAgIHJldHVybiAtMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHN0cnVjdCBtdHBfZGV2aWNlX3N0YXR1cyAqc3QgPSByZWludGVycHJldF9jYXN0PHN0cnVjdCBtdHBfZGV2aWNlX3N0YXR1cyo+KGJ1Zi5kYXRhKCkpOworICAgICAgICAgICAgc3QtPndMZW5ndGggPSBodG9sZTE2KHNpemVvZihzdCkpOworICAgICAgICAgICAgc3QtPndDb2RlID0gTVRQX1JFU1BPTlNFX09LOworICAgICAgICAgICAgbGVuZ3RoID0gc3QtPndMZW5ndGg7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgTE9HKERFQlVHKSA8PCAiVW5yZWNvZ25pemVkIE10cCBjbGF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VJEV0FSRUJVRkZFUl9VU0FHRV9DUFVfUkVBRCAoMHgyKS4KKyAgICBib29sIGhhc0NwdVVzYWdlID0gdXNhZ2UgJiBBSEFSRFdBUkVCVUZGRVJfVVNBR0VfQ1BVX1JFQURfT0ZURU47CiAgICAgc3dpdGNoIChmb3JtYXQpIHsKICAgICAgICAgY2FzZSBBSU1BR0VfRk9STUFUX1JHQkFfODg4ODoKICAgICAgICAgY2FzZSBBSU1BR0VfRk9STUFUX1JHQlhfODg4ODoKQEAgLTYwLDYgKzY0LDkgQEAKICAgICAgICAgY2FzZSBBSU1BR0VfRk9STUFUX0RFUFRIMTY6CiAgICAgICAgIGNhc2UgQUlNQUdFX0ZPUk1BVF9ERVBUSF9QT0lOVF9DTE9VRDoKICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICBjYXNlIEFJTUFHRV9GT1JNQVRfUFJJVkFURToKKyAgICAgICAgICAgIC8vIEZvciBwcml2YXRlIGZvcm1hdCwgY3B1IHVzYWdlIGlzIHByb2hpYml0ZWQuCisgICAgICAgICAgICByZXR1cm4gIWhhc0NwdVVzYWdlOwogICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgIH0KQEAgLTgzLDYgKzkwLDggQEAKICAgICAgICAgY2FzZSBBSU1BR0VfRk9STUFUX0RFUFRIMTY6CiAgICAgICAgIGNhc2UgQUlNQUdFX0ZPUk1BVF9ERVBUSF9QT0lOVF9DTE9VRDoKICAgICAgICAgICAgIHJldHVybiAxOworICAgICAgICBjYXNlIEFJTUFHRV9GT1JNQVRfUFJJVkFURToKKyAgICAgICAgICAgIHJldHVybiAwOwogICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgcmV0dXJuIC0xOwogICAgIH0KQEAgLTM0MCw3ICszNDksOCBAQAogICAgIGZvciAoYXV0byBpdCA9IG1BY3F1aXJlZEltYWdlcy5iZWdpbigpOwogICAgICAgICAgICAgICBpdCAhPSBtQWNxdWlyZWR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pemVvZihsb25nKSwKKyAgICAgICAgICAgICAgIl9vZmZfdF9jb21wYXQgZG9lcyBub3QgbWF0Y2ggdGhlIE5ESyBBQkkuIFNlZSAiCisgICAgICAgICAgICAgICJodHRwczovL2dpdGh1Yi5jb20vYW5kcm9pZC1uZGsvbmRrL2lzc3Vlcy80NTkuIik7CisjZW5kaWYKIAogLyoqCiAgKiBTZW5kIHRoZSBzcGVjaWZpZWQgYnVmZmVyIHRvIHRoZSBjb2RlYyBmb3IgcHJvY2Vzc2luZy4KICAqLwotbWVkaWFfc3RhdHVzX3QgQU1lZGlhQ29kZWNfcXVldWVTZWN1cmVJbnB1dEJ1ZmZlcihBTWVkaWFDb2RlYyosCi0gICAgICAgIHNpemVfdCBpZHgsIG9mZl90IG9mZnNldCwgQU1lZGlhQ29kZWNDcnlwdG9JbmZvKiwgdWludDY0X3QgdGltZSwgdWludDMyX3QgZmxhZ3MpOworbWVkaWFfc3RhdHVzX3QgQU1lZGlhQ29kZWNfcXVldWVJbnB1dEJ1ZmZlcihBTWVkaWFDb2RlYyosIHNpemVfdCBpZHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9vZmZfdF9jb21wYXQgb2Zmc2V0LCBzaXplX3Qgc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDY0X3QgdGltZSwgdWludDMyX3QgZmxhZ3MpOworCisvKioKKyAqIFNlbmQgdGhlIHNwZWNpZmllZCBidWZmZXIgdG8gdGhlIGNvZGVjIGZvciBwcm9jZXNzaW5nLgorICovCittZWRpYV9zdGF0dXNfdCBBTWVkaWFDb2RlY19xdWV1ZVNlY3VyZUlucHV0QnVmZmVyKEFNZWRpYUNvZGVjKiwgc2l6ZV90IGlkeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX29mZl90X2NvbXBhdCBvZmZzZXQsCisgICAgICAgICAgICAgICAgICAgIC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XN0U2VjdGlvbnMucHVzaChtQ3VycmVudFNlY3Rpb24pOwotICAgICAgICAgICAgbUN1cnJlbnRTZWN0aW9uID0gU0VDVElPTl9JTkNMVURFOwotICAgICAgICB9Ci0gICAgICAgICsrbURlcHRoOwotICAgICAgICByZXR1cm47Ci0gICAgfQotCi0gICAgc3dpdGNoIChtQ3VycmVudFNlY3Rpb24pIHsKLSAgICAgICAgY2FzZSBTRUNUSU9OX1RPUExFVkVMOgotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoIXN0cmNtcChuYW1lLCAiRGVjb2RlcnMiKSkgewotICAgICAgICAgICAgICAgIG1DdXJyZW50U2VjdGlvbiA9IFNFQ1RJT05fREVDT0RFUlM7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKCFzdHJjbXAobmFtZSwgIkVuY29kZXJzIikpIHsKLSAgICAgICAgICAgICAgICBtQ3VycmVudFNlY3Rpb24gPSBTRUNUSU9OX0VOQ09ERVJTOwotICAgICAgICAgICAgfSBlbHNlIGlmICghc3RyY21wKG5hbWUsICJTZXR0aW5ncyIpKSB7Ci0gICAgICAgICAgICAgICAgbUN1cnJlbnRTZWN0aW9uID0gU0VDVElPTl9TRVRUSU5HUzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBTRUNUSU9OX1NFVFRJTkdTOgotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoIXN0cmNtcChuYW1lLCAiU2V0dGluZyIpKSB7Ci0gICAgICAgICAgICAgICAgbUluaXRDaGVjayA9IGFkZFNldHRpbmdGcm9tQXR0cmlidXRlcyhhdHRycyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgU0VDVElPTl9ERUNPREVSUzoKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKCFzdHJjbXAobmFtZSwgIk1lZGlhQ29kZWMiKSkgewotICAgICAgICAgICAgICAgIG1Jbml0Q2hlY2sgPQotICAgICAgICAgICAgICAgICAgICBhZGRNZWRpYUNvZGVjRnJvbUF0dHJpYnV0ZXMoZmFsc2UgLyogZW5jb2RlciAqLywgYXR0cnMpOwotCi0gICAgICAgICAgICAgICAgbUN1cnJlbnRTZWN0aW9uID0gU0VDVElPTl9ERUNPREVSOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIFNFQ1RJT05fRU5DT0RFUlM6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICghc3RyY21wKG5hbWUsICJNZWRpYUNvZGVjIikpIHsKLSAgICAgICAgICAgICAgICBtSW5pdENoZWNrID0KLSAgICAgICAgICAgICAgICAgICAgYWRkTWVkaWFDb2RlY0Zyb21BdHRyaWJ1dGVzKHRydWUgLyogZW5jb2RlciAqLywgYXR0cnMpOwotCi0gICAgICAgICAgICAgICAgbUN1cnJlbnRTZWN0aW9uID0gU0VDVElPTl9FTkNPREVSOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIFNFQ1RJT05fREVDT0RFUjoKLSAgICAgICAgY2FzZSBTRUNUSU9OX0VOQ09ERVI6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICghc3RyY21wKG5hbWUsICJRdWlyayIpKSB7Ci0gICAgICAgICAgICAgICAgbUluaXRDaGVjayA9IGFkZFF1aXJrKGF0dHJzKTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAoIXN0cmNtcChuYW1lLCAiVHlwZSIpKSB7Ci0gICAgICAgICAgICAgICAgbUluaXRDaGVjayA9IGFkZFR5cGVGcm9tQXR0cmlidXRlcyhhdHRycywgKG1DdXJyZW50U2VjdGlvbiA9PSBTRUNUSU9OX0VOQ09ERVIpKTsKLSAgICAgICAgICAgICAgICBtQ3VycmVudFNlY3Rpb24gPQotICAgICAgICAgICAgIC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ICB9Ci0KLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIGJyZWFrOwotICAgIH0KLQotICAgICsrbURlcHRoOwotfQotCi12b2lkIE1lZGlhQ29kZWNzWG1sUGFyc2VyOjplbmRFbGVtZW50SGFuZGxlcihjb25zdCBjaGFyICpuYW1lKSB7Ci0gICAgaWYgKG1Jbml0Q2hlY2sgIT0gT0spIHsKLSAgICAgICAgcmV0dXJuOwotICAgIH0KLQotICAgIHN3aXRjaCAobUN1cnJlbnRTZWN0aW9uKSB7Ci0gICAgICAgIGNhc2UgU0VDVElPTl9TRVRUSU5HUzoKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKCFzdHJjbXAobmFtZSwgIlNldHRpbmdzIikpIHsKLSAgICAgICAgICAgICAgICBtQ3VycmVudFNlY3Rpb24gPSBTRUNUSU9OX1RPUExFVkVMOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIFNFQ1RJT05fREVDT0RFUlM6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICghc3RyY21wKG5hbWUsICJEZWNvZGVycyIpKSB7Ci0gICAgICAgICAgICAgICAgbUN1cnJlbnRTZWN0aW9uID0gU0VDVElPTl9UT1BMRVZFTDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBTRUNUSU9OX0VOQ09ERVJTOgotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoIXN0cmNtcChuYW1lLCAiRW5jb2RlcnMiKSkgewotICAgICAgICAgICAgICAgIG1DdXJyZW50U2VjdGlvbiA9IFNFQ1RJT05fVE9QTEVWRUw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgU0VDVElPTl9ERUNPREVSX1RZUEU6Ci0gICAgICAgIGNhc2UgU0VDVElPTl9FTkNPREVSX1RZUEU6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICghc3RyY21wKG5hbWUsICJUeXBlIikpIHsKLSAgICAgICAgICAgICAgICBtQ3VycmVudFNlY3Rpb24gPQotICAgICAgICAgICAgICAgICAgICAobUN1cnJlbnRTZWN0aW9uID09IFNFQ1RJT05fREVDT0RFUl9UWVBFCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBTRUNUSU9OX0RFQ09ERVIgOiBTRUNUSU9OX0VOQ09ERVIpOwotCi0gICAgICAgICAgICAgICAgbUN1cnJlbnRUeXBlID0gbUNvZGVjSW5mb3NbbUN1cnJlbnROYW1lXS5tVHlwZXMuZW5kKCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgU0VDVElPTl9ERUNPREVSOgotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoIXN0cmNtcChuYW1lLCAiTWVkaWFDb2RlYyIpKSB7Ci0gICAgICAgICAgICAgICAgbUN1cnJlbnRTZWN0aW9uID0gU0VDVElPTl9ERUNPREVSUzsKLSAgICAgICAgICAgICAgICBtQ3VycmVudE5hbWUuY2xlYXIoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBTRUNUSU9OX0VOQ09ERVI6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICghc3RyY21wKG5hbWUsICJNZWRpYUNvZGVjIikpIHsKLSAgICAgICAgICAgICAgICBtQ3VycmVudFNlY3Rpb24gPSBTRUNUSU9OX0VOQ09ERVJTOwotICAgICAgICAgICAgICAgIG1DdXJyZW50TmFtZS5jbGVhcigpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIFNFQ1RJT05fSU5DTFVERToKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKCFzdHJjbXAobmFtZSwgIkluY2x1ZGUiKSAmJiBtUGFzdFNlY3Rpb25zLnNpemUoKSA+IDApIHsKLSAgICAgICAgICAgICAgICBtQ3VycmVudFNlY3Rpb24gPSBtUGFzdFNlY3Rpb25zLnRvcCgpOwotICAgICAgICAgICAgICAgIG1QYXN0U2VjdGlvbnMucG9wKCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICBicmVhazsKLSAgICB9Ci0KLSAgICAtLW1EZXB0aDsKLX0KLQotc3RhdHVzX3QgTWVkaWFDb2RlY3NYbWxQYXJzZXI6OmFkZFNldHRpbmdGcm9tQXR0cmlidXRlcyhjb25zdCBjaGFyICoqYXR0cnMpIHsKLSAgICBjb25zdCBjaGFyICpuYW1lID0gTlVMTDsKLSAgICBjb25zdCBjaGFyICp2YWx1ZSA9IE5VTEw7Ci0gICAgY29uc3QgY2hhciAqdXBkYXRlID0gTlVMTDsKLQotICAgIHNpemVfdCBpID0gMDsKLSAgICB3aGlsZSAoYXR0cnNbaV0gIT0gTlVMTCkgewotICAgICAgICBpZiAoIXN0cmNtcChhdHRyc1tpXSwgIm5hbWUiKSkgewotICAgICAgICAgICAgaWYgKGF0dHJzW2kgKyAxXSA9PSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgQUxPR0UoImFkZFNldHRpbmdGcm9tQXR0cmlidXRlczogbmFtZSBpcyBudWxsIik7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBuYW1lID0gYXR0cnNbaSArIDFdOwotICAgICAgICAgICAgKytpOwotICAgICAgICB9IGVsc2UgaWYgKCFzdHJjbXAoYXR0cnNbaV0sICJ2YWx1ZSIpKSB7Ci0gICAgICAgICAgICBpZiAoYXR0cnNbaSArIDFdID09IE5VTEwpIHsKLSAgICAgICAgICAgICAgICBBTE9HRSgiY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TlVMTDsKLQotICAgIHNpemVfdCBpID0gMDsKLSAgICB3aGlsZSAoYXR0cnNbaV0gIT0gTlVMTCkgewotICAgICAgICBpZiAoIXN0cmNtcChhdHRyc1tpXSwgIm5hbWUiKSkgewotICAgICAgICAgICAgaWYgKGF0dHJzW2kgKyAxXSA9PSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgQUxPR0UoImFkZFR5cGVGcm9tQXR0cmlidXRlczogbmFtZSBpcyBudWxsIik7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBuYW1lID0gYXR0cnNbaSArIDFdOwotICAgICAgICAgICAgKytpOwotICAgICAgICB9IGVsc2UgaWYgKCFzdHJjbXAoYXR0cnNbaV0sICJ1cGRhdGUiKSkgewotICAgICAgICAgICAgaWYgKGF0dHJzW2kgKyAxXSA9PSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgQUxPR0UoImFkZFR5cGVGcm9tQXR0cmlidXRlczogdXBkYXRlIGlzIG51bGwiKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHVwZGF0ZSA9IGF0dHJzW2kgKyAxXTsKLSAgICAgICAgICAgICsraTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIEFMT0dFKCJhZGRUeXBlRnJvbUF0dHJpYnV0ZXM6IHVucmVjb2duaXplZCBhdHRyaWJ1dGU6ICVzIiwgYXR0cnNbaV0pOwotICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgIH0KLQotICAgICAgICArK2k7Ci0gICAgfQotCi0gICAgaWYgKG5hbWUgPT0gTlVMTCkgewotICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICB9Ci0KLSAgICBDb2RlY0luZm8gKmluZm8gPSAmbUNvZGVjSW5mb3NbbUN1cnJlbnROYW1lXTsKLSAgICBpbmZvLT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gICAgICAgfSBlbHNlIGlmIChtc2ctPmNvbnRhaW5zKCJtaW4iKSB8fCBtc2ctPmNvbnRhaW5zKCJtYXgiKSkgewotICAgICAgICAgICAgcmV0dXJuIGxpbWl0RXJyb3IobmFtZSwgImhhcyBvbmx5ICdtaW4nIG9yICdtYXgnIGF0dHJpYnV0ZSIpOwotICAgICAgICB9IGVsc2UgaWYgKG1zZy0+ZmluZFN0cmluZygidmFsdWUiLCAmbWF4KSkgewotICAgICAgICAgICAgbWluID0gbWF4OwotICAgICAgICAgICAgbWluLmFwcGVuZCgiLSIpOwotICAgICAgICAgICAgbWluLmFwcGVuZChtYXgpOwotICAgICAgICAgICAgaWYgKG1zZy0+Y29udGFpbnMoInJhbmdlIikpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gbGltaXRFcnJvcihuYW1lLCAiaGFzIGJvdGggJ3JhbmdlJyBhbmQgJ3ZhbHVlJyBhdHRyaWJ1dGVzIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBtc2ctPnNldFN0cmluZygicmFuZ2UiLCBtaW4pOwotICAgICAgICB9Ci0KLSAgICAgICAgQVN0cmluZyByYW5nZSwgc2NhbGUgPSAibGluZWFyIiwgZGVmLCBpbl87Ci0gICAgICAgIGlmICghbXNnLT5maW5kU3RyaW5nKCJyYW5nZSIsICZyYW5nZSkpIHsKLSAgICAgICAgICAgIHJldHVybiBsaW1pdEVycm9yKG5hbWUsICJ3aXRoIG5vICdyYW5nZScsICd2YWx1ZScgb3IgJ21pbicvJ21heCcgYXR0cmlidXRlcyIpOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKChuYW1lID09ICJxdWFsaXR5IiB8fCBuYW1lID09ICJjb21wbGV4aXR5IikgXgotICAgICAgICAgICAgICAgIChmb3VuZCA9IG1zZy0+ZmluZFN0cmluZygiZGVmYXVsdCIsICZkZWYpKSkgewotICAgICAgICAgICAgcmV0dXJuIGxpbWl0Rm91bmRNaXNzaW5nQXR0cihuYW1lLCAiZGVmYXVsdCIsIGZvdW5kKTsKLSAgICAgICAgfQotICAgICAgICBpZiAobmFtZSAhPSAicXVhbGl0eSIgJiYgbXNnLT5maW5kU3RyaW5nKCJzY2FsZSIsICZzY2FsZSkpIHsKLSAgICAgICAgICAgIHJldHVybiBsaW1pdEZvdW5kTWlzc2luZ0F0dHIobmFtZSwgInNjYWxlIik7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKChuYW1lID09ICJhc3BlY3QtcmF0aW8iKSBeIChmb3VuZCA9IG1zZy0+ZmluZFN0cmluZygiaW4iLCAmaW5fKSkpIHsKLSAgICAgICAgICAgIHJldHVybiBsaW1pdEZvdW5kTWlzc2luZ0F0dHIobmFtZSwgImluIiwgZm91bmQpOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKG5hbWUgPT0gImFzcGVjdC1yYXRpbyIpIHsKLSAgICAgICAgICAgIGlmICghKGluXyA9PSAicGl4ZWxzIikgJiYgIShpbl8gPT0gImJsb2NrcyIpKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGxpbWl0SW52YWxpZEF0dHIobmFtZSwgImluIiwgaW5fKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGluXy5lcmFzZSg1LCAxKTsgLy8gKHBpeGVsfGJsb2NrKS1hc3BlY3QtcmF0aW8KLSAgICAgICAgICAgIGluXy5hcHBlbmQoIi0iKTsKLSAgICAgICAgICAgIGluXy5hcHBlbmQobmFtZSk7Ci0gICAgICAgICAgICBuYW1lID0gaW5fOwotICAgICAgICB9Ci0gICAgICAgIGlmIChuYW1lID09ICJxdWFsaXR5IikgewotICAgICAgICAgICAgbUN1cnJlbnRUeXBlLT5tRGV0YWlsc1sicXVhbGl0eS1zY2FsZSJdID0gc2NhbGU7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKG5hbWUgPT0gInF1YWxpdHkiIHx8IG5hbWUgPT0gImNvbXBsZXhpdHkiKSB7Ci0gICAgICAgICAgICBBU3RyaW5nIHRhZyA9I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AgICAgICAgICAgIGlmICghc3RyY21wKGF0dHJzW2ldLCAib3B0aW9uYWwiKSkgewotICAgICAgICAgICAgICAgIG9wdGlvbmFsID0gdmFsdWU7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHJlcXVpcmVkID0gdmFsdWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICArK2k7Ci0gICAgICAgIH0gZWxzZSBpZiAoIXN0cmNtcChhdHRyc1tpXSwgInZhbHVlIikpIHsKLSAgICAgICAgICAgIHZhbHVlID0gYXR0cnNbaSArIDFdOwotICAgICAgICAgICAgKytpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgQUxPR0UoImFkZEZlYXR1cmU6IHVucmVjb2duaXplZCBhdHRyaWJ1dGU6ICVzIiwgYXR0cnNbaV0pOwotICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgIH0KLSAgICAgICAgKytpOwotICAgIH0KLSAgICBpZiAobmFtZSA9PSBOVUxMKSB7Ci0gICAgICAgIEFMT0dFKCJmZWF0dXJlIHdpdGggbm8gJ25hbWUnIGF0dHJpYnV0ZSIpOwotICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICB9Ci0KLSAgICBpZiAob3B0aW9uYWwgPT0gcmVxdWlyZWQgJiYgb3B0aW9uYWwgIT0gLTEpIHsKLSAgICAgICAgQUxPR0UoImZlYXR1cmUgJyVzJyBpcyBib3RoL25laXRoZXIgb3B0aW9uYWwgYW5kIHJlcXVpcmVkIiwgbmFtZSk7Ci0gICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgIH0KLQotICAgIGlmIChtQ3VycmVudFR5cGUgPT0gbUNvZGVjSW5mb3NbbUN1cnJlbnROYW1lXS5tVHlwZXMuZW5kKCkpIHsKLSAgICAgICAgQUxPR1coImlnbm9yaW5nIG51bGwgdHlwZSIpOwotICAgICAgICByZXR1cm4gT0s7Ci0gICAgfQotICAgIGlmICh2YWx1ZSAhPSBO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AgICAgICAgfQotICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSVJhZGlvOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOwotICAgICAgICBkYXRhLndyaXRlKGNvbmZpZywgc2l6ZW9mKHN0cnVjdCByYWRpb19iYW5kX2NvbmZpZykpOwotICAgICAgICBzdGF0dXNfdCBzdGF0dXMgPSByZW1vdGUoKS0+dHJhbnNhY3QoU0VUX0NPTkZJR1VSQVRJT04sIGRhdGEsICZyZXBseSk7Ci0gICAgICAgIGlmIChzdGF0dXMgPT0gTk9fRVJST1IpIHsKLSAgICAgICAgICAgIHN0YXR1cyA9IChzdGF0dXNfdClyZXBseS5yZWFkSW50MzIoKTsKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gc3RhdHVzOwotICAgIH0KLQotICAgIHZpcnR1YWwgc3RhdHVzX3QgZ2V0Q29uZmlndXJhdGlvbihzdHJ1Y3QgcmFkaW9fYmFuZF9jb25maWcgKmNvbmZpZykKLSAgICB7Ci0gICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKLSAgICAgICAgaWYgKGNvbmZpZyA9PSBOVUxMKSB7Ci0gICAgICAgICAgICByZXR1cm4gQkFEX1ZBTFVFOwotICAgICAgICB9Ci0gICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJUmFkaW86OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7Ci0gICAgICAgIHN0YXR1c190IHN0YXR1cyA9IHJlbW90ZSgpLT50cmFuc2FjdChHRVRfQ09ORklHVVJBVElPTiwgZGF0YSwgJnJlcGx5KTsKLSAgICAgICAgaWYgKHN0YXR1cyA9PSBOT19FUlJPUikgewotICAgICAgICAgICAgc3RhdHVzID0gKHN0YXR1c190KXJlcGx5LnJlYWRJbnQzMigpOwotICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBOT19FUlJPUikgewotICAgICAgICAgICAgICAgIHJlcGx5LnJlYWQoY29uZmlnLCBza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jdCByYWRpb19wcm9ncmFtX2luZm8pKTsKLSAgICAgICAgICAgICAgICAvLyByZXN0b3JlIGxvY2FsIG1ldGFkYXRhIHBvaW50ZXIKLSAgICAgICAgICAgICAgICBpbmZvLT5tZXRhZGF0YSA9IG1ldGFkYXRhOwotCi0gICAgICAgICAgICAgICAgdWludDMyX3QgbWV0YWRhdGFTaXplID0gcmVwbHkucmVhZFVpbnQzMigpOwotICAgICAgICAgICAgICAgIGlmIChtZXRhZGF0YVNpemUgIT0gMCkgewotICAgICAgICAgICAgICAgICAgICByYWRpb19tZXRhZGF0YV90ICpuZXdNZXRhZGF0YSA9IChyYWRpb19tZXRhZGF0YV90ICopbWFsbG9jKG1ldGFkYXRhU2l6ZSk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChuZXdNZXRhZGF0YSA9PSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gTk9fTUVNT1JZOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIHJlcGx5LnJlYWQobmV3TWV0YWRhdGEsIG1ldGFkYXRhU2l6ZSk7Ci0gICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IHJhZGlvX21ldGFkYXRhX2FkZF9tZXRhZGF0YSgmaW5mby0+bWV0YWRhdGEsIG5ld01ldGFkYXRhKTsKLSAgICAgICAgICAgICAgICAgICAgZnJlZShuZXdNZXRhZGF0YSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBzdGF0dXM7Ci0gICAgfQotCi0gICAgdmlydHVhbCBzdGF0dXNfdCBoYXNDb250cm9sKGJvb2wgKmhhc0NvbnRyb2wpCi0gICAgewotICAgICAgICBQYXJjZWwgZGF0YSwgcmVwbHk7Ci0gICAgICAgIGlmIChoYXNDb250cm9sID09IE5VTEwpIHsKLSAgICAgICAgICAgIHJldHVybiBCQURfVkFMVUU7Ci0gICAgICAgIH0KLS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XNlIFNFVF9DT05GSUdVUkFUSU9OOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSVJhZGlvLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBzdHJ1Y3QgcmFkaW9fYmFuZF9jb25maWcgY29uZmlnOwotICAgICAgICAgICAgZGF0YS5yZWFkKCZjb25maWcsIHNpemVvZihzdHJ1Y3QgcmFkaW9fYmFuZF9jb25maWcpKTsKLSAgICAgICAgICAgIHN0YXR1c190IHN0YXR1cyA9IHNldENvbmZpZ3VyYXRpb24oJmNvbmZpZyk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzdGF0dXMpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9Ci0gICAgICAgIGNhc2UgR0VUX0NPTkZJR1VSQVRJT046IHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJUmFkaW8sIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIHN0cnVjdCByYWRpb19iYW5kX2NvbmZpZyBjb25maWc7Ci0gICAgICAgICAgICBzdGF0dXNfdCBzdGF0dXMgPSBnZXRDb25maWd1cmF0aW9uKCZjb25maWcpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc3RhdHVzKTsKLSAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gTk9fRVJST1IpIHsKLSAgICAgICAgICAgICAgICByZXBseS0+d3JpdGUoJmNvbmZpZywgc2l6ZW9mKHN0cnVjdCByYWRpb19iYW5kX2NvbmZpZykpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9Ci0gICAgICAgIGNhc2UgU0VUX01VVEU6IHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJUmFkaW8sIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIGJvb2wgbXV0ZSA9IGRhdGEucmVhZEludDMyKCkgIT0gMDsKLSAgICAgICAgICAgIHN0YXR1c190IHN0YXR1cyA9IHNldE11dGUobXV0ZSk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzdGF0dXMpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9Ci0gICAgICAgIGNhc2UgR0VUX01VVEU6IHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJUmFkaW8sIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIGJvb2wgbXV0ZTsKLSAgICAgICAgICAgIHN0YXR1c190IHN0YXR1cyA9IGdldE11dGUoJm11dGUpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc3RhdHVzKTsKLSAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gTk9fRVJST1IpIHsKLSAgICAgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihtdXRlID8gMSA6IDApOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9Ci0gICAgICAgIGNhc2UgU0NBTjogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElSYWRpbywgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgcmFkaW9fZGlyZWN0aW9uX3QgZGlyZWN0aW9uID0gKHJhZGlvX2RpcmVjdGlvbl90KWRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBib29sIHNraXBTdWJDaGFubmVsID0gZGF0YS5yZWFkSW50MzIoKSA9PSAxOwotICAgICAgICAgICAgc3RhdHVzX3Qgc3RhdHVzID0gc2NhbihkaXJlY3Rpb24sIHNraXBTdWJDaGFubmVsKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHN0YXR1cyk7Ci0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0KLSAgICAgICAgY2FzZSBTVEVQOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0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fUFJPR1JBTV9JTkZPUk1BVElPTjogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElSYWRpbywgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgc3RydWN0IHJhZGlvX3Byb2dyYW1faW5mbyBpbmZvOwotICAgICAgICAgICAgUmFkaW9NZXRhZGF0YVdyYXBwZXIgbWV0YWRhdGFXcmFwcGVyKCZpbmZvLm1ldGFkYXRhKTsKLQotICAgICAgICAgICAgc3RhdHVzX3Qgc3RhdHVzID0gZ2V0UHJvZ3JhbUluZm9ybWF0aW9uKCZpbmZvKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHN0YXR1cyk7Ci0gICAgICAgICAgICBpZiAoc3RhdHVzID09IE5PX0VSUk9SKSB7Ci0gICAgICAgICAgICAgICAgcmVwbHktPndyaXRlKCZpbmZvLCBzaXplb2Yoc3RydWN0IHJhZGlvX3Byb2dyYW1faW5mbykpOwotICAgICAgICAgICAgICAgIGlmIChyYWRpb19tZXRhZGF0YV9nZXRfY291bnQoaW5mby5tZXRhZGF0YSkgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIHNpemVfdCBzaXplID0gcmFkaW9fbWV0YWRhdGFfZ2V0X3NpemUoaW5mby5tZXRhZGF0YSk7Ci0gICAgICAgICAgICAgICAgICAgIHJlcGx5LT53cml0ZVVpbnQzMigodWludDMyX3Qpc2l6ZSk7Ci0gICAgICAgICAgICAgICAgICAgIHJlcGx5LT53cml0ZShpbmZvLm1ldGFkYXRhLCBzaXplKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICByZXBseS0+d3JpdGVVaW50MzIoMCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9Ci0gICAgICAgIGNhc2UgSEFTX0NPTlRST0w6IHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDR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RhdGEud3JpdGVJbnQzMihudW1Nb2R1bGVzUmVxKTsKLSAgICAgICAgc3RhdHVzX3Qgc3RhdHVzID0gcmVtb3RlKCktPnRyYW5zYWN0KExJU1RfTU9EVUxFUywgZGF0YSwgJnJlcGx5KTsKLSAgICAgICAgaWYgKHN0YXR1cyA9PSBOT19FUlJPUikgewotICAgICAgICAgICAgc3RhdHVzID0gKHN0YXR1c190KXJlcGx5LnJlYWRJbnQzMigpOwotICAgICAgICAgICAgKm51bU1vZHVsZXMgPSAodWludDMyX3QpcmVwbHkucmVhZEludDMyKCk7Ci0gICAgICAgIH0KLSAgICAgICAgQUxPR1YoImxpc3RNb2R1bGVzKCkgc3RhdHVzICVkIGdvdCAqbnVtTW9kdWxlcyAlZCIsIHN0YXR1cywgKm51bU1vZHVsZXMpOwotICAgICAgICBpZiAoc3RhdHVzID09IE5PX0VSUk9SKSB7Ci0gICAgICAgICAgICBpZiAobnVtTW9kdWxlc1JlcSA+ICpudW1Nb2R1bGVzKSB7Ci0gICAgICAgICAgICAgICAgbnVtTW9kdWxlc1JlcSA9ICpudW1Nb2R1bGVzOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKG51bU1vZHVsZXNSZXEgPiAwKSB7Ci0gICAgICAgICAgICAgICAgcmVwbHkucmVhZChwcm9wZXJ0aWVzLCBudW1Nb2R1bGVzUmVxICogc2l6ZW9mKHN0cnVjdCByYWRpb19wcm9wZXJ0aWVzKSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIHN0YXR1czsKLSAgICB9Ci0KLSAgICB2aXJ0dWFsIHN0YXR1c190IGF0dGFjaChyYWRpb19oYW5kbGVfdCBoYW5kbGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3A8SVJhZGlvQ2xpZW50PiYgY2xpZW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHN0cnVjdCByYWRpb19iYW5kX2NvbmZpZyAqY29uZmlnLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgd2l0aEF1ZGlvLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNwPElSYWRpbz4mIHJhZGlvKQotICAgIHsKLSAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OwotICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSVJhZGlvU2VydmljZTo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKLSAgICAgICAgZGF0YS53cml0ZUludDMyKGhhbmRsZSk7Ci0gICAgICAgIGRhdGEud3JpdGVTdHJvbmdCaW5kZXIoSUludGVyZmFjZTo6YXNCaW5kZXIoY2xpZW50KSk7Ci0gICAgICAgIEFMT0dWKCJhdHRhY2goKSBjb25maWcgJXAgd2l0aEF1ZGlvICVkIHJlZ2lvbiAlZCB0eXBlICVkIiwKLSAgICAgICAgICAgICAgY29uZmlnID09IE5VTEwgPyAwIDogY29uZmlnLCB3aXRoQXVkaW8sCi0gICAgICAgICAgICAgIGNvbmZpZyA9PSBOVUxMID8gMCA6IGNvbmZpZy0+cmVnaW9uLAotICAgICAgICAgICAgICBjb25maWcgPT0gTlVMTCA/IDAgOiBjb25maWctPmJhbmQudHlwZSk7Ci0gICAgICAgIGlmIChjb25maWcgPT0gTlVMTCkgewotICAgICAgICAgICAgZGF0YS53cml0ZUludDMyKDApOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgZGF0YS53cml0ZUludDMyKDEpOwotICAgICAgICAgICAgZGF0YS53cml0ZShjb25maWcsIHNpemVvZihzdHJ1Y3QgcmFkaW9fYmFuZF9jb25maWcpKTsKLSAgICAgICAgfQotICAgICAgICBkYXRhLndyaXRlSW50MzIod2l0aEF1ZGlvID8gMSA6IDApOwotICAgICAgICBzdGF0dXNfdCBzdGF0dXMgPSByZW1vdGUoKS0+dHJhbnNhY3QoQVRUQUNILCBkYXRhLCAmcmVwbHkpOwotICAgICAgICBpZiAoc3Rhd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TW9kdWxlcyA9IG51bU1vZHVsZXNSZXE7Ci0gICAgICAgICAgICBzdHJ1Y3QgcmFkaW9fcHJvcGVydGllcyAqcHJvcGVydGllcyA9Ci0gICAgICAgICAgICAgICAgICAgIChzdHJ1Y3QgcmFkaW9fcHJvcGVydGllcyAqKWNhbGxvYyhudW1Nb2R1bGVzUmVxLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHN0cnVjdCByYWRpb19wcm9wZXJ0aWVzKSk7Ci0gICAgICAgICAgICBpZiAocHJvcGVydGllcyA9PSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoTk9fTUVNT1JZKTsKLSAgICAgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMigwKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHN0YXR1c190IHN0YXR1cyA9IGxpc3RNb2R1bGVzKHByb3BlcnRpZXMsICZudW1Nb2R1bGVzKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHN0YXR1cyk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihudW1Nb2R1bGVzKTsKLSAgICAgICAgICAgIEFMT0dWKCJMSVNUX01PRFVMRVMgc3RhdHVzICVkIGdvdCBudW1Nb2R1bGVzICVkIiwgc3RhdHVzLCBudW1Nb2R1bGVzKTsKLQotICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBOT19FUlJPUikgewotICAgICAgICAgICAgICAgIGlmIChudW1Nb2R1bGVzUmVxID4gbnVtTW9kdWxlcykgewotICAgICAgICAgICAgICAgICAgICBudW1Nb2R1bGVzUmVxID0gbnVtTW9kdWxlczsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgcmVwbHktPndyaXRlKHByb3BlcnRpZXMsCi0gICAgICAgICAgICAgICA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GFPZmZzZXQgLSBzaXplb2YodWludDMyX3QpKTsKLQotICAgIC8vIHJlc3RvcmUgbG9jYWwgbWV0YWRhdGEgcG9pbnRlciBmcm9tIG9mZnNldAotICAgIHN3aXRjaCAoZXZlbnQtPnR5cGUpIHsKLSAgICBjYXNlIFJBRElPX0VWRU5UX1RVTkVEOgotICAgIGNhc2UgUkFESU9fRVZFTlRfQUZfU1dJVENIOgotICAgICAgICBpZiAobWV0YWRhdGFTaXplICE9IDApIHsKLSAgICAgICAgICAgIGV2ZW50LT5pbmZvLm1ldGFkYXRhID0KLSAgICAgICAgICAgICAgICAgICAgKHJhZGlvX21ldGFkYXRhX3QgKikoKHVpbnQ4X3QgKilldmVudCArIG1ldGFkYXRhT2Zmc2V0KTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGV2ZW50LT5pbmZvLm1ldGFkYXRhID0gMDsKLSAgICAgICAgfQotICAgICAgICBicmVhazsKLSAgICBjYXNlIFJBRElPX0VWRU5UX01FVEFEQVRBOgotICAgICAgICBpZiAobWV0YWRhdGFTaXplICE9IDApIHsKLSAgICAgICAgICAgIGV2ZW50LT5tZXRhZGF0YSA9Ci0gICAgICAgICAgICAgICAgICAgIChyYWRpb19tZXRhZGF0YV90ICopKCh1aW50OF90ICopZXZlbnQgKyBtZXRhZGF0YU9mZnNldCk7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBldmVudC0+bWV0YWRhdGEgPSAwOwotICAgICAgICB9Ci0gICAgICAgIGJyZWFrOwotICAgIGRlZmF1bHQ6Ci0gICAgICAgIGJyZWFrOwotICAgIH0KLQotICAgIGlmIChtQ2FsbGJhY2sgIT0gMCkgewotICAgICAgICBtQ2FsbGJhY2stPm9uRXZlbnQoZXZlbnQpOwotICAgIH0KLX0KLQotCi0vL0lCaW5kZXI6OkRlYXRoUmVjaXBpZW50Ci12b2lkIFJhZGlvOjpiaW5kZXJEaWVkKGNvbnN0IHdwPElCaW5kZXI+JiB3aG8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LjM2NmExNjQgMTAwNjQ0Ci0tLSBhL3NlcnZpY2VzL2F1ZGlvZmxpbmdlci9NbWFwVHJhY2tzLmgKKysrIGIvc2VydmljZXMvYXVkaW9mbGluZ2VyL01tYXBUcmFja3MuaApAQCAtMjgsNiArMjgsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX2NoYW5uZWxfbWFza190IGNoYW5uZWxNYXNrLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX3Nlc3Npb25fdCBzZXNzaW9uSWQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWlkX3QgdWlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpZF90IHBpZCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19wb3J0X2hhbmRsZV90IHBvcnRJZCA9IEFVRElPX1BPUlRfSEFORExFX05PTkUpOwogICAgIHZpcnR1YWwgICAgICAgICAgICAgfk1tYXBUcmFjaygpOwogCkBAIC0zOSw3ICs0MCw3IEBACiAgICAgdmlydHVhbCBib29sICAgICAgICBpc0Zhc3RUcmFjaygpIGNvbnN0IHsgcmV0dXJuIGZhbHNlOyB9CiAKICAgICAgc3RhdGljIHZvaWQgICAgICAgIGFwcGVuZER1bXBIZWFkZXIoU3RyaW5nOCYgcmVzdWx0KTsKLSAgICAgICAgICAgIHZvaWQgICAgICAgIGR1bXAoY2hhciogYnVmZmVyLCBzaXplX3Qgc2l6ZSk7CisgICAgICAgICAgICB2b2lkICAgICAgICBhcHBlbmREdW1wKFN0cmluZzgmIHJlc3VsdCwgYm9vbCBhY3RpdmUpOwogCiBwcml2YXRlOgogICAgIGZyaWVuZCBjbGFzcyBNbWFwVGhyZWFkOwpAQCAtNTUsNSArNTYsNiBAQAogICAgIHZpcnR1YWwgaW50NjRfdCBmcmFtZXNSZWxlYXNlZCgpIGNvbnN0OwogICAgIHZpcnR1YWwgdm9pZCBvblRpbWVzdGFtcChjb25zdCBFeHRlbm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ICAgICBpZiAocGF0Y2gtPm1QYXRjaFJlY29yZCA9PSAwKSB7CiAgICAgICAgIHJldHVybiBOT19NRU1PUlk7CkBAIC00OTQsNiArNDk1LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JtYXQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJhbWVDb3VudCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXRjaC0+bVBhdGNoUmVjb3JkLT5idWZmZXIoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXRjaC0+bVBhdGNoUmVjb3JkLT5idWZmZXJTaXplKCksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQVVESU9fT1VUUFVUX0ZMQUdfTk9ORSk7CiAgICAgaWYgKHBhdGNoLT5tUGF0Y2hUcmFjayA9PSAwKSB7CiAgICAgICAgIHJldHVybiBOT19NRU1PUlk7CmRpZmYgLS1naXQgYS9zZXJ2aWNlcy9hdWRpb2ZsaW5nZXIvUGxheWJhY2tUcmFja3MuaCBiL3NlcnZpY2VzL2F1ZGlvZmxpbmdlci9QbGF5YmFja1RyYWNrcy5oCmluZGV4IDNmMWEwYzAuLjFjMWE5ODkgMTAwNjQ0Ci0tLSBhL3NlcnZpY2VzL2F1ZGlvZmxpbmdlci9QbGF5YmFja1RyYWNrcy5oCisrKyBiL3NlcnZpY2VzL2F1ZGlvZmxpbmdlci9QbGF5YmFja1RyYWNrcy5oCkBAIC0zMCw2ICszMCw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX2NoYW5uZWxfbWFza190IGNoYW5uZWxNYXNrLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplX3QgZnJhbWVDb3VudCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqYnVmZmVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplX3QgYnVmZmVyU2l6ZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3A8SU1lbW9yeT4mIHNoYXJlZEJ1ZmZlciwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fc2Vzc2lvbl90IHNlc3Npb25JZCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWlkX3QgdWlkLApAQCAtNDAsNyArNDEsNyBAQAogICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgaW5pdENoZWNrKCkgY29uc3Q7CiAKICAgICBzdGF0aWMgIHZvaWQgICAgICAgIGFwcGVuZER1bXBIZWFkZXIoU3RyaW5nOCYgcmVzdWx0KTsKLSAgICAgICAgICAgIHZvaWQgICAgICAgIGR1bXAoY2hhciogYnVmZmVyLCBzaXplX3Qgc2l6ZSwgYm9vbCBhY3RpdmUpOworICAgICAgICAgICAgdm9pZCAgICAgICAgYXBwZW5kRHVtcChTdHJpbmc4JiByZXN1bHQsIGJvb2wgYWN0aXZlKTsKICAgICB2aXJ0dWFsIHN0YXR1c190ICAgIHN0YXJ0KEF1ZGlvU3lzdGVtOjpzeW5jX2V2ZW50X3QgZXZlbnQgPQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW06OlNZTkNfRVZFTlRfTk9ORSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fc2Vzc2lvbl90IHRyaWdnZXJTZXNzaW9uID0gQVVESU9fU0VTU0lPTl9OT05FKTsKQEAgLTI0MCw2ICsyNDEsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19mb3JtYXRfdCBmb3JtYXQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVfdCBmcmFtZUNvdW50LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICpidWZmZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVfdCBidWZmZXJTaXplLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19vdXRwdXRfZmxhZ3NfdCBmbGFncyk7CiAgICAgdmlydHVhbCAgICAgICAgICAgICB+UGF0Y2hUcmFjaygpOwogCmRpZmYgLS1naXQgYS9zZXJ2aWNlcy9hdWRpb2ZsaW5nZXIvUmVjb3JkVHJhY2tzLmggYi9zZXJ2aWNlcy9hdWRpb2ZsaW5nZXIvUmVjb3JkVHJhY2tzLmgKaW5kZXggM2Y4M2NhOC4uZjhkYTc4MCAxMDA2NDQKLS0tIGEvc2VydmljZXMvYXVkaW9mbGluZ2VyL1JlY29yZFRyYWNrcy5oCisrKyBiL3NlcnZpY2VzL2F1ZGlvZmxpbmdlci9SZWNvcmRUcmFja3MuaApAQCAtMjksNiArMjksNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19jaGFubmVsX21hc2tfdCBjaGFubmVsTWFzaywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZV90IGZyYW1lQ291bnQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKmJ1ZmZlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZV90IGJ1ZmZlclNpemUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX3Nlc3Npb25fdCBzZXNzaW9uSWQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpZF90IHVpZCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9faW5wdXRfZmxhZ3NfdCBmbGFncywKQEAgLTUwLDcgKzUxLDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0bXA7IH0KIAogICAgIHN0YXRpY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UgdHJhY2sgbGlzdFxuIik7Ci0gICAgICAgIHJlc3VsdC5hcHBlbmQoYnVmZmVyKTsKKyAgICAgICAgcmVzdWx0LmFwcGVuZChwcmVmaXgpOwogICAgICAgICBUcmFjazo6YXBwZW5kRHVtcEhlYWRlcihyZXN1bHQpOwogICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IG51bWFjdGl2ZTsgKytpKSB7CiAgICAgICAgICAgICBzcDxUcmFjaz4gdHJhY2sgPSBtQWN0aXZlVHJhY2tzW2ldOwogICAgICAgICAgICAgaWYgKG1UcmFja3MuaW5kZXhPZih0cmFjaykgPCAwKSB7Ci0gICAgICAgICAgICAgICAgdHJhY2stPmR1bXAoYnVmZmVyLCBTSVpFLCB0cnVlKTsKLSAgICAgICAgICAgICAgICByZXN1bHQuYXBwZW5kKGJ1ZmZlcik7CisgICAgICAgICAgICAgICAgcmVzdWx0LmFwcGVuZChwcmVmaXgpOworICAgICAgICAgICAgICAgIHRyYWNrLT5hcHBlbmREdW1wKHJlc3VsdCwgdHJ1ZSAvKiBhY3RpdmUgKi8pOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQpAQCAtMjAxMyw3ICsyMDI4LDggQEAKICAgICAgICAgfQogCiAgICAgICAgIHRyYWNrID0gbmV3IFRyYWNrKHRoaXMsIGNsaWVudCwgc3RyZWFtVHlwZSwgc2FtcGxlUmF0ZSwgZm9ybWF0LAotICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsTWFzaywgZnJhbWVDb3VudCwgTlVMTCwgc2hhcmVkQnVmZmVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsTWFzaywgZnJhbWVDb3VudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgbnVsbHB0ciAvKiBidWZmZXIgKi8sIChzaXplX3QpMCAvKiBidWZmZXJTaXplICovLCBzaGFyZWRCdWZmZXIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlc3Npb25JZCwgdWl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IHRyYWNrLmdldCgpLCByZXN1bHQuc3RyaW5nKCkpOwogCiAgICAgbVRyYWNrcy5yZW1vdmUodHJhY2spOwogICAgIGRlbGV0ZVRyYWNrTmFtZV9sKHRyYWNrLT5uYW1lKCkpOwpAQCAtMjI0Miw2ICsyMjU0LDcgQEAKIAogICAgIHN3aXRjaCAoZXZlbnQpIHsKICAgICBjYXNlIEFVRElPX09VVFBVVF9PUEVORUQ6CisgICAgY2FzZSBBVURJT19PVVRQVVRfUkVHSVNURVJFRDoKICAgICBjYXNlIEFVRElPX09VVFBVVF9DT05GSUdfQ0hBTkdFRDoKICAgICAgICAgZGVzYy0+bVBhdGNoID0gbVBhdGNoOwogICAgICAgICBkZXNjLT5tQ2hhbm5lbE1hc2sgPSBtQ2hhbm5lbE1hc2s7CkBAIC0zNDA0LDEwICszNDE3LDYgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGlmICh0cmFjay0+aXNUZXJtaW5hdGVkKCkpIHsKICAgICAgICAgICAgICAgICByZW1vdmVUcmFja19sKHRyYWNrKTsKLSAgICAgICAgICAgIH0gZWxzZSB7IC8vIGluYWN0aXZlIGJ1dCBub3QgdGVybWluYXRlZAotICAgICAgICAgICAgICAgIGNoYXIgYnVmZmVyWzI1Nl07Ci0gICAgICAgICAgICAgICAgdHJhY2stPmR1bXAoYnVmZmVyLCBhcnJheXNpemUoYnVmZmVyKSwgZmFsc2UgLyogYWN0aXZlICovKTsKLSAgICAgICAgICAgICAgICBtTG9jYWxMb2cubG9nKCJyZW1vdmVUcmFja3NfbCglcCkgJXMiLCB0cmFjay5nZXQoKSwgYnVmZmVyICsgNCk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9CkBAIC00Mjg3LDYgKzQyOTYsNyBAQAogICAgICAgICAgICAgICAgICAgICBwYXJhbSA9IEF1ZGlvTWl4ZXI6OlJBTVBfVk9MVU1FOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBtQXVkaW9NaXh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TQzMDQsMTAgKzQzMTgsNiBAQAogICAgICAgICAgICAgICAgICAgICB0cmFjay0+c2V0UGF1c2VkKCk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfSBlbHNlIHsKLQotICAgICAgICAgICAgICAgIC8vIHJlYWQgb3JpZ2luYWwgdm9sdW1lcyB3aXRoIHZvbHVtZSBjb250cm9sCi0gICAgICAgICAgICAgICAgZmxvYXQgdHlwZVZvbHVtZSA9IG1TdHJlYW1UeXBlc1t0cmFjay0+c3RyZWFtVHlwZSgpXS52b2x1bWU7Ci0gICAgICAgICAgICAgICAgZmxvYXQgdiA9IG1hc3RlclZvbHVtZSAqIHR5cGVWb2x1bWU7CiAgICAgICAgICAgICAgICAgc3A8QXVkaW9UcmFja1NlcnZlclByb3h5PiBwcm94eSA9IHRyYWNrLT5tQXVkaW9UcmFja1NlcnZlclByb3h5OwogICAgICAgICAgICAgICAgIGdhaW5fbWluaWZsb2F0X3BhY2tlZF90IHZsciA9IHByb3h5LT5nZXRWb2x1bWVMUigpOwogICAgICAgICAgICAgICAgIHZsZiA9IGZsb2F0X2Zyb21fZ2FpbihnYWluX21pbmlmbG9hdF91bnBhY2tfbGVmdCh2bHIpKTsKQEAgLTQzNTksNiArNDM2OSwyNSBAQAogICAgICAgICAgICAgICAgIHRyYWNrLT5tSGFzVm9sdW1lQ29udHJvbGxlciA9IGZhbHNlOwogICAgICAgICAgICAgfQogCisgICAgICAgICAgICAvLyBGb3IgZGVkaWNhdGVkIFZvSVAgb3V0cHV0cywgbGV0IHRoZSBIQUwgYXBwbHkgdGhlIHN0cmVhbSB2b2x1bWUuIFRyYWNrIHZvbHVtZSBpcworICAgICAgICAgICAgLy8gc3RpbGwgYXBwbGllZCBieSB0aGUgbWl4ZXIuCisgICAgICAgICAgICBpZiAoKG1PdXRwdXQtPmZsYWdzICYgQVVESU9fT1VUUFVUX0ZMQUdfVk9JUF9SWCkgIT0gMCkgeworICAgICAgICAgICAgICAgIHYgPSBtU3RyZWFtVHlwZXNbdHJhY2stPnN0cmVhbVR5cGUoKV0ubXV0ZSA/IDAuMGYgOiB2OworICAgICAgICAgICAgICAgIGlmICh2ICE9IG1MZWZ0Vm9sRmxvYXQpIHsKKyAgICAgICAgICAgICAgICAgICAgc3RhdHVzX3QgcmVzdWx0ID0gbU91dHB1dC0+c3RyZWFtLT5zZXRWb2x1bWUodiwgdik7CisgICAgICAgICAgICAgICAgICAgIEFMT0dFX0lGKHJlc3VsdCAhPSBPSywgIkVycm9yIHdoZW4gc2V0dGluZyBvdXRwdXQgc3RyZWFtIHZvbHVtZTogJWQiLCByZXN1bHQpOworICAgICAgICAgICAgICAgICAgICBpZiAocmVzdWx0ID09IE9LKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtTGVmdFZvbEZsb2F0ID0gdjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvLyBpZiBzdHJlYW0gdm9sdW1lIHdhcyBzdWNjZXNzZnVsbHkgc2VudCB0byB0aGUgSEFMLCBtTGVmdFZvbEZsb2F0ID09IHYgaGVyZSBhbmQgd2UKKyAgICAgICAgICAgICAgICAvLyByZW1vdmUgc3RyZWFtIHZvbHVtZSBjb250cmlidXRpb24gZnJvbSBzb2Z0d2FyZSB2b2x1bWUuCisgICAgICAgICAgICAgICAgaWYgKHYgIT0gMC4wZiAmJiBtTGVmdFZvbEZsb2F0ID09IHYpIHsKKyAgICAgICAgICAgICAgICAgICB2bGYgPSBtaW4oMS4wZiwgdmxmIC8gdik7CisgICAgICAgICAgICAgICAgICAgdnJmID0gbWluKDEuMGYsIHZyZiAvIHYpOworICAgICAgICAgICAgICAgICAgIHZhZiA9IG1pbigxLjBmLCB2YWYgLyB2KTsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KICAgICAgICAgICAgIC8vIFhYWDogdGhlc2UgdGhpbmdzIERPTidUIG5lZWQgdG8gYmUgZG9uZSBlYWNoIHRpbWUK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c3A8UmVjb3JkVHJhY2s+IHRyYWNrID0gbVRyYWNrc1tpXTsKQEAgLTY5NDYsOCArNjk4Nyw4IEBACiAgICAgICAgICAgICAgICAgaWYgKGFjdGl2ZSkgewogICAgICAgICAgICAgICAgICAgICBudW1hY3RpdmVzZWVuKys7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHRyYWNrLT5kdW1wKGJ1ZmZlciwgU0laRSwgYWN0aXZlKTsKLSAgICAgICAgICAgICAgICByZXN1bHQuYXBwZW5kKGJ1ZmZlcik7CisgICAgICAgICAgICAgICAgcmVzdWx0LmFwcGVuZChwcmVmaXgpOworICAgICAgICAgICAgICAgIHRyYWNrLT5hcHBlbmREdW1wKHJlc3VsdCwgYWN0aXZlKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0gZWxzZSB7CkBAIC02OTU1LDE1ICs2OTk2LDE1IEBACiAgICAgfQogCiAgICAgaWYgKG51bWFjdGl2ZXNlZW4gIT0gbnVtYWN0aXZlKSB7Ci0gICAgICAgIHNucHJpbnRmKGJ1ZmZlciwgU0laRSwgIiAgVGhlIGZvbGxvd2luZyB0cmFja3MgYXJlIGluIHRoZSBhY3RpdmUgbGlzdCBidXQiCisgICAgICAgIHJlc3VsdC5hcHBlbmQoIiAgVGhlIGZvbGxvd2luZyB0cmFja3MgYXJlIGluIHRoZSBhY3RpdmUgbGlzdCBidXQiCiAgICAgICAgICAgICAgICAgIiBub3QgaW4gdGhlIHRyYWNrIGxpc3RcbiIpOwotICAgICAgICByZXN1bHQuYXBwZW5kKGJ1ZmZlcik7CisgICAgICAgIHJlc3VsdC5hcHBlbmQocHJlZml4KTsKICAgICAgICAgUmVjb3JkVHJhY2s6OmFwcGVuZER1bXBIZWFkZXIocmVzdWx0KTsKICAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBudW1hY3RpdmU7ICsraSkgewogICAgICAgICAgICAgc3A8UmVjb3JkVHJhY2s+IHRyYWNrID0gbUFjd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ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX3Nlc3Npb25fdCBzZXNzaW9uSWQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzcDxNbWFwU3RyZWFtQ2FsbGJhY2s+JiBjYWxsYmFjaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX3BvcnRfaGFuZGxlX3QgZGV2aWNlSWQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19wb3J0X2hhbmRsZV90IHBvcnRJZCkKIHsKICAgICBtQXR0ciA9ICphdHRyOwogICAgIG1TZXNzaW9uSWQgPSBzZXNzaW9uSWQ7CiAgICAgbUNhbGxiYWNrID0gY2FsbGJhY2s7CisgICAgbURldmljZUlkID0gZGV2aWNlSWQ7CiAgICAgbVBvcnRJZCA9IHBvcnRJZDsKIH0KIApAQCAtNzYyOCw2ICs3NjU0LDEwIEBACiAgICAgICAgIHJldHVybiBOT19FUlJPUjsKICAgICB9CiAKKyAgICBpZiAoIWlzT3V0cHV0KCkgJiYgIXJlY29yZGluZ0FsbG93ZWQoY2xpZW50LnBhY2thZ2VOYW1lLCBjbGllbnQuY2xpZW50UGlkLCBjbGllbnQuY2xpZW50VWlkKSkgeworICAgICAgICByZXR1cm4gUEVSTUlTU0lPTl9ERU5JRUQ7CisgICAgfQorCiAgICAgYXVkaW9fcG9ydF9oYW5kbGVfdCBwb3J0SWQgPSBBVURJT19QT1JUX0hBTkRMRV9OT05FOwogCiAgICAgYXVkaW9faW9faGFuZGxlX3QgaW8gPSBtSWQ7CkBAIC03NjM5LDcgKzc2NjksNyBAQAogICAgICAgICBhdWRpb19zdHJlYW1fdHlwZV90IHN0cmVhbSA9IHN0cmVhbVR5cGUoKTsKICAgICAgICAgYXVkaW9fb3V0cHV0X2ZsYWdzX3QgZmxhZ3MgPQogICAgICAgICAgICAgICAgIChhdWRpb19vdXRwdXRfZmxhZ3NfdCkoQVVESU9fT1VUUFVUX0ZMQUdfTU1BUF9OT0lSUSB8IEFVRElPX09VVFBVVF9GTEFHX0RJUkVDVCk7Ci0gICAgICAgIGF1ZGlvX3BvcnRfaGFuZGxlX3QgZGV2aWNlSWQgPSBBVURJT19QT1JUX0hBTkRMRV9OT05FOworICAgICAgICBhdWRpb19wb3J0X2hhbmRsZV90IGRldmljZUlkID0gbURldmljZUlkOwogICAgICAgICByZXQgPSBBdWRpb1N5c3RlbTo6Z2V0T3V0cHV0Rm9yQXR0cigmbUF0dHIsICZpbywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVNlc3Npb25JZCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnN0cmVhbSwKQEAgLTc2NTMsNyArNzY4Myw3IEBACiAgICAgICAgIGNvbmZpZy5zYW1wbGVfcmF0ZSA9IG1TYW1wbGVSYXRlOwogICAgICAgICBjb25maWcuY2hhbm5lbF9tYXNrID0gbUNoYW5uZWxNYXNrOwogICAgICAgICBjb25maWcuZm9ybWF0ID0gbUZvcm1hdDsKLSAgICAgICAgYXVkaW9fcG9ydF9oYW5kbGVfdCBkZXZpY2VJZCA9IEFVRElPX1BPUlRfSEFORExFX05PTkU7CisgICAgICAgIGF1ZGlvX3BvcnRfaGFuZGxlX3QgZGV2aWNlSWQgPSBtRGV2aWNlSWQ7CiAgICAgICAgIHJldCA9IEF1ZGlvU3lzdGVtOjpnZXRJbnB1dEZvckF0dHIoJm1BdHRyLCAmaW8sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVNlc3Npb25JZCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGllbnQuY2xpZW50UGlkLApAQCAtNzY5Myw3ICs3NzIzLDcgQEAKICAgICB9CiAKICAgICBzcDxNbWFwVHJhY2s+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SBUcmFja3NcbiIsIG51bXRyYWNrcyk7CisgICAgY29uc3QgY2hhciAqcHJlZml4ID0gIiAgICAiOwogICAgIGlmIChudW10cmFja3MpIHsKKyAgICAgICAgcmVzdWx0LmFwcGVuZChwcmVmaXgpOwogICAgICAgICBNbWFwVHJhY2s6OmFwcGVuZER1bXBIZWFkZXIocmVzdWx0KTsKICAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBudW10cmFja3MgOyArK2kpIHsKICAgICAgICAgICAgIHNwPE1tYXBUcmFjaz4gdHJhY2sgPSBtQWN0aXZlVHJhY2tzW2ldOwotICAgICAgICAgICAgdHJhY2stPmR1bXAoYnVmZmVyLCBTSVpFKTsKLSAgICAgICAgICAgIHJlc3VsdC5hcHBlbmQoYnVmZmVyKTsKKyAgICAgICAgICAgIHJlc3VsdC5hcHBlbmQocHJlZml4KTsKKyAgICAgICAgICAgIHRyYWNrLT5hcHBlbmREdW1wKHJlc3VsdCwgdHJ1ZSAvKiBhY3RpdmUgKi8pOwogICAgICAgICB9CiAgICAgfSBlbHNlIHsKICAgICAgICAgZHByaW50ZihmZCwgIlxuIik7CkBAIC04MjQwLDkgKzgyNzMsMTAgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX3N0cmVhbV90eXBlX3Qgc3RyZWFtVHlwZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX3Nlc3Npb25fdCBzZXNzaW9uSWQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzcDxNbWFwU3RyZWFtQ2FsbGJhY2s+JiBjYWxsYmFjaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX3BvcnRfaGFuZGxlX3QgZGV2aWNlSWQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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ICB7IH0KIAogICAgICAgICAgICAgICAgICAgICB+QWN0aXZlVHJhY2tzKCkgewpAQCAtNTYyLDYgKzU2Myw4IEBACiAgICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICAgICAgICB1cGRhdGVQb3dlclN0YXRlKHNwPFRocmVhZEJhc2U+IHRocmVhZCwgYm9vbCBmb3JjZSA9IGZhbHNlKTsKIAogICAgICAgICAgICAgICAgIHByaXZhdGU6CisgICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICAgICAgICBsb2dUcmFjayhjb25zdCBjaGFyICpmdW5jTmFtZSwgY29uc3Qgc3A8VD4gJnRyYWNrKSBjb25zdDsKKwogICAgICAgICAgICAgICAgICAgICBTb3J0ZWRWZWN0b3I8dWlkX3Q+IGdldFdha2VMb2NrVWlkcygpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIFNvcnRlZFZlY3Rvcjx1aWRfdD4gd2FrZUxvY2tVaWRzOwogICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChjb25zdCBzcDxUPiAmdHJhY2sgOiBtQWN0aXZlVHJhY2tzKSB7CkBAIC01NzYsNiArNTc5LDcgQEAKICAgICAgICAgICAgICAgICAgICAgaW50ICAgICAgICAgICAgICAgICBtQWN0aXZlVHJhY2tzR2VuZXJhdGlvbjsKICAgICAgICAgICAgICAgICAgICAgaW50ICAgICAgICAgICAgICAgICBtTGFzdEFjdGl2ZVRyYWNrc0dlbmVyYXRpb247CiAgICAgICAgICAgICAgICAgICAgIHdwPFQ+ICAgICAgICAgICAgICAgbUxhdGVzdEFjdGl2ZVRyYWNrOyAvLyBsYXRlc3QgdHJhY2sgYWRkZWQgdG8gQWN0aXZlVHJhY2tzCisgICAgICAgICAgICAgICAgICAgIFNpbXBsZUxvZyAqIGNvbnN0ICAgbUxvY2FsTG9nOwogICAgICAgICAgICAgICAgIH07CiAKICAgICAgICAgICAgICAgICBTaW1wbGVMb2cgbUxvY2FsTG9nOwpAQCAtOTk1LDYgKzk5OSw5IEBACiAgICAgICAgICAgICAgICAgYm9vbCAgICAgICAgbUh3U3VwcG9ydHNQYXVzZTsKICAgICAgICAgICAgICAgICBib29sICAgICAgICBtSHdQYXVzZWQ7CiAgICAgICAgICAgICAgICAgYm9vbCAgICAgICAgbUZsdXNoUGVuZGluZzsKKyAgICAgICAgICAgICAgICAvLyB2b2x1bWVzIGxhc3Qgc2VudCB0byBhdWRpbyBIQUwgd2l0aCBzdHJlYW0tPnNldFZvbHVtZSgpCisgICAgICAgICAgICAgICAgZmxvYXQgbUxlZnRWb2xGbG9hdDsKKyAgICAgICAgICAgICAgICBmbG9hdCBtUmlnaHRWb2xGbG9hdDsKIH07CiAKIGNsYXNzIE1peGVyVGhyZWFkIDogcHVibGljIFBsYXliYWNrVGhyZWFkIHsKQEAgLTExMTIsOSArMTExOSw2IEBACiAKICAgICB2aXJ0dWFsICAgICB2b2lkICAgICAgICBvbkFkZE5ld1RyYWNrX2woKTsKIAotICAgIC8vIHZvbHVtZXMgbGFzdCBzZW50IHRvIGF1ZGlvIEhBTCB3aXRoIHN0cmVhbS0+c2V0X3ZvbHVtZSgpCi0gICAgZmxvYXQgbUxlZnRWb2xGbG9hdDsKLSAgICBmbG9hdCBtUmlnaHRWb2xGbG9hdDsKICAgICBib29sIG1Wb2x1bWVTaGFwZXJBY3RpdmU7CiAKICAgICBEaXJlY3RPdXRwdXRUaHJlYWQoY29uc3Qgc3A8QXVkaW9GbGluZ2VyPiYgYXVkaW9GbGluZ2VyLCBBdWRpb1N0cmVhbU91dCogb3V0cHV0LApAQCAtMTQ3NSw2ICsxNDc5LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fc3RyZWFtX3R5cGVfdCBzdHJlYW1UeXBlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19zZXNzaW9uX3Qgc2Vzc2lvbklkLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzcDxNbWFwU3RyZWFtQ2FsbGJhY2s+JiBjYWxsYmFjaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fcG9ydF9oYW5kbGVfdCBkZXZpY2VJZCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fcG9ydF9oYW5kbGVfdCBwb3J0SWQpOwogCiAgICAgICAgICAgICAgICAgdm9pZCAgICAgICAgZGlzY29ubmVjdCgpOwpAQCAtMTUzNiw2ICsxNTQxLDcgQEAKIAogICAgICAgICAgICAgICAgIGF1ZGlvX2F0dHJpYnV0ZXNfdCAgICAgIG1BdHRyOwogICAgICAgICAgICAgICAgIGF1ZGlvX3Nlc3Npb25fdCAgICAgICAgIG1TZXNzaW9uSWQ7CisgICAgICAgICAgICAgICAgYXVkaW9fcG9ydF9oYW5kbGVfdCAgICAgbURldmljZUlkOwogICAgICAgICAgICAgICAgIGF1ZGlvX3BvcnRfaGFuZGxlX3QgICAgIG1Qb3J0SWQ7CiAKICAgICAgICAgICAgICAgICB3cDxNbWFwU3RyZWFtQ2FsbGJhY2s+ICBtQ2FsbGJhY2s7CkBAIC0xNTU4LDYgKzE1NjQsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19zdHJlYW1fdHlwZV90IHN0cmVhbVR5cGUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX3Nlc3Npb25fdCBzZXNzaW9uSWQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNwPE1tYXBTdHJlYW1DYWxsYmFjaz4mIGNhbGxiYWNrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19wb3J0X2hhbmRsZV90IGRldmljZUlkLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19wb3J0X2hhbmRsZV90IHBvcnRJZCk7CiAKICAgICAgICAgICAgICAgICBBdWRpb1N0cmVhbU91dCogY2xlYXJPdXRwdXQoKTsKZGlmZiAtLWdpdCBhL3NlcnZpY2VzL2F1ZGlvZmxpbmdlci9UcmFja0Jhc2UuaCBiL3NlcnZpY2VzL2F1ZGlvZmxpbmdlci9UcmFja0Jhc2UuaAppbmRleCBjYjU0MGNhLi5kNGNlMGI0IDEwMDY0NAotLS0gYS9zZXJ2aWNlcy9hdWRpb2ZsaW5nZXIvVHJhY2tCYXNlLmgKKysrIGIvc2VydmljZXMvYXVkaW9mbGluZ2VyL1RyYWNrQmFzZS5oCkBAIC02MSw2ICs2MSw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX2NoYW5uZWxfbWFza190IGNoYW5uZWxNYXNrLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplX3QgZnJhbWVDb3VudCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqYnVmZmVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplX3QgYnVmZmVyU2l6ZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fc2Vzc2lvbl90IHNlc3Npb25JZCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWlkX3QgdWlkLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGlzT3V0LApAQCAtODIsNiArODMsNyBAQAogCiAgICAgICAgICAgICBzcDxJTWVtb3J5PiBnZXRCdWZmZXJzKCkgY29uc3QgeyByZXR1cm4gbUJ1ZmZlck1lbW9yeTsgfQogICAgICAgICAgICAgdm9pZCogICAgICAgYnVmZmVyKCkgY29uc3QgeyByZXR1cm4gbUJ1ZmZlcjsgfQorICAgICAgICAgICAgc2l6ZV90ICAgICAgYnVmZmVyU2l6ZSgpIGNvbnN0IHsgcmV0dXJuIG1CdWZmZXJTaXplOyB9CiAgICAgdmlydHVhbCBib29sICAgICAgICBpc0Zhc3RUcmFjaygpIGNvbnN0ID0gMDsKICAgICAgICAgICAgIGJvb2wgICAgICAgIGlzT3V0cHV0VHJhY2soKSBjb25zdCB7IHJldHVybiAobVR5cGUgPT0gVFlQRV9PVVRQVVQpOyB9CiAgICAgICAgICAgICBib29sICAgICAgICBpc1BhdGNoVHJhY2soKSBjb25zdCB7IHJldHVybiAobVR5cGUgPT0gVFlQRV9QQVRDSCk7IH0KQEAgLTEzMyw2ICsxMzUsNDAgQEAKICAgICAgICAgbVRlcm1pbmF0ZWQgPSB0cnVlOwogICAgIH0KIAorICAgIC8vIFVwcGVyIGNhc2UgY2hhcmFjdGVycyBhcmUgZmluYWwgc3RhdGVzLgorICAgIC8vIExvd2VyIGNhc2UgY2hhcmFjdGVycyBhcmUgdHJhbnNpdG9yeS4KKyAgICBjb25zdCBjaGFyICpnZXRUcmFja1N0YXRlU3RyaW5nKCkgY29uc3QgeworICAgICAgICBpZiAoaXNUZXJtaW5hdGVkKCkpIHsKKyAgICAgICAgICAgIHJldHVybiAiVCAiOworICAgICAgICB9CisgICAgICAgIHN3aXRjaCAobVN0YXRlKSB7CisgICAgICAgIGNhc2UgSURMRToKKyAgICAgICAgICAgIHJldHVybiAiSSAiOworICAgICAgICBjYXNlIFNUT1BQSU5HXzE6IC8vIGZvciBGYXN0IGFuZCBPZmZsb2FkCisgICAgICAgICAgICByZXR1cm4gInMxIjsKKyAgICAgICAgY2FzZSBTVE9QUElOR18yOiAvLyBmb3IgRmFzdCBhbmQgT2ZmbG9hZAorICAgICAgICAgICAgcmV0dXJuICJzMiI7CisgICAgICAgIGNhc2UgU1RPUFBFRDoKKyAgICAgICAgICAgIHJldHVybiAiUyAiOworICAgICAgICBjYXNlIFJFU1VNSU5HOgorICAgICAgICAgICAgcmV0dXJuICJyICI7CisgICAgICAgIGNhc2UgQUNUSVZFOgorICAgICAgICAgICAgcmV0dXJuICJBICI7CisgICAgICAgIGNhc2UgUEFVU0lORzoKKyAgICAgICAgICAgIHJldHVybiAicCAiOworICAgICAgICBjYXNlIFBBVVNFRDoKKyAgICAgICAgICAgIHJldHVybiAiUCAiOworICAgICAgICBjYXNlIEZMVVNIRUQ6CisgICAgICAgICAgICByZXR1cm4gIkYgIjsKKyAgICAgICAgY2FzZSBTVEFSVElOR18xOiAvLyBmb3IgUmVjb3JkVHJhY2sKKyAgICAgICAgICAgIHJldHVybiAicjEiOworICAgICAgICBjYXNlIFNUQVJUSU5HXzI6IC8vIGZvciBSZWNvcmRUcmFjaworICAgICAgICAgICAgcmV0dXJuICJyMiI7CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICByZXR1cm4gIj8gIjsKKyAgICAgICAgfQorICAgIH0KKwogICAgIGJvb2wgaXNPdXQoKSBjb25zdCB7IHJldHVybiBtSXNPdXQ7IH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRydWUgZm9yIFRyYWNrLCBmYWxzZSBmb3IgUmVjb3JkVHJhY2ssCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIGNvdWxkIGJlIGEgdHJhY2sgdHlwZSBpZiBuZWVkZWQgbGF0ZXIKQEAgLTE0NCw2ICsxODAsNyBAQAogICAgIHNwPElNZW1vcnk+ICAgICAgICAgbUJ1ZmZlck1lbW9yeTsgIC8vIGN1cnJlbnRseSBub24tMCBmb3IgZmFzdCBSZWNvcmRUcmFjayBvbmx5CiAgICAgdm9pZCogICAgICAgICAgICAgICBtQnVmZmVyOyAgICAvLyBzdGFydCBvZiB0cmFjayBidWZmZXIsIHR5cGljYWxseSBpbiBzaGFyZWQgbWVtb3J5CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBleGNlcHQgZm9yIE91dHB1dFRyYWNrIHdoZW4gaXQgaXMgaW4gbG9jYWwgbWVtb3J5CisgICAgc2l6ZV90ICAgICAgICAgICAgICBtQnVmZmVyU2l6ZTsgLy8gc2l6ZSBvZiBtQnVmZm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bE1hc2ssCiAgICAgICAgICAgICBzaXplX3QgZnJhbWVDb3VudCwKICAgICAgICAgICAgIHZvaWQgKmJ1ZmZlciwKKyAgICAgICAgICAgIHNpemVfdCBidWZmZXJTaXplLAogICAgICAgICAgICAgYXVkaW9fc2Vzc2lvbl90IHNlc3Npb25JZCwKICAgICAgICAgICAgIHVpZF90IGNsaWVudFVpZCwKICAgICAgICAgICAgIGJvb2wgaXNPdXQsCkBAIC04MSw3ICs3OCw3IEBACiAgICAgICAgIG1UaHJlYWQodGhyZWFkKSwKICAgICAgICAgbUNsaWVudChjbGllbnQpLAogICAgICAgICBtQ2JsayhOVUxMKSwKLSAgICAgICAgLy8gbUJ1ZmZlcgorICAgICAgICAvLyBtQnVmZmVyLCBtQnVmZmVyU2l6ZQogICAgICAgICBtU3RhdGUoSURMRSksCiAgICAgICAgIG1TYW1wbGVSYXRlKHNhbXBsZVJhdGUpLAogICAgICAgICBtRm9ybWF0KGZvcm1hdCksCkBAIC0xMTMsMTUgKzExMCwyMiBAQAogCiAgICAgLy8gQUxPR0QoIkNyZWF0aW5nIHRyYWNrIHdpdGggJWQgYnVmZmVycyBAICVkIGJ5dGVzIiwgYnVmZmVyQ291bnQsIGJ1ZmZlclNpemUpOwogCi0gICAgc2l6ZV90IGJ1ZmZlclNpemUgPSBidWZmZXIgPT0gTlVMTCA/IHJvdW5kdXAoZnJhbWVDb3VudCkgOiBmcmFtZUNvdW50OworICAgIHNpemVfdCBtaW5CdWZmZXJTaXplID0gYnVmZmVyID09IE5VTEwgPyByb3VuZHVwKGZyYW1lQ291bnQpIDogZnJhbWVDb3VudDsKICAgICAvLyBjaGVjayBvdmVyZmxvdyB3aGVuIGNvbXB1dGluZyBidWZmZXJTaXplIGR1ZSB0byBtdWx0aXBsaWNhdGlvbiBieSBtRnJhbWVTaXplLgotICAgIGlmIChidWZmZXJTaXplIDwgZnJhbWVDb3VudCAgLy8gcm91bmR1cCByb3VuZHMgZG93biBmb3IgdmFsdWVzIGFib3Z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gICAgIC8vIFRoZXJlZm9yZSwgdG8gZGV0ZWN0IGluY29ycmVjdCB1c2FnZSBvZiB0aGUgYnVmZmVyLCB3ZSBzZXQgbUJ1ZmZlciB0byBOVUxMLgogICAgICAgICAgICAgbUJ1ZmZlciA9IE5VTEw7CisgICAgICAgICAgICBidWZmZXJTaXplID0gMDsKICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICBjYXNlIEFMTE9DX0NCTEs6CiAgICAgICAgICAgICAvLyBjbGVhciBhbGwgYnVmZmVycwpAQCAtMTk2LDcgKzIwMSwxMCBAQAogICAgICAgICBjYXNlIEFMTE9DX05PTkU6CiAgICAgICAgICAgICBtQnVmZmVyID0gYnVmZmVyOwogICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBMT0dfQUxXQVlTX0ZBVEFMKCJpbnZhbGlkIGFsbG9jYXRpb24gdHlwZTogJWQiLCAoaW50KWFsbG9jKTsKICAgICAgICAgfQorICAgICAgICBtQnVmZmVyU2l6ZSA9IGJ1ZmZlclNpemU7CiAKICNpZmRlZiBURUVfU0lOSwogICAgICAgICBpZiAobVRlZVNpbmtUcmFja0VuYWJsZWQpIHsKQEAgLTM2OCw2ICszNzYsNyBAQAogICAgICAgICAgICAgYXVkaW9fY2hhbm5lbF9tYXNrX3QgY2hhbm5lbE1hc2ssCiAgICAgICAgICAgICBzaXplX3QgZnJhbWVDb3VudCwKICAgICAgICAgICAgIHZvaWQgKmJ1ZmZlciwKKyAgICAgICAgICAgIHNpemVfdCBidWZmZXJTaXplLAogICAgICAgICAgICAgY29uc3Qgc3A8SU1lbW9yeT4mIHNoYXJlZEJ1ZmZlciwKICAgICAgICAgICAgIGF1ZGlvX3Nlc3Npb25fdCBzZXNzaW9uSWQsCiAgICAgICAgICAgICB1aWRfdCB1aWQsCkBAIC0zNzYsNiArMzg1LDcgQEAKICAgICAgICAgICAgIGF1ZGlvX3BvcnRfaGFuZGxlX3QgcG9ydElkKQogICA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taW5hdGVkKCkpIHsKLSAgICAgICAgc3RhdGVDaGFyID0gJ1QnOwotICAgIH0gZWxzZSB7Ci0gICAgICAgIHN3aXRjaCAoc3RhdGUpIHsKLSAgICAgICAgY2FzZSBJRExFOgotICAgICAgICAgICAgc3RhdGVDaGFyID0gJ0knOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgU1RPUFBJTkdfMToKLSAgICAgICAgICAgIHN0YXRlQ2hhciA9ICdzJzsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIFNUT1BQSU5HXzI6Ci0gICAgICAgICAgICBzdGF0ZUNoYXIgPSAnNSc7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBTVE9QUEVEOgotICAgICAgICAgICAgc3RhdGVDaGFyID0gJ1MnOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgUkVTVU1JTkc6Ci0gICAgICAgICAgICBzdGF0ZUNoYXIgPSAnUic7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBBQ1RJVkU6Ci0gICAgICAgICAgICBzdGF0ZUNoYXIgPSAnQSc7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBQQVVTSU5HOgotICAgICAgICAgICAgc3RhdGVDaGFyID0gJ3AnOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgUEFVU0VEOgotICAgICAgICAgICAgc3RhdGVDaGFyID0gJ1AnOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgRkxVU0hFRDoKLSAgICAgICAgICAgIHN0YXRlQ2hhciA9ICdGJzsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgc3RhdGVDaGFyID0gJz8nOwotICAgICAgICAgICAgYnJlYWs7CisgICAgY2hhciB0cmFja1R5cGU7CisgICAgc3dpdGNoIChtVHlwZSkgeworICAgIGNhc2UgV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1lSGFuZGxlci0+Z2V0TGFzdFZvbHVtZSgpOwotICAgIHNucHJpbnRmKCZidWZmZXJbOF0sIHNpemUgLSA4LCAiICU2cyAlNnUgJTR1ICUwOFggJTA4WCAlN3UgJTZ6dSAlMWMgJTFkICU1dSAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlNS4yZyAlNS4yZyAlNS4yZyVjICAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlMDhYICUwOHpYICUwOHpYIDB4JTAzWCAlOXUlYyAlN3VcbiIsCisgICAgY2hhciBmaWxsaW5nU3RhdHVzOworICAgIHN3aXRjaCAobUZpbGxpbmdVcFN0YXR1cykgeworICAgIGNhc2UgRlNfSU5WQUxJRDoKKyAgICAgICAgZmlsbGluZ1N0YXR1cyA9ICdJJzsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBGU19GSUxMSU5HOgorICAgICAgICBmaWxsaW5nU3RhdHVzID0gJ2YnOworICAgICAgICBicmVhazsKKyAgICBjYXNlIEZTX0ZJTExFRDoKKyAgICAgICAgZmlsbGluZ1N0YXR1cyA9ICdGJzsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBGU19BQ1RJVkU6CisgICAgICAgIGZpbGxpbmdTdGF0dXMgPSAnQSc7CisgICAgICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAgICAgIGZpbGxpbmdTdGF0dXMgPSAnPyc7CisgICAgICAgIGJyZWFrOworICAgIH0KKworICAgIC8vIGNsaXAgZnJhbWVzUmVhZHlTYWZlIHRvIG1heCByZXByZXNlbnRhdGlvbiBpbiBkdW1wCisgICAgY29uc3Qgc2l6ZV90IGZyYW1lc1JlYWR5U2FmZSA9CisgICAgICAgICAgICBzdGQ6Om1pbihtQXVkaW9UcmFja1NlcnZlclByb3h5LT5mcmFtZXNSZWFkeVNhZmUoKSwgKHNpemVfdCk5OTk5OTk5OSk7CisKKyAgICAvLyBvYnRhaW4gdm9sdW1lcworICA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MnUgJTUuMmcgJTUuMmcgJTUuMmclYyAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiJTA4WCAlNnp1JWMgJTZ6dSAlYyAlOXUlYyAlN3UgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiUwOHpYICUwOHpYXG4iLAogICAgICAgICAgICAgYWN0aXZlID8gInllcyIgOiAibm8iLAogICAgICAgICAgICAgKG1DbGllbnQgPT0gMCkgPyBnZXRwaWRfY2FjaGVkIDogbUNsaWVudC0+cGlkKCksCi0gICAgICAgICAgICBtU3RyZWFtVHlwZSwKKyAgICAgICAgICAgIG1TZXNzaW9uSWQsCisgICAgICAgICAgICBnZXRUcmFja1N0YXRlU3RyaW5nKCksCisgICAgICAgICAgICBtQ2Jsay0+bUZsYWdzLAorCiAgICAgICAgICAgICBtRm9ybWF0LAogICAgICAgICAgICAgbUNoYW5uZWxNYXNrLAotICAgICAgICAgICAgbVNlc3Npb25JZCwKLSAgICAgICAgICAgIG1GcmFtZUNvdW50LAotICAgICAgICAgICAgc3RhdGVDaGFyLAotICAgICAgICAgICAgbUZpbGxpbmdVcFN0YXR1cywKICAgICAgICAgICAgIG1BdWRpb1RyYWNrU2VydmVyUHJveHktPmdldFNhbXBsZVJhdGUoKSwKKworICAgICAgICAgICAgbVN0cmVhbVR5cGUsCiAgICAgICAgICAgICAyMC4wICogbG9nMTAoZmxvYXRfZnJvbV9nYWluKGdhaW5fbWluaWZsb2F0X3VucGFja19sZWZ0KHZscikpKSwKICAgICAgICAgICAgIDIwLjAgKiBsb2cxMChmbG9hdF9mcm9tX2dhaW4oZ2Fpbl9taW5pZmxvYXRfdW5wYWNrX3JpZ2h0KHZscikpKSwKICAgICAgICAgICAgIDIwLjAgKiBsb2cxMCh2c1ZvbHVtZS5maXJzdCksIC8vIFZvbHVtZVNoYXBlcihzKSB0b3RhbCB2b2x1bWUKICAgICAgICAgICAgIHZzVm9sdW1lLnNlY29uZCA/ICdBJyA6ICcgJywgIC8vIGlmIGFueSBWb2x1bWVTaGFwZXJzIGFjdGl2ZQorCiAgICAgICAgICAgICBtQ2Jsay0+bVNlcnZlciwKLSAgICAgICAgICAgIChzaXplX3QpbU1haW5CdWZmZXIsIC8vIHVzZSAlelggYXMgJXAgYXBwZW5kcyAweAotICAgICAgICAgICAgKHNpemVfdCltQXV4QnVmZmVyLCAgLy8gdXNlICV6WCBhcyAlcCBhcHBlbmRzIDB4Ci0gICAgICAgICAgICBtQ2Jsay0+bUZsYWdzLAorICAgICAgICAgICAgYnVmZmVyU2l6ZUluRnJhbWVzLAorICAgICAgICAgICAgbW9kaWZpZWRCdWZmZXJDaGFyLAorICAgICAgICAgICAgZnJhbWVzUmVhZHlTYWZlLAorICAgICAgICAgICAgZmlsbGluZ1N0YXR1cywKICAgICAgICAgICAgIG1BdWRpb1RyYWNrU2VydmVyUHJveHktPmdldFVuZGVycnVuRnJhbWVzKCksCiAgICAgICAgICAgICBub3dJblVuZGVycnVuLAotICAgICAgICAgICAgKHVuc2lnbmVkKW1BdWRpb1RyYWNrU2VydmVyUHJveHktPmZyYW1lc0ZsdXNoZWQoKSAlIDEwMDAwMDAwKTsgLy8gNyBkaWdpdHMKKyAgICAgICAgICAgICh1bnNpZ25lZCltQXVkaW9UcmFja1NlcnZlclByb3h5LT5mcmFtZXNGbHVzaGVkKCkgJSAxMDAwMDAwMCwKKworICAgICAgICAgICAgKHNpemVfdCltTWFpbkJ1ZmZlciwgLy8gdXNlICV6WCBhcyAlcCBhcHBlbmRzIDB4CisgICAgICAgICAgICAoc2l6ZV90KW1BdXhCdWZmZXIgICAvLyB1c2UgJXpYIGFzICVwIGFwcGVuZHMgMHgKKyAgICAgICAgICAgICk7CiB9CiAKIHVpbnQzMl90IEF1ZGlvRmxpbmdlcjo6UGxheWJhY2tUaHJlYWQ6OlRyYWNrOjpzYW1wbGVSYXRlKCkgY29uc3QgewpAQCAtMTIzNSw3ICsxMjU2LDggQEAKICAgICAgICAgICAgIHVpZF90IHVpZCkKICAgICA6ICAgVHJhY2socGxheWJhY2tUaHJlYWQsIE5VTEwsIEFVRElPX1NUUkVBTV9QQVRDSCwKICAgICAgICAgICAgICAgc2FtcGxlUmF0ZSwgZm9ybWF0LCBjaGFubmVsTWFzaywgZnJhbWVDb3VudCwKLSAgICAgICAgICAgICAgTlVMTCwgMCwgQVVESU9fU0VTU0lPTl9OT05FLCB1aWQsIEFVRElPX09VVFBVVF9GTEFHX05PTkUsCisgICAgICAgICAgICAgIG51bGxwdHIgLyogYnVmZmVyICovLCAoc2l6ZV90KTAgLyogYnVmZmVyU2l6ZSAqLywgbnVsbHB0ciAvKiBzaGFyZWRCdWZmZXIgKi8sCisgICAgICAgICAgICAgIEFVRElPX1NFU1NJT05fTk9ORSwgdWlkLCBBVURJT19PVVRQVVRfRkxBR19OT05FLAogICAgICAgICAgICAgICBUWVBFX09VVFBVVCksCiAgICAgbUFjdGl2ZShmYWxzZSksIG1Tb3VyY2VUaHJlYWQoc291cmNlVGhyZWFkKQogewpAQCAtMTM1MSw3ICsxMzczLDkgQEAKICAgICAgICAgICAgIGlmIChtQnVmZmVyUXVldWUuc2l6ZSgpKSB7CiAgICAgICAgICAgICAgICAgbUJ1ZmZlclF1ZXVlLnJlbW92ZUF0KDApOwogICAgICAgICAgICAgICAgIGZyZWUocEluQnVmZmVyLT5tQnVmZmVyKTsKLSAgICAgICAgICAgICAgICBkZWxldGUgcEluQnVmZmVyOworICAgICAgICAgICAgICAgIGlmIChwSW5CdWZmZXIgIT0gJmluQnVmZmVyKSB7CisgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBwSW5CdWZmZXI7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIEFMT0dWKCJPdXRwdXRUcmFjazo6d3JpdGUoKSAlcCB0aHJlYWQgJXAgcmVsZWFzZWQgb3ZlcmZsb3cgYnVmZmVyICV6dSIsIHRoaXMsCiAgICAgICAgICAgICAgICAgICAgICAgICBtVGhyZWFkLnVuc2FmZV9nZXQoKSwgbUJ1ZmZlclF1ZXVlLnNpemUoKSk7CiAgICAgICAgICAgICB9IGVsc2UgewpAQCAtMTQzMCwxMCArMTQ1NCwxMiBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19mb3JtYXRfdCBmb3JtYXQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVfdCBmcmFtZUNvdW50LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICpidWZmZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVfdCBidWZmZXJTaXplLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19vdXRwdXRfZmxhZ3NfdCBmbGFncykKICAgICA6ICAgVHJhY2socGxheWJhY2tUaHJlYWQsIE5VTEwsIHN0cmVhbVR5cGUsCiAgICAgICAgICAgICAgIHNhbXBsZVJhdGUsIGZvcm1hdCwgY2hhbm5lbE1hc2ssIGZyYW1lQ291bnQsCi0gICAgICAgICAgICAgIGJ1ZmZlciwgMCwgQVVESU9fU0VTU0lPTl9OT05FLCBnZXR1aWQoKSwgZmxhZ3MsIFRZUEVfUEFUQ0gpLAorICAgICAgICAgICAgICBidWZmZXIsIGJ1ZmZlclNpemUsIG51bGxwdHIgLyogc2hhcmVkQnVmZmVyICovLAorICAgICAgICAgICAgICBBVURJT19TRVNTSU9OX05PTkUsIGdldHVpZCgpLCBmbGFncywgVFlQRV9QQVRDSCksCiAgICAgICAgICAgICAgIG1Qcm94eShuZXcgQ2xpZW50UHJveHkobUNibGssIG1CdWZmZXIsIGZyYW1lQ291bnQsIG1GcmFtZVNpemUsIHRydWUsIHRydWUpKQogewogICAgIHVpbnQ2NF90IG1peEJ1ZmZlck5zID0gKCh1aW50NjRfdCkyICogcGxheWJhY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gICAgICAgICAgZ2V0VHJhY2tTdGF0ZVN0cmluZygpLAorICAgICAgICAgICAgbUNibGstPm1GbGFncywKKwogICAgICAgICAgICAgbUZvcm1hdCwKICAgICAgICAgICAgIG1DaGFubmVsTWFzaywKLSAgICAgICAgICAgIG1TZXNzaW9uSWQsCi0gICAgICAgICAgICBtU3RhdGUsCi0gICAgICAgICAgICBtQ2Jsay0+bVNlcnZlciwKLSAgICAgICAgICAgIG1GcmFtZUNvdW50LAotICAgICAgICAgICAgbVNhbXBsZVJhdGUpOworICAgICAgICAgICAgbVNhbXBsZVJhdGUsCiAKKyAgICAgICAgICAgIG1DYmxrLT5tU2VydmVyLAorICAgICAgICAgICAgbUZyYW1lQ291bnQKKyAgICAgICAgICAgICk7CiB9CiAKIHZvaWQgQXVkaW9GbGluZ2VyOjpSZWNvcmRUaHJlYWQ6OlJlY29yZFRyYWNrOjpoYW5kbGVTeW5jU3RhcnRFdmVudChjb25zdCBzcDxTeW5jRXZlbnQ+JiBldmVudCkKQEAgLTE3NjcsOSArMTgwMCwxMCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19mb3JtYXRfdCBmb3JtYXQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVfdCBmcmFtZUNvdW50LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICpidWZmZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVfdCBidWZmZXJTaXplLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19pbnB1dF9mbGFnc190IGZsYWdzKQogICAgIDogICBSZWNvcmRUcmFjayhyZWNvcmRUaHJlYWQsIE5VTEwsIHNhbXBsZVJhdGUsIGZvcm1hdCwgY2hhbm5lbE1hc2ssIGZyYW1lQ291bnQsCi0gICAgICAgICAgICAgICAgYnVmZmVyLCBBVURJT19TRVNTSU9OX05PTkUsIGdldHVpZCgpLCBmbGFncywgVFlQRV9QQVRDSCksCisgICAgICAgICAgICAgICAgYnVmZmVyLCBidWZmZXJTaXplLCBBVURJT19TRVNTSU9OX05PTkUsIGdldHVpZCgpLCBmbGFncywgVFlQRV9QQVRDSCksCiAgICAgICAgICAgICAgICAgbVByb3h5KG5ldyBDbGllbnRQcm94eShtQ2JsaywgbUJ1ZmZlciwgZnJhbWVDb3VudCwgbUZyYW1lU2l6ZSwgZmFsc2UsIHRydWUpKQogewogICAgIHVpbnQ2NF90IG1peEJ1ZmZlck5zID0gKCh1aW50NjRfdCkyICogcmVjb3JkVGhyZWFkLT5mcmFtZUNvdW50KCkgKiAxMDAwMDAwMDAwKSAvCkBAIC0xODM0LDExICsxODY4LDE1IEBACiAgICAgICAgIGF1ZGlvX2NoYW5uZWxfbWFza190IGNoYW5uZWxNYXNrLAogICAgICAgICBhdWRpb19zZXNzaW9uX3Qgc2Vzc2lvbklkLAogICAgICAgICB1aWRfdCB1aWQsCisgICAgICAgIHBpZF90IHBpZCwKICAgICAgICAgYXVkaW9fcG9ydF9oYW5kbGVfdCBwb3J0SWQpCiAgICAgOiAgIFRyYWNrQmFzZSh0aHJlYWQsIE5VTEwsIHNhbXBsZVJhdGUsIGZvcm1hdCwKLSAgICAgICAgICAgICAgICAgIGNoYW5uZWxNYXNrLCAwLCBOVUxMLCBzZXNzaW9uSWQsIHVpZCwgZmFsc2UsCisgICAgICAgICAgICAgICAgICBjaGFubmVsTWFzaywgKHNpemVfdCkwIC8qIGZyYW1lQ291bnQgKi8sCisgICAgICAgICAgICAgICAgICBudWxscHRyIC8qIGJ1ZmZlciAqLywgKHNpemVfdCkwIC8qIGJ1ZmZlclNpemUgKi8sCisgICAgICAgICAgICAgICAgICBzZXNzaW9uSWQsIHVpZCwgZmFsc2UgLyogaXNPdXQgKi8sCiAg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mxhZ3MgJiBBVURJT19JTlBVVF9GTEFHX01NQVBfTk9JUlEpID09IEFVRElPX0lOUFVUX0ZMQUdfTU1BUF9OT0lSUSAmJgorICAgICAgICAgICAgKmlucHV0ICE9IEFVRElPX0lPX0hBTkRMRV9OT05FKSB7CisgICAgICAgIHNzaXplX3QgaW5kZXggPSBtSW5wdXRzLmluZGV4T2ZLZXkoKmlucHV0KTsKKyAgICAgICAgaWYgKGluZGV4IDwgMCkgeworICAgICAgICAgICAgQUxPR1coImdldElucHV0Rm9yQXR0cigpIHVua25vd24gTU1BUCBpbnB1dCAlZCIsICppbnB1dCk7CisgICAgICAgICAgICBzdGF0dXMgPSBCQURfVkFMVUU7CisgICAgICAgICAgICBnb3RvIGVycm9yOworICAgICAgICB9CisgICAgICAgIHNwPEF1ZGlvSW5wdXREZXNjcmlwdG9yPiBpbnB1dERlc2MgPSBtSW5wdXRzLnZhbHVlQXQoaW5kZXgpOworICAgICAgICBzcDxBdWRpb1Nlc3Npb24+IGF1ZGlvU2Vzc2lvbiA9IGlucHV0RGVzYy0+Z2V0QXVkaW9TZXNzaW9uKHNlc3Npb24pOworICAgICAgICBpZiAoYXVkaW9TZXNzaW9uID09IDApIHsKKyAgICAgICAgICAgIEFMT0dXKCJnZXRJbnB1dEZvckF0dHIoKSB1bmtub3duIHNlc3Npb24gJWQgb24gaW5wdXQgJWQiLCBzZXNzaW9uLCAqaW5wdXQpOworICAgICAgICAgICAgc3RhdHVzID0gQkFEX1ZBTFVFOworICAgICAgICAgICAgZ290byBlcnJvcjsKKyAgICAgICAgfQorICAgICAgICAvLyBGb3IgTU1BUCBtb2RlLCB0aGUgZmlyc3QgY2FsbCB0byBnZXRJbnB1dEZvckF0dHIoKSBpcyBtYWRlIG9uIGJlaGFsZiBvZiBhdWRpb2ZsaW5nZXIuCisgICAgICAgIC8vIFRoZSBzZWNvbmQgY2FsbCBpcyBmb3IgdGhlIGZpcnN0IGFjdGl2ZSBjbGllbnQgYW5kIHNldHMgdGhlIFVJRC4gQW55IGZ1cnRoZXIgY2FsbAorICAgICAgICAvLyBjb3JyZXNwb25kcyB0byBhIG5ldyBjbGllbnQgYW5kIGlzIG9ubHkgcGVybWl0dGVkIGZyb20gdGhlIHNhbWUgVUlkLgorICAgICAgICBpZiAoYXVkaW9TZXNzaW9uLT5vcGVuQ291bnQoKSA9PSAxKSB7CisgICAgICAgICAgICBhdWRpb1Nlc3Npb24tPnNldFVpZCh1aWQpOworICAgICAgICB9IGVsc2UgaWYgKGF1ZGlvU2Vzc2lvbi0+dWlkKCkgIT0gdWlkKSB7CisgICAgICAgICAgICBBTE9HVygiZ2V0SW5wdXRGb3JBdHRyKCkgYmFkIHVpZCAlZCBmb3Igc2Vzc2lvbiAlZCB1aWQgJWQiLAorICAgICAgICAgICAgICAgICAgdWlkLCBzZXNzaW9uLCBhdWRpb1Nlc3Npb24tPnVpZCgpKTsKKyAgICAgICAgICAgIHN0YXR1cyA9IElOVkFMSURfT1BFUkFUSU9OOworICAgICAgICAgICAgZ290byBlcnJvcjsKKyAgICAgICAgfQorICAgICAgICBhdWRpb1Nlc3Npb24tPmNoYW5nZU9wZW5Db3VudCgxKTsKKyAgICAgICAgKmlucHV0VHlwZSA9IEFQSV9JTlBVVF9MRUdBQ1k7CisgICAgICAgIGlmICgqcG9ydElkID09IEFVRElPX1BPUlRfSEFORExFX05PTkUpIHsKKyAgICAgICAgICAgICpwb3J0SWQgPSBBdWRpb1BvcnQ6OmdldE5leHRVbmlxdWVJZCgpOworICAgICAgICB9CisgICAgICAgIGlucHV0RGV2aWNlcyA9IG1BdmFpbGFibGVJbnB1dERldmljZXMuZ2V0RGV2aWNlc0Zyb21UeXBlKGlucHV0RGVzYy0+bURldmljZSk7CisgICAgICAgICpzZWxlY3RlZERldmljZUlkID0gaW5wdXREZXZpY2VzLnNpemUoKSA+IDAgPyBpbnB1dERldmljZXMuaXRlbUF0KDApLT5nZXRJZCgpCisgICAgICAgICAgICAgICAgOiBBVURJT19QT1JUX0hBTkRMRV9OT05FOworICAgICAgICBBTE9HSSgiJXMgcmV1c2luZyBNTUFQIGlucHV0ICVkIGZvciBzZXNzaW9uICVkIiwgX19GVU5DVElPTl9fLCAqaW5wdXQsIHNlc3Npb24pOworCisgICAgICAgIHJldHVybiBOT19FUlJPUjsKKyAgICB9CisKKyAgICAqaW5wdXQgPSBBVURJT19JT19IQU5ETEVfTk9ORTsKKyAgICAqaW5wdXRUeXBlID0gQVBJX0lOUFVUX0lOVkFMSUQ7CisKKyAgICBpZiAoaW5wdXRTb3VyY2UgPT0gQVVESU9fU09VUkNFX0RFRkFVTFQpIHsKKyAgICAgICAgaW5wdXRTb3VyY2UgPSBBVURJT19TT1VSQ0VfTUlDOworICAgIH0KKyAgICBoYWxJbnB1dFNvdXJjZSA9IGlucHV0U291cmNlOworCisgICAgLy8gVE9ETzogY2hlY2sgZm9yIGV4aXN0aW5nIGNsaWVudCBmb3IgdGhpcyBwb3J0IElECisgICAgaWYgKCpwb3J0SWQgPT0gQVVESU9fUE9SVF9IQU5ETEVfTk9ORSkgeworICAgICAgICAqcG9ydElkID0gQXVkaW9Qb3J0OjpnZXROZXh0VW5pcXVlSWQoKTsKKyAgICB9CisKKyAgICBhdWRpb19kZXZpY2VzX3QgZGV2aWNlOworCiAgICAgaWYgKGlucHV0U291cmNlID09IEFVRElPX1NPVVJDRV9SRU1PVEVfU1VCTUlYICYmCiAgICAgICAgICAgICBzdHJuY21wKGF0dHItPnRhZ3MsICJhZGRyPSIsIHN0cmxlbigiYWRkcj0iKSkgPT0gMCkgewotICAgICAgICBzdGF0dXNfdCByZXQgPSBtUG9saWN5TWl4ZXMuZ2V0SW5wdXRNaXhGb3JBdHRyKCphdHRyLCAmcG9saWN5TWl4KTsKLSAgICAgICAgaWYgKHJldCAhPSBOT19FUlJPUikgewotICAgICAgICAgICAgcmV0dXJuIHJldDsKKyAgICAgICAgc3RhdHVzID0gbVBvbGljeU1peGVzLmdldElucHV0TWl4Rm9yQXR0cigqYXR0ciwgJnBvbGljeU1peCk7CisgICAgICAgIGlmIChzdGF0dXMgIT0gTk9fRVJST1IpIHsKKyAgICAgICAgICAgIGdvdG8gZXJyb3I7CiAgICAgICAgIH0KICAgICAgICAgKmlucHV0VHlwZSA9IEFQSV9JTlBVVF9NSVhfRVhUX1BPTElDWV9SRVJPVVRFOwogICAgICAgICBkZXZpY2UgPSBBVURJT19ERVZJQ0VfSU5fUkVNT1RFX1NVQk1JWDsKQEAgLTE1ODEsNyArMTU4OCw4IEBACiAgICAgICAgIGRldmljZSA9IGdldERldmljZUFuZE1peEZvcklucHV0U291cmNlKGlucHV0U291cmNlLCAmcG9saWN5TWl4KTsKICAgICAgICAgaWYgKGRldmljZSA9PSBBVURJT19ERVZJQ0VfTk9ORSkgewogICAgICAgICAgICAgQUxPR1coImdldElucHV0Rm9yQXR0cigpIGNvdWxkIG5vdCBmaW5kIGRldmljZSBmb3Igc291cmNlICVkIiwgaW5wdXRTb3VyY2UpOwotICAgICAgICAgICAgcmV0dXJuIEJBRF9WQUxVRTsKKyAgICAgICAgICAgIHN0YXR1cyA9IEJBRF9WQUxVRTsKKyAgICAgICAgICAgIGdvdG8gZXJyb3I7CiAgICAgICAgIH0KICAgICAgICAgaWYgKHBvbGljeU1peCAhPSBOVUxMKSB7CiAgICAgICAgICAgICBhZGRyZXNzID0gcG9saWN5TWl4LT5tRGV2aWNlQWRkcmVzczsKQEAgLTE2MTAsMTEgKzE2MTgsMTEgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWctPnNhbXBsZV9yYXRlLCBjb25maWctPmZvcm1hdCwgY29uZmlnLT5jaGFubmVsX21hc2ssIGZsYWdzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvbGljeU1peCk7CiAgICAgaWYgKCppbnB1dCA9PSBBVURJT19JT19IQU5ETEVfTk9ORSkgewotICAgICAgICBtSW5wdXRSb3V0ZXMucmVtb3ZlUm91dGUoc2Vzc2lvbik7Ci0gICAgICAgIHJldHV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wgYXVkaW9fc291cmNlX3Qgc291cmNlLAorICAgICAgICBpbnQgZXZlbnQsIGNvbnN0IHJlY29yZF9jbGllbnRfaW5mb190ICpjbGllbnRJbmZvLAogICAgICAgICBjb25zdCBhdWRpb19jb25maWdfYmFzZV90ICpjbGllbnRDb25maWcsIGNvbnN0IGF1ZGlvX2NvbmZpZ19iYXNlX3QgKmRldmljZUNvbmZpZywKICAgICAgICAgYXVkaW9fcGF0Y2hfaGFuZGxlX3QgcGF0Y2hIYW5kbGUpCiB7CiAgICAgaWYgKG1BdWRpb1BvbGljeVNlcnZpY2VDbGllbnQgIT0gMCkgewotICAgICAgICBtQXVkaW9Qb2xpY3lTZXJ2aWNlQ2xpZW50LT5vblJlY29yZGluZ0NvbmZpZ3VyYXRpb25VcGRhdGUoZXZlbnQsIHNlc3Npb24sIHNvdXJjZSwKKyAgICAgICAgbUF1ZGlvUG9saWN5U2VydmljZUNsaWVudC0+b25SZWNvcmRpbmdDb25maWd1cmF0aW9uVXBkYXRlKGV2ZW50LCBjbGllbnRJbmZvLAogICAgICAgICAgICAgICAgIGNsaWVudENvbmZpZywgZGV2aWNlQ29uZmlnLCBwYXRjaEhhbmRsZSk7CiAgICAgfQogfQpAQCAtNTQ0LDggKzU0NCw4IEBACiAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBtTG9jay51bmxvY2soKTsKLSAgICAgICAgICAgICAgICAgICAgc3ZjLT5kb09uUmVjb3JkaW5nQ29uZmlndXJhdGlvblVwZGF0ZShkYXRhLT5tRXZlbnQsIGRhdGEtPm1TZXNzaW9uLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEtPm1Tb3VyY2UsICZkYXRhLT5tQ2xpZW50Q29uZmlnLCAmZGF0YS0+bURldmljZUNvbmZpZywKKyAgICAgICAgICAgICAgICAgICAgc3ZjLT5kb09uUmVjb3JkaW5nQ29uZmlndXJhdGlvblVwZ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bWljUG9saWN5TWl4U3RhdGVVcGRhdGUoY29uc3QgU3RyaW5nOCYgcmVnSWQsIGludDMyX3Qgc3RhdGUpOwogICAgICAgICAgICAgdm9pZCBkb09uRHluYW1pY1BvbGljeU1peFN0YXRlVXBkYXRlKGNvbnN0IFN0cmluZzgmIHJlZ0lkLCBpbnQzMl90IHN0YXRlKTsKLSAgICAgICAgICAgIHZvaWQgb25SZWNvcmRpbmdDb25maWd1cmF0aW9uVXBkYXRlKGludCBldmVudCwgYXVkaW9fc2Vzc2lvbl90IHNlc3Npb24sCi0gICAgICAgICAgICAgICAgICAgIGF1ZGlvX3NvdXJjZV90IHNvdXJjZSwgY29uc3QgYXVkaW9fY29uZmlnX2Jhc2VfdCAqY2xpZW50Q29uZmlnLAorICAgICAgICAgICAgdm9pZCBvblJlY29yZGluZ0NvbmZpZ3VyYXRpb25VcGRhdGUoaW50IGV2ZW50LCBjb25zdCByZWNvcmRfY2xpZW50X2luZm9fdCAqY2xpZW50SW5mbywKKyAgICAgICAgICAgICAgICAgICAgY29uc3QgYXVkaW9fY29uZmlnX2Jhc2VfdCAqY2xpZW50Q29uZmlnLAogICAgICAgICAgICAgICAgICAgICBjb25zdCBhdWRpb19jb25maWdfYmFzZV90ICpkZXZpY2VDb25maWcsIGF1ZGlvX3BhdGNoX2hhbmRsZV90IHBhdGNoSGFuZGxlKTsKLSAgICAgICAgICAgIHZvaWQgZG9PblJlY29yZGluZ0NvbmZpZ3VyYXRpb25VcGRhdGUoaW50IGV2ZW50LCBhdWRpb19zZXNzaW9uX3Qgc2Vzc2lvbiwKLSAgICAgICAgICAgICAgICAgICAgYXVkaW9fc291cmNlX3Qgc291cmNlLCBjb25zdCBhdWRpb19jb25maWdfYmFzZV90ICpjbGllbnRDb25maWcsCisgICAgICAgICAgICB2b2lkIGRvT25SZWNvcmRpbmdDb25maWd1cmF0aW9uVXBkYXRlKGludCBldmVudCwgY29uc3QgcmVjb3JkX2NsaWVudF9pbmZvX3QgKmNsaWVudEluZm8sCisgICAgICAgICAgICAgICAgICAgIGNvbnN0IGF1ZGlvX2NvbmZpZ19iYXNlX3QgKmNsaWVudENvbmZpZywKICAgICAgICAgICAgICAgICAgICAgY29uc3QgYXVkaW9fY29uZmlnX2Jhc2VfdCAqZGV2aWNlQ29uZmlnLCBhdWRpb19wYXRjaF9oYW5kbGVfdCBwYXRjaEhhbmRsZSk7CiAKIHByaXZhdGU6CkBAIC0zMDYsOCArMzA2LDggQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZGVsYXlNcyk7CiAgICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICAgIGR5bmFtaWNQb2xpY3lNaXhTdGF0ZVVwZGF0ZUNvbW1hbmQoY29uc3QgU3RyaW5nOCYgcmVnSWQsIGludDMyX3Qgc3RhdGUpOwogICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICByZWNvcmRpbmdDb25maWd1cmF0aW9uVXBkYXRlQ29tbWFuZCgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGV2ZW50LCBhdWRpb19zZXNzaW9uX3Qgc2Vzc2lvbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fc291cmNlX3Qgc291cmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZXZlbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHJlY29yZF9jbGllbnRfaW5mb190ICpjbGllbnRJbmZvLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBhdWRpb19jb25maWdfYmFzZV90ICpjbGllbnRDb25maWcsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGF1ZGlvX2NvbmZpZ19iYXNlX3QgKmRldmljZUNvbmZpZywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fcGF0Y2hfaGFuZGxlX3QgcGF0Y2hIYW5kbGUpOwpAQCAtNDA0LDggKzQwNCw3IEBACiAgICAgICAgIGNsYXNzIFJlY29yZGluZ0NvbmZpZ3VyYXRpb25VcGRhdGVEYXRhIDogcHVibGljIEF1ZGlvQ29tbWFuZERhdGEgewogICAgICAgICBwdWJsaWM6CiAgICAgICAgICAgICBpbnQgbUV2ZW50OwotICAgICAgICAgICAgYXVkaW9fc2Vzc2lvbl90IG1TZXNzaW9uOwotICAgICAgICAgICAgYXVkaW9fc291cmNlX3QgbVNvdXJjZTsKKyAgICAgICAgICAgIHJlY29yZF9jbGllbnRfaW5mb190IG1DbGllbnRJbmZvOwogICAgICAgICAgICAgc3RydWN0IGF1ZGlvX2NvbmZpZ19iYXNlIG1DbGllbnRDb25maWc7CiAgICAgICAgICAgICBzdHJ1Y3QgYXVkaW9fY29uZmlnX2Jhc2UgbURldmljZUNvbmZpZzsKICAgICAgICAgICAgIGF1ZGlvX3BhdGNoX2hhbmRsZV90IG1QYXRjaEhhbmRsZTsKQEAgLTUxOCw3ICs1MTcsNyBAQAogICAgICAgICB2aXJ0dWFsIHZvaWQgb25BdWRpb1BhdGNoTGlzdFVwZGF0ZSgpOwogICAgICAgICB2aXJ0dWFsIHZvaWQgb25EeW5hbWljUG9saWN5TWl4U3RhdGVVcGRhdGUoU3RyaW5nOCByZWdJZCwgaW50MzJfdCBzdGF0ZSk7CiAgICAgICAgIHZpcnR1YWwgdm9pZCBvblJlY29yZGluZ0NvbmZpZ3VyYXRpb25VcGRhdGUoaW50IGV2ZW50LAotICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fc2Vzc2lvbl90IHNlc3Npb24sIGF1ZGlvX3NvdXJjZV90IHNvdXJjZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHJlY29yZF9jbGllbnRfaW5mb190ICpjbGllbnRJbmZvLAogICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgYXVkaW9fY29uZmlnX2Jhc2VfdCAqY2xpZW50Q29uZmlnLAogICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgYXVkaW9fY29uZmlnX2Jhc2VfdCAqZGV2aWNlQ29uZmlnLCBhdWRpb19wYXRjaF9oYW5kbGVfdCBwYXRjaEhhbmRsZSk7CiAKQEAgLTU0MCw4ICs1MzksNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICBvbkF1ZGlvUGF0Y2hMaXN0VXBkYXRlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAgICAgIG9uRHluYW1pY1BvbGljeU1peFN0YXRlVXBkYXRlKGNvbnN0IFN0cmluZzgmIHJlZ0lkLCBpbnQzMl90IHN0YXRlKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgb25SZWNvcmRpbmdDb25maWd1cmF0aW9uVXBkYXRlKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBldmVudCwgYXVkaW9fc2Vzc2lvbl90IHNlc3Npb24sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fc291cmNlX3Qgc291cmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBldmVudCwgY29uc3QgcmVjb3JkX2NsaWVudF9pbmZvX3QgKmNsaWVudEluZm8sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgYXVkaW9fY29uZmlnX2Jhc2VfdCAqY2xpZW50Q29uZmlnLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGF1ZGlvX2Nvb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ZS9hcGkxL2NsaWVudDIvSnBlZ1Byb2Nlc3Nvci5jcHAKQEAgLTEzNiwxNyArMTM2LDE2IEBACiAKICAgICBpZiAobUNhcHR1cmVTdHJlYW1JZCAhPSBOT19TVFJFQU0pIHsKICAgICAgICAgLy8gQ2hlY2sgaWYgc3RyZWFtIHBhcmFtZXRlcnMgaGF2ZSB0byBjaGFuZ2UKLSAgICAgICAgdWludDMyX3QgY3VycmVudFdpZHRoLCBjdXJyZW50SGVpZ2h0OwotICAgICAgICByZXMgPSBkZXZpY2UtPmdldFN0cmVhbUluZm8obUNhcHR1cmVTdHJlYW1JZCwKLSAgICAgICAgICAgICAgICAmY3VycmVudFdpZHRoLCAmY3VycmVudEhlaWdodCwgMCwgMCk7CisgICAgICAgIENhbWVyYURldmljZUJhc2U6OlN0cmVhbUluZm8gc3RyZWFtSW5mbzsKKyAgICAgICAgcmVzID0gZGV2aWNlLT5nZXRTdHJlYW1JbmZvKG1DYXB0dXJlU3RyZWFtSWQsICZzdHJlYW1JbmZvKTsKICAgICAgICAgaWYgKHJlcyAhPSBPSykgewogICAgICAgICAgICAgQUxPR0UoIiVzOiBDYW1lcmEgJWQ6IEVycm9yIHF1ZXJ5aW5nIGNhcHR1cmUgb3V0cHV0IHN0cmVhbSBpbmZvOiAiCiAgICAgICAgICAgICAgICAgICAgICIlcyAoJWQpIiwgX19GVU5DVElPTl9fLAogICAgICAgICAgICAgICAgICAgICBtSWQsIHN0cmVycm9yKC1yZXMpLCByZXMpOwogICAgICAgICAgICAgcmV0dXJuIHJlczsKICAgICAgICAgfQotICAgICAgICBpZiAoY3VycmVudFdpZHRoICE9ICh1aW50MzJfdClwYXJhbXMucGljdHVyZVdpZHRoIHx8Ci0gICAgICAgICAgICAgICAgY3VycmVudEhlaWdodCAhPSAodWludDMyX3QpcGFyYW1zLnBpY3R1cmVIZWlnaHQpIHsKKyAgICAgICAgaWYgKHN0cmVhbUluZm8ud2lkdGggIT0gKHVpbnQzMl90KXBhcmFtcy5wa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BkZXZpY2UtPmdldFN0cmVhbUluZm8obVByZXZpZXdTdHJlYW1JZCwKLSAgICAgICAgICAgICAgICAmY3VycmVudFdpZHRoLCAmY3VycmVudEhlaWdodCwgMCwgMCk7CisgICAgICAgIENhbWVyYURldmljZUJhc2U6OlN0cmVhbUluZm8gc3RyZWFtSW5mbzsKKyAgICAgICAgcmVzID0gZGV2aWNlLT5nZXRTdHJlYW1JbmZvKG1QcmV2aWV3U3RyZWFtSWQsICZzdHJlYW1JbmZvKTsKICAgICAgICAgaWYgKHJlcyAhPSBPSykgewogICAgICAgICAgICAgQUxPR0UoIiVzOiBDYW1lcmEgJWQ6IEVycm9yIHF1ZXJ5aW5nIHByZXZpZXcgc3RyZWFtIGluZm86ICIKICAgICAgICAgICAgICAgICAgICAgIiVzICglZCkiLCBfX0ZVTkNUSU9OX18sIG1JZCwgc3RyZXJyb3IoLXJlcyksIHJlcyk7CiAgICAgICAgICAgICByZXR1cm4gcmVzOwogICAgICAgICB9Ci0gICAgICAgIGlmIChjdXJyZW50V2lkdGggIT0gKHVpbnQzMl90KXBhcmFtcy5wcmV2aWV3V2lkdGggfHwKLSAgICAgICAgICAgICAgICBjdXJyZW50SGVpZ2h0ICE9ICh1aW50MzJfdClwYXJhbXMucHJldmlld0hlaWdodCkgeworICAgICAgICBpZiAoc3RyZWFtSW5mby53aWR0aCAhPSAodWludDMyX3QpcGFyYW1zLnByZXZpZXdXaWR0aCB8fAorICAgICAgICAgICAgICAgIHN0cmVhbUluZm8uaGVpZ2h0ICE9ICh1aW50MzJfdClwYXJhbXMucHJldmlld0hlaWdodCkgewogICAgICAgICAgICAgQUxPR1YoIiVzOiBDYW1lcmEgJWQ6IFByZXZpZXcgc2l6ZSBzd2l0Y2g6ICVkIHggJWQgLT4gJWQgeCAlZCIsCi0gICAgICAgICAgICAgICAgICAgIF9fRlVOQ1RJT05fXywgbUlkLCBjdXJyZW50V2lkdGgsIGN1cnJlbnRIZWlnaHQsCisgICAgICAgICAgICAgICAgIC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mVhbUluZm8obVJlY29yZGluZ1N0cmVhbUlkLAotICAgICAgICAgICAgICAgICZjdXJyZW50V2lkdGgsICZjdXJyZW50SGVpZ2h0LAotICAgICAgICAgICAgICAgICZjdXJyZW50Rm9ybWF0LCAmY3VycmVudERhdGFTcGFjZSk7CisgICAgICAgIENhbWVyYURldmljZUJhc2U6OlN0cmVhbUluZm8gc3RyZWFtSW5mbzsKKyAgICAgICAgcmVzID0gZGV2aWNlLT5nZXRTdHJlYW1JbmZvKG1SZWNvcmRpbmdTdHJlYW1JZCwgJnN0cmVhbUluZm8pOwogICAgICAgICBpZiAocmVzICE9IE9LKSB7CiAgICAgICAgICAgICBBTE9HRSgiJXM6IENhbWVyYSAlZDogRXJyb3IgcXVlcnlpbmcgcmVjb3JkaW5nIG91dHB1dCBzdHJlYW0gaW5mbzogIgogICAgICAgICAgICAgICAgICAgICAiJXMgKCVkKSIsIF9fRlVOQ1RJT05fXywgbUlkLAogICAgICAgICAgICAgICAgICAgICBzdHJlcnJvcigtcmVzKSwgcmVzKTsKICAgICAgICAgICAgIHJldHVybiByZXM7CiAgICAgICAgIH0KLSAgICAgICAgaWYgKGN1cnJlbnRXaWR0aCAhPSAodWludDMyX3QpcGFyYW1zLnZpZGVvV2lkdGggfHwKLSAgICAgICAgICAgICAgICBjdXJyZW50SGVpZ2h0ICE9ICh1aW50MzJfdClwYXJhbXMudmlkZW9IZWlnaHQgfHwKLSAgICAgICAgICAgICAgICBjdXJyZW50Rm9ybWF0ICE9ICh1aW50MzJfdClwYXJhbXMudmlkZW9Gb3JtYXQgfHwKLSAgICAgICAgICAgICAgICBjdXJyZW50RGF0YVNwYWNlICE9IHBhcmFtcy52aWRlb0RhdGFTcGFjZSkgeworICAgICAgICBpZiAoc3RyZWFtSW5mby53aWR0aCAhPSAodWludDMyX3QpcGFyYW1zLnZpZGVvV2lkdGggfHwKKyAgICAgICAgICAgICAgICBzdHJlYW1JbmZvLmhlaWdodCAhPSAodWludDMyX3QpcGFyYW1zL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gICAgcmVzID0gZGV2aWNlLT5nZXRTdHJlYW1JbmZvKG1ac2xTdHJlYW1JZCwKLSAgICAgICAgICAgICAgICAmY3VycmVudFdpZHRoLCAmY3VycmVudEhlaWdodCwgMCwgMCk7CisgICAgICAgIENhbWVyYURldmljZUJhc2U6OlN0cmVhbUluZm8gc3RyZWFtSW5mbzsKKyAgICAgICAgcmVzID0gZGV2aWNlLT5nZXRTdHJlYW1JbmZvKG1ac2xTdHJlYW1JZCwgJnN0cmVhbUluZm8pOwogICAgICAgICBpZiAocmVzICE9IE9LKSB7CiAgICAgICAgICAgICBBTE9HRSgiJXM6IENhbWVyYSAlZDogRXJyb3IgcXVlcnlpbmcgY2FwdHVyZSBvdXRwdXQgc3RyZWFtIGluZm86ICIKICAgICAgICAgICAgICAgICAgICAgIiVzICglZCkiLCBfX0ZVTkNUSU9OX18sCiAgICAgICAgICAgICAgICAgICAgIGNsaWVudC0+Z2V0Q2FtZXJhSWQoKSwgc3RyZXJyb3IoLXJlcyksIHJlcyk7CiAgICAgICAgICAgICByZXR1cm4gcmVzOwogICAgICAgICB9Ci0gICAgICAgIGlmIChjdXJyZW50V2lkdGggIT0gKHVpbnQzMl90KXBhcmFtcy5mYXN0SW5mby5hcnJheVdpZHRoIHx8Ci0gICAgICAgICAgICAgICAgY3VycmVudEhlaWdodCAhPSAodWludDMyX3QpcGFyYW1zLmZhc3RJbmZvLmFycmF5SGVpZ2h0KSB7CisgICAgICAgIGlmIChzdHJlYW1JbmZvLndpZHRoICE9ICh1aW50MzJfdClwYXJhbXMuZmFzdEluZm8uYXJyYXlXaWR0aCB8fAorICAgICAgICAgICAgICAgIHN0cmVhbUluZm8uaGVpZ2h0ICE9ICh1aW50MzJfdClwYXJhbXMuZmFzdEluZm8uYXJyYXlIZWlnaHQpIHsKICAgICAgICAgICAgIGlmIChtWnNsU3RyZWFtSWQgIT0gTk9fU1RSRUFNKSB7CiAgICAgICAgICAgICAgICAgQUxPR1YoIiVzOiBDYW1lcmEgJW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doZXRoZXIgdGhlIGZvcm1hdCBtYXRjaGVzIHRoZSBjdXJyZW50IG9yIHRoZSBvcmlnaW5hbCBvbmUgaW4gY2FzZQorICAgICAgICAgKiBpdCBnb3Qgb3ZlcnJpZGRlbi4KKyAgICAgICAgICovCisgICAgICAgIGJvb2wgbWF0Y2hGb3JtYXQodWludDMyX3QgY2xpZW50Rm9ybWF0KSBjb25zdCB7CisgICAgICAgICAgICBpZiAoKGZvcm1hdE92ZXJyaWRkZW4gJiYgKG9yaWdpbmFsRm9ybWF0ID09IGNsaWVudEZvcm1hdCkpIHx8CisgICAgICAgICAgICAgICAgICAgIChmb3JtYXQgPT0gY2xpZW50Rm9ybWF0KSkgeworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIENoZWNrIHdoZXRoZXIgdGhlIGRhdGFzcGFjZSBtYXRjaGVzIHRoZSBjdXJyZW50IG9yIHRoZSBvcmlnaW5hbCBvbmUgaW4gY2FzZQorICAgICAgICAgKiBpdCBnb3Qgb3ZlcnJpZGRlbi4KKyAgICAgICAgICovCisgICAgICAgIGJvb2wgbWF0Y2hEYXRhU3BhY2UoYW5kcm9pZF9kYXRhc3BhY2UgY2xpZW50RGF0YVNwYWNlKSBjb25zdCB7CisgICAgICAgICAgICBpZiAoKGRhdGFTcGFjZU92ZXJyaWRkZW4gJiYgKG9yaWdpbmFsRGF0YVNwYWNlID09IGNsaWVudERhdGFTcGFjZSkpIHx8CisgICAgICAgICAgICAgICAgICAgIChkYXRhU3BhY2UgPT0gY2xpZW50RGF0YVNwYWNlKSkgeworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICB9OworCiAgICAgLyoqCiAgICAgICogR2V0IGluZm9ybWF0aW9uIG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UKAogICAgICAgICAgICAgICAgIG1IaWRsRGV2aWNlLT5zZXRQcmV2aWV3V2luZG93KGJ1Zi5nZXQoKSA/IHRoaXMgOiBudWxscHRyKSk7Ci0gICAgfSBlbHNlIGlmIChtRGV2aWNlKSB7Ci0gICAgICAgIGlmIChtRGV2aWNlLT5vcHMtPnNldF9wcmV2aWV3X3dpbmRvdykgewotICAgICAgICAgICAgbVByZXZpZXdXaW5kb3cgPSBidWY7Ci0gICAgICAgICAgICBpZiAoYnVmICE9IG51bGxwdHIpIHsKLSAgICAgICAgICAgICAgICBpZiAobVByZXZpZXdTY2FsaW5nTW9kZSAhPSBOT1RfU0VUKSB7Ci0gICAgICAgICAgICAgICAgICAgIHNldFByZXZpZXdTY2FsaW5nTW9kZShtUHJldmlld1NjYWxpbmdNb2RlKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKG1QcmV2aWV3VHJhbnNmb3JtICE9IE5PVF9TRVQpIHsKLSAgICAgICAgICAgICAgICAgICAgc2V0UHJldmlld1RyYW5zZm9ybShtUHJldmlld1RyYW5zZm9ybSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgbUhhbFByZXZpZXdXaW5kb3cudXNlciA9IHRoaXM7Ci0gICAgICAgICAgICBBTE9HVigiJXMgJm1IYWxQcmV2aWV3V2luZG93ICVwIG1IYWxQcmV2aWV3V2luZG93LnVzZXIgJXAiLF9fRlVOQ1RJT05fXywKLSAgICAgICAgICAgICAgICAgICAgJm1IYWxQcmV2aWV3V2luZG93LCBtSGFsUHJldmlld1dpbmRvdy51c2VyKTsKLSAgICAgICAgICAgIHJldHVybiBtRGV2aWNlLT5vcHMtPnNldF9wcmV2aWV3X3dpbmRvdyhtRGV2aWNlLAotICAgICAgICAgICAgICAgICAgICBidWYuZ2V0KCkgPyAmbUhhbFByZXZpZXdXaW5kb3cubncgOiAwKTsKLSAgICAgICAgfQogICAgIH0KICAgICByZXR1cm4gSU5WQUxJRF9PUEVSQVRJT047CiB9CkBAIC00NzgsMTUgKzQ3MSw2IEBACiAgICAgbUNiVXNlciA9IHVzZXI7CiAKICAgICBBTE9HVigiJXMoJXMpIiwgX19GVU5DVElPTl9fLCBtTmFtZS5zdHJpbmcoKSk7Ci0KLSAgICBpZiAobURldmljZSAmJiBtRGV2aWNlLT5vcHMtPnNldF9jYWxsYmFja3MpIHsKLSAgICAgICAgbURldmljZS0+b3BzLT5zZXRfY2FsbGJhY2tzKG1EZXZpY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc05vdGlmeUNiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNEYXRhQ2IsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc0RhdGFDYlRpbWVzdGFtcCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzR2V0TWVtb3J5LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMpOwotICAgIH0KIH0KIAogdm9pZCBDYW1lcmFIYXJkd2FyZUludGVyZmFjZTo6ZW5hYmxlTXNnVHlwZShpbnQzMl90IG1zZ1R5cGUpCkBAIC00OTQsOCArNDc4LDYgQEAKICAgICBBTE9HVigiJXMoJXMpIiwgX19GVU5DVElPTl9fLCBtTmFtZS5zdHJpbmcoKSk7CiAgICAgaWYgKENDX0xJS0VMWShtSGlkbERldmljZSAhPSBudWxscHRyKSkgewogICAgICAgICBtSGlkbERldmljZS0+ZW5hYmxlTXNnVHlwZShtc2dUeXBlKTsKLSAgICB9IGVsc2UgaWYgKG1EZXZpY2UgJiYgbURldmljZS0+b3BzLT5lbmFibGVfbXNnX3R5cGUpIHsKLSAgICAgICAgbURldmljZS0+b3BzLT5lbmFibGVfbXNnX3R5cGUobURldmljZSwgbXNnVHlwZSk7CiAgICAgfQogfQogCkBAIC01MDQsOCArNDg2LDYgQEAKICAgICBBTE9HVigiJXMoJXMpIiwgX19GVU5DVElPTl9fLCBtTmFtZS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k7CiAgICAgfQogICAgIHJldHVybiBJTlZBTElEX09QRVJBVElPTjsKIH0KQEAgLTUzNyw4ICs1MTMsNiBAQAogICAgIEFMT0dWKCIlcyglcykiLCBfX0ZVTkNUSU9OX18sIG1OYW1lLnN0cmluZygpKTsKICAgICBpZiAoQ0NfTElLRUxZKG1IaWRsRGV2aWNlICE9IG51bGxwdHIpKSB7CiAgICAgICAgIG1IaWRsRGV2aWNlLT5zdG9wUHJldmlldygpOwotICAgIH0gZWxzZSBpZiAobURldmljZSAmJiBtRGV2aWNlLT5vcHMtPnN0b3BfcHJldmlldykgewotICAgICAgICBtRGV2aWNlLT5vcHMtPnN0b3BfcHJldmlldyhtRGV2aWNlKTsKICAgICB9CiB9CiAKQEAgLTU0Nyw4ICs1MjEsNiBAQAogICAgIEFMT0dWKCIlcyglcykiLCBfX0ZVTkNUSU9OX18sIG1OYW1lLnN0cmluZygpKTsKICAgICBpZiAoQ0NfTElLRUxZKG1IaWRsRGV2aWNlICE9IG51bGxwdHIpKSB7CiAgICAgICAgIHJldHVybiBtSGlkbERldmljZS0+cHJldmlld0VuYWJsZWQoKTsKLSAgICB9IGVsc2UgaWYgKG1EZXZpY2UgJiYgbURldmljZS0+b3BzLT5wcmV2aWV3X2VuYWJsZWQpIHsKLSAgICAgICAgcmV0dXJuIG1EZXZpY2UtPm9wcy0+cHJldmlld19lbmFibGVkKG1EZXZpY2UpOwogICAgIH0KICAgICByZXR1cm4gZmFsc2U7CiB9CkBAIC01NTksOCArNTMxLDYgQEAKICAgICBpZiAoQ0NfTElLRUxZKG1IaWRsRGV2aWNlICE9IG51bGxwdHIpKSB7CiAgICAgICAgIHJldHVybiBDYW1lcmFQcm92aWRlck1hbmFnZXI6Om1hcFRvU3RhdHVzVCgKICAgICAgICAgICAgICAgICBtSGlkbERldmljZS0+c3RvcmVNZXRhRGF0YUluQnVmZmVycyhlbmFibGUpKTsKLSAgICB9IGVsc2UgaWYgKG1EZXZpY2UgJiYgbURldmljZS0+b3BzL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NfTElLRUxZKG1IaWRsRGV2aWNlICE9IG51bGxwdHIpKSB7CiAgICAgICAgIHJldHVybiBtSGlkbERldmljZS0+cmVjb3JkaW5nRW5hYmxlZCgpOwotICAgIH0gZWxzZSBpZiAobURldmljZSAmJiBtRGV2aWNlLT5vcHMtPnJlY29yZGluZ19lbmFibGVkKSB7Ci0gICAgICAgIHJldHVybiBtRGV2aWNlLT5vcHMtPnJlY29yZGluZ19lbmFibGVkKG1EZXZpY2UpOwogICAgIH0KICAgICByZXR1cm4gZmFsc2U7CiB9CkBAIC02MjQsOSArNTg4LDYgQEAKICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgIG1IaWRsRGV2aWNlLT5yZWxlYXNlUmVjb3JkaW5nRnJhbWUoaGVhcElkLCBidWZmZXJJbmRleCk7CiAgICAgICAgIH0KLSAgICB9IGVsc2UgaWYgKG1EZXZpY2UgJiYgbURldmljZS0+b3BzLT5yZWxlYXNlX3JlY29yZGluZ19mcmFtZSkgewotICAgICAgICB2b2lkICpkYXRhID0gKCh1aW50OF90ICopaGVhcC0+YmFzZSgpKSArIG9mZnNldDsKLSAgICAgICAgcmV0dXJuIG1EZXZpY2UtPm9wcy0+cmVsZWFzZV9yZWNvcmRpbmdfZnJhbWUobURldmljZSwgZGF0YSk7CiAgICAgfQogfQogCkBAIC02NTMsOSArNjE0LDYgQEAKICAgICAgICAgICAgICAgICBBTE9HRSgiJXMgb25seSBzdXBwb3J0cyBWaWRlb05hdGl2ZUhhbmRsZU1ldGFkYXRhIG1vZGUiLCBfX0ZVTkNUSU9OX18pOwogICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIEFMT0dFKCJOb24gSElETCBtb2RlIGRvIG5vdCBzdXBwb3J0ICVzIiwgX19GVU5DVElPTl9fKTsKLSAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQogICAgIH0KIApAQCAtNjc0LDggKzYzMiw2I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k7CiAgICAgICAgIFN0cmluZzggdG1wKG91dFBhcmFtLmNfc3RyKCkpOwogICAgICAgICBwYXJtcy51bmZsYXR0ZW4odG1wKTsKLSAgICB9IGVsc2UgaWYgKG1EZXZpY2UgJiYgbURldmljZS0+b3BzLT5nZXRfcGFyYW1ldGVycykgewotICAgICAgICBjaGFyICp0ZW1wID0gbURldmljZS0+b3BzLT5nZXRfcGFyYW1ldGVycyhtRGV2aWNlKTsKLSAgICAgICAgU3RyaW5nOCBzdHJfcGFybXModGVtcCk7Ci0gICAgICAgIGlmIChtRGV2aWNlLT5vcHMtPnB1dF9wYXJhbWV0ZXJzKQotICAgICAgICAgICAgbURldmljZS0+b3BzLT5wdXRfcGFyYW1ldGVycyhtRGV2aWNlLCB0ZW1wKTsKLSAgICAgICAgZWxzZQotICAgICAgICAgICAgZnJlZSh0ZW1wKTsKLSAgICAgICAgcGFybXMudW5mbGF0dGVuKHN0cl9wYXJtcyk7CiAgICAgfQogICAgIHJldHVybiBwYXJtczsKIH0KQEAgLTc1OCw4ICs2OTgsNiBAQAogICAgIGlmIChDQ19MSUtFTFkobUhpZGxEZXZpY2UgIT0gbnVsbHB0cikpIHsKICAgICAgICAgcmV0dXJuIENhbWVyYVByb3ZpZGVyTWFuYWdlcjo6bWFwVG9TdGF0dXNUKAogICAgICAgICAgICAgICAgIG1IaWRsRGV2aWNlLT5zZW5kQ29tbWFuZCgoQ29tbWFuZFR5cGUpIGNtZCwgYXJnMSwgYXJnMikpOwotICAgIH0gZWxzZSBpZiAobURldmljZSAmJiBtRGV2aWNlLT5vcHMtPnNlbmRfY29tbWFuZCkgewotICAgICAgICByZXR1cm4gbURldmljZS0+b3BzLT5zZW5kX2NvbW1hbmQobURldmljZSwgY21kLCBhcmcxLCBhcmcyKTsKICAgICB9CiAgICAgcmV0dXJuIElOVkFMSURfT1BFUkFUSU9OOwogfQpAQCAtNzczLDggKzcxMSw2IEBACiAgICAgaWYgKENDX0xJS0VMWShtSGlkbERldmljZSAhPS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BAQAogICAgIGlmICghdmFsaWQoKSkgcmV0dXJuIElOVkFMSURfT1BFUkFUSU9OOwogICAgIHN0YXR1c190IHJlcyA9IE9LOwogCi0gICAgaWYgKG1IYWwzRGV2aWNlICE9IG51bGxwdHIpIHsKLSAgICAgICAgY29uc3QgY2FtZXJhX21ldGFkYXRhICpyOwotICAgICAgICByID0gbUhhbDNEZXZpY2UtPm9wcy0+Y29uc3RydWN0X2RlZmF1bHRfcmVxdWVzdF9zZXR0aW5ncygKLSAgICAgICAgICAgICAgICBtSGFsM0RldmljZSwgdGVtcGxhdGVJZCk7Ci0gICAgICAgIGlmIChyID09IG51bGxwdHIpIHJldHVybiBCQURfVkFMVUU7Ci0gICAgICAgICpyZXF1ZXN0VGVtcGxhdGUgPSBjbG9uZV9jYW1lcmFfbWV0YWRhdGEocik7Ci0gICAgICAgIGlmIChyZXF1ZXN0VGVtcGxhdGUgPT0gbnVsbHB0cikgewotICAgICAgICAgICAgQUxPR0UoIiVzOiBVbmFibGUgdG8gY2xvbmUgY2FtZXJhIG1ldGFkYXRhIHJlY2VpdmVkIGZyb20gSEFMIiwKLSAgICAgICAgICAgICAgICAgICAgX19GVU5DVElPTl9fKTsKLSAgICAgICAgICAgIHJldHVybiBJTlZBTElEX09QRVJBVElPTjsKLSAgICAgICAgfQotICAgIH0gZWxzZSB7Ci0gICAgICAgIGNvbW1vbjo6VjFfMDo6U3RhdHVzIHN0YXR1czsKLSAgICAgICAgUmVxdWVzdFRlbXBsYXRlIGlkOwotICAgICAgICBzd2l0Y2ggKHRlbXBsYXRlSWQpIHsKLSAgICAgICAgICAgIGNhc2UgQ0FNRVJBM19URU1QTEFURV9QUkVWSUVXOgotICAgICAgICAgICAgICAgIGlkID0gUmVxdWVzdFRlbXBsYXRlOjpQUkVWSUVXOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSBDQU1FUkEzX1RFTVBMQVRFX1NUSUxMX0NBUFRVUkU6Ci0gICAgICAgICAgICAgICAgaWQgPSBSZXF1ZXN0VGVtcGxhdGU6OlNUSUxMX0NBUFRVUkU7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIENBTUVSQTNfVEVNUExBVEVfVklERU9fUkVDT1JEOgotICAgICAgICAgICAgICAgIGlkID0gUmVxdWVzdFRlbXBsYXRlOjpWSURFT19SRUNPUkQ7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIENBTUVSQTNfVEVNUExBVEVfVklERU9fU05BUFNIT1Q6Ci0gICAgICAgICAgICAgICAgaWQgPSBSZXF1ZXN0VGVtcGxhdGU6OlZJREVPX1NOQVBTSE9UOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSBDQU1FUkEzX1RFTVBMQVRFX1pFUk9fU0hVVFRFUl9MQUc6Ci0gICAgICAgICAgICAgICAgaWQgPSBSZXF1ZXN0VGVtcGxhdGU6OlpFUk9fU0hVVFRFUl9MQUc7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIENBTUVSQTNfVEVNUExBVEVfTUFOVUFMOgotICAgICAgICAgICAgICAgIGlkID0gUmVxdWVzdFRlbXBsYXRlOjpNQU5VQUw7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgIC8vIFVua25vd24gdGVtcGxhdGUgSUQKLSAgICAgICAgICAgICAgICByZXR1cm4gQkFEX1ZBTFVFOwotICAgICAgICB9Ci0gICAgICAgIGF1dG8gZXJyID0gbUhpZGxTZXNzaW9uLT5jb25zdHJ1Y3REZWZhdWx0UmVxdWVzdFNldHRpbmdzKGlkLAotICAgICAgICAgICAgICAgIFsmc3RhdHVzLCAmcmVxdWVzdFRlbXBsYXRlXQotICAgICAgICAgICAgICAgIChjb21tb246OlYxXzA6OlN0YXR1cyBzLCBjb25zdCBkZXZpY2U6OlYzXzI6OkNhbWVyYU1ldGFkYXRhJiByZXF1ZXN0KSB7Ci0gICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IHM7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gY29tbW9uOjpWMV8wOjpTdGF0dXM6Ok9LKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBjYW1lcmFfbWV0YWRhdGEgKnIgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWludGVycHJldF9jYXN0PGNvbnN0IGNhbWVyYV9tZXRhZGF0YV90Kj4ocmVxdWVzdC5kYXRhKCkpOwotICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZV90IGV4cGVjdGVkU2l6ZSA9IHJlcXVlc3Quc2l6ZSgpOwotICAgICAgICAgICAgICAgICAgICAgICAgaW50IHJldCA9IHZhbGlkYXRlX2NhbWVyYV9tZXRhZGF0YV9zdHJ1Y3R1cmUociwgJmV4cGVjdGVkU2l6ZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAocmV0ID09IE9LIHx8IHJldCA9PSBDQU1FUkFfTUVUQURBVEFfVkFMSURBVElPTl9TSElGVEVEKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKnJlcXVlc3RUZW1wbGF0ZSA9IGNsb25lX2NhbWVyYV9tZXRhZGF0YShyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKnJlcXVlc3RUZW1wbGF0ZSA9PSBudWxscHRyKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFMT0dFKCIlczogVW5hYmxlIHRvIGNsb25lIGNhbWVyYSBtZXRhZGF0YSByZWNlaXZlZCBmcm9tIEhBTCIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19GVU5DVElPTl9fKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gY29tbW9uOjpWMV8wOjpTdGF0dXM6OklOVEVSTkFMX0VSUk9SOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgQUxPR0UoIiVzOiBNYWxmb3JtZWQgY2FtZXJhIG1ldGFkYXRhIHJlY2VpdmVkIGZyb20gSEFMIiwgX19GVU5DVElPTl9fKTsKKyAgICBjb21tb246OlYxXzA6OlN0YXR1cyBzdGF0dXM7CisgICAgUmVxdWVzdFRlbXBsYXRlIGlkOworICAgIHN3aXRjaCAodGVtcGxhdGVJZCkgeworICAgICAgICBjYXNlIENBTUVSQTNfVEVNUExBVEVfUFJFVklFVzoKKyAgICAgICAgICAgIGlkID0gUmVxdWVzdFRlbXBsYXRlOjpQUkVWSUVXOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgQ0FNRVJBM19URU1QTEFURV9TVElMTF9DQVBUVVJFOgorICAgICAgICAgICAgaWQgPSBSZXF1ZXN0VGVtcGxhdGU6OlNUSUxMX0NBUFRVUkU7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBDQU1FUkEzX1RFTVBMQVRFX1ZJREVPX1JFQ09SRDoKKyAgICAgICAgICAgIGlkID0gUmVxdWVzdFRlbXBsYXRlOjpWSURFT19SRUNPUkQ7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBDQU1FUkEzX1RFTVBMQVRFX1ZJREVPX1NOQVBTSE9UOgorICAgICAgICAgICAgaWQgPSBSZXF1ZXN0VGVtcGxhdGU6OlZJREVPX1NOQVBTSE9UOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgQ0FNRVJBM19URU1QTEFURV9aRVJPX1NIVVRURVJfTEFHOgorICAgICAgICAgICAgaWQgPSBSZXF1ZXN0VGVtcGxhdGU6OlpFUk9fU0hVVFRFUl9MQUc7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBDQU1FUkEzX1RFTVBMQVRFX01BTlVBTDoKKyAgICAgICAgICAgIGlkID0gUmVxdWVzdFRlbXBsYXRlOjpNQU5VQUw7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIC8vIFVua25vd24gdGVtcGxhdGUgSUQKKyAgICAgICAgICAgIHJldHVybiBCQURfVkFMVUU7CisgICAgfQorICAgIGF1dG8gZXJyID0gbUhpZGxTZXNzaW9uLT5jb25zdHJ1Y3REZWZhdWx0UmVxdWVzdFNldHRpbmdzKGlkLAorICAgICAgICAgICAgWyZzdGF0dXMsICZyZXF1ZXN0VGVtcGxhdGVdCisgICAgICAgICAgICAoY29tbW9uOjpWMV8wOjpTdGF0dXMgcywgY29uc3QgZGV2aWNlOjpWM18yOjpDYW1lcmFNZXRhZGF0YSYgcmVxdWVzdCkgeworICAgICAgICAgICAgICAgIHN0YXR1cyA9IHM7CisgICAgICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBjb21tb246OlYxXzA6OlN0YXR1czo6T0spIHsKKyAgICAgICAgICAgICAgICAgICAgY29uc3QgY2FtZXJhX21ldGFkYXRhICpyID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWludGVycHJldF9jYXN0PGNvbnN0IGNhbWVyYV9tZXRhZGF0YV90Kj4ocmVxdWVzdC5kYXRhKCkpOworICAgICAgICAgICAgICAgICAgICBzaXplX3QgZXhwZWN0ZWRTaXplID0gcmVxdWVzdC5zaXplKCk7CisgICAgICAgICAgICAgICAgICAgIGludCByZXQgPSB2YWxpZGF0ZV9jYW1lcmFfbWV0YWRhdGFfc3RydWN0dXJlKHIsICZleHBlY3RlZFNpemUpOworICAgICAgICAgICAgICAgICAgICBpZiAocmV0ID09IE9LIHx8IHJldCA9PSBDQU1FUkFfTUVUQURBVEFfVkFMSURBVElPTl9TSElGVEVEKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAqcmVxdWVzdFRlbXBsYXRlID0gY2xvbmVfY2FtZXJhX21ldGFkYXRhKHIpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCpyZXF1ZXN0VGVtcGxhdGUgPT0gbnVsbHB0cikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFMT0dFKCIlczogVW5hYmxlIHRvIGNsb25lIGNhbWVyYSBtZXRhZGF0YSByZWNlaXZlZCBmcm9tIEhBTCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX0ZVTkNUSU9OX18pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGNvbW1vbjo6VjFfMDo6U3RhdHVzOjpJTlRFUk5BTF9FUlJPUjsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIEFMT0dFKCIlczogTWFsZm9ybWVkIGNhbWVyYSBtZXRhZGF0YSByZWNlaXZlZCBmcm9tIEhBTCIsIF9fRlVOQ1RJT05fXyk7CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBjb21tb246OlYxXzA6OlN0YXR1czo6SU5URVJOQUxfRVJST1I7CiAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9KTsKLSAgICAgICAgaWYgKCFlcnIuaXNPaygpKSB7Ci0gICAgICAgICAgICBBTE9HRSgiJXM6IFRyYW5zYWN0aW9uIGVycm9yOiAlcyIsIF9fRlVOQ1RJT05fXywgZXJyLmRlc2NyaXB0aW9uKCkuY19zdHIoKSk7Ci0gICAgICAgICAgICByZXMgPSBERUFEX09CSkVDVDsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHJlcyA9IENhbWVyYVByb3ZpZGVyTWFuYWdlcjo6bWFwVG9TdGF0dXNUKHN0YXR1cyk7Ci0gICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICBpZiAoIWVyci5pc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mVhbTo6Y2FzdChzcmMpOworICAgICAgICBjYW0zc3RyZWFtLT5zZXRCdWZmZXJGcmVlZExpc3RlbmVyKHRoaXMpOworICAgICAgICBpbnQgc3RyZWFtSWQgPSBjYW0zc3RyZWFtLT5nZXRJZCgpOworICAgICAgICBTdHJlYW1UeXBlIHN0cmVhbVR5cGU7CisgICAgICAgIHN3aXRjaCAoc3JjLT5zdHJlYW1fdHlwZSkgeworICAgICAgICAgICAgY2FzZSBDQU1FUkEzX1NUUkVBTV9PVVRQVVQ6CisgICAgICAgICAgICAgICAgc3RyZWFtVHlwZSA9IFN0cmVhbVR5cGU6Ok9VVFBVVDsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgQ0FNRVJBM19TVFJFQU1fSU5QVVQ6CisgICAgICAgICAgICAgICAgc3RyZWFtVHlwZSA9IFN0cmVhbVR5cGU6OklOUFVUOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICBBTE9HRSgiJXM6IFN0cmVhbSAlZDogVW5zdXBwb3J0ZWQgc3RyZWFtIHR5cGUgJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgX19GVU5DVElPTl9fLCBzdHJlYW1JZCwgY29uZmlnLT5zdHJlYW1zW2ldLT5zdHJlYW1fdHlwZSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIEJBRF9WQUxVRTsKKyAgICAgICAgfQorICAgICAgICBkc3QuaWQgPSBzdHJlYW1JZDsKKyAgICAgICAgZHN0LnN0cmVhbVR5cGUgPSBzdHJlYW1UeXBlOworICAgICAgICBkc3Qud2lkdGggPSBzcmMtPndpZHRoOworICAgICAgICBkc3QuaGVpZ2h0ID0gc3JjLT5oZWlnaHQ7CisgICAgICAgIGRzdC5mb3JtYXQgPSBtYXBUb1BpeGVsRm9ybWF0KHNyYy0+Zm9ybWF0KTsKKyAgICAgICAgZHN0LnVzYWdlID0gbWFwVG9Db25zdW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0cmVhbXNbaV07Ci0gICAgICAgICAgICBjYW1lcmEzX3N0cmVhbV90ICpzcmMgPSBjb25maWctPnN0cmVhbXNbaV07Ci0KLSAgICAgICAgICAgIENhbWVyYTNTdHJlYW0qIGNhbTNzdHJlYW0gPSBDYW1lcmEzU3RyZWFtOjpjYXN0KHNyYyk7Ci0gICAgICAgICAgICBjYW0zc3RyZWFtLT5zZXRCdWZmZXJGcmVlZExpc3RlbmVyKHRoaXMpOwotICAgICAgICAgICAgaW50IHN0cmVhbUlkID0gY2FtM3N0cmVhbS0+Z2V0SWQoKTsKLSAgICAgICAgICAgIFN0cmVhbVR5cGUgc3RyZWFtVHlwZTsKLSAgICAgICAgICAgIHN3aXRjaCAoc3JjLT5zdHJlYW1fdHlwZSkgewotICAgICAgICAgICAgICAgIGNhc2UgQ0FNRVJBM19TVFJFQU1fT1VUUFVUOgotICAgICAgICAgICAgICAgICAgICBzdHJlYW1UeXBlID0gU3RyZWFtVHlwZTo6T1VUUFVUOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIENBTUVSQTNfU1RSRUFNX0lOUFVUOgotICAgICAgICAgICAgICAgICAgICBzdHJlYW1UeXBlID0gU3RyZWFtVHlwZTo6SU5QVVQ7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dFKCIlczogU3RyZWFtICVkOiBVbnN1cHBvcnRlZCBzdHJlYW0gdHlwZSAlZCIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgX19GVU5DVElPTl9fLCBzdHJlYW1JZCwgY29uZmlnLT5zdHJlYW1zW2ldLT5zdHJlYW1fdHlwZSk7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBCQURfVkFMVUU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBkc3QuaWQgPSBzdHJlYW1JZDsKLSAgICAgICAgICAgIG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lIHYzLjMgZm9yIHRoZSBjYWxsCisgICAgICAgIEFMT0dWKCIlczogdjMuMyBkZXZpY2UgZm91bmQiLCBfX0ZVTkNUSU9OX18pOworICAgICAgICBhdXRvIGVyciA9IGhpZGxTZXNzaW9uXzNfMy0+Y29uZmlndXJlU3RyZWFtc18zXzMocmVxdWVzdGVkQ29uZmlndXJhdGlvbiwKKyAgICAgICAgICAgIFsmc3RhdHVzLCAmZmluYWxDb25maWd1cmF0aW9uXQorICAgICAgICAgICAgKGNvbW1vbjo6VjFfMDo6U3RhdHVzIHMsIGNvbnN0IGRldmljZTo6VjNfMzo6SGFsU3RyZWFtQ29uZmlndXJhdGlvbiYgaGFsQ29uZmlndXJhdGlvbikgeworICAgICAgICAgICAgICAgIGZpbmFsQ29uZmlndXJhdGlvbiA9IGhhbENvbmZpZ3VyYXRpb247CisgICAgICAgICAgICAgICAgc3RhdHVzID0gczsKKyAgICAgICAgICAgIH0pOworICAgICAgICBpZiAoIWVyci5pc09rKCkpIHsKKyAgICAgICAgICAgIEFMT0dFKCIlczogVHJhbnNhY3Rpb24gZXJyb3I6ICVzIiwgX19GVU5DVElPTl9fLCBlcnIuZGVzY3JpcHRpb24oKS5jX3N0cigpKTsKKyAgICAgICAgICAgIHJldHVybiBERUFEX09CSkVDVDsKICAgICAgICAgfQotICAgICAgICAvLyByZW1vdmUgQnVmZmVySWRNYXAgZm9yIGRlbGV0ZWQgc3RyZWFtcwotICAgICAgICBmb3IoYXV0byBpdCA9IG1CdWZmZXJJZE1hcHMuYmVnaW4oKTsgaXQgIT0gbUJ1ZmZlcklkTWFwcy5lbmQoKTspIHsKLSAgICAgICAgICAgIGludCBzdHJlYW1JZCA9IGl0LT5maXJzdDsKLSAgICAgICAgICAgIGJvb2wgYWN0aXZlID0gYWN0aXZlU3RyZWFtcy5jb3VudChzdHJlYW1JZCkgPiAwOwotICAgICAgICAgICAgaWYgKCFhY3RpdmUpIHsKLSAgICAgICAgICAgICAgICBpdCA9IG1CdWZmZXJJZE1hcHMuZXJhc2UoaXQpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICArK2l0OwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgcmVzID0gbWFwVG9TdHJlYW1Db25maWd1cmF0aW9uTW9kZSgKLSAgICAgICAgICAgICAgICAoY2FtZXJhM19zdHJlYW1fY29uZmlndXJhdGlvbl9tb2RlX3QpIGNvbmZpZy0+b3BlcmF0aW9uX21vZGUsCi0gICAgICAgICAgICAgICAgLypvdXQqLyAmcmVxdWVzdGVkQ29uZmlndXJhdGlvbi5vcGVyYXRpb25Nb2RlKTsKLSAgICAgICAgaWYgKHJlcyAhPSBPSykgewotICAgICAgICAgICAgcmV0dXJuIHJlczsKLSAgICAgICAgfQotCi0gICAgICAgIC8vIEludm9rZSBjb25maWd1cmVTdHJlYW1zCi0KLSAgICAgICAgSGFsU3RyZWFtQ29uZmlndXJhdGlvbiBmaW5hbENvbmZpZ3VyYXRpb247Ci0gICAgICAgIGNvbW1vbjo6VjFfMDo6U3RhdHVzIHN0YXR1czsKKyAgICB9IGVsc2UgeworICAgICAgICAvLyBXZSBkb24ndDsgdXNlIHYzLjIgY2FsbCBhbmQgY29uc3RydWN0IGEgdjMuMyBIYWxTdHJlYW1Db25maWd1cmF0aW9uCisgICAgICAgIEFMT0dWKCIlczogdjMuMiBkZXZpY2UgZm91bmQiLCBfX0ZVTkNUSU9OX18pOworICAgICAgICBIYWxTdHJlYW1Db25maWd1cmF0aW9uIGZpbmFsQ29uZmlndXJhdGlvbl8zXzI7CiAgICAgICAgIGF1dG8gZXJyID0gbUhpZGxTZXNzaW9uLT5jb25maWd1cmVTdHJlYW1zKHJlcXVlc3RlZENvbmZpZ3VyYXRpb24sCi0gICAgICAgICAgICAgICAgWyZzdGF0dXMsICZmaW5hbENvbmZpZ3VyYXRpb25dCisgICAgICAgICAgICAgICAgWyZzdGF0dXMsICZmaW5hbENvbmZpZ3VyYXRpb25fM18yXQogICAgICAgICAgICAgICAgIChjb21tb246OlYxXzA6OlN0YXR1cyBzLCBjb25zdCBIYWxTdHJlYW1Db25maWd1cmF0aW9uJiBoYWxDb25maWd1cmF0aW9uKSB7Ci0gICAgICAgICAgICAgICAgICAgIGZpbmFsQ29uZmlndXJhdGlvbiA9IGhhbENvbmZpZ3VyYXRpb247CisgICAgICAgICAgICAgICAgICAgIGZpbmFsQ29uZmlndXJhdGlvbl8zXzIgPSBoYWxDb25maWd1cmF0aW9uOwogICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBzOwogICAgICAgICAgICAgICAgIH0pOwogICAgICAgICBpZiAoIWVyci5pc09rKCkpIHsKICAgICAgICAgICAgIEFMT0dFKCIlczogVHJhbnNhY3Rpb24gZXJyb3I6ICVzIiwgX19GVU5DVElPTl9fLCBlcnIuZGVzY3JpcHRpb24oKS5jX3N0cigpKTsKICAgICAgICAgICAgIHJldHVybiBERUFEX09CSkVDVDsKICAgICAgICAgfQorICAgICAgICBmaW5hbENvbmZpZ3VyYXRpb24uc3RyZWFtcy5yZXNpemUoZmluYWxDb25maWd1cmF0aW9uXzNfMi5zdHJlYW1zLnNpemUoKSk7CisgICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgZmluYWxDb25maWd1cmF0aW9uXzNfMi5zdHJlYW1zLnNpemUoKTsgaSsrKSB7CisgICAgICAgICAgICBmaW5hbENvbmZpZ3VyYXRpb24uc3RyZWFtc1tpXS52M18yID0gZmluYWxDb25maWd1cmF0aW9uXzNfMi5zdHJlYW1zW2ldOworICAgICAgICAgICAgZmluYWxDb25maWd1cmF0aW9uLnN0cmVhbXNbaV0ub3ZlcnJpZGVEYXRhU3BhY2UgPQorICAgICAgICAgICAgICAgICAgICByZXF1ZXN0ZWRDb25maWd1cmF0aW9uLnN0cmVhbXNbaV0uZGF0YVNwYWNlOworICAgICAgICB9CisgICAgfQogCi0gICAgICAgIGlmIChzdGF0dXMgIT0gY29tbW9uOjpWMV8wOjpTdGF0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gICAgICAgIGNhbWVyYTNfc3RyZWFtX3QgKmRzdCA9IGNvbmZpZy0+c3RyZWFtc1tpXTsKLSAgICAgICAgICAgIGludCBzdHJlYW1JZCA9IENhbWVyYTNTdHJlYW06OmNhc3QoZHN0KS0+Z2V0SWQoKTsKLQotICAgICAgICAgICAgLy8gU3RhcnQgc2NhbiBhdCBpLCB3aXRoIHRoZSBhc3N1bXB0aW9uIHRoYXQgdGhlIHN0cmVhbSBvcmRlciBtYXRjaGVzCi0gICAgICAgICAgICBzaXplX3QgcmVhbElkeCA9IGk7Ci0gICAgICAgICAgICBib29sIGZvdW5kID0gZmFsc2U7Ci0gICAgICAgICAgICBmb3IgKHNpemVfdCBpZHggPSAwOyBpZHggPCBmaW5hbENvbmZpZ3VyYXRpb24uc3RyZWFtcy5zaXplKCk7IGlkeCsrKSB7Ci0gICAgICAgICAgICAgICAgaWYgKGZpbmFsQ29uZmlndXJhdGlvbi5zdHJlYW1zW3JlYWxJZHhdLmlkID09IHN0cmVhbUlkKSB7Ci0gICAgICAgICAgICAgICAgICAgIGZvdW5kID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHJlYWxJZHggPSAocmVhbElkeCA+PSBmaW5hbENvbmZpZ3VyYXRpb24uc3RyZWFtcy5zaXplKCkpID8gMCA6IHJlYWxJZHggKyAxOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKCFmb3VuZCkgewotICAgICAgICAgICAgICAgIEFMT0dFKCIlczogU3RyZWFtICVkIG5vdCBmb3VuZCBpbiBzdHJlYW0gY29uZmlndXJhdGlvbiByZXNwb25zZSBmcm9tIEhBTCIsCisgICAgICAgIGlmIChkc3QtPnN0cmVhbV90eXBlID09IENBTUVSQTNfU1RSRUFNX0lOUFVUKSB7CisgICAgICAgICAgICBpZiAoc3JjLnYzXzIucHJvZHVjZXJVc2FnZSAhPSAwKSB7CisgICAgICAgICAgICAgICAgQUxPR0UoIiVzOiBTdHJlYW0gJWQ6IElOUFVUIHN0cmVhbXMgbXVzdCBoYXZlIDAgZm9yIHByb2R1Y2VyIHVzYWdlIiwKICAgICAgICAgICAgICAgICAgICAgICAgIF9fRlVOQ1RJT05fXywgc3RyZWFtSWQpOwogICAgICAgICAgICAgICAgIHJldHVybiBJTlZBTElEX09QRVJBVElPTjsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIEhhbFN0cmVhbSAmc3JjID0gZmluYWxDb25maWd1cmF0aW9uLnN0cmVhbXNbcmVhbElkeF07Ci0KLSAgICAgICAgICAgIGludCBvdmVycmlkZUZvcm1hdCA9IG1hcFRvRnJhbWV3b3JrRm9ybWF0KHNyYy5vdmVycmlkZUZvcm1hdCk7Ci0gICAgICAgICAgICBpZiAoZHN0LT5mb3JtYXQgIT0gSEFMX1BJWEVMX0ZPUk1BVF9JTVBMRU1FTlRBVElPTl9ERUZJTkVEKSB7Ci0gICAgICAgICAgICAgICAgaWYgKGRzdC0+Zm9ybWF0ICE9IG92ZXJyaWRlRm9ybWF0KSB7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dFKCIlczogU3RyZWFtICVkOiBGb3JtYXQgb3ZlcnJpZGUgbm90IGFsbG93ZWQgZm9yIGZvcm1hdCAweCV4IiwgX19GVU5DVElPTl9fLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbUlkLCBkc3QtPmZvcm1hdCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAvLyBPdmVycmlkZSBhbGxvd2VkIHdpdGggSU1QTEVNRU5UQVRJT05fREVGSU5FRAotICAgICAgICAgICAgICAgIGRzdC0+Zm9ybWF0ID0gb3ZlcnJpZGVGb3JtYXQ7CisgICAgICAgICAgICBkc3RTdHJlYW0tPnNldFVzYWdlKAorICAgICAgICAgICAgICAgICAgICBtYXBDb25zdW1lclRvRnJhbWV3b3JrVXNhZ2Uoc3JjLnYzXzIuY29uc3VtZXJVc2FnZSkpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLy8gT1VUUFVUCisgICAgICAgICAgICBpZiAoc3JjLnYzXzIuY29uc3VtZXJVc2FnZSAhPSAwKSB7CisgICAgICAgICAgICAgICAgQUxPR0UoIiVzOiBTdHJlYW0gJWQ6IE9VVFBVVCBzdHJlYW1zIG11c3QgaGF2ZSAwIGZvciBjb25zdW1lciB1c2FnZSIsCisgICAgICAgICAgICAgICAgICAgICAgICBfX0ZVTkNUSU9OX18sIHN0cmVhbUlkKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gSU5WQUxJRF9PUEVSQVRJT047CiAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChkc3QtPnN0cmVhbV90eXBlID09IENBTUVSQTNfU1RSRUFNX0lOUFVUKSB7Ci0gICAgICAgICAgICAgICAgaWYgKHNyYy5wcm9kdWNlclVzYWdlICE9IDApIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR0UoIiVzOiBTdHJlYW0gJWQ6IElOUFVUIHN0cmVhbXMgbXVzdCBoYXZlIDAgZm9yIHByb2R1Y2VyIHVzYWdlIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX0ZVTkNUSU9OX18sIHN0cmVhbUlkKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIElOVkFMSURfT1BFUkFUSU9OOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBkc3QtPnVzYWdlID0gbWFwQ29uc3VtZXJUb0ZyYW1ld29ya1VzYWdlKHNyYy5jb25zdW1lclVzYWdlKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgLy8gT1VUUFVUCi0gICAgICAgICAgICAgICAgaWYgKHNyYy5jb25zdW1lclVzYWdlICE9IDApIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR0UoIiVzOiBTdHJlYW0gJWQ6IE9VVFBVVCB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vZgorICAgICAgICAvLyBSRVFVRVNUL1JFU1VMVCBlcnJvci4KKyAgICAgICAgYm9vbCBza2lwUmVzdWx0TWV0YWRhdGE7CisKICAgICAgICAgLy8gRGVmYXVsdCBjb25zdHJ1Y3RvciBuZWVkZWQgYnkgS2V5ZWRWZWN0b3IKICAgICAgICAgSW5GbGlnaHRSZXF1ZXN0KCkgOgogICAgICAgICAgICAgICAgIHNodXR0ZXJUaW1lc3RhbXAoMCksCkBAIC04OTUsNyArOTA2LDggQEAKICAgICAgICAgICAgICAgICBudW1CdWZmZXJzTGVmdCgwKSwKICAgICAgICAgICAgICAgICBoYXNJbnB1dEJ1ZmZlcihmYWxzZSksCiAgICAgICAgICAgICAgICAgaGFzQ2FsbGJhY2sodHJ1ZSksCi0gICAgICAgICAgICAgICAgbWF4RXhwZWN0ZWREdXJhdGlvbihrRGVmYXVsdEV4cGVjdGVkRHVyYXRpb24pIHsKKyAgICAgICAgICAgICAgICBtYXhFeHBlY3RlZER1cmF0aW9uKGtEZWZhdWx0RXhwZWN0ZWREdXJhdGlvbiksCisgICAgICAgICAgICAgICAgc2tpcFJlc3VsdE1ldGFkYXRhKGZhbHNlKSB7CiAgICAgICAgIH0KIAogICAgICAgICBJbkZsaWdodFJlcXVlc3QoaW50IG51bUJ1ZmZlcnMsIENhcHR1cmVSZXN1bHRFeHRyYXMgZXh0cmFzLCBib29sIGhhc0lucHV0LApAQCAtOTA4LDcgKzkyMCw4IEBACiAgICAgICAgICAgICAgICAgcmVzdWx0RXh0cmFzKGV4dHJhcyksCiAgICAgICAgICAgICAgICAgaGFzSW5wdXRCdWZmZXIoaGFzSW5wdXQpLAogICAgICAgICAgICAgICAgIGhhc0NhbGxiYWNrKGhhc0FwcENhbGxiYWNrKSwKLSAgICAgICAgICAgICAgICBtYXhFeHBlY3RlZER1cmF0aW9uKG1heER1cmF0aW9uKSB7CisgICAgICAgICAgICAgICAgbWF4RXhwZWN0ZWREdXJhdGlvbihtYXhEdXJhdGlvbiksCis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mRyb2lkX2RhdGFzcGFjZSBkYXRhU3BhY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbWVyYTNfc3RyZWFtX3JvdGF0aW9uX3Qgcm90YXRpb24sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGNvbnN1bWVyVXNhZ2UsIG5zZWNzX3QgdGltZXN0YW1wT2Zmc2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50NjRfdCBjb25zdW1lclVzYWdlLCBuc2Vjc190IHRpbWVzdGFtcE9mZnNldCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNldElkKSA6CiAgICAgICAgIENhbWVyYTNJT1N0cmVhbUJhc2UoaWQsIHR5cGUsIHdpZHRoLCBoZWlnaHQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyptYXhTaXplKi8wLApAQCAtMTM4LDYgKzE0Miw3IEBACiAgICAgICAgIG1Vc2VCdWZmZXJNYW5hZ2VyKGZhbHNlKSwKICAgICAgICAgbVRpbWVzdGFtcE9mZnNldCh0aW1lc3RhbXBPZmZzZXQpLAogICAgICAgICBtQ29uc3VtZXJVc2FnZShjb25zdW1lclVzYWdlKSwKKyAgICAgICAgbURyb3BCdWZmZXJzKGZhbHNlKSwKICAgICAgICAgbURlcXVldWVCdWZmZXJMYXRlbmN5KGtEZXF1ZXVlTGF0ZW5jeUJpblNpemUpIHsKIAogICAgIGlmIChzZXRJZCA+IENBTUVSQTNfU1RSRUFNX1NFVF9JRF9JTlZBTElEKSB7CkBAIC0yMjYsOSArMjMxLDE0IEBACiAgICAgLyoqCiAgICAgICogUmV0dXJuIGJ1ZmZlciBiYWNrIHRvIEFOYXRpdmVXaW5kb3cKICAgICAgKi8KLSAgICBpZiAoYnVmZmVyLnN0YXR1cyA9PSBDQU1FUkEzX0JVRkZFUl9TVEFUVVNfRVJST1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b24oIi1oZWxwIik7CiAgICAgU3RyaW5nMTYgb25seU9wdGlvbigiLW9ubHkiKTsKLSAgICBjb25zdCBjaGFyICpvbmx5ID0gTlVMTDsKKyAgICBBU3RyaW5nIG9ubHk7CiAgICAgaW50IG4gPSBhcmdzLnNpemUoKTsKKwogICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbjsgaSsrKSB7CiAgICAgICAgIFN0cmluZzggbXlhcmcoYXJnc1tpXSk7CiAgICAgICAgIGlmIChhcmdzW2ldID09IGNsZWFyT3B0aW9uKSB7CiAgICAgICAgICAgICBjbGVhciA9IHRydWU7CiAgICAgICAgIH0gZWxzZSBpZiAoYXJnc1tpXSA9PSBzdW1tYXJ5T3B0aW9uKSB7CiAgICAgICAgICAgICBzdW1tYXJ5ID0gdHJ1ZTsKKyAgICAgICAgfSBlbHNlIGlmIChhcmdzW2ldID09IHByb3RvT3B0aW9uKSB7CisgICAgICAgICAgICBpKys7CisgICAgICAgICAgICBpZiAoaSA8IG4pIHsKKyAgICAgICAgICAgICAgICBTdHJpbmc4IHZhbHVlKGFyZ3NbaV0pOworICAgICAgICAgICAgICAgIGludCBwcm90byA9IE1lZGlhQW5hbHl0aWNzSXRlbTo6UFJPVE9fVjA7ICAgICAgIC8vIGRlZmF1bHQgdG8gb3JpZ2luYWwKKyAgICAgICAgICAgICAgICBjaGFyICplbmRwOworICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIgKnAgPSB2YWx1ZS5zdHJpbmcoKTsKKyAgICAgICAgICAgICAgICBwcm90byA9IHN0cnRvbChwLCAmZW5kcCwgMTApOworICAgICAgICAgICAgICAgIGlmIChlbmRwICE9IHAgfHwgKmVuZHAgPT0gJ1wwJykgeworICAgICAgICAgICAgICAgICAgICBpZiAocHJvdG8gPCBNZWRpYUFuYWx5dGljc0l0ZW06OlBST1RPX0ZJUlNUKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBwcm90byA9IE1lZGlhQW5hbHl0aWNzSXRlbTo6UFJPVE9fRklSU1Q7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocHJvdG8gPiBNZWRpYUFuYWx5dGljc0l0ZW06OlBST1RPX0xBU1QpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHByb3RvID0gTWVkaWFBbmFseXRpY3NJdGVtOjpQUk9UT19MQVNUOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIG1EdW1wUHJvdG8gPSBwcm90bzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CiAgICAgICAgIH0gZWxzZSBpZiAoYXJnc1tpXSA9PSBzaW5jZU9wdGlvbikgewogICAgICAgICAgICAgaSsrOwogICAgICAgICAgICAgaWYgKGkgPCBuKSB7CkBAIC0zNjgsMTggKzQzMCwxMiBAQAogICAgICAgICAgICAgaSsrOwogICAgICAgICAgICAgaWYgKGkgPCBuKSB7CiAgICAgICAgICAgICAgICAgU3RyaW5nOCB2YWx1ZShhcmdzW2ldKTsKLSAgICAgICAgICAgICAgICBjb25zdCBjaGFyICpwID0gdmFsdWUuc3RyaW5nKCk7Ci0gICAgICAgICAgICAgICAgY2hhciAqcSA9IHN0cmR1cChwKTsKLSAgICAgICAgICAgICAgICBpZiAocSAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChvbmx5ICE9IE5VTEwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGZyZWUoKHZvaWQqKW9ubHkpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgb25seSA9IHE7Ci0gICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIG9ubHkgPSB2YWx1ZS5zdHJpbmcoKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfSBlbHNlIGlmIChhcmdzW2ldID09IGhlbHBPcHRpb24pIHsKICAgICAgICAgICAgIHJlc3VsdC5hcHBlbmQoIlJlY29nbml6ZWQgcGFyYW1ldGVyczpcbiIpOwogICAgICAgICAgICAg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FwcGluZzsKKyAgICBtYXBwaW5nLnVpZCA9ICgtMSk7CisKKyAgICBzc2l6ZV90IGkgPSBtUGtnTWFwcGluZ3MuaW5kZXhPZktleSh1aWQpOworICAgIGlmIChpID49IDApIHsKKyAgICAgICAgbWFwcGluZyA9IG1Qa2dNYXBwaW5ncy52YWx1ZUF0KGkpOworICAgICAgICBBTE9HVigiRXhwaXJhdGlvbj8gdWlkICVkIGV4cGlyYXRpb24gJSIgUFJJZDY0ICIgbm93ICUiIFBSSWQ2NCwKKyAgICAgICAgICAgICAgdWlkLCBtYXBwaW5nLmV4cGlyYXRpb24sIG5vdyk7CisgICAgICAgIGlmIChtYXBwaW5nLmV4cGlyYXRpb24gPCBub3cpIHsKKyAgICAgICAgICAgIC8vIHB1cmdlIG91ciBjdXJyZW50IGVudHJ5IGFuZCByZS1xdWVyeQorICAgICAgICAgICAgQUxPR1YoImVudHJ5IGZvciB1aWQgJWQgZXhwaXJlZCwgbm93PSAlIiBQUklkNjQgIiIsIHVpZCwgbm93KTsKKyAgICAgICAgICAgIG1Qa2dNYXBwaW5ncy5yZW1vdmVJdGVtc0F0KGksIDEpOworICAgICAgICAgICAgLy8gY291bGQgY2hlYXQgYW5kIHVzZSBhIGdvdG8gYmFjayB0byB0aGUgdG9wIG9mIHRoZSByb3V0aW5lLgorICAgICAgICAgICAgLy8gYSBnb29kIGNvbXBpbGVyIHNob3VsZCByZWNvZ25pemUgdGhlIGxvY2FsIHRhaWwgcmVjdXJzaW9uLi4uCisgICAgICAgICAgICByZXR1cm4gc2V0UGtnSW5mbyhpdGVtLCB1aWQsIHNldE5hbWUsIHNldFZlcnNpb24pOworICAgICAgICB9CisgICAgfSBlbHNlIHsKKyAgICAgICAgQVN0cmluZyBwa2c7CisgICAgICAgIHN0ZDo6c3RyaW5nIGluc3RhbGxlciA9ICIiOworICAgICAgICBpbnQzMl90IHZlcnNpb25Db2RlID0gMDsKKworICAgICAgICBzdHJ1Y3QgcGFzc3dkICpwdyA9IGdldHB3dWlkKHVpZCk7CisgICAgICAgIGlmIChwdykgeworICAgICAgICAgICAgcGtnID0gcHctPnB3X25hbWU7CisgICAgICAgIH0KKworICAgICAgICAvLyBmaW5kIHRoZSBwcm9wZXIgdmFsdWUgLS0gc2hvdWxkIHdlIGNhY2hlIHRoaXMgYmluZGVyPz8KKworICAgICAgICBzcDxJQmluZGVyPiBiaW5kZXIgPSBOVUxMOworICAgICAgICBzcDxJU2VydmljZU1hbmFnZXI+IHNtID0gZGVmYXVsdFNlcnZpY2VNYW5hZ2VyKCk7CisgICAgICAgIGlmIChzbSA9PSBOVUxMKSB7CisgICAgICAgICAgICBBTE9HRSgiZGVmYXVsdFNlcnZpY2VNYW5hZ2VyIGZhaWxlZCIpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgYmluZGVyID0gc20tPmdldFNlcnZpY2UoU3RyaW5nMTYoInBhY2thZ2VfbmF0aXZlIikpOworICAgICAgICAgICAgaWYgKGJpbmRlciA9PSBOVUxMKSB7CisgICAgICAgICAgICAgICAgQUxPR0UoImdldFNlcnZpY2UgcGFja2FnZV9uYXRpdmUgZmFpbGVkIik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpZiAoYmluZGVyICE9IE5VTEwpIHsKKyAgICAgICAgICAgIHNwPElQYWNrYWdlTWFuYWdlck5hdGl2ZT4gcGFja2FnZV9tZ3IgPSBpbnRlcmZhY2VfY2FzdDxJUGFja2FnZU1hbmFnZXJOYXRpdmU+KGJpbmRlcik7CisgICAgICAgICAgICBiaW5kZXI6OlN0YXR1cyBzdGF0dXM7CisKKyAgICAgICAgICAgIHN0ZDo6dmVjdG9yPGludD4gdWlkczsKKyAgICAgICAgICAgIHN0ZDo6dmVjdG9yPHN0ZDo6c3RyaW5nPiBuYW1lczsKKworICAgICAgICAgICAgdWlkcy5wdXNoX2JhY2sodWlkKTsKKworICAgICAgICAgICAgc3RhdHVzID0gcGFja2FnZV9tZ3ItPmdldE5hbWVzRm9yVWlkcyh1aWRzLCAmbmFtZXMpOworICAgICAgICAgICAgaWYgKCFzdGF0dXMuaXNPaygpKSB7CisgICAgICAgICAgICAgICAgQUxPR0UoInBhY2thZ2VfbmF0aXZlOjpnZXROYW1lc0ZvclVpZHMgZmFpbGVkOiAlcyIsCisgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzLmV4Y2VwdGlvbk1lc3NhZ2UoKS5jX3N0cigpKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgaWYgKCFuYW1lc1swXS5lbXB0eSgpKSB7CisgICAgICAgICAgICAgICAgICAgIHBrZyA9IG5hbWVzWzBdLmNfc3RyKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBzdHJpcCBhbnkgbGVhZGluZyAic2hhcmVkOiIgc3RyaW5ncyB0aGF0IGNhbWUgYmFjaworICAgICAgICAgICAgaWYgKHBrZy5zdGFydHNXaXRoKCJzaGFyZWQ6IikpIHsKKyAgICAgICAgICAgICAgICBwa2cuZXJhc2UoMCwgNyk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIGRldGVybWluZSBob3cgcGtnIHdhcyBpbnN0YWxsZWQgYW5kIHRoZSB2ZXJzaW9uQ29kZQorICAgICAgICAgICAgLy8KKyAgICAgICAgICAgIGlmIChwa2cuZW1wdHkoKSkgeworICAgICAgICAgICAgICAgIC8vIG5vIG5hbWUgZm9yIHVzIHRvIG1hbmFnZQorICAgICAgICAgICAgfSBlbHNlIGlmIChzdHJjaHIocGtnLmNfc3RyKCksICcuJykgPT0gTlVMTCkgeworICAgICAgICAgICAgICAgIC8vIG5vdCBvZiBmb3JtICdjb20ud2hhdGV2ZXIuLi4nOyBhc3N1bWUgaW50ZXJuYWwgYW5kIG9rCisgICAgICAgICAgICB9IGVsc2UgaWYgKHN0cm5jbXAocGtnLmNfc3RyKCksICJhbmRyb2lkLiIsIDgpID09IDApIHsKKyAgICAgICAgICAgICAgICAvLyBhbmRyb2lkLiogcGFja2FnZXMgYXJlIGFzc3VtZWQgZmluZQorICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBTdHJpbmcxNiBwa2dOYW1lMTYocGtnLmNfc3RyKCkpOworICAgICAgICAgICAgICAgIHN0YXR1cyA9IHBhY2thZ2VfbWdyLT5nZXRJbnN0YWxsZXJGb3JQYWNrYWdlKHBrZ05hbWUxNiwgJmluc3RhbGxlcik7CisgICAgICAgICAgICAgICAgaWYgKCFzdGF0dXMuaXNPaygpKSB7CisgICAgICAgICAgICAgICAgICAgIEFMT0dFKCJwYWNrYWdlX25hdGl2ZTo6Z2V0SW5zdGFsbGVyRm9yUGFja2FnZSBmYWlsZWQ6ICVzIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzLmV4Y2VwdGlvbk1lc3NhZ2UoKS5jX3N0cigpKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyBza2lwIGlmIHdlIGRpZG4ndCBnZXQgYW4gaW5zdGFsbGVyCisgICAgICAgICAgICAgICAgaWYgKHN0YXR1cy5pc09rKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gcGFja2FnZV9tZ3ItPmdldFZlcnNpb25Db2RlRm9yUGFja2FnZShwa2dOYW1lMTYsICZ2ZXJzaW9uQ29kZSk7CisgICAgICAgICAgICAgICAgICAgIGlmICghc3RhdHVzLmlzT2soKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgQUxPR0UoInBhY2thZ2VfbmF0aXZlOjpnZXRWZXJzaW9uQ29kZUZvclBhY2thZ2UgZmFpbGVkOiAlcyIsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cy5leGNlcHRpb25NZXNzYWdlKCkuY19zdHIoKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisKKworICAgICAgICAgICAgICAgIEFMT0dWKCJwYWNrYWdlICclcycgaW5zdGFsbGVkIGJ5ICclcycgdmVyc2lvbmNvZGUgJWQgLyAlMDh4IiwKKyAgICAgICAgICAgICAgICAgICAgICBwa2cuY19zdHIoKSwgaW5zdGFsbGVyLmNfc3RyKCksIHZlcnNpb25Db2RlLCB2ZXJzaW9uQ29kZSk7CisKKyAgICAgICAgICAgICAgICBpZiAoc3RybmNtcChpbnN0YWxsZXIuY19zdHIoKSwgImNvbS5hbmRyb2lkLiIsIDEyKSA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBmcm9tIHBsYXkgc3RvcmUsIHdlIGtlZXAgaW5mbworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc3RybmNtcChpbnN0YWxsZXIuY19zdHIoKSwgImNvbS5nb29nbGUuIiwgMTEpID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNvbWUgZ29vZ2xlIHNvdXJjZSwgd2Uga2VlcCBpbmZvCisgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChzdHJjbXAoaW5zdGFsbGVyLmNfc3RyKCksICJwcmVsb2FkIikgPT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gcHJlbG9hZHMsIHdlIGtlZXAgdGhlIGluZm8KKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGluc3RhbGxlci5jX3N0cigpWzBdID09ICdcMCcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNpZGVsb2FkIChubyBpbnN0YWxsZXIpOyBkbyBub3QgcmVwb3J0CisgICAgICAgICAgICAgICAgICAgICAgICBwa2cgPSAiIjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZlcnNpb25Db2RlID0gMDsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gdW5rbm93biBpbnN0YWxsZXI7IGRvIG5vdCByZXBvcnQKKyAgICAgICAgICAgICAgICAgICAgICAgIHBrZyA9ICIiOworICAgICAgICAgICAgICAgICAgICAgICAgdmVyc2lvbkNvZGUgPSAwOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8vIGFkZCBpdCB0byB0aGUgbWFwLCB0byBzYXZlIGEgc3Vic2VxdWVudCBsb29rdXAKKyAgICAgICAgaWYgKCFwa2cuZW1wdHkoKSkgeworICAgICAgICAgICAgTXV0ZXg6OkF1dG9sb2NrIF9sKG1Mb2NrX21hcHBpbmdzKTsKKyAgICAgICAgICAgIEFMT0dWKCJBZGRpbmcgdWlkICVkIHBrZyAnJXMnIiwgdWlkLCBwa2cuY19zdHIoKSk7CisgICAgICAgICAgICBzc2l6ZV90IGkgPSBtUGtnTWFwcGluZ3MuaW5kZXhPZktleSh1aWQpOworICAgICAgICAgICAgaWYgKGkgPCAwKSB7CisgICAgICAgICAgICAgICAgbWFwcGluZy51aWQgPSB1aWQ7CisgICAgICAgICAgICAgICAgbWFwcGluZy5wa2cgPSBwa2c7CisgICAgICAgICAgICAgICAgbWFwcGluZy5pbnN0YWxsZXIgPSBpbnN0YWxsZXIuY19zdHIoKTsKKyAgICAgICAgICAgICAgICBtYXBwaW5nLnZlcnNpb25Db2RlID0gdmVyc2lvbkNvZGU7CisgICAgICAgICAgICAgICAgbWFwcGluZy5leHBpcmF0aW9uID0gbm93ICsgUEtHX0VYUElSQVRJT05fTlM7CisgICAgICAgICAgICAgICAgQUxPR1YoImV4cGlyYXRpb24gZm9yIHVpZCAlZCBzZXQgdG8gJSIgUFJJZDY0ICIiLCB1aWQsIG1hcHBpbmcuZXhwaXJhdGlvbik7CisKKyAgICAgICAgICAgICAgICBtUGtnTWFwcGluZ3MuYWRkKHVpZCwgbWFwcGluZyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBpZiAobWFwcGluZy51aWQgIT0gKHVpZF90KSgtMSkpIHsKKyAgICAgICAgaWYgKHNldE5hbWUpIHsKKyAgICAgICAgICAgIGl0ZW0tPnNldFBrZ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dGVtLT5zZXRJbnQzMigiYWdncmVnYXRlZCIsMSk7CisgICAgICAgICAgICBtZXJnZVJlY29yZCgqbml0ZW0sICppdGVtKTsKKyAgICAgICAgICAgIG1TdW1tYXJpZXMtPnB1c2hfYmFjayhuaXRlbSk7CiAgICAgfSBlbHNlIHsKICAgICAgICAgICAgIEFMT0dWKCJpbmNyZW1lbnQgZXhpc3RpbmcgcmVjb3JkIik7Ci0gICAgICAgICAgICAoKml0KS0+YWRkSW50MzIoImNvdW50IiwxKTsKKyAgICAgICAgICAgICgqaXQpLT5hZGRJbnQzMigiYWdncmVnYXRlZCIsMSk7CiAgICAgICAgICAgICBtZXJnZVJlY29yZCgqKCppdCksICppdGVtKTsKICAgICB9CiB9CkBAIC0xNjgsNiArMTY4LDcxIEBACiAgICAgcmV0dXJuOwogfQogCisvLyBrZWVwIHNvbWUgc3RhdHMgZm9yIHRoaW5nczogc3VtcywgY291bnRzLCBzdGFuZGFyZCBkZXZpYXRpb24KKy8vIHRoZSBpbnRlZ2VyIHZlcnNpb24gLS0gYWxsIG9mIHRoZXNlIHBpZWNlcyBhcmUgaW4gNjQgYml0cwordm9pZCBNZXRyaWNzU3VtbWFyaXplcjo6bWluTWF4VmFyNjQoTWVkaWFBbmFseXRpY3NJdGVtICZzdW1tYXRpb24sIGNvbnN0IGNoYXIgKmtleSwgaW50NjRfdCB2YWx1ZSkgeworICAgIGlmIChrZXkgPT0gTlVMTCkKKyAgICAgICAgcmV0dXJuOworICAgIGludCBsZW4gPSBzdHJsZW4oa2V5KSArIDMyOworICAgIGNoYXIgKnRtcEtleSA9IChjaGFyICopbWFsbG9jKGxlbik7CisKKyAgICBpZiAodG1wS2V5ID09IE5VTEwpIHsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIC8vIE4gLSBjb3VudCBvZiBzYW1wbGVzCisgICAgc25wcmludGYodG1wS2V5LCBsZW4sICIlcy5uIiwga2V5KTsKKyAgICBzdW1tYXRpb24uYWRkSW50NjQodG1wS2V5LCAxKTsKKworICAgIC8vIHplcm8gLSBjb3VudCBvZiBzYW1wbGVzIHRoYXQgYXJlIHplcm8KKyAgICBpZiAodmFsdWUgPT0gMCkgeworICAgICAgICBzbnByaW50Zih0bXBLZXksIGxlbiwgIiVzLnplcm8iLCBrZXkpOworICAgICAgICBpbnQ2NF90IHplcm8gPSAwOworICAgICAgICAodm9pZCkgc3VtbWF0aW9uLmdldEludDY0KHRtcEtleSwmemVybyk7CisgICAgICAgIHplcm8rKzsKKyAgICAgICAgc3VtbWF0aW9uLnNldEludDY0KHRtcEtleSwgemVybyk7CisgICAgfQorCisgICAgLy8gbWluCisgICAgc25wcmludGYodG1wS2V5LCBsZW4sICIlcy5taW4iLCBrZXkpOworICAgIGludDY0X3QgbWluID0gdmFsdWU7CisgICAgaWYgKHN1bW1hdGlvbi5nZXRJbnQ2NCh0bXBLZXksJm1pbikpIHsKKyAgICAgICAgaWYgKG1pbiA+IHZhbHVlKSB7CisgICAgICAgICAgICBzdW1tYXRpb24uc2V0SW50NjQodG1wS2V5LCB2YWx1ZSk7CisgICAgICAgIH0KKyAgICB9IGVsc2UgeworICAgICAgICBzdW1tYXRpb24uc2V0SW50NjQodG1wS2V5LCB2YWx1ZSk7CisgICAgfQorCisgICAgLy8gbWF4CisgICAgc25wcmludGYodG1wS2V5LCBsZW4sICIlcy5tYXgiLCBrZXkpOworICAgIGludDY0X3QgbWF4ID0gdmFsdWU7CisgICAgaWYgKHN1bW1hdGlvbi5nZXRJbnQ2NCh0bXBLZXksJm1heCkpIHsKKyAgICAgICAgaWYgKG1heCA8IHZhbHVlKSB7CisgICAgICAgICAgICBzdW1tYXRpb24uc2V0SW50NjQodG1wS2V5LCB2YWx1ZSk7CisgICAgICAgIH0KKyAgICB9IGVsc2UgeworICAgICAgICBzdW1tYXRpb24uc2V0SW50NjQodG1wS2V5LCB2YWx1ZSk7CisgICAgfQorCisgICAgLy8gY29tcG9uZW50cyBmb3IgbWVhbiwgc3RkZGV2OworICAgIC8v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AgcmV0dXJuIGZhbHNlOworICAgIH0KKwogICAgIC8vIHRoaXMgY2FuIGJlIG1hZGUgYmV0dGVyLgogICAgIGZvcihzaXplX3QgaT0wO2k8c2luZ2xlLT5tUHJvcENvdW50O2krKykgewogICAgICAgICBNZWRpYUFuYWx5dGljc0l0ZW06OlByb3AgKnByb3AxID0gJihzaW5nbGUtPm1Qcm9wc1tpXSk7CiAgICAgICAgIGNvbnN0IGNoYXIgKmF0dHJOYW1lID0gcHJvcDEtPm1OYW1lOwotICAgICAgICBBTE9HVigiY29tcGFyZSBvbiBhdHRyICclcyciLCBhdHRyTmFtZSk7CiAKICAgICAgICAgLy8gaXMgaXQgc29tZXRoaW5nIHdlIHNob3VsZCBpZ25vcmUKICAgICAgICAgaWYgKGlnbm9yYWJsZSAhPSBOVUxMKSB7CiAgICAgICAgICAgICBjb25zdCBjaGFyICoqaWcgPSBpZ25vcmFibGU7Ci0gICAgICAgICAgICB3aGlsZSAoKmlnKSB7CisgICAgICAgICAgICBmb3IgKDsqaWc7IGlnKyspIHsKICAgICAgICAgICAgICAgICBpZiAoc3RyY21wKCppZywgYXR0ck5hbWUpID09IDApIHsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlnKys7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAoKmlnKSB7CiAgICAgICAgICAgICAgICAgQUxPR1YoIndlIGRvbid0IG1pbmQgdGhhdCBpdCBoYXMgYXR0ciAnJXMnIiwgYXR0ck5hbWUpOwpAQCAtMjE4LDI5ICsyODYsNDIgQEAKICAgICAgICAgfQogICAgICAgICBzd2l0Y2ggKHByb3AxLT5tVHlwZSkgewogICAgICAgICAgICAgY2FzZSBNZWRpYUFuYWx5dGljc0l0ZW06OmtUeXBlSW50MzI6Ci0gICAgICAgICAgICAgICAgaWYgKHByb3AxLT51LmludDMyVmFsdWUgIT0gcHJvcDItPnUuaW50MzJWYWx1ZSkKKyAgICAgICAgICAgICAgICBpZiAocHJvcDEtPnUuaW50MzJWYWx1ZSAhPSBwcm9wMi0+dS5pbnQzMlZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgIEFMT0dWKCJtaXNtYXRjaCB2YWx1ZXMiKTsKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgIGNhc2UgTWVkaWFBbmFseXRpY3NJdGVtOjprVHlwZUludDY0OgotICAgICAgICAgICAgICAgIGlmIChwcm9wMS0+dS5pbnQ2NFZhbHVlICE9IHByb3AyLT51LmludDY0VmFsdWUpCisgICAgICAgICAgICAgICAgaWYgKHByb3AxLT51LmludDY0VmFsdWUgIT0gcHJvcDItPnUuaW50NjRWYWx1ZSkgeworICAgICAgICAgICAgICAgICAgICBBTE9HVigibWlzbWF0Y2ggdmFsdWVzIik7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICBjYXNlIE1lZGlhQW5hbHl0aWNzSXRlbTo6a1R5cGVEb3VibGU6CiAgICAgICAgICAgICAgICAgLy8gWFhYOiB3YXRjaCBvdXQgZm9yIGZsb2F0aW5nIHBvaW50IGNvbXBhcmlzb25zIQotICAgICAgICAgICAgICAgIGlmIChwcm9wMS0+dS5kb3VibGVWYWx1ZSAhPSBwcm9wMi0+dS5kb3VibGVWYWx1ZSkKKyAgICAgICAgICAgICAgICBpZiAocHJvcDEtPnUuZG91YmxlVmFsdWUgIT0gcHJvcDItPnUuZG91YmxlVmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgQUxPR1YoIm1pc21hdGNoIHZhbHVlcyIpOwogICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgY2FzZSBNZWRpYUFuYWx5dGljc0l0ZW06OmtUeXBlQ1N0cmluZzoKLSAgICAgICAgICAgICAgICBpZiAoc3RyY21wKHByb3AxLT51LkNTdHJpbmdWYWx1ZSwgcHJvcDItPnUuQ1N0cmluZ1ZhbHVlKSAhPSAwKQorICAgICAgICAgICAgICAgIGlmIChzdHJjbXAocHJvcDEtPnUuQ1N0cmluZ1ZhbHVlLCBwcm9wMi0+dS5DU3RyaW5nVmFsdWUpICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgQUxPR1YoIm1pc21hdGNoIHZhbHVlcyIpOwogICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgY2FzZSBNZWRpYUFuYWx5dGljc0l0ZW06OmtUeXBlUmF0ZToKLSAgICAgICAgICAgICAgICBpZiAocHJvcDEtPnUucmF0ZS5jb3VudCAhPSBwcm9wMi0+dS5yYXRlLmNvdW50KQorICAgICAgICAgICAgICAgIGlmIChwcm9wMS0+dS5yYXRlLmNvdW50ICE9IHByb3AyLT51LnJhdGUuY291bnQpIHsKKyAgICAgICAgICAgICAgICAgICAgQUxPR1YoIm1pc21hdGNoIHZhbHVlcyIpOwogICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICAgICAgaWYgKHByb3AxLT51LnJhdGUuZHVyYXRpb24gIT0gcHJvcDItPnUucmF0ZS5kdXJhdGlvbikKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKHByb3AxLT51LnJhdGUuZHVyYXRpb24gIT0gcHJvcDItPnUucmF0ZS5kdXJhdGlvbikgeworICAgICAgICAgICAgICAgICAgICBBTE9HVigibWlzbWF0Y2ggdmFsdWVzIik7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICA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iOyB9CiAKLSAgICB2aXJ0dWFsIHNwPElPTVg+ICAgIGdldE9NWCgpOworICAgIHZpcnR1YWwgc3A8SU9NWD4gICAgICBnZXRPTVgoKTsKIAotICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgb25UcmFuc2FjdCh1aW50MzJfdCBjb2RlLCBjb25zdCBQYXJjZWwmIGRhdGEsIFBhcmNlbCogcmVwbHksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGZsYWdzKTsKKyAgICB2aXJ0dWFsIHNwPElPTVhTdG9yZT4gZ2V0T01YU3RvcmUoKTsKKworICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgICBvblRyYW5zYWN0KHVpbnQzMl90IGNvZGUsIGNvbnN0IFBhcmNlbCYgZGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQYXJjZWwqIHJlcGx5LCB1aW50MzJfdCBmbGFncyk7CiAKIHByaXZhdGU6Ci0gICAgTXV0ZXggICAgICAgICAgICAgICBtTG9jazsKLSAgICBzcDxJT01YPiAgICAgICAgICAgIG1PTVg7CisgICAgTXV0ZXggICAgICAgICAgICAgICAgIG1PTVhMb2NrOworICAgIHNwPElPTVg+ICAgICAgICAgICAgICBtT01YOworICAgIE11dGV4ICAgICAgICAgICAgICAgICBtT01YU3RvcmVMb2NrOworICAgIHNwPElPTVhTdG9yZT4gICAgICAgICBtT01YU3RvcmU7CiB9OwogCiB9ICAgLy8gbmFtZXNwYWNlIGFuZHJvaWQKZGlmZiAtLWdpdCBhL3NlcnZpY2VzL21lZGlhY29kZWMvT1dORVJTIGIvc2VydmljZXMvbWVkaWFjb2RlYy9PV05FUlMKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uYzcxNmNjZQotLS0gL2Rldi9udWxsCisrKyBiL3NlcnZpY2VzL21lZGlhY29kZWMvT1dORVJTCkBAIC0wLDAgKzEsMiBAQAoramVmZnZAZ29vZ2xl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RW5kcG9pbnRfbCgKKyAgICAgICAgY29uc3QgQUF1ZGlvU3RyZWFtQ29uZmlndXJhdGlvbiAmY29uZmlndXJhdGlvbikgeworICAgIHNwPEFBdWRpb1NlcnZpY2VFbmRwb2ludFNoYXJlZD4gZW5kcG9pbnQ7CisgICAgZm9yIChjb25zdCBhdXRvIGVwICA6IG1TaGFyZWRTdHJlYW1zKSB7CisgICAgICAgIGlmIChlcC0+bWF0Y2hlcyhjb25maWd1cmF0aW9uKSkgeworICAgICAgICAgICAgZW5kcG9pbnQgPSBlcDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorCisgICAgQUxPR1YoIkFBdWRpb0VuZHBvaW50TWFuYWdlci5maW5kU2hhcmVkRW5kcG9pbnRfbCgpLCBmb3VuZCAlcCBmb3IgZGV2aWNlID0gJWQiLAorICAgICAgICAgIGVuZHBvaW50LmdldCgpLCBjb25maWd1cmF0aW9uLmdldERldmljZUlkKCkpOworICAgIHJldHVybiBlbmRwb2ludDsKK30KKworc3A8QUF1ZGlvU2VydmljZUVuZHBvaW50PiBBQXVkaW9FbmRwb2ludE1hbmFnZXI6Om9wZW5FbmRwb2ludChBQXVkaW9TZXJ2aWNlICZhdWRpb1NlcnZpY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgYWF1ZGlvOjpBQXVkaW9TdHJlYW1SZXF1ZXN0ICZyZXF1ZXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFhdWRpb19zaGFyaW5nX21vZGVfdCBzaGFyaW5nTW9kZSkgeworICAgIGlmIChzaGFyaW5nTW9kZSA9PSBBQVVESU9fU0hBUklOR19NT0RFX0VYQ0xVU0lWRSkgeworICAgICAgICByZXR1cm4gb3BlbkV4Y2x1c2l2ZUVuZHBvaW50KGF1ZGlvU2VydmljZSwgcmVxdWVzdCk7CisgICAgfSBlbHNlIHsKKyAgICAgICAgcmV0dXJuIG9wZW5T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9pbnRNTUFQPiBlbmRwb2ludE1NYXAgPSBuZXcgQUF1ZGlvU2VydmljZUVuZHBvaW50TU1BUCgpOworICAgICAgICBBTE9HRSgiQUF1ZGlvRW5kcG9pbnRNYW5hZ2VyLm9wZW5FbmRwb2ludCgpLGNyZWF0ZWQgTU1BUCAlcCIsIGVuZHBvaW50TU1hcC5nZXQoKSk7CisgICAgICAgIGVuZHBvaW50ID0gZW5kcG9pbnRNTWFwOwogCi0KLSAgICBzd2l0Y2ggKGRpcmVjdGlvbikgewotICAgICAgICBjYXNlIEFBVURJT19ESVJFQ1RJT05fSU5QVVQ6Ci0gICAgICAgICAgICBmb3IgKEFBdWRpb1NlcnZpY2VFbmRwb2ludCAqZXAgOiBtSW5wdXRzKSB7Ci0gICAgICAgICAgICAgICAgaWYgKGVwLT5tYXRjaGVzKGNvbmZpZ3VyYXRpb24pKSB7Ci0gICAgICAgICAgICAgICAgICAgIGVuZHBvaW50ID0gZXA7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIEFBVURJT19ESVJFQ1RJT05fT1VUUFVUOgotICAgICAgICAgICAgZm9yIChBQXVkaW9TZXJ2aWNlRW5kcG9pbnQgKmVwIDogbU91dHB1dHMpIHsKLSAgICAgICAgICAgICAgICBpZiAoZXAtPm1hdGNoZXMoY29uZmlndXJhdGlvbikpIHsKLSAgICAgICAgICAgICAgICAgICAgZW5kcG9pbnQgPSBlcDsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICBhc3NlcnQoZmFsc2UpOyAvLyBUaGVyZSBhcmUgb25seSB0d28gcG9zc2libGUgZGlyZWN0aW9ucy4KLSAgICAgICAgICAgIGJyZW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lvX3Jlc3VsdF90IHJlc3VsdCA9IGVuZHBvaW50LT5vcGVuKHJlcXVlc3QpOworICAgICAgICBpZiAocmVzdWx0ICE9IEFBVURJT19PSykgeworICAgICAgICAgICAgQUxPR0UoIkFBdWRpb0VuZHBvaW50TWFuYWdlci5vcGVuRW5kcG9pbnQoKSwgb3BlbiBmYWlsZWQiKTsKKyAgICAgICAgICAgIGVuZHBvaW50LmNsZWFyKCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBtRXhjbHVzaXZlU3RyZWFtcy5wdXNoX2JhY2soZW5kcG9pbnRNTWFwKTsKICAgICAgICAgfQogCi0gICAgICAgIGlmIChlbmRwb2ludCAhPSBudWxscHRyKSB7Ci0gICAgICAgICAgICBhYXVkaW9fcmVzdWx0X3QgcmVzdWx0ID0gZW5kcG9pbnQtPm9wZW4oY29uZmlndXJhdGlvbik7Ci0gICAgICAgICAgICBpZiAocmVzdWx0ICE9IEFBVURJT19PSykgewotICAgICAgICAgICAgICAgIEFMT0dFKCJBQXVkaW9FbmRwb2ludE1hbmFnZXI6OmZpbmRFbmRwb2ludCgpLCBvcGVuIGZhaWxlZCIpOwotICAgICAgICAgICAgICAgIGRlbGV0ZSBlbmRwb2ludDsKLSAgICAgICAgICAgICAgICBlbmRwb2ludCA9IG51bGxwdHI7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHN3aXRjaChkaXJlY3Rpb24pIHsKLSAgICAgICAgICAgICAgICAgICAgY2FzZSBBQVVESU9fRElSRUNUSU9OX0lOUFVUOgotICAgICAgICAgICAgICAgICAgICAgICAgbUlucHV0cy5wdXNoX2JhY2soY2FwdHVyZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgY2FzZSBBQVVESU9fRElSRUNUSU9OX09VVFBVVDoKLSAgICAgICAgICAgICAgICAgICAgICAgIG1PdXRwdXRzLnB1c2hfYmFjayhwbGF5ZXIpOwotICA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1ZXN0KTsKKyAgICAgICAgICAgIGlmIChyZXN1bHQgIT0gQUFVRElPX09LKSB7CisgICAgICAgICAgICAgICAgQUxPR0UoIkFBdWRpb0VuZHBvaW50TWFuYWdlci5vcGVuRW5kcG9pbnQoKSwgb3BlbiBmYWlsZWQiKTsKKyAgICAgICAgICAgICAgICBlbmRwb2ludC5jbGVhcigpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBtU2hhcmVkU3RyZWFtcy5wdXNoX2JhY2soZW5kcG9pbnQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIEFMT0dEKCJBQXVkaW9FbmRwb2ludE1hbmFnZXIub3BlblNoYXJlZEVuZHBvaW50KCksIGNyZWF0ZWQgJXAgZm9yIGRldmljZSA9ICVkLCBkaXIgPSAlZCIsCisgICAgICAgICAgICAgIGVuZHBvaW50LmdldCgpLCBjb25maWd1cmF0aW9uLmdldERldmljZUlkKCksIChpbnQpZGlyZWN0aW9uKTsKKyAgICAgICAgSVBDVGhyZWFkU3RhdGU6OnNlbGYoKS0+cmVzdG9yZUNhbGxpbmdJZGVudGl0eSh0b2tlbik7CisgICAgfQorCisgICAgaWYgKGVuZHBvaW50LmdldCgpICE9IG51bGxwdHIpIHsKKyAgICAgICAgLy8gSW5jcmVtZW50IHRoZSByZWZlcmVuY2UgY291bnQgdW5kZXIgdGhpcyBsb2NrLgorICAgICAgICBlbmRwb2ludC0+c2V0T3BlbkNvdW50KGVuZHBvaW50LT5nZXRPcGVuQ291bnQoKSArIDEpOworICAgIH0KKyAgICByZXR1cm4gZW5kcG9pbnQ7Cit9CisKK3ZvaWQgQUF1ZGlvRW5kcG9pbnRNYW5hZ2VyOjpjbG9zZUVuZHBvaW50KHNwPEFBdWRpb1NlcnZpY2VFbmRwb2ludD5zZXJ2aWNlRW5kcG9pbnQpIHsKKyAgICBpZiAoc2VydmljZUVuZHBvaW50LT5nZXRTaGFyaW5nTW9kZSgpID09IEFBVURJT19TSEFS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lckJ1cnN0KCkpOworICAgICAgICAgICAgZm9yIChjb25zdCBhdXRvIGNsaWVudFN0cmVhbSA6IG1SZWdpc3RlcmVkU3RyZWFtcykgeworICAgICAgICAgICAgICAgIGlmIChjbGllbnRTdHJlYW0tPmlzUnVubmluZygpKSB7CisgICAgICAgICAgICAgICAgICAgIGludDY0X3QgY2xpZW50RnJhbWVzV3JpdHRlbiA9IDA7CisgICAgICAgICAgICAgICAgICAgIHNwPEFBdWRpb1NlcnZpY2VTdHJlYW1TaGFyZWQ+IHN0cmVhbVNoYXJlZCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGljX2Nhc3Q8QUF1ZGlvU2VydmljZVN0cmVhbVNoYXJlZCAqPihjbGllbnRTdHJlYW0uZ2V0KCkpOworCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIExvY2sgdGhlIEF1ZGlvRmlmbyB0byBwcm90ZWN0IGFnYWluc3QgY2xvc2UuCisgICAgICAgICAgICAgICAgICAgICAgICBzdGQ6OmxvY2tfZ3VhcmQgPHN0ZDo6bXV0ZXg+IGxvY2soc3RyZWFtU2hhcmVkLT5nZXRBdWRpb0RhdGFRdWV1ZUxvY2soKSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIEZpZm9CdWZmZXIgKmZpZm8gPSBzdHJlYW1TaGFyZWQtPmdldEF1ZGlvRGF0YUZpZm9CdWZmZXJfbCgpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpZm8gIT0gbnVsbHB0cikgeworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gRGV0ZXJtaW5lIG9mZnNldCBiZXR3ZWVuIGZyYW1lUG9zaXRpb24gaW4gY2xpZW50J3Mgc3RyZWFtCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdnMgdGhlIHVuZGVybHlpbmcgTU1BUCBzdHJlYW0uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xpZW50RnJhbWVzV3JpdHRlbiA9IGZpZm8tPmdldFdyaXRlQ291bnRlcigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRoZXJlIGFyZSB0d28gaW5kaWNlcyB0aGF0IHJlZmVyIHRvIHRoZSBzYW1lIGZyYW1lLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludDY0X3QgcG9zaXRpb25PZmZzZXQgPSBtbWFwRnJhbWVzUmVhZCAtIGNsaWVudEZyYW1lc1dyaXR0ZW47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtU2hhcmVkLT5zZXRUaW1lc3RhbXBQb3NpdGlvbk9mZnNldChwb3NpdGlvbk9mZnNldCk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlmby0+Z2V0Rmlmb0NvbnRyb2xsZXJCYXNlKCktPmdldEVtcHR5RnJhbWVzQXZhaWxhYmxlKCkgPAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXRGcmFtZXNQZXJCdXJzdCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuZGVyZmxvd0NvdW50Kys7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmlmby0+d3JpdGUobURpc3RyaWJ1dGlvbkJ1ZmZlciwgZ2V0RnJhbWVzUGVyQnVyc3QoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsaWVudEZyYW1lc1dyaXR0ZW4gPSBmaWZvLT5nZXRXcml0ZUNvdW50ZXIoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBzaGFyZWRTdHJlYW0tPm1hcmtUcmFuc2ZlclRpbWUoQXVkaW9DbG9jazo6Z2V0TmFub3NlY29uZHMoKSk7CisKKyA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ICIgPDwgbUF1ZGlvRGF0YUZpbGVEZXNjcmlwdG9yOworICAgIHJlc3VsdCA8PCAiXG4iOworCisgICAgcmVzdWx0IDw8ICIgICAgSFcgT2Zmc2V0IE1pY3JvczogICAgICIgPDwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdldEhhcmR3YXJlVGltZU9mZnNldE5hbm9zKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8gQUFVRElPX05BTk9TX1BFUl9NSUNST1NFQ09ORCkgPDwgIlxuIjsKKworICAgIHJlc3VsdCA8PCBBQXVkaW9TZXJ2aWNlRW5kcG9pbnQ6OmR1bXAoKTsKKyAgICByZXR1cm4gcmVzdWx0LnN0cigpOworfQorCithYXVkaW9fcmVzdWx0X3QgQUF1ZGlvU2VydmljZUVuZHBvaW50TU1BUDo6b3Blbihjb25zdCBhYXVkaW86OkFBdWRpb1N0cmVhbVJlcXVlc3QgJnJlcXVlc3QpIHsKKyAgICBhYXVkaW9fcmVzdWx0X3QgcmVzdWx0ID0gQUFVRElPX09LOworICAgIGNvbnN0IGF1ZGlvX2F0dHJpYnV0ZXNfdCBhdHRyaWJ1dGVzID0geworICAgICAgICAgICAgLmNvbnRlbnRfdHlwZSA9IEFVRElPX0NPTlRFTlRfVFlQRV9NVVNJQywKKyAgICAgICAgICAgIC51c2FnZSA9IEFVRElPX1VTQUdFX01FRElBLAorICAgICAgICAgICAgLnNvdXJjZSA9IEFVRElPX1NPVVJDRV9WT0lDRV9SRUNPR05JVElPTiwKKyAgICAgICAgICAgIC5mbGFncyA9IEFVRElPX0ZMQUdfTE9XX0xBVEVOQ1ksCisgICAgICAgICAgICAudGFncyA9ICIiCisgICAgfTsKKyAgICBhdWRpb19jb25maWdfYmFzZV90IGNvbmZpZzsKKyAgICBhdWRpb19wb3J0X2hhbmRsZV90IGRldmljZUlkOworCisgICAgaW50MzJfdCBidXJzdE1pbk1pY3JvcyA9IEFBdWRpb1Byb3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GlvU2FtcGxlUmF0ZTsKKworICAgIGludDMyX3QgYWF1ZGlvU2FtcGxlc1BlckZyYW1lID0gZ2V0U2FtcGxlc1BlckZyYW1lKCk7CisKKyAgICBhYXVkaW9fZGlyZWN0aW9uX3QgZGlyZWN0aW9uID0gZ2V0RGlyZWN0aW9uKCk7CisgICAgaWYgKGRpcmVjdGlvbiA9PSBBQVVESU9fRElSRUNUSU9OX09VVFBVVCkgeworICAgICAgICBjb25maWcuY2hhbm5lbF9tYXNrID0gKGFhdWRpb1NhbXBsZXNQZXJGcmFtZSA9PSBBQVVESU9fVU5TUEVDSUZJRUQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IEFVRElPX0NIQU5ORUxfT1VUX1NURVJFTworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBhdWRpb19jaGFubmVsX291dF9tYXNrX2Zyb21fY291bnQoYWF1ZGlvU2FtcGxlc1BlckZyYW1lKTsKKyAgICAgICAgbUhhcmR3YXJlVGltZU9mZnNldE5hbm9zID0gT1VUUFVUX0VTVElNQVRFRF9IQVJEV0FSRV9PRkZTRVRfTkFOT1M7IC8vIGZyYW1lcyBhdCBEQUMgbGF0ZXIKKworICAgIH0gZWxzZSBpZiAoZGlyZWN0aW9uID09IEFBVURJT19ESVJFQ1RJT05fSU5QVVQpIHsKKyAgICAgICAgY29uZmlnLmNoYW5uZWxfbWFzayA9ICAoYWF1ZGlvU2FtcGxlc1BlckZyYW1lID09IEFBVURJT19VTlNQRUNJRklFRCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IEFVRElPX0NIQU5ORUxfSU5fU1RFUkVPCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBhdWRpb19jaGFubmVsX2luX21hc2tfZnJvbV9jb3VudChhYXVkaW9TYW1wbGVzUGVyRnJhbWUpOworICAgICAgICBtSGFyZHdhcmVUaW1lT2Zmc2V0TmFub3MgPSBJTlBVVF9FU1RJTUFURURfSEFSRFdBUkVfT0ZGU0VUX05BTk9TOyAvLyBmcmFtZXMgYXQgQURDIGVhcmxpZXIKKworICAgIH0gZWxzZSB7CisgICAgICAgIEFMT0dFKCJvcGVuTW1hcFN0cmVhbSAtIGludmFsaWQgZGlyZWN0aW9uID0gJWQiLCBkaXJlY3Rpb24pOworICAgICAgICByZXR1cm4gQUFVRElPX0VSUk9SX0lMTEVHQUxfQVJHVU1FTlQ7CisgICAgfQorCisgICAgTW1hcFN0cmVhbUludGVyZmFjZTo6c3RyZWFtX2RpcmVjdGlvbl90IHN0cmVhbURpcmVjdGlvbiA9CisgICAgICAgICAgICAoZGlyZWN0aW9uID09IEFBVURJT19ESVJFQ1RJT05fT1VUUFVUKQorICAgICAgICAgICAgPyBNbWFwU3RyZWFtSW50ZXJmYWNlOjpESVJFQ1RJT05fT1VUUFVUCisgICAgICAgICAgICA6IE1tYXBTdHJlYW1JbnRlcmZhY2U6OkRJUkVDVElPTl9JTlBVVDsKKworICAgIC8vIE9wZW4gSEFMIHN0cmVhbS4gU2V0IG1NbWFwU3RyZWFtCisgICAgc3RhdHVzX3Qgc3RhdHVzID0gTW1hcFN0cmVhbUludGVyZmFjZTo6b3Blbk1tYXBTdHJlYW0oc3RyZWFtRGlyZWN0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZhdHRyaWJ1dGVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZjb25maWcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU1tYXBDbGllbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmRldmljZUlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMsIC8vIGNhbGxiYWNrCisgICAgICAgICAg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gICAgICAgICAgICAgICAgZmxvYXQgdm9sdW1lID0gMS4wOyAvLyB0byBtYXRjaCBsZWdhY3kgdm9sdW1lCi0gICAgICAgICAgICAgICAgICAgIGJvb2wgdW5kZXJmbG93ZWQgPSBtTWl4ZXIubWl4KGluZGV4LCBmaWZvLCB2b2x1bWUpOwotICAgICAgICAgICAgICAgICAgICB1bmRlcmZsb3dDb3VudCArPSB1bmRlcmZsb3dlZCA/IDEgOiAwOwotICAgICAgICAgICAgICAgICAgICAvLyBUT0RPIGxvZyB1bmRlcmZsb3dzIGluIGVhY2ggc3RyZWFtCi0gICAgICAgICAgICAgICAgICAgIHNoYXJlZFN0cmVhbS0+bWFya1RyYW5zZmVyVGltZShBdWRpb0Nsb2NrOjpnZXROYW5vc2Vjb25kcygpKTsKKyAgICAgICAgICAgIGZvciAoY29uc3QgYXV0byBjbGllbnRTdHJlYW0gOiBtUmVnaXN0ZXJlZFN0cmVhbXMpIHsKKyAgICAgICAgICAgICAgICBpbnQ2NF90IGNsaWVudEZyYW1lc1JlYWQgPSAwOworCisgICAgICAgICAgICAgICAgaWYgKCFjbGllbnRTdHJlYW0tPmlzUnVubmluZygpKSB7CisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpbmRleCsrOworCisgICAgICAgICAgICAgICAgc3A8QUF1ZGlvU2VydmljZVN0cmVhbVNoYXJlZD4gc3RyZWFtU2hhcmVkID0KKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRpY19jYXN0PEFBdWRpb1NlcnZpY2VTdHJlYW1TaGFyZWQgKj4oY2xpZW50U3RyZWFtLmdldCgpKTsKKworICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gTG9jayB0aGUgQXVkaW9GaWZvIHRvIHByb3RlY3QgYWdhaW5zdCBjbG9zZS4KKyAgICAgICAgICAgICAgICAgICAgc3RkOjpsb2NrX2d1YXJkIDxzdGQ6Om11dGV4PiBsb2NrKHN0cmVhbVNoYXJlZC0+Z2V0QXVkaW9EYXRhUXVldWVMb2NrKCkpOworCisgICAgICAgICAgICAgICAgICAgIEZpZm9CdWZmZXIgKmZpZm8gPSBzdHJlYW1TaGFyZWQtPmdldEF1ZGlvRGF0YUZpZm9CdWZmZXJfbCgpOworICAgICAgICAgICAgICAgICAgICBpZiAoZmlmbyAhPSBudWxscHRyKSB7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIERldGVybWluZSBvZmZzZXQgYmV0d2VlbiBmcmFtZVBvc2l0aW9uIGluIGNsaWVudCdzIHN0cmVhbQorICAgICAgICAgICAgICAgICAgICAgICAgLy8gdnMgdGhlIHVuZGVybHlpbmcgTU1BUCBzdHJlYW0uCisgICAgICAgICAgICAgICAgICAgICAgICBjbGllbnRGcmFtZXNSZWFkID0gZmlmby0+Z2V0UmVhZENvdW50ZXIoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRoZXNlIHR3byBpbmRpY2VzIHJlZmVyIHRvIHRoZSBzYW1lIGZyYW1lLgorICAgICAgICAgICAgICAgICAgICAgICAgaW50NjRfdCBwb3NpdGlvbk9mZnNldCA9IG1tYXBGcmFtZXNXcml0dGVuIC0gY2xpZW50RnJhbWVzUmVhZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbVNoYXJlZC0+c2V0VGltZXN0YW1wUG9zaXRpb25PZmZzZXQocG9zaXRpb25PZmZzZXQpOworCisgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB2b2x1bWUgPSAxLjA7IC8vIHRvIG1hdGNoIGxlZ2FjeSB2b2x1bWUKKyAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgdW5kZXJmbG93ZWQgPSBtTWl4ZXIubWl4KGluZGV4LCBmaWZvLCB2b2x1bWUpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVuZGVyZmxvd2VkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtU2hhcmVkLT5pbmNyZW1lbnRYUnVuQ291bnQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGNsaWVudEZyYW1lc1JlYWQgPSBmaWZvLT5nZXRSZWFkQ291bnRlcigpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKGNsaWVudEZyYW1lc1JlYWQgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFRoaXMgdGltZXN0YW1wIHJlcHJlc2VudHMgdGhlIGNvbXBsZXRpb24gb2YgZGF0YSBiZWluZyByZWFkIG91dCBvZiB0aGUKKyAgICAgICAgICAgICAgICAgICAgLy8gY2xpZW50IGJ1ZmZlci4gSXQgaXMgc2VudCB0byB0aGUgY2xpZW50IGFuZCB1c2VkIGluIHRoZSB0aW1pbmcgbW9kZWwKKyAgICAgICAgICAgICAgICAgICAgLy8gdG8gZGVjaWRlIHdoZW4gdGhlIGNsaWVudCBoYXMgcm9vbSB0byB3cml0ZSBtb3JlIGRhdGEuCisgICAgICAgICAgICAgICAgICAgIFRpbWVzdGFtcCB0aW1lc3RhbXAoY2xpZW50RnJhbWVzUmVhZCwgQXVkaW9DbG9jazo6Z2V0TmFub3NlY29uZHMoKSk7CisgICAgICAgICAgICAgICAgICAgIHN0cmVhbVNoYXJlZC0+bWFya1RyYW5zZmVyVGltZSh0aW1lc3RhbXApOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGluZGV4Kys7IC8vIGp1c3QgdXNlZCBmb3IgbGFiZWxsaW5nIHRyYWNrcyBpbiBzeXN0cmFjZQogICAgICAgICAgICAgfQogICAgICAgICB9CiAKQEAgLTkzLDcgKzEyOSw3IEBACiAgICAgICAgIHJlc3VsdCA9IGdldFN0cmVhbUludGVybmFsKCktPndyaXRlKG1NaXhlci5nZXRPdXRwdXRCdWZmZXIoKSwKICAgICAgICAgICAgICAgICAg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291bnQgPT0gMSkgeyAvLyBhdG9taWMKKyAgICAgICAgICAgIHJlc3VsdCA9IGdldFN0cmVhbUludGVybmFsKCktPnJlcXVlc3RTdGFydCgpOworICAgICAgICAgICAgaWYgKHJlc3VsdCAhPSBBQVVESU9fT0spIHsKKyAgICAgICAgICAgICAgICAtLW1SdW5uaW5nU3RyZWFtQ291bnQ7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHJlc3VsdCA9IHN0YXJ0U2hhcmluZ1RocmVhZF9sKCk7CisgICAgICAgICAgICAgICAgaWYgKHJlc3VsdCAhPSBBQVVESU9fT0spIHsKKyAgICAgICAgICAgICAgICAgICAgZ2V0U3RyZWFtSW50ZXJuYWwoKS0+cmVxdWVzdFN0b3AoKTsKKyAgICAgICAgICAgICAgICAgICAgLS1tUnVubmluZ1N0cmVhbUNvdW50OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIGlmIChyZXN1bHQgPT0gQUFVRElPX09LKSB7CisgICAgICAgIHJlc3VsdCA9IGdldFN0cmVhbUludGVybmFsKCktPnN0YXJ0Q2xpZW50KHNoYXJlZFN0cmVhbS0+Z2V0QXVkaW9DbGllbnQoKSwgY2xpZW50SGFuZGxlKTsKKyAgICAgICAgaWYgKHJlc3VsdCAhPSBBQVVESU9fT0spIHsKKyAgICAgICAgICAgIGlmICgtLW1SdW5uaW5nU3RyZWFtQ291bnQgPT0gMCkgeyAvLyBhdG9taWMKKyAgICAgICAgICAgICAgICBzdG9wU2hhcmluZ1RocmVhZCgpOworICAgICAgICAgICAgICAgIGdldFN0cmVhbUludGVybmFsKCktPnJlcXVlc3RTdG9wKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4gcmVzdWx0OworfQorCithYXVkaW9fcmVzdWx0X3QgQUF1ZGlvU2VydmljZUVuZHBvaW50U2hhcmVkOjpzdG9wU3RyZWFtKHNwP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KTsKKyAgICAgICAgY29tbWFuZC53aGF0ID0gQUF1ZGlvU2VydmljZU1lc3NhZ2U6OmNvZGU6OlRJTUVTVEFNUF9TRVJWSUNFOwogICAgICAgICByZXN1bHQgPSB3cml0ZVVwTWVzc2FnZVF1ZXVlKCZjb21tYW5kKTsKLSAgICB9IGVsc2UgaWYgKHJlc3VsdCA9PSBBQVVESU9fRVJST1JfVU5BVkFJTEFCTEUpIHsKKworICAgICAgICBpZiAocmVzdWx0ID09IEFBVURJT19PSykgeworICAgICAgICAgICAgLy8gU2VuZCBhIGhhcmR3YXJlIHRpbWVzdGFtcCBmb3IgcHJlc2VudGF0aW9uIHRpbWUuCisgICAgICAgICAgICByZXN1bHQgPSBnZXRIYXJkd2FyZVRpbWVzdGFtcCgmY29tbWFuZC50aW1lc3RhbXAucG9zaXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmY29tbWFuZC50aW1lc3RhbXAudGltZXN0YW1wKTsKKyAgICAgICAgICAgIGlmIChyZXN1bHQgPT0gQUFVRElPX09LKSB7CisgICAgICAgICAgICAgICAgQUxPR1YoInNlbmRDdXJyZW50VGltZXN0YW1wKCkgSEFSRFdBUkUgJThsbGQgYXQgJWxsZCIsCisgICAgICAgICAgICAgICAgICAgICAgKGxvbmcgbG9uZykgY29tbWFuZC50aW1lc3RhbXAucG9zaXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgKGxvbmcgbG9uZykgY29tbWFuZC50aW1lc3RhbXAudGltZXN0YW1wKTsKKyAgICAgICAgICAgICAgICBjb21tYW5kLndoYXQgPSBBQXVkaW9TZXJ2aWNlTWVzc2FnZTo6Y29kZTo6VElNRVNUQU1QX0hBUkRXQVJFOworICAgICAgICAgICAgICAgIHJlc3VsdCA9IHdyaXRlVXBNZXNzYWdlUXVldWUoJmNvbW1hbmQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgaWYgKHJlc3VsdCA9PSBBQVVESU9fRVJ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9fRVJST1JfSUxMRUdBTF9BUkdVTUVOVDsKKyAgICBzcDxBQXVkaW9TZXJ2aWNlRW5kcG9pbnQ+IGVuZHBvaW50ID0gbVNlcnZpY2VFbmRwb2ludFdlYWsucHJvbW90ZSgpOworICAgIGlmIChlbmRwb2ludCA9PSBudWxscHRyKSB7CisgICAgICAgIEFMT0dFKCIlcygpIGhhcyBubyBlbmRwb2ludCIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIEFBVURJT19FUlJPUl9JTlZBTElEX1NUQVRFOwogICAgIH0KIAotICAgIE1tYXBTdHJlYW1JbnRlcmZhY2U6OnN0cmVhbV9kaXJlY3Rpb25fdCBzdHJlYW1EaXJlY3Rpb24gPSAoZGlyZWN0aW9uID09IEFBVURJT19ESVJFQ1RJT05fT1VUUFVUKQotICAgICAgICA/IE1tYXBTdHJlYW1JbnRlcmZhY2U6OkRJUkVDVElPTl9PVVRQVVQgOiBNbWFwU3RyZWFtSW50ZXJmYWNlOjpESVJFQ1RJT05fSU5QVVQ7Ci0KLSAgICAvLyBPcGVuIEhBTCBzdHJlYW0uCi0gICAgc3RhdHVzX3Qgc3RhdHVzID0gTW1hcFN0cmVhbUludGVyZmFjZTo6b3Blbk1tYXBTdHJlYW0oc3RyZWFtRGlyZWN0aW9uLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZhdHRyaWJ1dGVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZjb25maWcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU1tYXBDbGllbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmRldmljZUlkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1NbWFw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IHsKKyAgICAgICAgQUxPR0UoIiVzKCkgaGFzIG5vIGVuZHBvaW50IiwgX19mdW5jX18pOworICAgICAgICByZXR1cm4gQUFVRElPX0VSUk9SX0lOVkFMSURfU1RBVEU7CisgICAgfQorICAgIHNwPEFBdWRpb1NlcnZpY2VFbmRwb2ludE1NQVA+IHNlcnZpY2VFbmRwb2ludE1NQVAgPQorICAgICAgICAgICAgc3RhdGljX2Nhc3Q8QUF1ZGlvU2VydmljZUVuZHBvaW50TU1BUCAqPihlbmRwb2ludC5nZXQoKSk7CisKKyAgICAvLyBUT0RPIEdldCBwcmVzZW50YXRpb24gdGltZXN0YW1wIGZyb20gdGhlIEhBTAorICAgIGlmIChtQXRvbWljVGltZXN0YW1wLmlzVmFsaWQoKSkgeworICAgICAgICBUaW1lc3RhbXAgdGltZXN0YW1wID0gbUF0b21pY1RpbWVzdGFtcC5yZWFkKCk7CisgICAgICAgICpwb3NpdGlvbkZyYW1lcyA9IHRpbWVzdGFtcC5nZXRQb3NpdGlvbigpOworICAgICAgICAqdGltZU5hbm9zID0gdGltZXN0YW1wLmdldE5hbm9zZWNvbmRzKCkgKyBzZXJ2aWNlRW5kcG9pbnRNTUFQLT5nZXRIYXJkd2FyZVRpbWVPZmZzZXROYW5vcygpOworICAgICAgICByZXR1cm4gQUFVRElPX09LOworICAgIH0gZWxzZSB7CisgICAgICAgIHJldHVybiBBQVVESU9fRVJST1JfVU5BVkFJTEFCTEU7CisgICAgfQorfQogCiAvKioKICAqIEdldCBhbiBpbW11dGFibGUgZGVzY3JpcHRpb24gb2YgdGhlIGRhdGEgcXVldWUgZnJvbSB0aGUgSEFMLgogICovCi1hYXVkaW9fcmVzdWx0X3QgQUF1ZGlvU2VydmljZVN0cmVhbU1NQVA6OmdldERvd25EYXRhRGVzY3JpcHRpb24oQXVkaW9FbmRwb2ludFBhcmNlbGFibGUgJnBhcmNlbGFibGUpCithYXVkaW9fcmVzdWx0X3QgQUF1ZGlvU2VydmljZVN0cmVhbU1NQ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pID0gZGVmYXVsdDsKIAotICAgICAgICB2b2lkIG9uVGVhckRvd24oKSBvdmVycmlkZSB7Ci0gICAgICAgICAgICBtU2VydmljZUNhbGxiYWNrLm9uVGVhckRvd24oKTsKLSAgICAgICAgfTsKLQotICAgICAgICB2b2lkIG9uVm9sdW1lQ2hhbmdlZChhdWRpb19jaGFubmVsX21hc2tfdCBjaGFubmVscywgYW5kcm9pZDo6VmVjdG9yPGZsb2F0PiB2YWx1ZXMpIG92ZXJyaWRlCi0gICAgICAgIHsKLSAgICAgICAgICAgIG1TZXJ2aWNlQ2FsbGJhY2sub25Wb2x1bWVDaGFuZ2VkKGNoYW5uZWxzLCB2YWx1ZXMpOwotICAgICAgICB9OwotCi0gICAgICAgIHZvaWQgb25Sb3V0aW5nQ2hhbmdlZChhdWRpb19wb3J0X2hhbmRsZV90IGRldmljZUlkKSBvdmVycmlkZSB7Ci0gICAgICAgICAgICBtU2VydmljZUNhbGxiYWNrLm9uUm91dGluZ0NoYW5nZWQoZGV2aWNlSWQpOwotICAgICAgICB9OwotCi0gICAgcHJpdmF0ZToKLSAgICAgICAgYW5kcm9pZDo6TW1hcFN0cmVhbUNhbGxiYWNrICZtU2VydmljZUNhbGxiYWNrOwotICAgIH07Ci0KLSAgICBhbmRyb2lkOjpzcDxNeU1tYXBTdHJlYW1DYWxsYmFjaz4gICBtTW1hcFN0cmVhbUNhbGxiYWNrOwotICAgIE1vbm90b25pY0NvdW50ZXIgICAgICAgICAgICAgICAgICAgIG1GcmFtZXNXcml0dGVuOwotICAgIE1vbm90b25pY0NvdW50ZXIgICAgICAgICAgICAgICAgICAgIG1GcmFtZXNSZWFkOwotICAgIGludDMyX3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1QcmV2aW91c0ZyYW1lQ291bnRlciA9IDA7ICAgLy8gZnJvbSBIQUwKLQotICAgIC8vIEludGVyZmFjZSB0byB0aGUgQXVkaW9GbGluZ2VyIE1NQVAgc3VwcG9ydC4KLSAgICBhbmRyb2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cywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQ2NF90ICp0aW1lTmFub3MpIHsKLSAgICAvLyBUT0RPIGdldCB0aGVzZSB0d28gbnVtYmVycyBhcyBhbiBhdG9taWMgcGFpcgotICAgICpwb3NpdGlvbkZyYW1lcyA9IG1NYXJrZWRQb3NpdGlvbjsKLSAgICAqdGltZU5hbm9zID0gbU1hcmtlZFRpbWU7Ci0gICAgcmV0dXJuIEFBVURJT19PSzsKKworICAgIGludDY0X3QgcG9zaXRpb24gPSAwOworICAgIHNwPEFBdWRpb1NlcnZpY2VFbmRwb2ludD4gZW5kcG9pbnQgPSBtU2VydmljZUVuZHBvaW50V2Vhay5wcm9tb3RlKCk7CisgICAgaWYgKGVuZHBvaW50ID09IG51bGxwdHIpIHsKKyAgICAgICAgQUxPR0UoIiVzKCkgaGFzIG5vIGVuZHBvaW50IiwgX19mdW5jX18pOworICAgICAgICByZXR1cm4gQUFVRElPX0VSUk9SX0lOVkFMSURfU1RBVEU7CisgICAgfQorCisgICAgYWF1ZGlvX3Jlc3VsdF90IHJlc3VsdCA9IGVuZHBvaW50LT5nZXRUaW1lc3RhbXAoJnBvc2l0aW9uLCB0aW1lTmFub3MpOworICAgIGlmIChyZXN1bHQgPT0gQUFVRElPX09LKSB7CisgICAgICAgIGludDY0X3Qgb2Zmc2V0ID0gbVRpbWVzdGFtcFBvc2l0aW9uT2Zmc2V0LmxvYWQoKTsKKyAgICAgICAgLy8gVE9ETywgZG8gbm90IGdvIGJlbG93IHN0YXJ0aW5nIHZhbHVlCisgICAgICAgIHBvc2l0aW9uIC09IG9mZnNldDsgLy8gT2Zmc2V0IGZyb20gc2hhcmVkIE1NQVAgc3RyZWFtCisgICAgICAgIEFMT0dWKCJnZXRIYXJkd2FyZVRpbWVzdGFtcCgpICU4bGxkID0gJThsbGQgLSAlOGxsZCIsCisgICAgICAgICAgICAgIChsb25nIGxvbmcpIHBv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ZmZlciBpcyBhIG51bGxwdHIiKTsKLSAgICAgICAgcmV0dXJuOwotICAgIH0KLSAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IGhhbE1ldGFkYXRhLnNpemUoKTsgaSsrKSB7Ci0gICAgICAgIHJhZGlvX21ldGFkYXRhX2tleV90IGtleSA9IHN0YXRpY19jYXN0PHJhZGlvX21ldGFkYXRhX2tleV90PihoYWxNZXRhZGF0YVtpXS5rZXkpOwotICAgICAgICByYWRpb19tZXRhZGF0YV90eXBlX3QgdHlwZSA9IHN0YXRpY19jYXN0PHJhZGlvX21ldGFkYXRhX2tleV90PihoYWxNZXRhZGF0YVtpXS50eXBlKTsKLSAgICAgICAgcmFkaW9fbWV0YWRhdGFfY2xvY2tfdCBjbG9jazsKLQotICAgICAgICBzd2l0Y2ggKHR5cGUpIHsKLSAgICAgICAgY2FzZSBSQURJT19NRVRBREFUQV9UWVBFX0lOVDoKLSAgICAgICAgICAgIHJhZGlvX21ldGFkYXRhX2FkZF9pbnQobWV0YWRhdGEsIGtleSwgaGFsTWV0YWRhdGFbaV0uaW50VmFsdWUpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgUkFESU9fTUVUQURBVEFfVFlQRV9URVhUOgotICAgICAgICAgICAgcmFkaW9fbWV0YWRhdGFfYWRkX3RleHQobWV0YWRhdGEsIGtleSwgaGFsTWV0YWRhdGFbaV0uc3RyaW5nVmFsdWUuY19zdHIoKSk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBSQURJT19NRVRBREFUQV9UWVBFX1JBVzoKLSAgICAgICAgICAgIHJhZGlvX21ldGFkYXRhX2FkZF9yYXcobWV0YWRhdGEsIGtleSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFsTWV0YWRhdGFbaV0ucmF3VmFsdWUuZGF0YSgpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYWxNZXRhZGF0YVtpXS5yYXdWY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nRpZXMpIHsKLSAgICAgICAgICAgICAgICAgICAgaGFsUmVzdWx0ID0gcmVzdWx0OwotICAgICAgICAgICAgICAgICAgICBpZiAocmVzdWx0ID09IFJlc3VsdDo6T0spIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGhhbFByb3BlcnRpZXMgPSBwcm9wZXJ0aWVzOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSk7Ci0KLSAgICBpZiAoaGFsUmVzdWx0ID09IFJlc3VsdDo6T0spIHsKLSAgICAgICAgSGlkbFV0aWxzOjpjb252ZXJ0UHJvcGVydGllc0Zyb21IYWwocHJvcGVydGllcywgJmhhbFByb3BlcnRpZXMpOwotICAgIH0KLSAgICByZXR1cm4gSGlkbFV0aWxzOjpjb252ZXJ0SGFsUmVzdWx0KGhhbFJlc3VsdCk7Ci19Ci0KLWludCBSYWRpb0hhbEhpZGw6Om9wZW5UdW5lcihjb25zdCByYWRpb19oYWxfYmFuZF9jb25maWdfdCAqY29uZmlnLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgYXVkaW8sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3A8VHVuZXJDYWxsYmFja0ludGVyZmFjZT4gY2FsbGJhY2ssCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3A8VHVuZXJJbnRlcmZhY2U+JiB0dW5lcikKLXsKLSAgICBzcDxJQnJvYWRjYXN0UmFkaW8+IG1vZHVsZSA9IGdldFNlcnZpY2UoKTsKLSAgICBpZiAobW9kdWxlID09IDApIHsKLSAgICAgICAgcmV0dXJuIC1FTk9ERVY7Ci0gICAgfQotICAgIHNwPFR1bmVyPiB0dW5lckltcGwgPSBuZXcgVHVuZXIoY2FsbGJhY2ssIHRoaXMpOwotCi0gICAgQmFuZENvbmZpZyBoYWxDb25maWc7Ci0gICAgUmVzdWx0IGhhbFJlc3VsdCA9IFJlc3VsdDo6Tk9UX0lOSVRJQUxJWkVEOwotICAgIHNwPEl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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGF1ZGlvLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3A8VHVuZXJDYWxsYmFja0ludGVyZmFjZT4gY2FsbGJhY2ssCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcDxUdW5lckludGVyZmFjZT4mIHR1bmVyKTsKLSAgICAgICAgdmlydHVhbCBpbnQgY2xvc2VUdW5lcihzcDxUdW5lckludGVyZmFjZT4mIHR1bmVyKTsKLQotICAgICAgICBjbGFzcyBUdW5lciAgOiBwdWJsaWMgVHVuZXJJbnRlcmZhY2UsIHB1YmxpYyB2aXJ0dWFsIElUdW5lckNhbGxiYWNrCi0gICAgICAgIHsKLSAgICAgICAgcHVibGljOgotICAgICAgICAgICAgICAgICAgICAgICAgVHVuZXIoc3A8VHVuZXJDYWxsYmFja0ludGVyZmFjZT4gY2FsbGJhY2ssIHNwPFJhZGlvSGFsSGlkbD4gbW9kdWxlKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgLy8gVHVuZXJJbnRlcmZhY2UKLSAgICAgICAgICAgIHZpcnR1YWwgaW50IHNldENvbmZpZ3VyYXRpb24oY29uc3QgcmFkaW9faGFsX2JhbmRfY29uZmlnX3QgKmNvbmZpZyk7Ci0gICAgICAgICAgICB2aXJ0dWFsIGludCBnZXRDb25maWd1cmF0aW9uKHJhZGlvX2hhbF9iYW5kX2NvbmZpZ190ICpjb25maWcpOwotICAgICAgICAgICAgdmlydHVhbCBpbnQgc2NhbihyYWRpb19kaXJlY3Rpb25fdCBkaXJlY3Rpb24sIGJvb2wgc2tpcF9zdWJfY2hhbm5lbCk7Ci0gICAgICAgICAgICB2aXJ0dWFsIGludCBzdGVwKHJhZGlvX2RpcmVjdGlvbl90IGRpcmVjdGlvbiwgYm9vbCBza2lwX3N1Yl9jaGFubmVsKTsKLSAgICAgICAgICAgIHZpcnR1YWwgaW50IHR1bmUodW5zaWduZWQgaW50IGNoYW5uZWwsIHVuc2l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bnRlcmZhY2UuaCIKLQotbmFtZXNwYWNlIGFuZHJvaWQgewotCi1jbGFzcyBSYWRpb0hhbExlZ2FjeSA6IHB1YmxpYyBSYWRpb0ludGVyZmFjZQotewotcHVibGljOgotICAgICAgICBSYWRpb0hhbExlZ2FjeShyYWRpb19jbGFzc190IGNsYXNzSWQpOwotCi0gICAgICAgIC8vIFJhZGlvSW50ZXJmYWNlCi0gICAgICAgIHZpcnR1YWwgaW50IGdldFByb3BlcnRpZXMocmFkaW9faGFsX3Byb3BlcnRpZXNfdCAqcHJvcGVydGllcyk7Ci0gICAgICAgIHZpcnR1YWwgaW50IG9wZW5UdW5lcihjb25zdCByYWRpb19oYWxfYmFuZF9jb25maWdfdCAqY29uZmlnLAotICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBhdWRpbywKLSAgICAgICAgICAgICAgICAgICAgICAgIHNwPFR1bmVyQ2FsbGJhY2tJbnRlcmZhY2U+IGNhbGxiYWNrLAotICAgICAgICAgICAgICAgICAgICAgICAgc3A8VHVuZXJJbnRlcmZhY2U+JiB0dW5lcik7Ci0gICAgICAgIHZpcnR1YWwgaW50IGNsb3NlVHVuZXIoc3A8VHVuZXJJbnRlcmZhY2U+JiB0dW5lcik7Ci0KLSAgICAgICAgLy8gUmVmQmFzZQotICAgICAgICB2aXJ0dWFsIHZvaWQgb25GaXJzdFJlZigpOwotCi0gICAgICAgIGNsYXNzIFR1bmVyICA6IHB1YmxpYyBUdW5lckludGVyZmFjZQotICAgICAgICB7Ci0gICAgICAgIHB1YmxpYzoKLSAgICAgICAgICAgICAgICAgICAgICAgIFR1bmVyKHNwPFR1bmVyQ2FsbGJhY2tJbnRlcmZhY2U+IGNhbGxiYWNrKTsKLQotICAgICAgICAgICAgdmlydHVhbCBpbnQgc2V0Q29uZmlndXJhdGlvbihjb25zdCByYWRpb19oYWxfYmFuZF9jb25maWdfdCAqY29uZmlnKTsKLSAgICAgICAgICAgIHZpcnR1YWwgaW50IGdldENvbmZpZ3VyYX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XRpb24gcHJvcGVydGllcy4KLSAgICAgICAgICoKLSAgICAgICAgICogYXJndW1lbnRzOgotICAgICAgICAgKiAtIHByb3BlcnRpZXM6IHdoZXJlIHRvIHJldHVybiB0aGUgbW9kdWxlIHByb3BlcnRpZXMKLSAgICAgICAgICoKLSAgICAgICAgICogcmV0dXJuczoKLSAgICAgICAgICogIDAgaWYgbm8gZXJyb3IKLSAgICAgICAgICogIC1FSU5WQUwgaWYgaW52YWxpZCBhcmd1bWVudHMgYXJlIHBhc3NlZAotICAgICAgICAgKi8KLSAgICAgICAgdmlydHVhbCBpbnQgZ2V0UHJvcGVydGllcyhyYWRpb19oYWxfcHJvcGVydGllc190ICpwcm9wZXJ0aWVzKSA9IDA7Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogT3BlbiBhIHR1bmVyIGludGVyZmFjZSBmb3IgdGhlIHJlcXVlc3RlZCBjb25maWd1cmF0aW9uLgotICAgICAgICAgKiBJZiBubyBvdGhlciB0dW5lciBpcyBvcGVuZWQsIHRoaXMgd2lsbCBhY3RpdmF0ZSB0aGUgcmFkaW8gbW9kdWxlLgotICAgICAgICAgKgotICAgICAgICAgKiBhcmd1bWVudHM6Ci0gICAgICAgICAqIC0gY29uZmlnOiB0aGUgYmFuZCBjb25maWd1cmF0aW9uIHRvIGFwcGx5Ci0gICAgICAgICAqIC0gYXVkaW86IHRoaXMgdHVuZXIgd2lsbCBiZSB1c2VkIGZvciBsaXZlIHJhZGlvIGxpc3RlbmluZyBhbmQgc2hvdWxkIGJlIGNvbm5lY3RlZCB0bwotICAgICAgICAgKiB0aGUgcmFkaW8gYXVkaW8gc291cmNlLgotICAgICAgICAgKiAtIGNhbGxiYWNrOiB0aGUgZXZlbnQgY2FsbGJhY2sKLSAgICAgICAgICogLSBjb29raWU6IHRoZSBjb29raWUgdG8gcGFzcyB3aGVuIGNhbGxpbmcgdGhlIGNhbGxiYWNrCi0gICAgICAgICAqIC0gdHVuZXI6IHdoZXJlIHRvIHJldHVybiB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pWzBdKSkKLSNlbmRpZgotCi1jb25zdCByYWRpb19iYW5kX2NvbmZpZ190IHNLbm93blJlZ2lvbkNvbmZpZ3NbXSA9IHsKLSAgICB7ICAgLy8gRk0gSVRVIDEKLSAgICAgICAgUkFESU9fUkVHSU9OX0lUVV8xLAotICAgICAgICB7Ci0gICAgICAgIFJBRElPX0JBTkRfRk0sCi0gICAgICAgICAgICBmYWxzZSwKLSAgICAgICAgICAgIFJBRElPX0JBTkRfTE9XRVJfRk1fSVRVMSwKLSAgICAgICAgICAgIFJBRElPX0JBTkRfVVBQRVJfRk1fSVRVMSwKLSAgICAgICAgICAgIDEsCi0gICAgICAgICAgICB7UkFESU9fQkFORF9TUEFDSU5HX0ZNX0lUVTF9LAotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBSQURJT19ERUVNUEhBU0lTXzUwLAotICAgICAgICAgICAgICAgIHRydWUsCi0gICAgICAgICAgICAgICAgUkFESU9fUkRTX1dPUkxELAotICAgICAgICAgICAgICAgIHRydWUsCi0gICAgICAgICAgICAgICAgdHJ1ZSwKLSAgICAgICAgICAgICAgICB0cnVlLAotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0sCi0gICAgeyAgIC8vIEZNIEFtZXJpY2FzCi0gICAgICAgIFJBRElPX1JFR0lPTl9JVFVfMiwKLSAgICAgICAgewotICAgICAgICBSQURJT19CQU5EX0ZNLAotICAgICAgICAgICAgZmFsc2UsCi0gICAgICAgICAgICBSQURJT19CQU5EX0xPV0VSX0ZNX0lUVTIsCi0gICAgICAgICAgICBSQURJT19CQU5EX1VQUEVSX0ZNX0lUVTIsCi0gICAgICAgICAgICAxLAotICAgICAgICAgICAge1JBRElPX0JBTkRfU1BBQ0lOR19GTV9JVFUyfSwKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgUkFESU9fREVFTVBIQVNJU183NSwKLSAgICAgICAgICAgICAgICB0cnVlLAotICAgICAgICAgICAgICAgIFJBRElPX1JEU19VUywKLSAgICAgICAgICAgICAgICB0cnVlLAotICAgICAgICAgICAgICAgIHRydWUsCi0gICAgICAgICAgICAgICAgdHJ1ZSwKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9LAotICAgIHsgICAvLyBGTSBKYXBhbgotICAgICAgICBSQURJT19SRUdJT05fSkFQQU4sCi0gICAgICAgIHsKLSAgICAgICAgUkFESU9fQkFORF9GTSwKLSAgICAgICAgICAgIGZhbHNlLAotICAgICAgICAgICAgUkFESU9fQkFORF9MT1dFUl9GTV9KQVBBTiwKLSAgICAgICAgICAgIFJBRElPX0JBTkRfVVBQRVJfRk1fSkFQQU4sCi0gICAgICAgICAgICAxLAotICAgICAgICAgICAge1JBRElPX0JBTkRfU1BBQ0lOR19GTV9KQVBBTn0sCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIFJBRElPX0RFRU1QSEFTSVNfNTAsCi0gICAgICAgICAgICAgICAgdHJ1ZSwKLSAgICAgICAgICAgICAgICBSQURJT19SRFNfV09STEQsCi0gICAgICAgICAgICAgICAgdHJ1ZSwKLSAgICAgICAgICAgICAgICB0cnVlLAotICAgICAgICAgICAgICAgIHRydWUsCi0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfSwKLSAgICB7ICAgLy8gRk0gS29yZWEKLSAgICAgICAgUkFESU9fUkVHSU9OX0tPUkVBLAotICAgICAgICB7Ci0gICAgICAgIFJBRElPX0JBTkRfRk0sCi0gICAgICAgICAgICBmYWxzZSwKLSAgICAgICAgICAgIFJBRElPX0JBTkRfTE9XRVJfRk1fSVRVMSwKLSAgICAgICAgICAgIFJBRElPX0JBTkRfVVBQRVJfRk1fSVRVMSwKLSAgICAgICAgICAgIDEsCi0gICAgICAgICAgICB7UkFESU9fQkFORF9TUEFDSU5HX0ZNX0lUVTF9LAotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBSQURJT19ERUVNUEhBU0lTXzc1LAotICAgICAgICAgICAgICAgIHRydWUsCi0gICAgICAgICAgICAgICAgUkFESU9fUkRTX1dPUkxELAotICAgICAgICAgICAgICAgIHRydWUsCi0gICAgICAgICAgICAgICAgdHJ1ZSwKLSAgICAgICAgICAgICAgICB0cnVlLAotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0sCi0gICAgeyAgIC8vIEZNIE9JUlQKLSAgICAgICAgUkFESU9fUkVHSU9OX09JUlQsCi0gICAgICAgIHsKLSAgICAgICAgUkFESU9fQkFORF9GTSwKLSAgICAgICAgICAgIGZhbHNlLAotICAgICAgICAgICAgUkFESU9fQkFORF9MT1dFUl9GTV9PSVJULAotICAgICAgICAgICAgUkFESU9fQkFORF9VUFBFUl9GTV9PSVJULAotICAgICAgICAgICAgMSwKLSAgICAgICAgICAgIHtSQURJT19CQU5EX1NQQUNJTkdfRk1fT0lSVH0sCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIFJBRElPX0RFRU1QSEFTSVNfNTAsCi0gICAgICAgICAgICAgICAgdHJ1ZSwKLSAgICAgICAgICAgICAgICBSQURJT19SRFNfV09STEQsCi0gICAgICAgICAgICAgICAgdHJ1ZSwKLSAgICAgICAgICAgICAgICB0cnVlLAotICAgICAgICAgICAgICAgIHRydWUsCi0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfSwKLSAgICB7ICAgLy8gRk0gVVMgSEQgcmFkaW8KLSAgICAgICAgUkFESU9fUkVHSU9OX0lUVV8yLAotICAgICAgICB7Ci0gICAgICAgICAgICBSQURJT19CQU5EX0ZNX0hELAotICAgICAgICAgICAgZmFsc2UsCi0gICAgICAgICAgICBSQURJT19CQU5EX0xPV0VSX0ZNX0lUVTIsCi0gICAgICAgICAgICBSQURJT19CQU5EX1VQUEVSX0ZNX0lUVTIsCi0gICAgICAgICAgICAxLAotICAgICAgICAgICAge1JBRElPX0JBTkRfU1BBQ0lOR19GTV9JVFUyfSwKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgUkFESU9fREVFTVBIQVNJU183NSwKLSAgICAgICAgICAgICAgICB0cnVlLAotICAgICAgICAgICAgICAgIFJBRElPX1JEU19VUywKLSAgICAgICAgICAgICAgICB0cnVlLAotICAgICAgICAgICAgICAgIHRydWUsCi0gICAgICAgICAgICAgICAgdHJ1ZSwKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9LAotICAgIHsgICAvLyBBTSBMVwotICAgICAgICBSQURJT19SRUdJT05fSVRVXzEsCi0gICAgICAgIHsKLSAgICAgICAgICAgIFJBRElPX0JBTkRfQU0sCi0gICAgICAgICAgICBmYWxzZSwKLSAgICAgICAgICAgIFJBRElPX0JBTkRfTE9XRVJfTFcsCi0gICAgICAgICAgICBSQURJT19CQU5EX1VQUEVSX0xXLAotICAgICAgICAgICAgMSwKLSAgICAgICAgICAgIHtSQURJT19CQU5EX1NQQUNJTkdfTFd9LAotICAgICAgICAgICAgewotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfSwKLSAgICB7ICAgLy8gQU0gU1cKLSAgICAgICAgUkFESU9fUkVHSU9OX0lUVV8xLAotICAgICAgICB7Ci0gICAgICAgICAgICBSQURJT19CQU5EX0FNLAotICAgICAgICAgICAgZmFsc2UsCi0gICAgICAgICAgICBSQURJT19CQU5EX0xPV0VSX1NXLAotICAgICAgICAgICAgUkFESU9fQkFORF9VUFBFUl9TVywKLSAgICAgICAgICAgIDEsCi0gICAgICAgICAgICB7UkFESU9fQkFORF9TUEFDSU5HX1NXfSwKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0sCi0gICAgeyAgIC8vIEFNIE1XIElUVTEKLSAgICAgICAgUkFESU9fUkVHSU9OX0lUVV8xLAotICAgICAgICB7Ci0gICAgICAgICAgICBSQURJT19CQU5EX0FNLAotICAgICAgICAgICAgZmFsc2UsCi0gICAgICAgICAgICBSQURJT19CQU5EX0xPV0VSX01XX0lVVDEsCi0gICAgICAgICAgICBSQURJT19CQU5EX1VQUEVSX01XX0lUVTEsCi0gICAgICAgICAgICAxLAotICAgICAgICAgICAge1JBRElPX0JBTkRfU1BBQ0lOR19NV19JVFUxfSwKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0sCi0gICAgeyAgIC8vIEFNIE1XIElUVTIKLSAgICAgICAgUkFESU9fUkVHSU9OX0lUVV8yLAotICAgICAgICB7Ci0gICAgICAgICAgICBSQURJT19CQU5EX0FNLAotICAgICAgICAgICAgZmFsc2UsCi0gICAgICAgICAgICBSQURJT19CQU5EX0xPV0VSX01XX0lVVDIsCi0gICAgICAgICAgICBSQURJT19CQU5EX1VQUEVSX01XX0lUVTIsCi0gICAgICAgICAgICAxLAotICAgICAgICAgICAge1JBRElPX0JBTkRfU1BBQ0lOR19NV19JVFUyfSwKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLX07Ci0KLQotfSAvLyBuYW1lc3BhY2UgYW5kcm9pZAotCi0jZW5kaWYgLy8gQU5EUk9JRF9IQVJEV0FSRV9SQURJT19SRUdJT05TX0gKZGlmZiAtLWdpdCBhL3NlcnZpY2VzL3JhZGlvL1JhZGlvU2VydmljZS5jcHAgYi9zZXJ2aWNlcy9yYWRpby9SYWRpb1NlcnZpY2UuY3BwCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCBiZWI3YzA5Li4wMDAwMDAwCi0tLSBhL3NlcnZpY2VzL3JhZGlvL1JhZGlvU2VydmljZS5jcHAKKysrIC9kZXYv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gIGlmIChtTW9kdWxlQ2xpZW50c1tpXS0+YXVkaW8oKSkgewotICAgICAgICAgICAgICAgIGlmIChvbGRlc3RBdWRpbyA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIG9sZGVzdEF1ZGlvID0gbU1vZHVsZUNsaWVudHNbaV07Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGFsbG9jYXRlZEF1ZGlvKys7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGlmIChvbGRlc3RUdW5lciA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIG9sZGVzdFR1bmVyID0gbU1vZHVsZUNsaWVudHNbaV07Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGFsbG9jYXRlZFR1bmVycysrOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgc3A8VHVuZXJJbnRlcmZhY2U+IGhhbFR1bmVyOwotICAgIHNwPE1vZHVsZUNsaWVudD4gcHJlZW10ZWRDbGllbnQ7Ci0gICAgaWYgKGF1ZGlvKSB7Ci0gICAgICAgIGlmIChhbGxvY2F0ZWRBdWRpbyA+PSBtUHJvcGVydGllcy5udW1fYXVkaW9fc291cmNlcykgewotICAgICAgICAgICAgQUxPR19BU1NFUlQob2xkZXN0QXVkaW8gIT0gMCwgImFkZENsaWVudCgpIGFsbG9jYXRlZEF1ZGlvL29sZGVzdEF1ZGlvIG1pc21hdGNoIik7Ci0gICAgICAgICAgICBwcmVlbXRlZENsaWVudCA9IG9sZGVzdEF1ZGlvOwotICAgICAgICB9Ci0gICAgfSBlbHNlIHsKLSAgICAgICAgaWYgKGFsbG9jYXRlZEF1ZGlvICsgYWxsb2NhdGVkVHVuZXJzID49IG1Qcm9wZXJ0aWVzLm51bV90dW5lcnMpIHsKLSAgICAgICAgICAgIGlmIChhbGxvY2F0ZWRUdW5lcnMgIT0gMCkgewotICAgICAgICAgICAgICAgIEFMT0dfQVNTRVJ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Ci0KLWNvbnN0IHN0cnVjdCByYWRpb19iYW5kX2NvbmZpZyAqUmFkaW9TZXJ2aWNlOjpNb2R1bGU6OmdldERlZmF1bHRDb25maWcoKSBjb25zdAotewotICAgIGlmIChtUHJvcGVydGllcy5udW1fYmFuZHMgPT0gMCkgewotICAgICAgICByZXR1cm4gTlVMTDsKLSAgICB9Ci0gICAgcmV0dXJuICZtUHJvcGVydGllcy5iYW5kc1swXTsKLX0KLQotdm9pZCBSYWRpb1NlcnZpY2U6Ok1vZHVsZTo6bm90aWZ5RGV2aWNlQ29ubmVjdGlvbihib29sIGNvbm5lY3RlZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciAqYWRkcmVzcykgewotICAgIGludDY0X3QgdG9rZW4gPSBJUENUaHJlYWRTdGF0ZTo6c2VsZigpLT5jbGVhckNhbGxpbmdJZGVudGl0eSgpOwotICAgIEF1ZGlvU3lzdGVtOjpzZXREZXZpY2VDb25uZWN0aW9uU3RhdGUoQVVESU9fREVWSUNFX0lOX0ZNX1RVTkVSLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29ubmVjdGVkID8gQVVESU9fUE9MSUNZX0RFVklDRV9TVEFURV9BVkFJTEFCTEUgOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBVURJT19QT0xJQ1lfREVWSUNFX1NUQVRFX1VOQVZBSUxBQkxFLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkcmVzcywga1JhZGlvVHVuZXJBdWRpb0RldmljZU5hbWUpOwotICAgIElQQ1RocmVhZFN0YXRlOjpzZWxmKCktPnJlc3RvcmVDYWxsaW5nSWRlbnRpdHkodG9rZW4pOwotfQotCi0jdW5kZWYgTE9HX1RBRwotI2RlZmluZSBMT0dfVEFHICJSYWRpb1NlcnZpY2U6Ok1vZHVsZUNsaWVudCIK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sKLQotICAgIHZpcnR1YWwgc3RhdHVzX3QgYXR0YWNoKHJhZGlvX2hhbmRsZV90IGhhbmRsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzcDxJUmFkaW9DbGllbnQ+JiBjbGllbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3RydWN0IHJhZGlvX2JhbmRfY29uZmlnICpjb25maWcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCB3aXRoQXVkaW8sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3A8SVJhZGlvPiYgcmFkaW8pOwotCi0gICAgdmlydHVhbCBzdGF0dXNfdCAgICBvblRyYW5zYWN0KHVpbnQzMl90IGNvZGUsIGNvbnN0IFBhcmNlbCYgZGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGFyY2VsKiByZXBseSwgdWludDMyX3QgZmxhZ3MpOwotCi0gICAgdmlydHVhbCBzdGF0dXNfdCAgICBkdW1wKGludCBmZCwgY29uc3QgVmVjdG9yPFN0cmluZzE2PiYgYXJncyk7Ci0KLQotICAgIGNsYXNzIE1vZHVsZSA6IHB1YmxpYyB2aXJ0dWFsIFJlZkJhc2UgewotICAgIHB1YmxpYzoKLQotICAgICAgIE1vZHVsZShzcDxSYWRpb0ludGVyZmFjZT4gaHdEZXZpY2UsCi0gICAgICAgICAgICAgIHN0cnVjdCByYWRpb19wcm9wZXJ0aWVzIHByb3BlcnRpZXMpOwotCi0gICAgICAgdmlydHVhbCB+TW9kdWxlKCk7Ci0KLSAgICAgICAgICAgICAgIHNwPE1vZHVsZUNsaWVudD4gYWRkQ2xpZW50KGNvbnN0IHNwPElSYWRpb0NsaWVudD4mIGNsaWVudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzdHJ1Y3QgcmFkaW9fYmFuZF9jb25maWcgKmNvbmZpZywKLSAgICAgICAgICAgICAgICAgICAgICAgICA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9yPCBzcDxNb2R1bGVDbGllbnQ+ID4gICAgbU1vZHVsZUNsaWVudHM7IC8vIGxpc3Qgb2YgYXR0YWNoZWQgY2xpZW50cwotICAgICAgICBib29sICAgICAgICAgICAgICAgICAgICAgICAgICBtTXV0ZTsgICAgICAgICAgLy8gcmFkaW8gYXVkaW8gc291cmNlIHN0YXRlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB3aGVuIHVubXV0ZWQsIGF1ZGlvIGlzIHJvdXRlZCB0byB0aGUKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG91dHB1dCBkZXZpY2Ugc2VsZWN0ZWQgZm9yIG1lZGlhIHVzZSBjYXNlLgotICAgIH07IC8vIGNsYXNzIE1vZHVsZQotCi0gICAgY2xhc3MgQ2FsbGJhY2tUaHJlYWQgOiBwdWJsaWMgVGhyZWFkIHsKLSAgICBwdWJsaWM6Ci0KLSAgICAgICAgZXhwbGljaXQgQ2FsbGJhY2tUaHJlYWQoY29uc3Qgd3A8TW9kdWxlQ2xpZW50PiYgbW9kdWxlQ2xpZW50KTsKLQotICAgICAgICB2aXJ0dWFsIH5DYWxsYmFja1RocmVhZCgpOwotCi0KLSAgICAgICAgLy8gVGhyZWFkIHZpcnR1YWxzCi0gICAgICAgIHZpcnR1YWwgYm9vbCB0aHJlYWRMb29wKCk7Ci0KLSAgICAgICAgLy8gUmVmQmFzZQotICAgICAgICB2aXJ0dWFsIHZvaWQgb25GaXJzdFJlZigpOwotCi0gICAgICAgICAgICAgICAgdm9pZCBleGl0KCk7Ci0KLSAgICAgICAgICAgICAgICB2b2lkIHNlbmRFdmVudChyYWRpb19oYWxfZXZlbnRfdCAqaGFsRXZlbnQpOwotICAgICAgICAgICAgICAgIHNwPElNZW1vcnk+IHByZXBhcmVFdmVudChyYWRpb19oYWxfZXZlbnRfdCAqaGFsRXZlbnQpOwotCi0gICAgcHJ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uZCBtVHVuZXIKLSAgICAgICAgd3A8TW9kdWxlPiAgICAgICAgICAgICAgICAgIG1Nb2R1bGU7ICAgICAgICAgLy8gVGhlIG1vZHVsZSB0aGlzIGNsaWVudCBpcyBhdHRhY2hlZCB0bwotICAgICAgICBzcDxJUmFkaW9DbGllbnQ+ICAgICAgICAgICAgbUNsaWVudDsgICAgICAgICAvLyBldmVudCBjYWxsYmFjayBiaW5kZXIgaW50ZXJmYWNlCi0gICAgICAgIHJhZGlvX2JhbmRfY29uZmlnX3QgICAgICAgICBtQ29uZmlnOyAgICAgICAgIC8vIGN1cnJlbnQgYmFuZCBjb25maWd1cmF0aW9uCi0gICAgICAgIHNwPENhbGxiYWNrVGhyZWFkPiAgICAgICAgICBtQ2FsbGJhY2tUaHJlYWQ7IC8vIGV2ZW50IGNhbGxiYWNrIHRocmVhZAotICAgICAgICBjb25zdCBib29sICAgICAgICAgICAgICAgICAgbUF1ZGlvOwotICAgICAgICBzcDxUdW5lckludGVyZmFjZT4gICAgICAgICAgbVR1bmVyOyAgICAgICAgLy8gSEFMIHR1bmVyIGludGVyZmFjZS4gTlVMTCBpbmRpY2F0ZXMgdGhhdAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoaXMgY2xpZW50IGRvZXMgbm90IGhhdmUgY29udHJvbCBvbiBhbnkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0dW5lcgotICAgIH07IC8vIGNsYXNzIE1vZHVsZUNsaWVudAotCi0KLSAgICBzdGF0aWMgdm9pZCBjYWxsYmFjayhyYWRpb19oYWxfZXZlbnRfdCAqaGFsRXZlbnQsIHZvaWQgKmNvb2tpZSk7Ci0KLXByaXZhdGU6Ci0KLSAgICB2aXJ0dWFsIHZvaWQgb25GaXJzdFJlZigpOwotCi0gICAgc3RhdGljIHZvaWQgY29udmVydFByb3BlcnRpZXMocmFkaW9fcHJvcGVydGll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JuIFBFUk1JU1NJT05fREVOSUVEOwogICAgIH0KIApAQCAtODU2LDcgKzg1OCw3IEBACiAgICAgICAgIH0KIAogICAgICAgICBjb25zdCBib29sIHN1cHBvcnRzX3N0b3BfYWxsID0KLSAgICAgICAgICAgICAgICAobUhhbEludGVyZmFjZSAhPSAwKSAmJiAobUhhbEludGVyZmFjZS0+c3RvcEFsbFJlY29nbml0aW9ucygpID09IEVOT1NZUyk7CisgICAgICAgICAgICAgICAgKG1IYWxJbnRlcmZhY2UgIT0gMCkgJiYgKG1IYWxJbnRlcmZhY2UtPnN0b3BBbGxSZWNvZ25pdGlvbnMoKSAhPSAtRU5PU1lTKTsKIAogICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IG1Nb2RlbHMuc2l6ZSgpOyBpKyspIHsKICAgICAgICAgICAgIHNwPE1vZGVsPiBtb2RlbCA9IG1Nb2RlbHMudmFsdWVBdChpKTsKQEAgLTk2MCw3ICs5NjIsOCBAQAogCiB2b2lkIFNvdW5kVHJpZ2dlckh3U2VydmljZTo6TW9kdWxlQ2xpZW50OjpkZXRhY2goKSB7CiAgICAgQUxPR1YoImRldGFjaCgpIik7Ci0gICAgaWYgKCFjYXB0dXJlSG90d29yZEFsbG93ZWQoKSkgeworICAgIGlmICghY2FwdHVyZUhvdHdvcmRBbGxvd2VkKElQQ1RocmVhZFN0YXRlOjpzZWxmKCktPmdldENhbGxpbmdQaWQoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJUENUaHJlYWRTdGF0ZTo6c2VsZigpLT5nZXRDYWxsaW5nVWlkKCkpKSB7CiAgICAgICAgIHJldHVybjsKICAgICB9CiAKQEAgLTk4Myw3ICs5ODYsOCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzb3VuZF9tb2RlbF9oYW5kbGVfdCAqaGFuZGxlKQogewogICAgIEFMT0dWKCJsb2FkU291bmRNb2RlbCgpIGhhbmRsZSIpOwotICAgIGlmICghY2FwdHVyZ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