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dW1uID0gPDQ+OworCQkJbGludXgsY29kZSA9IDw0OD47CisJCX07CisKKwkJa2V5X2MgeworCQkJa2V5cGFkLHJvdyA9IDwxPjsKKwkJCWtleXBhZCxjb2x1bW4gPSA8NT47CisJCQlsaW51eCxjb2RlID0gPDQ2PjsKKwkJfTsKKworCQlrZXlfZCB7CisJCQlrZXlwYWQscm93ID0gPDE+OworCQkJa2V5cGFkLGNvbHVtbiA9IDw2PjsKKwkJCWxpbnV4LGNvZGUgPSA8MzI+OworCQl9OworCisJCWtleV9lIHsKKwkJCWtleXBhZCxyb3cgPSA8MT47CisJCQlrZXlwYWQsY29sdW1uID0gPDc+OworCQkJbGludXgsY29kZSA9IDwxOD47CisJCX07CisJfTsKKworCWkyY0AxMzg2MDAwMCB7CisJCSNhZGRyZXNzLWNlbGxzID0gPDE+OworCQkjc2l6ZS1jZWxscyA9IDwwPjsKKwkJc2Ftc3VuZyxpMmMtc2RhLWRlbGF5ID0gPDEwMD47CisJCXNhbXN1bmcsaTJjLW1heC1idXMtZnJlcSA9IDwyMDAwMD47CisJCWdwaW9zID0gPCZncGQxIDAgMiAzIDA+LAorCQkJPCZncGQxIDEgMiAzIDA+OworCisJCWVlcHJvbUA1MCB7CisJCQljb21wYXRpYmxlID0gInNhbXN1bmcsMjRhZDB4ZDEiOworCQkJcmVnID0gPDB4NTA+OworCQl9OworCisJCWVlcHJvbUA1MiB7CisJCQljb21wYXRpYmxlID0gInNhbXN1bmcsMjRhZDB4ZDEiOworCQkJcmVnID0gPDB4NTI+OworCQl9OworCX07CisKKwlzZGhjaUAxMjUxMDAwMCB7CisJCXN0YXR1cyA9ICJkaXNhYmxlZCI7CisJfTsKKworCXNkaGNpQDEyNTIwMDAwIHsKKwkJc3RhdHVzID0gImRpc2FibGVkIjsKKwl9OworCisJc2RoY2lAMTI1NDAwMDAgeworCQlzdGF0dXMgPSAiZGlzYWJsZWQiOworCX07CisKKwlpMmNAMTM4NzAwMDAgeworCQlzdGF0dXMgPSAiZGl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yBub3Qgc2V0CisjIENPTkZJR19JTkVUX0RJQUcgaXMgbm90IHNldAorIyBDT05GSUdfSVBWNiBpcyBub3Qgc2V0CitDT05GSUdfVUVWRU5UX0hFTFBFUl9QQVRIPSIvc2Jpbi9ob3RwbHVnIgorQ09ORklHX01URD15CitDT05GSUdfTVREX0NNRExJTkVfUEFSVFM9eQorQ09ORklHX01URF9DSEFSPXkKK0NPTkZJR19NVERfQkxPQ0s9eQorQ09ORklHX01URF9DRkk9eQorQ09ORklHX01URF9KRURFQ1BST0JFPXkKK0NPTkZJR19NVERfQ0ZJX0FNRFNURD15CitDT05GSUdfTVREX1BIWVNNQVA9eQorQ09ORklHX01URF9EQVRBRkxBU0g9eQorQ09ORklHX01URF9OQU5EPXkKK0NPTkZJR19NVERfTkFORF9BVE1FTD15CitDT05GSUdfQkxLX0RFVl9MT09QPXkKK0NPTkZJR19CTEtfREVWX1JBTT15CitDT05GSUdfQkxLX0RFVl9SQU1fU0laRT04MTkyCitDT05GSUdfU0NTST15CitDT05GSUdfQkxLX0RFVl9TRD15CitDT05GSUdfU0NTSV9NVUxUSV9MVU49eQorQ09ORklHX05FVERFVklDRVM9eQorQ09ORklHX01JST15CitDT05GSUdfTUFDQj15CisjIENPTkZJR19JTlBVVF9NT1VTRURFVl9QU0FVWCBpcyBub3Qgc2V0CitDT05GSUdfSU5QVVRfRVZERVY9eQorIyBDT05GSUdfSU5QVVRfS0VZQk9BUkQgaXMgbm90IHNldAorIyBDT05GSUdfSU5QVVRfTU9VU0UgaXMgbm90IHNldAorQ09ORklHX0lOUFVUX1RPVUNIU0NSRUVOPXkKK0NPTkZJR19UT1VDSFNDUkVFTl9BRFM3ODQ2PXkKKyMgQ09ORklHX1NFUklPIGlzIG5vdCBzZXQKK0NPTkZJR19TRVJJQUxfQVRNRUw9eQorQ09ORklHX1NFUklBTF9BVE1FTF9DT05TT0xFPXkKK0NPTkZJR19IV19SQU5ET009eQorQ09ORklHX0kyQz15CitDT05GSUdfSTJDX0N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BDTV9PU1M9eQorQ09ORklHX1NORF9TRVFVRU5DRVJfT1NTPXkKKyMgQ09ORklHX1NORF9WRVJCT1NFX1BST0NGUyBpcyBub3Qgc2V0CitDT05GSUdfVVNCPXkKK0NPTkZJR19VU0JfREVWSUNFRlM9eQorIyBDT05GSUdfVVNCX0RFVklDRV9DTEFTUyBpcyBub3Qgc2V0CitDT05GSUdfVVNCX01PTj15CitDT05GSUdfVVNCX09IQ0lfSENEPXkKK0NPTkZJR19VU0JfU1RPUkFHRT15CitDT05GSUdfVVNCX0dBREdFVD15CitDT05GSUdfVVNCX1pFUk89bQorQ09ORklHX1VTQl9HQURHRVRGUz1tCitDT05GSUdfVVNCX0ZJTEVfU1RPUkFHRT1tCitDT05GSUdfVVNCX0dfU0VSSUFMPW0KK0NPTkZJR19NTUM9eQorQ09ORklHX01NQ19BVDkxPW0KK0NPTkZJR19ORVdfTEVEUz15CitDT05GSUdfTEVEU19DTEFTUz15CitDT05GSUdfTEVEU19HUElPPXkKK0NPTkZJR19MRURTX1RSSUdHRVJTPXkKK0NPTkZJR19MRURTX1RSSUdHRVJfVElNRVI9eQorQ09ORklHX0xFRFNfVFJJR0dFUl9IRUFSVEJFQVQ9eQorQ09ORklHX1JUQ19DTEFTUz15CitDT05GSUdfUlRDX0RSVl9BVDkxU0FNOT15CitDT05GSUdfRVhUMl9GUz15CitDT05GSUdfTVNET1NfRlM9eQorQ09ORklHX1ZGQVRfRlM9eQorQ09ORklHX1RNUEZTPXkKK0NPTkZJR19KRkZTMl9GUz15CitDT05GSUdfSkZGUzJfU1VNTUFSWT15CitDT05GSUdfQ1JBTUZTPXkKK0NPTkZJR19ORlNfRlM9eQorQ09ORklHX05GU19WMz15CitDT05GSUdfUk9PVF9ORlM9eQorQ09ORklHX05MU19DT0RFUEFHRV80Mzc9eQorQ09ORklHX05MU19DT0RFUEFHRV84NTA9eQorQ09ORklHX05MU19JU084ODU5XzE9eQorQ09ORklHX05MU19JU084ODU5XzE1PXkKK0NPTkZ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25zdCB1bnNpZ25lZCBzaG9ydCBjY19tYXBbMTZdID0geworCTB4RjBGMCwJCQkvKiBFUSA9PSBaIHNldCAgICAgICAgICAgICovCisJMHgwRjBGLAkJCS8qIE5FICAgICAgICAgICAgICAgICAgICAgKi8KKwkweENDQ0MsCQkJLyogQ1MgPT0gQyBzZXQgICAgICAgICAgICAqLworCTB4MzMzMywJCQkvKiBDQyAgICAgICAgICAgICAgICAgICAgICovCisJMHhGRjAwLAkJCS8qIE1JID09IE4gc2V0ICAgICAgICAgICAgKi8KKwkweDAwRkYsCQkJLyogUEwgICAgICAgICAgICAgICAgICAgICAqLworCTB4QUFBQSwJCQkvKiBWUyA9PSBWIHNldCAgICAgICAgICAgICovCisJMHg1NTU1LAkJCS8qIFZDICAgICAgICAgICAgICAgICAgICAgKi8KKwkweDBDMEMsCQkJLyogSEkgPT0gQyBzZXQgJiYgWiBjbGVhciAqLworCTB4RjNGMywJCQkvKiBMUyA9PSBDIGNsZWFyIHx8IFogc2V0ICovCisJMHhBQTU1LAkJCS8qIEdFID09IChOPT1WKSAgICAgICAgICAgKi8KKwkweDU1QUEsCQkJLyogTFQgPT0gKE4hPVYpICAgICAgICAgICAqLworCTB4MEEwNSwJCQkvKiBHVCA9PSAoIVogJiYgKE49PVYpKSAgICovCisJMHhGNUZBLAkJCS8qIExFID09IChaIHx8IChOIT1WKSkgICAgKi8KKwkweEZGRkYsCQkJLyogQUwgYWx3YXlzICAgICAgICAgICAgICAqLworCTAJCQkvKiBOViAgICAgICAgICAgICAgICAgICAgICovCit9OworCisvKgorICogUmV0dXJuczoKKyAqIEFSTV9PUENPREVfQ09ORFRFU1RfRkFJTCAgIC0gaWYgY29uZGl0aW9uIGZhaWxzCisgKiBBUk1fT1BDT0RFX0NPTkRURVNUX1BBU1MgICAtIGlmIGNvbmRpdGlvbiBwYXNzZXMgKGluY2x1ZGluZyBBTCkKKyAqIEFSTV9PUENPREVfQ09ORFRFU1RfVU5DT05EIC0gaWYgTlYgY29uZGl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ioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIHZvaWQgX19pbml0IGRvdmVfZWhjaTBfaW5pdCh2b2lkKQogewotCW9yaW9uX2VoY2lfaW5pdCgmZG92ZV9tYnVzX2RyYW1faW5mbywKLQkJCURPVkVfVVNCMF9QSFlTX0JBU0UsIElSUV9ET1ZFX1VTQjApOworCW9yaW9uX2VoY2lfaW5pdChET1ZFX1VTQjBfUEhZU19CQVNFLCBJUlFfRE9WRV9VU0IwKTsKIH0KIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC04MCw4ICs3OSw3IEBACiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIHZvaWQgX19pbml0IGRvdmVfZWhjaTFfaW5pdCh2b2lkKQogewotCW9yaW9uX2VoY2lfMV9pbml0KCZkb3ZlX21idXNfZHJhbV9pbmZvLAotCQkJICBET1ZFX1VTQjFfUEhZU19CQVNFLCBJUlFfRE9WRV9VU0IxKTsKKwlvcmlvbl9laGNpXzFfaW5pdChET1ZFX1VTQjFfUEhZU19CQVNFLCBJUlFfRE9WRV9VU0IxKTsKIH0KIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC04OSw3ICs4Nyw3IEBACiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIHZvaWQgX19pbml0IGRvdmVfZ2UwMF9pbml0KHN0cnVjdCBtdjY0M3h4X2V0aF9wbGF0Zm9ybV9kYXRhICpldGhfZGF0YSkKIHsKLQlvcmlvbl9nZTAwX2luaXQoZXRoX2RhdGEsICZkb3ZlX21idXNfZHJh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KioqKioqKioqKioqKioqKioqKioqKioqKi8KIHZvaWQgX19pbml0IG12Nzh4eDBfZWhjaTBfaW5pdCh2b2lkKQogewotCW9yaW9uX2VoY2lfaW5pdCgmbXY3OHh4MF9tYnVzX2RyYW1faW5mbywKLQkJCVVTQjBfUEhZU19CQVNFLCBJUlFfTVY3OFhYMF9VU0JfMCk7CisJb3Jpb25fZWhjaV9pbml0KFVTQjBfUEhZU19CQVNFLCBJUlFfTVY3OFhYMF9VU0JfMCk7CiB9CiAKIApAQCAtMTc5LDggKzE3OCw3IEBACiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIHZvaWQgX19pbml0IG12Nzh4eDBfZWhjaTFfaW5pdCh2b2lkKQogewotCW9yaW9uX2VoY2lfMV9pbml0KCZtdjc4eHgwX21idXNfZHJhbV9pbmZvLAotCQkJICBVU0IxX1BIWVNfQkFTRSwgSVJRX01WNzhYWDBfVVNCXzEpOworCW9yaW9uX2VoY2lfMV9pbml0KFVTQjFfUEhZU19CQVNFLCBJUlFfTVY3OFhYMF9VU0JfMSk7CiB9CiAKIApAQCAtMTg5LDggKzE4Nyw3IEBACiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIHZvaWQgX19pbml0IG12Nzh4eDBfZWhjaTJfaW5pdCh2b2lkKQogewotCW9yaW9uX2VoY2lfMl9pbml0KCZtdjc4eHgwX21idXNfZHJhbV9pbmZvLAotCQkJICBVU0IyX1BIWVNfQkFTRSwgSVJRX01WNzhYWDBfVVNCXzIpOworCW9yaW9uX2VoY2lfMl9pbml0KFVTQjJfUEhZU19CQVNFLCBJUlFfTVY3OFhYMF9VU0JfMik7CiB9CiAKIApAQCAtMTk5LDcgKzE5Niw3IEBACiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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5jbHVkZSA8cGxhdC9jb21tb24uaD4KKyNpbmNsdWRlIDxwbGF0L2FkZHItbWFwLmg+CiAjaW5jbHVkZSAiY29tbW9uLmgiCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpAQCAtNzEsOCArNzIsNyBAQAogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiB2b2lkIF9faW5pdCBvcmlvbjV4X2VoY2kwX2luaXQodm9pZCkKIHsKLQlvcmlvbl9laGNpX2luaXQoJm9yaW9uNXhfbWJ1c19kcmFtX2luZm8sCi0JCQlPUklPTjVYX1VTQjBfUEhZU19CQVNFLCBJUlFfT1JJT041WF9VU0IwX0NUUkwpOworCW9yaW9uX2VoY2lfaW5pdChPUklPTjVYX1VTQjBfUEhZU19CQVNFLCBJUlFfT1JJT041WF9VU0IwX0NUUkwpOwogfQogCiAKQEAgLTgxLDggKzgxLDcgQEAKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogdm9pZCBfX2luaXQgb3Jpb241eF9laGNpMV9pbml0KHZvaWQpCiB7Ci0Jb3Jpb25fZWhjaV8xX2luaXQoJm9yaW9uNXhfbWJ1c19kcmFtX2luZm8sCi0JCQkgIE9SSU9ONVhfVVNCMV9QSFlTX0JBU0UsIElSUV9PUklPTjVYX1VTQjFfQ1RSTCk7CisJb3Jpb25fZWhjaV8xX2luaXQoT1JJT041WF9VU0IxX1BIWVNfQkFTRSwgSVJRX09SSU9ONVhfVVNCMV9DVFJMKTsKIH0KIAogCkBAIC05MSw3ICs5MCw3IEBACiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIHZv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2V4cG9ydC5oPgogI2luY2x1ZGUgPGxpbnV4L2luaXQuaD4KICNpbmNsdWRlIDxsaW51eC9wbGF0Zm9ybV9kZXZpY2UuaD4KICNpbmNsdWRlIDxsaW51eC9pbnRlcnJ1cHQuaD4KQEAgLTE3OSw3ICsxODAsNyBAQAogfTsKIAogc3RhdGljIHN0cnVjdCB1Y2IxNDAwX3BkYXRhIHZwYWMyNzBfdWNiMTQwMF9wZGF0YSA9IHsKLQkuaXJxCQk9IElSUV9HUElPKEJBTExPT04zX0dQSU9fQ09ERUNfSVJRKSwKKwkuaXJxCQk9IFBYQV9HUElPX1RPX0lSUShCQUxMT09OM19HUElPX0NPREVDX0lSUSksCiB9OwogCiAKQEAgLTMwNyw3ICszMDgsNyBAQAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICogVVNCIEdhZGdldAogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSNpZiBkZWZpbmVkKENPTkZJR19VU0JfR0FER0VUX1BYQTI3WCl8fGRlZmluZWQoQ09ORklHX1VTQl9HQURHRVRfUFhBMjdYX01PRFVMRSkKKyNpZiBkZWZpbmVkKENPTkZJR19VU0JfUFhBMjdYKXx8ZGVmaW5lZChDT05GSUdfVVNCX1BYQTI3WF9NT0RVTEUpCiBzdGF0aWMgdm9pZCBiYWxsb29uM191ZGNfY29tbWFuZChpbnQgY21kKQogewogCWlmIChjbWQgPT0gUFhBMlhYX1VEQ19DTURfQ09OTkVDVCkKQEAgLTgyOSw0ICs4MzAsNSBAQAogCS50aW1lcgkJPSAmcHhhX3RpbWVyLAogCS5pbml0X21hY2hpbmUJPSBiYWxsb29uM19pbml0LAogCS5hdGFnX29mZnNldAk9IDB4MTAwLAorCS5yZXN0YXJ0CT0gcHhhX3Jlc3RhcnQsCiBNQUNIS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ERVYsCi0JfSwgewotCQkucGVyaV9pZCA9ICh1OClETUFDSF9TUEkxX1JYLAotCQkucnF0eXBlID0gREVWVE9NRU0sCi0JfSwgewotCQkucGVyaV9pZCA9ICh1OClETUFDSF9TUEkxX1RYLAotCQkucnF0eXBlID0gTUVNVE9ERVYsCi0JfSwgewotCQkucGVyaV9pZCA9ICh1OClETUFDSF9TUEkyX1JYLAotCQkucnF0eXBlID0gREVWVE9NRU0sCi0JfSwgewotCQkucGVyaV9pZCA9ICh1OClETUFDSF9TUEkyX1RYLAotCQkucnF0eXBlID0gTUVNVE9ERVYsCi0JfSwgewotCQkucGVyaV9pZCA9ICh1OClETUFDSF9BQzk3X01JQ0lOLAotCQkucnF0eXBlID0gREVWVE9NRU0sCi0JfSwgewotCQkucGVyaV9pZCA9ICh1OClETUFDSF9BQzk3X1BDTUlOLAotCQkucnF0eXBlID0gREVWVE9NRU0sCi0JfSwgewotCQkucGVyaV9pZCA9ICh1OClETUFDSF9BQzk3X1BDTU9VVCwKLQkJLnJxdHlwZSA9IE1FTVRPREVWLAotCX0sIHsKLQkJLnBlcmlfaWQgPSAodTgpRE1BQ0hfRVhURVJOQUwsCi0JfSwgewotCQkucGVyaV9pZCA9ICh1OClETUFDSF9QV00sCi0JfSwgewotCQkucGVyaV9pZCA9ICh1OClETUFDSF9TUERJRiwKLQkJLnJxdHlwZSA9IE1FTVRPREVWLAotCX0sIHsKLQkJLnBlcmlfaWQgPSAodTgpRE1BQ0hfSFNJX1JYLAotCQkucnF0eXBlID0gREVWVE9NRU0sCi0JfSwgewotCQkucGVyaV9pZCA9ICh1OClETUFDSF9IU0lfVFgsCi0JCS5ycXR5cGUgPSBNRU1UT0RFViwKLQl9LAordTggcGRtYTBfcGVyaVtdID0geworCURNQUNIX1VBUlQwX1JYLAorCURNQUNIX1VBUlQwX1RYLAorCURNQUNIX1VBUlQxX1JYLAorCURNQUNIX1VBUlQxX1RYLAorCURNQUNIX1VBUlQyX1JYLAorCURNQUNIX1VBUl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E9NRU0sCi0JfSwgewotCQkucGVyaV9pZCA9ICh1OClETUFDSF9JMlMyX1RYLAotCQkucnF0eXBlID0gTUVNVE9ERVYsCi0JfSwgewotCQkucGVyaV9pZCA9ICh1OClETUFDSF9TUEkwX1JYLAotCQkucnF0eXBlID0gREVWVE9NRU0sCi0JfSwgewotCQkucGVyaV9pZCA9ICh1OClETUFDSF9TUEkwX1RYLAotCQkucnF0eXBlID0gTUVNVE9ERVYsCi0JfSwgewotCQkucGVyaV9pZCA9ICh1OClETUFDSF9TUEkxX1JYLAotCQkucnF0eXBlID0gREVWVE9NRU0sCi0JfSwgewotCQkucGVyaV9pZCA9ICh1OClETUFDSF9TUEkxX1RYLAotCQkucnF0eXBlID0gTUVNVE9ERVYsCi0JfSwgewotCQkucGVyaV9pZCA9ICh1OClETUFDSF9TUEkyX1JYLAotCQkucnF0eXBlID0gREVWVE9NRU0sCi0JfSwgewotCQkucGVyaV9pZCA9ICh1OClETUFDSF9TUEkyX1RYLAotCQkucnF0eXBlID0gTUVNVE9ERVYsCi0JfSwgewotCQkucGVyaV9pZCA9ICh1OClETUFDSF9QQ00wX1JYLAotCQkucnF0eXBlID0gREVWVE9NRU0sCi0JfSwgewotCQkucGVyaV9pZCA9ICh1OClETUFDSF9QQ00xX1RYLAotCQkucnF0eXBlID0gTUVNVE9ERVYsCi0JfSwgewotCQkucGVyaV9pZCA9ICh1OClETUFDSF9QQ00xX1JYLAotCQkucnF0eXBlID0gREVWVE9NRU0sCi0JfSwgewotCQkucGVyaV9pZCA9ICh1OClETUFDSF9QQ00xX1RYLAotCQkucnF0eXBlID0gTUVNVE9ERVYsCi0JfSwgewotCQkucGVyaV9pZCA9ICh1OClETUFDSF9NU01fUkVRMCwKLQl9LCB7Ci0JCS5wZXJpX2lkID0gKHU4KURNQUNIX01TTV9SRVExLAotCX0sIHsKLQkJLnBlcmlfaWQgPSAodTgpRE1BQ0hfTVNNX1JFUTIsCi0JfSwgewotCQkucGVyaV9pZCA9ICh1OClET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pb24gb2YgU2VhYm9hcmQKIAogY29uZmlnIE1BQ0hfVkVOVEFOQQogICAgICAgIGJvb2wgIlZlbnRhbmEgYm9hcmQiCisgICAgICAgZGVwZW5kcyBvbiBBUkNIX1RFR1JBXzJ4X1NPQwogICAgICAgIHNlbGVjdCBNQUNIX1RFR1JBX0RUCiAgICAgICAgaGVscAogICAgICAgICAgU3VwcG9ydCBmb3IgdGhlIG5WaWRpYSBWZW50YW5hIGRldmVsb3BtZW50IHBsYXRmb3JtCmRpZmYgLS1naXQgYS9hcmNoL2FybS9tYWNoLXRlZ3JhL01ha2VmaWxlIGIvYXJjaC9hcm0vbWFjaC10ZWdyYS9NYWtlZmlsZQppbmRleCA5MWEwN2UxLi5lMTIwZmY1IDEwMDY0NAotLS0gYS9hcmNoL2FybS9tYWNoLXRlZ3JhL01ha2VmaWxlCisrKyBiL2FyY2gvYXJtL21hY2gtdGVncmEvTWFrZWZpbGUKQEAgLTEsMyArMSw0IEBACitvYmoteSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKz0gYm9hcmQtcGlubXV4Lm8KIG9iai15ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArPSBjb21tb24ubwogb2JqLXkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICs9IGRldmljZXMubwogb2JqLXkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICs9IGlvLm8KQEAgLTUsMTIgKzYsMTMgQEAKIG9iai15ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArPSBjbG9jay5vCiBvYmoteSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKz0gdGltZXIubwogb2JqLXkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICs9IHBpbm11eC5vCi1vYmoteSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKz0gcG93ZXJnYXRlLm8KIG9iai15CQkJCQkrPSBmdXNlLm8KLW9iai0kKENPTkZJR19B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klHX01BQ0hfSEFSTU9OWX0gICAgICAgICAgICAgICs9IGJvYXJkLWhhcm1vbnktcGNpZS5vCi1vYmotJHtDT05GSUdfTUFDSF9IQVJNT05ZfSAgICAgICAgICAgICAgKz0gYm9hcmQtaGFybW9ueS1wb3dlci5vCitvYmotJChDT05GSUdfTUFDSF9IQVJNT05ZKSAgICAgICAgICAgICAgKz0gYm9hcmQtaGFybW9ueS5vCitvYmotJChDT05GSUdfTUFDSF9IQVJNT05ZKSAgICAgICAgICAgICAgKz0gYm9hcmQtaGFybW9ueS1waW5tdXgubworb2JqLSQoQ09ORklHX01BQ0hfSEFSTU9OWSkgICAgICAgICAgICAgICs9IGJvYXJkLWhhcm1vbnktcGNpZS5vCitvYmotJChDT05GSUdfTUFDSF9IQVJNT05ZKSAgICAgICAgICAgICAgKz0gYm9hcmQtaGFybW9ueS1wb3dlci5vCiAKLW9iai0ke0NPTkZJR19NQUNIX1BBWjAwfQkJKz0gYm9hcmQtcGF6MDAubwotb2JqLSR7Q09ORklHX01BQ0hfUEFaMDB9CQkrPSBib2FyZC1wYXowMC1waW5tdXgubworb2JqLSQoQ09ORklHX01BQ0hfUEFaMDApCQkrPSBib2FyZC1wYXowMC5vCitvYmotJChDT05GSUdfTUFDSF9QQVowMCkJCSs9IGJvYXJkLXBhejAwLXBpbm11eC5vCiAKLW9iai0ke0NPTkZJR19NQUNIX1NFQUJPQVJEfSAgICAgICAgICAgICArPSBib2FyZC1zZWFib2FyZC5vCi1vYmotJHtDT05GSUdfTUFDSF9TRUFCT0FSRH0gICAgICAgICAgICAgKz0gYm9hcmQtc2VhYm9hcmQtcGlubXV4Lm8KK29iai0kKENPTkZJR19NQUNIX1NFQUJPQVJEKSAgICAgICAgICAgICArPSBib2FyZC1zZWFib2FyZC5vCitvYmotJChDT05GSUdfTUFDSF9TRUFCT0FSRCkgICAgICAgICAgICAgKz0gYm9hcmQtc2VhYm9hcmQtcGlubXV4Lm8KIAotb2JqLSR7Q09ORklHX01BQ0hfVEVHUkFfRFR9ICAgICAgICAgICAgICs9IGJvYXJkLWR0Lm8KLW9iai0ke0NPTkZJR19NQUNIX1RFR1JBX0RUfSAgICAgICAgICAgICArPSBib2FyZC1oYXJtb255LXBpbm11eC5vCi1vYmotJHtDT05GSUdfTUFDSF9URUdSQV9EVH0gICAgICAgICAgICAgKz0gYm9hcmQtc2VhYm9hcmQtcGlubXV4Lm8KK29iai0kKENPTkZJR19NQUNIX1RFR1JBX0RUKSAgICAgICAgICAgICArPSBib2FyZC1kdC10ZWdyYTIwLm8KK29iai0kKENPTkZJR19NQUNIX1RFR1JBX0RUKSAgICAgICAgICAgICArPSBib2FyZC1oYXJtb255LXBpbm11eC5vCitvYmotJChDT05GSUdfTUFDSF9URUdSQV9EVCkgICAgICAgICAgICAgKz0gYm9hcmQtc2VhYm9hcmQtcGlubXV4Lm8KK29iai0kKENPTkZJR19NQUNIX1RFR1JBX0RUKSAgICAgICAgICAgICArPSBib2FyZC1wYXowMC1waW5tdXgubworb2JqLSQoQ09ORklHX01BQ0hfVEVHUkFfRFQpICAgICAgICAgICAgICs9IGJvYXJkLXRyaW1zbGljZS1waW5tdXgubwogCi1vYmotJHtDT05GSUdfTUFDSF9UUklNU0xJQ0V9ICAgICAgICAgICAgKz0gYm9hcmQtdHJpbXNsaWNlLm8KLW9iai0ke0NPTkZJR19NQUNIX1RSSU1TTElDRX0gICAgICAgICAgICArPSBib2FyZC10cmltc2xpY2UtcGlubXV4Lm8KK29iai0kKENPTkZJR19NQUNIX1RSSU1TTElDRSkgICAgICAgICAgICArPSBib2FyZC10cmltc2xpY2Uubworb2JqLSQoQ09ORklHX01BQ0hfVFJJTVNMSUNFKSAgICAgICAgICAgICs9IGJvYXJkLXRyaW1zbGljZS1waW5tdXgubwpkaWZmIC0tZ2l0IGEvYXJjaC9hcm0vbWFjaC10ZWdyYS9NYWtlZmlsZS5ib290IGIvYXJjaC9hcm0vbWFjaC10ZWdyYS9NYWtlZmlsZS5ib290CmluZGV4IGJkMT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0KSwKLQlQSU5HUk9VUChBVEQsICAgTkFORCwgIElERSwgICAgICAgTkFORCwgICAgICBHTUksICAgICAgIFNESU80LCAgICAgICAgIElERSwgICAgICAgMHgxNCwgMywgIDB4ODAsIDIwLCAweEEwLCA2KSwKLQlQSU5HUk9VUChBVEUsICAgTkFORCwgIElERSwgICAgICAgTkFORCwgICAgICBHTUksICAgICAgIFJTVkQsICAgICAgICAgIElERSwgICAgICAgMHgxOCwgMjUsIDB4ODAsIDEyLCAweEEwLCA4KSwKLQlQSU5HUk9VUChDREVWMSwgQVVESU8sIE9TQywgICAgICAgUExMQV9PVVQsICBQTExNX09VVDEsIEFVRElPX1NZTkMsICAgIE9TQywgICAgICAgMHgxNCwgNCwgIDB4ODgsIDIsICAweEE4LCAwKSwKLQlQSU5HUk9VUChDREVWMiwgQVVESU8sIE9TQywgICAgICAgQUhCX0NMSywgICBBUEJfQ0xLLCAgIFBMTFBfT1VUNCwgICAgIE9TQywgICAgICAgMHgxNCwgNSwgIDB4ODgsIDQsICAweEE4LCAyKSwKLQlQSU5HUk9VUChDUlRQLCAgTENELCAgIENSVCwgICAgICAgUlNWRCwgICAgICBSU1ZELCAgICAgIFJTVkQsICAgICAgICAgIFJTVkQsICAgICAgMHgyMCwgMTQsIDB4OTgsIDIwLCAweEE0LCAyNCksCi0JUElOR1JPVVAoQ1NVUywgIFZJLCAgICBQTExDX09VVDEsIFBMTFBfT1VUMiwgUExMUF9PVVQzLCBWSV9TRU5TT1JfQ0xLLCBQTExDX09VVDEsIDB4MTQsIDYsICAweDg4LCA2LCAgMHhBQywgMjQpLAotCVBJTkdST1VQKERBUDEsICBBVURJTywgREFQMSwgICAgICBSU1ZELCAgICAgIEdNSSwgICAgICAgU0RJTzIsICAgICAgICAgREFQMSwgICAgICAweDE0LCA3LCAgMHg4OCwgMjAsIDB4QTAsIDEwKSwKLQlQSU5HUk9VUChEQVAyLCAgQVVESU8sIERBUDIsICAgICAgVFdDLCAgICAgICBSU1ZELCAgICAgIEdNSSwgICAgICAgICAgIERBUDIsICAgICAgMHgxNCwgOCwgIDB4ODgsIDIyLCAweEEwLCAxMiksCi0JUElOR1JPVVAoREFQMywgIEJCLCAgICBEQVAzLCAgICAgIFJTVkQsICAgICAgUlNWRCwgICAgICBSU1ZELCAgICAgICAgICBEQVAzLCAgICAgIDB4MTQsIDksICAweDg4LCAyNCwgMHhBMCwgMTQpLAotCVBJTkdST1VQKERBUDQsICBVQVJULCAgREFQNCwgICAgICBSU1ZELCAgICAgIEdNSSwgICAgICAgUlNWRCwgICAgICAgICAgREFQNCwgICAgICAweDE0LCAxMCwgMHg4OCwgMjYsIDB4QTAsIDE2KSwKLQlQSU5HUk9VUChEREMsICAgTENELCAgIEkyQzIsICAgICAgUlNWRCwgICAgICBSU1ZELCAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgxOCwgMzEsIDB4ODgsIDAsICAweEIwLCAyOCksCi0JUElOR1JPVVAoRFRBLCAgIFZJLCAgICBSU1ZELCAgICAgIFNESU8yLCAgICAgVkksICAgICAgICBSU1ZELCAgICAgICAgICBSU1ZENCwgICAgIDB4MTQsIDExLCAweDg0LCAyMCwgMHhBMCwgMTgpLAotCVBJTkdST1VQKERUQiwgICBWSSwgICAgUlNWRCwgICAgICBSU1ZELCAgICAgIFZJLCAgICAgICAgU1BJMSwgICAgICAgICAgUlNWRDEsICAgICAweDE0LCAxMiwgMHg4NCwgMjIsIDB4QTAsIDIwKSwKLQlQSU5HUk9VUChEVEMsICAgVkksICAgIFJTVkQsICAgICAgUlNWRCwgICAgICBWSSwgICAgICAgIFJTVkQsICAgICAgICAgIFJTVkQxLCAgICAgMHgxNCwgMTMsIDB4ODQsIDI2LCAweEEwLCAyMiksCi0JUElOR1JPVVAoRFRELCAgIFZJLCAgICBSU1ZELCAgICAgIFNESU8yLCAgICAgVkksICAgICAgICBSU1ZELCAgICAgICAgICBSU1ZEMSwgICAgIDB4MTQsIDE0LCAweDg0LCAyOCwgMHhBMCwgMjQpLAotCVBJTkdST1VQKERURSwgICBWSSwgICAgUlNWRCwgICAgICBSU1ZELCAgICAgIFZJLCAgICAgICAgU1BJMSwgICAgICAgICAgUlNWRDEsICAgICAweDE0LCAxNSwgMHg4NCwgMzAsIDB4QTAsIDI2KSwKLQlQSU5HUk9VUChEVEYsICAgVkksICAgIEkyQzMsICAgICAgUlNWRCwgICAgICBWSSwgICAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgyMCwgMTIsIDB4OTgsIDMwLCAweEEwLCAyOCksCi0JUElOR1JPVVAoR01BLCAgIE5BTkQsICBVQVJURSwgICAgIFNQSTMsICAgICAgR01JLCAgICAgICBTRElPNCwgICAgICAgICBTUEkzLCAgICAgIDB4MTQsIDI4LCAweDg0LCAwLCAgMHhCMCwgMjApLAotCVBJTkdST1VQKEdNQiwgICBOQU5ELCAgSURFLCAgICAgICBOQU5ELCAgICAgIEdNSSwgICAgICAgR01JX0lOVCwgICAgICAgR01JLCAgICAgICAweDE4LCAyOSwgMHg4OCwgMjgsIDB4QjAsIDIyKSwKLQlQSU5HUk9VUChHTUMsICAgTkFORCwgIFVBUlRELCAgICAgU1BJNCwgICAgICBHTUksICAgICAgIFNGTEFTSCwgICAgICAgIFNQSTQsICAgICAgMHgxNCwgMjksIDB4ODQsIDIsICAweEIwLCAyNCksCi0JUElOR1JPVVAoR01ELCAgIE5BTkQsICBSU1ZELCAgICAgIE5BTkQsICAgICAgR01JLCAgICAgICBTRkxBU0gsICAgICAgICBHTUksICAgICAgIDB4MTgsIDMwLCAweDg4LCAzMCwgMHhCMCwgMjYpLAotCVBJTkdST1VQKEdNRSwgICBOQU5ELCAgUlNWRCwgICAgICBEQVA1LCAgICAgIEdNSSwgICAgICAgU0RJTzQsICAgICAgICAgR01JLCAgICAgICAweDE4LCAwLCAgMHg4QywgMCwgIDB4QTgsIDI0KSwKLQlQSU5HUk9VUChHUFUsICAgVUFSVCwgIFBXTSwgICAgICAgVUFSVEEsICAgICBHTUksICAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgxNCwgMTYsIDB4OEMsIDQsICAweEE0LCAyMCksCi0JUElOR1JPVVAoR1BVNywgIFNZUywgICBSVENLLCAgICAgIFJTVkQsICAgICAgUlNWRCwgICAgICBSU1ZELCAgICAgICAgICBSVENLLCAgICAgIDB4MjAsIDExLCAweDk4LCAyOCwgMHhBNCwgNiksCi0JUElOR1JPVVAoR1BWLCAgIFNELCAgICBQQ0lFLCAgICAgIFJTVkQsICAgICAgUlNWRCwgICAgICBSU1ZELCAgICAgICAgICBQQ0lFLCAgICAgIDB4MTQsIDE3LCAweDhDLCAyLCAgMHhBMCwgMzApLAotCVBJTkdST1VQKEhESU5ULCBMQ0QsICAgSERNSSwgICAgICBSU1ZELCAgICAgIFJTVkQsICAgICAgUlNWRCwgICAgICAgICAgSERNSSwgICAgICAweDFDLCAyMywgMHg4NCwgNCwgIDB4QUMsIDIyKSwKLQlQSU5HUk9VUChJMkNQLCAgU1lTLCAgIEkyQywgICAgICAgUlNWRCwgICAgICBSU1ZELCAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgxNCwgMTgsIDB4ODgsIDgsICAweEE0LCAyKSwKLQlQSU5HUk9VUChJUlJYLCAgVUFSVCwgIFVBUlRBLCAgICAgVUFSVEIsICAgICBHTUksICAgICAgIFNQSTQsICAgICAgICAgIFVBUlRCLCAgICAgMHgxNCwgMjAsIDB4ODgsIDE4LCAweEE4LCAyMiksCi0JUElOR1JPVVAoSVJUWCwgIFVBUlQsICBVQVJUQSwgICAgIFVBUlRCLCAgICAgR01JLCAgICAgICBTUEk0LCAgICAgICAgICBVQVJUQiwgICAgIDB4MTQsIDE5LCAweDg4LCAxNiwgMHhBOCwgMjApLAotCVBJTkdST1VQKEtCQ0EsICBTWVMsICAgS0JDLCAgICAgICBOQU5ELCAgICAgIFNESU8yLCAgICAgRU1DX1RFU1QwX0RMTCwgS0JDLCAgICAgICAweDE0LCAyMiwgMHg4OCwgMTAsIDB4QTQsIDgpLAotCVBJTkdST1VQKEtCQ0IsICBTWVMsICAgS0JDLCAgICAgICBOQU5ELCAgICAgIFNESU8yLCAgICAgTUlPLCAgICAgICAgICAgS0JDLCAgICAgICAweDE0LCAyMSwgMHg4OCwgMTIsIDB4QTQsIDEwKSwKLQlQSU5HUk9VUChLQkNDLCAgU1lTLCAgIEtCQywgICAgICAgTkFORCwgICAgICBUUkFDRSwgICAgIEVNQ19URVNUMV9ETEwsIEtCQywgICAgICAgMHgxOCwgMjYsIDB4ODgsIDE0LCAweEE0LCAxMiksCi0JUElOR1JPVVAoS0JDRCwgIFNZUywgICBLQkMsICAgICAgIE5BTkQsICAgICAgU0RJTzIsICAgICBNSU8sICAgICAgICAgICBLQkMsICAgICAgIDB4MjAsIDEwLCAweDk4LCAyNiwgMHhBNCwgMTQpLAotCVBJTkdST1VQKEtCQ0UsICBTWVMsICAgS0JDLCAgICAgICBOQU5ELCAgICAgIE9XUiwgICAgICAgUlNWRCwgICAgICAgICAgS0JDLCAgICAgICAweDE0LCAyNiwgMHg4MCwgMjgsIDB4QjAsIDIpLAotCVBJTkdST1VQKEtCQ0YsICBTWVMsICAgS0JDLCAgICAgICBOQU5ELCAgICAgIFRSQUNFLCAgICAgTUlPLCAgICAgICAgICAgS0JDLCAgICAgICAweDE0LCAyNywgMHg4MCwgMjYsIDB4QjAsIDApLAotCVBJTkdST1VQKExDU04sICBMQ0QsICAgRElTUExBWUEsICBESVNQTEFZQiwgIFNQSTMsICAgICAgUlNWRCwgICAgICAgICAgUlNWRDQsICAgICAweDFDLCAzMSwgMHg5MCwgMTIsIDB4QUMsIDIwKSwKLQlQSU5HUk9VUChMRDAsICAgTENELCAgIERJU1BMQVlBLCAgRElTUExBWUIsICBYSU8sICAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgxQywgMCwgIDB4OTQsIDAsICAweEFDLCAxMiksCi0JUElOR1JPVVAoTEQxLCAgIExDRCwgICBESVNQTEFZQSwgIERJU1BMQVlCLCAgWElPLCAgICAgICBSU1ZELCAgICAgICAgICBSU1ZENCwgICAgIDB4MUMsIDEsICAweDk0LCAyLCAgMHhBQywgMTIpLAotCVBJTkdST1VQKExEMTAsICBMQ0QsICAgRElTUExBWUEsICBESVNQTEFZQiwgIFhJTywgICAgICAgUlNWRCwgICAgICAgICAgUlNWRDQsICAgICAweDFDLCAxMCwgMHg5NCwgMjAsIDB4QUMsIDEyKSwKLQlQSU5HUk9VUChMRDExLCAgTENELCAgIERJU1BMQVlBLCAgRElTUExBWUIsICBYSU8sICAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgxQywgMTEsIDB4OTQsIDIyLCAweEFDLCAxMiksCi0JUElOR1JPVVAoTEQxMiwgIExDRCwgICBESVNQTEFZQSwgIERJU1BMQVlCLCAgWElPLCAgICAgICBSU1ZELCAgICAgICAgICBSU1ZENCwgICAgIDB4MUMsIDEyLCAweDk0LCAyNCwgMHhBQywgMTIpLAotCVBJTkdST1VQKExEMTMsICBMQ0QsICAgRElTUExBWUEsICBESVNQTEFZQiwgIFhJTywgICAgICAgUlNWRCwgICAgICAgICAgUlNWRDQsICAgICAweDFDLCAxMywgMHg5NCwgMjYsIDB4QUMsIDEyKSwKLQlQSU5HUk9VUChMRDE0LCAgTENELCAgIERJU1BMQVlBLCAgRElTUExBWUIsICBYSU8sICAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgxQywgMTQsIDB4OTQsIDI4LCAweEFDLCAxMiksCi0JUElOR1JPVVAoTEQxNSwgIExDRCwgICBESVNQTEFZQSwgIERJU1BMQVlCLCAgWElPLCAgICAgICBSU1ZELCAgICAgICAgICBSU1ZENCwgICAgIDB4MUMsIDE1LCAweDk0LCAzMCwgMHhBQywgMTIpLAotCVBJTkdST1VQKExEMTYsICBMQ0QsICAgRElTUExBWUEsICBESVNQTEFZQiwgIFhJTywgICAgICAgUlNWRCwgICAgICAgICAgUlNWRDQsICAgICAweDFDLCAxNiwgMHg5OCwgMCwgIDB4QUMsIDEyKSwKLQlQSU5HUk9VUChMRDE3LCAgTENELCAgIERJU1BMQVlBLCAgRElTUExBWUIsICBSU1ZELCAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgxQywgMTcsIDB4OTgsIDIsICAweEFDLCAxMiksCi0JUElOR1JPVVAoTEQyLCAgIExDRCwgICBESVNQTEFZQSwgIERJU1BMQVlCLCAgWElPLCAgICAgICBSU1ZELCAgICAgICAgICBSU1ZENCwgICAgIDB4MUMsIDIsICAweDk0LCA0LCAgMHhBQywgMTIpLAotCVBJTkdST1VQKExEMywgICBMQ0QsICAgRElTUExBWUEsICBESVNQTEFZQiwgIFhJTywgICAgICAgUlNWRCwgICAgICAgICAgUlNWRDQsICAgICAweDFDLCAzLCAgMHg5NCwgNiwgIDB4QUMsIDEyKSwKLQlQSU5HUk9VUChMRDQsICAgTENELCAgIERJU1BMQVlBLCAgRElTUExBWUIsICBYSU8sICAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgxQywgNCwgIDB4OTQsIDgsICAweEFDLCAxMiksCi0JUElOR1JPVVAoTEQ1LCAgIExDRCwgICBESVNQTEFZQSwgIERJU1BMQVlCLCAgWElPLCAgICAgICBSU1ZELCAgICAgICAgICBSU1ZENCwgICAgIDB4MUMsIDUsICAweDk0LCAxMCwgMHhBQywgMTIpLAotCVBJTkdST1VQKExENiwgICBMQ0QsICAgRElTUExBWUEsICBESVNQTEFZQiwgIFhJTywgICAgICAgUlNWRCwgICAgICAgICAgUlNWRDQsICAgICAweDFDLCA2LCAgMHg5NCwgMTIsIDB4QUMsIDEyKSwKLQlQSU5HUk9VUChMRDcsICAgTENELCAgIERJU1BMQVlBLCAgRElTUExBWUIsICBYSU8sICAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgxQywgNywgIDB4OTQsIDE0LCAweEFDLCAxMiksCi0JUElOR1JPVVAoTEQ4LCAgIExDRCwgICBESVNQTEFZQSwgIERJU1BMQVlCLCAgWElPLCAgICAgICBSU1ZELCAgICAgICAgICBSU1ZENCwgICAgIDB4MUMsIDgsICAweDk0LCAxNiwgMHhBQywgMTIpLAotCVBJTkdST1VQKExEOSwgICBMQ0QsICAgRElTUExBWUEsICBESVNQTEFZQiwgIFhJTywgICAgICAgUlNWRCwgICAgICAgICAgUlNWRDQsICAgICAweDFDLCA5LCAgMHg5NCwgMTgsIDB4QUMsIDEyKSwKLQlQSU5HUk9VUChMREMsICAgTENELCAgIERJU1BMQVlBLCAgRElTUExBWUIsICBSU1ZELCAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgxQywgMzAsIDB4OTAsIDE0LCAweEFDLCAyMCksCi0JUElOR1JPVVAoTERJLCAgIExDRCwgICBESVNQTEFZQSwgIERJU1BMQVlCLCAgUlNWRCwgICAgICBSU1ZELCAgICAgICAgICBSU1ZENCwgICAgIDB4MjAsIDYsICAweDk4LCAxNiwgMHhBQywgMTgpLAotCVBJTkdST1VQKExIUDAsICBMQ0QsICAgRElTUExBWUEsICBESVNQTEFZQiwgIFJTVkQsICAgICAgUlNWRCwgICAgICAgICAgUlNWRDQsICAgICAweDFDLCAxOCwgMHg5OCwgMTAsIDB4QUMsIDE2KSwKLQlQSU5HUk9VUChMSFAxLCAgTENELCAgIERJU1BMQVlBLCAgRElTUExBWUIsICBSU1ZELCAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgxQywgMTksIDB4OTgsIDQsICAweEFDLCAxNCksCi0JUElOR1JPVVAoTEhQMiwgIExDRCwgICBESVNQTEFZQSwgIERJU1BMQVlCLCAgUlNWRCwgICAgICBSU1ZELCAgICAgICAgICBSU1ZENCwgICAgIDB4MUMsIDIwLCAweDk4LCA2LCAgMHhBQywgMTQpLAotCVBJTkdST1VQKExIUywgICBMQ0QsICAgRElTUExBWUEsICBESVNQTEFZQiwgIFhJTywgICAgICAgUlNWRCwgICAgICAgICAgUlNWRDQsICAgICAweDIwLCA3LCAgMHg5MCwgMjIsIDB4QUMsIDIyKSwKLQlQSU5HUk9VUChMTTAsICAgTENELCAgIERJU1BMQVlBLCAgRElTUExBWUIsICBTUEkzLCAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgxQywgMjQsIDB4OTAsIDI2LCAweEFDLCAyMiksCi0JUElOR1JPVVAoTE0xLCAgIExDRCwgICBESVNQTEFZQSwgIERJU1BMQVlCLCAgUlNWRCwgICAgICBDUlQsICAgICAgICAgICBSU1ZEMywgICAgIDB4MUMsIDI1LCAweDkwLCAyOCwgMHhBQywgMjIpLAotCVBJTkdST1VQKExQUCwgICBMQ0QsICAgRElTUExBWUEsICBESVNQTEFZQiwgIFJTVkQsICAgICAgUlNWRCwgICAgICAgICAgUlNWRDQsICAgICAweDIwLCA4LCAgMHg5OCwgMTQsIDB4QUMsIDE4KSwKLQlQSU5HUk9VUChMUFcwLCAgTENELCAgIERJU1BMQVlBLCAgRElTUExBWUIsICBTUEkzLCAgICAgIEhETUksICAgICAgICAgIERJU1BMQVlBLCAgMHgyMCwgMywgIDB4OTAsIDAsICAweEFDLCAyMCksCi0JUElOR1JPVVAoTFBXMSwgIExDRCwgICBESVNQTEFZQSwgIERJU1BMQVlCLCAgUlNWRCwgICAgICBSU1ZELCAgICAgICAgICBSU1ZENCwgICAgIDB4MjAsIDQsICAweDkwLCAyLCAgMHhBQywgMjApLAotCVBJTkdST1VQKExQVzIsICBMQ0QsICAgRElTUExBWUEsICBESVNQTEFZQiwgIFNQSTMsICAgICAgSERNSSwgICAgICAgICAgRElTUExBWUEsICAweDIwLCA1LCAgMHg5MCwgNCwgIDB4QUMsIDIwKSwKLQlQSU5HUk9VUChMU0MwLCAgTENELCAgIERJU1BMQVlBLCAgRElTUExBWUIsICBYSU8sICAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgxQywgMjcsIDB4OTAsIDE4LCAweEFDLCAyMiksCi0JUElOR1JPVVAoTFNDMSwgIExDRCwgICBESVNQTEFZQSwgIERJU1BMQVlCLCAgU1BJMywgICAgICBIRE1JLCAgICAgICAgICBESVNQTEFZQSwgIDB4MUMsIDI4LCAweDkwLCAyMCwgMHhBQywgMjApLAotCVBJTkdST1VQKExTQ0ssICBMQ0QsICAgRElTUExBWUEsICBESVNQTEFZQiwgIFNQSTMsICAgICAgSERNSSwgICAgICAgICAgRElTUExBWUEsICAweDFDLCAyOSwgMHg5MCwgMTYsIDB4QUMsIDIwKSwKLQlQSU5HUk9VUChMU0RBLCAgTENELCAgIERJU1BMQVlBLCAgRElTUExBWUIsICBTUEkzLCAgICAgIEhETUksICAgICAgICAgIERJU1BMQVlBLCAgMHgyMCwgMSwgIDB4OTAsIDgsICAweEFDLCAyMCksCi0JUElOR1JPVVAoTFNESSwgIExDRCwgICBESVNQTEFZQSwgIERJU1BMQVlCLCAgU1BJMywgICAgICBSU1ZELCAgICAgICAgICBESVNQTEFZQSwgIDB4MjAsIDIsICAweDkwLCA2LCAgMHhBQywgMjApLAotCVBJTkdST1VQKExTUEksICBMQ0QsICAgRElTUExBWUEsICBESVNQTEFZQiwgIFhJTywgICAgICAgSERNSSwgICAgICAgICAgRElTUExBWUEsICAweDIwLCAwLCAgMHg5MCwgMTAsIDB4QUMsIDIyKSwKLQlQSU5HUk9VUChMVlAwLCAgTENELCAgIERJU1BMQVlBLCAgRElTUExBWUIsICBSU1ZELCAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgxQywgMjEsIDB4OTAsIDMwLCAweEFDLCAyMiksCi0JUElOR1JPVVAoTFZQMSwgIExDRCwgICBESVNQTEFZQSwgIERJU1BMQVlCLCAgUlNWRCwgICAgICBSU1ZELCAgICAgICAgICBSU1ZENCwgICAgIDB4MUMsIDIyLCAweDk4LCA4LCAgMHhBQywgMTYpLAotCVBJTkdST1VQKExWUywgICBMQ0QsICAgRElTUExBWUEsICBESVNQTEFZQiwgIFhJTywgICAgICAgUlNWRCwgICAgICAgICAgUlNWRDQsICAgICAweDFDLCAyNiwgMHg5MCwgMjQsIDB4QUMsIDIyKSwKLQlQSU5HUk9VUChPV0MsICAgU1lTLCAgIE9XUiwgICAgICAgUlNWRCwgICAgICBSU1ZELCAgICAgIFJTVkQsICAgICAgICAgIE9XUiwgICAgICAgMHgxNCwgMzEsIDB4ODQsIDgsICAweEIwLCAzMCksCi0JUElOR1JPVVAoUE1DLCAgIFNZUywgICBQV1JfT04sICAgIFBXUl9JTlRSLCAgUlNWRCwgICAgICBSU1ZELCAgICAgICAgICBQV1JfT04sICAgIDB4MTQsIDIzLCAweDk4LCAxOCwgLTEsICAgLTEpLAotCVBJTkdST1VQKFBUQSwgICBOQU5ELCAgSTJDMiwgICAgICBIRE1JLCAgICAgIEdNSSwgICAgICAgUlNWRCwgICAgICAgICAgUlNWRDQsICAgICAweDE0LCAyNCwgMHg5OCwgMjIsIDB4QTQsIDQpLAotCVBJTkdST1VQKFJNLCAgICBVQVJULCAgSTJDLCAgICAgICBSU1ZELCAgICAgIFJTVkQsICAgICAgUlNWRCwgICAgICAgICAgUlNWRDQsICAgICAweDE0LCAyNSwgMHg4MCwgMTQsIDB4QTQsIDApLAotCVBJTkdST1VQKFNEQiwgICBTRCwgICAgVUFSVEEsICAgICBQV00sICAgICAgIFNESU8zLCAgICAgU1BJMiwgICAgICAgICAgUFdNLCAgICAgICAweDIwLCAxNSwgMHg4QywgMTAsIC0xLCAgIC0xKSwKLQlQSU5HUk9VUChTREMsICAgU0QsICAgIFBXTSwgICAgICAgVFdDLCAgICAgICBTRElPMywgICAgIFNQSTMsICAgICAgICAgIFRXQywgICAgICAgMHgxOCwgMSwgIDB4OEMsIDEyLCAweEFDLCAyOCksCi0JUElOR1JPVVAoU0RELCAgIFNELCAgICBVQVJUQSwgICAgIFBXTSwgICAgICAgU0RJTzMsICAgICBTUEkzLCAgICAgICAgICBQV00sICAgICAgIDB4MTgsIDIsICAweDhDLCAxNCwgMHhBQywgMzApLAotCVBJTkdST1VQKFNESU8xLCBCQiwgICAgU0RJTzEsICAgICBSU1ZELCAgICAgIFVBUlRFLCAgICAgVUFSVEEsICAgICAgICAgUlNWRDIsICAgICAweDE0LCAzMCwgMHg4MCwgMzAsIDB4QjAsIDE4KSwKLQlQSU5HUk9VUChTTFhBLCAgU0QsICAgIFBDSUUsICAgICAgU1BJNCwgICAgICBTRElPMywgICAgIFNQSTIsICAgICAgICAgIFBDSUUsICAgICAgMHgxOCwgMywgIDB4ODQsIDYsICAweEE0LCAyMiksCi0JUElOR1JPVVAoU0xYQywgIFNELCAgICBTUERJRiwgICAgIFNQSTQsICAgICAgU0RJTzMsICAgICBTUEkyLCAgICAgICAgICBTUEk0LCAgICAgIDB4MTgsIDUsICAweDg0LCAxMCwgMHhBNCwgMjYpLAotCVBJTkdST1VQKFNMWEQsICBTRCwgICAgU1BESUYsICAgICBTUEk0LCAgICAgIFNESU8zLCAgICAgU1BJMiwgICAgICAgICAgU1BJNCwgICAgICAweDE4LCA2LCAgMHg4NCwgMTIsIDB4QTQsIDI4KSwKLQlQSU5HUk9VUChTTFhLLCAgU0QsICAgIFBDSUUsICAgICAgU1BJNCwgICAgICBTRElPMywgICAgIFNQSTIsICAgICAgICAgIFBDSUUsICAgICAgMHgxOCwgNywgIDB4ODQsIDE0LCAweEE0LCAzMCksCi0JUElOR1JPVVAoU1BESSwgIEFVRElPLCBTUERJRiwgICAgIFJTVkQsICAgICAgSTJDLCAgICAgICBTRElPMiwgICAgICAgICBSU1ZEMiwgICAgIDB4MTgsIDgsICAweDhDLCA4LCAgMHhBNCwgMTYpLAotCVBJTkdST1VQKFNQRE8sICBBVURJTywgU1BESUYsICAgICBSU1ZELCAgICAgIEkyQywgICAgICAgU0RJTzIsICAgICAgICAgUlNWRDIsICAgICAweDE4LCA5LCAgMHg4QywgNiwgIDB4QTQsIDE4KSwKLQlQSU5HUk9VUChTUElBLCAgQVVESU8sIFNQSTEsICAgICAgU1BJMiwgICAgICBTUEkzLCAgICAgIEdNSSwgICAgICAgICAgIEdNSSwgICAgICAgMHgxOCwgMTAsIDB4OEMsIDMwLCAweEE4LCA0KSwKLQlQSU5HUk9VUChTUElCLCAgQVVESU8sIFNQSTEsICAgICAgU1BJMiwgICAgICBTUEkzLCAgICAgIEdNSSwgICAgICAgICAgIEdNSSwgICAgICAgMHgxOCwgMTEsIDB4OEMsIDI4LCAweEE4LCA2KSwKLQlQSU5HUk9VUChTUElDLCAgQVVESU8sIFNQSTEsICAgICAgU1BJMiwgICAgICBTUEkzLCAgICAgIEdNSSwgICAgICAgICAgIEdNSSwgICAgICAgMHgxOCwgMTIsIDB4OEMsIDI2LCAweEE4LCA4KSwKLQlQSU5HUk9VUChTUElELCAgQVVESU8sIFNQSTIsICAgICAgU1BJMSwgICAgICBTUEkyX0FMVCwgIEdNSSwgICAgICAgICAgIEdNSSwgICAgICAgMHgxOCwgMTMsIDB4OEMsIDI0LCAweEE4LCAxMCksCi0JUElOR1JPVVAoU1BJRSwgIEFVRElPLCBTUEkyLCAgICAgIFNQSTEsICAgICAgU1BJMl9BTFQsICBHTUksICAgICAgICAgICBHTUksICAgICAgIDB4MTgsIDE0LCAweDhDLCAyMiwgMHhBOCwgMTIpLAotCVBJTkdST1VQKFNQSUYsICBBVURJTywgU1BJMywgICAgICBTUEkxLCAgICAgIFNQSTIsICAgICAgUlNWRCwgICAgICAgICAgUlNWRDQsICAgICAweDE4LCAxNSwgMHg4QywgMjAsIDB4QTgsIDE0KSwKLQlQSU5HUk9VUChTUElHLCAgQVVESU8sIFNQSTMsICAgICAgU1BJMiwgICAgICBTUEkyX0FMVCwgIEkyQywgICAgICAgICAgIFNQSTJfQUxULCAgMHgxOCwgMTYsIDB4OEMsIDE4LCAweEE4LCAxNiksCi0JUElOR1JPVVAoU1BJSCwgIEFVRElPLCBTUEkzLCAgICAgIFNQSTIsICAgICAgU1BJMl9BTFQsICBJMkMsICAgICAgICAgICBTUEkyX0FMVCwgIDB4MTgsIDE3LCAweDhDLCAxNiwgMHhBOCwgMTgpLAotCVBJTkdST1VQKFVBQSwgICBCQiwgICAgU1BJMywgICAgICBNSVBJX0hTLCAgIFVBUlRBLCAgICAgVUxQSSwgICAgICAgICAgTUlQSV9IUywgICAweDE4LCAxOCwgMHg4MCwgMCwgIDB4QUMsIDApLAotCVBJTkdST1VQKFVBQiwgICBCQiwgICAgU1BJMiwgICAgICBNSVBJX0hTLCAgIFVBUlRBLCAgICAgVUxQSSwgICAgICAgICAgTUlQSV9IUywgICAweDE4LCAxOSwgMHg4MCwgMiwgIDB4QUMsIDIpLAotCVBJTkdST1VQKFVBQywgICBCQiwgICAgT1dSLCAgICAgICBSU1ZELCAgICAgIFJTVkQsICAgICAgUlNWRCwgICAgICAgICAgUlNWRDQsICAgICAweDE4LCAyMCwgMHg4MCwgNCwgIDB4QUMsIDQpLAotCVBJTkdST1VQKFVBRCwgICBVQVJULCAgSVJEQSwgICAgICBTUERJRiwgICAgIFVBUlRBLCAgICAgU1BJNCwgICAgICAgICAgU1BESUYsICAgICAweDE4LCAyMSwgMHg4MCwgNiwgIDB4QUMsIDYpLAotCVBJTkdST1VQKFVDQSwgICBVQVJULCAgVUFSVEMsICAgICBSU1ZELCAgICAgIEdNSSwgICAgICAgUlNWRCwgICAgICAgICAgUlNWRDQsICAgICAweDE4LCAyMiwgMHg4NCwgMTYsIDB4QUMsIDgpLAotCVBJTkdST1VQKFVDQiwgICBVQVJULCAgVUFSVEMsICAgICBQV00sICAgICAgIEdNSSwgICAgICAgUlNWRCwgICAgICAgICAgUlNWRDQsICAgICAweDE4LCAyMywgMHg4NCwgMTgsIDB4QUMsIDEwKSwKLQlQSU5HUk9VUChVREEsICAgQkIsICAgIFNQSTEsICAgICAgUlNWRCwgICAgICBVQVJURCwgICAgIFVMUEksICAgICAgICAgIFJTVkQyLCAgICAgMHgyMCwgMTMsIDB4ODAsIDgsICAweEIwLCAxNiksCi0JLyogdGhlc2UgcGluIGdyb3VwcyBvbmx5IGhhdmUgcHVsbHVwIGFuZCBwdWxsIGRvd24gY29udHJvbCAqLwotCVBJTkdST1VQKENLMzIsICBTWVMsICAgUlNWRCwgICAgICBSU1ZELCAgICAgIFJTVkQsICAgICAgUlNWRCwgICAgICAgICAgUlNWRCwgICAgICAtMSwgICAtMSwgLTEsICAgLTEsIDB4QjAsIDE0KSwKLQlQSU5HUk9VUChERFJDLCAgRERSLCAgIFJTVkQsICAgICAgUlNWRCwgICAgICBSU1ZELCAgICAgIFJTVkQsICAgICAgICAgIFJTVkQsICAgICAgLTEsICAgLTEsIC0xLCAgIC0xLCAweEFDLCAyNiksCi0JUElOR1JPVVAoUE1DQSwgIFNZUywgICBSU1ZELCAgICAgIFJTVkQsICAgICAgUlNWRCwgICAgICBSU1ZELCAgICAgICAgICBSU1ZELCAgICAgIC0xLCAgIC0xLCAtMSwgICAtMSwgMHhCMCwgNCksCi0JUElOR1JPVVAoUE1DQiwgIFNZUywgICBSU1ZELCAgICAgIFJTVkQsICAgICAgUlNWRCwgICAgICBSU1ZELCAgICAgICAgICBSU1ZELCAgICAgIC0xLCAgIC0xLCAtMSwgICAtMSwgMHhCMCwgNiksCi0JUElOR1JPVVAoUE1DQywgIFNZUywgICBSU1ZELCAgICAgIFJTVkQsICAgICAgUlNWRCwgICAgICBSU1ZELCAgICAgICAgICBSU1ZELCAgICAgIC0xLCAgIC0xLCAtMSwgICAtMSwgMHhCMCwgOCksCi0JUElOR1JPVVAoUE1DRCwgIFNZUywgICBSU1ZELCAgICAgIFJTVkQsICAgICAgUlNWRCwgICAgICBSU1ZELCAgICAgICAgICBSU1ZELCAgICAgIC0xLCAgIC0xLCAtMSwgICAtMSwgMHhCMCwgMTApLAotCVBJTkdST1VQKFBNQ0UsICBTWVMsICAgUlNWRCwgICAgICBSU1ZELCAgICAgIFJTVkQsICAgICAgUlNWRCwgICAgICAgICAgUlNWRCwgICAgICAtMSwgICAtMSwgLTEsICAgLTEsIDB4QjAsIDEyKSwKLQlQSU5HUk9VUChYTTJDLCAgRERSLCAg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BX01BWF9QSU5HUk9VUF0gPSB7CisJUElOR1JPVVAoQVRBLCAgIE5BTkQsICBJREUsICAgICAgIE5BTkQsICAgICAgR01JLCAgICAgICBSU1ZELCAgICAgICAgICBJREUsICAgICAgIDB4MTQsIDAsICAweDgwLCAyNCwgMHhBMCwgMCksCisJUElOR1JPVVAoQVRCLCAgIE5BTkQsICBJREUsICAgICAgIE5BTkQsICAgICAgR01JLCAgICAgICBTRElPNCwgICAgICAgICBJREUsICAgICAgIDB4MTQsIDEsICAweDgwLCAxNiwgMHhBMCwgMiksCisJUElOR1JPVVAoQVRDLCAgIE5BTkQsICBJREUsICAgICAgIE5BTkQsICAgICAgR01JLCAgICAgICBTRElPNCwgICAgICAgICBJREUsICAgICAgIDB4MTQsIDIsICAweDgwLCAyMiwgMHhBMCwgNCksCisJUElOR1JPVVAoQVRELCAgIE5BTkQsICBJREUsICAgICAgIE5BTkQsICAgICAgR01JLCAgICAgICBTRElPNCwgICAgICAgICBJREUsICAgICAgIDB4MTQsIDMsICAweDgwLCAyMCwgMHhBMCwgNiksCisJUElOR1JPVVAoQVRFLCAgIE5BTkQsICBJREUsICAgICAgIE5BTkQsICAgICAgR01JLCAgICAgICBSU1ZELCAgICAgICAgICBJREUsICAgICAgIDB4MTgsIDI1LCAweDgwLCAxMiwgMHhBMCwgOCksCisJUElOR1JPVVAoQ0RFVjEsIEFVRElPLCBPU0MsICAgICAgIFBMTEFfT1VULCAgUExMTV9PVVQxLCBBVURJT19TWU5DLCAgICBPU0MsICAgICAgIDB4MTQsIDQsICAweDg4LCAyLCAgMHhBOCwgMCksCisJUElOR1JPVVAoQ0RFVjIsIEFVRElPLCBPU0MsICAgICAgIEFIQl9DTEssICAgQVBCX0NMSywgICBQTExQX09VVDQsICAgICBPU0MsICAgICAgIDB4MTQsIDUsICAweDg4LCA0LCAgMHhBOCwgMiksCisJUElOR1JPVVAoQ1JUUCwgIExDRCwgICBDUlQsICAgICAgIFJTVkQsICAgICAgUlNWRCwgICAgICBSU1ZELCAgICAgICAgICBSU1ZELCAgICAgIDB4MjAsIDE0LCAweDk4LCAyMCwgMHhBNCwgMjQpLAorCVBJTkdST1VQKENTVVMsICBWSSwgICAgUExMQ19PVVQxLCBQTExQX09VVDIsIFBMTFBfT1VUMywgVklfU0VOU09SX0NMSywgUExMQ19PVVQxLCAweDE0LCA2LCAgMHg4OCwgNiwgIDB4QUMsIDI0KSwKKwlQSU5HUk9VUChEQVAxLCAgQVVESU8sIERBUDEsICAgICAgUlNWRCwgICAgICBHTUksICAgICAgIFNESU8yLCAgICAgICAgIERBUDEsICAgICAgMHgxNCwgNywgIDB4ODgsIDIwLCAweEEwLCAxMCksCisJUElOR1JPVVAoREFQMiwgIEFVRElPLCBEQVAyLCAgICAgIFRXQywgICAgICAgUlNWRCwgICAgICBHTUksICAgICAgICAgICBEQVAyLCAgICAgIDB4MTQsIDgsICAweDg4LCAyMiwgMHhBMCwgMTIpLAorCVBJTkdST1VQKERBUDMsICBCQiwgICAgREFQMywgICAgICBSU1ZELCAgICAgIFJTVkQsICAgICAgUlNWRCwgICAgICAgICAgREFQMywgICAgICAweDE0LCA5LCAgMHg4OCwgMjQsIDB4QTAsIDE0KSwKKwlQSU5HUk9VUChEQVA0LCAgVUFSVCwgIERBUDQsICAgICAgUlNWRCwgICAgICBHTUksICAgICAgIFJTVkQsICAgICAgICAgIERBUDQsICAgICAgMHgxNCwgMTAsIDB4ODgsIDI2LCAweEEwLCAxNiksCisJUElOR1JPVVAoRERDLCAgIExDRCwgICBJMkMyLCAgICAgIFJTVkQsICAgICAgUlNWRCwgICAgICBSU1ZELCAgICAgICAgICBSU1ZENCwgICAgIDB4MTgsIDMxLCAweDg4LCAwLCAgMHhCMCwgMjgpLAorCVBJTkdST1VQKERUQSwgICBWSSwgICAgUlNWRCwgICAgICBTRElPMiwgICAgIFZJLCAgICAgICAgUlNWRCwgICAgICAgICAgUlNWRDQsICAgICAweDE0LCAxMSwgMHg4NCwgMjAsIDB4QTAsIDE4KSwKKwlQSU5HUk9VUChEVEIsICAgVkksICAgIFJTVkQsICAgICAgUlNWRCwgICAgICBWSSwgICAgICAgIFNQSTEsICAgICAgICAgIFJTVkQxLCAgICAgMHgxNCwgMTIsIDB4ODQsIDIyLCAweEEwLCAyMCksCisJUElOR1JPVVAoRFRDLCAgIFZJLCAgICBSU1ZELCAgICAgIFJTVkQsICAgICAgVkksICAgICAgICBSU1ZELCAgICAgICAgICBSU1ZEMSwgICAgIDB4MTQsIDEzLCAweDg0LCAyNiwgMHhBMCwgMjIpLAorCVBJTkdST1VQKERURCwgICBWSSwgICAgUlNWRCwgICAgICBTRElPMiwgICAgIFZJLCAgICAgICAgUlNWRCwgICAgICAgICAgUlNWRDEsICAgICAweDE0LCAxNCwgMHg4NCwgMjgsIDB4QTAsIDI0KSwKKwlQSU5HUk9VUChEVEUsICAgVkksICAgIFJTVkQsICAgICAgUlNWRCwgICAgICBWSSwgICAgICAgIFNQSTEsICAgICAgICAgIFJTVkQxLCAgICAgMHgxNCwgMTUsIDB4ODQsIDMwLCAweEEwLCAyNiksCisJUElOR1JPVVAoRFRGLCAgIFZJLCAgICBJMkMzLCAgICAgIFJTVkQsICAgICAgVkksICAgICAgICBSU1ZELCAgICAgICAgICBSU1ZENCwgICAgIDB4MjAsIDEyLCAweDk4LCAzMCwgMHhBMCwgMjgpLAorCVBJTkdST1VQKEdNQSwgICBOQU5ELCAgVUFSVEUsICAgICBTUEkzLCAgICAgIEdNSSwgICAgICAgU0RJTzQsICAgICAgICAgU1BJMywgICAgICAweDE0LCAyOCwgMHg4NCwgMCwgIDB4QjAsIDIwKSwKKwlQSU5HUk9VUChHTUIsICAgTkFORCwgIElERSwgICAgICAgTkFORCwgICAgICBHTUksICAgICAgIEdNSV9JTlQsICAgICAgIEdNSSwgICAgICAgMHgxOCwgMjksIDB4ODgsIDI4LCAweEIwLCAyMiksCisJUElOR1JPVVAoR01DLCAgIE5BTkQsICBVQVJURCwgICAgIFNQSTQsICAgICAgR01JLCAgICAgICBTRkxBU0gsICAgICAgICBTUEk0LCAgICAgIDB4MTQsIDI5LCAweDg0LCAyLCAgMHhCMCwgMjQpLAorCVBJTkdST1VQKEdNRCwgICBOQU5ELCAgUlNWRCwgICAgICBOQU5ELCAgICAgIEdNSSwgICAgICAgU0ZMQVNILCAgICAgICAgR01JLCAgICAgICAweDE4LCAzMCwgMHg4OCwgMzAsIDB4QjAsIDI2KSwKKwlQSU5HUk9VUChHTUUsICAgTkFORCwgIFJTVkQsICAgICAgREFQNSwgICAgICBHTUksICAgICAgIFNESU80LCAgICAgICAgIEdNSSwgICAgICAgMHgxOCwgMCwgIDB4OEMsIDAsICAweEE4LCAyNCksCisJUElOR1JPVVAoR1BVLCAgIFVBUlQsICBQV00sICAgICAgIFVBUlRBLCAgICAgR01JLCAgICAgICBSU1ZELCAgICAgICAgICBSU1ZENCwgICAgIDB4MTQsIDE2LCAweDhDLCA0LCAgMHhBNCwgMjApLAorCVBJTkdST1VQKEdQVTcsICBTWVMsICAgUlRDSywgICAgICBSU1ZELCAgICAgIFJTVkQsICAgICAgUlNWRCwgICAgICAgICAgUlRDSywgICAgICAweDIwLCAxMSwgMHg5OCwgMjgsIDB4QTQsIDYpLAorCVBJTkdST1VQKEdQViwgICBTRCwgICAgUENJRSwgICAgICBSU1ZELCAgICAgIFJTVkQsICAgICAgUlNWRCwgICAgICAgICAgUENJRSwgICAgICAweDE0LCAxNywgMHg4QywgMiwgIDB4QTAsIDMwKSwKKwlQSU5HUk9VUChIRElOVCwgTENELCAgIEhETUksICAgICAgUlNWRCwgICAgICBSU1ZELCAgICAgIFJTVkQsICAgICAgICAgIEhETUksICAgICAgMHgxQywgMjMsIDB4ODQsIDQsICAweEFDLCAyMiksCisJUElOR1JPVVAoSTJDUCwgIFNZUywgICBJMkMsICAgICAgIFJTVkQsICAgICAgUlNWRCwgICAgICBSU1ZELCAgICAgICAgICBSU1ZENCwgICAgIDB4MTQsIDE4LCAweDg4LCA4LCAgMHhBNCwgMiksCisJUElOR1JPVVAoSVJSWCwgIFVBUlQsICBVQVJUQSwgICAgIFVBUlRCLCAgICAgR01JLCAgICAgICBTUEk0LCAgICAgICAgICBVQVJUQiwgICAgIDB4MTQsIDIwLCAweDg4LCAxOCwgMHhBOCwgMjIpLAorCVBJTkdST1VQKElSVFgsICBVQVJULCAgVUFSVEEsICAgICBVQVJUQiwgICAgIEdNSSwgICAgICAgU1BJNCwgICAgICAgICAgVUFSVEIsICAgICAweDE0LCAxOSwgMHg4OCwgMTYsIDB4QTgsIDIwKSwKKwlQSU5HUk9VUChLQkNBLCAgU1lTLCAgIEtCQywgICAgICAgTkFORCwgICAgICBTRElPMiwgICAgIEVNQ19URVNUMF9ETEwsIEtCQywgICAgICAgMHgxNCwgMjIsIDB4ODgsIDEwLCAweEE0LCA4KSwKKwlQSU5HUk9VUChLQkNCLCAgU1lTLCAgIEtCQywgICAgICAgTkFORCwgICAgICBTRElPMiwgICAgIE1JTywgICAgICAgICAgIEtCQywgICAgICAgMHgxNCwgMjEsIDB4ODgsIDEyLCAweEE0LCAxMCksCisJUElOR1JPVVAoS0JDQywgIFNZUywgICBLQkMsICAgICAgIE5BTkQsICAgICAgVFJBQ0UsICAgICBFTUNfVEVTVDFfRExMLCBLQkMsICAgICAgIDB4MTgsIDI2LCAweDg4LCAxNCwgMHhBNCwgMTIpLAorCVBJTkdST1VQKEtCQ0QsICBTWVMsICAgS0JDLCAgICAgICBOQU5ELCAgICAgIFNESU8yLCAgICAgTUlPLCAgICAgICAgICAgS0JDLCAgICAgICAweDIwLCAxMCwgMHg5OCwgMjYsIDB4QTQsIDE0KSwKKwlQSU5HUk9VUChLQkNFLCAgU1lTLCAgIEtCQywgICAgICAgTkFORCwgICAgICBPV1IsICAgICAgIFJTVkQsICAgICAgICAgIEtCQywgICAgICAgMHgxNCwgMjYsIDB4ODAsIDI4LCAweEIwLCAyKSwKKwlQSU5HUk9VUChLQkNGLCAgU1lTLCAgIEtCQywgICAgICAgTkFORCwgICAgICBUUkFDRSwgICAgIE1JTywgICAgICAgICAgIEtCQywgICAgICAgMHgxNCwgMjcsIDB4ODAsIDI2LCAweEIwLCAwKSwKKwlQSU5HUk9VUChMQ1NOLCAgTENELCAgIERJU1BMQVlBLCAgRElTUExBWUIsICBTUEkzLCAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgxQywgMzEsIDB4OTAsIDEyLCAweEFDLCAyMCksCisJUElOR1JPVVAoTEQwLCAgIExDRCwgICBESVNQTEFZQSwgIERJU1BMQVlCLCAgWElPLCAgICAgICBSU1ZELCAgICAgICAgICBSU1ZENCwgICAgIDB4MUMsIDAsICAweDk0LCAwLCAgMHhBQywgMTIpLAorCVBJTkdST1VQKExEMSwgICBMQ0QsICAgRElTUExBWUEsICBESVNQTEFZQiwgIFhJTywgICAgICAgUlNWRCwgICAgICAgICAgUlNWRDQsICAgICAweDFDLCAxLCAgMHg5NCwgMiwgIDB4QUMsIDEyKSwKKwlQSU5HUk9VUChMRDEwLCAgTENELCAgIERJU1BMQVlBLCAgRElTUExBWUIsICBYSU8sICAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgxQywgMTAsIDB4OTQsIDIwLCAweEFDLCAxMiksCisJUElOR1JPVVAoTEQxMSwgIExDRCwgICBESVNQTEFZQSwgIERJU1BMQVlCLCAgWElPLCAgICAgICBSU1ZELCAgICAgICAgICBSU1ZENCwgICAgIDB4MUMsIDExLCAweDk0LCAyMiwgMHhBQywgMTIpLAorCVBJTkdST1VQKExEMTIsICBMQ0QsICAgRElTUExBWUEsICBESVNQTEFZQiwgIFhJTywgICAgICAgUlNWRCwgICAgICAgICAgUlNWRDQsICAgICAweDFDLCAxMiwgMHg5NCwgMjQsIDB4QUMsIDEyKSwKKwlQSU5HUk9VUChMRDEzLCAgTENELCAgIERJU1BMQVlBLCAgRElTUExBWUIsICBYSU8sICAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgxQywgMTMsIDB4OTQsIDI2LCAweEFDLCAxMiksCisJUElOR1JPVVAoTEQxNCwgIExDRCwgICBESVNQTEFZQSwgIERJU1BMQVlCLCAgWElPLCAgICAgICBSU1ZELCAgICAgICAgICBSU1ZENCwgICAgIDB4MUMsIDE0LCAweDk0LCAyOCwgMHhBQywgMTIpLAorCVBJTkdST1VQKExEMTUsICBMQ0QsICAgRElTUExBWUEsICBESVNQTEFZQiwgIFhJTywgICAgICAgUlNWRCwgICAgICAgICAgUlNWRDQsICAgICAweDFDLCAxNSwgMHg5NCwgMzAsIDB4QUMsIDEyKSwKKwlQSU5HUk9VUChMRDE2LCAgTENELCAgIERJU1BMQVlBLCAgRElTUExBWUIsICBYSU8sICAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgxQywgMTYsIDB4OTgsIDAsICAweEFDLCAxMiksCisJUElOR1JPVVAoTEQxNywgIExDRCwgICBESVNQTEFZQSwgIERJU1BMQVlCLCAgUlNWRCwgICAgICBSU1ZELCAgICAgICAgICBSU1ZENCwgICAgIDB4MUMsIDE3LCAweDk4LCAyLCAgMHhBQywgMTIpLAorCVBJTkdST1VQKExEMiwgICBMQ0QsICAgRElTUExBWUEsICBESVNQTEFZQiwgIFhJTywgICAgICAgUlNWRCwgICAgICAgICAgUlNWRDQsICAgICAweDFDLCAyLCAgMHg5NCwgNCwgIDB4QUMsIDEyKSwKKwlQSU5HUk9VUChMRDMsICAgTENELCAgIERJU1BMQVlBLCAgRElTUExBWUIsICBYSU8sICAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgxQywgMywgIDB4OTQsIDYsICAweEFDLCAxMiksCisJUElOR1JPVVAoTEQ0LCAgIExDRCwgICBESVNQTEFZQSwgIERJU1BMQVlCLCAgWElPLCAgICAgICBSU1ZELCAgICAgICAgICBSU1ZENCwgICAgIDB4MUMsIDQsICAweDk0LCA4LCAgMHhBQywgMTIpLAorCVBJTkdST1VQKExENSwgICBMQ0QsICAgRElTUExBWUEsICBESVNQTEFZQiwgIFhJTywgICAgICAgUlNWRCwgICAgICAgICAgUlNWRDQsICAgICAweDFDLCA1LCAgMHg5NCwgMTAsIDB4QUMsIDEyKSwKKwlQSU5HUk9VUChMRDYsICAgTENELCAgIERJU1BMQVlBLCAgRElTUExBWUIsICBYSU8sICAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgxQywgNiwgIDB4OTQsIDEyLCAweEFDLCAxMiksCisJUElOR1JPVVAoTEQ3LCAgIExDRCwgICBESVNQTEFZQSwgIERJU1BMQVlCLCAgWElPLCAgICAgICBSU1ZELCAgICAgICAgICBSU1ZENCwgICAgIDB4MUMsIDcsICAweDk0LCAxNCwgMHhBQywgMTIpLAorCVBJTkdST1VQKExEOCwgICBMQ0QsICAgRElTUExBWUEsICBESVNQTEFZQiwgIFhJTywgICAgICAgUlNWRCwgICAgICAgICAgUlNWRDQsICAgICAweDFDLCA4LCAgMHg5NCwgMTYsIDB4QUMsIDEyKSwKKwlQSU5HUk9VUChMRDksICAgTENELCAgIERJU1BMQVlBLCAgRElTUExBWUIsICBYSU8sICAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgxQywgOSwgIDB4OTQsIDE4LCAweEFDLCAxMiksCisJUElOR1JPVVAoTERDLCAgIExDRCwgICBESVNQTEFZQSwgIERJU1BMQVlCLCAgUlNWRCwgICAgICBSU1ZELCAgICAgICAgICBSU1ZENCwgICAgIDB4MUMsIDMwLCAweDkwLCAxNCwgMHhBQywgMjApLAorCVBJTkdST1VQKExESSwgICBMQ0QsICAgRElTUExBWUEsICBESVNQTEFZQiwgIFJTVkQsICAgICAgUlNWRCwgICAgICAgICAgUlNWRDQsICAgICAweDIwLCA2LCAgMHg5OCwgMTYsIDB4QUMsIDE4KSwKKwlQSU5HUk9VUChMSFAwLCAgTENELCAgIERJU1BMQVlBLCAgRElTUExBWUIsICBSU1ZELCAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgxQywgMTgsIDB4OTgsIDEwLCAweEFDLCAxNiksCisJUElOR1JPVVAoTEhQMSwgIExDRCwgICBESVNQTEFZQSwgIERJU1BMQVlCLCAgUlNWRCwgICAgICBSU1ZELCAgICAgICAgICBSU1ZENCwgICAgIDB4MUMsIDE5LCAweDk4LCA0LCAgMHhBQywgMTQpLAorCVBJTkdST1VQKExIUDIsICBMQ0QsICAgRElTUExBWUEsICBESVNQTEFZQiwgIFJTVkQsICAgICAgUlNWRCwgICAgICAgICAgUlNWRDQsICAgICAweDFDLCAyMCwgMHg5OCwgNiwgIDB4QUMsIDE0KSwKKwlQSU5HUk9VUChMSFMsICAgTENELCAgIERJU1BMQVlBLCAgRElTUExBWUIsICBYSU8sICAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgyMCwgNywgIDB4OTAsIDIyLCAweEFDLCAyMiksCisJUElOR1JPVVAoTE0wLCAgIExDRCwgICBESVNQTEFZQSwgIERJU1BMQVlCLCAgU1BJMywgICAgICBSU1ZELCAgICAgICAgICBSU1ZENCwgICAgIDB4MUMsIDI0LCAweDkwLCAyNiwgMHhBQywgMjIpLAorCVBJTkdST1VQKExNMSwgICBMQ0QsICAgRElTUExBWUEsICBESVNQTEFZQiwgIFJTVkQsICAgICAgQ1JULCAgICAgICAgICAgUlNWRDMsICAgICAweDFDLCAyNSwgMHg5MCwgMjgsIDB4QUMsIDIyKSwKKwlQSU5HUk9VUChMUFAsICAgTENELCAgIERJU1BMQVlBLCAgRElTUExBWUIsICBSU1ZELCAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgyMCwgOCwgIDB4OTgsIDE0LCAweEFDLCAxOCksCisJUElOR1JPVVAoTFBXMCwgIExDRCwgICBESVNQTEFZQSwgIERJU1BMQVlCLCAgU1BJMywgICAgICBIRE1JLCAgICAgICAgICBESVNQTEFZQSwgIDB4MjAsIDMsICAweDkwLCAwLCAgMHhBQywgMjApLAorCVBJTkdST1VQKExQVzEsICBMQ0QsICAgRElTUExBWUEsICBESVNQTEFZQiwgIFJTVkQsICAgICAgUlNWRCwgICAgICAgICAgUlNWRDQsICAgICAweDIwLCA0LCAgMHg5MCwgMiwgIDB4QUMsIDIwKSwKKwlQSU5HUk9VUChMUFcyLCAgTENELCAgIERJU1BMQVlBLCAgRElTUExBWUIsICBTUEkzLCAgICAgIEhETUksICAgICAgICAgIERJU1BMQVlBLCAgMHgyMCwgNSwgIDB4OTAsIDQsICAweEFDLCAyMCksCisJUElOR1JPVVAoTFNDMCwgIExDRCwgICBESVNQTEFZQSwgIERJU1BMQVlCLCAgWElPLCAgICAgICBSU1ZELCAgICAgICAgICBSU1ZENCwgICAgIDB4MUMsIDI3LCAweDkwLCAxOCwgMHhBQywgMjIpLAorCVBJTkdST1VQKExTQzEsICBMQ0QsICAgRElTUExBWUEsICBESVNQTEFZQiwgIFNQSTMsICAgICAgSERNSSwgICAgICAgICAgRElTUExBWUEsICAweDFDLCAyOCwgMHg5MCwgMjAsIDB4QUMsIDIwKSwKKwlQSU5HUk9VUChMU0NLLCAgTENELCAgIERJU1BMQVlBLCAgRElTUExBWUIsICBTUEkzLCAgICAgIEhETUksICAgICAgICAgIERJU1BMQVlBLCAgMHgxQywgMjksIDB4OTAsIDE2LCAweEFDLCAyMCksCisJUElOR1JPVVAoTFNEQSwgIExDRCwgICBESVNQTEFZQSwgIERJU1BMQVlCLCAgU1BJMywgICAgICBIRE1JLCAgICAgICAgICBESVNQTEFZQSwgIDB4MjAsIDEsICAweDkwLCA4LCAgMHhBQywgMjApLAorCVBJTkdST1VQKExTREksICBMQ0QsICAgRElTUExBWUEsICBESVNQTEFZQiwgIFNQSTMsICAgICAgUlNWRCwgICAgICAgICAgRElTUExBWUEsICAweDIwLCAyLCAgMHg5MCwgNiwgIDB4QUMsIDIwKSwKKwlQSU5HUk9VUChMU1BJLCAgTENELCAgIERJU1BMQVlBLCAgRElTUExBWUIsICBYSU8sICAgICAgIEhETUksICAgICAgICAgIERJU1BMQVlBLCAgMHgyMCwgMCwgIDB4OTAsIDEwLCAweEFDLCAyMiksCisJUElOR1JPVVAoTFZQMCwgIExDRCwgICBESVNQTEFZQSwgIERJU1BMQVlCLCAgUlNWRCwgICAgICBSU1ZELCAgICAgICAgICBSU1ZENCwgICAgIDB4MUMsIDIxLCAweDkwLCAzMCwgMHhBQywgMjIpLAorCVBJTkdST1VQKExWUDEsICBMQ0QsICAgRElTUExBWUEsICBESVNQTEFZQiwgIFJTVkQsICAgICAgUlNWRCwgICAgICAgICAgUlNWRDQsICAgICAweDFDLCAyMiwgMHg5OCwgOCwgIDB4QUMsIDE2KSwKKwlQSU5HUk9VUChMVlMsICAgTENELCAgIERJU1BMQVlBLCAgRElTUExBWUIsICBYSU8sICAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgxQywgMjYsIDB4OTAsIDI0LCAweEFDLCAyMiksCisJUElOR1JPVVAoT1dDLCAgIFNZUywgICBPV1IsICAgICAgIFJTVkQsICAgICAgUlNWRCwgICAgICBSU1ZELCAgICAgICAgICBPV1IsICAgICAgIDB4MTQsIDMxLCAweDg0LCA4LCAgMHhCMCwgMzApLAorCVBJTkdST1VQKFBNQywgICBTWVMsICAgUFdSX09OLCAgICBQV1JfSU5UUiwgIFJTVkQsICAgICAgUlNWRCwgICAgICAgICAgUFdSX09OLCAgICAweDE0LCAyMywgMHg5OCwgMTgsIC0xLCAgIC0xKSwKKwlQSU5HUk9VUChQVEEsICAgTkFORCwgIEkyQzIsICAgICAgSERNSSwgICAgICBHTUksICAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgxNCwgMjQsIDB4OTgsIDIyLCAweEE0LCA0KSwKKwlQSU5HUk9VUChSTSwgICAgVUFSVCwgIEkyQywgICAgICAgUlNWRCwgICAgICBSU1ZELCAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgxNCwgMjUsIDB4ODAsIDE0LCAweEE0LCAwKSwKKwlQSU5HUk9VUChTREIsICAgU0QsICAgIFVBUlRBLCAgICAgUFdNLCAgICAgICBTRElPMywgICAgIFNQSTIsICAgICAgICAgIFBXTSwgICAgICAgMHgyMCwgMTUsIDB4OEMsIDEwLCAtMSwgICAtMSksCisJUElOR1JPVVAoU0RDLCAgIFNELCAgICBQV00sICAgICAgIFRXQywgICAgICAgU0RJTzMsICAgICBTUEkzLCAgICAgICAgICBUV0MsICAgICAgIDB4MTgsIDEsICAweDhDLCAxMiwgMHhBQywgMjgpLAorCVBJTkdST1VQKFNERCwgICBTRCwgICAgVUFSVEEsICAgICBQV00sICAgICAgIFNESU8zLCAgICAgU1BJMywgICAgICAgICAgUFdNLCAgICAgICAweDE4LCAyLCAgMHg4QywgMTQsIDB4QUMsIDMwKSwKKwlQSU5HUk9VUChTRElPMSwgQkIsICAgIFNESU8xLCAgICAgUlNWRCwgICAgICBVQVJURSwgICAgIFVBUlRBLCAgICAgICAgIFJTVkQyLCAgICAgMHgxNCwgMzAsIDB4ODAsIDMwLCAweEIwLCAxOCksCisJUElOR1JPVVAoU0xYQSwgIFNELCAgICBQQ0lFLCAgICAgIFNQSTQsICAgICAgU0RJTzMsICAgICBTUEkyLCAgICAgICAgICBQQ0lFLCAgICAgIDB4MTgsIDMsICAweDg0LCA2LCAgMHhBNCwgMjIpLAorCVBJTkdST1VQKFNMWEMsICBTRCwgICAgU1BESUYsICAgICBTUEk0LCAgICAgIFNESU8zLCAgICAgU1BJMiwgICAgICAgICAgU1BJNCwgICAgICAweDE4LCA1LCAgMHg4NCwgMTAsIDB4QTQsIDI2KSwKKwlQSU5HUk9VUChTTFhELCAgU0QsICAgIFNQRElGLCAgICAgU1BJNCwgICAgICBTRElPMywgICAgIFNQSTIsICAgICAgICAgIFNQSTQsICAgICAgMHgxOCwgNiwgIDB4ODQsIDEyLCAweEE0LCAyOCksCisJUElOR1JPVVAoU0xYSywgIFNELCAgICBQQ0lFLCAgICAgIFNQSTQsICAgICAgU0RJTzMsICAgICBTUEkyLCAgICAgICAgICBQQ0lFLCAgICAgIDB4MTgsIDcsICAweDg0LCAxNCwgMHhBNCwgMzApLAorCVBJTkdST1VQKFNQREksICBBVURJTywgU1BESUYsICAgICBSU1ZELCAgICAgIEkyQywgICAgICAgU0RJTzIsICAgICAgICAgUlNWRDIsICAgICAweDE4LCA4LCAgMHg4QywgOCwgIDB4QTQsIDE2KSwKKwlQSU5HUk9VUChTUERPLCAgQVVESU8sIFNQRElGLCAgICAgUlNWRCwgICAgICBJMkMsICAgICAgIFNESU8yLCAgICAgICAgIFJTVkQyLCAgICAgMHgxOCwgOSwgIDB4OEMsIDYsICAweEE0LCAxOCksCisJUElOR1JPVVAoU1BJQSwgIEFVRElPLCBTUEkxLCAgICAgIFNQSTIsICAgICAgU1BJMywgICAgICBHTUksICAgICAgICAgICBHTUksICAgICAgIDB4MTgsIDEwLCAweDhDLCAzMCwgMHhBOCwgNCksCisJUElOR1JPVVAoU1BJQiwgIEFVRElPLCBTUEkxLCAgICAgIFNQSTIsICAgICAgU1BJMywgICAgICBHTUksICAgICAgICAgICBHTUksICAgICAgIDB4MTgsIDExLCAweDhDLCAyOCwgMHhBOCwgNiksCisJUElOR1JPVVAoU1BJQywgIEFVRElPLCBTUEkxLCAgICAgIFNQSTIsICAgICAgU1BJMywgICAgICBHTUksICAgICAgICAgICBHTUksICAgICAgIDB4MTgsIDEyLCAweDhDLCAyNiwgMHhBOCwgOCksCisJUElOR1JPVVAoU1BJRCwgIEFVRElPLCBTUEkyLCAgICAgIFNQSTEsICAgICAgU1BJMl9BTFQsICBHTUksICAgICAgICAgICBHTUksICAgICAgIDB4MTgsIDEzLCAweDhDLCAyNCwgMHhBOCwgMTApLAorCVBJTkdST1VQKFNQSUUsICBBVURJTywgU1BJMiwgICAgICBTUEkxLCAgICAgIFNQSTJfQUxULCAgR01JLCAgICAgICAgICAgR01JLCAgICAgICAweDE4LCAxNCwgMHg4QywgMjIsIDB4QTgsIDEyKSwKKwlQSU5HUk9VUChTUElGLCAgQVVESU8sIFNQSTMsICAgICAgU1BJMSwgICAgICBTUEkyLCAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgxOCwgMTUsIDB4OEMsIDIwLCAweEE4LCAxNCksCisJUElOR1JPVVAoU1BJRywgIEFVRElPLCBTUEkzLCAgICAgIFNQSTIsICAgICAgU1BJMl9BTFQsICBJMkMsICAgICAgICAgICBTUEkyX0FMVCwgIDB4MTgsIDE2LCAweDhDLCAxOCwgMHhBOCwgMTYpLAorCVBJTkdST1VQKFNQSUgsICBBVURJTywgU1BJMywgICAgICBTUEkyLCAgICAgIFNQSTJfQUxULCAgSTJDLCAgICAgICAgICAgU1BJMl9BTFQsICAweDE4LCAxNywgMHg4QywgMTYsIDB4QTgsIDE4KSwKKwlQSU5HUk9VUChVQUEsICAgQkIsICAgIFNQSTMsICAgICAgTUlQSV9IUywgICBVQVJUQSwgICAgIFVMUEksICAgICAgICAgIE1JUElfSFMsICAgMHgxOCwgMTgsIDB4ODAsIDAsICAweEFDLCAwKSwKKwlQSU5HUk9VUChVQUIsICAgQkIsICAgIFNQSTIsICAgICAgTUlQSV9IUywgICBVQVJUQSwgICAgIFVMUEksICAgICAgICAgIE1JUElfSFMsICAgMHgxOCwgMTksIDB4ODAsIDIsICAweEFDLCAyKSwKKwlQSU5HUk9VUChVQUMsICAgQkIsICAgIE9XUiwgICAgICAgUlNWRCwgICAgICBSU1ZELCAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgxOCwgMjAsIDB4ODAsIDQsICAweEFDLCA0KSwKKwlQSU5HUk9VUChVQUQsICAgVUFSVCwgIElSREEsICAgICAgU1BESUYsICAgICBVQVJUQSwgICAgIFNQSTQsICAgICAgICAgIFNQRElGLCAgICAgMHgxOCwgMjEsIDB4ODAsIDYsICAweEFDLCA2KSwKKwlQSU5HUk9VUChVQ0EsICAgVUFSVCwgIFVBUlRDLCAgICAgUlNWRCwgICAgICBHTUksICAgICAgIFJTVkQsICAgICAgICAgIFJTVkQ0LCAgICAgMHgxOC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TVkQyLAkgICAgUlNWRCwJT1VUUFVULAkweDMwOTgpLAorCVBJTkdST1VQKExDRF9IU1lOQywJICBMQ0QsCSAgICBESVNQTEFZQSwJRElTUExBWUIsICAgUlNWRDEsCVJTVkQyLAkgICAgUlNWRCwJT1VUUFVULAkweDMwOWMpLAorCVBJTkdST1VQKExDRF9WU1lOQywJICBMQ0QsCSAgICBESVNQTEFZQSwJRElTUExBWUIsICAgUlNWRDEsCVJTVkQyLAkgICAgUlNWRCwJT1VUUFVULAkweDMwYTApLAorCVBJTkdST1VQKExDRF9EMCwJICBMQ0QsCSAgICBESVNQTEFZQSwJRElTUExBWUIsICAgUlNWRDEsCVJTVkQyLAkgICAgUlNWRCwJT1VUUFVULAkweDMwYTQpLAorCVBJTkdST1VQKExDRF9EMSwJICBMQ0QsCSAgICBESVNQTEFZQSwJRElTUExBWUIsICAgUlNWRDEsCVJTVkQyLAkgICAgUlNWRCwJT1VUUFVULAkweDMwYTgpLAorCVBJTkdST1VQKExDRF9EMiwJICBMQ0QsCSAgICBESVNQTEFZQSwJRElTUExBWUIsICAgUlNWRDEsCVJTVkQyLAkgICAgUlNWRCwJT1VUUFVULAkweDMwYWMpLAorCVBJTkdST1VQKExDRF9EMywJICBMQ0QsCSAgICBESVNQTEFZQSwJRElTUExBWUIsICAgUlNWRDEsCVJTVkQyLAkgICAgUlNWRCwJT1VUUFVULAkweDMwYjApLAorCVBJTkdST1VQKExDRF9ENCwJICBMQ0QsCSAgICBESVNQTEFZQSwJRElTUExBWUIsICAgUlNWRDEsCVJTVkQyLAkgICAgUlNWRCwJT1VUUFVULAkweDMwYjQpLAorCVBJTkdST1VQKExDRF9ENSwJICBMQ0QsCSAgICBESVNQTEFZQSwJRElTUExBWUIsICAgUlNWRDEsCVJTVkQyLAkgICAgUlNWRCwJT1VUUFVULAkweDMwYjgpLAorCVBJTkdST1VQKExDRF9ENiwJICBMQ0QsCSAgICBESVNQTEFZQSwJRElTUExBWUIsICAgUlNWRDEsCVJTVkQ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AgQVVESU8sICAgIFNQRElGLAlSU1ZEMSwJICAgIElOVkFMSUQsCURBUFNETU1DMiwgIFJTVkQsCUlOUFVULAkweDMzNTQpLAorCVBJTkdST1VQKERBUDJfRlMsCSAgQVVESU8sICAgIEkyUzEsCUhEQSwJICAgIFJTVkQyLAlHTUksCSAgICBSU1ZELAlJTlBVVCwJMHgzMzU4KSwKKwlQSU5HUk9VUChEQVAyX0RJTiwJICBBVURJTywgICAgSTJTMSwJSERBLAkgICAgUlNWRDIsCUdNSSwJICAgIFJTVkQsCUlOUFVULAkweDMzNWMpLAorCVBJTkdST1VQKERBUDJfRE9VVCwJICBBVURJTywgICAgSTJTMSwJSERBLAkgICAgUlNWRDIsCUdNSSwJICAgIFJTVkQsCUlOUFVULAkweDMzNjApLAorCVBJTkdST1VQKERBUDJfU0NMSywJICBBVURJTywgICAgSTJTMSwJSERBLAkgICAgUlNWRDIsCUdNSSwJICAgIFJTVkQsCUlOUFVULAkweDMzNjQpLAorCVBJTkdST1VQKFNQSTJfTU9TSSwJICBBVURJTywgICAgU1BJNiwJU1BJMiwJICAgIElOVkFMSUQsCUdNSSwJICAgIFJTVkQsCUlOUFVULAkweDMzNjgpLAorCVBJTkdST1VQKFNQSTJfTUlTTywJICBBVURJTywgICAgU1BJNiwJU1BJMiwJICAgIElOVkFMSUQsCUdNSSwJICAgIFJTVkQsCUlOUFVULAkweDMzNmMpLAorCVBJTkdST1VQKFNQSTJfQ1MwX04sCSAgQVVESU8sICAgIFNQSTYsCVNQSTIsCSAgICBJTlZBTElELAlHTUksCSAgICBSU1ZELAlJTlBVVCwJMHgzMzcwKSwKKwlQSU5HUk9VUChTUEkyX1NDSywJICBBVURJTywgICAgU1BJNiwJU1BJMiwJICAgIElOVkFMSUQsCUdNSSwJICAgIFJTVkQsCUlOUFVULAkweDMzNzQpLAorCVBJTkdST1VQKFNQSTFfTU9TSSwJICBBVURJTywgICAgU1BJMiwJU1BJMSwJICAgIElOVkFMSUQsCUdNSSwJICAgIF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ICoKLSAqCShDKSBDb3B5cmlnaHQgMjAwMCwgTW9yZXRvbiBCYXkgKHd3dy5tb3JldG9uLmNvbS5hdSkKLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSNpZm5kZWYJYW5jaG9yX2gKLSNkZWZpbmUJYW5jaG9yX2gKLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKgotICoJRGVmaW5lIGJhc2ljIGFkZHJlc3NpbmcgaW5mby4KLSAqLwotI2lmIGRlZmluZWQoQ09ORklHX001NDA3QzMpCi0jZGVmaW5lCUNPTUVNX0JBU0UJMHhGRkZGMDAwMAkvKiBCYXNlIG9mIENPLU1FTSBhZGRyZXNzIHNwYWNlICovCi0jZGVmaW5lCUNPTUVNX0lSUQkyNQkJLyogSVJRIG9mIGFuY2hvciBwYXJ0ICovCi0jZWxzZQotI2RlZmluZQlDT01FTV9CQVNFCTB4ODAwMDAwMDAJLyogQmFzZSBvZiBDTy1NRU0gYWRkcmVzcyBzcGFjZSAqLwotI2RlZmluZQlDT01FTV9JUlEJMjUJCS8qIElSUSBvZiBhbmNob3IgcGFydCAqLwotI2VuZGlmCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKgotICoJNC1ieXRlIHJlZ2lzdGVycyBvZiBDTy1NRU0sIHNvIGFkanVzdCByZWdpc3RlciBhZGRyZXNzZXMgZm9yCi0gKgllYXN5IGFjY2Vzcy4gSGFuZHkgbWFjcm8gZm9yIHdvcmQgYWNjZXNzIHRvby4KLSAqLwotI2RlZmluZQlMUkVHKGEpCQkoKGEpID4+IDIpCi0jZGVmaW5lCVdSRUcoYSkJCSgoYSkgPj4gMSkKLQotCi0vKgot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DUFVCXzY4MDIwKQogI2RlZmluZSBDUFVfNjgwMzAgICAgICAoMTw8Q1BVQl82ODAzMCkKICNkZWZpbmUgQ1BVXzY4MDQwICAgICAgKDE8PENQVUJfNjgwNDApCiAjZGVmaW5lIENQVV82ODA2MCAgICAgICgxPDxDUFVCXzY4MDYwKQorI2RlZmluZSBDUFVfQ09MREZJUkUgICAoMTw8Q1BVQl9DT0xERklSRSkKIAogI2RlZmluZSBGUFVCXzY4ODgxICAgICAwCiAjZGVmaW5lIEZQVUJfNjg4ODIgICAgIDEKICNkZWZpbmUgRlBVQl82ODA0MCAgICAgMiAgICAgICAgICAgICAgICAgICAgICAgLyogSW50ZXJuYWwgRlBVICovCiAjZGVmaW5lIEZQVUJfNjgwNjAgICAgIDMgICAgICAgICAgICAgICAgICAgICAgIC8qIEludGVybmFsIEZQVSAqLwogI2RlZmluZSBGUFVCX1NVTkZQQSAgICA0ICAgICAgICAgICAgICAgICAgICAgICAvKiBTdW4tMyBGUEEgKi8KKyNkZWZpbmUgRlBVQl9DT0xERklSRSAgNSAgICAgICAgICAgICAgICAgICAgICAgLyogQ29sZEZpcmUgRlBVICovCiAKICNkZWZpbmUgRlBVXzY4ODgxICAgICAgKDE8PEZQVUJfNjg4ODEpCiAjZGVmaW5lIEZQVV82ODg4MiAgICAgICgxPDxGUFVCXzY4ODgyKQogI2RlZmluZSBGUFVfNjgwNDAgICAgICAoMTw8RlBVQl82ODA0MCkKICNkZWZpbmUgRlBVXzY4MDYwICAgICAgKDE8PEZQVUJfNjgwNjApCiAjZGVmaW5lIEZQVV9TVU5GUEEgICAgICgxPDxGUFVCX1NVTkZQQSkKKyNkZWZpbmUgRlBVX0NPTERGSVJFICAgKDE8PEZQVUJfQ09MREZJUkUpCiAKICNkZWZpbmUgTU1VQl82ODg1MSAgICAgMAogI2RlZmluZSBNTVVCXzY4MDMwICAgICAxICAgICAgICAgICAgICAgICAgICAgICAvKiBJbnRlcm5hbCBNTVUgKi8KQEAgLTIzNSw2IC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ICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tcGF0aWJsZSA9ICJzdG0sbTQxdDgwIiwgIm00MXN0ODUiOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZyA9IDwweDY4PjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKwkJCX07CisJCX07CisKKwkJUENJRTA6IHBjaWV4QDEwMTAwMDAwMDAwIHsJCS8vIDR4R0JJRjEKKwkJCWRldmljZV90eXBlID0gInBjaSI7CisJCQkjaW50ZXJydXB0LWNlbGxzID0gPDE+OworCQkJI3NpemUtY2VsbHMgPSA8Mj47CisJCQkjYWRkcmVzcy1jZWxscyA9IDwzPjsKKwkJCWNvbXBhdGlibGUgPSAiaWJtLHBsYi1wY2lleC00NzZmcGUiLCAiaWJtLHBsYi1wY2lleCI7CisJCQlwcmltYXJ5OworCQkJcG9ydCA9IDwweDA+OyAvKiBwb3J0IG51bWJlciAqLworCQkJcmVnID0gPDB4MDAwMDAxMDEgMHgwMDAwMDAwMCAweDAgMHgxMDAwMDAwMAkJLyogQ29uZmlnIHNwYWNlIGFjY2VzcyAqLworCQkJICAgICAgIDB4MDAwMDAxMDAgMHgwMDAwMDAwMCAweDAgMHgwMDAwMTAwMD47CS8qIFVUTCBSZWdpc3RlcnMgc3BhY2UgYWNjZXNzICovCisJCQlkY3ItcmVnID0gPDB4ODAgMHgyMD47CisKKy8vICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwY2lfc3BhY2UgIDwgcGNpX2FkZHIgICAgICAgICAgPiA8IGNwdV9hZGRyICAgICAgICAgID4gPCBzaXplICAgICAgID4KKwkJCXJhbmdlcyA9IDwweDAyMDAwMDAwIDB4MDAwMDAwMDAgMHg4MDAwMDAwMCAweDAwMDAwMTEwIDB4ODAwMDAwMDAgMHgwIDB4ODAwMDAwMDAKKwkJCSAgICAgICAgICAweDAxMDAwMDAwIDB4MCAgICAgICAgMHgwICAgICAgICAweDAwMDAwMTQw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B4MCAweDAgMHgzICZtcGljIDB4MiAweDEgMHgwIDB4MAorCQkJMDAwMCAweDAgMHgwIDB4NCAmbXBpYyAweDMgMHgxIDB4MCAweDAKKwkJCT47CisJfTsKK307CisKKyZyaW8geworCWNvbXBhdGlibGUgPSAiZnNsLHNyaW8iOworCWludGVycnVwdHMgPSA8NDggMiAwIDA+OworCSNhZGRyZXNzLWNlbGxzID0gPDI+OworCSNzaXplLWNlbGxzID0gPDI+OworCWZzbCxzcmlvLXJtdS1oYW5kbGUgPSA8JnJtdT47CisJc2xlZXAgPSA8JnBtYyAweDAwMDgwMDAwPjsKKwlyYW5nZXM7CisKKwlwb3J0MSB7CisJCSNhZGRyZXNzLWNlbGxzID0gPDI+OworCQkjc2l6ZS1jZWxscyA9IDwyPjsKKwkJY2VsbC1pbmRleCA9IDwxPjsKKwl9OworfTsKKworJnNvYyB7CisJI2FkZHJlc3MtY2VsbHMgPSA8MT47CisJI3NpemUtY2VsbHMgPSA8MT47CisJZGV2aWNlX3R5cGUgPSAic29jIjsKKwljb21wYXRpYmxlID0gImZzbCxtcGM4NTY4LWltbXIiLCAic2ltcGxlLWJ1cyI7CisJYnVzLWZyZXF1ZW5jeSA9IDwwPjsJCS8vIEZpbGxlZCBvdXQgYnkgdWJvb3QuCisKKwllY20tbGF3QDAgeworCQljb21wYXRpYmxlID0gImZzbCxlY20tbGF3IjsKKwkJcmVnID0gPDB4MCAweDEwMDA+OworCQlmc2wsbnVtLWxhd3MgPSA8MTA+OworCX07CisKKwllY21AMTAwMCB7CisJCWNvbXBhdGlibGUgPSAiZnNsLG1wYzg1NjgtZWNtIiwgImZzbCxlY20iOworCQlyZWcgPSA8MHgxMDAwIDB4MTAwMD47CisJCWludGVycnVwdHMgPSA8MTcgMiAwIDA+OworCX07CisKKwltZW1vcnktY29udHJvbGxlckAyMDAwIHsKKwkJY29tcGF0aWJsZSA9ICJmc2wsbXBjODU2OC1tZW1vcnktY29udHJvbGxlciI7CisJCXJlZyA9IDwweDIw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bHMgPSA8MT47CisJI3NpemUtY2VsbHMgPSA8MT47CisJZGV2aWNlX3R5cGUgPSAic29jIjsKKwljb21wYXRpYmxlID0gInNpbXBsZS1idXMiOworCisJc29jLXNyYW0tZXJyb3IgeworCQljb21wYXRpYmxlID0gImZzbCxzb2Mtc3JhbS1lcnJvciI7CisJCWludGVycnVwdHMgPSA8MTYgMiAxIDI5PjsKKwl9OworCisJY29yZW5ldC1sYXdAMCB7CisJCWNvbXBhdGlibGUgPSAiZnNsLGNvcmVuZXQtbGF3IjsKKwkJcmVnID0gPDB4MCAweDEwMDA+OworCQlmc2wsbnVtLWxhd3MgPSA8MzI+OworCX07CisKKwlkZHIxOiBtZW1vcnktY29udHJvbGxlckA4MDAwIHsKKwkJY29tcGF0aWJsZSA9ICJmc2wscW9yaXEtbWVtb3J5LWNvbnRyb2xsZXItdjQuNSIsICJmc2wscW9yaXEtbWVtb3J5LWNvbnRyb2xsZXIiOworCQlyZWcgPSA8MHg4MDAwIDB4MTAwMD47CisJCWludGVycnVwdHMgPSA8MTYgMiAxIDIzPjsKKwl9OworCisJY3BjOiBsMy1jYWNoZS1jb250cm9sbGVyQDEwMDAwIHsKKwkJY29tcGF0aWJsZSA9ICJmc2wscDMwNDEtbDMtY2FjaGUtY29udHJvbGxlciIsICJmc2wscDQwODAtbDMtY2FjaGUtY29udHJvbGxlciIsICJjYWNoZSI7CisJCXJlZyA9IDwweDEwMDAwIDB4MTAwMD47CisJCWludGVycnVwdHMgPSA8MTYgMiAxIDI3PjsKKwl9OworCisJY29yZW5ldC1jZkAxODAwMCB7CisJCWNvbXBhdGlibGUgPSAiZnNsLGNvcmVuZXQtY2YiOworCQlyZWcgPSA8MHgxODAwMCAweDEwMDA+OworCQlpbnRlcnJ1cHRzID0gPDE2IDIgMSAzMT47CisJCWZzbCxjY2YtbnVtLWNzZGlkcyA9IDwzMj47CisJCWZzbCxjY2YtbnVtLXNub29waWRzID0gPDMyPjsKKwl9OworCisJaW9tbXVAMjAwMDAg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wMCAweDAwNjgwMDAwPjsKKwkJCQlsYWJlbCA9ICJTUEkgRmxhc2ggSkZGUzIgUkZTIjsKKwkJCX07CisJCX07CisJfTsKKworCXVzYkAyMjAwMCB7CisJCXBoeV90eXBlID0gInV0bWkiOworCQlkcl9tb2RlID0gImhvc3QiOworCX07CisKKwltZGlvQDI0MDAwIHsKKwkJcGh5MDogZXRoZXJuZXQtcGh5QDAgeworCQkJaW50ZXJydXB0cyA9IDwzIDEgMCAwPjsKKwkJCXJlZyA9IDwweDE+OworCQl9OworCisJCXBoeTE6IGV0aGVybmV0LXBoeUAxIHsKKwkJCWludGVycnVwdHMgPSA8MiAxIDAgMD47CisJCQlyZWcgPSA8MHgwPjsKKwkJfTsKKworCQlwaHkyOiBldGhlcm5ldC1waHlAMiB7CisJCQlpbnRlcnJ1cHRzID0gPDIgMSAwIDA+OworCQkJcmVnID0gPDB4Mj47CisJCX07CisKKwkJdGJpLXBoeUAzIHsKKwkJCWRldmljZS10eXBlID0gInRiaS1waHkiOworCQkJcmVnID0gPDB4Mz47CisJCX07CisJfTsKKworCW1kaW9AMjUwMDAgeworCQl0YmkwOiB0YmktcGh5QDExIHsKKwkJCXJlZyA9IDwweDExPjsKKwkJCWRldmljZV90eXBlID0gInRiaS1waHkiOworCQl9OworCX07CisKKwltZGlvQDI2MDAwIHsKKwkJdGJpMTogdGJpLXBoeUAxMSB7CisJCQlyZWcgPSA8MHgxMT47CisJCQlkZXZpY2VfdHlwZSA9ICJ0YmktcGh5IjsKKwkJfTsKKwl9OworCisJZW5ldDA6IGV0aGVybmV0QGIwMDAwIHsKKwkJcGh5LWhhbmRsZSA9IDwmcGh5MD47CisJCXBoeS1jb25uZWN0aW9uLXR5cGUgPSAicmdtaWktaWQiOworCX07CisKKwllbmV0MTogZXRoZXJuZXRAYjEwMDAgeworCQlwaHktaGFuZGxlID0gPCZwaHkxPjsKKwkJdGJpLWhhbmRsZSA9IDwmdGJpMD47CisJCXBoeS1jb25uZWN0aW9uLXR5c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ZJR19FWFBFUklNRU5UQUw9eQorQ09ORklHX1NZU1ZJUEM9eQorQ09ORklHX1BPU0lYX01RVUVVRT15CitDT05GSUdfTE9HX0JVRl9TSElGVD0xNAorQ09ORklHX0JMS19ERVZfSU5JVFJEPXkKK0NPTkZJR19FWFBFUlQ9eQorQ09ORklHX0tBTExTWU1TX0FMTD15CitDT05GSUdfTU9EVUxFUz15CitDT05GSUdfTU9EVUxFX1VOTE9BRD15CisjIENPTkZJR19CTEtfREVWX0JTRyBpcyBub3Qgc2V0CisjIENPTkZJR19XQUxOVVQgaXMgbm90IHNldAorQ09ORklHX09CUzYwMD15CitDT05GSUdfTk9fSFo9eQorQ09ORklHX0hJR0hfUkVTX1RJTUVSUz15CitDT05GSUdfTUFUSF9FTVVMQVRJT049eQorQ09ORklHX05FVD15CitDT05GSUdfUEFDS0VUPXkKK0NPTkZJR19VTklYPXkKK0NPTkZJR19JTkVUPXkKK0NPTkZJR19JUF9QTlA9eQorQ09ORklHX0lQX1BOUF9ESENQPXkKK0NPTkZJR19JUF9QTlBfQk9PVFA9eQorIyBDT05GSUdfSU5FVF9YRlJNX01PREVfVFJBTlNQT1JUIGlzIG5vdCBzZXQKKyMgQ09ORklHX0lORVRfWEZSTV9NT0RFX1RVTk5FTCBpcyBub3Qgc2V0CisjIENPTkZJR19JTkVUX1hGUk1fTU9ERV9CRUVUIGlzIG5vdCBzZXQKKyMgQ09ORklHX0lORVRfTFJPIGlzIG5vdCBzZXQKKyMgQ09ORklHX0lQVjYgaXMgbm90IHNldAorQ09ORklHX1VFVkVOVF9IRUxQRVJfUEFUSD0iL3NiaW4vaG90cGx1ZyIKK0NPTkZJR19DT05ORUNUT1I9eQorQ09ORklHX01URD15CitDT05GSUdfTVREX0NNRExJTkVfUEFSVFM9eQorQ09ORklHX01URF9PRl9QQVJUUz15CitDT05GSUdfTVREX0NIQVI9eQorQ09ORklHX01URF9CTE9DSz15CitDT05GSUdfTVREX0NGST15CitDT05GSUdfTVREX0pFREVDUF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TkxJTUlUPW0KK0NPTkZJR19ORVRGSUxURVJfWFRfTUFUQ0hfQ09OTk1BUks9bQorQ09ORklHX05FVEZJTFRFUl9YVF9NQVRDSF9DT05OVFJBQ0s9bQorQ09ORklHX05FVEZJTFRFUl9YVF9NQVRDSF9EQ0NQPW0KK0NPTkZJR19ORVRGSUxURVJfWFRfTUFUQ0hfRFNDUD1tCitDT05GSUdfTkVURklMVEVSX1hUX01BVENIX0VTUD1tCitDT05GSUdfTkVURklMVEVSX1hUX01BVENIX0hBU0hMSU1JVD1tCitDT05GSUdfTkVURklMVEVSX1hUX01BVENIX0hFTFBFUj1tCitDT05GSUdfTkVURklMVEVSX1hUX01BVENIX0lQUkFOR0U9bQorQ09ORklHX05FVEZJTFRFUl9YVF9NQVRDSF9MRU5HVEg9bQorQ09ORklHX05FVEZJTFRFUl9YVF9NQVRDSF9MSU1JVD1tCitDT05GSUdfTkVURklMVEVSX1hUX01BVENIX01BQz1tCitDT05GSUdfTkVURklMVEVSX1hUX01BVENIX01BUks9bQorQ09ORklHX05FVEZJTFRFUl9YVF9NQVRDSF9NVUxUSVBPUlQ9bQorQ09ORklHX05FVEZJTFRFUl9YVF9NQVRDSF9PV05FUj1tCitDT05GSUdfTkVURklMVEVSX1hUX01BVENIX1BPTElDWT1tCitDT05GSUdfTkVURklMVEVSX1hUX01BVENIX1BLVFRZUEU9bQorQ09ORklHX05FVEZJTFRFUl9YVF9NQVRDSF9RVU9UQT1tCitDT05GSUdfTkVURklMVEVSX1hUX01BVENIX1JBVEVFU1Q9bQorQ09ORklHX05FVEZJTFRFUl9YVF9NQVRDSF9SRUFMTT1tCitDT05GSUdfTkVURklMVEVSX1hUX01BVENIX1JFQ0VOVD1tCitDT05GSUdfTkVURklMVEVSX1hUX01BVENIX1NDVFA9bQorQ09ORklHX05FVEZJTFRFUl9YVF9NQVRDSF9TVEFURT1tCitDT05GSUdfTkVURklMVEVSX1hUX01BVENIX1NUQVRJU1RJQz1tCitDT05GSUdfTkVURklMVEVSX1hUX01BVENIX1NUUklORz1tCitDT05GSUdfTkVURklMVEVSX1hUX01BVENIX1RDUE1TUz1tCitDT05GSUdfTkVURklMVEVSX1hUX01BVENIX1RJTUU9bQorQ09ORklHX05FVEZJTFRFUl9YVF9NQVRDSF9VMzI9bQorQ09ORklHX05GX0NPTk5UUkFDS19JUFY0PW0KK0NPTkZJR19JUF9ORl9RVUVVRT1tCitDT05GSUdfSVBfTkZfSVBUQUJMRVM9bQorQ09ORklHX0lQX05GX01BVENIX0FIPW0KK0NPTkZJR19JUF9ORl9NQVRDSF9FQ049bQorQ09ORklHX0lQX05GX01BVENIX1RUTD1tCitDT05GSUdfSVBfTkZfRklMVEVSPW0KK0NPTkZJR19JUF9ORl9UQVJHRVRfUkVKRUNUPW0KK0NPTkZJR19JUF9ORl9UQVJHRVRfTE9HPW0KK0NPTkZJR19JUF9ORl9UQVJHRVRfVUxPRz1tCitDT05GSUdfTkZfTkFUPW0KK0NPTkZJR19JUF9ORl9UQVJHRVRfTUFTUVVFUkFERT1tCitDT05GSUdfSVBfTkZfVEFSR0VUX05FVE1BUD1tCitDT05GSUdfSVBfTkZfVEFSR0VUX1JFRElSRUNUPW0KK0NPTkZJR19ORVRfVENQUFJPQkU9eQorIyBDT05GSUdfV0lSRUxFU1MgaXMgbm90IHNldAorQ09ORklHX05FVF85UD15CitDT05GSUdfTkVUXzlQX0RFQlVHPXkKK0NPTkZJR19VRVZFTlRfSEVMUEVSX1BBVEg9Ii9zYmluL2hvdHBsdWciCitDT05GSUdfREVWVE1QRlM9eQorQ09ORklHX01URD15CitDT05GSUdfTVREX0NIQVI9eQorQ09ORklHX01URF9CTE9DSz15CitDT05GSUdfTVREX0NGST15CitDT05GSUdfTVREX0NGSV9BRFZfT1BUSU9OUz15CitDT05GSUdfTVREX0NGSV9MRV9CWVRFX1NXQVA9eQorQ09ORklHX01URF9DRklfSU5URUxFWFQ9eQorQ09ORklHX01URF9DRklfQU1EU1REPXkKK0NPTkZJR19NVERfQ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AgICAgICAgICAgICAgICAgICA0LCAwLCAgOTMgKQogTFYxX0NBTEwocmVhZF9odGFiX2VudHJpZXMsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyLCA1LCAgOTUgKQpAQCAtMjc2LDcgKzI3Niw3IEBACiBMVjFfQ0FMTChkZXN0cnVjdF9pb19pcnFfb3V0bGV0LCAgICAgICAgICAgICAgICAgICAgICAgIDEsIDAsIDEyMSApCiBMVjFfQ0FMTChtYXBfaHRhYiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEsIDEsIDEyMiApCiBMVjFfQ0FMTCh1bm1hcF9odGFiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEsIDAsIDEyMyApCi1MVjFfQ0FMTChnZXRfdmVyc2lvbl9pbmZvLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsIDEsIDEyNyApCitMVjFfQ0FMTChnZXRfdmVyc2lvbl9pbmZvLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsIDIsIDEyNyApCiBMVjFfQ0FMTChpbnNlcnRfaHRhYl9lbnRyeSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDYsIDMsIDE1OCApCiBMVjFfQ0FMTChyZWFkX3ZpcnR1YWxfdWFydCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMsIDEsIDE2MiApCiBMVjFfQ0FMTCh3cml0ZV92aXJ0dWFsX3VhcnQsICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMsIDEsIDE2MyApCkBAIC0yOTQsOSArMjk0LDkgQEAKIExWMV9DQUxMKG5ldF9hZGRfbXVsdGljYXN0X2FkZHJlc3MsICAgICAgICAgICAgICAgICAgICAgNCwgMCwgMTg1ICkKIExWMV9DQUxMKG5ldF9yZW1vdmVfbXVsdGljYXN0X2FkZHJlc3MsICAgICAgICAgICAgICAgICAgNCwgMCwgMTg2ICkKIExWMV9DQUxMKG5ldF9zdGFydF90eF9kbWEsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCwgMCwgMTg3ICkKLUxWMV9DQUxMKG5ldF9zdG9wX3R4X2RtYSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMywgMCwgMTg4ICkKK0xWMV9DQUxMKG5ldF9zdG9wX3R4X2RtYSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMiwgMCwgMTg4ICkKIExWMV9DQUxMKG5ldF9zdGFydF9yeF9kbWEsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCwgMCwgMTg5ICkKLUxWMV9DQUxMKG5ldF9zdG9wX3J4X2RtYSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMywgMCwgMTkwICkKK0xWMV9DQUxMKG5ldF9zdG9wX3J4X2RtYSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMiwgMCwgMTkwICkKIExWMV9DQUxMKG5ldF9zZXRfaW50ZXJydXB0X3N0YXR1c19pbmRpY2F0b3IsICAgICAgICAgICAgNCwgMCwgMTkxICkKIExWMV9DQUxMKG5ldF9zZXRfaW50ZXJydXB0X21hc2ssICAgICAgICAgICAgICAgICAgICAgICAgNCwgMCwgMTkzICkKIExWMV9DQUxMKG5ldF9jb250cm9sLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNiwgMiwgMTk0ICkKZGlmZiAtLWdpdCBhL2FyY2gvcG93ZXJwYy9pbmNsdWRlL2FzbS9tYWNoZGVwLmggYi9hcmNoL3Bvd2VycGMvaW5jbHVkZS9hc20vbWFjaGRlcC5oCmluZGV4IGI1NDBkNmYuLmJmMzc5MzFkIDEwMDY0NAotLS0gYS9hcmNoL3Bvd2VycGMvaW5jbHVkZS9hc20vbWFjaGRlcC5oCisrKyBiL2FyY2gvcG93ZXJwYy9pbmNsdWRlL2FzbS9tYWNoZGVwLmgKQEAgLTIxMyw2ICsyMTMsOSBAQAogCSAqIGFsbG93IGFzc2lnbm1lbnQvZW5hYmxpbmcgb2YgdGhlIGRldmljZS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aW9uIik7CisJZG9fZXhpdChzaWducik7Cit9CiAKLQlvb3BzX2V4aXQoKTsKLQlkb19leGl0KGVycik7CitzdGF0aWMgaW50IF9fa3Byb2JlcyBfX2RpZShjb25zdCBjaGFyICpzdHIsIHN0cnVjdCBwdF9yZWdzICpyZWdzLCBsb25nIGVycikKK3sKKwlwcmludGsoIk9vcHM6ICVzLCBzaWc6ICVsZCBbIyVkXVxuIiwgc3RyLCBlcnIsICsrZGllX2NvdW50ZXIpOworI2lmZGVmIENPTkZJR19QUkVFTVBUCisJcHJpbnRrKCJQUkVFTVBUICIpOworI2VuZGlmCisjaWZkZWYgQ09ORklHX1NNUAorCXByaW50aygiU01QIE5SX0NQVVM9JWQgIiwgTlJfQ1BVUyk7CisjZW5kaWYKKyNpZmRlZiBDT05GSUdfREVCVUdfUEFHRUFMTE9DCisJcHJpbnRrKCJERUJVR19QQUdFQUxMT0MgIik7CisjZW5kaWYKKyNpZmRlZiBDT05GSUdfTlVNQQorCXByaW50aygiTlVNQSAiKTsKKyNlbmRpZgorCXByaW50aygiJXNcbiIsIHBwY19tZC5uYW1lID8gcHBjX21kLm5hbWUgOiAiIik7CisKKwlpZiAobm90aWZ5X2RpZShESUVfT09QUywgc3RyLCByZWdzLCBlcnIsIDI1NSwgU0lHU0VHVikgPT0gTk9USUZZX1NUT1ApCisJCXJldHVybiAxOworCisJcHJpbnRfbW9kdWxlcygpOworCXNob3dfcmVncyhyZWdzKTsKIAogCXJldHVybiAwOwogfQogCit2b2lkIGRpZShjb25zdCBjaGFyICpzdHIsIHN0cnVjdCBwdF9yZWdzICpyZWdzLCBsb25nIGVycikKK3sKKwl1bnNpZ25lZCBsb25nIGZsYWdzID0gb29wc19iZWdpbihyZWdzKTsKKworCWlmIChfX2RpZShzdHIsIHJlZ3MsIGVycikpCisJCWVyciA9IDA7CisJb29wc19lbmQoZmxhZ3MsIHJlZ3MsIGVycik7Cit9CisKIHZvaWQgdXNlcl9zaW5nbGVfc3RlcF9zaWdpbmZ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LAotCQkJCSAgICAgICAodW5zaWduZWQpc2Vjb25kLAotCQkJCSAgICAgICAoY29uc3Qgc3RydWN0IHRpbWVzcGVjIF9fdXNlciAqKSB0aGlyZCk7Ci0gICAgICAgIGNhc2UgU0VNR0VUOgotICAgICAgICAgICAgICAgIHJldHVybiBzeXNfc2VtZ2V0KGZpcnN0LCAoaW50KXNlY29uZCwgdGhpcmQpOwotICAgICAgICBjYXNlIFNFTUNUTDogewotICAgICAgICAgICAgICAgIHVuaW9uIHNlbXVuIGZvdXJ0aDsKLSAgICAgICAgICAgICAgICBpZiAoIXB0cikKLSAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgICAgIGlmIChnZXRfdXNlcihmb3VydGguX19wYWQsICh2b2lkIF9fdXNlciAqIF9fdXNlciAqKSBwdHIpKQotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC1FRkFVTFQ7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHN5c19zZW1jdGwoZmlyc3QsIChpbnQpc2Vjb25kLCB0aGlyZCwgZm91cnRoKTsKLSAgICAgICAgfQotICAgICAgICBjYXNlIE1TR1NORDoKLQkJcmV0dXJuIHN5c19tc2dzbmQgKGZpcnN0LCAoc3RydWN0IG1zZ2J1ZiBfX3VzZXIgKikgcHRyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoc2l6ZV90KXNlY29uZCwgdGhpcmQpOwotCQlicmVhazsKLSAgICAgICAgY2FzZSBNU0dSQ1Y6Ci0gICAgICAgICAgICAgICAgaWYgKCFwdHIpCi0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgICAgICAgICBpZiAoY29weV9mcm9tX3VzZXIgKCZ0bXAsIChzdHJ1Y3QgaXBjX2tsdWRnZSBfX3VzZXIgKikgcHRyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mIChzdHJ1Y3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WcudXNlciwKKwkJCQkJYnVmLCBjb3VudCwgb2Zmc2V0KTsKK30KKworc3RhdGljIHNzaXplX3QgaHdzYW1wbGVyX3VzZXJfd3JpdGUoc3RydWN0IGZpbGUgKmZpbGUsIGNoYXIgY29uc3QgX191c2VyICpidWYsCisJCQkJICAgIHNpemVfdCBjb3VudCwgbG9mZl90ICpvZmZzZXQpCit7CisJdW5zaWduZWQgbG9uZyB2YWw7CisJaW50IHJldHZhbDsKKworCWlmICgqb2Zmc2V0KQorCQlyZXR1cm4gLUVJTlZBTDsKKworCXJldHZhbCA9IG9wcm9maWxlZnNfdWxvbmdfZnJvbV91c2VyKCZ2YWwsIGJ1ZiwgY291bnQpOworCWlmIChyZXR2YWwpCisJCXJldHVybiByZXR2YWw7CisKKwlpZiAodmFsICE9IDAgJiYgdmFsICE9IDEpCisJCXJldHVybiAtRUlOVkFMOworCisJY291bnRlcl9jb25maWcudXNlciA9IHZhbDsKKworCXJldHVybiBjb3VudDsKK30KKworc3RhdGljIGNvbnN0IHN0cnVjdCBmaWxlX29wZXJhdGlvbnMgdXNlcl9mb3BzID0geworCS5yZWFkCQk9IGh3c2FtcGxlcl91c2VyX3JlYWQsCisJLndyaXRlCQk9IGh3c2FtcGxlcl91c2VyX3dyaXRlLAorfTsKKworCisvKgorICogRmlsZSBvcHMgdXNlZCBmb3I6IC9kZXYvb3Byb2ZpbGUvdGltZXIvZW5hYmxlZAorICogVGhlIHZhbHVlIGFsd2F5cyBoYXMgdG8gYmUgdGhlIGludmVydGVkIHZhbHVlIG9mIGh3c2FtcGxlcl9lbmFibGVkLiBTbworICogbm8gc2VwYXJhdGUgdmFyaWFibGUgaXMgY3JlYXRlZC4gVGhhdCB3YXkgd2UgZG8gbm90IG5lZWQgbG9ja2luZy4KKyAqLworCitzdGF0aWMgc3NpemVfdCB0aW1lcl9lbmFibGVkX3JlYWQoc3RydWN0IGZpbGUgKmZpbGUsIGNoYXIgX191c2VyICpidWYsCisJCQkJICBzaXplX3QgY291b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isgKiBhZGRfc3luYygpIGlzIGFsd2F5cyBsb2NrZWQKKyAqLworI2RlZmluZSBhZGRfc21wKHB0ciwgaW5jKQlfX2FkZCgocHRyKSwgKGluYyksIExPQ0tfUFJFRklYKQorI2RlZmluZSBhZGRfc3luYyhwdHIsIGluYykJX19hZGQoKHB0ciksIChpbmMpLCAibG9jazsgIikKKworI2RlZmluZSBfX2NtcHhjaGdfZG91YmxlKHBmeCwgcDEsIHAyLCBvMSwgbzIsIG4xLCBuMikJCQlcCisoewkJCQkJCQkJCVwKKwlib29sIF9fcmV0OwkJCQkJCQlcCisJX190eXBlb2ZfXygqKHAxKSkgX19vbGQxID0gKG8xKSwgX19uZXcxID0gKG4xKTsJCQlcCisJX190eXBlb2ZfXygqKHAyKSkgX19vbGQyID0gKG8yKSwgX19uZXcyID0gKG4yKTsJCQlcCisJQlVJTERfQlVHX09OKHNpemVvZigqKHAxKSkgIT0gc2l6ZW9mKGxvbmcpKTsJCQlcCisJQlVJTERfQlVHX09OKHNpemVvZigqKHAyKSkgIT0gc2l6ZW9mKGxvbmcpKTsJCQlcCisJVk1fQlVHX09OKCh1bnNpZ25lZCBsb25nKShwMSkgJSAoMiAqIHNpemVvZihsb25nKSkpOwkJXAorCVZNX0JVR19PTigodW5zaWduZWQgbG9uZykoKHAxKSArIDEpICE9ICh1bnNpZ25lZCBsb25nKShwMikpOwlcCisJYXNtIHZvbGF0aWxlKHBmeCAiY21weGNoZyVjNGIgJTI7IHNldGUgJTAiCQkJXAorCQkgICAgIDogIj1hIiAoX19yZXQpLCAiK2QiIChfX29sZDIpLAkJCVwKKwkJICAgICAgICIrbSIgKCoocDEpKSwgIittIiAoKihwMikpCQkJXAorCQkgICAgIDogImkiICgyICogc2l6ZW9mKGxvbmcpKSwgImEiIChfX29sZDEpLAkJXAorCQkgICAgICAgImIiIChfX25ldzEpLCAiYyIgKF9fbmV3MikpOwkJCVwKKwlfX3JldDsJCQkJCQkJCVwKK30pCisKKyNkZWZpbmUgY21weGN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1NSX09GRlNFVF9NQVNLKSk7Cit9CisKK3N0YXRpYyBpbmxpbmUgdm9pZCAqbGNzcl9hZGRyZXNzKHVuc2lnbmVkIGxvbmcgb2Zmc2V0KQoreworCXJldHVybiBfX3ZhKE5VTUFDSElQX0xDU1JfQkFTRSB8ICgxVUwgPDwgMTUpIHwKKwkJQ1NSX05PREVfQklUUygweGZmZjApIHwgKG9mZnNldCAmIENTUl9PRkZTRVRfTUFTSykpOworfQorCitzdGF0aWMgaW5saW5lIHVuc2lnbmVkIGludCByZWFkX2djc3IoaW50IG5vZGUsIHVuc2lnbmVkIGxvbmcgb2Zmc2V0KQoreworCXJldHVybiBzd2FiMzIocmVhZGwoZ2Nzcl9hZGRyZXNzKG5vZGUsIG9mZnNldCkpKTsKK30KKworc3RhdGljIGlubGluZSB2b2lkIHdyaXRlX2djc3IoaW50IG5vZGUsIHVuc2lnbmVkIGxvbmcgb2Zmc2V0LCB1bnNpZ25lZCBpbnQgdmFsKQoreworCXdyaXRlbChzd2FiMzIodmFsKSwgZ2Nzcl9hZGRyZXNzKG5vZGUsIG9mZnNldCkpOworfQorCitzdGF0aWMgaW5saW5lIHVuc2lnbmVkIGludCByZWFkX2xjc3IodW5zaWduZWQgbG9uZyBvZmZzZXQpCit7CisJcmV0dXJuIHN3YWIzMihyZWFkbChsY3NyX2FkZHJlc3Mob2Zmc2V0KSkpOworfQorCitzdGF0aWMgaW5saW5lIHZvaWQgd3JpdGVfbGNzcih1bnNpZ25lZCBsb25nIG9mZnNldCwgdW5zaWduZWQgaW50IHZhbCkKK3sKKwl3cml0ZWwoc3dhYjMyKHZhbCksIGxjc3JfYWRkcmVzcyhvZmZzZXQpKTsKK30KKworLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworLyogICAgICAgICAgICAgICAgICAgQ1NSX0cwX1NUQVRFX0NMRUFSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworCisjZGVmaW5lIENTUl9HMF9TVEFURV9DTEVBUiAoMHgwMDAgKyAoMCA8PCAxMikpCit1bmlvbiBudW1hY2hpcF9jc3JfZzBfc3RhdGVfY2xlYXIgeworCXVuc2lnbmVkIGludCB2OworCXN0cnVjdCBudW1hY2hpcF9jc3JfZzBfc3RhdGVfY2xlYXJfcyB7CisJCXVuc2lnbmVkIGludCBfc3RhdGU6MjsKKwkJdW5zaWduZWQgaW50IF9yc3ZkXzJfNjo1OworCQl1bnNpZ25lZCBpbnQgX2xvc3Q6MTsKKwkJdW5zaWduZWQgaW50IF9yc3ZkXzhfMzE6MjQ7CisJfSBzOworfTsKKworLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworLyogICAgICAgICAgICAgICAgICAgQ1NSX0cwX05PREVfSURTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworCisjZGVmaW5lIENTUl9HMF9OT0RFX0lEUyAoMHgwMDggKyAoMCA8PCAxMikpCit1bmlvbiBudW1hY2hpcF9jc3JfZzBfbm9kZV9pZHMgeworCXVuc2lnbmVkIGludCB2OworCXN0cnVjdCBudW1hY2hpcF9jc3JfZzBfbm9kZV9pZHNfcyB7CisJCXVuc2lnbmVkIGludCBfaW5pdGlhbGlkOjE2OworCQl1bnNpZ25lZCBpbnQgX25vZGVpZDoxMjsKKwkJdW5zaWduZWQgaW50IF9yc3ZkXzI4XzMxOjQ7CisJfSBzOworfTsKKworLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworLyogICAgICAgICAgICAgICAgICAgQ1NSX0czX0VYVF9JUlFfR0VOICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworCisjZGVmaW5lIENTUl9HM19FWFRfSVJRX0dFTiAoMHgwMzAgKyAoMyA8PCAxMikpCit1bmlvbiBudW1hY2hpcF9jc3JfZzNfZXh0X2lycV9nZW4geworCXVuc2lnbmVkIGludCB2OworCXN0cnVjdCBudW1hY2hpcF9jc3JfZzNfZXh0X2lycV9nZW5fcyB7CisJCXVuc2lnbmVkIGludCBfdmVjdG9yOjg7CisJCXVuc2lnbmVkIGludCBfbXNndHlwZTozOworCQl1bnNpZ25lZCBpbnQgX2luZGV4OjU7CisJCXVuc2lnbmVkIGludCBfZGVzdGluYXRpb25fYXBpY19pZDoxNjsKKwl9IHM7Cit9OworCisvKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCisvKiAgICAgICAgICAgICAgICAgICBDU1JfRzNfRVhUX0lSUV9TVEFUVVMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCisKKyNkZWZpbmUgQ1NSX0czX0VYVF9JUlFfU1RBVFVTICgweDAzNCArICgzIDw8IDEyKSkKK3VuaW9uIG51bWFjaGlwX2Nzcl9nM19leHRfaXJxX3N0YXR1cyB7CisJdW5zaWduZWQgaW50IHY7CisJc3RydWN0IG51bWFjaGlwX2Nzcl9nM19leHRfaXJxX3N0YXR1c19zIHsKKwkJdW5zaWduZWQgaW50IF9yZXN1bHQ6MzI7CisJfSBzOworfTsKKworLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworLyogICAgICAgICAgICAgICAgICAgQ1NSX0czX0VYVF9JUlFfREVTVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworCisjZGVmaW5lIENTUl9HM19FWFRfSVJRX0RFU1QgKDB4MDM4ICsgKDMgPDwgMTIpKQordW5pb24gbnVtYWNoaXBfY3NyX2czX2V4dF9pcnFfZGVzdCB7CisJdW5zaWduZWQgaW50IHY7CisJc3RydWN0IG51bWFjaGlwX2Nzcl9nM19leHRfaXJxX2Rlc3RfcyB7CisJCXVuc2lnbmVkIGludCBfaXJxOjg7CisJCXVuc2lnbmVkIGludCBfcnN2ZF84XzMxOjI0OworCX0gczsKK307CisKKy8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KKy8qICAgICAgICAgICAgICAgICAgIENTUl9HM19OQ19BVFRfTUFQX1NFTEVDVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KKworI2RlZmluZSBDU1JfRzNfTkNfQVRUX01BUF9TRUxFQ1QgKDB4N2ZjICsgKDMgPDwgMTIpKQordW5pb24gbnVtYWNoaXBfY3NyX2czX25jX2F0dF9tYXBfc2VsZWN0IHsKKwl1bnNpZ25lZCBpbnQgdjsKKwlzdHJ1Y3QgbnVtYWNoaXBfY3NyX2czX25jX2F0dF9tYXBfc2VsZWN0X3MgeworCQl1bnNpZ25lZCBpbnQgX3VwcGVyX2FkZHJlc3NfYml0czo0OworCQl1bnNpZ25lZCBpbnQgX3NlbGVjdF9yYW06NDsKKwkJdW5zaWduZWQgaW50IF9yc3ZkXzhfMzE6MjQ7CisJfSBzOworfTsKKworLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworLyogICAgICAgICAgICAgICAgICAgQ1NSX0czX05DX0FUVF9NQVBfU0VMRUNUXzAtMjU1ICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworCisjZGVmaW5lIENTUl9HM19OQ19BVFRfTUFQX1NFTEVDVF8wICgweDgwMCArICgzIDw8IDEyKSkKKworI2VuZGlmIC8qIF9BU01fWDg2X05VTUFDSElQX05VTUFDSElQX0NTUl9IICovCisKZGlmZiAtLWdpdCBhL2FyY2gveDg2L2luY2x1ZGUvYXNtL3BlcmNwdS5oIGIvYXJjaC94ODYvaW5jbHVkZS9hc20vcGVyY3B1LmgKaW5kZXggMzQ3MGM5ZC4uN2ExMTkxMCAxMDA2NDQKLS0tIGEvYXJjaC94ODYvaW5jbHVkZS9hc20vcGVyY3B1LmgKKysrIGIvYXJjaC94ODYvaW5jbHVkZS9hc20vcGVyY3B1LmgKQEAgLTQxNCwyMiArNDE0LDYgQEAKICNkZWZpbmUgdGhpc19jcHVfeGNoZ18yKHBjcCwgbnZhbCkJcGVyY3B1X3hjaGdfb3AocGNwLCBudmFsKQogI2RlZmluZSB0aGlzX2NwdV94Y2hnXzQocGNwLCBudmFsKQlwZXJjcHVfeGNoZ19vcChwY3AsIG52YWwpCiAKLSNkZWZpbmUgaXJxc2FmZV9jcHVfYWRkXzEocGNwLCB2YWwpCXBlcmNwdV9hZGRfb3AoKHBjcCksIHZhbCkKLSNkZWZpbmUgaXJxc2FmZV9jcHVfYWRkXzIocGNwLCB2YWwpCXB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iBTU0JfU1BST000X1RYUElEMkczX1NISUZUOworCisJYnVzLT5zcHJvbS50eHBpZDVnbFswXSA9IChzcHJvbVtTUE9GRihTU0JfU1BST000X1RYUElENUdMMDEpXSAmCisJICAgICBTU0JfU1BST000X1RYUElENUdMMCkgPj4gU1NCX1NQUk9NNF9UWFBJRDVHTDBfU0hJRlQ7CisJYnVzLT5zcHJvbS50eHBpZDVnbFsxXSA9IChzcHJvbVtTUE9GRihTU0JfU1BST000X1RYUElENUdMMDEpXSAmCisJICAgICBTU0JfU1BST000X1RYUElENUdMMSkgPj4gU1NCX1NQUk9NNF9UWFBJRDVHTDFfU0hJRlQ7CisJYnVzLT5zcHJvbS50eHBpZDVnbFsyXSA9IChzcHJvbVtTUE9GRihTU0JfU1BST000X1RYUElENUdMMjMpXSAmCisJICAgICBTU0JfU1BST000X1RYUElENUdMMikgPj4gU1NCX1NQUk9NNF9UWFBJRDVHTDJfU0hJRlQ7CisJYnVzLT5zcHJvbS50eHBpZDVnbFszXSA9IChzcHJvbVtTUE9GRihTU0JfU1BST000X1RYUElENUdMMjMpXSAmCisJICAgICBTU0JfU1BST000X1RYUElENUdMMykgPj4gU1NCX1NQUk9NNF9UWFBJRDVHTDNfU0hJRlQ7CisKKwlidXMtPnNwcm9tLnR4cGlkNWdbMF0gPSAoc3Byb21bU1BPRkYoU1NCX1NQUk9NNF9UWFBJRDVHMDEpXSAmCisJICAgICBTU0JfU1BST000X1RYUElENUcwKSA+PiBTU0JfU1BST000X1RYUElENUcwX1NISUZUOworCWJ1cy0+c3Byb20udHhwaWQ1Z1sxXSA9IChzcHJvbVtTUE9GRihTU0JfU1BST000X1RYUElENUcwMSldICYKKwkgICAgIFNTQl9TUFJPTTRfVFhQSUQ1RzEpID4+IFNTQl9TUFJPTTRfVFhQSUQ1RzFfU0hJRlQ7CisJYnVzLT5zcHJvbS50eHBpZDVnWzJdID0gKHNwcm9tW1NQT0ZGKFNTQl9TUFJPTTRfVFhQSUQ1RzIzKV0gJgorCSAgICAgU1NCX1NQUk9NNF9UWFBJRDVHMikgPj4gU1NCX1NQUk9NNF9UWFBJRDVHMl9TSElGVDsKKwlidXMtPnNwcm9tLnR4cGlkNWdbM10gPSAoc3Byb21bU1BPRkYoU1NCX1NQUk9NNF9UWFBJRDVHMjMpXSAmCisJICAgICBTU0JfU1BST000X1RYUElENUczKSA+PiBTU0JfU1BST000X1RYUElENUczX1NISUZUOworCisJYnVzLT5zcHJvbS50eHBpZDVnaFswXSA9IChzcHJvbVtTUE9GRihTU0JfU1BST000X1RYUElENUdIMDEpXSAmCisJICAgICBTU0JfU1BST000X1RYUElENUdIMCkgPj4gU1NCX1NQUk9NNF9UWFBJRDVHSDBfU0hJRlQ7CisJYnVzLT5zcHJvbS50eHBpZDVnaFsxXSA9IChzcHJvbVtTUE9GRihTU0JfU1BST000X1RYUElENUdIMDEpXSAmCisJICAgICBTU0JfU1BST000X1RYUElENUdIMSkgPj4gU1NCX1NQUk9NNF9UWFBJRDVHSDFfU0hJRlQ7CisJYnVzLT5zcHJvbS50eHBpZDVnaFsyXSA9IChzcHJvbVtTUE9GRihTU0JfU1BST000X1RYUElENUdIMjMpXSAmCisJICAgICBTU0JfU1BST000X1RYUElENUdIMikgPj4gU1NCX1NQUk9NNF9UWFBJRDVHSDJfU0hJRlQ7CisJYnVzLT5zcHJvbS50eHBpZDVnaFszXSA9IChzcHJvbVtTUE9GRihTU0JfU1BST000X1RYUElENUdIMjMpXSAmCisJICAgICBTU0JfU1BST000X1RYUElENUdIMykgPj4gU1NCX1NQUk9NNF9UWFBJRDVHSDNfU0hJRlQ7CisKIAlidXMtPnNwcm9tLmJvYXJkZmxhZ3NfbG8gPSBzcHJvbVtTUE9GRihTU0JfU1BST004X0JGTExPKV07CiAJYnVzLT5zcHJvbS5ib2FyZGZsYWdzX2hpID0gc3Byb21bU1BPRkYoU1NCX1NQUk9NOF9CRkxISSldOwogCWJ1cy0+c3Byb20uYm9hcmRmbGFnczJfbG8gPSBzcHJvbVtTUE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Q6IDEwME1IeiAqLworCXs3LCA3LCA3LCA3LCAxfSwKK307CitzdGF0aWMgdW5zaWduZWQgaW50IGV4eW5vczR4MTJfY2xrZGl2X2xyX2J1c1tdWzJdID0geworCS8qCisJICogQ2xvY2sgZGl2aWRlciB2YWx1ZSBmb3IgZm9sbG93aW5nCisJICogeyBESVZHREwvUiwgRElWR1BML1IgfQorCSAqLworCisJLyogQUNMS19HREwvUiBMMDogMjAwTUh6ICovCisJezMsIDF9LAorCS8qIEFDTEtfR0RML1IgTDE6IDIwME1IeiAqLworCXszLCAxfSwKKwkvKiBBQ0xLX0dETC9SIEwyOiAxNjBNSHogKi8KKwl7NCwgMX0sCisJLyogQUNMS19HREwvUiBMMzogMTMzTUh6ICovCisJezUsIDF9LAorCS8qIEFDTEtfR0RML1IgTDQ6IDEwME1IeiAqLworCXs3LCAxfSwKK307CitzdGF0aWMgdW5zaWduZWQgaW50IGV4eW5vczR4MTJfY2xrZGl2X3NjbGtpcFtdWzNdID0geworCS8qCisJICogQ2xvY2sgZGl2aWRlciB2YWx1ZSBmb3IgZm9sbG93aW5nCisJICogeyBESVZNRkMsIERJVkpQRUcsIERJVkZJTUMwfjN9CisJICovCisKKwkvKiBTQ0xLX01GQzogMjAwTUh6ICovCisJezMsIDMsIDR9LAorCS8qIFNDTEtfTUZDOiAyMDBNSHogKi8KKwl7MywgMywgNH0sCisJLyogU0NMS19NRkM6IDE2ME1IeiAqLworCXs0LCA0LCA1fSwKKwkvKiBTQ0xLX01GQzogMTMzTUh6ICovCisJezUsIDUsIDV9LAorCS8qIFNDTEtfTUZDOiAxMDBNSHogKi8KKwl7NywgNywgN30sCit9OworCisKK3N0YXRpYyBpbnQgZXh5bm9zNDIxMF9zZXRfYnVzY2xrKHN0cnVjdCBidXNmcmVxX2RhdGEgKmRhdGEsIHN0cnVjdCBvcHAgKm9wcCkKK3sKKwl1bnNpZ25lZCBpbnQgaW5kZXg7CisJdW5zaWduZWQgaW50IHRtcDsKKworCWZvciAoaW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i9ldmVyZ3JlZW5fcmVnLmgKQEAgLTQyLDYgKzQyLDE3IEBACiAjICAgICAgIGRlZmluZSBFVkVSR1JFRU5fR1JQSF9ERVBUSF84QlBQICAgICAgICAgICAgICAgIDAKICMgICAgICAgZGVmaW5lIEVWRVJHUkVFTl9HUlBIX0RFUFRIXzE2QlBQICAgICAgICAgICAgICAgMQogIyAgICAgICBkZWZpbmUgRVZFUkdSRUVOX0dSUEhfREVQVEhfMzJCUFAgICAgICAgICAgICAgICAyCisjICAgICAgIGRlZmluZSBFVkVSR1JFRU5fR1JQSF9OVU1fQkFOS1MoeCkgICAgICAgICAgICAgICgoKHgpICYgMHgzKSA8PCAyKQorIyAgICAgICBkZWZpbmUgRVZFUkdSRUVOX0FERFJfU1VSRl8yX0JBTksgICAgICAgICAgICAgICAwCisjICAgICAgIGRlZmluZSBFVkVSR1JFRU5fQUREUl9TVVJGXzRfQkFOSyAgICAgICAgICAgICAgIDEKKyMgICAgICAgZGVmaW5lIEVWRVJHUkVFTl9BRERSX1NVUkZfOF9CQU5LICAgICAgICAgICAgICAgMgorIyAgICAgICBkZWZpbmUgRVZFUkdSRUVOX0FERFJfU1VSRl8xNl9CQU5LICAgICAgICAgICAgICAzCisjICAgICAgIGRlZmluZSBFVkVSR1JFRU5fR1JQSF9aKHgpICAgICAgICAgICAgICAgICAgICAgICgoKHgpICYgMHgzKSA8PCA0KQorIyAgICAgICBkZWZpbmUgRVZFUkdSRUVOX0dSUEhfQkFOS19XSURUSCh4KSAgICAgICAgICAgICAoKCh4KSAmIDB4MykgPDwgNikKKyMgICAgICAgZGVmaW5lIEVWRVJHUkVFTl9BRERSX1NVUkZfQkFOS19XSURUSF8xICAgICAgICAgMAorIyAgICAgICBkZWZpbmUgRVZFUkdSRUVOX0FERFJfU1VSRl9CQU5LX1dJRFRIXzIgICAgICAgICAxCisjICAgICAgIGRlZmluZSBFVkVSR1JFRU5fQUREUl9TVVJGX0JBTktfV0lEVEhfNCAgICAgICAgIDIKKyMg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pbmUgQ0JfU0ZfRVhQT1JUX0ZVTEwJCQkwCiAjCWRlZmluZSBDQl9TRl9FWFBPUlRfTk9STQkJCTEKICNkZWZpbmUJQ0JfQ09MT1IwX0FUVFJJQgkJCQkweDI4Yzc0CisjICAgICAgIGRlZmluZSBDQl9USUxFX1NQTElUKHgpICAgICAgICAgICAgICAgICAgICAgICAgICgoKHgpICYgMHg3KSA8PCA1KQorIyAgICAgICBkZWZpbmUgQUREUl9TVVJGX1RJTEVfU1BMSVRfNjRCICAgICAgICAgICAgICAgICAwCisjICAgICAgIGRlZmluZSBBRERSX1NVUkZfVElMRV9TUExJVF8xMjhCICAgICAgICAgICAgICAgIDEKKyMgICAgICAgZGVmaW5lIEFERFJfU1VSRl9USUxFX1NQTElUXzI1NkIgICAgICAgICAgICAgICAgMgorIyAgICAgICBkZWZpbmUgQUREUl9TVVJGX1RJTEVfU1BMSVRfNTEyQiAgICAgICAgICAgICAgICAzCisjICAgICAgIGRlZmluZSBBRERSX1NVUkZfVElMRV9TUExJVF8xS0IgICAgICAgICAgICAgICAgIDQKKyMgICAgICAgZGVmaW5lIEFERFJfU1VSRl9USUxFX1NQTElUXzJLQiAgICAgICAgICAgICAgICAgNQorIyAgICAgICBkZWZpbmUgQUREUl9TVVJGX1RJTEVfU1BMSVRfNEtCICAgICAgICAgICAgICAgICA2CisjICAgICAgIGRlZmluZSBDQl9OVU1fQkFOS1MoeCkgICAgICAgICAgICAgICAgICAgICAgICAgICgoKHgpICYgMHgzKSA8PCAxMCkKKyMgICAgICAgZGVmaW5lIEFERFJfU1VSRl8yX0JBTksgICAgICAgICAgICAgICAgICAgICAgICAgMAorIyAgICAgICBkZWZpbmUgQUREUl9TVVJGXzRfQkFOSyAgICAgICAgICAgICAgICAgICAgICAgICAxCisjICAgICAgIGRlZmluZSBBRERSX1NVUkZfOF9CQU5LICAgICAgICAgICAgICAgICAgICAgICAgIDIKKyMgICAgICAgZGVmaW5lIEFERFJfU1VSRl8xNl9CQU5LICAgICAgICAgICAgICAgICAgICAgICAgMworIyAgICAgICBkZWZpbmUgQ0JfQkFOS19XSURUSCh4KSAgICAgICAgICAgICAgICAgICAgICAgICAoKCh4KSAmIDB4MykgPDwgMTMpCisjICAgICAgIGRlZmluZSBBRERSX1NVUkZfQkFOS19XSURUSF8xICAgICAgICAgICAgICAgICAgIDAKKyMgICAgICAgZGVmaW5lIEFERFJfU1VSRl9CQU5LX1dJRFRIXzIgICAgICAgICAgICAgICAgICAgMQorIyAgICAgICBkZWZpbmUgQUREUl9TVVJGX0JBTktfV0lEVEhfNCAgICAgICAgICAgICAgICAgICAyCisjICAgICAgIGRlZmluZSBBRERSX1NVUkZfQkFOS19XSURUSF84ICAgICAgICAgICAgICAgICAgIDMKKyMgICAgICAgZGVmaW5lIENCX0JBTktfSEVJR0hUKHgpICAgICAgICAgICAgICAgICAgICAgICAgKCgoeCkgJiAweDMpIDw8IDE2KQorIyAgICAgICBkZWZpbmUgQUREUl9TVVJGX0JBTktfSEVJR0hUXzEgICAgICAgICAgICAgICAgICAwCisjICAgICAgIGRlZmluZSBBRERSX1NVUkZfQkFOS19IRUlHSFRfMiAgICAgICAgICAgICAgICAgIDEKKyMgICAgICAgZGVmaW5lIEFERFJfU1VSRl9CQU5LX0hFSUdIVF80ICAgICAgICAgICAgICAgICAgMgorIyAgICAgICBkZWZpbmUgQUREUl9TVVJGX0JBTktfSEVJR0hUXzggICAgICAgICAgICAgICAgICAzCiAjZGVmaW5lCUNCX0NPTE9SMF9ESU0JCQkJCTB4MjhjNzgKIC8qIG9ubHkgQ0IwLTcgYmxvY2tzIGhhdmUgdGhlc2UgcmVncyAqLwogI2RlZmluZQlDQl9DT0xPUjBfQ01BU0sJCQkJCTB4MjhjN2MKQEAgLTExMzcsNyArMTE2NCwxMSBAQAogIwlkZWZpbmUgU1FfU0VMXzEJCQkJCTUKICNkZWZpbmUgU1FfVEVYX1JFU09VUkNFX1dPUkQ1XzAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMDA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IDMsCisJCS5tYXNrID0gREE5MDUyX0lSUV9NQVNLX1BPU18yLAorCX0sCisJW0RBOTA1Ml9JUlFfR1BJMTBdID0geworCQkucmVnX29mZnNldCA9IDMsCisJCS5tYXNrID0gREE5MDUyX0lSUV9NQVNLX1BPU18zLAorCX0sCisJW0RBOTA1Ml9JUlFfR1BJMTFdID0geworCQkucmVnX29mZnNldCA9IDMsCisJCS5tYXNrID0gREE5MDUyX0lSUV9NQVNLX1BPU180LAorCX0sCisJW0RBOTA1Ml9JUlFfR1BJMTJdID0geworCQkucmVnX29mZnNldCA9IDMsCisJCS5tYXNrID0gREE5MDUyX0lSUV9NQVNLX1BPU181LAorCX0sCisJW0RBOTA1Ml9JUlFfR1BJMTNdID0geworCQkucmVnX29mZnNldCA9IDMsCisJCS5tYXNrID0gREE5MDUyX0lSUV9NQVNLX1BPU182LAorCX0sCisJW0RBOTA1Ml9JUlFfR1BJMTRdID0geworCQkucmVnX29mZnNldCA9IDMsCisJCS5tYXNrID0gREE5MDUyX0lSUV9NQVNLX1BPU183LAorCX0sCisJW0RBOTA1Ml9JUlFfR1BJMTVdID0geworCQkucmVnX29mZnNldCA9IDMsCisJCS5tYXNrID0gREE5MDUyX0lSUV9NQVNLX1BPU184LAorCX0sCit9OworCitzdGF0aWMgc3RydWN0IHJlZ21hcF9pcnFfY2hpcCBkYTkwNTJfcmVnbWFwX2lycV9jaGlwID0geworCS5uYW1lID0gImRhOTA1Ml9pcnEiLAorCS5zdGF0dXNfYmFzZSA9IERBOTA1Ml9FVkVOVF9BX1JFRywKKwkubWFza19iYXNlID0gREE5MDUyX0lSUV9NQVNLX0FfUkVHLAorCS5hY2tfYmFzZSA9IERBOTA1Ml9FVkVOVF9BX1JFRywKKwkubnVtX3JlZ3MgPSBEQTkwNTJfTlVNX0lSUV9SRUdTLAorCS5pcnFzID0gZGE5MDUyX2lycXMsCisJLm51bV9pcnFzID0gQVJSQVlfU0laRShkYTkwNTJfaXJxcyksCit9OworCitzdHJ1Y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ykgfHwKLQkgICAgKDAgPT0gY29zMF9idykgfHwKLQkgICAgKDAgPT0gY29zMV9idykpIHsKKwlpZiAoKCF0b3RhbF9idykgfHwKKwkgICAgKCFjb3MwX2J3KSB8fAorCSAgICAoIWNvczFfYncpKSB7CiAJCURQKE5FVElGX01TR19MSU5LLCAiVG90YWwgQlcgY2FuJ3QgYmUgemVyb1xuIik7CiAJCXJldHVybjsKIAl9CkBAIC0xMjkwLDcgKzEzMjksNyBAQAogCSAqIGRiZzAtMDEwICAgICBkYmcxLTAwMSAgICAgY29zMS0xMDAgICAgIGNvczAtMDExICAgICBNQ1AtMDAwCiAJICogZGJnMC0wMTAgICAgIGRiZzEtMDAxICAgICBjb3MwLTAxMSAgICAgY29zMS0xMDAgICAgIE1DUC0wMDAKIAkgKi8KLQl2YWwgPSAoMCA9PSBzdHJpY3RfY29zKSA/IDB4MjMxOCA6IDB4MjJFMDsKKwl2YWwgPSAoIXN0cmljdF9jb3MpID8gMHgyMzE4IDogMHgyMkUwOwogCVJFR19XUihicCwgTklHX1JFR19QMF9UWF9BUkJfUFJJT1JJVFlfQ0xJRU5ULCB2YWwpOwogCiAJcmV0dXJuIDA7CkBAIC0xMjk4LDcgKzEzMzcsNiBAQAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qCQkJUEZDIHNlY3Rpb24JCQkJICAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQogc3RhdGljIHZvaWQgYm54MnhfdXBkYXRlX3BmY194bWFjKHN0cnVjdCBsaW5rX3BhcmFtcyAqcGFyYW1zLAogCQkJCSAgc3RydWN0IGxpbmtfdmFycyAqdmFycywKIAkJCQkgIHU4IGlzX2xiKQpAQCAtMTQwMSw3ICsxNDM5LDcgQEAKIAlpZiAoIXZhcnMtPmxpbmtfdXApCiAJCXJldHVybjsKIAot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C8qIEZsYWcgZm9yIHBvbGxpbmcgZm9yIHJlYWQgY29tcGxldGUgKi8KIAotI2RlZmluZSBJWEdCRV9FVEhfTEVOR1RIX09GX0FERFJFU1MgICA2Ci0KICNkZWZpbmUgSVhHQkVfRUVQUk9NX1BBR0VfU0laRV9NQVggICAgICAgMTI4CiAjZGVmaW5lIElYR0JFX0VFUFJPTV9SRF9CVUZGRVJfTUFYX0NPVU5UIDUxMiAvKiBFRVBST00gd29yZHMgIyByZWFkIGluIGJ1cnN0ICovCiAjZGVmaW5lIElYR0JFX0VFUFJPTV9XUl9CVUZGRVJfTUFYX0NPVU5UIDI1NiAvKiBFRVBST00gd29yZHMgIyB3ciBpbiBidXJzdCAqLwpAQCAtMjgwMiw5ICsyODAyLDkgQEAKIHN0cnVjdCBpeGdiZV9tYWNfaW5mbyB7CiAJc3RydWN0IGl4Z2JlX21hY19vcGVyYXRpb25zICAgICBvcHM7CiAJZW51bSBpeGdiZV9tYWNfdHlwZSAgICAgICAgICAgICB0eXBlOwotCXU4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkcltJWEdCRV9FVEhfTEVOR1RIX09GX0FERFJFU1NdOwotCXU4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGVybV9hZGRyW0lYR0JFX0VUSF9MRU5HVEhfT0ZfQUREUkVTU107Ci0JdTggICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYW5fYWRkcltJWEdCRV9FVEhfTEVOR1RIX09GX0FERFJFU1NdOworCXU4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkcltFVEhfQUxFTl07CisJdTggICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZXJtX2FkZHJbRVRIX0FMRU5dOworCXU4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2FuX2FkZHJbRVRIX0FMRU5dOwogCS8qIHByZWZpeCBmb3IgV29ybGQgV2lkZSBOb2RlIE5hbWUgKFdXTk4pICovCiAJdTE2ICAgICAgICAg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Q6IGdvdCAweCUwOFggZXhwZWN0ZWQgIiBcCisJCSAgICAgICAiMHglMDhYXG4iLCBSLCAodmFsICYgTSksIChXICYgTSkpOyAgICAgICAgICAgICAgICAgICAgXAogCQkqZGF0YSA9IFI7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKIAkJd3JpdGVsKGJlZm9yZSwgKGFkYXB0ZXItPmh3Lmh3X2FkZHIgKyBSKSk7ICAgICAgICAgICAgICAgICAgICBcCiAJCXJldHVybiAxOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXApkaWZmIC0tZ2l0IGEvZHJpdmVycy9uZXQvZXRoZXJuZXQvaW50ZWwvaXhnYmV2Zi9peGdiZXZmX21haW4uYyBiL2RyaXZlcnMvbmV0L2V0aGVybmV0L2ludGVsL2l4Z2JldmYvaXhnYmV2Zl9tYWluLmMKaW5kZXggNGM4ZTE5OS4uODkxMTYyZCAxMDA2NDQKLS0tIGEvZHJpdmVycy9uZXQvZXRoZXJuZXQvaW50ZWwvaXhnYmV2Zi9peGdiZXZmX21haW4uYworKysgYi9kcml2ZXJzL25ldC9ldGhlcm5ldC9pbnRlbC9peGdiZXZmL2l4Z2JldmZfbWFpbi5jCkBAIC0yOSw2ICsyOSw5IEBACiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgQ29weXJpZ2h0IChjKTIwMDYgLSAyMDA3IE15cmljb20sIEluYy4gZm9yIHNvbWUgTFJPIHNwZWNpZmljIGNvZGUKICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI2RlZmluZSBwcl9mbXQoZm10KSBLQlVJTERfTU9ETkFNRSAiOiAiIGZtdAorCiAjaW5jbHVkZSA8bGludXgvdHlwZXM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FpbGJveChkZXYpOworCQlpZiAoSVNfRVJSKG1haWxib3gpKQorCQkJcmV0dXJuIFBUUl9FUlIobWFpbGJveCk7CisJCWluYm94ID0gbWFpbGJveC0+YnVmOwogCi0JCW5wYWdlcyAgICAgIC09IGNodW5rOwotCQlzdGFydF9pbmRleCArPSBjaHVuazsKLQkJcGFnZV9saXN0ICAgKz0gY2h1bms7CisJCXdoaWxlIChucGFnZXMgPiAwKSB7CisJCQljaHVuayA9IG1pbl90KGludCwgTUxYNF9NQUlMQk9YX1NJWkUgLyBzaXplb2YodTY0KSAtIDIsCisJCQkJICAgICAgbnBhZ2VzKTsKKwkJCWluYm94WzBdID0gY3B1X3RvX2JlNjQobXR0LT5vZmZzZXQgKyBzdGFydF9pbmRleCk7CisJCQlpbmJveFsxXSA9IDA7CisJCQlmb3IgKGkgPSAwOyBpIDwgY2h1bms7ICsraSkKKwkJCQlpbmJveFtpICsgMl0gPSBjcHVfdG9fYmU2NChwYWdlX2xpc3RbaV0gfAorCQkJCQkgICAgICAgTUxYNF9NVFRfRkxBR19QUkVTRU5UKTsKKwkJCWVyciA9IG1seDRfV1JJVEVfTVRUKGRldiwgbWFpbGJveCwgY2h1bmspOworCQkJaWYgKGVycikgeworCQkJCW1seDRfZnJlZV9jbWRfbWFpbGJveChkZXYsIG1haWxib3gpOworCQkJCXJldHVybiBlcnI7CisJCQl9CisKKwkJCW5wYWdlcyAgICAgIC09IGNodW5rOworCQkJc3RhcnRfaW5kZXggKz0gY2h1bms7CisJCQlwYWdlX2xpc3QgICArPSBjaHVuazsKKwkJfQorCQltbHg0X2ZyZWVfY21kX21haWxib3goZGV2LCBtYWlsYm94KTsKKwkJcmV0dXJuIGVycjsKIAl9CiAKLQlyZXR1cm4gMDsKKwlyZXR1cm4gX19tbHg0X3dyaXRlX210dChkZXYsIG10dCwgc3RhcnRfaW5kZXgsIG5wYWdlcywgcGFnZV9saXN0KTsKIH0KIEVYUE9SVF9TWU1CT0xfR1BMKG1seDRfd3JpdG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V0dXJuIGVycjsKK30KK0VYUE9SVF9TWU1CT0xfR1BMKG1seDRfZm1yX2FsbG9jX3Jlc2VydmVkKTsKKwogaW50IG1seDRfZm1yX2VuYWJsZShzdHJ1Y3QgbWx4NF9kZXYgKmRldiwgc3RydWN0IG1seDRfZm1yICpmbXIpCiB7CiAJc3RydWN0IG1seDRfcHJpdiAqcHJpdiA9IG1seDRfcHJpdihkZXYpOwpAQCAtNjQwLDEyICs5MTMsMzIgQEAKIHZvaWQgbWx4NF9mbXJfdW5tYXAoc3RydWN0IG1seDRfZGV2ICpkZXYsIHN0cnVjdCBtbHg0X2ZtciAqZm1yLAogCQkgICAgdTMyICpsa2V5LCB1MzIgKnJrZXkpCiB7CisJc3RydWN0IG1seDRfY21kX21haWxib3ggKm1haWxib3g7CisJaW50IGVycjsKKwogCWlmICghZm1yLT5tYXBzKQogCQlyZXR1cm47CiAKIAlmbXItPm1hcHMgPSAwOwogCi0JKih1OCAqKSBmbXItPm1wdCA9IE1MWDRfTVBUX1NUQVRVU19TVzsKKwltYWlsYm94ID0gbWx4NF9hbGxvY19jbWRfbWFpbGJveChkZXYpOworCWlmIChJU19FUlIobWFpbGJveCkpIHsKKwkJZXJyID0gUFRSX0VSUihtYWlsYm94KTsKKwkJcHJpbnRrKEtFUk5fV0FSTklORyAibWx4NF9pYjogbWx4NF9hbGxvY19jbWRfbWFpbGJveCIKKwkJICAgICAgICIgZmFpbGVkICglZClcbiIsIGVycik7CisJCXJldHVybjsKKwl9CisKKwllcnIgPSBtbHg0X0hXMlNXX01QVChkZXYsIE5VTEwsCisJCQkgICAgIGtleV90b19od19pbmRleChmbXItPm1yLmtleSkgJgorCQkJICAgICAoZGV2LT5jYXBzLm51bV9tcHRzIC0gMSkpOworCW1seDRfZnJlZV9jbWRfbWFpbGJveChkZXYsIG1haWxib3gpOworCWlmIChlcnIpIHsKKwkJcHJpbnRrKEtFUk5fV0FSTklORyAibWx4NF9pYjogbWx4NF9IVzJTV19NUFQgZmFpbGVk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gICAgICAgKm10dDsKKwlzdHJ1Y3QgcmVzX2NxCSAgICAgICAqcmNxOworCXN0cnVjdCByZXNfY3EJICAgICAgICpzY3E7CisJc3RydWN0IHJlc19zcnEJICAgICAgICpzcnE7CisJc3RydWN0IGxpc3RfaGVhZAltY2dfbGlzdDsKKwlzcGlubG9ja190CQltY2dfc3BsOworCWludAkJCWxvY2FsX3FwbjsKK307CisKK2VudW0gcmVzX210dF9zdGF0ZXMgeworCVJFU19NVFRfQlVTWSA9IFJFU19BTllfQlVTWSwKKwlSRVNfTVRUX0FMTE9DQVRFRCwKK307CisKK3N0YXRpYyBpbmxpbmUgY29uc3QgY2hhciAqbXR0X3N0YXRlc19zdHIoZW51bSByZXNfbXR0X3N0YXRlcyBzdGF0ZSkKK3sKKwlzd2l0Y2ggKHN0YXRlKSB7CisJY2FzZSBSRVNfTVRUX0JVU1k6IHJldHVybiAiUkVTX01UVF9CVVNZIjsKKwljYXNlIFJFU19NVFRfQUxMT0NBVEVEOiByZXR1cm4gIlJFU19NVFRfQUxMT0NBVEVEIjsKKwlkZWZhdWx0OiByZXR1cm4gIlVua25vd24iOworCX0KK30KKworc3RydWN0IHJlc19tdHQgeworCXN0cnVjdCByZXNfY29tbW9uCWNvbTsKKwlpbnQJCQlvcmRlcjsKKwlhdG9taWNfdAkJcmVmX2NvdW50OworfTsKKworZW51bSByZXNfbXB0X3N0YXRlcyB7CisJUkVTX01QVF9CVVNZID0gUkVTX0FOWV9CVVNZLAorCVJFU19NUFRfUkVTRVJWRUQsCisJUkVTX01QVF9NQVBQRUQsCisJUkVTX01QVF9IVywKK307CisKK3N0cnVjdCByZXNfbXB0IHsKKwlzdHJ1Y3QgcmVzX2NvbW1vbgljb207CisJc3RydWN0IHJlc19tdHQJICAgICAgICptdHQ7CisJaW50CQkJa2V5OworfTsKKworZW51bSByZXNfZXFfc3RhdGVzIHsKKwlSRVNfRVFfQlVTWSA9IFJFU19BTllfQlVTWSwKKwlSRVNfRVFfUkVTRVJWRUQsCisJUkVTX0VRX0hXLAorfTsKKworc3RydWN0IHJlc19lcSB7CisJc3RydWN0IHJlc19jb21tb24JY29tOworCXN0cnVjdCByZXNfbXR0CSAgICAgICAqbXR0OworfTsKKworZW51bSByZXNfY3Ffc3RhdGVzIHsKKwlSRVNfQ1FfQlVTWSA9IFJFU19BTllfQlVTWSwKKwlSRVNfQ1FfQUxMT0NBVEVELAorCVJFU19DUV9IVywKK307CisKK3N0cnVjdCByZXNfY3EgeworCXN0cnVjdCByZXNfY29tbW9uCWNvbTsKKwlzdHJ1Y3QgcmVzX210dAkgICAgICAgKm10dDsKKwlhdG9taWNfdAkJcmVmX2NvdW50OworfTsKKworZW51bSByZXNfc3JxX3N0YXRlcyB7CisJUkVTX1NSUV9CVVNZID0gUkVTX0FOWV9CVVNZLAorCVJFU19TUlFfQUxMT0NBVEVELAorCVJFU19TUlFfSFcsCit9OworCitzdGF0aWMgaW5saW5lIGNvbnN0IGNoYXIgKnNycV9zdGF0ZXNfc3RyKGVudW0gcmVzX3NycV9zdGF0ZXMgc3RhdGUpCit7CisJc3dpdGNoIChzdGF0ZSkgeworCWNhc2UgUkVTX1NSUV9CVVNZOiByZXR1cm4gIlJFU19TUlFfQlVTWSI7CisJY2FzZSBSRVNfU1JRX0FMTE9DQVRFRDogcmV0dXJuICJSRVNfU1JRX0FMTE9DQVRFRCI7CisJY2FzZSBSRVNfU1JRX0hXOiByZXR1cm4gIlJFU19TUlFfSFciOworCWRlZmF1bHQ6IHJldHVybiAiVW5rbm93biI7CisJfQorfQorCitzdHJ1Y3QgcmVzX3NycSB7CisJc3RydWN0IHJlc19jb21tb24JY29tOworCXN0cnVjdCByZXNfbXR0CSAgICAgICAqbXR0OworCXN0cnVjdCByZXNfY3EJICAgICAgICpjcTsKKwlhdG9taWNfdAkJcmVmX2NvdW50OworfTsKKworZW51bSByZXNfY291bnRlcl9zdGF0ZXMgeworCVJFU19DT1VOVEVSX0JVU1kgPSBSRVNfQU5ZX0JVU1ksCisJUkVTX0NPVU5URVJfQUxMT0NBVEVELAorfTsKKworc3RhdGljIGlubGluZSBjb25zdCBjaGFyICpjb3VudGVyX3N0YXRlc19zdHIoZW51bSByZXNfY291bnRlcl9zdGF0ZXMgc3RhdGUpCit7CisJc3dpdGNoIChzdGF0ZSkgeworCWNhc2UgUkVTX0NPVU5URVJfQlVTWTogcmV0dXJuICJSRVNfQ09VTlRFUl9CVVNZIjsKKwljYXNlIFJFU19DT1VOVEVSX0FMTE9DQVRFRDogcmV0dXJuICJSRVNfQ09VTlRFUl9BTExPQ0FURUQiOworCWRlZmF1bHQ6IHJldHVybiAiVW5rbm93biI7CisJfQorfQorCitzdHJ1Y3QgcmVzX2NvdW50ZXIgeworCXN0cnVjdCByZXNfY29tbW9uCWNvbTsKKwlpbnQJCQlwb3J0OworfTsKKworLyogRm9yIERlYnVnIHVzZXMgKi8KK3N0YXRpYyBjb25zdCBjaGFyICpSZXNvdXJjZVR5cGUoZW51bSBtbHg0X3Jlc291cmNlIHJ0KQoreworCXN3aXRjaCAocnQpIHsKKwljYXNlIFJFU19RUDogcmV0dXJuICJSRVNfUVAiOworCWNhc2UgUkVTX0NROiByZXR1cm4gIlJFU19DUSI7CisJY2FzZSBSRVNfU1JROiByZXR1cm4gIlJFU19TUlEiOworCWNhc2UgUkVTX01QVDogcmV0dXJuICJSRVNfTVBUIjsKKwljYXNlIFJFU19NVFQ6IHJldHVybiAiUkVTX01UVCI7CisJY2FzZSBSRVNfTUFDOiByZXR1cm4gICJSRVNfTUFDIjsKKwljYXNlIFJFU19FUTogcmV0dXJuICJSRVNfRVEiOworCWNhc2UgUkVTX0NPVU5URVI6IHJldHVybiAiUkVTX0NPVU5URVIiOworCWRlZmF1bHQ6IHJldHVybiAiVW5rbm93biByZXNvdXJjZSB0eXBlICEhISI7CisJfTsKK30KKworaW50IG1seDRfaW5pdF9yZXNvdXJjZV90cmFja2VyKHN0cnVjdCBtbHg0X2RldiAqZGV2KQoreworCXN0cnVjdCBtbHg0X3Bya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naWQsCisJCQkJCSAgICBibG9ja19sb29wYmFjaywgcHJvdCwgdHlwZSk7CisJCWlmIChlcnIpCisJCQlnb3RvIGV4X3JlbTsKKwl9IGVsc2UgeworCQllcnIgPSByZW1fbWNnX3JlcyhkZXYsIHNsYXZlLCBycXAsIGdpZCwgcHJvdCk7CisJCWlmIChlcnIpCisJCQlnb3RvIGV4X3B1dDsKKwkJZXJyID0gbWx4NF9xcF9kZXRhY2hfY29tbW9uKGRldiwgJnFwLCBnaWQsIHByb3QsIHR5cGUpOworCX0KKworCXB1dF9yZXMoZGV2LCBzbGF2ZSwgcXBuLCBSRVNfUVApOworCXJldHVybiAwOworCitleF9yZW06CisJLyogaWdub3JlIGVycm9yIHJldHVybiBiZWxvdywgYWxyZWFkeSBpbiBlcnJvciAqLworCWVycjEgPSByZW1fbWNnX3JlcyhkZXYsIHNsYXZlLCBycXAsIGdpZCwgcHJvdCk7CitleF9wdXQ6CisJcHV0X3JlcyhkZXYsIHNsYXZlLCBxcG4sIFJFU19RUCk7CisKKwlyZXR1cm4gZXJyOworfQorCitlbnVtIHsKKwlCVVNZX01BWF9SRVRSSUVTID0gMTAKK307CisKK2ludCBtbHg0X1FVRVJZX0lGX1NUQVRfd3JhcHBlcihzdHJ1Y3QgbWx4NF9kZXYgKmRldiwgaW50IHNsYXZlLAorCQkJICAgICAgIHN0cnVjdCBtbHg0X3ZoY3IgKnZoY3IsCisJCQkgICAgICAgc3RydWN0IG1seDRfY21kX21haWxib3ggKmluYm94LAorCQkJICAgICAgIHN0cnVjdCBtbHg0X2NtZF9tYWlsYm94ICpvdXRib3gsCisJCQkgICAgICAgc3RydWN0IG1seDRfY21kX2luZm8gKmNtZCkKK3sKKwlpbnQgZXJyOworCWludCBpbmRleCA9IHZoY3ItPmluX21vZGlmaWVyICYgMHhmZmZmOworCisJZXJyID0gZ2V0X3JlcyhkZXYsIHNsYXZlLCBpbmRleCwgUkVTX0NPVU5URVIsIE5VTEwpOworCWlmIChlcnIpCisJCXJ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OworCXN0cnVjdCBuZXRfZGV2aWNlICpuZGV2OworCisJbmV0X2RldmljZSA9IGdldF9pbmJvdW5kX25ldF9kZXZpY2UoZGV2aWNlKTsKKwlpZiAoIW5ldF9kZXZpY2UpCisJCXJldHVybjsKKwluZGV2ID0gbmV0X2RldmljZS0+bmRldjsKKworCW52c3BfcGFja2V0ID0gKHN0cnVjdCBudnNwX21lc3NhZ2UgKikoKHVuc2lnbmVkIGxvbmcpcGFja2V0ICsKKwkJCShwYWNrZXQtPm9mZnNldDggPDwgMykpOworCisJaWYgKChudnNwX3BhY2tldC0+aGRyLm1zZ190eXBlID09IE5WU1BfTVNHX1RZUEVfSU5JVF9DT01QTEVURSkgfHwKKwkgICAgKG52c3BfcGFja2V0LT5oZHIubXNnX3R5cGUgPT0KKwkgICAgIE5WU1BfTVNHMV9UWVBFX1NFTkRfUkVDVl9CVUZfQ09NUExFVEUpIHx8CisJICAgIChudnNwX3BhY2tldC0+aGRyLm1zZ190eXBlID09CisJICAgICBOVlNQX01TRzFfVFlQRV9TRU5EX1NFTkRfQlVGX0NPTVBMRVRFKSkgeworCQkvKiBDb3B5IHRoZSByZXNwb25zZSBiYWNrICovCisJCW1lbWNweSgmbmV0X2RldmljZS0+Y2hhbm5lbF9pbml0X3BrdCwgbnZzcF9wYWNrZXQsCisJCSAgICAgICBzaXplb2Yoc3RydWN0IG52c3BfbWVzc2FnZSkpOworCQljb21wbGV0ZSgmbmV0X2RldmljZS0+Y2hhbm5lbF9pbml0X3dhaXQpOworCX0gZWxzZSBpZiAobnZzcF9wYWNrZXQtPmhkci5tc2dfdHlwZSA9PQorCQkgICBOVlNQX01TRzFfVFlQRV9TRU5EX1JORElTX1BLVF9DT01QTEVURSkgeworCQkvKiBHZXQgdGhlIHNlbmQgY29udGV4dCAqLworCQludnNjX3BhY2tldCA9IChzdHJ1Y3QgaHZfbmV0dnNjX3BhY2tldCAqKSh1bnNpZ25lZCBsb25nKQorCQkJcGFja2V0LT50cmFuc19pZDsKKwor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tX25vdGlmaWVyX2Jsb2NrIF9fcmVhZF9tb3N0bHkgPSB7CisJLm5vdGlmaWVyX2NhbGwgPSB0ZWFtX2RldmljZV9ldmVudCwKK307CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqCisgKiBNb2R1bGUgaW5pdCBhbmQgZXhpdAorICoqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgaW50IF9faW5pdCB0ZWFtX21vZHVsZV9pbml0KHZvaWQpCit7CisJaW50IGVycjsKKworCXJlZ2lzdGVyX25ldGRldmljZV9ub3RpZmllcigmdGVhbV9ub3RpZmllcl9ibG9jayk7CisKKwllcnIgPSBydG5sX2xpbmtfcmVnaXN0ZXIoJnRlYW1fbGlua19vcHMpOworCWlmIChlcnIpCisJCWdvdG8gZXJyX3J0bmxfcmVnOworCisJZXJyID0gdGVhbV9ubF9pbml0KCk7CisJaWYgKGVycikKKwkJZ290byBlcnJfbmxfaW5pdDsKKworCXJldHVybiAwOworCitlcnJfbmxfaW5pdDoKKwlydG5sX2xpbmtfdW5yZWdpc3RlcigmdGVhbV9saW5rX29wcyk7CisKK2Vycl9ydG5sX3JlZzoKKwl1bnJlZ2lzdGVyX25ldGRldmljZV9ub3RpZmllcigmdGVhbV9ub3RpZmllcl9ibG9jayk7CisKKwlyZXR1cm4gZXJyOworfQorCitzdGF0aWMgdm9pZCBfX2V4aXQgdGVhbV9tb2R1bGVfZXhpdCh2b2lkKQoreworCXRlYW1fbmxfZmluaSgpOworCXJ0bmxfbGlua191bnJlZ2lzdGVyKCZ0ZWFtX2xpbmtfb3BzKTsKKwl1bnJlZ2lzdGVyX25ldGRldmljZV9ub3RpZmllcigmdGVhbV9ub3RpZmllcl9ibG9jayk7Cit9CisKK21vZHVsZV9pbml0KHRlYW1fbW9kdWxlX2luaXQpOworbW9kdWxlX2V4aXQodGVhbV9tb2R1bGVfZXhpdCk7CisKK01PRFVMRV9MSUNFTlNFKCJHUEwgdjIiKTsKK01PRFVMRV9BVVRIT1IoIkppc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cnN0IDI4IGJ5dGVzIG9mIHRoZSBIVEMgcmVnaXN0ZXIgdGFibGUuIFRoaXMKKwkJICogd2lsbCB5aWVsZCB1cyB0aGUgdmFsdWUgb2YgZGlmZmVyZW50IGludCBzdGF0dXMKKwkJICogcmVnaXN0ZXJzIGFuZCB0aGUgbG9va2FoZWFkIHJlZ2lzdGVycy4KKwkJICoKKwkJICogICAgbGVuZ3RoID0gc2l6ZW9mKGludF9zdGF0dXMpICsgc2l6ZW9mKGNwdV9pbnRfc3RhdHVzKQorCQkgKiAgICAgICAgICAgICArIHNpemVvZihlcnJvcl9pbnRfc3RhdHVzKSArCisJCSAqICAgICAgICAgICAgIHNpemVvZihjb3VudGVyX2ludF9zdGF0dXMpICsKKwkJICogICAgICAgICAgICAgc2l6ZW9mKG1ib3hfZnJhbWUpICsgc2l6ZW9mKHJ4X2xrYWhkX3ZhbGlkKQorCQkgKiAgICAgICAgICAgICArIHNpemVvZihob2xlKSArIHNpemVvZihyeF9sa2FoZCkgKworCQkgKiAgICAgICAgICAgICBzaXplb2YoaW50X3N0YXR1c19lbikgKworCQkgKiAgICAgICAgICAgICBzaXplb2YoY3B1X2ludF9zdGF0dXNfZW4pICsKKwkJICogICAgICAgICAgICAgc2l6ZW9mKGVycl9pbnRfc3RhdHVzX2VuKSArCisJCSAqICAgICAgICAgICAgIHNpemVvZihjbnRyX2ludF9zdGF0dXNfZW4pOworCQkgKi8KKwkJc3RhdHVzID0gaGlmX3JlYWRfd3JpdGVfc3luYyhkZXYtPmFyLCBIT1NUX0lOVF9TVEFUVVNfQUREUkVTUywKKwkJCQkJICAgICAodTggKikgJmRldi0+aXJxX3Byb2NfcmVnLAorCQkJCQkgICAgIHNpemVvZihkZXYtPmlycV9wcm9jX3JlZyksCisJCQkJCSAgICAgSElGX1JEX1NZTkNfQllURV9JTkMpOworCQlpZiAoc3RhdHVzKQorCQkJZ290byBvdXQ7CisKKwkJaWYgKEFSX0RCR19MVkxfQ0hFQ0soQVRINktMX0RCR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ZW51bSBtY2lfbWVzc2FnZV9oZWFkZXIgewkJLyogbGVuZ3RoIG9mIHBheWxvYWQgKi8KKwlNQ0lfTE5BX0NUUkwgICAgID0gMHgxMCwgICAgICAgIC8qIGxlbiA9IDAgKi8KKwlNQ0lfQ09OVF9OQUNLICAgID0gMHgyMCwgICAgICAgIC8qIGxlbiA9IDAgKi8KKwlNQ0lfQ09OVF9JTkZPICAgID0gMHgzMCwgICAgICAgIC8qIGxlbiA9IDQgKi8KKwlNQ0lfQ09OVF9SU1QgICAgID0gMHg0MCwgICAgICAgIC8qIGxlbiA9IDAgKi8KKwlNQ0lfU0NIRF9JTkZPICAgID0gMHg1MCwgICAgICAgIC8qIGxlbiA9IDE2ICovCisJTUNJX0NQVV9JTlQgICAgICA9IDB4NjAsICAgICAgICAvKiBsZW4gPSA0ICovCisJTUNJX1NZU19XQUtJTkcgICA9IDB4NzAsICAgICAgICAvKiBsZW4gPSAwICovCisJTUNJX0dQTSAgICAgICAgICA9IDB4ODAsICAgICAgICAvKiBsZW4gPSAxNiAqLworCU1DSV9MTkFfSU5GTyAgICAgPSAweDkwLCAgICAgICAgLyogbGVuID0gMSAqLworCU1DSV9MTkFfU1RBVEUgICAgPSAweDk0LAorCU1DSV9MTkFfVEFLRSAgICAgPSAweDk4LAorCU1DSV9MTkFfVFJBTlMgICAgPSAweDljLAorCU1DSV9TWVNfU0xFRVBJTkcgPSAweGEwLCAgICAgICAgLyogbGVuID0gMCAqLworCU1DSV9SRVFfV0FLRSAgICAgPSAweGMwLCAgICAgICAgLyogbGVuID0gMCAqLworCU1DSV9ERUJVR18xNiAgICAgPSAweGZlLCAgICAgICAgLyogbGVuID0gMiAqLworCU1DSV9SRU1PVEVfUkVTRVQgPSAweGZmICAgICAgICAgLyogbGVuID0gMTYgKi8KK307CisKK2VudW0gYXRoX21jaV9ncG1fY29leF9wcm9maWxlX3R5cGUgeworCU1DSV9HUE1fQ09FWF9QUk9GSUxFX1VOS05PV04sCisJTUNJX0dQTV9D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mV2ID09IDIpCisJCWI0M19waHlfc2V0KGRldiwgQjQzX05QSFlfRklORVJYMl9DR0MsCisJCQkJQjQzX05QSFlfRklORVJYMl9DR0NfREVDR0MpOworfQorCisvKiBodHRwOi8vYmNtLXY0LnNpcHNvbHV0aW9ucy5uZXQvODAyLjExL1BIWS9OL1dvcmthcm91bmRzICovCitzdGF0aWMgdm9pZCBiNDNfbnBoeV93b3JrYXJvdW5kcyhzdHJ1Y3QgYjQzX3dsZGV2ICpkZXYpCit7CisJc3RydWN0IGI0M19waHkgKnBoeSA9ICZkZXYtPnBoeTsKKwlzdHJ1Y3QgYjQzX3BoeV9uICpucGh5ID0gcGh5LT5uOworCisJaWYgKGI0M19jdXJyZW50X2JhbmQoZGV2LT53bCkgPT0gSUVFRTgwMjExX0JBTkRfNUdIWikKKwkJYjQzX25waHlfY2xhc3NpZmllcihkZXYsIDEsIDApOworCWVsc2UKKwkJYjQzX25waHlfY2xhc3NpZmllcihkZXYsIDEsIDEpOworCisJaWYgKG5waHktPmhhbmdfYXZvaWQpCisJCWI0M19ucGh5X3N0YXlfaW5fY2Fycmllcl9zZWFyY2goZGV2LCAxKTsKKworCWI0M19waHlfc2V0KGRldiwgQjQzX05QSFlfSVFGTElQLAorCQkgICAgQjQzX05QSFlfSVFGTElQX0FEQzEgfCBCNDNfTlBIWV9JUUZMSVBfQURDMik7CisKKwlpZiAoZGV2LT5waHkucmV2ID49IDMpCisJCWI0M19ucGh5X3dvcmthcm91bmRzX3JldjNwbHVzKGRldik7CisJZWxzZQorCQliNDNfbnBoeV93b3JrYXJvdW5kc19yZXYxXzIoZGV2KTsKKworCWlmIChucGh5LT5oYW5nX2F2b2lkKQorCQliNDNfbnBoeV9zdGF5X2luX2NhcnJpZXJfc2VhcmNoKGRldiwgMCk7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogVHgvUnggY29tbW9uCisgKioqKioqKioqKioqKioqKioqKioqKioqKio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wZGF0ZWRbY29yZV0gPT0gMCkgewogCQkJCWI0M19ucGh5X3VwZGF0ZV90eF9jYWxfbGFkZGVyKGRldiwgY29yZSk7Ci0JCQkJdXBkYXRlZFtjb3JlXSA9IDE7CisJCQkJdXBkYXRlZFtjb3JlXSA9IHRydWU7CiAJCQl9CiAKIAkJCXRtcCA9IChwYXJhbXNbY29yZV0ubmNvcnJbdHlwZV0gPDwgOCkgfCAweDY2OwpAQCAtMzczMCwxMCArMzg4OCwxMDQgQEAKIAliNDNfbWFjX2VuYWJsZShkZXYpOwogfQogCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIE4tUEhZIGluaXQKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwogLyoKLSAqIEluaXQgTi1QSFkKLSAqIGh0dHA6Ly9iY20tdjQuc2lwc29sdXRpb25zLm5ldC84MDIuMTEvUEhZL0luaXQvTgorICogVXBsb2FkIHRoZSBOLVBIWSB0YWJsZXMuCisgKiBodHRwOi8vYmNtLXY0LnNpcHNvbHV0aW9ucy5uZXQvODAyLjExL1BIWS9OL0luaXRUYWJsZXMKICAqLworc3RhdGljIHZvaWQgYjQzX25waHlfdGFibGVzX2luaXQoc3RydWN0IGI0M193bGRldiAqZGV2KQoreworCWlmIChkZXYtPnBoeS5yZXYgPCAzKQorCQliNDNfbnBoeV9yZXYwXzFfMl90YWJsZXNfaW5pdChkZXYpOworCWVsc2UKKwkJYjQzX25waHlfcmV2M3BsdXNfdGFibGVzX2luaXQoZGV2KTsKK30KKworLyogaHR0cDovL2JjbS12NC5zaXBzb2x1dGlvbnMubmV0LzgwMi4xMS9QSFkvTi9NSU1PQ29uZmlnICovCitzdGF0aWMgdm9pZCBiNDNfbnBoeV91cGRhdGVfbWltb19jb25maWcoc3RydWN0IGI0M193bGRldiAqZGV2LCBzMzIgcHJlYW1ibGUpCit7CisJdTE2IG1pbW9jZmcgPS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jUpIHsKKwkJCWI0M193cml0ZTE2KGRldiwgQjQzX01NSU9fVFNGX0NMS19GUkFDX0xPVywKKwkJCQkgICAgYXZvaWQgPyAweDUzNDEgOiAweDg4ODkpOworCQkJYjQzX3dyaXRlMTYoZGV2LCBCNDNfTU1JT19UU0ZfQ0xLX0ZSQUNfSElHSCwgMHg4KTsKKwkJfQorCisJCWlmIChkZXYtPnBoeS5yZXYgPT0gMyB8fCBkZXYtPnBoeS5yZXYgPT0gNCkKKwkJCTsgLyogVE9ETzogcmVzZXQgUExMICovCisKKwkJaWYgKGF2b2lkKQorCQkJYjQzX3BoeV9zZXQoZGV2LCBCNDNfTlBIWV9CQkNGRywgQjQzX05QSFlfQkJDRkdfUlNUUlgpOworCQllbHNlCisJCQliNDNfcGh5X21hc2soZGV2LCBCNDNfTlBIWV9CQkNGRywKKwkJCQkgICAgIH5CNDNfTlBIWV9CQkNGR19SU1RSWCAmIDB4RkZGRik7CisKKwkJYjQzX25waHlfcmVzZXRfY2NhKGRldik7CisKKwkJLyogd2wgc2V0cyB1c2VsZXNzIHBoeV9pc3NwdXJhdm9pZCBoZXJlICovCiAJfQogCiAJYjQzX3BoeV93cml0ZShkZXYsIEI0M19OUEhZX05EQVRBVF9EVVA0MCwgMHgzODMwKTsKQEAgLTQwMzksNiArNDQxMCwxMCBAQAogCXJldHVybiAwOwogfQogCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIEJhc2ljIFBIWSBvcHMuCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKIHN0YXRpYyBpbnQgYjQzX25waHlfb3BfYWxsb2NhdGUoc3RydWN0IGI0M193bGRldiAqZGV2KQogewogCXN0cnVjdCBiNDNfcGh5X24gKm5waHk7CkBAIC00MDU1LDEwICs0NDMwLDEzIEBACiB7CiAJc3RydWN0IGI0M19waHkgKnBoeSA9ICZkZXYtPnBoeTsKIAlzdHJ1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XBvcyArPSBpbDM5NDVfc3RhdHNfZmxhZyhpbCwgYnVmLCBidWZzeik7CisJcG9zICs9CisJICAgIHNjbnByaW50ZihidWYgKyBwb3MsIGJ1ZnN6IC0gcG9zLAorCQkgICAgICAiJS0zMnMgICAgIGN1cnJlbnQiCisJCSAgICAgICJhY3VtdWxhdGl2ZSAgICAgICBkZWx0YSAgICAgICAgIG1heFxuIiwKKwkJICAgICAgIlN0YXRpc3RpY3NfUnggLSBPRkRNOiIpOworCXBvcyArPQorCSAgICBzY25wcmludGYoYnVmICsgcG9zLCBidWZzeiAtIHBvcywKKwkJICAgICAgIiAgJS0zMHMgJTEwdSAgJTEwdSAgJTEwdSAgJTEwdVxuIiwgImluYV9jbnQ6IiwKKwkJICAgICAgbGUzMl90b19jcHUob2ZkbS0+aW5hX2NudCksIGFjY3VtX29mZG0tPmluYV9jbnQsCisJCSAgICAgIGRlbHRhX29mZG0tPmluYV9jbnQsIG1heF9vZmRtLT5pbmFfY250KTsKKwlwb3MgKz0KKwkgICAgc2NucHJpbnRmKGJ1ZiArIHBvcywgYnVmc3ogLSBwb3MsCisJCSAgICAgICIgICUtMzBzICUxMHUgICUxMHUgICUxMHUgICUxMHVcbiIsICJmaW5hX2NudDoiLAorCQkgICAgICBsZTMyX3RvX2NwdShvZmRtLT5maW5hX2NudCksIGFjY3VtX29mZG0tPmZpbmFfY250LAorCQkgICAgICBkZWx0YV9vZmRtLT5maW5hX2NudCwgbWF4X29mZG0tPmZpbmFfY250KTsKKwlwb3MgKz0KKwkgICAgc2NucHJpbnRmKGJ1ZiArIHBvcywgYnVmc3ogLSBwb3MsCisJCSAgICAgICIgICUtMzBzICUxMHUgICUxMHUgICUxMHUgICUxMHVcbiIsICJwbGNwX2VycjoiLAorCQkgICAgICBsZTMyX3RvX2NwdShvZmRtLT5wbGNwX2VyciksIGFjY3VtX29mZG0tPnBsY3BfZXJyLAorCQkgICAgICBkZWx0YV9vZmRtLT5wbGNwX2VyciwgbWF4X29mZG0tPn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xpbWl0X292ZXJydW4sCisJCSAgICAgIGRlbHRhX29mZG0tPnJ4ZV9mcmFtZV9saW1pdF9vdmVycnVuLAorCQkgICAgICBtYXhfb2ZkbS0+cnhlX2ZyYW1lX2xpbWl0X292ZXJydW4pOworCXBvcyArPQorCSAgICBzY25wcmludGYoYnVmICsgcG9zLCBidWZzeiAtIHBvcywKKwkJICAgICAgIiAgJS0zMHMgJTEwdSAgJTEwdSAgJTEwdSAgJTEwdVxuIiwgInNlbnRfYWNrX2NudDoiLAorCQkgICAgICBsZTMyX3RvX2NwdShvZmRtLT5zZW50X2Fja19jbnQpLCBhY2N1bV9vZmRtLT5zZW50X2Fja19jbnQsCisJCSAgICAgIGRlbHRhX29mZG0tPnNlbnRfYWNrX2NudCwgbWF4X29mZG0tPnNlbnRfYWNrX2NudCk7CisJcG9zICs9CisJICAgIHNjbnByaW50ZihidWYgKyBwb3MsIGJ1ZnN6IC0gcG9zLAorCQkgICAgICAiICAlLTMwcyAlMTB1ICAlMTB1ICAlMTB1ICAlMTB1XG4iLCAic2VudF9jdHNfY250OiIsCisJCSAgICAgIGxlMzJfdG9fY3B1KG9mZG0tPnNlbnRfY3RzX2NudCksIGFjY3VtX29mZG0tPnNlbnRfY3RzX2NudCwKKwkJICAgICAgZGVsdGFfb2ZkbS0+c2VudF9jdHNfY250LCBtYXhfb2ZkbS0+c2VudF9jdHNfY250KTsKKworCXBvcyArPQorCSAgICBzY25wcmludGYoYnVmICsgcG9zLCBidWZzeiAtIHBvcywKKwkJICAgICAgIiUtMzJzICAgICBjdXJyZW50IgorCQkgICAgICAiYWN1bXVsYXRpdmUgICAgICAgZGVsdGEgICAgICAgICBtYXhcbiIsCisJCSAgICAgICJTdGF0aXN0aWNzX1J4IC0gQ0NLOiIpOworCXBvcyArPQorCSAgICBzY25wcmludGYoYnVmICsgcG9zLCBidWZzeiAtIHBvcywKKwkJICAgICAgIiAgJS0zMHMgJTEwdSAgJTEwdSAgJTEwdSAgJTEwdVxuIiwgImluY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GZyb20gcnhfZnJlZSBpbnRvIFJ4CisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWV1ZSwgdXBkYXRlcyBmaXJtd2FyZSBwb2ludGVycywgYW5kIHVwZGF0ZXMKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBXUklURSBpZHguICBJZiBpbnN1ZmZpY2llbnQgcnhfZnJlZSBidWZmZXJzCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmUgYXZhaWxhYmxlLCBzY2hlZHVsZXMgaWwzOTQ1X3J4X3JlcGxlbmlzaAorICoKKyAqIC0tIGVuYWJsZSBpbnRlcnJ1cHRzIC0tCisgKiBJU1IgLSBpbDM5NDVfcngoKSAgICAgICAgIERldGFjaCBpbF9yeF9idWZzIGZyb20gcG9vbCB1cCB0byB0aGUKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJFQUQgSURYLCBkZXRhY2hpbmcgdGhlIFNLQiBmcm9tIHRoZSBwb29sLgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgTW92ZXMgdGhlIHBhY2tldCBidWZmZXIgZnJvbSBxdWV1ZSB0byByeF91c2VkLgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2FsbHMgaWwzOTQ1X3J4X3F1ZXVlX3Jlc3RvY2sgdG8gcmVmaWxsIGFueSBlbXB0eQorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgc2xvdHMuCisgKiAuLi4KKyAqCisgKi8KKworLyoqCisgKiBpbDM5NDVfZG1hX2FkZHIycmJkX3B0ciAtIGNvbnZlcnQgYSBETUEgYWRkcmVzcyB0byBhIHVDb2RlIHJlYWQgYnVmZmVyIHB0cgorICovCitzdGF0aWMgaW5saW5lIF9fbGUzMgoraWwzOTQ1X2RtYV9hZGRyMnJiZF9wdHIoc3RydWN0IGlsX3ByaXYgKmlsLCBkbWFfYWRkcl90IGRtYV9hZGRyKQoreworCXJldHVybiBjcHVfdG9fbGUzMigodTMyKSBkbWF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kRlc2MgICAgICAgVGltZSAgICAgICBhc3J0UEMgIGJsaW5rMiAiCisJICAgICAgICJpbGluazEgIG5taVBDICAgTGluZVxuIik7CisJZm9yIChpID0gRVJST1JfU1RBUlRfT0ZGU0VUOworCSAgICAgaSA8IChjb3VudCAqIEVSUk9SX0VMRU1fU0laRSkgKyBFUlJPUl9TVEFSVF9PRkZTRVQ7CisJICAgICBpICs9IEVSUk9SX0VMRU1fU0laRSkgeworCQlkZXNjID0gaWxfcmVhZF90YXJnX21lbShpbCwgYmFzZSArIGkpOworCQl0aW1lID0gaWxfcmVhZF90YXJnX21lbShpbCwgYmFzZSArIGkgKyAxICogc2l6ZW9mKHUzMikpOworCQlibGluazEgPSBpbF9yZWFkX3RhcmdfbWVtKGlsLCBiYXNlICsgaSArIDIgKiBzaXplb2YodTMyKSk7CisJCWJsaW5rMiA9IGlsX3JlYWRfdGFyZ19tZW0oaWwsIGJhc2UgKyBpICsgMyAqIHNpemVvZih1MzIpKTsKKwkJaWxpbmsxID0gaWxfcmVhZF90YXJnX21lbShpbCwgYmFzZSArIGkgKyA0ICogc2l6ZW9mKHUzMikpOworCQlpbGluazIgPSBpbF9yZWFkX3RhcmdfbWVtKGlsLCBiYXNlICsgaSArIDUgKiBzaXplb2YodTMyKSk7CisJCWRhdGExID0gaWxfcmVhZF90YXJnX21lbShpbCwgYmFzZSArIGkgKyA2ICogc2l6ZW9mKHUzMikpOworCisJCUlMX0VSUigiJS0xM3MgKDB4JVgpICUwMTB1IDB4JTA1WCAweCUwNVggMHglMDVYIDB4JTA1WCAldVxuXG4iLAorCQkgICAgICAgaWwzOTQ1X2Rlc2NfbG9va3VwKGRlc2MpLCBkZXNjLCB0aW1lLCBibGluazEsIGJsaW5rMiwKKwkJICAgICAgIGlsaW5rMSwgaWxpbmsyLCBkYXRhMSk7CisJfQorfQorCitzdGF0aWMgdm9pZAoraWwzOTQ1X2lycV90YXNrbGV0KHN0cnVjdCBpbF9wcml2ICppbCkKK3sKKwl1MzIg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2ldLmllZWUgKiA1OworCQlyYXRlc1tpXS5od192YWx1ZSA9IGk7CS8qIFJhdGUgc2NhbGluZyB3aWxsIHdvcmsgb24gaWR4ZXMgKi8KKwkJcmF0ZXNbaV0uaHdfdmFsdWVfc2hvcnQgPSBpOworCQlyYXRlc1tpXS5mbGFncyA9IDA7CisJCWlmIChpID4gSUwzOV9MQVNUX09GRE1fUkFURSB8fCBpIDwgSUxfRklSU1RfT0ZETV9SQVRFKSB7CisJCQkvKgorCQkJICogSWYgQ0NLICE9IDFNIHRoZW4gc2V0IHNob3J0IHByZWFtYmxlIHJhdGUgZmxhZy4KKwkJCSAqLworCQkJcmF0ZXNbaV0uZmxhZ3MgfD0KKwkJCSAgICAoaWwzOTQ1X3JhdGVzW2ldLnBsY3AgPT0KKwkJCSAgICAgMTApID8gMCA6IElFRUU4MDIxMV9SQVRFX1NIT1JUX1BSRUFNQkxFOworCQl9CisJfQorfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogdUNvZGUgZG93bmxvYWQgZnVuY3Rpb25zCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworc3RhdGljIHZvaWQKK2lsMzk0NV9kZWFsbG9jX3Vjb2RlX3BjaShzdHJ1Y3QgaWxfcHJpdiAqaWwpCit7CisJaWxfZnJlZV9md19kZXNjKGlsLT5wY2lfZGV2LCAmaWwtPnVjb2RlX2NvZGUpOworCWlsX2ZyZWVfZndfZGVzYyhpbC0+cGNpX2RldiwgJmlsLT51Y29kZV9kYXRhKTsKKwlpbF9mcmVlX2Z3X2Rlc2MoaWwtPnBjaV9kZXYsICZpbC0+dWNvZGVfZGF0YV9iYWNrdXApOworCWlsX2ZyZWVfZndfZGVzYyhpbC0+cGNpX2RldiwgJmlsLT51Y29kZV9pbml0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N0YXJ0IGNhcmQ7ICJpbml0aWFsaXplIiB3aWxsIGxvYWQgcnVudGltZSB1Y29kZSAqLworCQlpbDM5NDVfbmljX3N0YXJ0KGlsKTsKKworCQlEX0lORk8oRFJWX05BTUUgIiBpcyBjb21pbmcgdXBcbiIpOworCisJCXJldHVybiAwOworCX0KKworCXNldF9iaXQoU19FWElUX1BFTkRJTkcsICZpbC0+c3RhdHVzKTsKKwlfX2lsMzk0NV9kb3duKGlsKTsKKwljbGVhcl9iaXQoU19FWElUX1BFTkRJTkcsICZpbC0+c3RhdHVzKTsKKworCS8qIHRyaWVkIHRvIHJlc3RhcnQgYW5kIGNvbmZpZyB0aGUgZGV2aWNlIGZvciBhcyBsb25nIGFzIG91cgorCSAqIHBhdGllbmNlIGNvdWxkIHdpdGhzdGFuZCAqLworCUlMX0VSUigiVW5hYmxlIHRvIGluaXRpYWxpemUgZGV2aWNlIGFmdGVyICVkIGF0dGVtcHRzLlxuIiwgaSk7CisJcmV0dXJuIC1FSU87Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIFdvcmtxdWV1ZSBjYWxsYmFja3MKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3N0YXRpYyB2b2lkCitpbDM5NDVfYmdfaW5pdF9hbGl2ZV9zdGFydChzdHJ1Y3Qgd29ya19zdHJ1Y3QgKmRhdGEpCit7CisJc3RydWN0IGlsX3ByaXYgKmlsID0KKwkgICAgY29udGFpbmVyX29mKGRhdGEsIHN0cnVjdCBpbF9wcml2LCBpbml0X2FsaXZlX3N0YXJ0LndvcmspOworCisJbXV0ZXhfbG9jaygmaWwtPm11dGV4KTsKKwlpZiAodGVzdF9iaXQoU19FWElUX1BFTkRJTkcsICZpbC0+c3RhdHVzKSkKKwkJZ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aWwpOworCQlicmVhazsKKwlkZWZhdWx0OgorCQlJTF9FUlIoIiVzIFNob3VsZCBub3QgYmUgY2FsbGVkIGluICVkIG1vZGVcbiIsIF9fZnVuY19fLAorCQkgICAgICAgY3R4LT52aWYtPnR5cGUpOworCQlicmVhazsKKwl9Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIG1hYzgwMjExIGVudHJ5IHBvaW50IGZ1bmN0aW9ucworICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI2RlZmluZSBVQ09ERV9SRUFEWV9USU1FT1VUCSgyICogSFopCisKK3N0YXRpYyBpbnQKK2lsMzk0NV9tYWNfc3RhcnQoc3RydWN0IGllZWU4MDIxMV9odyAqaHcpCit7CisJc3RydWN0IGlsX3ByaXYgKmlsID0gaHctPnByaXY7CisJaW50IHJldDsKKworCURfTUFDODAyMTEoImVudGVyXG4iKTsKKworCS8qIHdlIHNob3VsZCBiZSB2ZXJpZnlpbmcgdGhlIGRldmljZSBpcyByZWFkeSB0byBiZSBvcGVuZWQgKi8KKwltdXRleF9sb2NrKCZpbC0+bXV0ZXgpOworCisJLyogZmV0Y2ggdWNvZGUgZmlsZSBmcm9tIGRpc2ssIGFsbG9jIGFuZCBjb3B5IHRvIGJ1cy1tYXN0ZXIgYnVmZmVycyAuLi4KKwkgKiB1Y29kZSBmaWxlbmFtZSBhbmQgbWF4IHNpemVzIGFyZSBjYXJkLXNwZWNpZmljLiAqLworCisJaWYgKCFpbC0+dWNvZGVfY29kZS5sZW4pIHsKKwkJcmV0ID0gaWwzOTQ1X3JlYWRfdWNvZGUoaWwpOworCQlpZiAocmV0KSB7CisJCQlJTF9FUlIoIkNvdWxkIG5vdCByZWFkIG1pY3JvY29kZTogJWRcbiIsIHJldCk7CisJ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CSAgICBGSUZfT1RIRVJfQlNTIHwgRklGX0FMTE1VTFRJIHwgRklGX1BST01JU0NfSU5fQlNTIHwKKwkgICAgRklGX0JDTl9QUkJSRVNQX1BST01JU0MgfCBGSUZfQ09OVFJPTDsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogc3lzZnMgYXR0cmlidXRlcworICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI2lmZGVmIENPTkZJR19JV0xFR0FDWV9ERUJVRworCisvKgorICogVGhlIGZvbGxvd2luZyBhZGRzIGEgbmV3IGF0dHJpYnV0ZSB0byB0aGUgc3lzZnMgcmVwcmVzZW50YXRpb24KKyAqIG9mIHRoaXMgZGV2aWNlIGRyaXZlciAoaS5lLiBhIG5ldyBmaWxlIGluIC9zeXMvYnVzL3BjaS9kcml2ZXJzL2l3bC8pCisgKiB1c2VkIGZvciBjb250cm9sbGluZyB0aGUgZGVidWcgbGV2ZWwuCisgKgorICogU2VlIHRoZSBsZXZlbCBkZWZpbml0aW9ucyBpbiBpd2wgZm9yIGRldGFpbHMuCisgKgorICogVGhlIGRlYnVnX2xldmVsIGJlaW5nIG1hbmFnZWQgdXNpbmcgc3lzZnMgYmVsb3cgaXMgYSBwZXIgZGV2aWNlIGRlYnVnCisgKiBsZXZlbCB0aGF0IGlzIHVzZWQgaW5zdGVhZCBvZiB0aGUgZ2xvYmFsIGRlYnVnIGxldmVsIGlmIGl0ICh0aGUgcGVyCisgKiBkZXZpY2UgZGVidWcgbGV2ZWwpIGlzIHNldC4KKyAqLworc3RhdGljIHNzaXplX3QKK2lsMzk0NV9zaG93X2RlYnVnX2xldmVsKHN0cnVjdCBkZXZpY2UgKmQsIHN0cnVjdCBkZXZpY2VfYXR0cmlidXRlICphdHRyLAorCQkJY2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nID0gY2ZnOworCWlsLT5wY2lfZGV2ID0gcGRldjsKKwlpbC0+aW50YV9tYXNrID0gQ1NSX0lOSV9TRVRfTUFTSzsKKworCWlmIChpbF9hbGxvY190cmFmZmljX21lbShpbCkpCisJCUlMX0VSUigiTm90IGVub3VnaCBtZW1vcnkgdG8gZ2VuZXJhdGUgdHJhZmZpYyBsb2dcbiIpOworCisJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgorCSAqIDIuIEluaXRpYWxpemluZyBQQ0kgYnVzCisJICogKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwlwY2lfZGlzYWJsZV9saW5rX3N0YXRlKHBkZXYsCisJCQkgICAgICAgUENJRV9MSU5LX1NUQVRFX0wwUyB8IFBDSUVfTElOS19TVEFURV9MMSB8CisJCQkgICAgICAgUENJRV9MSU5LX1NUQVRFX0NMS1BNKTsKKworCWlmIChwY2lfZW5hYmxlX2RldmljZShwZGV2KSkgeworCQllcnIgPSAtRU5PREVWOworCQlnb3RvIG91dF9pZWVlODAyMTFfZnJlZV9odzsKKwl9CisKKwlwY2lfc2V0X21hc3RlcihwZGV2KTsKKworCWVyciA9IHBjaV9zZXRfZG1hX21hc2socGRldiwgRE1BX0JJVF9NQVNLKDMyKSk7CisJaWYgKCFlcnIpCisJCWVyciA9IHBjaV9zZXRfY29uc2lzdGVudF9kbWFfbWFzayhwZGV2LCBETUFfQklUX01BU0soMzIpKTsKKwlpZiAoZXJyKSB7CisJCUlMX1dBUk4oIk5vIHN1aXRhYmxlIERNQSBhdmFpbGFibGUuXG4iKTsKKwkJZ290byBvdXRfcGNpX2Rpc2FibGVfZGV2aWNlOworCX0KKworCXBjaV9zZXRfZHJ2ZGF0YShwZGV2LCBpbCk7CisJZXJyID0gcGNpX3JlcXVlc3RfcmVnaW9ucyhwZGV2LCBEUlZfTkFNRSk7CisJaWYgKGVycikKKwkJZ290byBvdXRfcGNpX2Rpc2FibGVfZGV2aWNlOworCisJLyoqKioqKioqKioqKioqKioqKioqKio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2VybmVsIHRyeWluZyB0byBzdGFydCB1cAorCSAqLworCV9pbF93cihpbCwgQ1NSX1JFU0VULCBDU1JfUkVTRVRfUkVHX0ZMQUdfTkVWT19SRVNFVCk7CisKKwkvKioqKioqKioqKioqKioqKioqKioqKioKKwkgKiA0LiBSZWFkIEVFUFJPTQorCSAqICoqKioqKioqKioqKioqKioqKioqLworCisJLyogUmVhZCB0aGUgRUVQUk9NICovCisJZXJyID0gaWxfZWVwcm9tX2luaXQoaWwpOworCWlmIChlcnIpIHsKKwkJSUxfRVJSKCJVbmFibGUgdG8gaW5pdCBFRVBST01cbiIpOworCQlnb3RvIG91dF9pb3VubWFwOworCX0KKwkvKiBNQUMgQWRkcmVzcyBsb2NhdGlvbiBpbiBFRVBST00gc2FtZSBmb3IgMzk0NS80OTY1ICovCisJZWVwcm9tID0gKHN0cnVjdCBpbDM5NDVfZWVwcm9tICopaWwtPmVlcHJvbTsKKwlEX0lORk8oIk1BQyBhZGRyZXNzOiAlcE1cbiIsIGVlcHJvbS0+bWFjX2FkZHJlc3MpOworCVNFVF9JRUVFODAyMTFfUEVSTV9BRERSKGlsLT5odywgZWVwcm9tLT5tYWNfYWRkcmVzcyk7CisKKwkvKioqKioqKioqKioqKioqKioqKioqKioKKwkgKiA1LiBTZXR1cCBIVyBDb25zdGFudHMKKwkgKiAqKioqKioqKioqKioqKioqKioqKi8KKwkvKiBEZXZpY2Utc3BlY2lmaWMgc2V0dXAgKi8KKwlpZiAoaWwzOTQ1X2h3X3NldF9od19wYXJhbXMoaWwpKSB7CisJCUlMX0VSUigiZmFpbGVkIHRvIHNldCBodyBzZXR0aW5nc1xuIik7CisJCWdvdG8gb3V0X2VlcHJvbV9mcmVlOworCX0KKworCS8qKioqKioqKioqKioqKioqKioqKioqKgorCSAqIDYuIFNldHVwIGlsCisJICogKioqKioqKioqKioqKioqKioqKiovCisKKwllcnIgPSBpbDM5NDVfaW5pdF9kcnYoaWwpOworCWlmIChlcnIpIHsKKwkJSUxfRVJS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VfcmVjbGFpbShpbCwgdHhxX2lkLCBpZHgpOworCisJaWYgKHN0YXR1cyAmIFRYX0FCT1JUX1JFUVVJUkVEX01TSykKKwkJSUxfRVJSKCJUT0RPOiAgSW1wbGVtZW50IFR4IEFCT1JUIFJFUVVJUkVEISEhXG4iKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogSW50ZWwgUFJPL1dpcmVsZXNzIDM5NDVBQkcvQkcgTmV0d29yayBDb25uZWN0aW9uCisgKgorICogIFJYIGhhbmRsZXIgaW1wbGVtZW50YXRpb25zCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmZGVmIENPTkZJR19JV0xFR0FDWV9ERUJVR0ZTCitzdGF0aWMgdm9pZAoraWwzOTQ1X2FjY3VtdWxhdGl2ZV9zdGF0cyhzdHJ1Y3QgaWxfcHJpdiAqaWwsIF9fbGUzMiAqIHN0YXRzKQoreworCWludCBpOworCV9fbGUzMiAqcHJldl9zdGF0czsKKwl1MzIgKmFjY3VtX3N0YXRzOworCXUzMiAqZGVsdGEsICptYXhfZGVsdGE7CisKKwlwcmV2X3N0YXRzID0gKF9fbGUzMiAqKSAmaWwtPl8zOTQ1LnN0YXRzOworCWFjY3VtX3N0YXRzID0gKHUzMiAqKSAmaWwtPl8zOTQ1LmFjY3VtX3N0YXRzOworCWRlbHRhID0gKHUzMiAqKSAmaWwtPl8zOTQ1LmRlbHRhX3N0YXRzOworCW1heF9kZWx0YSA9ICh1MzIgKikgJmlsLT5fMzk0NS5tYXhfZGVsdGE7CisKKwlmb3IgKGkgPSBzaXplb2YoX19sZTMyKTsgaSA8IHNpemVvZihzdHJ1Y3QgaWwzOTQ1X25vdGlmX3N0YXRzKTsKKwkgICAgIGkgKz0KKwkgICAgIHNpemVvZihfX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RzICovCisJdmFsID0gaWxfcmRfcHJwaChpbCwgQlNNX1dSX0RXQ09VTlRfUkVHKTsKKwlmb3IgKHJlZyA9IEJTTV9TUkFNX0xPV0VSX0JPVU5EOyByZWcgPCBCU01fU1JBTV9MT1dFUl9CT1VORCArIGxlbjsKKwkgICAgIHJlZyArPSBzaXplb2YodTMyKSwgaW1hZ2UrKykgeworCQl2YWwgPSBpbF9yZF9wcnBoKGlsLCByZWcpOworCQlpZiAodmFsICE9IGxlMzJfdG9fY3B1KCppbWFnZSkpIHsKKwkJCUlMX0VSUigiQlNNIHVDb2RlIHZlcmlmaWNhdGlvbiBmYWlsZWQgYXQgIgorCQkJICAgICAgICJhZGRyIDB4JTA4WCsldSAob2YgJXUpLCBpcyAweCV4LCBzL2IgMHgleFxuIiwKKwkJCSAgICAgICBCU01fU1JBTV9MT1dFUl9CT1VORCwgcmVnIC0gQlNNX1NSQU1fTE9XRVJfQk9VTkQsCisJCQkgICAgICAgbGVuLCB2YWwsIGxlMzJfdG9fY3B1KCppbWFnZSkpOworCQkJcmV0dXJuIC1FSU87CisJCX0KKwl9CisKKwlEX0lORk8oIkJTTSBib290c3RyYXAgdUNvZGUgaW1hZ2UgT0tcbiIpOworCisJcmV0dXJuIDA7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBFRVBST00gcmVsYXRlZCBmdW5jdGlvbnMKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKgorICogQ2xlYXIgdGhlIE9XTkVSX01TSywgdG8gZXN0YWJsaXNoIGRyaXZlciAoaW5zdGVhZCBvZiB1Q29kZSBydW5uaW5nIG9uCisgKiBlbWJlZGRlZCBjb250cm9sbGVyKSBhcyBFRVBST00gcmVhZGVyOyBlYWNoIHJlYWQgaX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JYX0VORCh4KSAoKHN0cnVjdCBpbDM5NDVfcnhfZnJhbWVfZW5kICopKFwKKwkJICAgICAgIElMX1JYX0hEUih4KS0+cGF5bG9hZCArIFwKKwkJICAgICAgIGxlMTZfdG9fY3B1KElMX1JYX0hEUih4KS0+bGVuKSkpCisjZGVmaW5lIElMX1JYX1NUQVRTKHgpICgmeC0+dS5yeF9mcmFtZS5zdGF0cykKKyNkZWZpbmUgSUxfUlhfREFUQSh4KSAoSUxfUlhfSERSKHgpLT5wYXlsb2FkKQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogRnVuY3Rpb25zIGltcGxlbWVudGVkIGluIGl3bDM5NDUtYmFzZS5jIHdoaWNoIGFyZSBmb3J3YXJkIGRlY2xhcmVkIGhlcmUKKyAqIGZvciB1c2UgYnkgaXdsLSouYworICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK2V4dGVybiBpbnQgaWwzOTQ1X2NhbGNfZGJfZnJvbV9yYXRpbyhpbnQgc2lnX3JhdGlvKTsKK2V4dGVybiB2b2lkIGlsMzk0NV9yeF9yZXBsZW5pc2godm9pZCAqZGF0YSk7CitleHRlcm4gdm9pZCBpbDM5NDVfcnhfcXVldWVfcmVzZXQoc3RydWN0IGlsX3ByaXYgKmlsLCBzdHJ1Y3QgaWxfcnhfcXVldWUgKnJ4cSk7CitleHRlcm4gdW5zaWduZWQgaW50IGlsMzk0NV9maWxsX2JlYWNvbl9mcmFtZShzdHJ1Y3QgaWxfcHJpdiAqaWwsCisJCQkJCSAgICAgc3RydWN0IGllZWU4MDIxMV9oZHIgKmhkciwKKwkJCQkJICAgICBpbnQgbGVmdCk7CitleHRlcm4gaW50IGlsMzk0NV9kdW1wX25pY19ldmVudF9sb2coc3RydWN0IGlsX3ByaXYgK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OCByZXNlcnZlZDE2WzE3Ml07CS8qIGZpbGwgb3V0IHRvIGZ1bGwgMTAyNCBieXRlIGJsb2NrICovCit9IF9fcGFja2VkOworCisjZGVmaW5lIElMMzk0NV9FRVBST01fSU1HX1NJWkUgMTAyNAorCisvKiBFbmQgb2YgRUVQUk9NICovCisKKyNkZWZpbmUgUENJX0NGR19SRVZfSURfQklUX0JBU0lDX1NLVSAgICAgICAgICAgICAgICAoMHg0MCkJLyogYml0IDYgICAgKi8KKyNkZWZpbmUgUENJX0NGR19SRVZfSURfQklUX1JUUCAgICAgICAgICAgICAgICAgICAgICAoMHg4MCkJLyogYml0IDcgICAgKi8KKworLyogNCBEQVRBICsgMSBDTUQuIFRoZXJlIGFyZSAyIEhDQ0EgcXVldWVzIHRoYXQgYXJlIG5vdCB1c2VkLiAqLworI2RlZmluZSBJTDM5X05VTV9RVUVVRVMgICAgICAgIDUKKyNkZWZpbmUgSUwzOV9DTURfUVVFVUVfTlVNCTQKKworI2RlZmluZSBJTF9ERUZBVUxUX1RYX1JFVFJZICAxNQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjZGVmaW5lIFJGRF9TSVpFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNAorI2RlZmluZSBOVU1fVEZEX0NIVU5LUyAgICAgICAgICAgICAgICAgICAgICAgIDQKKworI2RlZmluZSBURkRfQ1RMX0NPVU5UX1NFVChuKSAgICAgICAobiA8PCAyNCkKKyNkZWZpbmUgVEZEX0NUTF9DT1VOVF9HRVQoY3RsKSAgICAgKChjdGwgPj4gMjQpICYgNykKKyNkZWZpbmUgVEZEX0NUTF9QQURfU0VUKG4pICAgICAgICAgKG4gPDwgMjgpCisjZGVmaW5lIFRGRF9DVExfUEFEX0dFVChjdGwpICAgICAgIChjdGwgPj4gMjgpCisKKy8qIFNpemVzIGFuZCBhZGRyZXNzZXMgZm9yIGluc3RydWN0aW9uIGFuZCBkYXRhIG1lbW9yeSAoU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hFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjaW5jbHVkZSA8bGludXgvc2xhYi5oPgorI2luY2x1ZGUgPG5ldC9tYWM4MDIxMS5oPgorCisjaW5jbHVkZSAiY29tbW9uLmgiCisjaW5jbHVkZSAiNDk2NS5oIgorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIElOSVQgY2FsaWJyYXRpb25zIGZyYW1ld29yaworICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdHJ1Y3Qgc3RhdHNfZ2VuZXJhbF9kYXRhIHsKKwl1MzIgYmVhY29uX3NpbGVuY2VfcnNzaV9hOworCXUzMiBiZWFjb25fc2lsZW5jZV9yc3NpX2I7CisJdTMyIGJlYWNvbl9zaWxlbmNlX3Jzc2lfYzsKKwl1MzIgYmVhY29uX2VuZXJneV9hOworCXUzMiBiZWFjb25fZW5lcmd5X2I7CisJdTMyIGJlYWNvbl9lbmVyZ3lfYzsKK307CisKK3ZvaWQKK2lsNDk2NV9jYWxpYl9mcmVlX3Jlc3VsdHMoc3RydWN0IGlsX3ByaXYgKmlsKQoreworCWludCBpOworCisJZm9yIChpID0gMDsgaSA8IElMX0NBTElCX01BWDsgaSsrKSB7CisJCWtmcmVlKGlsLT5jYWxpYl9yZXN1bHRzW2ldLmJ1Zik7CisJCWlsLT5jYWxpYl9yZXN1bHRzW2ldLmJ1ZiA9IE5VTEw7CisJCWlsLT5jYWxpYl9yZXN1bHRzW2ldLmJ1Zl9sZW4gPSAwOworCX0KK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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UgPGxpbnV4L3NsYWIuaD4KKyNpbmNsdWRlIDxsaW51eC9kbWEtbWFwcGluZy5oPgorI2luY2x1ZGUgPGxpbnV4L2RlbGF5Lmg+CisjaW5jbHVkZSA8bGludXgvc2NoZWQuaD4KKyNpbmNsdWRlIDxsaW51eC9za2J1ZmYuaD4KKyNpbmNsdWRlIDxsaW51eC9uZXRkZXZpY2UuaD4KKyNpbmNsdWRlIDxsaW51eC9maXJtd2FyZS5oPgorI2luY2x1ZGUgPGxpbnV4L2V0aGVyZGV2aWNlLmg+CisjaW5jbHVkZSA8bGludXgvaWZfYXJwLmg+CisKKyNpbmNsdWRlIDxuZXQvbWFjODAyMTEuaD4KKworI2luY2x1ZGUgPGFzbS9kaXY2NC5oPgorCisjZGVmaW5lIERSVl9OQU1FICAgICAgICAiaXdsNDk2NSIKKworI2luY2x1ZGUgImNvbW1vbi5oIgorI2luY2x1ZGUgIjQ5NjUuaCIKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIG1vZHVsZSBib2lsZXIgcGxhdGUKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKgorICogbW9kdWxlIG5hbWUsIGNvcHlyaWdodCwgdmVyc2lvbiwgZXRjLgorICovCisjZGVmaW5lIERSVl9ERVNDUklQVElPTgkiSW50ZWwoUikgV2lyZWxlc3MgV2lGaSA0OTY1IGRyaXZlciBmb3IgTGludXgiCisKKyNpZmRlZiBDT05GSUdfSVdMRUdBQ1lfREVCVUcKKyNkZWZpbmUgVkQgImQiCisjZWxzZQorI2RlZmluZSBWRAorI2VuZGlmCisKKyNkZWZpbmUgRFJWX1ZFUlNJT04gICAgIElXTFdJRklfVkVSU0lPTiBWRAorCitNT0RVTEVfREVTQ1JJUFRJT04oRFJWX0RFU0NSS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Gx4XG4iLCAodW5zaWduZWQgbG9uZyBsb25nKWFkZHIpOworCisJaWw0OTY1X3RmZF9zZXRfdGIodGZkLCBudW1fdGJzLCBhZGRyLCBsZW4pOworCisJcmV0dXJuIDA7Cit9CisKKy8qCisgKiBUZWxsIG5pYyB3aGVyZSB0byBmaW5kIGNpcmN1bGFyIGJ1ZmZlciBvZiBUeCBGcmFtZSBEZXNjcmlwdG9ycyBmb3IKKyAqIGdpdmVuIFR4IHF1ZXVlLCBhbmQgZW5hYmxlIHRoZSBETUEgY2hhbm5lbCB1c2VkIGZvciB0aGF0IHF1ZXVlLgorICoKKyAqIDQ5NjUgc3VwcG9ydHMgdXAgdG8gMTYgVHggcXVldWVzIGluIERSQU0sIG1hcHBlZCB0byB1cCB0byA4IFR4IERNQQorICogY2hhbm5lbHMgc3VwcG9ydGVkIGluIGhhcmR3YXJlLgorICovCitpbnQKK2lsNDk2NV9od190eF9xdWV1ZV9pbml0KHN0cnVjdCBpbF9wcml2ICppbCwgc3RydWN0IGlsX3R4X3F1ZXVlICp0eHEpCit7CisJaW50IHR4cV9pZCA9IHR4cS0+cS5pZDsKKworCS8qIENpcmN1bGFyIGJ1ZmZlciAoVEZEIHF1ZXVlIGluIERSQU0pIHBoeXNpY2FsIGJhc2UgYWRkcmVzcyAqLworCWlsX3dyKGlsLCBGSDQ5X01FTV9DQkJDX1FVRVVFKHR4cV9pZCksIHR4cS0+cS5kbWFfYWRkciA+PiA4KTsKKworCXJldHVybiAwOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogR2VuZXJpYyBSWCBoYW5kbGVyIGltcGxlbWVudGF0aW9ucworICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgdm9pZAoraWw0OTY1X2hkbF9hbGl2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5hYmxlIFJGX0tJTEwgaWYgaXQgb2NjdXJyZWQgKi8KKwllbHNlIGlmIChoYW5kbGVkICYgQ1NSX0lOVF9CSVRfUkZfS0lMTCkKKwkJaWxfZW5hYmxlX3Jma2lsbF9pbnQoaWwpOworCisjaWZkZWYgQ09ORklHX0lXTEVHQUNZX0RFQlVHCisJaWYgKGlsX2dldF9kZWJ1Z19sZXZlbChpbCkgJiAoSUxfRExfSVNSKSkgeworCQlpbnRhID0gX2lsX3JkKGlsLCBDU1JfSU5UKTsKKwkJaW50YV9tYXNrID0gX2lsX3JkKGlsLCBDU1JfSU5UX01BU0spOworCQlpbnRhX2ZoID0gX2lsX3JkKGlsLCBDU1JfRkhfSU5UX1NUQVRVUyk7CisJCURfSVNSKCJFbmQgaW50YSAweCUwOHgsIGVuYWJsZWQgMHglMDh4LCBmaCAweCUwOHgsICIKKwkJICAgICAgImZsYWdzIDB4JTA4bHhcbiIsIGludGEsIGludGFfbWFzaywgaW50YV9maCwgZmxhZ3MpOworCX0KKyNlbmRpZgorfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBzeXNmcyBhdHRyaWJ1dGVzCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjaWZkZWYgQ09ORklHX0lXTEVHQUNZX0RFQlVHCisKKy8qCisgKiBUaGUgZm9sbG93aW5nIGFkZHMgYSBuZXcgYXR0cmlidXRlIHRvIHRoZSBzeXNmcyByZXByZXNlbnRhdGlvbgorICogb2YgdGhpcyBkZXZpY2UgZHJpdmVyIChpLmUuIGEgbmV3IGZpbGUgaW4gL3N5cy9jbGFzcy9uZXQvd2xhbjAvZGV2aWNlLykKKyAqIHVzZWQgZm9yIGNvbnRyb2xsaW5nIHRoZSBkZWJ1ZyBsZXZlbC4KKyAq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RfdGFyZ19tZW0oaWwsIGJhc2UgKyAxICogc2l6ZW9mKHUzMikpOworCWlsLT5pc3Jfc3RhdHMuZXJyX2NvZGUgPSBkZXNjOworCXBjID0gaWxfcmVhZF90YXJnX21lbShpbCwgYmFzZSArIDIgKiBzaXplb2YodTMyKSk7CisJYmxpbmsxID0gaWxfcmVhZF90YXJnX21lbShpbCwgYmFzZSArIDMgKiBzaXplb2YodTMyKSk7CisJYmxpbmsyID0gaWxfcmVhZF90YXJnX21lbShpbCwgYmFzZSArIDQgKiBzaXplb2YodTMyKSk7CisJaWxpbmsxID0gaWxfcmVhZF90YXJnX21lbShpbCwgYmFzZSArIDUgKiBzaXplb2YodTMyKSk7CisJaWxpbmsyID0gaWxfcmVhZF90YXJnX21lbShpbCwgYmFzZSArIDYgKiBzaXplb2YodTMyKSk7CisJZGF0YTEgPSBpbF9yZWFkX3RhcmdfbWVtKGlsLCBiYXNlICsgNyAqIHNpemVvZih1MzIpKTsKKwlkYXRhMiA9IGlsX3JlYWRfdGFyZ19tZW0oaWwsIGJhc2UgKyA4ICogc2l6ZW9mKHUzMikpOworCWxpbmUgPSBpbF9yZWFkX3RhcmdfbWVtKGlsLCBiYXNlICsgOSAqIHNpemVvZih1MzIpKTsKKwl0aW1lID0gaWxfcmVhZF90YXJnX21lbShpbCwgYmFzZSArIDExICogc2l6ZW9mKHUzMikpOworCWhjbWQgPSBpbF9yZWFkX3RhcmdfbWVtKGlsLCBiYXNlICsgMjIgKiBzaXplb2YodTMyKSk7CisKKwlJTF9FUlIoIkRlc2MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGltZSAgICAgICAiCisJICAgICAgICJkYXRhMSAgICAgIGRhdGEyICAgICAgbGluZVxuIik7CisJSUxfRVJSKCIlLTI4cyAoMHglMDRYKSAlMDEwdSAweCUwOFggMHglMDhYICV1XG4iLAorCSAgICAgICBpbDQ5NjVfZGVzY19sb29rdXAoZGVzYyksIGRlc2MsIHRpbWUsIGRhdGExLCBkY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KiBkZWZhdWx0IGZsYWdzIHNldHVwIGluIGlsX2Nvbm5lY3Rpb25faW5pdF9yeF9jb25maWcoKQorCSAqIHNpbmNlIHdlIGN1cnJlbnRseSBkbyBub3Qgc3VwcG9ydCBwcm9ncmFtbWluZyBtdWx0aWNhc3QKKwkgKiBmaWx0ZXJzIGludG8gdGhlIGRldmljZS4KKwkgKi8KKwkqdG90YWxfZmxhZ3MgJj0KKwkgICAgRklGX09USEVSX0JTUyB8IEZJRl9BTExNVUxUSSB8IEZJRl9QUk9NSVNDX0lOX0JTUyB8CisJICAgIEZJRl9CQ05fUFJCUkVTUF9QUk9NSVNDIHwgRklGX0NPTlRST0w7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIGRyaXZlciBzZXR1cCBhbmQgdGVhcmRvd24KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3N0YXRpYyB2b2lkCitpbDQ5NjVfYmdfdHhwb3dlcl93b3JrKHN0cnVjdCB3b3JrX3N0cnVjdCAqd29yaykKK3sKKwlzdHJ1Y3QgaWxfcHJpdiAqaWwgPSBjb250YWluZXJfb2Yod29yaywgc3RydWN0IGlsX3ByaXYsCisJCQkJCSAgdHhwb3dlcl93b3JrKTsKKworCW11dGV4X2xvY2soJmlsLT5tdXRleCk7CisKKwkvKiBJZiBhIHNjYW4gaGFwcGVuZWQgdG8gc3RhcnQgYmVmb3JlIHdlIGdvdCBoZXJlCisJICogdGhlbiBqdXN0IHJldHVybjsgdGhlIHN0YXRzIG5vdGlmaWNhdGlvbiB3aWxsCisJICoga2ljayBvZmYgYW5vdGhlciBzY2hlZHVsZWQgd29yayB0byBjb21wZW5zYXRlIGZvcgorCSAqIGFueSB0ZW1wZXJhdHVyZSBkZWx0YSB3ZSBtaX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X2RtYV9tYXNrKHBkZXYsIERNQV9CSVRfTUFTSygzNikpOworCWlmICghZXJyKQorCQllcnIgPSBwY2lfc2V0X2NvbnNpc3RlbnRfZG1hX21hc2socGRldiwgRE1BX0JJVF9NQVNLKDM2KSk7CisJaWYgKGVycikgeworCQllcnIgPSBwY2lfc2V0X2RtYV9tYXNrKHBkZXYsIERNQV9CSVRfTUFTSygzMikpOworCQlpZiAoIWVycikKKwkJCWVyciA9CisJCQkgICAgcGNpX3NldF9jb25zaXN0ZW50X2RtYV9tYXNrKHBkZXYsIERNQV9CSVRfTUFTSygzMikpOworCQkvKiBib3RoIGF0dGVtcHRzIGZhaWxlZDogKi8KKwkJaWYgKGVycikgeworCQkJSUxfV0FSTigiTm8gc3VpdGFibGUgRE1BIGF2YWlsYWJsZS5cbiIpOworCQkJZ290byBvdXRfcGNpX2Rpc2FibGVfZGV2aWNlOworCQl9CisJfQorCisJZXJyID0gcGNpX3JlcXVlc3RfcmVnaW9ucyhwZGV2LCBEUlZfTkFNRSk7CisJaWYgKGVycikKKwkJZ290byBvdXRfcGNpX2Rpc2FibGVfZGV2aWNlOworCisJcGNpX3NldF9kcnZkYXRhKHBkZXYsIGlsKTsKKworCS8qKioqKioqKioqKioqKioqKioqKioqKgorCSAqIDMuIFJlYWQgUkVWIHJlZ2lzdGVyCisJICoqKioqKioqKioqKioqKioqKioqKioqLworCWlsLT5od19iYXNlID0gcGNpX2lvbWFwKHBkZXYsIDAsIDApOworCWlmICghaWwtPmh3X2Jhc2UpIHsKKwkJZXJyID0gLUVOT0RFVjsKKwkJZ290byBvdXRfcGNpX3JlbGVhc2VfcmVnaW9uczsKKwl9CisKKwlEX0lORk8oInBjaV9yZXNvdXJjZV9sZW4gPSAweCUwOGxseFxuIiwKKwkgICAgICAgKHVuc2lnbmVkIGxvbmcgbG9uZylwY2lfcmVzb3VyY2VfbGVuKHBkZXYsIDApKTsKKwlEX0lORk8oInBjaV9yZXNvdXJjZV9iYXNlID0gJXBcbiIsIG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Kwl9CisKKwkvKioqKioqKioqKioqKioqKioKKwkgKiA0LiBSZWFkIEVFUFJPTQorCSAqKioqKioqKioqKioqKioqKi8KKwkvKiBSZWFkIHRoZSBFRVBST00gKi8KKwllcnIgPSBpbF9lZXByb21faW5pdChpbCk7CisJaWYgKGVycikgeworCQlJTF9FUlIoIlVuYWJsZSB0byBpbml0IEVFUFJPTVxuIik7CisJCWdvdG8gb3V0X2lvdW5tYXA7CisJfQorCWVyciA9IGlsNDk2NV9lZXByb21fY2hlY2tfdmVyc2lvbihpbCk7CisJaWYgKGVycikKKwkJZ290byBvdXRfZnJlZV9lZXByb207CisKKwlpZiAoZXJyKQorCQlnb3RvIG91dF9mcmVlX2VlcHJvbTsKKworCS8qIGV4dHJhY3QgTUFDIEFkZHJlc3MgKi8KKwlpbDQ5NjVfZWVwcm9tX2dldF9tYWMoaWwsIGlsLT5hZGRyZXNzZXNbMF0uYWRkcik7CisJRF9JTkZPKCJNQUMgYWRkcmVzczogJXBNXG4iLCBpbC0+YWRkcmVzc2VzWzBdLmFkZHIpOworCWlsLT5ody0+d2lwaHktPmFkZHJlc3NlcyA9IGlsLT5hZGRyZXNzZXM7CisJaWwtPmh3LT53aXBoeS0+bl9hZGRyZXNzZXMgPSAxOworCisJLyoqKioqKioqKioqKioqKioqKioqKioqKgorCSAqIDUuIFNldHVwIEhXIGNvbnN0YW50cworCSAqKioqKioqKioqKioqKioqKioqKioqKiovCisJaWYgKGlsNDk2NV9zZXRfaHdfcGFyYW1zKGlsKSkgeworCQlJTF9FUlIoImZhaWxlZCB0byBzZXQgaHcgcGFyYW1ldGVyc1xuIik7CisJCWdvdG8gb3V0X2ZyZWVfZWVwcm9tOworCX0KKworCS8qKioqKioqKioqKioqKioqKioqCisJICogNi4gU2V0dXAgaWwKKwkgKioqKioqKioqKioqKioqKioqKi8KKworCWVyciA9IGlsNDk2NV9pbml0X2RydihpbCk7CisJaWYgKGVycikKKwkJZ290byBvdXRfZnJlZV9lZXByb207CisJLyogQX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EwICAgICAgICAgMHgzZiAgICAgIChoaWdoZXN0IGdhaW4pCisgKiAgIDEgICAgICAgIDEwNCAgICAgICAgIDB4M2YKKyAqICAgMiAgICAgICAgIDk4ICAgICAgICAgMHgzZgorICogICAzICAgICAgICAxMTAgICAgICAgICAweDNlCisgKiAgIDQgICAgICAgIDEwNCAgICAgICAgIDB4M2UKKyAqICAgNSAgICAgICAgIDk4ICAgICAgICAgMHgzZQorICogICA2ICAgICAgICAxMTAgICAgICAgICAweDNkCisgKiAgIDcgICAgICAgIDEwNCAgICAgICAgIDB4M2QKKyAqICAgOCAgICAgICAgIDk4ICAgICAgICAgMHgzZAorICogICA5ICAgICAgICAxMTAgICAgICAgICAweDNjCisgKiAgMTAgICAgICAgIDEwNCAgICAgICAgIDB4M2MKKyAqICAxMSAgICAgICAgIDk4ICAgICAgICAgMHgzYworICogIDEyICAgICAgICAxMTAgICAgICAgICAweDNiCisgKiAgMTMgICAgICAgIDEwNCAgICAgICAgIDB4M2IKKyAqICAxNCAgICAgICAgIDk4ICAgICAgICAgMHgzYgorICogIDE1ICAgICAgICAxMTAgICAgICAgICAweDNhCisgKiAgMTYgICAgICAgIDEwNCAgICAgICAgIDB4M2EKKyAqICAxNyAgICAgICAgIDk4ICAgICAgICAgMHgzYQorICogIDE4ICAgICAgICAxMTAgICAgICAgICAweDM5CisgKiAgMTkgICAgICAgIDEwNCAgICAgICAgIDB4MzkKKyAqICAyMCAgICAgICAgIDk4ICAgICAgICAgMHgzOQorICogIDIxICAgICAgICAxMTAgICAgICAgICAweDM4CisgKiAgMjIgICAgICAgIDEwNCAgICAgICAgIDB4MzgKKyAqICAyMyAgICAgICAgIDk4ICAgICAgICAgMHgzOAorICogIDI0ICAgICAgICAxMTAgICAgICAgICAweDM3CisgKiAgMjUgICAgICAgIDEwNCAgICAgICAgIDB4MzcKKyAqICAyNiAgICAgICAgIDk4ICAgICAgICAgMHgzNworICogIDI3ICAgICAgICAxMTAgICAgICAgICAweDM2CisgKiAgMjggICAgICAgIDEwNCAgICAgICAgIDB4MzYKKyAqICAyOSAgICAgICAgIDk4ICAgICAgICAgMHgzNgorICogIDMwICAgICAgICAxMTAgICAgICAgICAweDM1CisgKiAgMzEgICAgICAgIDEwNCAgICAgICAgIDB4MzUKKyAqICAzMiAgICAgICAgIDk4ICAgICAgICAgMHgzNQorICogIDMzICAgICAgICAxMTAgICAgICAgICAweDM0CisgKiAgMzQgICAgICAgIDEwNCAgICAgICAgIDB4MzQKKyAqICAzNSAgICAgICAgIDk4ICAgICAgICAgMHgzNAorICogIDM2ICAgICAgICAxMTAgICAgICAgICAweDMzCisgKiAgMzcgICAgICAgIDEwNCAgICAgICAgIDB4MzMKKyAqICAzOCAgICAgICAgIDk4ICAgICAgICAgMHgzMworICogIDM5ICAgICAgICAxMTAgICAgICAgICAweDMyCisgKiAgNDAgICAgICAgIDEwNCAgICAgICAgIDB4MzIKKyAqICA0MSAgICAgICAgIDk4ICAgICAgICAgMHgzMgorICogIDQyICAgICAgICAxMTAgICAgICAgICAweDMxCisgKiAgNDMgICAgICAgIDEwNCAgICAgICAgIDB4MzEKKyAqICA0NCAgICAgICAgIDk4ICAgICAgICAgMHgzMQorICogIDQ1ICAgICAgICAxMTAgICAgICAgICAweDMwCisgKiAgNDYgICAgICAgIDEwNCAgICAgICAgIDB4MzAKKyAqICA0NyAgICAgICAgIDk4ICAgICAgICAgMHgzMAorICogIDQ4ICAgICAgICAxMTAgICAgICAgICAgMHg2CisgKiAgNDkgICAgICAgIDEwNCAgICAgICAgICAweDYKKyAqICA1MCAgICAgICAgIDk4ICAgICAgICAgIDB4NgorICogIDUxICAgICAgICAxMTAgICAgICAgICAgMHg1CisgKiAgNTIgICAgICAgIDEwNCAgICAgICAgICAweDUKKyAqICA1MyAgICAgICAgIDk4ICAgICAgICAgIDB4NQorICogIDU0ICAgICAgICAxMTAgICAgICAgICAgMHg0CisgKiAgNTUgICAgICAgIDEwNCAgICAgICAgICAweDQKKyAqICA1NiAgICAgICAgIDk4ICAgICAgICAgIDB4NAorICogIDU3ICAgICAgICAxMTAgICAgICAgICAgMHgzCisgKiAgNTggICAgICAgIDEwNCAgICAgICAgICAweDMKKyAqICA1OSAgICAgICAgIDk4ICAgICAgICAgIDB4MworICogIDYwICAgICAgICAxMTAgICAgICAgICAgMHgyCisgKiAgNjEgICAgICAgIDEwNCAgICAgICAgICAweDIKKyAqICA2MiAgICAgICAgIDk4ICAgICAgICAgIDB4MgorICogIDYzICAgICAgICAxMTAgICAgICAgICAgMHgxCisgKiAgNjQgICAgICAgIDEwNCAgICAgICAgICAweDEKKyAqICA2NSAgICAgICAgIDk4ICAgICAgICAgIDB4MQorICogIDY2ICAgICAgICAxMTAgICAgICAgICAgMHgwCisgKiAgNjcgICAgICAgIDEwNCAgICAgICAgICAweDAKKyAqICA2OCAgICAgICAgIDk4ICAgICAgICAgIDB4MAorICogIDY5ICAgICAgICAgOTcgICAgICAgICAgICAwCisgKiAgNzAgICAgICAgICA5NiAgICAgICAgICAgIDAKKyAqICA3MSAgICAgICAgIDk1ICAgICAgICAgICAgMAorICogIDcyICAgICAgICAgOTQgICAgICAgICAgICAwCisgKiAgNzMgICAgICAgICA5MyAgICAgICAgICAgIDAKKyAqICA3NCAgICAgICAgIDkyICAgICAgICAgICAgMAorICogIDc1ICAgICAgICAgOTEgICAgICAgICAgICAwCisgKiAgNzYgICAgICAgICA5MCAgICAgICAgICAgIDAKKyAqICA3NyAgICAgICAgIDg5ICAgICAgICAgICAgMAorICogIDc4ICAgICAgICAgODggICAgICAgICAgICAwCisgKiAgNzkgICAgICAgICA4NyAgICAgICAgICAgIDAKKyAqICA4MCAgICAgICAgIDg2ICAgICAgICAgICAgMAorICogIDgxICAgICAgICAgODUgICAgICAgICAgICAwCisgKiAgODIgICAgICAgICA4NCAgICAgICAgICAgIDAKKyAqICA4MyAgICAgICAgIDgzICAgICAgICAgICAgMAorICogIDg0ICAgICAgICAgODIgICAgICAgICAgICAwCisgKiAgODUgICAgICAgICA4MSAgICAgICAgICAgIDAKKyAqICA4NiAgICAgICAgIDgwICAgICAgICAgICAgMAorICogIDg3ICAgICAgICAgNzkgICAgICAgICAgICAwCisgKiAgODggICAgICAgICA3OCAgICAgICAgICAgIDAKKyAqICA4OSAgICAgICAgIDc3ICAgICAgICAgICAgMAorICogIDkwICAgICAgICAgNzYgICAgICAgICAgICAwCisgKiAgOTEgICAgICAgICA3NSAgICAgICAgICAgIDAKKyAqICA5MiAgICAgICAgIDc0ICAgICAgICAgICAgMAorICogIDkzICAgICAgICAgNzMgICAgICAgICAgICAwCisgKiAgOTQgICAgICAgICA3MiAgICAgICAgICAgIDAKKyAqICA5NSAgICAgICAgIDcxICAgICAgICAgICAgMAorICogIDk2ICAgICAgICAgNzAgICAgICAgICAgICAwCisgKiAgOTcgICAgICAgICA2OSAgICAgICAgICAgIDAKKyAqICA5OCAgICAgICAgIDY4ICAgICAgICAgICAgMAorICovCisKKy8qKgorICogNSBHSHogZ2FpbiB0YWJsZQorICoKKyAqIEluZGV4ICAgIERzcCBnYWluICAgUmFkaW8gZ2FpbgorICogIC05IAkgICAgICAxMjMgICAgICAgICAweDNGICAgICAgKGhpZ2hlc3QgZ2FpbikKKyAqICAtOCAJICAgICAgMTE3ICAgICAgICAgMHgzRgorICogIC03ICAgICAgICAxMTAgICAgICAgICAweDNGCisgKiAgLTYgICAgICAgIDEwNCAgICAgICAgIDB4M0YKKyAqICAtNSAgICAgICAgIDk4ICAgICAgICAgMHgzRgorICogIC00ICAgICAgICAxMTAgICAgICAgICAweDNFCisgKiAgLTMgICAgICAgIDEwNCAgICAgICAgIDB4M0UKKyAqICAtMiAgICAgICAgIDk4ICAgICAgICAgMHgzRQorICogIC0xICAgICAgICAxMTAgICAgICAgICAweDNECisgKiAgIDAgICAgICAgIDEwNCAgICAgICAgIDB4M0QKKyAqICAgMSAgICAgICAgIDk4ICAgICAgICAgMHgzRAorICogICAyICAgICAgICAxMTAgICAgICAgICAweDNDCisgKiAgIDMgICAgICAgIDEwNCAgICAgICAgIDB4M0MKKyAqICAgNCAgICAgICAgIDk4ICAgICAgICAgMHgzQworICogICA1ICAgICAgICAxMTAgICAgICAgICAweDNCCisgKiAgIDYgICAgICAgIDEwNCAgICAgICAgIDB4M0IKKyAqICAgNyAgICAgICAgIDk4ICAgICAgICAgMHgzQgorICogICA4ICAgICAgICAxMTAgICAgICAgICAweDNBCisgKiAgIDkgICAgICAgIDEwNCAgICAgICAgIDB4M0EKKyAqICAxMCAgICAgICAgIDk4ICAgICAgICAgMHgzQQorICogIDExICAgICAgICAxMTAgICAgICAgICAweDM5CisgKiAgMTIgICAgICAgIDEwNCAgICAgICAgIDB4MzkKKyAqICAxMyAgICAgICAgIDk4ICAgICAgICAgMHgzOQorICogIDE0ICAgICAgICAxMTAgICAgICAgICAweDM4CisgKiAgMTUgICAgICAgIDEwNCAgICAgICAgIDB4MzgKKyAqICAxNiAgICAgICAgIDk4ICAgICAgICAgMHgzOAorICogIDE3ICAgICAgICAxMTAgICAgICAgICAweDM3CisgKiAgMTggICAgICAgIDEwNCAgICAgICAgIDB4MzcKKyAqICAxOSAgICAgICAgIDk4ICAgICAgICAgMHgzNworICogIDIwICAgICAgICAxMTAgICAgICAgICAweDM2CisgKiAgMjEgICAgICAgIDEwNCAgICAgICAgIDB4MzYKKyAqICAyMiAgICAgICAgIDk4ICAgICAgICAgMHgzNgorICogIDIzICAgICAgICAxMTAgICAgICAgICAweDM1CisgKiAgMjQgICAgICAgIDEwNCAgICAgICAgIDB4MzUKKyAqICAyNSAgICAgICAgIDk4ICAgICAgICAgMHgzNQorICogIDI2ICAgICAgICAxMTAgICAgICAgICAweDM0CisgKiAgMjcgICAgICAgIDEwNCAgICAgICAgIDB4MzQKKyAqICAyOCAgICAgICAgIDk4ICAgICAgICAgMHgzNAorICogIDI5ICAgICAgICAxMTAgICAgICAgICAweDMzCisgKiAgMzAgICAgICAgIDEwNCAgICAgICAgIDB4MzMKKyAqICAzMSAgICAgICAgIDk4ICAgICAgICAgMHgzMworICogIDMyICAgICAgICAxMTAgICAgICAgICAweDMyCisgKiAgMzMgICAgICAgIDEwNCAgICAgICAgIDB4MzIKKyAqICAzNCAgICAgICAgIDk4ICAgICAgICAgMHgzMgorICogIDM1ICAgICAgICAxMTAgICAgICAgICAweDMxCisgKiAgMzYgICAgICAgIDEwNCAgICAgICAgIDB4MzEKKyAqICAzNyAgICAgICAgIDk4ICAgICAgICAgMHgzMQorICogIDM4ICAgICAgICAxMTAgICAgICAgICAweDMwCisgKiAgMzkgICAgICAgIDEwNCAgICAgICAgIDB4MzAKKyAqICA0MCAgICAgICAgIDk4ICAgICAgICAgMHgzMAorICogIDQxICAgICAgICAxMTAgICAgICAgICAweDI1CisgKiAgNDIgICAgICAgIDEwNCAgICAgICAgIDB4MjUKKyAqICA0MyAgICAgICAgIDk4ICAgICAgICAgMHgyNQorICogIDQ0ICAgICAgICAxMTAgICAgICAgICAweDI0CisgKiAgNDUgICAgICAgIDEwNCAgICAgICAgIDB4MjQKKyAqICA0NiAgICAgICAgIDk4ICAgICAgICAgMHgyNAorICogIDQ3ICAgICAgICAxMTAgICAgICAgICAweDIzCisgKiAgNDggICAgICAgIDEwNCAgICAgICAgIDB4MjMKKyAqICA0OSAgICAgICAgIDk4ICAgICAgICAgMHgyMworICogIDUwICAgICAgICAxMTAgICAgICAgICAweDIyCisgKiAgNTEgICAgICAgIDEwNCAgICAgICAgIDB4MTgKKyAqICA1MiAgICAgICAgIDk4ICAgICAgICAgMHgxOAorICogIDUzICAgICAgICAxMTAgICAgICAgICAweDE3CisgKiAgNTQgICAgICAgIDEwNCAgICAgICAgIDB4MTcKKyAqICA1NSAgICAgICAgIDk4ICAgICAgICAgMHgxNworICogIDU2ICAgICAgICAxMTAgICAgICAgICAweDE2CisgKiAgNTcgICAgICAgIDEwNCAgICAgICAgIDB4MTYKKyAqICA1OCAgICAgICAgIDk4ICAgICAgICAgMHgxNgorICogIDU5ICAgICAgICAxMTAgICAgICAgICAweDE1CisgKiAgNjAgICAgICAgIDEwNCAgICAgICAgIDB4MTUKKyAqICA2MSAgICAgICAgIDk4ICAgICAgICAgMHgxNQorICogIDYyICAgICAgICAxMTAgICAgICAgICAweDE0CisgKiAgNjMgICAgICAgIDEwNCAgICAgICAgIDB4MTQKKyAqICA2NCAgICAgICAgIDk4ICAgICAgICAgMHgxNAorICogIDY1ICAgICAgICAxMTAgICAgICAgICAweDEzCisgKiAgNjYgICAgICAgIDEwNCAgICAgICAgIDB4MTMKKyAqICA2NyAgICAgICAgIDk4ICAgICAgICAgMHgxMworICogIDY4ICAgICAgICAxMTAgICAgICAgICAweDEyCisgKiAgNjkgICAgICAgIDEwNCAgICAgICAgIDB4MDgKKyAqICA3MCAgICAgICAgIDk4ICAgICAgICAgMHgwOAorICogIDcxICAgICAgICAxMTAgICAgICAgICAweDA3CisgKiAgNzIgICAgICAgIDEwNCAgICAgICAgIDB4MDcKKyAqICA3MyAgICAgICAgIDk4ICAgICAgICAgMHgwNworICogIDc0ICAgICAgICAxMTAgICAgICAgICAweDA2CisgKiAgNzUgICAgICAgIDEwNCAgICAgICAgIDB4MDYKKyAqICA3NiAgICAgICAgIDk4ICAgICAgICAgMHgwNgorICogIDc3ICAgICAgICAxMTAgICAgICAgICAweDA1CisgKiAgNzggICAgICAgIDEwNCAgICAgICAgIDB4MDUKKyAqICA3OSAgICAgICAgIDk4ICAgICAgICAgMHgwNQorICogIDgwICAgICAgICAxMTAgICAgICAgICAweDA0CisgKiAgODEgICAgICAgIDEwNCAgICAgICAgIDB4MDQKKyAqICA4MiAgICAgICAgIDk4ICAgICAgICAgMHgwNAorICogIDgzICAgICAgICAxMTAgICAgICAgICAweDAzCisgKiAgODQgICAgICAgIDEwNCAgICAgICAgIDB4MDMKKyAqICA4NSAgICAgICAgIDk4ICAgICAgICAgMHgwMworICogIDg2ICAgICAgICAxMTAgICAgICAgICAweDAyCisgKiAgODcgICAgICAgIDEwNCAgICAgICAgIDB4MDIKKyAqICA4OCAgICAgICAgIDk4ICAgICAgICAgMH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ICogIDQtMzogIDApICBTaW5nbGUgc3RyZWFtIChTSVNPKQorICogICAgICAgIDEpICBEdWFsIHN0cmVhbSAoTUlNTykKKyAqICAgICAgICAyKSAgVHJpcGxlIHN0cmVhbSAoTUlNTykKKyAqCisgKiAgICA1OiAgVmFsdWUgb2YgMHgyMCBpbiBiaXRzIDc6MCBpbmRpY2F0ZXMgNiBNYnBzIEhUNDAgZHVwbGljYXRlIGRhdGEKKyAqCisgKiBMZWdhY3kgT0ZETSByYXRlIGZvcm1hdCBmb3IgYml0cyA3OjAgKGJpdCA4IG11c3QgYmUgIjAiLCBiaXQgOSAiMCIpOgorICogIDMtMDogIDB4RCkgICA2IE1icHMKKyAqICAgICAgICAweEYpICAgOSBNYnBzCisgKiAgICAgICAgMHg1KSAgMTIgTWJwcworICogICAgICAgIDB4NykgIDE4IE1icHMKKyAqICAgICAgICAweDkpICAyNCBNYnBzCisgKiAgICAgICAgMHhCKSAgMzYgTWJwcworICogICAgICAgIDB4MSkgIDQ4IE1icHMKKyAqICAgICAgICAweDMpICA1NCBNYnBzCisgKgorICogTGVnYWN5IENDSyByYXRlIGZvcm1hdCBmb3IgYml0cyA3OjAgKGJpdCA4IG11c3QgYmUgIjAiLCBiaXQgOSAiMSIpOgorICogIDYtMDogICAxMCkgIDEgTWJwcworICogICAgICAgICAyMCkgIDIgTWJwcworICogICAgICAgICA1NSkgIDUuNSBNYnBzCisgKiAgICAgICAgMTEwKSAgMTEgTWJwcworICovCisjZGVmaW5lIFJBVEVfTUNTX0NPREVfTVNLIDB4NworI2RlZmluZSBSQVRFX01DU19TUEFUSUFMX1BPUyAzCisjZGVmaW5lIFJBVEVfTUNTX1NQQVRJQUxfTVNLIDB4MTgKKyNkZWZpbmUgUkFURV9NQ1NfSFRfRFVQX1BPUyA1CisjZGVmaW5lIFJBVEVfTUNTX0hUX0RVUF9NU0sgMHgyMAorCisvKiBCaXQgODogKDEpIEhUIGZvcm1hdCwgKDApIGxlZ2FjeSBmb3JtYXQgaW4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Ki8KK3N0cnVjdCBpbDQ5NjVfdHhfcG93ZXJfZGIgeworCXN0cnVjdCB0eF9wb3dlcl9kdWFsX3N0cmVhbSBwb3dlcl90YmxbUE9XRVJfVEJMX05VTV9FTlRSSUVTXTsKK30gX19wYWNrZWQ7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICgwYSkKKyAqIEFsaXZlIGFuZCBFcnJvciBDb21tYW5kcyAmIFJlc3BvbnNlczoKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNkZWZpbmUgVUNPREVfVkFMSURfT0sJY3B1X3RvX2xlMzIoMHgxKQorI2RlZmluZSBJTklUSUFMSVpFX1NVQlRZUEUgICAgKDkpCisKKy8qCisgKiAoIkluaXRpYWxpemUiKSBOX0FMSVZFID0gMHgxIChyZXNwb25zZSBvbmx5LCBub3QgYSBjb21tYW5kKQorICoKKyAqIHVDb2RlIGlzc3VlcyB0aGlzICJpbml0aWFsaXplIGFsaXZlIiBub3RpZmljYXRpb24gb25jZSB0aGUgaW5pdGlhbGl6YXRpb24KKyAqIHVDb2RlIGltYWdlIGhhcyBjb21wbGV0ZWQgaXRzIHdvcmssIGFuZCBpcyByZWFkeSB0byBsb2FkIHRoZSBydW50aW1lIGltYWdlLgorICogVGhpcyBpcyB0aGUgKmZpcnN0KiAiYWxpdmUiIG5vdGlmaWNhdGlvbiB0aGF0IHRoZSBkcml2ZXIgd2lsbCByZWNlaXZlIGFmdGVyCisgKiByZWJvb3RpbmcgdUNvZGU7IHRoZSAiaW5pdGlhbGl6ZSIgYWxpdmUgaXMgaW5kaWNhdGVkIGJ5IHN1YnR5cGUgZmllbGQgPT0gOS4KKyAqCisgKiBTZWUgY29tbWVudHMgZG9jdW1lbnRpbmcgIkJTTSIgKGJvb3RzdHJ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KKwl1OCBzd19yZXZbOF07CisJdTggdmVyX3R5cGU7CisJdTggdmVyX3N1YnR5cGU7CQkvKiBub3QgIjkiIGZvciBydW50aW1lIGFsaXZlICovCisJX19sZTE2IHJlc2VydmVkMjsKKwlfX2xlMzIgbG9nX2V2ZW50X3RhYmxlX3B0cjsJLyogU1JBTSBhZGRyZXNzIGZvciBldmVudCBsb2cgKi8KKwlfX2xlMzIgZXJyb3JfZXZlbnRfdGFibGVfcHRyOwkvKiBTUkFNIGFkZHJlc3MgZm9yIGVycm9yIGxvZyAqLworCV9fbGUzMiB0aW1lc3RhbXA7CisJX19sZTMyIGlzX3ZhbGlkOworfSBfX3BhY2tlZDsKKworLyoKKyAqIE5fRVJST1IgPSAweDIgKHJlc3BvbnNlIG9ubHksIG5vdCBhIGNvbW1hbmQpCisgKi8KK3N0cnVjdCBpbF9lcnJvcl9yZXNwIHsKKwlfX2xlMzIgZXJyb3JfdHlwZTsKKwl1OCBjbWRfaWQ7CisJdTggcmVzZXJ2ZWQxOworCV9fbGUxNiBiYWRfY21kX3NlcV9udW07CisJX19sZTMyIGVycm9yX2luZm87CisJX19sZTY0IHRpbWVzdGFtcDsKK30gX19wYWNrZWQ7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICgxKQorICogUlhPTiBDb21tYW5kcyAmIFJlc3BvbnNlczoKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qCisgKiBSeCBjb25maWcgZGVmaW5lcyAmIHN0cnVjdHVyZQorICovCisvKiByeF9jb25maWcgZGV2aWNlIHR5cGVzICAqLworZW51bSB7CisJUlhPTl9ERVZfVFlQRV9BUCA9IDEsCisJUlhPTl9ERVZfVFlQRV9FU1MgPSAzLAorCVJYT05fREVWX1RZUEVfSUJTUyA9IDQ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KioqKioqKioqKioqKioqKioqKioqCisgKiAoMikKKyAqIFF1YWxpdHktb2YtU2VydmljZSAoUU9TKSBDb21tYW5kcyAmIFJlc3BvbnNlczoKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qKgorICogc3RydWN0IGlsX2FjX3FvcyAtLSBRT1MgdGltaW5nIHBhcmFtcyBmb3IgQ19RT1NfUEFSQU0KKyAqIE9uZSBmb3IgZWFjaCBvZiA0IEVEQ0EgYWNjZXNzIGNhdGVnb3JpZXMgaW4gc3RydWN0IGlsX3Fvc3BhcmFtX2NtZAorICoKKyAqIEBjd19taW46IENvbnRlbnRpb24gd2luLCBzdGFydCB2YWx1ZSBpbiBudW1iZXJzIG9mIHNsb3RzLgorICogICAgICAgICAgU2hvdWxkIGJlIGEgcG93ZXItb2YtMiwgbWludXMgMS4gIERldmljZSdzIGRlZmF1bHQgaXMgMHgwZi4KKyAqIEBjd19tYXg6IENvbnRlbnRpb24gd2luLCBtYXggdmFsdWUgaW4gbnVtYmVycyBvZiBzbG90cy4KKyAqICAgICAgICAgIFNob3VsZCBiZSBhIHBvd2VyLW9mLTIsIG1pbnVzIDEuICBEZXZpY2UncyBkZWZhdWx0IGlzIDB4M2YuCisgKiBAYWlmc246ICBOdW1iZXIgb2Ygc2xvdHMgaW4gQXJiaXRyYXRpb24gSW50ZXJmcmFtZSBTcGFjZSAoYmVmb3JlCisgKiAgICAgICAgICBwZXJmb3JtaW5nIHJhbmRvbSBiYWNrb2ZmIHRpbWluZyBwcmlvciB0byBUeCkuICBEZXZpY2UgZGVmYXVsdCAxLgorICogQGVkY2FfdHhvcDogIExlbmd0aCBvZiBUeCBvcHBvcnR1bml0eSwgaW4gdVNlY3MuICBEZXZpY2UgZGVmYXVsdCBpcyAwLgorICoKKyAqIERldmljZSB3aWxsIGF1dG9tYXRpY2FsbHkgaW5jcmVhc2UgY29udGVud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YWNbQUNfTlVNXTsKK30gX19wYWNrZWQ7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICgzKQorICogQWRkL01vZGlmeSBTdGF0aW9ucyBDb21tYW5kcyAmIFJlc3BvbnNlczoKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKgorICogTXVsdGkgc3RhdGlvbiBzdXBwb3J0CisgKi8KKworLyogU3BlY2lhbCwgZGVkaWNhdGVkIGxvY2F0aW9ucyB3aXRoaW4gZGV2aWNlJ3Mgc3RhdGlvbiB0YWJsZSAqLworI2RlZmluZQlJTF9BUF9JRAkJMAorI2RlZmluZQlJTF9TVEFfSUQJCTIKKyNkZWZpbmUJSUwzOTQ1X0JST0FEQ0FTVF9JRAkyNAorI2RlZmluZSBJTDM5NDVfU1RBVElPTl9DT1VOVAkyNQorI2RlZmluZSBJTDQ5NjVfQlJPQURDQVNUX0lECTMxCisjZGVmaW5lCUlMNDk2NV9TVEFUSU9OX0NPVU5UCTMyCisKKyNkZWZpbmUJSUxfU1RBVElPTl9DT1VOVAkzMgkvKiBNQVgoMzk0NSw0OTY1KSAqLworI2RlZmluZQlJTF9JTlZBTElEX1NUQVRJT04JMjU1CisKKyNkZWZpbmUgU1RBX0ZMR19UWF9SQVRFX01TSwkJY3B1X3RvX2xlMzIoMSA8PCAyKQorI2RlZmluZSBTVEFfRkxHX1BXUl9TQVZFX01TSwkJY3B1X3RvX2xlMzIoMSA8PCA4KQorI2RlZmluZSBTVEFfRkxHX1JUU19NSU1PX1BST1RfTVNLCWNwdV90b19sZTMyKDEgPDwgMTcpCisjZGVmaW5lIFNUQV9GTEdfQUdHX01QRFVfOFVTX01TSwljcHVfdG9fbGUzMigxIDw8IDE4KQorI2RlZmluZSBTVEFfRkxHX01BWF9BR0dfU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AwKQorCisjZGVmaW5lIElMX0RST1BfU0lOR0xFCQkwCisjZGVmaW5lIElMX0RST1BfU0VMRUNURUQJMQorI2RlZmluZSBJTF9EUk9QX0FMTAkJMgorCisvKgorICogUkVQTFlfV0VQX0tFWSA9IDB4MjAKKyAqLworc3RydWN0IGlsX3dlcF9rZXkgeworCXU4IGtleV9pZHg7CisJdTgga2V5X29mZnNldDsKKwl1OCByZXNlcnZlZDFbMl07CisJdTgga2V5X3NpemU7CisJdTggcmVzZXJ2ZWQyWzNdOworCXU4IGtleVsxNl07Cit9IF9fcGFja2VkOworCitzdHJ1Y3QgaWxfd2VwX2NtZCB7CisJdTggbnVtX2tleXM7CisJdTggZ2xvYmFsX2tleV90eXBlOworCXU4IGZsYWdzOworCXU4IHJlc2VydmVkOworCXN0cnVjdCBpbF93ZXBfa2V5IGtleVswXTsKK30gX19wYWNrZWQ7CisKKyNkZWZpbmUgV0VQX0tFWV9XRVBfVFlQRSAxCisjZGVmaW5lIFdFUF9LRVlTX01BWCA0CisjZGVmaW5lIFdFUF9JTlZBTElEX09GRlNFVCAweGZmCisjZGVmaW5lIFdFUF9LRVlfTEVOXzY0IDUKKyNkZWZpbmUgV0VQX0tFWV9MRU5fMTI4IDEzCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICg0KQorICogUnggUmVzcG9uc2VzOgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI2RlZmluZSBSWF9SRVNfU1RBVFVTX05PX0NSQzMyX0VSUk9SCWNwdV90b19sZTMyKDEgPDwgMCkKKyNkZWZpbmUgUlhfUkVTX1NUQVRVU19OT19SWEVfT1ZFUkZMT1cJY3B1X3RvX2xlMzIoMSA8PCAxKQorCisjZGVmaW5lIFJYX1JFU19QSFlfRkxBR1NfQkF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wbGF0Zm9ybS4gIEJsdWV0b290aCBkZXZpY2UgYWxlcnRzIHdpcmVsZXNzIGRldmljZSB3aGVuIGl0IHdpbGwgVHg7CisgKiB3aXJlbGVzcyBkZXZpY2UgY2FuIGRlbGF5IG9yIGtpbGwgaXRzIG93biBUeCB0byBhY2NvbW1vZGF0ZS4KKyAqLworc3RydWN0IGlsX2J0X2NtZCB7CisJdTggZmxhZ3M7CisJdTggbGVhZF90aW1lOworCXU4IG1heF9raWxsOworCXU4IHJlc2VydmVkOworCV9fbGUzMiBraWxsX2Fja19tYXNrOworCV9fbGUzMiBraWxsX2N0c19tYXNrOworfSBfX3BhY2tlZDsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogKDYpCisgKiBTcGVjdHJ1bSBNYW5hZ2VtZW50ICg4MDIuMTFoKSBDb21tYW5kcywgUmVzcG9uc2VzLCBOb3RpZmljYXRpb25zOgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyoKKyAqIFNwZWN0cnVtIE1hbmFnZW1lbnQKKyAqLworI2RlZmluZSBNRUFTVVJFTUVOVF9GSUxURVJfRkxBRyAoUlhPTl9GSUxURVJfUFJPTUlTQ19NU0sgICAgICAgICB8IFwKKwkJCQkgUlhPTl9GSUxURVJfQ1RMMkhPU1RfTVNLICAgICAgICB8IFwKKwkJCQkgUlhPTl9GSUxURVJfQUNDRVBUX0dSUF9NU0sgICAgICB8IFwKKwkJCQkgUlhPTl9GSUxURVJfRElTX0RFQ1JZUFRfTVNLICAgICB8IFwKKwkJCQkgUlhPTl9GSUxURVJfRElTX0dSUF9ERUNSWVBUX01TSyB8IFwKKwkJCQkgUlhPTl9GSUxURVJfQVNTT0NfTVNLICAgICAgICAgICB8IFwKKwkJCQkgUlhPTl9GSUxURVJfQk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mx5LCBub3QgYSBjb21tYW5kKQorICovCitzdHJ1Y3QgaWxfY2FyZF9zdGF0ZV9ub3RpZiB7CisJX19sZTMyIGZsYWdzOworfSBfX3BhY2tlZDsKKworI2RlZmluZSBIV19DQVJEX0RJU0FCTEVEICAgMHgwMQorI2RlZmluZSBTV19DQVJEX0RJU0FCTEVEICAgMHgwMgorI2RlZmluZSBDVF9DQVJEX0RJU0FCTEVEICAgMHgwNAorI2RlZmluZSBSWE9OX0NBUkRfRElTQUJMRUQgMHgxMAorCitzdHJ1Y3QgaWxfY3Rfa2lsbF9jb25maWcgeworCV9fbGUzMiByZXNlcnZlZDsKKwlfX2xlMzIgY3JpdGljYWxfdGVtcGVyYXR1cmVfTTsKKwlfX2xlMzIgY3JpdGljYWxfdGVtcGVyYXR1cmVfUjsKK30gX19wYWNrZWQ7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICg4KQorICogU2NhbiBDb21tYW5kcywgUmVzcG9uc2VzLCBOb3RpZmljYXRpb25zOgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI2RlZmluZSBTQ0FOX0NIQU5ORUxfVFlQRV9QQVNTSVZFIGNwdV90b19sZTMyKDApCisjZGVmaW5lIFNDQU5fQ0hBTk5FTF9UWVBFX0FDVElWRSAgY3B1X3RvX2xlMzIoMSkKKworLyoqCisgKiBzdHJ1Y3QgaWxfc2Nhbl9jaGFubmVsIC0gZW50cnkgaW4gQ19TQ0FOIGNoYW5uZWwgdGFibGUKKyAqCisgKiBPbmUgZm9yIGVhY2ggY2hhbm5lbCBpbiB0aGUgc2NhbiBsaXN0LgorICogRWFjaCBjaGFubmVsIGNhbiBpbmRlcGVuZGVudGx5IHNlbGVjdDoKKyAqIDEpICBTU0lEIGZvciBkaXJlY3Rl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GlmaWNhdGlvbiB7CisJdTggY2hhbm5lbDsKKwl1OCBiYW5kOworCXU4IHByb2JlX3N0YXR1czsKKwl1OCBudW1fcHJvYmVfbm90X3NlbnQ7CS8qIG5vdCBlbm91Z2ggdGltZSB0byBzZW5kICovCisJX19sZTMyIHRzZl9sb3c7CisJX19sZTMyIHRzZl9oaWdoOworCV9fbGUzMiBzdGF0c1tOVU1CRVJfT0ZfU1RBVFNdOworfSBfX3BhY2tlZDsKKworLyoKKyAqIE5fU0NBTl9DT01QTEVURSA9IDB4ODQgKG5vdGlmaWNhdGlvbiBvbmx5LCBub3QgYSBjb21tYW5kKQorICovCitzdHJ1Y3QgaWxfc2NhbmNvbXBsZXRlX25vdGlmaWNhdGlvbiB7CisJdTggc2Nhbm5lZF9jaGFubmVsczsKKwl1OCBzdGF0dXM7CisJdTggbGFzdF9jaGFubmVsOworCV9fbGUzMiB0c2ZfbG93OworCV9fbGUzMiB0c2ZfaGlnaDsKK30gX19wYWNrZWQ7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICg5KQorICogSUJTUy9BUCBDb21tYW5kcyBhbmQgTm90aWZpY2F0aW9uczoKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK2VudW0gaWxfaWJzc19tYW5hZ2VyIHsKKwlJTF9OT1RfSUJTU19NQU5BR0VSID0gMCwKKwlJTF9JQlNTX01BTkFHRVIgPSAxLAorfTsKKworLyoKKyAqIE5fQkVBQ09OID0gMHg5MCAobm90aWZpY2F0aW9uIG9ubHksIG5vdCBhIGNvbW1hbmQpCisgKi8KKworc3RydWN0IGlsMzk0NV9iZWFjb25fbm90aWYgeworCXN0cnVjdCBpbDM5NDVfdHhfcmVzcCBiZWFjb25fbm90aWZ5X2hkcjsKKwlfX2xlMzIgbG93X3RzZjsKKwlfX2xlMzIgaGlnaF90c2Y7CisJX19sZTMyIGlic3NfbWdyX3N0YXR1czsKK30gX19wYWNrZWQ7CisKK3N0cnVjdCBpbDQ5NjVfYmVhY29uX25vdGlmIHsKKwlzdHJ1Y3QgaWw0OTY1X3R4X3Jlc3AgYmVhY29uX25vdGlmeV9oZHI7CisJX19sZTMyIGxvd190c2Y7CisJX19sZTMyIGhpZ2hfdHNmOworCV9fbGUzMiBpYnNzX21ncl9zdGF0dXM7Cit9IF9fcGFja2VkOworCisvKgorICogQ19UWF9CRUFDT049IDB4OTEgKGNvbW1hbmQsIGhhcyBzaW1wbGUgZ2VuZXJpYyByZXNwb25zZSkKKyAqLworCitzdHJ1Y3QgaWwzOTQ1X3R4X2JlYWNvbl9jbWQgeworCXN0cnVjdCBpbDM5NDVfdHhfY21kIHR4OworCV9fbGUxNiB0aW1faWR4OworCXU4IHRpbV9zaXplOworCXU4IHJlc2VydmVkMTsKKwlzdHJ1Y3QgaWVlZTgwMjExX2hkciBmcmFtZVswXTsJLyogYmVhY29uIGZyYW1lICovCit9IF9fcGFja2VkOworCitzdHJ1Y3QgaWxfdHhfYmVhY29uX2NtZCB7CisJc3RydWN0IGlsX3R4X2NtZCB0eDsKKwlfX2xlMTYgdGltX2lkeDsKKwl1OCB0aW1fc2l6ZTsKKwl1OCByZXNlcnZlZDE7CisJc3RydWN0IGllZWU4MDIxMV9oZHIgZnJhbWVbMF07CS8qIGJlYWNvbiBmcmFtZSAqLworfSBfX3BhY2tlZDsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogKDEwKQorICogU3RhdGlzdGljcyBDb21tYW5kcyBhbmQgTm90aWZpY2F0aW9uczoKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNkZWZ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uczsKKwlfX2xlMzIgbnVtX2V4cGVjdGVkX2JlYWNvbnM7CisJX19sZTMyIG51bV9yZWN2ZF9iZWFjb25zOworfSBfX3BhY2tlZDsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogKDExKQorICogUnggQ2FsaWJyYXRpb24gQ29tbWFuZHM6CisgKgorICogV2l0aCB0aGUgdUNvZGUgdXNlZCBmb3Igb3BlbiBzb3VyY2UgZHJpdmVycywgbW9zdCBUeCBjYWxpYnJhdGlvbiAoZXhjZXB0CisgKiBmb3IgVHggUG93ZXIpIGFuZCBtb3N0IFJ4IGNhbGlicmF0aW9uIGlzIGRvbmUgYnkgdUNvZGUgZHVyaW5nIHRoZQorICogImluaXRpYWxpemUiIHBoYXNlIG9mIHVDb2RlIGJvb3QuICBEcml2ZXIgbXVzdCBjYWxpYnJhdGUgb25seToKKyAqCisgKiAxKSAgVHggcG93ZXIgKGRlcGVuZHMgb24gdGVtcGVyYXR1cmUpLCBkZXNjcmliZWQgZWxzZXdoZXJlCisgKiAyKSAgUmVjZWl2ZXIgZ2FpbiBiYWxhbmNlIChvcHRpbWl6ZSBNSU1PLCBhbmQgZGV0ZWN0IGRpc2Nvbm5lY3RlZCBhbnRlbm5hcykKKyAqIDMpICBSZWNlaXZlciBzZW5zaXRpdml0eSAodG8gb3B0aW1pemUgc2lnbmFsIGRldGVjdGlvbikKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qKgorICogQ19TRU5TSVRJVklUWSA9IDB4YTggKGNvbW1hbmQsIGhhcyBzaW1wbGUgZ2VuZXJpYyByZXNwb25zZSkKKyAqCisgKiBUaGlzIGNvbW1hbmQgc2V0cyB1cCB0aGUgUnggc2lnbmFsIGRldGVjdG9yIGZvciBhIHNlbnNpdGl2aXR5I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B2YWx1ZSBtZWFucyBsb3dlciBlbmVyZ3khKQorICogICAgICAgIG9mIHRoZSBsYXN0IDEwIG1pbmltYS4gIE9uY2UgdGhpcyBpcyBkZXRlcm1pbmVkLCBkcml2ZXIgbXVzdCBhZGQKKyAqICAgICAgICBhIGxpdHRsZSBtYXJnaW4gYnkgYWRkaW5nICI2IiB0byBpdC4KKyAqCisgKiAgIDMpLiAgTnVtYmVyIG9mIGNvbnNlY3V0aXZlIGJlYWNvbiBwZXJpb2RzIHdpdGggdG9vIGZldyBmYWxzZSBhbGFybXMuCisgKiAgICAgICAgUmVzZXQgdGhpcyB0byAwIGF0IHRoZSBmaXJzdCBiZWFjb24gcGVyaW9kIHRoYXQgZmFsbHMgd2l0aGluIHRoZQorICogICAgICAgICJnb29kIiByYW5nZSAoNSB0byA1MCBmYWxzZSBhbGFybXMgcGVyIDIwNC44IG1pbGxpc2Vjb25kcyByeCkuCisgKgorICogVGhlbiwgYWRqdXN0IHRoZSBmb2xsb3dpbmcgQ0NLIHRhYmxlIGVudHJpZXMgaW4gc3RydWN0IGlsX3NlbnNpdGl2aXR5X2NtZAorICogKG5vdGljZSB0aGF0IHRoZSBzdGFydCBwb2ludHMgZm9yIENDSyBhcmUgYXQgbWF4aW11bSBzZW5zaXRpdml0eSk6CisgKgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTVEFSVCAgLyAgTUlOICAvICBNQVgKKyAqICAgSERfQVVUT19DT1JSNDBfWDRfVEhfQUREX01JTl9JRFggICAgICAgICAxMjUgICAvICAxMjUgIC8gIDIwMAorICogICBIRF9BVVRPX0NPUlI0MF9YNF9USF9BRERfTUlOX01SQ19JRFggICAgIDIwMCAgIC8gIDIwMCAgLyAgNDAwCisgKiAgIEhEX01JTl9FTkVSR1lfQ0NLX0RFVF9JRFggICAgICAgICAgICAgICAgMTAwICAgLyAgICAwICAvICAxMDAKKyAqCisgKiAgIElmIGFjdHVhbCByYXRlIG9mIENDSyBmYW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SogIk1heCBjY2sgZW5lcmd5Ii4KKyAqCisgKi8KKworLyoKKyAqIFRhYmxlIGVudHJpZXMgaW4gQ19TRU5TSVRJVklUWSAoc3RydWN0IGlsX3NlbnNpdGl2aXR5X2NtZCkKKyAqLworI2RlZmluZSBIRF9UQkxfU0laRSAgKDExKQkvKiBudW1iZXIgb2YgZW50cmllcyAqLworI2RlZmluZSBIRF9NSU5fRU5FUkdZX0NDS19ERVRfSURYICAgICAgICAgICAgICAgICAoMCkJLyogdGFibGUgaWR4ZXMgKi8KKyNkZWZpbmUgSERfTUlOX0VORVJHWV9PRkRNX0RFVF9JRFggICAgICAgICAgICAgICAgKDEpCisjZGVmaW5lIEhEX0FVVE9fQ09SUjMyX1gxX1RIX0FERF9NSU5fSURYICAgICAgICAgICgyKQorI2RlZmluZSBIRF9BVVRPX0NPUlIzMl9YMV9USF9BRERfTUlOX01SQ19JRFggICAgICAoMykKKyNkZWZpbmUgSERfQVVUT19DT1JSNDBfWDRfVEhfQUREX01JTl9NUkNfSURYICAgICAgKDQpCisjZGVmaW5lIEhEX0FVVE9fQ09SUjMyX1g0X1RIX0FERF9NSU5fSURYICAgICAgICAgICg1KQorI2RlZmluZSBIRF9BVVRPX0NPUlIzMl9YNF9USF9BRERfTUlOX01SQ19JRFggICAgICAoNikKKyNkZWZpbmUgSERfQkFSS0VSX0NPUlJfVEhfQUREX01JTl9JRFggICAgICAgICAgICAgKDcpCisjZGVmaW5lIEhEX0JBUktFUl9DT1JSX1RIX0FERF9NSU5fTVJDX0lEWCAgICAgICAgICg4KQorI2RlZmluZSBIRF9BVVRPX0NPUlI0MF9YNF9USF9BRERfTUlOX0lEWCAgICAgICAgICAoOSkKKyNkZWZpbmUgSERfT0ZETV9FTkVSR1lfVEhfSU5fSURYICAgICAgICAgICAgICAgICAgKDEwKQorCisvKiBDb250cm9sIGZpZWxkIGluIHN0cnVjdCBpbF9zZW5zaXRpdml0eV9jbWQgKi8KKyNkZWZpbmUgQ19TRU5TSVRJVkl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WkUJCSgyNTMpCisKK3N0cnVjdCBpbF9jYWxpYl9oZHIgeworCXU4IG9wX2NvZGU7CisJdTggZmlyc3RfZ3JvdXA7CisJdTggZ3JvdXBzX251bTsKKwl1OCBkYXRhX3ZhbGlkOworfSBfX3BhY2tlZDsKKworLyogSUxfUEhZX0NBTElCUkFURV9ESUZGX0dBSU5fQ01EICg3KSAqLworc3RydWN0IGlsX2NhbGliX2RpZmZfZ2Fpbl9jbWQgeworCXN0cnVjdCBpbF9jYWxpYl9oZHIgaGRyOworCXM4IGRpZmZfZ2Fpbl9hOwkJLyogc2VlIGFib3ZlICovCisJczggZGlmZl9nYWluX2I7CisJczggZGlmZl9nYWluX2M7CisJdTggcmVzZXJ2ZWQxOworfSBfX3BhY2tlZDsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogKDEyKQorICogTWlzY2VsbGFuZW91cyBDb21tYW5kczoKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qCisgKiBMRURzIENvbW1hbmQgJiBSZXNwb25zZQorICogQ19MRURTID0gMHg0OCAoY29tbWFuZCwgaGFzIHNpbXBsZSBnZW5lcmljIHJlc3BvbnNlKQorICoKKyAqIEZvciBlYWNoIG9mIDMgcG9zc2libGUgTEVEcyAoQWN0aXZpdHkvTGluay9UZWNoLCBzZWxlY3RlZCBieSAiaWQiIGZpZWxkKSwKKyAqIHRoaXMgY29tbWFuZCB0dXJucyBpdCBvbiBvciBvZmYsIG9yIHNldHMgdXAgYSBwZXJpb2RpYyBibGlua2luZyBjeWNsZS4KKyAqLworc3RydWN0IGlsX2xlZF9jbWQgeworCV9fbGUzMiBpbnRlcnZhbDsJLyogImludGVydmFsIiBpbiB1U2VjICovCisJdTggaWQ7CQkJLyogMTogQWN0aXZpdHksIDI6IExpbmssIDM6IFRlY2ggKi8KKwl1OCBvZmY7CQkJLyogIyBpbnRlcnZhbHMgb2ZmIHdoaWxlIGJsaW5raW5nOworCQkJCSAqICIwIiwgd2l0aCA+MCAib24iIHZhbHVlLCB0dXJucyBMRUQgb24gKi8KKwl1OCBvbjsJCQkvKiAjIGludGVydmFscyBvbiB3aGlsZSBibGlua2luZzsKKwkJCQkgKiAiMCIsIHJlZ2FyZGxlc3Mgb2YgIm9mZiIsIHR1cm5zIExFRCBvZmYgKi8KKwl1OCByZXNlcnZlZDsKK30gX19wYWNrZWQ7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICgxMykKKyAqIFVuaW9uIG9mIGFsbCBleHBlY3RlZCBub3RpZmljYXRpb25zL3Jlc3BvbnNlczoKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNkZWZpbmUgSUxfUlhfRlJBTUVfU0laRV9NU0sJMHgwMDAwM2ZmZgorCitzdHJ1Y3QgaWxfcnhfcGt0IHsKKwkvKgorCSAqIFRoZSBmaXJzdCA0IGJ5dGVzIG9mIHRoZSBSWCBmcmFtZSBoZWFkZXIgY29udGFpbiBib3RoIHRoZSBSWCBmcmFtZQorCSAqIHNpemUgYW5kIHNvbWUgZmxhZ3MuCisJICogQml0IGZpZWxkczoKKwkgKiAzMTogICAgZmxhZyBmbHVzaCBSQiByZXF1ZXN0CisJICogMzA6ICAgIGZsYWcgaWdub3JlIFRDICh0ZXJtaW5hbCBjb3VudGVyKSByZXF1ZXN0CisJICogMjk6ICAgIGZsYWcgZmFzdCBJUlEgcmVxdWVzdAorCSAqIDI4LTE0OiBSZXNlcnZlZAorCSAqIDEzLTAwOiBSWCBmcmFtZSBzaXplCisJICovCisJX19sZTMyIGxlbl9uX2ZsYWdzOwor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3N0YXRpYyBjb25zdCB1OCBpbF9lZXByb21fYmFuZF8zW10gPSB7CS8qIDUxNzAtNTMyME1IeiAqLworCTM0LCAzNiwgMzgsIDQwLCA0MiwgNDQsIDQ2LCA0OCwgNTIsIDU2LCA2MCwgNjQKK307CisKK3N0YXRpYyBjb25zdCB1OCBpbF9lZXByb21fYmFuZF80W10gPSB7CS8qIDU1MDAtNTcwME1IeiAqLworCTEwMCwgMTA0LCAxMDgsIDExMiwgMTE2LCAxMjAsIDEyNCwgMTI4LCAxMzIsIDEzNiwgMTQwCit9OworCitzdGF0aWMgY29uc3QgdTggaWxfZWVwcm9tX2JhbmRfNVtdID0gewkvKiA1NzI1LTU4MjVNSHogKi8KKwkxNDUsIDE0OSwgMTUzLCAxNTcsIDE2MSwgMTY1Cit9OworCitzdGF0aWMgY29uc3QgdTggaWxfZWVwcm9tX2JhbmRfNltdID0gewkvKiAyLjQgaHQ0MCBjaGFubmVsICovCisJMSwgMiwgMywgNCwgNSwgNiwgNworfTsKKworc3RhdGljIGNvbnN0IHU4IGlsX2VlcHJvbV9iYW5kXzdbXSA9IHsJLyogNS4yIGh0NDAgY2hhbm5lbCAqLworCTM2LCA0NCwgNTIsIDYwLCAxMDAsIDEwOCwgMTE2LCAxMjQsIDEzMiwgMTQ5LCAxNTcKK307CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBFRVBST00gcmVsYXRlZCBmdW5jdGlvbnMKKyAqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3N0YXRpYyBpbnQKK2lsX2VlcHJvbV92ZXJpZnlfc2lnbmF0dXJlKHN0cnVjdCBpbF9wcml2ICppbCkKK3sKKwl1MzIgZ3AgPSBfaWxfcmQoaWwsIENTUl9FRVBST01fR1ApICYgQ1NSX0V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BpZHhlcworICovCitzdGF0aWMgaW50CitpbF9xdWV1ZV9pbml0KHN0cnVjdCBpbF9wcml2ICppbCwgc3RydWN0IGlsX3F1ZXVlICpxLCBpbnQgY291bnQsIGludCBzbG90c19udW0sCisJICAgICAgdTMyIGlkKQoreworCXEtPm5fYmQgPSBjb3VudDsKKwlxLT5uX3dpbiA9IHNsb3RzX251bTsKKwlxLT5pZCA9IGlkOworCisJLyogY291bnQgbXVzdCBiZSBwb3dlci1vZi10d28gc2l6ZSwgb3RoZXJ3aXNlIGlsX3F1ZXVlX2luY193cmFwCisJICogYW5kIGlsX3F1ZXVlX2RlY193cmFwIGFyZSBicm9rZW4uICovCisJQlVHX09OKCFpc19wb3dlcl9vZl8yKGNvdW50KSk7CisKKwkvKiBzbG90c19udW0gbXVzdCBiZSBwb3dlci1vZi10d28gc2l6ZSwgb3RoZXJ3aXNlCisJICogaWxfZ2V0X2NtZF9pZHggaXMgYnJva2VuLiAqLworCUJVR19PTighaXNfcG93ZXJfb2ZfMihzbG90c19udW0pKTsKKworCXEtPmxvd19tYXJrID0gcS0+bl93aW4gLyA0OworCWlmIChxLT5sb3dfbWFyayA8IDQpCisJCXEtPmxvd19tYXJrID0gNDsKKworCXEtPmhpZ2hfbWFyayA9IHEtPm5fd2luIC8gODsKKwlpZiAocS0+aGlnaF9tYXJrIDwgMikKKwkJcS0+aGlnaF9tYXJrID0gMjsKKworCXEtPndyaXRlX3B0ciA9IHEtPnJlYWRfcHRyID0gMDsKKworCXJldHVybiAwOworfQorCisvKioKKyAqIGlsX3R4X3F1ZXVlX2FsbG9jIC0gQWxsb2MgZHJpdmVyIGRhdGEgYW5kIFRGRCBDQiBmb3Igb25lIFR4L2NtZCBxdWV1ZQorICovCitzdGF0aWMgaW50CitpbF90eF9xdWV1ZV9hbGxvYyhzdHJ1Y3QgaWxfcHJpdiAqaWwsIHN0cnVjdCBpbF90eF9xdWV1ZSAqdHhxLCB1MzIgaWQpCit7CisJc3RydWN0IGRldmljZSAqZ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sX3R4X3F1ZXVlICp0eHEsIGludCBzbG90c19udW0sCisJCSAgICAgdTMyIHR4cV9pZCk7Cit2b2lkIGlsX3R4X3F1ZXVlX3Jlc2V0KHN0cnVjdCBpbF9wcml2ICppbCwgc3RydWN0IGlsX3R4X3F1ZXVlICp0eHEsCisJCSAgICAgICBpbnQgc2xvdHNfbnVtLCB1MzIgdHhxX2lkKTsKK3ZvaWQgaWxfdHhfcXVldWVfdW5tYXAoc3RydWN0IGlsX3ByaXYgKmlsLCBpbnQgdHhxX2lkKTsKK3ZvaWQgaWxfdHhfcXVldWVfZnJlZShzdHJ1Y3QgaWxfcHJpdiAqaWwsIGludCB0eHFfaWQpOwordm9pZCBpbF9zZXR1cF93YXRjaGRvZyhzdHJ1Y3QgaWxfcHJpdiAqaWwpOworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBUWCBwb3dlcgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitpbnQgaWxfc2V0X3R4X3Bvd2VyKHN0cnVjdCBpbF9wcml2ICppbCwgczggdHhfcG93ZXIsIGJvb2wgZm9yY2UpOworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogUmF0ZQorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordTggaWxfZ2V0X2xvd2VzdF9wbGNwKHN0cnVjdCBpbF9wcml2ICppbCwgc3RydWN0IGlsX3J4b25fY29udGV4dCAqY3R4KTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIFNjYW5uaW5nCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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5lIENTUl9SRVNFVF9SRUdfRkxBR19ORVZPX1JFU0VUICAgICAgICAgICAgICAgICgweDAwMDAwMDAxKQorI2RlZmluZSBDU1JfUkVTRVRfUkVHX0ZMQUdfRk9SQ0VfTk1JICAgICAgICAgICAgICAgICAoMHgwMDAwMDAwMikKKyNkZWZpbmUgQ1NSX1JFU0VUX1JFR19GTEFHX1NXX1JFU0VUICAgICAgICAgICAgICAgICAgKDB4MDAwMDAwODApCisjZGVmaW5lIENTUl9SRVNFVF9SRUdfRkxBR19NQVNURVJfRElTQUJMRUQgICAgICAgICAgICgweDAwMDAwMTAwKQorI2RlZmluZSBDU1JfUkVTRVRfUkVHX0ZMQUdfU1RPUF9NQVNURVIgICAgICAgICAgICAgICAoMHgwMDAwMDIwMCkKKyNkZWZpbmUgQ1NSX1JFU0VUX0xJTktfUFdSX01HTVRfRElTQUJMRUQgICAgICAgICAgICAgKDB4ODAwMDAwMDApCisKKy8qCisgKiBHUCAoZ2VuZXJhbCBwdXJwb3NlKSBDT05UUk9MIFJFR0lTVEVSCisgKiBCaXQgZmllbGRzOgorICogICAgMjc6ICBIV19SRl9LSUxMX1NXCisgKiAgICAgICAgIEluZGljYXRlcyBzdGF0ZSBvZiAocGxhdGZvcm0ncykgaGFyZHdhcmUgUkYtS2lsbCBzd2l0Y2gKKyAqIDI2LTI0OiAgUE9XRVJfU0FWRV9UWVBFCisgKiAgICAgICAgIEluZGljYXRlcyBjdXJyZW50IHBvd2VyLXNhdmluZyBtb2RlOgorICogICAgICAgICAwMDAgLS0gTm8gcG93ZXIgc2F2aW5nCisgKiAgICAgICAgIDAwMSAtLSBNQUMgcG93ZXItZG93bgorICogICAgICAgICAwMTAgLS0gUEhZIChyYWRpbykgcG93ZXItZG93bgorICogICAgICAgICAwMTEgLS0gRXJyb3IKKyAqICAgOS02OiAgU1lTX0NPTkZJRworICogICAgICAgICBJbmRpY2F0ZXMgY3VycmVudCBzeXN0ZW0gY29uZmlndXJhdGlvbiwgcmVmbGVjd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cmFtcy5tYXhfc3RhdGlvbnM7CisJY2hhciAqYnVmOworCWludCBpLCBqLCBwb3MgPSAwOworCXNzaXplX3QgcmV0OworCS8qIEFkZCAzMCBmb3IgaW5pdGlhbCBzdHJpbmcgKi8KKwljb25zdCBzaXplX3QgYnVmc3ogPSAzMCArIHNpemVvZihjaGFyKSAqIDUwMCAqIChpbC0+bnVtX3N0YXRpb25zKTsKKworCWJ1ZiA9IGttYWxsb2MoYnVmc3osIEdGUF9LRVJORUwpOworCWlmICghYnVmKQorCQlyZXR1cm4gLUVOT01FTTsKKworCXBvcyArPQorCSAgICBzY25wcmludGYoYnVmICsgcG9zLCBidWZzeiAtIHBvcywgIm51bSBvZiBzdGF0aW9uczogJWRcblxuIiwKKwkJICAgICAgaWwtPm51bV9zdGF0aW9ucyk7CisKKwlmb3IgKGkgPSAwOyBpIDwgbWF4X3N0YTsgaSsrKSB7CisJCXN0YXRpb24gPSAmaWwtPnN0YXRpb25zW2ldOworCQlpZiAoIXN0YXRpb24tPnVzZWQpCisJCQljb250aW51ZTsKKwkJcG9zICs9CisJCSAgICBzY25wcmludGYoYnVmICsgcG9zLCBidWZzeiAtIHBvcywKKwkJCSAgICAgICJzdGF0aW9uICVkIC0gYWRkcjogJXBNLCBmbGFnczogJSN4XG4iLCBpLAorCQkJICAgICAgc3RhdGlvbi0+c3RhLnN0YS5hZGRyLAorCQkJICAgICAgc3RhdGlvbi0+c3RhLnN0YXRpb25fZmxhZ3NfbXNrKTsKKwkJcG9zICs9CisJCSAgICBzY25wcmludGYoYnVmICsgcG9zLCBidWZzeiAtIHBvcywKKwkJCSAgICAgICJUSURcdHNlcV9udW1cdHR4cV9pZFx0ZnJhbWVzXHR0ZmRzXHQiKTsKKwkJcG9zICs9CisJCSAgICBzY25wcmludGYoYnVmICsgcG9zLCBidWZzeiAtIHBvcywKKwkJCSAgICAgICJzdGFydF9pZHhcdGJpdG1hcFx0XHRcdHJhdGVfbl9mbGFnc1xuIik7CisKKwkJZm9yIChq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pcdFx0XHQgJXVcbiIsCisJCSAgICAgIGRhdGEtPmNoYWluX25vaXNlX2MpOworCXBvcyArPQorCSAgICBzY25wcmludGYoYnVmICsgcG9zLCBidWZzeiAtIHBvcywgImNoYWluX3NpZ25hbF9hOlx0XHRcdCAldVxuIiwKKwkJICAgICAgZGF0YS0+Y2hhaW5fc2lnbmFsX2EpOworCXBvcyArPQorCSAgICBzY25wcmludGYoYnVmICsgcG9zLCBidWZzeiAtIHBvcywgImNoYWluX3NpZ25hbF9iOlx0XHRcdCAldVxuIiwKKwkJICAgICAgZGF0YS0+Y2hhaW5fc2lnbmFsX2IpOworCXBvcyArPQorCSAgICBzY25wcmludGYoYnVmICsgcG9zLCBidWZzeiAtIHBvcywgImNoYWluX3NpZ25hbF9jOlx0XHRcdCAldVxuIiwKKwkJICAgICAgZGF0YS0+Y2hhaW5fc2lnbmFsX2MpOworCXBvcyArPQorCSAgICBzY25wcmludGYoYnVmICsgcG9zLCBidWZzeiAtIHBvcywgImJlYWNvbl9jb3VudDpcdFx0XHQgJXVcbiIsCisJCSAgICAgIGRhdGEtPmJlYWNvbl9jb3VudCk7CisKKwlwb3MgKz0gc2NucHJpbnRmKGJ1ZiArIHBvcywgYnVmc3ogLSBwb3MsICJkaXNjb25uX2FycmF5Olx0XHRcdCIpOworCWZvciAoY250ID0gMDsgY250IDwgTlVNX1JYX0NIQUlOUzsgY250KyspIHsKKwkJcG9zICs9CisJCSAgICBzY25wcmludGYoYnVmICsgcG9zLCBidWZzeiAtIHBvcywgIiAldSIsCisJCQkgICAgICBkYXRhLT5kaXNjb25uX2FycmF5W2NudF0pOworCX0KKwlwb3MgKz0gc2NucHJpbnRmKGJ1ZiArIHBvcywgYnVmc3ogLSBwb3MsICJcbiIpOworCXBvcyArPSBzY25wcmludGYoYnVmICsgcG9zLCBidWZzeiAtIHBvcywgImRlbHRhX2dhaW5fY29kZTpcdFx0Iik7CisJZm9yIChjbnQgPSAwOyBjbnQgPCBOVU1fUlhfQ0hBSU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xfRVJSKHByaXYsICJCU00gdUNvZGUgdmVyaWZpY2F0aW9uIGZhaWxlZCBhdCAiCi0JCQkJICAiYWRkciAweCUwOFgrJXUgKG9mICV1KSwgaXMgMHgleCwgcy9iIDB4JXhcbiIsCi0JCQkJICBCU01fU1JBTV9MT1dFUl9CT1VORCwKLQkJCQkgIHJlZyAtIEJTTV9TUkFNX0xPV0VSX0JPVU5ELCBsZW4sCi0JCQkJICB2YWwsIGxlMzJfdG9fY3B1KCppbWFnZSkpOwotCQkJcmV0dXJuIC1FSU87Ci0JCX0KLQl9Ci0KLQlJV0xfREVCVUdfSU5GTyhwcml2LCAiQlNNIGJvb3RzdHJhcCB1Q29kZSBpbWFnZSBPS1xuIik7Ci0KLQlyZXR1cm4gMDsKLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKgotICogRUVQUk9NIHJlbGF0ZWQgZnVuY3Rpb25zCi0gKgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotLyoKLSAqIENsZWFyIHRoZSBPV05FUl9NU0ssIHRvIGVzdGFibGlzaCBkcml2ZXIgKGluc3RlYWQgb2YgdUNvZGUgcnVubmluZyBvbgotICogZW1iZWRkZWQgY29udHJvbGxlcikgYXMgRUVQUk9NIHJlYWRlcjsgZWFjaCByZWFkIGlzIGEgc2VyaWVzIG9mIHB1bHNlcwotICogdG8vZnJvbSB0aGUgRUVQUk9NIGNoaXAsIG5vdCBhIHNpbmdsZSBldmVudCwgc28gZXZlbiByZWFkcyBjb3VsZCBjb25mbGljdAotICogaWYgdGhleSB3ZXJlbid0IGFyYml0cmF0ZWQgYnkgc29tZSBvd25lcnNoaXAgbWVjaGFuaXNtLiAgSGVyZSwgdGhlIGRyaXZlcgotICogc2ltcGx5IGNsYWltcyBvd25lcnN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KElXTF9SWF9IRFIoeCktPnBheWxvYWQpCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICoKLSAqIEZ1bmN0aW9ucyBpbXBsZW1lbnRlZCBpbiBpd2wzOTQ1LWJhc2UuYyB3aGljaCBhcmUgZm9yd2FyZCBkZWNsYXJlZCBoZXJlCi0gKiBmb3IgdXNlIGJ5IGl3bC0qLmMKLSAqCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1leHRlcm4gaW50IGl3bDM5NDVfY2FsY19kYl9mcm9tX3JhdGlvKGludCBzaWdfcmF0aW8pOwotZXh0ZXJuIHZvaWQgaXdsMzk0NV9yeF9yZXBsZW5pc2godm9pZCAqZGF0YSk7Ci1leHRlcm4gdm9pZCBpd2wzOTQ1X3J4X3F1ZXVlX3Jlc2V0KHN0cnVjdCBpd2xfcHJpdiAqcHJpdiwgc3RydWN0IGl3bF9yeF9xdWV1ZSAqcnhxKTsKLWV4dGVybiB1bnNpZ25lZCBpbnQgaXdsMzk0NV9maWxsX2JlYWNvbl9mcmFtZShzdHJ1Y3QgaXdsX3ByaXYgKnByaXYsCi0JCQkJCXN0cnVjdCBpZWVlODAyMTFfaGRyICpoZHIsIGludCBsZWZ0KTsKLWV4dGVybiBpbnQgaXdsMzk0NV9kdW1wX25pY19ldmVudF9sb2coc3RydWN0IGl3bF9wcml2ICpwcml2LCBib29sIGZ1bGxfbG9nLAotCQkJCSAgICAgICBjaGFyICoqYnVmLCBib29sIGRpc3BsYXkpOwotZXh0ZXJuIHZvaWQgaXdsMzk0NV9kdW1wX25pY19lcnJvcl9sb2coc3RydWN0IGl3bF9wcml2ICpwcml2KTsKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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wotCi0jaW5jbHVkZSA8bGludXgvc2xhYi5oPgotI2luY2x1ZGUgPG5ldC9tYWM4MDIxMS5oPgotCi0jaW5jbHVkZSAiaXdsLWRldi5oIgotI2luY2x1ZGUgIml3bC1jb3JlLmgiCi0jaW5jbHVkZSAiaXdsLTQ5NjUtY2FsaWIuaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiBJTklUIGNhbGlicmF0aW9ucyBmcmFtZXdvcmsKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotc3RydWN0IHN0YXRpc3RpY3NfZ2VuZXJhbF9kYXRhIHsKLQl1MzIgYmVhY29uX3NpbGVuY2VfcnNzaV9hOwotCXUzMiBiZWFjb25fc2lsZW5jZV9yc3NpX2I7Ci0JdTMyIGJlYWNvbl9zaWxlbmNlX3Jzc2lfYzsKLQl1MzIgYmVhY29uX2VuZXJneV9hOwotCXUzMiBiZWFjb25fZW5lcmd5X2I7Ci0JdTMyIGJlYWNvbl9lbmVyZ3lfYzsKLX07Ci0KLXZvaWQgaXdsNDk2NV9jYWxpYl9mcmVlX3Jlc3VsdHMoc3RydWN0IGl3bF9wcml2ICpwcml2KQotewotCWludCBpOwotCi0JZm9yIChpID0gMDsgaSA8IElXTF9DQUxJQl9NQVg7IGkrKykgewotCQlrZnJlZShwcml2LT5jYWxpYl9yZXN1bHRzW2ldLmJ1Zik7Ci0JCXByaXYtPmNhbGliX3Jlc3VsdHNbaV0uYnVmID0gTlVMTDsKLQkJcHJpdi0+Y2FsaWJfcmVzdWx0c1tpXS5idWZfbGVuID0gMDsKLQl9Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogUlVOVElNRS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VUNIIERBTUFHRS4KLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCi0jaW5jbHVkZSA8bGludXgva2VybmVsLmg+Ci0jaW5jbHVkZSA8bGludXgvbW9kdWxlLmg+Ci0jaW5jbHVkZSA8bGludXgvc2xhYi5oPgotI2luY2x1ZGUgPGxpbnV4L2luaXQuaD4KLQotI2luY2x1ZGUgPG5ldC9tYWM4MDIxMS5oPgotCi0jaW5jbHVkZSAiaXdsLWNvbW1hbmRzLmgiCi0jaW5jbHVkZSAiaXdsLWRldi5oIgotI2luY2x1ZGUgIml3bC1jb3JlLmgiCi0jaW5jbHVkZSAiaXdsLWRlYnVnLmgiCi0jaW5jbHVkZSAiaXdsLTQ5NjUuaCIKLSNpbmNsdWRlICJpd2wtaW8uaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICoKLSAqIEVFUFJPTSByZWxhdGVkIGZ1bmN0aW9ucwotICoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotLyoKLSAqIFRoZSBkZXZpY2UncyBFRVBST00gc2VtYXBob3JlIHByZXZlbnRzIGNvbmZsaWN0cyBiZXR3ZWVuIGRyaXZlciBhbmQgdUNvZGUKLSAqIHdoZW4gYWNjZXNzaW5nIHRoZSBFRVBST007IGVhY2ggYWNjZXNzIGlzIGEgc2VyaWVzIG9mIHB1bHNlcyB0by9mcm9tIHRoZQotICogRUVQUk9NIGNoaXAsIG5vdCBhIHNpbmdsZSBldmVudCwgc28gZXZlbiByZWFkcyBjb3VsZCBjb25mbGljdCBpZiB0aGV5Ci0gKiB3ZXJlbid0IGFyYml0cmF0ZWQgYnkgdGhlIHNlbWFwaG9yZS4KLSAqL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KGhpZ2hlc3QgZ2FpbikKLSAqICAgMSAgICAgICAgMTA0ICAgICAgICAgMHgzZgotICogICAyICAgICAgICAgOTggICAgICAgICAweDNmCi0gKiAgIDMgICAgICAgIDExMCAgICAgICAgIDB4M2UKLSAqICAgNCAgICAgICAgMTA0ICAgICAgICAgMHgzZQotICogICA1ICAgICAgICAgOTggICAgICAgICAweDNlCi0gKiAgIDYgICAgICAgIDExMCAgICAgICAgIDB4M2QKLSAqICAgNyAgICAgICAgMTA0ICAgICAgICAgMHgzZAotICogICA4ICAgICAgICAgOTggICAgICAgICAweDNkCi0gKiAgIDkgICAgICAgIDExMCAgICAgICAgIDB4M2MKLSAqICAxMCAgICAgICAgMTA0ICAgICAgICAgMHgzYwotICogIDExICAgICAgICAgOTggICAgICAgICAweDNjCi0gKiAgMTIgICAgICAgIDExMCAgICAgICAgIDB4M2IKLSAqICAxMyAgICAgICAgMTA0ICAgICAgICAgMHgzYgotICogIDE0ICAgICAgICAgOTggICAgICAgICAweDNiCi0gKiAgMTUgICAgICAgIDExMCAgICAgICAgIDB4M2EKLSAqICAxNiAgICAgICAgMTA0ICAgICAgICAgMHgzYQotICogIDE3ICAgICAgICAgOTggICAgICAgICAweDNhCi0gKiAgMTggICAgICAgIDExMCAgICAgICAgIDB4MzkKLSAqICAxOSAgICAgICAgMTA0ICAgICAgICAgMHgzOQotICogIDIwICAgICAgICAgOTggICAgICAgICAweDM5Ci0gKiAgMjEgICAgICAgIDExMCAgICAgICAgIDB4MzgKLSAqICAyMiAgICAgICAgMTA0ICAgICAgICAgMHgzOAotICogIDIzICAgICAgICAgOTggICAgICAgICAweDM4Ci0gKiAgMjQgICAgICAgIDExMCAgICAgICAgIDB4MzcKLSAqICAyNSAgICAgICAgMTA0ICAgICAgICAgMHgzNwotICogIDI2ICAgICAgICAgOTggICAgICAgICAweDM3Ci0gKiAgMjcgICAgICAgIDExMCAgICAgICAgIDB4MzYKLSAqICAyOCAgICAgICAgMTA0ICAgICAgICAgMHgzNgotICogIDI5ICAgICAgICAgOTggICAgICAgICAweDM2Ci0gKiAgMzAgICAgICAgIDExMCAgICAgICAgIDB4MzUKLSAqICAzMSAgICAgICAgMTA0ICAgICAgICAgMHgzNQotICogIDMyICAgICAgICAgOTggICAgICAgICAweDM1Ci0gKiAgMzMgICAgICAgIDExMCAgICAgICAgIDB4MzQKLSAqICAzNCAgICAgICAgMTA0ICAgICAgICAgMHgzNAotICogIDM1ICAgICAgICAgOTggICAgICAgICAweDM0Ci0gKiAgMzYgICAgICAgIDExMCAgICAgICAgIDB4MzMKLSAqICAzNyAgICAgICAgMTA0ICAgICAgICAgMHgzMwotICogIDM4ICAgICAgICAgOTggICAgICAgICAweDMzCi0gKiAgMzkgICAgICAgIDExMCAgICAgICAgIDB4MzIKLSAqICA0MCAgICAgICAgMTA0ICAgICAgICAgMHgzMgotICogIDQxICAgICAgICAgOTggICAgICAgICAweDMyCi0gKiAgNDIgICAgICAgIDExMCAgICAgICAgIDB4MzEKLSAqICA0MyAgICAgICAgMTA0ICAgICAgICAgMHgzMQotICogIDQ0ICAgICAgICAgOTggICAgICAgICAweDMxCi0gKiAgNDUgICAgICAgIDExMCAgICAgICAgIDB4MzAKLSAqICA0NiAgICAgICAgMTA0ICAgICAgICAgMHgzMAotICogIDQ3ICAgICAgICAgOTggICAgICAgICAweDMwCi0gKiAgNDggICAgICAgIDExMCAgICAgICAgICAweDYKLSAqICA0OSAgICAgICAgMTA0ICAgICAgICAgIDB4NgotICogIDUwICAgICAgICAgOTggICAgICAgICAgMHg2Ci0gKiAgNTEgICAgICAgIDExMCAgICAgICAgICAweDUKLSAqICA1MiAgICAgICAgMTA0ICAgICAgICAgIDB4NQotICogIDUzICAgICAgICAgOTggICAgICAgICAgMHg1Ci0gKiAgNTQgICAgICAgIDExMCAgICAgICAgICAweDQKLSAqICA1NSAgICAgICAgMTA0ICAgICAgICAgIDB4NAotICogIDU2ICAgICAgICAgOTggICAgICAgICAgMHg0Ci0gKiAgNTcgICAgICAgIDExMCAgICAgICAgICAweDMKLSAqICA1OCAgICAgICAgMTA0ICAgICAgICAgIDB4MwotICogIDU5ICAgICAgICAgOTggICAgICAgICAgMHgzCi0gKiAgNjAgICAgICAgIDExMCAgICAgICAgICAweDIKLSAqICA2MSAgICAgICAgMTA0ICAgICAgICAgIDB4MgotICogIDYyICAgICAgICAgOTggICAgICAgICAgMHgyCi0gKiAgNjMgICAgICAgIDExMCAgICAgICAgICAweDEKLSAqICA2NCAgICAgICAgMTA0ICAgICAgICAgIDB4MQotICogIDY1ICAgICAgICAgOTggICAgICAgICAgMHgxCi0gKiAgNjYgICAgICAgIDExMCAgICAgICAgICAweDAKLSAqICA2NyAgICAgICAgMTA0ICAgICAgICAgIDB4MAotICogIDY4ICAgICAgICAgOTggICAgICAgICAgMHgwCi0gKiAgNjkgICAgICAgICA5NyAgICAgICAgICAgIDAKLSAqICA3MCAgICAgICAgIDk2ICAgICAgICAgICAgMAotICogIDcxICAgICAgICAgOTUgICAgICAgICAgICAwCi0gKiAgNzIgICAgICAgICA5NCAgICAgICAgICAgIDAKLSAqICA3MyAgICAgICAgIDkzICAgICAgICAgICAgMAotICogIDc0ICAgICAgICAgOTIgICAgICAgICAgICAwCi0gKiAgNzUgICAgICAgICA5MSAgICAgICAgICAgIDAKLSAqICA3NiAgICAgICAgIDkwICAgICAgICAgICAgMAotICogIDc3ICAgICAgICAgODkgICAgICAgICAgICAwCi0gKiAgNzggICAgICAgICA4OCAgICAgICAgICAgIDAKLSAqICA3OSAgICAgICAgIDg3ICAgICAgICAgICAgMAotICogIDgwICAgICAgICAgODYgICAgICAgICAgICAwCi0gKiAgODEgICAgICAgICA4NSAgICAgICAgICAgIDAKLSAqICA4MiAgICAgICAgIDg0ICAgICAgICAgICAgMAotICogIDgzICAgICAgICAgODMgICAgICAgICAgICAwCi0gKiAgODQgICAgICAgICA4MiAgICAgICAgICAgIDAKLSAqICA4NSAgICAgICAgIDgxICAgICAgICAgICAgMAotICogIDg2ICAgICAgICAgODAgICAgICAgICAgICAwCi0gKiAgODcgICAgICAgICA3OSAgICAgICAgICAgIDAKLSAqICA4OCAgICAgICAgIDc4ICAgICAgICAgICAgMAotICogIDg5ICAgICAgICAgNzcgICAgICAgICAgICAwCi0gKiAgOTAgICAgICAgICA3NiAgICAgICAgICAgIDAKLSAqICA5MSAgICAgICAgIDc1ICAgICAgICAgICAgMAotICogIDkyICAgICAgICAgNzQgICAgICAgICAgICAwCi0gKiAgOTMgICAgICAgICA3MyAgICAgICAgICAgIDAKLSAqICA5NCAgICAgICAgIDcyICAgICAgICAgICAgMAotICogIDk1ICAgICAgICAgNzEgICAgICAgICAgICAwCi0gKiAgOTYgICAgICAgICA3MCAgICAgICAgICAgIDAKLSAqICA5NyAgICAgICAgIDY5ICAgICAgICAgICAgMAotICogIDk4ICAgICAgICAgNjggICAgICAgICAgICAwCi0gKi8KLQotLyoqCi0gKiA1IEdIeiBnYWluIHRhYmxlCi0gKgotICogSW5kZXggICAgRHNwIGdhaW4gICBSYWRpbyBnYWluCi0gKiAgLTkgCSAgICAgIDEyMyAgICAgICAgIDB4M0YgICAgICAoaGlnaGVzdCBnYWluKQotICogIC04IAkgICAgICAxMTcgICAgICAgICAweDNGCi0gKiAgLTcgICAgICAgIDExMCAgICAgICAgIDB4M0YKLSAqICAtNiAgICAgICAgMTA0ICAgICAgICAgMHgzRgotICogIC01ICAgICAgICAgOTggICAgICAgICAweDNGCi0gKiAgLTQgICAgICAgIDExMCAgICAgICAgIDB4M0UKLSAqICAtMyAgICAgICAgMTA0ICAgICAgICAgMHgzRQotICogIC0yICAgICAgICAgOTggICAgICAgICAweDNFCi0gKiAgLTEgICAgICAgIDExMCAgICAgICAgIDB4M0QKLSAqICAgMCAgICAgICAgMTA0ICAgICAgICAgMHgzRAotICogICAxICAgICAgICAgOTggICAgICAgICAweDNECi0gKiAgIDIgICAgICAgIDExMCAgICAgICAgIDB4M0MKLSAqICAgMyAgICAgICAgMTA0ICAgICAgICAgMHgzQwotICogICA0ICAgICAgICAgOTggICAgICAgICAweDNDCi0gKiAgIDUgICAgICAgIDExMCAgICAgICAgIDB4M0IKLSAqICAgNiAgICAgICAgMTA0ICAgICAgICAgMHgzQgotICogICA3ICAgICAgICAgOTggICAgICAgICAweDNCCi0gKiAgIDggICAgICAgIDExMCAgICAgICAgIDB4M0EKLSAqICAgOSAgICAgICAgMTA0ICAgICAgICAgMHgzQQotICogIDEwICAgICAgICAgOTggICAgICAgICAweDNBCi0gKiAgMTEgICAgICAgIDExMCAgICAgICAgIDB4MzkKLSAqICAxMiAgICAgICAgMTA0ICAgICAgICAgMHgzOQotICogIDEzICAgICAgICAgOTggICAgICAgICAweDM5Ci0gKiAgMTQgICAgICAgIDExMCAgICAgICAgIDB4MzgKLSAqICAxNSAgICAgICAgMTA0ICAgICAgICAgMHgzOAotICogIDE2ICAgICAgICAgOTggICAgICAgICAweDM4Ci0gKiAgMTcgICAgICAgIDExMCAgICAgICAgIDB4MzcKLSAqICAxOCAgICAgICAgMTA0ICAgICAgICAgMHgzNwotICogIDE5ICAgICAgICAgOTggICAgICAgICAweDM3Ci0gKiAgMjAgICAgICAgIDExMCAgICAgICAgIDB4MzYKLSAqICAyMSAgICAgICAgMTA0ICAgICAgICAgMHgzNgotICogIDIyICAgICAgICAgOTggICAgICAgICAweDM2Ci0gKiAgMjMgICAgICAgIDExMCAgICAgICAgIDB4MzUKLSAqICAyNCAgICAgICAgMTA0ICAgICAgICAgMHgzNQotICogIDI1ICAgICAgICAgOTggICAgICAgICAweDM1Ci0gKiAgMjYgICAgICAgIDExMCAgICAgICAgIDB4MzQKLSAqICAyNyAgICAgICAgMTA0ICAgICAgICAgMHgzNAotICogIDI4ICAgICAgICAgOTggICAgICAgICAweDM0Ci0gKiAgMjkgICAgICAgIDExMCAgICAgICAgIDB4MzMKLSAqICAzMCAgICAgICAgMTA0ICAgICAgICAgMHgzMwotICogIDMxICAgICAgICAgOTggICAgICAgICAweDMzCi0gKiAgMzIgICAgICAgIDExMCAgICAgICAgIDB4MzIKLSAqICAzMyAgICAgICAgMTA0ICAgICAgICAgMHgzMgotICogIDM0ICAgICAgICAgOTggICAgICAgICAweDMyCi0gKiAgMzUgICAgICAgIDExMCAgICAgICAgIDB4MzEKLSAqICAzNiAgICAgICAgMTA0ICAgICAgICAgMHgzMQotICogIDM3ICAgICAgICAgOTggICAgICAgICAweDMxCi0gKiAgMzggICAgICAgIDExMCAgICAgICAgIDB4MzAKLSAqICAzOSAgICAgICAgMTA0ICAgICAgICAgMHgzMAotICogIDQwICAgICAgICAgOTggICAgICAgICAweDMwCi0gKiAgNDEgICAgICAgIDExMCAgICAgICAgIDB4MjUKLSAqICA0MiAgICAgICAgMTA0ICAgICAgICAgMHgyNQotICogIDQzICAgICAgICAgOTggICAgICAgICAweDI1Ci0gKiAgNDQgICAgICAgIDExMCAgICAgICAgIDB4MjQKLSAqICA0NSAgICAgICAgMTA0ICAgICAgICAgMHgyNAotICogIDQ2ICAgICAgICAgOTggICAgICAgICAweDI0Ci0gKiAgNDcgICAgICAgIDExMCAgICAgICAgIDB4MjMKLSAqICA0OCAgICAgICAgMTA0ICAgICAgICAgMHgyMwotICogIDQ5ICAgICAgICAgOTggICAgICAgICAweDIzCi0gKiAgNTAgICAgICAgIDExMCAgICAgICAgIDB4MjIKLSAqICA1MSAgICAgICAgMTA0ICAgICAgICAgMHgxOAotICogIDUyICAgICAgICAgOTggICAgICAgICAweDE4Ci0gKiAgNTMgICAgICAgIDExMCAgICAgICAgIDB4MTcKLSAqICA1NCAgICAgICAgMTA0ICAgICAgICAgMHgxNwotICogIDU1ICAgICAgICAgOTggICAgICAgICAweDE3Ci0gKiAgNTYgICAgICAgIDExMCAgICAgICAgIDB4MTYKLSAqICA1NyAgICAgICAgMTA0ICAgICAgICAgMHgxNgotICogIDU4ICAgICAgICAgOTggICAgICAgICAweDE2Ci0gKiAgNTkgICAgICAgIDExMCAgICAgICAgIDB4MTUKLSAqICA2MCAgICAgICAgMTA0ICAgICAgICAgMHgxNQotICogIDYxICAgICAgICAgOTggICAgICAgICAweDE1Ci0gKiAgNjIgICAgICAgIDExMCAgICAgICAgIDB4MTQKLSAqICA2MyAgICAgICAgMTA0ICAgICAgICAgMHgxNAotICogIDY0ICAgICAgICAgOTggICAgICAgICAweDE0Ci0gKiAgNjUgICAgICAgIDExMCAgICAgICAgIDB4MTMKLSAqICA2NiAgICAgICAgMTA0ICAgICAgICAgMHgxMwotICogIDY3ICAgICAgICAgOTggICAgICAgICAweDEzCi0gKiAgNjggICAgICAgIDExMCAgICAgICAgIDB4MTIKLSAqICA2OSAgICAgICAgMTA0ICAgICAgICAgMHgwOAotICogIDcwICAgICAgICAgOTggICAgICAgICAweDA4Ci0gKiAgNzEgICAgICAgIDExMCAgICAgICAgIDB4MDcKLSAqICA3MiAgICAgICAgMTA0ICAgICAgICAgMHgwNwotICogIDczICAgICAgICAgOTggICAgICAgICAweDA3Ci0gKiAgNzQgICAgICAgIDExMCAgICAgICAgIDB4MDYKLSAqICA3NSAgICAgICAgMTA0ICAgICAgICAgMHgwNgotICogIDc2ICAgICAgICAgOTggICAgICAgICAweDA2Ci0gKiAgNzcgICAgICAgIDExMCAgICAgICAgIDB4MDUKLSAqICA3OCAgICAgICAgMTA0ICAgICAgICAgMHgwNQotICogIDc5ICAgICAgICAgOTggICAgICAgICAweDA1Ci0gKiAgODAgICAgICAgIDExMCAgICAgICAgIDB4MDQKLSAqICA4MSAgICAgICAgMTA0ICAgICAgICAgMHgwNAotICogIDgyICAgICAgICAgOTggICAgICAgICAweDA0Ci0gKiAgODMgICAgICAgIDExMCAgICAgICAgIDB4MDMKLSAqICA4NCAgICAgICAgMTA0ICAgICAgICAgMHgwMwotICogIDg1ICAgICAgICAgOTggICAgICAgICAweDAzCi0gKiAgODYgICAgICAgIDExMCAgICAgICAgIDB4MDIKLSAqICA4NyAgICAgICAgMTA0ICAgICAgICAgMHgwMgotICogIDg4ICAgICAgICAgOTggICAgICAgICAweDAyCi0gKiAgODkgICAgICAgIDExMCAgICA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YX1BXUl9UQUJMRV9DTUQgPSAweDk3LAotCi0JLyogQmx1ZXRvb3RoIGRldmljZSBjb2V4aXN0ZW5jZSBjb25maWcgY29tbWFuZCAqLwotCVJFUExZX0JUX0NPTkZJRyA9IDB4OWIsCi0KLQkvKiBTdGF0aXN0aWNzICovCi0JUkVQTFlfU1RBVElTVElDU19DTUQgPSAweDljLAotCVNUQVRJU1RJQ1NfTk9USUZJQ0FUSU9OID0gMHg5ZCwKLQotCS8qIFJGLUtJTEwgY29tbWFuZHMgYW5kIG5vdGlmaWNhdGlvbnMgKi8KLQlDQVJEX1NUQVRFX05PVElGSUNBVElPTiA9IDB4YTEsCi0KLQkvKiBNaXNzZWQgYmVhY29ucyBub3RpZmljYXRpb24gKi8KLQlNSVNTRURfQkVBQ09OU19OT1RJRklDQVRJT04gPSAweGEyLAotCi0JUkVQTFlfQ1RfS0lMTF9DT05GSUdfQ01EID0gMHhhNCwKLQlTRU5TSVRJVklUWV9DTUQgPSAweGE4LAotCVJFUExZX1BIWV9DQUxJQlJBVElPTl9DTUQgPSAweGIwLAotCVJFUExZX1JYX1BIWV9DTUQgPSAweGMwLAotCVJFUExZX1JYX01QRFVfQ01EID0gMHhjMSwKLQlSRVBMWV9SWCA9IDB4YzMsCi0JUkVQTFlfQ09NUFJFU1NFRF9CQSA9IDB4YzUsCi0KLQlSRVBMWV9NQVggPSAweGZmCi19OwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiAoMCkKLSAqIENvbW1vbmx5IHVzZWQgc3RydWN0dXJlcyBhbmQgZGVmaW5pdGlvbnM6Ci0gKiBDb21tYW5kIGhlYWRlciwgcmF0ZV9uX2ZsYWdzLCB0eHBvd2VyCi0gKgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKiBpd2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bjsKLQlfX2xlMTYgY2hhbm5lbDsKLQlfX2xlMzIgcnhvbl9mbGFnczsKLQlfX2xlMzIgcnhvbl9maWx0ZXJfZmxhZ3M7Ci0JX19sZTMyIHN3aXRjaF90aW1lOwotCXN0cnVjdCBpd2w0OTY1X3R4X3Bvd2VyX2RiIHR4X3Bvd2VyOwotfSBfX3BhY2tlZDsKLQotLyoKLSAqIENIQU5ORUxfU1dJVENIX05PVElGSUNBVElPTiA9IDB4NzMgKG5vdGlmaWNhdGlvbiBvbmx5LCBub3QgYSBjb21tYW5kKQotICovCi1zdHJ1Y3QgaXdsX2NzYV9ub3RpZmljYXRpb24gewotCV9fbGUxNiBiYW5kOwotCV9fbGUxNiBjaGFubmVsOwotCV9fbGUzMiBzdGF0dXM7CQkvKiAwIC0gT0ssIDEgLSBmYWlsICovCi19IF9fcGFja2VkOwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiAoMikKLSAqIFF1YWxpdHktb2YtU2VydmljZSAoUU9TKSBDb21tYW5kcyAmIFJlc3BvbnNlczoKLSAqCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qKgotICogc3RydWN0IGl3bF9hY19xb3MgLS0gUU9TIHRpbWluZyBwYXJhbXMgZm9yIFJFUExZX1FPU19QQVJBTQotICogT25lIGZvciBlYWNoIG9mIDQgRURDQSBhY2Nlc3MgY2F0ZWdvcmllcyBpbiBzdHJ1Y3QgaXdsX3Fvc3BhcmFtX2NtZAotICoKLSAqIEBjd19taW46IENvbnRlbnRpb24gd2luZG93LCBzdGFydCB2YWx1ZSBpbiBudW1iZXJzIG9mIHNsb3RzLgotICogICAgICAgICAgU2hvdWxkIGJlIGEgcG93ZXItb2YtMiwgbWludXMgMS4gIERldmljZSdzIGRlZmF1bHQgaXMg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ioqKioKLSAqICgxMikKLSAqIE1pc2NlbGxhbmVvdXMgQ29tbWFuZHM6Ci0gKgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKgotICogTEVEcyBDb21tYW5kICYgUmVzcG9uc2UKLSAqIFJFUExZX0xFRFNfQ01EID0gMHg0OCAoY29tbWFuZCwgaGFzIHNpbXBsZSBnZW5lcmljIHJlc3BvbnNlKQotICoKLSAqIEZvciBlYWNoIG9mIDMgcG9zc2libGUgTEVEcyAoQWN0aXZpdHkvTGluay9UZWNoLCBzZWxlY3RlZCBieSAiaWQiIGZpZWxkKSwKLSAqIHRoaXMgY29tbWFuZCB0dXJucyBpdCBvbiBvciBvZmYsIG9yIHNldHMgdXAgYSBwZXJpb2RpYyBibGlua2luZyBjeWNsZS4KLSAqLwotc3RydWN0IGl3bF9sZWRfY21kIHsKLQlfX2xlMzIgaW50ZXJ2YWw7CS8qICJpbnRlcnZhbCIgaW4gdVNlYyAqLwotCXU4IGlkOwkJCS8qIDE6IEFjdGl2aXR5LCAyOiBMaW5rLCAzOiBUZWNoICovCi0JdTggb2ZmOwkJCS8qICMgaW50ZXJ2YWxzIG9mZiB3aGlsZSBibGlua2luZzsKLQkJCQkgKiAiMCIsIHdpdGggPjAgIm9uIiB2YWx1ZSwgdHVybnMgTEVEIG9uICovCi0JdTggb247CQkJLyogIyBpbnRlcnZhbHMgb24gd2hpbGUgYmxpbmtpbmc7Ci0JCQkJICogIjAiLCByZWdhcmRsZXNzIG9mICJvZmYiLCB0dXJucyBMRUQgb2ZmICovCi0JdTggcmVzZXJ2ZWQ7Ci19IF9fcGFja2VkOwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqICgxMykKLSAqIFVuaW9uIG9mIGFsbCBleHBlY3RlZCBub3RpZmljY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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotaW50IGl3bF9sZWdhY3lfc2V0X3R4X3Bvd2VyKHN0cnVjdCBpd2xfcHJpdiAqcHJpdiwgczggdHhfcG93ZXIsIGJvb2wgZm9yY2UpOwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogUmF0ZQotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdTggaXdsX2xlZ2FjeV9nZXRfbG93ZXN0X3BsY3Aoc3RydWN0IGl3bF9wcml2ICpwcml2LAotCQkJICAgIHN0cnVjdCBpd2xfcnhvbl9jb250ZXh0ICpjdHgpOwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogU2Nhbm5pbmcKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIGl3bF9sZWdhY3lfaW5pdF9zY2FuX3BhcmFtcyhzdHJ1Y3QgaXdsX3ByaXYgKnByaXYpOwotaW50IGl3bF9sZWdhY3lfc2Nhbl9jYW5jZWwoc3RydWN0IGl3bF9wcml2ICpwcml2KTsKLWludCBpd2xfbGVnYWN5X3NjYW5fY2FuY2VsX3RpbWVvdXQoc3RydWN0IGl3bF9wcml2ICpwcml2LCB1bnNpZ25lZCBsb25nIG1zKTsKLXZvaWQgaXdsX2xlZ2FjeV9mb3JjZV9zY2FuX2VuZChzdHJ1Y3QgaXdsX3ByaXYgKnByaXYpOwotaW50IGl3bF9sZWdhY3lfbWFjX2h3X3NjYW4oc3RydWN0IGllZWU4MDIxMV9odyAqaHcsCi0JCSAgICB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LCAxNDksIDE1MywgMTU3LCAxNjEsIDE2NQotfTsKLQotc3RhdGljIGNvbnN0IHU4IGl3bGVnYWN5X2VlcHJvbV9iYW5kXzZbXSA9IHsgICAgICAgLyogMi40IGh0NDAgY2hhbm5lbCAqLwotCTEsIDIsIDMsIDQsIDUsIDYsIDcKLX07Ci0KLXN0YXRpYyBjb25zdCB1OCBpd2xlZ2FjeV9lZXByb21fYmFuZF83W10gPSB7ICAgICAgIC8qIDUuMiBodDQwIGNoYW5uZWwgKi8KLQkzNiwgNDQsIDUyLCA2MCwgMTAwLCAxMDgsIDExNiwgMTI0LCAxMzIsIDE0OSwgMTU3Ci19OwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKgotICogRUVQUk9NIHJlbGF0ZWQgZnVuY3Rpb25zCi0gKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1zdGF0aWMgaW50IGl3bF9sZWdhY3lfZWVwcm9tX3ZlcmlmeV9zaWduYXR1cmUoc3RydWN0IGl3bF9wcml2ICpwcml2KQotewotCXUzMiBncCA9IGl3bF9yZWFkMzIocHJpdiwgQ1NSX0VFUFJPTV9HUCkgJiBDU1JfRUVQUk9NX0dQX1ZBTElEX01TSzsKLQlpbnQgcmV0ID0gMDsKLQotCUlXTF9ERUJVR19FRVBST00ocHJpdiwgIkVFUFJPTSBzaWduYXR1cmU9MHglMDh4XG4iLCBncCk7Ci0Jc3dpdGNoIChncCkgewotCWNhc2UgQ1NSX0VFUFJPTV9HUF9HT09EX1NJR19FRVBfTEVTU19USEFOXzRLOgotCWNhc2UgQ1NSX0VFUFJPTV9HUF9HT09EX1NJR19FRVBfTU9SRV9USEFOXzRLOgotCQlicmVhazsKLQlkZWZhdWx0OgotCQlJV0xfRVJSKHByaXYsICJiYWQgRUVQ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VzIHJ4X2ZyZWUgbGlzdCBmcm9tIHJ4X3VzZWQsIGFuZCBjYWxscwotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgaXdsMzk0NV9yeF9xdWV1ZV9yZXN0b2NrCi0gKiBpd2wzOTQ1X3J4X3F1ZXVlX3Jlc3RvY2soKSBNb3ZlcyBhdmFpbGFibGUgYnVmZmVycyBmcm9tIHJ4X2ZyZWUgaW50byBSeAotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVldWUsIHVwZGF0ZXMgZmlybXdhcmUgcG9pbnRlcnMsIGFuZCB1cGRhdGVzCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgV1JJVEUgaW5kZXguICBJZiBpbnN1ZmZpY2llbnQgcnhfZnJlZSBidWZmZXJzCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmUgYXZhaWxhYmxlLCBzY2hlZHVsZXMgaXdsMzk0NV9yeF9yZXBsZW5pc2gKLSAqCi0gKiAtLSBlbmFibGUgaW50ZXJydXB0cyAtLQotICogSVNSIC0gaXdsMzk0NV9yeCgpICAgICAgICAgRGV0YWNoIGl3bF9yeF9tZW1fYnVmZmVycyBmcm9tIHBvb2wgdXAgdG8gdGhlCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICBSRUFEIElOREVYLCBkZXRhY2hpbmcgdGhlIFNLQiBmcm9tIHRoZSBwb29sLgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgTW92ZXMgdGhlIHBhY2tldCBidWZmZXIgZnJvbSBxdWV1ZSB0byByeF91c2VkLgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2FsbHMgaXdsMzk0NV9yeF9xdWV1ZV9yZXN0b2NrIHRvIHJlZmlsbCBhbnkgZW1wdHkKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNsb3RzLgotICogLi4uCi0gKgotICovCi0KLS8qKgotICogaXdsMzk0NV9kbWFfYWRkcjJyYmRfcHRyIC0gY29udmV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lX2ludGVycnVwdHMocHJpdik7Ci0JLyogUmUtZW5hYmxlIFJGX0tJTEwgaWYgaXQgb2NjdXJyZWQgKi8KLQllbHNlIGlmIChoYW5kbGVkICYgQ1NSX0lOVF9CSVRfUkZfS0lMTCkKLQkJaXdsX2xlZ2FjeV9lbmFibGVfcmZraWxsX2ludChwcml2KTsKLQotI2lmZGVmIENPTkZJR19JV0xXSUZJX0xFR0FDWV9ERUJVRwotCWlmIChpd2xfbGVnYWN5X2dldF9kZWJ1Z19sZXZlbChwcml2KSAmIChJV0xfRExfSVNSKSkgewotCQlpbnRhID0gaXdsX3JlYWQzMihwcml2LCBDU1JfSU5UKTsKLQkJaW50YV9tYXNrID0gaXdsX3JlYWQzMihwcml2LCBDU1JfSU5UX01BU0spOwotCQlpbnRhX2ZoID0gaXdsX3JlYWQzMihwcml2LCBDU1JfRkhfSU5UX1NUQVRVUyk7Ci0JCUlXTF9ERUJVR19JU1IocHJpdiwKLQkJCSJFbmQgaW50YSAweCUwOHgsIGVuYWJsZWQgMHglMDh4LCBmaCAweCUwOHgsICIKLQkJCSJmbGFncyAweCUwOGx4XG4iLCBpbnRhLCBpbnRhX21hc2ssIGludGFfZmgsIGZsYWdzKTsKLQl9Ci0jZW5kaWYKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKgotICogc3lzZnMgYXR0cmlidXRlcwotICoKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2lmZGVmIENPTkZJR19JV0xXSUZJX0xFR0FDWV9ERUJVRwotCi0vKgotICogVGhlIGZvbGxvd2luZyBhZGRzIGEgbmV3IGF0dHJpYnV0ZSB0byB0aGUgc3lzZnMgcmVwcmVzZW50YXRpb24KLSAqIG9mIHRoaXMgZGV2aWNlIGRyaXZlciAoaS5lLi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HJkLT5zdGF0dXMpOwotCV9faXdsX2Rvd24ocHJpdik7Ci0JY2xlYXJfYml0KFNUQVRVU19FWElUX1BFTkRJTkcsICZwcml2LT5zaHJkLT5zdGF0dXMpOwotCi0JSVdMX0VSUihwcml2LCAiVW5hYmxlIHRvIGluaXRpYWxpemUgZGV2aWNlLlxuIik7Ci0JcmV0dXJuIHJldDsKLX0KLQotCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICAqCiAgKiBXb3JrcXVldWUgY2FsbGJhY2tzCkBAIC0xNTAyLDcgKzE0MDEsNyBAQAogCW11dGV4X3VubG9jaygmcHJpdi0+c2hyZC0+bXV0ZXgpOwogfQogCi1zdGF0aWMgdm9pZCBpd2xhZ25fcHJlcGFyZV9yZXN0YXJ0KHN0cnVjdCBpd2xfcHJpdiAqcHJpdikKK3ZvaWQgaXdsYWduX3ByZXBhcmVfcmVzdGFydChzdHJ1Y3QgaXdsX3ByaXYgKnByaXYpCiB7CiAJc3RydWN0IGl3bF9yeG9uX2NvbnRleHQgKmN0eDsKIAlib29sIGJ0X2Z1bGxfY29uY3VycmVudDsKQEAgLTE1NTksMTE3MyArMTQ1OCw4IEBACiAJfQogfQogCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqCi0gKiBtYWM4MDIxMSBlbnRyeSBwb2ludCBmdW5jdGlvbnMKLSAqCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXN0YXRpYyBjb25zdCBzdHJ1Y3QgaWVlZTgwMjExX2lmYWNlX2xpbWl0IGl3bGFnbl9zdGFfYXBfbGltaXRzW10gPSB7Ci0JewotCQkubWF4ID0gMSwKLQkJLnR5cGVzID0gQklUKE5MODAyMT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ZGUgIml3bC1jb3JlLmgiCisjaW5jbHVkZSAiaXdsLWlvLmgiCisjaW5jbHVkZSAiaXdsLWFnbi1jYWxpYi5oIgorI2luY2x1ZGUgIml3bC1hZ24uaCIKKyNpbmNsdWRlICJpd2wtc2hhcmVkLmgiCisjaW5jbHVkZSAiaXdsLWJ1cy5oIgorI2luY2x1ZGUgIml3bC10cmFucy5oIgorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBtYWM4MDIxMSBlbnRyeSBwb2ludCBmdW5jdGlvbnMKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3N0YXRpYyBjb25zdCBzdHJ1Y3QgaWVlZTgwMjExX2lmYWNlX2xpbWl0IGl3bGFnbl9zdGFfYXBfbGltaXRzW10gPSB7CisJeworCQkubWF4ID0gMSwKKwkJLnR5cGVzID0gQklUKE5MODAyMTFfSUZUWVBFX1NUQVRJT04pLAorCX0sCisJeworCQkubWF4ID0gMSwKKwkJLnR5cGVzID0gQklUKE5MODAyMTFfSUZUWVBFX0FQKSwKKwl9LAorfTsKKworc3RhdGljIGNvbnN0IHN0cnVjdCBpZWVlODAyMTFfaWZhY2VfbGltaXQgaXdsYWduXzJzdGFfbGltaXRzW10gPSB7CisJeworCQkubWF4ID0gMiwKKwkJLnR5cGVzID0gQklUKE5MODAyMTFfSUZUWVBFX1NUQVRJT04pLAorCX0sCit9OworCitzdGF0aWMgY29uc3Qgc3RydWN0IGllZWU4MDIxMV9pZmFjZV9saW1pdCBpd2xhZ25fcDJwX3N0YV9nb19saW1pdHNbXSA9IHsKKwl7CisJCS5tYXggPSAxLAorCQkudHlwZXMgPSBCSVQoTkw4MDIxMV9JRlRZUEVfU1RBVElPTiksCisJfSwKKwl7CisJCS5tYXggPSAxLAorCQkudHl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2xvY2soJnByaXYtPnNocmQtPm11dGV4KTsKKworCWlmIChwcml2LT5jb250ZXh0c1tJV0xfUlhPTl9DVFhfQlNTXS52aWYgIT0gdmlmKQorCQlnb3RvIG91dDsKKworCW1lbWNweShwcml2LT5rZWssIGRhdGEtPmtlaywgTkw4MDIxMV9LRUtfTEVOKTsKKwltZW1jcHkocHJpdi0+a2NrLCBkYXRhLT5rY2ssIE5MODAyMTFfS0NLX0xFTik7CisJcHJpdi0+cmVwbGF5X2N0ciA9CisJCWNwdV90b19sZTY0KGJlNjRfdG9fY3B1cCgoX19iZTY0ICopJmRhdGEtPnJlcGxheV9jdHIpKTsKKwlwcml2LT5oYXZlX3Jla2V5X2RhdGEgPSB0cnVlOworCisgb3V0OgorCW11dGV4X3VubG9jaygmcHJpdi0+c2hyZC0+bXV0ZXgpOworCUlXTF9ERUJVR19NQUM4MDIxMShwcml2LCAibGVhdmVcbiIpOworfQorCisjaWZkZWYgQ09ORklHX1BNX1NMRUVQCisKK3N0YXRpYyBpbnQgaXdsYWduX21hY19zdXNwZW5kKHN0cnVjdCBpZWVlODAyMTFfaHcgKmh3LAorCQkJICAgICAgc3RydWN0IGNmZzgwMjExX3dvd2xhbiAqd293bGFuKQoreworCXN0cnVjdCBpd2xfcHJpdiAqcHJpdiA9IGh3LT5wcml2OworCXN0cnVjdCBpd2xfcnhvbl9jb250ZXh0ICpjdHggPSAmcHJpdi0+Y29udGV4dHNbSVdMX1JYT05fQ1RYX0JTU107CisJaW50IHJldDsKKworCWlmIChXQVJOX09OKCF3b3dsYW4pKQorCQlyZXR1cm4gLUVJTlZBTDsKKworCUlXTF9ERUJVR19NQUM4MDIxMShwcml2LCAiZW50ZXJcbiIpOworCW11dGV4X2xvY2soJnByaXYtPnNocmQtPm11dGV4KTsKKworCS8qIERvbid0IGF0dGVtcHQgV29XTEFOIHdoZW4gbm90IGFzc29jaWF0ZWQsIHRlYXIgZG93biBpbnN0ZWFkLiAqLworCWlmICghY3R4LT52aWYgfHwg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RydWN0IHByaXNtMl9ob3N0YXBkX3BhcmFtIHsKLQl1MzIgY21kOwotCXU4IHN0YV9hZGRyW0VUSF9BTEVOXTsKLQl1bmlvbiB7Ci0JICAgICAgIHN0cnVjdCB7Ci0JCSAgICAgICB1OCBhbGdbSE9TVEFQX0NSWVBUX0FMR19OQU1FX0xFTl07Ci0JCSAgICAgICB1MzIgZmxhZ3M7Ci0JCSAgICAgICB1MzIgZXJyOwotCQkgICAgICAgdTggaWR4OwotCQkgICAgICAgdTggc2VxWzhdOyAvKiBzZXF1ZW5jZSBjb3VudGVyIChzZXQ6IFJYLCBnZXQ6IFRYKSAqLwotCQkgICAgICAgdTE2IGtleV9sZW47Ci0JCSAgICAgICB1OCBrZXlbMF07Ci0JCSAgICAgICB9IGNyeXB0OwotICAgICAgICAgICAgICAgc3RydWN0IHsKLSAgICAgICAgICAgICAgICAgICAgICAgdTggbGVuOwotICAgICAgICAgICAgICAgICAgICAgICB1OCBkYXRhWzBdOwotICAgICAgICAgICAgICAgfSBnZW5lcmljX2VsZW07Ci0gICAgICAgICAgICAgICBzdHJ1Y3QgewotI2RlZmluZSBNTE1FX1NUQV9ERUFVVEggMAotI2RlZmluZSBNTE1FX1NUQV9ESVNBU1NPQyAxCi0gICAgICAgICAgICAgICAgICAgICAgIHUxNiBjbWQ7Ci0gICAgICAgICAgICAgICAgICAgICAgIHUxNiByZWFzb25fY29kZTsKLSAgICAgICAgICAgICAgIH0gbWxtZTsKLSAgICAgICAgICAgICAgIHN0cnVjdCB7Ci0gICAgICAgICAgICAgICAgICAgICAgIHU4IHNzaWRfbGVuOwotICAgICAgICAgICAgICAgICAgICAgICB1OCBzc2lkWzMyXTsKLSAgICAgICAgICAgICAgIH0gc2Nhbl9yZXE7Ci0gICAgICAgfSB1OwotfTsKLQotCi1zdGF0aWMgaW50Ci1wcmlzbTJfaW9jdGxfc2V0X2VuY3J5cHRpb24oc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKLQlzdHJ1Y3QgcHJ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YW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwLT5sZW5ndGgpOwotICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgY2FzZSBQUklTTTJfSE9TVEFQRF9NTE1FOgotCSAgICAgICBwcmludGsoS0VSTl9ERUJVRyAiJXM6IENhdWdodCBXUEEgc3VwcGxpY2FudCBNTE1FIHJlcXVlc3RcbiIsCi0JCQkgICAgICAgbmRldi0+bmFtZSk7Ci0gICAgICAgICAgICAgICByZXQgPSBwcmlzbTJfaW9jdGxfbWxtZShuZGV2LCBwYXJhbSk7Ci0gICAgICAgICAgICAgICBicmVhazsKLSAgICAgICBjYXNlIFBSSVNNMl9IT1NUQVBEX1NDQU5fUkVROgotCSAgICAgICBwcmludGsoS0VSTl9ERUJVRyAiJXM6IENhdWdodCBXUEEgc3VwcGxpY2FudCBzY2FuIHJlcXVlc3RcbiIsCi0JCQkgICAgICAgbmRldi0+bmFtZSk7Ci0gICAgICAgICAgICAgICByZXQgPSBwcmlzbTJfaW9jdGxfc2Nhbl9yZXEobmRldiwgcGFyYW0pOwotICAgICAgICAgICAgICAgYnJlYWs7Ci0JY2FzZSBQUklTTTU0X1NFVF9XUEE6Ci0JICAgICAgIHByaW50ayhLRVJOX0RFQlVHICIlczogQ2F1Z2h0IFdQQSBzdXBwbGljYW50IHdwYSBpbml0IHJlcXVlc3RcbiIsCi0JCQkgICAgICAgbmRldi0+bmFtZSk7Ci0JICAgICAgIHV3cnEgPSAxOwotCSAgICAgICByZXQgPSBwcmlzbTU0X3NldF93cGEobmRldiwgTlVMTCwgJnV3cnEsIE5VTEwpOwotCSAgICAgICBicmVhazsKLQljYXNlIFBSSVNNNTRfRFJPUF9VTkVOQ1JZUFRFRDoKLQkgICAgICAgcHJpbnRrKEtFUk5fREVCVUcgIiVzOiBDYXVnaHQgV1BBIGRyb3AgdW5lbmNyeXB0ZWQgcmVxdWVzdFxuIiwKLQkJCSAgICAgICB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fdGltZXJfY3B1X25vdGlmaWVyCit9OworCitzdGF0aWMgaW50IG5taV90aW1lcl9zdGFydCh2b2lkKQoreworCWludCBjcHU7CisKKwlnZXRfb25saW5lX2NwdXMoKTsKKwljdHJfcnVubmluZyA9IDE7CisJZm9yX2VhY2hfb25saW5lX2NwdShjcHUpCisJCW5taV90aW1lcl9zdGFydF9jcHUoY3B1KTsKKwlwdXRfb25saW5lX2NwdXMoKTsKKworCXJldHVybiAwOworfQorCitzdGF0aWMgdm9pZCBubWlfdGltZXJfc3RvcCh2b2lkKQoreworCWludCBjcHU7CisKKwlnZXRfb25saW5lX2NwdXMoKTsKKwlmb3JfZWFjaF9vbmxpbmVfY3B1KGNwdSkKKwkJbm1pX3RpbWVyX3N0b3BfY3B1KGNwdSk7CisJY3RyX3J1bm5pbmcgPSAwOworCXB1dF9vbmxpbmVfY3B1cygpOworfQorCitzdGF0aWMgdm9pZCBubWlfdGltZXJfc2h1dGRvd24odm9pZCkKK3sKKwlzdHJ1Y3QgcGVyZl9ldmVudCAqZXZlbnQ7CisJaW50IGNwdTsKKworCWdldF9vbmxpbmVfY3B1cygpOworCXVucmVnaXN0ZXJfY3B1X25vdGlmaWVyKCZubWlfdGltZXJfY3B1X25iKTsKKwlmb3JfZWFjaF9wb3NzaWJsZV9jcHUoY3B1KSB7CisJCWV2ZW50ID0gcGVyX2NwdShubWlfdGltZXJfZXZlbnRzLCBjcHUpOworCQlpZiAoIWV2ZW50KQorCQkJY29udGludWU7CisJCXBlcmZfZXZlbnRfZGlzYWJsZShldmVudCk7CisJCXBlcl9jcHUobm1pX3RpbWVyX2V2ZW50cywgY3B1KSA9IE5VTEw7CisJCXBlcmZfZXZlbnRfcmVsZWFzZV9rZXJuZWwoZXZlbnQpOworCX0KKworCXB1dF9vbmxpbmVfY3B1cygpOworfQorCitzdGF0aWMgaW50IG5taV90aW1lcl9zZXR1cCh2b2lkKQoreworCWludCBjcHUsIGVycjsKKwl1NjQgcGVyaW9kOworCisJLyogY2x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GF0aWMgc3NpemVfdCBydGxfc2hvd192ZXJzaW9uKHN0cnVjdCBzeXNkZXZfY2xhc3MgKiBkZXYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBzeXNkZXZfY2xhc3NfYXR0cmlidXRlICphdHRyLAorc3RhdGljIHNzaXplX3QgcnRsX3Nob3dfdmVyc2lvbihzdHJ1Y3QgZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBkZXZpY2VfYXR0cmlidXRlICphdHRyLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFyICpidWYpCiB7CiAJcmV0dXJuIHNwcmludGYoYnVmLCAiJWRcbiIsIChpbnQpaW9yZWFkOCgmcnRsX3RhYmxlLT52ZXJzaW9uKSk7CiB9CiAKLXN0YXRpYyBzc2l6ZV90IHJ0bF9zaG93X3N0YXRlKHN0cnVjdCBzeXNkZXZfY2xhc3MgKmRldiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBzeXNkZXZfY2xhc3NfYXR0cmlidXRlICphdHRyLAorc3RhdGljIHNzaXplX3QgcnRsX3Nob3dfc3RhdGUoc3RydWN0IGRldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGRldmljZV9hdHRyaWJ1dGUgKmF0dHIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFyICpidWYpCiB7CiAJcmV0dXJuIHNwcmludGYoYnVmLCAiJWRcbiIsIGlvcmVhZDgoJnJ0bF90YWJsZS0+cnRfc3RhdHVzKSk7CiB9CiAKLXN0YXRpYyBzc2l6ZV90IHJ0bF9zZXRfc3RhdGUoc3RydWN0IHN5c2Rldl9jbGFzcyAqZGV2LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qgc3lzZGV2X2NsYXNzX2F0dHJpYnV0ZSAqYXR0ciwKK3N0YXRpYyBz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XplOyAgICAgIC8qIHNpemUgb2YgZWFjaCBjbWQgYnVmZmVyIGluIGJ5dGVzICovCiAgICAgdTMyICAgICByZXNlcnZlZDE7CiAgICAgdTMyICAgICByZXNlcnZlZDI7CiB9IF9fYXR0cmlidXRlX18oKHBhY2tlZCkpIGdkdGhfcGVyZl9tb2RlczsKZGlmZiAtLWdpdCBhL2RyaXZlcnMvc2NzaS9pcHMuYyBiL2RyaXZlcnMvc2NzaS9pcHMuYwppbmRleCAyMThmNzFhLi5kNzc4OTFlIDEwMDY0NAotLS0gYS9kcml2ZXJzL3Njc2kvaXBzLmMKKysrIGIvZHJpdmVycy9zY3NpL2lwcy5jCkBAIC00NDk0LDcgKzQ0OTQsNyBAQAogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiAgIEluaXRpYWxpemUgYSBDQ0IgdG8gZGVmYXVsdCB2YWx1ZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogQVNTVU1FRCB0byBiZSBjYWxsbGVkIGZyb20gd2l0aGluIGEgbG9jayAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiBBU1NVTUVEIHRvIGJlIGNhbGxlZCBmcm9tIHdpdGhpbiBhIGxvY2sgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIHN0YXRpYyBpcHNfc2NiX3QgKgpkaWZmIC0tZ2l0IGEvZHJpdmVycy9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wJCXwKICAqIHwgUXVldWUgQ29tbWFuZCBhbmQgSU8gdHJhY2luZyB8ICAgICAgIDB4MzAyZSAgICAgICB8ICAgICAweDMwMDggICAgIHwKICAqIHwgRFBDIFRocmVhZCAgICAgICAgICAgICAgICAgICB8ICAgICAgIDB4NDAxYyAgICAgICB8CQl8CiAgKiB8IEFzeW5jIEV2ZW50cyAgICAgICAgICAgICAgICAgfCAgICAgICAweDUwNTkgICAgICAgfAkJfAotICogfCBUaW1lciBSb3V0aW5lcyAgICAgICAgICAgICAgIHwgICAgICAgMHg2MDBkICAgICAgIHwJCXwKKyAqIHwgVGltZXIgUm91dGluZXMgICAgICAgICAgICAgICB8ICAgICAgIDB4NjAxMCAgICAgICB8IDB4NjAwZSwweDYwMGYgIHwKICAqIHwgVXNlciBTcGFjZSBJbnRlcmFjdGlvbnMgICAgICB8ICAgICAgIDB4NzA5ZCAgICAgICB8CQl8Ci0gKiB8IFRhc2sgTWFuYWdlbWVudCAgICAgICAgICAgICAgfCAgICAgICAweDgwNDEgICAgICAgfCAgICAJCXwKKyAqIHwgVGFzayBNYW5hZ2VtZW50ICAgICAgICAgICAgICB8ICAgICAgIDB4ODA0MSAgICAgICB8IDB4ODAwYiAgICAgICAgIHwKICAqIHwgQUVSL0VFSCAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgIDB4OTAwZiAgICAgICB8CQl8CiAgKiB8IFZpcnR1YWwgUG9ydCAgICAgICAgICAgICAgICAgfCAgICAgICAweGEwMDcgICAgICAgfAkJfAotICogfCBJU1A4MlhYIFNwZWNpZmljICAgICAgICAgICAgIHwgICAgICAgMHhiMDUxICAgICAgIHwgICAgCQl8CisgKiB8IElTUDgyWFggU3BlY2lmaWMgICAgICAgICAgICAgfCAgICAgICAweGIwNTIgICAgICAgfCAgICAJCXwKICAqIHwgTXVsdGlRICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgIDB4YzAwYiAgICAgICB8CQl8CiAgKiB8IE1pc2MgICAgICAgICAgICAgICA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VpFICogNjQpCisKK2VudW0geworCUJJTkRFUl9ERUJVR19VU0VSX0VSUk9SICAgICAgICAgICAgID0gMVUgPDwgMCwKKwlCSU5ERVJfREVCVUdfRkFJTEVEX1RSQU5TQUNUSU9OICAgICA9IDFVIDw8IDEsCisJQklOREVSX0RFQlVHX0RFQURfVFJBTlNBQ1RJT04gICAgICAgPSAxVSA8PCAyLAorCUJJTkRFUl9ERUJVR19PUEVOX0NMT1NFICAgICAgICAgICAgID0gMVUgPDwgMywKKwlCSU5ERVJfREVCVUdfREVBRF9CSU5ERVIgICAgICAgICAgICA9IDFVIDw8IDQsCisJQklOREVSX0RFQlVHX0RFQVRIX05PVElGSUNBVElPTiAgICAgPSAxVSA8PCA1LAorCUJJTkRFUl9ERUJVR19SRUFEX1dSSVRFICAgICAgICAgICAgID0gMVUgPDwgNiwKKwlCSU5ERVJfREVCVUdfVVNFUl9SRUZTICAgICAgICAgICAgICA9IDFVIDw8IDcsCisJQklOREVSX0RFQlVHX1RIUkVBRFMgICAgICAgICAgICAgICAgPSAxVSA8PCA4LAorCUJJTkRFUl9ERUJVR19UUkFOU0FDVElPTiAgICAgICAgICAgID0gMVUgPDwgOSwKKwlCSU5ERVJfREVCVUdfVFJBTlNBQ1RJT05fQ09NUExFVEUgICA9IDFVIDw8IDEwLAorCUJJTkRFUl9ERUJVR19GUkVFX0JVRkZFUiAgICAgICAgICAgID0gMVUgPDwgMTEsCisJQklOREVSX0RFQlVHX0lOVEVSTkFMX1JFRlMgICAgICAgICAgPSAxVSA8PCAxMiwKKwlCSU5ERVJfREVCVUdfQlVGRkVSX0FMTE9DICAgICAgICAgICA9IDFVIDw8IDEzLAorCUJJTkRFUl9ERUJVR19QUklPUklUWV9DQVAgICAgICAgICAgID0gMVUgPDwgMTQsCisJQklOREVSX0RFQlVHX0JVRkZFUl9BTExPQ19BU1lOQyAgICAgPSAxVSA8PCAxNSwKK307CitzdGF0aWMgdWludDMyX3QgYmluZGVyX2RlYnVnX21hc2sgPSBC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ZWFrICs9IHJlZi0+d2VhazsKKwl9CisJc2VxX3ByaW50ZihtLCAiICByZWZzOiAlZCBzICVkIHcgJWRcbiIsIGNvdW50LCBzdHJvbmcsIHdlYWspOworCisJY291bnQgPSAwOworCWZvciAobiA9IHJiX2ZpcnN0KCZwcm9jLT5hbGxvY2F0ZWRfYnVmZmVycyk7IG4gIT0gTlVMTDsgbiA9IHJiX25leHQobikpCisJCWNvdW50Kys7CisJc2VxX3ByaW50ZihtLCAiICBidWZmZXJzOiAlZFxuIiwgY291bnQpOworCisJY291bnQgPSAwOworCWxpc3RfZm9yX2VhY2hfZW50cnkodywgJnByb2MtPnRvZG8sIGVudHJ5KSB7CisJCXN3aXRjaCAody0+dHlwZSkgeworCQljYXNlIEJJTkRFUl9XT1JLX1RSQU5TQUNUSU9OOgorCQkJY291bnQrKzsKKwkJCWJyZWFrOworCQlkZWZhdWx0OgorCQkJYnJlYWs7CisJCX0KKwl9CisJc2VxX3ByaW50ZihtLCAiICBwZW5kaW5nIHRyYW5zYWN0aW9uczogJWRcbiIsIGNvdW50KTsKKworCXByaW50X2JpbmRlcl9zdGF0cyhtLCAiICAiLCAmcHJvYy0+c3RhdHMpOworfQorCisKK3N0YXRpYyBpbnQgYmluZGVyX3N0YXRlX3Nob3coc3RydWN0IHNlcV9maWxlICptLCB2b2lkICp1bnVzZWQpCit7CisJc3RydWN0IGJpbmRlcl9wcm9jICpwcm9jOworCXN0cnVjdCBobGlzdF9ub2RlICpwb3M7CisJc3RydWN0IGJpbmRlcl9ub2RlICpub2RlOworCWludCBkb19sb2NrID0gIWJpbmRlcl9kZWJ1Z19ub19sb2NrOworCisJaWYgKGRvX2xvY2spCisJCW11dGV4X2xvY2soJmJpbmRlcl9sb2NrKTsKKworCXNlcV9wdXRzKG0sICJiaW5kZXIgc3RhdGU6XG4iKTsKKworCWlmICghaGxpc3RfZW1wdHkoJmJpbmRlcl9kZWFkX25vZGVzKSkKKwkJc2VxX3B1dHMobSwgImRlYWQgbm9kZ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9vb21fYWRqID0gbWluX2FkajsKKworCXJlYWRfbG9jaygmdGFza2xpc3RfbG9jayk7CisJZm9yX2VhY2hfcHJvY2VzcyhwKSB7CisJCXN0cnVjdCBtbV9zdHJ1Y3QgKm1tOworCQlzdHJ1Y3Qgc2lnbmFsX3N0cnVjdCAqc2lnOworCQlpbnQgb29tX2FkajsKKworCQl0YXNrX2xvY2socCk7CisJCW1tID0gcC0+bW07CisJCXNpZyA9IHAtPnNpZ25hbDsKKwkJaWYgKCFtbSB8fCAhc2lnKSB7CisJCQl0YXNrX3VubG9jayhwKTsKKwkJCWNvbnRpbnVlOworCQl9CisJCW9vbV9hZGogPSBzaWctPm9vbV9hZGo7CisJCWlmIChvb21fYWRqIDwgbWluX2FkaikgeworCQkJdGFza191bmxvY2socCk7CisJCQljb250aW51ZTsKKwkJfQorCQl0YXNrc2l6ZSA9IGdldF9tbV9yc3MobW0pOworCQl0YXNrX3VubG9jayhwKTsKKwkJaWYgKHRhc2tzaXplIDw9IDApCisJCQljb250aW51ZTsKKwkJaWYgKHNlbGVjdGVkKSB7CisJCQlpZiAob29tX2FkaiA8IHNlbGVjdGVkX29vbV9hZGopCisJCQkJY29udGludWU7CisJCQlpZiAob29tX2FkaiA9PSBzZWxlY3RlZF9vb21fYWRqICYmCisJCQkgICAgdGFza3NpemUgPD0gc2VsZWN0ZWRfdGFza3NpemUpCisJCQkJY29udGludWU7CisJCX0KKwkJc2VsZWN0ZWQgPSBwOworCQlzZWxlY3RlZF90YXNrc2l6ZSA9IHRhc2tzaXplOworCQlzZWxlY3RlZF9vb21fYWRqID0gb29tX2FkajsKKwkJbG93bWVtX3ByaW50KDIsICJzZWxlY3QgJWQgKCVzKSwgYWRqICVkLCBzaXplICVkLCB0byBraWxsXG4iLAorCQkJICAgICBwLT5waWQsIHAtPmNvbW0sIG9vbV9hZGosIHRhc2tzaXplKTsKKwl9CisJaWYgKHNlbGVjdGVkKSB7CisJCWxvd21lbV9wcmludCgxLCAic2VuZCBzaWdra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CAgICAgTElORTZfQklUX0NPTlRST0wgICAgICAgICAgIH0sCi0JeyAiUE9EU3R1ZGlvR1giLCAgICJQT0QgU3R1ZGlvIEdYIiwgICAgTElORTZfQklUX1BPRFNUVURJT19HWCwgIExJTkU2X0JJVF9QQ00gICAgICAgICAgICAgICB9LAotCXsgIlBPRFN0dWRpb1VYMSIsICAiUE9EIFN0dWRpbyBVWDEiLCAgIExJTkU2X0JJVF9QT0RTVFVESU9fVVgxLCBMSU5FNl9CSVRfUENNICAgICAgICAgICAgICAgfSwKLQl7ICJQT0RTdHVkaW9VWDIiLCAgIlBPRCBTdHVkaW8gVVgyIiwgICBMSU5FNl9CSVRfUE9EU1RVRElPX1VYMiwgTElORTZfQklUX1BDTSAgICAgICAgICAgICAgIH0sCi0JeyAiUE9EWDMiLCAgICAgICAgICJQT0QgWDMiLCAgICAgICAgICAgTElORTZfQklUX1BPRFgzLCAgICAgICAgIExJTkU2X0JJVF9QQ00gICAgICAgICAgICAgICB9LAotCXsgIlBPRFgzTGl2ZSIsICAgICAiUE9EIFgzIExpdmUiLCAgICAgIExJTkU2X0JJVF9QT0RYM0xJVkUsICAgICBMSU5FNl9CSVRfUENNICAgICAgICAgICAgICAgfSwKLQl7ICJQT0R4dCIsICAgICAgICAgIlBPRHh0IiwgICAgICAgICAgICBMSU5FNl9CSVRfUE9EWFQsICAgICAgICAgTElORTZfQklUX0NPTlRST0xfUENNX0hXTU9OIH0sCi0JeyAiUE9EeHRMaXZlIiwgICAgICJQT0R4dCBMaXZlIiwgICAgICAgTElORTZfQklUX1BPRFhUTElWRSwgICAgIExJTkU2X0JJVF9DT05UUk9MX1BDTV9IV01PTiB9LAotCXsgIlBPRHh0UHJvIiwgICAgICAiUE9EeHQgUHJvIiwgICAgICAgIExJTkU2X0JJVF9QT0RYVFBSTywgICAgICBMSU5FNl9CSVRfQ09OVFJPTF9QQ01fSFdNT04gfSwKLQl7ICJUb25lUG9ydEdYIiwgICAgIlRvbmVQb3J0IEdYIiwgICAgICBMSU5FNl9CSVRfVE9ORVBPUlRfR1gsICAgTElORTZfQklUX1BDTSAgICAgICAgICAgICAgIH0sCi0JeyAiVG9uZVBvcnRVWDEiLCAgICJUb25lUG9ydCBVWDEiLCAgICAgTElORTZfQklUX1RPTkVQT1JUX1VYMSwgIExJTkU2X0JJVF9QQ00gICAgICAgICAgICAgICB9LAotCXsgIlRvbmVQb3J0VVgyIiwgICAiVG9uZVBvcnQgVVgyIiwgICAgIExJTkU2X0JJVF9UT05FUE9SVF9VWDIsICBMSU5FNl9CSVRfUENNICAgICAgICAgICAgICAgfSwKLQl7ICJWYXJpYXgiLCAgICAgICAgIlZhcmlheCBXb3JrYmVuY2giLCBMSU5FNl9CSVRfVkFSSUFYLCAgICAgICAgTElORTZfQklUX0NPTlRST0wgICAgICAgICAgIH0KKwl7IExJTkU2X0JJVF9CQVNTUE9EWFQsICAgICAiQmFzc1BPRHh0IiwgICAgICJCYXNzUE9EeHQiLCAgICAgICAgTElORTZfQklUX0NPTlRST0xfUENNX0hXTU9OIH0sCisJeyBMSU5FNl9CSVRfQkFTU1BPRFhUTElWRSwgIkJhc3NQT0R4dExpdmUiLCAiQmFzc1BPRHh0IExpdmUiLCAgIExJTkU2X0JJVF9DT05UUk9MX1BDTV9IV01PTiB9LAorCXsgTElORTZfQklUX0JBU1NQT0RYVFBSTywgICJCYXNzUE9EeHRQcm8iLCAgIkJhc3NQT0R4dCBQcm8iLCAgICBMSU5FNl9CSVRfQ09OVFJPTF9QQ01fSFdNT04gfSwKKwl7IExJTkU2X0JJVF9HVUlUQVJQT1JULCAgICAiR3VpdGFyUG9ydCIsICAgICJHdWl0YXJQb3J0IiwgICAgICAgTElORTZfQklUX1BDTSAgICAgICAgICAgICAgIH0sCisJeyBMSU5FNl9CSVRfUE9DS0VUUE9ELCAgICAgIlBvY2tldFBPRCIsICAgICAiUG9ja2V0IFBPRCIsICAgICAgIExJTkU2X0JJVF9DT05UUk9MICAgICAgICAgICB9LAorCXsgTElORTZfQklUX1BPREhEMzAwLCAgICAgICJQT0RIRDMwMCIsICAgICAgIlBPRCBIRDMwMCIsICAgICAgICBMSU5FNl9CSVRfQ09OVFJPTF9QQ01fSFdNT04gfSwKKwl7IExJTkU2X0JJVF9QT0RIRDUwMCwgICAgICAiUE9ESEQ1MDAiLCAgICAgICJQT0QgSEQ1MDAiLCAgICAgICAgTElORTZfQklUX0NPTlRST0xfUENNX0hXTU9OIH0sCisJeyBMSU5FNl9CSVRfUE9EU1RVRElPX0dYLCAgIlBPRFN0dWRpb0dYIiwgICAiUE9EIFN0dWRpbyBHWCIsICAgIExJTkU2X0JJVF9QQ00gICAgICAgICAgICAgICB9LAorCXsgTElORTZfQklUX1BPRFNUVURJT19VWDEsICJQT0RTdHVkaW9VWDEiLCAgIlBPRCBTdHVkaW8gVVgxIiwgICBMSU5FNl9CSVRfUENNICAgICAgICAgICAgICAgfSwKKwl7IExJTkU2X0JJVF9QT0RTVFVESU9fVVgyLCAiUE9EU3R1ZGlvVVgyIiwgICJQT0QgU3R1ZGlvIFVYMiIsICAgTElORTZfQklUX1BDTSAgICAgICAgICAgICAgIH0sCisJeyBMSU5FNl9CSVRfUE9EWDMsICAgICAgICAgIlBPRFgzIiwgICAgICAgICAiUE9EIFgzIiwgICAgICAgICAgIExJTkU2X0JJVF9QQ00gICAgICAgICAgICAgICB9LAorCXsgTElORTZfQklUX1BPRFgzTElWRSwgICAgICJQT0RYM0xpdmUiLCAgICAgIlBPRCBYMyBMaXZlIiwgICAgICBMSU5FNl9CSVRfUENNICAgICAgICAgICAgICAgfSwKKwl7IExJTkU2X0JJVF9QT0RYVCwgICAgICAgICAiUE9EeHQiLCAgICAgICAgICJQT0R4dCIsICAgICAgICAgICAgTElORTZfQklUX0NPTlRST0xfUENNX0hXTU9OIH0sCisJeyBMSU5FNl9CSVRfUE9EWFRMSVZFLCAgICAgIlBPRHh0TGl2ZSIsICAgICAiUE9EeHQgTGl2ZSIsICAgICAgIExJTkU2X0JJVF9DT05UUk9MX1BDTV9IV01PTiB9LAorCXsgTElORTZfQklUX1BPRFhUUFJPLCAgICAgICJQT0R4dFBybyIsICAgICAgIlBPRHh0IFBybyIsICAgICAgICBMSU5FNl9CSVRfQ09OVFJPTF9QQ01fSFdNT04gfSwKKwl7IExJTkU2X0JJVF9UT05FUE9SVF9HWCwgICAiVG9uZVBvcnRHWCIsICAgICJUb25lUG9ydCBHWCIsICAgICAgTElORTZfQklUX1BDTSAgICAgICAgICAgICAgIH0sCisJeyBMSU5FNl9CSVRfVE9ORVBPUlRfVVgxLCAgIlRvbmVQb3J0VVgxIiwgICAiVG9uZVBvcnQgVVgxIiwgICAgIExJTkU2X0JJVF9QQ00gICAgICAgICAgICAgICB9LAorCXsgTElORTZfQklUX1RPTkVQT1JUX1VYMiwgICJUb25lUG9ydFVYMiIsICAgIlRvbmVQb3J0IFVYMiIsICAgICBMSU5FNl9CSVRfUENNICAgICAgICAgICAgICAgfSwKKwl7IExJTkU2X0JJVF9WQVJJQVgsICAgICAgICAiVmFyaWF4IiwgICAgICAgICJWYXJpYXggV29ya2JlbmNoIiwgTElORTZfQklUX0NPTlRST0wgICAgICAgICAgIH0sCiB9OwogLyogKklOREVOVC1PTiogKi8KIApAQCAtNDM3LDYgKzQ0MiwxMCBAQAogCQkJCQkJICBsaW5lNik7CiAJCQlicmVhazsKIAorCQljYXNlIExJTkU2X0RFVklEX1BPREhEMzAwOgorCQljYXNlIExJTkU2X0RFVklEX1BPREhENTAwOgorCQkJYnJlYWs7IC8qIGxldCB1c2Vyc3BhY2UgaGFuZGxlIE1JREkgKi8KKwogCQljYXNlIExJTkU2X0RFVklEX1BPRFhUTElWRToKIAkJCXN3aXRjaCAobGluZTYtPmludGVyZmFjZV9udW1iZXIpIHsKIAkJCWNhc2UgUE9EWFRMSVZFX0lOVEVSRkFDRV9QT0Q6CkBAIC03MjAsOCArNzI5LDggQEAKIAkJICAgICAgIGNvbnN0IHN0cnVjdCB1c2JfZGV2aWNlX2lkICppZCkKIHsKIA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lICoqcGFnZXMsCisJCXVpbnQzMl90IG5wYWdlcywgdWludDMyX3Qgcm9sbCwgYm9vbCB3YWl0KQoreworCWludCByZXQgPSAwOworCXN0cnVjdCB0Y21fYXJlYSBzbGljZSwgYXJlYV9zOworCXN0cnVjdCBkbW1fdHhuICp0eG47CisKKwl0eG4gPSBkbW1fdHhuX2luaXQob21hcF9kbW0sIGFyZWEtPnRjbSk7CisJaWYgKElTX0VSUl9PUl9OVUxMKHR4bikpCisJCXJldHVybiBQVFJfRVJSKHR4bik7CisKKwl0Y21fZm9yX2VhY2hfc2xpY2Uoc2xpY2UsICphcmVhLCBhcmVhX3MpIHsKKwkJc3RydWN0IHBhdF9hcmVhIHBfYXJlYSA9IHsKKwkJCQkueDAgPSBzbGljZS5wMC54LCAgLnkwID0gc2xpY2UucDAueSwKKwkJCQkueDEgPSBzbGljZS5wMS54LCAgLnkxID0gc2xpY2UucDEueSwKKwkJfTsKKworCQlyZXQgPSBkbW1fdHhuX2FwcGVuZCh0eG4sICZwX2FyZWEsIHBhZ2VzLCBucGFnZXMsIHJvbGwpOworCQlpZiAocmV0KQorCQkJZ290byBmYWlsOworCisJCXJvbGwgKz0gdGNtX3NpemVvZihzbGljZSk7CisJfQorCisJcmV0ID0gZG1tX3R4bl9jb21taXQodHhuLCB3YWl0KTsKKworZmFpbDoKKwlyZXR1cm4gcmV0OworfQorCisvKgorICogUGluL3VucGluCisgKi8KKworLyogbm90ZTogc2xvdHMgZm9yIHdoaWNoIHBhZ2VzW2ldID09IE5VTEwgYXJlIGZpbGxlZCB3LyBkdW1teSBwYWdlCisgKi8KK2ludCB0aWxlcl9waW4oc3RydWN0IHRpbGVyX2Jsb2NrICpibG9jaywgc3RydWN0IHBhZ2UgKipwYWdlcywKKwkJdWludDMyX3QgbnBhZ2VzLCB1aW50MzJfdCByb2xsLCBib29sIHdhaXQpCit7CisJaW50IHJldDsKKworCXJldCA9IGZpbGwoJmJsb2NrLT5hcmVhLCBwYWdlcywgbnBhZ2V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nICovCisJaWYgKG9yaWVudCAmIE1BU0tfWF9JTlZFUlQpCisJCXggXj0geF9tYXNrOworCWlmIChvcmllbnQgJiBNQVNLX1lfSU5WRVJUKQorCQl5IF49IHlfbWFzazsKKworCS8qIGdldCBjb29yZGluYXRlIGFkZHJlc3MgKi8KKwlpZiAob3JpZW50ICYgTUFTS19YWV9GTElQKQorCQl0bXAgPSAoKHggPDwgeV9iaXRzKSArIHkpOworCWVsc2UKKwkJdG1wID0gKCh5IDw8IHhfYml0cykgKyB4KTsKKworCXJldHVybiBUSUxfQUREUigodG1wIDw8IGFsaWdubWVudCksIG9yaWVudCwgZm10KTsKK30KKworZG1hX2FkZHJfdCB0aWxlcl9zc3B0cihzdHJ1Y3QgdGlsZXJfYmxvY2sgKmJsb2NrKQoreworCUJVR19PTighdmFsaWRmbXQoYmxvY2stPmZtdCkpOworCisJcmV0dXJuIFRJTFZJRVdfOEJJVCArIHRpbGVyX2dldF9hZGRyZXNzKDAsIGJsb2NrLT5mbXQsCisJCQlibG9jay0+YXJlYS5wMC54ICogZ2VvbVtibG9jay0+Zm10XS5zbG90X3csCisJCQlibG9jay0+YXJlYS5wMC55ICogZ2VvbVtibG9jay0+Zm10XS5zbG90X2gpOworfQorCit2b2lkIHRpbGVyX2FsaWduKGVudW0gdGlsZXJfZm10IGZtdCwgdWludDE2X3QgKncsIHVpbnQxNl90ICpoKQoreworCUJVR19PTighdmFsaWRmbXQoZm10KSk7CisJKncgPSByb3VuZF91cCgqdywgZ2VvbVtmbXRdLnNsb3Rfdyk7CisJKmggPSByb3VuZF91cCgqaCwgZ2VvbVtmbXRdLnNsb3RfaCk7Cit9CisKK3VpbnQzMl90IHRpbGVyX3N0cmlkZShlbnVtIHRpbGVyX2ZtdCBmbXQpCit7CisJQlVHX09OKCF2YWxpZGZtdChmbXQpKTsKKworCXJldHVybiAxIDw8IChDT05UX1dJRFRIX0JJVFMgKyBnZW9tW2ZtdF0ueV9zaGZ0KTsKK30KKworc2l6ZV90IHRp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cmVlKSAgICAgIChzdHJ1Y3QgdGNtICp0Y20sIHN0cnVjdCB0Y21fYXJlYSAqYXJlYSk7CisJdm9pZCAoKmRlaW5pdCkgICAoc3RydWN0IHRjbSAqdGNtKTsKK307CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgICBCQVNJQyBUSUxFUiBDT05UQUlORVIgTUFOQUdFUiBJTlRFUkZBQ0UKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyoKKyAqIE5PVEU6CisgKgorICogU2luY2Ugc29tZSBiYXNpYyBwYXJhbWV0ZXIgY2hlY2tpbmcgaXMgZG9uZSBvdXRzaWRlIHRoZSBUQ00gYWxnb3JpdGhtcywKKyAqIFRDTSBpbXBsZW1lbnRhdGlvbiBkbyBOT1QgaGF2ZSB0byBjaGVjayB0aGUgZm9sbG93aW5nOgorICoKKyAqICAgYXJlYSBwb2ludGVyIGlzIE5VTEwKKyAqICAgd2lkdGggYW5kIGhlaWdodCBmaXRzIHdpdGhpbiBjb250YWluZXIKKyAqICAgbnVtYmVyIG9mIHBhZ2VzIGlzIG1vcmUgdGhhbiB0aGUgc2l6ZSBvZiB0aGUgY29udGFpbmVyCisgKgorICovCisKK3N0cnVjdCB0Y20gKnNpdGFfaW5pdCh1MTYgd2lkdGgsIHUxNiBoZWlnaHQsIHN0cnVjdCB0Y21fcHQgKmF0dHIpOworCisKKy8qKgorICogRGVpbml0aWFsaXplIHRpbGVyIGNvbnRhaW5lciBtYW5hZ2VyLgorICoKKyAqIEBwYXJhbSB0Y20JUG9pbnRlciB0byBjb250YWluZXIgbWFuYWdlci4KKyAqCisgKiBAcmV0dXJuIDAgb24gc3VjY2Vzcywgbm9uLTAgZXJyb3IgdmFsdWUgb24gZXJyb3IuICBUaGUgY2FsbAorICoJICA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IHBjaV9kcml2ZXIgcnRsODE5Ml9wY2lfZHJpdmVyID0geworCS5uYW1lID0gRFJWX05BTUUsCS8qIERyaXZlciBuYW1lICAgKi8KKwkuaWRfdGFibGUgPSBydGw4MTkyX3BjaV9pZF90YmwsCS8qIFBDSV9JRCB0YWJsZSAgKi8KKwkucHJvYmUJPSBydGw4MTkyX3BjaV9wcm9iZSwJLyogcHJvYmUgZm4gICAgICAqLworCS5yZW1vdmUJID0gX19kZXZleGl0X3AocnRsODE5Ml9wY2lfZGlzY29ubmVjdCksCS8qIHJlbW92ZSBmbiAqLworCS5zdXNwZW5kID0gcnRsODE5MkVfc3VzcGVuZCwJLyogUE0gc3VzcGVuZCBmbiAqLworCS5yZXN1bWUgPSBydGw4MTkyRV9yZXN1bWUsICAgICAgICAgICAgICAgICAvKiBQTSByZXN1bWUgZm4gICovCit9OworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1JTyBTVFVGRi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RhdGljIGJvb2wgUGxhdGZvcm1JT0NoZWNrUGFnZUxlZ2FsQW5kR2V0UmVnTWFzayh1MzIgdTRiUGFnZSwgdTggKnB1MWJQYWdlTWFzaykKK3sKKwlib29sCQliUmV0dXJuID0gZmFsc2U7CisKKwkqcHUxYlBhZ2VNYXNrID0gMHhmZTsKKworCXN3aXRjaCAodTRiUGFnZSkgeworCWNhc2UgMTogY2FzZSAyOiBjYXNlIDM6IGNhc2UgNDoKKwljYXNlIDg6IGNhc2UgOTogY2FzZSAxMDogY2FzZSAxMjogY2FzZSAxMzoKKwkJYlJldHVybiA9IHRydWU7CisJCSpwdTFiUG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T5pcnEsICh2b2lkICopcnRsODE5Ml9pbnRlcnJ1cHRfcnNsLCBJUlFGX1NIQVJFRCwKKwkgICAgZGV2LT5uYW1lLCBkZXYpKSB7CisJCXByaW50ayhLRVJOX0VSUiAiRXJyb3IgYWxsb2NhdGluZyBJUlEgJWQiLCBkZXYtPmlycSk7CisJCXJldHVybiAtMTsKKwl9IGVsc2UgeworCQlwcml2LT5pcnEgPSBkZXYtPmlycTsKKwkJUlRfVFJBQ0UoQ09NUF9JTklULCAiSVJRICVkXG4iLCBkZXYtPmlycSk7CisJfQorCisJaWYgKHJ0bDgxOTJfcGNpX2luaXRkZXNjcmluZyhkZXYpICE9IDApIHsKKwkJcHJpbnRrKEtFUk5fRVJSICJFbmRvcG9pbnRzIGluaXRpYWxpemF0aW9uIGZhaWxlZCIpOworCQlmcmVlX2lycShkZXYtPmlycSwgZGV2KTsKKwkJcmV0dXJuIC0xOworCX0KKworCXJldHVybiAwOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisJLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVdBVENIRE9HIFNUVUZGLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzaG9ydCBydGw4MTkyX2lzX3R4X3F1ZXVlX2VtcHR5KHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpCit7CisJaW50IGkgPSAwOworCXN0cnVjdCByODE5Ml9wcml2ICpwcml2ID0gcnRsbGliX3ByaXYoZGV2KTsKKwlmb3IgKGkgPSAwOyBpIDw9IE1HTlRfUVVFVUU7IGkrKykgeworCQlpZiAoKGkgPT0gVFhDTURfUVVFVUUpIHx8IChpID09IEhDQ0FfUVVFVUUpKQorCQkJY29udGludWU7CisJCWlmIChza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ygpXG4iKTsKK30KKwordm9pZCB3YXRjaF9kb2dfdGltZXJfY2FsbGJhY2sodW5zaWduZWQgbG9uZyBkYXRhKQoreworCXN0cnVjdCByODE5Ml9wcml2ICpwcml2ID0gcnRsbGliX3ByaXYoKHN0cnVjdCBuZXRfZGV2aWNlICopZGF0YSk7CisJcXVldWVfZGVsYXllZF93b3JrX3JzbChwcml2LT5wcml2X3dxLCAmcHJpdi0+d2F0Y2hfZG9nX3dxLCAwKTsKKwltb2RfdGltZXIoJnByaXYtPndhdGNoX2RvZ190aW1lciwgamlmZmllcyArCisJCSAgTVNFQ1MoUlRMTElCX1dBVENIX0RPR19USU1FKSk7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSBOSUMgVFgvUlggU1RVRkYtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwordm9pZCBydGw4MTkyX3J4X2VuYWJsZShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2KQoreworCXN0cnVjdCByODE5Ml9wcml2ICpwcml2ID0gKHN0cnVjdCByODE5Ml9wcml2ICopcnRsbGliX3ByaXYoZGV2KTsKKwlwcml2LT5vcHMtPnJ4X2VuYWJsZShkZXYpOworfQorCit2b2lkIHJ0bDgxOTJfdHhfZW5hYmxlKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpCit7CisJc3RydWN0IHI4MTkyX3ByaXYgKnByaXYgPSAoc3RydWN0IHI4MTkyX3ByaXYgKilydGxsaWJfcHJpdihkZXYpOworCisJcHJpdi0+b3BzLT50eF9lbmFibGUoZGV2KTsKKworCXJ0bGxpYl9yZXNldF9xdWV1ZShwcml2LT5ydGxsaWIpOworfQ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iAxKQorCQlydGw4MTkyX3J4X2NtZChwcml2LT5ydGxsaWItPmRldik7CisKKwl3cml0ZV9uaWNfZHdvcmQocHJpdi0+cnRsbGliLT5kZXYsIElOVEFfTUFTSywKKwkJCXJlYWRfbmljX2R3b3JkKHByaXYtPnJ0bGxpYi0+ZGV2LCBJTlRBX01BU0spIHwgSU1SX1JEVSk7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSBOSUMgU1RBUlQvQ0xPU0UgU1RVRkYtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwordm9pZCBydGw4MTkyX2NhbmNlbF9kZWZlcnJlZF93b3JrKHN0cnVjdCByODE5Ml9wcml2ICpwcml2KQoreworCWNhbmNlbF9kZWxheWVkX3dvcmsoJnByaXYtPndhdGNoX2RvZ193cSk7CisJY2FuY2VsX2RlbGF5ZWRfd29yaygmcHJpdi0+dXBkYXRlX2JlYWNvbl93cSk7CisJY2FuY2VsX2RlbGF5ZWRfd29yaygmcHJpdi0+cnRsbGliLT5od19zbGVlcF93cSk7CisJY2FuY2VsX3dvcmtfc3luYygmcHJpdi0+cmVzZXRfd3EpOworCWNhbmNlbF93b3JrX3N5bmMoJnByaXYtPnFvc19hY3RpdmF0ZSk7Cit9CisKK2ludCBfcnRsODE5Ml91cChzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LCBib29sIGlzX3NpbGVudF9yZXNldCkKK3sKKwlpZiAoX3J0bDgxOTJfc3RhX3VwKGRldiwgaXNfc2lsZW50X3Jlc2V0KSA9PSAtMSkKKwkJcmV0dXJuIC0xOworCXJldHVybiAwOworfQorCisKK3N0YXRpYyBpbnQgcnRsOD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XYtPmlycV90aF9sb2NrLCBmbGFncyk7CisKKwlwcml2LT5vcHMtPmludGVycnVwdF9yZWNvZ25pemVkKGRldiwgJmludGEsICZpbnRiKTsKKwlwcml2LT5zdGF0cy5zaGludHMrKzsKKworCWlmICghaW50YSkgeworCQlzcGluX3VubG9ja19pcnFyZXN0b3JlKCZwcml2LT5pcnFfdGhfbG9jaywgZmxhZ3MpOworCQlnb3RvIGRvbmU7CisJfQorCisJaWYgKGludGEgPT0gMHhmZmZmKSB7CisJCXNwaW5fdW5sb2NrX2lycXJlc3RvcmUoJnByaXYtPmlycV90aF9sb2NrLCBmbGFncyk7CisJCWdvdG8gZG9uZTsKKwl9CisKKwlwcml2LT5zdGF0cy5pbnRzKys7CisKKwlpZiAoIW5ldGlmX3J1bm5pbmcoZGV2KSkgeworCQlzcGluX3VubG9ja19pcnFyZXN0b3JlKCZwcml2LT5pcnFfdGhfbG9jaywgZmxhZ3MpOworCQlnb3RvIGRvbmU7CisJfQorCisJaWYgKGludGEgJiBJTVJfVEJET0spIHsKKwkJUlRfVFJBQ0UoQ09NUF9JTlRSLCAiYmVhY29uIG9rIGludGVycnVwdCFcbiIpOworCQlwcml2LT5zdGF0cy50eGJlYWNvbm9raW50Kys7CisJfQorCisJaWYgKGludGEgJiBJTVJfVEJERVIpIHsKKwkJUlRfVFJBQ0UoQ09NUF9JTlRSLCAiYmVhY29uIG9rIGludGVycnVwdCFcbiIpOworCQlwcml2LT5zdGF0cy50eGJlYWNvbmVycisrOworCX0KKworCWlmIChpbnRhICYgSU1SX0JET0spCisJCVJUX1RSQUNFKENPTVBfSU5UUiwgImJlYWNvbiBpbnRlcnJ1cHQhXG4iKTsKKworCWlmIChpbnRhICAmIElNUl9NR05URE9LKSB7CisJCVJUX1RSQUNFKENPTVBfSU5UUiwgIk1hbmFnZSBvayBpbnRlcnJ1cHQhXG4iKTsKKwkJcHJpdi0+c3RhdHMudHhtYW5hZ2Vva2ludCsrOworCQlydGw4MTkyX3R4X2lzcihkZ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pb2tpbnQrKzsKKwkJcHJpdi0+cnRsbGliLT5MaW5rRGV0ZWN0SW5mby5OdW1UeE9rSW5QZXJpb2QrKzsKKwkJcnRsODE5Ml90eF9pc3IoZGV2LCBWSV9RVUVVRSk7CisJfQorCisJaWYgKGludGEgJiBJTVJfVk9ET0spIHsKKwkJcHJpdi0+c3RhdHMudHh2b29raW50Kys7CisJCVJUX1RSQUNFKENPTVBfSU5UUiwgIlZvIFRYIE9LIGludGVycnVwdCFcbiIpOworCQlwcml2LT5ydGxsaWItPkxpbmtEZXRlY3RJbmZvLk51bVR4T2tJblBlcmlvZCsrOworCQlydGw4MTkyX3R4X2lzcihkZXYsIFZPX1FVRVVFKTsKKwl9CisKKwlzcGluX3VubG9ja19pcnFyZXN0b3JlKCZwcml2LT5pcnFfdGhfbG9jaywgZmxhZ3MpOworCitkb25lOgorCisJcmV0dXJuIElSUV9IQU5ETEVEOworfQorCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKwktLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tIFBDSV9TVFVGRi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgY29uc3Qgc3RydWN0IG5ldF9kZXZpY2Vfb3BzIHJ0bDgxOTJfbmV0ZGV2X29wcyA9IHsKKwkubmRvX29wZW4gPSBydGw4MTkyX29wZW4sCisJLm5kb19zdG9wID0gcnRsODE5Ml9jbG9zZSwKKwkubmRvX3R4X3RpbWVvdXQgPSBydGw4MTkyX3R4X3RpbWVvdXQsCisJLm5kb19kb19pb2N0bCA9IHJ0bDgxOTJfaW9jdGwsCisJLm5kb19zZXRfcnhfbW9kZSA9IHI4MTkyX3NldF9tdWx0aWNhc3QsCisJLm5k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k1pbjsKKwl1OAkJa2VlcEFsaXZlTGV2ZWw7CisKKwlib29sCQlzd19yYWRpb19vbjsKKwlib29sCQliSHdSYWRpb09mZjsKKwlib29sCQlwd3Jkb3duOworCWJvb2wJCWJsaW5rZWRfaW5ncGlvOworCXU4CQlwb2xsaW5nX3RpbWVyX29uOworCisJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKwllbnVtIGNhcmRfdHlwZSB7CisJCVBDSSwgTUlOSVBDSSwKKwkJQ0FSREJVUywgVVNCCisJfSBjYXJkX3R5cGU7CisKKwlzdHJ1Y3Qgd29ya19zdHJ1Y3QgcW9zX2FjdGl2YXRlOworCisJdTggYklic3NDb29yZGluYXRvcjsKKworCXNob3J0CXByb21pc2M7CisJc2hvcnQJY3JjbW9uOworCisJaW50IHR4YmVhY29uY291bnQ7CisKKwlzaG9ydAljaGFuOworCXNob3J0CXNlbnM7CisJc2hvcnQJbWF4X3NlbnM7CisJdTMyIHJ4X3ByZXZsZW47CisKKwl1OCBTY2FuRGVsYXk7CisJYm9vbCBwc19mb3JjZTsKKworCXUzMiBpcnFfbWFza1syXTsKKworCXU4IFJmX01vZGU7CisJZW51bSBuaWNfdCBjYXJkXzgxOTI7CisJdTggY2FyZF84MTkyX3ZlcnNpb247CisKKwlzaG9ydAllbmFibGVfZ3BpbzA7CisKKwl1OCByZl90eXBlOworCXU4IElDX0N1dDsKKwljaGFyIG5pY2tbSVdfRVNTSURfTUFYX1NJWkUgKyAxXTsKKworCXU4IFJlZ0JjbkN0cmxWYWw7CisJYm9vbCBiSHdBbnREaXY7CisKKwlib29sIGJUS0lQaW5ObW9kZUZyb21SZWc7CisJYm9vbCBiV0VQaW5ObW9kZUZyb21SZWc7CisKKwlib29sIGJMZWRPcGVuRHJhaW47CisKKwl1OCBjaGVja19yb2FtaW5nX2NudDsKKworCWJvb2wgYklnbm9yZVNpbGVudFJlc2V0OworCXUzMiBTaWxlbnRSZ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TEwLCBVU0EKKyAqCisgKiBUaGUgZnVsbCBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBpcyBpbmNsdWRlZCBpbiB0aGlzIGRpc3RyaWJ1dGlvbiBpbiB0aGUKKyAqIGZpbGUgY2FsbGVkIExJQ0VOU0UuCisgKgorICogQ29udGFjdCBJbmZvcm1hdGlvbjoKKyAqIHdsYW5mYWUgPHdsYW5mYWVAcmVhbHRlay5jb20+CisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaW5jbHVkZSAicnRsX2NvcmUuaCIKKyNpbmNsdWRlICJyODE5MkVfcGh5LmgiCisjaW5jbHVkZSAicjgxOTJFX3BoeXJlZy5oIgorI2luY2x1ZGUgInI4MTkwUF9ydGw4MjU2LmgiIC8qIFJUTDgyMjUgUmFkaW8gZnJvbnRlbmQgKi8KKyNpbmNsdWRlICJyODE5MkVfY21kcGt0LmgiCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVBST0NGUyBTVFVGRi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLypUaGlzIHBhcnQgaXMgcmVsYXRlZCB0byBQUk9DLCB3aGljaCB3aWxsIHJlY29yZCBzb21lIHN0YXRpc3RpY3MuICovCitzdGF0aWMgc3RydWN0IHByb2NfZGlyX2VudHJ5ICpydGw4MTkyX3Byb2M7CisKK3N0YXRpYyBpbnQgcHJvY19nZXRfc3RhdHNfYXAoY2hhciAqcGFnZSwgY2hhciAqKnN0YXJ0LAorCQkJICBvZmZfdCBvZmZzZXQsIGludCBjb3VudCwKKwkJCSAgaW50ICplb2YsIHZvaWQgKmRhdGEpCit7CisJc3RydWN0IG5ldF9kZXZpY2UgKmRldiA9IGRhdGE7CisJc3RydWN0IHI4MTkyX3ByaXYgKnByaXYgPSAoc3RydWN0IHI4MTkyX3ByaXYgKilydGxsaWJfcHJpdihkZXYpOworCXN0cnVjdCBydGxsaWJfZGV2aWNlICppZWVlID0gcHJpdi0+cnRsbGliOworCXN0cnVjdCBydGxsaWJfbmV0d29yayAqdGFyZ2V0OworCWludCBsZW4gPSAwOworCisJbGlzdF9mb3JfZWFjaF9lbnRyeSh0YXJnZXQsICZpZWVlLT5uZXR3b3JrX2xpc3QsIGxpc3QpIHsKKworCQlsZW4gKz0gc25wcmludGYocGFnZSArIGxlbiwgY291bnQgLSBsZW4sCisJCQkJIiVzICIsIHRhcmdldC0+c3NpZCk7CisKKwkJaWYgKHRhcmdldC0+d3BhX2llX2xlbiA+IDAgfHwgdGFyZ2V0LT5yc25faWVfbGVuID4gMCkKKwkJCWxlbiArPSBzbnByaW50ZihwYWdlICsgbGVuLCBjb3VudCAtIGxlbiwKKwkJCQkJIldQQVxuIik7CisJCWVsc2UKKwkJCWxlbiArPSBzbnByaW50ZihwYWdlICsgbGVuLCBjb3VudCAtIGxlbiwKKwkJCQkJIm5vbl9XUEFcbiIpOworCisJfQorCisJKmVvZiA9IDE7CisJcmV0dXJuIGxlbjsKK30KKworc3RhdGljIGludCBwcm9jX2dldF9yZWdpc3RlcnNfMChjaGFyICpwYWdlLCBjaGFyICoqc3RhcnQsCisJCQkgIG9mZl90IG9mZnNldCwgaW50IGNvdW50LAorCQkJICBpbnQgKmVvZiwgdm9pZCAqZGF0YSkKK3sKKwlzdHJ1Y3QgbmV0X2RldmljZSAqZGV2ID0gZGF0YTsKKworCWludCBsZW4gPSAwOworCWludCBpLCBuLCBwYWdlMDsKKworCWludCBtYXggPSAweGZmOworCXBhZ2UwID0gMHgwMDA7CisKKwlsZW4gKz0gc25wcmludGYocGFnZSArIGxlb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Z2V0X2NvbW1hbmQgPSAwOworCXUzMiB0YXJnZXRfY29udGVudCA9IDA7CisJdTggZW50cnlfaSA9IDA7CisJdTMyIHVsU3RhdHVzOworCWludCBsZW4gPSAwOworCWludCBpID0gMTAwLCBqID0gMDsKKworCS8qIFRoaXMgZHVtcCB0aGUgY3VycmVudCByZWdpc3RlciBwYWdlICovCisJbGVuICs9IHNucHJpbnRmKHBhZ2UgKyBsZW4sIGNvdW50IC0gbGVuLAorCQkJIlxuIyMjIyMjIyMjIyMjIyMjIyMjIyMgU0VDVVJJVFkgQ0FNICgxMS0yMSkgIgorCQkJIiMjIyMjIyMjIyMjIyMjIyMjI1xuICIpOworCWZvciAoaiA9IDExOyBqIDwgMjI7IGorKykgeworCQlsZW4gKz0gc25wcmludGYocGFnZSArIGxlbiwgY291bnQgLSBsZW4sICJcbkQ6ICAlMnggPiAiLCBqKTsKKwkJZm9yIChlbnRyeV9pID0gMDsgZW50cnlfaSA8IENBTV9DT05URU5UX0NPVU5UOyBlbnRyeV9pKyspIHsKKwkJCXRhcmdldF9jb21tYW5kID0gZW50cnlfaSArIENBTV9DT05URU5UX0NPVU5UICogajsKKwkJCXRhcmdldF9jb21tYW5kID0gdGFyZ2V0X2NvbW1hbmQgfCBCSVQzMTsKKworCQkJd2hpbGUgKChpLS0pID49IDApIHsKKwkJCQl1bFN0YXR1cyA9IHJlYWRfbmljX2R3b3JkKGRldiwgUldDQU0pOworCQkJCWlmICh1bFN0YXR1cyAmIEJJVDMxKQorCQkJCQljb250aW51ZTsKKwkJCQllbHNlCisJCQkJCWJyZWFrOworCQkJfQorCQkJd3JpdGVfbmljX2R3b3JkKGRldiwgUldDQU0sIHRhcmdldF9jb21tYW5kKTsKKwkJCXRhcmdldF9jb250ZW50ID0gcmVhZF9uaWNfZHdvcmQoZGV2LCBSQ0FNTyk7CisJCQlsZW4gKz0gc25wcmludGYocGFnZSArIGxlbiwgY291bnQgLSBsZW4sICIlOC44eCAiLAorCQkJCQl0YXJnZXR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F9zZW0pOworCXdycXUtPmRhdGEubGVuZ3RoID0gbWluKChzaXplX3QpIHdycXUtPmRhdGEubGVuZ3RoLCBzaXplb2YocHJpdi0+bmljaykpOworCW1lbXNldChwcml2LT5uaWNrLCAwLCBzaXplb2YocHJpdi0+bmljaykpOworCW1lbWNweShwcml2LT5uaWNrLCBleHRyYSwgd3JxdS0+ZGF0YS5sZW5ndGgpOworCXVwKCZwcml2LT53eF9zZW0pOworCXJldHVybiAwOworCit9CisKK3N0YXRpYyBpbnQgcjgxOTJfd3hfZ2V0X25pY2soc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKwkJCSAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKwkJCSAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisJc3RydWN0IHI4MTkyX3ByaXYgKnByaXYgPSBydGxsaWJfcHJpdihkZXYpOworCisJZG93bigmcHJpdi0+d3hfc2VtKTsKKwl3cnF1LT5kYXRhLmxlbmd0aCA9IHN0cmxlbihwcml2LT5uaWNrKTsKKwltZW1jcHkoZXh0cmEsIHByaXYtPm5pY2ssIHdycXUtPmRhdGEubGVuZ3RoKTsKKwl3cnF1LT5kYXRhLmZsYWdzID0gMTsgICAvKiBhY3RpdmUgKi8KKwl1cCgmcHJpdi0+d3hfc2VtKTsKKwlyZXR1cm4gMDsKK30KKworc3RhdGljIGludCByODE5Ml93eF9zZXRfZnJlcShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LCBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICphLAorCQkJICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpiKQoreworCWludCByZXQ7CisJc3RydWN0IHI4MTkyX3ByaXYgKnByaXYgPSBydGxsaWJfcHJpdihkZXYpOworCisJaWYgKHByaXYtPmJId1JhZGlvT2ZmID09IHRydWUpCisJCXJldHVybiAwOworCisJZG93bigmcHJpdi0+d3hfc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BBUkVfQ01EICAgICAgIDEzCi0jZGVmaW5lICAgUkVBRF9TUEFSRV9DTUQgICAgICAgIDE0Ci0jZGVmaW5lICAgV1JJVEVfTUFJTl9TUEFSRV9DTUQgIDE1Ci0jZGVmaW5lICAgUkVBRF9NQUlOX1NQQVJFX0NNRCAgIDE2Ci0jZGVmaW5lICAgTUVNQ09QWV9DTUQgICAgICAgICAgIDE3Ci0jZGVmaW5lICAgRFVNTVlfQ01EICAgICAgICAgICAgIDk5Ci0KLSNkZWZpbmUgICAgIEVWRU5UX1BBU1MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMAotI2RlZmluZSAgICAgRVZFTlRfQ09SUkVDVEFCTEVfREFUQV9FUlJPUl9GSVhFRCAgICAgICAgIDB4MDEKLSNkZWZpbmUgICAgIEVWRU5UX1VOQ09SUkVDVEFCTEVfREFUQV9FUlJPUiAgICAgICAgICAgICAgMHgwMgotI2RlZmluZSAgICAgRVZFTlRfVElNRV9PVVQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAzCi0jZGVmaW5lICAgICBFVkVOVF9QUk9HUkFNX0ZBSUxVUkUgICAgICAgICAgICAgICAgICAgICAgIDB4MDQKLSNkZWZpbmUgICAgIEVWRU5UX0VSQVNFX0ZBSUxVUkUgICAgICAgICAgICAgICAgICAgICAgICAgMHgwNQotI2RlZmluZSAgICAgRVZFTlRfTUVNQ09QWV9GQUlMVVJFICAgICAgICAgICAgICAgICAgICAgICAweDA2Ci0jZGVmaW5lICAgICBFVkVOVF9GQUlMICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDcKLQotI2RlZmluZSAgICAgRVZFTlRfTk9ORSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDIyCi0jZGVmaW5lICAgICBFVkVOVF9ETUFfQ01EX0NPTVAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4NzcKLSNkZWZpbmUgICAgIEVWRU5UX0VDQ19UUkFOU0FDVElPTl9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ci0JfQotCi0JcmV0dXJuIHdSZXN1bHQ7Ci19Ci0jZW5kaWYKLQotI2lmZGVmIFNVUFBPUlRfQklHX0VORElBTgotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiBGdW5jdGlvbjogICAgIEZUTF9JbnZlcnRfQmxvY2tfVGFibGUKLSogSW5wdXRzOiAgICAgICBub25lCi0qIE91dHB1dHM6ICAgICAgbm9uZQotKiBEZXNjcmlwdGlvbjogIFJlLWZvcm1hdCB0aGUgYmxvY2sgdGFibGUgaW4gcmFtIGJhc2VkIG9uIEJJR19FTkRJQU4gYW5kCi0qICAgICAgICAgICAgICAgICAgICAgTEFSR0VfQkxPQ0tOVU0gaWYgbmVjZXNzYXJ5Ci0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotc3RhdGljIHZvaWQgRlRMX0ludmVydF9CbG9ja19UYWJsZSh2b2lkKQotewotCXUzMiBpOwotCXUzMiAqcGJ0ID0gKHUzMiAqKWdfcEJsb2NrVGFibGU7Ci0KLQluYW5kX2RiZ19wcmludChOQU5EX0RCR19UUkFDRSwgIiVzLCBMaW5lICVkLCBGdW5jdGlvbjogJXNcbiIsCi0JCV9fRklMRV9fLCBfX0xJTkVfXywgX19mdW5jX18pOwotCi0jaWZkZWYgU1VQUE9SVF9MQVJHRV9CTE9DS05VTQotCWZvciAoaSA9IDA7IGkgPCBEZXZpY2VJbmZvLndEYXRhQmxvY2tOdW07IGkrKykgewotCQlwYnRbaV0gPSBJTlZFUlRVSU5UMzIocGJ0W2ldKTsKLQkJZ19wV2VhckNvdW50ZXJbaV0gPSBJTlZFUlRVSU5UMzIoZ19wV2VhckNvdW50ZXJbaV0pOwotCX0KLSNlbHNlCi0JZm9yIChpID0gMDsgaSA8IERldmljZUluZm8ud0RhdGFCbG9ja051bTsgaSsrKSB7Ci0JCX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gICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9Ci0vKgotICAgICAgICAgICAgICAgIGlmIChwTWdtdC0+ZUF1dGhlbk1vZGUgPCBXTUFDX0FVVEhfV1BBKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChwQ3VyckJTUy0+YldQQVZhbGlkID09IFRSVUUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIFdQQSBBUCB3aWxsIHJlamVjdCBjb25uZWN0aW9uIG9mIHN0YXRpb24gd2l0aG91dCBXUEEgZW5hYmxlLgotICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChwTWdtdC0+ZUF1dGhlbk1vZGUgPT0gV01BQ19BVVRIX1dQQSkgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIChwTWdtdC0+ZUF1dGhlbk1vZGUgPT0gV01BQ19BVVRIX1dQQVBTSykpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHBDdXJyQlNTLT5iV1BBVmFsaWQgPT0gRkFMU0UpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIHN0YXRpb24gd2l0aCBXUEEgZW5hYmxlIGNhbid0IGpvaW4gTm9uV1BBIEFQLgotICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChwTWdtdC0+ZUF1dGhlbk1vZGUgPT0gV01BQ19BVVRIX1dQQTIpIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAocE1nbXQtPmVBdXRoZW5Nb2RlID09IFdNQUNfQVVUSF9XUEEyUFNLKSkgewotICAgICAgICAgICAgICAgICAgICBpZiAocEN1cnJCU1MtPmJXUEEyVmFsaWQgPT0gRkFMU0UpIHsKLSAgICAgICAg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C0+c0JTU0xpc3RbaWldLCAwLCBzaXplb2YoS25vd25CU1MpKTsKICAgICB9CiAgICAgQlNTdkNsZWFyQW55QlNTSm9pblJlY29yZChwRGV2aWNlKTsKLQotICAgIHJldHVybjsKIH0KIAogCkBAIC01MjQsNDYgKzQ5Nyw2IEBACiAgICAgICAgICAgICBwQlNTTGlzdC0+bGRCbUF2ZXJhZ2VbaWldID0gMDsKICAgICB9CiAKLS8qCi0gICAgaWYgKChwSUVfQ291bnRyeSAhPSBOVUxMKSAmJgotICAgICAgICAocE1nbXQtPmIxMWhFbmFibGUgPT0gVFJVRSkpIHsKLSAgICAgICAgQ0FSRHZTZXRDb3VudHJ5SW5mbyhwTWdtdC0+cEFkYXB0ZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcEJTU0xpc3QtPmVOZXR3b3JrVHlwZUluVXNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJRV9Db3VudHJ5KTsKLSAgICB9Ci0KLSAgICBpZiAoKGJQYXJzaW5nUXVpZXQgPT0gVFJVRSkgJiYgKHBJRV9RdWlldCAhPSBOVUxMKSkgewotICAgICAgICBpZiAoKCgoUFdMQU5fSUVfUVVJRVQpcElFX1F1aWV0KS0+bGVuID09IDgpICYmCi0gICAgICAgICAgICAoKChQV0xBTl9JRV9RVUlFVClwSUVfUXVpZXQpLT5ieVF1aWV0Q291bnQgIT0gMCkpIHsKLSAgICAgICAgICAgIC8vIHZhbGlkIEVJRAotICAgICAgICAgICAgaWYgKHBRdWlldCA9PSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgcFF1aWV0ID0gKFBXTEFOX0lFX1FVSUVUKXBJRV9RdWlldDsKLSAgICAgICAgICAgICAgICBDQVJEYlNldFF1aWV0KCAgcE1nbXQtPnBBZGFwdGVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUUlVFLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUXVpZXQtPmJ5UXVpZXRDb3VudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFF1aWV0LT5ieVF1aWV0UGVyaW9kLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKChQV09SRClwUXVpZXQtPmFieVF1aWV0RHVyYXRpb24pLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKChQV09SRClwUXVpZXQtPmFieVF1aWV0T2Zmc2V0KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBwUXVpZXQgPSAoUFdMQU5fSUVfUVVJRVQpcElFX1F1aWV0OwotICAgICAgICAgICAgICAgIENBUkRiU2V0UXVpZXQoICBwTWdtdC0+cEFkYXB0ZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZBTFNFLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUXVpZXQtPmJ5UXVpZXRDb3VudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFF1aWV0LT5ieVF1aWV0UGVyaW9kLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKChQV09SRClwUXVpZXQtPmFieVF1aWV0RHVyYXRpb24pLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKChQV09SRClwUXVpZXQtPmFieVF1aWV0T2Zmc2V0KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgaWYgKChiUGFyc2luZ1F1aWV0ID09IFRSVUUpICYmCi0gICAgICAgIChwUXVpZXQgIT0gTlVMTCkpIHsKLSAgICAgICAgQ0FSRGJTdGFydFF1aWV0KHBNZ210LT5wQWRhcHRlcik7Ci0gICAgfQotKi8KLQogICAgIHBCU1NMaXN0LT51SUVMZW5ndGggPSB1SUVMZW5ndGg7CiAgICAgaWYgKHBCU1NMaXN0LT51SUVMZW5ndGggPiBXT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ZHItPnR5cGUgPSBWSUFXR0VUX0NDS01fUk9BTV9NU0c7CiAgICAgICAgICAgICAgd3BhaGRyLT5yZXNwX2llX2xlbiA9IDA7CkBAIC0xMjM3LDcgKzExNTcsNiBAQAogICAgICAgICAgICAgIG5ldGlmX3J4KHBEZXZpY2UtPnNrYik7CiAgICAgICAgICAgICBwRGV2aWNlLT5za2IgPSBkZXZfYWxsb2Nfc2tiKChpbnQpcERldmljZS0+cnhfYnVmX3N6KTsKIAotLy8gICAgICAgICB9CiAgICAgICAgICAgfQogICAgICAgZWxzZSBpZiAoKHBEZXZpY2UtPmJSb2FtaW5nID09IEZBTFNFKSYmKHBEZXZpY2UtPmJJc1JvYW1pbmcgPT0gVFJVRSkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT51SXNyb2FtaW5nVGltZSsrOwpAQCAtMTMxNSw3ICsxMjM0LDYgQEAKIAogICAgIHBNZ210LT5zVGltZXJTZWNvbmRDYWxsYmFjay5leHBpcmVzID0gUlVOX0FUKEhaKTsKICAgICBhZGRfdGltZXIoJnBNZ210LT5zVGltZXJTZWNvbmRDYWxsYmFjayk7Ci0gICAgcmV0dXJuOwogfQogCiAvKisKQEAgLTEzNjQsNyArMTI4Miw2IEBACiAKICAgICAvLyBPbmx5IFVuaWNhc3QgdXNpbmcgc3VwcG9ydCByYXRlcwogICAgIGlmICh3RklGT0N0bCAmIEZJRk9DVExfTkVFREFDSykgewotICAgICAgICAvL0RCR19QUk5fR1JQMjEoKCJEZXZpY2UgJTA4WCwgd1JhdGUgJTA0WCwgYnlUU1IgJTAyWFxuIiwgaERldmljZUNvbnRleHQsIHdSYXRlLCBieVRTUikpOwogICAgICAgICBpZiAocE1nbXQtPmVDdXJyTW9kZSA9PSBXTUFDX01PREVfRVNTX1NUQSkgewogICAgICAgICAgICAgcE1nbXQtPnNOb2RlREJUYWJsZVswXS51VHhBdHRlbXB0cyArPSAxOwogICAgICAgICAgICAgaWYgKCAhKGJ5VFN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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworLyogaW5wdXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qICAgICAgYmxbNV0gOiAxO0xWRFMgc2lnbmFsIG9uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAgICAgIGJsWzFdIDogMTtMVkRTIGJhY2tsaWdodCBvbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogICAgICBibFswXSA6IDE6TFZEUyBWREQgb24gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qICAgICAgYmg6IDEwMDAwMGIgOiBjbGVhciBiaXQgNSwgdG8gc2V0IGJpdDUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAgICAgICAgICAwMDAwMTBiIDogY2xlYXIgYml0IDEsIHRvIHNldCBiaXQxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogICAgICAgICAgMDAwMDAxYiA6IGNsZWFyIGJpdCAwLCB0byBzZXQgYml0MCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCitzdGF0aWMgdm9pZCBYR0lfWEcyMUJMU2lnbmFsVkREKHVuc2lnbmVkIHNob3J0IHRlbXBiaCwgdW5zaWduZWQgc2hvcnQgdGVtcGJsLAorCQlzdHJ1Y3QgdmJfZGV2aWNlX2luZm8gKnBWQkluZm8pCit7CisJdW5zaWduZWQgY2hhciBDUjRBLCB0ZW1wOworCisJQ1I0QSA9IHhnaWZiX3JlZ19nZXQocFZCSW5mby0+UDNkNCwgMHg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s1Nzg3LDYgQEAKIAkJaWYgKCEocFZCSW5mby0+VkJJbmZvICYgKFNldEluU2xhdmVNb2RlIHwgTG9hZERBQ0ZsYWcKIAkJCQl8IENSVDJEaXNwbGF5RmxhZykpKSB7CiAJCQlYR0lOZXdfRW5hYmxlQ1JUMihwVkJJbmZvKTsKLQkJCS8qIExvYWREQUMyKHBWQkluZm8tPlBhcnQ1UG9ydCwgTW9kZU5vLCBNb2RlSWRJbmRleCk7ICovCiAJCX0KIAl9CiAJcmV0dXJuOwpAQCAtNTkyMSwxMTggKzU4MDUsMTEgQEAKIAl4Z2lmYl9yZWdfYW5kX29yKHBWQkluZm8tPlAzZDQsIDB4NjMsIDB4QkYsIDB4MDApOwogfQogCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotLyogaW5wdXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgYmxbNV0gOiAxO0xWRFMgc2lnbmFsIG9uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIGJsWzFdIDogMTtMVkRTIGJhY2tsaWdodCBvbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICBibFswXSA6IDE6TFZEUyBWREQgb24gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgYmg6IDEwMDAwMGIgOiBjbGVhciBiaXQgNSwgdG8gc2V0IGJpdDUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAwMDAwMTBiIDogY2xlYXIgYml0IDEsIHRvIHNldCBiaXQxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLy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HJpdl90b19wcml2KGhwcml2KTsKKwlzdHJ1Y3QgdXNiaHNfcGlwZSAqcGlwZTsKKwlzdHJ1Y3QgZGV2aWNlICpkZXYgPSB1c2Joc19wcml2X3RvX2Rldihwcml2KTsKKwl1bnNpZ25lZCBsb25nIGZsYWdzOworCisJLyoqKioqKioqKioqKioqKioqKioqICBzcGluIGxvY2sgKioqKioqKioqKioqKioqKioqKiovCisJdXNiaHNfbG9jayhwcml2LCBmbGFncyk7CisKKwlwaXBlID0gdXNiaHNoX3VlcF90b19waXBlKHVlcCk7CisKKwlpZiAodW5saWtlbHkoIXBpcGUpKSB7CisJCWRldl9lcnIoZGV2LCAidWVwIGRvZW5zJ3QgaGF2ZSBwaXBlXG4iKTsKKwl9IGVsc2UgeworCQlzdHJ1Y3QgdXNiX2hvc3RfZW5kcG9pbnQgKmVwID0gdXNiaHNoX3VlcF90b19lcCh1ZXApOworCQlzdHJ1Y3QgdXNiaHNoX2RldmljZSAqdWRldiA9IHVzYmhzaF91ZXBfdG9fdWRldih1ZXApOworCisJCS8qIGRldGFjaCBwaXBlIGZyb20gdWVwICovCisJCXVzYmhzaF91ZXBfdG9fcGlwZSh1ZXApCQk9IE5VTEw7CisJCXVzYmhzaF9waXBlX3RvX3VlcChwaXBlKQk9IE5VTEw7CisKKwkJZGV2X2RiZyhkZXYsICIlcyBbJWQtJWQoJXMpXVxuIiwgX19mdW5jX18sCisJCQl1c2Joc2hfZGV2aWNlX251bWJlcihocHJpdiwgdWRldiksCisJCQl1c2JfZW5kcG9pbnRfbnVtKCZlcC0+ZGVzYyksCisJCQl1c2Joc19waXBlX25hbWUocGlwZSkpOworCX0KKworCXVzYmhzX3VubG9jayhwcml2LCBmbGFncyk7CisJLyoqKioqKioqKioqKioqKioqKioqICBzcGluIHVubG9jayAqKioqKioqKioqKioqKioqKiovCit9CisKKy8qCisgKgkJZW5kcG9pbnQgY29udHJvbAorICovCitzdGF0aWMgaW50IHVzYmhzaF9lbmRwb2ludF9hdHRhY2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nVjdCBtb3VudCAqbW50KQogewogCWJyX3dyaXRlX2xvY2sodmZzbW91bnRfbG9jayk7Ci0JbW50LT5tbnRfZmxhZ3MgJj0gfk1OVF9SRUFET05MWTsKKwltbnQtPm1udC5tbnRfZmxhZ3MgJj0gfk1OVF9SRUFET05MWTsKIAlicl93cml0ZV91bmxvY2sodmZzbW91bnRfbG9jayk7CiB9CiAKLXN0YXRpYyB2b2lkIGZyZWVfdmZzbW50KHN0cnVjdCB2ZnNtb3VudCAqbW50KQoraW50IHNiX3ByZXBhcmVfcmVtb3VudF9yZWFkb25seShzdHJ1Y3Qgc3VwZXJfYmxvY2sgKnNiKQoreworCXN0cnVjdCBtb3VudCAqbW50OworCWludCBlcnIgPSAwOworCisJLyogUmFjeSBvcHRpbWl6YXRpb24uICBSZWNoZWNrIHRoZSBjb3VudGVyIHVuZGVyIE1OVF9XUklURV9IT0xEICovCisJaWYgKGF0b21pY19sb25nX3JlYWQoJnNiLT5zX3JlbW92ZV9jb3VudCkpCisJCXJldHVybiAtRUJVU1k7CisKKwlicl93cml0ZV9sb2NrKHZmc21vdW50X2xvY2spOworCWxpc3RfZm9yX2VhY2hfZW50cnkobW50LCAmc2ItPnNfbW91bnRzLCBtbnRfaW5zdGFuY2UpIHsKKwkJaWYgKCEobW50LT5tbnQubW50X2ZsYWdzICYgTU5UX1JFQURPTkxZKSkgeworCQkJbW50LT5tbnQubW50X2ZsYWdzIHw9IE1OVF9XUklURV9IT0xEOworCQkJc21wX21iKCk7CisJCQlpZiAobW50X2dldF93cml0ZXJzKG1udCkgPiAwKSB7CisJCQkJZXJyID0gLUVCVVNZOworCQkJCWJyZWFrOworCQkJfQorCQl9CisJfQorCWlmICghZXJyICYmIGF0b21pY19sb25nX3JlYWQoJnNiLT5zX3JlbW92ZV9jb3VudCkpCisJCWVyciA9IC1FQlVTWTsKKworCWlmICghZXJyKSB7CisJCXNiLT5zX3JlYWRvbmx5X3JlbW91bnQgPSAxOworCQlzbXBfd21iKCk7CisJf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m1udF9yb290KTsKIAlmcmVlX3Zmc21udChtbnQpOwogCWRlYWN0aXZhdGVfc3VwZXIoc2IpOwogfQogCi1zdGF0aWMgdm9pZCBtbnRwdXRfbm9fZXhwaXJlKHN0cnVjdCB2ZnNtb3VudCAqbW50KQorc3RhdGljIHZvaWQgbW50cHV0X25vX2V4cGlyZShzdHJ1Y3QgbW91bnQgKm1udCkKIHsKIHB1dF9hZ2FpbjoKICNpZmRlZiBDT05GSUdfU01QCiAJYnJfcmVhZF9sb2NrKHZmc21vdW50X2xvY2spOwogCWlmIChsaWtlbHkoYXRvbWljX3JlYWQoJm1udC0+bW50X2xvbmd0ZXJtKSkpIHsKLQkJbW50X2RlY19jb3VudChtbnQpOworCQltbnRfYWRkX2NvdW50KG1udCwgLTEpOwogCQlicl9yZWFkX3VubG9jayh2ZnNtb3VudF9sb2NrKTsKIAkJcmV0dXJuOwogCX0KIAlicl9yZWFkX3VubG9jayh2ZnNtb3VudF9sb2NrKTsKIAogCWJyX3dyaXRlX2xvY2sodmZzbW91bnRfbG9jayk7Ci0JbW50X2RlY19jb3VudChtbnQpOworCW1udF9hZGRfY291bnQobW50LCAtMSk7CiAJaWYgKG1udF9nZXRfY291bnQobW50KSkgewogCQlicl93cml0ZV91bmxvY2sodmZzbW91bnRfbG9jayk7CiAJCXJldHVybjsKIAl9CiAjZWxzZQotCW1udF9kZWNfY291bnQobW50KTsKKwltbnRfYWRkX2NvdW50KG1udCwgLTEpOwogCWlmIChsaWtlbHkobW50X2dldF9jb3VudChtbnQpKSkKIAkJcmV0dXJuOwogCWJyX3dyaXRlX2xvY2sodmZzbW91bnRfbG9jayk7CkBAIC04MDIsOSArODI3LDEwIEBACiAJCW1udF9hZGRfY291bnQobW50LCBtbnQtPm1udF9waW5uZWQgKyAxKTsKIAkJbW50LT5tbnRfcGlubmVkID0gMDsKIAkJYnJfd3JpdGVfdW5sb2NrKHZmc21vdW50X2xvY2spOwotCQlhY2N0X2F1dG9fY2xvc2VfbW50KG1udC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5tbnRfcm9vdCA9PSBwYXRoLT5kZW50cnkpCiAJCWdvdG8gdW5sb2NrOwogCiAJZXJyID0gLUVJTlZBTDsKLQlpZiAoU19JU0xOSyhuZXdtbnQtPm1udF9yb290LT5kX2lub2RlLT5pX21vZGUpKQorCWlmIChTX0lTTE5LKG5ld21udC0+bW50Lm1udF9yb290LT5kX2lub2RlLT5pX21vZGUpKQogCQlnb3RvIHVubG9jazsKIAotCW5ld21udC0+bW50X2ZsYWdzID0gbW50X2ZsYWdzOworCW5ld21udC0+bW50Lm1udF9mbGFncyA9IG1udF9mbGFnczsKIAllcnIgPSBncmFmdF90cmVlKG5ld21udCwgcGF0aCk7CiAKIHVubG9jazoKQEAgLTIwMzAsNyArMTg2NSw3IEBACiAJaWYgKElTX0VSUihtbnQpKQogCQlyZXR1cm4gUFRSX0VSUihtbnQpOwogCi0JZXJyID0gZG9fYWRkX21vdW50KG1udCwgcGF0aCwgbW50X2ZsYWdzKTsKKwllcnIgPSBkb19hZGRfbW91bnQocmVhbF9tb3VudChtbnQpLCBwYXRoLCBtbnRfZmxhZ3MpOwogCWlmIChlcnIpCiAJCW1udHB1dChtbnQpOwogCXJldHVybiBlcnI7CkBAIC0yMDM4LDExICsxODczLDEyIEBACiAKIGludCBmaW5pc2hfYXV0b21vdW50KHN0cnVjdCB2ZnNtb3VudCAqbSwgc3RydWN0IHBhdGggKnBhdGgpCiB7CisJc3RydWN0IG1vdW50ICptbnQgPSByZWFsX21vdW50KG0pOwogCWludCBlcnI7CiAJLyogVGhlIG5ldyBtb3VudCByZWNvcmQgc2hvdWxkIGhhdmUgYXQgbGVhc3QgMiByZWZzIHRvIHByZXZlbnQgaXQgYmVpbmcKIAkgKiBleHBpcmVkIGJlZm9yZSB3ZSBnZXQgYSBjaGFuY2UgdG8gYWRkIGl0CiAJICovCi0JQlVHX09OKG1udF9nZXRfY291bnQobSkgPCAyKTsKKwlCVUdfT04obW50X2dldF9jb3VudChtbnQpIDwgMik7CiAKIAlpZiAobS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CAtMjg2LDcgKzI3MCw3IEBACiAvKgogICogcmV0dXJuIHRydWUgaWYgdGhlIHJlZmNvdW50IGlzIGdyZWF0ZXIgdGhhbiBjb3VudAogICovCi1zdGF0aWMgaW5saW5lIGludCBkb19yZWZjb3VudF9jaGVjayhzdHJ1Y3QgdmZzbW91bnQgKm1udCwgaW50IGNvdW50KQorc3RhdGljIGlubGluZSBpbnQgZG9fcmVmY291bnRfY2hlY2soc3RydWN0IG1vdW50ICptbnQsIGludCBjb3VudCkKIHsKIAlpbnQgbXljb3VudCA9IG1udF9nZXRfY291bnQobW50KSAtIG1udC0+bW50X2dob3N0czsKIAlyZXR1cm4gKG15Y291bnQgPiBjb3VudCk7CkBAIC0zMDIsMTAgKzI4NiwxMCBAQAogICoKICAqIHZmc21vdW50IGxvY2sgbXVzdCBiZSBoZWxkIGZvciB3cml0ZQogICovCi1pbnQgcHJvcGFnYXRlX21vdW50X2J1c3koc3RydWN0IHZmc21vdW50ICptbnQsIGludCByZWZjbnQpCitpbnQgcHJvcGFnYXRlX21vdW50X2J1c3koc3RydWN0IG1vdW50ICptbnQsIGludCByZWZjbnQpCiB7Ci0Jc3RydWN0IHZmc21vdW50ICptLCAqY2hpbGQ7Ci0Jc3RydWN0IHZmc21vdW50ICpwYXJlbnQgPSBtbnQtPm1udF9wYXJlbnQ7CisJc3RydWN0IG1vdW50ICptLCAqY2hpbGQ7CisJc3RydWN0IG1vdW50ICpwYXJlbnQgPSBtbnQtPm1udF9wYXJlbnQ7CiAJaW50IHJldCA9IDA7CiAKIAlpZiAobW50ID09IHBhcmVudCkKQEAgLTMyMSw3ICszMDUsNyBAQAogCiAJZm9yIChtID0gcHJvcGFnYXRpb25fbmV4dChwYXJlbnQsIHBhcmVudCk7IG07CiAJICAgICAJCW0gPSBwcm9wYWdhdGlvbl9uZXh0KG0sIHBhcmVudCkpIHsKLQkJY2hpbGQgPSBfX2xvb2t1cF9tbnQobSwgbW50LT5tbnRfbW91bnRwb2ludCwgMCk7CisJ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ZGV2KSk7CisJaWYgKHNiLT5zX29wLT5zaG93X3BhdGgpCisJCWVyciA9IHNiLT5zX29wLT5zaG93X3BhdGgobSwgbW50LT5tbnRfcm9vdCk7CisJZWxzZQorCQlzZXFfZGVudHJ5KG0sIG1udC0+bW50X3Jvb3QsICIgXHRcblxcIik7CisJaWYgKGVycikKKwkJZ290byBvdXQ7CisJc2VxX3B1dGMobSwgJyAnKTsKKworCS8qIG1vdW50cG9pbnRzIG91dHNpZGUgb2YgY2hyb290IGphaWwgd2lsbCBnaXZlIFNFUV9TS0lQIG9uIHRoaXMgKi8KKwllcnIgPSBzZXFfcGF0aF9yb290KG0sICZtbnRfcGF0aCwgJnJvb3QsICIgXHRcblxcIik7CisJaWYgKGVycikKKwkJZ290byBvdXQ7CisKKwlzZXFfcHV0cyhtLCBtbnQtPm1udF9mbGFncyAmIE1OVF9SRUFET05MWSA/ICIgcm8iIDogIiBydyIpOworCXNob3dfbW50X29wdHMobSwgbW50KTsKKworCS8qIFRhZ2dlZCBmaWVsZHMgKCJmb286WCIgb3IgImJhciIpICovCisJaWYgKElTX01OVF9TSEFSRUQocikpCisJCXNlcV9wcmludGYobSwgIiBzaGFyZWQ6JWkiLCByLT5tbnRfZ3JvdXBfaWQpOworCWlmIChJU19NTlRfU0xBVkUocikpIHsKKwkJaW50IG1hc3RlciA9IHItPm1udF9tYXN0ZXItPm1udF9ncm91cF9pZDsKKwkJaW50IGRvbSA9IGdldF9kb21pbmF0aW5nX2lkKHIsICZwLT5yb290KTsKKwkJc2VxX3ByaW50ZihtLCAiIG1hc3RlcjolaSIsIG1hc3Rlcik7CisJCWlmIChkb20gJiYgZG9tICE9IG1hc3RlcikKKwkJCXNlcV9wcmludGYobSwgIiBwcm9wYWdhdGVfZnJvbTolaSIsIGRvbSk7CisJfQorCWlmIChJU19NTlRfVU5CSU5EQUJMRShyKSkKKwkJc2VxX3B1dHMobSwgIiB1bmJpbmRhYmxlIik7CisKKwkvKiBGaWxlc3lzdGVtIHNwZ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tZShtLCBtbnRfcGF0aC5kZW50cnkpOworCX0gZWxzZSB7CisJCWlmIChyLT5tbnRfZGV2bmFtZSkgeworCQkJc2VxX3B1dHMobSwgImRldmljZSAiKTsKKwkJCW1hbmdsZShtLCByLT5tbnRfZGV2bmFtZSk7CisJCX0gZWxzZQorCQkJc2VxX3B1dHMobSwgIm5vIGRldmljZSIpOworCX0KKworCS8qIG1vdW50IHBvaW50ICovCisJc2VxX3B1dHMobSwgIiBtb3VudGVkIG9uICIpOworCXNlcV9wYXRoKG0sICZtbnRfcGF0aCwgIiBcdFxuXFwiKTsKKwlzZXFfcHV0YyhtLCAnICcpOworCisJLyogZmlsZSBzeXN0ZW0gdHlwZSAqLworCXNlcV9wdXRzKG0sICJ3aXRoIGZzdHlwZSAiKTsKKwlzaG93X3R5cGUobSwgc2IpOworCisJLyogb3B0aW9uYWwgc3RhdGlzdGljcyAqLworCWlmIChzYi0+c19vcC0+c2hvd19zdGF0cykgeworCQlzZXFfcHV0YyhtLCAnICcpOworCQlpZiAoIWVycikKKwkJCWVyciA9IHNiLT5zX29wLT5zaG93X3N0YXRzKG0sIG1udF9wYXRoLmRlbnRyeSk7CisJfQorCisJc2VxX3B1dGMobSwgJ1xuJyk7CisJcmV0dXJuIGVycjsKK30KKworc3RhdGljIGludCBtb3VudHNfb3Blbl9jb21tb24oc3RydWN0IGlub2RlICppbm9kZSwgc3RydWN0IGZpbGUgKmZpbGUsCisJCQkgICAgICBpbnQgKCpzaG93KShzdHJ1Y3Qgc2VxX2ZpbGUgKiwgc3RydWN0IHZmc21vdW50ICopKQoreworCXN0cnVjdCB0YXNrX3N0cnVjdCAqdGFzayA9IGdldF9wcm9jX3Rhc2soaW5vZGUpOworCXN0cnVjdCBuc3Byb3h5ICpuc3A7CisJc3RydWN0IG1udF9uYW1lc3BhY2UgKm5zID0gTlVMTDsKKwlzdHJ1Y3QgcGF0aCByb290OworCXN0cnVjdCBwcm9jX21vdW50cyAqcDsKKwlpbnQgcmV0ID0gLU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zaWduX3BvaW50ZXIoY2FsbGNoYWluX2NwdXNfZW50cmllcywgZW50cmllcyk7CisKKwlyZXR1cm4gMDsKKworZmFpbDoKKwlmb3JfZWFjaF9wb3NzaWJsZV9jcHUoY3B1KQorCQlrZnJlZShlbnRyaWVzLT5jcHVfZW50cmllc1tjcHVdKTsKKwlrZnJlZShlbnRyaWVzKTsKKworCXJldHVybiAtRU5PTUVNOworfQorCitpbnQgZ2V0X2NhbGxjaGFpbl9idWZmZXJzKHZvaWQpCit7CisJaW50IGVyciA9IDA7CisJaW50IGNvdW50OworCisJbXV0ZXhfbG9jaygmY2FsbGNoYWluX211dGV4KTsKKworCWNvdW50ID0gYXRvbWljX2luY19yZXR1cm4oJm5yX2NhbGxjaGFpbl9ldmVudHMpOworCWlmIChXQVJOX09OX09OQ0UoY291bnQgPCAxKSkgeworCQllcnIgPSAtRUlOVkFMOworCQlnb3RvIGV4aXQ7CisJfQorCisJaWYgKGNvdW50ID4gMSkgeworCQkvKiBJZiB0aGUgYWxsb2NhdGlvbiBmYWlsZWQsIGdpdmUgdXAgKi8KKwkJaWYgKCFjYWxsY2hhaW5fY3B1c19lbnRyaWVzKQorCQkJZXJyID0gLUVOT01FTTsKKwkJZ290byBleGl0OworCX0KKworCWVyciA9IGFsbG9jX2NhbGxjaGFpbl9idWZmZXJzKCk7CisJaWYgKGVycikKKwkJcmVsZWFzZV9jYWxsY2hhaW5fYnVmZmVycygpOworZXhpdDoKKwltdXRleF91bmxvY2soJmNhbGxjaGFpbl9tdXRleCk7CisKKwlyZXR1cm4gZXJyOworfQorCit2b2lkIHB1dF9jYWxsY2hhaW5fYnVmZmVycyh2b2lkKQoreworCWlmIChhdG9taWNfZGVjX2FuZF9tdXRleF9sb2NrKCZucl9jYWxsY2hhaW5fZXZlbnRzLCAmY2FsbGNoYWluX211dGV4KSkgeworCQlyZWxlYXNlX2NhbGxjaGFpbl9idWZmZXJzKCk7CisJCW11dGV4X3VubG9jaygmY2FsbGNoYWluX211dGV4K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PmhydGlja18qIGFuZCBhc2sgZm9yIGEKKyAqIHJlc2NoZWR1bGUgZXZlbnQuCisgKgorICogV2hlbiB3ZSBnZXQgcmVzY2hlZHVsZWQgd2UgcmVwcm9ncmFtIHRoZSBocnRpY2tfdGltZXIgb3V0c2lkZSBvZiB0aGUKKyAqIHJxLT5sb2NrLgorICovCisKK3N0YXRpYyB2b2lkIGhydGlja19jbGVhcihzdHJ1Y3QgcnEgKnJxKQoreworCWlmIChocnRpbWVyX2FjdGl2ZSgmcnEtPmhydGlja190aW1lcikpCisJCWhydGltZXJfY2FuY2VsKCZycS0+aHJ0aWNrX3RpbWVyKTsKK30KKworLyoKKyAqIEhpZ2gtcmVzb2x1dGlvbiB0aW1lciB0aWNrLgorICogUnVucyBmcm9tIGhhcmRpcnEgY29udGV4dCB3aXRoIGludGVycnVwdHMgZGlzYWJsZWQuCisgKi8KK3N0YXRpYyBlbnVtIGhydGltZXJfcmVzdGFydCBocnRpY2soc3RydWN0IGhydGltZXIgKnRpbWVyKQoreworCXN0cnVjdCBycSAqcnEgPSBjb250YWluZXJfb2YodGltZXIsIHN0cnVjdCBycSwgaHJ0aWNrX3RpbWVyKTsKKworCVdBUk5fT05fT05DRShjcHVfb2YocnEpICE9IHNtcF9wcm9jZXNzb3JfaWQoKSk7CisKKwlyYXdfc3Bpbl9sb2NrKCZycS0+bG9jayk7CisJdXBkYXRlX3JxX2Nsb2NrKHJxKTsKKwlycS0+Y3Vyci0+c2NoZWRfY2xhc3MtPnRhc2tfdGljayhycSwgcnEtPmN1cnIsIDEpOworCXJhd19zcGluX3VubG9jaygmcnEtPmxvY2spOworCisJcmV0dXJuIEhSVElNRVJfTk9SRVNUQVJUOworfQorCisjaWZkZWYgQ09ORklHX1NNUAorLyoKKyAqIGNhbGxlZCBmcm9tIGhhcmRpcnEgKElQSSkgY29udGV4dAorICovCitzdGF0aWMgdm9pZCBfX2hydGlja19zdGFydCh2b2lkICphcmcpCit7CisJc3RydWN0IHJxICpycSA9IGF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WNfYml0cyAtIDEpOworCQkJcmVzdWx0ID4+PSBmcmFjX2JpdHM7CisJCX0KKwkJbiA+Pj0gMTsKKwkJaWYgKCFuKQorCQkJYnJlYWs7CisJCXggKj0geDsKKwkJeCArPSAxVUwgPDwgKGZyYWNfYml0cyAtIDEpOworCQl4ID4+PSBmcmFjX2JpdHM7CisJfQorCisJcmV0dXJuIHJlc3VsdDsKK30KKworLyoKKyAqIGExID0gYTAgKiBlICsgYSAqICgxIC0gZSkKKyAqCisgKiBhMiA9IGExICogZSArIGEgKiAoMSAtIGUpCisgKiAgICA9IChhMCAqIGUgKyBhICogKDEgLSBlKSkgKiBlICsgYSAqICgxIC0gZSkKKyAqICAgID0gYTAgKiBlXjIgKyBhICogKDEgLSBlKSAqICgxICsgZSkKKyAqCisgKiBhMyA9IGEyICogZSArIGEgKiAoMSAtIGUpCisgKiAgICA9IChhMCAqIGVeMiArIGEgKiAoMSAtIGUpICogKDEgKyBlKSkgKiBlICsgYSAqICgxIC0gZSkKKyAqICAgID0gYTAgKiBlXjMgKyBhICogKDEgLSBlKSAqICgxICsgZSArIGVeMikKKyAqCisgKiAgLi4uCisgKgorICogYW4gPSBhMCAqIGVebiArIGEgKiAoMSAtIGUpICogKDEgKyBlICsgLi4uICsgZV5uLTEpIFsxXQorICogICAgPSBhMCAqIGVebiArIGEgKiAoMSAtIGUpICogKDEgLSBlXm4pLygxIC0gZSkKKyAqICAgID0gYTAgKiBlXm4gKyBhICogKDEgLSBlXm4pCisgKgorICogWzFdIGFwcGxpY2F0aW9uIG9mIHRoZSBnZW9tZXRyaWMgc2VyaWVzOgorICoKKyAqICAgICAgICAgICAgICBuICAgICAgICAgMSAtIHheKG4rMSkKKyAqICAgICBTX24gOj0gXFN1bSB4XmkgPSAtLS0tLS0tLS0tLS0tCisgKiAgICAgICAgICAgICBpPTAgICAgICAgICAgMSAtIHgKKyAqLworc3RhdGljIHVuc2lnbmVkIGxvbmcKK2NhbGNfbG9hZF9uKHVuc2lnbmVkI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TX05JQ0UKKworLyoKKyAqIHN5c19uaWNlIC0gY2hhbmdlIHRoZSBwcmlvcml0eSBvZiB0aGUgY3VycmVudCBwcm9jZXNzLgorICogQGluY3JlbWVudDogcHJpb3JpdHkgaW5jcmVtZW50CisgKgorICogc3lzX3NldHByaW9yaXR5IGlzIGEgbW9yZSBnZW5lcmljLCBidXQgbXVjaCBzbG93ZXIgZnVuY3Rpb24gdGhhdAorICogZG9lcyBzaW1pbGFyIHRoaW5ncy4KKyAqLworU1lTQ0FMTF9ERUZJTkUxKG5pY2UsIGludCwgaW5jcmVtZW50KQoreworCWxvbmcgbmljZSwgcmV0dmFsOworCisJLyoKKwkgKiBTZXRwcmlvcml0eSBtaWdodCBjaGFuZ2Ugb3VyIHByaW9yaXR5IGF0IHRoZSBzYW1lIG1vbWVudC4KKwkgKiBXZSBkb24ndCBoYXZlIHRvIHdvcnJ5LiBDb25jZXB0dWFsbHkgb25lIGNhbGwgb2NjdXJzIGZpcnN0CisJICogYW5kIHdlIGhhdmUgYSBzaW5nbGUgd2lubmVyLgorCSAqLworCWlmIChpbmNyZW1lbnQgPCAtNDApCisJCWluY3JlbWVudCA9IC00MDsKKwlpZiAoaW5jcmVtZW50ID4gNDApCisJCWluY3JlbWVudCA9IDQwOworCisJbmljZSA9IFRBU0tfTklDRShjdXJyZW50KSArIGluY3JlbWVudDsKKwlpZiAobmljZSA8IC0yMCkKKwkJbmljZSA9IC0yMDsKKwlpZiAobmljZSA+IDE5KQorCQluaWNlID0gMTk7CisKKwlpZiAoaW5jcmVtZW50IDwgMCAmJiAhY2FuX25pY2UoY3VycmVudCwgbmljZSkpCisJCXJldHVybiAtRVBFUk07CisKKwlyZXR2YWwgPSBzZWN1cml0eV90YXNrX3NldG5pY2UoY3VycmVudCwgbmljZSk7CisJaWYgKHJldHZhbCkKKwkJcmV0dXJuIHJldHZhbDsKKworCXNldF91c2VyX25pY2UoY3VycmVudCwgbmljZSk7CisJcmV0dXJuIDA7Cit9CisKKyNlbmRp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KHN0YXRlID09IFRBU0tfUlVOTklORykKKwkJcHJpbnRrKEtFUk5fQ09OVCAiICBydW5uaW5nIHRhc2sgICAgIik7CisJZWxzZQorCQlwcmludGsoS0VSTl9DT05UICIgJTAxNmx4ICIsIHRocmVhZF9zYXZlZF9wYyhwKSk7CisjZW5kaWYKKyNpZmRlZiBDT05GSUdfREVCVUdfU1RBQ0tfVVNBR0UKKwlmcmVlID0gc3RhY2tfbm90X3VzZWQocCk7CisjZW5kaWYKKwlwcmludGsoS0VSTl9DT05UICIlNWx1ICU1ZCAlNmQgMHglMDhseFxuIiwgZnJlZSwKKwkJdGFza19waWRfbnIocCksIHRhc2tfcGlkX25yKHJjdV9kZXJlZmVyZW5jZShwLT5yZWFsX3BhcmVudCkpLAorCQkodW5zaWduZWQgbG9uZyl0YXNrX3RocmVhZF9pbmZvKHApLT5mbGFncyk7CisKKwlzaG93X3N0YWNrKHAsIE5VTEwpOworfQorCit2b2lkIHNob3dfc3RhdGVfZmlsdGVyKHVuc2lnbmVkIGxvbmcgc3RhdGVfZmlsdGVyKQoreworCXN0cnVjdCB0YXNrX3N0cnVjdCAqZywgKnA7CisKKyNpZiBCSVRTX1BFUl9MT05HID09IDMyCisJcHJpbnRrKEtFUk5fSU5GTworCQkiICB0YXNrICAgICAgICAgICAgICAgIFBDIHN0YWNrICAgcGlkIGZhdGhlclxuIik7CisjZWxzZQorCXByaW50ayhLRVJOX0lORk8KKwkJIiAgdGFzayAgICAgICAgICAgICAgICAgICAgICAgIFBDIHN0YWNrICAgcGlkIGZhdGhlclxuIik7CisjZW5kaWYKKwlyY3VfcmVhZF9sb2NrKCk7CisJZG9fZWFjaF90aHJlYWQoZywgcCkgeworCQkvKgorCQkgKiByZXNldCB0aGUgTk1JLXRpbWVvdXQsIGxpc3RpbmcgYWxsIGZpbGVzIG9uIGEgc2xvdworCQkgKiBjb25zb2xlIG1pZ2h0IHRha2UgYSBsb3Qgb2YgdGltZToKKwkJICovCisJCXRvdWNoX25taV93YXR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CBzdGF0ZSB3ZSBoYXZlIHRvZGF5KS4KKyAqLworc3RydWN0IHJvb3RfZG9tYWluIGRlZl9yb290X2RvbWFpbjsKKworc3RhdGljIHZvaWQgaW5pdF9kZWZyb290ZG9tYWluKHZvaWQpCit7CisJaW5pdF9yb290ZG9tYWluKCZkZWZfcm9vdF9kb21haW4pOworCisJYXRvbWljX3NldCgmZGVmX3Jvb3RfZG9tYWluLnJlZmNvdW50LCAxKTsKK30KKworc3RhdGljIHN0cnVjdCByb290X2RvbWFpbiAqYWxsb2Nfcm9vdGRvbWFpbih2b2lkKQoreworCXN0cnVjdCByb290X2RvbWFpbiAqcmQ7CisKKwlyZCA9IGttYWxsb2Moc2l6ZW9mKCpyZCksIEdGUF9LRVJORUwpOworCWlmICghcmQpCisJCXJldHVybiBOVUxMOworCisJaWYgKGluaXRfcm9vdGRvbWFpbihyZCkgIT0gMCkgeworCQlrZnJlZShyZCk7CisJCXJldHVybiBOVUxMOworCX0KKworCXJldHVybiByZDsKK30KKworc3RhdGljIHZvaWQgZnJlZV9zY2hlZF9ncm91cHMoc3RydWN0IHNjaGVkX2dyb3VwICpzZywgaW50IGZyZWVfc2dwKQoreworCXN0cnVjdCBzY2hlZF9ncm91cCAqdG1wLCAqZmlyc3Q7CisKKwlpZiAoIXNnKQorCQlyZXR1cm47CisKKwlmaXJzdCA9IHNnOworCWRvIHsKKwkJdG1wID0gc2ctPm5leHQ7CisKKwkJaWYgKGZyZWVfc2dwICYmIGF0b21pY19kZWNfYW5kX3Rlc3QoJnNnLT5zZ3AtPnJlZikpCisJCQlrZnJlZShzZy0+c2dwKTsKKworCQlrZnJlZShzZyk7CisJCXNnID0gdG1wOworCX0gd2hpbGUgKHNnICE9IGZpcnN0KTsKK30KKworc3RhdGljIHZvaWQgZnJlZV9zY2hlZF9kb21haW4oc3RydWN0IHJjdV9oZWFkICpyY3UpCit7CisJc3RydWN0IHNjaGVkX2RvbWFpbiAqc2QgPSBjb250YWluZXJfb2YocmN1LCBzd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ICAgMzM1LCAgICAgICAyNzIsICAgICAgIDIxNSwgICAgICAgMTcyLCAgICAgICAxMzcsCisgLyogIDEwICovICAgICAgIDExMCwgICAgICAgIDg3LCAgICAgICAgNzAsICAgICAgICA1NiwgICAgICAgIDQ1LAorIC8qICAxNSAqLyAgICAgICAgMzYsICAgICAgICAyOSwgICAgICAgIDIzLCAgICAgICAgMTgsICAgICAgICAxNSwKK307CisKKy8qCisgKiBJbnZlcnNlICgyXjMyL3gpIHZhbHVlcyBvZiB0aGUgcHJpb190b193ZWlnaHRbXSBhcnJheSwgcHJlY2FsY3VsYXRlZC4KKyAqCisgKiBJbiBjYXNlcyB3aGVyZSB0aGUgd2VpZ2h0IGRvZXMgbm90IGNoYW5nZSBvZnRlbiwgd2UgY2FuIHVzZSB0aGUKKyAqIHByZWNhbGN1bGF0ZWQgaW52ZXJzZSB0byBzcGVlZCB1cCBhcml0aG1ldGljcyBieSB0dXJuaW5nIGRpdmlzaW9ucworICogaW50byBtdWx0aXBsaWNhdGlvbnM6CisgKi8KK3N0YXRpYyBjb25zdCB1MzIgcHJpb190b193bXVsdFs0MF0gPSB7CisgLyogLTIwICovICAgICA0ODM4OCwgICAgIDU5ODU2LCAgICAgNzYwNDAsICAgICA5MjgxOCwgICAgMTE4MzQ4LAorIC8qIC0xNSAqLyAgICAxNDczMjAsICAgIDE4NDY5OCwgICAgMjI5NjE2LCAgICAyODczMDgsICAgIDM2MDQzNywKKyAvKiAtMTAgKi8gICAgNDQ5ODI5LCAgICA1NjM2NDQsICAgIDcwNDA5MywgICAgODc1ODA5LCAgIDEwOTk1ODIsCisgLyogIC01ICovICAgMTM3NjE1MSwgICAxNzE3MzAwLCAgIDIxNTcxOTEsICAgMjcwODA1MCwgICAzMzYzMzI2LAorIC8qICAgMCAqLyAgIDQxOTQzMDQsICAgNTIzNzc2NSwgICA2NTU3MjAyLCAgIDgxNjUzMzcsICAxMDE1MzU4NywKKyAvKiAgIDUgKi8gIDEyODIwNzk4LCAgMTU3O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3N0YXRpYyB2b2lkIHByaW50X2Z1bmNfaGVscF9oZWFkZXIoc3RydWN0IHRyYWNlX2FycmF5ICp0ciwgc3RydWN0IHNlcV9maWxlICptKQoreworCXByaW50X2V2ZW50X2luZm8odHIsIG0pOworCXNlcV9wdXRzKG0sICIjICAgICAgICAgICBUQVNLLVBJRCAgIENQVSMgICAgICBUSU1FU1RBTVAgIEZVTkNUSU9OXG4iKTsKIAlzZXFfcHV0cyhtLCAiIyAgICAgICAgICAgICAgfCB8ICAgICAgIHwgICAgICAgICAgfCAgICAgICAgIHxcbiIpOwogfQogCitzdGF0aWMgdm9pZCBwcmludF9mdW5jX2hlbHBfaGVhZGVyX2lycShzdHJ1Y3QgdHJhY2VfYXJyYXkgKnRyLCBzdHJ1Y3Qgc2VxX2ZpbGUgKm0pCit7CisJcHJpbnRfZXZlbnRfaW5mbyh0ciwgbSk7CisJc2VxX3B1dHMobSwgIiMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfLS0tLS09PiBpcnFzLW9mZlxuIik7CisJc2VxX3B1dHMobSwgIiMgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8gXy0tLS09PiBuZWVkLXJlc2NoZWRcbiIpOworCXNlcV9wdXRzKG0sICIjICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgLyBfLS0tPT4gaGFyZGlycS9zb2Z0aXJxXG4iKTsKKwlzZXFfcHV0cyhtLCAiIyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAvIF8tLT0+IHByZWVtcHQtZGVwdGhcbiIpOworCXNlcV9wdXRzKG0sICIjICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8fCAvICAgICBkZWxheVxuIik7CisJc2VxX3B1dHMobSwgIiMgICAgICAgICAgIFRBU0stUElEICAgQ1BVIyAgfHx8fCAgICBUSU1FU1RBTVAgIEZVTkNUSU9OXG4iKTsKKwlzZXFfcHV0cyhtLCAiIyAgICAgICAgICAgICAgfCB8ICAgICAgIHwgICB8fHx8ICAgIC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iBjb25uLT5zdGF0ZSAhPSBCVF9DT05GSUcpCisJCQljb250aW51ZTsKKworCQljb25uX251bSsrOworCisJCWxpc3RfZm9yX2VhY2hfZW50cnlfcmN1KHRtcCwgJmNvbm4tPmNoYW5fbGlzdCwgbGlzdCkgeworCQkJc3RydWN0IHNrX2J1ZmYgKnNrYjsKKworCQkJaWYgKHNrYl9xdWV1ZV9lbXB0eSgmdG1wLT5kYXRhX3EpKQorCQkJCWNvbnRpbnVlOworCisJCQlza2IgPSBza2JfcGVlaygmdG1wLT5kYXRhX3EpOworCQkJaWYgKHNrYi0+cHJpb3JpdHkgPCBjdXJfcHJpbykKKwkJCQljb250aW51ZTsKKworCQkJaWYgKHNrYi0+cHJpb3JpdHkgPiBjdXJfcHJpbykgeworCQkJCW51bSA9IDA7CisJCQkJbWluID0gfjA7CisJCQkJY3VyX3ByaW8gPSBza2ItPnByaW9yaXR5OworCQkJfQorCisJCQludW0rKzsKKworCQkJaWYgKGNvbm4tPnNlbnQgPCBtaW4pIHsKKwkJCQltaW4gID0gY29ubi0+c2VudDsKKwkJCQljaGFuID0gdG1wOworCQkJfQorCQl9CisKKwkJaWYgKGhjaV9jb25uX251bShoZGV2LCB0eXBlKSA9PSBjb25uX251bSkKKwkJCWJyZWFrOworCX0KKworCXJjdV9yZWFkX3VubG9jaygpOworCisJaWYgKCFjaGFuKQorCQlyZXR1cm4gTlVMTDsKKworCXN3aXRjaCAoY2hhbi0+Y29ubi0+dHlwZSkgeworCWNhc2UgQUNMX0xJTks6CisJCWNudCA9IGhkZXYtPmFjbF9jbnQ7CisJCWJyZWFrOworCWNhc2UgU0NPX0xJTks6CisJY2FzZSBFU0NPX0xJTks6CisJCWNudCA9IGhkZXYtPnNjb19jbnQ7CisJCWJyZWFrOworCWNhc2UgTEVfTElOSzoKKwkJY250ID0gaGRldi0+bGVfbXR1ID8gaGRldi0+bGVfY250IDogaGRldi0+YWNsX2NudDsKKwkJYnJlYWs7CisJZGVmYXVsdDoKKwkJY250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KLQotCS8qIE5FVElGX0ZfSFdfVkxBTl9SWCAqLyAgICAgICJyeC12bGFuLWh3LXBhcnNlIiwKLQkvKiBORVRJRl9GX0hXX1ZMQU5fRklMVEVSICovICAicngtdmxhbi1maWx0ZXIiLAotCS8qIE5FVElGX0ZfVkxBTl9DSEFMTEVOR0VEICovICJ2bGFuLWNoYWxsZW5nZWQiLAotCS8qIE5FVElGX0ZfR1NPICovICAgICAgICAgICAgICJ0eC1nZW5lcmljLXNlZ21lbnRhdGlvbiIsCi0JLyogTkVUSUZfRl9MTFRYICovICAgICAgICAgICAgInR4LWxvY2tsZXNzIiwKLQkvKiBORVRJRl9GX05FVE5TX0xPQ0FMICovICAgICAibmV0bnMtbG9jYWwiLAotCS8qIE5FVElGX0ZfR1JPICovICAgICAgICAgICAgICJyeC1ncm8iLAotCS8qIE5FVElGX0ZfTFJPICovICAgICAgICAgICAgICJyeC1scm8iLAotCi0JLyogTkVUSUZfRl9UU08gKi8gICAgICAgICAgICAgInR4LXRjcC1zZWdtZW50YXRpb24iLAotCS8qIE5FVElGX0ZfVUZPICovICAgICAgICAgICAgICJ0eC11ZHAtZnJhZ21lbnRhdGlvbiIsCi0JLyogTkVUSUZfRl9HU09fUk9CVVNUICovICAgICAgInR4LWdzby1yb2J1c3QiLAotCS8qIE5FVElGX0ZfVFNPX0VDTiAqLyAgICAgICAgICJ0eC10Y3AtZWNuLXNlZ21lbnRhdGlvbiIsCi0JLyogTkVUSUZfRl9UU082ICovICAgICAgICAgICAgInR4LXRjcDYtc2VnbWVudGF0aW9uIiwKLQkvKiBORVRJRl9GX0ZTTyAqLyAgICAgICAgICAgICAidHgtZmNvZS1zZWdtZW50YXRpb24iLAotCSIiLAotCSIiLAotCi0JLyogTkVUSUZfRl9GQ09FX0NSQyAqLyAgICAgICAgInR4LWNoZWNrc3VtLWZjb2UtY3JjIiwKLQkvKiBORVRJRl9GX1NDVFBfQ1NVTSAqLyAgICAgICAidHgtY2hlY2tzdW0tc2N0cCIsCi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FnX3B1dF9tZW1pbmZvKHN0cnVjdCBzb2NrICpzaywgc3RydWN0IHNrX2J1ZmYgKnNrYiwgaW50IGF0dHJ0eXBlKQoreworCV9fdTMyICptZW07CisKKwltZW0gPSBSVEFfREFUQShfX1JUQV9QVVQoc2tiLCBhdHRydHlwZSwgU0tfTUVNSU5GT19WQVJTICogc2l6ZW9mKF9fdTMyKSkpOworCisJbWVtW1NLX01FTUlORk9fUk1FTV9BTExPQ10gPSBza19ybWVtX2FsbG9jX2dldChzayk7CisJbWVtW1NLX01FTUlORk9fUkNWQlVGXSA9IHNrLT5za19yY3ZidWY7CisJbWVtW1NLX01FTUlORk9fV01FTV9BTExPQ10gPSBza193bWVtX2FsbG9jX2dldChzayk7CisJbWVtW1NLX01FTUlORk9fU05EQlVGXSA9IHNrLT5za19zbmRidWY7CisJbWVtW1NLX01FTUlORk9fRldEX0FMTE9DXSA9IHNrLT5za19mb3J3YXJkX2FsbG9jOworCW1lbVtTS19NRU1JTkZPX1dNRU1fUVVFVUVEXSA9IHNrLT5za193bWVtX3F1ZXVlZDsKKwltZW1bU0tfTUVNSU5GT19PUFRNRU1dID0gYXRvbWljX3JlYWQoJnNrLT5za19vbWVtX2FsbG9jKTsKKworCXJldHVybiAwOworCitydGF0dHJfZmFpbHVyZToKKwlyZXR1cm4gLUVNU0dTSVpFOworfQorRVhQT1JUX1NZTUJPTF9HUEwoc29ja19kaWFnX3B1dF9tZW1pbmZvKTsKKwordm9pZCBzb2NrX2RpYWdfcmVnaXN0ZXJfaW5ldF9jb21wYXQoaW50ICgqZm4pKHN0cnVjdCBza19idWZmICpza2IsIHN0cnVjdCBubG1zZ2hkciAqbmxoKSkKK3sKKwltdXRleF9sb2NrKCZzb2NrX2RpYWdfdGFibGVfbXV0ZXgpOworCWluZXRfcmN2X2NvbXBhdCA9IGZuOworCW11dGV4X3VubG9jaygmc29ja19kaWFnX3RhYmxlX211dGV4KTsKK30KK0VYUE9SVF9TWU1CT0xfR1BMKHNvY2tfZG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WlmIChlcnIpCisJCWdvdG8gb3V0OworCisJZXJyID0gLUVOT01FTTsKKwlyZXAgPSBhbGxvY19za2IoTkxNU0dfU1BBQ0UoKHNpemVvZihzdHJ1Y3QgaW5ldF9kaWFnX21zZykgKworCQkJCSAgICAgc2l6ZW9mKHN0cnVjdCBpbmV0X2RpYWdfbWVtaW5mbykgKworCQkJCSAgICAgNjQpKSwgR0ZQX0tFUk5FTCk7CisJaWYgKCFyZXApCisJCWdvdG8gb3V0OworCisJZXJyID0gaW5ldF9za19kaWFnX2ZpbGwoc2ssIE5VTEwsIHJlcCwgcmVxLAorCQkJICAgTkVUTElOS19DQihpbl9za2IpLnBpZCwKKwkJCSAgIG5saC0+bmxtc2dfc2VxLCAwLCBubGgpOworCWlmIChlcnIgPCAwKSB7CisJCVdBUk5fT04oZXJyID09IC1FTVNHU0laRSk7CisJCWtmcmVlX3NrYihyZXApOworCQlnb3RvIG91dDsKKwl9CisJZXJyID0gbmV0bGlua191bmljYXN0KHNvY2tfZGlhZ19ubHNrLCByZXAsIE5FVExJTktfQ0IoaW5fc2tiKS5waWQsCisJCQkgICAgICBNU0dfRE9OVFdBSVQpOworCWlmIChlcnIgPiAwKQorCQllcnIgPSAwOworb3V0OgorCWlmIChzaykKKwkJc29ja19wdXQoc2spOworb3V0X25vc2s6CisJcmV0dXJuIGVycjsKK30KKworc3RhdGljIHZvaWQgdWRwX2R1bXAoc3RydWN0IHVkcF90YWJsZSAqdGFibGUsIHN0cnVjdCBza19idWZmICpza2IsIHN0cnVjdCBuZXRsaW5rX2NhbGxiYWNrICpjYiwKKwkJc3RydWN0IGluZXRfZGlhZ19yZXEgKnIsIHN0cnVjdCBubGF0dHIgKmJjKQoreworCWludCBudW0sIHNfbnVtLCBzbG90LCBzX3Nsb3Q7CisKKwlzX3Nsb3QgPSBjYi0+YXJnc1swXTsKKwludW0gPSBzX251bSA9IGNiLT5hcmdzWzFdOworCisJZm9yIChzbG90ID0gc19zbG90OyBzbG90IDw9IHRhYm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V2X25hbWUoJmRldi0+ZGV2KSwgY29tbV9tb2RlLCByZl9tb2RlKTsKKworCWlmICghZGV2LT5vcHMtPmRlcF9saW5rX3VwKQorCQlyZXR1cm4gLUVPUE5PVFNVUFA7CisKKwlkZXZpY2VfbG9jaygmZGV2LT5kZXYpOworCisJaWYgKCFkZXZpY2VfaXNfcmVnaXN0ZXJlZCgmZGV2LT5kZXYpKSB7CisJCXJjID0gLUVOT0RFVjsKKwkJZ290byBlcnJvcjsKKwl9CisKKwlpZiAoZGV2LT5kZXBfbGlua191cCA9PSB0cnVlKSB7CisJCXJjID0gLUVBTFJFQURZOworCQlnb3RvIGVycm9yOworCX0KKworCXJjID0gZGV2LT5vcHMtPmRlcF9saW5rX3VwKGRldiwgdGFyZ2V0X2luZGV4LCBjb21tX21vZGUsIHJmX21vZGUpOworCitlcnJvcjoKKwlkZXZpY2VfdW5sb2NrKCZkZXYtPmRldik7CisJcmV0dXJuIHJjOworfQorCitpbnQgbmZjX2RlcF9saW5rX2Rvd24oc3RydWN0IG5mY19kZXYgKmRldikKK3sKKwlpbnQgcmMgPSAwOworCisJcHJfZGVidWcoImRldl9uYW1lPSVzXG4iLCBkZXZfbmFtZSgmZGV2LT5kZXYpKTsKKworCWlmICghZGV2LT5vcHMtPmRlcF9saW5rX2Rvd24pCisJCXJldHVybiAtRU9QTk9UU1VQUDsKKworCWRldmljZV9sb2NrKCZkZXYtPmRldik7CisKKwlpZiAoIWRldmljZV9pc19yZWdpc3RlcmVkKCZkZXYtPmRldikpIHsKKwkJcmMgPSAtRU5PREVWOworCQlnb3RvIGVycm9yOworCX0KKworCWlmIChkZXYtPmRlcF9saW5rX3VwID09IGZhbHNlKSB7CisJCXJjID0gLUVBTFJFQURZOworCQlnb3RvIGVycm9yOworCX0KKworCWlmIChkZXYtPmRlcF9yZl9tb2RlID09IE5GQ19SRl9UQVJHRVQpIHsKKwkJcmMgPSAtRU9QTk9UU1VQUDsKKwkJZ290byBlcnJvcjsKKwl9CisKKwly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dG9fb3BzIGxsY3Bfc29ja19vcHMgPSB7CisJLmZhbWlseSAgICAgICAgID0gUEZfTkZDLAorCS5vd25lciAgICAgICAgICA9IFRISVNfTU9EVUxFLAorCS5iaW5kICAgICAgICAgICA9IGxsY3Bfc29ja19iaW5kLAorCS5jb25uZWN0ICAgICAgICA9IGxsY3Bfc29ja19jb25uZWN0LAorCS5yZWxlYXNlICAgICAgICA9IGxsY3Bfc29ja19yZWxlYXNlLAorCS5zb2NrZXRwYWlyICAgICA9IHNvY2tfbm9fc29ja2V0cGFpciwKKwkuYWNjZXB0ICAgICAgICAgPSBsbGNwX3NvY2tfYWNjZXB0LAorCS5nZXRuYW1lICAgICAgICA9IGxsY3Bfc29ja19nZXRuYW1lLAorCS5wb2xsICAgICAgICAgICA9IGxsY3Bfc29ja19wb2xsLAorCS5pb2N0bCAgICAgICAgICA9IHNvY2tfbm9faW9jdGwsCisJLmxpc3RlbiAgICAgICAgID0gbGxjcF9zb2NrX2xpc3RlbiwKKwkuc2h1dGRvd24gICAgICAgPSBzb2NrX25vX3NodXRkb3duLAorCS5zZXRzb2Nrb3B0ICAgICA9IHNvY2tfbm9fc2V0c29ja29wdCwKKwkuZ2V0c29ja29wdCAgICAgPSBzb2NrX25vX2dldHNvY2tvcHQsCisJLnNlbmRtc2cgICAgICAgID0gc29ja19ub19zZW5kbXNnLAorCS5yZWN2bXNnICAgICAgICA9IGxsY3Bfc29ja19yZWN2bXNnLAorCS5tbWFwICAgICAgICAgICA9IHNvY2tfbm9fbW1hcCwKK307CisKK3N0YXRpYyB2b2lkIGxsY3Bfc29ja19kZXN0cnVjdChzdHJ1Y3Qgc29jayAqc2spCit7CisJc3RydWN0IG5mY19sbGNwX3NvY2sgKmxsY3Bfc29jayA9IG5mY19sbGNwX3NvY2soc2spOworCisJcHJfZGVidWcoIiVwXG4iLCBzayk7CisKKwlpZiAoc2stPnNrX3N0YXRlID09IExMQ1BfQ09OTkVDVEVEKQorCQluZmNfcHV0X2RldmljZShsbG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1NFVDoKKwkJCWVyciA9IHZhbGlkYXRlX3NldChhLCBrZXkpOworCQkJaWYgKGVycikKKwkJCQlyZXR1cm4gZXJyOworCQkJYnJlYWs7CisKKwkJY2FzZSBPVlNfQUNUSU9OX0FUVFJfU0FNUExFOgorCQkJZXJyID0gdmFsaWRhdGVfc2FtcGxlKGEsIGtleSwgZGVwdGgpOworCQkJaWYgKGVycikKKwkJCQlyZXR1cm4gZXJyOworCQkJYnJlYWs7CisKKwkJZGVmYXVsdDoKKwkJCXJldHVybiAtRUlOVkFMOworCQl9CisJfQorCisJaWYgKHJlbSA+IDApCisJCXJldHVybiAtRUlOVkFMOworCisJcmV0dXJuIDA7Cit9CisKK3N0YXRpYyB2b2lkIGNsZWFyX3N0YXRzKHN0cnVjdCBzd19mbG93ICpmbG93KQoreworCWZsb3ctPnVzZWQgPSAwOworCWZsb3ctPnRjcF9mbGFncyA9IDA7CisJZmxvdy0+cGFja2V0X2NvdW50ID0gMDsKKwlmbG93LT5ieXRlX2NvdW50ID0gMDsKK30KKworc3RhdGljIGludCBvdnNfcGFja2V0X2NtZF9leGVjdXRlKHN0cnVjdCBza19idWZmICpza2IsIHN0cnVjdCBnZW5sX2luZm8gKmluZm8pCit7CisJc3RydWN0IG92c19oZWFkZXIgKm92c19oZWFkZXIgPSBpbmZvLT51c2VyaGRyOworCXN0cnVjdCBubGF0dHIgKiphID0gaW5mby0+YXR0cnM7CisJc3RydWN0IHN3X2Zsb3dfYWN0aW9ucyAqYWN0czsKKwlzdHJ1Y3Qgc2tfYnVmZiAqcGFja2V0OworCXN0cnVjdCBzd19mbG93ICpmbG93OworCXN0cnVjdCBkYXRhcGF0aCAqZHA7CisJc3RydWN0IGV0aGhkciAqZXRoOworCWludCBsZW47CisJaW50IGVycjsKKwlpbnQga2V5X2xlbjsKKworCWVyciA9IC1FSU5WQUw7CisJaWYgKCFhW09WU19QQUNLRVRfQVRUUl9QQUNLRVRdIHx8ICFhW09WU19QQUNLRVRfQVRUUl9LRVld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