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SQ19ERUZBVUxUX1BJRD15CkBAIC01NzYsNiArNjE5LDcgQEAKICMgR2VuZXJpYyBEcml2ZXIgT3B0aW9ucwogIwogQ09ORklHX1VFVkVOVF9IRUxQRVJfUEFUSD0iL3NiaW4vaG90cGx1ZyIKKyMgQ09ORklHX0RFVlRNUEZTIGlzIG5vdCBzZXQKIENPTkZJR19TVEFOREFMT05FPXkKIENPTkZJR19QUkVWRU5UX0ZJUk1XQVJFX0JVSUxEPXkKIENPTkZJR19GV19MT0FERVI9eQpAQCAtNTg1LDkgKzYyOSw5IEBACiAjIENPTkZJR19DT05ORUNUT1IgaXMgbm90IHNldAogQ09ORklHX01URD15CiAjIENPTkZJR19NVERfREVCVUcgaXMgbm90IHNldAorIyBDT05GSUdfTVREX1RFU1RTIGlzIG5vdCBzZXQKICMgQ09ORklHX01URF9DT05DQVQgaXMgbm90IHNldAogQ09ORklHX01URF9QQVJUSVRJT05TPXkKLSMgQ09ORklHX01URF9URVNUUyBpcyBub3Qgc2V0CiAjIENPTkZJR19NVERfUkVEQk9PVF9QQVJUUyBpcyBub3Qgc2V0CiAjIENPTkZJR19NVERfQ01ETElORV9QQVJUUyBpcyBub3Qgc2V0CiAjIENPTkZJR19NVERfQVI3X1BBUlRTIGlzIG5vdCBzZXQKQEAgLTYzNiw2ICs2ODAsNyBAQAogQ09ORklHX01URF9DT01QTEVYX01BUFBJTkdTPXkKIENPTkZJR19NVERfUEhZU01BUD15CiAjIENPTkZJR19NVERfUEhZU01BUF9DT01QQVQgaXMgbm90IHNldAorIyBDT05GSUdfTVREX0dQSU9fQUREUiBpcyBub3Qgc2V0CiAjIENPTkZJR19NVERfUExBVFJBTSBpcyBub3Qgc2V0CiAKICMKQEAgLTY2OCw2ICs3MTMsMTAgQEAKIENPTkZJR19CTEtfREVWPXkKICMgQ09ORklHX0JMS19ERVZfQ09XX0NPTU1PTiBpcyBub3Qgc2V0CiAjIENPTkZJR19CTEtfREVWX0xPT1AgaXMgbm90IHNldAorCisjCisj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ENPTkZJR19QUklOVEs9eQogQ09ORklHX0JVRz15CiBDT05GSUdfRUxGX0NPUkU9eQorQ09ORklHX1BDU1BLUl9QTEFURk9STT15CiBDT05GSUdfQkFTRV9GVUxMPXkKIENPTkZJR19GVVRFWD15Ci1DT05GSUdfQU5PTl9JTk9ERVM9eQogQ09ORklHX0VQT0xMPXkKIENPTkZJR19TSUdOQUxGRD15CitDT05GSUdfVElNRVJGRD15CiBDT05GSUdfRVZFTlRGRD15CiBDT05GSUdfU0hNRU09eQorQ09ORklHX0FJTz15CisKKyMKKyMgS2VybmVsIFBlcmZvcm1hbmNlIEV2ZW50cyBBbmQgQ291bnRlcnMKKyMKIENPTkZJR19WTV9FVkVOVF9DT1VOVEVSUz15CitDT05GSUdfUENJX1FVSVJLUz15CitDT05GSUdfQ09NUEFUX0JSSz15CiBDT05GSUdfU0xBQj15CiAjIENPTkZJR19TTFVCIGlzIG5vdCBzZXQKICMgQ09ORklHX1NMT0IgaXMgbm90IHNldAorQ09ORklHX1BST0ZJTElORz15CitDT05GSUdfT1BST0ZJTEU9bQorQ09ORklHX0hBVkVfT1BST0ZJTEU9eQorCisjCisjIEdDT1YtYmFzZWQga2VybmVsIHByb2ZpbGluZworIworIyBDT05GSUdfR0NPVl9LRVJORUwgaXMgbm90IHNldAorQ09ORklHX1NMT1dfV09SSz15CisjIENPTkZJR19TTE9XX1dPUktfREVCVUcgaXMgbm90IHNldAorQ09ORklHX0hBVkVfR0VORVJJQ19ETUFfQ09IRVJFTlQ9eQorQ09ORklHX1NMQUJJTkZPPXkKIENPTkZJR19SVF9NVVRFWEVTPXkKLSMgQ09ORklHX1RJTllfU0hNRU0gaXMgbm90IHNldAogQ09ORklHX0JBU0VfU01BTEw9MAogQ09ORklHX01PRFVMRVM9eQorIyBDT05GSUdfTU9EVUxFX0ZPUkNFX0xPQUQgaXMgbm90IHNldAogQ09ORklHX01PRFVMRV9VTkxPQUQ9eQogIyBDT05GSUdfTU9EVUxFX0ZPUkNFX1VOTE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0yCi0jIENPTkZJR19NVERfQUxDSEVNWSBpcyBub3Qgc2V0Ci0jIENPTkZJR19NVERfTVRYMSBpcyBub3Qgc2V0Ci1DT05GSUdfTVREX1BDST1tCi1DT05GSUdfTVREX1BMQVRSQU09bQorQ09ORklHX01URF9QSFlTTUFQPXkKKyMgQ09ORklHX01URF9QSFlTTUFQX0NPTVBBVCBpcyBub3Qgc2V0CisjIENPTkZJR19NVERfUENJIGlzIG5vdCBzZXQKKyMgQ09ORklHX01URF9HUElPX0FERFIgaXMgbm90IHNldAorIyBDT05GSUdfTVREX0lOVEVMX1ZSX05PUiBpcyBub3Qgc2V0CisjIENPTkZJR19NVERfUExBVFJBTSBpcyBub3Qgc2V0CiAKICMKICMgU2VsZi1jb250YWluZWQgTVREIGRldmljZSBkcml2ZXJzCiAjCi1DT05GSUdfTVREX1BNQzU1MT1tCi0jIENPTkZJR19NVERfUE1DNTUxX0JVR0ZJWCBpcyBub3Qgc2V0Ci0jIENPTkZJR19NVERfUE1DNTUxX0RFQlVHIGlzIG5vdCBzZXQKLUNPTkZJR19NVERfREFUQUZMQVNIPW0KLUNPTkZJR19NVERfTTI1UDgwPW0KLUNPTkZJR19NVERfU0xSQU09bQotQ09ORklHX01URF9QSFJBTT1tCi1DT05GSUdfTVREX01URFJBTT1tCi1DT05GSUdfTVREUkFNX1RPVEFMX1NJWkU9NDA5NgotQ09ORklHX01URFJBTV9FUkFTRV9TSVpFPTEyOAotQ09ORklHX01URF9CTE9DSzJNVEQ9bQorIyBDT05GSUdfTVREX1BNQzU1MSBpcyBub3Qgc2V0CisjIENPTkZJR19NVERfU0xSQU0gaXMgbm90IHNldAorIyBDT05GSUdfTVREX1BIUkFNIGlzIG5vdCBzZXQKKyMgQ09ORklHX01URF9NVERSQU0gaXMgbm90IHNldAorIyBDT05GSUdfTVREX0JMT0NLMk1URCBpcyBub3Qgc2V0CiAKICMKICMgRGlzay1Pbi1DaGlwIERldmljZSBEcml2ZXJzCiAjCi1DT05GSUdfTVREX0RPQzIwMDA9bQotQ09ORklHX01URF9ET0MyMDAxPW0KLUNPTkZJR19NVERfRE9DMjAwMVBMVVM9bQotQ09ORklHX01URF9ET0NQUk9CRT1tCi1DT05GSUdfTVREX0RPQ0VDQz1tCi0jIENPTkZJR19NVERfRE9DUFJPQkVfQURWQU5DRUQgaXMgbm90IHNldAotQ09ORklHX01URF9ET0NQUk9CRV9BRERSRVNTPTAKLUNPTkZJR19NVERfTkFORD1tCi0jIENPTkZJR19NVERfTkFORF9WRVJJRllfV1JJVEUgaXMgbm90IHNldAotIyBDT05GSUdfTVREX05BTkRfRUNDX1NNQyBpcyBub3Qgc2V0Ci0jIENPTkZJR19NVERfTkFORF9NVVNFVU1fSURTIGlzIG5vdCBzZXQKLUNPTkZJR19NVERfTkFORF9JRFM9bQotQ09ORklHX01URF9OQU5EX0RJU0tPTkNISVA9bQotIyBDT05GSUdfTVREX05BTkRfRElTS09OQ0hJUF9QUk9CRV9BRFZBTkNFRCBpcyBub3Qgc2V0Ci1DT05GSUdfTVREX05BTkRfRElTS09OQ0hJUF9QUk9CRV9BRERSRVNTPTAKLSMgQ09ORklHX01URF9OQU5EX0RJU0tPTkNISVBfQkJUV1JJVEUgaXMgbm90IHNldAotIyBDT05GSUdfTVREX05BTkRfQ0FGRSBpcyBub3Qgc2V0Ci1DT05GSUdfTVREX05BTkRfTkFORFNJTT1tCi0jIENPTkZJR19NVERfTkFORF9QTEFURk9STSBpcyBub3Qgc2V0Ci1DT05GSUdfTVREX09ORU5BTkQ9bQotQ09ORklHX01URF9PTkVOQU5EX1ZFUklGWV9XUklURT15Ci0jIENPTkZJR19NVERfT05FTkFORF9PVFAgaXMgbm90IHNldAorIyBDT05GSUdfTVREX0RPQzIwMDAgaXMgbm90IHNldAorIyBDT05GSUdfTVREX0RPQzIwMDEgaXMgbm90IHNldAorIyBDT05GSUdfTVREX0RPQzIwMDFQTFVTIGlzIG5vdCBzZXQKKyMgQ09ORklHX01URF9OQU5EIGlzIG5vdCBz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gKgorICogQ29weXJpZ2h0IFNVU0UgTGludXggUHJvZHVjdHMgR21iSCAyMDA5CisgKgorICogQXV0aG9yczogQWxleGFuZGVyIEdyYWYgPGFncmFmQHN1c2UuZGU+CisgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRW50cnkgY29kZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisubWFjcm8gTE9BRF9HVUVTVF9TRUdNRU5UUworCisJLyogUmVxdWlyZWQgc3RhdGU6CisJICoKKwkgKiBNU1IgPSB+SVJ8RFIKKwkgKiBSMSA9IGhvc3QgUjEKKwkgKiBSMiA9IGhvc3QgUjIKKwkgKiBSMyA9IHNoYWRvdyB2Y3B1CisJICogYWxsIG90aGVyIHZvbGF0aWxlIEdQUlMgPSBmcmVlCisJICogU1ZDUFVbQ1JdICA9IGd1ZXN0IENSCisJICogU1ZDUFVbWEVSXSA9IGd1ZXN0IFhFUgorCSAqIFNWQ1BVW0NUUl0gPSBndWVzdCBDVFIKKwkgKiBTVkNQVVtMUl0gID0gZ3Vlc3QgTFIKKwkgKi8KKworI2RlZmluZSBYQ0hHX1NSKG4pCWx3eglyOSwgKFNWQ1BVX1NSKyhuKjQpKShyMyk7ICBcCisJCQltdHNyCW4sIHI5CisKKwlYQ0hHX1NSKDApCisJWENIR19TUigxKQorCVhDSEdfU1IoMikKKwlYQ0hHX1NSKDMpCisJWENIR19TUig0KQorCVhDSEdfU1IoNSkKKwlYQ0hHX1NSKDYpCisJWENIR19TUig3KQorCVhDSEdfU1IoOCkKKwlYQ0hHX1NSKDkpCisJWENIR19TUigxMCkKKwlYQ0hHX1NSKDExKQorCVhDSEdfU1IoMTIpCisJWENIR19TUigxMykKKwlYQ0hHX1NSKDE0KQorCVhDSEdfU1IoMTUpCisKKwkvKiBDbGVhciBCQVRzLiAqLworCisjZGVmaW5lIEtWTV9LSUxMX0JBVChuLCByZWcpCQlcCisgICAgICAgIG10c3ByICAgU1BSTl9JQkFUIyNuIyNVLHJlZzsJXAorICAgICAgICBtdHNwciAgIFNQUk5fSUJBVCMjbiMjTCxyZWc7CVwKKyAgICAgICAgbXRzcHIgICBTUFJOX0RCQVQjI24jI1UscmVnOwlcCisgICAgICAgIG10c3ByICAgU1BSTl9EQkFUIyNuIyNMLHJlZzsJXAorCisgICAgICAgIGxpCXI5LCAwCisJS1ZNX0tJTExfQkFUKDAsIHI5KQorCUtWTV9LSUxMX0JBVCgxLCByOSkKKwlLVk1fS0lMTF9CQVQoMiwgcjkpCisJS1ZNX0tJTExfQkFUKDMsIHI5KQorCisuZW5kbQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeGl0IGNvZGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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Vk1fUjUpKHIxMykKLQlsZAlyNiwgKFBBQ0FfS1ZNX1I2KShyMTMpCi0JbGQJcjcsIChQQUNBX0tWTV9SNykocjEzKQotCWxkCXI4LCAoUEFDQV9LVk1fUjgpKHIxMykKLQlsZAlyOSwgKFBBQ0FfS1ZNX1I5KShyMTMpCi0JbGQJcjEwLCAoUEFDQV9LVk1fUjEwKShyMTMpCi0JbGQJcjEyLCAoUEFDQV9LVk1fUjEyKShyMTMpCi0KLQlsd3oJcjExLCAoUEFDQV9LVk1fQ1IpKHIxMykKLQltdGNyCXIxMQotCi0JbGQJcjExLCAoUEFDQV9LVk1fWEVSKShyMTMpCi0JbXR4ZXIJcjExCi0KLQlsZAlyMTEsIChQQUNBX0tWTV9SMTEpKHIxMykKLQlsZAlyMTMsIChQQUNBX0tWTV9SMTMpKHIxMykKLQotCVJGSQota3ZtcHBjX2hhbmRsZXJfdHJhbXBvbGluZV9lbnRlcl9lbmQ6Ci0KLQorLmVuZG0KIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgpAQCAtMTYyLDk5ICsxMjgsMjIgQEAKICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAotLmdsb2JhbCBrdm1wcGNfaGFuZGxlcl90cmFtcG9saW5lX2V4aXQKLWt2bXBwY19oYW5kbGVyX3RyYW1wb2xpbmVfZXhpdDoKKy5tYWNybyBMT0FEX0hPU1RfU0VHTUVOVFMKIAogCS8qIFJlZ2lzdGVyIHVzYWdlIGF0I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m0vYm9vazNzX3JtaGFuZGxlcnMuUwppbmRleCBjODNjNjBhLi41MDZkNWMzIDEwMDY0NAotLS0gYS9hcmNoL3Bvd2VycGMva3ZtL2Jvb2szc182NF9ybWhhbmRsZXJzLlMKKysrIGIvYXJjaC9wb3dlcnBjL2t2bS9ib29rM3Nfcm1oYW5kbGVycy5TCkBAIC0yMiw3ICsyMiwxMCBAQAogI2luY2x1ZGUgPGFzbS9yZWcuaD4KICNpbmNsdWRlIDxhc20vcGFnZS5oPgogI2luY2x1ZGUgPGFzbS9hc20tb2Zmc2V0cy5oPgorCisjaWZkZWYgQ09ORklHX1BQQ19CT09LM1NfNjQKICNpbmNsdWRlIDxhc20vZXhjZXB0aW9uLTY0cy5oPgorI2VuZGlmCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCkBAIC0zMCw2ICszMywzOSBAQAogICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAorI2lmIGRlZmluZWQoQ09ORklHX1BQQ19CT09LM1NfNjQpCisKKyNkZWZpbmUgTE9BRF9TSEFET1dfVkNQVShyZWcpCQkJCVwKKwltZnNwcglyZWcsIFNQUk5fU1BSR19QQUNBCisKKyNkZWZpbmUgU0hBRE9XX1ZDUFVfT0ZGCQlQQUNBX0tWTV9TVkNQVQorI2RlZmluZSBNU1JfTk9JUlEJCU1TUl9LRVJORUwgJiB+KE1TUl9JUiB8IE1TUl9EUikKKyNkZWZpbmUgRlVOQyhuYW1lKSAJCUdMVUUoLixu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SUdfUFBDX0JPT0szU182NCkKKworI2RlZmluZSBHRVRfU0hBRE9XX1ZDUFUocmVnKSAgICBcCisJYWRkaSAgICByZWcsIHIxMywgUEFDQV9LVk1fU1ZDUFUKKworI2VsaWYgZGVmaW5lZChDT05GSUdfUFBDX0JPT0szU18zMikKKworI2RlZmluZSBHRVRfU0hBRE9XX1ZDUFUocmVnKSAgICAJCQlcCisJdG9waHlzKHJlZywgcjIpOyAgICAgICAJCQlcCisJbHd6ICAgICByZWcsIChUSFJFQUQgKyBUSFJFQURfS1ZNX1NWQ1BVKShyZWcpOwlcCisJdG9waHlzKHJlZywgcmVnKQorCisjZW5kaWYKKworLyogRGlzYWJsZSBmb3IgbmVzdGVkIEtWTSAqLworI2RlZmluZSBVU0VfUVVJQ0tfTEFTVF9JTlNUCisKKworLyogR2V0IGhlbHBlciBmdW5jdGlvbnMgZm9yIHN1YmFyY2ggc3BlY2lmaWMgZnVuY3Rpb25hbGl0eSAqLworCisjaWYgZGVmaW5lZChDT05GSUdfUFBDX0JPT0szU182NCkKKyNpbmNsdWRlICJib29rM3NfNjRfc2xiLlMiCisjZWxpZiBkZWZpbmVkKENPTkZJR19QUENfQk9PSzNTXzMyKQorI2luY2x1ZGUgImJvb2szc18zMl9zci5TIgorI2VuZGlmCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVudHJ5IGNvZGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioq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FNWQ1BVX0xSKShyMykKKwlsd3oJcjYsIChTVkNQVV9DUikocjMpCisJbHd6CXI3LCAoU1ZDUFVfWEVSKShyMykKKworCW10Y3RyCXI0CisJbXRscglyNQorCW10Y3IJcjYKKwltdHhlcglyNworCisJUFBDX0xMCXIwLCAoU1ZDUFVfUjApKHIzKQorCVBQQ19MTAlyMSwgKFNWQ1BVX1IxKShyMykKKwlQUENfTEwJcjIsIChTVkNQVV9SMikocjMpCisJUFBDX0xMCXI0LCAoU1ZDUFVfUjQpKHIzKQorCVBQQ19MTAlyNSwgKFNWQ1BVX1I1KShyMykKKwlQUENfTEwJcjYsIChTVkNQVV9SNikocjMpCisJUFBDX0xMCXI3LCAoU1ZDUFVfUjcpKHIzKQorCVBQQ19MTAlyOCwgKFNWQ1BVX1I4KShyMykKKwlQUENfTEwJcjksIChTVkNQVV9SOSkocjMpCisJUFBDX0xMCXIxMCwgKFNWQ1BVX1IxMCkocjMpCisJUFBDX0xMCXIxMSwgKFNWQ1BVX1IxMSkocjMpCisJUFBDX0xMCXIxMiwgKFNWQ1BVX1IxMikocjMpCisJUFBDX0xMCXIxMywgKFNWQ1BVX1IxMykocjMpCisKKwlQUENfTEwJcjMsIChTVkNQVV9SMykocjMpCisKKwlSRkkKK2t2bXBwY19oYW5kbGVyX3RyYW1wb2xpbmVfZW50ZXJfZW5kOgorCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRXhpdCBjb2RlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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ZCBsb25nIHN0YXJ0LCBlbmQ7CisJaW50IGJjb3VudDsKKwlpbnQgcmV0OworCisJZm9yIChzdGFydCA9IGppZmZpZXMsIGVuZCA9IHN0YXJ0ICsgc2VjICogSFosIGJjb3VudCA9IDA7CisJICAgICB0aW1lX2JlZm9yZShqaWZmaWVzLCBlbmQpOyBiY291bnQrKykgeworCQlyZXQgPSBkb19vbmVfYWhhc2hfb3AocmVxLCBjcnlwdG9fYWhhc2hfZGlnZXN0KHJlcSkpOworCQlpZiAocmV0KQorCQkJcmV0dXJuIHJldDsKKwl9CisKKwlwcmludGsoIiU2dSBvcGVycy9zZWMsICU5bHUgYnl0ZXMvc2VjXG4iLAorCSAgICAgICBiY291bnQgLyBzZWMsICgobG9uZyliY291bnQgKiBibGVuKSAvIHNlYyk7CisKKwlyZXR1cm4gMDsKK30KKworc3RhdGljIGludCB0ZXN0X2FoYXNoX2ppZmZpZXMoc3RydWN0IGFoYXNoX3JlcXVlc3QgKnJlcSwgaW50IGJsZW4sCisJCQkgICAgICBpbnQgcGxlbiwgY2hhciAqb3V0LCBpbnQgc2VjKQoreworCXVuc2lnbmVkIGxvbmcgc3RhcnQsIGVuZDsKKwlpbnQgYmNvdW50LCBwY291bnQ7CisJaW50IHJldDsKKworCWlmIChwbGVuID09IGJsZW4pCisJCXJldHVybiB0ZXN0X2FoYXNoX2ppZmZpZXNfZGlnZXN0KHJlcSwgYmxlbiwgb3V0LCBzZWMpOworCisJZm9yIChzdGFydCA9IGppZmZpZXMsIGVuZCA9IHN0YXJ0ICsgc2VjICogSFosIGJjb3VudCA9IDA7CisJICAgICB0aW1lX2JlZm9yZShqaWZmaWVzLCBlbmQpOyBiY291bnQrKykgeworCQlyZXQgPSBjcnlwdG9fYWhhc2hfaW5pdChyZXEpOworCQlpZiAocmV0KQorCQkJcmV0dXJuIHJldDsKKwkJZm9yIChwY291bnQgPSAwOyBwY291bnQgPCBibGVuOyBwY291bnQgKz0gcGxlbikgeworCQkJcmV0ID0gZG9f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Y3ljbGVzICs9IGVuZCAtIHN0YXJ0OworCX0KKworb3V0OgorCWlmIChyZXQpCisJCXJldHVybiByZXQ7CisKKwlwcl9jb250KCIlNmx1IGN5Y2xlcy9vcGVyYXRpb24sICU0bHUgY3ljbGVzL2J5dGVcbiIsCisJCWN5Y2xlcyAvIDgsIGN5Y2xlcyAvICg4ICogYmxlbikpOworCisJcmV0dXJuIDA7Cit9CisKK3N0YXRpYyBpbnQgdGVzdF9haGFzaF9jeWNsZXMoc3RydWN0IGFoYXNoX3JlcXVlc3QgKnJlcSwgaW50IGJsZW4sCisJCQkgICAgIGludCBwbGVuLCBjaGFyICpvdXQpCit7CisJdW5zaWduZWQgbG9uZyBjeWNsZXMgPSAwOworCWludCBpLCBwY291bnQsIHJldDsKKworCWlmIChwbGVuID09IGJsZW4pCisJCXJldHVybiB0ZXN0X2FoYXNoX2N5Y2xlc19kaWdlc3QocmVxLCBibGVuLCBvdXQpOworCisJLyogV2FybS11cCBydW4uICovCisJZm9yIChpID0gMDsgaSA8IDQ7IGkrKykgeworCQlyZXQgPSBjcnlwdG9fYWhhc2hfaW5pdChyZXEpOworCQlpZiAocmV0KQorCQkJZ290byBvdXQ7CisJCWZvciAocGNvdW50ID0gMDsgcGNvdW50IDwgYmxlbjsgcGNvdW50ICs9IHBsZW4pIHsKKwkJCXJldCA9IGRvX29uZV9haGFzaF9vcChyZXEsIGNyeXB0b19haGFzaF91cGRhdGUocmVxKSk7CisJCQlpZiAocmV0KQorCQkJCWdvdG8gb3V0OworCQl9CisJCXJldCA9IGRvX29uZV9haGFzaF9vcChyZXEsIGNyeXB0b19haGFzaF9maW5hbChyZXEpKTsKKwkJaWYgKHJldCkKKwkJCWdvdG8gb3V0OworCX0KKworCS8qIFRoZSByZWFsIHRoaW5nLiAqLworCWZvciAoaSA9IDA7IGkgPCA4OyBpKyspIHsKKwkJY3ljbGVzX3Qgc3RhcnQsIGVuZDsKKworCQlzdGFydCA9IGdldF9jeWNsZXMoKTsKKworCQlyZ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geCArIDE7CisJaW50IGksIGosIGs7CisKKwljdHgtPmVuY190eXBlID0gbjJhbGctPmVuY190eXBlOworCisJaiA9IGsgPSAwOworCSp4ID0gMDsKKwkqeSA9IDA7CisJZm9yIChpID0gMDsgaSA8IDI1NjsgaSsrKQorCQlzW2ldID0gaTsKKwlmb3IgKGkgPSAwOyBpIDwgMjU2OyBpKyspIHsKKwkJdTggYSA9IHNbaV07CisJCWogPSAoaiArIGtleVtrXSArIGEpICYgMHhmZjsKKwkJc1tpXSA9IHNbal07CisJCXNbal0gPSBhOworCQlpZiAoKytrID49IGtleWxlbikKKwkJCWsgPSAwOworCX0KKworCXJldHVybiAwOworfQorCitzdGF0aWMgaW5saW5lIGludCBjaXBoZXJfZGVzY3JpcHRvcl9sZW4oaW50IG5ieXRlcywgdW5zaWduZWQgaW50IGJsb2NrX3NpemUpCit7CisJaW50IHRoaXNfbGVuID0gbmJ5dGVzOworCisJdGhpc19sZW4gLT0gKG5ieXRlcyAmIChibG9ja19zaXplIC0gMSkpOworCXJldHVybiB0aGlzX2xlbiA+ICgxIDw8IDE2KSA/ICgxIDw8IDE2KSA6IHRoaXNfbGVuOworfQorCitzdGF0aWMgaW50IF9fbjJfY3J5cHRfY2h1bmsoc3RydWN0IGNyeXB0b190Zm0gKnRmbSwgc3RydWN0IG4yX2NyeXB0b19jaHVuayAqY3AsCisJCQkgICAgc3RydWN0IHNwdV9xdWV1ZSAqcXAsIGJvb2wgZW5jcnlwdCkKK3sKKwlzdHJ1Y3QgbjJfY2lwaGVyX2NvbnRleHQgKmN0eCA9IGNyeXB0b190Zm1fY3R4KHRmbSk7CisJc3RydWN0IGN3cV9pbml0aWFsX2VudHJ5ICplbnQ7CisJYm9vbCBpbl9wbGFjZTsKKwlpbnQgaTsKKworCWVudCA9IHNwdV9xdWV1ZV9hbGxvYyhxcCwgY3AtPmFycl9sZW4pOworCWlmICghZW50KSB7CisJCXByX2luZm8oInF1ZXVlX2FsbG9jKCkgb2YgJWQgZmFpbHN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Y2VcbiIsIG1kbmFtZShtZGRldiksIGIpOwogCQkJbWRfZXJyb3IobWRkZXYsIGNvbmYtPm1pcnJvcnNbZF0ucmRldik7CiAJCQlyZXR1cm47CiAJCX0KQEAgLTE1ODYsMTUgKzE1ODIsMTYgQEAKIAkJCQkgICAgPT0gMCkgewogCQkJCQkvKiBXZWxsLCB0aGlzIGRldmljZSBpcyBkZWFkICovCiAJCQkJCXByaW50ayhLRVJOX05PVElDRQotCQkJCQkgICAgICAgInJhaWQxMDolczogcmVhZCBjb3JyZWN0aW9uICIKKwkJCQkJICAgICAgICJtZC9yYWlkMTA6JXM6IHJlYWQgY29ycmVjdGlvbiAiCiAJCQkJCSAgICAgICAid3JpdGUgZmFpbGVkIgogCQkJCQkgICAgICAgIiAoJWQgc2VjdG9ycyBhdCAlbGx1IG9uICVzKVxuIiwKIAkJCQkJICAgICAgIG1kbmFtZShtZGRldiksIHMsCiAJCQkJCSAgICAgICAodW5zaWduZWQgbG9uZyBsb25nKShzZWN0KwogCQkJCQkgICAgICAgcmRldi0+ZGF0YV9vZmZzZXQpLAogCQkJCQkgICAgICAgYmRldm5hbWUocmRldi0+YmRldiwgYikpOwotCQkJCQlwcmludGsoS0VSTl9OT1RJQ0UgInJhaWQxMDolczogZmFpbGluZyAiCisJCQkJCXByaW50ayhLRVJOX05PVElDRSAibWQvcmFpZDEwOiVzOiAlczogZmFpbGluZyAiCiAJCQkJCSAgICAgICAiZHJpdmVcbiIsCisJCQkJCSAgICAgICBtZG5hbWUobWRkZXYpLAogCQkJCQkgICAgICAgYmRldm5hbWUocmRldi0+YmRldiwgYikpOwogCQkJCQltZF9lcnJvcihtZGRldiwgcmRldik7CiAJCQkJfQpAQCAtMTYyMiwyMCArMTYxOSwyMSBAQAogCQkJCQkJIFJFQUQpID09IDApIHsKIAkJCQkJLyogV2VsbCwgdGhpcyBkZXZpY2UgaXMgZGVhZCAqLwogCQkJCQlwcmludGsoS0VSTl9OT1RJQ0UKLQkJCQkJICAgICAgICJ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k9MKGludGVsX3NjdV9pcGNfc2ltcGxlX2NvbW1hbmQpOworCisvKioKKyAqCWludGVsX3NjdV9pcGNfY29tbWFuZAktCWNvbW1hbmQgd2l0aCBkYXRhCisgKglAY21kOiBjb21tYW5kCisgKglAc3ViOiBzdWIgdHlwZQorICoJQGluOiBpbnB1dCBkYXRhCisgKglAaW5sZW46IGlucHV0IGxlbmd0aAorICoJQG91dDogb3V0cHV0IGRhdGEKKyAqCUBvdXRsZWluOiBvdXRwdXQgbGVuZ3RoCisgKgorICoJSXNzdWUgYSBjb21tYW5kIHRvIHRoZSBTQ1Ugd2hpY2ggaW52b2x2ZXMgZGF0YSB0cmFuc2ZlcnMuIERvIHRoZQorICoJZGF0YSBjb3BpZXMgdW5kZXIgdGhlIGxvY2sgYnV0IGxlYXZlIGl0IGZvciB0aGUgY2FsbGVyIHRvIGludGVycHJldAorICovCisKK2ludCBpbnRlbF9zY3VfaXBjX2NvbW1hbmQoaW50IGNtZCwgaW50IHN1YiwgdTMyICppbiwgaW50IGlubGVuLAorCQkJCQkJCXUzMiAqb3V0LCBpbnQgb3V0bGVuKQoreworCXUzMiBlcnIgPSAwOworCWludCBpID0gMDsKKworCW11dGV4X2xvY2soJmlwY2xvY2spOworCWlmIChpcGNkZXYucGRldiA9PSBOVUxMKSB7CisJCW11dGV4X3VubG9jaygmaXBjbG9jayk7CisJCXJldHVybiAtRU5PREVWOworCX0KKworCWZvciAoaSA9IDA7IGkgPCBpbmxlbjsgaSsrKQorCQlpcGNfZGF0YV93cml0ZWwoKmluKyssIDQgKiBpKTsKKworCWlwY19jb21tYW5kKGNtZCA8PCAxMiB8IHN1Yik7CisJZXJyID0gYnVzeV9sb29wKCk7CisKKwlmb3IgKGkgPSAwOyBpIDwgb3V0bGVuOyBpKyspCisJCSpvdXQrKyA9IGlwY19kYXRhX3JlYWRsKDQgKiBpKTsKKworCW11dGV4X3VubG9jaygmaXBjbG9jayk7CisJcmV0dXJuIGVycjsKK30KK0VYUE9SVF9TW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ioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKQEAgLTQ5NCwyMSArNTEyLDEzIEBACiAgKi8KIAogc3RhdGljIGFjcGlfaGFuZGxlIHJvb3RfaGFuZGxlOworc3RhdGljIGFjcGlfaGFuZGxlIGVjX2hhbmRsZTsKIAogI2RlZmluZSBUUEFDUElfSEFORExFKG9iamVjdCwgcGFyZW50LCBwYXRocy4uLikJCQlcCiAJc3RhdGljIGFjcGlfaGFuZGxlICBvYmplY3QjI19oYW5kbGU7CQkJXAotCXN0YXRpYyBhY3BpX2hhbmRsZSAqb2JqZWN0IyNfcGFyZW50ID0gJnBhcmVudCMjX2hhbmRsZTsJXAotCXN0YXRpYyBjaGFyICAgICAgICAqb2JqZWN0IyNfcGF0aDsJCQlcCi0Jc3RhdGljIGNoYXIgICAgICAgICpvYmplY3QjI19wYXRoc1tdID0geyBwYXRocyB9Ci0KLVRQQUNQSV9IQU5ETEUoZWMsIHJvb3QsICJcXF9TQi5QQ0kwLklTQS5FQzAiLAkvKiAyNDAsIDI0MHggKi8KLQkgICAiXFxfU0IuUENJLklTQS5FQyIsCS8qIDU3MCAqLwotCSAgICJcXF9TQi5QQ0kwLklTQTAuRUMwIiwJLyogNjAwZS94LCA3NzBlLCA3NzB4ICovCi0JICAgIlxcX1NCLlBDSTAuSVNBLkVDIiwJLyogQTIxZSwgQTJ4bS9wLCBUMjAtMjIsIFgyMC0yMSAqLwotCSAgICJcXF9TQi5QQ0kwLkFENFMuRUMwIiwJLyogaTE0MDAsIFIzMCAqLwotCSAgICJcXF9TQi5QQ0kwLklDSDMuRUMwIiwJLyogUjMxICovCi0JICAgIlxcX1NCLlBDSTAuTFBDLkVDIiwJLyogYWxsIG90aGVycyAqLwotCSAgICk7CisJc3RhdGljIGNvbnN0IGFjcGl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AgICAgdm9sYXRpbGUJdV9jaGFyIGNvbmZpZ1N0YXR1czsKLSAgICAgIHZvbGF0aWxlCXVfY2hhciBfMjI7Ci0gICAgICB2b2xhdGlsZQl1X2NoYXIgcHJvZ0lPQ3RybDsKLSAgICAgIHZvbGF0aWxlCXVfY2hhciBzaGFyZU1CYXNlOwotICAgICAgdm9sYXRpbGUJdV9jaGFyIGNvbnRyb2xSZWdpc3RlcjsKLX07Ci0KLXN0cnVjdCBhcmxhbl9jb25mX3N0cnUgewotICAgICAgaW50IHNwcmVhZGluZ0NvZGU7Ci0gICAgICBpbnQgY2hhbm5lbFNldDsKLSAgICAgIGludCBjaGFubmVsTnVtYmVyOwotICAgICAgaW50IHNjcmFtYmxpbmdEaXNhYmxlOwotICAgICAgaW50IHR4QXR0ZW51YXRpb247Ci0gICAgICBpbnQgc3lzdGVtSWQ7Ci0gICAgICBpbnQgbWF4RGF0YWdyYW1TaXplOwotICAgICAgaW50IG1heEZyYW1lU2l6ZTsKLSAgICAgIGludCBtYXhSZXRyaWVzOwotICAgICAgaW50IHJlY2VpdmVNb2RlOwotICAgICAgaW50IHByaW9yaXR5OwotICAgICAgaW50IHJvb3RPclJlcGVhdGVyOwotICAgICAgaW50IFNJRDsKLSAgICAgIGludCByYWRpb05vZGVJZDsKLSAgICAgIGludCByZWdpc3RyYXRpb25Nb2RlOwotICAgICAgaW50IHJlZ2lzdHJhdGlvbkZpbGw7Ci0gICAgICBpbnQgbG9jYWxUYWxrQWRkcmVzczsKLSAgICAgIGludCBjb2RlRm9ybWF0OwotICAgICAgaW50IG51bUNoYW5uZWxzOwotICAgICAgaW50IGNoYW5uZWwxOwotICAgICAgaW50IGNoYW5uZWwyOwotICAgICAgaW50IGNoYW5uZWwzOwotICAgICAgaW50IGNoYW5uZWw0OwotICAgICAgaW50IHR4Q2xlYXI7Ci0gICAgICBpbnQgdHhSZXRyaWVzOwotICAgICAgaW50IHR4Um91dGluZzsKLSAgICAgIGludCB0eFNjcmFtYmxlZD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WsgTGluZG5lciwgU2ltb24gV3VuZGVybGljaAogICoKQEAgLTUyLDYgKzUyLDggQEAKIAkgKi8KIAogCWlmICh0aW1lX2JlZm9yZShzZW5kX3RpbWUsIGZvcndfcGFja2V0LT5zZW5kX3RpbWUpICYmCisJICAgIHRpbWVfYWZ0ZXJfZXEoc2VuZF90aW1lICsgbXNlY3NfdG9famlmZmllcyhNQVhfQUdHUkVHQVRJT05fTVMpLAorCQkJCQlmb3J3X3BhY2tldC0+c2VuZF90aW1lKSAmJgogCSAgICAoYWdncmVnYXRlZF9ieXRlcyA8PSBNQVhfQUdHUkVHQVRJT05fQllURVMpKSB7CiAKIAkJLyoqCkBAIC03OSwxNCArODEsMjEgQEAKIAkJICogaW50ZXJmYWNlIG9ubHkgLSB3ZSBzdGlsbCBjYW4gYWdncmVnYXRlICovCiAJCWlmICgoZGlyZWN0bGluaykgJiYKIAkJICAgIChuZXdfYmF0bWFuX3BhY2tldC0+dHRsID09IDEpICYmCi0JCSAgICAoZm9yd19wYWNrZXQtPmlmX2luY29taW5nID09IGlmX2luY29taW5nKSkKLQkJCXJldHVybiB0cnVlOworCQkgICAgKGZvcndfcGFja2V0LT5pZl9pbmNvbWluZyA9PSBpZl9pbmNvbWluZykgJiYKIAorCQkgICAgLyogcGFja2V0cyBmcm9tIGRpcmVjdCBuZWlnaGJvcnMgb3IKKwkJICAgICAqIG93biBzZWNvbmRhcnkgaW50ZXJmYWNlIHBhY2tldHMKKwkJICAgICAqICg9IHNlY29uZGFyeSBpbnRlcmZhY2UgcGFja2V0cyBpbiBnZW5lcmFsKSAqLworCQkgICAgKGJhdG1hbl9wYWNrZXQtPmZsYWdzICYgRElSRUNUTElOSyB8fAorCQkgICAgIChmb3J3X3BhY2tldC0+b3duICYmCisJCSAgICAgIGZvcndfcGFja2V0LT5pZl9pbmNvbWluZy0+aWZfbnVtICE9IDApKSkKKwkJCXJldHVybiB0cnVlOwogCX0KIAogCXJldHVybiBmYWxzZTsKIH0KIAorI2RlZm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OworCX0KKworCXNwaW5fdW5sb2NrKCZvcmlnX2hhc2hfbG9jayk7CisJcmV0dXJuIDA7CisKK2VycjoKKwlzcGluX3VubG9jaygmb3JpZ19oYXNoX2xvY2spOworCXJldHVybiAtRU5PTUVNOworfQorCitzdGF0aWMgaW50IG9yaWdfbm9kZV9kZWxfaWYoc3RydWN0IG9yaWdfbm9kZSAqb3JpZ19ub2RlLAorCQkgICAgIGludCBtYXhfaWZfbnVtLCBpbnQgZGVsX2lmX251bSkKK3sKKwl2b2lkICpkYXRhX3B0ciA9IE5VTEw7CisJaW50IGNodW5rX3NpemU7CisKKwkvKiBsYXN0IGludGVyZmFjZSB3YXMgcmVtb3ZlZCAqLworCWlmIChtYXhfaWZfbnVtID09IDApCisJCWdvdG8gZnJlZV9iY2FzdF9vd247CisKKwljaHVua19zaXplID0gc2l6ZW9mKFRZUEVfT0ZfV09SRCkgKiBOVU1fV09SRFM7CisJZGF0YV9wdHIgPSBrbWFsbG9jKG1heF9pZl9udW0gKiBjaHVua19zaXplLCBHRlBfQVRPTUlDKTsKKwlpZiAoIWRhdGFfcHRyKSB7CisJCXByaW50ayhLRVJOX0VSUgorCQkgICAgICAgImJhdG1hbi1hZHY6Q2FuJ3QgcmVzaXplIG9yaWc6IG91dCBvZiBtZW1vcnlcbiIpOworCQlyZXR1cm4gLTE7CisJfQorCisJLyogY29weSBmaXJzdCBwYXJ0ICovCisJbWVtY3B5KGRhdGFfcHRyLCBvcmlnX25vZGUtPmJjYXN0X293biwgZGVsX2lmX251bSAqIGNodW5rX3NpemUpOworCisJLyogY29weSBzZWNvbmQgcGFydCAqLworCW1lbWNweShkYXRhX3B0ciwKKwkgICAgICAgb3JpZ19ub2RlLT5iY2FzdF9vd24gKyAoKGRlbF9pZl9udW0gKyAxKSAqIGNodW5rX3NpemUpLAorCSAgICAgICAobWF4X2lmX251bSAtIGRlbF9pZl9udW0pICogY2h1bmtfc2l6ZSk7CisKK2ZyZWVfYmNhc3Rfb3duOgorCWtmcm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vCitvYmotJChDT05GSUdfQ09NRURJX1BDTDcyNSkJCSs9IHBjbDcyNS5vCitvYmotJChDT05GSUdfQ09NRURJX1BDTDcyNikJCSs9IHBjbDcyNi5vCitvYmotJChDT05GSUdfQ09NRURJX1BDTDczMCkJCSs9IHBjbDczMC5vCitvYmotJChDT05GSUdfQ09NRURJX1BDTDgxMikJCSs9IHBjbDgxMi5vCitvYmotJChDT05GSUdfQ09NRURJX1BDTDgxNikJCSs9IHBjbDgxNi5vCitvYmotJChDT05GSUdfQ09NRURJX1BDTDgxOCkJCSs9IHBjbDgxOC5vCitvYmotJChDT05GSUdfQ09NRURJX1BDTTM3MjQpCQkrPSBwY20zNzI0Lm8KK29iai0kKENPTkZJR19DT01FRElfUENNMzczMCkJCSs9IHBjbTM3MzAubworb2JqLSQoQ09ORklHX0NPTUVESV9SVEk4MDApCQkrPSBydGk4MDAubworb2JqLSQoQ09ORklHX0NPTUVESV9SVEk4MDIpCQkrPSBydGk4MDIubworb2JqLSQoQ09ORklHX0NPTUVESV9EQVMwOCkJCSs9IGRhczA4Lm8KK29iai0kKENPTkZJR19DT01FRElfREFTMTZNMSkJCSs9IGRhczE2bTEubworb2JqLSQoQ09ORklHX0NPTUVESV9EQVMxNikJCSs9IGRhczE2Lm8KK29iai0kKENPTkZJR19DT01FRElfREFTODAwKQkJKz0gZGFzODAwLm8KK29iai0kKENPTkZJR19DT01FRElfREFTMTgwMCkJCSs9IGRhczE4MDAubworb2JqLSQoQ09ORklHX0NPTUVESV9EQVM2NDAyKQkJKz0gZGFzNjQwMi5vCitvYmotJChDT05GSUdfQ09NRURJX0RUMjgwMSkJCSs9IGR0MjgwMS5vCitvYmotJChDT05GSUdfQ09NRURJX0RUMjgxMSkJCSs9IGR0MjgxMS5vCitvYmotJChDT05GSUdfQ09NRURJX0RUMjgxNCkJCSs9IGR0MjgxNC5vCitvYmotJChDT05GSUdfQ09NRURJX0RUMjgxNSkJCSs9IGR0MjgxNS5vCitvYmotJChDT05GSUdfQ09NRURJX0RUMjgxNykJCSs9IGR0MjgxNy5vCitvYmotJChDT05GSUdfQ09NRURJX0RUMjgyWCkJCSs9IGR0MjgyeC5vCitvYmotJChDT05GSUdfQ09NRURJX0RNTTMyQVQpCQkrPSBkbW0zMmF0Lm8KK29iai0kKENPTkZJR19DT01FRElfRkw1MTIpCQkrPSBmbDUxMi5vCitvYmotJChDT05GSUdfQ09NRURJX0FJT19BSU8xMl84KQkrPSBhaW9fYWlvMTJfOC5vCitvYmotJChDT05GSUdfQ09NRURJX0FJT19JSVJPXzE2KQkrPSBhaW9faWlyb18xNi5vCitvYmotJChDT05GSUdfQ09NRURJX0M2WERJR0lPKQkJKz0gYzZ4ZGlnaW8ubworb2JqLSQoQ09ORklHX0NPTUVESV9NUEM2MjQpCQkrPSBtcGM2MjQubworb2JqLSQoQ09ORklHX0NPTUVESV9BRFExMkIpCQkrPSBhZHExMmIubworb2JqLSQoQ09ORklHX0NPTUVESV9OSV9BVF9BMjE1MCkJKz0gbmlfYXRfYTIxNTAubworb2JqLSQoQ09ORklHX0NPTUVESV9OSV9BVF9BTykJCSs9IG5pX2F0X2FvLm8KK29iai0kKENPTkZJR19DT01FRElfTklfQVRNSU8pCQkrPSBuaV9hdG1pby5vCitvYmotJChDT05GSUdfQ09NRURJX05JX0FUTUlPMTZEKQkrPSBuaV9hdG1pbzE2ZC5vCitvYmotJChDT05GSUdfQ09NRURJX1BDTUFEKQkJKz0gcGNtYWQubworb2JqLSQoQ09ORklHX0NPTUVESV9QQ01EQTEyKQkJKz0gcGNtZGExMi5vCitvYmotJChDT05GSUdfQ09NRURJX1BDTU1JTykJCSs9IHBjbW1pby5vCitvYmotJChDT05GSUdfQ09NRURJX1BDTVVJTykJCSs9IHBjbXVpby5vCitvYmotJChDT05GSUdfQ09NRURJX01VTFRJUTMpCQkrPSBtdWx0aXEzLm8KK29iai0kKENPTkZJR19DT01FRElfUE9DKQkJKz0gcG9jLm8KKwogIyBDb21lZGkgUENJIGRyaXZlcnMK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klWRVJTKQkrPSBzZXJpYWwyMDAyLm8KLW9iai0kKENPTkZJR19DT01FRElfUENJX0RSSVZFUlMpCSs9IHNrZWwubwotb2JqLSQoQ09ORklHX0NPTUVESV9QQ0lfRFJJVkVSUykJKz0gc3N2X2RucC5vCi1vYmotJChDT05GSUdfQ09NRURJX1BDSV9EUklWRVJTKQkrPSB1bmlveHg1Lm8KK29iai0kKENPTkZJR19DT01FRElfQURESV9BUENJXzAzNSkJKz0gYWRkaV9hcGNpXzAzNS5vCitvYmotJChDT05GSUdfQ09NRURJX0FERElfQVBDSV8xMDMyKQkrPSBhZGRpX2FwY2lfMTAzMi5vCitvYmotJChDT05GSUdfQ09NRURJX0FERElfQVBDSV8xNTAwKQkrPSBhZGRpX2FwY2lfMTUwMC5vCitvYmotJChDT05GSUdfQ09NRURJX0FERElfQVBDSV8xNTE2KQkrPSBhZGRpX2FwY2lfMTUxNi5vCitvYmotJChDT05GSUdfQ09NRURJX0FERElfQVBDSV8xNTY0KQkrPSBhZGRpX2FwY2lfMTU2NC5vCitvYmotJChDT05GSUdfQ09NRURJX0FERElfQVBDSV8xNlhYKQkrPSBhZGRpX2FwY2lfMTZ4eC5vCitvYmotJChDT05GSUdfQ09NRURJX0FERElfQVBDSV8yMDE2KQkrPSBhZGRpX2FwY2lfMjAxNi5vCitvYmotJChDT05GSUdfQ09NRURJX0FERElfQVBDSV8yMDMyKQkrPSBhZGRpX2FwY2lfMjAzMi5vCitvYmotJChDT05GSUdfQ09NRURJX0FERElfQVBDSV8yMjAwKQkrPSBhZGRpX2FwY2lfMjIwMC5vCitvYmotJChDT05GSUdfQ09NRURJX0FERElfQVBDSV8zMDAxKQkrPSBhZGRpX2FwY2lfMzAwMS5vCitvYmotJChDT05GSUdfQ09NRURJX0FERElfQVBDSV8zMTIwKQkrPSBhZGRpX2FwY2lfMzEyMC5vCitvYmotJChDT05GSUdfQ09NRURJX0FERElfQVBDSV8zNTAxKQkrPSBhZGRpX2FwY2lfMzUwMS5vCitv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UdfQ09NRURJX0NPTlRFQ19QQ0lfRElPKQkrPSBjb250ZWNfcGNpX2Rpby5vCitvYmotJChDT05GSUdfQ09NRURJX0RUMzAwMCkJCSs9IGR0MzAwMC5vCitvYmotJChDT05GSUdfQ09NRURJX1VOSU9YWDUpCQkrPSB1bmlveHg1Lm8KK29iai0kKENPTkZJR19DT01FRElfR1NDX0hQREkpCQkrPSBnc2NfaHBkaS5vCitvYmotJChDT05GSUdfQ09NRURJX0lDUF9NVUxUSSkJCSs9IGljcF9tdWx0aS5vCitvYmotJChDT05GSUdfQ09NRURJX0lJX1BDSTIwS0MpCQkrPSBpaV9wY2kyMGtjLm8KK29iai0kKENPTkZJR19DT01FRElfREFRQk9BUkQyMDAwKQkrPSBkYXFib2FyZDIwMDAubworb2JqLSQoQ09ORklHX0NPTUVESV9KUjNfUENJKQkJKz0ganIzX3BjaS5vCitvYmotJChDT05GSUdfQ09NRURJX0tFX0NPVU5URVIpCQkrPSBrZV9jb3VudGVyLm8KK29iai0kKENPTkZJR19DT01FRElfQ0JfUENJREFTNjQpCSs9IGNiX3BjaWRhczY0Lm8KK29iai0kKENPTkZJR19DT01FRElfQ0JfUENJREFTKQkJKz0gY2JfcGNpZGFzLm8KK29iai0kKENPTkZJR19DT01FRElfQ0JfUENJRERBKQkJKz0gY2JfcGNpZGRhLm8KK29iai0kKENPTkZJR19DT01FRElfQ0JfUENJRElPKQkJKz0gY2JfcGNpZGlvLm8KK29iai0kKENPTkZJR19DT01FRElfQ0JfUENJTURBUykJCSs9IGNiX3BjaW1kYXMubworb2JqLSQoQ09ORklHX0NPTUVESV9DQl9QQ0lNRERBKQkJKz0gY2JfcGNpbWRkYS5vCitvYmotJChDT05GSUdfQ09NRURJX01FNDAwMCkJCSs9IG1lNDAwMC5vCitvYmotJChDT05GSUdfQ09NRURJX01FX0RBUSkJCSs9IG1lX2RhcS5vCitvYmotJChDT05GSUdfQ09NRURJX05JXzY1MjcpCQkrPSBuaV82NTI3Lm8KK29iai0kKENPTkZJR19DT01FRElfTklfNjVYWCkJCSs9IG5pXzY1eHgubworb2JqLSQoQ09ORklHX0NPTUVESV9OSV82NjBYKQkJKz0gbmlfNjYweC5vCitvYmotJChDT05GSUdfQ09NRURJX05JXzY3MFgpCQkrPSBuaV82NzB4Lm8KK29iai0kKENPTkZJR19DT01FRElfTklfUENJRElPKQkJKz0gbmlfcGNpZGlvLm8KK29iai0kKENPTkZJR19DT01FRElfTklfUENJTUlPKQkJKz0gbmlfcGNpbWlvLm8KK29iai0kKENPTkZJR19DT01FRElfUlRENTIwKQkJKz0gcnRkNTIwLm8KK29iai0kKENPTkZJR19DT01FRElfUzUyNikJCSs9IHM1MjYubworb2JqLSQoQ09ORklHX0NPTUVESV9TNjI2KQkJKz0gczYyNi5vCitvYmotJChDT05GSUdfQ09NRURJX1NTVl9ETlApCQkrPSBzc3ZfZG5wLm8KIAogIyBDb21lZGkgUENNQ0lBIGRyaXZlcnMKLW9iai0kKENPTkZJR19DT01FRElfUENNQ0lBX0RSSVZFUlMpCSs9IGNiX2RhczE2X2NzLm8KLW9iai0kKENPTkZJR19DT01FRElfUENNQ0lBX0RSSVZFUlMpCSs9IGRhczA4X2NzLm8KLW9iai0kKENPTkZJR19DT01FRElfUENNQ0lBX0RSSVZFUlMpCSs9IG5pX2RhcV83MDAubwotb2JqLSQoQ09ORklHX0NPTUVESV9QQ01DSUFfRFJJVkVSUykJKz0gbmlfZGFxX2RpbzI0Lm8KLW9iai0kKENPTkZJR19DT01FRElfUENNQ0lBX0RSSVZFUlMpCSs9IG5pX2xhYnBjX2NzLm8KLW9iai0kKENPTkZJR19DT01FRElfUENNQ0lBX0RSSVZFUlMpCSs9IG5pX21pb19jcy5vCi1vYmotJChDT05GSUdfQ09NRURJX1BDTUNJQV9EUklWRVJTKQkrPSBxdWF0ZWNoX2RhcXBfY3Mubworb2JqLSQoQ09ORklHX0NPTUVESV9DQl9EQVMxNl9DUykJKz0gY2JfZGFzMTZfY3Mubworb2JqLSQoQ09OR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KioqKioqKioqKioqKioqKioqKi8KIAkJCQkJLyogUmVzdGF1cmUgZGVsYXkgbW9kZSAqLwogCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqLwogCi0JCQkJCXdyaXRlbChkd19UZW1wLAotCQkJCQkJKHZvaWQgKikoZGV2cHJpdi0+ZHdfQWlCYXNlICsKLQkJCQkJCQk0KSk7CisJCQkJCXdyaXRlbChkd19UZW1wLCBkZXZwcml2LT5kd19BaUJhc2UgKyA0KTsKIAogCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQkvKiBTZXQgdGhlIG51bWJlciBvZiBzZXF1ZW5jZSB0byAxICovCiAJCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKLQkJCQkJd3JpdGVsKDEsCi0JCQkJCQkodm9pZCAqKShkZXZwcml2LT5kd19BaUJhc2UgKwotCQkJCQkJCTQ4KSk7CisJCQkJCXdyaXRlbCgxLCBkZXZwcml2LT5kd19BaUJhc2UgKyA0OCk7CiAKIAkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIFNhdmUgdGhlIGludGVycnVwdCBmbGFnICovCkBAIC01MTQsNTAgKzQ5OCwyOSBAQAogCQkJCQkJCS8qIFN0YXJ0IHRoZSBjb252ZXJzaW9uICovCiAJCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKiovCiAKLQkJCQkJCQl3cml0ZWwoMHg4MDAwMFVMLAotCQkJCQkJCQkodm9pZCAqKQotCQkJCQkJCQkoZGV2cHJpdi0+Ci0JCQkJCQkJCQlkd19BaUJhc2UKLQkJCQkJCQkJCSsgOCkpOworCQkJCQkJCXdyaXRlbCgweDgwMDAwVUwsIGRldnByaXYtPmR3X0FpQmFzZSArIDgpOwogCiAJCQkgIC8qKioqKioqKioqKioqKioqLwogCQkJCQkJCS8qIFdhaXQgdGhlIEVPUyAqLwogCQkJICAvKioqKioqKioqKioqKioqKi8KI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AgICAgICAgICAgICAwID09IHNpbmdsZS1lbmRlZAotICAgICAgICAgICAgICAgICAxID09IGRpZmZlcmVudGlhbAotICAgICAgICAgICAgICAgICAyID09IHBzZXVkby1kaWZmZXJlbnRpYWwKKwkJIDAgPT0gc2luZ2xlLWVuZGVkCisJCSAxID09IGRpZmZlcmVudGlhbAorCQkgMiA9PSBwc2V1ZG8tZGlmZmVyZW50aWFsCiAgIG9wdGlvbnNbM10gICBBbmFsb2cgaW5wdXQgcmFuZ2UgY29uZmlndXJhdGlvbgotICAgICAgICAgICAgICAgICAwID09IGJpcG9sYXIgNSAgKC01ViAtLSArNVYpCi0gICAgICAgICAgICAgICAgIDEgPT0gYmlwb2xhciAyLjVWICAoLTIuNVYgLS0gKzIuNVYpCi0gICAgICAgICAgICAgICAgIDIgPT0gdW5pcG9sYXIgNVYgICgwViAtLSArNVYpCisJCSAwID09IGJpcG9sYXIgNSAgKC01ViAtLSArNVYpCisJCSAxID09IGJpcG9sYXIgMi41ViAgKC0yLjVWIC0tICsyLjVWKQorCQkgMiA9PSB1bmlwb2xhciA1ViAgKDBWIC0tICs1VikKICAgb3B0aW9uc1s0XSAgIEFuYWxvZyBvdXRwdXQgMCByYW5nZSBjb25maWd1cmF0aW9uCi0gICAgICAgICAgICAgICAgIDAgPT0gYmlwb2xhciA1ICAoLTVWIC0tICs1VikKLSAgICAgICAgICAgICAgICAgMSA9PSBiaXBvbGFyIDIuNVYgICgtMi41ViAtLSArMi41VikKLSAgICAgICAgICAgICAgICAgMiA9PSB1bmlwb2xhciA1ViAgKDBWIC0tICs1VikKKwkJIDAgPT0gYmlwb2xhciA1ICAoLTVWIC0tICs1VikKKwkJIDEgPT0gYmlwb2xhciAyLjVWICAoLTIuNVYgLS0gKzIuNVYpCisJCSAyID09IHVuaXBvbGFyIDVWICAoMFYgLS0gKzVWKQogICBvcHRpb25zWzVdICAgQW5hbG9nIG91dHB1dCAxIHJhbmdlIGNvbmZpZ3VyYXRpb24KLSAgICAgICAgICA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x1ZGUgPGxpbnV4L3BjaS5oPgogI2luY2x1ZGUgIi4uL2NvbWVkaWRldi5oIgogCi0jZGVmaW5lIFBDSV9WRU5ET1JfSURfTkFUSU5TVAkJMHgxMDkzCi0KIC8qICAjZGVmaW5lIERFQlVHX01JVEUgKi8KICNkZWZpbmUgUENJTUlPX0NPTVBBVAogCmRpZmYgLS1naXQgYS9kcml2ZXJzL3N0YWdpbmcvY29tZWRpL2RyaXZlcnMvbXBjNjI0LmMgYi9kcml2ZXJzL3N0YWdpbmcvY29tZWRpL2RyaXZlcnMvbXBjNjI0LmMKaW5kZXggMTJlNzJjOC4uOTg3NGFjMyAxMDA2NDQKLS0tIGEvZHJpdmVycy9zdGFnaW5nL2NvbWVkaS9kcml2ZXJzL21wYzYyNC5jCisrKyBiL2RyaXZlcnMvc3RhZ2luZy9jb21lZGkvZHJpdmVycy9tcGM2MjQuYwpAQCAtNDAsMjAgKzQwLDIwIEBACiBDb25maWd1cmF0aW9uIE9wdGlvbnM6CiAgIFswXSAtIEkvTyBiYXNlIGFkZHJlc3MKICAgWzFdIC0gY29udmVydGlvbiByYXRlCi0gICAgICAgICAgICBDb252ZXJ0aW9uIHJhdGUgIFJNUyBub2lzZSAgRWZmZWN0aXZlIE51bWJlciBPZiBCaXRzCi0gICAgICAgICAwICAgICAgMy41MmtIeiAgICAgICAgMjN1ViAgICAgICAgICAgICAgICAxNwotICAgICAgICAgMSAgICAgIDEuNzZrSHogICAgICAgMy41dVYgICAgICAgICAgICAgICAgMjAKLSAgICAgICAgIDIgICAgICAgODgwSHogICAgICAgICAydVYgICAgICAgICAgICAgICAgMjEuMwotICAgICAgICAgMyAgICAgICA0NDBIeiAgICAgICAgMS40dVYgICAgICAgICAgICAgICAyMS44Ci0gICAgICAgICA0ICAgICAgIDIyMEh6ICAgICAgICAgMXVWICAgICAgICAgICAgICAgIDIyLjQKLSAgICAgICAgIDUgICAgICAgMTEwSHogICAgICAgIDc1MHVWICAgICAgICAgICAgICAgMjIuOQotICAgICAgICAgNiAgICAgICA1NUh6ICAgICAgICAgNTEwblYgICAgICAgICAgICAgICAyMy40Ci0gICAgICAgICA3ICAgICAgMjcuNUh6ICAgICAgICAzNzVuViAgICAgICAgICAgICAgICAyNAotICAgICAgICAgOCAgICAgIDEzLjc1SHogICAgICAgMjUwblYgICAgICAgICAgICAgICAyNC40Ci0gICAgICAgICA5ICAgICAgNi44NzVIeiAgICAgICAyMDBuViAgICAgICAgICAgICAgIDI0LjYKLSAgIFsyXSAtIHZvbHRhZ2UgcmFuZ2UKLSAgICAgICAgIDAgICAgICAtMS4wMVYgLi4gKzEuMDFWCi0gICAgICAgICAxICAgICAgLTEwLjFWIC4uICsxMC4xVgorCUNvbnZlcnRpb24gcmF0ZSAgUk1TIG5vaXNlICBFZmZlY3RpdmUgTnVtYmVyIE9mIEJpdHMKKwkwICAgICAgMy41MmtIeiAgICAgICAgMjN1ViAgICAgICAgICAgICAgICAxNworCTEgICAgICAxLjc2a0h6ICAgICAgIDMuNXVWICAgICAgICAgICAgICAgIDIwCisJMiAgICAgICA4ODBIeiAgICAgICAgIDJ1ViAgICAgICAgICAgICAgICAyMS4zCisJMyAgICAgICA0NDBIeiAgICAgICAgMS40dVYgICAgICAgICAgICAgICAyMS44CisJNCAgICAgICAyMjBIeiAgICAgICAgIDF1ViAgICAgICAgICAgICAgICAyMi40CisJNSAgICAgICAxMTBIeiAgICAgICAgNzUwdVYgICAgICAgICAgICAgICAyMi45CisJNiAgICAgICA1NUh6ICAgICAgICAgNTEwblYgICAgICAgICAgICAgICAyMy40CisJNyAgICAgIDI3LjVIeiAgICAgICAgMzc1blYgICAgICAgICAgICAgICAgMjQKKwk4ICAgICAgMTMuNzVIeiAgICAgICAyNTBuViAgICAgICAgICAgICAgIDI0LjQKKwk5ICAgICAgNi44NzVIeiAgICAgICAyMDBuViAgICAgICAgICAgICAgIDI0LjYKKyAgWzJdIC0gdm9sdGFnZSByYW5nZQorCTAgICAgICAtMS4wMVYgLi4gKzEuMDF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ICAgICAgMCBpZiBuZWdhdGl2ZQorCQkgKiAgICAyODogTVNCCisJCSAqICAgICAgICAgIChNb3N0IFNpZ25pZmljYW50IEJpdCkgLSB0aGUgZmlyc3QgYml0IG9mCisJCSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgY29udmVyc2lvbiByZXN1bHQKKwkJICogICAgLi4uLgorCQkgKiAgICAwNTogTFNCCisJCSAqICAgICAgICAgIChMZWFzdCBTaWduaWZpY2FudCBCaXQpLSB0aGUgbGFzdCBiaXQgb2YgdGhlCisJCSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb252ZXJzaW9uIHJlc3VsdAorCQkgKiAgICAwNC0wMDogc3ViLUxTQgorCQkgKiAgICAgICAgICAtIHN1Yi1MU0JzIGFyZSBiYXNpY2FsbHkgbm9pc2UsIGJ1dCB3aGVuCisJCSAqICAgICAgICAgICAgYXZlcmFnZWQgcHJvcGVybHksIHRoZXkgY2FuIGluY3JlYXNlIGNvbnZlcnNpb24KKwkJICogICAgICAgICAgICBwcmVjaXNpb24gdXAgdG8gMjkgYml0czsgdGhleSBjYW4gYmUgZGlzY2FyZGVkCisJCSAqICAgICAgICAgICAgd2l0aG91dCBsb3NzIG9mIHJlc29sdXRpb24uCisJCSAqLwogCiAJCWlmIChkYXRhX2luICYgTVBDNjI0X0VPQ19CSVQpCi0JCQlwcmludGsoIk1QQzYyNDogRU9DIGJpdCBpcyBzZXQgKGRhdGFfaW49JWx1KSEiLAorCQkJcHJpbnRrKEtFUk5fSU5GTyAiTVBDNjI0OkVPQyBiaXQgaXMgc2V0IChkYXRhX2luPSVsdSkhIiwKIAkJCSAgICAgICBkYXRhX2luKTsKIAkJaWYgKGRhdGFfaW4gJiBNUEM2MjRfRE1ZX0JJVCkKLQkJCXByaW50aygiTVBDNjI0OiBETVkgYml0IGlzIHNldCAoZGF0YV9pbj0lbHUpISIsCisJCQlwcmludGsoS0VSTl9JTkZPICJNUEM2MjQ6RE1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AgICAgICAgICAgICAgICAgICAgICAgICAgICovCisJLyogV2UgY2FuIHVzZSB0aGUgInRoaXNib2FyZCIgbWFjcm8gbm93LiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIAlkZXYtPmJvYXJkX25hbWUgPSB0aGlzYm9hcmQtPm5hbWU7CiAKLQkvKiBBbGxvY2F0ZSB0aGUgcHJpdmF0ZSBzdHJ1Y3R1cmUgYXJlYS4gYWxsb2NfcHJpdmF0ZSgpIGlzIGEgY29udmVuaWVudCAgICAqLwotCS8qIG1hY3JvIGRlZmluZWQgaW4gY29tZWRpZGV2LmguICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisJLyogQWxsb2NhdGUgdGhlIHByaXZhdGUgc3RydWN0dXJlIGFyZWEuIGFsbG9jX3ByaXZhdGUoKSBpcyBhICAgICAgICAgKi8KKwkvKiBjb252ZW5pZW50IG1hY3JvIGRlZmluZWQgaW4gY29tZWRpZGV2LmguICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogCWlmIChhbGxvY19wcml2YXRlKGRldiwgc2l6ZW9mKHN0cnVjdCBkbnBfcHJpdmF0ZV9kYXRhKSkgPCAwKQogCQlyZXR1cm4gLUVOT01FTTsKIAotCS8qIEFsbG9jYXRlIHRoZSBzdWJkZXZpY2Ugc3RydWN0dXJlcy4gYWxsb2Nfc3ViZGV2aWNlKCkgaXMgYSBjb252ZW5pZW50ICAgICovCi0JLyogbWFjcm8gZGVmaW5lZCBpbiBjb21lZGlkZXYuaC4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKwkvKiBBbGxvY2F0ZSB0aGUgc3ViZGV2aWNlIHN0cnVjdHVyZXMuIGFsbG9jX3N1YmRldmljZSgpIGlzIGEgICAgICAgICAqLworCS8qIGNvbnZlbmllbnQgbWFjcm8gZGVmaW5lZCBpbiBjb21lZGlkZXYuaC4gICAgICAgICAgICAgICAgICAgICAgICAgICovCiAKIAlpZi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MgaW5wdXQgKGRlZmF1bHQpICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAJb3V0YihQQU1SLCBDU0NJUik7CiAJb3V0YigweDAwLCBDU0NEUik7CiAJb3V0YihQQk1SLCBDU0NJUik7CkBAIC0xODksOCArMTkyLDggQEAKIAlvdXRiKFBDTVIsIENTQ0lSKTsKIAlvdXRiKChpbmIoQ1NDRFIpICYgMHhBQSksIENTQ0RSKTsKIAotCS8qIGFubm91bmNlIHRoYXQgd2UgYXJlIGZpbmlzaGVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JcHJpbnRrKCJjb21lZGklZDogZG5wOiByZW1vdmVcbiIsIGRldi0+bWlub3IpOworCS8qIGFubm91bmNlIHRoYXQgd2UgYXJlIGZpbmlzaGVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisJcHJpbnRrKEtFUk5fSU5GTyAiY29tZWRpJWQ6IGRucDogcmVtb3ZlXG4iLCBkZXYtPm1pbm9yKTsKIAogCXJldHVybiAwOwogCkBAIC0yMTAsMTIgKzIxMywxMiBAQAogCWlmIChpbnNuLT5uICE9IDIpCiAJCXJldHVybiAtRUlOVkFMOwkvKiBpbnNuIHVzZXMgZGF0YVswXSBhbmQgZGF0YVsxXSAgICAgKi8KIAotCS8qIFRoZSBpbnNuIGRhdGEgaXMgYSBtYXNrIGluIGRhdGFbMF0gYW5kIHRoZSBuZXcgZGF0YSBpbiBkYXRhWzFdLCBlYWNoICAgICovCi0JLyogY2hhbm5lbCBjb29yZXNwb25kaW5nIHRvIGEgYml0LiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKwkvKiBUaGUgaW5zbiBkYXRhIGlzIGEgbWFzayBpbiBkYXRhWzBdIGFuZCB0aGUgbmV3IGRhdGEgaW4gZGF0YVsxXSwgICAqLworCS8qIGVhY2ggY2hhbm5lbCBjb29yZXNwb25kaW5nIHRvIGEgYml0LiAgICAgIC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gMiAxIDAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisJLyogQ29ycmVzcG9uZGluZyBwb3J0IEMgcGluOiBkIDMgZCAyIGQgMSBkIDAgICBkPSBkb24ndCB0b3VjaCAgICAgICAgICovCiAKIAlpZiAoKGNoYW4gPj0gMCkgJiYgKGNoYW4gPD0gNykpIHsKIAkJLyogdGhpcyBpcyBwb3J0IEEgKi8KQEAgLTI4OSw4ICsyOTMsOCBAQAogCQljaGFuIC09IDg7CiAJCW91dGIoUEJNUiwgQ1NDSVIpOwogCX0gZWxzZSBpZiAoKGNoYW4gPj0gMTYpICYmIChjaGFuIDw9IDE5KSkgewotCQkvKiB0aGlzIGlzIHBvcnQgQzsgbXVsdGlwbGljYXRpb24gd2l0aCAyIGJyaW5ncyBiaXRzIGludG8gY29ycmVjdCAgICAgICAgKi8KLQkJLyogcG9zaXRpb24gZm9yIFBDTVIhICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisJCS8qIHRoaXMgaXMgcG9ydCBDOyBtdWx0aXBsaWNhdGlvbiB3aXRoIDIgYnJpbmdzIGJpdHMgaW50byAgICAgKi8KKwkJLyogY29ycmVjdCBwb3NpdGlvbiBmb3IgUENNUiEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogCQljaGFuIC09IDE2OwogCQljaGFuICo9IDI7CiAJCW91dGIoUENNUiwgQ1NDSVIpOwpAQCAtMjk4LDcgKzMwMiw3IEBACiAJCXJldHVybiAtRUlOVkFMOwogCX0KIAotCS8qIHJlYWQgJ29sZCcgZGlyZWN0aW9uIG9mIHRoZSBwb3J0IGFuZCBzZXQgYml0cyAob3V0PTEsIGluPTApICAgICAgICAgICAgICovCisJLyogcmVhZCAnb2xkJyBkaXJlY3Rpb24gb2YgdGhlIHBvcnQgYW5kIHNldCBiaXRzIChvdXQ9MSwgaW49MCkgICAgICAgICovCiAJcmVnaXN0ZXJfYnVmZmVyID0gaW5iKENTQ0RSK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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICBUaGlzIHByb2dyYW0gaXMgZnJlZSBzb2Z0d2FyZTsgeW91IGNhbiByZWRpc3RyaWJ1dGUgaXQgYW5kL29yIG1vZGlmeSAgKgotICogICBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGFzIHB1Ymxpc2hlZCBieSAgKgotICogICB0aGUgRnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uOyBlaXRoZXIgdmVyc2lvbiAyIG9mIHRoZSBMaWNlbnNlLCBvciAgICAgKgotICogICAoYXQgeW91ciBvcHRpb24pIGFueSBsYXRlciB2ZXJzaW9uLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2lmbmRlZiBfX0NPTVBBVF9MSU5VWF9QQ0lfSURTX0gKLSNkZWZpbmUgX19DT01QQVRfTElOVVhfUENJX0lEU19ICi0KLSNpbmNsdWRlIDxsaW51eC9wY2lfaWRzLmg+Ci0KLSNpZm5kZWYgUENJX1ZFTkRPUl9JRF9BTUNDCi0jZGVmaW5lIFBDSV9WRU5ET1JfSURfQU1DQwkweDEwZTgKLSNlbmRpZgotCi0jaWZuZGVmIFBDSV9WRU5ET1JfSURfQ0JPQVJEUwotI2RlZmluZSBQQ0lfVkVORE9SX0lEX0NCT0FSRFMJMHgxMzA3Ci0jZW5kaWYKLQotI2lmbmRlZiBQQ0lfVkVORE9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ZvaWQgICAgICAgKlRXVl90YWJsZVsxMl0gPSB7CisgICAgVFdWTG9uZ0hhdWwwREIsIFRXVkxvbmdIYXVsN181REIsIFRXVkxvbmdIYXVsMTVEQiwgVFdWTG9uZ0hhdWwyMl81REIsCisgICAgVFdWU2hvcnRIYXVsMCwgVFdWU2hvcnRIYXVsMSwgVFdWU2hvcnRIYXVsMiwgVFdWU2hvcnRIYXVsMywgVFdWU2hvcnRIYXVsNCwKKyAgICBUV1ZTaG9ydEhhdWw1LAorICAgIFRXVl9FMV83NU9obSwgICAgLyoqIFBPUlQgUE9JTlQgLSA3NSBPaG0gbm90IHN1cHBvcnRlZCAqKi8KKyAgICBUV1ZfRTFfMTIwT2htCit9OworCisKK3N0YXRpYyBpbnQKK2xib190YmxfbGt1cCAoaW50IHQxLCBpbnQgbGJvKQoreworICAgIGlmICgobGJvIDwgQ0ZHX0xCT19MSDApIHx8IChsYm8gPiBDRkdfTEJPX0UxMjApKSAgICAvKiBlcnJvciBzd2l0Y2hlcyB0bworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBkZWZhdWx0ICovCisgICAgeworICAgICAgICBpZiAodDEpCisgICAgICAgICAgICBsYm8gPSBDRkdfTEJPX0xIMDsgIC8qIGRlZmF1bHQgVDEgd2F2ZWZvcm0gdGFibGUgKi8KKyAgICAgICAgZWxzZQorICAgICAgICAgICAgbGJvID0gQ0ZHX0xCT19FMTIwOyAgICAgLyogZGVmYXVsdCBFMSB3YXZlZm9ybSB0YWJsZSAqLworICAgIH0KKyAgICByZXR1cm4gKGxibyAtIDEpOyAgICAgICAgICAgICAgIC8qIG1ha2UgaW5kZXggWkVSTyByZWxhdGl2ZSAqLworfQorCisKK3ZvaWQKK2luaXRfY29tZXQgKHZvaWQgKmNpLCBjb21ldF90ICogY29tZXQsIHVfaW50MzJfdCBwb3J0X21vZGUsIGludCBjbG9ja21hc3RlciwKKyAgICAgICAgICAgIHVfaW50OF90IG1vcmVQYXJhbXMpCit7CisgICAgdV9pbnQ4X3QgaXNUMW1vZGU7CisgICAgdV9pbnQ4X3QgICAgdGl4ID0gQ0ZHX0xCT19MSDA7ICAgICAgLyogVDEgZGVmYXVsdCAqLworCisgICAgaXNUMW1vZGUgPSBJU19GUkFNRV9BTllfVDEgKHBvcnRfbW9kZSk7CisgICAgLyogVDEgb3IgRTEgKi8KKyAgICBpZiAoaXNUMW1vZGUpCisgICAgeworICAgICAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5nYmxfY2ZnLCAweGEwKTsgICAgIC8qIFNlbGVjdCBUMSBNb2RlICYgUElPCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogb3V0cHV0IGVuYWJsZWQgKi8KKyAgICAgICAgdGl4ID0gbGJvX3RibF9sa3VwIChpc1QxbW9kZSwgQ0ZHX0xCT19MSDApOyAgICAgLyogZGVmYXVsdCBUMSB3YXZlZm9ybQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiB0YWJsZSAqLworICAgIH0gZWxzZQorICAgIHsKKyAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+Z2JsX2NmZywgMHg4MSk7ICAgICAvKiBTZWxlY3QgRTEgTW9kZSAmIFBJTworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIG91dHB1dCBlbmFibGVkICovCisgICAgICAgIHRpeCA9IGxib190YmxfbGt1cCAoaXNUMW1vZGUsIENGR19MQk9fRTEyMCk7ICAgIC8qIGRlZmF1bHQgRTEgd2F2ZWZvcm0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogdGFibGUgKi8KKyAgICB9CisKKyAgICBpZiAobW9yZVBhcmFtcyAmIENGR19MQk9fTUFTSykKKyAgICAgICAgdGl4ID0gbGJvX3RibF9sa3VwIChpc1QxbW9kZSwgbW9yZVBhcmFtcyAmIENGR19MQk9fTUFTSyk7ICAgICAgIC8qIGRpYWwtaW4gcmVxdWVzdGVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiB3YXZlZm9ybSB0YWJsZSAqLworCisgICAgLyogVHggbGluZSBJbnRmYyBjZmcgICAgICoqIFNldCBmb3IgYW5hbG9nICYgbm8gc3BlY2lhbCBwYXR0ZXJucyAqLworICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPnR4X2xpbmVfY2ZnLCAweDAwKTsgICAgIC8qIFRyYW5zbWl0IExpbmUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBJbnRlcmZhY2UgQ29uZmlnLiAqLworCisgICAgLyogbWFzdGVyIHRlc3QgICAgKiogSWdub3JlIFRlc3Qgc2V0dGluZ3MgZm9yIG5vdyAqLworICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPm10ZXN0LCAweDAwKTsgICAvKiBtYWtpbmcgc3VyZSBpdCdzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIERlZmF1bHQgdmFsdWUgKi8KKworICAgIC8qIFR1cm4gb24gQ2VudGVyIChDRU5UKSBhbmQgZXZlcnl0aGluZyBlbHNlIG9mZiAqLworICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPnJqYXRfY2ZnLCAweDEwKTsgICAgICAgIC8qIFJKQVQgY2ZnICovCisgICAgLyogU2V0IEppdHRlciBBdHRlbnVhdGlvbiB0byByZWNvbW1lbmQgVDEgdmFsdWVzICovCisgICAgaWYgKGlzVDFtb2RlKQorICAgIHsKKyAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+cmphdF9uMWNsaywgMHgyRik7ICAvKiBSSkFUIERpdmlkZXIgTjEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBDb250cm9sICovCisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPnJqYXRfbjJjbGssIDB4MkYpOyAgLyogUkpBVCBEaXZpZGVyIE4yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogQ29udHJvbCAqLworICAgIH0gZWxzZQorICAgIHsKKyAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+cmphdF9uMWNsaywgMHhGRik7ICAvKiBSSkFUIERpdmlkZXIgTjEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBDb250cm9sICovCisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPnJqYXRfbjJjbGssIDB4RkYpOyAgLyogUkpBVCBEaXZpZGVyIE4yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogQ29udHJvbCAqLworICAgIH0KKworICAgIC8qIFR1cm4gb24gQ2VudGVyIChDRU5UKSBhbmQgZXZlcnl0aGluZyBlbHNlIG9mZiAqLworICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPnRqYXRfY2ZnLCAweDEwKTsgICAgICAgIC8qIFRKQVQgQ29uZmlnLiAqLworCisgICAgLyogRG8gbm90IGJ5cGFzcyBqaXR0ZXIgYXR0ZW51YXRpb24gYW5kIGJ5cGFzcyBlbGFzdGljIHN0b3JlICovCisgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+cnhfb3B0LCAweDAwKTsgIC8qIHJ4IG9wdHMgKi8KKworICAgIC8qIFRKQVQgY3RybCAmIFRKQVQgZGl2aWRlciBjdHJsICovCisgICAgLyogU2V0IEppdHRlciBBdHRlbnVhdGlvbiB0byByZWNvbW1lbmRlZCBUMSB2YWx1ZXMgKi8KKyAgICBpZiAoaXNUMW1vZGUpCisgICAgeworICAgICAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT50amF0X24xY2xrLCAweDJGKTsgIC8qIFRKQVQgRGl2aWRlciBOMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIENvbnRyb2wgKi8KKyAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+dGphdF9uMmNsaywgMHgyRik7ICAvKiBUSkFUIERpdmlkZXIgTjIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBDb250cm9sICovCisgICAgfSBlbHNlCisgICAgeworICAgICAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT50amF0X24xY2xrLCAweEZGKTsgIC8qIFRKQVQgRGl2aWRlciBOMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIENvbnRyb2wgKi8KKyAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+dGphdF9uMmNsaywgMHhGRik7ICAvKiBUSkFUIERpdmlkZXIgTjIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBDb250cm9sICovCisgICAgfQorCisgICAgLyogMWM6IHJ4IEVMU1QgY2ZnICAgMjA6IHR4IEVMU1QgY2ZnICAyOCYzODogcngmdHggZGF0YSBsaW5rIGN0cmwgKi8KKyAgICBpZiAoaXNUMW1vZGUpCisgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBTZWxlY3QgMTkzLWJpdCBmcmFtZSBmb3JtYXQgKi8KKyAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+cnhfZWxzdF9jZmcsIDB4MDApOworICAgICAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT50eF9lbHN0X2NmZywgMHgwMCk7CisgICAgfSBlbHNlCisgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBTZWxlY3QgMjU2LWJpdCBmcmFtZSBmb3JtYXQgKi8KKyAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+cnhfZWxzdF9jZmcsIDB4MDMpOworICAgICAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT50eF9lbHN0X2NmZywgMHgwMyk7CisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPnJ4Y2UxX2N0bCwgMHgwMCk7ICAgLyogZGlzYWJsZSBUMSBkYXRhIGxpbmsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiByZWNlaXZlICovCisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPnR4Y2kxX2N0bCwgMHgwMCk7ICAgLyogZGlzYWJsZSBUMSBkYXRhIGxpbmsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiB0cmFuc21pdCAqLworICAgIH0KKworICAgIC8qIHRoZSBmb2xsb3dpbmcgaXMgYSBkZWZhdWx0IHZhbHVlICovCisgICAgLyogRW5hYmxlIDggb3V0IG9mIDEwIHZhbGlkYXRpb24gKi8KKyAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT50MV9yYm9jX2VuYSwgMHgwMCk7ICAgICAvKiB0MVJCT0MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBlbmFibGUoQk9DOkJpdE9yaWVudGVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogQ29kZSkgKi8KKyAgICBpZiAoaXNUMW1vZGUpCisgICAgeworCisgICAgICAgIC8qIElCQ0QgY2ZnOiBha2EgSW5iYW5kIENvZGUgRGV0ZWN0aW9uICoqIGxvb3BiYWNrIGNvZGUgbGVuZ3RoIHNldCB0byAqLworICAgICAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5pYmNkX2NmZywgMHgwNCk7ICAgIC8qIDYgYml0IGRvd24sIDUgYml0IHVwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogKGFzc2VydCkgICovCisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPmliY2RfYWN0LCAweDA4KTsgICAgLyogbGluZSBsb29wYmFjaworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGFjdGl2YXRlIHBhdHRlcm4gKi8KKyAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+aWJjZF9kZWFjdCwgMHgyNCk7ICAvKiBkZWFjdGl2YXRlIGNvZGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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ICAgLyogQml0IDU6IFQxIERhdGFMaW5rCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogRW5hYmxlICovCisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPnR4Y2kxX2N0bCwgMHgyMCk7ICAgLyogNTogVDEgRGF0YUxpbmsgRW5hYmxlICovCisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPnQxX2ZybXJfY2ZnLCAweDMwKTsgLyogNDpFU0YgIDU6RVNGRkEgKi8KKyAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+c2lneF9jZmcsIDB4MDQpOyAgICAvKiAyOkVTRiAqLworICAgICAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT50MV94YmFzX2NmZywgMHgzMCk7IC8qIDQ6RVNGICA1OkI4WlMgKi8KKyAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+dDFfYWxtaV9jZmcsIDB4MTApOyAvKiA0OkVTRiAqLworICAgICAgICBicmVhazsKKyAgICBjYXNlIENGR19GUkFNRV9FMVBMQUlOOiAgICAgICAgIC8qIDMgLSBIREIzICovCisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPmNkcmNfY2ZnLCAwKTsKKyAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+c2lneF9jZmcsIDApOworICAgICAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5lMV90cmFuX2NmZywgMCk7CisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPmUxX2ZybXJfYW9wdHMsIDB4NDApOworICAgICAgICBicmVhazsKKyAgICBjYXNlIENGR19GUkFNRV9FMUNBUzogICAgICAgICAgIC8qIDQgLSBIREIzICovCisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPmNkcmNfY2ZnLCAwKTsKKyAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+c2lneF9jZmcsIDApOworICAgICAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5lMV90cmFuX2NmZywgMHg2MCk7CisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPmUxX2ZybXJfYW9wdHMsIDApOworICAgICAgICBicmVhazsKKyAgICBjYXNlIENGR19GUkFNRV9FMUNSQzogICAgICAgICAgIC8qIDUgLSBIREIzICovCisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPmNkcmNfY2ZnLCAwKTsKKyAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+c2lneF9jZmcsIDApOworICAgICAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5lMV90cmFuX2NmZywgMHgxMCk7CisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPmUxX2ZybXJfYW9wdHMsIDB4YzIpOworICAgICAgICBicmVhazsKKyAgICBjYXNlIENGR19GUkFNRV9FMUNSQ19DQVM6ICAgICAgIC8qIDYgLSBIREIzICovCisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPmNkcmNfY2ZnLCAwKTsKKyAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+c2lneF9jZmcsIDApOworICAgICAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5lMV90cmFuX2NmZywgMHg3MCk7CisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPmUxX2ZybXJfYW9wdHMsIDB4ODIpOworICAgICAgICBicmVhazsKKyAgICBjYXNlIENGR19GUkFNRV9TRl9BTUk6ICAgICAgICAgIC8qIDcgLSBUMSBBTUkgKi8KKyAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+Y2RyY19jZmcsIDB4ODApOyAgICAvKiBFbmFibGUgQU1JIExpbmUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBEZWNvZGluZyAqLworICAgICAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT50MV9mcm1yX2NmZywgMCk7CisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPnQxX3hiYXNfY2ZnLCAwKTsKKyAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+dDFfYWxtaV9jZmcsIDApOworICAgICAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5zaWd4X2NmZywgMCk7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgQ0ZHX0ZSQU1FX0VTRl9BTUk6ICAgICAgICAgLyogOCAtIFQxIEFNSSAqLworICAgICAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5jZHJjX2NmZywgMHg4MCk7ICAgIC8qIEVuYWJsZSBBTUkgTGluZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIERlY29kaW5nICovCisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPnJ4Y2UxX2N0bCwgMHgyMCk7ICAgLyogNTogVDEgRGF0YUxpbmsgRW5hYmxlICovCisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPnR4Y2kxX2N0bCwgMHgyMCk7ICAgLyogNTogVDEgRGF0YUxpbmsgRW5hYmxlICovCisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPnQxX2ZybXJfY2ZnLCAweDMwKTsgLyogQml0IDQ6RVNGICA1OkVTRkZBICovCisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPnNpZ3hfY2ZnLCAweDA0KTsgICAgLyogMjpFU0YgKi8KKyAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+dDFfeGJhc19jZmcsIDB4MTApOyAvKiA0OkVTRiAqLworICAgICAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT50MV9hbG1pX2NmZywgMHgxMCk7IC8qIDQ6RVNGICovCisgICAgICAgIGJyZWFrOworICAgIGNhc2UgQ0ZHX0ZSQU1FX0UxUExBSU5fQU1JOiAgICAgICAvKiA5IC0gQU1JICovCisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPmNkcmNfY2ZnLCAweDgwKTsgICAgLyogRW5hYmxlIEFNSSBMaW5lCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogRGVjb2RpbmcgKi8KKyAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+c2lneF9jZmcsIDApOworICAgICAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5lMV90cmFuX2NmZywgMHg4MCk7CisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPmUxX2ZybXJfYW9wdHMsIDB4NDApOworICAgICAgICBicmVhazsKKyAgICBjYXNlIENGR19GUkFNRV9FMUNBU19BTUk6ICAgICAgIC8qIDEwIC0gQU1JICovCisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPmNkcmNfY2ZnLCAweDgwKTsgICAgLyogRW5hYmxlIEFNSSBMaW5lCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogRGVjb2RpbmcgKi8KKyAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+c2lneF9jZmcsIDApOworICAgICAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5lMV90cmFuX2NmZywgMHhlMCk7CisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPmUxX2ZybXJfYW9wdHMsIDApOworICAgICAgICBicmVhazsKKyAgICBjYXNlIENGR19GUkFNRV9FMUNSQ19BTUk6ICAgICAgIC8qIDExIC0gQU1JICovCisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPmNkcmNfY2ZnLCAweDgwKTsgICAgLyogRW5hYmxlIEFNSSBMaW5lCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogRGVjb2RpbmcgKi8KKyAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+c2lneF9jZmcsIDApOworICAgICAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5lMV90cmFuX2NmZywgMHg5MCk7CisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPmUxX2ZybXJfYW9wdHMsIDB4YzIpOworICAgICAgICBicmVhazsKKyAgICBjYXNlIENGR19GUkFNRV9FMUNSQ19DQVNfQU1JOiAgIC8qIDEyIC0gQU1JICovCisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPmNkcmNfY2ZnLCAweDgwKTsgICAgLyogRW5hYmxlIEFNSSBMaW5lCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogRGVjb2RpbmcgKi8KKyAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+c2lneF9jZmcsIDApOworICAgICAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5lMV90cmFuX2NmZywgMHhmMCk7CisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPmUxX2ZybXJfYW9wdHMsIDB4ODIpOworICAgICAgICBicmVhazsKKyAgICB9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGVuZCBzd2l0Y2ggKi8KKworICAgIC8qKioKKyAgICAgKiBTZXQgRnVsbCBGcmFtZSBtb2RlIChOWERTT1sxXSA9IDAsIE5YRFNPWzBdID0gMCkKKyAgICAgKiBDTU9ERT0xOiBDbG9jayBzbGF2ZSBtb2RlIHdpdGggQlJDTEsgYXMgYW4gaW5wdXQsCisgICAgICogREU9MDogVXNlIGZhbGxpbmcgZWRnZSBvZiBCUkNMSyBmb3IgZGF0YSwKKyAgICAgKiBGRT0wOiBVc2UgZmFsbGluZyBlZGdlIG9mIEJSQ0xLIGZvciBmcmFtZSwKKyAgICAgKiBDTVM9MDogVXNlIGJhY2twbGFuZSBmcmVxLAorICAgICAqIFJBVEVbMTowXT0wLDA6IFQxCisgICAgICoqKi8KKworCisgICAgLyogMHgzMDogIkJSSUYgY2ZnIjsgMHgyMCBpcyAnQ01PREUnLCAweDAzIGlzIChiaXQpIHJhdGUgKi8KKyAgICAvKiBub3RlICJyYXRlIGJpdHMgY2FuIG9ubHkgYmUgc2V0IG9uY2UgYWZ0ZXIgcmVzZXQiICovCisgICAgaWYgKGNsb2NrbWFzdGVyKQorICAgIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogQ01PREUgPT0gY2xvY2tNb2RlLCAwPWNsb2NrIG1hc3RlciAoc28KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGFsbCAzIG90aGVycyBzaG91bGQgYmUgc2xhdmUpICovCisgICAgICAgIGlmIChpc1QxbW9kZSkgICAgICAgICAgICAgICAvKiByYXRlID0gMS41NDQgTWIvcyAqLworICAgICAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+YnJpZl9jZmcsIDB4MDApOyAgICAgICAgLyogQ29tZXQgMCBNYXN0ZXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIE1vZGUoQ01PREU9MCkgKi8KKyAgICAgICAgZWxzZSAgICAgICAgICAgICAgICAgICAgICAgIC8qIHJhdGUgPSAyLjA0OCBNYi9zICovCisgICAgICAgICAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5icmlmX2NmZywgMHgwMSk7ICAgICAgICAvKiBDb21ldCAwIE1hc3RlcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogTW9kZShDTU9ERT0wKSAqLworCisgICAgICAgIC8qIDMxOiBCUklGIGZyYW1lIHB1bHNlIGNmZyAgMDY6IHR4IHRpbWluZyBvcHRpb25zICovCisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPmJyaWZfZnBjZmcsIDB4MDApOyAgLyogTWFzdGVyIE1vZGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBpLmUuRlBNT0RFPTAgKEAweDIwKSAqLworICAgICAgICBpZiAoKG1vcmVQYXJhbXMgJiBDRkdfQ0xLX1BPUlRfTUFTSykgPT0gQ0ZHX0NMS19QT1JUX0lOVEVSTkFMKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAobG9nX2xldmVsID49IExPR19TQkVCVUcxMikKKyAgICAgICAgICAgICAgICBwcl9pbmZvKCI+PiAlczogY2xvY2ttYXN0ZXIgaW50ZXJuYWwgY2xvY2tcbiIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPnR4X3RpbWUsIDB4MGQpOyAvKiBpbnRlcm5hbCBvc2NpbGxhdG9yICovCisgICAgICAgIH0gZWxzZSAgICAgICAgICAgICAgICAgICAgICAvKiBleHRlcm5hbCBjbG9jayBzb3VyY2UgKi8KKyAgICAgICAgeworICAgICAgICAgICAgaWYgKGxvZ19sZXZlbCA+PSBMT0dfU0JFQlVHMTIpCisgICAgICAgICAgICAgICAgcHJfaW5mbygiPj4gJXM6IGNsb2NrbWFzdGVyIGV4dGVybmFsIGNsb2NrXG4iLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT50eF90aW1lLCAweDA5KTsgLyogbG9vcCB0aW1pbmcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiAoZXh0ZXJuYWwpICovCisgICAgICAgIH0KKworICAgIH0gZWxzZSAgICAgICAgICAgICAgICAgICAgICAgICAgLyogc2xhdmUgKi8KKyAgICB7CisgICAgICAgIGlmIChpc1QxbW9kZSkKKyAgICAgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPmJyaWZfY2ZnLCAweDIwKTsgICAgICAgIC8qIFNsYXZlIE1vZGUoQ01PREU9MSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHNlZSBhYm92ZSkgKi8KKyAgICAgICAgZWxzZQorICAgICAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+YnJpZl9jZmcsIDB4MjEpOyAgICAgICAgLyogU2xhdmUgTW9kZSAoQ01PREU9MSkgKi8KKyAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+YnJpZl9mcGNmZywgMHgyMCk7ICAvKiBTbGF2ZSBNb2RlIGkuZS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBGUE1PREU9MSAoQDB4MjApICovCisgICAgICAgIGlmIChsb2dfbGV2ZWwgPj0gTE9HX1NCRUJVRzEyKQorICAgICAgICAgICAgcHJfaW5mbygiPj4gJXM6IGNsb2Nrc2xhdmUgaW50ZXJuYWwgY2xvY2tcbiIsIF9fZnVuY19fKTsKKyAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+dHhfdGltZSwgMHgwZCk7ICAgICAvKiBvc2NpbGxhdG9yIHRpbWluZyAqLworICAgIH0KKworICAgIC8qIDMyOiBCUklGIHBhcml0eSBGLWJpdCBjZmcgKi8KKyAgICAvKiBUb3RlbS1wb2xlIG9wZXJhdGlvbiAqLworICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPmJyaWZfcGZjZmcsIDB4MDEpOyAgICAgIC8qIFJlY2VpdmUgQmFja3BsYW5lCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogUGFyaXR5L0YtYml0ICovCisKKyAgICAvKiBkYzogUkxQUyBlcXVhbGl6ZXIgViByZWYgKi8KKyAgICAvKiBDb25maWd1cmF0aW9uICovCisgICAgaWYgKGlzVDFtb2RlKQorICAgICAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5ybHBzX2VxdnIsIDB4MmMpOyAgIC8qIFJMUFMgRXF1YWxpemVyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogVm9sdGFnZSAgKi8KKyAgICBlbHNlCisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPnJscHNfZXF2ciwgMHgzNCk7ICAgLyogUkxQUyBFcXVhbGl6ZXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBWb2x0YWdlICAqLworCisgICAgLyogUmVzZXJ2ZWQgYml0IHNldCBhbmQgU1FVRUxDSCBlbmFibGVkICovCisgICAgLyogZjg6IFJMUFMgY2ZnICYgc3RhdHVzICBmOTogUkxQUyBBTE9TIGRldGVjdC9jbGVhciB0aHJlc2hvbGQgKi8KKyAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5ybHBzX2NmZ3N0cywgMHgxMSk7ICAgICAvKiBSTFBTIENvbmZpZ3VyYXRpb24KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBTdGF0dXMgKi8KKyAgICBpZiAoaXNUMW1vZGUpCisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPnJscHNfYWxvc190aHJlc2gsIDB4NTUpOyAgICAvKiA/ICovCisgICAgZWxzZQorICAgICAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5ybHBzX2Fsb3NfdGhyZXNoLCAweDIyKTsgICAgLyogPyAqLworCisKKyAgICAvKiBTZXQgRnVsbCBGcmFtZSBtb2RlIChOWERTT1sxXSA9IDAsIE5YRFNPWzBdID0gMCkgKi8KKyAgICAvKiBDTU9ERT0wOiBDbG9jayBzbGF2ZSBtb2RlIHdpdGggQlRDTEsgYXMgYW4gaW5wdXQsIERFPTE6IFVzZSByaXNpbmcgKi8KKyAgICAvKiBlZGdlIG9mIEJUQ0xLIGZvciBkYXRhLCBGRT0xOiBVc2UgcmlzaW5nIGVkZ2Ugb2YgQlRDTEsgZm9yIGZyYW1lLCAqLworICAgIC8qIENNUz0wOiBVc2UgYmFja3BsYW5lIGZyZXEsIFJBVEVbMTowXT0wLDA6IFQxICovCisvKioqICAgIFRyYW5zbWl0IHNpZGUgaXMgYWx3YXlzIGFuIElucHV0LCBTbGF2ZSBDbG9jayovCisgICAgLyogNDA6IEJUSUYgY2ZnICA0MTogQlRJRiBmcmFtZSBwdWxzZSBjZmcgKi8KKyAgICBpZiAoaXNUMW1vZGUpCisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPmJ0aWZfY2ZnLCAweDM4KTsgICAgLyogQlRJRiBDb25maWd1cmF0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogUmVnLiAqLworICAgIGVsc2UKKyAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+YnRpZl9jZmcsIDB4MzkpOyAgICAvKiBCVElGIENvbmZpZ3VyYXRpb24KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBSZWcuICovCisKKyAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5idGlmX2ZwY2ZnLCAweDAxKTsgICAgICAvKiBCVElGIEZyYW1lIFB1bHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogQ29uZ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gZm9sbG93aW5nIGxpbmVzIGFyZSBwZXIgRXJyYXRhIDcsIDIuNSAqKiovCisgICAgICAgIHsKKyAgICAgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPnJscHNfZXFfcndzZWwsIDB4ODApOyAgIC8qIFNldCB1cCBmb3IgYSByZWFkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBvcGVyYXRpb24gKi8KKyAgICAgICAgICAgIHBjaV9mbHVzaF93cml0ZSAoY2kpOyAgIC8qIGZvciB3cml0ZSBvcmRlciBwcmVzZXJ2YXRpb24gd2hlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogT3B0aW1pemluZyBkcml2ZXIgKi8KKyAgICAgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPnJscHNfZXFfaWFkZHIsICh1X2ludDhfdCkgcmFtYWRkcik7IC8qIHdyaXRlIHRoZSBhZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogaW5pdGlhdGUgYSByZWFkICovCisgICAgICAgICAgICBwY2lfZmx1c2hfd3JpdGUgKGNpKTsgICAvKiBmb3Igd3JpdGUgb3JkZXIgcHJlc2VydmF0aW9uIHdoZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIE9wdGltaXppbmcgZHJpdmVyICovCisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogd2FpdCAzIGxpbmUgcmF0ZSBjbG9jayBjeWNsZXMgdG8gZW5zdXJlIGFkZHJlc3MgYml0cyBhcmUKKyAgICAgICAgICAgICAqIGNhcHR1cmVkIGJ5IFQxL0UxIGNsb2NrCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIE9TX3V3YWl0ICg0LCAid3JldCIpOyAgIC8qIDY4M25zICogMyA9IDEzNjYgbnMsIGFwcHJveCAydXMgKGJ1dAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogdXNlIDR1cykgKi8KKyAgICAgICAgfQorCisgICAgICAgIHZhbHVlID0gKnRhYmxlKys7CisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPnJscHNfaWRhdGEzLCAodV9pbnQ4X3QpICh2YWx1ZSA+PiAyNCkpOworICAgICAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5ybHBzX2lkYXRhMiwgKHVfaW50OF90KSAodmFsdWUgPj4gMTYpKTsKKyAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+cmxwc19pZGF0YTEsICh1X2ludDhfdCkgKHZhbHVlID4+IDgpKTsKKyAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+cmxwc19pZGF0YTAsICh1X2ludDhfdCkgdmFsdWUpOworICAgICAgICBwY2lfZmx1c2hfd3JpdGUgKGNpKTsgICAgICAgLyogZm9yIHdyaXRlIG9yZGVyIHByZXNlcnZhdGlvbiB3aGVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBPcHRpbWl6aW5nIGRyaXZlciAqLworCisgICAgICAgIC8qIFN0b3JpbmcgUkFNIGFkZHJlc3MsIGNhdXNlcyBSQU0gdG8gYmUgdXBkYXRlZCAqLworCisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPnJscHNfZXFfcndzZWwsIDApOyAgLyogU2V0IHVwIGZvciBhIHdyaXRlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogb3BlcmF0aW9uICovCisgICAgICAgIHBjaV9mbHVzaF93cml0ZSAoY2kpOyAgICAgICAvKiBmb3Igd3JpdGUgb3JkZXIgcHJlc2VydmF0aW9uIHdoZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIE9wdGltaXppbmcgZHJpdmVyICovCisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPnJscHNfZXFfaWFkZHIsICh1X2ludDhfdCkgcmFtYWRkcik7IC8qIHdyaXRlIHRoZSBhZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBpbml0aWF0ZSBhIHJlYWQgKi8KKyAgICAgICAgcGNpX2ZsdXNoX3dyaXRlIChjaSk7ICAgICAgIC8qIGZvciB3cml0ZSBvcmRlciBwcmVzZXJ2YXRpb24gd2hlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogT3B0aW1pemluZyBkcml2ZXIgKi8KKyAgICAgICAgLyoKKyAgICAgICAgICogd2FpdCAzIGxpbmUgcmF0ZSBjbG9jayBjeWNsZXMgdG8gZW5zdXJlIGFkZHJlc3MgYml0cyBhcmUgY2FwdHVyZWQKKyAgICAgICAgICogYnkgVDEvRTEgY2xvY2sKKyAgICAgICAgICovCisgICAgICAgIE9TX3V3YWl0ICg0LCAid3JldCIpOyAgICAgICAvKiA2ODNucyAqIDMgPSAxMzY2IG5zLCBhcHByb3ggMnVzIChidXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHVzZSA0dXMpICovCisgICAgfQorCisgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+cmxwc19lcV9jZmcsIDB4Q0IpOyAgICAgLyogRW5hYmxlIEVxdWFsaXplciAmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogc2V0IGl0IHRvIHVzZSAyNTYKK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LyogWExQRyBBbmFsb2cgVGVzdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIFBvc2l0aXZlIGNvbnRyb2wgKi8KKyAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT54bHBnX2F0ZXN0X3BjdGwsIDB4MDEpOworCisgICAgdGVtcCA9IHBjaV9yZWFkXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+eGxwZ19hdGVzdF9wY3RsKSAmIDB4ZmU7CisgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+eGxwZ19hdGVzdF9wY3RsLCB0ZW1wKTsKKworICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPnhscGdfYXRlc3RfbmN0bCwgMHgwMSk7IC8qIFhMUEcgQW5hbG9nIFRlc3QKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBOZWdhdGl2ZSBjb250cm9sICovCisgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+eGxwZ19hdGVzdF9uY3RsLCAweDAxKTsKKworICAgIHRlbXAgPSBwY2lfcmVhZF8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPnhscGdfYXRlc3RfbmN0bCkgJiAweGZlOworICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPnhscGdfYXRlc3RfbmN0bCwgdGVtcCk7CisgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+eGxwZ19mZGF0YV9zZWwsIDB4MDEpOyAgLyogWExQRyAqLworfQorCisKKy8qCisqKiBOYW1lOiAgICAgICAgU2V0Q29tZXRPcHMKKyoqIERlc2NyaXB0aW9uOiBTZXQgdXAgdGhlIHNlbGVjdGVkIENvbWV0J3MgY2xvY2sgZWRnZSBkcml2ZSBmb3IgYm90aAorKiogICAgICAgICAgICAgICAgdGhlIHRyYW5zbWl0IG91dCB0aGUgYW5hbG9nIHNpZGUgYW5kIHJlY2VpdmUgdG8gdGhlCisqKiAgICAgICAgICAgICAgICBiYWNrcGxhbmUgc2lkZS4KKyoqIFJldHVybnM6ICAgICBOb3RoaW5nCisqLworI2lmIDAKK1NUQVRJQyB2b2lkCitTZXRDb21ldE9wcyAoY29tZXRfdCAqIGNvbWV0KQoreworICAgIHZvbGF0aWxlIHVfaW50OF90IHJkX3ZhbHVlOworCisgICAgaWYgKGNvbWV0ID09IG1Db25maWcuQzRGdW5jMUJhc2UgKyAoQ09NRVQwX09GRlNFVCA+PiAyKSkKKyAgICB7CisgICAgICAgIHJkX3ZhbHVlID0gKHVfaW50OF90KSBwY2lfcmVhZF8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPmJyaWZfY2ZnKTsgICAgIC8qIHJlYWQgdGhlIEJSSUYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogQ29uZmlndXJhdGlvbiAqLworICAgICAgICByZF92YWx1ZSAmPSB+MHgyMDsKKyAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+YnJpZl9jZmcsICh1X2ludDMyX3QpIHJkX3ZhbHVlKTsKKworICAgICAgICByZF92YWx1ZSA9ICh1X2ludDhfdCkgcGNpX3JlYWRfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5icmlmX2ZwY2ZnKTsgICAvKiByZWFkIHRoZSBCUklGIEZyYW1lCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIFB1bHNlIENvbmZpZ3VyYXRpb24gKi8KKyAgICAgICAgcmRfdmFsdWUgJj0gfjB4MjA7CisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPmJyaWZfZnBjZmcsICh1X2ludDhfdCkgcmRfdmFsdWUpOworICAgIH0gZWxzZQorICAgIHsKKyAgICAgICAgcmRfdmFsdWUgPSAodV9pbnQ4X3QpIHBjaV9yZWFkXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+YnJpZl9jZmcpOyAgICAgLyogcmVhZCB0aGUgQlJJRgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBDb25maWd1cmF0aW9uICovCisgICAgICAgIHJkX3ZhbHVlIHw9IDB4MjA7CisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPmJyaWZfY2ZnLCAodV9pbnQzMl90KSByZF92YWx1ZSk7CisKKyAgICAgICAgcmRfdmFsdWUgPSAodV9pbnQ4X3QpIHBjaV9yZWFkXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+YnJpZl9mcGNmZyk7ICAgLyogcmVhZCB0aGUgQlJJRiBGcmFtZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBQdWxzZSBDb25maWd1cmF0aW9uICovCisgICAgICAgIHJkX3ZhbHVlIHw9IDB4MjA7CisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPmJyaWZfZnBjZmcsICh1X2ludDhfdCkgcmRfdmFsdWUpOworICAgIH0KK30KKyNlbmRpZgorCisvKioqICBFbmQtb2YtRmlsZSAgKioqLwpkaWZmIC0tZ2l0IGEvZHJpdmVycy9zdGFnaW5nL2N4dDFlMS9jb21ldC5oIGIvZHJpdmVycy9zdGFnaW5nL2N4dDFlMS9jb21ldC5oCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4I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dGwgKi8KKyAgICBWSU5UMzIgdGphdF9jZmc7ICAgICAvKiAxQiAgVEpBVCBDZmcgKi8KKworICAgIFZJTlQzMiByeF9lbHN0X2NmZzsgICAgICAvKiAxQyAgUlgtRUxTVCBDZmcgKi8KKyAgICBWSU5UMzIgcnhfZWxzdF9pc3RzOyAgICAgLyogMUQgIFJYLUVMU1QgSW50ciBTdHMgKi8KKyAgICBWSU5UMzIgcnhfZWxzdF9pZGxlOyAgICAgLyogMUUgIFJYLUVMU1QgSWRsZSBDb2RlICovCisgICAgVklOVDMyIF9yeF9lbHN0X3JlczFmOyAgIC8qIDFGICAgICBSWC1FTFNUIFJlc2VydmVkICovCisKKyAgICBWSU5UMzIgdHhfZWxzdF9jZmc7ICAgICAgLyogMjAgIFRYLUVMU1QgQ2ZnICovCisgICAgVklOVDMyIHR4X2Vsc3RfaXN0czsgICAgIC8qIDIxICBUWC1FTFNUIEludHIgU3RzICovCisgICAgVklOVDMyIF90eF9lbHN0X3JlczIyOyAgIC8qIDIyICAgICBUWC1FTFNUIFJlc2VydmVkICovCisgICAgVklOVDMyIF90eF9lbHN0X3JlczIzOyAgIC8qIDIzICAgICBUWC1FTFNUIFJlc2VydmVkICovCisgICAgVklOVDMyIF9fcmVzMjQ7ICAgICAgICAgIC8qIDI0ICAgICBSZXNlcnZlZCAqLworICAgIFZJTlQzMiBfX3JlczI1OyAgICAgICAgICAvKiAyNSAgICAgUmVzZXJ2ZWQgKi8KKyAgICBWSU5UMzIgX19yZXMyNjsgICAgICAgICAgLyogMjYgICAgIFJlc2VydmVkICovCisgICAgVklOVDMyIF9fcmVzMjc7ICAgICAgICAgIC8qIDI3ICAgICBSZXNlcnZlZCAqLworCisgICAgVklOVDMyIHJ4Y2UxX2N0bDsgICAgICAgIC8qIDI4ICBSWENFIFJYIERhdGEgTGluayAxIEN0bCAqLworICAgIFZJTlQzMiByeGNlMV9iaXRzOyAgICAgICAvKiAyOSAgUlhDRSBSWCBEYXRhIExpbmsgMSBCaXQ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EJPQyBDb2RlICovCisgICAgVklOVDMyIF90MV94cGRlX3JlczY4OyAgIC8qIDY4ICAgICBUMSBYUERFIFJlc2VydmVkICovCisgICAgVklOVDMyIHQxX3hwZGVfaWVzOyAgICAgIC8qIDY5ICBUMSBYUERFIEludHIgRW5hYmxlL1N0cyAqLworCisgICAgVklOVDMyIHQxX3Jib2NfZW5hOyAgICAgIC8qIDZBICBUMSBSQk9DIEVuYWJsZSAqLworICAgIFZJTlQzMiB0MV9yYm9jX3N0czsgICAgICAvKiA2QiAgVDEgUkJPQyBDb2RlIFN0cyAqLworCisgICAgVklOVDMyIHQxX3Rwc2NfY2ZnOyAgICAgIC8qIDZDICBUUFNDIENmZyAqLworICAgIFZJTlQzMiB0MV90cHNjX3N0czsgICAgICAvKiA2RCAgVFBTQyB1UCBBY2Nlc3MgU3RzICovCisgICAgVklOVDMyIHQxX3Rwc2NfY2lhZGRyOyAgIC8qIDZFICBUUFNDIENoYW5uZWwgSW5kaXJlY3QKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogQWRkci9DdGwgKi8KKyAgICBWSU5UMzIgdDFfdHBzY19jaWRhdGE7ICAgLyogNkYgIFRQU0MgQ2hhbm5lbCBJbmRpcmVjdCBEYXRhCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIEJ1ZmZlciAqLworICAgIFZJTlQzMiB0MV9ycHNjX2NmZzsgICAgICAvKiA3MCAgUlBTQyBDZmcgKi8KKyAgICBWSU5UMzIgdDFfcnBzY19zdHM7ICAgICAgLyogNzEgIFJQU0MgdVAgQWNjZXNzIFN0cyAqLworICAgIFZJTlQzMiB0MV9ycHNjX2NpYWRkcjsgICAvKiA3MiAgUlBTQyBDaGFubmVsIEluZGlyZWN0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIEFkZHIvQ3RsICovCisgICAgVklOVDMyIHQxX3Jwc2NfY2lkYXRhOyAgIC8qIDczICB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250ZW50IE1TQiAoT2N0ZWN0IDYpICovCisKKyAgICBWSU5UMzIgZTFfdHJhbl9jZmc7ICAgICAgLyogODAgIEUxIFRSQU4gQ2ZnICovCisgICAgVklOVDMyIGUxX3RyYW5fdHhhbGFybTsgIC8qIDgxICBFMSBUUkFOIFRYIEFsYXJtL0RpYWdub3N0aWMgQ3RsICovCisgICAgVklOVDMyIGUxX3RyYW5faW50Y3RsOyAgIC8qIDgyICBFMSBUUkFOIEludGVybmF0aW9uYWwgQ3RsICovCisgICAgVklOVDMyIGUxX3RyYW5fZXh0cmFiOyAgIC8qIDgzICBFMSBUUkFOIEV4dHJhIEJpdHMgQ3RsICovCisgICAgVklOVDMyIGUxX3RyYW5faWVuOyAgICAgIC8qIDg0ICBFMSBUUkFOIEludHIgRW5hYmxlICovCisgICAgVklOVDMyIGUxX3RyYW5faXN0czsgICAgIC8qIDg1ICBFMSBUUkFOIEludHIgU3RzICovCisgICAgVklOVDMyIGUxX3RyYW5fbmF0czsgICAgIC8qIDg2ICBFMSBUUkFOIE5hdGlvbmFsIEJpdCBDb2Rld29yZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBTZWxlY3QgKi8KKyAgICBWSU5UMzIgZTFfdHJhbl9uYXQ7ICAgICAgLyogODcgIEUxIFRSQU4gTmF0aW9uYWwgQml0IENvZGV3b3JkICovCisgICAgVklOVDMyIF9fcmVzODg7ICAgICAgICAgIC8qIDg4ICAgICBSZXNlcnZlZCAqLworICAgIFZJTlQzMiBfX3Jlczg5OyAgICAgICAgICAvKiA4OSAgICAgUmVzZXJ2ZWQgKi8KKyAgICBWSU5UMzIgX19yZXM4QTsgICAgICAgICAgLyogOEEgICAgIFJlc2VydmVkICovCisgICAgVklOVDMyIF9fcmVzOEI7ICAgICAgICAgIC8qIDhCICAgICBSZXNlcnZlZCAqLworCisgICAgVklOVDMyIF90MV9mcm1yX3JlczhDOyAgIC8qIDhDICAgICBUMSBGUk1SIFJlc2VydmVk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ydmVkICovCisgICAgVklOVDMyIF9fcmVzQTY7ICAgICAgICAgIC8qIEE2ICAgICBSZXNlcnZlZCAqLworICAgIFZJTlQzMiBfX3Jlc0E3OyAgICAgICAgICAvKiBBNyAgICAgUmVzZXJ2ZWQgKi8KKworICAgIFZJTlQzMiB0ZHByMV9jZmc7ICAgICAgICAvKiBBOCAgVERQUiAjMSBDZmcgKi8KKyAgICBWSU5UMzIgdGRwcjFfdXRsOyAgICAgICAgLyogQTkgIFREUFIgIzEgVXBwZXIgVFggVGhyZXNob2xkICovCisgICAgVklOVDMyIHRkcHIxX2x0bDsgICAgICAgIC8qIEFBICBURFBSICMxIExvd2VyIFRYIFRocmVzaG9sZCAqLworICAgIFZJTlQzMiB0ZHByMV9pZW47ICAgICAgICAvKiBBQiAgVERQUiAjMSBJbnRyIEVuYWJsZSAqLworICAgIFZJTlQzMiB0ZHByMV9pc3RzOyAgICAgICAvKiBBQyAgVERQUiAjMSBJbnRyIFN0cy9VRFIgQ2xlYXIgKi8KKyAgICBWSU5UMzIgdGRwcjFfZGF0YTsgICAgICAgLyogQUQgIFREUFIgIzEgVFggRGF0YSAqLworICAgIFZJTlQzMiBfX3Jlc0FFOyAgICAgICAgICAvKiBBRSAgICAgUmVzZXJ2ZWQgKi8KKyAgICBWSU5UMzIgX19yZXNBRjsgICAgICAgICAgLyogQUYgICAgIFJlc2VydmVkICovCisgICAgVklOVDMyIHRkcHIyX2NmZzsgICAgICAgIC8qIEIwICBURFBSICMyIENmZyAqLworICAgIFZJTlQzMiB0ZHByMl91dGw7ICAgICAgICAvKiBCMSAgVERQUiAjMiBVcHBlciBUWCBUaHJlc2hvbGQgKi8KKyAgICBWSU5UMzIgdGRwcjJfbHRsOyAgICAgICAgLyogQjIgIFREUFIgIzIgTG93ZXIgVFggVGhyZXNob2xkICovCisgICAgVklOVDMyIHRkcHIyX2llbjsgICAgICAgIC8qIEIzICBURFBSICMyIEludHIgRW5hYmxlICovCisgICAgVklOVDMyIHRkcHIyX2lzdHM7ICAgICAgIC8qIEI0ICBURFBSICMyIEludHIgU3RzL1VEUiBDbGVhciAqLworICAgIFZJTlQzMiB0ZHByMl9kYXRhOyAgICAgICAvKiBCNSAgVERQUiAjMiBUWCBEYXRhICovCisgICAgVklOVDMyIF9fcmVzQjY7ICAgICAgICAgIC8qIEI2ICAgICBSZXNlcnZlZCAqLworICAgIFZJTlQzMiBfX3Jlc0I3OyAgICAgICAgICAvKiBCNyAgICAgUmVzZXJ2ZWQxICovCisgICAgVklOVDMyIHRkcHIzX2NmZzsgICAgICAgIC8qIEI4ICBURFBSICMzIENmZyAqLworICAgIFZJTlQzMiB0ZHByM191dGw7ICAgICAgICAvKiBCOSAgVERQUiAjMyBVcHBlciBUWCBUaHJlc2hvbGQgKi8KKyAgICBWSU5UMzIgdGRwcjNfbHRsOyAgICAgICAgLyogQkEgIFREUFIgIzMgTG93ZXIgVFggVGhyZXNob2xkICovCisgICAgVklOVDMyIHRkcHIzX2llbjsgICAgICAgIC8qIEJCICBURFBSICMzIEludHIgRW5hYmxlICovCisgICAgVklOVDMyIHRkcHIzX2lzdHM7ICAgICAgIC8qIEJDICBURFBSICMzIEludHIgU3RzL1VEUiBDbGVhciAqLworICAgIFZJTlQzMiB0ZHByM19kYXRhOyAgICAgICAvKiBCRCAgVERQUiAjMyBUWCBEYXRhICovCisgICAgVklOVDMyIF9fcmVzQkU7ICAgICAgICAgIC8qIEJFICAgICBSZXNlcnZlZCAqLworICAgIFZJTlQzMiBfX3Jlc0JGOyAgICAgICAgICAvKiBCRiAgICAgUmVzZXJ2ZWQgKi8KKworICAgIFZJTlQzMiByZGxjMV9jZmc7ICAgICAgICAvKiBDMCAgUkRMQyAjMSBDZmcgKi8KKyAgICBWSU5UMzIgcmRsYzFfaW50Y3RsOyAgICAgLyogQzEgIFJETEMgIzEgSW50ciBDdGwgKi8KKyAgICBWSU5UMzIgcmRsYzFfc3RzOyAgICAgICAgLyogQzIgIFJETEMgIzEgU3RzICovCisgICAgVklOVDMyIHJkbGMxX2RhdGE7ICAgICAgIC8qIEMzICBSRExDICMxIERhdGEgKi8KKyAgICBWSU5UMzIgcmRsYzFfcGFkZHI7ICAgICAgLyogQzQgIFJETEMgIzEgUHJpbWFyeSBBZGRyIE1hdGNoICovCisgICAgVklOVDMyIHJkbGMxX3NhZGRyOyAgICAgIC8qIEM1ICBSRExDICMxIFNlY29uZGFyeSBBZGRyIE1hdGNoICovCisgICAgVklOVDMyIF9fcmVzQzY7ICAgICAgICAgIC8qIEM2ICAgICBSZXNlcnZlZCAqLworICAgIFZJTlQzMiBfX3Jlc0M3OyAgICAgICAgICAvKiBDNyAgICAgUmVzZXJ2ZWQgKi8KKyAgICBWSU5UMzIgcmRsYzJfY2ZnOyAgICAgICAgLyogQzggIFJETEMgIzIgQ2ZnICovCisgICAgVklOVDMyIHJkbGMyX2ludGN0bDsgICAgIC8qIEM5ICBSRExDICMyIEludHIgQ3RsICovCisgICAgVklOVDMyIHJkbGMyX3N0czsgICAgICAgIC8qIENBICBSRExDICMyIFN0cyAqLworICAgIFZJTlQzMiByZGxjMl9kYXRhOyAgICAgICAvKiBDQiAgUkRMQyAjMiBEYXRhICovCisgICAgVklOVDMyIHJkbGMyX3BhZGRyOyAgICAgIC8qIENDICBSRExDICMyIFByaW1hcnkgQWRkciBNYXRjaCAqLworICAgIFZJTlQzMiByZGxjMl9zYWRkcjsgICAgICAvKiBDRCAgUkRMQyAjMiBTZWNvbmRhcnkgQWRkciBNYXRjaCAqLworICAgIFZJTlQzMiBfX3Jlc0NFOyAgICAgICAgICAvKiBDRSAgICAgUmVzZXJ2ZWQgKi8KKyAgICBWSU5UMzIgX19yZXNDRjsgICAgICAgICAgLyogQ0YgICAgIFJlc2VydmVkICovCisgICAgVklOVDMyIHJkbGMzX2NmZzsgICAgICAgIC8qIEQwICBSRExDICMzIENmZyAqLworICAgIFZJTlQzMiByZGxjM19pbnRjdGw7ICAgICAvKiBEMSAgUkRMQyAjMyBJbnRyIEN0bCAqLworICAgIF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gICAgICBUV1ZTaG9ydEhhdWwzCisqICAgICAgIFRXVlNob3J0SGF1bDQKKyogICAgICAgVFdWU2hvcnRIYXVsNQorKiAgICAgICBUV1ZfRTFfMTIwT2htCisqICAgICAgIFRXVl9FMV83NU9obSAgIDxub3Qgc3VwcG9ydGVkPgorKiAgICAgICBUMV9FcXVhbGl6ZXIKKyogICAgICAgRTFfRXF1YWxpemVyCisqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordV9pbnQ4X3QgVFdWTG9uZ0hhdWwwREJbMjVdWzVdID0vKiBUMSBMb25nIEhhdWwgMCBEQiAqLworeworICAgIHsweDAwLCAweDQ0LCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAwICovCisgICAgezB4MEEsIDB4NDQsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDEgKi8KKyAgICB7MHgyMCwgMHg0MywgMHgwMCwgMHgwMCwgMHgwMH0sICAgICAvKiBTYW1wbGUgMiAqLworICAgIHsweDMyLCAweDQzLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAzICovCisgICAgezB4M0UsIDB4NDIsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDQgKi8KKyAgICB7MHgzRCwgMHg0MiwgMHgwMCwgMHgwMCwgMHgwMH0sICAgICAvKiBTYW1wbGUgNSAqLworICAgIHsweDNDLCAweDQxLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSA2ICovCisgICAgezB4M0IsIDB4NDEsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDcgKi8KKyAgICB7MHgzQSwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMH0sICAgICAvKiBTYW1wbGUgOCAqLworICAgIHsweDM5LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSA5ICovCisgICAgezB4MzksIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDEwICovCisgICAgezB4MzgsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDExICovCisgICAgezB4MzcsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDEyICovCisgICAgezB4MzYsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDEzICovCisgICAgezB4MzQsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDE0ICovCisgICAgezB4MjksIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDE1ICovCisgICAgezB4NEYsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDE2ICovCisgICAgezB4NEMsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDE3ICovCisgICAgezB4NEEsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDE4ICovCisgICAgezB4NDksIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDE5ICovCisgICAgezB4NDcsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDIwICovCisgICAgezB4NDcsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDIxICovCisgICAgezB4NDYsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDIyICovCisgICAgezB4NDYsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDIzICovCisgICAgezB4MEN9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogUE1DJ3Mgc3VnZ2VzdGVkIHZhbHVlICovCisvKiAgezB4MTR9ICAgICAgICAgICAgICAgICAgICBPdXRwdXQgQW1wbGl0dWRlICovCit9OworCit1X2ludDhfdCAgICBUV1ZMb25nSGF1bDdfNURCWzI1XVs1XSA9ICAgLyogVDEgTG9uZyBIYXVsIDcuNSBEQiAqLworeworICAgIHsweDAwLCAweDEwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAwICovCisgICAgezB4MDEsIDB4MEUsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDEgKi8KKyAgICB7MHgwMiwgMHgwQywgMHgwMCwgMHgwMCwgMHgwMH0sICAgICAvKiBTYW1wbGUgMiAqLworICAgIHsweDA0LCAweDBBLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAzICovCisgICAgezB4MDgsIDB4MDgsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDQgKi8KKyAgICB7MHgwQywgMHgwNiwgMHgwMCwgMHgwMCwgMHgwMH0sICAgICAvKiBTYW1wbGUgNSAqLworICAgIHsweDEwLCAweDA0LCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSA2ICovCisgICAgezB4MTYsIDB4MDIsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDcgKi8KKyAgICB7MHgxQSwgMHgwMSwgMHgwMCwgMHgwMCwgMHgwMH0sICAgICAvKiBTYW1wbGUgOCAqLworICAgIHsweDFFLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSA5ICovCisgICAgezB4MjIsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDEwICovCisgICAgezB4MjYsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDExICovCisgICAgezB4M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wMCwgMHgwMH0sICAgICAvKiBTYW1wbGUgNiAqLworICAgIHsweDNCLCAweDQxLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSA3ICovCisgICAgezB4M0EsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDggKi8KKyAgICB7MHgzOSwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMH0sICAgICAvKiBTYW1wbGUgOSAqLworICAgIHsweDM5LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxMCAqLworICAgIHsweDM4LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxMSAqLworICAgIHsweDM3LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxMiAqLworICAgIHsweDM2LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxMyAqLworICAgIHsweDM0LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxNCAqLworICAgIHsweDI5LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxNSAqLworICAgIHsweDU5LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxNiAqLworICAgIHsweDU1LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxNyAqLworICAgIHsweDUwLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxOCAqLworICAgIHsweDRELCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxOSAqLworICAgIHsweDRBLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAyMCAqLworICAgIHsweDQ4LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAg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weDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxMCAqLworICAgIHsweDJCLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxMSAqLworICAgIHsweDJBLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxMiAqLworICAgIHsweDI4LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxMyAqLworICAgIHsweDI2LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxNCAqLworICAgIHsweDRBLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxNSAqLworICAgIHsweDY4LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxNiAqLworICAgIHsweDU0LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxNyAqLworICAgIHsweDRGLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxOCAqLworICAgIHsweDRBLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxOSAqLworICAgIHsweDQ5LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAyMCAqLworICAgIHsweDQ3LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAyMSAqLworICAgIHsweDQ3LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAyMiAqLworICAgIHsweDQ2LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAyMyAqLworICAgIHsweDEwfSAgICAgICAgICAgICAgICAgICAgICAvKiBPdXRwdXQgQW1wbGl0dWRlICovCit9OworCit1X2ludDhfdCAgICBUV1ZTaG9ydEh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LworICAgIHsweDIzLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxNCAqLworICAgIHsweDRBLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxNSAqLworICAgIHsweDZDLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxNiAqLworICAgIHsweDYwLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxNyAqLworICAgIHsweDRGLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxOCAqLworICAgIHsweDRBLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxOSAqLworICAgIHsweDQ5LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAyMCAqLworICAgIHsweDQ3LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAyMSAqLworICAgIHsweDQ3LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAyMiAqLworICAgIHsweDQ2LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAyMyAqLworICAgIHsweDExfSAgICAgICAgICAgICAgICAgICAgICAvKiBPdXRwdXQgQW1wbGl0dWRlICovCit9OworCit1X2ludDhfdCAgICBUV1ZTaG9ydEhhdWwzWzI1XVs1XSA9ICAgICAgLyogVDEgU2hvcnQgSGF1bCAzMzAgLSA0NDAgZnQgKi8KK3sKKyAgICB7MHgwMCwgMHg0NCwgMHgwMCwgMHgwMCwgMHgwMH0sICAgICAvKiBTYW1wbGUgMCAqLworICAgIHsweDBBLCAweDQ0LCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxICovCisgICAgezB4M0YsIDB4NDMsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDIgKi8KKyAgICB7MHgzRiwgMHg0MywgMHgwMCwgMHgwMCwgMHgwMH0sICAgICAvKiBTYW1wbGUgMyAqLworICAgIHsweDNGLCAweDQyLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSA0ICovCisgICAgezB4M0YsIDB4NDIsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDUgKi8KKyAgICB7MHgyRiwgMHg0MSwgMHgwMCwgMHgwMCwgMHgwMH0sICAgICAvKiBTYW1wbGUgNiAqLworICAgIHsweDJFLCAweDQxLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSA3ICovCisgICAgezB4MkQsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDggKi8KKyAgICB7MHgyQywgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMH0sICAgICAvKiBTYW1wbGUgOSAqLworICAgIHsweDJCLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxMCAqLworICAgIHsweDJBLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxMSAqLworICAgIHsweDI5LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxMiAqLworICAgIHsweDI4LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxMyAqLworICAgIHsweDE5LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxNCAqLworICAgIHsweDRBLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxNSAqLworICAgIHsweDdGLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxNiAqLworICAgIHsweDYwLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxNyAqLworICAgIHsweDRGLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxOCAqLworICAgIHsweDRBLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxOSAqLworICAgIHsweDQ5LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAyMCAqLworICAgIHsweDQ3LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAyMSAqLworICAgIHsweDQ3LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAyMiAqLworICAgIHsweDQ2LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAyMyAqLworICAgIHsweDEyfSAgICAgICAgICAgICAgICAgICAgICAvKiBPdXRwdXQgQW1wbGl0dWRlICovCit9OworCit1X2ludDhfdCAgICBUV1ZTaG9ydEhhdWw0WzI1XVs1XSA9ICAgICAgLyogVDEgU2hvcnQgSGF1bCA0NDAgLSA1NTAgZnQgKi8KK3sKKyAgICB7MHgwMCwgMHg0NCwgMHgwMCwgMHgwMCwgMHgwMH0sICAgICAvKiBTYW1wbGUgMCAqLworICAgIHsweDBBLCAweDQ0LCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxICovCisgICAgezB4M0YsIDB4NDMsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDIgKi8KKyAgICB7MHgzRiwgMHg0MywgMHgwMCwgMHgwMCwgMHgwMH0sICAgICAvKiBTYW1wbGUgMyAqLworICAgIHsweDNGLCAweDQyLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSA0ICovCisgICAgezB4M0YsIDB4NDIsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDUgKi8KKyAgICB7MHgzMCwgMHg0MSwgMHgwMCwgMHgwMCwgMHgwMH0sICAgICAvKiBTYW1wbGUgNiAqLworICAgIHsweDJCLCAweDQxLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSA3ICovCisgICAgezB4MkEsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDggKi8KKyAgICB7MHgyOSwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMH0sICAgICAvKiBTYW1wbGUgOSAqLworICAgIHsweDI4LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxMCAqLworICAgIHsweDI3LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxMSAqLworICAgIHsweDI2LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxMiAqLworICAgIHsweDI2LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxMyAqLworICAgIHsweDI0LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxNCAqLworICAgIHsweDRBLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxNSAqLworICAgIHsweDdGLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxNiAqLworICAgIHsweDdGLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxNyAqLworICAgIHsweDRGLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxOCAqLworICAgIHsweDRBLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxOSAqLworICAgIHsweDQ5LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAyMCAqLworICAgIHsweDQ3LCAweDAwLCAweDAwLCAweDAwLCAwe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IHsweDI4LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxMCAqLworICAgIHsweDI3LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxMSAqLworICAgIHsweDI2LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxMiAqLworICAgIHsweDI1LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxMyAqLworICAgIHsweDI0LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxNCAqLworICAgIHsweDRBLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxNSAqLworICAgIHsweDdGLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxNiAqLworICAgIHsweDdGLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxNyAqLworICAgIHsweDVGLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxOCAqLworICAgIHsweDUwLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAxOSAqLworICAgIHsweDQ5LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAyMCAqLworICAgIHsweDQ3LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAyMSAqLworICAgIHsweDQ3LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAyMiAqLworICAgIHsweDQ2LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAyMyAqLworICAgIHsweDE1fSAgICAgICAgICAgICAgICAgICAgICAvKiBPdXRwdXQgQW1wbGl0dWRlICovCit9OworCit1X2ludDhfdCAgICBUV1ZfRTFfMTIwT2htWzI1XVs1XSA9ICAgICAgLyogRTEgMTIwIE9obSAqLworeworICAgIHsweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAwICovCisgICAgezB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDEgKi8KKyAgICB7MHgwQSwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMH0sICAgICAvKiBTYW1wbGUgMiAqLworICAgIHsweDNGLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAzICovCisgICAgezB4M0YsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDQgKi8KKyAgICB7MHgzOSwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMH0sICAgICAvKiBTYW1wbGUgNSAqLworICAgIHsweDM4LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSA2ICovCisgICAgezB4MzYsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDcgKi8KKyAgICB7MHgzNiwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMH0sICAgICAvKiBTYW1wbGUgOCAqLworICAgIHsweDM1LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSA5ICovCisgICAgezB4MzUsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDEwICovCisgICAgezB4MzUsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDExICovCisgICAgezB4MzUsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDEyICovCisgICAgezB4MzUsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDEzICovCisgICAgezB4MzUsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDE0ICovCisgICAgezB4MkQsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDE1ICovCisgICAgezB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDE2ICovCisgICAgezB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDE3ICovCisgICAgezB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDE4ICovCisgICAgezB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDE5ICovCisgICAgezB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDIwICovCisgICAgezB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDIxICovCisgICAgezB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDIyICovCisgICAgezB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAgICAgLyogU2FtcGxlIDIzICovCisgICAgezB4MEN9ICAgICAgICAgICAgICAgICAgICAgIC8qIFBNQydzIHN1Z2dlc3RlZCB2YWx1ZSAqLworLyogIHsgMHgxMCB9ICAgICAgICAgICAgICAgIE91dHB1dCBBbXBsaXR1ZGUgKi8KK307CisKKworCit1X2ludDhfdCAgICBUV1ZfRTFfNzVPaG1bMjVdWzVdID0gICAgICAgLyogRTEgNzUgT2htICovCit7CisjaWZkZWYgUE1DQzRfRE9FU19OT1RfU1VQUE9SVAorICAgIHsweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgICAgIC8qIFNhbXBsZSAwICovCisgICAgezB4MDAsIDB4MDAsIDB4MDA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IEZMVVNIX1BDSV9SRUFEICgpOyAgICAgICAgICAgICAgLyogKi8KKyAgICByZXR1cm4gbGUzMl90b19jcHUgKCpwKTsKKyNlbmRpZgorfQorCit2b2lkCitwY2lfd3JpdGVfMzIgKHVfaW50MzJfdCAqcCwgdV9pbnQzMl90IHYpCit7CisjaWZkZWYgRkxPV19ERUJVRworICAgIGlmIChsb2dfbGV2ZWwgPj0gTE9HX0RFQlVHKQorICAgICAgICBwcl9pbmZvKCJwY2lfd3JpdGU6ICV4ID0gJXhcbiIsICh1X2ludDMyX3QpIHAsIHYpOworI2VuZGlmCisgICAgKnAgPSBjcHVfdG9fbGUzMiAodik7CisgICAgRkxVU0hfUENJX1dSSVRFICgpOyAgICAgICAgICAgICAvKiBUaGlzIHJvdXRpbmUgaXMgY2FsbGVkIGZyb20gcm91dGluZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHdoaWNoIGRvIG11bHRpcGxlIHJlZ2lzdGVyIHdyaXRlcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogd2hpY2ggdGhlbXNlbHZlcyBuZWVkIGZsdXNoaW5nIGJldHdlZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHdyaXRlcyBpbiBvcmRlciB0byBndWFyYW50ZWUgd3JpdGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIG9yZGVyaW5nLiAgSXQgaXMgbGVzcyBjb2RlLWN1bWJlcnNvbWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHRvIGZsdXNoIGhlcmUtaW4gdGhlbiB0byBpbnZlc3RpZ2F0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogYW5kIGNvZGUgdGhlIG1hbnkgb3RoZXIgcmVnaXN0ZXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHdyaXRpbmcgcm91dGluZXMuICovCit9CisjZW5kaWYKKworCit2b2lkCitwY2lfZmx1c2hfd3JpdGUgKGNpX3QgKiBjaSkKK3sKKyAgICB2b2xhdGlsZSB1X2ludDMyX3QgdjsKKworICAgIC8qIGlzc3VlIGEgUENJIHJlYWQgdG8gZmx1c2ggUENJIHdyaXRlIHRocnUgYnJpZGdlICovCisgICAgdiA9ICoodV9pbnQzMl90ICopICZjaS0+cmVnLT5nbGNkOyAgLyogYW55IGFkZHJlc3Mgd291bGQgZG8gKi8KKworICAgIC8qCisgICAgICogcmV0dXJuIG5vdGhpbmcsIHRoaXMganVzdCByZWFkcyBQQ0kgYnJpZGdlIGludGVyZmFjZSB0byBmbHVzaAorICAgICAqIHByZXZpb3VzbHkgd3JpdHRlbiBkYXRhCisgICAgICovCit9CisKKworU1RBVElDIHZvaWQKK3dhdGNoZG9nX2Z1bmMgKHVuc2lnbmVkIGxvbmcgYXJnKQoreworICAgIHN0cnVjdCB3YXRjaGRvZyAqd2QgPSAodm9pZCAqKSBhcmc7CisKKyAgICBpZiAoZHJ2cl9zdGF0ZSAhPSBTQkVfRFJWUl9BVkFJTEFCTEUpCisgICAgeworICAgICAgICBpZiAobG9nX2xldmVsID49IExPR19NT05JVE9SKQorICAgICAgICAgICAgcHJfd2FybmluZygiJXM6IGRydnIgbm90IGF2YWlsYWJsZSAoJXgpXG4iLCBfX2Z1bmNfXywgZHJ2cl9zdGF0ZSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisjaWYgTElOVVhfVkVSU0lPTl9DT0RFIDwgS0VSTkVMX1ZFUlNJT04oMiw1LDApCisgICAgLyogSW5pdGlhbGl6ZSB0aGUgdHEgZW50cnkgb25seSB0aGUgZmlyc3QgdGltZSAqLworICAgIGlmICh3ZC0+aW5pdF90cSkKKyAgICB7CisgICAgICAgIHdkLT5pbml0X3RxID0gMDsKKyAgICAgICAgd2QtPnRxLnJvdXRpbmUgPSB3ZC0+ZnVuYzsKKyAgICAgICAgd2QtPnRxLnN5bmMgPSAwOworICAgICAgICB3ZC0+dHEuZGF0YSA9IHdkLT5zb2Z0YzsKKyAgICB9CisgICAgc2NoZWR1bGVfdGFzayAoJndkLT50cSk7CisjZWxzZQorICAgIHNjaGVkdWxlX3dvcmsgKCZ3ZC0+d29yayk7CisjZW5kaWYKKyAgICBtb2RfdGltZXIgKCZ3ZC0+aCwgamlmZmllcyArIHdkLT50aWNrcyk7Cit9CisKK2ludCBPU19pbml0X3dhdGNoZG9nKHN0cnVjdCB3YXRjaGRvZyAqd2RwLCB2b2lkICgqZikgKHZvaWQgKiksIHZvaWQgKmMsIGludCB1c2VjKQoreworICAgIHdkcC0+ZnVuYyA9IGY7CisgICAgd2RwLT5zb2Z0YyA9IGM7CisgICAgd2RwLT50aWNrcyA9IChIWikgKiAodXNlYyAvIDEwMDApIC8gMTAwMDsKKyAgICBJTklUX1dPUksoJndkcC0+d29yaywgKHZvaWQgKilmKTsKKyAgICBpbml0X3RpbWVyICgmd2RwLT5oKTsKKyAgICB7CisgICAgICAgIGNpX3QgICAgICAgKmNpID0gKGNpX3QgKikgYzsKKworICAgICAgICB3ZHAtPmguZGF0YSA9ICh1bnNpZ25lZCBsb25nKSAmY2ktPndkOworICAgIH0KKyAgICB3ZHAtPmguZnVuY3Rpb24gPSB3YXRjaGRvZ19mdW5jOworICAgIHJldHVybiAwOworfQorCit2b2lkCitPU191d2FpdCAoaW50IHVzZWMsIGNoYXIgKmRlc2NyaXB0aW9uKQoreworICAgIGludCAgICAgICAgIHRtcDsKKworICAgIGlmICh1c2VjID49IDEwMDApCisgICAgeworICAgICAgICBtZGVsYXkgKHVzZWMgLyAxMDAwKTsKKyAgICAgICAgLyogbm93IGRlbGF5IHJlc2lkdWFsICovCisgICAgICAgIHRtcCA9ICh1c2VjIC8gMTAwMCkgKiAxMDAwOyAvKiByb3VuZCAqLworICAgICAgICB0bXAgPSB1c2VjIC0gdG1wOyAgICAgICAgICAgLyogcmVzaWR1YWwgKi8KKyAgICAgICAgaWYgKHRtcCkKKyAgICAgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHdhaXQgb24gcmVzaWR1YWwgKi8KKyAgICAgICAgICAgIHVkZWxheSAodG1wKTsKKyAgICAgICAgfQorICAgIH0gZWxzZQorICAgIHsKKyAgICAgICAgdWRlbGF5ICh1c2VjKTsKKyAgICB9Cit9CisKKy8qIGR1bW15IHNob3J0IGRlbGF5IHJvdXRpbmUgY2FsbGVkIGFzIGEgc3Vicm91dGluZSBzbyB0aGF0IGNvbXBpbGVyCisgKiBkb2VzIG5vdCBvcHRpbWl6ZS9yZW1vdmUgaXRzIGludGVudCAoYSBzaG9ydCBkZWxheSkKKyAqLworCit2b2lkCitPU191d2FpdF9kdW1teSAodm9pZCkKK3sKKyNpZm5kZWYgVVNFX01BWF9JTlRfREVMQVkKKyAgICBkdW1teSsrOworI2Vsc2UKKyAgICB1ZGVsYXkgKDEpOworI2VuZGlmCit9CisKKwordm9pZAorT1Nfc2VtX2luaXQgKHZvaWQgKnNlbSwgaW50IHN0YXRlKQoreworICAgIHN3aXRjaCAoc3RhdGUpCisgICAgeworICAgICAgICBjYXNlIFNFTV9UQUtFTjoKKyAgICAgICAgaW5pdF9NVVRFWF9MT0NLRUQgKChzdHJ1Y3Qgc2VtYXBob3JlICopIHNlbSk7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgU0VNX0FWQUlMQUJMRToKKyAgICAgICAgaW5pdF9NVVRFWCAoKHN0cnVjdCBzZW1hcGhvcmUgKikgc2VtKTsKKyAgICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDogICAgICAgICAgICAgICAgICAgICAgICAvKiBvdGhlcndpc2UsIHNldCBzZW0uY291bnQgdG8gc3RhdGUncworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogdmFsdWUgKi8KKyAgICAgICAgc2VtYV9pbml0IChzZW0sIHN0YXRlKTsKKyAgICAgICAgYnJlYWs7CisgICAgfQorfQorCisKK2ludAorc2RfbGluZV9pc19vayAodm9pZCAqdXNlcikKK3sKKyAgICBzdHJ1Y3QgbmV0X2RldmljZSAqbmRldiA9IChzdHJ1Y3QgbmV0X2RldmljZSAqKSB1c2VyOworCisgICAgcmV0dXJuIChuZXRpZl9jYXJyaWVyX29rIChuZGV2KSk7Cit9CisKK3ZvaWQKK3NkX2xpbmVfaXNfdXAgKHZvaWQgKnVzZXIpCit7CisgICAgc3RydWN0IG5ldF9kZXZpY2UgKm5kZXYgPSAoc3RydWN0IG5ldF9kZXZpY2UgKikgdXNlcjsKKworICAgIG5ldGlmX2NhcnJpZXJfb24gKG5kZXYpOworICAgIHJldHVybjsKK30KKwordm9pZAorc2RfbGluZV9pc19kb3duICh2b2lkICp1c2VyKQoreworICAgIHN0cnVjdCBuZXRfZGV2aWNlICpuZGV2ID0gKHN0cnVjdCBuZXRfZGV2aWNlICopIHVzZXI7CisKKyAgICBuZXRpZl9jYXJyaWVyX29mZiAobmRldik7CisgICAgcmV0dXJuOworfQorCit2b2lkCitzZF9kaXNhYmxlX3htaXQgKHZvaWQgKnVzZXIpCit7CisgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldiA9IChzdHJ1Y3QgbmV0X2RldmljZSAqKSB1c2VyOworCisgICAgbmV0aWZfc3RvcF9xdWV1ZSAoZGV2KTsKKyAgICByZXR1cm47Cit9CisKK3ZvaWQKK3NkX2VuYWJsZV94bWl0ICh2b2lkICp1c2VyKQoreworICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYgPSAoc3RydWN0IG5ldF9kZXZpY2UgKikgdXNlcjsKKworICAgIG5ldGlmX3dha2VfcXVldWUgKGRldik7CisgICAgcmV0dXJuOworfQorCitpbnQKK3NkX3F1ZXVlX3N0b3BwZWQgKHZvaWQgKnVzZXIpCit7CisgICAgc3RydWN0IG5ldF9kZXZpY2UgKm5kZXYgPSAoc3RydWN0IG5ldF9kZXZpY2UgKikgdXNlcjsKKworICAgIHJldHVybiAobmV0aWZfcXVldWVfc3RvcHBlZCAobmRldikpOworfQorCit2b2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jYXNlIDA6CisgICAgICAgIGRhdGEgPSBwY2lfcmVhZF8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPl9fcmVzMjQpOyAgICAgLyogMHg5MCAqLworICAgICAgICBicmVhazsKKyAgICBjYXNlIDE6CisgICAgICAgIGRhdGEgPSBwY2lfcmVhZF8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPl9fcmVzMjUpOyAgICAgLyogMHg5NCAqLworICAgICAgICBicmVhazsKKyAgICBjYXNlIDI6CisgICAgICAgIGRhdGEgPSBwY2lfcmVhZF8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPl9fcmVzMjYpOyAgICAgLyogMHg5OCAqLworICAgICAgICBicmVhazsKKyAgICBjYXNlIDM6CisgICAgICAgIGRhdGEgPSBwY2lfcmVhZF8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPl9fcmVzMjcpOyAgICAgLyogMHg5QyAqLworICAgICAgICBicmVhazsKKyAgICBjYXNlIDQ6CisgICAgICAgIGRhdGEgPSBwY2lfcmVhZF8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPl9fcmVzODgpOyAgICAgLyogMHgyMjAgKi8KKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSA1OgorICAgICAgICBkYXRhID0gcGNpX3JlYWRfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5fX3Jlczg5KTsgICAgIC8qIDB4MjI0ICovCisgICAgICAgIGJyZWFrOworICAgIGNhc2UgNjoKKyAgICAgICAgZGF0YSA9IHBjaV9yZWFkXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+X19yZXM4QSk7ICAgICAvKiAweDIyOCAqLworICAgICAgICBicmVhazsKKyAgICBjYXNlIDc6CisgICAgICAgIGRhdGEgPSBwY2lfcmVhZF8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPl9fcmVzOEIpOyAgICAgLyogMHgyMkMgKi8KKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSA4OgorICAgICAgICBkYXRhID0gcGNpX3JlYWRfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5fX3Jlc0EwKTsgICAgIC8qIDB4MjgwICovCisgICAgICAgIGJyZWFrOworICAgIGNhc2UgOToKKyAgICAgICAgZGF0YSA9IHBjaV9yZWFkXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+X19yZXNBMSk7ICAgICAvKiAweDI4NCAqLworICAgICAgICBicmVhazsKKyAgICBjYXNlIDEwOgorICAgICAgICBkYXRhID0gcGNpX3JlYWRfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5fX3Jlc0EyKTsgICAgIC8qIDB4Mjg4ICovCisgICAgICAgIGJyZWFrOworICAgIGNhc2UgMTE6CisgICAgICAgIGRhdGEgPSBwY2lfcmVhZF8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPl9fcmVzQTMpOyAgICAgLyogMHgyOEMgKi8KKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSAxMjoKKyAgICAgICAgZGF0YSA9IHBjaV9yZWFkXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+X19yZXNBNCk7ICAgICAvKiAweDI5MCAqLworICAgICAgICBicmVhazsKKyAgICBjYXNlIDEzOgorICAgICAgICBkYXRhID0gcGNpX3JlYWRfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5fX3Jlc0E1KTsgICAgIC8qIDB4Mjk0ICovCisgICAgICAgIGJyZWFrOworICAgIGNhc2UgMTQ6CisgICAgICAgIGRhdGEgPSBwY2lfcmVhZF8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPl9fcmVzQTYpOyAgICAgLyogMHgyOTggKi8KKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSAxNToKKyAgICAgICAgZGF0YSA9IHBjaV9yZWFkXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+X19yZXNBNyk7ICAgICAvKiAweDI5QyAqLworICAgICAgICBicmVhazsKKyAgICBjYXNlIDE2OgorICAgICAgICBkY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I2lmZGVmIENPTkZJR19QUk9DX0ZTCisjaW5jbHVkZSAic2JlcHJvYy5oIgorI2VuZGlmCisKKyNpZmRlZiBTQkVfSU5DTFVERV9TWU1CT0xTCisjZGVmaW5lIFNUQVRJQworI2Vsc2UKKyNkZWZpbmUgU1RBVElDICBzdGF0aWMKKyNlbmRpZgorCitleHRlcm4gaW50ICBsb2dfbGV2ZWw7CitleHRlcm4gaW50ICBlcnJvcl9mbGFnOworZXh0ZXJuIGludCAgZHJ2cl9zdGF0ZTsKKworLyogZm9yd2FyZCByZWZlcmVuY2VzICovCit2b2lkICAgICAgICBjNF9zdG9wd2QgKGNpX3QgKik7CitzdHJ1Y3QgbmV0X2RldmljZSAqIF9faW5pdCBjNF9hZGRfZGV2IChoZHdfaW5mb190ICosIGludCwgdW5zaWduZWQgbG9uZywgdW5zaWduZWQgbG9uZywgaW50LCBpbnQpOworCisKK3N0cnVjdCBzX2hkd19pbmZvIGhkd19pbmZvW01BWF9CT0FSRFNdOworCisKK3ZvaWQgICAgICAgIF9faW5pdAorc2hvd190d28gKGhkd19pbmZvX3QgKiBoaSwgaW50IGJyZG5vKQoreworICAgIGNpX3QgICAgICAgKmNpOworICAgIHN0cnVjdCBwY2lfZGV2ICpwZGV2OworICAgIGNoYXIgICAgICAgKmJpZDsKKyAgICBjaGFyICAgICAgICpicCwgYmFubmVyWzgwXTsKKyAgICBjaGFyICAgICAgICBzbls2XTsKKworICAgIGJwID0gYmFubmVyOworICAgIG1lbXNldCAoYmFubmVyLCAwLCA4MCk7ICAgICAgICAgLyogY2xlYXIgcHJpbnQgYnVmZmVyICovCisKKyAgICBjaSA9IChjaV90ICopKG5ldGRldl9wcml2KGhpLT5uZGV2KSk7CisgICAgYmlkID0gc2JlaWRfZ2V0X2JkbmFtZSAoY2kpOworICAgIHN3aXRjaCAoaGktPnByb21mbXQpCisgICAgeworICAgIGNhc2UgUFJPTV9GT1JNQVRfVFlQRTE6CisgICAgICAgIG1lbWNweSAoc24sIChGTERfVFlQRTEgKikgKGhpLT5tZmdfaW5mby5wZnQxLlNlcmlhbCksIDYpOworICAgICAgICBicmVhazsKKyAgICBjYXNlIFBST01fRk9STUFUX1RZUEUyOgorICAgICAgICBtZW1jcHkgKHNuLCAoRkxEX1RZUEUyICopIChoaS0+bWZnX2luZm8ucGZ0Mi5TZXJpYWwpLCA2KTsKKyAgICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAgICAgICAgbWVtc2V0IChzbiwgMCwgNik7CisgICAgICAgIGJyZWFrOworICAgIH0KKworICAgIHNwcmludGYgKGJhbm5lciwgIiVzOiAlcyAgUy9OICUwNlgsIE1VU1lDQyBSZXYgJTAyWCIsCisgICAgICAgICAgICAgaGktPmRldm5hbWUsIGJpZCwKKyAgICAgICAgICAgICAoKHNuWzNdIDw8IDE2KSAmIDB4ZmYwMDAwKSB8CisgICAgICAgICAgICAgICgoc25bNF0gPDwgOCkgJiAweDAwZmYwMCkgfAorICAgICAgICAgICAgICAoc25bNV0gJiAweDAwMDBmZiksCisgICAgICAgICAgICAgKHVfaW50OF90KSBoaS0+cmV2aWRbMF0pOworCisgICAgcHJfaW5mbygiJXNcbiIsIGJhbm5lcik7CisKKyAgICBwZGV2ID0gaGktPnBkZXZbMF07CisgICAgcHJfaW5mbygiJXM6ICVzIGF0IHYvcD0lbHgvJWx4ICglMDJ4OiUwMnguJXgpIGlycSAlZFxuIiwKKyAgICAgICAgICAgIGhpLT5kZXZuYW1lLCAiTVVTWUNDIiwKKyAgICAgICAgICAgICh1bnNpZ25lZCBsb25nKSBoaS0+YWRkcl9tYXBwZWRbMF0sIGhpLT5hZGRyWzBdLAorICAgICAgICAgICAgaGktPnBjaV9idXNubywgKHVfaW50OF90KSBQQ0lfU0xPVCAocGRldi0+ZGV2Zm4pLAorICAgICAgICAgICAgKHVfaW50OF90KSBQQ0lfRlVOQyAocGRldi0+ZGV2Zm4pLCBwZGV2LT5pcnEpOworCisgICAgcGRldiA9IGhpLT5wZGV2WzFdOworICAgIHByX2luZm8oIiVzOiAlcyBhdCB2L3A9JWx4LyVseCAoJTAyeDolMDJ4LiV4KSBpcnEgJWRcbiIsCisgICAgICAgICAgICBoaS0+ZGV2bmFtZSwgIkVCVVMgICIsCisgICAgICAgICAgICAodW5zaWduZWQgbG9uZykgaGktPmFkZHJfbWFwcGVkWzFdLCBoaS0+YWRkclsxXSwKKyAgICAgICAgICAgIGhpLT5wY2lfYnVzbm8sICh1X2ludDhfdCkgUENJX1NMT1QgKHBkZXYtPmRldmZuKSwKKyAgICAgICAgICAgICh1X2ludDhfdCkgUENJX0ZVTkMgKHBkZXYtPmRldmZuKSwgcGRldi0+aXJxKTsKK30KKworCit2b2lkICAgICAgICBfX2luaXQKK2hkd19zbl9nZXQgKGhkd19pbmZvX3QgKiBoaSwgaW50IGJyZG5vKQoreworICAgIC8qIG9idGFpbiBoYXJkd2FyZSBFRVBST00gaW5mb3JtYXRpb24gKi8KKyAgICBsb25nICAgICAgICBhZGRyOworCisgICAgYWRkciA9IChsb25nKSBoaS0+YWRkcl9tYXBwZWRbMV0gKyBFRVBST01fT0ZGU0VUOworCisgICAgLyogcmVhZCBFRVBST00gd2l0aCBsYXJnZXN0IGtub3duIGZvcm1hdCBzaXplLi4uICovCisgICAgcG1jX2VlcHJvbV9yZWFkX2J1ZmZlciAoYWRkciwgMCwgKGNoYXIgKikgaGktPm1mZ19pbmZvLmRhdGEsIHNpemVvZiAoRkxEX1RZUEUyKSk7CisKKyNpZiAwCisgICAgeworICAgICAgICB1bnNpZ25lZCBjaGFyICp1Y3AgPSAodW5zaWduZWQgY2hhciAqKSAmaGktPm1mZ19pbmZvLmRhdGE7CisKKyAgICAgICAgcHJfaW5mbygiZWVwcm9tWzAwXTogICUwMnggJTAyeCAlMDJ4ICUwMnggICUwMnggJTAyeCAlMDJ4ICUwMnhcbiIsCisgICAgICAgICAgICAgICAgKih1Y3AgKyAwKSwgKih1Y3AgKyAxKSwgKih1Y3AgKyAyKSwgKih1Y3AgKyAzKSwgKih1Y3AgKyA0KSwgKih1Y3AgKyA1KSwgKih1Y3AgKyA2KSwgKih1Y3AgKyA3KSk7CisgICAgICAgIHByX2luZm8oImVlcHJvbVswOF06ICAlMDJ4ICUwMnggJTAyeCAlMDJ4ICAlMDJ4ICUwMnggJTAyeCAlMDJ4XG4iLAorICAgICAgICAgICAgICAgICoodWNwICsgOCksICoodWNwICsgOSksICoodWNwICsgMTApLCAqKHVjcCArIDExKSwgKih1Y3AgKyAxMiksICoodWNwICsgMTMpLCAqKHVjcCArIDE0KSwgKih1Y3AgKyAxNSkpOworICAgICAgICBwcl9pbmZvKCJlZXByb21bMTZdOiAgJTAyeCAlMDJ4ICUwMnggJTAyeCAgJTAyeCAlMDJ4ICUwMnggJTAyeFxuIiwKKyAgICAgICAgICAgICAgICAqKHVjcCArIDE2KSwgKih1Y3AgKyAxNyksICoodWNwICsgMTgpLCAqKHVjcCArIDE5KSwgKih1Y3AgKyAyMCksICoodWNwICsgMjEpLCAqKHVjcCArIDIyKSwgKih1Y3AgKyAyMykpOworICAgICAgICBwcl9pbmZvKCJlZXByb21bMjRdOiAgJTAyeCAlMDJ4ICUwMnggJTAyeCAgJTAyeCAlMDJ4ICUwMnggJTAyeFxuIiwKKyAgICAgICAgICAgICAgICAqKHVjcCArIDI0KSwgKih1Y3AgKyAyNSksICoodWNwICsgMjYpLCAqKHVjcCArIDI3KSwgKih1Y3AgKyAyOCksICoodWNwICsgMjkpLCAqKHVjcCArIDMwKSwgKih1Y3AgKyAzMSkpOworICAgICAgICBwcl9pbmZvKCJlZXByb21bMzJdOiAgJTAyeCAlMDJ4ICUwMnggJTAyeCAgJTAyeCAlMDJ4ICUwMnggJTAyeFxuIiwKKyAgICAgICAgICAgICAgICAqKHVjcCArIDMyKSwgKih1Y3AgKyAzMyksICoodWNwICsgMzQpLCAqKHVjcCArIDM1KSwgKih1Y3AgKyAzNiksICoodWNwICsgMzcpLCAqKHVjcCArIDM4KSwgKih1Y3AgKyAzOSkpOworICAgICAgICBwcl9pbmZvKCJlZXByb21bNDBdOiAgJTAyeCAlMDJ4ICUwMnggJTAyeCAgJTAyeCAlMDJ4ICUwMnggJTAyeFxuIiwKKyAgICAgICAgICAgICAgICAqKHVjcCArIDQwKSwgKih1Y3AgKyA0MSksICoodWNwICsgNDIpLCAqKHVjcCArIDQzKSwgKih1Y3AgKyA0NCksICoodWNwICsgNDUpLCAqKHVjcCArIDQ2KSwgKih1Y3AgKyA0NykpOworICAgIH0KKyNlbmRpZgorI2lmIDAKKyAgICBwcl9pbmZvKCJzbjogJXggJXggJXggJXggJXggJXhcbiIsCisgICAgICAgICAgICBoaS0+bWZnX2luZm8uU2VyaWFsWzBdLAorICAgICAgICAgICAgaGktPm1mZ19pbmZvLlNlcmlhbFsxXSwKKyAgICAgICAgICAgIGhpLT5tZmdfaW5mby5TZXJpYWxbMl0sCisgICAgICAgICAgICBoaS0+bWZnX2luZm8uU2VyaWFsWzNdLAorICAgICAgICAgICAgaGktPm1mZ19pbmZvLlNlcmlhbFs0XSwKKyAgICAgICAgICAgIGhpLT5tZmdfaW5mby5TZXJpYWxbNV0pOworI2VuZGlmCisKKyAgICBpZiAoKGhpLT5wcm9tZm10ID0gcG1jX3ZlcmlmeV9ja3N1bSAoJmhpLT5tZmdfaW5mby5kYXRhKSkgPT0gUFJPTV9GT1JNQVRfVW5rKQorICAgIHsKKyAgICAgICAgLyogYmFkIGNyYywgZGF0YSBpcyBzdXNwZWN0ICovCisgICAgICAgIGlmIChsb2dfbGV2ZWwgPj0gTE9HX1dBUk4pCisgICAgICAgICAgICBwcl9pbmZvKCIlczogRUVQUk9NIGNrc3VtIGVycm9yXG4iLCBoaS0+ZGV2bmFtZSk7CisgICAgICAgIGhpLT5tZmdfaW5mb19zdHMgPSBFRVBST01fQ1JDRVJSOworICAgIH0gZWxzZQorICAgICAgICBoaS0+bWZnX2luZm9fc3RzID0gRUVQUk9NX09LOworfQorCisKK3ZvaWQgICAgICAgIF9faW5pdAorcHJlcF9oZHdfaW5mbyAodm9pZCkKK3sKKyAgICBoZHdfaW5mb190ICpoaTsKKyAgICBpbnQgICAgICAgICBpOworCisgICAgZm9yIChpID0gMCwgaGkgPSBoZHdfaW5mbzsgaSA8IE1BWF9CT0FSRFM7IGkrKywgaGkrKykKKyAgICB7CisgICAgICAgIGhpLT5wY2lfYnVzbm8gPSAweGZmOworICAgICAgICBoaS0+cGNpX3Nsb3QgPSAweGZmOworICAgICAgICBoaS0+cGNpX3BpblswXSA9IDA7CisgICAgICAgIGhpLT5wY2lfcGluWzFdID0gMDsKKyAgICAgICAgaGktPm5kZXYgPSAwOworICAgICAgICBoaS0+YWRkclswXSA9IDBMOworICAgICAgICBoaS0+YWRkclsxXSA9IDBMOworICAgICAgICBoaS0+YWRkcl9tYXBwZWRbMF0gPSAwTDsKKyAgICAgICAgaGktPmFkZHJfbWFwcGVkWzFdID0gMEw7CisgICAgfQorfQorCit2b2lkCitjbGVhbnVwX2lvcmVtYXAgKHZvaWQpCit7CisgICAgaGR3X2luZm9fdCAqaGk7CisgICAgaW50ICAgICAgICAgaTsKKworICAgIGZvciAoaSA9IDAsIGhpID0gaGR3X2luZm87IGkgPCBNQVhfQk9BUkRTOyBpKyssIGhpKyspCisgICAgeworICAgICAgICBpZiAoaGktPnBjaV9zbG90ID09IDB4ZmYpCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgaWYgKGhpLT5hZGRyX21hcHBlZFswXSkKKyAgICAgICAgeworICAgICAgICAgICAgaW91bm1hcCAoKHZvaWQgKikgKGhpLT5hZGRyX21hcHBlZFswXSkpOworICAgICAgICAgICAgcmVsZWFzZV9tZW1fcmVnaW9uICgobG9uZykgaGktPmFkZHJbMF0sIGhpLT5sZW5bMF0pOworICAgICAgICAgICAgaGktPmFkZHJfbWFwcGVkWzBdID0gMDsKKyAgICAgICAgfQorICAgICAgICBpZiAoaGktPmFkZHJfbWFwcGVkWzFdKQorICAgICAgICB7CisgICAgICAgICAgICBpb3VubWFwICgodm9pZCAqKSAoaGktPmFkZHJfbWFwcGVkWzFdKSk7CisgICAgICAgICAgICByZWxlYXNlX21lbV9yZWdpb24gKChsb25nKSBoaS0+YWRkclsxXSwgaGktPmxlblsxXSk7CisgICAgICAgICAgICBoaS0+YWRkcl9tYXBwZWRbMV0gPSAwOworICAgICAgICB9CisgICAgfQorfQorCisKK3ZvaWQKK2NsZWFudXBfZGV2cyAodm9pZCkKK3sKKyAgICBoZHdfaW5mb190ICpoaTsKKyAgICBpbnQgICAgICAgICBpOworCisgICAgZm9yIChpID0gMCwgaGkgPSBoZHdfaW5mbzsgaSA8IE1BWF9CT0FSRFM7IGkrKywgaGkrKykKKyAgICB7CisgICAgICAgIGlmIChoaS0+cGNpX3Nsb3QgPT0gMHhmZiB8fCAhaGktPm5kZXYpCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgYzRfc3RvcHdkKG5ldGRldl9wcml2KGhpLT5uZGV2KSk7CisjaWZkZWYgQ09ORklHX1BST0NfRlMKKyAgICAgICAgc2JlY29tX3Byb2NfYnJkX2NsZWFudXAobmV0ZGV2X3ByaXYoaGktPm5kZXYpKTsKKyNlbmRpZgorICAgICAgICB1bnJlZ2lzdGVyX25ldGRldiAoaGktPm5kZXYpOworICAgICAgICBmcmVlX2lycSAoaGktPnBkZXZbMF0tPmlycSwgaGktPm5kZXYpOworI2lmZGVmIENPTkZJR19TQkVfUE1DQzRfTkNPTU0KKyAgICAgICAgZnJlZV9pcnEgKGhpLT5wZGV2WzFdLT5pcnEsIGhpLT5uZGV2KTsKKyNlbmRpZgorICAgICAgICBPU19rZnJlZSAoaGktPm5kZXYpOworICAgIH0KK30KKworCitTVEFUSUMgaW50ICBfX2luaXQKK2M0X2hkd19pbml0IChzdHJ1Y3QgcGNpX2RldiAqIHBkZXYsIGludCBmb3VuZCkKK3sKKyAgICBoZHdfaW5mb190ICpoaTsKKyAgICBpbnQgICAgICAgICBpOworICAgIGludCAgICAgICAgIGZ1biwgc2xvdDsKKyAgICB1bnNpZ25lZCBjaG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GZvciAoaSA9IDAsIGhpID0gaGR3X2luZm87IGkgPCBNQVhfQk9BUkRTOyBpKyssIGhpKyspCisgICAgeworICAgICAgICAvKgorICAgICAgICAgKiBtYXRjaCB3aXRoIGJvYXJkJ3MgZmlyc3QgZm91bmQgaW50ZXJmYWNlLCBvdGhlcndpc2UgdGhpcyBpcyBmaXJzdAorICAgICAgICAgKiBmb3VuZAorICAgICAgICAgKi8KKyAgICAgICAgaWYgKChoaS0+cGNpX3Nsb3QgPT0gMHhmZikgfHwgICAvKiBuZXcgYm9hcmQgKi8KKyAgICAgICAgICAgICgoaGktPnBjaV9zbG90ID09IHNsb3QpICYmIChoaS0+YnVzID09IHBkZXYtPmJ1cykpKQorICAgICAgICAgICAgYnJlYWs7ICAgICAgICAgICAgICAgICAgLyogZm91bmQgZm9yLWxvb3AgZXhpdCAqLworICAgIH0KKyAgICBpZiAoaSA9PSBNQVhfQk9BUkRTKSAgICAgICAgICAgIC8qIG5vIG1hdGNoIGluIGFib3ZlIGxvb3AgbWVhbnMgTUFYCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBleGNlZWRlZCAqLworICAgIHsKKyAgICAgICAgcHJfd2FybmluZygiZXhjZWVkZWQgbnVtYmVyIG9mIGFsbG93ZWQgZGV2aWNlcyAoPiVkKT9cbiIsIE1BWF9CT0FSRFMpOworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisgICAgaWYgKHBkZXYtPmJ1cykKKyAgICAgICAgaGktPnBjaV9idXNubyA9IHBkZXYtPmJ1cy0+bnVtYmVyOworICAgIGVsc2UKKyAgICAgICAgaGktPnBjaV9idXNubyA9IDA7ICAgICAgICAgIC8qIGRlZmF1bHQgZm9yIHN5c3RlbSBQQ0kgaW5jb25zaXN0ZW5jeSAqLworICAgIGhpLT5wY2lfc2xvdCA9IHNsb3Q7CisgICAgcGNpX3JlYWRfY29uZmlnX2J5dGUgKHBkZXYsIFBDSV9JTlRFUlJVUFRfUElOLCAmaGktPnBjaV9waW5bZnVuXSk7CisgICAgcGNpX3JlYWRfY29uZmlnX2J5dGUgKHBkZXYsIFBDSV9SRVZJU0lPTl9JRCwgJmhpLT5yZXZpZFtmdW5dKTsKKyAgICBoaS0+YnVzID0gcGRldi0+YnVzOworICAgIGhpLT5hZGRyW2Z1bl0gPSBwY2lfcmVzb3VyY2Vfc3RhcnQgKHBkZXYsIDApOworICAgIGhpLT5sZW5bZnVuXSA9IHBjaV9yZXNvdXJjZV9lbmQgKHBkZXYsIDApIC0gaGktPmFkZHJbZnVuXSArIDE7CisgICAgaGktPnBkZXZbZnVuXSA9IHBkZXY7CisKKyAgICB7CisgICAgICAgIC8qCisgICAgICAgICAqIGNyZWF0ZSBkZXZpY2UgbmFtZSBmcm9tIG1vZHVsZSBuYW1lLCBwbHVzIGFkZCB0aGUgYXBwcm9wcmlhdGUKKyAgICAgICAgICogYm9hcmQgbnVtYmVyCisgICAgICAgICAqLworICAgICAgICBjaGFyICAgICAgICpjcCA9IGhpLT5kZXZuYW1lOworCisgICAgICAgIHN0cmNweSAoY3AsIEtCVUlMRF9NT0ROQU1FKTsKKyAgICAgICAgY3AgKz0gc3RybGVuIChjcCk7ICAgICAgICAgIC8qIHJlcG9zaXRpb24gKi8KKyAgICAgICAgKmNwKysgPSAnLSc7CisgICAgICAgICpjcCsrID0gJzAnICsgKGZvdW5kIC8gMik7ICAvKiB0aGVyZSBhcmUgdHdvIGZvdW5kIGludGVyZmFjZXMgcGVyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBib2FyZCAqLworICAgICAgICAqY3AgPSAwOyAgICAgICAgICAgICAgICAgICAgLyogdGVybWluYXRpb24gKi8KKyAgICB9CisKKyAgICByZXR1cm4gMTsKK30KKworCitzdGF0dXNfdCAgICBfX2luaXQKK2M0aHdfYXR0YWNoX2FsbCAodm9pZCkKK3sKKyAgICBoZHdfaW5mb190ICpoaTsKKyAgICBzdHJ1Y3QgcGNpX2RldiAqcGRldiA9IE5VTEw7CisgICAgaW50ICAgICAgICAgZm91bmQgPSAwLCBpLCBqOworCisgICAgZXJyb3JfZmxhZyA9IDA7CisgICAgcHJlcF9oZHdfaW5mbyAoKTsKKyAgICAvKioqIHNjYW4gUENJIGJ1cyBmb3IgYWxsIHBvc3NpYmxlIGJvYXJkcyAqLworI2lmIExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigyLDYsMCkKKyAgICB3aGlsZSAoKHBkZXYgPSBwY2lfZ2V0X2RldmljZSAoUENJX1ZFTkRPUl9JRF9DT05FWEFOVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUENJX0RFVklDRV9JRF9DTjg0NzQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBkZXYpKSkKKyNlbHNlCisgICAgd2hpbGUgKChwZGV2ID0gcGNpX2ZpbmRfZGV2aWNlIChQQ0lfVkVORE9SX0lEX0NPTkVYQU5ULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUENJX0RFVklDRV9JRF9DTjg0NzQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZGV2KSkpCisjZW5kaWYKKyAgICB7CisgICAgICAgIGlmIChjNF9oZHdfaW5pdCAocGRldiwgZm91bmQpKQorICAgICAgICAgICAgZm91bmQrKzsKKyAgICB9CisgICAgaWYgKCFmb3VuZCkKKyAgICB7CisgICAgICAgIHByX3dhcm5pbmcoIk5vIGJvYXJkcyBmb3VuZFxuIik7CisgICAgICAgIHJldHVybiBFTk9ERVY7CisgICAgfQorICAgIC8qIHNhbml0eSBjaGVjayBmb3IgY29uc2lzdGFudCBoYXJkd2FyZSBmb3VuZCAqLworICAgIGZvciAoaSA9IDAsIGhpID0gaGR3X2luZm87IGkgPCBNQVhfQk9BUkRTOyBpKyssIGhpKyspCisgICAgeworICAgICAgICBpZiAoaGktPnBjaV9zbG90ICE9IDB4ZmYgJiYgKCFoaS0+YWRkclswXSB8fCAhaGktPmFkZHJbMV0pKQorICAgICAgICB7CisgICAgICAgICAgICBwcl93YXJuaW5nKCIlczogc29tZXRoaW5nIHZlcnkgd3Jvbmcgd2l0aCBwY2lfZ2V0X2RldmljZVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgaGktPmRldm5hbWUpOworICAgICAgICAgICAgcmV0dXJuIEVJTzsKKyAgICAgICAgfQorICAgIH0KKyAgICAvKiBicmluZyBib2FyZCdzIG1lbW9yeSByZWdpb25zIG9uL2xpbmUgKi8KKyAgICBmb3IgKGkgPSAwLCBoaSA9IGhkd19pbmZvOyBpIDwgTUFYX0JPQVJEUzsgaSsrLCBoaSsrKQorICAgIHsKKyAgICAgICAgaWYgKGhpLT5wY2lfc2xvdCA9PSAweGZmKQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGZvciAoaiA9IDA7IGogPCAyOyBqKyspCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChyZXF1ZXN0X21lbV9yZWdpb24gKGhpLT5hZGRyW2pdLCBoaS0+bGVuW2pdLCBoaS0+ZGV2bmFtZSkgPT0gMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwcl93YXJuaW5nKCIlczogbWVtb3J5IGluIHVzZSwgYWRkcj0weCVseCwgbGVuPTB4JWx4ID9cbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBoaS0+ZGV2bmFtZSwgaGktPmFkZHJbal0sIGhpLT5sZW5bal0pOworICAgICAgICAgICAgICAgIGNsZWFudXBfaW9yZW1hcCAoKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gRU5PTUVNOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaGktPmFkZHJfbWFwcGVkW2pdID0gKHVuc2lnbmVkIGxvbmcpIGlvcmVtYXAgKGhpLT5hZGRyW2pdLCBoaS0+bGVuW2pdKTsKKyAgICAgICAgICAgIGlmICghaGktPmFkZHJfbWFwcGVkW2pdKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHByX3dhcm5pbmcoIiVzOiBpb3JlbWFwIGZhaWxzLCBhZGRyPTB4JWx4LCBsZW49MHglbHggP1xuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpLT5kZXZuYW1lLCBoaS0+YWRkcltqXSwgaGktPmxlbltqXSk7CisgICAgICAgICAgICAgICAgY2xlYW51cF9pb3JlbWFwICgpOworICAgICAgICAgICAgICAgIHJldHVybiBFTk9NRU07CisgICAgICAgICAgICB9CisjaWZkZWYgU0JFX01BUF9ERUJVRworICAgICAgICAgICAgcHJfd2FybmluZygiJXM6IGlvIHJlbWFwcGVkIGZyb20gcGh5cyAleCB0byB2aXJ0ICV4XG4iLAorICAgICAgICAgICAgICAgICAgICAgICBoaS0+ZGV2bmFtZSwgKHVfaW50MzJfdCkgaGktPmFkZHJbal0sICh1X2ludDMyX3QpIGhpLT5hZGRyX21hcHBlZFtqXSk7CisjZW5kaWYKKyAgICAgICAgfQorICAgIH0KKworICAgIGRydnJfc3RhdGUgPSBTQkVfRFJWUl9BVkFJTEFCTEU7CisKKyAgICAvKiBIYXZlIG5vdyBtZW1vcnkgbWFwcGVkIGFsbCBib2FyZHMuICBOb3cgYWxsb3cgYm9hcmQncyBhY2Nlc3MgdG8gc3lzdGVtICovCisgICAgZm9yIChpID0gMCwgaGkgPSBoZHdfaW5mbzsgaSA8IE1BWF9CT0FSRFM7IGkrKywgaGkrKykKKyAgICB7CisgICAgICAgIGlmIChoaS0+cGNpX3Nsb3QgPT0gMHhmZikKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBpZiAocGNpX2VuYWJsZV9kZXZpY2UgKGhpLT5wZGV2WzBdKSB8fAorICAgICAgICAgICAgcGNpX2VuYWJsZV9kZXZpY2UgKGhpLT5wZGV2WzFdKSkKKyAgICAgICAgeworICAgICAgICAgICAgZHJ2cl9zdGF0ZSA9IFNCRV9EUlZSX0RPV047CisgICAgICAgICAgICBwcl93YXJuaW5nKCIlczogZmFpbGVkIHRvIGVuYWJsZSBjYXJkICVkIHNsb3QgJWRcbiIsCisgICAgICAgICAgICAgICAgICAgICAgIGhpLT5kZXZuYW1lLCBpLCBoaS0+cGNpX3Nsb3QpOworICAgICAgICAgICAgY2xlYW51cF9kZXZzICgpOworICAgICAgICAgICAgY2xlYW51cF9pb3JlbWFwICgpOworICAgICAgICAgICAgcmV0dXJuIEVJTzsKKyAgICAgICAgfQorICAgICAgICBwY2lfc2V0X21hc3RlciAoaGktPnBkZXZbMF0pOworICAgICAgICBwY2lfc2V0X21hc3RlciAoaGktPnBkZXZbMV0pOworICAgICAgICBpZiAoIShoaS0+bmRldiA9IGM0X2FkZF9kZXYgKGhpLCBpLCAobG9uZykgaGktPmFkZHJfbWFwcGVkWzBdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChsb25nKSBoaS0+YWRkcl9tYXBwZWRbMV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGktPnBkZXZbMF0tPmlycSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoaS0+cGRldlsxXS0+aXJxKSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIGRydnJfc3RhdGUgPSBTQkVfRFJWUl9ET1dOOworICAgICAgICAgICAgY2xlYW51cF9pb3JlbWFwICgpOworICAgICAgICAgICAgLyogTk9URTogYzRfYWRkX2RldigpIGRvZXMgaXRzIG93biBkZXZpY2UgY2xlYW51cCAqLworI2lmIDAKKyAgICAgICAgICAgIGNsZWFudXBfZGV2cyAoKTsKKyNlbmRpZgorICAgICAgICAgICAgcmV0dXJuIGVycm9yX2ZsYWc7ICAgICAgLyogZXJyb3JfZmxhZyBzZXQgdy9pbiBhZGRfZGV2KCkgKi8KKyAgICAgICAgfQorICAgICAgICBzaG93X3R3byAoaGksIGkpOyAgICAgICAgICAgLyogZGlzcGxheXMgZm91bmQgaW5mb3JtYXRpb24gKi8KKyAgICB9CisgICAgcmV0dXJuIDA7Cit9CisKKy8qKiogI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AgIDYgICAgIC8qIGxpbmUgc3RhdGUgY2hhbmdlIGxvZ2dpbmcgdy9vIGh5c3RlcmlzaXMgKi8KKyNkZWZpbmUgTE9HX1dBUk4gICAgICAgICAgOAorI2RlZmluZSBMT0dfTU9OSVRPUiAgICAgIDEwCisjZGVmaW5lIExPR19TQkVCVUcxMiAgICAgMTIgICAgIC8qIGhpZGRlbiwgZm9yIGRldmVsb3BtZW50L2RlYnVnIHVzYWdlICovCisjZGVmaW5lIExPR19NT05JVE9SMiAgICAgMTQgICAgIC8qIGhpZGRlbiwgZm9yIGRldmVsb3BtZW50L2RlYnVnIHVzYWdlICovCisjZGVmaW5lIExPR19ERUJVRyAgICAgICAgMTYKKworICAgIC8qIFRFTVBPUkFSWSBERUZJTkVTICovLyogUkxEIERFQlVHICovCisjZGVmaW5lIGM0X0xPR19OT05FICAgICAgTE9HX05PTkUKKyNkZWZpbmUgYzRfTE9HX0VSUk9SICAgICBMT0dfRVJST1IKKyNkZWZpbmUgYzRfTE9HX1dBUk4gICAgICBMT0dfV0FSTgorI2RlZmluZSBjNF9MT0dfc1RyYWNlICAgIExPR19NT05JVE9SICAgIC8qIGRvIHNvbWUgdHJhY2UgbG9nZ2luZyBpbnRvCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogZnVuY3Rpb25zICovCisjZGVmaW5lIGM0X0xPR19ERUJVRyAgICAgTE9HX0RFQlVHCisjZGVmaW5lIGM0X0xPR19NQVggICAgICAgTE9HX0RFQlVHCisKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyoqICBnZXQgZHJpdmVyIGluZm9ybWF0aW9uICAqKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qIHJvdXRpbmUvaW9jdGw6IHdhbmNmZ19nZXRfZHJ2aW5mbygpIC0gU0JFX0lPQ19HRVRfRFJWSU5GTyAqLworCisjZGVmaW5lIFJFTF9TVFJMRU4gICA4MAorICAgIHN0cnVjdCBzYmVfZHJ2X2luZm8KKyAgICB7CisgICAgICAgIGludCAgICAgICAgIHJlbF9zdHJsZW47CisgICAgICAgIGNoYXIgICAgICAgIHJlbGVhc2VbUkVMX1NUUkxFTl07CisgICAgfTsKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiogIGdldCBib2FyZCBpbmZvcm1hdGlvbiAgKiovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qIHJvdXRpbmUvaW9jdGw6IHdhbmNmZ19nZXRfYnJkaW5mbygpIC0gU0JFX0lPQ19HRVRfQlJESU5GTyAqLworCisjZGVmaW5lIENITk1fU1RSTEVOICAgMTYKKyAgICBzdHJ1Y3Qgc2JlX2JyZF9pbmZvCisgICAgeworICAgICAgICB1X2ludDMyX3QgYnJkX2lkOyAgICAgICAvKiBTQkUncyB1bmlxdWUgUENJIFZFTkRPUi9ERVZJRCAqLworICAgICAgICB1X2ludDMyX3QgICBicmRfc247CisgICAgICAgIGludCAgICAgICAgIGJyZF9jaGFuX2NudDsgICAgICAgLyogbnVtYmVyIG9mIGNoYW5uZWxzIGJlaW5nIHVzZWQgKi8KKyAgICAgICAgaW50ICAgICAgICAgYnJkX3BvcnRfY250OyAgICAgICAvKiBudW1iZXIgb2YgcG9ydHMgYmVpbmcgdXNlZCAqLworICAgICAgICB1bnNpZ25lZCBjaGFyIGJyZG5vOyAgICAvKiBvdXIgYm9hcmQgbnVtYmVyICovCisgICAgICAgIHVuc2lnbmVkIGNoYXIgYnJkX3BjaV9zcGVlZDsgICAgLyogUENJIHNwZWVkLCAzMy82Nk1oeiAqLworICAgICAgICAgICAgICAgICAgICB1X2ludDhfdCBicmRfbWFjX2FkZHJbNl07CisgICAgICAgIGNoYXIgICAgICAgIGZpcnN0X2luYW1lW0NITk1fU1RSTEVOXTsgICAvKiBmaXJzdCBhc3NpZ25lZCBjaGFubmVsJ3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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ICAweDA3MEYgICAvKiBCSUQgMHgyWCwgQlRZUEUgMHgxWCB3L0ZQCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBMRURzICovCisjZGVmaW5lIFBDSV9ERVZJQ0VfSURfV0FOUE1DXzJTU0kgICAgICAweDA4MDEKKyNkZWZpbmUgUENJX0RFVklDRV9JRF9XQU5QQ0lfNFNTSSAgICAgIDB4MDgwMgorI2RlZmluZSBQQ0lfREVWSUNFX0lEX1dBTlBNQ18yVDNFMyAgICAgMHgwOTAwICAgLyogQklEIDB4NDMgKi8KKyNkZWZpbmUgU0JFX0JPQVJEX0lEKHYsaWQpICAgICAgICAgICAoKHY8PDE2KSB8IGlkKQorCisjZGVmaW5lIEJJTkZPX1BDSV9TUEVFRF91bmsgICAgIDAKKyNkZWZpbmUgQklORk9fUENJX1NQRUVEXzMzICAgICAgMQorI2RlZmluZSBCSU5GT19QQ0lfU1BFRURfNjYgICAgICAyCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiogIG9idGFpbiBpbnRlcmZhY2UgSUQgICoqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyogcm91dGluZS9pb2N0bDogd2FuY2ZnX2dldF9paWQoKSAtIFNCRV9JT0NfSUlEX0dFVCAqLworCisgICAgc3RydWN0IHNiZV9paWRfaW5mbworICAgIHsKKyAgICAgICAgdV9pbnQzMl90ICAgY2hhbm51bTsgICAgLyogY2hhbm5lbCByZXF1ZXN0ZWQgKi8KKyAgICAgICAgY2hhciAgICAgICAgaW5hbWVbQ0hOTV9TVFJMRU5dOyAvKiBjaGFubmVsJ3MgaW50ZXJmYWNlIG5hbWUgKi8KKyAgICB9OworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiogIGdldCBib2FyZCBhZGRyZXNzIGluZm9ybWF0aW9uICAqKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyogcm91dGluZS9pb2N0bDogd2FuY2ZnX2dldF9icmRhZGRyKCkgLSBTQkVfSU9DX0JSREFERFJfR0VUICovCisKKyAgICBzdHJ1Y3Qgc2JlX2JyZF9hZGRyCisgICAgeworICAgICAgICB1bnNpZ25lZCBjaGFyIGZ1bmM7ICAgICAvKiBzZWxlY3QgUENJIGFkZHJlc3Mgc3BhY2UgZnVuY3Rpb24gKi8KKyAgICAgICAgdW5zaWduZWQgY2hhciBicmRubzsgICAgLyogcmV0dXJucyBicmRubyByZXF1ZXN0ZWQgKi8KKyAgICAgICAgdW5zaWduZWQgY2hhciBpcnE7CisgICAgICAgIHVuc2lnbmVkIGNoYXIgc2l6ZTsgICAgIC8qIHJldHVybnMgc2l6ZSBvZiBhZGRyZXNzICovCisjZGVmaW5lIEJSREFERFJfU0laRV82NCAgMQorI2RlZmluZSBCUkRBRERSX1NJWkVfMzIgIDIKKyAgICAgICAgaW50ICAgICAgICAgcmVzZXJ2ZWQxOyAgLyogbW9kNjQgYWxpZ24sIHJlc2VydmVkIGZvciBmdXR1cmUgdXNlICovCisKKyAgICAgICAgdW5pb24KKyAgICAgICAgeworICAgICAgICAgICAgdW5zaWduZWQgbG9uZyB2aXJ0NjQ7ICAgICAgIC8qIHZpcnR1YWwvbWFwcGVkIGFkZHJlc3MgKi8KKyAgICAgICAgICAgIHVfaW50MzJfdCAgIHZpcnQzMlsyXTsKKyAgICAgICAgfSAgICAgICAgICAgdjsKKyAgICAgICAgdW5pb24KKyAgICAgICAgeworICAgICAgICAgICAgdW5zaWduZWQgbG9uZyBwaHlzNjQ7ICAgICAgIC8qIHBoeXNpY2FsIGJ1cyBhZGRyZXNzICovCisgICAgICAgICAgICB1X2ludDMyX3QgICBwaHlzMzJbMl07CisgICAgICAgIH0gICAgICAgICAgIHA7CisgICAgICAgIGludCAgICAgICAgIHJlc2VydmVkMls0XTsgICAgICAgLyogcmVzZXJ2ZWQgZm9yIGZ1dHVyZSB1c2UgKi8KKyAgICB9OworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qKiAgcmVhZC93cml0ZSBib2FyZCByZWdpc3RlcnMgICoqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qIHJvdXRpbmUvaW9jdGw6IHdhbmNmZ19yZWFkX3ZlYygpIC0gU0JFX0lPQ19SRUFEX1ZFQyAqLworLyogcm91dGluZS9pb2N0bDogd2FuY2ZnX3dyaXRlX3ZlYygpIC0gU0JFX0lPQ19XUklURV9WRUMgKi8KKworICAgIHN0cnVjdCBzYmVjb21fd3J0X3ZlYworICAgIHsKKyAgICAgICAgdV9pbnQzMl90ICAgcmVnOworICAgICAgICB1X2ludDMyX3QgICBkYXRhOworICAgIH07CisKKyNkZWZpbmUgQzFUM19DSElQX01TQ0NfMzIgICAgICAgIDB4MDEwMDAwMDAKKyNkZWZpbmUgQzFUM19DSElQX1RFQ1QzXzggICAgICAgIDB4MDIwMDAwMDAKKyNkZWZpbmUgQzFUM19DSElQX0NQTERfOCAgICAgICAgIDB4MDMwMDAwMDAKKyNkZWZpbmUgQzFUM19DSElQX0VFUFJPTV84ICAgICAgIDB4MDQwMDAwMDAKKworI2RlZmluZSBXMjU2VDNfQ0hJUF9NVVNZQ0NfMzIgICAgMHgwMjAwMDAwMAorI2RlZmluZSBXMjU2VDNfQ0hJUF9URU1VWF84ICAgICAgMHgxMDAwMDAwMAorI2RlZmluZSBXMjU2VDNfQ0hJUF9UODExMF84ICAgICAgMHgyMDAwMDAwMAorI2RlZmluZSBXMjU2VDNfQ0hJUF9UODExMF8zMiAgICAgMHgyMjAwMDAwMAorI2RlZmluZSBXMjU2VDNfQ0hJUF9DUExEXzggICAgICAgMHgzMDAwMDAwMAorI2RlZmluZSBXMjU2VDNfQ0hJUF9FRVBST01fOCAgICAgMHg0MDAwMDAwMAorCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyoqICByZWFkIHdyaXRlIHBvcnQgcGFy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nRlcnJ1cHQgbWFzaywgc3BlY2lmeSBvcmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIChTUzdfKUlOVFJfKiB0byBkaXNhYmxlICovCisgICAgICAgIHVfaW50OF90ICAgIHN0YXR1czsgICAgIC8qIDg6IGNoYW5uZWwgdHJhbnNjZWl2ZXIgc3RhdHVzIChUWF9FTkFCTEVELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBSWF9FTkFCTEVEKSAqLworICAgICAgICB1X2ludDhfdCAgICBjaGFuX21vZGU7ICAvKiA5OiBwcm90b2NvbCBtb2RlICovCisgICAgICAgIHVfaW50OF90ICAgIGlkbGVjb2RlOyAgIC8qIEE6IGlkbGUgY29kZSwgaW4gKEZMQUdfN0UsIEZMQUdfRkYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIEZMQUdfMDApICovCisgICAgICAgIHVfaW50OF90ICAgIHBhZF9maWxsX2NvdW50OyAgICAgLyogQjogcGFkIGZpbGwgY291bnQgKDEtMTI3KSwgMCAtIHBhZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGZpbGwgZGlzYWJsZWQgKi8KKyAgICAgICAgdV9pbnQ4X3QgICAgZGF0YV9pbnY7ICAgLyogQzogY2hhbm5lbCBkYXRhIGludmVyc2lvbiBzZWxlY3Rpb24gKi8KKyAgICAgICAgdV9pbnQ4X3QgICAgbW9kZV81Nms7ICAgLyogRDogNTZrYnBzIG1vZGUgKi8KKyAgICAgICAgdV9pbnQ4X3QgICAgcmVzZXJ2ZWRbMiArIDhdOyAgICAvKiBFOiAqLworICAgIH07CisKKy8qIFNTNyBpbnRlcnJ1cHQgc2lnbmFscyA8aW50cl9tYXNrPiAqLworI2RlZmluZSBTUzdfSU5UUl9TRklMVCAgICAgIDB4MDAwMDAwMjAKKyNkZWZpbmUgU1M3X0lOVFJfU0RFQyAgICAgICAweDAwMDAwMDQwCisjZGVmaW5lIFNTN19JT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mluZSBDRkdfQ0hfRElOVl9SWCAgICAgIDB4MDEKKyNkZWZpbmUgQ0ZHX0NIX0RJTlZfVFggICAgICAweDAyCisKKworLyogUG9zc3NpYmxlIHJlc2V0dGFibGUgY2hpcHNldHMvZnVuY3Rpb25zICovCisjZGVmaW5lIFJFU0VUX0RFVl9URU1VWCAgICAgMQorI2RlZmluZSBSRVNFVF9ERVZfVEVDVDMgICAgIFJFU0VUX0RFVl9URU1VWAorI2RlZmluZSBSRVNFVF9ERVZfUExMICAgICAgIDIKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyoqICByZWFkIHJlc2V0IGNoYW5uZWwgdGhydXB1dCBzdGF0aXN0aWNzICAqKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qIHJvdXRpbmUvaW9jdGw6IHdhbmNmZ19nZXRfY2hhbl9zdGF0cygpIC0gU0JFX0lPQ19DSEFOX0dFVF9TVEFUICovCisvKiByb3V0aW5lL2lvY3RsOiB3YW5jZmdfZGVsX2NoYW5fc3RhdHMoKSAtIFNCRV9JT0NfQ0hBTl9ERUxfU1RBVCAqLworLyogcm91dGluZS9pb2N0bDogd2FuY2ZnX2dldF9jYXJkX2NoYW5fc3RhdHMoKSAtIFNCRV9JT0NfQ0FSRF9DSEFOX1NUQVQgKi8KKworICAgIHN0cnVjdCBzYmVjb21fY2hhbl9zdGF0cworICAgIHsKKyAgICAgICAgdW5zaWduZWQgbG9uZyByeF9wYWNrZXRzOyAgICAgICAvKiB0b3RhbCBwYWNrZXRzIHJlY2VpdmVkICAgICAgICovCisgICAgICAgIHVuc2lnbmVkIGxvbmcgdHhfcGFja2V0czsgICAgICAgLyogdG90YWwgcGFja2V0cyB0cmFuc21pdHRlZCAgICAqLworICAgICAgICB1bnNpZ25lZCBsb25nIHJ4X2J5dGVzOyAvKiB0b3RhbCBieXRlcyByZWNlaXZlZCAgICAgICAgICovCisgICAg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9ycyAqLworICAgICAgICB1bnNpZ25lZCBsb25nIHR4X2Fib3J0ZWRfZXJyb3JzOworICAgICAgICB1bnNpZ25lZCBsb25nIHR4X2ZpZm9fZXJyb3JzOworICAgICAgICB1bnNpZ25lZCBsb25nIHR4X3BlbmRpbmc7CisgICAgfTsKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qKiAgcmVhZCB3cml0ZSBjYXJkIGxldmVsIHBhcmFtZXRlcnMgICoqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyAvKiBOT1RFOiB0aGlzIHN0cnVjdHVyZSBzdXBwb3J0cyBoYXJkd2FyZSB3aGljaCBzdXBwb3J0cyBwZXIvY2FyZCBjb250cm9sICovCisKKyAgICBzdHJ1Y3Qgc2JlY29tX2NhcmRfcGFyYW0KKyAgICB7CisgICAgICAgIHVfaW50OF90ICAgIGZyYW1pbmdfdHlwZTsgICAgICAgLyogMDogQ0JQIG9yIE0xMyAqLworICAgICAgICB1X2ludDhfdCAgICBsb29wYmFjazsgICAvKiAxOiBvbmUgb2YgTE9PUEJBQ0tfKiAqLworICAgICAgICB1X2ludDhfdCAgICBsaW5lX2J1aWxkX291dDsgICAgIC8qIDI6IGJvb2xlYW4gKi8KKyAgICAgICAgdV9pbnQ4X3QgICAgcmVjZWl2ZV9lcTsgLyogMzogYm9vbGVhbiAqLworICAgICAgICB1X2ludDhfdCAgICB0cmFuc21pdF9vbmVzOyAgICAgIC8qIDQ6IGJvb2xlYW4gKi8KKyAgICAgICAgdV9pbnQ4X3QgICAgY2xvY2s7ICAgICAgLyogNTogMCAtIGludGVybmFsLCBpPjAgLSBleHRlcm5hbCAocmVjb3ZlcmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGZyb20gZnJhbWVyIGkpICovCisgICAgICAgIHVfaW50OF90ICAgIGgxMTBlbmFibGU7IC8qIDY6ICovCisgICAgICAgIHVfaW50OF90ICAgIGRpc2FibGVfbGVkczsgICAgICAgLyogNzogKi8KKyAgICAgICAgdV9pbnQ4X3QgICAgcmVzZXJ2ZWQxOyAgLyogODogYXZhaWxhYmxlIC0gb2xkIDI1NnQzIGh5cGVyc2l6ZWQsIGJ1dAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBuZXZlciB1c2VkICovCisgICAgICAgIHVfaW50OF90ICAgIHJlYXJfaW87ICAgIC8qIDk6IHJlYXIgSS9PIG9mZi9vbiAqLworICAgICAgICB1X2ludDhfdCAgICBkaXNhYmxlX3R4OyAvKiBBOiBkaXNhYmxlIFRYIG9mZi9vbiAqLworICAgICAgICB1X2ludDhfdCAgICBtdXRlX2xvczsgICAvKiBCOiBtdXRlIExPUyBvZmYvb24gKi8KKyAgICAgICAgdV9pbnQ4X3QgICAgbG9zX3RocmVzaG9sZDsgICAgICAvKiBDOiBMT1MgdGhyZXNob2xkIG5vcm0vbG93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogKGRlZmF1bHQ6IG5vcm0pICovCisgICAgICAgIHVfaW50OF90ICAgIGRzMV9tb2RlOyAgIC8qIEQ6IERTMSBtb2RlIFQxL0UxIChkZWZhdWx0OiBUMSkgKi8KKyAgICAgICAgdV9pbnQ4X3QgICAgZHMzX3VuY2hhbjsgLyogRTogRFMzIHVuY2hhbm5lbGl6ZWQgbW9kZSBvZmYvb24gKi8KKyAgICAgICAgdV9pbnQ4X3QgICAgcmVzZXJ2ZWRbMSArIDE2XTsgICAvKiByZXNlcnZlZCBmb3IgZXhwYW5zaW9uIC0gbXVzdCBiZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIFpFUk8gZmlsbGVkICovCisgICAgfTsKKworLyogZnJhbWluZyB0eXBlcyA8ZnJhbWluZ190eXBlPiAqLworI2RlZmluZSBGUkFNSU5HX00xMyAgICAgICAgICAgICAgICAwCisjZGVmaW5lIEZSQU1JTkdfQ0JQICAgICAg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FEICovCisgICAgICAgIHVfaW50OF90ICAgIGF1dG9fYWxhcm1zOy8qIGF1dG8gYWxhcm1zICovCisgICAgICAgIHVfaW50OF90ICAgIHJlc2VydmVkWzEyXTsgICAgICAgLyogcmVzZXJ2ZWQgZm9yIGV4cGFuc2lvbiAtIG11c3QgYmUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBaRVJPIGZpbGxlZCAqLworICAgIH07CisKKy8qIGZyYW1lIHR5cGVzIDxmcmFtZV90eXBlPiAqLworI2RlZmluZSBDRkdfRlJBTUVfTk9ORSAgICAgICAgICAgICAwCisjZGVmaW5lIENGR19GUkFNRV9TRiAgICAgICAgICAgICAgIDEgICAgLyogVDEgQjhaUyAqLworI2RlZmluZSBDRkdfRlJBTUVfRVNGICAgICAgICAgICAgICAyICAgIC8qIFQxIEI4WlMgKi8KKyNkZWZpbmUgQ0ZHX0ZSQU1FX0UxUExBSU4gICAgICAgICAgMyAgICAvKiBIREIzIHcvbyBDQVMsQ1JDICovCisjZGVmaW5lIENGR19GUkFNRV9FMUNBUyAgICAgICAgICAgIDQgICAgLyogSERCMyAqLworI2RlZmluZSBDRkdfRlJBTUVfRTFDUkMgICAgICAgICAgICA1ICAgIC8qIEhEQjMgKi8KKyNkZWZpbmUgQ0ZHX0ZSQU1FX0UxQ1JDX0NBUyAgICAgICAgNiAgICAvKiBIREIzICovCisjZGVmaW5lIENGR19GUkFNRV9TRl9BTUkgICAgICAgICAgIDcgICAgLyogVDEgQU1JICovCisjZGVmaW5lIENGR19GUkFNRV9FU0ZfQU1JICAgICAgICAgIDggICAgLyogVDEgQU1JICovCisjZGVmaW5lIENGR19GUkFNRV9FMVBMQUlOX0FNSSAgICAgIDkgICAgLyogRTEgQU1JIHcvbyBDQVMsQ1JDICovCisjZGVmaW5lIENGR19GUkFNRV9FMUNBU19BTUkgICAgICAgMTAgICAgLyogRTEgQU1JICovCisjZGVmaW5lIENGR19GUkFNRV9FMUNSQ19BTUkgICAgICAgMTEgICAgLyogRTEgQU1JICovCisjZGVmaW5lIENGR19GUkFNRV9FMUNSQ19DQVNfQU1JICAgMTIgICAgLyogRTEgQU1JICovCisKKyNkZWZpbmUgSVNfRlJBTUVfQU5ZX1QxKGZpZWxkKSBcCisgICAgICAgICAgICAgICAgICAgICgoKGZpZWxkKSA9PSBDRkdfRlJBTUVfTk9ORSkgfHwgXAorICAgICAgICAgICAgICAgICAgICAgKChmaWVsZCkgPT0gQ0ZHX0ZSQU1FX1NGKSAgIHx8IFwKKyAgICAgICAgICAgICAgICAgICAgICgoZmllbGQpID09IENGR19GUkFNRV9FU0YpICB8fCBcCisgICAgICAgICAgICAgICAgICAgICAoKGZpZWxkKSA9PSBDRkdfRlJBTUVfU0ZfQU1JKSB8fCBcCisgICAgICAgICAgICAgICAgICAgICAoKGZpZWxkKSA9PSBDRkdfRlJBTUVfRVNGX0FNSSkpCisKKyNkZWZpbmUgSVNfRlJBTUVfQU5ZX1QxRVNGKGZpZWxkKSBcCisgICAgICAgICAgICAgICAgICAgICgoKGZpZWxkKSA9PSBDRkdfRlJBTUVfRVNGKSB8fCBcCisgICAgICAgICAgICAgICAgICAgICAoKGZpZWxkKSA9PSBDRkdfRlJBTUVfRVNGX0FNSSkpCisKKyNkZWZpbmUgSVNfRlJBTUVfQU5ZX0UxKGZpZWxkKSBcCisgICAgICAgICAgICAgICAgICAgICgoKGZpZWxkKSA9PSBDRkdfRlJBTUVfRTFQTEFJTikgfHwgXAorICAgICAgICAgICAgICAgICAgICAgKChmaWVsZCkgPT0gQ0ZHX0ZSQU1FX0UxQ0FTKSAgIHx8IFwKKyAgICAgICAgICAgICAgICAgICAgICgoZmllbGQpID09IENGR19GUkFNRV9FMUNSQykgICB8fCBcCisgICAgICAgICAgICAgICAgICAgICAoKGZpZWxkKSA9PSBDRkdfRlJBTUVfRTFDUkNfQ0FTKSB8fCBcCisgICAgICAgICAgICAgICAgICAgICAoKGZpZWxkKSA9PSBDRkdfRlJBTUVfRTFQTEFJTl9BTUkpIHx8IFwKKyAgICAgICAgICAgICAgICAgICAgICgoZmllbGQpID09IENGR19GUkFNRV9FMUNBU19BTUkpIHx8IFwKKyAgICAgICAgICAgICAgICAgICAgICgoZmllbGQpID09IENGR19GUkFNRV9FMUNSQ19BTUkpIHx8IFwKKyAgICAgICAgICAgICAgICAgICAgICgoZmllbGQpID09IENGR19GUkFNRV9FMUNSQ19DQVNfQU1JKSkKKworI2RlZmluZSBJU19GUkFNRV9BTllfQU1JKGZpZWxkKSBcCisgICAgICAgICAgICAgICAgICAgICgoKGZpZWxkKSA9PSBDRkdfRlJBTUVfU0ZfQU1JKSB8fCBcCisgICAgICAgICAgICAgICAgICAgICAoKGZpZWxkKSA9PSBDRkdfRlJBTUVfRVNGX0FNSSkgfHwgXAorICAgICAgICAgICAgICAgICAgICAgKChmaWVsZCkgPT0gQ0ZHX0ZSQU1FX0UxUExBSU5fQU1JKSB8fCBcCisgICAgICAgICAgICAgICAgICAgICAoKGZpZWxkKSA9PSBDRkdfRlJBTUVfRTFDQVNfQU1JKSB8fCBcCisgICAgICAgICAgICAgICAgICAgICAoKGZpZWxkKSA9PSBDRkdfRlJBTUVfRTFDUkNfQU1JKSB8fCBcCisgICAgICAgICAgICAgICAgICAgICAoKGZpZWxkKSA9PSBDRkdfRlJBTUVfRTFDUkNfQ0FTX0FNSSkpCisKKy8qIGZyYW1lIGxldmVsIGxvb3BiYWNrIG9wdGlvbnMgPGxvb3BiYWNrX3R5cGU+ICovCisjZGVmaW5lIENGR19GUk1SX0xPT1BCQUNLX05PTkUgICAgIDAKKyNkZWZpbmUgQ0ZHX0ZSTVJfTE9PUEJBQ0tfRElBRyAgICAgMQorI2RlZmluZSBDRkdfRlJNUl9MT09QQkFDS19MSU5FICAgICAyCisjZGVmaW5lIENGR19GUk1SX0xPT1BCQUNLX1BBWUxPQUQgIDMKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qKiAgcmVhZCByZXNldCBjYXJkIGVycm9yIHN0YXRpc3RpY3MgICoqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qIHJvdXRpbmUvaW9jdGw6IHdhbmNmZ19nZXRfY2FyZF9zdGF0cygpIC0gU0JFX0lPQ19DQVJEX0dFVF9TVEFUICovCisvKiByb3V0aW5lL2lvY3RsOiB3YW5jZmdfZGVsX2NhcmRfc3RhdHMoKSAtIFNCRV9JT0NfQ0FSRF9ERUxfU1RBVCAqLworCisgICAgc3RydWN0IHRlbXV4X2NhcmRfc3RhdHMKKyAgICB7CisgICAgICAgIHN0cnVjdCB0ZW11eF9zdGF0cworICAgICAgICB7CisgICAgICAgICAgICAvKiBURU1VWCBEUzMgUE1PTiBjb3VudGVycyAqLworICAgICAgICAgICAgdV9pbnQzMl90ICAgbGN2OworICAgICAgICAgICAgdV9pbnQzMl90ICAgZXJyX2ZyYW1pbmc7CisgICAgICAgICAgICB1X2ludDMyX3QgICBmZWJlOworICAgICAgICAgICAgdV9pbnQzMl90ICAgZXJyX2NwYml0OworICAgICAgICAgICAgdV9pbnQzMl90ICAgZXJyX3Bhcml0eTsKKyAgICAgICAgICAgIC8qIFRFTVVYIERTMyBGUk1SIHN0YXR1cyAqLworICAgICAgICAgICAgdV9pbnQ4X3QgICAgbG9zOworICAgICAgICAgICAgdV9pbnQ4X3QgICAgb29mOworICAgICAgICAgICAgdV9pbnQ4X3QgICAgcmVkOworICAgICAgICAgICAgdV9pbnQ4X3QgICAgeWVsbG93OworICAgICAgICAgICAgdV9pbnQ4X3QgICAgaWRsZTsKKyAgICAgICAgICAgIHVfaW50OF90ICAgIGFpczsKKyAgICAgICAgICAgIHVfaW50OF90ICAgIGNiaXQ7CisgICAgICAgICAgICAvKiBURU1VWCBEUzMgRkVBQyByZWNlaXZlciAqLworICAgICAgICAgICAgdV9pbnQ4X3QgICAgZmVhYzsKKyAgICAgICAgICAgIHVfaW50OF90ICAgIGZlYWNfbGFzdDsKKyAgICAgICAgfSAgICAgICAgICAgdDsKKyAgICAgICAgdV9pbnQzMl90ICAgdHhfcGVuZGluZzsgLyogdG90YWwgKi8KKyAgICB9OworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyAgICBzdHJ1Y3Qgd2FuY2ZnCisgICAgeworICAgICAgICBpbnQgICAgICAgICBjcywgZHM7CisgICAgICAgIGNoYXIgICAgICAgKnA7CisgICAgfTsKKyAgICB0eXBlZGVmIHN0cnVjdCB3YW5jZmcgd2NmZ190OworCisgICAgZXh0ZXJuIHdjZmdfdCAqd2FuY2ZnX2luaXQgKGNoYXIgKiwgY2hhciAqKTsKKyAgICBleHRlcm4gaW50ICB3YW5jZmdfY2FyZF9ibGluayAod2NmZ190ICosIGludCk7CisgICAgZXh0ZXJuIGludCAgd2FuY2ZnX2N0bCAod2NmZ190ICosIGludCwgdm9pZCAqLCBpbnQsIHZvaWQgKiwgaW50KTsKKyAgICBleHRlcm4gaW50ICB3YW5jZmdfZGVsX2NhcmRfc3RhdHMgKHdjZmdfdCAqKTsKKyAgICBleHRlcm4gaW50ICB3YW5jZmdfZGVsX2NoYW5fc3RhdHMgKHdjZmdfdCAqLCBpbnQpOworICAgIGV4dGVybiBpbnQgIHdhbmNmZ19lbmFibGVfcG9ydHMgKHdjZmdfdCAqLCBpbnQpOworICAgIGV4dGVybiBpbnQgIHdhbmNmZ19mcmVlICh3Y2ZnX3QgKik7CisgICAgZXh0ZXJuIGludCAgd2FuY2ZnX2dldF9icmRhZGRyICh3Y2ZnX3QgKiwgc3RydWN0IHNiZV9icmRfYWRkciAqKTsKKyAgICBleHRlcm4gaW50ICB3YW5jZmdfZ2V0X2JyZGluZm8gKHdjZmdfdCAqLCBzdHJ1Y3Qgc2JlX2JyZF9pbmZvICopOworICAgIGV4dGVybiBpbnQgIHdhbmNmZ19nZXRfY2FyZCAod2NmZ190ICosIHN0cnVjdCBzYmVjb21fY2FyZF9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naW5uaW5nLgorICovCisjaWYgKF9fR05VQ19fIDwgMykgfHwgKF9fR05VQ19fID09IDMgJiYgX19HTlVDX01JTk9SX18gPCAyKQorI2Vycm9yIFNvcnJ5LCB5b3VyIEdDQyBpcyB0b28gb2xkLiBJdCBidWlsZHMgaW5jb3JyZWN0IGtlcm5lbHMuCisjZW5kaWYKKworI2lmIF9fR05VQ19fID09IDQgJiYgX19HTlVDX01JTk9SX18gPT0gMSAmJiBfX0dOVUNfUEFUQ0hMRVZFTF9fID09IDAKKyN3YXJuaW5nIGdjYy00LjEuMCBpcyBrbm93biB0byBtaXNjb21waWxlIHRoZSBrZXJuZWwuICBBIGRpZmZlcmVudCBjb21waWxlciB2ZXJzaW9uIGlzIHJlY29tbWVuZGVkLgorI2VuZGlmCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI2lmZGVmIFNCRV9JTkNMVURFX1NZTUJPTFMKKyNkZWZpbmUgU1RBVElDCisjZWxzZQorI2RlZmluZSBTVEFUSUMgIHN0YXRpYworI2VuZGlmCisKKyNkZWZpbmUgQ0hBTk5BTUUgImhkbGMiCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogZm9yd2FyZCByZWZlcmVuY2VzICovCitzdGF0dXNfdCAgICBjNF9jaGFuX3dvcmtfaW5pdCAobXBpX3QgKiwgbWNoX3QgKik7Cit2b2lkICAgICAgICBtdXN5Y2Nfd3FfY2hhbl9yZXN0YXJ0ICh2b2lkICopOworc3RhdHVzX3QgX19pbml0IGM0X2luaXQgKGNpX3QgKiwgdV9jaGFyICosIHVfY2hhciAqKTsKK3N0YXR1c190IF9faW5pdCBjNF9pbml0MiAoY2lfdCAqKTsKK2NpX3QgICAgICAgKl9faW5pdCBjNF9uZXcgKHZvaWQgKik7CitpbnQ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ICAgICAgIG1heF9tdHVfZGVmYXVsdCA9IE1VU1lDQ19NVFU7Cittb2R1bGVfcGFyYW0obWF4X210dSwgaW50LCAwNDQ0KTsKKworaW50ICAgICAgICAgbWF4X3R4ZGVzY191c2VkID0gTVVTWUNDX1RYREVTQ19NSU47CitpbnQgICAgICAgICBtYXhfdHhkZXNjX2RlZmF1bHQgPSBNVVNZQ0NfVFhERVNDX01JTjsKK21vZHVsZV9wYXJhbShtYXhfdHhkZXNjX3VzZWQsIGludCwgMDQ0NCk7CisKK2ludCAgICAgICAgIG1heF9yeGRlc2NfdXNlZCA9IE1VU1lDQ19SWERFU0NfTUlOOworaW50ICAgICAgICAgbWF4X3J4ZGVzY19kZWZhdWx0ID0gTVVTWUNDX1JYREVTQ19NSU47Cittb2R1bGVfcGFyYW0obWF4X3J4ZGVzY191c2VkLCBpbnQsIDA0NDQpOworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3ZvaWQgICAgICAgKgorZ2V0dXNlcmJ5Y2hhbiAoaW50IGNoYW5udW0pCit7CisgICAgbWNoX3QgICAgICAqY2g7CisKKyAgICBjaCA9IGM0X2ZpbmRfY2hhbiAoY2hhbm51bSk7CisgICAgcmV0dXJuIGNoID8gY2gtPnVzZXIgOiAwOworfQorCisKKyNpZiBMSU5VWF9WRVJTSU9OX0NPREUgPCBLRVJORUxfVkVSU0lPTigyLDUsMCkKKyNkZWZpbmUgREVWX1RPX1BSSVYoZGV2KSAoICogKHN0cnVjdCBjNF9wcml2ICoqKSAoKGhkbGNfZGV2aWNlKikoZGV2KSsxKSkKKyNlbHNlCisKK2NoYXIgICAgICAgKgorZ2V0X2hkbGNfbmFtZSAoaGRsY19kZXZpY2UgKiBoZGxjKQoreworICAgIHN0cnVjdCBjNF9wcml2ICpwcml2ID0gaGRsYy0+cHJpdjsKKyAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2ID0gZ2V0dXNlcmJ5Y2hhbiAocHJpdi0+Y2hhbm51bSk7CisKKyAgICByZXR1cm4gZGV2LT5uYW1lOworfQorI2VuZGlmCisKKworc3RhdGljICAgICAgc3RhdHVzX3QKK21rcmV0IChpbnQgYnNkKQoreworICAgIGlmIChic2QgPiAwKQorICAgICAgICByZXR1cm4gLWJzZDsKKyAgICBlbHNlCisgICAgICAgIHJldHVybiBic2Q7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWYgTElOVVhfVkVSU0lPTl9DT0RFID4gS0VSTkVMX1ZFUlNJT04oMiw1LDQxKQorI2luY2x1ZGUgPGxpbnV4L3dvcmtxdWV1ZS5oPgorCisvKioqCisgKiBPbmUgd29ya3F1ZXVlICh3cSkgcGVyIHBvcnQgKHNpbmNlIG11c3ljYyBhbGxvd3Mgc2ltdWx0YW5lb3VzIGdyb3VwCisgKiBjb21tYW5kcyksIHdpdGggaW5kaXZpZHVhbCBkYXRhIGZvciBlYWNoIGNoYW5uZWw6CisgKgorICogICBtcGlfdCAtPiBzdHJ1Y3Qgd29ya3F1ZXVlX3N0cnVjdCAqd3FfcG9ydDsgIChkeW5hbWljYWxseSBhbGxvY2F0ZWQgdXNpbmcKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjcmVhdGVfd29ya3F1ZXVlKCkpCisgKgorICogV2l0aCB3b3JrIHN0cnVjdHVyZSAod29yaykgc3RhdGljYWxseSBhbGxvY2F0ZWQgZm9yIGVhY2ggY2hhbm5lbDoKKyAqCisgKiAg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dG8gcmVzdGFydCBhIHN0b3BwZWQgY2hhbm5lbAorICAgICAqLworCisgICAgLyoqIElOSVRfV09SSyAoc3RydWN0IHdvcmtfc3RydWN0ICp3b3JrLAorICAgICAqKiAgICAgICAgICAgIHZvaWQgKCpmdW5jdGlvbikodm9pZCAqKSwKKyAgICAgKiogICAgICAgICAgICB2b2lkICpkYXRhKTsKKyAgICAgKiovCisgICAgSU5JVF9XT1JLKCZjaC0+Y2hfd29yaywgKHZvaWQgKiltdXN5Y2Nfd3FfY2hhbl9yZXN0YXJ0KTsKKyAgICByZXR1cm4gMDsgICAgICAgICAgICAgICAgICAgICAgIC8qIHN1Y2Nlc3MgKi8KK30KKworc3RhdHVzX3QKK2M0X3dxX3BvcnRfaW5pdCAobXBpX3QgKiBwaSkKK3sKKworICAgIGNoYXIgICAgICAgIG5hbWVbMTZdLCAqbnA7ICAvKiBOT1RFOiBuYW1lIG9mIHRoZSBxdWV1ZSBsaW1pdGVkIGJ5IHN5c3RlbQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiB0byAxMCBjaGFyYWN0ZXJzICovCisKKyAgICBpZiAocGktPndxX3BvcnQpCisgICAgICAgIHJldHVybiAwOyAgICAgICAgICAgICAgICAgICAvKiBhbHJlYWR5IGluaXRpYWxpemVkICovCisKKyAgICBucCA9IG5hbWU7CisgICAgbWVtc2V0IChuYW1lLCAwLCAxNik7CisgICAgc3ByaW50ZiAobnAsICIlcyVkIiwgcGktPnVwLT5kZXZuYW1lLCBwaS0+cG9ydG51bSk7IC8qIElFIHBtY2M0LTAxKSAqLworCisjaWZkZWYgUkxEX1JFU1RBUlRfREVCVUcKKyAgICBwcl9pbmZvKCI+PiAlczogY3JlYXRpbmcgd29ya3F1ZXVlIDwlcz4gZm9yIFBvcnQgJWQuXG4iLAorICAgICAgICAgICAgX19mdW5jX18sIG5hbWUsIHBpLT5wb3J0bnVtKTsgLyogUkxEIERFQlVHICovCisjZW5kaWYKKyAgICBpZiAoIShwaS0+d3FfcG9ydCA9IGNyZWF0ZV9zaW5nbGV0aHJlYWRfd29ya3F1ZXVlIChuYW1lKSkpCisgICAgICAgIHJldHVybiBFTk9NRU07CisgICAgcmV0dXJuIDA7ICAgICAgICAgICAgICAgICAgICAgICAvKiBzdWNjZXNzICovCit9CisKK3ZvaWQKK2M0X3dxX3BvcnRfY2xlYW51cCAobXBpX3QgKiBwaSkKK3sKKyAgICAvKgorICAgICAqIFBPUlQgUE9JTlQ6IGNhbm5vdCBjYWxsIHRoaXMgaWYgV1EgaXMgc3RhdGljYWxseSBhbGxvY2F0ZWQgdy9pbgorICAgICAqIHN0cnVjdHVyZSBzaW5jZSBpdCBjYWxscyBrZnJlZSh3cSk7CisgICAgICovCisgICAgaWYgKHBpLT53cV9wb3J0KQorICAgIHsKKyAgICAgICAgZGVzdHJveV93b3JrcXVldWUgKHBpLT53cV9wb3J0KTsgICAgICAgIC8qIHRoaXMgYWxzbyBjYWxscworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogZmx1c2hfd29ya3F1ZXVlKCkgKi8KKyAgICAgICAgcGktPndxX3BvcnQgPSAwOworICAgIH0KK30KKyNlbmRpZgorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitpcnFyZXR1cm5fdAorYzRfbGludXhfaW50ZXJydXB0IChpbnQgaXJxLCB2b2lkICpkZXZfaW5zdGFuY2UpCit7CisgICAgc3RydWN0IG5ldF9kZXZpY2UgKm5kZXYgPSBkZXZfaW5zdGFuY2U7CisKKyAgICByZXR1cm4gbXVzeWNjX2ludHJfdGhfaGFuZGxlcihuZXRkZXZfcHJpdihuZGV2KSk7Cit9CisKKworI2lmZGVmIENPTkZJR19TQkVfUE1DQzRfTkNPTU0KK2lycXJldHVybl90CitjNF9lYnVzX2ludGVycnVwdCAoaW50IGlycSwgdm9pZCAqZGV2X2luc3RhbmNlKQoreworICAgIHN0cnVjdCBuZXRfZGV2aWNlICpuZGV2ID0gZGV2X2luc3RhbmNlOworCisgICAgcmV0dXJuIGM0X2VidXNfaW50cl90aF9oYW5kbGVyKG5ldGRldl9wcml2KG5kZXYpKTsKK30KKyNlbmRpZgorCisKK3N0YXRpYyBpbnQKK3ZvaWRfb3BlbiAoc3RydWN0IG5ldF9kZXZpY2UgKiBuZGV2KQoreworICAgIHByX2luZm8oIiVzOiB0cnlpbmcgdG8gb3BlbiBtYXN0ZXIgZGV2aWNlICFcbiIsIG5kZXYtPm5hbWUpOworICAgIHJldHVybiAtMTsKK30KKworCisjaWYgTElOVVhfVkVSU0lPTl9DT0RFIDwgS0VSTkVMX1ZFUlNJT04oMiw1LDApCisjaWYgIWRlZmluZWQoR0VORVJJQ19IRExDX1ZFUlNJT04pIHx8IChHRU5FUklDX0hETENfVkVSU0lPTiA8IDQpCisKKy8qKiBMaW51eCAyLjQuMTgtMTkgKiovCitTVEFUSUMgaW50CitjaGFuX29wZW4gKGhkbGNfZGV2aWNlICogaGRsYykKK3sKKyAgICBzdGF0dXNfdCAgICByZXQ7CisKKyAgICBpZiAoKHJldCA9IGM0X2NoYW5fdXAgKERFVl9UT19QUklWIChoZGxjKS0+Y2ksIERFVl9UT19QUklWIChoZGxjKS0+Y2hhbm51bSkpKQorICAgICAgICByZXR1cm4gLXJldDsKKyAgICBNT0RfSU5DX1VTRV9DT1VOVDsKKyAgICBuZXRpZl9zdGFydF9xdWV1ZSAoaGRsY190b19kZXYgKGhkbGMpKTsKKyAgICByZXR1cm4gMDsgICAgICAgICAgICAgICAgICAgICAgIC8qIG5vIGVycm9yID0gc3VjY2VzcyAqLworfQorCisjZWxzZQorCisvKiogTGludXggMi40LjIwIGFuZCBoaWdoZXIgKiovCitTVEFUSUMgaW50CitjaGFuX29wZW4gKHN0cnVjdCBuZXRfZGV2aWNlICogbmRldikKK3sKKyAgICBoZGxjX2RldmljZSAqaGRsYyA9IGRldl90b19oZGxjIChuZGV2KTsKKyAgICBzdGF0dXNfdCAgICByZXQ7CisKKyAgICBoZGxjLT5wcm90byA9IElGX1BST1RPX0hETEM7CisgICAgaWYgKChyZXQgPSBoZGxjX29wZW4gKGhkbGMpKSkKKyAgICB7CisgICAgICAgIHByX2luZm8oImhkbGNfb3BlbiBmYWlsdXJlLCBlcnIgJWQuXG4iLCByZXQpOworICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKyAgICBpZiAoKHJldCA9IGM0X2NoYW5fdXAgKERFVl9UT19QUklWIChoZGxjKS0+Y2ksIERFVl9UT19QUklWIChoZGxjKS0+Y2hhbm51bSkpKQorICAgICAgICByZXR1cm4gLXJldDsKKyAgICBNT0RfSU5DX1VTRV9DT1VOVDsKKyAgICBuZXRpZl9zdGFydF9xdWV1ZSAoaGRsY190b19kZXYgKGhkbGMpKTsKKyAgICByZXR1cm4gMDsgICAgICAgICAgICAgICAgICAgICAgIC8qIG5vIGVycm9yID0gc3VjY2VzcyAqLworfQorI2VuZGlmCisKKyNlbHNlCisKKy8qKiBMaW51eCAyLjYgKiovCitTVEFUSUMgaW50CitjaGFuX29wZW4gKHN0cnVjdCBuZXRfZGV2aWNlICogbmRldikKK3sKKyAgICBoZGxjX2RldmljZSAqaGRsYyA9IGRldl90b19oZGxjIChuZGV2KTsKKyAgICBjb25zdCBzdHJ1Y3QgYzRfcHJpdiAqcHJpdiA9IGhkbGMtPnByaXY7CisgICAgaW50ICAgICAgICAgcmV0OworCisgICAgaWYgKChyZXQgPSBoZGxjX29wZW4gKG5kZXYpKSkKKyAgICB7CisgICAgICAgIHByX2luZm8oImhkbGNfb3BlbiBmYWlsdXJlLCBlcnIgJWQuXG4iLCByZXQpOworICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKyAgICBpZiAoKHJldCA9IGM0X2NoYW5fdXAgKHByaXYtPmNpLCBwcml2LT5jaGFubnVtKSkpCisgICAgICAgIHJldHVybiAtcmV0OworICAgIHRyeV9tb2R1bGVfZ2V0IChUSElTX01PRFVMR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reworICAgIGhkbGNfZGV2aWNlICpoZGxjID0gZGV2X3RvX2hkbGMgKG5kZXYpOworICAgIGNvbnN0IHN0cnVjdCBjNF9wcml2ICpwcml2ID0gaGRsYy0+cHJpdjsKKworICAgIG5ldGlmX3N0b3BfcXVldWUgKG5kZXYpOworICAgIG11c3ljY19jaGFuX2Rvd24gKChjaV90ICopIDAsIHByaXYtPmNoYW5udW0pOworICAgIGhkbGNfY2xvc2UgKG5kZXYpOworICAgIG1vZHVsZV9wdXQgKFRISVNfTU9EVUxFKTsKKyAgICByZXR1cm4gMDsKK30KKyNlbmRpZgorCisKKyNpZiAhZGVmaW5lZChHRU5FUklDX0hETENfVkVSU0lPTikgfHwgKEdFTkVSSUNfSERMQ19WRVJTSU9OIDwgNCkKKworLyoqIExpbnV4IDIuNC4xOC0xOSAqKi8KK1NUQVRJQyBpbnQKK2NoYW5faW9jdGwgKGhkbGNfZGV2aWNlICogaGRsYywgc3RydWN0IGlmcmVxICogaWZyLCBpbnQgY21kKQoreworICAgIGlmIChjbWQgPT0gSERMQ1NDTE9DSykKKyAgICB7CisgICAgICAgIGlmci0+aWZyX2lmcnUuaWZydV9pdmFsdWUgPSBMSU5FX0RFRkFVTFQ7CisgICAgICAgIHJldHVybiAwOworICAgIH0KKyAgICByZXR1cm4gLUVJTlZBTDsKK30KKyNlbmRpZgorCisKKyNpZiAhZGVmaW5lZChHRU5FUklDX0hETENfVkVSU0lPTikgfHwgKEdFTkVSSUNfSERMQ19WRVJTSU9OIDwgNCkKK1NUQVRJQyBpbnQKK2NoYW5fZGV2X2lvY3RsIChzdHJ1Y3QgbmV0X2RldmljZSAqIGhkbGMsIHN0cnVjdCBpZnJlcSAqIGlmciwgaW50IGNtZCkKK3sKKyAgICBpZiAoY21kID09IEhETENTQ0xPQ0spCisgICAgeworICAgICAgICBpZnItPmlmcl9pZnJ1LmlmcnVfaXZhbHVlID0gTElORV9ERUZBVUxUOworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisgICAgcm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CBza19idWZmICogc2tiKQoreworICAgIGludCAgICAgICAgIHJ2YWw7CisKKyAgICBydmFsID0gbXVzeWNjX3N0YXJ0X3htaXQgKERFVl9UT19QUklWIChoZGxjKS0+Y2ksIERFVl9UT19QUklWIChoZGxjKS0+Y2hhbm51bSwgc2tiKTsKKyAgICByZXR1cm4gLXJ2YWw7Cit9CisjZWxzZSAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIG5ldyAqLworU1RBVElDIGludAorYzRfbGludXhfeG1pdCAoc3RydWN0IHNrX2J1ZmYgKiBza2IsIHN0cnVjdCBuZXRfZGV2aWNlICogbmRldikKK3sKKyAgICBjb25zdCBzdHJ1Y3QgYzRfcHJpdiAqcHJpdjsKKyAgICBpbnQgICAgICAgICBydmFsOworCisjaWYgTElOVVhfVkVSU0lPTl9DT0RFIDwgS0VSTkVMX1ZFUlNJT04oMiw1LDApCisgICAgcHJpdiA9IERFVl9UT19QUklWIChuZGV2KTsKKyNlbHNlCisgICAgaGRsY19kZXZpY2UgKmhkbGMgPSBkZXZfdG9faGRsYyAobmRldik7CisKKyAgICBwcml2ID0gaGRsYy0+cHJpdjsKKyNlbmRpZgorCisgICAgcnZhbCA9IG11c3ljY19zdGFydF94bWl0IChwcml2LT5jaSwgcHJpdi0+Y2hhbm51bSwgc2tiKTsKKyAgICByZXR1cm4gLXJ2YWw7Cit9CisjZW5kaWYgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdFTkVSSUNfSERMQ19WRVJTSU9OICovCisKK3N0YXRpYyBjb25zdCBzdHJ1Y3QgbmV0X2RldmljZV9vcHMgY2hhbl9vcHMgPSB7CisgICAgICAgLm5kb19vcGVuICAgICAgID0gY2hhbl9vcGVuLAorICAgICAgIC5uZG9fc3RvcCAgICAgICA9IGNoYW5fY2xvc2UsCisgICAgICAgLm5kb19zdGFydF94bWl0ID0gYzRfbGludXhfeG1pdCwKKyAgICAgICAubmRvX2RvX2lvY3RsICAgPSBjaGFuX2Rldl9pb2N0bCwKKyAgICAgICAubmRvX2dldF9zdGF0cyAgPSBjaGFuX2dldF9zdGF0cywKK307CisKK1NUQVRJQyBzdHJ1Y3QgbmV0X2RldmljZSAqCitjcmVhdGVfY2hhbiAoc3RydWN0IG5ldF9kZXZpY2UgKiBuZGV2LCBjaV90ICogY2ksCisgICAgICAgICAgICAgc3RydWN0IHNiZWNvbV9jaGFuX3BhcmFtICogY3ApCit7CisgICAgaGRsY19kZXZpY2UgKmhkbGM7CisgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldjsKKyAgICBoZHdfaW5mb190ICpoaTsKKyAgICBpbnQgICAgICAgICByZXQ7CisKKyAgICBpZiAoYzRfZmluZF9jaGFuIChjcC0+Y2hhbm51bSkpCisgICAgICAgIHJldHVybiAwOyAgICAgICAgICAgICAgICAgICAvKiBjaGFubmVsIGFscmVhZHkgZXhpc3RzICovCisKKyAgICB7CisgICAgICAgIHN0cnVjdCBjNF9wcml2ICpwcml2OworCisgICAgICAgIC8qIGFsbG9jYXRlIHRoZW4gZmlsbCBpbiBwcml2YXRlIGRhdGEgc3RydWN0dXJlICovCisgICAgICAgIHByaXYgPSBPU19rbWFsbG9jIChzaXplb2YgKHN0cnVjdCBjNF9wcml2KSk7CisgICAgICAgIGlmICghcHJpdikKKyAgICAgICAgeworICAgICAgICAgICAgcHJfd2FybmluZygiJXM6IG5vIG1lbW9yeSBmb3IgbmV0X2RldmljZSAhXG4iLCBjaS0+ZGV2bmFtZSk7CisgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgfQorICAgICAgICBkZXYgPSBhbGxvY19oZGxjZGV2IChwcml2KTsKKyAgICAgICAgaWYgKCFkZXYpCisgICAgICAgIHsKKyAgICAgICAgICAgIHByX3dhcm5pbmcoIiVzOiBubyBtZW1vcnkgZm9yIGhkbGNfZGV2aWNlICFcbiIsIGNpLT5kZXZuYW1lKTsKKyAgICAgICAgICAgIE9TX2tmcmVlIChwcml2KTsKKyAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICB9CisgICAgICAgIHByaXYtPmNpID0gY2k7CisgICAgICAgIHByaXYtPmNoYW5udW0gPSBjcC0+Y2hhbm51bTsKKyAgICB9CisKKyAgICBoZGxjID0gZGV2X3RvX2hkbGMgKGRldik7CisKKyAgICBkZXYtPmJhc2VfYWRkciA9IDA7ICAgICAgICAgICAgIC8qIG5vdCBJL08gbWFwcGVkICovCisgICAgZGV2LT5pcnEgPSBuZGV2LT5pcnE7CisgICAgZGV2LT50eXBlID0gQVJQSFJEX1JBV0hETEM7CisgICAgKmRldi0+bmFtZSA9IDA7ICAgICAgICAgICAgICAgICAvKiBkZWZhdWx0IGlmY29uZmlnIG5hbWUgPSAiaGRsYyIgKi8KKworICAgIGhpID0gKGhkd19pbmZvX3QgKikgY2ktPmhkd19pbmZvOworICAgIGlmIChoaS0+bWZnX2luZm9fc3RzID09IEVFUFJPTV9PSykKKyAgICB7CisgICAgICAgIHN3aXRjaCAoaGktPnByb21mbXQpCisgICAgICAgIHsKKyAgICAgICAgY2FzZSBQUk9NX0ZPUk1BVF9UWVBFMToKKyAgICAgICAgICAgIG1lbWNweSAoZGV2LT5kZXZfYWRkciwgKEZMRF9UWVBFMSAqKSAoaGktPm1mZ19pbmZvLnBmdDEuU2VyaWFsKSwgNik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBQUk9NX0ZPUk1BVF9UWVBFMjoKKyAgICAgICAgICAgIG1lbWNweSAoZGV2LT5kZXZfYWRkciwgKEZMRF9UWVBFMiAqKSAoaGktPm1mZ19pbmZvLnBmdDIuU2VyaWFsKSwgNik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIG1lbXNldCAoZGV2LT5kZXZfYWRkciwgMCwgNik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0gZWxzZQorICAgIHsKKyAgICAgICAgbWVtc2V0IChkZXYtPmRldl9hZGRyLCAwLCA2KTsKKyAgICB9CisKKyA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GdldF9jaV9ieV9kZXYgKG5kZXYpOworICAgIGlmICghY2kpCisgICAgICAgIHJldHVybiAtRUlOVkFMOyAgICAgICAgICAgICAvKiBnZXQgY2FyZCBpbmZvICovCisKKyAgICByZXQgPSBta3JldCAoYzRfZ2V0X3BvcnQgKGNpLCBwcC5wb3J0bnVtKSk7CisgICAgaWYgKHJldCkKKyAgICAgICAgcmV0dXJuIHJldDsKKyAgICBpZiAoY29weV90b191c2VyIChkYXRhLCAmY2ktPnBvcnRbcHAucG9ydG51bV0ucCwKKyAgICAgICAgICAgICAgICAgICAgICBzaXplb2YgKHN0cnVjdCBzYmVjb21fcG9ydF9wYXJhbSkpKQorICAgICAgICByZXR1cm4gLUVGQVVMVDsKKyAgICByZXR1cm4gMDsKK30KKworLyogdGhpcyBmdW5jdGlvbiBjb3B5cyB0aGUgdXNlciBkYXRhIGFuZCB0aGVuIGNhbGxzIHRoZSByZWFsIGFjdGlvbiBmdW5jdGlvbiAqLworU1RBVElDICAgICAgc3RhdHVzX3QKK2RvX3NldF9wb3J0IChzdHJ1Y3QgbmV0X2RldmljZSAqIG5kZXYsIHZvaWQgKmRhdGEpCit7CisgICAgY2lfdCAgICAgICAqY2k7ICAgICAgICAgICAgIC8qIGNpIHN0YW5kcyBmb3IgY2FyZCBpbmZvcm1hdGlvbiAqLworICAgIHN0cnVjdCBzYmVjb21fcG9ydF9wYXJhbSBwcDsvKiBjb3B5IGRhdGEgdG8ga2VybmVsIGxhbmQgKi8KKworICAgIGlmIChjb3B5X2Zyb21fdXNlciAoJnBwLCBkYXRhLCBzaXplb2YgKHN0cnVjdCBzYmVjb21fcG9ydF9wYXJhbSkpKQorICAgICAgICByZXR1cm4gLUVGQVVMVDsKKyAgICBpZiAocHAucG9ydG51bSA+PSBNVVNZQ0NfTlBPUlRTKQorICAgICAgICByZXR1cm4gLUVGQVVMVDsKKyAgICBjaSA9IGdldF9jaV9ieV9kZXYgKG5kZXYpOworICAgIGlmICghY2kpCisgICAgICAgIHJldHVybiAtRUlOVkFMOyAgICAgICAgICAgICAvKiBnZXQgY2FyZCBpbmZvICovCisKKyAgICBpZiAocHAucG9ydG51bSA+PSBjaS0+bWF4X3BvcnQpIC8qIHNhbml0eSBjaGVjayAqLworICAgICAgICByZXR1cm4gRU5YSU87CisKKyAgICBtZW1jcHkgKCZjaS0+cG9ydFtwcC5wb3J0bnVtXS5wLCAmcHAsIHNpemVvZiAoc3RydWN0IHNiZWNvbV9wb3J0X3BhcmFtKSk7CisgICAgcmV0dXJuIG1rcmV0IChjNF9zZXRfcG9ydCAoY2ksIHBwLnBvcnRudW0pKTsKK30KKworLyogd29yayB0aGUgcG9ydCBsb29wYmFjayBtb2RlIGFzIHBlciBkaXJlY3RlZCAqLworU1RBVElDICAgICAgc3RhdHVzX3QKK2RvX3BvcnRfbG9vcCAoc3RydWN0IG5ldF9kZXZpY2UgKiBuZGV2LCB2b2lkICpkYXRhKQoreworICAgIHN0cnVjdCBzYmVjb21fcG9ydF9wYXJhbSBwcDsKKyAgICBjaV90ICAgICAgICpjaTsKKworICAgIGlmIChjb3B5X2Zyb21fdXNlciAoJnBwLCBkYXRhLCBzaXplb2YgKHN0cnVjdCBzYmVjb21fcG9ydF9wYXJhbSkpKQorICAgICAgICByZXR1cm4gLUVGQVVMVDsKKyAgICBjaSA9IGdldF9jaV9ieV9kZXYgKG5kZXYpOworICAgIGlmICghY2kpCisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIHJldHVybiBta3JldCAoYzRfbG9vcF9wb3J0IChjaSwgcHAucG9ydG51bSwgcHAucG9ydF9tb2RlKSk7Cit9CisKKy8qIHNldCB0aGUgc3BlY2lmaWVkIHJlZ2lzdGVyIHdpdGggdGhlIGdpdmVuIHZhbHVlIC8gb3IganVzdCByZWFkIGl0ICovCitTVEFUSUMgICAgICBzdGF0dXNfdAorZG9fZnJhbWVyX3J3IChzdHJ1Y3QgbmV0X2RldmljZSAqIG5kZXYsIHZvaWQgKmRhdGEpCit7CisgICAgc3RydWN0IHNiZWNvbV9wb3J0X3BhcmFtIHBwOworICAgIGNpX3QgICAgICAgKmNpOworICAgIGludCAgICAgICAgIHJldDsKKworICAgIGlmIChjb3B5X2Zyb21fdXNlciAoJnBwLCBkYXRhLCBzaXplb2YgKHN0cnVjdCBzYmVjb21fcG9ydF9wYXJhbSkpKQorICAgICAgICByZXR1cm4gLUVGQVVMVDsKKyAgICBjaSA9IGdldF9jaV9ieV9kZXYgKG5kZXYpOworICAgIGlmICghY2kpCisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIHJldCA9IG1rcmV0IChjNF9mcmFtZV9ydyAoY2ksICZwcCkpOworICAgIGlmIChyZXQpCisgICAgICAgIHJldHVybiByZXQ7CisgICAgaWYgKGNvcHlfdG9fdXNlciAoZGF0YSwgJnBwLCBzaXplb2YgKHN0cnVjdCBzYmVjb21fcG9ydF9wYXJhbSkpKQorICAgICAgICByZXR1cm4gLUVGQVVMVDsKKyAgICByZXR1cm4gMDsKK30KKworLyogc2V0IHRoZSBzcGVjaWZpZWQgcmVnaXN0ZXIgd2l0aCB0aGUgZ2l2ZW4gdmFsdWUgLyBvciBqdXN0IHJlYWQgaXQgKi8KK1NUQVRJQyAgICAgIHN0YXR1c190Citkb19wbGRfcncgKHN0cnVjdCBuZXRfZGV2aWNlICogbmRldiwgdm9pZCAqZGF0YSkKK3sKKyAgICBzdHJ1Y3Qgc2JlY29tX3BvcnRfcGFyYW0gcHA7CisgICAgY2lfdCAgICAgICAqY2k7CisgICAgaW50ICAgICAgICAgcmV0OworCisgICAgaWYgKGNvcHlfZnJvbV91c2VyICgmcHAsIGRhdGEsIHNpemVvZiAoc3RydWN0IHNiZWNvbV9wb3J0X3BhcmFtKSkpCisgICAgICAgIHJldHVybiAtRUZBVUxUOworICAgIGNpID0gZ2V0X2NpX2J5X2RldiAobmRldik7CisgICAgaWYgKCFjaSkKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgcmV0ID0gbWtyZXQgKGM0X3BsZF9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bV9jaGFuX3BhcmFtIGNwOworICAgIGludCAgICAgICAgIHJldDsKKworICAgIGlmIChjb3B5X2Zyb21fdXNlciAoJmNwLCBkYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mIChzdHJ1Y3Qgc2JlY29tX2NoYW5fcGFyYW0pKSkKKyAgICAgICAgcmV0dXJuIC1FRkFVTFQ7CisKKyAgICBpZiAoKHJldCA9IG1rcmV0IChjNF9nZXRfY2hhbiAoY3AuY2hhbm51bSwgJmNwKSkpKQorICAgICAgICByZXR1cm4gcmV0OworCisgICAgaWYgKGNvcHlfdG9fdXNlciAoZGF0YSwgJmNwLCBzaXplb2YgKHN0cnVjdCBzYmVjb21fY2hhbl9wYXJhbSkpKQorICAgICAgICByZXR1cm4gLUVGQVVMVDsKKyAgICByZXR1cm4gMDsKK30KKworU1RBVElDICAgICAgc3RhdHVzX3QKK2RvX3NldF9jaGFuIChzdHJ1Y3QgbmV0X2RldmljZSAqIG5kZXYsIHZvaWQgKmRhdGEpCit7CisgICAgc3RydWN0IHNiZWNvbV9jaGFuX3BhcmFtIGNwOworICAgIGludCAgICAgICAgIHJldDsKKyAgICBjaV90ICAgICAgICpjaTsKKworICAgIGlmIChjb3B5X2Zyb21fdXNlciAoJmNwLCBkYXRhLCBzaXplb2YgKHN0cnVjdCBzYmVjb21fY2hhbl9wYXJhbSkpKQorICAgICAgICByZXR1cm4gLUVGQVVMVDsKKyAgICBjaSA9IGdldF9jaV9ieV9kZXYgKG5kZXYpOworICAgIGlmICghY2kpCisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIHN3aXRjaCAocmV0ID0gbWtyZXQgKGM0X3NldF9jaGFuIChjcC5jaGFubnVtLCAmY3ApKSkKKyAgICB7CisgICAgY2FzZSAwOgorICAgICAgICByZXR1cm4gMDsKKyAgICBkZWZhdWx0OgorICAgICAgICByZXR1cm4gcmV0OworICAgIH0KK30KKworU1RBVElDICAgICAgc3RhdHVzX3QKK2RvX2NyZWF0ZV9jaGFuIChzdHJ1Y3QgbmV0X2RldmljZSAqIG5kZXYsIHZvaWQgKmRhdGEpCit7CisgICAgY2lfdCAgICAgICAqY2k7CisgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldjsKKyAgICBzdHJ1Y3Qgc2JlY29tX2NoYW5fcGFyYW0gY3A7CisgICAgaW50ICAgICAgICAgcmV0OworCisgICAgaWYgKGNvcHlfZnJvbV91c2VyICgmY3AsIGRhdGEsIHNpemVvZiAoc3RydWN0IHNiZWNvbV9jaGFuX3BhcmFtKSkpCisgICAgICAgIHJldHVybiAtRUZBVUxUOworICAgIGNpID0gZ2V0X2NpX2J5X2RldiAobmRldik7CisgICAgaWYgKCFjaSkKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgZGV2ID0gY3JlYXRlX2NoYW4gKG5kZXYsIGNpLCAmY3ApOworICAgIGlmICghZGV2KQorICAgICAgICByZXR1cm4gLUVCVVNZOworICAgIHJldCA9IG1rcmV0IChjNF9uZXdfY2hhbiAoY2ksIGNwLnBvcnQsIGNwLmNoYW5udW0sIGRldikpOworICAgIGlmIChyZXQpCisgICAgeworI2lmIExJTlVYX1ZFUlNJT05fQ09ERSA8IEtFUk5FTF9WRVJTSU9OKDIsNSwwKQorICAgICAgICBydG5sX3VubG9jayAoKTsgICAgICAgICAgICAgLyogbmVlZGVkIGR1ZSB0byBJb2N0bCBjYWxsaW5nIHNlcXVlbmNlICovCisgICAgICAgIFY3ICh1bnJlZ2lzdGVyX2hkbGNfZGV2aWNlKSAoZGV2X3RvX2hkbGMgKGRldikpOworICAgICAgICBydG5sX2xvY2sgKCk7ICAgICAgICAgICAgICAgLyogbmVlZGVkIGR1ZSB0byBJb2N0bCBjYWxsaW5nIHNlcXVlbmNlICovCisgICAgICAgIE9TX2tmcmVlIChERVZfVE9fUFJJViAoZGV2KSk7CisgICAgICAgIE9TX2tmcmVlIChkZXYpOworI2Vsc2UKKyAgICAgICAgcnRubF91bmxvY2sgKCk7ICAgICAgICAgICAgIC8qIG5lZWRlZCBkdWUgdG8gSW9jdGwgY2FsbGluZyBzZXF1ZW5jZSAqLworICAgICAgICB1bnJlZ2lzdGVyX2hkbGNfZGV2aWNlIChkZXYpOworICAgICAgICBydG5sX2xvY2sgKCk7ICAgICAgICAgICAgICAgLyogbmVlZGVkIGR1ZSB0byBJb2N0bCBjYWxsaW5nIHNlcXVlbmNlICovCisgICAgICAgIGZyZWVfbmV0ZGV2IChkZXYpOworI2VuZGlmCisgICAgfQorICAgIHJldHVybiByZXQ7Cit9CisKK1NUQVRJQyAgICAgIHN0YXR1c190Citkb19nZXRfY2hhbl9zdGF0cyAoc3RydWN0IG5ldF9kZXZpY2UgKiBuZGV2LCB2b2lkICpkYXRhKQoreworICAgIHN0cnVjdCBjNF9jaGFuX3N0YXRzX3dyYXAgY2NzOworICAgIGludCAgICAgICAgIHJldDsKKworICAgIGlmIChjb3B5X2Zyb21fdXNlciAoJmNjcywgZGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiAoc3RydWN0IGM0X2NoYW5fc3RhdHNfd3JhcCkpKQorICAgICAgICByZXR1cm4gLUVGQVVMVDsKKyAgICBzd2l0Y2ggKHJldCA9IG1rcmV0IChjNF9nZXRfY2hhbl9zdGF0cyAoY2NzLmNoYW5udW0sICZjY3Muc3RhdHMpKSkKKyAgICB7CisgICAgY2FzZSAwOgorICAgICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKyAgICBpZiAoY29weV90b191c2VyIChkYXRhLCAmY2NzLAorICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiAoc3RydWN0IGM0X2NoYW5fc3RhdHNfd3JhcCkpKQorICAgICAgICByZXR1cm4gLUVGQVVMVDsKKyAgICByZXR1cm4gMDsKK30KK1NUQVRJQyAgICAgIHN0YXR1c190Citkb19zZXRfbG9nbGV2ZWwgKHN0cnVjdCBuZXRfZGV2aWNlICogbmRldiwgdm9pZCAqZGF0YSkKK3sKKyAgICB1bnNpZ25lZCBpbnQgbG9nX2xldmVsOworCisgICAgaWYgKGNvcHlfZnJvbV91c2VyICgmbG9nX2xldmVsLCBkYXRhLCBzaXplb2YgKGludCkpKQorICAgICAgICByZXR1cm4gLUVGQVVMVDsKKyAgICBzYmVjb21fc2V0X2xvZ2xldmVsIChsb2dfbGV2ZWwpOworICAgIHJldHVybiAwOworfQorCitTVEFUSUMgICAgICBzdGF0dXNfdAorZG9fZGVsdXNlciAoc3RydWN0IG5ldF9kZXZpY2UgKiBuZGV2LCBpbnQgbG9ja2l0KQoreworICAgIGlmIChuZGV2LT5mbGFncyAmIElGRl9VUCkKKyAgICAgICAgcmV0dXJuIC1FQlVTWTsKKworICAgIHsKKyAgICAgICAgY2lfdCAgICAgICAqY2k7CisgICAgICAgIG1jaF90ICAgICAgKmNoOworICAgICAgICBjb25zdCBzdHJ1Y3QgYzRfcHJpdiAqcHJpdjsKKyAgICAgICAgaW50ICAgICAgICAgY2hhbm51bTsKKworI2lmIExJTlVYX1ZFUlNJT05fQ09ERSA8IEtFUk5FTF9WRVJTSU9OKDIsNSwwKQorICAgICAgICBwcml2ID0gREVWX1RPX1BSSVYgKG5kZXYpOworI2Vsc2UKKyAgICAgICAgcHJpdiA9IChzdHJ1Y3QgYzRfcHJpdiAqKSBkZXZfdG9faGRsYyAobmRldiktPnByaXY7CisjZW5kaWYKKyAgICAgICAgY2kgPSBwcml2LT5jaTsKKyAgICAgICAgY2hhbm51bSA9IHByaXYtPmNoYW5udW07CisKKyAgICAgICAgY2ggPSBjNF9maW5kX2NoYW4gKGNoYW5udW0pOworICAgICAgICBpZiAoY2ggPT0gTlVMTCkKKyAgICAgICAgICAgIHJldHVybiAtRU5PRU5UOworICAgICAgICBjaC0+dXNlciA9IDA7ICAgICAgICAgICAgICAgLyogd2lsbCBiZSBmcmVlZCwgYmVsb3cgKi8KKyAgICB9CisKKyNpZiBMSU5VWF9WRVJTSU9OX0NPREUgPCBLRVJORUxfVkVSU0lPTigyLDUsMCkKKyAgICBpZiAobG9ja2l0KQorICAgICAgICBydG5sX3VubG9jayAoKTsgICAgICAgICAgICAgLyogbmVlZGVkIGlmIElvY3RsIGNhbGxpbmcgc2VxdWVuY2UgKi8KKyAgICBWNyAodW5yZWdpc3Rlcl9oZGxjX2RldmljZSkgKGRldl90b19oZGxjIChuZGV2KSk7CisgICAgaWYgKGxvY2tpdCkKKyAgICAgICAgcnRubF9sb2NrICgpOyAgICAgICAgICAgICAgIC8qIG5lZWRlZCBpZiBJb2N0bCBjYWxsaW5nIHNlcXVlbmNlICovCisgICAgT1Nfa2ZyZWUgKERFVl9UT19QUklWIChuZGV2KSk7CisgICAgT1Nfa2ZyZWUgKG5kZXYpOworI2Vsc2UKKyAgICBpZiAobG9ja2l0KQorICAgICAgICBydG5sX3VubG9jayAoKTsgICAgICAgICAgICAgLyogbmVlZGVkIGlmIElvY3RsIGNhbGxpbmcgc2VxdWVuY2UgKi8KKyAgICB1bnJlZ2lzdGVyX2hkbGNfZGV2aWNlIChuZGV2KTsKKyAgICBpZiAobG9ja2l0KQorICAgICAgICBydG5sX2xvY2sgKCk7ICAgICAgICAgICAgICAgLyogbmVlZGVkIGlmIElvY3RsIGNhbGxpbmcgc2VxdWVuY2UgKi8KKyAgICBmcmVlX25ldGRldiAobmRldik7CisjZW5kaWYKKyAgICByZXR1cm4gMDsKK30KKworaW50Citkb19kZWxfY2hhbiAoc3RydWN0IG5ldF9kZXZpY2UgKiBtdXN5Y2NfZGV2LCB2b2lkICpkYXRhKQoreworICAgIHN0cnVjdCBzYmVjb21fY2hhbl9wYXJhbSBjcDsKKyAgICBjaGFyICAgICAgICBidWZbc2l6ZW9mIChDSEFOTkFNRSkgKyAzXTsKKyAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2OworICAgIGludCAgICAgICAgIHJldDsKKworICAgIGlmIChjb3B5X2Zyb21fdXNlciAoJmNwLCBkYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mIChzdHJ1Y3Qgc2JlY29tX2NoYW5fcGFyYW0pKSkKKyAgICAgICAgcmV0dXJuIC1FRkFVTFQ7CisgICAgc3ByaW50ZiAoYnVmLCBDSEFOTkFNRSAiJWQiLCBjcC5jaGFubnVtKTsKKyAgICBpZiAoIShkZXYgPSBkZXZfZ2V0X2J5X25hbWUgKCZpbml0X25ldCwgYnVmKSkpCisgICAgICAgIHJldHVybiAtRU5PRU5UOworICAgIGRldl9wdXQgKGRldik7CisgICAgcmV0ID0gZG9fZGVsdXNlciAoZGV2LCAxKTsKKyAgICBpZiAocmV0KQorICAgICAgICByZXR1cm4gcmV0OworICAgIHJldHVybiBjNF9kZWxfY2hhbiAoY3AuY2hhbm51bSk7Cit9CitpbnQgICAgICAgICBjNF9yZXNldF9ib2FyZCAodm9pZCAqKTsKKworaW50Citkb19yZXNldCAoc3RydWN0IG5ldF9kZXZpY2UgKiBtdXN5Y2NfZGV2LCB2b2lkICpkYXRhKQoreworICAgIGNvbnN0IHN0cnVjdCBjNF9wcml2ICpwcml2OworICAgIGludCAgICAgICAgIGk7CisKKyAgICBmb3IgKGkgPSAwOyBpIDwgMTI4OyBpKyspCisgICAgeworICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqbmRldjsKKyAgICAgICAgY2hhciAgICAgICAgYnVmW3NpemVvZiAoQ0hBTk5BTUUpICsgM107CisKKyAgICAgICAgc3ByaW50ZiAoYnVmLCBDSEFOTkFNRSAiJWQiLCBpKTsKKyAgICAgICAgaWYgKCEobmRldiA9IGRldl9nZXRfYnlfbmFtZSgmaW5pdF9uZXQsIGJ1ZikpKQorICAgICAgICAgICAgY29udGludWU7CisgICAgICAgIHByaXYgPSBkZXZfdG9faGRsYyAobmRldiktPnByaXY7CisKKyAgICAgICAgaWYgKCh1bnNpZ25lZCBsb25nKSAocHJpdi0+Y2kpID09CisgICAgICAgICAgICAodW5zaWduZWQgbG9uZykgKG5ldGRldl9wcml2KG11c3ljY19kZXYpKSkKKyAgICAgICAgeworICAgICAgICAgICAgbmRldi0+ZmxhZ3MgJj0gfklGRl9VUDsKKyAgICAgICAgICAgIGRldl9wdXQgKG5kZXYpOworICAgICAgICAgICAgbmV0aWZfc3RvcF9xdWV1ZSAobmRldik7CisgICAgICAgICAgICBkb19kZWx1c2VyIChuZGV2LCAxKTsKKyAgICAgICAgfSBlbHNlCisgICAgICAgICAgICBkZXZfcHV0IChuZGV2KTsKKyAgICB9CisgICAgcmV0dXJuIDA7Cit9CisKK2ludAorZG9fcmVzZXRfY2hhbl9zdGF0cyAoc3RydWN0IG5ldF9kZXZpY2UgKiBtdXN5Y2NfZGV2LCB2b2lkICpkYXRhKQoreworICAgIHN0cnVjdCBzYmVjb21fY2hhbl9wYXJhbSBjcDsKKworICAgIGlmIChjb3B5X2Zyb21fdXNlciAoJmNwLCBkYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mIChzdHJ1Y3Qgc2JlY29tX2NoYW5fcGFyYW0pKSkKKyAgICAgICAgcmV0dXJuIC1FRkFVTFQ7CisgICAgcmV0dXJuIG1rcmV0IChjNF9kZWxfY2hhbl9zdGF0cyAoY3AuY2hhbm51bSkpOworfQorCitTVEFUSUMgICAgICBzdGF0dXNfdAorYzRfaW9jdGwgKHN0cnVjdCBuZXRfZGV2aWNlICogbmRldiwgc3RydWN0IGlmcmVxICogaWZyLCBpbnQgY21kKQoreworICAgIGNpX3QgICAgICAgKmNpOworICAgIHZvaWQgICAgICAgKmRhdGE7CisgICAgaW50ICAgICAgICAgaW9jbWQsIGlvbGVuOworICAgIHN0YXR1c190ICAgIHJldDsKKyAgICBzdGF0aWMgc3RydWN0IGRhdGEKKyAgICB7CisgICAgICAgIHVuaW9uCisgICAgICAgIHsKKyAgICAgICAgICAgIHVfaW50OF90IGM7CisgICAgICAgICAgICB1X2ludDMyX3QgaTsKKyAgICAgICAgICAgIHN0cnVjdCBzYmVfYnJkX2luZm8gYmlwOworICAgICAgICAgICAgc3RydWN0IHNiZV9kcnZfaW5mbyBkaXA7CisgICAgICAgICAgICBzdHJ1Y3Qgc2JlX2lpZF9pbmZvIGlpcDsKKyAgICAgICAgICAgIHN0cnVjdCBzYmVfYnJkX2FkZHIgYmFwOworICAgICAgICAgICAgc3RydWN0IHNiZWNvbV9jaGFuX3N0YXRzIHN0YXRzOworICAgICAgICAgICAgc3RydWN0IHNiZWNvbV9jaGFuX3BhcmFtIHBhcmFtOworICAgICAgICAgICAgc3RydWN0IHRlbXV4X2NhcmRfc3RhdHMgY2FyZHM7CisgICAgICAgICAgICBzdHJ1Y3Qgc2JlY29tX2NhcmRfcGFyYW0gY2FyZHA7CisgICAgICAgICAgICBzdHJ1Y3Qgc2JlY29tX2ZyYW1lcl9wYXJhbSBmcnA7CisgICAgICAgIH0gICAgICAgICAgIHU7CisgICAgfSAgICAgICAgICAgYXJnOworCisKKyAgICBpZiAoIWNhcGFibGUgKENBUF9TWVNfQURNSU4pKQorICAgICAgICByZXR1cm4gLUVQRVJNOworICAgIGlmIChjbWQgIT0gU0lPQ0RFVlBSSVZBVEUgKyAxNSkKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgaWYgKCEoY2kgPSBnZXRfY2lfYnlfZGV2IChuZGV2KSkpCisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIGlmIChjaS0+c3RhdGUgIT0gQ19SVU5OSU5HKQorICAgICAgICByZXR1cm4gLUVOT0RFVjsKKyAgICBpZiAoY29weV9mcm9tX3VzZXIgKCZpb2NtZCwgaWZyLT5pZnJfZGF0YSwgc2l6ZW9mIChpb2NtZCkpKQorICAgICAgICByZXR1cm4gLUVGQVVMVDsKKyNpZiAwCisgICAgaWYgKGNvcHlfZnJvbV91c2VyICgmbGVuLCBpZnItPmlmcl9kYXRhICsgc2l6ZW9mIChpb2NtZCksIHNpemVvZiAobGVuKSkpCisgICAgICAgIHJldHVybiAtRUZBVUxUOworI2VuZGlmCisKKyNpZiAwCisgICAgcHJfaW5mbygiYzRfaW9jdGw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vY3RsLi4uXG4iKTsKKyAgICAgICAgcmV0ID0gZG9fc2V0X2NoYW4gKG5kZXYsIGRhdGEpOworICAgICAgICBicmVhazsKKyAgICBjYXNlIEM0X0RFTF9DSEFOOgorICAgICAgICAvL3ByX2luZm8oIj4+IEM0X0RFTF9DSEFOIElvY3RsLi4uXG4iKTsKKyAgICAgICAgcmV0ID0gZG9fZGVsX2NoYW4gKG5kZXYsIGRhdGEpOworICAgICAgICBicmVhazsKKyAgICBjYXNlIFNCRV9JT0NfQ0hBTl9ORVc6CisgICAgICAgIHJldCA9IGRvX2NyZWF0ZV9jaGFuIChuZGV2LCBkYXRhKTsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBTQkVfSU9DX0NIQU5fR0VUX1NUQVQ6CisgICAgICAgIHJldCA9IGRvX2dldF9jaGFuX3N0YXRzIChuZGV2LCBkYXRhKTsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBTQkVfSU9DX0xPR0xFVkVMOgorICAgICAgICByZXQgPSBkb19zZXRfbG9nbGV2ZWwgKG5kZXYsIGRhdGEpOworICAgICAgICBicmVhazsKKyAgICBjYXNlIFNCRV9JT0NfUkVTRVRfREVWOgorICAgICAgICByZXQgPSBkb19yZXNldCAobmRldiwgZGF0YSk7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgU0JFX0lPQ19DSEFOX0RFTF9TVEFUOgorICAgICAgICByZXQgPSBkb19yZXNldF9jaGFuX3N0YXRzIChuZGV2LCBkYXRhKTsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBDNF9MT09QX1BPUlQ6CisgICAgICAgIHJldCA9IGRvX3BvcnRfbG9vcCAobmRldiwgZGF0YSk7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgQzRfUldfRlJNUjoKKyAgICAgICAgcmV0ID0gZG9fZnJhbWVyX3J3IChuZGV2LCBkYXRhKTsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBDNF9SV19NU1lDOgorICAgICAgICByZXQgPSBkb19tdXN5Y2NfcncgKG5kZXYsIGRhdGEpOworICAgICAgICBicmVhazsKKyAgICBjYXNlIEM0X1JXX1BMRDoKKyAgICAgICAgcmV0ID0gZG9fcGxkX3J3IChuZGV2LCBkYXRhKTsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBTQkVfSU9DX0lJRF9HRVQ6CisgICAgICAgIHJldCA9IChpb2xlbiA9PSBzaXplb2YgKHN0cnVjdCBzYmVfaWlkX2luZm8pKSA/IGM0X2dldF9paWRpbmZvIChjaSwgJmFyZy51LmlpcCkgOiAtRUZBVUxUOworICAgICAgICBpZiAocmV0ID09IDApICAgICAgICAgICAgICAgLyogbm8gZXJyb3IsIGNvcHkgZGF0YSAqLworICAgICAgICAgICAgaWYgKGNvcHlfdG9fdXNlciAoZGF0YSwgJmFyZywgaW9sZW4pKQorICAgICAgICAgICAgICAgIHJldHVybiAtRUZBVUxUOworICAgICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgICAvL3ByX2luZm8oIj4+IGM0X2lvY3RsOiBFSU5WQUwgLSB1bmtub3duIGlvY21kIDwleD5cbiIsIGlvY21kKTsKKyAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgIHJldHVybiBta3JldCAocmV0KTsKK30KKworc3RhdGljIGNvbnN0IHN0cnVjdCBuZXRfZGV2aWNlX29wcyBjNF9vcHMgPSB7CisgICAgICAgLm5kb19vcGVuICAgICAgID0gdm9pZF9vcGVuLAorICAgICAgIC5uZG9fc3RhcnRfeG1pdCA9IGM0X2xpbnV4X3htaXQsCisgICAgICAgLm5kb19kb19pb2N0bCAgID0gYzRfaW9jdGwsCit9OworCitzdGF0aWMgdm9pZCBjNF9zZXR1cChzdHJ1Y3QgbmV0X2RldmljZSAqZGV2KQoreworICAgICAgIGRldi0+dHlwZSA9IEFSUEhSRF9WT0lEOworICAgICAgIGRldi0+bmV0ZGV2X29wcyA9ICZjNF9vcHM7Cit9CisKK3N0cnVjdCBuZXRfZGV2aWNlICpfX2luaXQKK2M0X2FkZF9kZXYgKGhkd19pbmZvX3QgKiBoaSwgaW50IGJyZG5vLCB1bnNpZ25lZCBsb25nIGYwLCB1bnNpZ25lZCBsb25nIGYxLAorICAgICAgICAgICAgaW50IGlycTAsIGludCBpcnExKQoreworICAgIHN0cnVjdCBuZXRfZGV2aWNlICpuZGV2OworICAgIGNpX3QgICAgICAgKmNpOworCisgICAgbmRldiA9IGFsbG9jX25ldGRldihzaXplb2YoY2lfdCksIFNCRV9JRkFDRVRNUEwsIGM0X3NldHVwKTsKKyAgICBpZiAoIW5kZXYpCisgICAgeworICAgICAgICBwcl93YXJuaW5nKCIlczogbm8gbWVtb3J5IGZvciBzdHJ1Y3QgbmV0X2RldmljZSAhXG4iLCBoaS0+ZGV2bmFtZSk7CisgICAgICAgIGVycm9yX2ZsYWcgPSBFTk9NRU07CisgICAgICAgIHJldHVybiAwOworICAgIH0KKyAgICBjaSA9IChjaV90ICopKG5ldGRldl9wcml2KG5kZXYpKTsKKyAgICBuZGV2LT5pcnEgPSBpcnEwOworCisgICAgY2ktPmhkd19pbmZvID0gaGk7CisgICAgY2ktPnN0YXRlID0gQ19JTklUOyAgICAgICAgIC8qIG1hcmsgYXMgaGFyZHdhcmUgbm90IGF2YWlsYWJsZSAqLworICAgIGNpLT5uZXh0ID0gYzRfbGlzdDsKKyAgICBjNF9saXN0ID0gY2k7CisgICAgY2ktPmJyZG5vID0gY2ktPm5leHQgPyBjaS0+bmV4dC0+YnJkbm8gKyAxIDogMDsKKworICAgIGlmIChDSSA9PSAwKQorICAgICAgICBDSSA9IGNpOyAgICAgICAgICAgICAgICAgICAgLyogREVCVUcsIG9ubHkgYm9hcmQgMCB1c2FnZSAqLworCisgICAgc3RyY3B5IChjaS0+ZGV2bmFtZSwgaGktPmRldm5hbWUpOworICAgIGNpLT5yZWxlYXNlID0gJnBtY2M0X09TU0lfcmVsZWFzZVswXTsKKworICAgIC8qIHRhc2tsZXQgKi8KKyNpZiBkZWZpbmVkKFNCRV9JU1JfVEFTS0xFVCkKKyAgICB0YXNrbGV0X2luaXQgKCZjaS0+Y2lfbXVzeWNjX2lzcl90YXNrbGV0LAorICAgICAgICAgICAgICAgICAgKHZvaWQgKCopICh1bnNpZ25lZCBsb25nKSkgbXVzeWNjX2ludHJfYmhfdGFza2xldCwKKyAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCBsb25nKSBjaSk7CisKKyAgICBpZiAoYXRvbWljX3JlYWQgKCZjaS0+Y2lfbXVzeWNjX2lzcl90YXNrbGV0LmNvdW50KSA9PSAwKQorICAgICAgICB0YXNrbGV0X2Rpc2FibGVfbm9zeW5jICgmY2ktPmNpX211c3ljY19pc3JfdGFza2xldCk7CisjZWxpZiBkZWZpbmVkKFNCRV9JU1JfSU1NRURJQVRFKQorICAgIGNpLT5jaV9tdXN5Y2NfaXNyX3RxLnJvdXRpbmUgPSAodm9pZCAqKSAodW5zaWduZWQgbG9uZykgbXVzeWNjX2ludHJfYmhfdGFza2xldDsKKyAgICBjaS0+Y2lfbXVzeWNjX2lzcl90cS5kYXRhID0gY2k7CisjZW5kaWYKKworCisgICAgaWYgKHJlZ2lzdGVyX25ldGRldiAobmRldikgfHwKKyAgICAgICAgKGM0X2luaXQgKGNpLCAodV9jaGFyICopIGYwLCAodV9jaGFyICopIGYxKSAhPSBTQkVfRFJWUl9TVUNDRVNTKSkKKyAgICB7CisgICAgICAgIE9TX2tmcmVlIChuZXRkZXZfcHJpdihuZGV2KSk7CisgICAgICAgIE9TX2tmcmVlIChuZGV2KTsKKyAgICAgICAgZXJyb3JfZmxhZyA9IEVOT0RFVjsKKyAgICAgICAgcmV0dXJuIDA7CisgICAgfQorICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICogIGludCByZXF1ZXN0X2lycSh1bnNpZ25lZCBpbnQgaXJxLAorICAgICAqICAgICAgICAgICAgICAgICAgdm9pZCAoKmhhbmRsZXIpKGludCwgdm9pZCAqLCBzdHJ1Y3QgcHRfcmVncyAqKSwKKyAgICAgKiAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZmxhZ3MsIGNvbnN0IGNoYXIgKmRldl9uYW1lLCB2b2lkICpkZXZfaWQpOworICAgICAqICB3aGVyZWluOgorICAgICAqICBpcnEgICAgICAtPiBUaGUgaW50ZXJydXB0IG51bWJlciB0aGF0IGlzIGJlaW5nIHJlcXVlc3RlZC4KKyAgICAgKiAgaGFuZGxlciAgLT4gUG9pbnRlciB0byBoYW5kbGluZyBmdW5jdGlvbiBiZWluZyBpbnN0YWxsZWQuCisgICAgICogIGZsYWdzICAgIC0+IEEgYml0IG1hc2sgb2Ygb3B0aW9ucyByZWxhdGVkIHRvIGludGVycnVwdCBtYW5hZ2VtZW50LgorICAgICAqICBkZXZfbmFtZSAtPiBTdHJpbmcgdXNlZCBpbiAvcHJvYy9pbnRlcnJ1cHRzIHRvIHNob3cgb3duZXIgb2YgaW50ZXJydXB0LgorICAgICAqICBkZXZfaWQgICAtPiBQb2ludGVyIChmb3Igc2hhcmVkIGludGVycnVwdCBsaW5lcykgdG8gcG9pbnQgdG8gaXRzIG93bgorICAgICAqICAgICAgICAgICAgICBwcml2YXRlIGRhdGEgYXJlYSAodG8gaWRlbnRpZnkgd2hpY2ggZGV2aWNlIGlzIGludGVycnVwdGluZykuCisgICAgICoKKyAgICAgKiAgZXh0ZXJuIHZvaWQgZnJlZV9pcnEodW5zaWduZWQgaW50IGlycSwgdm9pZCAqZGV2X2lkKTsKKyAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyAgICBpZiAocmVxdWVzdF9pcnEgKGlycTAsICZjNF9saW51eF9pbnRlcnJ1cHQsCisjaWYgZGVmaW5lZChTQkVfSVNSX1RBU0tMRVQpCisgICAgICAgICAgICAgICAgICAgICBJUlFGX0RJU0FCTEVEIHwgSVJRRl9TSEFSRUQsCisjZWxpZiBkZWZpbmVkKFNCRV9JU1JfSU1NRURJQVRFKQorICAgICAgICAgICAgICAgICAgICAgSVJRRl9ESVNBQkxFRCB8IElSUUZfU0hBUkVELAorI2VsaWYgZGVmaW5lZChTQkVfSVNSX0lOTElORSkKKyAgICAgICAgICAgICAgICAgICAgIElSUUZfU0hBUkVELAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICBuZGV2LT5uYW1lLCBuZGV2KSkKKyAgICB7CisgICAgICAgIHByX3dhcm5pbmcoIiVzOiBNVVNZQ0MgY291bGQgbm90IGdldCBpcnE6ICVkXG4iLCBuZGV2LT5uYW1lLCBpcnEwKTsKKyAgICAgICAgdW5yZWdpc3Rlcl9uZXRkZXYgKG5kZXYpOworICAgICAgICBPU19rZnJlZSAobmV0ZGV2X3ByaXYobmRldikpOworICAgICAgICBPU19rZnJlZSAobmRldik7CisgICAgICAgIGVycm9yX2ZsYWcgPSBFSU87CisgICAgICAgIHJldHVybiAwOworICAgIH0KKyNpZmRlZiBDT05GSUdfU0JFX1BNQ0M0X05DT01NCisgICAgaWYgKHJlcXVlc3RfaXJxIChpcnExLCAmYzRfZWJ1c19pbnRlcnJ1cHQsIElSUUZfU0hBUkVELCBuZGV2LT5uYW1lLCBuZGV2KSkKKyAgICB7CisgICAgICAgIHByX3dhcm5pbmcoIiVzOiBFQlVTIGNvdWxkIG5vdCBnZXQgaXJxOiAlZFxuIiwgaGktPmRldm5hbWUsIGlycTEpOworICAgICAgICB1bnJlZ2lzdGVyX25ldGRldiAobmRldik7CisgICAgICAgIGZyZWVfaXJxIChpcnEwLCBuZGV2KTsKKyAgICAgICAgT1Nfa2ZyZWUgKG5ldGRldl9wcml2KG5kZXYpKTsKKyAgICAgICAgT1Nfa2ZyZWUgKG5kZXYpOworICAgICAgICBlcnJvcl9mbGFnID0gRUlPOworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisjZW5kaWYKKworICAgIC8qIHNldHVwIGJvYXJkIGlkZW50aWZpY2F0aW9uIGluZm9ybWF0aW9uICovCisKKyAgICB7CisgICAgICAgIHVfaW50MzJfdCAgIHRtcDsKKworICAgICAgICBoZHdfc25fZ2V0IChoaSwgYnJkbm8pOyAgICAgLyogYWxzbyBzZXRzIFBST00gZm9ybWF0IHR5cGUgKHByb21mbXQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBmb3IgbGF0ZXIgdXNhZ2UgKi8KKworICAgICAgICBzd2l0Y2ggKGhpLT5wcm9tZm10KQorICAgICAgICB7CisgICAgICAgIGNhc2UgUFJPTV9GT1JNQVRfVFlQRTE6CisgICAgICAgICAgICBtZW1jcHkgKG5kZXYtPmRldl9hZGRyLCAoRkxEX1RZUEUxICopIChoaS0+bWZnX2luZm8ucGZ0MS5TZXJpYWwpLCA2KTsKKyAgICAgICAgICAgIG1lbWNweSAoJnRtcCwgKEZMRF9UWVBFMSAqKSAoaGktPm1mZ19pbmZvLnBmdDEuSWQpLCA0KTsgICAgIC8qIHVuYWxpZ25lZCBkYXRhCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBhY3F1aXNpdGlvbiAqLworICAgICAgICAgICAgY2ktPmJyZF9pZCA9IGNwdV90b19iZTMyICh0bXApOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgUFJPTV9GT1JNQVRfVFlQRTI6CisgICAgICAgICAgICBtZW1jcHkgKG5kZXYtPmRldl9hZGRyLCAoRkxEX1RZUEUyICopIChoaS0+bWZnX2luZm8ucGZ0Mi5TZXJpYWwpLCA2KTsKKyAgICAgICAgICAgIG1lbWNweSAoJnRtcCwgKEZMRF9UWVBFMiAqKSAoaGktPm1mZ19pbmZvLnBmdDIuSWQpLCA0KTsgICAgIC8qIHVuYWxpZ25lZCBkYXRhCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBhY3F1aXNpdGlvbiAqLworICAgICAgICAgICAgY2ktPmJyZF9pZCA9IGNwdV90b19iZTMyICh0bXApOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBjaS0+YnJkX2lkID0gMDsKKyAgICAgICAgICAgIG1lbXNldCAobmRldi0+ZGV2X2FkZHIsIDAsIDYpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworI2lmIDEKKyAgICAgICAgc2JlaWRfc2V0X2hkd2JpZCAoY2kpOyAgICAgIC8qIHJlcXVpcmVzIGJpZCB0byBiZSBwcmVzZXQgKi8KKyNlbHNlCisgICAgICAgIHNiZWlkX3NldF9iZHR5cGUgKGNpKTsgICAgICAvKiByZXF1aXJlcyBoZHdfYmlkIHRvIGJlIHByZXNldCAqLworI2VuZGlmCisKKyAgICB9CisKKyNpZmRlZiBDT05GSUdfUFJPQ19GUworICAgIHNiZWNvbV9wcm9jX2JyZF9pbml0IChjaSk7CisjZW5kaWYKKyNpZiBkZWZpbmVkKFNCRV9JU1JfVEFTS0xFVCkKKyAgICB0YXNrbGV0X2VuYWJsZSAoJmNpLT5jaV9tdXN5Y2NfaXNyX3Rhc2tsZXQpOworI2VuZGlmCisKKworICAgIGlmICgoZXJyb3JfZmxhZyA9IGM0X2luaXQyIChjaSkpICE9IFNCRV9EUlZSX1NVQ0NFU1MpCisgICAgeworI2lmZGVmIENPTkZJR19QUk9DX0ZTCisgICAgICAgIHNiZWNvbV9wcm9jX2JyZF9jbGVhbnVwIChjaSk7CisjZW5kaWYKKyAgICAgICAgdW5yZWdpc3Rlcl9uZXRkZXYgKG5kZXYpOworICAgICAgICBmcmVlX2lycSAoaXJxMSwgbmRldik7CisgICAgICAgIGZyZWVfaXJxIChpcnEwLCBuZGV2KTsKKyAgICAgICAgT1Nfa2ZyZWUgKG5ldGRldl9wcml2KG5kZXYpKTsKKyAgICAgIC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ogZG9fZGVsdXNlcigpCisgICovCisKK1NUQVRJQyB2b2lkIF9fZXhpdAorY2xlYW51cF9oZGxjICh2b2lkKQoreworICAgIGhkd19pbmZvX3QgKmhpOworICAgIGNpX3QgICAgICAgKmNpOworICAgIHN0cnVjdCBuZXRfZGV2aWNlICpuZGV2OworICAgIGludCAgICAgICAgIGksIGosIGs7CisKKyAgICBmb3IgKGkgPSAwLCBoaSA9IGhkd19pbmZvOyBpIDwgTUFYX0JPQVJEUzsgaSsrLCBoaSsrKQorICAgIHsKKyAgICAgICAgaWYgKGhpLT5uZGV2KSAgICAgICAgICAgICAgIC8qIGEgYm9hcmQgaGFzIGJlZW4gYXR0YWNoZWQgKi8KKyAgICAgICAgeworICAgICAgICAgICAgY2kgPSAoY2lfdCAqKShuZXRkZXZfcHJpdihoaS0+bmRldikpOworICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IGNpLT5tYXhfcG9ydDsgaisrKQorICAgICAgICAgICAgICAgIGZvciAoayA9IDA7IGsgPCBNVVNZQ0NfTkNIQU5TOyBrKyspCisgICAgICAgICAgICAgICAgICAgIGlmICgobmRldiA9IGNpLT5wb3J0W2pdLmNoYW5ba10tPnVzZXIpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBkb19kZWx1c2VyIChuZGV2LCAwKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorfQorCisKK1NUQVRJQyB2b2lkIF9fZXhpdAorYzRfbW9kX3JlbW92ZSAodm9pZCkKK3sKKyAgICBjbGVhbnVwX2hkbGMgKCk7ICAgICAgICAgICAgLyogZGVsZXRlIGFueSBtaXNzZWQgY2hhbm5lbHMgKi8KKyAgICBjbGVhbnVwX2RldnMgKCk7CisgICAgYzRfY2xlYW51cCAoKTsKKyAgICBjbGVhbnVwX2lvcmVtYXAgKCk7CisgICAgcHJfaW5mbygiU0JFIC0gZHJpdmVyIHJlbW92ZWQuXG4iKTsKK30KKworbW9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F0ZTsKK2V4dGVybiBpbnQgIGxvZ19sZXZlbDsKKworZXh0ZXJuIGludCAgbWF4X21ydTsKK2V4dGVybiBpbnQgIG1heF9tdHU7CitleHRlcm4gaW50ICBtYXhfcnhkZXNjX3VzZWQ7CitleHRlcm4gaW50ICBtYXhfdHhkZXNjX3VzZWQ7CitleHRlcm4gY2lfdCAqQ0k7ICAgICAgICAgICAgICAgIC8qIGR1bW15IHBvaW50ciB0byBib2FyZCBaRVJPRSdzIGRhdGEgLSBERUJVRworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBVU0FHRSAqLworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogZm9yd2FyZCByZWZlcmVuY2VzICovCit2b2lkICAgICAgICBjNF9maWZvX2ZyZWUgKG1waV90ICosIGludCk7Cit2b2lkICAgICAgICBjNF93a19jaGFuX3Jlc3RhcnQgKG1jaF90ICopOwordm9pZCAgICAgICAgbXVzeWNjX2JoX3R4X2VvbSAobXBpX3QgKiwgaW50KTsKK2ludCAgICAgICAgIG11c3ljY19jaGFuX3VwIChjaV90ICosIGludCk7CitzdGF0dXNfdCBfX2luaXQgbXVzeWNjX2luaXQgKGNpX3QgKik7CitTVEFUSUMgdm9pZCBfX2luaXQgbXVzeWNjX2luaXRfcG9ydCAobXBpX3QgKik7Cit2b2lkICAgICAgICBtdXN5Y2NfaW50cl9iaF90YXNrbGV0IChjaV90ICopOwordm9pZCAgICAgICAgbXVzeWNjX3NlcnZfcmVxIChtcGlfdCAqLCB1X2ludDMyX3QpOwordm9pZCAgICAgICAgbXVzeWNjX3VwZGF0ZV90aW1lc2xvdHMgKG1waV90ICopOworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI2lmIDEKK1NUQVRJQyBpbnQKK211c3ljY19kdW1wX3J4YnVmZmVyX3JpbmcgKG1jaF90ICogY2gsIGludCBsb2NraXQpCit7CisgICAgc3RydWN0IG1kZXNjICptOworICAgIHVuc2lnbmVkIGxvbmcgZmxhZ3MgPSAwOworCisgICAgdV9pbnQzMl90IHN0YXR1czsKKyAgICBpbnQgICAgICAgICBuOworCisgICAgaWYgKGxvY2tpdCkKKyAgICB7CisgICAgICAgIHNwaW5fbG9ja19pcnFzYXZlICgmY2gtPmNoX3J4bG9jaywgZmxhZ3MpOworICAgIH0KKyAgICBpZiAoY2gtPnJ4ZF9udW0gPT0gMCkKKyAgICB7CisgICAgICAgIHByX2luZm8oIiAgWkVSTyByZWNlaXZlIGJ1ZmZlcnMgYWxsb2NhdGVkIGZvciB0aGlzIGNoYW5uZWwuIik7CisgICAgfSBlbHNlCisgICAgeworICAgICAgICBGTFVTSF9NRU1fUkVBRCAoKTsKKyAgICAgICAgbSA9ICZjaC0+bWRyW2NoLT5yeGl4X2lycV9zcnZdOworICAgICAgICBmb3IgKG4gPSBjaC0+cnhkX251bTsgbjsgbi0tKQorICAgICAgICB7CisgICAgICAgICAgICBzdGF0dXMgPSBsZTMyX3RvX2NwdSAobS0+c3RhdHVzKTsKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwcl9pbmZvKCIlYyAgJTA4bHhbJTJkXTogc3RzICUwOHggKCVjJWMlYyVjOiVkLikgRGF0YSBbJTA4eF0gTmV4dCBbJTA4eF1cbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAobSA9PSAmY2gtPm1kcltjaC0+cnhpeF9pcnFfc3J2XSkgPyAnRicgOiAnICcsCisgICAgICAgICAgICAgICAgICAgICAgICAodW5zaWduZWQgbG9uZykgbSwgbiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cywKKyAgICAgICAgICAgICAgICAgICAgICAgIG0tPmRhdGEgPyAoc3RhdHVzICYgSE9TVF9SWF9PV05FRCA/ICdIJyA6ICdNJykgOiAnLScsCisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgJiBQT0xMX0RJU0FCTEVEID8gJ1AnIDogJy0nLAorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzICYgRU9CSVJRX0VOQUJMRSA/ICdiJyA6ICctJywKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyAmIEVPTUlSUV9FTkFCTEUgPyAnbScgOiAnLScsCisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgJiBMRU5HVEhfTUFTSywKKyAgICAgICAgICAgICAgICAgICAgICAgIGxlMzJfdG9fY3B1IChtLT5kYXRhKSwgbGUzMl90b19jcHUgKG0tPm5leHQpKTsKKyNpZmRlZiBSTERfRFVNUF9CVUZEQVRBCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB1X2ludDMyX3QgICpkcDsKKyAgICAgICAgICAgICAgICAgICAgaW50ICAgICAgICAgbGVuID0gc3RhdHVzICYgTEVOR1RIX01BU0s7CisKKyNpZiAxCisgICAgICAgICAgICAgICAgICAgIGlmIChtLT5kYXRhICYmIChzdGF0dXMgJiBIT1NUX1JYX09XTkVEKSkKKyNlbHNlCisgICAgICAgICAgICAgICAgICAgIGlmIChtLT5kYXRhKSAgICAvKiBhbHdheXMgZHVtcCByZWdhcmRsZXNzIG9mIHZhbGlkIFJYCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBkYXRhICovCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZHAgPSAodV9pbnQzMl90ICopIE9TX3BoeXN0b3YgKCh2b2lkICopIChsZTMyX3RvX2NwdSAobS0+ZGF0YSkpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsZW4gPj0gMHgxMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcl9pbmZvKCIgICAgJXhbJXhdOiAlMDhYICUwOFggJTA4WCAlMDh4XG4iLCAodV9pbnQzMl90KSBkcCwgbGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKmRwLCAqKGRwICsgMSksICooZHAgKyAyKSwgKihkcCArIDMpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGxlbiA+PSAweDA4KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByX2luZm8oIiAgICAleFsleF06ICUwOFggJTA4WFxuIiwgKHVfaW50MzJfdCkgZHAsIGxlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICpkcCwgKihkcCArIDEpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcl9pbmZvKCIgICAgJXhbJXhdOiAlMDhYXG4iLCAodV9pbnQzMl90KSBkcCwgbGVuLCAqZHApOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorI2VuZGlmCisgICAgICAgICAgICB9CisgICAgICAgICAgICBtID0gbS0+c25leHQ7CisgICAgICAgIH0KKyAgICB9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIC1mb3ItICovCisgICAgcHJfaW5mbygiXG4iKTsKKworICAgIGlmIChsb2NraXQpCisgICAgeworICAgICAgICBzcGluX3VubG9ja19pcnFyZXN0b3JlICgmY2gtPmNoX3J4bG9jaywgZmxhZ3MpOworICAgIH0KKyAgICByZXR1cm4gMDsKK30KKyNlbmRpZgorCisjaWYgMQorU1RBVElDIGludAorbXVzeWNjX2R1bXBfdHhidWZmZXJfcmluZyAobWNoX3QgKiBjaCwgaW50IGxvY2tpdCkKK3sKKyAgICBzdHJ1Y3QgbWRlc2MgKm07CisgICAgdW5zaWduZWQgbG9uZyBmbGFncyA9IDA7CisgICAgdV9pbnQzMl90ICAgc3RhdHVzOworICAgIGludCAgICAgICAgIG47CisKKyAgICBpZiAobG9ja2l0KQorICAgIHsKKyAgICAgICAgc3Bpbl9sb2NrX2lycXNhdmUgKCZjaC0+Y2hfdHhsb2NrLCBmbGFncyk7CisgICAgfQorICAgIGlmIChjaC0+dHhkX251bSA9PSAwKQorICAgIHsKKyAgICAgICAgcHJfaW5mbygiICBaRVJPIHRyYW5zbWl0IGJ1ZmZlcnMgYWxsb2NhdGVkIGZvciB0aGlzIGNoYW5uZWwuIik7CisgICAgfSBlbHNlCisgICAgeworICAgICAgICBGTFVTSF9NRU1fUkVBRCAoKTsKKyAgICAgICAgbSA9IGNoLT50eGRfaXJxX3NydjsKKyAgICAgICAgZm9yIChuID0gY2gtPnR4ZF9udW07IG47IG4tLSkKKyAgICAgICAgeworICAgICAgICAgICAgc3RhdHVzID0gbGUzMl90b19jcHUgKG0tPnN0YXR1cyk7CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcHJfaW5mbygiJWMlYyAlMDhseFslMmRdOiBzdHMgJTA4eCAoJWMlYyVjJWM6JWQuKSBEYXRhIFslMDh4XSBOZXh0IFslMDh4XVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIChtID09IGNoLT50eGRfdXNyX2FkZCkgPyAnRicgOiAnICcsCisgICAgICAgICAgICAgICAgICAgICAgICAobSA9PSBjaC0+dHhkX2lycV9zcnYpID8gJ0wnIDogJyAnLAorICAgICAgICAgICAgICAgICAgICAgICAgKHVuc2lnbmVkIGxvbmcpIG0sIG4sCisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMsCisgICAgICAgICAgICAgICAgICAgICBtLT5kYXRhID8gKHN0YXR1cyAmIE1VU1lDQ19UWF9PV05FRCA/ICdNJyA6ICdIJykgOiAnLScsCisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgJiBQT0xMX0RJU0FCTEVEID8gJ1AnIDogJy0nLAorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzICYgRU9CSVJRX0VOQUJMRSA/ICdiJyA6ICctJywKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyAmIEVPTUlSUV9FTkFCTEUgPyAnbScgOiAnLScsCisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgJiBMRU5HVEhfTUFTSywKKyAgICAgICAgICAgICAgICAgICAgICAgIGxlMzJfdG9fY3B1IChtLT5kYXRhKSwgbGUzMl90b19jcHUgKG0tPm5leHQpKTsKKyNpZmRlZiBSTERfRFVNUF9CVUZEQVRBCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB1X2ludDMyX3QgICpkcDsKKyAgICAgICAgICAgICAgICAgICAgaW50ICAgICAgICAgbGVuID0gc3RhdHVzICYgTEVOR1RIX01BU0s7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKG0tPmRhdGEpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRwID0gKHVfaW50MzJfdCAqKSBPU19waHlzdG92ICgodm9pZCAqKSAobGUzMl90b19jcHUgKG0tPmRhdGEpKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobGVuID49IDB4MTApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJfaW5mbygiICAgICV4WyV4XTogJTA4WCAlMDhYICUwOFggJTA4eFxuIiwgKHVfaW50MzJfdCkgZHAsIGxlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICpkcCwgKihkcCArIDEpLCAqKGRwICsgMiksICooZHAgKyAzKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChsZW4gPj0gMHgwOCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcl9pbmZvKCIgICAgJXhbJXhdOiAlMDhYICUwOFhcbiIsICh1X2ludDMyX3QpIGRwLCBsZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqZHAsICooZHAgKyAxKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJfaW5mbygiICAgICV4WyV4XTogJTA4WFxuIiwgKHVfaW50MzJfdCkgZHAsIGxlbiwgKmRwKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyNlbmRpZgorICAgICAgICAgICAgfQorICAgICAgICAgICAgbSA9IG0tPnNuZXh0OworICAgICAgICB9CisgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAtZm9yLSAqLworICAgIHByX2luZm8oIlxuIik7CisKKyAgICBpZiAobG9ja2l0KQorICAgIHsKKyAgICAgICAgc3Bpbl91bmxvY2tfaXJxcmVzdG9yZSAoJmNoLT5jaF90eGxvY2ssIGZsYWdzKTsKKyAgICB9CisgICAgcmV0dXJuIDA7Cit9CisjZW5kaWYKKworCisvKgorICogVGhlIGZvbGxvd2luZyBzdXBwb3J0cyBhIGJhY2tkb29yIGRlYnVnIGZhY2lsaXR5IHdoaWNoIGNhbiBiZSB1c2VkIHRvCisgKiBkaXNwbGF5IHRoZSBzdGF0ZSBvZiBhIGJvYXJkJ3MgY2hhbm5lbC4KKyAqLworCitzdGF0dXNfdAorbXVzeWNjX2R1bXBfcmluZyAoY2lfdCAqIGNpLCB1bnNpZ25lZCBpbnQgY2hhbikKK3sKKyAgICBtY2hfdCAgICAgICpjaDsKKworICAgIGlmIChjaGFuID49IE1BWF9DSEFOU19VU0VEKQorICAgIHsKKyAgICAgICAgcmV0dXJuIFNCRV9EUlZSX0ZBSUw7ICAgICAgIC8qIEUyQklHICovCisgICAgfQorICAgIHsKKyAgICAgICAgaW50ICAgICAgICAgYmg7CisKKyAgICAgICAgYmggPSBhdG9taWNfcmVhZCAoJmNpLT5iaF9wZW5kaW5nKTsKKyAgICAgICAgcHJfaW5mbygiPj4gYmhfcGVuZCAlZCBbJWRdIGloZWFkICVkIGl0YWlsICVkIFslZF0gdGhfY250ICVkIGJoX2NudCAlZCB3ZGNudCAlZCBub3RlICVkXG4iLAorICAgICAgICAgICAgICAgIGJoLCBtYXhfYmgsIGNpLT5pcXBfaGVhZHgsIGNpLT5pcXBfdGFpbHgsIG1heF9pbnRjbnQsC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B0byB0aGUgbmV4dCB1bnByb2Nlc3NlZCBtZCAqLworCit2b2lkCittdXN5Y2NfdXBkYXRlX3R4X3RocCAobWNoX3QgKiBjaCkKK3sKKyAgICBzdHJ1Y3QgbWRlc2MgKm1kOworICAgIHVuc2lnbmVkIGxvbmcgZmxhZ3M7CisKKyAgICBzcGluX2xvY2tfaXJxc2F2ZSAoJmNoLT5jaF90eGxvY2ssIGZsYWdzKTsKKyAgICB3aGlsZSAoMSkKKyAgICB7CisgICAgICAgIG1kID0gY2gtPnR4ZF9pcnFfc3J2OworICAgICAgICBGTFVTSF9NRU1fUkVBRCAoKTsKKyAgICAgICAgaWYgKCFtZC0+ZGF0YSkKKyAgICAgICAgeworICAgICAgICAgICAgLyogTm8gTURzIHdpdGggYnVmZmVycyB0byBwcm9jZXNzICovCisgICAgICAgICAgICBzcGluX3VubG9ja19pcnFyZXN0b3JlICgmY2gtPmNoX3R4bG9jaywgZmxhZ3MpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGlmICgobGUzMl90b19jcHUgKG1kLT5zdGF0dXMpKSAmIE1VU1lDQ19UWF9PV05FRCkKKyAgICAgICAgeworICAgICAgICAgICAgLyogdGhpcyBpcyB0aGUgTUQgdG8gcmVzdGFydCBUWCB3aXRoICovCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICAvKgorICAgICAgICAgKiBPdGhlcndpc2UsIHdlIGhhdmUgYSB2YWxpZCwgaG9zdC1vd25lZCBtZXNzYWdlIGRlc2NyaXB0b3Igd2hpY2gKKyAgICAgICAgICogaGFzIGJlZW4gc3VjY2Vzc2Z1bGx5IHRyYW5zbWl0dGVkIGFuZCB3aG9zZSBidWZmZXIgY2FuIGJlIGZyZWVkLAorICAgICAgICAgKiBzby4uLiBwcm9jZXNzIHRoaXMgTUQsIGl0J3Mgb3duZWQgYnkgdGhlIGhvc3QuICAoVGhpcyBtaWdodCBnaXZlCisgICAgICAgICAqIGFzIGEgbmV3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ZworICogdXBvbiB0aGUgY2hhbm5lbCdzIGNoX3N0YXJ0X3R4IGFuZCBjaF9zdGFydF9yeCB2YXJpYWJsZXMuICBUaGlzIHJvdXRpbmUKKyAqIGlzIGltcGxlbWVudGVkIGFzIGEgd29yayBxdWV1ZSBzbyB0aGF0IHRoZSBjYWxsIHRvIHRoZSBzZXJ2aWNlIHJlcXVlc3QgaXMKKyAqIGFibGUgdG8gc2xlZXAsIGF3YWl0aW5nIGFuIGludGVycnVwdCBhY2tub3dsZWRnbWVudCByZXNwb25zZSAoU0FDSykgZnJvbQorICogdGhlIGhhcmR3YXJlLgorICovCisKK3ZvaWQKK211c3ljY193cV9jaGFuX3Jlc3RhcnQgKHZvaWQgKmFyZykgICAgICAvKiBjaGFubmVsIHByaXZhdGUgc3RydWN0dXJlICovCit7CisgICAgbWNoX3QgICAgICAqY2g7CisgICAgbXBpX3QgICAgICAqcGk7CisgICAgc3RydWN0IG1kZXNjICptZDsKKyNpZiAwCisgICAgdW5zaWduZWQgbG9uZyBmbGFnczsKKyNlbmRpZgorCisgICAgY2ggPSBjb250YWluZXJfb2YoYXJnLCBzdHJ1Y3QgYzRfY2hhbl9pbmZvLCBjaF93b3JrKTsKKyAgICBwaSA9IGNoLT51cDsKKworI2lmZGVmIFJMRF9UUkFOU19ERUJVRworICAgIHByX2luZm8oIndxX2NoYW5fcmVzdGFydFslZF06IHN0YXJ0X1JUWyVkLyVkXSBzdGF0dXMgJXhcbiIsCisgICAgICAgICAgICBjaC0+Y2hhbm51bSwgY2gtPmNoX3N0YXJ0X3J4LCBjaC0+Y2hfc3RhcnRfdHgsIGNoLT5zdGF0dXMpOworCisjZW5kaWYKKworICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworICAgIC8qKiBjaGVjayBmb3IgUlggcmVzdGFydCByZXF1ZXN0ICoqLworICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisgICAgaWYgKChjaC0+Y2hfc3RhcnRfcngpICYmIChjaC0+c3RhdHVzICYgUlhfRU5BQkxFRCkpCisgICAgeworCisgICAgICAgIGNoLT5jaF9zdGFydF9yeCA9IDA7CisjaWYgZGVmaW5lZChSTERfVFJBTlNfREVCVUcpIHx8IGRlZmluZWQoUkxEX1JYQUNUX0RFQlVHKQorICAgICAgICB7CisgICAgICAgICAgICBzdGF0aWMgaW50ICBoZXJlYjQgPSA3OworCisgICAgICAgICAgICBpZiAoaGVyZWI0KSAgICAgICAgICAgICAvKiBSTEQgREVCVUcgKi8KKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBoZXJlYjQtLTsKKyNpZmRlZiBSTERfVFJBTlNfREVCVUcKKyAgICAgICAgICAgICAgICBtZCA9ICZjaC0+bWRyW2NoLT5yeGl4X2lycV9zcnZdOworICAgICAgICAgICAgICAgIHByX2luZm8oIisrIG11c3ljY193cV9jaGFuX3Jlc3RhcnRbJWRdIENIQU4gUlggQUNUSVZBVEU6IHJ4aXhfaXJxX3NydiAlZCwgbWQgJXAgc3RzICV4LCByeHBrdCAlbHVcbiIsCisgICAgICAgICAgICAgICAgY2gtPmNoYW5udW0sIGNoLT5yeGl4X2lycV9zcnYsIG1kLCBsZTMyX3RvX2NwdSAobWQtPnN0YXR1cyksCisgICAgICAgICAgICAgICAgICAgICAgICBjaC0+cy5yeF9wYWNrZXRzKTsKKyNlbGlmIGRlZmluZWQoUkxEX1JYQUNUX0RFQlVHKQorICAgICAgICAgICAgICAgIG1kID0gJmNoLT5tZHJbY2gtPnJ4aXhfaXJxX3Nydl07CisgICAgICAgICAgICAgICAgcHJfaW5mbygiKysgbXVzeWNjX3dxX2NoYW5fcmVzdGFydFslZF0gQ0hBTiBSWCBBQ1RJVkFURTogcnhpeF9pcnFfc3J2ICVkLCBtZCAlcCBzdHMgJXgsIHJ4cGt0ICVsdVxuIiwKKyAgICAgICAgICAgICAgICBjaC0+Y2hhbm51bSwgY2gtPnJ4aXhfaXJxX3NydiwgbWQsIGxlMzJfdG9fY3B1IChtZC0+c3RhdHVzKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGNoLT5zLnJ4X3BhY2tldHMpOworICAgICAgICAgICAgICAgIG11c3ljY19kdW1wX3J4YnVmZmVyX3JpbmcgKGNoLCAxKTsgICAgICAvKiBSTEQgREVCVUcgKi8KKyNlbmRpZgorICAgICAgICAgICAgfQorICAgICAgICB9CisjZW5kaWYKKyAgICAgICAgbXVzeWNjX3NlcnZfcmVxIChwaSwgU1JfQ0hBTk5FTF9BQ1RJVkFURSB8IFNSX1JYX0RJUkVDVElPTiB8IGNoLT5nY2hhbik7CisgICAgfQorICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworICAgIC8qKiBjaGVjayBmb3IgVFggcmVzdGFydCByZXF1ZXN0ICoqLworICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisgICAgaWYgKChjaC0+Y2hfc3RhcnRfdHgpICYmIChjaC0+c3RhdHVzICYgVFhfRU5BQkxFRCkpCisgICAgeworICAgICAgICAvKiBmaW5kIG5leHQgdW5wcm9jZXNzZWQgbWVzc2FnZSwgdGhlbiBzZXQgVFggdGhwIHRvIGl0ICovCisgICAgICAgIG11c3ljY191cGRhdGVfdHhfdGhwIChjaCk7CisKKyNpZiAwCisgICAgICAgIHNwaW5fbG9ja19pcnFzYXZlICgmY2gtPmNoX3R4bG9jaywgZmxhZ3MpOworI2VuZGlmCisgICAgICAgIG1kID0gY2gtPnR4ZF9pcnFfc3J2OworICAgICAgICBpZiAoIW1kKQorICAgICAgICB7CisjaWZkZWYgUkxEX1RSQU5TX0RFQlVHCisgICAgICAgICAgICBwcl9pbmZvKCItLSBtdXN5Y2Nfd3FfY2hhbl9yZXN0YXJ0WyVkXTogV0FSTklORywgc3RhcnRpbmcgTlVMTCBtZFxuIiwgY2gtPmNoYW5udW0pOworI2VuZGlmCisjaWYgMAorICAgICAgICAgICAgc3Bpbl91bmxvY2tfaXJxcmVzdG9yZSAoJmN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NjdXJyZW5jZSBvZiBhIFRyYW5zcGFyZW50IG1vZGUgVFggT05SIG9yIGEKKyAgICAgICAgICogQlVGRiBlcnJvci4gIElmIHRoZSBwcmV2aW91cyBjb21tYW5kIHdhcyBhIENIQU5ORUwgQUNUSVZBVEUsCisgICAgICAgICAqIHByZWNlZGUgaXQgd2l0aCBhIE5PT1AgY29tbWFuZCBpbiBvcmRlciBtYWludGFpbiBjb2hlcmVudCBjb250cm9sCisgICAgICAgICAqIG9mIHRoaXMgY3VycmVudCAocmUpQUNUSVZBVEUuCisgICAgICAgICAqLworCisgICAgICAgIHIgPSAocGktPnNyX2xhc3QgJiB+U1JfR0NIQU5ORUxfTUFTSyk7CisgICAgICAgIGlmICgociA9PSAoU1JfQ0hBTk5FTF9BQ1RJVkFURSB8IFNSX1RYX0RJUkVDVElPTikpIHx8CisgICAgICAgICAgICAociA9PSAoU1JfQ0hBTk5FTF9BQ1RJVkFURSB8IFNSX1JYX0RJUkVDVElPTikpKQorICAgICAgICB7CisjaWZkZWYgUkxEX1RSQU5TX0RFQlVHCisgICAgICAgICAgICBwcl9pbmZvKCI+PiBzYW1lIENIQU4gQUNUIFNSLCBQb3J0ICVkIFJlcSAleCA9PiBpc3N1ZSBTUl9OT09QIENNRFxuIiwgcGktPnBvcnRudW0sIHJlcSk7CisjZW5kaWYKKyAgICAgICAgICAgIFNEX1NFTV9HSVZFICgmcGktPnNyX3NlbV9idXN5KTsgICAgIC8qIGFsbG93IHRoaXMgbmV4dCByZXF1ZXN0ICovCisgICAgICAgICAgICBtdXN5Y2Nfc2Vydl9yZXEgKHBpLCBTUl9OT09QKTsKKyAgICAgICAgICAgIFNEX1NFTV9UQUtFICgmcGktPnNyX3NlbV9idXN5LCAic2VydiIpOyAgICAgLyogcmVsb2NrICYgY29udGludWUgdy8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogb3JpZ2luYWwgcmVxICovCisgICAgICAgIH0gZWxz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3aGljaCByZWFkcyBmcm9tCisgICAgICogdGhlIHNhbWUgYWRkcmVzcy4iCisgICAgICovCisgICAgciA9IHBjaV9yZWFkXzMyICgodV9pbnQzMl90ICopICZwaS0+cmVnLT5zcmQpOyAgICAgIC8qIGFkaGVyZSB0byB3cml0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiB0aW1pbmcgaW1wb3NpdGlvbiAqLworCisKKyAgICBpZiAoKHIgIT0gcmVxKSAmJiAocmVxICE9IFNSX0NISVBfUkVTRVQpICYmICgrK3JjbnQgPD0gTVVTWUNDX1NSX1JFVFJZX0NOVCkpCisgICAgeworICAgICAgICBpZiAobG9nX2xldmVsID49IExPR19NT05JVE9SKQorICAgICAgICAgICAgcHJfaW5mbygiJXM6ICVkIC0gcmVpc3N1ZSBzcnYgcmVxL2xhc3QgJXgvJXggKGhkdyByZWFkcyAleCksIENoYW4gJWQuXG4iLAorICAgICAgICAgICAgICAgICAgICBwaS0+dXAtPmRldm5hbWUsIHJjbnQsIHJlcSwgcGktPnNyX2xhc3QsIHIsCisgICAgICAgICAgICAgICAgICAgIChwaS0+cG9ydG51bSAqIE1VU1lDQ19OQ0hBTlMpICsgKHJlcSAmIDB4MWYpKTsKKyAgICAgICAgT1NfdXdhaXRfZHVtbXkgKCk7ICAgICAgICAgIC8qIHRoaXMgZGVsYXkgaGVscHMgcmVkdWNlIHJlaXNzdWUgY291bnRzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiAocmVhc29uIG5vdCB5ZXQgcmVzZWFyY2hlZCkgKi8KKyAgICAgICAgZ290byByZXdyaXRlOworICAgIH0KKyAgICBpZiAocmNudCA+IE1VU1lDQ19TUl9SRVRSWV9DTlQpCisgICAgeworICAgICAgICBwcl93YXJuaW5nKCIlczogZmFpbGVkIHNlcnZpY2UgcmVxdWVzdCAoIyVkKT0gJXgsIGdyb3VwICVkLlxuIiwKKyAgICAgICAgICAgICAgICAgICBwaS0+dXAtPmRldm5hbWUsIE1VU1lDQ19TUl9SRVRSWV9DTlQsIHJlcSwgcGktPnBvcnRudW0pOworICAgICAgICBTRF9TRU1fR0lWRSAoJnBpLT5zcl9zZW1fYnVzeSk7IC8qIGFsbG93IGFueSBuZXh0IHJlcXVlc3QgKi8KKyAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICBpZiAocmVxID09IFNSX0NISVBfUkVTRVQpCisgICAgeworICAgICAgICAvKgorICAgICAgICAgKiBQT1JUIE5PVEU6IHRoZSBDSElQX1JFU0VUIGNvbW1hbmQgaXMgTk9UIGFjaydkIGJ5IHRoZSBNVVNZQ0MsIHRodXMKKyAgICAgICAgICogdGhlIHVwY29taW5nIGRlbGF5IGlzIHVzZWQuICBUaG91Z2ggdGhlIE1VU1lDQyBkb2N1bWVudGF0aW9uCisgICAgICAgICAqIHN1Z2dlc3RzIGEgcmVhZC1hZnRlci13cml0ZSB3b3VsZCBzdXBwbHkgdGhlIHJlcXVpcmVkIGRlbGF5LCBpdCdzCisgICAgICAgICAqIHVuY2xlYXIgd2hhdCBDUFUvQlVTIGNsb2NrIHNwZWVkcyBtaWdodCBoYXZlIGJlZW4gYXNzdW1lZCB3aGVuCisgICAgICAgICAqIHN1Z2dlc3RpbmcgdGhpcyAnbGFjayBvZiBBQ0snIHdvcmthcm91bmQuICBUaHVzIHRoZSB1c2Ugb2YgdXdhaXQuCisgICAgICAgICAqLworICAgICAgICBPU191d2FpdCAoMTAwMDAwLCAiaWNhcmQiKTsgLyogMTAwbXMgKi8KKyAgICB9IGVsc2UKKyAgICB7CisgICAgICAgIEZMVVNIX01FTV9SRUFEICgpOworICAgICAgICBTRF9TRU1fVEFLRSAoJnBpLT5zcl9zZW1fd2FpdCwgInNha2FjayIpOyAgICAgICAvKiBzbGVlcCB1bnRpbCBTQUNLCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGludGVycnVwdCBvY2N1cnMgKi8KKyAgICB9CisgICAgU0RfU0VNX0dJVkUgKCZwaS0+c3Jfc2VtX2J1c3kpOyAvKiBhbGxvdyBhbnkgbmV4dCByZXF1ZXN0ICovCit9CisKKworI2lmZGVmICBTQkVfUE1DQzRfRU5BQkxFCit2b2lkCittdXN5Y2NfdXBkYXRlX3RpbWVzbG90cyAobXBpX3QgKiBwaSkKK3sKKyAgICBpbnQgICAgICAgICBpLCBjaDsKKyAgICBjaGFyICAgICAgICBlMW1vZGUgPSBJU19GUkFNRV9BTllfRTEgKHBpLT5wLnBvcnRfbW9kZSk7CisKKyAgICBmb3IgKGkgPSAwOyBpIDwgMzI7IGkrKykKKyAgICB7CisgICAgICAgIGludCAgICAgICAgIHVzZWRieSA9IDAsIGxhc3QgPSAwLCB0cywgaiwgYml0c1s4XTsKKworICAgICAgICB1X2ludDhfdCBsYXN0dmFsID0gMDsKKworICAgICAgICBpZiAoKChpID09IDApICYmIGUxbW9kZSkgfHwgLyogZGlzYWJsZSBpZiAgRTEgbW9kZSAqLworICAgICAgICAgICAgKChpID09IDE2KSAmJiAoKHBpLT5wLnBvcnRfbW9kZSA9PSBDRkdfRlJBTUVfRTFDUkNfQ0FTKSB8fCAocGktPnAucG9ydF9tb2RlID09IENGR19GUkFNRV9FMUNSQ19DQVNfQU1JKSkpCisgICAgICAgICAgICB8fCAoKGkgPiAyMykgJiYgKCFlMW1vZGUpKSkgLyogZGlzYWJsZSBpZiBUMSBtb2RlICovCisgICAgICAgIHsKKyAgICAgICAgICAgIHBpLT50c21baV0gPSAweGZmOyAgICAgIC8qIG1ha2UgdHNsb3QgdW5hdmFpbGFibGUgZm9yIHRoaXMgbW9kZSAqLworICAgICAgICB9IGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgcGktPnRzbVtpXSA9IDB4MDA7ICAgICAgLyogbWFrZSB0c2xvdCBhdmFpbGFibGUgZm9yIGFzc2lnbm1lbnQgKi8KKyAgICAgICAgfQorICAgICAgICBmb3IgKGogPSAwOyBqIDwgODsgaisrKQorICAgICAgICAgICAgYml0c1tqXSA9IC0xOworICAgICAgICBmb3IgKGNoID0gMDsgY2ggPCBNVVNZQ0NfTkNIQU5TOyBjaCsrKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoKHBpLT5jaGFuW2NoXS0+c3RhdGUgPT0gVVApICYmIChwaS0+Y2hhbltjaF0tPnAuYml0bWFza1tpXSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdXNlZGJ5Kys7CisgICAgICAgICAgICAgICAgbGFzdCA9IGNoOworICAgICAgICAgICAgICAgIGxhc3R2YWwgPSBwaS0+Y2hhbltjaF0tPnAuYml0bWFza1tpXTsKKyAgICAgICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgODsgaisrKQorICAgICAgICAgICAgICAgICAgICBpZiAobGFzdHZhbCAmICgxIDw8IGopKQorICAgICAgICAgICAgICAgICAgICAgICAgYml0c1tqXSA9IGNoOworICAgICAgICAgICAgICAgIHBpLT50c21baV0gfD0gbGFzdHZhbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAoIXVzZWRieSkKKyAgICAgICAgICAgIHRzID0gMDsKKyAgICAgICAgZWxzZSBpZiAoKHVzZWRieSA9PSAxKSAmJiAobGFzdHZhbCA9PSAweGZmKSkKKyAgICAgICAgICAgIHRzID0gKDQgPDwgNSkgfCBsYXN0OworICAgICAgICBlbHNlIGlmICgodXNlZGJ5ID09IDEpICYmIChsYXN0dmFsID09IDB4N2YpKQorICAgICAgICAgICAgdHMgPSAoNSA8PCA1KSB8IGxhc3Q7CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgaW50ICAgICAgICAgaWR4OworCisgICAgICAgICAgICBpZiAoYml0c1swXSA8IDApCisgICAgICAgICAgICAgICAgdHMgPSAoNiA8PCA1KSB8IChpZHggPSBsYXN0KTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB0cyA9ICg3IDw8IDU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EUKKyAgICBobWFzayA9ICgweDFmIDw8IHBpLT51cC0+cC5oeXBlcnNpemUpICYgMHgxZjsKKyNlbmRpZgorI2lmZGVmIFNCRV9XQU4yNTZUM19FTkFCTEUKKyAgICBobWFzayA9ICgweDFmIDw8IGh5cGVyZHVtbXkpICYgMHgxZjsKKyNlbmRpZgorICAgIGZvciAoaSA9IDA7IGkgPCAxMjg7IGkrKykKKyAgICB7CisgICAgICAgIGdjaGFuID0gKChwaS0+cG9ydG51bSAqIE1VU1lDQ19OQ0hBTlMpICsgKGkgJiBobWFzaykpICUgTVVTWUNDX05DSEFOUzsKKyAgICAgICAgY2ggPSBwaS0+Y2hhbltnY2hhbl07CisgICAgICAgIGlmIChjaC0+cC5tb2RlXzU2aykKKyAgICAgICAgICAgIHRzZW4gPSBNT0RFXzU2S0JQUzsKKyAgICAgICAgZWxzZQorICAgICAgICAgICAgdHNlbiA9IE1PREVfNjRLQlBTOyAgICAgLyogYWxzbyB0aGUgZGVmYXVsdCAqLworICAgICAgICB0cyA9ICgocGktPnBvcnRudW0gJSA0KSA9PSAoaSAvIDMyKSkgPyAodHNlbiA8PCA1KSB8IChpICYgaG1hc2spIDogMDsKKyAgICAgICAgcGktPnJlZ3JhbS0+cnRzbVtpXSA9IHRzOworICAgICAgICBwaS0+cmVncmFtLT50dHNtW2ldID0gdHM7CisgICAgfQorICAgIEZMVVNIX01FTV9XUklURSAoKTsKKyAgICBtdXN5Y2Nfc2Vydl9yZXEgKHBpLCBTUl9USU1FU0xPVF9NQVAgfCBTUl9SWF9ESVJFQ1RJT04pOworICAgIG11c3ljY19zZXJ2X3JlcSAocGksIFNSX1RJTUVTTE9UX01BUCB8IFNSX1RYX0RJUkVDVElPTik7Cit9CisjZW5kaWYKKworCisgLyoKKyAgKiBUaGlzIHJvdXRpbmUgY29udmVydHMgYSBnZW5lcmljIGxpYnJhcnkgY2hhbm5lbCBjb25maWd1cmF0aW9uIHBhcmFtZXRlcgorICAqIGludG8gYSBoYXJkd2FyZSBzcGVjaWZpYyByZWdpc3RlciB2YWx1ZSAoSUUuIE1VU1lDQyBDQ0QgUmVnaXN0ZXIpLgorICAqLwordV9pbnQzMl90CittdXN5Y2NfY2hhbl9wcm90byAoaW50IHByb3RvKQoreworICAgIGludCAgICAgICAgIHJlZzsKKworICAgIHN3aXRjaCAocHJvdG8pCisgICAgeworICAgIGNhc2UgQ0ZHX0NIX1BST1RPX1RSQU5TOiAgICAgICAgLyogMCAqLworICAgICAgICByZWcgPSBNVVNZQ0NfQ0NEX1RSQU5TOworICAgICAgICBicmVhazsKKyAgICBjYXNlIENGR19DSF9QUk9UT19TUzc6ICAgICAgICAgIC8qIDEgKi8KKyAgICAgICAgcmVnID0gTVVTWUNDX0NDRF9TUzc7CisgICAgICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAgY2FzZSBDRkdfQ0hfUFJPVE9fSVNMUF9NT0RFOiAgIC8qIDQgKi8KKyAgICBjYXNlIENGR19DSF9QUk9UT19IRExDX0ZDUzE2OiAgLyogMiAqLworICAgICAgICByZWcgPSBNVVNZQ0NfQ0NEX0hETENfRkNTMTY7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgQ0ZHX0NIX1BST1RPX0hETENfRkNTMzI6ICAvKiAzICovCisgICAgICAgIHJlZyA9IE1VU1lDQ19DQ0RfSERMQ19GQ1MzMjsKKyAgICAgICAgYnJlYWs7CisgICAgfQorCisgICAgcmV0dXJuIHJlZzsKK30KKworI2lmZGVmIFNCRV9XQU4yNTZUM19FTkFCTEUKK1NUQVRJQyB2b2lkIF9faW5pdAorbXVzeWNjX2luaXRfcG9ydCAobXBpX3QgKiBwaSkKK3sKKyAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJnBpLT5yZWctPmdicCwgT1NfdnRvcGh5cyAocGktPnJlZ3JhbSkpOworCisgICAgcGktPnJlZ3JhbS0+Z3JjZCA9CisgICAgICAgIF9fY29uc3RhbnRfY3B1X3RvX2xlMzIgKE1VU1lDQ19HUkNEX1JYX0VOQUJMRSB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1VU1lDQ19HUkNEX1RYX0VOQUJMRSB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1VU1lDQ19HUkNEX1NGX0FMSUdOIHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTVVTWUNDX0dSQ0RfU1VCQ0hBTl9ESVNBQkxFIHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTVVTWUNDX0dSQ0RfT09GTVBfRElTQUJMRSB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1VU1lDQ19HUkNEX0NPRkFJUlFfRElTQUJMRSB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1VU1lDQ19HUkNEX01DX0VOQUJMRSB8CisgICAgICAgICAgICAgICAgICAgICAgIChNVVNZQ0NfR1JDRF9QT0xMVEhfMzIgPDwgTVVTWUNDX0dSQ0RfUE9MTFRIX1NISUZUKSk7CisKKyAgICBwaS0+cmVncmFtLT5wY2QgPQorICAgICAgICBfX2NvbnN0YW50X2NwdV90b19sZTMyIChNVVNZQ0NfUENEX0UxWDRfTU9ERSB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1VU1lDQ19QQ0RfVFhEQVRBX1JJU0lORyB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1VU1lDQ19QQ0RfVFhfRFJJVkVOKTsKKworICAgIC8qIE1lc3NhZ2UgbGVuZ3RoIGRlc2NyaXB0b3IgKi8KKyAgICBwaS0+cmVncmFtLT5tbGQgPSBfX2NvbnN0YW50X2NwdV90b19sZTMyIChtYXhfbXJ1IHwgKG1heF9tcnUgPDwgMTYpKTsKKyAgICBGTFVTSF9NRU1fV1JJVEUgKCk7CisKKyAgICBtdXN5Y2Nfc2Vydl9yZXEgKHBpLCBTUl9HUk9VUF9JTklUIHwgU1JfUlhfRElSRUNUSU9OKTsKKyA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FVRVVFX0JPVU5EQVJZIC0gMSkgJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh+KElOVF9RVUVVRV9CT1VOREFSWSAtIDEpKSk7ICAgIC8qIHRoaXMgY2FsY3VsYXRlcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGNsb3Nlc3QgYm91bmRhcnkgKi8KKworICAgIGZvciAoaSA9IDA7IGkgPCBJTlRfUVVFVUVfU0laRTsgaSsrKQorICAgIHsKKyAgICAgICAgY2ktPmlxZF9wW2ldID0gX19jb25zdGFudF9jcHVfdG9fbGUzMiAoSU5UX0VNUFRZX0VOVFJZKTsKKyAgICB9CisKKyAgICBmb3IgKGkgPSAwOyBpIDwgY2ktPm1heF9wb3J0OyBpKyspCisgICAgeworICAgICAgICBtcGlfdCAgICAgICpwaSA9ICZjaS0+cG9ydFtpXTsKKworICAgICAgICAvKgorICAgICAgICAgKiBQZXIgTVVTWUNDIG1hbnVhbCwgU2VjdGlvbiA2LjMuMiAtICJUaGUgaG9zdCBtdXN0IGFsbG9jYXRlIGEgMktCCisgICAgICAgICAqIGJvdW5kIG1lbW9yeSBzZWdtZW50IGZvciBDaGFubmVsIEdyb3VwIDAuIgorICAgICAgICAgKi8KKworI2RlZmluZSBHUk9VUF9CT1VOREFSWSAgIDB4ODAwCisKKyAgICAgICAgcmVnYWRkciA9IE9TX2ttYWxsb2MgKHNpemVvZiAoc3RydWN0IG11c3ljY19ncm91cHIpICsgR1JPVVBfQk9VTkRBUlkpOworICAgICAgICBpZiAocmVnYWRkciA9PSAwKQorICAgICAgICB7CisgICAgICAgICAgICBmb3IgKGdjaGFuID0gMDsgZ2NoYW4gPCBpOyBnY2hhbisrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBpID0gJmNpLT5wb3J0W2djaGFuXTsKKyAgICAgICAgICAgICAgICBPU19rZnJlZSAocGktPnJlZyk7CisgICAgICAgICAgICAgICAgcGktPnJlZyA9IDA7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gRU5PTUVNOworICAgICAgICB9CisgICAgICAgIHBpLT5yZWdyYW1fc2F2ZWQgPSByZWdhZGRyOyAvKiBzYXZlIG9yaWcgdmFsdWUgZm9yIGZyZWUncyB1c2FnZSAqLworICAgICAgICBwaS0+cmVncmFtID0gKHN0cnVjdCBtdXN5Y2NfZ3JvdXByICopICgodW5zaWduZWQgbG9uZykgKHJlZ2FkZHIgKyBHUk9VUF9CT1VOREFSWSAtIDEpICYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKH4oR1JPVVBfQk9VTkRBUlkgLSAxKSkpOyAgICAgICAgLyogdGhpcyBjYWxjdWxhdGVzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGNsb3Nlc3QgYm91bmRhcnkgKi8KKyAgICB9CisKKyAgICAvKiBhbnkgYm9hcmQgY2VudHJpYyBNVVNZQ0MgY29tbWFuZHMgd2lsbCB1c2UgZ3JvdXAgWkVSTyBhcyBpdHMgImhvbWUiICovCisgICAgY2ktPnJlZ3JhbSA9IGNpLT5wb3J0WzBdLnJlZ3JhbTsKKyAgICBtdXN5Y2Nfc2Vydl9yZXEgKCZjaS0+cG9ydFswXSwgU1JfQ0hJUF9SRVNFVCk7CisKKyAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNpLT5yZWctPmdicCwgT1NfdnRvcGh5cyAoY2ktPnJlZ3JhbSkpOworICAgIHBjaV9mbHVzaF93cml0ZSAoY2kpOworI2lmZGVmIENPTkZJR19TQkVfUE1DQzRfTkNPTU0KKyAgICBjaS0+cmVncmFtLT5fX2dsY2QgPSBfX2NvbnN0YW50X2NwdV90b19sZTMyIChHQ0RfTUFHSUMpOworI2Vsc2UKKyAgICAvKiBzdGFuZGFyZCBkcml2Z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gbWFsbG9jKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGZhaWx1cmUgdy9pbiBjaGFuX3VwKCkgcm91dGluZSAqLworCisjaWYgMAorI2lmZGVmIFNCRV9JU1JfSU5MSU5FCisgICAgc3Bpbl9sb2NrX2lycSAoJmNoLT5jaF90eGxvY2spOworI2Vsc2UKKyAgICBzcGluX2xvY2tfaXJxc2F2ZSAoJmNoLT5jaF90eGxvY2ssIGZsYWdzKTsKKyNlbmRpZgorI2VuZGlmCisgICAgZG8KKyAgICB7CisgICAgICAgIEZMVVNIX01FTV9SRUFEICgpOworICAgICAgICBtZCA9IGNoLT50eGRfaXJxX3NydjsKKyAgICAgICAgc3RhdHVzID0gbGUzMl90b19jcHUgKG1kLT5zdGF0dXMpOworCisgICAgICAgIC8qCisgICAgICAgICAqIE5vdGU6IFBlciBNVVNZQ0MgUmVmIDYuNC45LCB0aGUgaG9zdCBkb2VzIG5vdCBwb2xsIGEgaG9zdC1vd25lZAorICAgICAgICAgKiBUcmFuc21pdCBCdWZmZXIgRGVzY3JpcHRvciBkdXJpbmcgVHJhbnNwYXJlbnQgTW9kZS4KKyAgICAgICAgICovCisgICAgICAgIGlmIChzdGF0dXMgJiBNVVNZQ0NfVFhfT1dORUQpCisgICAgICAgIHsKKyAgICAgICAgICAgIGludCAgICAgICAgIHJlYWRDb3VudCwgbG9vcENvdW50OworCisgICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgICAgICAgICAvKiBIVyBCdWcgRml4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAvKiAtLS0tLS0tLS0tICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAvKiBVbmRlciBjZXJ0YWluIFBDSSBCdXMgbG9hZGluZyBjb25kaXRpb25zLCB0aGUgZGF0YSAgICAgICovCisgICAgICAgICAgICAvKiBhc3NvY2lhdGVkIHdpdGggYW4gdXBkYXRlIG9mIFNoYXJlZCBNZW1vcnkgaXMgZGVsYXllZCAgICovCisgICAgICAgICAgICAvKiByZWxhdGl2ZSB0byBpdHMgUENJIEludGVycnVwdC4gIFRoaXMgaXMgY2F1Z2h0IHdoZW4gICAgICovCisgICAgICAgICAgICAvKiB0aGUgaG9zdCBkZXRlcm1pbmVzIGl0IGRvZXMgbm90IHlldCBPV04gdGhlIGRlc2NyaXB0b3IuICovCisgICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyAgICAgICAgICAgIHJlYWRDb3VudCA9IDA7CisgICAgICAgICAgICB3aGlsZSAoc3RhdHVzICYgTVVTWUNDX1RYX09XTkVEKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGZvciAobG9vcENvdW50ID0gMDsgbG9vcENvdW50IDwgMHgzMDsgbG9vcENvdW50KyspCisgICAgICAgICAgICAgICAgICAgIE9TX3V3YWl0X2R1bW15ICgpOyAgLyogdXNlIGNhbGwgdG8gYXZvaWQgb3B0aW1pemF0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogcmVtb3ZhbCBvZiBkdW1teSBkZWxheSAqLworICAgICAgICAgICAgICAgIEZMVVNIX01FTV9SRUFEICgpOworICAgICAgICAgICAgICAgIHN0YXR1cyA9IGxlMzJfdG9fY3B1IChtZC0+c3RhdHVzKTsKKyAgICAgICAgICAgICAgICBpZiAocmVhZENvdW50KysgPiA0MCkKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7ICAgICAgICAgIC8qIGRvbid0IHdhaXQgYW55IGxvbmdlciAqLworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHN0YXR1cyAmIE1VU1lDQ19UWF9PV05FRCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAobG9nX2xldmVsID49IExPR19NT05JVE9SKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcHJfaW5mbygiJXM6IFBvcnQgJWQgQ2hhbiAlMmQgLSB1bmV4cGVjdGVkIFRYIG1zZyBvd25lcnNoaXAgaW50ciAobWQgJXAgc3RzICV4KVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaS0+dXAtPmRldm5hbWUsIHBpLT5wb3J0bnVtLCBjaC0+Y2hhbm51bSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZCwgc3RhdHVzKTsKKyAgICAgICAgICAgICAgICAgICAgcHJfaW5mbygiKysgVXNlciAweCVwIElSUV9TUlYgMHglcCBVU1JfQUREIDB4JXAgUVN0b3BwZWQgJXgsIHN0YXJ0X3R4ICV4IHR4X2Z1bGwgJWQgdHhkX2ZyZWUgJWQgbW9kZSAleFxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaC0+dXNlciwgY2gtPnR4ZF9pcnFfc3J2LCBjaC0+dHhkX3Vzcl9hZGQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2RfcXVldWVfc3RvcHBlZCAoY2gtPnVzZXIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoLT5jaF9zdGFydF90eCwgY2gtPnR4X2Z1bGwsIGNoLT50eGRfZnJlZSwgY2gtPnAuY2hhbl9tb2RlKTsKKyAgICAgICAgICAgICAgICAgICAgbXVzeWNjX2R1bXBfdHhidWZmZXJfcmluZyAoY2gsIDApOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsgICAgICAgICAgICAgIC8qIE5vdCBvdXIgbWRlc2MsIGRvbmUgKi8KKyAgICAgICAgICAgIH0gZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChsb2dfbGV2ZWwgPj0gTE9HX01PTklUT1IpCisgICAgICAgICAgICAgICAgICAgIHByX2luZm8oIiVzOiBQb3J0ICVkIENoYW4gJTJkIC0gcmVjb3ZlcmVkIFRYIG1zZyBvd25lcnNoaXAgWyVkXSAobWQgJXAgc3RzICV4KVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaS0+dXAtPmRldm5hbWUsIHBpLT5wb3J0bnVtLCBjaC0+Y2hhbm51bSwgcmVhZENvdW50LCBtZCwgc3RhdHVzKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBjaC0+dHhkX2lycV9zcnYgPSBtZC0+c25leHQ7CisKKyAgICAgICAgbWQtPmRhdGEgPSAwOworICAgICAgICBpZiAobWQtPm1lbV90b2tlbiAhPSAwKQorICAgICAgICB7CisgICAgICAgICAgICAvKiB1cGNvdW50IGNoYW5uZWwgKi8KKyAgICAgICAgICAgIGF0b21pY19zdWIgKE9TX21lbV90b2tlbl90bGVuIChtZC0+bWVtX3Rva2VuKSwgJmNoLT50eF9wZW5kaW5nKTsKKyAgICAgICAgICAgIC8qIHVwY291bnQgY2FyZCAqLworICAgICAgICAgICAgYXRvbWljX3N1YiAoT1NfbWVtX3Rva2VuX3RsZW4gKG1kLT5tZW1fdG9rZW4pLCAmcGktPnVwLT50eF9wZW5kaW5nKTsKKyNpZmRlZiBTQkVfV0FOMjU2VDNfRU5BQkxFCisgICAgICAgICAgICBpZiAoIWF0b21pY19yZWFkICgmcGktPnVwLT50eF9wZW5kaW5nKSkKKyAgICAgICAgICAgICAgICB3YW4yNTZ0M19sZWQgKHBpLT51cCwgTEVEX1RYLCAwKTsKKyNlbmRpZgorCisjaWZkZWYgQ09ORklHX1NCRV9XQU4yNTZUM19OQ09NTQorICAgICAgICAgICAgLyogY2FsbGJhY2sgdGhhdCBvdXIgcGFja2V0IHdhcyBzZW50ICovCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaW50ICAgICAgICAgaGRsY251bSA9IChwaS0+cG9ydG51bSAqIDMyICsgZ2NoYW4pOworCisgICAgICAgICAgICAgICAgaWYgKGhkbGNudW0gPj0gMjI4KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG5jaVByb2Nlc3NfVFhfY29tcGxldGUpCisgICAgICAgICAgICAgICAgICAgICAgICAoKm5jaVByb2Nlc3NfVFhfY29tcGxldGUpIChoZGxjbnVtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0dXNlcmJ5Y2hhbiAoZ2NoYW4pKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisjZW5kaWYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKioqIENPTkZJR19TQkVfV0FOMjU2VDNfTkNPTU0gKioqLworCisgICAgICAgICAgICBPU19tZW1fdG9rZW5fZnJlZV9pcnEgKG1kLT5tZW1fdG9rZW4pOworICAgICAgICAgICAgbWQtPm1lbV90b2tlbiA9IDA7CisgICAgICAgIH0KKyAgICAgICAgbWQtPnN0YXR1cyA9IDA7CisjaWZkZWYgUkxEX1RYRlVMTF9ERUJVRworICAgICAgICBpZiAobG9nX2xldmVsID49IExPR19NT05JVE9SMikKKyAgICAgICAgICAgIHByX2luZm8oIn5+IHR4X2VvbTogdHhfZnVsbCAleCAgdHhkX2ZyZWUgJWQgLT4gJWRcbiIsCisgICAgICAgICAgICAgICAgICAgIGNoLT50eF9mdWxsLCBjaC0+dHhkX2ZyZWUsIGNoLT50eGRfZnJlZSArIDEpOworI2VuZGlmCisgICAgICAgICsrY2gtPnR4ZF9mcmVlOworICAgICAgICBGTFVTSF9NRU1fV1JJVEUgKCk7CisKKyAgICAgICAgaWYgKChjaC0+cC5jaGFuX21vZGUgIT0gQ0ZHX0NIX1BST1RPX1RSQU5TKSAmJiAoc3RhdHVzICYgRU9CSVJRX0VOQUJMRSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChsb2dfbGV2ZWwgPj0gTE9HX01PTklUT1IpCisgICAgICAgICAgICAgICAgcHJfaW5mb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uLCBvbmx5IHJlbGVhdmUgdGFzayBzdG9wcGFnZSBpZiB3ZSBhY3R1YWxseSBoYXZlIGVub3VnaAorICAgICAgICAgKiBidWZmZXJzIHRvIHNlcnZpY2UgdGhlIGxhc3QgcmVxdWVzdGVkIHBhY2tldC4gIEl0IG1heSByZXF1aXJlIE1PUkUKKyAgICAgICAgICogdGhhbiBoYWxmIHRoZSBhdmFpbGFibGUhCisgICAgICAgICAqLworICAgICAgICBpZiAoY2gtPnR4ZF9mcmVlID49IGNoLT50eGRfcmVxdWlyZWQpCisgICAgICAgIHsKKworI2lmZGVmIFJMRF9UWEZVTExfREVCVUcKKyAgICAgICAgICAgIGlmIChsb2dfbGV2ZWwgPj0gTE9HX01PTklUT1IyKQorICAgICAgICAgICAgICAgIHByX2luZm8oInR4X2VvbVslZF06IGVuYWJsZSB4bWl0IHR4X2Z1bGwgbm8gbW9yZSwgdHhkX2ZyZWUgJWQgdHhkX251bS8yICVkXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgY2gtPmNoYW5udW0sCisgICAgICAgICAgICAgICAgICAgICAgICBjaC0+dHhkX2ZyZWUsIGNoLT50eGRfbnVtIC8gMik7CisjZW5kaWYKKyAgICAgICAgICAgIGNoLT50eF9mdWxsID0gMDsKKyAgICAgICAgICAgIGNoLT50eGRfcmVxdWlyZWQgPSAwOworICAgICAgICAgICAgc2RfZW5hYmxlX3htaXQgKGNoLT51c2VyKTsgIC8qIHJlLWVuYWJsZSB0byBjYXRjaCBmbG93IGNvbnRyb2xsZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBjaGFubmVsICovCisgICAgICAgIH0KKyAgICB9CisjaWZkZWYgUkxEX1RYRlVMTF9ERUJVRworICAgIGVsc2UgaWYgKGNoLT50eF9mdWxsKQorICAgIHsKKyAgICAgICAgaWYgKGxvZ19sZXZlbCA+PSBMT0dfTU9OSVRPUjIpCisgICAgICAgICAgICBwcl9pbmZvKCJ0eF9lb21bJWRdOiBieXBhc3MgVFggZW5hYmxlIHRob3VnaCByb29tIGF2YWlsYWJsZT8gKHR4ZF9mcmVlICVkIHR4ZF9udW0vMiAlZClcbiIsCisgICAgICAgICAgICAgICAgICAgIGNoLT5jaGFubnVtLAorICAgICAgICAgICAgICAgICAgICBjaC0+dHhkX2ZyZWUsIGNoLT50eGRfbnVtIC8gMik7CisgICAgfQorI2VuZGlmCisKKyAgICBGTFVTSF9NRU1fV1JJVEUgKCk7CisjaWYgMAorI2lmZGVmIFNCRV9JU1JfSU5MSU5FCisgICAgc3Bpbl91bmxvY2tfaXJxICgmY2gtPmNoX3R4bG9jayk7CisjZWxzZQorICAgIHNwaW5fdW5sb2NrX2lycXJlc3RvcmUgKCZjaC0+Y2hfdHhsb2NrLCBmbGFncyk7CisjZW5kaWYKKyNlbmRpZgorfQorCisKK1NUQVRJQyB2b2lkCittdXN5Y2NfYmhfcnhfZW9tIChtcGlfdCAqIHBpLCBpbnQgZ2NoYW4pCit7CisgICAgbWNoX3QgICAgICAqY2g7CisgICAgdm9pZCAgICAgICAqbSwgKm0yOworICAgIHN0cnVjdCBtZGVzYyAqbWQ7CisgICAgdm9sYXRpbGUgdV9pbnQzMl90IHN0YXR1czsKKyAgICB1X2ludDMyX3QgICBlcnJvcjsKKworICAgIGNoID0gcGktPmNoYW5bZ2NoYW5dOworICAgIGlmIChjaCA9PSAwIHx8IGNoLT5zdGF0ZSAhPSBVUCkKKyAgICB7CisgICAgICAgIGlmIChsb2dfbGV2ZWwgPiBMT0dfRVJST1IpCisgICAgICAgICAgICBwcl9pbmZvKCIlczogaW50cjogcmVjZWl2ZSBFT00gb24gdW5pbml0aWFsaXplZCBjaGFubmVsICVkXG4iLAorICAgICAgICAgICAgICAgICAgICBwaS0+dXAtPmRldm5hbWUsIGdjaGFuKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICBpZiAoY2gtPm1kciA9PSAwKQorICAgICAgICByZXR1cm47ICAgICAgICAgICAgICAgICAgICAgLyogY2FuIHRoaXMgaGFwcGVuID8gKi8KKworICAgIGZvciAoOzspCisgICAgeworICAgICAgICBGTFVTSF9NRU1fUkVBRCAoKTsKKyAgICAgICAgbWQgPSAmY2gtPm1kcltjaC0+cnhpeF9pcnFfc3J2XTsKKyAgICAgICAgc3RhdHVzID0gbGUzMl90b19jcHUgKG1kLT5zdGF0dXMpOworICAgICAgICBpZiAoIShzdGF0dXMgJiBIT1NUX1JYX09XTkVEKSkKKyAgICAgICAgICAgIGJyZWFrOyAgICAgICAgICAgICAgICAgIC8qIE5vdCBvdXIgbWRlc2MsIGRvbmUgKi8KKyAgICAgICAgbSA9IG1kLT5tZW1fdG9rZW47CisgICAgICAgIGVycm9yID0gKHN0YXR1cyA+PiAxNikgJiAweGY7CisgICAgICAgIGlmIChlcnJvciA9PSAwKQorICAgICAgICB7CisjaWZkZWYgQ09ORklHX1NCRV9XQU4yNTZUM19OQ09NTQorICAgICAgICAgICAgaW50ICAgICAgICAgaGRsY251bSA9IChwaS0+cG9ydG51bSAqIDMyICsgZ2NoYW4pOworCisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogaWYgdGhlIHBhY2tldCBudW1iZXIgYmVsb25ncyB0byBOQ09NTSwgdGhlbiBzZW5kIGl0IHRvIHRoZSBUTVMKKyAgICAgICAgICAgICAqIGRyaXZlcgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBpZiAoaGRsY251bSA+PSAyMjgpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKG5jaVByb2Nlc3NfUlhfcGFja2V0KQorICAgICAgICAgICAgICAgICAgICAoKm5jaVByb2Nlc3NfUlhfcGFja2V0KSAoaGRsY251bSwgc3RhdHVzICYgMHgzZmZmLCBtLCBjaC0+dXNlcik7CisgICAgICAgICAgICB9IGVsc2UKKyNlbmRpZiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qKiogQ09ORklHX1NCRV9XQU4yNTZUM19OQ09NTSAqKiovCisKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoKG0yID0gT1NfbWVtX3Rva2VuX2FsbG9jIChtYXhfbXJ1KSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvKiBzdWJzdGl0dXRlIHRoZSBtYnVmK2NsdXN0ZXIgKi8KKyAgICAgICAgICAgICAgICAgICAgbWQtPm1lbV90b2tlbiA9IG0yOworICAgICAgICAgICAgICAgICAgICBtZC0+ZGF0YSA9IGNwdV90b19sZTMyIChPU192dG9waHlzIChPU19tZW1fdG9rZW5fZGF0YSAobTIpKSk7CisKKyAgICAgICAgICAgICAgICAgICAgLyogcGFzcyB0aGUgcmVjZWl2ZWQgbWJ1ZiB1cHdhcmQgKi8KKyAgICAgICAgICAgICAgICAgICAgc2RfcmVjdl9jb25zdW1lIChtLCBzdGF0dXMgJiBMRU5HVEhfTUFTSywgY2gtPnVzZXIpOworICAgICAgICAgICAgICAgICAgICBjaC0+cy5yeF9wYWNrZXRzKys7CisgICAgICAgICAgICAgICAgICAgIGNoLT5zLnJ4X2J5dGVzICs9IHN0YXR1cyAmIExFTkdUSF9NQVNLOworICAgICAgICAgICAgICAgIH0gZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgY2gtPnMucnhfZHJvcHBlZCsrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSBFUlJfRkNTKQorICAgICAgICB7CisgICAgICAgICAgICBjaC0+cy5yeF9jcmNfZXJyb3JzKys7CisgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IgPT0gRVJSX0FMSUdOKQorICAgICAgICB7CisgICAgICAgICAgICBjaC0+cy5yeF9taXNzZWRfZXJyb3JzKys7CisgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IgPT0gRVJSX0FCVCkKKyAgICAgICAgeworICAgICAgICAgICAgY2gtPnMucnhfbWlzc2VkX2Vycm9ycysrOworICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IEVSUl9MTkcpCisgICAgICAgIHsKKyAgICAgICAgICAgIGNoLT5zLnJ4X2xlbmd0aF9lcnJvcnMrKzsKKyAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSBFUlJfU0hUKQorICAgICAgICB7CisgICAgICAgICAgICBjaC0+cy5yeF9sZW5ndGhfZXJyb3JzKys7CisgICAgICAgIH0KKyAgICAgICAgRkxVU0hfTUVNX1dSSVRFICgpOworICAgICAgICBzdGF0dXMgPSBtYXhfbXJ1OworICAgICAgICBpZiAoY2gtPnAuY2hhbl9tb2RlID09IENGR19DSF9QUk9UT19UUkFOUykKKyAgICAgICAgICAgIHN0YXR1cyB8PSBFT0JJUlFfRU5BQkxFOworICAgICAgICBtZC0+c3RhdHVzID0gY3B1X3RvX2xlMzIgKHN0YXR1cyk7CisKKyAgICAgICAgLyogQ2hlY2sgbmV4dCBtZGVzYyBpbiB0aGUgcmluZyAqLworICAgICAgICBpZiAoKytjaC0+cnhpeF9pcnFfc3J2ID49IGNoLT5yeGRfbnVtKQorICAgICAgICAgICAgY2gtPnJ4aXhfaXJxX3NydiA9IDA7CisgICAgICAgIEZMVVNIX01FTV9XUklURSAoKTsKKyAgICB9Cit9CisKKworaXJxcmV0dXJuX3QKK211c3ljY19pbnRyX3RoX2hhbmRsZXIgKHZvaWQgKmRldnApCit7CisgICAgY2lfdCAgICAgICAqY2kgPSAoY2lfdCAqKSBkZXZwOworICAgIHZvbGF0aWxlIHVfaW50MzJfdCBzdGF0dXMsIGN1cnJJbnQgPSAwOworICAgIHVfaW50MzJfdCAgIG5leHRJbnQsIGludENudDsKKworICAgIC8qCisgICAgICogSGFyZHdhcmUgbm90IGF2YWlsYWJsZSwgcG90ZW50aWFsIGludGVycnVwdCBoYW5nLiAgQnV0IHNpbmNlIGludGVycnVwdAorICAgICAqIG1pZ2h0IGJlIHNoYXJlZCwganVzdCByZXR1cm4uCisgICAgICovCisgICAgaWYgKGNpLT5zdGF0ZSA9PSBDX0lOSVQpCisgICAgeworICAgICAgICByZXR1cm4gSVJRX05PTkU7CisgICAgfQorICAgIC8qCisgICAgICogTWFya2VkIGFzIGhhcmR3YXJlIGF2YWlsYWJsZS4gRG9uJ3Qgc2VydmljZSBpbnRlcnJ1cHRzLCBqdXN0IGNsZWFyIHRoZQorICAgICAqIGV2ZW50LgorICAgICAqLworCisgICAgaWYgKGNpLT5zdGF0ZSA9PSBDX0lETEUpCisgICAgeworICAgICAgICBzdGF0dXMgPSBwY2lfcmVhZF8zMiAoKHVfaW50MzJfdCAqKSAmY2ktPnJlZy0+aXNkKTsKKworICAgICAgICAvKiBjbGVhciB0aGUgaW50ZXJydXB0IGJ1dCBwcm9jZXNzIG5vdGhpbmcgZWxzZSAqLworICAgICAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNpLT5yZWctPmlzZCwgc3RhdHVzKTsKKyAgICAgICAgcmV0dXJuIElSUV9IQU5ETEVEOworICAgIH0KKyAgICBGTFVTSF9QQ0lfUkVBRCAoKTsKKyAgICBGTFVTSF9NRU1fUkVBRCAoKTsKKworICAgIHN0YXR1cyA9IHBjaV9yZWFkXzMyICgodV9pbnQzMl90ICopICZjaS0+cmVnLT5pc2QpOworICAgIG5leHRJbnQgPSBJTlRSUFRTX05FWFRJTlQgKHN0YXR1cyk7CisgICAgaW50Q250ID0gSU5UUlBUU19JTlRDTlQgKHN0YXR1cyk7CisgICAgY2ktPmludGxvZy5kcnZyX2ludHJfdGhjb3VudCsrOworCisgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyAgICAvKiBIVyBCdWcgRml4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgIC8qIC0tLS0tLS0tLS0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgLyogVW5kZXIgY2VydGFpbiBQQ0kgQnVzIGxvYWRpbmcgY29uZGl0aW9ucywgdGhlICAgICAgICAgKi8KKyAgICAvKiBNVVNZQ0MgbG9vc2VzIHRoZSBkYXRhIGFzc29jaWF0ZWQgd2l0aCBhbiB1cGRhdGUgICAgICAqLworICAgIC8qIG9mIGl0cyBJU0QgYW5kIGVycm9uZW91c2x5IHJldHVybnMgdGhlIGltbWVkaWF0ZWx5ICAgICovCisgICAgLyogcHJlY2VkaW5nICduZXh0SW50JyB2YWx1ZS4gIEhvd2V2ZXIsIHRoZSAnaW50Q250JyAgICAgKi8KKyAgICAvKiB2YWx1ZSBhcHBlYXJzIHRvIGJlIGNvcnJlY3QuICBCeSBub3Qgc3RhcnRpbmcgc2VydmljZSAqLworICAgIC8qIHdoZXJlIHRoZSAnbWlzc2luZycgJ25leHRJbnQnIFNIT1VMRCBwb2ludCBjYXVzZXMgICAgICovCisgICAgLyogdGhlIElRRCBub3QgdG8gYmUgc2VydmljZWQgLSB0aGUgJ25vdCBzZXJ2aWNlZCcgICAgICAgKi8KKyAgICAvKiBlbnRyaWVzIHRoZW4gcmVtYWluIGFuZCBjb250aW51ZSB0byBpbmNyZWFzZSBhcyBtb3JlICAqLworICAgIC8qIGluY29ycmVjdCBJU0QncyBhcmUgZW5jb3VudGVyZWQuICAgICAgICAgICAgICAgICAgICAgICovCisgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworICAgIGlmIChuZXh0SW50ICE9IElOVFJQVFNfTkVYVElOVCAoY2ktPmludGxvZy50aGlzX3N0YXR1c19uZXcpKQorICAgIHsKKyAgICAgICAgaWYgKGxvZ19sZXZlbCA+PSBMT0dfTU9OSVRPUikKKyAgICAgICAgeworICAgICAgICAgICAgcHJfaW5mbygiJXM6IG5vdGUgLSB1cGRhdGVkIElTRCBmcm9tICUwOHggdG8gJTA4eFxuIiwKKyAgICAgICAgICAgICAgICAgICAgY2ktPmRldm5hbWUsIHN0YXR1cywKKyAgICAgICAgICAgICAgKHN0YXR1cyAmICh+SU5UUlBUU19ORVhUSU5UX00pKSB8IGNpLT5pbnRsb2cudGhpc19zdGF0dXNfbmV3KTsKKyAgICAgICAgfQorICAgICAgICAvKgorICAgICAgICAgKiBSZXBsYWNlIGJvZ3VzIHN0YXR1cyB3aXRoIHNvZnR3YXJlIGNvcnJlY3RlZCB2YWx1ZS4KKyAgICAgICAgICoKKyAgICAgICAgICogSXQncyBub3Qga25vd24gd2hldGhlciwgZHVyaW5nIHRoaXMgcHJvYmxlbSBvY2N1cnJlbmNlLCBpZiB0aGUKKyAgICAgICAgICogSU5URlVMTCBiaXQgaXMgY29ycmVjdGx5IHJlcG9ydGVkIG9yIG5vdC4KKyAgICAgICAgICovCisgICAgICAgIHN0YXR1cyA9IChzdGF0dXMgJiAofklOVFJQVFNfTkVYVElOVF9NKSkgfCAoY2ktPmludGxvZy50aGlzX3N0YXR1c19uZXcpOworICAgICAgICBuZXh0SW50ID0gSU5UUlBUU19ORVhUSU5UIChzdGF0dXMpOworICAgIH0KKyAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyAgICAvKiBDbjg0N3ggQnVnIEZpeCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAvKiAtLS0tLS0tLS0tLS0tLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAvKiBGaXggZm9yIGluYWJpbGl0eSB0byB3cml0ZSBiYWNrIHNhbWUgaW5kZXggKi8KKyAgICAvKiBhcyByZWFkIGZvciBhIGZ1bGwgaW50ZXJydXB0IHF1ZXVlLiAgICAgICAgKi8KKyAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworICAgIGlmIChpbnRDbnQgPT0gSU5UX1FVRVVFX1NJWkUpCisgICAgeworICAgICAgICBjdXJySW50ID0gKChpbnRDbnQgLSAxKSArIG5leHRJbnQpICYgKElOVF9RVUVVRV9TSVpFIC0gMSk7CisgICAgfSBlbHNlCisgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgICAgIC8qIEludGVycnVwdCBXcml0ZSBMb2NhdGlvbiBJc3N1ZXMgICAgICAgICAgICAgICovCisgICAgICAgIC8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gICAgICAgICAgICAgICovCisgICAgICAgIC8qIFdoZW4gdGhlIGludGVycnVwdCBzdGF0dXMgZGVzY3JpcHRvciBpcyAgICAgICovCisgICAgICAgIC8qIHdyaXR0ZW4sIHRoZSBpbnRlcnJ1cHQgbGluZSBpcyBkZS1hc3NlcnRlZCAgICovCisgICAgICAgIC8qIGJ5IHRoZSBDbjg0N3guICBJbiB0aGUgY2FzZSBvZiBNSVBTICAgICAgICAgICovCisgICAgICAgIC8qIG1pY3JvcHJvY2Vzc29ycywgdGhpcyBtdXN0IG9jY3VyIGF0IHRoZSAgICAgICovCisgICAgICAgIC8qIGJlZ2lubmluZyBvZiB0aGUgaW50ZXJydXB0IGhhbmRsZXIgc28gdGhhdCAgICovCisgICAgICAgIC8qIHRoZSBpbnRlcnJ1cHQgaGFuZGxlIGlzIG5vdCByZS1lbnRlcmVkIGR1ZSAgICovCisgICAgICAgIC8qIHRvIGludGVycnVwdCBkaXMtYXNzZXJ0aW9uIGxhdGVuY3kuICAgICAgICAgICovCisgICAgICAgIC8qIEluIHRoZSBjYXNlIG9mIGFsbCBvdGhlciBwcm9jZXNzb3JzLCB0aGlzICAgICovCisgICAgICAgIC8qIGFjdGlvbiBzaG91bGQgb2NjdXIgYXQgdGhlIGVuZCBvZiB0aGUgICAgICAgICovCisgICAgICAgIC8qIGludGVycnVwdCBoYW5kbGVyIHRvIGF2b2lkIG92ZXJ3cml0aW5nIHRoZSAgICovCisgICAgICAgIC8qIGludGVycnVwdCBxdWV1ZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyAgICBpZiAoaW50Q250KQorICAgIHsKKyAgICAgICAgY3VyckludCA9IChpbnRDbnQgKyBuZXh0SW50KSAmIChJTlRfUVVFVUVfU0laRSAtIDEpOworICAgIH0gZWxzZQorICAgIHsKKyAgICAgICAgLyoKKyAgICAgICAgICogTk9URTogU2VydmljaW5nIGFuIGludGVycnVwdCB3aG9zZSBJU0QgY29udGFpbnMgYSBjb3VudCBvZiBaRVJPCisgICAgICAgICAqIGNhbiBiZSBpbmRpY2F0aXZlIG9mIGEgU2hhcmVkIEludGVycnVwdCBjaGFpbi4gIE91ciBkcml2ZXIgY2FuIGJlCisgICAgICAgICAqIGNhbGxlZCBmcm9tIHRoZSBzeXN0ZW0ncyBpbnRlcnJ1cHQgaGFuZGxlciBhcyBhIG1hdHRlciBvZiB0aGUgT1MKKyAgICAgICAgICogd2Fsa2luZyB0aGUgY2hhaW4uICBBcyB0aGUgY2hhaW4gaXMgd2Fsa2VkLCB0aGUgaW50ZXJydXB0IHdpbGwKKyAgICAgICAgICogZXZlbnR1YWxseSBiZSBzZXJ2aWNlZCBieSB0aGUgY29ycmVjdCBkcml2ZXIvaGFuZGxlci4KKyAgICAgICAgICovCisjaWYgMAorICAgICAgICAvKiBjaGFpbmVkIGludGVycnVwdCA9IG5vdCBvdXJzICovCisgICAgICAgIHByX2luZm8oIj4+ICVzOiBpbnRDbnQgTlVMTCwgc3RzICV4LCBwb3NzaWJseSBhIGNoYWluZWQgaW50ZXJydXB0IVxuIiwKKyAgICAgICAgICAgICAgICBjaS0+ZGV2bmFtZSwgc3RhdHVzKTsKKyNlbmRpZgorICAgICAgICByZXR1cm4gSVJRX05PTkU7CisgICAgfQorCisgICAgY2ktPmlxcF90YWlseCA9IGN1cnJJbnQ7CisKKyAgICBjdXJySW50IDw8PSBJTlRSUFRTX05FWFRJTlRfUzsKKyAgICBjaS0+aW50bG9nLmxhc3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eWNjX2lzcl90cSwgJnRxX2ltbWVkaWF0ZSk7CisgICAgbWFya19iaCAoSU1NRURJQVRFX0JIKTsKKyNlbGlmIGRlZmluZWQoU0JFX0lTUl9JTkxJTkUpCisgICAgKHZvaWQpIG11c3ljY19pbnRyX2JoX3Rhc2tsZXQgKGNpKTsKKyAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNpLT5yZWctPmlzZCwgY3VyckludCk7CisjZW5kaWYKKyAgICByZXR1cm4gSVJRX0hBTkRMRUQ7Cit9CisKKworI2lmIGRlZmluZWQoU0JFX0lTUl9JTU1FRElBVEUpCit1bnNpZ25lZCBsb25nCisjZWxzZQordm9pZAorI2VuZGlmCittdXN5Y2NfaW50cl9iaF90YXNrbGV0IChjaV90ICogY2kpCit7CisgICAgbXBpX3QgICAgICAqcGk7CisgICAgbWNoX3QgICAgICAqY2g7CisgICAgdW5zaWduZWQgaW50IGludENudDsKKyAgICB2b2xhdGlsZSB1X2ludDMyX3QgY3VyckludCA9IDA7CisgICAgdm9sYXRpbGUgdW5zaWduZWQgaW50IGhlYWR4LCB0YWlseDsKKyAgICBpbnQgICAgICAgICByZWFkQ291bnQsIGxvb3BDb3VudDsKKyAgICBpbnQgICAgICAgICBncm91cCwgZ2NoYW4sIGV2ZW50LCBlcnIsIHR4OworICAgIHVfaW50MzJfdCAgIGJhZEludCA9IElOVF9FTVBUWV9FTlRSWTsKKyAgICB1X2ludDMyX3QgICBiYWRJbnQyID0gSU5UX0VNUFRZX0VOVFJZMjsKKworICAgIC8qCisgICAgICogSGFyZHdhcmUgbm90IGF2YWlsYWJsZSwgcG90ZW50aWFsIGludGVycnVwdCBoYW5nLiAgQnV0IHNpbmNlIGludGVycnVwdAorICAgICAqIG1pZ2h0IGJlIHNoYXJlZCwganVzdCByZXR1cm4uCisgICAgICovCisgICAgaWYgKChkcnZyX3N0YXRlICE9IFNCRV9EUlZSX0FWQUlMQUJMRSkgfHwgKGNpLT5zdGF0ZSA9PSBDX0lOSVQpKQorICAgIHsKKyNpZiBkZWZpbmVkKFNCRV9JU1JfSU1NRURJQVRFKQorICAgICAgICByZXR1cm4gMEw7CisjZWxzZQorICAgICAgICByZXR1cm47CisjZW5kaWYKKyAgICB9CisjaWYgZGVmaW5lZChTQkVfSVNSX1RBU0tMRVQpIHx8IGRlZmluZWQoU0JFX0lTUl9JTU1FRElBVEUpCisgICAgaWYgKGRydnJfc3RhdGUgIT0gU0JFX0RSVlJfQVZBSUxBQkxFKQorICAgIHsKKyNpZiBkZWZpbmVkKFNCRV9JU1JfVEFTS0xFVCkKKyAgICAgICAgcmV0dXJuOworI2VsaWYgZGVmaW5lZChTQkVfSVNSX0lNTUVESUFURSkKKyAgICAgICAgcmV0dXJuIDBMOworI2VuZGlmCisgICAgfQorI2VsaWYgZGVmaW5lZChTQkVfSVNSX0lOTElORSkKKyAgICAvKiBubyBzZW1hcGhvcmUgdGFrZW4sIG5vIGRvdWJsZSBjaGVja3MgKi8KKyNlbmRpZgorCisgICAgY2ktPmludGxvZy5kcnZyX2ludHJfYmhjb3VudCsrOworICAgIEZMVVNIX01FTV9SRUFEICgpOworICAgIHsKKyAgICAgICAgdW5zaWduZWQgaW50IGJoID0gYXRvbWljX3JlYWQgKCZjaS0+YmhfcGVuZGluZyk7CisKKyAgICAgICAgbWF4X2JoID0gbWF4IChiaCwgbWF4X2JoKTsKKyAgICB9CisgICAgYXRvbWljX3NldCAoJmNpLT5iaF9wZW5kaW5nLCAwKTsvKiBpZiBoZXJlLCBubyBsb25nZXIgcGVuZGluZyAqLworICAgIHdoaWxlICgoaGVhZHggPSBjaS0+aXFwX2hlYWR4KSAhPSAodGFpbHggPSBjaS0+aXFwX3RhaWx4KSkKKyAgICB7CisgICAgICAgIGludENudCA9ICh0YWlseCA+PSBoZWFkeCkgPyAodGFpbHggLSBoZWFkeCkgOiAodGFpbHggLSBoZWFkeCArIElOVF9RVUVVRV9TSVpFKTsKKyAgICAgICAgY3VyckludCA9IGxlMzJfdG9fY3B1IChjaS0+aXFkX3BbaGVhZHhdKTsKKworICAgICAgICBtYXhfaW50Y250ID0gbWF4IChpbnRDbnQsIG1heF9pbnRjbnQpOyAgLyogUkxEIERFQlVHICovCisKKyAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworICAgICAgICAvKiBIVyBCdWcgRml4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgIC8qIC0tLS0tLS0tLS0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgLyogVGhlIGZvbGxvd2luZyBjb2RlIGNoZWNrcyBmb3IgdGhlIGNvbmRpdGlvbiAgICAqLworICAgICAgICAvKiBvZiBpbnRlcnJ1cHQgYXNzZXJ0aW9uIGJlZm9yZSBpbnRlcnJ1cHQgICAgICAgICovCisgICAgICAgIC8qIHF1ZXVlIHVwZGF0ZS4gIFRoaXMgaXMgYSBwcm9ibGVtIG9uIHNldmVyYWwgICAgKi8KKyAgICAgICAgLyogUENJLUxvY2FsIGJyaWRnZSBjaGlwcyBmb3VuZCBvbiBzb21lIHByb2R1Y3RzLiAqLworICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyAgICAgICAgcmVhZENvdW50ID0gMDsKKyAgICAgICAgaWYgKChjdXJySW50ID09IGJhZEludCkgfHwgKGN1cnJJbnQgPT0gYmFkSW50MikpCisgICAgICAgICAgICBjaS0+aW50bG9nLmRydnJfaW50X2ZhaWx1cmUrKzsKKworICAgICAgICB3aGlsZSAoKGN1cnJJbnQgPT0gYmFkSW50KSB8fCAoY3VyckludCA9PSBiYWRJbnQyKSkKKyAgICAgICAgeworICAgICAgICAgICAgZm9yIChsb29wQ291bnQgPSAwOyBsb29wQ291bnQgPCAweDMwOyBsb29wQ291bnQrKykKKyAgICAgICAgICAgICAgICBPU191d2FpdF9kdW1teSAoKTsgIC8qIHVzZSBjYWxsIHRvIGF2b2lkIG9wdGltaXphdGlvbiByZW1vdmFsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBvZiBkdW1teSBkZWxheSAqLworICAgICAgICAgICAgRkxVU0hfTUVNX1JFQUQgKCk7CisgICAgICAgICAgICBjdXJySW50ID0gbGUzMl90b19jcHUgKGNpLT5pcWRfcFtoZWFkeF0pOworICAgICAgICAgICAgaWYgKHJlYWRDb3VudCsrID4gMjApCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBpZiAoKGN1cnJJbnQgPT0gYmFkSW50KSB8fCAoY3VyckludCA9PSBiYWRJbnQyKSkgICAgICAgIC8qIGNhdGNoIGZhaWx1cmUgb2YgQnVnCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogRml4IGNoZWNraW5nICovCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChsb2dfbGV2ZWwgPj0gTE9HX1dBUk4pCisgICAgICAgICAgICAgICAgcHJfaW5mbygiJXM6IElsbGVnYWwgSW50ZXJydXB0IERldGVjdGVkIEAgMHglcCwgbW9kICVkLilcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICBjaS0+ZGV2bmFtZSwgJmNpLT5pcWRfcFtoZWFkeF0sIGhlYWR4KTsKKworICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAqIElmIHRoZSBkZXNjcmlwdG9yIGhhcyBub3QgcmVjb3ZlcmVkLCB0aGVuIGxlYXZpbmcgdGhlIEVNUFRZCisgICAgICAgICAgICAgKiBlbnRyeSBzZXQgd2lsbCBub3Qgc2lnbmFsIHRvIHRoZSBNVVNZQ0MgdGhhdCB0aGlzIGRlc2NyaXB0b3IKKyAgICAgICAgICAgICAqIGhhcyBiZWVuIHNlcnZpY2VkLiBUaGUgSW50ZXJydXB0IFF1ZXVlIGNhbiB0aGVuIHN0YXJ0IGxvb3NpbmcKKyAgICAgICAgICAgICAqIGF2YWlsYWJsZSBkZXNjcmlwdG9ycyBhbmQgTVVTWUNDIGV2ZW50dWFsbHkgZW5jb3VudGVycyBhbmQKKyAgICAgICAgICAgICAqIHJlcG9ydHMgdGhlIElOVEZVTEwgY29uZGl0aW9uLiAgUGVyIG1hbnVhbCwgY2hhbmdpbmcgYW55IGJpdAorICAgICAgICAgICAgICogbWFya3MgZGVzY3JpcHRvciBhcyBhdmFpbGFibGUsIHRodXMgdGhlIHVzZSBvZiBkaWZmZXJlbnQKKyAgICAgICAgICAgICAqIEVNUFRZX0VOVFJZIHZhbHVlcy4KKyAgICAgICAgICAgICAqLworCisgICAgICAgICAgICBpZiAoY3VyckludCA9PSBiYWRJbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY2ktPmlxZF9wW2hlYWR4XSA9IF9fY29uc3RhbnRfY3B1X3RvX2xlMzIgKElOVF9FTVBUWV9FTlRSWTIpOworICAgICAgICAgICAgfSBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY2ktPmlxZF9wW2hlYWR4XSA9IF9fY29uc3RhbnRfY3B1X3RvX2xlMzIgKElOVF9FTVBUWV9FTlRSWSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBjaS0+aXFwX2hlYWR4ID0gKGhlYWR4ICsgMSkgJiAoSU5UX1FVRVVFX1NJWkUgLSAxKTsgLyogaW5zdXJlIHdyYXBuZXNzICovCisgICAgICAgICAgICBGTFVTSF9NRU1fV1JJVEUgKCk7CisgICAgICAgICAgICBGTFVTSF9NRU1fUkVBRCAoKTsKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICB9CisgICAgICAgIGdyb3VwID0gSU5UUlBUX0dSUCAoY3VyckludCk7CisgICAgICAgIGdjaGFuID0gSU5UUlBUX0NIIChjdXJySW50KTsKKyAgICAgICAgZXZlbnQgPSBJTlRSUFRfRVZFTlQgKGN1cnJJbnQpOworICAgICAgICBlcnIgPSBJTlRSUFRfRVJST1IgKGN1cnJJbnQpOworICAgICAgICB0eCA9IGN1cnJJbnQgJiBJTlRSUFRfRElSX007CisKKyAgICAgICAgY2ktPmlxZF9wW2hlYWR4XSA9IF9fY29uc3RhbnRfY3B1X3RvX2xlMzIgKElOVF9FTVBUWV9FTlRSWSk7CisgICAgICAgIEZMVVNIX01FTV9XUklURSAoKTsKKworICAgICAgICBpZiAobG9nX2xldmVsID49IExPR19ERUJVRykKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKGVyciAhPSAwKQorICAgICAgICAgICAgICAgIHByX2luZm8oIiAlMDh4IC0+IGVycjogJTJkLCIsIGN1cnJJbnQsIGVycik7CisKKyAgICAgICAgICAgIHByX2luZm8oIisgaW50ZXJydXB0IGV2ZW50OiAlZCwgZ3JwOiAlZCwgY2hhbjogJTJkLCBzaWRlOiAlY1hcbiIsCisgICAgICAgICAgICAgICAgICAgIGV2ZW50LCBncm91cCwgZ2NoYW4sIHR4ID8gJ1QnIDogJ1InKTsKKyAgICAgICAgfQorICAgICAgICBwaSA9ICZjaS0+cG9ydFtncm91cF07ICAgICAgLyogbm90aWNlIHRoYXQgaGVyZSB3ZSBhc3N1bWUgMS0xIGdyb3VwIC0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHBvcnQgbWFwcGluZyAqLworICAgICAgICBjaCA9IHBpLT5jaGFuW2djaGFuXTsKKyAgICAgICAgc3dpdGNoIChldmVudCkKKyAgICAgICAgeworICAgICAgICBjYXNlIEVWRV9TQUNLOiAgICAgICAgICAgICAgLyogU2VydmljZSBSZXF1ZXN0IEFja25vd2xlZGdlICovCisgICAgICAgICAgICBpZiAobG9nX2xldmVsID49IExPR19ERUJVRykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2b2xhdGlsZSB1X2ludDMyX3QgcjsKKworICAgICAgICAgICAgICAgIHIgPSBwY2lfcmVhZF8zMiAoKHVfaW50MzJfdCAqKSAmcGktPnJlZy0+c3JkKTsKKyAgICAgICAgICAgICAgICBwcl9pbmZvKCItIFNBQ0sgY21kOiAlMDh4IChoZHc9ICUwOHgpXG4iLCBwaS0+c3JfbGFzdCwgcik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBTRF9TRU1fR0lWRSAoJnBpLT5zcl9zZW1fd2FpdCk7ICAgICAvKiB3YWtlIHVwIHdhaXRpbmcgcHJvY2VzcyAqLworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgRVZFX0NIQUJUOiAgICAgLyogQ2hhbmdlIFRvIEFib3J0IENvZGUgKDB4N2UgLT4gMHhmZikgKi8KKyAgICAgICAgY2FzZSBFVkVfQ0hJQzogICAgICAgICAgICAgIC8qIENoYW5nZSBUbyBJZGxlIENvZGUgKDB4ZmYgLT4gMHg3ZSkgKi8KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIEVWRV9FT006ICAgICAgICAgICAgICAgLyogRW5kIE9mIE1lc3NhZ2UgKi8KKyAgICAgICAgY2FzZSBFVkVfRU9COiAgICAgICAgICAgICAgIC8qIEVuZCBPZiBCdWZmZXIgKFRyYW5zcGFyZW50IG1vZGUpICovCisgICAgICAgICAgICBpZiAodHgpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbXVzeWNjX2JoX3R4X2VvbSAocGksIGdjaGFuKTsKKyAgICAgICAgICAgIH0gZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIG11c3ljY19iaF9yeF9lb20gKHBpLCBnY2hhbik7CisgICAgICAgICAgICB9CisjaWYgMAorICAgICAgICAgICAgYnJlYWs7CisjZWxzZQorICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAqIE1VU1lDQyBJbnRlcnJ1cHQgRGVzY3JpcHRvciBzZWN0aW9uIHN0YXRlcyB0aGF0IEVPQiBhbmQgRU9NCisgICAgICAgICAgICAgKiBjYW4gYmUgY29tYmluZWQgd2l0aCB0aGUgTk9ORSBlcnJvciAoYXMgd2VsbCBhcyBvdGhlcnMpLiAgU28KKyAgICAgICAgICAgICAqIGRyb3AgdGhydSB0byBjYXRjaCB0aGlzLi4uCisgICAgICAgICAgICAgKi8KKyNlbmRpZgorICAgICAgICBjYXNlIEVWRV9OT05FOgorICAgICAgICAgICAgaWYgKGVyciA9PSBFUlJfU0hUKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNoLT5zLnJ4X2xlbmd0aF9lcnJvcnMrKzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgaWYgKGxvZ19sZXZlbCA+PSBMT0dfV0FSTikKKyAgICAgICAgICAgICAgICBwcl9pbmZvKCIlczogdW5leHBlY3RlZCBpbnRlcnJ1cHQgZXZlbnQ6ICVkLCBpcWRbJWRdOiAlMDh4LCBwb3J0OiAlZFxuIiwgY2ktPmRldm5hbWUsCisgICAgICAgICAgICAgICAgICAgICAgICBldmVudCwgaGVhZHgsIGN1cnJJbnQsIGdyb3VwKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9ICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogc3dpdGNoIG9uIGV2ZW50ICovCisKKworICAgICAgICAvKgorICAgICAgICAgKiBQZXIgTVVTWUNDIE1hbnVhbCwgU2VjdGlvbiA2LjQuOC4zIFtUcmFuc21pdCBFcnJvcnNdLCBUWCBlcnJvcnMKKyAgICAgICAgICogYXJlIHNlcnZpY2UtYWZmZWN0aW5nIGFuZCByZXF1aXJlIGFjdGlvbiB0byByZXN1bWUgbm9ybWFsCisgICAgICAgICAqIGJpdC1sZXZlbCBwcm9jZXNzaW5nLgorICAgICAgICAgKi8KKworICAgICAgICBzd2l0Y2ggKGVycikKKyAgICAgICAgeworICAgICAgICBjYXNlIEVSUl9PTlI6CisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogUGVyIE1VU1lDQyBtYW51YWwsIFNlY3Rpb24gIDYuNC44LjMgW1RyYW5zbWl0IEVycm9yc10sIHRoaXMKKyAgICAgICAgICAgICAqIGVycm9yIHJlcXVpcmVzIFRyYW5zbWl0IGNoYW5uZWwgcmVhY3RpdmF0aW9uLgorICAgICAgICAgICAgICoKKyAgICAgICAgICAgICAqIFBlciBNVVNZQ0MgbWFudWFsLCBTZWN0aW9uICA2LjQuOC40IFtSZWNlaXZlIEVycm9yc10sIHRoaXMgZXJyb3IKKyAgICAgICAgICAgICAqIHJlcXVpcmVzIFJlY2VpdmUgY2hhbm5lbCByZWFjdGl2YXRpb24uCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGlmICh0eCkKKyAgICAgICAgICAgIHsKKworICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICogVFggT05SIEVycm9yIG9ubHkgb2NjdXJzIHdoZW4gY2hhbm5lbCBpcyBjb25maWd1cmVkIGZvcgorICAgICAgICAgICAgICAgICAqIFRyYW5zcGFyZW50IE1vZGUuICBIb3dldmVyLCB0aGlzIGNvZGUgd2lsbCBjYXRjaCBhbmQKKyAgICAgICAgICAgICAgICAgKiByZS1hY3RpdmF0ZSBvbiBBTlkgVFggT05SIGVycm9yLgorICAgICAgICAgICAgICAgICAqLworCisgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgKiBTZXQgZmxhZyB0byByZS1lbmFibGUgb24gYW55IG5leHQgdHJhbnNtaXQgYXR0ZW1wdC4KKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBjaC0+Y2hfc3RhcnRfdHggPSBDSF9TVEFSVF9UWF9PTlI7CisKKyAgICAgICAgICAgICAgICB7CisjaWZkZWYgUkxEX1RSQU5TX0RFQlVHCisgICAgICAgICAgICAgICAgICAgIGlmICgxIHx8IGxvZ19sZXZlbCA+PSBMT0dfTU9OSVRPUikKKyNlbHNlCisgICAgICAgICAgICAgICAgICAgIGlmIChsb2dfbGV2ZWwgPj0gTE9HX01PTklUT1IpCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgcHJfaW5mbygiJXM6IFRYIGJ1ZmZlciB1bmRlcmZsb3cgW09OUl0gb24gY2hhbm5lbCAlZCwgbW9kZSAleCBRU3RvcHBlZCAleCBmcmVlICVkXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaS0+ZGV2bmFtZSwgY2gtPmNoYW5udW0sIGNoLT5wLmNoYW5fbW9kZSwgc2RfcXVldWVfc3RvcHBlZCAoY2gtPnVzZXIpLCBjaC0+dHhkX2ZyZWUpOworI2lmZGVmIFJMRF9ERUJVRworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNoLT5wLmNoYW5fbW9kZSA9PSAyKSAgICAgICAvKiBwcm9ibGVtID0gT05SIG9uIEhETEMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogbW9kZSAqLworICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByX2luZm8oIisrIEZhaWxlZCBMYXN0ICV4IE5leHQgJXggUVN0b3BwZWQgJXgsIHN0YXJ0X3R4ICV4IHR4X2Z1bGwgJWQgdHhkX2ZyZWUgJWQgbW9kZSAleFxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1X2ludDMyX3QpIGNoLT50eGRfaXJxX3NydiwgKHVfaW50MzJfdCkgY2gtPnR4ZF91c3JfYWRkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2RfcXVldWVfc3RvcHBlZCAoY2gtPnVzZXIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2gtPmNoX3N0YXJ0X3R4LCBjaC0+dHhfZnVsbCwgY2gtPnR4ZF9mcmVlLCBjaC0+cC5jaGFuX21vZGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG11c3ljY19kdW1wX3R4YnVmZmVyX3JpbmcgKGNoLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlICAgICAgICAgICAgICAgICAgLyogUlggYnVmZmVyIG92ZXJydW4gKi8KKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAqIFBlciBNVVNZQ0MgbWFudWFsLCBTZWN0aW9uIDYuNC44LjQgW1JlY2VpdmUgRXJyb3JzXSwKKyAgICAgICAgICAgICAgICAgKiBjaGFubmVsIHJlY292ZXJ5IGZvciB0aGlzIFJYIE9OUiBlcnJvciBJUyByZXF1aXJlZC4gIEl0IGlzCisgICAgICAgICAgICAgICAgICogYWxzbyBzdWdnZXN0ZWQgdG8gaW5jcmVhc2UgdGhlIG51bWJlciBvZiByZWNlaXZlIGJ1ZmZlcnMKKyAgICAgICAgICAgICAgICAgKiBmb3IgdGhpcyBjaGFubmVsLiAgUmVjZWl2ZSBjaGFubmVsIHJlYWN0aXZhdGlvbiBJUworICAgICAgICAgICAgICAgICAqIHJlcXVpcmVkLCBhbmQgZGF0YSBoYXMgYmVlbiBsb3N0LgorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGNoLT5zLnJ4X292ZXJfZXJyb3JzKys7CisgICAgICAgICAgICAgICAgY2gtPmNoX3N0YXJ0X3J4ID0gQ0hfU1RBUlRfUlhfT05SOworCisgICAgICAgICAgICAgICAgaWYgKGxvZ19sZXZlbCA+PSBMT0dfV0FSTikKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHByX2luZm8oIiVzOiBSWCBidWZmZXIgb3ZlcmZsb3cgW09OUl0gb24gY2hhbm5lbCAlZCwgbW9kZSAleFxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaS0+ZGV2bmFtZSwgY2gtPmNoYW5udW0sIGNoLT5wLmNoYW5fbW9kZSk7CisgICAgICAgICAgICAgICAgICAgIC8vbXVzeWNjX2R1bXBfcnhidWZmZXJfcmluZyAoY2gsIDApOyAgICAgICAgLyogUkxEIERFQlVHICovCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgbXVzeWNjX2NoYW5fcmVzdGFydCAoY2gpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgRVJSX0JVRjoKKyAgICAgICAgICAgIGlmICh0eCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjaC0+cy50eF9maWZvX2Vycm9ycysrOworICAgICAgICAgICAgICAgIGNoLT5jaF9zdGFydF90eCA9IENIX1NUQVJUX1RYX0JVRjsKKyAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAqIFBlciBNVVNZQ0MgbWFudWFsLCBTZWN0aW9uICA2LjQuOC4zIFtUcmFuc21pdCBFcnJvcnNdLAorICAgICAgICAgICAgICAgICAqIHRoaXMgQlVGRiBlcnJvciByZXF1aXJlcyBUcmFuc21pdCBjaGFubmVsIHJlYWN0aXZhdGlvbi4KKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBpZiAobG9nX2xldmVsID49IExPR19NT05JVE9SKQorICAgICAgICAgICAgICAgICAgICBwcl9pbmZvKCIlczogVFggYnVmZmVyIHVuZGVycnVuIFtCVUZGXSBvbiBjaGFubmVsICVkLCBtb2RlICV4XG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpLT5kZXZuYW1lLCBjaC0+Y2hhbm51bSwgY2gtPnAuY2hhbl9tb2RlKTsKKyAgICAgICAgICAgIH0gZWxzZSAgICAgICAgICAgICAgICAgIC8qIFJYIGJ1ZmZlciBvdmVycnVuICovCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY2gtPnMucnhfb3Zlcl9lcnJvcnMrKzsKKyAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAqIFBlciBNVVNZQ0MgbWFudWFsLCBTZWN0aW9uIDYuNC44LjQgW1JlY2VpdmUgRXJyb3JzXSwgSERMQworICAgICAgICAgICAgICAgICAqIG1vZGUgcmVxdWlyZXMgTk8gcmVjb3ZlcnkgZm9yIHRoaXMgUlggQlVGRiBlcnJvciBpcworICAgICAgICAgICAgICAgICAqIHJlcXVpcmVkLiAgSXQgaXMgc3VnZ2VzdGVkIHRvIGluY3JlYXNlIHRoZSBGSUZPIGJ1ZmZlcgorICAgICAgICAgICAgICAgICAqIHNwYWNlIGZvciB0aGlzIGNoYW5uZWwuICBSZWNlaXZlIGNoYW5uZWwgcmVhY3RpdmF0aW9uIGlzCisgICAgICAgICAgICAgICAgICogbm90IHJlcXVpcmVkLCBidXQgZGF0YSBoYXMgYmVlbiBsb3N0LgorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGlmIChsb2dfbGV2ZWwgPj0gTE9HX1dBUk4pCisgICAgICAgICAgICAgICAgICAgIHByX2luZm8oIiVzOiBSWCBidWZmZXIgb3ZlcnJ1biBbQlVGRl0gb24gY2hhbm5lbCAlZCwgbW9kZSAleFxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaS0+ZGV2bmFtZSwgY2gtPmNoYW5udW0sIGNoLT5wLmNoYW5fbW9kZSk7CisgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgKiBQZXIgTVVTWUNDIG1hbnVhbCwgU2VjdGlvbiA2LjQuOS40IFtSZWNlaXZlIEVycm9yc10sCisgICAgICAgICAgICAgICAgICogVHJhbnNwYXJlbnQgbW9kZSBET0VTIHJlcXVpcmUgcmVjb3ZlcnkgZm9yIHRoZSBSWCBCVUZGCisgICAgICAgICAgICAgICAgICogZXJyb3IuICBJdCBpcyBzdWdnZXN0ZWQgdG8gaW5jcmVhc2UgdGhlIEZJRk8gYnVmZmVyIHNwYWNlCisgICAgICAgICAgICAgICAgICogZm9yIHRoaXMgY2hhbm5lbC4gIFJlY2VpdmUgY2hhbm5lbCByZWFjdGl2YXRpb24gSVMKKyAgICAgICAgICAgICAgICAgKiByZXF1aXJlZCBhbmQgZGF0YSBoYXMgYmVlbiBsb3N0LgorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGlmIChjaC0+cC5jaGFuX21vZGUgPT0gQ0ZHX0NIX1BST1RPX1RSQU5TKQorICAgICAgICAgICAgICAgICAgICBjaC0+Y2hfc3RhcnRfcnggPSBDSF9TVEFSVF9SWF9CVUY7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmICh0eCB8fCAoY2gtPnAuY2hhbl9tb2RlID09IENGR19DSF9QUk9UT19UUkFOUykpCisgICAgICAgICAgICAgICAgbXVzeWNjX2NoYW5fcmVzdGFydCAoY2gpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHN3aXRjaCBvbiBlcnIgKi8KKworICAgICAgICAvKiBDaGVjayBmb3IgaW50ZXJydXB0IGxvc3QgY29uZGl0aW9uICovCisgICAgICAgIGlmICgoY3VyckludCAmIElOVFJQVF9JTE9TVF9NKSAmJiAobG9nX2xldmVsID49IExPR19FUlJPUikpCisgICAgICAgIHsKKyAgICAgICAgICAgIHByX2luZm8oIiVzOiBJbnRlcnJ1cHQgcXVldWUgb3ZlcmZsb3cgLSBJTE9TVCBhc3NlcnRlZFxuIiwKKyAgICAgICAgICAgICAgICAgICAgY2ktPmRldm5hbWUpOworICAgICAgICB9CisgICAgICAgIGNpLT5pcXBfaGVhZHggPSAoaGVhZHggKyAxKSAmIChJTlRfUVVFVUVfU0laRSAtIDEpOyAgICAgLyogaW5zdXJlIHdyYXBuZXNzICovCisgICAgICAgIEZMVVNIX01FTV9XUklURSAoKTsKKyAgICAgICAgRkxVU0hfTUVNX1JFQUQgKCk7CisgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiB3aGlsZSAqLworICAgIGlmICgobG9nX2xldmVsID49IExPR19NT05JVE9SMikgJiYgKGNpLT5pcXBfaGVhZHggIT0gY2ktPmlxcF90YWlseCkpCisgICAgeworICAgICAgICBpbnQgICAgICAgICBiaDsKKworICAgICAgICBiaCA9IGF0b21pY19yZWFkICgmQ0ktPmJoX3BlbmRpbmcpOworICAgICAgICBwcl9pbmZvKCJfYmhfOiBsYXRlIGFycml2YWxzLCBoZWFkICVkICE9IHRhaWwgJWQsIHBlbmRpbmcgJWRcbiIsCisgICAgICAgICAgICAgICAgY2ktPmlxcF9oZWFkeCwgY2ktPmlxcF90YWlseCwgYmgpOworICAgIH0KKyNpZiBkZWZpbmVkKFNCRV9JU1JfSU1NRURJQVRFKQorICAgIHJldHVybiAwTDsKKyNlbmRpZgorICAgIC8qIGVsc2UsIG5vdGhpbmcgcmV0dXJuZWQgKi8KK30KKworI2lmIDAKK2ludCAgICAgICAgIF9faW5pdAorbXVzeWNjX25ld19jaGFuIChjaV90ICogY2ksIGludCBjaGFubnVtLCB2b2lkICp1c2VyKQoreworICAgIG1jaF90ICAgICAgKmNoOworCisgICAgY2ggPSBjaS0+cG9ydFtjaGFubnVtIC8gTVVTWUNDX05DSEFOU10uY2hhbltjaGFubnVtICUgTVVTWUNDX05DSEFOU107CisKKyAgICBpZiAoY2gtPnN0YXRlICE9IFVOQVNTSUdORUQpCisgICAgICAgIHJldHVybiBFRVhJU1Q7CisgICAgLyogTk9URTogbWNoX3QgYWxyZWFkeSBjbGVhcmVkIGR1cmluZyBPU19rbWFsbG9jKCkgKi8KKyAgICBjaC0+c3RhdGUgPSBET1dOOworICAgIGNoLT51c2VyID0gdXNlcjsKKyNpZiAwCisgICAgY2gtPnN0YXR1cyA9IDA7CisgICAgY2gtPnAuc3RhdHVzID0gMDsKKyAgICBjaC0+cC5pbnRyX21hc2sgPSAwOworI2VuZGlmCisgICAgY2gtPnAuY2hhbl9tb2RlID0gQ0ZHX0NIX1BST1RPX0hETENfRkNTM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hbl0gPSAwOworICAgIHBpLT5yZWdyYW0tPnJocFtnY2hhbl0gPSAwOworICAgIHBpLT5yZWdyYW0tPnJtcFtnY2hhbl0gPSAwOworICAgIEZMVVNIX01FTV9XUklURSAoKTsKKyAgICBmb3IgKGkgPSAwOyBpIDwgY2gtPnR4ZF9udW07IGkrKykKKyAgICB7CisgICAgICAgIGlmIChjaC0+bWR0W2ldLm1lbV90b2tlbiAhPSAwKQorICAgICAgICAgICAgT1NfbWVtX3Rva2VuX2ZyZWUgKGNoLT5tZHRbaV0ubWVtX3Rva2VuKTsKKyAgICB9CisKKyAgICBmb3IgKGkgPSAwOyBpIDwgY2gtPnJ4ZF9udW07IGkrKykKKyAgICB7CisgICAgICAgIGlmIChjaC0+bWRyW2ldLm1lbV90b2tlbiAhPSAwKQorICAgICAgICAgICAgT1NfbWVtX3Rva2VuX2ZyZWUgKGNoLT5tZHJbaV0ubWVtX3Rva2VuKTsKKyAgICB9CisKKyAgICBPU19rZnJlZSAoY2gtPm1kcik7CisgICAgY2gtPm1kciA9IDA7CisgICAgY2gtPnJ4ZF9udW0gPSAwOworICAgIE9TX2tmcmVlIChjaC0+bWR0KTsKKyAgICBjaC0+bWR0ID0gMDsKKyAgICBjaC0+dHhkX251bSA9IDA7CisKKyAgICBtdXN5Y2NfdXBkYXRlX3RpbWVzbG90cyAocGkpOworICAgIGM0X2ZpZm9fZnJlZSAocGksIGNoLT5nY2hhbik7CisKKyAgICBwaS0+b3BlbmNoYW5zLS07CisgICAgcmV0dXJuIDA7Cit9CisjZW5kaWYKKworCitpbnQKK211c3ljY19kZWxfY2hhbiAoY2lfdCAqIGNpLCBpbnQgY2hhbm51bSkKK3sKKyAgICBtY2hfdCAgICAgICpjaDsKKworICAgIGlmICgoY2hhbm51bSA8IDApIHx8IChjaGFubnVtID49IChNVVNZQ0NfTlBPUlRTICogTVVTWUNDX05DSEFOUykpKSAgLyogc2FuaXR5IGNoayBwYXJhbSAqLworICAgICAgICByZXR1cm4gRUNIUk5HOworICAgIGlmICghKGNoID0gc2RfZmluZF9jaGFuIChjaSwgY2hhbm51bSkpKQorICAgICAgICByZXR1cm4gRU5PRU5UOworICAgIGlmIChjaC0+c3RhdGUgPT0gVVApCisgICAgICAgIG11c3ljY19jaGFuX2Rvd24gKGNpLCBjaGFubnVtKTsKKyAgICBjaC0+c3RhdGUgPSBVTkFTU0lHTkVEOworICAgIHJldHVybiAwOworfQorCisKK2ludAorbXVzeWNjX2RlbF9jaGFuX3N0YXRzIChjaV90ICogY2ksIGludCBjaGFubnVtKQoreworICAgIG1jaF90ICAgICAgKmNoOworCisgICAgaWYgKGNoYW5udW0gPCAwIHx8IGNoYW5udW0gPj0gKE1VU1lDQ19OUE9SVFMgKiBNVVNZQ0NfTkNIQU5TKSkgICAgICAvKiBzYW5pdHkgY2hrIHBhcmFtICovCisgICAgICAgIHJldHVybiBFQ0hSTkc7CisgICAgaWYgKCEoY2ggPSBzZF9maW5kX2NoYW4gKGNpLCBjaGFubnVtKSkpCisgICAgICAgIHJldHVybiBFTk9FTlQ7CisKKyAgICBtZW1zZXQgKCZjaC0+cywgMCwgc2l6ZW9mIChzdHJ1Y3Qgc2JlY29tX2NoYW5fc3RhdHMpKTsKKyAgICByZXR1cm4gMDsKK30KKworCitpbnQKK211c3ljY19zdGFydF94bWl0IChjaV90ICogY2ksIGludCBjaGFubnVtLCB2b2lkICptZW1fdG9rZW4pCit7CisgICAgbWNoX3QgICAgICAqY2g7CisgICAgc3RydWN0IG1kZXNjICptZDsKKyAgICB2b2lkICAgICAgICptMjsKKyNpZiAwCisgICAgdW5zaWduZWQgbG9uZyBmbGFnczsKKyNlbmRpZgorICAgIGludCAgICAgICAgIHR4ZF9uZWVkX2NudDsKKyAgICB1X2ludDMyX3QgICBsZW47CisKKyAgICBpZiAoIShjaCA9IHNkX2ZpbmRfY2hhbiAoY2ksIGNoYW5udW0pKSkKKyAgICAgICAgcmV0dXJuIEVOT0VOVDsKKworICAgIGlmIChjaS0+c3RhdGUgIT0gQ19SVU5OSU5HKSAgICAgLyogZnVsbCBpbnRlcnJ1cHQgcHJvY2Vzc2luZyBhdmFpbGFibGUgKi8KKyAgICAgICAgcmV0dXJuIEVJTlZBTDsKKyAgICBpZiAoY2gtPnN0YXRlICE9IFVQKQorICAgICAgICByZXR1cm4gRUlOVkFMOworCisgICAgaWYgKCEoY2gtPnN0YXR1cyAmIFRYX0VOQUJMRUQpKQorICAgICAgICByZXR1cm4gRVJPRlM7ICAgICAgICAgICAgICAgLyogaG93IGVsc2UgdG8gZmxhZyB1bndyaXRhYmxlIHN0YXRlID8gKi8KKworI2lmZGVmIFJMRF9UUkFOU19ERUJVR3gKKyAgICBpZiAoMSB8fCBsb2dfbGV2ZWwgPj0gTE9HX01PTklUT1IyKQorI2Vsc2UKKyAgICBpZiAobG9nX2xldmVsID49IExPR19NT05JVE9SMikKKyNlbmRpZgorICAgIHsKKyAgICAgICAgcHJfaW5mbygiKysgc3RhcnRfeG10WyVkXTogc3RhdGUgJXggc3RhcnQgJXggZnVsbCAlZCBmcmVlICVkIHJlcXVpcmVkICVkIHN0b3BwZWQgJXhcbiIsCisgICAgICAgICAgICAgICAgY2hhbm51bSwgY2gtPnN0YXRlLCBjaC0+Y2hfc3RhcnRfdHgsIGNoLT50eF9mdWxsLAorICAgICAgICAgICAgICAgIGNoLT50eGRfZnJlZSwgY2gtPnR4ZF9yZXF1aXJlZCwgc2RfcXVldWVfc3RvcHBlZCAoY2gtPnVzZXIpKTsKKyAgICB9CisgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworICAgIC8qKiBEZXRlcm1pbmUgdG90YWwgYW1vdW50IG9mIGRhdGEgdG8gYmUgc2VudCAqKi8KKyAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgbTIgPSBtZW1fdG9rZW47CisgICAgdHhkX25lZWRfY250ID0gMDsKKyAgICBmb3IgKGxlbiA9IE9TX21lbV90b2tlbl90bGVuIChtMik7IGxlbiA+IDA7CisgICAgICAgICBtMiA9ICh2b2lkICopIE9TX21lbV90b2tlbl9uZXh0IChtMikpCisgICAgeworICAgICAgICBpZiAoIU9TX21lbV90b2tlbl9sZW4gKG0yKSkKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICB0eGRfbmVlZF9jbnQrKzsKKyAgICAgICAgbGVuIC09IE9TX21lbV90b2tlbl9sZW4gKG0yKTsKKyAgICB9CisKKyAgICBpZiAodHhkX25lZWRfY250ID09IDApCisgICAgeworICAgICAgICBpZiAobG9nX2xldmVsID49IExPR19NT05JVE9SMikKKyAgICAgICAgICAgIHByX2luZm8oIiVzIGNoYW5uZWwgJWQ6IG5vIFRYIGRhdGEgaW4gVXNlciBidWZmZXJcbiIsIGNpLT5kZXZuYW1lLCBjaGFubnVtKTsKKyAgICAgICAgT1NfbWVtX3Rva2VuX2ZyZWUgKG1lbV90b2tlbik7CisgICAgICAgIHJldHVybiAwOyAgICAgICAgICAgICAgICAgICAvKiBubyBkYXRhIHRvIHNlbmQgKi8KKyAgICB9CisgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgLyoqIEFyZSB0aGVyZSBzdWZmaWNpZW50IGRlc2NyaXB0b3JzIGF2YWlsYWJsZT8gKiovCisgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgaWYgKHR4ZF9uZWVkX2NudCA+IGNoLT50eGRfbnVtKSAvKiBuZXZlciBlbm91Z2ggZGVzY3JpcHRvcnMgZm9yIHRoaXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGxhcmdlIGEgYnVmZmVyICovCisgICAgeworICAgICAgICBpZiAobG9nX2xldmVsID49IExPR19ERUJVRykKKyAgICAgICAgeworICAgICAgICAgICAgcHJfaW5mbygic3RhcnRfeG1pdDogZGlzY2FyZGluZyBidWZmZXIsIGluc3VmZmljaWVudCBkZXNjcmlwdG9yIGNudCAlZCwgbmVlZCAlZC5cbiIsCisgICAgICAgICAgICAgICAgICAgIGNoLT50eGRfbnVtLCB0eGRfbmVlZF9jbnQgKyAxKTsKKyAgICAgICAgfQorICAgICAgICBjaC0+cy50eF9kcm9wcGVkKys7CisgICAgICAgIE9TX21lbV90b2tlbl9mcmVlIChtZW1fdG9rZW4pOworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisjaWYgMAorICAgIHNwaW5fbG9ja19pcnFzYXZlICgmY2gtPmNoX3R4bG9jaywgZmxhZ3MpOworI2VuZGlmCisgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyAgICAvKiogZmxvdyBjb250cm9sIHRoZSBsaW5lIGlmIG5vdCBlbm91Z2ggZGVzY3JpcHRvcnMgcmVtYWluICoqLworICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgaWYgKHR4ZF9uZWVkX2NudCA+IGNoLT50eGRfZnJlZSkKKyAgICB7CisgICAgICAgIGlmIChsb2dfbGV2ZWwgPj0gTE9HX01PTklUT1IyKQorICAgICAgICB7CisgICAgICAgICAgICBwcl9pbmZvKCJzdGFydF94bWl0WyVkXTogRUJVU1kgLSBuZWVkIG1vcmUgZGVzY3JpcHRvcnMsIGhhdmUgJWQgb2YgJWQgbmVlZCAlZFxuIiwKKyAgICAgICAgICAgICAgICAgICAgY2hhbm51bSwgY2gtPnR4ZF9mcmVlLCBjaC0+dHhkX251bSwgdHhkX25lZWRfY250KTsKKyAgICAgICAgfQorICAgICAgICBjaC0+dHhfZnVsbCA9IDE7CisgICAgICAgIGNoLT50eGRfcmVxdWlyZWQgPSB0eGRfbmVlZF9jbnQ7CisgICAgICAgIHNkX2Rpc2FibGVfeG1pdCAoY2gtPnVzZXIpOworI2lmIDAKKyAgICAgICAgc3Bpbl91bmxvY2tfaXJxcmVzdG9yZSAoJmNoLT5jaF90eGxvY2ssIGZsYWdzKTsKKyNlbmRpZgorICAgICAgICByZXR1cm4gRUJVU1k7ICAgICAgICAgICAgICAgLyogdGVsbCB1c2VyIHRvIHRyeSBhZ2FpbiBsYXRlciAqLworICAgIH0KKyAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgLyoqIFB1dCB0aGUgdXNlciBkYXRhIGludG8gTVVTWUNDIGRhdGEgYnVmZmVyKHMpICoqLworICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyAgICBtMiA9IG1lbV90b2tlbjsKKyAgICBtZCA9IGNoLT50eGRfdXNyX2FkZDsgICAgICAgICAgIC8qIGdldCBjdXJyZW50IGF2YWlsYWJsZSBkZXNjcmlwdG9yICovCisKKyAgICBmb3IgKGxlbiA9IE9TX21lbV90b2tlbl90bGVuIChtMik7IGxlbiA+IDA7IG0yID0gT1NfbWVtX3Rva2VuX25leHQgKG0yKSkKKyAgICB7CisgICAgICAgIGludCAgICAgICAgIHUgPSBPU19tZW1fdG9rZW5fbGVuIChtMik7CisKKyAgICAgICAgaWYgKCF1KQorICAgICAgICAgICAgY29udGludWU7CisgICAgICAgIGxlbiAtPSB1OworCisgICAgICAgIC8qCisgICAgICAgICAqIEVuYWJsZSBmb2xsb3dpbmcgY2h1bmtzLCB5ZXQgd2FpdCB0byBlbmFibGUgdGhlIEZJUlNUIGNodW5rIHVudGlsCisgICAgICAgICAqIGFmdGVyIEFMTCBzdWJzZXF1ZW50IGNodW5rcyBhcmUgc2V0dXAuCisgICAgICAgICAqLworICAgICAgICBpZiAobWQgIT0gY2gtPnR4ZF91c3JfYWRkKSAgLyogbm90IGZpcnN0IGNodW5rICovCisgICAgICAgICAgICB1IHw9IE1VU1lDQ19UWF9PV05FRDsgICAvKiB0cmFuc2ZlciBvd25lcnNoaXAgZnJvbSBIT1NUIHRvIE1VU1lDQyAqLworCisgICAgICAgIGlmIChsZW4pICAgICAgICAgICAgICAgICAgICAvKiBub3QgbGFzdCBjaHVuayAqLworICAgICAgICAgICAgdSB8PSBFT0JJUlFfRU5BQkxFOworICAgICAgICBlbHNlIGlmIChjaC0+cC5jaGFuX21vZGUgPT0gQ0ZHX0NIX1BST1RPX1RSQU5TKQorICAgICAgICB7CisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogUGVyIE1VU1lDQyBSZWYgNi40LjkgZm9yIFRyYW5zcGFyZW50IE1vZGUsIHRoZSBob3N0IG11c3QKKyAgICAgICAgICAgICAqIGFsd2F5cyBjbGVhciBFT01JUlFfRU5BQkxFIGluIGV2ZXJ5IFRyYW5zbWl0IEJ1ZmZlciBEZXNjcmlwdG9yCisgICAgICAgICAgICAgKiAoSUUuIGRvbid0IHNldCBoZXJlaW4pLgorICAgICAgICAgICAgICovCisgICAgICAgICAgICB1IHw9IEVPQklSUV9FTkFCTEU7CisgICAgICAgIH0gZWxzZQorICAgICAgICAgICAgdSB8PSBFT01JUlFfRU5BQkxFOyAgICAgLyogRU9NLCBsYXN0IEhETEMgY2h1bmsgKi8KKworCisgICAgICAgIC8qIGxhc3QgY2h1bmsgaW4gaGRsYyBtb2RlICovCisgICAgICAgIHUgfD0gKGNoLT5wLmlkbGVjb2RlIDw8IElETEVfQ09ERSk7CisgICAgICAgIGlmIChjaC0+cC5wYWRfZmlsbF9jb3VudCkKKyAgICAgICAgeworI2lmIDAKKyAgICAgICAgICAgIC8qIE5PT1AgTk9URTogdV9pbnQ4X3QgY2Fubm90IGJlID4gMHhGRiAqLworICAgICAgICAgICAgLyogc2FuaXRpemUgcGFkX2ZpbGxfY291bnQgZm9yIG1heGltdW1zIGFsbG93ZWQgYnkgaGFyZHdhcmUgKi8KKyAgICAgICAgICAgIGlmIChjaC0+cC5wYWRfZmlsbF9jb3VudCA+IEVYVFJBX0ZMQUdTX01BU0spCisgICAgICAgICAgICAgICAgY2gtPnAucGFkX2ZpbGxfY291bnQgPSBFWFRSQV9GTEFHU19NQVNLOworI2VuZGlmCisgICAgICAgICAgICB1IHw9IChQQURGSUxMX0VOQUJMRSB8IChjaC0+cC5wYWRfZmlsbF9jb3VudCA8PCBFWFRSQV9GTEFHUykpOworICAgICAgICB9CisgICAgICAgIG1kLT5tZW1fdG9rZW4gPSBsZW4gPyAwIDogbWVtX3Rva2VuOyAgICAvKiBGaWxsIGluIG1kcyBvbiBsYXN0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBzZWdtZW50LCBvdGhlcnMgc2V0IFpFUk8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHNvIHRoYXQgZW50aXJlIHRva2VuIGlzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiByZW1vdmVkIE9OTFkgd2hlbiBBTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHNlZ21lbnRzIGhhdmUgYmVlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogdHJhbnNtaXR0ZWQuICovCisKKyAgICAgICAgbWQtPmRhdGEgPSBjcHVfdG9fbGUzMiAoT1NfdnRvcGh5cyAoT1NfbWVtX3Rva2VuX2RhdGEgKG0yKSkpOworICAgICAgICBGTFVTSF9NRU1fV1JJVEUgKCk7CisgICAgICAgIG1kLT5zdGF0dXMgPSBjcHVfdG9fbGUzMiAodSk7CisgICAgICAgIC0tY2gtPnR4ZF9mcmVlOworICAgICAgICBtZCA9IG1kLT5zbmV4dDsKKyAgICB9CisgICAgRkxVU0hfTUVNX1dSSVRFICgpOworCisKKyAgICAvKgorICAgICAqIE5vdyB0cmFuc2ZlciBvd25lcnNoaXAgb2YgZmlyc3QgY2h1bmsgZnJvbSBIT1NUIHRvIE1VU1lDQyBpbiBvcmRlciB0bworICAgICAqIGZpcmUtb2ZmIHRoaXMgWE1JVC4KKyAgICAgKi8KKyAgICBjaC0+dHhkX3Vzcl9hZGQtPnN0YXR1cyB8PSBfX2NvbnN0YW50X2NwdV90b19sZTMyIChNVVNZQ0NfVFhfT1dORUQpOworICAgIEZMVVNIX01FTV9XUklURSAoKTsKKyAgICBjaC0+dHhkX3Vzcl9hZGQgPSBtZDsKKworICAgIGxlbiA9IE9TX21lbV90b2tlbl90bGVuIChtZW1fdG9rZW4pOworICAgIGF0b21pY19hZGQgKGxlbiwgJmNoLT50eF9wZW5kaW5nKTsKKyAgICBhdG9taWNfYWRkIChsZW4sICZjaS0+dHhfcGVuZGluZyk7CisgICAgY2gtPnMudHhfcGFja2V0cysrOworICAgIGNoLT5zLnR4X2J5dGVzICs9IGxlbjsKKyNpZiAwCisgICAgc3Bpbl91bmxvY2tfaXJxcmVzdG9yZSAoJmNoLT5jaF90eGxvY2ssIGZsYWdzKTsgICAvKiBhbGxvdyBwZW5kaW5nCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBpbnRlcnJ1cHQgdG8gc25lYWsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHRocnUgKi8KKyNlbmRpZgorCisgICAgLyoKKyAgICAgKiBJZiBhbiBPTlIgd2FzIHNlZW4sIHRoZW4gY2hhbm5lbCByZXF1aXJlcyBwb2tpbmcgdG8gcmVzdGFydAorICAgICAqIHRyYW5zbWlzc2lvbi4KKyAgICAgKi8KKyAgICBpZiAoY2gtPmNoX3N0YXJ0X3R4KQorICAgIHsKKyNpZiBMSU5VWF9WRVJTSU9OX0NPREUgPD0gS0VSTkVMX1ZFUlNJT04oMiw1LDQxKQorICAgICAgICBTRF9TRU1fVEFLRSAoJmNpLT5zZW1fd2RidXN5LCAiX3dkXyIpOyAgLyogb25seSAxIHRocnUgaGVyZSwgcGVyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBib2FyZCAqLworICAgICAgICBpZiAoKGNoLT5jaF9zdGFydF90eCA9PSBDSF9TVEFSVF9UWF9PTlIpICYmIChjaC0+cC5jaGFuX21vZGUgPT0gQ0ZHX0NIX1BST1RPX1RSQU5TKSkKKyAgICAgICAgeworICAgICAgICAgICAgLyogT05SIHJlc3RhcnQgdHJhbnNtaXNzaW9uIGZyb20gYmFja2dyb3VuZCBsb29wICovCisgICAgICAgICAgICBjaS0+d2Rfbm90aWZ5ID0gV0RfTk9USUZZX09OUjsgICAgICAvKiBlbmFibGVkIGdsb2JhbCB3YXRjaGRvZworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogc2Nhbi10aHJ1ICAqLworICAgICAgICB9IGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLyogc3RhcnQgZmlyc3QgdHJhbnNtaXNzaW9uIGZyb20gYmFja2dyb3VuZCBsb29wICovCisgICAgICAgICAgICBjaS0+d2Rfbm90aWZ5ID0gV0RfTk9USUZZXzFUWDsgICAgICAvKiBlbmFibGVkIGdsb2JhbCB3YXRjaGRvZworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogc2Nhbi10aHJ1ICAqLworICAgICAgICB9CisgICAgICAgIG11c3ljY19jaGFuX3Jlc3RhcnQgKGNoKTsKKyAgICAgICAgU0RfU0VNX0dJVkUgKCZjaS0+c2VtX3dkYnVzeSk7CisjZWxzZQorICAgICAgICBtdXN5Y2NfY2hhbl9yZXN0YXJ0IChjaCk7CisjZW5kaWYKKyAgICB9CisjaWZkZWYgU0JFX1dBTjI1NlQzX0VOQUJMRQorICAgIHdhbjI1NnQzX2xlZCAoY2ksIExFRF9UWCwgTEVEVl9HKTsKKyNlbmRpZgorICAgIHJldHVybiAwOworfQorCisKKyNpZiAwCitpbnQKK211c3ljY19zZXRfY2hhbiAoY2lfdCAqIGNpLCBpbnQgY2hhbm51bSwgc3RydWN0IHNiZWNvbV9jaGFuX3BhcmFtICogcCkKK3sKKyAgICBtY2hfdCAgICAgICpjaDsKKyAgICBpbnQgICAgICAgICByb2sgPSAwOworICAgIGludCAgICAgICAgIG4gPSAwOworCisgICAgaWYgKGNoYW5udW0gPCAwIHx8IGNoYW5udW0gPj0gKE1VU1lDQ19OUE9SVFMgKiBNVVNZQ0NfTkNIQU5TKSkgICAgICAvKiBzYW5pdHkgY2hrIHBhcmFtICovCisgICAgICAgIHJldHVybiBFQ0hSTkc7CisgICAgaWYgKCEoY2ggPSBzZF9maW5kX2NoYW4gKGNpLCBjaGFubnVtKSkpCisgICAgICAgIHJldHVybiBFTk9FTlQ7CisgICAgaWYgKGNoLT5jaGFubnVtICE9IHAtPmNoYW5udW0pCisgICAgICAgIHJldHVybiBFSU5WQUw7CisgICAgaWYgKHNkX2xpbmVfaXNfb2sgKGNoLT51c2VyKSkKKyAgICB7CisgICAgICAgIHJvayA9IDE7CisgICAgICAgIHNkX2xpbmVfaXNfZG93biAoY2gtPnVzZXIpOworICAgIH0KKyAgICBpZiAoY2gtPnN0YXRlID09IFVQICYmICAgICAgICAgIC8qIGJyaW5nIGRvd24gaW4gY3VycmVudCBjb25maWd1cmF0aW9uICovCisgICAgICAgIChjaC0+cC5zdGF0dXMgIT0gcC0+c3RhdHVzIHx8CisgICAgICAgICBjaC0+cC5jaGFuX21vZGUgIT0gcC0+Y2hhbl9tb2RlIHx8CisgICAgICAgICBjaC0+cC5pbnRyX21hc2sgIT0gcC0+aW50cl9tYXNrIHx8CisgICAgICAgICBjaC0+dHhkX2ZyZWUgPCBjaC0+dHhkX251bSkpCisgICAgeworICAgICAgICBpZiAoKG4gPSBtdXN5Y2NfY2hhbl9kb3duIChjaSwgY2hhbm51bSkpKQorICAgICAgICAgICAgcmV0dXJuIG47CisgICAgICAgIGlmIChjaC0+cC5tb2RlXzU2ayAhPSBwLT5tb2RlXzU2aykKKyAgICAgICAgeworICAgICAgICAgICAgY2gtPnAgPSAqcDsgICAgICAgICAgICAgLyogY29weSBpbiBuZXcgcGFyYW1ldGVycyAqLworICAgICAgICAgICAgbXVzeWNjX3VwZGF0ZV90aW1lc2xvdHMgKCZjaS0+cG9ydFtjaC0+Y2hhbm51bSAvIE1VU1lDQ19OQ0hBTlNdKTsKKyAgICAgICAgfSBlbHNlCisgICAgICAgICAgICBjaC0+cCA9ICpwOyAgICAgICAgICAgICAvKiBjb3B5IGluIG5ldyBwYXJhbWV0ZXJzICovCisgICAgICAgIGlmICgobiA9IG11c3ljY19jaGFuX3VwIChjaSwgY2hhbm51bSkpKQorICAgICAgICAgICAgcmV0dXJuIG47CisgICAgICAgIHNkX2VuYWJsZV94bWl0IChjaC0+dXNlcik7ICAvKiByZS1lbmFibGUgdG8gY2F0Y2ggZmxvdyBjb250cm9sbGVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBjaGFubmVsICovCisgICAgfSBlbHNlCisgICAgeworICAgICAgICBpZiAoY2gtPnAubW9kZV81NmsgIT0gcC0+bW9kZV81NmspCisgICAgICAgIHsKKyAgICAgICAgICAgIGNoLT5wID0gKnA7ICAgICAgICAgICAgIC8qIGNvcHkgaW4gbmV3IHBhcmFtZXRlcnMgKi8KKyAgICAgICAgICAgIG11c3ljY191cGRhdGVfdGltZXNsb3RzICgmY2ktPnBvcnRbY2gtPmNoYW5udW0gLyBNVVNZQ0NfTkNIQU5TXSk7CisgICAgICAgIH0gZWxzZQorICAgICAgICAgICAgY2gtPnAgPSAqcDsgICAgICAgICAgICAgLyogY29weSBpbiBuZXcgcGFyYW1ldGVycyAqLworICAgIH0KKworICAgIGlmIChyb2spCisgICAgICAgIHNkX2xpbmVfaXNfdXAgKGNoLT51c2VyKTsKKyAgICByZXR1cm4gMDsKK30KKyNlbmRpZgorCisKK2ludAorbXVzeWNjX2dldF9jaGFuIChjaV90ICogY2ksIGludCBjaGFubnVtLCBzdHJ1Y3Qgc2JlY29tX2NoYW5fcGFyYW0gKiBwKQoreworICAgIG1jaF90ICAgICAgKmNoOworCisjaWYgMAorICAgIGlmIChjaGFubnVtIDwgMCB8fCBjaGFubnVtID49IChNVVNZQ0NfTlBPUlRTICogTVVTWUNDX05DSEFOUykpICAgICAgLyogc2FuaXR5IGNoayBwYXJhbSAqLworICAgICAgICByZXR1cm4gRUNIUk5HOworI2VuZGlmCisgICAgaWYgKCEoY2ggPSBzZF9maW5kX2NoYW4gKGNpLCBjaGFubnVtKSkpCisgICAgICAgIHJldHVybiBFTk9FTlQ7CisgICAgKnAgPSBjaC0+cDsKKyAgICByZXR1cm4gMDsKK30KKworCitpbnQKK211c3ljY19nZXRfY2hhbl9zdGF0cyAoY2lfdCAqIGNpLCBpbnQgY2hhbm51bSwgc3RydWN0IHNiZWNvbV9jaGFuX3N0YXRzICogcCkKK3sKKyAgICBtY2hfdCAgICAgICpjaDsKKworICAgIGlmIChjaGFubnVtIDwgMCB8fCBjaGFubnVtID49IChNVVNZQ0NfTlBPUlRTICogTVVTWUNDX05DSEFOUykpICAgICAgLyogc2FuaXR5IGNoayBwYXJhbSAqLworICAgICAgICByZXR1cm4gRUNIUk5HOworICAgIGlmICghKGNoID0gc2RfZmluZF9jaGFuIChjaSwgY2hhbm51bSkpKQorICAgICAgICByZXR1cm4gRU5PRU5UOworICAgICpwID0gY2gtPnM7CisgICAgcC0+dHhfcGVuZGluZyA9IGF0b21pY19yZWFkICgmY2gtPnR4X3BlbmRpbmcpOworICAgIHJldHVybiAwOworfQorCisKKworI2lmZGVmIFNCRV9XQU4yNTZUM19FTkFCTEUKK2ludAorbXVzeWNjX2NoYW5fZG93biAoY2lfdCAqIGNpLCBpbnQgY2hhbm51bSkKK3sKKyAgICBtY2hfdCAgICAgICpjaDsKKyAgICBtcGlfdCAgICAgICpwaTsKKyAgICBpbnQgICAgICAgICBpLCBnY2hhbjsKKworICAgIGlmICghKGNoID0gc2RfZmluZF9jaGFuIChjaSwgY2hhbm51bSkpKQorICAgICAgICByZXR1cm4gRUlOVkFMOworICAgIHBpID0gY2gtPnVwOworICAgIGdjaGFuID0gY2gtPmdjaGFuOworCisgICAgLyogRGVhY3RpdmF0ZSB0aGUgY2hhbm5lbCAqLworICAgIG11c3ljY19zZXJ2X3JlcSAocGksIFNSX0NIQU5ORUxfREVBQ1RJVkFURSB8IFNSX1JYX0RJUkVDVElPTiB8IGdjaGFuKTsKKyAgICBjaC0+Y2hfc3RhcnRfcnggPSAwOworICAgIG11c3ljY19zZXJ2X3JlcSAocGksIFNSX0NIQU5ORUxfREVBQ1RJVkFURSB8IFNSX1RYX0RJUkVDVElPTiB8IGdjaGFuKTsKKyAgICBjaC0+Y2hfc3RhcnRfdHggPSAwOworCisgICAgaWYgKGNoLT5zdGF0ZSA9PSBET1dOKQorICAgICAgICByZXR1cm4gMDsKKyAgICBjaC0+c3RhdGUgPSBET1dOOworCisgICAgcGktPnJlZ3JhbS0+dGhwW2djaGFuXSA9IDA7CisgICAgcGktPnJlZ3JhbS0+dG1wW2djaGFuXSA9IDA7CisgICAgcGktPnJlZ3JhbS0+cmhwW2djaGFuXSA9IDA7CisgICAgcGktPnJlZ3JhbS0+cm1wW2djaGFuXSA9IDA7CisgICAgRkxVU0hfTUVNX1dSSVRFICgpOworICAgIGZvciAoaSA9IDA7IGkgPCBjaC0+dHhkX251bTsgaSsrKQorICAgIHsKKyAgICAgICAgaWYgKGNoLT5tZHRbaV0ubWVtX3Rva2VuICE9IDApCisgICAgICAgICAgICBPU19tZW1fdG9rZW5fZnJlZSAoY2gtPm1kdFtpXS5tZW1fdG9rZW4pOworICAgIH0KKworICAgIGZvciAoaSA9IDA7IGkgPCBjaC0+cnhkX251bTsgaSsrKQorICAgIHsKKyAgICAgICAgaWYgKGNoLT5tZHJbaV0ubWVtX3Rva2VuICE9IDApCisgICAgICAgICAgICBPU19tZW1fdG9rZW5fZnJlZSAoY2gtPm1kcltpXS5tZW1fdG9rZW4pOworICAgIH0KKworICAgIE9TX2tmcmVl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tMzBdICAgICAgICAgKi8KKyAgICAgICAgVklOVDggICAgICAgdHRzbVsxMjhdOyAgLyogVGltZSBTbG90IE1hcCBbNS0yMl0gICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgVklOVDggICAgICAgdHNjbVsyNTZdOyAgLyogU3ViY2hhbm5lbCBNYXAgWzUtMjRdICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgVklOVDMyICAgICAgdGNjdFszMl07ICAgLyogQ2hhbm5lbCBDb25maWd1cmF0aW9uIFs1LTI2XSAgICAgICAgICAgKi8KKyAgICAgICAgVklOVDggICAgICAgcnRzbVsxMjhdOyAgLyogVGltZSBTbG90IE1hcCBbNS0yMl0gICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgVklOVDggICAgICAgcnNjbVsyNTZdOyAgLyogU3ViY2hhbm5lbCBNYXAgWzUtMjRdICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgVklOVDMyICAgICAgcmNjdFszMl07ICAgLyogQ2hhbm5lbCBDb25maWd1cmF0aW9uIFs1LTI2XSAgICAgICAgICAgKi8KKyAgICAgICAgVklOVDMyICAgICAgX19nbGNkOyAgICAgLyogR2xvYmFsIENvbmZpZ3VyYXRpb24gRGVzY3JpcHRvciBbNS0xMF0gKi8KKyAgICAgICAgVklOVDMyICAgICAgX19pcXA7ICAgICAgLyogSW50ZXJydXB0IFF1ZXVlIFBvaW50ZXIgWzUtMzZdICAgICAgICAgKi8KKyAgICAgICAgVklOVDMyICAgICAgX19pcWw7ICAgICAgLyogSW50ZXJydXB0IFF1ZXVlIExlbmd0aCBbNS0zNl0gICAgICAgICAgKi8KKyAgICAgICAgVklOVDMyICAgICAgZ3JjZDsgICAgICAgLyogR3JvdXAgQ29uZmlndXJhdGlvbiBEZXNjcmlwdG9yIFs1LTE2XSAgKi8KKyAgICAgICAgVklOVDMyICAgICAgbXBkOyAgICAgICAgLyogTWVtb3J5IFByb3RlY3Rpb24gRGVzY3JpcHRvciBbNS0xOF0gICAgKi8KKyAgICAgICAgVklOVDMyICAgICAgbWxkOyAgICAgICAgLyogTWVzc2FnZSBMZW5ndGggRGVzY3JpcHRvciBbNS0yMF0gICAgICAgKi8KKyAgICAgICAgVklOVDMyICAgICAgcGNkOyAgICAgICAgLyogUG9ydCBDb25maWd1cmF0aW9uIERlc2NyaXB0b3IgWzUtMTldICAgKi8KKyAgICB9OworCisvKiBoYXJkd2FyZSBNVVNZQ0MgcmVnaXN0ZXJzIGxheWVkIG91dCBhcyBhIEMgc3RydWN0dXJlICovCisgICAgc3RydWN0IG11c3ljY19nbG9iYWxyCisgICAgeworICAgICAgICBWSU5UMzIgICAgICBnYnA7ICAgICAgICAvKiBHcm91cCBCYXNlIFBvaW50ZXIgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICBWSU5UMzIgICAgICBkYWNicDsgICAgICAvKiBEdWFsIEFkZHJlc3MgQ3ljbGUgQmFzZSBQb2ludGVyICAgICAgICAqLworICAgICAgICBWSU5UMzIgICAgICBzcmQ7ICAgICAgICAvKiBTZXJ2aWNlIFJlcXVlc3QgRGVzY3JpcHRvciAgICAgICAgICAgICAqLworICAgICAgICBWSU5UMzIgICAgICBpc2Q7ICAgICAgICAvKiBJbnRlcnJ1cHQgU2VydmljZSBEZXNjcmlwdG9yICAgICAgICAgICAqLworICAgICAgICAvKgorICAgICAgICAgKiBhZGp1c3QgX190aHAgZHVlIHRvIGFib3ZlIDQgcmVnaXN0ZXJzLCB3aGljaCBhcmUgbm90IGNvbnRhaW5lZAorICAgICAgICAgKiB3aXRoaW4gbXVzeWNjX2dyb3VwcltdLiBBbGwgX19YWFhbXSBhcmUganVzdCBwbGFjZSBob2xkZXJzLAorICAgICAgICAgKiBhbnlob3cuCisgICAgICAgICAqLworICAgICAgICBWSU5UMzIgICAgICBfX3RocFszMiAtIDRdOyAgICAgIC8qIFRyYW5zbWl0IEhlYWQgUG9pbnRlciBbNS0yOV0gICAgICAgICAgICovCisgICAgICAgIFZJTlQzMiAgICAgIF9fdG1wWzMyXTsgIC8qIFRyYW5zbWl0IE1lc3NhZ2UgUG9pbnRlciBbNS0zMF0gICAgICAgICovCisgICAgICAgIFZJTlQzMiAgICAgIF9fcmhwWzMyXTsgIC8qIFJlY2VpdmUgSGVhZCBQb2ludGVyIFs1LTI5XSAgICAgICAgICAgICovCisgICAgICAgIFZJTlQzMiAgICAgIF9fcm1wWzMyXTsgIC8qIFJlY2VpdmUgTWVzc2FnZSBQb2ludGVyIFs1LTMwXSAgICAgICAgICovCisgICAgICAgIFZJTlQ4ICAgICAgIHR0c21bMTI4XTsgIC8qIFRpbWUgU2xvdCBNYXAgWzUtMjJdICAgICAgICAgICAgICAgICAgICovCisgICAgICAgIFZJTlQ4ICAgICAgIHRzY21bMjU2XTsgIC8qIFN1YmNoYW5uZWwgTWFwIFs1LTI0XSAgICAgICAgICAgICAgICAgICovCisgICAgICAgIFZJTlQzMiAgICAgIHRjY3RbMzJdOyAgIC8qIENoYW5uZWwgQ29uZmlndXJhdGlvbiBbNS0yNl0gICAgICAgICAgICovCisgICAgICAgIFZJTlQ4ICAgICAgIHJ0c21bMTI4XTsgIC8qIFRpbWUgU2xvdCBNYXAgWzUtMjJdICAgICAgICAgICAgICAgICAgICovCisgICAgICAgIFZJTlQ4ICAgICAgIHJzY21bMjU2XTsgIC8qIFN1YmNoYW5uZWwgTWFwIFs1LTI0XSAgICAgICAgICAgICAgICAgICovCisgICAgICAgIFZJTlQzMiAgICAgIHJjY3RbMzJdOyAgIC8qIENoYW5uZWwgQ29uZmlndXJhdGlvbiBbNS0yNl0gICAgICAgICAgICovCisgICAgICAgIFZJTlQzMiAgICAgIGdsY2Q7ICAgICAgIC8qIEdsb2JhbCBDb25maWd1cmF0aW9uIERlc2NyaXB0b3IgWzUtMTBdICovCisgICAgICAgIFZJTlQzMiAgICAgIGlxcDsgICAgICAgIC8qIEludGVycnVwdCBRdWV1ZSBQb2ludGVyIFs1LTM2XSAgICAgICAgICovCisgICAgICAgIFZJTlQzMiAgIC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gwMDAwMDAwNCAgICAgIC8qIFBDSSBJTlRCIGRpc2FibGUgKi8KKyNkZWZpbmUgTVVTWUNDX0dDRF9CTEFQU0UgICAgICAgMTIgICAgICAvKiBQb3NpdGlvbiBpbmRleCBmb3IgQkxBUFNFIGJpdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGZpZWxkICovCisjZGVmaW5lIE1VU1lDQ19HQ0RfQUxBUFNFICAgICAgIDggICAgICAgLyogUG9zaXRpb24gaW5kZXggZm9yIEFMQVBTRSBiaXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBmaWVsZCAqLworI2RlZmluZSBNVVNZQ0NfR0NEX0VMQVBTRSAgICAgICA0ICAgICAgIC8qIFBvc2l0aW9uIGluZGV4IGZvciBFTEFQU0UgYml0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogZmllbGQgKi8KKyNkZWZpbmUgTVVTWUNDX0dDRF9QT1JUTUFQXzMgICAgMyAgICAgICAvKiBSZXNlcnZlZCAqLworI2RlZmluZSBNVVNZQ0NfR0NEX1BPUlRNQVBfMiAgICAyICAgICAgIC8qIFBvcnQgMD0+R3JwIDAsMSwyLDM7IFBvcnQgMT0+R3JwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogNCw1LDYsNyAqLworI2RlZmluZSBNVVNZQ0NfR0NEX1BPUlRNQVBfMSAgICAxICAgICAgIC8qIFBvcnQgMD0+R3JwIDAsMTsgUG9ydCAxPT5HcnAgMiwzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGV0Yy4uLiAqLworI2RlZmluZSBNVVNZQ0NfR0NEX1BPUlRNQVBfMCAgICAwICAgICAgIC8qIFBvcnQgMD0+R3JwIDA7IFBvcnQgMT0+R3JwIDIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogZXRjLi4uICovCisKKy8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B0cmFuc21pdCBwcm9jZXNzaW5nICovCisjZGVmaW5lIE1VU1lDQ19HUkNEX1NVQkNIQU5fRElTQUJMRSAweDAwMDAwMDA0ICAvKiBNYXN0ZXIgZGlzYWJsZSBmb3IKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHN1YmNoYW5uZWxpbmcgKi8KKyNkZWZpbmUgTVVTWUNDX0dSQ0RfT09GTVBfRElTQUJMRSAgIDB4MDAwMDAwMDggIC8qIE91dCBvZiBGcmFtZSBtZXNzYWdlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBwcm9jZXNzaW5nIGRpc2FibGVkIGFsbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogY2hhbm5lbHMgKi8KKyNkZWZpbmUgTVVTWUNDX0dSQ0RfT09GSVJRX0RJU0FCTEUgIDB4MDAwMDAwMTAgIC8qIE91dCBvZiBGcmFtZS9JbiBGcmFtZSBpcnFzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBkaXNhYmxlZCAqLworI2RlZmluZSBNVVNZQ0NfR1JDRF9DT0ZBSVJRX0RJU0FCTEUgMHgwMDAwMDAyMCAgLyogQ2hhbmdlIG9mIEZyYW1lIEFsaWdubWVudAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogaXJxIGRpc2FibGVkICovCisjZGVmaW5lIE1VU1lDQ19HUkNEX0lOSFJCU0QgICAgICAgICAweDAwMDAwMTAwICAvKiBSZWNlaXZlIEJ1ZmZlciBTdGF0dXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIG92ZXJ3cml0ZSBkaXNhYmxlZCAqLworI2RlZmluZSBNVVNZQ0NfR1JDRF9JTkhUQlNEICAgICAgICAgMHgwMDAwMDIwMCAgLyogVHJhbnNtaXQgQnVmZmVyIFN0YXR1cworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogb3ZlcndyaXRlIGRpc2FibGVkICovCisjZGVmaW5lIE1VU1lDQ19HUkNEX1NGX0FMSUdOICAgICAgICAweDAwMDA4MDAwICAvKiBFeHRlcm5hbCBmcmFtZSBzeW5jICovCisjZGVmaW5lIE1VU1lDQ19HUkNEX01DX0VOQUJMRSAgICAgICAweDAwMDAwMDQwICAvKiBNZXNzYWdlIGNvbmZpZ3VyYXRpb24gYml0cworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogY29weSBlbmFibGUuIENvbmV4YW50IHNlegorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogdHVybiB0aGlzIG9uICovCisjZGVmaW5lIE1VU1lDQ19HUkNEX1BPTExUSF8xNiAgICAgICAweDAwMDAwMDAxICAvKiBQb2xsIGV2ZXJ5IDE2dGggZnJhbWUgKi8KKyNkZWZpbmUgTVVTWUNDX0dSQ0RfUE9MTFRIXzMyICAgICAgIDB4MDAwMDAwMDIgIC8qIFBvbGwgZXZlcnkgMzJuZCBmcmFtZSAqLworI2RlZmluZSBNVVNZQ0NfR1JDRF9QT0xMVEhfNjQgICAgICAgMHgwMDAwMDAwMyAgLyogUG9sbCBldmVyeSA2NHRoIGZyYW1lICovCisjZGVmaW5lIE1VU1lDQ19HUkNEX1BPTExUSF9TSElGVCAgICAxMCAgLyogUG9zaXRpb24gaW5kZXggZm9yIHBvbGwgdGhyb3R0bGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBiaXQgZmllbGQgKi8KKyNkZWZpbmUgTVVTWUNDX0dSQ0RfU1VFUk1fVEhSRVNIX1NISUZUIDE2ICAgICAgIC8qIFBvc2l0aW9uIGluZGV4IGZvciBTVUVSTQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogY291bnQgdGhyZXNob2xkICovCisKKy8qIFBvcnQgQ29uZmlnIERlc2NyaXB0b3IgYml0IG1hY3JvcyAqLworI2RlZmluZSBNVVNZQ0NfUENEX0UxWDJfTU9ERSAgICAgICAyICAgIC8qIFBvcnQgbW9kZSBpbiBiaXRzIDAtMi4gVDEgYW5kIEUxICovCisjZGVmaW5lIE1VU1lDQ19QQ0RfRTFYNF9NT0RFICAgICAgIDMgICAgLyogYXJlIGRlZmluZWQgaW4gY244NDd4LmggKi8KKyNkZWZpbmUgTVVTWUNDX1BDRF9OWDY0X01PREUgICAgICAgNAorI2RlZmluZSBNVVNZQ0NfUENEX1RYREFUQV9SSVNJTkcgICAweDAwMDAwMDEwICAgLyogU2FtcGxlIFR4IGRhdGEgb24gVENMSworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogcmlzaW5nIGVkZ2UgKi8KKyNkZWZpbmUgTVVTWUNDX1BDRF9UWFNZTkNfUklTSU5HICAgMHgwMDAwMDAyMCAgIC8qIFNhbXBsZSBUeCBmcmFtZSBzeW5jIG9uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBUQ0xLIHJpc2luZyBlZGdlICovCisjZGVmaW5lIE1VU1lDQ19QQ0RfUlhEQVRBX1JJU0lORyAgIDB4MDAwMDAwNDAgICAvKiBTYW1wbGUgUnggZGF0YSBvbiBSQ0xLCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiByaXNpbmcgZWRnZSAqLworI2RlZmluZSBNVVNZQ0NfUENEX1JYU1lOQ19SSVNJTkcgICAweDAwMDAwMDgwICAgLyogU2FtcGxlIFJ4IGZyYW1lIHN5bmMgb24KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIFJDTEsgcmlzaW5nIGVkZ2UgKi8KKyNkZWZpbmUgTVVTWUNDX1BDRF9ST09GX1JJU0lORyAgICAgMHgwMDAwMDEwMCAgIC8qIFNhbXBsZSBSeCBPdXQgT2YgRnJhbWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHNpZ25hbCBvbiBSQ0xLIHJpc2luZyBlZGdlICovCisjZGVmaW5lIE1VU1lDQ19QQ0RfVFhfRFJJVkVOICAgICAgIDB4MDAwMDAyMDAgICAvKiBObyBtYXBwZWQgdGltZXNsb3RzIGNhdXNlcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogbG9naWMgMSBvbiBvdXRwdXQsIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHRyaXN0YXRlICovCisjZGVmaW5lIE1VU1lDQ19QQ0RfUE9SVE1PREVfTUFTSyAgIDB4ZmZmZmZmZjggICAvKiBGb3IgY2hhbmdpbmcgdGhlIHBvcnQgbW9kZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogYmV0d2VlbiBFMSBhbmQgVDEgKi8KKworLyogVGltZSBTbG90IERlc2NyaXB0b3IgYml0IG1hY3JvcyAqLworI2RlZmluZSBNVVNZQ0NfVFNEX01PREVfNjRLQlBTICAgICAgICAgICAgICA0CisjZGVmaW5lIE1VU1lDQ19UU0RfTU9ERV81NktCUFMgICAgICAgICAgICAgIDUKKyNkZWZpbmUgTVVTWUNDX1RTRF9TVUJDSEFOTkVMX1dPX0ZJUlNUICAgICAgNgorI2RlZmluZSBNVVNZQ0NfVFNEX1NVQkNIQU5ORUxfV0lUSF9GSVJTVCAgICA3CisKKy8qIE1lc3NhZ2UgRGVzY3JpcHRvciBiaXQgbWFjcm9zICovCisjZGVmaW5lIE1VU1lDQ19NRFRfQkFTRTAzX0FERFIgICAgIDB4MDAwMDYwMDAKKworLyogQ2hhbm5lbCBDb25maWcgRGVzY3Jp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G9uZyB3aXRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiByZWNlaXZlZCBkYXRhICovCisjZGVmaW5lIE1VU1lDQ19DQ0RfUFJPVE9fU0hJRlQgICAgIDEyICAgLyogUG9zaXRpb24gaW5kZXggZm9yIHByb3RvY29sIGJpdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGZpZWxkICovCisjZGVmaW5lIE1VU1lDQ19DQ0RfVFJBTlMgICAgICAgICAgIDAgICAgLyogUHJvdG9jb2wgbW9kZSBpbiBiaXRzIDEyLTE0ICovCisjZGVmaW5lIE1VU1lDQ19DQ0RfU1M3ICAgICAgICAgICAgIDEKKyNkZWZpbmUgTVVTWUNDX0NDRF9IRExDX0ZDUzE2ICAgICAgMgorI2RlZmluZSBNVVNZQ0NfQ0NEX0hETENfRkNTMzIgICAgICAzCisjZGVmaW5lIE1VU1lDQ19DQ0RfRU9QSVJRX0RJU0FCTEUgIDB4MDAwMDgwMDAgICAvKiBFT1AgaXJxIGRpc2FibGVkICovCisjZGVmaW5lIE1VU1lDQ19DQ0RfSU5WRVJUX0RBVEEgICAgIDB4MDA4MDAwMDAgICAvKiBJbnZlcnQgZGF0YSAqLworI2RlZmluZSBNVVNZQ0NfQ0NEX01BWF9MRU5HVEggICAgICAxMCAgIC8qIFBvc2l0aW9uIGluZGV4IGZvciBtYXggbGVuZ3RoIGJpdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGZpZWxkICovCisjZGVmaW5lIE1VU1lDQ19DQ0RfQlVGRkVSX0xFTkdUSCAgIDE2ICAgLyogUG9zaXRpb24gaW5kZXggZm9yIGludGVybmFsIGRhdGEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBidWZmZXIgbGVuZ3RoICovCisjZGVmaW5lIE1VU1lDQ19DQ0RfQlVGRkVSX0xPQyAgICAgIDI0ICAgLyogUG9zaXRpb24gaW5kZXggZm9yIGludGVybmFsIGRhdGEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBidWZmZXIgc3RhcnRpbmcgbG9jYXRpb24gKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIEludGVycnVwdCBEZXNjcmlwdG9yIEluZm9ybWF0aW9uICovCisKKyNkZWZpbmUgSU5UX0VNUFRZX0VOVFJZICAgICAweGZlZWRmYWNlCisjZGVmaW5lIElOVF9FTVBUWV9FTlRSWTIgICAgMHhkZWFkZmFjZQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogSW50ZXJydXB0IFN0YXR1cyBEZXNjcmlwdG9yCisgKgorICogTk9URTogT25lIG11c3QgZmlyc3QgZmV0Y2ggdGhlIHZhbHVlIG9mIHRoZSBpbnRlcnJ1cHQgc3RhdHVzIGRlc2NyaXB0b3IKKyAqIGludG8gYSBsb2NhbCB2YXJpYWJsZSwgdGhlbiBwYXNzIHRoYXQgdmFsdWUgaW50byB0aGUgcmVhZCBtYWNyb3MuIFRoaXMKKyAqIGlzIHJlcXVpcmVkIHRvIGF2b2lkIHJhY2UgY29uZGl0aW9ucy4KKyAqKiovCisKKyNkZWZpbmUgSU5UUlBUU19ORVhUSU5UX00gICAgICAweDdGRkYwMDAwCisjZGVmaW5lIElOVFJQVFNfTkVYVElOVF9TICAgICAgMTYKKyNkZWZpbmUgSU5UUlBUU19ORVhUSU5UKHgpICAgICAoKHggJiBJTlRSUFRTX05FWFRJTlRfTSkgPj4gSU5UUlBUU19ORVhUSU5UX1MpCisKKyNkZWZpbmUgSU5UUlBUU19JTlRGVUxMX00gICAgICAweDAwMDA4MDAwCisjZGVmaW5lIElOVFJQVFNfSU5URlVMTF9TICAgICAgMTUKKyNkZWZpbmUgSU5UUlBUU19JTlRGVUxMKHgpICAgICAoKHggJiBJTlRSUFRTX0lOVEZVTExfTSkgPj4gSU5UUlBUU19JTlRGVUxMX1MpCisKKyNkZWZpbmUgSU5UUlBUU19JTlRDTlRfTSAgICAgICAweDAwMDA3RkZGCisjZGVmaW5lIElOVFJQVFNfSU5UQ05UX1MgICAgICAgMAorI2RlZmluZSBJTlRSUFRTX0lOVENOVCh4KSAgICAgICgoeCAmIElOVFJQVFNfSU5UQ05UX00pID4+IElOVFJQVFNfSU5UQ05UX1MpCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIEludGVycnVwdCBEZXNjcmlwdG9yCisgKioqLworCisjZGVmaW5lIElOVFJQVF9ESVJfTSAgICAgICAgICAgMHg4MDAwMDAwMAorI2RlZmluZSBJTlRSUFRfRElSX1MgICAgICAgICAgIDMxCisjZGVmaW5lIElOVFJQVF9ESVIoeCkgICAgICAgICAgKCh4ICYgSU5UUlBUX0RJUl9NKSA+PiBJTlRSUFRfRElSX1MpCisKKyNkZWZpbmUgSU5UUlBUX0dSUF9NICAgICAgICAgICAweDYwMDAwMDAwCisjZGVmaW5lIElOVFJQVF9HUlBfTVNCX00gICAgICAgMHgwMDAwNDAwMAorI2RlZmluZSBJTlRSUFRfR1JQX1MgICAgICAgICAgIDI5CisjZGVmaW5lIElOVFJQVF9HUlBfTVNCX1MgICAgICAgMTIKKyNkZWZpbmUgSU5UUlBUX0dSUCh4KSAgICAgICAgICAoKCh4ICYgSU5UUlBUX0dSUF9NKSA+PiBJTlRSUFRfR1JQX1MpIHwgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoeCAmIElOVFJQVF9HUlBfTVNCX00pID4+IElOVFJQVF9HUlBfTVNCX1MpKQorCisjZGVmaW5lIElOVFJQVF9DSF9NICAgICAgICAgICAgMHgxRjAwMDAwMAorI2RlZmluZSBJTlR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MDAgICAgICAvKiBFbmFibGUgcGFkZmlsbCAqLworI2RlZmluZSBSRVBFQVRfQklUICAgICAgMHgwMDAwODAwMCAgICAgIC8qIEJpdCBvbiBmb3IgRklTVSBkZXNjcmlwdG9yICovCisjZGVmaW5lIExFTkdUSF9NQVNLICAgICAgICAgMFgzZmZmICAgICAgLyogVGhpcyBwYXJ0IG9mIHN0YXR1cyBkZXNjcmlwdG9yIGlzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogbGVuZ3RoICovCisjZGVmaW5lIElETEVfQ09ERSAgICAgICAgICAgICAgIDI1ICAgICAgLyogUG9zaXRpb24gaW5kZXggZm9yIGlkbGUgY29kZSAoMgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGJpdHMpICovCisjZGVmaW5lIEVYVFJBX0ZMQUdTICAgICAgICAgICAgIDE2ICAgICAgLyogUG9zaXRpb24gaW5kZXggZm9yIG1pbmltdW0gZmxhZ3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBiZXR3ZWVuIG1lc3NhZ2VzICg4IGJpdHMpICovCisjZGVmaW5lIElETEVfQ09ERV9NQVNLICAgICAgICAweDAzICAgICAgLyogR2V0cyByaWQgb2YgZ2FyYmFnZSBiZWZvcmUgdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogcGF0dGVybiBpcyBPUidkIGluICovCisjZGVmaW5lIEVYVFJBX0ZMQUdTX01BU0sgICAgICAweGZmICAgICAgLyogR2V0cyByaWQgb2YgZ2FyYmFnZSBiZWZvcmUgdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogcGF0dGVybiBpcyBPUidkIGluICovCisjZGVmaW5lIFBDSV9QRVJNVVRFRF9PV05FUl9CSVQgIDB4MDAwMDAwODAgICAgICAvKiBGb3IgZmxpcHBpbmcgdGhlIGJpdCBvbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogdGhlIHBvbGxlZCBtb2RlIGRlc2NyaXB0b3IgKi8KKworLyogU2VydmljZSBSZXF1ZXN0IERlc2NyaXB0b3IgYml0IG1hY3JvcyAqLworI2RlZmluZSBTUkVRICA4ICAgICAgICAgICAgICAgICAvKiBQb3NpdGlvbiBpbmRleCBmb3Igc2VydmljZSByZXF1ZXN0IGJpdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBmaWVsZCAqLworI2RlZmluZSBTUl9OT09QICAgICAgICAgICAgICAgICAoMDw8KFNSRVEpKSAgICAgLyogTm8gT3BlcmF0aW9uLiBHZW5lcmF0ZXMgU0FDSyAqLworI2RlZmluZSBTUl9DSElQX1JFU0VUICAgICAgICAgICAoMTw8KFNSRVEpKSAgICAgLyogU29mdCBjaGlwIHJlc2V0ICovCisjZGVmaW5lIFNSX0dST1VQX1JFU0VUICAgICAgICAgICgyPDwoU1JFUSkpICAgICAvKiBHcm91cCByZXNldCAqLworI2RlZmluZSBTUl9HTE9CQUxfSU5JVCAgICAgICAgICAoNDw8KFNSRVEpKSAgICAgLyogR2xvYmFsIGluaXQ6IHJlYWQgZ2xvYmFsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBjb25maWcgZGVzd2MgYW5kIGludGVycnVwdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogcXVldWUgZGVzYyAqLworI2RlZmluZSBTUl9HUk9VUF9JTklUICAgICAgICAgICAoNTw8KFNSRVEpKSAgICAgLyogR3JvdXAgaW5pdDogcmVhZCBUaW1lc2xvdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogYW5kIFN1YmNoYW5uZWwgbWFwcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIENoYW5uZWwgQ29uZmlnLCAqLworICAgIC8qCisgICAgICogR3JvdXAgQ29uZmlnLCBNZW1vcnkgUHJvdGVjdCwgTWVzc2FnZSBMZW5ndGgsIGFuZCBQb3J0IENvbmZpZworICAgICAqIERlc2NyaXB0b3JzCisgICAgICovCisjZGVmaW5lIFNSX0NIQU5ORUxfQUNUSVZBVEUgICAgICg4PDwoU1JFUSkpICAgICAvKiBJbml0IGNoYW5uZWwsIHJlYWQgSGVhZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogUG9pbnRlciwgcHJvY2VzcyBmaXJzdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogTWVzc2FnZSBEZXNjcmlwdG9yICovCisjZGVmaW5lIFNSX0dDSEFOTkVMX01BU0sgICAgICAgIDB4MDAxRiAgICAgICAgICAvKiBjaGFubmVsIHBvcnRpb24gKGdjaGFuKSAqLworI2RlZmluZSBTUl9DSEFOTkVMX0RFQUNUSVZBVEUgICAoOTw8KFNSRVEpKSAgICAgLyogU3RvcCBjaGFubmVsIHByb2Nlc3NpbmcgKi8KKyNkZWZpbmUgU1JfSlVNUCAgICAgICAgICAgICAgICAgKDEwPDwoU1JFUSkpICAgIC8qIGE6IFByb2Nlc3MgbmV3IE1lc3NhZ2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIExpc3QgKi8KKyNkZWZpbmUgU1JfQ0hBTk5FTF9DT05GSUcgICAgICAgKDExPDwoU1JFUSkpICAgIC8qIGI6IFJlYWQgY2hhbm5lbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogQ29uZmlndXJhdGlvbiBEZXNjcmlwdG9yICovCisjZGVmaW5lIFNSX0dMT0JBTF9DT05GSUcgICAgICAgICgxNjw8KFNSRVEpKSAgICAvKiAxMDogUmVhZCBHbG9iYWwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIENvbmZpZ3VyYXRpb24gRGVzY3JpcHRvciAqLworI2RlZmluZSBTUl9JTlRFUlJVUFRfUSAgICAgICAgICAoMTc8PChTUkVRKSkgICAgLyogMTE6IFJlYWQgSW50ZXJydXB0IFF1ZXVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBEZXNjcmlwdG9yICovCisjZGVmaW5lIFNSX0dST1VQX0NPTkZJRyAgICAgICAgICgxODw8KFNSRVEpKSAgICAvKiAxMjogUmVhZCBHcm91cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogQ29uZmlndXJhdGlvbiBEZXNjcmlwdG9yICovCisjZGVmaW5lIFNSX01FTU9SWV9QUk9URUNUICAgICAgICgxOTw8KFNSRVEpKSAgICAvKiAxMzogUmVhZCBNZW1vcnkgUHJvdGVjdGlvbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogRGVzY3JpcHRvciAqLworI2RlZmluZSBTUl9NRVNTQUdFX0xFTkdUSCAgICAgICAoMjA8PChTUkVRKSkgICAgLyogMTQ6IFJlYWQgTWVzc2FnZSBMZW5ndGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIERlc2NyaXB0b3IgKi8KKyNkZWZpbmUgU1JfUE9SVF9DT05GSUcgICAgICAgICAgKDIxPDwoU1JFUSkpICAgIC8qIDE1OiBSZWFkIFBvcnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIENvbmZpZ3VyYXRpb24gRGVzY3JpcHRvciAqLworI2RlZmluZSBTUl9USU1FU0xPVF9NQVAgICAgICAgICAoMjQ8PChTUkVRKSkgICAgLyogMTg6IFJlYWQgVGltZXNsb3QgTWFwICovCisjZGVmaW5lIFNSX1NVQkNIQU5ORUxfTUFQICAgICAgICgyNTw8KFNSRVEpKSAgICAvKiAxOTogUmVhZCBTdWJjaGFubmVsIE1hcCAqLworI2RlZmluZSBTUl9DSEFOX0NPTkZJR19UQUJMRSAgICAoMjY8PChTUkVRKSkgICAgLyogMjA6IFJlYWQgQ2hhbm5lbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogQ29uZmlndXJhdGlvbiBUYWJsZSBmb3IKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHRoZSBncm91cCAqLworI2RlZmluZSBTUl9UWF9ESVJFQ1RJT04gICAgICAgICAweDAwMDAwMDIwICAgICAgLyogVHJhbnNtaXQgZGlyZWN0aW9uIGJpdC4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIEJpdCBvZmYgaW5kaWNhdGVzIHJlY2VpdmUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGRpcmVjdGlvbiAqLworI2RlZmluZSBTUl9SWF9ESVJFQ1RJT04gICAgICAgICAweDAwMDAwMDAwCisKKy8qIEludGVycnVwdCBEZXNjcmlwdG9yIGJpdCBtYWNyb3MgKi8KKyNkZWZpbmUgR1JPVVAxMCAgICAgICAgICAgICAgICAgICAgIDI5ICAvKiBQb3NpdGlvbiBpbmRleCBmb3IgdGhlIDIgTFMgZ3JvdXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBiaXRzICovCisjZGVmaW5lIENIQU5ORUwgICAgICAgICAgICAgICAgICAgICAyNCAgLyogUG9zaXRpb24gaW5kZXggZm9yIGNoYW5uZWwgYml0cyAqLworI2RlZmluZSBJTlRfSVFEX1RYICAgICAgICAgIDB4ODAwMDAwMDAKKyNkZWZpbmUgSU5UX0lRRF9HUlAgICAgICAgICAweDYwMDAwMDAwCisjZGVmaW5lIElOVF9JUURfQ0hBTiAgICAgICAgMHgxZjAwMDAwMAorI2RlZmluZSBJTlRfSVFEX0VWRU5UICAgICAgIDB4MDBmMDAwMDAKKyNkZWZpbmUgSU5UX0lRRF9FUlJPUiAgICAgICAweDAwMGYwMDAwCisjZGVmaW5lIElOVF9JUURfSUxPU1QgICAgICAgMHgwMDAwODAwMAorI2RlZmluZSBJTlRfSVFEX1BFUlIgICAgICAgIDB4MDAwMDQwMDAKKyNkZWZpbmUgSU5UX0lRRF9CTEVOICAgICAgICAweDAwMDAzZmZmCisKKy8qIEludGVycnVwdCBEZXNjcmlwdG9yIEV2ZW50cyAqLworI2RlZmluZSBFVkVfRVZFTlQgICAgICAgICAgICAgICAyMCAgICAgIC8qIFBvc2l0aW9uIGluZGV4IGZvciBldmVudCBiaXRzICovCisjZGVmaW5lIEVWRV9OT05FICAgICAgICAgICAgICAgIDAgICAgICAgLyogTm8gZXZlbnQgdG8gcmVwb3J0IGluIHRoaXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBpbnRlcnJ1cHQgKi8KKyNkZWZpbmUgRVZFX1NBQ0sgICAgICAgICAgICAgICAgMSAgICAgICAvKiBTZXJ2aWNlIFJlcXVlc3QgYWNrbm93bGVkZ2UgKi8KKyNkZWZpbmUgRVZFX0VPQiAgICAgICAgICAgICAgICAgMiAgICAgICAvKiBFbmQgb2YgQnVmZmVyICovCisjZGVmaW5lIEVWRV9FT00gICAgICAgICAgICAgICAgIDMgICAgICAgLyogRW5kIG9mIE1lc3NhZ2UgKi8KKyNkZWZpbmUgRVZFX0VPUCAgICAgICAgICAgICAgICAgNCAgICAgICAvKiBFbmQgb2YgUGFkZmlsbCAqLworI2RlZmluZSBFVkVfQ0hBQlQgICAgICAgICAgICAgICA1ICAgICAgIC8qIENoYW5nZSB0byBBYm9ydCBDb2RlICovCisjZGVmaW5lIEVWRV9DSElDICAgICAgICAgICAgICAgIDYgICAgICAgLyogQ2hhbmdlIHRvIElkbGUgQ29kZSAqLworI2RlZmluZSBFVkVfRlJFQyAgICAgICAgICAgICAgICA3ICAgICAgIC8qIEZyYW1lIFJlY292ZXJ5ICovCisjZGVmaW5lIEVWRV9TSU5DICAgICAgICAgICAgICAgIDggICAgICAgLyogTVRQMiBTVUVSTSBJbmNyZW1lbnQgKi8KKyNkZWZpbmUgRVZFX1NERUMgICAgICAgICAgICAgICAgOSAgICAgICAvKiBNVFAyIFNVRVJNIERlY3JlbWVudCAqLworI2RlZmluZSBFVkVfU0ZJTFQgICAgICAgICAgICAgICAxMCAgICAgIC8qIE1UUDIgU1VFUk0gRmlsdGVyZWQgTWVzc2FnZSAqLworLyogSW50ZXJydXB0IERlc2NyaXB0b3IgRXJyb3JzICovCisjZGVmaW5lIEVSUl9FUlJPUlMgICAgICAgICAgICAgIDE2ICAgICAgLyogUG9zaXRpb24gaW5kZXggZm9yIGVycm9yIGJpdHMgKi8KKyNkZWZpbmUgRVJSX0JVRiAgICAgICAgICAgICAgICAgMSAgICAgICAvKiBCdWZmZXIgRXJyb3IgKi8KKyNkZWZpbmUgRVJSX0NPRkEgICAgICAgICAgICAgICAgMiAgICAgICAvKiBDaGFuZ2Ugb2YgRnJhbWUgQWxpZ25tZW50IEVycm9yICovCisjZGVmaW5lIEVSUl9PTlIgICAgICAgICAgICAgICAgIDMgICAgICAgLyogT3duZXIgQml0IEVycm9yICovCisjZGVmaW5lIEVSUl9QUk9UICAgICAgICAgICAgICAgIDQgICAgICAgLyogTWVtb3J5IFByb3RlY3Rpb24gRXJyb3IgKi8KKyNkZWZpbmUgRVJSX09PRiAgICAgICAgICAgICAgICAgOCAgICAgICAvKiBPdXQgb2YgRnJhbWUgRXJyb3IgKi8KKyNkZWZpbmUgRVJSX0ZDUyAgICAgICAgICAgICAgICAgOSAgICAgICAvKiBGQ1MgRXJyb3IgKi8KKyNkZWZpbmUgRVJSX0FMSUdOICAgICAgICAgICAgICAgMTAgICAgICAvKiBPY3RldCBBbGlnbm1lbnQgRXJyb3IgKi8KKyNkZWZpbmUgRVJSX0FCVCAgICAgICAgICAgICAgICAgMTEgICAgICAvKiBBYm9ydCBUZXJtaW5hdGlvbiAqLworI2RlZmluZSBFUlJfTE5HICAgICAgICAgICAgICAgICAxMiAgICAgIC8qIExvbmcgTWVzc2FnZSBFcnJvciAqLworI2RlZmluZSBFUlJfU0hUICAgICAgICAgICAgICAgICAxMyAgICAgIC8qIFNob3J0IE1lc3NhZ2UgRXJyb3IgKi8KKyNkZWZpbmUgRVJSX1NVRVJSICAgICAgICAgICAgICAgMTQgICAgICAvKiBTVUVSTSB0aHJlc2hvbGQgZXhjZWVkZWQgKi8KKyNkZWZpbmUgRVJSX1BFUlIgICAgICAgICAgICAgICAgMTUgICAgICAvKiBQQ0kgUGFyaXR5IEVycm9yICovCisvKiBPdGhlciBTdHVmZiAqLworI2RlZmluZSBUUkFOU01JVF9ESVJFQ1RJT04gIDB4ODAwMDAwMDAgIC8qIFRyYW5zbWl0IGRpcmVjdGlvbiBiaXQuIEJpdCBvZmYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBpbmRpY2F0ZXMgcmVjZWl2ZSBkaXJlY3Rpb24gKi8KKyNkZWZpbmUgSUxPU1QgICAgICAgICAgICAgICAweDAwMDA4MDAwICAvKiBJbnRlcnJ1cHQgTG9zdCAqLworI2RlZmluZSBHUk9VUE1TQiAgICAgICAgICAgIDB4MDAwMDQwMDAgIC8qIEdyb3VwIG51bWJlciBNU0IgKi8KKyNkZWZpbmUgU0FDS19JTUFHRSAgICAgICAgICAweDAwMTAwMDAwICAvKiBVc2VkIGluIElSUSBmb3Igc2VtYXBob3JlIHRlc3QgKi8KKyNkZWZpbmUgSU5JVElBTF9TVEFUVVMgICAgICAweDEwMDAwICAgICAvKiBJUlEgc3RhdHVzIHNob3VsZCBiZSB0aGlzIGFmdGVyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogcmVzZXQgKi8KKworLyogIFRoaXMgbXVzdCBiZSBkZWZpbmVkIG9uIGFuIGV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iogIEFmdGVyd2FyZHMsIHRoZSBkYXRhIGJpdCB3aWxsIHJldHVybiB0byBhIGhpZ2ggc3RhdGUsIH42IG1zLCB0ZXJtaW5hdGluZworKiogIHRoZSBvcGVyYXRpb24uCisqLworICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSBhZGRyLCBFUFJPTV9FTkNTKTsgICAgICAvKiBSZS1lbmFibGUgQ2hpcCBTZWxlY3QgKi8KKyAgICB0ZW1wID0gcGNpX3JlYWRfMzIgKCh1X2ludDMyX3QgKikgYWRkcik7ICAgIC8qIGRpc2NhcmQgZmlyc3QgcmVhZCAqLworICAgIHRlbXAgPSBwY2lfcmVhZF8zMiAoKHVfaW50MzJfdCAqKSBhZGRyKTsKKyAgICBpZiAodGVtcCAmIEVQUk9NX0FDVElWRV9JTl9CSVQpCisgICAgeworICAgICAgICB0ZW1wID0gcGNpX3JlYWRfMzIgKCh1X2ludDMyX3QgKikgYWRkcik7CisgICAgICAgIGlmICh0ZW1wICYgRVBST01fQUNUSVZFX0lOX0JJVCkKKyAgICAgICAgeworICAgICAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopIGFkZHIsIDApOyAgICAgICAvKiBSZW1vdmUgQ2hpcCBTZWxlY3QKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogZnJvbSBFRVBST00gKi8KKyAgICAgICAgICAgIHJldHVybiAoMSk7CisgICAgICAgIH0KKyAgICB9CisgICAgY291bnQgPSAxMDAwOworICAgIHdoaWxlIChjb3VudC0tKQorICAgIHsKKyAgICAgICAgZm9yICh0ZW1wID0gMDsgdGVtcCA8IDB4MTA7IHRlbXArKykKKyAgICAgICAgICAgIE9TX3V3YWl0X2R1bW15ICgpOworCisgICAgICAgIGlmIChwY2lfcmVhZF8zMiAoKHVfaW50MzJfdCAqKSBhZGRyKSAmIEVQUk9NX0FDVElWRV9JTl9CSVQpCisgICAgICAgICAgICBicmV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WYKKworCisvKgorICogZXh0ZXJuYWwgaW50ZXJmYWNlCisgKi8KKwordm9pZCAgICAgICAgYzRfY2xlYW51cCAodm9pZCk7CitzdGF0dXNfdCAgICBjNF9jaGFuX3VwIChjaV90ICosIGludCBjaGFubnVtKTsKK3N0YXR1c190ICAgIGM0X2RlbF9jaGFuX3N0YXRzIChpbnQgY2hhbm51bSk7CitzdGF0dXNfdCAgICBjNF9kZWxfY2hhbiAoaW50IGNoYW5udW0pOworc3RhdHVzX3QgICAgYzRfZ2V0X2lpZGluZm8gKGNpX3QgKiBjaSwgc3RydWN0IHNiZV9paWRfaW5mbyAqIGlpcCk7CitpbnQgICAgICAgICBjNF9pc19jaGFuX3VwIChpbnQgY2hhbm51bSk7CisKK3ZvaWQgICAgICAgKmdldHVzZXJieWNoYW4gKGludCBjaGFubnVtKTsKK3ZvaWQgICAgICAgIHBjaV9mbHVzaF93cml0ZSAoY2lfdCAqIGNpKTsKK3ZvaWQgICAgICAgIHNiZWNvbV9zZXRfbG9nbGV2ZWwgKGludCBkZWJ1Z2xldmVsKTsKK2NoYXIgICAgICAgKnNiZWlkX2dldF9iZG5hbWUgKGNpX3QgKiBjaSk7Cit2b2lkICAgICAgICBzYmVpZF9zZXRfYmR0eXBlIChjaV90ICogY2kpOwordm9pZCAgICAgICAgc2JlaWRfc2V0X2hkd2JpZCAoY2lfdCAqIGNpKTsKK3VfaW50MzJfdCAgIHNiZUNyYyAodV9pbnQ4X3QgKiwgdV9pbnQzMl90LCB1X2ludDMyX3QsIHVfaW50MzJfdCAqKTsKKwordm9pZCAgICAgICAgVk1FVFJPX1RSQUNFICh2b2lkICopOyAgICAgICAvKiBwdXQgZGF0YSBpbnRvIDggTEVEcyAqLwordm9pZCAgICAgICAgVk1FVFJPX1RSSUdHRVIgKGNpX3QgKiwgaW50KTsgICAgICAgLyogTm90ZTogaW50ID0gMChkZWZhdWx0KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICog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0tLS0tLS0tLQorICogJExvZzogcG1jYzRfY3BsZC5oLHYgJAorICogUmV2aXNpb24gMS4wICAyMDA1LzA5LzI4IDAwOjEwOjA4ICByaWNrZAorICogSW5pdGlhbCByZXZpc2lvbgorICoKKyAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAqLworCisKKyNpZiBkZWZpbmVkKF9fRnJlZUJTRF9fKSB8fCBkZWZpbmVkKF9fTmV0QlNEX18pCisjaW5jbHVkZSA8c3lzL3R5cGVzLmg+CisjZWxzZQorI2lmbmRlZiBfX0tFUk5FTF9fCisjaW5jbHVkZSA8c3lzL3R5cGVzLmg+CisjZWxzZQorI2luY2x1ZGUgPGxpbnV4L3R5cGVzLmg+CisjZW5kaWYKKyNlbmRpZgorCisjaWZkZWYgX19jcGx1c3BsdXMKK2V4dGVybiAgICAgICJDIgoreworI2VuZGlmCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogaVNQTEQgY29udHJvbCBjaGlwIHJlZ2lzdGVycyAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjaWYgMAorI2RlZmluZSBDUExEX01DU1IgICAgMHgwCisjZGVmaW5lIENQTERfTUNMSyAgICAweDEKKyNkZWZpbmUgQ1BMRF9MRURTICAgIDB4MgorI2RlZmluZSBDUExEX0lOVFIgICAgMHgzCisjZW5kaWYKKworICAgIHN0cnVjdCBjNF9jcGxkCisgICAgeworICAgICAgICB2b2xhdGlsZSB1X2ludDMyX3QgbWNzcjsvKiByL3c6IE1hc3RlciBDbG9jayBTb3VyY2UgUmVnaXN0ZXIgKi8KKyAgICAgICAgdm9sYXRpbGUgdV9pbnQzMl90IG1jbGs7Lyogci93OiBNYXN0ZXIgQ2xvY2sgUmVnaXN0ZXIgKi8KKyAgICAgICAgdm9sYXRpbGUgdV9pbnQzMl90IGxlZHM7Lyogci93OiBMRUQgUmVnaXN0ZXIgKi8KKyAgICAgICAgdm9sYXRpbGUgdV9pbnQzMl90IGludHI7LyogcjogSW50ZXJydXB0IFJlZ2lzdGVyICovCisgICAgfTsKKworICAgIHR5cGVkZWYgc3RydWN0IGM0X2NwbGQgYzRjcGxkX3Q7CisKKy8qIG1jc3Igbm90ZTogc291cmNpbmcgQ09NRVQgbXVzdCBiZSBpbml0aWFsaXplZCB0byBNYXN0ZXIgTW9kZSAqLworI2RlZmluZSBQTUNDNF9DUExEX01DU1JfSU5EICAgICAwICAgICAgIC8qIHBvcnRzIHVzZWQgaW5kaXZpZHVhbCBCUCBDbGsgYXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBzb3VyY2UsIG5vIHNsYXZlcyAqLworI2RlZmluZSBQTUNDNF9DUExEX01DU1JfQ01UXzEgICAxICAgICAgIC8qIENPTUVUIDEgQlAgQ2xrIGlzIHNvdXJjZSwgMiwzLDQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBhcmUgQ2xrIHNsYXZlcyAqLworI2RlZmluZSBQTUNDNF9DUExEX01DU1JfQ01UXzIgICAyICAgICAgIC8qIENPTUVUIDIgQlAgQ2xrIGlzIHNvdXJjZSwgMSwzLDQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBhcmUgQ2xrIHNsYXZlcyAqLworI2RlZmluZSBQTUNDNF9DUExEX01DU1JfQ01UXzMgICAzICAgICAgIC8qIENPTUVUIDMgQlAgQ2xrIGlzIHNvdXJjZSwgMSwyLDQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBhcmUgQ2xrIHNsYXZlcyAqLworI2RlZmluZSBQTUNDNF9DUExEX01DU1JfQ01UXzQgICA0ICAgICAgIC8qIENPTUVUIDQgQlAgQ2xrIGlzIHNvdXJjZSwgMSwyLDMKKyAgICAgICAgICA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pbnQgIG1heF9yeGRlc2NfdXNlZCwgbWF4X3J4ZGVzY19kZWZhdWx0OworZXh0ZXJuIGludCAgbWF4X3R4ZGVzY191c2VkLCBtYXhfdHhkZXNjX2RlZmF1bHQ7CisKKyNpZiBkZWZpbmVkIChfX3Bvd2VycGNfXykKK2V4dGVybiB2b2lkICptZW1zZXQgKHZvaWQgKnMsIGludCBjLCBzaXplX3Qgbik7CisKKyNlbmRpZgorCitpbnQgICAgICAgICBkcnZyX3N0YXRlID0gU0JFX0RSVlJfSU5JVDsKK2NpX3QgICAgICAgKmM0X2xpc3QgPSAwOworY2lfdCAgICAgICAqQ0k7ICAgICAgICAgICAgICAgICAvKiBkdW1teSBwb2ludGVyIHRvIGJvYXJkIFpFUk9FJ3MgZGF0YSAtCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIERFQlVHIFVTQUdFICovCisKKwordm9pZAorc2JlY29tX3NldF9sb2dsZXZlbCAoaW50IGQpCit7CisgICAgLyoKKyAgICAgKiBUaGUgY29kZSB3aXRoaW4gdGhlIGZvbGxvd2luZyAtaWYtIGNsYXVzZSBpcyBhIGJhY2tkb29yIGRlYnVnIGZhY2lsaXR5CisgICAgICogd2hpY2ggY2FuIGJlIHVzZWQgdG8gZGlzcGxheSB0aGUgc3RhdGUgb2YgYSBib2FyZCdzIGNoYW5uZWwuCisgICAgICovCisgICAgaWYgKGQgPiBMT0dfREVCVUcpCisgICAgeworICAgICAgICB1bnNpZ25lZCBpbnQgY2hhbm51bSA9IGQgLSAoTE9HX0RFQlVHICsgMSk7ICAgICAvKiBjb252ZXJ0IHRvIFpFUk8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogcmVsYXRpdml0eSAqLworCisgICAgICAgICh2b2lkKSBtdXN5Y2NfZHVtcF9yaW5nICgoY2lfdCAqKSBDSSwgY2hhbm51bSk7IC8qIENJIGltcGxpZXMgc3VwcG9ydAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBmb3IgY2FyZCAwIG9ubHkgKi8KKyAgICB9IGVsc2UKKyAgICB7CisgICAgICAgIGlmIChsb2dfbGV2ZWwgIT0gZCkKKyAgICAgICAgeworICAgICAgICAgICAgcHJfaW5mbygibG9nIGxldmVsIGNoYW5nZWQgZnJvbSAlZCB0byAlZFxuIiwgbG9nX2xldmVsLCBkKTsKKyAgICAgICAgICAgIGxvZ19sZXZlbCA9IGQ7ICAgICAgICAgIC8qIHNldCBuZXcgKi8KKyAgICAgICAgfSBlbHNlCisgICAgICAgICAgICBwcl9pbmZvKCJsb2cgbGV2ZWwgaXMgJWRcbiIsIGxvZ19sZXZlbCk7CisgICAgfQorfQorCisKK21jaF90ICAgICAgKgorYzRfZmluZF9jaGFuIChpbnQgY2hhbm51bSkKK3sKKyAgICBjaV90ICAgICAgICpjaTsKKyAgICBtY2hfdCAgICAgICpjaDsKKyAgICBpbnQgICAgICAgICBwb3J0bnVtLCBnY2hhbjsKKworICAgIGZvciAoY2kgPSBjNF9saXN0OyBjaTsgY2kgPSBjaS0+bmV4dCkKKyAgICAgICAgZm9yIChwb3J0bnVtID0gMDsgcG9ydG51bSA8IGNpLT5tYXhfcG9ydDsgcG9ydG51bSsrKQorICAgICAgICAgICAgZm9yIChnY2hhbiA9IDA7IGdjaGFuIDwgTVVTWUNDX05DSEFOUzsgZ2NoYW4rKykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoKGNoID0gY2ktPnBvcnRbcG9ydG51bV0uY2hhbltnY2hhbl0pKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKChjaC0+c3RhdGUgIT0gVU5BU1NJR05FRCkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgIChjaC0+Y2hhbm51bSA9PSBjaGFubnVtKSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAoY2gpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICByZXR1cm4gMDsKK30KKworCitjaV90ICAgICAgICpfX2luaXQKK2M0X25ldyAodm9pZCAqaGkpCit7CisgICAgY2lfdCAgICAgICAqY2k7CisKKyNpZmRlZiBTQkVfTUFQX0RFQlVHCisgICAgcHJfd2FybmluZygiYzRfbmV3KCkgZW50ZXJlZCwgY2kgbmVlZHMgJXUuXG4iLAorICAgICAgICAgICAgICAgKHVuc2lnbmVkIGludCkgc2l6ZW9mIChjaV90KSk7CisjZW5kaWYKKworICAgIGNpID0gKGNpX3QgKikgT1Nfa21hbGxvYyAoc2l6ZW9mIChjaV90KSk7CisgICAgaWYgKGNpKQorICAgIHsKKyAgICAgICAgY2ktPmhkd19pbmZvID0gaGk7CisgICAgICAgIGNpLT5zdGF0ZSA9IENfSU5JVDsgICAgICAgICAvKiBtYXJrIGFzIGhhcmR3YXJlIG5vdCBhdmFpbGFibGUgKi8KKyAgICAgICAgY2ktPm5leHQgPSBjNF9saXN0OworICAgICAgICBjNF9saXN0ID0gY2k7CisgICAgICAgIGNpLT5icmRubyA9IGNpLT5uZXh0ID8gY2ktPm5leHQtPmJyZG5vICsgMSA6IDA7CisgICAgfSBlbHNlCisgICAgICAgIHByX3dhcm5pbmcoImZhaWxlZCBDSSBtYWxsb2MsIHNpemUgJXUuXG4iLAorICAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCBpbnQpIHNpemVvZiAoY2lfdCkpOworCisgICAgaWYgKENJID09IDApCisgICAgICAgIENJID0gY2k7ICAgICAgICAgICAgICAgICAgICAvKiBERUJVRywgb25seSBib2FyZCAwIHVzYWdlICovCisgICAgcmV0dXJuIGNpOworfQorCisKKy8qKioKKyAqIENoZWNrIHBvcnQgc3RhdGUgYW5kIHNldCBMRUQgc3RhdGVzIHVzaW5nIHdhdGNoZG9nIG9yIGlvY3RsLi4uCisgKiBhbHNvIGNoZWNrIGZvciBpbi1iYW5kIFNGIGxvb3BiYWNrIGNvbW1hbmRz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gICAgIDB4NDEgIC8qIGNoYW5nZSBpbiBzaWduYWwgc3RhdHVzIChsb3N0L3JlY292ZXJlZCkgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBzdGF0ZSAqLworI2RlZmluZSBzYmVMaW5rQ2hhbmdlICAgICAweDQwCisjZGVmaW5lIHNiZUxpbmtEb3duICAgICAgIDB4MDEKKyNkZWZpbmUgc2JlQWxhcm1zTWFzayAgICAgMHgwNyAgLyogcmVkIC8geWVsbG93IC8gYmx1ZSBhbGFybSBjb25kaXRpb25zICovCisjZGVmaW5lIHNiZUUxQWxhcm1zTWFzayAgIDB4MTA3IC8qIGFsYXJtIGNvbmRpdGlvbnMgKi8KKworI2RlZmluZSBDT01FVF9MQkNNRF9SRUFEICAweDgwICAvKiByZWFkIG9ubHkgKGRvIG5vdCBzZXQsIHJldHVybiByZWFkIHZhbHVlKSAqLworCit2b2lkCitjaGVja1BvcnRzIChjaV90ICogY2kpCit7CisjaWZuZGVmIENPTkZJR19TQkVfUE1DQzRfTkNPTU0KKyAgICAvKgorICAgICAqIFBPUlQgUE9JTlQgLSBOQ09NTSBuZWVkcyB0byBhdm9pZCB0aGlzIGNvZGUgc2luY2UgdGhlIHBvbGxpbmcgb2YKKyAgICAgKiBhbGFybXMgY29uZmxpY3RzIHdpdGggTkNPTU0ncyBpbnRlcnJ1cHQgc2VydmljaW5nIGltcGxlbWVudGF0aW9uLgorICAgICAqLworCisgICAgY29tZXRfdCAgICAqY29tZXQ7CisgICAgdm9sYXRpbGUgdV9pbnQzMl90IHZhbHVlOworICAgIHVfaW50MzJfdCAgIGNvcHlWYWwsIExFRHZhbDsKKworICAgIHVfaW50OF90IHBvcnRudW07CisKKyAgICBMRUR2YWwgPSAwOworICAgIGZvciAocG9ydG51bSA9IDA7IHBvcnRudW0gPCBjaS0+bWF4X3BvcnQ7IHBvcnRudW0rKykKKyAgICB7CisgICAgICAgIGNvcHlWYWwgPSAweDEyZiAmIChjaS0+YWxhcm1lZFtwb3J0bnVtXSk7ICAgICAgIC8qIHBvcnQncyBhbGFybSByZWNvcmQgKi8KKyAgICAgICAgY29tZXQgPSBjaS0+cG9ydFtwb3J0bnVtXS5jb21ldGJhc2U7CisgICAgICAgIHZhbHVlID0gcGNpX3JlYWRfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5jZHJjX2lzdHMpICYgc2JlTGlua01hc2s7ICAgIC8qIGxpbmsgbG9zcyByZWcgKi8KKworICAgICAgICBpZiAodmFsdWUgJiBzYmVMaW5rQ2hhbmdlKSAgLyogaXMgdGhlcmUgYSBjaGFuZ2UgaW4gdGhlIGxpbmsgc3R1ZmYgKi8KKyAgICAgICAgeworICAgICAgICAgICAgLyogaWYgdGhlcmUncyBiZWVuIGEgY2hhbmdlIChhYm92ZSkgYW5kIHlldCBpdCdzIHRoZSBzYW1lIChiZWxvdykgKi8KKyAgICAgICAgICAgIGlmICghKCgoY29weVZhbCA+PiAzKSAmIHNiZUxpbmtEb3duKSBeICh2YWx1ZSAmIHNiZUxpbmtEb3duKSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKHZhbHVlICYgc2JlTGlua0Rvd24pCisgICAgICAgICAgICAgICAgICAgIHByX3dhcm5pbmcoIiVzOiBQb3J0ICVkIG1vbWVudGFyaWx5IHJlY292ZXJlZC5cbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2ktPmRldm5hbWUsIHBvcnRudW0pOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgcHJfd2FybmluZygiJXM6IFdhcm5pbmc6IFBvcnQgJWQgbGluayB3YXMgYnJpZWZseSBkb3duLlxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaS0+ZGV2bmFtZSwgcG9ydG51bSk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKHZhbHVlICYgc2JlTGlua0Rvd24pCisgICAgICAgICAgICAgICAgcHJfd2FybmluZygiJXM6IFdhcm5pbmc6IFBvcnQgJWQgbGluayBpcyBkb3duLlxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpLT5kZXZuYW1lLCBwb3J0bnVtKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwcl93YXJuaW5nKCIlczogUG9ydCAlZCBsaW5rIGhhcyByZWNvdmVyZWQuXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgY2ktPmRldm5hbWUsIHBvcnRudW0pOworICAgICAgICAgICAgICAgIGNvcHlWYWwgfD0gMHgyMDsgICAgLyogcmVjb3JkIGxpbmsgdHJhbnNpdGlvbiB0byB1cCAqLworICAgICAgICAgICAgfQorICAgICAgICAgICAgY29weVZhbCB8PSAweDEwOyAgICAgICAgLyogY2hhbmdlIChsaW5rKSAtLT4gdXBkYXRlIExFRHMgICovCisgICAgICAgIH0KKyAgICAgICAgY29weVZhbCAmPSAweDEzNzsgICAgICAgICAgIC8qIGNsZWFyIExFRCAmIGxpbmsgb2xkIGhpc3RvcnkgYml0cyAmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBzYXZlIG90aGVycyAqLworICAgICAgICBpZiAodmFsdWUgJiBzYmVMaW5rRG93bikKKyAgICAgICAgICAgIGNvcHlWYWwgfD0gMHgwODsgICAgICAgIC8qIHJlY29yZCBsaW5rIHN0YXR1cyAobm93KSAqLworICAgICAgICBlbHNlCisgICAgICAgIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpZiBsaW5rIGlzIHVwLCBkbyB0aGlzICovCisgICAgICAgICAgICBjb3B5VmFsIHw9IDB4NDA7ICAgICAgICAvKiBMRUQgaW5kaWNhdGUgbGluayBpcyB1cCAgICAqLworICAgICAgICAgICAgLyogQWxhcm0gdGhpbmdzICYgdGhlIGxpa2UgLi4uIGZpcnN0IGlmIEUxLCB0aGVuIGlmIFQxICovCisgICAgICAgICAgICBpZiAoSVNfRlJBTUVfQU5ZX0UxIChjaS0+cG9ydFtwb3J0bnVtXS5wLnBvcnRfbW9kZSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgKiBmaXJzdCBjaGVjayBDb2Rld29yZCAoU2FYKSBjaGFuZ2VzICYgQ1JDIGFuZAorICAgICAgICAgICAgICAgICAqIHN1Yi1tdWx0aS1mcmFtZSBlcnJvcnMKKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAqIG5vdGUgdGhlc2UgZXJyb3JzIGFyZSBwcmludGVkIGV2ZXJ5IHRpbWUgdGhleSBhcmUgZGV0ZWN0ZWQKKyAgICAgICAgICAgICAgICAgKiB2cy4gYWxhcm1zCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgdmFsdWUgPSBwY2lfcmVhZF8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPmUxX2ZybXJfbmF0X2lzdHMpOyAgIC8qIGNvZGV3b3JkICovCisgICAgICAgICAgICAgICAgaWYgKHZhbHVlICYgMHgxZikKKyAgICAgICAgICAgICAgICB7ICAgICAgICAgICAgICAgICAgIC8qIGlmIGVycm9ycyAoY3JjIG9yIHNtZiBvbmx5KSAqLworICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUgJiAweDEwKQorICAgICAgICAgICAgICAgICAgICAgICAgcHJfd2FybmluZygiJXM6IEUxIFBvcnQgJWQgQ29kZXdvcmQgU2E0IGNoYW5nZSBkZXRlY3RlZC5cbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpLT5kZXZuYW1lLCBwb3J0bnVtKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlICYgMHgwOCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHByX3dhcm5pbmcoIiVzOiBFMSBQb3J0ICVkIENvZGV3b3JkIFNhNSBjaGFuZ2UgZGV0ZWN0ZWQuXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaS0+ZGV2bmFtZSwgcG9ydG51bSk7CisgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSAmIDB4MDQpCisgICAgICAgICAgICAgICAgICAgICAgICBwcl93YXJuaW5nKCIlczogRTEgUG9ydCAlZCBDb2Rld29yZCBTYTYgY2hhbmdlIGRldGVjdGVkLlxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2ktPmRldm5hbWUsIHBvcnRudW0pOworICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUgJiAweDAyKQorICAgICAgICAgICAgICAgICAgICAgICAgcHJfd2FybmluZygiJXM6IEUxIFBvcnQgJWQgQ29kZXdvcmQgU2E3IGNoYW5nZSBkZXRlY3RlZC5cbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpLT5kZXZuYW1lLCBwb3J0bnVtKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlICYgMHgwMSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHByX3dhcm5pbmcoIiVzOiBFMSBQb3J0ICVkIENvZGV3b3JkIFNhOCBjaGFuZ2UgZGV0ZWN0ZWQuXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaS0+ZGV2bmFtZSwgcG9ydG51bSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHZhbHVlID0gcGNpX3JlYWRfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5lMV9mcm1yX21pc3RzKTsgICAgICAvKiBjcmMgJiBzbWYgKi8KKyAgICAgICAgICAgICAgICBpZiAodmFsdWUgJiAweDMpCisgICAgICAgICAgICAgICAgeyAgICAgICAgICAgICAgICAgICAvKiBpZiBlcnJvcnMgKGNyYyBvciBzbWYgb25seSkgKi8KKyAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlICYgc2JlRTFDUkMpCisgICAgICAgICAgICAgICAgICAgICAgICBwcl93YXJuaW5nKCIlczogRTEgUG9ydCAlZCBDUkMtNCBlcnJvcihzKSBkZXRlY3RlZC5cbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpLT5kZXZuYW1lLCBwb3J0bnVtKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlICYgc2JlRTFlcnJTTUYpICAgIC8qIGVycm9yIGluIHN1Yi1tdWx0aWZyYW1lICovCisgICAgICAgICAgICAgICAgICAgICAgICBwcl93YXJuaW5nKCIlczogRTEgUG9ydCAlZCByZWNlaXZlZCBlcnJvcmVkIFNNRi5cbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpLT5kZXZuYW1lLCBwb3J0bnVtKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgdmFsdWUgPSBwY2lfcmVhZF8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPmUxX2ZybXJfbWFzdHMpICYgMHhjYzsgLyogYWxhcm1zICovCisgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgKiBwYWNrIGFsYXJtcyB0b2dldGhlciAoYml0bWlzZXIpLCBhbmQgY29uc3RydWN0IHNpbWlsYXIgdG8KKyAgICAgICAgICAgICAgICAgKiBUMQorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIC8qIFJBSSxSTUFJLC4sLixMT0YsQUlTLC4sLiA9PT4gIFJNQUksLiwuLC4sLiwuLFJBSSxMT0YsQUlTICovCisgICAgICAgICAgICAgICAgLyogc2VlIDB4OTcgKi8KKyAgICAgICAgICAgICAgICB2YWx1ZSA9ICh2YWx1ZSA+PiAyKTsKKyAgICAgICAgICAgICAgICBpZiAodmFsdWUgJiAweDMwKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlICYgMHgyMCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlIHw9IDB4NDA7ICAvKiBSQUkgKi8KKyAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlICYgMHgxMCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlIHw9IDB4MTAwOyAvKiBSTUFJICovCisgICAgICAgICAgICAgICAgICAgIHZhbHVlICY9IH4weDMwOworICAgICAgICAgICAgICAgIH0gICAgICAgICAgICAgICAgICAgLyogZmluaXNoZWQgcGFja2luZyBhbGFybSBpbiBoYW5keSBvcmRlciAqLworICAgICAgICAgICAgICAgIGlmICh2YWx1ZSAhPSAoY29weVZhbCAmIHNiZUUxQWxhcm1zTWFzaykpCisgICAgICAgICAgICAgICAgeyAgICAgICAgICAgICAgICAgICAvKiBpZiBhbGFybXMgY2hhbmdlZCAqLworICAgICAgICAgICAgICAgICAgICBjb3B5VmFsIHw9IDB4MTA7LyogY2hhbmdlIExFRCBzdGF0dXMgICAqLworICAgICAgICAgICAgICAgICAgICBpZiAoKGNvcHlWYWwgJiBzYmVSZWRBbG0pICYmICEodmFsdWUgJiBzYmVSZWRBbG0pKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBjb3B5VmFsICY9IH5zYmVSZWRBbG07CisgICAgICAgICAgICAgICAgICAgICAgICBwcl93YXJuaW5nKCIlczogRTEgUG9ydCAlZCBMT0YgYWxhcm0gZW5kZWQuXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaS0+ZGV2bmFtZSwgcG9ydG51bSk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIShjb3B5VmFsICYgc2JlUmVkQWxtKSAmJiAodmFsdWUgJiBzYmVSZWRBbG0pKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBjb3B5VmFsIHw9IHNiZVJlZEFsbTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHByX3dhcm5pbmcoIiVzOiBFMSBXYXJuaW5nOiBQb3J0ICVkIExPRiBhbGFybS5cbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpLT5kZXZuYW1lLCBwb3J0bnVtKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgoY29weVZhbCAmIHNiZVllbEFsbSkgJiYgISh2YWx1ZSAmIHNiZVllbEFsbSkpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvcHlWYWwgJj0gfnNiZVllbEFsbTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHByX3dhcm5pbmcoIiVzOiBFMSBQb3J0ICVkIFJBSSBhbGFybSBlbmRlZC5cbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpLT5kZXZuYW1lLCBwb3J0bnVtKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICghKGNvcHlWYWwgJiBzYmVZZWxBbG0pICYmICh2YWx1ZSAmIHNiZVllbEFsbSkpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvcHlWYWwgfD0gc2JlWWVsQWxtOworICAgICAgICAgICAgICAgICAgICAgICAgcHJfd2FybmluZygiJXM6IEUxIFdhcm5pbmc6IFBvcnQgJWQgUkFJIGFsYXJtLlxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2ktPmRldm5hbWUsIHBvcnRudW0pOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChjb3B5VmFsICYgc2JlRTFSTUFJKSAmJiAhKHZhbHVlICYgc2JlRTFSTUFJKSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgY29weVZhbCAmPSB+c2JlRTFSTUFJOworICAgICAgICAgICAgICAgICAgICAgICAgcHJfd2FybmluZygiJXM6IEUxIFBvcnQgJWQgUk1BSSBhbGFybSBlbmRlZC5cbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpLT5kZXZuYW1lLCBwb3J0bnVtKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICghKGNvcHlWYWwgJiBzYmVFMVJNQUkpICYmICh2YWx1ZSAmIHNiZUUxUk1BSSkpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvcHlWYWwgfD0gc2JlRTFSTUFJOworICAgICAgICAgICAgICAgICAgICAgICAgcHJfd2FybmluZygiJXM6IEUxIFdhcm5pbmc6IFBvcnQgJWQgUk1BSSBhbGFybS5cbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpLT5kZXZuYW1lLCBwb3J0bnVtKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgoY29weVZhbCAmIHNiZUFJU0FsbSkgJiYgISh2YWx1ZSAmIHNiZUFJU0FsbSkpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvcHlWYWwgJj0gfnNiZUFJU0FsbTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHByX3dhcm5pbmcoIiVzOiBFMSBQb3J0ICVkIEFJUyBhbGFybSBlbmRlZC5cbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpLT5kZXZuYW1lLCBwb3J0bnVtKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICghKGNvcHlWYWwgJiBzYmVBSVNBbG0pICYmICh2YWx1ZSAmIHNiZUFJU0FsbSkpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvcHlWYWwgfD0gc2JlQUlTQWxtOworICAgICAgICAgICAgICAgICAgICAgICAgcHJfd2FybmluZygiJXM6IEUxIFdhcm5pbmc6IFBvcnQgJWQgQUlTIGFsYXJtLlxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2ktPmRldm5hbWUsIHBvcnRudW0pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIC8qIGVuZCBvZiBFMSBhbGFybSBjb2RlICovCisgICAgICAgICAgICB9IGVsc2UKKyAgICAgICAgICAgIHsgICAgICAgICAgICAgICAgICAgICAgIC8qIGlmIGEgVDEgbW9kZSAqLworICAgICAgICAgICAgICAgIHZhbHVlID0gcGNpX3JlYWRfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT50MV9hbG1pX2lzdHMpOyAgICAgICAvKiBhbGFybXMgKi8KKyAgICAgICAgICAgICAgICB2YWx1ZSAmPSBzYmVBbGFybXNNYXNrOworICAgICAgICAgICAgICAgIGlmICh2YWx1ZSAhPSAoY29weVZhbCAmIHNiZUFsYXJtc01hc2spKQorICAgICAgICAgICAgICAgIHsgICAgICAgICAgICAgICAgICAgLyogaWYgYWxhcm1zIGNoYW5nZWQgKi8KKyAgICAgICAgICAgICAgICAgICAgY29weVZhbCB8PSAweDEwOy8qIGNoYW5nZSBMRUQgc3RhdHVzICAgKi8KKyAgICAgICAgICAgICAgICAgICAgaWYgKChjb3B5VmFsICYgc2JlUmVkQWxtKSAmJiAhKHZhbHVlICYgc2JlUmVkQWxtKSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgY29weVZhbCAmPSB+c2JlUmVkQWxtOworICAgICAgICAgICAgICAgICAgICAgICAgcHJfd2FybmluZygiJXM6IFBvcnQgJWQgcmVkIGFsYXJtIGVuZGVkLlxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2ktPmRldm5hbWUsIHBvcnRudW0pOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCEoY29weVZhbCAmIHNiZVJlZEFsbSkgJiYgKHZhbHVlICYgc2JlUmVkQWxtKSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgY29weVZhbCB8PSBzYmVSZWRBbG07CisgICAgICAgICAgICAgICAgICAgICAgICBwcl93YXJuaW5nKCIlczogV2FybmluZzogUG9ydCAlZCByZWQgYWxhcm0uXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaS0+ZGV2bmFtZSwgcG9ydG51bSk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKGNvcHlWYWwgJiBzYmVZZWxBbG0pICYmICEodmFsdWUgJiBzYmVZZWxBbG0pKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBjb3B5VmFsICY9IH5zYmVZZWxBbG07CisgICAgICAgICAgICAgICAgICAgICAgICBwcl93YXJuaW5nKCIlczogUG9ydCAlZCB5ZWxsb3cgKFJBSSkgYWxhcm0gZW5kZWQuXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaS0+ZGV2bmFtZSwgcG9ydG51bSk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIShjb3B5VmFsICYgc2JlWWVsQWxtKSAmJiAodmFsdWUgJiBzYmVZZWxBbG0pKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBjb3B5VmFsIHw9IHNiZVllbEFsbTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHByX3dhcm5pbmcoIiVzOiBXYXJuaW5nOiBQb3J0ICVkIHllbGxvdyAoUkFJKSBhbGFybS5cbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpLT5kZXZuYW1lLCBwb3J0bnVtKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgoY29weVZhbCAmIHNiZUFJU0FsbSkgJiYgISh2YWx1ZSAmIHNiZUFJU0FsbSkpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvcHlWYWwgJj0gfnNiZUFJU0FsbTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHByX3dhcm5pbmcoIiVzOiBQb3J0ICVkIGJsdWUgKEFJUykgYWxhcm0gZW5kZWQuXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaS0+ZGV2bmFtZSwgcG9ydG51bSk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIShjb3B5VmFsICYgc2JlQUlTQWxtKSAmJiAodmFsdWUgJiBzYmVBSVNBbG0pKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBjb3B5VmFsIHw9IHNiZUFJU0FsbTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHByX3dhcm5pbmcoIiVzOiBXYXJuaW5nOiBQb3J0ICVkIGJsdWUgKEFJUykgYWxhcm0uXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaS0+ZGV2bmFtZSwgcG9ydG51bSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9ICAgICAgICAgICAgICAgICAgICAgICAvKiBlbmQgVDEgbW9kZSBhbGFybSBjaGVja3MgKi8KKyAgICAgICAgfQorICAgICAgICBpZiAoY29weVZhbCAmIHNiZUFsYXJtc01hc2spCisgICAgICAgICAgICBjb3B5VmFsIHw9IDB4ODA7ICAgICAgICAvKiBpZiBhbGFybSB0dXJuIHllbCBMRUQgb24gKi8KKyAgICAgICAgaWYgKGNvcHlWYWwgJiAweDEwKQorICAgICAgICAgICAgTEVEdmFsIHw9IDB4MTAwOyAgICAgICAgLyogdGFnIGlmIExFRCB2YWx1ZXMgaGF2ZSBjaGFuZ2VkICAqLworICAgICAgICBMRUR2YWwgfD0gKChjb3B5VmFsICYgMHhjMCkgPj4gKDYgLSAocG9ydG51bSAqIDIpKSk7CisKKyAgICAgICAgY2ktPmFsYXJtZWRbcG9ydG51bV0gJj0gMHhmZmZmZjAwMDsgICAgIC8qIG91dCB3aXRoIHRoZSBvbGQgKGl0J3MgZmZmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiAuLi4gZm9vKSAqLworICAgICAgICBjaS0+YWxhcm1lZFtwb3J0bnVtXSB8PSAoY29weVZhbCk7ICAgICAgLyogaW4gd2l0aCB0aGUgbmV3ICovCisKKyAgICAgICAgLyoKKyAgICAgICAgICogZW5vdWdoIHdpdGggdGhlIGFsYXJtcyBhbmQgTEVEJ3MsIG5vdyBsZXQncyBjaGVjayBmb3IgbG9vcGJhY2sKKyAgICAgICAgICogcmVxdWVzdHMKKyAgICAgICAgICovCisKKyAgICAgICAgaWYgKElTX0ZSQU1FX0FOWV9UMSAoY2ktPnBvcnRbcG9ydG51bV0ucC5wb3J0X21vZGUpKQorICAgICAgICB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaWYgYSBUMSBtb2RlICAqLworICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAqIGJlZ2luIGluLWJhbmQgKFNGKSBsb29wYmFjayBjb2RlIGRldGVjdGlvbiAtLSBzdGFydCBieSByZWFkaW5nCisgICAgICAgICAgICAgKiBjb21tYW5kCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHZhbHVlID0gcGNpX3JlYWRfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5pYmNkX2llcyk7ICAgICAgIC8qIGRldGVjdCByZWcuICovCisgICAgICAgICAgICB2YWx1ZSAmPSAweDM7ICAgICAgICAgICAvKiB0cmltIHRvIGhhbmR5IGJpdHMgKi8KKyAgICAgICAgICAgIGlmICh2YWx1ZSAmIDB4MikKKyAgICAgICAgICAgIHsgICAgICAgICAgICAgICAgICAgICAgIC8qIGFjdGl2YXRlIGxvb3BiYWNrIChzZXRzIGZvciBkZWFjdGl2YXRlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBjb2RlIGxlbmd0aCkgKi8KKyAgICAgICAgICAgICAgICBjb3B5VmFsID0gYzRfbG9vcF9wb3J0IChjaSwgcG9ydG51bSwgQ09NRVRfTEJDTURfUkVBRCk7IC8qIHJlYWQgbGluZSBsb29wYmFjaworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogbW9kZSAqLworICAgICAgICAgICAgICAgIGlmIChjb3B5VmFsICE9IENPTUVUX01ESUFHX0xJTkVMQikgICAgICAvKiBkb24ndCBkbyBpdCBhZ2FpbiBpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBhbHJlYWR5IGluIHRoYXQgbW9kZSAqLworICAgICAgICAgICAgICAgICAgICBjNF9sb29wX3BvcnQgKGNpLCBwb3J0bnVtLCBDT01FVF9NRElBR19MSU5FTEIpOyAgICAgLyogcHV0IHBvcnQgaW4gbGluZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogbG9vcGJhY2sgbW9kZSAqLworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHZhbHVlICYgMHgxKQorICAgICAgICAgICAgeyAgICAgICAgICAgICAgICAgICAgICAgLyogZGVhY3RpdmF0ZSBsb29wYmFjayAoc2V0cyBmb3IgYWN0aXZhdGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGNvZGUgbGVuZ3RoKSAqLworICAgICAgICAgICAgICAgIGNvcHlWYWwgPSBjNF9sb29wX3BvcnQgKGNpLCBwb3J0bnVtLCBDT01FVF9MQkNNRF9SRUFEKTsgLyogcmVhZCBsaW5lIGxvb3BiYWNrCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBtb2RlICovCisgICAgICAgICAgICAgICAgaWYgKGNvcHlWYWwgIT0gQ09NRVRfTURJQUdfTEJPRkYpICAgICAgIC8qIGRvbid0IGRvIGl0IGFnYWluIGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGFscmVhZHkgaW4gdGhhdCBtb2RlICovCisgICAgICAgICAgICAgICAgICAgIGM0X2xvb3BfcG9ydCAoY2ksIHBvcnRudW0sIENPTUVUX01ESUFHX0xCT0ZGKTsgICAgICAvKiB0YWtlIHBvcnQgb3V0IG9mIGFueQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogbG9vcGJhY2sgbW9kZSAqLworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmIChJU19GUkFNRV9BTllfVDFFU0YgKGNpLT5wb3J0W3BvcnRudW1dLnAucG9ydF9tb2RlKSkKKyAgICAgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlmIGEgVDEgRVNGIG1vZGUgICovCisgICAgICAgICAgICAvKiBiZWdpbiBFU0YgbG9vcGJhY2sgY29kZSAqLworICAgICAgICAgICAgdmFsdWUgPSBwY2lfcmVhZF8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPnQxX3Jib2Nfc3RzKSAmIDB4M2Y7ICAgICAvKiByZWFkIGNvbW1hbmQgKi8KKyAgICAgICAgICAgIGlmICh2YWx1ZSA9PSAweDA3KQorICAgICAgICAgICAgICAgIGM0X2xvb3BfcG9ydCAoY2ksIHBvcnRudW0sIENPTUVUX01ESUFHX0xJTkVMQik7IC8qIHB1dCBwb3J0IGluIGxpbmUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBsb29wYmFjayBtb2RlICovCisgICAgICAgICAgICBpZiAodmFsdWUgPT0gMHgwYSkKKyAgICAgICAgICAgICAgICBjNF9sb29wX3BvcnQgKGNpLCBwb3J0bnVtLCBDT01FVF9NRElBR19QQVlMQik7ICAvKiBwdXQgcG9ydCBpbiBwYXlsb2FkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogbG9vcGJrIG1vZGUgKi8KKyAgICAgICAgICAgIGlmICgodmFsdWUgPT0gMHgxYykgfHwgKHZhbHVlID09IDB4MTkpIHx8ICh2YWx1ZSA9PSAweDEyKSkKKyAgICAgICAgICAgICAgICBjNF9sb29wX3BvcnQgKGNpLCBwb3J0bnVtLCBDT01FVF9NRElBR19MQk9GRik7ICAvKiB0YWtlIHBvcnQgb3V0IG9mIGFueQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGxvb3BiayBtb2RlICovCisgICAgICAgICAgICBpZiAobG9nX2xldmVsID49IExPR19ERUJVRykKKyAgICAgICAgICAgICAgICBpZiAodmFsdWUgIT0gMHgzZikKKyAgICAgICAgICAgICAgICAgICAgcHJfd2FybmluZygiJXM6IEJPQyB2YWx1ZSA9ICV4IG9uIFBvcnQgJWRcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2ktPmRldm5hbWUsIHZhbHVlLCBwb3J0bnVtKTsKKyAgICAgICAgICAgIC8qIGVuZCBFU0YgbG9vcGJhY2sgY29kZSAqLworICAgICAgICB9CisgICAgfQorCisgICAgLyogaWYgc29tZXRoaW5nIGlzIG5ldywgdXBkYXRlIExFRCdzICovCisgICAgaWYgKExFRHZhbCAmIDB4MTAwKQorICAgICAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNpLT5jcGxkYmFzZS0+bGVkcywgTEVEdmFsICYgMHhmZik7CisjZW5kaWYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKioqIENPTkZJR19TQkVfUE1DQzRfTkNPTU0gKioqLworfQorCisKK1NUQVRJQyB2b2lkCitjNF93YXRjaGRvZyAoY2lfdCAqIGNpKQoreworI2lmIDAKKyAgICAvL3Vuc2lnbmVkIGxvbmcgZmxhZ3M7CisjZW5kaWYKKworICAgIGlmIChkcnZyX3N0YXRlICE9IFNCRV9EUlZSX0FWQUlMQUJMRSkKKyAgICB7CisgICAgICAgIGlmIChsb2dfbGV2ZWwgPj0gTE9HX01PTklUT1IpCisgICAgICAgICAgICBwcl9pbmZvKCJkcnZyIG5vdCBhdmFpbGFibGUgKCV4KVxuIiwgZHJ2cl9zdGF0ZSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisjaWYgMAorICAgIFNEX1NFTV9UQUtFICgmY2ktPnNlbV93ZGJ1c3ksICJfd2RfIik7ICAgIC8qIG9ubHkgMSB0aHJ1IGhlcmUsIHBlcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGJvYXJkICovCisjZW5kaWYKKworICAgIGNpLT53ZGNvdW50Kys7CisgICAgY2hlY2tQb3J0cyAoY2kpOworI2lmIExJTlVYX1ZFUlNJT05fQ09ERSA8PSBLRVJORUxfVkVSU0lPTigyLDUsNDEpCisgICAgaWYgKGNpLT53ZF9ub3RpZnkpCisgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpcyB0aGVyZSBhIHN0YXRlIGNoYW5nZSB0byBzZWFyY2ggZm9yICovCisgICAgICAgIGludCAgICAgICAgIHBvcnQsIGdjaGFuOworCisgICAgICAgIGNpLT53ZF9ub3RpZnkgPSAwOyAgICAgICAgICAvKiByZXNldCBub3RpZmljYXRpb24gKi8KKyAgICAgICAgZm9yIChnY2hhbiA9IDA7IGdjaGFuIDwgTVVTWUNDX05DSEFOUzsgZ2NoYW4rKykKKyAgICAgICAgeworICAgICAgICAgICAgZm9yIChwb3J0ID0gMDsgcG9ydCA8IGNpLT5tYXhfcG9ydDsgcG9ydCsrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIG1jaF90ICAgICAgKmNoID0gY2ktPnBvcnRbcG9ydF0uY2hhbltnY2hhbl07CisKKyAgICAgICAgICAgICAgICBpZiAoIWNoIHx8IGNpLT5zdGF0ZSAhPSBDX1JVTk5JTkcpICAgICAgLyogc3RhdGUgY2hhbmdlZCB3aGlsZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBhY3F1aXJpbmcgc2VtYXBob3JlICovCisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGlmIChjaC0+c3RhdGUgPT0gVVApLyogY2hhbm5lbCBtdXN0IGJlIHNldCB1cCAqLworICAgICAgICAgICAgICAgIHsKKyNpZiAwCisjaWZkZWYgUkxEX1RSQU5TX0RFQlVHCisgICAgICAgICAgICAgICAgICAgIGlmICgxIHx8IGxvZ19sZXZlbCA+PSBMT0dfTU9OSVRPUikKKyNlbHNlCisgICAgICAgICAgICAgICAgICAgIGlmIChsb2dfbGV2ZWwgPj0gTE9HX01PTklUT1IpCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgIHByX2luZm8oIiVzOiB3YXRjaGRvZyByZXZpdmluZyBQb3J0ICVkIENoYW5uZWwgJWQgWyVkXSBzdHMgJXgvJXgsIHN0YXJ0X1RYICV4IGZyZWUgJXggc3RhcnRfUlggJXhcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgY2ktPmRldm5hbWUsIGNoLT5jaGFubnVtLCBwb3J0LCBnY2hhbiwgY2gtPmNoYW5udW0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoLT5wLnN0YXR1cywgY2gtPnN0YXR1cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaC0+Y2hfc3RhcnRfdHgsIGNoLT50eGRfZnJlZSwgY2gtPmNoX3N0YXJ0X3J4KTsKKyNlbmRpZgorCisgICAgICAgICAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworICAgICAgICAgICAgICAgICAgICAvKiogY2hlY2sgZm9yIFJYIHJlc3RhcnQgcmVxdWVzdCAqKi8KKyAgICAgICAgICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNoLT5jaF9zdGFydF9yeCAmJgorICAgICAgICAgICAgICAgICAgICAgICAgKGNoLT5zdGF0dXMgJiBSWF9FTkFCTEVEKSkgICAgICAvKiByZXF1aXJlcyBzdGFydCBvbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBlbmFibGVkIFJYICovCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNoLT5jaF9zdGFydF9yeCA9IDA7ICAgIC8qIHdlIGFyZSByZXN0YXJ0aW5nIFJYLi4uICovCisjaWZkZWYgUkxEX1RSQU5TX0RFQlVHCisgICAgICAgICAgICAgICAgICAgICAgICBwcl9pbmZvKCIrKyBjNF93YXRjaGRvZygpIENIQU4gUlggQUNUSVZBVEU6IGNoYW4gJWRcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoLT5jaGFubnVtKTsKKyNlbmRpZgorI2lmZGVmIFJMRF9SWEFDVF9ERUJVRworICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtZGVzYyAqbWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGljIGludCAgaGVyZWI0ID0gNzsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChoZXJlYjQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZXJlYjQtLTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWQgPSAmY2gtPm1kcltjaC0+cnhpeF9pcnFfc3J2XTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJfaW5mbygiKysgYzRfd2F0Y2hkb2dbJWRdIENIQU4gUlggQUNUSVZBVEU6IHJ4aXhfaXJxX3NydiAlZCwgbWQgJXAgc3RzICV4LCByeHBrdCAlbHVcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2gtPmNoYW5udW0sIGNoLT5yeGl4X2lycV9zcnYsIG1kLCBsZTMyX3RvX2NwdSAobWQtPnN0YXR1cyksIGNoLT5zLnJ4X3BhY2tldHMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtdXN5Y2NfZHVtcF9yeGJ1ZmZlcl9yaW5nIChjaCwgMSk7ICAgICAgLyogUkxEIERFQlVHICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICBtdXN5Y2Nfc2Vydl9yZXEgKGNoLT51cCwgU1JfQ0hBTk5FTF9BQ1RJVkFURSB8IFNSX1JYX0RJUkVDVElPTiB8IGdjaGFuKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyAgICAgICAgICAgICAgICAgICAgLyoqIGNoZWNrIGZvciBUWCByZXN0YXJ0IHJlcXVlc3QgKiovCisgICAgICAgICAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisgICAgICAgICAgICAgICAgICAgIGlmIChjaC0+Y2hfc3RhcnRfdHggJiYKKyAgICAgICAgICAgICAgICAgICAgICAgIChjaC0+c3RhdHVzICYgVFhfRU5BQkxFRCkpICAgICAgLyogcmVxdWlyZXMgc3RhcnQgb24KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogZW5hYmxlZCBUWCAqLworICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWRlc2MgKm1kOworCisgICAgICAgICAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAgICAgICAgICogZmluZCBuZXh0IHVucHJvY2Vzc2VkIG1lc3NhZ2UsIHRoZW4gc2V0IFRYIHRocCB0bworICAgICAgICAgICAgICAgICAgICAgICAgICogaXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICAgICAgbXVzeWNjX3VwZGF0ZV90eF90aHAgKGNoKTsKKworI2lmIDAKKyAgICAgICAgICAgICAgICAgICAgICAgIHNwaW5fbG9ja19pcnFzYXZlICgmY2gtPmNoX3R4bG9jaywgZmxhZ3MpOworI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICBtZCA9IGNoLT50eGRfaXJxX3NydjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghbWQpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJfaW5mbygiLS0gYzRfd2F0Y2hkb2dbJWRdOiBXQVJOSU5HLCBzdGFydGluZyBOVUxMIG1kXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2gtPmNoYW5udW0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByX2luZm8oIi0tICAgY2hhbiAlZCB0eGRfaXJxX3NydiAlcCBzdHMgJXggdXNyX2FkZCAlcCBzdHMgJXgsIHR4cGt0ICVsdVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoLT5jaGFubnVtLCBjaC0+dHhkX2lycV9zcnYsIGxlMzJfdG9fY3B1ICgoc3RydWN0IG1kZXNjICopIChjaC0+dHhkX2lycV9zcnYpLT5zdGF0dXMpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2gtPnR4ZF91c3JfYWRkLCBsZTMyX3RvX2NwdSAoKHN0cnVjdCBtZGVzYyAqKSAoY2gtPnR4ZF91c3JfYWRkKS0+c3RhdHVzKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoLT5zLnR4X3BhY2tldHMpOworI2lmIDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcGluX3VubG9ja19pcnFyZXN0b3JlICgmY2gtPmNoX3R4bG9jaywgZmxhZ3MpOworI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1kLT5kYXRhICYmICgobGUzMl90b19jcHUgKG1kLT5zdGF0dXMpKSAmIE1VU1lDQ19UWF9PV05FRCkpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisjaWZkZWYgUkxEX1RSQU5TX0RFQlVHCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJfaW5mbygiKysgYzRfd2F0Y2hkb2dbJWRdIENIQU4gVFggQUNUSVZBVEU6IHN0YXJ0X3R4ICV4XG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2gtPmNoYW5udW0sIGNoLT5jaF9zdGFydF90eCk7CisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaC0+Y2hfc3RhcnRfdHggPSAwOyAgICAgICAgLyogd2UgYXJlIHJlc3RhcnRpbmcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogVFguLi4gKi8KKyNpZiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3Bpbl91bmxvY2tfaXJxcmVzdG9yZSAoJmNoLT5jaF90eGxvY2ssIGZsYWdzKTsgICAvKiBhbGxvdyBpbnRlcnJ1cHRzIGZvcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogc2VydmljZSByZXF1ZXN0ICovCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtdXN5Y2Nfc2Vydl9yZXEgKGNoLT51cCwgU1JfQ0hBTk5FTF9BQ1RJVkFURSB8IFNSX1RYX0RJUkVDVElPTiB8IGdjaGFuKTsKKyNpZmRlZiBSTERfVFJBTlNfREVCVUcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMSB8fCBsb2dfbGV2ZWwgPj0gTE9HX01PTklUT1IpCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsb2dfbGV2ZWwgPj0gTE9HX01PTklUT1IpCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJfaW5mbygiKysgU0FDS1tQJWQvQyVkXSBhY2snZCwgY29udGludWluZy4uLlxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaC0+dXAtPnBvcnRudW0sIGNoLT5jaGFubnVtKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyNlbHNlCisgICAgY2ktPndkX25vdGlmeSA9IDA7CisjZW5kaWYKKyNpZiAwCisgICAgU0RfU0VNX0dJVkUgKCZjaS0+c2VtX3dkYnVzeSk7LyogcmVsZWFzZSBwZXItYm9hcmQgaG9sZCAqLworI2VuZGlmCit9CisKKwordm9pZAorYzRfY2xlYW51cCAodm9pZCkKK3sKKyAgICBjaV90ICAgICAgICpjaSwgKm5leHQ7CisgICAgbXBpX3QgICAgICAqcGk7CisgICAgaW50ICAgICAgICAgcG9ydG51bSwgajsKKworICAgIGNpID0gYzRfbGlzdDsKKyAgICB3aGlsZSAoY2kpCisgICAgeworICAgICAgICBuZXh0ID0gY2ktPm5leHQ7ICAgICAgICAgICAgLyogcHJvdGVjdCA8bmV4dD4gZnJvbSB1cGNvbWluZyA8ZnJlZT4gKi8KKyAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjaS0+Y3BsZGJhc2UtPmxlZHMsIFBNQ0M0X0NQTERfTEVEX09GRik7CisgICAgICAgIGZvciAocG9ydG51bSA9IDA7IHBvcnRudW0gPCBjaS0+bWF4X3BvcnQ7IHBvcnRudW0rKykKKyAgICAgICAgeworICAgICAgICAgICAgcGkgPSAmY2ktPnBvcnRbcG9ydG51bV07CisjaWYgTElOVVhfVkVSU0lPTl9DT0RFID4gS0VSTkVMX1ZFUlNJT04oMiw1LDQxKQorICAgICAgICAgICAgYzRfd3FfcG9ydF9jbGVhbnVwIChwaSk7CisjZW5kaWYKKyAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCBNVVNZQ0NfTkNIQU5TOyBqKyspCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKHBpLT5jaGFuW2pdKQorICAgICAgICAgICAgICAgICAgICBPU19rZnJlZSAocGktPmNoYW5bal0pOyAgICAgLyogZnJlZSBtY2hfdCBzdHJ1Y3QgKi8KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIE9TX2tmcmVlIChwaS0+cmVncmFtX3NhdmVkKTsKKyAgICAgICAgfQorI2lmIDAKKyAgICAgICAgLyogb2Jzb2xldGUgLSB3YXRjaGRvZyBpcyBub3cgc3RhdGljIHcvaW4gY2lfdCAqLworICAgICAgICBPU19mcmVlX3dhdGNoZG9nIChjaS0+d2QpOworI2VuZGlmCisgICAgICAgIE9TX2tmcmVlIChjaS0+aXFkX3Bfc2F2ZWQpOworICAgICAgICBPU19rZnJlZSAoY2kpOworICAgICAgICBjaSA9IG5leHQ7ICAgICAgICAgICAgICAgICAgLyogY2xlYW51cCBuZXh0IGJvYXJkLCBpZiBhbnkgKi8KKyAgICB9Cit9CisKKworLyoKKyAqIFRoaXMgZnVuY3Rpb24gaXNzdWVzIGEgd3JpdGUgdG8gYWxsIGNvbWV0IGNoaXBzIGFuZCBleHBlY3RzIHRoZSBzYW1lIGRhdGEKKyAqIHRvIGJlIHJldHVybmVkIGZyb20gdGhlIHN1YnNlcXVlbnQgcmVhZC4gIFRoaXMgZGV0ZXJtaW5lcyB0aGUgYm9hcmQgYnVpbGQKKyAqIHRvIGJlIGEgMS1wb3J0LCAyLXBvcnQsIG9yIDQtcG9ydCBidWlsZC4gIFRoZSB2YWx1ZSByZXR1cm5lZCByZXByZXNlbnRzIGEKKyAqIGJpdC1tYXNrIG9mIHRoZSBmb3VuZCBwb3J0cy4gIE9ubHkgY2VydGFpbiBjb25maWd1cmF0aW9ucyBhcmUgY29uc2lkZXJlZAorICogVkFMSUQgb3IgTEVHQUwgYnVpbGRzLgorICovCisKK2ludAorYzRfZ2V0X3BvcnRjZmcgKGNpX3QgKiBjaSkKK3sKKyAgICBjb21ldF90ICAgICpjb21ldDsKKyAgICBpbnQgICAgICAgICBwb3J0bnVtLCBtYXNrOworICAgIHVfaW50MzJfdCAgIHdkYXRhLCByZGF0YTsKKworICAgIHdkYXRhID0gQ09NRVRfTURJQUdfTEJPRkY7ICAgICAgLyogdGFrZSBwb3J0IG91dCBvZiBhbnkgbG9vcGJhY2sgbW9kZSAqLworCisgICAgbWFzayA9IDA7CisgICAgZm9yIChwb3J0bnVtID0gMDsgcG9ydG51bSA8IE1VU1lDQ19OUE9SVFM7IHBvcnRudW0rKykKKyAgICB7CisgICAgICAgIGNvbWV0ID0gY2ktPnBvcnRbcG9ydG51bV0uY29tZXRiYXNlOworICAgICAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5tZGlhZywgd2RhdGEpOworICAgICAgICByZGF0YSA9IHBjaV9yZWFkXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+bWRpYWcpICYgQ09NRVRfTURJQUdfTEJNQVNLOworICAgICAgICBpZiAod2RhdGEgPT0gcmRhdGEpCisgICAgICAgICAgICBtYXNrIHw9IDEgPDwgcG9ydG51bTsKKyAgICB9CisgICAgcmV0dXJuIG1hc2s7Cit9CisKKworLyogbm90aGluZyBoZXJlaW4gc2hvdWxkIGdlbmVyYXRlIGludGVycnVwdHMgKi8KKworc3RhdHVzX3QgICAgX19pbml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0+Z2xjZCwgR0NEX01BR0lDIHwgTVVTWUNDX0dDRF9JTlRCX0RJU0FCTEUpOworI2VuZGlmCisKKyAgICB7CisgICAgICAgIGludCAgICAgICAgIHBtc2s7CisKKyAgICAgICAgLyogbmVlZCBjb21ldCBhZGRyZXNzZXMgYXZhaWxhYmxlIGZvciBkZXRlcm1pbmF0aW9uIG9mIGhhcmR3YXJlIGJ1aWxkICovCisgICAgICAgIGZvciAocG9ydG51bSA9IDA7IHBvcnRudW0gPCBNVVNZQ0NfTlBPUlRTOyBwb3J0bnVtKyspCisgICAgICAgIHsKKyAgICAgICAgICAgIHBpID0gJmNpLT5wb3J0W3BvcnRudW1dOworICAgICAgICAgICAgcGktPmNvbWV0YmFzZSA9IChjb21ldF90ICopICgodV9pbnQzMl90ICopIChmdW5jMSArIENPTUVUX09GRlNFVCAocG9ydG51bSkpKTsKKyAgICAgICAgICAgIHBpLT5yZWcgPSAoc3RydWN0IG11c3ljY19nbG9iYWxyICopICgodV9jaGFyICopIGNpLT5yZWcgKyAocG9ydG51bSAqIDB4ODAwKSk7CisgICAgICAgICAgICBwaS0+cG9ydG51bSA9IHBvcnRudW07CisgICAgICAgICAgICBwaS0+cC5wb3J0bnVtID0gcG9ydG51bTsKKyAgICAgICAgICAgIHBpLT5vcGVuY2hhbnMgPSAwOworI2lmZGVmIFNCRV9NQVBfREVCVUcKKyAgICAgICAgICAgIHByX2luZm8oIkNvbWV0LSVkOiBhZGRyID0gJXBcbiIsIHBvcnRudW0sIHBpLT5jb21ldGJhc2UpOworI2VuZGlmCisgICAgICAgIH0KKyAgICAgICAgcG1zayA9IGM0X2dldF9wb3J0Y2ZnIChjaSk7CisgICAgICAgIHN3aXRjaCAocG1zaykKKyAgICAgICAgeworICAgICAgICBjYXNlIDB4MToKKyAgICAgICAgICAgIGNpLT5tYXhfcG9ydCA9IDE7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAweDM6CisgICAgICAgICAgICBjaS0+bWF4X3BvcnQgPSAyOworICAgICAgICAgICAgYnJlYWs7CisjaWYgMAorICAgICAgICBjYXNlIDB4NzogICAgICAgICAgICAgICAgICAgLyogbm90IGJ1aWx0LCBidXQgY291bGQgYmUuLi4gKi8KKyAgICAgICAgICAgIGNpLT5tYXhfcG9ydCA9IDM7CisgICAgICAgICAgICBicmVhazsKKyNlbmRpZgorICAgICAgICBjYXNlIDB4ZjoKKyAgICAgICAgICAgIGNpLT5tYXhfcG9ydCA9IDQ7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIGNpLT5tYXhfcG9ydCA9IDA7CisgICAgICAgICAgICBwcl93YXJuaW5nKCIlczogaWxsZWdhbCBwb3J0IGNvbmZpZ3VyYXRpb24gKCV4KVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgY2ktPmRldm5hbWUsIHBtc2spOworICAgICAgICAgICAgcmV0dXJuIFNCRV9EUlZSX0ZBSUw7CisgICAgICAgIH0KKyNpZmRlZiBTQkVfTUFQX0RFQlVHCisgICAgICAgIHByX2luZm8oIj4+ICVzOiBjNF9nZXRfYnVpbGQgLSBwbXNrICV4IG1heF9wb3J0ICV4XG4iLAorICAgICAgICAgICAgICAgIGNpLT5kZXZuYW1lLCBwbXNrLCBjaS0+bWF4X3BvcnQpOworI2VuZGlmCisgICAgfQorCisgICAgZm9yIChwb3J0bnVtID0gMDsgcG9ydG51bSA8IGNpLT5tYXhfcG9ydDsgcG9ydG51bSsrKQorICAgIHsKKyAgICAgICAgcGkgPSAmY2ktPnBvcnRbcG9ydG51bV07CisgICAgICAgIHBpLT51cCA9IGNpOworICAgICAgICBwaS0+c3JfbGFzdCA9IDB4ZmZmZmZmZmY7CisgICAgICAgIHBpLT5wLnBvcnRfbW9kZSA9IENGR19GUkFNRV9TRjsgLyogVDEgQjhaUywgdGhlIGRlZmF1bHQgKi8KKyAgICAgICAgcGktPnAucG9ydFAgPSAoQ0ZHX0NMS19QT1JUX0VYVEVSTkFMIHwgQ0ZHX0xCT19MSDApOyAgICAvKiBUMSBkZWZhdWx0cyAqLworCisgICAgICAgIE9TX3NlbV9pbml0ICgmcGktPnNyX3NlbV9idXN5LCBTRU1fQVZBSUxBQkxFKTsKKyAgICAgICAgT1Nfc2VtX2luaXQgKCZwaS0+c3Jfc2VtX3dhaXQsIFNFTV9UQUtFTik7CisKKyAgICAgICAgZm9yIChqID0gMDsgaiA8IDMyOyBqKyspCisgICAgICAgIHsKKyAgICAgICAgICAgIHBpLT5maWZvbWFwW2pdID0gLTE7CisgICAgICAgICAgICBwaS0+dHNtW2pdID0gMDsgICAgICAgICAvKiBubyBhc3NpZ25tZW50cywgYWxsIGF2YWlsYWJsZSAqLworICAgICAgICB9CisKKyAgICAgICAgLyogYWxsb2NhdGUgY2hhbm5lbCBzdHJ1Y3R1cmVzIGZvciB0aGlzIHBvcnQgKi8KKyAgICAgICAgZm9yIChqID0gMDsgaiA8IE1VU1lDQ19OQ0hBTlM7IGorKykKKyAgICAgICAgeworICAgICAgICAgICAgY2ggPSBPU19rbWFsbG9jIChzaXplb2YgKG1jaF90KSk7CisgICAgICAgICAgICBpZiAoY2gpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcGktPmNoYW5bal0gPSBjaDsKKyAgICAgICAgICAgICAgICBjaC0+c3RhdGUgPSBVTkFTU0lHTkVEOworICAgICAgICAgICAgICAgIGNoLT51cCA9IHBpOworICAgICAgICAgICAgICAgIGNoLT5nY2hhbiA9ICgtMSk7ICAgLyogY2hhbm5lbCBhc3NpZ25tZW50IG5vdCB5ZXQga25vd24gKi8KKyAgICAgICAgICAgICAgICBjaC0+Y2hhbm51bSA9ICgtMSk7IC8qIGNoYW5uZWwgYXNzaWdubWVudCBub3QgeWV0IGtub3duICovCisgICAgICAgICAgICAgICAgY2gtPnAuY2FyZCA9IGNpLT5icmRubzsKKyAgICAgICAgICAgICAgICBjaC0+cC5wb3J0ID0gcG9ydG51bTsKKyAgICAgICAgICAgICAgICBjaC0+cC5jaGFubnVtID0gKC0xKTsgICAvKiBjaGFubmVsIGFzc2lnbm1lbnQgbm90IHlldCBrbm93biAqLworICAgICAgICAgICAgICAgIGNoLT5wLm1vZGVfNTZrID0gMDsgLyogZGVmYXVsdCBpcyA2NGticHMgbW9kZSAqLworICAgICAgICAgICAgfSBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcHJfd2FybmluZygiZmFpbGVkIG1jaF90IG1hbGxvYywgcG9ydCAlZCBjaGFubmVsICVkIHNpemUgJXUuXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9ydG51bSwgaiwgKHVuc2lnbmVkIGludCkgc2l6ZW9mIChtY2hfdCkpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisKKyAgICB7CisgICAgICAgIC8qCisgICAgICAgICAqIFNldCBMRURzIHRocm91Z2ggdGhlaXIgcGFjZXMgdG8gc3VwcGx5IHZpc3VhbCBwcm9vZiB0aGF0IExFRHMgYXJlCisgICAgICAgICAqIGZ1bmN0aW9uYWwgYW5kIG5vdCBidXJudCBvdXQgbm9yIGJyb2tlbi4KKyAgICAgICAgICoKKyAgICAgICAgICogWUVMTE9XICsgR1JFRU4gLT4gT0ZGLgorICAgICAgICAgKi8KKworICAgICAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNpLT5jcGxkYmFzZS0+bGVkcywKKyAgICAgICAgICAgICAgICAgICAgICBQTUNDNF9DUExEX0xFRF9HUkVFTiB8IFBNQ0M0X0NQTERfTEVEX1lFTExPVyk7CisgICAgICAgIE9TX3V3YWl0ICg3NTAwMDAsICJsZWRzIik7CisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY2ktPmNwbGRiYXNlLT5sZWRzLCBQTUNDNF9DUExEX0xFRF9PRkYpOworICAgIH0KKworICAgIE9TX2luaXRfd2F0Y2hkb2cgKCZjaS0+d2QsICh2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GJlKS4gKi8KKworaW50CitjNF9sb29wX3BvcnQgKGNpX3QgKiBjaSwgaW50IHBvcnRudW0sIHVfaW50OF90IGNtZCkKK3sKKyAgICBjb21ldF90ICAgICpjb21ldDsKKyAgICB2b2xhdGlsZSB1X2ludDMyX3QgbG9vcFZhbHVlOworCisgICAgY29tZXQgPSBjaS0+cG9ydFtwb3J0bnVtXS5jb21ldGJhc2U7CisgICAgbG9vcFZhbHVlID0gcGNpX3JlYWRfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5tZGlhZykgJiBDT01FVF9NRElBR19MQk1BU0s7CisKKyAgICBpZiAoY21kICYgQ09NRVRfTEJDTURfUkVBRCkKKyAgICAgICAgcmV0dXJuIGxvb3BWYWx1ZTsgICAgICAgICAgIC8qIHJldHVybiB0aGUgcmVhZCB2YWx1ZSAqLworCisgICAgaWYgKGxvb3BWYWx1ZSAhPSBjbWQpCisgICAgeworICAgICAgICBzd2l0Y2ggKGNtZCkKKyAgICAgICAgeworICAgICAgICBjYXNlIENPTUVUX01ESUFHX0xJTkVMQjoKKyAgICAgICAgICAgIC8qIHNldChTRilsb29wYmFjayBkb3duICh0dXJuIG9mZikgY29kZSBsZW5ndGggdG8gNiBiaXRzICovCisgICAgICAgICAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5pYmNkX2NmZywgMHgwNSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBDT01FVF9NRElBR19MQk9GRjoKKyAgICAgICAgICAgIC8qIHNldCAoU0YpIGxvb3BiYWNrIHVwICh0dXJuIG9uKSBjb2RlIGxlbmd0aCB0byA1IGJpdHMgKi8KKyAgICAgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPmliY2RfY2ZnLCAweDAwKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZj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pZmljYWxseToKKyAqICAgcHAucG9ydG51bSAgICAgKG9uZSBndWVzcykKKyAqICAgcHAucG9ydF9tb2RlICAgb2Zmc2V0IG9mIHJlZ2lzdGVyCisgKiAgIHBwLnBvcnRQICAgICAgIHdyaXRlIChvciBub3QsIGkuZS4gcmVhZCkKKyAqICAgcHAucG9ydFN0YXR1cyAgd3JpdGUgdmFsdWUKKyAqIEJUVzoKKyAqICAgcHAucG9ydFN0YXR1cyAgYWxzbyB1c2VkIHRvIHJldHVybiByZWFkIHZhbHVlCisgKiAgIHBwLnBvcnRQICAgICAgIGFsc28gdXNlZCBkdXJpbmcgd3JpdGUsIHRvIHJldHVybiBvbGQgcmVnIHZhbHVlCisgKi8KKworc3RhdHVzX3QKK2M0X2ZyYW1lX3J3IChjaV90ICogY2ksIHN0cnVjdCBzYmVjb21fcG9ydF9wYXJhbSAqIHBwKQoreworICAgIGNvbWV0X3QgICAgKmNvbWV0OworICAgIHZvbGF0aWxlIHVfaW50MzJfdCBkYXRhOworCisgICAgaWYgKHBwLT5wb3J0bnVtID49IGNpLT5tYXhfcG9ydCkvKiBzYW5pdHkgY2hlY2sgKi8KKyAgICAgICAgcmV0dXJuIEVOWElPOworCisgICAgY29tZXQgPSBjaS0+cG9ydFtwcC0+cG9ydG51bV0uY29tZXRiYXNlOworICAgIGRhdGEgPSBwY2lfcmVhZF8zMiAoKHVfaW50MzJfdCAqKSBjb21ldCArIHBwLT5wb3J0X21vZGUpICYgMHhmZjsKKworICAgIGlmIChwcC0+cG9ydFApCisgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBjb250cm9sIHNheXMgdGhpcyBpcyBhIHJlZ2lzdGVyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBfd3JpdGVfICovCisgICAgICAgIGlmIChwcC0+cG9ydFN0YXR1cyA9PSBkYXRhKQorICAgICAgICAgICAgcHJfaW5mbygiJXM6IFBvcnQgJWQgYWxyZWFkeSB0aGF0IHZhbHVlISAgV3JpdGluZyBhZ2FpbiBhbnlob3cuXG4iLAorICAgICAgICAgICAgICAgICAgICBjaS0+ZGV2bmFtZSwgcHAtPnBvcnRudW0pOworICAgICAgICBwcC0+cG9ydFAgPSAodV9pbnQ4X3QpIGRhdGE7CisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSBjb21ldCArIHBwLT5wb3J0X21vZGUsCisgICAgICAgICAgICAgICAgICAgICAgcHAtPnBvcnRTdGF0dXMpOworICAgICAgICBkYXRhID0gcGNpX3JlYWRfMzIgKCh1X2ludDMyX3QgKikgY29tZXQgKyBwcC0+cG9ydF9tb2RlKSAmIDB4ZmY7CisgICAgfQorICAgIHBwLT5wb3J0U3RhdHVzID0gKHVfaW50OF90KSBkYXRhOworICAgIHJldHVybiAwOworfQorCisKKy8qIGM0X3BsZF9ydzogcmVhZCBvciB3cml0ZSB0aGUgcGxkIHJlZ2lzdGVyIHNwZWNpZmllZAorICogKG1vZGlmaWVzIHVzZSBvZiBwb3J0X3BhcmFtIHRvIG5vbi1zdGFuZGFyZCB1c2Ugb2Ygc3RydWN0KQorICogU3BlY2lmaWNhbGx5OgorICogICBwcC5wb3J0X21vZGUgICBvZmZzZXQgb2YgcmVnaXN0ZXIKKyAqICAgcHAucG9ydFAgICAgICAgd3JpdGUgKG9yIG5vdCwgaS5lLiByZWFkKQorICogICBwcC5wb3J0U3RhdHVzICB3cml0ZSB2YWx1ZQorICogQlRXOgorICogICBwcC5wb3J0U3RhdHVzICBhbHNvIHVzZWQgdG8gcmV0dXJuIHJlYWQgdmFsdWUKKyAqICAgcHAucG9ydFAgICAgICAgYWxzbyB1c2VkIGR1cmluZyB3cml0ZSwgdG8gcmV0dXJuIG9sZCByZWcgdmFsdWUKKyAqLworCitzdGF0dXNfdAorYzRfcGxkX3J3IChjaV90ICogY2ksIHN0cnVjdCBzYmVjb21fcG9ydF9wYXJhbSAqIHBwKQoreworICAgIHZvbGF0aWxlIHVfaW50MzJfdCAqcmVnYWRkcjsKKyAgICB2b2xhdGlsZSB1X2ludDMyX3QgZGF0YTsKKyAgICBpbnQgICAgICAgICByZWdudW0gPSBwcC0+cG9ydF9tb2RlOworCisgICAgcmVnYWRkciA9ICh1X2ludDMyX3QgKikgY2ktPmNwbGRiYXNlICsgcmVnbnVtOworICAgIGRhdGEgPSBwY2lfcmVhZF8zMiAoKHVfaW50MzJfdCAqKSByZWdhZGRyKSAmIDB4ZmY7CisKKyAgICBpZiAocHAtPnBvcnRQKQorICAgIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogY29udHJvbCBzYXlzIHRoaXMgaXMgYSByZWdpc3RlcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogX3dyaXRlXyAqLworICAgICAgICBwcC0+cG9ydFAgPSAodV9pbnQ4X3QpIGRhdGE7CisgICAgICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSByZWdhZGRyLCBwcC0+cG9ydFN0YXR1cyk7CisgICAgICAgIGRhdGEgPSBwY2lfcmVhZF8zMiAoKHVfaW50MzJfdCAqKSByZWdhZGRyKSAmIDB4ZmY7CisgICAgfQorICAgIHBwLT5wb3J0U3RhdHVzID0gKHVfaW50OF90KSBkYXRhOworICAgIHJldHVybiAwOworfQorCisvKiBjNF9tdXN5Y2Nfcnc6IHJlYWQgb3Igd3JpdGUgdGhlIG11c3ljYyByZWdpc3RlciBzcGVjaWZpZWQKKyAqIChtb2RpZmllcyB1c2Ugb2YgcG9ydF9wYXJhbSB0byBub24tc3RhbmRhcmQgdXNlIG9mIHN0cnVjdCkKKyAqIFNwZWNpZmljYWxseToKKyAqICAgIG1jcC5SV3BvcnRudW0gICBwb3J0IG51bWJlciBhbmQgd3JpdGUgaW5kaWNhdGlvbiBiaXQgKDB4ODApCisgKiAgICBtY3Aub2Zmc2V0ICAgICAgb2Zmc2V0IG9mIHJlZ2lzdGVyCisgKiAgICBtY3AudmFsdWUgICAgICAgd3JpdGUgdm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1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogdXNhZ2UgKi8KKyAgICBpbnQgICAgICAgICBvZmZzZXQgPSBtY3AtPm9mZnNldCAlIDB4ODAwOyAgIC8qIGdyb3VwIHJlbGF0aXZlIGFkZHJlc3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIG9mZnNldCwgbWNwLT5wb3J0bnVtIGlzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBub3QgdXNlZCAqLworICAgIGludCAgICAgICAgIHBvcnRudW0sIHJhbXJlYWQgPSAwOworICAgIHZvbGF0aWxlIHVfaW50MzJfdCBkYXRhOworCisgICAgLyoKKyAgICAgKiBTYW5pdHkgY2hlY2sgaGFyZHdhcmUgYWNjZXNzaWJpbGl0eS4gIFRoZSAweDYwMDAgcG9ydGlvbiBoYW5kbGVzIHBvcnQKKyAgICAgKiBudW1iZXJzIGFzc29jaWF0ZWQgd2l0aCBNc2cgRGVzY3IgVGJsIGRlY29kaW5nLgorICAgICAqLworICAgIHBvcnRudW0gPSAobWNwLT5vZmZzZXQgJSAweDYwMDApIC8gMHg4MDA7CisgICAgaWYgKHBvcnRudW0gPj0gY2ktPm1heF9wb3J0KQorICAgICAgICByZXR1cm4gRU5YSU87CisgICAgcGkgPSAmY2ktPnBvcnRbcG9ydG51bV07CisgICAgaWYgKG1jcC0+b2Zmc2V0ID49IDB4NjAwMCkKKyAgICAgICAgb2Zmc2V0ICs9IDB4NjAwMDsgICAgICAgICAgIC8qIHB1dCBiYWNrIGluIE1zZ0NmZ0Rlc2MgYWRkcmVzcyBvZmZzZXQgKi8KKyAgICBkcGggPSAodV9pbnQzMl90ICopICgodV9sb25nKSBwaS0+cmVnICsgb2Zmc2V0KTsKKworICAgIC8qIHJlYWQgb2YgVFggYXJlIGZyb20gUkFNIGltYWdlLCBzaW5jZSBoYXJkd2FyZSByZXR1cm5zIEZGICovCisgICAgZHByID0gKHVfaW50MzJfdCAqKSAoKHVfbG9uZykgcGktPnJlZ3JhbSArIG9mZnNldCk7CisgICAgaWYgKG1jcC0+b2Zmc2V0IDwgMHg2MDAwKSAgICAgICAvKiBub24gTXNnRGVzYyBUYmwgYWNjZXNzZXMgbWlnaHQgcmVxdWlyZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogUkFNIGFjY2VzcyAqLworICAgIHsKKyAgICAgICAgaWYgKG9mZnNldCA+PSAweDIwMCAmJiBvZmZzZXQgPCAweDM4MCkKKyAgICAgICAgICAgIHJhbXJlYWQgPSAxOworICAgICAgICBpZiAob2Zmc2V0ID49IDB4MTAgJiYgb2Zmc2V0IDwgMHgyMDApCisgICAgICAgICAgICByYW1yZWFkID0gMTsKKyAgICB9CisgICAgLyogcmVhZCByZWdpc3RlciBmcm9tIFJBTSBvciBoYXJkd2FyZSwgZGVwZW5kaW5nLi4uICovCisgICAgaWYgKHJhbXJlYWQpCisgICAgeworICAgICAgICBkYXRhID0gKmRwcjsKKyAgICAgICAgLy9wcl9pbmZvKCJjNF9tdXN5Y2Nfcnc6IFJBTSBhZGRyICVwICByZWFkIGRhdGEgJXggKHBvcnRubyAleCBvZmZzZXQgJXggUkFNIHJhbXJlYWQgJXgpXG4iLCBkcHIsIGRhdGEsIHBvcnRudW0sIG9mZnNldCwgcmFtcmVhZCk7IC8qIFJMRCBERUJVRyAqLworICAgIH0gZWxzZQorICAgIHsKKyAgICAgICAgZGF0YSA9IHBjaV9yZWFkXzMyICgodV9pbnQzMl90ICopIGRwaCk7CisgICAgICAgIC8vcHJfaW5mbygiYzRfbXVzeWNjX3J3OiBSRUcgYWRkciAlcCAgcmVhZCBkYXRhICV4IChwb3J0bm8gJXggb2Zmc2V0ICV4IFJBTSByYW1yZWFkICV4KVxuIiwgZHBoLCBkYXRhLCBwb3J0bnVtLCBvZmZzZXQsIHJhbXJlYWQpOyAvKiBSTEQgREVCVUcgKi8KKyAgICB9CisKKworICAgIGlmIChtY3AtPlJXcG9ydG51bSAmIDB4ODApCisgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBjb250cm9sIHNheXMgdGhpcyBpcyBhIHJlZ2lzdGVyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBfd3JpdGVfICovCisgICAgICAgIGlmIChtY3AtPnZhbHVlID09IGRhdGEpCisgICAgICAgICAgICBwcl9pbmZvKCIlczogbXVzeWNjIGdycCVkIGFscmVhZHkgdGhhdCB2YWx1ZSEgd3JpdGluZyBhZ2FpbiBhbnlob3cuXG4iLAorICAgICAgICAgICAgICAgICAgICBjaS0+ZGV2bmFtZSwgKG1jcC0+Uldwb3J0bnVtICYgMHg3KSk7CisgICAgICAgIC8qIHdyaXRlIHJlZ2lzdGVyIFJBTSAqLworICAgICAgICBpZiAocmFtcmVhZCkKKyAgICAgICAgICAgICpkcHIgPSBtY3AtPnZhbHVlOworICAgICAgICAvKiB3cml0ZSBoYXJkd2FyZSByZWdpc3RlciAqLworICAgICAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgZHBoLCBtY3AtPnZhbHVlKTsKKyAgICB9CisgICAgbWNwLT52YWx1ZSA9IGRhdGE7ICAgICAgICAgICAgICAvKiByZXR1cm4gdGhlIHJlYWQgdmFsdWUgKG9yIHRoZSAnb2xkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiB2YWx1ZScsIGlmIGlzIHdyaXRlKSAqLworICAgIHJldHVybiAwOworfQorCitzdGF0dXNfdAorYzRfZ2V0X3BvcnQgKGNpX3QgKiBjaSwgaW50IHBvcnRudW0pCit7CisgICAgaWYgKHBvcnRudW0gPj0gY2ktPm1heF9wb3J0KSAgICAvKiBzYW5pdHkgY2hlY2sgKi8KKyAgICAgICAgcmV0dXJuIEVOWElPOworCisgICAgU0RfU0VNX1RBS0UgKCZjaS0+c2VtX3dkYnVzeSwgIl93ZF8iKTsgICAgICAvKiBvbmx5IDEgdGhydSBoZXJlLCBwZXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGJvYXJkICovCisgICAgY2hlY2tQb3J0cyAoY2kpOworICAgIGNpLT5wb3J0W3BvcnRudW1dLnAucG9ydFN0YXR1cyA9ICh1X2ludDhfdCkgY2ktPmFsYXJtZWRbcG9ydG51bV07CisgICAgY2ktPmFsYXJtZWRbcG9ydG51bV0gJj0gMHhkZjsKKyAgICBTRF9TRU1fR0lWRSAoJmNpLT5zZW1fd2RidXN5KTsgIC8qIHJlbGVhc2UgcGVyLWJvYXJkIGhvbGQgKi8KKyAgICByZXR1cm4gMDsKK30KKworc3RhdHVzX3QKK2M0X3NldF9wb3J0IChjaV90ICogY2ksIGludCBwb3J0bnVtKQoreworICAgIG1waV90ICAgICAgKnBpOworICAgIHN0cnVjdCBzYmVjb21fcG9ydF9wYXJhbSAqcHA7CisgICAgaW50ICAgICAgICAgZTFtb2RlOworICAgIHVfaW50OF90ICAgIGNsY2s7CisgICAgaW50ICAgICAgICAgaTsKKworICAgIGlmIChwb3J0bnVtID49IGNpLT5tYXhfcG9ydCkgICAgLyogc2FuaXR5IGNoZWNrICovCisgICAgICAgIHJldHVybiBFTlhJTzsKKworICAgIHBpID0gJmNpLT5wb3J0W3BvcnRudW1dOworICAgIHBwID0gJmNpLT5wb3J0W3BvcnRudW1dLnA7CisgICAgZTFtb2RlID0gSVNfRlJBTUVfQU5ZX0UxIChwcC0+cG9ydF9tb2RlKTsKKyAgICBpZiAobG9nX2xldmVsID49IExPR19NT05JVE9SMikKKyAgICB7CisgICAgICAgIHByX2luZm8oIiVzOiBjNF9zZXRfcG9ydFslZF06ICBlbnRlcmVkLCBlMW1vZGUgPSAleCwgb3BlbmNoYW5zICVkLlxuIiwKKyAgICAgICAgICAgICAgICBjaS0+ZGV2bmFtZSwKKyAgICAgICAgICAgICAgICBwb3J0bnVtLCBlMW1vZGUsIHBpLT5vcGVuY2hhbnMpOworICAgIH0KKyAgICBpZiAocGktPm9wZW5jaGFucykKKyAgICAgICAgcmV0dXJuIEVCVVNZOyAgICAgICAgICAgICAgIC8qIGdyb3VwIG5lZWRzIGluaXRpYWxpemF0aW9uIG9ubHkgZm9yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBmaXJzdCBjaGFubmVsIG9mIGEgZ3JvdXAgKi8KKworI2lmIExJTlVYX1ZFUlNJT05fQ09ERSA+IEtFUk5FTF9WRVJTSU9OKDIsNSw0MSkKKyAgICB7CisgICAgICAgIHN0YXR1c190ICAgIHJldDsKKworICAgICAgICBpZiAoKHJldCA9IGM0X3dxX3BvcnRfaW5pdCAocGkpKSkgICAgICAgLyogY3JlYXRlL2luaXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHdvcmtxdWV1ZV9zdHJ1Y3QgKi8KKyAgICAgICAgICAgIHJldHVybiAocmV0KTsKKyAgICB9CisjZW5kaWYKKworICAgIGluaXRfY29tZXQgKGNpLCBwaS0+Y29tZXRiYXNlLCBwcC0+cG9ydF9tb2RlLCAxIC8qIGNsb2NrbWFzdGVyID09IHRydWUgKi8gLCBwcC0+cG9ydFApOworICAgIGNsY2sgPSBwY2lfcmVhZF8zMiAoKHVfaW50MzJfdCAqKSAmY2ktPmNwbGRiYXNlLT5tY2xrKSAmIFBNQ0M0X0NQTERfTUNMS19NQVNLOworICAgIGlmIChlMW1vZGUpCisgICAgICAgIGNsY2sgfD0gMSA8PCBwb3J0bnVtOworICAgIGVsc2UKKyAgICAgICAgY2xjayAmPSAweGYgXiAoMSA8PCBwb3J0bnVtKTsKKworICAgIHBjaV93cml0ZV8zMiAoKHVfaW50MzJfdCAqKSAmY2ktPmNwbGRiYXNlLT5tY2xrLCBjbGNrKTsKKyAgICBwY2lfd3JpdGVfMzIgKCh1X2ludDMyX3QgKikgJmNpLT5jcGxkYmFzZS0+bWNzciwgUE1DQzRfQ1BMRF9NQ1NSX0lORCk7CisgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZwaS0+cmVnLT5nYnAsIE9TX3Z0b3BoeXMgKHBpLT5yZWdyYW0pKTsKKworICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgLyogRVJSQVRBOiBJZiB0cmFuc3BhcmVudCBtb2RlIGlzIHVzZWQsIGRvIG5vdCBzZXQgT09GTVBfRElTQUJMRSBiaXQgKi8KKyAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisgICAgcGktPnJlZ3JhbS0+Z3JjZCA9CisgICAgICAgIF9fY29uc3RhbnRfY3B1X3RvX2xlMzIgKE1VU1lDQ19HUkNEX1JYX0VOQUJMRSB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1VU1lDQ19HUkNEX1RYX0VOQUJMRSB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1VU1lDQ19HUkNEX09PRk1QX0RJU0FCTEUgfAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNVVNZQ0NfR1JDRF9TRl9BTElHTiB8ICAvKiBwZXIgTVVTWUNDIEVSUkFUQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogZm9yIFQxICogZml4ICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1VU1lDQ19HUkNEX0NPRkFJUlFfRElTQUJMRSB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1VU1lDQ19HUkNEX01DX0VOQUJMRSB8CisgICAgICAgICAgICAgICAgICAgICAgIChNVVNZQ0NfR1JDRF9QT0xMVEhfMzIgPDwgTVVTWUNDX0dSQ0RfUE9MTFRIX1NISUZUKSk7CisKKyAgICBwaS0+cmVncmFtLT5wY2QgPQorICAgICAgICBfX2NvbnN0YW50X2NwdV90b19sZTMyICgoZTFtb2RlID8gMSA6IDApIHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTVVTWUNDX1BDRF9UWFNZTkNfUklTSU5HIHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTVVTWUNDX1BDRF9SWFNZTkNfUklTSU5HIHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTVVTWUNDX1BDRF9SWERBVEFfUklTSU5HKTsKKworICAgIC8qIE1lc3NhZ2UgbGVuZ3RoIGRlc2NyaXB0b3IgKi8KKyAgICBwaS0+cmVncmFtLT5tbGQgPSBfX2NvbnN0YW50X2NwdV90b19sZTMyIChtYXhfbXJ1IHwgKG1heF9tcnUgPDwgMTYpKTsKKworICAgIC8qIHRzbSBhbGdvcml0aG0gKi8KKyAgICBmb3IgKGkgPSAwOyBpIDwgMzI7IGkrKykKKyAgICB7CisKKyAgICAgICAgLyoqKiBBU1NJR05NRU5UIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKioqLworICAgICAgICAvKioqIEdyb3VwJ3MgY2hhbm5lbCAgWkVSTyAgdW5hdmFpbGFibGUgaWYgRTEuICAgICAqKiovCisgICAgICAgIC8qKiogR3JvdXAncyBjaGFubmVsICAxNiAgICB1bmF2YWlsYWJsZSBpZiBFMSBDQVMuICoqKi8KKyAgICAgICAgLyoqKiBHcm91cCdzIGNoYW5uZWxzIDI0LTMxIHVuYXZhaWxhYmxlIGlmIFQxLiAgICAgKioqLworCisgICAgICAgIGlmICgoKGkgPT0gMCkgJiYgZTFtb2RlKSB8fAorICAgICAgICAgICAgKChpID09IDE2KSAmJiAoKHBwLT5wb3J0X21vZGUgPT0gQ0ZHX0ZSQU1FX0UxQ1JDX0NBUykgfHwgKHBwLT5wb3J0X21vZGUgPT0gQ0ZHX0ZSQU1FX0UxQ1JDX0NBU19BTUkpKSkKKyAgICAgICAgICAgIHx8ICgoaSA+IDIzKSAmJiAoIWUxbW9kZSkpKQorICAgICAgICB7CisgICAgICAgICAgICBwaS0+dHNtW2ldID0gMHhmZjsgICAgICAvKiBtYWtlIHRzbG90IHVuYXZhaWxhYmxlIGZvciB0aGlzIG1vZGUgKi8KKyAgICAgICAgfSBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIHBpLT50c21baV0gPSAweDAwOyAgICAgIC8qIG1ha2UgdHNsb3QgYXZhaWxhYmxlIGZvciBhc3NpZ25tZW50ICovCisgICAgICAgIH0KKyAgICB9CisgICAgZm9yIChpID0gMDsgaSA8IE1VU1lDQ19OQ0hBTlM7IGkrKykKKyAgICB7CisgICAgICAgIHBpLT5yZWdyYW0tPnR0c21baV0gPSAwOworICAgICAgICBwaS0+cmVncmFtLT5ydHNtW2ldID0gMDsKKyAgICB9CisgICAgRkxVU0hfTUVNX1dSSVRFICgpOworICAgIG11c3ljY19zZXJ2X3JlcSAocGksIFNSX0dST1VQX0lOSVQgfCBTUl9SWF9ESVJFQ1RJT04pOworICAgIG11c3ljY19zZXJ2X3JlcSAocGksIFNSX0dST1VQX0lOSVQgfCBTUl9UWF9ESVJFQ1RJT04pOworCisgICAgbXVzeWNjX2luaXRfbWR0IChwaSk7CisKKyAgICBwaS0+Z3JvdXBfaXNfc2V0ID0gMTsKKyAgICBwaS0+cCA9ICpwcDsKKyAgICByZXR1cm4gMDsKK30KKworCit1bnNpZ25lZCBpbnQgbWF4X2ludCA9IDA7CisKK3N0YXR1c190CitjNF9uZXdfY2hhbiAoY2lfdCAqIGNpLCBpbnQgcG9ydG51bSwgaW50IGNoYW5udW0sIHZvaWQgKnVzZXIpCit7CisgICAgbXBpX3QgICAgICAqcGk7CisgICAgbWNoX3QgICAgICAqY2g7CisgICAgaW50ICAgICAgICAgZ2NoYW47CisKKyAgICBpZiAoYzRfZmluZF9jaGFuIChjaGFubnVtKSkgICAgIC8qIGEgbmV3IGNoYW5uZWwgc2hvdWxkbid0IGFscmVhZHkgZXhp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Q0ZHX0NIX1BST1RPX0hETENfRkNTMTY7CisgICAgY2gtPnAuaWRsZWNvZGUgPSBDRkdfQ0hfRkxBR183RTsKKyAgICBjaC0+cC5wYWRfZmlsbF9jb3VudCA9IDI7CisgICAgc3Bpbl9sb2NrX2luaXQgKCZjaC0+Y2hfcnhsb2NrKTsKKyAgICBzcGluX2xvY2tfaW5pdCAoJmNoLT5jaF90eGxvY2spOworCisjaWYgTElOVVhfVkVSU0lPTl9DT0RFID4gS0VSTkVMX1ZFUlNJT04oMiw1LDQxKQorICAgIHsKKyAgICAgICAgc3RhdHVzX3QgICAgcmV0OworCisgICAgICAgIGlmICgocmV0ID0gYzRfd2tfY2hhbl9pbml0IChwaSwgY2gpKSkKKyAgICAgICAgICAgIHJldHVybiByZXQ7CisgICAgfQorI2VuZGlmCisKKyAgICAvKiBzYXZlIG9mZiBpbnRlcmZhY2UgYXNzaWdubWVudHMgd2hpY2ggYm91bmQgYSBib2FyZCAqLworICAgIGlmIChjaS0+Zmlyc3RfaWYgPT0gMCkgICAgICAgICAgLyogZmlyc3QgY2hhbm5lbCByZWdpc3RlcmVkIGlzIGFzc3VtZWQgdG8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGJlIHRoZSBsb3dlc3QgY2hhbm5lbCAqLworICAgIHsKKyAgICAgICAgY2ktPmZpcnN0X2lmID0gY2ktPmxhc3RfaWYgPSB1c2VyOworICAgICAgICBjaS0+Zmlyc3RfY2hhbm51bSA9IGNpLT5sYXN0X2NoYW5udW0gPSBjaGFubnVtOworICAgIH0gZWxzZQorICAgIHsKKyAgICAgICAgY2ktPmxhc3RfaWYgPSB1c2VyOworICAgICAgICBpZiAoY2ktPmxhc3RfY2hhbm51bSA8IGNoYW5udW0pIC8qIGhpZ2hlciBudW1iZXIgY2hhbm5lbCBmb3VuZCAqLworICAgICAgICAgICAgY2ktPmxhc3RfY2hhbm51bSA9IGNoYW5udW07CisgICAgfQorICAgIHJldHVybiAwOworfQorCitzdGF0dXNfdAorYzRfZGVsX2NoYW4gKGludCBjaGFubnVtKQoreworICAgIG1jaF90ICAgICAgKmNoOworCisgICAgaWYgKCEoY2ggPSBjNF9maW5kX2NoYW4gKGNoYW5udW0pKSkKKyAgICAgICAgcmV0dXJuIEVOT0VOVDsKKyAgICBpZiAoY2gtPnN0YXRlID09IFVQKQorICAgICAgICBtdXN5Y2NfY2hhbl9kb3duICgoY2lfdCAqKSAwLCBjaGFubnVtKTsKKyAgICBjaC0+c3RhdGUgPSBVTkFTU0lHTkVEOworICAgIGNoLT5nY2hhbiA9ICgtMSk7CisgICAgY2gtPmNoYW5udW0gPSAoLTEpOworICAgIGNoLT5wLmNoYW5udW0gPSAoLTEpOworICAgIHJldHVybiAwOworfQorCitzdGF0dXNfdAorYzRfZGVsX2NoYW5fc3RhdHMgKGludCBjaGFubnVtKQoreworICAgIG1jaF90ICAgICAgKmNoOworCisgICAgaWYgKCEoY2ggPSBjNF9maW5kX2NoYW4gKGNoYW5udW0pKSkKKyAgICAgICAgcmV0dXJuIEVOT0VOVDsKKworICAgIG1lbXNldCAoJmNoLT5zLCAwLCBzaXplb2YgKHN0cnVjdCBzYmVjb21fY2hhbl9zdGF0cykpOworICAgIHJldHVybiAwOworfQorCisKK3N0YXR1c190CitjNF9zZXRfY2hhbiAoaW50IGNoYW5udW0sIHN0cnVjdCBzYmVjb21fY2hhbl9wYXJhbSAqIHApCit7CisgICAgbWNoX3QgICAgICAqY2g7CisgICAgaW50ICAgICAgICAgaSwgeCA9IDA7CisKKyAgICBpZiAoIShjaCA9IGM0X2ZpbmRfY2hhbiAoY2hhbm51bSkpKQorICAgICAgICByZXR1cm4gRU5PRU5UOworCisjaWYgMQorICAgIGlmIChjaC0+cC5jYXJkICE9IHAtPmNhcmQgfHwKKyAgICAgICAgY2gtPnAucG9ydCAhPSBwLT5wb3J0IHx8CisgICAgICAgIGNoLT5wLmNoYW5udW0gIT0gcC0+Y2hhbm51bSkKKyAgICAgICAgcmV0dXJuIEVJTlZBTDsKKyNlbmRpZgorCisgICAgaWYgKCEoY2gtPnVwLT5ncm91cF9pc19zZXQpKQorICAgIHsKKyAgICAgICAgcmV0dXJuIEVJTzsgICAgICAgICAgICAgICAgIC8qIG91dCBvZiBvcmRlciwgU0VUX1BPUlQgY29tbWFuZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogcmVxdWlyZWQgcHJpb3IgdG8gZmlyc3QgZ3JvdXAncworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogU0VUX0NIQU4gY29tbWFuZCAqLworICAgIH0KKyAgICAvKgorICAgICAqIENoZWNrIGZvciBjaGFuZ2Ugb2YgcGFyYW1ldGVyIHNldHRpbmdzIGluIG9yZGVyIHRvIGludm9rZSBjbG9zaW5nIG9mCisgICAgICogY2hhbm5lbCBwcmlvciB0byBoYXJkd2FyZSBwb2tpbmcuCisgICAgICovCisKKyAgICBpZiAoY2gtPnAuc3RhdHVzICE9IHAtPnN0YXR1cyB8fCBjaC0+cC5jaGFuX21vZGUgIT0gcC0+Y2hhbl9tb2RlIHx8CisgICAgICAgIGNoLT5wLmRhdGFfaW52ICE9IHAtPmRhdGFfaW52IHx8IGNoLT5wLmludHJfbWFzayAhPSBwLT5pbnRyX21hc2sgfHwKKyAgICAgICAgY2gtPnR4ZF9mcmVlIDwgY2gtPnR4ZF9udW0pIC8qIHRvIGNsZWFyIG91dCBxdWV1ZWQgbWVzc2FnZXMgKi8KKyAgICAgICAgeCA9IDE7ICAgICAgICAgICAgICAgICAgICAgIC8qIHdlIGhhdmUgYSBjaGFuZ2UgcmVxdWVzdGVkICovCisgICAgZm9yIChpID0gMDsgaSA8IDMyOyBpKyspICAgICAgICAvKiBjaGVjayBmb3IgdGltZXNsb3QgbWFwcGluZyBjaGFuZ2VzICovCisgICAgICAgIGlmIChjaC0+cC5iaXRtYXNrW2ldICE9IHAtPmJpdG1hc2tbaV0pCisgICAgICAgICAgICB4ID0gMTsgICAgICAgICAgICAgICAgICAvKiB3ZSBoYXZlIGEgY2hhbmdlIHJlcXVlc3RlZCAqLworICAgIGNoLT5wID0gKnA7CisgICAgaWYgKHggJiYgKGNoLT5zdGF0ZSA9PSBVUCkpICAgICAvKiBpZiBjaGFuZ2UgcmVxdWVzdCBhbmQgY2hhbm5lbCBpcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogb3Blbi4uLiAqLworICAgIHsKKyAgICAgICAgc3RhdHVzX3QgICAgcmV0OworCisgICAgICAgIGlmICgocmV0ID0gbXVzeWNjX2NoYW5fZG93biAoKGNpX3QgKikgMCwgY2hhbm51bSkpKQorICAgICAgICAgICAgcmV0dXJuIHJldDsKKyAgICAgICAgaWYgKChyZXQgPSBjNF9jaGFuX3VwIChjaC0+dXAtPnVwLCBjaGFubnVtKSkpCisgICAgICAgICAgICByZXR1cm4gcmV0OworICAgICAgICBzZF9lbmFibGVfeG1pdCAoY2gtPnVzZXIpOyAgLyogcmUtZW5hYmxlIHRvIGNhdGNoIGZsb3cgY29udHJvbGxlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogY2hhbm5lbCAqLworICAgIH0KKyAgICByZXR1cm4gMDsKK30KKworCitzdGF0dXNfdAorYzRfZ2V0X2NoYW4gKGludCBjaGFubnVtLCBzdHJ1Y3Qgc2JlY29tX2NoYW5fcGFyYW0gKiBwKQoreworICAgIG1jaF90ICAgICAgKmNoOworCisgICAgaWYgKCEoY2ggPSBjNF9maW5kX2NoYW4gKGNoYW5udW0pKSkKKyAgICAgICAgcmV0dXJuIEVOT0VOVDsKKyAgICAqcCA9IGNoLT5wOworICAgIHJldHVybiAwOworfQorCitzdGF0dXNfdAorYzRfZ2V0X2NoYW5fc3RhdHMgKGludCBjaGFubnVtLCBzdHJ1Y3Qgc2JlY29tX2NoYW5fc3RhdHMgKiBwKQoreworICAgIG1jaF90ICAgICAgKmNoOworCisgICAgaWYgKCEoY2ggPSBjNF9maW5kX2NoYW4gKGNoYW5udW0pKSkKKyAgICAgICAgcmV0dXJuIEVOT0VOVDsKKyAgICAqcCA9IGNoLT5zOworICAgIHAtPnR4X3BlbmRpbmcgPSBhdG9taWNfcmVhZCAoJmNoLT50eF9wZW5kaW5nKTsKKyAgICByZXR1cm4gMDsKK30KKworU1RBVElDIGludAorYzRfZmlmb19hbGxvYyAobXBpX3QgKiBwaSwgaW50IGNoYW4sIGludCAqbGVuKQoreworICAgIGludCAgICAgICAgIGksIGwgPSAwLCBzdGFydCA9IDAsIG1heCA9IDAsIG1heHN0YXJ0ID0gMDsKKworICAgIGZvciAoaSA9IDA7IGkgPCAzMjsgaSsrKQorICAgIHsKKyAgICAgICAgaWYgKHBpLT5maWZvbWFwW2ldICE9IC0xKQorICAgICAgICB7CisgICAgICAgICAgICBsID0gMDsKKyAgICAgICAgICAgIHN0YXJ0ID0gaSArIDE7CisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgfQorICAgICAgICArK2w7CisgICAgICAgIGlmIChsID4gbWF4KQorICAgICAgICB7CisgICAgICAgICAgICBtYXggPSBsOworICAgICAgICAgICAgbWF4c3RhcnQgPSBzdGFydDsKKyAgICAgICAgfQorICAgICAgICBpZiAobWF4ID09ICpsZW4pCisgICAgICAgICAgICBicmVhazsKKyAgICB9CisgICAgaWYgKG1heCAhPSAqbGVuKQorICAgIHsKKyAgICAgICAgaWYgKGxvZ19sZXZlbCA+PSBMT0dfV0FSTikKKyAgICAgICAgICAgIHByX2luZm8oIiVzOiB3YW50ZWQgdG8gYWxsb2NhdGUgJWQgZmlmbyBzcGFjZSwgYnV0IGdvdCBvbmx5ICVkXG4iLAorICAgICAgICAgICAgICAgICAgICBwaS0+dXAtPmRldm5hbWUsICpsZW4sIG1heCk7CisgICAgICAgICpsZW4gPSBtYXg7CisgICAgfQorICAgIGlmIChsb2dfbGV2ZWwgPj0gTE9HX0RFQlVHKQorICAgICAgICBwcl9pbmZvKCIlczogYWxsb2NhdGVkICVkIGZpZm8gYXQgJWQgZm9yIGNoYW5uZWwgJWQvJWRcbiIsCisgICAgICAgICAgICAgICAgcGktPnVwLT5kZXZuYW1lLCBtYXgsIHN0YXJ0LCBjaGFuLCBwaS0+cC5wb3J0bnVtKTsKKyAgICBmb3IgKGkgPSBtYXhzdGFydDsgaSA8IChtYXhzdGFydCArIG1heCk7IGkrKykKKyAgICAgICAgcGktPmZpZm9tYXBbaV0gPSBjaGFuOworICAgIHJldHVybiBzdGFydDsKK30KKwordm9pZAorYzRfZmlmb19mcmVlIChtcGlfdCAqIHBpLCBpbnQgY2hhbikKK3sKKyAgICBpbnQgICAgICAgICBpOworCisgICAgaWYgKGxvZ19sZXZlbCA+PSBMT0dfREVCVUcpCisgICAgICAgIHByX2luZm8oIiVzOiBkZWFsbG9jYXRlZCBmaWZvIGZvciBjaGFubmVsICVkLyVkXG4iLAorICAgICAgICAgICAgICAgIHBpLT51cC0+ZGV2bmFtZSwgY2hhbiwgcGktPnAucG9ydG51bSk7CisgICAgZm9yIChpID0gMDsgaSA8IDMyOyBpKyspCisgICAgICAgIGlmIChwaS0+Zmlmb21hcFtpXSA9PSBjaGFuKQorICAgICAgICAgICAgcGktPmZpZm9tYXBbaV0gPSAtMTsKK30KKworCitzdGF0dXNfdAorYzRfY2hhbl91cCAoY2lfdCAqIGNpLCBpbnQgY2hhbm51bSkKK3sKKyAgICBtcGlfdCAgICAgICpwaTsKKyAgICBtY2hfdCAgICAgICpjaDsKKyAgICBzdHJ1Y3QgbWJ1ZiAqbTsKKyAgICBzdHJ1Y3QgbWRlc2MgKm1kOworICAgIGludCAgICAgICAgIG50cywgbmJ1ZiwgdHhudW0sIHJ4bnVtOworICAgIGludCAgICAgICAgIGFkZHIsIGksIGosIGdjaGFuOworICAgIHVfaW50MzJfdCAgIHRtcDsgICAgICAgICAgICAvKiBmb3Igb3B0aW1pemluZyBjb252ZXJzaW9uIGFjcm9zcyBCRQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBwbGF0Zm9ybSAqLworCisgICAgaWYgKCEoY2ggPSBjNF9maW5kX2NoYW4gKGNoYW5udW0pKSkKKyAgICAgICAgcmV0dXJuIEVOT0VOVDsKKyAgICBpZiAoY2gtPnN0YXRlID09IFVQKQorICAgIHsKKyAgICAgICAgaWYgKGxvZ19sZXZlbCA+PSBMT0dfTU9OSVRPUikKKyAgICAgICAgICAgIHByX2luZm8oIiVzOiBjaGFubmVsIGFscmVhZHkgVVAsIGdyYWNlZnVsIGVhcmx5IGV4aXRcbiIsCisgICAgICAgICAgICAgICAgICAgIGNpLT5kZXZuYW1lKTsKKyAgICAgICAgcmV0dXJuIDA7CisgICAgfQorICAgIHBpID0gY2gtPnVwOworICAgIGdjaGFuID0gY2gtPmdjaGFuOworICAgIC8qIGZpbmQgbnRzICgnbnVtYmVyIG9mIHRpbWVzbG90cycpICovCisgICAgbnRzID0gMDsKKyAgICBmb3IgKGkgPSAwOyBpIDwgMzI7IGkrKykKKyAgICB7CisgICAgICAgIGlmIChjaC0+cC5iaXRtYXNrW2ldICYgcGktPnRzbVtpXSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKDEgfHwgbG9nX2xldmVsID49IExPR19XQVJOKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHByX2luZm8oIiVzOiBjNF9jaGFuX3VwWyVkXSBFSU5WQUwgKGF0dGVtcHQgdG8gY2ZnIGluLXVzZSBvciB1bmF2YWlsYWJsZSBUaW1lU2xvdFslZF0pXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgY2ktPmRldm5hbWUsIGNoYW5udW0sIGkpOworICAgICAgICAgICAgICAgIHByX2luZm8oIisgYXNrNCAleCwgY3VycmVudGx5ICV4XG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgY2gtPnAuYml0bWFza1tpXSwgcGktPnRzbVtpXSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gRUlOVkFMOworICAgICAgICB9CisgICAgICAgIGZvciAoaiA9IDA7IGogPCA4OyBqKyspCisgICAgICAgICAgICBpZiAoY2gtPnAuYml0bWFza1tpXSAmICgxIDw8IGopKQorICAgICAgICAgICAgICAgIG50cysrOworICAgIH0KKworICAgIG5idWYgPSBudHMgLyA4ID8gbnRzIC8gOCA6IDE7CisgICAgaWYgKCFuYnVmKQorICAgIHsKKyAgICAgICAgLyogaWYoIGxvZ19sZXZlbCA+PSBMT0dfV0FSTikgICovCisgICAgICAgIHByX2luZm8oIiVzOiBjNF9jaGFuX3VwWyVkXSBFTk9CVUZTIChubyBUaW1lU2xvdHMgYXNzaWduZWQpXG4iLAorICAgICAgICAgICAgICAgIGNpLT5kZXZuYW1lLCBjaGFubnVtKTsKKyAgICAgICAgcmV0dXJuIEVOT0JVRlM7ICAgICAgICAgICAgIC8qIHRoaXMgc2hvdWxkIG5vdCBoYXBwZW4gKi8KKyAgICB9CisgICAgYWRkciA9IGM0X2ZpZm9fYWxsb2MgKHBpLCBnY2hhbiwgJm5idWYpOworICAgIGNoLT5zdGF0ZSA9IFVQOworCisgICAgLyogU2V0dXAgdGhlIFRpbWUgU2xvdCBNYXAgKi8KKyAgICBtdXN5Y2NfdXBkYXRlX3RpbWVzbG90cyAocGkpOworCisgICAgLyogY2gtPnR4X2xpbWl0ID0gbnRzOyAqLworICAgIGNoLT5zLnR4X3BlbmRpbmcgPSAwOworCisgICAgLyogU2V0IENoYW5uZWwgQ29uZmlndXJhdGlvbiBEZXNjcmlwdG9ycyAqLworICAgIHsKKyAgICAgICAgdV9pbnQzMl90ICAgY2NkOworCisgICAgICAgIGNjZCA9IG11c3ljY19jaGFuX3Byb3RvIChjaC0+cC5jaGFuX21vZGUpIDw8IE1VU1lDQ19DQ0RfUFJPVE9fU0hJRlQ7CisgICAgICAgIGlmICgoY2gtPnAuY2hhbl9tb2RlID09IENGR19DSF9QUk9UT19JU0xQX01PREUpIHx8CisgICAgICAgICAgICAoY2gtPnAuY2hhbl9tb2RlID09IENGR19DSF9QUk9UT19UUkFOUykpCisgICAgICAgIHsKKyAgICAgICA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JUlFfRU5BQkxFKTsKKyAgICBlbHNlCisgICAgICAgIHRtcCA9IF9fY29uc3RhbnRfY3B1X3RvX2xlMzIgKG1heF9tcnUpOworCisgICAgZm9yIChpID0gMCwgbWQgPSBjaC0+bWRyOyBpIDwgcnhudW07IGkrKywgbWQrKykKKyAgICB7CisgICAgICAgIGlmIChpID09IChyeG51bSAtIDEpKQorICAgICAgICB7CisgICAgICAgICAgICBtZC0+c25leHQgPSAmY2gtPm1kclswXTsvKiB3cmFwbmVzcyAqLworICAgICAgICB9IGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgbWQtPnNuZXh0ID0gJmNoLT5tZHJbaSArIDFdOworICAgICAgICB9CisgICAgICAgIG1kLT5uZXh0ID0gY3B1X3RvX2xlMzIgKE9TX3Z0b3BoeXMgKG1kLT5zbmV4dCkpOworCisgICAgICAgIGlmICghKG0gPSBPU19tZW1fdG9rZW5fYWxsb2MgKG1heF9tcnUpKSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKGxvZ19sZXZlbCA+PSBMT0dfTU9OSVRPUikKKyAgICAgICAgICAgICAgICBwcl9pbmZvKCIlczogYzRfY2hhbl91cFslZF0gLSB0b2tlbiBhbGxvYyBmYWlsdXJlLCBzaXplID0gJWQuXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgY2ktPmRldm5hbWUsIGNoYW5udW0sIG1heF9tcnUpOworICAgICAgICAgICAgZ290byBlcnJmcmVlOworICAgICAgICB9CisgICAgICAgIG1kLT5tZW1fdG9rZW4gPSBtOworICAgICAgICBtZC0+ZGF0YSA9IGNwdV90b19sZTMyIChPU192dG9waHlzIChPU19tZW1fdG9rZW5fZGF0YSAobSkpKTsKKyAgICAgICAgbWQtPnN0YXR1cyA9IHRtcCB8IE1VU1lDQ19SWF9PV05FRDsgICAgIC8qIE1VU1lDQyBvd25zIFJYIGRlc2NyaXB0b3IgKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIENPRElORyBOT1RFOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogTVVTWUNDX1JYX09XTkVEID0gMCBzbyBubworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogbmVlZCB0byBieXRlU3dhcCAqLworICAgIH0KKworICAgIGZvciAoaSA9IDAsIG1kID0gY2gtPm1kdDsgaSA8IHR4bnVtOyBpKyssIG1kKyspCisgICAgeworICAgICAgICBtZC0+c3RhdHVzID0gSE9TVF9UWF9PV05FRDsgLyogSG9zdCBvd25zIFRYIGRlc2NyaXB0b3IgKiogQ09ESU5HCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBOT1RFOiBIT1NUX1RYX09XTkVEID0gMCBzbyBubyBuZWVkIHRvCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBieXRlU3dhcCAqLworICAgICAgICBtZC0+bWVtX3Rva2VuID0gMDsKKyAgICAgICAgbWQtPmRhdGEgPSAwOworICAgICAgICBpZiAoaSA9PSAodHhudW0gLSAxKSkKKyAgICAgICAgeworICAgICAgICAgICAgbWQtPnNuZXh0ID0gJmNoLT5tZHRbMF07Lyogd3JhcG5lc3MgKi8KKyAgICAgICAgfSBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIG1kLT5zbmV4dCA9ICZjaC0+bWR0W2kgKyAxXTsKKyAgICAgICAgfQorICAgICAgICBtZC0+bmV4dCA9IGNwdV90b19sZTMyIChPU192dG9waHlzIChtZC0+c25leHQpKTsKKyAgICB9CisgICAgY2gtPnR4ZF9pcnFfc3J2ID0gY2gtPnR4ZF91c3JfYWRkID0gJmNoLT5tZHRbMF07CisgICAgY2gtPnR4ZF9mcmVlID0gdHhudW07CisgICAgY2gtPnR4X2Z1bGwgPSAwOworICAgIGNoLT50eGRfcmVxdWlyZWQgPSAwOworCisgICAgLyogQ29uZmlndXJlIGl0IGludG8gdGhlIGNoaXAgK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VNUOyAgICAgIC8qIHdlIGFyZSBkZWxheWluZyBzdGFydAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogdW50aWwgcmVjZWlwdCBmcm9tIHVzZXIgb2YKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGZpcnN0IHBhY2tldCB0byB0cmFuc21pdC4gKi8KKyAgICB9CisgICAgY2gtPnN0YXR1cyA9IGNoLT5wLnN0YXR1czsKKyAgICBwaS0+b3BlbmNoYW5zKys7CisgICAgcmV0dXJuIDA7CisKK2VycmZyZWU6CisgICAgd2hpbGUgKGkgPiAwKQorICAgIHsKKyAgICAgICAgLyogRG9uJ3QgbGVhayBhbGwgdGhlIHByZXZpb3VzbHkgYWxsb2NhdGVkIG1idWZzIGluIHRoaXMgbG9vcCAqLworICAgICAgICBpLS07CisgICAgICAgIE9TX21lbV90b2tlbl9mcmVlIChjaC0+bWRyW2ldLm1lbV90b2tlbik7CisgICAgfQorICAgIE9TX2tmcmVlIChjaC0+bWR0KTsKKyAgICBjaC0+bWR0ID0gMDsKKyAgICBjaC0+dHhkX251bSA9IDA7CisgICAgT1Nfa2ZyZWUgKGNoLT5tZHIpOworICAgIGNoLT5tZHIgPSAwOworICAgIGNoLT5yeGRfbnVtID0gMDsKKyAgICBjaC0+c3RhdGUgPSBET1dOOworICAgIHJldHVybiBFTk9CVUZTOworfQorCisvKiBzdG9wIHRoZSBoYXJkd2FyZSBmcm9tIHNlcnZpY2luZyAmIGludGVycnVwdGluZyAqLworCit2b2lkCitjNF9zdG9wd2QgKGNpX3QgKiBjaSkKK3sKKyAgICBPU19zdG9wX3dhdGNoZG9nICgmY2ktPndkKTsKKyAgICBTRF9TRU1fVEFLRSAoJmNpLT5zZW1fd2RidXN5LCAiX3N0b3BfIik7ICAgIC8qIGVuc3VyZSBXRCBub3QgcnVubmluZyAqLworICAgIFNEX1NFTV9HSVZFICgmY2ktPnNlbV93ZGJ1c3kpOworfQorCisKK3ZvaWQKK3NiZWNvbV9nZXRfYnJkaW5mbyAoY2lfdCAqIGNpLCBzdHJ1Y3Qgc2JlX2JyZF9pbmZvICogYmlwLCB1X2ludDhfdCAqYnNuKQoreworICAgIGNoYXIgICAgICAgKm5wOworICAgIHVfaW50MzJfdCAgIHNuID0gMDsKKyAgICBpbnQgICAgICAgICBpOworCisgICAgYmlwLT5icmRubyA9IGNpLT5icmRubzsgICAgICAgICAvKiBvdXIgYm9hcmQgbnVtYmVyICovCisgICAgYmlwLT5icmRfaWQgPSBjaS0+YnJkX2lkOworICAgIGJpcC0+YnJkX2hkd19pZCA9IGNpLT5oZHdfYmlkOworICAgIGJpcC0+YnJkX2NoYW5fY250ID0gTVVTWUNDX05DSEFOUyAqIGNpLT5tYXhfcG9ydDsgICAvKiBudW1iZXIgb2YgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogYmVpbmcgdXNlZCAqLworICAgIGJpcC0+YnJkX3BvcnRfY250ID0gY2ktPm1heF9wb3J0OyAgIC8qIG51bWJlciBvZiBwb3J0cyBiZWluZyB1c2VkICovCisgICAgYmlwLT5icmRfcGNpX3NwZWVkID0gQklORk9fUENJX1NQRUVEX3VuazsgICAvKiBQQ0kgc3BlZWQgbm90IHlldAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogZGV0ZXJtaW5hYmxlICovCisKKyAgICBpZiAoY2ktPmZpcnN0X2lmKQorICAgIHsKKyNpZiBMSU5VWF9WRVJTSU9OX0NPREUgPCBLRVJORUxfVkVSU0lPTigyLDUsMCkKKyAgICAgICAgbnAgPSAoY2hhciAqKSBoZGxjX3RvX25hbWUgKGNpLT5maXJzdF9pZik7CisjZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2OworCisgICAgICAgICAgICBkZXYgPSAoc3RydWN0IG5ldF9kZXZpY2UgKikgY2ktPmZpcnN0X2lmOworICAgICAgICAgICAgbnAgPSAoY2hhciAqKSBkZXYtPm5hbWU7CisgICAgICAgIH0KKyNlbmRpZgorICAgICAgICBzdHJuY3B5IChiaXAtPmZpcnN0X2luYW1lLCBucCwgQ0hOTV9TVFJMRU4gLSAxKTsKKyAgICB9IGVsc2UKKyAgICAgICAgc3RyY3B5IChiaXAtPmZpcnN0X2luYW1lLCAiPE5VTEw+Iik7CisgICAgaWYgKGNpLT5sYXN0X2lmKQorICAgIHsKKyNpZiBMSU5VWF9WRVJTSU9OX0NPREUgPCBLRVJORUxfVkVSU0lPTigyLDUsMCkKKyAgICAgICAgbnAgPSAoY2hhciAqKSBoZGxjX3RvX25hbWUgKGNpLT5sYXN0X2lmKTsKKyNlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXY7CisKKyAgICAgICAgICAgIGRldiA9IChzdHJ1Y3QgbmV0X2RldmljZSAqKSBjaS0+bGFzdF9pZjsKKyAgICAgICAgICAgIG5wID0gKGNoYXIgKikgZGV2LT5uYW1lOworICAgICAgICB9CisjZW5kaWYKKyAgICAgICAgc3RybmNweSAoYmlwLT5sYXN0X2luYW1lLCBucCwgQ0hOTV9TVFJMRU4gLSAxKTsKKyAgICB9IGVsc2UKKyAgICAgICAgc3RyY3B5IChiaXAtPmxhc3RfaW5hbWUsICI8TlVMTD4iKTsKKworICAgIGlmIChic24pCisgICAgeworICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMzsgaSsrKQorICAgICAgICB7CisgICAgICAgICAgICBiaXAtPmJyZF9tYWNfYWRkcltpXSA9ICpic24rKzsKKyAgICAgICAgfQorICAgICAgICBmb3IgKDsgaSA8IDY7IGkrKykKKyAgICAgICAgeworICAgICAgICAgICAgYmlwLT5icmRfbWFjX2FkZHJbaV0gPSAqYnNuOworICAgICAgICAgICAgc24gPSAoc24gPDwgOCkgfCAqYnNuKys7CisgICAgICAgIH0KKyAgICB9IGVsc2UKKyAgICB7CisgICAgICAgIGZvciAoaSA9IDA7IGkgPCA2OyBpKyspCisgICAgICAgICAgICBiaXAtPmJyZF9tYWNfYWRkcltpXSA9IDA7CisgICAgfQorICAgIGJpcC0+YnJkX3NuID0gc247Cit9CisKKworc3RhdHVzX3QKK2M0X2dldF9paWRpbmZvIChjaV90ICogY2ksIHN0cnVjdCBzYmVfaWlkX2luZm8gKiBpaXApCit7CisgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldjsKKyAgICBjaGFyICAgICAgICpucDsKKworICAgIGlmICghKGRldiA9IGdldHVzZXJieWNoYW4gKGlpcC0+Y2hhbm51bSkpKQorICAgICAgICByZXR1cm4gRU5PRU5UOworCisjaWYgTElOVVhfVkVSU0lPTl9DT0RFIDwgS0VSTkVMX1ZFUlNJT04oMiw1LDApCisgICAgbnAgPSAoY2hhciAqKSBoZGxjX3RvX25hbWUgKGRldl90b19oZGxjIChkZXYpKTsKKyNlbHNlCisgICAgbnAgPSBkZXYtPm5hbWU7CisjZW5kaWYKKyAgICBzdHJuY3B5IChpaXAtPmluYW1lLCBucCwgQ0hOTV9TVFJMRU4gLSAxKTsKKyAgICByZXR1cm4gMDsKK30KKworCisjaWZkZWYgQ09ORklHX1NCRV9QTUNDNF9OQ09NTQordm9pZCAgICAgICAgKCpuY2lJbnRlcnJ1cHRbTUFYX0JPQVJEU11bNF0pICh2b2lkKTsKK2V4dGVybiB2b2lkIHdhbnBtY0M0VDFFMV9ob29rSW50ZXJydXB0IChpbnQgY2FyZElELCBpbnQgZGV2aWNlSUQsIHZvaWQgKmhhbmRsZXIpOworCit2b2lkCit3YW5wbWNDNFQxRTFfaG9va0ludGVycnVwdCAoaW50IGNhcmRJRCwgaW50IGRldmljZUlELCB2b2lkICpoYW5kbGVyKQoreworICAgIGlmIChjYXJkSUQgPCBNQVhfQk9BUkRTKSAgICAvKiBzYW5pdHkgY2hlY2sgKi8KKyAgICAgICAgbmNpSW50ZXJydXB0W2NhcmRJRF1bZGV2aWNlSURdID0gaGFuZGxlcjsKK30KKworaXJxcmV0dXJuX3QKK2M0X2VidXNfaW50cl90aF9oYW5kbGVyICh2b2lkICpkZXZwKQoreworICAgIGNpX3QgICAgICAgKmNpID0gKGNpX3QgKikgZGV2cDsKKyAgICB2b2xhdGlsZSB1X2ludDMyX3QgaXN0czsKKyAgICBpbnQgICAgICAgICBoYW5kbGVkID0gMDsKKyAgICBpbnQgICAgICAgICBicmRubzsKKworICAgIC8qIHdoaWNoIENPTUVUIGNhdXNlZCB0aGUgaW50ZXJydXB0ICovCisgICAgYnJkbm8gPSBjaS0+YnJkbm87CisgICAgaXN0cyA9IHBjaV9yZWFkXzMyICgodV9pbnQzMl90ICopICZjaS0+Y3BsZGJhc2UtPmludHIpOworICAgIGlmIChpc3RzICYgUE1DQzRfQ1BMRF9JTlRSX0NNVF8xKQorICAgIHsKKyAgICAgICAgaGFuZGxlZCA9IDB4MTsKKyAgICAgICAgaWYgKG5jaUludGVycnVwdFticmRub11bMF0gIT0gTlVMTCkKKyAgICAgICAgICAgICgqbmNpSW50ZXJydXB0W2JyZG5vXVswXSkgKCk7CisgICAgfQorICAgIGlmIChpc3RzICYgUE1DQzRfQ1BMRF9JTlRSX0NNVF8yKQorICAgIHsKKyAgICAgICAgaGFuZGxlZCB8PSAweDI7CisgICAgICAgIGlmIChuY2lJbnRlcnJ1cHRbYnJkbm9dWzFdICE9IE5VTEwpCisgICAgICAgICAgICAoKm5jaUludGVycnVwdFticmRub11bMV0pICgpOworICAgIH0KKyAgICBpZiAoaXN0cyAmIFBNQ0M0X0NQTERfSU5UUl9DTVRfMykKKyAgICB7CisgICAgICAgIGhhbmRsZWQgfD0gMHg0OworICAgICAgICBpZiAobmNpSW50ZXJydXB0W2JyZG5vXVsyXSAhPSBOVUxMKQorICAgICAgICAgICAgKCpuY2lJbnRlcnJ1cHRbYnJkbm9dWzJdKSAoKTsKKyAgICB9CisgICAgaWYgKGlzdHMgJiBQTUNDNF9DUExEX0lOVFJfQ01UXzQpCisgICAgeworICAgICAgICBoYW5kbGVkIHw9IDB4ODsKKyAgICAgICAgaWYgKG5jaUludGVycnVwdFticmRub11bM10gIT0gTlVMTCkKKyAgICAgICAgICAgICgqbmNpSW50ZXJydXB0W2JyZG5vXVszXSkgKCk7CisgICAgfQorI2lmIDAKKyAgICAvKioqIFRlc3QgY29kZSBqdXN0IGRlLWltcGxlbWVudHMgdGhlIGFzc2VydGVkIGludGVycnVwdC4gIEFsdGVybmF0ZQorICAgIHZlbmRvciB3aWxsIHN1cHBseSBDT01FVCBpbnRlcnJ1cHQgaGFuZGxpbmcgY29kZSBoZXJlaW4gb3Igc3VjaC4KKyAgICAqKiovCisgICAgcGNpX3dyaXRlXzMyICgodV9pbnQzMl90ICopICZjaS0+cmVnLT5nbGNkLCBHQ0RfTUFHSUMgfCBNVVNZQ0NfR0NEX0lOVEJfRElTQUJMRSk7CisjZW5kaWYKKworI2lmIExJTlVYX1ZFUlNJT05fQ09ERSA8PSBLRVJORUxfVkVSU0lPTigyLDQsMjApCisgICAgcmV0dXJuOworI2Vsc2UKKyAgICByZXR1cm4gSVJRX1JFVFZBTCAoaGFuZGxlZCk7CisjZW5kaWYKK30KKworCit1bnNpZ25lZCBsb25nCit3YW5wbWNDNFQxRTFfZ2V0QmFzZUFkZHJlc3MgKGludCBjYXJkSUQsIGludCBkZXZpY2VJRCkKK3sKKyAgICBjaV90ICAgICAgICpjaTsKKyAgICB1bnNpZ25lZCBsb25nIGJhc2UgPSAwOworCisgICAgY2kgPSBjNF9saXN0OworICAgIHdoaWxlIChjaSkKKyAgICB7CisgICAgICAgIGlmIChjaS0+YnJkbm8gPT0gY2FyZElEKSAgICAvKiBmb3VuZCB2YWxpZCBkZXZpY2UgKi8KKyAgICAgICAgeworICAgICAgICAgICAgaWYgKGRldmljZUlEIDwgY2ktPm1heF9wb3J0KSAgICAgICAgLyogY29tZXQgaXMgc3VwcG9ydGVkICovCisgICAgICAgICAgICAgICA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yAgLyogQnVmZmVyIERlc2NyaXB0b3IgKi8KKyAgICB1X2ludDMyX3QgICBkYXRhOyAgICAgICAgICAgLyogRGF0YSBQb2ludGVyICovCisgICAgdV9pbnQzMl90ICAgbmV4dDsgICAgICAgICAgIC8qIE1VU1lDQyB2aWV3IG9mIE5leHQgUG9pbnRlciAqLworICAgIHZvaWQgICAgICAgKm1lbV90b2tlbjsgICAgICAvKiBEYXRhICovCisgICAgc3RydWN0IG1kZXNjICpzbmV4dDsKK307CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIFByaXZhdGUgZHJpdmVyIGRhdGEgc3RydWN0dXJlcywgaW50ZXJuYWwgdXNlIG9ubHkuCisgKi8KKworc3RydWN0IGM0X2NoYW5faW5mbworeworICAgIGludCAgICAgICAgIGdjaGFuOyAgICAgICAgICAvKiBjaGFubmVsIG51bWJlciB3aXRoaW4gZ3JvdXAvcG9ydCAwLTMxICovCisgICAgaW50ICAgICAgICAgY2hhbm51bTsgICAgICAgIC8qIGFic29sdXRlIGNoYW5uZWwgbnVtYmVyIDAtMTI4ICovCisgICAgdV9pbnQ4X3QgICAgc3RhdHVzOworI2RlZmluZSBUWF9SRUNPVkVSWV9NQVNLICAgMHgwZgorI2RlZmluZSBUWF9PTlJfUkVDT1ZFUlkgICAgMHgwMQorI2RlZmluZSBUWF9CVUZGX1JFQ09WRVJZICAgMHgwMgorI2RlZmluZSBSWF9SRUNPVkVSWV9NQVNLICAgMHhmMAorI2RlZmluZSBSWF9PTlJfUkVDT1ZFUlkgICAgMHgxMAorCisgICAgdW5zaWduZWQgY2hhciBjaF9zdGFydF9yeDsKKyNkZWZpbmUgQ0hfU1RBUlRfUlhfTk9XICAgIDEKKyNkZWZpbmUgQ0hfU1RBUlRfUlhfT05SICAgIDIKKyNkZWZpbmUgQ0hfU1RBUlRfUlhfQlVGICAgIDMKKworICAgIHVuc2lnbmVkIGNoYXIgY2hfc3RhcnRfdHg7CisjZGVmaW5lIENIX1NUQVJUX1RYXzFTVCAgICAxCisjZGVmaW5lIENIX1NUQVJUX1RYX09OUiAgICAyCisjZGVmaW5lIENIX1NUQVJUX1RYX0JVRiAgICAzCisKKyAgICBjaGFyICAgICAgICB0eF9mdWxsOyAgICAgICAgLyogYm9vbGVhbiAqLworICAgIHNob3J0ICAgICAgIHR4ZF9mcmVlOyAgICAgICAvKiBjb3VudCBvZiBUWCBEZXNjIGF2YWlsYWJsZSAqLworICAgIHNob3J0ICAgICAgIHR4ZF9yZXF1aXJlZDsgICAvKiBjb3VudCBvZiBUWCBEZXNjIG5lZWRlZCBieSBtZXNnICovCisgICAgdW5zaWduZWQgc2hvcnQgcnhkX251bTsgICAgIC8qIG11c3Qgc3VwcG9ydCByYW5nZSB1cCB0byAyMDAwICovCisgICAgdW5zaWduZWQgc2hvcnQgdHhkX251bTsgICAgIC8qIG11c3Qgc3VwcG9ydCByYW5nZSB1cCB0byAxMDAwICovCisgICAgaW50ICAgICAgICAgcnhpeF9pcnFfc3J2OworCisgICAgZW51bQorICAgIHsKKyAgICAgICAgVU5BU1NJR05FRCwgICAgICAgICAgICAgLyogQVZBSUxBQkxFLCBOT1RJTlVTRSAqLworICAgICAgICBET1dOLCAgICAgICAgICAgICAgICAgICAvKiBBU1NJR05FRCwgTk9USU5VU0UgKi8KKyAgICAgICAgVVAgICAgICAgICAgICAgICAgICAgICAgLyogQVNTSUdORUQgYW5kIElOVVNFICovCisgICAgfSAgICAgICAgICAgc3RhdGU7CisKKyAgICBzdHJ1Y3QgYzRfcG9ydF9pbmZvICp1cDsKKyAgICB2b2lkICAgICAgICp1c2VyOworCisgICAgc3RydWN0IHdvcmtfc3RydWN0IGNoX3dvcms7CisgICAgc3RydWN0IG1kZXNjICptZHQ7CisgICAgc3RydWN0IG1kZXNjICptZHI7CisgICAgc3RydWN0IG1kZXNjICp0eGRfaXJxX3NydjsKKyAgICBzdHJ1Y3QgbWRlc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AgICAgICAgICAgICAgICAgICAgKiBib3VuZGFyeS4gIE5lZWQgdG8gc2F2ZSBmb3IgdXNlIHdoZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogZnJlZWluZy4gKi8KKyAgICBjb21ldF90ICAgICpjb21ldGJhc2U7CisgICAgc3RydWN0IHNiZV9jYXJkX2luZm8gKnVwOworCisgICAgLyoKKyAgICAgKiBUaGUgd29ya3F1ZXVlIGlzIHVzZWQgZm9yIFRYIHJlc3RhcnQgb2YgT05SJ2QgY2hhbm5lbHMgd2hlbiBpbgorICAgICAqIFRyYW5zcGFyZW50IG1vZGUuCisgICAgICovCisKKyAgICBzdHJ1Y3Qgd29ya3F1ZXVlX3N0cnVjdCAqd3FfcG9ydDsgICAvKiBjaGFuIHJlc3RhcnQgd29yayBxdWV1ZSAqLworICAgIHN0cnVjdCBzZW1hcGhvcmUgc3Jfc2VtX2J1c3k7ICAgICAgIC8qIHNlcnZpY2UgcmVxdWVzdCBleGNsdXNpb24KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBzZW1hcGhvcmUgKi8KKyAgICBzdHJ1Y3Qgc2VtYXBob3JlIHNyX3NlbV93YWl0OyAgICAgICAvKiBzZXJ2aWNlIHJlcXVlc3QgaGFuZHNoYWtlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogc2VtYXBob3JlICovCisgICAgdV9pbnQzMl90ICAgc3JfbGFzdDsKKyAgICBzaG9ydCAgICAgICBvcGVuY2hhbnM7CisgICAgY2hhciAgICAgICAgcG9ydG51bTsKKyAgICBjaGFyICAgICAgICBncm91cF9pc19zZXQ7ICAgLyogR1JPVVBfSU5JVCBjb21tYW5kIGlzc3VlZCB0byBNVVNZQ0MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIG90aGVyd2lzZSBTRVRfQ0hBTiBJb2N0bCBmYWlscyAqLworCisgICAgbWNoX3QgICAgICAqY2hhbltNVV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ICAgICAgICAgICAgICAgICAgICAgIC8qIHN0YXRlIGFzIHJlZ2FyZHMgaW50ZXJydXB0IHByb2Nlc3NpbmcgKi8KKyAgICB7CisgICAgICAgIENfSU5JVCwgICAgICAgICAgICAgICAgIC8qIG9mLWJvYXJkLWFkZHJlc3Mgbm90IGNvbmZpZ3VyZWQgb3IgYXJlIGluCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHByb2Nlc3Mgb2YgYmVpbmcgcmVtb3ZlZCwgZG9uJ3QgYWNjZXNzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGhhcmR3YXJlICovCisgICAgICAgIENfSURMRSwgICAgICAgICAgICAgICAgIC8qIG9mZi1ib2FyZC1hZGRyZXNzZXMgYXJlIGNvbmZpZ3VyZWQsIGJ1dAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBkb24ndCBzZXJ2aWNlIGludGVycnVwdHMsIGp1c3QgY2xlYXIgdGhlbQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBmcm9tIGhhcmR3YXJlICovCisgICAgICAgIENfUlVOTklORyAgICAgICAgICAgICAgIC8qIGxpZmUgaXMgZ29vZCwgc2VydmljZSBhd2F5ICovCisgICAgfSAgICAgICAgICAgc3RhdGU7CisKKyAgICBzdHJ1Y3Qgc2JlX2NhcmRfaW5mbyAqbmV4dDsKKyAgICB1X2ludDMyX3QgICplZXByb21iYXNlOyAgICAgLyogbWFwcGVkIGFkZHJlc3Mgb2YgYm9hcmQncyBFRVBST00gKi8KKyAgICBjNGNwbGRfdCAgICpjcGxkYmFzZTsgICAgICAgLyogbWFwcGVkIGFkZHJlc3Mgb2YgYm9hcmQncyBDUExEIGhhcmR3YXJlICovCisgICAgY2hhciAgICAgICAqcmVsZWFzZTsgICAgICAgIC8qIFNCRSBJRCBzdHJpbmcgdy9pbiBzYmVSZWxlYXNlLmMgKi8KKyAgICB2b2lkICAgICAgICpoZHdfaW5mbzsKKyNpZmRlZiBDT05GSUdfUFJPQ19GUworICAgIHN0cnVjdCBwcm9jX2Rpcl9lbnRyeSAqZGlyX2RldjsKKyNlbmRpZgorCisgICAgLyogc2F2ZWQgb2ZmIGludGVyZmFjZSBhc3NpZ25tZW50cyB3aGljaCBib3VuZCBhIGJvYXJkICovCisgICAgaGRsY19kZXZpY2UgKmZpcnN0X2lmOworICAgIGhkbGNfZGV2aWNlICpsYXN0X2lmOworICAgIHNob3J0ICAgICAgIGZpcnN0X2NoYW5udW0sIGxhc3RfY2hhbm51bTsKKworICAgIHN0cnVjdCBpbnRsb2cKKyAgICB7CisgICAgICAgIHVfaW50MzJfdCAgIHRoaXNfc3RhdHVzX25ldzsKKyAgICAgICAgdV9pbnQzMl90ICAgbGFzdF9zdGF0dXNfbmV3OworICAgICAgICB1X2ludDMyX3QgICBkcnZyX2ludHJfdGhjb3VudDsKKyAgICAgICAgdV9pbnQzMl90ICAgZHJ2cl9pbnRyX2JoY291bnQ7CisgICAgICAgIHVfaW50MzJfdCAgIGRydnJfaW50X2ZhaWx1cmU7CisgICAgfSAgICAgICAgICAgaW50bG9nOworCisgICAgbXBpX3QgICAgICAgcG9ydFtNVVNZQ0NfTlBPUlRTXTsKKyAgICBjaGFyICAgICAgICBkZXZuYW1lW1NCRV9JRkFDRVRNUExfU0laRSArIDFdOworICAgIGF0b21pY190ICAgIHR4X3BlbmRpbmc7CisgICAgdV9pbnQzMl90ICAgYWxhcm1lZFs0XTsgICAgIC8qIGRwbTIxMSAqLworCisjaWYgZGVmaW5lZChTQkVfSVNSX1RBU0tMRVQpCisgICAgc3RydWN0IHRhc2tsZXRfc3RydWN0IGNpX211c3ljY19pc3JfdGFza2xldDsKKyNlbGlmIGRlZmluZWQoU0JFX0lTUl9JTU1FRElBVEUpCisgICAgc3RydWN0IHRxX3N0cnVjdCBjaV9tdXN5Y2NfaXNyX3RxOworI2VuZGlmCit9OwordHlwZWRlZiBzdHJ1Y3Qgc2JlX2NhcmRfaW5mbyBjaV90OworCitzdHJ1Y3Qgc19oZHdfaW5mbworeworICAgIHVfaW50OF90ICAgIHBjaV9idXNubzsKKyAgICB1X2ludDhfdCAgICBwY2lfc2xvdDsKKyAgICB1X2ludDhfdCAgICBwY2lfcGluWzJdOworICAgIHVfaW50OF90ICAgIHJldmlkWzJdOworICAgIHVfaW50OF90ICAgIG1mZ19pbmZvX3N0czsKKyNkZWZpbmUgRUVQUk9NX09LICAgICAgICAgIDB4MDAKKyNkZWZpbmUgRUVQUk9NX0NSQ0VSUiAgICAgIDB4MDEKKyAgICBjaGFyICAgICAgICBwcm9tZm10OyAgICAgICAgLyogcHJvbSB0eXBlLCBmcm9tIHNiZV9wcm9tZm9ybWF0LmggKi8KKworICAgIGNoYXIgICAgICAgIGRldm5hbWVbU0JFX0lGQUNFVE1QTF9TSVpFXTsKKyAgICBzdHJ1Y3QgcGNpX2J1cyAqYnVzOworICAgIHN0cnVjdCBuZXRfZGV2aWNlICpuZGV2OworICAgIHN0cnVjdCBwY2lfZGV2ICpwZGV2WzJdOworCisgICAgdW5zaWduZWQgbG9uZyBhZGRyWzJdOworICAgIHVuc2lnbmVkIGxvbmcgYWRkcl9tYXBwZWRbMl07CisgICAgdW5zaWduZWQgbG9uZyBsZW5bMl07CisKKyAgICB1bmlvbgorICAgIHsKKyAgICAgICAgY2hhciAgICAgICAgZGF0YVsxMjhdOworICAgICAgICBGTERfVFlQRTEgICBwZnQxOyAgICAgICAvKiBwcm9tIGZpZWxkLCB0eXBlICMxICovCisgICAgICAgIEZMRF9UWVBFMiAgIHBmdDI7ICAgICAgIC8qIHByb20gZmllbGQsIHR5cGUgIzIgKi8KKyAgICB9ICAgICAgICAgICBtZmdfaW5mbzsKK307Cit0eXBlZGVmIHN0cnVjdCBzX2hkd19pbmZvIGhkd19pbmZvX3Q7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworc3RydWN0IGM0X3ByaXYKK3sKKy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C8qIDB4MDEtMHgwMiAqLworICAgICAgICBjaGFyICAgICAgICBTdWJJZFsyXTsgICAvKiAweDAzLTB4MDQgKi8KKyAgICAgICAgY2hhciAgICAgICAgU2VyaWFsWzZdOyAgLyogMHgwNS0weDBhICovCisgICAgICAgIGNoYXIgICAgICAgIENyZWF0ZVRpbWVbNF07ICAgICAgLyogMHgwYi0weDBlICovCisgICAgICAgIGNoYXIgICAgICAgIEhlYXRSdW5UaW1lWzRdOyAgICAgLyogMHgwZi0weDEyICovCisgICAgICAgIGNoYXIgICAgICAgIEhlYXRSdW5JdGVyYXRpb25zWzRdOyAgICAgICAvKiAweDEzLTB4MTYgKi8KKyAgICAgICAgY2hhciAgICAgICAgSGVhdFJ1bkVycm9yc1s0XTsgICAvKiAweDE3LTB4MWEgKi8KKyAgICAgICAgY2hhciAgICAgICAgQ3JjMzJbNF07ICAgLyogMHgxYi0weDFlICovCisgICAgfSAgICAgICAgICAgRkxEX1RZUEUxOworCisKKy8qKioqKiogYml0IGZpZWxkcyAgZm9yIGEgdHlwZSAyIGZvcm1hdHRlZCBzZWVwcm9tICoqKioqKioqKioqKioqKioqKioqKioqKioqLworICAgIHR5cGVkZWYgc3RydWN0CisgICAgeworICAgICAgICBjaGFyICAgICAgICB0eXBlOyAgICAgICAvKiAweDAwICovCisgICAgICAgIGNoYXIgICAgICAgIGxlbmd0aFsyXTsgIC8qIDB4MDEtMHgwMiAqLworICAgICAgICBjaGFyICAgICAgICBDcmMzMls0XTsgICAvKiAweDAzLTB4MDYgKi8KKyAgICAgICAgY2hhciAgICAgICAgSWRbMl07ICAgICAgLyogMHgwNy0weDA4ICovCisgICAgICAgIGNoYXIgICAgICAgIFN1YklkWzJdOyAgIC8qIDB4MDktMHgwYSAqLworICAgICAgICBjaGFyICAgICAgICBTZXJpYWxbNl07ICAvKiAweDBiLTB4MTAgKi8KKyAgICAgICAgY2hhciAgICAgICAgQ3JlYXRlVGltZVs0XTsgICAgICAvKiAweDExLTB4MTQgKi8KKyAgICAgICAgY2hhciAgICAgICAgSGVhdFJ1blRpbWVbNF07ICAgICAvKiAweDE1LTB4MTggKi8KKyAgICAgICAgY2hhciAgICAgICAgSGVhdFJ1bkl0ZXJhdGlvbnNbNF07ICAgICAgIC8qIDB4MTktMHgxYyAqLworICAgICAgICBjaGFyICAgICAgICBIZWF0UnVuRXJyb3JzWzRdOyAgIC8qIDB4MWQtMHgyMCAqLworICAgIH0gICAgICAgICAgIEZMRF9UWVBFMjsKKworCisKKy8qKioqKiB0aGlzIHVuaW9uIGFsbG93cyB1cyB0byBhY2Nlc3MgdGhlIHNlZXByb20gYXMgYW4gYXJyYXkgb2YgYnl0ZXMgKioqLworLyoqKioqIG9yIGFzIGluZGl2aWR1YWwgZmllbGRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKiovCisKKyNkZWZpbmUgU0JFX0VFUFJPTV9TSVpFICAgIDEyOAorI2RlZmluZSBTQkVfTUZHX0lORk9fU0laRSAgc2l6ZW9mKEZMRF9UWVBFMikKKworICAgIHR5cGVkZWYgdW5pb24KKyAgICB7CisgICAgICAgIGNoYXIgICAgICAgIGJ5dGVzWzEyOF07CisgICAgICAgIEZMRF9UWVBFMSAgIGZsZFR5cGUxOworICAgICAgICBGTERfVFlQRTIgICBmbGRUeXBlMjsKKyAgICB9ICAgICAgICAgICBQUk9NRk9STUFUOworCisjaWZkZWYgX19jcGx1c3BsdXMKK30KKyNlbmRpZgorCisjZW5kaWYgICAgICAgICAgICAgICAgICAgICAgICAgIC8qKiogX0lOQ19TQkVfUFJPTUZPUk1BVF9IXyAqKiovCmRpZmYgLS1naXQgYS9kcml2ZXJzL3N0YWdpbmcvY3h0MWUxL3NiZWNvbV9pbmxpbmVfbGludXguaCBiL2RyaXZlcnMvc3RhZ2luZy9jeHQxZTEvc2JlY29tX2lubGluZV9saW51eC5oCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmM2NTE3MmQKLS0tIC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SV9SRUFEICgpOyAgICAgIC8qICovCisgICAgcmV0dXJuIGxlMzJfdG9fY3B1ICgqcCk7CisjZW5kaWYKK30KKworc3RhdGljIGlubGluZSB2b2lkCitwY2lfd3JpdGVfMzIgKHVfaW50MzJfdCAqcCwgdV9pbnQzMl90IHYpCit7CisjaWZkZWYgRkxPV19ERUJVRworICAgIGlmIChsb2dfbGV2ZWwgPj0gTE9HX0RFQlVHKQorICAgICAgICBwcl9pbmZvKCJwY2lfd3JpdGU6ICV4ID0gJXhcbiIsICh1X2ludDMyX3QpIHAsIHYpOworI2VuZGlmCisgICAgKnAgPSBjcHVfdG9fbGUzMiAodik7CisgICAgRkxVU0hfUENJX1dSSVRFICgpOyAgICAgICAgICAgICAvKiBUaGlzIHJvdXRpbmUgaXMgY2FsbGVkIGZyb20gcm91dGluZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHdoaWNoIGRvIG11bHRpcGxlIHJlZ2lzdGVyIHdyaXRlcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogd2hpY2ggdGhlbXNlbHZlcyBuZWVkIGZsdXNoaW5nIGJldHdlZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHdyaXRlcyBpbiBvcmRlciB0byBndWFyYW50ZWUgd3JpdGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIG9yZGVyaW5nLiAgSXQgaXMgbGVzcyBjb2RlLWN1bWJlcnNvbWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHRvIGZsdXNoIGhlcmUtaW4gdGhlbiB0byBpbnZlc3RpZ2F0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogYW5kIGNvZGUgdGhlIG1hbnkgb3RoZXIgcmVnaXN0ZXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHdyaXRpbmcgcm91dGluZXMuICovCit9CisjZWxzZQorLyogZm9yd2FyZCByZWZlcmVuY2UgKi8KK3VfaW50MzJfdCAgIHBjaV9yZWFkXzMyICh1X2ludDMyX3QgKnApOwordm9pZCAgICAgICAgcGNpX3dyaXRlXzMyICh1X2ludDMyX3QgKnAsIHVfaW50MzJfdCB2KTsKKworI2VuZGlmCisKKworLyoKKyAqIHN5c3RlbSBkZXBlbmRlbnQgY2FsbGJhY2tzCisgKi8KKworLyoqKioqKioqKiovCisvKiBtYWxsb2MgKi8KKy8qKioqKioqKioqLworCitzdGF0aWMgaW5saW5lIHZvaWQgKgorT1Nfa21hbGxvYyAoc2l6ZV90IHNpemUpCit7CisgICAgY2hhciAgICAgICAqcHRyID0ga21hbGxvYyAoc2l6ZSwgR0ZQX0tFUk5FTCB8IEdGUF9ETUEpOworCisgICAgaWYgKHB0cikKKyAgICAgICAgbWVtc2V0IChwdHIsIDAsIHNpemUpOworICAgIHJldHVybiBwdHI7Cit9CisKK3N0YXRpYyBpbmxpbmUgdm9pZAorT1Nfa2ZyZWUgKHZvaWQgKngpCit7CisgICAga2ZyZWUgKHgpOworfQorCisKKy8qKioqKioqKioqKioqKioqLworLyogbWVtb3J5IHRva2VuICovCisvKioqKioqKioqKioqKioqKi8KKworc3RhdGljIGlubGluZSB2b2lkICoKK09TX21lbV90b2tlbl9hbGxvYyAoc2l6ZV90IHNpemUpCit7CisgICAgc3RydWN0IHNrX2J1ZmYgKnNrYjsKKworICAgIHNrYiA9IGRldl9hbGxvY19za2IgKHNpemUpOworICAgIGlmICghc2tiKQorICAgIHsKKyAgICAgICAgLy9wcl93YXJuaW5nKCJubyBtZW0gaW4gT1NfbWVtX3Rva2VuX2FsbG9jICFcbiIpOworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisgICAgcmV0dXJuIHNrYjsKK30KKworCitzdGF0aWMgaW5saW5lIHZvaWQKK09TX21lbV90b2tlbl9mcmVlICh2b2lkICp0b2tlbikKK3sKKyAgICBkZXZfa2ZyZWVfc2tiX2FueSAodG9rZW4pOworfQorCisKK3N0YXRpYyBpbmxpbmUgdm9pZAorT1NfbWVtX3Rva2VuX2ZyZWVfaXJxICh2b2lkICp0b2tlbikKK3sKKyAgICBkZXZfa2ZyZWVfc2tiX2lycSAodG9rZW4pOworfQorCisKK3N0YXRpYyBpbmxpbmUgdm9pZCAqCitPU19tZW1fdG9rZW5fZGF0YSAodm9pZCAqdG9rZW4pCit7CisgICAgcmV0dXJuICgoc3RydWN0IHNrX2J1ZmYgKikgdG9rZW4pLT5kYXRhOworfQorCisKK3N0YXRpYyBpbmxpbmUgdm9pZCAqCitPU19tZW1fdG9rZW5fbmV4dCAodm9pZCAqdG9rZW4pCit7CisgICAgcmV0dXJuIDA7Cit9CisKKworc3RhdGljIGlubGluZSBpbnQKK09TX21lbV90b2tlbl9sZW4gKHZvaWQgKnRva2VuKQoreworICAgIHJldHVybiAoKHN0cnVjdCBza19idWZmICopIHRva2VuKS0+bGVuOworfQorCisKK3N0YXRpYyBpbmxpbmUgaW50CitPU19tZW1fdG9rZW5fdGxlbiAodm9pZCAqdG9rZW4pCit7CisgICAgcmV0dXJuICgoc3RydWN0IHNrX2J1ZmYgKikgdG9rZW4pLT5sZW47Cit9CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qIHZpcnR1YWwgdG8gcGh5c2ljYWwgYWRkciBjb252ZXJzaW9uICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgaW5saW5lIHVfbG9uZworT1NfcGh5c3RvdiAodm9pZCAqYWRkcikKK3sKKyAgICByZXR1cm4gKHVfbG9uZykgX192YSAoYWRkcik7Cit9CisKKworc3RhdGljIGlubGluZSB1X2xvbmcKK09TX3Z0b3BoeXMgKHZvaWQgKmFkZHIpCit7CisgICAgcmV0dXJuIF9fcGEgKGFkZHIpOworfQorCisKKy8qKioqKioqKioqLworLyogc2Vtb3BzICovCisvKioqKioqKioqKi8KKwordm9pZCAgICAgICAgT1Nfc2VtX2luaXQgKHZvaWQgKiwgaW50KTsKKworCitzdGF0aWMgaW5saW5lIHZvaWQKK09TX3NlbV9mcmVlICh2b2lkICpzZW0pCit7CisgICAgLyoKKyAgICAgKiBOT09QIC0gc2luY2Ugc2VtYXBob3JlcyBzdHJ1Y3R1cmVzIHByZWRlY2xhcmVkIHcvaW4gc3RydWN0dXJlcywgbm8KKyAgICAgKiBsb25nZXIgbWFsbG9jJ2QKKyAgICAgKi8KK30KKworI2RlZmluZSBTRF9TRU1fVEFLRShzZW0sZGVzYykgIGRvd24oc2VtKQorI2RlZmluZSBTRF9TRU1fR0lWRShzZW0pICAgICAgIHVwKHNlbSkKKyNkZWZpbmUgU0VNX0FWQUlMQUJMRSAgICAgMQorI2RlZmluZSBTRU1fVEFLRU4gICAgICAgICAwCisKKworLyoqKioqKioqKioqKioqKioqKioqKiovCisvKiB3YXRjaGRvZyBmdW5jdGlvbnMgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqLworCitzdHJ1Y3Qgd2F0Y2hkb2cKK3sKKyAgICBzdHJ1Y3QgdGltZXJfbGlzdCBoOworI2lmIExJTlVYX1ZFUlNJT05fQ09ERSA8IEtFUk5FTF9WRVJTSU9OKDIsNSwwKQorICAgIHN0cnVjdCB0cV9zdHJ1Y3QgdHE7CisjZWxzZQorICAgIHN0cnVjdCB3b3JrX3N0cnVjdCB3b3JrOworI2VuZGlmCisgICAgdm9pZCAgICAgICAqc29mdGM7CisgICAgdm9pZCAgICAgICAgKCpmdW5jKSAodm9pZCAqc29mdGMpOworICAgIGludCAgICAgICAgIHRpY2tzOworICAgIGludCAgICAgICAgIGluaXRfdHE7Cit9OworCisKK3N0YXRpYyBpbmxpbmUgaW50CitPU19zdGFydF93YXRjaGRvZyAoc3RydWN0IHdhdGNoZG9nICogd2QpCit7CisgICAgd2QtPmguZXhwaXJlcyA9IGppZmZpZXMgKyB3ZC0+dGlja3M7CisgICAgYWRkX3RpbWVyICgmd2QtPmgpOworICAg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aCIKKworLyogZGVmaW5lcyAqLworI2RlZmluZSBDUkMzMl9QT0xZTk9NSUFMICAgICAgICAgICAgICAgIDB4RURCODgzMjBMCisjZGVmaW5lIENSQ19UQUJMRV9FTlRSSUVTICAgICAgICAgICAgICAgICAgICAgICAyNTYKKworCisKK3N0YXRpYyAgICAgIHVfaW50MzJfdCBjcmNUYWJsZUluaXQ7CisKKyNpZmRlZiBTVEFUSUNfQ1JDX1RBQkxFCitzdGF0aWMgdV9pbnQzMl90IENSQ1RhYmxlW0NSQ19UQUJMRV9FTlRSSUVTXTsKKworI2VuZGlmCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKgorKiBnZW5DcmNUYWJsZSAtIGZpbGxzIGluIENSQ1RhYmxlLCBhcyB1c2VkIGJ5IHNiZUNyYygpCisqCisqIFJFVFVSTlM6IE4vQQorKgorKiBFUlJOTzogTi9BCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3N0YXRpYyB2b2lkCitnZW5DcmNUYWJsZSAodV9pbnQzMl90ICpDUkNUYWJsZSkKK3sKKyAgICBpbnQgICAgICAgICBpaSwgamo7CisgICAgdV9pbnQzMl90ICAgICAgY3JjOworCisgICAgZm9yIChpaSA9IDA7IGlpIDwgQ1JDX1RBQkxFX0VOVFJJRVM7IGlpKyspCisgICAgeworICAgICAgICBjcmMgPSBpaTsKKyAgICAgICAgZm9yIChqaiA9IDg7IGpqID4gMDsgamotLSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKGNyYyAmIDEpCisgICAgICAgICAgICAgICAgY3JjID0gKGNyYyA+PiAxKSBeIENSQzMyX1BPTFlOT01JQUw7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgY3JjID4+PSAxOworICAgICAgICB9CisgICAgICAgIENSQ1RhYmxlW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IGluIGJ5dGVzICovCisgICAgICAgIHVfaW50MzJfdCBpbml0aWFsQ3JjLCAgICAgIC8qIHN0YXJ0aW5nIENSQyAqLworICAgICAgICB1X2ludDMyX3QgKnJlc3VsdCkKK3sKKyAgICB1X2ludDMyX3QgICAgICp0YmwgPSAwOworICAgIHVfaW50MzJfdCAgICAgIHRlbXAxLCB0ZW1wMiwgY3JjOworCisgICAgLyoKKyAgICAgKiBpZiB0YWJsZSBub3QgeWV0IGNyZWF0ZWQsIGRvIHNvLiBEb24ndCBjYXJlIGFib3V0ICJleHRyYSIgdGltZQorICAgICAqIGNoZWNraW5nIHRoaXMgZXZlcnl0aW1lIHNiZUNyYygpIGlzIGNhbGxlZCwgc2luY2UgQ1JDIGNhbGN1bGF0aW9ucyBhcmUKKyAgICAgKiBhbHJlYWR5IHRpbWUgY29uc3VtaW5nCisgICAgICovCisgICAgaWYgKCFjcmNUYWJsZUluaXQpCisgICAgeworI2lmZGVmIFNUQVRJQ19DUkNfVEFCTEUKKyAgICAgICAgdGJsID0gJkNSQ1RhYmxlOworICAgICAgICBnZW5DcmNUYWJsZSAodGJsKTsKKyNlbHNlCisgICAgICAgIHRibCA9ICh1X2ludDMyX3QgKikgT1Nfa21hbGxvYyAoQ1JDX1RBQkxFX0VOVFJJRVMgKiBzaXplb2YgKHVfaW50MzJfdCkpOworICAgICAgICBpZiAodGJsID09IDApCisgICAgICAgIHsKKyAgICAgICAgICAgICpyZXN1bHQgPSAwOyAgICAgICAgICAgIC8qIGR1bW15IHVwIHJldHVybiB2YWx1ZSBkdWUgdG8gbWFsbG9jCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBmYWlsdXJlICovCisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgZ2VuQ3JjVGFibGUgKHRibCk7CisjZW5kaWYKKyAgICB9CisgICAgLyogaW52ZXJ0aW5nIGJpdHMgbWFrZXMgWk1PREVNICYgUEtaSVAgY29tcGF0aWJsZS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ICAgICAgICAqIFZlcnNpb24pICovCisgICAgICAgIGJyZWFrOworICAgIGNhc2UgU0JFX0JPQVJEX0lEIChQQ0lfVkVORE9SX0lEX1NCRSwgUENJX0RFVklDRV9JRF9XQU5QVE1DXzI1NlQzX1QxKToKKyAgICAgICAgY2ktPmhkd19iaWQgPSBTQkVfQklEXzI1NlQzX1QxOyAvKiAweDQyIC0gU0JFIHdhblBUTUMtMjU2VDMgKFQxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogVmVyc2lvbikgKi8KKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBTQkVfQk9BUkRfSUQgKFBDSV9WRU5ET1JfSURfU0JFLCBQQ0lfREVWSUNFX0lEX1dBTlBNQ19DNFQxRTEpOgorICAgIGNhc2UgU0JFX0JPQVJEX0lEIChQQ0lfVkVORE9SX0lEX1NCRSwgUENJX0RFVklDRV9JRF9XQU5QTUNfQzRUMUUxX0wpOgorICAgICAgICAvKgorICAgICAgICAgKiBUaGlzIEJvYXJkIElEIGlzIGEgZ2VuZXJpYyBpZGVudGlmaWNhdGlvbi4gIFVzZSB0aGUgZm91bmQgbnVtYmVyCisgICAgICAgICAqIG9mIHBvcnRzIHRvIGZ1cnRoZXIgZGVmaW5lIHRoaXMgaGFyZHdhcmUuCisgICAgICAgICAqLworICAgICAgICBzd2l0Y2ggKGNpLT5tYXhfcG9ydCkKKyAgICAgICAgeworICAgICAgICBkZWZhdWx0OiAgICAgICAgICAgICAgICAgICAgLyogc2hvdWxkbid0IG5lZWQgYSBkZWZhdWx0LCBidXQgaGF2ZSBvbmUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGFueXdheSAqLworICAgICAgICBjYXNlIDQ6CisgICAgICAgICAgICBjaS0+aGR3X2JpZCA9IFNCRV9CSURfUE1DX0M0VDFFMTsgICAvKiAweEM0IC0gU0JFIHdhblBNQy1DNFQxRTEgKi8KKyAgICAgICAgICAgIGJyZWFrOworICAgICA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8KKyAgICAgICAgc3dpdGNoIChjaS0+bWF4X3BvcnQpCisgICAgICAgIHsKKyAgICAgICAgZGVmYXVsdDogICAgICAgICAgICAgICAgICAgIC8qIHNob3VsZG4ndCBuZWVkIGEgZGVmYXVsdCwgYnV0IGhhdmUgb25lCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBhbnl3YXkgKi8KKyAgICAgICAgY2FzZSA0OgorICAgICAgICAgICAgY2ktPmhkd19iaWQgPSBTQkVfQklEX1BDSV9DNFQxRTE7ICAgLyogMHgwNCAtIFNCRSB3YW5QQ0ktQzRUMUUxICovCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgY2ktPmhkd19iaWQgPSBTQkVfQklEX1BDSV9DMlQxRTE7ICAgLyogMHgwMiAtIFNCRSB3YW5QQ0ktQzJUMUUxICovCisgICAgICAgICAgICBjaS0+YnJkX2lkID0gU0JFX0JPQVJEX0lEIChQQ0lfVkVORE9SX0lEX1NCRSwgUENJX0RFVklDRV9JRF9XQU5QQ0lfQzJUMUUxKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIDE6CisgICAgICAgICAgICBjaS0+aGR3X2JpZCA9IFNCRV9CSURfUENJX0MxVDFFMTsgICAvKiAweDAxIC0gU0JFIHdhblBDSS1DMVQxRTEgKi8KKyAgICAgICAgICAgIGNpLT5icmRfaWQgPSBTQkVfQk9BUkRfSUQgKFBDSV9WRU5ET1JfSURfU0JFLCBQQ0lfREVWSUNFX0lEX1dBTlBDSV9DMVQxRTEpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBTQkVfQk9BUkRfSUQgKFBDSV9WRU5ET1JfSURfU0JFLCBQQ0lfREVWSUNFX0lEX1dBTlBDSV9DMlQxRTEpOgorICAgICAgICBjaS0+aGR3X2JpZCA9IFNCRV9CSURfUENJX0MyVDFFMTsgICAgICAgLyogMHgwMiAtIFNCRSB3YW5QQ0ktQzJUMUUxICovCisgICAgICAgIGJyZWFrOworICAgIGNhc2UgU0JFX0JPQVJEX0lEIChQQ0lfVkVORE9SX0lEX1NCRSwgUENJX0RFVklDRV9JRF9XQU5QQ0lfQzFUMUUxKToKKyAgICAgICAgY2ktPmhkd19iaWQgPSBTQkVfQklEX1BDSV9DMVQxRTE7ICAgICAgIC8qIDB4MDEgLSBTQkUgd2FuUENJLUMxVDFFMSAqLworICAgICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgICAvKioqIGJpZCA9ICI8dW5rbm93bj4iOyAgKioqLworICAgICAgICBjaS0+aGR3X2JpZCA9IFNCRV9CSURfUE1DX0M0VDFFMTsgICAgICAgLyogMHg0MSAtIFNCRSB3YW5QVE1DLUM0VDFFMSAqLworICAgICAgICBicmVhazsKKyAgICB9Cit9CisKKy8qIGdpdmVuIHRoZSBwcmVzZXR0aW5nIG9mIGhkd19iaWQsIHNldCB0aGUgY29ycmVzcG9uZGluZyBicmRfaWQgKi8KKwordm9pZAorc2JlaWRfc2V0X2JkdHlwZSAoY2lfdCAqIGNpKQoreworICAgIC8qIHNldCBTQkUncyB1bmlxdWUgUENJIFZFTkRPUi9ERVZJRCAqLworICAgIHN3aXRjaCAoY2ktPmhkd19iaWQpCisgICAgeworICAgICAgICBjYXNlIFNCRV9CSURfQzFUMzogICAgICAvKiBTQkUgd2FuUE1DLUMxVDMgKi8KKyAgICAgICAgY2ktPmJyZF9pZCA9IFNCRV9CT0FSRF9JRCAoUENJX1ZFTkRPUl9JRF9TQkUsIFBDSV9ERVZJQ0VfSURfV0FOUE1DX0MxVDMpOworICAgICAgICBicmVhazsKKyAgICBjYXNlIFNCRV9CSURfQzI0VEUxOiAgICAgICAgICAgIC8qIFNCRSB3YW5QVE1DLUMyNFRFMSAqLworICAgICAgICBjaS0+YnJkX2lkID0gU0JFX0JPQVJEX0lEIChQQ0lfVkVORE9SX0lEX1NCRSwgUENJX0RFVklDR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2R1bGUuaD4KKyNpbmNsdWRlIDxsaW51eC9lcnJuby5oPgorI2luY2x1ZGUgPGxpbnV4L2tlcm5lbC5oPgorI2luY2x1ZGUgPGxpbnV4L2luaXQuaD4KKyNpbmNsdWRlIDxsaW51eC9wcm9jX2ZzLmg+CisjaW5jbHVkZSA8bGludXgvc2NoZWQuaD4KKyNpbmNsdWRlIDxhc20vdWFjY2Vzcy5oPgorI2luY2x1ZGUgInBtY2M0X3N5c2RlcC5oIgorI2luY2x1ZGUgInNiZWNvbV9pbmxpbmVfbGludXguaCIKKyNpbmNsdWRlICJwbWNjNF9wcml2YXRlLmgiCisjaW5jbHVkZSAic2JlcHJvYy5oIgorCisvKiBmb3J3YXJkcyAqLwordm9pZCAgICAgICAgc2JlY29tX2dldF9icmRpbmZvIChjaV90ICosIHN0cnVjdCBzYmVfYnJkX2luZm8gKiwgdV9pbnQ4X3QgKik7CitleHRlcm4gc3RydWN0IHNfaGR3X2luZm8gaGR3X2luZm9bTUFYX0JPQVJEU107CisKKyNpZmRlZiBDT05GSUdfUFJPQ19GUworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBwcm9jZnMgc3R1ZmYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKwordm9pZAorc2JlY29tX3Byb2NfYnJkX2NsZWFudXAgKGNpX3QgKiBjaSkKK3sKKyAgICBpZiAoY2ktPmRpcl9kZXYpCisgICAgeworCWNoYXIgZGlyWzcgKyBTQkVfSUZBQ0VUTVBMX1NJWkUgKyAxXTsKKwlzbnByaW50ZihkaXIsIHNpemVvZihkaXIpLCAiZHJpdmVyLyVzIiwgY2ktPmRldm5hbWUpOworICAgICAgICByZW1vdmVfcHJvY19lbnRyeSgiaW5mbyIsIGNpLT5kaXJfZGV2KTsKKyAgICAgICAgcmVtb3ZlX3Byb2NfZW50cnkoZGlyLCBOVUxMKTsKKyAgICAgICAgY2ktPmRpcl9kZXYgPSBOVUxMOworICAgIH0KK30KKworCitzdGF0aWMgaW50CitzYmVjb21fcHJvY19nZXRfc2JlX2luZm8gKGNoYXIgKmJ1ZmZlciwgY2hhciAqKnN0YXJ0LCBvZmZfdCBvZmZzZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBsZW5ndGgsIGludCAqZW9mLCB2b2lkICpwcml2KQoreworICAgIGNpX3QgICAgICAgKmNpID0gKGNpX3QgKikgcHJpdjsKKyAgICBpbnQgICAgICAgICBsZW4gPSAwOworICAgIGNoYXIgICAgICAgKnNwZDsKKyAgICBzdHJ1Y3Qgc2JlX2JyZF9pbmZvICpiaXA7CisKKyAgICBpZiAoIShiaXAgPSBPU19rbWFsbG9jIChzaXplb2YgKHN0cnVjdCBzYmVfYnJkX2luZm8pKSkpCisgICAgeworICAgICAgICByZXR1cm4gLUVOT01FTTsKKyAgICB9CisjaWYgMAorICAgIC8qKiBSTEQgREVCVUcgKiovCisgICAgcHJfaW5mbygiPj4gc2JlY29tX3Byb2NfZ2V0X3NiZV9pbmZvOiBlbnRlcmVkLCBvZmZzZXQgJWQuIGxlbmd0aCAlZC5cbiIsCisgICAgICAgICAgICAoaW50KSBvZmZzZXQsIChpbnQpIGxlbmd0aCk7CisjZW5kaWYKKworICAgIHsKKyAgICAgICAgaGR3X2luZm9fdCAqaGkgPSAmaGR3X2luZm9bY2ktPmJyZG5vXTsKKworICAgICAgICB1X2ludDhfdCAqYnNuID0gMDsKKworICAgICAgICBzd2l0Y2ggKGhpLT5wcm9tZm10KQorICAgICAgICB7CisgICAgICAgIGNhc2UgUFJPTV9GT1JNQVRfVFlQRTE6CisgICAgICAgICAgICBic24gPSAodV9pbnQ4X3QgKikgaGktPm1mZ19pbmZvLnBmdDEuU2VyaWFsOworICAgICAgICAgICAgY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BzZXQgRU9GLCByZXR1cm4gbGVuICovCisgICAgKmVvZiA9IDE7CisjZW5kaWYKKworI2lmIDAKKyAgICAvKgorICAgICAqICMxIC0gZnJvbSBuZXQvd2lyZWxlc3MvYXRtZWwuYyBSTEQgTk9URSAtdGhlcmUncyBzb21ldGhpbmcgd3Jvbmcgd2l0aAorICAgICAqIHRoaXMgcGxhZ2FyaXplZCBjb2RlIHdoaWNoIHJlc3VsdHMgaW4gdGhpcyByb3V0aW5lIGJlaW5nIGNhbGxlZCBUV0lDRS4KKyAgICAgKiBUaGUgc2Vjb25kIGNhbGwgcmV0dXJucyBaRVJPLCByZXN1bHRpbmcgaW4gaGlkZGVuIGZhaWx1cmUsIGJ1dCBhdAorICAgICAqIGxlYXN0IG9ubHkgYSBzaW5nbGUgbWVzc2FnZSBzZXQgaXMgYmVpbmcgZGlzcGxheWVkLgorICAgICAqLworICAgIGlmIChsZW4gPD0gb2Zmc2V0ICsgbGVuZ3RoKQorICAgICAgICAqZW9mID0gMTsKKyAgICAqc3RhcnQgPSBidWZmZXIgKyBvZmZzZXQ7CisgICAgbGVuIC09IG9mZnNldDsKKyAgICBpZiAobGVuID4gbGVuZ3RoKQorICAgICAgICBsZW4gPSBsZW5ndGg7CisgICAgaWYgKGxlbiA8IDApCisgICAgICAgIGxlbiA9IDA7CisjZW5kaWYKKworI2lmIDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogIzIgZnJvbSBuZXQvdG9rZW5yaW5nL29seW1waWMuYyArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBsYW5zdHJlYW1lci5jICovCisgICAgeworICAgICAgICBvZmZfdCAgICAgICBiZWdpbiA9IDA7CisgICAgICAgIGludCAgICAgICAgIHNpemUgPSAwOworICAgICAgICBvZmZfdCAgICAgICBwb3MgPSAwOworCisgICAgICAgIHNpemUgPSBsZW47CisgICAgICAgIHBvcyA9IGJlZ2luICsgc2l6ZTsKKyAgICAgICAgaWYgKHBvcyA8IG9mZnNldCkKKyAgICAgICAgeworICAgICAgICAgICAgbGVuID0gMDsKKyAgICAgICAgICAgIGJlZ2luID0gcG9zOworICAgICAgICB9CisgICAgICAgICpzdGFydCA9IGJ1ZmZlciArIChvZmZzZXQgLSBiZWdpbik7ICAgICAvKiBTdGFydCBvZiB3YW50ZWQgZGF0YSAqLworICAgICAgICBsZW4gLT0gKG9mZnNldCAtIGJlZ2luKTsgICAgLyogU3RhcnQgc2xvcCAqLworICAgICAgICBpZiAobGVuID4gbGVuZ3RoKQorICAgICAgICAgICAgbGVuID0gbGVuZ3RoOyAgICAgICAgICAgLyogRW5kaW5nIHNsb3AgKi8KKyAgICB9CisjZW5kaWYKKworI2lmIDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogIzMgZnJvbQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogY2hhci9mdGFwZS9sb3dsZXZlbC9mdGFwZS1wcm9jLmMgKi8KKyAgICBsZW4gPSBzdHJsZW4gKGJ1ZmZlcik7CisgICAgKnN0YXJ0ID0gTlVMTDsKKyAgICBpZiAob2Zmc2V0ICsgbGVuZ3RoID49IGxlbikKKyAgICAgICAgKmVvZiA9IDE7CisgICAgZWxzZQorICAgICAgICAqZW9mID0gMDsKKyNlbmRpZgorCisjaWYgMAorICAgIHByX2luZm8oIj4+IHByb2NfZnM6IHJldHVybmVkIGxlbiA9ICVkLiwgc3RhcnQgJXBcbiIsIGxlbiwgc3RhcnQpOyAgLyogUkxEIERFQlVHICovCisjZW5kaWYKKworLyoqKgorICAgdXNpbmcgTk9ORTogcmV0dXJucyA9IDMxNC4zMTQuMzE0LgorICAgdXNpbmcgIzEgIDogcmV0dXJucyA9IDMxNCwgMC4KKyAgIHVzaW5nICMyICA6IHJldHVybnMgPSAzMTQsIDAsIDAuCisgICB1c2luZyAjMyAgOiByZXR1cm5zID0gMzE0LCAzMTQuCisgICB1c2luZyAjNCAgOiByZXR1cm5zID0gMzE0LCAzMTQuCisqKiovCisKKyAgICByZXR1cm4gbGVuOworfQorCisvKiBpbml0aWFsaXplIHRoZSAvcHJvYyBzdWJzeXN0ZW0gZm9yIHRoZSBzcGVjaWZpYyBTQkUgZHJpdmVyICovCisKK2ludCAgICAgICAgIF9faW5pdAorc2JlY29tX3Byb2NfYnJkX2luaXQgKGNpX3QgKiBjaSkKK3sKKyAgICBzdHJ1Y3QgcHJvY19kaXJfZW50cnkgKmU7CisgICAgY2hhciBkaXJbNyArIFNCRV9JRkFDRVRNUExfU0laRSArIDFdOworCisgICAgLyogY3JlYXRlIGEgZGlyZWN0b3J5IGluIHRoZSByb290IHByb2NmcyAqLworICAgIHNucHJpbnRmKGRpciwgc2l6ZW9mKGRpciksICJkcml2ZXIvJXMiLCBjaS0+ZGV2bmFtZSk7CisgICAgY2ktPmRpcl9kZXYgPSBwcm9jX21rZGlyKGRpciwgTlVMTCk7CisgICAgaWYgKCFjaS0+ZGlyX2RldikKKyAgICB7CisgICAgICAgIHByX2VycigiVW5hYmxlIHRvIGNyZWF0ZSBkaXJlY3RvcnkgL3Byb2MvZHJpdmVyLyVzXG4iLCBjaS0+ZGV2bmFtZSk7CisgICAgICAgIGdvdG8gZmFpbDsKKyAgICB9CisgICAgZSA9IGNyZWF0ZV9wcm9jX3JlYWRfZW50cnkgKCJpbmZvIiwgU19JRlJFRyB8IFNfSVJVR08sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpLT5kaXJfZGV2LCBzYmVjb21fcHJvY19nZXRfc2JlX2luZm8sIGNpKTsKKyAgICBpZiAoIWUpCisgICAgeworICAgICAgICBwcl9lcnIoIlVuYWJsZSB0byBjcmVhdGUgZW50cnkgL3Byb2MvZHJpdmVyLyVzL2luZm9cbiIsIGNpLT5kZXZuYW1lKTsKKyAgICAgICAgZ290byBmYWlsOworICAgIH0KKyAgICByZXR1cm4gMDsKKworZmFpbDoKKyAgICBzYmVjb21fcHJvY19icmRfY2xlYW51cCAoY2kpOworICAgIHJldHVybiAxOworf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jIGIvZHJpdmVycy9zdGFnaW5nL2R0MzE1NXY0bC9kdDMxNTV2NGwuYwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi42ZGMzYWY2Ci0tLSAvZGV2L251bGwKKysrIGIvZHJpdmVycy9zdGFnaW5nL2R0MzE1NXY0bC9kdDMxNTV2NGwuYwpAQCAtMCwwICsxLDEyMDAgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICAgQ29weXJpZ2h0IChDKSAyMDA2LTIwMTAgYnkgTWFyaW4gTWl0b3YgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICAgbWl0b3ZAaXNzcC5iYXMuYmcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICAgVGhpcyBwcm9ncmFtIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0IGFuZC9vciBtb2RpZnkgICoKKyAqICAgaXQgdW5kZXIgdGhlIHRlcm1zIG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBhcyBwdWJsaXNoZWQgYnkgICoKKyAqICAgdGhlIEZyZWUgU29mdHdhcmUgRm91bmRhdGlvbjsgZWl0aGVyIHZlcnNpb24gMiBvZiB0aGUgTGljZW5zZSwgb3IgICAgICoKKyAqICAgKGF0IHlvdXIgb3B0aW9uKSBhbnkgbGF0ZXIgdmVyc2lvbi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICAgVGhpcyBwcm9ncmFtIGlzIGRpc3RyaWJ1dGVkIGluIHRoZSBob3BlIHRoYXQgaXQgd2lsbCBiZSB1c2VmdWwsICAgICAgICoKKyAqICAgYnV0IFdJVEhPVVQgQU5ZIFdBUlJBTlRZOyB3aXRob3V0IGV2ZW4gdGhlIGltcGxpZWQgd2FycmFudHkgb2YgICAgICAgICoKKyAqICAgTUVSQ0hBTlRBQklMSVRZIG9yIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFLiAgU2VlIHRoZSAgICAgICAgICoKKyAqICAgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgZm9yIG1vcmUgZGV0YWlscy4gICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICAgWW91IHNob3VsZCBoYXZlIHJlY2VpdmVkIGEgY29weSBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgICAgICoKKyAqICAgYWxvbmcgd2l0aCB0aGlzIHByb2dyYW07IGlmIG5vdCwgd3JpdGUgdG8gdGhlICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICAgRnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uLCBJbmMuLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICAgNTkgVGVtcGxlIFBsYWNlIC0gU3VpdGUgMzMwLCBCb3N0b24sIE1BICAwMjExMS0xMzA3LCBVU0EuICAgICAgICAgICAgICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNpbmNsdWRlIDxsaW51eC92ZXJzaW9uLmg+CisjaW5jbHVkZSA8bGludXgvc3RyaW5naWZ5Lmg+CisjaW5jbHVkZSA8bGludXgvZGVsYXkuaD4KKyNpbmNsdW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VSTl9JTkZPICJkdDMxNTU6ID09PT09PT09PT09PT09PT09PVxuIik7Cit9CisKK21vZHVsZV9pbml0KGR0MzE1NV9pbml0X21vZHVsZSk7Cittb2R1bGVfZXhpdChkdDMxNTVfZXhpdF9tb2R1bGUpOworCitNT0RVTEVfREVTQ1JJUFRJT04oInZpZGVvNGxpbnV4IHBjaS1kcml2ZXIgZm9yIGR0MzE1NSBmcmFtZSBncmFiYmVyIik7CitNT0RVTEVfQVVUSE9SKCJNYXJpbiBNaXRvdiA8bWl0b3ZAaXNzcC5iYXMuYmc+Iik7CitNT0RVTEVfVkVSU0lPTihEVDMxNTVfVkVSU0lPTik7CitNT0RVTEVfTElDRU5TRSgiR1BMIik7CmRpZmYgLS1naXQgYS9kcml2ZXJzL3N0YWdpbmcvZHQzMTU1djRsL2R0MzE1NXY0bC5oIGIvZHJpdmVycy9zdGFnaW5nL2R0MzE1NXY0bC9kdDMxNTV2NGwuaApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5hYTY4YTZmMwotLS0gL2Rldi9udWxsCisrKyBiL2RyaXZlcnMvc3RhZ2luZy9kdDMxNTV2NGwvZHQzMTU1djRsLmgKQEAgLTAsMCArMSwyMjQgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICAgQ29weXJpZ2h0IChDKSAyMDA2LTIwMTAgYnkgTWFyaW4gTWl0b3YgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICAgbWl0b3ZAaXNzcC5iYXMuYmcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICAgVGhpcyBwcm9ncmFtIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0IGFuZC9vciBtb2RpZnkgICoKKyAqICAgaXQgdW5kZXIgdGhlIHRlcm1zIG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBhcyBwdWJsaXNoZWQgYnkgICoKKyAqICAgdGhlIEZyZWUgU29mdHdhcmUgRm91bmRhdGlvbjsgZWl0aGVyIHZlcnNpb24gMiBvZiB0aGUgTGljZW5zZSwgb3IgICAgICoKKyAqICAgKGF0IHlvdXIgb3B0aW9uKSBhbnkgbGF0ZXIgdmVyc2lvbi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICAgVGhpcyBwcm9ncmFtIGlzIGRpc3RyaWJ1dGVkIGluIHRoZSBob3BlIHRoYXQgaXQgd2lsbCBiZSB1c2VmdWwsICAgICAgICoKKyAqICAgYnV0IFdJVEhPVVQgQU5ZIFdBUlJBTlRZOyB3aXRob3V0IGV2ZW4gdGhlIGltcGxpZWQgd2FycmFudHkgb2YgICAgICAgICoKKyAqICAgTUVSQ0hBTlRBQklMSVRZIG9yIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFLiAgU2VlIHRoZSAgICAgICAgICoKKyAqICAgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgZm9yIG1vcmUgZGV0YWlscy4gICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICAgWW91IHNob3VsZCBoYXZlIHJlY2VpdmVkIGEgY29weSBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgICAgICoKKyAqICAgYWxvbmcgd2l0aCB0aGlzIHByb2dyYW07IGlmIG5vdC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ciwKKwkmaWlvX3NjYW5fZWxfaW42bWluNy5kZXZfYXR0ci5hdHRyLAorCSZpaW9fc2Nhbl9lbF9pbjFtaW4wLmRldl9hdHRyLmF0dHIsCisJJmlpb19zY2FuX2VsX2luM21pbjIuZGV2X2F0dHIuYXR0ciwKKwkmaWlvX3NjYW5fZWxfaW41bWluNC5kZXZfYXR0ci5hdHRyLAorCSZpaW9fc2Nhbl9lbF9pbjdtaW42LmRldl9hdHRyLmF0dHIsCisJJmlpb19kZXZfYXR0cl9pbl9wcmVjaXNpb24uZGV2X2F0dHIuYXR0ciwKK307CisKK3N0YXRpYyBzdHJ1Y3QgYXR0cmlidXRlX2dyb3VwIG1heDExNjA4X3NjYW5fZWxfZ3JvdXAgPSB7CisJLm5hbWUgPSAic2Nhbl9lbGVtZW50cyIsCisJLmF0dHJzID0gbWF4MTE2MDhfc2Nhbl9lbF9hdHRycywKK307CisKK2VudW0geyBtYXgxMzYxLAorICAgICAgIG1heDEzNjIsCisgICAgICAgbWF4MTM2MywKKyAgICAgICBtYXgxMzY0LAorICAgICAgIG1heDEwMzYsCisgICAgICAgbWF4MTAzNywKKyAgICAgICBtYXgxMDM4LAorICAgICAgIG1heDEwMzksCisgICAgICAgbWF4MTEzNiwKKyAgICAgICBtYXgxMTM3LAorICAgICAgIG1heDExMzgsCisgICAgICAgbWF4MTEzOSwKKyAgICAgICBtYXgxMjM2LAorICAgICAgIG1heDEyMzcsCisgICAgICAgbWF4MTIzOCwKKyAgICAgICBtYXgxMjM5LAorICAgICAgIG1heDExNjAwLAorICAgICAgIG1heDExNjAxLAorICAgICAgIG1heDExNjAyLAorICAgICAgIG1heDExNjAzLAorICAgICAgIG1heDExNjA0LAorICAgICAgIG1heDExNjA1LAorICAgICAgIG1heDExNjA2LAorICAgICAgIG1heDExNjA3LAorICAgICAgIG1heDExNjA4LAorICAgICAgIG1heDExNjA5LAorICAgICAgIG1heDExNjEwLAorICAgICAgIG1heDExNjExLAorICAgICAgIG1heDExNjEyLAor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gLTIyLDI0ICsyMiw0NCBAQAogZW51bSB7CiAJUE9EX3R3ZWFrICAgICAgICAgICAgICAgICAgICAgICAgICA9ICAgMSwKIAlQT0Rfd2FoX3Bvc2l0aW9uICAgICAgICAgICAgICAgICAgID0gICA0LAotCVBPRF9jb21wcmVzc2lvbl9nYWluICAgICAgICAgICAgICAgPSAgIDUsICAvKiBkZXZpY2U6IExJTkU2X0JJVFNfUE9EWFRBTEwgKi8KKworCS8qIGRldmljZTogTElORTZfQklUU19QT0RYVEFMTCAqLworCVBPRF9jb21wcmVzc2lvbl9nYWluICAgICAgICAgICAgICAgPSAgIDUsCisKIAlQT0Rfdm9sX3BlZGFsX3Bvc2l0aW9uICAgICAgICAgICAgID0gICA3LAogCVBPRF9jb21wcmVzc2lvbl90aHJlc2hvbGQgICAgICAgICAgPSAgIDksCiAJUE9EX3BhbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA9ICAxMCwKIAlQT0RfYW1wX21vZGVsX3NldHVwICAgICAgICAgICAgICAgID0gIDExLAotCVBPRF9hbXBfbW9kZWwgICAgICAgICAgICAgICAgICAgICAgPSAgMTIsICAvKiBmaXJtd2FyZTogMi4wICovCisJUE9EX2FtcF9tb2RlbCAgICAgICAgICAgICAgICAgICAgICA9ICAxMiwgLyogZmlybXdhcmU6IDIuMCAqLwogCVBPRF9kcml2ZSAgICAgICAgICAgICAgICAgICAgICAgICAgPSAgMTMsCiAJUE9EX2Jhc3MgICAgICAgICAgICAgICAgICAgICAgICAgICA9ICAxNCwKLQlQT0RfbWlkICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gIDE1LCAgLyogZGV2aWNlOiBMSU5FNl9CSVRTX1BPRFhUQUxMICovCi0JUE9EX2xvd21pZCAgICAgICAgICAgICAgICAgICAgICAgICA9ICAxNSwgIC8qIGRldmljZTogTElORTZfQklUU19CQVNTUE9EWFRBTEwgKi8KLQlQT0RfdHJlYmxlICAgICAgICAgICAgICAgICAgICAgICAgID0gIDE2LCAgLyogZGV2aWNlOiBMSU5FNl9CSVRTX1BPRFhUQUxMICovCi0JUE9EX2hpZ2htaWQgICAgICAgICAgICAgICAgICAgICAgICA9ICAxNiwgIC8qIGRldmljZTogTElORTZfQklUU19CQVNTUE9EWFRBTEwgKi8KKworCS8qIGRldmljZTogTElORTZfQklUU19QT0RYVEFMTCAqLworCVBPRF9taWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSAgMTUsCisKKwkgLyogZGV2aWNlOiBMSU5FNl9CSVRTX0JBU1NQT0RYVEFMTCAqLworCVBPRF9sb3dtaWQgICAgICAgICAgICAgICAgICAgICAgICAgPSAgMTUsCisKKwkvKiBkZXZpY2U6IExJTkU2X0JJVFNfUE9EWFRBTEwgKi8KKwlQT0RfdHJlYmxlICAgICAgICAgICAgICAgICAgICAgICAgID0gIDE2LAorCisJLyogZGV2aWNlOiBMSU5FNl9CSVRTX0JBU1NQT0RYVEFMTCAqLworCVBPRF9oaWdobWlkICAgICAgICAgICAgICAgICAgICAgICAgPSAgMTYsCisKIAlQT0RfY2hhbl92b2wgICAgICAgICAgICAgICAgICAgICAgID0gIDE3LAotCVBPRF9yZXZlcmJfbWl4ICAgICAgICAgICAgICAgICAgICAgPSAgMTgsICAvKiBkZXZpY2U6IExJTkU2X0JJVFNfUE9EWFRBTEwgKi8KKworCS8qIGRldmljZTogTElORTZfQklUU19QT0RYVEFMTCAqLworCVBPRF9yZXZlcmJfbWl4ICAgICAgICAgICAgICAgICAgICAgPSAgMTgsCisKIAlQT0RfZWZmZWN0X3NldHVwICAgICAgICAgICAgICAgICAgID0gIDE5LAogCVBPRF9iYW5kXzFfZnJlcXVlbmN5ICAgICAgICAgICAgICAgPSAgMjAsICAvKiBmaXJtd2FyZTogMi4wICovCi0JUE9EX3ByZXNlbmNlICAgICAgICAgICAgICAgICAgICAgICA9ICAyMSwgIC8qIGRldmljZTogTElORTZfQklUU19QT0RYVEFMTCAqLwotCVBPRF90cmVibGVfX2Jhc3MgICAgICAgICAgICAgICAgICA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AgICAgICAgICA9ICAzOCwKKwlQT0RfcmV2ZXJiX3RvbmUgICAgICAgICAgICAgICAgICAgID0gIDM5LAorCVBPRF9yZXZlcmJfcHJlX2RlbGF5ICAgICAgICAgICAgICAgPSAgNDAsCisJUE9EX3JldmVyYl9wcmVfcG9zdCAgICAgICAgICAgICAgICA9ICA0MSwKKwlQT0RfYmFuZF8yX2ZyZXF1ZW5jeSAgICAgICAgICAgICAgID0gIDQyLAorCisJLyogZGV2aWNlOiBMSU5FNl9CSVRTX0JBU1NQT0RYVEFMTCAqLworCVBPRF9iYW5kXzNfZnJlcXVlbmN5X19iYXNzICAgICAgICAgPSAgNDIsICAvKiBmaXJtd2FyZTogMi4wICovCisKIAlQT0Rfd2FoX2VuYWJsZSAgICAgICAgICAgICAgICAgICAgID0gIDQzLAotCVBPRF9tb2R1bGF0aW9uX2xvX2N1dCAgICAgICAgICAgICAgPSAgNDQsICAvKiBkZXZpY2U6IExJTkU2X0JJVFNfQkFTU1BPRFhUQUxMICovCi0JUE9EX2RlbGF5X3JldmVyYl9sb19jdXQgICAgICAgICAgICA9ICA0NSwgIC8qIGRldmljZTogTElORTZfQklUU19CQVNTUE9EWFRBTEwgKi8KLQlQT0Rfdm9sdW1lX3BlZGFsX21pbmltdW0gICAgICAgICAgID0gIDQ2LCAgLyogZGV2aWNlOiBMSU5FNl9CSVRTX1BPRFhUQUxMICovICAgICAvKiBmaXJtd2FyZTogMi4wICovCi0JUE9EX2VxX3ByZV9wb3N0ICAgICAgICAgICAgICAgICAgICA9ICA0NiwgIC8qIGRldmljZTogTElORTZfQklUU19CQVNTUE9EWFRBTEwgKi8gLyogZmlybXdhcmU6IDIuMCAqLworCisJLyogZGV2aWNlOiBMSU5FNl9CSVRTX0JBU1NQT0RYVEFMTCAqLworCVBPRF9tb2R1bGF0aW9uX2xvX2N1dCAgICAgICAgICAgICAgPSAgNDQsCisJUE9EX2RlbGF5X3JldmVyYl9sb19jdXQgICAgICAgICAgICA9ICA0NSwKKworCS8qIGRldmljZTogTElORTZfQklUU19QT0RYVEFMTCAqLworCVBPRF92b2x1bWVfcGVkYWxfbWluaW11bSAgICAgICAgICAgPSAgNDYsICAvKiBmaXJtd2FyZTogMi4wICovCisKKwkvKiBkZXZpY2U6IExJTkU2X0JJVFNfQkFTU1BPRFhUQUxMICovCisJUE9EX2VxX3ByZV9wb3N0ICAgICAgICAgICAgICAgICAgICA9ICA0NiwgIC8qIGZpcm13YXJlOiAyLjAgKi8KKwogCVBPRF92b2x1bWVfcHJlX3Bvc3QgICAgICAgICAgICAgICAgPSAgNDcsCi0JUE9EX2RpX21vZGVsICAgICAgICAgICAgICAgICAgICAgICA9ICA0OCwgIC8qIGRldmljZTogTElORTZfQklUU19CQVNTUE9EWFRBTEwgKi8KLQlQT0RfZGlfZGVsYXkgICAgICAgICAgICAgICAgICAgICAgID0gIDQ5LCAgLyogZGV2aWNlOiBMSU5FNl9CSVRTX0JBU1NQT0RYVEFMTCAqLworCisJLyogZGV2aWNlOiBMSU5FNl9CSVRTX0JBU1NQT0RYVEFMTCAqLworCVBPRF9kaV9tb2RlbCAgICAgICAgICAgICAgICAgICAgICAgPSAgNDgsCisJUE9EX2RpX2RlbGF5ICAgICAgICAgICAgICAgICAgICAgICA9ICA0OSwKKwogCVBPRF9tb2RfZW5hYmxlICAgICAgICAgICAgICAgICAgICAgPSAgNTAsCiAJUE9EX21vZF9wYXJhbV8xX25vdGVfdmFsdWUgICAgICAgICA9ICA1MSwKIAlQT0RfbW9kX3BhcmFtXzIgICAgICAgICAgICAgICAgICAgID0gIDUyLAogCVBPRF9tb2RfcGFyYW1fMyAgICAgICAgICAgICAgICAgICAgPSAgNTMsCiAJUE9EX21vZF9wYXJhbV80ICAgICAgICAgICAgICAgICAgICA9ICA1NCwKLQlQT0RfbW9kX3BhcmFtXzUgICAgICAgICAgICAgICAgICAgID0gIDU1LCAgLyogZGV2aWNlOiBMSU5FNl9CSVRTX0JBU1NQT0RYVEFMTCAqLworCisJLyogZGV2aWNlOiBMSU5FNl9CSVRTX0JBU1NQT0RYVEFMTCAqLworCVBPRF9tb2RfcGFyYW1fNSAgICAgICAgICAgICAgICAgICAgPSAgNTUsCisKIAlQT0RfbW9kX3ZvbHVtZV9taXggICAgICAgICAgICAgICAgID0gIDU2LAogCVBPRF9tb2RfcHJlX3Bvc3QgICAgICAgICAgICAgICAgICAgPSAgNTcsCiAJUE9EX21vZHVsYXRpb25fbW9kZWwgICAgICAgICAgICAgICA9ICA1OCwKLQlQT0RfYmFuZF8zX2ZyZXF1ZW5jeSAgICAgICAgICAgICAgID0gIDYwLCAgLyogZGV2aWNlOiBMSU5FNl9CSVRTX1BPRFhUQUxMICovICAgICAvKiBmaXJtd2FyZTogMi4wICovCi0JUE9EX2JhbmRfNF9mcmVxdWVuY3lfX2Jhc3MgICAgICAgICA9ICA2MCwgIC8qIGRldmljZTogTElORTZfQklUU19CQVNTUE9EWFRBTEwgKi8gLyogZmlybXdhcmU6IDIuMCAqLworCisJLyogZGV2aWNlOiBMSU5FNl9CSVRTX1BPRFhUQUxMICovCisJUE9EX2JhbmRfM19mcmVxdWVuY3kgICAgICAgICAgICAgICA9ICA2MCwgIC8qIGZpcm13YXJlOiAyLjAgKi8KKworCS8qIGRldmljZTogTElORTZfQklUU19CQVNTUE9EWFRBTEwgKi8KKwlQT0RfYmFuZF80X2ZyZXF1ZW5jeV9fYmFzcyAgICAgICAgID0gIDYwLCAgLyogZmlybXdhcmU6IDIuMCAqLworCiAJUE9EX21vZF9wYXJhbV8xX2RvdWJsZV9wcmVjaXNpb24gICA9ICA2MSwKIAlQT0RfZGVsYXlfcGFyYW1fMV9kb3VibGVfcHJlY2lzaW9uID0gIDYyLAogCVBPRF9lcV9lbmFibGUgICAgICAgICAgICAgICAgICAgICAgPSAgNjMsICAvKiBmaXJtd2FyZTogMi4wICovCiAJUE9EX3RhcCAgICAgICAgICAgICAgICAgICAgICAgICAgICA9ICA2NCwKIAlQT0Rfdm9sdW1lX3R3ZWFrX3BlZGFsX2Fzc2lnbiAgICAgID0gIDY1LAotCVBPRF9iYW5kXzVfZnJlcXVlbmN5ICAgICAgICAgICAgICAgPSAgNjgsICAvKiBkZXZpY2U6IExJTkU2X0JJVFNfQkFTU1BPRFhUQUxMICovIC8qIGZpcm13YXJlOiAyLjAgKi8KKworCS8qIGRldmljZTogTElORTZfQklUU19CQVNTUE9EWFRBTEwgKi8KKwlQT0RfYmFuZF81X2ZyZXF1ZW5jeSAgICAgICAgICAgICAgID0gIDY4LCAgLyogZmlybXdhcmU6IDIuMCAqLworCiAJUE9EX3R1bmVyICAgICAgICAgICAgICAgICAgICAgICAgICA9ICA2OSwKIAlQT0RfbWljX3NlbGVjdGlvbiAgICAgICAgICAgICAgICAgID0gIDcwLAogCVBPRF9jYWJpbmV0X21vZGVsICAgICAgICAgICAgICAgICAgPSAgNzEsCiAJUE9EX3N0b21wX21vZGVsICAgICAgICAgICAgICAgICAgICA9ICA3NSwKIAlQT0Rfcm9vbWxldmVsICAgICAgICAgICAgICAgICAgICAgID0gIDc2LAotCVBPRF9iYW5kXzRfZnJlcXVlbmN5ICAgICAgICAgICAgICAgPSAgNzcsICAvKiBkZXZpY2U6IExJTkU2X0JJVFNfUE9EWFRBTEwgKi8gICAgIC8qIGZpcm13YXJlOiAyLjAgKi8KLQlQT0RfYmFuZF82X2ZyZXF1ZW5jeSAgICAgICAgICAgICAgID0gIDc3LCAgLyogZGV2aWNlOiBMSU5FNl9CSVRTX0JBU1NQT0RYVEFMTCAqLyAvKiBmaXJtd2FyZTogMi4wICovCisKKwkvKiBkZXZpY2U6IExJTkU2X0JJVFNfUE9EWFRBTEwgKi8KKwlQT0RfYmFuZF80X2ZyZXF1ZW5jeSAgICAgICAgICAgICAgID0gIDc3LCAgLyogZmlybXdhcmU6IDIuMCAqLworCisJLyogZGV2aWNlOiBMSU5FNl9CSVRTX0JBU1NQT0RYVEFMTCAqLworCVBPRF9iYW5kXzZfZnJlcXVlbmN5ICAgICAgICAgICAgICAgPSAgNzcsICAvKiBmaXJtd2FyZTogMi4wICovCisKIAlQT0Rfc3RvbXBfcGFyYW1fMV9ub3RlX3ZhbHVlICAgICAgID0gIDc4LAogCVBPRF9zdG9tcF9wYXJhbV8yICAgICAgICAgICAgICAgICAgPSAgNzksCiAJUE9EX3N0b21wX3BhcmFtXzMgICAgICAgICAgICAgICAgICA9ICA4MCwKIAlQT0Rfc3RvbXBfcGFyYW1fNCAgICAgICAgICAgICAgICAgID0gIDgxLAogCVBPRF9zdG9tcF9wYXJhbV81ICAgICAgICAgICAgICAgICAgPSAgODIsCiAJUE9EX3N0b21wX3BhcmFtXzYgICAgICAgICAgICAgICAgICA9ICA4MywKLQlQT0RfYW1wX3N3aXRjaF9zZWxlY3QgICAgICAgICAgICAgID0gIDg0LCAgLyogZGV2aWNlOiBMSU5FNl9CSVRTX0xJVkUgKi8KKworCS8qIGRldmljZTogTElORTZfQklUU19MSVZFICovCisJUE9EX2FtcF9zd2l0Y2hfc2VsZWN0ICAgICAgICAgICAgICA9ICA4NCwKKwogCVBPRF9kZWxheV9wYXJhbV80ICAgICAgICAgICAgICAgICAgPSAgODUsCiAJUE9EX2RlbGF5X3BhcmFtXzUgICAgICAgICAgICAgICAgICA9ICA4NiwKIAlQT0RfZGVsYXlfcHJlX3Bvc3QgICAgICAgICAgICAgICAgID0gIDg3LAotCVBPRF9kZWxheV9tb2RlbCAgICAgICAgICAgICAgICAgICAgPSAgODgsICAvKiBkZXZpY2U6IExJTkU2X0JJVFNfUE9EWFRBTEwgKi8KLQlQT0RfZGVsYXlfdmVyYl9tb2RlbCAgICAgICAgICAgICAgID0gIDg4LCAgLyogZGV2aWNlOiBMSU5FNl9CSVRTX0JBU1NQT0RYVEFMTCAqLworCisJLyogZGV2aWNlOiBMSU5FNl9CSVRTX1BPRFhUQUxMICovCisJUE9EX2RlbGF5X21vZGVsICAgICAgICAgICAgICAgICAgICA9ICA4OCwKKworCS8qIGRldmljZTogTElORTZfQklUU19CQVNTUE9EWFRBTEwgKi8KKwlQT0RfZGVsYXlfdmVyYl9tb2RlbCAgICAgICAgICAgICAgID0gIDg4LAorCiAJUE9EX3RlbXBvX21zYiAgICAgICAgICAgICAgICAgICAgICA9ICA4OSwKIAlQT0RfdGVtcG9fbHNiICAgICAgICAgICAgICAgICAgICAgID0gIDkwLAogCVBPRF93YWhfbW9kZWwgICAgICAgICAgICAgICAgICAgICAgPSAgOTEsICAvKiBmaXJtd2FyZTogMy4wICovCiAJUE9EX2J5cGFzc192b2x1bWUgICAgICAgICAgICAgICAgICA9IDEwNSwgIC8qIGZpcm13YXJlOiAyLjE0ICovCi0JUE9EX2Z4X2xvb3Bfb25fb2ZmICAgICAgICAgICAgICAgICA9IDEwNywgIC8qIGRldmljZTogTElORTZfQklUU19QUk8gKi8KKworCS8qIGRldmljZTogTElORTZfQklUU19QUk8gKi8KKwlQT0RfZnhfbG9vcF9vbl9vZmYgICAgICAgICAgICAgICAgID0gMTA3LAorCiAJUE9EX3R3ZWFrX3BhcmFtX3NlbGVjdCAgICAgICAgICAgICA9IDEwOCwKIAlQT0RfYW1wMV9lbmdhZ2UgICAgICAgICAgICAgICAgICAgID0gMTExLAogCVBPRF9iYW5kXzFfZ2FpbiAgICAgICAgICAgICAgICAgICAgPSAxMTQsICAvKiBmaXJtd2FyZTogMi4wICovCi0JUE9EX2JhbmRfMl9nYWluX19iYXNzICAgICAgICAgICAgICA9IDExNSwgIC8qIGRldmljZTogTElORTZfQklUU19CQVNTUE9EWFRBTEwgKi8gLyogZmlybXdhcmU6IDIuMCAqLwotCVBPRF9iYW5kXzJfZ2FpbiAgICAgICAgICAgICAgICAgICAgPSAxMTYsICAvKiBkZXZpY2U6IExJTkU2X0JJVFNfUE9EWFRBTEwgKi8gICAgIC8qIGZpcm13YXJlOiAyLjAgKi8KLQlQT0RfYmFuZF8zX2dhaW5fX2Jhc3MgICAgICAgICAgICAgID0gMTE2LCAgLyogZGV2aWNlOiBMSU5FNl9CSVRTX0JBU1NQT0RYVEFMTCAqLyAvKiBmaXJtd2FyZTogMi4wICovCi0JUE9EX2JhbmRfM19nYWluICAgICAgICAgICAgICAgICAgICA9IDExNywgIC8qIGRldmljZTogTElORTZfQklUU19QT0RYVEFMTCAqLyAgICAgLyogZmlybXdhcmU6IDIuMCAqLwotCVBPRF9iYW5kXzRfZ2Fpbl9fYmFzcyAgICAgICAgICAgICAgPSAxMTcsICAvKiBkZXZpY2U6IExJTkU2X0JJVFNfQkFTU1BPRFhUQUxMICovIC8qIGZpcm13YXJlOiAyLjAgKi8KLQlQT0RfYmFuZF81X2dhaW5fX2Jhc3MgICAgICAgICAgICAgID0gMTE4LCAgLyogZGV2aWNlOiBMSU5FNl9CSVRTX0JBU1NQT0RYVEFMTCAqLyAvKiBmaXJtd2FyZTogMi4wICovCi0JUE9EX2JhbmRfNF9nYWluICAgICAgICAgICAgICAgICAgICA9IDExOSwgIC8qIGRldmljZTogTElORTZfQklUU19QT0RYVEFMTCAqLyAgICAgLyogZmlybXdhcmU6IDIuMCAqLwotCVBPRF9iYW5kXzZfZ2Fpbl9fYmFzcyAgICAgICAgICAgICAgPSAxMTkgICAvKiBkZXZpY2U6IExJTkU2X0JJVFNfQkFTU1BPRFhUQUxMICovIC8qIGZpcm13YXJlOiAyLjAgKi8KKworCS8qIGRldmljZTogTElORTZfQklUU19CQVNTUE9EWFRBTEwgKi8KKwlQT0RfYmFuZF8yX2dhaW5fX2Jhc3MgICAgICAgICAgICAgID0gMTE1LCAgLyogZmlybXdhcmU6IDIuMCAqLworCisJLyogZGV2aWNlOiBMSU5FNl9CSVRTX1BPRFhUQUxMICovCisJUE9EX2JhbmRfMl9nYWluICAgICAgICAgICAgICAgICAgICA9IDExNiwgIC8qIGZpcm13YXJlOiAyLjAgKi8KKworCS8qIGRldmljZTogTElORTZfQklUU19CQVNTUE9EWFRBTEwgKi8KKwlQT0RfYmFuZF8zX2dhaW5fX2Jhc3MgICAgICAgICAgICAgID0gMTE2LCAgLyogZmlybXdhcmU6IDIuMCAqLworCisJLyogZGV2aWNlOiBMSU5FNl9CSVRTX1BPRFhUQUxMICovCisJUE9EX2JhbmRfM19nYWluICAgICAgICAgICAgICAgICAgICA9IDExNywgIC8qIGZpcm13YXJlOiAyLjAgKi8KKworCS8qIGRldmljZTogTElORTZfQklUU19CQVNTUE9EWFRBTEwgKi8KKwlQT0RfYmFuZF80X2dhaW5fX2Jhc3MgICAgICAgICAgICAgID0gMTE3LCAgLyogZmlybXdhcmU6IDIuMCAqLworCVBPRF9iYW5kXzVfZ2Fpbl9fYmFzcyAgICAgICAgICAgICAgPSAxMTgsICAvKiBmaXJtd2FyZTogMi4wICovCisKKwkvKiBkZXZpY2U6IExJTkU2X0JJVFNfUE9EWFRBTEwgKi8KKwlQT0RfYmFuZF80X2dhaW4gICAgICAgICAgICAgICAgICAgID0gMTE5LCAgLyogZmlybXdhcmU6IDIuMCAqLworCisJLyogZGV2aWNlOiBMSU5FNl9CSVRTX0JBU1NQT0RYVEFMTCAqLworCVBPRF9iYW5kXzZfZ2Fpbl9fYmFzcyAgICAgICAgICAgICAgPSAxMTkgICAvKiBmaXJtd2FyZTogMi4wICovCiB9OwogCiAvKioKQEAgLTEzOSw3ICsyMTgsOCBAQAogCVZBUklBWF9waWNrdXAyX3Bvc2l0aW9uICAgICAgICAgICAgPSAgMjMsICAvKiB0eXBlOiAyNCBiaXQgZmxvYXQgKi8KIAlWQVJJQVhfcGlja3VwMl9hbmdsZSAgICAgICAgICAgICAgID0gIDI2LCAgLyogdHlwZTogMjQgYml0IGZsb2F0ICovCiAJVkFSSUFYX3BpY2t1cDJfbGV2ZWwgICAgICAgICAgICAgICA9ICAyOSwgIC8qIHR5cGU6IDI0IGJpdCBmbG9hdCAqLwotCVZBUklBWF9waWNrdXBfcGhhc2UgICAgICAgICAgICAgICAgPSAgMzIsICAvKiAwOiBpbiBwaGFzZSwgMTogb3V0IG9mIHBoYXNlICovCisJVkFSSUFYX3BpY2t1cF9waGFzZSAgICAgICAgICAgICAgICA9ICAzMiwgIC8qI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ysrIGIvZHJpdmVycy9zdGFnaW5nL290dXMvODAyMTFjb3JlL2NhZ2cuYwpAQCAtMjQ4NSw3ICsyNDg1LDcgQEAKICAgICAgICAgQkFXLT5pbnNlcnQoZGV2LCBidWZfaW5mby0+YnVmLCB0aWRfdHgtPmJhcl9zc24gPj4gNCwgYWdnQ29udHJvbC0+dGlkX2JhdywgYnVmX2luZm8tPmJhd19yZXRyYW5zbWl0LCAmaGVhZGVyX3IpOwogICAgIH0qLwogCi0gICAgaWYgKChlcnIgPSB6ZkhwU2VuZChkZXYsCisgICAgZXJyID0gemZIcFNlbmQoZGV2LAogICAgICAgICAgICAgICAgICAgICBidWZfaW5mby0+YmF3X2hlYWRlci0+aGVhZGVyLAogICAgICAgICAgICAgICAgICAgICBidWZfaW5mby0+YmF3X2hlYWRlci0+aGVhZGVyTGVuLAogICAgICAgICAgICAgICAgICAgICBidWZfaW5mby0+YmF3X2hlYWRlci0+c25hcCwKQEAgLTI0OTYsNyArMjQ5Niw4IEBACiAgICAgICAgICAgICAgICAgICAgIGJ1Zl9pbmZvLT5iYXdfaGVhZGVyLT5yZW1vdmVMZW4sCiAgICAgICAgICAgICAgICAgICAgIFpNX0VYVEVSTkFMX0FMTE9DX0JVRiwKICAgICAgICAgICAgICAgICAgICAgKHU4X3QpdGlkX3R4LT5hYywKLSAgICAgICAgICAgICAgICAgICAgYnVmX2luZm8tPmJhd19oZWFkZXItPmtleUlkeCkpICE9IFpNX1NVQ0NFU1MpCisgICAgICAgICAgICAgICAgICAgIGJ1Zl9pbmZvLT5iYXdfaGVhZGVyLT5rZXlJZHgpOworICAgIGlmIChlcnIgIT0gWk1fU1VDQ0VTUykKICAgICB7CiAgICAgICAgIGdvdG8gemxFcnJvcjsKICAgICB9CkBAIC0yNzk3LDkgKzI3OTgsMTAgQEAKICAgICAgICAgICAgIEJBVy0+aW5zZXJ0KGRldiwgYnVmLCB0aWRfdHgtPmJhcl9zc24gPj4gNCwgYWdnQ29udHJvbC0+dGlkX2Jh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pb24oZGV2KTsKLSAgICAgICAgICAgIGlmICgoaT16ZkFwRmluZFN0YShkZXYsICh1MTZfdCopcnNwKSkgIT0gMHhmZmZmKQorICAgICAgICAgICAgaSA9IHpmQXBGaW5kU3RhKGRldiwgKHUxNl90Kilyc3ApOworICAgICAgICAgICAgaWYgKGkgIT0gMHhmZmZmKQogICAgICAgICAgICAgewogICAgICAgICAgICAgICAgIHpmUmF0ZUN0cmxUeEZhaWxFdmVudChkZXYsICZ3ZC0+YXAuc3RhVGFibGVbaV0ucmNDZWxsLCAwLCh1MzJfdCl6ZlBoeUN0cmxUb1JhdGUocmV0cnlSYXRlKSk7CiAgICAgICAgICAgICB9CkBAIC0zODcsNyArMzg5LDggQEAKICAgICAgICAgaWYgKHdkLT53bGFuTW9kZSA9PSBaTV9NT0RFX0FQKQogICAgICAgICB7CiAgICAgICAgICAgICB6bXdfZW50ZXJfY3JpdGljYWxfc2VjdGlvbihkZXYpOwotICAgICAgICAgICAgaWYgKChpPXpmQXBGaW5kU3RhKGRldiwgKHUxNl90Kilyc3ApKSAhPSAweGZmZmYpCisgICAgICAgICAgICBpID0gemZBcEZpbmRTdGEoZGV2LCAodTE2X3QqKXJzcCk7CisgICAgICAgICAgICBpZiAoaSAhPSAweGZmZmYpCiAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgemZSYXRlQ3RybFR4U3VjY2Vzc0V2ZW50KGRldiwgJndkLT5hcC5zdGFUYWJsZVtpXS5yY0NlbGwsIHpmUGh5Q3RybFRvUmF0ZShyZXRyeVJhdGUpKTsKICAgICAgICAgICAgIH0KZGlmZiAtLWdpdCBhL2RyaXZlcnMvc3RhZ2luZy9vdHVzLzgwMjExY29yZS9jaW5pdC5jIGIvZHJpdmVycy9zdGFnaW5nL290dXMvODAyMTFjb3JlL2Npbml0LmMKaW5kZXggNWY4NTNjZS4uMTE4MjMzMSAxMDA2NDQKLS0tIGEvZHJpdmVycy9zdGFnaW5nL290dXMvODAyMTFjb3JlL2Npbml0Lm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gwKTsKICAgICB9CkBAIC0xMDcsMTAgKzEwOCwxMiBAQAogICAgIHdoaWxlICgob2Zmc2V0KzIpPGJ1ZkxlbikgICAgICAgICAgICAgICAgICAgLy8gaW5jbHVkaW5nIGVsZW1lbnQgSUQgYW5kIGxlbmd0aCAoMmJ5dGVzKQogICAgIHsKICAgICAgICAgLyogU2VhcmNoIHRhcmdldCBlbGVtZW50ICovCi0gICAgICAgIGlmICgoaWQgPSB6bXdfcnhfYnVmX3JlYWRiKGRldiwgYnVmLCBvZmZzZXQpKSA9PSBlaWQpCisgICAgICAgIGlkID0gem13X3J4X2J1Zl9yZWFkYihkZXYsIGJ1Ziwgb2Zmc2V0KTsKKyAgICAgICAgaWYgKGlkID09IGVpZCkKICAgICAgICAgewogICAgICAgICAgICAgLyogQmluZ28gKi8KLSAgICAgICAgICAgIGlmICgoZWxlbiA9IHptd19yeF9idWZfcmVhZGIoZGV2LCBidWYsIG9mZnNldCsxKSk+KGJ1ZkxlbiAtIG9mZnNldCkpCisgICAgICAgICAgICBlbGVuID0gem13X3J4X2J1Zl9yZWFkYihkZXYsIGJ1Ziwgb2Zmc2V0KzEpOworICAgICAgICAgICAgaWYgKGVsZW4gPiBidWZMZW4gLSBvZmZzZXQpCiAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgLyogRWxlbWVudCBsZW5ndGggZXJyb3IgKi8KICAgICAgICAgICAgICAgICByZXR1cm4gMHhmZmZmOwpAQCAtMTUxLDcgKzE1NCw4IEBACiAgICAgICAgICNpZiAxCiAgICAgICAgIGVsZW4gPSB6bXdfcnhfYnVmX3JlYWRiKGRldiwgYnVmLCBvZmZzZXQrMSk7CiAgICAgICAgICNlbHNlCi0gICAgICAgIGlmICgoZWxlbiA9IHptd19yeF9idWZfcmVhZGIoZGV2LCBidWYsIG9mZnNldCsxKSkgPT0gMCkKKyAgICAgICAgZWxlbiA9IHptd19yeF9idWZfcmVhZGIoZGV2LCBidWYsIG9mZnNldCsxKTsKKyAgICAgICAg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sxKTsKKyAgICAgICAgICAgIGlmIChlbGVuID4gYnVmTGVuIC0gb2Zmc2V0KQogICAgICAgICAgICAgewogICAgICAgICAgICAgICAgIC8qIEVsZW1lbnQgbGVuZ3RoIGVycm9yICovCiAgICAgICAgICAgICAgICAgcmV0dXJuIDB4ZmZmZjsKQEAgLTIyOSw3ICsyMzYsOCBAQAogICAgICAgICAgICAgewogICAgICAgICAgICAgICAgIGlmICggc3VidHlwZSAhPSAweGZmICkKICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICggKHRtcCA9IHptd19yeF9idWZfcmVhZGIoZGV2LCBidWYsIG9mZnNldCs2KSkgPT0gc3VidHlwZSAgKQorICAgICAgICAgICAgICAgICAgICB0bXAgPSB6bXdfcnhfYnVmX3JlYWRiKGRldiwgYnVmLCBvZmZzZXQrNik7CisgICAgICAgICAgICAgICAgICAgIGlmICh0bXAgPT0gc3VidHlwZSkKICAgICAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9mZnNldDsKICAgICAgICAgICAgICAgICAgICAgfQpAQCAtMjQxLDcgKzI0OSw4IEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgICAgLyogQWR2YW5jZSB0byBuZXh0IGVsZW1lbnQgKi8KLSAgICAgICAgaWYgKChlbGVuID0gem13X3J4X2J1Zl9yZWFkYihkZXYsIGJ1Ziwgb2Zmc2V0KzEpKSA9PSAwKQorICAgICAgICBlbGVuID0gem13X3J4X2J1Zl9yZWFkYihkZXYsIGJ1Ziwgb2Zmc2V0KzEpOworICAgICAgICBpZiAoZWxlbiA9PSAwKQogICAgICAgICB7CiAgICAgICAgICAgICByZXR1cm4gMHhmZmZmOwogICAgICAgICB9CkBAIC0zNDgsNyArMzU3LDggQEAKIAogICAgIC8qIEdldCBvZmZzZXQgb2YgZmlyc3QgZWxlbWVudCAqLwogICAgIHN1YlR5cGUgPSAoem13X3J4X2J1Zl9yZWFkYih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kID0gem13X3J4X2J1Zl9yZWFkYihkZXYsIGJ1Ziwgb2Zmc2V0KTsKKyAgICAgICAgaWYgKGlkID09IFpNX1dMQU5fRUlEX1ZFTkRPUl9QUklWQVRFKQogICAgICAgICB7CiAgICAgICAgICAgICAvKiBCaW5nbyAqLwotICAgICAgICAgICAgaWYgKChlbGVuID0gem13X3J4X2J1Zl9yZWFkYihkZXYsIGJ1Ziwgb2Zmc2V0KzEpKT4oYnVmTGVuIC0gb2Zmc2V0KSkKKyAgICAgICAgICAgIGVsZW4gPSB6bXdfcnhfYnVmX3JlYWRiKGRldiwgYnVmLCBvZmZzZXQrMSk7CisgICAgICAgICAgICBpZiAoZWxlbiA+IGJ1ZkxlbiAtIG9mZnNldCkKICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAvKiBFbGVtZW50IGxlbmd0aCBlcnJvciAqLwogICAgICAgICAgICAgICAgIHJldHVybiAweGZmZmY7CkBAIC00NDcsNyArNDYzLDggQEAKICAgICAgICAgI2lmIDEKICAgICAgICAgZWxlbiA9IHptd19yeF9idWZfcmVhZGIoZGV2LCBidWYsIG9mZnNldCsxKTsKICAgICAgICAgI2Vsc2UKLSAgICAgICAgaWYgKChlbGVuID0gem13X3J4X2J1Zl9yZWFkYihkZXYsIGJ1Ziwgb2Zmc2V0KzEpKSA9PSAwKQorICAgICAgICBlbGVuID0gem13X3J4X2J1Zl9yZWFkYihkZXYsIGJ1Ziwgb2Zmc2V0KzEpOworICAgICAgICBpZiAoZWxlbiA9PSAwKQogICAgICAgICB7CiAgICAgICAgICAgICByZXR1cm4gMHhmZmZmOwogICAgICAgICB9CkBAIC04NjgsNyArODg1LDggQEAKIAogICAgIHptX21zZzJfbW0oWk1fTFZfMiwgIlNlbmQgbW0gZnJhbWUsIHR5cGU9IiwgZnJhbWVUeXBlKTsKICAgICAvKiBUQkQgOiBNYXhpbXVtIHNpemUgb2YgbWFuYWdlbWVudCBmcmFtZSAqLwotICAgIGlmICgoYnVmID0gemZ3QnVmQWxsb2NhdGUoZGV2LCAxMDI0KSkgPT0gTlVMTCkKKyAgICBidWYgPSB6ZndCdWZBbGxvY2F0ZShkZXYsIDEwMjQpOworICAgIGlmIChidWYgPT0gTlVMTCkKICAgICB7CiAgICAgICAgIHptX21zZzBfbW0oWk1fTFZfMCwgIkFsbG9jIG1tIGJ1ZiBGYWlsISIpOwogICAgICAgICByZXR1cm47CkBAIC0xMjU3LDcgKzEyNzUsOCBAQAogICAgICAgICAgICAgewogICAgICAgICAgICAgICB2YXAgPSAodTE2X3QpIHAzOwogCi0gICAgICAgICAgICAgIGlmICgoYWlkID0gemZBcEZpbmRTdGEoZGV2LCBkc3QpKSAhPSAweGZmZmYpCisgICAgICAgICAgICAgIGFpZCA9IHpmQXBGaW5kU3RhKGRldiwgZHN0KTsKKyAgICAgICAgICAgICAgaWYgKGFpZCAhPSAweGZmZmYpCiAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgIHptd19lbnRlcl9jcml0aWNhbF9zZWN0aW9uKGRldik7CiAgICAgICAgICAgICAgICAgICAvKiBDbGVhciBTVEEgdGFibGUgKi8KQEAgLTEzMDMsOCArMTMyMiw5IEBACiAgICAgLy96bV9tc2cyX21tKFpNX0xWXzIsICJidWYtPmRhdGE9IiwgYnVmLT5kYXRhKTsKIAogICAgICNpZiAwCi0gICAgaWYgKChlcnIgPSB6ZkhwU2VuZChkZXYsIE5VTEwsIDAsIE5VTEwsIDAsIE5VTEwsIDAsIGJ1ZiwgMCwKLSAgICAgICAgICAgIFpNX0lOVEVSTkFMX0FMTE9DX0JVRiwgMCwgMHhmZikpICE9IFpNX1NVQ0NFU1MpCisgICAgZXJyID0gemZIcFNlbmQoZGV2LCBOVUxMLCAwLCBOVUxMLCAwLCBOVUxMLCAwLCBidWYsIDAsCisJCSAgIFpNX0lOVEVSTkFMX0FMTE9DX0JVRiwgMCwgMHhmZik7CisgICAgaWYgKGVyciAhPSBaTV9TVUNDRVNTKQogICAgIHsKICAgICAgICAgZ290byB6bEVycm9yOwogICAgIH0KQEAgLTEzNjYsNyArMTM4Niw4IEBACiAgICAgICAgIGlmICgocmFbMF0gJiAweDEpICE9IDEpCiAgICAgICAgIHsKICAgICAgICAgICAgIC8qIEFQIDogRmluZCB2aXJ0dWFsIEFQICovCi0gICAgICAgICAgICBpZiAoKGluZGV4ID0gemZBcEZpbmRTdGEoZGV2LCB0YSkpICE9IDB4ZmZmZikKKyAgICAgICAgICAgIGluZGV4ID0gemZBcEZpbmRTdGEoZGV2LCB0YSk7CisgICAgICAgICAgICBpZiAoaW5kZXggIT0gMHhmZmZmKQogICAgICAgICAgICAgewogICAgICAgICAgICAgICAgIHZhcCA9IHdkLT5hcC5zdGFUYWJsZVtpbmRleF0udmFwOwogICAgICAgICAgICAgfQpAQCAtMTUzNCw3ICsxNTU1LDggQEAKICAgICB9CiAKICAgICAvKiBjaGVjayBTU0lEICovCi0gICAgaWYgKChvZmZzZXQgPSB6ZkZpbmRFbGVtZW50KGRldiwgYnVmLCBaTV9XTEFOX0VJRF9TU0lEKSkgPT0gMHhmZmZmKQorICAgIG9mZnNldCA9IHpmRmluZEVsZW1lbnQoZGV2LCBidWYsIFpNX1dMQU5fRUlEX1NTSUQpOworICAgIGlmIChvZmZzZXQgPT0gMHhmZmZmKQogICAgIHsKICAgICAgICAgem1fbXNnMF9tbShaTV9MVl8zLCAicHJvYmUgcmVxIFNTSUQgbm90IGZvdW5kIik7CiAgICAgICAgIHJldHVybjsKQEAgLTE1NjEsOCArMTU4Myw4IEBACiAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgZm9yIChqPTA7IGo8bGVuOyBqKyspCiAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpZiAoKGNoID0gem13X3J4X2J1Zl9yZWFkYihkZXYsIGJ1Ziwgb2Zmc2V0KzIraikpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIT0gd2QtPmFwLnNzaWRbaV1bal0pCisgICAgICAgICAgICAgICAgICAgIGNoID0gem13X3J4X2J1Zl9yZWFkYihkZXYsIGJ1Ziwgb2Zmc2V0KzIraik7CisgICAgICAgICAgICAgICAgICAgIGlmIChjaCAhPSB3ZC0+YXAuc3NpZFtpXVtqXSkKICAgICAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgIH0KQEAgLTE4MTQsNyArMTgzNiw4IEBACiAgICAgLyogR2V0IG9mZnNldCBvZiBmaXJzdCBlbGVtZW50ICovCiAgICAgc3ViVHlwZSA9ICh6bXdfcnhfYnVmX3JlYWRiKGRldiwgYnVmLCAwKSA+PiA0KTsKIAotICAgIGlmICgob2Zmc2V0ID0gemdFbGVtZW50T2Zmc2V0VGFibGVbc3ViVHlwZV0pID09IDB4ZmYpCisgICAgb2Zmc2V0ID0gemdFbGVtZW50T2Zmc2V0VGFibGVbc3ViVHlwZV07CisgICAgaWYgKG9mZnNldCA9PSAweGZmKQogICAgIHsKICAgICAgICAgem1fYXNzZXJ0KDApOwogICAgIH0KQEAgLTE4MjgsMTAgKzE4NTEsMTIgQEAKICAgICB3aGlsZSAoKG9mZnNldCsyKTxidWZMZW4pICAgICAgICAgICAgICAgICAgIC8vIGluY2x1ZGluZyBlbGVtZW50IElEIGFuZCBsZW5ndGggKDJieXRlcykKICAgICB7CiAgICAgICAgIC8qIFNlYXJjaCB0YXJnZXQgZWxlbWVudCAqLwotICAgICAgICBpZiAoKGlkID0gem13X3J4X2J1Zl9yZWFkYihkZXYsIGJ1Ziwgb2Zmc2V0KSkgPT0gWk1fV0xBTl9FSURfV0lGSV9JRSkKKyAgICAgICAgaWQgPSB6bXdfcnhfYnVmX3JlYWRiKGRldiwgYnVmLCBvZmZzZXQpOworICAgICAgICBpZiAoaWQgPT0gWk1fV0xBTl9FSURfV0lGSV9JRSkKICAgICAgICAgewogICAgICAgICAgICAgLyogQmluZ28gKi8KLSAgICAgICAgICAgIGlmICgoZWxlbiA9IHptd19yeF9idWZfcmVhZGIoZGV2LCBidWYsIG9mZnNldCsxKSk+KGJ1ZkxlbiAtIG9mZnNldCkpCisgICAgICAgICAgICBlbGVuID0gem13X3J4X2J1Zl9yZWFkYihkZXYsIGJ1Ziwgb2Zmc2V0KzEpOworICAgICAgICAgICAgaWYgKGVsZW4gPiBidWZMZW4gLSBvZmZzZXQpCiAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgLyogRWxlbWVudCBsZW5ndGggZXJyb3IgKi8KICAgICAgICAgICAgICAgICByZXR1cm4gMHhmZmZmOwpAQCAtMTg1MCw3ICsxODc1LDggQEAKICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICBpZiAoIHN1YnR5cGUgIT0gMHhmZiApCiAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpZiAoICh0bXAgPSB6bXdfcnhfYnVmX3JlYWRiKGRldiwgYnVmLCBvZmZzZXQrNikpID09IHN1YnR5cGUgICkKKyAgICAgICAgICAgICAgICAgICAgdG1wID0gem13X3J4X2J1Zl9yZWFkYihkZXYsIGJ1Ziwgb2Zmc2V0KzYpOworICAgICAgICAgICAgICAgICAgICBpZiAodG1wID09IHN1YnR5cGUgICkKICAgICAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9mZnNldDsKICAgICAgICAgICAgICAgICAgICAgfQpAQCAtMTg2Myw3ICsxODg5LDggQEAKICAgICAgICAgfQogCiAgICAgICAgIC8qIEFkdmFuY2UgdG8gbmV4dCBlbGVtZW50ICovCi0gICAgICAgIGlmICgoZWxlbiA9IHptd19yeF9idWZfcmVhZGIoZGV2LCBidWYsIG9mZnNldCsxKSkgPT0gMCkKKyAgICAgICAgZWxlbiA9IHptd19yeF9idWZfcmVhZGIoZGV2LCBidWYsIG9mZnNldCsxKTsKKyAgICAgICAgaWYgKGVsZW4gPT0gMCkKICAgICAgICAgewogICAgICAgICAgICAgcmV0dXJuIDB4ZmZmZjsKICAgICAgICA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ZnNldCkKICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAvKiBFbGVtZW50IGxlbmd0aCBlcnJvciAqLwogICAgICAgICAgICAgICAgIHJldHVybiAweGZmZmY7CkBAIC0xOTMwLDcgKzE5NjAsOCBAQAogICAgICAgICBlbHNlIGlmICgoaWQgPSB6bXdfcnhfYnVmX3JlYWRiKGRldiwgYnVmLCBvZmZzZXQpKSA9PSAweDdGKQogICAgICAgICB7CiAgICAgICAgICAgICAvKiBCaW5nbyAqLwotICAgICAgICAgICAgaWYgKChlbGVuID0gem13X3J4X2J1Zl9yZWFkYihkZXYsIGJ1Ziwgb2Zmc2V0KzEpKT4oYnVmTGVuIC0gb2Zmc2V0KSkKKyAgICAgICAgICAgIGVsZW4gPSB6bXdfcnhfYnVmX3JlYWRiKGRldiwgYnVmLCBvZmZzZXQrMSk7CisgICAgICAgICAgICBpZiAoZWxlbiA+IGJ1ZkxlbiAtIG9mZnNldCkKICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAvKiBFbGVtZW50IGxlbmd0aCBlcnJvciAqLwogICAgICAgICAgICAgICAgIHJldHVybiAweGZmZmY7CkBAIC0xOTQxLDcgKzE5NzIsOCBAQAogICAgICAgICAgICAgICAgIHJldHVybiAweGZmZmY7CiAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgIGlmICgodG1wID0gem13X3J4X2J1Zl9yZWFkYihkZXYsIGJ1Ziwgb2Zmc2V0KzIpKSA9PSAweDAxKQorICAgICAgICAgICAgdG1wID0gem13X3J4X2J1Zl9yZWFkYihkZXYsIGJ1Ziwgb2Zmc2V0KzIpOworICAgICAgICAgICAgaWYgKHRtcCA9PSAweDAxKQogCiAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgcmV0dXJuIG9mZnNldDsKQEAgLTE5NDksNyArMTk4MSw4IEBACiAgICAgICAgIH0KIAogICAgICAgICAvKiBBZHZhbmNlIHRvIG5leHQgZWxlbWVudCAqLwotICAgICAgICBpZiAoKGVsZW4gPSB6bXdfcnhfYnVmX3JlYWRiKGRldiwgYnVmLCBvZmZzZXQrMSkpID09IDApCisgICAgICAgIGVsZW4gPSB6bXdfcnhfYnVmX3JlYWRiKGRldiwgYnVmLCBvZmZzZXQrMSk7CisgICAgICAgIGlmIChlbGVuID09IDApCiAgICAgICAgIHsKICAgICAgICAgICAgIHJldHVybiAweGZmZmY7CiAgICAgICAgIH0KQEAgLTE5NzAsNyArMjAwMyw4IEBACiAgICAgLyogR2V0IG9mZnNldCBvZiBmaXJzdCBlbGVtZW50ICovCiAgICAgc3ViVHlwZSA9ICh6bXdfcnhfYnVmX3JlYWRiKGRldiwgYnVmLCAwKSA+PiA0KTsKIAotICAgIGlmICgob2Zmc2V0ID0gemdFbGVtZW50T2Zmc2V0VGFibGVbc3ViVHlwZV0pID09IDB4ZmYpCisgICAgb2Zmc2V0ID0gemdFbGVtZW50T2Zmc2V0VGFibGVbc3ViVHlwZV07CisgICAgaWYgKG9mZnNldCA9PSAweGZmKQogICAgIHsKICAgICAgICAgem1fYXNzZXJ0KDApOwogICAgIH0KQEAgLTE5ODQsMTAgKzIwMTgsMTIgQEAKICAgICB3aGlsZSAoKG9mZnNldCsyKTxidWZMZW4pICAgICAgICAgICAgICAgICAgIC8vIGluY2x1ZGluZyBlbGVtZW50IElEIGFuZCBsZW5ndGggKDJieXRlcykKICAgICB7CiAgICAgICAgIC8qIFNlYXJjaCB0YXJnZXQgZWxlbWVudCAqLwotICAgICAgICBpZiAoKGlkID0gem13X3J4X2J1Zl9yZWFkYihkZXYsIGJ1Ziwgb2Zmc2V0KSkgPT0gWk1fV0xBTl9FSURfV0lGSV9JRSkKKyAgICAgICAgaWQgPSB6bXdfcnhfYnVmX3JlYWRiKGRldiwgYnVmLCBvZmZzZXQpOworICAgICAgICBpZiAoaWQgPT0gWk1fV0xBTl9FSURfV0lGSV9JRSkKICAgICAgICAgewogICAgICAgICAgICAgLyogQmluZ28gKi8KLSAgICAgICAgICAgIGlmICgoZWxlbiA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rMikgPCBidWZMZW4pICAgICAgICAgICAgICAgICAgIC8vIGluY2x1ZGluZyBlbGVtZW50IElEIGFuZCBsZW5ndGggKDJieXRlcykKICAgICB7CiAgICAgICAgIC8qIFNlYXJjaCB0YXJnZXQgZWxlbWVudCAqLwotICAgICAgICBpZiAoKGlkID0gem13X3J4X2J1Zl9yZWFkYihkZXYsIGJ1Ziwgb2Zmc2V0KSkgPT0gWk1fV0xBTl9FSURfV0lGSV9JRSkKKyAgICAgICAgaWQgPSB6bXdfcnhfYnVmX3JlYWRiKGRldiwgYnVmLCBvZmZzZXQpOworICAgICAgICBpZiAoaWQgPT0gWk1fV0xBTl9FSURfV0lGSV9JRSkKICAgICAgICAgewogICAgICAgICAgICAgLyogQmluZ28gKi8KLSAgICAgICAgICAgIGlmICgoZWxlbiA9IHptd19yeF9idWZfcmVhZGIoZGV2LCBidWYsIG9mZnNldCsxKSkgPiAoYnVmTGVuIC0gb2Zmc2V0KSkKKyAgICAgICAgICAgIGVsZW4gPSB6bXdfcnhfYnVmX3JlYWRiKGRldiwgYnVmLCBvZmZzZXQrMSk7CisgICAgICAgICAgICBpZiAoZWxlbiA+IChidWZMZW4gLSBvZmZzZXQpKQogICAgICAgICAgICAgewogICAgICAgICAgICAgICAgIC8qIEVsZW1lbnQgbGVuZ3RoIGVycm9yICovCiAgICAgICAgICAgICAgICAgcmV0dXJuIDB4ZmZmZjsKQEAgLTIwNjYsNyArMjEwNiw4IEBACiAgICAgICAgIH0KIAogICAgICAgICAvKiBBZHZhbmNlIHRvIG5leHQgZWxlbWVudCAqLwotICAgICAgICBpZiAoKGVsZW4gPSB6bXdfcnhfYnVmX3JlYWRiKGRldiwgYnVmLCBvZmZzZXQrMSkpID09IDApCisgICAgICAgIGVsZW4gPSB6bXdfcnhfYnVmX3JlYWRiKGRldiwgYnVmLCBvZmZzZXQrMSk7CisgICAgICAgIGlmIChlbGVuID09IDApCiAgICAgICAgIHsKICAgICAgICAgICAgIHJldHVybiAweGZmZmY7Ci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ICAgLyogRWxlbWVudCBsZW5ndGggZXJyb3IgKi8KICAgICAgICAgICAgICAgICByZXR1cm4gMHhmZmZmOwpAQCAtMjExNyw3ICsyMTYxLDggQEAKICAgICAgICAgICAgICAgICByZXR1cm4gMHhmZmZmOwogICAgICAgICAgICAgfQogCi0gICAgICAgICAgICBpZiAoKHRtcCA9IHptd19yeF9idWZfcmVhZGIoZGV2LCBidWYsIG9mZnNldCsyKSkgPT0gMHgwMSkKKyAgICAgICAgICAgIHRtcCA9IHptd19yeF9idWZfcmVhZGIoZGV2LCBidWYsIG9mZnNldCsyKTsKKyAgICAgICAgICAgIGlmICh0bXAgPT0gMHgwMSkKIAogICAgICAgICAgICAgewogICAgICAgICAgICAgICAgIHJldHVybiBvZmZzZXQ7CkBAIC0yMTI1LDcgKzIxNzAsOCBAQAogICAgICAgICB9CiAKICAgICAgICAgLyogQWR2YW5jZSB0byBuZXh0IGVsZW1lbnQgKi8KLSAgICAgICAgaWYgKChlbGVuID0gem13X3J4X2J1Zl9yZWFkYihkZXYsIGJ1Ziwgb2Zmc2V0KzEpKSA9PSAwKQorICAgICAgICBlbGVuID0gem13X3J4X2J1Zl9yZWFkYihkZXYsIGJ1Ziwgb2Zmc2V0KzEpOworICAgICAgICBpZiAoZWxlbiA9PSAwKQogICAgICAgICB7CiAgICAgICAgICAgICByZXR1cm4gMHhmZmZmOwogICAgICAgICB9CmRpZmYgLS1naXQgYS9kcml2ZXJzL3N0YWdpbmcvb3R1cy84MDIxMWNvcmUvY21tYXAuYyBiL2RyaXZlcnMvc3RhZ2luZy9vdHVzLzgwMjExY29yZS9jbW1hcC5jCmluZGV4IDdmMDlmZGUuLjhlYzM4MzAgMTAwNjQ0Ci0tLSBhL2RyaXZlcnMvc3RhZ2luZy9vdHVzLzgwMjExY29yZS9jbW1hcC5jCisrKyBiL2RyaXZlcnMvc3RhZ2luZy9vdHVzLzgwMjExY29yZS9jbW1hcC5jCkBAIC0xNDEsNyArMTQxLDggQEAKIAogICAgIHpt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lmIChpZCAhPSAweGZmZmYpCiAgICAgICAgIHsKICAgICAgICAgICAgIGlmICh3ZC0+YXAuc3RhVGFibGVbaWRdLnBzTW9kZSA9PSAxKQogICAgICAgICAgICAgewpAQCAtNjAzLDcgKzYxMyw4IEBACiAgICAgLy9wc01vZGU9MDsKICNlbmRpZgogCi0gICAgaWYgKChpZCA9IHpmQXBGaW5kU3RhKGRldiwgYWRkcikpICE9IDB4ZmZmZikKKyAgICBpZCA9IHpmQXBGaW5kU3RhKGRldiwgYWRkcik7CisgICAgaWYgKGlkICE9IDB4ZmZmZikKICAgICB7CiAgICAgICAgIGlmIChwc01vZGUgIT0gMCkKICAgICAgICAgewpAQCAtNjQ4LDcgKzY1OSw4IEBACiAKICAgICAgICAgd2hpbGUgKDEpCiAgICAgICAgIHsKLSAgICAgICAgICAgIGlmICgocHNCdWYgPSB6ZlF1ZXVlR2V0V2l0aE1hYyhkZXYsIHdkLT5hcC51YXBzZFEsICh1OF90KilhZGRyLCAmbWIpKSAhPSBOVUxMKQorICAgICAgICAgICAgcHNCdWYgPSB6ZlF1ZXVlR2V0V2l0aE1hYyhkZXYsIHdkLT5hcC51YXBzZFEsICh1OF90KilhZGRyLCAmbWIpOworICAgICAgICAgICAgaWYgKHBzQnVmICE9IE5VTEwpCiAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgemZUeFNlbmRFdGgoZGV2LCBwc0J1ZiwgMCwgWk1fRVhURVJOQUxfQUxMT0NfQlVGLCAwKTsKICAgICAgICAgICAgIH0KQEAgLTczMCw3ICs3NDIsOCBAQAogCiAgICAgem13X2VudGVyX2NyaXRpY2FsX3NlY3Rpb24oZGV2KTsKIAotICAgIGlmICgoaW5kZXggPSB6ZkFwRmluZFN0YShkZXYsIGFkZHIpKSAhPSAweGZmZmYpCisgICAgaW5kZXggPSB6ZkFwRmluZFN0YShkZXYsIGFkZHIpOworICAgIGlmIChpbmRleCAhPSAweGZmZmYpCiAgICAgewogICAgICAgICB6bV9tc2cwX21tKFpNX0xWXzIsICJmb3VuZCIpOwogICAgICAgICAvKiBVcGRhdGUgU1RBIHN0YXRlICovCkBAIC05NjMsNyArOTc2LDggQEAKICAgICB6bV9tc2cwX21tKFpNX0xWXzMsICJSeCBiZWFjb24iKTsKIAogICAgIC8qIHVwZGF0ZSBOb24tRVJQIGZsYWcod2QtPmFwLm5vbkVycE9ic3MpICovCi0gICAgaWYgKChvZmZzZXQgPSB6ZkZpbmRFbGVtZW50KGRldiwgYnVmLCBaTV9XTEFOX0VJRF9FUlApKSA9PSAweGZmZmYpCisgICAgb2Zmc2V0ID0gemZGaW5kRWxlbWVudChkZXYsIGJ1ZiwgWk1fV0xBTl9FSURfRVJQKTsKKyAgICBpZiAob2Zmc2V0ID09IDB4ZmZmZikKICAgICB7CiAgICAgICAgIC8qIDExYiBPQlNTICovCiAgICAgICAgIHdkLT5hcC5wcm90ZWN0ZWRPYnNzKys7CkBAIC0xMDQ2LDcgKzEwNjAsOCBAQAogICAgICAgICAgICAgaWYgKHNlcSA9PSAxKQogICAgICAgICAgICAgewogICAgICAgICAgICAgICAgIC8qIEFQIDogdXBkYXRlIFNUQSB0byBhdXRoICovCi0gICAgICAgICAgICAgICAgaWYgKChyZXQgPSB6ZkFwQWRkU3RhKGRldiwgc3JjLCBaTV9TVEFURV9BVVRILCBhcElkLCAwLCAwLCAwKSkgIT0gMHhmZmZmKQorICAgICAgICAgICAgICAgIHJldCA9IHpmQXBBZGRTdGEoZGV2LCBzcmMsIFpNX1NUQVRFX0FVVEgsIGFwSWQsIDAsIDAsIDApOworICAgICAgICAgICAgICAgIGlmIChyZXQgIT0gMHhmZmZmKQogICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICAgLyogQVAgOiBjYWxsIHpmd0F1dGhOb3RpZnkoKSBmb3IgaG9zdCB0byBqdWRnZSAqLwogICAgICAgICAgICAgICAgICAgICAvL3pmd0F1dGhOb3RpZnkoZGV2LCBzcmMpOwpAQCAtMTE3NywxMiArMTE5MiwxNCBAQAogCiAgICAgem13X2dldF93bGFuX2RldihkZXYpOwogICAgIC8qIEFQIDogY2hlY2sgU1NJRCAqLwotICAgIGlmICgob2Zmc2V0ID0gemZGaW5kRWxlbWVudChkZXYsIGJ1ZiwgWk1fV0xBTl9FSURfU1NJRCkpICE9IDB4ZmZmZikKKyAgICBvZmZzZXQgPSB6ZkZpbmRFbGVtZW50KGRldiwgYnVmLCBaTV9XTEFOX0VJRF9TU0lEKTsKKyAgICBpZiAob2Zmc2V0ICE9IDB4ZmZmZikKICAgICB7CiAgICAgICAgIGsgPSAwOwogICAgICAgICBmb3IgKGogPSAwOyBqIDwgd2QtPmFwLnZhcE51bWJlcjsgaisrKQogICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoKHRtcCA9IHptd19idWZfcmVhZGIoZGV2LCBidWYsIG9mZnNldCsxKSkKKyAgICAgICAgICAgIHRtcCA9IHptd19idWZfcmVhZGIoZGV2LCBidWYsIG9mZnNldCsxKTsKKyAgICAgICAgICAgIGlmICh0bXAKICAgICAgICAgICAgICAgICAgICAgICAgICE9IHdkLT5hcC5zc2lkTGVuW2pdKQogICAgICAgICAgICAgewogICAgICAgICAgICAgICAgIGsrKzsKQEAgLTExOTgsNyArMTIxNSw4IEBACiAgICAgICAgIHsKICAgICAgICAgICAgIGZvciAoaT0wOyBpPHdkLT5hcC5zc2lkTGVuW2pdOyBpKyspCiAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKCh0bXAgPSB6bXdfYnVmX3JlYWRiKGRldiwgYnVmLCBvZmZzZXQrMitpKSkKKyAgICAgICAgICAgICAgICB0bXAgPSB6bXdfYnVmX3JlYWRiKGRldiwgYnVmLCBvZmZzZXQrMitpKTsKKyAgICAgICAgICAgICAgICBpZiAodG1wCiAgICAgICAgICAgICAgICAgICAgICAgICAhPSB3ZC0+YXAuc3NpZFtqXVtpXSkKICAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwpAQCA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ICAgewogICAgICAgICAvKiBhdGhlcm9zIHByZSBuICovCiAgICAgICAgIHptX2RlYnVnX21zZzAoImF0aGVyb3MgcHJlIG4gSFRJTkZPIik7CkBAIC0yODE1LDcgKzI4NDYsOCBAQAogICAgIH0KIAogICAgIC8qIGNoZWNrIFNTSUQgKi8KLSAgICBpZiAoKG9mZnNldCA9IHpmRmluZEVsZW1lbnQoZGV2LCBidWYsIFpNX1dMQU5fRUlEX1NTSUQpKSA9PSAweGZmZmYpCisgICAgb2Zmc2V0ID0gemZGaW5kRWxlbWVudChkZXYsIGJ1ZiwgWk1fV0xBTl9FSURfU1NJRCk7CisgICAgaWYgKG9mZnNldCA9PSAweGZmZmYpCiAgICAgewogICAgICAgICB6bV9tc2cwX21tKFpNX0xWXzMsICJwcm9iZSByZXEgU1NJRCBub3QgZm91bmQiKTsKICAgICAgICAgcmV0dXJuOwpAQCAtMzc3NCw3ICszODA2LDggQEAKICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgLyogU2tpcCBpZiBBUCBpbiBibG9ja2luZyBsaXN0ICovCi0gICAgICAgICAgICBpZiAoKHJldCA9IHpmU3RhSXNBcEluQmxvY2tpbmdMaXN0KGRldiwgcEJzc0luZm8tPmJzc2lkKSkgPT0gVFJVRSkKKyAgICAgICAgICAgIHJldCA9IHpmU3RhSXNBcEluQmxvY2tpbmdMaXN0KGRldiwgcEJzc0luZm8tPmJzc2lkKTsKKyAgICAgICAgICAgIGlmIChyZXQgPT0gVFJVRSkKICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICB6bV9tc2cwX21tKFpNX0xWXzAsICJDYW5kaWRhdGUgQVAgaW4gYmxvY2tpbmcgTGlzdCwgc2tpcCBpZiB0aGVyZSdzIHN0aWxsYSBjaG9pY2UhIik7CiAgICAgICAgICAgICAgICAgcE5vd0Jzc0luZm8gPSBwQnNzSW5mbzsKQEAgLTUwMDcsNyArNTA0MCw4IEBACiAKICAgICB6bXdfZ2V0X3dsYW5fZGV2KGRldik7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isgICAgICAgICAgICAgICAgaWQgPSB6ZkFwRmluZFN0YShkZXYsIGFkZHIpOworICAgICAgICAgICAgICAgIGlmIChpZCAhPSAweGZmZmYpCiAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICBpZiAod2QtPmFwLnN0YVRhYmxlW2lkXS5lbmNyeU1vZGUgPT0gWk1fVEtJUCkKICAgICAgICAgICAgICAgICAgICAgewpAQCAtMTMyLDcgKzEzMyw4IEBACiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICAgICAgLyogV0RTIHBvcnQgY2hlY2tpbmcgKi8KLSAgICAgICAgICAgIGlmICgod2RzUG9ydCA9IHZhcCAtIDB4MjApID49IFpNX01BWF9XRFNfU1VQUE9SVCkKKyAgICAgICAgICAgIHdkc1BvcnQgPSB2YXAgLSAweDIwOworICAgICAgICAgICAgaWYgKHdkc1BvcnQgPj0gWk1fTUFYX1dEU19TVVBQT1JUKQogICAgICAgICAgICAgewogICAgICAgICAgICAgICAgIHdkc1BvcnQgPSAwOwogICAgICAgICAgICAgfQpAQCAtNzQxLDggKzc0Myw5IEBACiAKICAgICB6ZndCdWZSZW1vdmVIZWFkKGRldiwgYnVmLCAyNCk7CiAKLSAgICBpZiAoKGVyciA9IHpmSHBTZW5kKGRldiwgaGVhZGVyLCBobGVuLCBOVUxMLCAwLCBOVUxMLCAwLCBidWYsIDAsCi0gICAgICAgICAgICBaTV9FWFRFUk5BTF9BTExPQ19CVUYsIDAsIDApKSAhPSBaTV9TVUNDRVNTKQorICAgIGVyciA9IHpmSHBTZW5kKGRldiwgaGVhZGVyLCBobGVuLCBOVUxMLCAwLCBOVUxMLCAwLCBidWYsIDAsCisJCSAgIFpNX0VYVEVSTkFMX0FMTE9DX0JVRiwgMCwgMCk7CisgICAgaWYgKGVyciAhPSBaTV9TVUNDRVNTKQogICAgIHsKICAgICAgICAgZ290byB6bEVycm9yOwogICAgIH0KQEAgLTc5OSw3ICs4MDIsOCBAQAogICAg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QEAKICAgICAgICAgLy96bV9tc2cwX3J4KFpNX0xWXzAsICJSeCBkYXRhIik7CiAgICAgICAgIGlmICh3ZC0+d2xhbk1vZGUgPT0gWk1fTU9ERV9BUCkKICAgICAgICAgewotICAgICAgICAgICAgaWYgKChyZXQgPSB6ZkFwVXBkYXRlUHNCaXQoZGV2LCBidWYsICZ2YXAsICZ1YXBzZFRyaWcpKSAhPSBaTV9TVUNDRVNTKQorICAgICAgICAgICAgcmV0ID0gemZBcFVwZGF0ZVBzQml0KGRldiwgYnVmLCAmdmFwLCAmdWFwc2RUcmlnKTsKKyAgICAgICAgICAgIGlmIChyZXQgIT0gWk1fU1VDQ0VTUykKICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICB6ZndCdWZGcmVlKGRldiwgYnVmLCAwKTsKICAgICAgICAgICAgICAgICByZXR1cm47CkBAIC0yMTE1LDcgKzIxMjQsOCBAQAogICAgICAgICAgICAgICAgICAgICBmb3IgKGlpPTA7IGlpPHBrdE51bTsgaWkrKykKICAgICAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICAgICAgLy9pZiAoKHBzQnVmID0gemZRdWV1ZUdldChkZXYsIHdkLT5hcC51YXBzZFEpKSAhPSBOVUxMKQotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChwc0J1ZiA9IHpmUXVldWVHZXRXaXRoTWFjKGRldiwgd2QtPmFwLnVhcHNkUSwgc3JjLCAmbWIpKSAhPSBOVUxMKQorICAgICAgICAgICAgICAgICAgICAgICAgcHNCdWYgPSB6ZlF1ZXVlR2V0V2l0aE1hYyhkZXYsIHdkLT5hcC51YXBzZFEsIHNyYywgJm1iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwc0J1ZiAhPSBOVUxMKQogICAgICAgICAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoaWkrMSkgPT0gcGt0TnVtKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKQEAgLTIyMzIsNyArMjI0Miw4IEBACiAgICAgICAgIH0KICAgICAgICAgZWxzZQogICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoIChidWYgPSB6ZkRlZnJhZ21lbnQoZGV2LCBidWYsICZiSXNEZWZyYWcsIGFkZEluZm8pKSA9PSBOVUxMICkKKyAgICAgICAgICAgIGJ1ZiA9IHpmRGVmcmFnbWVudChkZXYsIGJ1ZiwgJmJJc0RlZnJhZywgYWRkSW5mbyk7CisgICAgICAgICAgICBpZiAoYnVmID09IE5VTEwpCiAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgLyogSW4gdGhpcyBjYXNlLCB0aGUgYnVmZmVyIGhhcyBiZWVuIGZyZWVkIGluIHpmRGVmcmFnbWVudCAqLwogICAgICAgICAgICAgICAgIHJldHVybjsKQEAgLTI4MzYsNyArMjg0Nyw4IEBACiAgICAgICAgICAgICAgICAgemZ3QnVmUmVtb3ZlSGVhZChkZXYsIGJ1ZiwgMTgrb2Zmc2V0KTsKICNlbmRpZiAgLy8gWk1fRU5BQkxFX05BVElWRV9XSUZJCiAgICAgICAgICAgICAgICAgI2lmIDEKLSAgICAgICAgICAgICAgICBpZiAoKHJldCA9IHpmSW50cmFic3NGb3J3YXJkKGRldiwgYnVmLCB2YXApKSA9PSAxKQorICAgICAgICAgICAgICAgIHJldCA9IHpmSW50cmFic3NGb3J3YXJkKGRldiwgYnVmLCB2YXApOworICAgICAgICAgICAgICAgIGlmIChyZXQgPT0gMSkKICAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgIC8qIEZyZWUgUnggYnVmZmVyIGlmIGludHJhLUJTUyB1bmljYXN0IGZyYW1lICovCiAgICAgICAgICAgICAgICAgICAgIHptX21zZzBfcngoWk1fTFZfMiwgIkZyZWUgaW50cmEtQlNTIHVuaWNhc3QgZnJhbWUiKTsKQEAgLTMwMzcsNyArMzA0OSw4IEBACiAgICAgfQogICAgIGVsc2UgaWYgKCB3ZC0+d2xhbk1vZ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AgWk1fSU5URVJOQUxfQUxMT0NfQlVGLCAwLCAweGZmKTsKKyAgICAgICAgICAgICAgICBpZiAoZXJyICE9IFpNX1NVQ0NFU1MpCiAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICB6ZndCdWZGcmVlKGRldiwgYnVmLCAwKTsKICAgICAgICAgICAgICAgICB9CkBAIC0zODMxLDkgKzM4NDYsMTEgQEAKICAgICAgICAgLyogU2VydmljZSBWVHhRWzNdICovCiAgICAgICAgIGZvciAoaT0wOyBpPDQ7IGkrKykKICAgICAgICAgewotICAgICAgICAgICAgaWYgKChmcmVlVHhkID0gemZIcEdldEZyZWVUeGRDb3VudChkZXYpKSA+PSAzKQorICAgICAgICAgICAgZnJlZVR4ZCA9IHpmSHBHZXRGcmVlVHhkQ291bnQoZGV2KTsKKyAgICAgICAgICAgIGlmIChmcmVlVHhkID49IDMpCiAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKChidWYgPSB6ZkdldFZ0eHEoZGV2LCAzKSkgIT0gMCkKKyAgICAgICAgICAgICAgICBidWYgPSB6ZkdldFZ0eHEoZGV2LCAzKTsKKyAgICAgICAgICAgICAgICBpZiAoYnVmICE9IDApCiAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICB0eGVkID0gMTsKICAgICAgICAgICAgICAgICAgICAgLy96bV9kZWJ1Z19tc2cyKCJzZW5kIGJ1ZiA9ICIsIGJ1Zik7CkBAIC0zODUwLDkgKzM4NjcsMTEgQEAKICAgICAgICAgLyogU2VydmljZSBWVHhRWzJdICovCiAgICAgICAgIGZvciAoaT0wOyBpPDM7IGkrKykKICAgICAgICAgewotICAgICAgICAgICAgaWYgKChmcmVlVHhkID0gemZIcEdldEZyZWVUeGRDb3VudChkZXYpKSA+PSAoemZIcEdldE1heFR4ZENvdW50KGRldikqMS80KSkKKyAgICAgICAgICAgIGZyZWVUeGQgPSB6ZkhwR2V0RnJlZVR4ZENvdW50KGRldik7CisgICAgICAgICAgICBpZiAoZnJlZVR4ZCA+PSAoemZIcEdldE1heFR4ZENvdW50KGRldikqMS80KSkKICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoKGJ1ZiA9IHpmR2V0VnR4cShkZXYsIDIpKSAhPSAwKQorICAgICAgICAgICAgICAgIGJ1ZiA9IHpmR2V0VnR4cShkZXYsIDIpOworICAgICAgICAgICAgICAgIGlmIChidWYgIT0gMCkKICAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgIHR4ZWQgPSAxOwogICAgICAgICAgICAgICAgICAgICB6ZlR4U2VuZEV0aChkZXYsIGJ1ZiwgMCwgWk1fRVhURVJOQUxfQUxMT0NfQlVGLCAwKTsKQEAgLTM4NjAsNyArMzg3OSw4IEBACiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGlmICh3ZC0+c3RhLmFjMFByaW9yaXR5SGlnaGVyVGhhbkFjMiA9PSAxKQogICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKChidWYgPSB6ZkdldFZ0eHEoZGV2LCAwKSkgIT0gMCkKKyAgICAgICAgICAgICAgICAgICAgYnVmID0gemZHZXRWdHhxKGRldiwgMCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChidWYgIT0gMCkKICAgICAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICAgICAgdHhlZCA9IDE7CiAgICAgICAgICAgICAgICAgICAgICAgICB6ZlR4U2VuZEV0aChkZXYsIGJ1ZiwgMCwgWk1fRVhURVJOQUxfQUxMT0NfQlVGLCAwKTsKQEAgLTM4NzcsOSArMzg5NywxMSBAQAogICAgICAgICAvKiBTZXJ2aWNlIFZUeFFbMF0gKi8KICAgICAgICAgZm9yIChpPTA7IGk8MjsgaSsrKQogICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoKGZyZWVUeGQgPSB6ZkhwR2V0RnJlZVR4ZENvdW50KGRldikpID49ICh6ZkhwR2V0TWF4VHhkQ291bnQoZGV2KSoyLzQpKQorICAgICAgICAgICAgZnJlZVR4ZCA9IHpmSHBHZXRGcmVlVHhkQ291bnQoZGV2KTsKKyAgICAgICAgICAgIGlmIChmcmVlVHhkID49ICh6ZkhwR2V0TWF4VHhkQ291bnQoZGV2KSoyLzQpKQogICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmICgoYnVmID0gemZHZXRWdHhxKGRldiwgMCkpICE9IDApCisgICAgICAgICAgICAgICAgYnVmID0gemZHZXRWdHhxKGRldiwgMCk7CisgICAgICAgICAgICAgICAgaWYgKGJ1ZiAhPSAwKQogICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICAgdHhlZCA9IDE7CiAgICAgICAgICAgICAgICAgICAgIHpmVHhTZW5kRXRoKGRldiwgYnVmLCAwLCBaTV9FWFRFUk5BTF9BTExPQ19CVUYsIDApOwpAQCAtMzg5NCw5ICszOTE2LDExIEBACiAgICAgICAgIH0KIAogICAgICAgICAvKiBTZXJ2aWNlIFZUeFFbMV0gKi8KLSAgICAgICAgaWYgKChmcmVlVHhkID0gemZIcEdldEZyZWVUeGRDb3VudChkZXYpKSA+PSAoemZIcEdldE1heFR4ZENvdW50KGRldikqMy80KSkKKyAgICAgICAgZnJlZVR4ZCA9IHpmSHBHZXRGcmVlVHhkQ291bnQoZGV2KTsKKyAgICAgICAgaWYgKGZyZWVUeGQgPj0gKHpmSHBHZXRNYXhUeGRDb3VudChkZXYpKjMvNCkpCiAgICAgICAgIHsKLSAgICAgICAgICAgIGlmICgoYnVmID0gemZHZXRWdHhxKGRldiwgMSkpICE9IDApCisgICAgICAgICAgICBidWYgPSB6ZkdldFZ0eHEoZGV2LCAxKTsKKyAgICAgICAgICAgIGlmIChidWYgIT0gMCkKICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICB0eGVkID0gMTsKICAgICAgICAgICAgICAgICB6ZlR4U2VuZEV0aChkZXYsIGJ1ZiwgMCwgWk1fRVhURVJOQUxfQU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wKTsKKyAgICAgICAgaWYgKHJldCAhPSBaTV9TVUNDRVNTKQogICAgICAgICB7CiAgICAgICAgICAgICBEYmdQcmludCgiRGwgemNGd0J1ZkltYWdlIGZhaWxlZCEiKTsKICAgICAgICAgfQogCiAgICAgICAgIHpmd1NsZWVwKGRldiwgMTAwMCk7CiAKLSAgICAgICAgaWYgKChyZXQgPSB6ZkZpcm13YXJlRG93bmxvYWQoZGV2LCAodTMyX3QqKXpjRndJbWFnZSwKLSAgICAgICAgICAgICAgICAodTMyX3QpemNGd0ltYWdlU2l6ZSwgWk1fRklSTVdBUkVfV0xBTl9BRERSKSkgIT0gWk1fU1VDQ0VTUykKKyAgICAgICAgcmV0ID0gemZGaXJtd2FyZURvd25sb2FkKGRldiwgKHUzMl90Kil6Y0Z3SW1hZ2UsCisgICAgICAgICAgICAgICAgKHUzMl90KXpjRndJbWFnZVNpemUsIFpNX0ZJUk1XQVJFX1dMQU5fQUREUik7CisgICAgICAgIGlmIChyZXQgIT0gWk1fU1VDQ0VTUykKICAgICAgICAgewogICAgICAgICAgICAgRGJnUHJpbnQoIkRsIHpjRndCdWZJbWFnZSBmYWlsZWQhIik7CiAgICAgICAgIH0KQEAgLTI0OSwxNSArMjUzLDE3IEBACiAKICAgICAjaWZuZGVmIFpNX09UVVNfTElOVVhfUEhBU0VfMgogICAgIC8qIERvd25sb2FkIGZpcm13YXJlICovCi0gICAgaWYgKChyZXQgPSB6ZkZpcm13YXJlRG93bmxvYWQoZGV2LCAodTMyX3QqKXpjRndJbWFnZSwKLSAgICAgICAgICAgICh1MzJfdCl6Y0Z3SW1hZ2VTaXplLCBaTV9GSVJNV0FSRV9XTEFOX0FERFIpKSAhPSBaTV9TVUNDRVNTKQorICAgIHJldCA9IHpmRmlybXdhcmVEb3dubG9hZChkZXYsICh1MzJfdCopemNGd0ltYWdlLAorICAgICAgICAgICAgKHUzMl90KXpjRndJbWFnZVNpemUsIFpNX0ZJUk1XQVJFX1dMQU5fQUREUik7CisgICAgaW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BWklMIiwgICAgICAgICBOTywgIE5PLCAgTk8sICBOTywgIE5PLCAgNzAwMCB9LAotICAgIHtDVFJZX0JSVU5FSV9EQVJVU1NBTEFNLEFQTDFfV09STEQsIkJOIiwgIkJSVU5FSSBEQVJVU1NBTEFNIiwgWUVTLCBZRVMsIFlFUywgIFlFUywgWUVTLCA3MDAwIH0sCi0gICAge0NUUllfQlVMR0FSSUEsICAgIEVUU0k2X1dPUkxELCAgICJCRyIsICJCVUxHQVJJQSIsICAgICAgIFlFUywgTk8sICBZRVMsIFlFUywgWUVTLCA3MDAwIH0sCi0gICAge0NUUllfQ0FOQURBLCAgICAgIEZDQzZfRkNDQSwgICAgICJDQSIsICJDQU5BREEiLCAgICAgICAgIFlFUywgWUVTLCBZRVMsIFlFUywgWUVTLCA3MDAwIH0sCi0gICAge0NUUllfQ0hJTEUsICAgICAgIEFQTDZfV09STEQsICAgICJDTCIsICJDSElMRSIsICAgICAgICAgIFlFUywgWUVTLCBZRVMsIFlFUywgWUVTLCA3MDAwIH0sCi0gICAge0NUUllfQ0hJTkEsICAgICAgIEFQTDFfV09STEQsICAgICJDTiIsICJDSElOQSIsICAgICAgICAgIFlFUywgWUVTLCBZRVMsIFlFUywgWUVTLCA3MDAwIH0sCi0gICAge0NUUllfQ09MT01CSUEsICAgIEZDQzFfRkNDQSwgICAgICJDTyIsICJDT0xPTUJJQSIsICAgICAgIFlFUywgTk8sICBZRVMsIE5PLCAgWUVTLCA3MDAwIH0sCi0gICAge0NUUllfQ09TVEFfUklDQSwgIEZDQzFfV09STEQsICAgICJDUiIsICJDT1NUQSBSSUNBIiwgICAgIFlFUywgTk8sICBZRVMsIE5PLCAgWUVTLCA3MDAwIH0sCi0gICAge0NUUllfQ1JPQVRJQSwgICAgIEVUU0kzX1dPUkxELCAgICJIUiIsICJDUk9BVElBIiwgICAgICAgIFlFUywgTk8sICBZRVMsIE5PLCAgWUVTLCA3MDAwIH0sCi0gICAge0NUUllfQ1lQUlVTLCAgICAgIEVU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ioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qICAgVGVtcG9yYXJ5IGRpc2NhcmQgY2hhbm5lbCB0aGF0IEJXIDwgMjBNSHogKDUgb3IgMTBNSHopICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAgIE91ciBhcmNoaXRlY3R1cmUgZG9lcyBub3QgaW1wbGVtbnQgaXQgISEhICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLQkJCQkJaWYgKChjID49IGNfbG8pICYmIChjIDw9IGNfaGkpKQotCQkJCQl7Ci0JCQkJCSAgICBpY3YuY2hhbm5lbCA9IGM7Ci0JCQkJCSAgICBpY3YuY2hhbm5lbEZsYWdzID0gY20tPmZsYWdzOwotCQkJCQkgICAgaWN2Lm1heFJlZ1R4UG93ZXIgPSBmYmFuZC0+cG93ZXJEZnM7Ci0JCQkJCSAgICBpZiAoZmJhbmQtPnVzZVBhc3NTY2FuICYgcmQtPnBzY2FuKQotCQkJCQkgICAgCWljdi5jaGFubmVsRmxhZ3MgfD0gWk1fUkVHX0ZMQUdfQ0hBTk5FTF9QQVNTSVZFOwotCQkJCQkgICAgZWxzZQotCQkJCQkgICAgCWljdi5jaGFubmVsRmxhZ3MgJj0gflpNX1JFR19GTEFHX0NIQU5ORUxfUEFTU0lWRTsKLQkJCQkJICAgIGlmIChmYmFuZC0+dXNlRGZzICYgcmQtPmRmc01hc2spCi0JCQkJCSAgICAJaWN2LnByaXZGbGFncyA9IFpNX1JFR19GTEFHX0NIQU5ORUxfREZTOwotCQkJCQkgICAgZWxzZQotCQkJCQkgICAgCWljdi5wcml2RmxhZ3MgPSAwOworCQkJCQkvKiBEaXNhYmxlIGFsbCBERlMgY2hhbm5lbCAqLworCQkJCQlpZiAoKGhwUHJpdi0+ZGlzYWJsZURmc0NoID09IDApIHx8ICghKGZiYW5kLT51c2VEZnMgJiByZC0+ZGZzTWFzaykpKSB7CisJCQkJCQlpZiAoZmJhbmQtPmNoYW5uZWxCVyA8IDIwKSB7CisJCQkJCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCQkJCQkJCS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKwkJCQkJCQkvKiAgIFRlbXBvcmFyeSBkaXNjYXJkIGNoYW5uZWwgdGhhdCBCVyA8IDIwTUh6ICg1IG9yIDEwTUh6KSAgICovCisJCQkJCQkJLyogICBPdXIgYXJjaGl0ZWN0dXJlIGRvZXMgbm90IGltcGxlbW50IGl0ICEhISAgICAgICAgICAgICAgICAqLworCQkJCQkJCS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKwkJCQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisJCQkJCQkJY29udGludWU7CisJCQkJCQl9CisJCQkJCQlpZiAoKGMgPj0gY19sbykgJiYgKGMgPD0gY19oaSkpIHsKKwkJCQkJCQlpY3YuY2hhbm5lbCA9IGM7CisJCQkJCQkJaWN2LmNoYW5uZWxGbGFncyA9IGNtLT5mbGFnczsKKwkJCQkJCQlp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YgKCAoY2ggPj0gMTg0KSYmKGNoIDw9IDE5NikgKQorCQkJCQkJY19oaSA9IDQwMDAgKyBjaCo1OworCQkJCQllbHNlCisJCQkJCQljX2hpID0gNTAwMCArIGNoKjU7CisJCQkJfQogCi0gICAgICAgICAgICAvL3doaWxlIChpbmRleCA8IChjb3VudHJ5SW5mb1sxXSsyKSkKLSAgICAgICAgICAgIC8vewotICAgICAgICAgICAgLy8gIGlmIChjb3VudHJ5SW5mb1tpbmRleF0gPD0gMTQpCi0gICAgICAgICAgICAvLyAgewotICAgICAgICAgICAgLy8gICAgICAgIC8qIGNhbGN1bGF0ZSAyLjRHSHogbG93IGJvdW5kYXJ5IGNoYW5uZWwgZnJlcXVlbmN5ICovCi0gICAgICAgICAgICAvLyAgICAgICAgY2ggPSBjb3VudHJ5SW5mb1tpbmRleF07Ci0gICAgICAgICAgICAvLyAgICAgICAgaWYgKCBjaCA9PSAxNCApCi0gICAgICAgICAgICAvLyAgICAgICAgICAgIGNfbG8gPSBaTV9DSF9HXzE0OwotICAgICAgICAgICAgLy8gICAgICAgIGVsc2UKLSAgICAgICAgICAgIC8vICAgICAgICAgICAgY19sbyA9IFpNX0NIX0dfMSArIChjaCAtIDEpICogNTsKLSAgICAgICAgICAgIC8vICAgICAgICAvKiBjYWxjdWxhdGUgMi40R0h6IGhpZ2ggYm91bmRhcnkgY2hhbm5lbCBmcmVxdWVuY3kgKi8KLSAgICAgICAgICAgIC8vICAgICAgICBjaCA9IGNvdW50cnlJbmZvW2luZGV4XSArIGNvdW50cnlJbmZvW2luZGV4ICsgMV0gLSAxOwotICAgICAgICAgICAgLy8gICAgICAgIGlmICggY2ggPT0gMTQgKQotICAgICAgICAgICAgLy8gICAgICAgICAgICBjX2hpID0gWk1fQ0hfR18xNDsKLSAgICAgICAgICAgIC8vICAgICAgICBlbHNlCi0gICAgICAgICAgICAvLyAgICAgICAgICAgIGNfaGkgPSBaTV9DSF9HXzEgKyAoY2ggLSAxKSAqIDU7Ci0gICAgICAgICAgICAvLyAgfQotICAgICAgICAgICAgLy8gIGVsc2UKLSAgICAgICAgICAgIC8vICB7Ci0gICAgICAgICAgICAvLyAgICAgICAgLyogY2FsY3VsYXRlIDVHSHogbG93IGJvdW5kYXJ5IGNoYW5uZWwgZnJlcXVlbmN5ICovCi0gICAgICAgICAgICAvLyAgICAgICAgY2ggPSBjb3VudHJ5SW5mb1tpbmRleF07Ci0gICAgICAgICAgICAvLyAgICAgICAgaWYgKCAoY2ggPj0gMTg0KSYmKGNoIDw9IDE5NikgKQotICAgICAgICAgICAgLy8gICAgICAgICAgICBjX2xvID0gNDAwMCArIGNoKjU7Ci0gICAgICAgICAgICAvLyAgICAgICAgZWxzZQotICAgICAgICAgICAgLy8gICAgICAgICAgICBjX2xvID0gNTAwMCArIGNoKjU7Ci0gICAgICAgICAgICAvLyAgICAgICAgLyogY2FsY3VsYXRlIDVHSHogaGlnaCBib3VuZGFyeSBjaGFubmVsIGZyZXF1ZW5jeSAqLwotICAgICAgICAgICAgLy8gICAgICAgIGNoID0gY291bnRyeUluZm9baW5kZXhdICsgY291bnRyeUluZm9baW5kZXggKyAxXSAtIDE7Ci0gICAgICAgICAgICAvLyAgICAgICAgaWYgKCAoY2ggPj0gMTg0KSYmKGNoIDw9IDE5NikgKQotICAgICAgICAgICAgLy8gICAgICAgICAgICBjX2hpID0gNDAwMCArIGNoKjU7Ci0gICAgICAgICAgICAvLyAgICAgICAgZWxzZQotICAgICAgICAgICAgLy8gICAgICAgICAgICBjX2hpID0gNTAwMCArIGNoKjU7Ci0gICAgICAgICAgICAvLyAgfQotICAgICAgICAgICAgLy8KLSAgICAgICAgICAgIC8vICB6ZkhwR2V0UmVndWxhdGlvblRhYmxlKGRldiwgUmVnRG9tYWluLCBjX2xvLCBjX2hpKTsKLSAgICAgICAgICAgIC8vCi0gICAgICAgICAgICAvLyAgaW5kZXgrPTM7Ci0gICAgICAgICAgICAvL30KKwkJCXpmSHBHZXRSZWd1bGF0aW9uVGFibGUoZGV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nRyaWVzW2ldLnJlZ0RtbkVudW07CisJCWJyZWFrOworCQl9CisJfQogCi0gICAgcmV0dXJuIHJlZ2lvbkNvZGU7CisJcmV0dXJuIHJlZ2lvbkNvZGU7CiB9CiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCkBAIC0yMDI5LDMyMyArMTk4MCwyOTQgQEAKIC8qICAgICAgQ2hhby1XZW4gWWFuZyAgICAgICAgIFp5REFTIFRlY2hub2xvZ3kgQ29ycG9yYXRpb24gICAgMjAwNy4zICAgICovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXUxNl90IHpmSHBEZWxldGVBbGxvd0NoYW5uZWwoemRldl90KiBkZXYsIHUxNl90IGZyZXEpCit1MTZfdCB6ZkhwRGVsZXRlQWxsb3dDaGFubmVsKHpkZXZfdCAqZGV2LCB1MTZfdCBmcmVxKQogewotICAgIHUxNl90IGksIGJhbmRJbmRleCA9IDA7Ci0gICAgdTE2X3QgZGZzNUdCYW5kW11bMl0gPSB7ezUxNTAsIDUyNDB9LCB7NTI2MCwgNTM1MH0sIHs1NDUwLCA1NzAwfSwgezU3MjUsIDU4MjV9fTsKKwl1MTZfdCBpLCBiYW5kSW5kZXggPSAwOworCXUxNl90IGRmczVHQmFuZFtdWzJdID0geyB7NTE1MCwgNTI0MH0sIHs1MjYwLCA1MzUwfSwgezU0NTAsIDU3MDB9LCB7NTcyNSwgNTgyNX0gfTsKIAotICAgIHptd19nZXRfd2xhbl9kZXYoZGV2KTsKLSAgICAvKiBGaW5kIHdoaWNoIGJhbmQgZG9lcyB0aGlzIGZyZXF1ZW5jeSBiZWxvbmcgKi8KLSAgICBmb3IgKG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HX1NUUlVDICBCYnBDc3I7CQkJCVwKKwkJaW50ICAgX2J1c3lDbnQsIF9zZWNDbnQsIF9yZWdJRDsJCQlcCisJCQkJCQkJCQlcCisJCV9yZWdJRCA9ICgoX2JWaWFNQ1UpID09IFRSVUUgPyBIMk1fQkJQX0FHRU5UIDogQkJQX0NTUl9DRkcpOyBcCisJCWZvciAoX2J1c3lDbnQgPSAwOyBfYnVzeUNudCA8IE1BWF9CVVNZX0NPVU5UOyBfYnVzeUNudCsrKSB7IFwKKwkJCVJUTVBfSU9fUkVBRDMyKF9wQWQsIF9yZWdJRCwgJkJicENzci53b3JkKTsJXAogCQkJaWYgKEJicENzci5maWVsZC5CdXN5ID09IEJVU1kpICAgICAgICAgICAgICAgICAgXAotCQkJCWNvbnRpbnVlOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCQkJCWNvbnRpbnVlOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAJCQlCYnBDc3Iud29yZCA9IDA7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAJCQlCYnBDc3IuZmllbGQuZlJlYWQgPSAxOyAgICAgICAgICAgICAgICAgICAgICAgICBcCi0JCQlCYnBDc3IuZmllbGQuQkJQX1JXX01PREUgPSAxOyAgICAgICAgICAgICAgICAgICAgICAgICBcCisJCQlCYnBDc3IuZmllbGQuQkJQX1JXX01PREUgPSAxOyAgICAgICAgICAgICAgICAgICBcCiAJCQlCYnBDc3IuZmllbGQuQnVzeSA9IDE7ICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0JCQlCYnBDc3IuZmllbGQuUmVnTnVtID0gX2JicElEOyAgICAgICAgICAgICAgICAgICAgICAgXAorCQkJQmJwQ3NyLmZpZWxkLlJlZ051bSA9IF9iYnBJRDsgICAgICAgICAgICAgICAgICAgXAogCQkJUlRNUF9JT19XUklURTMyKF9wQWQsIF9yZWdJRCwgQmJwQ3NyLndvcmQpOyAgICAgXAotCQkJaWYgKChfYlZpYU1DVSkgPT0gVFJVRSkJCQkJCQkJXAotCQkJewkJCQkJCQkJCQkJCQlcCi0JCQkJQXNpY1NlbmRDb21tYW5kVG9NY3UoX3BBZCwgMHg4MCwgMHhmZiwgMHgwLCAweDApOyBcCi0JCQkJUlRNUHVzZWNEZWxheSgxMDAwKTsJXAotCQkJfQkJCQkJCQlcCi0JCQlmb3IgKF9zZWNDbnQ9MDsgX3NlY0NudDxNQVhfQlVTWV9DT1VOVDsgX3NlY0NudCsrKSAgICAgICBcCi0JCQl7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJCQlpZiAoKF9iVmlhTUNVKSA9PSBUUlVFKSB7CQkJXAorCQkJICAgIEFzaWNTZW5kQ29tbWFuZFRvTWN1KF9wQWQsIDB4ODAsIDB4ZmYsIDB4MCwgMHgwKTsgXAorCQkJICAgIFJUTVB1c2VjRGVsYXkoMTAwMCk7CVwKKwkJCX0JCQkJCQlcCisJCQlmb3IgKF9zZWNDbnQgPSAwOyBfc2VjQ250IDwgTUFYX0JVU1lfQ09VTlQ7IF9zZWNDbnQrKykgeyBcCiAJCQkJUlRNUF9JT19SRUFEMzIoX3BBZCwgX3JlZ0lELCAmQmJwQ3NyLndvcmQpOyBcCi0JCQkJaWYgKEJicENzci5maWVsZC5CdXN5ID09IElETEUpICAgICAgICAgICAgICBcCi0JCQkJCWJyZWFrOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0JCQl9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0JCQlpZiAoKEJicENzci5maWVsZC5CdXN5ID09IElETEUpICYmICAgICAgICAgICAgICBcCi0JCQkJKEJicENzci5maWVsZC5SZWdOdW0gPT0gX2JicElEKSkgICAgICAgICAgICAgICAgXAotCQkJeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotCQkJCSooX3BWKSA9ICh1OClCYnBDc3IuZmllbGQuVmFsdWU7ICAgICAgICAgXAotCQkJCWJyZWFrOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotCQkJfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotCQl9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotCQlpZiAoQmJwQ3NyLmZpZWxkLkJ1c3kgPT0gQlVTWSkgICAgICAgICAgICAgICAgICAgICAgXAotCQl7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotCQkJREJHUFJJTlRfRVJSKCgiQkJQKHZpYU1DVT0lZCkgcmVhZCBSJWQgZmFpbFxuIiwgKF9iVmlhTUNVKSwgX2JicElEKSk7ICAgICAgXAorCQkJCWlmIChCYnBDc3IuZmllbGQuQnVzeSA9PSBJRExFKQkJXAorCQkJCQlicmVhazsJCQkJXAorCQkJfQkJCQkJCVwKKwkJCWlmICgoQmJwQ3NyLmZpZWxkLkJ1c3kgPT0gSURMRSkgJiYJCVwKKwkJCQkoQmJwQ3NyLmZpZWxkLlJlZ051bSA9PSBfYmJwSUQpKSB7CVwKKwkJCQkqKF9wVikgPSAodTgpQmJwQ3NyLmZpZWxkLlZhbHVlOwlcCisJCQkJYnJlYWs7CQkJCQlcCisJCQl9CQkJCQkJXAorCQl9CQkJCQkJCVwKKwkJaWYgKEJicENzci5maWVsZC5CdXN5ID09IEJVU1kpIHsJCQlcCisJCQlEQkdQUklOVF9FUlIoKCJCQlAodmlhTUNVPSVkKSByZWFkIFIlZCBmYWlsXG4iLCAoX2JWaWFNQ1UpLCBfYmJwSUQpKTsJXAogCQkJKihfcFYpID0gKF9wQWQpLT5CYnBXcml0ZUxhdGNoW19iYnBJRF07ICAgICAgICAgICAgICAgXAotCQkJaWYgKChfYlZpYU1DVSkgPT0gVFJVRSkJCQkJXAotCQkJewkJCQkJCQkJCV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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJCQkJCQkJCQlcCiAgICAgX3BSZW1vdmVkTExDU05BUCA9IE5VTEw7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAgICAgaWYgKE5kaXNFcXVhbE1lbW9yeShTTkFQXzgwMl8xSCwgX3BEYXRhLCA2KSAgfHwgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIE5kaXNFcXVhbE1lbW9yeShTTkFQX0JSSURHRV9UVU5ORUwsIF9wRGF0YSwgNikpICAgICAgICAgICAgICAgICBcCi0gICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIHU4ICpwUHJvdG8gPSBfcERhdGEgKyA2OyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIGlmICgoTmRpc0VxdWFsTWVtb3J5KElQWCwgcFByb3RvLCAyKSB8fCBOZGlzRXF1YWxNZW1vcnkoQVBQTEVfVEFMSywgcFByb3RvLCAyKSkgJiYgIFwKLSAgICAgICAgICAgIE5kaXNFcXVhbE1lbW9yeShTTkFQXzgwMl8xSCwgX3BEYXRhLCA2KSkgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgIExMQ19MZW5bMF0gPSAodTgpKF9EYXRhU2l6ZSAvIDI1Nik7ICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgIExMQ19MZW5bMV0gPSAodTgpKF9EYXRhU2l6ZSAlIDI1Nik7ICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgIE1BS0VfODAyXzNfSEVBREVSKF9wODAyM2hkciwgX3BEQSwgX3BTQSwgTExDX0xlbik7ICAgICAgICAgIFwKLSAgICAgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgZWxzZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgIE1BS0VfODAyXzNfSEVBREVSKF9wODAyM2hkciwgX3BEQSwgX3BTQSwgcFByb3RvKTsgICAgICAgICAgIFwKLSAgICAgICAgICAgIF9wUmVtb3ZlZExMQ1NOQVAgPSBfcERhdGE7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgIF9EYXRhU2l6ZSAtPSBMRU5HVEhfODAyXzFfSDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgIF9wRGF0YSArPSBMRU5HVEhfODAyXzFfSDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwlOZGlzRXF1YWxNZW1vcnkoU05BUF9CUklER0VfVFVOTkVMLCBfcERhdGEsIDYpKQl7CQlcCisJdTggKnBQcm90byA9IF9wRGF0YSArIDY7CQkJCQlcCisJCQkJCQkJCQlcCisJaWYgKChOZGlzRXF1YWxNZW1vcnkoSVBYLCBwUHJvdG8sIDIpIHx8IE5kaXNFcXVhbE1lbW9yeShBUFBMRV9UQUxLLCBwUHJvdG8sIDIpKSAmJiAgXAorCQlOZGlzRXF1YWxNZW1vcnkoU05BUF84MDJfMUgsIF9wRGF0YSwgNikpCXsJXAorCQlMTENfTGVuWzBdID0gKHU4KShfRGF0YVNpemUgLyAyNTYpOwkJCVwKKwkJTExDX0xlblsxXSA9ICh1OCkoX0RhdGFTaXplICUgMjU2KTsJCQlcCisJCU1BS0VfODAyXzNfSEVBREVSKF9wODAyM2hkciwgX3BEQSwgX3BTQSwgTExDX0xlbik7CVwKKwl9CQkJCQkJCQlcCisJZWxzZQl7CQkJCQkJCVwKKwkJTUFLRV84MDJfM19IRUFERVIoX3A4MDIzaGRyLCBfcERBLCBfcFNBLCBwUHJvdG8pOwlcCisJCV9wUmVtb3ZlZExMQ1NOQVAgPSBfcERhdGE7CQkJCVwKKwkJX0RhdGFTaXplIC09IExFTkdUSF84MDJfMV9IOwkJCQlcCisJCV9wRGF0YSArPSBMRU5HVEhfODAyXzFfSDsJCQkJXAorCX0JCQkJCQkJCVwKICAgICB9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICBlbHNlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgTExDX0xlblswXSA9ICh1OCkoX0RhdGFTaXplIC8gMjU2KTsgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgTExDX0xlblsxXSA9ICh1OCkoX0RhdGFTaXplICUgMjU2KTsgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgTUFLRV84MDJfM19IRUFERVIoX3A4MDIzaGRyLCBfcERBLCBfcFNBLCBMTENfTGVuKTsgICAgICAgICAgICAgIFwKKwllbHNlCXsJ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ydG1wX3NnX2xpc3QgKnNnKTsKK3N0cnVjdCBydF9ydG1wX3NnX2xpc3QgKnJ0X2dldF9zZ19saXN0X2Zyb21fcGFja2V0KHZvaWQgKnBQYWNrZXQsCisJCQkJCQlzdHJ1Y3QgcnRfcnRtcF9zZ19saXN0ICpzZyk7CiAKIHZvaWQgYW5ub3VuY2VfODAyXzNfcGFja2V0KHN0cnVjdCBydF9ydG1wX2FkYXB0ZXIgKnBBZCwgdm9pZCAqcFBhY2tldCk7CiAKQEAgLTM3MTcsMjMgKzM3MDUsMTkgQEAKIHsJCQkJCQkJCQkJCQkJCQkJCQkJCVwKIAl1OCAqX3BSZW1vdmVkTExDU05BUCA9IE5VTEwsICpfcERBLCAqX3BTQTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAJCQkJCQkJCQkJCQkJCQkJCQkJCVwKLQlpZiAoUlhfQkxLX1RFU1RfRkxBRyhfcFJ4QmxrLCBmUlhfTUVTSCkpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotCXsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJaWYgKFJYX0JMS19URVNUX0ZMQUcoX3BSeEJsaywgZlJYX01FU0gpKQl7ICAgICAgICAgICAgXAogCQlfcERBID0gX3BSeEJsay0+cEhlYWRlci0+QWRkcjM7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAJCV9wU0EgPSAodTggKilfcFJ4QmxrLT5wSGVhZGVyICsgc2l6ZW9mKHN0cnVjdCBydF9oZWFkZXJfODAyXzExKTsgICAgICAgICAgICAgICAgXAogCX0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0JZWxzZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLQl7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotCQlpZiAoUlhfQkxLX1RFU1RfRkxBRyhfcFJ4QmxrLCBmUlhfSU5GUkEpKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAlcCi0JCXsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwllbHNlCXtcCisJCWlmIChSWF9CTEtfVEVTVF9GTEFHKF9wUnhCbGssIGZSWF9JTkZSQSkpCXtcCiAJCQlfcERBID0gX3BSeEJsay0+cEhlYWRlci0+QWRkcjE7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKIAkJaWYgKFJYX0JMS19URVNUX0ZMQUcoX3BSeEJsaywgZlJYX0RMUykpCQkJCQkJCQkJXAogCQkJX3BTQSA9IF9wUnhCbGstPnBIZWFkZXItPkFkZHIyOwkJCQkJCQkJCQlcCiAJCWVsc2UJCQkJCQkJCQkJCQkJCQkJCVwKIAkJCV9wU0EgPSBfcFJ4QmxrLT5wSGVhZGVyLT5BZGRyMzsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogCQl9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0JCWVsc2UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLQkJeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCQllbHNlCXsJXAogCQkJX3BEQSA9IF9wUnhCbGstPnBIZWFkZXItPkFkZHIxOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAJCQl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0bDgxODBfcGNpX2lkX3RibFtdIF9fZGV2aW5pdGRhdGEgPSB7Ci0gICAgICAgIHsKLSAgICAgICAgICAgICAgICAudmVuZG9yID0gUENJX1ZFTkRPUl9JRF9SRUFMVEVLLAotICAgICAgICAgICAgICAgIC5kZXZpY2UgPSAweDgxOTksCi0gICAgICAgICAgICAgICAgLnN1YnZlbmRvciA9IFBDSV9BTllfSUQsCi0gICAgICAgICAgICAgICAgLnN1YmRldmljZSA9IFBDSV9BTllfSUQsCi0gICAgICAgICAgICAgICAgLmRyaXZlcl9kYXRhID0gMCwKLSAgICAgICAgfSwKLSAgICAgICAgewotICAgICAgICAgICAgICAgIC52ZW5kb3IgPSAwLAotICAgICAgICAgICAgICAgIC5kZXZpY2UgPSAwLAotICAgICAgICAgICAgICAgIC5zdWJ2ZW5kb3IgPSAwLAotICAgICAgICAgICAgICAgIC5zdWJkZXZpY2UgPSAwLAotICAgICAgICAgICAgICAgIC5kcml2ZXJfZGF0YSA9IDAsCi0gICAgICAgIH0KKwl7CisJCS52ZW5kb3IgPSBQQ0lfVkVORE9SX0lEX1JFQUxURUssCisJCS5kZXZpY2UgPSAweDgxOTksCisJCS5zdWJ2ZW5kb3IgPSBQQ0lfQU5ZX0lELAorCQkuc3ViZGV2aWNlID0gUENJX0FOWV9JRCwKKwkJLmRyaXZlcl9kYXRhID0gMCwKKwl9LAorCXsKKwkJLnZlbmRvciA9IDAsCisJCS5kZXZpY2UgPSAwLAorCQkuc3VidmVuZG9yID0gMCwKKwkJLnN1YmRldmljZSA9IDAsCisJCS5kcml2ZXJfZGF0YSA9IDAsCisJfQogfTsKIAogCi1zdGF0aWMgY2hhciogaWZuYW1lID0gIndsYW4lZCI7CitzdGF0aWMgY2hhciAqaWZuYW1lID0gIndsYW4lZCI7CiBzdGF0aWMgaW50IGh3c2VxbnVtID0gMDsKIHN0YXRpYyBpbnQgaHd3ZXAgPSAwOwogc3RhdGljIGludCBjaGFubmVscyA9IDB4M2ZmZjsKIAotI2Rl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gQEAKICAqICByZXR1cm46ICBOVUxMCiAgKiAgbm90aWNlOgogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0jaWYgMQogdm9pZCBSeFBrdFBlbmRpbmdUaW1lb3V0KHVuc2lnbmVkIGxvbmcgZGF0YSkKIHsKIAlQUlhfVFNfUkVDT1JECXBSeFRzID0gKFBSWF9UU19SRUNPUkQpZGF0YTsKQEAgLTgzLDggKzgyLDYgQEAKIAkJCXJldHVybjsKIAkJfQogCQlpZWVlODAyMTFfaW5kaWNhdGVfcGFja2V0cyhpZWVlLCBzdGF0c19JbmRpY2F0ZUFycmF5LCBpbmRleCk7Ci0JCSBiUGt0SW5CdWYgPSBmYWxzZTsKLQogCX0KIAogCWlmKGJQa3RJbkJ1ZiAmJiAocFJ4VHMtPlJ4VGltZW91dEluZGljYXRlU2VxPT0weGZmZmYpKQpAQCAtOTUsNyArOTIsNiBAQAogCXNwaW5fdW5sb2NrX2lycXJlc3RvcmUoJihpZWVlLT5yZW9yZGVyX3NwaW5sb2NrKSwgZmxhZ3MpOwogCS8vUGxhdGZvcm1SZWxlYXNlU3BpbkxvY2soQWRhcHRlciwgUlRfUlhfU1BJTkxPQ0spOwogfQotI2VuZGlmCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICpmdW5jdGlvbjogIEFkZCBCQSB0aW1lciBmdW5jdGlvbgpAQCAtNTM0LDggKzUzMCw4IEBACiB2b2lkIFJlbW92ZVBlZXJUUyhzdHJ1Y3QgaWVlZTgwMjExX2RldmljZSogaWVlZSwgdTgqIEFkZHIpCiB7CiAJUFRTX0NPTU1PTl9JTkZPCXBUUywgcFRtcF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SkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbF90aW1lcl9zeW5jKCYocExlZC0+QmxpbmtUaW1lcikpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTGVkLT5iTGVkTm9MaW5rQmxpbmtJblByb2dyZXNzID0gRkFMU0U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCBwTGVkLT5iTGVkTGlua0JsaW5rSW5Qcm9ncmVzcyA9PSBUUlVFICkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbF90aW1lcl9zeW5jKCYocExlZC0+QmxpbmtUaW1lcikpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTGVkLT5iTGVkTGlua0JsaW5rSW5Qcm9ncmVzcyA9IEZBTFNFOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTGVkLT5iTGVkQmxpbmtJblByb2dyZXNzID0gVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTGVkLT5DdXJyTGVkU3RhdGUgPSBMRURfVFhSWF9CTElOSzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTGVkLT5CbGlua1RpbWVzID0gMjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiggcExlZC0+YkxlZE9uICkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcExlZC0+QmxpbmtpbmdMZWRTdGF0ZSA9IExFRF9PRkY7IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcExlZC0+QmxpbmtpbmdMZWRTdGF0ZSA9IExFRF9PTjsgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kX3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IpICk7fSkKKwljb25zdCB0eXBlb2YoKCh0eXBlICopMCktPm1lbWJlcikgKCpfX21wdHIgPSAocHRyKSk7ICAgIFwKKwkodHlwZSAqKSgoY2hhciAqKV9fbXB0ciAtIG9mZnNldG9mKHR5cGUsIG1lbWJlcikpOyB9KQogI2VuZGlmCiAKICNkZWZpbmUgS0VZX1RZUEVfTkEJCTB4MAotI2RlZmluZSBLRVlfVFlQRV9XRVA0MCAJCTB4MQorI2RlZmluZSBLRVlfVFlQRV9XRVA0MAkJMHgxCiAjZGVmaW5lIEtFWV9UWVBFX1RLSVAJCTB4MgogI2RlZmluZSBLRVlfVFlQRV9DQ01QCQkweDQKICNkZWZpbmUgS0VZX1RZUEVfV0VQMTA0CQkweDUKQEAgLTcxLDkgKzcxLDkgQEAKIC8qIGFkZGVkIGZvciBydGw4MTl4IHR4IHByb2NlZHVyZSAqLwogI2RlZmluZSBNQVhfUVVFVUVfU0laRQkJMHgxMAogCi0vLwotLy8gODE5MCBxdWV1ZSBtYXBwaW5nCi0vLworLyoKKyAqIDgxOTAgcXVldWUgbWFwcGluZworICovCiAjZGVmaW5lIEJLX1FVRVVFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAKICNkZWZpbmUgQkVfUVVFVUUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMQogI2RlZmluZSBWSV9RVUVVRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyCkBAIC04NywxMyArODcsMTMgQEAKICNkZWZpbmUgTE9XX1FVRVVFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQkVfUVVFVUUKICNkZWZpbmUgTk9STUFMX1FVRVVFICAgICAgICAgICAgICAgICAgICAgICAgICAgTUdOVF9RVUVVRQogCi0vL2FkZGVkIGJ5IGFteSBmb3IgcHMKKy8qIGFkZGVkIGJ5IGFteSBmb3IgcHMgKi8KICNkZWZpbmUgU1dSRl9USU1FT1VUCQkJCTUwCiAKLS8vYWRkZWQgYnkgYW15IGZvciBMRU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BJRUVFODAyMTFfREVCVUcoSUVFRTgwMjExX0RMX0lORk8sIGYsICMjIGEpCkBAIC02MTgsMTggKzYxMSwxNyBAQAogLyogQWRkZWQgYnkgQW5uaWUsIDIwMDUtMTEtMjIuICovCiAjZGVmaW5lIE1BWF9TVFJfTEVOICAgICA2NAogLyogSSB3YW50IHRvIHNlZSBBU0NJSSAzMyB0byAxMjYgb25seS4gT3RoZXJ3aXNlLCBJIHByaW50ICc/Jy4gQW5uaWUsIDIwMDUtMTEtMjIuKi8KLSNkZWZpbmUgUFJJTlRBQkxFKF9jaCkgIChfY2g+JyEnICYmIF9jaDwnficpCisjZGVmaW5lIFBSSU5UQUJMRShfY2gpICAoX2NoID4gJyEnICYmIF9jaCA8ICd+JykKICNkZWZpbmUgSUVFRTgwMjExX1BSSU5UX1NUUihfQ29tcCwgX1RpdGxlU3RyaW5nLCBfUHRyLCBfTGVuKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAJXAotCQkJaWYoKF9Db21wKSAmIGxldmVsKSAgIAkJCQkJCQlcCi0JCQl7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJCQlpZiAoKF9Db21wKSAmIGxldmVsKSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAJCQkJaW50ICAgICAgICAgICAgIF9faTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKIAkJCQl1OCAgYnVmZmVyW01BWF9TVFJfTEVOXTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAJXAotCQkJCWludCBsZW5ndGggPSAoX0xlbjxNQVhfU1RSX0xFTik/IF9MZW4gOiAoTUFYX1NUUl9MRU4tMSkgOyAgCVwKKwkJCQlpbnQgbGVuZ3RoID0gKF9MZW4gPCBNQVhfU1RSX0xFTikgPyBfTGVuIDogKE1BWF9TVFJfTEVOIC0gMSk7ICAJXAogCQkJCW1lbXNldChidWZmZXIsIDAsIE1BWF9TVFJfTEVOKTsgICAgICAgICAgICAgICAgICAgICAgCQlcCi0JCQkJbWVtY3B5KGJ1ZmZlciwgKHU4ICopX1B0ciwgbGVuZ3RoICk7ICAgICAgICAgICAgCQlcCi0JCQkJZm9yKCBfX2k9MDsgX19pPE1BWF9TVFJfTEVOOyBfX2krKyApICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLQkJCQl7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotCQkJCSAgICAgaWYoICFQUklOVEFCTEUoYnVmZmVyW19faV0pICkgICBidWZmZXJbX19pXSA9ICc/JzsgICAgIAlcCisJCQkJbWVtY3B5KGJ1ZmZlciwgKHU4ICopX1B0ciwgbGVuZ3RoKTsgICAgICAgICAgICAJCVwKKwkJCQlmb3IgKF9faSA9IDA7IF9faSA8IE1BWF9TVFJfTEVOOyBfX2krKykgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwkJCQkgICAgIGlmICghUFJJTlRBQkxFKGJ1ZmZlcltfX2ldKSkgICBcCisJCQkJCQlidWZmZXJbX19pXSA9ICc/JzsgICAgIAlcCiAJCQkJfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKIAkJCQlidWZmZXJbbGVuZ3RoXSA9ICdcMCc7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogCQkJCXByaW50aygiUnRsODE5eDogIik7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAJXApAQCAtNjQ0LDkgKzYzNiw5IEBACiAjaW5jbHVkZSA8bGludXgvaWZfYXJwLmg+IC8qIEFSUEhSRF9FVEhFUiAqLwogCiAjaWZ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WFibGVzCQkJCQkJCSovCi0KLXN0YXRpYyBMSVNUX0hFQUQoc3RyaXBfbGlzdCk7Ci1zdGF0aWMgREVGSU5FX1NQSU5MT0NLKHN0cmlwX2xvY2spOwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogTWFjcm9zCQkJCQkJCQkqLwotCi0vKiBSZXR1cm5zIFRSVUUgaWYgdGV4dCBUIGJlZ2lucyB3aXRoIHByZWZpeCBQICovCi0jZGVmaW5lIGhhc19wcmVmaXgoVCxMLFApICgoKEwpID49IHNpemVvZihQKS0xKSAmJiAhc3RybmNtcCgoVCksIChQKSwgc2l6ZW9mKFApLTEpKQotCi0vKiBSZXR1cm5zIFRSVUUgaWYgdGV4dCBUIG9mIGxlbmd0aCBMIGlzIGVxdWFsIHRvIHN0cmluZyBTICovCi0jZGVmaW5lIHRleHRfZXF1YWwoVCxMLFMpICgoKEwpID09IHNpemVvZihTKS0xKSAmJiAhc3RybmNtcCgoVCksIChTKSwgc2l6ZW9mKFMpLTEpKQotCi0jZGVmaW5lIFJFQURIRVgoWCkgKChYKT49JzAnICYmIChYKTw9JzknID8gKFgpLScwJyA6ICAgICAgXAotICAgICAgICAgICAgICAgICAgICAoWCk+PSdhJyAmJiAoWCk8PSdmJyA/IChYKS0nYScrMTAgOiAgIFwKLSAgICAgICAgICAgICAgICAgICAgKFgpPj0nQScgJiYgKFgpPD0nRicgPyAoWCktJ0EnKzEwIDogMCApCi0KLSNkZWZpbmUgUkVBREhFWDE2KFgpICgoX191MTYpKFJFQURIRVgoWCkpKQotCi0jZGVmaW5lIFJFQURERUMoWCkgKChYKT49JzAnICYmIChYKTw9JzknID8gKFgpLScwJyA6IDApCi0KLSNkZWZpbmUgQVJSQVlfRU5EKFgpICgmKChYKVtBUlJBWV9TSVpFKFgpXSkpCi0KLSNkZWZpbmUgSklGRklFX1RPX1NFQyhYKSAoKFgpIC8gSFop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ZCB0byBiZSB3cml0dGVuIiwgc2tiLT5sZW4pOworCWxlbiA9IHNrYi0+bGVuOworCisJLyogc3RfbGwgdG8gZGVjaWRlIHdoZXJlIHRvIGVucXVldWUgdGhlIHNrYiAqLworCXN0X2ludF9lbnF1ZXVlKHN0X2dkYXRhLCBza2IpOworCS8qIHdha2UgdXAgKi8KKwlzdF90eF93YWtldXAoc3RfZ2RhdGEpOworCisJLyogcmV0dXJuIG51bWJlciBvZiBieXRlcyB3cml0dGVuICovCisJcmV0dXJuIGxlbjsKK30KKworLyogZm9yIHByb3RvY29scyBtYWtpbmcgdXNlIG9mIHNoYXJlZCB0cmFuc3BvcnQgKi8KK0VYUE9SVF9TWU1CT0xfR1BMKHN0X3VucmVnaXN0ZXIpOworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKgorICogZnVuY3Rpb25zIGNhbGxlZCBmcm9tIFRUWSBsYXllcgorICovCitzdGF0aWMgaW50IHN0X3R0eV9vcGVuKHN0cnVjdCB0dHlfc3RydWN0ICp0dHkpCit7CisJaW50IGVyciA9IFNUX1NVQ0NFU1M7CisJc3RydWN0IHN0X2RhdGFfcyAqc3RfZ2RhdGE7CisJcHJfaW5mbygiJXMgIiwgX19mdW5jX18pOworCisJc3Rfa2ltX3JlZigmc3RfZ2RhdGEpOworCXN0X2dkYXRhLT50dHkgPSB0dHk7CisJdHR5LT5kaXNjX2RhdGEgPSBzdF9nZGF0YTsKKworCS8qIGRvbid0IGRvIGFuIHdha2V1cCBmb3Igbm93ICovCisJY2xlYXJfYml0KFRUWV9ET19XUklURV9XQUtFVVAsICZ0dHktPmZsYWdzKTsKKworCS8qIG1lbSBhbHJlYWR5IGFsbG9jYXRlZAorCSAqLworCXR0eS0+cmVjZWl2ZV9yb29tID0gNjU1MzY7CisJLyogRmx1c2ggYW55IHBlbmRpbmcgY2hhcmFjdGVycyBpbiB0aGUgZHJpdmVyIGFuZ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iamVjdCBwc0VSUCwKKyAgICBQV0xBTl9JRV9SU04gcFJTTiwKKyAgICBQV0xBTl9JRV9SU05fRVhUIHBSU05XUEEsCisgICAgUFdMQU5fSUVfQ09VTlRSWSBwSUVfQ291bnRyeSwKKyAgICBQV0xBTl9JRV9RVUlFVCBwSUVfUXVpZXQsCisgICAgUEtub3duQlNTIHBCU1NMaXN0LAorICAgIFVJTlQgdUlFTGVuZ3RoLAorICAgIFBCWVRFIHBieUlFcywKKyAgICB2b2lkICpwUnhQYWNrZXRDb250ZXh0CiAgICAgKQogewogICAgIGludCAgICAgICAgICAgICBpaTsKQEAgLTc2NCw5ICs3NjQsOSBAQAogCiBCT09MCiBCU1NEQmJJc1NUQUluTm9kZURCKAotICAgIElOIFBWT0lEIHBNZ210T2JqZWN0LAotICAgIElOIFBCWVRFIGFieURzdEFkZHIsCi0gICAgT1VUIFBVSU5UIHB1Tm9kZUluZGV4CisgICAgdm9pZCAqcE1nbXRPYmplY3QsCisgICAgUEJZVEUgYWJ5RHN0QWRkciwKKyAgICBQVUlOVCBwdU5vZGVJbmRleAogICAgICkKIHsKICAgICBQU01nbXRPYmplY3QgICAgcE1nbXQgPSAoUFNNZ210T2JqZWN0KSBwTWdtdE9iamVjdDsKQEAgLTc5NywxMCArNzk3LDEwIEBACiAgKiAgICBOb25lCiAgKgogLSovCi1WT0lECit2b2lkCiBCU1N2Q3JlYXRlT25lTm9kZSgKLSAgICBJTiBIQU5ETEUgaERldmljZUNvbnRleHQsCi0gICAgT1VUIFBVSU5UIHB1Tm9kZUluZGV4CisgICAgdm9pZCAqaERldmljZUNvbnRleHQsCisgICAgUFVJTlQgcHVOb2RlSW5kZXgKICAgICApCiB7CiAKQEAgLTg2MiwxMCArODYyLDEwIEBACiAgKiAgICBOb25lCiAgKgogLSovCi1WT0lECit2b2lkCiBCU1N2UmVtb3ZlT25lTm9kZSgKLSAgICBJTiBIQU5ETEUgaERldmljZUNvbnRleHQsCi0gICAgSU4gVUlOVCB1Tm9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pY2VDb250ZXh0CisgICAgdm9pZCAqaERldmljZUNvbnRleHQKICAgICApCiB7CiAgICAgUFNEZXZpY2UgICAgICAgIHBEZXZpY2UgPSAoUFNEZXZpY2UpaERldmljZUNvbnRleHQ7CkBAIC0xMTExLDcgKzExMTEsNyBAQAogfQogCiAjaWZkZWYgQ2FsY3VfTGlua1F1YWwKLSAgIHNfdUNhbGN1bGF0ZUxpbmtRdWFsKChIQU5ETEUpcERldmljZSk7CisgICBzX3VDYWxjdWxhdGVMaW5rUXVhbCgodm9pZCAqKXBEZXZpY2UpOwogI2VuZGlmCiAKICAgICBmb3IgKGlpID0gMDsgaWkgPCAoTUFYX05PREVfTlVNICsgMSk7IGlpKyspIHsKQEAgLTExNjIsNyArMTE2Miw3IEBACiAqLwogICAgICAgICAgICAgICAgIGlmIChpaSA+IDApIHsKICAgICAgICAgICAgICAgICAgICAgLy8gaWkgPSAwIGZvciBtdWx0aWNhc3Qgbm9kZSAoQVAgJiBBZGhvYykKLSAgICAgICAgICAgICAgICAgICAgUkFURXZUeFJhdGVGYWxsQmFjaygoUFZPSUQpcERldmljZSwgJihwTWdtdC0+c05vZGVEQlRhYmxlW2lpXSkpOworICAgICAgICAgICAgICAgICAgICBSQVRFdlR4UmF0ZUZhbGxCYWNrKCh2b2lkICopcERldmljZSwgJihwTWdtdC0+c05vZGVEQlRhYmxlW2lpXSkpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgLy8gaWkgPSAwIHJlc2VydmVkIGZvciB1bmljYXN0IEFQIG5vZGUgKEluZnJhIFNUQSkKQEAgLTExNzAsNyArMTE3MCw3IEBACiAjaWZkZWYJUExJQ0VfREVCVUcKIAkJcHJpbnRrKCJTZWNvbmRDYWxsYmFjazpCZWZvcmU6VHhEYXRhUmF0ZSBpcyAlZFxuIixwTWdtdC0+c05vZGVEQlRhYmxlWzBdLndUeERhdGFSYXRlKTsKICNlbmRpZgotICAgICAgICAgICAgICAgICAgICAgICAgUkFURXZUeFJhdGVGYWxsQmFjaygoUFZPSUQpcERldmljZSwgJihwTWdtdC0+c05vZGVEQlRhYmxlW2lpXSkpOworICAgICAgICAgICAgICAgICAgICAgICAgUkFURXZUeFJhdGVGYWxsQmFjaygodm9pZCAqKXBEZXZpY2UsICYocE1nbXQtPnNOb2RlREJUYWJsZVtpaV0pKTsKICNpZmRlZglQTElDRV9ERUJVRwogCQlwcmludGsoIlNlY29uZENhbGxiYWNrOkFmdGVyOlR4RGF0YVJhdGUgaXMgJWRcbiIscE1nbXQtPnNOb2RlREJUYWJsZVswXS53VHhEYXRhUmF0ZSk7CiAjZW5kaWYKQEAgLTEyMTUsMTQgKzEyMTUsMTQgQEAKICAgICAgICAgICAgIGlmIChwRGV2aWNlLT5iU2hvcnRTbG90VGltZSkgewogICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJTaG9ydFNsb3RUaW1lID0gRkFMU0U7CiAgICAgICAgICAgICAgICAgQkJ2U2V0U2hvcnRTbG90VGltZShwRGV2aWNlKTsKLSAgICAgICAgICAgICAgICB2VXBkYXRlSUZTKChQVk9JRClwRGV2aWNlKTsKKyAgICAgICAgICAgICAgICB2VXBkYXRlSUZTKCh2b2lkICopcERldmljZSk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICBpZiAoIXBEZXZpY2UtPmJTaG9ydFNsb3RUaW1lKSB7CiAgICAgICAgICAgICAgICAgcERldmljZS0+YlNob3J0U2xvdFRpbWUgPSBUUlVFOwogICAgICAgICAgICAgICAgIEJCdlNldFNob3J0U2xvdFRpbWUocERldmljZSk7Ci0gICAgICAgICAgICAgICAgdlVwZGF0ZUlGUygoUFZPSUQpcERldmljZSk7CisgICAgICAgICAgICAgICAgdlVwZGF0ZUlGUygodm9pZCAqKXBEZXZpY2UpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAKQEAgLTEyNjEsMTggKzEyNjEsMTggQEAKICAgICAgICAgaWYgKHBNZ210LT5zTm9kZURCVGFibGVbMF0uYkFjdGl2ZSkgeyAvLyBBc3NvYyB3aXRoIEJTUwogICAgICAgICAgICAvLyBEQkdfUFJUKE1TR19MRVZFTF9JTkZPLCBLRVJOX0lORk8gIkNhbGxiYWNrIGluYWN0aXZlIENvdW50ID0gWyVkXVxuIiwgcE1nbXQtPnNOb2RlREJUYWJsZVswXS51SW5BY3RpdmVDb3VudCk7CiAgICAgICAgICAgICAvL2lmIChwRGV2aWNlLT5iVXBkYXRlQkJWR0EpIHsKLSAgICAgICAgICAgIC8vICBzX3ZDaGVja1NlbnNpdGl2aXR5KChIQU5ETEUpIHBEZXZpY2UpOworICAgICAgICAgICAgLy8gIHNfdkNoZWNrU2Vuc2l0aXZpdHkoKHZvaWQgKikgcERldmljZSk7CiAgICAgICAgICAgICAvL30KIAogICAgICAgICAgICAgaWYgKHBEZXZpY2UtPmJVcGRhdGVCQlZHQSkgewotICAgICAgICAgICAgICAgLy8gc192Q2hlY2tTZW5zaXRpdml0eSgoSEFORExFKSBwRGV2aWNlKTsKLSAgICAgICAgICAgICAgIHNfdkNoZWNrUHJlRURUaHJlc2hvbGQoKEhBTkRMRSlwRGV2aWNlKTsKKyAgICAgICAgICAgICAgIC8vIHNfdkNoZWNrU2Vuc2l0aXZpdHkoKHZvaWQgKikgcERldmljZSk7CisgICAgICAgICAgICAgICBzX3ZDaGVja1ByZUVEVGhyZXNob2xkKCh2b2lkICopcERldmljZSk7CiAgICAgICAgICAgICB9CiAKICAgICAJICAgIGlmICgocE1nbXQtPnNOb2RlREJUYWJsZVswXS51SW5BY3RpdmVDb3VudCA+PSAoTE9TVF9CRUFDT05fQ09VTlQvMikpICYmCiAgICAgCSAgICAgICAgKHBEZXZpY2UtPmJ5QkJWR0FDdXJyZW50ICE9IHBEZXZpY2UtPmFieUJCVkdBWzBdKSApIHsKICAgICAJICAgICAgICBwRGV2aWNlLT5ieUJCVkdBTmV3ID0gcERldmljZS0+Y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AgICAgICAgIGJTY2hlZHVsZUNvbW1hbmQoKHZvaWQgKikgcERldmljZSwgV0xBTl9DTURfQlNTSURfU0NBTiwgcE1nbXQtPmFieURlc2lyZVNTSUQpOworICAgICAgICAgICAgICAgIGJTY2hlZHVsZUNvbW1hbmQoKHZvaWQgKikgcERldmljZSwgV0xBTl9DTURfU1NJRCwgcE1nbXQtPmFieURlc2lyZVNTSUQpOwogICAgICAgICAgICAgICAgIHBEZXZpY2UtPnVBdXRvUmVDb25uZWN0VGltZSA9IDA7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KQEAgLTEzNDIsMTYgKzEzNDIsMTYgQEAKICAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX05PVElDRSwgS0VSTl9JTkZPICJBZGhvYyByZS1zY2FuaW5nIC4uLlxuIik7CiAJICAgICAgcE1nbXQtPmVTY2FuVHlwZSA9IFdNQUNfU0NBTl9BQ1RJVkU7Ci0gICAgICAgICAgICAgICAgYlNjaGVkdWxlQ29tbWFuZCgoSEFORExFKSBwRGV2aWNlLCBXTEFOX0NNRF9CU1NJRF9TQ0FOLCBOVUxMKTsKLSAgICAgICAgICAgICAgICBiU2NoZWR1bGVDb21tYW5kKChIQU5ETEUpIHBEZXZpY2UsIFdMQU5fQ01EX1NTSUQsIE5VTEwpOworICAgICAgICAgICAgICAgIGJTY2hlZHVsZUNvbW1hbmQoKHZvaWQgKikgcERldmljZSwgV0xBTl9DTURfQlNTSURfU0NBTiwgTlVMTCk7CisgICAgICAgICAgICAgICAgYlNjaGVkdWxlQ29tbWFuZCgodm9pZCAqKSBwRGV2aWNlLCBXTEFOX0NNRF9TU0lELCBOVUxMKTsKICAgICAgICAgICAgICAgICBwRGV2aWNlLT51QXV0b1JlQ29ubmVjdFRpbWUgPSAwOwogICAgICAgICAgICAgfTsKICAgICAgICAgfQogICAgICAgICBpZiAocE1nbXQtPmVDdXJyU3RhdGUgPT0gV01BQ19TVEFURV9KT0lOVEVEKSB7CiAKICAgICAgICAgICAgIGlmIChwRGV2aWNlLT5iVXBkYXRlQkJWR0EpIHsKLSAgICAgICAgICAgICAgIC8vc192Q2hlY2tTZW5zaXRpdml0eSgoSEFORExFKSBwRGV2aWNlKTsKLSAgICAgICAgICAgICAgIHNfdkNoZWNrUHJlRURUaHJlc2hvbGQoKEhBTkRMRSlwRGV2aWNlKTsKKyAgICAgICAgICAgICAgIC8vc192Q2hlY2tTZW5zaXRpdml0eSgodm9pZCAqKSBwRGV2aWNlKTsKKyAgICAgICAgICAgICAgIHNfdkNoZWNrUHJlRURUaHJlc2hvbGQoKHZvaWQgKilwRGV2aWNlKTsKICAgICAgICAgICAgIH0KICAgICAgICAgCWlmIChwTWdtdC0+c05vZGVEQlRhYmxlWzBdLnVJbkFjdGl2ZUNvdW50ID49QURIT0NfTE9TVF9CRUFDT05fQ09VTlQpIHsKICAgICAgICAgCSAgICBEQkdfUFJUKE1TR19MRVZFTF9OT1RJQ0UsIEtFUk5fSU5GTyAiTG9zdCBvdGhlciBTVEEgYmVhY29uIFslZF0gc2VjLCBzdGFydGVkICFcbiIsIHBNZ210LT5zTm9kZURCVGFibGVbMF0udUluQWN0aXZlQ291bnQpOwpAQCAtMTM4OCwxMyArMTM4OCwxMyBAQAogCiAKIAotVk9JRAordm9pZAogQlNTdlVwZGF0ZU5vZGVUeENvdW50ZXIoCi0gICAgSU4gSEFORExFICAgICAgaERldmljZUNvbnRleHQsCi0gICAgSU4gQllURSAgICAgICAgYnlUc3IwLAotICAgIElOIEJZVEUgICAgICAgIGJ5VHNyMSwKLSAgICBJTiBQQllURSAgICAgICBwYnlCdWZmZXIsCi0gICAgSU4gVUlOVCAgICAgICAgdUZJRk9IZWFkZXJTaXplCisgICAgdm9pZCAqaERldmljZUNvbnRleHQsCisgICAgQllURSAgICAgICAgYnlUc3IwLAorICAgIEJZVEUgICAgICAgIGJ5VHNyMSwKKyAgICBQQllURSAgICAgICBwYnlCdWZmZXIsCisgICA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ZXh0Cit2b2lkIHNfdkNoZWNrU2Vuc2l0aXZpdHkoCisgICAgdm9pZCAqaERldmljZUNvbnRleHQKICAgICApCiB7CiAgICAgUFNEZXZpY2UgICAgICAgIHBEZXZpY2UgPSAoUFNEZXZpY2UpaERldmljZUNvbnRleHQ7CkBAIC0xNjQ5LDcgKzE2NDksNyBAQAogICAgICAgICAgICAgICAgIGlmIChwRGV2aWNlLT5ieUJCVkdBTmV3ICE9IHBEZXZpY2UtPmJ5QkJWR0FDdXJyZW50KSB7CiAgICAgICAgICAgICAgICAgICAgIHBEZXZpY2UtPnVCQlZHQURpZmZDb3VudCsrOwogICAgICAgICAgICAgICAgICAgICBpZiAocERldmljZS0+dUJCVkdBRGlmZkNvdW50ID49IEJCX1ZHQV9DSEFOR0VfVEhSRVNIT0xEKQotICAgICAgICAgICAgICAgICAgICAgICAgYlNjaGVkdWxlQ29tbWFuZCgoSEFORExFKSBwRGV2aWNlLCBXTEFOX0NNRF9DSEFOR0VfQkJTRU5TSVRJVklUWSwgTlVMTCk7CisgICAgICAgICAgICAgICAgICAgICAgICBiU2NoZWR1bGVDb21tYW5kKCh2b2lkICopIHBEZXZpY2UsIFdMQU5fQ01EX0NIQU5HRV9CQlNFTlNJVElWSVRZLCBOVUxMKTsKICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT51QkJWR0FEaWZmQ291bnQgPSAwOwogICAgICAgICAgICAgICAgIH0KQEAgLTE2NTksOSArMTY1OSw5IEBACiB9CiAKIAotVk9JRAordm9pZAogQlNTdkNsZWFyQW55QlNTSm9pblJlY29yZCAoCi0gICAgSU4gSEFORExFIGhEZXZpY2VDb250ZXh0CisgICAgdm9pZCAqaERldmljZUNvbnRleHQKICAgICApCiB7CiAgICAgUFNEZXZpY2UgICAgICAgIHBEZXZpY2UgPSAoUFNEZXZpY2UpaERldmljZUNvbnRleHQ7CkBAIC0xNjc1LDggKzE2NzUsOCBAQAogfQogCiAjaW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ldmljZUNvbnRleHQsCi0gICAgSU4gQllURSAgICAgICAgYnlUc3IwLAotICAgIElOIEJZVEUgICAgICAgIGJ5VHNyMSwKLSAgICBJTiBQQllURSAgICAgICBwYnlCdWZmZXIsCi0gICAgSU4gVUlOVCAgICAgICAgdUZJRk9IZWFkZXJTaXplCisgICAgdm9pZCAqaERldmljZUNvbnRleHQsCisgICAgQllURSAgICAgICAgYnlUc3IwLAorICAgIEJZVEUgICAgICAgIGJ5VHNyMSwKKyAgICBQQllURSAgICAgICBwYnlCdWZmZXIsCisgICAgVUlOVCAgICAgICAgdUZJRk9IZWFkZXJTaXplCiAgICAgKTsKIAotVk9JRAordm9pZAogQlNTdlJlbW92ZU9uZU5vZGUoCi0gICAgSU4gSEFORExFIGhEZXZpY2VDb250ZXh0LAotICAgIElOIFVJTlQgdU5vZGVJbmRleAorICAgIHZvaWQgKmhEZXZpY2VDb250ZXh0LAorICAgIFVJTlQgdU5vZGVJbmRleAogICAgICk7CiAKLVZPSUQKK3ZvaWQKIEJTU3ZBZGRNdWx0aWNhc3ROb2RlKAotICAgIElOIEhBTkRMRSBoRGV2aWNlQ29udGV4dAorICAgIHZvaWQgKmhEZXZpY2VDb250ZXh0CiAgICAgKTsKIAogCi1WT0lECit2b2lkCiBCU1N2Q2xlYXJOb2RlREJUYWJsZSgKLSAgICBJTiBIQU5ETEUgaERldmljZUNvbnRleHQsCi0gICAgSU4gVUlOVCB1U3RhcnRJbmRleAorICAgIHZvaWQgKmhEZXZpY2VDb250ZXh0LAorICAgIFVJTlQgdVN0YXJ0SW5kZXgKICAgICApOwogCi1WT0lECit2b2lkCiBCU1N2Q2xlYXJBbnlCU1NKb2luUmVjb3JkKAotICAgIElOIEhBTkRMRSBoRGV2aWNlQ29udGV4dAorICAgIHZvaWQgKmhEZXZpY2VDb250ZXh0CiAgICAgKTsKIAogI2VuZGlmIC8vX19CU1NEQl9IX18KZGlmZiAtLWdpdCBhL2RyaXZlcnMvc3RhZ2luZy92dDY2NTUvY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XRlczolZFxuIiwgKGludClwRGV2aWNlLT5nc1BNS0lEQ2FuZGlkYXRlLk51bUNhbmRpZGF0ZXMpOwogICAgIHJldHVybiBUUlVFOwogfQogCi1QVk9JRAordm9pZCAqCiBDQVJEcEdldEN1cnJlbnRBZGRyZXNzICgKLSAgICBJTiBQVk9JRCAgICAgICAgICAgIHBEZXZpY2VIYW5kbGVyCisgICAgdm9pZCAqcERldmljZUhhbmRsZXIKICAgICApCiB7CiAgICAgUFNEZXZpY2UgICAgICAgICAgICBwRGV2aWNlID0gKFBTRGV2aWNlKSBwRGV2aWNlSGFuZGxlcjsKQEAgLTE2MTEsNyArMTYxMSw3IEBACiAKIAogCi1WT0lEIENBUkR2SW5pdENoYW5uZWxUYWJsZSAoUFZPSUQgcERldmljZUhhbmRsZXIpCit2b2lkIENBUkR2SW5pdENoYW5uZWxUYWJsZSAodm9pZCAqcERldmljZUhhbmRsZXIpCiB7CiAgICAgUFNEZXZpY2UgICAgcERldmljZSA9IChQU0RldmljZSkgcERldmljZUhhbmRsZXI7CiAgICAgQk9PTCAgICAgICAgYk11bHRpQmFuZCA9IEZBTFNFOwpAQCAtMTcwOCw5ICsxNzA4LDkgQEAKIC0qLwogQk9PTAogQ0FSRGJTdGFydE1lYXN1cmUgKAotICAgIElOIFBWT0lEICAgICAgICAgICAgcERldmljZUhhbmRsZXIsCi0gICAgSU4gUFZPSUQgICAgICAgICAgICBwdk1lYXN1cmVFSURzLAotICAgIElOIFVJTlQgICAgICAgICAgICAgdU51bU9mTWVhc3VyZUVJRHMKKyAgICB2b2lkICpwRGV2aWNlSGFuZGxlciwKKyAgICB2b2lkICpwdk1lYXN1cmVFSURzLAorICAgIFVJTlQgICAgICAgICAgICAgdU51bU9mTWVhc3VyZUVJRHMKICAgICApCiB7CiAgICAgUFNEZXZpY2UgICAgICAgICAgICAgICAgcERldmljZSA9IChQU0RldmljZSkgcERldmljZUhhbmRsZXI7CkBAIC0xODM1LDEwICsxODM1LDEwIEBACiAtKi8KIEJPT0wKIENBUkRiQ2hhbm5lbFN3aXRjaCAoCi0gICAgSU4gUFZPSUQgICAgICAgICAgICBwRGV2aWNlSGFuZGxlciwKLSAgICBJTiBCWVRFICAgICAgICAgICAgIGJ5TW9kZSwKLSAgICBJTiBCWVRFICAgICAgICAgICAgIGJ5TmV3Q2hhbm5lbCwKLSAgICBJTiBCWVRFICAgICAgICAgICAgIGJ5Q291bnQKKyAgICB2b2lkICpwRGV2aWNlSGFuZGxlciwKKyAgICBCWVRFICAgICAgICAgICAgIGJ5TW9kZSwKKyAgICBCWVRFICAgICAgICAgICAgIGJ5TmV3Q2hhbm5lbCwKKyAgICBCWVRFICAgICAgICAgICAgIGJ5Q291bnQKICAgICApCiB7CiAgICAgUFNEZXZpY2UgICAgcERldmljZSA9IChQU0RldmljZSkgcERldmljZUhhbmRsZXI7CkBAIC0xODc4LDEyICsxODc4LDEyIEBACiAtKi8KIEJPT0wKIENBUkRiU2V0UXVpZXQgKAotICAgIElOIFBWT0lEICAgICAgICAgICAgcERldmljZUhhbmRsZXIsCi0gICAgSU4gQk9PTCAgICAgICAgICAgICBiUmVzZXRRdWlldCwKLSAgICBJTiBCWVRFICAgICAgICAgICAgIGJ5UXVpZXRDb3VudCwKLSAgICBJTiBCWVRFICAgICAgICAgICAgIGJ5UXVpZXRQZXJpb2QsCi0gICAgSU4gV09SRCAgICAgICAgICAgICB3UXVpZXREdXJhdGlvbiwKLSAgICBJTiBXT1JEICAgICAgICAgICAgIHdRdWlldE9mZnNldAorICAgIHZvaWQgKnBEZXZpY2VIYW5kbGVyLAorICAgIEJPT0wgICAgICAgICAgICAgYlJlc2V0UXVpZXQsCisgICAgQllURSAgICAgICAgICAgICBieVF1aWV0Q291bnQsCisgICAgQllURSAgICAgICAgICAgICBieVF1aWV0UGVyaW9kLAorICAgIFdPUkQgICAgICAgICAgICAgd1F1aWV0RHVyYXRpb24sCisgICAgV09SRCAgICAgICAgICAgICB3UXVpZXRPZmZzZXQKICAgICApCiB7CiAgICAgUFNEZXZpY2UgICAgcERldmljZSA9IChQU0RldmljZSkgcERldmljZUhhbmRsZXI7CkBAIC0xOTM0LDcgKzE5MzQsNyBAQAogLSovCiBCT09MCiBDQVJEYlN0YXJ0UXVpZXQgKAotICAgIElOIFBWT0lEICAgICAgICAgICAgcERldmljZUhhbmRsZXIKKyAgICB2b2lkICpwRGV2aWNlSGFuZGxlcgogICAgICkKIHsKICAgICBQU0RldmljZSAgICBwRGV2aWNlID0gKFBTRGV2aWNlKSBwRGV2aWNlSGFuZGxlcjsKQEAgLTIwMzMsMTEgKzIwMzMsMTEgQEAKICAqIFJldHVybiBWYWx1ZTogbm9uZS4KICAqCiAtKi8KLVZPSUQKK3ZvaWQKIENBUkR2U2V0Q291bnRyeUluZm8gKAotICAgIElOIFBWT0lEICAgICAgICAgICAgcERldmljZUhhbmRsZXIsCi0gICAgSU4gQ0FSRF9QSFlfVFlQRSAgICBlUEhZVHlwZSwKLSAgICBJTiBQVk9JRCAgICAgICAgICAgIHBJRQorICAgIHZvaWQgKnBEZXZpY2VIYW5kbGVyLAorICAgIENBUkRfUEhZX1RZUEUgICAgZVBIWVR5cGUsCisgICAgdm9pZCAqcElFCiAgICAgKQogewogICAgIFBTRGV2aWNlICAgICAgICAgICAgcERldmljZSA9IChQU0RldmljZSkgcERldmljZUhhbmRsZXI7CkBAIC0yMDkyLDExICsyMDkyLDExIEBACiAgKiBSZXR1cm4gVmFsdWU6IG5vbmUuCiAgKgogLSovCi1WT0lECit2b2lkCiBDQVJEdlNldFBvd2VyQ29uc3RyYWludCAoCi0gICAgSU4gUFZPSUQgICAgICAgICAgICBwRGV2aWNlSGFuZGxlciwKLSAgICBJTiBCWVRFICAgICAgICAgICAgIGJ5Q2hhbm5lbCwKLSAgICBJTiBJOCAgICAgICAgICAgICAgIGJ5UG93ZXIKKyAgICB2b2lkICpwRGV2aWNlSGFuZGxlciwKKyAgICBCWVRFICAgICAgICAgICAgIGJ5Q2hhbm5lbCwKKyAgICBJOCAgICAgICAgICAgICAgIGJ5UG93ZXIKICAgICApCiB7CiAgICAgUFNEZXZpY2UgICAgcERldmljZSA9IChQU0RldmljZSkgcERldmljZUhhbmRsZXI7CkBAIC0yMTI3LDExICsyMTI3LDExIEBACiAgKiBSZXR1cm4gVmFsdWU6IG5vbmUuCiAgKgogLSovCi1WT0lECit2b2lkCiBDQVJEdkdldFBvd2VyQ2FwYWJpbGl0eSAoCi0gICAgSU4gUFZPSUQgICAgICAgICAgICBwRGV2aWNlSGFuZGxlciwKLSAgICBPVVQgUEJZVEUgICAgICAgICAgIHBieU1pblBvd2VyLAotICAgIE9VVCBQQllURSAgICAgICAgICAgcGJ5TWF4UG93ZXIKKyAgICB2b2lkICpwRGV2aWNlSGFuZGxlciwKKyAgICBQQllURSAgICAgICAgICAgcGJ5TWluUG93ZXIsCisgICAgUEJZVEUgICAgICAgICAgIHBieU1heFBvd2VyCiAgICAgKQogewogICAgIFBTRGV2aWNlICAgIHBEZXZpY2UgPSAoUFNEZXZpY2UpIHBEZXZpY2VIYW5kbGVyOwpAQCAtMjE2NSw4ICsyMTY1LDggQEAKIC0qLwogQllURQogQ0FSRGJ5U2V0U3VwcG9ydENoYW5uZWxzICgKLSAgICBJTiBQVk9JRCAgICAgICAgICAgIHBEZXZpY2VIYW5kbGVyLAotICAgIElOIE9VVCBQQllURSAgICAgICAgcGJ5SUVzCisgICAgdm9pZCAqcERldmljZUhhbmRsZXIsCisgICAgUEJZVEUgICAgICAgIHBieUlFcwogICAgICkKIHsKICAgICBQU0RldmljZSAgICAgICAgICAgIHBEZXZpY2UgPSAoUFNEZXZpY2UpIHBEZXZpY2VIYW5kbGVyOwpAQCAtMjI1Niw3ICsyMjU2LDcgQEAKIC0qLwogSTgKIENBUkRieUdldFRyYW5zbWl0UG93ZXIgKAotICAgIElOIFBWT0lEICAgICAgICAgICAgcERldmljZUhhbmRsZXIKKyAgICB2b2lkICpwRGV2aWNlSGFuZGxlcgogICAgICkKIHsKICAgICBQU0RldmljZSAgICBwRGV2aWNlID0gKFBTRGV2aWNlKSBwRGV2aWNlSGFuZGxlcjsKQEAgLTIyNjcsOCArMjI2Nyw4IEBACiAKIEJPT0wKIENBUkRiQ2hhbm5lbEdldExpc3QgKAotICAgIElOICBVSU5UICAgICAgIHVDb3VudHJ5Q29kZUlkeCwKLSAgICBPVVQgUEJZVEUgICAgICBwYnlDaGFubmVsVGFibGUKKyAgICAgVUlOVCAgICAgICB1Q291bnRyeUNvZGVJZHgsCisgICAgUEJZVEUgICAgICBwYnlDaGFubmVsVGFibGUKICAgICApCiB7CiAgICAgaWYgKHVDb3VudHJ5Q29kZUlkeCA+PSBDQ09ERV9NQVgpIHsKQEAgLTIyNzksMTAgKzIyNzksMTAgQEAKIH0KIAogCi1WT0lECit2b2lkCiBDQVJEdlNldENvdW50cnlJRSgKLSAgICBJTiBQVk9JRCAgICAgICAgcERldmljZUhhbmRsZXIsCi0gICAgSU4gUFZPSUQgICAgICAgIHBJRQorICAgIHZvaWQgKnBEZXZpY2VIYW5kbGVyLAorICAgIHZvaWQgKnBJRQogICAgICkKIHsKICAgICBQU0RldmljZSAgICAgICAgICAgIHBEZXZpY2UgPSAoUFNEZXZpY2UpIHBEZXZpY2VIYW5kbGVyOwpAQCAtMjMwNywxMCArMjMwNywxMCBAQAogCiBCT09MCiBDQVJEYkdldENoYW5uZWxNYXBJbmZvKAotICAgIElOIFBWT0lEICAgICAgICBwRGV2aWNlSGFuZGxlciwKLSAgICBJTiBVSU5UICAgICAgICAgdUNoYW5uZWxJbmRleCwKLSAgICBPVVQgUEJZVEUgICAgICAgcGJ5Q2hhbm5lbE51bWJlciwKLSAgICBPVVQgUEJZVEUgICAgICAgcGJ5TWFwCisgICAgdm9pZCAqcERldmljZUhhbmRsZXIsCisgICAgVUlOVCAgICAgICAgIHVDaGFubmVsSW5kZXgsCisgICAgUEJZVEUgICAgICAgcGJ5Q2hhbm5lbE51bWJlciwKKyAgICBQQllURSAgICAgICBwYnlNYXAKICAgICApCiB7Ci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ICAgICAgICAgICAgICAgICBDQVJEd0dldENDS0NvbnRyb2xSYXRlKChQVk9JRClwRGV2aWNlLCBSQVRFXzFNKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBDQVJEd0dldENDS0NvbnRyb2xSYXRlKCh2b2lkICopcERldmljZSwgUkFURV8xTSksCiAgICAgICAgICAgICAgICAgICAgICAgICAgUEtfVFlQRV8xMUIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgJndMZW4sCiAgICAgICAgICAgICAgICAgICAgICAgICAgJmJ5U2VydiwKQEAgLTI2MjUsNyArMjYyNSw3IEBACiAgICAgLy8vUlNQSU5GX2JfMgogICAgIEJCdkNhY3VsYXRlUGFyYW1ldGVyKHBEZXZpY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgMTQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgQ0FSRHdHZXRDQ0tDb250cm9sUmF0ZSgoUFZPSUQpcERldmljZSwgUkFURV8yTSksCisgICAgICAgICAgICAgICAgICAgICAgICAgQ0FSRHdHZXRDQ0tDb250cm9sUmF0ZSgodm9pZCAqKXBEZXZpY2UsIFJBVEVfMk0pLAogICAgICAgICAgICAgICAgICAgICAgICAgIFBLX1RZUEVfMTFCLAogICAgICAgICAgICAgICAgICAgICAgICAgICZ3TGVuLAogICAgICAgICAgICAgICAgICAgICAgICAgICZieVNlcnYsCkBAIC0yNjM2LDcgKzI2MzYsNyBAQAogICAgIC8vUlNQSU5GX2JfNQogICAgIEJCdkNhY3VsYXRlUGFyYW1ldGVyKHBEZXZpY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgMTQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgQ0FSRHdHZXRDQ0tDb250cm9sUmF0ZSgoUFZPSUQpcERldmljZSwgUkFURV81TSksCisgICAgICAgICAgICAgICAgICAgICAgICAgQ0FSRHdHZXRDQ0tDb250cm9sUmF0ZSgodm9pZCAqKXBEZXZpY2UsIFJBVEVfNU0pLAogICAgICAgICAgICAgICAgICAgICAgICAgIFBLX1RZUEVfMTFCLAogICAgICAgICAgICAgICAgICAgICAgICAgICZ3TGVuLAogICAgICAgICAgICAgICAgICAgICAgICAgICZieVNlcnYsCkBAIC0yNjQ3LDcgKzI2NDcsNyBAQAogICAgIC8vUlNQSU5GX2JfMTEKICAgICBCQnZDYWN1bGF0ZVBhcmFtZXRlcihwRGV2aWNlLAogICAgICAgICAgICAgICAgICAgICAgICAgIDE0LAotICAgICAgICAgICAgICAgICAgICAgICAgIENBUkR3R2V0Q0NLQ29udHJvbFJhdGUoKFBWT0lEKXBEZXZpY2UsIFJBVEVfMTFNKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBDQVJEd0dldENDS0NvbnRyb2xSYXRlKCh2b2lkICopcERldmljZSwgUkFURV8xMU0pLAogICAgICAgICAgICAgICAgICAgICAgICAgIFBLX1RZUEVfMTFCLAogICAgICAgICAgICAgICAgICAgICAgICAgICZ3TGVuLAogICAgICAgICAgICAgICAgICAgICAgICAgICZieVNlcnYsCkBAIC0yNjg2LDI2ICsyNjg2LDI2IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmYnlSc3ZUaW1lKTsKICAgICBWTlN2T3V0UG9ydFcocERldmljZS0+UG9ydE9mZnNldCArIE1BQ19SRUdfUlNQSU5GX0FfMjQsIE1BS0VXT1JEKGJ5VHhSYXRlLGJ5UnN2VGltZSkpOwogICAgIC8vUlNQSU5GX2FfMzYKLSAgICBzX3ZDYWN1bGF0ZU9GRE1SUGFyYW1ldGVyKENBUkR3R2V0T0ZETUNvbnRyb2xSYXRlKChQVk9JRClwRGV2aWNlLCBSQVRFXzM2TSksCisgICAgc192Q2FjdWxhdGVPRkRNUlBhcmFtZXRlcihDQVJEd0dldE9GRE1Db250cm9sUmF0ZSgodm9pZCAqKXBEZXZpY2UsIFJBVEVfMzZNKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVQSFlUeXBlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmJ5VHhSYXRlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmJ5UnN2VGltZSk7CiAgICAgVk5Tdk91dFBvcnRXKHBEZXZpY2UtPlBvcnRPZmZzZXQgKyBNQUNfUkVHX1JTUElORl9BXzM2LCBNQUtFV09SRChieVR4UmF0ZSxieVJzdlRpbWUpKTsKICAgICAvL1JTUElORl9hXzQ4Ci0gICAgc192Q2FjdWxhdGVPRkRNUlBhcmFtZXRlcihDQVJEd0dldE9GRE1Db250cm9sUmF0ZSgoUFZPSUQpcERldmljZSwgUkFURV80OE0pLAorICAgIHNfdkNhY3VsYXRlT0ZETVJQYXJhbWV0ZXIoQ0FSRHdHZXRPRkRNQ29udHJvbFJhdGUoKHZvaWQgKilwRGV2aWNlLCBSQVRFXzQ4TSksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlUEhZVHlwZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZieVR4UmF0ZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZieVJzdlRpbWUpOwogICAgIFZOU3ZPdXRQb3J0VyhwRGV2aWNlLT5Qb3J0T2Zmc2V0ICsgTUFDX1JFR19SU1BJTkZfQV80OCwgTUFLRVdPUkQoYnlUeFJhdGUsYnlSc3ZUaW1lKSk7CiAgICAgLy9SU1BJTkZfYV81NAotICAgIHNfdkNhY3VsYXRlT0ZETVJQYXJhbWV0ZXIoQ0FSRHdHZXRPRkRNQ29udHJvbFJhdGUoKFBWT0lEKXBEZXZpY2UsIFJBVEVfNTRNKSwKKyAgICBzX3ZDYWN1bGF0ZU9GRE1SUGFyYW1ldGVyKENBUkR3R2V0T0ZETUNvbnRyb2xSYXRlKCh2b2lkICopcERldmljZSwgUkFURV81NE0pLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVBIWVR5cGUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmYnlUeFJhdGUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgIC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JRHMKICAgICApOwogCiBCT09MCiBDQVJEYkNoYW5uZWxTd2l0Y2ggKAotICAgIElOIFBWT0lEICAgICAgICAgICAgcERldmljZUhhbmRsZXIsCi0gICAgSU4gQllURSAgICAgICAgICAgICBieU1vZGUsCi0gICAgSU4gQllURSAgICAgICAgICAgICBieU5ld0NoYW5uZWwsCi0gICAgSU4gQllURSAgICAgICAgICAgICBieUNvdW50CisgICAgdm9pZCAqcERldmljZUhhbmRsZXIsCisgICAgQllURSAgICAgICAgICAgICBieU1vZGUsCisgICAgQllURSAgICAgICAgICAgICBieU5ld0NoYW5uZWwsCisgICAgQllURSAgICAgICAgICAgICBieUNvdW50CiAgICAgKTsKIAogQk9PTAogQ0FSRGJTZXRRdWlldCAoCi0gICAgSU4gUFZPSUQgICAgICAgICAgICBwRGV2aWNlSGFuZGxlciwKLSAgICBJTiBCT09MICAgICAgICAgICAgIGJSZXNldFF1aWV0LAotICAgIElOIEJZVEUgICAgICAgICAgICAgYnlRdWlldENvdW50LAotICAgIElOIEJZVEUgICAgICAgICAgICAgYnlRdWlldFBlcmlvZCwKLSAgICBJTiBXT1JEICAgICAgICAgICAgIHdRdWlldER1cmF0aW9uLAotICAgIElOIFdPUkQgICAgICAgICAgICAgd1F1aWV0T2Zmc2V0CisgICAgdm9pZCAqcERldmljZUhhbmRsZXIsCisgICAgQk9PTCAgICAgICAgICAgICBiUmVzZXRRdWlldCwKKyAgICBCWVRFICAgICAgICAgICAgIGJ5UXVpZXRDb3VudCwKKyAgICBCWVRFICAgICAgICAgICAgIGJ5UXVpZXRQZXJpb2QsCisgICAgV09SRCAgICAgICAgICAgICB3UXVpZXREdXJhdGlvbiwKKyAgICBXT1JEICAgICAgICAgICAgIHdRdWlldE9mZnNldAogICAgICk7CiAKIEJPT0wKIENBUkRiU3RhcnRRdWlldCAoCi0gICAgSU4gUFZPSUQgICAgICAgICAgICBwRGV2aWNlSGFuZGxlcgorICAgIHZvaWQgKnBEZXZpY2VIYW5kbGVyCiAgICAgKTsKIAotVk9JRAordm9pZAogQ0FSRHZTZXRDb3VudHJ5SW5mbyAoCi0gICAgSU4gUFZPSUQgICAgICAgICAgICBwRGV2aWNlSGFuZGxlciwKLSAgICBJTiBDQVJEX1BIWV9UWVBFICAgIGVQSFlUeXBlLAotICAgIElOIFBWT0lEICAgICAgICAgICAgcElFCisgICAgdm9pZCAqcERldmljZUhhbmRsZXIsCisgICAgQ0FSRF9QSFlfVFlQRSAgICBlUEhZVHlwZSwKKyAgICB2b2lkICpwSUUKICAgICApOwogCi1WT0lECit2b2lkCiBDQVJEdlNldFBvd2VyQ29uc3RyYWludCAoCi0gICAgSU4gUFZPSUQgICAgICAgICAgICBwRGV2aWNlSGFuZGxlciwKLSAgICBJTiBCWVRFICAgICAgICAgICAgIGJ5Q2hhbm5lbCwKLSAgICBJTiBJOCAgICAgICAgICAgICAgIGJ5UG93ZXIKKyAgICB2b2lkICpwRGV2aWNlSGFuZGxlciwKKyAgICBCWVRFICAgICAgICAgICAgIGJ5Q2hhbm5lbCwKKyAgICBJOCAgICAgICAgICAgICAgIGJ5UG93ZXIKICAgICApOwogCi1WT0lECit2b2lkCiBDQVJEdkdldFBvd2VyQ2FwYWJpbGl0eSAoCi0gICAgSU4gUFZPSUQgICAgICAgICAgICBwRGV2aWNlSGFuZGxlciwKLSAgICBPVVQgUEJZVEUgICAgICAgICAgIHBieU1pblBvd2VyLAotICAgIE9VVCBQQllURSAgICAgICAgICAgcGJ5TWF4UG93ZXIKKyAgICB2b2lkICpwRGV2aWNlSGFuZGxlciwKKyAgICBQQllURSAgICAgICAgICAgcGJ5TWluUG93ZXIsCisgICAgUEJZVEUgICAgICAgICAgIHBieU1heFBvd2VyCiAgICAgKTsKIAogQllURQogQ0FSRGJ5U2V0U3VwcG9ydENoYW5uZWxzICgKLSAgICBJTiBQVk9JRCAgICAgICAgICAgIHBEZXZpY2VIYW5kbGVyLAotICAgIElOIE9VVCBQQllURSAgICAgICAgcGJ5SUVzCisgICAgdm9pZCAqcERldmljZUhhbmRsZXIsCisgICAgUEJZVEUgICAgICAgIHBieUlFcwogICAgICk7CiAKIEk4CiBDQVJEYnlHZXRUcmFuc21pdFBvd2VyICgKLSAgICBJTiBQVk9JRCAgICAgICAgICAgIHBEZXZpY2VIYW5kbGVyCisgICAgdm9pZCAqcERldmljZUhhbmRsZXIKICAgICApOwogCiBCT09MCiBDQVJEYkNoYW5uZWxHZXRMaXN0ICgKLSAgICBJTiAgVUlOVCAgICAgICB1Q291bnRyeUNvZGVJZHgsCi0gICAgT1VUIFBCWVRFICAgICAgcGJ5Q2hhbm5lbFRhYmxlCisgICAgIFVJTlQgICAgICAgdUNvdW50cnlDb2RlSWR4LAorICAgIFBCWVRFICAgICAgcGJ5Q2hhbm5lbFRhYmxlCiAgICAgKTsKIAotVk9JRAordm9pZAogQ0FSRHZTZXRDb3VudHJ5SUUoCi0gICAgSU4gUFZPSUQgICAgICAgIHBEZXZpY2VIYW5kbGVyLAotICAgIElOIFBWT0lEICAgICAgICBwSUUKKyAgICB2b2lkICpwRGV2aWNlSGFuZGxlciwKKyAgICB2b2lkICpwSUUKICAgICApOwogCiBCT09MCiBDQVJEYkdldENoYW5uZWxNYXBJbmZvKAotICAgIElOIFBWT0lEICAgICAgICBwRGV2aWNlSGFuZGxlciwKLSAgICBJTiBVSU5UICAgICAgICAgdUNoYW5uZWxJbmRleCwKLSAgICBPVVQgUEJZVEUgICAgICAgcGJ5Q2hhbm5lbE51bWJlciwKLSAgICBPVVQgUEJZVEUgICAgICAgcGJ5TWFwCisgICAgdm9pZCAqcERldmljZUhhbmRsZXIsCisgICAgVUlOVCAgICAgICAgIHVDaGFubmVsSW5kZXgsCisgICAgUEJZVEUgICAgICAgcGJ5Q2hhbm5lbE51bWJlciwKKyAgICBQQllURSAgICAgICBwYnlNYXAKICAgICApOwogCi1WT0lECit2b2lkCiBDQVJEdlNldENoYW5uZWxNYXBJbmZvKAotICAgIElOIFBWT0lEICAgICAgICBwRGV2aWNlSGFuZGxlciw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ZXRpbWU7CiAgICAgc3RydWN0IHNrX2J1ZmYqIHNrYjsKICAgICBQQllURSAgICAgICAgICAgcGJ5UnhCdWZmZXI7CkBAIC00ODQsNyArNDg0LDcgQEAKICAgIEJZVEUgICAgICAgICAgICAgICAgICAgICAgICBieU9yaWdpbmFsWm9uZXR5cGU7CiAgICAgQllURSAgICAgICAgICAgICAgICAgICAgICAgIGFieU1hY0NvbnRleHRbTUFDX01BWF9DT05URVhUX1JFR107CiAgICAgQk9PTCAgICAgICAgICAgICAgICAgICAgICAgIGJMaW5rUGFzczsgICAgICAgICAgLy8gbGluayBzdGF0dXM6IE9LIG9yIGZhaWwKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICAgICAgYWJ5Q3VycmVudE5ldEFkZHJbVV9FVEhFUl9BRERSX0xFTl07CisgICAgQllURSAgICAgICAgICAgICAgICAgICAgICAgIGFieUN1cnJlbnROZXRBZGRyW0VUSF9BTEVOXTsKIAogICAgIC8vIEFkYXB0ZXIgc3RhdGlzdGljcwogICAgIFNTdGF0Q291bnRlciAgICAgICAgICAgICAgICBzY1N0YXRpc3RpYzsKQEAgLTU0Niw4ICs1NDYsOCBAQAogICAgIEJZVEUgICAgICAgICAgICAgICAgICAgICAgICBieU9wTW9kZTsKICAgICBCT09MICAgICAgICAgICAgICAgICAgICAgICAgYkJTU0lERmlsdGVyOwogICAgIFdPUkQgICAgICAgICAgICAgICAgICAgICAgICB3TWF4VHJhbnNtaXRNU0RVTGlmZXRpbWU7Ci0gICAgQllURSAgICAgICAgICAgICAgICAgICAgICAgIGFieUJTU0lEW1VfRVRIRVJfQUREUl9MRU5dOwotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgICAgICBhYnlEZXNpcmVCU1NJRFtVX0VUSEVSX0FERFJfTEVOXTsKKyAgICBCWVRFICAgICAgICAgICAgICAgICAgICAgICAgYWJ5QlNTSURbRVRIX0FMRU5dOworICAgIEJZVEUgICAgICAgICAgICAgICAgICAgICAgICBhYnlEZXNpcmVCU1NJRFtFVEhfQUxFTl07CiAgICAgV09SRCAgICAgICAgICAgICAgICAgICAgICAgIHdDVFNEdXJhdGlvbjsgICAgICAgLy8gdXBkYXRlIHdoaWxlIHNwZWVkIGNoYW5nZQogICAgIFdPUkQgICAgICAgICAgICAgICAgICAgICAgICB3QUNLRHVyYXRpb247ICAgICAgIC8vIHVwZGF0ZSB3aGlsZSBzcGVlZCBjaGFuZ2UKICAgICBXT1JEICAgICAgICAgICAgICAgICAgICAgICAgd1JUU1RyYW5zbWl0TGVuOyAgICAvLyB1cGRhdGUgd2hpbGUgc3BlZWQgY2hhbmdlCkBAIC03NTMsOSArNzUzLDkgQEAKIAogICAgIFNFdGhlcm5ldEhlYWRlciAgICAgICAgIHNUeEV0aEhlYWRlcjsKICAgICBTRXRoZXJuZXRIZWFkZXIgICAgICAgICBzUnhFdGhIZWFkZXI7Ci0gICAgQllURSAgICAgICAgICAgICAgICAgICAgYWJ5QnJvYWRjYXN0QWRkcltVX0VUSEVSX0FERFJfTEVOXTsKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICBhYnlTTkFQX1JGQzEwNDJbVV9FVEhFUl9BRERSX0xFTl07Ci0gICAgQllURSAgICAgICAgICAgICAgICAgICAgYWJ5U05BUF9CcmlkZ2V0dW5uZWxbVV9FVEhFUl9BRERSX0xFTl07CisgICAgQllURSAgICAgICAgICAgICAgICAgICAgYWJ5QnJvYWRjYXN0QWRkcltFVEhfQUxFTl07CisgICAgQllURSAgICAgICAgICAgICAgICAgICAgYWJ5U05BUF9SRkMxMDQyW0VUSF9BTEVOXTsKKyAgICBCWVRFICAgICAgICAgICAgICAgICAgICBhYnlTTkFQX0JyaWRnZXR1bm5lbFtFVEhfQUxFTl07CiAgICAgIEJZVEUgICAgICAgICAgICAgICAgICAgICAgICBhYnlFRVBST01bRUVQX01BWF9DT05URVhUX1NJWkVdOyAgLy9EV09SRCBhbGlnbm1lbnQKICAgICAvLyBQcmUtQXV0aGVudGljYXRpb24gJiBQTUsg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YgKGRldikKLSAgICAgICAgaG9zdGFwX3NldF9ob3N0YXBkKHBEZXZpY2UsIDAsIDApOworICAgICAgICB2dDY2NTVfaG9zdGFwX3NldF9ob3N0YXBkKHBEZXZpY2UsIDAsIDApOwogI2VuZGlmCiAgICAgaWYgKGRldikKICAgICAgICAgdW5yZWdpc3Rlcl9uZXRkZXYoZGV2KTsKIAogICAgIGlmIChwRGV2aWNlLT5Qb3J0T2Zmc2V0KQotICAgICAgICBpb3VubWFwKChQVk9JRClwRGV2aWNlLT5Qb3J0T2Zmc2V0KTsKKyAgICAgICAgaW91bm1hcCgodm9pZCAqKXBEZXZpY2UtPlBvcnRPZmZzZXQpOwogCiAgICAgaWYgKHBEZXZpY2UtPnBjaWQpCiAgICAgICAgIHBjaV9yZWxlYXNlX3JlZ2lvbnMocERldmljZS0+cGNpZCk7CkBAIC0xNDYwLDcgKzE0NjMsNyBAQAogCiAgICAgICAgIGRldl9rZnJlZV9za2IocFJESW5mby0+c2tiKTsKIAotICAgICAgICBrZnJlZSgoUFZPSUQpcERlc2MtPnBSREluZm8pOworICAgICAgICBrZnJlZSgodm9pZCAqKXBEZXNjLT5wUkRJbmZvKTsKICAgICB9CiAKIH0KQEAgLTE0NzgsNyArMTQ4MSw3IEBACiAKICAgICAgICAgZGV2X2tmcmVlX3NrYihwUkRJbmZvLT5za2IpOwogCi0gICAgICAgIGtmcmVlKChQVk9JRClwRGVzYy0+cFJESW5mbyk7CisgICAgICAgIGtmcmVlKCh2b2lkICopcERlc2MtPnBSREluZm8pOwogICAgIH0KIAogfQpAQCAtMTU2Myw3ICsxNTY2LDcgQEAKICAgICAgICAgaWYgKHBUREluZm8tPnNrYikKICAgICAgICAgICAgIGRldl9rZnJlZV9za2IocFRESW5mby0+c2tiKTsKIAotICAgICAgICBrZnJlZSgoUFZPSUQpcERlc2MtPnBUREluZm8pOworICAgICAgICBrZnJlZSgodm9pZCAqKXBEZXNjLT5wVERJbmZvKTsKICAgICB9CiB9CiAKQEAgLTE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worICAgIERlc2NyaXB0b3JfdHlwZSA9IHNrYi0+ZGF0YVtFVEhfSExFTisxKzErMl07CisgICAgS2V5X2luZm8gPSAoc2tiLT5kYXRhW0VUSF9ITEVOKzErMSsyKzFdIDw8IDgpfChza2ItPmRhdGFbRVRIX0hMRU4rMSsxKzIrMl0pOwogICAgaWYgKHBEZXZpY2UtPnNUeEV0aEhlYWRlci53VHlwZSA9PSBUWVBFX1BLVF84MDJfMXgpIHsKICAgICAgICAgICAgaWYoKChQcm90b2NvbF9WZXJzaW9uPT0xKSB8fChQcm90b2NvbF9WZXJzaW9uPT0yKSkgJiYKIAkgICAgICAgIChQYWNrZXRfVHlwZT09MykpIHsgIC8vODAyLjF4IE9SIGVhcG9sLWtleSBjaGFsbGVuZ2UgZnJhbWUgdHJhbnNmZXIKQEAgLTI4NTcsNyArMjg2MCw3IEBACiAKICAgICAgICAgICAgIHBEZXZpY2UtPmJCZWFjb25TZW50ID0gRkFMU0U7CiAgICAgICAgICAgICBpZiAocERldmljZS0+YkVuYWJsZVBTTW9kZSkgewotICAgICAgICAgICAgICAgIFBTYklzTmV4dFRCVFRXYWtlVXAoKEhBTkRMRSlwRGV2aWNlKTsKKyAgICAgICAgICAgICAgICBQU2JJc05leHRUQlRUV2FrZVVwKCh2b2lkICopcERldmljZSk7CiAgICAgICAgICAgICB9OwogCiAgICAgICAgICAgICBpZiAoKHBEZXZpY2UtPmVPUE1vZGUgPT0gT1BfTU9ERV9BUCkgfHwKQEAgLTI4OTAsNyArMjg5Myw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBjaGVjayBpZiBtdXRsdGNhc3QgdHggYnVmZmVycmluZwogICAgICAgICAgICAgICAgICAgICAgICAgcE1nbXQtPmJ5RFRJTUNvdW50ID0gcE1nbXQtPmJ5RFRJTVBlcmlvZCAtIDE7CiAgICAgICAgICAgICAgICAgICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlWzBdLmJSeFBTUG9sbCA9IFRSVUU7Ci0g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BzdGF0aWMgQk9PTCBzX2JIYW5kbGVSeEVuY3J5cHRpb24oCi0gICAgSU4gUFNEZXZpY2UgICAgIHBEZXZpY2UsCi0gICAgSU4gUEJZVEUgICAgICAgIHBieUZyYW1lLAotICAgIElOIFVJTlQgICAgICAgICBGcmFtZVNpemUsCi0gICAgSU4gUEJZVEUgICAgICAgIHBieVJzciwKLSAgICBPVVQgUEJZVEUgICAgICAgcGJ5TmV3UnNyLAotICAgIE9VVCBQU0tleUl0ZW0gICAqcEtleU91dCwKKyAgICBQU0RldmljZSAgICAgcERldmljZSwKKyAgICBQQllURSAgICAgICAgcGJ5RnJhbWUsCisgICAgVUlOVCAgICAgICAgIEZyYW1lU2l6ZSwKKyAgICBQQllURSAgICAgICAgcGJ5UnNyLAorICAgIFBCWVRFICAgICAgIHBieU5ld1JzciwKKyAgICBQU0tleUl0ZW0gICAqcEtleU91dCwKICAgICBpbnQgKiAgICAgICBwYkV4dElWLAotICAgIE9VVCBQV09SRCAgICAgICBwd1J4VFNDMTVfMCwKLSAgICBPVVQgUERXT1JEICAgICAgcGR3UnhUU0M0N18xNgorICAgIFBXT1JEICAgICAgIHB3UnhUU0MxNV8wLAorICAgIFBEV09SRCAgICAgIHBkd1J4VFNDNDdfMTYKICAgICApOwogCiBzdGF0aWMgQk9PTCBzX2JIb3N0V2VwUnhFbmNyeXB0aW9uKAogCi0gICAgSU4gUFNEZXZpY2UgICAgIHBEZXZpY2UsCi0gICAgSU4gUEJZVEUgICAgICAgIHBieUZyYW1lLAotICAgIElOIFVJTlQgICAgICAgICBGcmFtZVNpemUsCi0gICAgSU4gUEJZVEUgICAgICAgIHBieVJzciwKLSAgICBJTiBCT09MICAgICAgICAgYk9uRmx5LAotICAgIElOIFBTS2V5SXRlbSAgICBwS2V5LAotICAgIE9VVCBQQllURSAgICAgICBwYnlOZXdSc3IsCisgICAgUFNEZXZpY2UgICAgIHBEZXZpY2UsCisgICAgUEJZVEUgICAgICAgIHBieUZyYW1lLAorICAgIFVJTlQgICAgICAgICBGcmFtZVNpemUsCisgICAgUEJZVEUgICAgICAgIHBieVJzciwKKyAgICBCT09MICAgICAgICAgYk9uRmx5LAorICAgIFBTS2V5SXRlbSAgICBwS2V5LAorICAgIFBCWVRFICAgICAgIHBieU5ld1JzciwKICAgICBpbnQgKiAgICAgICBwYkV4dElWLAotICAgIE9VVCBQV09SRCAgICAgICBwd1J4VFNDMTVfMCwKLSAgICBPVVQgUERXT1JEICAgICAgcGR3UnhUU0M0N18xNgorICAgIFBXT1JEICAgICAgIHB3UnhUU0MxNV8wLAorICAgIFBEV09SRCAgICAgIHBkd1J4VFNDNDdfMTYKIAogICAgICk7CiAKQEAgLTE2MywxNCArMTYzLDE0IEBACiAgKgogLSovCiBzdGF0aWMKLVZPSUQKK3ZvaWQKIHNfdlByb2Nlc3NSeE1BQ0hlYWRlciAoCi0gICAgSU4gIFBTRGV2aWNlIHBEZXZpY2UsCi0gICAgSU4gIFBCWVRFIHBieVJ4QnVmZmVyQWRkciwKLSAgICBJTiAgVUlOVCBjYlBhY2tldFNpemUsCi0gICAgSU4gIEJPT0wgYklzV0VQLAotICAgIElOICBCT09MIGJFeHRJViwKLSAgICBPVVQgUFVJTlQgcGNiSGVhZFNpemUKKyAgICBQU0RldmljZSBwRGV2aWNlLAorICAgIFBCWVRFIHBieVJ4QnVmZmVyQWRkciwKKyAgICBVSU5UIGNiUGFja2V0U2l6ZSwKKyAgICBCT09MIGJJc1dFUCwKKyAgICBCT09MIGJFeHRJViwKKyAgICBQVUlOVCBwY2JIZWFkU2l6ZQogICAgICkKIHsKICAgICBQQllURSAgICAgICAgICAgcGJ5UnhCdWZmZXI7CkBAIC0yMzYsMTEgKzIzNiwxMSBAQAogICAgICAgICB9CiAgICAgfQogCi0gICAgY2JIZWFkZXJTaXplIC09IChVX0VUSEVSX0FERFJfTEVOICogMik7CisgICAgY2JIZWFkZXJTaXplIC09IChFVEhfQUxFTiAqIDIpOwogICAgIHBieVJ4QnVmZmVyID0gKFBC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GcmFtZUN0bCAmIEZDX1RPRFMpID09IDApIHsKICAgICAgICAgaWYgKHBNQUNIZWFkZXItPndGcmFtZUN0bCAmIEZDX0ZST01EUykgewotICAgICAgICAgICAgZm9yKGlpPTA7aWk8VV9FVEhFUl9BRERSX0xFTjtpaSsrKSB7CisgICAgICAgICAgICBmb3IoaWk9MDtpaTxFVEhfQUxFTjtpaSsrKSB7CiAgICAgICAgICAgICAgICAgcHNFdGhIZWFkZXItPmFieURzdEFkZHJbaWldID0gcE1BQ0hlYWRlci0+YWJ5QWRkcjFbaWldOwogICAgICAgICAgICAgICAgIHBzRXRoSGVhZGVyLT5hYnlTcmNBZGRyW2lpXSA9IHBNQUNIZWFkZXItPmFieUFkZHIzW2lpXTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgICAgICBlbHNlIHsKICAgICAgICAgICAgIC8vIElCU1MgbW9kZQotICAgICAgICAgICAgZm9yKGlpPTA7aWk8VV9FVEhFUl9BRERSX0xFTjtpaSsrKSB7CisgICAgICAgICAgICBmb3IoaWk9MDtpaTxFVEhfQUxFTjtpaSsrKSB7CiAgICAgICAgICAgICAgICAgcHNFdGhIZWFkZXItPmFieURzdEFkZHJbaWldID0gcE1BQ0hlYWRlci0+YWJ5QWRkcjFbaWldOwogICAgICAgICAgICAgICAgIHBzRXRoSGVhZGVyLT5hYnlTcmNBZGRyW2lpXSA9IHBNQUNIZWFkZXItPmFieUFkZHIyW2lpXTsKICAgICAgICAgICAgIH0KQEAgLTI5MywxNCArMjkzLDE0IEBACiAgICAgZWxzZSB7CiAgICAgICAgIC8vIElzIEFQIG1vZGUuLgogICAgICAgICBpZiAocE1BQ0hlYWRlci0+d0ZyYW1lQ3RsICYgRkNfRlJPTURTKSB7Ci0gICAgICAgICAgICBmb3IoaWk9MDtpaTxVX0VUSEVSX0FERFJfTEVOO2lpKyspIHsKKyAgICAgICAgICAgIGZvcihpaT0wO2lpPEVUSF9BTEVOO2lpKyspIHsKICAgICAgICAgICAgICAgICBwc0V0aEhlYWRlci0+YWJ5RHN0QWRkcltpaV0gPSBwTUFDSGVhZGVyLT5hYnlBZGRyM1tpaV07CiAgICAgICAgICAgICAgICAgcHNFdGhIZWFkZXItPmFieVNyY0FkZHJbaWldID0gcE1BQ0hlYWRlci0+YWJ5QWRkcjRbaWldOwogICAgICAgICAgICAgICAgIGNiSGVhZGVyU2l6ZSArPSA2OwogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgICAgIGVsc2UgewotICAgICAgICAgICAgZm9yKGlpPTA7aWk8VV9FVEhFUl9BRERSX0xFTjtpaSsrKSB7CisgICAgICAgICAgICBmb3IoaWk9MDtpaTxFVEhfQUxFTjtpaSsrKSB7CiAgICAgICAgICAgICAgICAgcHNFdGhIZWFkZXItPmFieURzdEFkZHJbaWldID0gcE1BQ0hlYWRlci0+YWJ5QWRkcjNbaWldOwogICAgICAgICAgICAgICAgIHBzRXRoSGVhZGVyLT5hYnlTcmNBZGRyW2lpXSA9IHBNQUNIZWFkZXItPmFieUFkZHIyW2lpXTsKICAgICAgICAgICAgIH0KQEAgLTMxNCw3ICszMTQsNyBAQAogCiAvL1BMSUNFX0RFQlVHIC0+CiAKLVZPSUQJTW5nV29ya0l0ZW0oUFZPSUQgQ29udGV4dCkKK3ZvaWQJTW5nV29ya0l0ZW0odm9pZCAqQ29udGV4dCkKIHsKIAlQU1J4TWdtdFBhY2tldAkJCXBSeE1nbXRQYWNrZXQ7CiAJUFNEZXZpY2UJcERldmljZSA9ICAoUFNEZXZpY2UpIENvbnRleHQ7CkBAIC0zMzUsOCArMzM1LDggQEAKIAogQk9PTAogZGV2aWNlX3JlY2VpdmVfZnJhbWUgKAotICAgIElOICBQU0RldmljZSBwRGV2aWNlLAotICAgIElOICBQU1J4RGVzYyBwQ3VyclJECisgICAgUFNEZXZpY2UgcERldmljZSwKKyAgICBQU1J4RGVzYyBwQ3VyclJECiAgICAgKQogewogCkBAIC01NjksNyArNTY5LDcgQEAKICAgICAvLyBSWCBPSwogICA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KzEwMzksOSBAQAogCiAKIHN0YXRpYyBCT09MIHNfYkFQTW9kZVJ4Q3RsICgKLSAgICBJTiBQU0RldmljZSBwRGV2aWNlLAotICAgIElOIFBCWVRFICAgIHBieUZyYW1lLAotICAgIElOIElOVCAgICAgIGlTQU5vZGVJbmRleAorICAgIFBTRGV2aWNlIHBEZXZpY2UsCisgICAgUEJZVEUgICAgcGJ5RnJhbWUsCisgICAgSU5UICAgICAgaVNBTm9kZUluZGV4CiAgICAgKQogewogICAgIFBTODAyXzExSGVhZGVyICAgICAgcDgwMl8xMUhlYWRlcjsKQEAgLTEwODcsNyArMTA4Nyw3IEBACiAgICAgICAgICAgICAgICAgICAgIC8vIGRlbGNhcmUgcmVjZWl2ZWQgcHMtcG9sbCBldmVudAogICAgICAgICAgICAgICAgICAgICBpZiAoSVNfQ1RMX1BTUE9MTChwYnlGcmFtZSkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIHBNZ210LT5zTm9kZURCVGFibGVbaVNBTm9kZUluZGV4XS5iUnhQU1BvbGwgPSBUUlVFOwotICAgICAgICAgICAgICAgICAgICAgICAgYlNjaGVkdWxlQ29tbWFuZCgoSEFORExFKXBEZXZpY2UsIFdMQU5fQ01EX1JYX1BTUE9MTCwgTlVMTCk7CisgICAgICAgICAgICAgICAgICAgICAgICBiU2NoZWR1bGVDb21tYW5kKCh2b2lkICopcERldmljZSwgV0xBTl9DTURfUlhfUFNQT0xMLCBOVUxMKTsKICAgICAgICAgICAgICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8gImRwYzogV0xBTl9DTURfUlhfUFNQT0xMIDFcbiIpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIGVsc2UgewpAQCAtMTA5Niw3ICsxMDk2LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghSVNfRkNfUE9XRVJNR1QocGJ5RnJhbWUpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1nbXQtPnNOb2RlREJUYWJsZVtpU0FOb2RlSW5kZXhdLmJQU0VuYWJsZSA9IEZBTFNFOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNZ210LT5zTm9kZURCVGFibGVbaVNBTm9kZUluZGV4XS5iUnhQU1BvbGwgPSBUUlVFOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJTY2hlZHVsZUNvbW1hbmQoKEhBTkRMRSlwRGV2aWNlLCBXTEFOX0NNRF9SWF9QU1BPTEwsIE5VTEwpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJTY2hlZHVsZUNvbW1hbmQoKHZvaWQgKilwRGV2aWNlLCBXTEFOX0NNRF9SWF9QU1BPTEwsIE5VTEwpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8gImRwYzogV0xBTl9DTURfUlhfUFNQT0xMIDJcbiIpOwogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICB9CkBAIC0xMTEyLDcgKzExMTIsNyBAQAogICAgICAgICAgICAgICAgICAgICAgIGlmIChwTWdtdC0+c05vZGVEQlRhYmxlW2lTQU5vZGVJbmRleF0ud0VuUXVldWVDbnQgPiAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNZ210LT5zTm9kZURCVGFibGVbaVNBTm9kZUluZGV4XS5iUFNFbmFibGUgPSBGQUxTRTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1nbXQtPnNOb2RlREJUYWJsZVtpU0FOb2RlSW5kZXhdLmJSeFBTUG9sbCA9IFRSVUU7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgIGJTY2hlZHVsZUNvbW1hbmQoKEhBTkRMRSlwRGV2aWNlLCBXTEFOX0NNRF9SWF9QU1BPTEwsIE5VTEwpOworICAgICAgICAgICAgICAgICAgICAgICAgICBiU2NoZWR1bGVDb21tYW5kKCh2b2lkICopcERldmljZSwgV0xBTl9DTURfUlhfUFNQT0xMLCBOVUxMKTsKICAgICAgICAgICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPICJkcGM6IFdMQU5fQ01EX1JYX1BTUE9MTCAzXG4iKTsKIAogICAgICAgICAgICAgICAgICAgICAgIH0KQEAgLTExNjMsMTUgKzExNjMsMTUgQEAKIH0KIAogc3RhdGljIEJPT0wgc19iSGFuZGxlUnhFbmNyeXB0aW9uICgKLSAgICBJTiBQU0RldmljZSAgICAgcERldmljZSwKLSAgICBJTiBQQllURSAgICAgICAgcGJ5RnJhbWUsCi0gICAgSU4gVUlOVCAgICAgICAgIEZyYW1lU2l6ZSwKLSAgICBJTiBQQllURSAgICAgICAgcGJ5UnNyLAotICAgIE9VVCBQQllURSAgICAgICBwYnlOZXdSc3IsCi0gICAgT1VUIFBTS2V5SXRlbSAgICpwS2V5T3V0LAorICAgIFBTRGV2aWNlICAgICBwRGV2aWNlLAorICAgIFBCWVRFICAgICAgICBwYnlGcmFtZSwKKyAgICBVSU5UICAgICAgICAgRnJhbWVTaXplLAorICAgIFBCWVRFICAgICAgICBwYnlSc3IsCisgICAgUEJZVEUgICAgICAgcGJ5TmV3UnNyLAorICAgIFBTS2V5SXRlbSAgICpwS2V5T3V0LAogICAgIGludCAqICAgICAgIHBiRXh0SVYsCi0gICAgT1VUIFBXT1JEICAgICAgIHB3UnhUU0MxNV8wLAotICAgIE9VVCBQRFdPUkQgICAgICBwZHdSeFRTQzQ3XzE2CisgICAgUFdPUkQgICAgICAgcHdSeFRTQzE1XzAsCisgICAgUERXT1JEICAgICAgcGR3UnhUU0M0N18xNgogICAgICkKIHsKICAgICBVSU5UICAgICAgICAgICAgUGF5bG9hZExlbiA9IEZyYW1lU2l6ZTsKQEAgLTEzMDksMTYgKzEzMDksMTYgQEAKIAogCiBzdGF0aWMgQk9PTCBzX2JIb3N0V2VwUnhFbmNyeXB0aW9uICgKLSAgICBJTiBQU0RldmljZSAgICAgcERldmljZSwKLSAgICBJTiBQQllURSAgICAgICAgcGJ5RnJhbWUsCi0gICAgSU4gVUlOVCAgICAgICAgIEZyYW1lU2l6ZSwKLSAgICBJTiBQQllURSAgICAgICAgcGJ5UnNyLAotICAgIElOIEJPT0wgICAgICAgICBiT25GbHksCi0gICAgSU4gUFNLZXlJdGVtICAgIHBLZXksCi0gICAgT1VUIFBCWVRFICAgICAgIHBieU5ld1JzciwKKyAgICBQU0RldmljZSAgICAgcERldmljZSwKKyAgICBQQllURSAgICAgICAgcGJ5RnJhbWUsCisgICAgVUlOVCAgICAgICAgIEZyYW1lU2l6ZSwKKyAgICBQQllURSAgICAgICAgcGJ5UnNyLAorICAgIEJPT0wgICAgICAgICBiT25GbHksCisgICAgUFNLZXlJdGVtICAgIHBLZXksCisgICAgUEJZVEUgICAgICAgcGJ5TmV3UnNyLAogICAgIGludCAqICAgICAgIHBiRXh0SVYsCi0gICAgT1VUIFBXT1JEICAgICAgIHB3UnhUU0MxNV8wLAotICAgIE9VVCBQRFdPUkQgICAgICBwZHdSeFRTQzQ3XzE2CisgICAgUFdPUkQgICAgICAgcHdSeFRTQzE1XzAsCisgICAgUERXT1JEICAgICAgcGR3UnhUU0M0N18xNgogICAgICkKIHsKICAgICBVSU5UICAgICAgICAgICAgUGF5bG9hZExlbiA9IEZyYW1lU2l6ZTsKQEAgLTE0NDAsMTIgKzE0NDAsMTIgQEAKIAogCiBzdGF0aWMgQk9PTCBzX2JBUE1vZGVSeERhdGEgKAotICAgIElOIFBTRGV2aWNlIHBEZXZpY2UsCi0gICAgSU4gc3RydWN0IHNrX2J1ZmYqIHNrYiwKLSAgICBJTiBVSU5UICAgICBGcmFtZVNpemUsCi0gICAgSU4gVUlOVCAgICAgY2JIZWFkZXJPZmZzZXQsCi0gICAgSU4gSU5UICAgICAgaVNBTm9kZUluZGV4LAotICAgIElOIElOVCAgICAgIGlEQU5vZGVJbmRleAorICAgIFBTRGV2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gcFRhYmxlLAotICAgIElOICBQQllURSAgICAgICAgICAgcGJ5QlNTSUQsCi0gICAgSU4gIERXT1JEICAgICAgICAgICBkd0tleUluZGV4LAotICAgIE9VVCBQU0tleUl0ZW0gICAgICAgKnBLZXkKKyAgICBQU0tleU1hbmFnZW1lbnQgcFRhYmxlLAorICAgIFBCWVRFICAgICAgICAgICBwYnlCU1NJRCwKKyAgICBEV09SRCAgICAgICAgICAgZHdLZXlJbmRleCwKKyAgICBQU0tleUl0ZW0gICAgICAgKnBLZXkKICAgICApCiB7CiAgICAgaW50IGk7CkBAIC0yODEsNyArMjgxLDcgQEAKICAgICAgICAgfQogICAgIH0KICAgICBpZiAoaiA8IChNQVhfS0VZX1RBQkxFLTEpKSB7Ci0gICAgICAgIG1lbWNweShwVGFibGUtPktleVRhYmxlW2pdLmFieUJTU0lELHBieUJTU0lELFVfRVRIRVJfQUREUl9MRU4pOworICAgICAgICBtZW1jcHkocFRhYmxlLT5LZXlUYWJsZVtqXS5hYnlCU1NJRCxwYnlCU1NJRCxFVEhfQUxFTik7CiAgICAgICAgIHBUYWJsZS0+S2V5VGFibGVbal0uYkluVXNlID0gVFJVRTsKICAgICAgICAgaWYgKChkd0tleUluZGV4ICYgUEFJUldJU0VfS0VZKSAhPSAwKSAgewogICAgICAgICAgICAgLy8gUGFpcndpc2Uga2V5CkBAIC00NzAsNyArNDcwLDcgQEAKICAqIFJldHVybiBWYWx1ZTogVFJVRSBpZiBzdWNjZXNzIG90aGVyd2lzZSBGQUxTRQogICoKICAqLwotVk9JRCBLZXl2UmVtb3ZlV0VQS2V5ICgKK3ZvaWQgS2V5dlJlbW92ZVdFUEtleSAoCiAgICAgUFNLZXlNYW5hZ2VtZW50IHBUYWJsZSwKICAgICBEV09SRCAgICAgICAgICAgZHdLZXlJbmRleCwKICAgICBEV09SRF9QVFIgICAgICAgZHdJb0Jhc2UKQEAgLTQ5Miw3ICs0OTIsNyBAQAogICAgIHJldHVybjsKIH0KIAotVk9JRCBLZXl2UmVtb3ZlQWxsV0VQS2V5ICgKK3ZvaWQgS2V5dlJlbW92ZUFsbFdFUEtleSAoCiAgICAgUFNLZXlNYW5hZ2VtZW50IHBUYWJsZSwKICAgICBEV09SRF9QVFIgICAgICAgZHdJb0Jhc2UKICAgICApCkBAIC01MTgsMTAgKzUxOCwxMCBAQAogICoKICAqLwogQk9PTCBLZXliR2V0VHJhbnNtaXRLZXkgKAotICAgIElOICBQU0tleU1hbmFnZW1lbnQgcFRhYmxlLAotICAgIElOICBQQllURSAgICAgICAgICAgcGJ5QlNTSUQsCi0gICAgSU4gIERXT1JEICAgICAgICAgICBkd0tleVR5cGUsCi0gICAgT1VUIFBTS2V5SXRlbSAgICAgICAqcEtleQorICAgIFBTS2V5TWFuYWdlbWVudCBwVGFibGUsCisgICAgUEJZVEUgICAgICAgICAgIHBieUJTU0lELAorICAgIERXT1JEICAgICAgICAgICBkd0tleVR5cGUsCisgICAgUFNLZXlJdGVtICAgICAgICpwS2V5CiAgICAgKQogewogICAgIGludCBpLCBpaTsKQEAgLTU5OCw4ICs1OTgsOCBAQAogICoKICAqLwogQk9PTCBLZXliQ2hlY2tQYWlyZXdpc2VLZXkgKAotICAgIElOICBQU0tleU1hbmFnZW1lbnQgcFRhYmxlLAotICAgIE9VVCBQU0tleUl0ZW0gICAgICAgKnBLZXkKKyAgICBQU0tleU1hbmFnZW1lbnQgcFRhYmxlLAorICAgIFBTS2V5SXRlbSAgICAgICAqcEtleQogICAgICkKIHsKICAgICBpbnQgaTsKQEAgLTY1Niw3ICs2NTYsNyBAQAogICAgIH0KIAogICAgIHBUYWJsZS0+S2V5VGFibGVbTUFYX0tFWV9UQUJMRS0xXS5iSW5Vc2UgPSBUUlVFOwotICAgIGZvcihpaT0wO2lpPFVfRVRIRVJfQUREUl9MRU47aWkrKykKKyAgICBmb3IoaWk9MDtpaTxFVEhfQUxFTjtpaSsrKQogICAgICAgICBwVGFibGUtPktleVRhYmxlW01BWF9LRVlfVEFCTEUtMV0uYW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UYWJsZSwgRFdPUkRfUFRSIGR3SW9CYXNlKTsKK3ZvaWQgS2V5dkluaXRUYWJsZShQU0tleU1hbmFnZW1lbnQgcFRhYmxlLCBEV09SRF9QVFIgZHdJb0Jhc2UpOwogCiBCT09MIEtleWJHZXRLZXkoCi0gICAgSU4gIFBTS2V5TWFuYWdlbWVudCBwVGFibGUsCi0gICAgSU4gIFBCWVRFICAgICAgICAgICBwYnlCU1NJRCwKLSAgICBJTiAgRFdPUkQgICAgICAgICAgIGR3S2V5SW5kZXgsCi0gICAgT1VUIFBTS2V5SXRlbSAgICAgICAqcEtleQorICAgIFBTS2V5TWFuYWdlbWVudCBwVGFibGUsCisgICAgUEJZVEUgICAgICAgICAgIHBieUJTU0lELAorICAgIERXT1JEICAgICAgICAgICBkd0tleUluZGV4LAorICAgIFBTS2V5SXRlbSAgICAgICAqcEtleQogICAgICk7CiAKIEJPT0wgS2V5YlNldEtleSgKQEAgLTE0MSwxNSArMTQxLDE1IEBACiAgICAgKTsKIAogQk9PTCBLZXliR2V0VHJhbnNtaXRLZXkoCi0gICAgSU4gIFBTS2V5TWFuYWdlbWVudCBwVGFibGUsCi0gICAgSU4gIFBCWVRFICAgICAgICAgICBwYnlCU1NJRCwKLSAgICBJTiAgRFdPUkQgICAgICAgICAgIGR3S2V5VHlwZSwKLSAgICBPVVQgUFNLZXlJdGVtICAgICAgICpwS2V5CisgICAgUFNLZXlNYW5hZ2VtZW50IHBUYWJsZSwKKyAgICBQQllURSAgICAgICAgICAgcGJ5QlNTSUQsCisgICAgRFdPUkQgICAgICAgICAgIGR3S2V5VHlwZSwKKyAgICBQU0tleUl0ZW0gICAgICAgKnBLZXkKICAgICApOwogCiBCT09MIEtleWJDaGVja1BhaXJld2lzZUtleSgKLSAgICBJTiAgUFNLZXlNYW5hZ2VtZW50IHBUYWJsZSwKLSAgICBPVVQgUFNLZXlJdGVtICAgICAgICpwS2V5CisgICAgUFNLZXlNYW5hZ2VtZW50IHBUYWJsZSwKKyAgICB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YWwKKyAgICB2b2lkICpoRGV2aWNlQ29udGV4dCwKKyAgICBXT1JEIHdMaXN0ZW5JbnRlcnZhbAogICAgICkKIHsKICAgICBQU0RldmljZSAgICAgICAgcERldmljZSA9IChQU0RldmljZSloRGV2aWNlQ29udGV4dDsKQEAgLTExOCw3ICsxMTgsNyBAQAogICAgIHBEZXZpY2UtPmJFbmFibGVQU01vZGUgPSBUUlVFOwogCiAgICAgaWYgKHBEZXZpY2UtPmVPUE1vZGUgPT0gT1BfTU9ERV9BREhPQykgewotLy8gICAgICAgIGJNZ3JQcmVwYXJlQmVhY29uVG9TZW5kKChIQU5ETEUpcERldmljZSwgcE1nbXQpOworLy8gICAgICAgIGJNZ3JQcmVwYXJlQmVhY29uVG9TZW5kKCh2b2lkICopcERldmljZSwgcE1nbXQpOwogICAgIH0KICAgICAvLyBXZSBkb24ndCBzZW5kIG51bGwgcGt0IGluIGFkIGhvYyBtb2RlIHNpbmNlIGJlYWNvbiB3aWxsIGhhbmRsZSB0aGlzLgogICAgIGVsc2UgaWYgKHBEZXZpY2UtPmVPUE1vZGUgPT0gT1BfTU9ERV9JTkZSQVNUUlVDVFVSRSkgewpAQCAtMTQ0LDkgKzE0NCw5IEBACiAgKgogLSovCiAKLVZPSUQKK3ZvaWQKIFBTdkRpc2FibGVQb3dlclNhdmluZygKLSAgICBJTiBIQU5ETEUgaERldmljZUNvbnRleHQKKyAgICB2b2lkICpoRGV2aWNlQ29udGV4dAogICAgICkKIHsKICAgICBQU0RldmljZSAgICAgICAgcERldmljZSA9IChQU0RldmljZSloRGV2aWNlQ29udGV4dDsKQEAgLTE4NCw5ICsxODQsOSBAQAogCiBCT09MCiBQU2JDb25zaWRlclBvd2VyRG93bigKLSAgICBJTiBIQU5ETEUgaERldmljZUNvbnRleHQsCi0gICAgSU4gQk9PTCBiQ2hlY2tSeERNQSwKLSAgICBJTiBCT09MIGJDaGVja0NvdW50VG9XYWtlVXAKKyAgICB2b2lkICpoRGV2aWNlQ29udGV4dC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L3Z0NjY1NS9yeHR4LmMKQEAgLTExNSw5MyArMTE1LDkzIEBACiAKIAogc3RhdGljCi1WT0lECit2b2lkCiBzX3ZGaWxsVHhLZXkoCi0gICAgSU4gIFBTRGV2aWNlICAgcERldmljZSwKLSAgICBJTiAgUEJZVEUgICAgICBwYnlCdWYsCi0gICAgSU4gIFBCWVRFICAgICAgcGJ5SVZIZWFkLAotICAgIElOICBQU0tleUl0ZW0gIHBUcmFuc21pdEtleSwKLSAgICBJTiAgUEJZVEUgICAgICBwYnlIZHJCdWYsCi0gICAgSU4gIFdPUkQgICAgICAgd1BheWxvYWRMZW4sCi0gICAgT1VUIFBCWVRFICAgICAgcE1JQ0hEUgorICAgIFBTRGV2aWNlICAgcERldmljZSwKKyAgICBQQllURSAgICAgIHBieUJ1ZiwKKyAgICBQQllURSAgICAgIHBieUlWSGVhZCwKKyAgICBQU0tleUl0ZW0gIHBUcmFuc21pdEtleSwKKyAgICBQQllURSAgICAgIHBieUhkckJ1ZiwKKyAgICBXT1JEICAgICAgIHdQYXlsb2FkTGVuLAorICAgIFBCWVRFICAgICAgcE1JQ0hEUgogICAgICk7CiAKIAogCiBzdGF0aWMKLVZPSUQKK3ZvaWQKIHNfdkZpbGxSVFNIZWFkKAotICAgIElOIFBTRGV2aWNlICAgICAgICAgcERldmljZSwKLSAgICBJTiBCWVRFICAgICAgICAgICAgIGJ5UGt0VHlwZSwKLSAgICBJTiBQVk9JRCAgICAgICAgICAgIHB2UlRTLAotICAgIElOIFVJTlQgICAgICAgICAgICAgY2JGcmFtZUxlbmd0aCwKLSAgICBJTiBCT09MICAgICAgICAgICAgIGJOZWVkQWNrLAotICAgIElOIEJPT0wgICAgICAgICAgICAgYkRpc0NSQywKLSAgICBJTiBQU0V0aGVybmV0SGVhZGVyIHBzRXRoSGVhZGVyLAotICAgIElOIFdPUkQgICAgICAgICAgICAgd0N1cnJlbnRSYXRlLAotICAgIElOIEJZVEUgICAgICAgICAgICAgYnlGQk9wdGlvbgorICAgIFBTRGV2aWNlICAgICAgICAgcERldmljZSwKKyAgICBCWVRFICAgICAgICAgICAgIGJ5UGt0VHlwZSwKKyAgICB2b2lkICogICAgICAgICAgIHB2UlRTLAorICAgIFVJTlQgICAgICAgICAgICAgY2JGcmFtZUxlbmd0aCwKKyAgICBCT09MICAgICAgICAgICAgIGJOZWVkQWNrLAorICAgIEJPT0wgICAgICAgICAgICAgYkRpc0NSQywKKyAgICBQU0V0aGVybmV0SGVhZGVyIHBzRXRoSGVhZGVyLAorICAgIFdPUkQgICAgICAgICAgICAgd0N1cnJlbnRSYXRlLAorICAgIEJZVEUgICAgICAgICAgICAgYnlGQk9wdGlvbgogICAgICk7CiAKIHN0YXRpYwotVk9JRAordm9pZAogc192R2VuZXJhdGVUeFBhcmFtZXRlcigKLSAgICBJTiBQU0RldmljZSAgICAgICAgIHBEZXZpY2UsCi0gICAgSU4gIEJZVEUgICAgICAgICAgICBieVBrdFR5cGUsCi0gICAgSU4gUFZPSUQgICAgICAgICAgICBwVHhCdWZIZWFkLAotICAgIElOIFBWT0lEICAgICAgICAgICAgcHZScnZUaW1lLAotICAgIElOIFBWT0lEICAgICAgICAgICAgcHZSVFMsCi0gICAgSU4gUFZPSUQgICAgICAgICAgICBwdkNUUywKLSAgICBJTiBVSU5UICAgICAgICAgICAgIGNiRnJhbWVTaXplLAotICAgIElOIEJPT0wgICAgICAgICAgICAgYk5lZWRBQ0ssCi0gICAgSU4gVUlOVCAgICAgICAgICAgICB1RE1BSWR4LAotICAgIElOIFBTRXRoZXJuZXRIZWFkZXIgcHNFdGhIZWFkZXIsCi0gICAgSU4gV09SRCAgICAgICAgICAgICB3Q3VycmVudFJhdGUKKyAgICBQU0RldmljZSAgICAgICAgIHBEZXZpY2UsCisgICAgQllURSAgICAgICAgICAgIGJ5UGt0VHlwZSwKKyAgICB2b2lkICogICAgICAgICAgIHBUeEJ1ZkhlYWQsCisgICAgdm9pZCAqICAgICAgICAgICBwdlJydlRpbWUsCisgICAgdm9pZCAqICAgICAgICAgICBwdlJUUywKKyAgICB2b2lkICogICAgICAgICAgIHB2Q1RTLAorICAgIFVJTlQgICAgICAgICAgICAgY2JGcmFtZVNpemUsCisgICAgQk9PTCAgICAgICAgICAgICBiTmVlZEFDSywKKyAgICBVSU5UICAgICAgICAgICAgIHVETUFJZHgsCisgICAgUFNFdGhlcm5ldEhlYWRlciBwc0V0aEhlYWRlciwKKyAgICBXT1JEICAgICAgICAgICAgIHdDdXJyZW50UmF0ZQogICAgICk7CiAKIAogCiBzdGF0aWMgdm9pZCBzX3ZGaWxsRnJhZ1BhcmFtZXRlcigKLSAgICBJTiBQU0RldmljZSBwRGV2aWNlLAotICAgIElOIFBCWVRFICAgIHBieUJ1ZmZlciwKLSAgICBJTiBVSU5UICAgICB1VHhUeXBlLAotICAgIElOIFBWT0lEICAgIHB2dGRDdXJyLAotICAgIElOIFdPUkQgICAgIHdGcmFnVHlwZSwKLSAgICBJTiBVSU5UICAgICBjYlJlcUNvdW50CisgICAgUFNEZXZpY2UgcERldmljZSwKKyAgICBQQllURSAgICBwYnlCdWZmZXIsCisgICAgVUlOVCAgICAgdVR4VHlwZSwKKyAgICB2b2lkICogICBwdnRkQ3VyciwKKyAgICBXT1JEICAgICB3RnJhZ1R5cGUsCisgICAgVUlOVCAgICAgY2JSZXFDb3VudAogICAgICk7CiAKIAogc3RhdGljCiBVSU5UCiBzX2NiRmlsbFR4QnVmSGVhZCAoCi0gICAgSU4gIFBTRGV2aWNlICAgICAgICAgcERldmljZSwKLSAgICBJTiAgQllURSAgICAgICAgICAgICBieVBrdFR5cGUsCi0gICAgSU4gIFBCWVRFICAgICAgICAgICAgcGJ5VHhCdWZmZXJBZGRyLAotICAgIElOICBVSU5UICAgICAgICAgICAgIGNiRnJhbWVCb2R5U2l6ZSwKLSAgICBJTiAgVUlOVCAgICAgICAgICAgICB1RE1BSWR4LAotICAgIElOICBQU1R4RGVzYyAgICAgICAgIHBIZWFkVEQsCi0gICAgSU4gIFBTRXRoZXJuZXRIZWFkZXIgcHNFdGhIZWFkZXIsCi0gICAgSU4gIFBCWVRFICAgICAgICAgICAgcFBhY2tldCwKLSAgICBJTiAgQk9PTCAgICAgICAgICAgICBiTmVlZEVuY3J5cHQsCi0gICAgSU4gIFBTS2V5SXRlbSAgICAgICAgcFRyYW5zbWl0S2V5LAotICAgIElOICBVSU5UICAgICAgICAgICAgIHVOb2RlSW5kZXgsCi0gICAgT1VUIFBVSU5UICAgICAgICAgICAgcHVNQUNmcmFnTnVtCisgICAgUFNEZXZpY2UgICAgICAgICBwRGV2aWNlLAorICAgIEJZVEUgICAgICAgICAgICAgYnlQa3RUeXBlLAorICAgIFBCWVRFICAgICAgICAgICAgcGJ5VHhCdWZmZXJBZGRyLAorICAgIFVJTlQgICAgICAgICAgICAgY2JGcmFtZUJvZHlTaXplLAorICAgIFVJTlQgICAgICAgICAgICAgdURNQUlkeCwKKyAgICBQU1R4RGVzYyAgICAgICAgIHBIZWFkVEQsCisgICAgUFNFdGhlcm5ldEhlYWRlciBwc0V0aEhlYWRlciwKKyAgICBQQllURSAgICAgICAgICAgIHBQYWNrZXQsCisgICAgQk9PTCAgICAgICAgICAgICBiTmVlZEVuY3J5cHQsCisgICAgUFNLZXlJdGVtICAgICAgICBwVHJhbnNtaXRLZXksCisgICAgVUlOVCAgICAgICAgICAgICB1Tm9kZUluZGV4LAorICAgIFBVSU5UICAgICAgICAgICAgcHVNQUNmcmFnTnVtCiAgICAgKTsKIAogCiBzdGF0aWMKIFVJTlQKIHNfdUZpbGxEYXRhSGVhZCAoCi0gICAgSU4gUFNEZXZpY2UgcERldmljZSwKLSAgICBJTiBCWVRFICAgICBieVBrdFR5cGUsCi0gICAgSU4gUFZPSUQgICAgcFR4RGF0YUhlYWQsCi0gICAgSU4gVUlOVCAgICAgY2JGcmFtZUxlbmd0aCwKLSAgICBJTiBVSU5UICAgICB1RE1BSWR4LAotICAgIElOIEJPT0wgICAgIGJOZWVkQWNrLAotICAgIElOIFVJTlQgICAgIHVGcmFnSWR4LAotICAgIElOIFVJTlQgICAgIGNiTGFzdEZyYWdtZW50U2l6ZSwKLSAgICBJTiBVSU5UICAgICB1TUFDZnJhZ051bSwKLSAgICBJTiBCWVRFICAgICBieUZCT3B0aW9uLAotICAgIElOIFdPUkQgICAgIHdDdXJyZW50UmF0ZQorICAgIFBTRGV2aWNlIHBEZXZpY2UsCisgICAgQllURSAgICAgYnlQa3RUeXBlLAorICAgIHZvaWQgKiAgIHBUeERhdGFIZWFkLAorICAgIFVJTlQgICAgIGNiRnJhbWVMZW5ndGgsCisgICAgVUlOVCAgICAgdURNQUlkeCwKKyAgICBCT09MICAgICBiTmVlZEFjaywKKyAgICBVSU5UICAgICB1RnJhZ0lkeCwKKyAgICBVSU5UICAgICBjYkxhc3RGcmFnbWVudFNpemUsCisgICAgVUlOVCAgICAgdU1BQ2ZyYWdOdW0sCisgICAgQllURSAgICAgYnlGQk9wdGlvbiwKKyAgICBXT1JEICAgICB3Q3VycmVudFJhdGUKICAgICApOwogCiAKQEAgLTIxMCwxNSArMjEwLDE1IEBACiAKIAogc3RhdGljCi1WT0lECit2b2lkCiBzX3ZGaWxsVHhLZXkgKAotICAgIElOICBQU0RldmljZSAgIHBEZXZpY2UsCi0gICAgSU4gIFBCWVRFICAgICAgcGJ5QnVmLAotICAgIElOICBQQllURSAgICAgIHBieUlWSGVhZCwKLSAgICBJTiAgUFNLZXlJdGVtICBwVHJhbnNtaXRLZXksCi0gICAgSU4gIFBCWVRFICAgICAgcGJ5SGRyQnVmLAotICAgIElOICBXT1JEICAgICAgIHdQYXlsb2FkTGVuLAotICAgIE9VVCBQQllURSAgICAgIHBNSUNIRFIKKyAgICBQU0RldmljZSAgIHBEZXZpY2UsCisgICAgUEJZVEUgICAgICBwYnlCdWYsCisgICAgUEJZVEUgICAgICBwYnlJVkhlYWQsCisgICAgUFNLZXlJdGVtICBwVHJhbnNtaXRLZXksCisgICAgUEJZVEUgICAgICBwYnlIZHJCdWYsCisgICAgV09SRCAgICAgICB3UGF5bG9hZExlbiwKKyAgICBQQllURSAgICAgIHBNSUNIRFIKICAgICApCiB7CiAgICAgUERXT1JEICAgICAgICAgIHBkd0lWID0gKFBEV09SRCkgcGJ5SVZIZWFkOwpAQCAtMzI4LDEyICszMjgsMTIgQEAKIAogCiBzdGF0aWMKLVZPSUQKK3ZvaWQKIHNfdlNXZW5jcnlwdGlvbiAoCi0gICAgSU4gIFBTRGV2aWNlICAgICAgICAgICAgcERldmljZSwKLSAgICBJTiAgUFNLZXlJdGVtICAgICAgICAgICBwVHJhbnNtaXRLZXksCi0gICAgSU4gIFBCWVRFICAgICAgICAgICAgICAgcGJ5UGF5bG9hZEhlYWQsCi0gICAgSU4gIFdPUkQgICAgICAgICAgICAgICAgd1BheWxvYWRTaXplCisgICAgUFNEZXZpY2UgICAgICAgICAgICBwRGV2aWNlLAorICAgIFBTS2V5SXRlbSAgICAgICAgICAgcFRyYW5zbWl0S2V5LAorICAgIFBCWVRFICAgICAgICAgICAgICAgcGJ5UGF5bG9hZEhlYWQsCisgICAgV09SRCAgICAgICAgICAgICAgICB3UGF5bG9hZFNpemUKICAgICApCiB7CiAgICAgVUlOVCAgIGNiSUNWbGVuID0gNDsKQEAgLTM3OSwxMSArMzc5LDExIEBACiBzdGF0aWMKIFVJTlQKIHNfdUdldFR4UnN2VGltZSAoCi0gICAgSU4gUFNEZXZpY2UgcERldmljZSwKLSAgICBJTiBCWVRFICAgICBieVBrdFR5cGUsCi0gICAgSU4gVUlOVCAgICAgY2JGcmFtZUxlbmd0aCwKLSAgICBJTiBXT1JEICAgICB3UmF0ZSwKLSAgICBJTiBCT09MICAgICBiTmVlZEFjaworICAgIFBTRGV2aWNlIHBEZXZpY2UsCisgICAgQllURSAgICAgYnlQa3RUeXBlLAorICAgIFVJTlQgICAgIGNiRnJhbWVMZW5ndGgsCisgICAgV09SRCAgICAgd1JhdGUsCisgICAgQk9PTCAgICAgYk5lZWRBY2sKICAgICApCiB7CiAgICAgVUlOVCB1RGF0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gIElOIEJPT0wgICAgIGJOZWVkQWNrLAotICAgIElOIFVJTlQgICAgIHVGcmFnSWR4LAotICAgIElOIFVJTlQgICAgIGNiTGFzdEZyYWdtZW50U2l6ZSwKLSAgICBJTiBVSU5UICAgICB1TUFDZnJhZ051bSwKLSAgICBJTiBCWVRFICAgICBieUZCT3B0aW9uLAotICAgIElOIFdPUkQgICAgIHdDdXJyZW50UmF0ZQorICAgIFBTRGV2aWNlIHBEZXZpY2UsCisgICAgQllURSAgICAgYnlQa3RUeXBlLAorICAgIHZvaWQgKiAgIHBUeERhdGFIZWFkLAorICAgIFVJTlQgICAgIGNiRnJhbWVMZW5ndGgsCisgICAgVUlOVCAgICAgdURNQUlkeCwKKyAgICBCT09MICAgICBiTmVlZEFjaywKKyAgICBVSU5UICAgICB1RnJhZ0lkeCwKKyAgICBVSU5UICAgICBjYkxhc3RGcmFnbWVudFNpemUsCisgICAgVUlOVCAgICAgdU1BQ2ZyYWdOdW0sCisgICAgQllURSAgICAgYnlGQk9wdGlvbiwKKyAgICBXT1JEICAgICB3Q3VycmVudFJhdGUKICAgICApCiB7CiAgICAgV09SRCAgd0xlbiA9IDB4MDAwMDsKQEAgLTg1MSwxNyArODUxLDE3IEBACiAKIAogc3RhdGljCi1WT0lECit2b2lkCiBzX3ZGaWxsUlRTSGVhZCAoCi0gICAgSU4gUFNEZXZpY2UgICAgICAgICBwRGV2aWNlLAotICAgIElOIEJZVEUgICAgICAgICAgICAgYnlQa3RUeXBlLAotICAgIElOIFBWT0lEICAgICAgICAgICAgcHZSVFMsCi0gICAgSU4gVUlOVCAgICAgICAgICAgICBjYkZyYW1lTGVuZ3RoLAotICAgIElOIEJPT0wgICAgICAgICAgICAgYk5lZWRBY2ssCi0gICAgSU4gQk9PTCAgICAgICAgICAgICBiRGlzQ1JDLAotICAgIElOIFBTRXRoZXJuZXRIZWFkZXIgcHNFdGhIZWFkZXIsCi0gICAgSU4gV09SRCAgICAgICAgICAgICB3Q3VycmVudFJhdGUsCi0gICAgSU4gQllURSAgICAgICAgICAgICBieUZCT3B0aW9uCisgICAgUFNEZXZpY2UgICAgICAgICBwRGV2aWNlLAorICAgIEJZVEUgICAgICAgICAgICAgYnlQa3RUeXBlLAorICAgIHZvaWQgKiAgICAgICAgICAgcHZSVFMsCisgICAgVUlOVCAgICAgICAgICAgICBjYkZyYW1lTGVuZ3RoLAorICAgIEJPT0wgICAgICAgICAgICAgYk5lZWRBY2ssCisgICAgQk9PTCAgICAgICAgICAgICBiRGlzQ1JDLAorICAgIFBTRXRoZXJuZXRIZWFkZXIgcHNFdGhIZWFkZXIsCisgICAgV09SRCAgICAgICAgICAgICB3Q3VycmVudFJhdGUsCisgICAgQllURSAgICAgICAgICAgICBieUZCT3B0aW9uCiAgICAgKQogewogICAgIFVJTlQgdVJUU0ZyYW1lTGVuID0gMjA7CkBAIC05MDAsMTYgKzkwMCwxNiBAQAogICAgICAgICAgICAgcEJ1Zi0+RGF0YS53RnJhbWVDb250cm9sID0gVFlQRV9DVExfUlRTOy8vMHgwMEI0CiAgICAgICAgICAgICBpZiAoKHBEZXZpY2UtPmVPUE1vZGUgPT0gT1BfTU9ERV9BREhPQykgfHwKICAgICAgICAgICAgICAgICAocERldmljZS0+ZU9QTW9kZSA9PSBPUF9NT0RFX0FQKSkgewotICAgICAgICAgICAgICAgIG1lbWNweSgmKHBCdWYtPkRhdGEuYWJ5UkFbMF0pLCAmKHBzRXRoSGVhZGVyLT5hYnlEc3RBZGRyWzBdKSwgVV9FVEhFUl9BRERSX0xFTik7CisgICAgICAgICAgICAgICAgbWVtY3B5KCYocEJ1Zi0+RGF0YS5hYnlSQVswXSksICYocHNFdGhIZWFkZXItPmFieURzdEFkZHJbMF0pLCBFVEhfQUxFTik7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBlbHNlIHsKLSAgICAgICAgICAgICAgICBtZW1jcHkoJihwQnVmLT5EYXRhLmFieVJBWzBdKSwgJihwRGV2aWNlLT5hYnlCU1NJRFswXSksIFVfRVRIRVJfQUREUl9MRU4pOworICAgICAgICAgICAgICAgIG1lbWNweSgmKHBCdWYtPkRhdGEuYWJ5UkFbMF0pLCAmKHBEZXZpY2UtPmFieUJTU0lEWzBdKSwgRVRIX0FMRU4pOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgaWYgKHBEZXZpY2UtPmVPUE1vZGUgPT0gT1BfTU9ERV9BUCkgewotICAgICAgICAgICAgICAgIG1lbWNweSgmKHBCdWYtPkRhdGEuYWJ5VEFbMF0pLCAmKHBEZXZpY2UtPmFieUJTU0lEWzBdKSwgVV9FVEhFUl9BRERSX0xFTik7CisgICAgICAgICAgICAgICAgbWVtY3B5KCYocEJ1Zi0+RGF0YS5hYnlUQVswXSksICYocERldmljZS0+YWJ5QlNTSURbMF0pLCBFVEhfQUxFTik7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBlbHNlIHsKLSAgICAgICAgICAgICAgICBtZW1jcHkoJihwQnVmLT5EYXRhLmFieVRBWzBdKSwgJihwc0V0aEhlYWRlci0+YWJ5U3JjQWRkclswXSksIFVfRVRIRVJfQUREUl9MRU4pOworICAgICAgICAgICAgICAgIG1lbWNweSgmKHBCdWYtPkRhdGEuYWJ5VEFbMF0pLCAmKHBzRXRoSGVhZGVyLT5hYnlTcmNBZGRyWzBdKSwgRVRIX0FMRU4pOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgICAgIGVsc2UgewpAQCAtOTM4LDE3ICs5MzgsMTcgQEAKIAogICAgICAgICAgICAgaWYgKChwRGV2aWNlLT5lT1BNb2RlID09IE9QX01PREVfQURIT0MpIHx8CiAgICAgICAgICAgICAgICAgKHBEZXZpY2UtPmVPUE1vZGUgPT0gT1BfTU9ERV9BUCkpIHsKLSAgICAgICAgICAgICAgICBtZW1jcHkoJihwQnVmLT5EYXRhLmFieVJBWzBdKSwgJihwc0V0aEhlYWRlci0+YWJ5RHN0QWRkclswXSksIFVfRVRIRVJfQUREUl9MRU4pOworICAgICAgICAgICAgICAgIG1lbWNweSgmKHBCdWYtPkRhdGEuYWJ5UkFbMF0pLCAmKHBzRXRoSGVhZGVyLT5hYnlEc3RBZGRyWzBdKSwgRVRIX0FMRU4pOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgICAgICAgbWVtY3B5KCYocEJ1Zi0+RGF0YS5hYnlSQVswXSksICYocERldmljZS0+YWJ5QlNTSURbMF0pLCBVX0VUSEVSX0FERFJfTEVOKTsKKyAgICAgICAgICAgICAgICBtZW1jcHkoJihwQnVmLT5EYXRhLmFieVJBWzBdKSwgJihwRGV2aWNlLT5hYnlCU1NJRFswXSksIEVUSF9BTEVOKTsKICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgaWYgKHBEZXZpY2UtPmVPUE1vZGUgPT0gT1BfTU9ERV9BUCkgewotICAgICAgICAgICAgICAgIG1lbWNweSgmKHBCdWYtPkRhdGEuYWJ5VEFbMF0pLCAmKHBEZXZpY2UtPmFieUJTU0lEWzBdKSwgVV9FVEhFUl9BRERSX0xFTik7CisgICAgICAgICAgICAgICAgbWVtY3B5KCYocEJ1Zi0+RGF0YS5hYnlUQVswXSksICYocERldmljZS0+YWJ5QlNTSURbMF0pLCBFVEhfQUxFTik7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBlbHNlIHsKLSAgICAgICAgICAgICAgICBtZW1jcHkoJihwQnVmLT5EYXRhLmFieVRBWzBdKSwgJihwc0V0aEhlYWRlci0+YWJ5U3JjQWRkclswXSksIFVfRVRIRVJfQUREUl9MRU4pOworICAgICAgICAgICAgICAgIG1lbWNweSgmKHBCdWYtPkRhdGEuYWJ5VEFbMF0pLCAmKHBzRXRoSGVhZGVyLT5hYnlTcmNBZGRyWzBdKSwgRVRIX0FMRU4pOwogICAgICAgICAgICAgfQogCiAgICAgICAgIH0gLy8gaWYgKGJ5RkJPcHRpb24gPT0gQVVUT19GQl9OT05FKQpAQCAtOTY5LDE3ICs5NjksMTcgQEAKIAogICAgICAgICAgICAgaWYgKChwRGV2aWNlLT5lT1BNb2RlID09IE9QX01PREVfQURIT0MpIHx8CiAgICAgICAgICAgICAgICAgKHBEZXZpY2UtPmVPUE1vZGUgPT0gT1BfTU9ERV9BUCkpIHsKLSAgICAgICAgICAgICAgICBtZW1jcHkoJihwQnVmLT5EYXRhLmFieVJBWzBdKSwgJihwc0V0aEhlYWRlci0+YWJ5RHN0QWRkclswXSksIFVfRVRIRVJfQUREUl9MRU4pOworICAgICAgICAgICAgICAgIG1lbWNweSgmKHBCdWYtPkRhdGEuYWJ5UkFbMF0pLCAmKHBzRXRoSGVhZGVyLT5hYnlEc3RBZGRyWzBdKSwgRVRIX0FMRU4pOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgICAgICAgbWVtY3B5KCYocEJ1Zi0+RGF0YS5hYnlSQVswXSksICYocERldmljZS0+YWJ5QlNTSURbMF0pLCBVX0VUSEVSX0FERFJfTEVOKTsKKyAgICAgICAgICAgICAgICBtZW1jcHkoJihwQnVmLT5EYXRhLmFieVJBWzBdKSwgJihwRGV2aWNlLT5hYnlCU1NJRFswXSksIEVUSF9BTEVOKTsKICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgaWYgKHBEZXZpY2UtPmVPUE1vZGUgPT0gT1BfTU9ERV9BUCkgewotICAgICAgICAgICAgICAgIG1lbWNweSgmKHBCdWYtPkRhdGEuYWJ5VEFbMF0pLCAmKHBEZXZpY2UtPmFieUJTU0lEWzBdKSwgVV9FVEhFUl9BRERSX0xFTik7CisgICAgICAgICAgICAgICAgbWVtY3B5KCYocEJ1Zi0+RGF0YS5hYnlUQVswXSksICYocERldmljZS0+YWJ5QlNTSURbMF0pLCBFVEhfQUxFTik7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBlbHNlIHsKLSAgICAgICAgICAgICAgICBtZW1jcHkoJihwQnVmLT5EYXRhLmFieVRBWzBdKSwgJihwc0V0aEhlYWRlci0+YWJ5U3JjQWRkclswXSksIFVfRVRIRVJfQUREUl9MRU4pOworICAgICAgICAgICAgICAgIG1lbWNweSgmKHBCdWYtPkRhdGEuYWJ5VEFbMF0pLCAmKHBzRXRoSGVhZGVyLT5hYnlTcmNBZGRyWzBdKSwgRVRIX0FMRU4pOwogICAgICAgICAgICAgfQogCiAgICAgICAgIH0KQEAgLTEwMDAsMTYgKzEwMDAsMTYgQEAKIAogICAgICAgICAgICAgaWYgKChwRGV2aWNlLT5lT1BNb2RlID09IE9QX01PREVfQURIT0MpIHx8CiAgICAgICAgICAgICAgICAgKHBEZXZpY2UtPmVPUE1vZGUgPT0gT1BfTU9ERV9BUCkpIHsKLSAgICAgICAgICAgICAgICBtZW1jcHkoJihwQnVmLT5EYXRhLmFieVJBWzBdKSwgJihwc0V0aEhlYWRlci0+YWJ5RHN0QWRkclswXSksIFVfRVRIRVJfQUREUl9MRU4pOworICAgICAgICAgICAgICAgIG1lbWNweSgmKHBCdWYtPkRhdGEuYWJ5UkFbMF0pLCAmKHBzRXRoSGVhZGVyLT5hYnlEc3RBZGRyWzBdKSwgRVRIX0FMRU4pOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgICAgICAgbWVtY3B5KCYocEJ1Zi0+RGF0YS5hYnlSQVswXSksICYocERldmljZS0+YWJ5QlNTSURbMF0pLCBVX0VUSEVSX0FERFJfTEVOKTsKKyAgICAgICAgICAgICAgICBtZW1jcHkoJihwQnVmLT5EYXRhLmFieVJBWzBdKSwgJihwRGV2aWNlLT5hYnlCU1NJRFswXSksIEVUSF9BTEVOKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGlmIChwRGV2aWNlLT5lT1BNb2RlID09IE9QX01PREVfQVApIHsKLSAgICAgICAgICAgICAgICBtZW1jcHkoJihwQnVmLT5EYXRhLmFieVRBWzBdKSwgJihwRGV2aWNlLT5hYnlCU1NJRFswXSksIFVfRVRIRVJfQUREUl9MRU4pOworICAgICAgICAgICAgICAgIG1lbWNweSgmKHBCdWYtPkRhdGEuYWJ5VEFbMF0pLCAmKHBEZXZpY2UtPmFieUJTU0lEWzBdKSwgRVRIX0FMRU4pOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgICAgICAgbWVtY3B5KCYocEJ1Zi0+RGF0YS5hYnlUQVswXSksICYocHNFdGhIZWFkZXItPmFieVNyY0FkZHJbMF0pLCBVX0VUSEVSX0FERFJfTEVOKTsKKyAgICAgICAgICAgICAgICBtZW1jcHkoJihwQnVmLT5EYXRhLmFieVRBWzBdKSwgJihwc0V0aEhlYWRlci0+YWJ5U3JjQWRkclswXSksIEVUSF9BTEVOKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KQEAgLTEwMjksMzMgKzEwMjksMzMgQEAKIAogICAgICAgICBpZiAoKHBEZXZpY2UtPmVPUE1vZGUgPT0gT1BfTU9ERV9BREhPQykgfHwKICAgICAgICAgICAgIChwRGV2aWNlLT5lT1BNb2RlID09IE9QX01PREVfQVApKSB7Ci0gICAgICAgICAgICBtZW1jcHkoJihwQnVmLT5EYXRhLmFieVJBWzBdKSwgJihwc0V0aEhlYWRlci0+YWJ5RHN0QWRkclswXSksIFVfRVRIRVJfQUREUl9MRU4pOworICAgICAgICAgICAgbWVtY3B5KCYocEJ1Zi0+RGF0YS5hYnlSQVswXSksICYocHNFdGhIZWFkZXItPmFieURzdEFkZHJbMF0pLCBFVEhfQUxFTik7CiAgICAgICAgIH0KICAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgICBtZW1jcHkoJihwQnVmLT5EYXRhLmFieVJBWzBdKSwgJihwRGV2aWNlLT5hYnlCU1NJRFswXSksIFVfRVRIRVJfQUREUl9MRU4pOworICAgICAgICAgICAgbWVtY3B5KCYocEJ1Zi0+RGF0YS5hYnlSQVswXSksICYocERldmljZS0+YWJ5QlNTSURbMF0pLCBFVEhfQUxFTik7CiAgICAgICAgIH0KIAogICAgICAgICBpZiAocERldmljZS0+ZU9QTW9kZSA9PSBPUF9NT0RFX0FQKSB7Ci0gICAgICAgICAgICBtZW1jcHkoJihwQnVmLT5EYXRhLmFieVRBWzBdKSwgJihwRGV2aWNlLT5hYnlCU1NJRFswXSksIFVfRVRIRVJfQUREUl9MRU4pOworICAgICAgICAgICAgbWVtY3B5KCYocEJ1Zi0+RGF0YS5hYnlUQVswXSksICYocERldmljZS0+YWJ5QlNTSURbMF0pLCBFVEhfQUxFTik7CiAgICAgICAgIH0KICAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgICBtZW1jcHkoJihwQnVmLT5EYXRhLmFieVRBWzBdKSwgJihwc0V0aEhlYWRlci0+YWJ5U3JjQWRkclswXSksIFVfRVRIRVJfQUREUl9MRU4pOworICAgICAgICAgICAgbWVtY3B5KCYocEJ1Zi0+RGF0YS5hYnlUQVswXSksICYocHNFdGhIZWFkZXItPmFieVNyY0FkZHJbMF0pLCBFVEhfQUxFTik7CiAgICAgICAgIH0KICAgICB9CiB9CiAKIHN0YXRpYwotVk9JRAordm9pZAogc192RmlsbENUU0hlYWQgKAotICAgIElOIFBTRGV2aWNlIHBEZXZpY2UsCi0gICAgSU4gVUlOVCAgICAgdURNQUlkeCwKLSAgICBJTiBCWVRFICAgICBieVBrdFR5cGUsCi0gICAgSU4gUFZPSUQgICAgcHZDVFMsCi0gICAgSU4gVUlOVCAgICAgY2JGcmFtZUxlbmd0aCwKLSAgICBJTiBCT09MICAgICBiTmVlZEFjaywKLSAgICBJTiBCT09MICAgICBiRGlzQ1JDLAotICAgIElOIFdPUkQgICAgIHdDdXJyZW50UmF0ZSwKLSAgICBJTiBCWVRFICAgICBieUZCT3B0aW9uCisgICAgUFNEZXZpY2UgcERldmljZSwKKyAgICBVSU5UICAgICB1RE1BSWR4LAorICAgIEJZVEUgICAgIGJ5UGt0VHlwZSwKKyAgICB2b2lkICogICBwdkNUUywKKyAgICBVSU5UICAgICBjYkZyYW1lTGVuZ3RoLAorICAgIEJPT0wgICAgIGJOZWVkQW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ICAgICAgIG1lbWNweSgmKHBCdWYtPkRhdGEuYWJ5UkFbMF0pLCAmKHBEZXZpY2UtPmFieUN1cnJlbnROZXRBZGRyWzBdKSwgVV9FVEhFUl9BRERSX0xFTik7CisgICAgICAgICAgICBtZW1jcHkoJihwQnVmLT5EYXRhLmFieVJBWzBdKSwgJihwRGV2aWNlLT5hYnlDdXJyZW50TmV0QWRkclswXSksIEVUSF9BTEVOKTsKICAgICAgICAgfQogICAgIH0KIH0KQEAgLTExNTAsMTkgKzExNTAsMTkgQEAKIC0qLwogLy8gVUlOVCAgICAgICAgICAgIGNiRnJhbWVTaXplLC8vSGRyK1BheWxvYWQrRkNTCiBzdGF0aWMKLVZPSUQKK3ZvaWQKIHNfdkdlbmVyYXRlVHhQYXJhbWV0ZXIgKAotICAgIElOIFBTRGV2aWNlICAgICAgICAgcERldmljZSwKLSAgICBJTiBCWVRFICAgICAgICAgICAgIGJ5UGt0VHlwZSwKLSAgICBJTiBQVk9JRCAgICAgICAgICAgIHBUeEJ1ZkhlYWQsCi0gICAgSU4gUFZPSUQgICAgICAgICAgICBwdlJydlRpbWUsCi0gICAgSU4gUFZPSUQgICAgICAgICAgICBwdlJUUywKLSAgICBJTiBQVk9JRCAgICAgICAgICAgIHB2Q1RTLAotICAgIElOIFVJTlQgICAgICAgICAgICAgY2JGcmFtZVNpemUsCi0gICAgSU4gQk9PTCAgICAgICAgICAgICBiTmVlZEFDSywKLSAgICBJTiBVSU5UICAgICAgICAgICAgIHVETUFJZHgsCi0gICAgSU4gUFNFdGhlcm5ldEhlYWRlciBwc0V0aEhlYWRlciwKLSAgICBJTiBXT1JEICAgICAgICAgICAgIHdDdXJyZW50UmF0ZQorICAgIFBTRGV2aWNlICAgICAgICAgcERldmljZSwKKyAgICBCWVRFICAgICAgICAgICAgIGJ5UGt0VHlwZSwKKyAgICB2b2lkICogICAgICAgICAgIHBUeEJ1ZkhlYWQsCisgICAgdm9pZCAqICAgICAgICAgICBwdlJydlRpbWUsCisgICAgdm9pZCAqICAgICAgICAgICBwdlJUUywKKyAgICB2b2lkICogICAgICAgICAgIHB2Q1RTLAorICAgIFVJTlQgICAgICAgICAgICAgY2JGcmFtZVNpemUsCisgICAgQk9PTCAgICAgICAgICAgICBiTmVlZEFDSywKKyAgICBVSU5UICAgICAgICAgICAgIHVETUFJZHgsCisgICAgUFNFdGhlcm5ldEhlYWRlciBwc0V0aEhlYWRlciwKKyAgICBXT1JEICAgICAgICAgICAgIHdDdXJyZW50UmF0ZQogICAgICkKIHsKICAgICBVSU5UIGNiTUFDSGRMZW4gPSBXTEFOX0hEUl9BRERSM19MRU47IC8vMjQKQEAgLTEyNjgsMTQgKzEyNjgsMTQgQEAKICAgICBVSU5UICBjYkZyYWdtZW50U2l6ZSwvL0hkcitwYXlvYWQrRkNTCiAqLwogc3RhdGljCi1WT0lECit2b2lkCiBzX3ZGaWxsRnJhZ1BhcmFtZXRlcigKLSAgICBJTiBQU0RldmljZSBwRGV2aWNlLAotICAgIElOIFBCWVRFICAgIHBieUJ1ZmZlciwKLSAgICBJTiBVSU5UICAgICB1VHhUeXBlLAotICAgIElOIFBWT0lEICAgIHB2dGRDdXJyLAotICAgIElOIFdPUkQgICAgIHdGcmFnVHlwZSwKLSAgICBJTiBVSU5UICAgICBjYlJlcUNvdW50CisgICAgUFNEZXZpY2UgcERldmljZSwKKyAgICBQQllURSAgICBwYnlCdWZmZXIsCisgICAgVUlOVCAgICAgdVR4VHlwZSwKKyAgICB2b2lkICogICBwdnRkQ3VyciwKKyAgICBXT1JEICAgICB3RnJhZ1R5cGUsCisgICAgVUlOVCAgICAgY2JSZXFDb3VudAogICAgICkKIHsKICAgICBQU1R4QnVmSGVhZCBwVHhCdWZIZWFkID0gKFBTVHhCdWZIZWFkKSBwYnlCdWZmZXI7CkBAIC0xMzE4LDE4ICsxMzE4LDE4IEBACiBzdGF0aWMKIFVJTlQKIHNfY2JGaWxsVHhCdWZIZWFkICgKLSAgICBJTiAgUFNEZXZpY2UgICAgICAgICBwRGV2aWNlLAotICAgIElOICBCWVRFICAgICAgICAgICAgIGJ5UGt0VHlwZSwKLSAgICBJTiAgUEJZVEUgICAgICAgICAgICBwYnlUeEJ1ZmZlckFkZHIsCi0gICAgSU4gIFVJTlQgICAgICAgICAgICAgY2JGcmFtZUJvZHlTaXplLAotICAgIElOICBVSU5UICAgICAgICAgICAgIHVETUFJZHgsCi0gICAgSU4gIFBTVHhEZXNjICAgICAgICAgcEhlYWRURCwKLSAgICBJTiAgUFNFdGhlcm5ldEhlYWRlciBwc0V0aEhlYWRlciwKLSAgICBJTiAgUEJZVEUgICAgICAgICAgICBwUGFja2V0LAotICAgIElOICBCT09MICAgICAgICAgICAgIGJOZWVkRW5jcnlwdCwKLSAgICBJTiAgUFNLZXlJdGVtICAgICAgICBwVHJhbnNtaXRLZXksCi0gICAgSU4gIFVJTlQgICAgICAgICAgICAgdU5vZGVJbmRleCwKLSAgICBPVVQgUFVJTlQgICAgICAgICAgICBwdU1BQ2ZyYWdOdW0KKyAgICBQU0RldmljZSAgICAgICAgIHBEZXZpY2UsCisgICAgQllURSAgICAgICAgICAgICBieVBrdFR5cGUsCisgICAgUEJZVEUgICAgICAgICAgICBwYnlUeEJ1ZmZlckFkZHIsCisgICAgVUlOVCAgICAgICAgICAgICBjYkZyYW1lQm9keVNpemUsCisgICAgVUlOVCAgICAgICAgICAgICB1RE1BSWR4LAorICAgIFBTVHhEZXNjICAgICAgICAgcEhlYWRURCwKKyAgICBQU0V0aGVybmV0SGVhZGVyIHBzRXRoSGVhZGVyLAorICAgIFBCWVRFICAgICAgICAgICAgcFBhY2tldCwKKyAgICBCT09MICAgICAgICAgICAgIGJOZWVkRW5jcnlwdCwKKyAgICBQU0tleUl0ZW0gICAgICAgIHBUcmFuc21pdEtleSwKKyAgICBVSU5UICAgICAgICAgICAgIHVOb2RlSW5kZXgsCisgICAgUFVJTlQgICAgICAgICAgICBwdU1BQ2ZyYWdOdW0KICAgICApCiB7CiAgICAgVUlOVCAgICAgICA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AgICAgaWYgKG50b2hzKHBzRXRoSGVhZGVyLT53VHlwZSkgPiBFVEhfREFUQV9MRU4pIHsKICAgICAgICAgICAgICAgICAgICAgaWYgKChwc0V0aEhlYWRlci0+d1R5cGUgPT0gVFlQRV9QS1RfSVBYKSB8fAogICAgICAgICAgICAgICAgICAgICAgICAgKHBzRXRoSGVhZGVyLT53VHlwZSA9PSBjcHVfdG9fbGUxNigweEYzODApKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgbWVtY3B5KChQQllURSkgKHBieVBheWxvYWRIZWFkKSwgJnBEZXZpY2UtPmFieVNOQVBfQnJpZGdldHVubmVsWzBdLCA2KTsKQEAgLTE2NDMsNyArMTY0Myw3IEBACiAgICAgICAgICAgICAgICAgLy9pZiAocERldmljZS0+YkFFUykgewogICAgICAgICAgICAgICAgIC8vICAgIHNfdkZpbGxNSUNIRFIocERldmljZSwgKFBCWVRFKXBNSUNIRFIsIHBieU1hY0hkciwgKFdPUkQpY2JGcmFnUGF5bG9hZFNpemUpOwogICAgICAgICAgICAgICAgIC8vfQotICAgICAgICAgICAgICAgIC8vY2JSZXFDb3VudCArPSBzX3VEb0VuY3J5cHRpb24ocERldmljZSwgcHNFdGhIZWFkZXIsIChQVk9JRClwc1R4QnVmSGQsIGJ5S2V5U2VsLAorICAgICAgICAgICAgICAgIC8vY2JSZXFDb3VudCArPSBzX3VEb0VuY3J5cHRpb24ocERldmljZSwgcHNFdGhIZWFkZXIsICh2b2lkICopcHNUeEJ1ZkhkLCBieUtleVNlbCwKICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGJ5UGF5bG9hZEhlYWQsIChXT1JEKWNiRnJhZ1BheWxvYWRTaXplLCB1RE1BSWR4KTsKIAogCkBAIC0xNjUzLDcgKzE2NTMsNyBAQAogCiAgICAgICAgICAgICAgICAgdUxlbmd0aCA9IGNiSGVhZGVyTGVuZ3RoICsgY2JNQUNIZExlbiArIHVQYWRkaW5nICsgY2J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IHNfdkdlbmVyYXRlVHhQYXJhbWV0ZXIocERldmljZSwgYnlQa3RUeXBlLCAodm9pZCAqKXBzVHhCdWZIZCwgcHZScnZUaW1lLCBwdlJUUywgcHZDVFMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYkZyYWdtZW50U2l6ZSwgYk5lZWRBQ0ssIHVETUFJZHgsIHBzRXRoSGVhZGVyLCBwRGV2aWNlLT53Q3VycmVudFJhdGUpOwogICAgICAgICAgICAgICAgIC8vRmlsbCBEYXRhSGVhZAogICAgICAgICAgICAgICAgIHVEdXJhdGlvbiA9IHNfdUZpbGxEYXRhSGVhZChwRGV2aWNlLCBieVBrdFR5cGUsIHB2VHhEYXRhSGQsIGNiRnJhZ21lbnRTaXplLCB1RE1BSWR4LCBiTmVlZEFDSywKQEAgLTE4NjQsNyArMTg2NCw3IEBACiAgICAgICAgICAgICAgICAgLy9pZiAocERldmljZS0+YkFFUykgewogICAgICAgICAgICAgICAgIC8vICAgIHNfdkZpbGxNSUNIRFIocERldmljZSwgKFBCWVRFKXBNSUNIRFIsIHBieU1hY0hkciwgKFdPUkQpY2JGcmFnUGF5bG9hZFNpemUpOwogICAgICAgICAgICAgICAgIC8vfQotICAgICAgICAgICAgICAgIC8vY2JSZXFDb3VudCArPSBzX3VEb0VuY3J5cHRpb24ocERldmljZSwgcHNFdGhIZWFkZXIsIChQVk9JRClwc1R4QnVmSGQsIGJ5S2V5U2VsLAorICAgICAgICAgICAgICAgIC8vY2JSZXFDb3VudCArPSBzX3VEb0VuY3J5cHRpb24ocERldmljZSwgcHNFdGhIZWFkZXIsICh2b2lkICopcHNUeEJ1ZkhkLCBieUtleVNlbCwKICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBieVBheWxvYWRIZWFkLCAoV09SRCljYkZyYWdQYXlsb2FkU2l6ZSwgdURNQUlkeCk7CiAKIApAQCAtMTg3NSw3ICsxODc1LDcgQEAKICAgICAgIC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UFNLZXlJdGVtICAgICAgICBwVHJhbnNtaXRLZXksCi0gICAgSU4gIFVJTlQgICAgICAgICAgICAgdU5vZGVJbmRleCwKLSAgICBPVVQgUFVJTlQgICAgICAgICAgICBwdU1BQ2ZyYWdOdW0sCi0gICAgT1VUIFBVSU5UICAgICAgICAgICAgcGNiSGVhZGVyU2l6ZQorICAgIFBTRGV2aWNlICAgICAgICAgcERldmljZSwKKyAgICBCWVRFICAgICAgICAgICAgIGJ5UGt0VHlwZSwKKyAgICBQQllURSAgICAgICAgICAgIHBieVR4QnVmZmVyQWRkciwKKyAgICBCT09MICAgICAgICAgICAgIGJOZWVkRW5jcnlwdCwKKyAgICBVSU5UICAgICAgICAgICAgIGNiUGF5bG9hZFNpemUsCisgICAgVUlOVCAgICAgICAgICAgICB1RE1BSWR4LAorICAgIFBTVHhEZXNjICAgICAgICAgcEhlYWRURCwKKyAgICBQU0V0aGVybmV0SGVhZGVyIHBzRXRoSGVhZGVyLAorICAgIFBCWVRFICAgICAgICAgICAgcFBhY2tldCwKKyAgICBQU0tleUl0ZW0gICAgICAgIHBUcmFuc21pdEtleSwKKyAgICBVSU5UICAgICAgICAgICAgIHVOb2RlSW5kZXgsCisgICAgUFVJTlQgICAgICAgICAgICBwdU1BQ2ZyYWdOdW0sCisgICAgUFVJTlQgICAgICAgICAgICBwY2JIZWFkZXJTaXplCiAgICAgKQogewogICAgIFVJTlQgICAgICAgICAgICB3VHhCdWZTaXplOyAgICAgICAvLyBGRmluZm8gc2l6ZQpAQCAtMjI2NCwxNiArMjI2NCwxNiBAQAogICoKIC0qLwogCi1WT0lECit2b2lkCiB2R2VuZXJhdGVNQUNIZWFkZXIgKAotICAgIElOIFBTRGV2aWNlICAgICAgICAgcERldmljZSwKLSAgICBJTiBQQllURSAgICAgICAgICAgIHBieUJ1ZmZlckFkZHIsCi0gICAgSU4gV09SRCAgICAgICAgICAgICB3RHVyYXRpb24sCi0gICAgSU4gUFNFdGhlcm5ldEhlYWRlciBwc0V0aEhlYWRlciwKLSAgICBJTiBCT09MICAgICAgICAgICAgIGJOZWVkRW5jcnlwdCwKLSAgICBJTiBXT1JEICAgICAgICAgICAgIHdGcmFnVHlwZSwKLSAgICBJTiBVSU5UICAgICAgICAgICAgIHVETUFJZHgsCi0gICAgSU4gVUlOVCAgICAgICAgICAgICB1RnJhZ0lkeAorICAgIFBTRGV2aWNlICAgICAgICAgcERldmljZSwKKyAgICBQQllURSAgICAgICAgICAgIHBieUJ1ZmZlckFkZHIsCisgICAgV09SRCAgICAgICAgICAgICB3RHVyYXRpb24sCisgICAgUFNFdGhlcm5ldEhlYWRlciBwc0V0aEhlYWRlciwKKyAgICBCT09MICAgICAgICAgICAgIGJOZWVkRW5jcnlwdCwKKyAgICBXT1JEICAgICAgICAgICAgIHdGcmFnVHlwZSwKKyAgICBVSU5UICAgICAgICAgICAgIHVETUFJZHgsCisgICAgVUlOVCAgICAgICAgICAgICB1RnJhZ0lkeAogICAgICkKIHsKICAgICBQUzgwMl8xMUhlYWRlciAgcE1BQ0hlYWRlciA9IChQUzgwMl8xMUhlYWRlcilwYnlCdWZmZXJBZGRyOwpAQCAtMjI4NywyMSArMjI4NywyMSBAQAogICAgIH0KIAogICAgIGlmIChwRGV2aWNlLT5lT1BNb2RlID09IE9QX01PREVfQVApIHsKLSAgICAgICAgbWVtY3B5KCYocE1BQ0hlYWRlci0+YWJ5QWRkcjFbMF0pLCAmKHBzRXRoSGVhZGVyLT5hYnlEc3RBZGRyWzBdKSwgVV9FVEhFUl9BRERSX0xFTik7Ci0gICAgICAgIG1lbWNweSgmKHBNQUNIZWFkZXItPmFieUFkZHIyWzBdKSwgJihwRGV2aWNlLT5hYnlCU1NJRFswXSksIFVfRVRIRVJfQUREUl9MRU4pOwotICAgICAgICBtZW1jcHkoJihwTUFDSGVhZGVyLT5hYnlBZGRyM1swXSksICYocHNFdGhIZWFkZXItPmFieVNyY0FkZHJbMF0pLCBVX0VUSEVSX0FERFJfTEVOKTsKKyAgICAgICAgbW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gUFZPSUQgICAgICAgICAgIHB2UlRTOworICAgIHZvaWQgKiAgICAgICAgICBwdlJUUzsKICAgICBQU0NUUyAgICAgICAgICAgcENUUzsKLSAgICBQVk9JRCAgICAgICAgICAgcHZUeERhdGFIZDsKKyAgICB2b2lkICogICAgICAgICAgcHZUeERhdGFIZDsKICAgICBVSU5UICAgICAgICAgICAgdUR1cmF0aW9uOwogICAgIFVJTlQgICAgICAgICAgICBjYlJlcUNvdW50OwogICAgIFBTODAyXzExSGVhZGVyICBwTUFDSGVhZGVyOwpAQCAtMjM2Miw4ICsyMzYyLDggQEAKICAgICBXT1JEICAgICAgICAgICAgd1R4QnVmU2l6ZTsKICAgICBVSU5UICAgICAgICAgICAgY2JNYWNIZExlbjsKICAgICBTRXRoZXJuZXRIZWFkZXIgc0V0aEhlYWRlcjsKLSAgICBQVk9JRCAgICAgICAgICAgcHZScnZUaW1lOwotICAgIFBWT0lEICAgICAgICAgICBwTUlDSERSOworICAgIHZvaWQgKiAgICAgICAgICBwdlJydlRpbWU7CisgICAgdm9pZCAqICAgICAgICAgIHBNSUNIRFI7CiAgICAgUFNNZ210T2JqZWN0ICAgIHBNZ210ID0gcERldmljZS0+cE1nbXQ7CiAgICAgV09SRCAgICAgICAgICAgIHdDdXJyZW50UmF0ZSA9IFJBVEVfMU07CiAKQEAgLTI1MTYsMTAgKzI1MTYsMTAgQEAKICAgICAgICAgY2JIZWFkZXJTaXplID0gd1R4QnVmU2l6ZSArIHNpemVvZihTUnJ2VGltZV9hYikgKyBzaXplb2YoU1R4RGF0YUhlYWRfYWIpOwogICAgIH0KIAotICAgIG1lbXNldCgoUFZPSUQpKHBieVR4QnVmZmVyQWRkciArIHdUeEJ1ZlNpemUpLCAwLCAoY2JIZWFkZXJTaXplIC0gd1R4QnVmU2l6ZSkpOworICAgIG1lbXNldCgodm9pZCAqKShwYnlUeEJ1ZmZlckFkZHIgKyB3VHhCdWZTaXplKSwgMCwgKGNiSGVhZGVyU2l6ZSAtIHdUeEJ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oSGVhZGVyCiAgICAgKQogewogICAgIFVJTlQgICAgICAgICAgIGNiTUFDSGRMZW47CkBAIC0yODI1LDE1ICsyODI1LDE1IEBACiB9CiAKIAotVk9JRAordm9pZAogdkRNQTBfdHhfODAyMTEoUFNEZXZpY2UgIHBEZXZpY2UsIHN0cnVjdCBza19idWZmICpza2IsIFBCWVRFIHBiTVBEVSwgVUlOVCBjYk1QRFVMZW4pIHsKIAogICAgIFBTVHhEZXNjICAgICAgICBwRnJzdFREOwogICAgIEJZVEUgICAgICAgICAgICBieVBrdFR5cGU7CiAgICAgUEJZVEUgICAgICAgICAgIHBieVR4QnVmZmVyQWRkcjsKLSAgICBQVk9JRCAgICAgICAgICAgcHZSVFM7Ci0gICAgUFZPSUQgICAgICAgICAgIHB2Q1RTOwotICAgIFBWT0lEICAgICAgICAgICBwdlR4RGF0YUhkOworICAgIHZvaWQgKiAgICAgICAgICBwdlJUUzsKKyAgICB2b2lkICogICAgICAgICAgcHZDVFM7CisgICAgdm9pZCAqICAgICAgICAgIHB2VHhEYXRhSGQ7CiAgICAgVUlOVCAgICAgICAgICAgIHVEdXJhdGlvbjsKICAgICBVSU5UICAgICAgICAgICAgY2JSZXFDb3VudDsKICAgICBQUzgwMl8xMUhlYWRlciAgcE1BQ0hlYWRlcjsKQEAgLTI4NTcsOCArMjg1Nyw4IEBACiAgICAgV09SRCAgICAgICAgICAgIHdUeEJ1ZlNpemU7CiAgICAgVUlOVCAgICAgICAgICAgIGNiTWFjSGRMZW47CiAgICAgU0V0aGVybmV0SGVhZGVyIHNFdGhIZWFkZXI7Ci0gICAgUFZPSUQgICAgICAgICAgIHB2UnJ2VGltZTsKLSAgICBQVk9JRCAgICAgICAgICAgcE1JQ0hEUjsKKyAgICB2b2lkICogICAgICAgICAgcHZScnZUaW1lOworICAgIHZvaWQgKiAgICAgICAgICBwTUlDSERSOwogICAgIFBTTWdtdE9iamVjdCAgICBwTWdtdCA9IHBEZXZpY2UtPnBNZ210OwogICAgIFdPUkQ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GR3UnhCdWZmZXJBZGRyLAorICAgIFVJTlQgY2JQYWNrZXRTaXplLAorICAgIEJPT0wgYklzV0VQLAorICAgIFBVSU5UIHBjYkhlYWRTaXplCiAgICAgKTsKICovCiAKIAotVk9JRAordm9pZAogdkdlbmVyYXRlTUFDSGVhZGVyICgKLSAgICBJTiBQU0RldmljZSAgICAgICAgIHBEZXZpY2UsCi0gICAgSU4gUEJZVEUgICAgICAgICAgICBwYnlCdWZmZXJBZGRyLAotICAgIElOIFdPUkQgICAgICAgICAgICAgd0R1cmF0aW9uLAotICAgIElOIFBTRXRoZXJuZXRIZWFkZXIgcHNFdGhIZWFkZXIsCi0gICAgSU4gQk9PTCAgICAgICAgICAgICBiTmVlZEVuY3J5cHQsCi0gICAgSU4gV09SRCAgICAgICAgICAgICB3RnJhZ1R5cGUsCi0gICAgSU4gVUlOVCAgICAgICAgICAgICB1RE1BSWR4LAotICAgIElOIFVJTlQgICAgICAgICAgICAgdUZyYWdJZHgKKyAgICBQU0RldmljZSAgICAgICAgIHBEZXZpY2UsCisgICAgUEJZVEUgICAgICAgICAgICBwYnlCdWZmZXJBZGRyLAorICAgIFdPUkQgICAgICAgICAgICAgd0R1cmF0aW9uLAorICAgIFBTRXRoZXJuZXRIZWFkZXIgcHNFdGhIZWFkZXIsCisgICAgQk9PTCAgICAgICAgICAgICBiTmVlZEVuY3J5cHQsCisgICAgV09SRCAgICAgICAgICAgICB3RnJhZ1R5cGUsCisgICAgVUlOVCAgICAgICAgICAgICB1RE1BSWR4LAorICAgIFVJTlQgICAgICAgICAgICAgdUZyYWdJZHgKICAgICApOwogCiAKIFVJTlQKIGNiR2V0RnJhZ0NvdW50KAotICAgIElOICBQU0RldmljZSAgICAgICAgIHBEZXZpY2UsCi0gICAgSU4gIFBTS2V5SXRlbSAgICAgICAgcFRyYW5zbWl0S2V5LAotICAgIElOICBVSU5UICAgICAgICAgICAgIGNiRnJhbWVCb2R5U2l6ZSwKLSAgICBJTiAgUFNFdGhlcm5ldEhlYWRlciBwc0V0aEhlYWRlcgorICAgIFBTRGV2aWNlICAgICAgICAgcERldmljZSwKKyAgICBQU0tleUl0ZW0gICAgICAgIHBUcmFuc21pdEtleSwKKyAgICBVSU5UICAgICAgICAgICAgIGNiRnJhbWVCb2R5U2l6ZSwKKyAgICBQU0V0aGVybmV0SGVhZGVyIHBzRXRoSGVhZGVyCiAgICAgKTsKIAogCi1WT0lECit2b2lkCiB2R2VuZXJhdGVGSUZPSGVhZGVyICgKLSAgICBJTiAgUFNEZXZpY2UgICAgICAgICBwRGV2aWNlLAotICAgIElOICBCWVRFICAgICAgICAgICAgIGJ5UGt0VHlwLAotICAgIElOICBQQllURSAgICAgICAgICAgIHBieVR4QnVmZmVyQWRkciwKLSAgICBJTiAgQk9PTCAgICAgICAgICAgICBiTmVlZEVuY3J5cHQsCi0gICAgSU4gIFVJTlQgICAgICAgICAgICAgY2JQYXlsb2FkU2l6ZSwKLSAgICBJTiAgVUlOVCAgICAgICAgICAgICB1RE1BSWR4LAotICAgIElOICBQU1R4RGVzYyAgICAgICAgIHBIZWFkVEQsCi0gICAgSU4gIFBTRXRoZXJuZXRIZWFkZXIgcHNFdGhIZWFkZXIsCi0gICAgSU4gIFBCWVRFICAgICAgICAgICAgcFBhY2tldCwKLSAgICBJTiAgUFNLZXlJdGVtICAgICAgICBwVHJhbnNtaXRLZXksCi0gICAgSU4gIFVJTlQgICAgICAgICAgICAgdU5vZGVJbmRleCwKLSAgICBPVVQgUFVJTlQgICAgICAgICAgICBwdU1BQ2ZyYWdOdW0sCi0gICAgT1VUIFBVSU5UICAgICAgICAgICAgcGNiSGVhZGVyU2l6ZQorICAgIFBTRGV2aWNlICAgICAgICAgcERldmljZSwKKyAgICBCWVRFICAgICAgICAgICAgIGJ5UGt0VHlwLAorICAgIFBCWVRFICAgICAgICAgICAgcGJ5VHhCdWZmZXJBZGRyLAorICAgIEJPT0wgICAgICAgICAgICAgYk5lZWRFbmNyeXB0LAorICAgIFVJTlQgICAgICAgIC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i8KICAgICBmb3IgKGlpID0gMDsgaWkgPCBFRVBfTUFYX0NPTlRFWFRfU0laRTsgaWkrKykgewogICAgICAgICAqcGJ5RWVwcm9tUmVncyA9IFNST01ieVJlYWRFbWJlZGRlZChkd0lvQmFzZSwoQllURSkgaWkpOwogICAgICAgICBwYnlFZXByb21SZWdzKys7CkBAIC0yOTEsMTEgKzI5MSwxMSBAQAogICogUmV0dXJuIFZhbHVlOiBub25lCiAgKgogICovCi12b2lkIFNST012V3JpdGVBbGxDb250ZW50cyAoRFdPUkRfUFRSIGR3SW9CYXNlLCBQQllURSBwYnlFZXByb21SZWdzKQordm9pZCBTUk9NdldyaXRlQWxsQ29udGVudHMoRFdPUkRfUFRSIGR3SW9CYXNlLCBQQllURSBwYnlFZXByb21SZWdzKQogewogICAgIGludCAgICAgaWk7CiAKLSAgICAvLyBpaSA9IFJvbSBBZGRyZXNzCisgICAgLyogaWkgPSBSb20gQWRkcmVzcyAqLwogICAgIGZvciAoaWkgPSAwOyBpaSA8IEVFUF9NQVhfQ09OVEVYVF9TSVpFOyBpaSsrKSB7CiAgICAgICAgIFNST01iV3JpdGVFbWJlZGRlZChkd0lvQmFzZSwoQllURSkgaWksICpwYnlFZXByb21SZWdzKTsKICAgICAgICAgcGJ5RWVwcm9tUmVncysrOwpAQCAtMzE1LDEyICszMTUsMTIgQEAKICAqIFJldHVybiBWYWx1ZTogbm9uZQogICoKICAqLwotdm9pZCBTUk9NdlJlYWRFdGhlckFkZHJlc3MgKERXT1JEX1BUUiBkd0lvQmFzZSwgUEJZVEUgcGJ5RXRoZXJBZGRyZXNzKQordm9pZCBTUk9NdlJlYWRFdGhlckFkZHJlc3MoRFdPUkRfUFRSIGR3SW9CYXNlLCBQQllURSBwYnlFdGhlckFkZHJlc3MpCiB7CiAgICAgQllURSAgICAgaWk7CiAKLSAgICAvLyBpaSA9IFJvbSBBZGRyZXNzCi0gICAgZm9yIChpaSA9IDA7IGlpIDwgVV9FVEhFUl9BRERSX0xFTjsg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ZTogbm9uZQogICoKIC0qLwotVk9JRAordm9pZAogVk5UV0lGSXZTZXRPUE1vZGUgKAotICAgIElOIFBWT0lEIHBNZ210SGFuZGxlLAotICAgIElOIFdNQUNfQ09ORklHX01PREUgZU9QTW9kZQorICAgIHZvaWQgKnBNZ210SGFuZGxlLAorICAgIFdNQUNfQ09ORklHX01PREUgZU9QTW9kZQogICAgICkKIHsKICAgICBQU01nbXRPYmplY3QgICAgICAgIHBNZ210ID0gKFBTTWdtdE9iamVjdClwTWdtdEhhbmRsZTsKQEAgLTk4LDEyICs5OCwxMiBAQAogICogUmV0dXJuIFZhbHVlOiBub25lCiAgKgogLSovCi1WT0lECit2b2lkCiBWTlRXSUZJdlNldElCU1NQYXJhbWV0ZXIgKAotICAgIElOIFBWT0lEIHBNZ210SGFuZGxlLAotICAgIElOIFdPUkQgIHdCZWFjb25QZXJpb2QsCi0gICAgSU4gV09SRCAgd0FUSU1XaW5kb3csCi0gICAgSU4gVUlOVCAgdUNoYW5uZWwKKyAgICB2b2lkICpwTWdtdEhhbmRsZSwKKyAgICBXT1JEICB3QmVhY29uUGVyaW9kLAorICAgIFdPUkQgIHdBVElNV2luZG93LAorICAgIFVJTlQgIHVDaGFubmVsCiAgICAgKQogewogICAgIFBTTWdtdE9iamVjdCAgICAgICAgcE1nbXQgPSAoUFNNZ210T2JqZWN0KXBNZ210SGFuZGxlOwpAQCAtMTI5LDcgKzEyOSw3IEBACiAtKi8KIFBXTEFOX0lFX1NTSUQKIFZOVFdJRklwR2V0Q3VycmVudFNTSUQgKAotICAgIElOIFBWT0lEIHBNZ210SGFuZGxlCisgICAgdm9pZCAqcE1nbXRIYW5kbGUKICAgICApCiB7CiAgICAgUFNNZ210T2JqZWN0ICAgICAgICBwTWdtdCA9IChQU01nbXRPYmplY3QpcE1nbXRIYW5kbGU7CkBAIC0xNTIsNyArMTUyLDcgQEAKIC0qLwogVUlOVAogVk5UV0lGSXBHZXRDdXJyZW50Q2hhbm5lbCAoCi0gICAgSU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h5VHlwZQogICAgICkKIHsKICAgICBQU01nbXRPYmplY3QgICAgICAgIHBNZ210ID0gKFBTTWdtdE9iamVjdClwTWdtdEhhbmRsZTsKQEAgLTM3OSwxMCArMzc5LDEwIEBACiB9CiAKIAotVk9JRAordm9pZAogVk5UV0lGSWJHZXRDb25maWdQaHlNb2RlICgKLSAgICBJTiAgUFZPSUQgcE1nbXRIYW5kbGUsCi0gICAgT1VUIFBWT0lEIHBlUGh5VHlwZQorICAgIHZvaWQgKnBNZ210SGFuZGxlLAorICAgIHZvaWQgKnBlUGh5VHlwZQogICAgICkKIHsKICAgICBQU01nbXRPYmplY3QgICAgICAgIHBNZ210ID0gKFBTTWdtdE9iamVjdClwTWdtdEhhbmRsZTsKQEAgLTQyNCwxMSArNDI0LDExIEBACiAgKgogLSovCiAKLVZPSUQKK3ZvaWQKIFZOVFdJRkl2UXVlcnlCU1NMaXN0ICgKLSAgICBJTiBQVk9JRCAgICBwTWdtdEhhbmRsZSwKLSAgICBPVVQgUFVJTlQgICBwdUJTU0NvdW50LAotICAgIE9VVCBQVk9JRCAgICpwdkZpcnN0QlNTCisgICAgdm9pZCAqcE1nbXRIYW5kbGUsCisgICAgUFVJTlQgICBwdUJTU0NvdW50LAorICAgIHZvaWQgKipwdkZpcnN0QlNTCiAgICAgKQogewogICAgIFVJTlQgICAgICAgICAgICBpaSA9IDA7CkBAIC00NTQsMTEgKzQ1NCwxMSBAQAogCiAKIAotVk9JRAordm9pZAogVk5UV0lGSXZHZXROZXh0QlNTICgKLSAgICBJTiBQVk9JRCAgICAgICAgICAgIHBNZ210SGFuZGxlLAotICAgIElOIFBWT0lEICAgICAgICAgICAgcHZDdXJyZW50QlNTLAotICAgIE9VVCBQVk9JRCAgICAgICAgICAgKnB2TmV4dEJTUworICAgIHZvaWQgKnBNZ210SGFuZGxlLAorICAgIHZvaWQgKnB2Q3VycmVudEJTUywKKyAgICB2b2lkICoqcHZOZXh0QlNTCiAgICAgKQogewogICAgIFBLbm93bkJTU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BoZXIoCi0gICAgSU4gUFZPSUQgICAgcE1nbXRIYW5kbGUsCi0gICAgSU4gQk9PTCAgICAgYkdyb3VwS2V5CisgICAgdm9pZCAqcE1nbXRIYW5kbGUsCisgICAgQk9PTCAgICAgYkdyb3VwS2V5CiAgICAgKTsKIAogCkBAIC0yNjQsNDkgKzI2NCw0OSBAQAogCiBCT09MCiBWTlRXSUZJYlNldFBNS0lEQ2FjaGUgKAotICAgIElOIFBWT0lEIHBNZ210T2JqZWN0LAotICAgIElOIFVMT05HIHVsQ291bnQsCi0gICAgSU4gUFZPSUQgcFBNS0lESW5mbworICAgIHZvaWQgKnBNZ210T2JqZWN0LAorICAgIFVMT05HIHVsQ291bnQsCisgICAgdm9pZCAqcFBNS0lESW5mbwogICAgICk7CiAKIEJPT0wKIFZOVFdJRkliQ29tbWFuZFJ1bm5pbmcgKAotICAgIElOIFBWT0lEIHBNZ210T2JqZWN0CisgICAgdm9pZCAqcE1nbXRPYmplY3QKICAgICApOwogCiBXT1JECiBWTlRXSUZJd0dldE1heFN1cHBvcnRSYXRlKAotICAgIElOIFBWT0lEIHBNZ210T2JqZWN0CisgICAgdm9pZCAqcE1nbXRPYmplY3QKICAgICApOwogCiAvLyBmb3IgODAyLjExaAotVk9JRAordm9pZAogVk5UV0lGSXZTZXQxMWggKAotICAgIElOIFBWT0lEIHBNZ210T2JqZWN0LAotICAgIElOIEJPT0wgIGIxMWhFbmFibGUKKyAgICB2b2lkICpwTWdtdE9iamVjdCwKKyAgICBCT09MICBiMTFoRW5hYmxlCiAgICAgKTsKIAogQk9PTAogVk5UV0lGSWJNZWFzdXJlUmVwb3J0KAotICAgIElOIFBWT0lEIHBNZ210T2JqZWN0LAotICAgIElOIEJPT0wgIGJFbmRPZlJlcG9ydCwKLSAgICBJTiBQVk9JRCBwdk1lYXN1cmVFSUQsCi0gICAgSU4gQllURSAgYnlSZXBvcnRNb2RlLAotICAgIElOIEJZVEUgIGJ5QmFzaWNNYXAsCi0gICAgSU4gQllUR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BFX0FDMERNQV0gIT0gMCl7CiAgICAgICAgICAgICAgICAgc3Bpbl91bmxvY2tfaXJxKCZwRGV2aWNlLT5sb2NrKTsKLSAgICAgICAgICAgICAgICB2Q29tbWFuZFRpbWVyV2FpdCgoSEFORExFKXBEZXZpY2UsIDEwKTsKKyAgICAgICAgICAgICAgICB2Q29tbWFuZFRpbWVyV2FpdCgodm9pZCAqKXBEZXZpY2UsIDEwKTsKICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICB9OwogCkBAIC00MjQsNyArNDI0LDcgQEAKICAgICAgICAgICAgICAgICAgICAgcE1nbXQtPmFieVNjYW5CU1NJRFs1XSA9IDB4RkY7CiAgICAgICAgICAgICAgICAgICAgIHBJdGVtU1NJRC0+YnlFbGVtZW50SUQgPSBXTEFOX0VJRF9TU0lEOwogICAgICAgICAgICAgICAgICAgICAvLyBjbGVhciBic3NpZCBsaXN0Ci0gICAgICAgICAgICAgICAgICAgIC8vIEJTU3ZDbGVhckJTU0xpc3QoKEhBTkRMRSlwRGV2aWNlLCBwRGV2aWNlLT5iTGlua1Bhc3MpOworICAgICAgICAgICAgICAgICAgICAvLyBCU1N2Q2xlYXJCU1NMaXN0KCh2b2lkICopcERldmljZSwgcERldmljZS0+YkxpbmtQYXNzKTsKICAgICAgICAgICAgICAgICAgICAgcE1nbXQtPmVTY2FuU3RhdGUgPSBXTUFDX0lTX1NDQU5OSU5HOwogCiAgICAgICAgICAgICAgICAgfQpAQCAtNDUzLDExICs0NTMsMTEgQEAKICAgICAgICAgICAgICAgICAgICAgKHBNZ210LT51U2NhbkNoYW5uZWwgPCBDQl9NQVhfQ0hBTk5FTF8yNEcpKSB7CiAgICAgICAgICAgICAgICAgICAgIHNfdlByb2JlQ2hhbm5lbChwRGV2aWNlKTsKICAgICAgICAgICAgICAgICAgICAgc3Bpbl91bmxvY2tfaXJxKCZwRGV2aWNlLT5sb2NrKTsKLSAgICAgICAgICAgICAgICAgICAgdkNvbW1hbmRUaW1lcldhaXQoKEhBTkRMRSlwRGV2aWNlLCBXQ01EX0FDVElWRV9TQ0FOX1RJTUUpOworICAgICAgICAgICAgICAgICAgICB2Q29tbWFuZFRpbWVyV2FpdCgodm9pZCAqKXBEZXZpY2UsIFdDTURfQUNUSVZFX1NDQU5fVElNRSk7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICBzcGluX3VubG9ja19pcnEoJnBEZXZpY2UtPmxvY2spOwotICAgICAgICAgICAgICAgICAgICB2Q29tbWFuZFRpbWVyV2FpdCgoSEFORExFKXBEZXZpY2UsIFdDTURfUEFTU0lWRV9TQ0FOX1RJTUUpOworICAgICAgICAgICAgICAgICAgICB2Q29tbWFuZFRpbWVyV2FpdCgodm9pZCAqKXBEZXZpY2UsIFdDTURfUEFTU0lWRV9TQ0FOX1RJTUUpOwogICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgfQogCkBAIC01MDEsNyArNTAxLDcgQEAKICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyJTZW5kIERpc2Fzc29jaWF0aW9uIFBhY2tldC4uXG4iKTsKICAgICAgICAgICAgICAgICAvLyByZWFzb24gPSA4IDogZGlzYXNzb2MgYmVjYXVzZSBzdGEgaGFzIGxlZnQKLSAgICAgICAgICAgICAgICB2TWdyRGlzYXNzb2NCZWdpblN0YSgoSEFORExFKXBEZXZpY2UsIHBNZ210LCBwTWdtdC0+YWJ5Q3VyckJTU0lELCAoOCksICZTdGF0dXMpOworICAgICAgICAgICAgICAgIHZNZ3JEaXNhc3NvY0JlZ2luU3RhKCh2b2lkICopcERldmljZSwgcE1nbXQsIHBNZ210LT5hYnlDdXJyQlNTSUQsICg4KSwgJlN0YXR1cyk7CiAgICAgICAgICAgICAgICAgcERldmljZS0+YkxpbmtQYXNzID0gRkFMU0U7CiAgICAgICAgICAgICAgICAgLy8gdW5sb2NrIGNvbW1hbmQgYnVzeQogICAgICAgICAgICAgICAgIHBJdGVtU1NJRCA9IChQV0xBTl9JRV9TU0lEKXBNZ210LT5hYnlDdXJyU1NJRDsKQEAgLTUxNSw3ICs1MTUsNyBAQAogICAgICAgICAgICAgcERldmljZS0+ZUNvbW1hbmRTdGF0ZSA9IFdMQU5fRElTQVNTT0NJQVRFX1dBSVQ7CiAgICAgICAgICAgICAvLyB3YWl0IGFsbCBDb250cm9sIFREIGNvbXBsZXRlCiAgICAgICAgICAgICBpZiAocERldmljZS0+aVREVXNlZFtUWVBFX1RYRE1BMF0gIT0gMCl7Ci0gICAgICAgICAgICAgICAgdkNvbW1hbmRUaW1lcldhaXQoKEhBTkRMRSlwRGV2aWNlLCAxMCk7CisgICAgICAgICAgICAgICAgdkNvbW1hbmRUaW1lcldhaXQoKHZvaWQgKilwRGV2aWNlLCAxMCk7CiAgICAgICAgICAgICAgICAgc3Bpbl91bmxvY2tfaXJxKCZwRGV2aWNlLT5sb2NrKTsKICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICB9OwpAQCAtNTI4LDcgKzUyOCw3IEBACiAgICAgICAgIGNhc2UgV0xBTl9ESVNBU1NPQ0lBVEVfV0FJVCA6CiAgICAgICAgICAgICAvLyB3YWl0IGFsbCBDb250cm9sIFREIGNvbXBsZXRlCiAgICAgICAgICAgICBpZiAocERldmljZS0+aVREVXNlZFtUWVBFX1RYRE1BMF0gIT0gMCl7Ci0gICAgICAgICAgICAgICAgdkNvbW1hbmRUaW1lcldhaXQoKEhBTkRMRSlwRGV2aWNlLCAxMCk7CisgICAgICAgICAgICAgICAgdkNvbW1hbmRUaW1lcldhaXQoKHZvaWQgKilwRGV2aWNlLCAxMCk7CiAgICAgICAgICAgICAgICAgc3Bpbl91bmxvY2tfaXJxKCZwRGV2aWNlLT5sb2NrKTsKICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICB9OwpAQCAtNTc4LDI0ICs1NzgsMjQgQEAKICAgICAgICAgICAgIC8vIHNldCBpbml0aWFsIHN0YXRlCiAgICAgICAgICAgICBwTWdtdC0+ZUN1cnJTdGF0ZSA9IFdNQUNfU1RBVEVfSURMRTsKICAgICAgICAgICAgIHBNZ210LT5lQ3Vyck1vZGUgPSBXTUFDX01PREVfU1RBTkRCWTsKLSAgICAgICAgICAgIFBTdkRpc2FibGVQb3dlclNhdmluZygoSEFORExFKXBEZXZpY2UpOworICAgICAgICAgICAgUFN2RGlzYWJsZVBvd2VyU2F2aW5nKCh2b2lkICopcERldmljZSk7CiAgICAgICAgICAgICBCU1N2Q2xlYXJOb2RlREJUYWJsZShwRGV2aWNlLCAwKTsKIAotICAgICAgICAgICAgdk1nckpvaW5CU1NCZWdpbigoSEFORExFKXBEZXZpY2UsICZTdGF0dXMpOworICAgICAgICAgICAgdk1nckpvaW5CU1NCZWdpbigodm9pZCAqKXBEZXZpY2UsICZTdGF0dXMpOwogICAgICAgICAgICAgLy8gaWYgSW5mcmEgbW9kZQogICAgICAgICAgICAgaWYgKChwTWdtdC0+ZUN1cnJNb2RlID09IFdNQUNfTU9ERV9FU1NfU1RBKSAmJiAocE1nbXQtPmVDdXJyU3RhdGUgPT0gV01BQ19TVEFURV9KT0lOVEVEKSkgewogCiAJCS8vIENhbGwgbWdyIHRvIGJlZ2luIHRoZSBkZWF1dGhlbnRpY2F0aW9uCiAgICAgICAgICAgICAgICAgLy8gcmVhc29uID0gKDMpIGJlYWN1c2Ugc3RhIGhhcyBsZWZ0IEVTUwogICAgICAgICAgICAgICAgIGlmIChwTWdtdC0+ZUN1cnJTdGF0ZT49IFdNQUNfU1RBVEVfQVVUSCkgewotICAgICAgICAgICAgICAgICAgICB2TWdyRGVBdXRoZW5CZWdpblN0YSgoSEFORExFKXBEZXZpY2UsIHBNZ210LCBwTWdtdC0+YWJ5Q3VyckJTU0lELCAoMyksICZTdGF0dXMpOworICAgICAgICAgICAgICAgICAgICB2TWdyRGVBdXRoZW5CZWdpblN0YSgodm9pZCAqKXBEZXZpY2UsIHBNZ210LCBwTWdtdC0+YWJ5Q3VyckJTU0lELCAoMyksICZTdGF0dXMpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAvLyBDYWxsIG1nciB0byBiZWdpbiB0aGUgYXV0aGVudGljYXRpb24KLSAgICAgICAgICAgICAgICB2TWdyQXV0aGVuQmVnaW5TdGEoKEhBTkRMRSlwRGV2aWNlLCBwTWdtdCwgJlN0YXR1cyk7CisgICAgICAgICAgICAgICAgdk1nckF1dGhlbkJlZ2luU3RhKCh2b2lkICopcERldmljZSwgcE1nbXQsICZTdGF0dXMpOwogICAgICAgICAgICAgICAgIGlmIChTdGF0dXMgPT0gQ01EX1NUQVRVU19TVUNDRVNTKSB7CiAJCXBEZXZpY2UtPmJ5TGlua1dhaXRDb3VudCA9IDA7CiAgICAgICAgICAgICAgICAgICAgIHBEZXZpY2UtPmVDb21tYW5kU3RhdGUgPSBXTEFOX0FVVEhFTlRJQ0FURV9XQUlUOwotICAgICAgICAgICAgICAgICAgICB2Q29tbWFuZFRpbWVyV2FpdCgoSEFORExFKXBEZXZpY2UsIEFVVEhFTlRJQ0FURV9USU1FT1VUKTsKKyAgICAgICAgICAgICAgICAgICAgdkNvbW1hbmRUaW1lcldhaXQoKHZvaWQgKilwRGV2aWNlLCBBVVRIRU5USUNBVEVfVElNRU9VVCk7CiAgICAgICAgICAgICAgICAgICAgIHNwaW5fdW5sb2NrX2lycSgmcERldmljZS0+bG9jayk7CiAgICAgICAgICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8iIFNldCBlQ29tbWFuZFN0YXRlID0gV0xBTl9BVVRIRU5USUNBVEVfV0FJVFxuIik7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKQEAgLTYxNSw3ICs2MTUsNyBAQAogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgLy8gc3RhcnQgb3duIElCU1MKLSAgICAgICAgICAgICAgICAgICAgdk1nckNyZWF0ZU93bklCU1MoKEhBTkRMRSlwRGV2aWNlLCAmU3RhdHVzKTsKKyAgICAgICAgICAgICAgICAgICAgdk1nckNyZWF0ZU93bklCU1MoKHZvaWQgKilwRGV2aWNlLCAmU3RhdHVzKTsKICAgICAgICAgICAgICAgICAgICAgaWYgKFN0YXR1cyAhPSBDTURfU1RBVFVTX1NVQ0NFU1MpewogICAgICAgICAgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyAiIFdMQU5fQ01EX0lCU1NfQ1JFQVRFIGZhaWwgISBcbiIpOwogICAgICAgICAgICAgICAgICAgICB9OwpAQCAtNjI3LDcgKzYyNyw3IEBACiAgICAgICAgICAgICAgICAgaWYgKHBNZ210LT5lQ29uZmlnTW9kZSA9PSBXTUFDX0NPTkZJR19JQlNTX1NUQSB8fAogICAgICAgICAgICAgICAgICAgICBwTWdtdC0+ZUNvbmZpZ01vZGUgPT0gV01BQ19DT05GSUdfQVVUTykgewogICAgICAgICAgICAgICAgICAgICAvLyBzdGFydCBvd24gSUJTUwotICAgICAgICAgICAgICAgICAgICB2TWdyQ3JlYXRlT3duSUJTUygoSEFORExFKXBEZXZpY2UsICZTdGF0dXMpOworICAgICAgICAgICAgICAgICAgICB2TWdyQ3JlYXRlT3duSUJTUygodm9pZCAqKXBEZXZpY2UsICZTdGF0dXMpOwogICAgICAgICAgICAgICAgICAgICBpZiAoU3RhdHVzICE9IENNRF9TVEFUVVNfU1VDQ0VTUyl7CiAgICAgICAgICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPIiBXTEFOX0NNRF9JQlNTX0NSRUFURSBmYWlsICEgXG4iKTsKICAgICAgICAgICAgICAgICAgICAgfTsKQEAgLTY2MSwxMiArNjYxLDEyIEBACiAgICAgICAgICAgICAgICAgLy8gQ2FsbCBtZ3IgdG8gYmVnaW4gdGhlIGFzc29jaWF0aW9uCiAgICAgICAgICAgICAgICAgCXBEZXZpY2UtPmJ5TGlua1dhaXRDb3VudCA9IDA7CiAgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyJlQ3VyclN0YXRlID09IFdNQUNfU1RBVEVfQVVUSFxuIik7Ci0gICAgICAgICAgICAgICAgdk1nckFzc29jQmVnaW5TdGEoKEhBTkRMRSlwRGV2aWNlLCBwTWdtdCwgJlN0YXR1cyk7CisgICAgICAgICAgICAgICAgdk1nckFzc29jQmVnaW5TdGEoKHZvaWQgKilwRGV2aWNlLCBwTWdtdCwgJlN0YXR1cyk7CiAgICAgICAgICAgICAgICAgaWYgKFN0YXR1cyA9PSBDTURfU1RBVFVTX1NVQ0NFU1MpIHsKIAkJcERldmljZS0+YnlMaW5rV2FpdENvdW50ID0gMDsKICAgICAgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyJlQ29tbWFuZFN0YXRlID0gV0xBTl9BU1NPQ0lBVEVfV0FJVFxuIik7CiAgICAgICAgICAgICAgICAgICAgIHBEZXZpY2UtPmVDb21tYW5kU3RhdGUgPSBXTEFOX0FTU09DSUFURV9XQUlUOwotICAgICAgICAgICAgICAgICAgICB2Q29tbWFuZFRpbWVyV2FpdCgoSEFORExFKXBEZXZpY2UsIEFTU09DSUFURV9USU1FT1VUKTsKKyAgICAgICAgICAgICAgICAgICAgdkNvbW1hbmRUaW1lcldhaXQoKHZvaWQgKilwRGV2aWNlLCBBU1NPQ0lBVEVfVElNRU9VVCk7CiAgICAgICAgICAgICAgICAgICAgIHNwaW5fdW5sb2NrX2lycSgmcERldmljZS0+bG9jayk7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICB9CkBAIC02NzksNyArNjc5LDcgQE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V1BBKSB7CiAgICAgICAgICAgICAgICAgICAgIEtleWJSZW1vdmVBbGxLZXkoJihwRGV2aWNlLT5zS2V5KSwgcERldmljZS0+YWJ5QlNTSUQsIHBEZXZpY2UtPlBvcnRPZmZzZXQpOwpAQCAtNzQzLDcgKzc0Myw3IEBACiAgICAgICAgICAgICAgICAgcERldmljZS0+YnlMaW5rV2FpdENvdW50ICsrOwogCSAgICAgICBwcmludGsoIldMQU5fQVNTT0NJQVRFX1dBSVQ6d2FpdCAlZCB0aW1lcyEhXG4iLHBEZXZpY2UtPmJ5TGlua1dhaXRDb3VudCk7CiAJICAgICAgIHNwaW5fdW5sb2NrX2lycSgmcERldmljZS0+bG9jayk7Ci0JICAgICAgIHZDb21tYW5kVGltZXJXYWl0KChIQU5ETEUpcERldmljZSwgQVNTT0NJQVRFX1RJTUVPVVQvMik7CisJICAgICAgIHZDb21tYW5kVGltZXJXYWl0KCh2b2lkICopcERldmljZSwgQVNTT0NJQVRFX1RJTUVPVVQvMik7CiAJICAgICAgIHJldHVybjsKIAkgICB9CiAJICAgICAgICAgIHBEZXZpY2UtPmJ5TGlua1dhaXRDb3VudCA9IDA7CkBAIC03NzksNyArNzc5LDcgQEAKICAgICAgICAgICAgICAgICBwTWdtdC0+ZUN1cnJTdGF0ZSA9IFdNQUNfU1RBVEVfSURMRTsKICAgICAgICAgICAgICAgICBwRGV2aWNlLT5iRml4UmF0ZSA9IEZBTFNFOwogCi0gICAgICAgICAgICAgICAgdk1nckNyZWF0ZU93bklCU1MoKEhBTkRMRSlwRGV2aWNlLCAmU3RhdHVzKTsKKyAgICAgICAgICAgICAgICB2TWdyQ3JlYXRlT3duSUJTUygodm9pZCAqKXBEZXZpY2UsICZTdGF0dXMpOwogICAgICAgICAgICAgICAgIGlmIChTdGF0dXMgIT0gQ01EX1NUQVRVU19TVUNDRVNTKXsKICAgICAgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyAiIHZNZ3JDcmVhdGVPd25JQlNTIGZhaWwgISBcbiIpOwogICAgICAgICAgICAgICAgIH07CkBAIC04NjksMTIgKzg2OSwxMiBAQAogICAgICAgICAgICAgLy9EQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPImVDb21tYW5kU3RhdGUgPT0gV0xBTl9DTURfQ0hFQ0tfQkJTRU5TSVRJVklUWV9TVEFSVFxuIik7CiAgICAgICAgICAgICAvLyB3YWl0IGFsbCBURCBjb21wbGV0ZQogICAgICAgICAgICAgaWYgKHBEZXZpY2UtPmlURFVzZWRbVFlQRV9BQzBETUFdICE9IDApewotICAgICAgICAgICAgICAgIHZDb21tYW5kVGltZXJXYWl0KChIQU5ETEUpcERldmljZSwgMTApOworICAgICAgICAgICAgICAgIHZDb21tYW5kVGltZXJXYWl0KCh2b2lkICopcERldmljZSwgMTApOwogICAgICAgICAgICAgICAgIHNwaW5fdW5sb2NrX2lycSgmcERldmljZS0+bG9jayk7CiAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgaWYgKHBEZXZpY2UtPmlURFVzZWRbVFlQRV9UWERNQTBdICE9IDApewotICAgICAgICAgICAgICAgIHZDb21tYW5kVGltZXJXYWl0KChIQU5ETEUpcERldmljZSwgMTApOworICAgICAgICAgICAgICAgIHZDb21tYW5kVGltZXJXYWl0KCh2b2lkICopcERldmljZSwgMTApOwogICAgICAgICAgICAgICAgIHNwaW5fdW5sb2NrX2lycSgmcERldmljZS0+bG9jayk7CiAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgfQpAQCAtOTcxLDcgKzk3MSw3IEBACiAKICAgICAgICAgfQogCi0gICAgICAgIHZDb21tYW5kVGltZXJXYWl0KChIQU5ETEUpcERldmljZSwgMCk7CisgICAgICAgIHZDb21tYW5kVGltZXJXYWl0KCh2b2lkICopcERldmljZSwgMCk7CiAgICAgfQogCiAgICAgcmV0dXJuIFRSVUU7CkBAIC05ODAsOSArOTgwLDkgQEAKIAogCiBCT09MIGJTY2hlZHVsZUNvbW1hbmQgKAotICAgIElOIEhBTkRMRSBoRGV2aWNlQ29udGV4dCwKLSAgICBJTiBDTURfQ09ERSAgICBlQ29tbWFuZCwKLSAgICBJTiBQQllURSAgICAgICBwYnlJdGVtMAorICAgIHZvaWQgKmhEZXZpY2VDb250ZXh0LAorICAgIENNRF9DT0RFICAgIGVDb21tYW5kLAorICAgIFBCWVRFICAgICAgIHBieUl0ZW0wCiAgICAgKQogewogICAgIFBTRGV2aWNlICAgICAgICBwRGV2aWNlID0gKFBTRGV2aWNlKWhEZXZpY2VDb250ZXh0OwpAQCAtMTA2MSw3ICsxMDYxLDcgQEAKICAqCiAgKi8KIEJPT0wgYkNsZWFyQlNTSURfU0NBTiAoCi0gICAgSU4gSEFORExFIGhEZXZpY2VDb250ZXh0CisgICAgdm9pZCAqaERldmljZUNvbnRleHQKICAgICApCiB7CiAgICAgUFNEZXZpY2UgICAgICAgIHBEZXZpY2UgPSAoUFNEZXZpY2UpaERldmljZUNvbnRleHQ7CkBAIC0xMDgxLDkgKzEwODEsOSBAQAogfQogCiAvL21pa2UgYWRkOnJlc2V0IGNvbW1hbmQgdGltZXIKLVZPSUQKK3ZvaWQKIHZSZXNldENvbW1hbmRUaW1lcigKLSAgICBJTiBIQU5ETEUgICAgICBoRGV2aWNlQ29udGV4dAorICAgIHZvaWQgKmhEZXZpY2VDb250ZXh0CiAgICAgKQogewogICBQU0RldmljZSAgICAgICAgcERldmljZSA9IChQU0RldmljZSloRGV2aWNlQ29udGV4dDsKQEAgLTExMDUsOSArMTEwNSw5IEBACiAKIAogI2lmZGVmIFR4SW5TbGVlcAotVk9JRAordm9pZAogQlNTdlNlY29uZFR4RGF0YSgKLSAgICBJTiAgSEFORExFICAgICAgaERldmljZUNvbnRleHQKKyAgICB2b2lkICpoRGV2aWNlQ29udGV4dAogICAgICkKIHsKICAgUFNEZXZpY2UgICAgICAgIHBEZXZpY2UgPSAoUFNE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b2lkCiB2TWdyVGltZXJJbml0KAotICAgIElOICBIQU5ETEUgaERldmljZUNvbnRleHQKKyAgICB2b2lkICpoRGV2aWNlQ29udGV4dAogICAgICkKIHsKICAgICBQU0RldmljZSAgICAgcERldmljZSA9IChQU0RldmljZSloRGV2aWNlQ29udGV4dDsKQEAgLTQzMSw5ICs0MzEsOSBAQAogICoKIC0qLwogCi1WT0lECit2b2lkCiB2TWdyT2JqZWN0UmVzZXQoCi0gICAgSU4gIEhBTkRMRSBoRGV2aWNlQ29udGV4dAorICAgIHZvaWQgKmhEZXZpY2VDb250ZXh0CiAgICAgKQogewogICAgIFBTRGV2aWNlICAgICAgICAgcERldmljZSA9IChQU0RldmljZSloRGV2aWNlQ29udGV4dDsKQEAgLTQ2MCwxMSArNDYwLDExIEBACiAtKi8KIAogCi1WT0lECit2b2lkCiB2TWdyQXNzb2NCZWdpblN0YSgKLSAgICBJTiAgSEFORExFIGhEZXZpY2VDb250ZXh0LAotICAgIElOICBQU01nbXRPYmplY3QgcE1nbXQsCi0gICAgT1VUIFBDTURfU1RBVFVTIHBTdGF0dXMKKyAgICB2b2lkICpoRGV2aWNlQ29udGV4dCwKKyAgICBQU01nbXRPYmplY3QgcE1nbXQsCisgICAgUENNRF9TVEFUVVMgcFN0YXR1cwogICAgICkKIHsKICAgICBQU0RldmljZSAgICAgICAgICAgICBwRGV2aWNlID0gKFBTRGV2aWNlKWhEZXZpY2VDb250ZXh0OwpAQCAtNTM2LDExICs1MzYsMTEgQEAKICAqCiAtKi8KIAotVk9JRAordm9pZAogdk1nclJlQXNzb2NCZWdpblN0YSgKLSAgICBJTiAgSEFORExFIGhEZXZpY2VDb250ZXh0LAotICAgIElOICBQU01nbXRPYmplY3QgcE1nbXQsCi0gICAgT1VUIFBDTURfU1RBVFVTIHBTdGF0dXMKKyAgICB2b2lkICpoRGV2aWNlQ29udGV4dCwKKyAgICBQU01nbXRPYmplY3QgcE1nbXQsCisgICAgUENNRF9TVEFUVVMgcFN0YXR1c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ICAgICAgIH0KIAogCi0gICAgICAgIFJBVEV2UGFyc2VNYXhSYXRlKChQVk9JRClwRGV2aWNlLAorICAgICAgICBSQVRFdlBhcnNlTWF4UmF0ZSgodm9pZCAqKXBEZXZpY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoUFdMQU5fSUVfU1VQUF9SQVRFUylhYnlDdXJyU3VwcFJhdGVzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgKFBXTEFOX0lFX1NVUFBfUkFURVMpYWJ5Q3VyckV4dFN1cHBSYXRlcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZBTFNFLCAvLyBkbyBub3QgY2hhbmdlIG91ciBiYXNpYyByYXRlCkBAIC04NDAsMTIgKzg0MCwxMiBAQAogLSovCiAKIHN0YXRpYwotVk9JRAordm9pZAogc192TWdyUnhSZUFzc29jUmVxdWVzdCgKLSAgICBJTiBQU0RldmljZSBwRGV2aWNlLAotICAgIElOIFBTTWdtdE9iamVjdCBwTWdtdCwKLSAgICBJTiBQU1J4TWdtdFBhY2tldCBwUnhQYWNrZXQsCi0gICAgSU4gVUlOVCB1Tm9kZUluZGV4CisgICAgUFNEZXZpY2UgcERldmljZSwKKyAgICBQU01nbXRPYmplY3QgcE1nbXQsCisgICAgUFNSeE1nbXRQYWNrZXQgcFJ4UGFja2V0LAorICAgIFVJTlQgdU5vZGVJbmRleAogICAgICkKIHsKICAgICBXTEFOX0ZSX1JFQVNTT0NSRVEgICAgc0ZyYW1lOwpAQCAtODk1LDcgKzg5NSw3IEBACiAgICAgICAgIH0KIAogCi0gICAgICAgIFJBVEV2UGFyc2VNYXhSYXRlKChQVk9JRClwRGV2aWNlLAorICAgICAgICBSQVRFdlBhcnNlTWF4UmF0ZSgodm9pZCAqKXBEZXZpY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgIChQV0xBTl9JRV9TVVBQX1JBVEVTKWFieUN1cnJTdXBwUmF0ZXMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgIChQ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BVVRIRU4gcEZyYW1lCisgICAgUFNEZXZpY2UgcERldmljZSwKKyAgICBQU01nbXRPYmplY3QgcE1nbXQsCisgICAgUFdMQU5fRlJfQVVUSEVOIHBGcmFtZQogICAgICkKIHsKICAgICBXTEFOX0ZSX0FVVEhFTiAgICAgIHNGcmFtZTsKQEAgLTE0NTUsNyArMTQ1NSw3IEBACiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAocERldmljZS0+ZUNvbW1hbmRTdGF0ZSA9PSBXTEFOX0FVVEhFTlRJQ0FURV9XQUlUICkgewogLy8gICAgICAgICAgICAgICAgc3Bpbl91bmxvY2tfaXJxKCZwRGV2aWNlLT5sb2NrKTsKLS8vICAgICAgICAgICAgICAgIHZDb21tYW5kVGltZXJXYWl0KChIQU5ETEUpcERldmljZSwgMCk7CisvLyAgICAgICAgICAgICAgICB2Q29tbWFuZFRpbWVyV2FpdCgodm9pZCAqKXBEZXZpY2UsIDApOwogLy8gICAgICAgICAgICAgICAgc3Bpbl9sb2NrX2lycSgmcERldmljZS0+bG9jayk7CiAgICAgICAgICAgICB9CiAKQEAgLTE1MDIsNyArMTUwMiw3IEBACiAgICAgICAgICAgICAJREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyAiTWd0OnJ4IEF1dGhfcmVwbHkgc2VxdWVuY2VfMiBzdGF0dXMgZXJyb3IgLi4uXG4iKTsKICAgICAgICAgICAgICAgICBpZiAoIHBEZXZpY2UtPmVDb21tYW5kU3RhdGUgPT0gV0xBTl9BVVRIRU5USUNBVEVfV0FJVCApIHsKIC8vICAgICAgICAgICAgICAgICAgICBzcGluX3VubG9ja19pcnEoJnBEZXZpY2UtPmxvY2spOwotLy8gICAgICAgICAgICAgICAgICAgIHZDb21tYW5kVGltZXJXYWl0KChIQU5ETEUpcERldmljZSwgMCk7CisvLyAgICAgICAgICAgICAgICAgICAgdkNvbW1hbmRUaW1lcldhaXQoKHZvaWQgKilwRGV2aWNlLCAwKTsKIC8v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gICAgICAgICAgICAgc0ZyYW1lLnBIZHItPnNBMy5hYnlBZGRyMywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqc0ZyYW1lLnBxd1RpbWVzdGFtcCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqc0ZyYW1lLnB3QmVhY29uSW50ZXJ2YWwsCkBAIC0xOTYyLDEyICsxOTYyLDEyIEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc0ZyYW1lLnBJRV9RdWlldCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzRnJhbWUubGVuIC0gV0xBTl9IRFJfQUREUjNfTEVOLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNGcmFtZS5wSGRyLT5zQTQuYWJ5QWRkcjQsICAgLy8gcGF5bG9hZCBvZiBiZWFjb24KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAoSEFORExFKXBSeFBhY2tldAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopcFJ4UGFja2V0CiAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwogICAgIH0KICAgICBlbHNlIHsKIC8vICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPInVwZGF0ZSBiY246IFJ4Q2hhbm5lbCA9IDogJWRcbiIsIGJ5Q3VyckNoYW5uZWwpOwotICAgICAgICBCU1NiVXBkYXRlVG9CU1NMaXN0KChIQU5ETEUpcERldmljZSwKKyAgICAgICAgQlNTYlVwZGF0ZVRvQlNTTGlzdCgodm9pZCAqKXBEZXZpY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKnNGcmFtZS5wcXdUaW1lc3RhbXAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKnNGcmFtZS5wd0JlYWNvbkludGVydmFsLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICpzRnJhbWUucHdDYXBJbmZvLApAQCAtMTk4NCw3ICsxOTg0LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQlNTTGlzdCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzRnJhbWUubGVuIC0gV0xBTl9IRFJfQUREUjNfTEVOLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNGcmFtZS5wSGRyLT5zQTQuYWJ5QWRkcjQsICAgLy8gcGF5bG9hZCBvZiBwcm9icmVzcG9uc2UKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAoSEFORExFKXBSeFBhY2tldAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopcFJ4UGFja2V0CiAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwogCiAgICAgfQpAQCAtMjA5MSw3ICsyMDkxLDcgQEAKICAgICAgICAgICAgIHBNZ210LT5hYnlDdXJyRXh0U3VwcFJhdGVzWzFdID0gUkFURXVTZXRJRSgoUFdMQU5fSUVfU1VQUF9SQVRFUylwQlNTTGlzdC0+YWJ5RXh0U3VwcFJhdGVzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChQV0xBTl9JRV9TVVBQX1JBVEVTKXBNZ210LT5hYnlDdXJyRXh0U3VwcFJhdGVzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVSYXRlTGVuKTsKLSAgICAgICAgICAgIFJBVEV2UGFyc2VNYXhSYXRlKCAoUFZPSUQpcERldmljZSwKKyAgICAgICAgICAgIFJBVEV2UGFyc2VNYXhSYXRlKCAodm9pZCAqKXBEZXZpY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFBXTEFOX0lFX1NVUFBfUkFURVMpcE1nbXQtPmFieUN1cnJTdXBwUmF0ZXMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFBXTEFOX0lFX1NVUFBfUkFURVMpcE1nbXQtPmFieUN1cnJFeHRTdXBwUmF0ZXMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVFJVRSwKQEAgLTIyNTYsNyArMjI1Niw3IEBACiAgICAgICAgICAgICAgICAgcE1nbXQtPmFieUN1cnJTdXBwUmF0ZXNbMV0gPSBSQVRFdVNldElFKChQV0xBTl9JRV9TVVBQX1JBVEVTKXNGcmFtZS5wU3VwcFJhdGVzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoUFdMQU5fSUVfU1VQUF9SQVRFUylwTWdtdC0+YWJ5Q3VyclN1cHBSYXRlcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTl9SQVRFU19NQVhMRU5fMTFCKTsKLSAgICAgICAgICAgICAgICBSQVRFdlBhcnNlTWF4UmF0ZSggKFBWT0lEKXBEZXZpY2UsCisgICAgICAgICAgICAgICAgUkFURXZQYXJzZU1heFJhdGUoICh2b2lkICopcERldmljZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFBXTEFOX0lFX1NVUFBfUkFURVMpcE1nbXQtPmFieUN1cnJTdXBwUmF0ZXMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRSVUUsCkBAIC0yMjc3LDcgKzIyNzcsNyBAQAogICAgICAgICAgICAgICAgIHBNZ210LT5hYnlDdXJyU3VwcFJhdGVzWzFdID0gUkFURXVTZXRJRSgoUFdMQU5fSUVfU1VQUF9SQVRFUylzRnJhbWUucFN1cHBSYXRlcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFBXTEFOX0lFX1NVUFBfUkFURVMpcE1nbXQtPmFieUN1cnJTdXBwUmF0ZXMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5fUkFURVNfTUFYTEVOXzExQik7Ci0gICAgICAgICAgICAgICAgUkFURXZQYXJzZU1heFJhdGUoIChQVk9JRClwRGV2aWNlLAorICAgICAgICAgICAgICAgIFJBVEV2UGFyc2VNYXhSYXRlKCAodm9pZCAqKXBEZXZpY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChQV0xBTl9JRV9TVVBQX1JBVEVTKXBNZ210LT5hYnlDdXJyU3VwcFJhdGVzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUUlVFLApAQCAtMjM1Myw3ICsyMzUzLDcgQEAKICAgICAgICAgICAgICAgICAgICAgIC8vIHNldCBoaWdoZXN0IGJhc2ljIHJhdGUKICAgICAgICAgICAgICAgICAgICAgIC8vIHNfdlNldEhpZ2hlc3RCYXNpY1JhdGUocERldmljZSwgKFBXTEFOX0lFX1NVUFBfUkFURVMpcE1nbXQtPmFieUN1cnJTdXBwUmF0ZXMpOwogICAgICAgICAgICAgICAgICAgICAgLy8gUHJlcGFyZSBiZWFjb24gZnJhbWUKLSAgICAgICAgICAgICAgICAgICAgIGJNZ3JQcmVwYXJlQmVhY29uVG9TZW5kKChIQU5ETEUpcERldmljZSwgcE1nbXQpOworICAgICAgICAgICAgICAgICAgICAgYk1nclByZXBhcmVCZWFjb25Ub1NlbmQoKHZvaWQgKilwRGV2aWNlLCBwTWdtdCk7CiAgICAgICAgICAgICAgIC8vICB9CiAgICAgICAgICAgICB9OwogICAgICAgICB9CkBAIC0yMzg0LDEwICsyMzg0LDEwIEBACiAgKiAgICBDTURfU1RBVFVTCiAgKgogLSovCi1WT0lECit2b2lkCiB2TWdyQ3JlYXRlT3duSUJTUygKLSAgICBJTiAgSEFORExFIGhEZXZpY2VDb250ZXh0LAotICAgIE9VVCBQQ01EX1NUQVRVUyBwU3RhdHVzCisgICAgdm9pZCAqaERldmljZUNvbnRleHQsCisgICAgUENNRF9TVEFUVVMgcFN0YXR1cw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gICAgICAgICAgQk9PTCBiUmVzdWx0ID0gYkFkZF9QTUtJRF9DYW5kaWRhdGUoKHZvaWQgKilwRGV2aWNlLCBwTWdtdC0+YWJ5Q3VyckJTU0lELCAmcEN1cnItPnNSU05DYXBPYmopOwogICAgICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8iYkFkZF9QTUtJRF9DYW5kaWRhdGU6IDEoJWQpXG4iLCBiUmVzdWx0KTsKICAgICAgICAgICAgICAgICBpZiAoYlJlc3VsdCA9PSBGQUxTRSkgewotICAgICAgICAgICAgICAgICAgICB2Rmx1c2hfUE1LSURfQ2FuZGlkYXRlKChIQU5ETEUpcERldmljZSk7CisgICAgICAgICAgICAgICAgICAgIHZGbHVzaF9QTUtJRF9DYW5kaWRhdGUoKHZvaWQgKilwRGV2aWNlKTsKICAgICAgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyJ2Rmx1c2hfUE1LSURfQ2FuZGlkYXRlOiA0XG4iKTsKLSAgICAgICAgICAgICAgICAgICAgYkFkZF9QTUtJRF9DYW5kaWRhdGUoKEhBTkRMRSlwRGV2aWNlLCBwTWdtdC0+YWJ5Q3VyckJTU0lELCAmcEN1cnItPnNSU05DYXBPYmopOworICAgICAgICAgICAgICAgICAgICBiQWRkX1BNS0lEX0NhbmRpZGF0ZSgodm9pZCAqKXBEZXZpY2UsIHBNZ210LT5hYnlDdXJyQlNTSUQsICZwQ3Vyci0+c1JTTkNhcE9iaik7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogCkBAIC0yODY3LDcgKzI4NjcsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChQV0xBTl9JRV9TVVBQX1JBVEVTKXBNZ210LT5hYnlDdXJyU3VwcFJhdGVzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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amVjdCBwTWdtdCwKKyAgICBQU1J4TWdtdFBhY2tldCBwUnhQYWNrZXQKICAgICApCiB7CiAgICAgUEtub3duQlNTICAgICAgICAgICBwQlNTTGlzdCA9IE5VTEw7CkBAIC00Mzc4LDkgKzQzNzgsOSBAQAogCiAKICAgICAvLyB1cGRhdGUgb3IgaW5zZXJ0IHRoZSBic3MKLSAgICBwQlNTTGlzdCA9IEJTU3BBZGRySXNJbkJTU0xpc3QoKEhBTkRMRSlwRGV2aWNlLCBzRnJhbWUucEhkci0+c0EzLmFieUFkZHIzLCBzRnJhbWUucFNTSUQpOworICAgIHBCU1NMaXN0ID0gQlNTcEFkZHJJc0luQlNTTGlzdCgodm9pZCAqKXBEZXZpY2UsIHNGcmFtZS5wSGRyLT5zQTMuYWJ5QWRkcjMsIHNGcmFtZS5wU1NJRCk7CiAgICAgaWYgKHBCU1NMaXN0KSB7Ci0gICAgICAgIEJTU2JVcGRhdGVUb0JTU0xpc3QoKEhBTkRMRSlwRGV2aWNlLAorICAgICAgICBCU1NiVXBkYXRlVG9CU1NMaXN0KCh2b2lkICopcERldmljZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqc0ZyYW1lLnBxd1RpbWVzdGFtcCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqc0ZyYW1lLnB3QmVhY29uSW50ZXJ2YWwsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKnNGcmFtZS5wd0NhcEluZm8sCkBAIC00Mzk3LDEyICs0Mzk3LDEyIEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEJTU0xpc3QsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc0ZyYW1lLmxlbiAtIFdMQU5fSERSX0FERFIzX0xFTiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzRnJhbWUucEhkci0+c0E0LmFieUFkZHI0LCAgIC8vIHBheWxvYWQgb2YgcHJvYnJlc3BvbnNlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKEhBTkRMRSlwUnhQYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKXBSeFBhY2tldAogICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsKICAgICB9CiAgICAgZWxzZSB7CiAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8iUHJvYmUgcmVzcC9pbnNlcnQ6IFJ4Q2hhbm5lbCA9IDogJWRcbiIsIGJ5Q3VyckNoYW5uZWwpOwotICAgICAgICBCU1NiSW5zZXJ0VG9CU1NMaXN0KChIQU5ETEUpcERldmljZSwKKyAgICAgICAgQlNTYkluc2VydFRvQlNTTGlzdCgodm9pZCAqKXBEZXZpY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc0ZyYW1lLnBIZHItPnNBMy5hYnlBZGRyMywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqc0ZyYW1lLnBxd1RpbWVzdGFtcCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqc0ZyYW1lLnB3QmVhY29uSW50ZXJ2YWwsCkBAIC00NDE4LDcgKzQ0MTgsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNGcmFtZS5wSUVfUXVpZXQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc0ZyYW1lLmxlbiAtIFdMQU5fSERSX0FERFIzX0xFTiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzRnJhbWUucEhkci0+c0E0LmFieUFkZHI0LCAgIC8vIHBheWxvYWQgb2YgYmVhY29uCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKEhBTkRMRSlwUnhQYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKXBSeFBhY2tldAogICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsKICAgICB9CiAgICAgcmV0dXJuOwpAQCAtNDQzOCwxMSArNDQzOCwxMSBAQAogCiAKIHN0YXRpYwotVk9JRAordm9pZAogc192TWdyUnhQcm9iZVJlcXVlc3QoCi0gICAgSU4gUFNEZXZpY2UgcERldmljZSwKLSAgICBJTiBQU01nbXRPYmplY3QgcE1nbXQsCi0gICAgSU4gUFNSeE1nbXRQYWNrZXQgcFJ4UGFja2V0CisgICAgUFNEZXZpY2UgcERldmljZSwKKyAgICBQU01nbXRPYmplY3QgcE1nbXQsCisgICAgUFNSeE1nbXRQYWNrZXQgcFJ4UGFja2V0CiAgICAgKQogewogICAgIFdMQU5fRlJfUFJPQkVSRVEgICAgc0ZyYW1lOwpAQCAtNDUzNCwxMSArNDUzNCwxMSBAQAogLSovCiAKIAotVk9JRAordm9pZAogdk1nclJ4TWFuYWdlUGFja2V0KAotICAgIElOICBIQU5ETEUgaERldmljZUNvbnRleHQsCi0gICAgSU4gUFNNZ210T2JqZWN0IHBNZ210LAotICAgIElOIFBTUnhNZ210UGFja2V0IHBSeFBhY2tldAorICAgIHZvaWQgKmhEZXZpY2VDb250ZXh0LAorICAgIFBTTWdtdE9iamVjdCBwTWdtdCwKKyAgICBQU1J4TWdtdFBhY2tldCBwUnhQYWNrZXQKICAgICAgKQogewogICAgIFBTRGV2aWNlICAgIHBEZXZpY2UgPSAoUFNEZXZpY2UpaERldmljZUNvbnRleHQ7CkBAIC00Njg1LDggKzQ2ODUsOCBAQAogLSovCiBCT09MCiBiTWdyUHJlcGFyZUJlYWNvblRvU2VuZCgKLSAgICBJTiBIQU5ETEUgaERldmljZUNvbnRleHQsCi0gICAgSU4gUFNNZ210T2JqZWN0IHBNZ210CisgICAgdm9pZCAqaERldmljZUNvbnRleHQsCisgICAgUFNNZ210T2JqZWN0IHBNZ210CiAgICAgKQogewogICAgIFBTRGV2aWNlICAgICAgICAgICAgcERldmljZSA9IChQU0RldmljZSloRGV2aWNlQ29udGV4dDsKQEAgLTQ3MzgsMTAgKzQ3MzgsMTAgQEAKICAqCiAtKi8KIHN0YXRpYwotVk9JRAordm9pZAogc192TWdyTG9nU3RhdHVzKAotICAgIElOIFBT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RjaCAoCi0gICAgSU4gUEtub3duQlNTICAgICAgICAgICAgICAgICAgICAgICAgcEJTU05vZGUsCi0gICAgSU4gTkRJU184MDJfMTFfRU5DUllQVElPTl9TVEFUVVMgICAgRW5jU3RhdHVzLAotICAgIE9VVCBQQllURSAgICAgICAgICAgICAgICAgICAgICAgICAgIHBieUNDU1BLLAotICAgIE9VVCBQQllURSAgICAgICAgICAgICAgICAgICAgICAgICAgIHBieUNDU0dLCisgICAgUEtub3duQlNTICAgICAgICAgICAgICAgICAgICAgICAgcEJTU05vZGUsCisgICAgTkRJU184MDJfMTFfRU5DUllQVElPTl9TVEFUVVMgICAgRW5jU3RhdHVzLAorICAgIFBCWVRFICAgICAgICAgICAgICAgICAgICAgICAgICAgcGJ5Q0NTUEssCisgICAgUEJZVEUgICAgICAgICAgICAgICAgICAgICAgICAgICBwYnlDQ1NHSwogICAgICkKIHsKICAgICBCWVRFIGJ5TXVsdGljYXN0Q2lwaGVyID0gS0VZX0NUTF9JTlZBTElEOwpkaWZmIC0tZ2l0IGEvZHJpdmVycy9zdGFnaW5nL3Z0NjY1NS93bWdyLmggYi9kcml2ZXJzL3N0YWdpbmcvdnQ2NjU1L3dtZ3IuaAppbmRleCAxYzFmMmVhLi45YWU3ZTBkIDEwMDY0NAotLS0gYS9kcml2ZXJzL3N0YWdpbmcvdnQ2NjU1L3dtZ3IuaAorKysgYi9kcml2ZXJzL3N0YWdpbmcvdnQ2NjU1L3dtZ3IuaApAQCAtMjQ5LDcgKzI0OSw3IEBACiB0eXBlZGVmIHN0cnVjdCB0YWdTTWdtdE9iamVjdAogewogCi0gICAgUFZPSUQgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXI7CisgICAgdm9pZCAqICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyOwogICAgIC8vIE1BQyBhZGRyZXNzCiAgICAgQllURSAgICAgICAgICAgICAgICAgICAgYWJ5TUFDQWRkcltXTEFOX0FERFJfTEVOXTsKIApAQCAtNDAxLDEwMiArNDAxLDEwMiBAQAogCiB2b2lkCiB2TWdyT2JqZWN0SW5pdCgKLSAgICBJTiAgSEFORExFIGhEZXZpY2VDb250ZXh0CisgICAgdm9pZCAqaERldmljZUNvbnRleHQKICAgICApOwogCiB2b2lkCiB2TWdyVGltZXJJbml0KAotICAgIElOICBIQU5ETEUgaERldmljZUNvbnRleHQKKyAgICB2b2lkICpoRGV2aWNlQ29udGV4dAogICAgICk7CiAKLVZPSUQKK3ZvaWQKIHZNZ3JPYmplY3RSZXNldCgKLSAgICBJTiAgSEFORExFIGhEZXZpY2VDb250ZXh0CisgICAgdm9pZCAqaERldmljZUNvbnRleHQKICAgICApOwogCiB2b2lkCiB2TWdyQXNzb2NCZWdpblN0YSgKLSAgICBJTiAgSEFORExFIGhEZXZpY2VDb250ZXh0LAotICAgIElOICBQU01nbXRPYmplY3QgcE1nbXQsCi0gICAgT1VUIFBDTURfU1RBVFVTIHBTdGF0dXMKKyAgICB2b2lkICpoRGV2aWNlQ29udGV4dCwKKyAgICBQU01nbXRPYmplY3QgcE1nbXQsCisgICAgUENNRF9TVEFUVVMgcFN0YXR1cwogICAgICk7CiAKLVZPSUQKK3ZvaWQKIHZNZ3JSZUFzc29jQmVnaW5TdGEoCi0gICAgSU4gIEhBTkRMRSBoRGV2aWNlQ29udGV4dCwKLSAgICBJTiAgUFNNZ210T2JqZWN0IHBNZ210LAotICAgIE9VVCBQQ01EX1NUQVRVUyBwU3RhdHVzCisgICAgdm9pZCAqaERldmljZUNvbnRleHQsCisgICAgUFNNZ210T2JqZWN0IHBNZ210LAorICAgIFBDTURfU1RBVFVTIHBTdGF0dXMKICAgICApOwogCi1WT0lECit2b2lkCiB2TWdyRGlzYXNzb2NCZWdpblN0YSgKLSAgICBJTiAgSEFORExFIGhEZXZpY2VDb250ZXh0LAotICAgIElOICBQU01nbXRPYmplY3QgcE1nbXQsCi0gICAgSU4gIFBCWVRFICBhYnlEZXN0QWRkcmVzcywKLSAgICBJTiAgV09SRCAgICB3UmVhc29uLAotICAgIE9VVCBQQ01EX1NUQVRVUyBwU3RhdHVzCisgICAgdm9pZCAqaERldmljZUNvbnRleHQsCisgICAgUFNNZ210T2JqZWN0IHBNZ210LAorICAgIFBCWVRFICBhYnlEZXN0QWRkcmVzcywKKyAgICBXT1JEICAgIHdSZWFzb24sCisgICAgUENNRF9TVEFUVVMgcFN0YXR1cwogICAgICk7CiAKLVZPSUQKK3ZvaWQKIHZNZ3JBdXRoZW5CZWdpblN0YSgKLSAgICBJTiAgSEFORExFIGhEZXZpY2VDb250ZXh0LAotICAgIElOICBQU01nbXRPYmplY3QgcE1nbXQsCi0gICAgT1VUIFBDTURfU1RBVFVTIHBTdGF0dXMKKyAgICB2b2lkICpoRGV2aWNlQ29udGV4dCwKKyAgICBQU01nbXRPYmplY3QgcE1nbXQsCisgICAgUENNRF9TVEFUVVMgcFN0YXR1cwogICAgICk7CiAKLVZPSUQKK3ZvaWQKIHZNZ3JDcmVhdGVPd25JQlNTKAotICAgIElOICBIQU5ETEUgaERldmljZUNvbnRleHQsCi0gICAgT1VUIFBDTURfU1RBVFVTIHBTdGF0dXMKKyAgICB2b2lkICpoRGV2aWNlQ29udGV4dCwKKyAgICBQQ01EX1NUQVRVUyBwU3RhdHVzCiAgICAgKTsKIAotVk9JRAordm9pZAogdk1nckpvaW5CU1NCZWdpbigKLSAgICBJTiAgSEFORExFIGhEZXZpY2VDb250ZXh0LAotICAgIE9VVCBQQ01EX1NUQVRVUyBwU3RhdHVzCisgICAgdm9pZCAqaERldmljZUNvbnRleHQsCisgICAgUENNRF9TVEFUVVMgcFN0YXR1cwogICAgICk7CiAKLVZPSUQKK3ZvaWQKIHZNZ3JSeE1hbmFnZVBhY2tldCgKLSAgICBJTiAgSEFORExFIGhEZXZpY2VDb250ZXh0LAotICAgIElOICBQU01nbXRPYmplY3QgcE1nbXQsCi0gICAgSU4gIFBTUnhNZ210UGFja2V0IHBSeFBhY2tldAorICAgIHZvaWQgKmhEZXZpY2VDb250ZXh0LAorICAgIFBTTWdtdE9iamVjdCBwTWdtdCwKKyAgICBQU1J4TWdtdFBhY2tldCBwUnhQYWNrZXQKICAgICApOwogCiAvKgotVk9JRAordm9pZAogdk1nclNjYW5CZWdpbigKLSAgICBJTiAgSEFORExFIGhEZXZpY2VDb250ZXh0LAotICAgIE9VVCBQQ01EX1NUQVRVUyBwU3RhdHVzCisgICAgdm9pZCAqaERldmljZUNvbnRleHQsCisgICAgUENNRF9TVEFUVVMgcFN0YXR1cwogICAgICk7CiAqLwogCi1WT0lECit2b2lkCiB2TWdyRGVBdXRoZW5CZWdpblN0YSgKLSAgICBJTiAgSEFORExFIGhEZXZpY2VDb250ZXh0LAotICAgIElOICBQU01nbXRPYmplY3QgIHBNZ210LAotICAgIElOICBQQllURSAgIGFieURlc3RBZGRyZXNzLAotICAgIElOICBXT1JEICAgIHdSZWFzb24sCi0gICAgT1VUIFBDTURfU1RBVFVTIHBTdGF0dXMKKyAgICB2b2lkICpoRGV2aWNlQ29udGV4dCwKKyAgICBQU01nbXRPYmplY3QgIHBNZ210LAorICAgIFBCWVRFICAgYWJ5RGVzdEFkZHJlc3MsCisgICAgV09SRCAgICB3UmVhc29uLAorICAgIFBDTURfU1RBVFVTIHBTdGF0dXMKICAgICApOwogCiBCT09MCiBiTWdyUHJlcGFyZUJlYWNvblRvU2VuZCgKLSAgICBJTiAgSEFORExFIGhEZXZpY2VDb250ZXh0LAotICAgIElOICBQU01nbXRPYmplY3QgcE1nbXQKKyAgICB2b2lkICpoRGV2aWNlQ29udGV4dCwKKyAgICBQU01nbXRPYmplY3QgcE1nbXQKICAgICApOwogCiAKIEJPT0wKIGJBZGRfUE1LSURfQ2FuZGlkYXRlICgKLSAgICBJTiBIQU5ETEUgICAgaERldmljZUNvbnRleHQsCi0gICAgSU4gUEJZVEUgICAgICAgICAgcGJ5QlNTSUQsCi0gICAgSU4gUFNSU05DYXBPYmplY3QgcHNSU05DYXBPYmoKKyAgICB2b2lkICpoRGV2aWNlQ29udGV4dCwK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pAQCAtMjYzLDggKzI2Myw4IEBACiAtKi8KIFVJTlQKIFdQQTJ1U2V0SUVzKAotICAgIElOIFBWT0lEIHBNZ210SGFuZGxlLAotICAgIE9VVCBQV0xBTl9JRV9SU04gcFJTTklFcworICAgIHZvaWQgKnBNZ210SGFuZGxlLAorICAgIFBXTEFOX0lFX1JTTiBwUlNOSUVzCiAgICAgKQogewogICAgIFBTTWdtdE9iamVjdCAgICBwTWdtdCA9IChQU01nbXRPYmplY3QpIHBNZ210SGFuZGxlOwpAQCAtMzQ2LDcgKzM0Niw3IEBACiAgICAgICAgICAgICAqcHdQTUtJRCA9IDA7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEluaXRpYWxpemUgUE1LSUQgY291bnQKICAgICAgICAgICAgIHBieUJ1ZmZlciA9ICZwUlNOSUVzLT5hYnlSU05bMjBdOyAgICAgICAgICAgLy8gUG9pbnQgdG8gUE1LSUQgbGlzdAogICAgICAgICAgICAgZm9yIChpaSA9IDA7IGlpIDwgcE1nbXQtPmdzUE1LSURDYWNoZS5CU1NJREluZm9Db3VudDsgaWkrKykgewotICAgICAgICAgICAgICAgIGlmICggIW1lbWNtcCgmcE1nbXQtPmdzUE1LSURDYWNoZS5CU1NJREluZm9baWldLmFieUJTU0lEWzBdLCBwTWdtdC0+YWJ5Q3VyckJTU0lELCBVX0VUSEVSX0FERFJfTEVOKSkgeworICAgICAgICAgICAgICAgIGlmICggIW1lbWNtcCgmcE1nbXQtPmdzUE1LSURDYWNoZS5CU1NJREluZm9baWldLmFieUJTU0lEWzBdLCBwTWdtdC0+YWJ5Q3VyckJTU0lELCBFVEhfQUxFTikpIHsKICAgICAgICAgICAgICAgICAgICAgKCpwd1BNS0lEKSArKzsKICAgICAgICAgICAgICAgICAgICAgbWVtY3B5KHBieUJ1ZmZlciwgcE1nbXQtPmdzUE1LSURDYWNoZS5CU1NJREluZm9baWldLmFieVBNS0lELCAxNik7CiAgICAgICAgICAgICAgICAgICAgIHBieUJ1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wogICAgIFBVV0xBTl84MDIxMUhEUiAgICAgICAgIHBIZHI7CiAgICAgLy8gZml4ZWQgZmllbGRzCkBAIC01NjYsOCArNTY2LDggQEAKIC8vIElCU1MgQVRJTSBmcmFtZQogdHlwZWRlZiBzdHJ1Y3QgdGFnV0xBTl9GUl9JQlNTQVRJTSB7CiAKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICB1VHlwZTsKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICBsZW47CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgICAgICB1VHlwZTsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICAgICAgICAgIGxlbjsKICAgICBQQllURSAgICAgICAgICAgICAgICAgICBwQnVmOwogICAgIFBVV0xBTl84MDIxMUhEUiAgICAgICAgIHBIZHI7CiAKQEAgLTU4MCw4ICs1ODAsOCBAQAogLy8gRGlzYXNzb2NpYXRpb24KIHR5cGVkZWYgc3RydWN0IHRhZ1dMQU5fRlJfRElTQVNTT0MgewogCi0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgdVR5cGU7Ci0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgbGVuOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgICAgICAgICAgdVR5cGU7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgICAgICBsZW47CiAgICAgUEJZVEUgICAgICAgICAgICAgICAgICAgcEJ1ZjsKICAgICBQVVdMQU5fODAyMTFIRFIgICAgICAgICBwSGRyOwogICAgIC8qLS0gZml4ZWQgZmllbGRzIC0tLS0tLS0tLS0tKi8KQEAgLTU5Myw4ICs1OTMsOCBAQAogLy8gQXNzb2NpYXRpb24gUmVxdWVzdAogdHlwZWRlZiBzdHJ1Y3QgdGFnV0xBTl9GUl9BU1NPQ1JFUSB7CiAKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICB1VHlwZTsKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICBsZW47CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgICAgICB1VHlwZTsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICAgICAgICAgIGxlbjsKICAgICBQQllURSAgICAgICAgICAgICAgICAgICBwQnVmOwogICAgIFBVV0xBTl84MDIxMUhEUiAgICAgICAgIHBIZHI7CiAgICAgLyotLSBmaXhlZCBmaWVsZHMgLS0tLS0tLS0tLS0qLwpAQCAtNjE3LDggKzYxNyw4IEBACiAvLyBBc3NvY2lhdGlvbiBSZXNwb25zZQogdHlwZWRlZiBzdHJ1Y3QgdGFnV0xBTl9GUl9BU1NPQ1JFU1AgewogCi0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgdVR5cGU7Ci0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgbGVuOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgICAgICAgICAgdVR5cGU7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgICAgICBsZW47CiAgICAgUEJZVEUgICAgICAgICAgICAgICAgICAgcEJ1ZjsKICAgICBQVVdMQU5fODAyMTFIRFIgICAgICAgICBwSGRyOwogICAgIC8qLS0gZml4ZWQgZmllbGRzIC0tLS0tLS0tLS0tKi8KQEAgLTYzNCw4ICs2MzQsOCBAQAogLy8gUmVhc3NvY2lhdGlvbiBSZXF1ZXN0CiB0eXBlZGVmIHN0cnVjdCB0YWdXTEFOX0ZSX1JFQVNTT0NSRVEgewogCi0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgdVR5cGU7Ci0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgbGVuOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgICAgICAgICAgdVR5cGU7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgICAgICBsZW47CiAgICAgUEJZVEUgICAgICAgICAgICAgICAgICAgcEJ1ZjsKICAgICBQVVdMQU5fODAyMTFIRFIgICAgICAgICBwSGRyOwogCkBAIC02NTksOCArNjU5LDggQEAKIC8vIFJlYXNzb2NpYXRpb24gUmVzcG9uc2UKIHR5cGVkZWYgc3RydWN0IHRhZ1dMQU5fRlJfUkVBU1NPQ1JFU1AgewogCi0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgdVR5cGU7Ci0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgbGVuOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgICAgICAgICAgdVR5cGU7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgICAgICBsZW47CiAgICAgUEJZVEUgICAgICAgICAgICAgICAgICAgcEJ1ZjsKICAgICBQVVdMQU5fODAyMTFIRFIgICAgICAgICBwSGRyOwogICAgIC8qLS0gZml4ZWQgZmllbGRzIC0tLS0tLS0tLS0tKi8KQEAgLTY3Niw4ICs2NzYsOCBAQAogLy8gUHJvYmUgUmVxdWVzdAogdHlwZWRlZiBzdHJ1Y3QgdGFnV0xBTl9GUl9QUk9CRVJFUSB7CiAKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICB1VHlwZTsKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICBsZW47CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgICAgICB1VHlwZTsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICAgICAgICAgIGxlbjsKICAgICBQQllURSAgICAgICAgICAgICAgICAgICBwQnVmOwogICAgIFBVV0xBTl84MDIxMUhEUiAgICAgICAgIHBIZHI7CiAgICAgLyotLSBmaXhlZCBmaWVsZHMgLS0tLS0tLS0tLS0qLwpAQCAtNjkxLDggKzY5MSw4IEBACiAvLyBQcm9iZSBSZXNwb25zZQogdHlwZWRlZiBzdHJ1Y3QgdGFnV0xBTl9GUl9QUk9CRVJFU1AgewogCi0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgdVR5cGU7Ci0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgbGVuOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgICAgICAgICAgdVR5cGU7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgICAgICBsZW47CiAgICAgUEJZVEUgICAgICAgICAgICAgICAgICAgcEJ1ZjsKICAgICBQVVdMQU5fODAyMTFIRFIgICAgICAgICBwSGRyOwogICAgIC8qLS0gZml4ZWQgZmllbGRzIC0tLS0tLS0tLS0tKi8KQEAgLTcyMCw4ICs3MjAsOCBAQAogLy8gQXV0aGVudGljYXRpb24KIHR5cGVkZWYgc3RydWN0IHRhZ1dMQU5fRlJfQVVUSEVOIHsKIAotICAgIFVJTlQgICAgICAgICAgICAgICAgICAgIHVUeXBlOwotICAgIFVJTlQgICAgICAgICAgICAgICAgICAgIGxlbjsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICAgICAgICAgIHVUeXBlOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgICAgICAgICAgbGVuOwogICAgIFBCWVRFICAgICAgICAgICAgICAgICAgIHBCdWY7CiAgICAgUFVXTEFOXzgwMjExSERSICAgICAgICAgcEhkcjsKICAgICAvKi0tIGZpeGVkIGZpZWxkcyAtLS0tLS0tLS0tLSovCkBAIC03MzYsOCArNzM2LDggQEAKIC8vIERlYXV0aGVuaWNhdGlvbgogdHlwZWRlZiBzdHJ1Y3QgdGFnV0xBTl9GUl9ERUFVVEhFTiB7CiAKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICB1VHlwZTsKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICBsZW47CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgICAgICB1VHlwZTsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICAgICAgICAgIGxlbjsKICAgICBQQllURSAgICAgICAgICAgICAgICAgICBwQnVmOwogICAgIFBVV0xBTl84MDIxMUhEUiAgICAgICAgIHBIZHI7CiAgICAgLyotLSBmaXhlZCBmaWVsZHMgLS0tLS0tLS0tLS0qLwpAQCAtNzQ4LDExNCArNzQ4LDExNCBAQAogfSBXTEFOX0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HRyQisrKTsKIH0KIAogdm9pZCBBZGRSb3VuZEtleShCWVRFICprZXksIGludCByb3VuZCkKIHsKLUJZVEUgc2JveF9rZXlbNF07Ci1CWVRFIHJjb25fdGFibGVbMTBdID0geyAweDAxLCAweDAyLCAweDA0LCAweDA4LCAweDEwLCAweDIwLCAweDQwLCAweDgwLCAweDFiLCAweDM2fTsKKwlCWVRFIHNib3hfa2V5WzRdOworCUJZVEUgcmNvbl90YWJsZVsxMF0gPSB7IDB4MDEsIDB4MDIsIDB4MDQsIDB4MDgsIDB4MTAsIDB4MjAsIDB4NDAsIDB4ODAsIDB4MWIsIDB4MzZ9OwogCi0gICAgc2JveF9rZXlbMF0gPSBzYm94X3RhYmxlW2tleVsxM11dOwotICAgIHNib3hfa2V5WzFdID0gc2JveF90YWJsZVtrZXlbMTRdXTsKLSAgICBzYm94X2tleVsyXSA9IHNib3hfdGFibGVba2V5WzE1XV07Ci0gICAgc2JveF9rZXlbM10gPSBzYm94X3RhYmxlW2tleVsxMl1dOworCXNib3hfa2V5WzBdID0gc2JveF90YWJsZVtrZXlbMTNdXTsKKwlzYm94X2tleVsxXSA9IHNib3hfdGFibGVba2V5WzE0XV07CisJc2JveF9rZXlbMl0gPSBzYm94X3RhYmxlW2tleVsxNV1dOworCXNib3hfa2V5WzNdID0gc2JveF90YWJsZVtrZXlbMTJdXTsKIAotICAgIGtleVswXSA9IGtleVswXSBeIHJjb25fdGFibGVbcm91bmRdOwotICAgIHhvcl8zMigma2V5WzBdLCBzYm94X2tleSwgJmtleVswXSk7CisJa2V5WzBdID0ga2V5WzBdIF4gcmNvbl90YWJsZVtyb3VuZF07CisJeG9yXzMyKCZrZXlbMF0sIHNib3hfa2V5LCAma2V5WzBdKTsKIAotICAgIHhvcl8zMigma2V5WzRdLCAma2V5WzBdLCAma2V5WzRdKTsKLSAgICB4b3JfMzIoJmtleVs4XSwgJmtleVs0XSwgJmtleVs4XSk7Ci0gICAgeG9yXzMyKCZrZXlbMTJdLCAma2V5WzhdLCAma2V5WzEyXSk7CisJeG9yXzMyKCZrZXlbNF0sICZrZXlbMF0sICZrZXlbNF0pOworCXhvcl8zMigma2V5WzhdLCAma2V5WzRdLCAma2V5WzhdKTsKKwl4b3JfMzIoJmtleVsxMl0sICZrZXlbOF0sICZrZXlbMTJdKTsKIH0KIAogdm9pZCBTdWJCeXRlcyhCWVRFICppbiwgQllURSAqb3V0KQogewotaW50IGk7CisJaW50IGk7CiAKLSAgICBmb3IgKGk9MDsgaTwgMTY7IGkrKykKLSAgICB7Ci0gICAgICAgIG91dFtpXSA9IHNib3hfdGFibGVbaW5baV1dOwotICAgIH0KKwlmb3IgKGkgPSAwOyBpIDwgMTY7IGkrKykKKwkJb3V0W2ldID0gc2JveF90YWJsZVtpbltpXV07CiB9CiAKIHZvaWQgU2hpZnRSb3dzKEJZVEUgKmluLCBCWVRFICpvdXQpCiB7Ci0gICAgb3V0WzBdICA9IGluWzBdOwotICAgIG91dFsxXSAgPSBpbls1XTsKLSAgICBvdXRbMl0gID0gaW5bMTBdOwotICAgIG91dFszXSAgPSBpblsxNV07Ci0gICAgb3V0WzRdICA9IGluWzRdOwotICAgIG91dFs1XSAgPSBpbls5XTsKLSAgICBvdXRbNl0gID0gaW5bMTRdOwotICAgIG91dFs3XSAgPSBpblszXTsKLSAgICBvdXRbOF0gID0gaW5bOF07Ci0gICAgb3V0WzldICA9IGluWzEzXTsKLSAgICBvdXRbMTBdID0gaW5bMl07Ci0gICAgb3V0WzExXSA9IGluWzddOwotICAgIG91dFsxMl0gPSBpblsxMl07Ci0gICAgb3V0WzEzXSA9IGluWzFdOwotICAgIG91dFsxNF0gPSBpbls2XTsKLSAgICBvdXRbMTVdID0gaW5bMTFdOworCW91dFswXSAgPSBpblswXTsKKwlvdXRbMV0gID0gaW5bNV07CisJb3V0WzJdICA9IGluWzEwXTsKKwlvdXRbM10gID0gaW5bMTVdOworCW91dFs0XSAgPSBpbls0XTsKKwlvdXRbNV0gID0gaW5bOV07CisJb3V0Wz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W5zKCZUbXBkYXRhQls4XSwgJlRtcGRhdGFBWzhdKTsKKwkJCU1peENvbHVtbnMoJlRtcGRhdGFCWzEyXSwgJlRtcGRhdGFBWzEyXSk7CisJCQl4b3JfMTI4KFRtcGRhdGFBLCBhYnlSb3VuZEtleSwgY2lwaGVydGV4dCk7CisJCQlBZGRSb3VuZEtleShhYnlSb3VuZEtleSwgcm91bmQpOworCQl9CisJfQogCiB9CiAKQEAgLTI0MywxNjAgKzIzMCwxNTcgQEAKICAqIFJldHVybiBWYWx1ZTogTUlDIGNvbXBhcmUgcmVzdWx0CiAgKgogICovCisKIEJPT0wgQUVTYkdlbkNDTVAoUEJZVEUgcGJ5UnhLZXksIFBCWVRFIHBieUZyYW1lLCBXT1JEIHdGcmFtZVNpemUpCiB7Ci1CWVRFICAgICAgICAgICAgYWJ5Tm9uY2VbMTNdOwotQllURSAgICAgICAgICAgIE1JQ19JVlsxNl07Ci1CWVRFICAgICAgICAgICAgTUlDX0hEUjFbMTZdOwotQllURSAgICAgICAgICAgIE1JQ19IRFIyWzE2XTsKLUJZVEUgICAgICAgICAgICBhYnlNSUNbMTZdOwotQllURSAgICAgICAgICAgIGFieUNUUlBMRFsxNl07Ci1CWVRFICAgICAgICAgICAgYWJ5VG1wWzE2XTsKLUJZVEUgICAgICAgICAgICBhYnlQbGFpblRleHRbMTZdOwotQllURSAgICAgICAgICAgIGFieUxhc3RDaXBoZXJbMTZdOworCUJZVEUgICAgICAgICAgICBhYnlOb25jZVsxM107CisJQllURSAgICAgICAgICAgIE1JQ19JVlsxNl07CisJQllURSAgICAgICAgICAgIE1JQ19IRFIxWzE2XTsKKwlCWVRFICAgICAgICAgICAgTUlDX0hEUjJbMTZdOworCUJZVEUgICAgICAgICAgICBhYnlNSUNbMTZdOworCUJZVEUgICAgICAgICAgICBhYnlDVFJQTERbMTZdOworCUJZVEUgICAgICAgICAgICBhYnlUbXBbMTZdOworCUJZVEUgICAgICAgICAgICBhYnlQbGFpblRleHRbMTZdOworCUJZVEUgICAgICAgICAgICBhYnlMYXN0Q2lwaGVyWzE2XTsKIAotUFM4MDJfMTFIZWFkZXIgIHBNQUNIZWFkZXIgPSAoUFM4MDJfMTFIZWFkZXIpIHBieUZyYW1lOwotUEJZVEUgICAgICAgICAgIHBieUlWOwotUEJZVEUgICAgICAgICAgIHBieVBheWxvYWQ7Ci1XT1JEICAgICAgICAgICAgd0hMZW4gPSAyMjsKLVdPUkQgICAgICAgICAgICB3UGF5bG9hZFNpemUgPSB3RnJhbWVTaXplIC0gOCAtIDggLSA0IC0gV0xBTl9IRFJfQUREUjNfTEVOOy8vOCBpcyBJViwgOCBpcyBNSUMsIDQgaXMgQ1JDCi1CT09MICAgICAgICAgICAgYkE0ID0gRkFMU0U7Ci1CWVRFICAgICAgICAgICAgYnlUbXA7Ci1XT1JEICAgICAgICAgICAgd0NudDsKLWludCAgICAgICAgICAgICBpaSxqaixrazsKKwlQUzgwMl8xMUhlYWRlciAgcE1BQ0hlYWRlciA9IChQUzgwMl8xMUhlYWRlcikgcGJ5RnJhbWU7CisJUEJZVEUgICAgICAgICAgIHBieUlWOworCVBCWVRFICAgICAgICAgICBwYnlQYXlsb2FkOworCVdPUkQgICAgICAgICAgICB3SExlbiA9IDIyOworCS8qIDggaXMgSVYsIDggaXMgTUlDLCA0IGlzIENSQyAqLworCVdPUkQgICAgICAgICAgICB3UGF5bG9hZFNpemUgPSB3RnJhbWVTaXplIC0gOCAtIDggLSA0IC0gV0xBTl9IRFJfQUREUjNfTEVOOworCUJPT0wgICAgICAgICAgICBiQTQgPSBGQUxTRTsKKwlCWVRFICAgICAgICAgICAgYnlUbXA7CisJV09SRCAgICAgICAgICAgIHdDbnQ7CisJaW50ICAgICAgICAgICAgIGlpLCBqaiwga2s7CiAKKwlwYnlJViA9IHBieUZyYW1lICsgV0xBTl9IRFJfQUREUjNfTEVOOworCWlmIChXTEFOX0dFVF9GQ19UT0RTKCooUFdPUkQpIHBieUZyYW1lKSAmJgorCSAgICBXTEFOX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AgIElOIFdPUkQgd1JhdGUKKyAgICAgQllURSBieVByZWFtYmxlVHlwZSwKKyAgICAgQllURSBieUZyZXFUeXBlLAorICAgICB1bnNpZ25lZCBpbnQgY2JGcmFtZUxlbmd0aCwKKyAgICAgV09SRCB3UmF0ZQogICAgICk7CiAKLVZPSUQKK3ZvaWQKIEJCdkNhY3VsYXRlUGFyYW1ldGVyICgKLSAgICBJTiAgUFNEZXZpY2UgcERldmljZSwKLSAgICBJTiAgVUlOVCBjYkZyYW1lTGVuZ3RoLAotICAgIElOICBXT1JEIHdSYXRlLAotICAgIElOICBCWVRFIGJ5UGFja2V0VHlwZSwKLSAgICBPVVQgUFdPUkQgcHdQaHlMZW4sCi0gICAgT1VUIFBCWVRFIHBieVBoeVNydiwKLSAgICBPVVQgUEJZVEUgcGJ5UGh5U2duCisgICAgICBQU0RldmljZSBwRGV2aWNlLAorICAgICAgdW5zaWduZWQgaW50IGNiRnJhbWVMZW5ndGgsCisgICAgICBXT1JEIHdSYXRlLAorICAgICAgQllURSBieVBhY2tldFR5cGUsCisgICAgIFBXT1JEIHB3UGh5TGVuLAorICAgICBQQllURSBwYnlQaHlTcnYsCisgICAgIFBCWVRFIHBieVBoeVNnbgogICAgICk7CiAKIC8vIHRpbWVyIGZvciBhbnRlbm5hIGRpdmVyc2l0eQogCi1WT0lECi1UaW1lclNRM0NhbGxCYWNrICgKLSAgICBJTiAgSEFORExFICAgICAgaERldmljZUNvbnRleHQKLSAgICApOwordm9pZCBUaW1lclNRM0NhbGxCYWNrKHZvaWQgKmhEZXZpY2VDb250ZXh0KTsKK3ZvaWQgVGltZXJTUTNUbWF4M0NhbGxCYWNrKHZvaWQgKmhEZXZpY2VDb250ZXh0KTsKIAotVk9JRAotVGltZXJTUTNUbWF4M0NhbGxCYWNrICgKLSAgICBJTiAgSEFORExFICAgICAgaERldmljZUNvbnRleHQKLSAgICApOwotCi1WT0lEIEJCdkFudGVubmFEaXZlcnNpdHkgKFBTRGV2aWNlIHBEZXZp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PSAwOyAgIC8vRGF2aWRXYW5nCisgICAgdW5zaWduZWQgaW50IGlpID0gMDsKKyAgICB1bnNpZ25lZCBpbnQgamogPSAwOwogICAgIGlmIChwYnlEZXNpcmVCU1NJRCAhPSBOVUxMKSB7CiAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8iQlNTcFNlYXJjaEJTU0xpc3QgQlNTSURbJTAyWCAlMDJYICUwMlgtJTAyWCAlMDJYICUwMlhdXG4iLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICpwYnlEZXNpcmVCU1NJRCwqKHBieURlc2lyZUJTU0lEKzEpLCoocGJ5RGVzaXJlQlNTSUQrMiksCkBAIC0yOTYsMTUgKzI4NywxMSBAQAogLSovCiAKIAotVk9JRAotQlNTdkNsZWFyQlNTTGlzdCgKLSAgICBJTiBIQU5ETEUgaERldmljZUNvbnRleHQsCi0gICAgSU4gQk9PTCBiS2VlcEN1cnJCU1NJRAotICAgICkKK3ZvaWQgQlNTdkNsZWFyQlNTTGlzdCh2b2lkICpoRGV2aWNlQ29udGV4dCwgQk9PTCBiS2VlcEN1cnJCU1NJRCkKIHsKICAgICBQU0RldmljZSAgICAgcERldmljZSA9IChQU0RldmljZSloRGV2aWNlQ29udGV4dDsKICAgICBQU01nbXRPYmplY3QgICAgcE1nbXQgPSAmKHBEZXZpY2UtPnNNZ210T2JqKTsKLSAgICBVSU5UICAgICAgICAgICAgaWk7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgaWk7CiAKICAgICBmb3IgKGlpID0gMDsgaWkgPCBNQVhfQlNTX05VTTsgaWkrKykgewogICAgICAgICBpZiAoYktlZXBDdXJyQlNTSUQpIHsKQEAgLTM0MiwxNyArMzI5LDE0IEBACiAgKiAgICBUUlVFIGlmIGZvdW5kLgogICoKIC0qLwotUEtub3duQlNTCi1CU1NwQWRkcklzSW5CU1NMaXN0KAotICAgIElOIEhBTkRMRSBoRGV2aWNlQ29udGV4dCwKLSA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otQk9PTAotQlNTYklzU1RBSW5Ob2RlREIoCi0gICAgSU4gSEFORExFIGhEZXZpY2VDb250ZXh0LAotICAgIElOIFBCWVRFIGFieURzdEFkZHIsCi0gICAgT1VUIFBVSU5UIHB1Tm9kZUluZGV4Ci0gICAgKQorQk9PTCBCU1NiSXNTVEFJbk5vZGVEQih2b2lkICpoRGV2aWNlQ29udGV4dCwKKwkJICAgICAgIFBCWVRFIGFieURzdEFkZHIsCisJCSAgICAgICBQVUlOVCBwdU5vZGVJbmRleCkKIHsKICAgICBQU0RldmljZSAgICAgICAgcERldmljZSA9IChQU0RldmljZSloRGV2aWNlQ29udGV4dDsKICAgICBQU01nbXRPYmplY3QgICAgcE1nbXQgPSAmKHBEZXZpY2UtPnNNZ210T2JqKTsKLSAgICBVSU5UICAgICAgICAgICAgaWk7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgaWk7CiAKICAgICAvLyBJbmRleCA9IDAgcmVzZXJ2ZWQgZm9yIEFQIE5vZGUKICAgICBmb3IgKGlpID0gMTsgaWkgPCAoTUFYX05PREVfTlVNICsgMSk7IGlpKyspIHsKQEAgLTgwNCwxOCArNzg2LDE0IEBACiAgKiAgICBOb25lCiAgKgogLSovCi1WT0lECi1CU1N2Q3JlYXRlT25lTm9kZSgKLSAgICBJTiBIQU5ETEUgaERldmljZUNvbnRleHQsCi0gICAgT1VUIFBVSU5UIHB1Tm9kZUluZGV4Ci0gICAgKQordm9pZCBCU1N2Q3JlYXRlT25lTm9kZSh2b2lkICpoRGV2aWNlQ29udGV4dCwgUFVJTlQgcHVOb2RlSW5kZXgpCiB7CiAKICAgICBQU0RldmljZSAgICAgcERldmljZSA9IChQU0RldmljZSloRGV2aWNlQ29udGV4dDsKICAgICBQU01nbXRPYmplY3QgICAgcE1nbXQgPSAmKHBEZXZpY2UtPnNNZ210T2JqKTsKLSAgICBVSU5UICAgICAgICAgICAgaWk7Ci0gICAgVUlOVCAgICAgICAgICAgIEJpZ2VzdENvdW50ID0gMDsKLSAgICBVSU5UICAgICAgICAgICAgU2VsZWN0SW5kZXg7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgaWk7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgQmlnZXN0Q291bnQgPSAwOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgIFNlbGVjdEluZGV4OwogICAgIHN0cnVjdCBza19idWZmICAqc2tiOwogICAgIC8vIEluZGV4ID0gMCByZXNlcnZlZCBmb3IgQVAgTm9kZSAoSW4gU1RBIG1vZGUpCiAgICAgLy8gSW5kZXggPSAwIHJlc2VydmVkIGZvciBCcm9hZGNhc3QvTXVsdGlDYXN0IChJbiBBUCBtb2RlKQpAQCAtODY5LDExICs4NDcsOCBAQAogICogICAgTm9uZQogICoKIC0qLwotVk9JRAotQlNTdlJlbW92ZU9uZU5vZGUoCi0gICAgSU4gSEFORExFIGhEZXZpY2VDb250ZXh0LAotICAgIElOIFVJTlQgdU5vZGVJbmRleAotICAgICkKKwordm9pZCBCU1N2UmVtb3ZlT25lTm9kZSh2b2lkICpoRGV2aWNlQ29udGV4dCwgdW5zaWduZWQgaW50IHVOb2RlSW5kZXgpCiB7CiAKICAgICBQU0RldmljZSAgICAgICAgcERldmljZSA9IChQU0RldmljZSloRGV2aWNlQ29udGV4dDsKQEAgLTkwMiwxNyArODc3LDE0IEBACiAgKgogLSovCiAKLVZPSUQKLUJTU3ZVcGRhdGVBUE5vZGUoCi0gICAgSU4gSEFORExFIGhEZXZpY2VDb250ZXh0LAotICAgIElOIFBXT1JEIHB3Q2FwSW5mbywKLSAgICBJTiBQV0xBTl9JRV9TVVBQX1JBVEVTIHBTdXBwUmF0ZXMsCi0gICAgSU4gUFdMQU5fSUVfU1VQUF9SQVRFUyBwRXh0U3VwcFJhdGVzCi0gICAgKQordm9pZCBCU1N2VXBkYXRlQVBOb2RlKHZvaWQgKmhEZXZpY2VDb250ZXh0LAorCQkgICAgICBQV09SRCBwd0NhcEluZm8sCisJCSAgICAgIFBXTEFOX0lFX1NVUFBfUkFURVMgcFN1cHBSYXRlcywKKwkJICAgICAgUFdMQU5fSUVfU1VQUF9SQVRFUyBwRXh0U3VwcFJhdGVzKQogewogICAgIFBTRGV2aWNlICAgICBwRGV2aWNlID0gKFBTRGV2aWNlKWhEZXZpY2VDb250ZXh0OwogICAgIFBTTWdtdE9iamVjdCAgICBwTWdtdCA9ICYocERldmljZS0+c01nbXRPYmopOwotICAgIFVJTlQgICAgICAgICAgICB1UmF0ZUxlbiA9IFdMQU5fUkFURVNfTUFYTEVOOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgIHVSYXRlTGVuID0gV0xBTl9SQVRFU19NQVhMRU47CiAKICAgICBtZW1zZXQoJnBNZ210LT5zTm9kZURCVGFibGVbMF0sIDAsIHNpemVvZihLbm93bk5vZGVEQikpOwogCkBAIC05MjYsNyArODk4LDcgQEAKICAgICBwTWdtdC0+YWJ5Q3VyckV4dFN1cHBSYXRlc1sxXSA9IFJBVEV1U2V0SUUoKFBXTEFOX0lFX1NVUFBfUkFURVMpcEV4dFN1cHBSYXRlcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFBXTEFOX0lFX1NVUFBfUkFURVMpcE1nbXQtPmFieUN1cnJFeHRTdXBwUmF0ZXMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVSYXRlTGVuKTsKLSAgICBSQVRFdlBhcnNlTWF4UmF0ZSgoUFZPSUQpIHBEZXZpY2UsCisgICAgUkFURXZQYXJzZU1heFJhdGUoKHZvaWQgKikgcERldmljZSwKICAgICAgICAgICAgICAgICAgICAgICAgKFBXTEFOX0lFX1NVUFBfUkFURVMpcE1nbXQtPmFieUN1cnJTdXBwUmF0ZXMsCiAgICAgICAgICAgICAgICAgICAgICAgIChQV0xBTl9JRV9TVVBQX1JBVEVTKXBNZ210LT5hYnlDdXJyRXh0U3VwcFJhdGVzLAogICAgICAgICAgICAgICAgICAgICAgICBUUlVFLApAQCAtOTQ2LDEwICs5MTgsNiBAQAogCiB9OwogCi0KLQotCi0KIC8qKwogICoKICAqIFJvdXRpbmUgRGVzY3JpcHRpb246CkBAIC05NjEsMTEgKzkyOSw3IEBACiAgKgogLSovCiAKLQotVk9JRAotQlNTdkFkZE11bHRpY2FzdE5vZGUoCi0gICAgSU4gSEFORExFIGhEZXZpY2VDb250ZXh0Ci0gICAgKQordm9pZCBCU1N2QWRkTXVsdGljYXN0Tm9kZSh2b2lkICpoRGV2aWNlQ29udGV4dCkKIHsKICAgICBQU0RldmljZSAgICAgcERldmljZSA9IChQU0RldmljZSloRGV2aWNlQ29udGV4dDsKICAgICBQU01nbXRPYmplY3QgICAgcE1nbXQgPSAmKHBEZXZpY2UtPnNNZ210T2JqKTsKQEAgLTk3Niw3ICs5NDAsNyBAQAogICAgIHBNZ210LT5zTm9kZURCVGFibGVbMF0uYkFjdGl2ZSA9IFRSVUU7CiAgICAgcE1nbXQtPnNOb2RlREJUYWJsZVswXS5iUFNFbmFibGUgPSBGQUxTRTsKICAgICBza2JfcXVldWVfaGVhZF9pbml0KCZwTWdtdC0+c05vZGVEQlRhYmxlWzBdLnNUeFBTUXVldWUpOwotICAgIFJBVEV2UGFyc2VNYXhSYXRlKChQVk9JRCkgcERldmljZSwKKyAgICBSQVRFdlBhcnNlTWF4UmF0ZSgodm9pZCAqKSBwRGV2aWNlLAogICAgICAgICAgICAgICAgICAgICAgIChQV0xBTl9JRV9TVVBQX1JBVEVTKXBNZ210LT5hYnlDdXJyU3VwcFJhdGVzLAogICAgICAgICAgICAgICAgICAgICAgIChQV0xBTl9JRV9TVVBQX1JBVEVTKXBNZ210LT5hYnlDdXJyRXh0U3VwcFJhdGVzLAogICAgICAgICAgICAgICAgICAgICAgIFRSVUUsCkBAIC05OTEsMTAgKzk1NSw2IEBACiAKIH07CiAKLQotCi0KLQogLyorCiAgKgogICogUm91dGluZSBEZXNjcmlwdGlvbjoKQEAgLTEwMDgsMTkgK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lua1F1YWwoKHZvaWQgKilwRGV2aWNlKTsKICNlbmRpZgogCiAgICAgZm9yIChpaSA9IDA7IGlpIDwgKE1BWF9OT0RFX05VTSArIDEpOyBpaSsrKSB7CkBAIC0xMTMxLDEyICsxMDg3LDE0IEBACiAqLwogICAgICAgICAgICAgICAgIGlmIChpaSA+IDApIHsKICAgICAgICAgICAgICAgICAgICAgLy8gaWkgPSAwIGZvciBtdWx0aWNhc3Qgbm9kZSAoQVAgJiBBZGhvYykKLSAgICAgICAgICAgICAgICAgICAgUkFURXZUeFJhdGVGYWxsQmFjaygoUFZPSUQpcERldmljZSwgJihwTWdtdC0+c05vZGVEQlRhYmxlW2lpXSkpOworCQkJUkFURXZUeFJhdGVGYWxsQmFjaygodm9pZCAqKXBEZXZpY2UsCisJCQkJCSAgICAmKHBNZ210LT5zTm9kZURCVGFibGVbaWldKSk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgICAgICAvLyBpaSA9IDAgcmVzZXJ2ZWQgZm9yIHVuaWNhc3QgQVAgbm9kZSAoSW5mcmEgU1RBKQotICAgICAgICAgICAgICAgICAgICBpZiAocE1nbXQtPmVDdXJyTW9kZSA9PSBXTUFDX01PREVfRVNTX1NUQSkKLSAgICAgICAgICAgICAgICAgICAgICAgIFJBVEV2VHhSYXRlRmFsbEJhY2soKFBWT0lEKXBEZXZpY2UsICYocE1nbXQtPnNOb2RlREJUYWJsZVtpaV0pKTsKKwkJCWlmIChwTWdtdC0+ZUN1cnJNb2RlID09IFdNQUNfTU9ERV9FU1NfU1RBKQorCQkJCVJBVEV2VHhSYXRlRmFsbEJhY2soKHZvaWQgKilwRGV2aWNlLAorCQkJCQkJICAgICYocE1nbXQtPnNOb2RlREJUYWJsZVtpaV0pKTsKICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIH0KQEAgLTExNzcsMTQgKzExMzUsMTQgQEAKICAgICAgICAgICAgIGlmIChwRGV2aWNlLT5iU2hvcnRTbG90VGltZSkgewogICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJTaG9ydFNsb3RUaW1lID0gRkFMU0U7CiAgICAgICAgICAgICAgICAgQkJ2U2V0U2hvcnRTbG90VGltZShwRGV2aWNlKTsKLSAgICAgICAgICAgICAgICB2VXBkYXRlSUZTKChQVk9JRClwRGV2aWNlKTsKKwkJdlVwZGF0ZUlGUygodm9pZCAqKXBEZXZpY2UpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgaWYgKCFwRGV2aWNlLT5iU2hvcnRTbG90VGltZSkgewogICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJTaG9ydFNsb3RUaW1lID0gVFJVRTsKICAgICAgICAgICAgICAgICBCQnZTZXRTaG9ydFNsb3RUaW1lKHBEZXZpY2UpOwotICAgICAgICAgICAgICAgIHZVcGRhdGVJRlMoKFBWT0lEKXBEZXZpY2UpOworCQl2VXBkYXRlSUZTKCh2b2lkICopcERldmljZSk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KIApAQCAtMTIyNCwxNCArMTE4MiwxNiBAQAogICAgICAgICAgICAvLyBEQkdfUFJUKE1TR19MRVZFTF9JTkZPLCBLRVJOX0lORk8gIkNhbGxiYWNrIGluYWN0aXZlIENvdW50ID0gWyVkXVxuIiwgcE1nbXQtPnNOb2RlREJUYWJsZVswXS51SW5BY3RpdmVDb3VudCk7CiAKICAgICAgICAgICAgIGlmIChwRGV2aWNlLT5iVXBkYXRlQkJWR0EpIHsKLSAgICAgICAgICAgICAgIC8vIHNfdkNoZWNrU2Vuc2l0aXZpdHkoKEhBTkRMRSkgcERldmljZSk7Ci0gICAgICAgICAgICAgICBzX3ZDaGVja1ByZUVEVGhyZXNob2xkKChIQU5ETEUpcERldmljZSk7CisJCS8qIHNfdkNoZWNrU2Vuc2l0aXZpdHkoKHZvaWQgKikgcERldmljZSk7ICovCisJCXNfdkNoZWNrUHJlRURUaHJ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UNvdW50KTsKICAgICAgICAgICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlWzBdLnVJbkFjdGl2ZUNvdW50ID0gMDsKQEAgLTEzNzcsOSArMTM0NSw2IEBACiAgICAgcmV0dXJuOwogfQogCi0KLQotCiAvKisKICAqCiAgKiBSb3V0aW5lIERlc2NyaXB0aW9uOgpAQCAtMTM5MywzMCArMTM1OCwyMyBAQAogICoKIC0qLwogCi0KLQotVk9JRAotQlNTdlVwZGF0ZU5vZGVUeENvdW50ZXIoCi0gICAgSU4gSEFORExFICAgICAgaERldmljZUNvbnRleHQsCi0gICAgSU4gUFNTdGF0Q291bnRlciAgICBwU3RhdGlzdGljLAotICAgIElOIEJZVEUgICAgICAgICAgICAgYnlUU1IsCi0gICAgSU4gQllURSAgICAgICAgICAgICBieVBrdE5PCi0gICAgKQordm9pZCBCU1N2VXBkYXRlTm9kZVR4Q291bnRlcih2b2lkICpoRGV2aWNlQ29udGV4dCwKKwkJCSAgICAgUFNTdGF0Q291bnRlciBwU3RhdGlzdGljLAorCQkJICAgICBCWVRFIGJ5VFNSLAorCQkJICAgICBCWVRFIGJ5UGt0Tk8pCiB7CiAgICAgUFNEZXZpY2UgICAgICAgIHBEZXZpY2UgPSAoUFNEZXZpY2UpaERldmljZUNvbnRleHQ7CiAgICAgUFNNZ210T2JqZWN0ICAgIHBNZ210ID0gJihwRGV2aWNlLT5zTWdtdE9iaik7Ci0gICAgVUlOVCAgICAgICAgICAgIHVOb2RlSW5kZXggPSAwOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgIHVOb2RlSW5kZXggPSAwOwogICAgIEJZVEUgICAgICAgICAgICBieVR4UmV0cnk7CiAgICAgV09SRCAgICAgICAgICAgIHdSYXRlOwogICAgIFdPUkQgICAgICAgICAgICB3RmFsbEJhY2tSYXRlID0gUkFURV8xTTsKICAgICBCWVRFICAgICAgICAgICAgYnlGYWxsQmFjazsKLSAgICBVSU5UICAgICAgICAgICAgaWk7CisgICAgdW5zaW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RyYW5zbWl0IHN1Y2Nlc3MsIFR4QXR0ZW1wdHMgYXQgbGVhc3QgcGx1cyBvbmUKICAgICAgICAgICAgICAgICAgICAgcE1nbXQtPnNOb2RlREJUYWJsZVt1Tm9kZUluZGV4XS51VHhPa1tNQVhfUkFURV0rKzsKQEAgLTE1NDIsOSArMTUwMiw2IEBACiAKIH0KIAotCi0KLQogLyorCiAgKgogICogUm91dGluZSBEZXNjcmlwdGlvbjoKQEAgLTE1NjMsMTggKzE1MjAsMTMgQEAKICAqCiAtKi8KIAotCi1WT0lECi1CU1N2Q2xlYXJOb2RlREJUYWJsZSgKLSAgICBJTiBIQU5ETEUgaERldmljZUNvbnRleHQsCi0gICAgSU4gVUlOVCB1U3RhcnRJbmRleAotICAgICkKLQordm9pZCBCU1N2Q2xlYXJOb2RlREJUYWJsZSh2b2lkICpoRGV2aWNlQ29udGV4dCwKKwkJCSAgdW5zaWduZWQgaW50IHVTdGFydEluZGV4KQogewogICAgIFBTRGV2aWNlICAgICBwRGV2aWNlID0gKFBTRGV2aWNlKWhEZXZpY2VDb250ZXh0OwogICAgIFBTTWdtdE9iamVjdCAgICBwTWdtdCA9ICYocERldmljZS0+c01nbXRPYmopOwogICAgIHN0cnVjdCBza19idWZmICAqc2tiOwotICAgIFVJTlQgICAgICAgICAgICBpaTsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICBpaTsKIAogICAgIGZvciAoaWkgPSB1U3RhcnRJbmRleDsgaWkgPCAoTUFYX05PREVfTlVNICsgMSk7IGlpKyspIHsKICAgICAgICAgaWYgKHBNZ210LT5zTm9kZURCVGFibGVbaWldLmJBY3RpdmUpIHsKQEAgLTE1OTIsMTAgKzE1NDQsNyBAQAogICAgIHJldHVybjsKIH07CiAKLQotVk9JRCBzX3ZDaGVja1NlbnNpdGl2aXR5KAotICAgIElOIEhBTkRMRSBoRGV2aWNlQ29udGV4dAotICAgICkKK3ZvaWQgc192Q2hlY2tTZW5zaXRpdml0eSh2b2lkICpoRG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MzY1YjZiLi45Njg2ZDg2IDEwMDY0NAotLS0gYS9kcml2ZXJzL3N0YWdpbmcvdnQ2NjU2L2Jzc2RiLmgKKysrIGIvZHJpdmVycy9zdGFnaW5nL3Z0NjY1Ni9ic3NkYi5oCkBAIC05NywxMCArOTcsMTAgQEAKICAgICAvLyBCU1MgaW5mbwogICAgIEJPT0wgICAgICAgICAgICBiQWN0aXZlOwogICAgIEJZVEUgICAgICAgICAgICBhYnlCU1NJRFtXTEFOX0JTU0lEX0xFTl07Ci0gICAgVUlOVCAgICAgICAgICAgIHVDaGFubmVsOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgIHVDaGFubmVsOwogICAgIEJZVEUgICAgICAgICAgICBhYnlTdXBwUmF0ZXNbV0xBTl9JRUhEUl9MRU4gKyBXTEFOX1JBVEVTX01BWExFTiArIDFdOwogICAgIEJZVEUgICAgICAgICAgICBhYnlFeHRTdXBwUmF0ZXNbV0xBTl9JRUhEUl9MRU4gKyBXTEFOX1JBVEVTX01BWExFTiArIDFdOwotICAgIFVJTlQgICAgICAgICAgICB1UlNTSTsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICB1UlNTSTsKICAgICBCWVRFICAgICAgICAgICAgYnlTUTsKICAgICBXT1JEICAgICAgICAgICAgd0JlYWNvbkludGVydmFsOwogICAgIFdPUkQgICAgICAgICAgICB3Q2FwSW5mbzsKQEAgLTEwOSw5ICsxMDksOSBAQAogCiAvLyAgICBXT1JEICAgICAgICAgICAgd0FUSU1XaW5kb3c7CiAgICAgQllURSAgICAgICAgICAgIGJ5UlNTSVN0YXRDbnQ7Ci0gICAgTE9ORyAgICAgICAgICAgIGxkQm1NQVg7Ci0gICAgTE9ORyAgICAgICAgICAgIGxkQm1BdmVyYWdlW1JTU0lfU1RBVF9DT1VOVF07Ci0gICAgTE9ORyAgICAgICAgICAgIGxkQm1BdmVyUmFuZ2U7CisgICAgc2lnbmVkIGxvbmcgICAgICAgICAgICBsZEJtTUFYOworICAgIH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IGRlcGVuZHMgb24gcGFja2V0VHlwLgogICAgIFdPUkQgICAgICAgICAgICB3TWF4U3VwcFJhdGU7ICAgICAgLy9SZWNvcmRzIHRoZSBoaWdoZXN0IHN1cHBvcnRlZCByYXRlIGdldHRpbmcgZnJvbSBTdXBwUmF0ZXMgSUUgYW5kIEV4dFN1cHBSYXRlcyBJRSBpbiBCZWFjb24uCiAgICAgV09SRCAgICAgICAgICAgIHdTdXBwUmF0ZTsKQEAgLTE5NCwxNjYgKzE5NCwxMTQgQEAKICAgICBCT09MICAgICAgICAgICAgYlBTRW5hYmxlOwogICAgIEJPT0wgICAgICAgICAgICBiUnhQU1BvbGw7CiAgICAgQllURSAgICAgICAgICAgIGJ5QXV0aFNlcXVlbmNlOwotICAgIFVMT05HICAgICAgICAgICB1bExhc3RSeEppZmZlcjsKKyAgICB1bnNpZ25lZCBsb25nICAgICAgICAgICB1bExhc3RSeEppZmZlcjsKICAgICBCWVRFICAgICAgICAgICAgYnlTdXBwUmF0ZTsKICAgICBEV09SRCAgICAgICAgICAgZHdGbGFnczsKICAgICBXT1JEICAgICAgICAgICAgd0VuUXVldWVDbnQ7CiAKICAgICBCT09MICAgICAgICAgICAgYk9uRmx5OwotICAgIFVMT05HTE9ORyAgICAgICBLZXlSU0M7CisgICAgdW5zaWduZWQgbG9uZyBsb25nICAgICAgIEtleVJTQzsKICAgICBCWVRFICAgICAgICAgICAgYnlLZXlJbmRleDsKICAgICBEV09SRCAgICAgICAgICAgZHdLZXlJbmRleDsKICAgICBCWVRFICAgICAgICAgICAgYnlDaXBoZXJTdWl0ZTsKICAgICBEV09SRCAgICAgICAgICAgZHdUU0M0N18xNjsKICAgICBXT1JEICAgICAgICAgICAgd1RTQzE1XzA7Ci0gICAgVUlOVCAgICAgICAgICAgIHVXZXBLZXlMZW5ndGg7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgdVdlcEtleUxlbmd0aDsKICAgICBCWVRFICAgICAgICAgICAgYWJ5V2VwS2V5W1dMQU5fV0VQTUFYX0tFWUxFTl07CiAgICAgLy8KICAgICAvLyBBdXRvIHJhdGUgZmFsbGJhY2sgdmFycwogICAgIEJPT0wgICAgICAgICAgICBiSXNJbkZhbGxiYWNrOwotICAgIFVJTlQgICAgICAgICAgICB1QXZlcmFnZVJTU0k7Ci0gICAgVUlOVCAgICAgICAgICAgIHVSYXRlUmVjb3ZlcnlUaW1lb3V0OwotICAgIFVJTlQgICAgICAgICAgICB1UmF0ZVBvbGxUaW1lb3V0OwotICAgIFVJTlQgICAgICAgICAgICB1VHhGYWlsdXJlczsKLSAgICBVSU5UICAgICAgICAgICAgdVR4QXR0ZW1wdHM7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgdUF2ZXJhZ2VSU1NJOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgIHVSYXRlUmVjb3ZlcnlUaW1lb3V0OworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgIHVSYXRlUG9sbFRpbWVvdXQ7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgdVR4RmFpbHVyZXM7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgdVR4QXR0ZW1wdHM7CiAKLSAgICBVSU5UICAgICAgICAgICAgdVR4UmV0cnk7Ci0gICAgVUlOVCAgICAgICAgICAgIHVGYWlsdXJlUmF0aW87Ci0gICAgVUlOVCAgICAgICAgICAgIHVSZXRyeVJhdGlvOwotICAgIFVJTlQgICAgICAgICAgICB1VHhPa1tNQVhfUkFURSsxXTsKLSAgICBVSU5UICAgICAgICAgICAgdVR4RmFpbFtNQVhfUkFURSsxXTsKLSAgICBVSU5UICAgICAgICAgICAgdVRpbWVDb3VudDsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICB1VHhSZXRyeTsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICB1RmFpbHVyZVJhdGlvOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgIHVSZXRyeVJhdGlvOworICAgIHVuc2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ljZSkgcERldmljZUhhbmRsZXI7CiBCT09MIGJSZXN1bHQgPSBUUlVFOwpAQCAtMTAxOSw3ICsxMDE5LDcgQEAKICAgICByZXR1cm4gYlJlc3VsdDsKIH0KIAotdm9pZCBDQVJEdlNldEJTU01vZGUgKFBWT0lEIHBEZXZpY2VIYW5kbGVyKQordm9pZCBDQVJEdlNldEJTU01vZGUodm9pZCAqcERldmljZUhhbmRsZXIpCiB7CiAgICAgUFNEZXZpY2UgICAgcERldmljZSA9IChQU0RldmljZSkgcERldmljZUhhbmRsZXI7CiAgICAgLy8gU2V0IEJCIGFuZCBwYWNrZXQgdHlwZSBhdCB0aGUgc2FtZSB0aW1lLi8ve3tSb2JlcnRZdToyMDA1MDIyMiwgQUw3MjMwIGhhdmUgdHdvIFRYIFBBIG91dHB1dCwgb25seSBjb25uZXQgdG8gYi9nIG5vdwpAQCAtMTA4MCwxMCArMTA4MCwxMCBAQAogLSovCiBCT09MCiBDQVJEYkNoYW5uZWxTd2l0Y2ggKAotICAgIElOIFBWT0lEICAgICAgICAgICAgcERldmljZUhhbmRsZXIsCi0gICAgSU4gQllURSAgICAgICAgICAgICBieU1vZGUsCi0gICAgSU4gQllURSAgICAgICAgICAgICBieU5ld0NoYW5uZWwsCi0gICAgSU4gQllURSAgICAgICAgICAgICBieUNvdW50CisgICAgIHZvaWQgKnBEZXZpY2VIYW5kbGVyLAorICAgICBCWVRFICAgICAgICAgICAgIGJ5TW9kZSwKKyAgICAgQllURSAgICAgICAgICAgICBieU5ld0NoYW5uZWwsCisgICAgIEJZVEUgICAgICAgICAgICAgYnlDb3VudAogICAgICkKIHsKICAgICBQU0RldmljZSAgICBwRGV2aWNlID0gKFBTRGV2aWNlKSBwRGV2aWNlSGFuZGxlcjsKZGlmZiAtLWdpdCBhL2RyaXZlcnMvc3RhZ2luZy92dDY2NTYvY2FyZC5oIGIvZHJpdmVycy9zdGFnaW5nL3Z0NjY1Ni9jYXJkLmgKaW5kZXggYWE5MGMyYy4uNmM5M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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIEJPT0wKLUNoYW5uZWxWYWxpZChVSU5UIENvdW50cnlDb2RlLCBVSU5UIENoYW5uZWxJbmRleCkKK0NoYW5uZWxWYWxpZCh1bnNpZ25lZCBpbnQgQ291bnRyeUNvZGUsIHVuc2lnbmVkIGludCBDaGFubmVsSW5kZXgpCiB7CiAgICAgQk9PTCAgICBiVmFsaWQ7CiAKQEAgLTQyNSw4ICs0MjUsOCBAQAogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIEJPT0wKIENIdkNoYW5uZWxHZXRMaXN0ICgKLSAgICBJTiAgVUlOVCAgICAgICB1Q291bnRyeUNvZGVJZHgsCi0gICAgT1VUIFBCWVRFICAgICAgcGJ5Q2hhbm5lbFRhYmxlCisgICAgICB1bnNpZ25lZCBpbnQgICAgICAgdUNvdW50cnlDb2RlSWR4LAorICAgICBQQllURSAgICAgIHBieUNoYW5uZWxUYWJsZQogICAgICkKIHsKICAgICBpZiAodUNvdW50cnlDb2RlSWR4ID49IENDT0RFX01BWCkgewpAQCAtNDM3LDExICs0MzcsMTEgQEAKIH0KIAogCi1WT0lEIENIdkluaXRDaGFubmVsVGFibGUgKFBWT0lEIHBEZXZpY2VIYW5kbGVyKQordm9pZCBDSHZJbml0Q2hhbm5lbFRhYmxlKHZvaWQgKnBEZXZpY2VIYW5kbGVyKQogewogICAgIFBTRGV2aWNlICAgIHBEZXZpY2UgPSAoUFNEZXZpY2UpIHBEZXZpY2VIYW5kbGVyOwogICAgIEJPT0wgICAgICAgIGJNdWx0aUJhbmQgPSBGQUxTRTsKLSAgICBVSU5UICAgICAgICBpaTsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgIGlpOwogCiAgICAgZm9yKGlpPTE7aWk8PUNCX01BWF9DSEFOTkVMO2lpKyspIHs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EVfV1JJVEUsCisJCWJ5UmVnT2ZzLAorCQlieVJlZ1R5cGUsCisJCTEsCisJCSZieURhdGExKTsKIH0KIAotCi12b2lkIENvbnRyb2x2UmVhZEJ5dGUoUFNEZXZpY2UgcERldmljZSwgQllURSBieVJlZ1R5cGUsIEJZVEUgYnlSZWdPZnMsIFBCWVRFIHBieURhdGEpCit2b2lkIENvbnRyb2x2UmVhZEJ5dGUoUFNEZXZpY2UgcERldmljZSwgQllURSBieVJlZ1R5cGUsIEJZVEUgYnlSZWdPZnMsCisJCQlQQllURSBwYnlEYXRhKQogewotTlRTVEFUVVMgICAgICAgIG50U3RhdHVzOwotQllURSAgICAgICAgICAgIGJ5RGF0YTE7Ci0KLQotICAgIG50U3RhdHVzID0gQ09OVFJPTG5zUmVxdWVzdEluKHBEZXZpY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNRVNTQUdFX1RZUEVfUkVBRCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5UmVnT2ZzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnlSZWdUeXBlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZieURhdGExKTsKLQotICAgICpwYnlEYXRhID0gYnlEYXRhMTsKLQorCU5UU1RBVFVTCW50U3RhdHVzOworCUJZVEUJYnlEYXRhMTsKKwludFN0YXR1cyA9IENPTlRST0xuc1JlcXVlc3RJbihwRGV2aWNlLAorCQkJCQlNRVNTQUdFX1RZUEVfUkVBRCwKKwkJCQkJYnlSZWdPZnMsCisJCQkJCWJ5UmVnVHlwZSwKKwkJCQkJMSwKKwkJCQkJJmJ5RGF0YTEpOworCSpwYnlEYXRhID0gYnlEYXRhMTsKIH0KIAotCi0KLXZvaWQgQ29udHJvbHZNYXNrQnl0ZShQU0RldmljZSBwRGV2aWNlLCBCWVRFIGJ5UmVn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RfQUREUkVTU19OVU0gKiBVX0VUSEVSX0FERFJfTEVOKQorI2RlZmluZSBNVUxUSUNBU1RfQUREUkVTU19MSVNUX1NJWkUgICAgIChNQVhfTVVMVElDQVNUX0FERFJFU1NfTlVNICogRVRIX0FMRU4pCiAKIAogLy8jZGVmaW5lIE9QX01PREVfSU5GUkFTVFJVQ1RVUkUgIDAKQEAgLTIwOSw5ICsyMDksOSBAQAogLy8gUkNCIChSZWNlaXZlIENvbnRyb2wgQmxvY2spCiB0eXBlZGVmIHN0cnVjdCBfUkNCCiB7Ci0gICAgUFZPSUQgICAgICAgICAgICAgICAgICAgTmV4dDsKLSAgICBMT05HICAgICAgICAgICAgICAgICAgICBSZWY7Ci0gICAgUFZPSUQgICAgICAgICAgICAgICAgICAgcERldmljZTsKKyAgICB2b2lkICpOZXh0OworICAgIHNpZ25lZCBsb25nICAgICAgICAgICAgICAgICAgICBSZWY7CisgICAgdm9pZCAqcERldmljZTsKICAgICBzdHJ1Y3QgdXJiICAgICAgICAgICAgICAqcFVyYjsKICAgICBTUnhNZ210UGFja2V0ICAgICAgICAgICBzTW5nUGFja2V0OwogICAgIHN0cnVjdCBza19idWZmKiAgICAgICAgIHNrYjsKQEAgLTIyMiwzNCArMjIyLDMzIEBACiAKIC8vIHVzZWQgdG8gdHJhY2sgYnVsayBvdXQgaXJwcwogdHlwZWRlZiBzdHJ1Y3QgX1VTQl9TRU5EX0NPTlRFWFQgewotICAgIFBWT0lEICAgICAgICAgICBwRGV2aWNlOworICAgIHZvaWQgKnBEZXZpY2U7CiAgICAgc3RydWN0IHNrX2J1ZmYgKnBQYWNrZXQ7CiAgICAgc3RydWN0IHVyYiAgICAgICpwVXJiOwotICAgIFVJTlQgICAgICAgICAgICB1QnVmTGVuOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgIHVCdWZMZW47CiAgICAgQ09OVEVYVF9UWVBFICAgIFR5cGU7CiAgICAgU0V0aGVybmV0SGVhZGVyIHNFdGhIZWFkZXI7Ci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AgICAgIHBieVJ4QnVmZmVyOwotICAgIFVJTlQgICAgICAgICAgICBjYkZyYW1lTGVuZ3RoOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgIGNiRnJhbWVMZW5ndGg7CiAgICAgQk9PTCAgICAgICAgICAgIGJJblVzZTsKIH0gU0RlRnJhZ0NvbnRyb2xCbG9jaywgKlBTRGVGcmFnQ29udHJvbEJsb2NrOwogCkBAIC00MzUsNyArNDM0LDcgQEAKICAgICBpbnQgICAgICAgICBzaG9ydF9yZXRyeTsKICAgICBpbnQgICAgICAgICBsb25nX3JldHJ5OwogICAgIGludCAgICAgICAgIGJicF90eXBlOwotICAgIFUzMiAgICAgICAgIGZsYWdzOworICAgIHUzMiAgICAgICAgIGZsYWdzOwogfSBPUFRJT05TLCAqUE9QVElPTlM7CiAKIApAQCAtNDUzLDI1ICs0NTIsMjUgQEAKIAlzdHJ1Y3QgdGFza2xldF9zdHJ1Y3QgICAgICAgUmVhZFdvcmtJdGVtOwogCXN0cnVjdCB0YXNrbGV0X3N0cnVjdCAgICAgICBSeE1uZ1dvcmtJdGVtOwogCi0gICAgVTMyICAgICAgICAgICAgICAgICAgICAgICAgIHJ4X2J1Zl9zejsKKyAgICB1MzIgICAgICAgICAgICAgICAgICAgICAgICAgcnhfYnVmX3N6OwogICAgIGludCAgICAgICAgICAgICAgICAgICAgICAgICBtdWx0aWNhc3RfbGltaXQ7CiAgICAgQllURSAgICAgICAgICAgICAgICAgICAgICAgIGJ5UnhNb2RlOwogCiAgICAgc3BpbmxvY2tfdCAgICAgICAgICAgICAgICAgIGxvY2s7CiAKLSAgICBVMzIgICAgICAgICAgICAgICAgICAgICAgICAgcnhfYnl0ZXM7CisgICAgdTMyICAgICAgICAgICAgICAgICAgICAgICAgIHJ4X2J5dGVzOwogCiAgICAgQllURSAgICAgICAgICAgICAgICAgICAgICAgIGJ5UmV2SWQ7CiAKLSAgICBVMzIgICAgICAgICAgICAgICAgICAgICAgICAgZmxhZ3M7Ci0gICAgVUxPTkcgICAgICAgICAgICAgICAgICAgICAgIEZsYWdzOworICAgIHUzMiAgICAgICAgICAgICAgICAgICAgICAgICBmbGFnczsKKyAgICB1bnNpZ25lZCBsb25nICAgICAgICAgICAgICAgICAgICAgICBGbGFnczsKIAogICAgIFNDYWNoZSAgICAgICAgICAgICAgICAgICAgICBzRHVwUnhDYWNoZTsKIAogICAgIFNEZUZyYWdDb250cm9sQmxvY2sgICAgICAgICBzUnhERkNCW0NCX01BWF9SWF9GUkFHXTsKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICAgICAgY2JERkNCOwotICAgIFVJTlQgICAgICAgICAgICAgICAgICAgICAgICBjYkZyZWVERkNCOwotICAgIFVJTlQgICAgICAgICAgICAgICAgICAgICAgICB1Q3VycmVudERGQ0JJZHg7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgICAgICAgICAgY2JERkNCOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgICAgICAgICAgICAgIGNiRnJlZURGQ0I7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgICAgICAgICAgdUN1cnJlbnRERkNCSWR4OwogCiAgICAgLy8gKysrVVNCCiAKQEAgLTQ3OSwyOSArNDc4LDI5IEBACiAgICAgc3RydWN0IHVyYiAgICAgICAgICAgICAgICAgICpwSW50ZXJydXB0VVJCOwogCXN0cnVjdCB1c2JfY3RybHJlcXVlc3QgICAgICBzVXNiQ3RsUmVxdWVzdDsKIAotICAgIFVJTlQgICAgICAgICAgICAgICAgICAgICAgICBpbnRfaW50ZXJ2YWw7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgICAgICAgICAgaW50X2ludGVydmFsOwogICAgIC8vCiAgICAgLy8gVmFyaWFibGVzIHRvIHRyYWNrIHJlc291cmNlcyBmb3IgdGhlIEJVTEsgSW4gUGlwZQogICAgIC8vCiAgICAgUFJDQiAgICAgICAgICAgICAgICAgICAgICAgIHBSQ0JNZW07CiAgICAgUFJDQiAgICAgICAgICAgICAgICAgICAgICAgIGFwUkNCW0NCX01BWF9SWF9ERVNDXTsKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICAgICAgY2JSRDsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICAgICAgICAgICAgICBjYlJEOwogICAgIFBSQ0IgICAgICAgICAgICAgICAgICAgICAgICBGaXJzdFJlY3ZGcmVlTGlzdDsKICAgICBQUkNCICAgICAgICAgICAgICAgICAgICAgICAgTGFzdFJlY3ZGcmVlTGlzdDsKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICAgICAgTnVtUmVjdkZyZWVMaXN0OworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgICAgICAgICAgICAgIE51bVJlY3ZGcmVlTGlzdDsKICAgICBQUkNCICAgICAgICAgICAgICAgICAgICAgICAgRmlyc3RSZWN2TW5nTGlzdDsKICAgICBQUkNCICAgICAgICAgICAgICAgICAgICAgICAgTGFzdFJlY3ZNbmdMaXN0OwotICAgIFVJTlQgICAgICAgICAgICAgICAgICAgICAgICBOdW1SZWN2TW5nTGlzdDsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICAgICAgICAgICAgICBOdW1SZWN2TW5nTGlzdDsKICAgICBCT09MICAgICAgICAgICAgICAgICAgICAgICAgYklzUnhXb3JrSXRlbVF1ZXVlZDsKICAgICBCT09MICAgICAgICAgICAgICAgICAgICAgICAgYklzUnhNbmdXb3JrSXRlbVF1ZXVlZDsKLSAgICBVTE9ORyAgICAgICAgICAgICAgICAgICAgICAgdWxSY3ZSZWZDb3VudDsgICAgICAvLyBudW1iZXIgb2YgcGFja2V0cyB0aGF0IGhhdmUgbm90IGJlZW4gcmV0dXJuZWQgYmFjaworCXVuc2lnbmVkIGxvbmcgdWxSY3ZSZWZDb3VudDsgLyogcGFja2V0cyB0aGF0IGhhdmUgbm90IHJldHVybmVkIGJhY2sgKi8KIAogICAgIC8vCiAgICAgLy8gIFZhcmlhYmxlcyB0byB0cmFjayByZXNvdXJjZXMgZm9yIHRoZSBCVUxLIE91dCBQaXBlCiAgICAgLy8KIAogICAgIFBVU0JfU0VORF9DT05URVhUICAgICAgICAgICBhcFREW0NCX01BWF9UWF9ERVNDXTsKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICAgICAgY2JURDsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICAgICAgICAgICAgICBjYlREOwogCiAgICAgLy8KICAgICAvLyAgVmFyaWFibGVzIHRvIHRyYWNrIHJlc291cmNlcyBmb3IgdGhlIEludGVycmlwdCBJbiBQaXBlCkBAIC01MTgsMjAgKzUxNywyMCBAQAogICAgIC8vCiAgICAgLy8gU3RhdGlzdGljIGZvciBVU0IKICAgICAvLyBwcm90ZWN0IHdpdGggc3BpbmxvY2sKLSAgICBVTE9ORyAgICAgICAgICAgICAgICAgICAgICAgdWxCdWxrSW5Qb3N0ZWQ7Ci0gICAgVUxPTkcgICAgICAgICAgICAgICAgICAgICAgIHVsQnVsa0luRXJyb3I7Ci0gICAgVUxPTkcgICAgICAgICAgICAgICAgICAgICAgIHVsQnVsa0luQ29udENSQ0Vycm9yOwotICAgIFVMT05HICAgICAgICAgICAgICAgICAgICAgICB1bEJ1bGtJbkJ5dGVzUmVhZDsKKyAgICB1bnNpZ25lZCBsb25nICAgICAgICAgICAgICAgICAgICAgICB1bEJ1bGtJblBvc3RlZDsKKyAgICB1bnNpZ25lZCBsb25nICAgICAgICAgICAgICAgICAgICAgICB1bEJ1bGtJbkVycm9yOworICAgIHVuc2lnbmVkIGxvbmcgICAgICAgICAgICAgICAgICAgICAgIHVsQnVsa0luQ29udENSQ0Vycm9yOworICAgIHVuc2lnbmVkIGxvbmcgICAgICAgICAgICAgICAgICAgICAgIHVsQnVsa0luQnl0ZXNSZWFkOwogCi0gICAgVUxPTkcgICAgICAgICAgICAgICAgICAgICAgIHVsQnVsa091dFBvc3RlZDsKLSAgICBVTE9ORyAgICAgICAgICAgICAgICAgICAgICAgdWxCdWxrT3V0RXJyb3I7Ci0gICAgVUxPTkcgICAgICAgICAgICAgICAgICAgICAgIHVsQnVsa091dENvbnRDUkNFcnJvcjsKLSAgICBVTE9ORyAgICAgICAgICAgICAgICAgICAgICAgdWxCdWxrT3V0Qnl0ZXNXcml0ZTsKKyAgICB1bnNpZ25lZCBsb25nICAgICAgICAgICAgICAgICAgICAgICB1bEJ1bGtPdXRQb3N0ZWQ7CisgICAgdW5zaWduZWQgbG9uZyAgICAgICAgICAgICAgICAgICAgICAgdWxCdWxrT3V0RXJyb3I7CisgICAgdW5zaWduZWQgbG9uZyAgICAgICAgICAgICAgICAgICAgICAgdWxCdWxrT3V0Q29udENSQ0Vycm9yOworICAgIHVuc2lnbmVkIGxvbmcgICAgICAgICAgICAgICAgICAgICAgIHVsQnVsa091dEJ5dGVzV3JpdGU7CiAKLSAgICBVTE9ORyAgICAgICAgICAgICAgICAgICAgICAgdWxJbnRJblBvc3RlZDsKLSAgICBVTE9ORyAgICAgICAgICAgICAgICAgICAgICAgdWxJbnRJbkVycm9yOwotICAgIFVMT05HICAgICAgICAgICAgICAgICAgICAgICB1bEludEluQ29udENSQ0Vycm9yOwotICAgIFVMT05HICAgICAgICAgICAgICAgICAgICAgICB1bEludEluQnl0ZXNSZWFkOworICAgIHVuc2lnbmVkIGxvbmcgICAgICAgICAgICAgICAgICAgICAgIHVsSW50SW5Qb3N0ZWQ7CisgICAgdW5zaWduZWQgbG9uZyAgICAgICAgICAgICAgICAgICAgICAgdWxJbnRJbkVycm9yOworICAgIHVuc2lnbmVkIGxvbmcgICAgICAgICAgICAgICAgICAgICAgIHVsSW50SW5Db250Q1JDRXJyb3I7CisgICAgdW5zaWduZWQgbG9uZyAgICAgICAgICAgICAgICAgICAgICAgdWxJbnRJbkJ5dGVzUmVhZDsKIAogCiAgICAgLy8gVmVyc2lvbiBjb250cm9sCkBAIC01NDcsMTAgKzU0NiwxMCBAQAogICAgIEJZVEUgICAgICAgICAgICAgICAgICAgICAgICBieU9yaWdpbmFsWm9uZXR5cGU7CiAKICAgICBCT09MICAgICAgICAgICAgICAgICAgICAgICAgYkxpbmtQYXNzOyAgICAgICAgICAvLyBsaW5rIHN0YXR1czogT0sgb3IgZmFpbAotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgICAgICBhYnlDdXJyZW50TmV0QWRkcltVX0VUSEVSX0FERFJfTEVOXTsKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICAgICAgYWJ5UGVybWFuZW50TmV0QWRkcltVX0VUSEVSX0FERFJfTEVOXTsKKyAgICBCWVRFICAgICAgICAgICAgICAgICAgICAgICAgYWJ5Q3VycmVudE5ldEFkZHJbRVRIX0FMRU5dOworICAgIEJZVEUgICAgICAgICAgICAgICAgICAgICAgICBhYnlQZXJtYW5lbnROZXRBZGRyW0VUSF9BTEVOXTsKICAgICAvLyBTVyBuZXR3b3JrIGFkZHJlc3MKLS8vICAgIEJZVEUgICAgICAgICAgICAgICAgICAgICAgICBhYnlTb2Z0d2FyZU5ldEFkZHJbVV9FVEhFUl9BRERSX0xFTl07CisJLyogdTggYWJ5U29mdHdhcmVOZXRBZGRyW0VUSF9BTEVOXTsgKi8KICAgICBCT09MICAgICAgICAgICAgICAgICAgICAgICAgYkV4aXN0U1dOZXRBZGRyOwogCiAgICAgLy8gQWRhcHRlciBzdGF0aXN0aWNzCkBAIC01NjEsMjQgKzU2MCwyNCBAQAogICAgIC8vCiAgICAgLy8gTWFpbnRhaW4gc3RhdGlzdGljYWwgZGVidWcgaW5mby4KICAgICAvLwotICAgIFVMT05HICAgICAgICAgICAgICAgICAgICAgICBwYWNrZXRzUmVjZWl2ZWQ7Ci0gICAgVUxPTkcgICAgICAgICAgICAgICAgICAgICAgIHBhY2tldHNSZWNlaXZlZERyb3BwZWQ7Ci0gICAgVUxPTkcgICAgICAgICAgICAgICAgICAgICAgIHBhY2tldHNSZWNlaXZlZE92ZXJmbG93OwotICAgIFVMT05HICAgICAgICAgICAgICAgICAgICAgICBwYWNrZXRzU2VudDsKLSAgICBVTE9ORyAgICAgICAgICAgICAgICAgICAgICAgcGFja2V0c1NlbnREcm9wcGVkOwotICAgIFVMT05HICAgICAgICAgICAgICAgICAgICAgICBTZW5kQ29udGV4dHNJblVzZTsKLSAgICBVTE9ORyAgICAgICAgICAgICAgICAgICAgICAgUmN2QnVmZmVyc0luVXNlOworICAgIHVuc2lnbmVkIGxvbmcgICAgICAgICAgICAgICAgICAgICAgIHBhY2tldHNSZWNlaXZlZDsKKyAgICB1bnNpZ25lZCBsb25nICAgICAgICAgICAgICAgICAgICAgICBwYWNrZXRzUmVjZWl2ZWREcm9wcGVkOworICAgIHVuc2lnbmVkIGxvbmcgICAgICAgICAgICAgICAgICAgICAgIHBhY2tldHNSZWNlaXZlZE92ZXJmbG93OworICAgIHVuc2lnbmVkIGxvbmcgICAgICAgICAgICAgICAgICAgICAgIHBhY2tldHNTZW50OworICAgIHVuc2lnbmVkIGxvbmcgICAgICAgICAgICAgICAgICAgICAgIHBhY2tldHNTZW50RHJvcHBlZDsKKyAgICB1bnNpZ25lZCBsb25nICAgICAgICAgICAgICAgICAgICAgICBTZW5kQ29udGV4dHNJblVzZTsKKyAgICB1bnNpZ25lZCBsb25nICAgICAgICAgICAgICAgICAgICAgICBSY3ZCdWZmZXJzSW5Vc2U7CiAKIAogICAgIC8vIDgwMi4xMSBtYW5hZ2VtZW50CiAgICAgU01nbXRPYmplY3QgICAgICAgICAgICAgICAgIHNNZ210T2JqOwogCiAgICAgUVdPUkQgICAgICAgICAgICAgICAgICAgICAgIHF3Q3VyclRTRjsKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICAgICAgY2JCdWxrSW5NYXg7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgICAgICAgICAgY2JCdWxrSW5NYXg7CiAgICAgQk9PTCAgICAgICAgICAgICAgICAgICAgICAgIGJQU1J4QmVhY29uOwogCiAgICAgLy8gODAyLjExIE1BQyBzcGVjaWZpYwotICAgIFVJTlQgICAgICAgICAgICAgICAgICAgICAgICB1Q3VyclJTU0k7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgICAgICAgICAgdUN1cnJSU1NJOwogICAgIEJZVEUgICAgICAgICAgICAgICAgICAgICAgICBieUN1cnJTUTsKIAogCkBAIC01OTksMzAgKzU5OCwzMSBAQAogCiAgICAgQk9PTCAgICAgICAgICAgICAgICAgICAgICAgIGJEaXZlcnNpdHlSZWdDdGxPTjsKICAgICBCT09MICAgICAgICAgICAgICAgICAgICAgICAgYkRpdmVyc2l0eUVuYWJsZTsKLSAgICBVTE9ORyAgICAgICAgICAgICAgICAgICAgICAgdWxEaXZlcnNpdHlOVmFsdWU7Ci0gICAgVUxPTkcgICAgICAgICAgICAgICAgICAgICAgIHVsRGl2ZXJzaXR5TVZhbHVlOworICAgIHVuc2lnbmVkIGxvbmcgICAgICAgICAgICAgICAgICAgICAgIHVsRGl2ZXJzaXR5TlZhbHVlOworICAgIHVuc2lnbmVkIGxvbmcgICAgICAgICAgICAgICAgICAgICAgIHVsRGl2ZXJzaXR5TVZhbHVlOwogICAgIEJZVEUgICAgICAgICAgICAgICAgICAgICAgICBieVRNYXg7CiAgICAgQllURSAgICAgICAgICAgICAgICAgICAgICAgIGJ5VE1heDI7CiAgICAgQllURSAgICAgICAgICAgICAgICAgICAgICAgIGJ5VE1heDM7Ci0gICAgVUxPTkcgICAgICAgICAgICAgICAgICAgICAgIHVsU1EzVEg7CisgICAgdW5zaWduZWQgbG9uZyAgICAgICAgICAgICAgICAgICAgICAgdWxTUTNUSDsKIAotICAgIFVMT05HICAgICAgICAgICAgICAgICAgICAgICB1RGl2ZXJzaXR5Q250OworICAgIHVuc2lnbmVkIGxvbmcgICAgICAgICAgICAgICAgICAgICAgIHVEaXZlcnNpdHlDbnQ7CiAgICAgQllURSAgICAgICAgICAgICAgICAgICAgICAgIGJ5QW50ZW5uYVN0YXRlOwotICAgIFVMT05HICAgICAgICAgICAgICAgICAgICAgICB1bFJhdGlvX1N0YXRlMDsKLSAgICBVTE9ORyAgICAgICAgICAgICAgICAgICAgICAgdWxSYXRpb19TdGF0ZTE7Ci0gICAgVUxPTkcgICAgICAgICAgICAgICAgICAgICAgIHVsU1EzX1N0YXRlMDsKLSAgICBVTE9ORyAgICAgICAgICAgICAgICAgICAgICAgdWxTUTNfU3RhdGUxOworICAgIHVuc2lnbmVkIGxvbmcgICAgICAgICAgICAgICAgICAgICAgIHVsUmF0aW9fU3RhdGUwOworICAgIHVuc2lnbmVkIGxvbmcgICAgICAgICAgICAgICAgICAgICAgIHVsUmF0aW9fU3RhdGUxOworICAgIHVuc2lnbmVkIGxvbmcgICAgICAgICAgICAgICAgICAgICAgIHVsU1EzX1N0YXRlMDsKKyAgICB1bnNpZ25lZCBsb25nICAgICAgICAgICAgICAgICAgICAgICB1bFNRM19TdGF0ZTE7CiAKLSAgICBVTE9ORyAgICAgICAgICAgICAgICAgICAgICAgYXVsU1EzVmFsW01BWF9SQVRFXTsKLSAgICBVTE9ORyAgICAgICAgICAgICAgICAgICAgICAgYXVsUGt0TnVtW01BWF9SQVRFXTsKKyAgICB1bnNpZ25lZCBsb25nICAgICAgICAgICAgICAgICAgICAgICBhdWxTUTNWYWxbTUFYX1JBVEVdOworICAgIHVuc2lnbmVkIGxvbmcgICAgICAgICAgICAgICAgICAgICAgIGF1bFBrdE51bVtNQVhfUkFURV07CiAKLSAgICAvLyBJRlMgJiBDdwotICAgIFVJTlQgICAgICAgICAgICAgICAgICAgICAgICB1U0lGUzsgICAgLy9DdXJyZW50IFNJRlMKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICAgICAgdURJRlM7ICAgIC8vQ3VycmVudCBESUZTCi0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgICAgIHVFSUZTOyAgICAvL0N1cnJlbnQgRUlGUwotICAgIFVJTlQgICAgICAgICAgICAgICAgICAgICAgICB1U2xvdDsgICAgLy9DdXJyZW50IFNsb3RUaW1lCi0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgICAgIHVDd01pbjsgICAvL0N1cnJlbnQgQ3dNaW4KLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICAgICAgdUN3TWF4OyAgIC8vQ3dNYXggaXMgZml4ZWQgb24gMTAyMy4KKwkvKiBJRlMgJiBDdyAqLworCXVuc2lnbmVkIGludCB1U0lGUzsgIC8qIEN1cnJlbnQgU0lGUyAqLworCXVuc2lnbmVkIGludCB1RElGUzsgIC8qIEN1cnJlbnQgRElGUyAqLworCXVuc2lnbmVkIGludCB1RUlGUzsgIC8qIEN1cnJlbnQgRUlGUyAqLworCXVuc2lnbmVkIGludCB1U2xvdDsgIC8qIEN1cnJlbnQgU2xvdFRpbWUgKi8KKwl1bnNpZ25lZCBpbnQgdUN3TWluOyAvKiBDdXJyZW50IEN3TWluICovCisJdW5zaWduZWQgaW50IHVDd01heDsgLyogQ3dNYXggaXMgZml4ZWQgb24gMTAyMyAqLworCiAgICAgLy8gUEhZIHBhcmFtZXRlcgogICAgIEJZVEUgICAgICAgICAgICAgICAgICAgICAgICBieVNJRlM7CiAgICAgQllURSAgICAgICAgICAgICAgICAgICAgICAgIGJ5RElGUzsKQEAgLTY0Nyw3ICs2NDcsNyBAQAogCiAgICAgQllURSAgICAgICAgICAgICAgICAgICAgICAgIGJ5TWluQ2hhbm5lbDsKICAgICBCWVRFICAgICAgICAgICAgICAgICAgICAgICAgYnlNYXhDaGFubmVsOwotICAgIFVJTlQgICAgICAgICAgICAgICAgICAgICAgICB1Q29ubmVjdGlvblJhdGU7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgICAgICAgICAgdUNvbm5lY3Rpb25SYXRlOwogCiAgICAgQllURSAgICAgICAgICAgICAgICAgICAgICAgIGJ5UHJlYW1ibGVUeXBlOwogICAgIEJZVEUgICAgICAgICAgICAgICAgICAgICAgICBieVNob3J0UHJlYW1ibGU7CkBAIC02NzEsOCArNjcxLDggQEAKICAgICBDQVJEX09QX01PREUgICAgICAgICAgICAgICAgZU9QTW9kZTsKICAgICBCT09MICAgICAgICAgICAgICAgICAgICAgICAgYkJTU0lERmlsdGVyOwogICAgIFdPUkQgICAgICAgICAgICAgICAgICAgICAgICB3TWF4VHJhbnNtaXRNU0RVTGlmZXRpbWU7Ci0gICAgQllURSAgICAgICAgICAgICAgICAgICAgICAgIGFieUJTU0lEW1VfRVRIRVJfQUREUl9MRU5dOwotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgICAgICBhYnlEZXNpcmVCU1NJRFtVX0VUSEVSX0FERFJfTEVOXTsKKyAgICBCWVRFICAgICAgICAgICAgICAgICAgICAgICAgYWJ5QlNTSURbRVRIX0FMRU5dOworICAgIEJZVEUgICAgICAgICAgICAgICAgICAgICAgICBhYnlEZXNpcmVCU1NJRFtFVEhfQUxFTl07CiAgICAgV09SRCAgICAgICAgICAgICAgICAgICAgICAgIHdDVFNEdXJhdGlvbjsgICAgICAgLy8gdXBkYXRlIHdoaWxlIHNwZWVkIGNoYW5nZQogICAgIFdPUkQgICAgICAgICAgICAgICAgICAgICAgICB3QUNLRHVyYXRpb247ICAgICAgIC8vIHVwZGF0ZSB3aGlsZSBzcGVlZCBjaGFuZ2UKICAgICBXT1JEICAgICAgICAgICAgICAgICAgICAgICAgd1JUU1RyYW5zbWl0TGVuOyAgICAvLyB1cGRhdGUgd2hpbGUgc3BlZWQgY2hhbmdlCkBAIC03MDEsNyArNzAxLDcgQEAKICAgICBXT1JEICAgICAgICAgICAgICAgICAgICAgICAgd0xpc3RlbkludGVydmFsOwogICAgIEJPT0wgICAgICAgICAgICAgICAgICAgICAgICBiUFdCaXRPbjsKICAgICBXTUFDX1BPV0VSX01PREUgICAgICAgICAgICAgZVBTTW9kZTsKLSAgICBVTE9ORyAgICAgICAgICAgICAgICAgICAgICAgdWxQU01vZGVXYWl0VHg7CisgICAgdW5zaWduZWQgbG9uZyAgICAgICAgICAgICAgICAgICAgICAgdWxQU01vZGVXYWl0VHg7CiAgICAgQk9PTCAgICAgICAgICAgICAgICAgICAgICAgIGJQU01vZGVUeEJ1cnN0OwogCiAgICAgLy8gQmVhY29uIHJlbGVhdGVkCkBAIC03MTAsNyArNzEwLDcgQEAKICAgICBCT09MICAgICAgICAgICAgICAgICAgICBiQmVhY29uU2VudDsKICAgICBCT09MICAgICAgICAgICAgICAgICAgICBiRml4UmF0ZTsKICAgICBCWVRFICAgICAgICAgICAgICAgICAgICBieUN1cnJlbnRDaDsKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICB1U2NhblRpbWU7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgICAgICB1U2NhblRpbWU7CiAKICAgICBDTURfU1RBVEUgICAgICAgICAgICAgICBlQ29tbWFuZFN0YXRlOwogCkBAIC03MjEsMTUgKzcyMSwxNSBAQAogICAgIEJPT0wgICAgICAgICAgICAgICAgICAgIGJTdG9wQmVhY29uOwogICAgIEJPT0wgICAgICAgICAgICAgICAgICAgIGJTdG9wRGF0YVBrdDsKICAgICBCT09MICAgICAgICAgICAgICAgICAgICBiU3RvcFR4MFBrdDsKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICB1QXV0b1JlQ29ubmVjdFRpbWU7Ci0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgdUlzcm9hbWluZ1RpbWU7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgICAgICB1QXV0b1JlQ29ubmVjdFRpbWU7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgICAgICB1SXNyb2FtaW5nVGltZTsKIAogICAgIC8vIDgwMi4xMSBjb3VudGVyCiAKICAgICBDTURfSVRFTSAgICAgICAgICAgICAgICBlQ21kUXVldWVbQ01EX1FfU0laRV07Ci0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgdUNtZERlcXVldWVJZHg7Ci0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgdUNtZEVucXVldWVJZHg7Ci0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgY2JGcmVlQ21kUXVldWU7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgICAgICB1Q21kRGVxdWV1ZUlkeDsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICAgICAgICAgIHVDbWRFbnF1ZXVlSWR4OworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgICAgICAgICAgY2JGcmVlQ21kUXVldWU7CiAgICAgQk9PTCAgICAgICAgICAgICAgICAgICAgYkNtZFJ1bm5pbmc7CiAgICAgQk9PTCAgICAgICAgICAgICAgICAgICAgYkNtZENsZWFyOwogICAgIEJPT0wgICAgICAgICAgICAgICAgICAgIGJOZWVkUmFkaW9PRkY7CkBAIC03NDEsNyArNzQxLDcgQEAKICAgICBCWVRFICAgICAgICAgICAgICAgICAgICBiU2FtZUJTU0N1ck51bTsgIC8vRGF2aWRXYW5nCiAgICAgQk9PTCAgICAgICAgICAgICAgICAgICAgYlJvYW1pbmc7CiAgICAgQk9PTCAgICAgICAgICAgICAgICAgICAgYjExaEVhYmxlOwotICAgIFVMT05HICAgICAgICAgICAgICAgICAgIHVsVHhQb3dlcjsKKyAgICB1bnNpZ25lZCBsb25nICAgICAgICAgICAgICAgICAgIHVsVHhQb3dlcjsKIAogICAgIC8vIEVuY3J5cHRpb24KICAgICBORElTXzgwMl8xMV9XRVBfU1RBVFVTICBlRW5jcnlwdGlvblN0YXR1czsKQEAgLTc2MiwxMSArNzYyLDExIEBACiAgICAgQk9PTCAgICAgICAgICAgICAgICAgICAgYkFFUzsKICAgICBCWVRFICAgICAgICAgICAgICAgICAgICBieUNudE1lYXN1cmU7CiAKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICB1S2V5TGVuZ3RoOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgICAgICAgICAgdUtleUxlbmd0aDsKICAgICBCWVRFICAgICAgICAgICAgICAgICAgICBhYnlLZXlbV0xBTl9XRVAyMzJfS0VZTEVOXTsKIAogICAgIC8vIGZvciBBUCBtb2RlCi0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgdUFzc29jQ291bnQ7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgICAgICB1QXNzb2NDb3VudDsKICAgICBCT09MICAgICAgICAgICAgICAgICAgICBiTW9yZURhdGE7CiAKICAgICAvLyBRb1MKQEAgLTc4MSwxMSArNzgxLDExIEBACiAKICAgICAvLyBGb3IgVXBkYXRlIEJhc2VCYW5kIFZHQSBHYWluIE9mZnNldAogICAgIEJPT0wgICAgICAgICAgICAgICAgICAgIGJVcGRhdGVCQlZHQTsKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICB1QkJWR0FEaWZmQ291bnQ7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgICAgICB1QkJWR0FEaWZmQ291bnQ7CiAgICAgQllURSAgICAgICAgICAgICAgICAgICAgYnlCQlZHQU5ldzsKICAgICBCWVRFICAgICAgICAgICAgICAgICAgICBieUJCVkdBQ3VycmVudDsKICAgICBCWVRFICAgICAgICAgICAgICAgICAgICBhYnlCQlZHQVtCQl9WR0FfTEVWRUxdOwotICAgIExPTkcgICAgICAgICAgICAgICAgICAgIGxkQm1UaHJlc2hvbGRbQkJfVkdBX0xFVkVMXTsKKyAgICBzaWduZWQgbG9uZyAgICAgICAgICAgICAgICAgICAgbGRCbVRocmVzaG9sZFtCQl9WR0FfTEVWRUxdOwogCiAgICAgQllURSAgICAgICAgICAgICAgICAgICAgYnlCQlByZUVEUlNTSTsKICAgICBCWVRFICAgICAgICAgICAgICAgICAgICBieUJCUHJlRURJbmRleDsKQEAgLTgxMyw3ICs4MTMsNyBAQAogLy8yMDA3LTAxMTUtMDE8QWRkPmJ5IE1pa2VMaXUKICNpZmRlZiBUeEluU2xlZXAKICAgICAgc3RydWN0IHRpbWVyX2xpc3QgICAgICAgc1RpbWVyVHhEYXRhOwotICAgICBVTE9ORyAgICAgICAgICAgICAgICAgICAgICAgblR4RGF0YVRpbWVDb3V0OworICAgICB1bnNpZ25lZCBsb25nICAgICAgICAgICAgICAgICAgICAgICBuVHhEYXRhVGltZUNvdXQ7CiAgICAgIEJPT0wgIGZUeERhdGFJblNsZWVwOwogICAgICBCT09MICBJc1R4RGF0YVRyaWdnZXI7CiAjZW5kaWYKQEAgLTgyNiw5ICs4MjYsOSBAQAogCiAgICAgU0V0aGVybmV0SGVhZGVyICAgICAgICAgc1R4RXRoSGVhZGVyOwogICAgIFNFdGhlcm5ldEhlYWRlciAgICAgICAgIHNSeEV0aEhlYWRlcjsKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICBhYnlCcm9hZGNhc3RBZGRyW1VfRVRIRVJfQUREUl9MRU5dOwotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgIGFieVNOQVBfUkZDMTA0MltVX0VUSEVSX0FERFJfTEVOXTsKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICBhYnlTTkFQX0JyaWRnZXR1bm5lbFtVX0VUSEVSX0FERFJfTEVOXTsKKyAgICBCWVRFICAgICAgICAgICAgICAgICAgICBhYnlCcm9hZGNhc3RBZGRyW0VUSF9BTEVOXTsKKyAgICBCWVRFICAgICAgICAgICAgICAgICAgICBhYnlTTkFQX1JGQzEwNDJbRVRIX0FMRU5dOworICAgIEJZVEUgICAgICAgICAgICAgICAgICAgIGFieVNOQVBfQnJpZGdldHVubmVsW0VUSF9BTEVOXTsKIAogICAgIC8vIFByZS1BdXRoZW50aWNhdGlvbiAmIFBNSyBjYWNoZQogICAgIFNQTUtJRCAgICAgICAgICAgICAgICAgIGdzUE1LSUQ7CkBAIC04NjQsNyArODY0LDcgQEAKIAlzdHJ1Y3QgbmV0X2RldmljZSAgICAgICAqYXBkZXY7CiAJaW50ICgqdHhfODAyMTEpKHN0cnVjdCBza19idWZmICpza2IsIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpOwogI2VuZGlmCi0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgdUNoYW5uZWw7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgICAgICB1Q2hhbm5lbDsKIAogCXN0c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sKIAogCiAKIHN0YXRpYyBCT09MIHNfYkFQTW9kZVJ4RGF0YSAoCi0gICAgSU4gUFNEZXZpY2UgcERldmljZSwKLSAgICBJTiBzdHJ1Y3Qgc2tfYnVmZiogc2tiLAotICAgIElOIFVJTlQgICAgIEZyYW1lU2l6ZSwKLSAgICBJTiBVSU5UICAgICBjYkhlYWRlck9mZnNldCwKLSAgICBJTiBJTlQgICAgICBpU0FOb2RlSW5kZXgsCi0gICAgSU4gSU5UICAgICAgaURBTm9kZUluZGV4CisgICAgIFBTRGV2aWNlIHBEZXZpY2UsCisgICAgIHN0cnVjdCBza19idWZmICpza2IsCisgICAgIHVuc2lnbmVkIGludCAgICAgRnJhbWVTaXplLAorICAgICB1bnNpZ25lZCBpbnQgICAgIGNiSGVhZGVyT2Zmc2V0LAorICAgICBzaWduZWQgaW50ICAgICAgaVNBTm9kZUluZGV4LAorICAgICBzaWduZWQgaW50ICAgICAgaURBTm9kZUluZGV4CiAgICAgKTsKIAogCiBzdGF0aWMgQk9PTCBzX2JIYW5kbGVSeEVuY3J5cHRpb24oCi0gICAgSU4gUFNEZXZpY2UgICAgIHBEZXZpY2UsCi0gICAgSU4gUEJZVEUgICAgICAgIHBieUZyYW1lLAotICAgIElOIFVJTlQgICAgICAgICBGcmFtZVNpemUsCi0gICAgSU4gUEJZVEUgICAgICAgIHBieVJzciwKLSAgICBPVVQgUEJZVEUgICAgICAgcGJ5TmV3UnNyLAotICAgIE9VVCBQU0tleUl0ZW0gICAqcEtleU91dCwKKyAgICAgUFNEZXZpY2UgICAgIHBEZXZpY2UsCisgICAgIFBCWVRFICAgICAgICBwYnlGcmFtZSwKKyAgICAgdW5zaWduZWQgaW50ICAgICAgICAgRnJhbWVTaXplLAorICAgICBQQllURSAgICAgICAgcGJ5UnNyLAorICAgICBQQllURSAgICAgICBwYnlOZXdSc3IsCisgICAgIFBTS2V5SXRlbSAgICogcEtleU91dCwKICAgICBpbnQgKiAgICAgICBwYkV4dElWLAotICAgIE9VVCBQV09SRCAgICAgICBwd1J4VFNDMTVfMCwKLSAgICBPVVQgUERXT1JEICAgICAgcGR3UnhUU0M0N18xNgorICAgICBQV09SRCAgICAgICBwd1J4VFNDMTVfMCwKKyAgICAgUERXT1JEICAgICAgcGR3UnhUU0M0N18xNgogICAgICk7CiAKIHN0YXRpYyBCT09MIHNfYkhvc3RXZXBSeEVuY3J5cHRpb24oCiAKLSAgICBJTiBQU0RldmljZSAgICAgcERldmljZSwKLSAgICBJTiBQQllURSAgICAgICAgcGJ5RnJhbWUsCi0gICAgSU4gVUlOVCAgICAgICAgIEZyYW1lU2l6ZSwKLSAgICBJTiBQQllURSAgICAgICAgcGJ5UnNyLAotICAgIElOIEJPT0wgICAgICAgICBiT25GbHksCi0gICAgSU4gUFNLZXlJdGVtICAgIHBLZXksCi0gICAgT1VUIFBCWVRFICAgICAgIHBieU5ld1JzciwKKyAgICAgUFNEZXZpY2UgICAgIHBEZXZpY2UsCisgICAgIFBCWVRFICAgICAgICBwYnlGcmFtZSwKKyAgICAgdW5zaWduZWQgaW50ICAgICAgICAgRnJhbWVTaXplLAorICAgICBQQllURSAgICAgICAgcGJ5UnNyLAorICAgICBCT09MICAgICAgICAgYk9uRmx5LAorICAgICBQU0tleUl0ZW0gICAgcEtleSwKKyAgICAgUEJZVEUgICAgICAgcGJ5TmV3UnNyLAogICAgIGludCAqICAgICAgIHBiRXh0SVYsCi0gICAgT1VUIFBXT1JEICAgICAgIHB3UnhUU0MxNV8wLAotICAgIE9VVCBQRFdPUkQgICAgICBwZHdSeFRTQzQ3XzE2CisgICAgIFBXT1JEICAgICAgIHB3UnhUU0MxNV8wLAorICAgICBQRFdPUkQgICAgICBwZHdSeFRTQzQ3XzE2CiAKICAgICApOwogCkBAIC0xNjEsMTggKzE2MCwxOCBAQAogICoKIC0qLwogc3RhdGljCi1WT0lECit2b2lkCiBzX3ZQcm9jZXNzUnhNQUNIZWFkZXIgKAotICAgIElOICBQU0RldmljZSBwRGV2aWNlLAotICAgIEl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TaXplKTsKKwlwTUFDSGVhZGVyID0gKFBTODAyXzExSGVhZGVyKSAocGJ5UnhCdWZmZXJBZGRyICsgY2JIZWFkZXJTaXplKTsKIAotICAgIGlmICgocE1BQ0hlYWRlci0+d0ZyYW1lQ3RsICYgRkNfVE9EUykgPT0gMCkgewotICAgICAgICBpZiAocE1BQ0hlYWRlci0+d0ZyYW1lQ3RsICYgRkNfRlJPTURTKSB7Ci0gICAgICAgICAgICBmb3IoaWk9MDtpaTxVX0VUSEVSX0FERFJfTEVOO2lpKyspIHsKLSAgICAgICAgICAgICAgICBwc0V0aEhlYWRlci0+YWJ5RHN0QWRkcltpaV0gPSBwTUFDSGVhZGVyLT5hYnlBZGRyMVtpaV07Ci0gICAgICAgICAgICAgICAgcHNFdGhIZWFkZXItPmFieVNyY0FkZHJbaWldID0gcE1BQ0hlYWRlci0+YWJ5QWRkcjNbaWldOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UgewotICAgICAgICAgICAgLy8gSUJTUyBtb2RlCi0gICAgICAgICAgICBmb3IoaWk9MDtpaTxVX0VUSEVSX0FERFJfTEVOO2lpKyspIHsKLSAgICAgICAgICAgICAgICBwc0V0aEhlYWRlci0+YWJ5RHN0QWRkcltpaV0gPSBwTUFDSGVhZGVyLT5hYnlBZGRyMVtpaV07Ci0gICAgICAgICAgICAgICAgcHNFdGhIZWFkZXItPmFieVNyY0FkZHJbaWldID0gcE1BQ0hlYWRlci0+YWJ5QWRkcjJbaWldOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UgewotICAgICAgICAvLyBJcyBBUCBtb2RlLi4KLSAgICAgICAgaWYgKHBNQUNIZWFkZXItPndGcmFtZUN0bCAmIEZDX0ZST01EUykgewotICAgICAgICAgICAgZm9yKGlpPTA7aWk8VV9FVEhFUl9BRERSX0xFTjtpaSsrKSB7Ci0gICAgICAgICAgICAgICAgcHNFdGhIZWFkZXItPmFieURzdEFkZHJbaWldID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mcgICAgICAgICAgICBCeXRlc1RvSW5kaWNhdGUKICAgICApCiB7CiAKQEAgLTMyOSwyNiArMzMzLDI2IEBACiAgICAgUFFXT1JEICAgICAgICAgIHBxd1RTRlRpbWU7CiAgICAgUEJZVEUgICAgICAgICAgIHBieUZyYW1lOwogICAgIEJPT0wgICAgICAgICAgICBiRGVGcmFnUnggPSBGQUxTRTsKLSAgICBVSU5UICAgICAgICAgICAgY2JIZWFkZXJPZmZzZXQ7Ci0gICAgVUlOVCAgICAgICAgICAgIEZyYW1lU2l6ZTsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICBjYkhlYWRlck9mZnNldDsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICBGcmFtZVNpemU7CiAgICAgV09SRCAgICAgICAgICAgIHdFdGhlclR5cGUgPSAwOwotICAgIElOVCAgICAgICAgICAgICBpU0FOb2RlSW5kZXggPSAtMTsKLSAgICBJTlQgICAgICAgICAgICAgaURBTm9kZUluZGV4ID0gLTE7Ci0gICAgVUlOVCAgICAgICAgICAgIGlpOwotICAgIFVJTlQgICAgICAgICAgICBjYklWT2Zmc2V0OworICAgIHNpZ25lZCBpbnQgICAgICAgICAgICAgaVNBTm9kZUluZGV4ID0gLTE7CisgICAgc2lnbmVkIGludCAgICAgICAgICAgICBpREFOb2RlSW5kZXggPSAtMTsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICBpaTsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICBjYklWT2Zmc2V0OwogICAgIFBCWVRFICAgICAgICAgICBwYnlSeFN0czsKICAgICBQQllURSAgICAgICAgICAgcGJ5UnhSYXRlOwogICAgIFBCWVRFICAgICAgICAgICBwYnlTUTsKICNpZmRlZiBDYWxjdV9MaW5rUXVhbAogICAgIFBCWVRFICAgICAgICAgICBwYnkzU1E7CiAjZW5kaWYKLSAgICBVSU5UICAgICAgICAgICAgY2JIZWFkZXJTaXplOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgIGNiSGVhZGVyU2l6ZTsKICAgICBQU0tleUl0ZW0gICAgICAgcEtleSA9IE5VTEw7CiAgICAgV09SRCAgICAgICAgICAgIHdSeFRTQzE1XzAgPSAwOwogICAgIERXT1JEICAgICAgICAgICBkd1J4VFNDNDdfMTYgPSAwOwogICAgIFNLZXlJdGVtICAgICAgICBTVGVtcEtleTsKICAgICAvLyA4MDIuMTFoIFJQSQotICAgIC8vTE9ORyAgICAgICAgICAgIGxkQm0gPSAwOworICAgIC8qIHNpZ25lZCBsb25nIGxkQm0gPSAwOyAqLwogICAgIEJPT0wgICAgICAgICAgICBiSXNXRVAgPSBGQUxTRTsKICAgICBCT09MICAgICAgICAgICAgYkV4dElWID0gRkFMU0U7CiAgICAgRFdPUkQgICAgICAgICAgIGR3V2JrU3RhdHVzOwpAQCAtMzY4LDcgKzM3Miw3IEBACiAKICAgICAvL1szMToxNl1SY3ZCeXRlQ291bnQgKCBub3QgaW5jbHVkZSA0LWJ5dGUgU3RhdHVzICkKICAgICBkd1dia1N0YXR1cyA9ICAqKCAoUERXT1JEKShza2ItPmRhdGEpICk7Ci0gICAgRnJhbWVTaXplID0gKFVJTlQpKGR3V2JrU3RhdHVzID4+IDE2KTsKKyAgICBGcmFtZVNpemUgPSAodW5zaWduZWQgaW50KShkd1dia1N0YXR1cyA+PiAxNik7CiAgICAgRnJhbWVTaXplICs9IDQ7CiAKICAgICBpZiAoQnl0ZXNUb0luZGljYXRlICE9IEZyYW1lU2l6ZSkgewpAQCAtOTMwLDkgKzkzNCw5IEBACiAgICAgICAgIGlmIChiSXNXRVApIHsKICAgICAgICAgICAgIFdPUkQgICAgICAgIHdMb2NhbFRTQzE1XzAgPSAwOwogICAgICAgICAgICAgRFdPUkQgICAgICAgZHdMb2NhbFRTQzQ3XzE2ID0gMDsKLSAgICAgICAgICAgIFVMT05HTE9ORyAgICAgICBSU0MgPSAwOworCSAgICB1bnNpZ25lZCBsb25nIGxvbmcgICAgICAgUlNDID0gMDsKICAgICAgICAgICAgIC8vIGVuZGlhbiBpc3N1ZXMKLSAgICAgICAgICAgIFJTQyA9ICooKFVMT05HTE9ORyAqKSAmKHBLZXktPktleVJTQykpOworCSAgICBSU0MgPSAqKCh1bnNpZ25lZCBsb25nIGxvbmcgKikgJihwS2V5LT5LZXlSU0MpKTsKICAgICAgICAgICAgIHdMb2NhbFRTQzE1XzAgPSAoV09SRCkgUlNDOwogICAgICAgICAgICAgZHdMb2NhbFRTQzQ3XzE2ID0gKERXT1JEKSAoUlNDPj4xNik7CiAKQEAgLTEwMTcsOSArMTAyMSw5IEBACiAKIAogc3RhdGljIEJPT0wgc19iQVBNb2RlUnhDdGwgKAotICAgIElOIFBTRGV2aWNlIHBEZXZpY2UsCi0gICAgSU4gUEJZVEUgICAgcGJ5RnJhbWUsCi0gICAgSU4gSU5UICAgICAgaVNBTm9kZUluZGV4CisgICAgIFBTRGV2aWNlIHBEZXZpY2UsCisgICAgIFBCWVRFICAgIHBieUZyYW1lLAorICAgICBzaWduZWQgaW50ICAgICAgaVNBTm9kZUluZGV4CiAgICAgKQogewogICAgIFBTODAyXzExSGVhZGVyICAgICAgcDgwMl8xMUhlYWRlcjsKQEAgLTEwNjUsNyArMTA2OSw5IEBACiAgICAgICAgICAgICAgICAgICAgIC8vIGRlbGNhcmUgcmVjZWl2ZWQgcHMtcG9sbCBldmVudAogICAgICAgICAgICAgICAgICAgICBpZiAoSVNfQ1RMX1BTUE9MTChwYnlGcmFtZSkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIHBNZ210LT5zTm9kZURCVGFibGVbaVNBTm9kZUluZGV4XS5iUnhQU1BvbGwgPSBUUlVFOwotICAgICAgICAgICAgICAgICAgICAgICAgYlNjaGVkdWxlQ29tbWFuZCgoSEFORExFKXBEZXZpY2UsIFdMQU5fQ01EX1JYX1BTUE9MTCwgTlVMTCk7CisJCQliU2NoZWR1bGVDb21tYW5kKCh2b2lkICopIHBEZXZpY2UsCisJCQkJCSBXTEFOX0NNRF9SWF9QU1BPTEwsCisJCQkJCSBOVUxMKTsKICAgICAgICAgICAgICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8gImRwYzogV0xBTl9DTURfUlhfUFNQT0xMIDFcbiIpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIGVsc2UgewpAQCAtMTA3NCw3ICsxMDgwLDkgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghSVNfRkNfUE9XRVJNR1QocGJ5RnJhbWUpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1nbXQtPnNOb2RlREJUYWJsZVtpU0FOb2RlSW5kZXhdLmJQU0VuYWJsZSA9IEZBTFNFOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNZ210LT5zTm9kZURCVGFibGVbaVNBTm9kZUluZGV4XS5iUnhQU1BvbGwgPSBUUlVFOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJTY2hlZHVsZUNvbW1hbmQoKEhBTkRMRSlwRGV2aWNlLCBXTEFOX0NNRF9SWF9QU1BPTEwsIE5VTEwpOworCQkJCWJTY2hlZHVsZUNvbW1hbmQoKHZvaWQgKikgcERldmljZSwKKwkJCQkJCSBXTEFOX0NNRF9SWF9QU1BPTEwsCisJCQkJCQkgTlVMTCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyAiZHBjOiBXTEFOX0NNRF9SWF9QU1BPTEwgMlxuIik7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KQEAgLTEwOTAsNyArMTA5OCw5IEBACiAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBNZ210LT5zTm9kZURCVGFibGVbaVNBTm9kZUluZGV4XS53RW5RdWV1ZUNudCA+IDApIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1nbXQtPnNOb2RlREJUYWJsZVtpU0FOb2RlSW5kZXhdLmJQU0VuYWJsZSA9IEZBTFNFOwogICAgICAgICAgICAgICAgICAgICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlW2lTQU5vZGVJbmRleF0uYlJ4UFNQb2xsID0gVFJVRTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgYlNjaGVkdWxlQ29tbWFuZCgoSEFORExFKXBEZXZpY2UsIFdMQU5fQ01EX1JYX1BTUE9MTCwgTlVMTCk7CisJCQliU2NoZWR1bGVDb21tYW5kKCh2b2lkICopIHBEZXZpY2UsCisJCQkJCSBXTEFOX0NNRF9SWF9QU1BPTEwsCisJCQkJCSBOVUxMKTsKICAgICAgICAgICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPICJkcGM6IFdMQU5fQ01EX1JYX1BTUE9MTCAzXG4iKTsKIAogICAgICAgICAgICAgICAgICAgICAgIH0KQEAgLTExMzksMTggKzExNDksMTggQEAKIH0KIAogc3RhdGljIEJPT0wgc19iSGFuZGxlUnhFbmNyeXB0aW9uICgKLSAgICBJTiBQU0RldmljZSAgICAgcERldmljZSwKLSAgICBJTiBQQllURSAgICAgICAgcGJ5RnJhbWUsCi0gICAgSU4gVUlOVCAgICAgICAgIEZyYW1lU2l6ZSwKLSAgICBJTiBQQllURSAgICAgICAgcGJ5UnNyLAotICAgIE9VVCBQQllURSAgICAgICBwYnlOZXdSc3IsCi0gICAgT1VUIFBTS2V5SXRlbSAgICpwS2V5T3V0LAorICAgICBQU0RldmljZSAgICAgcERldmljZSwKKyAgICAgUEJZVEUgICAgICAgIHBieUZyYW1lLAorICAgICB1bnNpZ25lZCBpbnQgICAgICAgICBGcmFtZVNpemUsCisgICAgIFBCWVRFICAgICAgICBwYnlSc3IsCisgICAgIFBCWVRFICAgICAgIHBieU5ld1JzciwKKyAgICAgUFNLZXlJdGVtICAgKiBwS2V5T3V0LAogICAgIGludCAqICAgICAgIHBiRXh0SVYsCi0gICAgT1VUIFBXT1JEICAgICAgIHB3UnhUU0MxNV8wLAotICAgIE9VVCBQRFdPUkQgICAgICBwZHdSeFRTQzQ3XzE2CisgICAgIFBXT1JEICAgICAgIHB3UnhUU0MxNV8wLAorICAgICBQRFdPUkQgICAgICBwZHdSeFRTQzQ3XzE2CiAgICAgKQogewotICAgIFVJTlQgICAgICAgICAgICBQYXlsb2FkTGVuID0gRnJhbWVTaXplOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgIFBheWxvYWRMZW4gPSBGcmFtZVNpemU7CiAgICAgUEJZVEUgICAgICAgICAgIHBieUlWOwogICAgIEJZVEUgICAgICAgICAgICBieUtleUlkeDsKICAgICBQU0tleUl0ZW0gICAgICAgcEtleSA9IE5VTEw7CkBAIC0xMjg1LDIwICsxMjk1LDIwIEBACiAKIAogc3RhdGljIEJPT0wgc19iSG9zdFdlcFJ4RW5jcnlwdGlvbiAoCi0gICAgSU4gUFNEZXZpY2UgICAgIHBEZXZpY2UsCi0gICAgSU4gUEJZVEUgICAgICAgIHBieUZyYW1lLAotICAgIElOIFVJTlQgICAgICAgICBGcmFtZVNpemUsCi0gICAgSU4gUEJZVEUgICAgICAgIHBieVJzciwKLSAgICBJTiBCT09MICAgICAgICAgYk9uRmx5LAotICAgIElOIFBTS2V5SXRlbSAgICBwS2V5LAotICAgIE9VVCBQQllURSAgICAgICBwYnlOZXdSc3IsCisgICAgIFBTRGV2aWNlICAgICBwRGV2aWNlLAorICAgICBQQllURSAgICAgICAgcGJ5RnJhbWUsCisgICAgIHVuc2lnbmVkIGludCAgICAgICAgIEZyYW1lU2l6ZSwKKyAgICAgUEJZVEUgICAgICAgIHBieVJzciwKKyAgICAgQk9PTCAgICAgICAgIGJPbkZseSwKKyAgICAgUFNLZXlJdGVtICAgIHBLZXksCisgICAgIFBCWVRFICAgICAgIHBieU5ld1JzciwKICAgICBpbnQgKiAgICAgICBwYkV4dElWLAotICAgIE9VVCBQV09SRCAgICAgICBwd1J4VFNDMTVfMCwKLSAgICBPVVQgUERXT1JEICAgICAgcGR3UnhUU0M0N18xNgorICAgICBQV09SRCAgICAgICBwd1J4VFNDMTVfMCwKKyAgICAgUERXT1JEICAgICAgcGR3UnhUU0M0N18xNgogICAgICkKIHsKICAgICBQU01nbXRPYmplY3QgICAgcE1nbXQgPSAmKHBEZXZpY2UtPnNNZ210T2JqKTsKLSAgICBVSU5UICAgICAgICAgICAgUGF5bG9hZExlbiA9IEZyYW1lU2l6ZTsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICBQYXlsb2FkTGVuID0gRnJhbWVTaXplOwogICAgIFBCWVRFICAgICAgICAgICBwYnlJVjsKICAgICBCWVRFICAgICAgICAgICAgYnlLZXlJZHg7CiAgICAgQllURSAgICAgICAgICAgIGJ5RGVjTW9kZSA9IEtFWV9DVExfV0VQOwpAQCAtMTQxNywxMiArMTQyNywxMiBAQAogCiAKIHN0YXRpYyBCT09MIHNfYkFQTW9kZVJ4RGF0YSAoCi0gICAgSU4gUFNEZXZpY2UgcERldmljZSwKLSAgICBJTiBzdHJ1Y3Qgc2tfYnVmZiogc2tiLAotICAgIElOIFVJTlQgICAgIEZyYW1lU2l6ZSwKLSAgICBJTiBVSU5UICAgICBjYkhlYWRlck9mZnNldCwKLSAgICBJTiBJTlQgICAgICBpU0FOb2RlSW5kZXgsCi0gICAgSU4gSU5UICAgICAgaURBTm9kZUluZGV4CisgICAgIFBTRGV2aWNlIHBEZXZpY2UsCisgICAgIHN0cnVjdCBza19idWZmICpza2IsCisgICAgIHVuc2lnbmVkIGludCAgICAgRnJhbWVTaXplLAorICAgICB1bnNpZ25lZCBpbnQgICAgIGNiSGVhZGVyT2Zmc2V0LAorICAgICBzaWduZWQgaW50ICAgICAgaVNBTm9kZUluZGV4LAorICAgICBzaWduZWQgaW50ICAgICAgaURBTm9kZUluZGV4CiAgICAgKQogCiB7CkBAIC0xNDkzLDcgKzE1MDMsOCBAQAogICAgICAgICAgICAgaURBTm9kZ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XS5iUnhQU1BvbGwgPSBGQUxTRTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYocE1nbXQtPmJ5RFRJTUNvdW50ID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gY2hlY2sgaWYgbXV0bHRjYXN0IHR4IGJ1ZmZlcnJpbmcKLSAgICAgICAgICAgICAgICAgICAgcE1nbXQtPmJ5RFRJTUNvdW50ID0gcE1nbXQtPmJ5RFRJTVBlcmlvZCAtIDE7Ci0gICAgICAgICAgICAgICAgICAgIHBNZ210LT5zTm9kZURCVGFibGVbMF0uYlJ4UFNQb2xsID0gVFJVRTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHBNZ210LT5zTm9kZURCVGFibGVbMF0uYlBTRW5hYmxlKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBiU2NoZWR1bGVDb21tYW5kKChIQU5ETEUpcERldmljZSwgV0xBTl9DTURfUlhfUFNQT0xMLCBOVUxMKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBiU2NoZWR1bGVDb21tYW5kKChIQU5ETEUpcERldmljZSwgV0xBTl9DTURfQkVDT05fU0VORCwgTlVMTCk7Ci0gICAgICAgICAgICB9IC8vIGlmIChwRGV2aWNlLT5lT1BNb2RlID09IE9QX01PREVfQVApCisJaWYgKHBJTlREYXRhLT5ieUlTUjEgIT0gMCkKKwkJaWYgKHBJTlREYXRhLT5ieUlTUjEgJiBJU1JfR1BJTzMpCisJCQliU2NoZWR1bGVDb21tYW5kKCh2b2lkICopIHBEZXZpY2UsCisJCQkJCVdMQU5fQ01EX1JBRElPLAorCQkJCQlOVUxMKTsKKwlwRGV2aWNlLT5pbnRCdWYudURhdGFMZW4gPSAwOworCXBEZXZpY2UtPmludEJ1Zi5iSW5Vc2UgPSBGQUxTRTsKIAotICAgICAgICAgICAgcERldmljZS0+YkJlYWNvblNlbnQgPSBUUlVFOwotICAgICAgICB9IGVsc2Ug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ICAgICAgICAgICAgd1R4RGF0YVJhdGU7Ci0gICAgVTE2ICAgICAgICAgICAgd0luQWN0aXZlQ291bnQ7Ci0gICAgVTE2ICAgICAgICAgICAgd0VuUXVldWVDbnQ7Ci0gICAgVTE2ICAgICAgICAgICAgd0ZsYWdzOworICAgIHUxNiAgICAgICAgICAgIHdBSUQ7CisgICAgdTggICAgICAgICAgICAgYWJ5TUFDQWRkcls2XTsKKyAgICB1MTYgICAgICAgICAgICB3VHhEYXRhUmF0ZTsKKyAgICB1MTYgICAgICAgICAgICB3SW5BY3RpdmVDb3VudDsKKyAgICB1MTYgICAgICAgICAgICB3RW5RdWV1ZUNudDsKKyAgICB1MTYgICAgICAgICAgICB3RmxhZ3M7CiAgICAgQk9PTCAgICAgICAgICAgYlBXQml0T247Ci0gICAgVTggICAgICAgICAgICAgYnlLZXlJbmRleDsKLSAgICBVMTYgICAgICAgICAgICB3V2VwS2V5TGVuZ3RoOwotICAgIFU4ICAgICAgICAgICAgYWJ5V2VwS2V5W1dFUF9LRVlNQVhMRU5dOworICAgIHU4ICAgICAgICAgICAgIGJ5S2V5SW5kZXg7CisgICAgdTE2ICAgICAgICAgICAgd1dlcEtleUxlbmd0aDsKKyAgICB1OCAgICAgICAgICAgIGFieVdlcEtleVtXRVBfS0VZTUFYTEVOXTsKICAgICAvLyBBdXRvIHJhdGUgZmFsbGJhY2sgdmFycwogICAgIEJPT0wgICAgICAgICAgIGJJc0luRmFsbGJhY2s7Ci0gICAgVTMyICAgICAgICAgICAgdVR4RmFpbHVyZXM7Ci0gICAgVTMyICAgICAgICAgICAgdVR4QXR0ZW1wdHM7Ci0gICAgVTE2ICAgICAgICAgICAgd0ZhaWx1cmVSYXRpbzsKKyAgICB1MzIgICAgICAgICAgICB1VHhGYWlsdXJlczsKKyAgICB1MzIgICAgICAgICAgICB1VHhBdHRlbXB0czsKKyAgICB1MTYgICAgICAgICAgICB3RmFpbHVyZVJhdGlvOwogCiB9IFNOb2RlSXRlbTsKIAogCi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clNvZnRJbnRlcnJ1cHQ7Ci0gICAgVTMyICAgZHdJc3JSeE5vQnVmOworICAgIHUzMiAgIGR3SXNyVHgwT0s7CisgICAgdTMyICAgZHdJc3JUeDFPSzsKKyAgICB1MzIgICBkd0lzckJlYWNvblR4T0s7CisgICAgdTMyICAgZHdJc3JSeE9LOworICAgIHUzMiAgIGR3SXNyVEJUVEludDsKKyAgICB1MzIgICBkd0lzclNUSU1FUkludDsKKyAgICB1MzIgICBkd0lzclVucmVjb3ZlcmFibGVFcnJvcjsKKyAgICB1MzIgICBkd0lzclNvZnRJbnRlcnJ1cHQ7CisgICAgdTMyICAgZHdJc3JSeE5vQnVmOwogICAgIC8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KIAotICAgIFUzMiAgIGR3SXNyVW5rbm93bjsgICAgICAgICAgICAgICAvLyB1bmtub3duIGludGVycnVwdCBjb3VudAorCXUzMiBkd0lzclVua25vd247IC8qIHVua25vd24gaW50ZXJydXB0IGNvdW50ICovCiAKICAgICAvLyBSU1Igc3RhdHVzIGNvdW50CiAgICAgLy8KLSAgICBVMzIgICBkd1JzckZybUFsZ25FcnI7Ci0gICAgVTMyICAgZHdSc3JFcnI7Ci0gICAgVTMyICAgZHdSc3JDUkNFcnI7Ci0gICAgVTMyICAgZHdSc3JDUkNPazsKLSAgICBVMzIgICBkd1JzckJTU0lET2s7Ci0gICAgVTMyICAgZHdSc3JBRERST2s7Ci0gICAgVTMyICAgZHdSc3JJQ1ZPazsKLSAgICBVMzIgICBkd05ld1JzclNob3J0UHJlYW1ibGU7Ci0gICAgVTMyICAgZHdSc3JMb25nOwotICAgIFUzMiAgIGR3UnNyUnVudDsKKyAgICB1MzIgICBkd1JzckZybUFsZ25FcnI7CisgICAgdTMyICAgZHdSc3JFcnI7CisgICAgdTMyICAgZHdSc3JDUkNFcnI7CisgICAgdTMyICAgZHdSc3JDUkNPazsKKyAgICB1MzIgICBkd1JzckJTU0lET2s7CisgICAg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BQU0JTU0lETGlzdCAgICAgICAgIHBMaXN0OwogICAgIFBTTm9kZUxpc3QgICAgICAgICAgcE5vZGVMaXN0OwotICAgIFVJTlQgICAgICAgICAgICAgICAgY2JMaXN0Q291bnQ7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgIGNiTGlzdENvdW50OwogICAgIFBLbm93bkJTUyAgICAgICAgICAgcEJTUzsKICAgICBQS25vd25Ob2RlREIgICAgICAgIHBOb2RlOwotICAgIFVJTlQgICAgICAgICAgICAgICAgaWksIGpqOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgICAgICBpaSwgamo7CiAgICAgU0NtZExpbmtTdGF0dXMgICAgICBzTGlua1N0YXR1czsKICAgICBCWVRFICAgICAgICAgICAgICAgIGFieVN1cHBSYXRlc1tdID0ge1dMQU5fRUlEX1NVUFBfUkFURVMsIDQsIDB4MDIsIDB4MDQsIDB4MEIsIDB4MTZ9OwogICAgIEJZVEUgICAgICAgICAgICAgICAgYWJ5TnVsbEFkZHJbXSA9IHsweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwfTsKICAgICBEV09SRCAgICAgICAgICAgICAgIGR3S2V5SW5kZXg9IDA7CiAgICAgQllURSAgICAgICAgICAgICAgICBhYnlTY2FuU1NJRFtXTEFOX0lFSERSX0xFTiArIFdMQU5fU1NJRF9NQVhMRU4gKyAxXTsKLSAgICBMT05HICAgICAgICAgICAgICAgIGxkQm07CisgICAgc2lnbmVkIGxvbmcgICAgICAgICAgICAgICAgbGRCbTsKIAogICAgIHBSZXEtPndSZXN1bHQgPSAwOwogCkBAIC0xMDAsMTYgKzEwMCwyMSBAQAogICAgICAgICAgICAgbWVtY3B5KGFieVNjYW5TU0lELCBwSXRlbVNTSUQsIHBJdGVtU1NJRC0+bGVuICsgV0xBTl9JRUhEUl9MRU4pOwogICAgICAgICB9CiAgICAgICAgIHNwaW5fbG9ja19pcnEoJnBEZXZpY2UtPmxvY2spOwotICAgICAgICBpZiAobW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ICAgICAgICAgICAgdGhlbiBpZ25vcmUsYmVjYXVzZSB5b3UgZG9uJ3Qga25vd24gd2hpY2ggb25lIHRvIGJlIGNvbm5lY3Qgd2l0aD8/CiAgICAgICAgCXsKLSAgICAgICAgICAgVUlOVCAgICAgICAgICAgIGlpICwgdVNhbWVCc3NpZE51bT0wOworCQl1bnNpZ25lZCBpbnQgaWksIHVTYW1lQnNzaWROdW0gPSAwOwogICAgICAgICAgICAgICAgICAgZm9yIChpaSA9IDA7IGlpIDwgTUFYX0JTU19OVU07IGlpKyspIHsKICAgICAgICAgICAgICAgICAgICAgIGlmIChwTWdtdC0+c0JTU0xpc3RbaWldLmJBY3RpdmUgJiYKICAgICAgICAgICAgICAgICAgICAgICAgIElTX0VUSF9BRERSRVNTX0VRVUFMKHBNZ210LT5zQlNTTGlzdFtpaV0uYWJ5QlNTSUQscE1nbXQtPmFieURlc2lyZUJTU0lEKSkgewpAQCAtOTM0LDkgKzkzMyw4IEBACiAgICAgICAgIHsKICAgICAgICAgICAgUEtub3duQlNTICAgICAgIHBDdXJyID0gTlVMTDsKICAgICAgICAgICAgQllURSAgICAgICAgICAgICAgICAgICBhYnlUbXBEZXNpcmVTU0lEW1dMQU5fSUVIRFJfTEVOICsgV0xBTl9TU0lEX01BWExFTiArIDFdOwotCSAgVUlOVCAgICAgICAgICAgIGlpICwgdVNhbWVCc3NpZE51bT0wOworCSAgdW5zaWduZWQgaW50IGlpLCB1U2FtZUJzc2lkTnVtID0gMDsKIAotCSAgbWVtc2V0KGFieVRtcERlc2lyZVNTSUQsMCxzaXplb2YoYWJ5VG1wRGVzaXJlU1NJRCkpOwogCSAgbWVtY3B5KGFieVRtcERlc2lyZVNTSUQscE1nbXQtPmFieURlc2lyZVNTSUQsc2l6ZW9mKGFieVRtcERlc2lyZVNTSUQpKTsKICAgICAgICAgICAgIHBDdXJyID0gQlNTcFNlYXJjaEJTU0xpc3QocERldmljZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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WVudCBwVGFibGUsIFBCWVRFIHBieUJTU0lELCBEV09SRCBkd0tleUluZGV4LAorCQlQU0tleUl0ZW0gKnBLZXkpCiB7CiAgICAgaW50IGk7CiAKQEAgLTIyMCwxMiArMjE4LDEyIEBACiAgKiBSZXR1cm4gVmFsdWU6IFRSVUUgaWYgc3VjY2VzcyBvdGhlcndpc2UgRkFMU0UKICAqCiAgKi8KLUJPT0wgS2V5YlNldEtleSAoCi0gICAgUFZPSUQgICAgICAgICAgIHBEZXZpY2VIYW5kbGVyLAorQk9PTCBLZXliU2V0S2V5KAorICAgIHZvaWQgKnBEZXZpY2VIYW5kbGVyLAogICAgIFBTS2V5TWFuYWdlbWVudCBwVGFibGUsCiAgICAgUEJZVEUgICAgICAgICAgIHBieUJTU0lELAogICAgIERXT1JEICAgICAgICAgICBkd0tleUluZGV4LAotICAgIFVMT05HICAgICAgICAgICB1S2V5TGVuZ3RoLAorICAgIHVuc2lnbmVkIGxvbmcgICAgICAgICAgIHVLZXlMZW5ndGgsCiAgICAgUFFXT1JEICAgICAgICAgIHBLZXlSU0MsCiAgICAgUEJZVEUgICAgICAgICAgIHBieUtleSwKICAgICBCWVRFICAgICAgICAgICAgYnlLZXlEZWNNb2RlCkBAIC0yMzMsOSArMjMxLDkgQEAKIHsKICAgICBQU0RldmljZSAgICBwRGV2aWNlID0gKFBTRGV2aWNlKSBwRGV2aWNlSGFuZGxlcjsKICAgICBpbnQgICAgICAgICBpLGo7Ci0gICAgVUlOVCAgICAgICAgaWk7CisgICAgdW5zaWduZWQgaW50ICAgICAgICBpaTsKICAgICBQU0tleUl0ZW0gICBwS2V5OwotICAgIFVJTlQgICAgICAgIHVLZXlJZHg7CisgICAgdW5zaWduZWQgaW50ICAgICAgICB1S2V5SWR4OwogCiAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyJFbnRlciBLZXliU2V0S2V5OiAlbFhcbiIsIGR3S2V5SW5kZXgpOwogCkBAIC0zMTIsNyArMzEwLDcgQEAKICAgICAgICAgfQogICAgIH0KICAgICBpZiAoaiA8IChNQVhfS0VZX1RBQkxFLTEpKSB7Ci0gICAgICAgIG1lbWNweShwVGFibGUtPktleVRhYmxlW2pdLmFieUJTU0lELHBieUJTU0lELFVfRVRIRVJfQUREUl9MRU4pOworCW1lbWNweShwVGFibGUtPktleVRhYmxlW2pdLmFieUJTU0lELCBwYnlCU1NJRCwgRVRIX0FMRU4pOwogICAgICAgICBwVGFibGUtPktleVRhYmxlW2pdLmJJblVzZSA9IFRSVUU7CiAgICAgICAgIGlmICgoZHdLZXlJbmRleCAmIFBBSVJXSVNFX0tFWSkgIT0gMCkgIHsKICAgICAgICAgICAgIC8vIFBhaXJ3aXNlIGtleQpAQCAtMzkzLDggKzM5MSw4IEBACiAgKiBSZXR1cm4gVmFsdWU6IFRSVUUgaWYgc3VjY2VzcyBvdGhlcndpc2UgRkFMU0UKICAqCiAgKi8KLUJPT0wgS2V5YlJlbW92ZUtleSAoCi0gICAgUFZPSUQgICAgICAgICAgIHBEZXZpY2VIYW5kbGVyLAorQk9PTCBLZXliUmVtb3ZlS2V5KAorICAgIHZvaWQgKnBEZXZpY2VIYW5kbGVyLAogICAgIFBTS2V5TWFuYWdlbWVudCBwVGFibGUsCiAgICAgUEJZVEUgICAgICAgICAgIHBieUJTU0lELAogICAgIERXT1JEICAgICAgICAgICBkd0tleUluZGV4CkBAIC00NzQsOCArNDcyLDggQEAKICAqIFJldHVybiBWYWx1ZTogVFJVRSBpZiBzdWNjZXNzIG90aGVyd2lzZSBGQUxTRQogICoKICAqLwotQk9PTCBLZXliUmVtb3ZlQWxsS2V5ICgKLSAgICBQVk9JRCAgICAgICAgICAgcERldmljZUhhbmRsZXIsCitCT09MIEtleWJSZW1vdmVBbGxLZXkoCisgICAgdm9pZCAqcERldmljZUhhbmRsZXIsCiAgICAgUFNLZXlNYW5hZ2VtZW50IHBUYWJsZSwKICAgICBQQllURSAgICAgICAgICAgcGJ5QlNTSUQKICAgICApCkBAIC01MTAsOCArNTA4LDggQEAKICAqIFJldHVybiBWYWx1ZTogVFJVRSBpZiBzdWNjZXNzIG90aGVyd2lzZSBGQUxTRQogICoKICAqLwotVk9JRCBLZXl2UmVtb3ZlV0VQS2V5ICgKLSAgICBQVk9JRCAgICAgICAgICAgcERldmljZUhhbmRsZXIsCit2b2lkIEtleXZSZW1vdmVXRVBLZXkoCisgICAgdm9pZCAqcERldmljZUhhbmRsZXIsCiAgICAgUFNLZXlNYW5hZ2VtZW50IHBUYWJsZSwKICAgICBEV09SRCAgICAgICAgICAgZHdLZXlJbmRleAogICAgICkKQEAgLTUzMyw4ICs1MzEsOCBAQAogICAgIHJldHVybjsKIH0KIAotVk9JRCBLZXl2UmVtb3ZlQWxsV0VQS2V5ICgKLSAgICBQVk9JRCAgICAgICAgICAgcERldmljZUhhbmRsZXIsCit2b2lkIEtleXZSZW1vdmVBbGxXRVBLZXkoCisgICAgdm9pZCAqcERldmljZUhhbmRsZXIsCiAgICAgUFNLZXlNYW5hZ2VtZW50IHBUYWJsZQogICAgICkKIHsKQEAgLTU2MSwxMiArNTU5LDggQEAKICAqIFJldHVybiBWYWx1ZTogVFJVRSBpZiBmb3VuZCBvdGhlcndpc2UgRkFMU0UKICAqCiAgKi8KLUJPT0wgS2V5YkdldFRyYW5zbWl0S2V5ICgKLSAgICBJTiAgUFNLZXlNYW5hZ2VtZW50IHBUYWJsZSwKLSAgICBJTiAgUEJZVEUgICAgICAgICAgIHBieUJTU0lELAotICAgIElOICBEV09SRCAgICAgICAgICAgZHdLZXlUeXBlLAotICAgIE9VVCBQU0tleUl0ZW0gICAgICAgKnBLZXkKLSAgICApCitCT09MIEtleWJHZXRUcmFuc21pdEtleShQU0tleU1hbmFnZW1lbnQgcFRhYmxlLCBQQllURSBwYnlCU1NJRCwgRFdPUkQgZHdLZXlUeXBlLAorCQkJUFNLZXlJdGVtICpwS2V5KQogewogICAgIGludCBpLCBpaTsKIApAQCAtNjQxLDEwICs2MzUsNyBAQAogICogUmV0dXJuIFZhbHVlOiBUUlVFIGlmIGZvdW5kIG90aGVyd2lzZSBGQUxTRQogICoKICAqLwotQk9PTCBLZXliQ2hlY2tQYWlyZXdpc2VLZXkgKAotICAgIElOICBQU0tleU1hbmFnZW1lbnQgcFRhYmxlLAotICAgIE9VVCBQU0tleUl0ZW0gICAgICAgKnBLZXkKLSAgICApCitCT09MIEtleWJDaGVja1BhaXJld2lzZUtleShQU0tleU1hbmFnZW1lbnQgcFRhYmxlLCBQU0tleUl0ZW0gKnBLZXkpCiB7CiAgICAgaW50IGk7CiAKQEAgLTY3NSwyMyArNjY2LDIzIEBACiAgKiBSZXR1cm4gVmFsdWU6IFRSVUUgaWYgc3VjY2VzcyBvdGhlcndpc2UgRkFMU0UKICAqCiAgKi8KLUJPT0wgS2V5YlNldERlZmF1bHRLZXkgKAotICAgIFBWT0lEICAgICAgICAgICBwRGV2aWNlSGFuZGxlciwKK0JPT0wgS2V5YlNldERlZmF1bHRLZXkoCisgICAgdm9pZCAqcERldmljZUhhbmRsZXIsCiAgICAgUFNLZXlNYW5hZ2VtZW50IHBUYWJsZSwKICAgICBEV09SRCAgICAgICAgICAgZHdLZXlJbmRleCwKLSAgICBVTE9ORyAgICAgICAgICAgdUtleUxlbmd0aCwKKyAgICB1bnNpZ25lZCBsb25nICAgICAgICAgICB1S2V5TGVuZ3RoLAogICAgIFBRV09SRCAgICAgICAgICBwS2V5UlNDLAogICAgIFBCWVRFICAgICAgICAgICBwYnlLZXksCiAgICAgQllURSAgICAgICAgICAgIGJ5S2V5RGVjTW9kZQogICAgICkKIHsKICAgICBQU0RldmljZSAgICBwRGV2aWNlID0gKFBTRGV2aWNlKSBwRGV2aWNlSGFuZGxlcjsKLSAgICBVSU5UICAgICAgICBpaTsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgIGlpOwogICAgIFBTS2V5SXRlbSAgIHBLZXk7Ci0gICAgVUlOVCAgICAgICAgdUtleUlkeDsKKyAgICB1bnNpZ25lZCBp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YW5hZ2VtZW50IHBUYWJsZSwKLSAgICBJTiAgUEJZVEUgICAgICAgICAgIHBieUJTU0lELAotICAgIElOICBEV09SRCAgICAgICAgICAgZHdLZXlJbmRleCwKLSAgICBPVVQgUFNLZXlJdGVtICAgICAgICpwS2V5Ci0gICAgKTsKK0JPT0wgS2V5YkdldEtleShQU0tleU1hbmFnZW1lbnQgcFRhYmxlLCBQQllURSBwYnlCU1NJRCwgRFdPUkQgZHdLZXlJbmRleCwKKwkJUFNLZXlJdGVtICpwS2V5KTsKIAogQk9PTCBLZXliU2V0S2V5KAotICAgIFBWT0lEICAgICAgICAgICBwRGV2aWNlSGFuZGxlciwKKyAgICB2b2lkICpwRGV2aWNlSGFuZGxlciwKICAgICBQU0tleU1hbmFnZW1lbnQgcFRhYmxlLAogICAgIFBCWVRFICAgICAgICAgICBwYnlCU1NJRCwKICAgICBEV09SRCAgICAgICAgICAgZHdLZXlJbmRleCwKLSAgICBVTE9ORyAgICAgICAgICAgdUtleUxlbmd0aCwKKyAgICB1bnNpZ25lZCBsb25nICAgICAgICAgICB1S2V5TGVuZ3RoLAogICAgIFBRV09SRCAgICAgICAgICBwS2V5UlNDLAogICAgIFBCWVRFICAgICAgICAgICBwYnlLZXksCiAgICAgQllURSAgICAgICAgICAgIGJ5S2V5RGVjTW9kZQogICAgICk7CiAKIEJPT0wgS2V5YlJlbW92ZUtleSgKLSAgICBQVk9JRCAgICAgICAgICAgcERldmljZUhhbmRsZXIsCisgICAgdm9pZCAqcERldmljZUhhbmRsZXIsCiAgICAgUFNLZXlNYW5hZ2VtZW50IHBUYWJsZSwKICAgICBQQllURSAgICAgICAgICAgcGJ5QlNTSUQsCiAgICAgRFdPUkQgICAgICAgICAgIGR3S2V5SW5kZXgKICAgICApOwogCi1CT09MIEtleWJSZW1vdmVBbGxLZXkgKAotICAgIFBWT0lEICAgICAgICAgICBwRGV2aWNlSGFuZGxlciwKK0JPT0wgS2V5YlJlbW92ZUFsbEtleSgKKyAgICB2b2lkICpwRGV2aWNlSGFuZGxlciwKICAgICBQU0tleU1hbmFnZW1lbnQgcFRhYmxlLAogICAgIFBCWVRFICAgICAgICAgICBwYnlCU1NJRAogICAgICk7CiAKLVZPSUQgS2V5dlJlbW92ZVdFUEtleSgKLSAgICBQVk9JRCAgICAgICAgICAgcERldmljZUhhbmRsZXIsCit2b2lkIEtleXZSZW1vdmVXRVBLZXkoCisgICAgdm9pZCAqcERldmljZUhhbmRsZXIsCiAgICAgUFNLZXlNYW5hZ2VtZW50IHBUYWJsZSwKICAgICBEV09SRCAgICAgICAgICAgZHdLZXlJbmRleAogICAgICk7CiAKLVZPSUQgS2V5dlJlbW92ZUFsbFdFUEtleSgKLSAgICBQVk9JRCAgICAgICAgICAgcERldmljZUhhbmRsZXIsCit2b2lkIEtleXZSZW1vdmVBbGxXRVBLZXkoCisgICAgdm9pZCAqcERldmljZUhhbmRsZXIsCiAgICAgUFNLZXlNYW5hZ2VtZW50IHBUYWJsZQogICAgICk7CiAKLUJPT0wgS2V5YkdldFRyYW5zbWl0S2V5KAotICAgIElOICBQU0tleU1hbmFnZW1lbnQgcFRhYmxlLAotICAgIElOICBQQllURSAgICAgICAgICAgcGJ5QlNTSUQsCi0gICAgSU4gIERXT1JEICAgICAgICAgICBkd0tleVR5cGUsCi0gICAgT1VUIFBTS2V5SXRlbSAgICAgICAqcEtleQotICAgICk7CitCT09MIEtleWJHZXRUcmFuc21pdEtleShQU0tleU1hbmFnZW1lbnQgcFRhYmxlLAlQQllURSBwYnlCU1NJRCwJRFdPUkQgZHdLZXlUeXBlLAorCQkJUFNLZXlJdGVtICpwS2V5KTsKIAotQk9PTCBLZXliQ2hlY2tQYWlyZXdpc2VLZXkoCi0gICAgSU4gIFBTS2V5TWFuYWdlbWVudCBwVGFibGUsCi0gICAgT1VUIFBTS2V5SXRlbSAgICAgICAqcEtleQotICAgICk7CitCT09MIEtleWJDaGVja1BhaXJld2lzZUtleShQU0tleU1hbmFnZW1lbnQgcFRhYmxlLCBQU0tleUl0ZW0gKnBLZXkpOwogCi1CT09MIEtleWJTZXREZWZhdWx0S2V5ICgKLSAgICBQVk9JRCAgICAgICAgICAgcERldmljZUhhbmRsZXIsCitCT09MIEtleWJTZXREZWZhdWx0S2V5KAorICAgIHZvaWQgKnBEZXZpY2VIYW5kbGVyLAogICAgIFBTS2V5TWFuYWdlbWVudCBwVGFibGUsCiAgICAgRFdPUkQgICAgICAgICAgIGR3S2V5SW5kZXgsCi0gICAgVUxPTkcgICAgICAgICAgIHVLZXlMZW5ndGgsCisgICAgdW5zaWduZWQgbG9uZyAgICAgICAgICAgdUtleUxlbmd0aCwKICAgICBQUVdPUkQgICAgICAgICAgcEtleVJTQywKICAgICBQQllURSAgICAgICAgICAgcGJ5S2V5LAogICAgIEJZVEUgICAgICAgICAgICBieUtleURlY01vZGUKICAgICApOwogCi1CT09MIEtleWJTZXRBbGxHcm91cEtleSAoCi0gICAgUFZPSUQgICAgICAgICAgIHBEZXZpY2VIYW5kbGVyLAorQk9PTCBLZXliU2V0QWxsR3JvdXBLZXkoCisgICAgdm9pZCAqcERldmljZUhhbmRsZXIsCiAgICAgUFNLZXlNYW5hZ2VtZW50IHBUYWJsZSwKICAgICBEV09SRCAgICAgICAgICAgZHdLZXlJbmRleCwKLSAgICBVTE9ORyAgICAgICAgICAgdUtleUxlbmd0aCwKKyAgICB1bnNpZ25lZCBsb25nICAgICAgICAgICB1S2V5TGVuZ3RoLAogICAgIFBRV09SRCAgICAgICAgICBwS2V5UlNDLAogICAgIFBCWVRFICAgICAgICAgICBwYnlLZXksCiAgICAgQllURSAgICAgICAgICAgIGJ5S2V5RGVjTW9kZQogICAgICk7CiAKLSNlbmRpZiAvLyBfX0tFWV9IX18KLQorI2VuZGlmIC8qIF9fS0VZX0hfXyAqLwpkaWZmIC0tZ2l0IGEvZHJpdmVycy9zdGFnaW5nL3Z0NjY1Ni9tYWMuYyBiL2RyaXZlcnMvc3RhZ2luZy92dDY2NTYvbWFjLmMKaW5kZXggNTVhN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iAgICAgZWxzZSB7Ci0gICAgCURCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8iVW5rbm93bjogVG90YWxbJWRdLCBDUkNPS1slZF1cbiIsIChJTlQpcFN0YXRpc3RpYy0+ZHdSc3JSeFBhY2tldCsxLCAoSU5UKXBTdGF0aXN0aWMtPmR3UnNyQ1JDT2spOworCSAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywKKwkJICAgIEtFUk5fSU5GTyAiVW5rbm93bjogVG90YWxbJWRdLCBDUkNPS1slZF1cbiIsCisJCSAgICAoc2lnbmVkIGludCkgcFN0YXRpc3RpYy0+ZHdSc3JSeFBhY2tldCsxLAorCQkgICAgKHNpZ25lZCBpbnQpcFN0YXRpc3RpYy0+ZHdSc3JDUkNPayk7CiAgICAgfQogCiAgICAgaWYgKGJ5UlNSICYgUlNSX0JTU0lET0spCkBAIC0zNzAsNyArNDAwLDcgQEAKICAgICBCWVRFICAgICAgICAgICAgYnlSeFN0cywKICAgICBCWVRFICAgICAgICAgICAgYnlSeFJhdGUsCiAgICAgUEJZVEUgICAgICAgICAgIHBieUJ1ZmZlciwKLSAgICBVSU5UICAgICAgICAgICAgY2JGcmFtZUxlbmd0aAorICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgIGNiRnJhbWVMZW5ndGgKICAgICApCiB7CiAgICAgU1RBdlVwZGF0ZVJEU3RhdENvdW50ZXIoCkBAIC01MTAsMTkgKzU0MCwyMiBAQAogICAgICkKIHsKICAgICAvL3A4MDJfMTFDb3VudGVyLT5UcmFuc21pdHRlZEZyYWdtZW50Q291bnQKLSAgICBwODAyXzExQ291bnRlci0+TXVsdGljYXN0VHJhbnNtaXR0ZWRGcmFtZUNvdW50ID0gKFVMT05HTE9ORykgKHBTdGF0aXN0aWMtPmR3VHNyQnJvYWRjYXN0ICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTdGF0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FDb3VudGVyczsKIAogCkBAIC04NSwxNSArODcsMTUgQEAKIC8vIE1JQjIgY291bnRlcgogLy8KIHR5cGVkZWYgc3RydWN0IHRhZ1NNaWIyQ291bnRlciB7Ci0gICAgTE9ORyAgICBpZkluZGV4OworICAgIHNpZ25lZCBsb25nICAgIGlmSW5kZXg7CiAgICAgY2hhciAgICBpZkRlc2NyWzI1Nl07ICAgICAgICAgICAgICAgLy8gbWF4IHNpemUgMjU1IHBsdXMgemVybyBlbmRpbmcKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBlLmcuICJpbnRlcmZhY2UgMSIKLSAgICBMT05HICAgIGlmVHlwZTsKLSAgICBMT05HICAgIGlmTXR1OworICAgIHNpZ25lZCBsb25nICAgIGlmVHlwZTsKKyAgICBzaWduZWQgbG9uZyAgICBpZk10dTsKICAgICBEV09SRCAgIGlmU3BlZWQ7Ci0gICAgQllURSAgICBpZlBoeXNBZGRyZXNzW1VfRVRIRVJfQUREUl9MRU5dOwotICAgIExPTkcgICAgaWZBZG1pblN0YXR1czsKLSAgICBMT05HICAgIGlmT3BlclN0YXR1czsKKyAgICBCWVRFICAgIGlmUGh5c0FkZHJlc3NbRVRIX0FMRU5dOworICAgIHNpZ25lZCBsb25nICAgIGlmQWRtaW5TdGF0dXM7CisgICAgc2lnbmVkIGxvbmcgICAgaWZPcGVyU3RhdHVzOwogICAgIERXT1JEICAgaWZMYXN0Q2hhbmdlOwogICAgIERXT1JEICAgaWZJbk9jdGV0czsKICAgICBEV09SRCAgIGlmSW5VY2FzdFBrdHM7CkBAIC0xMjQsNyArMTI2LDcgQEAKIC8vIFJNT04gY291bnRlcgogLy8KIHR5cGVkZWYgc3RydWN0IHRhZ1NSbW9uQ291bnRlciB7Ci0gICAgTE9ORyAgICBldGhlclN0YXRzSW5kZXg7CisgICAgc2lnbmVkIGxvbmcgICAgZXRoZXJTdGF0c0luZGV4OwogICAgIERXT1JEICAgZXRoZXJTdGF0c0RhdGFT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N0ICAgIHBNZ210ID0gJihwRGV2aWNlLT5zTWdtdE9iaik7CkBAIC0yNDgsOCArMjI2LDYgQEAKICAgICByZXR1cm4gVFJVRTsKIH0KIAotCi0KIC8qKwogICoKICAqIFJvdXRpbmUgRGVzY3JpcHRpb246CkBAIC0yNjAsMTIgKzIzNiw3IEBACiAgKgogLSovCiAKLQotCi1WT0lECi1QU3ZTZW5kUFNQT0xMKAotICAgIElOIEhBTkRMRSBoRGV2aWNlQ29udGV4dAotICAgICkKK3ZvaWQgUFN2U2VuZFBTUE9MTCh2b2lkICpoRGV2aWNlQ29udGV4dCkKIHsKICAgICBQU0RldmljZSAgICAgICAgICAgIHBEZXZpY2UgPSAoUFNEZXZpY2UpaERldmljZUNvbnRleHQ7CiAgICAgUFNNZ210T2JqZWN0ICAgICAgICBwTWdtdCA9ICYocERldmljZS0+c01nbXRPYmopOwpAQCAtMjk3LDggKzI2OCw2IEBACiAgICAgcmV0dXJuOwogfQogCi0KLQogLyorCiAgKgogICogUm91dGluZSBEZXNjcmlwdGlvbjoKQEAgLTMwOCwxMCArMjc3LDggQEAKICAqICAgIE5vbmUuCiAgKgogLSovCi1CT09MCi1QU2JTZW5kTnVsbFBhY2tldCgKLSAgICBJTiBIQU5ETEUgaERldmljZUNvbnRleHQKLSAgICApCisKK0JPT0wgUFNiU2VuZE51bGxQYWNrZXQodm9pZCAqaERldmljZUNvbnRleHQpCiB7CiAgICAgUFNEZXZpY2UgICAgICAgICAgICBwRGV2aWNlID0gKFBTRGV2aWNlKWhEZXZpY2VDb250ZXh0OwogICAgIFBTVHhNZ210UGFja2V0ICAgICAgcFR4UGFja2V0ID0gTlVMTDsKQEAgLTM4OCwxMCArMzU1LDcgQEAKICAqCiAtKi8KIAotQk9PTAotUFNiSXNOZXh0VEJUVFdha2VVcCgKLSAgICBJTiBIQU5ETEUgaERldmljZUNvbnRleHQKLSAgICApCitCT09MIFBTYklzTmV4dFRCVFRXYWtlVXAodm9pZCAqaERldmljZUNvbnRleH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NJLAorICAgICAgUFNEZXZpY2UgcERldmljZSwKKyAgICAgIEJZVEUgICAgIGJ5Q3VyclJTU0ksCiAgICAgbG9uZyAqICAgIHBsZEJtCiAgICAgKQogewogICAgIEJZVEUgYnlJZHggPSAoKChieUN1cnJSU1NJICYgMHhDMCkgPj4gNikgJiAweDAzKTsKLSAgICBMT05HIGIgPSAoYnlDdXJyUlNTSSAmIDB4M0YpOwotICAgIExPTkcgYSA9IDA7CisgICAgc2lnbmVkIGxvbmcgYiA9IChieUN1cnJSU1NJICYgMHgzRik7CisgICAgc2lnbmVkIGxvbmcgYSA9IDA7CiAgICAgQllURSBhYnlBSVJPSEFSRls0XSA9IHswLCAxOCwgMCwgNDB9OwogCiAgICAgc3dpdGNoIChwRGV2aWNlLT5ieVJGVHlwZSkgewpAQCAtOTg0LDkgKzk4NCw5IEBACiAKIAogCi1WT0lECit2b2lkCiBSRmJSRlRhYmxlRG93bmxvYWQgKAotICAgIElOICBQU0RldmljZSBwRGV2aWNlCisgICAgICBQU0RldmljZSBwRGV2aWNlCiAgICAgKQogewogV09SRCAgICB3TGVuZ3RoMSA9IDAsd0xlbmd0aDIgPSAwICx3TGVuZ3RoMyA9IDA7CkBAIC0xMTMzLDkgKzExMzMsOSBAQAogCiAvLyBSb2JlcnRZdToyMDA2MDQxMiwgVFdJRjEuMTEgYWRqdXN0IExPIEN1cnJlbnQgZm9yIDExYiBtb2RlCiBCT09MIHNfYlZUMzIyNkQwXzExYkxvQ3VycmVudEFkanVzdCgKLSAgICBJTiAgUFNEZXZpY2UgICAgcERldmljZSwKLSAgICBJTiAgQllURSAgICAgICAgYnlDaGFubmVsLAotICAgIElOICBCT09MICAgICAgICBiMTFiTW9kZSApCisgICAgICBQU0RldmljZSAgICBwRGV2aWNlLAorICAgICAgQllURSAgICAgICAgYnlDaGFubmVsLAorICAgICAgQk9PTCAgICAgICAgYjExYk1vZGUpCiB7CiAgICAgQk9PTCAgICBiUmVzdWx0OwogCmRpZmYgLS1naXQgYS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gICAgICAgICAgIHVETUFJZHgsCi0gICAgSU4gUFNFdGhlcm5ldEhlYWRlciBwc0V0aEhlYWRlcgorICAgICBQU0RldmljZSAgICAgICAgIHBEZXZpY2UsCisgICAgIEJZVEUgICAgICAgICAgICAgYnlQa3RUeXBlLAorICAgICBXT1JEICAgICAgICAgICAgIHdDdXJyZW50UmF0ZSwKKyAgICAgdm9pZCAqcFR4QnVmSGVhZCwKKyAgICAgdm9pZCAqcHZScnZUaW1lLAorICAgICB2b2lkICpwdlJUUywKKyAgICAgdm9pZCAqcHZDVFMsCisgICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgICBjYkZyYW1lU2l6ZSwKKyAgICAgQk9PTCAgICAgICAgICAgICBiTmVlZEFDSywKKyAgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgIHVETUFJZHgsCisgICAgIFBTRXRoZXJuZXRIZWFkZXIgcHNFdGhIZWFkZXIKICAgICApOwogCiAKLXN0YXRpYwotVUlOVAotc191RmlsbERhdGFIZWFkICgKLSAgICBJTiBQU0RldmljZSBwRGV2aWNlLAotICAgIElOIEJZVEUgICAgIGJ5UGt0VHlwZSwKLSAgICBJTiBXT1JEICAgICB3Q3VycmVudFJhdGUsCi0gICAgSU4gUFZPSUQgICAgcFR4RGF0YUhlYWQsCi0gICAgSU4gVUlOVCAgICAgY2JGcmFtZUxlbmd0aCwKLSAgICBJTiBVSU5UICAgICB1RE1BSWR4LAotICAgIElOIEJPT0wgICAgIGJOZWVkQWNrLAotICAgIElOIFVJTlQgICAgIHVGcmFnSWR4LAotICAgIElOIFVJTlQgICAgIGNiTGFzdEZyYWdtZW50U2l6ZSwKLSAgICBJTiBVSU5UICAgICB1TUFDZnJhZ051bSwKLSAgICBJTiBCWVRFICAgICBieUZCT3B0aW9uCitzdGF0aWMgdW5zaWduZWQgaW50IHNfdUZpbGxEYXRhSGVhZCgKKyAgICAgUFNEZXZpY2UgcERldmljZSwKKyAgICAgQllURSAgICAgYnlQa3RUeXBlLAorICAgICBXT1JEICAgICB3Q3VycmVudFJhdGUsCisgICAgIHZvaWQgKnBUeERhdGFIZWFkLAorICAgICB1bnNpZ25lZCBpbnQgICAgIGNiRnJhbWVMZW5ndGgsCisgICAgIHVuc2lnbmVkIGludCAgICAgdURNQUlkeCwKKyAgICAgQk9PTCAgICAgYk5lZWRBY2ssCisgICAgIHVuc2lnbmVkIGludCAgICAgdUZyYWdJZHgsCisgICAgIHVuc2lnbmVkIGludCAgICAgY2JMYXN0RnJhZ21lbnRTaXplLAorICAgICB1bnNpZ25lZCBpbnQgICAgIHVNQUNmcmFnTnVtLAorICAgICBCWVRFICAgICBieUZCT3B0aW9uCiAgICAgKTsKIAogCiAKIAogc3RhdGljCi1WT0lECit2b2lkCiBzX3ZHZW5lcmF0ZU1BQ0hlYWRlciAoCi0gICAgSU4gUFNEZXZpY2UgICAgICAgICBwRGV2aWNlLAotICAgIElOIFBCWVRFICAgICAgICAgICAgcGJ5QnVmZmVyQWRkciwKLSAgICBJTiBXT1JEICAgICAgICAgICAgIHdEdXJhdGlvbiwKLSAgICBJTiBQU0V0aGVybmV0SGVhZGVyIHBzRXRoSGVhZGVyLAotICAgIElOIEJPT0wgICAgICAgICAgICAgYk5lZWRFbmNyeXB0LAotICAgIElOIFdPUkQgICAgICAgICAgICAgd0ZyYWdUeXBlLAotICAgIElOIFVJTlQgICAgICAgICAgICAgdURNQUlkeCwKLSAgICBJTiBVSU5UICAgICAgICAgICAgIHVGcmFnSWR4CisgICAgIFBTRGV2aWNlICAgICAgICAgcERldmljZSwKKyAgICAgUEJZVEUgICAgICAgICAgICBwYnlCdWZmZXJBZGRyLAorICAgICBXT1JEICAgICAgICAgICAgIHdEdXJhdGlvbiwKKyAgICAgUFNFdGhlcm5ldEhlYWRlciBwc0V0aEhlYWRlciwKKyAgICAgQk9PTCAgICAgICAgICAgICBiTmVlZEVuY3J5cHQsCisgICAgIFdPUkQgICAgICAgICAgICAgd0ZyYWdUeXBlLAorICAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICAgdURNQUlkeCwKKyAgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgIHVGcmFnSWR4CiAgICAgKTsKIAogc3RhdGljCi1WT0lECit2b2lkCiBzX3ZGaWxsVHhLZXkoCi0gICAgSU4gIFBTRGV2aWNlICAgcERldmljZSwKLSAgICBJTiAgUEJZVEUgICAgICBwYnlCdWYsCi0gICAgSU4gIFBCWVRFICAgICAgcGJ5SVZIZWFkLAotICAgIElOICBQU0tleUl0ZW0gIHBUcmFuc21pdEtleSwKLSAgICBJTiAgUEJZVEUgICAgICBwYnlIZHJCdWYsCi0gICAgSU4gIFdPUkQgICAgICAgd1BheWxvYWRMZW4sCi0gICAgT1VUIFBCWVRFICAgICAgcE1JQ0hEUgorICAgICAgUFNEZXZpY2UgICBwRGV2aWNlLAorICAgICAgUEJZVEUgICAgICBwYnlCdWYsCisgICAgICBQQllURSAgICAgIHBieUlWSGVhZCwKKyAgICAgIFBTS2V5SXRlbSAgcFRyYW5zbWl0S2V5LAorICAgICAgUEJZVEUgICAgICBwYnlIZHJCdWYsCisgICAgICBXT1JEICAgICAgIHdQYXlsb2FkTGVuLAorICAgICBQQllURSAgICAgIHBNSUNIRFIKICAgICApOwogCiBzdGF0aWMKLVZPSUQKK3ZvaWQKIHNfdlNXZW5jcnlwdGlvbiAoCi0gICAgSU4gIFBTRGV2aWNlICAgICAgICAgcERldmljZSwKLSAgICBJTiAgUFNLZXlJdGVtICAgICAgICBwVHJhbnNtaXRLZXksCi0gICAgSU4gIFBCWVRFICAgICAgICAgICAgcGJ5UGF5bG9hZEhlYWQsCi0gICAgSU4gIFdPUkQgICAgICAgICAgICAgd1BheWxvYWRTaXplCisgICAgICBQU0RldmljZSAgICAgICAgIHBEZXZpY2UsCisgICAgICBQU0tleUl0ZW0gICAgICAgIHBUcmFuc21pdEtleSwKKyAgICAgIFBCWVRFICAgICAgICAgICAgcGJ5UGF5bG9hZEhlYWQsCisgICAgICBXT1JEICAgICAgICAgICAgIHdQYXlsb2FkU2l6ZQogICAgICk7CiAKLXN0YXRpYwotVUlOVAotc191R2V0VHhSc3ZUaW1lICgKLSAgICBJTiBQU0RldmljZSBwRGV2aWNlLAotICAgIElOIEJZVEUgICAgIGJ5UGt0VHlwZSwKLSAgICBJTiBVSU5UICAgICBjYkZyYW1lTGVuZ3RoLAotICAgIElOIFdPUkQgICAgIHdSYXRlLAotICAgIElOIEJPT0wgICAgIGJOZWVkQWNrCitzdGF0aWMgdW5zaWduZWQgaW50IHNfdUdldFR4UnN2VGltZSgKKyAgICAgUFNEZXZpY2UgcERldmljZSwKKyAgICAgQllURSAgICAgYnlQa3RUeXBlLAorICAgICB1bnNpZ25lZCBpbnQgICAgIGNiRnJhbWVMZW5ndGgsCisgICAgIFdPUkQgICAgIHdSYXRlLAorICAgICBCT09MICAgICBiTmVlZEFjawogICAgICk7CiAKIAotc3RhdGljCi1VSU5UCi1zX3VHZXRSVFNDVFNSc3ZUaW1lICgKLSAgICBJTiBQU0RldmljZSBwRGV2aWNlLAotICAgIElOIEJZVEUgYnlSVFNSc3ZUeXBlLAotICAgIElOIEJZVEUgYnlQa3RUeXBlLAotICAgIElOIFVJTlQgY2JGcmFtZUxlbmd0aCwKLSAgICBJTiBXT1JEIHdDdXJyZW50UmF0ZQorc3RhdGljIHVuc2lnbmVkIGludCBzX3VHZXRSVFNDVFNSc3ZUaW1lKAorICAgICBQU0RldmljZSBwRGV2aWNlLAorICAgICBCWVRFIGJ5UlRTUnN2VHlwZSwKKyAgICAgQllURSBieVBrdFR5cGUsCisgICAgIHVuc2lnbmVkIGludCBjYkZyYW1lTGVuZ3RoLAorICAgICBXT1JEIHdDdXJyZW50UmF0ZQogICAgICk7CiAKIHN0YXRpYwotVk9JRAordm9pZAogc192RmlsbENUU0hlYWQgKAotICAgIElOIFBTRGV2aWNlIHBEZXZpY2UsCi0gICAgSU4gVUlOVCAgICAgdURNQUlkeCwKLSAgICBJTiBCWVRFICAgICBieVBrdFR5cGUsCi0gICAgSU4gUFZPSUQgICAgcHZDVFMsCi0gICAgSU4gVUlOVCAgICAgY2JGcmFtZUxlbmd0aCwKLSAgICBJTiBCT09MICAgICBiTmVlZEFjaywKLSAgICBJTiBCT09MICAgICBiRGlzQ1JDLAotICAgIElOIFdPUkQgICAgIHdDdXJyZW50UmF0ZSwKLSAgICBJTiBCWVRFICAgICBieUZCT3B0aW9uCisgICAgIFBTRGV2aWNlIHBEZXZpY2UsCisgICAgIHVuc2lnbmVkIGludCAgICAgdURNQUlkeCwKKyAgICAgQllURSAgICAgYnlQa3RUeXBlLAorICAgICB2b2lkICpwdkNUUywKKyAgICAgdW5zaWduZWQgaW50ICAgICBjYkZyYW1lTGVuZ3RoLAorICAgICBCT09MICAgICBiTmVlZEFjaywKKyAgICAgQk9PTCAgICAgYkRpc0NSQywKKyAgICAgV09SRCAgICAgd0N1cnJlbnRSYXRlLAorICAgICBCWVRFICAgICBieUZCT3B0aW9uCiAgICAgKTsKIAogc3RhdGljCi1WT0lECit2b2lkCiBzX3ZGaWxsUlRTSGVhZCgKLSAgICBJTiBQU0RldmljZSAgICAgICAgIHBEZXZpY2UsCi0gICAgSU4gQllURSAgICAgICAgICAgICBieVBrdFR5cGUsCi0gICAgSU4gUFZPSUQgICAgICAgICAgICBwdlJUUywKLSAgICBJTiBVSU5UICAgICAgICAgICAgIGNiRnJhbWVMZW5ndGgsCi0gICAgSU4gQk9PTCAgICAgICAgICAgICBiTmVlZEFjaywKLSAgICBJTiBCT09MICAgICAgICAgICAgIGJEaXNDUkMsCi0gICAgSU4gUFNFdGhlcm5ldEhlYWRlciBwc0V0aEhlYWRlciwKLSAgICBJTiBXT1JEICAgICAgICAgICAgIHdDdXJyZW50UmF0ZSwKLSAgICBJTiBCWVRFICAgICAgICAgICAgIGJ5RkJPcHRpb24KKyAgICAgUFNEZXZpY2UgICAgICAgICBwRGV2aWNlLAorICAgICBCWVRFICAgICAgICAgICAgIGJ5UGt0VHlwZSwKKyAgICAgdm9pZCAqcHZSVFMsCisgICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgICBjYkZyYW1lTGVuZ3RoLAorICAgICBCT09MICAgICAgICAgICAgIGJOZWVkQWNrLAorICAgICBCT09MICAgICAgICAgICAgIGJEaXNDUkMsCisgICAgIFBTRXRoZXJuZXRIZWFkZXIgcHNFdGhIZWFkZXIsCisgICAgIFdPUkQgICAgICAgICAgICAgd0N1cnJlbnRSYXRlLAorICAgICBCWVRFICAgICAgICAgICAgIGJ5RkJPcHRpb24KICAgICApOwogCi1zdGF0aWMKLVVJTlQKLXNfdUdldERhdGFEdXJhdGlvbiAoCi0gICAgSU4gUFNEZXZpY2UgcERldmljZSwKLSAgICBJTiBCWVRFICAgICBieUR1clR5cGUsCi0gICAgSU4gVUlOVCAgICAgY2JGcmFtZUxlbmd0aCwKLSAgICBJTiBCWVRFICAgICBieVBrdFR5cGUsCi0gICAgSU4gV09SRCAgICAgd1JhdGUsCi0gICAgSU4gQk9PTCAgICAgYk5lZWRBY2ssCi0gICAgSU4gVUlOVCAgICAgdUZyYWdJZHgsCi0gICAgSU4gVUlOVCAgICAgY2JMYXN0RnJhZ21lbnRTaXplLAotICAgIElOIFVJTlQgICAgIHVNQUNmcmFnTnVtLAotICAgIElOIEJZVEUgICAgIGJ5RkJPcHRpb24KK3N0YXRpYyB1bnNpZ25lZCBpbnQgc191R2V0RGF0YUR1cmF0aW9uKAorICAgICBQU0RldmljZSBwRGV2aWNlLAorICAgICBCWVRFICAgICBieUR1clR5cGUsCisgICAgIHVuc2lnbmVkIGludCAgICAgY2JGcmFtZUxlbmd0aCwKKyAgICAgQllURSAgICAgYnlQa3RUeXBlLAorICAgICBXT1JEICAgICB3UmF0ZSwKKyAgICAgQk9PTCAgICAgYk5lZWRBY2ssCisgICAgIHVuc2lnbmVkIGludCAgICAgdUZyYWdJZHgsCisgICAgIHVuc2lnbmVkIGludCAgICAgY2JMYXN0RnJhZ21lbnRTaXplLAorICAgICB1bnNpZ25lZCBpbnQgICAgIHVNQU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gICAgcGJ5SVZIZWFkLAotICAgIElOICBQU0tleUl0ZW0gIHBUcmFuc21pdEtleSwKLSAgICBJTiAgUEJZVEUgICAgICBwYnlIZHJCdWYsCi0gICAgSU4gIFdPUkQgICAgICAgd1BheWxvYWRMZW4sCi0gICAgT1VUIFBCWVRFICAgICAgcE1JQ0hEUgorICAgICAgUFNEZXZpY2UgICBwRGV2aWNlLAorICAgICAgUEJZVEUgICAgICBwYnlCdWYsCisgICAgICBQQllURSAgICAgIHBieUlWSGVhZCwKKyAgICAgIFBTS2V5SXRlbSAgcFRyYW5zbWl0S2V5LAorICAgICAgUEJZVEUgICAgICBwYnlIZHJCdWYsCisgICAgICBXT1JEICAgICAgIHdQYXlsb2FkTGVuLAorICAgICBQQllURSAgICAgIHBNSUNIRFIKICAgICApCiB7CiAgICAgUERXT1JEICAgICAgICAgIHBkd0lWID0gKFBEV09SRCkgcGJ5SVZIZWFkOwpAQCAtNDQ2LDE1ICs0NDAsMTUgQEAKIAogCiBzdGF0aWMKLVZPSUQKK3ZvaWQKIHNfdlNXZW5jcnlwdGlvbiAoCi0gICAgSU4gIFBTRGV2aWNlICAgICAgICAgICAgcERldmljZSwKLSAgICBJTiAgUFNLZXlJdGVtICAgICAgICAgICBwVHJhbnNtaXRLZXksCi0gICAgSU4gIFBCWVRFICAgICAgICAgICAgICAgcGJ5UGF5bG9hZEhlYWQsCi0gICAgSU4gIFdPUkQgICAgICAgICAgICAgICAgd1BheWxvYWRTaXplCisgICAgICBQU0RldmljZSAgICAgICAgICAgIHBEZXZpY2UsCisgICAgICBQU0tleUl0ZW0gICAgICAgICAgIHBUcmFuc21pdEtleSwKKyAgICAgIFBCWVRFICAgICAgICAgICAgICAgcGJ5UGF5bG9hZEhlYWQsCisgICAgICBXT1JEICAgICAgICAgICAgICAgIHdQYXlsb2FkU2l6ZQogICAgICkKIHsKLSAgICBVSU5UICAgY2JJQ1ZsZW4gPSA0OworICAgIHVuc2lnbmVkIGludCAgIGNiSUNWbGVuID0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lbnRTaXplLAorICAgICB1bnNpZ25lZCBpbnQgICAgIHVNQUNmcmFnTnVtLAorICAgICBCWVRFICAgICBieUZCT3B0aW9uCiAgICAgKQogewogCkBAIC05NzksMjAgKzk3MiwyMCBAQAogCiAKIHN0YXRpYwotVk9JRAordm9pZAogc192RmlsbFJUU0hlYWQgKAotICAgIElOIFBTRGV2aWNlICAgICAgICAgcERldmljZSwKLSAgICBJTiBCWVRFICAgICAgICAgICAgIGJ5UGt0VHlwZSwKLSAgICBJTiBQVk9JRCAgICAgICAgICAgIHB2UlRTLAotICAgIElOIFVJTlQgICAgICAgICAgICAgY2JGcmFtZUxlbmd0aCwKLSAgICBJTiBCT09MICAgICAgICAgICAgIGJOZWVkQWNrLAotICAgIElOIEJPT0wgICAgICAgICAgICAgYkRpc0NSQywKLSAgICBJTiBQU0V0aGVybmV0SGVhZGVyIHBzRXRoSGVhZGVyLAotICAgIElOIFdPUkQgICAgICAgICAgICAgd0N1cnJlbnRSYXRlLAotICAgIElOIEJZVEUgICAgICAgICAgICAgYnlGQk9wdGlvbgorICAgICBQU0RldmljZSAgICAgICAgIHBEZXZpY2UsCisgICAgIEJZVEUgICAgICAgICAgICAgYnlQa3RUeXBlLAorICAgICB2b2lkICpwdlJUUywKKyAgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgIGNiRnJhbWVMZW5ndGgsCisgICAgIEJPT0wgICAgICAgICAgICAgYk5lZWRBY2ssCisgICAgIEJPT0wgICAgICAgICAgICAgYkRpc0NSQywKKyAgICAgUFNFdGhlcm5ldEhlYWRlciBwc0V0aEhlYWRlciwKKyAgICAgV09SRCAgICAgICAgICAgICB3Q3VycmVudFJhdGUsCisgICAgIEJZVEUgICAgICAgICAgICAgYnlGQk9wdGlvbgogICAgICkKIHsKLSAgICBVSU5UIHVSVFNGcmFtZUxlbiA9IDIwOworICAgIHVuc2lnbmVkIGludCB1UlRTRnJhbWVMZW4gPSAyMDsKICAgICBXT1JEICB3TGVuID0gMHgwMDAwOwogCiAgICAgaWYgKHB2UlRTID09IE5VTEwpCkBAIC0xMDI2LDE4ICsxMDE5LDI3IEBACiAgICAgICAgICAgICBwQnVmLT5EYXRhLndEdXJhdGlvbklEID0gcEJ1Zi0+d0R1cmF0aW9uX2FhOwogICAgICAgICAgICAgLy9HZXQgUlRTIEZyYW1lIGJvZHkKICAgICAgICAgICAgIHBCdWYtPkRhdGEud0ZyYW1lQ29udHJvbCA9IFRZUEVfQ1RMX1JUUzsvLzB4MDBCNAotICAgICAgICAgICAgaWYgKChwRGV2aWNlLT5lT1BNb2RlID09IE9QX01PREVfQURIT0MpIHx8Ci0gICAgICAgICAgICAgICAgKHBEZXZpY2UtPmVPUE1vZGUgPT0gT1BfTU9ERV9BUCkpIHsKLSAgICAgICAgICAgICAgICBtZW1jcHkoJihwQnVmLT5EYXRhLmFieVJBWzBdKSwgJihwc0V0aEhlYWRlci0+YWJ5RHN0QWRkclswXSksIFVfRVRIRVJfQUREUl9MRU4pOwotICAgICAgICAgICAgfQorCisJaWYgKChwRGV2aWNlLT5lT1BNb2RlID09IE9QX01PREVfQURIT0MpIHx8CisJICAgIChwRGV2aWNlLT5lT1BNb2RlID09IE9QX01PREVfQVApKSB7CisJCW1lbWNweSgmKHBCdWYtPkRhdGEuYWJ5UkFbMF0pLAorCQkgICAgICAgJihwc0V0aEhlYWRlci0+YWJ5RHN0QWRkclswXSksCisJCSAgICAgICBFVEhfQUxFTik7CisJfQogICAgICAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgICAgICAgbWVtY3B5KCYocEJ1Zi0+RGF0YS5hYnlSQVswXSksICYocERldmljZS0+YWJ5QlNTSURbMF0pLCBVX0VUSEVSX0FERFJfTEVOKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChwRGV2aWNlLT5lT1BNb2RlID09IE9QX01PREVfQVApIHsKLSAgICAgICAgICAgICAgICBtZW1jcHkoJihwQnVmLT5EYXRhLmFieVRBWzBdKSwgJihwRGV2aWNlLT5hYnl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VRIRVJfQUREUl9MRU4pOwotICAgICAgICAgICAgfQorCWlmICgocERldmljZS0+ZU9QTW9kZSA9PSBPUF9NT0RFX0FESE9DKSB8fAorCSAgICAocERldmljZS0+ZU9QTW9kZSA9PSBPUF9NT0RFX0FQKSkgeworCQltZW1jcHkoJihwQnVmLT5EYXRhLmFieVJBWzBdKSwKKwkJICAgICAgICYocHNFdGhIZWFkZXItPmFieURzdEFkZHJbMF0pLAorCQkgICAgICAgRVRIX0FMRU4pOworCX0KICAgICAgICAgICAgIGVsc2UgewotICAgICAgICAgICAgICAgIG1lbWNweSgmKHBCdWYtPkRhdGEuYWJ5UkFbMF0pLCAmKHBEZXZpY2UtPmFieUJTU0lEWzBdKSwgVV9FVEhFUl9BRERSX0xFTik7CisJCW1lbWNweSgmKHBCdWYtPkRhdGEuYWJ5UkFbMF0pLAorCQkgICAgICAgJihwRGV2aWNlLT5hYnlCU1NJRFswXSksCisJCSAgICAgICBFVEhfQUxFTik7CiAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgIGlmIChwRGV2aWNlLT5lT1BNb2RlID09IE9QX01PREVfQVApIHsKLSAgICAgICAgICAgICAgICBtZW1jcHkoJihwQnVmLT5EYXRhLmFieVRBWzBdKSwgJihwRGV2aWNlLT5hYnlCU1NJRFswXSksIFVfRVRIRVJfQUREUl9MRU4pOwotICAgICAgICAgICAgfQorCWlmIChwRGV2aWNlLT5lT1BNb2RlID09IE9QX01PREVfQVApIHsKKwkJbWVtY3B5KCYocEJ1Zi0+RGF0YS5hYnlUQVswXSksCisJCSAgICAgICAmKHBEZXZpY2UtPmFieUJTU0lEWzBdKSwKKwkJICAgICAgIEVUSF9BTEVOKTsKKwl9CiAgICAgICAgICAgICBlbHNlIHsKLSAgICAgICAgICAgICAgICBtZW1jcHkoJihwQnVmLT5EYXRhLmFieVRBWzBdKSwgJihwc0V0aEhlYWRlci0+YWJ5U3JjQWRkclswXSksIFVfRVRIRVJfQUREUl9MRU4pOworCQkgICAgbWVtY3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VJBWzBdKSwKKwkJICAgICAgICYocERldmljZS0+YWJ5QlNTSURbMF0pLAorCQkgICAgICAgRVRIX0FMRU4pOworCX0KIAotICAgICAgICAgICAgaWYgKHBEZXZpY2UtPmVPUE1vZGUgPT0gT1BfTU9ERV9BUCkgewotICAgICAgICAgICAgICAgIG1lbWNweSgmKHBCdWYtPkRhdGEuYWJ5VEFbMF0pLCAmKHBEZXZpY2UtPmFieUJTU0lEWzBdKSwgVV9FVEhFUl9BRERSX0xFTik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlIHsKLSAgICAgICAgICAgICAgICBtZW1jcHkoJihwQnVmLT5EYXRhLmFieVRBWzBdKSwgJihwc0V0aEhlYWRlci0+YWJ5U3JjQWRkclswXSksIFVfRVRIRVJfQUREUl9MRU4pOwotICAgICAgICAgICAgfQorCWlmIChwRGV2aWNlLT5lT1BNb2RlID09IE9QX01PREVfQVApIHsKKwkJbWVtY3B5KCYocEJ1Zi0+RGF0YS5hYnlUQVswXSksCisJCSAgICAgICAmKHBEZXZpY2UtPmFieUJTU0lEWzBdKSwKKwkJICAgICAgIEVUSF9BTEVOKTsKKwl9IGVsc2UgeworCQltZW1jcHkoJihwQnVmLT5EYXRhLmFieVRBWzBdKSwKKwkJICAgICAgICYocHNFdGhIZWFkZXItPmFieVNyY0FkZHJbMF0pLAorCQkgICAgICAgRVRIX0FMRU4pOworCX0KIAogICAgICAgICB9CiAgICAgICAgIGVsc2UgewpAQCAtMTEyNSwxOSArMTE0MSwyNSBAQAogICAgIAkgICAgLy9HZXQgUlRTIEZyYW1lIGJvZHkKICAgICAgICAgICAgIHBCdWYtPkRhdGEud0ZyYW1lQ29udHJvbCA9IFRZUEVfQ1RMX1JUUzsvLzB4MDBCNAogCi0gICAgICAgICAgICBpZiAoKHBEZXZpY2UtPmVPUE1vZGUgPT0gT1BfTU9ERV9BREhPQykgfHwKLSAgICAgICAgICAgICAgICAocERldmljZS0+ZU9QTW9kZSA9PSBPUF9NT0RFX0FQKSkgewotICAgICAgICAgICAgICAgIG1lbWNweSgmKHBCdWYtPkRhdGEuYWJ5UkFbMF0pLCAmKHBzRXRoSGVhZGVyLT5hYnlEc3RBZGRyWzBdKSwgVV9FVEhFUl9BRERSX0xFTik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlIHsKLSAgICAgICAgICAgICAgICBtZW1jcHkoJihwQnVmLT5EYXRhLmFieVJBWzBdKSwgJihwRGV2aWNlLT5hYnlCU1NJRFswXSksIFVfRVRIRVJfQUREUl9MRU4pOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKHBEZXZpY2UtPmVPUE1vZGUgPT0gT1BfTU9ERV9BUCkgewotICAgICAgICAgICAgICAgIG1lbWNweSgmKHBCdWYtPkRhdGEuYWJ5VEFbMF0pLCAmKHBEZXZpY2UtPmFieUJTU0lEWzBdKSwgVV9FVEhFUl9BRERSX0xFTik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlIHsKLSAgICAgICAgICAgICAgICBtZW1jcHkoJihwQnVmLT5EYXRhLmFieVRBWzBdKSwgJihwc0V0aEhlYWRlci0+YWJ5U3JjQWRkclswXSksIFVfRVRIRVJfQUREUl9MRU4pOwotICAgICAgICAgICAgfQorCWlmICgocERldmljZS0+ZU9QTW9kZSA9PSBPUF9NT0RFX0FESE9DKSB8fAorCSAgICAocERldmljZS0+ZU9QTW9kZSA9PSBPUF9NT0RFX0FQKSkgeworCQltZW1jcHkoJihwQnVmLT5EYXRhLmFieVJBWzBdKSwKKwkJICAgICAgICYocHNFdGhIZWFkZXItPmFieURzdEFkZHJbMF0pLAorCQkgICAgICAgRVRIX0FMRU4pOworCX0gZWxzZSB7CisJCW1lbWNweSgmKHBCdWYtPkRhdGEuYWJ5UkFbMF0pLAorCQkgICAgICAgJihwRGV2aWNlLT5hYnlCU1NJRFswXSksCisJCSAgICAgICBFVEhfQUxFTik7CisJfQorCWlmIChwRGV2aWNlLT5lT1BNb2RlID09IE9QX01PREVfQVApIHsKKwkJbWVtY3B5KCYocEJ1Zi0+RGF0YS5hYnlUQVswXSksCisJCSAgICAgICAmKHBEZXZpY2UtPmFieUJTU0lEWzBdKSwKKwkJICAgICAgIEVUSF9BTEVOKTsKKwl9IGVsc2UgeworCQltZW1jcHkoJihwQnVmLT5EYXRhLmFieVRBWzBdKSwKKwkJICAgICAgICYocHNFdGhIZWFkZXItPmFieVNyY0FkZHJbMF0pLAorCQkgICAgICAgRVRIX0FMRU4pOworCX0KICAgICAgICAgfQogICAgIH0KICAgICBlbHNlIGlmIChieVBrdFR5cGUgPT0gUEtfVFlQRV8xMUIpIHsKQEAgLTExNTMsMzkgKzExNzUsNDUgQEAKICAgICAgICAgLy9HZXQgUlRTIEZyYW1lIGJvZHkKICAgICAgICAgcEJ1Zi0+RGF0YS53RnJhbWVDb250cm9sID0gVFlQRV9DVExfUlRTOy8vMHgwMEI0CiAKLQotICAgICAgICBpZiAoKHBEZXZpY2UtPmVPUE1vZGUgPT0gT1BfTU9ERV9BREhPQykgfHwKKwlpZiAoKHBEZXZpY2UtPmVPUE1vZGUgPT0gT1BfTU9ERV9BREhPQykgfHwKICAgICAgICAgICAgIChwRGV2aWNlLT5lT1BNb2RlID09IE9QX01PREVfQVApKSB7Ci0gICAgICAgICAgICBtZW1jcHkoJihwQnVmLT5EYXRhLmFieVJBWzBdKSwgJihwc0V0aEhlYWRlci0+YWJ5RHN0QWRkclswXSksIFVfRVRIRVJfQUREUl9MRU4pOworCQltZW1jcHkoJihwQnVmLT5EYXRhLmFieVJBWzBdKSwKKwkJICAgICAgICYocHNFdGhIZWFkZXItPmFieURzdEFkZHJbMF0pLAorCQkgICAgICAgRVRIX0FMRU4pOwogICAgICAgICB9CiAgICAgICAgIGVsc2UgewotICAgICAgICAgICAgbWVtY3B5KCYocEJ1Zi0+RGF0YS5hYnlSQVswXSksICYocERldmljZS0+YWJ5QlNTSURbMF0pLCBVX0VUSEVSX0FERFJfTEVOKTsKKwkJbWVtY3B5KCYocEJ1Zi0+RGF0YS5hYnlSQVswXSksCisJCSAgICAgICAmKHBEZXZpY2UtPmFieUJTU0lEWzBdKSwKKwkJICAgICAgIEVUSF9BTEVOKTsKICAgICAgICAgfQogCiAgICAgICAgIGlmIChwRGV2aWNlLT5lT1BNb2RlID09IE9QX01PREVfQVApIHsKLSAgICAgICAgICAgIG1lbWNweSgmKHBCdWYtPkRhdGEuYWJ5VEFbMF0pLCAmKHBEZXZpY2UtPmFieUJTU0lEWzBdKSwgVV9FVEhFUl9BRERSX0xFTik7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgICBtZW1jcHkoJihwQnVmLT5EYXRhLmFieVRBWzBdKSwgJihwc0V0aEhlYWRlci0+YWJ5U3JjQWRkclswXSksIFVfRVRIRVJfQUREUl9MRU4pOworCQltZW1jcHkoJihwQnVmLT5EYXRhLmFieVRBWzBdKSwKKwkJICAgICAgICYocERldmljZS0+YWJ5QlNTSURbMF0pLAorCQkgICAgICAgRVRIX0FMRU4pOworCX0gZWxzZSB7CisJCW1lbWNweSgmKHBCdWYtPkRhdGEuYWJ5VEFbMF0pLAorCQkgICAgICAgJihwc0V0aEhlYWRlci0+YWJ5U3JjQWRkclswXSksCisJCSAgICAgICBFVEhfQUxFTik7CiAgICAgICAgIH0KICAgICB9CiB9CiAKIHN0YXRpYwotVk9JRAordm9pZAogc192RmlsbENUU0hlYWQgKAotICAgIElOIFBTRGV2aWNlIHBEZXZpY2UsCi0gICAgSU4gVUlOVCAgICAgdURNQUlkeCwKLSAgICBJTiBCWVRFICAgICBieVBrdFR5cGUsCi0gICAgSU4gUFZPSUQgICAgcHZDVFMsCi0gICAgSU4gVUlOVCAgICAgY2JGcmFtZUxlbmd0aCwKLSAgICBJTiBCT09MICAgICBiTmVlZEFjaywKLSAgICBJTiBCT09MICAgICBiRGlzQ1JDLAotICAgIElOIFdPUkQgICAgIHdDdXJyZW50UmF0ZSwKLSAgICBJTiBCWVRFICAgICB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ICAgcFR4QnVmSGVhZCwKLSAgICBJTiBQVk9JRCAgICAgICAgICAgIHB2UnJ2VGltZSwKLSAgICBJTiBQVk9JRCAgICAgICAgICAgIHB2UlRTLAotICAgIElOIFBWT0lEICAgICAgICAgICAgcHZDVFMsCi0gICAgSU4gVUlOVCAgICAgICAgICAgICBjYkZyYW1lU2l6ZSwKLSAgICBJTiBCT09MICAgICAgICAgICAgIGJOZWVkQUNLLAotICAgIElOIFVJTlQgICAgICAgICAgICAgdURNQUlkeCwKLSAgICBJTiBQU0V0aGVybmV0SGVhZGVyIHBzRXRoSGVhZGVyCisgICAgIFBTRGV2aWNlICAgICAgICAgcERldmljZSwKKyAgICAgQllURSAgICAgICAgICAgICBieVBrdFR5cGUsCisgICAgIFdPUkQgICAgICAgICAgICAgd0N1cnJlbnRSYXRlLAorICAgICB2b2lkICpwVHhCdWZIZWFkLAorICAgICB2b2lkICpwdlJydlRpbWUsCisgICAgIHZvaWQgKnB2UlRTLAorICAgICB2b2lkICpwdkNUUywKKyAgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgIGNiRnJhbWVTaXplLAorICAgICBCT09MICAgICAgICAgICAgIGJOZWVkQUNLLAorICAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICAgdURNQUlkeCwKKyAgICAgUFNFdGhlcm5ldEhlYWRlciBwc0V0aEhlYWRlcgogICAgICkKIHsKLSAgICBVSU5UIGNiTUFDSGRMZW4gPSBXTEFOX0hEUl9BRERSM19MRU47IC8vMjQKKwl1bnNpZ25lZCBpbnQgY2JNQUNIZExlbiA9IFdMQU5fSERSX0FERFIzX0xFTjsgLyogMjQgKi8KICAgICBXT1JEIHdGaWZvQ3RsOwogICAgIEJPT0wgYkRpc0NSQyA9IEZBTFNFOwogICAgIEJZVEUgYnlGQk9wdGlvbiA9IEFVVE9fRkJfTk9ORTsKQEAgLTEzODYsNDQgKzE0MTMsNDUgQEAKIC8qCiAgICAgUEJZVEUgcGJ5QnVmZmVyLC8vcG9pbnQgdG8gcFR4QnVmSGVhZAogICAgIFdPUkQgIHdGcmFnVHlwZSwvLzAwOk5vbi1GcmFnLCAwMTpTdGFydCwgMDI6TWlkLCAwMzpMYXN0Ci0gICAgVUlOVCAgY2JGcmFnbWVudFNpemUsLy9IZHIrcGF5b2FkK0ZDUworICAgIHVuc2lnbmVkIGludCAgY2JGcmFnbWVudFNpemUsLy9IZHIrcGF5b2FkK0ZDUwogKi8KIAogCiBCT09MCiBzX2JQYWNrZXRUb1dpcmVsZXNzVXNiKAotICAgIElOICBQU0RldmljZSAgICAgICAgIHBEZXZpY2UsCi0gICAgSU4gIEJZVEUgICAgICAgICAgICAgYnlQa3RUeXBlLAotICAgIElOICBQQllURSAgICAgICAgICAgIHVzYlBhY2tldEJ1ZiwKLSAgICBJTiAgQk9PTCAgICAgICAgICAgICBiTmVlZEVuY3J5cHRpb24sCi0gICAgSU4gIFVJTlQgICAgICAgICAgICAgdVNrYlBhY2tldExlbiwKLSAgICBJTiAgVUlOVCAgICAgICAgICAgICB1RE1BSWR4LAotICAgIElOICBQU0V0aGVybmV0SGVhZGVyIHBzRXRoSGVhZGVyLAotICAgIElOICBQQllURSAgICAgICAgICAgIHBQYWNrZXQsCi0gICAgSU4gIFBTS2V5SXRlbSAgICAgICAgcFRyYW5zbWl0S2V5LAotICAgIElOICBVSU5UICAgICAgICAgICAgIHVOb2RlSW5kZXgsCi0gICAgSU4gIFdPUkQgICAgICAgICAgICAgd0N1cnJlbnRSYXRlLAotICAgIE9VVCBVSU5UICAgICAgICAgICAgICpwY2JIZWFkZXJMZW4sCi0gICAgT1VUIFVJTlQgICAgICAgICAgICAgKnBjYlRvdGFsTGVuCisgICAgICBQU0RldmljZSAgICAgICAgIHBEZXZpY2UsCisgICAgICBCWVRFICAgICAgICAgICAgIGJ5UGt0VHlwZSwKKyAgICAgIFBCWVRFICAgICAgICAgICAgdXNiUGFja2V0QnVmLAorICAgICAgQk9PTCAgICAgICAgICAgICBiTmVlZEVuY3J5cHRpb24sCisgICAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICAgdVNrYlBhY2tldExlbiwKKyAgICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgICB1RE1BSWR4LAorICAgICAgUFNFdGhlcm5ldEhlYWRlciBwc0V0aEhlYWRlciwKKyAgICAgIFBCWVRFICAgICAgICAgICAgcFBhY2tldCwKKyAgICAgIFBTS2V5SXRlbSAgICAgICAgcFRyYW5zbWl0S2V5LAorICAgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgIHVOb2RlSW5kZXgsCisgICAgICBXT1JEICAgICAgICAgICAgIHdDdXJyZW50UmF0ZSwKKyAgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICpwY2JIZWFkZXJMZW4sCisgICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgICAqcGNiVG90YWxMZW4KICAgICApCiB7CiAgICAgUFNNZ210T2JqZWN0ICAgICAgICBwTWdtdCA9ICYocERldmljZS0+c01nbXRPYmopOwotICAgIFVJTlQgICAgICAgICAgICAgICAgY2JGcmFtZVNpemUsY2JGcmFtZUJvZHlTaXplOworICAgIHVuc2lnbmVkIGludCBjYkZyYW1lU2l6ZSwgY2JGcmFtZUJvZHlTaXplOwogICAgIFBUWF9CVUZGRVIgICAgICAgICAgcFR4QnVmSGVhZDsKLSAgICBVSU5UICAgICAgICAgICAgICAgIGNiODAyXzFfSF9sZW47Ci0gICAgVUlOVCAgICAgICAgICAgICAgICBjYklWbGVuPTAsY2JJQ1ZsZW49MCxjYk1JQ2xlbj0wLGNiTUFDSGRMZW49MCxjYkZDU2xlbj00OwotICAgIFVJTlQgICAgICAgICAgICAgICAgY2JNSUNIRFIgPSAwOworICAgIHVuc2lnbmVkIGludCBjYjgwMl8xX0hfbGVuOworICAgIHVuc2lnbmVkIGludCBjYklWbGVuID0gMCwgY2JJQ1ZsZW4gPSAwLCBjYk1JQ2xlbiA9IDAsCisJICAgIGNiTUFDSGRMZW4gPSAwLCBjYkZDU2xlbiA9IDQ7C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ICAgICAgICAgICAgIGNiRnJhbWVTaXplLCBiTmVlZEFDSywgdURNQUlkeCwgcHNFdGhIZWFkZXIpOwogICAgIC8vRmlsbCBEYXRhSGVhZAogICAgIHVEdXJhdGlvbiA9IHNfdUZpbGxEYXRhSGVhZChwRGV2aWNlLCBieVBrdFR5cGUsIHdDdXJyZW50UmF0ZSwgcHZUeERhdGFIZCwgY2JGcmFtZVNpemUsIHVETUFJZHgsIGJOZWVkQUNLLApAQCAtMTcwMCwxMyArMTcyOSwxMyBAQAogICAgIGlmIChwUGFja2V0ICE9IE5VTEwpIHsKICAgICAgICAgLy8gQ29weSB0aGUgUGFja2V0IGludG8gYSB0eCBCdWZmZXIKICAgICAgICAgbWVtY3B5KChwYnlQYXlsb2FkSGVhZCArIGNiODAyXzFfSF9sZW4pLAotICAgICAgICAgICAgICAgICAocFBhY2tldCArIFVfSEVBREVSX0xFTiksCi0gICAgICAgICAgICAgICAgIHVTa2JQYWNrZXRMZW4gLSBVX0hFQURFUl9MRU4KKyAgICAgICAgICAgICAgICAgKHBQYWNrZXQgKyBFVEhfSExFTiksCisgICAgICAgICAgICAgICAgIHVTa2JQYWNrZXRMZW4gLSBFVEhfSExFTgogICAgICAgICAgICAgICAgICApOwogCiAgICAgfSBlbHNlIHsKICAgICAgICAgLy8gd2hpbGUgYlJlbGF5UGFja2V0U2VuZCBwc0V0aEhlYWRlciBpcyBwb2ludCB0byBoZWFkZXIrcGF5bG9hZAotICAgICAgICBtZW1jcHkoKHBieVBheWxvYWRIZWFkICsgY2I4MDJfMV9IX2xlbiksICgoUEJZVEUpcHNFdGhIZWFkZXIpK1VfSEVBREVSX0xFTiwgdVNrYlBhY2tldExlbiAtIFVfSEVBREVSX0xFTik7CisgICAgICAgIG1lbWNweSgocGJ5UGF5bG9hZEhlYWQgKyBjYjgwMl8xX0hfbGVuKSwgKChQQllURSlwc0V0aEhlYWRlcikgKyBFVEhfSExFTiwgdVNrYlBhY2tldExlbiAtIEVUSF9ITEVOKTsKICAgICB9CiAKICAgICBBU1NFUlQodUxlbmd0aCA9PSBjYk5kaXNCb2R5U2l6ZSk7CkBAIC0xNzcyLDcgKzE4MDEsNyBAQAogICAgIH0KIAogICAgIGlmIChwRGV2aWNlLT5iU29mdHdhcmVHZW5DcmNFcnIgPT0gVFJVRSkgewotICAgICAgICBVSU5UICAgY2JMZW47CisJdW5zaWduZWQgaW50IGNiTGVuOwogICAgICAgICBQRFdPUkQgcGR3Q1JDOwogCiAgICAgICAgIGR3Q1JDID0gMHhGRkZGRkZGRkw7CkBAIC0xODIwLDE2ICsxODQ5LDE2IEBACiAgKgogLSovCiAKLVZPSUQKK3ZvaWQKIHNfdkdlbmVyYXRlTUFDSGVhZGVyICgKLSAgICBJTiBQU0RldmljZSAgICAgICAgIHBEZXZpY2UsCi0gICAgSU4gUEJZVEUgICAgICAgICAgICBwYnlCdWZmZXJBZGRyLAotICAgIElOIFdPUkQgICAgICAgICAgICAgd0R1cmF0aW9uLAotICAgIElOIFBTRXRoZXJuZXRIZWFkZXIgcHNFdGhIZWFkZXIsCi0gICAgSU4gQk9PTCAgICAgICAgICAgICBiTmVlZEVuY3J5cHQsCi0gICAgSU4gV09SRCAgICAgICAgICAgICB3RnJhZ1R5cGUsCi0gICAgSU4gVUlOVCAgICAgICAgICAgICB1RE1BSWR4LAotICAgIElOIFVJTlQgICAgICAgICAgICAgdUZyYWdJZHgKKyAgICAgUFNEZXZpY2UgICAgICAgICBwRGV2aWNlLAorICAgICBQQllURSAgICAgICAgICAgIHBieUJ1ZmZlckFkZHIsCisgICAgIFdPUkQgICAgICAgICAgICAgd0R1cmF0aW9uLAorICAgICBQU0V0aGVybmV0SGVhZGVyIHBzRXRoSGVhZGVyLAorICAgICBCT09MICAgICAgICAgICAgIGJOZWVkRW5jcnlwdCwKKyAgICAgV09SRCAgICAgICAgICAgICB3RnJhZ1R5cGUsCisgICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgICB1RE1BSWR4LAorICAgICB1bnNpZ25lZCB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gICAgVUlOVCAgICAgICAgICAgIHVEdXJhdGlvbjsKLSAgICBVSU5UICAgICAgICAgICAgY2JSZXFDb3VudDsKKyAgICB2b2lkICpwdlR4RGF0YUhkOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgIHVEdXJhdGlvbjsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICBjYlJlcUNvdW50OwogICAgIFBTODAyXzExSGVhZGVyICBwTUFDSGVhZGVyOwotICAgIFVJTlQgICAgICAgICAgICBjYkhlYWRlclNpemU7Ci0gICAgVUlOVCAgICAgICAgICAgIGNiRnJhbWVCb2R5U2l6ZTsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICBjYkhlYWRlclNpemU7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgY2JGcmFtZUJvZHlTaXplOwogICAgIEJPT0wgICAgICAgICAgICBiTmVlZEFDSzsKICAgICBCT09MICAgICAgICAgICAgYklzUFNQT0xMID0gRkFMU0U7CiAgICAgUFNUeEJ1ZkhlYWQgICAgIHBUeEJ1ZkhlYWQ7Ci0gICAgVUlOVCAgICAgICAgICAgIGNiRnJhbWVTaXplOwotICAgIFVJTlQgICAgICAgICAgICBjYklWbGVuID0gMDsKLSAgICBVSU5UICAgICAgICAgICAgY2JJQ1ZsZW4gPSAwOwotICAgIFVJTlQgICAgICAgICAgICBjYk1JQ2xlbiA9IDA7Ci0gICAgVUlOVCAgICAgICAgICAgIGNiRkNTbGVuID0gNDsKLSAgICBVSU5UICAgICAgICAgICAgdVBhZGRpbmcgPSAwOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgIGNiRnJhbWVTaXplOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgIGNiSVZsZW4gPSAwOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgIGNiSUNWbGVuID0gMDsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICBjYk1JQ2xlbiA9IDA7CisgICAgdW5zaWduZWQgaW50ICAgICA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3B5KCYoc0V0aEhlYWRlci5hYnlTcmNBZGRyWzBdKSwgJihwUGFja2V0LT5wODAyMTFIZWFkZXItPnNBMy5hYnlBZGRyMlswXSksIFVfRVRIRVJfQUREUl9MRU4pOworICAgIG1lbWNweSgmKHNFdGhIZWFkZXIuYWJ5RHN0QWRkclswXSksCisJICAgJihwUGFja2V0LT5wODAyMTFIZWFkZXItPnNBMy5hYnlBZGRyMVswXSksCisJICAgRVRIX0FMRU4pOworICAgIG1lbWNweSgmKHNFdGhIZWFkZXIuYWJ5U3JjQWRkclswXSksCisJICAgJihwUGFja2V0LT5wODAyMTFIZWFkZXItPnNBMy5hYnlBZGRyMlswXSksCisJICAgRVRIX0FMRU4pOwogICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PQogICAgIC8vICAgIE5vIEZyYWdtZW50YXRpb24KICAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT0KQEAgLTIxOTcsMjAgKzIyNDUsMjAgQEAKIAogQ01EX1NUQVRVUwogY3NCZWFjb25feG1pdCgKLSAgICBJTiAgUFNEZXZpY2UgcERldmljZSwKLSAgICBJTiAgUFNUeE1nbXRQYWNrZXQgcFBhY2tldAorICAgICAgUFNEZXZpY2UgcERldmljZSwKKyAgICAgIFBTVHhNZ210UGFja2V0IHBQYWNrZXQKICAgICApCiB7CiAKLSAgICBVSU5UICAgICAgICAgICAgICAgIGNiRnJhbWVTaXplID0gcFBhY2tldC0+Y2JNUERVTGVuICsgV0xBTl9GQ1NfTEVOOwotICAgIFVJTlQgICAgICAgICAgICAgICAgY2JIZWFkZXJTaXplID0gMDsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICAgICAgY2JGcmFtZVNpemUgPSBwUGFja2V0LT5jYk1QRFVMZW4gKyBXTEFOX0ZDU19MRU47CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgIGNiSGVhZGVyU2l6ZSA9IDA7CiAgICAgV09SRCAgICAgICAgICAgICAgICB3VHhCdWZTaXplID0gc2l6ZW9mKFNUeFNob3J0QnVmSGVhZCk7CiAgICAgUFNUeFNob3J0QnVmSGVhZCAgICBwVHhCdWZIZWFkOwogICAgIFBTODAyXzExSGVhZGVyICAgICAgcE1BQ0hlYWRlcjsKICAgICBQU1R4RGF0YUhlYWRfYWIgICAgIHBUeERhdGFIZWFkOwogICAgIFdPUkQgICAgICAgICAgICAgICAgd0N1cnJlbnRSYXRlOwotICAgIFVJTlQgICAgICAgICAgICAgICAgY2JGcmFtZUJvZHlTaXplOwotICAgIFVJTlQgICAgICAgICAgICAgICAgY2JSZXFDb3VudDsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICAgICAgY2JGcmFtZUJvZHlTaXplOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgICAgICBjYlJlcUNvdW50OwogICAgIFBCRUFDT05fQlVGRkVSICAgICAgcFRYX0J1ZmZlcjsKICAgICBQQllURSAgICAgICAgICAgICAgIHBieVR4QnVmZmVyQWRkcjsKICAgICBQVVNCX1NFTkRfQ09OVEVYVCAgIHBDb250ZXh0OwpAQCAtMjI4OCw1MCArMjMzNiw1MCBAQAogCiAKIAotVk9JRAordm9pZAogdkRNQTBfdHhfODAyMTEoUFNEZXZpY2UgIHBEZXZpY2UsIHN0cnVjdCBza19idWZmICpza2IpIHsKIAogICAgIFBTTWdtdE9iamVjdCAgICBwTWdtdCA9ICYocERldmljZS0+c01nbXRPYmopOwogICAgIEJZVEUgICAgICAgICAgICBieVBrdFR5cGU7CiAgICAgUEJZVEUgICAgICAgICAgIHBieVR4QnVmZmVyQWRkcjsKLSAgICBQVk9JRCAgICAgICAgICAgcHZSVFM7Ci0gICAgUFZPSUQgICAgICAgICAgIHB2Q1RTOwotICAgIFBWT0lEICAgICAgICAgICBwdlR4RGF0YUhkOwotICAgIFVJTlQgICAgICAgICAgICB1RHVyYXRpb247Ci0gICAgVUlOVCAgICAgICAgICAgIGNiUmVxQ291bnQ7CisgICAgdm9pZCAqcHZSVFM7CisgICAgdm9pZCAqcHZDVFM7CisgICAgdm9pZCAqcHZUeERhdGFIZDsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICB1RHVyYXRpb247CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgY2JSZXFDb3VudDsKICAgICBQUzgwMl8xMUhlYWRlciAgcE1BQ0hlYWRlcjsKLSAgICBVSU5UICAgICAgICAgICAgY2JIZWFkZXJTaXplOwotICAgIFVJTlQgICAgICAgICAgICBjYkZyYW1lQm9keVNpemU7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgY2JIZWFkZXJTaXplOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgIGNiRnJhbWVCb2R5U2l6ZTsKICAgICBCT09MICAgICAgICAgICAgYk5lZWRBQ0s7CiAgICAgQk9PTCAgICAgICAgICAgIGJJc1BTUE9MTCA9IEZBTFNFOwogICAgIFBTVHhCdWZIZWFkICAgICBwVHhCdWZIZWFkOwotICAgIFVJTlQgICAgICAgICAgICBjYkZyYW1lU2l6ZTsKLSAgICBVSU5UICAgICAgICAgICAgY2JJVmxlbiA9IDA7Ci0gICAgVUlOVCAgICAgICAgICAgIGNiSUNWbGVuID0gMDsKLSAgICBVSU5UICAgICAgICAgICAgY2JNSUNsZW4gPSAwOwotICAgIFVJTlQgICAgICAgICAgICBjYkZDU2xlbiA9IDQ7Ci0gICAgVUlOVCAgICAgICAgICAgIHVQYWRkaW5nID0gMDsKLSAgICBVSU5UICAgICAgICAgICAgY2JNSUNIRFIgPSAwOwotICAgIFVJTlQgICAgICAgICAgICB1TGVuZ3RoID0gMDsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICBjYkZyYW1lU2l6ZTsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICBjYklWbGVuID0gMDsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICBjYklDVmxlbiA9IDA7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgY2JNSUNsZW4gPSAwOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgIGNiRkNTbGVuID0gNDsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICB1UGFkZGluZyA9IDA7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgY2JNSUNIRFIgPSAwOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgIHVMZW5ndGggPSAwOwogICAgIERXT1JEICAgICAgICAgICBkd01JQ0tleTAsIGR3TUlDS2V5MTsKICAgICBEV09SRCAgICAgICAgICAgZHdNSUNfUHJpb3JpdHk7CiAgICAgUERXT1JEICAgICAgICAgIHBkd01JQ19MOwogICAgIFBEV09SRCAgICAgICAgICBwZHdNSUNfUjsKICAgICBXT1JEICAgICAgICAgICAgd1R4QnVmU2l6ZTsKLSAgICBVSU5UICAgICAgICAgICAgY2JNYWNIZExlbjsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICBjYk1hY0hkTGVuOwogICAgIFNFdGhlcm5ldEhlYWRlciBzRXRoSGVhZGVyOwotICAgIFBWT0lEICAgICAgICAgICBwdlJydlRpbWU7Ci0gICAgUFZPSUQgICAgICAgICAgIHBNSUNIRFI7CisgICAgdm9pZCAqcHZScnZUaW1lOworICAgIHZvaWQgKnBNSUNIRFI7CiAgICAgV09SRCAgICAgICAgICAgIHdDdXJyZW50UmF0ZSA9IFJBVEVfMU07CiAgICAgUFVXTEFOXzgwMjExSERSICBwODAyMTFIZWFkZXI7Ci0gICAgVUlOVCAgICAgICAgICAgICB1Tm9kZUluZGV4ID0gMDsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICAgdU5vZGVJbmRleCA9IDA7CiAgICAgQk9PTCAgICAgICAgICAgIGJOb2RlRXhpc3QgPSBGQUxTRTsKICAgICBTS2V5SXRlbSAgICAgICAgU1RlbXBLZXk7CiAgICAgUFNLZXlJdGVtICAgICAgIHBUcmFuc21pdEtleSA9IE5VTEw7CiAgICAgUEJZVEUgICAgICAgICAgIHBieUlWSGVhZD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NpemUgLSB3VHhCdWZTaXplKSk7CisgICAgbWVtY3B5KCYoc0V0aEhlYWRlci5hYnlEc3RBZGRyWzBdKSwKKwkgICAmKHA4MDIxMUhlYWRlci0+c0EzLmFieUFkZHIxWzBdKSwKKwkgICBFVEhfQUxFTik7CisgICAgbWVtY3B5KCYoc0V0aEhlYWRlci5hYnlTcmNBZGRyWzBdKSwKKwkgICAmKHA4MDIxMUhlYWRlci0+c0EzLmFieUFkZHIyWzBdKSwKKwkgICBFVEhfQUxFTik7CiAgICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09CiAgICAgLy8gICAgTm8gRnJhZ21lbnRhdGlvbgogICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PQpAQCAtMjY5MiwyMSArMjc0NSwyMSBAQAogCiBOVFNUQVRVUwogbnNETUFfdHhfcGFja2V0KAotICAgIElOICBQU0RldmljZSBwRGV2aWNlLAotICAgIElOICBVSU5UICAgIHVETUFJZHgsCi0gICAgSU4gIHN0cnVjdCBza19idWZmICpza2IKKyAgICAgIFBTRGV2aWNlIHBEZXZpY2UsCisgICAgICB1bnNpZ25lZCBpbnQgICAgdURNQUlkeCwKKyAgICAgIHN0cnVjdCBza19idWZmICpza2IKICAgICApCiB7CiAgICAgUFNNZ210T2JqZWN0ICAgIHBNZ210ID0gJihwRGV2aWNlLT5zTWdtdE9iaik7Ci0gICAgVUlOVCAgICAgICAgICAgIEJ5dGVzVG9Xcml0ZSA9MCx1SGVhZGVyTGVuID0gMDsKLSAgICBVSU5UICAgICAgICAgICAgdU5vZGVJbmRleCA9IDA7CisgICAgdW5zaWduZWQgaW50IEJ5dGVzVG9Xcml0ZSA9IDAsIHVIZWFkZXJMZW4gPSAwOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgIHVOb2RlSW5kZXggPSAwOwogICAgIEJZVEUgICAgICAgICAgICBieU1hc2tbOF0gPSB7MSwgMiwgNCwgOCwgMHgxMCwgMHgyMCwgMHg0MCwgMHg4MH07CiAgICAgV09SRCAgICAgICAgICAgIHdBSUQ7CiAgICAgQllURSAgICAgICAgICAgIGJ5UGt0VHlwZTsKICAgICBCT09MICAgICAgICAgICAgYk5lZWRFbmNyeXB0aW9uID0gRkFMU0U7CiAgICAgUFNLZXlJdGVtICAgICAgIHBUcmFuc21pdEtleSA9IE5VTEw7CiAgICAgU0tleUl0ZW0gICAgICAgIFNUZW1wS2V5OwotICAgIFVJTlQgICAgICAgICAgICBpaTsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICBpaTsKICAgICBCT09MICAgICAgICAgICAgYlRLSVBfVXNlR1RLID0gRkFMU0U7CiAgICAgQk9PTCAgICAgICAgICAgIGJOZWVkRGVBdXRoID0gRkFMU0U7CiAgICAgUEJZVEUgICAgICAgICAgIHBieUJTU0lEOwpAQCAtMjcxNCw3ICsyNzY3LDcgQEAKICAgICBQVVNCX1NFTkRfQ09OVEVYVCBwQ29udGV4dDsKICAgICBCT09MICAgICAgICAgICAgZkNvbnZlcnRlZFBhY2tldDsKICAgICBQVFhfQlVGRkVSICAgICAgcFRYX0J1ZmZlcjsKLSAgICBVSU5UICAgICAgICAgICAgc3RhdHVzOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgIHN0YXR1czsKICAgICBXT1JEICAgICAgICAgICAgd0tlZXBSYXRlID0gcERldmljZS0+d0N1cnJlbnRSYXRlOwogICAgIHN0cnVjdCBuZXRfZGV2aWNlX3N0YXRzKiBwU3RhdHMgPSAmcERldmljZS0+c3RhdHM7CiAvLyNpZmRlZiBXUEFfU01fVHJhbnN0YXR1cwpAQCAtMjc5Niw3ICsyODQ5LDcgQEAKICAgICAgICAgcmV0dXJuIFNUQVRVU19SRVNPVVJDRVM7CiAgICAgfQogCi0gICAgbWVtY3B5KHBEZXZpY2UtPnNUeEV0aEhlYWRlci5hYnlEc3RBZGRyLCAoUEJZVEUpKHNrYi0+ZGF0YSksIFVfSEVBREVSX0xFTik7CisgICAgbWVtY3B5KHBEZXZpY2UtPnNUeE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YlBTTW9kZVR4QnVyc3QgPSBUUlVFOwogICAgICAgICB9CiAgICAgfQpAQCAtMzA3Nyw3ICszMTM0LDcgQEAKICAgICBpZiAoYk5lZWREZUF1dGggPT0gVFJVRSkgewogICAgICAgICBXT1JEIHdSZWFzb24gPSBXTEFOX01HTVRfUkVBU09OX01JQ19GQUlMVVJFOwogCi0gICAgICAgIGJTY2hlZHVsZUNvbW1hbmQoKEhBTkRMRSkgcERldmljZSwgV0xBTl9DTURfREVBVVRILCAoUEJZVEUpJndSZWFzb24pOworCWJTY2hlZHVsZUNvbW1hbmQoKHZvaWQgKikgcERldmljZSwgV0xBTl9DTURfREVBVVRILCAoUEJZVEUpICZ3UmVhc29uKTsKICAgICB9CiAKICAgaWYoc3RhdHVzIT1TVEFUVVNfUEVORElORykgewpAQCAtMzExMCwxNCArMzE2NywxNCBAQAogCiBCT09MCiBiUmVsYXlQYWNrZXRTZW5kICgKLSAgICBJTiAgUFNEZXZpY2UgcERldmljZSwKLSAgICBJTiAgUEJZVEUgICAgcGJ5U2tiRGF0YSwKLSAgICBJTiAgVUlOVCAgICAgdURhdGFMZW4sCi0gICAgSU4gIFVJTlQgICAgIHVOb2RlSW5kZXgKKyAgICAgIFBTRGV2aWNlIHBEZXZpY2UsCisgICAgICBQQllURSAgICBwYnlTa2JEYXRhLAorICAgICAgdW5zaWduZWQgaW50ICAgICB1RGF0YUxlbiwKKyAgICAgIHVuc2lnbmVkIGludCAgICAgdU5vZGVJbmRleAogICAgICkKIHsKICAgICBQU01nbXRPYmplY3QgICAgcE1nbXQgPSAmKHBEZXZpY2UtPnNNZ210T2JqKTsKLSAgICBVSU5UICAgICAgICAgICAgQnl0ZXNUb1dyaXRlID0wLHVIZWFkZXJMZW4gPSAwOworICAgIHVuc2lnbmVkIGludCBCeXRlc1RvV3JpdGUgPSAwLCB1SGVhZGVyTGVuID0gMDsKICAgICBCWVRFICAgICAgICAgICAgYnlQa3RUeXBlID0gUEtfVFlQRV8xMUI7CiAgICAgQ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PT0wKIGJQYWNrZXRUb1dpcmVsZXNzVXNiKAotICAgIElOICBQU0RldmljZSAgICAgICAgIHBEZXZpY2UsCi0gICAgSU4gIEJZVEUgICAgICAgICAgICAgYnlQa3RUeXBlLAotICAgIElOICBQQllURSAgICAgICAgICAgIHVzYlBhY2tldEJ1ZiwKLSAgICBJTiAgQk9PTCAgICAgICAgICAgICBiTmVlZEVuY3J5cHQsCi0gICAgSU4gIFVJTlQgICAgICAgICAgICAgY2JQYXlsb2FkU2l6ZSwKLSAgICBJTiAgVUlOVCAgICAgICAgICAgICB1RE1BSWR4LAotICAgIElOICBQU0V0aGVybmV0SGVhZGVyIHBzRXRoSGVhZGVyLAotICAgIElOICBQQllURSAgICAgICAgICAgIHBQYWNrZXQsCi0gICAgSU4gIFBTS2V5SXRlbSAgICAgICAgcFRyYW5zbWl0S2V5LAotICAgIElOICBVSU5UICAgICAgICAgICAgIHVOb2RlSW5kZXgsCi0gICAgSU4gIFdPUkQgICAgICAgICAgICAgd0N1cnJlbnRSYXRlLAotICAgIE9VVCBVSU5UICAgICAgICAgICAgICpwY2JIZWFkZXJMZW4sCi0gICAgT1VUIFVJTlQgICAgICAgICAgICAgKnBjYlRvdGFsTGVuCisgICAgICBQU0RldmljZSAgICAgICAgIHBEZXZpY2UsCisgICAgICBCWVRFICAgICAgICAgICAgIGJ5UGt0VHlwZSwKKyAgICAgIFBCWVRFICAgICAgICAgICAgdXNiUGFja2V0QnVmLAorICAgICAgQk9PTCAgICAgICAgICAgICBiTmVlZEVuY3J5cHQsCisgICAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICAgY2JQYXlsb2FkU2l6ZSwKKyAgICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgICB1RE1BSWR4LAorICAgICAgUFNFdGhlcm5ldEhlYWRlciBwc0V0aEhlYWRlciwKKyAgICAgIFBCWVRFICAgICAgICAgICAgcFBhY2tldCwKKyAgICAgIFBTS2V5SXRlbSAgICAgICAgcFRyYW5zbWl0S2V5L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tLS0tLS0tICBFeHBvcnQgRGVmaW5pdGlvbnMgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCiAvLwogLy8gY29uc3RhbnRzCiAvLwotI2RlZmluZSBVX0VUSEVSX0FERFJfTEVOICAgIDYgICAgICAgICAgIC8vIEV0aGVybmV0IGFkZHJlc3MgbGVuZ3RoCi0jZGVmaW5lIFVfVFlQRV9MRU4gICAgICAgICAgMiAgICAgICAgICAgLy8KICNkZWZpbmUgVV9DUkNfTEVOICAgICAgICAgICA0ICAgICAgICAgICAvLwotI2RlZmluZSBVX0hFQURFUl9MRU4gICAgICAgIChVX0VUSEVSX0FERFJfTEVOICogMiArIFVfVFlQRV9MRU4pCi0jZGVmaW5lIFVfRVRIRVJfQUREUl9TVFJfTEVOIChVX0VUSEVSX0FERFJfTEVOICogMiArIDEpCisjZGVmaW5lIFVfRVRIRVJfQUREUl9TVFJfTEVOIChFVEhfQUxFTiAqIDIgKyAxKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEV0aGVybmV0IGFkZHJlc3Mgc3RyaW5nIGxlbmd0aAogCiAjZGVmaW5lIE1JTl9EQVRBX0xFTiAgICAgICAgNDYgICAgICAgICAgLy8gbWluIGRhdGEgbGVuZ3RoCiAjZGVmaW5lIE1BWF9EQVRBX0xFTiAgICAgICAgMTUwMCAgICAgICAgLy8gbWF4IGRhdGEgbGVuZ3RoCiAKLSNkZWZpbmUgTUlOX1BBQ0tFVF9MRU4gICAgICAoTUlOX0RBVEFfTEVOICsgVV9IRUFERVJfTEVOKQorI2RlZmluZSBNSU5fUEFDS0VUX0xFTiAgICAgIChNSU5fREFUQV9MRU4gKyBFVEhfSExFTikKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyA2MAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG1pbiB0b3RhbCBwYWNrZXQgbGVuZ3RoICh0eCkKLSNkZWZpbmUg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ICAgICAvLyAzMi1iaXQKQEAgLTE1MCwxMyArMTA0LDQgQEAKIAogdHlwZWRlZiBRV09SRCAqICAgICAgICAgIFBRV09SRDsKIAotdHlwZWRlZiB2b2lkICogICAgICAgICAgIFBWT0lEOwotCi0vLyBoYW5kbGUgZGVjbGFyYXRpb24KLSNpZmRlZiBTVFJJQ1QKLXR5cGVkZWYgdm9pZCAqSEFORExFOwotI2Vsc2UKLXR5cGVkZWYgUFZPSUQgSEFORExFOwotI2VuZGlmCi0KLSNlbmRpZiAvLyBfX1RUWVBFX0hfXworI2VuZGlmIC8qIF9fVFRZUEVfSF9fICovCmRpZmYgLS1naXQgYS9kcml2ZXJzL3N0YWdpbmcvdnQ2NjU2L3VwYy5oIGIvZHJpdmVycy9zdGFnaW5nL3Z0NjY1Ni91cGMuaAppbmRleCBhY2QxYjY2Li5iMzNhYmE0IDEwMDY0NAotLS0gYS9kcml2ZXJzL3N0YWdpbmcvdnQ2NjU2L3VwYy5oCisrKyBiL2RyaXZlcnMvc3RhZ2luZy92dDY2NTYvdXBjLmgKQEAgLTE0MSw3ICsxNDEsNyBAQAogCiAjZGVmaW5lIFBDQXZEZWxheUJ5SU8odURlbGF5VW5pdCkgeyAgICAgICAgICAgICBcCiAgICAgQllURSAgICBieURhdGE7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgVUxPTkcgICBpaTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgdW5zaWduZWQgbG9uZyAgIGlpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICBpZiAodURlbGF5VW5pdCA8PSA1MCkgeyAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgICAgdWRlbGF5KHVEZWxheVVuaXQpOyAgICAgICAgICAgICAgICAgICAgIFwKQEAgLTE1OSw4ICsxNTksNCBAQAogCiAvKi0tLS0tLS0tLS0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AgICAgc3RydWN0IHVyYiAqdXJiCiAgICAgKTsKIAogc3RhdGljCi1WT0lECit2b2lkCiBzX25zQ29udHJvbEluVXNiSW9Db21wbGV0ZVdyaXRlKAotICAgIElOIHN0cnVjdCB1cmIgKnVyYgorICAgICBzdHJ1Y3QgdXJiICp1cmIKICAgICApOwogCiAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLSAgRXhwb3J0IFZhcmlhYmxlcyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwpAQCAtMTExLDEyICsxMTEsMTIgQEAKIAogTlRTVEFUVVMKIFBJUEVuc0NvbnRyb2xPdXRBc3luKAotICAgIElOIFBTRGV2aWNlICAgICBwRGV2aWNlLAotICAgIElOIEJZVEUgICAgICAgICBieVJlcXVlc3QsCi0gICAgSU4gV09SRCAgICAgICAgIHdWYWx1ZSwKLSAgICBJTiBXT1JEICAgICAgICAgd0luZGV4LAotICAgIElOIFdPUkQgICAgICAgICB3TGVuZ3RoLAotICAgIElOIFBCWVRFICAgICAgICBwYnlCdWZmZXIKKyAgICAgUFNEZXZpY2UgICAgIHBEZXZpY2UsCisgICAgIEJZVEUgICAgICAgICBieVJlcXVlc3QsCisgICAgIFdPUkQgICAgICAgICB3VmFsdWUsCisgICAgIFdPUkQgICAgICAgICB3SW5kZXgsCisgICAgIFdPUkQgICAgICAgICB3TGVuZ3RoLAorICAgICBQQllURSAgICAgICAgcGJ5QnVmZmVyCiAgICAgKQogewogICAgIE5UU1RBVFVTICAgICAgICAgICAgICAgIG50U3RhdHVzOwpAQCAtMTQyLDcgKzE0Miw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg0MCwgLy8gUmVxdWVzdFR5cGUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3VmFsdWUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd0luZGV4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIChQVk9JRCkgcGJ5QnVmZmVyLAorCQkJICAgICh2b2lkICopIHBieUJ1ZmZlciwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3TGVuZ3RoLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhaCiAgICAgICAgICAgICAgICAgICAgICAgICAgICk7CkBAIC0xNjIsMTIgKzE2MiwxMiBAQAogCiBOVFNUQVRVUwogUElQRW5zQ29udHJvbE91dCgKLSAgICBJTiBQU0RldmljZSAgICAgcERldmljZSwKLSAgICBJTiBCWVRFICAgICAgICAgYnlSZXF1ZXN0LAotICAgIElOIFdPUkQgICAgICAgICB3VmFsdWUsCi0gICAgSU4gV09SRCAgICAgICAgIHdJbmRleCwKLSAgICBJTiBXT1JEICAgICAgICAgd0xlbmd0aCwKLSAgICBJTiBQQllURSAgICAgICAgcGJ5QnVmZmVyCisgICAgIFBTRGV2aWNlICAgICBwRGV2aWNlLAorICAgICBCWVRFICAgICAgICAgYnlSZXF1ZXN0LAorICAgICBXT1JEICAgICAgICAgd1ZhbHVlLAorICAgICBXT1JEICAgICAgICAgd0luZGV4LAorICAgICBXT1JEICAgICAgICAgd0xlbmd0aCwKKyAgICAgUEJZVEUgICAgICAgIHBieUJ1ZmZlcgogICAgICkKIHsKICAgICBOVFNUQVRVUyAgICAgICAgICAgIG50U3RhdHVzID0gMDsKQEAgLTE5Myw3ICsxOTMsOCBAQAogCQkJIHVzYl9zbmRjdHJscGlwZShwRGV2aWNlLT51c2IgLCAwKSwgKGNoYXIgKikgJnBEZXZpY2UtPnNVc2JDdGxSZXF1ZXN0LAogCQkJIHBieUJ1ZmZlciwgd0xlbmd0aCwgc19uc0NvbnRyb2xJblVzYklvQ29tcGxldGVXcml0ZSwgcERldmljZSk7CiAKLQlpZiAoKG50U3RhdHVzID0gdXNiX3N1Ym1pdF91cmIocERldmljZS0+cENvbnRyb2xVUkIsIEdGUF9BVE9NSUMpKSAhPSAwKSB7CisJbnRTdGF0dXMgPSB1c2Jfc3VibWl0X3VyYihwRGV2aWNlLT5wQ29udHJvbFVSQiw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gICAgICAgICAgICAgIHVzYl9yY3ZpbnRwaXBlKHBEZXZpY2UtPnVzYiwgMSksCi0JICAgICAgICAgICAgICAgICAoUFZPSUQpIHBEZXZpY2UtPmludEJ1Zi5wRGF0YUJ1ZiwKKwkJCSAodm9pZCAqKSBwRGV2aWNlLT5pbnRCdWYucERhdGFCdWYsCiAJICAgICAgICAgICAgICAgICBNQVhfSU5URVJSVVBUX1NJWkUsCiAJICAgICAgICAgICAgICAgICBzX25zSW50ZXJydXB0VXNiSW9Db21wbGV0ZVJlYWQsCiAJICAgICAgICAgICAgICAgICBwRGV2aWNlLApAQCAtMzk0LDcgKzM5Niw3IEBACiAJdXNiX2ZpbGxfaW50X3VyYihwRGV2aWNlLT5wSW50ZXJydXB0VVJCLAogCSAgICAgICAgICAgICAgICAgcERldmljZS0+dXNiLAogCSAgICAgICAgICAgICAgICAgdXNiX3JjdmludHBpcGUocERldmljZS0+dXNiLCAxKSwKLQkgICAgICAgICAgICAgICAgIChQVk9JRCkgcERldmljZS0+aW50QnVmLnBEYXRhQnVmLAorCQkJICh2b2lkICopIHBEZXZpY2UtPmludEJ1Zi5wRGF0YUJ1ZiwKIAkgICAgICAgICAgICAgICAgIE1BWF9JTlRFUlJVUFRfU0laRSwKIAkgICAgICAgICAgICAgICAgIHNfbnNJbnRlcnJ1cHRVc2JJb0NvbXBsZXRlUmVhZCwKIAkgICAgICAgICAgICAgICAgIHBEZXZpY2UsCkBAIC00MDcsMTQgKzQwOSwxNSBAQAogdXNiX2ZpbGxfYnVsa191cmIocERldmljZS0+cEludGVycnVwdFVSQiwKIAkJcERldmljZS0+dXNiLAogCQl1c2JfcmN2YnVsa3BpcGUocERldmljZS0+dXNiLCAxKSwKLQkJKFBWT0lEKSBwRGV2aWNlLT5pbnRCdWYucERhdGFCdWYsCisJCSh2b2lkICopIHBEZXZpY2UtPmludEJ1Zi5wRGF0YUJ1ZiwKIAkJTUFYX0lOVEVSUlVQVF9TSVpFLAogCQlzX25zSW50ZXJydXB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AKIAogTlRTVEFUVVMKIFBJUEVuc0NvbnRyb2xPdXRBc3luKAotICAgIElOIFBTRGV2aWNlICAgICBwRGV2aWNlLAotICAgIElOIEJZVEUgICAgICAgICBieVJlcXVlc3QsCi0gICAgSU4gV09SRCAgICAgICAgIHdWYWx1ZSwKLSAgICBJTiBXT1JEICAgICAgICAgd0luZGV4LAotICAgIElOIFdPUkQgICAgICAgICB3TGVuZ3RoLAotICAgIElOIFBCWVRFICAgICAgICBwYnlCdWZmZXIKKyAgICAgUFNEZXZpY2UgICAgIHBEZXZpY2UsCisgICAgIEJZVEUgICAgICAgICBieVJlcXVlc3QsCisgICAgIFdPUkQgICAgICAgICB3VmFsdWUsCisgICAgIFdPUkQgICAgICAgICB3SW5kZXgsCisgICAgIFdPUkQgICAgICAgICB3TGVuZ3RoLAorICAgICBQQllURSAgICAgICAgcGJ5QnVmZmVyCiAgICAgKTsKIAogTlRTVEFUVVMKIFBJUEVuc0NvbnRyb2xJbigKLSAgICBJTiBQU0RldmljZSAgICAgcERldmljZSwKLSAgICBJTiBCWVRFICAgICAgICAgYnlSZXF1ZXN0LAotICAgIElOIFdPUkQgICAgICAgICB3VmFsdWUsCi0gICAgSU4gV09SRCAgICAgICAgIHdJbmRleCwKLSAgICBJTiBXT1JEICAgICAgICAgd0xlbmd0aCwKLSAgICBJTiBPVVQgIFBCWVRFICAgcGJ5QnVmZmVyCisgICAgIFBTRGV2aWNlICAgICBwRGV2aWNlLAorICAgICBCWVRFICAgICAgICAgYnlSZXF1ZXN0LAorICAgICBXT1JEICAgICAgICAgd1ZhbHVlLAorICAgICBXT1JEICAgICAgICAgd0luZGV4LAorICAgICBXT1JEICAgICAgICAgd0xlbmd0aCwKKyAgICAgICBQQllURSAgIHBieUJ1ZmZlcgogICAgICk7CiAKIApAQCAtNzgsMjIgKzc4LDE5IEBACiAKIE5UU1RBVFVTCiBQSVBFbnNJbnRlcnJ1cHRSZWFkKAotICAgIElOIFBTRGV2aWNlIHBEZXZpY2UKK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FuZCk7CiAgICAgcmV0dXJuOwogfQogCi0KLQotCi1WT0lECi12UnVuQ29tbWFuZCgKLSAgICBJTiAgSEFORExFICAgICAgaERldmljZUNvbnRleHQKLSAgICApCit2b2lkIHZSdW5Db21tYW5kKHZvaWQgKmhEZXZpY2VDb250ZXh0KQogewogICAgIFBTRGV2aWNlICAgICAgICBwRGV2aWNlID0gKFBTRGV2aWNlKWhEZXZpY2VDb250ZXh0OwogICAgIFBTTWdtdE9iamVjdCAgICBwTWdtdCA9ICYocERldmljZS0+c01nbXRPYmopOwogICAgIFBXTEFOX0lFX1NTSUQgICBwSXRlbVNTSUQ7CiAgICAgUFdMQU5fSUVfU1NJRCAgIHBJdGVtU1NJREN1cnI7CiAgICAgQ01EX1NUQVRVUyAgICAgIFN0YXR1czsKLSAgICBVSU5UICAgICAgICAgICAgaWk7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgaWk7CiAgICAgQllURSAgICAgICAgICAgIGJ5TWFza1s4XSA9IHsxLCAyLCA0LCA4LCAweDEwLCAweDIwLCAweDQwLCAweDgwfTsKICAgICBzdHJ1Y3Qgc2tfYnVmZiAgKnNrYjsKICAgICBCWVRFICAgICAgICAgICAgYnlEYXRhOwpAQCAtNDM1LDcgKzQxNiw4IEBACiAgICAgICAgICAgICAgICAgICAgIHBNZ210LT5hYnlTY2FuQlNTSURbNV0gPSAweEZGOwogICAgICAgICAgICAgICAgICAgICBwSXRlbVNTSUQtPmJ5RWxlbWVudElEID0gV0xBTl9FSURfU1NJRDsKICAgICAgICAgICAgICAgICAgICAgLy8gY2xlYXIgYnNzaWQgbGlzdAotICAgICAgICAgICAgICAgICAgICAvLyBCU1N2Q2xlYXJCU1NMaXN0KChIQU5ETEUpcERldmljZSwgcERldmljZS0+YkxpbmtQYXNzKTsKKwkJICAgIC8qIEJTU3ZDbGVhckJTU0xpc3QoKHZvaWQgKikgcERldmljZSwKKwkJICAgICAgIHBEZXZpY2UtPmJMaW5rUGFzcyk7ICovCiAgICAgICAgICAgICAgICAgICAgIHBNZ210LT5lU2NhblN0YXRlID0gV01BQ19JU19TQ0FOTklORzsKICAgICAgICAgICAgICAgICAgICAgcERldmljZS0+YnlTY2FuQkJUeXBlID0gcERldmljZS0+YnlCQlR5cGU7ICAvL2x1Y2FzCiAgICAgICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJTdG9wRGF0YVBrdCA9IFRSVUU7CkBAIC00ODAsMTEgKzQ2MiwxMSBAQAogICAgICAgICAgICAgICAgICAgICAocE1nbXQtPnVTY2FuQ2hhbm5lbCA8IENCX01BWF9DSEFOTkVMXzI0RykpIHsKICAgICAgICAgICAgICAgICAgICAgc192UHJvYmVDaGFubmVsKHBEZXZpY2UpOwogICAgICAgICAgICAgICAgICAgICBzcGluX3VubG9ja19pcnEoJnBEZXZpY2UtPmxvY2spOwotCQkgICAgIHZDb21tYW5kVGltZXJXYWl0KChIQU5ETEUpcERldmljZSwgMTAwKTsKKwkJICAgICB2Q29tbWFuZFRpbWVyV2FpdCgodm9pZCAqKSBwRGV2aWNlLCAxMDApOwogICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgc3Bpbl91bmxvY2tfaXJxKCZwRGV2aWNlLT5sb2NrKTsKLSAgICAgICAgICAgICAgICAgICAgdkNvbW1hbmRUaW1lcldhaXQoKEhBTkRMRSlwRGV2aWNlLCBXQ01EX1BBU1NJVkVfU0NBTl9USU1FKTsKKwkJICAgIHZDb21tYW5kVGltZXJXYWl0KCh2b2lkICopIHBEZXZpY2UsIFdDTURfUEFTU0lWRV9TQ0FOX1RJTUUpOwogICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgfQogCkBAIC01NTIsNyArNTM0LDExIEBACiAKICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPIlNlbmQgRGlzYXNzb2NpYXRpb24gUGFja2V0Li5cbiIpOwogICAgICAgICAgICAgICAgIC8vIHJlYXNvbiA9IDggOiBkaXNhc3NvYyBiZWNhdXNlIHN0YSBoYXMgbGVmdAotICAgICAgICAgICAgICAgIHZNZ3JEaXNhc3NvY0JlZ2luU3RhKChIQU5ETEUpcERldmljZSwgcE1nbXQsIHBNZ210LT5hYnlDdXJyQlNTSUQsICg4KSwgJlN0YXR1cyk7CisJCXZNZ3JEaXNhc3NvY0JlZ2luU3RhKCh2b2lkICopIHBEZXZpY2UsCisJCQkJICAgICBwTWdtdCwKKwkJCQkgICAgIHBNZ210LT5hYnlDdXJyQlNTSUQsCisJCQkJICAgICAoOCksCisJCQkJICAgICAmU3RhdHVzKTsKICAgICAgICAgICAgICAgICBwRGV2aWNlLT5iTGlua1Bhc3MgPSBGQUxTRTsKICAgICAgICAgICAgICAgICBDb250cm9sdk1hc2tCeXRlKHBEZXZpY2UsTUVTU0FHRV9SRVFVRVNUX01BQ1JFRyxNQUNfUkVHX1BBUEVERUxBWSxMRURTVFNfU1RTLExFRFNUU19TTE9XKTsKICAgICAgICAgICAgICAgICAvLyB1bmxvY2sgY29tbWFuZCBidXN5CkBAIC02MTQsMjIgKzYwMCwyNiBAQAogICAgICAgICAgICAgLy8gc2V0IGluaXRpYWwgc3RhdGUKICAgICAgICAgICAgIHBNZ210LT5lQ3VyclN0YXRlID0gV01BQ19TVEFURV9JRExFOwogICAgICAgICAgICAgcE1nbXQtPmVDdXJyTW9kZSA9IFdNQUNfTU9ERV9TVEFOREJZOwotICAgICAgICAgICAgUFN2RGlzYWJsZVBvd2VyU2F2aW5nKChIQU5ETEUpcERldmljZSk7CisJICAgIFBTdkRpc2FibGVQb3dlclNhdmluZygodm9pZCAqKSBwRGV2aWNlKTsKICAgICAgICAgICAgIEJTU3ZDbGVhck5vZGVEQlRhYmxlKHBEZXZpY2UsIDApOwotICAgICAgICAgICAgdk1nckpvaW5CU1NCZWdpbigoSEFORExFKXBEZXZpY2UsICZTdGF0dXMpO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gJlN0YXR1cyk7CiAgICAgICAgICAgICAgICAgaWYgKFN0YXR1cyA9PSBDTURfU1RBVFVTX1NVQ0NFU1MpIHsKIAkJICAgcERldmljZS0+YnlMaW5rV2FpdENvdW50ID0gMDsKICAgICAgICAgICAgICAgICAgICAgcERldmljZS0+ZUNvbW1hbmRTdGF0ZSA9IFdMQU5fQVVUSEVOVElDQVRFX1dBSVQ7Ci0gICAgICAgICAgICAgICAgICAgIHZDb21tYW5kVGltZXJXYWl0KChIQU5ETEUpcERldmljZSwgQVVUSEVOVElDQVRFX1RJTUVPVVQpOworCQkgICAgdkNvbW1hbmRUaW1lcldhaXQoKHZvaWQgKikgcERldmljZSwgQVVUSEVOVElDQVRFX1RJTUVPVVQpOwogICAgICAgICAgICAgICAgICAgICBzcGluX3VubG9ja19pcnEoJnBEZXZpY2UtPmxvY2spOwogICAgICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPIiBTZXQgZUNvbW1hbmRTdGF0ZSA9IFdMQU5fQVVUSEVOVElDQVRFX1dBSVRcbiIpOwogICAgICAgICAgICAgICAgICAgICByZXR1cm47CkBAIC02NDgsMTAgKzYzOCwxMiBAQAogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgLy8gc3RhcnQgb3duIElCU1MKLSAgICAgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyAiQ3JlYXRlT3duIElCU1MgYnkgQ3Vyck1vZGUgPSBJQlNTX1NUQSBcbiIpOwotICAgICAgICAgICAgICAgICAgICB2TWdyQ3JlYXRlT3duSUJTUygoSEFORExFKXBEZXZpY2UsICZTdGF0dXMpOworCQkgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsCisJCQkgICAgS0VSTl9JTkZPICJDcmVhdGVPd24gSUJTUyBieSBDdXJyTW9kZSA9IElCU1NfU1RBXG4iKTsKKwkJICAgIHZNZ3JDcmVhdGVPd25JQlNTKCh2b2lkICopIHBEZXZpY2UsICZTdGF0dXMpOwogICAgICAgICAgICAgICAgICAgICBpZiAoU3RhdHVzICE9IENNRF9TVEFUVVNfU1VDQ0VTUyl7Ci0gICAgICAgICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPICIgV0xBTl9DTURfSUJTU19DUkVBVEUgZmFpbCAhIFxuIik7CisJCQlEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywKKwkJCQlLRVJOX0lORk8gIldMQU5fQ01EX0lCU1NfQ1JFQVRFIGZhaWwhXG4iKTsKICAgICAgICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgICAgICAgQlNTdkFkZE11bHRpY2FzdE5vZGUocERldmljZSk7CiAgICAgICAgICAgICAgICAgfQpAQCAtNjYyLDEwICs2NTQsMTIgQEAKICAgICAgICAgICAgICAgICBpZiAocE1nbXQtPmVDb25maWdNb2RlID09IFdNQUNfQ09ORklHX0lCU1NfU1RBIHx8CiAgICAgICAgICAgICAgICAgICAgIHBNZ210LT5lQ29uZmlnTW9kZSA9PSBXTUFDX0NPTkZJR19BVVRPKSB7CiAgICAgICAgICAgICAgICAgICAgIC8vIHN0YXJ0IG93biBJQlNTCi0gICAgICAgICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8gIkNyZWF0ZU93biBJQlNTIGJ5IEN1cnJNb2RlID0gU1RBTkRCWSBcbiIpOwotICAgICAgICAgICAgICAgICAgICB2TWdyQ3JlYXRlT3duSUJTUygoSEFORExFKXBEZXZpY2UsICZTdGF0dXMpOworCQkJREJHX1BSVChNU0dfTEVWRUxfREVCVUcsCisJCQkJS0VSTl9JTkZPICJDcmVhdGVPd24gSUJTUyBieSBDdXJyTW9kZSA9IFNUQU5EQllcbiIpOworCQkgICAgdk1nckNyZWF0ZU93bklCU1MoKHZvaWQgKikgcERldmljZSwgJlN0YXR1cyk7CiAgICAgICAgICAgICAgICAgICAgIGlmIChTdGF0dXMgIT0gQ01EX1NUQVRVU19TVUNDRVNTKXsKLSAgICAgICAgICAgICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8iIFdMQU5fQ01EX0lCU1NfQ1JFQVRFIGZhaWwgISBcbiIpOworCQkJREJHX1BSVChNU0dfTEVWRUxfREVCVUcsCisJCQkJS0VSTl9JTkZPICJXTEFOX0NNRF9JQlNTX0NSRUFURSBmYWlsIVxuIik7CiAgICAgICAgICAgICAgICAgICAgIH07CiAgICAgICAgICAgICAgICAgICAgIEJTU3ZBZGRNdWx0aWNhc3ROb2RlKHBEZXZpY2UpOwogICAgICAgICAgICAgICAgICAgICBzX2JDbGVhckJTU0lEX1NDQU4ocERldmljZSk7CkBAIC03MDEsMTIgKzY5NSwxMiBAQAogCQlwRGV2aWNlLT5ieUxpbmtXYWl0Q291bnQgPSAwOwogICAgICAgICAgICAgICAgIC8vIENhbGwgbWdyIHRvIGJlZ2luIHRoZSBhc3NvY2lhdGlvbgogICAgICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8iZUN1cnJTdGF0ZSA9PSBXTUFDX1NUQVRFX0FVVEhcbiIpOwotICAgICAgICAgICAgICAgIHZNZ3JBc3NvY0JlZ2luU3RhKChIQU5ETEUpcERldmljZSwgcE1nbXQsICZTdGF0dXMpOworCQl2TWdyQXNzb2NCZWdpblN0YSgodm9pZCAqKSBwRGV2aWNlLCBwTWdtdCwgJlN0YXR1cyk7CiAgICAgICAgICAgICAgICAgaWYgKFN0YXR1cyA9PSBDTURfU1RBVFVTX1NVQ0NFU1MpIHsKICAgICAgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyJlQ29tbWFuZFN0YXRlID0gV0xBTl9BU1NPQ0lBVEVfV0FJVFxuIik7CiAJCSAgcERldmljZS0+YnlMaW5rV2FpdENvdW50ID0gMDsKICAgICAgICAgICAgICAgICAgICAgcERldmljZS0+ZUNvbW1hbmRTdGF0ZSA9IFdMQU5fQVNTT0NJQVRFX1dBSVQ7Ci0gICAgICAgICAgICAgICAgICAgIHZDb21tYW5kVGltZXJXYWl0KChIQU5ETEUpcERldmljZSwgQVNTT0NJQVRFX1RJTUVPVVQpOworCQkgICAgdkNvbW1hbmRUaW1lcldhaXQoKHZvaWQgKikgcERldmljZSwgQVNTT0NJQVRFX1RJTUVPVVQpOwogICAgICAgICAgICAgICAgICAgICBzcGluX3VubG9ja19pcnEoJnBEZXZpY2UtPmxvY2spOwogICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgfQpAQCAtNzE4LDcgKzcxMiw3IEBACiAgICAgICAgICAgICAgICAgcERldmljZS0+YnlMaW5rV2FpdENvdW50ICsrOwogCSAgICAgICBwcmludGsoIldMQU5fQVVUSEVOVElDQVRFX1dBSVQ6d2FpdCAlZCB0aW1lcyEhXG4iLHBEZXZpY2UtPmJ5TGlua1dhaXRDb3VudCk7CiAJICAgICAgIHNwaW5fdW5sb2NrX2lycSgmcERldmljZS0+bG9jayk7Ci0JICAgICAgIHZDb21tYW5kVGltZXJXYWl0KChIQU5ETEUpcERldmljZSwgQVVUSEVOVElDQVRFX1RJTUVPVVQvMik7CisJICAgICAgIHZDb21tYW5kVGltZXJXYWl0KCh2b2lkICopIHBEZXZpY2UsIEFVVEhFTlRJQ0FURV9USU1FT1VULzIpOwogCSAgICAgICByZXR1cm47CiAJICAgfQogCSAgICAgICAgICBwRGV2aWNlLT5ieUxpbmtXYWl0Q291bnQgPSAwOwpAQCAtNzQyLDcgKzczNiw4IEBACiAgICAgICAgICAgICBpZiAocE1nbXQtPmVDdXJyU3RhdGUgPT0gV01BQ19TVEFURV9BU1NPQykgewogICAgICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8iZUN1cnJTdGF0ZSA9PSBXTUFDX1NUQVRFX0FTU09DXG4iKTsKICAgICAgICAgICAgICAgICBpZiAocERldmljZS0+ZVBTTW9kZSAhPSBXTUFDX1BPV0VSX0NBTSkgewotICAgICAgICAgICAgICAgICAgICBQU3ZFbmFibGVQb3dlclNhdmluZygoSEFORExFKXBEZXZpY2UsIHBNZ210LT53TGlzdGVuSW50ZXJ2YWwpOworCQkJUFN2RW5hYmxlUG93ZXJTYXZpbmcoKHZvaWQgKikgcERldmljZSwKKwkJCQkJICAgICBwTWdtdC0+d0xpc3RlbkludGVydmFsKTsKICAgICAgICAgICAgICAgICB9CiAvKgogICAgICAgICAgICAgICAgIGlmIChwTWdtdC0+ZUF1dGhlbk1vZGUgPj0gV01BQ19BVVRIX1dQQSkgewpAQCAtNzY1LDcgKzc2MCw3IEBACiAgICAgICAgICAgICAgICAgICAgICAvLyBwcmludGsoIlJlLWluaXRpYWwgVHhEYXRhVGltZXIqKioqXG4iKTsKIAkJICAgIGRlbF90aW1lcigmcERldmljZS0+c1RpbWVyVHhEYXRhKTsKICAgICAgICAgICAgICAgICAgICAgICBpbml0X3RpbWVyKCZwRGV2aWNlLT5zVGltZXJUeERhdGEpOwotICAgICAgICAgICAgICAgICAgICAgIHBEZXZpY2UtPnNUaW1lclR4RGF0YS5kYXRhID0gKFVMT05HKXBEZXZpY2U7CisJCQlwRGV2aWNlLT5zVGltZXJUeERhdGEuZGF0YSA9ICh1bnNpZ25lZCBsb25nKSBwRGV2aWNlOwogICAgICAgICAgICAgICAgICAgICAgIHBEZXZpY2UtPnNUaW1lclR4RGF0YS5mdW5jdGlvbiA9IChUaW1lckZ1bmN0aW9uKUJTU3ZTZWNvbmRUeERhdGE7CiAgICAgICAgICAgICAgICAgICAgICAgcERldmljZS0+c1RpbWVyVHhEYXRhLmV4cGlyZXMgPSBSVU5fQVQoMTAqSFopOyAgICAgIC8vMTBzIGNhbGxiYWNrCiAgICAgICAgICAgICAgICAgICAgICA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lEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywKKwkJCQlLRVJOX0lORk8gInZNZ3JDcmVhdGVPd25JQlNTIGZhaWwhXG4iKTsKICAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICAgICAgIC8vIGFsd2F5IHR1cm4gb2ZmIHVuaWNhc3QgYml0CiAgICAgICAgICAgICAgICAgTUFDdlJlZ0JpdHNPZmYocERldmljZSwgTUFDX1JFR19SQ1IsIFJDUl9VTklDQVNUKTsKQEAgLTk0OCw3ICs5NDQsMTEgQEAKIAogCSAgaWYgKHBEZXZpY2UtPmJMaW5rUGFzcyA9PSBUUlVFKSB7CiAgICAgICAgICAgICAgICAgLy8gcmVhc29uID0gOCA6IGRpc2Fzc29jIGJlY2F1c2Ugc3RhIGhhcyBsZWZ0Ci0gICAgICAgICAgICAgICAgICAgICAgIHZNZ3JEaXNhc3NvY0JlZ2luU3RhKChIQU5ETEUpcERldmljZSwgcE1nbXQsIHBNZ210LT5hYnlDdXJyQlNTSUQsICg4KSwgJlN0YXR1cyk7CisJCXZNZ3JEaXNhc3NvY0JlZ2luU3RhKCh2b2lkICopIHBEZXZpY2UsCisJCQkJICAgICBwTWdtdCwKKwkJCQkgICAgIHBNZ210LT5hYnlDdXJyQlNTSUQsCisJCQkJICAgICAoOCksCisJCQkJICAgICAmU3RhdHVzKTsKICAgICAgICAgICAgICAgICAgICAgICAgcERldmljZS0+YkxpbmtQYXNzID0gRkFMU0U7CiAgICAgICAgICAgICAgICAgLy8gdW5sb2NrIGNvbW1hbmQgYnVzeQogICAgICAgICAgICAgICAgICAgICAgICAgcE1nbXQtPmVDdXJyU3RhdGUgPSBXTUFDX1NUQVRFX0lETEU7CkBAIC0xMTg1LDE4ICsxMTg1LDE1IEBACiAgICAgICAgICAgICAgICAgYnJlYWs7CiAKICAgICAgICAgfQotCi0gICAgICAgIHZDb21tYW5kVGltZXJXYWl0KChIQU5ETEUpcERldmljZSwgMCk7CisJdkNvbW1hbmRUaW1lcldhaXQoKHZvaWQgKikgcERldmljZSwgMCk7CiAgICAgfQogCiAgICAgcmV0dXJuIFRSVUU7CiB9CiAKLUJPT0wgYlNjaGVkdWxlQ29tbWFuZCAoCi0gICAgSU4gSEFORExFIGhEZXZpY2VDb250ZXh0LAotICAgIElOIENNRF9DT0RFICAgIGVDb21tYW5kLAotICAgIElOIFBCWVRFICAgICAgIHBieUl0ZW0wCi0gICAgKQorQk9PTCBiU2NoZWR1bGVDb21tYW5kKHZvaWQgKmhEZXZpY2VDb250ZXh0LAorCQkgICAgICBDTURfQ09ERSBlQ29tbWFuZCwKKwkJICAgICAgUEJZVEUgcGJ5SXRlbTApCiB7CiAgICAgUFNEZXZpY2UgICAgICAgIHBEZXZpY2UgPSAoUFNEZXZpY2UpaERldmljZUNvbnRleHQ7CiAKQEAgLTEyNjQsMTQgKzEyNjEsMTEgQEAKICAqIFJldHVybiBWYWx1ZTogVFJVRSBpZiBzdWNjZXNzOyBvdGhlcndpc2UgRkFMU0UKICAqCiAgKi8KLXN0YXRpYwotQk9PTCBzX2JDbGVhckJTU0lEX1NDQU4gKAotICAgIElOIEhBTkRMRSBoRGV2aWNlQ29udGV4dAotICAgICkKK3N0YXRpYyBCT09MIHNfYkNsZWFyQlNTSURfU0NBTih2b2lkICpoRGV2aWNlQ29udGV4dCkKIHsKICAgICBQU0RldmljZSAgICAgICAgcERldmljZSA9IChQU0RldmljZSloRGV2aWNlQ29udGV4dDsKLSAgICBVSU5UICAgICAgICAgICAgdUNtZERlcXVldWVJZHggPSBwRGV2aWNlLT51Q21kRGVxdWV1ZUlkeDsKLSAgICBVSU5UICAgICAgICAgICAgaWk7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgdUNtZERlcXVldWVJZHggPSBwRGV2aWNlLT51Q21kRGVxdWV1ZUlkeDsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICBpaTsKIAogICAgIGlmICgocERldmljZS0+Y2JGcmVlQ21kUXVldWUgPCBDTURfUV9TSVpFKSAm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XVlc3QvcmVzcG9uc2UgZnVuY3Rpb25zCiBzdGF0aWMKLVZPSUQKK3ZvaWQKIHNfdk1nclJ4UHJvYmVSZXF1ZXN0KAotICAgIElOIFBTRGV2aWNlIHBEZXZpY2UsCi0gICAgSU4gUFNNZ210T2JqZWN0IHBNZ210LAotICAgIElOIFBTUnhNZ210UGFja2V0IHBSeFBhY2tldAorICAgICBQU0RldmljZSBwRGV2aWNlLAorICAgICBQU01nbXRPYmplY3QgcE1nbXQsCisgICAgIFBTUnhNZ210UGFja2V0IHBSeFBhY2tldAogICAgICk7CiAKIHN0YXRpYwotVk9JRAordm9pZAogc192TWdyUnhQcm9iZVJlc3BvbnNlKAotICAgIElOIFBTRGV2aWNlIHBEZXZpY2UsCi0gICAgSU4gUFNNZ210T2JqZWN0IHBNZ210LAotICAgIElOIFBTUnhNZ210UGFja2V0IHBSeFBhY2tldAorICAgICBQU0RldmljZSBwRGV2aWNlLAorICAgICBQU01nbXRPYmplY3QgcE1nbXQsCisgICAgIFBTUnhNZ210UGFja2V0IHBSeFBhY2tldAogICAgICk7CiAKIC8vIGJlYWNvbiBmdW5jdGlvbnMKIHN0YXRpYwotVk9JRAordm9pZAogc192TWdyUnhCZWFjb24oCi0gICAgSU4gUFNEZXZpY2UgcERldmljZSwKLSAgICBJTiBQU01nbXRPYmplY3QgcE1nbXQsCi0gICAgSU4gUFNSeE1nbXRQYWNrZXQgcFJ4UGFja2V0LAotICAgIElOIEJPT0wgYkluU2NhbgorICAgICBQU0RldmljZSBwRGV2aWNlLAorICAgICBQU01nbXRPYmplY3QgcE1nbXQsCisgICAgIFBTUnhNZ210UGFja2V0IHBSeFBhY2tldCwKKyAgICAgQk9PTCBiSW5TY2FuCiAgICAgKTsKIAogc3RhdGljCi1WT0lECit2b2lkCiBzX3ZNZ3JGb3JtYXRUSU0oCi0gICAgSU4gUFNNZ210T2JqZWN0IHBNZ210LAotICAgIElOIFBXTEFOX0lFX1RJTSBwVElNCisgICAgIFBTTWdtdE9i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UQgcEN1cnJTU0lELAorICAgICBQQllURSBwQ3VyckJTU0lELAorICAgICBQV0xBTl9JRV9TVVBQX1JBVEVTIHBDdXJyU3VwcFJhdGVzLAorICAgICBQV0xBTl9JRV9TVVBQX1JBVEVTIHBDdXJyRXh0U3VwcFJhdGVzLAorICAgICBCWVRFIGJ5UEhZVHlwZQogICAgICk7CiAKIC8vIHJlY2VpdmVkIHN0YXR1cwogc3RhdGljCi1WT0lECit2b2lkCiBzX3ZNZ3JMb2dTdGF0dXMoCi0gICAgSU4gUFNNZ210T2JqZWN0IHBNZ210LAotICAgIElOIFdPUkQgd1N0YXR1cworICAgICBQU01nbXRPYmplY3QgcE1nbXQsCisgICAgIFdPUkQgd1N0YXR1cwogICAgICk7CiAKIAogc3RhdGljCi1WT0lECit2b2lkCiBzX3ZNZ3JTeW5jaEJTUyAoCi0gICAgSU4gUFNEZXZpY2UgICAgICBwRGV2aWNlLAotICAgIElOIFVJTlQgICAgICAgICAgdUJTU01vZGUsCi0gICAgSU4gUEtub3duQlNTICAgICBwQ3VyciwKLSAgICBPVVQgUENNRF9TVEFUVVMgIHBTdGF0dXMKKyAgICAgUFNEZXZpY2UgICAgICBwRGV2aWNlLAorICAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgdUJTU01vZGUsCisgICAgIFBLbm93bkJTUyAgICAgcEN1cnIsCisgICAgIFBDTURfU1RBVFVTICBwU3RhdHVzCiAgICAgKTsKIAogCiBzdGF0aWMgQk9PTAogc19iQ2lwaGVyTWF0Y2ggKAotICAgIElOIFBLbm93bkJTUyAgICAgICAgICAgICAgICAgICAgICAgIHBCU1NOb2RlLAotICAgIElOIE5ESVNfODAyXzExX0VOQ1JZUFRJT05fU1RBVFVTICAgIEVuY1N0YXR1cywKLSAgICBPVVQgUEJZVEUgICAgICAgICAgICAgICAgICAgICAgICAgICBwYnlDQ1NQSywKLSAgICBPVVQgUEJZVEUgICAgICAgICAgICAgICAgICAgICAgICAgICBwYnlDQ1NHSworICAgICBQS25vd25CU1MgICAgICAgICAgICAgICAgICAgICAgICBwQlNTTm9kZSwKKyAgICAgTkRJU184MDJfMTFfRU5DUllQVElPTl9TVEFUVVMgICAgRW5jU3RhdHVzLAorICAgICBQQllURSAgICAgICAgICAgICAgICAgICAgICAgICAgIHBieUNDU1BLLAorICAgICBQQllURSAgICAgICAgICAgICAgICAgICAgICAgICAgIHBieUNDU0dLCiAgICAgKTsKIAotIHN0YXRpYyBWT0lEICBFbmN5cHRpb25fUmVidWlsZCgKLSAgICBJTiBQU0RldmljZSBwRGV2aWNlLAotICAgIElOIFBLbm93bkJTUyBwQ3VycgorIHN0YXRpYyB2b2lkICBFbmN5cHRpb25fUmVidWlsZCgKKyAgICAgUFNEZXZpY2UgcERldmljZSwKKyAgICAgUEtub3duQlNTIHBDdXJyCiAgKTsKIAotCi0KIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tICBFeHBvcnQgVmFyaWFibGVzICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCiAKLQogLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0gIEV4cG9ydCBGdW5jdGlvbnMgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KIAotCiAvKisKICAqCiAgKiBSb3V0aW5lIERlc2NyaXB0aW9uOgpAQCAtMzQ3LDEwICszNDMsNyBAQAogICoKIC0qLwogCi1WT0lECi12TWdyT2JqZWN0SW5pdCgKLSAgICBJTiAgSEFORExFIGhEZXZpY2VDb250ZXh0Ci0gICAgKQordm9pZCB2TWdyT2JqZWN0SW5pdCh2b2lkICpoRGV2aWNlQ29udGV4dCkKIHsKICAgICBQU0RldmljZSAgICAgcERldmljZSA9IChQU0RldmljZSloRGV2aWNlQ29udGV4dDsKICAgICBQU01nbXRPYmplY3QgICAgcE1nbXQgPSAmKHBEZXZpY2UtPnNNZ210T2JqKTsKQEAgLTM2OCwyMiArMzYxLDIyIEBACiAgICAgcE1nbXQtPmJ5Q1NTUEsgPSBLRVlfQ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ZXN0KAotICAgIElOIFBTRGV2aWNlIHBEZXZpY2UsCi0gICAgSU4gUFNNZ210T2JqZWN0IHBNZ210LAotICAgIElOIFBTUnhNZ210UGFja2V0IHBSeFBhY2tldCwKLSAgICBJTiBVSU5UIHVOb2RlSW5kZXgKKyAgICAgUFNEZXZpY2UgcERldmljZSwKKyAgICAgUFNNZ210T2JqZWN0IHBNZ210LAorICAgICBQU1J4TWdtdFBhY2tldCBwUnhQYWNrZXQsCisgICAgIHVuc2lnbmVkIGludCB1Tm9kZUluZGV4CiAgICAgKQogewogICAgIFdMQU5fRlJfQVNTT0NSRVEgICAgc0ZyYW1lOwpAQCAtNjQ2LDcgKzYyNyw3IEBACiAgICAgUFNUeE1nbXRQYWNrZXQgICAgICBwVHhQYWNrZXQ7CiAgICAgV09SRCAgICAgICAgICAgICAgICB3QXNzb2NTdGF0dXMgPSAwOwogICAgIFdPUkQgICAgICAgICAgICAgICAgd0Fzc29jQUlEID0gMDsKLSAgICBVSU5UICAgICAgICAgICAgICAgIHVSYXRlTGVuID0gV0xBTl9SQVRFU19NQVhMRU47CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgIHVSYXRlTGVuID0gV0xBTl9SQVRFU19NQVhMRU47CiAgICAgQllURSAgICAgICAgICAgICAgICBhYnlDdXJyU3VwcFJhdGVzW1dMQU5fSUVIRFJfTEVOICsgV0xBTl9SQVRFU19NQVhMRU4gKyAxXTsKICAgICBCWVRFICAgICAgICAgICAgICAgIGFieUN1cnJFeHRTdXBwUmF0ZXNbV0xBTl9JRUhEUl9MRU4gKyBXTEFOX1JBVEVTX01BWExFTiArIDFdOwogCkBAIC02OTEsNyArNjcyLDcgQEAKICAgICAgICAgfQogCiAKLSAgICAgICAgUkFURXZQYXJzZU1heFJhdGUoKFBWT0lEKXBEZXZpY2UsCisJUkFURXZQYXJzZU1heFJhdGUoKHZvaWQgKilwRGV2aWNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgKFBXTEFOX0lFX1NVUFBfUkFURVMpYWJ5Q3VyclN1cHBSYXRlcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgIChQV0xBTl9JRV9TVVBQX1JBVEVTKWFieUN1cnJFeHRTdXBwUmF0ZXMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBGQUxTRSwgLy8gZG8gbm90IGNoYW5nZSBvdXIgYmFzaWMgcmF0ZQpAQCAtNzg5LDEyICs3NzAsMTIgQEAKIC0qLwogCiBzdGF0aWMKLVZPSUQKK3ZvaWQKIHNfdk1nclJ4UmVBc3NvY1JlcXVlc3QoCi0gICAgSU4gUFNEZXZpY2UgcERldmljZSwKLSAgICBJTiBQU01nbXRPYmplY3QgcE1nbXQsCi0gICAgSU4gUFNSeE1nbXRQYWNrZXQgcFJ4UGFja2V0LAotICAgIElOIFVJTlQgdU5vZGVJbmRleAorICAgICBQU0RldmljZSBwRGV2aWNlLAorICAgICBQU01nbXRPYmplY3QgcE1nbXQsCisgICAgIFBTUnhNZ210UGFja2V0IHBSeFBhY2tldCwKKyAgICAgdW5zaWduZWQgaW50IHVOb2RlSW5kZXgKICAgICApCiB7CiAgICAgV0xBTl9GUl9SRUFTU09DUkVRICAgIHNGcmFtZTsKQEAgLTgwMiw3ICs3ODMsNyBAQAogICAgIFBTVHhNZ210UGFja2V0ICAgICAgcFR4UGFja2V0OwogICAgIFdPUkQgICAgICAgICAgICAgICAgd0Fzc29jU3RhdHVzID0gMDsKICAgICBXT1JEICAgICAgICAgICAgICAgIHdBc3NvY0FJRCA9IDA7Ci0gICAgVUlOVCAgICAgICAgICAgICAgICB1UmF0ZUxlbiA9IFdMQU5fUkFURVNfTUFYTEVOOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgICAgICB1UmF0ZUxlbiA9IFdMQU5fUkFURVNfTUFYTEVOOwogICAgIEJZVEUgICAgICAgICAgICAgICAgYWJ5Q3VyclN1cHBSYXRlc1tXTEFOX0lFSERSX0xFTiArIFdMQU5fUkFURVNfTUFYTEVOICsgMV07CiAgICAgQllURSAgICAgICAgICAgICAgICBhYnlDdXJyRXh0U3VwcFJhdGVzW1dMQU5fSUVIRFJfTEVOICsgV0xBTl9SQVRFU19NQVhMRU4gKyAxXTsKIApAQCAtODQ0LDcgKzgyNSw3IEBACiAgICAgICAgIH0KIAogCi0gICAgICAgIFJBVEV2UGFyc2VNYXhSYXRlKChQVk9JRClwRGV2aWNlLAorCVJBVEV2UGFyc2VNYXhSYXRlKCh2b2lkICopcERldmljZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgKFBXTEFOX0lFX1NVUFBfUkFURVMpYWJ5Q3VyclN1cHBSYXRlcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgKFBXTEFOX0lFX1NVUFBfUkFURVMpYWJ5Q3VyckV4dFN1cHBSYXRlcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZBTFNFLCAvLyBkbyBub3QgY2hhbmdlIG91ciBiYXNpYyByYXRlCkBAIC05MzYsMTIgKzkxNywxMiBAQAogLSovCiAKIHN0YXRpYwotVk9JRAordm9pZAogc192TWdyUnhBc3NvY1Jlc3BvbnNlKAotICAgIElOIFBTRGV2aWNlIHBEZXZpY2UsCi0gICAgSU4gUFNNZ210T2JqZWN0IHBNZ210LAotICAgIElOIFBTUnhNZ210UGFja2V0IHBSeFBhY2tldCwKLSAgICBJTiBCT09MIGJSZUFzc29jVHlwZQorICAgICBQU0RldmljZSBwRGV2aWNlLAorICAgICBQU01nbXRPYmplY3QgcE1nbXQsCisgICAgIFBTUnhNZ210UGFja2V0IHBSeFBhY2tldCwKKyAgICAgQk9PTCBiUmVBc3NvY1R5cGUKICAgICApCiB7CiAgICAgV0xBTl9GUl9BU1NPQ1JFU1AgICBzRnJhbWU7CkBAIC05NTgsMTIgKzkzOSwxMiBAQAogICAgICAgICBzRnJhbWUucEJ1ZiA9IChQQllURSlwUnhQYWNrZXQtPnA4MDIxMUhlYWRlcjsKICAgICAgICAgLy8gZGVjb2RlIHRoZSBmcmFtZQogICAg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NvbW1hbmRTdGF0ZSA9PSBXTEFOX0FVVEhFTlRJQ0FURV9XQUlUICkgewotLy8gICAgICAgICAgICAgICAgc3Bpbl91bmxvY2tfaXJxKCZwRGV2aWNlLT5sb2NrKTsKLS8vICAgICAgICAgICAgICAgIHZDb21tYW5kVGltZXJXYWl0KChIQU5ETEUpcERldmljZSwgMCk7Ci0vLyAgICAgICAgICAgICAgICBzcGluX2xvY2tfaXJxKCZwRGV2aWNlLT5sb2NrKTsKKwkgICAgaWYgKHBEZXZpY2UtPmVDb21tYW5kU3RhdGUgPT0gV0xBTl9BVVRIRU5USUNBVEVfV0FJVCkgeworCQkvKiBzcGluX3VubG9ja19pcnEoJnBEZXZpY2UtPmxvY2spOworCQkgICB2Q29tbWFuZFRpbWVyV2FpdCgodm9pZCAqKSBwRGV2aWNlLCAwKTsKKwkJICAgc3Bpbl9sb2NrX2lycSgmcERldmljZS0+bG9jayk7ICovCiAgICAgICAgICAgICB9Ci0KICAgICAgICAgICAgIGJyZWFrOwogCiAgICAgICAgIGNhc2UgV0xBTl9BVVRIX0FMR19TSEFSRURLRVk6CkBAIC0xNDUzLDkgKzE0MjYsOSBAQAogICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAJREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyAiTWd0OnJ4IEF1dGhfcmVwbHkgc2VxdWVuY2VfMiBzdGF0dXMgZXJyb3IgLi4uXG4iKTsKICAgICAgICAgICAgICAgICBpZiAoIHBEZXZpY2UtPmVDb21tYW5kU3RhdGUgPT0gV0xBTl9BVVRIRU5USUNBVEVfV0FJVCApIHsKLS8vICAgICAgICAgICAgICAgICAgICBzcGluX3VubG9ja19pcnEoJnBEZXZpY2UtPmxvY2spOwotLy8gICAgICAgICAgICAgICAgICAgIHZDb21tYW5kVGltZXJXYWl0KChIQU5ETEUpcERldmljZSwgMCk7Ci0vLyAgICAgICAgICAgICAgICAgICAgc3Bpbl9sb2NrX2lycSgmcERldmlj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EBACiAtKi8KIAogc3RhdGljCi1WT0lECit2b2lkCiBzX3ZNZ3JSeEJlYWNvbigKLSAgICBJTiBQU0RldmljZSBwRGV2aWNlLAotICAgIElOIFBTTWdtdE9iamVjdCBwTWdtdCwKLSAgICBJTiBQU1J4TWdtdFBhY2tldCBwUnhQYWNrZXQsCi0gICAgSU4gQk9PTCBiSW5TY2FuCisgICAgIFBTRGV2aWNlIHBEZXZpY2UsCisgICAgIFBTTWdtdE9iamVjdCBwTWdtdCwKKyAgICAgUFNSeE1nbXRQYWNrZXQgcFJ4UGFja2V0LAorICAgICBCT09MIGJJblNjYW4KICAgICApCiB7CiAKQEAgLTE4NDUsMTcgKzE4MTcsMTcgQEAKICAgICBCT09MICAgICAgICAgICAgICAgIGJVcGRhdGVUU0YgPSBGQUxTRTsKICAgICBCT09MICAgICAgICAgICAgICAgIGJJc0FQQmVhY29uID0gRkFMU0U7CiAgICAgQk9PTCAgICAgICAgICAgICAgICBiSXNDaGFubmVsRXF1YWwgPSBGQUxTRTsKLSAgICBVSU5UICAgICAgICAgICAgICAgIHVMb2NhdGVCeXRlSW5kZXg7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgIHVMb2NhdGVCeXRlSW5kZXg7CiAgICAgQllURSAgICAgICAgICAgICAgICBieVRJTUJpdE9uID0gMDsKICAgICBXT1JEICAgICAgICAgICAgICAgIHdBSUROdW1iZXIgPSAwOwotICAgIFVJTlQgICAgICAgICAgICAgICAgdU5vZGVJbmRleDsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICAgICAgdU5vZGVJbmRleDsKICAgICBRV09SRCAgICAgICAgICAgICAgIHF3VGltZXN0YW1wLCBxd0xvY2FsVFNGOwogICAgIFFXT1JEICAgICAgICAgICAgICAgcXdDdXJyVFNGOwogICAgIFdPUkQgICAgICAgICAgICAgICAgd1N0YXJ0SW5kZXggPSAwOwogICAgIFdPUkQgICAgICAgICAgICAgICAgd0FJREluZGV4ID0gMDsKICAgICBCWV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ICAgICAgICAgICAgICAgICAgICAgICAgICBzRnJhbWUucEhkci0+c0E0LmFieUFkZHI0LCAgIC8vIHBheWxvYWQgb2YgYmVhY29uCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKEhBTkRMRSlwUnhQYWNrZXQKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICk7CisJCQkgICAgKHZvaWQgKikgcFJ4UGFja2V0KTsKICAgICB9CiAgICAgZWxzZSB7CiAvLyAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyJ1cGRhdGUgYmNuOiBSeENoYW5uZWwgPSA6ICVkXG4iLCBieUN1cnJDaGFubmVsKTsKLSAgICAgICAgQlNTYlVwZGF0ZVRvQlNTTGlzdCgoSEFORExFKXBEZXZpY2UsCisJQlNTYlVwZGF0ZVRvQlNTTGlzdCgodm9pZCAqKSBwRGV2aWNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICpzRnJhbWUucHF3VGltZXN0YW1wLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICpzRnJhbWUucHdCZWFjb25JbnRlcnZhbCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqc0ZyYW1lLnB3Q2FwSW5mbywKQEAgLTE5NTQsOCArMTkyNyw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEJTU0xpc3QsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc0ZyYW1lLmxlbiAtIFdMQU5fSERSX0FERFIzX0xFTiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzRnJhbWUucEhkci0+c0E0LmFieUFkZHI0LCAgIC8vIHBheWxvYWQgb2YgcHJvYnJlc3BvbnNlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKEhBTkRMRSlwUnhQYWNrZXQKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICk7CisJCQkgICAgKHZvaWQgKikgcFJ4UGFja2V0KTsKIAogICAgIH0KIApAQCAtMjA4OSw3ICsyMDYxLDcgQEAKICAgICAgICAgICAgIHBNZ210LT5hYnlDdXJyRXh0U3VwcFJhdGVzWzFdID0gUkFURXVTZXRJRSgoUFdMQU5fSUVfU1VQUF9SQVRFUylwQlNTTGlzdC0+YWJ5RXh0U3VwcFJhdGVzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChQV0xBTl9JRV9TVVBQX1JBVEVTKXBNZ210LT5hYnlDdXJyRXh0U3VwcFJhdGVzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVSYXRlTGVuKTsKLSAgICAgICAgICAgIFJBVEV2UGFyc2VNYXhSYXRlKCAoUFZPSUQpcERldmljZSwKKwkgICAgUkFURXZQYXJzZU1heFJhdGUoKHZvaWQgKilwRGV2aWNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChQV0xBTl9JRV9TVVBQX1JBVEVTKXBNZ210LT5hYnlDdXJyU3VwcFJhdGVzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChQV0xBTl9JRV9TVVBQX1JBVEVTKXBNZ210LT5hYnlDdXJyRXh0U3VwcFJhdGVzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRSVUUsCkBAIC0yMTUyLDkgKzIxMjQsOSBAQAogICAgICAgICBpZiAoYlRTRkxhcmdlRGlmZikKICAgICAgICAgICAgIGJVcGRhdGVUU0YgPSBUUlVFOwogCi0gICAgICAgIGlmICgocERldmljZS0+YkVuYWJsZVBTTW9kZSA9PSBUUlVFKSAmJihzRnJhbWUucFRJTSAhPSAwKSkgeworCWlmICgocERldmljZS0+YkVuYWJsZVBTTW9kZSA9PSBUUlVFKSAmJiAoc0ZyYW1lLnBUSU0pKSB7CiAKLSAgICAgICAgICAgIC8vIGRlYWwgd2l0aCBEVElNLCBhbmFseXNpcyBUSU0KKwkJLyogZGVhbCB3aXRoIERUSU0sIGFuYWx5c2lzIFRJTSAqLwogICAgICAgICAgICAgcE1nbXQtPmJNdWx0aWNhc3RUSU0gPSBXTEFOX01HTVRfSVNfTVVMVElDQVNUX1RJTShzRnJhbWUucFRJTS0+YnlCaXRNYXBDdGwpID8gVFJVRSA6IEZBTFNFIDsKICAgICAgICAgICAgIHBNZ210LT5ieURUSU1Db3VudCA9IHNGcmFtZS5wVElNLT5ieURUSU1Db3VudDsKICAgICAgICAgICAgIHBNZ210LT5ieURUSU1QZXJpb2QgPSBzRnJhbWUucFRJTS0+YnlEVElNUGVyaW9kOwpAQCAtMjIyNyw3ICsyMTk5LDcgQEAKICAgICAgICAgICAgICAgICBwTWdtdC0+YWJ5Q3VyclN1cHBSYXRlc1sxXSA9IFJBVEV1U2V0SUUoKFBXTEFOX0lFX1NVUFBfUkFURVMpc0ZyYW1lLnBTdXBwUmF0ZXMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChQV0xBTl9JRV9TVVBQX1JBVEVTKXBNZ210LT5hYnlDdXJyU3VwcFJhdGVzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOX1JBVEVTX01BWExFTl8xMUIpOwotICAgICAgICAgICAgICAgIFJBVEV2UGFyc2VNYXhSYXRlKCAoUFZPSUQpcERldmljZSwKKwkJUkFURXZQYXJzZU1heFJhdGUoKHZvaWQgKilwRGV2aWNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoUFdMQU5fSUVfU1VQUF9SQVRFUylwTWdtdC0+YWJ5Q3VyclN1cHBSYXRlcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVFJVRSwKQEAgLTIyNDgsNyArMjIyMCw3IEBACiAgICAgICAgICAgICAgICAgcE1nbXQtPmFieUN1cnJTdXBwUmF0ZXNbMV0gPSBSQVRFdVNldElFKChQV0xBTl9JRV9TVVBQX1JBVEVTKXNGcmFtZS5wU3VwcFJhdGVzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoUFdMQU5fSUVfU1VQUF9SQVRFUylwTWdtdC0+YWJ5Q3VyclN1cHBSYXRlcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTl9SQVRFU19NQVhMRU5fMTFCKTsKLSAgICAgICAgICAgICAgICBSQVRFdlBhcnNlTWF4UmF0ZSggKFBWT0lEKXBEZXZpY2UsCisJCVJBVEV2UGFyc2VNYXhSYXRlKCh2b2lkICopcERldmljZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFBXTEFOX0lFX1NVUFBfUkFURVMpcE1nbXQtPmFieUN1cnJTdXBwUmF0ZXMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRSVUUsCkBAIC0yMzI0LDcgKzIyOTYsNyBAQAogICAgICAgICAgICAgICAgICAgICAgLy8gc2V0IGhpZ2hlc3QgYmFzaWMgcmF0ZQogICAgICAgICAgICAgICAgICAgICAgLy8gc192U2V0SGlnaGVzdEJhc2ljUmF0ZShwRGV2aWNlLCAoUFdMQU5fSUVfU1VQUF9SQVRFUylwTWdtdC0+YWJ5Q3VyclN1cHBSYXRlcyk7CiAgICAgICAgICAgICAgICAgICAgICAvLyBQcmVwYXJlIGJlYWNvbiBmcmFtZQotICAgICAgICAgICAgICAgICAgICAgYk1nclByZXBhcmVCZWFjb25Ub1NlbmQoKEhBTkRMRSlwRGV2aWNlLCBwTWdtdCk7CisJCQliTWdyUHJlcGFyZUJlYWNvblRvU2VuZCgodm9pZCAqKSBwRGV2aWNlLCBwTWdtdCk7CiAgICAgICAgICAgICAgIC8vICB9CiAgICAgICAgICAgICB9OwogICAgICAgICB9CkBAIC0yMzQxLDggKzIzMTMsNiBAQAogICAgIHJldHVybjsKIH0KIAotCi0KIC8qKwogICoKICAqIFJvdXRpbmUgRGVzY3JpcHRpb246CkBAIC0yMzU1LDExICsyMzI1LDkgQEAKICAqICAgIENNRF9TVEFUVVMKICAqCiAtKi8KLVZPSUQKLXZNZ3JDcmVhdGVPd25JQlNTKAotICAgIElOICBIQU5ETEUgaERldmljZUNvbnRleHQsCi0gICAgT1VUIFBDTURfU1RBVFVTIHBTdGF0dXMKLSAgICApCisKK3ZvaWQgdk1nckNyZWF0ZU93bklCU1Modm9pZCAqaERldmljZUNvbnRleHQsCisJCSAgICAgICBQQ01EX1NUQVRVUyBwU3RhdHVzKQogewogICAgIFBTRGV2aWNlICAgICAgICAgICAgcERldmljZSA9IChQU0RldmljZSloRGV2aWNlQ29udGV4dDsKICAgICBQU01nbXRPYmplY3QgICAgICAgIHBNZ210ID0gJihwRGV2aWNlLT5zTWdtdE9iaik7CkBAIC0yMzY4LDcgKzIzMzYsNyBAQAogICAgIEJZVEUgICAgICAgICAgICAgICAgYnlUb3BDQ0tCYXNpY1JhdGU7CiAgICAgQllURSAgICAgICAgICAgICAgICBieVRvcE9GRE1CYXNpY1JhdGU7CiAgICAgUVdPUkQgICAgICAgICAgICAgICBxd0N1cnJUU0Y7Ci0gICAgVUlOVCAgICAgICAgICAgICAgICBpaTsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICAgICAgaWk7CiAgICAgQllURSAgICBhYnlSQVRFW10gPSB7MHg4MiwgMHg4NCwgMHg4QiwgMHg5NiwgMHgyNCwgMHgzMCwgMHg0OCwgMHg2QywgMHgwQywgMHgxMiwgMHgxOCwgMHg2MH07CiAgICAgQllURSAgICBhYnlDQ0tfUkFURVtdID0gezB4ODIsIDB4ODQsIDB4OEIsIDB4OTZ9OwogICAgIEJZVEUgICAgYWJ5T0ZETV9SQVRFW10gPSB7MHgwQywgMHgxMiwgMHgxOCwgMHgyNCwgMHgzMCwgMH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B0aW9uOgpAQCAtMjYyOSwyMSArMjU5NiwxNiBAQAogICoKIC0qLwogCi1WT0lECi12TWdySm9pbkJTU0JlZ2luKAotICAgIElOICBIQU5ETEUgaERldmljZUNvbnRleHQsCi0gICAgT1VUIFBDTURfU1RBVFVTIHBTdGF0dXMKLSAgICApCit2b2lkIHZNZ3JKb2luQlNTQmVnaW4odm9pZCAqaERldmljZUNvbnRleHQsIFBDTURfU1RBVFVTIHBTdGF0dXMpCiB7Ci0KICAgICBQU0RldmljZSAgICAgcERldmljZSA9IChQU0RldmljZSloRGV2aWNlQ29udGV4dDsKICAgICBQU01nbXRPYmplY3QgICAgcE1nbXQgPSAmKHBEZXZpY2UtPnNNZ210T2JqKTsKICAgICBQS25vd25CU1MgICAgICAgcEN1cnIgPSBOVUxMOwotICAgIFVJTlQgICAgICAgICAgICBpaSwgdXU7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgaWksIHV1OwogICAgIFBXTEFOX0lFX1NVUFBfUkFURVMgcEl0ZW1SYXRlcyA9IE5VTEw7CiAgICAgUFdMQU5fSUVfU1VQUF9SQVRFUyBwSXRlbUV4dFJhdGVzID0gTlVMTDsKICAgICBQV0xBTl9JRV9TU0lEICAgcEl0ZW1TU0lEOwotICAgIFVJTlQgICAgICAgICAgICB1UmF0ZUxlbiA9IFdMQU5fUkFURVNfTUFYTEVOOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgIHVSYXRlTGVuID0gV0xBTl9SQVRFU19NQVhMRU47CiAgICAgV09SRCAgICAgICAgICAgIHdNYXhCYXNpY1JhdGUgPSBSQVRFXzFNOwogICAgIFdPUkQgICAgICAgICAgICB3TWF4U3VwcFJhdGUgPSBSQVRFXzFNOwogICAgIFdPUkQgICAgICAgICAgICB3U3VwcFJhdGU7CkBAIC0yNzQzLDkgKzI3MDUsMTAgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdVJhdGVMZW4pOwogICAgICAgICAgICAgLy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WRhdGU6IDRcbiIpOwotICAgICAgICAgICAgICAgICAgICBiQWRkX1BNS0lEX0NhbmRpZGF0ZSgoSEFORExFKXBEZXZpY2UsIHBNZ210LT5hYnlDdXJyQlNTSUQsICZwQ3Vyci0+c1JTTkNhcE9iaik7CisJCQl2Rmx1c2hfUE1LSURfQ2FuZGlkYXRlKCh2b2lkICopIHBEZXZpY2UpOworCQkJREJHX1BSVChNU0dfTEVWRUxfREVCVUcsCisJCQkJS0VSTl9JTkZPICJ2Rmx1c2hfUE1LSURfQ2FuZGlkYXRlOiA0XG4iKTsKKwkJCWJBZGRfUE1LSURfQ2FuZGlkYXRlKCh2b2lkICopIHBEZXZpY2UsCisJCQkJCSAgICAgcE1nbXQtPmFieUN1cnJCU1NJRCwKKwkJCQkJICAgICAmcEN1cnItPnNSU05DYXBPYmopOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KIApAQCAtMjg5OSw3ICsyODY3LDggQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoUFdMQU5fSUVfU1VQUF9SQVRFUylwTWdtdC0+YWJ5Q3VyclN1cHBSYXRlcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOX1JBVEVTX01BWExFTl8xMUIpOwogICAgICAgICAgICAgLy8gc2V0IGJhc2ljIHJhdGUKLSAgICAgICAgICAgIFJBVEV2UGFyc2VNYXhSYXRlKChQVk9JRClwRGV2aWNlLCAoUFdMQU5fSUVfU1VQUF9SQVRFUylwTWdtdC0+YWJ5Q3VyclN1cHBSYXRlcywKKwkgICAgUkFURXZQYXJzZU1heFJhdGUoKHZvaWQgKilwRGV2aWNlLAorCQkJICAgICAgKFBXTEFOX0lFX1NVUFBfUkFURVMpcE1nbXQtPmFieUN1cnJTdXBwUmF0ZXMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLCBUUlVFLCAmd01heEJhc2ljUmF0ZSwgJndNYXhTdXBwUmF0ZSwgJndTdXBwUmF0ZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZieVRvcENDS0Jhc2ljUmF0ZSwgJmJ5VG9wT0ZETUJhc2ljUmF0ZSk7CiAgICAgICAgICAgICB2VXBkYXRlSUZTKHBEZXZpY2UpOwpAQCAtMjkzOCw3ICsyOTA3LDcgQEAKICAgICAgICAgICAgIENBUkR2U2V0UlNQSU5GKHBEZXZpY2UsIChCWVRFKXBEZXZpY2UtPmJ5QkJUeXBlKTsKIAogICAgICAgICAgICAgLy8gUHJlcGFyZSBiZWFjb24KLSAgICAgICAgICAgIGJNZ3JQcmVwYXJlQmVhY29uVG9TZW5kKChIQU5ETEUpcERldmljZSwgcE1nbXQpOworCQliTWdyUHJlcGFyZUJlYWNvblRvU2VuZCgodm9pZCAqKSBwRGV2aWNlLCBwTWdtdCk7CiAgICAgICAgIH0KICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICBwTWdtdC0+ZUN1cnJTdGF0ZSA9IFdNQUNfU1RBVEVfSURMRTsKQEAgLTI5NjAsMTIgKzI5MjksMTIgQEAKICAqCiAtKi8KIHN0YXRpYwotVk9JRAordm9pZAogc192TWdyU3luY2hCU1MgKAotICAgIElOIFBTRGV2aWNlICAgICAgcERldmljZSwKLSAgICBJTiBVSU5UICAgICAgICAgIHVCU1NNb2RlLAotICAgIElOIFBLbm93bkJTUyAgICAgcEN1cnIsCi0gICAgT1VUIFBDTURfU1RBVFVTICBwU3RhdHVzCisgICAgIFBTRGV2aWNlICAgICAgcERldmljZSwKKyAgICAgdW5zaWduZWQgaW50ICAgICAgICAgIHVCU1NNb2RlLAorICAgICBQS25vd25CU1MgICAgIHBDdXJyLAorICAgICBQQ01EX1NUQVRVUyAgcFN0YXR1cwogICAgICkKIHsKICAgICBQU01nbXRPYmplY3QgIHBNZ210ID0gJihwRGV2aWNlLT5zTWdtdE9iaik7CkBAIC0zMDA0LDcgKzI5NzMsNyBAQAog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AgIFBCWVRFIHBEQWRkciwKKyAgICAgV09SRCB3Q3VyckNhcEluZm8sCisgICAgIFdPUkQgd0xpc3RlbkludGVydmFsLAorICAgICBQV0xBTl9JRV9TU0lEIHBDdXJyU1NJRCwKKyAgICAgUFdMQU5fSUVfU1VQUF9SQVRFUyBwQ3VyclJhdGVzLAorICAgICBQV0xBTl9JRV9TVVBQX1JBVEVTIHBDdXJyRXh0U3VwcFJhdGVzCiAgICAgKQogewogICAgIFBTVHhNZ210UGFja2V0ICAgICAgcFR4UGFja2V0ID0gTlVMTDsKQEAgLTM3MDQsNyArMzY3Myw3IEBACiAgICAgfSBlbHNlIGlmICgoKHBNZ210LT5lQXV0aGVuTW9kZSA9PSBXTUFDX0FVVEhfV1BBMikgfHwKICAgICAgICAgICAgICAgICAocE1nbXQtPmVBdXRoZW5Nb2RlID09IFdNQUNfQVVUSF9XUEEyUFNLKSkgJiYKICAgICAgICAgICAgICAgIChwTWdtdC0+cEN1cnJCU1MgIT0gTlVMTCkpIHsKLSAgICAgICAgVUlOVCAgICAgICAgICAgICAgICBpaTsKKwl1bnNpZ25lZCBpbnQgaWk7CiAgICAgICAgIFBXT1JEICAgICAgICAgICAgICAgcHdQTUtJRDsKIAogICAgICAgICAvLyBXUEEgSUUKQEAgLTM3NzMsMTMgKzM3NDIsMTcgQEAKICAgICAgICAgICAgIHB3UE1LSUQgPSAoUFdPUkQpcGJ5UlNOOyAvLyBQb2ludCB0byBQTUtJRCBjb3VudAogICAgICAgICAgICAgKnB3UE1LSUQgPSAwOyAgICAgICAgICAgIC8vIEluaXRpYWxpemUgUE1LSUQgY291bnQKICAgICAgICAgICAgIHBieVJTTiArPSAyOyAgICAgICAgICAgICAvLyBQb2ludCB0byBQTUtJRCBsaXN0Ci0gICAgICAgICAgICBmb3IgKGlpID0gMDsgaWkgPCBwRGV2aWNlLT5nc1BNS0lELkJTU0lESW5mb0NvdW50OyBpaSsrKSB7Ci0gICAgICAgICAgICAgICAgaWYgKCAhbWVtY21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GNvdW50CiAgICAgICAgICAgICBwYnlSU04gKz0gMjsgICAgICAgICAgICAgLy8gUG9pbnQgdG8gUE1LSUQgbGlzdAogICAgICAgICAgICAgZm9yIChpaSA9IDA7IGlpIDwgcERldmljZS0+Z3NQTUtJRC5CU1NJREluZm9Db3VudDsgaWkrKykgewotICAgICAgICAgICAgICAgIGlmICggIW1lbWNtcCgmcERldmljZS0+Z3NQTUtJRC5CU1NJREluZm9baWldLkJTU0lEWzBdLCBwTWdtdC0+YWJ5Q3VyckJTU0lELCBVX0VUSEVSX0FERFJfTEVOKSkgewotICAgICAgICAgICAgICAgICAgICAoKnB3UE1LSUQpICsrOwotICAgICAgICAgICAgICAgICAgICBtZW1jcHkocGJ5UlNOLCBwRGV2aWNlLT5nc1BNS0lELkJTU0lESW5mb1tpaV0uUE1LSUQsIDE2KTsKLSAgICAgICAgICAgICAgICAgICAgcGJ5UlNOICs9IDE2OworCQlpZiAoIW1lbWNtcCgmcERldmljZS0+Z3NQTUtJRC5CU1NJREluZm9baWldLkJTU0lEWzBdLAorCQkJICAgIHBNZ210LT5hYnlDdXJyQlNTSUQsCisJCQkgICAgRVRIX0FMRU4pKSB7CisJCQkoKnB3UE1LSUQpKys7CisJCQltZW1jcHkocGJ5UlNOLAorCQkJICAgICAgIHBEZXZpY2UtPmdzUE1LSUQuQlNTSURJbmZvW2lpXS5QTUtJRCwKKwkJCSAgICAgICAxNik7CisJCQlwYnlSU04gKz0gMTY7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICAgICAgaWYgKCpwd1BNS0lEICE9IDApIHsKQEAgLTQwNTcsOCArNDAzNCw2IEBACiAgICAgcmV0dXJuIHBUeFBhY2tldDsKIH0KIAotCi0KIC8qKwogICoKICAqIFJvdXRpbmUgRGVzY3JpcHRpb246CkBAIC00MDcwLDE3ICs0MDQ1LDE2IEBACiAgKgogLSovCiAKLQogUFNUeE1nbXRQYWNrZXQKIHNfTWdyTWFrZUFzc29jUmVzcG9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AgICAgKnNGcmFtZS5wd0JlYWNvbkludGVydmFsLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICpzRnJhbWUucHdDYXBJbmZvLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5Q3VyckNoYW5uZWwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYkNoYW5uZWxIaXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc0ZyYW1lLnBTU0lELAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNGcmFtZS5wU3VwcFJhdGVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNGcmFtZS5wRXh0U3VwcFJhdGVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICZzRVJQLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNGcmFtZS5wUlNOLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNGcmFtZS5wUlNOV1BBLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNGcmFtZS5wSUVfQ291bnRyeSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzRnJhbWUucElFX1F1aWV0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBCU1NMaXN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNGcmFtZS5sZW4gLSBXTEFOX0hEUl9BRERSM19MRU4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc0ZyYW1lLnBIZHItPnNBNC5hYnlBZGRyNCwgICAvLyBwYXlsb2FkIG9mIHByb2JyZXNwb25zZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIChIQU5ETEUpcFJ4UGFja2V0Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICApOwotICAgIH0KLSAgICBlbHNlIHsKKwlCU1NiVXBkYXRlVG9CU1NMaXN0KCh2b2lkICopIHBEZXZpY2UsCisJCQkgICAgKnNGcmFtZS5wcXdUaW1lc3RhbXAsCisJCQkgICAgKnNGcmFtZS5wd0JlYWNvbkludGVydmFsLAorCQkJICAgICpzRnJhbWUucHdDYXBJbmZvLAorCQkJICAgIGJ5Q3VyckNoYW5uZWwsCisJCQkgICAgYkNoYW5uZWxIaXQsCisJCQkgICAgc0ZyYW1lLnBTU0lELAorCQkJICAgIHNGcmFtZS5wU3VwcFJhdGVzLAorCQkJICAgIHNGcmFtZS5wRXh0U3VwcFJhdGVzLAorCQkJICAgICZzRVJQLAorCQkJICAgIHNGcmFtZS5wUlNOLAorCQkJICAgIHNGcmFtZS5wUlNOV1BBLAorCQkJICAgIHNGcmFtZS5wSUVfQ291bnRyeSwKKwkJCSAgICBzRnJhbWUucElFX1F1aWV0LAorCQkJICAgIHBCU1NMaXN0LAorCQkJICAgIHNGcmFtZS5sZW4gLSBXTEFOX0hEUl9BRERSM19MRU4sCisJCQkgICAgLyogcGF5bG9hZCBvZiBwcm9icmVzcG9uc2UgKi8KKwkJCSAgICBzRnJhbWUucEhkci0+c0E0LmFieUFkZHI0LAorCQkJICAgICh2b2lkICopIHBSeFBhY2tldCk7CisgICAgfSBlbHNlIHsKICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyJQcm9iZSByZXNwL2luc2VydDogUnhDaGFubmVsID0gOiAlZFxuIiwgYnlDdXJyQ2hhbm5lbCk7Ci0gICAgICAgIEJTU2JJbnNlcnRUb0JTU0xpc3QoKEhBTkRMRSlwRGV2aWNlLAorCUJTU2JJbnNlcnRUb0JTU0xpc3QoKHZvaWQgKikgcERldmljZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzRnJhbWUucEhkci0+c0EzLmFieUFkZHIzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICpzRnJhbWUucHF3VGltZXN0YW1wLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICpzRnJhbWUucHdCZWFjb25JbnRlcnZhbCwKQEAgLTQzMjgsOSArNDMwNiw4IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc0ZyYW1lLnBJRV9Db3VudHJ5LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNGcmFtZS5wSUVfUXVpZXQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc0ZyYW1lLmxlbiAtIFdMQU5fSERSX0FERFIzX0xFTiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzRnJhbWUucEhkci0+c0E0LmFieUFkZHI0LCAgIC8vIHBheWxvYWQgb2YgYmVhY29uCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKEhBTkRMRSlwUnhQYWNrZXQKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICk7CisJCQkgICAgc0ZyYW1lLnBIZHItPnNBNC5hYnlBZGRyNCwgICAvKiBwYXlsb2FkIG9mIGJlYWNvbiAqLworCQkJICAgICh2b2lkICopIHBSeFBhY2tldCk7CiAgICAgfQogICAgIHJldHVybjsKIApAQCAtNDM0OSwxMSArNDMyNiwxMSBAQAogCiAKIHN0YXRpYwotVk9JRAordm9pZAogc192TWdyUnhQcm9iZVJlcXVlc3QoCi0gICAgSU4gUFNEZXZpY2UgcERldmljZSwKLSAgICBJTiBQU01nbXRPYmplY3QgcE1nbXQsCi0gICAgSU4gUFNSeE1nbXRQYWNrZXQgcFJ4UGFja2V0CisgICAgIFBTRGV2aWNlIHBEZXZpY2UsCisgICAgIFBTTWdtdE9iamVjdCBwTWdtdCwKKyAgICAgUFNSeE1nbXRQYWNrZXQgcFJ4UGFja2V0CiAgICAgKQogewogICAgIFdMQU5fRlJfUFJPQkVSRVEgICAgc0ZyYW1lOwpAQCAtNDQyNiwxMCArNDQwMyw2IEBACiAgICAgcmV0dXJuOwogfQogCi0KLQotCi0KIC8qKwogICoKICAqIFJvdXRpbmUgRGVzY3JpcHRpb246CkBAIC00NDQ0LDE3ICs0NDE3LDEzIEBACiAgKgogLSovCiAKLQotVk9JRAotdk1nclJ4TWFuYWdlUGFja2V0KAotICAgIElOICBIQU5ETEUgaERldmljZUNvbnRleHQsCi0gICAgSU4gUFNNZ210T2JqZWN0IHBNZ210LAotICAgIElOIFBTUnhNZ210UGFja2V0IHBSeFBhY2tldAotICAgICApCit2b2lkIHZNZ3JSeE1hbmFnZVBhY2tldCh2b2lkICpoRGV2aWNlQ29udGV4dCwKKwkJCVBTTWdtdE9iamVjdCBwTWdtdCwKKwkJCVBTUnhNZ210UGFja2V0IHBSeFBhY2tldCkKIHsKICAgICBQU0RldmljZSAgICBwRGV2aWNlID0gKFBTRGV2aWNlKWhEZXZpY2VDb250ZXh0OwogICAgIEJPT0wgICAgICAgIGJJblNjYW4gPSBGQUxTRTsKLSAgICBVSU5UICAgICAgICB1Tm9kZUluZGV4ID0gMDsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgIHVOb2RlSW5kZXggPSAwOwogICAgIE5PREVfU1RBVEUgIGVOb2RlU3RhdGUgPSAwOwogICAgIENNRF9TVEFUVVMgIFN0YXR1czsKIApAQCAtNDU4Myw5ICs0NTUyLDYgQEAKICAgICByZXR1cm47CiB9CiAKLQotCi0KIC8qKwogICoKICAqIFJvdXRpbmUgRGVzY3JpcHRpb246CkBAIC00NTk3LDExICs0NTYzLDcgQEAKICAqICAgIFRSVUUgaWYgc3VjY2VzczsgRkFMU0UgaWYgZmFpbGVkLgogICoKIC0qLwotQk9PTAotYk1nclByZXBhcmVCZWFjb25Ub1NlbmQoCi0gICAgSU4gSEFORExFIGhEZXZpY2VDb250ZXh0LAotICAgIElOIFBTTWdtdE9iamVjdCBwTWdtdAotICAgICkKK0JPT0wgYk1nclByZXBhcmVCZWFjb25Ub1NlbmQodm9pZCAqaERldmljZUNvbnRleHQsIFBTTWdtdE9iamVjdCBwTWdtdCkKIHsKICAgICBQU0RldmljZSAgICAgICAgICAgIHBEZXZpY2UgPSAoUFNEZXZpY2UpaERldmljZUNvbnRleHQ7CiAgICAgUFNUeE1nbXRQYWNrZXQgICAgICBwVHhQYWNrZXQ7CkBAIC00NjUzLDEwICs0NjE1LDEwIEBACiAgKgogLSovCiBzdGF0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4dDsKIApAQCAtNDc5OCwxMCArNDc1OCwxMCBAQAogCiBzdGF0aWMgQk9PTAogc19iQ2lwaGVyTWF0Y2ggKAotICAgIElOIFBLbm93bkJTUyAgICAgICAgICAgICAgICAgICAgICAgIHBCU1NOb2RlLAotICAgIElOIE5ESVNfODAyXzExX0VOQ1JZUFRJT05fU1RBVFVTICAgIEVuY1N0YXR1cywKLSAgICBPVVQgUEJZVEUgICAgICAgICAgICAgICAgICAgICAgICAgICBwYnlDQ1NQSywKLSAgICBPVVQgUEJZVEUgICAgICAgICAgICAgICAgICAgICAgICAgICBwYnlDQ1NHSworICAgICBQS25vd25CU1MgICAgICAgICAgICAgICAgICAgICAgICBwQlNTTm9kZSwKKyAgICAgTkRJU184MDJfMTFfRU5DUllQVElPTl9TVEFUVVMgICAgRW5jU3RhdHVzLAorICAgICBQQllURSAgICAgICAgICAgICAgICAgICAgICAgICAgIHBieUNDU1BLLAorICAgICBQQllURSAgICAgICAgICAgICAgICAgICAgICAgICAgIHBieUNDU0dLCiAgICAgKQogewogICAgIEJZVEUgYnlNdWx0aWNhc3RDaXBoZXIgPSBLRVlfQ1RMX0lOVkFMSUQ7CmRpZmYgLS1naXQgYS9kcml2ZXJzL3N0YWdpbmcvdnQ2NjU2L3dtZ3IuaCBiL2RyaXZlcnMvc3RhZ2luZy92dDY2NTYvd21nci5oCmluZGV4IGM2ODJhN2YuLjFlNWI5MTYgMTAwNjQ0Ci0tLSBhL2RyaXZlcnMvc3RhZ2luZy92dDY2NTYvd21nci5oCisrKyBiL2RyaXZlcnMvc3RhZ2luZy92dDY2NTYvd21nci5oCkBAIC04NCwzNyArODQsMzcgQEAKIC8vbWlrZSBkZWZpbmU6IG1ha2UgdGltZXIgIHRvIGV4cGlyZSBhZnRlciBkZXNpcmVkIHRpbWVzCiAjZGVmaW5lIHRpbWVyX2V4cGlyZSh0aW1lcixuZXh0X3RpY2spICAgbW9kX3RpbWVyKCZ0aW1lciwgUlVOX0FUKG5leHRfdGljaykpC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kcgICAgICAgICAgICAgICAgICAgTGVuZ3RoOwotICAgIFVTSE9SVCAgICAgICAgICAgICAgICAgIEF2YWlsYWJsZVJlcXVlc3RGaXhlZElFczsKKyAgICB1bnNpZ25lZCBsb25nICAgICAgICAgICAgICAgICAgIExlbmd0aDsKKyAgICB1bnNpZ25lZCBzaG9ydCAgICAgICAgICAgICAgICAgIEF2YWlsYWJsZVJlcXVlc3RGaXhlZElFczsKICAgICBORElTXzgwMl8xMV9BSV9SRVFGSSAgICBSZXF1ZXN0Rml4ZWRJRXM7Ci0gICAgVUxPTkcgICAgICAgICAgICAgICAgICAgUmVxdWVzdElFTGVuZ3RoOwotICAgIFVMT05HICAgICAgICAgICAgICAgICAgIE9mZnNldFJlcXVlc3RJRXM7Ci0gICAgVVNIT1JUICAgICAgICAgICAgICAgICAgQXZhaWxhYmxlUmVzcG9uc2VGaXhlZElFczsKKyAgICB1bnNpZ25lZCBsb25nICAgICAgICAgICAgICAgICAgIFJlcXVlc3RJRUxlbmd0aDsKKyAgICB1bnNpZ25lZCBsb25nICAgICAgICAgICAgICAgICAgIE9mZnNldFJlcXVlc3RJRXM7CisgICAgdW5zaWduZWQgc2hvcnQgICAgICAgICAgICAgICAgICBBdmFpbGFibGVSZXNwb25zZUZpeGVkSUVzOwogICAgIE5ESVNfODAyXzExX0FJX1JFU0ZJICAgIFJlc3BvbnNlRml4ZWRJRXM7Ci0gICAgVUxPTkcgICAgICAgICAgICAgICAgICAgUmVzcG9uc2VJRUxlbmd0aDsKLSAgICBVTE9ORyAgICAgICAgICAgICAgICAgICBPZmZzZXRSZXNwb25zZUlFczsKKyAgICB1bnNpZ25lZCBsb25nICAgICAgICAgICAgICAgICAgIFJlc3BvbnNlSUVMZW5ndGg7CisgICAgdW5zaWduZWQgbG9uZyAgICAgICAgICAgICAgICAgICBPZmZzZXRSZXNwb25zZUlFczsKIH0gTkRJU184MDJfMTFfQVNTT0NJQVRJT05fSU5GT1JNQVRJT04sICpQTkRJU184MDJfMTFfQVNTT0NJQVRJT05fSU5GT1JNQVRJT047CiAKIApAQCAtMTIzLDcgKzEyMyw3IEBACiAgICAgTkRJU184MDJfMTFfQVNTT0NJQVRJT05fSU5GT1JNQVRJT04gICAgIEFzc29jSW5mbzsKICAgICBCWVRFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWJ5SUVzW1dMQU5fQkVBQ09OX0ZSX01BWExFTitXTEFOX0JFQUNPTl9GUl9NQVhMRU5dOwogICAgIC8vIHN0b3JlIFJlcUlFcyBzZXQgYnkgT0lEXzgwMl8xMV9BU1NPQ0lBVElPTl9JTkZPUk1BVElPTgotICAgIFVMT05HICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXF1ZXN0SUVMZW5ndGg7CisgICAgdW5zaWduZWQgbG9uZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVxdWVzdElFTGVuZ3RoOwogICAgIEJZVEUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhYnlSZXFJRXNbV0xBTl9CRUFDT05fRlJfTUFYTEVOXTsKIH0gU0Fzc29jSW5mbywgKlBTQXNzb2NJbmZvOwogLy8tLS0KQEAgLTIyMiw4ICsyMjIsOCBAQAogdHlwZWRlZiBzdHJ1Y3QgdGFnU1R4TWdtdFBhY2tldCB7CiAKICAgICBQVVdMQU5fODAyMTFIRFIgICAgIHA4MDIxMUhlYWRlcjsKLSAgICBVSU5UICAgICAgICAgICAgICAgIGNiTVBEVUxlbjsKLSAgICBVSU5UICAgICAgICAgICAgICAgIGNiUGF5bG9hZExlbjsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICAgICAgY2JNUERVTGVuOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgICAgICBjYlBheWxvYWRMZW47CiAKIH0gU1R4TWdtdFBhY2tldCwgKlBTVHhNZ210UGFja2V0OwogCkBAIC0yMzMsOSArMjMzLDkgQEAKIAogICAgIFBVV0xBTl84MDIxMUhEUiAgICAgcDgwMjExSGVhZGVyOwogICAgIFFXT1JEICAgICAgICAgICAgICAgcXdMb2NhbFRTRjsKLSAgICBVSU5UICAgICAgICAgICAgICAgIGNiTVBEVUxlbjsKLSAgICBVSU5UICAgICAgICAgICAgICAgIGNiUGF5bG9hZExlbjsKLSAgICBVSU5UICAgICAgICAgICAgICAgIHVSU1NJOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgICAgICBjYk1QRFVMZW47CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgIGNiUGF5bG9hZExlbjsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICAgICAgdVJTU0k7CiAgICAgQllURSAgICAgICAgICAgICAgICBieVNROwogICAgIEJZVEUgICAgICAgICAgICAgICAgYnlSeFJhdGU7CiAgICAgQllURSAgICAgICAgICAgICAgICBieVJ4Q2hhbm5lbDsKQEAgLTI0Niw4ICsyNDYsNyBAQAogCiB0eXBlZGVmIHN0cnVjdCB0YWdTTWdtdE9iamVjdAogewotCi0gICAgUFZPSUQgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXI7CisJdm9pZCAqcEFkYXB0ZXI7CiAgICAgLy8gTUFDIGFkZHJlc3MKICAgICBCWVRFICAgICAgICAgICAgICAgICAgICBhYnlNQUNBZGRyW1dMQU5fQUREUl9MRU5dOwogCkBAIC0yNzMsMjEgKzI3MiwyMSBAQAogICAgIEJPT0wgICAgICAgICAgICAgICAgICAgIGJDdXJyQlNTSURGaWx0ZXJPbjsKIAogICAgIC8vIEN1cnJlbnQgc3RhdGUgdmFycwotICAgIFVJTlQgICAgICAgICAgICAgICAgICAgIHVDdXJyQ2hhbm5lbDsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICAgICAgICAgIHVDdXJyQ2hhbm5lbDsKICAgICBCWVRFICAgICAgICAgICAgICAgICAgICBhYnlDdXJyU3VwcFJhdGVzW1dMQU5fSUVIRFJfTEVOICsgV0xBTl9SQVRFU19NQVhMRU4gKyAxXTsKICAgICBCWVRFICAgICAgICAgICAgICAgICAgICBhYnlDdXJyRXh0U3VwcFJhdGVzW1dMQU5fSUVIRFJfTEVOICsgV0xBTl9SQVRFU19NQVhMRU4gKyAxXTsKICAgICBCWVRFICAgICAgICAgICAgICAgICAgICBhYnlDdXJyU1NJRFtXTEFOX0lFSERSX0xFTiArIFdMQU5fU1NJRF9NQVhMRU4gKyAxXTsKICAgICBCWVRFICAgICAgICAgICAgICAgICAgICBhYnlDdXJyQlNTSURbV0xBTl9CU1NJRF9MRU5dOwogICAgIFdPUkQgICAgICAgICAgICAgICAgICAgIHdDdXJyQ2FwSW5mbzsKICAgICBXT1JEICAgICAgICAgICAgICAgICAgICB3Q3VyckFJRDsKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICB1UlNTSVRyaWdnZXI7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgICAgICB1UlNTSVRyaWdnZXI7CiAgICAgV09SRCAgICAgICAgICAgICAgICAgICAgd0N1cnJBVElNV2luZG93OwogICAgIFdPUkQgICAgICAgICAgICAgICAgICAgIHdDdXJyQmVhY29uUGVyaW9kOwogICAgIEJPT0wgICAgICAgICAgICAgICAgICAgIGJJc0RTOwogICAgIEJZVEUgICAgICAgICAgICAgICAgICAgIGJ5RVJQQ29udGV4dDsKIAogICAgIENNRF9TVEFURSAgICAgICAgICAgICAgIGVDb21tYW5kU3RhdGU7Ci0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgdVNjYW5DaGFubmVsOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgICAgICAgICAgdVNjYW5DaGFubmVsOwogCiAgICAgLy8gRGVzaXJlIGpvaW5uaW5nIEJTUyB2YXJzCiAgICAgQllURSAgICAgICAgICAgICAgICAgICAgYWJ5RGVzaXJlU1NJRFtXTEFOX0lFSERSX0xFTiArIFdMQU5fU1NJRF9NQVhMRU4gKyAxXTsKQEAgLTMwMiwyMiArMzAxLDIyIEBACiAgICAgLy8gQWRob2Mgb3IgQVAgY29uZmlndXJhdGlvbiB2YXJzCiAgICAgV09SRCAgICAgICAgICAgICAgICAgICAgd0lCU1NCZWFjb25QZXJpb2Q7CiAgICAgV09SRCAgICAgICAgICAgICAgICAgICAgd0lCU1NBVElNV2luZG93OwotICAgIFVJTlQgICAgICAgICAgICAgICAgICAgIHVJQlNTQ2hhbm5lbDsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICAgICAgICAgIHVJQlNTQ2hhbm5lbDsKICAgICBCWVRFICAgICAgICAgICAgICAgICAgICBhYnlJQlNTU3VwcFJhdGVzW1dMQU5fSUVIRFJfTEVOICsgV0xBTl9SQVRFU19NQVhMRU4gKyAxXTsKICAgICBCWVRFICAgICAgICAgICAgICAgICAgICBieUFQQkJUeXBlOwogICAgIEJZVEUgICAgICAgICAgICAgICAgICAgIGFieVdQQUlFW01BWF9XUEFfSUVfTEVOXTsKICAgICBXT1JEICAgICAgICAgICAgICAgICAgICB3V1BBSUVMZW47CiAKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICB1QXNzb2NDb3VudDsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICAgICAgICAgIHVBc3NvY0NvdW50OwogICAgIEJPT0wgICAgICAgICAgICAgICAgICAgIGJNb3JlRGF0YTsKIAogICAgIC8vIFNjYW4gc3RhdGUgdmFycwogICAgIFdNQUNfU0NBTl9TVEFURSAgICAgICAgIGVTY2FuU3RhdGU7CiAgICAgV01BQ19TQ0FOX1RZUEUgICAgICAgICAgZVNjYW5UeXBlOwotICAgIFVJTlQgICAgICAgICAgICAgICAgICAgIHVTY2FuU3RhcnRDaDsKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICB1U2NhbkVuZENoOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgICAgICAgICAgdVNjYW5TdGFydENoOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgICAgICAgICAgdVNjYW5FbmRDaDsKICAgICBXT1JEICAgICAgICAgICAgICAgICAgICB3U2NhblN0ZXBzOwotICAgIFVJTlQgICAgICAgICAgICAgICAgICAgIHVTY2FuQlNTVHlwZTsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICAgICAgICAgIHVTY2FuQlNTVHlwZTsKICAgICAvLyBEZXNpcmUgc2Nhbm5pZyB2YXJzCiAgICAgQllURSAgICAgICAgICAgICAgICAgICAgYWJ5U2NhblNTSURbV0xBTl9JRUhEUl9MRU4gKyBXTEFOX1NTSURfTUFYTEVOICsgMV07CiAgICAgQllURSAgICAgICAgICAgICAgICAgICAgYWJ5U2NhbkJTU0lEW1dMQU5fQlNTSURfTEVOXTsKQEAgLTM0NSw4ICszNDQsOCBAQAogICAgIEJZVEUgICAgICAgICAgICAgICAgICAgIGFieVBTVHhNYXBbTUFYX05PREVfTlVNICsgMV07CiAKICAgICAvLyBtYW5hZ21lbnQgY29tbWFuZCByZWxhdGVkCi0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgdUNtZEJ1c3k7Ci0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgdUNtZEhvc3RBUEJ1c3k7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgICAgICB1Q21kQnVzeTsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICAgICAgICAgIHVDbWRIb3N0QVBCdXN5OwogCiAgICAgLy8gbWFuYWdtZW50IHBhY2tldCBwb29sCiAgICAgUEJZVEUgICAgICAgICAgICAgICAgICAgcGJ5TWdtdFBhY2tldFBvb2w7CkBAIC0zOTAsNyArMzg5LDcgQEAKICAgICBCT09MICAgICAgICAgICAgICAgICAgICBiU3dpdGNoQ2hhbm5lbDsKICAgICBCWVRFICAgICAgICAgICAgICAgICAgICBieU5ld0NoYW5uZWw7CiAgICAgUFdMQU5fSUVfTUVBU1VSRV9SRVAgICAgcEN1cnJNZWFzdXJlRUlEUmVwOwotICAgIFVJTlQgICAgICAgICAgICAgICAgICAgIHVMZW5ndGhPZlJlcEVJRHM7CisgICAgdW5zaW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gUFNNZ210T2JqZWN0IHBNZ210LAotICAgIE9VVCBQQ01EX1NUQVRVUyBwU3RhdHVzCi0gICAgKTsKK3ZvaWQgdk1nckpvaW5CU1NCZWdpbih2b2lkICpoRGV2aWNlQ29udGV4dCwKKwkJICAgICAgUENNRF9TVEFUVVMgcFN0YXR1cyk7CiAKLVZPSUQKLXZNZ3JDcmVhdGVPd25JQlNTKAotICAgIElOICBIQU5ETEUgaERldmljZUNvbnRleHQsCi0gICAgT1VUIFBDTURfU1RBVFVTIHBTdGF0dXMKLSAgICApOwotCi1WT0lECi12TWdySm9pbkJTU0JlZ2luKAotICAgIElOICBIQU5ETEUgaERldmljZUNvbnRleHQsCi0gICAgT1VUIFBDTURfU1RBVFVTIHBTdGF0dXMKLSAgICApOwotCi1WT0lECi12TWdyUnhNYW5hZ2VQYWNrZXQoCi0gICAgSU4gIEhBTkRMRSBoRGV2aWNlQ29udGV4dCwKLSAgICBJTiAgUFNNZ210T2JqZWN0IHBNZ210LAotICAgIElOICBQU1J4TWdtdFBhY2tldCBwUnhQYWNrZXQKLSAgICApOwordm9pZCB2TWdyUnhNYW5hZ2VQYWNrZXQodm9pZCAqaERldmljZUNvbnRleHQsCisJCQlQU01nbXRPYmplY3QgcE1nbXQsCisJCQlQU1J4TWdtdFBhY2tldCBwUnhQYWNrZXQpOwogCiAvKgotVk9JRAordm9pZAogdk1nclNjYW5CZWdpbigKLSAgICBJTiAgSEFORExFIGhEZXZpY2VDb250ZXh0LAotICAgIE9VVCBQQ01EX1NUQVRVUyBwU3RhdHVzCisgICAgICB2b2lkICpoRGV2aWNlQ29udGV4dCwKKyAgICAgUENNRF9TVEFUVVMgcFN0YXR1cwogICAgICk7CiAqLwogCi1WT0lECi12TWdyRGVBdXRoZW5CZWdpblN0YSgKLSAgICBJTiAgSEFORExFIGhEZXZpY2VDb250ZXh0LAotICAgIElOICBQU01nbXRPYmplY3QgIHBNZ210LAotICAgIElOICBQQllURSAgIGFieURlc3RBZGRyZXNzLAotICA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KHZvaWQgKnBNZ210SGFuZGxlLAorICAgICBQV0xBTl9JRV9SU04gcFJTTklFcwogICAgICkKIHsKICAgICBQU01nbXRPYmplY3QgICAgcE1nbXQgPSAoUFNNZ210T2JqZWN0KSBwTWdtdEhhbmRsZTsKICAgICBQQllURSAgICAgICAgICAgcGJ5QnVmZmVyID0gTlVMTDsKLSAgICBVSU5UICAgICAgICAgICAgaWkgPSAwOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgIGlpID0gMDsKICAgICBQV09SRCAgICAgICAgICAgcHdQTUtJRCA9IE5VTEw7CiAKICAgICBpZiAocFJTTklFcyA9PSBOVUxMKSB7CkBAIC0zMzcsMjAgKzMzNiwyNSBAQAogICAgICAgICB9CiAgICAgICAgIHBSU05JRXMtPmxlbiArPTI7CiAKLSAgICAgICAgaWYgKChwTWdtdC0+Z3NQTUtJRENhY2hlLkJTU0lESW5mb0NvdW50ID4gMCkgJiYKLSAgICAgICAgICAgIChwTWdtdC0+YlJvYW1pbmcgPT0gVFJVRSkgJiYKKwlpZiAoKHBNZ210LT5nc1BNS0lEQ2FjaGUuQlNTSURJbmZvQ291bnQgPiAwKSAmJgorCSAgICAocE1nbXQtPmJSb2FtaW5nID09IFRSVUUpICYmCiAgICAgICAgICAgICAocE1nbXQtPmVBdXRoZW5Nb2RlID09IFdNQUNfQVVUSF9XUEEyKSkgewotICAgICAgICAgICAgLy8gUlNOIFBNS0lECi0gICAgICAgICAgICBwd1BNS0lEID0gKFBXT1JEKSgmcFJTTklFcy0+YWJ5UlNOWzE4XSk7ICAvLyBQb2ludCB0byBQTUtJRCBjb3VudAotICAgICAgICAgICAgKnB3UE1LSUQgPSAwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBJbml0aWFsaXplIFBNS0lEIGNvdW50Ci0gICAgICAgICAgICBwYnlCdWZmZXIgPSAmcFJTTklFcy0+YWJ5UlNOWzIwXTsgICAgICAgICAgIC8vIFBvaW50IHRvIFBNS0lEIGxpc3QKL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T09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCSAqIFN0YXRpc3RpY3MgKG5vIG1hdHRlciB3aGV0aGVyIGl0IGhhZCBkb25lIHN1Y2Nlc3NmdWxseSkgLXdrY2hlbgorCSAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKwkgKi8KKwl1MzIJX051bVJ4TVNEVTsKKwl1MzIJX051bVR4TVNEVTsKKwl1MzIJX2RvdDExV0VQRXhjbHVkZWRDb3VudDsKKwl1MzIJX2RvdDExV0VQVW5kZWNyeXB0YWJsZUNvdW50OworCXUzMglfZG90MTFGcmFtZUR1cGxpY2F0ZUNvdW50OwogCi0gICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gICAgLy8gU3RhdGlzdGljcyAobm8gbWF0dGVyIHdoZXRoZXIgaXQgaGFkIGRvbmUgc3VjY2Vzc2Z1bGx5KSAtd2tjaGVuCi0gICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gICAgdTMyCQkgICAJX051bVJ4TVNEVTsKLSAgICB1MzIJICAgCQlfTnVtVHhNU0RVOwotICAgIHUzMgkgICAJCV9kb3QxMVdFUEV4Y2x1ZGVkQ291bnQ7Ci0gICAgdTMyCSAgIAkJX2RvdDExV0VQVW5kZWNyeXB0YWJsZUNvdW50OwotICAgIHUzMgkgICAJCV9kb3QxMUZyYW1lRHVwbGljYXRlQ291bnQ7CisJc3RydWN0CWNoYW5faW5mbyBJYnNzQ2hhblNldHRpbmc7CS8qIDJCLiBTdGFydCBJQlNTIENoYW5uZWwgc2V0dGluZyBieSByZWdpc3RyeSBvciBXV1UuICovCisJdTgJcmVzZXJ2ZWRfNVsyXTsJCS8qIEl0IG1heSBub3QgY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1MTYJCXJlc2VydmVkXzc7Ci0KIH07CiAKICNlbmRpZgpkaWZmIC0tZ2l0IGEvZHJpdmVycy9zdGFnaW5nL3dpbmJvbmQvbWFjX3N0cnVjdHVyZXMuaCBiL2RyaXZlcnMvc3RhZ2luZy93aW5ib25kL21hY19zdHJ1Y3R1cmVzLmgKaW5kZXggMGQxNjE5Ni4uNzQ0MTAxNSAxMDA2NDQKLS0tIGEvZHJpdmVycy9zdGFnaW5nL3dpbmJvbmQvbWFjX3N0cnVjdHVyZXMuaAorKysgYi9kcml2ZXJzL3N0YWdpbmcvd2luYm9uZC9tYWNfc3RydWN0dXJlcy5oCkBAIC0xLDQgKzEsNCBAQAotLy8rKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrCisvKisrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysKIC8vIE1BQ19TdHJ1Y3R1cmVzLmgKIC8vCiAvLyBUaGlzIGZpbGUgY29udGFpbnMgdGhlIGRlZmluaXRpb25zIGFuZCBkYXRhIHN0cnVjdHVyZXMgdXNlZCBieSBTVy1NQUMuCkBAIC0xNiwyNCArMTYsMjQgQEAKIC8vICAgICAgICAgICAgICAgICAgICAgIERlbGV0ZWQgc29tZSB1bnVzZWQuCiAvLyAgICAgICAgICAyMDAyMTEyOSAgICBQRDQzIEF1c3RpbgogLy8JCQkyMDAzMDYxNwlpbmNyZWFzZSB0aGUgODAyLjExZyBkZWZpbml0aW9uCi0vLysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysKKy8vKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKyovCiAKICNpZm5kZWYgX01BQ19TdHJ1Y3R1cmVzX0hfCiAjZGVmaW5lIF9NQUNfU3RydWN0dXJlc19IXwogCiAjaW5jbHVkZSA8bGludXgvc2tidWZmLmg+CiAKLS8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQogLy8gU29tZSBtaXNjZWxsYW5lb3VzIGRlZmluaXRpb25zCi0vLy0tLS0tCisvLy0tLS0tKi8KICNkZWZpbmUgTUFYX0NIQU5ORUxTICAgICAgICAgICAgICAgICAgICAgICAgMzAKICNkZWZpbmUgTUFDX0FERFJfTEVOR1RIICAgICAgICAgICAgICAgICAgICAgNgotI2RlZmluZSBNQVhfV0VQX0tFWV9TSVpFICAgICAgICAgICAgICAgICAgICAxNiAgLy8gMTI4IGJpdHMKLSNkZWZpbmUJTUFYXzgwMl8xMV9GUkFHTUVOVF9OVU1CRVIJCTEwIC8vIEJ5IHNwZWMKKyNkZWZpbmUgTUFYX1dFUF9LRVlfU0laRSAgICAgICAgICAgICAgICAgICAgMTYgIC8qIDEyOCBiaXRzICovCisjZGVmaW5lCU1BWF84MDJfMTFfRlJBR01FTlRfTlVNQkVSCQkxMCAvKiBCeSBzcGVjICovCiAKLS8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKy8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAvLyA4MDIuMTEgRnJhbWUgZGVmaW5lCi0vLy0tLS0tCisvLy0tLS0tICovCiAjZGVmaW5lIE1BU0tfUFJPVE9DT0xfVkVSU0lPTl9UWVBFCTB4MEYKICNkZWZpbmUgTUFTS19GUkFHTUVOVF9OVU1CRVIJCTB4MDAwRgogI2RlZmluZSBTRVFVRU5DRV9OVU1CRVJfU0hJRlQJCTQKQEAgLTQxLDggKzQxLDggQEAKICNkZWZpbm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09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLXR5cGVkZWYgZW51bSBlbnVtX1Bvd2VyTWFuYWdlbWVudE1vZGUKLXsKLSAgICBBQ1RJVkUgPSAwLAotICAgIFBPV0VSX1NBVkUKLX0gV0JfUE1fTW9kZSwgKlBXQl9QTV9NT0RFOwotCiAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KIC8vICBSZWFzb24gQ29kZSAoVGFibGUgMTgpOiBpbmRpY2F0ZSB0aGUgcmVhc29uIG9mIERpc0Fzc29jLCBEZUF1dGhlbgogLy8gIGxlbmd0aCBvZiBSZWFzb25Db2RlIGlzIDIgT2N0cy4KQEAgLTEzNyw3ICsxMzAsNyBAQAogI2RlZmluZSBSRUFTT05fQ0xBU1MzX0ZSQU1FX0ZST01fTk9OQVNTT19TVEEgICAgNwogI2RlZmluZSBESVNBU1NfUkVBU09OX0xFRlRfQlNTICAgICAgOAogI2RlZmluZSBSRUFTT05fTk9UX0FVVEhfWUVUICAgICAgICAgOQotLy84MDIuMTFpIGRlZmluZQorLyogODAyLjExaSBkZWZpbmUgKi8KICNkZWZpbmUgUkVBU09OX0lOVkFMSURfSUUJCQkJCQkxMwogI2RlZmluZSBSRUFTT05fTUlDX0VSUk9SCQkJCQkJMTQKICNkZWZpbmUgUkVBU09OXzRXQVlfSEFORFNIQUtFX1RJTUVPVVQJCQkxNQpAQCAtMTgyLDEzICsxNzUsMTIgQEAKIH0gV0JfTU1QRFVSRVNVTFRDT0RFLCAqUFdCX01NUERVUkVTVUxUQ09ERTsKICovCiAKLS8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KIC8vIGVudW1fVHhSYXRlIC0tCiAvLyAgIERlZmluZSB0aGUgdHJhbnNtaXNzaW9uIGNvbnN0YW50cyBiYXNlZCBvbiBXODlDMzIgTUFDCiAvLyAgIHRhcmdldCBzcGVjaWZpY2F0aW9uLgotLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotdHlwZWRlZiBlbnVtIGVudW1fVHhSYXRlCi17CisvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3R5cGVkZWYgZW51bSBlbnVtX1R4UmF0ZSB7CiAgICAgVFhSQVRFXzFNICAgICAgICAgICAgICAgPSAwLAogICAgIFRYUkFURV8yTUxPTkcgICAgICAgICAgID0gMiwKICAgICBUWFJBVEVfMk1TSE9SVCAgICAgICAgICA9IDMsCkBAIC0xOTYsNyArMTg4LDcgQEAKICAgICBUWFJBVEVfNTVNU0hPUlQgICAgICAgICA9IDUsCiAgICAgVFhSQVRFXzExTUxPTkcgICAgICAgICAgPSA2LAogICAgIFRYUkFURV8xMU1TSE9SVCAgICAgICAgID0gNywKLSAgICBUWFJBVEVfQVVUTyAgICAgICAgICAgICA9IDI1NSAgICAgICAgICAgLy8gUEQ0MyAyMDAyMTEwOAorICAgIFRYUkFURV9BVVRPICAgICAgICAgICAgID0gMjU1ICAgICAgICAgICAvKiBQRDQzIDIwMDIxMTA4ICovCiB9IFdCX1RYUkFURSwgKlBXQl9UWFJBVEU7CiAKIApAQCAtMjMyLDcgKzIyNCw3IEBACiAjZGVmaW5lIFJBVEVfNTRNCQkJCQkxMDgKICNkZWZpbmUgUkFURV9NQVgJCQkJCTI1NQogCi0vL0NBUEFCSUxJVFkKKy8qIENBUEFCSUxJVFkgKi8KICNkZWZpbmUgQ0FQQUJJTElUWV9FU1NfQklUCQkJCTB4MDAwMQogI2RlZmluZSBDQVBBQklMSVRZX0lCU1NfQklUCQkJCTB4MDAwMgogI2RlZmluZSBDQVBBQklMSVRZX0NGX1BPTExfQklUCQkJMHgwMDA0Ck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kaWYgLy9lbmRkZWYgX1dQQTJfCi0vLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorI2VuZGlmIC8qIGVuZGRlZiBfV1BBMl8gKi8KKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAvLyBNQUMgRnJhbWUgc3RydWN0dXJlIChkaWZmZXJlbnQgdHlwZSkgYW5kIHN1YmZpZWxkIHN0cnVjdHVyZQotLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKy8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KIHN0cnVjdCBNQUNfZnJhbWVfY29udHJvbAogewotICAgIHU4ICAgIG1hY19mcmFtZV9pbmZvOyAvLyBhIGNvbWJpbmF0aW9uIG9mIHRoZSBbUHJvdG9jb2wgVmVyc2lvbiwgQ29udHJvbCBUeXBlLCBDb250cm9sIFN1YnR5cGVdCi0gICAgI2lmZGVmIF9CSUdfRU5ESUFOXyAvLzIwMDYwOTI3IGFkZCBieSBhbnNvbidzIGVuZGlhbgorICAgIHU4ICAgIG1hY19mcmFtZV9pbmZvOyAvKiBhIGNvbWJpbmF0aW9uIG9mIHRoZSBbUHJvdG9jb2wgVmVyc2lvbiwgQ29udHJvbCBUeXBlLCBDb250cm9sIFN1YnR5cGVdKi8KKyAgICAjaWZkZWYgX0JJR19FTkRJQU5fIC8qIDIwMDYwOTI3IGFkZCBieSBhbnNvbidzIGVuZGlhbiAqLwogICAgIHU4ICAgIG9yZGVyOjE7CiAgICAgdTggICAgV0VQOjE7CiAgICAgdTggICAgbW9yZV9kYXRhOjE7CkBAIC01NjMsMjQgKzU0MCwyNCBAQAogfSBfX2F0dHJpYnV0ZV9fICgocGFja2VkKSk7CiAKIHN0cnVjdCBNYW5hZ2VtZW50X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yTWVhc3VyZUJsb2NrOworCXU4CXJlc2VydmVkXzRbMl07CiAKLQl1MzIJVHhUc2M7IC8vIDIwMDYwMjE0Ci0JdTMyCVR4VHNjXzI7IC8vIDIwMDYwMjE0Ci0KKwl1MzIJVHhUc2M7CisJdTMyCVR4VHNjXzI7CiB9OwogCiAjZW5kaWYKZGlmZiAtLWdpdCBhL2RyaXZlcnMvc3RhZ2luZy93aW5ib25kL21sbWVfcy5oIGIvZHJpdmVycy9zdGFnaW5nL3dpbmJvbmQvbWxtZV9zLmgKaW5kZXggMTIxN2ExYy4uYTdlZjNjNyAxMDA2NDQKLS0tIGEvZHJpdmVycy9zdGFnaW5nL3dpbmJvbmQvbWxtZV9zLmgKKysrIGIvZHJpdmVycy9zdGFnaW5nL3dpbmJvbmQvbWxtZV9zLmgKQEAgLTcsMjggKzcsMjkgQEAKICNpbmNsdWRlICJtYWNfc3RydWN0dXJlcy5oIgogI2luY2x1ZGUgIm1kc19zLmgiCiAKLS8vKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysKLS8vCU1sbWUuaAotLy8JCURlZmluZSB0aGUgcmVsYXRlZCBkZWZpbml0aW9ucyBvZiBNTE1FIG1vZHVsZQotLy8JaGlzdG9yeSAtLSAwMS8xNC8wMycgY3JlYXRlZAotLy8KLS8vKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysKKy8qCisgKiArKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrCisgKglNbG1lLmgKKyAqCQlEZWZpbmUgdGhlIHJlbGF0ZWQgZGVmaW5pdGlvbnMgb2YgTUxNRSBtb2R1bGUKKyAqCisgKiArKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysr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YgKzEsMjYgQEAKLS8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLy8gIE1vZHVsZSBOYW1lOgotLy8gICAgTUxNRVR4UnguQwotLy8KLS8vICBEZXNjcmlwdGlvbjoKLS8vICAgIFRoZSBpbnRlcmZhY2UgYmV0d2VlbiBNRFMgKE1BQyBEYXRhIFNlcnZpY2UpIGFuZCBNTE1FLgotLy8KLS8vICBSZXZpc2lvbiBIaXN0b3J5OgotLy8gIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0vLyAgICAgICAgICAyMDAyMDkgICAgICBVTjIwIEplbm5pZmVyIFh1Ci0vLyAgICAgICAgICAgICAgICAgICAgICBJbml0aWFsIFJlbGVhc2UKLS8vICAgICAgICAgIDIwMDIxMTA4ICAgIFBENDMgQXVzdGluIExpdQotLy8gICAgICAgICAgMjAwMzAxMTcgICAgUEQ0MyBBdXN0aW4gTGl1Ci0vLyAgICAgICAgICAgICAgICAgICAgICBEZWxldGVkIE1MTUVSZXR1cm5QYWNrZXQgYW5kIE1MTUVQcm9jVGhyZWFkKCkKLS8vCi0vLyAgQ29weXJpZ2h0IChjKSAxOTk2LTIwMDIgV2luYm9uZCBFbGVjdHJvbmljcyBDb3JwLiBBbGwgUmlnaHRzIFJlc2VydmVkLgotLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisvKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIE1vZHVsZSBOYW1lOgorICAgIE1MTUVUeFJ4LkMKKworICBEZXNjcmlwdGlvbjoKKyAgICBUaGUgaW50ZXJmYWNlIGJldHdlZW4gTURTIChNQUMgRGF0YSBTZXJ2aWNlKSBhbmQgTUxNRS4KKworICBSZXZpc2lvbiBIaXN0b3J5OgorICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCQkyMDAyMDkgICAgICBVTjIwIEplbm5pZmVyIFh1CisJCUluaXRpYWwgUmVsZWFzZQorCQkyMDAyMTEwOCAgICBQRDQzIEF1c3RpbiBMaXUKKwkJMjAwMzAxMTcgICAgUEQ0MyBBdXN0aW4gTGl1CisJCURlbGV0ZWQgTUxNRVJldHVyblBhY2tldCBhbmQgTUxNRVByb2NUaHJlYWQoKQorCisgIENvcHlyaWdodCAoYykgMTk5Ni0yMDAyIFdpbmJvbmQgRWxlY3Ryb25pY3MgQ29ycC4gQWxsIFJpZ2h0cyBSZXNlcnZlZC4KKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KICNpbmNsdWRlICJzeXNkZWYuaCIKIAogI2luY2x1ZGUgIm1kc19mLmgiCiAKLS8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLXU4IE1MTUVTZW5kRnJhbWUoc3RydWN0IHdic29mdF9wcml2ICogYWRhcHRlciwgdTggKnBNTVBEVSwgdTE2IGxlbiwgdTggRGF0YVR5cGUpCisvKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwordTggTUxNRVNlbmRGcmFtZShzdHJ1Y3Qgd2Jzb2Z0X3ByaXYgKmFkYXB0ZXIsIHU4ICpwTU1QRFUsIHUxNiBsZW4sIHU4IERhdGFUeXBlKQogLyoJRGF0YVR5cGUgOiBGU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EFOIFNUQS4KLS8vCi0vLyAgICBUaGUgZm9sbG93aW5nIE1JQiBhdHRyaWJ1dGVzIG9yIGludGVybmFsIHZhcmlhYmxlcyB3aWxsIGJlIGFmZmVjdGVkCi0vLyAgICB3aGlsZSB0aGUgTVRPIGlzIGJlaW5nIGV4ZWN1dGVkOgotLy8gICAgICAgZG90MTFGcmFnbWVudGF0aW9uVGhyZXNob2xkLAotLy8gICAgICAgZG90MTFSVFNUaHJlc2hvbGQsCi0vLyAgICAgICB0cmFuc21pc3Npb24gcmF0ZSBhbmQgUExDUCBwcmVhbWJsZSB0eXBlLAotLy8gICAgICAgQ0NBIG1vZGUsCi0vLyAgICAgICBhbnRlbm5hIGRpdmVyc2l0eS4KLS8vCi0vLyAgUmV2aXNpb24gaGlzdG9yeToKLS8vICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotLy8gICAgICAgICAgIDIwMDMxMjI3ICBVTjIwIFBldGUgQ2hhbwotLy8gICAgICAgICAgICAgICAgICAgICBGaXJzdCBkcmFmdAotLy8gIDIwMDMxMjI5ICAgICAgICAgICBUdXJibyAgICAgICAgICAgICAgICBjb3B5IGZyb20gUEQ0MwotLy8gIDIwMDQwMjEwICAgICAgICAgICBLZXZpbiAgICAgICAgICAgICAgICByZXZpc2VkCi0vLyAgQ29weXJpZ2h0IChjKSAyMDAzIFdpbmJvbmQgRWxlY3Ryb25pY3MgQ29ycC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLS8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorLyoKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIE1UTy5DIC0KKyAqCisgKiBEZXNjc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PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0vLyAgTVRPX0luaXQgLS0KLS8vCi0vLyAgRGVzY3JpcHRpb246Ci0vLyAgICBJbml0aWFsaXplIE1UTyBwYXJhbWV0ZXJzLgotLy8KLS8vICAgIFRoaXMgZnVuY3Rpb24gc2hvdWxkIGJlIGludm9rZWQgZHVyaW5nIHN5c3RlbSBpbml0aWFsaXphdGlvbi4KLS8vCi0vLyAgQXJndW1lbnRzOgotLy8gICAgYWRhcHRlciAgICAgIC0gVGhlIHBvaW50ZXIgdG8gdGhlIE1pbmlwb3J0IGFkYXB0ZXIgQ29udGV4dAotLy8KLS8vICBSZXR1cm4gVmFsdWU6Ci0vLyAgICBOb25lCi0vLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKy8qCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIE1UT19Jbml0IC0tCisgKgorICogIERlc2NyaXB0aW9uOgorICogICAgSW5pdGlhbGl6ZSBNVE8gcGFyYW1ldGVycy4KKyAqCisgKiAgICBUaGlzIGZ1bmN0aW9uIHNob3VsZCBiZSBpbnZva2VkIGR1cmluZyBzeXN0ZW0gaW5pdGlhbGl6YXRpb24uCisgKgorICogIEFyZ3VtZW50czoKKyAqICAgIGFkYXB0ZXIgICAgICAtIFRoZSBwb2ludGVyIHRvIHRoZSBNaW5pcG9ydCBhZGFwdGVyIENvbnRleHQKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICovCiB2b2lkIE1UT19Jbml0KHN0cnVjdCB3YnNvZnRfcHJpdiAqYWRhcHRlcikKIHsKLSAgICBpbnQgaTsKKw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PT09PT09PT09PT09PT09PQotLy8gICAgICAgICAgMjAwMzAxMTAgICAgVU4yMCBQZXRlIENoYW8KLS8vICAgICAgICAgICAgICAgICAgICAgIEluaXRpYWwgUmVsZWFzZQotLy8KLS8vIENvcHlyaWdodCAoYykgMjAwMyBXaW5ib25kIEVsZWN0cm9uaWNzIENvcnAuIEFsbCByaWdodHMgcmVzZXJ2ZWQuCi0vLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorLyoKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTVRPLkgKKyAqCisgKiBDb3B5cmlnaHQgKGMpIDIwMDMgV2luYm9uZCBFbGVjdHJvbmljcyBDb3JwLiBBbGwgcmlnaHRzIHJlc2VydmVkLgorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKi8KICNpZm5kZWYgX19NVE9fSF9fCiAjZGVmaW5lIF9fTVRPX0hfXwogCkBAIC0xNSwxMTUgKzEyLDEwNCBAQAogCiBzdHJ1Y3Qgd2Jzb2Z0X3ByaXY7CiAKLS8vIExBMjAwNDAyMTBfRFRPIGtldmluCi0vLyNkZWZpbmUgTVRPX1BSRUFNQkxFX0xPTkcgICAgICAgICAgICAgICAwCi0vLyNkZWZpbmUgTVRPX1BSRUFNQkxFX1NIT1JUICAgICAgICAgICAgICAxCiAjZGVmaW5lIE1UT19QUkVBTUJMRV9MT05HICAgICAgICAgICAgICAgV0xBTl9QUkVBTUJMRV9UWVBFX0xPTkcKICNkZWZpbmUgTVRPX1BSRUFNQkxFX1NIT1JUICAgICAgICAgICAgICBXTEFOX1BSRUFNQkxFX1RZUEVfU0hPUlQKIAotLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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OUZFMDIsICAgICAgICAgIC8vIE1heCAtIDAgZEIKLSAgICAweDlCRTAyLCAgICAgICAgICAvLyBNYXggLSAxIGRCCi0gICAgMHg5REUwMiwgICAgICAgICAgLy8gTWF4IC0gMiBkQgotICAgIDB4OTlFMDIsICAgICAgICAgIC8vIE1heCAtIDMgZEIKLSAgICAweDlFRTAyLCAgICAgICAgICAvLyBNYXggLSA0IGRCCi0gICAgMHg5QUUwMiwgICAgICAgICAgLy8gTWF4IC0gNSBkQgotICAgIDB4OUNFMDIsICAgICAgICAgIC8vIE1heCAtIDYgZEIKLSAgICAweDk4RTAyLCAgICAgICAgICAvLyBNYXggLSA3IGRCCi0gICAgMHg5NzYwMiwgICAgICAgICAgLy8gTWF4IC0gOCBkQgotICAgIDB4OTM2MDIsICAgICAgICAgIC8vIE1heCAtIDkgZEIKLSAgICAweDk1NjAyLCAgICAgICAgICAvLyBNYXggLSAxMCBkQgotICAgIDB4OTE2MDIsICAgICAgICAgIC8vIE1heCAtIDExIGRCCi0gICAgMHg5NjYwMiwgICAgICAgICAgLy8gTWF4IC0gMTIgZEIKLSAgICAweDkyNjAyLCAgICAgICAgICAvLyBNYXggLSAxMyBkQgotICAgIDB4OTQ2MDIsICAgICAgICAgIC8vIE1heCAtIDE0IGRCCi0gICAgMHg5MDYwMiwgICAgICAgICAgLy8gTWF4IC0gMTUgZEIKLSAgICAweDk3QTAyLCAgICAgICAgICAvLyBNYXggLSAxNiBkQgotICAgIDB4OTNBMDIsICAgICAgICAgIC8vIE1heCAtIDE3IGRCCi0gICAgMHg5NUEwMiwgICAgICAgICAgLy8gTWF4IC0gMTggZEIKLSAgICAweDkxQTAyLCAgICAgICAgICAvLyBNYXggLSAxOSBkQgotICAgIDB4OTZBMDIsICAgICAgICAgIC8vIE1heCAtIDIwIGRCCi0gICAgMHg5MkEwMiwgICAgICAgICAgLy8gTWF4IC0gMjEgZEIKLSAgICAweDk0QTAyLCAgICAgICAgICAvLyBNYXggLSAyMiBkQgotICAgIDB4OTBBMDIsICAgICAgICAgIC8vIE1heCAtIDIzIGRCCi0gICAgMHg5NzIwMiwgICAgICAgICAgLy8gTWF4IC0gMjQgZEIKLSAgICAweDkzMjAyLCAgICAgICAgICAvLyBNYXggLSAyNSBkQgotICAgIDB4OTUyMDIsICAgICAgICAgIC8vIE1heCAtIDI2IGRCCi0gICAgMHg5MTIwMiwgICAgICAgICAgLy8gTWF4IC0gMjcgZEIKLSAgICAweDk2MjAyLCAgICAgICAgICAvLyBNYXggLSAyOCBkQgotICAgIDB4OTIyMDIsICAgICAgICAgIC8vIE1heCAtIDI5IGRCCi0gICAgMHg5NDIwMiwgICAgICAgICAgLy8gTWF4IC0gMzAgZEIKLSAgICAweDkwMjAyICAgICAgICAgICAvLyBNYXggLSAzMSBkQgotfTsKLSovCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBPcmlnaW5hbCBQaHkuaAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICovCiAKLS8vIDIwMDQwOTI3IDEuMS42OS4xMDAwIHliamlhbmcKLS8vIGZyb20gSm9obgotdTMyIGFsMjIzMF90eHZnYV9kYXRhW11bMl0gPQotewotCS8vdmFsdWUJLCBpbmRleAorLyoKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIEZvciBNQVhJTTI4MjUvNi83IFZlci4gMzMxIG9yIG1vcmUKKyAqCisgKiAweDAwIDB4MDAwYTIKKyAqIDB4MDEgMHgyMWNjMAorICogMHgwMiAweDEzODAyCisgKiAweDAyIDB4MTM4M2EKKyAqCisgKiBjaGFubmUxIDAxIDsgMHgwMyAweDMwMTQyIDsgMHgwNCAweDBiMzMzOworICogY2hhbm5lMSAwMiA7IDB4MDMgMHgzMjE0MSA7IDB4MDQgMHgwODQ0NDsKKyAqIGNoYW5uZTEgMDMgOyAweDAzIDB4M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PT09PT09PT09PT09PT09PT09PT09Ci0vLyAgVXh4X1JlYWRFdGhlcm5ldEFkZHJlc3MgLS0KLS8vCi0vLyAgUm91dGluZSBEZXNjcmlwdGlvbjoKLS8vICAgIFJlYWRzIGluIHRoZSBFdGhlcm5ldCBhZGRyZXNzIGZyb20gdGhlIElDLgotLy8KLS8vICBBcmd1bWVudHM6Ci0vLyAgICBwSHdEYXRhICAgICAgICAtIFRoZSBwSHdEYXRhIHN0cnVjdHVyZQotLy8KLS8vICBSZXR1cm4gVmFsdWU6Ci0vLwotLy8gICAgVGhlIGFkZHJlc3MgaXMgc3RvcmVkIGluIEV0aGVybmV0SURBZGRyLgotLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci12b2lkCi1VeHhfUmVhZEV0aGVybmV0QWRkcmVzcyggIHN0cnVjdCBod19kYXRhICogcEh3RGF0YSApCisvKgorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogIFV4eF9SZWFkRXRoZXJuZXRBZGRyZXNzIC0tCisgKgorICogIFJvdXRpbmUgRGVzY3JpcHRpb246CisgKiAgICBSZWFkcyBpbiB0aGUgRXRoZXJuZXQgYWRkcmVzcyBmcm9tIHRoZSBJQy4KKyAqCisgKiAgQXJndW1lbnRzOgorICogICAgcEh3RGF0YSAgICAgICAgLSBUaGUgcEh3RGF0YSBzdHJ1Y3R1cmUKKyAqCisgKiAgUmV0dXJuIFZhbHVlOgorICoKKyAqICAgIFRoZSBhZGRyZXNzIGlzIHN0b3JlZCBpbiBFdGhlcm5ldElEQWRkci4KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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0IC0tCi0vLyAgRGVzY3JpcHRpb246Ci0vLyAgICBGb3IgYSBnaXZlbiBtdWx0aWNhc3QgYWRkcmVzcywgcmV0dXJucyB0aGUgYnl0ZSBhbmQgYml0IGluIHRoZSBjYXJkIG11bHRpY2FzdCByZWdpc3RlcnMgdGhhdCBpdCBoYXNoZXMgdG8uCi0vLyAgICBDYWxscyBDYXJkQ29tcHV0ZUNyYygpIHRvIGRldGVybWluZSB0aGUgQ1JDIHZhbHVlLgotLy8gIEFyZ3VtZW50czoKLS8vICAgIEFkZHJlc3MgLSB0aGUgYWRkcmVzcwotLy8gICAgQnl0ZSAtIHRoZSBieXRlIHRoYXQgaXQgaGFzaGVzIHRvCi0vLyAgICBWYWx1ZSAtIHdpbGwgaGF2ZSBhIDEgaW4gdGhlIHJlbGV2YW50IGJpdAotLy8gIFJldHVybiBWYWx1ZToKLS8vICAgIE5vbmUuCi0vLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci12b2lkIENhcmRHZXRNdWx0aWNhc3RCaXQoIHU4IEFkZHJlc3NbRVRIX0FMRU5dLCB1OCAqQnl0ZSwgdTggKlZhbHVlICkKKy8qCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqICBDYXJkR2V0TXVsdGljYXN0Qml0IC0tCisgKiAgRGVzY3JpcHRpb246CisgKiAgICBGb3IgYSBnaXZlbiBtdWx0aWNhc3QgYWRkcmVzcywgcmV0dXJucyB0aGUgYnl0ZSBhbmQgYml0IGluIHRoZSBjYXJkIG11bHRpY2FzdCByZWdpc3RlcnMgdGhhdCBpdCBoYXNoZXMgdG8uCisgKiAgICBDYWxscyBDYXJkQ29tcHV0Z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IAotdm9pZCBTZXRfQ2hhbkluZGVwX1JmRGF0YV9hbDcyMzBfNTAoICBzdHJ1Y3QgaHdfZGF0YSAqIHBId0RhdGEsIHUzMiAqcGx0bXAsIGNoYXIgbnVtYmVyKQordm9pZCBTZXRfQ2hhbkluZGVwX1JmRGF0YV9hbDcyMzBfNTAoc3RydWN0IGh3X2RhdGEgKnBId0RhdGEsIHUzMiAqcGx0bXAsIGNoYXIgbnVtYmVyKQogewogCXU4CWk7CiAKLQlmb3IoIGk9MDsgaTxudW1iZXI7IGkrKyApCi0JeworCWZvciAoaSA9IDA7IGkgPCBudW1iZXI7IGkrKykgewogCQlwSHdEYXRhLT5waHlfcGFyYVtpXSA9IGFsNzIzMF9yZl9kYXRhXzUwW2ldOwotCQlwbHRtcFtpXSA9ICgxIDw8IDMxKSB8ICgwIDw8IDMwKSB8ICgyNCA8PCAyNCkgfCAoYWw3MjMwX3JmX2RhdGFfNTBbaV0mMHhmZmZmZmYpOworCQlwbHRtcFtpXSA9ICgxIDw8IDMxKSB8ICgwIDw8IDMwKSB8ICgyNCA8PCAyNCkgfCAoYWw3MjMwX3JmX2RhdGFfNTBbaV0gJiAweGZmZmZmZik7CiAJfQogfQogCiAKLS8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLy8gUkZTeW50aGVzaXplcl9pbml0aWFsIC0tCi0vLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLXZvaWQKLVJGU3ludGhlc2l6ZXJfaW5pdGlhbChzdHJ1Y3QgaHdfZGF0YSAqIHBId0RhdGEpCisvKgorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogUkZTeW50aGVzaXplcl9pbml0aWFsIC0tCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKi8KK3ZvaWQgUkZTeW50aGVzaXplcl9pbml0aWFsKHN0cnVjdCBod19kYXRhICpwSHdEYXRhKQogewogCXUzMglhbHRtcFszMl07Ci0JdTMyICoJcGx0bXAgPSBhbHRtcDsKKwl1MzIJKnBsdG1wID0gYWx0bXA7CiAJdTMyCWx0bXA7Ci0JdTgJbnVtYmVyPTB4MDA7IC8vIFRoZSBudW1iZXIgb2YgcmVnaXN0ZXIgdmFsZQorCXU4CW51bWJlciA9IDB4MDA7IC8qIFRoZSBudW1iZXIgb2YgcmVnaXN0ZXIgdmFsZSAqLwogCXU4CWk7CiAKLQkvLwotCS8vIGJpdFszMV0gICAgICBTUEkgRW5hYmxlLgotCS8vICAgICAgICAgICAgICAxPXBlcmZvcm0gc3ludGhlc2l6ZXIgcHJvZ3JhbSBvcGVyYXRpb24uIFRoaXMgYml0IHdpbGwKLQkvLyAgICAgICAgICAgICAgY2xlYXJlZCBhdXRvbWF0aWNhbGx5IGFmdGVyIHRoZSBvcGVyYXRpb24gaXMgY29tcGxldGVkLgotCS8vIGJpdFszMF0gICAgICBTUEkgUi9XIENvbnRyb2wKLQkvLyAgICAgICAgICAgICAgMD13cml0ZSwgICAgMT1yZWFkCi0JLy8gYml0WzI5OjI0XSAgIFNQSSBEYXRhIEZvcm1hdCBMZW5ndGgKLQkvLyBiaXRbMTc6NCBdICAgUkYgRGF0YSBiaXRzLgotCS8vIGJpdFszIDowIF0gICBSRiBhZGRyZXNzLgotCXN3aXRjaCggcEh3RGF0YS0+cGh5X3R5cGUgKQotCXsKKwkvKgorCSAqIGJpdFszMV0gICAgIC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T09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLy8gIEJCUHJvY2Vzc29yUG93ZXJ1cEluaXQgLS0KLS8vCi0vLyAgRGVzY3JpcHRpb246Ci0vLyAgICBJbml0aWFsaXplIHRoZSBCYXNlYmFuZCBwcm9jZXNzb3IuCi0vLwotLy8gIEFyZ3VtZW50czoKLS8vICAgIHBId0RhdGEgICAgLSBIYW5kbGUgb2YgdGhlIFVTQiBEZXZpY2UuCi0vLwotLy8gIFJldHVybiB2YWx1ZXM6Ci0vLyAgICBOb25lLgotLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci12b2lkCi1CQlByb2Nlc3Nvcl9pbml0aWFsKCAgc3RydWN0IGh3X2RhdGEgKiBwSHdEYXRhICkKKy8qCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqICBCQlByb2Nlc3NvclBvd2VydXBJbml0IC0tCisgKgorICogIERlc2NyaXB0aW9uOgorICogICAgSW5pdGlhbGl6ZSB0aGUgQmFzZWJhbmQgcHJvY2Vzc29yLgorICoKKyAqICBBcmd1bWVudHM6CisgKiAgICBwSHdEYXRhICAgIC0gSGFuZGxlIG9mIHRoZSBVU0IgRGV2aWNlLgorICoKKyAqICBSZXR1cm4gdmFsdWVzOgorICogICAgTm9uZS4KKyAqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICovCit2b2lkIEJCUHJvY2Vzc29yX2luaXRpYWwoc3RydWN0IGh3X2RhdGEgKnBId0RhdGEpCiB7CiAJc3RydWN0IHdiMzVfcmVnICpyZWcgPSAmcEh3RGF0YS0+cmVnOwogCXUzMglpLCBwbHRtcF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6CisJCWJyZWFrOwogCX0KLQlSRlN5bnRoZXNpemVyX1NldFBvd2VySW5kZXgoIHBId0RhdGEsIGluZGV4ICk7CisJUkZTeW50aGVzaXplcl9TZXRQb3dlckluZGV4KHBId0RhdGEsIGluZGV4KTsKIH0KIAotLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0vLyBSRlN5bnRoZXNpemVyX1N3aXRjaGluZ0NoYW5uZWwgLS0KLS8vCi0vLyBEZXNjcmlwdGlvbjoKLS8vICAgU3dpdGhjaCB0aGUgUkYgY2hhbm5lbC4KLS8vCi0vLyBBcmd1bWVudHM6Ci0vLyAgIHBId0RhdGEgICAgLSBIYW5kbGUgb2YgdGhlIFVTQiBEZXZpY2UuCi0vLyAgIENoYW5uZWwgICAgLSBUaGUgY2hhbm5lbCBuby4KLS8vCi0vLyBSZXR1cm4gdmFsdWVzOgotLy8gICBOb25lLgotLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci12b2lkCi1SRlN5bnRoZXNpemVyX1N3aXRjaGluZ0NoYW5uZWwoICBzdHJ1Y3QgaHdfZGF0YSAqIHBId0RhdGEsICBzdHJ1Y3QgY2hhbl9pbmZvIENoYW5uZWwgKQorLyoKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBSRlN5bnRoZXNpemVyX1N3aXRjaGluZ0NoYW5uZWwgLS0KKyAqCisgKiBEZXNjcmlwdGlvbjoKKyAqICAgU3dpdGhjaCB0aGUgUkYgY2hhbm5lbC4KKyAqCisgKiBBcmd1bWVudHM6CisgKiAgIHBId0RhdGEgICAgLSB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wogCi0vLyBSZiB2Z2EgMCB+IDMgZm9yIHRlbXBlcmF0dXJlIGNvbXBlbnNhdGUuIEl0IHdpbGwgYWZmZWN0IHRoZSBzY2FuIEJzcy4KLS8vIFRoZSBpIHZhbHVlIGVxdWFscyB0byA4IG9yIDcgdXN1YWxseS4gU28gSXQncyBub3QgbmVjZXNzYXJ5IHRvIHNldHVwIHRoaXMgUkYgcmVnaXN0ZXIuCi0vLwlpZiggaSA8PSAzICkKLS8vCQlQb3dlckRhdGEgPSAoMSA8PCAzMSkgfCAoMCA8PCAzMCkgfCAoMjQgPDwgMjQpIHwgQml0UmV2ZXJzZSggMHgwMDAwMjQsIDI0ICk7Ci0vLwllbHNlCi0vLwkJUG93ZXJEYXRhID0gKDEgPDwgMzEpIHwgKDAgPDwgMzApIHwgKDI0IDw8IDI0KSB8IEJpdFJldmVyc2UoIDB4MDAxODI0LCAyNCApOwotLy8JV2IzNVJlZ19Xcml0ZSggcEh3RGF0YSwgMHgwODY0LCBQb3dlckRhdGEgKTsKIAlyZXR1cm4gaTsKIH0KIAotLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLy8gRHh4X2luaXRpYWwgLS0KLS8vIE14eF9pbml0aWFsIC0tCi0JLy8KLS8vICBSb3V0aW5lIERlc2NyaXB0aW9uOgotLy8JCUluaXRpYWwgdGhlIGhhcmR3YXJlIHNldHRpbmcgYW5kIG1vZHVsZSB2YXJpYWJsZQotCS8vCi0vLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci12b2lkIER4eF9pbml0aWFsKCAgc3RydWN0IGh3X2RhdGEgKiBwSHdEYXRhICkKKy8qCisgKiA9PT09PT09PT09PT09PT09PT09PT09P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sCS8qIG1XLCBNQVggLSA1LAkxMC42IGRibSAqLworCTksCS8qIG1XLCBNQVggLSA2LAkgOS40IGRibSAqLworCTcsCS8qIG1XLCBNQVggLSA3LAkgOC4zIGRibSAqLworCTUsCS8qIG1XLCBNQVggLSA4LAkgNi40IGRibSAqLworCTQsCS8qIG1XLCBNQVggLSA5LAkgNS4zIGRibSAqLworCTMsCS8qIG1XLCBNQVggLSAxMCwgIDQuMCBkYm0gKi8KKwkyLAkvKiBtVywgTUFYIC0gMTEsICA/IGRibSAqLworCTIsCS8qIG1XLCBNQVggLSAxMiwgID8gZGJtICovCisJMiwJLyogbVcsIE1BWCAtIDEzLCAgPyBkYm0gKi8KKwkyLAkvKiBtVywgTUFYIC0gMTQsICA/IGRibSAqLworCTIsCS8qIG1XLCBNQVggLSAxNSwgID8gZGJtICovCisJMiwJLyogbVcsIE1BWCAtIDE2LCAgPyBkYm0gKi8KKwkyLAkvKiBtVywgTUFYIC0gMTcsICA/IGRibSAqLworCTIsCS8qIG1XLCBNQVggLSAxOCwgID8gZGJtICovCisJMSwJLyogbVcsIE1BWCAtIDE5LCAgPyBkYm0gKi8KKwkxLAkvKiBtVywgTUFYIC0gMjAsICA/IGRibSAqLworCTEsCS8qIG1XLCBNQVggLSAyMSwgID8gZGJtICovCisJMSwJLyogbVcsIE1BWCAtIDIyLCAgPyBkYm0gKi8KKwkxLAkvKiBtVywgTUFYIC0gMjMsICA/IGRibSAqLworCTEsCS8qIG1XLCBNQVggLSAyNCwgID8gZGJtICovCisJMSwJLyogbVcsIE1BWCAtIDI1LCAgPyBkYm0gKi8KKwkxLAkvKiBtVywgTUFYIC0gMjYsICA/IGRibSAqLworCTEsCS8qIG1XLCBNQVggLSAyNywgID8gZGJtICovCisJMSwJLyogbVcsIE1BWCAtIDI4LCAgPyBkYm0gKi8KKwkxLAkvKiBtVywgTUFYIC0gMjksICA/IGRibSAqLworCTEsCS8qIG1XLCBNQVggLSAzMCwgID8gZGJtICovCisJMQkvKiBtVyw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pIHwgQ2Fycnk7CisJCX0KKwl9CisJcmV0dXJuIENyYzsKIH0KIAogCi0vLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLy8gQml0UmV2ZXJzZSAtLQotLy8gICBSZXZlcnNlIHRoZSBiaXRzIGluIHRoZSBpbnB1dCBhcmd1bWVudCwgZHdEYXRhLCB3aGljaCBpcwotLy8gICByZWdhcmRlZCBhcyBhIHN0cmluZyBvZiBiaXRzIHdpdGggdGhlIGxlbmd0aCwgRGF0YUxlbmd0aC4KLS8vCi0vLyBBcmd1bWVudHM6Ci0vLyAgIGR3RGF0YSAgICAgOgotLy8gICBEYXRhTGVuZ3RoIDoKLS8vCi0vLyBSZXR1cm46Ci0vLyAgIFRoZSBjb252ZXJ0ZWQgdmFsdWUuCi0vLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotdTMyIEJpdFJldmVyc2UoIHUzMiBkd0RhdGEsIHUzMiBEYXRhTGVuZ3RoKQorLyoKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQml0UmV2ZXJzZSAtLQorICogICBSZXZlcnNlIHRoZSBiaXRzIGluIHRoZSBpbnB1dCBhcmd1bWVudCwgZHdEYXRhLCB3aGljaCBpcworICogICByZWdhcmRlZCBhcyBhIHN0cmluZyBvZiBiaXRzIHdpdGggdGhlIGxlbmd0aCwgRGF0YUxlbmd0aC4KKyAqCisgKiBBcmd1bWVudHM6CisgKiAgIGR3RGF0YSAgICAgOgorICogICBEYXRhTGVuZ3RoIDoKKyAqCisgKiBSZXR1cm46CisgKiAgIFRoZSBjb252ZXJ0ZWQgdmFsdWUuCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqLwordT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HQV9mb3JfaXFfbWFnKHN0cnVjdCBod19kYXRhICpod19kYXRhKTsKIAogI2VuZGlmCmRpZmYgLS1naXQgYS9kcml2ZXJzL3N0YWdpbmcvd2luYm9uZC93YjM1cmVnX3MuaCBiL2RyaXZlcnMvc3RhZ2luZy93aW5ib25kL3diMzVyZWdfcy5oCmluZGV4IDMyZWY0YjguLjRlZmYwMDkgMTAwNjQ0Ci0tLSBhL2RyaXZlcnMvc3RhZ2luZy93aW5ib25kL3diMzVyZWdfcy5oCisrKyBiL2RyaXZlcnMvc3RhZ2luZy93aW5ib25kL3diMzVyZWdfcy5oCkBAIC01LDk4ICs1LDEwMCBAQAogI2luY2x1ZGUgPGxpbnV4L3R5cGVzLmg+CiAjaW5jbHVkZSA8YXNtL2F0b21pYy5oPgogCi0vLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLyoKLQkJCQlIQUwgc2V0dGluZyBmdW5jdGlvbgorLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICoKKyAqCQkJSEFMIHNldHRpbmcgZnVuY3Rpb24KKyAqCisgKgkJPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICoJCXxVeHh8IAl8RHh4fAl8TXh4fAl8QkJ8CXxSRnwKKyAqCQk9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKgkJCXwJCQkJCXwKKyAqCQlXYjM1UmVnX1JlYWQJCVdiMzVSZWdfV3JpdGUKKyAqCisgKgkJLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICoJCQkJV2JVc2JfQ2FsbFVTQkRBU3luYwlzdXBwbGllZCBCeSBXYlVzYiBtb2R1bGUKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09P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mZmVyOwogCX07Ci0JdTgJCVJFU0VSVkVEWzRdOyAvLyBzcGFjZSByZXNlcnZlZCBmb3IgY29tbXVuaWNhdGlvbgotCXUxNgkJSU5ERVg7IC8vIEZvciBzdG9yaW5nIHRoZSByZWdpc3RlciBpbmRleAotCXU4CQlSRVNFUlZFRF9WQUxJRDsJLy8gSW5kaWNhdGUgd2hldGhlciB0aGUgUkVTRVJWRUQgc3BhY2UgaXMgdmFsaWQgYXQgdGhpcyBjb21tYW5kLgotCXU4CQlESVJFQ1Q7IC8vIDA6SW4gICAxOk91dAorCXU4CQlSRVNFUlZFRFs0XTsJLyogc3BhY2UgcmVzZXJ2ZWQgZm9yIGNvbW11bmljYXRpb24gKi8KKwl1MTYJCUlOREVYOwkJLyogRm9yIHN0b3JpbmcgdGhlIHJlZ2lzdGVyIGluZGV4ICovCisJdTgJCVJFU0VSVkVEX1ZBTElEOwkvKiBJbmRpY2F0ZSB3aGV0aGVyIHRoZSBSRVNFUlZFRCBzcGFjZSBpcyB2YWxpZCBhdCB0aGlzIGNvbW1hbmQuICovCisJdTgJCURJUkVDVDsJCS8qIDA6SW4gICAxOk91dCAqLwogfTsKIAotLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS8vIEludGVybmFsIHZhcmlhYmxlIGZvciBtb2R1bGUKLS8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisvKgorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBJbnRlcm5hbCB2YXJpYWJsZSBmb3IgbW9kdWxlCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqLwogI2RlZmluZSBNQVhfU1EzX0ZJTFRFUl9TSVpFCQk1CiBzdHJ1Y3Qgd2IzNV9yZWcgewotCS8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PQotCS8vIFJlZ2lzdGVyIEJhbmsgYmFja3VwCi0JLy89PT09PT09PT09PT09PT09PT09PT09PT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AyIFdpbmJvbmQgRWxlY3Ryb25pYyBDb3Jwb3JhdGlvbgotLy8KLS8vICBNb2R1bGUgTmFtZToKLS8vICAgIFdiMzVSeC5jCi0vLwotLy8gIEFic3RyYWN0OgotLy8gICAgUHJvY2Vzc2luZyB0aGUgUnggbWVzc2FnZSBmcm9tIGRvd24gbGF5ZXIKLS8vCi0vLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKy8qCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiAgQ29weXJpZ2h0IChjKSAxOTk2LTIwMDIgV2luYm9uZCBFbGVjdHJvbmljIENvcnBvcmF0aW9uCisgKgorICogIE1vZHVsZSBOYW1lOgorICogICAgV2IzNVJ4LmMKKyAqCisgKiAgQWJzdHJhY3Q6CisgKiAgICBQcm9jZXNzaW5nIHRoZSBSeCBtZXNzYWdlIGZyb20gZG93biBsYXllcgorICoKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqLwogI2luY2x1ZGUgPGxpbnV4L3VzYi5oPgogI2luY2x1ZGUgPGxpbnV4L3NsYWIuaD4KIApAQCAtMzAsMTYgKzMyLDcgQEAKIAkJcmV0dXJuOwogCX0KIAotCW1lbWNweShza2JfcHV0KHNrYiwgUGFja2V0U2l6ZSksCi0JICAgICAgIHBSeEJ1ZmZlckFkZHJlc3MsCi0JICAgICAgIFBhY2tldFNpemUpOwotCi0vKgotCXJ4X3N0YXR1cy5yYXRlID0gMTA7Ci0Jcnhfc3RhdHVzLmNoYW5uZWwgPSAxOwotCXJ4X3N0YXR1cy5mcmVxID0gMTIzNDU7Ci0Jcnhfc3RhdHVzLnBoeW1vZGUgPSBNT0RFX0lFRUU4MDIxMUI7Ci0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Ci0JI2VuZGlmCisjZW5kaWYKIH0KIApkaWZmIC0tZ2l0IGEvZHJpdmVycy9zdGFnaW5nL3dpbmJvbmQvd2IzNXR4X2YuaCBiL2RyaXZlcnMvc3RhZ2luZy93aW5ib25kL3diMzV0eF9mLmgKaW5kZXggYTdhZjljYi4uMWQzYjUxNSAxMDA2NDQKLS0tIGEvZHJpdmVycy9zdGFnaW5nL3dpbmJvbmQvd2IzNXR4X2YuaAorKysgYi9kcml2ZXJzL3N0YWdpbmcvd2luYm9uZC93YjM1dHhfZi5oCkBAIC00LDE4ICs0LDIwIEBACiAjaW5jbHVkZSAiY29yZS5oIgogI2luY2x1ZGUgIndiaGFsX2YuaCIKIAotLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS8vIEludGVyZmFjZSBmdW5jdGlvbiBkZWNsYXJlCi0vLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotdW5zaWduZWQgY2hhciBXYjM1VHhfaW5pdGlhbCgJIHN0cnVjdCBod19kYXRhICogcEh3RGF0YSApOwotdm9pZCBXYjM1VHhfZGVzdHJveSggIHN0cnVjdCBod19kYXRhICogcEh3RGF0YSApOwotdW5zaWduZWQgY2hhciBXYjM1VHhfZ2V0X3R4X2J1ZmZlciggIHN0cnVjdCBod19kYXRhICogcEh3RGF0YSwgIHU4ICoqcEJ1ZmZlciApOworLyoKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogSW50ZXJmYWNlIGZ1bmN0aW9uIGRlY2xhcmUKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICovCit1bnNpZ25lZCBjaGFyIFdiMzVUeF9pbml0aWFsKHN0cnVjdCBod19kYXRhICpod19kYXRhKTsKK3ZvaWQgV2IzNVR4X2Rlc3Ryb3koc3RydWN0IGh3X2RhdGEgKmh3X2RhdGEpOwordW5zaWduZWQgY2hhciBXYjM1VHhfZ2V0X3R4X2J1ZmZlcihzdHJ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PT09PT09PT09PT09PT0KKyAqIERldmljZSByZWxhdGVkIGluY2x1ZGUKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorKi8KICNpbmNsdWRlICJ3YjM1cmVnX2YuaCIKICNpbmNsdWRlICJ3YjM1dHhfZi5oIgogI2luY2x1ZGUgIndiMzVyeF9mLmgiCiAKICNpbmNsdWRlICJjb3JlLmgiCiAKLS8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0vLyBGdW5jdGlvbiBkZWNsYXJhdGlvbgotLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLXZvaWQgaGFsX3JlbW92ZV9tYXBwaW5nX2tleSggIHN0cnVjdCBod19kYXRhICogcEh3RGF0YSwgIHU4ICpwbWFjX2FkZHIgKTsKLXZvaWQgaGFsX3JlbW92ZV9kZWZhdWx0X2tleSggIHN0cnVjdCBod19kYXRhICogcEh3RGF0YSwgIHUzMiBpbmRleCApOwotdW5zaWduZWQgY2hhciBoYWxfc2V0X21hcHBpbmdfa2V5KCAgc3RydWN0IGh3X2RhdGEgKiBhZGFwdGVyLCAgdTggKnBtYWNfYWRkciwgIHU4IG51bGxfa2V5LCAgdTggd2VwX29uLCAgdTggKnB0eF90c2MsICB1OCAqcHJ4X3RzYywgIHU4IGtleV90eXBlLCAgdTgga2V5X2xlbiwgIHU4ICpwa2V5X2RhdGEgKTsKLXVuc2lnbmVkIGNoYXIgaGFsX3NldF9kZWZhdWx0X2tleSggIHN0cnVjdCBod19kYXRhICogYWRhcHRlciwgIHU4IGluZGV4LCAgdTggbnVsbF9rZXksICB1OCB3ZXBfb24sICB1OCAqcHR4X3RzYywgIHU4ICpwcnhfdHNjLCAgdTgga2V5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U0NSSVBUT1JfQlVGRkVSX0lOREVYXTsKKwl2b2lkCSpidWZmZXJfYWRkcmVzc1tNQVhfREVTQ1JJUFRPUl9CVUZGRVJfSU5ERVhdOwogfTsKIAogCi0jZGVmaW5lIERFRkFVTFRfTlVMTF9QQUNLRVRfQ09VTlQJCTE4MDAwMAkvLzIwMDYwODI4LjEgQWRkLiAxODAgc2Vjb25kcworI2RlZmluZSBERUZBVUxUX05VTExfUEFDS0VUX0NPVU5UCTE4MDAwMAkvKiAxODAgc2Vjb25kcyAqLwogCi0jZGVmaW5lIE1BWF9UWFZHQV9FRVBST00JOQkvL0hvdyBtYW55IHdvcmQodTE2KSBvZiBFRVBST00gd2lsbCBiZSB1c2VkIGZvciBUeFZHQQotI2RlZmluZSBNQVhfUkZfUEFSQU1FVEVSCTMyCisjZGVmaW5lIE1BWF9UWFZHQV9FRVBST00JCTkJLyogSG93IG1hbnkgd29yZCh1MTYpIG9mIEVFUFJPTSB3aWxsIGJlIHVzZWQgZm9yIFR4VkdBICovCisjZGVmaW5lIE1BWF9SRl9QQVJBTUVURVIJCTMyCiAKIHR5cGVkZWYgc3RydWN0IF9UWFZHQV9GT1JfNTAgewotCXU4ICAgICAgQ2hhbk5vOwotCXU4ICAgICAgVHhWZ2FWYWx1ZTsKKwl1OAlDaGFuTm87CisJdTgJVHhWZ2FWYWx1ZTsKIH0gVFhWR0FfRk9SXzUwOwogCiAKLS8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0vLyBEZXZpY2UgcmVsYXRlZCBpbmNsdWRlCi0vLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorLyoKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIERldmljZSByZWxhdGVkIGluY2x1ZGUKKyAqID09PT09PT09PT09PT09PT09PT09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3VycmVudERlZmF1bHRLZXlJbmRleDsKIAl1MzIJQ3VycmVudERlZmF1bHRLZXlMZW5ndGg7CiAKLQkvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotCS8vIFZhcmlhYmxlIGZvciBlYWNoIG1vZHVsZQotCS8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0Jc3RydWN0IHdiX3VzYglXYlVzYjsgLy8gTmVlZCBXYlVzYi5oCi0Jc3RydWN0IHdiMzVfcmVnCXJlZzsgLy8gTmVlZCBXYjM1UmVnLmgKLQlzdHJ1Y3Qgd2IzNV90eAlXYjM1VHg7IC8vIE5lZWQgV2IzNVR4LmgKLQlzdHJ1Y3Qgd2IzNV9yeAlXYjM1Ung7IC8vIE5lZWQgV2IzNVJ4LmgKKwkvKgorCSAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisJICogVmFyaWFibGUgZm9yIGVhY2ggbW9kdWxlCisJICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKwkgKi8KKwlzdHJ1Y3Qgd2JfdXNiCQlXYlVzYjsJLyogTmVlZCBXYlVzYi5oICovCisJc3RydWN0IHdiMzVfcmVnCQlyZWc7CS8qIE5lZWQgV2IzNVJlZy5oICovCisJc3RydWN0IHdiMzVfdHgJCVdiMzVUeDsgLyogTmVlZCBXYjM1VHguaCAqLworCXN0cnVjdCB3YjM1X3J4CQlXYjM1Ung7IC8qIE5lZWQgV2IzNVJ4LmggKi8KIAotCXN0cnVjdCB0aW1lcl9saXN0CUxFRFRpbWVyOy8vIEZvciBMRUQKKwlzdHJ1Y3QgdGltZXJfbGlzdAlMRURUaW1lcjsgLyogRm9yIExFRCAqLwogCi0JdTMyCQlMRURwb2ludDsvLyBGb3IgTEVEC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4sIFMpOyB9CiAKIAotI2RlZmluZSBEQkdfRVJST1IoQSxTLi4uKSAgIHtpZiAoREJHX0ZMQUdTKEEpICYgREJHX0VSUk9SX09OKSBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHtEQkdfUFJJTlQoIiVzOkVSUk9SOiVzICIsREJHX05BTUUoQSksX19GVU5DX18pO0RCR19QUklOVEMoUyk7REJHX1RSQVA7fX0KKyNkZWZpbmUgREJHX0VSUk9SKEEsIFMuLi4pICAge2lmIChEQkdfRkxBR1MoQSkgJiBEQkdfRVJST1JfT04pIHtcCisJCQkJREJHX1BSSU5UKCIlczpFUlJPUjolcyAiLCBEQkdfTkFNRShBKSwgX19GVU5DX18pO1wKKwkJCQlEQkdfUFJJTlRDKFMpOyBcCisJCQkJREJHX1RSQVA7IFwKKwkJCQl9IFwKKwkJCQl9CiAKIAotI2RlZmluZSBEQkdfV0FSTklORyhBLFMuLi4pIHtpZiAoREJHX0ZMQUdTKEEpICYgREJHX1dBUk5JTkdfT04pIFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge0RCR19QUklOVCgiJXM6V0FSTklORzolcyAiLERCR19OQU1FKEEpLF9fRlVOQ19fKTtEQkdfUFJJTlRDKFMpO319CisjZGVmaW5lIERCR19XQVJOSU5HKEEsIFMuLi4pIHtpZiAoREJHX0ZMQUdTKEEpICYgREJHX1dBUk5JTkdfT04pIHtcCisJCQkJREJHX1BSSU5UKCIlczpXQVJOSU5HOiVzICIsIERCR19OQU1FKEEpLCBfX0ZVTkNfXyk7XAorCQkJCURCR19QUklOVEMoUyk7IH0gfQogCiAKLSNkZWZpbmUgREJHX05PVElDRShBLFMuLi4pICB7aWYgKERCR19GTEFHUyhBKSAmIERCR19OT1RJQ0VfT04pIFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge0RCR19QUklOVCgiJXM6Tk9USUNFOiVzICIsREJHX05BTUUoQSksX19GVU5DX18pO0RCR19QUklOVEMoUyk7fX0KKyNkZWZpbmUgREJHX05PVElDRShBLCBTLi4uKSAge2lmIChEQkdfRkxBR1MoQSkgJiBEQkdfTk9USUNFX09OKSB7XAorCQkJCURCR19QUklOVCgiJXM6Tk9USUNFOiVzICIsIERCR19OQU1FKEEpLCBfX0ZVTkNfXyk7XAorCQkJCURCR19QUklOVEMoUyk7IFwKKwkJCQl9IFwKKwkJCQl9CiAKIAotI2RlZmluZSBEQkdfVFJBQ0UoQSxTLi4uKSAgIGRvIHtpZiAoREJHX0ZMQUdTKEEpICYgREJHX1RSQUNFX09OKSBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHtEQkdfUFJJTlQoIiVzOiVzICIsREJHX05BTUUoQSksX19GVU5DX18pO0RCR19QUklOVEMoUyk7fX0gd2hpbGUgKDApCisjZGVmaW5lIERCR19UUkFDRShBLCBTLi4uKSAgIGRvIHtpZiAoREJHX0ZMQUdTKEEpICYgREJHX1RSQUNFX09OKSB7XAorCQkJCURCR19QUklOVCgiJXM6JXMgIiwgREJHX05BTUUoQSksIF9fRlVOQ19fKTtcCisJCQkJREJHX1BSSU5UQyhTKTsgfSB9IHdoaWxlICgwKQogCiAKLSNkZWZpbmUgREJHX1JYKEEsUy4uLikgICAgICB7aWYgKERCR19GTEFHUyhBKSAmIERCR19SWF9PTikgXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7REJHX1BSSU5UKFMpO319CisjZGVmaW5lIERCR19SWChBLCBTLi4uKSAgICAgIHtpZiAoREJHX0ZMQUdTKEEpICYgREJHX1JYX09OKSB7XAorCQkJCURCR19QUklOVChTKTsgfSB9CiAKIAotI2RlZmluZSBEQkdfVFgoQSxTLi4uKSAgICAgIHtpZiAoREJHX0ZMQUdTKEEpICYgREJHX1RYX09OKSBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHtEQkdfUFJJTlQoUyk7fX0KKyNkZWZpbmUgREJHX1RYKEEsIFMuLi4pICAgICAge2lmIChEQkdfRkxBR1MoQSkgJiBEQkdfVFhfT04pIHtcCisJCQkJREJHX1BSSU5UKFMpOyB9IH0KIAotI2RlZmluZSBEQkdfRFMoQSxTLi4uKSAgICAgIHtpZiAoREJHX0ZMQUdTKEEpICYgREJHX0RTX09OKSBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHtEQkdfUFJJTlQoUyk7fX0KKyNkZWZpbmUgREJHX0RTKEEsIFMuLi4pICAgICAge2lmIChEQkdfRkxBR1MoQSkgJiBEQkdfRFNfT04pIHtcCisJCQkJREJHX1BSSU5UKFMpOyB9IH0KIAogCi0jZGVmaW5lIERCR19BU1NFUlQoQykgICAgICAge2lmICghKEMpKSBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHtEQkdfUFJJTlQoIkFTU0VSVCglcykgLS0gJXMjJWQgKCVzKVxuIiwgXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI0MsX19GSUxFX18sX19MSU5FX18sX19GVU5DX18pOyBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCR19UUkFQO319CisjZGVmaW5lIERCR19BU1NFUlQoQykJCXsgXAorCQkJCWlmICghKEMpKSB7XAorCQkJCQlEQkdfUFJJTlQoIkFTU0VSVCglcykgLS0gJXMjJWQgKCVzKVxuIiwgXAorCQkJCQkjQywgX19GSUxFX18sIF9fTElORV9fLCBfX0ZVTkNfXyk7IFwKKwkJCQkJREJHX1RSQVA7IFwKKwkJCQkJfSBcCisJCQkJCX0KIAogdHlwZWRlZiBzdHJ1Y3QgewogICAgIGNoYXIgICAgICAgICAgICpkYmdOYW1lOwpAQCAtMTgzLDcgKzE5Nyw3IEBACiAKIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0jZWxzZSAvLyBEQkcKKyNlbHNlIC8qIERCRyAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKICNkZWZpbmUgREJHX0RFRk4KQEAgLTE5MiwyMSArMjA2LDIxIEBACiAjZGVmaW5lIERCR19QUklOVChTLi4uKQogI2RlZmluZSBEQkdfRU5URVIoQSkKICNkZWZpbmUgREJHX0xFQVZFKEEpCi0jZGVmaW5lIERCR19QQVJBTShBLE4sRixTLi4uKQotI2RlZmluZSBEQkdfRVJST1IoQSxTLi4uKQotI2RlZmluZSBEQkdfV0FSTklORyhBLFMuLi4pCi0jZGVmaW5lIERCR19OT1RJQ0UoQSxTLi4uKQotI2RlZmluZSBEQkdfVFJBQ0UoQSxTLi4uKQotI2RlZmluZSBEQkdfUlgoQSxTLi4uKQotI2RlZmluZSBEQkdfVFgoQSxTLi4uKQotI2RlZmluZSBEQkdfRFMoQSxTLi4uKQorI2RlZmluZSBEQkdfUEFSQU0oQSwgTiwgRiwgUy4uLikKKyNkZWZpbmUgREJHX0VSUk9SKEEsIFMuLi4pCisjZGVmaW5lIERCR19XQVJOSU5HKEEsIFMuLi4pCisjZGVmaW5lIERCR19OT1RJQ0UoQSwgUy4uLikKKyNkZWZpbmUgREJHX1RSQUNFKEEsIFMuLi4pCisjZGVmaW5lIERCR19SWChBLCBTLi4uKQorI2RlZmluZSBEQkdfVFgoQSwgUy4uLikKKyNkZWZpbmUgREJHX0RTKEEsIFMuLi4pCiAjZGVmaW5lIERCR19BU1NFUlQoQykKIAotI2VuZGlmIC8vIERCRworI2VuZGlmIC8qIERCRyAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAogCiAKLSNlbmRpZiAvLyBfREVCVUdfSAorI2VuZGlmIC8qIF9ERUJVR19IICovCiAKZGlmZiAtLWdpdCBhL2RyaXZlcnMvc3RhZ2luZy93bGFnczQ5X2gyL2RoZi5jIGIvZHJpdmVycy9zdGFnaW5nL3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XAgICAgICAgIAk9IHsgTE9GKENGR19TVVBfUkFOR0VfU1RSQ1QpLCBDRkdfTklDX01GSV9TVVBfUkFOR0UgfTsKIENGR19TVVBfUkFOR0VfU1RSQ1QgCWNmaV9zdXAgICAgICAgIAk9IHsgTE9GKENGR19TVVBfUkFOR0VfU1RSQ1QpLCBDRkdfTklDX0NGSV9TVVBfUkFOR0UgfTsKIC8qIE5vdGU6IGNvdWxkIGJlIHVzZWQgcmF0aGVyIHRoYW4gdGhlIGFib3ZlIGV4cGxhaW5lZCBhbmQgZGVmaW5lZCBETF9TSVpFIGlmIG5lZWQgYXJpc2VzCkBAIC0xNjQsNyArMTUwLDcgQEAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogIFBST1RPVFlQRVMgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0YXRpYyBpbnQJCQkJY2hlY2tfY29tcF9mdyggbWVtaW1hZ2UgKmZ3ICk7CitzdGF0aWMgaW50CQkJCWNoZWNrX2NvbXBfZncobWVtaW1hZ2UgKmZ3KTsKIAogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xODUsMTggKzE3MSwxOCBAQAogKi5FTkRET0MJCQkJRU5EIERPQ1VNRU5UQVRJT04KICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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ioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKQEAgLTM1MSw3ICszNDAsNyBAQAogKi5FTkRET0MJCQkJRU5EIERPQ1VNRU5UQVRJT04KICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiBpbnQKLWRoZl9kb3dubG9hZF9mdyggdm9pZCAqaWZicCwgbWVtaW1hZ2UgKmZ3ICkKK2RoZl9kb3dubG9hZF9mdyh2b2lkICppZmJwLCBtZW1pbWFnZSAqZncpCiB7CiBpbnQgCQkJCXJjID0gSENGX1NVQ0NFU1M7CiBMVFZfSU5GT19TVFJVQ1RfUFRSIHBwID0gbHR2X2luZm87CkBAIC0zNTksMzIgKzM0OCwzNCBAQAogTFRWUCAJCQkJbHR2cDsKIGludAkJCQkJaTsKIAotCU1NREFTU0VSVCggZncgIT0gTlVMTCwgMCApCi0JLy92YWxpZGF0ZSB0aGUgaW1hZ2UKLQlmb3IgKCBpID0gMDsgaSA8IHNpemVvZihzaWduYXR1cmUpICYmIGZ3LT5zaWduYXR1cmVbaV0gPT0gc2lnbmF0dXJlW2ldOyBpKysgKSAvKk5PUCovOwotCWlmICggaSAhPSBzaXplb2Yoc2lnbmF0dXJlKSAJCXx8CisJTU1EQVNTRVJUKGZ3ICE9IE5VTEwsIDApCisJLyogdmFsaWRhdGUgdGhlIGltYWdlICovCisJZm9yIChpID0gMDsgaSA8IHNpemVvZihzaWduYXR1cmUpICYmIGZ3LT5zaWduYXR1cmVbaV0gPT0gc2lnbmF0dXJlW2ldOyBpKyspCisJCTsgLyogTk9QICovCisJaWYgKGkgIT0gc2l6ZW9mKHNpZ25hdHVyZSkgCQl8fAogCQkgZnctPnNpZ25hdHVyZVtpXSAhPSAweDAxCQl8fAotCQkgLy9jaGVjayBmb3IgYmluY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0ZGU0VUXzEsIG9mZnNldCApOwogCQlpZiAoIHR5cGUgPT0gSU9fSU4gKSB7CmRpZmYgLS1naXQgYS9kcml2ZXJzL3N0YWdpbmcvd2xhZ3M0OV9oMi93bF9jcy5jIGIvZHJpdmVycy9zdGFnaW5nL3dsYWdzNDlfaDIvd2xfY3MuYwppbmRleCBjOWQ5OWQ4Li4xMGFiZDQwIDEwMDY0NAotLS0gYS9kcml2ZXJzL3N0YWdpbmcvd2xhZ3M0OV9oMi93bF9jcy5jCisrKyBiL2RyaXZlcnMvc3RhZ2luZy93bGFnczQ5X2gyL3dsX2NzLmMKQEAgLTEwNSwxMyArMTA1LDYgQEAKIAogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogIG1hY3JvIGRlZmluaXRpb25zCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotI2RlZmluZSBDU19DSEVDSyhmbiwgcmV0KSBkbyB7IFwKLSAgICAgICAgICAgICAgICAgICAgbGFzdF9mbiA9IChmbik7IGlmICgobGFzdF9yZXQgPSAocmV0KSkgIT0gMCkgZ290byBjc19mYWlsZWQ7IFwKLSAgICAgICAgICAgIH0gd2hpbGUgKDApCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgKiAgZ2xvYmFsIGRlZmluaXRpb25zCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogI2lmIERCRwpAQCAtMzAyLDcgKzI5NSw3IEBACiB7CiAgICAgc3RydWN0IG5ldF9kZXZpY2UgICAgICAgKmRldjsKICAgICBpbnQgaTsKLSAgICBpbnQgICAgICAgIC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l9vcGVuOwotICAgIGRldi0+c3RvcCAgICAgICAgICAgICAgID0gJndsX2FkYXB0ZXJfY2xvc2U7Ci0gICAgZGV2LT5kb19pb2N0bCAgICAgICAgICAgPSAmd2xfaW9jdGw7Ci0KLSAgICBkZXYtPnR4X3RpbWVvdXQgICAgICAgICA9ICZ3bF90eF90aW1lb3V0OwotCi0jaWZkZWYgQ09ORklHX05FVF9QT0xMX0NPTlRST0xMRVIKLSAgICBkZXYtPnBvbGxfY29udHJvbGxlciA9IHdsX3BvbGw7Ci0jZW5kaWYKLQotI2VuZGlmIC8vIChMSU5VWF9WRVJTSU9OX0NPREUgPiBLRVJORUxfVkVSU0lPTigyLDYsMzApKQogCiAgICAgZGV2LT53YXRjaGRvZ190aW1lbyAgICAgPSBUWF9USU1FT1VUOwogCkBAIC0xOTk1LDggKzE5NzAsMTAgQEAKICAgICAgICAgICAgICAgICBwb3J0ID0gKCBoZnNfc3RhdCA+PiA4ICkgJiAweDAwMDc7CiAgICAgICAgICAgICAgICAgREJHX1JYKCBEYmdJbmZvLCAiUnggZnJhbWUgZm9yIHBvcnQgJWRcbiIsIHBvcnQgKTsKIAotICAgICAgICAgICAgICAgIGlmKCggcGt0bGVuID0gR0VUX0JVRl9DTlQoIGRlc2NfbmV4dCApKSAhPSAwICkgewotICAgICAgICAgICAgICAgICAgICBpZigoIHNrYiA9IEFMTE9DX1NLQiggcGt0bGVuICkpICE9IE5VTEwgKSB7CisgICAgICAgICAgICAgICAgcGt0bGVuID0gR0VUX0JVRl9DTlQoZGVzY19uZXh0KTsKKyAgICAgICAgICAgICAgICBpZiAocGt0bGVuICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgc2tiID0gQUxMT0NfU0tCKHBrdGxlbik7CisgICAgICAgICAgICAgICAgICAgIGlmIChza2IgIT0gTlVMTCkgewogICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoKCBwb3J0ICkgewogI2lmZGVmIFVTRV9XRFMKICAgICAgICAgICAgICAgICAgICA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QkJaWYgKCAoIHZhbHVlWzBdIHwgKCdZJ14neScpICkgPT0gJ3knICkgcmMgPSAxOwotLy8JfSBlbHNlIHsKLS8vCQl0aGlzIHNob3VsZCBub3QgYmUgZGVidWcgdGltZSBpbmZvLCBpdCBpcyBhbiBlbmR1c2VyIGRhdGEgZW50cnkgZXJyb3IgOz8KLS8vCQlEQkdfV0FSTklORyggRGJnSW5mbywgIiVzIGludmFsaWQ7IHdpbGwgYmUgaWdub3JlZFxuIiwgUEFSTV9OQU1FX01JQ1JPV0FWRV9ST0JVU1RORVNTICk7CisJaWYgKHN0cmxlbih2YWx1ZSkgPT0gMSkgeworCQlpZiAoKHZhbHVlWzBdIHwgKCdZJ14neScpKSA9PSAneScpCisJCQlyYyA9IDE7CisJLyogfSBlbHNlIHsgKi8KKwkJLyogdGhpcyBzaG91bGQgbm90IGJlIGRlYnVnIHRpbWUgaW5mbywgaXQgaXMgYW4gZW5kdXNlciBkYXRhIGVudHJ5IGVycm9yIDs/ICovCisJCS8qIERCR19XQVJOSU5HKERiZ0luZm8sICIlcyBpbnZhbGlkOyB3aWxsIGJlIGlnbm9yZWRcbiIsIFBBUk1fTkFNRV9NSUNST1dBVkVfUk9CVVNUTkVTUyk7ICovCiAJfQogCXJldHVybiByYzsKLX0gLy8gcGFyc2VfeWVzX25vCit9IC8qIHBhcnNlX3llc19ubyAqLwogCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xNDksMTMgKzE1MSwxMyBAQAogICogICAgICBOL0EKICAqCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotdm9pZCBwYXJzZV9jb25maWcoIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYgKQordm9pZCBwYXJzZV9jb25maWcoc3RydWN0IG5ldF9kZXZpY2UgKmRld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gdG8gdGhlIG9yaWdpbmFsIGNvbnRleHQgKi8KLSNlbmRpZiAvLyBCSU5fREwKKwkJc2V0X2ZzKGZzKTsJCQkvKiBSZXR1cm4gdG8gdGhlIG9yaWdpbmFsIGNvbnRleHQgKi8KKyNlbmRpZiAvKiBCSU5fREwgKi8KIAotCURCR19MRUFWRSggRGJnSW5mbyApOworCURCR19MRUFWRShEYmdJbmZvKTsKIAlyZXR1cm47Ci19IC8vIHBhcnNlX2NvbmZpZworfSAvKiBwYXJzZV9jb25maWcgKi8KIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICAqCXJlYWRsaW5lKCkKQEAgLTI5OCwxNyArMjk4LDE3IEBACiAgKiAgICAgIC0xIG9uIGVycm9yCiAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLWludCByZWFkbGluZSggaW50IGZpbGVkZXNjLCBjaGFyICpidWZmZXIgKQoraW50IHJlYWRsaW5lKGludCBmaWxlZGVzYywgY2hhciAqYnVmZmVyKQogewogCWludCByZXN1bHQgPSAtMTsKIAlpbnQgYnl0ZXNfcmVhZCA9IDA7CiAJLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwogCiAJLyogTWFrZSBzdXJlIHRoZSBmaWxlIGRlc2NyaXB0b3IgaXMgZ29vZCAqLwotCWlmICggZmlsZWRlc2MgIT0gLTEgKSB7CisJaWYgKGZpbGVkZXNjICE9IC0xKSB7CiAJCS8qIFJlYWQgaW4gZnJvbSB0aGUgZmlsZSBieXRlIGJ5IGJ5dGUgdW50aWwgYSBuZXdsaW5lIGlzIHJlYWNoZWQgKi8KLQkJd2hpbGUoKCByZXN1bHQgPSByZWFkKCBmaWxlZGVzYywgJmJ1ZmZlcltieXRlc19yZWFkXSwgMSApKSA9PSAxICkgewotCQkJaWYgKCBidWZmZXJbYnl0ZXNfcmVhZF0gPT0gJ1xuJyApIHsKKwkJd2hpbGUgKChyZXN1bHQgPSByZWFkKGZpbGVkZXNjLCAmYnVmZmVyW2J5dGVzX3JlYWRdLCAxKSkgPT0gMSkgeworCQkJaWYgKGJ1ZmZlcltieXRlc19yZWFkXSA9PSAnXG4nKSB7CiAJCQkJYnVmZmVyW2J5dGVzX3JlYWRdID0gJ1wwJzsKIAkJCQlieXRlc19yZWFkKys7CiAJCQkJYnJlYWs7CkBAIC0zMTgsMTIgKzMxOCwxMSBAQAogCX0KIAogCS8qIFJldHVybiB0aGUgbnVtYmVyIG9mIGJ5dGVzIHJlYWQgKi8KLQlpZiAoIHJlc3VsdCA9PSAtMSApIHsKKwlpZiAocmVzdWx0ID09IC0xKQogCQlyZXR1cm4gcmVzdWx0OwotCX0gZWxzZSB7CisJZWxzZQogCQlyZXR1cm4gYnl0ZXNfcmVhZDsKLQl9Ci19IC8vIHJlYWRsaW5lCit9IC8qIHJlYWRsaW5lICovCiAvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpAQCAtMzQ2LDcgKzM0NSw3IEBACiAgKiAgICAgIE4vQQogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIHRyYW5zbGF0ZV9vcHRpb24oIGNoYXIgKmJ1ZmZlciwgc3RydWN0IHdsX3ByaXZhdGUgKmxwICkKK3ZvaWQgdHJhbnNsYXRlX29wdGlvbihjaGFyICpidWZmZXIsIHN0cn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C8qIFVTRV9XRFMgKi8KIAl9CiAjZW5kaWYgIC8qIChIQ0ZfVFlQRSkgJiBIQ0ZfVFlQRV9BUCAqLwogCiAJcmV0dXJuOwotfSAvLyB0cmFuc2xhdGVfb3B0aW9uCit9IC8qIHRyYW5zbGF0ZV9vcHRpb24gKi8KIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC05OTYsNyArODk5LDcgQEAKICAqICAgICAgVGhlIG51bWJlciBvZiBieXRlcyBpbiB0aGUgZmluYWwgTUFDIGFkZHJlc3MsIHNob3VsZCBlcXVhbCB0byBFVEhfQUxFTi4KICAqCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotaW50IHBhcnNlX21hY19hZGRyZXNzKCBjaGFyICp2YWx1ZSwgdV9jaGFyICpieXRlX2FycmF5ICkKK2ludCBwYXJzZV9tYWNfYWRkcmVzcyhjaGFyICp2YWx1ZSwgdV9jaGFyICpieXRlX2FycmF5KQogewogCWludCAgICAgdmFsdWVfb2Zmc2V0ID0gMDsKIAlpbnQgICAgIGFycmF5X29mZnNldCA9IDA7CkBAIC0xMDA0LDExICs5MDcsMTEgQEAKIAljaGFyICAgIGJ5dGVfZmllbGRbM107CiAJLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwogCi0JbWVtc2V0KCBieXRlX2ZpZWxkLCAnXDAnLCAzICk7CisJbWVtc2V0KGJ5dGVfZmllbGQsICdcMCcsIDMpOwogCi0Jd2hpbGUoIHZhbHVlW3ZhbH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ZXNzCit9IC8qIHBhcnNlX21hY19hZGRyZXNzICovCiAvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpAQCAtMTA1Miw0MiArOTU1LDQyIEBACiAgKiAgICAgIE4vQQogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIFBhcnNlQ29uZmlnTGluZSggY2hhciAqcHN6TGluZSwgY2hhciAqKnBwc3pMVmFsLCBjaGFyICoqcHBzelJWYWwgKQordm9pZCBQYXJzZUNvbmZpZ0xpbmUoY2hhciAqcHN6TGluZSwgY2hhciAqKnBwc3pMVmFsLCBjaGFyICoqcHBzelJWYWwpCiB7CiAJaW50IGk7CiAJaW50IHNpemU7CiAJLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwogCi0JREJHX0ZVTkMoICJQYXJzZUNvbmZpZ0xpbmUiICk7Ci0JREJHX0VOVEVSKCBEYmdJbmZvICk7CisJREJHX0ZVTkMoIlBhcnNlQ29uZmlnTGluZSIpOworCURCR19FTlRFUihEYmdJbmZvKTsKIAogCS8qIGdldCBhIHNuYXBzaG90IG9mIG91ciBzdHJpbmcgc2l6ZSAqLwotCXNpemUgICAgICA9IHN0cmxlbiggcHN6TGluZSApOworCXNpemUgICAgICA9IHN0cmxlbihwc3pMaW5lKTsKIAkqcHBzekxWYWwgPSBOVUxMOwogCSpwcHN6UlZhbCA9IE5VTEw7CiAKLQlpZiAoIHBzekxpbmVbMF0gIT0gJyMnICYmCQkJCQkJCS8qIHNraXAgdG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G4iLCByKTsKK30KKworc3RhdGljIGlubGluZSB2b2lkIGFjeDU2NWFrbV9jbWQoc3RydWN0IGFjeDU2NWFrbV9kZXZpY2UgKm1kLCBpbnQgY21kKQoreworCWFjeDU2NWFrbV90cmFuc2ZlcihtZCwgY21kLCBOVUxMLCAwLCBOVUxMLCAwKTsKK30KKworc3RhdGljIGlubGluZSB2b2lkIGFjeDU2NWFrbV93cml0ZShzdHJ1Y3QgYWN4NTY1YWttX2RldmljZSAqbWQsCisJCQkgICAgICAgaW50IHJlZywgY29uc3QgdTggKmJ1ZiwgaW50IGxlbikKK3sKKwlhY3g1NjVha21fdHJhbnNmZXIobWQsIHJlZywgYnVmLCBsZW4sIE5VTEwsIDApOworfQorCitzdGF0aWMgaW5saW5lIHZvaWQgYWN4NTY1YWttX3JlYWQoc3RydWN0IGFjeDU2NWFrbV9kZXZpY2UgKm1kLAorCQkJICAgICAgaW50IHJlZywgdTggKmJ1ZiwgaW50IGxlbikKK3sKKwlhY3g1NjVha21fdHJhbnNmZXIobWQsIHJlZywgTlVMTCwgMCwgYnVmLCBsZW4pOworfQorCitzdGF0aWMgdm9pZCBod19ndWFyZF9zdGFydChzdHJ1Y3QgYWN4NTY1YWttX2RldmljZSAqbWQsIGludCBndWFyZF9tc2VjKQoreworCW1kLT5od19ndWFyZF93YWl0ID0gbXNlY3NfdG9famlmZmllcyhndWFyZF9tc2VjKTsKKwltZC0+aHdfZ3VhcmRfZW5kID0gamlmZmllcyArIG1kLT5od19ndWFyZF93YWl0OworfQorCitzdGF0aWMgdm9pZCBod19ndWFyZF93YWl0KHN0cnVjdCBhY3g1NjVha21fZGV2aWNlICptZCkKK3sKKwl1bnNpZ25lZCBsb25nIHdhaXQgPSBtZC0+aHdfZ3VhcmRfZW5kIC0gamlmZmllczsKKworCWlmICgobG9uZyl3YWl0ID4gMCAmJiB3YWl0IDw9IG1kLT5od19ndWFyZF93YWl0KSB7CisJCXNldF9jdXJyZW50X3N0YXRlKFRBU0tfVU5JTl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