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zBdLGlvWzFdLGlsLGlyLHQwLHQxKTsKKwlDQU1FTExJQV9ST1VORFNNKGlvWzBdLGlvWzFdLAorCQkJIENBTUVMTElBX1NVQktFWV9MKDIyKSxDQU1FTExJQV9TVUJLRVlfUigyMiksCisJCQkgaW9bMl0saW9bM10saWwsaXIsdDAsdDEpOworCUNBTUVMTElBX1JPVU5EU00oaW9bMl0saW9bM10sCisJCQkgQ0FNRUxMSUFfU1VCS0VZX0woMjMpLENBTUVMTElBX1NVQktFWV9SKDIzKSwKKwkJCSBpb1swXSxpb1sxXSxpbCxpcix0MCx0MSk7CisKKwkvKiBwb3N0IHdoaXRlbmluZyBidXQga3c0ICovCisJaW9bMl0gXj0gQ0FNRUxMSUFfU1VCS0VZX0woMjQpOworCWlvWzNdIF49IENBTUVMTElBX1NVQktFWV9SKDI0KTsKKworCXQwID0gaW9bMF07CisJdDEgPSBpb1sxXTsKKwlpb1swXSA9IGlvWzJdOworCWlvWzFdID0gaW9bM107CisJaW9bMl0gPSB0MDsKKwlpb1szXSA9IHQxOworCisJaW9fdGV4dFswXSA9IGNwdV90b19iZTMyKGlvWzBdKTsKKwlpb190ZXh0WzFdID0gY3B1X3RvX2JlMzIoaW9bMV0pOworCWlvX3RleHRbMl0gPSBjcHVfdG9fYmUzMihpb1syXSk7CisJaW9fdGV4dFszXSA9IGNwdV90b19iZTMyKGlvWzNdKTsKKworCXJldHVybjsKK30KKworc3RhdGljIHZvaWQgY2FtZWxsaWFfZGVjcnlwdDEyOChjb25zdCB1MzIgKnN1YmtleSwgX19iZTMyICppb190ZXh0KQoreworCXUzMiBpbCxpcix0MCx0MTsgICAgICAgICAgICAgICAvKiB0ZW1wb3JhcnkgdmFsaWFibGVzICovCisKKwl1MzIgaW9bNF07CisKKwlpb1swXSA9IGJlMzJfdG9fY3B1KGlvX3RleHRbMF0pOworCWlvWzFdID0gYmUzMl90b19jcHUoaW9fdGV4dFsxXSk7CisJaW9bMl0gPSBiZTMyX3RvX2NwdShpb190ZXh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0FNRUxMSUFfU1VCS0VZX1IoMiksCisJCQkgaW9bMF0saW9bMV0saWwsaXIsdDAsdDEpOworCisJLyogcG9zdCB3aGl0ZW5pbmcgYnV0IGt3NCAqLworCWlvWzJdIF49IENBTUVMTElBX1NVQktFWV9MKDApOworCWlvWzNdIF49IENBTUVMTElBX1NVQktFWV9SKDApOworCisJdDAgPSBpb1swXTsKKwl0MSA9IGlvWzFdOworCWlvWzBdID0gaW9bMl07CisJaW9bMV0gPSBpb1szXTsKKwlpb1syXSA9IHQwOworCWlvWzNdID0gdDE7CisKKwlpb190ZXh0WzBdID0gY3B1X3RvX2JlMzIoaW9bMF0pOworCWlvX3RleHRbMV0gPSBjcHVfdG9fYmUzMihpb1sxXSk7CisJaW9fdGV4dFsyXSA9IGNwdV90b19iZTMyKGlvWzJdKTsKKwlpb190ZXh0WzNdID0gY3B1X3RvX2JlMzIoaW9bM10pOworCisJcmV0dXJuOworfQorCisKKy8qKgorICogc3R1ZmYgZm9yIDE5MiBhbmQgMjU2Yml0IGVuY3J5cHRpb24vZGVjcnlwdGlvbgorICovCitzdGF0aWMgdm9pZCBjYW1lbGxpYV9lbmNyeXB0MjU2KGNvbnN0IHUzMiAqc3Via2V5LCBfX2JlMzIgKmlvX3RleHQpCit7CisJdTMyIGlsLGlyLHQwLHQxOyAgICAgICAgICAgLyogdGVtcG9yYXJ5IHZhbGlhYmxlcyAqLworCisJdTMyIGlvWzRdOworCisJaW9bMF0gPSBiZTMyX3RvX2NwdShpb190ZXh0WzBdKTsKKwlpb1sxXSA9IGJlMzJfdG9fY3B1KGlvX3RleHRbMV0pOworCWlvWzJdID0gYmUzMl90b19jcHUoaW9fdGV4dFsyXSk7CisJaW9bM10gPSBiZTMyX3RvX2NwdShpb190ZXh0WzNdKTsKKworCS8qIHByZSB3aGl0ZW5pbmcgYnV0IGFic29yYiBrdzIqLworCWlvWzBdIF49IENBTUVMTElBX1NVQktFWV9MKDApOworCWlvWzFdIF49IENBTUVMTElBX1NVQktF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zMl90b19jcHUoeCA8PCAzKQorc3RhdGljIGNvbnN0IHUzMiBzYm94MFsyNTZdID0geworCVooMHhlYSksIFooMHg3ZiksIFooMHhiMiksIFooMHg2NCksIFooMHg5ZCksIFooMHhiMCksIFooMHhkOSksIFooMHgxMSksCisJWigweGNkKSwgWigweDg2KSwgWigweDg2KSwgWigweDkxKSwgWigweDBhKSwgWigweGIyKSwgWigweDkzKSwgWigweDA2KSwKKwlaKDB4MGUpLCBaKDB4MDYpLCBaKDB4ZDIpLCBaKDB4NjUpLCBaKDB4NzMpLCBaKDB4YzUpLCBaKDB4MjgpLCBaKDB4NjApLAorCVooMHhmMiksIFooMHgyMCksIFooMHhiNSksIFooMHgzOCksIFooMHg3ZSksIFooMHhkYSksIFooMHg5ZiksIFooMHhlMyksCisJWigweGQyKSwgWigweGNmKSwgWigweGM0KSwgWigweDNjKSwgWigweDYxKSwgWigweGZmKSwgWigweDRhKSwgWigweDRhKSwKKwlaKDB4MzUpLCBaKDB4YWMpLCBaKDB4YWEpLCBaKDB4NWYpLCBaKDB4MmIpLCBaKDB4YmIpLCBaKDB4YmMpLCBaKDB4NTMpLAorCVooMHg0ZSksIFooMHg5ZCksIFooMHg3OCksIFooMHhhMyksIFooMHhkYyksIFooMHgwOSksIFooMHgzMiksIFooMHgxMCksCisJWigweGM2KSwgWigweDZmKSwgWigweDY2KSwgWigweGQ2KSwgWigweGFiKSwgWigweGE5KSwgWigweGFmKSwgWigweGZkKSwKKwlaKDB4M2IpLCBaKDB4OTUpLCBaKDB4ZTgpLCBaKDB4MzQpLCBaKDB4OWEpLCBaKDB4ODEpLCBaKDB4NzIpLCBaKDB4ODApLAorCVooMHg5YyksIFooMHhmMyksIFooMHhlYyksIFooMHhkYSksIFooMHg5ZiksIFooMHgyNiksIFooMHg3NiksIFooMHgxNSksCisJWigweDNlKSwgWigweDU1KSwgWigweDRkKSwgWigweGRlKSwgWigweDg0KSwgWigweGVlKSwgWigweGFkKSwgWigweGM3KSwKKwlaKDB4ZjEpLCBaKDB4NmIpLCBaKDB4M2QpLCBaKDB4ZDMpLCBaKDB4MDQpLCBaKDB4NDkpLCBaKDB4YWEpLCBaKDB4MjQpLAorCVooMHgwYiksIFooMHg4YSksIFooMHg4MyksIFooMHhiYSksIFooMHhmYSksIFooMHg4NSksIFooMHhhMCksIFooMHhhOCksCisJWigweGIxKSwgWigweGQ0KSwgWigweDAxKSwgWigweGQ4KSwgWigweDcwKSwgWigweDY0KSwgWigweGYwKSwgWigweDUxKSwKKwlaKDB4ZDIpLCBaKDB4YzMpLCBaKDB4YTcpLCBaKDB4NzUpLCBaKDB4OGMpLCBaKDB4YTUpLCBaKDB4NjQpLCBaKDB4ZWYpLAorCVooMHgxMCksIFooMHg0ZSksIFooMHhiNyksIFooMHhjNiksIFooMHg2MSksIFooMHgwMyksIFooMHhlYiksIFooMHg0NCksCisJWigweDNkKSwgWigweGU1KSwgWigweGIzKSwgWigweDViKSwgWigweGFlKSwgWigweGQ1KSwgWigweGFkKSwgWigweDFkKSwKKwlaKDB4ZmEpLCBaKDB4NWEpLCBaKDB4MWUpLCBaKDB4MzMpLCBaKDB4YWIpLCBaKDB4OTMpLCBaKDB4YTIpLCBaKDB4YjcpLAorCVooMHhlNyksIFooMHhhOCksIFooMHg0NSksIFooMHhhNCksIFooMHhjZCksIFooMHgyOSksIFooMHg2MyksIFooMHg0NCksCisJWigweGI2KSwgWigweDY5KSwgWigweDdlKSwgWigweDJlKSwgWigweDYyKSwgWigweDAzKSwgWigweGM4KSwgWigweGUwKSwKKwlaKDB4MTcpLCBaKDB4YmIpLCBaKDB4YzcpLCBaKDB4ZjMpLCBaKDB4M2YpLCBaKDB4MzYpLCBaKDB4YmEpLCBaKDB4NzEpLAorCVooMHg4ZSksIFooMHg5NyksIFooMHg2NSksIFooMHg2MCksIFooMHg2OSksIFooMHhiNiksIFooMHhmNiksIFooMHhlNiksCisJWigweDZlKSwgWigweGUwKSwgWigweDgxKSwgWigweDU5KSwgWigweGU4KSwgWigweGFmKSwgWigweGRkKSwgWigweDk1KSwKKwlaKDB4MjIpLCBaKDB4OTkpLCBaKDB4ZmQpLCBaKDB4NjMpLCBaKDB4MTkpLCBaKDB4NzQpLCBaKDB4NjEpLCBaKDB4YjEpLAorCVooMHhiNiksIFooMHg1YiksIFooMHhhZSksIFooMHg1NCksIFooMHhiMyksIFooMHg3MCksIFooMHhmZiksIFooMHhjNiksCisJWigweDNiKSwgWigweDNlKSwgWigweGMxKSwgWigweGQ3KSwgWigweGUxKSwgWigweDBlKSwgWigweDc2KSwgWigweGU1KSwKKwlaKDB4MzYpLCBaKDB4NGYpLCBaKDB4NTkpLCBaKDB4YzcpLCBaKDB4MDgpLCBaKDB4NmUpLCBaKDB4ODIpLCBaKDB4YTYpLAorCVooMHg5MyksIFooMHhjNCksIFooMHhhYSksIFooMHgyNiksIFooMHg0OSksIFooMHhlMCksIFooMHgyMSksIFooMHg2NCksCisJWigweDA3KSwgWigweDlmKSwgWigweDY0KSwgWigweDgxKSwgWigweDljKSwgWigweGJmKSwgWigweGY5KSwgWigweGQxKSwKKwlaKDB4NDMpLCBaKDB4ZjgpLCBaKDB4YjYpLCBaKDB4YjkpLCBaKDB4ZjEpLCBaKDB4MjQpLCBaKDB4NzUpLCBaKDB4MDMpLAorCVooMHhlNCksIFooMHhiMCksIFooMHg5OSksIFooMHg0NiksIFooMHgzZCksIFooMHhmNSksIFooMHhkMSksIFooMHgzOSksCisJWigweDcyKSwgWigweDEyKSwgWigweGY2KSwgWigweGJhKSwgWigweDBjKSwgWigweDBkKSwgWigweDQyKSwgWigweDJlKQorfTsKKworI3VuZGVmIFoKKyNkZWZpbmUgWih4KSBfX2NvbnN0YW50X2JlMzJfdG9fY3B1KCh4IDw8IDI3KSB8ICh4ID4+IDUpKQorc3RhdGljIGNvbnN0IHUzMiBzYm94MVsyNTZdID0geworCVooMHg3NyksIFooMHgxNCksIFooMHhhNiksIFooMHhmZSksIFooMHhiMiksIFooMHg1ZSksIFooMHg4YyksIFooMHgzZSksCisJWigweDY3KSwgWigweDZjKSwgWigweGExKSwgWigweDBkKSwgWigweGMyKSwgWigweGEyKSwgWigweGMxKSwgWigweDg1KSwKKwlaKDB4NmMpLCBaKDB4N2IpLCBaKDB4NjcpLCBaKDB4YzYpLCBaKDB4MjMpLCBaKDB4ZTMpLCBaKDB4ZjIpLCBaKDB4ODkpLAorCVooMHg1MCksIFooMHg5YyksIFooMHgwMyksIFooMHhiNyksIFooMHg3MyksIFooMHhlNiksIFooMHhlMSksIFooMHgzOSksCisJWigweDMxKSwgWigweDJjKSwgWigweDI3KSwgWigweDlmKSwgWigweGE1KSwgWigweDY5KSwgWigweDQ0KSwgWigweGQ2KSwKKwlaKDB4MjMpLCBaKDB4ODMpLCBaKDB4OTgpLCBaKDB4N2QpLCBaKDB4M2MpLCBaKDB4YjQpLCBaKDB4MmQpLCBaKDB4OTkpLAorCVooMHgxYyksIFooMHgxZiksIFooMHg4YyksIFooMHgyMCksIFooMHgwMyksIFooMHg3YyksIFooMHg1ZiksIFooMHhhZCksCisJWigweGY0KSwgWigweGZhKSwgWigweDk1KSwgWigweGNhKSwgWigweDc2KSwgWigweDQ0KSwgWigweGNkKSwgWigweGI2KSwKKwlaKDB4YjgpLCBaKDB4YTEpLCBaKDB4YTEpLCBaKDB4YmUpLCBaKDB4OWUpLCBaKDB4NTQpLCBaKDB4OGYpLCBaKDB4MGIpLAorCVooMHgxNiksIFooMHg3NCksIFooMHgzMSksIFooMHg4YSksIFooMHgyMyksIFooMHgxNyksIFooMHgwNCksIFooMHhmYSksCisJWigweDc5KSwgWigweDg0KSwgWigweGIxKSwgWigweGY1KSwgWigweDEzKSwgWigweGFiKSwgWigweGI1KSwgWigweDJlKSwKKwlaKDB4YWEpLCBaKDB4MGMpLCBaKDB4NjApLCBaKDB4NmIpLCBaKDB4NWIpLCBaKDB4YzQpLCBaKDB4NGIpLCBaKDB4YmMpLAorCVooMHhlMiksIFooMHhhZiksIFooMHg0NSksIFooMHg3MyksIFooMHhmYSksIFooMHhjOSksIFooMHg0OSksIFooMHhjZCksCisJWigweDAwKSwgWigweDkyKSwgWigweDdkKSwgWigweDk3KSwgWigweDdhKSwgWigweDE4KSwgWigweDYwKSwgWigweDNkKSwKKwlaKDB4Y2YpLCBaKDB4NWIpLCBaKDB4ZGUpLCBaKDB4YzYpLCBaKDB4ZTIpLCBaKDB4ZTYpLCBaKDB4YmIpLCBaKDB4OGIpLAorCVooMHgwNiksIFooMHhkYSksIFooMHgwOCksIFooMHgxNSksIFooMHgxYiksIFooMHg4OCksIFooMHg2YSksIFooMHgxNyksCisJWigweDg5KSwgWigweGQwKSwgWigweGE5KSwgWigweGMxKSwgWigweGM5KSwgWigweDcwKSwgWigweDZiKSwgWigweGU1KSwKKwlaKDB4NDMpLCBaKDB4ZjQpLCBaKDB4NjgpLCBaKDB4YzgpLCBaKDB4ZDMpLCBaKDB4ODQpLCBaKDB4MjgpLCBaKDB4MGEpLAorCVooMHg1MiksIFooMHg2NiksIFooMHhhMyksIFooMHhjYSksIFooMHhmMiksIFooMHhlMyksIFooMHg3ZiksIFooMHg3YSksCisJWigweDMxKSwgWigweGY3KSwgWigweDg4KSwgWigweDk0KSwgWigweDVlKSwgWigweDljKSwgWigweDYzKSwgWigweGQ1KSwKKwlaKDB4MjQpLCBaKDB4NjYpLCBaKDB4ZmMpLCBaKDB4YjMpLCBaKDB4NTcpLCBaKDB4MjUpLCBaKDB4YmUpLCBaKDB4ODkpLAorCVooMHg0NCksIFooMHhjNCksIFooMHhlMCksIFooMHg4ZiksIFooMHgyMyksIFooMHgzYyksIFooMHgxMiksIFooMHg1MiksCisJWigweGY1KSwgWigweDFlKSwgWigweGY0KSwgWigweGNiKSwgWigweDE4KSwgWigweDMzKSwgWigweDFmKSwgWigweGY4KSwKKwlaKDB4NjkpLCBaKDB4MTApLCBaKDB4OWQpLCBaKDB4ZDMpLCBaKDB4ZjcpLCBaKDB4MjgpLCBaKDB4ZjgpLCBaKDB4MzApLAorCVooMHgwNSksIFooMHg1ZSksIFooMHgzMiksIFooMHhjMCksIFooMHhkNSksIFooMHgxOSksIFooMHhiZCksIFooMHg0NSksCisJWigweDhiKSwgWigweDViKSwgWigweGZkKSwgWigweGJjKSwgWigweGUyKSwgWigweDVjKSwgWigweGE5KSwgWigweDk2KSwKKwlaKDB4ZWYpLCBaKDB4NzApLCBaKDB4Y2YpLCBaKDB4YzIpLCBaKDB4MmEpLCBaKDB4YjMpLCBaKDB4NjEpLCBaKDB4YWQpLAorCVooMHg4MCksIFooMHg0OCksIFooMHg4MSksIFooMHhiNyksIFooMHgxZCksIFooMHg0MyksIFooMHhkOSksIFooMHhkNyksCisJWigweDQ1KSwgWigweGYwKSwgWigweGQ4KSwgWigweDhhKSwgWigweDU5KSwgWigweDdjKSwgWigweDU3KSwgWigweGMxKSwKKwlaKDB4NzkpLCBaKDB4YzcpLCBaKDB4MzQpLCBaKDB4ZDYpLCBaKDB4NDMpLCBaKDB4ZGYpLCBaKDB4ZTQpLCBaKDB4NzgpLAorCVooMHgxNiksIFooMHgwNiksIFooMHhkYSksIFooMHg5MiksIFooMHg3NiksIFooMHg1MSksIFooMHhlMSksIFooMHhkNCksCisJWigweDcwKSwgWigweDAzKSwgWigweGUwKSwgWigweDJmKSwgWigweDk2KSwgWigweDkxKSwgWigweDgyKSwgWigweDgwKQorfTsKKworI3VuZGVmIFoKKyNkZWZpbmUgWih4KSBfX2NvbnN0YW50X2JlMzJfdG9fY3B1KHggPDwgMTEpCitzdGF0aWMgY29uc3QgdTMyIHNib3gyWzI1Nl0gPSB7CisJWigweGYwKSwgWigweDM3KSwgWigweDI0KSwgWigweDUzKSwgWigweDJhKSwgWigweDAzKSwgWigweDgzKSwgWigweDg2KSwKKwlaKDB4ZDEpLCBaKDB4ZWMpLCBaKDB4NTApLCBaKDB4ZjApLCBaKDB4NDIpLCBaKDB4NzgpLCBaKDB4MmYpLCBaKDB4NmQpLAorCVooMHhiZiksIFooMHg4MCksIFooMHg4NyksIFooMHgyNyksIFooMHg5NSksIFooMHhlMiksIFooMHhjNSksIFooMHg1ZCksCisJWigweGY5KSwgWigweDZmKSwgWigweGRiKSwgWigweGI0KSwgWigweDY1KSwgWigweDZlKSwgWigweGU3KSwgWigweDI0KSwKKwlaKDB4YzgpLCBaKDB4MWEpLCBaKDB4YmIpLCBaKDB4NDkpLCBaKDB4YjUpLCBaKDB4MGEpLCBaKDB4N2QpLCBaKDB4YjkpLAorCVooMHhlOCksIFooMHhkYyksIFooMHhiNyksIFooMHhkOSksIFooMHg0NSksIFooMHgyMCksIFooMHgxYiksIFooMHhjZSksCisJWigweDU5KSwgWigweDlkKSwgWigweDZiKSwgWigweGJkKSwgWigweDBlKSwgWigweDhmKSwgWigweGEzKSwgWigweGE5KSwKKwlaKDB4YmMpLCBaKDB4NzQpLCBaKDB4YTYpLCBaKDB4ZjYpLCBaKDB4N2YpLCBaKDB4NWYpLCBaKDB4YjEpLCBaKDB4NjgpLAorCVooMHg4NCksIFooMHhiYyksIFooMHhhOSksIFooMHhmZCksIFooMHg1NSksIFooMHg1MCksIFooMHhlOSksIFooMHhiNiksCisJWigweDEzKSwgWigweDVlKSwgWigweDA3KSwgWigweGI4KSwgWigweDk1KSwgWigweDAyKSwgWigweGMwKSwgWigweGQwKSwKKwlaKDB4NmEpLCBaKDB4MWEpLCBaKDB4ODUpLCBaKDB4YmQpLCBaKDB4YjYpLCBaKDB4ZmQpLCBaKDB4ZmUpLCBaKDB4MTcpLAorCVooMHgzZiksIFooMHgwOSksIFooMHhhMyksIFooMHg4ZCksIFooMHhmYiksIFooMHhlZCksIFooMHhkYSksIFooMHgxZCksCisJWigweDZkKSwgWigweDFjKSwgWigweDZjKSwgWigweDAxKSwgWigweDVhKSwgWigweGU1KSwgWigweDcxKSwgWigweDNlKSwKKwlaKDB4OGIpLCBaKDB4NmIpLCBaKDB4YmUpLCBaKDB4MjkpLCBaKDB4ZWIpLCBaKDB4MTIpLCBaKDB4MTkpLCBaKDB4MzQpLAorCVooMHhjZCksIFooMHhiMyksIFooMHhiZCksIFooMHgzNSksIFooMHhlYSksIFooMHg0YiksIFooMHhkNSksIFooMHhhZSksCisJWigweDJhKSwgWigweDc5KSwgWigweDVhKSwgWigweGE1KSwgWigweDMyKSwgWigweDEyKSwgWigweDdiKSwgWigweGRjKSwKKwlaKDB4MmMpLCBaKDB4ZDApLCBaKDB4MjIpLCBaKDB4NGIpLCBaKDB4YjEpLCBaKDB4ODUpLCBaKDB4NTkpLCBaKDB4ODApLAorCVooMHhjMCksIFooMHgzMCksIFooMHg5ZiksIFooMHg3MyksIFooMHhkMyksIFooMHgxNCksIFooMHg0OCksIFooMHg0MCksCisJWigweDA3KSwgWigweDJkKSwgWigweDhmKSwgWigweDgwKSwgWigweDBmKSwgWigweGNlKSwgWigweDBiKSwgWigweDVlKSwKKwlaKDB4YjcpLCBaKDB4NWUpLCBaKDB4YWMpLCBaKDB4MjQpLCBaKDB4OTQpLCBaKDB4NGEpLCBaKDB4MTgpLCBaKDB4MTUpLAorCVooMHgwNSksIFooMHhlOCksIFooMHgwMiksIFooMHg3NyksIFooMHhhOSksIFooMHhjNyksIFooMHg0MCksIFooMHg0NSksCisJWigweDg5KSwgWigweGQxKSwgWigweGVhKSwgWigweGRlKSwgWigweDBjKSwgWigweDc5KSwgWigweDJhKSwgWigweDk5KSwKKwlaKDB4NmMpLCBaKDB4M2UpLCBaKDB4OTUpLCBaKDB4ZGQpLCBaKDB4OGMpLCBaKDB4N2QpLCBaKDB4YWQpLCBaKDB4NmYpLAorCVooMHhkYyksIFooMHhmZiksIFooMHhmZCksIFooMHg2MiksIFooMHg0NyksIFooMHhiMyksIFooMHgyMSksIFooMHg4YSksCisJWigweGVjKSwgWigweDhlKSwgWigweDE5KSwgWigweDE4KSwgWigweGI0KSwgWigweDZlKSwgWigweDNkKSwgWigweGZkKSwKKwlaKDB4NzQpLCBaKDB4NTQpLCBaKDB4MWUpLCBaKDB4MDQpLCBaKDB4ODUpLCBaKDB4ZDgpLCBaKDB4YmMpLCBaKDB4MWYpLAorCVooMHg1NiksIFooMHhlNyksIFooMHgzYSksIFooMHg1NiksIFooMHg2NyksIFooMHhkNiksIFooMHhjOCksIFooMHhhNSksCisJWigweGYzKSwgWigweDhlKSwgWigweGRlKSwgWigweGFlKSwgWigweDM3KSwgWigweDQ5KSwgWigweGI3KSwgWigweGZhKSwKKwlaKDB4YzgpLCBaKDB4ZjQpLCBaKDB4MWYpLCBaKDB4ZTApLCBaKDB4MmEpLCBaKDB4OWIpLCBaKDB4MTUpLCBaKDB4ZDEpLAorCVooMHgzNCksIFooMHgwZSksIFooMHhiNSksIFooMHhlMCksIFooMHg0NCksIFooMHg3OCksIFooMHg4NCksIFooMHg1OSksCisJWigweDU2KSwgWigweDY4KSwgWigweDc3KSwgWigweGE1KSwgWigweDE0KSwgWigweDA2KSwgWigweGY1KSwgWigweDJmKSwKKwlaKDB4OGMpLCBaKDB4OGEpLCBaKDB4NzMpLCBaKDB4ODApLCBaKDB4NzYpLCBaKDB4YjQpLCBaKDB4MTApLCBaKDB4ODYpCit9OworCisjdW5kZWYgWgorI2RlZmluZSBaKHgpIF9fY29uc3RhbnRfYmUzMl90b19jcHUoeCA8PCAxOSkKK3N0YXRpYyBjb25zdCB1MzIgc2JveDNbMjU2XSA9IHsKKwlaKDB4YTkpLCBaKDB4MmEpLCBaKDB4NDgpLCBaKDB4NTEpLCBaKDB4ODQpLCBaKDB4N2UpLCBaKDB4NDkpLCBaKDB4ZTIpLAorCVooMHhiNSksIFooMHhiNyksIFooMHg0MiksIFooMHgzMyksIFooMHg3ZCksIFooMHg1ZCksIFooMHhhNiksIFooMHgxMiksCisJWigweDQ0KSwgWigweDQ4KSwgWigweDZkKSwgWigweDI4KSwgWigweGFhKSwgWigweDIwKSwgWigweDZkKSwgWigweDU3KSwKKwlaKDB4ZDYpLCBaKDB4NmIpLCBaKDB4NWQpLCBaKDB4NzIpLCBaKDB4ZjApLCBaKDB4OTIpLCBaKDB4NWEpLCBaKDB4MWIpLAorCVooMHg1MyksIFooMHg4MCksIFooMHgyNCksIFooMHg3MCksIFooMHg5YSksIFooMHhjYyksIFooMHhhNyksIFooMHg2NiksCisJWigweGExKSwgWigweDAxKSwgWigweGE1KSwgWigweDQxKSwgWigweDk3KSwgWigweDQxKSwgWigweDMxKSwgWigweDgyKSwKKwlaKDB4ZjEpLCBaKDB4MTQpLCBaKDB4Y2YpLCBaKDB4NTMpLCBaKDB4MGQpLCBaKDB4YTApLCBaKDB4MTApLCBaKDB4Y2MpLAorCVooMHgyYSksIFooMHg3ZCksIFooMHhkMiksIFooMHhiZiksIFooMHg0YiksIFooMHgxYSksIFooMHhkYiksIFooMHgxNiksCisJWigweDQ3KSwgWigweGY2KSwgWigweDUxKSwgWigweDM2KSwgWigweGVkKSwgWigweGYzKSwgWigweGI5KSwgWigweDFhKSwKKwlaKDB4YTcpLCBaKDB4ZGYpLCBaKDB4MjkpLCBaKDB4NDMpLCBaKDB4MDEpLCBaKDB4NTQpLCBaKDB4NzApLCBaKDB4YTQpLAorCVooMHhiZiksIFooMHhkNCksIFooMHgwYiksIFooMHg1MyksIFooMHg0NCksIFooMHg2MCksIFooMHg5ZSksIFooMHgyMyksCisJWigweGExKSwgWigweDE4KSwgWigweDY4KSwgWigweDRmKSwgWigweGYwKSwgWigweDJmKSwgWigweDgyKSwgWigweGMyKSwKKwlaKDB4MmEpLCBaKDB4NDEpLCBaKDB4YjIpLCBaKDB4NDIpLCBaKDB4MGMpLCBaKDB4ZWQpLCBaKDB4MGMpLCBaKDB4MWQpLAorCVooMHgxMyksIFooMHgzYSksIFooMHgzYyksIFooMHg2ZSksIFooMHgzNSksIFooMHhkYyksIFooMHg2MCksIFooMHg2NSksCisJWigweDg1KSwgWigweGU5KSwgWigweDY0KSwgWigweDAyKSwgWigweDlhKSwgWigweDNmKSwgWigweDlmKSwgWigweDg3KSwKKwlaKDB4OTYpLCBaKDB4ZGYpLCBaKDB4YmUpLCBaKDB4ZjIpLCBaKDB4Y2IpLCBaKDB4ZTUpLCBaKDB4NmMpLCBaKDB4ZDQpLAorCVooMHg1YSksIFooMHg4MyksIFooMHhiZiksIFooMHg5MiksIFooMHgxYiksIFooMHg5NCksIFooMHgwMCksIFooMHg0MiksCisJWigweGNmKSwgWigweDRiKSwgWigweDAwKSwgWigweDc1KSwgWigweGJhKSwgWigweDhmKSwgWigweDc2KSwgWigweDVmKSwKKwlaKDB4NWQpLCBaKDB4M2EpLCBaKDB4NGQpLCBaKDB4MDkpLCBaKDB4MTIpLCBaKDB4MDgpLCBaKDB4MzgpLCBaKDB4OTUpLAorCVooMHgxNyksIFooMHhlNCksIFooMHgwMSksIFooMHgxZCksIFooMHg0YyksIFooMHhhOSksIFooMHhjYyksIFooMHg4NSksCisJWigweDgyKSwgWigweDRjKSwgWigweDlkKSwgWigweDJmKSwgWigweDNiKSwgWigweDY2KSwgWigweGExKSwgWigweDM0KSwKKwlaKDB4MTApLCBaKDB4Y2QpLCBaKDB4NTkpLCBaKDB4ODkpLCBaKDB4YTUpLCBaKDB4MzEpLCBaKDB4Y2YpLCBaKDB4MDUpLAorCVooMHhjOCksIFooMHg4NCksIFooMHhmYSksIFooMHhjNyksIFooMHhiYSksIFooMHg0ZSksIFooMHg4YiksIFooMHgxYSksCisJWigweDE5KSwgWigweGYxKSwgWigweGExKSwgWigweDNiKSwgWigweDE4KSwgWigweDEyKSwgWigweDE3KSwgWigweGIwKSwKKwlaKDB4OTgpLCBaKDB4OGQpLCBaKDB4MGIpLCBaKDB4MjMpLCBaKDB4YzMpLCBaKDB4M2EpLCBaKDB4MmQpLCBaKDB4MjApLAorCVooMHhkZiksIFooMHgxMyksIFooMHhhMCksIFooMHhhOCksIFooMHg0YyksIFooMHgwZCksIFooMHg2YyksIFooMHgyZiksCisJWigweDQ3KSwgWigweDEzKSwgWigweDEzKSwgWigweDUyKSwgWigweDFmKSwgWigweDJkKSwgWigweGY1KSwgWigweDc5KSwKKwlaKDB4M2QpLCBaKDB4YTIpLCBaKDB4NTQpLCBaKDB4YmQpL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RyKQorCQkJbmJ5dGVzID0gY3J5cHRvX3BjYmNfZGVjcnlwdF9pbnBsYWNlKGRlc2MsICZ3YWxrLCBjaGlsZCwKKwkJCQkJCQkgICAgIHhvcik7CisJCWVsc2UKKwkJCW5ieXRlcyA9IGNyeXB0b19wY2JjX2RlY3J5cHRfc2VnbWVudChkZXNjLCAmd2FsaywgY2hpbGQsCisJCQkJCQkJICAgICB4b3IpOworCQllcnIgPSBibGtjaXBoZXJfd2Fsa19kb25lKGRlc2MsICZ3YWxrLCBuYnl0ZXMpOworCX0KKworCXJldHVybiBlcnI7Cit9CisKK3N0YXRpYyB2b2lkIHhvcl9ieXRlKHU4ICphLCBjb25zdCB1OCAqYiwgdW5zaWduZWQgaW50IGJzKQoreworCWRvIHsKKwkJKmErKyBePSAqYisrOworCX0gd2hpbGUgKC0tYnMpOworfQorCitzdGF0aWMgdm9pZCB4b3JfcXVhZCh1OCAqZHN0LCBjb25zdCB1OCAqc3JjLCB1bnNpZ25lZCBpbnQgYnMpCit7CisJdTMyICphID0gKHUzMiAqKWRzdDsKKwl1MzIgKmIgPSAodTMyICopc3JjOworCisJZG8geworCQkqYSsrIF49ICpiKys7CisJfSB3aGlsZSAoKGJzIC09IDQpKTsKK30KKworc3RhdGljIHZvaWQgeG9yXzY0KHU4ICphLCBjb25zdCB1OCAqYiwgdW5zaWduZWQgaW50IGJzKQoreworCSgodTMyICopYSlbMF0gXj0gKCh1MzIgKiliKVswXTsKKwkoKHUzMiAqKWEpWzFdIF49ICgodTMyICopYilbMV07Cit9CisKK3N0YXRpYyB2b2lkIHhvcl8xMjgodTggKmEsIGNvbnN0IHU4ICpiLCB1bnNpZ25lZCBpbnQgYnMpCit7CisJKCh1MzIgKilhKVswXSBePSAoKHUzMiAqKWIpWzBdOworCSgodTMyICopYSlbMV0gXj0gKCh1MzIgKiliKVsxXTsKKwkoKHUzMiAqKWEpWzJdIF49ICgodTMyICopYilbMl07CisJKCh1MzIgKilhKVszXSBePSAoKHUzMiAqK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52bGFuX3RhZyAmIDcpIDw8IDEzKSB8CisJCQkJCSgocnJkLT52bGFuX3RhZyAmIDgpIDw8IDkpOworCQkJdmxhbl9od2FjY2VsX3J4KHNrYiwgYWRhcHRlci0+dmxncnAsIHZsYW5fdGFnKTsKKwkJfSBlbHNlCisJCQluZXRpZl9yeChza2IpOworCisJCS8qIGxldCBwcm90b2NvbCBsYXllciBmcmVlIHNrYiAqLworCQlidWZmZXJfaW5mby0+c2tiID0gTlVMTDsKKwkJYnVmZmVyX2luZm8tPmFsbG9jZWQgPSAwOworCQlycmQtPnhzei52YWxpZCA9IDA7CisKKwkJYWRhcHRlci0+bmV0ZGV2LT5sYXN0X3J4ID0gamlmZmllczsKKwl9CisKKwlhdG9taWNfc2V0KCZycmRfcmluZy0+bmV4dF90b19jbGVhbiwgcnJkX25leHRfdG9fY2xlYW4pOworCisJYXRsMV9hbGxvY19yeF9idWZmZXJzKGFkYXB0ZXIpOworCisJLyogdXBkYXRlIG1haWxib3ggPyAqLworCWlmIChjb3VudCkgeworCQl1MzIgdHBkX25leHRfdG9fdXNlOworCQl1MzIgcmZkX25leHRfdG9fdXNlOworCQl1MzIgcnJkX25leHRfdG9fY2xlYW47CisKKwkJc3Bpbl9sb2NrKCZhZGFwdGVyLT5tYl9sb2NrKTsKKworCQl0cGRfbmV4dF90b191c2UgPSBhdG9taWNfcmVhZCgmYWRhcHRlci0+dHBkX3JpbmcubmV4dF90b191c2UpOworCQlyZmRfbmV4dF90b191c2UgPQorCQkgICAgYXRvbWljX3JlYWQoJmFkYXB0ZXItPnJmZF9yaW5nLm5leHRfdG9fdXNlKTsKKwkJcnJkX25leHRfdG9fY2xlYW4gPQorCQkgICAgYXRvbWljX3JlYWQoJmFkYXB0ZXItPnJyZF9yaW5nLm5leHRfdG9fY2xlYW4pOworCQl2YWx1ZSA9ICgocmZkX25leHRfdG9fdXNlICYgTUJfUkZEX1BST0RfSU5EWF9NQVNLKSA8PAorCQkJTUJfUkZEX1BST0RfSU5EWF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ZV9wZW5kaW5nID0gbW9uX2l1Y3ZfbWVzc2FnZV9wZW5kaW5nLAogfTsKIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmlsZSBvcGVyYXRpb25zICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotc3RhdGljIGludAotbW9uX29wZW4oc3RydWN0IGlub2RlICppbm9kZSwgc3RydWN0IGZpbGUgKmZpbHApCitzdGF0aWMgaW50IG1vbl9vcGVuKHN0cnVjdCBpbm9kZSAqaW5vZGUsIHN0cnVjdCBmaWxlICpmaWxwKQogewotCWludCByYywgaTsKIAlzdHJ1Y3QgbW9uX3ByaXZhdGUgKm1vbnByaXY7CisJaW50IHJjOwogCiAJLyoKIAkgKiBvbmx5IG9uZSB1c2VyIGFsbG93ZWQKIAkgKi8KKwlyYyA9IC1FQlVTWTsKIAlpZiAodGVzdF9hbmRfc2V0X2JpdChNT05fSU5fVVNFLCAmbW9uX2luX3VzZSkpCi0JCXJldHVybiAtRUJVU1k7CisJCWdvdG8gb3V0OwogCisJcmMgPSAtRU5PTUVNOwogCW1vbnByaXYgPSBtb25fYWxsb2NfbWVtKCk7CiAJaWYgKCFtb25wcml2KQotCQlyZXR1cm4gLUVOT01FTTsKKwkJZ290byBvdXRfdXNlOwogCiAJLyoKLQkgKiBSZWdpc3RlciB3aXRoIElVQ1YgYW5kIGNvbm5lY3QgdG8gKk1PTklUT1Igc2VydmljZQorCSAqIENvbm5lY3QgdG8gKk1PTklUT1Igc2VydmljZQogCSAqLwotCW1vbnByaXYtPml1Y3ZfaGFuZGxlID0gaXVjdl9yZWdpc3Rlcl9wcm9ncmFtKCJteV9tb25yZWFkZXIgICAgIi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zdGF0aWMgc3NpemVfdCBtb25fcmVhZChzdHJ1Y3QgZmlsZSAqZmlscCwgY2hhciBfX3VzZXIgKmRhdGEsCisJCQlzaXplX3QgY291bnQsIGxvZmZfdCAqcHBvcykKIHsKIAlzdHJ1Y3QgbW9uX3ByaXZhdGUgKm1vbnByaXYgPSBmaWxwLT5wcml2YXRlX2RhdGE7CiAJc3RydWN0IG1vbl9tc2cgKm1vbm1zZzsKQEAgLTU2Myw4ICs1MzUsNyBAQAogCXJldHVybiBjb3VudDsKIH0KIAotc3RhdGljIHVuc2lnbmVkIGludAotbW9uX3BvbGwoc3RydWN0IGZpbGUgKmZpbHAsIHN0cnVjdCBwb2xsX3RhYmxlX3N0cnVjdCAqcCkKK3N0YXRpYyB1bnNpZ25lZCBpbnQgbW9uX3BvbGwoc3RydWN0IGZpbGUgKmZpbHAsIHN0cnVjdCBwb2xsX3RhYmxlX3N0cnVjdCAqcCkKIHsKIAlzdHJ1Y3QgbW9uX3ByaXZhdGUgKm1vbnByaXYgPSBmaWxwLT5wcml2YXRlX2RhdGE7CiAKQEAgLTU5Myw4ICs1NjQsNyBAQAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2R1bGUgaW5pdC9leGl0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotc3RhdGljIGludCBfX2luaXQKLW1vbl9pbml0KHZvaWQpCitzdGF0aWMgaW50IF9faW5pdCBtb25faW5pdCh2b2lkKQogewogCWludCByYzsKIApAQCAtNjAzLDIyICs1NzMsMzQgQEAKIAkJcmV0dXJuIC1FTk9ERVY7CiAJfQogCisJLyoKKwkgKiBSZWdpc3RlciB3aXRoIElVQ1YgYW5kI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B0cikpLCooKChjaGFyKilwdHIpKzEpLCooKChjaGFyKilwdHIpKzIpLCBcCisJCSAgICooKChjaGFyKilwdHIpKzMpLCooKChjaGFyKilwdHIpKzQpLCooKChjaGFyKilwdHIpKzUpLCBcCisJCSAgICooKChjaGFyKilwdHIpKzYpLCooKChjaGFyKilwdHIpKzcpLCooKChjaGFyKilwdHIpKzgpLCBcCisJCSAgICooKChjaGFyKilwdHIpKzkpLCooKChjaGFyKilwdHIpKzEwKSwqKCgoY2hhciopcHRyKSsxMSksIFwKKwkJICAgKigoKGNoYXIqKXB0cikrMTIpLCooKChjaGFyKilwdHIpKzEzKSwgXAorCQkgICAqKCgoY2hhciopcHRyKSsxNCksKigoKGNoYXIqKXB0cikrMTUpKTsgXAorUFJJTlRfIyNpbXBvcnRhbmNlKGhlYWRlciAiJTAyeCAlMDJ4ICUwMnggJTAyeCAgJTAyeCAlMDJ4ICUwMnggJTAyeCAgIiBcCisJCSAgICIlMDJ4ICUwMnggJTAyeCAlMDJ4ICAlMDJ4ICUwMnggJTAyeCAlMDJ4XG4iLCBcCisJCSAgICooKChjaGFyKilwdHIpKzE2KSwqKCgoY2hhciopcHRyKSsxNyksIFwKKwkJICAgKigoKGNoYXIqKXB0cikrMTgpLCooKChjaGFyKilwdHIpKzE5KSwgXAorCQkgICAqKCgoY2hhciopcHRyKSsyMCksKigoKGNoYXIqKXB0cikrMjEpLCBcCisJCSAgICooKChjaGFyKilwdHIpKzIyKSwqKCgoY2hhciopcHRyKSsyMyksIFwKKwkJICAgKigoKGNoYXIqKXB0cikrMjQpLCooKChjaGFyKilwdHIpKzI1KSwgXAorCQkgICAqKCgoY2hhciopcHRyKSsyNiksKigoKGNoYXIqKXB0cikrMjcpLCBcCisJCSAgICooKChjaGFyKilwdHIpKzI4KSwqKCgoY2hhciopcHRyKSsyOSksIFwKKwkJICAgKigoKGNoYXIqKXB0cikrMzApLCooKChjaGFyKilwdHIpKzMxKSk7CisKK3N0YXRpYyBpbmxpbmUgdm9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lciAqZHJ2LAorCQkJICAgICBjb25zdCBjaGFyICpidWYsIHNpemVfdCBjb3VudCkKIHsKLQlzdHJ1Y3QgaXVjdl9jb25uZWN0aW9uICoqY2xpc3QgPSAmaXVjdl9jb25ucy5pdWN2X2Nvbm5lY3Rpb25zOwotCXVuc2lnbmVkIGxvbmcgZmxhZ3M7CisJc3RydWN0IGl1Y3ZfY29ubmVjdGlvbiAqY3A7CiAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpuZGV2OwogICAgICAgICBzdHJ1Y3QgbmV0aXVjdl9wcml2ICpwcml2OwogICAgICAgICBzdHJ1Y3QgZGV2aWNlICpkZXY7CiAgICAgICAgIGNoYXIgbmFtZVtJRk5BTVNJWl07Ci0gICAgICAgIGNoYXIgKnA7CisJY29uc3QgY2hhciAqcDsKICAgICAgICAgaW50IGk7CiAKICAgICAgICAgSVVDVl9EQkZfVEVYVCh0cmFjZSwgMywgX19GVU5DVElPTl9fKTsKQEAgLTIwNzIsMzMgKzIwNDksMjcgQEAKICAgICAgICAgaWYgKGNvdW50ID49IElGTkFNU0laKQogICAgICAgICAgICAgICAgIGNvdW50ID0gSUZOQU1TSVogLSAxOzsKIAotICAgICAgICBmb3IgKGk9MCwgcD0oY2hhciAqKWJ1ZjsgaTxjb3VudCAmJiAqcDsgaSsrLCBwKyspIHsKLSAgICAgICAgICAgICAgICBpZiAoKCpwID09ICdcbicpIHx8ICgqcCA9PSAnICcpKSB7CisJZm9yIChpID0gMCwgcCA9IGJ1ZjsgaSA8IGNvdW50ICYmICpwOyBpKyssIHArKykgeworCQlpZiAoKnAgPT0gJ1xuJyB8fCAqcCA9PSAnICcpCiAgICAgICAgICAgICAgICAgICAgICAgICAvKiB0cmFpbGluZyBsZiwgZ3JyICovCiAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgbmFtZVtpXT0qcDsKLSAgICAgICAgICAgICAg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QVJOKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAibmV0aXVjdjogbmV0IGRldmljZSAlcyBhY3RpdmUgd2l0aCBwZWVyICVzXG4iLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZGV2LT5uYW1lLCBwcml2LT5jb25uLT51c2VyaWQpOworCQkJUFJJTlRfV0FSTigibmV0aXVjdjogbmV0IGRldmljZSAlcyBhY3RpdmUgd2l0aCBwZWVyICIKKwkJCQkgICAiJXNcbiIsIG5kZXYtPm5hbWUsIHByaXYtPmNvbm4tPnVzZXJpZCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBQUklOVF9XQVJOKCJuZXRpdWN2OiAlcyBjYW5ub3QgYmUgcmVtb3ZlZFxuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmRldi0+bmFtZSk7CisJCQkJICAgbmRldi0+bmFtZSk7CiAJCQlJVUNWX0RCRl9URVhUKGRhdGEsIDIsICJyZW1vdmVfd3JpdGU6IHN0aWxsIGFjdGl2ZVxuIik7CiAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gLUVCVVNZOwogICAgICAgICAgICAgICAgIH0KQEAgLTIxMDYsNyArMjA3Nyw3IEBACiAgICAgICAgICAgICAgICAgbmV0aXVjdl91bnJlZ2lzdGVyX2RldmljZShkZXYpOwogICAgICAgICAgICAgICAgIHJldHVybiBjb3VudDsKICAgICAgICAgfQotCXJlYWRfdW5sb2NrX2lycXJlc3RvcmUoJml1Y3ZfY29ubnMuaXVjdl9yd2xvY2ssIGZsYWdzKTsKKwlyZWFkX3VubG9ja19iaCgmaXVjdl9jb25uZWN0aW9uX3J3bG9jayk7CiAgICAgICAgIFBSSU5UX1dBUk4oIm5ldGl1Y3Y6IG5ldCBkZXZpY2UgJXMgdW5rbm93blxuIiwgbmFtZSk7CiAJSVVDVl9EQkZfVEVYVChkYXRhLCAyLCAicmVtb3ZlX3dyaXRlOiB1bmtub3duIGRldmljZVxuIik7CiAg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