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fVklBODJDWFhYKQkrPSB2aWE4MmN4eHhfYXVkaW8ubyBhYzk3X2NvZGVjLm8KK2lmZXEgKCQoQ09ORklHX01JRElfVklBODJDWFhYKSx5KQorICBvYmotJChDT05GSUdfU09VTkRfVklBODJDWFhYKSArPSBzb3VuZC5vIHVhcnQ0MDEubworZW5kaWYKK29iai0kKENPTkZJR19TT1VORF9ZTUZQQ0kpCSs9IHltZnBjaS5vIGFjOTdfY29kZWMubworaWZlcSAoJChDT05GSUdfU09VTkRfWU1GUENJX0xFR0FDWSkseSkKKyAgb2JqLSQoQ09ORklHX1NPVU5EX1lNRlBDSSkgICAgKz0gb3BsMy5vIHVhcnQ0MDEubworZW5kaWYKK29iai0kKENPTkZJR19TT1VORF9NU05EQ0xBUykJKz0gbXNuZC5vIG1zbmRfY2xhc3NpYy5vCitvYmotJChDT05GSUdfU09VTkRfTVNORFBJTikJKz0gbXNuZC5vIG1zbmRfcGlubmFjbGUubworb2JqLSQoQ09ORklHX1NPVU5EX1ZXU05EKQkrPSB2d3NuZC5vCitvYmotJChDT05GSUdfU09VTkRfTk0yNTYpCSs9IG5tMjU2X2F1ZGlvLm8gYWM5Ny5vCitvYmotJChDT05GSUdfU09VTkRfSUNIKQkJKz0gaTgxMF9hdWRpby5vIGFjOTdfY29kZWMubworb2JqLSQoQ09ORklHX1NPVU5EX1NPTklDVklCRVMpCSs9IHNvbmljdmliZXMubworb2JqLSQoQ09ORklHX1NPVU5EX0NNUENJKQkrPSBjbXBjaS5vCitpZmVxICgkKENPTkZJR19TT1VORF9DTVBDSV9GTSkseSkKKyAgb2JqLSQoQ09ORklHX1NPVU5EX0NNUENJKSAgICAgKz0gc291bmQubyBvcGwzLm8KK2VuZGlmCitpZmVxICgkKENPTkZJR19TT1VORF9DTVBDSV9NSURJKSx5KQorICBvYmotJChDT05GSUdfU09VTkRfQ01QQ0kpICAgICArPSBzb3VuZC5vIG1wdTQwMS5vCitlbmRpZgorb2JqLSQoQ09ORklHX1NPVU5EX0VT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bmVkIGNoYXIgKiBtYXVpX29zID0gTlVMTDsnOwlcCisJICAgIGVjaG8gJ3N0YXRpYyBpbnQgbWF1aV9vc0xlbiA9IDA7JzsJCQlcCisJKSA+ICRACitlbmRpZgorCisjIFR1cnRsZSBCZWFjaCBNdWx0aVNvdW5kCisKK2lmZXEgKCQoQ09ORklHX01TTkRDTEFTX0hBVkVfQk9PVCkseSkKKyAgICAkKG9iaikvbXNuZF9jbGFzc2ljLm86ICQob2JqKS9tc25kcGVybS5jICQob2JqKS9tc25kaW5pdC5jCisKKyAgICAkKG9iaikvbXNuZHBlcm0uYzogJChwYXRzdWJzdCAiJSIsICUsICQoQ09ORklHX01TTkRDTEFTX1BFUk1fRklMRSkpICQob2JqKS9iaW4yaGV4CisJJChvYmopL2JpbjJoZXggbXNuZHBlcm0gPCAkPCA+ICRACisKKyAgICAkKG9iaikvbXNuZGluaXQuYzogJChwYXRzdWJzdCAiJSIsICUsICQoQ09ORklHX01TTkRDTEFTX0lOSVRfRklMRSkpICQob2JqKS9iaW4yaGV4CisJJChvYmopL2JpbjJoZXggbXNuZGluaXQgPCAkPCA+ICRACitlbmRpZgorCitpZmVxICgkKENPTkZJR19NU05EUElOX0hBVkVfQk9PVCkseSkKKyAgICAkKG9iaikvbXNuZF9waW5uYWNsZS5vOiAkKG9iaikvcG5kc3Blcm0uYyAkKG9iaikvcG5kc3BpbmkuYworCisgICAgJChvYmopL3BuZHNwZXJtLmM6ICQocGF0c3Vic3QgIiUiLCAlLCAkKENPTkZJR19NU05EUElOX1BFUk1fRklMRSkpICQob2JqKS9iaW4yaGV4CisJJChvYmopL2JpbjJoZXggcG5kc3Blcm0gPCAkPCA+ICRACisKKyAgICAkKG9iaikvcG5kc3BpbmkuYzogJChwYXRzdWJzdCAiJSIsICUsICQoQ09ORklHX01TTkRQSU5fSU5JVF9GSUxFKSkgJChvYmopL2JpbjJoZXgKKwkkKG9iaikvYmluMmhleCBwbmRzcGluaSA8ICQ8ID4gJEAKK2VuZGlm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l9NSUMsICAgICAgMHgxZiwgTU8sIFNPVU5EX01BU0tfTUlDLCAgICAgIDAsIDB4MDAwMCwgSU5WICB9LAorICAgIHsgQUM5N19MSU5FSU5fVk9MLCAgICAgICAgU09VTkRfTUlYRVJfTElORSwgICAgIDB4MWYsIFNULCBTT1VORF9NQVNLX0xJTkUsICAgICA0LCAweDAwMDAsIElOViAgfSwKKyAgICB7IEFDOTdfQ0RfVk9MLCAgICAgICAgICAgIFNPVU5EX01JWEVSX0NELCAgICAgICAweDFmLCBTVCwgU09VTkRfTUFTS19DRCwgICAgICAgMSwgMHgwMDAwLCBJTlYgIH0sCisgICAgeyBBQzk3X1ZJREVPX1ZPTCwgICAgICAgICBTT1VORF9NSVhFUl9WSURFTywgICAgMHgxZiwgU1QsIFNPVU5EX01BU0tfVklERU8sICAgIDIsIDB4MDAwMCwgSU5WICB9LAorICAgIHsgQUM5N19BVVhfVk9MLCAgICAgICAgICAgU09VTkRfTUlYRVJfTElORTEsICAgIDB4MWYsIFNULCBTT1VORF9NQVNLX0xJTkUxLAkgICAzLCAweDAwMDAsIElOViAgfSwKKyAgICB7IEFDOTdfUENNT1VUX1ZPTCwgICAgICAgIFNPVU5EX01JWEVSX1BDTSwgICAgICAweDFmLCBTVCwgU09VTkRfTUFTS19QQ00sICAgICAtMSwgMHgwMDAwLCBJTlYgIH0sCisgICAgeyBBQzk3X1JFQ09SRF9HQUlOLCAgICAgICBTT1VORF9NSVhFUl9JR0FJTiwgICAgMHgwZiwgU1QsIFNPVU5EX01BU0tfSUdBSU4sICAgLTEsIDB4MDAwMCwgTklOViB9LAorICAgIHsgLTEsCQkgICAgICAtMSwJCSAgICAweGZmLCAwLCAgMCwgICAgICAgICAgICAgICAgICAtMSwgMHgwMDAwLCAwICAgIH0sCit9OworCitzdGF0aWMgc3RydWN0IGFjOTdfY2huX2Rlc2MgKgorYWM5N19maW5kX2NobmRlc2MgKHN0cnVjdCBhYzk3X2h3aW50ICpkZXYsIGludCBvc3NfY2hhb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UgKiAxMDAgKyAobWF4dmFsIC8gMikpIC8gbWF4dmFsOworCWlmIChpID4gMTAwKQorCSAgICAgaSA9IDEwMDsKKwlpZiAoaSA8IDApCisJICAgIGkgPSAwOworCXJldHVybiBpOworICAgIH0KK30KKworc3RhdGljIGludAorYWM5N19zY2FsZV9mcm9tX29zc192YWwgKGludCB2YWx1ZSwgaW50IG1heHZhbCwgaW50IGlzX3N0ZXJlbywgaW50IGludikKK3sKKyAgICBpZiAoaXNfc3RlcmVvKQorCXJldHVybiAoYWM5N19zY2FsZV9mcm9tX29zc192YWwgKHZhbHVlICYgMjU1LCBtYXh2YWwsIDAsIGludikgPDwgOCkKKwl8IChhYzk3X3NjYWxlX2Zyb21fb3NzX3ZhbCAoKHZhbHVlID4+IDgpICYgMjU1LCBtYXh2YWwsIDAsIGludikgPDwgMCk7CisgICAgZWxzZSB7CisJaW50IGkgPSAoKHZhbHVlICYgMjU1KSAqIG1heHZhbCArIDUwKSAvIDEwMDsKKwlpZiAoaW52KQorCSAgICBpID0gbWF4dmFsIC0gaTsKKwlpZiAoaSA8IDApCisJICAgIGkgPSAwOworCWlmIChpID4gbWF4dmFsKQorCSAgICBpID0gbWF4dmFsOworCXJldHVybiBpOworICAgIH0KK30KKworc3RhdGljIGludAorYWM5N19zZXRfbWl4ZXIgKHN0cnVjdCBhYzk3X2h3aW50ICpkZXYsIGludCBvc3NfY2hhbm5lbCwgdTE2IG9zc192YWx1ZSkKK3sKKyAgICBpbnQgc2NhbGVkX3ZhbHVlOworICAgIHN0cnVjdCBhYzk3X2Nobl9kZXNjICpjaGFubmVsID0gYWM5N19maW5kX2NobmRlc2MgKGRldiwgb3NzX2NoYW5uZWwpOworICAgIGludCByZXN1bHQ7CisKKyAgICBpZiAoY2hhbm5lbCA9PSBOVUxMKQorCXJldHVybiAtRU5PREVWOworICAgIGlmICghIGFjOTdfaXNfdmFsaWRfY2hhbm5lbCAoZGV2LCBjaGFubmVsKSkKKwlyZXR1cm4gLUVOT0RFVj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XJnKQoreworICAgIGludCByZXQ7CisKKyAgICBzd2l0Y2ggKGNtZCkgeworICAgIGNhc2UgU09VTkRfTUlYRVJfUkVBRF9SRUNTUkM6CisJcmV0ID0gYWM5N19nZXRfcmVjbWFzayAoZGV2KTsKKwlicmVhazsKKworICAgIGNhc2UgU09VTkRfTUlYRVJfV1JJVEVfUkVDU1JDOgorCXsKKwkgICAgaWYgKGdldF91c2VyIChyZXQsIChpbnQgX191c2VyICopIGFyZykpCisJCXJldCA9IC1FRkFVTFQ7CisJICAgIGVsc2UKKwkJcmV0ID0gYWM5N19zZXRfcmVjbWFzayAoZGV2LCByZXQpOworCX0KKwlicmVhazsKKworICAgIGNhc2UgU09VTkRfTUlYRVJfUkVBRF9DQVBTOgorCXJldCA9IFNPVU5EX0NBUF9FWENMX0lOUFVUOworCWJyZWFrOworCisgICAgY2FzZSBTT1VORF9NSVhFUl9SRUFEX0RFVk1BU0s6CisJcmV0ID0gZGV2LT5taXhlcl9kZXZtYXNrOworCWJyZWFrOworCisgICAgY2FzZSBTT1VORF9NSVhFUl9SRUFEX1JFQ01BU0s6CisJcmV0ID0gZGV2LT5taXhlcl9yZWNtYXNrOworCWJyZWFrOworCisgICAgY2FzZSBTT1VORF9NSVhFUl9SRUFEX1NURVJFT0RFVlM6CisJcmV0ID0gZGV2LT5taXhlcl9zdGVyZW9tYXNrOworCWJyZWFrOworCisgICAgZGVmYXVsdDoKKwkvKiBSZWFkIG9yIHdyaXRlIHJlcXVlc3QuICovCisJcmV0ID0gLUVJTlZBTDsKKwlpZiAoX0lPQ19UWVBFIChjbWQpID09ICdNJykgeworCSAgICBpbnQgZGlyID0gX1NJT0NfRElSIChjbWQpOworCSAgICBpbnQgY2hhbm5lbCA9IF9JT0NfTlIgKGNtZCk7CisKKwkgICAgaWYgKGNoYW5uZWwgPj0gMCAmJiBjaGFubmVsIDwgU09VTkRfTUlYRVJfTlJERVZJQ0VTKSB7CisJCXJldCA9IDA7CisJCWlmIChkaXIgJiBfU0l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B4MDAzZgorCisvKiByZWNvcmQgbXV4IGRlZmluZXMgKi8KKworI2RlZmluZSBBQzk3X1JFQ01VWF9NSUMgICAgICAgICAgMHgwMDAwCisjZGVmaW5lIEFDOTdfUkVDTVVYX0NEICAgICAgICAgICAweDAxMDEKKyNkZWZpbmUgQUM5N19SRUNNVVhfVklERU8gICAgICAgIDB4MDIwMiAgICAgIC8qIG5vdCB1c2VkICovCisjZGVmaW5lIEFDOTdfUkVDTVVYX0FVWCAgICAgICAgICAweDAzMDMgICAgICAKKyNkZWZpbmUgQUM5N19SRUNNVVhfTElORSAgICAgICAgIDB4MDQwNCAgICAgIAorI2RlZmluZSBBQzk3X1JFQ01VWF9TVEVSRU9fTUlYICAgMHgwNTA1CisjZGVmaW5lIEFDOTdfUkVDTVVYX01PTk9fTUlYICAgICAweDA2MDYKKyNkZWZpbmUgQUM5N19SRUNNVVhfUEhPTkUgICAgICAgIDB4MDcwNworCisKKy8qIGdlbmVyYWwgcHVycG9zZSByZWdpc3RlciBiaXQgZGVmaW5lcyAqLworCisjZGVmaW5lIEFDOTdfR1BfTFBCSyAgICAgICAgICAgICAweDAwODAgICAgICAvKiBMb29wYmFjayBtb2RlICovCisjZGVmaW5lIEFDOTdfR1BfTVMgICAgICAgICAgICAgICAweDAxMDAgICAgICAvKiBNaWMgU2VsZWN0IDA9TWljMSwgMT1NaWMyICovCisjZGVmaW5lIEFDOTdfR1BfTUlYICAgICAgICAgICAgICAweDAyMDAgICAgICAvKiBNb25vIG91dHB1dCBzZWxlY3QgMD1NaXgsIDE9TWljICovCisjZGVmaW5lIEFDOTdfR1BfUkxCSyAgICAgICAgICAgICAweDA0MDAgICAgICAvKiBSZW1vdGUgTG9vcGJhY2sgLSBNb2RlbSBsaW5lIGNvZGVjICovCisjZGVmaW5lIEFDOTdfR1BfTExCSyAgICAgICAgICAgICAweDA4MDAgICAgICAvKiBMb2NhbCBMb29wYmFjayAtIE1vZGVtIExpbmUgY29kZWMgKi8KKyNkZWZpbmUgQUM5N19HUF9MRCAgICAgICAgICAgICAgIDB4MTAwMCAgICAgIC8qIExvdWRuZXNzIDE9b24gKi8KKyNkZWZpbmUgQUM5N19HUF8zRCAgICAgICAgICAgICAgIDB4MjAwMCAgICAgIC8qIDNEIEVuaGFuY2VtZW50IDE9b24gKi8KKyNkZWZpbmUgQUM5N19HUF9TVCAgICAgICAgICAgICAgIDB4NDAwMCAgICAgIC8qIFN0ZXJlbyBFbmhhbmNlbWVudCAxPW9uICovCisjZGVmaW5lIEFDOTdfR1BfUE9QICAgICAgICAgICAgICAweDgwMDAgICAgICAvKiBQY20gT3V0IFBhdGgsIDA9cHJlIDNELCAxPXBvc3QgM0QgKi8KKworCisvKiBwb3dlcmRvd24gY29udHJvbCBhbmQgc3RhdHVzIGJpdCBkZWZpbmVzICovCisKKy8qIHN0YXR1cyAqLworI2RlZmluZSBBQzk3X1BXUl9NRE0gICAgICAgICAgICAgMHgwMDEwICAgICAgLyogTW9kZW0gc2VjdGlvbiByZWFkeSAqLworI2RlZmluZSBBQzk3X1BXUl9SRUYgICAgICAgICAgICAgMHgwMDA4ICAgICAgLyogVnJlZiBub21pbmFsICovCisjZGVmaW5lIEFDOTdfUFdSX0FOTCAgICAgICAgICAgICAweDAwMDQgICAgICAvKiBBbmFsb2cgc2VjdGlvbiByZWFkeSAqLworI2RlZmluZSBBQzk3X1BXUl9EQUMgICAgICAgICAgICAgMHgwMDAyICAgICAgLyogREFDIHNlY3Rpb24gcmVhZHkgKi8KKyNkZWZpbmUgQUM5N19QV1JfQURDICAgICAgICAgICAgIDB4MDAwMSAgICAgIC8qIEFEQyBzZWN0aW9uIHJlYWR5ICovCisKKy8qIGNvbnRyb2wgKi8KKyNkZWZpbmUgQUM5N19QV1JfUFIwICAgICAgICAgICAgIDB4MDEwMCAgICAgIC8qIEFEQyBhbmQgTXV4IHBvd2VyZG93biAqLworI2RlZmluZSBBQzk3X1BXUl9QUjEgICAgICAgICAgICAgMHgwMjAwICAgICAgLyogREFDIHBv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gvc3RkZGVmLmg+CisjaW5jbHVkZSA8bGludXgvc3BpbmxvY2suaD4KKyNpbmNsdWRlICJzb3VuZF9jb25maWcuaCIKKworI2RlZmluZSBERUJVR05PSVNFKHgpCisKKyNkZWZpbmUgQ0hFQ0tfRk9SX1BPV0VSIHsgaW50IHRpbWVvdXQ9MTAwOyBcCisgIHdoaWxlICh0aW1lb3V0ID4gMCAmJiAoaW5iKGRldmMtPmJhc2UpJjB4ODApIT0gMHg4MCkge1wKKyAgICAgICAgICB0aW1lb3V0LS07IFwKKyAgfSBcCisgIGlmICh0aW1lb3V0PT0wKSB7XAorICAgICAgICAgIHByaW50ayhLRVJOX1dBUk5JTkcgImFkMTgxNjogQ2hlY2sgZm9yIHBvd2VyIGZhaWxlZCBpbiAlcyBsaW5lOiAlZFxuIixfX0ZJTEVfXyxfX0xJTkVfXyk7IFwKKyAgfSBcCit9CisKKy8qIHN0cnVjdHVyZSB0byBob2xkIGRldmljZSBzcGVjaWZpYyBpbmZvcm1hdGlvbiAqLwordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgICAgICAgaW50ICAgICAgICAgICAgYmFzZTsgICAgICAgICAgLyogc2V0IGluIGF0dGFjaCAqLworCWludCAgICAgICAgICAgIGlycTsKKwlpbnQgICAgICAgICAgICBkbWFfcGxheWJhY2s7CisgICAgICAgIGludCAgICAgICAgICAgIGRtYV9jYXB0dXJlOworICAKKwlpbnQgICAgICAgICAgICBvcGVuZWQ7ICAgICAgICAgLyogb3BlbiAqLworICAgICAgICBpbnQgICAgICAgICAgICBzcGVlZDsJCisJaW50ICAgICAgICAgICAgY2hhbm5lbHM7CisJaW50ICAgICAgICAgICAgYXVkaW9fZm9ybWF0OworICAgICAgICBpbnQgICAgICAgICAgICBhdWRpb19tb2RlOyAKKyAgCisgICAgICAgIGludCAgICAgICAgICAgIHJlY21hc2s7ICAgICAgICAvKiBzZXR1cCAqLworCXVuc2lnbmVkIGNoYXIgIGZvcm1hdF9iaXRzOworCWludCAgICAgIC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IF9fSVNBUE5QX18KKwkvKiBjb25maWd1cmUgUG5QIGNhcmRzICovCisJaWYoaXNhcG5wKSBhZDE4MTZfY29uZmlnX3BucF9jYXJkcygpOworI2VuZGlmCisJLyogY29uZmlndXJlIGNhcmQgYnkgbW9kdWxlIHBhcmFtcyAqLworCWlmIChpbyAhPSAtMSAmJiBpcnEgIT0gLTEgJiYgZG1hICE9IC0xKSB7CisJCXN0cnVjdCBhZGRyZXNzX2luZm8gY2ZnOworCQljZmcuaW9fYmFzZSA9IGlvOworCQljZmcuaXJxID0gaXJxOworCQljZmcuZG1hID0gZG1hOworCQljZmcuZG1hMiA9IGRtYTI7CisJCWFkMTgxNl9pbml0X2NhcmQoJmNmZywgTlVMTCk7CisJfQorCWlmIChucl9hZDE4MTZfZGV2cyA8PSAwKQorCSAgCXJldHVybiAtRU5PREVWOworCXJldHVybiAwOworfQorCisvKiBtb2R1bGUgY2xlYW51cCAqLworc3RhdGljIHZvaWQgX19leGl0IGNsZWFudXBfYWQxODE2ICh2b2lkKQoreworCWludCAgICAgICAgICBpOworCWFkMTgxNl9pbmZvICAqZGV2YyA9IE5VTEw7CisgIAorCS8qIHJlbW92ZSBhbnkgc291bmRjYXJkICovCisJZm9yIChpID0gMDsgIGkgPCBucl9hZDE4MTZfZGV2czsgaSsrKSB7CisJCWRldmMgPSAmZGV2X2luZm9baV07CisJCXVubG9hZF9jYXJkKGRldmMpOworCX0gICAgIAorCW5yX2FkMTgxNl9kZXZzPTA7CisJcHJpbnRrKEtFUk5fSU5GTyAiYWQxODE2OiBkcml2ZXIgdW5sb2FkZWQhXG4iKTsKK30KKworbW9kdWxlX2luaXQoaW5pdF9hZDE4MTYpOworbW9kdWxlX2V4aXQoY2xlYW51cF9hZDE4MTYpOworCisjaWZuZGVmIE1PRFVMRQorLyoga2VybmVsIGNvbW1hbmQgbGluZSBwYXJhbWV0ZXIgZXZhbHVhdGlvbiAqLworc3RhdGljIGludCBfX2luaXQgc2V0dXBfYWQxODE2KGNoY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LworCWludCAJCXN1YnR5cGU7CisJdW5zaWduZWQgY2hhciAgIE1DRV9iaXQ7CisJdW5zaWduZWQgY2hhciAgIHNhdmVkX3JlZ3NbNjRdOwkvKiBJbmNsdWRlcyBleHRlbmRlZCByZWdpc3RlciBzcGFjZSAqLworCWludCAgICAgICAgICAgICBkZWJ1Z19mbGFnOworCisJaW50ICAgICAgICAgICAgIGF1ZGlvX2ZsYWdzOworCWludCAgICAgICAgICAgICByZWNvcmRfZGV2LCBwbGF5YmFja19kZXY7CisKKwlpbnQgICAgICAgICAgICAgeGZlcl9jb3VudDsKKwlpbnQgICAgICAgICAgICAgYXVkaW9fbW9kZTsKKwlpbnQgICAgICAgICAgICAgb3Blbl9tb2RlOworCWludCAgICAgICAgICAgICBpbnRyX2FjdGl2ZTsKKwljaGFyICAgICAgICAgICAqY2hpcF9uYW1lLCAqbmFtZTsKKwlpbnQgICAgICAgICAgICAgbW9kZWw7CisjZGVmaW5lIE1EXzE4NDgJCTEKKyNkZWZpbmUgTURfNDIzMQkJMgorI2RlZmluZSBNRF80MjMxQQkzCisjZGVmaW5lIE1EXzE4NDUJCTQKKyNkZWZpbmUgTURfNDIzMgkJNQorI2RlZmluZSBNRF9DOTMwCQk2CisjZGVmaW5lIE1EX0lXQVZFCTcKKyNkZWZpbmUgTURfNDIzNSAgICAgICAgIDggLyogQ3J5c3RhbCBBdWRpbyBDUzQyMzUgICovCisjZGVmaW5lIE1EXzE4NDVfU1NDQVBFICA5IC8qIEVuc29uaXEgU291bmRzY2FwZSBQTlAqLworI2RlZmluZSBNRF80MjM2CQkxMCAvKiA0MjM2IGFuZCBoaWdoZXIgKi8KKyNkZWZpbmUgTURfNDJ4QgkJMTEgLyogQ1MgNDJ4QiAqLworI2RlZmluZSBNRF80MjM5CQkxMiAvKiBDUzQyMzkgKi8KKworCS8qIE1peGVyIHBhcmFtZXRlcnMgKi8KKwlpbnQgICAgICAgICAgICAgcmVjbWFzazsKKwlpbnQgICAgICAgICAgICAgc3VwcG9ydGVkX2RldmljZXMsIG9yaWdfZGV2aWNlczsKKwlpbnQgICAgICAgICAgICAgc3VwcG9ydGVkX3JlY19kZXZpY2VzLCBvcmlnX3JlY19kZXZpY2VzOworCWludCAgICAgICAgICAgICpsZXZlbHM7CisJc2hvcnQgICAgICAgICAgIG1peGVyX3Jlcm91dGVbMzJdOworCWludCAgICAgICAgICAgICBkZXZfbm87CisJdm9sYXRpbGUgdW5zaWduZWQgbG9uZyB0aW1lcl90aWNrczsKKwlpbnQgICAgICAgICAgICAgdGltZXJfcnVubmluZzsKKwlpbnQgICAgICAgICAgICAgaXJxX29rOworCW1peGVyX2VudHMgICAgICptaXhfZGV2aWNlczsKKwlpbnQgICAgICAgICAgICAgbWl4ZXJfb3V0cHV0X3BvcnQ7CisKKwkvKiBQb3dlciBtYW5hZ2VtZW50ICovCisJc3RydWN0CQlwbV9kZXYgKnBtZGV2OworfSBhZDE4NDhfaW5mbzsKKwordHlwZWRlZiBzdHJ1Y3QgYWQxODQ4X3BvcnRfaW5mbworeworCWludCAgICAgICAgICAgICBvcGVuX21vZGU7CisJaW50ICAgICAgICAgICAgIHNwZWVkOworCXVuc2lnbmVkIGNoYXIgICBzcGVlZF9iaXRzOworCWludCAgICAgICAgICAgICBjaGFubmVsczsKKwlpbnQgICAgICAgICAgICAgYXVkaW9fZm9ybWF0OworCXVuc2lnbmVkIGNoYXIgICBmb3JtYXRfYml0czsKK30KK2FkMTg0OF9wb3J0X2luZm87CisKK3N0YXRpYyBzdHJ1Y3QgYWRkcmVzc19pbmZvIGNmZzsKK3N0YXRpYyBpbnQgbnJfYWQxODQ4X2RldnM7CisKK3N0YXRpYyBpbnQgZGVza3Byb194bDsKK3N0YXRpYyBpbnQgZGVza3Byb19tOworc3RhdGljIGludCBzb3VuZHBybzsKKworc3RhdGljIHZvbGF0aWxlIHNpZ25lZCBjaGFyIGlycTJkZXZbMTddID0geworCS0xLCAtMSwgLTEsIC0xLCAtMSwgLTEsIC0xLCAtMSwKKwkt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ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRldmMtPmNoaXBfbmFtZSA9ICI4MkM5MzAiOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXZjLT5tb2RlbCA9IE1EX0M5MzA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisJCQkJCQllbHNlCisJCQkJCQl7CisJCQkJCQkJZGV2Yy0+Y2hpcF9uYW1lID0gIkNTNDIzMSI7CisJCQkJCQkJZGV2Yy0+bW9kZWwgPSBNRF80MjMxOworCQkJCQkJfQorCQkJCQl9CisJCQkJfQorCQkJfQorCQkJYWRfd3JpdGUoZGV2YywgMjUsIHRtcDEpOwkvKiBSZXN0b3JlIGJpdHMgKi8KKworCQkJRERCKHByaW50aygiYWQxODQ4X2RldGVjdCgpIC0gc3RlcCBLXG4iKSk7CisJCX0KKwl9IGVsc2UgaWYgKHRtcDEgPT0gMHgwYSkgeworCQkvKgorCQkgKiBJcyBpdCBwZXJoYXBzIGEgU291bmRQcm8gQ01JODMzMD8KKwkJICogSWYgc28sIHRoZW4gd2Ugc2hvdWxkIGJlIGFibGUgdG8gY2hhbmdlIGluZGlyZWN0IHJlZ2lzdGVycworCQkgKiBncmVhdGVyIHRoYW4gSTE1IGFmdGVyIGFjdGl2YXRpbmcgTU9ERTIsIGV2ZW4gdGhvdWdoIHJlYWRpbmcKKwkJICogYmFjayBJMTIgZG9lcyBub3Qgc2hvdyBpdC4KKwkJICovCisKKwkJLyoKKwkJICogTGV0J3MgdHJ5IGNvbXBhcmluZyByZWdpc3RlciB2YWx1ZXMKKwkJICovCisJCWZvciAoaSA9IDA7IGkgPCAxNjsgaSsrKSB7CisJCQlpZiAoKHRtcDEgPSBhZF9yZWFkKGRldmMsIGkpKSAhPSAodG1wMiA9IGFkX3JlYWQoZGV2YywgaSArIDE2KSk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twcm8gWEwuCisgKi8KKworc3RhdGljIGludCBpbml0X2Rlc2twcm8oc3RydWN0IGFkZHJlc3NfaW5mbyAqaHdfY29uZmlnKQoreworCXVuc2lnbmVkIGNoYXIgICB0bXA7CisKKwlpZiAoKHRtcCA9IGluYigweGM0NCkpID09IDB4ZmYpCisJeworCQlEREIocHJpbnRrKCJpbml0X2Rlc2twcm86IERlYWQgcG9ydCAweGM0NFxuIikpOworCQlyZXR1cm4gMDsKKwl9CisJb3V0YigodG1wIHwgMHgwNCksIDB4YzQ0KTsJLyogU2VsZWN0IGJhbmsgMSAqLworCWlmIChpbmIoMHhjNDQpICE9IDB4MDQpCisJeworCQlEREIocHJpbnRrKCJpbml0X2Rlc2twcm86IEludmFsaWQgYmFuazEgc2lnbmF0dXJlIGluIHBvcnQgMHhjNDRcbiIpKTsKKwkJcmV0dXJuIDA7CisJfQorCS8qCisJICogT0suIEl0IGxvb2tzIGxpa2UgYSBEZXNrcHJvIHNvIGxldCdzIHByb2NlZWQuCisJICovCisKKwkvKgorCSAqIEkvTyBwb3J0IDB4YzQ0IEF1ZGlvIGNvbmZpZ3VyYXRpb24gcmVnaXN0ZXIuCisJICoKKwkgKiBiaXRzIDB4YzA6ICAgQXVkaW8gcmV2aXNpb24gYml0cworCSAqICAgICAgICAgICAgICAweDAwID0gQ29tcGFxIEJ1c2luZXNzIEF1ZGlvCisJICogICAgICAgICAgICAgIDB4NDAgPSBNUyBTb3VuZCBTeXN0ZW0gQ29tcGF0aWJsZSAocmVzZXQgZGVmYXVsdCkKKwkgKiAgICAgICAgICAgICAgMHg4MCA9IFJlc2VydmVkCisJICogICAgICAgICAgICAgIDB4YzAgPSBSZXNlcnZlZAorCSAqIGJpdCAweDIwOiAgICBObyBXYWl0IFN0YXRlIEVuYWJsZQorCSAqICAgICAgICAgICAgICAweDAwID0gRGlzYWJsZWQgKHJlc2V0IGRlZmF1bHQsIERNQSBtb2RlKQorCSAqICAgICAgICAgICAgICAweDIwID0gRW5hYmxlZCAocHJvZ3JhbW1lZCBJL08gbW9kZSkKKwkgKiBiaXQgMHgxMDogICAgTVMgU291bmQgU3lzdGVtIERlY29kZSBFbmFibGUKKwkgKiAgICAgICAgICAgICAgMHgwMCA9IERlY29kaW5nIGRpc2FibGVkIChyZXNldCBkZWZhdWx0KQorCSAqICAgICAgICAgICAgICAweDEwID0gRGVjb2RpbmcgZW5hYmxlZAorCSAqIGJpdCAweDA4OiAgICBGTSBTeW50aGVzaXMgRGVjb2RlIEVuYWJsZQorCSAqICAgICAgICAgICAgICAweDAwID0gRGVjb2RpbmcgRGlzYWJsZWQgKHJlc2V0IGRlZmF1bHQpCisJICogICAgICAgICAgICAgIDB4MDggPSBEZWNvZGluZyBlbmFibGVkCisJICogYml0IDB4MDQgICAgIEJhbmsgc2VsZWN0CisJICogICAgICAgICAgICAgIDB4MDAgPSBCYW5rIDAKKwkgKiAgICAgICAgICAgICAgMHgwNCA9IEJhbmsgMQorCSAqIGJpdHMgMHgwMyAgICBNU1MgQmFzZSBhZGRyZXNzCisJICogICAgICAgICAgICAgIDB4MDAgPSAweDUzMCAocmVzZXQgZGVmYXVsdCkKKwkgKiAgICAgICAgICAgICAgMHgwMSA9IDB4NjA0CisJICogICAgICAgICAgICAgIDB4MDIgPSAweGY0MAorCSAqICAgICAgICAgICAgICAweDAzID0gMHhlODAKKwkgKi8KKworI2lmZGVmIERFQlVHWEwKKwkvKiBEZWJ1ZyBwcmludGluZyAqLworCXByaW50aygiUG9ydCAweGM0NCAoYmVmb3JlKTogIik7CisJb3V0YigodG1wICYgfjB4MDQpLCAweGM0NCk7CisJcHJpbnRrKCIlMDJ4ICIsIGluYigweGM0NCkpOworCW91dGIoKHRtcCB8IDB4MDQpLCAweGM0NCk7CisJcHJpbnRrKCIlMDJ4XG4iLCBpbmIoMHhjNDQpKTsKKyNlbmRpZgorCisJLyogU2V0IGJhbmsgMSBvZiB0aGUgcmVnaXN0ZXIgKi8KKwl0bXAgPSAweDU4OwkJLyogTVNTIE1vZ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FyZF9zdWJ0eXBlID09IDIpCS8qIENvbXBhcSBEZXNrcHJvIFhMICovCisJeworCQlpZiAoIWluaXRfZGVza3Bybyhod19jb25maWcpKQorCQkJcmV0dXJuIDA7CisJfQorCisJaWYgKGRlc2twcm9fbSkJLyogQ29tcGFxIERlc2twcm8gTSAqLworCXsKKwkJaWYgKCFpbml0X2Rlc2twcm9fbShod19jb25maWcpKQorCQkJcmV0dXJuIDA7CisJfQorCisJLyoKKwkgICAqIENoZWNrIGlmIHRoZSBJTyBwb3J0IHJldHVybnMgdmFsaWQgc2lnbmF0dXJlLiBUaGUgb3JpZ2luYWwgTVMgU291bmQKKwkgICAqIHN5c3RlbSByZXR1cm5zIDB4MDQgd2hpbGUgc29tZSBjYXJkcyAoQXVkaW9Ucml4IFBybyBmb3IgZXhhbXBsZSkKKwkgICAqIHJldHVybiAweDAwIG9yIDB4MGYuCisJICovCisKKwlpZiAoKHRtcCA9IGluYihod19jb25maWctPmlvX2Jhc2UgKyAzKSkgPT0gMHhmZikJLyogQnVzIGZsb2F0ICovCisJeworCQkgIGludCAgICAgICAgICAgICByZXQ7CisKKwkJICBEREIocHJpbnRrKCJJL08gYWRkcmVzcyBpcyBpbmFjdGl2ZSAoJXgpXG4iLCB0bXApKTsKKwkJICBpZiAoIShyZXQgPSBhZDE4NDhfZGV0ZWN0KHBvcnRzLCBOVUxMLCBod19jb25maWctPm9zcCkpKQorCQkJICByZXR1cm4gMDsKKwkJICByZXR1cm4gMTsKKwl9CisJRERCKHByaW50aygiTVNTIHNpZ25hdHVyZSA9ICV4XG4iLCB0bXAgJiAweDNmKSk7CisJaWYgKCh0bXAgJiAweDNmKSAhPSAweDA0ICYmCisJICAgICh0bXAgJiAweDNmKSAhPSAweDBmICYmCisJICAgICh0bXAgJiAweDNmKSAhPSAweDAwKQorCXsKKwkJaW50IHJldDsKKworCQlNREIocHJpbnRrKEtFUk5fRVJSICJObyBNU1Mgc2lnbmF0dXJlIGRldGVjdGVkIG9uIHBvcnQg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pOworCQkJZWxzZQorCQkJCWh3X2NvbmZpZy0+ZG1hMiA9IC0xOworICAgICAgICAgICAgICAgICAgICAgICAgaHdfY29uZmlnLT5jYXJkX3N1YnR5cGUgPSBhZDE4NDhfaXNhcG5wX2xpc3Rbc2xvdF0udHlwZTsKKwkJfSBlbHNlCisJCQlyZXR1cm4oTlVMTCk7CisJfSBlbHNlCisJCXJldHVybihOVUxMKTsKKworCXJldHVybihhZDE4NDhfZGV2KTsKK30KKworc3RhdGljIGludCBfX2luaXQgYWQxODQ4X2lzYXBucF9pbml0KHN0cnVjdCBhZGRyZXNzX2luZm8gKmh3X2NvbmZpZywgc3RydWN0IHBucF9jYXJkICpidXMsIGludCBzbG90KQoreworCWNoYXIgKmJ1c25hbWUgPSBidXMtPm5hbWVbMF0gPyBidXMtPm5hbWUgOiBhZDE4NDhfaXNhcG5wX2xpc3Rbc2xvdF0ubmFtZTsKKworCS8qIEluaXRpYWxpemUgdGhpcyBiYWJ5LiAqLworCisJaWYoYWQxODQ4X2luaXRfZ2VuZXJpYyhidXMsIGh3X2NvbmZpZywgc2xvdCkpIHsKKwkJLyogV2UgZ290IGl0LiAqLworCisJCXByaW50ayhLRVJOX05PVElDRSAiYWQxODQ4OiBQblAgcmVwb3J0cyAnJXMnIGF0IGkvbyAlI3gsIGlycSAlZCwgZG1hICVkLCAlZFxuIiwKKwkJICAgICAgIGJ1c25hbWUsCisJCSAgICAgICBod19jb25maWctPmlvX2Jhc2UsIGh3X2NvbmZpZy0+aXJxLCBod19jb25maWctPmRtYSwKKwkJICAgICAgIGh3X2NvbmZpZy0+ZG1hMik7CisJCXJldHVybiAxOworCX0KKwlyZXR1cm4gMDsKK30KKworc3RhdGljIGludCBfX2luaXQgYWQxODQ4X2lzYXBucF9wcm9iZShzdHJ1Y3QgYWRkcmVzc19pbmZvICpod19jb25maWcpCit7CisJc3RhdGljIGludCBmaXJzdCA9IDE7CisJaW50IGk7CisKKwkvKiBDb3VudCBlbnRyaWVzIGluIHNiX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mbXQsICMjYXJnKQorI2RlZmluZSBERVZOQU1FICJhZDE4ODkiCisKKyNkZWZpbmUgTlJfSFdfQ0gJNAorI2RlZmluZSBEQUNfUlVOTklORwkxCisjZGVmaW5lIEFEQ19SVU5OSU5HCTIKKworI2RlZmluZSBVTkRFUlJVTihkZXYpCSgwKQorCisjZGVmaW5lIEFEMTg4OV9SRUFEVyhkZXYscmVnKSByZWFkdyhkZXYtPnJlZ2Jhc2UgKyByZWcpCisjZGVmaW5lIEFEMTg4OV9XUklURVcoZGV2LHJlZyx2YWwpIHdyaXRldygodmFsKSwgZGV2LT5yZWdiYXNlICsgcmVnKQorI2RlZmluZSBBRDE4ODlfUkVBREwoZGV2LHJlZykgcmVhZGwoZGV2LT5yZWdiYXNlICsgcmVnKQorI2RlZmluZSBBRDE4ODlfV1JJVEVMKGRldixyZWcsdmFsKSB3cml0ZWwoKHZhbCksIGRldi0+cmVnYmFzZSArIHJlZykKKworLy9ub3cgMTAwbXMKKy8qICNkZWZpbmUgV0FJVF8xME1TKCkJc2NoZWR1bGVfdGltZW91dChIWi8xMCkgKi8KKyNkZWZpbmUgV0FJVF8xME1TKCkJZG8geyBpbnQgX19pOyBmb3IgKF9faSA9IDA7IF9faSA8IDEwMDsgX19pKyspIHVkZWxheSgxMDAwKTsgfSB3aGlsZSgwKQorCisvKiBjdXJyZW50bHkgb25seSBzdXBwb3J0IGEgc2luZ2xlIGRldmljZSAqLworc3RhdGljIGFkMTg4OV9kZXZfdCAqYWQxODg5X2RldiA9IE5VTEw7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqIGhlbHBlciByb3V0aW5lcyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworc3RhdGljIGlubGluZSB2b2lkIGFkMTg4OV9zZXRfd2F2X3JhdGUoYWQxODg5X2Rldl90ICpkZXYsIGludCByYXRlKQoreworCXN0cnVjdCBhYzk3X2NvZGVjICphYzk3X2NvZGVjID0gZGV2LT5hYzk3X2NvZGVjOworCisJREJ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AqLworI2RlZmluZSBERUZfQUVEU1AxNl9JT0IgMHgyMjAgICAvKiAweDIyMChkZWZhdWx0KSAweDI0MCAgICAgICAgICAgICAgICAgKi8KKyNkZWZpbmUgREVGX0FFRFNQMTZfSVJRIDcJLyogNSA3KGRlZmF1bHQpIDkgMTAgMTEgICAgICAgICAgICAgICAgICovCisjZGVmaW5lIERFRl9BRURTUDE2X01SUSAwCS8qIDUgNyA5IDEwIDAoZGVmYXVsdCksIDAgbWVhbnMgZGlzYWJsZSAqLworI2RlZmluZSBERUZfQUVEU1AxNl9ETUEgMQkvKiAwIDEoZGVmYXVsdCkgMyAgICAgICAgICAgICAgICAgICAgICAgKi8KKworLyoKKyAqIENvbW1hbmRzIG9mIEFFRFNQMTYncyBEU1AgKFNCUFJPK3NwZWNpYWwpLgorICogU29tZSBvZiB0aGVtIGFyZSBDT01NQU5EX3h4LCBpbiB0aGUgZnV0dXJlIHRoZXkgbWF5IGNoYW5nZS4KKyAqLworI2RlZmluZSBXUklURV9NRElSUV9DRkcgICAweDUwCS8qIFNldCBNJkkmRFJRIG1hc2sgKHRoZSByZWFsIGNvbmZpZykgICAqLworI2RlZmluZSBDT01NQU5EXzUyICAgICAgICAweDUyCS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworI2RlZmluZSBSRUFEX0hBUkRfQ0ZHICAgICAweDU4CS8qIFJlYWQgSGFyZHdhcmUgQ29uZmlnIChJL08gYmFzZSBldGMpICAqLworI2RlZmluZSBDT01NQU5EXzVDICAgICAgICAweDVjCS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworI2RlZmluZSBDT01NQU5EXzYwICAgICAgICAweDYwCS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworI2RlZmluZSBDT01NQU5EXzY2ICAgICAgICAweDY2CS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworI2RlZmluZSBDT01NQU5EXzZDICAgICAgICAweDZjCS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworI2RlZmluZSBDT01NQU5EXzZFICAgICAgICAweDZlCS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworI2RlZmluZSBDT01NQU5EXzg4ICAgICAgICAweDg4CS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworI2RlZmluZSBEU1BfSU5JVF9NU1MgICAgICAweDhjCS8qIEVuYWJsZSBNaWNyb3NvZnQgU291bmQgU3lzdGVtIG1vZGUgICAqLworI2RlZmluZSBDT01NQU5EX0M1ICAgICAgICAweGM1CS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworI2RlZmluZSBHRVRfRFNQX1ZFUlNJT04gICAweGUxCS8qIEdldCBEU1AgVmVyc2lvbiAgICAgICAgICAgICAgICAgICAgICAqLworI2RlZmluZSBHRVRfRFNQX0NPUFlSSUdIVCAweGUzCS8qIEdldCBEU1AgQ29weXJpZ2h0ICAgICAgICAgICAgICAgICAgICAqLworCisvKgorICogT2Zmc2V0cyBvZiBBRURTUDE2IERTUCBJL08gcG9ydHMuIFRoZSBvZmZzZXQgaXMgYWRkZWQgdG8gYmFzZSBJL08gcG9ydAorICogdG8gaGF2ZSB0aGUgYWN0dWFsIEkvTyBwb3J0LgorICogUmVnaXN0ZXIgcGVybWlzc2lvbnMgYXJlOgorICogKHdvKSA9PSBXcml0ZSBPbmx5CisgKiAocm8pID09IFJlYWQgIE9ubHkKKyAqICh3LSkgPT0gV3JpdGUKKyAqIChyLSkgPT0gUmVhZAorICovCisjZGVmaW5lIERTUF9SRVNFVCAgICAweDA2CS8qIG9mZnNldCBvZiBEU1AgUkVTRVQgICAgICAgICAgICAgKHdvKSAqLworI2RlZmluZSBEU1BfUkVBRCAgICAgMHgwYQkvKiBvZmZzZXQgb2YgRFNQIFJFQUQgICAgICAgICAgICAgIChybykgKi8KKyNkZWZpbmUgRFNQX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lZCBtc3MgY29uZmlnICovCitzdGF0aWMgaW50ICAgICAgdmVyW0NBUkRWRVJMRU5dIF9faW5pdGRhdGEgPSB7MCwgMH07CS8qIERTUCBWZXI6CisJCQkJCQkgICBoaS0+dmVyWzBdIGxvLT52ZXJbMV0gKi8KKworI2lmIGRlZmluZWQoQ09ORklHX1NDNjYwMCkKK3N0YXRpYyBpbnQJaGFyZF9jZmdbMl0gICAgIC8qIGxvPC1oYXJkX2NmZ1swXSBoaTwtaGFyZF9jZmdbMV0gICAgICAqLworICAgICAgICAgICAgICAgICAgICAgX19pbml0ZGF0YSA9IHsgMCwgMH07CisjZW5kaWYgLyogQ09ORklHX1NDNjYwMCAqLworCisjaWYgZGVmaW5lZChDT05GSUdfU0M2NjAwKQorLyogRGVjb2RlZCBoYXJkIGNvbmZpZ3VyYXRpb24gKi8KK3N0cnVjdAlkX2hjZmcgeworCWludCBpb2Jhc2U7CisJaW50IGpveXN0aWNrOworCWludCBtcHViYXNlOworCWludCB3c3NiYXNlOworCWludCBjZHJvbTsKKwlpbnQgY2Ryb21iYXNlOworfTsKKworc3RhdGljIHN0cnVjdCBkX2hjZmcgZGVjb2RlZF9oY2ZnIF9faW5pdGRhdGEgPSB7MCwgfTsKKworI2VuZGlmIC8qIENPTkZJR19TQzY2MDAgKi8KKworLyogb3JWYWxzIGNvbnRhaW4gdGhlIHZhbHVlcyB0byBiZSBvcidlZCAgICAgICAJCQkJKi8KK3N0cnVjdCBvclZhbHMgeworCWludAl2YWw7CQkvKiBpcnF8bWlycXxkbWEgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKwlpbnQJb3I7CQkvKiBzb2Z0X2NmZyB8PSBUaGVTdHJ1Y3Qub3IgICAgICAgICAgICAgKi8KK307CisKKy8qIGFlZHNwMTZfaW5mbyBjb250YWluIHRoZSBhdWRpbyBjYXJkIGNvbmZpZ3VyYXRpb24gICAgICAgICAgICAgICAgICAqLworc3RydWN0IGFlZHNwMTZfaW5mbyB7CisJaW50IGJhc2VfaW87ICAgICAgICAgICAgLyogYmFzZSBJL08gYWRkcmVzcyBmb3IgYWNjZXNzaW5nIGNhcmQgICovCisJaW50IGlycTsgICAgICAgICAgICAgICAgLyogaXJxIHZhbHVlIGZvciBEU1AgSS9PICAgICAgICAgICAgICAgICovCisJaW50IG1wdV9pcnE7ICAgICAgICAgICAgLyogaXJxIGZvciBtcHU0MDEgaW50ZXJmYWNlIEkvTyAgICAgICAgICovCisJaW50IGRtYTsgICAgICAgICAgICAgICAgLyogZG1hIHZhbHVlIGZvciBEU1AgSS9PICAgICAgICAgICAgICAgICovCisJaW50IG1zc19iYXNlOyAgICAgICAgICAgLyogYmFzZSBJL08gZm9yIE1pY3Jvc29mdCBTb3VuZCBTeXN0ZW0gICovCisJaW50IG1wdV9iYXNlOyAgICAgICAgICAgLyogYmFzZSBJL08gZm9yIE1QVS00MDEgZW11bGF0aW9uICAgICAgICovCisJaW50IGluaXQ7ICAgICAgICAgICAgICAgLyogSW5pdGlhbGl6YXRpb24gc3RhdHVzIG9mIHRoZSBjYXJkICAgICovCit9OworCisvKgorICogTWFnaWMgdmFsdWVzIHRoYXQgdGhlIERTUCB3aWxsIGVhdCB3aGVuIGNvbmZpZ3VyaW5nIGlycS9taXJxL2RtYQorICovCisvKiBEU1AgSVJRIGNvbnZlcnNpb24gYXJyYXkgICAgICAgICAgICAgKi8KK3N0YXRpYyBzdHJ1Y3Qgb3JWYWxzIG9ySVJRW10gX19pbml0ZGF0YSA9IHsKKwl7MHgwNSwgMHgyOH0sCisJezB4MDcsIDB4MDh9LAorCXsweDA5LCAweDEwfSwKKwl7MHgwYSwgMHgxOH0sCisJezB4MGIsIDB4MjB9LAorCXsweDAwLCAweDAwfQorfTsKKworLyogTVBVLTQwMSBJUlEgY29udmVyc2lvbiBhcnJheSAgICAgICAgICovCitzdGF0aWMgc3RydWN0IG9yVmFscyBvck1JUlFbXSBfX2luaXRkYXRhID0geworCXsweDA1LCAweDA0fSwKKwl7MHgwNywgMHg0NH0sCisJezB4MDksIDB4ODR9LAorCXsweDBhLCAweGM0fSwKKwl7MHgwMCwgMHgwMH0KK307CisKKy8qIERNQSBDaGFubmVscyBjb252ZXJzaW9uIGFycmF5ICAgICAgICAqLworc3RhdGljIHN0cnVjdCBvclZhbHMgb3JETUFbXSBfX2luaXRkYXRhID0geworCXsweDAwLCAweDAxfSwKKwl7MHgwMSwgMHgwMn0sCisJezB4MDMsIDB4MDN9LAorCXsweDAwLCAweDAwfQorfTsKKworc3RhdGljIHN0cnVjdCBhZWRzcDE2X2luZm8gYWVfY29uZmlnID0geworCURFRl9BRURTUDE2X0lPQiwKKwlERUZfQUVEU1AxNl9JUlEsCisJREVGX0FFRFNQMTZfTVJRLAorCURFRl9BRURTUDE2X0RNQSwKKwktMSwKKwktMSwKKwlJTklUX05PTkUKK307CisKKy8qCisgKiBCdWZmZXJzIHRvIHN0b3JlIGF1ZGlvIGNhcmQgaW5mb3JtYXRpb25zCisgKi8KK3N0YXRpYyBjaGFyICAgICBEU1BDb3B5cmlnaHRbQ0FSRE5BTUVMRU4gKyAxXSBfX2luaXRkYXRhID0gezAsIH07CitzdGF0aWMgY2hhciAgICAgRFNQVmVyc2lvbltDQVJEVkVSTEVOICsgMV0gX19pbml0ZGF0YSA9IHswLCB9OworCitzdGF0aWMgaW50IF9faW5pdCBhZWRzcDE2X3dhaXRfZGF0YShpbnQgcG9ydCkKK3sKKwlpbnQgICAgICAgICAgICAgbG9vcCA9IFNUQVRVU1JFVFJZOworCXVuc2lnbmVkIGNoYXIgICByZXQgPSAwOworCisJREJHMSgoImFlZHNwMTZfd2FpdF9kYXRhICgweCV4KTogIiwgcG9ydCkpOworCisJZG8geworCQkgIHJldCA9IGluYihwb3J0ICsgRFNQX0RBVEFWQUlMKTsKKwkvKgorCSAqIFdhaXQgZm9yIGRhdGEgYXZhaWxhYmxlIChiaXQgNyBvZiByZXQgPT0gMSkKKwkgKi8KKwkgIH0gd2hpbGUgKCEocmV0ICYgMHg4MCkgJiYgbG9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ChhZWRzcDE2X2luaXRfbXNzKGFlX2NvbmZpZy5iYXNlX2lvKSA9PSBGQUxTRSkgeworCQkJCXByaW50aygiW0FFRFNQMTZdIENhbiBub3QgaW5pdGlhbGl6ZSIKKwkJCQkgICAgICAgIk1pY3Jvc29mdCBTb3VuZCBTeXN0ZW0gbW9kZS5cbiIpOworCQkJCXJldHVybiBGQUxTRTsKKwkJCX0KKwkJfQorCX0KKworI2lmICFkZWZpbmVkKE1PRFVMRSkgfHwgZGVmaW5lZChBRURTUDE2X0lORk8pIHx8IGRlZmluZWQoQUVEU1AxNl9ERUJVRykKKworCXByaW50aygiQXVkaW8gRXhjZWwgRFNQIDE2IGluaXQgdiVzICglcyAlcykgWyIsCisJCVZFUlNJT04sIERTUENvcHlyaWdodCwKKwkJRFNQVmVyc2lvbik7CisKKwlpZiAoYWVfY29uZmlnLm1wdV9iYXNlICE9IC0xKSB7CisJCWlmIChhZV9jb25maWcuaW5pdCAmIElOSVRfTVBVNDAxKSB7CisJCQlwcmludGsoIk1QVTQwMSIpOworCQkJaWYgKChhZV9jb25maWcuaW5pdCAmIElOSVRfTVNTKSB8fAorCQkJICAgIChhZV9jb25maWcuaW5pdCAmIElOSVRfU0JQUk8pKQorCQkJCXByaW50aygiICIpOworCQl9CisJfQorCisJaWYgKGFlX2NvbmZpZy5tc3NfYmFzZSA9PSAtMSkgeworCQlpZiAoYWVfY29uZmlnLmluaXQgJiBJTklUX1NCUFJPKSB7CisJCQlwcmludGsoIlNCUHJvIik7CisJCQlpZiAoYWVfY29uZmlnLmluaXQgJiBJTklUX01TUykKKwkJCQlwcmludGsoIiAiKTsKKwkJfQorCX0KKworCWlmIChhZV9jb25maWcubXNzX2Jhc2UgIT0gLTEpCisJCWlmIChhZV9jb25maWcuaW5pdCAmIElOSVRfTVNTKQorCQkJcHJpbnRrKCJNU1MiKTsKKworCXByaW50aygiXVxuIik7CisjZW5kaWYgLyogTU9EVUxFIHx8IEFFRFNQMTZfSU5GTyB8fCBBRURTUDE2X0RFQlVHICovCisKKwltZGVsYXkoMTApOworCisJcmV0dXJuIFRSVUU7Cit9CisKK3N0YXRpYyBpbnQgX19pbml0IGluaXRfYWVkc3AxNl9zYih2b2lkKQoreworCURCRygoImluaXRfYWVkc3AxNl9zYjogIikpOworCisvKgorICogSWYgdGhlIGNhcmQgaXMgYWxyZWFkeSBpbml0J2VkIE1TUywgd2UgY2FuIG5vdCBpbml0IGl0IHRvIFNCUFJPIHRvbworICogYmVjYXVzZSB0aGUgYm9hcmQgY2FuIG5vdCBlbXVsYXRlIHNpbXVsdGFuZW91c2x5IE1TUyBhbmQgU0JQUk8uCisgKi8KKwlpZiAoYWVfY29uZmlnLmluaXQgJiBJTklUX01TUykKKwkJcmV0dXJuIEZBTFNFOworCWlmIChhZV9jb25maWcuaW5pdCAmIElOSVRfU0JQUk8pCisJCXJldHVybiBGQUxTRTsKKworCWFlX2NvbmZpZy5pbml0IHw9IElOSVRfU0JQUk87CisKKwlEQkcoKCJkb25lLlxuIikpOworCisJcmV0dXJuIFRSVUU7Cit9CisKK3N0YXRpYyB2b2lkIHVuaW5pdF9hZWRzcDE2X3NiKHZvaWQpCit7CisJREJHKCgidW5pbml0X2FlZHNwMTZfc2I6ICIpKTsKKworCWFlX2NvbmZpZy5pbml0ICY9IH5JTklUX1NCUFJPOworCisJREJHKCgiZG9uZS5cbiIpKTsKK30KKworc3RhdGljIGludCBfX2luaXQgaW5pdF9hZWRzcDE2X21zcyh2b2lkKQoreworCURCRygoImluaXRfYWVkc3AxNl9tc3M6ICIpKTsKKworLyoKKyAqIElmIHRoZSBjYXJkIGlzIGFscmVhZHkgaW5pdCdlZCBTQlBSTywgd2UgY2FuIG5vdCBpbml0IGl0IHRvIE1TUyB0b28KKyAqIGJlY2F1c2UgdGhlIGJvYXJkIGNhbiBub3QgZW11bGF0ZSBzaW11bHRhbmVvdXNseSBNU1MgYW5kIFNCUFJPLgorICovCisJaWYgKGFlX2NvbmZpZy5pbml0ICYgSU5JVF9TQlB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25maWcuZG1hID0gZG1hOworCisJYWVfY29uZmlnLm1zc19iYXNlID0gbXNzX2Jhc2U7CisJYWVfY29uZmlnLm1wdV9iYXNlID0gbXB1X2Jhc2U7CisJYWVfY29uZmlnLm1wdV9pcnEgPSBtcHVfaXJxOworCisJaWYgKGluaXRfYWVkc3AxNigpID09IEZBTFNFKSB7CisJCXByaW50ayhLRVJOX0VSUiAiYWVkc3AxNjogaW5pdGlhbGl6YXRpb24gZmFpbGVkXG4iKTsKKwkJLyoKKwkJICogWFhYCisJCSAqIFdoYXQgZXJyb3Igc2hvdWxkIHdlIHJldHVybiBoZXJlID8KKwkJICovCisJCXJldHVybiAtRUlOVkFMOworCX0KKwlyZXR1cm4gMDsKK30KKworc3RhdGljIHZvaWQgX19leGl0IGNsZWFudXBfYWVkc3AxNih2b2lkKSB7CisJdW5pbml0X2FlZHNwMTYoKTsKK30KKworbW9kdWxlX2luaXQoZG9faW5pdF9hZWRzcDE2KTsKK21vZHVsZV9leGl0KGNsZWFudXBfYWVkc3AxNik7CisKKyNpZm5kZWYgTU9EVUxFCitzdGF0aWMgaW50IF9faW5pdCBzZXR1cF9hZWRzcDE2KGNoYXIgKnN0cikKK3sKKwkvKiBpbywgaXJxLCBkbWEsIG1zc19pbywgbXB1X2lvLCBtcHVfaXJxICovCisJaW50IGludHNbN107CisJCisJc3RyID0gZ2V0X29wdGlvbnMoc3RyLCBBUlJBWV9TSVpFKGludHMpLCBpbnRzKTsKKworCWlvCSA9IGludHNbMV07CisJaXJxCSA9IGludHNbMl07CisJZG1hCSA9IGludHNbM107CisJbXNzX2Jhc2UgPSBpbnRzWzRdOworCW1wdV9iYXNlID0gaW50c1s1XTsKKwltcHVfaXJxCSA9IGludHNbNl07CisJcmV0dXJuIDE7Cit9CisKK19fc2V0dXAoImFlZHNwMTY9Iiwgc2V0dXBfYWVkc3AxNik7CisjZW5kaWYKZGlmZiAtLWdpdCBhL3NvdW5kL29zcy9hbGk1NDU1LmMgYi9zb3VuZC9vc3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UFQLCBzdXJyb3VuZCBEQUNzIHdpbGwgKi8KKwkJLyogICAgIGF1dG9tYXRpY2xseSBnZXQgYXNzaWduZWQgdG8gc2xvdHMuICAgICAgICAgICAgKi8KKwkJLyogICAgICogQ2hlY2sgZm9yIHN1cnJvdW5kIERBQ3MgYW5kIGluY3JlbWVudCBpZiAgICAgKi8KKwkJLyogICAgICAgZm91bmQuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKwkJLyogICAtIEVsc2UgY2hlY2sgaWYgdGhlIGNvZGVjIGlzIHJldmlzaW9uIDIuMiAgICAgICAgKi8KKwkJLyogICAgICogSWYgc3Vycm91bmQgREFDcyBleGlzdCwgYXNzaWduIHRoZW0gdG8gc2xvdHMgKi8KKwkJLyogICAgICAgYW5kIGluY3JlbWVudCBjaGFubmVsIGNvdW50LiAgICAgICAgICAgICAgICAgKi8KKworCQkvKiBBbGwgb2YgdGhpcyBvbmx5IGFwcGxpZXMgdG8gSUNIMiBhbmQgYWJvdmUuIElDSCAgICAqLworCQkvKiBhbmQgSUNIMCBvbmx5IHN1cHBvcnQgMiBjaGFubmVscy4gIElDSDIgd2lsbCBvbmx5ICAqLworCQkvKiBzdXBwb3J0IG11bHRpcGxlIGNvZGVjcyBpbiBhICJzcGxpdCBhdWRpbyIgY29uZmlnLiAqLworCQkvKiBhcyBkZXNjcmliZWQgYWJvdmUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworCisJCS8qIFRPRE86IFJlbW92ZSBhbGwgdGhlIGRlYnVnZ2luZyBtZXNzYWdlcyEgICAgICAgICAgICovCisKKwkJaWYgKChlaWQgJiAweGMwMDApID09IDApCS8qIHByaW1hcnkgY29kZWMgKi8KKwkJCXRvdGFsX2NoYW5uZWxzICs9IDI7CisJCWlmICgoY29kZWMtPmRldl9taXhlciA9IHJlZ2lzdGVyX3NvdW5kX21peGVyKCZhbGlfbWl4ZXJfZm9wcywgLTEpKSA8IDApIHsKKwkJCXByaW50ay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RldiwgY2huLCBpbmZvLT5wZ21fbnVtKTsKK30KKworCisjaWZkZWYgQ09ORklHX0FXRTMyX01JWEVSCisvKgorICogQVdFMzIgbWl4ZXIgZGV2aWNlIGNvbnRyb2wKKyAqLworCitzdGF0aWMgaW50IGF3ZV9taXhlcl9pb2N0bChpbnQgZGV2LCB1bnNpZ25lZCBpbnQgY21kLCB2b2lkIF9fdXNlciAqYXJnKTsKKworc3RhdGljIGludCBteV9taXhlcmRldiA9IC0xOworCitzdGF0aWMgc3RydWN0IG1peGVyX29wZXJhdGlvbnMgYXdlX21peGVyX29wZXJhdGlvbnMgPSB7CisJLm93bmVyCT0gVEhJU19NT0RVTEUsCisJLmlkCT0gIkFXRSIsCisJLm5hbWUJPSAiQVdFMzIgRXF1YWxpemVyIiwKKwkuaW9jdGwJPSBhd2VfbWl4ZXJfaW9jdGwsCit9OworCitzdGF0aWMgdm9pZCBfX2luaXQgYXR0YWNoX21peGVyKHZvaWQpCit7CisJaWYgKChteV9taXhlcmRldiA9IHNvdW5kX2FsbG9jX21peGVyZGV2KCkpID49IDApIHsKKwkJbWl4ZXJfZGV2c1tteV9taXhlcmRldl0gPSAmYXdlX21peGVyX29wZXJhdGlvbnM7CisJfQorfQorCitzdGF0aWMgdm9pZCB1bmxvYWRfbWl4ZXIodm9pZCkKK3sKKwlpZiAobXlfbWl4ZXJkZXYgPj0gMCkKKwkJc291bmRfdW5sb2FkX21peGVyZGV2KG15X21peGVyZGV2KTsKK30KKworc3RhdGljIGludAorYXdlX21peGVyX2lvY3RsKGludCBkZXYsIHVuc2lnbmVkIGludCBjbWQsIHZvaWQgX191c2VyICogYXJnKQoreworCWludCBpLCBsZXZlbCwgdmFsdWU7CisKKwlpZiAoKChjbWQgPj4gOCkgJiAweGZmKSAhPSAnTScpCisJCXJldHVybiAtRUlOVkFMOworCisJaWYgKGdldF91c2VyKGxldmVsLCAoaW50IF9fdXNlciAqKWFyZykpCisJCXJldHVybiAtRUZBVUxUOworCWxldmVsID0gK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CkKKwkJcmV0dXJuIC1FQlVTWTsKKworCW1pZGlfb3BlbmVkID0gVFJVRTsKKworCW1pZGlfbW9kZSA9IE1PREVfR007CisKKwljdXJzdC5xdWV1ZSA9IFFfTk9ORTsKKwljdXJzdC5xbGVuID0gMDsKKwljdXJzdC5yZWFkID0gMDsKKwljdXJzdC5zdGF0dXMgPSAwOworCWN1cnN0LmNoYW4gPSAwOworCW1lbXNldChjdXJzdC5idWYsIDAsIHNpemVvZihjdXJzdC5idWYpKTsKKworCWluaXRfbWlkaV9zdGF0dXMoJmN1cnN0KTsKKworCXJldHVybiAwOworfQorCitzdGF0aWMgdm9pZAorYXdlX21pZGlfY2xvc2UgKGludCBkZXYpCit7CisJbWlkaV9vcGVuZWQgPSBGQUxTRTsKK30KKworCitzdGF0aWMgaW50Cithd2VfbWlkaV9pb2N0bCAoaW50IGRldiwgdW5zaWduZWQgY21kLCB2b2lkIF9fdXNlciAqYXJnKQoreworCXJldHVybiAtRVBFUk07Cit9CisKK3N0YXRpYyBpbnQKK2F3ZV9taWRpX291dHB1dGMgKGludCBkZXYsIHVuc2lnbmVkIGNoYXIgbWlkaV9ieXRlKQoreworCWlmICghIG1pZGlfb3BlbmVkKQorCQlyZXR1cm4gMTsKKworCS8qIGZvcmNlIHRvIGNoYW5nZSBwbGF5aW5nIG1vZGUgKi8KKwlwbGF5aW5nX21vZGUgPSBBV0VfUExBWV9NVUxUSTsKKworCWdldF9taWRpX2NoYXIoJmN1cnN0LCBtaWRpX2J5dGUpOworCXJldHVybiAxOworfQorCisKKy8qCisgKiBpbml0aWFsaXplCisgKi8KKworc3RhdGljIHZvaWQgaW5pdF9taWRpX3N0YXR1cyhNaWRpU3RhdHVzICpzdCkKK3sKKwljbGVhcl9ycG4oKTsKKwljb2Fyc2V0dW5lID0gMDsKKwlmaW5ldHVuZSA9IDA7Cit9CisKKworLyoKKyAqIFJQTiAmIE5SUE4KKyAqLworCisjZGVmaW5lIE1BWF9NSURJX0NIQU5ORUxTCTE2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RldmljZSh2b2lkKQoreworCWlmIChhd2VfcHJlc2VudCkgeworCQlhd2VfcmVzZXRfc2FtcGxlcygpOworCQlhd2VfcmVsZWFzZV9yZWdpb24oKTsKKwkJZnJlZV90YWJsZXMoKTsKKyNpZmRlZiBDT05GSUdfQVdFMzJfTUlYRVIKKwkJdW5sb2FkX21peGVyKCk7CisjZW5kaWYKKyNpZmRlZiBDT05GSUdfQVdFMzJfTUlESUVNVQorCQl1bmxvYWRfbWlkaWVtdSgpOworI2VuZGlmCisJCXNvdW5kX3VubG9hZF9zeW50aGRldihteV9kZXYpOworCQlhd2VfcHJlc2VudCA9IEZBTFNFOworCX0KK30KKworCisvKgorICogTGVnYWN5IGRldmljZSBQcm9iaW5nCisgKi8KKworLyogZGV0ZWN0IGVtdTgwMDAgY2hpcCBvbiB0aGUgc3BlY2lmaWVkIGFkZHJlc3M7IGZyb20gVlYncyBndWlkZSAqLworCitzdGF0aWMgaW50IF9faW5pdAorYXdlX2RldGVjdF9iYXNlKGludCBhZGRyKQoreworCXNldHVwX3BvcnRzKGFkZHIsIDAsIDApOworCWlmICgoYXdlX3BlZWsoQVdFX1UxKSAmIDB4MDAwRikgIT0gMHgwMDBDKQorCQlyZXR1cm4gMDsKKwlpZiAoKGF3ZV9wZWVrKEFXRV9IV0NGMSkgJiAweDAwN0UpICE9IDB4MDA1OCkKKwkJcmV0dXJuIDA7CisJaWYgKChhd2VfcGVlayhBV0VfSFdDRjIpICYgMHgwMDAzKSAhPSAweDAwMDMpCisJCXJldHVybiAwOworICAgICAgICBERUJVRygwLHByaW50aygiQVdFMzIgZm91bmQgYXQgJXhcbiIsIGFkZHIpKTsKKwlyZXR1cm4gMTsKK30KKworc3RhdGljIGludCBfX2luaXQgYXdlX2RldGVjdF9sZWdhY3lfZGV2aWNlcyh2b2lkKQoreworCWludCBiYXNlOworCWZvciAoYmFzZSA9IDB4NjIwOyBiYXNlIDw9IDB4NjgwOyBiYXNlICs9IDB4MjApCisJCWlmIChhd2VfZG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UgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmI1OTEwOWUKLS0tIC9kZXYvbnVsbAorKysgYi9zb3VuZC9vc3MvYmluMmhleC5jCkBAIC0wLDAgKzEsMzkgQEAKKyNpbmNsdWRlIDxzdGRpby5oPgorI2luY2x1ZGUgPHN0cmluZy5oPgorI2luY2x1ZGUgPHN0ZGxpYi5oPgorCitpbnQgbWFpbiggaW50IGFyZ2MsIGNvbnN0IGNoYXIgKiBhcmd2IFtdICkKK3sKKyAgICBjb25zdCBjaGFyICogdmFybmFtZTsKKyAgICBpbnQgaSA9IDA7CisgICAgaW50IGM7CisgICAgaW50IGlkID0gMDsKKworICAgIGlmKGFyZ3ZbMV0gJiYgc3RyY21wKGFyZ3ZbMV0sIi1pIik9PTApCisgICAgeworICAgIAlhcmd2Kys7CisgICAgCWFyZ2MtLTsKKyAgICAJaWQ9MTsKKyAgICB9CisgICAgCQorICAgIGlmKGFyZ2M9PTEpCisgICAgeworICAgIAlmcHJpbnRmKHN0ZGVyciwgImJpbjJoZXg6IFstaV0gZmlybXdhcmVcbiIpOworICAgIAlleGl0KDEpOworICAgIH0KKyAgICAKKyAgICB2YXJuYW1lID0gYXJndlsxXTsKKyAgICBwcmludGYoICIvKiBhdXRvbWF0aWNhbGx5IGdlbmVyYXRlZCBieSBiaW4yaGV4ICovXG4iICk7CisgICAgcHJpbnRmKCAic3RhdGljIHVuc2lnbmVkIGNoYXIgJXMgW10gJXMgPVxue1xuIiwgdmFybmFtZSAsIGlkPyJfX2luaXRkYXRhIjoiIik7CisKKyAgICB3aGlsZSAoICggYyA9IGdldGNoYXIoICkgKSAhPSBFT0YgKQorICAgIHsKKwlpZiAoIGkgIT0gMCAmJiBpICUgMTAgPT0gMCApCisJICAgIHByaW50ZiggIlxuIiApOworCXByaW50ZiggIjB4JTAybHgsIiwgYyAmIDB4RkZsICk7CisJaSsrOworICAgIH0KKworICAgIHByaW50ZiggIn07XG5zdGF0aWMgaW50ICVzTGVuID0gICVkO1x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worCWludCByZXQsdmFsPTAsaT0wOworCXZvaWQgX191c2VyICphcmdwID0gKHZvaWQgX191c2VyICopYXJnOworCisJaWYgKGNtZCA9PSBTT1VORF9NSVhFUl9JTkZPKSB7CisJCW1peGVyX2luZm8gaW5mbzsKKwkJbWVtc2V0KCZpbmZvLDAsc2l6ZW9mKGluZm8pKTsKKyAgICAgICAgICAgICAgICBzdHJsY3B5KGluZm8uaWQsImJ0ODc4IixzaXplb2YoaW5mby5pZCkpOworICAgICAgICAgICAgICAgIHN0cmxjcHkoaW5mby5uYW1lLCJCcm9va3RyZWUgQnQ4NzggYXVkaW8iLHNpemVvZihpbmZvLm5hbWUpKTsKKyAgICAgICAgICAgICAgICBpbmZvLm1vZGlmeV9jb3VudGVyID0gYnRhLT5taXhjb3VudDsKKyAgICAgICAgICAgICAgICBpZiAoY29weV90b191c2VyKGFyZ3AsICZpbmZvLCBzaXplb2YoaW5mbykpKQorICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC1FRkFVTFQ7CisJCXJldHVybiAwOworCX0KKwlpZiAoY21kID09IFNPVU5EX09MRF9NSVhFUl9JTkZPKSB7CisJCV9vbGRfbWl4ZXJfaW5mbyBpbmZvOworCQltZW1zZXQoJmluZm8sMCxzaXplb2YoaW5mbykpOworICAgICAgICAgICAgICAgIHN0cmxjcHkoaW5mby5pZCwiYnQ4NzgiLHNpemVvZihpbmZvLmlkKS0xKTsKKyAgICAgICAgICAgICAgICBzdHJsY3B5KGluZm8ubmFtZSwiQnJvb2t0cmVlIEJ0ODc4IGF1ZGlvIixzaXplb2YoaW5mby5uYW1lKSk7CisgICAgICAgICAgICAgICAgaWYgKGNvcHlfdG9fdXNlcihhcmdwLCAmaW5mbywgc2l6ZW9mKGluZm8pKSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAtRUZBVUxUOworCQlyZXR1cm4gMDsKKwl9CisJaWYgKGNtZCA9PSBPU1NfR0VUVkVSU0lPTikKKwkJcmV0dXJuIHB1d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sgMik7CisJLyogYWNrbm93bGVkZ2UgaW50ZXJydXB0ICovCisJaWYgKGludHNyYyAmIEFEQ0lOVCkKKwkJbWFzayB8PSBFTkFEQ0lOVDsKKwlpZiAoaW50c3JjICYgREFDSU5UKQorCQltYXNrIHw9IEVOREFDSU5UOworCW91dGIoaW50c3RhdCAmIH5tYXNrLCBzLT5pb2Jhc2UgKyBDT0RFQ19DTUlfSU5UX0hMRENMUiArIDIpOworCW91dGIoaW50c3RhdCB8IG1hc2ssIHMtPmlvYmFzZSArIENPREVDX0NNSV9JTlRfSExEQ0xSICsgMik7CisJY21fdXBkYXRlX3B0cihzKTsKKwlzcGluX3VubG9jaygmcy0+bG9jayk7CisjaWZkZWYgQ09ORklHX1NPVU5EX0NNUENJX01JREkKKwlpZiAoaW50c3JjICYgMHgwMDAxMDAwMCkgewkvLyBVQVJUIGludGVycnVwdAorCQlpZiAocy0+bWlkaV9kZXZjICYmIGludGNoa19tcHU0MDEoKHZvaWQgKilzLT5taWRpX2RldmMpKQorCQkJbXB1aW50cihpcnEsICh2b2lkICopcy0+bWlkaV9kZXZjLCByZWdzKTsKKwkJZWxzZQorCQkJaW5iKHMtPmlvbWlkaSk7Ly8gZHVtbXkgcmVhZAorCX0KKyNlbmRpZgorCXJldHVybiBJUlFfSEFORExFRDsKK30KKworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisKK3N0YXRpYyBjb25zdCBjaGFyIGludmFsaWRfbWFnaWNbXSA9IEtFUk5fQ1JJVCAiY21wY2k6IGludmFsaWQgbWFnaWMgdmFsdWVcbiI7CisKKyNkZWZpbmUgVkFMSURBVEVfU1RBVEUocykgICAgICAgICAgICAgICAgICAgICAgICAgXAorKHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJaWYgKCEocykgfHwgKHMpLT5tYWdpYyAhP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VNLOiAvKiBBcmcgY29udGFpbnMgYSBiaXQgZm9yIGVhY2ggc3VwcG9ydGVkIHJlY29yZGluZyBzb3VyY2UgKi8KKwkJCWZvciAodmFsID0gaSA9IDA7IGkgPCBTT1VORF9NSVhFUl9OUkRFVklDRVM7IGkrKykKKwkJCQlpZiAobWl4dGFibGVbaV0ucGxheSkKKwkJCQkJdmFsIHw9IDEgPDwgaTsKKwkJCXJldHVybiBwdXRfdXNlcih2YWwsIHApOworCisgICAgICAgICAgICAgICAgIGNhc2UgU09VTkRfTUlYRVJfU1RFUkVPREVWUzogLyogTWl4ZXIgY2hhbm5lbHMgc3VwcG9ydGluZyBzdGVyZW8gKi8KKwkJCWZvciAodmFsID0gaSA9IDA7IGkgPCBTT1VORF9NSVhFUl9OUkRFVklDRVM7IGkrKykKKwkJCQlpZiAobWl4dGFibGVbaV0udHlwZSAmJiBtaXh0YWJsZVtpXS50eXBlICE9IE1UXzRNVVRFTU9OTykKKwkJCQkJdmFsIHw9IDEgPDwgaTsKKwkJCXJldHVybiBwdXRfdXNlcih2YWwsIHApOworCisgICAgICAgICAgICAgICAgY2FzZSBTT1VORF9NSVhFUl9DQVBTOgorCQkJcmV0dXJuIHB1dF91c2VyKDAsIHApOworCisJCWRlZmF1bHQ6CisJCQlpID0gX0lPQ19OUihjbWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPj0gU09VTkRfTUlYRVJfTlJERVZJQ0VTIHx8ICFtaXh0YWJsZVtpXS50eXBlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKwkJCWlmICghdm9saWR4W2ldKQorCQkJCXJldHVybiAtRUlOVkFMOworCQkJcmV0dXJuIHB1dF91c2VyKHMtPm1peC52b2xbdm9saWR4W2ldLTFdLCBwKTsKKwkJfQorCX0KKyAgICAgICAgaWYgKF9TSU9DX0RJUihjbWQpICE9IChfU0lPQ19SRUFEfF9TSU9DX1dSSVRFKSkKKwkJcmV0dX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ESUZfTE9PUDoKKwkJaWYgKGdldF91c2VyKHZhbCwgcCkpCisJCQlyZXR1cm4gLUVGQVVMVDsKKwkJc2V0X3NwZGlmX2xvb3AocywgdmFsKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gMDsKKwljYXNlIFNORENUTF9TUERJRl9NT05JVE9SOgorCQlpZiAoZ2V0X3VzZXIodmFsLCBwKSkKKwkJCXJldHVybiAtRUZBVUxUOworCQlzZXRfc3BkaWZfbW9uaXRvcihzLCB2YWwpOworICAgICAgICAgICAgICAgIHJldHVybiAwOworCWNhc2UgU05EQ1RMX1NQRElGX0xFVkVMOgorCQlpZiAoZ2V0X3VzZXIodmFsLCBwKSkKKwkJCXJldHVybiAtRUZBVUxUOworCQlzZXRfc3BkaWZvdXRfbGV2ZWwocywgdmFsKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gMDsKKwljYXNlIFNORENUTF9TUERJRl9JTlY6CisJCWlmIChnZXRfdXNlcih2YWwsIHApKQorCQkJcmV0dXJuIC1FRkFVTFQ7CisJCXNldF9zcGRpZmluX2ludmVyc2UocywgdmFsKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gMDsKKwljYXNlIFNORENUTF9TUERJRl9TRUwyOgorCQlpZiAoZ2V0X3VzZXIodmFsLCBwKSkKKwkJCXJldHVybiAtRUZBVUxUOworCQlzZXRfc3BkaWZpbl9jaGFubmVsMihzLCB2YWwpOworICAgICAgICAgICAgICAgIHJldHVybiAwOworCWNhc2UgU05EQ1RMX1NQRElGX1ZBTElEOgorCQlpZiAoZ2V0X3VzZXIodmFsLCBwKSkKKwkJCXJldHVybiAtRUZBVUxUOworCQlzZXRfc3BkaWZpbl92YWxpZChzLCB2YWwpOworICAgICAgICAgICAgICAgIHJldHVybiAwOworCWNhc2UgU05EQ1RMX1NQRElGT1VUOgorCQlpZiAoZ2V0X3VzZXIodmFsLCBwKSkKKwkJCXJldHVybiAtRUZBVUxUOworCQlzZXRfc3BkaWZvdXQocywgdmFsID8gcy0+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ik7CisgICAgICAgIAorICAgICAgICAvKiBTd2l0Y2ggdG8gUGluIENvbnRyb2wgQWRkcmVzcyAqLyAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgcmVnZCA9IGluYihiYXNlaW8gKyBJTkRFWF9BRERSRVNTKSAmIDB4ZTA7CisgICAgICAgIG91dGIoKCh1bnNpZ25lZCBjaGFyKSAoUElOX0NPTlRST0wgfCByZWdkKSksIGJhc2VpbyArIElOREVYX0FERFJFU1MgKTsKKyAgICAgICAgCisgICAgICAgIC8qIEFjdGl2YXRlIHRoZSBYQ1RSTDAgYW5kIFhDVFJMMSBQaW5zICovCisgICAgICAgIHJlZ2QgPSBpbmIoYmFzZWlvICsgSU5ERVhfREFUQSk7CisgICAgICAgIG91dGIoKCh1bnNpZ25lZCBjaGFyKSAoRU5BQkxFX1BJTlMgfCByZWdkKSksIGJhc2VpbyArIElOREVYX0RBVEEgKTsKK30KKworc3RhdGljIGludCBfX2luaXQgcHJvYmVfY3M0MjMyKHN0cnVjdCBhZGRyZXNzX2luZm8gKmh3X2NvbmZpZywgaW50IGlzYXBucF9jb25maWd1cmVkKQoreworCWludCBpLCBuOworCWludCBiYXNlID0gaHdfY29uZmlnLT5pb19iYXNlLCBpcnEgPSBod19jb25maWctPmlycTsKKwlpbnQgZG1hMSA9IGh3X2NvbmZpZy0+ZG1hLCBkbWEyID0gaHdfY29uZmlnLT5kbWEyOworCXN0cnVjdCByZXNvdXJjZSAqcG9ydHM7CisKKwlpZiAoYmFzZSA9PSAtMSB8fCBpcnEgPT0gLTEgfHwgZG1hMSA9PSAtMSkgeworCQlwcmludGsoS0VSTl9FUlIgImNzNDIzMjogZG1hLCBpcnEgYW5kIGlvIG11c3QgYmUgc2V0LlxuIik7CisJCXJldHVybiAwOworCX0KKworCS8qCisJICogVmVyaWZ5IHRoYXQgdGhlIEkvTyBwb3J0IHJhbmdlIGlzIGZyZWUuCisJICovCisKKwlwb3J0cyA9IHJlcXVlc3RfcmVnaW9uKGJhc2Us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2NvbmZpZy0+aW9fYmFzZSwgaXJxID0gaHdfY29uZmlnLT5pcnE7CisJaW50IGRtYTEgPSBod19jb25maWctPmRtYSwgZG1hMiA9IGh3X2NvbmZpZy0+ZG1hMjsKKworCWlmIChkbWEyID09IC0xKQorCQlkbWEyID0gZG1hMTsKKworCWFkMTg0OF91bmxvYWQoYmFzZSwKKwkJICAgICAgaXJxLAorCQkgICAgICBkbWExLAkvKiBQbGF5YmFjayBETUEgKi8KKwkJICAgICAgZG1hMiwJLyogQ2FwdHVyZSBETUEgKi8KKwkJICAgICAgMCk7CisKKwlzb3VuZF91bmxvYWRfYXVkaW9kZXYoaHdfY29uZmlnLT5zbG90c1swXSk7CisJaWYgKG1wdV9iYXNlICE9IDAgJiYgbXB1X2lycSAhPSAwICYmIG1wdV9kZXRlY3RlZCkKKwl7CisJCXN0YXRpYyBzdHJ1Y3QgYWRkcmVzc19pbmZvIGh3X2NvbmZpZzIgPQorCQl7CisJCQkwCisJCX07CQkvKiBFbnN1cmUgaXQncyBpbml0aWFsaXplZCAqLworCisJCWh3X2NvbmZpZzIuaW9fYmFzZSA9IG1wdV9iYXNlOworCQlod19jb25maWcyLmlycSA9IG1wdV9pcnE7CisJCWh3X2NvbmZpZzIuZG1hID0gLTE7CisJCWh3X2NvbmZpZzIuZG1hMiA9IC0xOworCQlod19jb25maWcyLmFsd2F5c19kZXRlY3QgPSAwOworCQlod19jb25maWcyLm5hbWUgPSBOVUxMOworCQlod19jb25maWcyLmRyaXZlcl91c2VfMSA9IDA7CisJCWh3X2NvbmZpZzIuZHJpdmVyX3VzZV8yID0gMDsKKwkJaHdfY29uZmlnMi5jYXJkX3N1YnR5cGUgPSAwOworCQlod19jb25maWcyLnNsb3RzWzFdID0gaHdfY29uZmlnLT5zbG90c1sxXTsKKworCQl1bmxvYWRfdWFydDQwMSgmaHdfY29uZmlnMik7CisJfQorfQorCitzdGF0aWMgc3RydWN0IGFkZHJlc3NfaW5mbyBjZmc7CitzdGF0aWMgc3Ryd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2h3ZGVmcy5oCkBAIC0wLDAgKzEsMTIzNCBAQAorLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisvLworLy8gSFdERUZTLkggLSBEZWZpbml0aW9ucyBvZiB0aGUgcmVnaXN0ZXJzIGFuZCBkYXRhIHN0cnVjdHVyZXMgdXNlZCBieSB0aGUKKy8vICAgICAgICAgICAgQ1M0MjgxCisvLworLy8gQ29weXJpZ2h0IChjKSAxOTk5LDIwMDAsMjAwMSBDcnlzdGFsIFNlbWljb25kdWN0b3IgQ29ycC4KKy8vCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKworI2lmbmRlZiBfSF9IV0RFRlMKKyNkZWZpbmUgX0hfSFdERUZTCisKKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorLy8KKy8vIFRoZSBmb2xsb3dpbmcgZGVmaW5lIHRoZSBvZmZzZXRzIG9mIHRoZSByZWdpc3RlcnMgbG9jYXRlZCBpbiB0aGUgUENJCisvLyBjb25maWd1cmF0aW9uIHNwYWNlIG9mIHRoZSBDUzQyODEgcGFydC4KKy8vCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyNkZWZpbmUgUENJQ09ORklHX0RFVklEX1ZFTklEICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDBMCisjZGVmaW5lIFBDSUNPTkZJR19TVEFUVVNfQ09NTUFORCAgICAgICAgICAgICAgICAweDAwMDAwMDA0TAorI2RlZmluZSBQQ0lDT05GSUdfQ0xBU1NfUkVWSVNJT04gICAgICAgICAgICAgICAgMHgwMDAwMDAwOEwKKyNkZWZpbmUgUENJQ09ORklHX0xBVEVOQ1lfVElNRVIgICAgICAgICAgICAgICAgIDB4MDAwMDAwMENMCisjZGVmaW5lIFBDSUNPTkZJR19CQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDEwTAorI2RlZmluZSBQQ0lDT05GSUdfQkExICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAxNEwKKyNkZWZpbmUgUENJQ09ORklHX1NVQlNZU0lEX1NVQlNZU1ZFTklEICAgICAgICAgIDB4MDAwMDAwMkNMCisjZGVmaW5lIFBDSUNPTkZJR19JTlRFUlJVUFQgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDNDTAorCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKy8vCisvLyBUaGUgZm9sbG93aW5nIGRlZmluZSB0aGUgb2Zmc2V0cyBvZiB0aGUgcmVnaXN0ZXJzIGFjY2Vzc2VkIHZpYSBiYXNlIGFkZHJlc3MKKy8vIHJlZ2lzdGVyIHplcm8gb24gdGhlIENTNDI4MSBwYXJ0LgorLy8KKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorI2RlZmluZSBCQTBfSElTUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMEwKKyNkZWZpbmUgQkEwX0hJQ1IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDhMCisjZGVmaW5lIEJBMF9ISU1SICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDBDTAorI2RlZmluZSBCQTBfSUlFUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAxMEwKKyNkZWZpbmUgQkEwX0hEU1IwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwRjBMCisjZGVmaW5lIEJBMF9IRFNSMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMEY0TAorI2RlZmluZSBCQTBfSERTUjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDBGOEwKKyNkZWZpbmUgQkEwX0hEU1IzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwRkNMCisjZGVmaW5lIEJBMF9EQ0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMTEwTAorI2RlZmluZSBCQTBfRENDMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDExNEwKKyNkZWZpbmUgQkEwX0RCQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxMThMCisjZGVmaW5lIEJBMF9EQkMwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMTFDTAorI2RlZmluZSBCQTBfRENBMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDEyMEwKKyNkZWZpbmUgQkEwX0RDQzEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxMjRMCisjZGVmaW5lIEJBMF9EQkExICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMTI4TAorI2RlZmluZSBCQTBfREJDMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDEyQ0wKKyNkZWZpbmUgQkEwX0RDQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxMzBMCisjZGVmaW5lIEJBMF9EQ0MyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMTM0TAorI2RlZmluZSBCQTBfREJBMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDEzOEwKKyNkZWZpbmUgQkEwX0RCQzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxM0NMCisjZGVmaW5lIEJBMF9EQ0EzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMTQwTAorI2RlZmluZSBCQTBfRENDMyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDE0NEwKKyNkZWZpbmUgQkEwX0RCQTMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxNDhMCisjZGVmaW5lIEJBMF9EQkMzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMTRDTAorI2RlZmluZSBCQTBfRE1SMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDE1MEwKKyNkZWZpbmUgQkEwX0RDUjAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxNTRMCisjZGVmaW5lIEJBMF9ETVIxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMTU4TAorI2RlZmluZSBCQTBfRENSMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDE1Q0wKKyNkZWZpbmUgQkEwX0RNUjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxNjBMCisjZGVmaW5lIEJBMF9EQ1IyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMTY0TAorI2RlZmluZSBCQTBfRE1SMyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDE2OEwKKyNkZWZpbmUgQkEwX0RDUjMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxNkNMCisjZGVmaW5lIEJBMF9ETE1SICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMTcwTAorI2RlZmluZSBCQTBfRExTUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDE3NEwKKyNkZWZpbmUgQkEwX0ZDUjAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxODBMCisjZGVmaW5lIEJBMF9GQ1IxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMTg0TAorI2RlZmluZSBCQTBfRkNSMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDE4OEwKKyNkZWZpbmUgQkEwX0ZDUjMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxOENMCisjZGVmaW5lIEJBMF9GUERSMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMTkwTAorI2RlZmluZSBCQTBfRlBEUjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDE5NEwKKyNkZWZpbmUgQkEwX0ZQRFIyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxOThMCisjZGVmaW5lIEJBMF9GUERSMyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMTlDTAorI2RlZmluZSBCQTBfRkNIUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDIwQ0wKKyNkZWZpbmUgQkEwX0ZTSUMwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAyMTBMCisjZGVmaW5lIEJBMF9GU0lDMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMjE0TAorI2RlZmluZSBCQTBfRlNJQzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDIxOEwKKyNkZWZpbmUgQkEwX0ZTSUMzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAyMUNMCisjZGVmaW5lIEJBMF9QQ0lDRkcwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMzAwTAorI2RlZmluZSBCQTBfUENJQ0ZHMDQgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDMwNEwKKyNkZWZpbmUgQkEwX1BDSUNGRzA4ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAzMDhMCisjZGVmaW5lIEJBMF9QQ0lDRkcwQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMzBDTAorI2RlZmluZSBCQTBfUENJQ0ZHMTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDMxMEwKKyNkZWZpbmUgQkEwX1BDSUNGRzE0ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAzMTRMCisjZGVmaW5lIEJBMF9QQ0lDRkcxOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMzE4TAorI2RlZmluZSBCQTBfUENJQ0ZHMUMgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDMxQ0wKKyNkZWZpbmUgQkEwX1BDSUNGRzIwICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAzMjBMCisjZGVmaW5lIEJBMF9QQ0lDRkcyNCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMzI0TAorI2RlZmluZSBCQTBfUENJQ0ZHMjggICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDMyOEwKKyNkZWZpbmUgQkEwX1BDSUNGRzJDICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAzMkNMCisjZGVmaW5lIEJBMF9QQ0lDRkczMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMzMwTAorI2RlZmluZSBCQTBfUENJQ0ZHMzQgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDMzNEwKKyNkZWZpbmUgQkEwX1BDSUNGRzM4ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAzMzhMCisjZGVmaW5lIEJBMF9QQ0lDRkczQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMzNDTAorI2RlZmluZSBCQTBfUENJQ0ZHNDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDM0MEwKKyNkZWZpbmUgQkEwX1BNQ1MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAzNDRMCisjZGVmaW5lIEJBMF9DV1BSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwM0UwTAorI2RlZmluZSBCQTBfRVBQTUMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDNFNEwKKyNkZWZpbmUgQkEwX0dQSU9SICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAzRThMCisjZGVmaW5lIEJBMF9TUE1DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwM0VDTAorI2RlZmluZSBCQTBfQ0ZMUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDNGMEwKKyNkZWZpbmUgQkEwX0lJU1IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAzRjRMCisjZGVmaW5lIEJBMF9UTVMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwM0Y4TAorI2RlZmluZSBCQTBfU1NWSUQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDNGQ0wKKyNkZWZpbmUgQkEwX0NMS0NSMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0MDBMCisjZGVmaW5lIEJBMF9GUlIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNDEwTAorI2RlZmluZSBCQTBfU0xUMTJPICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDQxQ0wKKyNkZWZpbmUgQkEwX1NFUk1DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0MjBMCisjZGVmaW5lIEJBMF9TRVJDMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNDI4TAorI2RlZmluZSBCQTBfU0VSQzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDQyQ0wKKyNkZWZpbmUgQkEwX1NMVDEyTSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0NUNMCisjZGVmaW5lIEJBMF9BQ0NUTCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNDYwTAorI2RlZmluZSBCQTBfQUNTVFMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDQ2NEwKKyNkZWZpbmUgQkEwX0FDT1NWICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0NjhMCisjZGVmaW5lIEJBMF9BQ0NBRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNDZDTAorI2RlZmluZSBCQTBfQUNDREEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDQ3MEwKKyNkZWZpbmUgQkEwX0FDSVNWICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0NzRMCisjZGVmaW5lIEJBMF9BQ1NBRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNDc4TAorI2RlZmluZSBCQTBfQUNTREEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDQ3Q0wKKyNkZWZpbmUgQkEwX0pTUFQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0ODBMCisjZGVmaW5lIEJBMF9KU0NUTCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNDg0TAorI2RlZmluZSBCQTBfTUlEQ1IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDQ5MEwKKyNkZWZpbmUgQkEwX01JRENNRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0OTRMCisjZGVmaW5lIEJBMF9NSURTUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNDk0TAorI2RlZmluZSBCQTBfTUlEV1AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDQ5OEwKKyNkZWZpbmUgQkEwX01JRFJQICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0OUNMCisjZGVmaW5lIEJBMF9BT0RTRDEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNEE4TAorI2RlZmluZSBCQTBfQU9EU0QyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDRBQ0wKKyNkZWZpbmUgQkEwX0NGR0kgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0QjBMCisjZGVmaW5lIEJBMF9TTFQxMk0yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNERDTAorI2RlZmluZSBCQTBfQUNTVFMyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDRFNEwKKyNkZWZpbmUgQkEwX0FDSVNWMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0RjRMCisjZGVmaW5lIEJBMF9BQ1NBRDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNEY4TAorI2RlZmluZSBCQTBfQUNTREEyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDRGQ0wKKyNkZWZpbmUgQkEwX0lPVEdQICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA1MDBMCisjZGVmaW5lIEJBMF9JT1RTQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNTA0TAorI2RlZmluZSBCQTBfSU9URk0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDUwOEwKKyNkZWZpbmUgQkEwX0lPVERNQSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA1MENMCisjZGVmaW5lIEJBMF9JT1RBQzAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNTAwTAorI2RlZmluZSBCQTBfSU9UQUMxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDUwNEwKKyNkZWZpbmUgQkEwX0lPVEFDMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA1MDhMCisjZGVmaW5lIEJBMF9JT1RBQzMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNTBDTAorI2RlZmluZSBCQTBfSU9UUENQICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDUyQ0wKKyNkZWZpbmUgQkEwX0lPVENDICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA1MzBMCisjZGVmaW5lIEJBMF9JT1RDUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNThDTAorI2RlZmluZSBCQTBfUENQUlIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDYwMEwKKyNkZWZpbmUgQkEwX1BDUEdSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA2MDRMCisjZGVmaW5lIEJBMF9QQ1BDUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNjA4TAorI2RlZmluZSBCQTBfUENQQ0lFTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDYwOEwKKyNkZWZpbmUgQkEwX1NCTUFSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA3MDBMCisjZGVmaW5lIEJBMF9TQk1EUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNzA0TAorI2RlZmluZSBCQTBfU0JSUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDcwOEwKKyNkZWZpbmUgQkEwX1NCUkRQICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA3MENMCisjZGVmaW5lIEJBMF9TQldEUCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNzEwTAorI2RlZmluZSBCQTBfU0JXQlMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDcxMEwKKyNkZWZpbmUgQkEwX1NCUkJTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA3MTRMCisjZGVmaW5lIEJBMF9GTVNSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNzMwTAorI2RlZmluZSBCQTBfQjBBUCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDczMEwKKyNkZWZpbmUgQkEwX0ZNRFAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA3MzRMCisjZGVmaW5lIEJBMF9CMUFQICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNzM4TAorI2RlZmluZSBCQTBfQjFEUCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDczQ0wKKyNkZWZpbmUgQkEwX1NTUE0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA3NDBMCisjZGVmaW5lIEJBMF9EQUNTUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNzQ0TAorI2RlZmluZSBCQTBfQURDU1IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDc0OEwKKyNkZWZpbmUgQkEwX1NTQ1IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA3NENMCisjZGVmaW5lIEJBMF9GTUxWQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNzU0TAorI2RlZmluZSBCQTBfRk1SVkMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDc1OEwKKyNkZWZpbmUgQkEwX1NSQ1NBICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA3NUNMCisjZGVmaW5lIEJBMF9QUExWQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNzYwTAorI2RlZmluZSBCQTBfUFBSVkMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDc2NEwKKyNkZWZpbmUgQkEwX1BBU1IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA3NjhMCisjZGVmaW5lIEJBMF9DQVNSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNzZDTAorCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKy8vCisvLyBUaGUgZm9sbG93aW5nIGRlZmluZSB0aGUgb2Zmc2V0cyBvZiB0aGUgQUM5NyBzaGFkb3cgcmVnaXN0ZXJzLCB3aGljaCBhcHBlYXIKKy8vIGFzIGEgdmlydHVhbCBleHRlbnNpb24gdG8gdGhlIGJhc2UgYWRkcmVzcyByZWdpc3RlciB6ZXJvIG1lbW9yeSByYW5nZS4KKy8vCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyNkZWZpbmUgQUM5N19SRUdfT0ZGU0VUX01BU0sgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwN0VMCisjZGVmaW5lIEFDOTdfQ09ERUNfTlVNQkVSX01BU0sgICAgICAgICAgICAgICAgICAweDAwMDAzMDAwTAorCisjZGVmaW5lIEJBMF9BQzk3X1JFU0VUICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAxMDAwTAorI2RlZmluZSBCQTBfQUM5N19NQVNURVJfVk9MVU1FICAgICAgICAgICAgICAgICAgMHgwMDAwMTAwMkwKKyNkZWZpbmUgQkEwX0FDOTdfSEVBRFBIT05FX1ZPTFVNRSAgICAgICAgICAgICAgIDB4MDAwMDEwMDRMCisjZGVmaW5lIEJBMF9BQzk3X01BU1RFUl9WT0xVTUVfTU9OTyAgICAgICAgICAgICAweDAwMDAxMDA2TAorI2RlZmluZSBCQTBfQUM5N19NQVNURVJfVE9ORSAgICAgICAgICAgICAgICAgICAgMHgwMDAwMTAwOEwKKyNkZWZpbmUgQkEwX0FDOTdfUENfQkVFUF9WT0xVTUUgICAgICAgICAgICAgICAgIDB4MDAwMDEwMEFMCisjZGVmaW5lIEJBMF9BQzk3X1BIT05FX1ZPTFVNRSAgICAgICAgICAgICAgICAgICAweDAwMDAxMDBDTAorI2RlZmluZSBCQTBfQUM5N19NSUNfVk9MVU1FICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMTAwRUwKKyNkZWZpbmUgQkEwX0FDOTdfTElORV9JTl9WT0xVTUUgICAgICAgICAgICAgICAgIDB4MDAwMDEwMTBMCisjZGVmaW5lIEJBMF9BQzk3X0NEX1ZPTFVNRSAgICAgICAgICAgICAgICAgICAgICAweDAwMDAxMDEyTAorI2RlZmluZSBCQTBfQUM5N19WSURFT19WT0xVTUUgICAgICAgICAgICAgICAgICAgMHgwMDAwMTAxNEwKKyNkZWZpbmUgQkEwX0FDOTdfQVVYX1ZPTFVNRSAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDEwMTZMCisjZGVmaW5lIEJBMF9BQzk3X1BDTV9PVVRfVk9MVU1FICAgICAgICAgICAgICAgICAweDAwMDAxMDE4TAorI2RlZmluZSBCQTBfQUM5N19SRUNPUkRfU0VMRUNUICAgICAgICAgICAgICAgICAgMHgwMDAwMTAxQUwKKyNkZWZpbmUgQkEwX0FDOTdfUkVDT1JEX0dBSU4gICAgICAgICAgICAgICAgICAgIDB4MDAwMDEwMUNMCisjZGVmaW5lIEJBMF9BQzk3X1JFQ09SRF9HQUlOX01JQyAgICAgICAgICAgICAgICAweDAwMDAxMDFFTAorI2RlZmluZSBCQTBfQUM5N19HRU5FUkFMX1BVUlBPU0UgICAgICAgICAgICAgICAgMHgwMDAwMTAyMEwKKyNkZWZpbmUgQkEwX0FDOTdfM0RfQ09OVFJPTCAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDEwMjJMCisjZGVmaW5lIEJBMF9BQzk3X01PREVNX1JBVEUgICAgICAgICAgICAgICAgICAgICAweDAwMDAxMDI0TAorI2RlZmluZSBCQTBfQUM5N19QT1dFUkRPV04gICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMTAyNkwKKyNkZWZpbmUgQkEwX0FDOTdfRVhUX0FVRElPX0lEICAgICAgICAgICAgICAgICAgIDB4MDAwMDEwMjhMCisjZGVmaW5lIEJBMF9BQzk3X0VYVF9BVURJT19QT1dFUiAgICAgICAgICAgICAgICAweDAwMDAxMDJBTAorI2RlZmluZSBCQTBfQUM5N19QQ01fRlJPTlRfREFDX1JBVEUgICAgICAgICAgICAgMHgwMDAwMTAyQ0wKKyNkZWZpbmUgQkEwX0FDOTdfUENNX1NVUlJfREFDX1JBVEUgICAgICAgICAgICAgIDB4MDAwMDEwMkVMCisjZGVmaW5lIEJBMF9BQzk3X1BDTV9MRkVfREFDX1JBVEUgICAgICAgICAgICAgICAweDAwMDAxMDMwTAorI2RlZmluZSBCQTBfQUM5N19QQ01fTFJfQURDX1JBVEUgICAgICAgICAgICAgICAgMHgwMDAwMTAzMkwKKyNkZWZpbmUgQkEwX0FDOTdfTUlDX0FEQ19SQVRFICAgICAgICAgICAgICAgICAgIDB4MDAwMDEwMzRMCisjZGVmaW5lIEJBMF9BQzk3XzZDSF9WT0xfQ19MRkUgICAgICAgICAgICAgICAgICAweDAwMDAxMDM2TAorI2RlZmluZSBCQTBfQUM5N182Q0hfVk9MX1NVUlJPVU5EICAgICAgICAgICAgICAgMHgwMDAwMTAzOEwKKyNkZWZpbmUgQkEwX0FDOTdfUkVTRVJWRURfM0EgICAgICAgICAgICAgICAgICAgIDB4MDAwMDEwM0FMCisjZGVmaW5lIEJBMF9BQzk3X0VYVF9NT0RFTV9JRCAgICAgICAgICAgICAgICAgICAweDAwMDAxMDNDTAorI2RlZmluZSBCQTBfQUM5N19FWFRfTU9ERU1fUE9XRVIgICAgICAgICAgICAgICAgMHgwMDAwMTAzRUwKKyNkZWZpbmUgQkEwX0FDOTdfTElORTFfQ09ERUNfUkFURSAgICAgICAgICAgICAgIDB4MDAwMDEwNDBMCisjZGVmaW5lIEJBMF9BQzk3X0xJTkUyX0NPREVDX1JBVEUgICAgICAgICAgICAgICAweDAwMDAxMDQyTAorI2RlZmluZSBCQTBfQUM5N19IQU5EU0VUX0NPREVDX1JBVEUgICAgICAgICAgICAgMHgwMDAwMTA0NEwKKyNkZWZpbmUgQkEwX0FDOTdfTElORTFfQ09ERUNfTEVWRUwgICAgICAgICAgICAgIDB4MDAwMDEwNDZMCisjZGVmaW5lIEJBMF9BQzk3X0xJTkUyX0NPREVDX0xFVkVMICAgICAgICAgICAgICAweDAwMDAxMDQ4TAorI2RlZmluZSBCQTBfQUM5N19IQU5EU0VUX0NPREVDX0xFVkVMICAgICAgICAgICAgMHgwMDAwMTA0QUwKKyNkZWZpbmUgQkEwX0FDOTdfR1BJT19QSU5fQ09ORklHICAgICAgICAgICAgICAgIDB4MDAwMDEwNENMCisjZGVmaW5lIEJBMF9BQzk3X0dQSU9fUElOX1RZUEUgICAgICAgICAgICAgICAgICAweDAwMDAxMDRFTAorI2RlZmluZSBCQTBfQUM5N19HUElPX1BJTl9TVElDS1kgICAgICAgICAgICAgICAgMHgwMDAwMTA1MEwKKyNkZWZpbmUgQkEwX0FDOTdfR1BJT19QSU5fV0FLRVVQICAgICAgICAgICAgICAgIDB4MDAwMDEwNTJMCisjZGVmaW5lIEJBMF9BQzk3X0dQSU9fUElOX1NUQVRVUyAgICAgICAgICAgICAgICAweDAwMDAxMDU0TAorI2RlZmluZSBCQTBfQUM5N19NSVNDX01PREVNX0FGRV9TVEFUICAgICAgICAgICAgMHgwMDAwMTA1NkwKKyNkZWZpbmUgQkEwX0FDOTdf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mluZSBCQTBfQUM5N19WRU5ET1JfUkVTRVJWRURfNzQgICAgICAgICAgICAgMHgwMDAwMTA3NEwKKyNkZWZpbmUgQkEwX0FDOTdfQ0FMX0FERFJFU1MgICAgICAgICAgICAgICAgICAgIDB4MDAwMDEwNzZMCisjZGVmaW5lIEJBMF9BQzk3X0NBTF9EQVRBICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAxMDc4TAorI2RlZmluZSBCQTBfQUM5N19WRU5ET1JfUkVTRVJWRURfN0EgICAgICAgICAgICAgMHgwMDAwMTA3QUwKKyNkZWZpbmUgQkEwX0FDOTdfVkVORE9SX0lEMSAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDEwN0NMCisjZGVmaW5lIEJBMF9BQzk3X1ZFTkRPUl9JRDIgICAgICAgICAgICAgICAgICAgICAweDAwMDAxMDdFTAorCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKy8vCisvLyBUaGUgZm9sbG93aW5nIGRlZmluZSB0aGUgb2Zmc2V0cyBvZiB0aGUgcmVnaXN0ZXJzIGFuZCBtZW1vcmllcyBhY2Nlc3NlZCB2aWEKKy8vIGJhc2UgYWRkcmVzcyByZWdpc3RlciBvbmUgb24gdGhlIENTNDI4MSBwYXJ0LgorLy8KKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKy8vCisvLyBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIFBDSSBkZXZpY2UgSUQvdmVuZG9yIElECisvLyByZWdpc3Rlci4KKy8vCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyNkZWZpbmUgUERWX1ZFTklEX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMEZGRkZMCisjZGVmaW5lIFBEVl9ERVZJRF9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAweEZGRkYwMDAwTAorI2RlZmluZSBQRFZfVkVOSURfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgMEwKKyNkZWZpbmUgUERWX0RFVklEX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgIDE2TAorI2RlZmluZSBWRU5JRF9DSVJSVVNfTE9HSUMgICAgICAgICAgICAgICAgICAgICAgMHgxMDEzTAorI2RlZmluZSBERVZJRF9DUzQyODEgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg2MDA1TAorCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKy8vCisvLyBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIFBDSSBzdGF0dXMgYW5kIGNvbW1hbmQKKy8vIHJlZ2lzdGVyLgorLy8KKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorI2RlZmluZSBQU0NfSU9fU1BBQ0VfRU5BQkxFICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMUwKKyNkZWZpbmUgUFNDX01FTU9SWV9TUEFDRV9FTkFCTEUgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDJMCisjZGVmaW5lIFBTQ19CVVNfTUFTVEVSX0VOQUJMRSAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA0TAorI2RlZmluZSBQU0NfU1BFQ0lBTF9DWUNMRVMgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwOEwKKyNkZWZpbmUgUFNDX01XSV9FTkFCTEUgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMTBMCisjZGVmaW5lIFBTQ19WR0FfUEFMRVRURV9TTk9PUCAgICAgICAgICAgICAgICAgICAweDAwMDAwMDIwTAorI2RlZmluZSBQU0NfUEFSSVRZX1JFU1BPTlNFICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA0MEwKKyNkZWZpbmUgUFNDX1dBSVRfQ09OVFJPTCAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwODBMCisjZGVmaW5lIFBTQ19TRVJSX0VOQUJMRSAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMTAwTAorI2RlZmluZSBQU0NfRkFTVF9CMkJfRU5BQkxFICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDIwMEwKKyNkZWZpbmUgUFNDX1VERl9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDA3RjAwMDBMCisjZGVmaW5lIFBTQ19GQVNUX0IyQl9DQVBBQkxFICAgICAgICAgICAgICAgICAgICAweDAwODAwMDAwTAorI2RlZmluZSBQU0NfUEFSSVRZX0VSUk9SX0RFVEVDVEVEICAgICAgICAgICAgICAgMHgwMTAwMDAwMEwKKyNkZWZpbmUgUFNDX0RFVlNFTF9USU1JTkdfTUFTSyAgICAgICAgICAgICAgICAgIDB4MDYwMDAwMDBMCisjZGVmaW5lIFBTQ19UQVJHRVRfQUJPUlRfU0lHTkFMTEVEICAgICAgICAgICAgICAweDA4MDAwMDAwTAorI2RlZmluZSBQU0NfUkVDRUlWRURfVEFSR0VUX0FCT1JUICAgICAgICAgICAgICAgMHgxMDAwMDAwMEwKKyNkZWZpbmUgUFNDX1JFQ0VJVkVEX01BU1RFUl9BQk9SVCAgICAgICAgICAgICAgIDB4MjAwMDAwMDBMCisjZGVmaW5lIFBTQ19TSUdOQUxMRURfU0VSUiAgICAgICAgICAgICAgICAgICAgICAweDQwMDAwMDAwTAorI2RlZmluZSBQU0NfREVURUNURURfUEFSSVRZX0VSUk9SICAgICAgICAgICAgICAgMHg4MDAwMDAwMEwKKyNkZWZpbmUgUFNDX1VERl9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAgIDE2TAorI2RlZmluZSBQU0NfREVWU0VMX1RJTUlOR19TSElGVCAgICAgICAgICAgICAgICAgMjVMCisKKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorLy8KKy8vIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgUENJIGNsYXNzL3JldmlzaW9uIElECisvLyByZWdpc3Rlci4KKy8vCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyNkZWZpbmUgUENSX1JFVklEX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwRkZMCisjZGVmaW5lIFBDUl9JTlRFUkZBQ0VfTUFTSyAgICAgICAgICAgICAgICAgICAgICAweDAwMDBGRjAwTAorI2RlZmluZSBQQ1JfU1VCQ0xBU1NfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgMHgwMEZGMDAwMEwKKyNkZWZpbmUgUENSX0NMQVNTX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgIDB4RkYwMDAwMDBMCisjZGVmaW5lIFBDUl9SRVZJRF9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAwTAorI2RlZmluZSBQQ1JfSU5URVJGQUNFX1NISUZUICAgICAgICAgICAgICAgICAgICAgOEwKKyNkZWZpbmUgUENSX1NVQkNMQVNTX1NISUZUICAgICAgICAgICAgICAgICAgICAgIDE2TAorI2RlZmluZSBQQ1JfQ0xBU1NfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgMjRMCisKKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorLy8KKy8vIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgUENJIGxhdGVuY3kgdGltZXIgcmVnaXN0ZXIuCisvLworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisjZGVmaW5lIFBMVF9DQUNIRV9MSU5FX1NJWkVfTUFTSyAgICAgICAgICAgICAgICAweDAwMDAwMEZGTAorI2RlZmluZSBQTFRfTEFURU5DWV9USU1FUl9NQVNLICAgICAgICAgICAgICAgICAgMHgwMDAwRkYwMEwKKyNkZWZpbmUgUExUX0hFQURFUl9UWVBFX01BU0sgICAgICAgICAgICAgICAgICAgIDB4MDBGRjAwMDBMCisjZGVmaW5lIFBMVF9CSVNUX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgICAweEZGMDAwMDAwTAorI2RlZmluZSBQTFRfQ0FDSEVfTElORV9TSVpFX1NISUZUICAgICAgICAgICAgICAgMEwKKyNkZWZpbmUgUExUX0xBVEVOQ1lfVElNRVJfU0hJRlQgICAgICAgICAgICAgICAgIDhMCisjZGVmaW5lIFBMVF9IRUFERVJfVFlQRV9TSElGVCAgICAgICAgICAgICAgICAgICAxNkwKKyNkZWZpbmUgUExUX0JJU1RfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgIDI0TAorCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKy8vCisvLyBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIFBDSSBiYXNlIGFkZHJlc3MgcmVnaXN0ZXJzLgorLy8KKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorI2RlZmluZSBQQkFSX01FTU9SWV9TUEFDRV9JTkRJQ0FUT1IgICAgICAgICAgICAgMHgwMDAwMDAwMUwKKyNkZWZpbmUgUEJBUl9MT0NBVElPTl9UWVBFX01BU0sgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDZMCisjZGVmaW5lIFBCQVJfTk9UX1BSRUZFVENIQUJMRSAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA4TAorI2RlZmluZSBQQkFSX0FERFJFU1NfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgMHhGRkZGRkZGMEwKKyNkZWZpbmUgUEJBUl9MT0NBVElPTl9UWVBFX1NISUZUICAgICAgICAgICAgICAgIDFMCisKKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorLy8KKy8vIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgUENJIHN1YnN5c3RlbSBJRC9zdWJzeXN0ZW0KKy8vIHZlbmRvciBJRCByZWdpc3Rlci4KKy8vCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyNkZWZpbmUgUFNTX1NVQlNZU1RFTV9WRU5ET1JfSURfTUFTSyAgICAgICAgICAgIDB4MDAwMEZGRkZMCisjZGVmaW5lIFBTU19TVUJTWVNURU1fSURfTUFTSyAgICAgICAgICAgICAgICAgICAweEZGRkYwMDAwTAorI2RlZmluZSBQU1NfU1VCU1lTVEVNX1ZFTkRPUl9JRF9TSElGVCAgICAgICAgICAgMEwKKyNkZWZpbmUgUFNTX1NVQlNZU1RFTV9JRF9TSElGVCAgICAgICAgICAgICAgICAgIDE2TAorCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKy8vCisvLyBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIFBDSSBpbnRlcnJ1cHQgcmVnaXN0ZXIuCisvLworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisjZGVmaW5lIFBJX0xJTkVfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMEZGTAorI2RlZmluZSBQSV9QSU5fTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwRkYwMEwKKyNkZWZpbmUgUElfTUlOX0dSQU5UX01BU0sgICAgICAgICAgICAgICAgICAgICAgIDB4MDBGRjAwMDBMCisjZGVmaW5lIFBJX01BWF9MQVRFTkNZX01BU0sgICAgICAgICAgICAgICAgICAgICAweEZGMDAwMDAwTAorI2RlZmluZSBQSV9MSU5FX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgICAgMEwKKyNkZWZpbmUgUElfUElOX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgICAgIDhMCisjZGVmaW5lIFBJX01JTl9HUkFOVF9TSElGVCAgICAgICAgICAgICAgICAgICAgICAxNkwKKyNkZWZpbmUgUElfTUFYX0xBVEVOQ1lfU0hJRlQgICAgICAgICAgICAgICAgICAgIDI0TAorCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKy8vCisvLyBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIGhvc3QgaW50ZXJydXB0IHN0YXR1cworLy8gcmVnaXN0ZXIuCisvLworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisjZGVmaW5lIEhJU1JfSFZPTE1BU0sgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwM0wKKyNkZWZpbmUgSElTUl9WRE5JICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAxTAorI2RlZmluZSBISVNSX1ZVUEkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDJMCisjZGVmaW5lIEhJU1JfR1AxSSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNEwKKyNkZWZpbmUgSElTUl9HUDNJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA4TAorI2RlZmluZSBISVNSX0dQU0kgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMTBMCisjZGVmaW5lIEhJU1JfR1BQSSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAyMEwKKyNkZWZpbmUgSElTUl9ETUFJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDQwMDAwTAorI2RlZmluZSBISVNSX0ZJRk9JICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAxMDAwMDBMCisjZGVmaW5lIEhJU1JfSFZPTCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDIwMDAwMEwKKyNkZWZpbmUgSElTUl9NSURJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwNDAwMDAwTAorI2RlZmluZSBISVNSX1NCSU5UICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDA4MDAwMDBMCisjZGVmaW5lIEhJU1JfSU5URU5BICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg4MDAwMDAwMEwKKyNkZWZpbmUgSElTUl9ETUFfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwRjAwTAorI2RlZmluZSBISVNSX0ZJRk9fTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMEYwMDBMCisjZGVmaW5lIEhJU1JfRE1BX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgICAgOEwKKyNkZWZpbmUgSElTUl9GSUZPX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgICAxMkwKKyNkZWZpbmUgSElTUl9GSUZPMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAxMDAwTAorI2RlZmluZSBISVNSX0ZJRk8xICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDIwMDBMCisjZGVmaW5lIEhJU1JfRklGTzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwNDAwMEwKKyNkZWZpbmUgSElTUl9GSUZPMyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDA4MDAwTAorI2RlZmluZSBISVNSX0RNQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxMDBMCisjZGVmaW5lIEhJU1JfRE1BMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDIwMEwKKyNkZWZpbmUgSElTUl9ETUEyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNDAwTAorI2RlZmluZSBISVNSX0RNQTMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA4MDBMCisjZGVmaW5lIEhJU1JfUkVTRVJWRUQgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg0MDAwMDAwMEwKKworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisvLworLy8gVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBob3N0IGludGVycnVwdCBjb250cm9sCisvLyByZWdpc3Rlci4KKy8vCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyNkZWZpbmUgSElDUl9JRVYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAxTAorI2RlZmluZSBISUNSX0NIR00gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDJMCisKKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorLy8KKy8vIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgRE1BIE1vZGUgUmVnaXN0ZXIgbgorLy8gKERNUm4pCisvLworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisjZGVmaW5lIERNUm5fVFJfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwQ0wKKyNkZWZpbmUgRE1Sbl9UUl9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAyTAorI2RlZmluZSBETVJuX0FVVE8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMTBMCisjZGVmaW5lIERNUm5fVFJfUkVBRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwOEwKKyNkZWZpbmUgRE1Sbl9UUl9XUklURSAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA0TAorI2RlZmluZSBETVJuX1RZUEVfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwQzBMCisjZGVmaW5lIERNUm5fVFlQRV9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAgNkwKKyNkZWZpbmUgRE1Sbl9TSVpFOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDEwMDAwTAorI2RlZmluZSBETVJuX01PTk8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMjAwMDBMCisjZGVmaW5lIERNUm5fQkVORCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDA0MDAwMEwKKyNkZWZpbmUgRE1Sbl9VU0lHTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDgwMDAwTAorI2RlZmluZSBETVJuX1NJWkUyMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAxMDAwMDBMCisjZGVmaW5lIERNUm5fU1dBUEMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDQwMDAwMEwKKyNkZWZpbmUgRE1Sbl9DQkMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAxMDAwMDAwTAorI2RlZmluZSBETVJuX1RCQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDIwMDAwMDBMCisjZGVmaW5lIERNUm5fUE9MTCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxMDAwMDAwMEwKKyNkZWZpbmUgRE1Sbl9ETUEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDIwMDAwMDAwTAorI2RlZmluZSBETVJuX0ZTRUxfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4QzAwMDAwMDBMCisjZGVmaW5lIERNUm5fRlNFTF9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAgMzBMCisjZGVmaW5lIERNUm5fRlNFTDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMEwKKyNkZWZpbmUgRE1Sbl9GU0VMMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDQwMDAwMDAwTAorI2RlZmluZSBETVJuX0ZTRUwyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4ODAwMDAwMDBMCisjZGVmaW5lIERNUm5fRlNFTDMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhDMDAwMDAwMEwKKworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisvLworLy8gVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBETUEgQ29tbWFuZCBSZWdpc3RlciBuCisvLyAoRENSbikKKy8vCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyNkZWZpbmUgRENSbl9IVENJRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDIwMDAwTAorI2RlZmluZSBEQ1JuX1RDSUUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMTAwMDBMCisjZGVmaW5lIERDUm5fTVNLICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMUwKKworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisvLworLy8gVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBGSUZPIENvbnRyb2wgCisvLyByZWdpc3RlciBuLihGQ1JuKQorLy8KKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorI2RlZmluZSBGQ1JuX09GX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA3RkwKKyNkZWZpbmUgRkNSbl9PRl9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAgIDBMCisjZGVmaW5lIEZDUm5fU1pfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDA3RjAwTAorI2RlZmluZSBGQ1JuX1NaX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgICAgOEwKKyNkZWZpbmUgRkNSbl9MU19NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAxRjAwMDBMCisjZGVmaW5lIEZDUm5fTFNfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgICAxNkwKKyNkZWZpbmUgRkNSbl9SU19NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MUYwMDAwMDBMCisjZGVmaW5lIEZDUm5fUlNfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgICAyNEwKKyNkZWZpbmUgRkNSbl9GRU4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4ODAwMDAwMDBMCisjZGVmaW5lIEZDUm5fUFNIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDIwMDAwMDAwTAorI2RlZmluZSBGQ1JuX0RBQ1ogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg0MDAwMDAwMEwKKworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisvLworLy8gVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBzZXJpYWwgcG9ydCBQb3dlciBNYW5hZ2VtZW50CisvLyBjb250cm9sIHJlZ2lzdGVyLihTUE1DKQorLy8KKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorI2RlZmluZSBTUE1DX1JTVE4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMUwKKyNkZWZpbmUgU1BNQ19BU1lOICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDJMCisjZGVmaW5lIFNQTUNfV1VQMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA0TAorI2RlZmluZSBTUE1DX1dVUDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwOEwKKyNkZWZpbmUgU1BNQ19BU0RJMkUgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxMDBMCisjZGVmaW5lIFNQTUNfRVNTUEQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMjAwTAorI2RlZmluZSBTUE1DX0dJU1BFTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwNDAwMEwKKyNkZWZpbmUgU1BNQ19HSVBQRU4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDgwMDBMCisKKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorLy8KKy8vIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgQ29uZmlndXJhdGlvbiBMb2FkIHJlZ2lzdGVyLgorLy8gKENGTFIpCisvLworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisjZGVmaW5lIENGTFJfQ0xPQ0tfU09VUkNFX01BU0sgICAgICAgICAgICAgICAgICAweDAwMDAwMDAzTAorI2RlZmluZSBDRkxSX0NMT0NLX1NPVVJDRV9BQzk3ICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMUwKKworI2RlZmluZSBDRkxSX0NCMF9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwRkZMCisjZGVmaW5lIENGTFJfQ0IxX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwRkYwMEwKKyNkZWZpbmUgQ0ZMUl9DQjJfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwRkYwMDAwTAorI2RlZmluZSBDRkxSX0NCM19NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4RkYwMDAwMDBMCisjZGVmaW5lIENGTFJfQ0IwX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgICAgMEwKKyNkZWZpbmUgQ0ZMUl9DQjFfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgICA4TAorI2RlZmluZSBDRkxSX0NCMl9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAgIDE2TAorI2RlZmluZSBDRkxSX0NCM19TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAgIDI0TAorCisjZGVmaW5lIElPVENSX0RNQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAwTAorI2RlZmluZSBJT1RDUl9ETUExICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDQwMEwKKyNkZWZpbmUgSU9UQ1JfRE1BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA4MDBMCisjZGVmaW5lIElPVENSX0RNQTMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwQzAwTAorI2RlZmluZSBJT1RDUl9DQ0xTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDEwMEwKKyNkZWZpbmUgSU9UQ1JfUENQQ0kgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAyMDBMCisjZGVmaW5lIElPVENSX0RETUEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMzAwTAorCisjZGVmaW5lIFNCV0JTX1dCQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDgwTAorCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKy8vCisvLyBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIFNSQyBTbG90IEFzc2lnbm1lbnQgUmVnaXN0ZXIKKy8vIChTUkNTQSkKKy8vCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyNkZWZpbmUgU1JDU0FfUExTU19NQVNLICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMUZMCisjZGVmaW5lIFNSQ1NBX1BMU1NfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAwTAorI2RlZmluZSBTUkNTQV9QUlNTX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMUYwMEwKKyNkZWZpbmUgU1JDU0FfUFJTU19TSElGVCAgICAgICAgICAgICAgICAgICAgICAgIDhMCisjZGVmaW5lIFNSQ1NBX0NMU1NfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMUYwMDAwTAorI2RlZmluZSBTUkNTQV9DTFNTX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgMTZMCisjZGVmaW5lIFNSQ1NBX0NSU1NfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAweDFGMDAwMDAwTAorI2RlZmluZSBTUkNTQV9DUlNTX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgMjRMCisKKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorLy8KKy8vIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgU291bmQgU3lzdGVtIFBvd2VyIE1hbmFnZW1lbnQKKy8vIHJlZ2lzdGVyLihTU1BNKQorLy8KKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorI2RlZmluZSBTU1BNX0ZQRE4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA4MEwKKyNkZWZpbmUgU1NQTV9NSVhFTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwNDBMCisjZGVmaW5lIFNTUE1fQ1NSQ0VOICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDIwTAorI2RlZmluZSBTU1BNX1BTUkNFTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAxMEwKKyNkZWZpbmUgU1NQTV9KU0VOICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDhMCisjZGVmaW5lIFNTUE1fQUNMRU4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA0TAorI2RlZmluZSBTU1BNX0ZNRU4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMkwKKworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisvLworLy8gVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBTb3VuZCBTeXN0ZW0gQ29udHJvbAorLy8gUmVnaXN0ZXIuIChTU0NSKQorLy8KKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorI2RlZmluZSBTU0NSX1NCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNEwKKyNkZWZpbmUgU1NDUl9IVkMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDhMCisjZGVmaW5lIFNTQ1JfTFBGSUZPICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDQwTAorI2RlZmluZSBTU0NSX0xQU1JDICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA4MEwKKyNkZWZpbmUgU1NDUl9YTFBTUkMgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxMDBMCisjZGVmaW5lIFNTQ1JfTVZNRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDEwMDAwTAorI2RlZmluZSBTU0NSX01WQUQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAyMDAwMEwKKyNkZWZpbmUgU1NDUl9NVkxEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwNDAwMDBMCisjZGVmaW5lIFNTQ1JfTVZDUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDgwMDAwTAorCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKy8vCisvLyBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIENsb2NrIENvbnRyb2wgUmVnaXN0ZXIgMS4gCisvLyAoQ0xLQ1IxKQorLy8KKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorI2RlZmluZSBDTEtDUjFfRExMU1NfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwQ0wKKyNkZWZpbmUgQ0xLQ1IxX0RMTFNTX1NISUZUICAgICAgICAgICAgICAgICAgICAgIDJMCisjZGVmaW5lIENMS0NSMV9ETExQICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDEwTAorI2RlZmluZSBDTEtDUjFfU1dDRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAyMEwKKyNkZWZpbmUgQ0xLQ1IxX0RMTE9TICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwNDBMCisjZGVmaW5lIENMS0NSMV9DS1JBICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDEwMDAwTAorI2RlZmluZSBDTEtDUjFfQ0tSTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAyMDAwMEwKKyNkZWZpbmUgQ0xLQ1IxX0RMTFJEWSAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDEwMDAwMDBMCisjZGVmaW5lIENMS0NSMV9DTEtPTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAyMDAwMDAwTAorCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKy8vCisvLyBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIFNvdW5kIEJsYXN0ZXIgUmVhZCBCdWZmZXIKKy8vIFN0YXR1cy4oU0JSQlMpCisvLworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisjZGVmaW5lIFNCUkJTX1JEX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDdGTAorI2RlZmluZSBTQlJCU19SRF9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAgMEwKKyNkZWZpbmUgU0JSQlNfUkJGICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwODBMCisKKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorLy8KKy8vIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgc2VyaWFsIHBvcnQgbWFzdGVyIGNvbnRyb2wKKy8vIHJlZ2lzdGVyLihTRVJNQykKKy8vCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyNkZWZpbmUgU0VSTUNfTVNQRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDFMCisjZGVmaW5lIFNFUk1DX1BUQ19NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDBFTAorI2RlZmluZSBTRVJNQ19QVENfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgMUwKKyNkZWZpbmUgU0VSTUNfUFRDX0FDOTcgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDJMCisjZGVmaW5lIFNFUk1DX1BMQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDEwTAorI2RlZmluZSBTRVJNQ19QWExCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAyMEwKKyNkZWZpbmUgU0VSTUNfTE9GViAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwODAwMDBMCisjZGVmaW5lIFNFUk1DX1NMQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMTAwMDAwTAorI2RlZmluZSBTRVJNQ19TWExCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDIwMDAwMEwKKyNkZWZpbmUgU0VSTUNfT0RTRU4xICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDEwMDAwMDBMCisjZGVmaW5lIFNFUk1DX09EU0VOMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAyMDAwMDAwTAorCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKy8vCisvLyBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIEdlbmVyYWwgUHVycG9zZSBJL08gUmVnaXN0ZXIuIAorLy8gKEdQSU9SKQorLy8KKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorI2RlZmluZSBHUElPUl9WRE5TICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMUwKKyNkZWZpbmUgR1BJT1JfVlVQUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDJMCisjZGVmaW5lIEdQSU9SX0dQMVMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA0TAorI2RlZmluZSBHUElPUl9HUDNTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwOEwKKyNkZWZpbmUgR1BJT1JfR1BTUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMTBMCisjZGVmaW5lIEdQSU9SX0dQUFMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDIwTAorI2RlZmluZSBHUElPUl9HUDFEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDQwMEwKKyNkZWZpbmUgR1BJT1JfR1AzRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA4MDBMCisjZGVmaW5lIEdQSU9SX1ZETkxUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDEwMDAwTAorI2RlZmluZSBHUElPUl9WRE5QTyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAyMDAwMEwKKyNkZWZpbmUgR1BJT1JfVkROU1QgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwNDAwMDBMCisjZGVmaW5lIEdQSU9SX1ZETlcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDgwMDAwTAorI2RlZmluZSBHUElPUl9WVVBMVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDEwMDAwMEwKKyNkZWZpbmUgR1BJT1JfVlVQUE8gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAyMDAwMDBMCisjZGVmaW5lIEdQSU9SX1ZVUFNUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwNDAwMDAwTAorI2RlZmluZSBHUElPUl9WVVBXICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDgwMDAwMEwKKyNkZWZpbmUgR1BJT1JfR1AxT0UgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDEwMDAwMDBMCisjZGVmaW5lIEdQSU9SX0dQMVBUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAyMDAwMDAwTAorI2RlZmluZSBHUElPUl9HUDFTVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwNDAwMDAwMEwKKyNkZWZpbmUgR1BJT1JfR1AxVyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDgwMDAwMDBMCisjZGVmaW5lIEdQSU9SX0dQM09FICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDEwMDAwMDAwTAorI2RlZmluZSBHUElPUl9HUDNQVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgyMDAwMDAwMEwKKyNkZWZpbmUgR1BJT1JfR1AzU1QgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4NDAwMDAwMDBMCisjZGVmaW5lIEdQSU9SX0dQM1cgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDgwMDAwMDAwTAorCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKy8vCisvLyBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIGNsb2NrIGNvbnRyb2wgcmVnaXN0ZXIgMS4KKy8vCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyNkZWZpbmUgQ0xLQ1IxX1BMTFNTX01BU0sgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMENMCisjZGVmaW5lIENMS0NSMV9QTExTU19TRVJJQUwgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAwTAorI2RlZmluZSBDTEtDUjFfUExMU1NfQ1JZU1RBTCAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNEwKKyNkZWZpbmUgQ0xLQ1IxX1BMTFNTX1BDSSAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDhMCisjZGVmaW5lIENMS0NSMV9QTExTU19SRVNFUlZFRCAgICAgICAgICAgICAgICAgICAweDAwMDAwMDBDTAorI2RlZmluZSBDTEtDUjFfUExMUCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAxMEwKKyNkZWZpbmUgQ0xLQ1IxX1NXQ0UgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMjBMCisjZGVmaW5lIENMS0NSMV9QTExPUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDQwTAorCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKy8vCisvLyBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIGZlYXR1cmUgcmVwb3J0aW5nIHJlZ2lzdGVyLgorLy8KKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorI2RlZmluZSBGUlJfRkFCX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwM0wKKyNkZWZpbmUgRlJSX01BU0tfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMUNMCisjZGVmaW5lIEZSUl9JRF9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAzMDAwTAorI2RlZmluZSBGUlJfRkFCX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgICAgMEwKKyNkZWZpbmUgRlJSX01BU0tfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgIDJMCisjZGVmaW5lIEZSUl9JRF9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMkwKKworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisvLworLy8gVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBzZXJpYWwgcG9ydCAxIGNvbmZpZ3VyYXRpb24KKy8vIHJlZ2lzdGVyLgorLy8KKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorI2RlZmluZSBTRVJDMV9WQUxVRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwM0wKKyNkZWZpbmUgU0VSQzFfU08xRU4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDFMCisjZGVmaW5lIFNFUkMxX1NPMUZfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDBFTAorI2RlZmluZSBTRVJDMV9TTzFGX0NTNDIzWCAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMEwKKyNkZWZpbmUgU0VSQzFfU08xRl9BQzk3ICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDJMCisjZGVmaW5lIFNFUkMxX1NPMUZfREFDICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA0TAorI2RlZmluZSBTRVJDMV9TTzFGX1NQRElGICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNkwKKworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisvLworLy8gVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBzZXJpYWwgcG9ydCAyIGNvbmZpZ3VyYXRpb24KKy8vIHJlZ2lzdGVyLgorLy8KKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorI2RlZmluZSBTRVJDMl9WQUxVRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwM0wKKyNkZWZpbmUgU0VSQzJfU0kxRU4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDFMCisjZGVmaW5lIFNFUkMyX1NJMUZfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDBFTAorI2RlZmluZSBTRVJDMl9TSTFGX0NTNDIzWCAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMEwKKyNkZWZpbmUgU0VSQzJfU0kxRl9BQzk3ICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDJMCisjZGVmaW5lIFNFUkMyX1NJMUZfQURDICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA0TAorI2RlZmluZSBTRVJDMl9TSTFGX1NQRElGICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNkwKKworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisvLworLy8gVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBBQzk3IGNvbnRyb2wgcmVnaXN0ZXIuCisvLworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisjZGVmaW5lIEFDQ1RMX0VTWU4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAyTAorI2RlZmluZSBBQ0NUTF9WRlJNICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNEwKKyNkZWZpbmUgQUNDVExfRENWICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDhMCisjZGVmaW5lIEFDQ1RMX0NSVyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDEwTAorI2RlZmluZSBBQ0NUTF9UQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA0MEwKKworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisvLworLy8gVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBBQzk3IHN0YXR1cyByZWdpc3Rlci4KKy8vCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyNkZWZpbmUgQUNTVFNfQ1JEWSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDFMCisjZGVmaW5lIEFDU1RTX1ZTVFMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAyTAorCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKy8vCisvLyBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIEFDOTcgb3V0cHV0IHNsb3QgdmFsaWQKKy8vIHJlZ2lzdGVyLgorLy8KKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorI2RlZmluZSBBQ09TVl9TTFYzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMUwKKyNkZWZpbmUgQUNPU1ZfU0xWNCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDJMCisjZGVmaW5lIEFDT1NWX1NMVjUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA0TAorI2RlZmluZSBBQ09TVl9TTFY2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwOEwKKyNkZWZpbmUgQUNPU1ZfU0xWNyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMTBMCisjZGVmaW5lIEFDT1NWX1NMVjggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDIwTAorI2RlZmluZSBBQ09TVl9TTFY5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA0MEwKKyNkZWZpbmUgQUNPU1ZfU0xWMTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwODBMCisjZGVmaW5lIEFDT1NWX1NMVjExICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMTAwTAorI2RlZmluZSBBQ09TVl9TTFYxMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDIwMEwKKworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisvLworLy8gVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBBQzk3IGNvbW1hbmQgYWRkcmVzcworLy8gcmVnaXN0ZXIuCisvLworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisjZGVmaW5lIEFDQ0FEX0NJX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDdGTAorI2RlZmluZSBBQ0NBRF9DSV9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAgMEwKKworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisvLworLy8gVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBBQzk3IGNvbW1hbmQgZGF0YSByZWdpc3Rlci4KKy8vCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyNkZWZpbmUgQUNDREFfQ0RfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMEZGRkZMCisjZGVmaW5lIEFDQ0RBX0NEX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgICAwTAorCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKy8vCisvLyBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIEFDOTcgaW5wdXQgc2xvdCB2YWxpZAorLy8gcmVnaXN0ZXIuCisvLworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisjZGVmaW5lIEFDSVNWX0lTVjMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAxTAorI2RlZmluZSBBQ0lTVl9JU1Y0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMkwKKyNkZWZpbmUgQUNJU1ZfSVNWNSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDRMCisjZGVmaW5lIEFDSVNWX0lTVjYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA4TAorI2RlZmluZSBBQ0lTVl9JU1Y3ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAxMEwKKyNkZWZpbmUgQUNJU1ZfSVNWOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMjBMCisjZGVmaW5lIEFDSVNWX0lTVjkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDQwTAorI2RlZmluZSBBQ0lTVl9JU1YxMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA4MEwKKyNkZWZpbmUgQUNJU1ZfSVNWMTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxMDBMCisjZGVmaW5lIEFDSVNWX0lTVjEyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMjAwTAorCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKy8vCisvLyBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIEFDOTcgc3RhdHVzIGFkZHJlc3MKKy8vIHJlZ2lzdGVyLgorLy8KKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorI2RlZmluZSBBQ1NBRF9TSV9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA3RkwKKyNkZWZpbmUgQUNTQURfU0lfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgIDBMCisKKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorLy8KKy8vIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgQUM5NyBzdGF0dXMgZGF0YSByZWdpc3Rlci4KKy8vCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyNkZWZpbmUgQUNTREFfU0RfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMEZGRkZMCisjZGVmaW5lIEFDU0RBX1NEX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgICAwTAorCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKy8vCisvLyBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIEkvTyB0cmFwIGFkZHJlc3MgYW5kIGNvbnRyb2wKKy8vIHJlZ2lzdGVycyAoYWxsIDEyKS4KKy8vCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyNkZWZpbmUgSU9UQUNfU0FfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMEZGRkZMCisjZGVmaW5lIElPVEFDX01TS19NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMEYwMDAwTAorI2RlZmluZSBJT1RBQ19JT0RDX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgMHgwNjAwMDAwMEwKKyNkZWZpbmUgSU9UQUNfSU9EQ18xNl9CSVQgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDBMCisjZGVmaW5lIElPVEFDX0lPRENfMTBfQklUICAgICAgICAgICAgICAgICAgICAgICAweDAyMDAwMDAwTAorI2RlZmluZSBJT1RBQ19JT0RDXzEyX0JJVCAgICAgICAgICAgICAgICAgICAgICAgMHgwNDAwMDAwMEwKKyNkZWZpbmUgSU9UQUNfV1NQSSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDgwMDAwMDBMCisjZGVmaW5lIElPVEFDX1JTUEkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDEwMDAwMDAwTAorI2RlZmluZSBJT1RBQ19XU0UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgyMDAwMDAwMEwKKyNkZWZpbmUgSU9UQUNfV0UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4NDAwMDAwMDBMCisjZGVmaW5lIElPVEFDX1JFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDgwMDAwMDAwTAorI2RlZmluZSBJT1RBQ19TQV9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAgMEwKKyNkZWZpbmUgSU9UQUNfTVNLX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgIDE2TAorCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKy8vCisvLyBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIFBDL1BDSSBtYXN0ZXIgZW5hYmxlCisvLyByZWdpc3Rlci4KKy8vCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyNkZWZpbmUgUENQQ0lFTl9FTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDFMCisKKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorLy8KKy8vIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgam95c3RpY2sgcG9sbC90cmlnZ2VyCisvLyByZWdpc3Rlci4KKy8vCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyNkZWZpbmUgSlNQVF9DQVggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDFMCisjZGVmaW5lIEpTUFRfQ0FZICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAyTAorI2RlZmluZSBKU1BUX0NCWCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNEwKKyNkZWZpbmUgSlNQVF9DQlkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDhMCisjZGVmaW5lIEpTUFRfQkExICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDEwTAorI2RlZmluZSBKU1BUX0JBMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAyMEwKKyNkZWZpbmUgSlNQVF9CQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwNDBMCisjZGVmaW5lIEpTUFRfQkIyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDgwTAorCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKy8vCisvLyBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIGpveXN0aWNrIGNvbnRyb2wgcmVnaXN0ZXIuCisvLyBUaGUgVEJGIGJpdCBoYXMgYmVlbiBtb3ZlZCBmcm9tIE1JRFNSIHJlZ2lzdGVyIHRvIEpTQ1RMIHJlZ2lzdGVyIGJpdCA4LgorLy8KKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorI2RlZmluZSBKU0NUTF9TUF9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwM0wKKyNkZWZpbmUgSlNDVExfU1BfU0xPVyAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDBMCisjZGVmaW5lIEpTQ1RMX1NQX01FRElVTV9TTE9XICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAxTAorI2RlZmluZSBKU0NUTF9TUF9NRURJVU1fRkFTVCAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMkwKKyNkZWZpbmUgSlNDVExfU1BfRkFTVCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDNMCisjZGVmaW5lIEpTQ1RMX0FSRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA0TAorI2RlZmluZSBKU0NUTF9UQkYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDEwMEwKKworCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKy8vCisvLyBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIE1JREkgY29udHJvbCByZWdpc3Rlci4KKy8vCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyNkZWZpbmUgTUlEQ1JfVFhFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDFMCisjZGVmaW5lIE1JRENSX1JYRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAyTAorI2RlZmluZSBNSURDUl9SSUUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNEwKKyNkZWZpbmUgTUlEQ1JfVElFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDhMCisjZGVmaW5lIE1JRENSX01MQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDEwTAorI2RlZmluZSBNSURDUl9NUlNUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAyMEwKKworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisvLworLy8gVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBNSURJIHN0YXR1cyByZWdpc3Rlci4KKy8vCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyNkZWZpbmUgTUlEU1JfUkJFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwODBMCisjZGVmaW5lIE1JRFNSX1JEQSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDA4MDAwTAorCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKy8vCisvLyBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIE1JREkgd3JpdGUgcG9ydCByZWdpc3Rlci4KKy8vCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyNkZWZpbmUgTUlEV1BfTVdEX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwRkZMCisjZGVmaW5lIE1JRFdQX01XRF9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAwTAorCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKy8vCisvLyBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIE1JREkgcmVhZCBwb3J0IHJlZ2lzdGVyLgorLy8KKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorI2RlZmluZSBNSURSUF9NUkRfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDBGRkwKKyNkZWZpbmUgTUlEUlBfTVJEX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgIDBMCisKKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorLy8KKy8vIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgY29uZmlndXJhdGlvbiBpbnRlcmZhY2UKKy8vIHJlZ2lzdGVyLgorLy8KKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorI2RlZmluZSBDRkdJX0NMSyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMUwKKyNkZWZpbmUgQ0ZHSV9ET1VUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDJMCisjZGVmaW5lIENGR0lfRElOX0VFTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA0TAorI2RlZmluZSBDRkdJX0VFTEQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwOEwKKworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisvLworLy8gVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBzdWJzeXN0ZW0gSUQgYW5kIHZlbmRvciBJRAorLy8gcmVnaXN0ZXIuCisvLworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisjZGVmaW5lIFNTVklEX1ZJRF9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDBGRkZGTAorI2RlZmluZSBTU1ZJRF9TSURfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgMHhGRkZGMDAwMEwKKyNkZWZpbmUgU1NWSURfVklEX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgIDBMCisjZGVmaW5lIFNTVklEX1NJRF9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAxNkwKKworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisvLworLy8gVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBHUElPIHBpbiBpbnRlcmZhY2UgcmVnaXN0ZXIuCisvLworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisjZGVmaW5lIEdQSU9SX1ZPTEROICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAxTAorI2RlZmluZSBHUElPUl9WT0xVUCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMkwKKyNkZWZpbmUgR1BJT1JfU0kyRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDRMCisjZGVmaW5lIEdQSU9SX1NJMk9FICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA4TAorCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKy8vCisvLyBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIEFDOTcgc3RhdHVzIHJlZ2lzdGVyIDIuCisvLworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisjZGVmaW5lIEFDU1RTMl9DUkRZICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAxTAorI2RlZmluZSBBQ1NUUzJfVlNUUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMkwKKworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisvLworLy8gVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBBQzk3IGlucHV0IHNsb3QgdmFsaWQKKy8vIHJlZ2lzdGVyIDIuCisvLworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisjZGVmaW5lIEFDSVNWMl9JU1YzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAxTAorI2RlZmluZSBBQ0lTVjJfSVNWNCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMkwKKyNkZWZpbmUgQUNJU1YyX0lTVjUgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDRMCisjZGVmaW5lIEFDSVNWMl9JU1Y2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA4TAorI2RlZmluZSBBQ0lTVjJfSVNWNyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAxMEwKKyNkZWZpbmUgQUNJU1YyX0lTVjggICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMjBMCisjZGVmaW5lIEFDSVNWMl9JU1Y5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDQwTAorI2RlZmluZSBBQ0lTVjJfSVNWMTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA4MEwKKyNkZWZpbmUgQUNJU1YyX0lTVjExICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxMDBMCisjZGVmaW5lIEFDSVNWMl9JU1YxMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMjAwTAorCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKy8vCisvLyBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIEFDOTcgc3RhdHVzIGFkZHJlc3MKKy8vIHJlZ2lzdGVyIDIuCisvLworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisjZGVmaW5lIEFDU0FEMl9TSV9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDdGTAorI2RlZmluZSBBQ1NBRDJfU0lfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgMEwKKworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisvLworLy8gVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBBQzk3IHN0YXR1cyBkYXRhIHJlZ2lzdGVyIDIuCisvLworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisjZGVmaW5lIEFDU0RBMl9TRF9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDBGRkZGTAorI2RlZmluZSBBQ1NEQTJfU0RfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgMEwKKworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisvLworLy8gVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBJL08gdHJhcCBjb250cm9sIHJlZ2lzdGVyLgorLy8KKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorI2RlZmluZSBJT1RDUl9JVEQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMUwKKyNkZWZpbmUgSU9UQ1JfSFJWICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDJMCisjZGVmaW5lIElPVENSX1NSViAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA0TAorI2RlZmluZSBJT1RDUl9EVEkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwOEwKKyNkZWZpbmUgSU9UQ1JfREZJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMTBMCisjZGVmaW5lIElPVENSX0REUCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDIwTAorI2RlZmluZSBJT1RDUl9KVEUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA0MEwKKyNkZWZpbmUgSU9UQ1JfUFBFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwODBMCisKKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorLy8KKy8vIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgSS9PIHRyYXAgYWRkcmVzcyBhbmQgY29udHJvbAorLy8gcmVnaXN0ZXJzIGZvciBIYXJkd2FyZSBNYXN0ZXIgVm9sdW1lLiAgCisvLworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisjZGVmaW5lIElPVEdQX1NBX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDBGRkZGTAorI2RlZmluZSBJT1RHUF9NU0tfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDBGMDAwMEwKKyNkZWZpbmUgSU9UR1BfSU9EQ19NQVNLICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDYwMDAwMDBMCisjZGVmaW5lIElPVEdQX0lPRENfMTZfQklUICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAwTAorI2RlZmluZSBJT1RHUF9JT0RDXzEwX0JJVCAgICAgICAgICAgICAgICAgICAgICAgMHgwMjAwMDAwMEwKKyNkZWZpbmUgSU9UR1BfSU9EQ18xMl9CSVQgICAgICAgICAgICAgICAgICAgICAgIDB4MDQwMDAwMDBMCisjZGVmaW5lIElPVEdQX1dTUEkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDA4MDAwMDAwTAorI2RlZmluZSBJT1RHUF9SU1BJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxMDAwMDAwMEwKKyNkZWZpbmUgSU9UR1BfV1NFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAwMDAwMDBMCisjZGVmaW5lIElPVEdQX1dFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDQwMDAwMDAwTAorI2RlZmluZSBJT1RHUF9SRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg4MDAwMDAwMEwKKyNkZWZpbmUgSU9UR1BfU0FfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgIDBMCisjZGVmaW5lIElPVEdQX01TS19TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAxNkwKKworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisvLworLy8gVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBJL08gdHJhcCBhZGRyZXNzIGFuZCBjb250cm9sCisvLyByZWdpc3RlcnMgZm9yIFNvdW5kIEJsYXN0ZXIKKy8vCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyNkZWZpbmUgSU9UU0JfU0FfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMEZGRkZMCisjZGVmaW5lIElPVFNCX01TS19NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMEYwMDAwTAorI2RlZmluZSBJT1RTQl9JT0RDX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgMHgwNjAwMDAwMEwKKyNkZWZpbmUgSU9UU0JfSU9EQ18xNl9CSVQgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDBMCisjZGVmaW5lIElPVFNCX0lPRENfMTBfQklUICAgICAgICAgICAgICAgICAgICAgICAweDAyMDAwMDAwTAorI2RlZmluZSBJT1RTQl9JT0RDXzEyX0JJVCAgICAgICAgICAgICAgICAgICAgICAgMHgwNDAwMDAwMEwKKyNkZWZpbmUgSU9UU0JfV1NQSSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDgwMDAwMDBMCisjZGVmaW5lIElPVFNCX1JTUEkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDEwMDAwMDAwTAorI2RlZmluZSBJT1RTQl9XU0UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgyMDAwMDAwMEwKKyNkZWZpbmUgSU9UU0JfV0UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4NDAwMDAwMDBMCisjZGVmaW5lIElPVFNCX1JFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDgwMDAwMDAwTAorI2RlZmluZSBJT1RTQl9TQV9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAgMEwKKyNkZWZpbmUgSU9UU0JfTVNLX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgIDE2TAorCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKy8vCisvLyBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIEkvTyB0cmFwIGFkZHJlc3MgYW5kIGNvbnRyb2wKKy8vIHJlZ2lzdGVycyBmb3IgRk0uCisvLworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisjZGVmaW5lIElPVEZNX1NBX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDBGRkZGTAorI2RlZmluZSBJT1RGTV9NU0tfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDBGMDAwMEwKKyNkZWZpbmUgSU9URk1fSU9EQ19NQVNLICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDYwMDAwMDBMCisjZGVmaW5lIElPVEZNX0lPRENfMTZfQklUICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAwTAorI2RlZmluZSBJT1RGTV9JT0RDXzEwX0JJVCAgICAgICAgICAgICAgICAgICAgICAgMHgwMjAwMDAwMEwKKyNkZWZpbmUgSU9URk1fSU9EQ18xMl9CSVQgICAgICAgICAgICAgICAgICAgICAgIDB4MDQwMDAwMDBMCisjZGVmaW5lIElPVEZNX1dTUEkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDA4MDAwMDAwTAorI2RlZmluZSBJT1RGTV9SU1BJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxMDAwMDAwMEwKKyNkZWZpbmUgSU9URk1fV1NFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAwMDAwMDBMCisjZGVmaW5lIElPVEZNX1dFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDQwMDAwMDAwTAorI2RlZmluZSBJT1RGTV9SRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg4MDAwMDAwMEwKKyNkZWZpbmUgSU9URk1fU0FfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgIDBMCisjZGVmaW5lIElPVEZNX01TS19TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAxNkwKKworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisvLworLy8gVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBQQy9QQ0kgcmVxdWVzdCByZWdpc3Rlci4KKy8vCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyNkZWZpbmUgUENQUlJfUkRDX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwN0wKKyNkZWZpbmUgUENQUlJfUkVRICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwODAwMEwKKyNkZWZpbmUgUENQUlJfUkRDX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgMEwKKworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisvLworLy8gVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBQQy9QQ0kgZ3JhbnQgcmVnaXN0ZXIuCisvLworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisjZGVmaW5lIFBDUEdSX0dEQ19NQVNLICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDdMCisjZGVmaW5lIFBDUEdSX1ZMICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDgwMDBMCisjZGVmaW5lIFBDUEdSX0dEQ19TSElGVCAgICAgICAgICAgICAgICAgICAgICAgIDBMCisKKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorLy8KKy8vIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgUEMvUENJIENvbnRyb2wgUmVnaXN0ZXIuCisvLworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisjZGVmaW5lIFBDUENSX0VOICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDFMCisKKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorLy8KKy8vIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgZGVidWcgaW5kZXggcmVnaXN0ZXIuCisvLworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisjZGVmaW5lIERSRUdfUkVHSURfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDdGTAorI2RlZmluZSBEUkVHX0RFQlVHICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA4MEwKKyNkZWZpbmUgRFJFR19SR0JLX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA3MDBMCisjZGVmaW5lIERSRUdfVFJBUCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwODAwTAorI2lmICFkZWZpbmVkKE5PX0NTNDYxMikKKyNpZiAhZGVmaW5lZChOT19DUzQ2MTUpCisjZGVmaW5lIERSRUdfVFJBUFggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAxMDAwTAorI2VuZGlmCisjZW5kaWYKKyNkZWZpbmUgRFJFR19SRUdJRF9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgIDBMCisjZGVmaW5lIERSRUdfUkdCS19TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICA4TAorI2RlZmluZSBEUkVHX1JHQktfUkVHSURfTUFTSyAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDc3RkwKKyNkZWZpbmUgRFJFR19SRUdJRF9SMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMTBMCisjZGVmaW5lIERSRUdfUkVHSURfUjEgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDExTAorI2RlZmluZSBEUkVHX1JFR0lEX1IyICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAxMkwKKyNkZWZpbmUgRFJFR19SRUdJRF9SMyAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMTNMCisjZGVmaW5lIERSRUdfUkVHSURfUjQgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDE0TAorI2RlZmluZSBEUkVHX1JFR0lEX1I1ICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAxNUwKKyNkZWZpbmUgRFJFR19SRUdJRF9SNiAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMTZMCisjZGVmaW5lIERSRUdfUkVHSURfUjcgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDE3TAorI2RlZmluZSBEUkVHX1JFR0lEX1I4ICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAxOEwKKyNkZWZpbmUgRFJFR19SRUdJRF9SOSAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMTlMCisjZGVmaW5lIERSRUdfUkVHSURfUkEgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDFBTAorI2RlZmluZSBEUkVHX1JFR0lEX1JCICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAxQkwKKyNkZWZpbmUgRFJFR19SRUdJRF9SQyAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMUNMCisjZGVmaW5lIERSRUdfUkVHSURfUkQgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDFETAorI2RlZmluZSBEUkVHX1JFR0lEX1JFICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAxRUwKKyNkZWZpbmUgRFJFR19SRUdJRF9SRiAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMUZMCisjZGVmaW5lIERSRUdfUkVHSURfUkFfQlVTX0xPVyAgICAgICAgICAgICAgICAgICAweDAwMDAwMDIwTAorI2RlZmluZSBEUkVHX1JFR0lEX1JBX0JVU19ISUdIICAgICAgICAgICAgICAgICAgMHgwMDAwMDAzOEwKKyNkZWZpbmUgRFJFR19SRUdJRF9ZQlVTX0xPVyAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwNTBMCisjZGVmaW5lIERSRUdfUkVHSURfWUJVU19ISUdIICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDU4TAorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfMCAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDEwMEwKKyNkZWZpbmUgRFJFR19SRUdJRF9UUkFQXzEgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxMDFMCisjZGVmaW5lIERSRUdfUkVHSURfVFJBUF8yICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMTAyTAorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfMyAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDEwM0wKKyNkZWZpbmUgRFJFR19SRUdJRF9UUkFQXzQgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxMDRMCisjZGVmaW5lIERSRUdfUkVHSURfVFJBUF81ICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMTA1TAorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfNiAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDEwNkwKKyNkZWZpbmUgRFJFR19SRUdJRF9UUkFQXzcgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxMDdMCisjZGVmaW5lIERSRUdfUkVHSURfSU5ESVJFQ1RfQUREUkVTUyAgICAgICAgICAgICAweDAwMDAwMTBFTAorI2RlZmluZSBEUkVHX1JFR0lEX1RPUF9PRl9TVEFDSyAgICAgICAgICAgICAgICAgMHgwMDAwMDEwRkwKKyNpZiAhZGVmaW5lZChOT19DUzQ2MTIpCisjaWYgIWRlZmluZWQoTk9fQ1M0NjE1KQorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfOCAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDExMEwKKyNkZWZpbmUgRFJFR19SRUdJRF9UUkFQXzkgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxMTFMCisjZGVmaW5lIERSRUdfUkVHSURfVFJBUF8xMCAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMTEyTAorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfMTEgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDExM0wKKyNkZWZpbmUgRFJFR19SRUdJRF9UUkFQXzEyICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxMTRMCisjZGVmaW5lIERSRUdfUkVHSURfVFJBUF8xMyAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMTE1TAorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfMTQgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDExNkwKKyNkZWZpbmUgRFJFR19SRUdJRF9UUkFQXzE1ICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxMTdMCisjZGVmaW5lIERSRUdfUkVHSURfVFJBUF8xNiAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMTE4TAorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfMTcgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDExOUwKKyNkZWZpbmUgRFJFR19SRUdJRF9UUkFQXzE4ICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxMUFMCisjZGVmaW5lIERSRUdfUkVHSURfVFJBUF8xOSAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMTFCTAorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfMjAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDExQ0wKKyNkZWZpbmUgRFJFR19SRUdJRF9UUkFQXzIxICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxMURMCisjZGVmaW5lIERSRUdfUkVHSURfVFJBUF8yMiAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMTFFTAorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfMjMgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDExRkwKKyNlbmRpZgorI2VuZGlmCisjZGVmaW5lIERSRUdfUkVHSURfUlNBMF9MT1cgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMjAwTAorI2RlZmluZSBEUkVHX1JFR0lEX1JTQTBfSElHSCAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDIwMUwKKyNkZWZpbmUgRFJFR19SRUdJRF9SU0ExX0xPVyAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAyMDJMCisjZGVmaW5lIERSRUdfUkVHSURfUlNBMV9ISUdIICAgICAgICAgICAgICAgICAgICAweDAwMDAwMjAzTAorI2RlZmluZSBEUkVHX1JFR0lEX1JTQTIgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDIwNEwKKyNkZWZpbmUgRFJFR19SRUdJRF9SU0EzICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAyMDVMCisjZGVmaW5lIERSRUdfUkVHSURfUlNJMF9MT1cgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMjA2TAorI2RlZmluZSBEUkVHX1JFR0lEX1JTSTBfSElHSCAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDIwN0wKKyNkZWZpbmUgRFJFR19SRUdJRF9SU0kxICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAyMDhMCisjZGVmaW5lIERSRUdfUkVHSURfUlNJMiAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMjA5TAorI2RlZmluZSBEUkVHX1JFR0lEX1NBR1VTVEFUVVMgICAgICAgICAgICAgICAgICAgMHgwMDAwMDIwQUwKKyNkZWZpbmUgRFJFR19SRUdJRF9SU0NPTkZJRzAxX0xPVyAgICAgICAgICAgICAgIDB4MDAwMDAyMEJMCisjZGVmaW5lIERSRUdfUkVHSURfUlNDT05GSUcwMV9ISUdIICAgICAgICAgICAgICAweDAwMDAwMjBDTAorI2RlZmluZSBEUkVHX1JFR0lEX1JTQ09ORklHMjNfTE9XICAgICAgICAgICAgICAgMHgwMDAwMDIwREwKKyNkZWZpbmUgRFJFR19SRUdJRF9SU0NPTkZJRzIzX0hJR0ggICAgICAgICAgICAgIDB4MDAwMDAyMEVMCisjZGVmaW5lIERSRUdfUkVHSURfUlNETUEwMUUgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMjBGTAorI2RlZmluZSBEUkVHX1JFR0lEX1JTRE1BMjNFICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDIxMEwKKyNkZWZpbmUgRFJFR19SRUdJRF9SU0QwX0xPVyAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAyMTFMCisjZGVmaW5lIERSRUdfUkVHSURfUlNEMF9ISUdIICAgICAgICAgICAgICAgICAgICAweDAwMDAwMjEyTAorI2RlZmluZSBEUkVHX1JFR0lEX1JTRDFfTE9XICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDIxM0wKKyNkZWZpbmUgRFJFR19SRUdJRF9SU0QxX0hJR0ggICAgICAgICAgICAgICAgICAgIDB4MDAwMDAyMTRMCisjZGVmaW5lIERSRUdfUkVHSURfUlNEMl9MT1cgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMjE1TAorI2RlZmluZSBEUkVHX1JFR0lEX1JTRDJfSElHSCAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDIxNkwKKyNkZWZpbmUgRFJFR19SRUdJRF9SU0QzX0xPVyAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAyMTdMCisjZGVmaW5lIERSRUdfUkVHSURfUlNEM19ISUdIICAgICAgICAgICAgICAgICAgICAweDAwMDAwMjE4TAorI2RlZmluZSBEUkVHX1JFR0lEX1NSQVJfSElHSCAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDIxQUwKKyNkZWZpbmUgRFJFR19SRUdJRF9TUkFSX0xPVyAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAyMUJMCisjZGVmaW5lIERSRUdfUkVHSURfRE1BX1NUQVRFICAgICAgICAgICAgICAgICAgICAweDAwMDAwMjFDTAorI2RlZmluZSBEUkVHX1JFR0lEX0NVUlJFTlRfRE1BX1NUUkVBTSAgICAgICAgICAgMHgwMDAwMDIxREwKKyNkZWZpbmUgRFJFR19SRUdJRF9ORVhUX0RNQV9TVFJFQU0gICAgICAgICAgICAgIDB4MDAwMDAyMUVMCisjZGVmaW5lIERSRUdfUkVHSURfQ1BVX1NUQVRVUyAgICAgICAgICAgICAgICAgICAweDAwMDAwMzAwTAorI2RlZmluZSBEUkVHX1JFR0lEX01BQ19NT0RFICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDMwMUwKKyNkZWZpbmUgRFJFR19SRUdJRF9TVEFDS19BTkRfUkVQRUFUICAgICAgICAgICAgIDB4MDAwMDAzMDJMCisjZGVmaW5lIERSRUdfUkVHSURfSU5ERVgwICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMzA0TAorI2RlZmluZSBEUkVHX1JFR0lEX0lOREVYMSAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDMwNUwKKyNkZWZpbmUgRFJFR19SRUdJRF9ETUFfU1RBVEVfMF8zICAgICAgICAgICAgICAgIDB4MDAwMDA0MDBMCisjZGVmaW5lIERSRUdfUkVHSURfRE1BX1NUQVRFXzRfNyAgICAgICAgICAgICAgICAweDAwMDAwNDA0TAorI2RlZmluZSBEUkVHX1JFR0lEX0RNQV9TVEFURV84XzExICAgICAgICAgICAgICAgMHgwMDAwMDQwOEwKKyNkZWZpbmUgRFJFR19SRUdJRF9ETUFfU1RBVEVfMTJfMTUgICAgICAgICAgICAgIDB4MDAwMDA0MENMCisjZGVmaW5lIERSRUdfUkVHSURfRE1BX1NUQVRFXzE2XzE5ICAgICAgICAgICAgICAweDAwMDAwNDEwTAorI2RlZmluZSBEUkVHX1JFR0lEX0RNQV9TVEFURV8yMF8yMyAgICAgICAgICAgICAgMHgwMDAwMDQxNEwKKyNkZWZpbmUgRFJFR19SRUdJRF9ETUFfU1RBVEVfMjRfMjcgICAgICAgICAgICAgIDB4MDAwMDA0MThMCisjZGVmaW5lIERSRUdfUkVHSURfRE1BX1NUQVRFXzI4XzMxICAgICAgICAgICAgICAweDAwMDAwNDFDTAorI2RlZmluZSBEUkVHX1JFR0lEX0RNQV9TVEFURV8zMl8zNSAgICAgICAgICAgICAgMHgwMDAwMDQyMEwKKyNkZWZpbmUgRFJ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I2RlZmluZSBEUkVHX1JFR0lEX0RNQV9TVEFURV85Ml85NSAgICAgICAgICAgICAgMHgwMDAwMDQ1Q0wKKyNkZWZpbmUgRFJFR19SRUdJRF9UUkFQX1NFTEVDVCAgICAgICAgICAgICAgICAgIDB4MDAwMDA1MDBMCisjZGVmaW5lIERSRUdfUkVHSURfVFJBUF9XUklURV8wICAgICAgICAgICAgICAgICAweDAwMDAwNTAwTAorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfV1JJVEVfMSAgICAgICAgICAgICAgICAgMHgwMDAwMDUwMUwKKyNkZWZpbmUgRFJFR19SRUdJRF9UUkFQX1dSSVRFXzIgICAgICAgICAgICAgICAgIDB4MDAwMDA1MDJMCisjZGVmaW5lIERSRUdfUkVHSURfVFJBUF9XUklURV8zICAgICAgICAgICAgICAgICAweDAwMDAwNTAzTAorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfV1JJVEVfNCAgICAgICAgICAgICAgICAgMHgwMDAwMDUwNEwKKyNkZWZpbmUgRFJFR19SRUdJRF9UUkFQX1dSSVRFXzUgICAgICAgICAgICAgICAgIDB4MDAwMDA1MDVMCisjZGVmaW5lIERSRUdfUkVHSURfVFJBUF9XUklURV82ICAgICAgICAgICAgICAgICAweDAwMDAwNTA2TAorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfV1JJVEVfNyAgICAgICAgICAgICAgICAgMHgwMDAwMDUwN0wKKyNpZiAhZGVmaW5lZChOT19DUzQ2MTIpCisjaWYgIWRlZmluZWQoTk9fQ1M0NjE1KQorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfV1JJVEVfOCAgICAgICAgICAgICAgICAgMHgwMDAwMDUxMEwKKyNkZWZpbmUgRFJFR19SRUdJRF9UUkFQX1dSSVRFXzkgICAgICAgICAgICAgICAgIDB4MDAwMDA1MTFMCisjZGVmaW5lIERSRUdfUkVHSURfVFJBUF9XUklURV8xMCAgICAgICAgICAgICAgICAweDAwMDAwNTEyTAorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfV1JJVEVfMTEgICAgICAgICAgICAgICAgMHgwMDAwMDUxM0wKKyNkZWZpbmUgRFJFR19SRUdJRF9UUkFQX1dSSVRFXzEyICAgICAgICAgICAgICAgIDB4MDAwMDA1MTRMCisjZGVmaW5lIERSRUdfUkVHSURfVFJBUF9XUklURV8xMyAgICAgICAgICAgICAgICAweDAwMDAwNTE1TAorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfV1JJVEVfMTQgICAgICAgICAgICAgICAgMHgwMDAwMDUxNkwKKyNkZWZpbmUgRFJFR19SRUdJRF9UUkFQX1dSSVRFXzE1ICAgICAgICAgICAgICAgIDB4MDAwMDA1MTdMCisjZGVmaW5lIERSRUdfUkVHSURfVFJBUF9XUklURV8xNiAgICAgICAgICAgICAgICAweDAwMDAwNTE4TAorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfV1JJVEVfMTcgICAgICAgICAgICAgICAgMHgwMDAwMDUxOUwKKyNkZWZpbmUgRFJFR19SRUdJRF9UUkFQX1dSSVRFXzE4ICAgICAgICAgICAgICAgIDB4MDAwMDA1MUFMCisjZGVmaW5lIERSRUdfUkVHSURfVFJBUF9XUklURV8xOSAgICAgICAgICAgICAgICAweDAwMDAwNTFCTAorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfV1JJVEVfMjAgICAgICAgICAgICAgICAgMHgwMDAwMDUxQ0wKKyNkZWZpbmUgRFJFR19SRUdJRF9UUkFQX1dSSVRFXzIxICAgICAgICAgICAgICAgIDB4MDAwMDA1MURMCisjZGVmaW5lIERSRUdfUkVHSURfVFJBUF9XUklURV8yMiAgICAgICAgICAgICAgICAweDAwMDAwNTFFTAorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfV1JJVEVfMjMgICAgICAgICAgICAgICAgMHgwMDAwMDUxRkwKKyNlbmRpZgorI2VuZGlmCisjZGVmaW5lIERSRUdfUkVHSURfTUFDMF9BQ0MwX0xPVyAgICAgICAgICAgICAgICAweDAwMDAwNjAwTAorI2RlZmluZSBEUkVHX1JFR0lEX01BQzBfQUNDMV9MT1cgICAgICAgICAgICAgICAgMHgwMDAwMDYwMUwKKyNkZWZpbmUgRFJFR19SRUdJRF9NQUMwX0FDQzJfTE9XICAgICAgICAgICAgICAgIDB4MDAwMDA2MDJMCisjZGVmaW5lIERSRUdfUkVHSURfTUFDMF9BQ0MzX0xPVyAgICAgICAgICAgICAgICAweDAwMDAwNjAzTAorI2RlZmluZSBEUkVHX1JFR0lEX01BQzFfQUNDMF9MT1cgICAgICAgICAgICAgICAgMHgwMDAwMDYwNEwKKyNkZWZpbmUgRFJFR19SRUdJRF9NQUMxX0FDQzFfTE9XICAgICAgICAgICAgICAgIDB4MDAwMDA2MDVMCisjZGVmaW5lIERSRUdfUkVHSURfTUFDMV9BQ0MyX0xPVyAgICAgICAgICAgICAgICAweDAwMDAwNjA2TAorI2RlZmluZSBEUkVHX1JFR0lEX01BQzFfQUNDM19MT1cgICAgICAgICAgICAgICAgMHgwMDAwMDYwN0wKKyNkZWZpbmUgRFJFR19SRUdJRF9NQUMwX0FDQzBfTUlEICAgICAgICAgICAgICAgIDB4MDAwMDA2MDhMCisjZGVmaW5lIERSRUdfUkVHSURfTUFDMF9BQ0MxX01JRCAgICAgICAgICAgICAgICAweDAwMDAwNjA5TAorI2RlZmluZSBEUkVHX1JFR0lEX01BQzBfQUNDMl9NSUQgICAgICAgICAgICAgICAgMHgwMDAwMDYwQUwKKyNkZWZpbmUgRFJFR19SRUdJRF9NQUMwX0FDQzNfTUlEICAgICAgICAgICAgICAgIDB4MDAwMDA2MEJMCisjZGVmaW5lIERSRUdfUkVHSURfTUFDMV9BQ0MwX01JRCAgICAgICAgICAgICAgICAweDAwMDAwNjBDTAorI2RlZmluZSBEUkVHX1JFR0lEX01BQzFfQUNDMV9NSUQgICAgICAgICAgICAgICAgMHgwMDAwMDYwREwKKyNkZWZpbmUgRFJFR19SRUdJRF9NQUMxX0FDQzJfTUlEICAgICAgICAgICAgICAgIDB4MDAwMDA2MEVMCisjZGVmaW5lIERSRUdfUkVHSURfTUFDMV9BQ0MzX01JRCAgICAgICAgICAgICAgICAweDAwMDAwNjBGTAorI2RlZmluZSBEUkVHX1JFR0lEX01BQzBfQUNDMF9ISUdIICAgICAgICAgICAgICAgMHgwMDAwMDYxMEwKKyNkZWZpbmUgRFJFR19SRUdJRF9NQUMwX0FDQzFfSElHSCAgICAgICAgICAgICAgIDB4MDAwMDA2MTFMCisjZGVmaW5lIERSRUdfUkVHSURfTUFDMF9BQ0MyX0hJR0ggICAgICAgICAgICAgICAweDAwMDAwNjEyTAorI2RlZmluZSBEUkVHX1JFR0lEX01BQzBfQUNDM19ISUdIICAgICAgICAgICAgICAgMHgwMDAwMDYxM0wKKyNkZWZpbmUgRFJFR19SRUdJRF9NQUMxX0FDQzBfSElHSCAgICAgICAgICAgICAgIDB4MDAwMDA2MTRMCisjZGVmaW5lIERSRUdfUkVHSURfTUFDMV9BQ0MxX0hJR0ggICAgICAgICAgICAgICAweDAwMDAwNjE1TAorI2RlZmluZSBEUkVHX1JFR0lEX01BQzFfQUNDMl9ISUdIICAgICAgICAgICAgICAgMHgwMDAwMDYxNkwKKyNkZWZpbmUgRFJFR19SRUdJRF9NQUMxX0FDQzNfSElHSCAgICAgICAgICAgICAgIDB4MDAwMDA2MTdMCisjZGVmaW5lIERSRUdfUkVHSURfUlNIT1VUX0xPVyAgICAgICAgICAgICAgICAgICAweDAwMDAwNjIwTAorI2RlZmluZSBEUkVHX1JFR0lEX1JTSE9VVF9NSUQgICAgICAgICAgICAgICAgICAgMHgwMDAwMDYyOEwKKyNkZWZpbmUgRFJFR19SRUdJRF9SU0hPVVRfSElHSCAgICAgICAgICAgICAgICAgIDB4MDAwMDA2MzBMCisKKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorLy8KKy8vIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgQUM5NyBTL1BESUYgQ29udHJvbCByZWdpc3Rlci4KKy8vCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyNkZWZpbmUgU1BESUZfQ09OVFJPTF9TUERJRl9FTiAgICAgICAgICAgICAgICAgMHgwMDAwODAwMEwKKyNkZWZpbmUgU1BESUZfQ09OVFJPTF9WQUwgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwNDAwMEwKKyNkZWZpbmUgU1BESUZfQ09OVFJPTF9DT1BZICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNEwKKyNkZWZpbmUgU1BESUZfQ09OVFJPTF9DQzAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAxMEwKKyNkZWZpbmUgU1BESUZfQ09OVFJPTF9DQzEgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAyMEwKKyNkZWZpbmUgU1BESUZfQ09OVFJPTF9DQzIgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA0MEwKKyNkZWZpbmUgU1BESUZfQ09OVFJPTF9DQzMgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA4MEwKKyNkZWZpbmUgU1BESUZfQ09OVFJPTF9DQzQgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDEwMEwKKyNkZWZpbmUgU1BESUZfQ09OVFJPTF9DQzUgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDIwMEwKKyNkZWZpbmUgU1BESUZfQ09OVFJPTF9DQzYgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDQwMEwKKyNkZWZpbmUgU1BESUZfQ09OVFJPTF9MICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDgwMEwKKworI2VuZGlmIC8vIF9IX0hXREVGUwpkaWZmIC0tZ2l0IGEvc291bmQvb3NzL2NzNDI4MS9jcz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NkZWZpbmUgTUlESU9VVEJVRiA1MDAKKworI2RlZmluZSBGTU9ERV9NSURJX1NISUZUIDMKKyNkZWZpbmUgRk1PREVfTUlESV9SRUFEICAoRk1PREVfUkVBRCA8PCBGTU9ERV9NSURJX1NISUZUKQorI2RlZmluZSBGTU9ERV9NSURJX1dSSVRFIChGTU9ERV9XUklURSA8PCBGTU9ERV9NSURJX1NISUZUKQorCisjZGVmaW5lIENTNDI4MV9NQUpPUl9WRVJTSU9OIAkxCisjZGVmaW5lIENTNDI4MV9NSU5PUl9WRVJTSU9OIAkxMworI2lmZGVmIF9faWE2NF9fCisjZGVmaW5lIENTNDI4MV9BUkNICSAgICAgCTY0CS8vYXJjaGl0ZWN0dXJlIGtleQorI2Vsc2UKKyNkZWZpbmUgQ1M0MjgxX0FSQ0gJICAgICAJMzIJLy9hcmNoaXRlY3R1cmUga2V5CisjZW5kaWYKKworI2RlZmluZSBDU19UWVBFX0FEQyAwCisjZGVmaW5lIENTX1RZUEVfREFDIDEKKworCitzdGF0aWMgY29uc3QgY2hhciBpbnZhbGlkX21hZ2ljW10gPQorICAgIEtFUk5fQ1JJVCAiY3M0MjgxOiBpbnZhbGlkIG1hZ2ljIHZhbHVlXG4iOworCisjZGVmaW5lIFZBTElEQVRFX1NUQVRFKHMpICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyh7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICBpZiAoIShzKSB8fCAocyktPm1hZ2ljICE9IENTNDI4MV9NQUdJQykgeyBcCisgICAgICAgICAgICAgICAgcHJpbnRrKGludmFsaWRfbWFnaWMpOyAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICByZXR1cm4gLUVOWElPOyAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICB9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCit9KQorCisvL0xJU1RfSEVBRChjczQyODFfZGV2cyk7CitzdGF0a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UNTX0RCR09VVChDU19FUlJPUiwgMSwgcHJpbnRrKEtFUk5fSU5GTworCSAgICAgIAkJImNzNDI4MTogY3NfNDI4MV93cml0ZV9hYzk3KCktIHVuYWJsZSB0byB3cml0ZS4gQUNDVExfRENWIGFjdGl2ZVxuIikpOworCQlyZXR1cm4gMTsKKwl9CisJQ1NfREJHT1VUKENTX0ZVTkNUSU9OLCAyLAorCQkgIHByaW50ayhLRVJOX0lORk8gImNzNDI4MTogY3NfNDI4MV93cml0ZV9hYzk3KCktIDBcbiIpKTsKKwkvLyBTdWNjZXNzLgorCXJldHVybiAwOworfQorCisKKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisvLyAiSW5pdDQyODEoKSIgLS0gQnJpbmcgdXAgdGhlIHBhcnQuCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorc3RhdGljIF9fZGV2aW5pdCBpbnQgY3M0MjgxX2h3X2luaXQoc3RydWN0IGNzNDI4MV9zdGF0ZSAqY2FyZCkKK3sKKwl1MzIgYWM5N19zbG90aWQ7CisJdTMyIHRlbXAxLCB0ZW1wMjsKKworCUNTX0RCR09VVChDU19GVU5DVElPTiwgMiwKKwkJICBwcmludGsoS0VSTl9JTkZPICJjczQyODE6IGNzNDI4MV9od19pbml0KCkrIFxuIikpOworI2lmbmRlZiBOT1RfQ1M0MjgxX1BNCisJaWYoIWNhcmQpCisJCXJldHVybiAxOworI2VuZGlmCisJdGVtcDIgPSByZWFkbChjYXJkLT5wQkEwICsgQkEwX0NGTFIpOworCUNTX0RCR09VVChDU19JTklUIHwgQ1NfRVJST1IgfCBDU19QQVJNUywgNCwgcHJpbnRrKEtFUk5fSU5GTyAKKwkJImNzNDI4MTogY3M0MjgxX2h3X2luaXQoKSBDRkxSIDB4JXhcbiIsIHRlbXAy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cGlwZWxpbmVzKHN0cnVjdCBjczQyODFfc3RhdGUgKnMpCit7CisJaW50IGk7CisJZm9yKGk9MDtpPENTNDI4MV9OVU1CRVJfT0ZfUElQRUxJTkVTO2krKykKKwl7CisJCWlmKHMtPnBsW2ldLmZsYWdzICYgQ1M0MjgxX1BJUEVMSU5FX1ZBTElEKQorCQl7CisJCQlwcmludHBpcGUoJnMtPnBsW2ldKTsKKwkJfQorCX0KK30KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqICBTdXNwZW5kIC0gc2F2ZSB0aGUgYWM5NyByZWdzLCBtdXRlIHRoZSBvdXRwdXRzIGFuZCBwb3dlciBkb3duIHRoZSBwYXJ0LiAgCisqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RhdGljIHZvaWQgY3M0MjgxX2FjOTdfc3VzcGVuZChzdHJ1Y3QgY3M0MjgxX3N0YXRlICpzKQoreworCWludCBDb3VudCxpOworCisJQ1NfREJHT1VUKENTX1BNLCA5LCBwcmludGsoImNzNDI4MTogY3M0MjgxX2FjOTdfc3VzcGVuZCgpK1xuIikpOworLyoKKyogY2hhbmdlIHRoZSBzdGF0ZSwgc2F2ZSB0aGUgY3VycmVudCBod3B0ciwgdGhlbiBzdG9wIHRoZSBkYWMvYWRjCisqLworCXMtPnBtLmZsYWdzICY9IH5DUzQyODFfUE1fSURMRTsKKwlzLT5wbS5mbGFncyB8PSBDUzQyODFfUE1fU1VTUEVORElORzsKKwlzLT5wbS51MzJod3B0cl9wbGF5YmFjayA9IHJlYWRsKHMtPnBCQTAgKyBCQTBfRENBMCk7CisJcy0+cG0udTMyaHdwdHJfY2FwdHVyZSA9IHJlYWRsKHMtPnBCQTAgKyBCQTBfRENBMSk7CisJc3RvcF9kYWMocyk7CisJc3RvcF9hZGMocyk7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VNRSwgMHg4MDAwKTsKKwljczQyODFfd3JpdGVfYWM5NyhzLCBCQTBfQUM5N19IRUFEUEhPTkVfVk9MVU1FLCAweDgwMDApOworCWNzNDI4MV93cml0ZV9hYzk3KHMsIEJBMF9BQzk3X01BU1RFUl9WT0xVTUVfTU9OTywgMHg4MDAwKTsKKwljczQyODFfd3JpdGVfYWM5NyhzLCBCQTBfQUM5N19QQ01fT1VUX1ZPTFVNRSwgMHg4MDAwKTsKKworCWNzNDI4MV9yZWFkX2FjOTcocywgQkEwX0FDOTdfUE9XRVJET1dOLCAmcy0+cG0udTMyQUM5N19wb3dlcmRvd24pOworCWNzNDI4MV9yZWFkX2FjOTcocywgQkEwX0FDOTdfR0VORVJBTF9QVVJQT1NFLCAmcy0+cG0udTMyQUM5N19nZW5lcmFsX3B1cnBvc2UpOworCisvKgorKiBBbmQgcG93ZXIgZG93biBldmVyeXRoaW5nIG9uIHRoZSBBQzk3IGNvZGVjLgorKi8KKwljczQyODFfd3JpdGVfYWM5NyhzLCBCQTBfQUM5N19QT1dFUkRPV04sIDB4ZmYwMCk7CisJQ1NfREJHT1VUKENTX1BNLCA5LCBwcmludGsoImNzNDI4MTogY3M0MjgxX2FjOTdfc3VzcGVuZCgpLVxuIikpOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKgorKiAgUmVzdW1lIC0gcG93ZXIgdXAgdGhlIHBhcnQgYW5kIHJlc3RvcmUgaXRzIHJlZ2lzdGVycy4uICAKKyoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgdm9pZCBjczQyODFfYWM5N19yZXN1bWUoc3RydWN0IGNzNDI4MV9zdGF0ZSAqcykKK3sKKwlpbnQgQ291bnQsaTsKKworCUNTX0RCR09VVChDU19QTSwgOSwgcHJpbnRrKC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UgdGhlIHBvd2VyIHN0YXRlIHJlZ2lzdGVycyBhdCB0aGlzIHRpbWUKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoKKyogIFNhdmVQb3dlclN0YXRlIC0gU2F2ZSB0aGUgcG93ZXIgcmVnaXN0ZXJzIGF3YXkuIAorKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgordm9pZCAKK0hXQUM5N2NvZGVjOjpTYXZlUG93ZXJTdGF0ZSh2b2lkKQoreworICAgIEVOVFJZKFRNX09CSkVDVENBTExTLCAiSFdBQzk3Y29kZWM6OlNhdmVQb3dlclN0YXRlKClcclxuIik7CisKKyAgICB1bFNhdmVSZWcweDI2ID0gUGVla1NoYWRvdygweDI2KTsKKworICAgIC8vCisgICAgLy8gTm90ZSB0aGF0IHdlIGhhdmUgc2F2ZWQgcmVnaXN0ZXJzIHRoYXQgbmVlZCB0byBiZSByZXN0b3JlZCBkdXJpbmcgYQorICAgIC8vIHJlc3VtZSBpbnN0ZWFkIG9mIHVsQUM5N1JlZ3NbXS4KKyAgICAvLworICAgIGJQb3dlclN0YXRlU2F2ZWQgPSBUUlVFOworCit9IC8vIFNhdmVQb3dlclN0YXRlCisqLworCitzdGF0aWMgdm9pZCBjczQyODFfU3VzcGVuZEZJRk8oc3RydWN0IGNzNDI4MV9zdGF0ZSAqcywgc3RydWN0IGNzNDI4MV9waXBlbGluZSAqcGwpCit7CisgLyoKKyAqIFdlIG5lZWQgdG8gc2F2ZSB0aGUgY29udGVudHMgb2YgdGhlIEJBU0lDIEZJRk8gUmVnaXN0ZXJzLgorICovCisJcGwtPnUzMkZDUm5fU2F2ZSA9IHJlYWRsKHMtPnBCQTAgKyBwbC0+dTMyRkNSbkFkZHJlc3MpOworCXBsLT51MzJGU0lDbl9TYXZlID0gcmVhZGwocy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0IGZpbGUgKmZpbGUsCisJCQkgICAgICAgdW5zaWduZWQgaW50IGNtZCwgdW5zaWduZWQgbG9uZyBhcmcpCit7CisJcmV0dXJuIG1peGVyX2lvY3RsKChzdHJ1Y3QgY3M0MjgxX3N0YXRlICopIGZpbGUtPnByaXZhdGVfZGF0YSwgY21kLAorCQkJICAgYXJnKTsKK30KKworCisvLyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKy8vICAgTWl4ZXIgZmlsZSBvcGVyYXRpb25zIHN0cnVjdC4KKy8vICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorc3RhdGljIC8qY29uc3QgKi8gc3RydWN0IGZpbGVfb3BlcmF0aW9ucyBjczQyODFfbWl4ZXJfZm9wcyA9IHsKKwkub3duZXIJID0gVEhJU19NT0RVTEUsCisJLmxsc2VlawkgPSBub19sbHNlZWssCisJLmlvY3RsCSA9IGNzNDI4MV9pb2N0bF9taXhkZXYsCisJLm9wZW4JID0gY3M0MjgxX29wZW5fbWl4ZGV2LAorCS5yZWxlYXNlID0gY3M0MjgxX3JlbGVhc2VfbWl4ZGV2LAorfTsKKworLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tIAorCisKK3N0YXRpYyBpbnQgZHJhaW5fYWRjKHN0cnVjdCBjczQyODFfc3RhdGUgKnMsIGludCBub25ibG9jaykKK3sKKwlERUNMQVJFX1dBSVRRVUVVRSh3YWl0LCBjdXJyZW50KTsKKwl1bnNpZ25lZCBsb25nIGZsYWdzOworCWludCBjb3VudDsKKwl1bnNpZ25lZCB0bW87CisKKwlpZiAocy0+ZG1hX2FkYy5tYXBwZWQpCisJ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pbnRlciB0byBhIHNvdXJjZSBidWZmZXIKKy8vICBjb3VudCAgICAgICAgICAgLSBUaGUgbnVtYmVyIG9mIGJ5dGVzIHRvIGNvcHkgaW50byB0aGUgZGVzdGluYXRpb24gYnVmZmVyLgorLy8gIGlDaGFubmVscyAgICAgICAtIFN0ZXJlbyAtIDIKKy8vICAgICAgICAgICAgICAgICAgICBNb25vICAgLSAxCisvLyAgZm10ICAgICAgICAgICAgIC0gQUZNVF94eHggKHNvdW5kY2FyZC5oIGZvcm1hdHMpCisvLworLy8gTk9URVM6IG9ubHkgY2FsbCB0aGlzIHJvdXRpbmUgZm9yIGNvbnZlcnNpb24gdG8gOGJpdCBmcm9tIDE2Yml0CisvLworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCitzdGF0aWMgdm9pZCBDb3B5U2FtcGxlcyhjaGFyICpkc3QsIGNoYXIgKnNyYywgaW50IGNvdW50LCBpbnQgaUNoYW5uZWxzLAorCQkJdW5zaWduZWQgZm10KQoreworCisJdW5zaWduZWQgc2hvcnQgKnBzU3JjOworCWxvbmcgbEF1ZGlvU2FtcGxlOworCisJQ1NfREJHT1VUKENTX0ZVTkNUSU9OLCAyLAorCQkgIHByaW50ayhLRVJOX0lORk8gImNzNDI4MTogQ29weVNhbXBsZXMoKSsgIikpOworCUNTX0RCR09VVChDU19XQVZFX1JFQUQsIDgsIHByaW50ayhLRVJOX0lORk8KKwkJICIgZHN0PSVwIHNyYz0lcCBjb3VudD0lZCBpQ2hhbm5lbHM9JWQgZm10PTB4JXhcbiIsCisJCQkgZHN0LCBzcmMsICh1bnNpZ25lZCkgY291bnQsICh1bnNpZ25lZCkgaUNoYW5uZWxzLCAodW5zaWduZWQpIGZtdCkpOworCisJLy8gR2Vyc2h3aW4gZG9lcyBmb3JtYXQgY29udmVyc2lvbiBpbiBoYXJkd2FyZSBzbyBub3JtYWxseQorCS8vIHdlIGRv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A7CisJCXVwKCZzLT5vcGVuX3NlbV9kYWMpOworCisJCWlmIChwcm9nX2RtYWJ1Zl9kYWMocykpIHsKKwkJCUNTX0RCR09VVChDU19PUEVOIHwgQ1NfRVJST1IsIDIsIHByaW50ayhLRVJOX0VSUgorCQkJCSJjczQyODE6IGRhYyBQcm9ncmFtIGRtYWJ1ZnMgZmFpbGVkLlxuIikpOworCQkJY3M0MjgxX3JlbGVhc2UoaW5vZGUsIGZpbGUpOworCQkJcmV0dXJuIC1FTk9NRU07CisJCX0KKwkJcHJvZ19jb2RlYyhzLCBDU19UWVBFX0RBQyk7CisJfQorCUNTX0RCR09VVChDU19GVU5DVElPTiB8IENTX09QRU4sIDIsCisJCSAgcHJpbnRrKEtFUk5fSU5GTyAiY3M0MjgxOiBjczQyODFfb3BlbigpLSAwXG4iKSk7CisJcmV0dXJuIG5vbnNlZWthYmxlX29wZW4oaW5vZGUsIGZpbGUpOworfQorCisKKy8vICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorLy8gICBXYXZlIChhdWRpbykgZmlsZSBvcGVyYXRpb25zIHN0cnVjdC4KKy8vICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorc3RhdGljIC8qY29uc3QgKi8gc3RydWN0IGZpbGVfb3BlcmF0aW9ucyBjczQyODFfYXVkaW9fZm9wcyA9IHsKKwkub3duZXIJID0gVEhJU19NT0RVTEUsCisJLmxsc2VlawkgPSBub19sbHNlZWssCisJLnJlYWQJID0gY3M0MjgxX3JlYWQsCisJLndyaXRlCSA9IGNzNDI4MV93cml0ZSwKKwkucG9sbAkgPSBjczQyODFfcG9sbCwKKwkuaW9jdGwJID0gY3M0MjgxX2lvY3RsLAorCS5tbWFwCSA9IGNzNDI4MV9tbWFwLAorCS5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EwX01JRENSKTsJLy8gRGlzYWJsZSBNaWRpIGludGVycnVwdHMuICAKKwkJZGVsX3RpbWVyKCZzLT5taWRpLnRpbWVyKTsKKwl9CisJc3Bpbl91bmxvY2tfaXJxcmVzdG9yZSgmcy0+bG9jaywgZmxhZ3MpOworCXVwKCZzLT5vcGVuX3NlbSk7CisJd2FrZV91cCgmcy0+b3Blbl93YWl0KTsKKwlyZXR1cm4gMDsKK30KKworLy8gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisvLyAgIE1pZGkgZmlsZSBvcGVyYXRpb25zIHN0cnVjdC4KKy8vICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorc3RhdGljIC8qY29uc3QgKi8gc3RydWN0IGZpbGVfb3BlcmF0aW9ucyBjczQyODFfbWlkaV9mb3BzID0geworCS5vd25lcgkgPSBUSElTX01PRFVMRSwKKwkubGxzZWVrCSA9IG5vX2xsc2VlaywKKwkucmVhZAkgPSBjczQyODFfbWlkaV9yZWFkLAorCS53cml0ZQkgPSBjczQyODFfbWlkaV93cml0ZSwKKwkucG9sbAkgPSBjczQyODFfbWlkaV9wb2xsLAorCS5vcGVuCSA9IGNzNDI4MV9taWRpX29wZW4sCisJLnJlbGVhc2UgPSBjczQyODFfbWlkaV9yZWxlYXNlLAorfTsKKworCisvLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gCisKKy8vIG1heGltdW0gbnVtYmVyIG9mIGRldmljZXMgCisjZGVmaW5lIE5SX0RFVklDRSA4CQkvLyBPbmx5IGVpZ2h0IGRldmljZXMgc3VwcG9ydGVkIGN1cnJlbnRseS4KKworLy8gLS0tLS0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lJVU180NjEyCisjZGVmaW5lIFBDSV9ERVZJQ0VfSURfQ0lSUlVTXzQ2MTIgICAgICAgMHg2MDAzCisjZW5kaWYKKyNpZm5kZWYgUENJX0RFVklDRV9JRF9DSVJSVVNfNDYxNQorI2RlZmluZSBQQ0lfREVWSUNFX0lEX0NJUlJVU180NjE1ICAgICAgIDB4NjAwNAorI2VuZGlmCisKKy8qCisgKiAgRGlyZWN0IHJlZ2lzdGVycworICovCisKKy8qCisgKiAgVGhlIGZvbGxvd2luZyBkZWZpbmUgdGhlIG9mZnNldHMgb2YgdGhlIHJlZ2lzdGVycyBhY2Nlc3NlZCB2aWEgYmFzZSBhZGRyZXNzCisgKiAgcmVnaXN0ZXIgemVybyBvbiB0aGUgQ1M0NjF4IHBhcnQuCisgKi8KKyNkZWZpbmUgQkEwX0hJU1IJCQkJMHgwMDAwMDAwMAorI2RlZmluZSBCQTBfSFNSMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNAorI2RlZmluZSBCQTBfSElDUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwOAorI2RlZmluZSBCQTBfRE1TUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDEwMAorI2RlZmluZSBCQTBfSFNBUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDExMAorI2RlZmluZSBCQTBfSERBUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDExNAorI2RlZmluZSBCQTBfSERNUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDExOAorI2RlZmluZSBCQTBfSERDUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDExQworI2RlZmluZSBCQTBfUEZNQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDIwMAorI2RlZmluZSBCQTBfUEZDVjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDIwNAorI2RlZmluZSBCQTBfUEZDVjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDIwOAorI2RlZmluZSBCQTBfUENJQ0ZHMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDMwMAorI2RlZmluZSBCQTBfUENJQ0ZHMDQgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDMwNAorI2RlZmluZSBCQTBfUENJQ0ZHMDggICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDMwOAorI2RlZmluZSBCQTBfUENJQ0ZHMEMgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDMwQworI2RlZmluZSBCQTBfUENJQ0ZHMTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDMxMAorI2RlZmluZSBCQTBfUENJQ0ZHMTQgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDMxNAorI2RlZmluZSBCQTBfUENJQ0ZHMTggICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDMxOAorI2RlZmluZSBCQTBfUENJQ0ZHMUMgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDMxQworI2RlZmluZSBCQTBfUENJQ0ZHMjAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDMyMAorI2RlZmluZSBCQTBfUENJQ0ZHMjQgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDMyNAorI2RlZmluZSBCQTBfUENJQ0ZHMjggICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDMyOAorI2RlZmluZSBCQTBfUENJQ0ZHMkMgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDMyQworI2RlZmluZSBCQTBfUENJQ0ZHMzAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDMzMAorI2RlZmluZSBCQTBfUENJQ0ZHMzQgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDMzNAorI2RlZmluZSBCQTBfUENJQ0ZHMzggICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDMzOAorI2RlZmluZSBCQTBfUENJQ0ZHM0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDMzQworI2RlZmluZSBCQTBfQ0xLQ1IxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDQwMAorI2RlZmluZSBCQTBfQ0xLQ1IyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDQwNAorI2RlZmluZSBCQTBfUExMTSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDQwOAorI2RlZmluZSBCQTBfUExMQ0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDQwQworI2RlZmluZSBCQTBfRlJSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDQxMCAKKyNkZWZpbmUgQkEwX0NGTDEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0MTQKKyNkZWZpbmUgQkEwX0NGTDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0MTgKKyNkZWZpbmUgQkEwX1NFUk1DMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0MjAKKyNkZWZpbmUgQkEwX1NFUk1DMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0MjQKKyNkZWZpbmUgQkEwX1NFUkMxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0MjgKKyNkZWZpbmUgQkEwX1NFUkMyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0MkMKKyNkZWZpbmUgQkEwX1NFUkMzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0MzAKKyNkZWZpbmUgQkEwX1NFUkM0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0MzQKKyNkZWZpbmUgQkEwX1NFUkM1ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0MzgKKyNkZWZpbmUgQkEwX1NFUkJTUCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0M0MKKyNkZWZpbmUgQkEwX1NFUkJTVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0NDAKKyNkZWZpbmUgQkEwX1NFUkJDTSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0NDQKKyNkZWZpbmUgQkEwX1NFUkJBRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0NDgKKyNkZWZpbmUgQkEwX1NFUkJDRiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0NEMKKyNkZWZpbmUgQkEwX1NFUkJXUCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0NTAKKyNkZWZpbmUgQkEwX1NFUkJSUCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0NTQKKyNpZm5kZWYgTk9fQ1M0NjEyCisjZGVmaW5lIEJBMF9BU0VSX0ZBRERSICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNDU4CisjZW5kaWYKKyNkZWZpbmUgQkEwX0FDQ1RMICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0NjAKKyNkZWZpbmUgQkEwX0FDU1RTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0NjQKKyNkZWZpbmUgQkEwX0FDT1NWICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0NjgKKyNkZWZpbmUgQkEwX0FDQ0FEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0NkMKKyNkZWZpbmUgQkEwX0FDQ0RBICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0NzAKKyNkZWZpbmUgQkEwX0FDSVNWICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0NzQKKyNkZWZpbmUgQkEwX0FDU0FEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0NzgKKyNkZWZpbmUgQkEwX0FDU0RBICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0N0MKKyNkZWZpbmUgQkEwX0pTUFQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0ODAKKyNkZWZpbmUgQkEwX0pTQ1RMICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0ODQKKyNkZWZpbmUgQkEwX0pTQzEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0ODgKKyNkZWZpbmUgQkEwX0pTQzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0OEMKKyNkZWZpbmUgQkEwX01JRENSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0OTAKKyNkZWZpbmUgQkEwX01JRFNSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0OTQKKyNkZWZpbmUgQkEwX01JRFdQICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0OTgKKyNkZWZpbmUgQkEwX01JRFJQICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0OUMKKyNkZWZpbmUgQkEwX0pTSU8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0QTAKKyNpZm5kZWYgTk9fQ1M0NjEyCisjZGVmaW5lIEJBMF9BU0VSX01BU1RFUiAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNEE0CisjZW5kaWYKKyNkZWZpbmUgQkEwX0NGR0kgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0QjAKKyNkZWZpbmUgQkEwX1NTVklEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0QjQKKyNkZWZpbmUgQkEwX0dQSU9SICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA0QjgKKyNpZm5kZWYgTk9fQ1M0NjEyCisjZGVmaW5lIEJBMF9FR1BJT0RSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNEJDCisjZGVmaW5lIEJBMF9FR1BJT1BUUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNEMwCisjZGVmaW5lIEJBMF9FR1BJT1RSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNEM0CisjZGVmaW5lIEJBMF9FR1BJT1dSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNEM4CisjZGVmaW5lIEJBMF9FR1BJT1NSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNENDCisjZGVmaW5lIEJBMF9TRVJDNiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNEQwCisjZGVmaW5lIEJBMF9TRVJDNyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNEQ0CisjZGVmaW5lIEJBMF9TRVJBQ0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNEQ4CisjZGVmaW5lIEJBMF9BQ0NUTDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNEUwCisjZGVmaW5lIEJBMF9BQ1NUUzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNEU0CisjZGVmaW5lIEJBMF9BQ09TVjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNEU4CisjZGVmaW5lIEJBMF9BQ0NBRDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNEVDCisjZGVmaW5lIEJBMF9BQ0NEQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNEYwCisjZGVmaW5lIEJBMF9BQ0lTVjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNEY0CisjZGVmaW5lIEJBMF9BQ1NBRDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNEY4CisjZGVmaW5lIEJBMF9BQ1NEQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNEZDCisjZGVmaW5lIEJBMF9JT1RBQzAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNTAwCisjZGVmaW5lIEJBMF9JT1RBQzEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNTA0CisjZGVmaW5lIEJBMF9JT1RBQzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNTA4CisjZGVmaW5lIEJBMF9JT1RBQzMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNTBDCisjZGVmaW5lIEJBMF9JT1RBQzQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNTEwCisjZGVmaW5lIEJBMF9JT1RBQzUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNTE0CisjZGVmaW5lIEJBMF9JT1RBQzYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNTE4CisjZGVmaW5lIEJBMF9JT1RBQzcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNTFDCisjZGVmaW5lIEJBMF9JT1RBQzggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNTIwCisjZGVmaW5lIEJBMF9JT1RBQzkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNTI0CisjZGVmaW5lIEJBMF9JT1RBQzEwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNTI4CisjZGVmaW5lIEJBMF9JT1RBQzExICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNTJDCisjZGVmaW5lIEJBMF9JT1RGUjAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNTQwCisjZGVmaW5lIEJBMF9JT1RGUjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNTQ0CisjZGVmaW5lIEJBMF9JT1RGUjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNTQ4CisjZGVmaW5lIEJBMF9JT1RGUjMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNTRDCisjZGVmaW5lIEJBMF9JT1RGUjQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNTUwCisjZGVmaW5lIEJBMF9JT1RGUjUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNTU0CisjZGVmaW5lIEJBMF9JT1RGUjYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNTU4CisjZGVmaW5lIEJBMF9JT1RGUjcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNTVDCisjZGVmaW5lIEJBMF9JT1RGSUZPICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNTgwCisjZGVmaW5lIEJBMF9JT1RSUkQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNTg0CisjZGVmaW5lIEJBMF9JT1RGUCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNTg4CisjZGVmaW5lIEJBMF9JT1RDUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNThDCisjZGVmaW5lIEJBMF9EUENJRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNTkwCisjZGVmaW5lIEJBMF9EUENJQSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNTk0CisjZGVmaW5lIEJBMF9EUENJQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNTk4CisjZGVmaW5lIEJBMF9QQ1BDSVIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNjAwCisjZGVmaW5lIEJBMF9QQ1BDSUcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNjA0CisjZGVmaW5lIEJBMF9QQ1BDSUVOICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNjA4CisjZGVmaW5lIEJBMF9FUENJUE1DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNjEwCisjZW5kaWYKKworLyoKKyAqICBUaGUgZm9sbG93aW5nIGRlZmluZSB0aGUgb2Zmc2V0cyBvZiB0aGUgcmVnaXN0ZXJzIGFuZCBtZW1vcmllcyBhY2Nlc3NlZCB2aWEKKyAqICBiYXNlIGFkZHJlc3MgcmVnaXN0ZXIgb25lIG9uIHRoZSBDUzQ2MXggcGFydC4KKyAqLworI2RlZmluZSBCQTFfU1BfRE1FTTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMAorI2RlZmluZSBCQTFfU1BfRE1FTTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAxMDAwMAorI2RlZmluZSBCQTFfU1BfUE1FTSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAyMDAwMAorI2RlZmluZSBCQTFfU1BfUkVHCQkJCTB4MDAwMzAwMDAKKyNkZWZpbmUgQkExX1NQQ1IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMzAwMDAKKyNkZWZpbmUgQkExX0RSRUcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMzAwMDQKKyNkZWZpbmUgQkExX0RTUldQICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMzAwMDgKKyNkZWZpbmUgQkExX1RXUFIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMzAwMEMKKyNkZWZpbmUgQkExX1NQV1IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMzAwMTAKKyNkZWZpbmUgQkExX1NQSVIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMzAwMTQKKyNkZWZpbmUgQkExX0ZHUjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMzAwMjAKKyNkZWZpbmUgQkExX1NQQ1MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMzAwMjgKKyNkZWZpbmUgQkExX1NEU1IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMzAwMkMKKyNkZWZpbmUgQkExX0ZSTVQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMzAwMzAKKyNkZWZpbmUgQkExX0ZSQ0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMzAwMzQKKyNkZWZpbmUgQkExX0ZSU0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMzAwMzgKKyNkZWZpbmUgQkExX09NTklfTUVNICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwRTAwMDAKKworLyoKKyAqICBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIGhvc3QgaW50ZXJydXB0IHN0YXR1cworICogIHJlZ2lzdGVyLgorICovCisjZGVmaW5lIEhJU1JfVkNfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDBGRkZGCisjZGVmaW5lIEhJU1JfVkMwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAxCisjZGVmaW5lIEhJU1JfVkMxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAyCisjZGVmaW5lIEhJU1JfVkMyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA0CisjZGVmaW5lIEhJU1JfVkMzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA4CisjZGVmaW5lIEhJU1JfVkM0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDEwCisjZGVmaW5lIEhJU1JfVkM1ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDIwCisjZGVmaW5lIEhJU1JfVkM2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDQwCisjZGVmaW5lIEhJU1JfVkM3ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDgwCisjZGVmaW5lIEhJU1JfVkM4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMTAwCisjZGVmaW5lIEhJU1JfVkM5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMjAwCisjZGVmaW5lIEhJU1JfVkMxMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNDAwCisjZGVmaW5lIEhJU1JfVkMxMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwODAwCisjZGVmaW5lIEhJU1JfVkMxMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAxMDAwCisjZGVmaW5lIEhJU1JfVkMxMyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAyMDAwCisjZGVmaW5lIEhJU1JfVkMxNCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDA0MDAwCisjZGVmaW5lIEhJU1JfVkMxNSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDA4MDAwCisjZGVmaW5lIEhJU1JfSU5UMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDEwMDAwCisjZGVmaW5lIEhJU1JfSU5UMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDIwMDAwCisjZGVmaW5lIEhJU1JfRE1BSSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDQwMDAwCisjZGVmaW5lIEhJU1JfRlJPVlIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDgwMDAwCisjZGVmaW5lIEhJU1JfTUlESSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMTAwMDAwCisjaWZkZWYgTk9fQ1M0NjEyCisjZGVmaW5lIEhJU1JfUkVTRVJWRUQgICAgICAgICAgICAgICAgICAgICAgICAgICAweDBGRTAwMDAwCisjZWxzZQorI2RlZmluZSBISVNSX1NCSU5UICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDIwMDAwMAorI2RlZmluZSBISVNSX1JFU0VSVkVEICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwRkMwMDAwMAorI2VuZGlmCisjZGVmaW5lIEhJU1JfSDBQICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDQwMDAwMDAwCisjZGVmaW5lIEhJU1JfSU5URU5BICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDgwMDAwMDAwCisKKy8qCisgKiAgVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBob3N0IHNpZ25hbCByZWdpc3RlciAwLgorICovCisjZGVmaW5lIEhTUjBfVkNfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEZGRkZGRkZGCisjZGVmaW5lIEhTUjBfVkMxNiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAxCisjZGVmaW5lIEhTUjBfVkMxNyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAyCisjZGVmaW5lIEhTUjBfVkMxOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA0CisjZGVmaW5lIEhTUjBfVkMxOSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA4CisjZGVmaW5lIEhTUjBfVkMyMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDEwCisjZGVmaW5lIEhTUjBfVkMyMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDIwCisjZGVmaW5lIEhTUjBfVkMyMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDQwCisjZGVmaW5lIEhTUjBfVkMyMyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDgwCisjZGVmaW5lIEhTUjBfVkMyNCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMTAwCisjZGVmaW5lIEhTUjBfVkMyNSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMjAwCisjZGVmaW5lIEhTUjBfVkMyNiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNDAwCisjZGVmaW5lIEhTUjBfVkMyNyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwODAwCisjZGVmaW5lIEhTUjBfVkMyOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAxMDAwCisjZGVmaW5lIEhTUjBfVkMyOSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAyMDAwCisjZGVmaW5lIEhTUjBfVkMzMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDA0MDAwCisjZGVmaW5lIEhTUjBfVkMzMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDA4MDAwCisjZGVmaW5lIEhTUjBfVkMzMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDEwMDAwCisjZGVmaW5lIEhTUjBfVkMzMyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDIwMDAwCisjZGVmaW5lIEhTUjBfVkMzNCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDQwMDAwCisjZGVmaW5lIEhTUjBfVkMzNSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDgwMDAwCisjZGVmaW5lIEhTUjBfVkMzNiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMTAwMDAwCisjZGVmaW5lIEhTUjBfVkMzNyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMjAwMDAwCisjZGVmaW5lIEhTUjBfVkMzOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwNDAwMDAwCisjZGVmaW5lIEhTUjBfVkMzOSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwODAwMDAwCisjZGVmaW5lIEhTUjBfVkM0MCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAxMDAwMDAwCisjZGVmaW5lIEhTUjBfVkM0MSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAyMDAwMDAwCisjZGVmaW5lIEhTUjBfVkM0MiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDA0MDAwMDAwCisjZGVmaW5lIEhTUjBfVkM0MyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDA4MDAwMDAwCisjZGVmaW5lIEhTUjBfVkM0NCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDEwMDAwMDAwCisjZGVmaW5lIEhTUjBfVkM0NSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDIwMDAwMDAwCisjZGVmaW5lIEhTUjBfVkM0NiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDQwMDAwMDAwCisjZGVmaW5lIEhTUjBfVkM0NyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDgwMDAwMDAwCisKKy8qCisgKiAgVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBob3N0IGludGVycnVwdCBjb250cm9sCisgKiAgcmVnaXN0ZXIuCisgKi8KKyNkZWZpbmUgSElDUl9JRVYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDEKKyNkZWZpbmUgSElDUl9DSEdNICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDIKKworLyoKKyAqICBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIERNQSBzdGF0dXMgcmVnaXN0ZXIuCisgKi8KKyNkZWZpbmUgRE1TUl9IUCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDEKKyNkZWZpbmUgRE1TUl9IUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDIKKyNkZWZpbmUgRE1TUl9TUCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDQKKyNkZWZpbmUgRE1TUl9TUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDgKKworLyoKKyAqICBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIGhvc3QgRE1BIHNvdXJjZSBhZGRyZXNzCisgKiAgcmVnaXN0ZXIuCisgKi8KKyNkZWZpbmUgSFNBUl9IT1NUX0FERFJfTUFTSyAgICAgICAgICAgICAgICAgICAgIDB4RkZGRkZGRkYKKyNkZWZpbmUgSFNBUl9EU1BfQUREUl9NQVNLICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMEZGRkYKKyNkZWZpbmUgSFNBUl9NRU1JRF9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwRjAwMDAKKyNkZWZpbmUgSFNBUl9NRU1JRF9TUF9ETUVNMCAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDAKKyNkZWZpbmUgSFNBUl9NRU1JRF9TUF9ETUVNMSAgICAgICAgICAgICAgICAgICAgIDB4MDAwMTAwMDAKKyNkZWZpbmUgSFNBUl9NRU1JRF9TUF9QTUVNICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMjAwMDAKKyNkZWZpbmUgSFNBUl9NRU1JRF9TUF9ERUJVRyAgICAgICAgICAgICAgICAgICAgIDB4MDAwMzAwMDAKKyNkZWZpbmUgSFNBUl9NRU1JRF9PTU5JX01FTSAgICAgICAgICAgICAgICAgICAgIDB4MDAwRTAwMDAKKyNkZWZpbmUgSFNBUl9FTkQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4NDAwMDAwMDAKKyNkZWZpbmUgSFNBUl9FUlIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4ODAwMDAwMDAKKworLyoKKyAqICBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIGhvc3QgRE1BIGRlc3RpbmF0aW9uIGFkZHJlc3MKKyAqICByZWdpc3Rlci4KKyAqLworI2RlZmluZSBIREFSX0hPU1RfQUREUl9NQVNLICAgICAgICAgICAgICAgICAgICAgMHhGRkZGRkZGRgorI2RlZmluZSBIREFSX0RTUF9BRERSX01BU0sgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwRkZGRgorI2RlZmluZSBIREFSX01FTUlEX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDBGMDAwMAorI2RlZmluZSBIREFSX01FTUlEX1NQX0RNRU0wICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMAorI2RlZmluZSBIREFSX01FTUlEX1NQX0RNRU0xICAgICAgICAgICAgICAgICAgICAgMHgwMDAxMDAwMAorI2RlZmluZSBIREFSX01FTUlEX1NQX1BNRU0gICAgICAgICAgICAgICAgICAgICAgMHgwMDAyMDAwMAorI2RlZmluZSBIREFSX01FTUlEX1NQX0RFQlVHICAgICAgICAgICAgICAgICAgICAgMHgwMDAzMDAwMAorI2RlZmluZSBIREFSX01FTUlEX09NTklfTUVNICAgICAgICAgICAgICAgICAgICAgMHgwMDBFMDAwMAorI2RlZmluZSBIREFSX0VORCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg0MDAwMDAwMAorI2RlZmluZSBIREFSX0VSUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg4MDAwMDAwMAorCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgaG9zdCBETUEgY29udHJvbCByZWdpc3Rlci4KKyAqLworI2RlZmluZSBIRE1SX0FDX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwRjAwMAorI2RlZmluZSBIRE1SX0FDXzhfMTYgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMTAwMAorI2RlZmluZSBIRE1SX0FDX01fUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMjAwMAorI2RlZmluZSBIRE1SX0FDX0JfTCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwNDAwMAorI2RlZmluZSBIRE1SX0FDX1NfVSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwODAwMAorCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgaG9zdCBETUEgY29udHJvbCByZWdpc3Rlci4KKyAqLworI2RlZmluZSBIRENSX0NPVU5UX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDNGRgorI2RlZmluZSBIRENSX0RPTkUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwNDAwMAorI2RlZmluZSBIRENSX09QVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwODAwMAorI2RlZmluZSBIRENSX1dCRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDQwMDAwMAorI2RlZmluZSBIRENSX1dCUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDgwMDAwMAorI2RlZmluZSBIRENSX0RNU19NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwNzAwMDAwMAorI2RlZmluZSBIRENSX0RNU19MSU5FQVIgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMAorI2RlZmluZSBIRENSX0RNU18xNl9EV09SRFMgICAgICAgICAgICAgICAgICAgICAgMHgwMTAwMDAwMAorI2RlZmluZSBIRENSX0RNU18zMl9EV09SRFMgICAgICAgICAgICAgICAgICAgICAgMHgwMjAwMDAwMAorI2RlZmluZSBIRENSX0RNU182NF9EV09SRFMgICAgICAgICAgICAgICAgICAgICAgMHgwMzAwMDAwMAorI2RlZmluZSBIRENSX0RNU18xMjhfRFdPUkRTICAgICAgICAgICAgICAgICAgICAgMHgwNDAwMDAwMAorI2RlZmluZSBIRENSX0RNU18yNTZfRFdPUkRTICAgICAgICAgICAgICAgICAgICAgMHgwNTAwMDAwMAorI2RlZmluZSBIRENSX0RNU181MTJfRFdPUkRTICAgICAgICAgICAgICAgICAgICAgMHgwNjAwMDAwMAorI2RlZmluZSBIRENSX0RNU18xMDI0X0RXT1JEUyAgICAgICAgICAgICAgICAgICAgMHgwNzAwMDAwMAorI2RlZmluZSBIRENSX0RIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwODAwMDAwMAorI2RlZmluZSBIRENSX1NNU19NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg3MDAwMDAwMAorI2RlZmluZSBIRENSX1NNU19MSU5FQVIgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMAorI2RlZmluZSBIRENSX1NNU18xNl9EV09SRFMgICAgICAgICAgICAgICAgICAgICAgMHgxMDAwMDAwMAorI2RlZmluZSBIRENSX1NNU18zMl9EV09SRFMgICAgICAgICAgICAgICAgICAgICAgMHgyMDAwMDAwMAorI2RlZmluZSBIRENSX1NNU182NF9EV09SRFMgICAgICAgICAgICAgICAgICAgICAgMHgzMDAwMDAwMAorI2RlZmluZSBIRENSX1NNU18xMjhfRFdPUkRTICAgICAgICAgICAgICAgICAgICAgMHg0MDAwMDAwMAorI2RlZmluZSBIRENSX1NNU18yNTZfRFdPUkRTICAgICAgICAgICAgICAgICAgICAgMHg1MDAwMDAwMAorI2RlZmluZSBIRENSX1NNU181MTJfRFdPUkRTICAgICAgICAgICAgICAgICAgICAgMHg2MDAwMDAwMAorI2RlZmluZSBIRENSX1NNU18xMDI0X0RXT1JEUyAgICAgICAgICAgICAgICAgICAgMHg3MDAwMDAwMAorI2RlZmluZSBIRENSX1NIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg4MDAwMDAwMAorI2RlZmluZSBIRENSX0NPVU5UX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgMAorCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgcGVyZm9ybWFuY2UgbW9uaXRvciBjb250cm9sCisgKiAgcmVnaXN0ZXIuCisgKi8KKyNkZWZpbmUgUEZNQ19DMVNTX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMUYKKyNkZWZpbmUgUEZNQ19DMUVWICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMjAKKyNkZWZpbmUgUEZNQ19DMVJTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDgwMDAKKyNkZWZpbmUgUEZNQ19DMlNTX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAxRjAwMDAKKyNkZWZpbmUgUEZNQ19DMkVWICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAyMDAwMDAKKyNkZWZpbmUgUEZNQ19DMlJTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4ODAwMDAwMDAKKyNkZWZpbmUgUEZNQ19DMVNTX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgIDAKKyNkZWZpbmUgUEZNQ19DMlNTX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgIDE2CisjZGVmaW5lIFBGTUNfQlVTX0dSQU5UICAgICAgICAgICAgICAgICAgICAgICAgICAwCisjZGVmaW5lIFBGTUNfR1JBTlRfQUZURVJfUkVRICAgICAgICAgICAgICAgICAgICAxCisjZGVmaW5lIFBGTUNfVFJBTlNBQ1RJT04gICAgICAgICAgICAgICAgICAgICAgICAyCisjZGVmaW5lIFBGTUNfRFdPUkRfVFJBTlNGRVIgICAgICAgICAgICAgICAgICAgICAzCisjZGVmaW5lIFBGTUNfU0xBVkVfUkVBRCAgICAgICAgICAgICAgICAgICAgICAgICA0CisjZGVmaW5lIFBGTUNfU0xBVkVfV1JJVEUgICAgICAgICAgICAgICAgICAgICAgICA1CisjZGVmaW5lIFBGTUNfUFJFRU1QVElPTiAgICAgICAgICAgICAgICAgICAgICAgICA2CisjZGVmaW5lIFBGTUNfRElTQ09OTkVDVF9SRVRSWSAgICAgICAgICAgICAgICAgICA3CisjZGVmaW5lIFBGTUNfSU5URVJSVVBUICAgICAgICAgICAgICAgICAgICAgICAgICA4CisjZGVmaW5lIFBGTUNfQlVTX09XTkVSU0hJUCAgICAgICAgICAgICAgICAgICAgICA5CisjZGVmaW5lIFBGTUNfVFJBTlNBQ1RJT05fTEFHICAgICAgICAgICAgICAgICAgICAxMAorI2RlZmluZSBQRk1DX1BDSV9DTE9DSyAgICAgICAgICAgICAgICAgICAgICAgICAgMTEKKyNkZWZpbmUgUEZNQ19TRVJJQUxfQ0xPQ0sgICAgICAgICAgICAgICAgICAgICAgIDEyCisjZGVmaW5lIFBGTUNfU1BfQ0xPQ0sgICAgICAgICAgICAgICAgICAgICAgICAgICAxMworCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgcGVyZm9ybWFuY2UgY291bnRlciB2YWx1ZSAxCisgKiAgcmVnaX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AgIDB4MDAwMDAwMEMKKyNkZWZpbmUgQ0xLQ1IxX1BMTFAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMTAKKyNkZWZpbmUgQ0xLQ1IxX1NXQ0UgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMjAKKyNkZWZpbmUgQ0xLQ1IxX1BMTE9TICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwNDAKKworLyoKKyAqICBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIGNsb2NrIGNvbnRyb2wgcmVnaXN0ZXIgMi4KKyAqLworI2RlZmluZSBDTEtDUjJfUERJVlNfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwRgorI2RlZmluZSBDTEtDUjJfUERJVlNfMSAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMQorI2RlZmluZSBDTEtDUjJfUERJVlNfMiAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMgorI2RlZmluZSBDTEtDUjJfUERJVlNfNCAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNAorI2RlZmluZSBDTEtDUjJfUERJVlNfNyAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNworI2RlZmluZSBDTEtDUjJfUERJVlNfOCAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwOAorI2RlZmluZSBDTEtDUjJfUERJVlNfMTYgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMAorCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgUExMIG11bHRpcGxpZXIgcmVnaXN0ZXIuCisgKi8KKyNkZWZpbmUgUExMTV9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwRkYKKyNkZWZpbmU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mluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIGNvbmZpZ3VyYXRpb24gbG9hZCAyCisgKiAgcmVnaXN0ZXIuCisgKi8KKyNkZWZpbmUgQ0ZMMl9WQUxJRF9EQVRBX01BU0sgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwRkYKKworLyoKKyAqICBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIHNlcmlhbCBwb3J0IG1hc3RlciBjb250cm9sCisgKiAgcmVnaXN0ZXIgMS4KKyAqLworI2RlZmluZSBTRVJNQzFfTVNQRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMQorI2RlZmluZSBTRVJNQzFfUFRDX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwRQorI2RlZmluZSBTRVJNQzFfUFRDX0NTNDIzWCAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMAorI2RlZmluZSBTRVJNQzFfUFRDX0FDOTcgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMgorI2RlZmluZSBTRVJNQzFfUFRDX0RBQyAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNAorI2RlZmluZSBTRVJNQzFfUExCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAxMAorI2RlZmluZSBTRVJNQzFfWExCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAyMAorCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgc2VyaWFsIHBvcnQgbWFzdGVyIGNvbnRyb2wKKyAqICByZWdpc3RlciAyLgorICovCisjZGVmaW5lIFNFUk1DMl9MUk9FICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAxCisjZGVmaW5lIFNFUk1DMl9NQ09FICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAyCisjZGVmaW5lIFNFUk1DMl9NQ0RJViAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA0CisKKy8qCisgKiAgVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBzZXJpYWwgcG9ydCAxIGNvbmZpZ3VyYXRpb24KKyAqICByZWdpc3Rlci4KKyAqLworI2RlZmluZSBTRVJDMV9TTzFFTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMQorI2RlZmluZSBTRVJDMV9TTzFGX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwRQorI2RlZmluZSBTRVJDMV9TTzFGX0NTNDIzWCAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMAorI2RlZmluZSBTRVJDMV9TTzFGX0FDOTcgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMgorI2RlZmluZSBTRVJDMV9TTzFGX0RBQyAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNAorI2RlZmluZSBTRVJDMV9TTzFGX1NQRElGICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNgorCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgc2VyaWFsIHBvcnQgMiBjb25maWd1cmF0aW9uCisgKiAgcmVnaXN0ZXIuCisgKi8KKyNkZWZpbmUgU0VSQzJfU0kxRU4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDEKKyNkZWZpbmUgU0VSQzJfU0kxRl9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMEUKKyNkZWZpbmUgU0VSQzJfU0kxRl9DUzQyM1ggICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDAKKyNkZWZpbmUgU0VSQzJfU0kxRl9BQzk3ICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDIKKyNkZWZpbmUgU0VSQzJfU0kxRl9BREMgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDQKKyNkZWZpbmUgU0VSQzJfU0kxRl9TUERJRiAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDYKKworLyoKKyAqICBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIHNlcmlhbCBwb3J0IDMgY29uZmlndXJhdGlvbgorICogIHJlZ2lzdGVyLgorICovCisjZGVmaW5lIFNFUkMzX1NPMkVOICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAxCisjZGVmaW5lIFNFUkMzX1NPMkZfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA2CisjZGVmaW5lIFNFUkMzX1NPMkZfREFDICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAwCisjZGVmaW5lIFNFUkMzX1NPMkZfU1BESUYgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAyCisKKy8qCisgKiAgVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBzZXJpYWwgcG9ydCA0IGNvbmZpZ3VyYXRpb24KKyAqICByZWdpc3Rlci4KKyAqLworI2RlZmluZSBTRVJDNF9TTzNFTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMQorI2RlZmluZSBTRVJDNF9TTzNGX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNgorI2RlZmluZSBTRVJDNF9TTzNGX0RBQyAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMAorI2RlZmluZSBTRVJDNF9TTzNGX1NQRElGICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMgorCisvKgorICogIFRoZSBmb2x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cG9ydCBiYWNrZG9vciBjb21tYW5kCisgKiAgcmVnaXN0ZXIuCisgKi8KKyNkZWZpbmUgU0VSQkNNX1JEQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDEKKyNkZWZpbmUgU0VSQkNNX1dSQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDIKKworLyoKKyAqICBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIHNlcmlhbCBwb3J0IGJhY2tkb29yIGFkZHJlc3MKKyAqICByZWdpc3Rlci4KKyAqLworI2lmZGVmIE5PX0NTNDYxMgorI2RlZmluZSBTRVJCQURfRkFEX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDBGRgorI2Vsc2UKKyNkZWZpbmUgU0VSQkFEX0ZBRF9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxRkYKKyNlbmRpZgorI2RlZmluZSBTRVJCQURfRkFEX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgMAorCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgc2VyaWFsIHBvcnQgYmFja2Rvb3IKKyAqICBjb25maWd1cmF0aW9uIHJlZ2lzdGVyLgorICovCisjZGVmaW5lIFNFUkJDRl9IQlAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAxCisKKy8qCisgKiAgVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBzZXJpYWwgcG9ydCBiYWNrZG9vciB3cml0ZQorICogIHBvcnQgcmVnaXN0ZXIuCisgKi8KKyNkZWZpbmUgU0VSQldQX0ZXRF9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwRkZGRkYKKyNkZWZpbmUgU0VSQldQX0ZXRF9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgIDAKKworLyoKKyAqICBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIHNlcmlhbCBwb3J0IGJhY2tkb29yIHJlYWQKKyAqICBwb3J0IHJlZ2lzdGVyLgorICovCisjZGVmaW5lIFNFUkJSUF9GUkRfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMEZGRkZGCisjZGVmaW5lIFNFUkJSUF9GUkRfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAwCisKKy8qCisgKiAgVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBhc3luYyBGSUZPIGFkZHJlc3MgcmVnaXN0ZXIuCisgKi8KKyNpZm5kZWYgTk9fQ1M0NjEyCisjZGVmaW5lIEFTRVJfRkFERFJfQTFfTUFTSyAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMUZGCisjZGVmaW5lIEFTRVJfRkFERFJfRU4xICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDA4MDAwCisjZGVmaW5lIEFTRVJfRkFERFJfQTJfTUFTSyAgICAgICAgICAgICAgICAgICAgICAweDAxRkYwMDAwCisjZGVmaW5lIEFTRVJfRkFERFJfRU4yICAgICAgICAgICAgICAgICAgICAgICAgICAweDgwMDAwMDAwCisjZGVmaW5lIEFTRVJfRkFERFJfQTFfU0hJRlQgICAgICAgICAgICAgICAgICAgICAwCisjZGVmaW5lIEFTRVJfRkFERFJfQTJfU0hJRlQgICAgICAgICAgICAgICAgICAgICAxNgorI2VuZGlmCisKKy8qCisgKiAgVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBBQzk3IGNvbnRyb2wgcmVnaXN0ZXIuCisgKi8KKyNkZWZpbmUgQUNDVExfUlNUTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDEKKyNkZWZpbmUgQUNDVExfRVNZTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDIKKyNkZWZpbmUgQUNDVExfVkZSTSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDQKKyNkZWZpbmUgQUNDVExfRENWICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDgKKyNkZWZpbmUgQUNDVExfQ1JXICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMTAKKyNkZWZpbmUgQUNDVExfQVNZTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMjAKKyNpZm5kZWYgTk9fQ1M0NjEyCisjZGVmaW5lIEFDQ1RMX1RDICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDQwCisjZW5kaWYKKworLyoKKyAqICBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIEFDOTcgc3RhdHVzIHJlZ2lzdGVyLgorICovCisjZGVmaW5lIEFDU1RTX0NSRFkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAxCisjZGVmaW5lIEFDU1RTX1ZTVFMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAyCisjaWZuZGVmIE5PX0NTNDYxMgorI2RlZmluZSBBQ1NUU19XS1VQICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNAorI2VuZGlmCisKKy8qCisgKiAgVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBBQzk3IG91dHB1dCBzbG90IHZhbGlkCisgKiAgcmVnaXN0ZXIuCisgKi8KKyNkZWZpbmUgQUNPU1ZfU0xWMyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDEKKyNkZWZpbmUgQUNPU1ZfU0xWNCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDIKKyNkZWZpbmUgQUNPU1ZfU0xWNSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDQKKyNkZWZpbmUgQUNPU1ZfU0xWNiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDgKKyNkZWZpbmUgQUNPU1ZfU0xWNyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMTAKKyNkZWZpbmUgQUNPU1ZfU0xWOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMjAKKyNkZWZpbmUgQUNPU1ZfU0xWOSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwNDAKKyNkZWZpbmUgQUNPU1ZfU0xWMTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwODAKKyNkZWZpbmUgQUNPU1ZfU0xWMTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxMDAKKyNkZWZpbmUgQUNPU1ZfU0xWMTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAyMDAKKworLyoKKyAqICBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIEFDOTcgY29tbWFuZCBhZGRyZXNzCisgKiAgcmVnaXN0ZXIuCisgKi8KKyNkZWZpbmUgQUNDQURfQ0lfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwN0YKKyNkZWZpbmUgQUNDQURfQ0lfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgIDAKKworLyoKKyAqICBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIEFDOTcgY29tbWFuZCBkYXRhIHJlZ2lzdGVyLgorICovCisjZGVmaW5lIEFDQ0RBX0NEX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDBGRkZGCisjZGVmaW5lIEFDQ0RBX0NEX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgICAwCisKKy8qCisgKiAgVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBBQzk3IGlucHV0IHNsb3QgdmFsaWQKKyAqICByZWdpc3Rlci4KKyAqLworI2RlZmluZSBBQ0lTVl9JU1YzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMQorI2RlZmluZSBBQ0lTVl9JU1Y0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMgorI2RlZmluZSBBQ0lTVl9JU1Y1ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNAorI2RlZmluZSBBQ0lTVl9JU1Y2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwOAorI2RlZmluZSBBQ0lTVl9JU1Y3ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAxMAorI2RlZmluZSBBQ0lTVl9JU1Y4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAyMAorI2RlZmluZSBBQ0lTVl9JU1Y5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA0MAorI2RlZmluZSBBQ0lTVl9JU1YxMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA4MAorI2RlZmluZSBBQ0lTVl9JU1YxMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDEwMAorI2RlZmluZSBBQ0lTVl9JU1YxMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDIwMAorCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgQUM5NyBzdGF0dXMgYWRkcmVzcworICogIHJlZ2lzdGVyLgorICovCisjZGVmaW5lIEFDU0FEX1NJX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDdGCisjZGVmaW5lIEFDU0FEX1NJX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgICAwCisKKy8qCisgKiAgVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBBQzk3IHN0YXR1cyBkYXRhIHJlZ2lzdGVyLgorICovCisjZGVmaW5lIEFDU0RBX1NEX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDBGRkZGCisjZGVmaW5lIEFDU0RBX1NEX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgICAwCisKKy8qCisgKiAgVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBqb3lzdGljayBwb2xsL3RyaWdnZXIKKyAqICByZWdpc3Rlci4KKyAqLworI2RlZmluZSBKU1BUX0NBWCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMQorI2RlZmluZSBKU1BUX0NBWSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMgorI2RlZmluZSBKU1BUX0NCWCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNAorI2RlZmluZSBKU1BUX0NCWSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwOAorI2RlZmluZSBKU1BUX0JBMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAxMAorI2RlZmluZSBKU1BUX0JBMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAyMAorI2RlZmluZSBKU1BUX0JCMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA0MAorI2RlZmluZSBKU1BUX0JCMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA4MAorCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgam95c3RpY2sgY29udHJvbCByZWdpc3Rlci4KKyAqLworI2RlZmluZSBKU0NUTF9TUF9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMworI2RlZmluZSBKU0NUTF9TUF9TTE9XICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMAorI2RlZmluZSBKU0NUTF9TUF9NRURJVU1fU0xPVyAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMQorI2RlZmluZSBKU0NUTF9TUF9NRURJVU1fRkFTVCAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMgorI2RlZmluZSBKU0NUTF9TUF9GQVNUICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMworI2RlZmluZSBKU0NUTF9BUkUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNAorCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgam95c3RpY2sgY29vcmRpbmF0ZSBwYWlyIDEKKyAqICByZWFkYmFjayByZWdpc3Rlci4KKyAqLworI2RlZmluZSBKU0MxX1kxVl9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwRkZGRgorI2RlZmluZSBKU0MxX1gxVl9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhGRkZGMDAwMAorI2RlZmluZSBKU0MxX1kxVl9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAgMAorI2RlZmluZSBKU0MxX1gxVl9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAgMTYKKworLyoKKyAqICBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIGpveXN0aWNrIGNvb3JkaW5hdGUgcGFpciAyCisgKiAgcmVhZGJhY2sgcmVnaXN0ZXIuCisgKi8KKyNkZWZpbmUgSlNDMl9ZMlZfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMEZGRkYKKyNkZWZpbmUgSlNDMl9YMlZfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4RkZGRjAwMDAKKyNkZWZpbmUgSlNDMl9ZMlZfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgIDAKKyNkZWZpbmUgSlNDMl9YMlZfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgIDE2CisKKy8qCisgKiAgVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBNSURJIGNvbnRyb2wgcmVnaXN0ZXIuCisgKi8KKyNkZWZpbmUgTUlEQ1JfVFhFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDEJLyogRW5hYmxlIHRyYW5zbWl0dGluZy4gKi8KKyNkZWZpbmUgTUlEQ1JfUlhFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDIJLyogRW5hYmxlIHJlY2VpdmluZy4gKi8KKyNkZWZpbmUgTUlEQ1JfUklFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDQJLyogSW50ZXJydXB0IHVwb24gdHggcmVhZHkuICovCisjZGVmaW5lIE1JRENSX1RJRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA4CS8qIEludGVycnVwdCB1cG9uIHJ4IHJlYWR5LiAqLworI2RlZmluZSBNSURDUl9NTEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAxMAkvKiBFbmFibGUgbWlkaSBsb29wYmFjay4gKi8KKyNkZWZpbmUgTUlEQ1JfTVJTVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMjAJLyogUmVzZXQgaW50ZXJmYWNlLiAqLworCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgTUlESSBzdGF0dXMgcmVnaXN0ZXIuCisgKi8KKyNkZWZpbmUgTUlEU1JfVEJGICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDEJLyogVHggRklGTyBpcyBmdWxsLiAqLworI2RlZmluZSBNSURTUl9SQkUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMgkvKiBSeCBGSUZPIGlzIGVtcHR5LiAqLworCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgTUlESSB3cml0ZSBwb3J0IHJlZ2lzdGVyLgorICovCisjZGVmaW5lIE1JRFdQX01XRF9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMEZGCisjZGVmaW5lIE1JRFdQX01XRF9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAwCisKKy8qCisgKiAgVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBNSURJIHJlYWQgcG9ydCByZWdpc3Rlci4KKyAqLworI2RlZmluZSBNSURSUF9NUkRfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDBGRgorI2RlZmluZSBNSURSUF9NUkRfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgMAorCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgam95c3RpY2sgR1BJTyByZWdpc3Rlci4KKyAqLworI2RlZmluZSBKU0lPX0RBWCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMQorI2RlZmluZSBKU0lPX0RBWSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMgorI2RlZmluZSBKU0lPX0RCWCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNAorI2RlZmluZSBKU0lPX0RCWSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwOAorI2RlZmluZSBKU0lPX0FYT0UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAxMAorI2RlZmluZSBKU0lPX0FZT0UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAyMAorI2RlZmluZSBKU0lPX0JYT0UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA0MAorI2RlZmluZSBKU0lPX0JZT0UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA4MAorCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgbWFzdGVyIGFzeW5jL3N5bmMgc2VyaWFsCisgKiAgcG9ydCBlbmFibGUgcmVnaXN0ZXIuCisgKi8KKyNpZm5kZWYgTk9fQ1M0NjEyCisjZGVmaW5lIEFTRVJfTUFTVEVSX01FICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAxCisjZW5kaWYKKworLyoKKyAqICBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIGNvbmZpZ3VyYXRpb24gaW50ZXJmYWNlCisgKiAgcmVnaXN0ZXIuCisgKi8KKyNkZWZpbmUgQ0ZHSV9DTEsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDEKKyNkZWZpbmUgQ0ZHSV9ET1VUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDIKKyNkZWZpbmUgQ0ZHSV9ESU5fRUVOICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDQKKyNkZWZpbmUgQ0ZHSV9FRUxEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDgKKworLyoKKyAqICBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIHN1YnN5c3RlbSBJRCBhbmQgdmVuZG9yIElECisgKiAgcmVnaXN0ZXIuCisgKi8KKyNkZWZpbmUgU1NWSURfVklEX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMEZGRkYKKyNkZWZpbmUgU1NWSURfU0lEX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgIDB4RkZGRjAwMDAKKyNkZWZpbmUgU1NWSURfVklEX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgIDAKKyNkZWZpbmUgU1NWSURfU0lEX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgIDE2CisKKy8qCisgKiAgVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBHUElPIHBpbiBpbnRlcmZhY2UgcmVnaXN0ZXIuCisgKi8KKyNkZWZpbmUgR1BJT1JfVk9MRE4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDEKKyNkZWZpbmUgR1BJT1JfVk9MVVAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDIKKyNkZWZpbmUgR1BJT1JfU0kyRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDQKKyNkZWZpbmUgR1BJT1JfU0kyT0UgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDgKKworLyoKKyAqICBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIGV4dGVuZGVkIEdQSU8gcGluIGRpcmVjdGlvbgorICogIHJlZ2lzdGVyLgorICovCisjaWZuZGVmIE5PX0NTNDYxMgorI2RlZmluZSBFR1BJT0RSX0dQT0UwICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMQorI2RlZmluZSBFR1BJT0RSX0dQT0UxICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMgorI2RlZmluZSBFR1BJT0RSX0dQT0UyICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNAorI2RlZmluZSBFR1BJT0RSX0dQT0UzICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwOAorI2RlZmluZSBFR1BJT0RSX0dQT0U0ICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAxMAorI2RlZmluZSBFR1BJT0RSX0dQT0U1ICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAyMAorI2RlZmluZSBFR1BJT0RSX0dQT0U2ICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA0MAorI2RlZmluZSBFR1BJT0RSX0dQT0U3ICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA4MAorI2RlZmluZSBFR1BJT0RSX0dQT0U4ICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDEwMAorI2VuZGlmCisKKy8qCisgKiAgVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBleHRlbmRlZCBHUElPIHBpbiBwb2xhcml0eS8KKyAqICB0eXBlIHJlZ2lzdGVyLgorICovCisjaWZuZGVmIE5PX0NTNDYxMgorI2RlZmluZSBFR1BJT1BUUl9HUFBUMCAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMQorI2RlZmluZSBFR1BJT1BUUl9HUFBUMSAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMgorI2RlZmluZSBFR1BJT1BUUl9HUFBUMiAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNAorI2RlZmluZSBFR1BJT1BUUl9HUFBUMyAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwOAorI2RlZmluZSBFR1BJT1BUUl9HUFBUNCAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAxMAorI2RlZmluZSBFR1BJT1BUUl9HUFBUNSAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAyMAorI2RlZmluZSBFR1BJT1BUUl9HUFBUNiAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA0MAorI2RlZmluZSBFR1BJT1BUUl9HUFBUNyAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA4MAorI2RlZmluZSBFR1BJT1BUUl9HUFBUOCAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDEwMAorI2VuZGlmCisKKy8qCisgKiAgVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBleHRlbmRlZCBHUElPIHBpbiBzdGlja3kKKyAqICByZWdpc3Rlci4KKyAqLworI2lmbmRlZiBOT19DUzQ2MTIKKyNkZWZpbmUgRUdQSU9UUl9HUFMwICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDEKKyNkZWZpbmUgRUdQSU9UUl9HUFMxICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDIKKyNkZWZpbmUgRUdQSU9UUl9HUFMyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDQKKyNkZWZpbmUgRUdQSU9UUl9HUFMzICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDgKKyNkZWZpbmUgRUdQSU9UUl9HUFM0ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMTAKKyNkZWZpbmUgRUdQSU9UUl9HUFM1ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMjAKKyNkZWZpbmUgRUdQSU9UUl9HUFM2ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwNDAKKyNkZWZpbmUgRUdQSU9UUl9HUFM3ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwODAKKyNkZWZpbmUgRUdQSU9UUl9HUFM4ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxMDAKKyNlbmRpZgorCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgZXh0ZW5kZWQgR1BJTyBwaW5nIHdha2V1cAorICogIHJlZ2lzdGVyLgorICovCisjaWZuZGVmIE5PX0NTNDYxMgorI2RlZmluZSBFR1BJT1dSX0dQVzAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMQorI2RlZmluZSBFR1BJT1dSX0dQVzEgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMgorI2RlZmluZSBFR1BJT1dSX0dQVzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNAorI2RlZmluZSBFR1BJT1dSX0dQVzMgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwOAorI2RlZmluZSBFR1BJT1dSX0dQVzQgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAxMAorI2RlZmluZSBFR1BJT1dSX0dQVzUgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAyMAorI2RlZmluZSBFR1BJT1dSX0dQVzYgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA0MAorI2RlZmluZSBFR1BJT1dSX0dQVzcgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA4MAorI2RlZmluZSBFR1BJT1dSX0dQVzggICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDEwMAorI2VuZGlmCisKKy8qCisgKiAgVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBleHRlbmRlZCBHUElPIHBpbiBzdGF0dXMKKyAqICByZWdpc3Rlci4KKyAqLworI2lmbmRlZiBOT19DUzQ2MTIKKyNkZWZpbmUgRUdQSU9TUl9HUFMwICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDEKKyNkZWZpbmUgRUdQSU9TUl9HUFMxICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDIKKyNkZWZpbmUgRUdQSU9TUl9HUFMyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDQKKyNkZWZpbmUgRUdQSU9TUl9HUFMzICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDgKKyNkZWZpbmUgRUdQSU9TUl9HUFM0ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMTAKKyNkZWZpbmUgRUdQSU9TUl9HUFM1ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMjAKKyNkZWZpbmUgRUdQSU9TUl9HUFM2ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwNDAKKyNkZWZpbmUgRUdQSU9TUl9HUFM3ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwODAKKyNkZWZpbmUgRUdQSU9TUl9HUFM4ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxMDAKKyNlbmRpZgorCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgc2VyaWFsIHBvcnQgNiBjb25maWd1cmF0aW9uCisgKiAgcmVnaXN0ZXIuCisgKi8KKyNpZm5kZWYgTk9fQ1M0NjEyCisjZGVmaW5lIFNFUkM2X0FTRE8yRU4gICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAxCisjZW5kaWYKKworLyoKKyAqICBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIHNlcmlhbCBwb3J0IDcgY29uZmlndXJhdGlvbgorICogIHJlZ2lzdGVyLgorICovCisjaWZuZGVmIE5PX0NTNDYxMgorI2RlZmluZSBTRVJDN19BU0RJMkVOICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMQorI2RlZmluZSBTRVJDN19QT1NJTEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMgorI2RlZmluZSBTRVJDN19TSVBPTEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNAorI2RlZmluZSBTRVJDN19TT1NJTEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwOAorI2RlZmluZSBTRVJDN19TSVNPTEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAxMAorI2VuZGlmCisKKy8qCisgKiAgVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBzZXJpYWwgcG9ydCBBQyBsaW5rCisgKiAgY29uZmlndXJhdGlvbiByZWdpc3Rlci4KKyAqLworI2lmbmRlZiBOT19DUzQ2MTIKKyNkZWZpbmUgU0VSQUNDX0NPREVDX1RZUEVfTUFTSyAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDEKKyNkZWZpbmUgU0VSQUNDX0NPREVDX1RZUEVfMV8wMyAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDAKKyNkZWZpbmUgU0VSQUNDX0NPREVDX1RZUEVfMl8wICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDEKKyNkZWZpbmUgU0VSQUNDX1RXT19DT0RFQ1MgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDIKKyNkZWZpbmUgU0VSQUNDX01ETSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDQKKyNkZWZpbmUgU0VSQUNDX0hTUCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDgKKyNlbmRpZgorCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgQUM5NyBjb250cm9sIHJlZ2lzdGVyIDIuCisgKi8KKyNpZm5kZWYgTk9fQ1M0NjEyCisjZGVmaW5lIEFDQ1RMMl9SU1ROICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAxCisjZGVmaW5lIEFDQ1RMMl9FU1lOICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAyCisjZGVmaW5lIEFDQ1RMMl9WRlJNICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA0CisjZGVmaW5lIEFDQ1RMMl9EQ1YgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA4CisjZGVmaW5lIEFDQ1RMMl9DUlcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDEwCisjZGVmaW5lIEFDQ1RMMl9BU1lOICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDIwCisjZW5kaWYKKworLyoKKyAqICBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIEFDOTcgc3RhdHVzIHJlZ2lzdGVyIDIuCisgKi8KKyNpZm5kZWYgTk9fQ1M0NjEyCisjZGVmaW5lIEFDU1RTMl9DUkRZICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAxCisjZGVmaW5lIEFDU1RTMl9WU1RTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAyCisjZW5kaWYKKworLyoKKyAqICBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIEFDOTcgb3V0cHV0IHNsb3QgdmFsaWQKKyAqICByZWdpc3RlciAyLgorICovCisjaWZuZGVmIE5PX0NTNDYxMgorI2RlZmluZSBBQ09TVjJfU0xWMyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMQorI2RlZmluZSBBQ09TVjJfU0xWNCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMgorI2RlZmluZSBBQ09TVjJfU0xWNSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNAorI2RlZmluZSBBQ09TVjJfU0xWNiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwOAorI2RlZmluZSBBQ09TVjJfU0xWNyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAxMAorI2RlZmluZSBBQ09TVjJfU0xWOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAyMAorI2RlZmluZSBBQ09TVjJfU0xWOSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA0MAorI2RlZmluZSBBQ09TVjJfU0xWMTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA4MAorI2RlZmluZSBBQ09TVjJfU0xWMTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDEwMAorI2RlZmluZSBBQ09TVjJfU0xWMTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDIwMAorI2VuZGlmCisKKy8qCisgKiAgVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBBQzk3IGNvbW1hbmQgYWRkcmVzcworICogIHJlZ2lzdGVyIDIuCisgKi8KKyNpZm5kZWYgTk9fQ1M0NjEyCisjZGVmaW5lIEFDQ0FEMl9DSV9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDdGCisjZGVmaW5lIEFDQ0FEMl9DSV9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAwCisjZW5kaWYKKworLyoKKyAqICBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIEFDOTcgY29tbWFuZCBkYXRhIHJlZ2lzdGVyCisgKiAgMi4KKyAqLworI2lmbmRlZiBOT19DUzQ2MTIKKyNkZWZpbmUgQUNDREEyX0NEX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMEZGRkYKKyNkZWZpbmUgQUNDREEyX0NEX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgIDAgIAorI2VuZGlmCisKKy8qCisgKiAgVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBBQzk3IGlucHV0IHNsb3QgdmFsaWQKKyAqICByZWdpc3RlciAyLgorICovCisjaWZuZGVmIE5PX0NTNDYxMgorI2RlZmluZSBBQ0lTVjJfSVNWMyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMQorI2RlZmluZSBBQ0lTVjJfSVNWNCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMgorI2RlZmluZSBBQ0lTVjJfSVNWNSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNAorI2RlZmluZSBBQ0lTVjJfSVNWNiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwOAorI2RlZmluZSBBQ0lTVjJfSVNWNyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAxMAorI2RlZmluZSBBQ0lTVjJfSVNWOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAyMAorI2RlZmluZSBBQ0lTVjJfSVNWOSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA0MAorI2RlZmluZSBBQ0lTVjJfSVNWMTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA4MAorI2RlZmluZSBBQ0lTVjJfSVNWMTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDEwMAorI2RlZmluZSBBQ0lTVjJfSVNWMTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDIwMAorI2VuZGlmCisKKy8qCisgKiAgVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBBQzk3IHN0YXR1cyBhZGRyZXNzCisgKiAgcmVnaXN0ZXIgMi4KKyAqLworI2lmbmRlZiBOT19DUzQ2MTIKKyNkZWZpbmUgQUNTQUQyX1NJX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwN0YKKyNkZWZpbmUgQUNTQUQyX1NJX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgIDAKKyNlbmRpZgorCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgQUM5NyBzdGF0dXMgZGF0YSByZWdpc3RlciAyLgorICovCisjaWZuZGVmIE5PX0NTNDYxMgorI2RlZmluZSBBQ1NEQTJfU0RfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwRkZGRgorI2RlZmluZSBBQ1NEQTJfU0RfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgMAorI2VuZGlmCisKKy8qCisgKiAgVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBJL08gdHJhcCBhZGRyZXNzIGFuZCBjb250cm9sCisgKiAgcmVnaXN0ZXJzIChhbGwgMTIpLgorICovCisjaWZuZGVmIE5PX0NTNDYxMgorI2RlZmluZSBJT1RBQ19TQV9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwRkZGRgorI2RlZmluZSBJT1RBQ19NU0tfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDBGMDAwMAorI2RlZmluZSBJT1RBQ19JT0RDX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgMHgwNjAwMDAwMAorI2RlZmluZSBJT1RBQ19JT0RDXzE2X0JJVCAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMAorI2RlZmluZSBJT1RBQ19JT0RDXzEwX0JJVCAgICAgICAgICAgICAgICAgICAgICAgMHgwMjAwMDAwMAorI2RlZmluZSBJT1RBQ19JT0RDXzEyX0JJVCAgICAgICAgICAgICAgICAgICAgICAgMHgwNDAwMDAwMAorI2RlZmluZSBJT1RBQ19XU1BJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwODAwMDAwMAorI2RlZmluZSBJT1RBQ19SU1BJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxMDAwMDAwMAorI2RlZmluZSBJT1RBQ19XU0UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgyMDAwMDAwMAorI2RlZmluZSBJT1RBQ19XRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg0MDAwMDAwMAorI2RlZmluZSBJT1RBQ19SRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg4MDAwMDAwMAorI2RlZmluZSBJT1RBQ19TQV9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAgMAorI2RlZmluZSBJT1RBQ19NU0tfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgMTYKKyNlbmRpZgorCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgSS9PIHRyYXAgZmFzdCByZWFkIHJlZ2lzdGVycworICogIChhbGwgOCkuCisgKi8KKyNpZm5kZWYgTk9fQ1M0NjEyCisjZGVmaW5lIElPVEZSX0RfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDBGRkZGCisjZGVmaW5lIElPVEZSX0FfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMEYwMDAwCisjZGVmaW5lIElPVEZSX1JfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDBGMDAwMDAwCisjZGVmaW5lIElPVEZSX0FMTCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDQwMDAwMDAwCisjZGVmaW5lIElPVEZSX1ZMICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDgwMDAwMDAwCisjZGVmaW5lIElPVEZSX0RfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgICAwCisjZGVmaW5lIElPVEZSX0FfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgICAxNgorI2RlZmluZSBJT1RGUl9SX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgICAgMjQKKyNlbmRpZgorCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgSS9PIHRyYXAgRklGTyByZWdpc3Rlci4KKyAqLworI2lmbmRlZiBOT19DUzQ2MTIKKyNkZWZpbmUgSU9URklGT19CQV9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDNGRkYKKyNkZWZpbmUgSU9URklGT19TX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDBGRjAwMDAKKyNkZWZpbmUgSU9URklGT19PRiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4NDAwMDAwMDAKKyNkZWZpbmUgSU9URklGT19TUElPRiAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4ODAwMDAwMDAKKyNkZWZpbmUgSU9URklGT19CQV9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgIDAKKyNkZWZpbmUgSU9URklGT19TX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgIDE2CisjZW5kaWYKKworLyoKKyAqICBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIEkvTyB0cmFwIHJldHJ5IHJlYWQgZGF0YQorICogIHJlZ2lzdGVyLgorICovCisjaWZuZGVmIE5PX0NTNDYxMgorI2RlZmluZSBJT1RSUkRfRF9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwRkZGRgorI2RlZmluZSBJT1RSUkRfUkRWICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg4MDAwMDAwMAorI2RlZmluZSBJT1RSUkRfRF9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAgMAorI2VuZGlmCisKKy8qCisgKiAgVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBJL08gdHJhcCBGSUZPIHBvaW50ZXIKKyAqICByZWdpc3Rlci4KKyAqLworI2lmbmRlZiBOT19DUzQ2MTIKKyNkZWZpbmUgSU9URlBfQ0FfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDNGRkYKKyNkZWZpbmUgSU9URlBfUEFfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4M0ZGRjAwMDAKKyNkZWZpbmUgSU9URlBfQ0FfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgIDAKKyNkZWZpbmUgSU9URlBfUEFfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgIDE2CisjZW5kaWYKKworLyoKKyAqICBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIEkvTyB0cmFwIGNvbnRyb2wgcmVnaXN0ZXIuCisgKi8KKyNpZm5kZWYgTk9fQ1M0NjEyCisjZGVmaW5lIElPVENSX0lURCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAxCisjZGVmaW5lIElPVENSX0hSViAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAyCisjZGVmaW5lIElPVENSX1NSViAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA0CisjZGVmaW5lIElPVENSX0RUSSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA4CisjZGVmaW5lIElPVENSX0RGSSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDEwCisjZGVmaW5lIElPVENSX0REUCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDIwCisjZGVmaW5lIElPVENSX0pURSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDQwCisjZGVmaW5lIElPVENSX1BQRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDgwCisjZW5kaWYKKworLyoKKyAqICBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIGRpcmVjdCBQQ0kgZGF0YSByZWdpc3Rlci4KKyAqLworI2lmbmRlZiBOT19DUzQ2MTIKKyNkZWZpbmUgRFBDSURfRF9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4RkZGRkZGRkYKKyNkZWZpbmUgRFBDSURfRF9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAgIDAKKyNlbmRpZgorCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgZGlyZWN0IFBDSSBhZGRyZXNzIHJlZ2lzdGVyLgorICovCisjaWZuZGVmIE5PX0NTNDYxMgorI2RlZmluZSBEUENJQV9BX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhGRkZGRkZGRgorI2RlZmluZSBEUENJQV9BX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgICAgMAorI2VuZGlmCisKKy8qCisgKiAgVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBkaXJlY3QgUENJIGNvbW1hbmQgcmVnaXN0ZXIuCisgKi8KKyNpZm5kZWYgTk9fQ1M0NjEyCisjZGVmaW5lIERQQ0lDX0NfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDBGCisjZGVmaW5lIERQQ0lDX0NfSU9SRUFEICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAyCisjZGVmaW5lIERQQ0lDX0NfSU9XUklURSAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAzCisjZGVmaW5lIERQQ0lDX0JFX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMEYwCisjZW5kaWYKKworLyoKKyAqICBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIFBDL1BDSSByZXF1ZXN0IHJlZ2lzdGVyLgorICovCisjaWZuZGVmIE5PX0NTNDYxMgorI2RlZmluZSBQQ1BDSVJfUkRDX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNworI2RlZmluZSBQQ1BDSVJfQ19NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwNzAwMAorI2RlZmluZSBQQ1BDSVJfUkVRICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwODAwMAorI2RlZmluZSBQQ1BDSVJfUkRDX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgMAorI2RlZmluZSBQQ1BDSVJfQ19TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAgMTIKKyNlbmRpZgorCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgUEMvUENJIGdyYW50IHJlZ2lzdGVyLgorICovIAorI2lmbmRlZiBOT19DUzQ2MTIKKyNkZWZpbmUgUENQQ0lHX0dEQ19NQVNLICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDcKKyNkZWZpbmUgUENQQ0lHX1ZMICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDgwMDAKKyNkZWZpbmUgUENQQ0lHX0dEQ19TSElGVCAgICAgICAgICAgICAgICAgICAgICAgIDAKKyNlbmRpZgorCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgUEMvUENJIG1hc3RlciBlbmFibGUKKyAqICByZWdpc3Rlci4KKyAqLworI2lmbmRlZiBOT19DUzQ2MTIKKyNkZWZpbmUgUENQQ0lFTl9FTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDEKKyNlbmRpZgorCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgZXh0ZW5kZWQgUENJIHBvd2VyCisgKiAgbWFuYWdlbWVudCBjb250cm9sIHJlZ2lzdGVyLgorICovCisjaWZuZGVmIE5PX0NTNDYxMgorI2RlZmluZSBFUENJUE1DX0dXVSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMQorI2RlZmluZSBFUENJUE1DX0ZTUEMgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMgorI2VuZGlmIAorCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgU1AgY29udHJvbCByZWdpc3Rlci4KKyAqLworI2RlZmluZSBTUENSX1JVTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMQorI2RlZmluZSBTUENSX1NUUEZSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMgorI2RlZmluZSBTUENSX1JVTkZSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNAorI2RlZmluZSBTUENSX1RJQ0sgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwOAorI2RlZmluZSBTUENSX0RSUUVOICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAyMAorI2RlZmluZSBTUENSX1JTVFNQICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA0MAorI2RlZmluZSBTUENSX09SRU4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA4MAorI2lmbmRlZiBOT19DUzQ2MTIKKyNkZWZpbmUgU1BDUl9QQ0lJTlQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxMDAKKyNkZWZpbmUgU1BDUl9PSU5URCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAyMDAKKyNkZWZpbmUgU1BDUl9DUkUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDgwMDAKKyNlbmRpZgorCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgZGVidWcgaW5kZXggcmVnaXN0ZXIuCisgKi8KKyNkZWZpbmUgRFJFR19SRUdJRF9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwN0YKKyNkZWZpbmUgRFJFR19ERUJVRyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwODAKKyNkZWZpbmUgRFJFR19SR0JLX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA3MDAKKyNkZWZpbmUgRFJFR19UUkFQICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA4MDAKKyNpZiAhZGVmaW5lZChOT19DUzQ2MTIpCisjaWYgIWRlZmluZWQoTk9fQ1M0NjE1KQorI2RlZmluZSBEUkVHX1RSQVBYICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMTAwMAorI2VuZGlmCisjZW5kaWYKKyNkZWZpbmUgRFJFR19SRUdJRF9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgIDAKKyNkZWZpbmUgRFJFR19SR0JLX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgIDgKKyNkZWZpbmUgRFJFR19SR0JLX1JFR0lEX01BU0sgICAgICAgICAgICAgICAgICAgIDB4MDAwMDA3N0YKKyNkZWZpbmUgRFJFR19SRUdJRF9SMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMTAKKyNkZWZpbmUgRFJFR19SRUdJRF9SMSAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMTEKKyNkZWZpbmUgRFJFR19SRUdJRF9SMiAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMTIKKyNkZWZpbmUgRFJFR19SRUdJRF9SMyAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMTMKKyNkZWZpbmUgRFJFR19SRUdJRF9SNCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMTQKKyNkZWZpbmUgRFJFR19SRUdJRF9SNSAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMTUKKyNkZWZpbmUgRFJFR19SRUdJRF9SNiAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMTYKKyNkZWZpbmUgRFJFR19SRUdJRF9SNyAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMTcKKyNkZWZpbmUgRFJFR19SRUdJRF9SOCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMTgKKyNkZWZpbmUgRFJFR19SRUdJRF9SOSAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMTkKKyNkZWZpbmUgRFJFR19SRUdJRF9SQSAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMUEKKyNkZWZpbmUgRFJFR19SRUdJRF9SQiAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMUIKKyNkZWZpbmUgRFJFR19SRUdJRF9SQyAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMUMKKyNkZWZpbmUgRFJFR19SRUdJRF9SRCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMUQKKyNkZWZpbmUgRFJFR19SRUdJRF9SRSAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMUUKKyNkZWZpbmUgRFJFR19SRUdJRF9SRiAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMUYKKyNkZWZpbmUgRFJFR19SRUdJRF9SQV9CVVNfTE9XICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMjAKKyNkZWZpbmUgRFJFR19SRUdJRF9SQV9CVVNfSElHSCAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMzgKKyNkZWZpbmUgRFJFR19SRUdJRF9ZQlVTX0xPVyAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwNTAKKyNkZWZpbmUgRFJFR19SRUdJRF9ZQlVTX0hJR0ggICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwNTgKKyNkZWZpbmUgRFJFR19SRUdJRF9UUkFQXzAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxMDAKKyNkZWZpbmUgRFJFR19SRUdJRF9UUkFQXzEgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxMDEKKyNkZWZpbmUgRFJFR19SRUdJRF9UUkFQXzIgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxMDIKKyNkZWZpbmUgRFJFR19SRUdJRF9UUkFQXzMgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxMDMKKyNkZWZpbmUgRFJFR19SRUdJRF9UUkFQXzQgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxMDQKKyNkZWZpbmUgRFJFR19SRUdJRF9UUkFQXzUgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxMDUKKyNkZWZpbmUgRFJFR19SRUdJRF9UUkFQXzYgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxMDYKKyNkZWZpbmUgRFJFR19SRUdJRF9UUkFQXzcgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAxMDcKKyNkZWZpbmUgRFJFR19SRUdJRF9JTkRJUkVDVF9BRERSRVNTICAgICAgICAgICAgIDB4MDAwMDAxMEUKKyNkZWZpbmUgRFJFR19SRUdJRF9UT1BfT0ZfU1RBQ0sgICAgICAgICAgICAgICAgIDB4MDAwMDAxMEYKKyNpZiAhZGVmaW5lZChOT19DUzQ2MTIpCisjaWYgIWRlZmluZWQoTk9fQ1M0NjE1KQorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfOCAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDExMAorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfOSAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDExMQorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfMTAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDExMgorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfMTEgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDExMworI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfMTIgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDExNAorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfMTMgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDExNQorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfMTQgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDExNgorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfMTUgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDExNworI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfMTYgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDExOAorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfMTcgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDExOQorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfMTggICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDExQQorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfMTkgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDExQgorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfMjAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDExQworI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfMjEgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDExRAorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfMjIgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDExRQorI2RlZmluZSBEUkVHX1JFR0lEX1RSQVBfMjMgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDExRgorI2VuZGlmCisjZW5kaWYKKyNkZWZpbmUgRFJFR19SRUdJRF9SU0EwX0xPVyAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAyMDAKKyNkZWZpbmUgRFJFR19SRUdJRF9SU0EwX0hJR0ggICAgICAgICAgICAgICAgICAgIDB4MDAwMDAyMDEKKyNkZWZpbmUgRFJFR19SRUdJRF9SU0ExX0xPVyAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAyMDIKKyNkZWZpbmUgRFJFR19SRUdJRF9SU0ExX0hJR0ggICAgICAgICAgICAgICAgICAgIDB4MDAwMDAyMDMKKyNkZWZpbmUgRFJFR19SRUdJRF9SU0EyICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAyMDQKKyNkZWZpbmUgRFJFR19SRUdJRF9SU0EzICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAyMDUKKyNkZWZpbmUgRFJFR19SRUdJRF9SU0kwX0xPVyAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAyMDYKKyNkZWZpbmUgRFJFR19SRUdJRF9SU0kwX0hJR0ggICAgICAgICAgICAgICAgICAgIDB4MDAwMDAyMDcKKyNkZWZpbmUgRFJFR19SRUdJRF9SU0kxICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAyMDgKKyNkZWZpbmUgRF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AgICAgICAgICAgICAgIDB4MDAwMDAwMDYKKyNkZWZpbmUgRFNSV1BfRFNSX1JRX1BFTkRJTkcgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDgKKworLyoKKyAqICBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIHRyYXAgd3JpdGUgcG9ydCByZWdpc3Rlci4KKyAqLworI2RlZmluZSBUV1BSX1RXX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwRkZGRgorI2RlZmluZSBUV1BSX1RXX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgICAgMAorCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgc3RhY2sgcG9pbnRlciB3cml0ZQorICogIHJlZ2lzdGVyLgorICovCisjZGVmaW5lIFNQV1JfU1RLUF9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDBGCisjZGVmaW5lIFNQV1JfU1RLUF9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAwCisKKy8qCisgKiAgVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBTUCBpbnRlcnJ1cHQgcmVnaXN0ZXIuCisgKi8KKyNkZWZpbmUgU1BJUl9GUkkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDEKKyNkZWZpbmUgU1BJUl9ET0kgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDIKKyNkZWZpbmUgU1BJUl9HUEkyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDQKKyNkZWZpbmUgU1BJUl9HUEkzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDgKKyNkZWZpbmUgU1BJUl9JUDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMTAKKyNkZWZpbmUgU1BJUl9JUDEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMjAKKyNkZWZpbmUgU1BJUl9JUDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwNDAKKyNkZWZpbmUgU1BJUl9JUDMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwODAKKworLyoKKyAqICBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIGZ1bmN0aW9uYWwgZ3JvdXAgMSByZWdpc3Rlci4KKyAqLworI2RlZmluZSBGR1IxX0YxU19NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwRkZGRgorI2RlZmluZSBGR1IxX0YxU19TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAgMAorCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgU1AgY2xvY2sgc3RhdHVzIHJlZ2lzdGVyLgorICovCisjZGVmaW5lIFNQQ1NfRlJJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAxCisjZGVmaW5lIFNQQ1NfRE9JICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAyCisjZGVmaW5lIFNQQ1NfR1BJMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA0CisjZGVmaW5lIFNQQ1NfR1BJMyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA4CisjZGVmaW5lIFNQQ1NfSVAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDEwCisjZGVmaW5lIFNQQ1NfSVAxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDIwCisjZGVmaW5lIFNQQ1NfSVAyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDQwCisjZGVmaW5lIFNQQ1NfSVAzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDgwCisjZGVmaW5lIFNQQ1NfU1BSVU4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMTAwCisjZGVmaW5lIFNQQ1NfU0xFRVAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMjAwCisjZGVmaW5lIFNQQ1NfRkcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNDAwCisjZGVmaW5lIFNQQ1NfT1JVTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwODAwCisjZGVmaW5lIFNQQ1NfSVJRICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAxMDAwCisjZGVmaW5lIFNQQ1NfRkdOX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDBFMDAwCisjZGVmaW5lIFNQQ1NfRkdOX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgICAxMworCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgU1AgRE1BIHJlcXVlc3RvciBzdGF0dXMKKyAqICByZWdpc3Rlci4KKyAqLworI2RlZmluZSBTRFNSX0RDU19NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDBGRgorI2RlZmluZSBTRFNSX0RDU19TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAgMAorI2RlZmluZSBTRFNSX0RDU19OT05FICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNworCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgZnJhbWUgdGltZXIgcmVnaXN0ZXIuCisgKi8KKyNkZWZpbmUgRlJNVF9GVFZfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMEZGRkYKKyNkZWZpbmUgRlJNVF9GVFZfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgIDAKKworLyoKKyAqICBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIGZvciB0aGUgZmxhZ3MgaW4gdGhlIGZyYW1lIHRpbWVyIGN1cnJlbnQgY291bnQKKyAqICByZWdpc3Rlci4KKyAqLworI2RlZmluZSBGUkNDX0ZDQ19NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwRkZGRgorI2RlZmluZSBGUkNDX0ZDQ19TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAgMAorCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lcyBhcmUgZm9yIHRoZSBmbGFncyBpbiB0aGUgZnJhbWUgdGltZXIgc2F2ZSBjb3VudAorICogIHJlZ2lzdGVyLgorICovCisjZGVmaW5lIEZSU0NfRkNTX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDBGRkZGCisjZGVmaW5lIEZSU0NfRkNTX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgICAwCisKKy8qCisgKiAgVGhlIGZvbGxvd2luZyBkZWZpbmUgdGhlIHZhcmlvdXMgZmxhZ3Mgc3RvcmVkIGluIHRoZSBzY2F0dGVyL2dhdGhlcgorICogIGRlc2NyaXB0b3JzLgorICovCisjZGVmaW5lIERNQV9TR19ORVhUX0VOVFJZX01BU0sgICAgICAgICAgICAgICAgICAweDAwMDAwRkY4CisjZGVmaW5lIERNQV9TR19TQU1QTEVfRU5EX01BU0sgICAgICAgICAgICAgICAgICAweDBGRkYwMDAwCisjZGVmaW5lIERNQV9TR19TQU1QTEVfRU5EX0ZMQUcgICAgICAgICAgICAgICAgICAweDEwMDAwMDAwCisjZGVmaW5lIERNQV9TR19MT09QX0VORF9GTEFHICAgICAgICAgICAgICAgICAgICAweDIwMDAwMDAwCisjZGVmaW5lIERNQV9TR19TSUdOQUxfRU5EX0ZMQUcgICAgICAgICAgICAgICAgICAweDQwMDAwMDAwCisjZGVmaW5lIERNQV9TR19TSUdOQUxfUEFHRV9GTEFHICAgICAgICAgICAgICAgICAweDgwMDAwMDAwCisjZGVmaW5lIERNQV9TR19ORVhUX0VOVFJZX1NISUZUICAgICAgICAgICAgICAgICAzCisjZGVmaW5lIERNQV9TR19TQU1QTEVfRU5EX1NISUZUICAgICAgICAgICAgICAgICAxNgorCisvKgorICogIFRoZSBmb2xsb3dpbmcgZGVmaW5lIHRoZSBvZmZzZXRzIG9mIHRoZSBmaWVsZHMgd2l0aGluIHRoZSBvbi1jaGlwIGdlbmVyaWMKKyAqICBETUEgcmVxdWVzdG9yLgorICovCisjZGVmaW5lIERNQV9SUV9DT05UUk9MMSAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAwCisjZGVmaW5lIERNQV9SUV9DT05UUk9MMiAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA0CisjZGVmaW5lIERNQV9SUV9TT1VSQ0VfQUREUiAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDA4CisjZGVmaW5lIERNQV9SUV9ERVNUSU5BVElPTl9BRERSICAgICAgICAgICAgICAgICAweDAwMDAwMDBDCisjZGVmaW5lIERNQV9SUV9ORVhUX1BBR0VfQUREUiAgICAgICAgICAgICAgICAgICAweDAwMDAwMDEwCisjZGVmaW5lIERNQV9SUV9ORVhUX1BBR0VfU0dERVNDICAgICAgICAgICAgICAgICAweDAwMDAwMDE0CisjZGVmaW5lIERNQV9SUV9MT09QX1NUQVJUX0FERFIgICAgICAgICAgICAgICAgICAweDAwMDAwMDE4CisjZGVmaW5lIERNQV9SUV9QT1NUX0xPT1BfQUREUiAgICAgICAgICAgICAgICAgICAweDAwMDAwMDFDCisjZGVmaW5lIERNQV9SUV9QQUdFX01BUF9BRERSICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDIwCisKKy8qCisgKiAgVGhlI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y8qCisgKiAgVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBzb3VyY2UgYW5kIGRlc3RpbmF0aW9uIHdvcmRzCisgKiAgb2YgdGhlIG9uLWNoaXAgZ2VuZXJpYyBETUEgcmVxdWVzdG9yLgorICovCisjZGVmaW5lIERNQV9SUV9TRF9BRERSRVNTX01BU0sgICAgICAgICAgICAgICAgICAweDAwMDBGRkZGCisjZGVmaW5lIERNQV9SUV9TRF9NRU1PUllfSURfTUFTSyAgICAgICAgICAgICAgICAweDAwMEYwMDAwCisjZGVmaW5lIERNQV9SUV9TRF9TUF9QQVJBTV9BRERSICAgICAgICAgICAgICAgICAweDAwMDAwMDAwCisjZGVmaW5lIERNQV9SUV9TRF9TUF9TQU1QTEVfQUREUiAgICAgICAgICAgICAgICAweDAwMDEwMDAwCisjZGVmaW5lIERNQV9SUV9TRF9TUF9QUk9HUkFNX0FERFIgICAgICAgICAgICAgICAweDAwMDIwMDAwCisjZGVmaW5lIERNQV9SUV9TRF9TUF9ERUJVR19BRERSICAgICAgICAgICAgICAgICAweDAwMDMwMDAwCisjZGVmaW5lIERNQV9SUV9TRF9PTU5JTUVNX0FERFIgICAgICAgICAgICAgICAgICAweDAwMEUwMDAwCisjZGVmaW5lIERNQV9SUV9TRF9FTkRfRkxBRyAgICAgICAgICAgICAgICAgICAgICAweDQwMDAwMDAwCisjZGVmaW5lIERNQV9SUV9TRF9FUlJPUl9GTEFHICAgICAgICAgICAgICAgICAgICAweDgwMDAwMDAwCisjZGVmaW5lIERNQV9SUV9TRF9BRERSRVNTX1NISUZUICAgICAgICAgICAgICAgICAwCisKKy8qCisgKiAgVGhlIGZvbGxvd2luZyBkZWZpbmVzIGFyZSBmb3IgdGhlIGZsYWdzIGluIHRoZSBwYWdlIG1hcCBhZGRyZXNzIHdvcmQgb2YgdGhlCisgKiAgb24tY2hpcCBnZW5lcmljIERNQSByZXF1ZXN0b3IuCisgKi8KKyNkZ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NQQiAgICAgICAgICAgICAgICAweDM0MCAgICAvKiBCQTFfQ0FQVFVSRV9TUEJfQUREUkVTUyAqLworCisvKgorICoKKyAqLworCisjZGVmaW5lIENTNDYxWF9NT0RFX09VVFBVVAkoMTw8MCkJIC8qIE1JREkgVUFSVCAtIG91dHB1dCAqLyAKKyNkZWZpbmUgQ1M0NjFYX01PREVfSU5QVVQJKDE8PDEpCSAvKiBNSURJIFVBUlQgLSBpbnB1dCAqLworCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKy8vCisvLyBUaGUgZm9sbG93aW5nIGRlZmluZSB0aGUgb2Zmc2V0cyBvZiB0aGUgQUM5NyBzaGFkb3cgcmVnaXN0ZXJzLCB3aGljaCBhcHBlYXIKKy8vIGFzIGEgdmlydHVhbCBleHRlbnNpb24gdG8gdGhlIGJhc2UgYWRkcmVzcyByZWdpc3RlciB6ZXJvIG1lbW9yeSByYW5nZS4KKy8vCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyNkZWZpbmUgQUM5N19SRUdfT0ZGU0VUX01BU0sgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwN0VMCisjZGVmaW5lIEFDOTdfQ09ERUNfTlVNQkVSX01BU0sgICAgICAgICAgICAgICAgICAweDAwMDAzMDAwTAorCisjZGVmaW5lIEJBMF9BQzk3X1JFU0VUICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAxMDAwTAorI2RlZmluZSBCQTBfQUM5N19NQVNURVJfVk9MVU1FICAgICAgICAgICAgICAgICAgMHgwMDAwMTAwMkwKKyNkZWZpbmUgQkEwX0FDOTdfSEVBRFBIT05FX1ZPTFVNRSAgICAgICAgICAgICAgIDB4MDAwMDEwMDRMCisjZGVmaW5lIEJBMF9BQzk3X01BU1RFUl9WT0xVTUVfTU9OTyAgICAgICAgICAgICAweDAwMDAxMDA2TAorI2RlZmluZSBCQTBfQUM5N19NQVNURVJfVE9ORSAgICAgICAgICAgICAgICAgICAgMHgwMDAwMTAwOEwKKyNkZWZpbmUgQkEwX0FDOTdfUENfQkVFUF9WT0xVTUUgICAgICAgICAgICAgICAgIDB4MDAwMDEwMEFMCisjZGVmaW5lIEJBMF9BQzk3X1BIT05FX1ZPTFVNRSAgICAgICAgICAgICAgICAgICAweDAwMDAxMDBDTAorI2RlZmluZSBCQTBfQUM5N19NSUNfVk9MVU1FICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMTAwRUwKKyNkZWZpbmUgQkEwX0FDOTdfTElORV9JTl9WT0xVTUUgICAgICAgICAgICAgICAgIDB4MDAwMDEwMTBMCisjZGVmaW5lIEJBMF9BQzk3X0NEX1ZPTFVNRSAgICAgICAgICAgICAgICAgICAgICAweDAwMDAxMDEyTAorI2RlZmluZSBCQTBfQUM5N19WSURFT19WT0xVTUUgICAgICAgICAgICAgICAgICAgMHgwMDAwMTAxNEwKKyNkZWZpbmUgQkEwX0FDOTdfQVVYX1ZPTFVNRSAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDEwMTZMCisjZGVmaW5lIEJBMF9BQzk3X1BDTV9PVVRfVk9MVU1FICAgICAgICAgICAgICAgICAweDAwMDAxMDE4TAorI2RlZmluZSBCQTBfQUM5N19SRUNPUkRfU0VMRUNUICAgICAgICAgICAgICAgICAgMHgwMDAwMTAxQUwKKyNkZWZpbmUgQkEwX0FDOTdfUkVDT1JEX0dBSU4gICAgICAgICAgICAgICAgICAgIDB4MDAwMDEwMUNMCisjZGVmaW5lIEJBMF9BQzk3X1JFQ09SRF9HQUlOX01JQyAgICAgICAgICAgICAgICAweDAwMDAxMDFFTAorI2RlZmluZSBCQTBfQUM5N19HRU5FUkFMX1BVUlBPU0UgICAgICAgICAgICAgICAgMHgwMDAwMTAyMEwKKyNkZWZpbmUgQkEwX0FDOTdfM0RfQ09OVFJPTCAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDEwMjJMCisjZGVmaW5lIEJBMF9BQzk3X01PREVNX1JBVEUgICAgICAgICAgICAgICAgICAgICAweDAwMDAxMDI0TAorI2RlZmluZSBCQTBfQUM5N19QT1dFUkRPV04gICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMTAyNkwKKyNkZWZpbmUgQkEwX0FDOTdfRVhUX0FVRElPX0lEICAgICAgICAgICAgICAgICAgIDB4MDAwMDEwMjhMCisjZGVmaW5lIEJBMF9BQzk3X0VYVF9BVURJT19QT1dFUiAgICAgICAgICAgICAgICAweDAwMDAxMDJBTAorI2RlZmluZSBCQTBfQUM5N19QQ01fRlJPTlRfREFDX1JBVEUgICAgICAgICAgICAgMHgwMDAwMTAyQ0wKKyNkZWZpbmUgQkEwX0FDOTdfUENNX1NVUlJfREFDX1JBVEUgICAgICAgICAgICAgIDB4MDAwMDEwMkVMCisjZGVmaW5lIEJBMF9BQzk3X1BDTV9MRkVfREFDX1JBVEUgICAgICAgICAgICAgICAweDAwMDAxMDMwTAorI2RlZmluZSBCQTBfQUM5N19QQ01fTFJfQURDX1JBVEUgICAgICAgICAgICAgICAgMHgwMDAwMTAzMkwKKyNkZWZpbmUgQkEwX0FDOTdfTUlDX0FEQ19SQVRFICAgICAgICAgICAgICAgICAgIDB4MDAwMDEwMzRMCisjZGVmaW5lIEJBMF9BQzk3XzZDSF9WT0xfQ19MRkUgICAgICAgICAgICAgICAgICAweDAwMDAxMDM2TAorI2RlZmluZSBCQTBfQUM5N182Q0hfVk9MX1NVUlJPVU5EICAgICAgICAgICAgICAgMHgwMDAwMTAzOEwKKyNkZWZpbmUgQkEwX0FDOTdfUkVTRVJWRURfM0EgICAgICAgICAgICAgICAgICAgIDB4MDAwMDEwM0FMCisjZGVmaW5lIEJBMF9BQzk3X0VYVF9NT0RFTV9JRCAgICAgICAgICAgICAgICAgICAweDAwMDAxMDNDTAorI2RlZmluZSBCQTBfQUM5N19FWFRfTU9ERU1fUE9XRVIgICAgICAgICAgICAgICAgMHgwMDAwMTAzRUwKKyNkZWZpbmUgQkEwX0FDOTdfTElORTFfQ09ERUNfUkFURSAgICAgICAgICAgICAgIDB4MDAwMDEwNDBMCisjZGVmaW5lIEJBMF9BQzk3X0xJTkUyX0NPREVDX1JBVEUgICAgICAgICAgICAgICAweDAwMDAxMDQyTAorI2RlZmluZSBCQTBfQUM5N19IQU5EU0VUX0NPREVDX1JBVEUgICAgICAgICAgICAgMHgwMDAwMTA0NEwKKyNkZWZpbmUgQkEwX0FDOTdfTElORTFfQ09ERUNfTEVWRUwgICAgICAgICAgICAgIDB4MDAwMDEwNDZMCisjZGVmaW5lIEJBMF9BQzk3X0xJTkUyX0NPREVDX0xFVkVMICAgICAgICAgICAgICAweDAwMDAxMDQ4TAorI2RlZmluZSBCQTBfQUM5N19IQU5EU0VUX0NPREVDX0xFVkVMICAgICAgICAgICAgMHgwMDAwMTA0QUwKKyNkZWZpbmUgQkEwX0FDOTdfR1BJT19QSU5fQ09ORklHICAgICAgICAgICAgICAgIDB4MDAwMDEwNENMCisjZGVmaW5lIEJBMF9BQzk3X0dQSU9fUElOX1RZUEUgICAgICAgICAgICAgICAgICAweDAwMDAxMDRFTAorI2RlZmluZSBCQTBfQUM5N19HUElPX1BJTl9TVElDS1kgICAgICAgICAgICAgICAgMHgwMDAwMTA1MEwKKyNkZWZpbmUgQkEwX0FDOTdfR1BJT19QSU5fV0FLRVVQICAgICAgICAgICAgICAgIDB4MDAwMDEwNTJMCisjZGVmaW5lIEJBMF9BQzk3X0dQSU9fUElOX1NUQVRVUyAgICAgICAgICAgICAgICAweDAwMDAxMDU0TAorI2RlZmluZSBCQTBfQUM5N19NSVNDX01PREVNX0FGRV9TVEFUICAgICAgICAgICAgMHgwMDAwMTA1NkwKKyNkZWZpbmUgQkEwX0FDOTdfUkVTRVJWRURfNTggICAgICAgICAgICAgICAgICAgIDB4MDAwMDEwNThMCisjZGVmaW5lIEJBMF9BQzk3X0NSWVNUQUxf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EwX0FDOTdfQ0FMX0FERFJFU1MgICAgICAgICAgICAgICAgICAgIDB4MDAwMDEwNzZMCisjZGVmaW5lIEJBMF9BQzk3X0NBTF9EQVRBICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAxMDc4TAorI2RlZmluZSBCQTBfQUM5N19WRU5ET1JfUkVTRVJWRURfN0EgICAgICAgICAgICAgMHgwMDAwMTA3QUwKKyNkZWZpbmUgQkEwX0FDOTdfVkVORE9SX0lEMSAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDEwN0NMCisjZGVmaW5lIEJBMF9BQzk3X1ZFTkRPUl9JRDIgICAgICAgICAgICAgICAgICAgICAweDAwMDAxMDdFTAorI2VuZGlmCQkJCS8qIF9fQ1M0NjFYX0ggKi8KZGlmZiAtLWdpdCBhL3NvdW5kL29zcy9jczQ2MXhfaW1hZ2UuaCBiL3NvdW5kL29zcy9jczQ2MXhfaW1hZ2UuaApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5iNWM1YTQ2Ci0tLSAvZGV2L251bGwKKysrIGIvc291bmQvb3NzL2NzNDYxeF9pbWFnZS5oCkBAIC0wLDAgKzEsMzIyIEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogIkNXQ0lNQUdFLkgiLS0gRm9yIENTNDZYWC4gVmVyIDEuMDQKKyAqICAgICAgQ29weXJpZ2h0IDE5OTgtMjAwMSAoYykgQ2lycnVzIExvZ2ljIENvcnAuCisgKiAgICAgIFZlcnNpb24gMS4wNAorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqLworI2lmbmRlZiBfX0NTX0lNQUdFX0gKKyNkZWZpbmUgX19DU19JTUFHRV9ICisKKyNkZWZpbmUgQ0xFQVJfX0NPVU5UICAgICAzCisjZGVmaW5lIE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qIHRoZXNlIHZhbHVlcyBhcmUgaW5jb3JyZWN0IGZvciB0aGUgYWM5NyBkcml2ZXIsIGZpeC4KKyAgICAgICAgICogSW5kZXggb2YgbWl4dGFibGUxW10gbWVtYmVyIGlzIERldmljZSBJRCAKKyAgICAgICAgICogYW5kIG11c3QgYmUgPD0gU09VTkRfTUlYRVJfTlJERVZJQ0VTLgorICAgICAgICAgKiBWYWx1ZSBvZiBhcnJheSBtZW1iZXIgaXMgaW5kZXggaW50byBzLT5taXgudm9sW10KKyAgICAgICAgICovCisgICAgICAgIHN0YXRpYyBjb25zdCB1bnNpZ25lZCBjaGFyIG1peHRhYmxlMVtTT1VORF9NSVhFUl9OUkRFVklDRVNdID0geworICAgICAgICAgICAgICAgIFtTT1VORF9NSVhFUl9QQ01dICAgICA9IDEsICAgLyogdm9pY2UgKi8KKyAgICAgICAgICAgICAgICBbU09VTkRfTUlYRVJfTElORTFdICAgPSAyLCAgIC8qIEFVWCAqLworICAgICAgICAgICAgICAgIFtTT1VORF9NSVhFUl9DRF0gICAgICA9IDMsICAgLyogQ0QgKi8KKyAgICAgICAgICAgICAgICBbU09VTkRfTUlYRVJfTElORV0gICAgPSA0LCAgIC8qIExpbmUgKi8KKyAgICAgICAgICAgICAgICBbU09VTkRfTUlYRVJfU1lOVEhdICAgPSA1LCAgIC8qIEZNICovCisgICAgICAgICAgICAgICAgW1NPVU5EX01JWEVSX01JQ10gICAgID0gNiwgICAvKiBNaWMgKi8KKyAgICAgICAgICAgICAgICBbU09VTkRfTUlYRVJfU1BFQUtFUl0gPSA3LCAgIC8qIFNwZWFrZXIgKi8KKyAgICAgICAgICAgICAgICBbU09VTkRfTUlYRVJfUkVDTEVWXSAgPSA4LCAgIC8qIFJlY29yZGluZyBsZXZlbCAqLworICAgICAgICAgICAgICAgIFtTT1VORF9NSVhFUl9WT0xVTUVdICA9IDkgICAgLyogTWFzdGVyIFZvbHVtZSAqLworICAgICAgICB9OworICAgICAgICAKKyAgICBzd2l0Y2goe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QkdPVVQoQ1NfSU9DVEwsIDQsIHByaW50aygiU09VTkRfUENNX1JFQURfRklMVEVSOiAiKSApOworCQlicmVhazsKKworICAgICAgICBjYXNlIFNPVU5EX01JWEVSX1BSSVZBVEUxOgorCQlDU19EQkdPVVQoQ1NfSU9DVEwsIDQsIHByaW50aygiU09VTkRfTUlYRVJfUFJJVkFURTE6ICIpICk7CisJCWJyZWFrOworICAgICAgICBjYXNlIFNPVU5EX01JWEVSX1BSSVZBVEUyOgorCQlDU19EQkdPVVQoQ1NfSU9DVEwsIDQsIHByaW50aygiU09VTkRfTUlYRVJfUFJJVkFURTI6ICIpICk7CisJCWJyZWFrOworICAgICAgICBjYXNlIFNPVU5EX01JWEVSX1BSSVZBVEUzOgorCQlDU19EQkdPVVQoQ1NfSU9DVEwsIDQsIHByaW50aygiU09VTkRfTUlYRVJfUFJJVkFURTM6ICIpICk7CisJCWJyZWFrOworICAgICAgICBjYXNlIFNPVU5EX01JWEVSX1BSSVZBVEU0OgorCQlDU19EQkdPVVQoQ1NfSU9DVEwsIDQsIHByaW50aygiU09VTkRfTUlYRVJfUFJJVkFURTQ6ICIpICk7CisJCWJyZWFrOworICAgICAgICBjYXNlIFNPVU5EX01JWEVSX1BSSVZBVEU1OgorCQlDU19EQkdPVVQoQ1NfSU9DVEwsIDQsIHByaW50aygiU09VTkRfTUlYRVJfUFJJVkFURTU6ICIpICk7CisJCWJyZWFrOworICAgICAgICBjYXNlIFNPVU5EX01JWEVSX0lORk86CisJCUNTX0RCR09VVChDU19JT0NUTCwgNCwgcHJpbnRrKCJTT1VORF9NSVhFUl9JTkZPOiAiKSApOworCQlicmVhazsKKyAgICAgICAgY2FzZSBTT1VORF9PTERfTUlYRVJfSU5GTzoKKwkJQ1NfREJHT1VUKENTX0lPQ1RMLCA0LCBwcmludGsoIlNPVU5EX09MRF9NSVhFUl9JTkZPOiAiKSApOworCQlicmVhazsKKworCWRlZmF1bHQ6CisJCXN3aXRjaCAoX0lPQ19OUih4KSkgC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dGU7Cit9CisKKy8qIHByZXBhcmUgY2hhbm5lbCBhdHRyaWJ1dGVzIGZvciBwbGF5YmFjayAqLyAKK3N0YXRpYyB2b2lkIGNzX3BsYXlfc2V0dXAoc3RydWN0IGNzX3N0YXRlICpzdGF0ZSkKK3sKKwlzdHJ1Y3QgZG1hYnVmICpkbWFidWYgPSAmc3RhdGUtPmRtYWJ1ZjsKKwlzdHJ1Y3QgY3NfY2FyZCAqY2FyZCA9IHN0YXRlLT5jYXJkOworICAgICAgICB1bnNpZ25lZCBpbnQgdG1wLCBDb3VudCwgcGxheUZvcm1hdDsKKworCUNTX0RCR09VVChDU19GVU5DVElPTiwgMiwgcHJpbnRrKCJjczQ2eHg6IGNzX3BsYXlfc2V0dXAoKStcbiIpICk7CisgICAgICAgIGNzNDYxeF9wb2tlKGNhcmQsIEJBMV9QVk9MLCAweDgwMDA4MDAwKTsKKyAgICAgICAgaWYoIWRtYWJ1Zi0+U0dvaykKKyAgICAgICAgICAgICAgIGNzNDYxeF9wb2tlKGNhcmQsIEJBMV9QQkEsIHZpcnRfdG9fYnVzKGRtYWJ1Zi0+cGJ1ZikpOworICAgIAorICAgICAgICBDb3VudCA9IDQ7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICBwbGF5Rm9ybWF0PWNzNDYxeF9wZWVrKGNhcmQsIEJBMV9QRklFKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICBpZiAoKGRtYWJ1Zi0+Zm10ICYgQ1NfRk1UX1NURVJFTykpIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIHBsYXlGb3JtYXQgJj0gfkRNQV9SUV9DMl9BQ19NT05PX1RPX1NURVJFTzsgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIENvdW50ICo9IDI7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICB9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICBlbHNlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIHBsYXlGb3JtYXQgfD0gRE1BX1JRX0MyX0FDX01PTk9fVE9fU1RFUkVPOyAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICBpZiAoKGRtYWJ1Zi0+Zm10ICYgQ1NfRk1UXzE2QklUKSkgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIHBsYXlGb3JtYXQgJj0gfihETUFfUlFfQzJfQUNfOF9UT18xNl9CSVQgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBETUFfUlFfQzJfQUNfU0lHTkVEX0NPTlZFUlQpOyAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIENvdW50ICo9IDI7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICB9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICBlbHNlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIHBsYXlGb3JtYXQgfD0gKERNQV9SUV9DMl9BQ184X1RPXzE2X0JJVCAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBETUFfUlFfQzJfQUNfU0lHTkVEX0NPTlZFUlQpOyAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICBjczQ2MXhfcG9rZShjYXJkLCBCQTFfUEZJRSwgcGxheUZvcm1hdCk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICB0bXAgPSBjczQ2MXhfcGVlayhjYXJkLCBCQTFfUERUQyk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICB0bXAgJj0gMHhmZmZmZmUwMDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICBjczQ2MXhfcG9rZShjYXJkLCBCQTFfUERUQywgdG1wIHwgLS1Db3VudCk7ICAgICAgICAgICAgICAgICAgICAgICAgIAorCisJQ1NfREJHT1VUKENTX0ZVTkNUSU9OLCAyLCBwcmludGsoImNzNDZ4eDogY3NfcGxheV9zZXR1cCgpLVxuIikgKTsKKworfQorCitzdGF0aWMgc3RydWN0IEluaXRTdHJ1Y3QKK3sKKyAgICB1MzIgb2ZmOworICAgIHUzMiB2YWw7Cit9IEluaXRBcnJheVtdID0geyB7MHgwMDAwMDA0MCwgMHgzZmMwMDAwZn0sCisgICAgICAgICAgICAgICAgICB7MHgwMDAwMDA0YywgMHgwNDgwMDAwMH0sCisKKyAgICAgICAgICAgICAgICAgIHsweDAwMDAwMGIzLCAweDAwMDAwNzgwfSwKKyAgICAgICAgICAgICAgICAgIHsweDAwMDAwMGI3LCAweDAwMDAwMDAwfSwKKyAgICAgICAgICAgICAgICAgIHsweDAwMDAwMGJjLCAweDA3ODAwMDAwfSwKKworICAgICAgICAgICAgICAgICAgezB4MDAwMDAwY2QsIDB4MDA4MDAwMDB9LAorICAgICAgICAgICAgICAgIH07CisKKy8qCisgKiAiU2V0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wgcHJpbnRrKAorCQkJICAgICJjczQ2eHg6IHByb2dfZG1hYnVmKCkgRXJyb3I6IGFsbG9jYXRlZF9wYWdlcyB0b28gc21hbGwgKCVkKVxuIiwKKwkJCQkodW5zaWduZWQpYWxsb2NhdGVkX3BhZ2VzKSk7CisJCQlyZXR1cm4gLUVOT01FTTsKKwkJfQorCQkJCQkJCQkJCSAgICAKKwkJLyogVXNlIGFsbCB0aGUgcGFnZXMgYWxsb2NhdGVkLCBmcmFnc2l6ZSA0ay4gKi8KKwkJLyogVXNlICdwYnVmJyBmb3IgUy9HIHBhZ2UgbWFwIHRhYmxlLiAqLworCQlkbWFidWYtPlNHb2sgPSAxOyAgICAgICAgICAgLyogVXNlIFMvRy4gKi8KKworCQluU0dwYWdlcyA9IGFsbG9jYXRlZF9ieXRlcy80MDk2OyAgICAvKiBTL0cgcGFnZXMgYWx3YXlzIDRrLiAqLworCQkJCQkJCQkJCSAgICAKKwkJICAgICAvKiBTZXQgdXAgUy9HIHZhcmlhYmxlcy4gKi8KKwkJKnB0bXAgPSB2aXJ0X3RvX2J1cyhkbWFidWYtPnJhd2J1Zik7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKwkJKihwdG1wKzEpID0gMHgwMDAwMDAwODsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKwkJZm9yKHRtcDE9IDE7IHRtcDEgPCBuU0dwYWdlczsgdG1wMSsrKSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKwkJCSoocHRtcCsyKnRtcDEpID0gdmlydF90b19idXMoIChkbWFidWYtPnJhd2J1ZikrNDA5Nip0bXAxKTsgIAorCQkJaWYoIHRtcDEgPT0gblNHcGFnZXMtMSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisJCQkJdG1wMiA9IDB4YmZmZjAwMDA7CisJCQllbHNlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKwkJCQl0bXAyID0gMHg4MDAwMDAwMCs4Kih0bXAxKzEpOyAgICAgICAgICAgICAgICAgICAgICAgCisJCQkqKHB0bXArMip0bXAxKzEpID0gdG1wMjsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKwkJfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKwkJU0dhcnJheVswXSA9IDB4ODJjMDIwMGQ7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKwkJU0dhcnJheVsxXSA9IDB4ZmZmZjAwMDA7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKwkJU0dhcnJheVsyXSA9ICpwdG1wOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKwkJU0dhcnJheVszXSA9IDB4MDAwMTA2MDA7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKwkJU0dhcnJheVs0XSA9ICoocHRtcCsyKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKwkJU0dhcnJheVs1XSA9IDB4ODAwMDAwMTA7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKwkJU0dhcnJheVs2XSA9ICpwdG1wOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKwkJU0dhcnJheVs3XSA9ICoocHRtcCsyKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKwkJU0dhcnJheVs4XSA9ICh2aXJ0X3RvX2J1cyhkbWFidWYtPnBidWYpICYgMHhmZmZmMDAwKSB8IDB4MTA7ICAgICAgICAKKworCQlpZiAoZG1hYnVmLT5TR29rKSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorCQkJZG1hYnVmLT5udW1mcmFnID0gblNHcGFnZXM7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisJCQlkbWFidWYtPmZyYWdzaXplID0gNDA5NjsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKwkJCWRtYWJ1Zi0+ZnJhZ3NhbXBsZXMgPSA0MDk2ID4+IHNhbXBsZV9zaGlmdFtkbWFidWYtPmZtdF07ICAgIAorCQkJZG1hYnVmLT5mcmFnc2hpZnQgPSAxMjsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisJCQlkbWFidWYtPmRtYXNpemUgPSBkbWFidWYtPm51bWZyYWcqNDA5NjsgICAgICAgICAgICAgICAgICAgICAKKwkJfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKwkJZWxzZSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKwkJCVNHYXJyYXlbMF0gPSAweGYyYzAwMDBmOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorCQkJU0dhcnJheVsxXSA9IDB4MDAwMDAyMDA7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisJCQlTR2FycmF5WzJdID0gMDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKwkJCVNHYXJyYXlbM10gPSAweDAwMDEwNjAwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorCQkJU0dhcnJheVs0XT1TR2FycmF5WzVdPVNHYXJyYXlbNl09U0dhcnJheVs3XT1TR2FycmF5WzhdID0gMDsgCisJCQlkbWFidWYtPm51bWZyYWcgPSAyOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKwkJCWRtYWJ1Zi0+ZnJhZ3NpemUgPSAyMDQ4OyAgICAgIC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LT5taWRpLml3ciA9IChjYXJkLT5taWRpLml3ciArIDEpICUgQ1NfTUlESUlOQlVGOworICAgICAgICAgICAgICAgICAgICAgICAgY2FyZC0+bWlkaS5pY250Kys7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHdha2UgPSAxOworICAgICAgICB9CisgICAgICAgIGlmICh3YWtlKQorICAgICAgICAgICAgICAgIHdha2VfdXAoJmNhcmQtPm1pZGkuaXdhaXQpOworICAgICAgICB3YWtlID0gMDsKKyAgICAgICAgd2hpbGUgKCEoY3M0NjF4X3BlZWtCQTAoY2FyZCwgIEJBMF9NSURTUikgJiBNSURTUl9UQkYpICYmIGNhcmQtPm1pZGkub2NudCA+IDApIHsKKyAgICAgICAgICAgICAgICB0ZW1wMSA9ICggY2FyZC0+bWlkaS5vYnVmW2NhcmQtPm1pZGkub3JkXSApICYgMHgwMDAwMDBmZjsKKyAgICAgICAgICAgICAgICBjczQ2MXhfcG9rZUJBMChjYXJkLCBCQTBfTUlEV1AsdGVtcDEpOworICAgICAgICAgICAgICAgIGNhcmQtPm1pZGkub3JkID0gKGNhcmQtPm1pZGkub3JkICsgMSkgJSBDU19NSURJT1VUQlVGOworICAgICAgICAgICAgICAgIGNhcmQtPm1pZGkub2NudC0tOworICAgICAgICAgICAgICAgIGlmIChjYXJkLT5taWRpLm9jbnQgPCBDU19NSURJT1VUQlVGLTE2KQorICAgICAgICAgICAgICAgICAgICAgICAgd2FrZSA9IDE7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHdha2UpCisgICAgICAgICAgICAgICAgd2FrZV91cCgmY2FyZC0+bWlkaS5vd2FpdCk7Cit9CisKK3N0YXRpYyBpcnFyZXR1cm5fdCBjc19pbnRlcnJ1cHQoaW50IGlycSwgdm9pZCAqZGV2X2lkLCBzdHJ1Y3QgcHRfcmVncyAqcmVncykKK3sKKwlzdHJ1Y3QgY3NfY2FyZCAqY2FyZCA9IChzdHJ1Y3QgY3NfY2FyZCAqKWRldl9pZDsKKw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FKTsKKwl9CisKKyAgICAgICAgaWYoIHN0YXR1cyAmIEhJU1JfTUlESSApCisgICAgICAgICAgICAgICAgY3NfaGFuZGxlX21pZGkoY2FyZCk7CisJCisgCS8qIGNsZWFyICdlbSAqLworCWNzNDYxeF9wb2tlQkEwKGNhcmQsIEJBMF9ISUNSLCBISUNSX0NIR018SElDUl9JRVYpOworCXNwaW5fdW5sb2NrKCZjYXJkLT5sb2NrKTsKKwlDU19EQkdPVVQoQ1NfSU5URVJSVVBULCA5LCBwcmludGsoImNzNDZ4eDogY3NfaW50ZXJydXB0KCktIFxuIikpOworCXJldHVybiBJUlFfSEFORExFRDsKK30KKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworc3RhdGljIHNzaXplX3QgY3NfbWlkaV9yZWFkKHN0cnVjdCBmaWxlICpmaWxlLCBjaGFyIF9fdXNlciAqYnVmZmVyLCBzaXplX3QgY291bnQsIGxvZmZfdCAqcHBvcykKK3sKKyAgICAgICAgc3RydWN0IGNzX2NhcmQgKmNhcmQgPSAoc3RydWN0IGNzX2NhcmQgKilmaWxlLT5wcml2YXRlX2RhdGE7CisgICAgICAgIHNzaXplX3QgcmV0OworICAgICAgICB1bnNpZ25lZCBsb25nIGZsYWdzOworICAgICAgICB1bnNpZ25lZCBwdHI7CisgICAgICAgIGludCBjbnQ7CisKKyAgICAgICAgaWYgKCFhY2Nlc3Nfb2soVkVSSUZZX1dSSVRFLCBidWZmZXIsIGNvdW50KSkKKyAgICAgICAgICAgICAgICByZXR1cm4gLUVGQVVMVDsKKyAgICAgICAgcmV0ID0gMDsKKyAgICAgICAgd2hpbGUgKGNvdW50ID4gMCkgeworICAgICAgICAgICAgICAgIHNwaW5fbG9ja19pcnFzYXZlKCZjYXJkLT5sb2NrLCBmbGFncyk7CisgICAgICAgICAgICAgICAgcHRyID0gY2FyZC0+bWlkaS5pcmQ7CisgICAgICAgICAgICAgICAgY250ID0gQ1NfTUlESUlOQlVGIC0gcHRyOworICAgICAgICAgICAgICAgIGlmIChjYXJkLT5taWRpLmljbnQgPCBjbnQpCisgICAgICAgICAgICAgICAgICAgICAgICBjbnQgPSBjYXJkLT5taWRpLmljbnQ7CisgICAgICAgICAgICAgICAgc3Bpbl91bmxvY2tfaXJxcmVzdG9yZSgmY2FyZC0+bG9jaywgZmxhZ3MpOworICAgICAgICAgICAgICAgIGlmIChjbnQgPiBjb3VudCkKKyAgICAgICAgICAgICAgICAgICAgICAgIGNudCA9IGNvdW50OworICAgICAgICAgICAgICAgIGlmIChjbnQgPD0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGUtPmZfZmxhZ3MgJiBPX05PTkJMT0NLKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmV0ID8gcmV0IDogLUVBR0FJTjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludGVycnVwdGlibGVfc2xlZXBfb24oJmNhcmQtPm1pZGkuaXdhaXQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNpZ25hbF9wZW5kaW5nKGN1cnJlbnQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmV0ID8gcmV0IDogLUVSRVNUQVJUU1lTOworICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChjb3B5X3RvX3VzZXIoYnVmZmVyLCBjYXJkLT5taWRpLmlidWYgKyBwdHIsIGNudCkpCisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmV0ID8gcmV0IDogLUVGQVVMVDsKKyAgICAgICAgICAgICAgICBwdHIgPSAocHRyICsgY250KSAlIENTX01JRElJTkJVRjsKKyAgICAgICAgICAgICAgICBzcGluX2xvY2tfaXJxc2F2ZSgmY2FyZC0+bG9jaywgZmxhZ3MpOworICAgICAgICAgICAgICAgIGNhcmQtPm1pZGkuaXJkID0gcHRyOworICAgICAgICAgICAgICAgIGNhcmQtPm1pZGkuaWNudCAtPSBjbnQ7CisgICAgICAgICAgICAgICAgc3Bpbl91bmxvY2tfaXJxcmVzdG9yZSgmY2FyZC0+bG9jaywgZmxhZ3MpOworICAgICAgICAgICAgICAgIGNvdW50IC09IGNudDsKKyAgICAgICAgICAgICAgICBidWZmZXIgKz0gY250OworICAgICAgICAgICAgICAgIHJldCArPSBjbnQ7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHJldDsKK30KKworCitzdGF0aWMgc3NpemVfdCBjc19taWRpX3dyaXRlKHN0cnVjdCBmaWxlICpmaWxlLCBjb25zdCBjaGFyIF9fdXNlciAqYnVmZmVyLCBzaXplX3QgY291bnQsIGxvZmZfdCAqcHBvcykKK3sKKyAgICAgICAgc3RydWN0IGNzX2NhcmQgKmNhcmQgPSAoc3RydWN0IGNzX2NhcmQgKilmaWxlLT5wcml2YXRlX2RhdGE7CisgICAgICAgIHNzaXplX3QgcmV0OworICAgICAgICB1bnNpZ25lZCBsb25nIGZsYWdzOworICAgICAgICB1bnNpZ25lZCBwdHI7CisgICAgICAgIGludCBjbnQ7CisKKyAgICAgICAgaWYgKCFhY2Nlc3Nfb2soVkVSSUZZX1JFQUQsIGJ1ZmZlciwgY291bnQpKQorICAgICAgICAgICAgICAgIHJldHVybiAtRUZBVUxUOworICAgICAgICByZXQgPSAwOworICAgICAgICB3aGlsZSAoY291bnQgPiAwKSB7CisgICAgICAgICAgICAgICAgc3Bpbl9sb2NrX2lycXNhdmUoJmNhcmQtPmxvY2ssIGZsYWdzKTsKKyAgICAgICAgICAgICAgICBwdHIgPSBjYXJkLT5taWRpLm93cjsKKyAgICAgICAgICAgICAgICBjbnQgPSBDU19NSURJT1VUQlVGIC0gcHRyOworICAgICAgICAgICAgICAgIGlmIChjYXJkLT5taWRpLm9jbnQgKyBjbnQgPiBDU19NSURJT1VUQlVGKQorICAgICAgICAgICAgICAgICAgICAgICAgY250ID0gQ1NfTUlESU9VVEJVRiAtIGNhcmQtPm1pZGkub2NudDsKKyAgICAgICAgICAgICAgICBpZiAoY250IDw9IDApCisgICAgICAgICAgICAgICAgICAgICAgICBjc19oYW5kbGVfbWlkaShjYXJkKTsKKyAgICAgICAgICAgICAgICBzcGluX3VubG9ja19pcnFyZXN0b3JlKCZjYXJkLT5sb2NrLCBmbGFncyk7CisgICAgICAgICAgICAgICAgaWYgKGNudCA+IGNvdW50KQorICAgICAgICAgICAgICAgICAgICAgICAgY250ID0gY291bnQ7CisgICAgICAgICAgICAgICAgaWYgKGNudCA8PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZS0+Zl9mbGFncyAmIE9fTk9OQkxPQ0spCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXQgPyByZXQgOiAtRUFHQUlOOworICAgICAgICAgICAgICAgICAgICAgICAgaW50ZXJydXB0aWJsZV9zbGVlcF9vbigmY2FyZC0+bWlkaS5vd2FpdCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2lnbmFsX3BlbmRpbmcoY3VycmVudCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXQgPyByZXQgOiAtRVJFU1RBUlRTWVM7CisgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKGNvcHlfZnJvbV91c2VyKGNhcmQtPm1pZGkub2J1ZiArIHB0ciwgYnVmZmVyLCBjbnQpKQorICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJldCA/IHJldCA6IC1FRkFVTFQ7CisgICAgICAgICAgICAgICAgcHRyID0gKHB0ciArIGNudCkgJSBDU19NSURJT1VUQlVGOworICAgICAgICAgICAgICAgIHNwaW5fbG9ja19pcnFzYXZlKCZjYXJkLT5sb2NrLCBmbGFncyk7CisgICAgICAgICAgICAgICAgY2FyZC0+bWlkaS5vd3IgPSBwdHI7CisgICAgICAgICAgICAgICAgY2FyZC0+bWlkaS5vY250ICs9IGNudDsKKyAgICAgICAgICAgICAgICBzcGluX3VubG9ja19pcnFyZXN0b3JlKCZjYXJkLT5sb2NrLCBmbGFncyk7CisgICAgICAgICAgICAgICAgY291bnQgLT0gY250OworICAgICAgICAgICAgICAgIGJ1ZmZlciArPSBjbnQ7CisgICAgICAgICAgICAgICAgcmV0ICs9IGNudDsKKyAgICAgICAgICAgICAgICBzcGluX2xvY2tfaXJxc2F2ZSgmY2FyZC0+bG9jaywgZmxhZ3MpOworICAgICAgICAgICAgICAgIGNzX2hhbmRsZV9taWRpKGNhcmQpOworICAgICAgICAgICAgICAgIHNwaW5fdW5sb2NrX2lycXJlc3RvcmUoJmNhcmQtPmxvY2ssIGZsYWdzKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gcmV0OworfQorCisKK3N0YXRpYyB1bnNpZ25lZCBpbnQgY3NfbWlkaV9wb2xsKHN0cnVjdCBmaWxlICpmaWxlLCBzdHJ1Y3QgcG9sbF90YWJsZV9zdHJ1Y3QgKndhaXQpCit7CisgICAgICAgIHN0cnVjdCBjc19jYXJkICpjYXJkID0gKHN0cnVjdCBjc19jYXJkICopZmlsZS0+cHJpdmF0ZV9kYXRhOworICAgICAgICB1bnNpZ25lZCBsb25nIGZsYWdzOworICAgICAgICB1bnNpZ25lZCBpbnQgbWFzayA9IDA7CisKKyAgICAgICAgaWYgKGZpbGUtPmZfZmxhZ3MgJiBGTU9ERV9XUklURSkKKyAgICAgICAgICAgICAgICBwb2xsX3dhaXQoZmlsZSwgJmNhcmQtPm1pZGkub3dhaXQsIHdhaXQpOworICAgICAgICBpZiAoZmlsZS0+Zl9mbGFncyAmIEZNT0RFX1JFQUQpCisgICAgICAgICAgICAgICAgcG9sbF93YWl0KGZpbGUsICZjYXJkLT5taWRpLml3YWl0LCB3YWl0KTsKKyAgICAgICAgc3Bpbl9sb2NrX2lycXNhdmUoJmNhcmQtPmxvY2ssIGZsYWdzKTsKKyAgICAgICAgaWYgKGZpbGUtPmZfZmxhZ3MgJiBGTU9ERV9SRUFEKSB7CisgICAgICAgICAgICAgICAgaWYgKGNhcmQtPm1pZGkuaWNudCA+IDApCisgICAgICAgICAgICAgICAgICAgICAgICBtYXNrIHw9IFBPTExJTiB8IFBPTExSRE5PUk07CisgICAgICAgIH0KKyAgICAgICAgaWYgKGZpbGUtPmZfZmxhZ3MgJiBGTU9ERV9XUklURSkgeworICAgICAgICAgICAgICAgIGlmIChjYXJkLT5taWRpLm9jbnQgPCBDU19NSURJT1VUQlVGKQorICAgICAgICAgICAgICAgICAgICAgICAgbWFzayB8PSBQT0xMT1VUIHwgUE9MTFdSTk9STTsKKyAgICAgICAgfQorICAgICAgICBzcGluX3VubG9ja19pcnFyZXN0b3JlKCZjYXJkLT5sb2NrLCBmbGFncyk7CisgICAgICAgIHJldHVybiBtYXNrOworfQorCisKK3N0YXRpYyBpbnQgY3NfbWlkaV9vcGVuKHN0cnVjdCBpbm9kZSAqaW5vZGUsIHN0cnVjdCBmaWxlICpmaWxlKQoreworICAgICAgICB1bnNpZ25lZCBpbnQgbWlub3IgPSBpbWlub3IoaW5vZGUpOworICAgICAgICBzdHJ1Y3QgY3NfY2FyZCAqY2FyZD1OVUxMOworICAgICAgICB1bnNpZ25lZCBsb25nIGZsYWdzOworCXN0cnVjdCBsaXN0X2hlYWQgKmVudHJ5OworCisJbGlzdF9mb3JfZWFjaChlbnRyeSwgJmNzNDZ4eF9kZXZzKQorCXsKKwkJY2FyZCA9IGxpc3RfZW50cnkoZW50cnksIHN0cnVjdCBjc19jYXJkLCBsaXN0KTsKKwkJaWYgKGNhcmQtPmRldl9taWRpID09IG1pbm9yKQorCQkJYnJlYWs7CisJfQorCisJaWYgKGVudHJ5ID09ICZjczQ2eHhfZGV2cykKKwkJcmV0dXJuIC1FTk9ERVY7CisJaWYgKCFjYXJkKQorCXsKKwkJQ1NfREJHT1VUKENTX0ZVTkNUSU9OIHwgQ1NfT1BFTiwgMiwgcHJpbnRrKEtFUk5fSU5GTworCQkJImNzNDZ4eDogY3M0Nnh4X21pZGlfb3BlbigpOiBFcnJvciAtIHVuYWJsZSB0byBmaW5kIGNhcmQgc3RydWN0XG4iKSk7CisJCXJldHVybiAtRU5PREVWOworCX0KKworICAgICAgICBmaWxlLT5wcml2YXRlX2RhdGEgPSBjYXJkOworICAgICAgICAvKiB3YWl0IGZvciBkZXZpY2UgdG8gYmVjb21lIGZyZWUgKi8KKyAgICAgICAgZG93bigmY2FyZC0+bWlkaS5vcGVuX3NlbSk7CisgICAgICAgIHdoaWxlIChjYXJkLT5taWRpLm9wZW5fbW9kZSAmIGZpbGUtPmZfbW9kZSkgeworICAgICAgICAgICAgICAgIGlmIChmaWxlLT5mX2ZsYWdzICYgT19OT05CTE9DSykgeworICAgICAgICAgICAgICAgICAgICAgICAgdXAoJmNhcmQtPm1pZGkub3Blbl9zZW0pOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC1FQlVTWTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgdXAoJmNhcmQtPm1pZGkub3Blbl9zZW0pOworICAgICAgICAgICAgICAgIGludGVycnVwdGlibGVfc2xlZXBfb24oJmNhcmQtPm1pZGkub3Blbl93YWl0KTsKKyAgICAgICAgICAgICAgICBpZiAoc2lnbmFsX3BlbmRpbmcoY3VycmVudCkpCisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gLUVSRVNUQVJUU1lTOworICAgICAgICAgICAgICAgIGRvd24oJmNhcmQtPm1pZGkub3Blbl9zZW0pOworICAgICAgICB9CisgICAgICAgIHNwaW5fbG9ja19pcnFzYXZlKCZjYXJkLT5taWRpLmxvY2ssIGZsYWdzKTsKKyAgICAgICAgaWYgKCEoY2FyZC0+bWlkaS5vcGVuX21vZGUgJiAoRk1PREVfUkVBRCB8IEZNT0RFX1dSSVRFKSkpIHsKKyAgICAgICAgICAgICAgICBjYXJkLT5taWRpLmlyZCA9I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ljIGludCBjc19taWRpX3JlbGVhc2Uoc3RydWN0IGlub2RlICppbm9kZSwgc3RydWN0IGZpbGUgKmZpbGUpCit7CisgICAgICAgIHN0cnVjdCBjc19jYXJkICpjYXJkID0gKHN0cnVjdCBjc19jYXJkICopZmlsZS0+cHJpdmF0ZV9kYXRhOworICAgICAgICBERUNMQVJFX1dBSVRRVUVVRSh3YWl0LCBjdXJyZW50KTsKKyAgICAgICAgdW5zaWduZWQgbG9uZyBmbGFnczsKKyAgICAgICAgdW5zaWduZWQgY291bnQsIHRtbzsKKworICAgICAgICBpZiAoZmlsZS0+Zl9tb2RlICYgRk1PREVfV1JJVEUpIHsKKyAgICAgICAgICAgICAgICBjdXJyZW50LT5zdGF0ZSA9IFRBU0tfSU5URVJSVVBUSUJMRTsKKyAgICAgICAgICAgICAgICBhZGRfd2FpdF9xdWV1ZSgmY2FyZC0+bWlkaS5vd2FpdCwgJndhaXQpOworICAgICAgICAgICAgICAgIGZvciAoOzspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNwaW5fbG9ja19pcnFzYXZlKCZjYXJkLT5taWRpLmxvY2ssIGZsYWdzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvdW50ID0gY2FyZC0+bWlkaS5vY250OworICAgICAgICAgICAgICAgICAgICAgICAgc3Bpbl91bmxvY2tfaXJxcmVzdG9yZSgmY2FyZC0+bWlkaS5sb2NrLCBmbGFncyk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY291bnQgPD0gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2lnbmFsX3BlbmRpbmcoY3VycmVudCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGUtPmZfZmxhZ3MgJiBPX05PTkJMT0NLKQorICAgICAgICAgICAgICAgICAgICAgICAgCWJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgdG1vID0gKGNvdW50ICogSFopIC8gMzEwMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc2NoZWR1bGVfdGltZW91dCh0bW8gPyA6IDEpICYmIHRtbykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRrKEtFUk5fREVCVUcgImNzNDZ4eDogbWlkaSB0aW1lZCBvdXQ/P1xuIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJlbW92ZV93YWl0X3F1ZXVlKCZjYXJkLT5taWRpLm93YWl0LCAmd2FpdCk7CisgICAgICAgICAgICAgICAgY3VycmVudC0+c3RhdGUgPSBUQVNLX1JVTk5JTkc7CisgICAgICAgIH0KKyAgICAgICAgZG93bigmY2FyZC0+bWlkaS5vcGVuX3NlbSk7CisgICAgICAgIGNhcmQtPm1pZGkub3Blbl9tb2RlICY9ICh+KGZpbGUtPmZfbW9kZSAmIChGTU9ERV9SRUFEIHwgRk1PREVfV1JJVEUpKSk7CisgICAgICAgIHVwKCZjYXJkLT5taWRpLm9wZW5fc2VtKTsKKyAgICAgICAgd2FrZV91cCgmY2FyZC0+bWlkaS5vcGVuX3dhaXQpOworICAgICAgICByZXR1cm4gMDsKK30KKworLyoKKyAqICAgTWlkaSBmaWxlIG9wZXJhdGlvbnMgc3RydWN0LgorICovCitzdGF0aWMgLypjb25zdCovIHN0cnVjdCBmaWxlX29wZXJhdGlvbnMgY3NfbWlkaV9mb3BzID0geworCUNTX09XTkVSCUNTX1RISVNfTU9EVUxFCisJLmxsc2VlawkJPSBub19sbHNlZWssCisJLnJlYWQJCT0gY3NfbWlkaV9yZWFkLAorCS53cml0ZQkJPSBjc19taWRpX3dyaXRlLAorCS5wb2xsCQk9IGNzX21pZGlfcG9sbCwKKwkub3BlbgkJPSBjc19taWRpX29wZW4sCisJLnJlbGVhc2UJPSBjc19taWRpX3JlbGVhc2UsCit9OworCisvKgorICoKKyAqIENvcHlTYW1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ilkc3Q7CisKKyAgICBDU19EQkdPVVQoQ1NfRlVOQ1RJT04sIDIsIHByaW50ayhLRVJOX0lORk8gImNzNDZ4eDogQ29weVNhbXBsZXMoKSsgIikgKTsKKyAgICBDU19EQkdPVVQoQ1NfV0FWRV9SRUFELCA4LCBwcmludGsoS0VSTl9JTkZPCisJIiBkc3Q9JXAgc3JjPSVwIGNvdW50PSVkIGZtdD0weCV4XG4iLAorCWRzdCxzcmMsY291bnQsZm10KSApOworCisgICAgLyoKKyAgICAgKiBTZWUgaWYgdGhlIGRhdGEgc2hvdWxkIGJlIG91dHB1dCBhcyA4LWJpdCB1bnNpZ25lZCBzdGVyZW8uCisgICAgICovCisgICAgaWYoKGZtdCAmIENTX0ZNVF9TVEVSRU8pICYmICEoZm10ICYgQ1NfRk1UXzE2QklUKSkKKyAgICB7CisgICAgICAgIC8qCisgICAgICAgICAqIENvbnZlcnQgZWFjaCAxNi1iaXQgc2lnbmVkIHN0ZXJlbyBzYW1wbGUgdG8gOC1iaXQgdW5zaWduZWQgCisJICogc3RlcmVvIHVzaW5nIHJvdW5kaW5nLgorICAgICAgICAgKi8KKyAgICAgICAgcHNTcmMgPSAoczE2ICopc3JjOworCWNvdW50ID0gY291bnQvMjsKKyAgICAgICAgd2hpbGUoY291bnQtLSkKKyAgICAgICAgeworICAgICAgICAgICAgKihwdWNEc3QrKykgPSAodTgpKCgoczE2KSgqcHNTcmMrKykgKyAoczE2KTB4ODAwMCkgPj4gOCk7CisgICAgICAgIH0KKyAgICB9CisgICAgLyoKKyAgICAgKiBTZWUgaWYgdGhlIGRhdGEgc2hvdWxkIGJlIG91dHB1dCBhdCA4LWJpdCB1bnNpZ25lZCBtb25vLgorICAgICAqLworICAgIGVsc2UgaWYoIShmbXQgJiBDU19GTVRfU1RFUkVPKSAmJiAhKGZtdCAmIENTX0ZNVF8xNkJJVCkpCisgICAgeworICAgICAgICAvKgorICAgICAgICAgKiBDb252ZXJ0IGVhY2ggMTYtYml0IHNpZ25lZCBzdGVyZW8gc2FtcGxlIHRvIDgtYml0IHVuc2lnbmVkIAorCSAqIG1vbm8gdXNpbmcgYXZlcmFnaW5nIGFuZCByb3VuZGluZy4KKyAgICAgICAgICovCisgICAgICAgIHBzU3JjID0gKHMxNiAqKXNyYzsKKwljb3VudCA9IGNvdW50LzI7CisgICAgICAgIHdoaWxlKGNvdW50LS0pCisgICAgICAgIHsKKwkgICAgczMyQXVkaW9TYW1wbGUgPSAoKCpwc1NyYykrKCoocHNTcmMgKyAxKSkpLzIgKyAoczMyKTB4ODA7CisJICAgIGlmKHMzMkF1ZGlvU2FtcGxlID4gMHg3ZmZmKQorCSAgICAJczMyQXVkaW9TYW1wbGUgPSAweDdmZmY7CisgICAgICAgICAgICAqKHB1Y0RzdCsrKSA9ICh1OCkoKChzMTYpczMyQXVkaW9TYW1wbGUgKyAoczE2KTB4ODAwMCkgPj4gOCk7CisJICAgIHBzU3JjICs9IDI7CisgICAgICAgIH0KKyAgICB9CisgICAgLyoKKyAgICAgKiBTZWUgaWYgdGhlIGRhdGEgc2hvdWxkIGJlIG91dHB1dCBhdCAxNi1iaXQgc2lnbmVkIG1vbm8uCisgICAgICovCisgICAgZWxzZSBpZighKGZtdCAmIENTX0ZNVF9TVEVSRU8pICYmIChmbXQgJiBDU19GTVRfMTZCSVQpKQorICAgIHsKKyAgICAgICAgLyoKKyAgICAgICAgICogQ29udmVydCBlYWNoIDE2LWJpdCBzaWduZWQgc3RlcmVvIHNhbXBsZSB0byAxNi1iaXQgc2lnbmVkIAorCSAqIG1vbm8gdXNpbmcgYXZlcmFnaW5nLgorICAgICAgICAgKi8KKyAgICAgICAgcHNTcmMgPSAoczE2ICopc3JjOworCWNvdW50ID0gY291bnQvMjsKKyAgICAgICAgd2hpbGUoY291bnQtLSkKKyAgICAgICAgeworICAgICAgICAgICAgKihwc0RzdCsrKSA9IChzMTYpKCgqcHNTcmMpKygqKHBzU3JjICsgMSkpKS8yOworCSAgICBwc1NyYyArPSAyOworICAgICAgICB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+cG0udTMyQUM5N19wb3dlcmRvd24gPSAodTMyKWNzX2FjOTdfZ2V0KGRldiwgKHU4KUFDOTdfUE9XRVJfQ09OVFJPTCk7IAorCWNhcmQtPnBtLnUzMkFDOTdfZ2VuZXJhbF9wdXJwb3NlID0gKHUzMiljc19hYzk3X2dldChkZXYsICh1OClCQTBfQUM5N19HRU5FUkFMX1BVUlBPU0UpOyAKKy8qCisqIEFuZCBwb3dlciBkb3duIGV2ZXJ5dGhpbmcgb24gdGhlIEFDOTcgY29kZWMuCisqIHdlbGwsIGZvciBub3csIG9ubHkgcG93ZXIgZG93biB0aGUgREFDL0FEQyBhbmQgTUlYRVIgVlJFRk9OIGNvbXBvbmVudHMuIAorKiB0cm91YmxlIHdpdGggcmVtb3ZpbmcgVlJFRi4KKyovCisJaWYoICh0bXAgPSBjczQ2MXhfcG93ZXJkb3duKGNhcmQsIENTX1BPV0VSX0RBQyB8IENTX1BPV0VSX0FEQyB8CisJCQlDU19QT1dFUl9NSVhWT04sIENTX1RSVUUgKSkgKQorCXsKKwkJQ1NfREJHT1VUKENTX0VSUk9SIHwgQ1NfSU5JVCwgMSwgcHJpbnRrKEtFUk5fSU5GTyAKKwkJCSJjczQ2eHg6IGNzNDZ4eF9hYzk3X3N1c3BlbmQoKSBmYWlsdXJlICgweCV4KVxuIix0bXApICk7CisJfQorCisJQ1NfREJHT1VUKENTX1BNLCA5LCBwcmludGsoImNzNDZ4eDogY3M0Nnh4X2FjOTdfc3VzcGVuZCgpLVxuIikpOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKgorKiAgUmVzdW1lIC0gcG93ZXIgdXAgdGhlIHBhcnQgYW5kIHJlc3RvcmUgaXRzIHJlZ2lzdGVycy4uICAKKyoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi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pZmljIGluZm8gKi8KK30gY29wcm9jX29wZXJhdGlvbnM7CisKK3N0cnVjdCBhdWRpb19kcml2ZXIgCit7CisJc3RydWN0IG1vZHVsZSAqb3duZXI7CisJaW50ICgqb3BlbikgKGludCBkZXYsIGludCBtb2RlKTsKKwl2b2lkICgqY2xvc2UpIChpbnQgZGV2KTsKKwl2b2lkICgqb3V0cHV0X2Jsb2NrKSAoaW50IGRldiwgdW5zaWduZWQgbG9uZyBidWYsIAorCQkJICAgICAgaW50IGNvdW50LCBpbnQgaW50cmZsYWcpOworCXZvaWQgKCpzdGFydF9pbnB1dCkgKGludCBkZXYsIHVuc2lnbmVkIGxvbmcgYnVmLCAKKwkJCSAgICAgaW50IGNvdW50LCBpbnQgaW50cmZsYWcpOworCWludCAoKmlvY3RsKSAoaW50IGRldiwgdW5zaWduZWQgaW50IGNtZCwgdm9pZCBfX3VzZXIgKiBhcmcpOworCWludCAoKnByZXBhcmVfZm9yX2lucHV0KSAoaW50IGRldiwgaW50IGJ1ZnNpemUsIGludCBuYnVmcyk7CisJaW50ICgqcHJlcGFyZV9mb3Jfb3V0cHV0KSAoaW50IGRldiwgaW50IGJ1ZnNpemUsIGludCBuYnVmcyk7CisJdm9pZCAoKmhhbHRfaW8pIChpbnQgZGV2KTsKKwlpbnQgKCpsb2NhbF9xbGVuKShpbnQgZGV2KTsKKwl2b2lkICgqY29weV91c2VyKSAoaW50IGRldiwKKwkJCWNoYXIgKmxvY2FsYnVmLCBpbnQgbG9jYWxvZmZzLAorICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciBfX3VzZXIgKnVzZXJidWYsIGludCB1c2Vyb2ZmcywKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBtYXhfaW4sIGludCBtYXhfb3V0LAorICAgICAgICAgICAgICAgICAgICAgICAgaW50ICp1c2VkLCBpbnQgKnJldHVybmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgaW50IGxlbik7CisJdm9pZCAoKmhhbHRfaW5wdX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bWFfYnVmZnBhcm1zIGRtYXBzWzJdOworfTsKKworaW50ICpsb2FkX21peGVyX3ZvbHVtZXMoY2hhciAqbmFtZSwgaW50ICpsZXZlbHMsIGludCBwcmVzZW50KTsKKworc3RydWN0IG1peGVyX29wZXJhdGlvbnMgCit7CisJc3RydWN0IG1vZHVsZSAqb3duZXI7CisJY2hhciBpZFsxNl07CisJY2hhciBuYW1lWzY0XTsKKwlpbnQgKCppb2N0bCkgKGludCBkZXYsIHVuc2lnbmVkIGludCBjbWQsIHZvaWQgX191c2VyICogYXJnKTsKKwkKKwl2b2lkICpkZXZjOworCWludCBtb2RpZnlfY291bnRlcjsKK307CisKK3N0cnVjdCBzeW50aF9vcGVyYXRpb25zIAoreworCXN0cnVjdCBtb2R1bGUgKm93bmVyOworCWNoYXIgKmlkOwkvKiBVbmlxdWUgaWRlbnRpZmllciAoQVNDSUkpIG1heCAyOSBjaGFyICovCisJc3RydWN0IHN5bnRoX2luZm8gKmluZm87CisJaW50IG1pZGlfZGV2OworCWludCBzeW50aF90eXBlOworCWludCBzeW50aF9zdWJ0eXBlOworCisJaW50ICgqb3BlbikgKGludCBkZXYsIGludCBtb2RlKTsKKwl2b2lkICgqY2xvc2UpIChpbnQgZGV2KTsKKwlpbnQgKCppb2N0bCkgKGludCBkZXYsIHVuc2lnbmVkIGludCBjbWQsIHZvaWQgX191c2VyICogYXJnKTsKKwlpbnQgKCpraWxsX25vdGUpIChpbnQgZGV2LCBpbnQgdm9pY2UsIGludCBub3RlLCBpbnQgdmVsb2NpdHkpOworCWludCAoKnN0YXJ0X25vdGUpIChpbnQgZGV2LCBpbnQgdm9pY2UsIGludCBub3RlLCBpbnQgdmVsb2NpdHkpOworCWludCAoKnNldF9pbnN0cikgKGludCBkZXYsIGludCB2b2ljZSwgaW50IGluc3RyKTsKKwl2b2lkICgqcmVzZXQpIChpbnQgZGV2KTsKKwl2b2lkICgqaHdfY29udHJvbCkgKGludCBkZXYsIHVuc2lnbmVkIGNoYXIgKmV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AqYXVkaW9fZGV2c1tNQVhfQVVESU9fREVWXTsKK2ludCBudW1fYXVkaW9kZXZzOworc3RydWN0IG1peGVyX29wZXJhdGlvbnMgKm1peGVyX2RldnNbTUFYX01JWEVSX0RFVl07CitpbnQgbnVtX21peGVyczsKK3N0cnVjdCBzeW50aF9vcGVyYXRpb25zICpzeW50aF9kZXZzW01BWF9TWU5USF9ERVYrTUFYX01JRElfREVWXTsKK2ludCBudW1fc3ludGhzOworc3RydWN0IG1pZGlfb3BlcmF0aW9ucyAqbWlkaV9kZXZzW01BWF9NSURJX0RFVl07CitpbnQgbnVtX21pZGlzOworCitleHRlcm4gc3RydWN0IHNvdW5kX3RpbWVyX29wZXJhdGlvbnMgZGVmYXVsdF9zb3VuZF90aW1lcjsKK3N0cnVjdCBzb3VuZF90aW1lcl9vcGVyYXRpb25zICpzb3VuZF90aW1lcl9kZXZzW01BWF9USU1FUl9ERVZdID0geworCSZkZWZhdWx0X3NvdW5kX3RpbWVyLCBOVUxMCit9OyAKK2ludCBudW1fc291bmRfdGltZXJzID0gMTsKKyNlbHNlCitleHRlcm4gc3RydWN0IGF1ZGlvX29wZXJhdGlvbnMgKmF1ZGlvX2RldnNbTUFYX0FVRElPX0RFVl07CitleHRlcm4gaW50IG51bV9hdWRpb2RldnM7CitleHRlcm4gc3RydWN0IG1peGVyX29wZXJhdGlvbnMgKm1peGVyX2RldnNbTUFYX01JWEVSX0RFVl07CitleHRlcm4gaW50IG51bV9taXhlcnM7CitleHRlcm4gc3RydWN0IHN5bnRoX29wZXJhdGlvbnMgKnN5bnRoX2RldnNbTUFYX1NZTlRIX0RFVitNQVhfTUlESV9ERVZdOworZXh0ZXJuIGludCBudW1fc3ludGhzOworZXh0ZXJuIHN0cnVjdCBtaWRpX29wZXJhdGlvbnMgKm1pZGlfZGV2c1tNQVhfTUlESV9ERVZdOworZXh0ZXJuIGludCBudW1fbWlkaXM7CitleHRlcm4gc3RydWN0IHNvdW5kX3RpbWVyX29wZXJhdGlvbn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b3VuZF9jb3JlLm8gZG1hc291bmRfYXRhcmkubworb2JqLSQoQ09ORklHX0RNQVNPVU5EX1BNQUMpCSs9IGRtYXNvdW5kX2NvcmUubyBkbWFzb3VuZF9wbWFjLm8KK29iai0kKENPTkZJR19ETUFTT1VORF9QQVVMQSkJKz0gZG1hc291bmRfY29yZS5vIGRtYXNvdW5kX3BhdWxhLm8KK29iai0kKENPTkZJR19ETUFTT1VORF9RNDApCSs9IGRtYXNvdW5kX2NvcmUubyBkbWFzb3VuZF9xNDAubwpkaWZmIC0tZ2l0IGEvc291bmQvb3NzL2RtYXNvdW5kL2F3YWNzX2RlZnMuaCBiL3NvdW5kL29zcy9kbWFzb3VuZC9hd2Fjc19kZWZzLmgKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMjE5NGY0NgotLS0gL2Rldi9udWxsCisrKyBiL3NvdW5kL29zcy9kbWFzb3VuZC9hd2Fjc19kZWZzLmgKQEAgLTAsMCArMSwyNTEgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBUaGlzIGZpbGUgd2FzIHdyaXR0ZW4gYnkgc29tZW9uZSwgc29tZXdoZXJlLCBzb21ldGltZSAqLworLyogQW5kIGlzIHJlbGVhc2VkIGludG8gdGhlIFB1YmxpYyBEb21haW4gICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNpZm5kZWYgX0FXQUNTX0RFRlNfSF8KKyNkZWZpbmUgX0FXQUNTX0RFRlNfSF8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBBV0FDcyBBdWRpbyBSZWdpc3RlciBMYXlvdXQgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdHJ1Y3QgYXdhY3NfcmVncyB7CisgICAgdW5zaWduZWQJY29ud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kKKyNlbmRpZgorCisvKiBkZXNjcmlwdGlvbiBvZiB0aGUgc2V0LXVwIGFwcGxpZXMgdG8gZWl0aGVyIGhhcmQgb3Igc29mdCBzZXR0aW5ncyAqLworCit0eXBlZGVmIHN0cnVjdCB7CisgICAgaW50IGZvcm1hdDsJCS8qIEFGTVRfKiAqLworICAgIGludCBzdGVyZW87CQkvKiAwID0gbW9ubywgMSA9IHN0ZXJlbyAqLworICAgIGludCBzaXplOwkJLyogOC8xNiBiaXQqLworICAgIGludCBzcGVlZDsJCS8qIHNwZWVkICovCit9IFNFVFRJTkdTOworCisgICAgLyoKKyAgICAgKiAgTWFjaGluZSBkZWZpbml0aW9ucworICAgICAqLworCit0eXBlZGVmIHN0cnVjdCB7CisgICAgY29uc3QgY2hhciAqbmFtZTsKKyAgICBjb25zdCBjaGFyICpuYW1lMjsKKyAgICBzdHJ1Y3QgbW9kdWxlICpvd25lcjsKKyAgICB2b2lkICooKmRtYV9hbGxvYykodW5zaWduZWQgaW50LCBpbnQpOworICAgIHZvaWQgKCpkbWFfZnJlZSkodm9pZCAqLCB1bnNpZ25lZCBpbnQpOworICAgIGludCAoKmlycWluaXQpKHZvaWQpOworI2lmZGVmIE1PRFVMRQorICAgIHZvaWQgKCppcnFjbGVhbnVwKSh2b2lkKTsKKyNlbmRpZgorICAgIHZvaWQgKCppbml0KSh2b2lkKTsKKyAgICB2b2lkICgqc2lsZW5jZSkodm9pZCk7CisgICAgaW50ICgqc2V0Rm9ybWF0KShpbnQpOworICAgIGludCAoKnNldFZvbHVtZSkoaW50KTsKKyAgICBpbnQgKCpzZXRCYXNzKShpbnQpOworICAgIGludCAoKnNldFRyZWJsZSkoaW50KTsKKyAgICBpbnQgKCpzZXRHYWluKShpbnQpOworICAgIHZvaWQgKCpwbGF5KSh2b2lkKTsKKyAgICB2b2lkICgqcmVjb3JkKSh2b2lkKTsJCS8qIG9wdGlvbmFsICovCisgICAgdm9pZCAoKm1peGVyX2luaXQpKHZvaWQpOwkJLy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KKwkJZGFjYV9nZXRfdm9sdW1lKCYgZGF0YSwgJmRhdGEpOworCQlyYyA9IElPQ1RMX09VVChhcmcsIGRhdGEpOworCQlicmVhazsKKwljYXNlIFNPVU5EX01JWEVSX09VVE1BU0s6CisJY2FzZSBTT1VORF9NSVhFUl9PVVRTUkM6CisJZGVmYXVsdDoKKwkJcmMgPSAtRUlOVkFMOworCX0KKwlyZXR1cm4gcmM7Cit9CisKK3N0YXRpYyBpbnQgUE1hY01peGVySW9jdGwodV9pbnQgY21kLCB1X2xvbmcgYXJnKQoreworCWludCByYzsKKwkKKwkvKiBEaWZmZXJlbnQgSU9DVExTIGZvciBidXJndW5keSBhbmQsIGV2ZW50dWFsbHksIERBQ0EgJiBUdW1ibGVyICovCisKKwlUUllfTE9DSygpOworCQorCXN3aXRjaCAoYXdhY3NfcmV2aXNpb24peworCQljYXNlIEFXQUNTX0JVUkdVTkRZOgorCQkJcmMgPSBidXJndW5keV9taXhlcl9pb2N0bChjbWQsIGFyZyk7CisJCQlicmVhayA7CisJCWNhc2UgQVdBQ1NfREFDQToKKwkJCXJjID0gZGFjYV9taXhlcl9pb2N0bChjbWQsIGFyZyk7CisJCQlicmVhazsKKwkJY2FzZSBBV0FDU19UVU1CTEVSOgorCQljYXNlIEFXQUNTX1NOQVBQRVI6CisJCQlyYyA9IHRhc19taXhlcl9pb2N0bChjbWQsIGFyZyk7CisJCQlicmVhayA7CisJCWRlZmF1bHQ6IC8qIDstKSkgKi8KKwkJCXJjID0gYXdhY3NfbWl4ZXJfaW9jdGwoY21kLCBhcmcpOworCX0KKworCVVOTE9DSygpOworCQorCXJldHVybiByYzsKK30KKworc3RhdGljIHZvaWQgUE1hY01peGVySW5pdCh2b2lkKQoreworCXN3aXRjaCAoYXdhY3NfcmV2aXNpb24pIHsKKwkJY2FzZSBBV0FDU19UVU1CTEVSOgorCQkgIHByaW50aygiQUUtSW5pdCB0dW1ibGVyIG1peGVyXG4iKTsKKwkJICBicmVhayA7CisJCWNhc2U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Z1bmN0aW9uIGZvciB1c2UgYnkgbG93LWxldmVsIGNvZGUsIGlmIHJlcXVpcmVkICovCisKK2NoYXIgKmdldF9hZm10X3N0cmluZyhpbnQgYWZtdCkKK3sKKyAgICAgICAgc3dpdGNoKGFmbXQpIHsKKyAgICAgICAgICAgIGNhc2UgQUZNVF9NVV9MQVc6CisgICAgICAgICAgICAgICAgcmV0dXJuICJtdS1sYXciOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBBRk1UX0FfTEFXOgorICAgICAgICAgICAgICAgIHJldHVybiAiQS1sYXciOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBBRk1UX1U4OgorICAgICAgICAgICAgICAgIHJldHVybiAidW5zaWduZWQgOCBiaXQiOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBBRk1UX1M4OgorICAgICAgICAgICAgICAgIHJldHVybiAic2lnbmVkIDggYml0IjsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgQUZNVF9TMTZfQkU6CisgICAgICAgICAgICAgICAgcmV0dXJuICJzaWduZWQgMTYgYml0IEJFIjsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgQUZNVF9VMTZfQkU6CisgICAgICAgICAgICAgICAgcmV0dXJuICJ1bnNpZ25lZCAxNiBiaXQgQkUiOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBBRk1UX1MxNl9MRToKKyAgICAgICAgICAgICAgICByZXR1cm4gInNpZ25lZCAxNiBiaXQgTEUiOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBBRk1UX1UxNl9MRToKKyAgICAgICAgICAgICAgICByZXR1cm4gInVuc2lnbmVkIDE2IGJpdCBMRSI7CisgICAgICAgICAgICAgICAgYnJlYWs7CisJICAgIGNhc2UgMDoKKwkJcmV0dXJuICJmb3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gMCkKKwkJdW5yZWdpc3Rlcl9zb3VuZF9kc3Aoc3FfdW5pdCk7Cit9CisKKyNlbHNlIC8qICFNT0RVTEUgKi8KKworc3RhdGljIGludCBkbWFzb3VuZF9zZXR1cChjaGFyICpzdHIpCit7CisJaW50IGludHNbNl0sIHNpemU7CisKKwlzdHIgPSBnZXRfb3B0aW9ucyhzdHIsIEFSUkFZX1NJWkUoaW50cyksIGludHMpOworCisJLyogY2hlY2sgdGhlIGJvb3RzdHJhcCBwYXJhbWV0ZXIgZm9yICJkbWFzb3VuZD0iICovCisKKwkvKiBGSVhNRTogb3RoZXIgdGhhbiBpbiB0aGUgbW9zdCBuYWl2ZSBvZiBjYXNlcyB0aGVyZSBpcyBubyBzZW5zZSBpbiB0aGVzZQorCSAqCSAgYnVmZmVycyBiZWluZyBvdGhlciB0aGFuIHBvd2VycyBvZiB0d28uICBUaGlzIGlzIG5vdCBjaGVja2VkIHlldC4KKwkgKi8KKworCXN3aXRjaCAoaW50c1swXSkgeworI2lmZGVmIEhBU19SRUNPUkQKKyAgICAgICAgY2FzZSA1OgorICAgICAgICAgICAgICAgIGlmICgoaW50c1s1XSA8IDApIHx8IChpbnRzWzVdID4gTUFYX0NBVENIX1JBRElVUykpCisgICAgICAgICAgICAgICAgICAgICAgICBwcmludGsoImRtYXNvdW5kX3NldHVwOiBpbnZhbGlkIGNhdGNoIHJhZGl1cywgdXNpbmcgZGVmYXVsdCA9ICVkXG4iLCBjYXRjaFJhZGl1cyk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgY2F0Y2hSYWRpdXMgPSBpbnRzWzVdOworICAgICAgICAgICAgICAgIC8qIGZhbGwgdGhyb3VnaCAqLworICAgICAgICBjYXNlIDQ6CisgICAgICAgICAgICAgICAgaWYgKGludHNbNF0gPCBNSU5fQlVGRkVSUykKKyAgICAgICAgICAgICAgICAgICAgICAgIHByaW50aygiZG1hc291bmRfc2V0dXA6IGludmFsaWQgbnVtYmVyIG9mIHJlYWQgYnVmZmVycywgdXNpbmcgZGVmYXVsdCA9ICVkXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtUmVhZEJ1ZnMpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgIG51bVJlYWRCdWZzID0gaW50c1s0XTsKKyAgICAgICAgICAgICAgICAvKiBmYWxsIHRocm91Z2ggKi8KKyAgICAgICAgY2FzZSAzOgorCQlpZiAoKHNpemUgPSBpbnRzWzNdKSA8IDI1NikgIC8qIGNoZWNrIGZvciBzbWFsbCBidWZmZXIgc3BlY3MgKi8KKwkJCXNpemUgPDw9IDEwIDsKKyAgICAgICAgICAgICAgICBpZiAoc2l6ZSA8IE1JTl9CVUZTSVpFIHx8IHNpemUgPiBNQVhfQlVGU0laRSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHByaW50aygiZG1hc291bmRfc2V0dXA6IGludmFsaWQgcmVhZCBidWZmZXIgc2l6ZSwgdXNpbmcgZGVmYXVsdCA9ICVkXG4iLCByZWFkQnVmU2l6ZSk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgcmVhZEJ1ZlNpemUgPSBzaXplOworICAgICAgICAgICAgICAgIC8qIGZhbGwgdGhyb3VnaCAqLworI2Vsc2UKKwljYXNlIDM6CisJCWlmICgoaW50c1szXSA8IDApIHx8IChpbnRzWzNdID4gTUFYX0NBVENIX1JBRElVUykpCisJCQlwcmludGsoImRtYXNvdW5kX3NldHVwOiBpbnZhbGlkIGNhdGNoIHJhZGl1cywgdXNpbmcgZGVmYXVsdCA9ICVkXG4iLCBjYXRjaFJhZGl1cyk7CisJCWVsc2UKKwkJCWNhdGNoUmFkaXVzID0gaW50c1szXTsKKwkJLyogZmFsbCB0aHJvdWdoICovCisjZW5kaWYKKwljYXNlIDI6CisJCWlmIChpbnRzWzFdIDwgTUlOX0JVRkZFUlMpCisJCQlwcmludGsoImRtYXNvdW5kX3NldHVwOiBpbnZhbGlkIG51bWJlciBvZiBidWZmZXJzLCB1c2luZyBkZWZhdWx0ID0gJWRcbiIsIG51bVdyaXRlQnVmcyk7CisJCWVsc2UKKwkJCW51bVdyaXRlQnVmcyA9IGludHNbMV07CisJCS8qIGZhbGwgdGhyb3VnaCAqLworCWNhc2UgMToKKwkJaWYgKChzaXplID0gaW50c1syXSkgPCAyNTYpIC8qIGNoZWNrIGZvciBzbWFsbCBidWZmZXIgc3BlY3MgKi8KKwkJCXNpemUgPDw9IDEwIDsKKyAgICAgICAgICAgICAgICBpZiAoc2l6ZSA8IE1JTl9CVUZTSVpFIHx8IHNpemUgPiBNQVhfQlVGU0laRSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHByaW50aygiZG1hc291bmRfc2V0dXA6IGludmFsaWQgd3JpdGUgYnVmZmVyIHNpemUsIHVzaW5nIGRlZmF1bHQgPSAlZFxuIiwgd3JpdGVCdWZTaXplKTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUJ1ZlNpemUgPSBzaXplOworCWNhc2UgMDoKKwkJYnJlYWs7CisJZGVmYXVsdDoKKwkJcHJpbnRrKCJkbWFzb3VuZF9zZXR1cDogaW52YWxpZCBudW1iZXIgb2YgYXJndW1lbnRzXG4iKTsKKwkJcmV0dXJuIDA7CisJfQorCXJldHVybiAxOworfQorCitfX3NldHVwKCJkbWFzb3VuZD0iLCBkbWFzb3VuZF9zZXR1cCk7CisKKyNlbmRpZiAvKiAhTU9EVUxFICovCisKKyAgICAvKgorICAgICAqICBDb252ZXJzaW9uIHRhYmxlcworICAgICAqLworCisjaWZkZWYgSEFTXzhCSVRfVEFCTEVTCisvKiA4IGJpdCBtdS1sYXcgKi8KKworY2hhciBkbWFzb3VuZF91bGF3MmRtYThbXSA9IHsKKwktMTI2LAktMTIyLAktMTE4LAktMTE0LAktMTEwLAktMTA2LAktMTAyLAktOTgsCisJLTk0LAktOTAsCS04Ni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hcnRiZWF0KCkJZG8geyB9IHdoaWxlICgwKQorI2RlZmluZSBlbmFibGVfaGVhcnRiZWF0KCkJZG8geyB9IHdoaWxlICgwKQorI2VuZGlmIC8qICFDT05GSUdfSEVBUlRCRUFUICovCisKKworLyoqKiBNaWQgbGV2ZWwgc3R1ZmYgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgdm9pZCBBbWlNaXhlckluaXQodm9pZCk7CitzdGF0aWMgaW50IEFtaU1peGVySW9jdGwodV9pbnQgY21kLCB1X2xvbmcgYXJnKTsKK3N0YXRpYyBpbnQgQW1pV3JpdGVTcVNldHVwKHZvaWQpOworc3RhdGljIGludCBBbWlTdGF0ZUluZm8oY2hhciAqYnVmZmVyLCBzaXplX3Qgc3BhY2UpOworCisKKy8qKiogVHJhbnNsYXRpb25zICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyogKytUZVNjaGU6IHJhZGljYWxseSBjaGFuZ2VkIGZvciBuZXcgZXhwYW5kaW5nIHB1cnBvc2VzLi4uCisgKgorICogVGhlc2UgdHdvIHJvdXRpbmVzIG5vdyBkZWFsIHdpdGggY29weWluZy9leHBhbmRpbmcvdHJhbnNsYXRpbmcgdGhlIHNhbXBsZXMKKyAqIGZyb20gdXNlciBzcGFjZSBpbnRvIG91ciBidWZmZXIgYXQgdGhlIHJpZ2h0IGZyZXF1ZW5jeS4gVGhleSB0YWtlIGNhcmUgYWJvdXQKKyAqIGhvdyBtdWNoIGRhdGEgdGhlcmUncyBhY3R1YWxseSB0byByZWFkLCBob3cgbXVjaCBidWZmZXIgc3BhY2UgdGhlcmUgaXMgYW5kCisgKiB0byBjb252ZXJ0IHNhbXBsZXMgaW50byB0aGUgcmlnaHQgZnJlcXVlbmN5L2VuY29kaW5nLiBUaGV5IHdpbGwgb25seSB3b3JrIG9uCisgKiBjb21wbGV0ZSB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IGlycXJldHVybl90IFE0MFN0ZXJlb0ludGVycnVwdChpbnQgaXJxLCB2b2lkICpkdW1teSwgc3RydWN0IHB0X3JlZ3MgKmZwKQoreworCXNwaW5fbG9jaygmZG1hc291bmQubG9jayk7CisgICAgICAgIGlmIChxNDBfc2M+MSl7CisgICAgICAgICAgICAqREFDX0xFRlQ9KnE0MF9wcCsrOworCSAgICAqREFDX1JJR0hUPSpxNDBfcHArKzsKKwkgICAgcTQwX3NjIC09MjsKKwkgICAgbWFzdGVyX291dGIoMSxTQU1QTEVfQ0xFQVJfUkVHKTsKKwl9ZWxzZSBRNDBJbnRlcnJ1cHQoKTsKKwlzcGluX3VubG9jaygmZG1hc291bmQubG9jayk7CisJcmV0dXJuIElSUV9IQU5ETEVEOworfQorc3RhdGljIGlycXJldHVybl90IFE0ME1vbm9JbnRlcnJ1cHQoaW50IGlycSwgdm9pZCAqZHVtbXksIHN0cnVjdCBwdF9yZWdzICpmcCkKK3sKKwlzcGluX2xvY2soJmRtYXNvdW5kLmxvY2spOworICAgICAgICBpZiAocTQwX3NjPjApeworICAgICAgICAgICAgKkRBQ19MRUZUPSpxNDBfcHA7CisJICAgICpEQUNfUklHSFQ9KnE0MF9wcCsrOworCSAgICBxNDBfc2MgLS07CisJICAgIG1hc3Rlcl9vdXRiKDEsU0FNUExFX0NMRUFSX1JFRyk7CisJfWVsc2UgUTQwSW50ZXJydXB0KCk7CisJc3Bpbl91bmxvY2soJmRtYXNvdW5kLmxvY2spOworCXJldHVybiBJUlFfSEFORExFRDsKK30KK3N0YXRpYyB2b2lkIFE0MEludGVycnVwdCh2b2lkKQoreworCWlmICghd3JpdGVfc3EuYWN0aXZlKSB7CisJICAgICAgICAgIC8qIHBsYXlpbmcgd2FzIGludGVycnVwdGVkIGFuZCBzcV9yZXNldCgpIGhhcyBhbHJlYWR5IGNsZWFyZWQKKwkJICAgKiB0aGUgc3EgdmFyaWFibGVzLCBzbyBiZXR0ZXIgZG9uJ3QgZG8gYW55dGhpbm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BUzMwMDFDICJUQVMzMDAxYyBkcml2ZXIgViAiIFRBUzMwMDFDX1ZFUlNJT04KKyNkZWZpbmUgSTJDX0RSSVZFUklEX1RBUzMwMDFDICAgKEkyQ19EUklWRVJJRF9UQVNfQkFTRSswKQorCitleHRlcm4gIHN0cnVjdCB0YXNfZHJpdmVyX2hvb2tzX3QgdGFzMzAwMWNfaG9va3M7CitleHRlcm4gc3RydWN0IHRhc19nYWluX3QgdGFzMzAwMWNfZ2FpbjsKK2V4dGVybiBzdHJ1Y3QgdGFzX2VxX3ByZWZfdCAqdGFzMzAwMWNfZXFfcHJlZnNbXTsKKworZW51bSB0YXMzMDAxY19yZWdfdCB7CisgIFRBUzMwMDFDX1JFR19NQ1IgICAgICAgICAgICAgICAgICAgID0gMHgwMSwKKyAgVEFTMzAwMUNfUkVHX0RSQyAgICAgICAgICAgICAgICAgICAgPSAweDAyLAorCisgIFRBUzMwMDFDX1JFR19WT0xVTUUgICAgICAgICAgICAgICAgID0gMHgwNCwKKyAgVEFTMzAwMUNfUkVHX1RSRUJMRSAgICAgICAgICAgICAgICAgPSAweDA1LAorICBUQVMzMDAxQ19SRUdfQkFTUyAgICAgICAgICAgICAgICAgICA9IDB4MDYsCisgIFRBUzMwMDFDX1JFR19NSVhFUjEgICAgICAgICAgICAgICAgID0gMHgwNywKKyAgVEFTMzAwMUNfUkVHX01JWEVSMiAgICAgICAgICAgICAgICAgPSAweDA4LAorCisgIFRBUzMwMDFDX1JFR19MRUZUX0JJUVVBRDAgICAgICAgICAgID0gMHgwYSwKKyAgVEFTMzAwMUNfUkVHX0xFRlRfQklRVUFEMSAgICAgICAgICAgPSAweDBiLAorICBUQVMzMDAxQ19SRUdfTEVGVF9CSVFVQUQyICAgICAgICAgICA9IDB4MGMsCisgIFRBUzMwMDFDX1JFR19MRUZUX0JJUVVBRDMgICAgICAgICAgID0gMHgwZCwKKyAgVEFTMzAwMUNfUkVHX0xFRlRfQklRVUFENCAgICAgICAgICAgPSAweDBlLAorIC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wKK307CisKK3N0YXRpYyBzdHJ1Y3QgdGFzX2VxX3ByZWZfdCBlcXBfMGVfMl8xID0geworICAuc2FtcGxlX3JhdGUgICA9IDQ0MTAwLAorICAuZGV2aWNlX2lkICAgICA9IDB4MGUsCisgIC5vdXRwdXRfaWQgICAgID0gVEFTX09VVFBVVF9FWFRFUk5BTF9TUEtSLAorICAuc3BlYWtlcl9pZCAgICA9IDB4MDEsCisKKyAgLmRyY2UgICAgICAgICAgPSAmZXFwXzBlXzJfMV9kcmNlLAorCisgIC5maWx0ZXJfY291bnQgID0gMTIsCisgIC5iaXF1YWRzICAgICAgID0gZXFwXzBlXzJfMV9iaXF1YWRzCit9OworCisvKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KKworc3RhdGljIHN0cnVjdCB0YXNfZHJjZV90IGVxcF8xMF8xXzBfZHJjZT17CisgIC5lbmFibGUgICAgID0gMSwKKyAgLmFib3ZlICAgICAgPSB7IC52YWwgPSAzLjAgKiAoMTw8OCksIC5leHBhbmQgPSAwIH0sCisgIC5iZWxvdyAgICAgID0geyAudmFsID0gMS4wICogKDE8PDgpLCAuZXhwYW5kID0gMCB9LAorICAudGhyZXNob2xkICA9IC0xMi40NiAgKiAoMTw8OCksCisgIC5lbmVyZ3kgICAgID0gMi40ICAgICAqICgxPDwxMiksCisgIC5hdHRhY2sgICAgID0gMC4wMTMgICAqICgxPDwxMiksCisgIC5kZWNheSAgICAgID0gMC4yMTIgICAqICgxPDwxMiksCit9OworCitzdGF0aWMgc3RydWN0IHRhc19iaXF1YWRfY3RybF90IGVxcF8xMF8xXzBfYmlxdWFkc1tdPXsKKyAgeyAuY2hhbm5lbCA9IDAsIC5maWx0ZXIgPSAwLCAuZGF0YSA9IHsgLmNvZWZmID0geyAweDBGNEExMiwgMHhFMTZCREEsIDB4MEY0QTEyLCAweEUxNzNGMCwgMHgwRTlDM0EgfSB9IH0sCis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H0sCit9OworCitzdGF0aWMgc3RydWN0IHRhc19lcV9wcmVmX3QgZXFwXzE1XzJfMSA9IHsKKyAgLnNhbXBsZV9yYXRlICAgPSA0NDEwMCwKKyAgLmRldmljZV9pZCAgICAgPSAweDE1LAorICAub3V0cHV0X2lkICAgICA9IFRBU19PVVRQVVRfRVhURVJOQUxfU1BLUiwKKyAgLnNwZWFrZXJfaWQgICAgPSAweDAxLAorCisgIC5kcmNlICAgICAgICAgID0gJmVxcF8xNV8yXzFfZHJjZSwKKworICAuZmlsdGVyX2NvdW50ICA9IDEyLAorICAuYmlxdWFkcyAgICAgICA9IGVxcF8xNV8yXzFfYmlxdWFkcworfTsKKworLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCisKK3N0YXRpYyBzdHJ1Y3QgdGFzX2RyY2VfdCBlcXBfMTVfMV8wX2RyY2U9eworICAuZW5hYmxlICAgICA9IDEsCisgIC5hYm92ZSAgICAgID0geyAudmFsID0gMy4wICogKDE8PDgpLCAuZXhwYW5kID0gMCB9LAorICAuYmVsb3cgICAgICA9IHsgLnZhbCA9IDEuMCAqICgxPDw4KSwgLmV4cGFuZCA9IDAgfSwKKyAgLnRocmVzaG9sZCAgPSAwLjAgICAgICogKDE8PDgpLAorICAuZW5lcmd5ICAgICA9IDIuNCAgICAgKiAoMTw8MTIpLAorICAuYXR0YWNrICAgICA9IDAuMDEzICAgKiAoMTw8MTIpLAorICAuZGVjYXkgICAgICA9IDAuMjEyICAgKiAoMTw8MTIpLAorfTsKKworc3RhdGljIHN0cnVjdCB0YXNfYmlxdWFkX2N0cmxfdCBlcXBfMTVfMV8wX2JpcXVhZHNbXT17CisgIHsgLmNoYW5uZWwgPSAwLCAuZmlsdGVyID0gMCwgLmRhdGEgPSB7IC5jb2VmZiA9IHsgMHgwRkFEMDgsIDB4RTBBNUVGLCAweDBGQUQwOCwgMHhFMEE3OUQsIDB4MEY1Q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SwgICAgICAgMHg5YywgICAgICAgMHhiYiwKKwkgICAgICAweGRiLCAgICAgICAweGZiLCAgICAgIDB4MTFlLCAgICAgIDB4MTQzLAorCSAgICAgMHgxNmIsICAgICAgMHgxOTYsICAgICAgMHgxYzMsICAgICAgMHgxZjUsCisJICAgICAweDIyOSwgICAgICAweDI2MywgICAgICAweDI5ZiwgICAgICAweDJlMSwKKwkgICAgIDB4MzI4LCAgICAgIDB4MzczLCAgICAgIDB4M2M1LCAgICAgIDB4NDFiLAorCSAgICAgMHg0NzgsICAgICAgMHg0ZGMsICAgICAgMHg1NDcsICAgICAgMHg1YjgsCisJICAgICAweDYzMywgICAgICAweDZiNSwgICAgICAweDc0MCwgICAgICAweDdkNSwKKwkgICAgIDB4ODczLCAgICAgIDB4OTFjLCAgICAgIDB4OWQyLCAgICAgIDB4YTkyLAorCSAgICAgMHhiNWUsICAgICAgMHhjMzksICAgICAgMHhkMjIsICAgICAgMHhlMTksCisJICAgICAweGYyMCwgICAgIDB4MTAzNywgICAgIDB4MTE2MSwgICAgIDB4MTI5ZSwKKwkgICAgMHgxM2VkLCAgICAgMHgxNTUxLCAgICAgMHgxNmNhLCAgICAgMHgxODVkLAorCSAgICAweDFhMDgsICAgICAweDFiY2MsICAgICAweDFkYWMsICAgICAweDFmYTcsCisJICAgIDB4MjFjMSwgICAgIDB4MjNmYSwgICAgIDB4MjY1NSwgICAgIDB4MjhkNiwKKwkgICAgMHgyYjdjLCAgICAgMHgyZTRhLCAgICAgMHgzMTQxLCAgICAgMHgzNDY0LAorCSAgICAweDM3YjQsICAgICAweDNiMzUsICAgICAweDNlZTksICAgICAweDQyZDMsCisJICAgIDB4NDZmNiwgICAgIDB4NGI1MywgICAgIDB4NGZmMCwgICAgIDB4NTRjZSwKKwkgICAgMHg1OWYyLCAgICAgMHg1ZjVmLCAgICAgMHg2NTE5LCAgICAgMHg2YjI0LAorCSAgICAweDcxODMsICAgICAweDc4M2MsICAgICAweDdmNTMsICAgICAweDg2Y2MsCisJICAgIDB4OGVhZCwgICAgIDB4OTZmYSwgICAgIDB4OWZiYSwgICAgIDB4YThmMiwKKwkgICAgMHhiMmE3LCAgICAgMHhiY2UxLCAgICAgMHhjN2E1LCAgICAgMHhkMmZhLAorCSAgICAweGRlZTgsICAgICAweGViNzUsICAgICAweGY4YWEsICAgIDB4MTA2OGUsCisJICAgMHgxMTUyYSwgICAgMHgxMjQ4NywgICAgMHgxMzRhZCwgICAgMHgxNDVhNSwKKwkgICAweDE1NzdiLCAgICAweDE2YTM3LCAgICAweDE3ZGY1LCAgICAweDE5MmJkLAorCSAgIDB4MWE4OTAsICAgIDB4MWJmN2IsICAgIDB4MWQ3OGQsICAgIDB4MWYwZDEsCisJICAgMHgyMGI1NSwgICAgMHgyMjcyNywgICAgMHgyNDQ1NiwgICAgMHgyNjJmMiwKKwkgICAweDI4MzBiCit9OworCitzdGF0aWMgdWludCB0YXMzMDAxY19taXhlcl90YWJbXT17CisJICAgICAgIDB4MCwgICAgICAweDc0OCwgICAgICAweDliZSwgICAgICAweGJhZiwKKwkgICAgIDB4ZGE0LCAgICAgIDB4ZmIxLCAgICAgMHgxMWRlLCAgICAgMHgxNDMxLAorCSAgICAweDE2YWQsICAgICAweDE5NTksICAgICAweDFjMzcsICAgICAweDFmNGIsCisJICAgIDB4MjI5OCwgICAgIDB4MjYyOCwgICAgIDB4MjlmYiwgICAgIDB4MmUxMiwKKwkgICAgMHgzMjdkLCAgICAgMHgzNzM0LCAgICAgMHgzYzQ3LCAgICAgMHg0MWI0LAorCSAgICAweDQ3ODcsICAgICAweDRkYmUsICAgICAweDU0NmQsICAgICAweDViODYsCisJICAgIDB4NjMyZSwgICAgIDB4NmI1MiwgICAgIDB4NzQwMCwgICAgIDB4N2Q1NCwKKwkgICAgMHg4NzNiLCAgICAgMHg5MWM2LCAgICAgMHg5ZDFhLCAgICAgMHhhOTIwLAorCSAgICAweGI1ZTUsICAgICAweGMzOGMsICAgICAweGQyMWIsICAgICAweGUxOGYsCisJ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AxY190cmVibGVfdGFiW109eworCSAgICAgIDB4OTYsICAgICAgIDB4OTUsICAgICAgIDB4OTUsICAgICAgIDB4OTQsCisJICAgICAgMHg5MywgICAgICAgMHg5MiwgICAgICAgMHg5MiwgICAgICAgMHg5MSwKKwkgICAgICAweDkwLCAgICAgICAweDkwLCAgICAgICAweDhmLCAgICAgICAweDhlLAorCSAgICAgIDB4OGQsICAgICAgIDB4OGQsICAgICAgIDB4OGMsICAgICAgIDB4OGIsCisJICAgICAgMHg4YSwgICAgICAgMHg4YSwgICAgICAgMHg4OSwgICAgICAgMHg4OCwKKwkgICAgICAweDg4LCAgICAgICAweDg3LCAgICAgICAweDg2LCAgICAgICAweDg1LAorCSAgICAgIDB4ODUsICAgICAgIDB4ODQsICAgICAgIDB4ODMsICAgICAgIDB4ODMsCisJICAgICAgMHg4MiwgICAgICAgMHg4MSwgICAgICAgMHg4MCwgICAgICAgMHg4MCwKKwkgICAgICAweDdmLCAgICAgICAweDdlLCAgICAgICAweDdlLCAgICAgICAweDdkLAorCSAgICAgIDB4N2MsICAgICAgIDB4N2IsICAgICAgIDB4N2IsICAgICAgIDB4N2EsCisJICAgICAgMHg3OSwgICAgICAgMHg3OCwgICAgICAgMHg3OCwgICAgICAgMHg3NywKKwkgICAgICAweDc2LCAgICAgICAweDc2LCAgICAgICAweDc1LCAgICAgICAweDc0LAorCSAgICAgIDB4NzMsICAgICAgIDB4NzMsICAgICAgIDB4NzIsICAgICAgIDB4NzEsCisJICAgICAgMHg3MSwgICAgICAgMHg3MCwgICAgICAgMHg2ZSwgICAgICAgMHg2ZCwKKwkgICAgICAweDZkLCAgICAgICAweDZjLCAgICAgICAweDZiLCAgICAgICAweDZhLAorCSAgICAgIDB4NjksICAgICAgIDB4NjgsICAgICAgIDB4NjcsICAgICAgIDB4NjYsCisJICAgICAgMHg2NSwgICAgICAgMHg2MywgICAgICAgMHg2MiwgICAgICAgMHg2MiwKKwkgICAgICAweDYwLCAgICAgICAweDVmLCAgICAgICAweDVkLCAgICAgICAweDVjLAorCSAgICAgIDB4NWEsICAgICAgIDB4NTgsICAgICAgIDB4NTYsICAgICAgIDB4NTUsCisJICAgICAgMHg1MywgICAgICAgMHg1MSwgICAgICAgMHg0ZiwgICAgICAgMHg0YywKKwkgICAgICAweDRhLCAgICAgICAweDQ4LCAgICAgICAweDQ1LCAgICAgICAweDQzLAorCSAgICAgIDB4NDAsICAgICAgIDB4M2QsICAgICAgIDB4M2EsICAgICAgIDB4MzcsCisJICAgICAgMHgzNSwgICAgICAgMHgzMiwgICAgICAgMHgyZSwgICAgICAgMHgyYSwKKwkgICAgICAweDI3LCAgICAgICAweDIyLCAgICAgICAweDFlLCAgICAgICAweDFhLAorCSAgICAgIDB4MTUsICAgICAgIDB4MTEsICAgICAgICAweGMsICAgICAgICAweDcsCisJICAgICAgIDB4MQorfTsKKworc3RhdGljIHVpbnQgdGFzMzAwMWNfYmFzc190YWJbXT17CisJICAgICAgMHg4NiwgICAgICAgMHg4MywgICAgICAgMHg4MSwgICAgICAgMHg3ZiwKKwkgICAgICAweDdkLCAgICAgICAweDdiLCAgICAgICAweDc5LCAgICAgICAweDc4LAorCSAgICAgIDB4NzYsICAgICAgIDB4NzUsICAgICAgIDB4NzQsICAgICAgIDB4NzIsCisJICAgICAgMHg3MSwgICAgICAgMHg2ZiwgICAgICAgMHg2ZSwgICAgICAgMHg2ZCwKKwkgICAgICAweDZjLCAgICAgICAweDZiLCAgICAgICAweDY5LCAgICAgICAweDY3LAorCSAgICAgIDB4NjUsICAgICAgIDB4NjQsICAgICAgIDB4NjEsICAgICAgIDB4NjAsCisJICAgICAgMHg1ZSwgICAgICAgMHg1ZCwgICAgICAgMHg1YywgICAgICAgMHg1YiwKKwkgICAgICAweDVhLCAgICAgICAweDU5LCAgICAgICAweDU4LCAgICAgICAweDU3LAorCSAgICAgIDB4NTYsICAgICAgIDB4NTUsICAgICAgIDB4NTUsICAgICAgIDB4NTQsCisJICAgICAgMHg1MywgICAgICAgMHg1MiwgICAgICAgMHg1MCwgICAgICAgMHg0ZiwKKwkgICAgICAweDRkLCAgICAgICAweDRjLCAgICAgICAweDRiLCAgICAgICAweDQ5LAorCSAgICAgIDB4NDcsICAgICAgIDB4NDUsICAgICAgIDB4NDQsICAgICAgIDB4NDIsCisJICAgICAgMHg0MSwgICAgICAgMHgzZiwgICAgICAgMHgzZSwgICAgICAgMHgzZCwKKwkgICAgICAweDNjLCAgICAgICAweDNiLCAgICAgICAweDM5LCAgICAgICAweDM4LAorCSAgICAgIDB4MzcsICAgICAgIDB4MzYsICAgICAgIDB4MzUsICAgICAgIDB4MzQsCisJICAgICAgMHgzMywgICAgICAgMHgzMSwgICAgICAgMHgzMCwgICAgICAgMHgyZiwKKwkgICAgICAweDJlLCAgICAgICAweDJjLCAgICAgICAweDJiLCAgICAgICAweDJiLAorCSAgICAgIDB4MjksICAgICAgIDB4MjgsICAgICAgIDB4MjcsICAgICAgIDB4MjYsCisJICAgICAgMHgyNSwgICAgICAgMHgyNCwgICAgICAgMHgyMiwgICAgICAgMHgyMSwKKwkgICAgICAweDIwLCAgICAgICAweDFlLCAgICAgICAweDFjLCAgICAgICAweDE5LAorCSAgICAgIDB4MTgsICAgICAgIDB4MTgsICAgICAgIDB4MTcsICAgICAgIDB4MTYsCisJICAgICAgMHgxNSwgICAgICAgMHgxNCwgICAgICAgMHgxMywgICAgICAgMHgxMiwKKwkgICAgICAweDExLCAgICAgICAweDEwLCAgICAgICAgMHhmLCAgICAgICAgMHhlLAorCSAgICAgICAweGQsICAgICAgICAweGIsICAgICAgICAweGEsICAgICAgICAweDksCisJICAgICAgIDB4OCwgICAgICAgIDB4NiwgICAgICAgIDB4NCwgICAgICAgIDB4MiwKKwkgICAgICAgMHgxCit9OworCitzdHJ1Y3QgdGFzX2dhaW5fdCB0YXMzMDAxY19nYWluID0geworICAubWFzdGVyICA9IHRhczMwMDFjX21hc3Rlcl90YWIsCisgIC50cmVibGUgID0gdGFzMzAwMWNfdHJlYmxlX3RhYiwKK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HX0RSQyAgICAgICAgICAgICAgICAgICAgPSAweDAyLAorCisgIFRBUzMwMDRfUkVHX1ZPTFVNRSAgICAgICAgICAgICAgICAgPSAweDA0LAorICBUQVMzMDA0X1JFR19UUkVCTEUgICAgICAgICAgICAgICAgID0gMHgwNSwKKyAgVEFTMzAwNF9SRUdfQkFTUyAgICAgICAgICAgICAgICAgICA9IDB4MDYsCisgIFRBUzMwMDRfUkVHX0xFRlRfTUlYRVIgICAgICAgICAgICAgPSAweDA3LAorICBUQVMzMDA0X1JFR19SSUdIVF9NSVhFUiAgICAgICAgICAgID0gMHgwOCwKKworICBUQVMzMDA0X1JFR19MRUZUX0JJUVVBRDAgICAgICAgICAgID0gMHgwYSwKKyAgVEFTMzAwNF9SRUdfTEVGVF9CSVFVQUQxICAgICAgICAgICA9IDB4MGIsCisgIFRBUzMwMDRfUkVHX0xFRlRfQklRVUFEMiAgICAgICAgICAgPSAweDBjLAorICBUQVMzMDA0X1JFR19MRUZUX0JJUVVBRDMgICAgICAgICAgID0gMHgwZCwKKyAgVEFTMzAwNF9SRUdfTEVGVF9CSVFVQUQ0ICAgICAgICAgICA9IDB4MGUsCisgIFRBUzMwMDRfUkVHX0xFRlRfQklRVUFENSAgICAgICAgICAgPSAweDBmLAorICBUQVMzMDA0X1JFR19MRUZUX0JJUVVBRDYgICAgICAgICAgID0gMHgxMCwKKyAgCisgIFRBUzMwMDRfUkVHX1JJR0hUX0JJUVVBRDAgICAgICAgICAgPSAweDEzLAorICBUQVMzMDA0X1JFR19SSUdIVF9CSVFVQUQxICAgICAgICAgID0gMHgxNCwKKyAgVEFTMzAwNF9SRUdfUklHSFRfQklRVUFEMiAgICAgICAgICA9IDB4MTUsCisgIFRBUzMwMDRfUkVHX1JJR0hUX0JJUVVBRDMgICAgICAgICAgPSAweDE2LAorICBUQVMzMDA0X1JFR19SSUdIVF9CSVFVQUQ0ICAgICAgICAgID0gMHgxNywKKyAgVEFTMzAwNF9SRUdfUklHSFRfQklRVUFENSAgIC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MCB9IH0gfSwKKyAgeyAuY2hhbm5lbCA9IDEsIC5maWx0ZXIgPSA2LCAuZGF0YSA9IHsgLmNvZWZmID0geyAweDEwMDAwMCwgMHgwMDAwMDAsIDB4MDAwMDAwLCAweDAwMDAwMCwgMHgwMDAwMDAgfSB9IH0KK307CisKK3N0YXRpYyBzdHJ1Y3QgdGFzX2VxX3ByZWZfdCBlcXBfMThfMV8wID0geworICAuc2FtcGxlX3JhdGUgICA9IDQ0MTAwLAorICAuZGV2aWNlX2lkICAgICA9IDB4MTgsCisgIC5vdXRwdXRfaWQgICAgID0gVEFTX09VVFBVVF9JTlRFUk5BTF9TUEtSLAorICAuc3BlYWtlcl9pZCAgICA9IDB4MDAsCisKKyAgLmRyY2UgICAgICAgICAgPSAmZXFwXzE4XzFfMF9kcmNlLAorCisgIC5maWx0ZXJfY291bnQgID0gMTQsCisgIC5iaXF1YWRzICAgICAgID0gZXFwXzE4XzFfMF9iaXF1YWRzCit9OworCisvKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KKworc3RhdGljIHN0cnVjdCB0YXNfZHJjZV90IGVxcF8xYV8xXzBfZHJjZT17CisgIC5lbmFibGUgICAgID0gMSwKKyAgLmFib3ZlICAgICAgPSB7IC52YWwgPSAzLjAgKiAoMTw8OCksIC5leHBhbmQgPSAwIH0sCisgIC5iZWxvdyAgICAgID0geyAudmFsID0gMS4wICogKDE8PDgpLCAuZXhwYW5kID0gMCB9LAorICAudGhyZXNob2xkICA9IC0xMC43NSAgKiAoMTw8OCksCisgIC5lbmVyZ3kgICAgID0gMi40ICAgICAqICgxPDwxMiksCisgIC5hdHRhY2sgICAgID0gMC4wMTMgICAqICgxPDwxMiksCisgIC5kZWNheSAgICAgID0gMC4yMTIgICAqICgxPDwxMiksCit9OworCitzdGF0aWMgc3RydWN0IHRhc19iaXF1YWRfY3RybF90IGVxcF8xYV8xXzBfYmlxdWF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X3JhdGUgICA9IDQ0MTAwLAorICAuZGV2aWNlX2lkICAgICA9IDB4MWEsCisgIC5vdXRwdXRfaWQgICAgID0gVEFTX09VVFBVVF9JTlRFUk5BTF9TUEtSLAorICAuc3BlYWtlcl9pZCAgICA9IDB4MDAsCisKKyAgLmRyY2UgICAgICAgICAgPSAmZXFwXzFhXzFfMF9kcmNlLAorCisgIC5maWx0ZXJfY291bnQgID0gMTQsCisgIC5iaXF1YWRzICAgICAgID0gZXFwXzFhXzFfMF9iaXF1YWRzCit9OworCisvKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KKworc3RhdGljIHN0cnVjdCB0YXNfZHJjZV90IGVxcF8xY18xXzBfZHJjZT17CisgIC5lbmFibGUgICAgID0gMSwKKyAgLmFib3ZlICAgICAgPSB7IC52YWwgPSAzLjAgKiAoMTw8OCksIC5leHBhbmQgPSAwIH0sCisgIC5iZWxvdyAgICAgID0geyAudmFsID0gMS4wICogKDE8PDgpLCAuZXhwYW5kID0gMCB9LAorICAudGhyZXNob2xkICA9IC0xNC4zNCAgKiAoMTw8OCksCisgIC5lbmVyZ3kgICAgID0gMi40ICAgICAqICgxPDwxMiksCisgIC5hdHRhY2sgICAgID0gMC4wMTMgICAqICgxPDwxMiksCisgIC5kZWNheSAgICAgID0gMC4yMTIgICAqICgxPDwxMiksCit9OworCitzdGF0aWMgc3RydWN0IHRhc19iaXF1YWRfY3RybF90IGVxcF8xY18xXzBfYmlxdWFkc1tdPXsKKyAgeyAuY2hhbm5lbCA9IDAsIC5maWx0ZXIgPSAwLCAuZGF0YSA9IHsgLmNvZWZmID0geyAweDBmNGY5NSwgMHhlMTYwZDQsIDB4MGY0Zjk1LCAweGUxNjg2ZSwgMHgwZWE2YzUgfSB9IH0sCisgIHsgLmNoYW5uZWwgPSAwLCAuZmlsdGVyID0gMSwgLmRhdGEgPSB7IC5jb2VmZiA9IHsgMHgwN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MTQsCisgIC5iaXF1YWRzICAgICAgID0gZXFwXzFjXzFfMF9iaXF1YWRzCit9OworCisvKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KKworc3RhdGljIHVpbnQgdGFzMzAwNF9tYXN0ZXJfdGFiW109eworCSAgICAgICAweDAsICAgICAgIDB4NzUsICAgICAgIDB4OWMsICAgICAgIDB4YmIsCisJICAgICAgMHhkYiwgICAgICAgMHhmYiwgICAgICAweDExZSwgICAgICAweDE0MywKKwkgICAgIDB4MTZiLCAgICAgIDB4MTk2LCAgICAgIDB4MWMzLCAgICAgIDB4MWY1LAorCSAgICAgMHgyMjksICAgICAgMHgyNjMsICAgICAgMHgyOWYsICAgICAgMHgyZTEsCisJICAgICAweDMyOCwgICAgICAweDM3MywgICAgICAweDNjNSwgICAgICAweDQxYiwKKwkgICAgIDB4NDc4LCAgICAgIDB4NGRjLCAgICAgIDB4NTQ3LCAgICAgIDB4NWI4LAorCSAgICAgMHg2MzMsICAgICAgMHg2YjUsICAgICAgMHg3NDAsICAgICAgMHg3ZDUsCisJICAgICAweDg3MywgICAgICAweDkxYywgICAgICAweDlkMiwgICAgICAweGE5MiwKKwkgICAgIDB4YjVlLCAgICAgIDB4YzM5LCAgICAgIDB4ZDIyLCAgICAgIDB4ZTE5LAorCSAgICAgMHhmMjAsICAgICAweDEwMzcsICAgICAweDExNjEsICAgICAweDEyOWUsCisJICAgIDB4MTNlZCwgICAgIDB4MTU1MSwgICAgIDB4MTZjYSwgICAgIDB4MTg1ZCwKKwkgICAgMHgxYTA4LCAgICAgMHgxYmNjLCAgICAgMHgxZGFjLCAgICAgMHgxZmE3LAorCSAgICAweDIxYzEsICAgICAweDIzZmEsICAgICAweDI2NTUsICAgICAweDI4ZDYsCisJICAgIDB4MmI3YywgICAgIDB4MmU0YSwgICAgIDB4MzE0MSwgICAgIDB4MzQ2NCwKKwkgICAgMHgzN2I0LCAgICAgMHgzYjM1LCAgICAgMHgzZWU5LCAgICAgMHg0MmQzLAorCSAgICAweDQ2ZjYsICAgICAweDRiNTMsICAgICAweDRmZjAsICAgICAweDU0Y2UsCisJICAgIDB4NTlmMiwgICAgIDB4NWY1ZiwgICAgIDB4NjUxOSwgICAgIDB4NmIyNCwKKwkgICAgMHg3MTgzLCAgICAgMHg3ODNjLCAgICAgMHg3ZjUzLCAgICAgMHg4NmNjLAorCSAgICAweDhlYWQsICAgICAweDk2ZmEsICAgICAweDlmYmEsICAgICAweGE4ZjIsCisJICAgIDB4YjJhNywgICAgIDB4YmNlMSwgICAgIDB4YzdhNSwgICAgIDB4ZDJmYSwKKwkgICAgMHhkZWU4LCAgICAgMHhlYjc1LCAgICAgMHhmOGFhLCAgICAweDEwNjhlLAorCSAgIDB4MTE1MmEsICAgIDB4MTI0ODcsICAgIDB4MTM0YWQsICAgIDB4MTQ1YTUsCisJICAgMHgxNTc3YiwgICAgMHgxNmEzNywgICAgMHgxN2RmNSwgICAgMHgxOTJiZCwKKwkgICAweDFhODkwLCAgICAweDFiZjdiLCAgICAweDFkNzhkLCAgICAweDFmMGQxLAorCSAgIDB4MjBiNTUsICAgIDB4MjI3MjcsICAgIDB4MjQ0NTYsICAgIDB4MjYyZjIsCisJICAgMHgyODMwYgorfTsKKworc3RhdGljIHVpbnQgdGFzMzAwNF9taXhlcl90YWJbXT17CisJICAgICAgIDB4MCwgICAgICAweDc0OCwgICAgICAweDliZSwgICAgICAweGJhZiwKKwkgICAgIDB4ZGE0LCAgICAgIDB4ZmIxLCAgICAgMHgxMWRlLCAgICAgMHgxNDMxLAorCSAgICAweDE2YWQsICAgICAweDE5NTksICAgICAweDFjMzcsICAgICAweDFmNGIsCisJICAgIDB4MjI5OCwgICAgIDB4MjYyOCwgICAgIDB4MjlmYiwgICAgIDB4MmUxMiwKKwkgICAgMHgzMjdkLCAgICAgMHgzNzM0LCAgICAgMHgzYzQ3LCAgICAgMHg0MWI0LAorCSAgICAweDQ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gIDB4MTU3N2FjLCAgIDB4MTZhMzcwLCAgIDB4MTdkZjUxLCAgIDB4MTkyYmMyLAorCSAgMHgxYTg4ZjgsICAgMHgxYmY3YjcsICAgMHgxZDc4YzksICAgMHgxZjBkMDQsCisJICAweDIwYjU0MiwgICAweDIyNzI2OCwgICAweDI0NDU2NCwgICAweDI2MmYyNiwKKwkgIDB4MjgzMGFmCit9OworCitzdGF0aWMgdWludCB0YXMzMDA0X3RyZWJsZV90YWJbXT17CisJICAgICAgMHg5NiwgICAgICAgMHg5NSwgICAgICAgMHg5NSwgICAgICAgMHg5NCwKKwkgICAgICAweDkzLCAgICAgICAweDkyLCAgICAgICAweDkyLCAgICAgICAweDkxLAorCSAgICAgIDB4OTAsICAgICAgIDB4OTAsICAgICAgIDB4OGYsICAgICAgIDB4OGUsCisJICAgICAgMHg4ZCwgICAgICAgMHg4ZCwgICAgICAgMHg4YywgICAgICAgMHg4YiwKKwkgICAgICAweDhhLCAgICAgICAweDhhLCAgICAgICAweDg5LCAgICAgICAweDg4LAorCSAgICAgIDB4ODgsICAgICAgIDB4ODcsICAgICAgIDB4ODYsICAgICAgIDB4ODUsCisJICAgICAgMHg4NSwgICAgICAgMHg4NCwgICAgICAgMHg4MywgICAgICAgMHg4MywKKwkgICAgICAweDgyLCAgICAgICAweDgxLCAgICAgICAweDgwLCAgICAgICAweDgwLAorCSAgICAgIDB4N2YsICAgICAgIDB4N2UsICAgICAgIDB4N2UsICAgICAgIDB4N2QsCisJICAgICAgMHg3YywgICAgICAgMHg3YiwgICAgICAgMHg3YiwgICAgICAgMHg3YSwKKwkgICAgICAweDc5LCAgICAgICAweDc4LCAgICAgICAweDc4LCAgICAgICAweDc3LAorCSAgICAgIDB4NzYsICAgICAgIDB4NzYsICAgICAgIDB4NzUsICAgICAgIDB4NzQsCisJICAgICAgMHg3MywgICAgICAgMHg3MywgICAgICAgMHg3MiwgICAgICAgMHg3MSwKKwkgICAgICAweDcxLCAgICAgICAweDY4LCAgICAgICAweDQ1LCAgICAgICAweDViLAorCSAgICAgIDB4NmQsICAgICAgIDB4NmMsICAgICAgIDB4NmIsICAgICAgIDB4NmEsCisJICAgICAgMHg2OSwgICAgICAgMHg2OCwgICAgICAgMHg2NywgICAgICAgMHg2NiwKKwkgICAgICAweDY1LCAgICAgICAweDYzLCAgICAgICAweDYyLCAgICAgICAweDYyLAorCSAgICAgIDB4NjAsICAgICAgIDB4NWUsICAgICAgIDB4NWMsICAgICAgIDB4NWIsCisJICAgICAgMHg1OSwgICAgICAgMHg1NywgICAgICAgMHg1NSwgICAgICAgMHg1MywKKwkgICAgICAweDUyLCAgICAgICAweDRmLCAgICAgICAweDRkLCAgICAgICAweDRhLAorCSAgICAgIDB4NDgsICAgICAgIDB4NDYsICAgICAgIDB4NDMsICAgICAgIDB4NDAsCisJICAgICAgMHgzZCwgICAgICAgMHgzYSwgICAgICAgMHgzNiwgICAgICAgMHgzMywKKwkgICAgICAweDJmLCAgICAgICAweDJjLCAgICAgICAweDI3LCAgICAgICAweDIzLAorCSAgICAgIDB4MWYsICAgICAgIDB4MWEsICAgICAgIDB4MTUsICAgICAgICAweGYsCisJICAgICAgIDB4OCwgICAgICAgIDB4NSwgICAgICAgIDB4MiwgICAgICAgIDB4MSwKKwkgICAgICAgMHgxCit9OworCitzdGF0aWMgdWludCB0YXMzMDA0X2Jhc3NfdGFiW109eworCSAgICAgIDB4OTYsICAgICAgIDB4OTUsICAgICAgIDB4OTUsICAgICAgIDB4OTQsCisJICAgICAgMHg5MywgICAgICAgMHg5MiwgICAgICAgMHg5MiwgICAgICAgMHg5MSwKKwkgICAgICAweDkwLCAgICAgICAweDkwLCAgICAgICAweDhmLCAgICAgICAweDhlLAorCSAgICAgIDB4OGQsICAgICAgIDB4OGQsICAgICAgIDB4OGMsICAgICAgIDB4OGIsCisJICAgICAgMHg4YSwgICAgICAgMHg4YSwgICAgICAgMHg4OSwgICAgICAgMHg4OCwKKwkgICAgICAweDg4LCAgICAgICAweDg3LCAgICAgICAweDg2LCAgICAgICAweDg1LAorCSAgICAgIDB4ODUsICAgICAgIDB4ODQsICAgICAgIDB4ODMsICAgICAgIDB4ODMsCisJICAgICAgMHg4MiwgICAgICAgMHg4MSwgICAgICAgMHg4MCwgICAgICAgMHg4MCwKKwkgICAgICAweDdmLCAgICAgICAweDdlLCAgICAgICAweDdlLCAgICAgICAweDdkLAorCSAgICAgIDB4N2MsICAgICAgIDB4N2IsICAgICAgIDB4N2IsICAgICAgIDB4N2EsCisJICAgICAgMHg3OSwgICAgICAgMHg3OCwgICAgICAgMHg3OCwgICAgICAgMHg3NywKKwkgICAgICAweDc2LCAgICAgICAweDc2LCAgICAgICAweDc1LCAgICAgICAweDc0LAorCSAgICAgIDB4NzMsICAgICAgIDB4NzMsICAgICAgIDB4NzIsICAgICAgIDB4NzEsCisJICAgICAgMHg3MCwgICAgICAgMHg2ZiwgICAgICAgMHg2ZSwgICAgICAgMHg2ZCwKKwkgICAgICAweDZjLCAgICAgICAweDZiLCAgICAgICAweDZhLCAgICAgICAweDZhLAorCSAgICAgIDB4NjksICAgICAgIDB4NjcsICAgICAgIDB4NjYsICAgICAgIDB4NjYsCisJICAgICAgMHg2NSwgICAgICAgMHg2MywgICAgICAgMHg2MiwgICAgICAgMHg2MiwKKwkgICAgICAweDYxLCAgICAgICAweDYwLCAgICAgICAweDVlLCAgICAgICAweDVkLAorCSAgICAgIDB4NWIsICAgICAgIDB4NTksICAgICAgIDB4NTcsICAgICAgIDB4NTUsCisJICAgICAgMHg1MywgICAgICAgMHg1MSwgICAgICAgMHg0ZiwgICAgICAgMHg0YywKKwkgICAgICAweDRhLCAgICAgICAweDQ4LCAgICAgICAweDQ2LCAgICAgICAweDQ0LAorCSAgICAgIDB4NDEsICAgICAgIDB4M2UsICAgICAgIDB4M2IsICAgICAgIDB4MzgsCisJICAgICAgMHgzNiwgICAgICAgMHgzMywgICAgICAgMHgyZiwgICAgICAgMHgyYiwKKwkgICAgICAweDI4LCAgICAgICAweDI0LCAgICAgIC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RlBfS0VSTkVMKTsKKwlpZiAoIW5ld19jbGllbnQpCisJCXJldHVybiAtRU5PTUVNOworCW1lbXNldChuZXdfY2xpZW50LCAwLCBzaXplb2YoKm5ld19jbGllbnQpKTsKKworCW5ld19jbGllbnQtPmFkZHIgPSBhZGRyZXNzOworCW5ld19jbGllbnQtPmFkYXB0ZXIgPSBhZGFwdGVyOworCW5ld19jbGllbnQtPmRyaXZlciA9ICZ0YXNfZHJpdmVyOworCXN0cmxjcHkobmV3X2NsaWVudC0+bmFtZSwgY2xpZW50X25hbWUsIERFVklDRV9OQU1FX1NJWkUpOworCisgICAgICAgIGlmIChkcml2ZXJfaG9va3MtPmluaXQobmV3X2NsaWVudCkpCisJCWdvdG8gYmFpbDsKKworCS8qIFRlbGwgdGhlIGkyYyBsYXllciBhIG5ldyBjbGllbnQgaGFzIGFycml2ZWQgKi8KKwlpZiAoaTJjX2F0dGFjaF9jbGllbnQobmV3X2NsaWVudCkpIHsKKwkJZHJpdmVyX2hvb2tzLT51bmluaXQoZGV2X2dldF9kcnZkYXRhKCZuZXdfY2xpZW50LT5kZXYpKTsKKwkJZ290byBiYWlsOworCX0KKworCXRhc19jbGllbnQgPSBuZXdfY2xpZW50OworCXJldHVybiAwOworIGJhaWw6CisJdGFzX2NsaWVudCA9IE5VTEw7CisJa2ZyZWUobmV3X2NsaWVudCk7CisJcmV0dXJuIHJjOworfQorCitzdGF0aWMgaW50Cit0YXNfYXR0YWNoX2FkYXB0ZXIoc3RydWN0IGkyY19hZGFwdGVyICphZGFwdGVyKQoreworCWlmICghc3RybmNtcChhZGFwdGVyLT5uYW1lLCAibWFjLWlvIiwgNikpCisJCXJldHVybiB0YXNfZGV0ZWN0X2NsaWVudChhZGFwdGVyLCB0YXNfaTJjX2FkZHJlc3MpOworCXJldHVybiAwOworfQorCitzdGF0aWMgaW50Cit0YXNfZGV0YWNoX2NsaWVudChzdHJ1Y3QgaTJjX2NsaWVudCAqY2xpZW50KQoreworCWlmIChjbGllbnQgP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YgLS1naXQgYS9zb3VuZC9vc3MvZG1hc291bmQvdGFzX2NvbW1vbi5oIGIvc291bmQvb3NzL2RtYXNvdW5kL3Rhc19jb21tb24uaApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zYTZkNDg2Ci0tLSAvZGV2L251bGwKKysrIGIvc291bmQvb3NzL2RtYXNvdW5kL3Rhc19jb21tb24uaApAQCAtMCwwICsxLDI4NCBAQAorI2lmbmRlZiBfVEFTX0NPTU1PTl9IXworI2RlZmluZSBfVEFTX0NPTU1PTl9IXworCisjaW5jbHVkZSA8bGludXgvaTJjLmg+CisjaW5jbHVkZSA8bGludXgvc291bmRjYXJkLmg+CisjaW5jbHVkZSA8YXNtL3N0cmluZy5oPgorCisjZGVmaW5lIEkyQ19EUklWRVJJRF9UQVNfQkFTRSAgICgweEZFQkEpCisKKyNkZWZpbmUgU0VUXzRfMjAoc2hhZG93LCBvZmZzZXQsIHZhbCkgICAgICAgICAgICAgICAgICAgICAgICBcCisJZG8geyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJCShzaGFkb3cpWyhvZmZzZXQpKzBdID0gKCh2YWwpID4+IDE2KSAmIDB4ZmY7IFwKKwkJKHNoYWRvdylbKG9mZnNldCkrMV0gPSAoKHZhbCkgPj4gOCkgICYgMHhmZjsgXAorCQkoc2hhZG93KVsob2Zmc2V0KSsyXSA9ICgodmFsKSA+PiAwKSAgJiAweGZmOyBcCisJfSB3aGlsZSAoMCkKKworI2RlZmluZSBHRVRfNF8yMChzaGFkb3csIG9mZnNldCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwkoKCh1X2ludCkoKHNoYWRvdylbKG9mZnNldCkrMF0pIDw8IDE2KSB8ICAgICAgICAgICAgIFwKKwkgKCh1X2ludCkoKHNoYWRvdylbKG9mZnNldCkrMV0pIDw8ICA4KSB8ICAgICAgICAgICAgIFwKKwkgKCh1X2ludCkoKHNoYWRv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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogICAgIDgwMTAuaAorICogICAgIENvcHlyaWdodCAxOTk5LTIwMDEgQ3JlYXRpdmUgTGFicywgSW5jLgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogICAgIERhdGUJCSAgICBBdXRob3IJICAgIFN1bW1hcnkgb2YgY2hhbmdlcworICogICAgIC0tLS0JCSAgICAtLS0tLS0JICAgIC0tLS0tLS0tLS0tLS0tLS0tLQorICogICAgIE9jdG9iZXIgMjAsIDE5OTkgICAgIEJlcnRyYW5kIExlZSAgICBiYXNlIGNvZGUgcmVsZWFzZQorICogICAgIE5vdmVtYmVyIDIsIDE5OTkgICAgIEFsYW4gQ294CSAgICBDbGVhbmVkIG9mIDhiaXQgY2hhcnMsIERPUworICoJCQkJCSAgICBsaW5lIGVuZGluZ3MKKyAqICAgICBEZWNlbWJlciA4LCAxOTk5ICAgICBKb24gVGF5bG9yCSAgICBBZGRlZCBsb3RzIG9mIG5ldyByZWdpc3RlciBpbmZvCisgKiAgICAgTWF5IDE2LCAyMDAxICAgICAgICAgRGFuaWVsIEJlcnRyYW5kIEFkZGVkIHVub2ZmaWNpYWwgREJHIHJlZ2lzdGVyIGluZm8KKyAqICAgICBPY3QtTm92IDIwMDEgICAgICAgICBELkIuICAgICAgICAgICAgQWRkZWQgdW5vZmZpY2lhbCBBdWRpZ3kgcmVnaXN0ZXJzIAorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogICAgIFRoaXMgcHJvZ3JhbSBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IKKyAqICAgICBtb2RpZnkgaXQgdW5kZXIgdG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XJzaW9uOgorI2RlZmluZSBNQUpPUl9WRVIgMAorI2RlZmluZSBNSU5PUl9WRVIgMjAKKyNkZWZpbmUgRFJJVkVSX1ZFUlNJT04gIjAuMjBhIgorCisKKy8vIEF1ZGlneSBzcGVjaWZ5IHJlZ2lzdGVycyBhcmUgcHJlZml4ZWQgd2l0aCAnQV8nCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBQQ0kgZnVuY3Rpb24gMCByZWdpc3RlcnMsIGFkZHJlc3MgPSA8dmFsPiArIFBDSUJBU0UwCQkJCQkJKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNkZWZpbmUgUFRSCQkJMHgwMAkJLyogSW5kZXhlZCByZWdpc3RlciBzZXQgcG9pbnRlciByZWdpc3RlcgkqLworCQkJCQkJLyogTk9URTogVGhlIENIQU5ORUxOVU0gYW5kIEFERFJFU1Mgd29yZHMgY2FuCSovCisJCQkJCQkvKiBiZSBtb2RpZmllZCBpbmRlcGVuZGVudGx5IG9mIGVhY2ggb3RoZXIuCSovCisjZGVmaW5lIFBUUl9DSEFOTkVMTlVNX01BU0sJMHgwMDAwMDAzZgkvKiBGb3IgZWFjaCBwZXItY2hhbm5lbCByZWdpc3RlciwgaW5kaWNhdGVzIHRoZQkqLworCQkJCQkJLyogY2hhbm5lbCBudW1iZXIgb2YgdGhlIHJlZ2lzdGVyIHRvIGJlCQkqLworCQkJCQkJLyogYWNjZXNzZWQuICBGb3Igbm9uIHBlci1jaGFubmVsIHJlZ2lzdGVycyB0aGUJKi8KKwkJCQkJCS8qIHZhbHVlIHNob3VsZCBiZSBzZXQgdG8gemVyby4JCQkqLworI2RlZmluZSBQVFJfQUREUkVTU19NQVNLC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dlZAkqLworCQkJCQkJLyogYmVmb3JlIHRoZSBuZXcgcmF0ZSBpcyBndWFyYW50ZWVkIGFjY3VyYXRlLgkqLworI2RlZmluZSBUSU1FUl9SQVRFX01BU0sJCTB4MDNmZgkJLyogVGltZXIgaW50ZXJydXB0IHJhdGUgaW4gc2FtcGxlIHBlcmlvZHMJKi8KKwkJCQkJCS8qIDAgPT0gMTAyNCBwZXJpb2RzLCBbMS4uNF0gYXJlIG5vdCB1c2VmdWwJKi8KKworI2RlZmluZSBBQzk3REFUQQkJMHgxYwkJLyogQUM5NyByZWdpc3RlciBzZXQgZGF0YSByZWdpc3RlciAoMTYgYml0KQkqLworCisjZGVmaW5lIEFDOTdBRERSRVNTCQkweDFlCQkvKiBBQzk3IHJlZ2lzdGVyIHNldCBhZGRyZXNzIHJlZ2lzdGVyICg4IGJpdCkJKi8KKyNkZWZpbmUgQUM5N0FERFJFU1NfUkVBRFkJMHg4MAkJLyogUmVhZC1vbmx5IGJpdCwgcmVmbGVjdHMgQ09ERUMgUkVBRFkgc2lnbmFsCSovCisjZGVmaW5lIEFDOTdBRERSRVNTX0FERFJFU1MJMHg3ZgkJLyogQWRkcmVzcyBvZiBpbmRleGVkIEFDOTcgcmVnaXN0ZXIJCSovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qIEVtdTEwazEgcG9pbnRlci1vZmZzZXQgcmVnaXN0ZXIgc2V0LCBhY2Nlc3NlZCB0aHJvdWdoIHRoZSBQVFIgYW5kIERBVEEgcmVnaXN0ZXJzCQkJKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI2RlZmluZSBDUEYJCQkweDAwCQkvKiBDdXJyZW50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8qIGRlZmluaXRpb25zIGZvciBkZWJ1ZyByZWdpc3RlciAtIHRha2VuIGZyb20gdGhlIGFsc2EgZHJpdmVycyAqLworI2RlZmluZSBEQkdfWkMgICAgICAgICAgICAgICAgICAweDgwMDAwMDAwICAgICAgLyogemVybyB0cmFtIGNvdW50ZXIgKi8KKyNkZWZpbmUgREJHX1NBVFVSQVRJT05fT0NDVVJFRCAgMHgwMjAwMDAwMCAgICAgIC8qIHNhdHVyYXRpb24gY29udHJvbCAqLworI2RlZmluZSBEQkdfU0FUVVJBVElPTl9BRERSICAgICAweDAxZmYwMDAwICAgICAgLyogc2F0dXJhdGlvbiBhZGRyZXNzICovCisjZGVmaW5lIERCR19TSU5HTEVfU1RFUCAgICAgICAgIDB4MDAwMDgwMDAgICAgICAvKiBzaW5nbGUgc3RlcCBtb2RlICovCisjZGVmaW5lIERCR19TVEVQICAgICAgICAgICAgICAgIDB4MDAwMDQwMDAgICAgICAvKiBzdGFydCBzaW5nbGUgc3RlcCAqLworI2RlZmluZSBEQkdfQ09ORElUSU9OX0NPREUgICAgICAweDAwMDAzZTAwICAgICAgLyogY29uZGl0aW9uIGNvZGUgKi8KKyNkZWZpbmUgREJHX1NJTkdMRV9TVEVQX0FERFIgICAgMHgwMDAwMDFmZiAgICAgIC8qIHNpbmdsZSBzdGVwIGFkZHJlc3MgKi8KKworCisjZGVmaW5lIFJFRzUzCQkJMHg1MwkJLyogRE8gTk9UIFBST0dSQU0gVEhJUyBSRUdJU1RFUiEhISBNQVkgREVTVFJPWSBDSElQICovCisKKyNkZWZpbmUgQV9EQkcJCQkgMHg1MworI2RlZmluZSBBX0RCR19TSU5HTEVfU1RFUAkgMHgwMDAyMDAwMAkvKiBTZXQgdG8gemVybyB0byBzdGFydCBkc3AgKi8KKyNkZWZpbmUgQV9EQkdfWkMJCSAweDQwMDAwMDAwCS8qIHplcm8gdHJhbSBjb3VudGVyICovCisjZGVmaW5lIEFfREJHX1NURVBfQUREUgkJIDB4MDAwMDAzZm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lnaHQgMTk5OSwgMjAwMCBDcmVhdGl2ZSBMYWJzLCBJbmMuCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiAgICAgRGF0ZSAgICAgICAgICAgICAgICAgQXV0aG9yICAgICAgICAgIFN1bW1hcnkgb2YgY2hhbmdlcworICogICAgIC0tLS0gICAgICAgICAgICAgICAgIC0tLS0tLSAgICAgICAgICAtLS0tLS0tLS0tLS0tLS0tLS0KKyAqICAgICBPY3RvYmVyIDIwLCAxOTk5ICAgICBCZXJ0cmFuZCBMZWUgICAgYmFzZSBjb2RlIHJlbGVhc2UKKyAqICAgICBOb3ZlbWJlciAyLCAxOTk5CSAgICBBbGFuIENveCAgICAgICAgY2xlYW5lZCB1cCB0eXBlcy9sZWFrcworICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogICAgIFRoaXMgcHJvZ3JhbSBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IKKyAqICAgICBtb2RpZnkgaXQgdW5kZXIgdGhlIHRlcm1zIG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBhcworICogICAgIHB1Ymxpc2hlZCBieSB0aGUgRnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uOyBlaXRoZXIgdmVyc2lvbiAyIG9mCisgKiAgICAgdGhlIExpY2Vuc2UsIG9yIChhdCB5b3VyIG9wdGlvbikgYW55IGxhdGVyIHZlcnNpb24uCisgKgorICogICAgIFRoaXMgcHJvZ3JhbSBpcyBkaXN0cmlidXRlZCBpbiB0aGUgaG9wZSB0aGF0IGl0IHdpbGwgYmUgdXNlZnVsLAorICogICAgIGJ1dCBXSVRIT1VUIEFOWSBXQVJSQU5UWTsgd2l0aG91dCBldmV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w0NCBAQAorLyoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAgICAgYXVkaW8uYyAtLSAvZGV2L2RzcCBpbnRlcmZhY2UgZm9yIGVtdTEwazEgZHJpdmVyCisgKiAgICAgQ29weXJpZ2h0IDE5OTksIDIwMDAgQ3JlYXRpdmUgTGFicywgSW5jLgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogICAgIERhdGUgICAgICAgICAgICAgICAgIEF1dGhvciAgICAgICAgICBTdW1tYXJ5IG9mIGNoYW5nZXMKKyAqICAgICAtLS0tICAgICAgICAgICAgICAgICAtLS0tLS0gICAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tCisgKiAgICAgT2N0b2JlciAyMCwgMTk5OSAgICAgQmVydHJhbmQgTGVlICAgIGJhc2UgY29kZSByZWxlYXNlCisgKiAgICAgTm92ZW1iZXIgMiwgMTk5OQkgICAgQWxhbiBDb3ggICAgICAgIGNsZWFuZWQgdXAgdHlwZXMvbGVha3MKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqICAgICBUaGlzIHByb2dyYW0gaXMgZnJlZSBzb2Z0d2FyZTsgeW91IGNhbiByZWRpc3RyaWJ1dGUgaXQgYW5kL29yCisgKiAgICAgbW9kaWZ5IGl0IHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgYXMKKyAqICAgICBwdWJsaXNoZWQgYnkgdGhlIEZyZWUgU29mdHdhcmUgRm91bmRhdGlvbjsgZWl0aGVyIHZlcnNpb24gMiBvZgorICogICAgIHRoZSBMaWNlbnNlLCBvciAoYXQgeW91ciBvcHRpb24pIGFueSBsYXRlciB2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xL2NhcmRtaS5jIGIvc291bmQvb3NzL2VtdTEwazEvY2FyZG1pLmMKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMDU0NTgxNAotLS0gL2Rldi9udWxsCisrKyBiL3NvdW5kL29zcy9lbXUxMGsxL2NhcmRtaS5jCkBAIC0wLDAgKzEsODMyIEBACisvKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICAgICBzYmxpdmVfbWkuYyAtIE1JREkgVUFSVCBpbnB1dCBIQUwgZm9yIGVtdTEwazEgZHJpdmVyCisgKiAgICAgQ29weXJpZ2h0IDE5OTksIDIwMDAgQ3JlYXRpdmUgTGFicywgSW5jLgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogICAgIERhdGUgICAgICAgICAgICAgICAgIEF1dGhvciAgICAgICAgICBTdW1tYXJ5IG9mIGNoYW5nZXMKKyAqICAgICAtLS0tICAgICAgICAgICAgICAgICAtLS0tLS0gICAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tCisgKiAgICAgT2N0b2JlciAyMCwgMTk5OSAgICAgQmVydHJhbmQgTGVlICAgIGJhc2UgY29kZSByZWxlYXNlCisgKiAgICAgTm92ZW1iZXIgMiwgMTk5OSAgICAgQWxhbiBDb3ggICAgICAgIGNsZWFuIHVwCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiAgICAgVGhpcyBwcm9ncmFtIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0IGFuZC9vcgorICogICAgIG1vZGlmeSBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaW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wgMHhGMywgQnl0ZSAxICAgICAgICAgICovCisJeworCXNibGl2ZV9taVN0YXRlU3lzQ29tbW9uM30sCS8qIDB4RjIgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKwl7CisJc2JsaXZlX21pU3RhdGVTeXNDb21tb24zS2V5fSwJLyogMHhGMiAsIEJ5dGUgMSAgICAgICAgICAgICAgICAqLworCXsKKwlzYmxpdmVfbWlTdGF0ZVN5c0NvbW1vbjNWZWx9LAkvKiAweEYyICwgQnl0ZSAyICAgICAgICAgICAgICAgICovCisJeworCXNibGl2ZV9taVN0YXRlU3lzRXhOb3JtfSwJLyogMHhGMCwgMHhGNywgTm9ybWFsIG1vZGUgICAgICAqLworCXsKKwlzYmxpdmVfbWlTdGF0ZVN5c1JlYWx9CS8qIDB4RjQgLSAweEY2ICwweEY4IC0gMHhGRiAgICAgKi8KK307CisKKworLyogSW5zdGFsbHMgdGhlIElSUSBoYW5kbGVyIGZvciB0aGUgTVBVIGluIHBvcnQgICAgICAgICAgICAgICAgICovCisKKy8qIGFuZCBpbml0aWFsaXplIHBhcmFtZXRlcnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworCitpbnQgZW11MTBrMV9tcHVpbl9vcGVuKHN0cnVjdCBlbXUxMGsxX2NhcmQgKmNhcmQsIHN0cnVjdCBtaWRpX29wZW5pbmZvICpvcGVuaW5mbykKK3sKKwlzdHJ1Y3QgZW11MTBrMV9tcHVpbiAqY2FyZF9tcHVpbiA9IGNhcmQtPm1wdWluOworCisJRFBGKDIsICJlbXUxMGsxX21wdWluX29wZW5cbiIpOworCisJaWYgKCEoY2FyZF9tcHVpbi0+c3RhdHVzICYgRkxBR1NfQVZBSUxBQkxFKSkKKwkJcmV0dXJuIC0xOworCisJLyogQ29weSBvcGVuIGluZm8gYW5kIG1hcmsgY2hhbm5lbCBhcyBpbiB1c2UgKi8KKwljYXJkX21wdWluLT5vcGVuaW5mbyA9ICpvcGVuaW5mbzsKKwljYXJkX21wdW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X21wdWluLCBkYXRhKTsKKwl9CisKKwlyZXR1cm47Cit9CisKKy8qIElSUSBjYWxsYmFjayBoYW5kbGVyIHJvdXRpbmUgZm9yIHRoZSBNUFUgaW4gcG9ydCAqLworCitpbnQgZW11MTBrMV9tcHVpbl9pcnFoYW5kbGVyKHN0cnVjdCBlbXUxMGsxX2NhcmQgKmNhcmQpCit7CisJdW5zaWduZWQgaWR4OworCXVuc2lnbmVkIGNvdW50OworCXU4IE1QVUl2YWx1ZTsKKwlzdHJ1Y3QgZW11MTBrMV9tcHVpbiAqY2FyZF9tcHVpbiA9IGNhcmQtPm1wdWluOworCisJLyogSVJRIHNlcnZpY2Ugcm91dGluZS4gVGhlIGRhdGEgYW5kIGNvZGUgdG91Y2hlZCBhcmU6CisJICogMS4gY2FyZF9tcHVpbgorCSAqLworCisJY291bnQgPSAwOworCWlkeCA9IGNhcmRfbXB1aW4tPnF0YWlsOworCisJd2hpbGUgKDEpIHsKKwkJaWYgKGVtdTEwazFfbXB1X3JlYWRfZGF0YShjYXJkLCAmTVBVSXZhbHVlKSA8IDApIHsKKwkJCWJyZWFrOworCQl9IGVsc2UgeworCQkJKytjb3VudDsKKwkJCWNhcmRfbXB1aW4tPm1pZGlxW2lkeF0uZGF0YSA9IE1QVUl2YWx1ZTsKKwkJCWNhcmRfbXB1aW4tPm1pZGlxW2lkeF0udGltZWluID0gKGppZmZpZXMgKiAxMDAwKSAvIEhaOworCQkJaWR4ID0gKGlkeCArIDEpICUgTUlESUlOX01BWF9CVUZGRVJfU0laRTsKKwkJfQorCX0KKworCWlmIChjb3VudCkgeworCQljYXJkX21wdWluLT5xdGFpbCA9IGlkeDsKKworCQl0YXNrbGV0X2hpX3NjaGVkdWxlKCZjYXJkX21wdWluLT50YXNrbGV0KTsKKwl9CisKKwlyZXR1cm4gMDsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisv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QkJY2FyZF9tcHVpbi0+bGFzdG1pZGlxID0gTlVMTDsKKworCQkJc3Bpbl91bmxvY2tfaXJxcmVzdG9yZSgmY2FyZF9tcHVpbi0+bG9jaywgZmxhZ3MpOworCisJCQllbXUxMGsxX21wdWluX2NhbGxiYWNrKGNhcmRfbXB1aW4sIElDQVJETUlESV9JTkxPTkdEQVRBLCAodW5zaWduZWQgbG9uZykgbWlkaXEsIDApOworCisJCQlrZnJlZShtaWRpcSk7CisKKwkJCXJldHVybiBDVFNUQVRVU19ORVhUX0JZVEU7CisJCX0KKwl9CisKKwlyZXR1cm4gQ1RTVEFUVVNfTkVYVF9CWVRFOworfQorCitzdGF0aWMgaW50IHNibGl2ZV9taVN0YXRlU3lzUmVhbChzdHJ1Y3QgZW11MTBrMV9tcHVpbiAqY2FyZF9tcHVpbiwgdTggZGF0YSkKK3sKKwllbXUxMGsxX21wdWluX2NhbGxiYWNrKGNhcmRfbXB1aW4sIElDQVJETUlESV9JTkRBVEEsIGRhdGEsIDEpOworCisJcmV0dXJuIENUU1RBVFVTX05FWFRfQllURTsKK30KZGlmZiAtLWdpdCBhL3NvdW5kL29zcy9lbXUxMGsxL2NhcmRtaS5oIGIvc291bmQvb3NzL2VtdTEwazEvY2FyZG1pLmgKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uZDEyYzI0MQotLS0gL2Rldi9udWxsCisrKyBiL3NvdW5kL29zcy9lbXUxMGsxL2NhcmRtaS5oCkBAIC0wLDAgKzEsOTcgQEAKKy8qCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogICAgIHNibGl2ZV9taS5oCisgKiAgICAgQ29weXJpZ2h0IDE5OTksIDIwMDAgQ3JlYXRpdmUgTGFicywgSW5jLgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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BQdWJsaWMgTGljZW5zZSBmb3IgbW9yZSBkZXRhaWxzLgorICoKKyAqICAgICBZb3Ugc2hvdWxkIGhhdmUgcmVjZWl2ZWQgYSBjb3B5IG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMKKyAqICAgICBMaWNlbnNlIGFsb25nIHdpdGggdGhpcyBwcm9ncmFtOyBpZiBub3QsIHdyaXRlIHRvIHRoZSBGcmVlCisgKiAgICAgU29mdHdhcmUgRm91bmRhdGlvbiwgSW5jLiwgNjc1IE1hc3MgQXZlLCBDYW1icmlkZ2UsIE1BIDAyMTM5LAorICogICAgIFVTQS4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICovCisKKyNpZm5kZWYgX0NBUkRNSV9ICisjZGVmaW5lIF9DQVJETUlfSAorCisjaW5jbHVkZSAiaWNhcmRtaWQuaCIKKyNpbmNsdWRlIDxsaW51eC9pbnRlcnJ1cHQuaD4KKwordHlwZWRlZiBlbnVtCit7CisJU1RJTl9QQVJTRSA9IDAsCisJU1RJTl8zQllURSwgICAgICAgICAgICAgICAgICAgICAvKiAweDgwLCAweDkwLCAweEEwLCAweEIwLCAweEUwICovCisJU1RJTl8zQllURV9LRVksICAgICAgICAgICAgICAgICAvKiBCeXRlIDEgKi8KKwlTVElOXzNCWVRFX1ZFTCwgICAgICAgICAgICAgICAgIC8qIEJ5dGUgMSAqLworCVNUSU5fMkJZVEUsICAgICAgICAgICAgICAgICAgICAgLyogMHhDMCwgMHhEMCAqLworCVNUSU5fMkJZVEVfS0VZLCAgICAgICAgICAgICAgICAgLyogQnl0ZSAxICovCisJU1RJTl9TWVNfQ09NTU9OXzIsICAgICAgICAgICAgICAvKiAweEYxLCAweEYzICAqLworCVNUSU5fU1lTX0NPTU1PTl8yX0tFWSwKKwlTVElOX1NZU19DT01NT05fMywgICAgICAgICAgICAgIC8qIDB4RjIgKi8KKwlTVElOX1NZU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qKioqKioqKioqKioqKioqKioqKioqKgorICogICAgIGNhcmRtby5jIC0gTUlESSBVQVJUIG91dHB1dCBIQUwgZm9yIGVtdTEwazEgZHJpdmVyIAorICogICAgIENvcHlyaWdodCAxOTk5LCAyMDAwIENyZWF0aXZlIExhYnMsIEluYy4gCisgKiAKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqIAorICogCisgKiAgICAgRGF0ZSAgICAgICAgICAgICAgICAgQXV0aG9yICAgICAgICAgIFN1bW1hcnkgb2YgY2hhbmdlcyAKKyAqICAgICAtLS0tICAgICAgICAgICAgICAgICAtLS0tLS0gICAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tIAorICogICAgIE9jdG9iZXIgMjAsIDE5OTkgICAgIEJlcnRyYW5kIExlZSAgICBiYXNlIGNvZGUgcmVsZWFzZSAKKyAqICAgICBOb3ZlbWJlciAyLCAxOTk5ICAgICBBbGFuIENveCAgICAgICAgY2xlYW5lZCB1cAorICogCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAKKyAqIAorICogICAgIFRoaXMgcHJvZ3JhbSBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IgCisgKiAgICAgbW9kaWZ5IGl0IHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgYXMgCisgKiAgICAgcHVibGlzaGVkIGJ5IHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb247IGVpdGhlciB2ZXJzaW9uIDIgb2YgCisgKiAgICAgdGhlIExpY2Vuc2UsIG9yIChhdCB5b3VyIG9wdGlvbikgYW55IGxhdGVyIHZlcnNpb24uIAorICogCisgKiAgICAgVGhpcyBwcm9ncmFtIGlzIGRpc3RyaWJ1dG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KQEAgLTAsMCArMSw2MiBAQAorLyoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAgICAgY2FyZG1vLmgKKyAqICAgICBDb3B5cmlnaHQgMTk5OSwgMjAwMCBDcmVhdGl2ZSBMYWJzLCBJbmMuCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiAgICAgRGF0ZSAgICAgICAgICAgICAgICAgQXV0aG9yICAgICAgICAgIFN1bW1hcnkgb2YgY2hhbmdlcworICogICAgIC0tLS0gICAgICAgICAgICAgICAgIC0tLS0tLSAgICAgICAgICAtLS0tLS0tLS0tLS0tLS0tLS0KKyAqICAgICBPY3RvYmVyIDIwLCAxOTk5ICAgICBCZXJ0cmFuZCBMZWUgICAgYmFzZSBjb2RlIHJlbGVhc2UKKyAqICAgICBOb3ZlbWJlciAyLCAxOTk5ICAgICBBbGFuIENveAkgICAgY2xlYW5lZCB1cAorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogICAgIFRoaXMgcHJvZ3JhbSBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IKKyAqICAgICBtb2RpZnkgaXQgdW5kZXIgdGhlIHRlcm1zIG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBhcworICogICAgIHB1Ymxpc2hlZCBieSB0aGUgRnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uOyBlaXRoZXIgdmVyc2lvbiAyIG9mCisgKiAgICAgdGhlIExpY2Vuc2UsIG9yIChhdCB5b3VyIG9wdGlvbikgYW55IGxhdGVyIHZlcnNpb24uCisgKgorICogICAgIFRoaXMgcHJvZ3JhbSBpc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DAgQ3JlYXRpdmUgTGFicywgSW5jLgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogICAgIERhdGUgICAgICAgICAgICAgICAgIEF1dGhvciAgICAgICAgICBTdW1tYXJ5IG9mIGNoYW5nZXMKKyAqICAgICAtLS0tICAgICAgICAgICAgICAgICAtLS0tLS0gICAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tCisgKiAgICAgT2N0b2JlciAyMCwgMTk5OSAgICAgQmVydHJhbmQgTGVlICAgIGJhc2UgY29kZSByZWxlYXNlCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiAgICAgVGhpcyBwcm9ncmFtIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0IGFuZC9vcgorICogICAgIG1vZGlmeSBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGFzCisgKiAgICAgcHVibGlzaGVkIGJ5IHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb247IGVpdGhlciB2ZXJzaW9uIDIgb2YKKyAqICAgICB0aGUgTGljZW5zZSwgb3IgKGF0IHlvdXIgb3B0aW9uKSBhbnkgbGF0ZXIgdmVyc2lvbi4KKyAqCisgKiAgICAgVGhpcyBwcm9ncmFtIGlzIGRpc3RyaWJ1dGVkIGluIHRoZSBob3BlIHRoYXQgaXQgd2lsbCBiZSB1c2VmdWwsCisgKiAgICAgYnV0IFdJVEhPVVQgQU5ZIFdBUlJBTlRZOyB3aXRob3V0IGV2ZW4gdGhlIGltcGxpZWQgd2FycmFudHkgb2YKKyAqICAgICBNRVJDSEFOVEFCSUxJVFkgb3IgRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFSIFBVUlBP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ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjE1Y2ZiOWIKLS0tIC9kZXYvbnVsbAorKysgYi9zb3VuZC9vc3MvZW11MTBrMS9jYXJkd2kuaApAQCAtMCwwICsxLDkxIEBACisvKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICAgICBjYXJkd2kuaCAtLSBoZWFkZXIgZmlsZSBmb3IgY2FyZCB3YXZlIGlucHV0IGZ1bmN0aW9ucworICogICAgIENvcHlyaWdodCAxOTk5LCAyMDAwIENyZWF0aXZlIExhYnMsIEluYy4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqICAgICBEYXRlICAgICAgICAgICAgICAgICBBdXRob3IgICAgICAgICAgU3VtbWFyeSBvZiBjaGFuZ2VzCisgKiAgICAgLS0tLSAgICAgICAgICAgICAgICAgLS0tLS0tICAgICAgICAgIC0tLS0tLS0tLS0tLS0tLS0tLQorICogICAgIE9jdG9iZXIgMjAsIDE5OTkgICAgIEJlcnRyYW5kIExlZSAgICBiYXNlIGNvZGUgcmVsZWFzZQorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogICAgIFRoaXMgcHJvZ3JhbSBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IKKyAqICAgICBtb2RpZnkgaXQgdW5kZXIgdGhlIHRlcm1zIG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBhcworICogICAgIHB1Ymxpc2hlZCBieSB0aGUgRnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uOyBlaXRoZXIgdmVyc2lvbiAyIG9mCisgKiAgICAgd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m9yIGVtdTEwazEgZHJpdmVyCisgKiAgICAgQ29weXJpZ2h0IDE5OTksIDIwMDAgQ3JlYXRpdmUgTGFicywgSW5jLgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogICAgIERhdGUgICAgICAgICAgICAgICAgIEF1dGhvciAgICAgICAgICBTdW1tYXJ5IG9mIGNoYW5nZXMKKyAqICAgICAtLS0tICAgICAgICAgICAgICAgICAtLS0tLS0gICAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tCisgKiAgICAgT2N0b2JlciAyMCwgMTk5OSAgICAgQmVydHJhbmQgTGVlICAgIGJhc2UgY29kZSByZWxlYXNlCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiAgICAgVGhpcyBwcm9ncmFtIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0IGFuZC9vcgorICogICAgIG1vZGlmeSBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGFzCisgKiAgICAgcHVibGlzaGVkIGJ5IHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb247IGVpdGhlciB2ZXJzaW9uIDIgb2YKKyAqICAgICB0aGUgTGljZW5zZSwgb3IgKGF0IHlvdXIgb3B0aW9uKSBhbnkgbGF0ZXIgdmVyc2lvbi4KKyAqCisgKiAgICAgVGhpcyBwcm9ncmFtIGlzIGRpc3RyaWJ1dGVkIGluIHRoZSBob3BlIHRoYXQgaXQgd2lsbCBiZSB1c2VmdWwsCisgKiAgICAgYnV0IFdJVEhPVVQgQU5ZIFdBUlJBTlRZOyB3aXRob3V0IGV2ZW4gdGhlIGltcGxpZWQgd2FycmFudHkgb2YKKyAqICAgICBNRVJDSEF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nVuY3Rpb25zCisgKiAgICAgQ29weXJpZ2h0IDE5OTksIDIwMDAgQ3JlYXRpdmUgTGFicywgSW5jLiAKKyAqIAorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogCisgKiAKKyAqICAgICBEYXRlICAgICAgICAgICAgICAgICBBdXRob3IgICAgICAgICAgU3VtbWFyeSBvZiBjaGFuZ2VzIAorICogICAgIC0tLS0gICAgICAgICAgICAgICAgIC0tLS0tLSAgICAgICAgICAtLS0tLS0tLS0tLS0tLS0tLS0gCisgKiAgICAgT2N0b2JlciAyMCwgMTk5OSAgICAgQmVydHJhbmQgTGVlICAgIGJhc2UgY29kZSByZWxlYXNlIAorICogCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAKKyAqIAorICogICAgIFRoaXMgcHJvZ3JhbSBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IgCisgKiAgICAgbW9kaWZ5IGl0IHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgYXMgCisgKiAgICAgcHVibGlzaGVkIGJ5IHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb247IGVpdGhlciB2ZXJzaW9uIDIgb2YgCisgKiAgICAgdGhlIExpY2Vuc2UsIG9yIChhdCB5b3VyIG9wdGlvbikgYW55IGxhdGVyIHZlcnNpb24uIAorICogCisgKiAgICAgVGhpcyBwcm9ncmFtIGlzIGRpc3RyaWJ1dGVkIGluIHRoZSBob3BlIHRoYXQgaXQgd2lsbCBiZSB1c2VmdWwsIAorICogICAgIGJ1dCBXSVRIT1VUIEFOWSBXQVJSQU5UWTsgd2l0aG91dCBldmVuIHRoZSBpbXBsaWVkIHdhcnJhbnR5IG9mIAorICogICAgIE1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sxX3dhdmVvdXRfdXBkYXRlKHN0cnVjdCB3b2luc3QqKTsKKworI2VuZGlmIC8qIF9DQVJEV09fSCAqLwpkaWZmIC0tZ2l0IGEvc291bmQvb3NzL2VtdTEwazEvZWNhcmQuYyBiL3NvdW5kL29zcy9lbXUxMGsxL2VjYXJkLmMKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uNGFlNjM1ZgotLS0gL2Rldi9udWxsCisrKyBiL3NvdW5kL29zcy9lbXUxMGsxL2VjYXJkLmMKQEAgLTAsMCArMSwxNTcgQEAKKy8qICAgICAKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAgICAgZWNhcmQuYyAtIEUtY2FyZCBpbml0aWFsaXphdGlvbiBjb2RlCisgKiAgICAgQ29weXJpZ2h0IDE5OTksIDIwMDAgQ3JlYXRpdmUgTGFicywgSW5jLiAKKyAqIAorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogCisgKiAKKyAqICAgICBEYXRlICAgICAgICAgICAgICAgICBBdXRob3IgICAgICAgICAgU3VtbWFyeSBvZiBjaGFuZ2VzIAorICogICAgIC0tLS0gICAgICAgICAgICAgICAgIC0tLS0tLSAgICAgICAgICAtLS0tLS0tLS0tLS0tLS0tLS0gCisgKiAgICAgT2N0b2JlciAyMCwgMTk5OSAgICAgQmVydHJhbmQgTGVlICAgIGJhc2UgY29kZSByZWxlYXNlIAorICogCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAKKyAqIAorICogICAgIFRoaXMgcHJvZ3JhbSBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IgCisgKiAgICAgbW9kaWZ5IGl0IHVuZG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orICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICAgICBlY2FyZC5oCisgKiAgICAgQ29weXJpZ2h0IDE5OTksIDIwMDAgQ3JlYXRpdmUgTGFicywgSW5jLiAKKyAqIAorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogCisgKiAKKyAqICAgICBUaGlzIHByb2dyYW0gaXMgZnJlZSBzb2Z0d2FyZTsgeW91IGNhbiByZWRpc3RyaWJ1dGUgaXQgYW5kL29yIAorICogICAgIG1vZGlmeSBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGFzIAorICogICAgIHB1Ymxpc2hlZCBieSB0aGUgRnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uOyBlaXRoZXIgdmVyc2lvbiAyIG9mIAorICogICAgIHRoZSBMaWNlbnNlLCBvciAoYXQgeW91ciBvcHRpb24pIGFueSBsYXRlciB2ZXJzaW9uLiAKKyAqIAorICogICAgIFRoaXMgcHJvZ3JhbSBpcyBkaXN0cmlidXRlZCBpbiB0aGUgaG9wZSB0aGF0IGl0IHdpbGwgYmUgdXNlZnVsLCAKKyAqICAgICBidXQgV0lUSE9VVCBBTlkgV0FSUkFOVFk7IHdpdGhvdXQgZXZlbiB0aGUgaW1wbGllZCB3YXJyYW50eSBvZiAKKyAqICAgICBNRVJDSEFOVEFCSUxJVFkgb3IgRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFSIFBVUlBPU0UuICBTZWUgdGhlIAorICogICAgIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGZvciBtb3JlIGRldGFpbHMuIAorICogCisgKiAgICAgWW91IHNob3VsZCBoYXZlIHJlY2VpdmVkIGEgY29weSBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIAorICogICA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gICAgICAweDQwIC8qIEVDQVJEIEVFUFJPTSBoYXMgNjQgMTYtYml0IHdvcmRzICovCisKKy8qIEFkZHJlc3NlcyBmb3Igc3BlY2lhbCB2YWx1ZXMgc3RvcmVkIGluIHRvIEVFUFJPTSAqLworI2RlZmluZSBFQ19QUk9NX1ZFUlNJT05fQUREUgkweDIwCS8qIEFkZHJlc3Mgb2YgdGhlIGN1cnJlbnQgcHJvbSB2ZXJzaW9uICovCisjZGVmaW5lIEVDX0JPQVJEUkVWMF9BRERSCTB4MjEJLyogTFNXIG9mIGJvYXJkIHJldiAqLworI2RlZmluZSBFQ19CT0FSRFJFVjFfQUREUiAJMHgyMgkvKiBNU1cgb2YgYm9hcmQgcmV2ICovIAorCisjZGVmaW5lIEVDX0xBU1RfUFJPTUZJTEVfQUREUgkweDJmCisKKyNkZWZpbmUgRUNfU0VSSUFMTlVNX0FERAkweDMwCS8qIEZpcnN0IHdvcmQgb2Ygc2VyaWFsIG51bWJlci4gIFRoZSBudW1iZXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBjYW4gYmUgdXAgdG8gMzAgY2hhcmFjdGVycyBpbiBsZW5ndGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBhbmQgaXMgc3RvcmVkIGFzIGEgTlVMTC10ZXJtaW5hdGVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogQVNDSUkgc3RyaW5nLiAgQW55IHVudXNlZCBieXRlcyBtdXN0IGJlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogZmlsbGVkIHdpdGggemVyb3MgKi8KKyNkZWZpbmUgRUNfQ0hFQ0tTVU1fQUREUgkweDNmICAgIC8qIExvY2F0aW9uIGF0IHdoaWNoIGNoZWNrc3VtIGlzIHN0b3JlZCAqLworCisKKworLyogTW9zdCBvZiB0aGlzIHN0dWZmIGlzIHByZXR0eSBzZWxmLWV2aW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L251bGwKKysrIGIvc291bmQvb3NzL2VtdTEwazEvZWZ4bWdyLmMKQEAgLTAsMCArMSwyMjAgQEAKKy8qCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogICAgIGVmeG1nci5jCisgKiAgICAgQ29weXJpZ2h0IDE5OTksIDIwMDAgQ3JlYXRpdmUgTGFicywgSW5jLiAKKyAqIAorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogCisgKiAKKyAqICAgICBEYXRlICAgICAgICAgICAgICAgICBBdXRob3IgICAgICAgICAgU3VtbWFyeSBvZiBjaGFuZ2VzIAorICogICAgIC0tLS0gICAgICAgICAgICAgICAgIC0tLS0tLSAgICAgICAgICAtLS0tLS0tLS0tLS0tLS0tLS0gCisgKiAgICAgT2N0b2JlciAyMCwgMTk5OSAgICAgQmVydHJhbmQgTGVlICAgIGJhc2UgY29kZSByZWxlYXNlIAorICogCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAKKyAqIAorICogICAgIFRoaXMgcHJvZ3JhbSBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IgCisgKiAgICAgbW9kaWZ5IGl0IHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgYXMgCisgKiAgICAgcHVibGlzaGVkIGJ5IHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb247IGVpdGhlciB2ZXJzaW9uIDIgb2YgCisgKiAgICAgdGhlIExpY2Vuc2UsIG9yIChhdCB5b3VyIG9wdGlvbikgYW55IGxhdGVyIHZlcnNpb24uIAorICogCisgKiAgICAgVGhpcyBwcm9ncmFtIGlzIGRpc3RyaWJ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KyAqICAgICBzYmxpdmVfZnguaAorICogICAgIENvcHlyaWdodCAxOTk5LCAyMDAwIENyZWF0aXZlIExhYnMsIEluYy4gCisgKiAKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqIAorICogCisgKiAgICAgRGF0ZSAgICAgICAgICAgICAgICAgQXV0aG9yICAgICAgICAgIFN1bW1hcnkgb2YgY2hhbmdlcyAKKyAqICAgICAtLS0tICAgICAgICAgICAgICAgICAtLS0tLS0gICAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tIAorICogICAgIE9jdG9iZXIgMjAsIDE5OTkgICAgIEJlcnRyYW5kIExlZSAgICBiYXNlIGNvZGUgcmVsZWFzZSAKKyAqIAorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogCisgKiAKKyAqICAgICBUaGlzIHByb2dyYW0gaXMgZnJlZSBzb2Z0d2FyZTsgeW91IGNhbiByZWRpc3RyaWJ1dGUgaXQgYW5kL29yIAorICogICAgIG1vZGlmeSBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGFzIAorICogICAgIHB1Ymxpc2hlZCBieSB0aGUgRnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uOyBlaXRoZXIgdmVyc2lvbiAyIG9mIAorICogICAgIHRoZSBMaWNlbnNlLCBvciAoYXQgeW91ciBvcHRpb24pIGFueSBsYXRlciB2ZXJzaW9uLiAKKyAqIAorICogICAgIFRoaXMgcHJvZ3JhbSBpcyBkaXN0cmlidXRlZCBpbiB0aGUgaG9wZSB0aGF0IGl0IHdpbGwgYmUgdXNlZnVsLCAKKyAqICAgICBidXQgV0lUSE9VVCBBTlkgV0FSUkFOVFk7IHdpdGhvdXQgZXZlbiB0aGUgaW1wbGllZCB3YXJyYW50eSBvZiAKKy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dW5kL29zcy9lbXUxMGsxL2VtdWFkeG1nLmMKQEAgLTAsMCArMSwxMDQgQEAKKworLyogICAgIAorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICAgICBlbXVhZHhtZy5jIC0gQWRkcmVzcyBzcGFjZSBtYW5hZ2VyIGZvciBlbXUxMGsxIGRyaXZlciAKKyAqICAgICBDb3B5cmlnaHQgMTk5OSwgMjAwMCBDcmVhdGl2ZSBMYWJzLCBJbmMuIAorICogCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAKKyAqIAorICogICAgIERhdGUgICAgICAgICAgICAgICAgIEF1dGhvciAgICAgICAgICBTdW1tYXJ5IG9mIGNoYW5nZXMgCisgKiAgICAgLS0tLSAgICAgICAgICAgICAgICAgLS0tLS0tICAgICAgICAgIC0tLS0tLS0tLS0tLS0tLS0tLSAKKyAqICAgICBPY3RvYmVyIDIwLCAxOTk5ICAgICBCZXJ0cmFuZCBMZWUgICAgYmFzZSBjb2RlIHJlbGVhc2UgCisgKiAKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqIAorICogCisgKiAgICAgVGhpcyBwcm9ncmFtIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0IGFuZC9vciAKKyAqICAgICBtb2RpZnkgaXQgdW5kZXIgdGhlIHRlcm1zIG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBhcyAKKyAqICAgICBwdWJsaXNoZWQgYnkgdGhlIEZyZWUgU29mdHdhcmUgRm91bmRhdGlvbjsgZWl0aGVyIHZlcnNpb24gMiBvZiAKKyAqICAgICB0aGUgTGljZW5zZSwgb3IgKGF0IHlvdXIgb3B0aW9uKSBhbnkgbGF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worCXJldHVybjsKK30KZGlmZiAtLWdpdCBhL3NvdW5kL29zcy9lbXUxMGsxL2h3YWNjZXNzLmMgYi9zb3VuZC9vc3MvZW11MTBrMS9od2FjY2Vzcy5jCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjJkYzE2YTgKLS0tIC9kZXYvbnVsbAorKysgYi9zb3VuZC9vc3MvZW11MTBrMS9od2FjY2Vzcy5jCkBAIC0wLDAgKzEsNTA3IEBACisvKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICAgICBod2FjY2Vzcy5jIC0tIEhhcmR3YXJlIGFjY2VzcyBsYXllcgorICogICAgIENvcHlyaWdodCAxOTk5LCAyMDAwIENyZWF0aXZlIExhYnMsIEluYy4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqICAgICBEYXRlICAgICAgICAgICAgICAgICBBdXRob3IgICAgICAgICAgU3VtbWFyeSBvZiBjaGFuZ2VzCisgKiAgICAgLS0tLSAgICAgICAgICAgICAgICAgLS0tLS0tICAgICAgICAgIC0tLS0tLS0tLS0tLS0tLS0tLQorICogICAgIE9jdG9iZXIgMjAsIDE5OTkgICAgIEJlcnRyYW5kIExlZSAgICBiYXNlIGNvZGUgcmVsZWFzZQorICogICAgIERlY2VtYmVyIDksIDE5OTkgICAgIEpvbiBUYXlsb3IgICAgICByZXdyb3RlIHRoZSBJL08gc3Vic3lzdGVtCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiAgICAgVGhpcyBwcm9ncmFtIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0IGFuZC9vcgorICogICAgIG1vZGlmeSBpd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yNpbmNsdWRlICJpY2FyZG1pZC5oIgorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiBGdW5jdGlvbiA6IHNyVG9QaXRjaCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyogSW5wdXQgICAgOiBzYW1wbGVSYXRlIC0gc2FtcGxpbmcgcmF0ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisqIFJldHVybiAgIDogcGl0Y2ggdmFsdWUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorKiBBYm91dCAgICA6IGNvbnZlcnQgc2FtcGxpbmcgcmF0ZSB0byBwaXRjaCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyogTm90ZSAgICAgOiBmb3IgODAxMCwgc2FtcGxpbmcgcmF0ZSBpcyBhdCA0OGtIeiwgdGhpcyBmdW5jdGlvbiBzaG91bGQgICAqCisqICAgICAgICAgICAgYmUgY2hhbmdlZC4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3UzMiBzclRvUGl0Y2godTMyIHNhbXBsZVJhdGUpCit7CisJaW50IGk7CisKKwkvKiBGSVhNRTogVGhlc2UgdGFibGVzIHNob3VsZCBiZSBkZWZpbmVkIGluIGEgaGVhZGVyZmlsZSAqLworCXN0YXRpYyB1MzIgbG9nTWFnVGFibGVbMTI4XSA9IHsKKwkJMHgwMDAwMCwgMHgwMmRmYywgMHgwNWI5ZSwgMHgwODhlNiwgMHgwYjVkNiwgMHgwZTI2ZiwgMHgxMGViMywgMHgxM2FhMiwKKwkJMHgxNjYzZiwgMHgxOTE4YSwgMHgxYmM4NCwgMHgxZTc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KwkJdmFsID0gaW5sKGNhcmQtPmlvYmFzZSArIHJlZyk7CisJCXNwaW5fdW5sb2NrX2lycXJlc3RvcmUoJmNhcmQtPmxvY2ssIGZsYWdzKTsKKworCQlyZXR1cm4gKHZhbCAmIG1hc2spID4+IG9mZnNldDsKKyAgICAgICAgfSBlbHNlIHsKKwkJc3Bpbl9sb2NrX2lycXNhdmUoJmNhcmQtPmxvY2ssIGZsYWdzKTsKKwkJdmFsID0gaW5sKGNhcmQtPmlvYmFzZSArIHJlZyk7CisJCXNwaW5fdW5sb2NrX2lycXJlc3RvcmUoJmNhcmQtPmxvY2ssIGZsYWdzKTsKKwkJcmV0dXJuIHZhbDsKKwl9Cit9CisKK3ZvaWQgZW11MTBrMV90aW1lcl9zZXQoc3RydWN0IGVtdTEwazFfY2FyZCAqIGNhcmQsIHUxNiBkYXRhKQoreworCXVuc2lnbmVkIGxvbmcgZmxhZ3M7CisKKwlzcGluX2xvY2tfaXJxc2F2ZSgmY2FyZC0+bG9jaywgZmxhZ3MpOworCW91dHcoZGF0YSAmIFRJTUVSX1JBVEVfTUFTSywgY2FyZC0+aW9iYXNlICsgVElNRVIpOworCXNwaW5fdW5sb2NrX2lycXJlc3RvcmUoJmNhcmQtPmxvY2ssIGZsYWdzKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiB3cml0ZS9yZWFkIEVtdTEwazEgcG9pbnRlci1vZmZzZXQgcmVnaXN0ZXIgc2V0LCBhY2Nlc3NlZCB0aHJvdWdoICAgICAgKgorKiAgdGhlIFBUUiBhbmQgREFUQSByZWdpc3RlcnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNkZWZpbmUgQV9QVFJfQUREUkVTU19NQVNL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BVEEpOworCisJc3Bpbl91bmxvY2tfaXJxcmVzdG9yZSgmY2FyZC0+bG9jaywgZmxhZ3MpOworCisJcmV0dXJuIGRhdGE7Cit9CisKK3ZvaWQgZW11MTBrMV9hYzk3X3dyaXRlKHN0cnVjdCBhYzk3X2NvZGVjICpjb2RlYywgdTggcmVnLCB1MTYgdmFsdWUpCit7CisJc3RydWN0IGVtdTEwazFfY2FyZCAqY2FyZCA9IGNvZGVjLT5wcml2YXRlX2RhdGE7CisJdW5zaWduZWQgbG9uZyBmbGFnczsKKworCXNwaW5fbG9ja19pcnFzYXZlKCZjYXJkLT5sb2NrLCBmbGFncyk7CisKKwlvdXRiKHJlZywgY2FyZC0+aW9iYXNlICsgQUM5N0FERFJFU1MpOworCW91dHcodmFsdWUsIGNhcmQtPmlvYmFzZSArIEFDOTdEQVRBKTsKKwlvdXRiKCBBQzk3X0VYVEVOREVEX0lELCBjYXJkLT5pb2Jhc2UgKyBBQzk3QUREUkVTUyk7IAorCXNwaW5fdW5sb2NrX2lycXJlc3RvcmUoJmNhcmQtPmxvY2ssIGZsYWdzKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiAgICAgICAgICAgIE1QVSBhY2Nlc3MgZnVuY3Rpb25zICAgICAgICAgICAgICAgICAgICAgICAgKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworaW50IGVtdTEwazFfbXB1X3dyaXRlX2RhdGEoc3RydWN0IGVtdTEwazFfY2FyZCAqY2FyZCwgdTggZGF0YSkKK3sKKwl1bnNpZ25lZCBsb25nIGZsYWdzOworCWludCByZXQ7CisKKwlpZiAoY2FyZC0+aXNfYXVkaWd5KSB7CisJCWlmICgoc2JsaXZlX3JlYWRwdHIoY2FyZCwgQV9NVVNUQVQsMCkgJiBNVVNUQVRfT1JEWU4pID09IDApIHsKKwkJCXNibGl2ZV93cml0Z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T5tcHVhY3Fjb3VudDsKKworCXJldHVybiAwOworfQpkaWZmIC0tZ2l0IGEvc291bmQvb3NzL2VtdTEwazEvaHdhY2Nlc3MuaCBiL3NvdW5kL29zcy9lbXUxMGsxL2h3YWNjZXNzLmgKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMTA0MjIzYQotLS0gL2Rldi9udWxsCisrKyBiL3NvdW5kL29zcy9lbXUxMGsxL2h3YWNjZXNzLmgKQEAgLTAsMCArMSwyNDcgQEAKKy8qCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogICAgIGh3YWNjZXNzLmgKKyAqICAgICBDb3B5cmlnaHQgMTk5OSwgMjAwMCBDcmVhdGl2ZSBMYWJzLCBJbmMuCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiAgICAgRGF0ZQkJICAgIEF1dGhvcgkgICAgU3VtbWFyeSBvZiBjaGFuZ2VzCisgKiAgICAgLS0tLQkJICAgIC0tLS0tLQkgICAgLS0tLS0tLS0tLS0tLS0tLS0tCisgKiAgICAgT2N0b2JlciAyMCwgMTk5OSAgICAgQmVydHJhbmQgTGVlICAgIGJhc2UgY29kZSByZWxlYXNlCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiAgICAgVGhpcyBwcm9ncmFtIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0IGFuZC9vcgorICogICAgIG1vZGlmeSBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGFzCisgKiAgICAgcHVibGlzaGVkIGJ5IHRoZSBGcmVlIFNvZnR3YX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X2FjOTdfcmVhZChzdHJ1Y3QgYWM5N19jb2RlYyAqLCB1OCk7Cit2b2lkIGVtdTEwazFfYWM5N193cml0ZShzdHJ1Y3QgYWM5N19jb2RlYyAqLCB1OCwgdTE2KTsKKworLyogTVBVIGFjY2VzcyBmdW5jdGlvbiovCitpbnQgZW11MTBrMV9tcHVfd3JpdGVfZGF0YShzdHJ1Y3QgZW11MTBrMV9jYXJkICosIHU4KTsKK2ludCBlbXUxMGsxX21wdV9yZWFkX2RhdGEoc3RydWN0IGVtdTEwazFfY2FyZCAqLCB1OCAqKTsKK2ludCBlbXUxMGsxX21wdV9yZXNldChzdHJ1Y3QgZW11MTBrMV9jYXJkICopOworaW50IGVtdTEwazFfbXB1X2FjcXVpcmUoc3RydWN0IGVtdTEwazFfY2FyZCAqKTsKK2ludCBlbXUxMGsxX21wdV9yZWxlYXNlKHN0cnVjdCBlbXUxMGsxX2NhcmQgKik7CisKKyNlbmRpZiAgLyogX0hXQUNDRVNTX0ggKi8KZGlmZiAtLWdpdCBhL3NvdW5kL29zcy9lbXUxMGsxL2ljYXJkbWlkLmggYi9zb3VuZC9vc3MvZW11MTBrMS9pY2FyZG1pZC5oCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjZhNmVmNDEKLS0tIC9kZXYvbnVsbAorKysgYi9zb3VuZC9vc3MvZW11MTBrMS9pY2FyZG1pZC5oCkBAIC0wLDAgKzEsMTYzIEBACisvKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICAgICBpc2JsaXZlX21pZC5oCisgKiAgICAgQ29weXJpZ2h0IDE5OTksIDIwMDAgQ3JlYXRpdmUgTGFicywgSW5jLgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogICAgIERhdGUgICAgICAgICAgICAgICA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B0aGUgR05VIEdlbmVyYWwgUHVibGljCisgKiAgICAgTGljZW5zZSBhbG9uZyB3aXRoIHRoaXMgcHJvZ3JhbTsgaWYgbm90LCB3cml0ZSB0byB0aGUgRnJlZQorICogICAgIFNvZnR3YXJlIEZvdW5kYXRpb24sIEluYy4sIDY3NSBNYXNzIEF2ZSwgQ2FtYnJpZGdlLCBNQSAwMjEzOSwKKyAqICAgICBVU0EuCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqLworCisjaWZuZGVmIF9JQ0FSRE1JRElfSAorI2RlZmluZSBfSUNBUkRNSURJX0gKKworLyogTUlESSBkZWZpbmVzICovCisjZGVmaW5lIE1JRElfREFUQV9GSVJTVCAgICAgICAgICAgICAgICAgMHgwMAorI2RlZmluZSBNSURJX0RBVEFfTEFTVCAgICAgICAgICAgICAgICAgIDB4N0YKKyNkZWZpbmUgTUlESV9TVEFUVVNfRklSU1QgICAgICAgICAgICAgICAweDgwCisjZGVmaW5lIE1JRElfU1RBVFVTX0xBU1QgICAgICAgICAgICAgICAgMHhGRgorCisvKiBDaGFubmVsIHN0YXR1cyBieXRlcyAqLworI2RlZmluZSBNSURJX1NUQVRVU19DSEFOTkVMX0ZJUlNUICAgICAgIDB4ODAKKyNkZWZpbmUgTUlESV9TVEFUVVNfQ0hBTk5FTF9MQVNUICAgICAgICAweEUwCisjZGVmaW5lIE1JRElfU1RBVFVTX0NIQU5ORUxfTUFTSyAgICAgICAgMHhGMAorCisvKiBDaGFubmVsIHZvaWNlIG1lc3NhZ2VzICovCisjZGVmaW5lIE1JRElfVk9JQ0VfTk9URV9PRkYgICAgICAgICAgICAgMHg4MAorI2RlZmluZSBNSURJX1ZPSUNFX05PVEVfT04gICAgICAgICAgICAgIDB4OTAKKyNkZWZpbmUgTUlESV9WT0lDRV9QT0xZX1BSRVNTVVJFICAgICAgICAweEEwCisjZGVmaW5lIE1JRElfVk9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1JFUVVFU1QgICAgICAgIDB4RjYKKworLyogU3lzdGVtIHJlYWwtdGltZSBtZXNzYWdlcyAqLworI2RlZmluZSBNSURJX1JUSU1FX1RJTUlOR19DTE9DSyAgICAgICAgIDB4RjgKKyNkZWZpbmUgTUlESV9SVElNRV9VTkRFRklORURfRjkgICAgICAgICAweEY5CisjZGVmaW5lIE1JRElfUlRJTUVfU1RBUlQgICAgICAgICAgICAgICAgMHhGQQorI2RlZmluZSBNSURJX1JUSU1FX0NPTlRJTlVFICAgICAgICAgICAgIDB4RkIKKyNkZWZpbmUgTUlESV9SVElNRV9TVE9QICAgICAgICAgICAgICAgICAweEZDCisjZGVmaW5lIE1JRElfUlRJTUVfVU5ERUZJTkVEX0ZEICAgICAgICAgMHhGRAorI2RlZmluZSBNSURJX1JUSU1FX0FDVElWRV9TRU5TSU5HICAgICAgIDB4RkUKKyNkZWZpbmUgTUlESV9SVElNRV9TWVNURU1fUkVTRVQgICAgICAgICAweEZGCisKKy8qIEZsYWdzIGZvciBmbGFncyBwYXJtIG9mIG1pZGlPdXRDYWNoZVBhdGNoZXMoKSwgbWlkaU91dENhY2hlRHJ1bVBhdGNoZXMoKSAqLworI2RlZmluZSBNSURJX0NBQ0hFX0FMTCAgICAgICAgICAgICAgICAgIDEKKyNkZWZpbmUgTUlESV9DQUNIRV9CRVNURklUICAgICAgICAgICAgICAyCisjZGVmaW5lIE1JRElfQ0FDSEVfUVVFUlkgICAgICAgICAgICAgICAgMworI2RlZmluZSBNSURJX1VOQ0FDSEUgICAgICAgICAgICAgICAgICAgIDQKKworLyogRXZlbnQgZGVjbGFyYXRpb25zIGZvciBNUFUgSVJRIENhbGxiYWNrcyAqLworI2RlZmluZSBJQ0FSRE1JRElfSU5MT05HREFUQSAgICAgICAgICAgIDB4MDAwMDAwMDEgLyogTUlNX0xPTkdEQVRBICovCisjZGVmaW5lIElDQVJETUlESV9JTkxPTkdFUlJPUiAgICAgICAgICAgMHgwMDAwMDAwMiAvKiBNSU1fTE9OR0VSUk9SICovCisjZGVmaW5lIElDQVJETUlESV9PVVRMT05HREFUQSAgICAgICAgICAgMHgwMDAwMDAwNCAvKiBNT01fRE9ORSBmb3IgTVBVIE9VVCBidWZmZXIgKi8KKyNkZWZpbmUgSUNBUkRNSURJX0lOREFUQSAgICAgICAgICAgICAgICAweDAwMDAwMDEwIC8qIE1JTV9EQVRBICovCisjZGVmaW5lIElDQVJETUlESV9JTkRBVEFFUlJPUiAgICAgICAgICAgMHgwMDAwMDAyMCAvKiBNSU1fRVJST1IgKi8KKworLyogRGVjbGFyYXRpb24gZm9yIGZsYWdzIGluIENBUkRNSURJQlVGRkVSSERSICovCisvKiBNYWtlIGl0IHRoZSBzYW1lIGFzIE1IRFJfRE9ORSwgTUhEUl9JTlFVRVVFIGluIG1tc3lzdGVtLmggKi8KKyNkZWZpbmUgTUlESUJVRl9ET05FICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAxCisjZGVmaW5lIE1JRElCVUZfSU5RVUVVRSAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNAorCisvKiBEZWNsYXJhdGlvbiBmb3IgbXNnIHBhcmFtZXRlciBpbiBtaWRpQ2FsbGJhY2tGbiAqLworI2RlZmluZSBJQ0FSRE1JRElfT1VUQlVGRkVST0sgICAgICAgICAgIDB4MDAwMDAwMDEKKyNkZWZpbmUgSUNBUkRNSURJX0lOTUlESU9LICAgICAgICAgICAgICAweDAwMDAwMDAyCisKKy8qIERlY2xhcmF0aW9uIGZvciB0ZWNobm9sb2d5IGluIHN0cnVjdCBtaWRpX2NhcHMgKi8KKyNkZWZpbmUgTVRfTUlESVBPUlQgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAxCS8qIEluIG9yaWdpbmFsIE1JRElPVVRDQVBTIHN0cnVjdHVyZSAqLworI2RlZmluZSBNVF9GTVNZTlRIICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDQJLyogSW4gb3JpZ2luYWwgTUlESU9VVENBUFMgc3RydWN0d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FNldENvbnRyb2wgKi8KK2VudW0KK3sKKwlNSURJT0JKVk9MVU1FID0gMHgxLAorCU1JRElRVUVSWUFDVElWRUlOU1QKK307CisKK3N0cnVjdCBtaWRpX3F1ZXVlCit7CisJc3RydWN0IG1pZGlfcXVldWUgICpuZXh0OworCXUzMiBxdHlwZTsgICAgICAgICAgICAvKiAwID0gc2hvcnQgbWVzc2FnZSwgMSA9IGxvbmcgZGF0YSAqLworCXUzMiBsZW5ndGg7CisJdTMyIHNpemVMZWZ0OworCXU4ICptaWRpYnl0ZTsKKwl1bnNpZ25lZCBsb25nIHJlZmRhdGE7Cit9OworCitzdHJ1Y3QgbWlkaV9vcGVuaW5mbworeworCXUzMiAgICAgY2JzaXplOworCXUzMiAgICAgZmxhZ3M7CisJdW5zaWduZWQgbG9uZyAgcmVmZGF0YTsKKwl1MzIgICAgIHN0cmVhbWlkOworfTsKKworaW50IGVtdTEwazFfbWlkaV9jYWxsYmFjayh1bnNpZ25lZCBsb25nICwgdW5zaWduZWQgbG9uZywgdW5zaWduZWQgbG9uZyAqKTsKKworI2VuZGlmIC8qIF9JQ0FSRE1JRElfSCAqLwpkaWZmIC0tZ2l0IGEvc291bmQvb3NzL2VtdTEwazEvaWNhcmR3YXYuaCBiL3NvdW5kL29zcy9lbXUxMGsxL2ljYXJkd2F2LmgKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMjViZTQwOQotLS0gL2Rldi9udWxsCisrKyBiL3NvdW5kL29zcy9lbXUxMGsxL2ljYXJkd2F2LmgKQEAgLTAsMCArMSw1MyBAQAorLyogICAgIAorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICAgICBpY2FyZHdhdi5oCisgKiAgICAgQ29weXJpZ2h0IDE5OTksIDIwMDAgQ3JlYXRpdmUgTGFicywgSW5jLiAKKyAqIAorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogCisgKiAKKyAqICAgICBEYXRlICAgICAgICAgICAgICAgICBBdXRob3IgICAgICAgICAgU3VtbWFyeSBvZiBjaGFuZ2VzIAorICogICAgIC0tLS0gICAgICAgICAgICAgICAgIC0tLS0tLSAgICAgICAgICAtLS0tLS0tLS0tLS0tLS0tLS0gCisgKiAgICAgT2N0b2JlciAyMCwgMTk5OSAgICAgQmVydHJhbmQgTGVlICAgIGJhc2UgY29kZSByZWxlYXNlIAorICogCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAKKyAqIAorICogICAgIFRoaXMgcHJvZ3JhbSBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IgCisgKiAgICAgbW9kaWZ5IGl0IHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgYXMgCisgKiAgICAgcHVibGlzaGVkIGJ5IHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb247IGVpdGhlciB2ZXJzaW9uIDIgb2YgCisgKiAgICAgdGhlIExpY2Vuc2UsIG9yIChhdCB5b3VyIG9wdGlvbikgYW55IGxhdGVyIHZlcnNpb24uIAorICogCisgKiAgICAgVGhpcyBwcm9ncmFtIGlzIGRpc3RyaWJ1dGVkIGluIHRoZSBob3BlIHRoYXQgaXQgd2lsbCBiZSB1c2VmdWwsIAorICogICAgIGJ1dCBXSVRIT1VUIEFOWSBXQVJSQU5UWTsgd2l0aG91dCBldmVuIHRoZSBpbXBsaWVkIHdhcnJhbnR5IG9mIAorICogICAgIE1FUkNIQU5UQUJJTElUWSBvciBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRS4gIFNlZSB0aGUgCisgKiAgICAgR05VIEdlbmVyYWwgUHVibGlj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mMgYi9zb3VuZC9vc3MvZW11MTBrMS9pcnFtZ3IuYwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5kMTliNDY0Ci0tLSAvZGV2L251bGwKKysrIGIvc291bmQvb3NzL2VtdTEwazEvaXJxbWdyLmMKQEAgLTAsMCArMSwxMTMgQEAKKy8qCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogICAgIGlycW1nci5jIC0gSVJRIG1hbmFnZXIgZm9yIGVtdTEwazEgZHJpdmVyCisgKiAgICAgQ29weXJpZ2h0IDE5OTksIDIwMDAgQ3JlYXRpdmUgTGFicywgSW5jLgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogICAgIERhdGUgICAgICAgICAgICAgICAgIEF1dGhvciAgICAgICAgICBTdW1tYXJ5IG9mIGNoYW5nZXMKKyAqICAgICAtLS0tICAgICAgICAgICAgICAgICAtLS0tLS0gICAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tCisgKiAgICAgT2N0b2JlciAyMCwgMTk5OSAgICAgQmVydHJhbmQgTGVlICAgIGJhc2UgY29kZSByZWxlYXNlCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiAgICAgVGhpcyBwcm9ncmFtIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0IGFuZC9vcgorICogICAgIG1vZGlmeSBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGFzCisgKiAgICAgcHVibGlzaGVkIGJ5IHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb247IGVpdGhlciB2ZXJzaW9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GludGVycnVwdDogJSMwOHhcbiIsIGlycXN0YXR1cyk7CisJCQkvL21ha2Ugc3VyZSBhbnkgaW50ZXJydXB0cyB3ZSBkb24ndCBoYW5kbGUgYXJlIGRpc2FibGVkOgorCQkJZW11MTBrMV9pcnFfZGlzYWJsZShjYXJkLCB+KElOVEVfTUlESVJYRU5BQkxFIHwgSU5URV9NSURJVFhFTkFCTEUgfCBJTlRFX0lOVEVSVkFMVElNRVJFTkIgfAorCQkJCQkJSU5URV9WT0xERUNSRU5BQkxFIHwgSU5URV9WT0xJTkNSRU5BQkxFIHwgSU5URV9NVVRFRU5BQkxFIHwKKwkJCQkJCUlOVEVfRlhEU1BFTkFCTEUpKTsKKwkJfQorCisJCS8qIGFja25vd2xlZGdlIGludGVycnVwdCAqLworCQlvdXRsKGlycXN0YXR1c190bXAsIGNhcmQtPmlvYmFzZSArIElQUik7CisJCWhhbmRsZWQgPSAxOworCX0KKwlyZXR1cm4gSVJRX1JFVFZBTChoYW5kbGVkKTsKK30KZGlmZiAtLWdpdCBhL3NvdW5kL29zcy9lbXUxMGsxL2lycW1nci5oIGIvc291bmQvb3NzL2VtdTEwazEvaXJxbWdyLmgKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uN2U3YzljYQotLS0gL2Rldi9udWxsCisrKyBiL3NvdW5kL29zcy9lbXUxMGsxL2lycW1nci5oCkBAIC0wLDAgKzEsNTIgQEAKKy8qCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogICAgIGlycS5oCisgKiAgICAgQ29weXJpZ2h0IDE5OTksIDIwMDAgQ3JlYXRpdmUgTGFicywgSW5jLgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogICAgIERhdGUgICAgICAgICAgICAgICAgIEF1dGhvciAgICAgICAgICBTd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SX0dQU1BESUZTVEFUVVNDSEFOR0UgfCBJUFJfQ0RST01TVEFUVVNDSEFOR0UpCisjZGVmaW5lIElSUVRZUEVfRFNQCQlJUFJfRlhEU1AKKwordm9pZCBlbXUxMGsxX3RpbWVyX2lycWhhbmRsZXIoc3RydWN0IGVtdTEwazFfY2FyZCAqKTsKK3ZvaWQgZW11MTBrMV9kc3BfaXJxaGFuZGxlcihzdHJ1Y3QgZW11MTBrMV9jYXJkICopOwordm9pZCBlbXUxMGsxX211dGVfaXJxaGFuZGxlcihzdHJ1Y3QgZW11MTBrMV9jYXJkICopOwordm9pZCBlbXUxMGsxX3ZvbGluY3JfaXJxaGFuZGxlcihzdHJ1Y3QgZW11MTBrMV9jYXJkICopOwordm9pZCBlbXUxMGsxX3ZvbGRlY3JfaXJxaGFuZGxlcihzdHJ1Y3QgZW11MTBrMV9jYXJkICopOworCisjZW5kaWYgLyogX0lSUV9IICovCmRpZmYgLS1naXQgYS9zb3VuZC9vc3MvZW11MTBrMS9tYWluLmMgYi9zb3VuZC9vc3MvZW11MTBrMS9tYWluLmMKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uOWI5MDViYQotLS0gL2Rldi9udWxsCisrKyBiL3NvdW5kL29zcy9lbXUxMGsxL21haW4uYwpAQCAtMCwwICsxLDE0NzUgQEAKKyAvKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICAgICBtYWluLmMgLSBDcmVhdGl2ZSBFTVUxMEsxIGF1ZGlvIGRyaXZlcgorICogICAgIENvcHlyaWdodCAxOTk5LCAyMDAwIENyZWF0aXZlIExhYnMsIEluYy4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqICAgICBEYXRlICAgICAgICAgICAgICAgICBBdXRob3IgICAgICAgICAgU3Vt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qCisgKiAgICAgWW91IHNob3VsZCBoYXZlIHJlY2VpdmVkIGEgY29weSBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljCisgKiAgICAgTGljZW5zZSBhbG9uZyB3aXRoIHRoaXMgcHJvZ3JhbTsgaWYgbm90LCB3cml0ZSB0byB0aGUgRnJlZQorICogICAgIFNvZnR3YXJlIEZvdW5kYXRpb24sIEluYy4sIDY3NSBNYXNzIEF2ZSwgQ2FtYnJpZGdlLCBNQSAwMjEzOSwKKyAqICAgICBVU0EuCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiAgICAgIFN1cHBvcnRlZCBkZXZpY2VzOgorICogICAgICAvZGV2L2RzcDogICAgICAgIFN0YW5kYXJkIC9kZXYvZHNwIGRldmljZSwgT1NTLWNvbXBhdGlibGUKKyAqICAgICAgL2Rldi9kc3AxOiAgICAgICBSb3V0ZXMgdG8gcmVhciBzcGVha2VycyBvbmx5CSAKKyAqICAgICAgL2Rldi9taXhlcjogICAgICBTdGFuZGFyZCAvZGV2L21peGVyIGRldmljZSwgT1NTLWNvbXBhdGlibGUKKyAqICAgICAgL2Rldi9taWRpOiAgICAgICBSYXcgTUlESSBVQVJUIGRldmljZSwgbW9zdGx5IE9TUy1jb21wYXRpYmxlCisgKgkvZGV2L3NlcXVlbmNlcjogIFNlcXVlbmNlciBJbnRlcmZhY2UgKHJlcXVpcmVzIHNvdW5kLm8pCisgKgorICogICAgICBSZXZpc2lvbiBoaXN0b3J5OgorICogICAgICAwLjEgYmV0YSBJbml0aWFsIHJlbGVhc2UKKyAqICAgICAgMC4yIExvd2VyZWQgaW5pdGlhbCBtaXhlciB2b2wuIEltcHJvdmVkIG9uIHN0dXR0ZXJpbmcgd2F2ZSBwbGF5YmFjay4gQWRkZWQgTUlESSBVQVJUIHN1cHBvcnQuCisgKiAgICAgIDAuMyBGaXhlZCBtaXhlciByb3V0aW5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A7IGNoIDwgTlVNX0c7IGNoKyspCisJCXNibGl2ZV93cml0ZXB0cihjYXJkLCBEQ1lTVVNWLCBjaCwgMCk7CisKKwlmb3IgKGNoID0gMDsgY2ggPCBOVU1fRzsgY2grKykgeworCQlzYmxpdmVfd3JpdGVwdHJfdGFnKGNhcmQsIGNoLAorCQkJCSAgICBWVEZULCAwLAorCQkJCSAgICBDVkNGLCAwLAorCQkJCSAgICBQVFJYLCAwLAorCQkJCSAgICAvL0NQRiwgMCwKKwkJCQkgICAgVEFHTElTVF9FTkQpOworCQlzYmxpdmVfd3JpdGVwdHIoY2FyZCwgQ1BGLCBjaCwgMCk7CisJfQorCisJLyogRGlzYWJsZSBhdWRpbyBhbmQgbG9jayBjYWNoZSAqLworCWVtdTEwazFfd3JpdGVmbjAoY2FyZCwgSENGRywgSENGR19MT0NLU09VTkRDQUNIRSB8IEhDRkdfTE9DS1RBTktDQUNIRV9NQVNLIHwgSENGR19NVVRFQlVUVE9ORU5BQkxFKTsKKworCXNibGl2ZV93cml0ZXB0cl90YWcoY2FyZCwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBQVEIsIDAsCisKKwkJCSAgICAvKiBSZXNldCByZWNvcmRpbmcgYnVmZmVycyAqLworCQkJICAgIE1JQ0JTLCBBRENCU19CVUZTSVpFX05PTkUsCisJCQkgICAgTUlDQkEsIDAsCisJCQkgICAgRlhCUywgQURDQlNfQlVGU0laRV9OT05FLAorCQkJICAgIEZYQkEsIDAsCisJCQkgICAgRlhXQywgMCwKKwkJCSAgICBBRENCUywgQURDQlNfQlVGU0laRV9OT05FLAorCQkJICAgIEFEQ0JBLCAwLAorCQkJICAgIFRDQlMsIDAsCisJCQkgICAgVENCLCAwLAorCQkJICAgIERCRywgMHg4MDAwLAorCisJCQkgICAgLyogRGlzYWJsZSBjaGFubmVsIGludGVycnVwdCAqLworCQkJICAgIENMSUVMLCAwLAorCQkJICAgIENMSUVILCAwLAorCQkJICAgIFNPTEVMLCAwLAorCQ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RpYyBzdHJ1Y3QgbWlkaV9vcGVyYXRpb25zIGVtdTEwazFfbWlkaV9vcGVyYXRpb25zID0KK3sKKwlUSElTX01PRFVMRSwKKwl7IkVNVTEwSzEgTUlESSIsIDAsIDAsIFNORENBUkRfRU1VMTBLMX0sCisJJnN0ZF9taWRpX3N5bnRoLAorCXswfSwKKwllbXUxMGsxX3NlcV9taWRpX29wZW4sCisJZW11MTBrMV9zZXFfbWlkaV9jbG9zZSwKKwlOVUxMLAorCWVtdTEwazFfc2VxX21pZGlfb3V0LAorCWVtdTEwazFfc2VxX21pZGlfc3RhcnRfcmVhZCwKKwllbXUxMGsxX3NlcV9taWRpX2VuZF9yZWFkLAorCWVtdTEwazFfc2VxX21pZGlfa2ljaywKKwlOVUxMLAorCWVtdTEwazFfc2VxX21pZGlfYnVmZmVyX3N0YXR1cywKKwlOVUxMCit9OworCisjZW5kaWYKZGlmZiAtLWdpdCBhL3NvdW5kL29zcy9lbXUxMGsxL21pZGkuYyBiL3NvdW5kL29zcy9lbXUxMGsxL21pZGkuYwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zM2RlYTNkCi0tLSAvZGV2L251bGwKKysrIGIvc291bmQvb3NzL2VtdTEwazEvbWlkaS5jCkBAIC0wLDAgKzEsNjEzIEBACisvKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICAgICBtaWRpLmMgLSAvZGV2L21pZGkgaW50ZXJmYWNlIGZvciBlbXUxMGsxIGRyaXZlcgorICogICAgIENvcHlyaWdodCAxOTk5LCAyMDAwIENyZWF0aXZlIExhYnMsIEluYy4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqICAgICBEYXRlICAgICAgICAgICAgICAgICBBdXRob3IgICAgICAgICAgU3VtbWFyeSBvZiB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bZGV2XS0+ZGV2YzsKKwlxdWV1ZSA9IGNhcmQtPm1wdW91dC0+Zmlyc3RtaWRpcTsKKworCXdoaWxlIChxdWV1ZSAhPSBOVUxMKSB7CisJCWNvdW50Kys7CisJCWlmIChxdWV1ZSA9PSBjYXJkLT5tcHVvdXQtPmxhc3RtaWRpcSkKKwkJCWJyZWFrOworCisJCXF1ZXVlID0gcXVldWUtPm5leHQ7CisJfQorCisJcmV0dXJuIGNvdW50OworfQorCisjZW5kaWYKKwpkaWZmIC0tZ2l0IGEvc291bmQvb3NzL2VtdTEwazEvbWlkaS5oIGIvc291bmQvb3NzL2VtdTEwazEvbWlkaS5oCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjI0NTllYzkKLS0tIC9kZXYvbnVsbAorKysgYi9zb3VuZC9vc3MvZW11MTBrMS9taWRpLmgKQEAgLTAsMCArMSw3OCBAQAorLyogICAgIAorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICAgICBtaWRpLmgKKyAqICAgICBDb3B5cmlnaHQgMTk5OSwgMjAwMCBDcmVhdGl2ZSBMYWJzLCBJbmMuIAorICogCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAKKyAqIAorICogICAgIERhdGUgICAgICAgICAgICAgICAgIEF1dGhvciAgICAgICAgICBTdW1tYXJ5IG9mIGNoYW5nZXMgCisgKiAgICAgLS0tLSAgICAgICAgICAgICAgICAgLS0tLS0tICAgICAgICAgIC0tLS0tLS0tLS0tLS0tLS0tLSAKKyAqICAgICBPY3RvYmVyIDIwLCAxOTk5ICAgICBCZXJ0cmFuZCBMZWUgICAgYmFzZSBjb2RlIHJlbGVhc2UgCisgKiAKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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yaWdodCAxOTk5LCAyMDAwIENyZWF0aXZlIExhYnMsIEluYy4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqICAgICBEYXRlICAgICAgICAgICAgICAgICBBdXRob3IgICAgICAgICAgU3VtbWFyeSBvZiBjaGFuZ2VzCisgKiAgICAgLS0tLSAgICAgICAgICAgICAgICAgLS0tLS0tICAgICAgICAgIC0tLS0tLS0tLS0tLS0tLS0tLQorICogICAgIE9jdG9iZXIgMjAsIDE5OTkgICAgIEJlcnRyYW5kIExlZSAgICBiYXNlIGNvZGUgcmVsZWFzZQorICogICAgIE5vdmVtYmVyIDIsIDE5OTkgICAgIEFsYW4gQ294ICAgICAgICBjbGVhbmVkIHVwIHN0dWZmCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiAgICAgVGhpcyBwcm9ncmFtIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0IGFuZC9vcgorICogICAgIG1vZGlmeSBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGFzCisgKiAgICAgcHVibGlzaGVkIGJ5IHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb247IGVpdGhlciB2ZXJzaW9uIDIgb2YKKyAqICAgICB0aGUgTGljZW5zZSwgb3IgKGF0IHlvdXIgb3B0aW9uKSBhbnkgbGF0ZXIgdmVyc2lvbi4KKyAqCisgKiAgICAgVGhpcyBwcm9ncmFtIGlzIGRpc3RyaWJ1dGVkIGluIHRoZSBob3BlIHRoYXQgaXQgd2lsbCBiZSB1c2VmdWwsCisgKiAgICAgYnV0IFdJVEhPVVQgQU5ZIFdBUlJBTlRZOyB3aXRob3V0IGV2ZW4gdGhlIGlt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XUxMGsxX21peGVyX29wZW4sCisJLnJlbGVhc2UJPSBlbXUxMGsxX21peGVyX3JlbGVhc2UsCit9OwpkaWZmIC0tZ2l0IGEvc291bmQvb3NzL2VtdTEwazEvcGFzc3Rocm91Z2guYyBiL3NvdW5kL29zcy9lbXUxMGsxL3Bhc3N0aHJvdWdoLmMKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uNDA5NGJlNQotLS0gL2Rldi9udWxsCisrKyBiL3NvdW5kL29zcy9lbXUxMGsxL3Bhc3N0aHJvdWdoLmMKQEAgLTAsMCArMSwyMzYgQEAKKy8qCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogICAgIHBhc3N0aHJvdWdoLmMgLS0gRW11MTBrMSBkaWdpdGFsIHBhc3N0aHJvdWdoCisgKiAgICAgQ29weXJpZ2h0IChDKSAyMDAxICBKdWhhIFlyavZs5CA8anlyam9sYUBjYy5odXQuZmk+CisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiAgICAgRGF0ZSAgICAgICAgICAgICAgICAgQXV0aG9yICAgICAgICAgIFN1bW1hcnkgb2YgY2hhbmdlcworICogICAgIC0tLS0gICAgICAgICAgICAgICAgIC0tLS0tLSAgICAgICAgICAtLS0tLS0tLS0tLS0tLS0tLS0KKyAqICAgICBNYXkgMTUsIDIwMDEJICAgIEp1aGEgWXJq9mzkCSAgICBiYXNlIGNvZGUgcmVsZWFzZQorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogICAgIFRoaXMgcHJvZ3JhbSBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IKKyAqICAgICB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emUgKyBwb3M7CisJd29pbnN0LT5idWZmZXIuaHdfcG9zID0gcG9zOworfQpkaWZmIC0tZ2l0IGEvc291bmQvb3NzL2VtdTEwazEvcGFzc3Rocm91Z2guaCBiL3NvdW5kL29zcy9lbXUxMGsxL3Bhc3N0aHJvdWdoLmgKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uNDIwY2M5NwotLS0gL2Rldi9udWxsCisrKyBiL3NvdW5kL29zcy9lbXUxMGsxL3Bhc3N0aHJvdWdoLmgKQEAgLTAsMCArMSw5OSBAQAorLyoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAgICAgcGFzc3Rocm91Z2guaCAtLSBFbXUxMGsxIGRpZ2l0YWwgcGFzc3Rocm91Z2ggaGVhZGVyIGZpbGUKKyAqICAgICBDb3B5cmlnaHQgKEMpIDIwMDEgIEp1aGEgWXJq9mzkIDxqeXJqb2xhQGNjLmh1dC5maT4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqICAgICBEYXRlICAgICAgICAgICAgICAgICBBdXRob3IgICAgICAgICAgU3VtbWFyeSBvZiBjaGFuZ2VzCisgKiAgICAgLS0tLSAgICAgICAgICAgICAgICAgLS0tLS0tICAgICAgICAgIC0tLS0tLS0tLS0tLS0tLS0tLQorICogICAgIE1heSAxNSwgMjAwMQkgICAgSnVoYSBZcmr2bOQgICAgIGJhc2UgY29kZSByZWxlYXNlCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiAgICAgVGhpcyBwcm9ncmFtIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0IGFuZC9vcgorICogICAgIG1vZG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Li5hNjg3NjZhCi0tLSAvZGV2L251bGwKKysrIGIvc291bmQvb3NzL2VtdTEwazEvcmVjbWdyLmgKQEAgLTAsMCArMSw0OCBAQAorLyogICAgIAorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICAgICByZWNtZ3IuaAorICogICAgIENvcHlyaWdodCAxOTk5LCAyMDAwIENyZWF0aXZlIExhYnMsIEluYy4gCisgKiAKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqIAorICogCisgKiAgICAgRGF0ZSAgICAgICAgICAgICAgICAgQXV0aG9yICAgICAgICAgIFN1bW1hcnkgb2YgY2hhbmdlcyAKKyAqICAgICAtLS0tICAgICAgICAgICAgICAgICAtLS0tLS0gICAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tIAorICogICAgIE9jdG9iZXIgMjAsIDE5OTkgICAgIEJlcnRyYW5kIExlZSAgICBiYXNlIGNvZGUgcmVsZWFzZSAKKyAqIAorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogCisgKiAKKyAqICAgICBUaGlzIHByb2dyYW0gaXMgZnJlZSBzb2Z0d2FyZTsgeW91IGNhbiByZWRpc3RyaWJ1dGUgaXQgYW5kL29yIAorICogICAgIG1vZGlmeSBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGFzIAorICogICAgIHB1Ymxpc2hlZCBieSB0aGUgRnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uOyBlaXRoZXIgdmVyc2lvbiAyIG9mIAorICogICAgIHRoZSBMaWNlbnNlLCBvciAoYXQgeW91ciBvcHRpb24pIGFueSBsYXRlciB2ZXJzaW9uLiAKKyAqIAorICogICAgIFRoaXMgcHJ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Y2VtZ3IuaCBiL3NvdW5kL29zcy9lbXUxMGsxL3ZvaWNlbWdyLmgKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMDk5YThjYgotLS0gL2Rldi9udWxsCisrKyBiL3NvdW5kL29zcy9lbXUxMGsxL3ZvaWNlbWdyLmgKQEAgLTAsMCArMSwxMDMgQEAKKy8qCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogICAgIHNibGl2ZV92b2ljZS5oIC0tIEVNVSBWb2ljZSBSZXNvdXJjZSBNYW5hZ2VyIGhlYWRlciBmaWxlCisgKiAgICAgQ29weXJpZ2h0IDE5OTksIDIwMDAgQ3JlYXRpdmUgTGFicywgSW5jLgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogICAgIERhdGUgICAgICAgICAgICAgICAgIEF1dGhvciAgICAgICAgICBTdW1tYXJ5IG9mIGNoYW5nZXMKKyAqICAgICAtLS0tICAgICAgICAgICAgICAgICAtLS0tLS0gICAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tCisgKiAgICAgT2N0b2JlciAyMCwgMTk5OSAgICAgQmVydHJhbmQgTGVlICAgIGJhc2UgY29kZSByZWxlYXNlCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiAgICAgVGhpcyBwcm9ncmFtIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0IGFuZC9vcgorICogICAgIG1vZGlmeSBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGFzCisgKiAgICAgcHVibGlzaGVkIGJ5IHRoZSBGcmVlIFNvZn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ZGVkIHN1cHBvcnQgZm9yIGFuIGVsZWN0cmV0IG1pYyBmb3IgU0IgUENJNjQKKyAqICAgICAgICAgICAgICAgICAgICAgICB0byB0aGUgTGludXgga2VybmVsIHNvdW5kIGRyaXZlci4gVGhpcyBtb2QgYWxzbyBzdHJhaWdodGVuCisgKiAgICAgICAgICAgICAgICAgICAgICAgb3V0IHRoZSBxdWVzdGlvbiBtYXJrcyBhcm91bmQgdGhlIG1pYyBpbXBlZGFuY2Ugc2V0dGluZworICogICAgICAgICAgICAgICAgICAgICAgIChtaWN6KS4gRnJvbSBLaW0uQmVydHNAZmlzdWIubWFpbC5hYmIuY29tCisgKiAgICAxMS4wNS4xOTk5ICAgMC4yMiAgSW1wbGVtZW50ZWQgdGhlIElNSVggY2FsbCB0byBtdXRlIHJlY29yZGluZyBtb25pdG9yLgorICogICAgICAgICAgICAgICAgICAgICAgIEd1ZW50ZXIgR2VpZ2VyIDxnZWlnZXJAZXB5LmNvLmF0PgorICogICAgMTUuMDYuMTk5OSAgIDAuMjMgIEZpeCBiYWQgYWxsb2NhdGlvbiBidWcuCisgKiAgICAgICAgICAgICAgICAgICAgICAgVGhhbmtzIHRvIERldGkgRmxpZWdsIDxmbGllZ2xAaW4udHVtLmRlPgorICogICAgMjguMDYuMTk5OSAgIDAuMjQgIEFkZCBwY2lfc2V0X21hc3RlcgorICogICAgMDIuMDguMTk5OSAgIDAuMjUgIEFkZGVkIHdvcmthcm91bmQgZm9yIHRoZSAicGhhbnRvbSB3cml0ZSIgYnVnIGZpcnN0CisgKiAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnRlZCBieSBEYXZlIFNoYXJwbGVzcyBmcm9tIEFuY2hvciBHYW1lcworICogICAgMDMuMDguMTk5OSAgIDAuMjYgIGFkYXB0IHRvIExpbnVzJyBuZXcgX19zZXR1cC9fX2luaXRjYWxsCisgKiAgICAgICAgICAgICAgICAgICAgICAgYWRkZWQga2VybmVsIGNvbW1hbmQgbGluZSBvcHRpb24gIm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AgICAweDAwMDAwMDAxICAvKiBBREMgaW50IHBlbmRpbmcgKi8KKworI2RlZmluZSBVU1RBVF9SWElOVCAgICAgMHg4MCAgICAgICAgLyogVUFSVCByeCBpbnQgcGVuZGluZyAqLworI2RlZmluZSBVU1RBVF9UWElOVCAgICAgMHgwNCAgICAgICAgLyogVUFSVCB0eCBpbnQgcGVuZGluZyAqLworI2RlZmluZSBVU1RBVF9UWFJEWSAgICAgMHgwMiAgICAgICAgLyogVUFSVCB0eCByZWFkeSAqLworI2RlZmluZSBVU1RBVF9SWFJEWSAgICAgMHgwMSAgICAgICAgLyogVUFSVCByeCByZWFkeSAqLworCisjZGVmaW5lIFVDVFJMX1JYSU5URU4gICAweDgwICAgICAgICAvKiAxID0gZW5hYmxlIFJYIGludHMgKi8KKyNkZWZpbmUgVUNUUkxfVFhJTlRFTiAgIDB4NjAgICAgICAgIC8qIFRYIGludCBlbmFibGUgZmllbGQgbWFzayAqLworI2RlZmluZSBVQ1RSTF9FTkFfVFhJTlQgMHgyMCAgICAgICAgLyogZW5hYmxlIFRYIGludCAqLworI2RlZmluZSBVQ1RSTF9DTlRSTCAgICAgMHgwMyAgICAgICAgLyogY29udHJvbCBmaWVsZCAqLworI2RlZmluZSBVQ1RSTF9DTlRSTF9TV1IgMHgwMyAgICAgICAgLyogc29mdHdhcmUgcmVzZXQgY29tbWFuZCAqLworCisjZGVmaW5lIFNDVFJMX1AyRU5ESU5DICAgIDB4MDAzODAwMDAgIC8qICAqLworI2RlZmluZSBTQ1RSTF9TSF9QMkVORElOQyAxOQorI2RlZmluZSBTQ1RSTF9QMlNUSU5DICAgICAweDAwMDcwMDAwICAvKiAgKi8KKyNkZWZpbmUgU0NUUkxfU0hfUDJTVElOQyAgMTYKKyNkZWZpbmUgU0NUUkxfUjFMT09QU0VMICAgMHgwMDAwODAwMCAgLyogMCA9IGxvb3AgbW9kZSAqLworI2RlZmluZSBTQ1RSTF9QMkxPT1BTRUwgICAweDAwMDA0MDAwICAvKiAwID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C8qIE1vbm8xICovCisJW1NPVU5EX01JWEVSX0xJTkUzXSAgPSB7IDcsIDB4ZCwgMHgwLCAwLCAweDAyMDAsIDEgfSwgICAvKiBNb25vMiAqLworCVtTT1VORF9NSVhFUl9NSUNdICAgID0geyA4LCAweGUsIDB4MCwgMCwgMHgwMDAxLCAxIH0sICAgLyogTWljICovCisJW1NPVU5EX01JWEVSX09HQUlOXSAgPSB7IDksIDB4ZiwgMHgwLCAwLCAweDAwMDAsIDEgfSAgICAvKiBtb25vIG91dCAqLworfTsKKworc3RhdGljIHZvaWQgc2V0X3JlY3NyYyhzdHJ1Y3QgZXMxMzcwX3N0YXRlICpzLCB1bnNpZ25lZCBpbnQgdmFsKQoreworCXVuc2lnbmVkIGludCBpLCBqOworCisJZm9yIChqID0gaSA9IDA7IGkgPCBTT1VORF9NSVhFUl9OUkRFVklDRVM7IGkrKykgeworCQlpZiAoISh2YWwgJiAoMSA8PCBpKSkpCisJCQljb250aW51ZTsKKwkJaWYgKCFtaXh0YWJsZVtpXS5yZWNtYXNrKSB7CisJCQl2YWwgJj0gfigxIDw8IGkpOworCQkJY29udGludWU7CisJCX0KKwkJaiB8PSBtaXh0YWJsZVtpXS5yZWNtYXNrOworCX0KKwlzLT5taXgucmVjc3JjID0gdmFsOworCXdyY29kZWMocywgMHgxMiwgaiAmIDB4ZDUpOworCXdyY29kZWMocywgMHgxMywgaiAmIDB4YWEpOworCXdyY29kZWMocywgMHgxNCwgKGogPj4gOCkgJiAweDE3KTsKKwl3cmNvZGVjKHMsIDB4MTUsIChqID4+IDgpICYgMHgwZik7CisJaSA9IChqICYgMHgzN2YpIHwgKChqIDw8IDEpICYgMHgzMDAwKSB8IDB4YzYwOworCWlmICghcy0+bWl4LmltaXgpIHsKKwkJaSAmPSAweGZmNjA7ICAvKiBtdXRlIHJlY29yZCBhbmQgbGluZSBtb25pdG9yICovCisJfQorCXdyY29kZWMocywgMHgxMCwgaSk7CisJd3Jjb2RlYyhzLCAweDExLCBpID4+I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IGZsYWdzKTsKKwkJaWYgKGNvdW50IDw9IDApCisJCQlicmVhazsKKwkJaWYgKHNpZ25hbF9wZW5kaW5nKGN1cnJlbnQpKQorICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgaWYgKG5vbmJsb2NrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVfd2FpdF9xdWV1ZSgmcy0+ZG1hX2RhYzEud2FpdCwgJndhaXQpOworICAgICAgICAgICAgICAgICAgICAgICAgc2V0X2N1cnJlbnRfc3RhdGUoVEFTS19SVU5OSU5HKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAtRUJVU1k7CisgICAgICAgICAgICAgICAgfQorCQl0bW8gPSAzICogSFogKiAoY291bnQgKyBzLT5kbWFfZGFjMS5mcmFnc2l6ZSkgLyAyCisJCQkvIGRhYzFfc2FtcGxlcmF0ZVsocy0+Y3RybCAmIENUUkxfV1RTUlNFTCkgPj4gQ1RSTF9TSF9XVFNSU0VMXTsKKwkJdG1vID4+PSBzYW1wbGVfc2hpZnRbKHMtPnNjdHJsICYgU0NUUkxfUDFGTVQpID4+IFNDVFJMX1NIX1AxRk1UXTsKKwkJaWYgKCFzY2hlZHVsZV90aW1lb3V0KHRtbyArIDEpKQorCQkJREJHKHByaW50ayhLRVJOX0RFQlVHICJlczEzNzA6IGRtYSB0aW1lZCBvdXQ/P1xuIik7KQorICAgICAgICB9CisgICAgICAgIHJlbW92ZV93YWl0X3F1ZXVlKCZzLT5kbWFfZGFjMS53YWl0LCAmd2FpdCk7CisgICAgICAgIHNldF9jdXJyZW50X3N0YXRlKFRBU0tfUlVOTklORyk7CisgICAgICAgIGlmIChzaWduYWxfcGVuZGluZyhjdXJyZW50KSkKKyAgICAgICAgICAgICAgICByZXR1cm4gLUVSRVNUQVJUU1lTOworICAgICAgICByZXR1cm4gMDsKK30KKworc3RhdGljIGludCBkcmFpbl9kYWMyKHN0cnVjdCBlczEzNzBfc3RhdGUgKnMsIGludCBub25ibG9jaykKK3sKKwlERUNMQVJFX1dBSVRRVUVVRSh3YWl0LCBjdXJyZW50KTsKKwl1bnNpZ25lZCBsb25nIGZsYWdzOworCWludCBjb3VudCwgdG1vOworCisJaWYgKHMtPmRtYV9kYWMyLm1hcHBlZCB8fCAhcy0+ZG1hX2RhYzIucmVhZHkpCisJCXJldHVybiAwOworICAgICAgICBhZGRfd2FpdF9xdWV1ZSgmcy0+ZG1hX2RhYzIud2FpdCwgJndhaXQpOworICAgICAgICBmb3IgKDs7KSB7CisJCV9fc2V0X2N1cnJlbnRfc3RhdGUoVEFTS19JTlRFUlJVUFRJQkxFKTsKKyAgICAgICAgICAgICAgICBzcGluX2xvY2tfaXJxc2F2ZSgmcy0+bG9jaywgZmxhZ3MpOworCQljb3VudCA9IHMtPmRtYV9kYWMyLmNvdW50OworICAgICAgICAgICAgICAgIHNwaW5fdW5sb2NrX2lycXJlc3RvcmUoJnMtPmxvY2ssIGZsYWdzKTsKKwkJaWYgKGNvdW50IDw9IDApCisJCQlicmVhazsKKwkJaWYgKHNpZ25hbF9wZW5kaW5nKGN1cnJlbnQpKQorICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgaWYgKG5vbmJsb2NrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVfd2FpdF9xdWV1ZSgmcy0+ZG1hX2RhYzIud2FpdCwgJndhaXQpOworICAgICAgICAgICAgICAgICAgICAgICAgc2V0X2N1cnJlbnRfc3RhdGUoVEFTS19SVU5OSU5HKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAtRUJVU1k7CisgICAgICAgICAgICAgICAgfQorCQl0bW8gPSAzICogSFogKiAoY291bnQgKyBzLT5kbWFfZGFjMi5mcmFnc2l6ZSkgLyAyCisJCQkvIERBQzJfRElWVE9TUigocy0+Y3RybCAmIENUUkxfUENMS0RJVikgPj4gQ1RSTF9TSF9QQ0xLRElWKTsKKwkJdG1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m4gMDsKKworICAgICAgICBjYXNlIFNPVU5EX1BDTV9SRUFEX1JBVEU6CisJCXJldHVybiBwdXRfdXNlcihkYWMxX3NhbXBsZXJhdGVbKHMtPmN0cmwgJiBDVFJMX1dUU1JTRUwpID4+IENUUkxfU0hfV1RTUlNFTF0sIHApOworCisgICAgICAgIGNhc2UgU09VTkRfUENNX1JFQURfQ0hBTk5FTFM6CisJCXJldHVybiBwdXRfdXNlcigocy0+c2N0cmwgJiBTQ1RSTF9QMVNNQikgPyAyIDogMSwgcCk7CisKKyAgICAgICAgY2FzZSBTT1VORF9QQ01fUkVBRF9CSVRTOgorCQlyZXR1cm4gcHV0X3VzZXIoKHMtPnNjdHJsICYgU0NUUkxfUDFTRUIpID8gMTYgOiA4LCBwKTsKKworICAgICAgICBjYXNlIFNPVU5EX1BDTV9XUklURV9GSUxURVI6CisgICAgICAgIGNhc2UgU05EQ1RMX0RTUF9TRVRTWU5DUk86CisgICAgICAgIGNhc2UgU09VTkRfUENNX1JFQURfRklMVEVSOgorICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworCQkKKwl9CisJcmV0dXJuIG1peGVyX2lvY3RsKHMsIGNtZCwgYXJnKTsKK30KKworc3RhdGljIGludCBlczEzNzBfb3Blbl9kYWMoc3RydWN0IGlub2RlICppbm9kZSwgc3RydWN0IGZpbGUgKmZpbGUpCit7CisJdW5zaWduZWQgaW50IG1pbm9yID0gaW1pbm9yKGlub2RlKTsKKwlERUNMQVJFX1dBSVRRVUVVRSh3YWl0LCBjdXJyZW50KTsKKwl1bnNpZ25lZCBsb25nIGZsYWdzOworCXN0cnVjdCBsaXN0X2hlYWQgKmxpc3Q7CisJc3RydWN0IGVzMTM3MF9zdGF0ZSAqczsKKworCWZvciAobGlzdCA9IGRldnMubmV4dDsgOyBsaXN0ID0gbGlzdC0+bmV4dCkgeworCQlpZiAobGlzdCA9PSAmZGV2cykKKwkJCXJldHVybiAtRU5PREVWOworCQlzID0gbGlzdF9lbnRyeShsa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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKworI2lmbmRlZiBNT0RVTEUKKworLyogZm9ybWF0IGlzOiBlczEzNzA9bGluZW91dFssbWljYmlhc11dICovCisKK3N0YXRpYyBpbnQgX19pbml0IGVzMTM3MF9zZXR1cChjaGFyICpzdHIpCit7CisJc3RhdGljIHVuc2lnbmVkIF9faW5pdGRhdGEgbnJfZGV2ID0gMDsKKworCWlmIChucl9kZXYgPj0gTlJfREVWSUNFKQorCQlyZXR1cm4gMDsKKworCSh2b2lkKQorCSgoZ2V0X29wdGlvbigmc3RyLCZsaW5lb3V0IFtucl9kZXZdKSA9PSAyKQorCSAmJiBnZXRfb3B0aW9uKCZzdHIsJm1pY2JpYXMgW25yX2Rldl0pCisJKTsKKworCW5yX2RldisrOworCXJldHVybiAxOworfQorCitfX3NldHVwKCJlczEzNzA9IiwgZXMxMzcwX3NldHVwKTsKKworI2VuZGlmIC8qIE1PRFVMRSAqLwpkaWZmIC0tZ2l0IGEvc291bmQvb3NzL2VzMTM3MS5jIGIvc291bmQvb3NzL2VzMTM3MS5jCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmE1MGZkZGEKLS0tIC9kZXYvbnVsbAorKysgYi9zb3VuZC9vc3MvZXMxMzcxLmMKQEAgLTAsMCArMSwzMDk3IEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qCisgKiAgICAgIGVzMTM3MS5jICAtLSAgQ3JlYXRpdmUgRW5zb25pcSBFUzEzNzEuCisgKgorICogICAgICBDb3B5cmlnaHQgKEMpIDE5OTgtMjAwMSwgMjAwMyAgVGhvbWFzIFNhaWxlciAodC5zYWlsZXJAYWx1bW5pLmV0aHouY2gpCisgKgorICogICAgICBUaGlzIHByb2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1LjA2LjE5OTkgICAwLjEyICBGaXggYmFkIGFsbG9jYXRpb24gYnVnLgorICogICAgICAgICAgICAgICAgICAgICAgIFRoYW5rcyB0byBEZXRpIEZsaWVnbCA8ZmxpZWdsQGluLnR1bS5kZT4KKyAqICAgIDI4LjA2LjE5OTkgICAwLjEzICBBZGQgcGNpX3NldF9tYXN0ZXIKKyAqICAgIDAzLjA4LjE5OTkgICAwLjE0ICBhZGFwdCB0byBMaW51cycgbmV3IF9fc2V0dXAvX19pbml0Y2FsbAorICogICAgICAgICAgICAgICAgICAgICAgIGFkZGVkIGtlcm5lbCBjb21tYW5kIGxpbmUgb3B0aW9uICJlczEzNzE9am95c3RpY2thZGRyIgorICogICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZWQgQ09ORklHX1NPVU5EX0VTMTM3MV9KT1lQT1JUX0JPT1Qga2x1ZGdlCisgKiAgICAxMC4wOC4xOTk5ICAgMC4xNSAgKFJlKWFkZGVkIFMvUERJRiBtb2R1bGUgb3B0aW9uIGZvciBjYXJkcyByZXZpc2lvbiA+PSA0LgorICogICAgICAgICAgICAgICAgICAgICAgIEluaXRpYWwgdmVyc2lvbiBieSBEYXZlIFBsYXR0IDxkcGxhdHRAc251bGJ1Zy5tdHZpZXcuY2EudXM+LgorICogICAgICAgICAgICAgICAgICAgICAgIG1vZHVsZV9pbml0L19fc2V0dXAgZml4ZXMKKyAqICAgIDA4LjE2LjE5OTkgICAwLjE2ICBKb2UgQ290ZWxsZXNlIDxqb2VjQGVuc29uaXEuY29tPgorICogICAgICAgICAgICAgICAgICAgICAgIEFkZGVkIGRldGVjdGlvbiBmb3IgRVMxMzcxIHJldmlzaW9uIElEIHNvIHRoYXQgd2UgY2FuCisgKiAgICAgICAgICAgICAgICAgICAgICAgZGV0ZWN0IHRoZSBFUzEzNzMgYW5kIGxhdGVyIHBhcnRzLgorICogICAgICAgICAgICAgICAgICAgICAgIGFkZGVkIEFDOTcgI2RlZmluZXMgZm9yIHJlYWRhYmlsaX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AgIDB4MDAwMDAwMDIgIC8qIERBQzIgaW50IHBlbmRpbmcgKi8KKyNkZWZpbmUgU1RBVF9BREMgICAgICAgIDB4MDAwMDAwMDEgIC8qIEFEQyBpbnQgcGVuZGluZyAqLworCisjZGVmaW5lIFVTVEFUX1JYSU5UICAgICAweDgwICAgICAgICAvKiBVQVJUIHJ4IGludCBwZW5kaW5nICovCisjZGVmaW5lIFVTVEFUX1RYSU5UICAgICAweDA0ICAgICAgICAvKiBVQVJUIHR4IGludCBwZW5kaW5nICovCisjZGVmaW5lIFVTVEFUX1RYUkRZICAgICAweDAyICAgICAgICAvKiBVQVJUIHR4IHJlYWR5ICovCisjZGVmaW5lIFVTVEFUX1JYUkRZICAgICAweDAxICAgICAgICAvKiBVQVJUIHJ4IHJlYWR5ICovCisKKyNkZWZpbmUgVUNUUkxfUlhJTlRFTiAgIDB4ODAgICAgICAgIC8qIDEgPSBlbmFibGUgUlggaW50cyAqLworI2RlZmluZSBVQ1RSTF9UWElOVEVOICAgMHg2MCAgICAgICAgLyogVFggaW50IGVuYWJsZSBmaWVsZCBtYXNrICovCisjZGVmaW5lIFVDVFJMX0VOQV9UWElOVCAweDIwICAgICAgICAvKiBlbmFibGUgVFggaW50ICovCisjZGVmaW5lIFVDVFJMX0NOVFJMICAgICAweDAzICAgICAgICAvKiBjb250cm9sIGZpZWxkICovCisjZGVmaW5lIFVDVFJMX0NOVFJMX1NXUiAweDAzICAgICAgICAvKiBzb2Z0d2FyZSByZXNldCBjb21tYW5kICovCisKKy8qIHNhbXBsZSByYXRlIGNvbnZlcnRlciAqLworI2RlZmluZSBTUkNfT0tTVEFURSAgICAgICAgMQorCisjZGVmaW5lIFNSQ19SQU1BRERSX01BU0sgICAweGZlMDAwMDAwCisjZGVmaW5lIFNSQ19SQU1BRERSX1NISUZUICAyNQorI2RlZmluZSBTUkNfREFDMUZSRUVaRSAgICAgKDFVTCA8PCAyMSkKKyNkZWZpbmUgU1JDX0RBQzJGUkVFWkUgICAgICAoM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PREVfTUlESV9SRUFEICAoRk1PREVfUkVBRCA8PCBGTU9ERV9NSURJX1NISUZUKQorI2RlZmluZSBGTU9ERV9NSURJX1dSSVRFIChGTU9ERV9XUklURSA8PCBGTU9ERV9NSURJX1NISUZUKQorCisjZGVmaW5lIEVTMTM3MV9NT0RVTEVfTkFNRSAiZXMxMzcxIgorI2RlZmluZSBQRlggRVMxMzcxX01PRFVMRV9OQU1FICI6ICIKKworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisKK3N0cnVjdCBlczEzNzFfc3RhdGUgeworCS8qIG1hZ2ljICovCisJdW5zaWduZWQgaW50IG1hZ2ljOworCisJLyogbGlzdCBvZiBlczEzNzEgZGV2aWNlcyAqLworCXN0cnVjdCBsaXN0X2hlYWQgZGV2czsKKworCS8qIHRoZSBjb3JyZXNwb25kaW5nIHBjaV9kZXYgc3RydWN0dXJlICovCisJc3RydWN0IHBjaV9kZXYgKmRldjsKKworCS8qIHNvdW5kY29yZSBzdHVmZiAqLworCWludCBkZXZfYXVkaW87CisJaW50IGRldl9kYWM7CisJaW50IGRldl9taWRpOworCQorCS8qIGhhcmR3YXJlIHJlc291cmNlcyAqLworCXVuc2lnbmVkIGxvbmcgaW87IC8qIGxvbmcgZm9yIFNQQVJDICovCisJdW5zaWduZWQgaW50IGlycTsKKworCS8qIFBDSSBJRCdzICovCisJdTE2IHZlbmRvcjsKKwl1MTYgZGV2aWNlOworICAgICAgICB1OCByZXY7IC8qIHRoZSBjaGlwIHJldmlzaW9uICovCisKKwkvKiBvcHRpb25zICovCisJaW50IHNwZGlmX3ZvbHVtZTsgLyogUy9QRElGIG91dHB1dCBpcyBlbmFibGVkIGlmICE9IC0xICovCisKKyNpZmRlZiBFUzEzNzFfREVCVUcKKyAgICAgICAgLyogZGVidWcgL3Byb2MgZW50cnkgKi8KKwlzdHJ1Y3QgcHJvY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mlvICsgRVMxMzcxX1JFR19TUkNPTlYpOworCisgICAgICAgIC8qIG5vdywgd2FpdCBmb3IgYnVzeSBhbmQgdGhlIGNvcnJlY3QgdGltZSB0byByZWFkICovCisgICAgICAgIHRlbXAgPSB3YWl0X3NyY19yZWFkeSAocyk7CisKKyAgICAgICAgaWYgKCAodGVtcCAmIDB4MDA4NzAwMDBVTCApICE9ICggU1JDX09LU1RBVEUgPDwgMTYgKSl7CisgICAgICAgICAgICAgICAgLyogd2FpdCBmb3IgdGhlIHJpZ2h0IHN0YXRlICovCisgICAgICAgICAgICAgICAgZm9yIChpPTA7IGk8UE9MTF9DT1VOVDsgaSsrKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAgPSBpbmwgKHMtPmlvICsgRVMxMzcxX1JFR19TUkNPTlYpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCAodGVtcCAmIDB4MDA4NzAwMDBVTCApID09ICggU1JDX09LU1RBVEUgPDwgMTYgKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLyogaGlkZSB0aGUgc3RhdGUgYml0cyAqLworICAgICAgICBvdXRsICgob3JpZyAmIFNSQ19DVExNQVNLKSB8IChyZWcgPDwgU1JDX1JBTUFERFJfU0hJRlQpLCBzLT5pbyArIEVTMTM3MV9SRUdfU1JDT05WKTsKKyAgICAgICAgcmV0dXJuIHRlbXA7CisgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAKK30KKworc3RhdGljIHZvaWQgc3JjX3dyaXRlKHN0cnVjdCBlczEzNzFfc3RhdGUgKnMsIHVuc2lnbmVkIHJlZywgdW5zaWduZWQgZGF0YSkKK3sKKyAgICAgIAorCXVuc2lnbmVkIGludCByOworCisJciA9IHdhaXRfc3JjX3JlYWR5KHMpICYgKFNSQ19ESVMgfCBTUkNfRERBQzEgfCBTUkNfRERBQzIgfCB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V9SRUdfU1JDT05WKTsKKworICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMHg4MDsgaSsrKQorICAgICAgICAgICAgICAgIHNyY193cml0ZShzLCBpLCAwKTsKKworICAgICAgICBzcmNfd3JpdGUocywgU1JDUkVHX0RBQzErU1JDUkVHX1RSVU5DX04sIDE2IDw8IDQpOworICAgICAgICBzcmNfd3JpdGUocywgU1JDUkVHX0RBQzErU1JDUkVHX0lOVF9SRUdTLCAxNiA8PCAxMCk7CisgICAgICAgIHNyY193cml0ZShzLCBTUkNSRUdfREFDMitTUkNSRUdfVFJVTkNfTiwgMTYgPDwgNCk7CisgICAgICAgIHNyY193cml0ZShzLCBTUkNSRUdfREFDMitTUkNSRUdfSU5UX1JFR1MsIDE2IDw8IDEwKTsKKyAgICAgICAgc3JjX3dyaXRlKHMsIFNSQ1JFR19WT0xfQURDLCAxIDw8IDEyKTsKKyAgICAgICAgc3JjX3dyaXRlKHMsIFNSQ1JFR19WT0xfQURDKzEsIDEgPDwgMTIpOworICAgICAgICBzcmNfd3JpdGUocywgU1JDUkVHX1ZPTF9EQUMxLCAxIDw8IDEyKTsKKyAgICAgICAgc3JjX3dyaXRlKHMsIFNSQ1JFR19WT0xfREFDMSsxLCAxIDw8IDEyKTsKKyAgICAgICAgc3JjX3dyaXRlKHMsIFNSQ1JFR19WT0xfREFDMiwgMSA8PCAxMik7CisgICAgICAgIHNyY193cml0ZShzLCBTUkNSRUdfVk9MX0RBQzIrMSwgMSA8PCAxMik7CisgICAgICAgIHNldF9hZGNfcmF0ZShzLCAyMjA1MCk7CisgICAgICAgIHNldF9kYWMxX3JhdGUocywgMjIwNTApOworICAgICAgICBzZXRfZGFjMl9yYXRlKHMsIDIyMDUwKTsKKworICAgICAgICAvKiBXQVJOSU5HOgorICAgICAgICAgKiBlbmFibGluZyB0aGUgc2FtcGxlIHJhdGUgY29udmVydGVyIHdpdGhvdXQgcHJvcGVybHkgcHJvZ3JhbW1pbmcKKyAgICAgICAgICogaXRzI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19EREFDMiB8IFNSQ19EQURDKSkgfCAweDAwMDEwMDAwLAorCSAgICAgcy0+aW8rRVMxMzcxX1JFR19TUkNPTlYpOworCisgICAgICAgIC8qIHdhaXQgZm9yIG5vdCBidXN5IChzdGF0ZSAwKSBmaXJzdCB0byBhdm9pZAorICAgICAgICAgICB0cmFuc2l0aW9uIHN0YXRlcyAqLworICAgICAgICBmb3IgKHQ9MDsgdDxQT0xMX0NPVU5UOyB0KyspeworICAgICAgICAgICAgICAgIGlmKChpbmwocy0+aW8rRVMxMzcxX1JFR19TUkNPTlYpICYgMHgwMDg3MDAwMCkgPT0wICkKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgdWRlbGF5KDEpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICAvKiB3YWl0IGZvciBhIFNBRkUgdGltZSB0byB3cml0ZSBhZGRyL2RhdGEgYW5kIHRoZW4gZG8gaXQsIGRhbW1pdCAqLworICAgICAgICBmb3IgKHQ9MDsgdDxQT0xMX0NPVU5UOyB0KyspeworICAgICAgICAgICAgICAgIGlmKChpbmwocy0+aW8rRVMxMzcxX1JFR19TUkNPTlYpICYgMHgwMDg3MDAwMCkgPT0weDAwMDEwMDAwKQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB1ZGVsYXkoMSk7CisgICAgICAgIH0KKworCW91dGwoKChhZGRyIDw8IENPREVDX1BPQUREX1NISUZUKSAmIENPREVDX1BPQUREX01BU0spIHwKKwkgICAgICgoZGF0YSA8PCBDT0RFQ19QT0RBVF9TSElGVCkgJiBDT0RFQ19QT0RBVF9NQVNLKSwgcy0+aW8rRVMxMzcxX1JFR19DT0RFQyk7CisKKwkvKiByZXN0b3JlIFNSQyByZWcgKi8KKwl3YWl0X3NyY19yZWFkeShzKTsKKwlvdXRsKHgsIHMtPmlvK0VTMTM3MV9SRUdfU1JDT05WKTsKKwlzcGluX3VubG9ja19pcnFyZXN0b3JlKCZzLT5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dWRlbGF5KDEpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICAvKiB3YWl0IGZvciBhIFNBRkUgdGltZSB0byB3cml0ZSBhZGRyL2RhdGEgYW5kIHRoZW4gZG8gaXQsIGRhbW1pdCAqLworICAgICAgICBmb3IgKHQ9MDsgdDxQT0xMX0NPVU5UOyB0KyspeworICAgICAgICAgICAgICAgIGlmKChpbmwocy0+aW8rRVMxMzcxX1JFR19TUkNPTlYpICYgMHgwMDg3MDAwMCkgPT0weDAwMDEwMDAwKQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB1ZGVsYXkoMSk7CisgICAgICAgIH0KKworCW91dGwoKChhZGRyIDw8IENPREVDX1BPQUREX1NISUZUKSAmIENPREVDX1BPQUREX01BU0spIHwgQ09ERUNfUE9SRCwgcy0+aW8rRVMxMzcxX1JFR19DT0RFQyk7CisJLyogcmVzdG9yZSBTUkMgcmVnICovCisJd2FpdF9zcmNfcmVhZHkocyk7CisJb3V0bCh4LCBzLT5pbytFUzEzNzFfUkVHX1NSQ09OVik7CisKKyAgICAgICAgLyogd2FpdCBmb3IgV0lQIGFnYWluICovCisJZm9yICh0ID0gMDsgdCA8IDB4MTAwMDsgdCsrKQorCQlpZiAoIShpbmwocy0+aW8rRVMxMzcxX1JFR19DT0RFQykgJiBDT0RFQ19XSVApKQorCQkJYnJlYWs7CisgICAgICAgIAorCS8qIG5vdyB3YWl0IGZvciB0aGUgc3RpbmtpbicgZGF0YSAoUkRZKSAqLworCWZvciAodCA9IDA7IHQgPCBQT0xMX0NPVU5UOyB0KyspCisJCWlmICgoeCA9IGlubChzLT5pbytFUzEzNzFfUkVHX0NPREVDKSkgJiBDT0RFQ19SRFkpCisJCQlicmVhazsKKyAgICAgICAgCisJc3Bpbl91bmxvY2tfaXJxcmVzdG9yZSgmcy0+bG9jaywgZmxhZ3MpOworCXJldHVybiAoKHggJiBDT0RFQ19QSURBVF9NQVNLKSA+PiBDT0RFQ19QSURBVF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IGNvdW50LCB0bW87CisJCisJaWYgKHMtPmRtYV9kYWMxLm1hcHBlZCB8fCAhcy0+ZG1hX2RhYzEucmVhZHkpCisJCXJldHVybiAwOworICAgICAgICBhZGRfd2FpdF9xdWV1ZSgmcy0+ZG1hX2RhYzEud2FpdCwgJndhaXQpOworICAgICAgICBmb3IgKDs7KSB7CisJCV9fc2V0X2N1cnJlbnRfc3RhdGUoVEFTS19JTlRFUlJVUFRJQkxFKTsKKyAgICAgICAgICAgICAgICBzcGluX2xvY2tfaXJxc2F2ZSgmcy0+bG9jaywgZmxhZ3MpOworCQljb3VudCA9IHMtPmRtYV9kYWMxLmNvdW50OworICAgICAgICAgICAgICAgIHNwaW5fdW5sb2NrX2lycXJlc3RvcmUoJnMtPmxvY2ssIGZsYWdzKTsKKwkJaWYgKGNvdW50IDw9IDApCisJCQlicmVhazsKKwkJaWYgKHNpZ25hbF9wZW5kaW5nKGN1cnJlbnQpKQorICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgaWYgKG5vbmJsb2NrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVfd2FpdF9xdWV1ZSgmcy0+ZG1hX2RhYzEud2FpdCwgJndhaXQpOworICAgICAgICAgICAgICAgICAgICAgICAgc2V0X2N1cnJlbnRfc3RhdGUoVEFTS19SVU5OSU5HKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAtRUJVU1k7CisgICAgICAgICAgICAgICAgfQorCQl0bW8gPSAzICogSFogKiAoY291bnQgKyBzLT5kbWFfZGFjMS5mcmFnc2l6ZSkgLyAyIC8gcy0+ZGFjMXJhdGU7CisJCXRtbyA+Pj0gc2FtcGxlX3NoaWZ0WyhzLT5zY3RybCAmIFNDVFJMX1AxRk1UKSA+PiBTQ1RSTF9TSF9QMUZNVF07CisJCWlmICghc2NoZWR1bGVfdGltZW91dCh0bW8gKyAxKSkKKwkJCURCRyhwcmludGsoS0VSTl9ERUJVRyBQRlggImRhYzEgZG1hIHRpbWVkIG91dD8/XG4iKTspCisgICAgICAgIH0KKyAgICAgICAgcmVtb3ZlX3dhaXRfcXVldWUoJnMtPmRtYV9kYWMxLndhaXQsICZ3YWl0KTsKKyAgICAgICAgc2V0X2N1cnJlbnRfc3RhdGUoVEFTS19SVU5OSU5HKTsKKyAgICAgICAgaWYgKHNpZ25hbF9wZW5kaW5nKGN1cnJlbnQpKQorICAgICAgICAgICAgICAgIHJldHVybiAtRVJFU1RBUlRTWVM7CisgICAgICAgIHJldHVybiAwOworfQorCitzdGF0aWMgaW50IGRyYWluX2RhYzIoc3RydWN0IGVzMTM3MV9zdGF0ZSAqcywgaW50IG5vbmJsb2NrKQoreworCURFQ0xBUkVfV0FJVFFVRVVFKHdhaXQsIGN1cnJlbnQpOworCXVuc2lnbmVkIGxvbmcgZmxhZ3M7CisJaW50IGNvdW50LCB0bW87CisKKwlpZiAocy0+ZG1hX2RhYzIubWFwcGVkIHx8ICFzLT5kbWFfZGFjMi5yZWFkeSkKKwkJcmV0dXJuIDA7CisgICAgICAgIGFkZF93YWl0X3F1ZXVlKCZzLT5kbWFfZGFjMi53YWl0LCAmd2FpdCk7CisgICAgICAgIGZvciAoOzspIHsKKwkJX19zZXRfY3VycmVudF9zdGF0ZShUQVNLX1VOSU5URVJSVVBUSUJMRSk7CisgICAgICAgICAgICAgICAgc3Bpbl9sb2NrX2lycXNhdmUoJnMtPmxvY2ssIGZsYWdzKTsKKwkJY291bnQgPSBzLT5kbWFfZGFjMi5jb3VudDsKKyAgICAgICAgICAgICAgICBzcGluX3VubG9ja19pcnFyZXN0b3JlKCZzLT5sb2NrLCBmbGFncyk7CisJCWlmIChjb3VudCA8PSAwKQorCQkJYnJlYWs7CisJCWlmIChzaWduYWxfcGVuZGluZyhjdXJyZW50KSkKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGlmIChub25ibG9jaykgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV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aXplb2YoYWJpbmZvKSkgPyAtRUZBVUxUIDogMDsKKworICAgICAgICBjYXNlIFNORENUTF9EU1BfTk9OQkxPQ0s6CisgICAgICAgICAgICAgICAgZmlsZS0+Zl9mbGFncyB8PSBPX05PTkJMT0NLOworICAgICAgICAgICAgICAgIHJldHVybiAwOworCisgICAgICAgIGNhc2UgU05EQ1RMX0RTUF9HRVRPREVMQVk6CisJCWlmICghcy0+ZG1hX2RhYzEucmVhZHkgJiYgKHZhbCA9IHByb2dfZG1hYnVmX2RhYzEocykpICE9IDApCisJCQlyZXR1cm4gdmFsOworCQlzcGluX2xvY2tfaXJxc2F2ZSgmcy0+bG9jaywgZmxhZ3MpOworCQllczEzNzFfdXBkYXRlX3B0cihzKTsKKyAgICAgICAgICAgICAgICBjb3VudCA9IHMtPmRtYV9kYWMxLmNvdW50OworCQlzcGluX3VubG9ja19pcnFyZXN0b3JlKCZzLT5sb2NrLCBmbGFncyk7CisJCWlmIChjb3VudCA8IDApCisJCQljb3VudCA9IDA7CisJCXJldHVybiBwdXRfdXNlcihjb3VudCwgcCk7CisKKyAgICAgICAgY2FzZSBTTkRDVExfRFNQX0dFVE9QVFI6CisJCWlmICghcy0+ZG1hX2RhYzEucmVhZHkgJiYgKHZhbCA9IHByb2dfZG1hYnVmX2RhYzEocykpICE9IDApCisJCQlyZXR1cm4gdmFsOworCQlzcGluX2xvY2tfaXJxc2F2ZSgmcy0+bG9jaywgZmxhZ3MpOworCQllczEzNzFfdXBkYXRlX3B0cihzKTsKKyAgICAgICAgICAgICAgICBjaW5mby5ieXRlcyA9IHMtPmRtYV9kYWMxLnRvdGFsX2J5dGVzOworCQljb3VudCA9IHMtPmRtYV9kYWMxLmNvdW50OworCQlpZiAoY291bnQgPCAwKQorCQkJY291bnQgPSAwOworICAgICAgICAgICAgICAgIGNpbmZvLmJsb2NrcyA9IGNvdW50ID4+IHMtPmRtYV9kYWMxLmZyYWdzaGlmdDsKKyAgICAgICAgICAgICAgICBjaW5mby5wdHI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FKHMpOworCWlmICghYWNjZXNzX29rKFZFUklGWV9SRUFELCBidWZmZXIsIGNvdW50KSkKKwkJcmV0dXJuIC1FRkFVTFQ7CisJaWYgKGNvdW50ID09IDApCisJCXJldHVybiAwOworCXJldCA9IDA7CisgICAgICAgIGFkZF93YWl0X3F1ZXVlKCZzLT5taWRpLm93YWl0LCAmd2FpdCk7CisJd2hpbGUgKGNvdW50ID4gMCkgeworCQlzcGluX2xvY2tfaXJxc2F2ZSgmcy0+bG9jaywgZmxhZ3MpOworCQlwdHIgPSBzLT5taWRpLm93cjsKKwkJY250ID0gTUlESU9VVEJVRiAtIHB0cjsKKwkJaWYgKHMtPm1pZGkub2NudCArIGNudCA+IE1JRElPVVRCVUYpCisJCQljbnQgPSBNSURJT1VUQlVGIC0gcy0+bWlkaS5vY250OworCQlpZiAoY250IDw9IDApIHsKKwkJCV9fc2V0X2N1cnJlbnRfc3RhdGUoVEFTS19JTlRFUlJVUFRJQkxFKTsKKwkJCWVzMTM3MV9oYW5kbGVfbWlkaShzKTsKKwkJfQorCQlzcGluX3VubG9ja19pcnFyZXN0b3JlKCZzLT5sb2NrLCBmbGFncyk7CisJCWlmIChjbnQgPiBjb3VudCkKKwkJCWNudCA9IGNvdW50OworCQlpZiAoY250IDw9IDApIHsKKwkJCWlmIChmaWxlLT5mX2ZsYWdzICYgT19OT05CTE9DSykgeworCQkJCWlmICghcmV0KQorCQkJCQlyZXQgPSAtRUFHQUlOOworCQkJCWJyZWFrOworCQkJfQorCQkJc2NoZWR1bGUoKTsKKwkJCWlmIChzaWduYWxfcGVuZGluZyhjdXJyZW50KSkgeworCQkJCWlmICghcmV0KQorCQkJCQlyZXQgPSAtRVJFU1RBUlRTWVM7CisJCQkJYnJlYWs7CisJCQl9CisJCQljb250aW51ZTsKKwkJfQorCQlpZiAoY29weV9mcm9tX3VzZXIocy0+bWlkaS5vYnVmICsgcHRyLCBidWZmZXIsIGNudCkpIHsKKwkJCWlmICghcmV0KQorCQkJCXJldCA9I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xMzcxX3N0YXRlLCBkZXZzKTsKKyAgICAgICAgLyogcHJpbnQgb3V0IGhlYWRlciAqLworICAgICAgICBsZW4gKz0gc3ByaW50ZihidWYgKyBsZW4sICJcdFx0Q3JlYXRpdmUgRVMxMzd4IERlYnVnIER1bXAtby1tYXRpY1xuIik7CisKKyAgICAgICAgLyogcHJpbnQgb3V0IENPREVDIHN0YXRlICovCisgICAgICAgIGxlbiArPSBzcHJpbnRmIChidWYgKyBsZW4sICJBQzk3IENPREVDIHN0YXRlXG4iKTsKKwlmb3IgKGNudD0wOyBjbnQgPD0gMHg3ZTsgY250ID0gY250ICsyKQorICAgICAgICAgICAgICAgIGxlbis9IHNwcmludGYgKGJ1ZiArIGxlbiwgInJlZzoweCUwMnggIHZhbDoweCUwNHhcbiIsIGNudCwgcmRjb2RlYyhzLT5jb2RlYywgY250KSk7CisKKyAgICAgICAgaWYgKGZwb3MgPj1sZW4peworICAgICAgICAgICAgICAgICpzdGFydCA9IGJ1ZjsKKyAgICAgICAgICAgICAgICAqZW9mID0xOworICAgICAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICB9CisgICAgICAgICpzdGFydCA9IGJ1ZiArIGZwb3M7CisgICAgICAgIGlmICgobGVuIC09IGZwb3MpID4gbGVuZ3RoKQorICAgICAgICAgICAgICAgIHJldHVybiBsZW5ndGg7CisgICAgICAgICplb2YgPTE7CisgICAgICAgIHJldHVybiBsZW47CisKK30KKyNlbmRpZiAvKiBFUzEzNzFfREVCVUcgKi8KKworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisKKy8qIG1heGltdW0gbnVtYmVyIG9mIGRldmljZXM7IG9ubHkgdXNlZCBmb3IgY29tbWFuZCBsaW5lIHBhcmFtcyAqLworI2RlZmluZSBOUl9ERVZJQ0UgNQorCitzdGF0aWMgaW50IHNwZGlmW05SX0RFVklDRV07CitzdG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gL2Rldi9taXhlciAgc3RhbmRhcmQgL2Rldi9taXhlciBkZXZpY2UsIChtb3N0bHkpIE9TUyBjb21wYXRpYmxlCisgKiAgL2Rldi9taWRpICAgc2ltcGxlIE1JREkgVUFSVCBpbnRlcmZhY2UsIG5vIGlvY3RsCisgKgorICogIFJldmlzaW9uIGhpc3RvcnkKKyAqICAgIDEwLjExLjE5OTggICAwLjEgICBJbml0aWFsIHJlbGVhc2UgKHdpdGhvdXQgYW55IGhhcmR3YXJlKQorICogICAgMjIuMDMuMTk5OSAgIDAuMiAgIGNpbmZvLmJsb2NrcyBzaG91bGQgYmUgcmVzZXQgYWZ0ZXIgR0VUeFBUUiBpb2N0bC4KKyAqICAgICAgICAgICAgICAgICAgICAgICByZXBvcnRlZCBieSBKb2hhbiBNYWVzIDxqb21hQHRlbGluZHVzLmJlPgorICogICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBFQUdBSU4gaW5zdGVhZCBvZiBFQlVTWSB3aGVuIE9fTk9OQkxPQ0sKKyAqICAgICAgICAgICAgICAgICAgICAgICByZWFkL3dyaXRlIGNhbm5vdCBiZSBleGVjdXRlZAorICogICAgMDcuMDQuMTk5OSAgIDAuMyAgIGltcGxlbWVudGVkIHRoZSBmb2xsb3dpbmcgaW9jdGwnczogU09VTkRfUENNX1JFQURfUkFURSwgCisgKiAgICAgICAgICAgICAgICAgICAgICAgU09VTkRfUENNX1JFQURfQ0hBTk5FTFMsIFNPVU5EX1BDTV9SRUFEX0JJVFM7IAorICogICAgICAgICAgICAgICAgICAgICAgIEFscGhhIGZpeGVzIHJlcG9ydGVkIGJ5IFBldGVyIEpvbmVzIDxwam9uZXNAcmVkaGF0LmNvbT4KKyAqICAgIDE1LjA2LjE5OTkgICAwLjQgICBGaXggYmFkIGFsbG9jYXRpb24gYnVnLgorICogICAgICAgICAgICAgICAgICAgICAgIFRoYW5rcyB0byBEZXRpIEZsaWVnbCA8ZmxpZWdsQGluLnR1bS5kZT4KKyAqICAgIDI4LjA2LjE5OTkgICAwLjUgICBBZGQgcGNpX3NldF9tYXN0ZXIKKyAqICAgIDEyLjA4LjE5OTkgICAwLjYgICBGaXggTUlESSBVQVJUIGNyYXNoaW5nIHRoZSBkcml2ZXIKKyAqICAgICAgICAgICAgICAgICAgICAgICBDaGFuZ2VkIG1peGVyIHNlbWFudGljcyBmcm9tIE9TUyBkb2N1bWVudGVkCisgKiAgICAgICAgICAgICAgICAgICAgICAgYmVoYXZpb3VyIHRvIE9TUyAiY29kZSBiZWhhdmlvdXIiLgorICogICAgICAgICAgICAgICAgICAgICAgIFJlY29yZGluZyBtaWdodCBhY3R1YWxseSB3b3JrIG5vdy4KKyAqICAgICAgICAgICAgICAgICAgICAgICBUaGUgcmVhbCBERE1BIGNvbnRyb2xsZXIgYWRkcmVzcyByZWdpc3RlciBpcyBhdCBQQ0kgY29uZmlnCisgKiAgICAgICAgICAgICAgICAgICAgICAgMHg2MCwgd2hpbGUgdGhlIHJlZ2lzdGVyIGF0IDB4MTggaXMgdXNlZCBhcyBhIHBsYWNlaG9sZGVyCisgKiAgICAgICAgICAgICAgICAgICAgICAgcmVnaXN0ZXIgZm9yIEJJT1MgYWRkcmVzcyBhbGxvY2F0aW9uLiBUaGlzIHJlZ2lzdGVyCisgKiAgICAgICAgICAgICAgICAgICAgICAgaXMgc3VwcG9zZWQgdG8gYmUgY29waWVkIGludG8gMHg2MCwgYWNjb3JkaW5nCisgKiAgICAgICAgICAgICAgICAgICAgICAgdG8gdGhlIFNvbG8xIGRhdGFzaGVldC4gV2hlbiBJIGRvIHRoYXQsIEkgY2FuIGFjY2VzcworICogICAgICAgICAgICAgICAgICAgICAgIHRoZSBERE1BIHJlZ2lzdGVycyBleGNlcHQgdGhlIG1hc2sgYml0LCB3aGljaAorICogICAgICAgICAgICAgICAgICAgICAgIGlzIHN0dWNrIGF0IDEuIFdoZW4gSSBjb3B5IHRoZSBjb250ZW50cyBvZiAweDE4ICsweDEwCisgKiAgICAgICAgICAgICAgICAgICAgICAgdG8gdGhlIERETUEgYmFzZSByZWdpc3RlciwgZXZlcnl0aGluZyBzZWVtcyB0byB3b3JrLgorICogICAgICAgICAgICAgICAgICAgICAgIFRoZSBmdW4gcGFydCBpcyB0aGF0IHRoZSBXaW5kb3dzIFNvbG8xIGRyaXZlciBkb2Vzbid0CisgKiAgICAgICAgICAgICAgICAgICAgICAgc2VlbSB0byBkbyB0aGVzZSB0cmlja3MuCisgKiAgICAgICAgICAgICAgICAgICAgICAgQnVncyByZW1haW5pbmc6IHBsb3BzIGFuZCBjbGlja3Mgd2hlbiBzdGFydGluZy9zdG9wcGluZyBwbGF5YmFjaworICogICAgMzEuMDguMTk5OSAgIDAuNyAgIGFkZCBzcGluX2xvY2tfaW5pdAorICogICAgICAgICAgICAgICAgICAgICAgIHJlcGxhY2VkIGN1cnJlbnQtPnN0YXRlID0geCB3aXRoIHNldF9jdXJyZW50X3N0YXRlKHgpCisgKiAgICAwMy4wOS4xOTk5ICAgMC44ICAgY2hhbmdlIHJlYWQgc2VtYW50aWNzIGZvciBNSURJIHRvIG1hdGNoCisgKiAgICAgICAgICAgICAgICAgICAgICAgT1NTIG1vcmUgY2xvc2VseTsgcmVtb3ZlIHBvc3NpYmxlIHdha2V1cCByYWNlCisgKiAgICAwNy4xMC4xOTk5ICAgMC45ICAgRml4IGluaXRpYWxpemF0aW9uOyBjb21wbGFpbiBpZiBzZXF1ZW5jZXIgd3JpdGVzIHRpbWUgb3V0CisgKiAgICAgICAgICAgICAgICAgICAgICAgUmV2aXNlZCByZXNvdXJjZSBncmFiYmluZyBmb3IgdGhlIEZNIHN5bnRoZXNpemVyCisgKiAgICAyOC4xMC4xOTk5ICAgMC4xMCAgTW9yZSB3YWl0cXVldWUgcmFjZXMgZml4ZWQKKyAqICAgIDA5LjEyLjE5OTkgICAwLjExICBXb3JrIGFyb3VuZCBzdHVwaWQgQWxwaGEgcG9ydCBpc3N1ZSAodmlydF90b19idXMoa21hbGxvYyhHRlBfRE1BKSkgPiAxNk0pC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zMS4wMS4yMDAxICAgMC4xOCAgUmVnaXN0ZXIvVW5yZWdpc3RlciBnYW1lcG9ydCwgb3JpZ2luYWwgcGF0Y2ggZnJvbQorICogICAgICAgICAgICAgICAgICAgICAgIE5hdGhhbmllbCBEYXcgPGRhd0Bjcy5jbXUuZWR1PgorICogICAgICAgICAgICAgICAgICAgICAgIEZpeCBTRVRUUklHR0VSIG5vbiBPU1MgQVBJIGNvbmZvcm1pdHkKKyAqICAgIDEwLjAzLjIwMDEgICAgICAgICBwcm92aWRlIGFicyBmdW5jdGlvbiwgcHJldmVudCBwaWNraW5nIHVwIGEgYm9ndXMga2VybmVsIG1hY3JvCisgKiAgICAgICAgICAgICAgICAgICAgICAgZm9yIGFicy4gQnVnIHJlcG9ydCBieSBBbmRyZXcgTW9ydG9uIDxhbmRyZXdtQHVvdy5lZHUuYXU+CisgKiAgICAxNS4wNS4yMDAxICAgICAgICAgcGNpX2VuYWJsZV9kZXZpY2UgbW92ZWQsIHJldHVybiB2YWx1ZXMgaW4gcHJvYmUgY2xlYW5lZAorICogICAgICAgICAgICAgICAgICAgICAgIHVwLiBNYXJjdXMgTWVpc3NuZXIgPG1tQGNhbGRlcmEuZGU+CisgKiAgICAyMi4wNS4yMDAxICAgMC4xOSAgbW9yZSBjbGVhbnVwcywgY2hhbmdlZCBQTSB0byBQQ0kgMi40IHN0eWxlLCBnb3QgcmlkCisgKiAgICAgICAgICAgICAgICAgICAgICAgb2YgZ2xvYmFsIGxpc3Qgb2YgZGV2aWNlcywgdXNpbmcgcGNpIGRldmljZSBkYXRhLgorICogICAgICAgICAgICAgICAgICAgICAgIE1hcmN1cyBNZWlzc25lciA8bW1AY2FsZGVyYS5kZT4KKyAqICAgIDAzLjAxLjIwMDMgICAwLjIwICBvcGVuX21vZGUgZml4ZXMgZnJvbSBHZW9yZyBBY2hlciA8YWNoZXJAaW4udHVtLmRlPgorICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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URfRVNTCisjZGVmaW5lIFBDSV9WRU5ET1JfSURfRVNTICAgICAgICAgMHgxMjVkCisjZW5kaWYKKyNpZm5kZWYgUENJX0RFVklDRV9JRF9FU1NfU09MTzEKKyNkZWZpbmUgUENJX0RFVklDRV9JRF9FU1NfU09MTzEgICAweDE5NjkKKyNlbmRpZgorCisjZGVmaW5lIFNPTE8xX01BR0lDICAoKFBDSV9WRU5ET1JfSURfRVNTPDwxNil8UENJX0RFVklDRV9JRF9FU1NfU09MTzEpCisKKyNkZWZpbmUgRERNQUJBU0VfT0ZGU0VUICAgICAgICAgICAwICAgIC8qIGNoaXAgYnVnIHdvcmthcm91bmQga2x1ZGdlICovCisjZGVmaW5lIERETUFCQVNFX0VYVEVOVCAgICAgICAgICAgMTYKKworI2RlZmluZSBJT0JBU0VfRVhURU5UICAgICAgICAgICAgIDE2CisjZGVmaW5lIFNCQkFTRV9FWFRFTlQgICAgICAgICAgICAgMTYKKyNkZWZpbmUgVkNCQVNFX0VYVEVOVCAgICAgICAgICAgICAoRERNQUJBU0VfRVhURU5UK0RETUFCQVNFX09GRlNFVCkKKyNkZWZpbmUgTVBVQkFTRV9FWFRFTlQgICAgICAgICAgICA0CisjZGVmaW5lIEdQQkFTRV9FWFRFTlQgICAgICAgICAgICAgNAorI2RlZmluZSBHQU1FUE9SVF9FWFRFTlQJCSAgNAorCisjZGVmaW5lIEZNU1lOVEhfRVhURU5UICAgICAgICAgICAgNAorCisvKiBNSURJIGJ1ZmZlciBzaXplcyAqLworCisjZGVmaW5lIE1JRElJTkJVRiAgMjU2CisjZGVmaW5lIE1JRElPVVRCVUYgMjU2CisKKyNkZWZpbmUgRk1PREVfTUlESV9TSElGVCAzCisjZGVmaW5lIEZNT0RFX01JRElfUkVBRCAgKEZNT0RFX1JFQUQgPDwgRk1PREVfTUlESV9TSElGVCkKKyNkZWZpbmUgRk1PREVfTUlESV9XUklURSAoRk1PREVfV1JJVEUgPDwgRk1PREVfTUlESV9TSElGVCkKKworI2RlZ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ZltNSURJSU5CVUZdOworCQl1bnNpZ25lZCBjaGFyIG9idWZbTUlESU9VVEJVRl07CisJfSBtaWRpOworCisJc3RydWN0IGdhbWVwb3J0ICpnYW1lcG9ydDsKK307CisKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworCitzdGF0aWMgaW5saW5lIHZvaWQgd3JpdGVfc2VxKHN0cnVjdCBzb2xvMV9zdGF0ZSAqcywgdW5zaWduZWQgY2hhciBkYXRhKQoreworICAgICAgICBpbnQgaTsKKwl1bnNpZ25lZCBsb25nIGZsYWdzOworCisJLyogdGhlIGxvY2FsX2lycV9zYXZlIHN0dW50IGlzIHRvIHNlbmQgdGhlIGRhdGEgd2l0aGluIHRoZSBjb21tYW5kIHdpbmRvdyAqLworICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMHhmZmZmOyBpKyspIHsKKwkJbG9jYWxfaXJxX3NhdmUoZmxhZ3MpOworICAgICAgICAgICAgICAgIGlmICghKGluYihzLT5zYmJhc2UrMHhjKSAmIDB4ODApKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBvdXRiKGRhdGEsIHMtPnNiYmFzZSsweGMpOworCQkJbG9jYWxfaXJxX3Jlc3RvcmUoZmxhZ3MpOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKwkJbG9jYWxfaXJxX3Jlc3RvcmUoZmxhZ3MpOworCX0KKwlwcmludGsoS0VSTl9FUlIgImVzc3NvbG8xOiB3cml0ZV9zZXEgdGltZW91dFxuIik7CisJb3V0YihkYXRhLCBzLT5zYmJhc2UrMHhjKTsKK30KKworc3RhdGljIGlubGluZSBpbnQgcmVhZF9zZXEoc3RydWN0IHNvbG8xX3N0YXRlICpzLCB1bnNpZ25lZCBjaGFyICpkYXRhKQoreworICAgICAgICBpbnQgaTsKKworICAgICAgICBpZiAoIWRhdGEpCisgICAgICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgIGZvciAoaSA9IDA7IGkgPCAweGZmZmY7IGkrKykKKyAgICAgICAgICAgICAgICBpZiAoaW5iKHMtPnNiYmFzZSsweGUpICYgMHg4MCkgeworICAgICAgICAgICAgICAgICAgICAgICAgKmRhdGEgPSBpbmIocy0+c2JiYXNlKzB4YSk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMTsKKyAgICAgICAgICAgICAgICB9CisJcHJpbnRrKEtFUk5fRVJSICJlc3Nzb2xvMTogcmVhZF9zZXEgdGltZW91dFxuIik7CisgICAgICAgIHJldHVybiAwOworfQorCitzdGF0aWMgaW5saW5lIGludCByZXNldF9jdHJsKHN0cnVjdCBzb2xvMV9zdGF0ZSAqcykKK3sKKyAgICAgICAgaW50IGk7CisKKyAgICAgICAgb3V0YigzLCBzLT5zYmJhc2UrNik7IC8qIGNsZWFyIHNlcXVlbmNlciBhbmQgRklGTyAqLworICAgICAgICB1ZGVsYXkoMTApOworICAgICAgICBvdXRiKDAsIHMtPnNiYmFzZSs2KTsKKyAgICAgICAgZm9yIChpID0gMDsgaSA8IDB4ZmZmZjsgaSsrKQorICAgICAgICAgICAgICAgIGlmIChpbmIocy0+c2JiYXNlKzB4ZSkgJiAweDgwKQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGluYihzLT5zYmJhc2UrMHhhKSA9PSAweGFhKSB7CisJCQkJd3JpdGVfc2VxKHMsIDB4YzYpOyAvKiBlbnRlciBlbmhhbmNlZCBtb2RlICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAxOworCQkJfQorICAgICAgICByZXR1cm4gMDsKK30KKworc3RhdGljIHZvaWQgd3JpdGVfY3RybChzdHJ1Y3Qgc29sbzFfc3RhdGUgKnMsIHVuc2lnbmVkIGNoYXIgcmVnLCB1bnNpZ25lZCBjaGFyIGRhdGEpCit7CisJd3JpdGVfc2VxKHMsIHJlZyk7C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AgICBcCisoeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwlpZiAoIShzKSB8fCAocyktPm1hZ2ljICE9IFNPTE8xX01BR0lDKSB7IFwKKwkJcHJpbnRrKGludmFsaWRfbWFnaWMpOyAgICAgICAgICAgIFwKKwkJcmV0dXJuIC1FTlhJTzsgICAgICAgICAgICAgICAgICAgIFwKKwl9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCit9KQorCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKworc3RhdGljIGludCBtaXhlcl9pb2N0bChzdHJ1Y3Qgc29sbzFfc3RhdGUgKnMsIHVuc2lnbmVkIGludCBjbWQsIHVuc2lnbmVkIGxvbmcgYXJnKQoreworCXN0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbWl4ZXJfc3JjWzhdID0geworCQlTT1VORF9NQVNLX01JQywgU09VTkRfTUFTS19NSUMsIFNPVU5EX01BU0tfQ0QsIFNPVU5EX01BU0tfVk9MVU1FLAorCQlTT1VORF9NQVNLX01JQywgMCwgU09VTkRfTUFTS19MSU5FLCAwCisJfTsKKwlzdGF0aWMgY29uc3QgdW5zaWduZWQgY2hhciBtaXh0YWJsZTFbU09VTkRfTUlYRVJfTlJERVZJQ0VTXSA9IHsKKwkJW1NPVU5EX01JWEVSX1BDTV0gICAgID0gMSwgICAvKiB2b2ljZSAqLworCQlbU09VTkRfTUlYRVJfU1lOVEhdICAgPSAyLCAgIC8qIEZNICovCisJCVtTT1VORF9NSVhFUl9DRF0gICAgICA9IDMsICAgLyogQ0QgKi8KKwkJW1NPVU5EX01JWEVSX0xJTkVdICAgID0gNCwgICAvKiBMaW5lICovCisJCVtTT1VORF9NSVhFUl9MSU5FMV0gICA9IDUsICAgLyogQVVYICovCisJCVtTT1VORF9NSV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NfTlIoY21kKSkgeworCWNhc2UgU09VTkRfTUlYRVJfUkVDU1JDOiAvKiBBcmcgY29udGFpbnMgYSBiaXQgZm9yIGVhY2ggcmVjb3JkaW5nIHNvdXJjZSAqLworI2lmIDAKKwkgICAgICAgIHsKKwkJCXN0YXRpYyBjb25zdCB1bnNpZ25lZCBjaGFyIHJlZ3NbXSA9IHsKKwkJCQkweDFjLCAweDFhLCAweDM2LCAweDM4LCAweDNhLCAweDNjLCAweDNlLCAweDYwLCAweDYyLCAweDZkLCAweDdjCisJCQl9OworCQkJaW50IGk7CisJCQkKKwkJCWZvciAoaSA9IDA7IGkgPCBzaXplb2YocmVncyk7IGkrKykKKwkJCQlwcmludGsoS0VSTl9ERUJVRyAic29sbzE6IG1peGVyIHJlZyAweCUwMng6IDB4JTAyeFxuIiwKKwkJCQkgICAgICAgcmVnc1tpXSwgcmVhZF9taXhlcihzLCByZWdzW2ldKSk7CisJCQlwcmludGsoS0VSTl9ERUJVRyAic29sbzE6IGN0cmwgcmVnIDB4JTAyeDogMHglMDJ4XG4iLAorCQkJICAgICAgIDB4YjQsIHJlYWRfY3RybChzLCAweGI0KSk7CisJCX0KKyNlbmRpZgorCSAgICAgICAgaWYgKGdldF91c2VyKHZhbCwgcCkpCisJCQlyZXR1cm4gLUVGQVVMVDsKKyAgICAgICAgICAgICAgICBpID0gaHdlaWdodDMyKHZhbCk7CisgICAgICAgICAgICAgICAgaWYgKGkgPT0gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKGkgPiAxKSAKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbCAmPSB+bWl4ZXJfc3JjW3JlYWRfbWl4ZXIocywgMHgxYykgJiA3XTsKKwkJZm9yIChpID0gMDsgaSA8IDg7IGkrKykgeworCQkJaWYgKG1peGVyX3NyY1tpXSAmIHZhbCkKKwkJCQlicmVhazsKKwkJfQorCQlpZiAoaSA+IDcpCisJCQlyZXR1cm4gMDsKKwkJd3JpdGVfbWl4ZXIocywgMHgxYywgaSk7CisJCXJldHVybiAwOworCisJY2FzZSBTT1VORF9NSVhFUl9WT0xVTUU6CisJCWlmIChnZXRfdXNlcih2YWwsIHApKQorCQkJcmV0dXJuIC1FRkFVTFQ7CisJCWwgPSB2YWwgJiAweGZmOworCQlpZiAobCA+IDEwMCkKKwkJCWwgPSAxMDA7CisJCXIgPSAodmFsID4+IDgpICYgMHhmZjsKKwkJaWYgKHIgPiAxMDApCisJCQlyID0gMTAwOworCQlpZiAobCA8IDYpIHsKKwkJCXJsID0gMHg0MDsKKwkJCWwgPSAwOworCQl9IGVsc2UgeworCQkJcmwgPSAobCAqIDIgLSAxMSkgLyAzOworCQkJbCA9IChybCAqIDMgKyAxMSkgLyAyOworCQl9CisJCWlmIChyIDwgNikgeworCQkJcnIgPSAweDQwOworCQkJciA9IDA7CisJCX0gZWxzZSB7CisJCQlyciA9IChyICogMiAtIDExKSAvIDM7CisJCQlyID0gKHJyICogMyArIDExKSAvIDI7CisJCX0KKwkJd3JpdGVfbWl4ZXIocywgMHg2MCwgcmwpOworCQl3cml0ZV9taXhlcihzLCAweDYyLCBycik7CisjaWZkZWYgT1NTX0RPQ1VNRU5URURfTUlYRVJfU0VNQU5USUNTCisgICAgICAgICAgICAgICAgcy0+bWl4LnZvbFs5XSA9ICgodW5zaWduZWQgaW50KXIgPDwgOCkgfCBsOworI2Vsc2UKKyAgICAgICAgICAgICAgICBzLT5taXgudm9sWzldID0gdmFsOworI2VuZGlmCisJCXJldHVybiBwdXRfdXNlcihzLT5taXgudm9sWzldLCBwKTsKKworCWNhc2UgU09VTkRfTUlYRVJfU1BFQUtFUjoKKwkJaWYgKGdldF91c2VyKHZhbCwgcCkpCisJCQlyZXR1cm4gLUVGQVVMVDsKKwkJbCA9IHZhbCAmIDB4ZmY7CisJCWlmIChsID4gMTAwKQorCQkJbCA9IDEwMDsKKwkJZWxzZSBpZiAobCA8IDIpCisJCQlsID0gMjsKKwkJcmwgPSAobCAtIDIpIC8gMTQ7CisJCWwgPSBybCAqIDE0ICsgMjsKKwkJd3JpdGVfbWl4ZXIocywgMHgzYywgcmwpOworI2lmZGVmIE9TU19ET0NVTUVOVEVEX01JWEVSX1NFTUFOVElDUworICAgICAgICAgICAgICAgIHMtPm1peC52b2xbN10gPSBsICogMHgxMDE7CisjZWxzZQorICAgICAgICAgICAgICAgIHMtPm1peC52b2xbN10gPSB2YWw7CisjZW5kaWYKKwkJcmV0dXJuIHB1dF91c2VyKHMtPm1peC52b2xbN10sIHApOworCisJY2FzZSBTT1VORF9NSVhFUl9SRUNMRVY6CisJCWlmIChnZXRfdXNlcih2YWwsIHApKQorCQkJcmV0dXJuIC1FRkFVTFQ7CisJCWwgPSAodmFsIDw8IDEpICYgMHgxZmU7CisJCWlmIChsID4gMjAwKQorCQkJbCA9IDIwMDsKKwkJZWxzZSBpZiAobCA8IDUpCisJCQlsID0gNTsKKwkJciA9ICh2YWwgPj4gNykgJiAweDFmZTsKKwkJaWYgKHIgPiAyMDApCisJCQlyID0gMjAwOworCQllbHNlIGlmIChyIDwgNSkKKwkJCXIgPSA1OworCQlybCA9IChsIC0gNSkgLyAxMzsKKwkJcnIgPSAociAtIDUpIC8gMTM7CisJCXIgPSAocmwgKiAxMyArIDUpIC8gMjsKKwkJbCA9IChyciAqIDEzICsgNSkgLyAyOworCQl3cml0ZV9jdHJsKHMsIDB4YjQsIChybCA8PCA0KSB8IHJyKTsKKyNpZmRlZiBPU1NfRE9DVU1FTlRFRF9NSVhFUl9TRU1BTlRJQ1MKKyAgICAgICAgICAgICAgICBzLT5taXgudm9sWzhdID0gKCh1bnNpZ25lZCBpbnQpciA8PCA4KSB8IGw7CisjZWxzZQorICAgICAgICAgICAgICAgIHMtPm1peC52b2xbOF0gPSB2YWw7CisjZW5kaWYKKwkJcmV0dXJuIHB1dF91c2VyKHMtPm1peC52b2xbOF0sIHApOworCisJZGVmYXVsdDoKKwkJaSA9IF9JT0NfTlIoY21k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gKGNvdW50IDw9IDApCisJCQlicmVhazsKKwkJaWYgKHNpZ25hbF9wZW5kaW5nKGN1cnJlbnQpKQorICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgaWYgKG5vbmJsb2NrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVfd2FpdF9xdWV1ZSgmcy0+ZG1hX2RhYy53YWl0LCAmd2FpdCk7CisgICAgICAgICAgICAgICAgICAgICAgICBzZXRfY3VycmVudF9zdGF0ZShUQVNLX1JVTk5JTkcpOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC1FQlVTWTsKKyAgICAgICAgICAgICAgICB9CisJCXRtbyA9IDMgKiBIWiAqIChjb3VudCArIHMtPmRtYV9kYWMuZnJhZ3NpemUpIC8gMiAvIHMtPnJhdGU7CisJCWlmIChzLT5mbXQgJiAoQUZNVF9TMTZfTEUgfCBBRk1UX1UxNl9MRSkpCisJCQl0bW8gPj49IDE7CisJCWlmIChzLT5jaGFubmVscyA+IDEpCisJCQl0bW8gPj49IDE7CisgICAgICAgICAgICAgICAgaWYgKCFzY2hlZHVsZV90aW1lb3V0KHRtbyArIDEpKQorICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRrKEtFUk5fREVCVUcgInNvbG8xOiBkbWEgdGltZWQgb3V0Pz9cbiIpOworICAgICAgICB9CisgICAgICAgIHJlbW92ZV93YWl0X3F1ZXVlKCZzLT5kbWFfZGFjLndhaXQsICZ3YWl0KTsKKyAgICAgICAgc2V0X2N1cnJlbnRfc3RhdGUoVEFTS19SVU5OSU5HKTsKKyAgICAgICAgaWYgKHNpZ25hbF9wZW5kaW5nKGN1cnJlbnQpKQorICAgICAgICAgICAgICAgIHJldHVybiAtRVJFU1RBUlRTWVM7CisgICAgICAgIHJldHVybiAwOworfQorCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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ICAgICAgICAgICAweDAyICAgIC8qIEZNIE91dHB1dCBWb2x1bWUgKi8KKyNkZWZpbmUgRk9SVEVfSTJTX1ZPTCAgICAgICAgICAgMHgwNCAgICAvKiBJMlMgVm9sdW1lICovCisjZGVmaW5lIEZPUlRFX1JFQ19TUkMgICAgICAgICAgIDB4MDYgICAgLyogUmVjb3JkIFNvdXJjZSAqLworI2RlZmluZSBGT1JURV9QTFlfQ1RSTCAgICAgICAgICAweDA4ICAgIC8qIFBsYXliYWNrIENvbnRyb2wgKi8KKyNkZWZpbmUgRk9SVEVfUExZX0NPVU5UICAgICAgICAgMHgwYSAgICAvKiBQbGF5YmFjayBDb3VudCAqLworI2RlZmluZSBGT1JURV9QTFlfQlVGMSAgICAgICAgICAweDBjICAgIC8qIFBsYXliYWNrIEJ1ZmZlciBJICovCisjZGVmaW5lIEZPUlRFX1BMWV9CVUYyICAgICAgICAgIDB4MTAgICAgLyogUGxheWJhY2sgQnVmZmVyIElJICovCisjZGVmaW5lIEZPUlRFX0NBUF9DVFJMICAgICAgICAgIDB4MTQgICAgLyogQ2FwdHVyZSBDb250cm9sICovCisjZGVmaW5lIEZPUlRFX0NBUF9DT1VOVCAgICAgICAgIDB4MTYgICAgLyogQ2FwdHVyZSBDb3VudCAqLworI2RlZmluZSBGT1JURV9DQVBfQlVGMSAgICAgICAgICAweDE4ICAgIC8qIENhcHR1cmUgQnVmZmVyIEkgKi8KKyNkZWZpbmUgRk9SVEVfQ0FQX0JVRjIgICAgICAgICAgMHgxYyAgICAvKiBDYXB0dXJlIEJ1ZmZlciBJSSAqLworI2RlZmluZSBGT1JURV9DT0RFQ19DVFJMICAgICAgICAweDIyICAgIC8qIENvZGVjIENvbnRyb2wgKi8KKyNkZWZpbmUgRk9SVEVfSTJTX01PREUgICAgICAgICAgMHgyNCAgICAvKiBJMlMgTW9kZSBDb250cm9sICovCisjZGVmaW5lIEZPUlRFX1ZPTFVNRSAgICAgICAgICAgIDB4MjYgICAgLyogVm9sdW1lIFVwL0Rvd24vTXV0ZSBTdGF0dXMgKi8KKyNkZWZpbmUgRk9SVEVfSTJDX0NUUkwgICAgICAgICAgMHgyOSAgICAvKiBJMkMgQ29udHJvbCAqLworI2RlZmluZSBGT1JURV9BQzk3X0NNRCAgICAgICAgICAweDJhICAgIC8qIEFDJzk3IENvbW1hbmQgKi8KKyNkZWZpbmUgRk9SVEVfQUM5N19EQVRBICAgICAgICAgMHgyYyAgICAvKiBBQyc5NyBEYXRhICovCisjZGVmaW5lIEZPUlRFX01QVTQwMV9EQVRBICAgICAgIDB4MzAgICAgLyogTVBVNDAxIERhdGEgKi8KKyNkZWZpbmUgRk9SVEVfTVBVNDAxX0NNRCAgICAgICAgMHgzMSAgICAvKiBNUFU0MDEgQ29tbWFuZCAqLworI2RlZmluZSBGT1JURV9HUElPX0NUUkwgICAgICAgICAweDUyICAgIC8qIEdlbmVyYWwgUHVycG9zZSBJL08gQ29udHJvbCAqLworI2RlZmluZSBGT1JURV9HRU5fQ1RSTCAgICAgICAgICAweDU0ICAgIC8qIEdlbmVyYWwgQ29udHJvbCAqLworI2RlZmluZSBGT1JURV9JUlFfTUFTSyAgICAgICAgICAweDU2ICAgIC8qIEludGVycnVwdCBNYXNrICovCisjZGVmaW5lIEZPUlRFX0lSUV9TVEFUVVMgICAgICAgIDB4NWEgICAgLyogSW50ZXJydXB0IFN0YXR1cyAqLworI2RlZmluZSBGT1JURV9PUEwzX0JBTkswICAgICAgICAweDY4ICAgIC8qIE9QTDMgU3RhdHVzIFJlYWQgLyBCYW5rIDAgV3JpdGUgKi8KKyNkZWZpbmUgRk9SVEVfT1BMM19EQVRBMCAgICAgICAgMHg2OSAgICAvKiBPUEwzIERhdGEgMCBXcml0ZSAqLworI2RlZmluZSBGT1JURV9PUEwzX0JBTksxICAgICAgICAweDZhICAgIC8qIE9QTDMgQmFuayAxIFdyaXRlICovCisjZGVmaW5lIEZPUlRFX09QTDNfREFUQTEgICAgICAgIDB4NmIgICAgLyogT1BMMyBCYW5rIDEgV3JpdGUgKi8KKyNkZWZpbmUgRk9SVEVfUE9XRVJET1dOICAgICAgICAgMHg3MCAgICAvKiBCbG9ja3MgUG93ZXIgRG93biBDb250cm9sICovCisKKyNkZWZpbmUgRk9SVEVfQ0FQX09GRlNFVCAgICAgICAgRk9SVEVfQ0FQX0NUUkwgLSBGT1JURV9QTFlfQ1RSTAorCisjZGVmaW5lIEZPUlRFX0FDOTdfQUREUl9TSElGVCAgIDEwCisKKy8qIFBsYXliYWNrIGFuZCByZWNvcmQgY29udHJvbCByZWdpc3RlciBiaXRzICovCisjZGVmaW5lIEZPUlRFX0JVRjFfTEFTVCAgICAgICAgICgxPDwxKQorI2RlZmluZSBGT1JURV9CVUYyX0xBU1QgICAgICAgICAoMTw8MikKKyNkZWZpbmUgRk9SVEVfU1RBUlQgICAgICAgICAgICAgKDE8PDUpCisjZGVmaW5lIEZPUlRFX1BBVVNFICAgICAgICAgICAgICgxPDw2KQorI2RlZmluZSBGT1JURV9JTU1FRF9TVE9QICAgICAgICAoMTw8NykKKyNkZWZpbmUgRk9SVEVfUkFURV9TSElGVCAgICAgICAgOAorI2RlZmluZSBGT1JURV9SQVRFX01BU0sgICAgICAgICAoMTUgPDwgRk9SVEVfUkFURV9TSElGVCkKKyNkZWZpbmUgRk9SVEVfQ0hBTk5FTFNfNCAgICAgICAgKDE8PDEyKSAvKiBQbGF5YmFjayBvbmx5ICovCisjZGVmaW5lIEZPUlRFX0NIQU5ORUxTXzYgICAgICAgICgyPDwxMikgLyogUGxheWJhY2sgb25seSAqLworI2RlZmluZSBGT1JURV9DSEFOTkVMU182TVMgICAgICAoMzw8MTIpIC8qIFBsYXliYWNrIG9ubHkgKi8KKyNkZWZpbmUgRk9SVEVfQ0hBTk5FTFNfTUFTSyAgICAgKDM8PDEyKQorI2RlZmluZSBGT1JURV8xNkJJVCAgICAgICAgICAgICAoMTw8MTQpCisjZGVmaW5lIEZPUlRFX1NURVJFTyAgICAgICAgICAgICgxPDwxNSkKKworLy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VfV1JJVEUpCisJCWNoYW5uZWwgPSAmY2hpcC0+cGxheTsKKwllbHNlIGlmIChmaWxlLT5mX21vZGUgJiBGTU9ERV9SRUFEKQorCQljaGFubmVsID0gJmNoaXAtPnJlYzsKKwllbHNlIHsKKwkJcmV0ID0gLUVJTlZBTDsKKwkJZ290byBvdXQ7CisJfQorCisJZm9ydGVfY2hhbm5lbF9wcmVwIChjaGFubmVsKTsKKwljaGFubmVsLT5tYXBwZWQgPSAxOworCisgICAgICAgIGlmICh2bWEtPnZtX3Bnb2ZmICE9IDApIHsKKwkJcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgICBnb3RvIG91dDsKKwl9CisKKyAgICAgICAgc2l6ZSA9IHZtYS0+dm1fZW5kIC0gdm1hLT52bV9zdGFydDsKKworICAgICAgICBpZiAoc2l6ZSA+IGNoYW5uZWwtPmJ1Zl9wYWdlcyAqIFBBR0VfU0laRSkgeworCQlEUFJJTlRLICgiJXM6IHNpemUgKCVsZCkgPiBidWZfc3ogKCVkKSBcbiIsIF9fRlVOQ1RJT05fXywKKwkJCSBzaXplLCBjaGFubmVsLT5idWZfc3opOworCQlyZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgIGdvdG8gb3V0OworCX0KKworICAgICAgICBpZiAocmVtYXBfcGZuX3JhbmdlKHZtYSwgdm1hLT52bV9zdGFydCwKKwkJCSAgICAgIHZpcnRfdG9fcGh5cyhjaGFubmVsLT5idWYpID4+IFBBR0VfU0hJRlQsCisJCQkgICAgICBzaXplLCB2bWEtPnZtX3BhZ2VfcHJvdCkpIHsKKwkJRFBSSU5USyAoIiVzOiByZW1hcCBlbCBhIG5vIHdvcmtvXG4iLCBfX0ZVTkNUSU9OX18pOworCQlyZXQgPSAtRUFHQUlOOworICAgICAgICAgICAgICAgIGdvdG8gb3V0OworCX0KKworICAgICAgICByZXQgPSAwOworCisgb3V0OgorCXNwaW5fdW5sb2NrX2lycSAoJmNoaXAtPmxvY2spOworICAgICAgICByZX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OiAlLTZkICAgICUtNmRcbiIKKwkJICAgICAgIk1hcHBlZCAgICAgOiAlLTNzICAgICAgICUtM3NcbiIsCisJCSAgICAgIHBfcmVnICYgMTw8MCAgPyAieWVzIiA6ICJubyIsCisJCSAgICAgIHJfcmVnICYgMTw8MCAgPyAieWVzIiA6ICJubyIsCisJCSAgICAgIHBfcmVnICYgMTw8MSAgPyAieWVzIiA6ICJubyIsCisJCSAgICAgIHJfcmVnICYgMTw8MSAgPyAieWVzIiA6ICJubyIsCisJCSAgICAgIHBfcmVnICYgMTw8MiAgPyAieWVzIiA6ICJubyIsCisJCSAgICAgIHJfcmVnICYgMTw8MiAgPyAieWVzIiA6ICJubyIsCisJCSAgICAgIHBfcmVnICYgMTw8NSAgPyAieWVzIiA6ICJubyIsCisJCSAgICAgIHJfcmVnICYgMTw8NSAgPyAieWVzIiA6ICJubyIsCisJCSAgICAgIHBfcmVnICYgMTw8NiAgPyAieWVzIiA6ICJubyIsCisJCSAgICAgIHJfcmVnICYgMTw8NiAgPyAieWVzIiA6ICJubyIsCisJCSAgICAgIHBfcmVnICYgMTw8NyAgPyAieWVzIiA6ICJubyIsCisJCSAgICAgIHJfcmVnICYgMTw8NyAgPyAieWVzIiA6ICJubyIsCisJCSAgICAgIHBfcmF0ZSwgcl9yYXRlLAorCQkgICAgICBwX2NoYW4sCisJCSAgICAgIHBfcmVnICYgMTw8MTQgPyAieWVzIiA6ICJubyIsCisJCSAgICAgIHJfcmVnICYgMTw8MTQgPyAieWVzIiA6ICJubyIsCisJCSAgICAgIHBfcmVnICYgMTw8MTUgPyAieWVzIiA6ICJubyIsCisJCSAgICAgIHJfcmVnICYgMTw8MTUgPyAieWVzIiA6ICJubyIsCisJCSAgICAgIGZvcnRlLT5wbGF5LmJ1Zl9zeiwgICAgICAgZm9ydGUtPnJlYy5idWZfc3osCisJCSAgICAgIGZvcnRlLT5wbGF5LmZyYWdfc3osICAgICAgZm9ydGUtPnJlYy5mcmFnX3N6LAorCQkgICAgICBm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IGFkZHJlc3NfaW5mbyAqaHdfY29uZmlnID0gZGV2X2lkOworCQlhZGludHIoaXJxLCAodm9pZCAqKWh3X2NvbmZpZy0+c2xvdHNbM10sIE5VTEwpOworCX0KKyNlbmRpZgorCisJd2hpbGUgKDEpCisJeworCQlpZiAoIShzcmMgPSBpbmIodV9JcnFTdGF0dXMpKSkKKwkJCWJyZWFrOworCQloYW5kbGVkID0gMTsKKwkJaWYgKHNyYyAmIERNQV9UQ19JUlEpCisJCXsKKwkJCWd1c3dhdmVfZG1hX2lycSgpOworCQl9CisJCWlmIChzcmMgJiAoTUlESV9UWF9JUlEgfCBNSURJX1JYX0lSUSkpCisJCXsKKwkJCWd1c19taWRpX2ludGVycnVwdCgwKTsKKwkJfQorCQlpZiAoc3JjICYgKEdGMV9USU1FUjFfSVJRIHwgR0YxX1RJTUVSMl9JUlEpKQorCQl7CisJCQlpZiAoZ3VzX3RpbWVyX2VuYWJsZWQpCisJCQkJc291bmRfdGltZXJfaW50ZXJydXB0KCk7CisJCQlndXNfd3JpdGU4KDB4NDUsIDApOwkvKiBBY2sgSVJRICovCisJCQlndXNfdGltZXJfY29tbWFuZCg0LCAweDgwKTsJCS8qIFJlc2V0IElSUSBmbGFncyAqLworCQl9CisJCWlmIChzcmMgJiAoV0FWRVRBQkxFX0lSUSB8IEVOVkVMT1BFX0lSUSkpCisJCQlndXNfdm9pY2VfaXJxKCk7CisJfQorCXJldHVybiBJUlFfUkVUVkFMKGhhbmRsZWQpOworfQorCisvKgorICoJU29tZSBleHRyYSBjb2RlIGZvciB0aGUgMTYgYml0IHNhbXBsaW5nIG9wdGlvbgorICovCisKKyNpZmRlZiBDT05GSUdfU09VTkRfR1VTMTYKKworc3RhdGljIGludCBfX2luaXQgaW5pdF9ndXNfZGIxNihzdHJ1Y3QgYWRkcmVzc19pbmZvICpod19jb25maWcpCit7CisJc3RydWN0IHJlc291cmNlICpwb3J0czsKKworCXBvcnRzID0gcmVxdWVzdF9yZWdpb24oaHdfY29uZ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GhlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdhdmUgdGFibGUgKEdGMSBjaGlwKSAqLworI2VuZGlmCisKKworLyoKKyAqICAgIE5vdGUgRE1BMiBvZiAtMSBoYXMgdGhlIHJpZ2h0IG1lYW5pbmcgaW4gdGhlIEdVUyBkcml2ZXIgYXMgd2VsbAorICogICAgICBhcyBoZXJlLiAKKyAqLworCitzdGF0aWMgc3RydWN0IGFkZHJlc3NfaW5mbyBjZmc7CisKK3N0YXRpYyBpbnQgX19pbml0ZGF0YSBpbyA9IC0xOworc3RhdGljIGludCBfX2luaXRkYXRhIGlycSA9IC0xOworc3RhdGljIGludCBfX2luaXRkYXRhIGRtYSA9IC0xOworc3RhdGljIGludCBfX2luaXRkYXRhIGRtYTE2ID0gLTE7CS8qIFNldCB0aGlzIGZvciBtb2R1bGVzIHRoYXQgbmVlZCBpdCAqLworc3RhdGljIGludCBfX2luaXRkYXRhIHR5cGUgPSAwOwkJLyogMSBmb3IgUG5QICovCisKK21vZHVsZV9wYXJhbShpbywgaW50LCAwKTsKK21vZHVsZV9wYXJhbShpcnEsIGludCwgMCk7Cittb2R1bGVfcGFyYW0oZG1hLCBpbnQsIDApOworbW9kdWxlX3BhcmFtKGRtYTE2LCBpbnQsIDApOworbW9kdWxlX3BhcmFtKHR5cGUsIGludCwgMCk7CisjaWZkZWYgQ09ORklHX1NPVU5EX0dVU01BWAorbW9kdWxlX3BhcmFtKG5vX3dhdmVfZG1hLCBpbnQsIDApOworI2VuZGlmCisjaWZkZWYgQ09ORklHX1NPVU5EX0dVUzE2Cittb2R1bGVfcGFyYW0oZGIxNiwgaW50LCAwKTsKK21vZHVsZV9wYXJhbShndXMxNiwgaW50LCAwKTsKKyNlbmRpZgorTU9EVUxFX0xJQ0VOU0UoIkdQTCIpOworCitzdGF0aWMgaW50IF9faW5pdCBpbml0X2d1cyh2b2lkKQoreworCXByaW50ayhLRVJOX0lORk8gIkdyYXZpcyBVbHRyYXNvdW5kI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xCisjZGVmaW5lIFZNT0RFX0VOVkVMT1BFCQkyCisjZGVmaW5lIFZNT0RFX1NUQVJUX05PVEUJMworCisJaW50ICAgICAgICAgICAgIGVudl9waGFzZTsKKwl1bnNpZ25lZCBjaGFyICAgZW52X3JhdGVbNl07CisJdW5zaWduZWQgY2hhciAgIGVudl9vZmZzZXRbNl07CisKKwkvKgorCSAqIFZvbHVtZSBjb21wdXRhdGlvbiBwYXJhbWV0ZXJzIGZvciBndXNfYWRhZ2lvX3ZvbCgpCisJICovCisJaW50CQltYWluX3ZvbCwgZXhwcmVzc2lvbl92b2wsIHBhdGNoX3ZvbDsKKworCS8qIFZhcmlhYmxlcyBmb3IgIlVsdHJhY2xpY2siIHJlbW92YWwgKi8KKwlpbnQgICAgICAgICAgICAgZGV2X3BlbmRpbmcsIG5vdGVfcGVuZGluZywgdm9sdW1lX3BlbmRpbmcsCisJICAgICAgICAgICAgICAgIHNhbXBsZV9wZW5kaW5nOworCWNoYXIgICAgICAgICAgICBraWxsX3BlbmRpbmc7CisJbG9uZyAgICAgICAgICAgIG9mZnNldF9wZW5kaW5nOworCit9OworCitzdGF0aWMgc3RydWN0IHZvaWNlX2FsbG9jX2luZm8gKnZvaWNlX2FsbG9jOworc3RhdGljIHN0cnVjdCBhZGRyZXNzX2luZm8gKmd1c19od19jb25maWc7CitleHRlcm4gaW50ICAgICAgZ3VzX2Jhc2U7CitleHRlcm4gaW50ICAgICAgZ3VzX2lycSwgZ3VzX2RtYTsKK2V4dGVybiBpbnQgICAgICBndXNfcG5wX2ZsYWc7CitleHRlcm4gaW50ICAgICAgZ3VzX25vX3dhdmVfZG1hOworc3RhdGljIGludCAgICAgIGd1c19kbWEyID0gLTE7CitzdGF0aWMgaW50ICAgICAgZHVhbF9kbWFfbW9kZTsKK3N0YXRpYyBsb25nICAgICBndXNfbWVtX3NpemU7CitzdGF0aWMgbG9uZyAgICAgZnJlZV9tZW1fcHRyOworc3RhdGljIGludCAgICAgIGd1c19idXN5Oworc3RhdGljIGludCAgICAgIGd1c19ub19kbWE7CitzdGF0aWMgaW50ICAgICAgbnJfdm9pY2VzOworc3RhdGljIGludCAgICAgIGd1c19kZXZudW07CitzdGF0aWMgaW50ICAgICAgdm9sdW1lX2Jhc2UsIHZvbHVtZV9zY2FsZSwgdm9sdW1lX21ldGhvZDsKK3N0YXRpYyBpbnQgICAgICBndXNfcmVjbWFzayA9IFNPVU5EX01BU0tfTUlDOworc3RhdGljIGludCAgICAgIHJlY29yZGluZ19hY3RpdmU7CitzdGF0aWMgaW50ICAgICAgb25seV9yZWFkX2FjY2VzczsKK3N0YXRpYyBpbnQgICAgICBvbmx5XzhfYml0czsKKworc3RhdGljIGludCAgICAgIGl3X21vZGUgPSAwOworaW50ICAgICAgICAgICAgIGd1c193YXZlX3ZvbHVtZSA9IDYwOworaW50ICAgICAgICAgICAgIGd1c19wY21fdm9sdW1lID0gODA7CitpbnQgICAgICAgICAgICAgaGF2ZV9ndXNfbWF4ID0gMDsKK3N0YXRpYyBpbnQgICAgICBndXNfbGluZV92b2wgPSAxMDAsIGd1c19taWNfdm9sOworc3RhdGljIHVuc2lnbmVkIGNoYXIgbWl4X2ltYWdlID0gMHgwMDsKKworaW50ICAgICAgICAgICAgIGd1c190aW1lcl9lbmFibGVkID0gMDsKKworLyoKKyAqIEN1cnJlbnQgdmVyc2lvbiBvZiB0aGlzIGRyaXZlciBkb2Vzbid0IGFsbG93IHN5bnRoIGFuZCBQQ00gZnVuY3Rpb25zCisgKiBhdCB0aGUgc2FtZSB0aW1lLiBUaGUgYWN0aXZlX2RldmljZSBzcGVjaWZpZXMgdGhlIGFjdGl2ZSBkcml2ZXIKKyAqLworCitzdGF0aWMgaW50ICAgICAgYWN0aXZlX2RldmljZTsKKworI2RlZmluZSBHVVNfREVWX1dBVkUJCTEJLyogV2F2ZSB0YWJsZSBzeW50aCAqLworI2RlZmluZSBHVVNfREVWX1BDTV9ET05FCTIJLyogUENNIGRldmljZSwgdHJhbnNmZXIgZG9uZSAqLworI2RlZmluZSBHVVNfREVWX1BDTV9DT05USU5VRQkzCS8qIFBDTSBkZXZpY2UsIHRyYW5zZmVyIGRvbmUgY2guIDEvMiAqLworCitzdGF0aWMgaW50ICAgICAgZ3VzX2F1ZGlvX3NwZWVkOworc3RhdGljIGludCAgICAgIGd1c19hdWRpb19jaGFubmVsczsKK3N0YXRpYyBpbnQgICAgICBndXNfYXVkaW9fYml0czsKK3N0YXRpYyBpbnQgICAgICBndXNfYXVkaW9fYnNpemU7CitzdGF0aWMgY2hhciAgICAgYm91bmNlX2J1Zls4ICogMTAyNF07CS8qIE11c3QgbWF0Y2ggdmFsdWUgc2V0IHRvIG1heF9mcmFnbWVudCAqLworCitzdGF0aWMgREVDTEFSRV9XQUlUX1FVRVVFX0hFQUQoZHJhbV9zbGVlcGVyKTsKKworLyoKKyAqIFZhcmlhYmxlcyBhbmQgYnVmZmVycyBmb3IgUENNIG91dHB1dAorICovCisKKyNkZWZpbmUgTUFYX1BDTV9CVUZGRVJTCQkoMTI4Kk1BWF9SRUFMVElNRV9GQUNUT1IpCS8qIERvbid0IGNoYW5nZSAqLworCitzdGF0aWMgaW50ICAgICAgcGNtX2JzaXplLCBwY21fbmJsaywgcGNtX2JhbmtzaXplOworc3RhdGljIGludCAgICAgIHBjbV9kYXRhc2l6ZVtNQVhfUENNX0JVRkZFUlNdOworc3RhdGljIHZvbGF0aWxlIGludCBwY21faGVhZCwgcGNtX3RhaWwsIHBjbV9xbGVuOworc3RhdGljIHZvbGF0aWxlIGludCBwY21fYWN0aXZlOworc3RhdGljIHZvbGF0aWxlIGludCBkbWFfYWN0aXZlOworc3RhdGljIGludCAgICAgIHBjbV9vcGVuZWQ7CitzdGF0aWMgaW50ICAgICAgcGNtX2N1cnJlbnRfZGV2Oworc3RhdGljIGludCAgICAgIHBjbV9jdXJyZW50X2Jsb2NrOworc3RhdGljIHVuc2lnbmVkIGxvbmcgcGNtX2N1cnJlbnRfYnVmOworc3RhdGljIGludCAgICAgIHBjbV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A7CQkvKiBDb21iaW5lIERNQSBjaGFubmVscyAqLworCQkJICAgIGR1YWxfZG1hX21vZGUgPSAwOworCQl9CisJCWRtYV9pbWFnZSB8PSB0bXA7CisJfQorCisJLyoKKwkgKiBGb3Igc29tZSByZWFzb24gdGhlIElSUSBhbmQgRE1BIGFkZHJlc3NlcyBtdXN0IGJlIHdyaXR0ZW4gdHdpY2UKKwkgKi8KKworCS8qCisJICogRG9pbmcgaXQgZmlyc3QgdGltZQorCSAqLworCisJb3V0YigobWl4X2ltYWdlKSwgdV9NaXhlcik7CS8qIFNlbGVjdCBETUEgY29udHJvbCAqLworCW91dGIoKGRtYV9pbWFnZSB8IDB4ODApLCB1X0lSUURNQUNvbnRyb2wpOwkvKiBTZXQgRE1BIGFkZHJlc3MgKi8KKworCW91dGIoKG1peF9pbWFnZSB8IDB4NDApLCB1X01peGVyKTsJLyogU2VsZWN0IElSUSBjb250cm9sICovCisJb3V0YigoaXJxX2ltYWdlKSwgdV9JUlFETUFDb250cm9sKTsJLyogU2V0IElSUSBhZGRyZXNzICovCisKKwkvKgorCSAqIERvaW5nIGl0IHNlY29uZCB0aW1lCisJICovCisKKwlvdXRiKChtaXhfaW1hZ2UpLCB1X01peGVyKTsJLyogU2VsZWN0IERNQSBjb250cm9sICovCisJb3V0YigoZG1hX2ltYWdlKSwgdV9JUlFETUFDb250cm9sKTsJLyogU2V0IERNQSBhZGRyZXNzICovCisKKwlvdXRiKChtaXhfaW1hZ2UgfCAweDQwKSwgdV9NaXhlcik7CS8qIFNlbGVjdCBJUlEgY29udHJvbCAqLworCW91dGIoKGlycV9pbWFnZSksIHVfSVJRRE1BQ29udHJvbCk7CS8qIFNldCBJUlEgYWRkcmVzcyAqLworCisJZ3VzX3NlbGVjdF92b2ljZSgwKTsJLyogVGhpcyBkaXNhYmxlcyB3cml0ZXMgdG8gSVJRL0RNQSByZWcgKi8KKworCW1peF9pbWFnZSAmPSB+MHgwMjsJLyogRW5hYmxlIGxpbmUgb3V0ICovC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c2VfcmVnaW9uKGJhc2VhZGRyLCAxNik7CisJCXJldHVybiAwOworCX0KKworCWd1c19iYXNlID0gYmFzZWFkZHI7CisKKwlndXNfd3JpdGU4KDB4NGMsIDApOwkvKiBSZXNldCBHRjEgKi8KKwlndXNfZGVsYXkoKTsKKwlndXNfZGVsYXkoKTsKKworCWd1c193cml0ZTgoMHg0YywgMSk7CS8qIFJlbGVhc2UgUmVzZXQgKi8KKwlndXNfZGVsYXkoKTsKKwlndXNfZGVsYXkoKTsKKworI2lmZGVmIEdVU1BOUF9BVVRPREVURUNUCisJdmFsID0gZ3VzX2xvb2s4KDB4NWIpOwkvKiBWZXJzaW9uIG51bWJlciByZWdpc3RlciAqLworCWd1c193cml0ZTgoMHg1YiwgfnZhbCk7CS8qIEludmVydCBhbGwgYml0cyAqLworCisJaWYgKChndXNfbG9vazgoMHg1YikgJiAweGYwKSA9PSAodmFsICYgMHhmMCkpCS8qIE5vIGNoYW5nZSAqLworCXsKKwkJaWYgKChndXNfbG9vazgoMHg1YikgJiAweDBmKSA9PSAoKH52YWwpICYgMHgwZikpCS8qIENoYW5nZSAqLworCQl7CisJCQlEREIocHJpbnRrKCJJbnRlcndhdmUgY2hpcCB2ZXJzaW9uICVkIGRldGVjdGVkXG4iLCAodmFsICYgMHhmMCkgPj4gNCkpOworCQkJZ3VzX3BucF9mbGFnID0gMTsKKwkJfQorCQllbHNlCisJCXsKKwkJCUREQihwcmludGsoIk5vdCBhbiBJbnRlcndhdmUgY2hpcCAoJXgpXG4iLCBndXNfbG9vazgoMHg1YikpKTsKKwkJCWd1c19wbnBfZmxhZyA9IDA7CisJCX0KKwl9CisJZ3VzX3dyaXRlOCgweDViLCB2YWwpOwkvKiBSZXN0b3JlIGFsbCBiaXRzICovCisjZW5kaWYKKworCWlmIChndXNfcG5wX2ZsYWcpCisJCXBucF9tZW1faW5pdCgpOworCWlmIChpd19tb2RlKQorCQlyZXR1cm4gMTsKKworCS8qIFNlZSBpZiB0aGVyZSBpcyBm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KSAvIChndXNfYXVkaW9fc3BlZWQgKyAyKSkgKyA4KSAvIDE2OworCQlzcGVlZCA9ICg5ODc4NDAwIC8gKHNwZWVkICogMTYpKSAtIDI7CisJfQorCXJldHVybiBzcGVlZDsKK30KKworc3RhdGljIGludCBndXNfYXVkaW9fc2V0X2NoYW5uZWxzKGludCBjaGFubmVscykKK3sKKwlpZiAoIWNoYW5uZWxzKQorCQlyZXR1cm4gZ3VzX2F1ZGlvX2NoYW5uZWxzOworCWlmIChjaGFubmVscyA+IDIpCisJCWNoYW5uZWxzID0gMjsKKwlpZiAoY2hhbm5lbHMgPCAxKQorCQljaGFubmVscyA9IDE7CisJZ3VzX2F1ZGlvX2NoYW5uZWxzID0gY2hhbm5lbHM7CisJcmV0dXJuIGNoYW5uZWxzOworfQorCitzdGF0aWMgaW50IGd1c19hdWRpb19zZXRfYml0cyhpbnQgYml0cykKK3sKKwlpZiAoIWJpdHMpCisJCXJldHVybiBndXNfYXVkaW9fYml0czsKKworCWlmIChiaXRzICE9IDggJiYgYml0cyAhPSAxNikKKwkJYml0cyA9IDg7CisKKwlpZiAob25seV84X2JpdHMpCisJCWJpdHMgPSA4OworCisJZ3VzX2F1ZGlvX2JpdHMgPSBiaXRzOworCXJldHVybiBiaXRzOworfQorCitzdGF0aWMgaW50IGd1c19hdWRpb19pb2N0bChpbnQgZGV2LCB1bnNpZ25lZCBpbnQgY21kLCB2b2lkIF9fdXNlciAqYXJnKQoreworCWludCB2YWw7CisKKwlzd2l0Y2ggKGNtZCkgCisJeworCQljYXNlIFNPVU5EX1BDTV9XUklURV9SQVRFOgorCQkJaWYgKGdldF91c2VyKHZhbCwgKGludCBfX3VzZXIqKWFyZykpCisJCQkJcmV0dXJuIC1FRkFVTFQ7CisJCQl2YWwgPSBndXNfYXVkaW9fc2V0X3NwZWVkKHZhbCk7CisJCQlicmVhazsKKworCQljYXNlIFNPVU5EX1BDTV9SRUFEX1JBVEU6CisJCQl2YWwgPSBndXNfYXVkaW9fc3BlZ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ZlX3VubG9hZChzdHJ1Y3QgYWRkcmVzc19pbmZvICpod19jb25maWcpCit7CisjaWZkZWYgQ09ORklHX1NPVU5EX0dVU01BWAorCWlmIChoYXZlX2d1c19tYXgpCisJeworCQlhZDE4NDhfdW5sb2FkKGd1c19iYXNlICsgMHgxMGMsCisJCQkJLWd1c19pcnEsCisJCQkJZ3VzX2RtYTIsCS8qIFBsYXliYWNrIERNQSAqLworCQkJCWd1c19kbWEsCS8qIENhcHR1cmUgRE1BICovCisJCQkJMSk7CS8qIFNoYXJlIERNQSBjaGFubmVscyB3aXRoIEdGMSAqLworCX0KKyNlbmRpZgorCisJaWYgKG1peGVyX3R5cGUgPT0gSUNTMjEwMSkKKwl7CisJCXJlbGVhc2VfcmVnaW9uKHVfTWl4U2VsZWN0LCAxKTsKKwl9CisJaWYgKGh3X2NvbmZpZy0+c2xvdHNbMF0gIT0gLTEpCisJCXNvdW5kX3VubG9hZF9zeW50aGRldihod19jb25maWctPnNsb3RzWzBdKTsKKwlpZiAoaHdfY29uZmlnLT5zbG90c1sxXSAhPSAtMSkKKwkJc291bmRfdW5sb2FkX2F1ZGlvZGV2KGh3X2NvbmZpZy0+c2xvdHNbMV0pOworCWlmIChod19jb25maWctPnNsb3RzWzJdICE9IC0xKQorCQlzb3VuZF91bmxvYWRfbWlkaWRldihod19jb25maWctPnNsb3RzWzJdKTsKKwlpZiAoaHdfY29uZmlnLT5zbG90c1s0XSAhPSAtMSkKKwkJc291bmRfdW5sb2FkX2F1ZGlvZGV2KGh3X2NvbmZpZy0+c2xvdHNbNF0pOworCWlmIChod19jb25maWctPnNsb3RzWzVdICE9IC0xKQorCQlzb3VuZF91bmxvYWRfbWl4ZXJkZXYoaHdfY29uZmlnLT5zbG90c1s1XSk7CisJCisJdmZyZWUoc2FtcGxlcyk7CisJc2FtcGxlcz1OVUxMOworfQorLyogY2FsbGVkIGluIGludGVycnVwdCBjb250ZXh0ICovCitzdGF0aWMgdm9pZCBkb19sb29wX2lycShpbnQgd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ZWFrOworCQkJfQorCQkvKiBBcmcgY29udGFpbnMgYSBiaXQgZm9yIGVhY2ggc3VwcG9ydGVkIHJlY29yZGluZyBzb3VyY2UgKi8KKyAgICAgICAgICAgICAgICBjYXNlIFNPVU5EX01JWEVSX1JFQ01BU0s6CisJCQl2YWwgPSAwOworCQkJYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTT1VORF9NSVhFUl9DQVBTOgorCQkJdmFsID0gMDsKKwkJCWJyZWFrOworCQkvKiBSZWFkIGEgc3BlY2lmaWMgbWl4ZXIgKi8KKwkJZGVmYXVsdDogeworCQkJaW50IGkgPSBfSU9DX05SKGNtZCk7CisKKwkJCWlmIChpID49IFNPVU5EX01JWEVSX05SREVWSUNFUyB8fCAhbWl4dGFibGVbaV0uYXZhaWwpCisJCQkJcmV0dXJuIC1FSU5WQUw7CisJCQl2YWwgPSBoYWwyLT5taXhlci52b2x1bWVbbWl4dGFibGVbaV0uaWR4XTsKKwkJCWJyZWFrOworCQkJfQorCQl9CisJCXJldHVybiBwdXRfdXNlcih2YWwsIChpbnQgKilhcmcpOworCX0KKworICAgICAgICBpZiAoX0lPQ19ESVIoY21kKSAhPSAoX0lPQ19XUklURXxfSU9DX1JFQUQpKQorCQlyZXR1cm4gLUVJTlZBTDsKKworCWhhbDItPm1peGVyLm1vZGNudCsrOworCisJaWYgKGdldF91c2VyKHZhbCwgKGludCAqKWFyZykpCisJCXJldHVybiAtRUZBVUxUOworCisJc3dpdGNoIChfSU9DX05SKGNtZCkpIHsKKwkvKiBBcmcgY29udGFpbnMgYSBiaXQgZm9yIGVhY2ggcmVjb3JkaW5nIHNvdXJjZSAqLworCWNhc2UgU09VTkRfTUlYRVJfUkVDU1JDOgorCQlyZXR1cm4gMDsJLyogRklYTUUgKi8KKwlkZWZhdWx0OgorCQlyZXR1cm4gaGFsMl93cml0ZV9taXhlcihoYWwyLCBfSU9DX05SKGNtZCksIHZhbCk7CisJfQorCisJcmV0dXJuIDA7Cit9CisKK3N0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fYnVmLCAwLCBIQVJNT05ZX0JVRl9TSVpFKk1BWF9CVUZTKTsKKwlDSEVDS19XQkFDS19JTlZfT0ZGU0VUKHBsYXllZF9idWYsIDAsIEhBUk1PTllfQlVGX1NJWkUqTUFYX0JVRlMpOworCQorCXJldHVybiAwOworfQorCisvKgorICogUmVsZWFzZSAoY2xvc2UpIHRoZSBhdWRpbyBkZXZpY2UuCisgKi8KKworc3RhdGljIGludCBoYXJtb255X2F1ZGlvX3JlbGVhc2Uoc3RydWN0IGlub2RlICppbm9kZSwgc3RydWN0IGZpbGUgKmZpbGUpCit7CisJaWYgKCFoYXJtb255LmF1ZGlvX29wZW4pIAorCQlyZXR1cm4gLUVCVVNZOworCQorCWhhcm1vbnkuYXVkaW9fb3BlbiA9IDA7CisKKwlyZXR1cm4gMDsKK30KKworLyoKKyAqIFJlYWQgcmVjb3JkZWQgZGF0YSBvZmYgdGhlIGF1ZGlvIGRldmljZS4KKyAqLworCitzdGF0aWMgc3NpemVfdCBoYXJtb255X2F1ZGlvX3JlYWQoc3RydWN0IGZpbGUgKmZpbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgKmJ1ZmZlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZV90IHNpemVfY291bnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZmZfdCAqcHBvcykKK3sKKwlpbnQgdG90YWxfY291bnQgPSAoaW50KSBzaXplX2NvdW50OworCWludCBjb3VudCA9IDA7CisJaW50IGJ1Zl90b19yZWFkOworCisJd2hpbGUgKGNvdW50PHRvdGFsX2NvdW50KSB7CisJCS8qIFdhaXQgdW50aWwgd2UncmUgb3V0IG9mIGNvbnRyb2wgbW9kZSAqLworCQloYXJtb255X3dhaXRfQ05UTCgpOworCQkKKwkJLyogRmlndXJlIG91dCB3aGljaCBidWZmZXIgdG8gZmlsbCBpbiAqLworCQlpZiAoaGFybW9ueS5uYl9maWxsZWRfcmVjb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ZSBIQVJNT05ZX01BR0lDX1NURVJFTzoKKwkJCQloYXJtb255LnN0ZXJlb19zZWxlY3QgPSBIQVJNT05ZX1NTX1NURVJFTzsKKwkJCQlicmVhazsKKwkJCWRlZmF1bHQ6CisJCQkJaGFybW9ueS5zdGVyZW9fc2VsZWN0ID0gSEFSTU9OWV9TU19NT05POworCQkJCWJyZWFrOworCQkJfQorCQkJaGFybW9ueV9zZXRfcmF0ZShoYXJtb255X2RldGVjdF9yYXRlKCZzcGVlZCkpOworCQkJaGFybW9ueS5kYWNfcmF0ZSA9IHNwZWVkOworCQkJZ290byBvdXQ7CisJCX0KKwl9CisJaGFybW9ueV9zZXRfY29udHJvbChIQVJNT05ZX0RGXzhCSVRfVUxBVywgSEFSTU9OWV9TUl84S0haLCBIQVJNT05ZX1NTX01PTk8pOworb3V0OgorCXJldHVybiByZXQ7Cit9CisjdW5kZWYgZm91cl9ieXRlc190b191MzIKKworCitzdGF0aWMgc3NpemVfdCBoYXJtb255X2F1ZGlvX3dyaXRlKHN0cnVjdCBmaWxlICpmaWxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciAqYnVmZmVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZV90IHNpemVfY291bnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2ZmX3QgKnBwb3MpCit7CisJaW50IHRvdGFsX2NvdW50ID0gKGludCkgc2l6ZV9jb3VudDsKKwlpbnQgY291bnQgPSAwOworCWludCBmcmFtZV9zaXplOworCWludCBidWZfdG9fZmlsbDsKKwlpbnQgZnJlc2hfYnVmZmVyOworCisJaWYgKCFoYXJtb255LmZvcm1hdF9pbml0aWFsaXplZCkgeworCQlpZiAoaGFybW9ueV9mb3JtYXRfYXV0b19kZXRlY3QoYnVmZmVyLCB0b3RhbF9jb3VudCkpCisJCQlyZXR1cm4gLUVGQVVMVDsKKwl9CisJCisJd2hpbGUgKGNvdW50PHRvdGF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ybW9ueS5zdXNwZW5kZWRfcGxheWluZyAmJiAoaGFybW9ueS5uYl9maWxsZWRfcGxheT49NCkpCisJCQloYXJtb255X2VuYWJsZV9pbnRlcnJ1cHRzKCk7CisJfQorCQorCXJldHVybiBjb3VudDsKK30KKworc3RhdGljIHVuc2lnbmVkIGludCBoYXJtb255X2F1ZGlvX3BvbGwoc3RydWN0IGZpbGUgKmZpbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IHBvbGxfdGFibGVfc3RydWN0ICp3YWl0KQoreworCXVuc2lnbmVkIGludCBtYXNrID0gMDsKKwkKKwlpZiAoZmlsZS0+Zl9tb2RlICYgRk1PREVfUkVBRCkgeworCQlpZiAoIWhhcm1vbnkuc3VzcGVuZGVkX3JlY29yZGluZykKKwkJCXBvbGxfd2FpdChmaWxlLCAmaGFybW9ueS53cV9yZWNvcmQsIHdhaXQpOworCQlpZiAoaGFybW9ueS5uYl9maWxsZWRfcmVjb3JkKQorCQkJbWFzayB8PSBQT0xMSU4gfCBQT0xMUkROT1JNOworCX0KKworCWlmIChmaWxlLT5mX21vZGUgJiBGTU9ERV9XUklURSkgeworCQlpZiAoIWhhcm1vbnkuc3VzcGVuZGVkX3BsYXlpbmcpCisJCQlwb2xsX3dhaXQoZmlsZSwgJmhhcm1vbnkud3FfcGxheSwgd2FpdCk7CisJCWlmIChoYXJtb255Lm5iX2ZpbGxlZF9wbGF5KQorCQkJbWFzayB8PSBQT0xMT1VUIHwgUE9MTFdSTk9STTsKKwl9CisKKwlyZXR1cm4gbWFzazsKK30KKworc3RhdGljIGludCBoYXJtb255X2F1ZGlvX2lvY3RsKHN0cnVjdCBpbm9kZSAqaW5vZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmaWxlICpmaWxlLAorCQkJCXVuc2lnbmVkIGludCBjbWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgYXJnKQ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JY3VycmVudF9pbnB1dF9saW5lID0gKGhhcm1vbnkuY3VycmVudF9nYWluICYgR0FJTl9JU19NQVNLKSAKKwkJCQkgICAgPj4gR0FJTl9JU19TSElGVDsKKwlpZiAoY3VycmVudF9pbnB1dF9saW5lKSAKKwkJcmV0dXJuIFNPVU5EX01BU0tfTUlDOworCisJcmV0dXJuIFNPVU5EX01BU0tfTElORTsKK30KKworLyoKKyAqIFNldCB0aGUgaW5wdXQgKG9ubHkgb25lIGF0IHRpbWUsIGFyYml0cmFyeSBwcmlvcml0eSB0byBsaW5lIGluKQorICovCisKK3N0YXRpYyBpbnQgaGFybW9ueV9taXhlcl9zZXRfcmVjbWFzayhpbnQgcmVjbWFzaykKK3sKKwlpbnQgbmV3X2lucHV0X2xpbmU7CisJaW50IG5ld19pbnB1dF9tYXNrOworCWludCBjdXJyZW50X2lucHV0X2xpbmU7CisJCisJY3VycmVudF9pbnB1dF9saW5lID0gKGhhcm1vbnkuY3VycmVudF9nYWluICYgR0FJTl9JU19NQVNLKQorCQkJCSAgICA+PiBHQUlOX0lTX1NISUZUOworCWlmICgoY3VycmVudF9pbnB1dF9saW5lICYmICgocmVjbWFzayAmIFNPVU5EX01BU0tfTElORSkgfHwgIShyZWNtYXNrICYgU09VTkRfTUFTS19NSUMpKSkgfHwKKwkJKCFjdXJyZW50X2lucHV0X2xpbmUgJiYgKChyZWNtYXNrICYgU09VTkRfTUFTS19MSU5FKSAmJiAhKHJlY21hc2sgJiBTT1VORF9NQVNLX01JQykpKSkgeworCQluZXdfaW5wdXRfbGluZSA9IDA7CisJCW5ld19pbnB1dF9tYXNrID0gU09VTkRfTUFTS19MSU5FOworCX0gZWxzZSB7CisJCW5ld19pbnB1dF9saW5lID0gMTsKKwkJbmV3X2lucHV0X21hc2sgPSBTT1VORF9NQVNLX01JQzsKKwl9CisJaGFybW9ueS5jdXJyZW50X2dhaW4gPSAoKGhhcm1vbnkuY3VycmVudF9nYWluICYgfkdBSU5fSVNfTUFTSykgfCAK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aGFybW9ueS5jdXJyZW50X2dhaW4gJj0gfkdBSU5fSEVfTUFTSzsKKwkKKwloYXJtb255X21peGVyX3NldF9nYWluKCk7CisKKwlyZXR1cm4gKG91dG1hc2sgJiAoTUFTS19JTlRFUk5BTCB8IE1BU0tfTElORU9VVCB8IE1BU0tfSEVBRFBIT05FUykpOworfQorCisvKgorICogVGhpcyBjb2RlIGlzIGluc3BpcmVkIGZyb20gc2JfbWl4ZXIuYworICovCisKK3N0YXRpYyBpbnQgaGFybW9ueV9taXhlcl9pb2N0bChzdHJ1Y3QgaW5vZGUgKiBpbm9kZSwgc3RydWN0IGZpbGUgKiBmaWxlLAorCQl1bnNpZ25lZCBpbnQgY21kLCB1bnNpZ25lZCBsb25nIGFyZykKK3sKKwlpbnQgdmFsOworCWludCByZXQ7CisKKwlpZiAoY21kID09IFNPVU5EX01JWEVSX0lORk8pIHsKKwkJbWl4ZXJfaW5mbyBpbmZvOworCQltZW1zZXQoJmluZm8sIDAsIHNpemVvZihpbmZvKSk7CisgICAgICAgICAgICAgICAgc3RybmNweShpbmZvLmlkLCAiaGFybW9ueSIsIHNpemVvZihpbmZvLmlkKS0xKTsKKyAgICAgICAgICAgICAgICBzdHJuY3B5KGluZm8ubmFtZSwgIkhhcm1vbnkgYXVkaW8iLCBzaXplb2YoaW5mby5uYW1lKS0xKTsKKyAgICAgICAgICAgICAgICBpbmZvLm1vZGlmeV9jb3VudGVyID0gMTsgLyogPyAqLworICAgICAgICAgICAgICAgIGlmIChjb3B5X3RvX3VzZXIoKHZvaWQgKilhcmcsICZpbmZvLCBzaXplb2YoaW5mbykpKQorICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC1FRkFVTFQ7CisJCXJldHVybiAwOworCX0KKwkKKwlpZiAoY21kID09IE9TU19HRVRWRVJTSU9OKQorCQlyZXR1cm4gcHV0X3VzZXIoU09VTkRfVkVSU0lPTiwgKGludCAqKWFyZyk7CisKKwkvKiByZWFkICovCisJdmFsID0gMDsKKwlpZ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1VORF9NSVhFUl9PVVRTUkMpOgorCQlyZXQgPSBoYXJtb255X21peGVyX3NldF9vdXRtYXNrKHZhbCk7CisJCWJyZWFrOworCWNhc2UgTUlYRVJfUkVBRChTT1VORF9NSVhFUl9PVVRTUkMpOgorCQlyZXQgPSBoYXJtb255X21peGVyX2dldF9vdXRtYXNrKCk7CisJCWJyZWFrOworCQorCWNhc2UgTUlYRVJfV1JJVEUoU09VTkRfTUlYRVJfVk9MVU1FKToKKwljYXNlIE1JWEVSX1dSSVRFKFNPVU5EX01JWEVSX0lHQUlOKToKKwljYXNlIE1JWEVSX1dSSVRFKFNPVU5EX01JWEVSX01PTklUT1IpOgorCQlyZXQgPSBoYXJtb255X21peGVyX3NldF9sZXZlbChjbWQgJiAweGZmLCB2YWwpOworCQlicmVhazsKKworCWNhc2UgTUlYRVJfUkVBRChTT1VORF9NSVhFUl9WT0xVTUUpOgorCWNhc2UgTUlYRVJfUkVBRChTT1VORF9NSVhFUl9JR0FJTik6CisJY2FzZSBNSVhFUl9SRUFEKFNPVU5EX01JWEVSX01PTklUT1IpOgorCQlyZXQgPSBoYXJtb255X21peGVyX2dldF9sZXZlbChjbWQgJiAweGZmKTsKKwkJYnJlYWs7CisKKwlkZWZhdWx0OgorCQlyZXR1cm4gLUVJTlZBTDsKKwl9CisKKwlpZiAocHV0X3VzZXIocmV0LCAoaW50ICopYXJnKSkKKwkJcmV0dXJuIC1FRkFVTFQ7CisJcmV0dXJuIDA7Cit9CisKKworc3RhdGljIGludCBoYXJtb255X21peGVyX29wZW4oc3RydWN0IGlub2RlICppbm9kZSwgc3RydWN0IGZpbGUgKmZpbGUpCit7CisJaWYgKGhhcm1vbnkubWl4ZXJfb3BlbikgCisJCXJldHVybiAtRUJVU1k7CisJaGFybW9ueS5taXhlcl9vcGVuID0gMTsKKwlyZXR1cm4gMDsKK30KKworc3RhdGljIGludCBoYXJtb255X21peGVyX3JlbGVhc2Uoc3RydWN0IGlub2RlICppbm9kZSwgc3RydWN0IGZ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0ZSwgMCkpKQorCQlyZXR1cm4gcmV0OworCWlmICghYWNjZXNzX29rKFZFUklGWV9SRUFELCBidWZmZXIsIGNvdW50KSkKKwkJcmV0dXJuIC1FRkFVTFQ7CisJcmV0ID0gMDsKKworCXBlbmRpbmcgPSAwOworCisgICAgICAgIGFkZF93YWl0X3F1ZXVlKCZkbWFidWYtPndhaXQsICZ3YWl0YSk7CisJd2hpbGUgKGNvdW50ID4gMCkgeworCQlzZXRfY3VycmVudF9zdGF0ZShUQVNLX0lOVEVSUlVQVElCTEUpOworCQlzcGluX2xvY2tfaXJxc2F2ZSgmc3RhdGUtPmNhcmQtPmxvY2ssIGZsYWdzKTsKKyAgICAgICAgICAgICAgICBpZiAoUE1fU1VTUEVOREVEKGNhcmQpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzcGluX3VubG9ja19pcnFyZXN0b3JlKCZjYXJkLT5sb2NrLCBmbGFncyk7CisgICAgICAgICAgICAgICAgICAgICAgICBzY2hlZHVsZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNpZ25hbF9wZW5kaW5nKGN1cnJlbnQpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghcmV0KSByZXQgPSAtRUFHQUlOOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIH0KKworCQljbnQgPSBpODEwX2dldF9mcmVlX3dyaXRlX3NwYWNlKHN0YXRlKTsKKwkJc3dwdHIgPSBkbWFidWYtPnN3cHRyOworCQkvKiBCb3VuZCB0aGUgbWF4aW11bSBzaXplIHRvIGhvdyBtdWNoIHdlIGNhbiBjb3B5IHRvIHRoZQorCQkgKiBkbWEgYnVmZmVyIGJlZm9yZSB3ZSBoaXQgdGhlIGVuZC4gIElmIHdlIGhhdmUgbW9yZSB0bworCQkgKiBjb3B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worfQorCisvKioKKyAqCWk4MTBfYWM5N19wb3dlcl91cF9idXMJLQlicmluZyB1cCBBQzk3IGxpbmsKKyAqCUBjYXJkIDogSUNIIGF1ZGlvIGRldmljZSB0byBwb3dlciB1cAorICoKKyAqCUJyaW5nIHVwIHRoZSBBQ0xpbmsgQUM5NyBjb2RlYyBidXMKKyAqLworIAorc3RhdGljIGludCBpODEwX2FjOTdfcG93ZXJfdXBfYnVzKHN0cnVjdCBpODEwX2NhcmQgKmNhcmQpCit7CQorCXUzMiByZWcgPSBJODEwX0lPUkVBREwoY2FyZCwgR0xPQl9DTlQpOworCWludCBpOworCWludCBwcmltYXJ5X2NvZGVjX2lkID0gMDsKKworCWlmKChyZWcmMik9PTApCS8qIENvbGQgcmVxdWlyZWQgKi8KKwkJcmVnfD0yOworCWVsc2UKKwkJcmVnfD00OwkvKiBXYXJtICovCisJCQorCXJlZyY9fjg7CS8qIEFDTGluayBvbiAqLworCQorCS8qIEF0IHRoaXMgcG9pbnQgd2UgZGVhc3NlcnQgQUNfUkVTRVQgIyAqLworCUk4MTBfSU9XUklURUwocmVnICwgY2FyZCwgR0xPQl9DTlQpOworCisJLyogV2UgbXVzdCBub3cgYWxsb3cgdGltZSBmb3IgdGhlIENvZGVjIGluaXRpYWxpc2F0aW9uLgorCSAgIDYwMG1TIGlzIHRoZSBzcGVjaWZpZWQgdGltZSAqLworCSAgIAkKKwlmb3IoaT0wO2k8MTA7aSsrKQorCXsKKwkJaWYoKEk4MTBfSU9SRUFETChjYXJkLCBHTE9CX0NOVCkmNCk9PTApCisJCQlicmVhazsKKworCQlzZXRfY3VycmVudF9zdGF0ZShUQVNLX1VOSU5URVJSVVBUSUJMRSk7CisJCXNjaGVkdWxlX3RpbWVvdXQoSFovMjApOworCX0KKwlpZihpPT0xMCkKKwl7CisJCXByaW50ayhLRVJOX0VSUiAiaTgxMF9hdWRpbzogQUMnOTcgcmVzZXQgZmFpbGVkLlxuIik7CisJCXJldHVybiAwOworCX0KKworCXNldF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JLyoKKwkgKiAgICBUaGVuIHRyeSB0byBkZXRlY3Qgd2l0aCB0aGUgb2xkIHBhc3N3b3JkCisJICovCisJYm9hcmRfdHlwZSA9IEM5MjQ7CisKKwlEREIocHJpbnRrKCJEZXRlY3QgdXNpbmcgcGFzc3dvcmQgPSAweEU1XG4iKSk7CisJCisJaWYgKGRldGVjdF9tYWQxNigpKSB7CisJCXJldHVybiAxOworCX0KKwkKKwlib2FyZF90eXBlID0gQzkyODsKKworCUREQihwcmludGsoIkRldGVjdCB1c2luZyBwYXNzd29yZCA9IDB4RTJcbiIpKTsKKworCWlmIChkZXRlY3RfbWFkMTYoKSkKKwl7CisJCXVuc2lnbmVkIGNoYXIgbW9kZWw7CisKKwkJaWYgKCgobW9kZWwgPSBtYWRfcmVhZChNQzNfUE9SVCkpICYgMHgwMykgPT0gMHgwMykgeworCQkJRERCKHByaW50aygibWFkMTYuYzogTW96YXJ0IGRldGVjdGVkXG4iKSk7CisJCQlib2FyZF90eXBlID0gTU9aQVJUOworCQl9IGVsc2UgeworCQkJRERCKHByaW50aygibWFkMTYuYzogODJDOTI4IGRldGVjdGVkPz8/XG4iKSk7CisJCQlib2FyZF90eXBlID0gQzkyODsKKwkJfQorCQlyZXR1cm4gMTsKKwl9CisKKwlib2FyZF90eXBlID0gQzkyOTsKKworCUREQihwcmludGsoIkRldGVjdCB1c2luZyBwYXNzd29yZCA9IDB4RTNcbiIpKTsKKworCWlmIChkZXRlY3RfbWFkMTYoKSkKKwl7CisJCUREQihwcmludGsoIm1hZDE2LmM6IDgyQzkyOSBkZXRlY3RlZFxuIikpOworCQlyZXR1cm4gMTsKKwl9CisKKwlpZiAoaW5iKFBBU1NXRF9SRUcpICE9IDB4ZmYpCisJCXJldHVybiAwOworCisJLyoKKwkgKiBGaXJzdCByZWxvY2F0ZSBNQyMgcmVnaXN0ZXJzIHRvIDB4ZTBlLzB4ZTBmLCBkaXNhYmxlIHBhc3N3b3JkIAorCSAqLworCisJb3V0YigoMHhFNCksIFBBU1NXRF9SRUcpOworCW91dGIoKDB4ODApLCBQQVNTV0RfUkVHKTsKKworCWJvYXJkX3R5cGUgPSBDOTMwOworCisJRERCKHByaW50aygiRGV0ZWN0IHVzaW5nIHBhc3N3b3JkID0gMHhFNFxuIikpOworCisJZm9yIChpID0gMHhmOGQ7IGkgPD0gMHhmOTM7IGkrKykKKwkJRERCKHByaW50aygicG9ydCAlMDN4ID0gJTAyeFxuIiwgaSwgbWFkX3JlYWQoaSkpKTsKKworICAgICAgICBpZihkZXRlY3RfbWFkMTYoKSkgeworCQlEREIocHJpbnRrKCJtYWQxNi5jOiA4MkM5MzAgZGV0ZWN0ZWRcbiIpKTsKKwkJcmV0dXJuIDE7CisJfQorCisJLyogVGhlIEM5MzEgaGFzIHRoZSBwYXNzd29yZCByZWcgYXQgRjhEICovCisJb3V0YigoMHhFNCksIDB4RjhEKTsKKwlvdXRiKCgweDgwKSwgMHhGOEQpOworCUREQihwcmludGsoIkRldGVjdCB1c2luZyBwYXNzd29yZCA9IDB4RTQgZm9yIEM5MzFcbiIpKTsKKworCWlmIChkZXRlY3RfbWFkMTYoKSkgeworCQlyZXR1cm4gMTsKKwl9CisKKwlib2FyZF90eXBlID0gQzkyNDsKKwljOTI0cG5wKys7CisJRERCKHByaW50aygiRGV0ZWN0IHVzaW5nIHBhc3N3b3JkID0gMHhFNSAoYWdhaW4pLCBwb3J0IG9mZnNldCAtMHg4MFxuIikpOworCWlmIChkZXRlY3RfbWFkMTYoKSkgeworCQlEREIocHJpbnRrKCJtYWQxNi5jOiA4MkM5MjQgUG5QIGRldGVjdGVkXG4iKSk7CisJCXJldHVybiAxOworCX0KKwkKKwljOTI0cG5wPTA7CisKKwlyZXR1cm4gMDsKK30KKworc3RhdGljIGludCBfX2luaXQgcHJvYmVfbWFkMTYoc3RydWN0IGFkZHJlc3NfaW5mbyAqaHdfY29uZmlnKQoreworCWludCBpOworCXVuc2lnbmVkIGNoYXIgdG1wOworCXVuc2lnbmVkIGNoYXIg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ICovCisJb3V0YigweEZGLCBjLT5pb2Jhc2UrMHgxQSk7CisJCQorCS8qCisJICoJVXBkYXRlIHRoZSBwb2ludGVycyBmb3IgYWxsIEFQVSdzIHdlIGFyZSBydW5uaW5nLgorCSAqLworCWZvcihpPTA7aTxOUl9EU1BTO2krKykKKwl7CisJCXM9JmMtPmNoYW5uZWxzW2ldOworCQlpZihzLT5kZXZfYXVkaW8gPT0gLTEpCisJCQlicmVhazsKKwkJc3Bpbl9sb2NrKCZzLT5sb2NrKTsKKwkJZXNzX3VwZGF0ZV9wdHIocyk7CisJCXNwaW5fdW5sb2NrKCZzLT5sb2NrKTsKKwl9CisJcmV0dXJuIElSUV9IQU5ETEVEOworfQorCisKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworCitzdGF0aWMgY29uc3QgY2hhciBpbnZhbGlkX21hZ2ljW10gPSBLRVJOX0NSSVQgIm1hZXN0cm86IGludmFsaWQgbWFnaWMgdmFsdWUgaW4gJXNcbiI7CisKKyNkZWZpbmUgVkFMSURBVEVfTUFHSUMoRk9PLE1BRykgICAgICAgICAgICAgICAgICAgICAgICAgXAorKHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJaWYgKCEoRk9PKSB8fCAoRk9PKS0+bWFnaWMgIT0gTUFHKSB7IFwKKwkJcHJpbnRrKGludmFsaWRfbWFnaWMsX19GVU5DVElPTl9fKTsgICAgICAgICAgICBcCisJCXJldHVybiAtRU5YSU87ICAgICAgICAgICAgICAgICAgICBcCisJfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorfSkKKworI2RlZmluZSBWQUxJREFURV9TVEFURShhKSBWQUxJREFURV9NQUdJQyhhLEVTU19TVEFURV9NQUdJQykKKyNkZWZpbmUgVkFMSURBVEVfQ0FSRChhKSBWQUxJREF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AgICAgICByZXR1cm4gLUVJTlZBTDsKKworICAgICAgICBpZiAoX0lPQ19ESVIoY21kKSA9PSBfSU9DX1JFQUQpIHsKKyAgICAgICAgICAgICAgICBzd2l0Y2ggKF9JT0NfTlIoY21kKSkgeworICAgICAgICAgICAgICAgIGNhc2UgU09VTkRfTUlYRVJfUkVDU1JDOiAvKiBnaXZlIHRoZW0gdGhlIGN1cnJlbnQgcmVjb3JkIHNvdXJjZSAqLworCisJCQlpZighY2FyZC0+bWl4LnJlY21hc2tfaW8pIHsKKwkJCQl2YWwgPSAwOworCQkJfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcGluX2xvY2tfaXJxc2F2ZSgmY2FyZC0+bG9jaywgZmxhZ3MpOworCQkJCXZhbCA9IGNhcmQtPm1peC5yZWNtYXNrX2lvKGNhcmQsMSwwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcGluX3VubG9ja19pcnFyZXN0b3JlKCZjYXJkLT5sb2NrLCBmbGFncyk7CisJCQl9CisJCQlicmVhazsKKwkJCQorICAgICAgICAgICAgICAgIGNhc2UgU09VTkRfTUlYRVJfREVWTUFTSzogLyogZ2l2ZSB0aGVtIHRoZSBzdXBwb3J0ZWQgbWl4ZXJzICovCisJCQl2YWwgPSBjYXJkLT5taXguc3VwcG9ydGVkX21peGVyczsKKwkJCWJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBTT1VORF9NSVhFUl9SRUNNQVNLOiAvKiBBcmcgY29udGFpbnMgYSBiaXQgZm9yIGVhY2ggc3VwcG9ydGVkIHJlY29yZGluZyBzb3VyY2UgKi8KKwkJCXZhbCA9IGNhcmQtPm1peC5yZWNvcmRfc291cmNlczsKKwkJCWJyZWFrOworCQkJCisgICAgICAgICAgICAgICAgY2FzZSBTT1VORF9NSVhFUl9TVEVSRU9ERVZTOiAvKiBNaXhlciBjaGFubmVscyBzdXBwb3J0aW5nIHN0ZXJlbyAqLworCQkJdmFsID0g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VhazsKKwkJaWYgKHNpZ25hbF9wZW5kaW5nKGN1cnJlbnQpKQorICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgaWYgKG5vbmJsb2NrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVfd2FpdF9xdWV1ZSgmcy0+ZG1hX2RhYy53YWl0LCAmd2FpdCk7CisJCQljdXJyZW50LT5zdGF0ZSA9IFRBU0tfUlVOTklORzsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAtRUJVU1k7CisgICAgICAgICAgICAgICAgfQorCQl0bW8gPSAoY291bnQgKiBIWikgLyBzLT5yYXRlZGFjOworCQl0bW8gPj49IHNhbXBsZV9zaGlmdFsocy0+Zm10ID4+IEVTU19EQUNfU0hJRlQpICYgRVNTX0ZNVF9NQVNLXTsKKwkJLyogWFhYIHRoaXMgaXMganVzdCBicm9rZW4uICBzb21lb25lIGlzIHdha2luZyB1cyB1cCBhbG90LCBvciBzY2hlZHVsZV90aW1lb3V0IGlzIGJyb2tlbi4KKwkJCW9yIHNvbWV0aGluZy4gIHdobyBjYXJlcy4gLSB6YWNoICovCisJCWlmICghc2NoZWR1bGVfdGltZW91dCh0bW8gPyB0bW8gOiAxKSAmJiB0bW8pCisJCQlNX3ByaW50ayhLRVJOX0RFQlVHICJtYWVzdHJvOiBkbWEgdGltZWQgb3V0Pz8gJWxkXG4iLGppZmZpZXMpOworICAgICAgICB9CisgICAgICAgIHJlbW92ZV93YWl0X3F1ZXVlKCZzLT5kbWFfZGFjLndhaXQsICZ3YWl0KTsKKwljdXJyZW50LT5zdGF0ZSA9IFRBU0tfUlVOTklORzsKKyAgICAgICAgaWYgKHNpZ25hbF9wZW5kaW5nKGN1cnJlbnQpKQorICAgICAgICAgICAgICAgIHJldHVybiAtRVJFU1RBUlRTWVM7CisgICAgICAgIHJldHVybiAwOworfQorCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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gICAgICAgIHZvaWQgKnJhd2J1ZjsKKyAgICAgICAgdW5zaWduZWQgYnVmb3JkZXI7CisgICAgICAgIHVuc2lnbmVkIG51bWZyYWc7CisgICAgICAgIHVuc2lnbmVkIGZyYWdzaGlmdDsKKyAgICAgICAgdW5zaWduZWQgaHdwdHIsIHN3cHRyOworICAgICAgICB1bnNpZ25lZCB0b3RhbF9ieXRlczsKKyAgICAgICAgaW50IGNvdW50OworICAgICAgICB1bnNpZ25lZCBlcnJvcjsgLyogb3Zlci91bmRlcnJ1biAqLworICAgICAgICB3YWl0X3F1ZXVlX2hlYWRfdCB3YWl0OworICAgICAgICAvKiByZWR1bmRhbnQsIGJ1dCBtYWtlcyBjYWxjdWxhdGlvbnMgZWFzaWVyICovCisgICAgICAgIHVuc2lnbmVkIGZyYWdzaXplOworICAgICAgICB1bnNpZ25lZCBkbWFzaXplOworICAgICAgICB1bnNpZ25lZCBmcmFnc2FtcGxlczsKKyAgICAgICAgLyogT1NTIHN0dWZmICovCisgICAgICAgIHVuc2lnbmVkIG1hcHBlZDoxOworICAgICAgICB1bnNpZ25lZCByZWFkeToxOyAgICAKKyAgICAgICAgdW5zaWduZWQgZW5kY2xlYXJlZDoxOworICAgICAgICB1bnNpZ25lZCBvc3NmcmFnc2hpZnQ7CisgICAgICAgIGludCBvc3NtYXhmcmFnczsKKyAgICAgICAgdW5zaWduZWQgc3ViZGl2aXNpb247CisgICAgICAgIC8qIG5ldyBpbiBtMyAqLworICAgICAgICBpbnQgbWl4ZXJfaW5kZXgsIGRtYV9pbmRleCwgbXNyY19pbmRleCwgYWRjMV9pbmRleDsKKyAgICAgICAgaW50IGluX2xpc3RzOworICAgICAgICAvKiAyLjQuLiAqLworICAgICAgICBkbWFfYWRkcl90IGhhbmRsZTsKKworICAgIH0gZG1hX2RhYywgZG1hX2FkYzsKK307CisgICAgCitzdHJ1Y3QgbTNfY2FyZCB7CisgICAgdW5zaWduZWQgaW50IG1hZ2ljOworCisgICAgc3RydWN0IG0z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1heC4KKyAqLworI2RlZmluZSBBUkJfVk9MVU1FICggMHg2ODAwICkKKworc3RhdGljIGNvbnN0IHVuc2lnbmVkIHNhbXBsZV9zaGlmdFtdID0geyAwLCAxLCAxLCAyIH07CisKK2VudW0geworICAgIEVTU19BTExFR1JPLAorICAgIEVTU19NQUVTVFJPMywKKyAgICAvKgorICAgICAqIGEgbWFlc3RybzMgd2l0aCAnaGFyZHdhcmUgc3RyYXBwaW5nJywgb25seQorICAgICAqIGZvdW5kIGluc2lkZSBFU1M/CisgICAgICovCisgICAgRVNTX01BRVNUUk8zSFcsCit9OworCitzdGF0aWMgY2hhciAqY2FyZF9uYW1lc1tdID0geworICAgIFtFU1NfQUxMRUdST10gPSAiQWxsZWdybyIsCisgICAgW0VTU19NQUVTVFJPM10gPSAiTWFlc3RybzMoaSkiLAorICAgIFtFU1NfTUFFU1RSTzNIV10gPSAiTWFlc3RybzMoaSlodyIKK307CisKKyNpZm5kZWYgUENJX1ZFTkRPUl9FU1MKKyNkZWZpbmUgUENJX1ZFTkRPUl9FU1MgICAgICAweDEyNUQKKyNlbmRpZgorCisjZGVmaW5lIE0zX0RFVklDRShERVYsIFRZUEUpCQkJXAorewkJCQkJCVwKKy52ZW5kb3IJICAgICA9IFBDSV9WRU5ET1JfRVNTLAkJCVwKKy5kZXZpY2UJICAgICA9IERFViwJCQkJXAorLnN1YnZlbmRvciAgID0gUENJX0FOWV9JRCwJCQlcCisuc3ViZGV2aWNlICAgPSBQQ0lfQU5ZX0lELAkJCVwKKy5jbGFzcwkgICAgID0gUENJX0NMQVNTX01VTFRJTUVESUFfQVVESU8gPDwgOCwJXAorLmNsYXNzX21hc2sgID0gMHhmZmZmIDw8IDgsCQkJXAorLmRyaXZlcl9kYXRhID0gVFlQRSwJCQkJXAorfQorCitzdGF0aWMgc3RydWN0IHBjaV9kZXZpY2VfaWQgbTNfaWRfdGFibGVbXSA9IHsKKyAgICBNM19ERVZJQ0UoMHgxOTg4LCBFU1NfQUxMRUdSTyksCisgICAgTTNfREVWSUNFKDB4MTk5OCwgRVNTX01BRVNUUk8zKSwKKyAgICBNM19ERVZJQ0UoMHgxOTlhLCBFU1NfTUFFU1RSTzNIVyksCisgICAgezAsfQorfTsKKworTU9EVUxFX0RFVklDRV9UQUJMRSAocGNpLCBtM19pZF90YWJsZSk7CisKKy8qCisgKiByZXBvcnRzIHNlZW0gdG8gaW5kaWNhdGUgdGhhdCB0aGUgbTMgaXMgbGltaXRlZAorICogdG8gMjhiaXQgYnVzIGFkZHJlc3Nlcy4gIGFhYWFyZ2dnaC4uLgorICovCisjZGVmaW5lIE0zX1BDSV9ETUFfTUFTSyAweDBmZmZmZmZmCisKK3N0YXRpYyB1bnNpZ25lZCAKK2xkMih1bnNpZ25lZCBpbnQgeCkKK3sKKyAgICB1bnNpZ25lZCByID0gMDsKKyAgICAKKyAgICBpZiAoeCA+PSAweDEwMDAwKSB7CisgICAgICAgIHggPj49IDE2OworICAgICAgICByICs9IDE2OworICAgIH0KKyAgICBpZiAoeCA+PSAweDEwMCkgeworICAgICAgICB4ID4+PSA4OworICAgICAgICByICs9IDg7CisgICAgfQorICAgIGlmICh4ID49IDB4MTApIHsKKyAgICAgICAgeCA+Pj0gNDsKKyAgICAgICAgciArPSA0OworICAgIH0KKyAgICBpZiAoeCA+PSA0KSB7CisgICAgICAgIHggPj49IDI7CisgICAgICAgIHIgKz0gMjsKKyAgICB9CisgICAgaWYgKHggPj0gMikKKyAgICAgICAgcisrOworICAgIHJldHVybiByOworfQorCitzdGF0aWMgc3RydWN0IG0zX2NhcmQgKmRldnM7CisKKy8qCisgKiBJJ20gbm90IHZlcnkgZ29vZCBhdCBsYXlpbmcgb3V0IGZ1bmN0aW9ucyBpbiBhIGZpbGUgOikKKyAqLworc3RhdGljIGludCBtM19ub3RpZmllcihzdHJ1Y3Qgbm90aWZpZXJfYmxvY2sgKm5iLCB1bnNpZ25lZCBsb25nIGV2ZW50LCB2b2lkICpidWYpOworc3RhdGljIGludCBtM19zdXNw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BLAorICAgICAgICAgICAgICAgIGxpc3QtPm1lbV9hZGRyICsgaW5kZXgsCisgICAgICAgICAgICAgICAgdmFsKTsKKyAgICB9CisKKyAgICBtM19hc3NwX3dyaXRlKGNhcmQsIE1FTVRZUEVfSU5URVJOQUxfREFUQSwKKyAgICAgICAgICAgIGxpc3QtPm1lbV9hZGRyICsgbGFzdGluZGV4LAorICAgICAgICAgICAgMCk7CisKKyAgICBsaXN0LT5jdXJsZW4tLTsKK30KKworc3RhdGljIHZvaWQgc2V0X2ZtdChzdHJ1Y3QgbTNfc3RhdGUgKnMsIHVuc2lnbmVkIGNoYXIgbWFzaywgdW5zaWduZWQgY2hhciBkYXRhKQoreworICAgIGludCB0bXA7CisKKyAgICBzLT5mbXQgPSAocy0+Zm10ICYgbWFzaykgfCBkYXRhOworCisgICAgdG1wID0gKHMtPmZtdCA+PiBFU1NfREFDX1NISUZUKSAmIEVTU19GTVRfTUFTSzsKKworICAgIC8qIHdyaXRlIHRvICdtb25vJyB3b3JkICovCisgICAgbTNfYXNzcF93cml0ZShzLT5jYXJkLCBNRU1UWVBFX0lOVEVSTkFMX0RBVEEsCisgICAgICAgICAgICBzLT5kYWNfaW5zdC5kYXRhICsgU1JDM19ESVJFQ1RJT05fT0ZGU0VUICsgMSwgCisgICAgICAgICAgICAodG1wICYgRVNTX0ZNVF9TVEVSRU8pID8gMCA6IDEpOworICAgIC8qIHdyaXRlIHRvICc4Yml0JyB3b3JkICovCisgICAgbTNfYXNzcF93cml0ZShzLT5jYXJkLCBNRU1UWVBFX0lOVEVSTkFMX0RBVEEsCisgICAgICAgICAgICBzLT5kYWNfaW5zdC5kYXRhICsgU1JDM19ESVJFQ1RJT05fT0ZGU0VUICsgMiwgCisgICAgICAgICAgICAodG1wICYgRVNTX0ZNVF8xNkJJVCkgPyAwIDogMSk7CisKKyAgICB0bXAgPSAocy0+Zm10ID4+IEVTU19BRENfU0hJRlQpICYgRVNTX0ZNVF9NQVNLOworCisgICAgLyogd3JpdGUg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F0ZSkKK3sKKyAgICB1MzIgZnJlcTsKKworICAgIGlmIChyYXRlID4gNDgwMDApCisgICAgICAgIHJhdGUgPSA0ODAwMDsKKyAgICBpZiAocmF0ZSA8IDgwMDApCisgICAgICAgIHJhdGUgPSA4MDAwOworCisgICAgcy0+cmF0ZWFkYyA9IHJhdGU7CisKKyAgICBmcmVxID0gKChyYXRlIDw8IDE1KSArIDI0MDAwICkgLyA0ODAwMDsKKyAgICBpZihmcmVxKSAKKyAgICAgICAgZnJlcS0tOworCisgICAgbTNfYXNzcF93cml0ZShzLT5jYXJkLCBNRU1UWVBFX0lOVEVSTkFMX0RBVEEsCisgICAgICAgICAgICBzLT5hZGNfaW5zdC5kYXRhICsgQ0RBVEFfRlJFUVVFTkNZLAorICAgICAgICAgICAgZnJlcSk7Cit9CisKK3N0YXRpYyB2b2lkIGluY190aW1lcl91c2VycyhzdHJ1Y3QgbTNfY2FyZCAqY2FyZCkKK3sKKyAgICB1bnNpZ25lZCBsb25nIGZsYWdzOworCisgICAgc3Bpbl9sb2NrX2lycXNhdmUoJmNhcmQtPmxvY2ssIGZsYWdzKTsKKyAgICAKKyAgICBjYXJkLT50aW1lcl91c2VycysrOworICAgIERQUklOVEsoRFBTWVMsICJpbmMgdGltZXIgdXNlcnMgbm93ICVkXG4iLAorICAgICAgICAgICAgY2FyZC0+dGltZXJfdXNlcnMpOworICAgIGlmKGNhcmQtPnRpbWVyX3VzZXJzICE9IDEpIAorICAgICAgICBnb3RvIG91dDsKKworICAgIF9fbTNfYXNzcF93cml0ZShjYXJkLCBNRU1UWVBFX0lOVEVSTkFMX0RBVEEsCisgICAgICAgIEtEQVRBX1RJTUVSX0NPVU5UX1JFTE9BRCwKKyAgICAgICAgIDI0MCApIDsKKworICAgIF9fbTNfYXNzcF93cml0ZShjYXJkLCBNRU1UWVBFX0lOVEVSTkFMX0RBVEEsCisgICAgICAgIEtEQVRBX1RJTUVSX0NPVU5UX0NVUlJFTlQsCisgICAgICAgICAyNDAgKSA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UFDX1BBR0UzX1NFTEVDVE9SICsgRE1BQ19CTE9DS0ZfU0VMRUNUT1IpOworCisgICAgLyoKKyAgICAgKiBzZXQgYW4gYXJtbG9hZCBvZiBzdGF0aWMgaW5pdGlhbGl6ZXJzCisgICAgICovCisgICAgZm9yKGkgPSAwIDsgaSA8IChzaXplb2YocHYpIC8gc2l6ZW9mKHB2WzBdKSkgOyBpKyspIAorICAgICAgICBtM19hc3NwX3dyaXRlKHMtPmNhcmQsIE1FTVRZUEVfSU5URVJOQUxfREFUQSwKKyAgICAgICAgICAgIHMtPmRhY19pbnN0LmRhdGEgKyBwdltpXS5hZGRyLCBwdltpXS52YWwpOworCisgICAgLyogCisgICAgICogcHV0IHVzIGluIHRoZSBsaXN0cyBpZiB3ZSdyZSBub3QgYWxyZWFkeSB0aGVyZQorICAgICAqLworCisgICAgaWYoZGItPmluX2xpc3RzID09IDApIHsKKworICAgICAgICBkYi0+bXNyY19pbmRleCA9IG0zX2FkZF9saXN0KHMtPmNhcmQsICZzLT5jYXJkLT5tc3JjX2xpc3QsIAorICAgICAgICAgICAgICAgIHMtPmRhY19pbnN0LmRhdGEgPj4gRFBfU0hJRlRfQ09VTlQpOworCisgICAgICAgIGRiLT5kbWFfaW5kZXggPSBtM19hZGRfbGlzdChzLT5jYXJkLCAmcy0+Y2FyZC0+ZG1hX2xpc3QsIAorICAgICAgICAgICAgICAgIHMtPmRhY19pbnN0LmRhdGEgPj4gRFBfU0hJRlRfQ09VTlQpOworCisgICAgICAgIGRiLT5taXhlcl9pbmRleCA9IG0zX2FkZF9saXN0KHMtPmNhcmQsICZzLT5jYXJkLT5taXhlcl9saXN0LCAKKyAgICAgICAgICAgICAgICBzLT5kYWNfaW5zdC5kYXRhID4+IERQX1NISUZUX0NPVU5UKTsKKworICAgICAgICBkYi0+aW5fbGlzdHMgPSAxOworICAgIH0KKworICAgIHNldF9kYWNfcmF0ZShzLHJhdGUpOworICAgIHN0YXJ0X2RhYyhzKTsKK30KKworLyoKKyA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Vuc2lnbmVkIGh3cHRyOworICAgIGludCBkaWZmOworCisgICAgLyogdXBkYXRlIEFEQyBwb2ludGVyICovCisgICAgaWYgKHMtPmRtYV9hZGMucmVhZHkpIHsKKyAgICAgICAgaHdwdHIgPSBnZXRfZG1hYyhzKSAlIHMtPmRtYV9hZGMuZG1hc2l6ZTsKKyAgICAgICAgZGlmZiA9IChzLT5kbWFfYWRjLmRtYXNpemUgKyBod3B0ciAtIHMtPmRtYV9hZGMuaHdwdHIpICUgcy0+ZG1hX2FkYy5kbWFzaXplOworICAgICAgICBzLT5kbWFfYWRjLmh3cHRyID0gaHdwdHI7CisgICAgICAgIHMtPmRtYV9hZGMudG90YWxfYnl0ZXMgKz0gZGlmZjsKKyAgICAgICAgcy0+ZG1hX2FkYy5jb3VudCArPSBkaWZmOworICAgICAgICBpZiAocy0+ZG1hX2FkYy5jb3VudCA+PSAoc2lnbmVkKXMtPmRtYV9hZGMuZnJhZ3NpemUpIAorICAgICAgICAgICAgd2FrZV91cCgmcy0+ZG1hX2FkYy53YWl0KTsKKyAgICAgICAgaWYgKCFzLT5kbWFfYWRjLm1hcHBlZCkgeworICAgICAgICAgICAgaWYgKHMtPmRtYV9hZGMuY291bnQgPiAoc2lnbmVkKShzLT5kbWFfYWRjLmRtYXNpemUgLSAoKDMgKiBzLT5kbWFfYWRjLmZyYWdzaXplKSA+PiAxKSkpIHsKKyAgICAgICAgICAgICAgICBzdG9wX2FkYyhzKTsgCisgICAgICAgICAgICAgICAgLyogYnJ1dGUgZm9yY2UgZXZlcnlvbmUgYmFjayBpbiBzeW5jLCBzaWdoICovCisgICAgICAgICAgICAgICAgcy0+ZG1hX2FkYy5jb3VudCA9IDA7CisgICAgICAgICAgICAgICAgcy0+ZG1hX2FkYy5zd3B0ciA9IDA7CisgICAgICAgICAgICAgICAgcy0+ZG1hX2FkYy5od3B0ciA9IDA7CisgICAgICAgICAgICAgICAgcy0+ZG1hX2FkYy5lcnJvcisrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIC8qIHVwZGF0ZSBEQUMgcG9pbnRlciAqLworICAgIGlmIChzLT5kbWFfZGFjLnJlYWR5KSB7CisgICAgICAgIGh3cHRyID0gZ2V0X2RtYWEocykgJSBzLT5kbWFfZGFjLmRtYXNpemU7IAorICAgICAgICBkaWZmID0gKHMtPmRtYV9kYWMuZG1hc2l6ZSArIGh3cHRyIC0gcy0+ZG1hX2RhYy5od3B0cikgJSBzLT5kbWFfZGFjLmRtYXNpemU7CisKKyAgICAgICAgRFBSSU5USyhEUElOVCwidXBkYXRpbmcgZGFjOiBod3B0cjogJTZkIGRpZmY6ICU2ZCBjb3VudDogJTZkXG4iLAorICAgICAgICAgICAgICAgIGh3cHRyLGRpZmYscy0+ZG1hX2RhYy5jb3VudCk7CisKKyAgICAgICAgcy0+ZG1hX2RhYy5od3B0ciA9IGh3cHRyOworICAgICAgICBzLT5kbWFfZGFjLnRvdGFsX2J5dGVzICs9IGRpZmY7CisKKyAgICAgICAgaWYgKHMtPmRtYV9kYWMubWFwcGVkKSB7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIHMtPmRtYV9kYWMuY291bnQgKz0gZGlmZjsKKyAgICAgICAgICAgIGlmIChzLT5kbWFfZGFjLmNvdW50ID49IChzaWduZWQpcy0+ZG1hX2RhYy5mcmFnc2l6ZSkgeworICAgICAgICAgICAgICAgIHdha2VfdXAoJnMtPmRtYV9kYWMud2FpdCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisKKyAgICAgICAgICAgIHMtPmRtYV9kYWMuY291bnQgLT0gZGlmZjsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgaWYgKHMtPmRtYV9kYWMuY291bnQgPD0gMCkgeworICAgICAgICAgICAgICAgIERQUklOVEsoRFBDUkFQLCJ1bmRlcmZsb3chIGRpZmY6ICVkICgweCV4KSBjb3VudDogJWQgKDB4JXgpIGh3OiAlZCAoMHgleCkgc3c6ICVkICgweCV4KVxuIiwgCisgICAgICAgICAgICAgICAgICAgICAgICBkaWZmLCBkaWZmLCAKKyAgICAgICAgICAgICAgICAgICAgICAgIHMtPmRtYV9kYWMuY291bnQsIAorICAgICAgICAgICAgICAgICAgICAgICAgcy0+ZG1hX2RhYy5jb3VudCwgCisgICAgICAgICAgICAgICAgICAgIGh3cHRyLCBod3B0ciwKKyAgICAgICAgICAgICAgICAgICAgcy0+ZG1hX2RhYy5zd3B0ciwKKyAgICAgICAgICAgICAgICAgICAgcy0+ZG1hX2RhYy5zd3B0cik7CisgICAgICAgICAgICAgICAgc3RvcF9kYWMocyk7CisgICAgICAgICAgICAgICAgLyogYnJ1dGUgZm9yY2UgZXZlcnlvbmUgYmFjayBpbiBzeW5jLCBzaWdoICovCisgICAgICAgICAgICAgICAgcy0+ZG1hX2RhYy5jb3VudCA9IDA7IAorICAgICAgICAgICAgICAgIHMtPmRtYV9kYWMuc3dwdHIgPSBod3B0cjsgCisgICAgICAgICAgICAgICAgcy0+ZG1hX2RhYy5lcnJvcisrOworICAgICAgICAgICAgfSBlbHNlIGlmIChzLT5kbWFfZGFjLmNvdW50IDw9IChzaWduZWQpcy0+ZG1hX2RhYy5mcmFnc2l6ZSAmJiAhcy0+ZG1hX2RhYy5lbmRjbGVhcmVkKSB7CisgICAgICAgICAgICAgICAgY2xlYXJfYWR2YW5jZShzKTsKKyAgICAgICAgICAgICAgICBzLT5kbWFfZGFjLmVuZGNsZWFyZWQgPSAxOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHMtPmRtYV9kYWMuY291bnQgKyAoc2lnbmVkKXMtPmRtYV9kYWMuZnJhZ3NpemUgPD0gKHNpZ25lZClzLT5kbWFfZGFjLmRtYXNpemUpIHsKKyAgICAgICAgICAgICAgICB3YWtlX3VwKCZzLT5kbWFfZGFjLndhaXQpOworICAgICAgICAgICAgICAgIERQUklOVEsoRFBJTlQsIndha2luZyB1cCBEQUMgY291bnQ6ICVkIHN3OiAlZCBodzogJWRcbiIsCisgICAgICAgICAgIC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ICAgICBvdXRiKCBEU1AySE9TVF9SRVFfVElNRVIsIGMtPmlvYmFzZSArIEFTU1BfSE9TVF9JTlRfU1RBVFVTKTsKKyAgICAgICAgICAgICAgICAvKiB1cGRhdGUgYWRjL2RhYyBpbmZvIGlmIGl0IHdhcyBhIHRpbWVyIGludCAqLworICAgICAgICAgICAgICAgIHNwaW5fbG9jaygmYy0+bG9jayk7CisgICAgICAgICAgICAgICAgbTNfdXBkYXRlX3B0cihzKTsKKyAgICAgICAgICAgICAgICBzcGluX3VubG9jaygmYy0+bG9jayk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKiBYWFggaXMgdGhpcyBuZWVkZWQ/ICovCisgICAgaWYoc3RhdHVzICYgMHg0MCkgCisgICAgICAgIG91dGIoMHg0MCwgYy0+aW9iYXNlKzB4MUEpOworICAgIHJldHVybiBJUlFfSEFORExFRDsKK30KKworCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKworc3RhdGljIGNvbnN0IGNoYXIgaW52YWxpZF9tYWdpY1tdID0gS0VSTl9DUklUIFBGWCAiaW52YWxpZCBtYWdpYyB2YWx1ZSBpbiAlc1xuIjsKKworI2RlZmluZSBWQUxJREFURV9NQUdJQyhGT08sTUFHKSAgICAgICAgICAgICAgICAgICAgICAgICBcCisoeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICBpZiAoIShGT08pIHx8IChGT08pLT5tYWdpYyAhPSBNQUcpIHsgXAorICAgICAgICBwcmludGsoaW52YWxpZF9tYWdpYyxfX0ZVTkNUSU9OX18pOyAgICAgICAgICAgIFwKKyAgICAgICAgcmV0dXJuIC1FTlhJTzsgICAgICAgICAgICAgICAgICAgIFwKKyAgICB9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCit9KQorCisjZGVmaW5lIFZBTElEQVRFX1NUQVRFKGEpIFZBTElEQVRFX01BR0lDKGEsTTNfU1RBVEVfTUFHSUMpCisjZGVmaW5lIFZBTElEQVRFX0NBUkQoYSkgVkFMSURBVEVfTUFHSUMoYSxNM19DQVJEX01BR0lDKQorCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKworc3RhdGljIGludCBkcmFpbl9kYWMoc3RydWN0IG0zX3N0YXRlICpzLCBpbnQgbm9uYmxvY2spCit7CisgICAgREVDTEFSRV9XQUlUUVVFVUUod2FpdCxjdXJyZW50KTsKKyAgICB1bnNpZ25lZCBsb25nIGZsYWdzOworICAgIGludCBjb3VudDsKKyAgICBzaWduZWQgbG9uZyB0bW87CisKKyAgICBpZiAocy0+ZG1hX2RhYy5tYXBwZWQgfHwgIXMtPmRtYV9kYWMucmVhZHkpCisgICAgICAgIHJldHVybiAwOworICAgIHNldF9jdXJyZW50X3N0YXRlKFRBU0tfSU5URVJSVVBUSUJMRSk7CisgICAgYWRkX3dhaXRfcXVldWUoJnMtPmRtYV9kYWMud2FpdCwgJndhaXQpOworICAgIGZvciAoOzspIHsKKyAgICAgICAgc3Bpbl9sb2NrX2lycXNhdmUoJnMtPmNhcmQtPmxvY2ssIGZsYWdzKTsKKyAgICAgICAgY291bnQgPSBzLT5kbWFfZGFjLmNvdW50OworICAgICAgICBzcGluX3VubG9ja19pcnFyZXN0b3JlKCZzLT5jYXJkLT5sb2NrLCBmbGFncyk7CisgICAgICAgIGlmIChjb3VudCA8PSAwKQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGlmIChzaWduYWxfcGVuZGluZyhjdXJyZW50KSkKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBpZiAobm9uYmxvY2spIHsKKyAgICAgICAgICAgIHJlbW92ZV93YWl0X3F1ZXVlKCZzLT5k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plX3QgcmV0OworICAgIHVuc2lnbmVkIGxvbmcgZmxhZ3M7CisgICAgdW5zaWduZWQgc3dwdHI7CisgICAgaW50IGNudDsKKyAgICAKKyAgICBWQUxJREFURV9TVEFURShzKTsKKyAgICBpZiAocy0+ZG1hX2FkYy5tYXBwZWQpCisgICAgICAgIHJldHVybiAtRU5YSU87CisgICAgaWYgKCFzLT5kbWFfYWRjLnJlYWR5ICYmIChyZXQgPSBwcm9nX2RtYWJ1ZihzLCAxKSkpCisgICAgICAgIHJldHVybiByZXQ7CisgICAgaWYgKCFhY2Nlc3Nfb2soVkVSSUZZX1dSSVRFLCBidWZmZXIsIGNvdW50KSkKKyAgICAgICAgcmV0dXJuIC1FRkFVTFQ7CisgICAgcmV0ID0gMDsKKworICAgIHNwaW5fbG9ja19pcnFzYXZlKCZzLT5jYXJkLT5sb2NrLCBmbGFncyk7CisKKyAgICB3aGlsZSAoY291bnQgPiAwKSB7CisgICAgICAgIGludCB0aW1lZF9vdXQ7CisKKyAgICAgICAgc3dwdHIgPSBzLT5kbWFfYWRjLnN3cHRyOworICAgICAgICBjbnQgPSBzLT5kbWFfYWRjLmRtYXNpemUtc3dwdHI7CisgICAgICAgIGlmIChzLT5kbWFfYWRjLmNvdW50IDwgY250KQorICAgICAgICAgICAgY250ID0gcy0+ZG1hX2FkYy5jb3VudDsKKworICAgICAgICBpZiAoY250ID4gY291bnQpCisgICAgICAgICAgICBjbnQgPSBjb3VudDsKKworICAgICAgICBpZiAoY250IDw9IDApIHsKKyAgICAgICAgICAgIHN0YXJ0X2FkYyhzKTsKKyAgICAgICAgICAgIGlmIChmaWxlLT5mX2ZsYWdzICYgT19OT05CTE9DSykgCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcmV0ID0gcmV0ID8gcmV0IDogLUVBR0FJTjsKKyAgICAgICAgICAgICAgICBnb3RvIG91dDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgc3Bpbl91bmxvY2tfaXJxcmVzdG9yZSgmcy0+Y2FyZC0+bG9jaywgZmxhZ3MpOworICAgICAgICAgICAgdGltZWRfb3V0ID0gaW50ZXJydXB0aWJsZV9zbGVlcF9vbl90aW1lb3V0KCZzLT5kbWFfYWRjLndhaXQsIEhaKSA9PSAwOworICAgICAgICAgICAgc3Bpbl9sb2NrX2lycXNhdmUoJnMtPmNhcmQtPmxvY2ssIGZsYWdzKTsKKworICAgICAgICAgICAgaWYodGltZWRfb3V0KSB7CisgICAgICAgICAgICAgICAgcHJpbnRrKCJyZWFkOiBjaGlwIGxvY2t1cD8gZG1hc3ogJXUgZnJhZ3N6ICV1IGNvdW50ICV1IGh3cHRyICV1IHN3cHRyICV1XG4iLAorICAgICAgICAgICAgICAgICAgICAgICBzLT5kbWFfYWRjLmRtYXNpemUsIHMtPmRtYV9hZGMuZnJhZ3NpemUsIHMtPmRtYV9hZGMuY291bnQsIAorICAgICAgICAgICAgICAgICAgICAgICBzLT5kbWFfYWRjLmh3cHRyLCBzLT5kbWFfYWRjLnN3cHRyKTsKKyAgICAgICAgICAgICAgICBzdG9wX2FkYyhzKTsKKyAgICAgICAgICAgICAgICBzZXRfZG1hYyhzLCB2aXJ0X3RvX2J1cyhzLT5kbWFfYWRjLnJhd2J1ZiksIHMtPmRtYV9hZGMubnVtZnJhZyA8PCBzLT5kbWFfYWRjLmZyYWdzaGlmdCk7CisgICAgICAgICAgICAgICAgcy0+ZG1hX2FkYy5jb3VudCA9IHMtPmRtYV9hZGMuaHdwdHIgPSBzLT5kbWFfYWRjLnN3cHRyID0gMDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChzaWduYWxfcGVuZGluZyhjdXJyZW50KSkgCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcmV0ID0gcmV0ID8gcmV0IDogLUVSRVNUQVJUU1lTOworICAgICAgICAgICAgICAgIGdvdG8gb3V0OworICAgICAgICAgICAgfQorICAgICAgICAgICAgY29udGludWU7CisgICAgICAgIH0KKyAgICAKKyAgICAgICAg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MubWFwcGVkKQorICAgICAgICByZXR1cm4gLUVOWElPOworICAgIGlmICghcy0+ZG1hX2RhYy5yZWFkeSAmJiAocmV0ID0gcHJvZ19kbWFidWYocywgMCkpKQorICAgICAgICByZXR1cm4gcmV0OworICAgIGlmICghYWNjZXNzX29rKFZFUklGWV9SRUFELCBidWZmZXIsIGNvdW50KSkKKyAgICAgICAgcmV0dXJuIC1FRkFVTFQ7CisgICAgcmV0ID0gMDsKKworICAgIHNwaW5fbG9ja19pcnFzYXZlKCZzLT5jYXJkLT5sb2NrLCBmbGFncyk7CisKKyAgICB3aGlsZSAoY291bnQgPiAwKSB7CisgICAgICAgIGludCB0aW1lZF9vdXQ7CisKKyAgICAgICAgaWYgKHMtPmRtYV9kYWMuY291bnQgPCAwKSB7CisgICAgICAgICAgICBzLT5kbWFfZGFjLmNvdW50ID0gMDsKKyAgICAgICAgICAgIHMtPmRtYV9kYWMuc3dwdHIgPSBzLT5kbWFfZGFjLmh3cHRyOworICAgICAgICB9CisgICAgICAgIHN3cHRyID0gcy0+ZG1hX2RhYy5zd3B0cjsKKworICAgICAgICBjbnQgPSBzLT5kbWFfZGFjLmRtYXNpemUtc3dwdHI7CisKKyAgICAgICAgaWYgKHMtPmRtYV9kYWMuY291bnQgKyBjbnQgPiBzLT5kbWFfZGFjLmRtYXNpemUpCisgICAgICAgICAgICBjbnQgPSBzLT5kbWFfZGFjLmRtYXNpemUgLSBzLT5kbWFfZGFjLmNvdW50OworCisKKyAgICAgICAgaWYgKGNudCA+IGNvdW50KQorICAgICAgICAgICAgY250ID0gY291bnQ7CisKKyAgICAgICAgaWYgKGNudCA8PSAwKSB7CisgICAgICAgICAgICBzdGFydF9kYWMocyk7CisgICAgICAgICAgICBpZiAoZmlsZS0+Zl9mbGFncyAmIE9fTk9OQkxPQ0spIHsKKyAgICAgICAgICAgICAgICBpZighcmV0KSByZXQgPSAtRUFHQUlOOworICAgICAgICAgICAgICAgIGdvdG8gb3V0OworICAgICAgICAgICAgfQorICAgICAgICAgICAgc3Bpbl91bmxvY2tfaXJxcmVzdG9yZSgmcy0+Y2FyZC0+bG9jaywgZmxhZ3MpOworICAgICAgICAgICAgdGltZWRfb3V0ID0gaW50ZXJydXB0aWJsZV9zbGVlcF9vbl90aW1lb3V0KCZzLT5kbWFfZGFjLndhaXQsIEhaKSA9PSAwOworICAgICAgICAgICAgc3Bpbl9sb2NrX2lycXNhdmUoJnMtPmNhcmQtPmxvY2ssIGZsYWdzKTsKKyAgICAgICAgICAgIGlmKHRpbWVkX291dCkgeworICAgICAgICAgICAgICAgIERQUklOVEsoRFBDUkFQLCJ3cml0ZTogY2hpcCBsb2NrdXA/IGRtYXN6ICV1IGZyYWdzeiAldSBjb3VudCAldSBod3B0ciAldSBzd3B0ciAldVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgcy0+ZG1hX2RhYy5kbWFzaXplLCBzLT5kbWFfZGFjLmZyYWdzaXplLCBzLT5kbWFfZGFjLmNvdW50LCAKKyAgICAgICAgICAgICAgICAgICAgICAgcy0+ZG1hX2RhYy5od3B0ciwgcy0+ZG1hX2RhYy5zd3B0cik7CisgICAgICAgICAgICAgICAgc3RvcF9kYWMocyk7CisgICAgICAgICAgICAgICAgc2V0X2RtYWEocywgdmlydF90b19idXMocy0+ZG1hX2RhYy5yYXdidWYpLCBzLT5kbWFfZGFjLm51bWZyYWcgPDwgcy0+ZG1hX2RhYy5mcmFnc2hpZnQpOworICAgICAgICAgICAgICAgIHMtPmRtYV9kYWMuY291bnQgPSBzLT5kbWFfZGFjLmh3cHRyID0gcy0+ZG1hX2RhYy5zd3B0ciA9IDA7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoc2lnbmFsX3BlbmRpbmcoY3VycmVudCkpIHsKKyAgICAgICAgICAgICAgICBpZiAoIXJldCkgcmV0ID0gLUVSRVNUQVJUU1lTOworICAgICAgICAgICAgICAgIGdvdG8gb3V0OworICAgICAgICAgICAgfQorICAgICAgICAgICAgY29udGludWU7CisgICAg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ICAgICAgICAgICAgICAgIG1hc2sgfD0gUE9MTE9VVCB8IFBPTExXUk5PUk07CisgICAgICAgIH0KKyAgICB9CisKKyAgICBzcGluX3VubG9ja19pcnFyZXN0b3JlKCZzLT5jYXJkLT5sb2NrLCBmbGFncyk7CisgICAgcmV0dXJuIG1hc2s7Cit9CisKK3N0YXRpYyBpbnQgbTNfbW1hcChzdHJ1Y3QgZmlsZSAqZmlsZSwgc3RydWN0IHZtX2FyZWFfc3RydWN0ICp2bWEpCit7CisgICAgc3RydWN0IG0zX3N0YXRlICpzID0gKHN0cnVjdCBtM19zdGF0ZSAqKWZpbGUtPnByaXZhdGVfZGF0YTsKKyAgICB1bnNpZ25lZCBsb25nIG1heF9zaXplLCBzaXplLCBzdGFydCwgb2Zmc2V0OworICAgIHN0cnVjdCBkbWFidWYgKmRiOworICAgIGludCByZXQgPSAtRUlOVkFMOworCisgICAgVkFMSURBVEVfU1RBVEUocyk7CisgICAgaWYgKHZtYS0+dm1fZmxhZ3MgJiBWTV9XUklURSkgeworICAgICAgICBpZiAoKHJldCA9IHByb2dfZG1hYnVmKHMsIDApKSAhPSAwKQorICAgICAgICAgICAgcmV0dXJuIHJldDsKKyAgICAgICAgZGIgPSAmcy0+ZG1hX2RhYzsKKyAgICB9IGVsc2UgCisgICAgaWYgKHZtYS0+dm1fZmxhZ3MgJiBWTV9SRUFEKSB7CisgICAgICAgIGlmICgocmV0ID0gcHJvZ19kbWFidWYocywgMSkpICE9IDApCisgICAgICAgICAgICByZXR1cm4gcmV0OworICAgICAgICBkYiA9ICZzLT5kbWFfYWRjOworICAgIH0gZWxzZSAgCisgICAgICAgIHJldHVybiAtRUlOVkFMOworCisgICAgbWF4X3NpemUgPSBkYi0+ZG1hc2l6ZTsKKworICAgIHN0YXJ0ID0gdm1hLT52bV9zdGFydDsKKyAgICBvZmZzZXQgPSAodm1hLT52bV9wZ29mZiA8PCBQQUdFX1NISUZUKTsKKyAgICBzaXplID0gdm1hLT52bV9lbmQgLSB2b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yAgICBjb3VudF9pbmZvIGNpbmZvOworICAgIGludCB2YWwsIG1hcHBlZCwgcmV0OworICAgIHVuc2lnbmVkIGNoYXIgZm10bSwgZm10ZDsKKyAgICB2b2lkIF9fdXNlciAqYXJncCA9ICh2b2lkIF9fdXNlciAqKWFyZzsKKyAgICBpbnQgX191c2VyICpwID0gYXJncDsKKworICAgIFZBTElEQVRFX1NUQVRFKHMpOworCisgICAgbWFwcGVkID0gKChmaWxlLT5mX21vZGUgJiBGTU9ERV9XUklURSkgJiYgcy0+ZG1hX2RhYy5tYXBwZWQpIHx8CisgICAgICAgICgoZmlsZS0+Zl9tb2RlICYgRk1PREVfUkVBRCkgJiYgcy0+ZG1hX2FkYy5tYXBwZWQpOworCisgICAgRFBSSU5USyhEUFNZUywibTNfaW9jdGw6IGNtZCAlZFxuIiwgY21kKTsKKworICAgIHN3aXRjaCAoY21kKSB7CisgICAgY2FzZSBPU1NfR0VUVkVSU0lPTjoKKyAgICAgICAgcmV0dXJuIHB1dF91c2VyKFNPVU5EX1ZFUlNJT04sIHApOworCisgICAgY2FzZSBTTkRDVExfRFNQX1NZTkM6CisgICAgICAgIGlmIChmaWxlLT5mX21vZGUgJiBGTU9ERV9XUklURSkKKyAgICAgICAgICAgIHJldHVybiBkcmFpbl9kYWMocywgZmlsZS0+Zl9mbGFncyAmIE9fTk9OQkxPQ0spOworICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgCisgICAgY2FzZSBTTkRDVExfRFNQX1NFVERVUExFWDoKKyAgICAgICAgLyogWFhYIGZpeCAqLworICAgICAgICByZXR1cm4gMDsKKworICAgIGNhc2UgU05EQ1RMX0RTUF9HRVRDQVBTOgorICAgICAgICByZXR1cm4gcHV0X3VzZXIoRFNQX0NBUF9EVVBMRVggfCBEU1BfQ0FQX1JFQUxUSU1FIHwgRFNQX0NBUF9UUklHR0VSIHwgRFNQX0NBUF9NTUFQLCBwKTsKKyAgICAgICAgCisgICAgY2FzZSBTTkRDVExfRFNQX1JFU0VUOgorICAgICAgICBzcGluX2xvY2tfaXJxc2F2ZSgmY2FyZC0+bG9jaywgZmxhZ3MpOworICAgICAgICBpZiAoZmlsZS0+Zl9tb2RlICYgRk1PREVfV1JJVEUpIHsKKyAgICAgICAgICAgIHN0b3BfZGFjKHMpOworICAgICAgICAgICAgc3luY2hyb25pemVfaXJxKHMtPmNhcmQtPnBjaWRldi0+aXJxKTsKKyAgICAgICAgICAgIHMtPmRtYV9kYWMuc3dwdHIgPSBzLT5kbWFfZGFjLmh3cHRyID0gcy0+ZG1hX2RhYy5jb3VudCA9IHMtPmRtYV9kYWMudG90YWxfYnl0ZXMgPSAwOworICAgICAgICB9CisgICAgICAgIGlmIChmaWxlLT5mX21vZGUgJiBGTU9ERV9SRUFEKSB7CisgICAgICAgICAgICBzdG9wX2FkYyhzKTsKKyAgICAgICAgICAgIHN5bmNocm9uaXplX2lycShzLT5jYXJkLT5wY2lkZXYtPmlycSk7CisgICAgICAgICAgICBzLT5kbWFfYWRjLnN3cHRyID0gcy0+ZG1hX2FkYy5od3B0ciA9IHMtPmRtYV9hZGMuY291bnQgPSBzLT5kbWFfYWRjLnRvdGFsX2J5dGVzID0gMDsKKyAgICAgICAgfQorICAgICAgICBzcGluX3VubG9ja19pcnFyZXN0b3JlKCZjYXJkLT5sb2NrLCBmbGFncyk7CisgICAgICAgIHJldHVybiAwOworCisgICAgY2FzZSBTTkRDVExfRFNQX1NQRUVEOgorICAgICAgICBnZXRfdXNlcl9yZXQodmFsLCBwLCAtRUZBVUxUKTsKKyAgICAgICAgc3Bpbl9sb2NrX2lycXNhdmUoJmNhcmQtPmxvY2ssIGZsYWdzKTsKKyAgICAgICAgaWYgKHZhbCA+PSAwKSB7CisgICAgICAgICAgICBpZiAoZmlsZS0+Zl9tb2RlICYgRk1PREVfUkVBRCkgeworICAgICAgICAgICAgICAgIHN0b3BfYWRjKHMpOworICAgICAgICAgICAgICAgIHMtPmRtYV9hZGMucmVhZHkgPSAwOworICAgICAgICAgICAgICAgIHNldF9hZGNfcmF0ZShzLCB2YWwpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGZpbGUtPmZfbW9kZSAmIEZNT0RFX1dSSVRFKSB7CisgICAgICAgICAgICAgICAgc3RvcF9kYWMocyk7CisgICAgICAgICAgICAgICAgcy0+ZG1hX2RhYy5yZWFkeSA9IDA7CisgICAgICAgICAgICAgICAgc2V0X2RhY19yYXRlKHMsIHZhbCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgc3Bpbl91bmxvY2tfaXJxcmVzdG9yZSgmY2FyZC0+bG9jaywgZmxhZ3MpOworICAgICAgICByZXR1cm4gcHV0X3VzZXIoKGZpbGUtPmZfbW9kZSAmIEZNT0RFX1JFQUQpID8gcy0+cmF0ZWFkYyA6IHMtPnJhdGVkYWMsIHApOworICAgICAgICAKKyAgICBjYXNlIFNORENUTF9EU1BfU1RFUkVPOgorICAgICAgICBnZXRfdXNlcl9yZXQodmFsLCBwLCAtRUZBVUxUKTsKKyAgICAgICAgc3Bpbl9sb2NrX2lycXNhdmUoJmNhcmQtPmxvY2ssIGZsYWdzKTsKKyAgICAgICAgZm10ZCA9IDA7CisgICAgICAgIGZtdG0gPSB+MDsKKyAgICAgICAgaWYgKGZpbGUtPmZfbW9kZSAmIEZNT0RFX1JFQUQpIHsKKyAgICAgICAgICAgIHN0b3BfYWRjKHMpOworICAgICAgICAgICAgcy0+ZG1hX2FkYy5yZWFkeSA9IDA7CisgICAgICAgICAgICBpZiAodmFsKQorICAgICAgICAgICAgICAgIGZtdGQgfD0gRVNTX0ZNVF9TVEVSRU8gPDwgRVNTX0FEQ19TSElGVDsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBmbXRtICY9IH4oRVNTX0ZNVF9TVEVSRU8gPDwgRVNTX0FEQ19TSElGVCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGZpbGUtPmZfbW9kZSAmIEZNT0RFX1dSSVRFKSB7CisgICAgICAgICAgICBzdG9wX2RhYyhzKTsKKyAgICAgICAgICAgIHMtPmRtYV9kYWMucmVhZHkgPSAwOworICAgICAgICAgICAgaWYgKHZhbCkKKyAgICAgICAgICAgICAgICBmbXRkIHw9IEVTU19GTVRfU1RFUkVPIDw8IEVTU19EQUNfU0hJRlQ7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgZm10bSAmPSB+KEVTU19GTVRfU1RFUkVPIDw8IEVTU19EQUNfU0hJRlQpOworICAgICAgICB9CisgICAgICAgIHNldF9mbXQocywgZm10bSwgZm10ZCk7CisgICAgICAgIHNwaW5fdW5sb2NrX2lycXJlc3RvcmUoJmNhcmQtPmxvY2ssIGZsYWdzKTsKKyAgICAgICAgcmV0dXJuIDA7CisKKyAgICBjYXNlIFNORENUTF9EU1BfQ0hBTk5FTFM6CisgICAgICAgIGdldF91c2VyX3JldCh2YWwsIHAsIC1FRkFVTFQpOworICAgICAgICBzcGluX2xvY2tfaXJxc2F2ZSgmY2FyZC0+bG9jaywgZmxhZ3MpOworICAgICAgICBpZiAodmFsICE9IDApIHsKKyAgICAgICAgICAgIGZtdGQgPSAwOworICAgICAgICAgICAgZm10bSA9IH4wOworICAgICAgICAgICAgaWYgKGZpbGUtPmZfbW9kZSAmIEZNT0RFX1JFQUQpIHsKKyAgICAgICAgICAgICAgICBzdG9wX2FkYyhzKTsKKyAgICAgICAgICAgICAgICBzLT5kbWFfYWRjLnJlYWR5ID0gMDsKKyAgICAgICAgICAgICAgICBpZiAodmFsID49IDIpCisgICAgICAgICAgICAgICAgICAgIGZtdGQgfD0gRVNTX0ZNVF9TVEVSRU8gPDwgRVNTX0FEQ19TSElGVDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIGZtdG0gJj0gfihFU1NfRk1UX1NURVJFTyA8PCBFU1NfQURDX1NISUZUKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChmaWxlLT5mX21vZGUgJiBGTU9ERV9XUklURSkgeworICAgICAgICAgICAgICAgIHN0b3BfZGFjKHMpOworICAgICAgICAgICAgICAgIHMtPmRtYV9kYWMucmVhZHkgPSAwOworICAgICAgICAgICAgICAgIGlmICh2YWwgPj0gMikKKyAgICAgICAgICAgICAgICAgICAgZm10ZCB8PSBFU1NfRk1UX1NURVJFTyA8PCBFU1NfREFDX1NISUZUOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgZm10bSAmPSB+KEVTU19GTVRfU1RFUkVPIDw8IEVTU19EQUNfU0hJRlQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc2V0X2ZtdChzLCBmbXRtLCBmbXRkKTsKKyAgICAgICAgfQorICAgICAgICBzcGluX3VubG9ja19pcnFyZXN0b3JlKCZjYXJkLT5sb2NrLCBmbGFncyk7CisgICAgICAgIHJldHVybiBwdXRfdXNlcigocy0+Zm10ICYgKChmaWxlLT5mX21vZGUgJiBGTU9ERV9SRUFEKSA/IChFU1NfRk1UX1NURVJFTyA8PCBFU1NfQURDX1NISUZUKSAKKyAgICAgICAgICAgICAgICAgICAgICAgOiAoRVNTX0ZNVF9TVEVSRU8gPDwgRVNTX0RBQ19TSElGVCkpKSA/IDIgOiAxLCBwKTsKKyAgICAgICAgCisgICAgY2FzZSBTTkRDVExfRFNQX0dFVEZNVFM6IC8qIFJldHVybnMgYSBtYXNrICovCisgICAgICAgIHJldHVybiBwdXRfdXNlcihBRk1UX1U4fEFGTVRfUzE2X0xFLCBwKTsKKyAgICAgICAgCisgICAgY2FzZSBTTkRDVExfRFNQX1NFVEZNVDogLyogU2VsZWN0cyBPTkUgZm10Ki8KKyAgICAgICAgZ2V0X3VzZXJfcmV0KHZhbCwgcCwgLUVGQVVMVCk7CisgICAgICAgIHNwaW5fbG9ja19pcnFzYXZlKCZjYXJkLT5sb2NrLCBmbGFncyk7CisgICAgICAgIGlmICh2YWwgIT0gQUZNVF9RVUVSWSkgeworICAgICAgICAgICAgZm10ZCA9IDA7CisgICAgICAgICAgICBmbXRtID0gfjA7CisgICAgICAgICAgICBpZiAoZmlsZS0+Zl9tb2RlICYgRk1PREVfUkVBRCkgeworICAgICAgICAgICAgICAgIHN0b3BfYWRjKHMpOworICAgICAgICAgICAgICAgIHMtPmRtYV9hZGMucmVhZHkgPSAwOworICAgICAgICAgICAgICAgIGlmICh2YWwgPT0gQUZNVF9TMTZfTEUpCisgICAgICAgICAgICAgICAgICAgIGZtdGQgfD0gRVNTX0ZNVF8xNkJJVCA8PCBFU1NfQURDX1NISUZUOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgZm10bSAmPSB+KEVTU19GTVRfMTZCSVQgPDwgRVNTX0FEQ19TSElGVCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoZmlsZS0+Zl9tb2RlICYgRk1PREVfV1JJVEUpIHsKKyAgICAgICAgICAgICAgICBzdG9wX2RhYyhzKTsKKyAgICAgICAgICAgICAgICBzLT5kbWFfZGFjLnJlYWR5ID0gMDsKKyAgICAgICAgICAgICAgICBpZiAodmFsID09IEFGTVRfUzE2X0xFKQorICAgICAgICAgICAgICAgICAgICBmbXRkIHw9IEVTU19GTVRfMTZCSVQgPDwgRVNTX0RBQ19TSElGVDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIGZtdG0gJj0gfihFU1NfRk1UXzE2QklUIDw8IEVTU19EQUNfU0hJRlQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc2V0X2ZtdChzLCBmbXRtLCBmbXRkKTsKKyAgICAgICAgfQorICAgICAgICBzcGluX3VubG9ja19pcnFyZXN0b3JlKCZjYXJkLT5sb2NrLCBmbGFncyk7CisgICAgICAgIHJldHVybiBwdXRfdXNlcigocy0+Zm10ICYgKChmaWxlLT5mX21vZGUgJiBGTU9ERV9SRUFEKSA/IAorICAgICAgICAgICAgKEVTU19GTVRfMTZCSVQgPDwgRVNTX0FEQ19TSElGVCkgCisgICAgICAgICAgICA6IChFU1NfRk1UXzE2QklUIDw8IEVTU19EQUNfU0hJRlQpKSkgPyAKKyAgICAgICAgICAgICAgICBBRk1UX1MxNl9MRSA6IAorICAgICAgICAgICAgICAgIEFGTVRfVTgsIAorICAgICAgICAgICAgcCk7CisgICAgICAgIAorICAgIGNhc2UgU05EQ1RMX0RTUF9QT1NUOgorICAgICAgICByZXR1cm4gMDsKKworICAgIGNhc2UgU05EQ1RMX0RTUF9HRVRUUklHR0VSOgorICAgICAgICB2YWwgPSAwOworICAgICAgICBpZiAoKGZpbGUtPmZfbW9kZSAmIEZNT0RFX1JFQUQpICYmIChzLT5lbmFibGUgJiBBRENfUlVOTklORykpCisgICAgICAgICAgICB2YWwgfD0gUENNX0VOQUJMRV9JTlBVVDsKKyAgICAgICAgaWYgKChmaWxlLT5mX21vZGUgJiBGTU9ERV9XUklURSkgJiYgKHMtPmVuYWJsZSAmIERBQ19SVU5OSU5HKSkgCisgICAgICAgICAgICB2YWwgfD0gUENNX0VOQUJMRV9PVVRQVVQ7CisgICAgICAgIHJldHVybiBwdXRfdXNlcih2YWwsIHApOworICAgICAgICAKKyAgICBjYXNlIFNORENUTF9EU1BfU0VUVFJJR0dFUjoKKyAgICAgICAgZ2V0X3VzZXJfcmV0KHZhbCwgcCwgLUVGQVVMVCk7CisgICAgICAgIGlmIChmaWxlLT5mX21vZGUgJiBGTU9ERV9SRUFEKSB7CisgICAgICAgICAgICBpZiAodmFsICYgUENNX0VOQUJMRV9JTlBVVCkgeworICAgICAgICAgICAgICAgIGlmICghcy0+ZG1hX2FkYy5yZWFkeSAmJiAocmV0ID0gIHByb2dfZG1hYnVmKHMsIDEpKSkKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJldDsKKyAgICAgICAgICAgICAgICBzdGFydF9hZGMocyk7CisgICAgICAgICAgICB9IGVsc2UKKyAgICAgICAgICAgICAgICBzdG9wX2FkYyhzKTsKKyAgICAgICAgfQorICAgICAgICBpZiAoZmlsZS0+Zl9tb2RlICYgRk1PREVfV1JJVEUpIHsKKyAgICAgICAgICAgIGlmICh2YWwgJiBQQ01fRU5BQkxFX09VVFBVVCkgeworICAgICAgICAgICAgICAgIGlmICghcy0+ZG1hX2RhYy5yZWFkeSAmJiAocmV0ID0gcHJvZ19kbWFidWYocywgMCkpKQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmV0OworICAgICAgICAgICAgICAgIHN0YXJ0X2RhYyhzKTsKKyAgICAgICAgICAgIH0gZWxzZQorICAgICAgICAgICAgICAgIHN0b3BfZGFjKHMpOworICAgICAgICB9CisgICAgICAgIHJldHVybiAwOworCisgICAgY2FzZSBTTkRDVExfRFNQX0dFVE9TUEFDRToKKyAgICAgICAgaWYgKCEoZmlsZS0+Zl9tb2RlICYgRk1PREVfV1JJVEUpKQorICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgIGlmICghKHMtPmVuYWJsZSAmIERBQ19SVU5OSU5HKSAmJiAodmFsID0gcHJvZ19kbWFidWYocywgMCkpICE9IDApCisgICAgICAgICAgICByZXR1cm4gdmFsOworICAgICAgICBzcGluX2xvY2tfaXJxc2F2ZSgmY2FyZC0+bG9jaywgZmxhZ3MpOworICAgICAgICBtM191cGRhdGVfcHRyKHMpOworICAgICAgICBhYmluZm8uZnJhZ3NpemUgPSBzLT5kbWFfZGFjLmZyYWdzaXplOworICAgICAgICBhYmluZm8uYnl0ZXMgPSBzLT5kbWFfZGFjLmRtYXNpemUgLSBzLT5kbWFfZGFjLmNvdW50OworICAgICAgICBhYmluZm8uZnJhZ3N0b3RhbCA9IHMtPmRtYV9kYWMubnVtZnJhZzsKKyAgICAgICAgYWJpbmZvLmZyYWdtZW50cyA9IGFiaW5mby5ieXRlcyA+PiBzLT5kbWFfZGFjLmZyYWdzaGlmdDsgICAgICAKKyAgICAgICAgc3Bpbl91bmxvY2tfaXJxcmVzdG9yZSgmY2FyZC0+bG9jaywgZmxhZ3MpOworICAgICAgICByZXR1cm4gY29weV90b191c2VyK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kKKyAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICBzcGluX2xvY2tfaXJxc2F2ZSgmY2FyZC0+bG9jaywgZmxhZ3MpOworICAgICAgICBtM191cGRhdGVfcHRyKHMpOworICAgICAgICB2YWwgPSBzLT5kbWFfZGFjLmNvdW50OworICAgICAgICBzcGluX3VubG9ja19pcnFyZXN0b3JlKCZjYXJkLT5sb2NrLCBmbGFncyk7CisgICAgICAgIHJldHVybiBwdXRfdXNlcih2YWwsIHApOworCisgICAgY2FzZSBTTkRDVExfRFNQX0dFVElQVFI6CisgICAgICAgIGlmICghKGZpbGUtPmZfbW9kZSAmIEZNT0RFX1JFQUQpKQorICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgIHNwaW5fbG9ja19pcnFzYXZlKCZjYXJkLT5sb2NrLCBmbGFncyk7CisgICAgICAgIG0zX3VwZGF0ZV9wdHIocyk7CisgICAgICAgIGNpbmZvLmJ5dGVzID0gcy0+ZG1hX2FkYy50b3RhbF9ieXRlczsKKyAgICAgICAgY2luZm8uYmxvY2tzID0gcy0+ZG1hX2FkYy5jb3VudCA+PiBzLT5kbWFfYWRjLmZyYWdzaGlmdDsKKyAgICAgICAgY2luZm8ucHRyID0gcy0+ZG1hX2FkYy5od3B0cjsKKyAgICAgICAgaWYgKHMtPmRtYV9hZGMubWFwcGVkKQorICAgICAgICAgICAgcy0+ZG1hX2FkYy5jb3VudCAmPSBzLT5kbWFfYWRjLmZyYWdzaXplLTE7CisgICAgICAgIHNwaW5fdW5sb2NrX2lycXJlc3RvcmUoJmNhcmQtPmxvY2ssIGZsYWdzKTsKKwlpZiAoY29weV90b191c2VyKGFyZ3AsICZjaW5mbywgc2l6ZW9mKGNpbmZvKSkpCisJCXJldHVybiAtRUZBVUxUOworCXJldHVybiAwOworCisgICAgY2FzZSBTTkRDVExfRFNQX0dFVE9QVFI6CisgICAgICAgIGlmICghKGZpbGUtPmZfbW9kZSAmIEZNT0RFX1dSSVRFKSkKKyAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICBzcGluX2xvY2tfaXJxc2F2ZSgmY2FyZC0+bG9jaywgZmxhZ3MpOworICAgICAgICBtM191cGRhdGVfcHRyKHMpOworICAgICAgICBjaW5mby5ieXRlcyA9IHMtPmRtYV9kYWMudG90YWxfYnl0ZXM7CisgICAgICAgIGNpbmZvLmJsb2NrcyA9IHMtPmRtYV9kYWMuY291bnQgPj4gcy0+ZG1hX2RhYy5mcmFnc2hpZnQ7CisgICAgICAgIGNpbmZvLnB0ciA9IHMtPmRtYV9kYWMuaHdwdHI7CisgICAgICAgIGlmIChzLT5kbWFfZGFjLm1hcHBlZCkKKyAgICAgICAgICAgIHMtPmRtYV9kYWMuY291bnQgJj0gcy0+ZG1hX2RhYy5mcmFnc2l6ZS0xOworICAgICAgICBzcGluX3VubG9ja19pcnFyZXN0b3JlKCZjYXJkLT5sb2NrLCBmbGFncyk7CisJaWYgKGNvcHlfdG9fdXNlcihhcmdwLCAmY2luZm8sIHNpemVvZihjaW5mbykpKQorCQlyZXR1cm4gLUVGQVVMVDsKKwlyZXR1cm4gMDsKKworICAgIGNhc2UgU05EQ1RMX0RTUF9HRVRCTEtTSVpFOgorICAgICAgICBpZiAoZmlsZS0+Zl9tb2RlICYgRk1PREVfV1JJVEUpIHsKKyAgICAgICAgICAgIGlmICgodmFsID0gcHJvZ19kbWFidWYocywgMCkpKQorICAgICAgICAgICAgICAgIHJldHVybiB2YWw7CisgICAgICAgICAgICByZXR1cm4gcHV0X3VzZXIocy0+ZG1hX2RhYy5mcmFnc2l6ZSwgcCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKCh2YWwgPSBwcm9nX2RtYWJ1ZihzLCAxKSkpCisgICAgICAgICAgICByZXR1cm4gdmFsOworICAgICAgICByZXR1cm4gcHV0X3VzZXIocy0+ZG1hX2FkYy5mcmFnc2l6ZSwgcCk7CisKKyAgICBjYXNlIFNORENUTF9EU1BfU0VURlJBR01FTlQ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ItPmhhbmRsZSk7CisKKyAgICBkYi0+cmF3YnVmID0gTlVMTDsKKyAgICBkYi0+YnVmb3JkZXIgPSAwOworICAgIGRiLT5tYXBwZWQgPSAwOworICAgIGRiLT5yZWFkeSA9IDA7Cit9CisKK3N0YXRpYyBpbnQgbTNfb3BlbihzdHJ1Y3QgaW5vZGUgKmlub2RlLCBzdHJ1Y3QgZmlsZSAqZmlsZSkKK3sKKyAgICB1bnNpZ25lZCBpbnQgbWlub3IgPSBpbWlub3IoaW5vZGUpOworICAgIHN0cnVjdCBtM19jYXJkICpjOworICAgIHN0cnVjdCBtM19zdGF0ZSAqcyA9IE5VTEw7CisgICAgaW50IGk7CisgICAgdW5zaWduZWQgY2hhciBmbXRtID0gfjAsIGZtdHMgPSAwOworICAgIHVuc2lnbmVkIGxvbmcgZmxhZ3M7CisKKyAgICAvKgorICAgICAqICAgIFNjYW4gdGhlIGNhcmRzIGFuZCBmaW5kIHRoZSBjaGFubmVsLiBXZSBvbmx5CisgICAgICogICAgZG8gdGhpcyBhdCBvcGVuIHRpbWUgc28gaXQgaXMgb2sKKyAgICAgKi8KKyAgICBmb3IoYyA9IGRldnMgOyBjICE9IE5VTEwgOyBjID0gYy0+bmV4dCkgeworCisgICAgICAgIGZvcihpPTA7aTxOUl9EU1BTO2krKykgeworCisgICAgICAgICAgICBpZihjLT5jaGFubmVsc1tpXS5kZXZfYXVkaW8gPCAwKQorICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgaWYoKGMtPmNoYW5uZWxzW2ldLmRldl9hdWRpbyBeIG1pbm9yKSAmIH4weGYpCisgICAgICAgICAgICAgICAgY29udGludWU7CisKKyAgICAgICAgICAgIHMgPSAmYy0+Y2hhbm5lbHNbaV07CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKyAgICAgICAgCisgICAgaWYgKCFzKQorICAgICAgICByZXR1cm4gLUVOT0RFVjsKKyAgICAgICAgCisgICAgVkFMSURBVEVfU1RBVEUocyk7CisKKyAgICBmaWxlLT5wcml2YXRlX2RhdGEgPSBzOworCisgICAgLyogd2FpdCBmb3IgZGV2aWNlIHRvIGJlY29tZSBmcmVlICovCisgICAgZG93bigmcy0+b3Blbl9zZW0pOworICAgIHdoaWxlIChzLT5vcGVuX21vZGUgJiBmaWxlLT5mX21vZGUpIHsKKyAgICAgICAgaWYgKGZpbGUtPmZfZmxhZ3MgJiBPX05PTkJMT0NLKSB7CisgICAgICAgICAgICB1cCgmcy0+b3Blbl9zZW0pOworICAgICAgICAgICAgcmV0dXJuIC1FV09VTERCTE9DSzsKKyAgICAgICAgfQorICAgICAgICB1cCgmcy0+b3Blbl9zZW0pOworICAgICAgICBpbnRlcnJ1cHRpYmxlX3NsZWVwX29uKCZzLT5vcGVuX3dhaXQpOworICAgICAgICBpZiAoc2lnbmFsX3BlbmRpbmcoY3VycmVudCkpCisgICAgICAgICAgICByZXR1cm4gLUVSRVNUQVJUU1lTOworICAgICAgICBkb3duKCZzLT5vcGVuX3NlbSk7CisgICAgfQorICAgIAorICAgIHNwaW5fbG9ja19pcnFzYXZlKCZjLT5sb2NrLCBmbGFncyk7CisKKyAgICBpZiAoZmlsZS0+Zl9tb2RlICYgRk1PREVfUkVBRCkgeworICAgICAgICBmbXRtICY9IH4oKEVTU19GTVRfU1RFUkVPIHwgRVNTX0ZNVF8xNkJJVCkgPDwgRVNTX0FEQ19TSElGVCk7CisgICAgICAgIGlmICgobWlub3IgJiAweGYpID09IFNORF9ERVZfRFNQMTYpCisgICAgICAgICAgICBmbXRzIHw9IEVTU19GTVRfMTZCSVQgPDwgRVNTX0FEQ19TSElGVDsgCisKKyAgICAgICAgcy0+ZG1hX2FkYy5vc3NmcmFnc2hpZnQgPSBzLT5kbWFfYWRjLm9zc21heGZyYWdzID0gcy0+ZG1hX2FkYy5zdWJkaXZpc2lvbiA9IDA7CisgICAgICAgIHNldF9hZGNfcmF0ZShzLCA4MDAwKTsKKyAgICB9CisgICAgaWYgKGZpbGUtPm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DSyk7CisKKyAgICBkb3duKCZzLT5vcGVuX3NlbSk7CisgICAgc3Bpbl9sb2NrX2lycXNhdmUoJmNhcmQtPmxvY2ssIGZsYWdzKTsKKworICAgIGlmIChmaWxlLT5mX21vZGUgJiBGTU9ERV9XUklURSkgeworICAgICAgICBzdG9wX2RhYyhzKTsKKyAgICAgICAgaWYocy0+ZG1hX2RhYy5pbl9saXN0cykgeworICAgICAgICAgICAgbTNfcmVtb3ZlX2xpc3Qocy0+Y2FyZCwgJihzLT5jYXJkLT5taXhlcl9saXN0KSwgcy0+ZG1hX2RhYy5taXhlcl9pbmRleCk7CisgICAgICAgICAgICBudWtlX2xpc3RzKHMtPmNhcmQsICYocy0+ZG1hX2RhYykpOworICAgICAgICB9CisgICAgfQorICAgIGlmIChmaWxlLT5mX21vZGUgJiBGTU9ERV9SRUFEKSB7CisgICAgICAgIHN0b3BfYWRjKHMpOworICAgICAgICBpZihzLT5kbWFfYWRjLmluX2xpc3RzKSB7CisgICAgICAgICAgICBtM19yZW1vdmVfbGlzdChzLT5jYXJkLCAmKHMtPmNhcmQtPmFkYzFfbGlzdCksIHMtPmRtYV9hZGMuYWRjMV9pbmRleCk7CisgICAgICAgICAgICBudWtlX2xpc3RzKHMtPmNhcmQsICYocy0+ZG1hX2FkYykpOworICAgICAgICB9CisgICAgfQorICAgICAgICAKKyAgICBzLT5vcGVuX21vZGUgJj0gKH5maWxlLT5mX21vZGUpICYgKEZNT0RFX1JFQUR8Rk1PREVfV1JJVEUpOworCisgICAgc3Bpbl91bmxvY2tfaXJxcmVzdG9yZSgmY2FyZC0+bG9jaywgZmxhZ3MpOworICAgIHVwKCZzLT5vcGVuX3NlbSk7CisgICAgd2FrZV91cCgmcy0+b3Blbl93YWl0KTsKKworICAgIHJldHVybiAwOworfQorCisvKgorICogV2FpdCBmb3IgdGhlIGFjOTcgc2VyaWFsIGJ1cyB0byBiZSBmcmVlLgorICogcmV0dXJuIG5vbnplcm8gaWYgdGhlIGJ1cyBpcyBzdGlsbCBidXN5LgorICovCitzdGF0aWMgaW50IG0zX2FjOTdfd2FpdChzdHJ1Y3QgbTNfY2FyZCAqY2FyZCkKK3sKKyAgICBpbnQgaSA9IDEwMDAwOworCisgICAgd2hpbGUoIChtM19pbmIoY2FyZCwgMHgzMCkgJiAxKSAmJiBpLS0pIDsKKworICAgIHJldHVybiBpID09IDA7Cit9CisKK3N0YXRpYyB1MTYgbTNfYWM5N19yZWFkKHN0cnVjdCBhYzk3X2NvZGVjICpjb2RlYywgdTggcmVnKQoreworICAgIHUxNiByZXQgPSAwOworICAgIHN0cnVjdCBtM19jYXJkICpjYXJkID0gY29kZWMtPnByaXZhdGVfZGF0YTsKKworICAgIHNwaW5fbG9jaygmY2FyZC0+YWM5N19sb2NrKTsKKworICAgIGlmKG0zX2FjOTdfd2FpdChjYXJkKSkgeworICAgICAgICBwcmludGsoS0VSTl9FUlIgUEZYICJzZXJpYWwgYnVzIGJ1c3kgcmVhZGluZyByZWcgMHgleFxuIixyZWcpOworICAgICAgICBnb3RvIG91dDsKKyAgICB9CisKKyAgICBtM19vdXRiKGNhcmQsIDB4ODAgfCAocmVnICYgMHg3ZiksIDB4MzApOworCisgICAgaWYobTNfYWM5N193YWl0KGNhcmQpKSB7CisgICAgICAgIHByaW50ayhLRVJOX0VSUiBQRlggInNlcmlhbCBidXMgYnVzeSBmaW5pc2hpbmcgcmVhZCByZWcgMHgleFxuIixyZWcpOworICAgICAgICBnb3RvIG91dDsKKyAgICB9CisKKyAgICByZXQgPSAgbTNfaW53KGNhcmQsIDB4MzIpOworICAgIERQUklOVEsoRFBDUkFQLCJyZWFkaW5nIDB4JTA0eCBmcm9tIDB4JTAyeFxuIixyZXQsIHJlZyk7CisKK291dDoKKyAgICBzcGluX3VubG9jaygmY2FyZC0+YWM5N19sb2NrKTsKKyAgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgdm9pZCBtM19hYzk3X3dyaXRlKHN0cnVjdCBhYzk3X2NvZGVjICpjb2RlYywgdTggcmVnLCB1MTYgdmFsKQoreworICAgIHN0cnVjdCBtM19jYXJkICpjYXJkID0gY29kZWMtPnByaXZhdGVfZGF0YTsKKworICAgIHNwaW5fbG9jaygmY2FyZC0+YWM5N19sb2NrKTsKKworICAgIGlmKG0zX2FjOTdfd2FpdChjYXJkKSkgeworICAgICAgICBwcmludGsoS0VSTl9FUlIgUEZYICJzZXJpYWwgYnVzIGJ1c3kgd3JpdGluZyAweCV4IHRvIDB4JXhcbiIsdmFsLCByZWcpOworICAgICAgICBnb3RvIG91dDsKKyAgICB9CisgICAgRFBSSU5USyhEUENSQVAsIndyaXRpbmcgMHglMDR4ICB0byAgMHglMDJ4XG4iLCB2YWwsIHJlZyk7CisKKyAgICBtM19vdXR3KGNhcmQsIHZhbCwgMHgzMik7CisgICAgbTNfb3V0YihjYXJkLCByZWcgJiAweDdmLCAweDMwKTsKK291dDoKKyAgICBzcGluX3VubG9jaygmY2FyZC0+YWM5N19sb2NrKTsKK30KKy8qIE9TUyAvZGV2L21peGVyIGZpbGUgb3BlcmF0aW9uIG1ldGhvZHMgKi8KK3N0YXRpYyBpbnQgbTNfb3Blbl9taXhkZXYoc3RydWN0IGlub2RlICppbm9kZSwgc3RydWN0IGZpbGUgKmZpbGUpCit7CisgICAgdW5zaWduZWQgaW50IG1pbm9yID0gaW1pbm9yKGlub2RlKTsKKyAgICBzdHJ1Y3QgbTNfY2FyZCAqY2FyZCA9IGRldnM7CisKKyAgICBmb3IgKGNhcmQgPSBkZXZzOyBjYXJkICE9IE5VTEw7IGNhcmQgPSBjYXJkLT5uZXh0KSB7CisgICAgICAgIGlmKChjYXJkLT5hYzk3ICE9IE5VTEwpICYmIChjYXJkLT5hYzk3LT5kZXZfbWl4ZXIgPT0gbWlub3IpKQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgIH0KKworICAgIGlmICghY2FyZCkgeworICAgICAgICByZXR1cm4gLUVOT0RFVjsKKyAgICB9CisKKyAgICBmaWxlLT5wcml2YXRlX2RhdGE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IChpbncoaW8gKyBTRE9fT1VUX0RFU1RfQ1RSTCkgJiB+Q09NTUFORF9BRERSX09VVCkgfCBpc3JlbW90ZSwKKyAgICAgICAgICAgIGlvICsgU0RPX09VVF9ERVNUX0NUUkwpOworICAgIG91dHcoICAoaW53KGlvICsgU0RPX0lOX0RFU1RfQ1RSTCkgJiB+U1RBVFVTX0FERFJfSU4pIHwgaXNyZW1vdGUsCisgICAgICAgICAgICBpbyArIFNET19JTl9ERVNUX0NUUkwpOworfQorCisvKiAKKyAqIGhhY2ssIHJldHVybnMgbm9uIHplcm8gb24gZXJyIAorICovCitzdGF0aWMgaW50IHRyeV9yZWFkX3ZlbmRvcihzdHJ1Y3QgbTNfY2FyZCAqY2FyZCkKK3sKKyAgICB1MTYgcmV0OworCisgICAgaWYobTNfYWM5N193YWl0KGNhcmQpKSAKKyAgICAgICAgcmV0dXJuIDE7CisKKyAgICBtM19vdXRiKGNhcmQsIDB4ODAgfCAoQUM5N19WRU5ET1JfSUQxICYgMHg3ZiksIDB4MzApOworCisgICAgaWYobTNfYWM5N193YWl0KGNhcmQpKSAKKyAgICAgICAgcmV0dXJuIDE7CisKKyAgICByZXQgPSAgbTNfaW53KGNhcmQsIDB4MzIpOworCisgICAgcmV0dXJuIChyZXQgPT0gMCkgfHwgKHJldCA9PSAweGZmZmYpOworfQorCitzdGF0aWMgdm9pZCBtM19jb2RlY19yZXNldChzdHJ1Y3QgbTNfY2FyZCAqY2FyZCwgaW50IGJ1c3l3YWl0KQoreworICAgIHUxNiBkaXI7CisgICAgaW50IGRlbGF5MSA9IDAsIGRlbGF5MiA9IDAsIGk7CisgICAgaW50IGlvID0gY2FyZC0+aW9iYXNlOworCisgICAgc3dpdGNoIChjYXJkLT5jYXJkX3R5cGUpIHsKKyAgICAgICAgLyoKKyAgICAgICAgICogdGhlIG9uYm9hcmQgY29kZWMgb24gdGhlIGFsbGVncm8gc2VlbXMgCisgICAgICAgICAqIHRvIHdhbnQgdG8gd2FpdCBhIHZlcnkgbG9uZyB0aW1lIGJlZm9yZQorICAgICAgICAgKiBjb21pbmcgYmFjayB0byBsaWZlIAorICAgICAgICAgKi8KKyAgICAgICAgY2FzZSBFU1NfQUxMRUdSTzoKKyAgICAgICAgICAgIGRlbGF5MSA9IDUwOworICAgICAgICAgICAgZGVsYXkyID0gODAwOworICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBFU1NfTUFFU1RSTzM6CisgICAgICAgIGNhc2UgRVNTX01BRVNUUk8zSFc6CisgICAgICAgICAgICBkZWxheTEgPSAyMDsKKyAgICAgICAgICAgIGRlbGF5MiA9IDUwMDsKKyAgICAgICAgYnJlYWs7CisgICAgfQorCisgICAgZm9yKGkgPSAwOyBpIDwgNTsgaSArKykgeworICAgICAgICBkaXIgPSBpbncoaW8gKyBHUElPX0RJUkVDVElPTik7CisgICAgICAgIGRpciB8PSAweDEwOyAvKiBhc3N1bWluZyBwY2kgYnVzIG1hc3Rlcj8gKi8KKworICAgICAgICByZW1vdGVfY29kZWNfY29uZmlnKGlvLCAwKTsKKworICAgICAgICBvdXR3KElPX1NSQU1fRU5BQkxFLCBpbyArIFJJTkdfQlVTX0NUUkxfQSk7CisgICAgICAgIHVkZWxheSgyMCk7CisKKyAgICAgICAgb3V0dyhkaXIgJiB+R1BPX1BSSU1BUllfQUM5NyAsIGlvICsgR1BJT19ESVJFQ1RJT04pOworICAgICAgICBvdXR3KH5HUE9fUFJJTUFSWV9BQzk3ICwgaW8gKyBHUElPX01BU0spOworICAgICAgICBvdXR3KDAsIGlvICsgR1BJT19EQVRBKTsKKyAgICAgICAgb3V0dyhkaXIgfCBHUE9fUFJJTUFSWV9BQzk3LCBpbyArIEdQSU9fRElSRUNUSU9OKTsKKworICAgICAgICBpZihidXN5d2FpdCkgIHsKKyAgICAgICAgICAgIG1kZWxheShkZWxheTEpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgc2V0X2N1cnJlbnRfc3RhdGUoVEFTS19VTklOVEVSUlVQVElCTEUpOworICAgICAgICAgICAgc2NoZWR1bGVfdGltZW91dCgoZGVsYXkxICogSFopIC8gMTAwMCk7CisgICAgICAgIH0KKworICAgICAgICBvdXR3KEdQT19QUklNQVJZX0FDOTcsIGlvICsgR1BJT19EQVRBKTsKKyAgICAgICAgdWRlbGF5KDUpOworICAgICAgICAvKiBvaywgYnJpbmcgYmFjayB0aGUgYWMtbGluayAqLworICAgICAgICBvdXR3KElPX1NSQU1fRU5BQkxFIHwgU0VSSUFMX0FDX0xJTktfRU5BQkxFLCBpbyArIFJJTkdfQlVTX0NUUkxfQSk7CisgICAgICAgIG91dHcofjAsIGlvICsgR1BJT19NQVNLKTsKKworICAgICAgICBpZihidXN5d2FpdCkgeworICAgICAgICAgICAgbWRlbGF5KGRlbGF5Mik7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBzZXRfY3VycmVudF9zdGF0ZShUQVNLX1VOSU5URVJSVVBUSUJMRSk7CisgICAgICAgICAgICBzY2hlZHVsZV90aW1lb3V0KChkZWxheTIgKiBIWikgLyAxMDAwKTsKKyAgICAgICAgfQorICAgICAgICBpZighIHRyeV9yZWFkX3ZlbmRvcihjYXJkKSkKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGRlbGF5MSArPSAxMDsKKyAgICAgICAgZGVsYXkyICs9IDEwMDsKKworICAgICAgICBEUFJJTlRLKERQTU9ELCAicmV0cnlpbmcgY29kZWMgcmVzZXQgd2l0aCBkZWxheXMgb2YgJWQgYW5kICVkIG1zXG4iLAorICAgICAgICAgICAgICAgIGRlbGF5MSwgZGVsYXkyKTsKKyAgICB9CisKKyNpZiAwCisgICAgLyogbW9yZSBndW5nLWhvIHJlc2V0IHRoYXQgZG9lc24ndAorICAgICAqIHNlZW0gdG8gd29yayBhbnl3aGVyZSA6KQorICAgICAqLworICAgIHRtcCA9IGludyhpbyArIFJJTkdfQlVTX0NUUkxfQSk7CisgICAgb3V0dyhSQUNfU0RGU19FTkFCTEV8TEFDX1NERlNfRU5BQkxFLCBpbyArIFJJTkdfQlVTX0NUUkxfQSk7CisgICAgbWRlbGF5KDIwKTsKKyAgICBvdXR3KHRtcCwgaW8gKyBSSU5HX0JVU19DVFJMX0EpOworICAgIG1kZWxheSg1MCk7CisjZW5kaWYKK30KKworc3RhdGljIGludCBfX2RldmluaXQgbTNfY29kZWNfaW5zdGFsbChzdHJ1Y3QgbTNfY2FyZCAqY2FyZCkKK3sKKyAgICBzdHJ1Y3QgYWM5N19jb2RlYyAqY29kZWM7CisKKyAgICBpZiAoKGNvZGVjID0gYWM5N19hbGxvY19jb2RlYygpKSA9PSBOVUxMKQorICAgICAgICByZXR1cm4gLUVOT01FTTsKKworICAgIGNvZGVjLT5wcml2YXRlX2RhdGEgPSBjYXJkOworICAgIGNvZGVjLT5jb2RlY19yZWFkID0gbTNfYWM5N19yZWFkOworICAgIGNvZGVjLT5jb2RlY193cml0ZSA9IG0zX2FjOTdfd3JpdGU7CisgICAgLyogc29tZWRheSB3ZSBzaG91bGQgc3VwcG9ydCBzZWNvbmRhcnkgY29kZWNzLi4gKi8KKyAgICBjb2RlYy0+aWQgPSAwOworCisgICAgaWYgKGFjOTdfcHJvYmVfY29kZWMoY29kZWMpID09IDApIHsKKyAgICAgICAgcHJpbnRrKEtFUk5fRVJSIFBGWCAiY29kZWMgcHJvYmUgZmFpbGVkXG4iKTsKKyAgICAgICAgYWM5N19yZWxlYXNlX2NvZGVjKGNvZGVjKTsKKyAgICAgICAgcmV0dXJuIC0xOworICAgIH0KKworICAgIGlmICgoY29kZWMtPmRldl9taXhlciA9IHJlZ2lzdGVyX3NvdW5kX21peGVyKCZtM19taXhlcl9mb3BzLCAtMSkpIDwgMCkgeworICAgICAgICBwcmludGsoS0VSTl9FUlIgUEZYICJjb3VsZG4ndCByZWdpc3RlciBtaXhlciFcbiIpOworICAgICAgICBhYzk3X3JlbGVhc2VfY29kZWMoY29kZWMpOworICAgICAgICByZXR1cm4gLTE7CisgICAgfQorCisgICAgY2FyZC0+YWM5Ny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KKyAgICAvKiB3cml0ZSBrZXJuZWwgaW50byBjb2RlIG1lbW9yeS4uICovCisgICAgZm9yKGkgPSAwIDsgaSA8IHNpemVvZihhc3NwX2tlcm5lbF9pbWFnZSkgLyAyOyBpKyspIHsKKyAgICAgICAgbTNfYXNzcF93cml0ZShjYXJkLCBNRU1UWVBFX0lOVEVSTkFMX0NPREUsIAorICAgICAgICAgICAgICAgIFJFVl9CX0NPREVfTUVNT1JZX0JFR0lOICsgaSwgCisgICAgICAgICAgICAgICAgYXNzcF9rZXJuZWxfaW1hZ2VbaV0pOworICAgIH0KKworICAgIC8qCisgICAgICogV2Ugb25seSBoYXZlIHRoaXMgb25lIGNsaWVudCBhbmQgd2Uga25vdyB0aGF0IDB4NDAwCisgICAgICogaXMgZnJlZSBpbiBvdXIga2VybmVsJ3MgbWVtIG1hcCwgc28gbGV0cyBqdXN0CisgICAgICogZHJvcCBpdCB0aGVyZS4gIEl0IHNlZW1zIHRoYXQgdGhlIG1pbmlzcmMgZG9lc24ndAorICAgICAqIG5lZWQgdmVjdG9ycywgc28gd2Ugd29uJ3QgYm90aGVyIHdpdGggdGhlbS4uCisgICAgICovCisgICAgZm9yKGkgPSAwIDsgaSA8IHNpemVvZihhc3NwX21pbmlzcmNfaW1hZ2UpIC8gMjsgaSsrKSB7CisgICAgICAgIG0zX2Fzc3Bfd3JpdGUoY2FyZCwgTUVNVFlQRV9JTlRFUk5BTF9DT0RFLCAKKyAgICAgICAgICAgICAgICAweDQwMCArIGksIAorICAgICAgICAgICAgICAgIGFzc3BfbWluaXNyY19pbWFnZVtpXSk7CisgICAgfQorCisgICAgLyoKKyAgICAgKiB3cml0ZSB0aGUgY29lZmZpY2llbnRzIGZvciB0aGUgbG93IHBhc3MgZmlsdGVyPworICAgICAqLworICAgIGZvcihpID0gMDsgaSA8IE1JTklTUkNfTFBGX0xFTiA7IGkrKykgeworICAgICAgICBtM19hc3NwX3dyaXRlKGNhcmQsIE1FTVRZUEVfSU5URVJOQUxfQ09ERSwKKyAgICAgICAgICAgIDB4NDAwICsgTUlOSVNSQ19DT0VGX0xPQyArIGksCisgICAgICAgICAgICBtaW5pc3JjX2xwZltpXSk7CisgICAgfQorCisgICAgbTNfYXNzcF93cml0ZShjYXJkLCBNRU1UWVBFX0lOVEVSTkFMX0NPREUsCisgICAgICAgIDB4NDAwICsgTUlOSVNSQ19DT0VGX0xPQyArIE1JTklTUkNfTFBGX0xFTiwKKyAgICAgICAgMHg4MDAwKTsKKworICAgIC8qCisgICAgICogdGhlIG1pbmlzcmMgaXMgdGhlIG9ubHkgdGhpbmcgb24KKyAgICAgKiBvdXIgdGFzayBsaXN0Li4KKyAgICAgKi8KKyAgICBtM19hc3NwX3dyaXRlKGNhcmQsIE1FTVRZUEVfSU5URVJOQUxfREFUQSwgCisgICAgICAgICAgICBLREFUQV9UQVNLMCwgCisgICAgICAgICAgICAweDQwMCk7CisKKyAgICAvKgorICAgICAqIGluaXQgdGhlIG1peGVyIG51bWJlci4uCisgICAgICovCisKKyAgICBtM19hc3NwX3dyaXRlKGNhcmQsIE1FTVRZUEVfSU5URVJOQUxfREFUQSwKKyAgICAgICAgICAgIEtEQVRBX01JWEVSX1RBU0tfTlVNQkVSLDApOworCisgICAgLyoKKyAgICAgKiBFWFRSRU1FIEtFUk5FTCBNQVNURVIgVk9MVU1FCisgICAgICovCisgICAgbTNfYXNzcF93cml0ZShjYXJkLCBNRU1UWVBFX0lOVEVSTkFMX0RBVEEsCisgICAgICAgIEtEQVRBX0RBQ19MRUZUX1ZPTFVNRSwgQVJCX1ZPTFVNRSk7CisgICAgbTNfYXNzcF93cml0ZShjYXJkLCBNRU1UWVBFX0lOVEVSTkFMX0RBVEEsCisgICAgICAgIEtEQVRBX0RBQ19SSUdIVF9WT0xVTUUsIEFSQl9WT0xVTUUpOworCisgICAgY2FyZC0+bWl4ZXJfbGlzdC5tZW1fYWRkciA9IEtEQVRBX01JWEVSX1hGRVIwOworICAgIGNhcmQtPm1peGVyX2xpc3QubWF4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ZmVyZW5jZSBib2FyZCwgaGF2ZSB0byBmaW5kCisgICAgICogb3V0IGFib3V0IG90aGVycworICAgICAqCisgICAgICogdGhpcyBuZWVkcyBtb3JlIG1hZ2ljIGZvciA0IHNwZWFrZXIsIGJ1dC4uCisgICAgICovCisgICAgaW50IGlvID0gY2FyZC0+aW9iYXNlOworICAgIHUxNiBncG8sIHBvbGFyaXR5X3BvcnQsIHBvbGFyaXR5OworCisgICAgaWYoIWV4dGVybmFsX2FtcCkKKyAgICAgICAgcmV0dXJuOworCisgICAgaWYgKGdwaW9fcGluID49IDAgICYmIGdwaW9fcGluIDw9IDE1KSB7CisgICAgICAgIHBvbGFyaXR5X3BvcnQgPSAweDEwMDAgKyAoMHgxMDAgKiBncGlvX3Bpbik7CisgICAgfSBlbHNlIHsKKyAgICAgICAgc3dpdGNoIChjYXJkLT5jYXJkX3R5cGUpIHsKKyAgICAgICAgICAgIGNhc2UgRVNTX0FMTEVHUk86CisgICAgICAgICAgICAgICAgcG9sYXJpdHlfcG9ydCA9IDB4MTgwMDsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgcG9sYXJpdHlfcG9ydCA9IDB4MTEwMDsKKyAgICAgICAgICAgICAgICAvKiBQYW5hc29uaWMgdG91Z2hib29rIENGNzIgaGFzIHRvIGJlIGRpZmZlcmVudC4uLiAqLworICAgICAgICAgICAgICAgIGlmKGNhcmQtPnBjaWRldi0+c3Vic3lzdGVtX3ZlbmRvciA9PSAweDEwRjcgJiYgY2FyZC0+cGNpZGV2LT5zdWJzeXN0ZW1fZGV2aWNlID09IDB4ODMzRCkKKyAgICAgICAgICAgICAgICAJcG9sYXJpdHlfcG9ydCA9IDB4MUQwMDsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICAgIGdwbyA9IChwb2xhcml0eV9wb3J0ID4+IDgpICYgMHgwRjsKKyAgICBwb2xhcml0eSA9IH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VwdCwgU0FfU0hJUlEsIGNhcmRfbmFtZXNbY2FyZC0+Y2FyZF90eXBlXSwgY2FyZCkpIHsKKworICAgICAgICBwcmludGsoS0VSTl9FUlIgUEZYICJ1bmFibGUgdG8gYWxsb2NhdGUgaXJxICVkLFxuIiwgY2FyZC0+aXJxKTsKKworICAgICAgICByZXQgPSAtRUlPOworICAgICAgICBnb3RvIG91dDsKKyAgICB9CisKKyAgICBwY2lfc2V0X2RydmRhdGEocGNpX2RldiwgY2FyZCk7CisgICAgCisgICAgbTNfZW5hYmxlX2ludHMoY2FyZCk7CisgICAgbTNfYXNzcF9jb250aW51ZShjYXJkKTsKKworb3V0OgorICAgIGlmKHJldCkgeworICAgICAgICBpZihjYXJkLT5pb2Jhc2UpCisgICAgICAgICAgICByZWxlYXNlX3JlZ2lvbihwY2lfcmVzb3VyY2Vfc3RhcnQocGNpX2RldiwgMCksIHBjaV9yZXNvdXJjZV9sZW4ocGNpX2RldiwgMCkpOworICAgICAgICBmcmVlX2RzcF9zdXNwZW5kbWVtKGNhcmQpOworICAgICAgICBpZihjYXJkLT5hYzk3KSB7CisgICAgICAgICAgICB1bnJlZ2lzdGVyX3NvdW5kX21peGVyKGNhcmQtPmFjOTctPmRldl9taXhlcik7CisgICAgICAgICAgICBrZnJlZShjYXJkLT5hYzk3KTsKKyAgICAgICAgfQorICAgICAgICBmb3IoaT0wO2k8TlJfRFNQUztpKyspCisgICAgICAgIHsKKyAgICAgICAgICAgIHN0cnVjdCBtM19zdGF0ZSAqcyA9ICZjYXJkLT5jaGFubmVsc1tpXTsKKyAgICAgICAgICAgIGlmKHMtPmRldl9hdWRpbyAhPSAtMSkKKyAgICAgICAgICAgICAgICB1bnJlZ2lzdGVyX3NvdW5kX2RzcChzLT5kZXZfYXVkaW8pOworICAgICAgICB9CisgICAgICAgIGtmcmVlKGNhcmQpOworICAgIH0KKworICAgIHJldHVybiByZXQ7IAorfQorCitzdGF0aWMgdm9pZCBtM19yZW1vdmUoc3RydWN0IHBjaV9kZXYgKnBjaV9kZXYpCit7CisgICAgc3RydWN0IG0zX2NhcmQgKmNhcmQ7CisKKyAgICB1bnJlZ2lzdGVyX3JlYm9vdF9ub3RpZmllcigmbTNfcmVib290X25iKTsKKworICAgIHdoaWxlICgoY2FyZCA9IGRldnMpKSB7CisgICAgICAgIGludCBpOworICAgICAgICBkZXZzID0gZGV2cy0+bmV4dDsKKyAgICAKKyAgICAgICAgZnJlZV9pcnEoY2FyZC0+aXJxLCBjYXJkKTsKKyAgICAgICAgdW5yZWdpc3Rlcl9zb3VuZF9taXhlcihjYXJkLT5hYzk3LT5kZXZfbWl4ZXIpOworICAgICAgICBrZnJlZShjYXJkLT5hYzk3KTsKKworICAgICAgICBmb3IoaT0wO2k8TlJfRFNQUztpKyspCisgICAgICAgIHsKKyAgICAgICAgICAgIHN0cnVjdCBtM19zdGF0ZSAqcyA9ICZjYXJkLT5jaGFubmVsc1tpXTsKKyAgICAgICAgICAgIGlmKHMtPmRldl9hdWRpbyA8IDApCisgICAgICAgICAgICAgICAgY29udGludWU7CisKKyAgICAgICAgICAgIHVucmVnaXN0ZXJfc291bmRfZHNwKHMtPmRldl9hdWRpbyk7CisgICAgICAgICAgICBmcmVlX2RtYWJ1ZihjYXJkLT5wY2lkZXYsICZzLT5kbWFfYWRjKTsKKyAgICAgICAgICAgIGZyZWVfZG1hYnVmKGNhcmQtPnBjaWRldiwgJnMtPmRtYV9kYWMpOworICAgICAgICB9CisKKyAgICAgICAgcmVsZWFzZV9yZWdpb24oY2FyZC0+aW9iYXNlLCAyNTYpOworICAgICAgICBmcmVlX2RzcF9zdXNwZW5kbWVtKGNhcmQpOworICAgICAgICBrZnJlZShjYXJkKTsKKyAgICB9CisgICAgZGV2cyA9IE5VTEw7Cit9CisKKy8qCisgKiBzb21lIGJpb3NlcyBsaWtlIHRoZSBzb3VuZCBjaGlwIHRvIGJlIHBvd2VyZWQgZG93bgorICogYXQgc2h1dGRvd24uICBXZSdyZSBqdXN0IGNhbGxpbmcgX3N1c3BlbmQgdG8KKyAqIGFjaGlldmUgdGhhdC4uCisgKi8KK3N0YXRpYyBpbnQgbTNfbm90aWZpZXIoc3RydWN0IG5vdGlmaWVyX2Jsb2NrICpuYiwgdW5zaWduZWQgbG9uZyBldmVudCwgdm9pZCAqYnVmKQoreworICAgIHN0cnVjdCBtM19jYXJkICpjYXJkOworCisgICAgRFBSSU5USyhEUE1PRCwgIm5vdGlmaWVyIHN1c3BlbmRpbmcgYWxsIGNhcmRzXG4iKTsKKworICAgIGZvcihjYXJkID0gZGV2czsgY2FyZCAhPSBOVUxMOyBjYXJkID0gY2FyZC0+bmV4dCkgeworICAgICAgICBpZighY2FyZC0+aW5fc3VzcGVuZCkKKyAgICAgICAgICAgIG0zX3N1c3BlbmQoY2FyZC0+cGNpZGV2LCBQTVNHX1NVU1BFTkQpOyAvKiBYWFggbGVnYWw/ICovCisgICAgfQorICAgIHJldHVybiAwOworfQorCitzdGF0aWMgaW50IG0zX3N1c3BlbmQoc3RydWN0IHBjaV9kZXYgKnBjaV9kZXYsIHBtX21lc3NhZ2VfdCBzdGF0ZSkKK3sKKyAgICB1bnNpZ25lZCBsb25nIGZsYWdzOworICAgIGludCBpOworICAgIHN0cnVjdCBtM19jYXJkICpjYXJkID0gcGNpX2dldF9kcnZkYXRhKHBjaV9kZXYpOworCisgICAgLyogbXVzdCBiZSBhIGJldHRlciB3YXkuLiAqLworCXNwaW5fbG9ja19pcnFzYXZlKCZjYXJkLT5sb2NrLCBmbGFncyk7CisKKyAgICBEUFJJTlRLKERQTU9ELCAicG0gaW4gZGV2ICVwXG4iLGNhcmQpOworCisgICAgZm9yKGk9MDtpPE5SX0RTUFM7aSsrKSB7CisgICAgICAgIHN0cnVjdCBtM19zdGF0ZSAqcyA9ICZjYXJkLT5jaGFubmVsc1tpXTsKKworICAgICAgICBpZihzLT5kZXZfYXVkaW8gPT0gLTEpCisgICAgICAgICAgICBjb250aW51ZTsKKworICAgICAgICBEUFJJTlRLKERQTU9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9lbmFibGUoY2FyZCwgMSk7CisKKyAgICAvKiAKKyAgICAgKiBub3cgd2UgZmxpcCBvbiB0aGUgbXVzaWMgCisgICAgICovCisgICAgZm9yKGk9MDtpPE5SX0RTUFM7aSsrKSB7CisgICAgICAgIHN0cnVjdCBtM19zdGF0ZSAqcyA9ICZjYXJkLT5jaGFubmVsc1tpXTsKKyAgICAgICAgaWYocy0+ZGV2X2F1ZGlvID09IC0xKQorICAgICAgICAgICAgY29udGludWU7CisgICAgICAgIC8qCisgICAgICAgICAqIGRiLT5yZWFkeSBtYWtlcyBpdCBzbyB0aGVzZSBndXlzIGNhbiBiZQorICAgICAgICAgKiBjYWxsZWQgdW5jb25kaXRpb25hbGx5Li4KKyAgICAgICAgICovCisgICAgICAgIERQUklOVEsoRFBNT0QsICJ0dXJuaW5nIG9uIGRhY3MgaW5kICVkXG4iLGkpOworICAgICAgICBzdGFydF9kYWMocyk7ICAgIAorICAgICAgICBzdGFydF9hZGMocyk7ICAgIAorICAgIH0KKworICAgIHNwaW5fdW5sb2NrX2lycXJlc3RvcmUoJmNhcmQtPmxvY2ssIGZsYWdzKTsKKworICAgIC8qIAorICAgICAqIGFsbCByaWdodCwgd2UgdGhpbmsgdGhpbmdzIGFyZSByZWFkeSwgCisgICAgICogd2FrZSB1cCBwZW9wbGUgd2hvIHdlcmUgdXNpbmcgdGhlIGRldmljZSAKKyAgICAgKiB3aGVuIHdlIHN1c3BlbmRlZAorICAgICAqLworICAgIHdha2VfdXAoJmNhcmQtPnN1c3BlbmRfcXVldWUpOworCisgICAgcmV0dXJuIDA7Cit9CisKK01PRFVMRV9BVVRIT1IoIlphY2ggQnJvd24gPHphYkB6YWJiby5uZXQ+Iik7CitNT0RVTEVfREVTQ1JJUFRJT04oIkVTUyBNYWVzdHJvMy9BbGxlZ3JvIERyaXZlciIpOworTU9EVUxFX0xJQ0VOU0UoIkdQTCIpOworCisjaWZkZWYgTV9ERUJVRworbW9kdWxlX3BhcmFtKGRlYnVnLCBpbn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RU5BQkxFICAgIDB4MDAwMDAwMDEKKyNkZWZpbmUgRk1fU1lOVEhFU0lTX0VOQUJMRSAgICAgMHgwMDAwMDAwMgorI2RlZmluZSBHQU1FX1BPUlRfRU5BQkxFICAgICAgICAweDAwMDAwMDA0CisjZGVmaW5lIE1QVTQwMV9JT19FTkFCTEUgICAgICAgIDB4MDAwMDAwMDgKKyNkZWZpbmUgTVBVNDAxX0lSUV9FTkFCTEUgICAgICAgMHgwMDAwMDAxMAorI2RlZmluZSBBTElBU18xMEJJVF9JTyAgICAgICAgICAweDAwMDAwMDIwCisjZGVmaW5lIFNCX0RNQV9NQVNLICAgICAgICAgICAgIDB4MDAwMDAwQzAKKyNkZWZpbmUgU0JfRE1BXzAgICAgICAgICAgICAgICAgMHgwMDAwMDA0MAorI2RlZmluZSBTQl9ETUFfMSAgICAgICAgICAgICAgICAweDAwMDAwMDQwCisjZGVmaW5lIFNCX0RNQV9SICAgICAgICAgICAgICAgIDB4MDAwMDAwODAKKyNkZWZpbmUgU0JfRE1BXzMgICAgICAgICAgICAgICAgMHgwMDAwMDBDMAorI2RlZmluZSBTQl9JUlFfTUFTSyAgICAgICAgICAgICAweDAwMDAwNzAwCisjZGVmaW5lIFNCX0lSUV81ICAgICAgICAgICAgICAgIDB4MDAwMDAwMDAKKyNkZWZpbmUgU0JfSVJRXzcgICAgICAgICAgICAgICAgMHgwMDAwMDEwMAorI2RlZmluZSBTQl9JUlFfOSAgICAgICAgICAgICAgICAweDAwMDAwMjAwCisjZGVmaW5lIFNCX0lSUV8xMCAgICAgICAgICAgICAgIDB4MDAwMDAzMDAKKyNkZWZpbmUgTUlESV9JUlFfTUFTSyAgICAgICAgICAgMHgwMDAwMzgwMAorI2RlZmluZSBTRVJJQUxfSVJRX0VOQUJMRSAgICAgICAweDAwMDA0MDAwCisjZGVmaW5lIERJU0FCTEVfTEVHQUNZICAgICAgICAgIDB4MDAwMDgwMDAKKworI2RlZmluZSBQQ0lfQUxMRUdST19DT05GSUcgICAgICAweDUwCisjZGVmaW5lIFNCX0FERFJfMjQwICAgICAgICAgICAgIDB4MDAwMDAwMDQKKyNkZWZpbmUgTVBVX0FERFJfTUFTSyAgICAgICAgICAgMHgwMDAwMDAxOAorI2RlZmluZSBNUFVfQUREUl8zMzAgICAgICAgICAgICAweDAwMDAwMDAwCisjZGVmaW5lIE1QVV9BRERSXzMwMCAgICAgICAgICAgIDB4MDAwMDAwMDgKKyNkZWZpbmUgTVBVX0FERFJfMzIwICAgICAgICAgICAgMHgwMDAwMDAxMAorI2RlZmluZSBNUFVfQUREUl8zNDAgICAgICAgICAgICAweDAwMDAwMDE4CisjZGVmaW5lIFVTRV9QQ0lfVElNSU5HICAgICAgICAgIDB4MDAwMDAwNDAKKyNkZWZpbmUgUE9TVEVEX1dSSVRFX0VOQUJMRSAgICAgMHgwMDAwMDA4MAorI2RlZmluZSBETUFfUE9MSUNZX01BU0sgICAgICAgICAweDAwMDAwNzAwCisjZGVmaW5lIERNQV9ERE1BICAgICAgICAgICAgICAgIDB4MDAwMDAwMDAKKyNkZWZpbmUgRE1BX1RETUEgICAgICAgICAgICAgICAgMHgwMDAwMDEwMAorI2RlZmluZSBETUFfUENQQ0kgICAgICAgICAgICAgICAweDAwMDAwMjAwCisjZGVmaW5lIERNQV9XQkRNQTE2ICAgICAgICAgICAgIDB4MDAwMDA0MDAKKyNkZWZpbmUgRE1BX1dCRE1BNCAgICAgICAgICAgICAgMHgwMDAwMDUwMAorI2RlZmluZSBETUFfV0JETUEyICAgICAgICAgICAgICAweDAwMDAwNjAwCisjZGVmaW5lIERNQV9XQkRNQTEgICAgICAgICAgICAgIDB4MDAwMDA3MDAKKyNkZWZpbmUgRE1BX1NBRkVfR1VBUkQgICAgICAgICAgMHgwMDAwMDgwMAorI2RlZmluZSBISV9QRVJGX0dQX0VOQUJMRSAgICAgICAweDAwMDAxMDAwCisjZGVmaW5lIFBJQ19TTk9PUF9NT0RFXzAgICAgICAgIDB4MDAwMDIwMDAKKyNkZWZpb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jZGVmaW5lIENPREVDX1NUQVRVUyAgICAgICAgICAgIDB4MzAKKyNkZWZpbmUgQ09ERUNfQlVTWV9CICAgICAgICAgICAgMHgwMQorCisjZGVmaW5lIENPREVDX0RBVEEgICAgICAgICAgICAgIDB4MzIKKworI2RlZmluZSBSSU5HX0JVU19DVFJMX0EgICAgICAgICAweDM2CisjZGVmaW5lIFJBQ19QTUVfRU5BQkxFICAgICAgICAgIDB4MDEwMAorI2RlZmluZSBSQUNfU0RGU19FTkFCTEUgICAgICAgICAweDAyMDAKKyNkZWZpbmUgTEFDX1BNRV9FTkFCTEUgICAgICAgICAgMHgwNDAwCisjZGVmaW5lIExBQ19TREZTX0VOQUJMRSAgICAgICAgIDB4MDgwMAorI2RlZmluZSBTRVJJQUxfQUNfTElOS19FTkFCTEUgICAweDEwMDAKKyNkZWZpbmUgSU9fU1JBTV9FTkFCTEUgICAgICAgICAgMHgyMDAwCisjZGVmaW5lIElJU19JTlBVVF9FTkFCTEUgICAgICAgIDB4ODAwMAorCisjZGVmaW5lIFJJTkdfQlVTX0NUUkxfQiAgICAgICAgIDB4MzgKKyNkZWZpbmUgU0VDT05EX0NPREVDX0lEX01BU0sgICAgMHgwMDAzCisjZGVmaW5lIFNQRElGX0ZVTkNfRU5BQkxFICAgICAgIDB4MDAxMAorI2RlZmluZSBTRUNPTkRfQUNfRU5BQkxFICAgICAgICAweDAwMjAKKyNkZWZpbmUgU0JfTU9EVUxFX0lOVEZfRU5BQkxFICAgMHgwMDQwCisjZGVmaW5lIFNTUEVfRU5BQkxFICAgICAgICAgICAgIDB4MDA0MAorI2RlZmluZSBNM0lfRE9DS19FTkFCTEUgICAgICAgICAweDAwODAKKworI2RlZmluZSBTRE9fT1VUX0RFU1RfQ1RSTCAgICAgICAweDNBCisjZGVmaW5lIENPTU1BTkRfQUREUl9PVVQgICAgICAgIDB4MDAwMworI2RlZmluZSBQQ01fTFJfT1VUX0xPQ0FMICAgICAgICAweDAwMDAKKyNkZWZpbmUgUENNX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F9PVVRfTVVURSAgICAgICAgMHgyMDAwCisjZGVmaW5lIEhBTkRTRVRfT1VUX0JPVEggICAgICAgIDB4MzAwMAorI2RlZmluZSBJT19DVFJMX09VVF9MT0NBTCAgICAgICAweDAwMDAKKyNkZWZpbmUgSU9fQ1RSTF9PVVRfUkVNT1RFICAgICAgMHg0MDAwCisjZGVmaW5lIElPX0NUUkxfT1VUX01VVEUgICAgICAgIDB4ODAwMAorI2RlZmluZSBJT19DVFJMX09VVF9CT1RIICAgICAgICAweEMwMDAKKworI2RlZmluZSBTRE9fSU5fREVTVF9DVFJMICAgICAgICAweDNDCisjZGVmaW5lIFNUQVRVU19BRERSX0lOICAgICAgICAgIDB4MDAwMworI2RlZmluZSBQQ01fTFJfSU5fTE9DQUwgICAgICAgICAweDAwMDAKKyNkZWZpbmUgUENNX0xSX0lOX1JFTU9URSAgICAgICAgMHgwMDA0CisjZGVmaW5lIFBDTV9MUl9SRVNFUlZFRCAgICAgICAgIDB4MDAwOAorI2RlZmluZSBQQ01fTFJfSU5fQk9USCAgICAgICAgICAweDAwMEMKKyNkZWZpbmUgTElORTFfQURDX0lOX0xPQ0FMICAgICAgMHgwMDAwCisjZGVmaW5lIExJTkUxX0FEQ19JTl9SRU1PVEUgICAgIDB4MDAxMAorI2RlZmluZSBMSU5FMV9BRENfSU5fTVVURSAgICAgICAweDAwMjAKKyNkZWZpbmUgTUlDX0FEQ19JTl9MT0NBTCAgICAgICAgMHgwMDAwCisjZGVmaW5lIE1JQ19BRENfSU5fUkVNT1RFICAgICAgIDB4MDA0MAorI2RlZmluZSBNSUNfQURDX0lOX01VVEUgICAgICAgICAweDAwODAKKyNkZWZpbmUgTElORTJfREFDX0lOX0xPQ0FMICAgICAgMHgwMDAwCisjZGVmaW5lIExJTkUyX0RBQ19JTl9SRU1PVEUgICAgIDB4MDQwMAorI2RlZmluZSBMSU5FMl9EQUNfSU5fTVVURSAgICAgICAweDA4MDAKKyNkZWZpbmUgSEFORFNFVF9JTl9MT0N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AgICAgICAgICAgNworCisjZGVmaW5lIEtEQVRBX0JBU0VfQUREUiAgICAgICAgICAgICAgICAgMHgxMDAwCisjZGVmaW5lIEtEQVRBX0JBU0VfQUREUjIgICAgICAgICAgICAgICAgMHgxMDgwCisKKyNkZWZpbmUgS0RBVEFfVEFTSzAgICAgICAgICAgICAgICAgICAgICAoS0RBVEFfQkFTRV9BRERSICsgMHgwMDAwKQorI2RlZmluZSBLREFUQV9UQVNLMSAgICAgICAgICAgICAgICAgICAgIChLREFUQV9CQVNFX0FERFIgKyAweDAwMDEpCisjZGVmaW5lIEtEQVRBX1RBU0syICAgICAgICAgICAgICAgICAgICAgKEtEQVRBX0JBU0VfQUREUiArIDB4MDAwMikKKyNkZWZpbmUgS0RBVEFfVEFTSzMgICAgICAgICAgICAgICAgICAgICAoS0RBVEFfQkFTRV9BRERSICsgMHgwMDAzKQorI2RlZmluZSBLREFUQV9UQVNLNCAgICAgICAgICAgICAgICAgICAgIChLREFUQV9CQVNFX0FERFIgKyAweDAwMDQpCisjZGVmaW5lIEtEQVRBX1RBU0s1ICAgICAgICAgICAgICAgICAgICAgKEtEQVRBX0JBU0VfQUREUiArIDB4MDAwNSkKKyNkZWZpbmUgS0RBVEFfVEFTSzYgICAgICAgICAgICAgICAgICAgICAoS0RBVEFfQkFTRV9BRERSICsgMHgwMDA2KQorI2RlZmluZSBLREFUQV9UQVNLNyAgICAgICAgICAgICAgICAgICAgIChLREFUQV9CQVNFX0FERFIgKyAweDAwMDcpCisjZGVmaW5lIEtEQVRBX1RBU0tfRU5ETUFSSyAgICAgICAgICAgICAgKEtEQVRBX0JBU0VfQUREUiArIDB4MDAwOCkKKworI2RlZmluZSBLREFUQV9DVVJSRU5UX1RBU0sgICAgICAgICAgICAgIChLREFUQV9CQVNFX0FERFIgKyAweDAwMDkpCisjZGVmaW5lIEtEQVRBX1RBU0tfU1dJVENIICAgICAgICAgICAgICAgKEtEQVRBX0JBU0VfQUREUiArIDB4MDAwQSkKKworI2RlZmlu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AgICAgIChLREFUQV9CQVNFX0FERFIgKyAweDAwMjMpCisjZGVmaW5lIEtEQVRBX0lOU1RBTkNFMV9DUFlUSFJVICAgICAgICAgKEtEQVRBX0JBU0VfQUREUiArIDB4MDAyNCkKKyNkZWZpbmUgS0RBVEFfSU5TVEFOQ0VfQ1BZVEhSVV9FTkRNQVJLICAoS0RBVEFfQkFTRV9BRERSICsgMHgwMDI1KQorCisjZGVmaW5lIEtEQVRBX0NVUlJFTlRfRE1BICAgICAgICAgICAgICAgKEtEQVRBX0JBU0VfQUREUiArIDB4MDAyNikKKyNkZWZpbmUgS0RBVEFfRE1BX1NXSVRDSCAgICAgICAgICAgICAgICAoS0RBVEFfQkFTRV9BRERSICsgMHgwMDI3KQorI2RlZmluZSBLREFUQV9ETUFfQUNUSVZFICAgICAgICAgICAgICAgIChLREFUQV9CQVNFX0FERFIgKyAweDAwMjgpCisKKyNkZWZpbmUgS0RBVEFfRE1BX1hGRVIwICAgICAgICAgICAgICAgICAoS0RBVEFfQkFTRV9BRERSICsgMHgwMDI5KQorI2RlZmluZSBLREFUQV9ETUFfWEZFUjEgICAgICAgICAgICAgICAgIChLREFUQV9CQVNFX0FERFIgKyAweDAwMkEpCisjZGVmaW5lIEtEQVRBX0RNQV9YRkVSMiAgICAgICAgICAgICAgICAgKEtEQVRBX0JBU0VfQUREUiArIDB4MDAyQikKKyNkZWZpbmUgS0RBVEFfRE1BX1hGRVIzICAgICAgICAgICAgICAgICAoS0RBVEFfQkFTRV9BRERSICsgMHgwMDJDKQorI2RlZmluZSBLREFUQV9ETUFfWEZFUjQgICAgICAgICAgICAgICAgIChLREFUQV9CQVNFX0FERFIgKyAweDAwMkQpCisjZGVmaW5lIEtEQVRBX0RNQV9YRkVSNSAgICAgICAgICAgICAgICAgKEtEQVRBX0JBU0VfQUREUiArIDB4MDAyRSkKKyNkZWZpbmUgS0RBVEFfRE1BX1hGRVI2ICAgICAgICAgICAgICAgICAoS0RBVEFfQkFTRV9BRERSICsgMHgwMDJGKQorI2RlZmluZSBLREFUQV9ETUFfWEZFUjcgICAgICAgICAgICAgICAgIChLREFUQV9CQVNFX0FERFIgKyAweDAwMzApCisjZGVmaW5lIEtEQVRBX0RNQV9YRkVSOCAgICAgICAgICAgICAgICAgKEtEQVRBX0JBU0VfQUREUiArIDB4MDAzMSkKKyNkZWZpbmUgS0RBVEFfRE1BX1hGRVJfRU5ETUFSSyAgICAgICAgICAoS0RBVEFfQkFTRV9BRERSICsgMHgwMDMyKQorCisjZGVmaW5lIEtEQVRBX0kyU19TQU1QTEVfQ09VTlQgICAgICAgICAgKEtEQVRBX0JBU0VfQUREUiArIDB4MDAzMykKKyNkZWZpbmUgS0RBVEFfSTJTX0lOVF9NRVRFUiAgICAgICAgICAgICAoS0RBVEFfQkFTRV9BRERSICsgMHgwMDM0KQorI2RlZmluZSBLREFUQV9JMlNfQUNUSVZFICAgICAgICAgICAgICAgIChLREFUQV9CQVNFX0FERFIgKyAweDAwMzUpCisKKyNkZWZpbmUgS0RBVEFfVElNRVJfQ09VTlRfUkVMT0FEICAgICAgICAoS0RBVEFfQkFTRV9BRERSICsgMHgwMDM2KQorI2RlZmluZSBLREFUQV9USU1FUl9DT1VOVF9DVVJSRU5UICAgICAgIChLREFUQV9CQVNFX0FERFIgKyAweDAwMzcpCisKKyNkZWZpbmUgS0RBVEFfSEFMVF9TWU5DSF9DTElFTlQgICAgICAgICAoS0RBVEFfQkFTRV9BRERSICsgMHgwMDM4KQorI2RlZmluZSBLREFUQV9IQUxUX1NZTkNIX0RNQSAgICAgICAgICAgIChLREFUQV9CQVNFX0FERFIgKyAweDAwMzkpCisjZGVmaW5lIEtEQVRBX0hBTFRfQUNLTk9XTEVER0UgICAgICAgICAgKEtEQVRBX0JBU0VfQUREUiArIDB4MDAzQSkKKworI2RlZmluZSBLREFUQV9BREMxX1hGRVIwICAgICAgICAgICAgICAgIChLREFUQV9CQVNFX0FERFIgKyAweDAwM0IpCisjZGVmaW5lIEtEQVRBX0FEQzFfW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QVRBX0JBU0VfQUREUiArIDB4MDA1NikKKyNkZWZpbmUgS0RBVEFfU1BESUZfRlJBTUUwICAgICAgICAgICAgICAoS0RBVEFfQkFTRV9BRERSICsgMHgwMDU3KQorI2RlZmluZSBLREFUQV9TUERJRl9GUkFNRTEgICAgICAgICAgICAgIChLREFUQV9CQVNFX0FERFIgKyAweDAwNTgpCisjZGVmaW5lIEtEQVRBX1NQRElGX0ZSQU1FMiAgICAgICAgICAgICAgKEtEQVRBX0JBU0VfQUREUiArIDB4MDA1OSkKKworI2RlZmluZSBLREFUQV9TUERJRl9SRVFVRVNUICAgICAgICAgICAgIChLREFUQV9CQVNFX0FERFIgKyAweDAwNUEpCisjZGVmaW5lIEtEQVRBX1NQRElGX1RFTVAgICAgICAgICAgICAgICAgKEtEQVRBX0JBU0VfQUREUiArIDB4MDA1QikKKworI2RlZmluZSBLREFUQV9TUERJRklOX1hGRVIwICAgICAgICAgICAgIChLREFUQV9CQVNFX0FERFIgKyAweDAwNUMpCisjZGVmaW5lIEtEQVRBX1NQRElGSU5fWEZFUl9FTkRNQVJLICAgICAgKEtEQVRBX0JBU0VfQUREUiArIDB4MDA1RCkKKyNkZWZpbmUgS0RBVEFfU1BESUZJTl9JTlRfTUVURVIgICAgICAgICAoS0RBVEFfQkFTRV9BRERSICsgMHgwMDVFKQorCisjZGVmaW5lIEtEQVRBX0RTUF9SRVNFVF9DT1VOVCAgICAgICAgICAgKEtEQVRBX0JBU0VfQUREUiArIDB4MDA1RikKKyNkZWZpbmUgS0RBVEFfREVCVUdfT1VUUFVUICAgICAgICAgICAgICAoS0RBVEFfQkFTRV9BRERSICsgMHgwMDYwKQorCisjZGVmaW5lIEtEQVRBX0tFUk5FTF9JU1JfTElTVCAgICAgICAgICAgKEtEQVRBX0JBU0VfQUREUiArIDB4MDA2MSkKKworI2RlZmluZSBLREFUQV9LRVJORUxfSVNSX0NCU1IxICAgICAgICAgIChLREFUQV9CQVNFX0FERFIgKyAweDAwNjIpCisjZGVma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ZmluZSBLREFUQV9NSUNfU1lOQ19DT1VOVEVSCQkJKEtEQVRBX0JBU0VfQUREUiArIDB4MDA3QykKKworLyoKKyAqIHNlY29uZCAnc2VnbWVudCcgKD8pIHJlc2VydmVkIGZvciBtaXhlcgorICogYnVmZmVycy4uCisgKi8KKworI2RlZmluZSBLREFUQV9NSVhFUl9XT1JEMCAgICAgICAgICAgICAgIChLREFUQV9CQVNFX0FERFIyICsgMHgwMDAwKQorI2RlZmluZSBLREFUQV9NSVhFUl9XT1JEMSAgICAgICAgICAgICAgIChLREFUQV9CQVNFX0FERFIyICsgMHgwMDAxKQorI2RlZmluZSBLREFUQV9NSVhFUl9XT1JEMiAgICAgICAgICAgICAgIChLREFUQV9CQVNFX0FERFIyICsgMHgwMDAyKQorI2RlZmluZSBLREFUQV9NSVhFUl9XT1JEMyAgICAgICAgICAgICAgIChLREFUQV9CQVNFX0FERFIyICsgMHgwMDAzKQorI2RlZmluZSBLREFUQV9NSVhFUl9XT1JENCAgICAgICAgICAgICAgIChLREFUQV9CQVNFX0FERFIyICsgMHgwMDA0KQorI2RlZmluZSBLREFUQV9NSVhFUl9XT1JENSAgICAgICAgICAgICAgIChLREFUQV9CQVNFX0FERFIyICsgMHgwMDA1KQorI2RlZmluZSBLREFUQV9NSVhFUl9XT1JENiAgICAgICAgICAgICAgIChLREFUQV9CQVNFX0FERFIyICsgMHgwMDA2KQorI2RlZmluZSBLREFUQV9NSVhFUl9XT1JENyAgICAgICAgICAgICAgIChLREFUQV9CQVNFX0FERFIyICsgMHgwMDA3KQorI2RlZmluZSBLREFUQV9NSVhFUl9XT1JEOCAgICAgICAgICAgICAgIChLREFUQV9CQVNFX0FERFIyICsgMHgwMDA4KQorI2RlZmluZSBLREFUQV9NSVhFUl9XT1JEOSAgICAgICAgICAgICAgIChLREFUQV9CQVNFX0FERFIyICsgMHgwMDA5KQorI2RlZmluZSBLREFUQV9NSVhFUl9XT1JEQSAgICAgICAgICAgICAgIChLREFUQV9CQVNFX0FERFIyICsgMHgwMDBBKQorI2RlZmluZSBLREFUQV9NSVhFUl9XT1JEQiAgICAgICAgICAgICAgIChLREFUQV9CQVNFX0FERFIyICsgMHgwMDBCKQorI2RlZmluZSBLREFUQV9NSVhFUl9XT1JEQyAgICAgICAgICAgICAgIChLREFUQV9CQVNFX0FERFIyICsgMHgwMDBDKQorI2RlZmluZSBLREFUQV9NSVhFUl9XT1JERCAgICAgICAgICAgICAgIChLREFUQV9CQVNFX0FERFIyICsgMHgwMDBEKQorI2RlZmluZSBLREFUQV9NSVhFUl9XT1JERSAgICAgICAgICAgICAgIChLREFUQV9CQVNFX0FERFIyICsgMHgwMDBFKQorI2RlZmluZSBLREFUQV9NSVhFUl9XT1JERiAgICAgICAgICAgICAgIChLREFUQV9CQVNFX0FERFIyICsgMHgwMDBGKQorCisjZGVmaW5lIEtEQVRBX01JWEVSX1hGRVIwICAgICAgICAgICAgICAgKEtEQVRBX0JBU0VfQUREUjIgKyAweDAwMTApCisjZGVmaW5lIEtEQVRBX01JWEVSX1hGRVIxICAgICAgICAgICAgICAgKEtEQVRBX0JBU0VfQUREUjIgKyAweDAwMTEpCisjZGVmaW5lIEtEQVRBX01JWEVSX1hGRVIyICAgICAgICAgICAgICAgKEtEQVRBX0JBU0VfQUREUjIgKyAweDAwMTIpCisjZGVmaW5lIEtEQVRBX01JWEVSX1hGRVIzICAgICAgICAgICAgICAgKEtEQVRBX0JBU0VfQUREUjIgKyAweDAwMTMpCisjZGVmaW5lIEtEQVRBX01JWEVSX1hGRVI0ICAgICAgICAgICAgICAgKEtEQVRBX0JBU0VfQUREUjIgKyAweDAwMTQpCisjZGVmaW5lIEtEQVRBX01JWEVSX1hGRVI1ICAgICAgICAgICAgICAgKEtEQVRBX0JBU0VfQUREUjIgKyAweDAwMTUpCisjZGVmaW5lIEtEQVRBX01JWEVSX1hGRVI2ICAgICAgICAgICAgICAgKEtEQVRBX0JBU0VfQUREUjIgKyAweDAwMTYpCisjZGVmaW5lIEtEQVRBX01J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V9YRkVSX0VORE1BUksgLSBLREFUQV9ETUFfWEZFUjApCisjZGVmaW5lIE1BWF9WSVJUVUFMX01JWEVSX0NIQU5ORUxTICAgICAgKEtEQVRBX01JWEVSX1hGRVJfRU5ETUFSSyAtIEtEQVRBX01JWEVSX1hGRVIwKQorI2RlZmluZSBNQVhfVklSVFVBTF9BREMxX0NIQU5ORUxTICAgICAgIChLREFUQV9BREMxX1hGRVJfRU5ETUFSSyAtIEtEQVRBX0FEQzFfWEZFUjApCisKKy8qCisgKiBjbGllbnQgZGF0YSBhcmVhIG9mZnNldHMKKyAqLworI2RlZmluZSBDREFUQV9JTlNUQU5DRV9SRUFEWSAgICAgICAgICAgIDB4MDAKKworI2RlZmluZSBDREFUQV9IT1NUX1NSQ19BRERSTCAgICAgICAgICAgIDB4MDEKKyNkZWZpbmUgQ0RBVEFfSE9TVF9TUkNfQUREUkggICAgICAgICAgICAweDAyCisjZGVmaW5lIENEQVRBX0hPU1RfU1JDX0VORF9QTFVTXzFMICAgICAgMHgwMworI2RlZmluZSBDREFUQV9IT1NUX1NSQ19FTkRfUExVU18xSCAgICAgIDB4MDQKKyNkZWZpbmUgQ0RBVEFfSE9TVF9TUkNfQ1VSUkVOVEwgICAgICAgICAweDA1CisjZGVmaW5lIENEQVRBX0hPU1RfU1JDX0NVUlJFTlRIICAgICAgICAgMHgwNgorCisjZGVmaW5lIENEQVRBX0lOX0JVRl9DT05ORUNUICAgICAgICAgICAgMHgwNworI2RlZmluZSBDREFUQV9PVVRfQlVGX0NPTk5FQ1QgICAgICAgICAgIDB4MDgKKworI2RlZmluZSBDREFUQV9JTl9CVUZfQkVHSU4gICAgICAgICAgICAgIDB4MDkKKyNkZWZpbmUgQ0RBVEFfSU5fQlVGX0VORF9QTFVTXzEgICAgICAgICAweDBBCisjZGVmaW5lIENEQVRBX0lOX0JVRl9IRUFEICAgICAgICAgICAgICAgMHgwQgorI2RlZmluZSBDREFUQV9JTl9CVUZfVEFJTCAgICAgICAgICAgICAgIDB4MEMKKyNkZWZpbmUgQ0RBVEFfT1VUX0JVRl9CRUdJTiAgICAgICAgICAgICAweDBECisjZGVmaW5lIENEQVRBX09VVF9CVUZfRU5EX1BMVVNfMSAgICAgICAgMHgwRQorI2RlZmluZSBDREFUQV9PVVRfQlVGX0hFQUQgICAgICAgICAgICAgIDB4MEYKKyNkZWZpbmUgQ0RBVEFfT1VUX0JVRl9UQUlMICAgICAgICAgICAgICAweDEwCisKKyNkZWZpbmUgQ0RBVEFfRE1BX0NPTlRST0wgICAgICAgICAgICAgICAweDExCisjZGVmaW5lIENEQVRBX1JFU0VSVkVEICAgICAgICAgICAgICAgICAgMHgxMgorCisjZGVmaW5lIENEQVRBX0ZSRVFVRU5DWSAgICAgICAgICAgICAgICAgMHgxMworI2RlZmluZSBDREFUQV9MRUZUX1ZPTFVNRSAgICAgICAgICAgICAgIDB4MTQKKyNkZWZpbmUgQ0RBVEFfUklHSFRfVk9MVU1FICAgICAgICAgICAgICAweDE1CisjZGVmaW5lIENEQVRBX0xFRlRfU1VSX1ZPTCAgICAgICAgICAgICAgMHgxNgorI2RlZmluZSBDREFUQV9SSUdIVF9TVVJfVk9MICAgICAgICAgICAgIDB4MTcKKworI2RlZmluZSBDREFUQV9IRUFERVJfTEVOICAgICAgICAgICAgICAgIDB4MTgKKworI2RlZmluZSBTUkMzX0RJUkVDVElPTl9PRkZTRVQgICAgICAgICAgIENEQVRBX0hFQURFUl9MRU4KKyNkZWZpbmUgU1JDM19NT0RFX09GRlNFVCAgICAgICAgICAgICAgICAoQ0RBVEFfSEVBREVSX0xFTiArIDEpCisjZGVmaW5lIFNSQzNfV09SRF9MRU5HVEhfT0ZGU0VUICAgICAgICAgKENEQVRBX0hFQURFUl9MRU4gKyAyKQorI2RlZmluZSBTUkMzX1BBUkFNRVRFUl9PRkZTRVQgICAgICAgICAgIChDREFUQV9IRUFERVJfTEVOICsgMykKKyNkZWZpbmUgU1JDM19DT0VGRl9BRERSX09GRlNFVCAgICAgICAgICAo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B0bXAxLCB0bXAyKTsKKworCWlmICghbWF1aV93cml0ZSgweDlGKSkJLyogUmVwb3J0IGZpcm13YXJlIHZlcnNpb24gKi8KKwkJZ290byBvdXQzOworCWlmICgodG1wMSA9IG1hdWlfcmVhZCgpKSA9PSAtMSB8fCAodG1wMiA9IG1hdWlfcmVhZCgpKSA9PSAtMSkKKwkJZ290byBvdXQzOworCisJcHJpbnRrKEtFUk5fREVCVUcgIldhdmVGcm9udCBmaXJtd2FyZSB2ZXJzaW9uICVkLiVkXG4iLCB0bXAxLCB0bXAyKTsKKworCWlmICghbWF1aV93cml0ZSgweDg1KSkJLyogUmVwb3J0IGZyZWUgRFJBTSAqLworCQlnb3RvIG91dDM7CisJdG1wMSA9IDA7CisJZm9yIChpID0gMDsgaSA8IDQ7IGkrKykgeworCQl0bXAxIHw9IG1hdWlfcmVhZCgpIDw8ICg3ICogaSk7CisJfQorCXByaW50ayhLRVJOX0RFQlVHICJBdmFpbGFibGUgRFJBTSAlZGtcbiIsIHRtcDEgLyAxMDI0KTsKKworCWZvciAoaSA9IDA7IGkgPCAxMDAwOyBpKyspCisJCWlmIChwcm9iZV9tcHU0MDEoaHdfY29uZmlnLCBwb3J0cykpCisJCQlicmVhazsKKworCXJldCA9IHByb2JlX21wdTQwMShod19jb25maWcsIHBvcnRzKTsKKwlpZiAoIXJldCkKKwkJZ290byBvdXQzOworCisJY29uZl9wcmludGYoIk1hdWkiLCBod19jb25maWcpOworCisJaHdfY29uZmlnLT5pcnEgKj0gLTE7CisJaHdfY29uZmlnLT5uYW1lID0gIk1hdWkiOworCWF0dGFjaF9tcHU0MDEoaHdfY29uZmlnLCBUSElTX01PRFVMRSk7CisKKwlpZiAoaHdfY29uZmlnLT5zbG90c1sxXSAhPSAtMSkJLyogVGhlIE1QVTQwMSBkcml2ZXIgaW5zdGFsbGVkIGl0c2VsZiAqLyB7CisJCXN0cnVjdCBzeW50aF9vcGVyYXRpb25zICpzeW50aDsKKworCQl0aGlzX2RldiA9IGh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c3RhdGVbZGV2XSA9IDA7Cit9CisKK3N0YXRpYyB2b2lkCittaWRpX3N5bnRoX291dHB1dChpbnQgZGV2KQoreworCS8qCisJICogQ3VycmVudGx5IE5PUAorCSAqLworfQorCitpbnQgbWlkaV9zeW50aF9pb2N0bChpbnQgZGV2LCB1bnNpZ25lZCBpbnQgY21kLCB2b2lkIF9fdXNlciAqYXJnKQoreworCS8qCisJICogaW50IG9yaWdfZGV2ID0gc3ludGhfZGV2c1tkZXZdLT5taWRpX2RldjsKKwkgKi8KKworCXN3aXRjaCAoY21kKSB7CisKKwljYXNlIFNORENUTF9TWU5USF9JTkZPOgorCQlpZiAoX19jb3B5X3RvX3VzZXIoYXJnLCBzeW50aF9kZXZzW2Rldl0tPmluZm8sIHNpemVvZihzdHJ1Y3Qgc3ludGhfaW5mbykpKQorCQkJcmV0dXJuIC1FRkFVTFQ7CisJCXJldHVybiAwOworCQkKKwljYXNlIFNORENUTF9TWU5USF9NRU1BVkw6CisJCXJldHVybiAweDdmZmZmZmZmOworCisJZGVmYXVsdDoKKwkJcmV0dXJuIC1FSU5WQUw7CisJfQorfQorCitpbnQKK21pZGlfc3ludGhfa2lsbF9ub3RlKGludCBkZXYsIGludCBjaGFubmVsLCBpbnQgbm90ZSwgaW50IHZlbG9jaXR5KQoreworCWludCAgICAgICAgICAgICBvcmlnX2RldiA9IHN5bnRoX2RldnNbZGV2XS0+bWlkaV9kZXY7CisJaW50ICAgICAgICAgICAgIG1zZywgY2huOworCisJaWYgKG5vdGUgPCAwIHx8IG5vdGUgPiAxMjcpCisJCXJldHVybiAwOworCWlmIChjaGFubmVsIDwgMCB8fCBjaGFubmVsID4gMTUpCisJCXJldHVybiAwOworCWlmICh2ZWxvY2l0eSA8IDApCisJCXZlbG9jaXR5ID0gMDsKKwlpZiAodmVsb2NpdHkgPiAxMjcpCisJCXZlbG9jaXR5ID0gMTI3OworCisJbGVhdmVfc3lzZXgoZGV2KTsKKworCW1zZyA9IHByZXZfb3V0X3N0YXR1c1tvcmlnX2Rldl0gJiAweGYwOworCWNobiA9IHByZXZfb3V0X3N0YXR1c1tvcmlnX2Rldl0gJiAweDBmOworCisJaWYgKGNobiA9PSBjaGFubmVsICYmICgobXNnID09IDB4OTAgJiYgdmVsb2NpdHkgPT0gNjQpIHx8IG1zZyA9PSAweDgwKSkKKwkgIHsJCQkvKgorCQkJCSAqIFVzZSBydW5uaW5nIHN0YXR1cworCQkJCSAqLworCQkgIGlmICghcHJlZml4X2NtZChvcmlnX2Rldiwgbm90ZSkpCisJCQkgIHJldHVybiAwOworCisJCSAgbWlkaV9vdXRjKG9yaWdfZGV2LCBub3RlKTsKKworCQkgIGlmIChtc2cgPT0gMHg5MCkJLyoKKwkJCQkJICogUnVubmluZyBzdGF0dXMgPSBOb3RlIG9uCisJCQkJCSAqLworCQkJICBtaWRpX291dGMob3JpZ19kZXYsIDApOwkvKgorCQkJCQkJCSAgICogTm90ZSBvbiB3aXRoIHZlbG9jaXR5IDAgPT0gbm90ZQorCQkJCQkJCSAgICogb2ZmCisJCQkJCQkJICovCisJCSAgZWxzZQorCQkJICBtaWRpX291dGMob3JpZ19kZXYsIHZlbG9jaXR5KTsKKwl9IGVsc2UKKwkgIHsKKwkJICBpZiAodmVsb2NpdHkgPT0gNjQpCisJCSAgICB7CisJCQkgICAgaWYgKCFwcmVmaXhfY21kKG9yaWdfZGV2LCAweDkwIHwgKGNoYW5uZWwgJiAweDBmKSkpCisJCQkJICAgIHJldHVybiAwOworCQkJICAgIG1pZGlfb3V0YyhvcmlnX2RldiwgMHg5MCB8IChjaGFubmVsICYgMHgwZikpOwkvKgorCQkJCQkJCQkJCSAqIE5vdGUgb24KKwkJCQkJCQkJCQkgKi8KKwkJCSAgICBtaWRpX291dGMob3JpZ19kZXYsIG5vdGUpOworCQkJICAgIG1pZGlfb3V0YyhvcmlnX2RldiwgMCk7CS8qCisJCQkJCQkJICogWmVybyBHCisJCQkJCQkJICovCisJCSAgfSBlbHNlCisJCSAgICB7CisJCQk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VlbiA9IChpID4gMCAmJiBkYXRhICYgMHg4MCk7CS8qIEVuZCBvZiBzeXNleCAqLworCisJCWlmIChlb3hfc2VlbiAmJiBkYXRhICE9IDB4ZjcpCisJCQlkYXRhID0gMHhmNzsKKworCQlpZiAoaSA9PSAwKQorCQl7CisJCQlpZiAoZGF0YSAhPSAweGYwKQorCQkJeworCQkJCXByaW50ayhLRVJOX1dBUk5JTkcgIm1pZGlfc3ludGg6IFN5c2V4IHN0YXJ0IG1pc3NpbmdcbiIpOworCQkJCXJldHVybiAtRUlOVkFMOworCQkJfQorCQl9CisJCXdoaWxlICghbWlkaV9kZXZzW29yaWdfZGV2XS0+b3V0cHV0YyhvcmlnX2RldiwgKHVuc2lnbmVkIGNoYXIpIChkYXRhICYgMHhmZikpICYmCisJCQkhc2lnbmFsX3BlbmRpbmcoY3VycmVudCkpCisJCQlzY2hlZHVsZSgpOworCisJCWlmICghZmlyc3RfYnl0ZSAmJiBkYXRhICYgMHg4MCkKKwkJCXJldHVybiAwOworCQlmaXJzdF9ieXRlID0gMDsKKwl9CisKKwlpZiAoIWVveF9zZWVuKQorCQltaWRpX291dGMob3JpZ19kZXYsIDB4ZjcpOworCXJldHVybiAwOworfQorICAKK3ZvaWQgbWlkaV9zeW50aF9wYW5uaW5nKGludCBkZXYsIGludCBjaGFubmVsLCBpbnQgcHJlc3N1cmUpCit7Cit9CisgIAordm9pZCBtaWRpX3N5bnRoX2FmdGVydG91Y2goaW50IGRldiwgaW50IGNoYW5uZWwsIGludCBwcmVzc3VyZSkKK3sKKwlpbnQgICAgICAgICAgICAgb3JpZ19kZXYgPSBzeW50aF9kZXZzW2Rldl0tPm1pZGlfZGV2OworCWludCAgICAgICAgICAgICBtc2csIGNobjsKKworCWlmIChwcmVzc3VyZSA8IDAgfHwgcHJlc3N1cmUgPiAxMjcpCisJCXJldHVybjsKKwlpZiAoY2hhbm5lbCA8IDAgfHwgY2hhbm5lbCA+IDE1KQorCQlyZXR1cm47CisKKwlsZWF2ZV9zeXNleChkZXYpOworCisJbXNnID0gcHJldl9vdXRfc3RhdHVzW29yaWdfZGV2XSAmIDB4ZjA7CisJY2huID0gcHJldl9vdXRfc3RhdHVzW29yaWdfZGV2XSAmIDB4MGY7CisKKwlpZiAobXNnICE9IDB4ZDAgfHwgY2huICE9IGNoYW5uZWwpCS8qCisJCQkJCQkgKiBUZXN0IGZvciBydW5uaW5nIHN0YXR1cworCQkJCQkJICovCisJICB7CisJCSAgaWYgKCFwcmVmaXhfY21kKG9yaWdfZGV2LCAweGQwIHwgKGNoYW5uZWwgJiAweDBmKSkpCisJCQkgIHJldHVybjsKKwkJICBtaWRpX291dGMob3JpZ19kZXYsIDB4ZDAgfCAoY2hhbm5lbCAmIDB4MGYpKTsJCS8qCisJCQkJCQkJCQkgKiBDaGFubmVsIHByZXNzdXJlCisJCQkJCQkJCQkgKi8KKwl9IGVsc2UgaWYgKCFwcmVmaXhfY21kKG9yaWdfZGV2LCBwcmVzc3VyZSkpCisJCXJldHVybjsKKworCW1pZGlfb3V0YyhvcmlnX2RldiwgcHJlc3N1cmUpOworfQorCit2b2lkCittaWRpX3N5bnRoX2NvbnRyb2xsZXIoaW50IGRldiwgaW50IGNoYW5uZWwsIGludCBjdHJsX251bSwgaW50IHZhbHVlKQoreworCWludCAgICAgICAgICAgICBvcmlnX2RldiA9IHN5bnRoX2RldnNbZGV2XS0+bWlkaV9kZXY7CisJaW50ICAgICAgICAgICAgIGNobiwgbXNnOworCisJaWYgKGN0cmxfbnVtIDwgMCB8fCBjdHJsX251bSA+IDEyNykKKwkJcmV0dXJuOworCWlmIChjaGFubmVsIDwgMCB8fCBjaGFubmVsID4gMTUpCisJCXJldHVybjsKKworCWxlYXZlX3N5c2V4KGRldik7CisKKwltc2cgPSBwcmV2X291dF9zdGF0dXNbb3JpZ19kZXZdICYgMHhmMDsKKwljaG4gPSBwcmV2X291dF9zdGF0dXNbb3JpZ19kZXZdICYgMHgwZjsKKworCWlmIChtc2cgIT0gMHhiMCB8f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CIKKworc3RhdGljIGludCAgICAgIHRpbWVyX21vZGUgPSBUTVJfSU5URVJOQUwsIHRpbWVyX2NhcHMgPSBUTVJfSU5URVJOQUw7CisKK3N0cnVjdCBtcHVfY29uZmlnCit7CisJaW50ICAgICAgICAgICAgIGJhc2U7CS8qCisJCQkJICogSS9PIGJhc2UKKwkJCQkgKi8KKwlpbnQgICAgICAgICAgICAgaXJxOworCWludCAgICAgICAgICAgICBvcGVuZWQ7CS8qCisJCQkJICogT3BlbiBtb2RlCisJCQkJICovCisJaW50ICAgICAgICAgICAgIGRldm5vOworCWludCAgICAgICAgICAgICBzeW50aG5vOworCWludCAgICAgICAgICAgICB1YXJ0X21vZGU7CisJaW50ICAgICAgICAgICAgIGluaXRpYWxpemVkOworCWludCAgICAgICAgICAgICBtb2RlOworI2RlZmluZSBNT0RFX01JREkJMQorI2RlZmluZSBNT0RFX1NZTlRICTIKKwl1bnNpZ25lZCBjaGFyICAgdmVyc2lvbiwgcmV2aXNpb247CisJdW5zaWduZWQgaW50ICAgIGNhcGFiaWxpdGllczsKKyNkZWZpbmUgTVBVX0NBUF9JTlRMRwkweDEwMDAwMDAwCisjZGVmaW5lIE1QVV9DQVBfU1lOQwkweDAwMDAwMDEwCisjZGVmaW5lIE1QVV9DQVBfRlNLCTB4MDAwMDAwMjAKKyNkZWZpbmUgTVBVX0NBUF9DTFMJMHgwMDAwMDA0MAorI2RlZmluZSBNUFVfQ0FQX1NNUFRFIAkweDAwMDAwMDgwCisjZGVmaW5lIE1QVV9DQVBfMlBPUlQJMHgwMDAwMDAwMQorCWludCAgICAgICAgICAgICB0aW1lcl9mbGFnOworCisjZGVmaW5lIE1CVUZfTUFYCTEwCisjZGVmaW5lIEJVRlRFU1QoZGMpIGlmIChkYy0+bV9wdHIgPj0gTUJVRl9NQVggfHwgZGMtPm1fcHRyIDwgMCkgXAorCXtwcmludGsoICJNUFU6IEludmFsaWQgYnVmZmVyIHBvaW50ZXIgJWQvJWQsIHM9JWRcbiIsICBkYy0+bV9wdHIsICBkYy0+bV9sZWZ0LCAgZGMtPm1fc3RhdGUpO2RjLT5tX3B0ci0tO30KKwkgIGludCAgICAgICAgICAgICBtX2J1c3k7CisJICB1bnNpZ25lZCBjaGFyICAgbV9idWZbTUJVRl9NQVhdOworCSAgaW50ICAgICAgICAgICAgIG1fcHRyOworCSAgaW50ICAgICAgICAgICAgIG1fc3RhdGU7CisJICBpbnQgICAgICAgICAgICAgbV9sZWZ0OworCSAgdW5zaWduZWQgY2hhciAgIGxhc3Rfc3RhdHVzOworCSAgdm9pZCAgICAgICAgICAgICgqaW5wdXRpbnRyKSAoaW50IGRldiwgdW5zaWduZWQgY2hhciBkYXRhKTsKKwkgIGludCAgICAgICAgICAgICBzaGFyZWRfaXJxOworCSAgaW50ICAgICAgICAgICAgKm9zcDsKKwkgIHNwaW5sb2NrX3QJbG9jazsKKyAgfTsKKworI2RlZmluZQlEQVRBUE9SVChiYXNlKSAgIChiYXNlKQorI2RlZmluZQlDT01EUE9SVChiYXNlKSAgIChiYXNlKzEpCisjZGVmaW5lCVNUQVRQT1JUKGJhc2UpICAgKGJhc2UrMSkKKworCitzdGF0aWMgdm9pZCBtcHU0MDFfY2xvc2UoaW50IGRldik7CisKK3N0YXRpYyBpbmxpbmUgaW50IG1wdTQwMV9zdGF0dXMoc3RydWN0IG1wdV9jb25maWcgKmRldmMpCit7CisJcmV0dXJuIGluYihTVEFUUE9SVChkZXZjLT5iYXNlKSk7Cit9CisKKyNkZWZpbmUgaW5wdXRfYXZhaWwoZGV2YykJCSghKG1wdTQwMV9zdGF0dXMoZGV2YykmSU5QVVRfQVZBSUwpKQorI2RlZmluZSBvdXRwdXRfcmVhZHkoZGV2YykJCSghKG1wdTQwMV9zdGF0dXMoZGV2YykmT1VUUFVUX1JFQURZKSkKKworc3RhdGljIGlubGluZSB2b2lkIHdyaXRlX2NvbW1hbmQoc3RydWN0IG1wdV9jb25maWcgKmRldmMsIHVuc2lnbmVkIGNoYXIgY21kKQoreworC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ZXR1cm4gcmV0OworCXJldHVybiAodW5zaWduZWQgY2hhcikgcmVjLmRhdGFbMF07Cit9CisKK3N0YXRpYyBpbnQgbXB1NDAxX3ByZWZpeF9jbWQoaW50IGRldiwgdW5zaWduZWQgY2hhciBzdGF0dXMpCit7CisJc3RydWN0IG1wdV9jb25maWcgKmRldmMgPSAmZGV2X2NvbmZbZGV2XTsKKworCWlmIChkZXZjLT51YXJ0X21vZGUpCisJCXJldHVybiAxOworCisJaWYgKHN0YXR1cyA8IDB4ZjApCisJeworCQlpZiAobXB1X2NtZChkZXYsIDB4RDAsIDApIDwgMCkKKwkJCXJldHVybiAwOworCQlyZXR1cm4gMTsKKwl9CisJc3dpdGNoIChzdGF0dXMpCisJeworCQljYXNlIDB4RjA6CisJCQlpZiAobXB1X2NtZChkZXYsIDB4REYsIDApIDwgMCkKKwkJCQlyZXR1cm4gMDsKKwkJCXJldHVybiAxOworCisJCWRlZmF1bHQ6CisJCQlyZXR1cm4gMDsKKwl9Cit9CisKK3N0YXRpYyBpbnQgbXB1NDAxX3N0YXJ0X3JlYWQoaW50IGRldikKK3sKKwlyZXR1cm4gMDsKK30KKworc3RhdGljIGludCBtcHU0MDFfZW5kX3JlYWQoaW50IGRldikKK3sKKwlyZXR1cm4gMDsKK30KKworc3RhdGljIGludCBtcHU0MDFfaW9jdGwoaW50IGRldiwgdW5zaWduZWQgY21kLCB2b2lkIF9fdXNlciAqYXJnKQoreworCXN0cnVjdCBtcHVfY29uZmlnICpkZXZjOworCW1wdV9jb21tYW5kX3JlYyByZWM7CisJaW50IHZhbCwgcmV0OworCisJZGV2YyA9ICZkZXZfY29uZltkZXZdOworCXN3aXRjaCAoY21kKSAKKwl7CisJCWNhc2UgU05EQ1RMX01JRElfTVBVTU9ERToKKwkJCWlmICghKGRldmMtPmNhcGFiaWxpdGllcyAmIE1QVV9DQVBfSU5UTEcpKSB7IC8qIE5vIGludGVsbGlnZW50IG1vZGUgKi8KKwkJCQlwcmludGsoS0VSTl9XQV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Y29uZmlnLT5pb19iYXNlKSk7CisJCXJldHVybiAwOwkvKiBKdXN0IGJ1cyBmbG9hdD8gKi8KKwl9CisJb2sgPSByZXNldF9tcHU0MDEoJnRtcF9kZXZjKTsKKworCWlmICghb2spCisJeworCQlEREIocHJpbnRrKCJNUFU0MDE6IFJlc2V0IGZhaWxlZCBvbiBwb3J0ICV4XG4iLCBod19jb25maWctPmlvX2Jhc2UpKTsKKwl9CisJcmV0dXJuIG9rOworfQorCit2b2lkIHVubG9hZF9tcHU0MDEoc3RydWN0IGFkZHJlc3NfaW5mbyAqaHdfY29uZmlnKQoreworCXZvaWQgKnA7CisJaW50IG49aHdfY29uZmlnLT5zbG90c1sxXTsKKwkJCisJaWYgKG4gIT0gLTEpIHsKKwkJcmVsZWFzZV9yZWdpb24oaHdfY29uZmlnLT5pb19iYXNlLCAyKTsKKwkJaWYgKGh3X2NvbmZpZy0+YWx3YXlzX2RldGVjdCA9PSAwICYmIGh3X2NvbmZpZy0+aXJxID4gMCkKKwkJCWZyZWVfaXJxKGh3X2NvbmZpZy0+aXJxLCAodm9pZCAqKW4pOworCQlwPW1wdTQwMV9zeW50aF9vcGVyYXRpb25zW25dOworCQlzb3VuZF91bmxvYWRfbWlkaWRldihuKTsKKwkJc291bmRfdW5sb2FkX3RpbWVyZGV2KGh3X2NvbmZpZy0+c2xvdHNbMl0pOworCQlpZihwKQorCQkJa2ZyZWUocCk7CisJfQorfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICAgICAgVGltZXIgc3R1ZmYKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgdm9sYXRpbGUgaW50IHRpbWVyX2luaXRpYWxpemVkID0gMCwgdGltZXJfb3BlbiA9IDAsIHRtcl9ydW5uaW5nID0gMDsKK3N0YXRpYyB2b2xhdGlsZSBpbnQgY3Vycl90ZW1wbywgY3Vycl90a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A9IDA7CisJCQlicmVhazsKKworCQljYXNlIFRNUl9DT05USU5VRToKKwkJCWlmICh0bXJfcnVubmluZykKKwkJCQlicmVhazsKKwkJCW1wdV9jbWQobWlkaV9kZXYsIDB4MDMsIDApOwkvKiBTZW5kIE1JREkgY29udGludWUgKi8KKwkJCXNldHVwX21ldHJvbm9tZShtaWRpX2Rldik7CisJCQl0bXJfcnVubmluZyA9IDE7CisJCQlicmVhazsKKworCQljYXNlIFRNUl9URU1QTzoKKwkJCWlmIChwYXJtKQorCQkJeworCQkJCWlmIChwYXJtIDwgOCkKKwkJCQkJcGFybSA9IDg7CisJCQkgCWlmIChwYXJtID4gMjUwKQorCQkJCQlwYXJtID0gMjUwOworCQkJCWlmIChtcHVfY21kKG1pZGlfZGV2LCAweEUwLCBwYXJtKSA8IDApCisJCQkJCXByaW50ayhLRVJOX1dBUk5JTkcgIm1wdTQwMTogQ2FuJ3Qgc2V0IHRlbXBvIHRvICVkXG4iLCAoaW50KSBwYXJtKTsKKwkJCQljdXJyX3RlbXBvID0gcGFybTsKKwkJCX0KKwkJCWJyZWFrOworCisJCWNhc2UgVE1SX0VDSE86CisJCQlzZXFfY29weV90b19pbnB1dChldmVudCwgOCk7CisJCQlicmVhazsKKworCQljYXNlIFRNUl9USU1FU0lHOgorCQkJaWYgKG1ldHJvbm9tZV9tb2RlKQkvKiBNZXRyb25vbWUgZW5hYmxlZCAqLworCQkJeworCQkJCW1ldHJvbm9tZV9tb2RlID0gcGFybTsKKwkJCQlzZXR1cF9tZXRyb25vbWUobWlkaV9kZXYpOworCQkJfQorCQkJYnJlYWs7CisKKwkJZGVmYXVsdDo7CisJfQorCXJldHVybiBUSU1FUl9OT1RfQVJNRUQ7Cit9CisKK3N0YXRpYyB1bnNpZ25lZCBsb25nIG1wdV90aW1lcl9nZXRfdGltZShpbnQgZGV2KQoreworCWlmICghdGltZXJfb3BlbikKKwkJcmV0dXJuIDA7CisKKwlyZXR1cm4gY3Vycl90aWNrczsKK30KKworc3R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Lworc3RhdGljIGludCByZXNldDsKKworLyogRXh0cmEgUGVyaXBoZXJhbCBDb25maWd1cmF0aW9uIChEZWZhdWx0OiBEaXNhYmxlKSAqLworI2lmbmRlZiBDT05GSUdfTVNORFBJTl9NUFVfSU8KKyMgIGRlZmluZSBDT05GSUdfTVNORFBJTl9NUFVfSU8JCTAKKyNlbmRpZgorc3RhdGljIGludCBtcHVfaW8gX19pbml0ZGF0YSA9CQlDT05GSUdfTVNORFBJTl9NUFVfSU87CisKKyNpZm5kZWYgQ09ORklHX01TTkRQSU5fTVBVX0lSUQorIyAgZGVmaW5lIENPTkZJR19NU05EUElOX01QVV9JUlEJMAorI2VuZGlmCitzdGF0aWMgaW50IG1wdV9pcnEgX19pbml0ZGF0YSA9CQlDT05GSUdfTVNORFBJTl9NUFVfSVJROworCisjaWZuZGVmIENPTkZJR19NU05EUElOX0lERV9JTzAKKyMgIGRlZmluZSBDT05GSUdfTVNORFBJTl9JREVfSU8wCTAKKyNlbmRpZgorc3RhdGljIGludCBpZGVfaW8wIF9faW5pdGRhdGEgPQkJQ09ORklHX01TTkRQSU5fSURFX0lPMDsKKworI2lmbmRlZiBDT05GSUdfTVNORFBJTl9JREVfSU8xCisjICBkZWZpbmUgQ09ORklHX01TTkRQSU5fSURFX0lPMQkwCisjZW5kaWYKK3N0YXRpYyBpbnQgaWRlX2lvMSBfX2luaXRkYXRhID0JCUNPTkZJR19NU05EUElOX0lERV9JTzE7CisKKyNpZm5kZWYgQ09ORklHX01TTkRQSU5fSURFX0lSUQorIyAgZGVmaW5lIENPTkZJR19NU05EUElOX0lERV9JUlEJMAorI2VuZGlmCitzdGF0aWMgaW50IGlkZV9pcnEgX19pbml0ZGF0YSA9CQlDT05GSUdfTVNORFBJTl9JREVfSVJROworCisjaWZuZGVmIENPTkZJR19NU05EUElOX0pPWVNUSUNLX0lPCisjICBkZWZpbmUgQ09ORklHX01TTkRQSU5fSk9ZU1RJQ0tfSU8JMAorI2VuZGlmCitzdGF0aWMgaW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AgPSBkYWMtPm5leHRPdXQgKyBkYWMtPmZyYWdTaXplKjI7CisJaWYgKHRlbXAgPj0gZGFjLT5mcmFnVG90YWxTaXplKSB7CisJCUFTU0VSVCggKHRlbXAgPT0gZGFjLT5mcmFnVG90YWxTaXplKSB8fCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRlbXAgPT0gZGFjLT5mcmFnVG90YWxTaXplICsgZGFjLT5mcmFnU2l6ZSkgKTsKKwkJdGVtcCAtPSBkYWMtPmZyYWdUb3RhbFNpemU7CisJfQorCW91dGwoZGFjLT5sYnVmRG1hICsgdGVtcCwgcy0+aW8gKyBWUkM1NDc3X0RBQzFfQkFERFIpOworCWlmIChzLT5kYWNDaGFubmVscyA9PSAxKSB7CisJCW91dGwoZGFjLT5sYnVmRG1hICsgdGVtcCwgcy0+aW8gKyBWUkM1NDc3X0RBQzJfQkFERFIpOworCX0gZWxzZSB7CisJCW91dGwoZGFjLT5yYnVmRG1hICsgdGVtcCwgcy0+aW8gKyBWUkM1NDc3X0RBQzJfQkFERFIpOworCX0KKworI2lmIGRlZmluZWQoVlJDNTQ3N19BQzk3X1ZFUkJPU0VfREVCVUcpCisJaWYgKCoodTE2KikoZGFjLT5sYnVmICsgIGRhYy0+bmV4dE91dCkgIT0gb3V0VGlja2V0KSB7CisJCXByaW50aygiYXNzZXJ0IGZhaWw6IC0gJWQgdnMgJWRcbiIsIAorCQkgICAgICAgICoodTE2KikoZGFjLT5sYnVmICsgIGRhYy0+bmV4dE91dCksCisgICAgICAgICAgICAgICAgICAgICAgICBvdXRUaWNrZXQpOworICAgICAgICAgICAgICAgIEFTU0VSVCgxID09IDApOworCX0KKyNlbmRpZgorCisJLyogYWRqdXN0IG5leHRPdXQgcG9pbnRlciAqLworCWRhYy0+bmV4dE91dCArPSBkYWMtPmZyYWdTaXplOworCWlmIChkYWMtPm5leHRPdXQgPj0gZGFjLT5mcmFnVG90YWxTaXplKSB7CisJCUFTU0VSVChkYWMtPm5leHRPdX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CQkJCXJldHVybiByZXQ7CisJCQkJfQorCQkJfQorCQl9IHdoaWxlIChhdmFpbCA8PSAwKTsKKworCQlBU1NFUlQoIChhdmFpbCAlIGRiLT5mcmFnU2l6ZSkgPT0gMCk7CisJCWNvcHlDb3VudCA9IGNvcHlfYWRjX3RvX3VzZXIocywgYnVmZmVyLCBjb3VudCwgYXZhaWwpOworCQlpZiAoY29weUNvdW50IDw9MCApIHsKKwkJCWlmICghcmV0KSByZXQgPSAtRUZBVUxUOworCQkJcmV0dXJuIHJldDsKKwkJfQorCisJCWNvdW50IC09IGNvcHlDb3VudDsKKwkJYnVmZmVyICs9IGNvcHlDb3VudDsKKwkJcmV0ICs9IGNvcHlDb3VudDsKKwl9IC8vIHdoaWxlIChjb3VudCA+IDApCisKKwlyZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW5saW5lIGludAorY29weV90d29fY2hhbm5lbF9kYWNfZnJvbV91c2VyKHN0cnVjdCB2cmM1NDc3X2FjOTdfc3RhdGUgKnMsIAorCQkJICAgICAgIGNvbnN0IGNoYXIgKmJ1ZmZlciwgCisJCQkgICAgICAgaW50IGNvcHlDb3VudCkKK3sKKwlzdHJ1Y3QgZG1hYnVmICpkYiA9ICZzLT5kbWFfZGFjOworCWludCBidWZTdGFydCA9IGRiLT5uZXh0SW47CisKKwlBU1NFUlQoZGItPnJlYWR5KTsKKworICAgICAgICBmb3IgKDsgY29weUNvdW50ID4gMDsgKSB7CisgICAgICAgICAgICAgICAgaW50IGk7CisgICAgICAgICAgICAgICAgaW50IGNvdW50ID0gY29weUNvdW50OworICAgICAgICAgICAgICAgIGlmIChjb3VudCA+IFdPUktfQlVGX1NJWkUvMikgY291bnQgPSBXT1JLX0JVRl9TSVpFLzI7CisgICAgICAgICAgICAgICAgaWYgKGNvcHlfZnJvbV91c2VyKHMtPndvcmtCdWYsIGJ1ZmZlciwgY291bnQqMikpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAtMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZm9yIChpPTA7IGk8IGNvdW50LzI7IGkrKykgeworCQkJKih1MTYqKShkYi0+bGJ1ZiArIGJ1ZlN0YXJ0ICsgaSoyKSA9IAorCQkJCXMtPndvcmtCdWZbaV0ubGNoYW5uZWw7CisJCQkqKHUxNiopKGRiLT5yYnVmICsgYnVmU3RhcnQgKyBpKjIpID0gCisJCQkJcy0+d29ya0J1ZltpXS5yY2hhbm5lbDsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBjb3B5Q291bnQgLT0gY291bnQ7CisJCWJ1ZlN0YXJ0ICs9IGNvdW50OworCQlBU1NFUlQoYnVmU3RhcnQgPD0gZGItPmZyYWdUb3RhbFNpemUpOworICAgICAgICAgICAgICAgIGJ1ZmZlciArPSBjb3VudCAqMjsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gMDsKKworfQorCisvKiByZXR1cm4gdGhlIHRvdGFsIGJ5dGVzIHRoYXQgaXMgY29waWVkICovCitzdGF0aWMgaW5saW5lIGludAorY29weV9kYWNfZnJvbV91c2VyKHN0cnVjdCB2cmM1NDc3X2FjOTdfc3RhdGUgKnMsIAorCQkgICBjb25zdCBjaGFyICpidWZmZXIsIAorCQkgICBzaXplX3QgY291bnQsIAorCQkgICBpbnQgYXZhaWwpCit7CQorICAgICAgICBzdHJ1Y3QgZG1hYnVmICpkYiA9ICZzLT5kbWFfZGFjOworICAgICAgICBpbnQgY29weUNvdW50PTA7CisgICAgICAgIGludCBjb3B5RnJhZ0NvdW50PTA7CisgICAgICAgIGludCB0b3RhbENvcHlDb3VudCA9IDA7CisgICAgICAgIGludCB0b3RhbENvcHlGcmFnQ291bnQgPSAwOworICAgICAgICB1bnNpZ25lZCBsb25nIGZsYWdzOworI2lmIGRlZmluZWQoVlJDNTQ3N19BQzk3X1ZFUkJPU0VfREVCVUcpCisJaW50IGk7CisjZW5kaWYKKworICAgICAgICAvKiBhZGp1c3QgY291bnQgdG8gc2lnbmVsIGNoYW5uZWwgYnl0ZSBjb3VudCAqLworICAgICAgICBjb3VudCA+Pj0gcy0+ZGFjQ2hhbm5lbHMgLSAxOworCisgICAgICAgIC8qIHdlIG1heSBoYXZlIHRvICJjb3B5IiB0d2ljZSBhcyByaW5nIGJ1ZmZlciB3cmFwcyBhcm91bmQgKi8KKyAgICAgICAgZm9yICg7IChhdmFpbCA+IDApICYmIChjb3VudCA+IDApOyApIHsKKyAgICAgICAgICAgICAgICAvKiBkZXRlcm1pbmUgbWF4IHBvc3NpYmxlIGNvcHkgY291bnQgZm9yIHNpbmdsZSBjaGFubmVsICovCisgICAgICAgICAgICAgICAgY29weUNvdW50ID0gY291bnQ7CisgICAgICAgICAgICAgICAgaWYgKGNvcHlDb3VudCA+IGF2YWlsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjb3B5Q291bnQgPSBhdmFpbDsKKwkJfQorICAgICAgICAgICAgICAgIGlmIChjb3B5Q291bnQgKyBkYi0+bmV4dEluID4gZGItPmZyYWdUb3RhbFNpemUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvcHlDb3VudCA9IGRiLT5mcmFnVG90YWxTaXplIC0gZGItPm5leHRJbjsKKyAgICAgICAgICAgICAgICAgICAgICAgIEFTU0VSVChjb3B5Q291bnQgPiAwKTsKKyAgICAgICAgICAgICAgICB9CisKKwkJY29weUZyYWdDb3VudCA9IGNvcHlDb3VudDsKKwkJQVNTRVJUKGNvcHlGcmFnQ291bnQgPj0gY29weUNvdW50KTsKKworCQkvKiB3ZSBjb3B5IGRpZmZlcmVudGx5IGJhc2VkIG9uIHRoZSBudW1iZXIgY2hhbm5lbHMgKi8KKwkJaWYgKHMtPmRhY0NoYW5uZWxzID09IDEpIHsKKwkJCWlmIChjb3B5X2Zyb21fdXNlcihkYi0+bGJ1ZiArIGRiLT5uZXh0SW4sCisJCQkJCSAgIGJ1ZmZlciwKKwkJCQkJICAgY29weUNvdW50KSkgCisJCQkJcmV0dXJuIC0xOwor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NpemUpOworCQlsZW4gKz0gc3ByaW50ZiAoYnVmICsgbGVuLCAiZG1hX2RhYy5uZXh0SW4gPSAleFxuIiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPmRtYV9kYWMubmV4dEluKTsKKwkJbGVuICs9IHNwcmludGYgKGJ1ZiArIGxlbiwgImRtYV9kYWMubmV4dE91dCA9ICV4XG4iLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+ZG1hX2RhYy5uZXh0T3V0KTsKKwkJbGVuICs9IHNwcmludGYgKGJ1ZiArIGxlbiwgImRtYV9kYWMuY291bnQgPSAleFxuIiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPmRtYV9kYWMuY291bnQpOworCX0KKworCWxlbiArPSBzcHJpbnRmIChidWYgKyBsZW4sICJkbWFfYWRjIGlzICVzIHJlYWR5XG4iLCAgCisJICAgICAgICAgICAgICAgIHMtPmRtYV9hZGMucmVhZHk/ICIiIDogIm5vdCIpOworICAgICAgICBpZiAocy0+ZG1hX2FkYy5yZWFkeSkgeworCQlsZW4gKz0gc3ByaW50ZiAoYnVmICsgbGVuLCAiZG1hX2FkYyBpcyAlcyBzdG9wcGVkLlxuIiwgIAorCSAgICAgICAgICAgICAgICAgICAgICAgIHMtPmRtYV9hZGMuc3RvcHBlZD8gIiIgOiAibm90Iik7CisJCWxlbiArPSBzcHJpbnRmIChidWYgKyBsZW4sICJkbWFfYWRjLmZyYWdTaXplID0gJXhcbiIsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT5kbWFfYWRjLmZyYWdTaXplKTsKKwkJbGVuICs9IHNwcmludGYgKGJ1ZiArIGxlbiwgImRtYV9hZGMuZnJhZ1NoaWZ0ID0gJXhcbiIsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT5kbWFfYWRjLmZyYWdTaGlmdCk7CisJCWxlbiArPSBzcHJpbnRmIChidWYgKyBsZW4sICJkbWFfYWRjLm51bUZyYWcgPSAleFxuIiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPmRtYV9hZGMubnVtRnJhZyk7CisJCWxlbiArPSBzcHJpbnRmIChidWYgKyBsZW4sICJkbWFfYWRjLmZyYWdUb3RhbFNpemUgPSAleFxuIiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPmRtYV9hZGMuZnJhZ1RvdGFsU2l6ZSk7CisJCWxlbiArPSBzcHJpbnRmIChidWYgKyBsZW4sICJkbWFfYWRjLm5leHRJbiA9ICV4XG4iLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+ZG1hX2FkYy5uZXh0SW4pOworCQlsZW4gKz0gc3ByaW50ZiAoYnVmICsgbGVuLCAiZG1hX2FkYy5uZXh0T3V0ID0gJXhcbiIsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT5kbWFfYWRjLm5leHRPdXQpOworCQlsZW4gKz0gc3ByaW50ZiAoYnVmICsgbGVuLCAiZG1hX2FkYy5jb3VudCA9ICV4XG4iLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+ZG1hX2FkYy5jb3VudCk7CisJfQorCSAKKwkvKiBwcmludCBvdXQgQ09ERUMgc3RhdGUgKi8KKwlsZW4gKz0gc3ByaW50ZiAoYnVmICsgbGVuLCAiXG5BQzk3IENPREVDIHJlZ2lzdGVyc1xuIik7CisJbGVuICs9IHNwcmludGYgKGJ1ZiArIGxlbiwgIi0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cbiIpOworCWZvciAoY250PTA7IGNudCA8PSAweDdlOyBjbnQgPSBjbnQgKzIpCisJCWxlbis9IHNwcmludGYgKGJ1ZiArIGxlbiwgInJlZyAlMDJ4ID0gJTA0eFxuIiwKKwkJCSAgICAgICBjbnQsIHJkY29kZWMocy0+Y29kZWMsIGNudCkpOworCisJaWYgKGZwb3MgPj1sZW4peworCQkqc3RhcnQgPSBidWY7C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2lzdGVyKFBNX1BDSV9ERVYsIFBNX1BDSV9JRChwY2lkZXYpLCBoYW5kbGVfcG1fZXZlbnQpOworICAgIGlmIChwbWRldikKKyAgICAgICAgcG1kZXYtPmRhdGEgPSBjYXJkOworCisgICAgcmV0dXJuIDE7Cit9CisKKworLyoKKyAqIFBNIGV2ZW50IGhhbmRsZXIsIHNvIHRoZSBjYXJkIGlzIHByb3Blcmx5IHJlaW5pdGlhbGl6ZWQgYWZ0ZXIgYSBwb3dlcgorICogZXZlbnQuCisgKi8KK3N0YXRpYyBpbnQKK2hhbmRsZV9wbV9ldmVudCAoc3RydWN0IHBtX2RldiAqZGV2LCBwbV9yZXF1ZXN0X3QgcnFzdCwgdm9pZCAqZGF0YSkKK3sKKyAgICBzdHJ1Y3Qgbm0yNTZfaW5mbyAqY3JkID0gKHN0cnVjdCBubTI1Nl9pbmZvKikgZGV2LT5kYXRhOworICAgIGlmIChjcmQpIHsKKyAgICAgICAgc3dpdGNoIChycXN0KSB7CisJY2FzZSBQTV9TVVNQRU5EOgorCSAgICBicmVhazsKKwljYXNlIFBNX1JFU1VNRToKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpbnQgcGxheWluZyA9IGNyZC0+cGxheWluZzsKKyAgICAgICAgICAgICAgICBubTI1Nl9mdWxsX3Jlc2V0IChjcmQpOworICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICogQSBsaXR0bGUgdWdseSwgYnV0IHRoYXQncyBvazsgcHJldGVuZCB0aGUKKyAgICAgICAgICAgICAgICAgKiBibG9jayB3ZSB3ZXJlIHBsYXlpbmcgaXMgZG9uZS4gCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgaWYgKHBsYXlpbmcpCisgICAgICAgICAgICAgICAgICAgIERNQWJ1Zl9vdXRwdXRpbnRyIChjcmQtPmRldl9mb3JfcGxheSwgMSk7CisgICAgICAgICAgICB9CisJICAgIGJyZWFrOworCX0KKyAgICB9CisgICAgcmV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19vcGVuX3BsYXkgPSAxOworCX0KKwllbHNlCisJICAgIHJldHVybiAtRUJVU1k7CisgICAgfQorCisgICAgaWYgKG1vZGUgJiBPUEVOX1JFQUQpIHsKKwlpZiAoY2FyZC0+aXNfb3Blbl9yZWNvcmQgPT0gMCkgeworCSAgICBjYXJkLT5kZXZfZm9yX3JlY29yZCA9IGRldjsKKwkgICAgY2FyZC0+aXNfb3Blbl9yZWNvcmQgPSAxOworCX0KKwllbHNlCisJICAgIHJldHVybiAtRUJVU1k7CisgICAgfQorCisgICAgY2FyZC0+b3BlbmNudFt3XSsrOworICAgIHJldHVybiAwOworfQorCisvKgorICogQ2xvc2UgdGhlIGRldmljZQorICoKKyAqIERFViAgLSBkZXZpY2UKKyAqCisgKiBDYWxsZWQgd2hlbiBjbG9zaW5nIHRoZSBETUFidWYgICAgICAgICAgICAgICAoZG1hYnVmLmM6NDc3KQorICogICAgICBhZnRlciBoYWx0X3hmZXIKKyAqLworc3RhdGljIHZvaWQKK25tMjU2X2F1ZGlvX2Nsb3NlKGludCBkZXYpCit7CisgICAgc3RydWN0IG5tMjU2X2luZm8gKmNhcmQgPSBubTI1Nl9maW5kX2NhcmQgKGRldik7CisJCisgICAgaWYgKGNhcmQgIT0gTlVMTCkgeworCWludCB3OworCisJaWYgKGNhcmQtPmRldlswXSA9PSBkZXYpCisJICAgIHcgPSAwOworCWVsc2UgaWYgKGNhcmQtPmRldlsxXSA9PSBkZXYpCisJICAgIHcgPSAxOworCWVsc2UKKwkgICAgcmV0dXJuOworCisJY2FyZC0+b3BlbmNudFt3XS0tOworCWlmIChjYXJkLT5vcGVuY250W3ddIDw9IDApIHsKKwkgICAgY2FyZC0+b3BlbmNudFt3XSA9IDA7CisKKwkgICAgaWYgKGNhcmQtPmRldl9mb3JfcGxheSA9PSBkZXYpIHsKKwkJc3RvcFBsYXkgKGNhcmQpOworCQljYXJkLT5pc19vcGVuX3BsYXkgPSAwOworCQljYXJkLT5kZXZfZm9yX3BsYXkgPSAtM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KKwkgICAgfQorCSAgICBicmVhazsKKworCWNhc2UgU09VTkRfUENNX1JFQURfQ0hBTk5FTFM6CisJICAgIHJldCA9IGNhcmQtPnNpbmZvW3ddLnN0ZXJlbyArIDE7CisJICAgIGJyZWFrOworCisJY2FzZSBTTkRDVExfRFNQX1NFVEZNVDoKKwkgICAgaWYgKGdldF91c2VyKHJldCwgKGludCBfX3VzZXIgKikgYXJnKSkKKwkJcmV0dXJuIC1FRkFVTFQ7CisKKwkgICAgaWYgKHJldCAhPSAwKSB7CisJCW9sZGluZm8gPSBjYXJkLT5zaW5mb1t3XS5iaXRzOworCQljYXJkLT5zaW5mb1t3XS5iaXRzID0gcmV0OworCQlyZXQgPSBubTI1Nl9zZXRJbmZvIChkZXYsIGNhcmQpOworCQlpZiAocmV0ICE9IDApCisJCSAgICBjYXJkLT5zaW5mb1t3XS5iaXRzID0gb2xkaW5mbzsKKwkgICAgfQorCSAgICBpZiAocmV0ID09IDApCisJCXJldCA9IGNhcmQtPnNpbmZvW3ddLmJpdHM7CisJICAgIGJyZWFrOworCisJY2FzZSBTT1VORF9QQ01fUkVBRF9CSVRTOgorCSAgICByZXQgPSBjYXJkLT5zaW5mb1t3XS5iaXRzOworCSAgICBicmVhazsKKworCWRlZmF1bHQ6CisJICAgIHJldHVybiAtRUlOVkFMOworCX0KKyAgICByZXR1cm4gcHV0X3VzZXIocmV0LCAoaW50IF9fdXNlciAqKSBhcmcpOworfQorCisvKgorICogR2l2ZW4gdGhlIHNvdW5kIGRldmljZSBERVYgYW5kIGFuIGFzc29jaWF0ZWQgcGh5c2ljYWwgYnVmZmVyIFBIWVNCVUYsIAorICogcmV0dXJuIGEgcG9pbnRlciB0byB0aGUgYWN0dWFsIGJ1ZmZlciBpbiBrZXJuZWwgc3BhY2UuIAorICoKKyAqIFRoaXMgcm91dGluZSBzaG91bGQgZXhpc3QgYXMgcGFydCBvZiB0aGUgc291bmRjb3JlIHJvdXRpbmVzLgorICovCisKK3N0YXRpYyBjaGFyIC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NkZWZpbmUgT0ZGU180T1AJMTEKKworc3RydWN0IHZvaWNlX2luZm8KK3sKKwl1bnNpZ25lZCBjaGFyICAga2V5b25fYnl0ZTsKKwlsb25nICAgICAgICAgICAgYmVuZGVyOworCWxvbmcgICAgICAgICAgICBiZW5kZXJfcmFuZ2U7CisJdW5zaWduZWQgbG9uZyAgIG9yaWdfZnJlcTsKKwl1bnNpZ25lZCBsb25nICAgY3VycmVudF9mcmVxOworCWludCAgICAgICAgICAgICB2b2x1bWU7CisJaW50ICAgICAgICAgICAgIG1vZGU7CisJaW50ICAgICAgICAgICAgIHBhbm5pbmc7CS8qIDB4ZmZmZiBtZWFucyBub3Qgc2V0ICovCit9OworCit0eXBlZGVmIHN0cnVjdCBvcGxfZGV2aW5mbworeworCWludCAgICAgICAgICAgICBiYXNlOworCWludCAgICAgICAgICAgICBsZWZ0X2lvLCByaWdodF9pbzsKKwlpbnQgICAgICAgICAgICAgbnJfdm9pY2U7CisJaW50ICAgICAgICAgICAgIGx2X21hcFtNQVhfVk9JQ0VdOworCisJc3RydWN0IHZvaWNlX2luZm8gdm9jW01BWF9WT0lDRV07CisJc3RydWN0IHZvaWNlX2FsbG9jX2luZm8gKnZfYWxsb2M7CisJc3RydWN0IGNoYW5uZWxfaW5mbyAqY2huX2luZm87CisKKwlzdHJ1Y3Qgc2JpX2luc3RydW1lbnQgaV9tYXBbU0JGTV9NQVhJTlNUUl07CisJc3RydWN0IHNiaV9pbnN0cnVtZW50ICphY3RfaVtNQVhfVk9JQ0VdOworCisJc3RydWN0IHN5bnRoX2luZm8gZm1faW5mbzsKKworCWludCAgICAgICAgICAgICBidXN5OworCWludCAgICAgICAgICAgICBtb2RlbDsKKwl1bnNpZ25lZCBjaGFyICAgY21hc2s7CisKKwlpbnQgICAgICAgICAgICAgaXNfb3BsNDsKKwlpbnQgICAgICAgICAgICAqb3NwOworfSBvcGxfZGV2aW5mbzsKKworc3RhdGljIHN0cnVjdCBvcGxfZGV2aW5mbyAqZGV2Yy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5EX01JWEVSX0xJTkUyLCBTT1VORF9NSVhFUl9TWU5USCk7CisJCUFEMTg0OF9SRVJPVVRFKFNPVU5EX01JWEVSX0xJTkUzLCBTT1VORF9NSVhFUl9MSU5FKTsKKwl9Cit9CisKKworc3RhdGljIGludCBfX2luaXQgcHJvYmVfb3BsM3NhX21wdShzdHJ1Y3QgYWRkcmVzc19pbmZvICpod19jb25maWcpCit7CisJdW5zaWduZWQgY2hhciBjb25mOworCXN0YXRpYyBzaWduZWQgY2hhciBpcnFfYml0c1tdID0geworCQktMSwgLTEsIC0xLCAtMSwgLTEsIDEsIC0xLCAyLCAtMSwgMywgNAorCX07CisKKwlpZiAoaHdfY29uZmlnLT5pcnEgPiAxMCkKKwl7CisJCXByaW50ayhLRVJOX0VSUiAiT1BMMy1TQTogQmFkIE1QVSBJUlEgJWRcbiIsIGh3X2NvbmZpZy0+aXJxKTsKKwkJcmV0dXJuIDA7CisJfQorCWlmIChpcnFfYml0c1tod19jb25maWctPmlycV0gPT0gLTEpCisJeworCQlwcmludGsoS0VSTl9FUlIgIk9QTDMtU0E6IEJhZCBNUFUgSVJRICVkXG4iLCBod19jb25maWctPmlycSk7CisJCXJldHVybiAwOworCX0KKwlzd2l0Y2ggKGh3X2NvbmZpZy0+aW9fYmFzZSkKKwl7CisJCWNhc2UgMHgzMzA6CisJCQljb25mID0gMHgwMDsKKwkJCWJyZWFrOworCQljYXNlIDB4MzMyOgorCQkJY29uZiA9IDB4MjA7CisJCQlicmVhazsKKwkJY2FzZSAweDMzNDoKKwkJCWNvbmYgPSAweDQwOworCQkJYnJlYWs7CisJCWNhc2UgMHgzMDA6CisJCQljb25mID0gMHg2MDsKKwkJCWJyZWFrOworCQlkZWZhdWx0OgorCQkJcmV0dXJuIDA7CS8qIEludmFsaWQgcG9ydCAqLworCX0KKworCWNvbmYgfD0gMHg4MzsJCS8qIE1QVSAmIE9QTDMgKHN5bnRoKSAmIGdhbWUgcG9ydCBlbmFibGUgKi8KKwljb25mIHw9I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ApCisgKiBTY290dCBNdXJyYXkgICAgICAgICAgICBCYXNlZCBvbiBhIHBhdGNoIGJ5IEpvZWwgWWxpbHVvbWEgKGFrYSBCaXNxd2l0KSwKKyAqICAgICAgICAgICAgICAgICAgICAgICAgIGludGVncmF0ZWQgd2lkZSBtaXhlciBhbmQgYWRqdXN0ZWQgbWljLCBiYXNzLCB0cmVibGUKKyAqICAgICAgICAgICAgICAgICAgICAgICAgIHNjYWxpbmcuIChEZWMgNiwgMjAwMCkKKyAqIFNjb3R0IE11cnJheSAgICAgICAgICAgIEJhc2VkIG9uIGEgcGF0Y2ggYnkgUGV0ZXIgRW5nbG1haWVyLCBpbnRlZ3JhdGVkCisgKiAgICAgICAgICAgICAgICAgICAgICAgICB5bW9kZSBhbmQgbG9vcGJhY2sgb3B0aW9ucy4gKERlYyA2LCAyMDAwKQorICogU2NvdHQgTXVycmF5ICAgICAgICAgICAgSW5zcGlyZWQgYnkgYSBwYXRjaCBieSBQZXRlciBFbmdsbWFpZXIsIGFuZCBiYXNlZCBvbgorICogICAgICAgICAgICAgICAgICAgICAgICAgd2hhdCBBTFNBIGRvZXMsIGFkZGVkIGluaXRpYWxpemF0aW9uIGNvZGUgZm9yIHRoZQorICogICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdCBETUEgYW5kIElSUSBzZXR0aW5ncy4gKERlYyA2LCAyMDAwKQorICogU2NvdHQgTXVycmF5ICAgICAgICAgICAgQWRkZWQgc29tZSBtb3JlIGNoZWNrcyB0byB0aGUgY2FyZCBkZXRlY3Rpb24gY29kZSwKKyAqICAgICAgICAgICAgICAgICAgICAgICAgIGJhc2VkIG9uIHdoYXQgQUxTQSBkb2VzLiAoRGVjIDEyLCAyMDAwKQorICogU2NvdHQgTXVycmF5ICAgICAgICAgICAgSW5zcGlyZWQgYnkgc2ltaWxhciBwYXRjaGVzIGZyb20gSm9obiBGcmVtbGluLAorICogICAgICAgICAgICAgICAgICAgICAgICAgSmltIFJhZGZvcmQsIE1pa2Ug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DBmLCAweDBmLCAweDBmLCAweDBmLCAweDBmLCAweDBmLCAweDBlLCAweDBlLCAweDBlLAorCQkweDBlLCAweDBlLCAweDBlLCAweDBkLCAweDBkLCAweDBkLCAweDBkLCAweDBkLCAweDBkLCAweDBjLAorCQkweDBjLCAweDBjLCAweDBjLCAweDBjLCAweDBjLCAweDBjLCAweDBiLCAweDBiLCAweDBiLCAweDBiLAorCQkweDBiLCAweDBiLCAweDBhLCAweDBhLCAweDBhLCAweDBhLCAweDBhLCAweDBhLCAweDA5LCAweDA5LAorCQkweDA5LCAweDA5LCAweDA5LCAweDA5LCAweDA5LCAweDA4LCAweDA4LCAweDA4LCAweDA4LCAweDA4LAorCQkweDA4LCAweDA3LCAweDA3LCAweDA3LCAweDA3LCAweDA3LCAweDA3LCAweDA2LCAweDA2LCAweDA2LAorCQkweDA2LCAweDA2LCAweDA2LCAweDA2LCAweDA1LCAweDA1LCAweDA1LCAweDA1LCAweDA1LCAweDA1LAorCQkweDA0LCAweDA0LCAweDA0LCAweDA0LCAweDA0LCAweDA0LCAweDAzLCAweDAzLCAweDAzLCAweDAzLAorCQkweDAzLCAweDAzLCAweDAzLCAweDAyLCAweDAyLCAweDAyLCAweDAyLCAweDAyLCAweDAyLCAweDAxLAorCQkweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLAorCQkweDAwCisJfTsKKwl1bnNpZ25lZCBjaGFyIHZvbDsKKworCXZvbCA9IHNjYWxlW2xlZnRdOworCisJLyogSWYgbGV2ZWwgaXMgemVybywgdHVybiBvbiBtdXRlICovCisJaWYoIWxlZnQpCisJCXZvbCB8PSAweDgwOworCisJb3BsM3NhMl93cml0ZShkZXZjLT5jZmdfcG9ydCwgT1BMM1NBMl9NQVNURVJfTEVGVCwgdm9sKTsKKworCXZvbCA9IHNjYWxlW3JpZ2h0XTsKKworCS8qIElmIGxldmVsIGlzIHplcm8sIHR1cm4gb24gbXV0ZSAqL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HIpCit7CisJcmV0dXJuIGluYihpb2FkZHIgKyBwYXNfdHJhbnNsYXRlX2NvZGUpOworfQorCit2b2lkIHBhc193cml0ZSh1bnNpZ25lZCBjaGFyIGRhdGEsIGludCBpb2FkZHIpCit7CisJb3V0YigoZGF0YSksIGlvYWRkciArIHBhc190cmFuc2xhdGVfY29kZSk7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqIEJlZ2luIG9mIHRoZSBJbnRlcnJ1cHQgSGFuZGxlciAqKioqKioqKioqKioqKioqKioqKi8KKworc3RhdGljIGlycXJldHVybl90IHBhc2ludHIoaW50IGlycSwgdm9pZCAqZGV2X2lkLCBzdHJ1Y3QgcHRfcmVncyAqZHVtbXkpCit7CisJaW50ICAgICAgICAgICAgIHN0YXR1czsKKworCXN0YXR1cyA9IHBhc19yZWFkKDB4MEI4OSk7CisJcGFzX3dyaXRlKHN0YXR1cywgMHgwQjg5KTsJLyogQ2xlYXIgaW50ZXJydXB0ICovCisKKwlpZiAoc3RhdHVzICYgMHgwOCkKKwl7CisJCSAgcGFzX3BjbV9pbnRlcnJ1cHQoc3RhdHVzLCAxKTsKKwkJICBzdGF0dXMgJj0gfjB4MDg7CisJfQorCWlmIChzdGF0dXMgJiAweDEwKQorCXsKKwkJICBwYXNfbWlkaV9pbnRlcnJ1cHQoKTsKKwkJICBzdGF0dXMgJj0gfjB4MTA7CisJfQorCXJldHVybiBJUlFfSEFORExFRDsKK30KKworaW50IHBhc19zZXRfaW50cihpbnQgbWFzaykKK3sKKwlpZiAoIW1hc2spCisJCXJldHVybiAwOworCisJcGFzX2ludHJfbWFzayB8PSBtYXNrOworCisJcGFzX3dyaXRlKHBhc19pbnRyX21hc2ssIDB4MEI4Qik7CisJcmV0dXJuIDA7Cit9CisKK2ludCBwYXNfcmVtb3ZlX2ludHIoaW50IG1hc2spCit7CisJaWYgKCFtYXNrKQorCQlyZXR1cm4gMDsKKworCXBhc19pbnRyX21hc2sgJj0gfm1hc2s7CisJcGFzX3dyaXRl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TsKKworCWlmIChib2FyZF9pZCA9PSAweGZmKQorCQlyZXR1cm4gMDsKKworCS8qCisJICogV2UgcHJvYmFibHkgaGF2ZSBhIFBBUy1zZXJpZXMgYm9hcmQsIG5vdyBjaGVjayBmb3IgYSBQQVMxNi1zZXJpZXMgYm9hcmQKKwkgKiBieSB0cnlpbmcgdG8gY2hhbmdlIHRoZSBib2FyZCByZXZpc2lvbiBiaXRzLiBQQVMxNi1zZXJpZXMgaGFyZHdhcmUgd29uJ3QKKwkgKiBsZXQgeW91IGRvIHRoaXMgLSB0aGUgYml0cyBhcmUgcmVhZC1vbmx5LgorCSAqLworCisJZm9vID0gYm9hcmRfaWQgXiAweGUwOworCisJcGFzX3dyaXRlKGZvbywgMHgwQjhCKTsKKwlmb28gPSBwYXNfcmVhZCgweDBCOEIpOworCXBhc193cml0ZShib2FyZF9pZCwgMHgwQjhCKTsKKworCWlmIChib2FyZF9pZCAhPSBmb28pCisJCXJldHVybiAwOworCisJcGFzX21vZGVsID0gcGFzX3JlYWQoMHhGRjg4KTsKKworCXJldHVybiBwYXNfbW9kZWw7Cit9CisKK3N0YXRpYyB2b2lkIF9faW5pdCBhdHRhY2hfcGFzX2NhcmQoc3RydWN0IGFkZHJlc3NfaW5mbyAqaHdfY29uZmlnKQoreworCXBhc19pcnEgPSBod19jb25maWctPmlycTsKKworCWlmIChkZXRlY3RfcGFzX2h3KGh3X2NvbmZpZykpCisJeworCisJCWlmICgocGFzX21vZGVsID0gcGFzX3JlYWQoMHhGRjg4KSkpCisJCXsKKwkJCWNoYXIgICAgICAgICAgICB0ZW1wWzEwMF07CisKKwkJCXNwcmludGYodGVtcCwKKwkJCSAgICAiJXMgcmV2ICVkIiwgcGFzX21vZGVsX25hbWVzWyhpbnQpIHBhc19tb2RlbF0sCisJCQkJICAgIHBhc19yZWFkKDB4Mjc4OSkpOworCQkJY29uZl9wcmludGYodGVtcCwgaHdfY29uZmlnKTsKKwkJfQorCQlpZiAoY29uZmlnX3Bhc19odyhod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N0YXRpYyB2b2lkICAgICAoKm1pZGlfaW5wdXRfaW50cikgKGludCBkZXYsIHVuc2lnbmVkIGNoYXIgZGF0YSk7CisKK3N0YXRpYyBpbnQgcGFzX21pZGlfb3BlbihpbnQgZGV2LCBpbnQgbW9kZSwKKwkgICAgICB2b2lkICAgICAgICAgICAgKCppbnB1dCkgKGludCBkZXYsIHVuc2lnbmVkIGNoYXIgZGF0YSksCisJICAgICAgdm9pZCAgICAgICAgICAgICgqb3V0cHV0KSAoaW50IGRldikKKykKK3sKKwlpbnQgICAgICAgICAgICAgZXJyOworCXVuc2lnbmVkIGxvbmcgICBmbGFnczsKKwl1bnNpZ25lZCBjaGFyICAgY3RybDsKKworCisJaWYgKG1pZGlfYnVzeSkKKwkJcmV0dXJuIC1FQlVTWTsKKworCS8qCisJICogUmVzZXQgaW5wdXQgYW5kIG91dHB1dCBGSUZPIHBvaW50ZXJzCisJICovCisJcGFzX3dyaXRlKDB4MjAgfCAweDQwLAorCQkgIDB4MTc4Yik7CisKKwlzcGluX2xvY2tfaXJxc2F2ZSgmcGFzX2xvY2ssIGZsYWdzKTsKKworCWlmICgoZXJyID0gcGFzX3NldF9pbnRyKDB4MTApKSA8IDApCisJeworCQlzcGluX3VubG9ja19pcnFyZXN0b3JlKCZwYXNfbG9jaywgZmxhZ3MpOworCQlyZXR1cm4gZXJyOworCX0KKwkvKgorCSAqIEVuYWJsZSBpbnB1dCBhdmFpbGFibGUgYW5kIG91dHB1dCBGSUZPIGVtcHR5IGludGVycnVwdHMKKwkgKi8KKworCWN0cmwgPSAwOworCWlucHV0X29wZW5lZCA9IDA7CisJbWlkaV9pbnB1dF9pbnRyID0gaW5wdXQ7CisKKwlpZiAobW9kZSA9PSBPUEVOX1JFQUQgfHwgbW9kZSA9PSBPUEVOX1JFQURXUklURSkKKwl7CisJCWN0cmwgfD0gMHgwNDsJLyogRW5hYmxlIGlucHV0ICovCisJCWlucHV0X29wZW5lZCA9IDE7CisJfQorCWlmIChtb2RlID09I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V2ZWwgJiBQT1NTSUJMRV9SRUNPUkRJTkdfREVWSUNFUzsKKworCQkgIGNoYW5nZWQgPSBkZXZtYXNrIF4gcmVjX2RldmljZXM7CisJCSAgcmVjX2RldmljZXMgPSBkZXZtYXNrOworCisJCSAgZm9yIChpID0gMDsgaSA8IFNPVU5EX01JWEVSX05SREVWSUNFUzsgaSsrKQorCQkJICBpZiAoY2hhbmdlZCAmICgxIDw8IGkpKQorCQkJICAgIHsKKwkJCQkgICAgcGFzX21peGVyX3NldChpLCBsZXZlbHNbaV0pOworCQkJICAgIH0KKwkJICByZXR1cm4gcmVjX2RldmljZXM7CisJCSAgYnJlYWs7CisKKwkgIGRlZmF1bHQ6CisJCSAgcmV0dXJuIC1FSU5WQUw7CisJICB9CisKKwlyZXR1cm4gKGxldmVsc1t3aGljaERldl0pOworfQorCisvKioqKiovCisKK3N0YXRpYyB2b2lkCitwYXNfbWl4ZXJfcmVzZXQodm9pZCkKK3sKKwlpbnQgICAgICAgICAgICAgZm9vOworCisJREVCKHByaW50aygicGFzMl9taXhlci5jOiB2b2lkIHBhc19taXhlcl9yZXNldCh2b2lkKVxuIikpOworCisJZm9yIChmb28gPSAwOyBmb28gPCBTT1VORF9NSVhFUl9OUkRFVklDRVM7IGZvbysrKQorCQlwYXNfbWl4ZXJfc2V0KGZvbywgbGV2ZWxzW2Zvb10pOworCisJc2V0X21vZGUoMHgwNCB8IDB4MDEpOworfQorCitzdGF0aWMgaW50IHBhc19taXhlcl9pb2N0bChpbnQgZGV2LCB1bnNpZ25lZCBpbnQgY21kLCB2b2lkIF9fdXNlciAqYXJnKQoreworCWludCBsZXZlbCx2IDsKKwlpbnQgX191c2VyICpwID0gKGludCBfX3VzZXIgKilhcmc7CisKKwlERUIocHJpbnRrKCJwYXMyX21peGVyLmM6IGludCBwYXNfbWl4ZXJfaW9jdGwodW5zaWduZWQgaW50IGNtZCA9ICVYLCB1bnNpZ25lZCBpbnQgYXJnID0gJVgpXG4iLCBjbWQsIGFyZyk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AqLworfQorCitzdGF0aWMgaW50IHBhc19hdWRpb19vcGVuKGludCBkZXYsIGludCBtb2RlKQoreworCWludCAgICAgICAgICAgICBlcnI7CisJdW5zaWduZWQgbG9uZyAgIGZsYWdzOworCisJREVCKHByaW50aygicGFzMl9wY20uYzogc3RhdGljIGludCBwYXNfYXVkaW9fb3BlbihpbnQgbW9kZSA9ICVYKVxuIiwgbW9kZSkpOworCisJc3Bpbl9sb2NrX2lycXNhdmUoJnBhc19sb2NrLCBmbGFncyk7CisJaWYgKHBjbV9idXN5KQorCXsKKwkJc3Bpbl91bmxvY2tfaXJxcmVzdG9yZSgmcGFzX2xvY2ssIGZsYWdzKTsKKwkJcmV0dXJuIC1FQlVTWTsKKwl9CisJcGNtX2J1c3kgPSAxOworCXNwaW5fdW5sb2NrX2lycXJlc3RvcmUoJnBhc19sb2NrLCBmbGFncyk7CisKKwlpZiAoKGVyciA9IHBhc19zZXRfaW50cihQQVNfUENNX0lOVFJCSVRTKSkgPCAwKQorCQlyZXR1cm4gZXJyOworCisKKwlwY21fY291bnQgPSAwOworCW9wZW5fbW9kZSA9IG1vZGU7CisKKwlyZXR1cm4gMDsKK30KKworc3RhdGljIHZvaWQgcGFzX2F1ZGlvX2Nsb3NlKGludCBkZXYpCit7CisJdW5zaWduZWQgbG9uZyAgIGZsYWdzOworCisJREVCKHByaW50aygicGFzMl9wY20uYzogc3RhdGljIHZvaWQgcGFzX2F1ZGlvX2Nsb3NlKHZvaWQpXG4iKSk7CisKKwlzcGluX2xvY2tfaXJxc2F2ZSgmcGFzX2xvY2ssIGZsYWdzKTsKKworCXBhc19hdWRpb19yZXNldChkZXYpOworCXBhc19yZW1vdmVfaW50cihQQVNfUENNX0lOVFJCSVRTKTsKKwlwY21fbW9kZSA9IFBDTV9OT047CisKKwlwY21fYnVzeSA9IDA7CisJc3Bpbl91bmxvY2tfaXJxcmVzdG9yZSgmcGFzX2xvY2ssIGZsYWdzKTsKK30KKworc3RhdGljIHZvaWQgcGFzX2F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lZmluZSBQU1NfRkxBRzEgICAgIDB4MTAwMAorI2RlZmluZSBQU1NfRkxBRzAgICAgIDB4MDgwMAorI2RlZmluZSBQU1NfV1JJVEVfRU1QVFkgIDB4ODAwMAorI2RlZmluZSBQU1NfUkVBRF9GVUxMICAgIDB4NDAwMAorCisvKgorICogV1NTIHJlZ2lzdGVycworICovCisjZGVmaW5lIFdTU19JTkRFWCA0CisjZGVmaW5lIFdTU19EQVRBIDUKKworLyoKKyAqIFdTUyBzdGF0dXMgYml0cworICovCisjZGVmaW5lIFdTU19JTklUSUFMSVpJTkcgMHg4MAorI2RlZmluZSBXU1NfQVVUT0NBTElCUkFUSU9OIDB4MjAKKworI2RlZmluZSBOT19XU1NfTUlYRVIJLTEKKworI2luY2x1ZGUgImNvcHJvYy5oIgorCisjaW5jbHVkZSAicHNzX2Jvb3QuaCIKKworLyogSWYgY29tcGlsZWQgaW50byBrZXJuZWwsIGl0IGVuYWJsZSBvciBkaXNhYmxlIHBzcyBtaXhlciAqLworI2lmZGVmIENPTkZJR19QU1NfTUlYRVIKK3N0YXRpYyBpbnQgcHNzX21peGVyID0gMTsKKyNlbHNlCitzdGF0aWMgaW50IHBzc19taXhlcjsKKyNlbmRpZgorCisKK3R5cGVkZWYgc3RydWN0IHBzc19taXhlcmRhdGEgeworCXVuc2lnbmVkIGludCB2b2x1bWVfbDsKKwl1bnNpZ25lZCBpbnQgdm9sdW1lX3I7CisJdW5zaWduZWQgaW50IGJhc3M7CisJdW5zaWduZWQgaW50IHRyZWJsZTsKKwl1bnNpZ25lZCBpbnQgc3ludGg7Cit9IHBzc19taXhlcmRhdGE7CisKK3R5cGVkZWYgc3RydWN0IHBzc19jb25mZGF0YSB7CisJaW50ICAgICAgICAgICAgIGJhc2U7CisJaW50ICAgICAgICAgICAgIGlycTsKKwlpbnQgICAgICAgICAgICAgZG1hOworCWludCAgICAgICAgICAgICpvc3A7CisJcHNzX21peGVyZGF0YSAgIG1peGVyOworCWludCAgICAgICAgICAgICBh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50ayhLRVJOX0VSUiAiUFNTOiBJbnZhbGlkIElSUSAlZFxuIiwgaXJxKTsKKwkJcmV0dXJuIDA7CisJfQorCW91dHcodG1wIHwgYml0cywgUkVHKGRldikpOworCXJldHVybiAxOworfQorCitzdGF0aWMgaW50IHNldF9pb19iYXNlKHBzc19jb25mZGF0YSAqIGRldmMsIGludCBkZXYsIGludCBiYXNlKQoreworCXVuc2lnbmVkIHNob3J0ICB0bXAgPSBpbncoUkVHKGRldikpICYgMHgwMDNmOworCXVuc2lnbmVkIHNob3J0ICBiaXRzID0gKGJhc2UgJiAweDBmZmMpIDw8IDQ7CisKKwlvdXR3KGJpdHMgfCB0bXAsIFJFRyhkZXYpKTsKKworCXJldHVybiAxOworfQorCitzdGF0aWMgaW50IHNldF9kbWEocHNzX2NvbmZkYXRhICogZGV2YywgaW50IGRldiwgaW50IGRtYSkKK3sKKwlzdGF0aWMgdW5zaWduZWQgc2hvcnQgZG1hX2JpdHNbOF0gPQorCXsKKwkJMHgwMDAxLCAweDAwMDIsIDB4MDAwMCwgMHgwMDAzLAorCQkweDAwMDAsIDB4MDAwNSwgMHgwMDA2LCAweDAwMDcKKwl9OworCisJdW5zaWduZWQgc2hvcnQgIHRtcCwgYml0czsKKworCWlmIChkbWEgPCAwIHx8IGRtYSA+IDcpCisJCXJldHVybiAwOworCisJdG1wID0gaW53KFJFRyhkZXYpKSAmIH4weDA3OwkvKiBMb2FkIGNvbmZyZWcsIG1hc2sgRE1BIGJpdHMgb3V0ICovCisKKwlpZiAoKGJpdHMgPSBkbWFfYml0c1tkbWFdKSA9PSAwICYmIGRtYSAhPSA0KQorCXsKKwkJICBwcmludGsoS0VSTl9FUlIgIlBTUzogSW52YWxpZCBETUEgJWRcbiIsIGRtYSk7CisJCSAgcmV0dXJuIDA7CisJfQorCW91dHcodG1wIHwgYml0cywgUkVHKGRldikpOworCXJldHVybiAxOworfQorCitzdGF0aWMgaW50IHBzc19yZXNldF9kc3AocHNzX2NvbmZkYXRhICogZG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CQkJfQorCQl9CisvKl9fX19fIFNlbmQgdGhlIG5leHQgYnl0ZSAqLworCQlpZiAoY291bnQgPj0gc2l6ZSkgCisJCXsKKwkJCS8qIElmIG5vdCBkYXRhIGluIGJsb2NrIHNlbmQgMHhmZmZmICovCisJCQlvdXR3ICgweGZmZmYsIFJFRyAoUFNTX0RBVEEpKTsKKwkJfQorCQllbHNlCisJCXsKKwkJCS8qX19fX18gU2VuZCB0aGUgbmV4dCBieXRlICovCisJCQlvdXR3ICgqYmxvY2srKywgUkVHIChQU1NfREFUQSkpOworCQl9OworCQljb3VudCsrOworCX0KKworCWlmIChmbGFncyAmIENQRl9MQVNUKQorCXsKKy8qX19fX18gV2h5ICovCisJCW91dHcoMCwgUkVHKFBTU19EQVRBKSk7CisKKwkJbGltaXQgPSBqaWZmaWVzICsgSFovMTA7CisJCWZvciAoaSA9IDA7IGkgPCAzMjc2OCAmJiAobGltaXQgLSBqaWZmaWVzID49IDApOyBpKyspCisJCQl2YWwgPSBpbncoUkVHKFBTU19TVEFUVVMpKTsKKworCQlsaW1pdCA9IGppZmZpZXMgKyBIWi8xMDsKKwkJZm9yIChpID0gMDsgaSA8IDMyNzY4ICYmIChsaW1pdC1qaWZmaWVzID49IDApOyBpKyspCisJCXsKKwkJCXZhbCA9IGludyhSRUcoUFNTX1NUQVRVUykpOworCQkJaWYgKHZhbCAmIDB4NDAwMCkKKwkJCQlicmVhazsKKwkJfQorCisJCS8qIG5vdyByZWFkIHRoZSB2ZXJzaW9uICovCisJCWZvciAoaSA9IDA7IGkgPCAzMjAwMDsgaSsrKQorCQl7CisJCQl2YWwgPSBpbncoUkVHKFBTU19TVEFUVVMpKTsKKwkJCWlmICh2YWwgJiBQU1NfUkVBRF9GVUxMKQorCQkJCWJyZWFrOworCQl9CisJCWlmIChpID09IDMyMDAwKQorCQkJcmV0dXJuIDA7CisKKwkJdmFsID0gaW53KFJFRyhQU1NfREFUQSkpOworCQkvKiBwcmludGsoICI8UFNTOiBtaWNyb2NvZGUgdmVyc2lvbiAlZC4lZCBsb2FkZWQ+IiwgIHZhbC8xNiwgIHZhbCAlIDE2KTsgKi8KKwl9CisJcmV0dXJuIDE7Cit9CisKKy8qIE1peGVyICovCitzdGF0aWMgdm9pZCBzZXRfbWFzdGVyX3ZvbHVtZShwc3NfY29uZmRhdGEgKmRldmMsIGludCBsZWZ0LCBpbnQgcmlnaHQpCit7CisJc3RhdGljIHVuc2lnbmVkIGNoYXIgbG9nX3NjYWxlWzEwMV0gPSAgeworCQkweGRiLCAweGUwLCAweGUzLCAweGU1LCAweGU3LCAweGU5LCAweGVhLCAweGViLCAweGVjLCAweGVkLCAweGVkLCAweGVlLAorCQkweGVmLCAweGVmLCAweGYwLCAweGYwLCAweGYxLCAweGYxLCAweGYyLCAweGYyLCAweGYyLCAweGYzLCAweGYzLCAweGYzLAorCQkweGY0LCAweGY0LCAweGY0LCAweGY1LCAweGY1LCAweGY1LCAweGY1LCAweGY2LCAweGY2LCAweGY2LCAweGY2LCAweGY3LAorCQkweGY3LCAweGY3LCAweGY3LCAweGY3LCAweGY4LCAweGY4LCAweGY4LCAweGY4LCAweGY4LCAweGY5LCAweGY5LCAweGY5LAorCQkweGY5LCAweGY5LCAweGY5LCAweGZhLCAweGZhLCAweGZhLCAweGZhLCAweGZhLCAweGZhLCAweGZhLCAweGZiLCAweGZiLAorCQkweGZiLCAweGZiLCAweGZiLCAweGZiLCAweGZiLCAweGZiLCAweGZjLCAweGZjLCAweGZjLCAweGZjLCAweGZjLCAweGZjLAorCQkweGZjLCAweGZjLCAweGZjLCAweGZjLCAweGZkLCAweGZkLCAweGZkLCAweGZkLCAweGZkLCAweGZkLCAweGZkLCAweGZkLAorCQkweGZkLCAweGZkLCAweGZlLCAweGZlLCAweGZlLCAweGZlLCAweGZlLCAweGZlLCAweGZlLCAweGZlLCAweGZlLCAweGZlLAorCQkweGZlLCAweGZlLCAweGZmLCAweGZmLCAweGZmCisJfTsKKwlwc3Nfd3JpdGUoZGV2YywgMHg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waW5fdW5sb2NrX2lycXJlc3RvcmUoJmRtYS0+cy0+bG9jayxmbGFncyk7CisJcmV0dXJuIGNudDsKK30KKworCitzdGF0aWMgaW5saW5lIGludCBybWU5Nnh4X2NvcHlmcm9tdXNlcihzdHJ1Y3QgZG1hYnVmKiBkbWEsY29uc3QgY2hhciBfX3VzZXIgKiBidWZmZXIsaW50IGNvdW50LGludCBob3ApCit7CisJaW50IHN3cHRyID0gZG1hLT53cml0ZXB0cjsKKwlzd2l0Y2ggKGRtYS0+Zm9ybWF0KSB7CisJY2FzZSBBRk1UX1MzMl9CTE9DS0VEOgorCXsKKwkgICAgIGNoYXIgX191c2VyICogYnVmID0gKGNoYXIgX191c2VyICopYnVmZmVyOworCSAgICAgaW50IGNudCA9IGNvdW50L2RtYS0+b3V0Y2hhbm5lbHM7CisJICAgICBpbnQgaTsKKwkgICAgIGZvciAoaT0wO2kgPCBkbWEtPm91dGNoYW5uZWxzO2krKykgeworCQkgIGNoYXIqIGh3YnVmID0oY2hhciopICZkbWEtPnMtPnBsYXlidWZbKGRtYS0+b3V0b2Zmc2V0ICsgaSkqUk1FOTZ4eF9ETUFfTUFYX1NBTVBMRVNdOworCQkgIGh3YnVmKz1zd3B0cjsKKworCQkgIGlmIChjb3B5X2Zyb21fdXNlcihod2J1ZixidWYsIGNudCkpCisJCSAgICAgICByZXR1cm4gLTE7CisJCSAgYnVmKz1ob3A7CisJICAgICB9CisJICAgICBzd3B0cis9Y250OworCSAgICAgYnJlYWs7CisJfQorCWNhc2UgQUZNVF9TMTZfTEU6CisJeworCSAgICAgaW50IGksajsKKwkgICAgIGludCBjbnQgPSBjb3VudC9kbWEtPm91dGNoYW5uZWxzOworCSAgICAgZm9yIChpPTA7aSA8IGRtYS0+b3V0Y2hhbm5lbHMgKyBkbWEtPm1vbm87aSsrKSB7CisJCSAgICAgc2hvcnQgX191c2VyICogc2J1ZiA9IChzaG9ydCBfX3VzZXIgKilidWZmZXIgKyBpKighZG1hLT5tb25vKTsKK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5jaGFubmVsczsKKwkgICAgIGludCBpOworCisJICAgICBmb3IgKGk9MDtpIDwgZG1hLT5pbmNoYW5uZWxzO2krKykgeworCQkgIGNoYXIqIGh3YnVmID0oY2hhciopICZkbWEtPnMtPnJlY2J1ZlsoZG1hLT5pbm9mZnNldCArIGkpKlJNRTk2eHhfRE1BX01BWF9TQU1QTEVTXTsKKwkJICBod2J1Zis9c3dwdHI7CisKKwkJICBpZiAoY29weV90b191c2VyKGJ1Zixod2J1ZixjbnQpKQorCQkgICAgICAgcmV0dXJuIC0xOworCQkgIGJ1Zis9aG9wOworCSAgICAgfQorCSAgICAgc3dwdHIrPWNudDsKKwkgICAgIGJyZWFrOworCX0KKwljYXNlIEFGTVRfUzE2X0xFOgorCXsKKwkgICAgIGludCBpLGo7CisJICAgICBpbnQgY250ID0gY291bnQvZG1hLT5pbmNoYW5uZWxzOworCSAgICAgZm9yIChpPTA7aSA8IGRtYS0+aW5jaGFubmVscztpKyspIHsKKwkJICBzaG9ydCBfX3VzZXIgKiBzYnVmID0gKHNob3J0IF9fdXNlciAqKWJ1ZmZlciArIGk7CisJCSAgc2hvcnQqIGh3YnVmID0oc2hvcnQqKSAmZG1hLT5zLT5yZWNidWZbKGRtYS0+aW5vZmZzZXQgKyBpKSpSTUU5Nnh4X0RNQV9NQVhfU0FNUExFU107CSAgICAgCisJCSAgaHdidWYrPShzd3B0cj4+MSk7CisJCSAgZm9yIChqPTA7ajwoY250Pj4xKTtqKyspIHsKKwkJICAgICAgIGh3YnVmKys7CisJCSAgICAgICBfX3B1dF91c2VyKCpod2J1ZisrLHNidWYrKyk7CisJCSAgICAgICBzYnVmKz0oZG1hLT5pbmNoYW5uZWxzLTEpOworCQkgIH0KKwkgICAgIH0KKwkgICAgIHN3cHRyICs9IChjbnQ8PDEpOworCSAgICAgYnJlYWs7CisJfQorCWRlZmF1bHQ6CisJICAgICBwcmludGsoUk1FX01FU1MiIHVuc3VwcG9ydGVkIGZvcm1hdFxuIik7CisJICAgICByZ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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gCisgUENJIGRldGVjdGlvbiBhbmQgbW9kdWxlIGluaXRpYWxpemF0aW9uIHN0dWZmIAorIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworCitzdGF0aWMgdm9pZCogYnVzbWFzdGVyX21hbGxvYyhpbnQgc2l6ZSkgeworICAgICBpbnQgcGc7IC8qIDIgcyBleHBvbmVudCBvZiBtZW1vcnkgc2l6ZSAqLworICAgICAgICBjaGFyICpidWY7CisKKyAgICAgICAgREJHKHByaW50aygia2VybmVsIG1hbGxvYyBwYWdlcyAuLlxuIikpOworICAgICAgICAKKyAgICAgICAgZm9yIChwZyA9IDA7IFBBR0VfU0laRSAqICgxIDw8IHBnKSA8IHNpemU7IHBnKyspOworCisgICAgICAgIGJ1ZiA9IChjaGFyICopIF9fZ2V0X2ZyZWVfcGFnZXMoR0ZQX0tFUk5FTCB8IEdGUF9ETUEsIHBnKTsKKworICAgICAgICBpZiAoYnVmKSB7CisgICAgICAgICAgICAgICAgc3RydWN0IHBhZ2UqIHBhZ2UsICpsYXN0X3BhZ2U7CisKKyAgICAgICAgICAgICAgICBwYWdlID0gdmlydF90b19wYWdlKGJ1Zik7CisgICAgICAgICAgICAgICAgbGFzdF9wYWdlID0gdmlydF90b19wYWdlKGJ1ZiArICgxIDw8IHBnKSk7CisgICAgICAgICAgICAgICAgREJHKHByaW50aygic2V0dGluZyByZXNlcnZlZCBiaXRcbiIpKTsKKyAgICAgICAgICAgICAgICB3aGlsZSAocGFnZSA8IGxhc3RfcGFnZSkgeworCQkJU2V0UGFnZVJlc2VydmVkKHBhZ2UpOworICAgICAgICAgICAgICAgICAgICAgICAgcGFnZSsrOworICAgICAgICAgICAgICAgIH0KKwkJcmV0dXJuIGJ1ZjsK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jE7CisJdW5zaWduZWQgaW50IHNyNDg6MTsgICAgICAgICAvKiBzYW1wbGVyYXRlIDA9NDQuMS84OC4yLCAxPTQ4Lzk2IGtIeiAqLworCXVuc2lnbmVkIGludCBzcGFyZToxOworCXVuc2lnbmVkIGludCBkb3VibGVzcGVlZDoxOyAgLyogZG91YmxlIHNwZWVkIDA9NDQuMS80OCwgMT04OC4yLzk2IEtoeiAqLworCXVuc2lnbmVkIGludCBwcm86MTsgICAgICAgICAgLyogVzogU1BESUYtT1VUIDA9Y29uc3VtZXIsIDE9cHJvZmVzc2lvbmFsICovCisJdW5zaWduZWQgaW50IGVtcGhhc2lzOjE7ICAgICAvKiBXOiBTUERJRi1PVVQgZW1waGFzaXMgMD1vZmYsIDE9b24gKi8KKwl1bnNpZ25lZCBpbnQgZG9sYnk6MTsgICAgICAgIC8qIFc6IFNQRElGLU9VVCBub24tYXVkaW8gYml0IDE9c2V0LCAwPXVuc2V0ICovCisJdW5zaWduZWQgaW50IG9wdF9vdXQ6MTsgICAgICAvKiBXOiB1c2UgMXN0IG9wdGljYWwgT1VUIGFzIFNQRElGOiAxPXllcywgMD1ubyAqLworCXVuc2lnbmVkIGludCB3b3JkY2xvY2s6MTsgICAgLyogVzogdXNlIFdvcmRjbG9jayBhcyBzeW5jIChvdmVyd3JpdGVzIG1hc3RlcikgKi8KKyAgICAgICAgdW5zaWduZWQgaW50IHNwZGlmX2luOjI7ICAgICAvKiBXOiBTUERJRi1JTjogKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAgICAwMD1vcHRpY2FsIChBREFUMSksIDAxPWNvYXhpYWwgKENpbmNoKSwgMTA9aW50ZXJuYWwgQ0RST00gKi8KKwl1bnNpZ25lZCBpbnQgc3luY19yZWY6MjsgICAgIC8qIFc6IHByZWZlcnJlZCBzeW5jLXNvdXJjZSBpbiBhdXRvc3luYyAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qICAgIDAwPUF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Kworc3RydWN0IG1peGVyX2RlZiB7CisJdW5zaWduZWQgaW50IHJlZ25vOiA4OworCXVuc2lnbmVkIGludCBiaXRvZmZzOjQ7CisJdW5zaWduZWQgaW50IG5iaXRzOjQ7Cit9OworCit0eXBlZGVmIHN0cnVjdCBtaXhlcl9kZWYgbWl4ZXJfdGFiWzMyXVsyXTsKK3R5cGVkZWYgc3RydWN0IG1peGVyX2RlZiBtaXhlcl9lbnQ7CisKK3N0cnVjdCBzYl9tb2R1bGVfb3B0aW9ucworeworCWludCAgZXNzdHlwZTsJLyogRVNTIGNoaXAgdHlwZSAqLworCWludCAgYWNlcjsJLyogRG8gYWNlciBub3RlYm9vayBpbml0PyAqLworCWludCAgc21fZ2FtZXM7CS8qIExvZ2l0ZWNoIHNvdW5kbWFuIGdhbWVzPyAqLworfTsKKwordHlwZWRlZiBzdHJ1Y3Qgc2JfZGV2YyB7CisJICAgaW50IGRldjsKKworCS8qIEhhcmR3YXJlIHBhcmFtZXRlcnMgKi8KKwkgICBpbnQgKm9zcDsKKwkgICBpbnQgbWlub3IsIG1ham9yOworCSAgIGludCB0eXBlOworCSAgIGludCBtb2RlbCwgc3VibW9kZWw7CisJICAgaW50IGNhcHM7CisjCWRlZmluZSBTQkNBUF9TVEVSRU8JMHgwMDAwMDAwMQorIwlkZWZpbmUgU0JDQVBfMTZCSVRTCTB4MDAwMDAwMDIKKworCS8qIEhhcmR3YXJlIHJlc291cmNlcyAqLworCSAgIGludCBiYXNlOworCSAgIGludCBpcnE7CisJICAgaW50IGRtYTgsIGRtYTE2OworCSAgIAorCSAgIGludCBwY2liYXNlOwkJLyogRm9yIEVTUyBNYWVzdHJvIGV0YyAqLworCisJLyogU3RhdGUgdmFyaWFibGVzICovCisgCSAgIGludCBvcGVuZWQ7CisJLyogbmV3IGF1ZGlvIGZpZWxkcyBmb3IgZnVsbCBkdXBsZXggc3VwcG9ydCAqLworCSAgIGludCBmdWxsZHVwbGV4OworCSAgIGludCBkdXBsZXg7CisJICAg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cihkZXZjKTsKK30KKworc3RhdGljIGlycXJldHVybl90IHNiaW50cihpbnQgaXJxLCB2b2lkICpkZXZfaWQsIHN0cnVjdCBwdF9yZWdzICpkdW1teSkKK3sKKwlzYl9kZXZjICpkZXZjID0gZGV2X2lkOworCisJZGV2Yy0+aXJxX29rID0gMTsKKworCXN3aXRjaCAoZGV2Yy0+bW9kZWwpIHsKKwljYXNlIE1ETF9FU1NQQ0k6CisJCXBjaV9pbnRyIChkZXZjKTsKKwkJYnJlYWs7CisJCQorCWNhc2UgTURMX0VTUzoKKwkJZXNzX2ludHIgKGRldmMpOworCQlicmVhazsKKwlkZWZhdWx0OgorCQlzYl9pbnRyIChkZXZjKTsKKwkJYnJlYWs7CisJfQorCXJldHVybiBJUlFfSEFORExFRDsKK30KKworaW50IHNiX2RzcF9yZXNldChzYl9kZXZjICogZGV2YykKK3sKKwlpbnQgbG9vcGM7CisKKwlERUIocHJpbnRrKCJFbnRlcmVkIHNiX2RzcF9yZXNldCgpXG4iKSk7CisKKwlpZiAoZGV2Yy0+bW9kZWwgPT0gTURMX0VTUykgcmV0dXJuIGVzc19kc3BfcmVzZXQgKGRldmMpOworCisJLyogVGhpcyBpcyBvbmx5IGZvciBub24tRVNTIGNoaXBzICovCisKKwlvdXRiKDEsIERTUF9SRVNFVCk7CisKKwl1ZGVsYXkoMTApOworCW91dGIoMCwgRFNQX1JFU0VUKTsKKwl1ZGVsYXkoMzApOworCisJZm9yIChsb29wYyA9IDA7IGxvb3BjIDwgMTAwMCAmJiAhKGluYihEU1BfREFUQV9BVkFJTCkgJiAweDgwKTsgbG9vcGMrKyk7CisKKwlpZiAoaW5iKERTUF9SRUFEKSAhPSAweEFBKQorCXsKKwkJRERCKHByaW50aygic2I6IE5vIHJlc3BvbnNlIHRvIFJFU0VUXG4iKSk7CisJCXJldHVybiAwOwkvKiBTb3JyeSAqLworCX0KKworCURFQihwcmludGsoInNiX2RzcF9yZXNldCgpIE9LXG4iKSk7CisKKwlyZXR1cm4g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isJCQlpdmFsID0gNDsKKwkJCWJyZWFrOworCQljYXNlIDk6CisJCQlpdmFsID0gMTsKKwkJCWJyZWFrOworCQljYXNlIDEwOgorCQkJaXZhbCA9IDg7CisJCQlicmVhazsKKwkJZGVmYXVsdDoKKwkJCXByaW50ayhLRVJOX0VSUiAiU0IxNjogSW52YWxpZCBJUlElZFxuIiwgbGV2ZWwpOworCQkJcmV0dXJuIDA7CisJfQorCXNiX3NldG1peGVyKGRldmMsIElSUV9OUiwgaXZhbCk7CisJcmV0dXJuIDE7Cit9CisKK3N0YXRpYyB2b2lkIHJlbG9jYXRlX0phenoxNihzYl9kZXZjICogZGV2Yywgc3RydWN0IGFkZHJlc3NfaW5mbyAqaHdfY29uZmlnKQoreworCXVuc2lnbmVkIGNoYXIgYml0cyA9IDA7CisJdW5zaWduZWQgbG9uZyBmbGFnczsKKworCWlmIChqYXp6MTZfYmFzZSAhPSAwICYmIGphenoxNl9iYXNlICE9IGh3X2NvbmZpZy0+aW9fYmFzZSkKKwkJcmV0dXJuOworCisJc3dpdGNoIChod19jb25maWctPmlvX2Jhc2UpCisJeworCQljYXNlIDB4MjIwOgorCQkJYml0cyA9IDE7CisJCQlicmVhazsKKwkJY2FzZSAweDI0MDoKKwkJCWJpdHMgPSAyOworCQkJYnJlYWs7CisJCWNhc2UgMHgyNjA6CisJCQliaXRzID0gMzsKKwkJCWJyZWFrOworCQlkZWZhdWx0OgorCQkJcmV0dXJuOworCX0KKwliaXRzID0gamF6ejE2X2JpdHMgPSBiaXRzIDw8IDU7CisJamF6ejE2X2Jhc2UgPSBod19jb25maWctPmlvX2Jhc2U7CisKKwkvKgorCSAqCU1hZ2ljIHdha2UgdXAgc2VxdWVuY2UgYnkgd3JpdGluZyB0byAweDIwMSAoYWthIEpveXN0aWNrIHBvcnQpCisJICovCisJc3Bpbl9sb2NrX2lycXNhdmUoJmphenoxNl9sb2NrLCBmbGFncyk7CisJb3V0YigoMHhBRiksIDB4MjAxKTsKKwlvdXRiKCgwe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XIgcmVnKTsKK3N0YXRpYyBpbnQgZXNzX3dyaXRlIChzYl9kZXZjICogZGV2YywgdW5zaWduZWQgY2hhciByZWcsIHVuc2lnbmVkIGNoYXIgZGF0YSk7CitzdGF0aWMgdm9pZCBlc3NfY2hnbWl4ZXIKKwkoc2JfZGV2YyAqIGRldmMsIHVuc2lnbmVkIGludCByZWcsIHVuc2lnbmVkIGludCBtYXNrLCB1bnNpZ25lZCBpbnQgdmFsKTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCQkJCQkJCQkJCQkJCQkJCQkJCSoKKyAqCQkJCQkJCQkJRVNTIGF1ZGlvCQkJCQkJCQkqCisgKgkJCQkJCQkJCQkJCQkJCQkJCQkqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworc3RydWN0IGVzc19jb21tYW5kIHtzaG9ydCBjbWQ7IHNob3J0IGRhdGE7fTsKKworLyoKKyAqIENvbW1hbmRzIGZvciBpbml0aWFsaXppbmcgQXVkaW8gMSBmb3IgaW5wdXQgKHJlY29yZCkKKyAqLworc3RhdGljIHN0cnVjdCBlc3NfY29tbWFuZCBlc3NfaTA4bVtdID0JCS8qIGlucHV0IDggYml0IG1vbm8gKi8KKwl7IHsweGI3LCAweDUxfSwgezB4YjcsIDB4ZDB9LCB7LTEsIDB9IH07CitzdGF0aWMgc3RydWN0IGVzc19jb21tYW5kIGVzc19pMTZtW10gPQkJLyogaW5wdXQgMTYgYml0IG1vbm8gKi8KKwl7IHsweGI3LCAweDcxfSwgezB4YjcsIDB4ZjR9LCB7LTEsIDB9IH07CitzdGF0aWMgc3RydWN0IGVzc19jb21tYW5kIGVzc19pMDhzW10gPQkJLyogaW5wdXQgOCBiaXQgc3RlcmVvICovCisJeyB7MHhiNywgMHg1MX0sIHsweGI3LCAweD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GVsc2UgeworCQkJCQljaGlwID0gIkVTMTg4OCI7CisJCQkJCWRldmMtPnN1Ym1vZGVsID0gU1VCTURMX0VTMTg4ODsKKwkJCQl9CisJCQl9IGVsc2UgeworCQkJCWNoaXAgPSAiRVMxNzg4IjsKKwkJCQlkZXZjLT5zdWJtb2RlbCA9IFNVQk1ETF9FUzE3ODg7CisJCQl9CisJCX07CisJCWlmIChjaGlwID09IE5VTEwpIHsKKwkJCWNoaXAgPSAiRVMxNjg4IjsKKwkJfTsKKworCSAgICBwcmludGsgKCBLRVJOX0lORk8gIkVTUyBjaGlwICVzICVzJXNcbiIKKyAgICAgICAgICAgICAgICwgY2hpcAorICAgICAgICAgICAgICAgLCAoIGRldmMtPnNibW8uZXNzdHlwZSA9PSBFU1NUWVBFX0RFVEVDVCB8fCBkZXZjLT5zYm1vLmVzc3R5cGUgPT0gRVNTVFlQRV9MSUtFMjAKKyAgICAgICAgICAgICAgICAgPyAiZGV0ZWN0ZWQiCisgICAgICAgICAgICAgICAgIDogInNwZWNpZmllZCIKKyAgICAgICAgICAgICAgICAgKQorICAgICAgICAgICAgICAgLCAoIGRldmMtPnNibW8uZXNzdHlwZSA9PSBFU1NUWVBFX0xJS0UyMAorICAgICAgICAgICAgICAgICA/ICIgKGtlcm5lbCAyLjAgY29tcGF0aWJsZSkiCisgICAgICAgICAgICAgICAgIDogIiIKKyAgICAgICAgICAgICAgICAgKQorICAgICAgICAgICAgICAgKTsKKworCQlzcHJpbnRmKG5hbWUsIkVTUyAlcyBBdWRpb0RyaXZlIChyZXYgJWQpIiwgY2hpcCwgZXNzX21pbm9yICYgMHgwZik7CisJfSBlbHNlIHsKKwkJc3RyY3B5KG5hbWUsICJKYXp6MTYiKTsKKwl9CisKKwkvKiBBQVM6IGluZm8gc3RvbGVuIGZyb20gQUxTQTogdGhlc2UgYm9hcmRzIGhhdmUgZGlmZmVyZW50IGNsb2NrcyAqLworCXN3aXRjaChkZXZjLT5zdWJtb2RlbCkgeworLyogQVBQQ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4KKwkgKgorCSAqIEZvciBTQjE2IGhhdmluZyBib3RoIGRtYTggYW5kIGRtYTE2IG1lYW5zIGVuYWJsZQorCSAqIEZ1bGwgRHVwbGV4LiBMZXQncyB0cnkgdGhpcyBmb3IgRVMxODg3IHRvbworCSAqCisJICovCisJaWYgKGRldmMtPnN1Ym1vZGVsID09IFNVQk1ETF9FUzE4ODcpIHsKKwkJaWYgKGh3X2NvbmZpZy0+ZG1hMiAhPSAtMSkgeworCQkJZGV2Yy0+ZG1hMTYgPSBod19jb25maWctPmRtYTI7CisJCX0KKwkJLyoKKwkJICogZGV2Yy0+ZHVwbGV4IGluaXRpYWxpemF0aW9uIGlzIHB1dCBoZXJlLCBjYXVzZQorCQkgKiBlc3Nfc2V0X2RtYV9odyBuZWVkcyBpdC4KKwkJICovCisJCWlmIChkZXZjLT5kbWE4ICE9IGRldmMtPmRtYTE2ICYmIGRldmMtPmRtYTE2ICE9IC0xKSB7CisJCQlkZXZjLT5kdXBsZXggPSAxOworCQl9CisJfQorCWlmICghZXNzX3NldF9kbWFfaHcgKGRldmMpKSB7CisJCWZyZWVfaXJxKGRldmMtPmlycSwgZGV2Yyk7CisJCXJldHVybiAwOworCX0KKwlyZXR1cm4gMTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCQkJCQkJCQkJCQkJCQkJCQkJCSoKKyAqCQkJCQkJCQkJRVNTIG1peGVyCQkJCQkJCQkqCisgKgkJCQkJCQkJCQkJCQkJCQkJCQkqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI2RlZmluZSBFUzY4OF9SRUNPUkRJTkdfREVWSUNFUwlcCisJCQkoIFNPVU5EX01BU0tfTElORQl8IFNPVU5EX01BU0tfTUlDCXwgU09VTkRfTUFTS19DRAkJKQorI2RlZmluZ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5taWRpX2lucHV0X2ludHIgPSBpbnB1dDsKKwl9CisJcmV0dXJuIDA7Cit9CisKK3N0YXRpYyB2b2lkIHNiX21pZGlfY2xvc2UoaW50IGRldikKK3sKKwlzYl9kZXZjICpkZXZjID0gbWlkaV9kZXZzW2Rldl0tPmRldmM7CisJdW5zaWduZWQgbG9uZyBmbGFnczsKKworCWlmIChkZXZjID09IE5VTEwpCisJCXJldHVybjsKKworCXNwaW5fbG9ja19pcnFzYXZlKCZkZXZjLT5sb2NrLCBmbGFncyk7CisJc2JfZHNwX3Jlc2V0KGRldmMpOworCWRldmMtPmludHJfYWN0aXZlID0gMDsKKwlkZXZjLT5pbnB1dF9vcGVuZWQgPSAwOworCWRldmMtPm9wZW5lZCA9IDA7CisJc3Bpbl91bmxvY2tfaXJxcmVzdG9yZSgmZGV2Yy0+bG9jaywgZmxhZ3MpOworfQorCitzdGF0aWMgaW50IHNiX21pZGlfb3V0KGludCBkZXYsIHVuc2lnbmVkIGNoYXIgbWlkaV9ieXRlKQoreworCXNiX2RldmMgKmRldmMgPSBtaWRpX2RldnNbZGV2XS0+ZGV2YzsKKworCWlmIChkZXZjID09IE5VTEwpCisJCXJldHVybiAxOworCisJaWYgKGRldmMtPm1pZGlfYnJva2VuKQorCQlyZXR1cm4gMTsKKworCWlmICghc2JfZHNwX2NvbW1hbmQoZGV2YywgbWlkaV9ieXRlKSkKKwl7CisJCWRldmMtPm1pZGlfYnJva2VuID0gMTsKKwkJcmV0dXJuIDE7CisJfQorCXJldHVybiAxOworfQorCitzdGF0aWMgaW50IHNiX21pZGlfc3RhcnRfcmVhZChpbnQgZGV2KQoreworCXJldHVybiAwOworfQorCitzdGF0aWMgaW50IHNiX21pZGlfZW5kX3JlYWQoaW50IGRldikKK3sKKwlzYl9kZXZjICpkZXZjID0gbWlkaV9kZXZzW2Rldl0tPmRldmM7CisKKwlpZiAoZGV2YyA9PSBOVUxMKQorCQlyZXR1cm4gLUVOWElPOworCisJc2JfZHNwX3Jlc2V0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AgICAweDYKKyNkZWZpbmUgU0JEU1BfUkVBRCAgICAgICAweEEKKyNkZWZpbmUgU0JEU1BfQ09NTUFORCAgICAweEMKKyNkZWZpbmUgU0JEU1BfU1RBVFVTICAgICBTQkRTUF9DT01NQU5ECisjZGVmaW5lIFNCRFNQX0RBVEFfQVZBSUwgMHhFCisKK3N0YXRpYyBpbnQgX19pbml0IHNiX3JzdChpbnQgYmFzZSkKK3sKKwlpbnQgICBpOworICAgCisJb3V0YiggMSwgYmFzZStTQkRTUF9SRVNFVCApOyAgICAgLyogcmVzZXQgdGhlIERTUCAqLworCW91dGIoIDAsIGJhc2UrU0JEU1BfUkVTRVQgKTsKKyAgICAKKwlmb3IgKCBpPTA7IGk8NTAwOyBpKysgKSAgICAgICAgICAvKiBkZWxheSAqLworCQlpbmIoRFBPUlQpOworICAgICAgCisJZm9yICggaT0wOyBpPDEwMDAwMDsgaSsrICkKKwl7CisJCWlmICggaW5iKCBiYXNlK1NCRFNQX0RBVEFfQVZBSUwgKSYweDgwICkKKwkJCWJyZWFrOworCX0KKworCWlmICggaW5iKCBiYXNlK1NCRFNQX1JFQUQgKSE9MHhBQSApCisJCXJldHVybiAwOworCisJcmV0dXJuIDE7Cit9CisKK3N0YXRpYyBpbnQgX19pbml0IHNiX2NtZCggaW50IGJhc2UsIHVuc2lnbmVkIGNoYXIgdmFsICkKK3sKKwlpbnQgIGk7CisKKwlmb3IgKCBpPTEwMDAwMDsgaTsgaS0tICkKKwl7CisJCWlmICggKGluYiggYmFzZStTQkRTUF9TVEFUVVMgKSYweDgwKT09MCApCisJCXsKKyAgICAgICAgCQlvdXRiKCB2YWwsIGJhc2UrU0JEU1BfQ09NTUFORCApOworICAgICAgICAJCWJyZWFrOworCQl9CisJfQorCXJldHVybiBpOyAgICAgIC8qIGk+MCA9PSBzdWNjZXNzICovCit9CisKKworI2RlZmluZSBhaV9zZ2Jhc2UgICAgZHJpdmVyX3VzZV8xCisKK3N0YXRpYyBpbnQgX19pbml0IHByb2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WFzaworICogICAgMTIuMTIuMjAwMCAgIDAuMjggIE1vcmUgZG1hIGJ1ZmZlciBpbml0aWFsaXphdGlvbnMsIHBhdGNoIGZyb20KKyAqICAgICAgICAgICAgICAgICAgICAgICBUamVlcmQgTXVsZGVyIDx0amVlcmQubXVsZGVyQGZ1aml0c3Utc2llbWVucy5jb20+CisgKiAgICAzMS4wMS4yMDAxICAgMC4yOSAgUmVnaXN0ZXIvVW5yZWdpc3RlciBnYW1lcG9ydAorICogICAgICAgICAgICAgICAgICAgICAgIEZpeCBTRVRUUklHR0VSIG5vbiBPU1MgQVBJIGNvbmZvcm1pdHkKKyAqICAgIDE4LjA1LjIwMDEgICAwLjMwICBQQ0kgcHJvYmluZyBhbmQgZXJyb3IgdmFsdWVzIGNsZWFuZWQgdXAgYnkgTWFyY3VzCisgKiAgICAgICAgICAgICAgICAgICAgICAgTWVpc3NuZXIgPG1tQGNhbGRlcmEuZGU+CisgKiAgICAwMy4wMS4yMDAzICAgMC4zMSAgb3Blbl9tb2RlIGZpeGVzIGZyb20gR2VvcmcgQWNoZXIgPGFjaGVyQGluLnR1bS5kZT4KKyAqCisgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworICAgICAgCisjaW5jbHVkZSA8bGludXgvbW9kdWxlLmg+CisjaW5jbHVkZSA8bGludXgvc3RyaW5nLmg+CisjaW5jbHVkZSA8bGludXgvaW9wb3J0Lmg+CisjaW5jbHVkZSA8bGludXgvaW50ZXJydXB0Lmg+CisjaW5jbHVkZSA8bGludXgvd2FpdC5oPgorI2luY2x1ZGUgPGxpbnV4L21tLmg+CisjaW5jbHVkZSA8bGludXgvZGVsYXkuaD4KKyNpbmNsdWRlIDxsaW51eC9zb3VuZC5oPgorI2luY2x1ZGUgPGxpbnV4L3NsYWIuaD4KKyNpbmNsdWRlIDxsaW51eC9zb3VuZGNhcmQuaD4KKyNpbmNsdWR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OworCXdoaWxlIChjb3VudCA+IDApIHsKKwkJc3Bpbl9sb2NrX2lycXNhdmUoJnMtPmxvY2ssIGZsYWdzKTsKKwkJcHRyID0gcy0+bWlkaS5pcmQ7CisJCWNudCA9IE1JRElJTkJVRiAtIHB0cjsKKwkJaWYgKHMtPm1pZGkuaWNudCA8IGNudCkKKwkJCWNudCA9IHMtPm1pZGkuaWNudDsKKwkJaWYgKGNudCA8PSAwKQorICAgICAgICAgICAgICAgICAgICAgIF9fc2V0X2N1cnJlbnRfc3RhdGUoVEFTS19JTlRFUlJVUFRJQkxFKTsKKwkJc3Bpbl91bmxvY2tfaXJxcmVzdG9yZSgmcy0+bG9jaywgZmxhZ3MpOworCQlpZiAoY250ID4gY291bnQpCisJCQljbnQgPSBjb3VudDsKKwkJaWYgKGNudCA8PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGUtPmZfZmxhZ3MgJiBPX05PTkJMT0NLKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXJldCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0ID0gLUVBR0FJTjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICBzY2hlZHVsZSgpOworICAgICAgICAgICAgICAgICAgICAgIGlmIChzaWduYWxfcGVuZGluZyhjdXJyZW50KSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFyZXQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldCA9IC1FUkVTVEFSVFNZUzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgIH0KKwkJCWNvbnRpbnVlOworCQl9CisJCWlmIChjb3B5X3RvX3VzZXIoYnVmZmVyLCBzLT5taWRpLmlidWYgKyBwdHIsIGNudCkpI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UF9GUkVFOworfQorCitzdGF0aWMgdm9pZCBkb19zZXF1ZW5jZXJfdGltZXIodW5zaWduZWQgbG9uZyBkdW1teSkKK3sKKwlzZXF1ZW5jZXJfdGltZXIoMCk7Cit9CisKKworc3RhdGljIHN0cnVjdCB0aW1lcl9saXN0IHNlcV90aW1lciA9CisJCVRJTUVSX0lOSVRJQUxJWkVSKGRvX3NlcXVlbmNlcl90aW1lciwgMCwgMCk7CisKK3ZvaWQgcmVxdWVzdF9zb3VuZF90aW1lcihpbnQgY291bnQpCit7CisJZXh0ZXJuIHVuc2lnbmVkIGxvbmcgc2VxX3RpbWU7CisKKwlpZiAoY291bnQgPCAwKSB7CisJCXNlcV90aW1lci5leHBpcmVzID0gKC1jb3VudCkgKyBqaWZmaWVzOworCQlhZGRfdGltZXIoJnNlcV90aW1lcik7CisJCXJldHVybjsKKwl9CisJY291bnQgKz0gc2VxX3RpbWU7CisKKwljb3VudCAtPSBqaWZmaWVzOworCisJaWYgKGNvdW50IDwgMSkKKwkJY291bnQgPSAxOworCisJc2VxX3RpbWVyLmV4cGlyZXMgPSAoY291bnQpICsgamlmZmllczsKKwlhZGRfdGltZXIoJnNlcV90aW1lcik7Cit9CisKK3ZvaWQgc291bmRfc3RvcF90aW1lcih2b2lkKQoreworCWRlbF90aW1lcigmc2VxX3RpbWVyKTsKK30KKwordm9pZCBjb25mX3ByaW50ZihjaGFyICpuYW1lLCBzdHJ1Y3QgYWRkcmVzc19pbmZvICpod19jb25maWcpCit7CisjaWZuZGVmIENPTkZJR19TT1VORF9UUkFDRUlOSVQKKwlyZXR1cm47CisjZWxzZQorCXByaW50aygiPCVzPiBhdCAweCUwM3giLCBuYW1lLCBod19jb25maWctPmlvX2Jhc2UpOworCisJaWYgKGh3X2NvbmZpZy0+aXJxKQorCQlwcmludGsoIiBpcnEgJWQiLCAoaHdfY29uZmlnLT5pcnEgPiAwKSA/IGh3X2NvbmZpZy0+aXJxIDogLWh3X2NvbmZpZy0+aXJxKTsKKworCWlmIChod19jb25maWctPmRtYSAhPSAtMSB8fCBod19jb25maWctPmRtYTIgIT0gLTEpCisJeworCQlwcmludGsoIiBkbWEgJWQiLCBod19jb25maWctPmRtYSk7CisJCWlmIChod19jb25maWctPmRtYTIgIT0gLTEpCisJCQlwcmludGsoIiwlZCIsIGh3X2NvbmZpZy0+ZG1hMik7CisJfQorCXByaW50aygiXG4iKTsKKyNlbmRpZgorfQorCit2b2lkIGNvbmZfcHJpbnRmMihjaGFyICpuYW1lLCBpbnQgYmFzZSwgaW50IGlycSwgaW50IGRtYSwgaW50IGRtYTIpCit7CisjaWZuZGVmIENPTkZJR19TT1VORF9UUkFDRUlOSVQKKwlyZXR1cm47CisjZWxzZQorCXByaW50aygiPCVzPiBhdCAweCUwM3giLCBuYW1lLCBiYXNlKTsKKworCWlmIChpcnEpCisJCXByaW50aygiIGlycSAlZCIsIChpcnEgPiAwKSA/IGlycSA6IC1pcnEpOworCisJaWYgKGRtYSAhPSAtMSB8fCBkbWEyICE9IC0xKQorCXsKKwkJICBwcmludGsoIiBkbWEgJWQiLCBkbWEpOworCQkgIGlmIChkbWEyICE9IC0xKQorCQkJICBwcmludGsoIiwlZCIsIGRtYTIpOworCX0KKwlwcmludGsoIlxuIik7CisjZW5kaWYKK30KZGlmZiAtLWdpdCBhL3NvdW5kL29zcy9zb3VuZHZlcnMuaCBiL3NvdW5kL29zcy9zb3VuZHZlcnMuaApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5lOTA4NGQyCi0tLSAvZGV2L251bGwKKysrIGIvc291bmQvb3NzL3NvdW5kdmVycy5oCkBAIC0wLDAgKzEsMiBAQAorI2RlZmluZSBTT1VORF9WRVJTSU9OX1NUUklORyAiMy44czIrKy05NzExMzAiCisjZGVmaW5lIFNPVU5EX0lOVEVSTkFMX1ZFUlNJT04gMHgwMzA4MDQKZGlmZiAtLWdpdCBhL3NvdW5kL29zcy9zc2NhcGUuYyBiL3NvdW5kL29zcy9zc2Nh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EVfU1RBVEUocykgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyh7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgaWYgKCEocykgfHwgKHMpLT5tYWdpYyAhPSBDUzQyOTdhX01BR0lDKSB7IFwKKyAgICAgICAgICAgICAgICBwcmludGsoaW52YWxpZF9tYWdpYyk7ICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICByZXR1cm4gLUVOWElPOyAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKK30pCisKK3N0cnVjdCBsaXN0X2hlYWQgY3M0Mjk3YV9kZXZzID0geyAmY3M0Mjk3YV9kZXZzLCAmY3M0Mjk3YV9kZXZzIH07CisKK3R5cGVkZWYgc3RydWN0IHNlcmRtYV9kZXNjcl9zIHsKKyAgICAgICAgdTY0IGRlc2NyX2E7CisgICAgICAgIHU2NCBkZXNjcl9iOworfSBzZXJkbWFfZGVzY3JfdDsKKwordHlwZWRlZiB1bnNpZ25lZCBsb25nIHBhZGRyX3Q7CisKK3R5cGVkZWYgc3RydWN0IHNlcmRtYV9zIHsKKyAgICAgICAgdW5zaWduZWQgICAgICAgICByaW5nc3o7CisgICAgICAgIHNlcmRtYV9kZXNjcl90ICAqZGVzY3J0YWI7CisgICAgICAgIHNlcmRtYV9kZXNjcl90ICAqZGVzY3J0YWJfZW5kOworICAgICAgICBwYWRkcl90ICAgICAgICAgIGRlc2NydGFiX3BoeXM7CisgICAgICAgIAorICAgICAgICBzZXJkbWFfZGVzY3JfdCAgKmRlc2NyX2FkZDsKKyAgICAgICAgc2VyZG1hX2Rlc2NyX3QgICpkZXNjcl9yZW07CisgICAgICAgIAorICAgICAgICB1NjQgICpkbWFfYnVmOyAgICAgICAgICAgLy8gYnVmZmVyIGZvciBETUEgY29udGVudHMgKGZyYW1lcykKKyAgICAgICAgcGFkZH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VU5UKCAwKSB8IE1fU1lOQ1NFUl9TRVFfRU5BQkxFIHwgTV9TWU5DU0VSX1NFUV9TVFJPQkUgfAorICAgICAgICAgICAgICBNX1NZTkNTRVJfU0VRX0xBU1QsIFNTX1JYVEJMKDMpKTsKKworICAgICAgICBmb3IgKGk9NDsgaTwxNjsgaSsrKSB7CisgICAgICAgICAgICAgICAgLyogSnVzdCBpbiBjYXNlLi4uICovCisgICAgICAgICAgICAgICAgX19yYXdfd3JpdGVxKE1fU1lOQ1NFUl9TRVFfTEFTVCwgU1NfVFhUQkwoaSkpOworICAgICAgICAgICAgICAgIF9fcmF3X3dyaXRlcShNX1NZTkNTRVJfU0VRX0xBU1QsIFNTX1JYVEJMKGkpKTsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiAwOworfQorCitzdGF0aWMgaW50IGluaXRfc2VyZG1hKHNlcmRtYV90ICpkbWEpCit7CisgICAgICAgIENTX0RCR09VVChDU19JTklULCAyLAorICAgICAgICAgICAgICAgICAgcHJpbnRrKEtFUk5fRVJSICJjczQyOTdhOiBkZXNjIC0gJWQgc2J1ZnNpemUgLSAlZCBkYnVmc2l6ZSAtICVkXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgIERNQV9ERVNDUiwgU0FNUExFX0JVRl9TSVpFLCBETUFfQlVGX1NJWkUpKTsKKworICAgICAgICAvKiBEZXNjcmlwdG9ycyAqLworICAgICAgICBkbWEtPnJpbmdzeiA9IERNQV9ERVNDUjsKKyAgICAgICAgZG1hLT5kZXNjcnRhYiA9IGttYWxsb2MoZG1hLT5yaW5nc3ogKiBzaXplb2Yoc2VyZG1hX2Rlc2NyX3QpLCBHRlBfS0VSTkVMKTsKKyAgICAgICAgaWYgKCFkbWEtPmRlc2NydGFiKSB7CisgICAgICAgICAgICAgICAgcHJpbnRrKEtFUk5fRVJSICJjczQyOTdhOiBrbWFsbG9jIGRlc2NydGFiIGZhaWxlZFxuIik7CisgICAgICAgICAgICAgICAgcmV0dXJuIC0xOworIC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IWRtYS0+c2FtcGxlX2J1ZikgeworICAgICAgICAgICAgICAgIHByaW50ayhLRVJOX0VSUiAiY3M0Mjk3YToga21hbGxvYyBzYW1wbGVfYnVmIGZhaWxlZFxuIik7CisgICAgICAgICAgICAgICAga2ZyZWUoZG1hLT5kZXNjcnRhYik7CisgICAgICAgICAgICAgICAga2ZyZWUoZG1hLT5kbWFfYnVmKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gLTE7CisgICAgICAgIH0KKyAgICAgICAgZG1hLT5zYl9zd3B0ciA9IGRtYS0+c2JfaHdwdHIgPSBkbWEtPnNhbXBsZV9idWY7CisgICAgICAgIGRtYS0+c2JfZW5kID0gKHUxNiAqKSgodm9pZCAqKWRtYS0+c2FtcGxlX2J1ZiArIGRtYS0+c2J1ZnN6KTsKKyAgICAgICAgZG1hLT5mcmFnc2l6ZSA9IGRtYS0+c2J1ZnN6ID4+IDE7CisKKyAgICAgICAgQ1NfREJHT1VUKENTX0lOSVQsIDQsIAorICAgICAgICAgICAgICAgICAgcHJpbnRrKEtFUk5fRVJSICJjczQyOTdhOiBkZXNjcnRhYiAtICUwOHggZG1hX2J1ZiAtICV4IHNhbXBsZV9idWYgLSAleFxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAoaW50KWRtYS0+ZGVzY3J0YWIsIChpbnQpZG1hLT5kbWFfYnVmLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAoaW50KWRtYS0+c2FtcGxlX2J1ZikpOworCisgICAgICAgIHJldHVybiAwOworfQorCitzdGF0aWMgaW50IGRtYV9pbml0KHN0cnVjdCBjczQyOTdhX3N0YXRlICpzKQoreworICAgICAgICBpbnQgaTsKKworICAgICAgICBDU19EQkdPVVQoQ1NfSU5JVCwgMiwgCisgICAgICAgICAgICAgICAgICBwcmludGsoS0VSTl9JTkZPICJjczQyOTdhOiBTZXR0aW5nIHVwIERNQVxuIikpOworCisgICAgICAgIGlmIChpbml0X3NlcmRtYSgmcy0+ZG1hX2FkYykgfH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RhdGUgKnMsIHU2NCBkYXRhKQoreworICAgICAgICBzZXJkbWFfdCAqZCA9ICZzLT5kbWFfZGFjOworICAgICAgICB1NjQgKmRhdGFfcDsKKyAgICAgICAgdW5zaWduZWQgc3dwdHI7CisgICAgICAgIGludCBmbGFnczsKKyAgICAgICAgc2VyZG1hX2Rlc2NyX3QgKmRlc2NyOworCisgICAgICAgIGlmIChzLT5yZWdfcmVxdWVzdCkgeworICAgICAgICAgICAgICAgIHByaW50ayhLRVJOX0VSUiAiY3M0Mjk3YTogYXR0ZW1wdCB0byBpc3N1ZSBtdWx0aXBsZSByZWdfYWNjZXNzXG4iKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gLTE7CisgICAgICAgIH0KKworICAgICAgICBpZiAocy0+ZW5hICYgRk1PREVfV1JJVEUpIHsKKyAgICAgICAgICAgICAgICAvKiBTaW5jZSBhIHdyaXRlciBoYXMgdGhlIERTUCBvcGVuLCB3ZSBoYXZlIHRvIG11eCB0aGUKKyAgICAgICAgICAgICAgICAgICByZXF1ZXN0IGluICovCisgICAgICAgICAgICAgICAgcy0+cmVnX3JlcXVlc3QgPSBkYXRhOworICAgICAgICAgICAgICAgIGludGVycnVwdGlibGVfc2xlZXBfb24oJnMtPmRtYV9kYWMucmVnX3dhaXQpOworICAgICAgICAgICAgICAgIC8qIFhYWEtXIGhvdyBjYW4gSSBkZWFsIHdpdGggdGhlIHN0YXJ2YXRpb24gY2FzZSB3aGVyZQorICAgICAgICAgICAgICAgICAgIHRoZSBvcGVuZXIgaXNuJ3Qgd3JpdGluZz8gKi8KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAvKiBCZSBzYWZlIHdoZW4gY2hhbmdpbmcgcmluZyBwb2ludGVycyAqLworCQlzcGluX2xvY2tfaXJxc2F2ZSgmcy0+bG9jaywgZmxhZ3MpOworICAgICAgICAgICAgICAgIGlmIChkLT5od3B0ciAhPSBkLT5zd3B0cikgeworICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRrKEtFUk5fRVJSICJjczQyOTdhOiByZWcgYWNjZXNzIGZvdW5kIGJvb2trZWVwaW5nIGVycm9yIChody9zdyA9ICVkLyVkXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQtPmh3cHRyLCBkLT5zd3B0cik7CisgICAgICAgICAgICAgICAgICAgICAgICBzcGluX3VubG9ja19pcnFyZXN0b3JlKCZzLT5sb2NrLCBmbGFncyk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gLTE7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHN3cHRyID0gZC0+c3dwdHI7CisgICAgICAgICAgICAgICAgZC0+aHdwdHIgPSBkLT5zd3B0ciA9IChkLT5zd3B0ciArIDEpICUgZC0+cmluZ3N6OworCQlzcGluX3VubG9ja19pcnFyZXN0b3JlKCZzLT5sb2NrLCBmbGFncyk7CisKKyAgICAgICAgICAgICAgICBkZXNjciA9ICZkLT5kZXNjcnRhYltzd3B0cl07CisgICAgICAgICAgICAgICAgZGF0YV9wID0gJmQtPmRtYV9idWZbc3dwdHIgKiA0XTsKKwkJKmRhdGFfcCA9IGNwdV90b19iZTY0KGRhdGEpOworICAgICAgICAgICAgICAgIF9fcmF3X3dyaXRlcSgxLCBTU19DU1IoUl9TRVJfRE1BX0RTQ1JfQ09VTlRfVFgpKTsKKyAgICAgICAgICAgICAgICBDU19EQkdPVVQoQ1NfREVTQ1IsIDQsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ayhLRVJOX0lORk8gImNzNDI5N2E6IGFkZF90eCAgJXAgKCV4IC0+ICV4KVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFfcCwgc3dwdHIsIGQtPmh3cHRyKSk7CisgICAgICAgIH0KKworICAgICAgICBDU19EQkdPVVQoQ1NfRlVOQ1RJT04sIDYsCisgICAgICAgICAgICAgICAgICBwcmludGsoS0VSTl9JTkZPICJjczQyOTdhOiBzZXJkbWFfcmVnX2FjY2VzcygpLVxuIikpOworICAgICAgICAKKyAgICAgICAgcmV0dXJuIDA7Cit9CisKKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorLy8gImNzNDI5N2FfcmVhZF9hYzk3IiAtLSBSZWFkcyBhbiBBQzk3IHJlZ2lzdGVyCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKK3N0YXRpYyBpbnQgY3M0Mjk3YV9yZWFkX2FjOTcoc3RydWN0IGNzNDI5N2Ffc3RhdGUgKnMsIHUzMiBvZmZzZXQsCisJCQkgICAgdTMyICogdmFsdWUpCit7CisgICAgICAgIENTX0RCR09VVChDU19BQzk3LCAxLAorICAgICAgICAgICAgICAgICAgcHJpbnRrKEtFUk5fSU5GTyAiY3M0Mjk3YTogcmVhZCByZWcgJTJ4XG4iLCBvZmZzZXQpKTsKKyAgICAgICAgaWYgKHNlcmRtYV9yZWdfYWNjZXNzKHMsICgweENMTCA8PCA2MCkgfCAoMUxMIDw8IDQ3KSB8ICgodTY0KShvZmZzZXQgJiAweDdGKSA8PCA0MCkpKQorICAgICAgICAgICAgICAgIHJldHVybiAtMTsKKworICAgICAgICBpbnRlcnJ1cHRpYmxlX3NsZWVwX29uKCZzLT5kbWFfYWRjLnJlZ193YWl0KTsKKyAgICAgICAgKnZhbHVlID0gcy0+cmVhZF92YWx1ZTsKKyAgICAgICAgQ1NfREJHT1VUKENTX0FDOTcsIDIsCisgICAgICAgICAgICAgICAgICBwcmludGsoS0VSTl9JTkZPICJjczQyOTdhOiByZHIgcmVnICV4IC0+ICV4XG4iLCBzLT5yZWFkX3JlZywgcy0+cmVhZF92YWx1ZSkpOworCisgICAgICAgIHJldHVybiAwOworfQorCisKKy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorLy8gImNzNDI5N2Ffd3JpdGVfYWM5NygpIi0tIHdyaXRlcyBhbiBBQzk3IHJlZ2lzdGVyCisvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKK3N0YXRpYyBpbnQgY3M0Mjk3YV93cml0ZV9hYzk3KHN0cnVjdCBjczQyOTdhX3N0YXRlICpzLCB1MzIgb2Zmc2V0LAorCQkJICAgICB1MzIgdmFsdWUpCit7CisgICAgICAgIENTX0RCR09VVChDU19BQzk3LCAxLAorICAgICAgICAgICAgICAgICAgcHJpbnRrKEtFUk5fSU5GTyAiY3M0Mjk3YTogd3JpdGUgcmVnICUyeCAtPiAlMDR4XG4iLCBvZmZzZXQsIHZhbHVlKSk7CisgICAgICAgIHJldHVybiAoc2VyZG1hX3JlZ19hY2Nlc3MocywgKDB4RUxMIDw8IDYwKSB8ICgodTY0KShvZmZzZXQgJiAweDdGKSA8PCA0MCkgfCAoKHZhbHVlICYgMHhmZmZmKSA8PCAxMikpKTsKK30KKworc3RhdGljIHZvaWQgc3RvcF9kYWMoc3RydWN0IGNzNDI5N2Ffc3RhdGUgKnMpCit7CisJdW5zaWduZWQgbG9uZyBmbGFnczsKKworCUNTX0RCR09VVChDU19XQVZFX1dSSVRFLCAzLCBwcmludGsoS0VSTl9JTkZPICJjczQyOTdhOiBzdG9wX2RhYygpOlxuIikpOworCXNwaW5fbG9ja19pcnFzYXZlKCZzLT5sb2NrLCBmbGFncyk7CisJcy0+ZW5hICY9IH5GTU9ERV9XUklURTsKKyNpZiAwCisgICAgICAgIC8qIFhYWEtXIHdoYXQgZG8gSSByZWFsbHkgd2FudCBoZXJlPyAgTXkgdGhlb3J5IGZvciBub3cgaXMKKyAgICAgICAgICAgdGhhdCBJIGp1c3QgZmxpcCB0aGUgImVuYSIgYml0LCBhbmQgdGhlIGludGVycnVwdCBoYW5k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UgKnMsIGludCBpbnRmbGFnKQoreworCWludCBnb29kX2RpZmYsIGRpZmYsIGRpZmYyOworICAgICAgICB1NjQgKmRhdGFfcCwgZGF0YTsKKyAgICAgICAgdTMyICpzX3B0cjsKKwl1bnNpZ25lZCBod3B0cjsKKyAgICAgICAgdTMyIHN0YXR1czsKKyAgICAgICAgc2VyZG1hX3QgKmQ7CisgICAgICAgIHNlcmRtYV9kZXNjcl90ICpkZXNjcjsKKworCS8vIHVwZGF0ZSBBREMgcG9pbnRlciAKKyAgICAgICAgc3RhdHVzID0gaW50ZmxhZyA/IF9fcmF3X3JlYWRxKFNTX0NTUihSX1NFUl9TVEFUVVMpKSA6IDA7CisKKwlpZiAoKHMtPmVuYSAmIEZNT0RFX1JFQUQpIHx8IChzdGF0dXMgJiAoTV9TWU5DU0VSX1JYX0VPUF9DT1VOVCkpKSB7CisgICAgICAgICAgICAgICAgZCA9ICZzLT5kbWFfYWRjOworICAgICAgICAgICAgICAgIGh3cHRyID0gKHVuc2lnbmVkKSAoKChfX3Jhd19yZWFkcShTU19DU1IoUl9TRVJfRE1BX0NVUl9EU0NSX0FERFJfUlgpKSAmIE1fRE1BX0NVUkRTQ1JfQUREUikgLQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQtPmRlc2NydGFiX3BoeXMpIC8gc2l6ZW9mKHNlcmRtYV9kZXNjcl90KSk7CisKKyAgICAgICAgICAgICAgICBpZiAocy0+ZW5hICYgRk1PREVfUkVBRCkgeworICAgICAgICAgICAgICAgICAgICAgICAgQ1NfREJHT1VUKENTX0ZVTkNUSU9OLCAyLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmludGsoS0VSTl9JTkZPICJjczQyOTdhOiB1cGRfcmN2IHN3LT5ody0+aHcgJXgvJXgvJXggKGludC0lZCluIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZC0+c3dwdHIsIGQtPmh3cHRyLCBod3B0ciwgaW50ZmxhZykpOworICAgICAgICAgICAgICAgICAgICAgICAgLyogTnVtYmVyIG9mIERNQSBidWZmZXJzIGF2YWlsYWJsZSBmb3Igc29mdHdhcmU6ICovCisgICAgICAgICAgICAgICAgICAgICAgICBkaWZmMiA9IGRpZmYgPSAoZC0+cmluZ3N6ICsgaHdwdHIgLSBkLT5od3B0cikgJSBkLT5yaW5nc3o7CisgICAgICAgICAgICAgICAgICAgICAgICBkLT5od3B0ciA9IGh3cHRyOworICAgICAgICAgICAgICAgICAgICAgICAgZ29vZF9kaWZmID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNfcHRyID0gKHUzMiAqKSYoZC0+ZG1hX2J1ZltkLT5zd3B0cio0XSk7CisgICAgICAgICAgICAgICAgICAgICAgICBkZXNjciA9ICZkLT5kZXNjcnRhYltkLT5zd3B0cl07CisgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoZGlmZjItLSkgeworCQkJCXU2NCBkYXRhID0gYmU2NF90b19jcHUoKih1NjQgKilzX3B0cik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU2NCBkZXNjcl9hOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MTYgbGVmdCwgcmlnaHQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2NyX2EgPSBkZXNjci0+ZGVzY3JfYTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzY3ItPmRlc2NyX2EgJj0gfk1fRE1BX1NFUlJYX1NPUDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChkZXNjcl9hICYgTV9ETUFfRFNDUkFfQV9BRERSKSAhPSBDUEhZU0FERFIoKGxvbmcpc19wdHIpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRrKEtFUk5fRVJSICJjczQyOTdhOiBSWCBCYWQgYWRkcmVzcyAocmVhZClcbiIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKGRhdGEgJiAweDk4MDAwMDAwMDAwMDAwMDApICE9IDB4OTgwMDAwMDAwMDAwMDAwMCkgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICghKGRlc2NyX2EgJiBNX0RNQV9TRVJSWF9TT1ApKSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKEdfRE1BX0RTQ1JCX1BLVF9TSVpFKGRlc2NyLT5kZXNjcl9iKSAhPSBGUkFNRV9CWVRFUykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT5zdGF0cy5yeF9iYWQrKzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmludGsoS0VSTl9ERUJVRyAiY3M0Mjk3YTogUlggQmFkIGF0dHJpYnV0ZXMgKHJlYWQpXG4iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT5zdGF0cy5yeF9nb29kKys7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZGF0YSA+PiA2MSkgPT0gNykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPnJlYWRfdmFsdWUgPSAoZGF0YSA+PiAxMikgJiAweGZmZmY7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+cmVhZF9yZWcgPSAoZGF0YSA+PiA0MCkgJiAweDdmOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdha2VfdXAoJmQtPnJlZ193YWl0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZC0+Y291bnQgJiYgKGQtPnNiX2h3cHRyID09IGQtPnNiX3N3cHRyKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPnN0YXRzLnJ4X292ZXJmbG93Kys7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRrKEtFUk5fREVCVUcgImNzNDI5N2E6IFJYIG92ZXJmbG93XG4iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnb29kX2RpZmYrKzsKKwkJCQlsZWZ0ID0gKChiZTMyX3RvX2NwdShzX3B0clsxXSkgJiAweGZmKSA8PCA4KSB8CisJCQkJICAgICAgICgoYmUzMl90b19jcHUoc19wdHJbMl0pID4+IDI0KSAmIDB4ZmYpOworCQkJCXJpZ2h0ID0gKGJlMzJfdG9fY3B1KHNfcHRyWzJdKSA+PiA0KSAmIDB4ZmZmZjsKKwkJCQkqZC0+c2JfaHdwdHIrKyA9IGNwdV90b19iZTE2KGxlZnQpOworCQkJCSpkLT5zYl9od3B0cisrID0gY3B1X3RvX2JlMTYocmlnaHQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZC0+c2JfaHdwdHIgPT0gZC0+c2JfZW5kKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQtPnNiX2h3cHRyID0gZC0+c2FtcGxlX2J1ZjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzY3IrKzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRlc2NyID09IGQtPmRlc2NydGFiX2VuZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2NyID0gZC0+ZGVzY3J0YWI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc19wdHIgPSAodTMyICopcy0+ZG1hX2FkYy5kbWFfYnVmOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNfcHRyICs9IDg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGQtPnRvdGFsX2J5dGVzICs9IGdvb2RfZGlmZiAqIEZSQU1FX1NBTVBMRV9CWVRFUzsKKyAgICAgICAgICAgICAgICAgICAgICAgIGQtPmNvdW50ICs9IGdvb2RfZGlmZiAqIEZSQU1FX1NBTVBMRV9CWVRFUzsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkLT5jb3VudCA+IGQtPnNidWZzeikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmludGsoS0VSTl9FUlIgImNzNDI5N2E6IGJvZ3VzIHJlY2VpdmUgb3ZlcmZsb3chIVxuIik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBkLT5zd3B0ciA9IChkLT5zd3B0ciArIGRpZmYpICUgZC0+cmluZ3N6OworICAgICAgICAgICAgICAgICAgICAgICAgX19yYXdfd3JpdGVxKGRpZmYsIFNTX0NTUihSX1NFUl9ETUFfRFNDUl9DT1VOVF9SWCkpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGQtPm1hcHBlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZC0+Y291bnQgPj0gKHNpZ25lZCkgZC0+ZnJhZ3NpemUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2FrZV91cCgmZC0+d2FpdCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZC0+Y291bnQgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ1NfREJHT1VUKENTX1dBVkVfUkVBRCwgNCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRrKEtFUk5fSU5GTworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImNzNDI5N2E6IHVwZGF0ZSBjb3VudCAtPiAlZFxuIiwgZC0+Y291bnQpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3YWtlX3VwKCZkLT53YWl0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvKiBSZWNlaXZlIGlzIGdvaW5nIGV2ZW4gaWYgbm8gb25lIGlzCisgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0ZW5pbmcgKGZvciByZWdpc3RlciBhY2Nlc3NlcyBhbmQgdG8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGF2b2lkIEZJRk8gb3ZlcnJ1bikgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgIGRpZmYyID0gZGlmZiA9IChod3B0ciArIGQtPnJpbmdzeiAtIGQtPmh3cHRyKSAlIGQtPnJpbmdzejsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZGlmZikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmludGsoS0VSTl9FUlIgImNzNDI5N2E6IFJYIGZ1bGwgb3IgZW1wdHk/XG4iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgZGVzY3IgPSAmZC0+ZGVzY3J0YWJbZC0+c3dwdHJdOworICAgICAgICAgICAgICAgICAgICAgICAgZGF0YV9wID0gJmQtPmRtYV9idWZbZC0+c3dwdHIqNF07CisKKyAgICAgICAgICAgICAgICAgICAgICAgIC8qIEZvcmNlIHRoaXMgdG8gaGFwcGVuIGF0IGxlYXN0IG9uY2U7IEkgZ290CisgICAgICAgICAgICAgICAgICAgICAgICAgICBoZXJlIGJlY2F1c2Ugb2YgYW4gaW50ZXJydXB0LCBzbyB0aGVyZSBtdXN0CisgICAgICAgICAgICAgICAgICAgICAgICAgICBiZSBhIGJ1ZmZlciB0byBwcm9jZXNzLiAqLworICAgICAgICAgICAgICAgICAgICAgICAgZG8geworCQkJCWRhdGEgPSBiZTY0X3RvX2NwdSgqZGF0YV9wKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChkZXNjci0+ZGVzY3JfYSAmIE1fRE1BX0RTQ1JBX0FfQUREUikgIT0gQ1BIWVNBRERSKChsb25nKWRhdGFfcCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmludGsoS0VSTl9FUlIgImNzNDI5N2E6IFJYIEJhZCBhZGRyZXNzICVkICglbGx4ICVseClcbiIsIGQtPnN3cHRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobG9uZyBsb25nKShkZXNjci0+ZGVzY3JfYSAmIE1fRE1BX0RTQ1JBX0FfQUREUiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChsb25nKUNQSFlTQUREUigobG9uZylkYXRhX3ApKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIShkYXRhICYgKDFMTCA8PCA2MykpIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhKGRlc2NyLT5kZXNjcl9hICYgTV9ETUFfU0VSUlhfU09QKSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKEdfRE1BX0RTQ1JCX1BLVF9TSVpFKGRlc2NyLT5kZXNjcl9iKSAhPSBGUkFNRV9CWVRFUykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT5zdGF0cy5yeF9iYWQrKzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmludGsoS0VSTl9ERUJVRyAiY3M0Mjk3YTogUlggQmFkIGF0dHJpYnV0ZXNcbiIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPnN0YXRzLnJ4X2dvb2QrKzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGRhdGEgPj4gNjEpID09IDcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPnJlYWRfdmFsdWUgPSAoZGF0YSA+PiAxMikgJiAweGZmZmY7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT5yZWFkX3JlZyA9IChkYXRhID4+IDQwKSAmIDB4N2Y7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3YWtlX3VwKCZkLT5yZWdfd2FpdCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2NyLT5kZXNjcl9hICY9IH5NX0RNQV9TRVJSWF9TT1A7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2NyKys7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQtPnN3cHRyKys7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFfcCArPSA0OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGVzY3IgPT0gZC0+ZGVzY3J0YWJfZW5kKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzY3IgPSBkLT5kZXNjcnRhYjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkLT5zd3B0ciA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YV9wID0gZC0+ZG1hX2J1ZjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX3Jhd193cml0ZXEoMSwgU1NfQ1NSKFJfU0VSX0RNQV9EU0NSX0NPVU5UX1JYKSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgtLWRpZmYpOworICAgICAgICAgICAgICAgICAgICAgICAgZC0+aHdwdHIgPSBod3B0cjsKKworICAgICAgICAgICAgICAgICAgICAgICAgQ1NfREJHT1VUKENTX0RFU0NSLCA2LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmludGsoS0VSTl9JTkZPICJjczQyOTdhOiBody9zdyAleC8leFxuIiwgZC0+aHdwdHIsIGQtPnN3cHRyKSk7CisgICAgICAgICAgICAgICAgfQorCisJCUNTX0RCR09VVChDU19QQVJNUywgOCwgcHJpbnRrKEtFUk5fSU5GTworCQkJImNzNDI5N2E6IGNzNDI5N2FfdXBkYXRlX3B0cigpOiBzPTB4JS44eCBod3B0cj0lZCB0b3RhbF9ieXRlcz0lZCBjb3VudD0lZCBcbiIsCisJCQkJKHVuc2lnbmVkKXMsIGQtPmh3cHRyLCAKKwkJCQlkLT50b3RhbF9ieXRlcywgZC0+Y291bnQpKTsKKwl9CisKKyAgICAgICAgLyogWFhYS1cgd29ycnkgYWJvdXQgcy0+cmVnX3JlcXVlc3QgLS0gdGhlcmUgaXMgYSBzdGFydmF0aW9uCisgICAgICAgICAgIGNhc2UgaWYgcy0+ZW5hIGhhcyBGTU9ERV9XUklURSBvbiwgYnV0IHRoZSBjbGllbnQgaXNuJ3QKKyAgICAgICAgICAgZG9pbmcgd3JpdGVzICovCisKKwkvLyB1cGRhdGUgREFDIHBvaW50ZXIgCisJLy8KKwkvLyBjaGVjayBmb3IgZW5kIG9mIGJ1ZmZlciwgbWVhbnMgdGhhdCB3ZSBhcmUgZ29pbmcgdG8gd2FpdCBmb3IgYW5vdGhlciBpbnRlcnJ1cHQKKwkvLyB0byBhbGxvdyBzaWxlbmNlIHRvIGZpbGwgdGhlIGZpZm9zIG9uIHRoZSBwYXJ0LCB0byBrZWVwIHBvcHMgZG93biB0byBhIG1pbmltdW0uCisJLy8KKwlpZiAocy0+ZW5hICYgRk1PREVfV1JJVEUpIHsKKyAgICAgICAgICAgICAgICBzZXJkbWFfdCAqZCA9ICZzLT5kbWFfZGFjOworICAgICAgICAgICAgICAgIGh3cHRyID0gKHVuc2lnbmVkKSAoKChfX3Jhd19yZWFkcShTU19DU1IoUl9TRVJfRE1BX0NVUl9EU0NSX0FERFJfVFgpKSAmIE1fRE1BX0NVUkRTQ1JfQUREUikgLQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQtPmRlc2NydGFiX3BoeXMpIC8gc2l6ZW9mKHNlcmRtYV9kZXNjcl90KSk7CisgICAgICAgICAgICAgICAgZGlmZiA9IChkLT5yaW5nc3ogKyBod3B0ciAtIGQtPmh3cHRyKSAlIGQtPnJpbmdzejsKKyAgICAgICAgICAgICAgICBDU19EQkdPVVQoQ1NfV0FWRV9XUklURSwgNCwgcHJpbnRrKEtFUk5fSU5GTworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImNzNDI5N2E6IGNzNDI5N2FfdXBkYXRlX3B0cigpOiBody9ody9zdyAleC8leC8leCBkaWZmICVkIGNvdW50ICVkXG4iLAorICAgICAgICAgICAg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ZCkocy0+cHJvcF9kYWMuZm10ICYgCisJCQkJCQkoQUZNVF9VOCB8IEFGTVRfVTE2X0xFKSkgPyAweDgwIDogMCwgCisJCQkJCQkodW5zaWduZWQpZC0+ZG1hX2J1ZiwgCisJCQkJCQlkLT5yaW5nc3opKTsKKwkJCQltZW1zZXQoZC0+ZG1hX2J1ZiwgMCwgZC0+cmluZ3N6ICogRlJBTUVfQllURVMpOworCQkJCWlmIChkLT5jb3VudCA8IDApIHsKKwkJCQkJZC0+dW5kZXJydW4gPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPnN0YXRzLnR4X3VuZGVycnVuKys7CisJCQkJCWQtPmNvdW50ID0gMDsKKwkJCQkJQ1NfREJHT1VUKENTX0VSUk9SLCA5LCBwcmludGsoS0VSTl9JTkZPCisJCQkJCSAiY3M0Mjk3YTogY3M0Mjk3YV91cGRhdGVfcHRyKCk6IHVuZGVycnVuXG4iKSk7CisJCQkJfQorCQkJfSBlbHNlIGlmIChkLT5jb3VudCA8PQorCQkJCSAgIChzaWduZWQpIGQtPmZyYWdzaXplCisJCQkJICAgJiYgIWQtPmVuZGNsZWFyZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgLyogWFhYS1cgd2hhdCBpcyB0aGlzIGZvcj8gKi8KKwkJCQljbGVhcl9hZHZhbmNlKGQtPmRtYV9idWYsCisJCQkJCSAgICAgIGQtPnNidWZzeiwKKwkJCQkJICAgICAgZC0+c3dwdHIsCisJCQkJCSAgICAgIGQtPmZyYWdzaXplLAorCQkJCQkgICAgICAwKTsKKwkJCQlkLT5lbmRjbGVhcmVkID0gMTsKKwkJCX0KKwkJCWlmICggKGQtPmNvdW50IDw9IChzaWduZWQpIGQtPnNidWZzei8yKSB8fCBpbnRmbGFnKQorCQkJeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDU19EQkdPVVQoQ1NfV0FWRV9XUklURSwgNCwKKyAgICAgICAgICAgICAgICAgICAgICA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VU5EX01JWEVSX1JFQ1NSQzoJLy8gQXJnIGNvbnRhaW5zIGEgYml0IGZvciBlYWNoIHJlY29yZGluZyBzb3VyY2UgCisJCQljczQyOTdhX3JlYWRfYWM5NyhzLCBBQzk3X1JFQ09SRF9TRUxFQ1QsCisJCQkJCSAmdGVtcDEpOworCQkJcmV0dXJuIHB1dF91c2VyKG1peGVyX3NyY1t0ZW1wMSAmIDddLCAoaW50ICopIGFyZyk7CisKKwkJY2FzZSBTT1VORF9NSVhFUl9ERVZNQVNLOgkvLyBBcmcgY29udGFpbnMgYSBiaXQgZm9yIGVhY2ggc3VwcG9ydGVkIGRldmljZSAKKwkJCXJldHVybiBwdXRfdXNlcihTT1VORF9NQVNLX1BDTSB8IFNPVU5EX01BU0tfTElORSB8CisJCQkJCVNPVU5EX01BU0tfVk9MVU1FIHwgU09VTkRfTUFTS19SRUNMRVYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGludCAqKSBhcmcpOworCisJCWNhc2UgU09VTkRfTUlYRVJfUkVDTUFTSzoJLy8gQXJnIGNvbnRhaW5zIGEgYml0IGZvciBlYWNoIHN1cHBvcnRlZCByZWNvcmRpbmcgc291cmNlIAorCQkJcmV0dXJuIHB1dF91c2VyKFNPVU5EX01BU0tfTElORSB8IFNPVU5EX01BU0tfVk9MVU1FLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpbnQgKikgYXJnKTsKKworCQljYXNlIFNPVU5EX01JWEVSX1NURVJFT0RFVlM6CS8vIE1peGVyIGNoYW5uZWxzIHN1cHBvcnRpbmcgc3RlcmVvIAorCQkJcmV0dXJuIHB1dF91c2VyKFNPVU5EX01BU0tfUENNIHwgU09VTkRfTUFTS19MSU5FIHwKKwkJCQkJU09VTkRfTUFTS19WT0xVTUUgfCBTT1VORF9NQVNLX1JFQ0xFViwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaW50ICopIGFyZyk7CisK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RlICppbm9kZSwgc3RydWN0IGZpbGUgKmZpbGUpCit7CisJc3RydWN0IGNzNDI5N2Ffc3RhdGUgKnMgPQorCSAgICAoc3RydWN0IGNzNDI5N2Ffc3RhdGUgKikgZmlsZS0+cHJpdmF0ZV9kYXRhOworCisJVkFMSURBVEVfU1RBVEUocyk7CisJcmV0dXJuIDA7Cit9CisKKworc3RhdGljIGludCBjczQyOTdhX2lvY3RsX21peGRldihzdHJ1Y3QgaW5vZGUgKmlub2RlLCBzdHJ1Y3QgZmlsZSAqZmlsZSwKKwkJCSAgICAgICB1bnNpZ25lZCBpbnQgY21kLCB1bnNpZ25lZCBsb25nIGFyZykKK3sKKwlyZXR1cm4gbWl4ZXJfaW9jdGwoKHN0cnVjdCBjczQyOTdhX3N0YXRlICopIGZpbGUtPnByaXZhdGVfZGF0YSwgY21kLAorCQkJICAgYXJnKTsKK30KKworCisvLyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKy8vICAgTWl4ZXIgZmlsZSBvcGVyYXRpb25zIHN0cnVjdC4KKy8vICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorc3RhdGljIC8qY29uc3QgKi8gc3RydWN0IGZpbGVfb3BlcmF0aW9ucyBjczQyOTdhX21peGVyX2ZvcHMgPSB7CisJLm93bmVyCQk9IFRISVNfTU9EVUxFLAorCS5sbHNlZWsJCT0gbm9fbGxzZWVrLAorCS5pb2N0bAkJPSBjczQyOTdhX2lvY3RsX21peGRldiwKKwkub3BlbgkJPSBjczQyOTdhX29wZW5fbWl4ZGV2LAorCS5yZWxlYXNlCT0gY3M0Mjk3YV9yZWxlYXNlX21peGRldiwKK307CisKKy8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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E6IGNzNDI5N2Ffd3JpdGUoKSsgY291bnQ9JWRcbiIsCisJCQkgY291bnQpKTsKKwlWQUxJREFURV9TVEFURShzKTsKKworCWlmIChzLT5kbWFfZGFjLm1hcHBlZCkKKwkJcmV0dXJuIC1FTlhJTzsKKwlpZiAoIXMtPmRtYV9kYWMucmVhZHkgJiYgKHJldCA9IHByb2dfZG1hYnVmX2RhYyhzKSkpCisJCXJldHVybiByZXQ7CisJaWYgKCFhY2Nlc3Nfb2soVkVSSUZZX1JFQUQsIGJ1ZmZlciwgY291bnQpKQorCQlyZXR1cm4gLUVGQVVMVDsKKwlyZXQgPSAwOworCXdoaWxlIChjb3VudCA+IDApIHsKKyAgICAgICAgICAgICAgICBzZXJkbWFfdCAqZCA9ICZzLT5kbWFfZGFjOworICAgICAgICAgICAgICAgIGludCBjb3B5X2NudDsKKyAgICAgICAgICAgICAgICB1MzIgKnNfdG1wbDsKKyAgICAgICAgICAgICAgICB1MzIgKnRfdG1wbDsKKyAgICAgICAgICAgICAgICB1MzIgbGVmdCwgcmlnaHQ7CisgICAgICAgICAgICAgICAgaW50IHN3YXAgPSAocy0+cHJvcF9kYWMuZm10ID09IEFGTVRfUzE2X0xFKSB8fCAocy0+cHJvcF9kYWMuZm10ID09IEFGTVRfVTE2X0xFKTsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAvKiBYWFhYWFggdGhpcyBpcyBicm9rZW4gZm9yIEJMT0FUX0ZBQ1RPUiAqLworCQlzcGluX2xvY2tfaXJxc2F2ZSgmcy0+bG9jaywgZmxhZ3MpOworCQlpZiAoZC0+Y291bnQgPCAwKSB7CisJCQlkLT5jb3VudCA9IDA7CisJCQlkLT5zd3B0ciA9IGQtPmh3cHRyOworCQl9CisJCWlmIChkLT51bmRlcnJ1bikgeworCQkJZC0+dW5kZXJydW4gPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgaHdwdHIgPSAodW5zaWduZWQpICgoKF9fcmF3X3JlYWRxKFNTX0NTUih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h1MzIgKilkLT5zYW1wbGVfYnVmOworICAgICAgICAgICAgICAgIHRfdG1wbCA9ICh1MzIgKikoZC0+ZG1hX2J1ZiArIChzd3B0ciAqIDQpKTsKKworICAgICAgICAgICAgICAgIC8qIFhYWEtXIGFzc3VtaW5nIDE2LWJpdCBzdGVyZW8hICovCisgICAgICAgICAgICAgICAgZG8geworCQkJdTMyIHRtcDsKKworCQkJdF90bXBsWzBdID0gY3B1X3RvX2JlMzIoMHg5ODAwMDAwMCk7CisKKwkJCXRtcCA9IGJlMzJfdG9fY3B1KHNfdG1wbFswXSk7CisJCQlsZWZ0ID0gdG1wICYgMHhmZmZmOworCQkJcmlnaHQgPSB0bXAgPj4gMTY7CisJCQlpZiAoc3dhcCkgeworCQkJCWxlZnQgPSBzd2FiMTYobGVmdCk7CisJCQkJcmlnaHQgPSBzd2FiMTYocmlnaHQpOworCQkJfQorCQkJdF90bXBsWzFdID0gY3B1X3RvX2JlMzIobGVmdCA+PiA4KTsKKwkJCXRfdG1wbFsyXSA9IGNwdV90b19iZTMyKCgobGVmdCAmIDB4ZmYpIDw8IDI0KSB8CisJCQkJCQkocmlnaHQgPDwgNCkpOworCisgICAgICAgICAgICAgICAgICAgICAgICBzX3RtcGwrKzsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRfdG1wbCArPSA4OworICAgICAgICAgICAgICAgICAgICAgICAgY29weV9jbnQgLT0gNDsKKyAgICAgICAgICAgICAgICB9IHdoaWxlIChjb3B5X2NudCk7CisKKyAgICAgICAgICAgICAgICAvKiBNdXggaW4gYW55IHBlbmRpbmcgcmVhZC93cml0ZSBhY2Nlc3NlcyAqLworICAgICAgICAgICAgICAgIGlmIChzLT5yZWdfcmVxdWVzdCkgeworCQkJKih1NjQgKikoZC0+ZG1hX2J1ZiArIChzd3B0ciAqIDQpKSB8PQorCQkJCWNwdV90b19iZTY0KHMtPnJlZ19yZXF1ZXN0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHMtPnJlZ19yZXF1ZXN0ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHdha2VfdXAoJnMtPmRtYV9kYWMucmVnX3dhaXQpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIENTX0RCR09VVChDU19XQVZFX1dSSVRFLCA0LAorICAgICAgICAgICAgICAgICAgICAgICAgICBwcmludGsoS0VSTl9JTkZPCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiY3M0Mjk3YTogY29weSBpbiAlZCB0byBzd3B0ciAleFxuIiwgY250LCBzd3B0cikpOworCisJCXN3cHRyID0gKHN3cHRyICsgKGNudC9GUkFNRV9TQU1QTEVfQllURVMpKSAlIGQtPnJpbmdzejsKKyAgICAgICAgICAgICAgICBfX3Jhd193cml0ZXEoY250L0ZSQU1FX1NBTVBMRV9CWVRFUywgU1NfQ1NSKFJfU0VSX0RNQV9EU0NSX0NPVU5UX1RYKSk7CisJCXNwaW5fbG9ja19pcnFzYXZlKCZzLT5sb2NrLCBmbGFncyk7CisJCWQtPnN3cHRyID0gc3dwdHI7CisJCWQtPmNvdW50ICs9IGNudDsKKwkJZC0+ZW5kY2xlYXJlZCA9IDA7CisJCXNwaW5fdW5sb2NrX2lycXJlc3RvcmUoJnMtPmxvY2ssIGZsYWdzKTsKKwkJY291bnQgLT0gY250OworCQlidWZmZXIgKz0gY250OworCQlyZXQgKz0gY250OworCQlzdGFydF9kYWMocyk7CisJfQorCUNTX0RCR09VVChDU19GVU5DVElPTiB8IENTX1dBVkVfV1JJVEUsIDIsCisJCSAgcHJpbnRrKEtFUk5fSU5GTyAiY3M0Mjk3YTogY3M0Mjk3YV93cml0ZSgpLSAlZFxuIiwgcmV0KSk7CisJcmV0dXJuIHJldDsKK30KKworCitzdGF0aWMgdW5zaWduZWQgaW50IGNzNDI5N2FfcG9sbChzdHJ1Y3QgZmlsZSAqZmlsZSwKKwkJCQlzdHJ1Y3QgcG9sbF90YWJsZV9zdHJ1Y3QgKndhaXQpCit7CisJc3RydWN0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A7CisJCXVwKCZzLT5vcGVuX3NlbV9kYWMpOworCisJCWlmIChwcm9nX2RtYWJ1Zl9kYWMocykpIHsKKwkJCUNTX0RCR09VVChDU19PUEVOIHwgQ1NfRVJST1IsIDIsIHByaW50ayhLRVJOX0VSUgorCQkJCSJjczQyOTdhOiBkYWMgUHJvZ3JhbSBkbWFidWZzIGZhaWxlZC5cbiIpKTsKKwkJCWNzNDI5N2FfcmVsZWFzZShpbm9kZSwgZmlsZSk7CisJCQlyZXR1cm4gLUVOT01FTTsKKwkJfQorCX0KKwlDU19EQkdPVVQoQ1NfRlVOQ1RJT04gfCBDU19PUEVOLCAyLAorCQkgIHByaW50ayhLRVJOX0lORk8gImNzNDI5N2E6IGNzNDI5N2Ffb3BlbigpLSAwXG4iKSk7CisJcmV0dXJuIG5vbnNlZWthYmxlX29wZW4oaW5vZGUsIGZpbGUpOworfQorCisKKy8vICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorLy8gICBXYXZlIChhdWRpbykgZmlsZSBvcGVyYXRpb25zIHN0cnVjdC4KKy8vICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorc3RhdGljIC8qY29uc3QgKi8gc3RydWN0IGZpbGVfb3BlcmF0aW9ucyBjczQyOTdhX2F1ZGlvX2ZvcHMgPSB7CisJLm93bmVyCQk9IFRISVNfTU9EVUxFLAorCS5sbHNlZWsJCT0gbm9fbGxzZWVrLAorCS5yZWFkCQk9IGNzNDI5N2FfcmVhZCwKKwkud3JpdGUJCT0gY3M0Mjk3YV93cml0ZSwKKwkucG9sbAkJPSBjczQyOTdhX3BvbGwsCisJLmlvY3RsCQk9IGNzNDI5N2FfaW9jdGwsCisJLm1tYXAJCT0gY3M0Mjk3YV9tbWFwLAorCS5vcGVuC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dfcmVhZHEoU1NfQ1NSKFJfU0VSX1NUQVRVUykpOworICAgICAgICAgICAgICAgIHByaW50ayhLRVJOX0VSUiAiY3M0Mjk3YTogcnggc3luYyBlcnJvciAoc3RhdHVzICUwOHgpXG4iLCBzdGF0dXMpOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChzdGF0dXMgJiBNX1NZTkNTRVJfUlhfT1ZFUlJVTikgeworICAgICAgICAgICAgICAgIGludCBuZXdwdHIsIGk7CisgICAgICAgICAgICAgICAgcy0+c3RhdHMucnhfb3Zycm4rKzsKKyAgICAgICAgICAgICAgICBwcmludGsoS0VSTl9FUlIgImNzNDI5N2E6IHJlY2VpdmUgRklGTyBvdmVycnVuXG4iKTsKKworICAgICAgICAgICAgICAgIC8qIEZpeCB0aGluZ3MgdXA6IGdldCB0aGUgcmVjZWl2ZSBkZXNjcmlwdG9yIHBvb2wKKyAgICAgICAgICAgICAgICAgICBjbGVhbiBhbmQgZ2l2ZSB0aGVtIGJhY2sgdG8gdGhlIGhhcmR3YXJlICovCisgICAgICAgICAgICAgICAgd2hpbGUgKF9fcmF3X3JlYWRxKFNTX0NTUihSX1NFUl9ETUFfRFNDUl9DT1VOVF9SWCkpKQorICAgICAgICAgICAgICAgICAgICAgICAgOworICAgICAgICAgICAgICAgIG5ld3B0ciA9ICh1bnNpZ25lZCkgKCgoX19yYXdfcmVhZHEoU1NfQ1NSKFJfU0VSX0RNQV9DVVJfRFNDUl9BRERSX1JYKSkgJiBNX0RNQV9DVVJEU0NSX0FERFIpIC0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT5kbWFfYWRjLmRlc2NydGFiX3BoeXMpIC8gc2l6ZW9mKHNlcmRtYV9kZXNjcl90KSk7CisgICAgICAgICAgICAgICAgZm9yIChpPTA7IGk8RE1BX0RFU0NSOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHMtPmRtYV9hZGMuZGVzY3J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VhZHEoS1NFRzEgKyBBX1NDRF9TWVNURU1fQ0ZHKTsKKyAgICAgICAgICAgICAgICBpZiAoIShjZmcgJiBNX1NZU19TRVIxX0VOQUJMRSkpIHsKKyAgICAgICAgICAgICAgICAgIHByaW50ayhLRVJOX0lORk8gImNzNDI5N2E6IHNlcmlhbCBwb3J0IDEgbm90IGNvbmZpZ3VyZWQgZm9yIHN5bmNocm9ub3VzIG9wZXJhdGlvblxuIik7CisgICAgICAgICAgICAgICAgICByZXR1cm4gLTE7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgcHJpbnRrKEtFUk5fSU5GTyAiY3M0Mjk3YTogc2VyaWFsIHBvcnQgMSBzd2l0Y2hpbmcgdG8gc3luY2hyb25vdXMgb3BlcmF0aW9uXG4iKTsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAvKiBGb3JjZSB0aGUgY29kZWMgKG9uIFNXQVJNKSB0byByZXNldCBieSBjbGVhcmluZworICAgICAgICAgICAgICAgICAgIEdFTk8sIHByZXNlcnZpbmcgTURJTyAobm8gZWZmZWN0IG9uIENTV0FSTSkgKi8KKyAgICAgICAgICAgICAgICBfX3Jhd193cml0ZXEobWRpb192YWwsIEtTRUcxK0FfTUFDX1JFR0lTVEVSKDIsIFJfTUFDX01ESU8pKTsKKyAgICAgICAgICAgICAgICB1ZGVsYXkoMTApOworICAgICAgICB9CisKKyAgICAgICAgLyogTm93IHNldCBHRU5PICovCisgICAgICAgIF9fcmF3X3dyaXRlcShtZGlvX3ZhbCB8IE1fTUFDX0dFTkMsIEtTRUcxK0FfTUFDX1JFR0lTVEVSKDIsIFJfTUFDX01ESU8pKTsKKyAgICAgICAgLyogR2l2ZSB0aGUgY29kZWMgc29tZSB0aW1lIHRvIGZpbmlzaCByZXNldHRpbmcgKHN0YXJ0IHRoZSBiaXQgY2xvY2spICovCisgICAgICAgIHVkZWxheSgxMDApOworI2VuZGlmCisKKwlpZiAoIShzID0ga21hbGxvYyhza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NiMTI1MF9kdWFydF9wcmVzZW50OworCisgICAgICAgICAgICAgICAgZnMgPSBnZXRfZnMoKTsKKyAgICAgICAgICAgICAgICBzZXRfZnMoS0VSTkVMX0RTKTsKKyNpZiAwCisgICAgICAgICAgICAgICAgdmFsID0gU09VTkRfTUFTS19MSU5FOworICAgICAgICAgICAgICAgIG1peGVyX2lvY3RsKHMsIFNPVU5EX01JWEVSX1dSSVRFX1JFQ1NSQywgKHVuc2lnbmVkIGxvbmcpICZ2YWwpOworICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBzaXplb2YoaW5pdHZvbCkgLyBzaXplb2YoaW5pdHZvbFswXSk7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFsID0gaW5pdHZvbFtpXS52b2w7CisgICAgICAgICAgICAgICAgICAgICAgICBtaXhlcl9pb2N0bChzLCBpbml0dm9sW2ldLm1peGNoLCAodW5zaWduZWQgbG9uZykgJnZhbCk7CisgICAgICAgICAgICAgICAgfQorLy8gICAgICAgICAgICAgICAgY3M0Mjk3YV93cml0ZV9hYzk3KHMsIDB4MTgsIDB4MDgwOCk7CisjZWxzZQorICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgIGNzNDI5N2Ffd3JpdGVfYWM5NyhzLCAweDVlLCAweDE4MCk7CisgICAgICAgICAgICAgICAgY3M0Mjk3YV93cml0ZV9hYzk3KHMsIDB4MDIsIDB4MDgwOCk7CisgICAgICAgICAgICAgICAgY3M0Mjk3YV93cml0ZV9hYzk3KHMsIDB4MTgsIDB4MDgwOCk7CisjZW5kaWYKKyAgICAgICAgICAgICAgICBzZXRfZnMoZnMpOworCisgICAgICAgICAgICAgICAgbGlzdF9hZGQoJnMtPmxpc3QsICZjczQyOTdhX2RldnMpOworCisgICAgICAgICAgICAgICAgY3M0Mjk3YV9yZWFkX2FjOTcocywgQUM5N19WRU5ET1JfSUQxLCAmaWQpOworCisJCXNiMTI1MF9kdWFydF9wcmVzZW50ID0gc3ltYm9sX2dldChzYjEyNTBfZHVhcnRfcHJlc2VudCk7CisJCWlmIChzYjEyNTBfZHVhcnRfcHJlc2VudCkKKwkJCXNiMTI1MF9kdWFydF9wcmVzZW50WzFdID0gMDsKKworICAgICAgICAgICAgICAgIHByaW50ayhLRVJOX0lORk8gImNzNDI5N2E6IGluaXRpYWxpemVkICh2ZW5kb3IgaWQgPSAleClcbiIsIGlkKTsKKworICAgICAgICAgICAgICAgIENTX0RCR09VVChDU19JTklUIHwgQ1NfRlVOQ1RJT04sIDIsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ayhLRVJOX0lORk8gImNzNDI5N2E6IGNzNDI5N2FfaW5pdF9tb2R1bGUoKS1cbiIpKTsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgfQorCisgZXJyX2RldjM6CisJdW5yZWdpc3Rlcl9zb3VuZF9taXhlcihzLT5kZXZfbWl4ZXIpOworIGVycl9kZXYyOgorCXVucmVnaXN0ZXJfc291bmRfZHNwKHMtPmRldl9hdWRpbyk7CisgZXJyX2RldjE6CisJZnJlZV9pcnEocy0+aXJxLCBzKTsKKyBlcnJfaXJxOgorCWtmcmVlKHMpOworCisgICAgICAgIHByaW50ayhLRVJOX0lORk8gImNzNDI5N2E6IGluaXRpYWxpemF0aW9uIGZhaWxlZFxuIik7CisKKyAgICAgICAgcmV0dXJuIC0xOworfQorCitzdGF0aWMgdm9pZCBfX2V4aXQgY3M0Mjk3YV9jbGVhbnVwKHZvaWQpCit7CisgICAgICAgIC8qCisgICAgICAgICAgWFhYS1cgCisgICAgICAgICAgIGRpc2FibGVfaXJxLCBmcmVlX2lycQorICAgICAgICAgICBkcmFpbiBETUEgcXVldWUKKyAgICAgICAgICAgZGlzYWJsZSBETUEKKyAgICAgICAgICAgZGlzYWJsZSBUWC9SWAorICAgICAgICAgICBmcmVlIG1lbW9yeQorICAgICAgICAqLworCUNTX0RCR09VVChDU19JTklUIHwgQ1Nf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XIoMCk7CisJCQkgICAgICB9CisJCQkJc3Bpbl91bmxvY2soJmxvY2spOworCQkgICAgfQorCSAgfQorfQorCitzdGF0aWMgdm9pZAordG1yX3Jlc2V0KHZvaWQpCit7CisJdW5zaWduZWQgbG9uZyAgIGZsYWdzOworCisJc3Bpbl9sb2NrX2lycXNhdmUoJmxvY2ssZmxhZ3MpOworCXRtcl9vZmZzID0gMDsKKwl0aWNrc19vZmZzID0gMDsKKwl0bXJfY3RyID0gMDsKKwluZXh0X2V2ZW50X3RpbWUgPSAodW5zaWduZWQgbG9uZykgLTE7CisJcHJldl9ldmVudF90aW1lID0gMDsKKwljdXJyX3RpY2tzID0gMDsKKwlzcGluX3VubG9ja19pcnFyZXN0b3JlKCZsb2NrLGZsYWdzKTsKK30KKworc3RhdGljIGludAorZGVmX3Rtcl9vcGVuKGludCBkZXYsIGludCBtb2RlKQoreworCWlmIChvcGVuZWQpCisJCXJldHVybiAtRUJVU1k7CisKKwl0bXJfcmVzZXQoKTsKKwljdXJyX3RlbXBvID0gNjA7CisJY3Vycl90aW1lYmFzZSA9IDEwMDsKKwlvcGVuZWQgPSAxOworCisJOworCisJeworCQlkZWZfdG1yLmV4cGlyZXMgPSAoMSkgKyBqaWZmaWVzOworCQlhZGRfdGltZXIoJmRlZl90bXIpOworCX07CisKKwlyZXR1cm4gMDsKK30KKworc3RhdGljIHZvaWQKK2RlZl90bXJfY2xvc2UoaW50IGRldikKK3sKKwlvcGVuZWQgPSB0bXJfcnVubmluZyA9IDA7CisJZGVsX3RpbWVyKCZkZWZfdG1yKTsKK30KKworc3RhdGljIGludAorZGVmX3Rtcl9ldmVudChpbnQgZGV2LCB1bnNpZ25lZCBjaGFyICpldmVudCkKK3sKKwl1bnNpZ25lZCBjaGFyICAgY21kID0gZXZlbnRbMV07CisJdW5zaWduZWQgbG9uZyAgIHBhcm0gPSAqKGludCAqKSAmZXZlbnRbNF07CisKKwlzd2l0Y2ggKGNtZCkKKwkgIHsKKwkgIGNhc2UgVE1SX1dBSVRfUkVMOgorCQkgIHBhcm0gKz0gcHJldl9ldmVudF90aW1lOworCSAgY2FzZSBUTVJfV0FJVF9BQlM6CisJCSAgaWYgKHBhcm0gPiAwKQorCQkgICAgeworCQkJICAgIGxvbmcgICAgICAgICAgICB0aW1lOworCisJCQkgICAgaWYgKHBhcm0gPD0gY3Vycl90aWNrcykJLyogSXQncyB0aGUgdGltZSAqLworCQkJCSAgICByZXR1cm4gVElNRVJfTk9UX0FSTUVEOworCisJCQkgICAgdGltZSA9IHBhcm07CisJCQkgICAgbmV4dF9ldmVudF90aW1lID0gcHJldl9ldmVudF90aW1lID0gdGltZTsKKworCQkJICAgIHJldHVybiBUSU1FUl9BUk1FRDsKKwkJICAgIH0KKwkJICBicmVhazsKKworCSAgY2FzZSBUTVJfU1RBUlQ6CisJCSAgdG1yX3Jlc2V0KCk7CisJCSAgdG1yX3J1bm5pbmcgPSAxOworCQkgIGJyZWFrOworCisJICBjYXNlIFRNUl9TVE9QOgorCQkgIHRtcl9ydW5uaW5nID0gMDsKKwkJICBicmVhazsKKworCSAgY2FzZSBUTVJfQ09OVElOVUU6CisJCSAgdG1yX3J1bm5pbmcgPSAxOworCQkgIGJyZWFrOworCisJICBjYXNlIFRNUl9URU1QTzoKKwkJICBpZiAocGFybSkKKwkJICAgIHsKKwkJCSAgICBpZiAocGFybSA8IDgpCisJCQkJICAgIHBhcm0gPSA4OworCQkJICAgIGlmIChwYXJtID4gMzYwKQorCQkJCSAgICBwYXJtID0gMzYwOworCQkJICAgIHRtcl9vZmZzID0gdG1yX2N0cjsKKwkJCSAgICB0aWNrc19vZmZzICs9IHRtcjJ0aWNrcyh0bXJfY3RyKTsKKwkJCSAgICB0bXJfY3RyID0gMDsKKwkJCSAgICBjdXJyX3RlbXBvID0gcGFybTsKKwkJICAgIH0KKwkJICBicmVhazsKKworCSAgY2FzZSBUTVJfRUNITzoKKwkJICBzZXFfY29weV90b19pbnB1dChldmVudCwgOCk7CisJCSAgYnJlYWs7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sID0gaW5iKFRSSURfUkVHKGNhcmQsIEFMSV9TUERJRl9DVFJMICsgMSkpOworCWJ2YWwgfD0gMHgxRjsKKwlvdXRiKGJ2YWwsIFRSSURfUkVHKGNhcmQsIEFMSV9TUERJRl9DVFJMICsgMSkpOworCisJd2hpbGUgKCgoUjEgPCAweDBCKSB8fCAoUjEgPiAweDBFKSkgJiYgKFIxICE9IDB4MTIpICYmIAorCSAgICAgICBjb3VudCA8PSA1MDAwMCkgeworCQljb3VudCsrOworCisJCWFsaV9kZWxheShjYXJkLCA2KTsKKworCQlidmFsID0gaW5iKFRSSURfUkVHKGNhcmQsIEFMSV9TUERJRl9DVFJMICsgMSkpOworCQlSMSA9IGJ2YWwgJiAweDFGOworCX0KKworCWlmIChjb3VudCA+IDUwMDAwKSB7CisJCXByaW50ayhLRVJOX1dBUk5JTkcgInRyaWRlbnQ6IEVycm9yIGluICIKKwkJICAgICAgICJhbGlfZGV0ZWN0X3NwZGlmX3JhdGUhXG4iKTsKKwkJcmV0dXJuOworCX0KKworCWNvdW50ID0gMDsKKworCXdoaWxlIChjb3VudCA8PSA1MDAwMCkgeworCQljb3VudCsrOworCisJCWFsaV9kZWxheShjYXJkLCA2KTsKKworCQlidmFsID0gaW5iKFRSSURfUkVHKGNhcmQsIEFMSV9TUERJRl9DVFJMICsgMSkpOworCQlSMiA9IGJ2YWwgJiAweDFGOworCisJCWlmIChSMiAhPSBSMSkKKwkJCVIxID0gUjI7CisJCWVsc2UKKwkJCWJyZWFrOworCX0KKworCWlmIChjb3VudCA+IDUwMDAwKSB7CisJCXByaW50ayhLRVJOX1dBUk5JTkcgInRyaWRlbnQ6IEVycm9yIGluICIKKwkJICAgICAgICJhbGlfZGV0ZWN0X3NwZGlmX3JhdGUhXG4iKTsKKwkJcmV0dXJuOworCX0KKworCXN3aXRjaCAoUjIpIHsKKwljYXNlIDB4MGI6CisJY2FzZSAweDBjOgorCWNhc2UgMHgwZDoKKwljYXNlIDB4MGU6CisJCXd2YWwgPS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3RhcnQgKi8KKworCS8qCisJICAgKiAgV3JpdGUgdGhlIGJvb3QgY29kZSB0byB0aGUgUkFNIHVwbG9hZC9kb3dubG9hZCByZWdpc3Rlci4KKwkgICAqICBFYWNoIHdyaXRlIGluY3JlbWVudHMgdGhlIGludGVybmFsIGRhdGEgcG9pbnRlci4KKwkgKi8KKwlvdXRiKCgweDAxKSwgYmFzZSArIDYpOwkvKiBDbGVhciB0aGUgaW50ZXJuYWwgZGF0YSBwb2ludGVyICovCisJb3V0YigoMHgxQSksIDB4MzkwKTsJLyogU2VsZWN0IFJBTSBkb3dubG9hZC91cGxvYWQgcG9ydCAqLworCisJZm9yIChpID0gMDsgaSA8IG47IGkrKykKKwkJb3V0YigodHJpeF9ib290W2ldKSwgMHgzOTEpOworCWZvciAoaSA9IG47IGkgPCAxMDAxNjsgaSsrKQkvKiBDbGVhciB1cCB0byBmaXJzdCAxNiBieXRlcyBvZiBkYXRhIFJBTSAqLworCQlvdXRiKCgweDAwKSwgMHgzOTEpOworCW91dGIoKDB4MDApLCBiYXNlICsgNik7CS8qIFJlc2V0ICovCisJb3V0YigoMHg1MCksIDB4MzkwKTsJLyogPz8/Pz8/ICovCisKK30KKworc3RhdGljIGludCB0cml4X3NldF93c3NfcG9ydChzdHJ1Y3QgYWRkcmVzc19pbmZvICpod19jb25maWcpCit7CisJdW5zaWduZWQgY2hhciAgIGFkZHJfYml0czsKKworCWlmICh0cml4X3JlYWQoMHgxNSkgIT0gMHg3MSkJLyogTm8gQVNJQyBzaWduYXR1cmUgKi8KKwl7CisJCU1EQihwcmludGsoS0VSTl9FUlIgIk5vIEF1ZGlvVHJpeCBBU0lDIHNpZ25hdHVyZSBmb3VuZFxuIikpOworCQlyZXR1cm4gMDsKKwl9CisKKwkvKgorCSAqIFJlc2V0IHNvbWUgcmVnaXN0ZXJzLgorCSAqLworCisJdHJpeF93cml0ZSgweDEzLCAwKTsKKwl0cml4X3dyaXRlKDB4MTQsIDApOworCisJLyoKKwkgKiBDb25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IFBybyI7CisJcmV0dXJuIHByb2JlX3VhcnQ0MDEoaHdfY29uZmlnLCBUSElTX01PRFVMRSk7Cit9CisKK3N0YXRpYyB2b2lkIF9fZXhpdCB1bmxvYWRfdHJpeF93c3Moc3RydWN0IGFkZHJlc3NfaW5mbyAqaHdfY29uZmlnKQoreworCWludCBkbWEyID0gaHdfY29uZmlnLT5kbWEyOworCisJaWYgKGRtYTIgPT0gLTEpCisJCWRtYTIgPSBod19jb25maWctPmRtYTsKKworCXJlbGVhc2VfcmVnaW9uKDB4MzkwLCAyKTsKKwlyZWxlYXNlX3JlZ2lvbihod19jb25maWctPmlvX2Jhc2UsIDQpOworCisJYWQxODQ4X3VubG9hZChod19jb25maWctPmlvX2Jhc2UgKyA0LAorCQkgICAgICBod19jb25maWctPmlycSwKKwkJICAgICAgaHdfY29uZmlnLT5kbWEsCisJCSAgICAgIGRtYTIsCisJCSAgICAgIDApOworCXNvdW5kX3VubG9hZF9hdWRpb2Rldihod19jb25maWctPnNsb3RzWzBdKTsKK30KKworc3RhdGljIGlubGluZSB2b2lkIF9fZXhpdCB1bmxvYWRfdHJpeF9tcHUoc3RydWN0IGFkZHJlc3NfaW5mbyAqaHdfY29uZmlnKQoreworCXVubG9hZF91YXJ0NDAxKGh3X2NvbmZpZyk7Cit9CisKK3N0YXRpYyBpbmxpbmUgdm9pZCBfX2V4aXQgdW5sb2FkX3RyaXhfc2Ioc3RydWN0IGFkZHJlc3NfaW5mbyAqaHdfY29uZmlnKQoreworCXNiX2RzcF91bmxvYWQoaHdfY29uZmlnLCBtcHUpOworfQorCitzdGF0aWMgc3RydWN0IGFkZHJlc3NfaW5mbyBjZmc7CitzdGF0aWMgc3RydWN0IGFkZHJlc3NfaW5mbyBjZmcyOworc3RhdGljIHN0cnVjdCBhZGRyZXNzX2luZm8gY2ZnX21wdTsKKworc3RhdGljIGludCBzYjsKK3N0YXRpYyBpbnQgZndfbG9hZDsKKworc3RhdGljIGludCBfX2luaXRkYXRhIGlvCT0g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oYXJkd2FyZSBkZXRlY3RlZC5cbiIpKTsKKworCWlmIChvaykKKwkJdWFydDQwMV9pbnB1dF9sb29wKGRldmMpOwkvKgorCQkJCQkJICogRmx1c2ggaW5wdXQgYmVmb3JlIGVuYWJsaW5nIGludGVycnVwdHMKKwkJCQkJCSAqLworCisJcmV0dXJuIG9rOworfQorCitpbnQgcHJvYmVfdWFydDQwMShzdHJ1Y3QgYWRkcmVzc19pbmZvICpod19jb25maWcsIHN0cnVjdCBtb2R1bGUgKm93bmVyKQoreworCXVhcnQ0MDFfZGV2YyAqZGV2YzsKKwljaGFyICpuYW1lID0gIk1QVS00MDEgKFVBUlQpIE1JREkiOworCWludCBvayA9IDA7CisJdW5zaWduZWQgbG9uZyBmbGFnczsKKworCUREQihwcmludGsoIkVudGVyZWQgcHJvYmVfdWFydDQwMSgpXG4iKSk7CisKKwkvKiBEZWZhdWx0IHRvICJub3QgZm91bmQiICovCisJaHdfY29uZmlnLT5zbG90c1s0XSA9IC0xOworCisJaWYgKCFyZXF1ZXN0X3JlZ2lvbihod19jb25maWctPmlvX2Jhc2UsIDQsICJNUFUtNDAxIFVBUlQiKSkgeworCQlwcmludGsoS0VSTl9JTkZPICJ1YXJ0NDAxOiBjb3VsZCBub3QgcmVxdWVzdF9yZWdpb24oJWQsIDQpXG4iLCBod19jb25maWctPmlvX2Jhc2UpOworCQlyZXR1cm4gMDsKKwl9CisKKwlkZXZjID0ga21hbGxvYyhzaXplb2YodWFydDQwMV9kZXZjKSwgR0ZQX0tFUk5FTCk7CisJaWYgKCFkZXZjKSB7CisJCXByaW50ayhLRVJOX1dBUk5JTkcgInVhcnQ0MDE6IENhbid0IGFsbG9jYXRlIG1lbW9yeVxuIik7CisJCWdvdG8gY2xlYW51cF9yZWdpb247CisJfQorCisJZGV2Yy0+YmFzZSA9IGh3X2NvbmZpZy0+aW9fYmFzZTsKKwlkZXZjLT5pcnEgPSBod19jb25maWctPmlycTsKKwlkZXZjLT5vc3AgPSBod19jb25maWctP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aWwoKSAmJiBjb3VudCkKKwkJCQljb3VudC0tOworCQl9CisJfQorfQorCitzdGF0aWMgaXJxcmV0dXJuX3QgbTY4NTBpbnRyKGludCBpcnEsIHZvaWQgKmRldl9pZCwgc3RydWN0IHB0X3JlZ3MgKmR1bW15KQoreworCWlmIChpbnB1dF9hdmFpbCgpKQorCQl1YXJ0Njg1MF9pbnB1dF9sb29wKCk7CisJcmV0dXJuIElSUV9IQU5ETEVEOworfQorCisvKgorICoJSXQgbG9va3MgbGlrZSB0aGVyZSBpcyBubyBpbnB1dCBpbnRlcnJ1cHRzIGluIHRoZSBVQVJUIG1vZGUuIExldCdzIHRyeQorICoJcG9sbGluZy4KKyAqLworCitzdGF0aWMgdm9pZCBwb2xsX3VhcnQ2ODUwKHVuc2lnbmVkIGxvbmcgZHVtbXkpCit7CisJdW5zaWduZWQgbG9uZyBmbGFnczsKKworCWlmICghKHVhcnQ2ODUwX29wZW5lZCAmIE9QRU5fUkVBRCkpCisJCXJldHVybjsJCS8qIERldmljZSBoYXMgYmVlbiBjbG9zZWQgKi8KKworCXNwaW5fbG9ja19pcnFzYXZlKCZsb2NrLGZsYWdzKTsKKwlpZiAoaW5wdXRfYXZhaWwoKSkKKwkJdWFydDY4NTBfaW5wdXRfbG9vcCgpOworCisJdWFydDY4NTBfdGltZXIuZXhwaXJlcyA9IDEgKyBqaWZmaWVzOworCWFkZF90aW1lcigmdWFydDY4NTBfdGltZXIpOworCQorCS8qCisJICoJQ29tZSBiYWNrIGxhdGVyCisJICovCisKKwlzcGluX3VubG9ja19pcnFyZXN0b3JlKCZsb2NrLGZsYWdzKTsKK30KKworc3RhdGljIGludCB1YXJ0Njg1MF9vcGVuKGludCBkZXYsIGludCBtb2RlLAorCSAgICAgIHZvaWQgICAgICAgICAgICAoKmlucHV0KSAoaW50IGRldiwgdW5zaWduZWQgY2hhciBkYXRhKSwKKwkgICAgICB2b2lkICAgICAgICAgICAgKCpvdXRwdXQpIChpbnQgZGV2KQorKQoreworCWl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9ybWFsbHkgaXQgdGFrZXMganVzdCBhYm91dCAxMCBsb29wcy4KKwkgKi8KKworCWZvciAodGltZW91dCA9IDMwMDAwOyB0aW1lb3V0ID4gMCAmJiAhb3V0cHV0X3JlYWR5KCk7IHRpbWVvdXQtLSk7CS8qCisJCQkJCQkJCQkJICogV2FpdAorCQkJCQkJCQkJCSAqLworCWlmICghb3V0cHV0X3JlYWR5KCkpCisJeworCQlwcmludGsoS0VSTl9XQVJOSU5HICJNaWRpNjg1MDogVGltZW91dFxuIik7CisJCXJldHVybiAwOworCX0KKwl1YXJ0Njg1MF93cml0ZShtaWRpX2J5dGUpOworCXJldHVybiAxOworfQorCitzdGF0aWMgaW5saW5lIGludCB1YXJ0Njg1MF9jb21tYW5kKGludCBkZXYsIHVuc2lnbmVkIGNoYXIgKm1pZGlfYnl0ZSkKK3sKKwlyZXR1cm4gMTsKK30KKworc3RhdGljIGlubGluZSBpbnQgdWFydDY4NTBfc3RhcnRfcmVhZChpbnQgZGV2KQoreworCXJldHVybiAwOworfQorCitzdGF0aWMgaW5saW5lIGludCB1YXJ0Njg1MF9lbmRfcmVhZChpbnQgZGV2KQoreworCXJldHVybiAwOworfQorCitzdGF0aWMgaW5saW5lIHZvaWQgdWFydDY4NTBfa2ljayhpbnQgZGV2KQoreworfQorCitzdGF0aWMgaW5saW5lIGludCB1YXJ0Njg1MF9idWZmZXJfc3RhdHVzKGludCBkZXYpCit7CisJcmV0dXJuIDA7CQkvKgorCQkJCSAqIE5vIGRhdGEgaW4gYnVmZmVycworCQkJCSAqLworfQorCisjZGVmaW5lIE1JRElfU1lOVEhfTkFNRQkiNjg1MCBVQVJUIE1pZGkiCisjZGVmaW5lIE1JRElfU1lOVEhfQ0FQUwlTWU5USF9DQVBfSU5QVVQKKyNpbmNsdWRlICJtaWRpX3N5bnRoLmgiCisKK3N0YXRpYyBzdHJ1Y3QgbWlkaV9vcGVyYXRpb25zIHVhcnQ2ODUwX29wZXJhdGlvbnMgPQoreworCS5vd25l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yogaW8sIGlycSAqLworCWludCBpbnRzWzNdOworCQorCXN0ciA9IGdldF9vcHRpb25zKHN0ciwgQVJSQVlfU0laRShpbnRzKSwgaW50cyk7CisJCisJaW8gPSBpbnRzWzFdOworCWlycSA9IGludHNbMl07CisKKwlyZXR1cm4gMTsKK30KK19fc2V0dXAoInVhcnQ2ODUwPSIsIHNldHVwX3VhcnQ2ODUwKTsKKyNlbmRpZgorTU9EVUxFX0xJQ0VOU0UoIkdQTCIpOwpkaWZmIC0tZ2l0IGEvc291bmQvb3NzL3VsYXcuaCBiL3NvdW5kL29zcy91bGF3LmgKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMGZmOGMwYQotLS0gL2Rldi9udWxsCisrKyBiL3NvdW5kL29zcy91bGF3LmgKQEAgLTAsMCArMSw2OSBAQAorc3RhdGljIHVuc2lnbmVkIGNoYXIgdWxhd19kc3BbXSA9IHsKKyAgICAgMywgICAgNywgICAxMSwgICAxNSwgICAxOSwgICAyMywgICAyNywgICAzMSwKKyAgICAzNSwgICAzOSwgICA0MywgICA0NywgICA1MSwgICA1NSwgICA1OSwgICA2MywKKyAgICA2NiwgICA2OCwgICA3MCwgICA3MiwgICA3NCwgICA3NiwgICA3OCwgICA4MCwKKyAgICA4MiwgICA4NCwgICA4NiwgICA4OCwgICA5MCwgICA5MiwgICA5NCwgICA5NiwKKyAgICA5OCwgICA5OSwgIDEwMCwgIDEwMSwgIDEwMiwgIDEwMywgIDEwNCwgIDEwNSwKKyAgIDEwNiwgIDEwNywgIDEwOCwgIDEwOSwgIDExMCwgIDExMSwgIDExMiwgIDExMywKKyAgIDExMywgIDExNCwgIDExNCwgIDExNSwgIDExNSwgIDExNiwgIDExNiwgIDExNywKKyAgIDExNywgIDExOCwgIDExOCwgIDExOSwgIDExOSwgIDEyMCwgIDEyMCwgIDEyMSwKKyAgIDEyMSwgIDEyMSwgIDEyMiwgIDEyMiwgIDEyMiwgIDEyMiwgIDEyMywgIDEy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AgMTUsCisgICAgMTUsICAgMTYsICAgMTYsICAgMTcsICAgMTcsICAgMTgsICAgMTgsICAgMTksCisgICAgMTksICAgMjAsICAgMjAsICAgMjEsICAgMjEsICAgMjIsICAgMjIsICAgMjMsCisgICAgMjMsICAgMjQsICAgMjQsICAgMjUsICAgMjUsICAgMjYsICAgMjYsICAgMjcsCisgICAgMjcsICAgMjgsICAgMjgsICAgMjksICAgMjksICAgMzAsICAgMzAsICAgMzEsCisgICAgMzEsICAgMzIsICAgMzMsICAgMzQsICAgMzUsICAgMzYsICAgMzcsICAgMzgsCisgICAgMzksICAgNDAsICAgNDEsICAgNDIsICAgNDMsICAgNDQsICAgNDUsICAgNDYsCisgICAgNDcsICAgNDksICAgNTEsICAgNTMsICAgNTUsICAgNTcsICAgNTksICAgNjEsCisgICAgNjMsICAgNjYsICAgNzAsICAgNzQsICAgNzgsICAgODQsICAgOTIsICAxMDQsCisgICAyNTQsICAyMzEsICAyMTksICAyMTEsICAyMDUsICAyMDEsICAxOTcsICAxOTMsCisgICAxOTAsICAxODgsICAxODYsICAxODQsICAxODIsICAxODAsICAxNzgsICAxNzYsCisgICAxNzUsICAxNzQsICAxNzMsICAxNzIsICAxNzEsICAxNzAsICAxNjksICAxNjgsCisgICAxNjcsICAxNjYsICAxNjUsICAxNjQsICAxNjMsICAxNjIsICAxNjEsICAxNjAsCisgICAxNTksICAxNTksICAxNTgsICAxNTgsICAxNTcsICAxNTcsICAxNTYsICAxNTYsCisgICAxNTUsICAxNTUsICAxNTQsICAxNTQsICAxNTMsICAxNTMsICAxNTIsICAxNTIsCisgICAxNTEsICAxNTEsICAxNTAsICAxNTAsICAxNDksICAxNDksICAxNDgsICAxNDgsCisgICAxNDcsICAxNDcsICAxNDYsICAxNDYsICAxNDUsICAxNDUsICAxNDQsICAxNDQsCisgICAxNDMsICAxNDMsICAxNDMsICAxNDMsICAxNDIsICAxNDIsICAxNDIsICAxNDIsCisgICAxNDEsICAxNDEsICAxNDEsICAxNDEsICAxNDAsICAxNDAsICAxNDAsICAxNDAsCisgICAxMzksICAxMzksICAxMzksICAxMzksICAxMzgsICAxMzgsICAxMzgsICAxMzgsCisgICAxMzcsICAxMzcsICAxMzcsICAxMzcsICAxMzYsICAxMzYsICAxMzYsICAxMzYsCisgICAxMzUsICAxMzUsICAxMzUsICAxMzUsICAxMzQsICAxMzQsICAxMzQsICAxMzQsCisgICAxMzMsICAxMzMsICAxMzMsICAxMzMsICAxMzIsICAxMzIsICAxMzIsICAxMzIsCisgICAxMzEsICAxMzEsICAxMzEsICAxMzEsICAxMzAsICAxMzAsICAxMzAsICAxMzAsCisgICAxMjksICAxMjksICAxMjksICAxMjksICAxMjgsICAxMjgsICAxMjgsICAxMjgsCit9OwpkaWZmIC0tZ2l0IGEvc291bmQvb3NzL3ZfbWlkaS5jIGIvc291bmQvb3NzL3ZfbWlkaS5jCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjA3N2I3NjcKLS0tIC9kZXYvbnVsbAorKysgYi9zb3VuZC9vc3Mvdl9taWRpLmMKQEAgLTAsMCArMSwyOTEgQEAKKy8qCisgKiBzb3VuZC92X21pZGkuYworICoKKyAqIFRoZSBsb3cgbGV2ZWwgZHJpdmVyIGZvciB0aGUgU291bmQgQmxhc3RlciBEUyBjaGlwcy4KKyAqCisgKgorICogQ29weXJpZ2h0IChDKSBieSBIYW5udSBTYXZvbGFpbmVuIDE5OTMtMTk5NgorICoKKyAqIFVTUy9MaXRlIGZvciBMaW51eCBpcyBkaXN0cmlidXRlZCB1bmRlciB0aGUgR05VIEdFTkVSQUwgUFVCTElDIExJQ0VOU0UgKEdQTCkKKyAqIFZlcnNpb24gMiAoSnVuZSAxOTkxKS4gU2VlIHRoZSAiQ09QWUlORyIgZmlsZSBkaXN0cmlidXRlZCB3aXRoIHRoaXMgc29mdHdhcmUKKyAqIGZvciBtb3JlIGluZm8uCisgKiA/PworICoKKyAqIENoYW5nZXMKKyAqCUFsYW4gQ294CQ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ElORV9fLCAjZSkpCisjZGVmaW5lIERCR0RPKHgpICAgICAgICAgICAgeAorI2RlZmluZSBEQkdYKGZtdCwgYXJncy4uLikgIChpbl9pbnRlcnJ1cHQoKSA/IDAgOiBwcmludGsoS0VSTl9FUlIgZm10LCAjI2FyZ3MpKQorI2RlZmluZSBEQkdQKGZtdCwgYXJncy4uLikgIChEQkdYKCIlczogIiBmbXQsIF9fRlVOQ1RJT05fXyAsICMjYXJncykpCisjZGVmaW5lIERCR0UoZm10LCBhcmdzLi4uKSAgKERCR1goIiVzIiBmbXQsIF9fRlVOQ1RJT05fXyAsICMjYXJncykpCisjZGVmaW5lIERCR0MocnRuKSAgICAgICAgICAgKERCR1AoImNhbGxpbmcgJXNcbiIsIHJ0bikpCisjZGVmaW5lIERCR1IoKSAgICAgICAgICAgICAgKERCR1AoInJldHVybmluZ1xuIikpCisjZGVmaW5lIERCR1hWKGZtdCwgYXJncy4uLikgKHNodXRfdXAgPyAwIDogREJHWChmbXQsICMjYXJncykpCisjZGVmaW5lIERCR1BWKGZtdCwgYXJncy4uLikgKHNodXRfdXAgPyAwIDogREJHUChmbXQsICMjYXJncykpCisjZGVmaW5lIERCR0VWKGZtdCwgYXJncy4uLikgKHNodXRfdXAgPyAwIDogREJHRShmbXQsICMjYXJncykpCisjZGVmaW5lIERCR0NWKHJ0bikgICAgICAgICAgKHNodXRfdXAgPyAwIDogREJHQyhydG4pKQorI2RlZmluZSBEQkdSVigpICAgICAgICAgICAgIChzaHV0X3VwID8gMCA6IERCR1IoKSkKKworI2Vsc2UgLyogIVZXU05EX0RFQlVHICovCisKKyNkZWZpbmUgQVNTRVJUKGUpICAgICAgICAgICAoKHZvaWQpIDApCisjZGVmaW5lIERCR0RPKHgpICAgICAgICAgICAgLyogZG9uJ3QgKi8KKyNkZWZpbmUgREJHWChmbXQsIGFyZ3MuLi4pICAoKHZvaWQpIDApCisjZGVmaW5lIERCR1AoZm10LCBhcmdzLi4uKSAgKCh2b2lkKSAwKQorI2RlZmluZSBEQkdFKGZtdCwgYXJncy4uLikgICgodm9pZCkgMCkKKyNkZWZpbmUgREJHQyhydG4pICAgICAgICAgICAoKHZvaWQpIDApCisjZGVmaW5lIERCR1IoKSAgICAgICAgICAgICAgKCh2b2lkKSAwKQorI2RlZmluZSBEQkdQVihmbXQsIGFyZ3MuLi4pICgodm9pZCkgMCkKKyNkZWZpbmUgREJHWFYoZm10LCBhcmdzLi4uKSAoKHZvaWQpIDApCisjZGVmaW5lIERCR0VWKGZtdCwgYXJncy4uLikgKCh2b2lkKSAwKQorI2RlZmluZSBEQkdDVihydG4pICAgICAgICAgICgodm9pZCkgMCkKKyNkZWZpbmUgREJHUlYoKSAgICAgICAgICAgICAoKHZvaWQpIDApCisKKyNlbmRpZiAvKiAhVldTTkRfREVCVUcgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogbG93IGxldmVsIGxpdGhpdW0gYWNjZXNzICovCisKKy8qCisgKiBXZSBuZWVkIHRvIHRhbGsgdG8gTGl0aGl1bSByZWdpc3RlcnMgb24gdGhyZWUgcGFnZXMuICBIZXJlIGFyZQorICogdGhlIHBhZ2VzJyBvZmZzZXRzIGZyb20gdGhlIGJhc2UgYWRkcmVzcyAoMHhGRjAwMTAwMCkuCisgKi8KKworZW51bSB7CisJTElfUEFHRTBfT0ZGU0VUID0gMHgwMTAwMCAtIDB4MTAwMCwgLyogRkYwMDEwMDAgKi8KKwlMSV9QQUdFMV9PRkZTRVQgPSAweDBGMDAwIC0gMHgxMDAwLCAvKiBGRjAwRjAwMCAqLworCUxJX1BBR0UyX09GRlNFVCA9IDB4MTAwMDAgLSAweDEwMDAsIC8qIEZGMDEwMDAwICovCit9OworCisvKiBsb3ctbGV2ZWwgbGl0aGl1bSBkYXRhICovCisKK3R5cGVkZWYgc3RydWN0IGxpdGhpdW0geworCXZvaWQgKgkJcGFnZTA7CQkvKiB2a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W50IG9mZiwgdW5zaWduZWQgY2hhciB2YWwpCit7CisJKiAodm9sYXRpbGUgdW5zaWduZWQgY2hhciAqKSAobGl0aC0+cGFnZTAgKyBvZmYpID0gdmFsOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBIaWdoIExldmVsIExpdGhpdW0gQWNjZXNzICovCisKKy8qCisgKiBMaXRoaXVtIERNQSBOb3RlcworICoKKyAqIExpdGhpdW0gaGFzIHR3byBkZWRpY2F0ZWQgRE1BIGNoYW5uZWxzIGZvciBhdWRpby4gIFRoZXkgYXJlIGtub3duCisgKiBhcyBjb21tMSBhbmQgY29tbTIgKGNvbW11bmljYXRpb24gYXJlYXMgMSBhbmQgMikuICBDb21tMSBpcyBmb3IKKyAqIGlucHV0LCBhbmQgY29tbTIgaXMgZm9yIG91dHB1dC4gIEVhY2ggaXMgY29udHJvbGxlZCBieSB0aHJlZQorICogcmVnaXN0ZXJzOiBCQVNFIChiYXNlIGFkZHJlc3MpLCBDRkcgKGNvbmZpZykgYW5kIENDVEwKKyAqIChjb25maWcvY29udHJvbCkuCisgKgorICogRWFjaCBETUEgY2hhbm5lbCBwb2ludHMgdG8gYSBwaHlzaWNhbGx5IGNvbnRpZ3VvdXMgcmluZyBidWZmZXIgaW4KKyAqIG1haW4gbWVtb3J5IG9mIHVwIHRvIDggS2J5dGVzLiAgKFRoaXMgZHJpdmVyIGFsd2F5cyB1c2VzIDggS2IuKQorICogVGhlcmUgYXJlIHRocmVlIHBvaW50ZXJzIGludG8gdGhlIHJpbmcgYnVmZmVyOiByZWFkLCB3cml0ZSwgYW5kCisgKiB0cmlnZ2VyLiAgVGhlIHBvaW50ZXJzIGFyZSA4IGJpdHMgZWFjaC4gIEVhY2ggcG9pbnRlciBwb2ludHMgdG8KKyAqIDMyLWJ5dGUgImNodW5rcyIgb2YgZGF0YS4gIFRoZSBETUEgZW5naW5lI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BBRDE4NDMgaW50ZXJuYWwgY2xvY2tzIGFuZCB0aGUgZXh0ZXJuYWwgY3J5c3RhbCBvc2NpbGxhdG9yCisJICAgdG8gc3RhYmlsaXplLiAqLworCisJbGlfd3JpdGVsKGxpdGgsIExJX0hPU1RfQ09OVFJPTExFUiwgTElfSENfTElOS19FTkFCTEUpOworCXVkZWxheSgxKTsKKworCXJldHVybiAwOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBBRDE4NDMgYWNjZXNzICovCisKKy8qCisgKiBBRDE4NDMgYml0ZmllbGQgZGVmaW5pdGlvbnMuICBBbGwgYXJlIG5hbWVkIGFzIGluIHRoZSBBRDE4NDMgZGF0YQorICogc2hlZXQsIHdpdGggYWQxODQzXyBwcmVwZW5kZWQgYW5kIGluZGl2aWR1YWwgYml0IG51bWJlcnMgcmVtb3ZlZC4KKyAqCisgKiBFLmcuLCBiaXRzIExTUzAgdGhyb3VnaCBMU1MyIGJlY29tZSBhZDE4NDNfTFNTLgorICoKKyAqIE9ubHkgdGhlIGJpdGZpZWxkcyB3ZSBuZWVkIGFyZSBkZWZpbmVkLgorICovCisKK3R5cGVkZWYgc3RydWN0IGFkMTg0M19iaXRmaWVsZCB7CisJY2hhciByZWc7CisJY2hhciBsb19iaXQ7CisJY2hhciBuYml0czsKK30gYWQxODQzX2JpdGZpZWxkX3Q7CisKK3N0YXRpYyBjb25zdCBhZDE4NDNfYml0ZmllbGRfdAorCWFkMTg0M19QRE5PICAgPSB7ICAwLCAxNCwgIDEgfSwJLyogQ29udmVydGVyIFBvd2VyLURvd24gRmxhZyAqLworCWFkMTg0M19JTklUICAgPSB7ICAwLCAxNSwgIDEgfSwJLyogQ2xvY2sgSW5pdGlhbGl6YXRpb24gRmxhZyAqLworCWFkMTg0M19SSUcgICAgPSB7ICAyLCAgMCwgIDQgfSwJLyogUmlnaHQgQURDIElucHV0IE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U5EX01BU0tfTElORSB8CisJCQkgICBTT1VORF9NQVNLX01JQyB8IFNPVU5EX01BU0tfQ0QpKTsKKwlhZDE4NDNfd3JpdGVfbXVsdGkobGl0aCwgMiwgJmFkMTg0M19MREExQU0sIDAsICZhZDE4NDNfUkRBMUFNLCAwKTsKKworCS8qIFNldCBkZWZhdWx0IHJlY29yZGluZyBzb3VyY2UgdG8gTGluZSBJbiBhbmQgc2V0CisJICogbWljIGdhaW4gdG8gKzIwIGRCLgorCSAqLworCisJYWQxODQzX3NldF9yZWNzcmMobGl0aCwgU09VTkRfTUFTS19MSU5FKTsKKwlhZDE4NDNfd3JpdGVfbXVsdGkobGl0aCwgMiwgJmFkMTg0M19MTUdFLCAxLCAmYWQxODQzX1JNR0UsIDEpOworCisJLyogU2V0IFNwZWFrZXIgT3V0IGxldmVsIHRvICsvLSA0ViBhbmQgdW5tdXRlIGl0LiAqLworCisJYWQxODQzX3dyaXRlX211bHRpKGxpdGgsIDIsICZhZDE4NDNfSFBPUywgMSwgJmFkMTg0M19IUE9NLCAwKTsKKworCXJldHVybiAwOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBQQ00gSS9PICovCisKKyNkZWZpbmUgUkVBRF9JTlRSX01BU0sgIChMSV9JTlRSX0NPTU0xX1RSSUcgfCBMSV9JTlRSX0NPTU0xX09WRVJGTE9XKQorI2RlZmluZSBXUklURV9JTlRSX01BU0sgKExJX0lOVFJfQ09NTTJfVFJJRyB8IExJX0lOVFJfQ09NTTJfVU5ERVJGTE9XKQorCit0eXBlZGVmIGVudW0gdndzbmRfcG9ydF9zd3N0YXRlIHsJLyogc29mdHdhcmUgc3RhdGUgKi8KKwlTV19PRkYsCisJU1dfSU5JVElBTCwKKwlTV19SVU4sCisJU1dfRFJBSU4sCit9IHZ3c25kX3BvcnRfc3dzdGF0ZV90OworCit0eXBlZGVmIGVudW0gdnd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wkubGxzZWVrID0Jbm9fbGxzZWVrLAorCS5pb2N0bCA9CXZ3c25kX21peGVyX2lvY3RsLAorCS5vcGVuID0JCXZ3c25kX21peGVyX29wZW4sCisJLnJlbGVhc2UgPQl2d3NuZF9taXhlcl9yZWxlYXNlLAorfTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogcHJvYmUvYXR0YWNoL3VubG9hZCAqLworCisvKiBkcml2ZXIgcHJvYmUgcm91dGluZS4gIFJldHVybiBub256ZXJvIGlmIGhhcmR3YXJlIGlzIGZvdW5kLiAqLworCitzdGF0aWMgaW50IF9faW5pdCBwcm9iZV92d3NuZChzdHJ1Y3QgYWRkcmVzc19pbmZvICpod19jb25maWcpCit7CisJbGl0aGl1bV90IGxpdGg7CisJaW50IHc7CisJdW5zaWduZWQgbG9uZyBsYXRlcjsKKworCURCR0VWKCIoaHdfY29uZmlnPTB4JXApXG4iLCBod19jb25maWcpOworCisJLyogWFhYIHZlcmlmeSBsaXRoaXVtIHByZXNlbnQgKHRvIHByZXZlbnQgY3Jhc2ggb24gbm9uLXZ3KSAqLworCisJaWYgKGxpX2NyZWF0ZSgmbGl0aCwgaHdfY29uZmlnLT5pb19iYXNlKSAhPSAwKSB7CisJCXByaW50ayhLRVJOX1dBUk5JTkcgInByb2JlX3Z3c25kOiBjYW4ndCBtYXAgbGl0aGl1bVxuIik7CisJCXJldHVybiAwOworCX0KKwlsYXRlciA9IGppZmZpZXMgKyAyOworCWxpX3dyaXRlbCgmbGl0aCwgTElfSE9TVF9DT05UUk9MTEVSLCBMSV9IQ19MSU5LX0VOQUJMRSk7CisJZG8geworCQl3ID0gbGlfcmVhZGwoJmxpdGgsIExJX0hPU1RfQ09OVFJPTExFUik7CisJfSB3aGlsZSAodyA9PSBMSV9IQ19MSU5LX0VOQUJMRSAmJiB0aW1lX2JlZm9yZShqaWZmaWVzLCBsYXRlcikpO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lICsgU1RBVFIpICYgQ01EX1dFKQorCQkJCWJyZWFrOworCisJCWlmICghY291bnQpCisJCQl0aW1lZF9vdXQgPSAxOworCQllbHNlCisJCQlvdXR3KGNtZFtpXSwgaW9fYmFzZSArIENNRFIpOworCX0KKworCWZvciAoaSA9IDA7ICF0aW1lZF9vdXQgJiYgaSA8IG5yX3Jlc3A7IGkrKykgeworCQlpbnQgY291bnQ7CisKKwkJZm9yIChjb3VudCA9IDUwMDA7IGNvdW50OyBjb3VudC0tKQorCQkJaWYgKGluYihpb19iYXNlICsgU1RBVFIpICYgQ01EX1JGKQorCQkJCWJyZWFrOworCisJCWlmICghY291bnQpCisJCQl0aW1lZF9vdXQgPSAxOworCQllbHNlCisJCQlyZXNwW2ldID0gaW53KGlvX2Jhc2UgKyBDTURSKTsKKwl9CisKKwlpZiAoZGVidWdfZmxnICYgREVCVUdfQ01EKSB7CisJCWlmICghdGltZWRfb3V0KSB7CisJCQlwcmludGsoIndhdmVhcnRpc3RfY21kOiByZXNwPSIpOworCisJCQlmb3IgKGkgPSAwOyBpIDwgbnJfcmVzcDsgaSsrKQorCQkJCXByaW50aygiJTA0WCAiLCByZXNwW2ldKTsKKworCQkJcHJpbnRrKCJcbiIpOworCQl9IGVsc2UKKwkJCXByaW50aygid2F2ZWFydGlzdF9jbWQ6IHRpbWVkIG91dFxuIik7CisJfQorCisJcmV0dXJuIHRpbWVkX291dCA/IDEgOiAwOworfQorCisvKgorICogU2VuZCBvbmUgY29tbWFuZCB3b3JkCisgKi8KK3N0YXRpYyBpbmxpbmUgaW50Cit3YXZlYXJ0aXN0X2NtZDEod2F2bmNfaW5mbyAqZGV2YywgdW5zaWduZWQgaW50IGNtZCkKK3sKKwlyZXR1cm4gd2F2ZWFydGlzdF9jbWQoZGV2YywgMSwgJmNtZCwgMCwgTlVMTCk7Cit9CisKKy8qCisgKiBTZW5kIG9uZSBjb21tYW5kLCByZWNlaXZlIG9uZSB3b3JkCisgKi8KK3N0YXRpYyBpbmxpb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XRlKQorCQkJdm5jX211dGVfc3BrcihkZXZjKTsKKworCQlpZiAocHJldl9saW5lX211dGUgIT0gZGV2Yy0+bGluZV9tdXRlX3N0YXRlKQorCQkJdm5jX211dGVfbG91dChkZXZjKTsKKworCQlpZiAocHJldl9hdXRvX3N0YXRlICE9IGRldmMtPm5vX2F1dG9zZWxlY3QpCisJCQl2bmNfY29uZmlndXJlX21peGVyKGRldmMsIGRldmMtPnJlY21hc2spOworCisJCXJldHVybiAwOworCX0KKworCWNhc2UgU09VTkRfTUlYRVJfUFJJVkFURTI6CisJCWlmIChnZXRfdXNlcih2YWwsIGFyZykpCisJCQlyZXR1cm4gLUVGQVVMVDsKKworCQlzd2l0Y2ggKHZhbCkgeworI2RlZmluZSBWTkNfU09VTkRfUEFVU0UgICAgICAgICAweDUzICAgIC8vdG8gcGF1c2UgdGhlIERTUAorI2RlZmluZSBWTkNfU09VTkRfUkVTVU1FICAgICAgICAweDU3ICAgIC8vdG8gdW5wYXVzZSB0aGUgRFNQCisJCWNhc2UgVk5DX1NPVU5EX1BBVVNFOgorCQkJd2F2ZWFydGlzdF9jbWQxKGRldmMsIDB4MTYpOworCQkJYnJlYWs7CisKKwkJY2FzZSBWTkNfU09VTkRfUkVTVU1FOgorCQkJd2F2ZWFydGlzdF9jbWQxKGRldmMsIDB4MTgpOworCQkJYnJlYWs7CisKKwkJZGVmYXVsdDoKKwkJCXJldHVybiAtRUlOVkFMOworCQl9CisJCXJldHVybiAwOworCisJLyogcHJpdmF0ZSBpb2N0bCB0byBhbGxvdyBidWxrIGFjY2VzcyB0byB3YXZlYXJ0aXN0ICovCisJY2FzZSBTT1VORF9NSVhFUl9QUklWQVRFMzoKKwl7CisJCXVuc2lnbmVkIGxvbmcJZmxhZ3M7CisJCWludAkJbWl4ZXJfcmVnWzE1XSwgaSwgdmFsOworCisJCWlmIChnZXRfdXNlcih2YWwsIGFyZykpCisJCQlyZXR1cm4gLUVGQVVMVDsKKwkJaWYgKGNvcHlfZnJvbV91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wICAgICAgICAgICBiYXNlICsgOCAKKyNkZWZpbmUgZnhfbGNyICAgICAgICAgIGJhc2UgKyA5IAorI2RlZmluZSBmeF9kc3BfYWRkciAgICAgYmFzZSArIDB4YQorI2RlZmluZSBmeF9kc3BfcGFnZSAgICAgYmFzZSArIDB4YiAKKyNkZWZpbmUgZnhfZHNwX2xzYiAgICAgIGJhc2UgKyAweGMgCisjZGVmaW5lIGZ4X2RzcF9tc2IgICAgICBiYXNlICsgMHhkIAorI2RlZmluZSBmeF9tb2RfYWRkciAgICAgYmFzZSArIDB4ZQorI2RlZmluZSBmeF9tb2RfZGF0YSAgICAgYmFzZSArIDB4ZiAKKworCXZvbGF0aWxlIGludCBpcnFfb2s7ICAgICAgICAgICAgICAgLyogc2V0IGJ5IGludGVycnVwdCBoYW5kbGVyICovCisgICAgICAgIHZvbGF0aWxlIGludCBpcnFfY250OyAgICAgICAgICAgICAgLyogZGl0dG8gKi8KKwlpbnQgb3BlbmVkOyAgICAgICAgICAgICAgICAgICAgICAgIC8qIGZsYWcsIGhvbGRzIG9wZW4oMikgbW9kZSAqLworCWNoYXIgZGVidWc7ICAgICAgICAgICAgICAgICAgICAgICAgLyogZGVidWdnaW5nIGZsYWdzICovCisJaW50IGZyZWVtZW07ICAgICAgICAgICAgICAgICAgICAgICAvKiBpbnN0YWxsZWQgUkFNLCBpbiBieXRlcyAqLyAKKworCWludCBzeW50aF9kZXY7ICAgICAgICAgICAgICAgICAgICAgLyogZGV2bm8gZm9yICJyYXciIHN5bnRoICovCisJaW50IG1pZGlkZXY7ICAgICAgICAgICAgICAgICAgICAgICAvKiBkZXZubyBmb3IgaW50ZXJuYWwgTUlESSAqLworCWludCBleHRfbWlkaWRldjsgICAgICAgICAgICAgICAgICAgLyogZGV2bm8gZm9yIGV4dGVybmFsIE1JREkgKi8gCisgICAgICAgIGludCBmeF9taWRpZGV2OyAgICAgICAgICAgICAgICAgICAgLyogZGV2bm8gZm9yIEZYIE1JREkgaW50ZXJmYWNlICov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C8qIHNvbWV0aGluZyB1bmtub3duICovCisKKwkJCQlpZiAoYWNrID09IDB4ZmYpIHsgLyogZXhwbGljaXQgZXJyb3IgKi8KKwkJICAgIAorCQkJCQlpZiAoKGVyciA9IHdhdmVmcm9udF9yZWFkICgpKSA9PSAtMSkgeworCQkJCQkJRFBSSU5UIChXRl9ERUJVR19EQVRBLAorCQkJCQkJCSJjYW5ub3QgcmVhZCBlcnIgIgorCQkJCQkJCSJmb3IgMHgleCBbJXNdLlxuIiwKKwkJCQkJCQljbWQsIHdmY21kLT5hY3Rpb24pOworCQkJCQl9CisJCQkJfQorCQkJCQorCQkJCURQUklOVCAoV0ZfREVCVUdfSU8sICIweCV4IFslc10gIgorCQkJCQkiZmFpbGVkICgweCV4LCAweCV4LCAlcylcbiIsCisJCQkJCWNtZCwgd2ZjbWQtPmFjdGlvbiwgYWNrLCBlcnIsCisJCQkJCXdhdmVmcm9udF9lcnJvcnN0ciAoZXJyKSk7CisJCQkJCisJCQkJcmV0dXJuIC1lcnI7CisJCQl9CisJCX0KKwkJCisJCURQUklOVCAoV0ZfREVCVUdfREFUQSwgImFjayByZWNlaXZlZCAiCisJCQkJCSJmb3IgMHgleCBbJXNdXG4iLAorCQkJCQljbWQsIHdmY21kLT5hY3Rpb24pOworCX0gZWxzZSB7CisKKwkJRFBSSU5UIChXRl9ERUJVR19DTUQsICIweCV4IFslc10gZG9lcyBub3QgbmVlZCAiCisJCQkJICAgICAgICJBQ0sgKCVkLCVkLCVkKVxuIiwKKwkJCQkgICAgICAgY21kLCB3ZmNtZC0+YWN0aW9uLCB3ZmNtZC0+cmVhZF9jbnQsCisJCQkJICAgICAgIHdmY21kLT53cml0ZV9jbnQsIHdmY21kLT5uZWVkX2Fjayk7CisJfQorCisJcmV0dXJuIDA7CisJCit9CisMCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKK1dhdmVGcm9udDogZGF0YSBtdW5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yAgICAKKwllbmQgPSBzcmMgKyBzcmNfYnl0ZXM7CisKKwkvKiBOT1RFOiBzcmMgYW5kIGRzdCAqQ0FOKiBwb2ludCB0byB0aGUgc2FtZSBhZGRyZXNzICovCisKKwlmb3IgKGkgPSAwOyBzcmMgIT0gZW5kOyBpKyspIHsKKwkJZHN0W2ldID0gKnNyYysrOworCQlkc3RbaV0gfD0gKCpzcmMrKyk8PDc7CisJfQorCisJcmV0dXJuIGRzdDsKK30KKwwKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorV2F2ZUZyb250OiBzYW1wbGUsIHBhdGNoIGFuZCBwcm9ncmFtIG1hbmFnZW1lbnQuCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworc3RhdGljIGludAord2F2ZWZyb250X2RlbGV0ZV9zYW1wbGUgKGludCBzYW1wbGVfbnVtKQorCit7CisJdW5zaWduZWQgY2hhciB3YnVmWzJdOworCWludCB4OworCisJd2J1ZlswXSA9IHNhbXBsZV9udW0gJiAweDdmOworCXdidWZbMV0gPSBzYW1wbGVfbnVtID4+IDc7CisKKwlpZiAoKHggPSB3YXZlZnJvbnRfY21kIChXRkNfREVMRVRFX1NBTVBMRSwgTlVMTCwgd2J1ZikpID09IDApIHsKKwkJZGV2LnNhbXBsZV9zdGF0dXNbc2FtcGxlX251bV0gPSBXRl9TVF9FTVBUWTsKKwl9CisKKwlyZXR1cm4geDsKK30KKworc3RhdGljIGludAord2F2ZWZyb250X2dldF9zYW1wbGVfc3RhdHVzIChpbnQgYXNzdW1lX3JvbSkKKworeworCWludCBpOworCXVuc2lnbmVkIGNoYXIgcmJ1ZlszMl0sIHdidWZbMzJdOworCXVuc2lnbmVkIGludCAgICBzY19yZWFsLCBzY19hbGlhcywgc2NfbXVsdGk7CisKKwkvKiBjaGVjayBzYW1wbGUgc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wkJCWJyZWFrOworCisJCWNhc2UgV0ZDX1ZNSURJX09OOgorCQkJaWYgKHZpcnR1YWxfbWlkaV9lbmFibGUgKCkgPCAwKSB7CisJCQkJcmV0dXJuIC0oRUlPKTsKKwkJCX0KKwkJCWJyZWFrOworCQl9CisJfQorCisJcmV0dXJuIDA7Cit9CisKKwwKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qIFdhdmVGcm9udDogTGludXggZmlsZSBzeXN0ZW0gaW50ZXJmYWNlIChmb3IgYWNjZXNzIHZpYSByYXcgc3ludGgpICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3N0YXRpYyBpbnQgCit3YXZlZnJvbnRfb3BlbiAoc3RydWN0IGlub2RlICppbm9kZSwgc3RydWN0IGZpbGUgKmZpbGUpCit7CisJLyogWFhYIGZpeCBtZSAqLworCWRldi5vcGVuZWQgPSBmaWxlLT5mX2ZsYWdzOworCXJldHVybiAwOworfQorCitzdGF0aWMgaW50Cit3YXZlZnJvbnRfcmVsZWFzZShzdHJ1Y3QgaW5vZGUgKmlub2RlLCBzdHJ1Y3QgZmlsZSAqZmlsZSkKK3sKKwlsb2NrX2tlcm5lbCgpOworCWRldi5vcGVuZWQgPSAwOworCWRldi5kZWJ1ZyA9IDA7CisJdW5sb2NrX2tlcm5lbCgpOworCXJldHVybiAwOworfQorCitzdGF0aWMgaW50Cit3YXZlZnJvbnRfaW9jdGwoc3RydWN0IGlub2RlICppbm9kZSwgc3RydWN0IGZpbGUgKmZpbGUsCisJCXVuc2lnbmVkIGludCBjbWQsIHVuc2lnbmVkIGxvbmcgYXJnKQoreworCXdhdmVmcm9udF9jb250cm9sIHdjOworCWludCBlcnI7CisKKwlzd2l0Y2ggKGNtZCkgeworCisJY2FzZSBXRkNUTF9XRkNNRDoKKwkJaWYgKGNvcHlfZnJvbV91c2VyKCZ3YywgKHZvaWQgX191c2VyICopIGFyZywgc2l6ZW9mICh3YykpKQorCQkJcmV0dXJuIC1FRkFVTFQ7CisJCQorCQlpZiAoKGVyciA9IHdhdmVmcm9udF9zeW50aF9jb250cm9sIChjbWQsICZ3YykpID09IDApIHsKKwkJCWlmIChjb3B5X3RvX3VzZXIgKCh2b2lkIF9fdXNlciAqKSBhcmcsICZ3Yywgc2l6ZW9mICh3YykpKQorCQkJCXJldHVybiAtRUZBVUxUOworCQl9CisKKwkJcmV0dXJuIGVycjsKKwkJCisJY2FzZSBXRkNUTF9MT0FEX1NQUDoKKwkJcmV0dXJuIHdhdmVmcm9udF9sb2FkX3BhdGNoICgoY29uc3QgY2hhciBfX3VzZXIgKikgYXJnKTsKKwkJCisJZGVmYXVsdDoKKwkJcHJpbnRrIChLRVJOX1dBUk5JTkcgTE9HTkFNRSAiaW52YWxpZCBpb2N0bCAlI3hcbiIsIGNtZCk7CisJCXJldHVybiAtKEVJTlZBTCk7CisKKwl9CisJcmV0dXJuIDA7Cit9CisKK3N0YXRpYyAvKmNvbnN0Ki8gc3RydWN0IGZpbGVfb3BlcmF0aW9ucyB3YXZlZnJvbnRfZm9wcyA9IHsKKwkub3duZXIJCT0gVEhJU19NT0RVTEUsCisJLmxsc2VlawkJPSBub19sbHNlZWssCisJLmlvY3RsCQk9IHdhdmVmcm9udF9pb2N0bCwKKwkub3BlbgkJPSB3YXZlZnJvbnRfb3BlbiwKKwkucmVsZWFzZQk9IHdhdmVmcm9udF9yZWxlYXNlLAorfTsKKworDAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogV2F2ZUZyb250OiBPU1MgaW5zdGFsbGF0aW9uIGFuZCBzdXBwb3J0IGludGVyZmFjZSAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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IHJldHVybiAhZGV0ZWN0X3dhdmVmcm9udCAoaHdfY29uZmlnLT5pcnEsIGh3X2NvbmZpZy0+aW9fYmFzZSk7Cit9CisKK3N0YXRpYyB2b2lkIF9fZXhpdCB1bmxvYWRfd2F2ZWZyb250IChzdHJ1Y3QgYWRkcmVzc19pbmZvICpod19jb25maWcpIAoreworICAgICh2b2lkKSB1bmluc3RhbGxfd2F2ZWZyb250ICgpOworfQorCisjZW5kaWYgLyogT1NTX1NVUFBPUlRfU1RBVElDX0lOU1RBTEwgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogV2F2ZUZyb250OiBMaW51eCBtb2R1bGFyIHNvdW5kIGtlcm5lbCBpbnN0YWxsYXRpb24gaW50ZXJmYWNlICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgaXJxcmV0dXJuX3QKK3dhdmVmcm9udGludHIoaW50IGlycSwgdm9pZCAqZGV2X2lkLCBzdHJ1Y3QgcHRfcmVncyAqZHVtbXkpCit7CisJc3RydWN0IHdmX2NvbmZpZyAqaHcgPSBkZXZfaWQ7CisKKwkvKgorCSAgIFNvbWUgY29tbWVudHMgb24gaW50ZXJydXB0cy4gSSBhdHRlbXB0ZWQgYSB2ZXJzaW9uIG9mIHRoaXMKKwkgICBkcml2ZXIgdGhhdCB1c2VkIGludGVycnVwdHMgdGhyb3VnaG91dCB0aGUgY29kZSBpbnN0ZWFkIG9mCisJICAgZG9pbmcgYnVzeSBhbmQvb3Igc2xlZXAtd2FpdGluZy4gQWxhcywgaXQgYXBwZWFycyB0aGF0IG9uY2UKKwkgICB0aGUgTW90b3JvbGEgZmlybXdhcmUgaXMgZG93bmxvYWRlZCwgdGhlIGNhcmQgKm5ldmVyKgorCSAgIGdlbmVyYXRlcyBhbiBSWC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+aXJxX2NudCsrOworCXdha2VfdXBfaW50ZXJydXB0aWJsZSAoJmh3LT5pbnRlcnJ1cHRfc2xlZXBlcik7CisJcmV0dXJuIElSUV9IQU5ETEVEOworfQorCisvKiBTVEFUVVMgUkVHSVNURVIgCisKKzAgSG9zdCBSeCBJbnRlcnJ1cHQgRW5hYmxlICgxPUVuYWJsZWQpCisxIEhvc3QgUnggUmVnaXN0ZXIgRnVsbCAoMT1GdWxsKQorMiBIb3N0IFJ4IEludGVycnVwdCBQZW5kaW5nICgxPUludGVycnVwdCkKKzMgVW51c2VkCis0IEhvc3QgVHggSW50ZXJydXB0ICgxPUVuYWJsZWQpCis1IEhvc3QgVHggUmVnaXN0ZXIgZW1wdHkgKDE9RW1wdHkpCis2IEhvc3QgVHggSW50ZXJydXB0IFBlbmRpbmcgKDE9SW50ZXJydXB0KQorNyBVbnVzZWQKKyovCisKK3N0YXRpYyBpbnQKK3dhdmVmcm9udF9pbnRlcnJ1cHRfYml0cyAoaW50IGlycSkKKworeworCWludCBiaXRzOworCisJc3dpdGNoIChpcnEpIHsKKwljYXNlIDk6CisJCWJpdHMgPSAweDAwOworCQlicmVhazsKKwljYXNlIDU6CisJCWJpdHMgPSAweDA4OworCQlicmVhazsKKwljYXNlIDEyOgorCQliaXRzID0gMHgxMDsKKwkJYnJlYWs7CisJY2FzZSAxNToKKwkJYml0cyA9IDB4MTg7CisJCWJyZWFrOworCQorCWRlZmF1bHQ6CisJCXByaW50ayAoS0VSTl9XQVJOSU5HIExPR05BTUUgImludmFsaWQgSVJRICVkXG4iLCBpcnEpOworCQliaXRzID0gLTE7CisJfQorCisJcmV0dXJuIGJpdHM7Cit9CisKK3N0YXRpYyB2b2lkCit3YXZlZnJvbnRfc2hvdWxkX2NhdXNlX2ludGVycnVwdCAoaW50IHZhbCwgaW50IHBvcnQsIGludCB0aW1lb3V0KQorCit7CisJdW5zaWduZWQgbG9uZyBmbGFnczsKKworCS8qIHRoaXMgd2lsbCBub3QgaGVscCBvbi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WwgQm9vdCBST00KKwkgICAxIC0gbWVtb3J5IGFjY2Vzc2VzIHRvIDAzRkMzMC0wM0ZGRkZIIGFyZSBkaXJlY3RlZCB0byBleHRlcm5hbCAKKwkgICBzdG9yYWdlLgorICAgICAKKwkqLworCisJLyogY29uZmlndXJlIGhhcmR3YXJlOiBJUlEsIGVuYWJsZSBpbnRlcnJ1cHRzLCAKKwkgICBwbHVzIGV4dGVybmFsIDktcGluIE1JREkgaW50ZXJmYWNlIHNlbGVjdGVkCisJKi8KKworCW91dGIgKDB4ODAgfCAweDQwIHwgYml0cywgZGV2LmRhdGFfcG9ydCk7CQorICAKKwkvKiBDT05UUk9MIFJFR0lTVEVSCisKKwkgICAwIEhvc3QgUnggSW50ZXJydXB0IEVuYWJsZSAoMT1FbmFibGVkKSAgICAgIDB4MQorCSAgIDEgVW51c2VkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgyCisJICAgMiBVbnVzZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDQKKwkgICAzIFVudXNlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4OAorCSAgIDQgSG9zdCBUeCBJbnRlcnJ1cHQgRW5hYmxlICAgICAgICAgICAgICAgICAweDEwCisJICAgNSBNdXRlICgwPU11dGU7IDE9UGxheSkgICAgICAgICAgICAgICAgICAgIDB4MjAKKwkgICA2IE1hc3RlciBJbnRlcnJ1cHQgRW5hYmxlICgxPUVuYWJsZWQpICAgICAgMHg0MAorCSAgIDcgTWFzdGVyIFJlc2V0ICgwPVJlc2V0OyAxPVJ1bikgICAgICAgICAgICAweDgwCisKKwkgICBUYWtlIHVzIG91dCBvZiByZXNldCwgbXV0ZSBvdXRwdXQsIG1hc3RlciArIFRYICsgUlggaW50ZXJydXB0cyBvbi4KKwkgICAKKwkgICBXZSdsbCBnZXQgYW4gaW50ZXJydXB0IHByZXN1bWFibHkgdG8gdGVsbCB1cyB0aGF0IHRoZSBUWAorCSA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nb3RvIGZhaWx1cmU7CisJCQl9CisJCX0KKwkKKwkJLyogZ2V0IEFDSyAqLworCQorCQlpZiAod2F2ZWZyb250X3dhaXQgKFNUQVRfQ0FOX1JFQUQpKSB7CisKKwkJCWlmICgoYyA9IGluYiAoZGV2LmRhdGFfcG9ydCkpICE9IFdGX0FDSykgeworCisJCQkJcHJpbnRrIChLRVJOX0VSUiBMT0dOQU1FICJkb3dubG9hZCAiCisJCQkJCSJvZiBzZWN0aW9uICMlZCBub3QgIgorCQkJCQkiYWNrbm93bGVkZ2VkLCBhY2sgPSAweCV4XG4iLAorCQkJCQlzZWN0aW9uX2NudF9kb3dubG9hZGVkICsgMSwgYyk7CisJCQkJZ290byBmYWlsdXJlOworCQkKKwkJCX0KKworCQl9IGVsc2UgeworCQkJcHJpbnRrIChLRVJOX0VSUiBMT0dOQU1FICJ0aW1lIG91dCBmb3IgZmlybXdhcmUgQUNLLlxuIik7CisJCQlnb3RvIGZhaWx1cmU7CisJCX0KKworCX0KKworCXN5c19jbG9zZSAoZmQpOworCXNldF9mcyAoZnMpOworCXJldHVybiAwOworCisgZmFpbHVyZToKKwlzeXNfY2xvc2UgKGZkKTsKKwlzZXRfZnMgKGZzKTsKKwlwcmludGsgKEtFUk5fRVJSICJcbldhdmVGcm9udDogZmlybXdhcmUgZG93bmxvYWQgZmFpbGVkISEhXG4iKTsKKwlyZXR1cm4gMTsKK30KKworc3RhdGljIGludCBfX2luaXQgd2F2ZWZyb250X2NvbmZpZ19taWRpICh2b2lkKQoreworCXVuc2lnbmVkIGNoYXIgcmJ1Zls0XSwgd2J1Zls0XTsKKyAgICAKKwlpZiAoZGV0ZWN0X3dmX21wdSAoZGV2LmlycSwgZGV2LmJhc2UpIDwgMCkgeworCQlwcmludGsgKEtFUk5fV0FSTklORyBMT0dOQU1FCisJCQkiY291bGQgbm90IGZpbmQgd29ya2luZyBNSURJIGRldmljZVxuIik7CisJCXJldHVybiAtMTsKKwl9IAorCisJaWYgKChkZXYubWlkaW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XRpYyB2b2lkIF9fZXhpdCB1bmluc3RhbGxfd2F2ZWZyb250ICh2b2lkKQoreworCS8qIHRoZSBmaXJzdCB0d28gaS9vIGFkZHJlc3NlcyBhcmUgZnJlZWQgYnkgdGhlIHdmX21wdSBjb2RlICovCisJcmVsZWFzZV9yZWdpb24gKGRldi5iYXNlKzIsIDYpOworCisJaWYgKGRldi5oYXNfZngpIHsKKwkJcmVsZWFzZV9yZWdpb24gKGRldi5iYXNlKzgsIDgpOworCX0KKworCXVucmVnaXN0ZXJfc291bmRfc3ludGggKGRldi5zeW50aF9kZXYpOworCisjaWYgT1NTX1NVUFBPUlRfTEVWRUwgJiBPU1NfU1VQUE9SVF9TRVEKKwlzb3VuZF91bmxvYWRfc3ludGhkZXYgKGRldi5vc3NfZGV2KTsKKyNlbmRpZiAvKiBPU1NfU1VQUE9SVF9TRVEgKi8gCisJdW5pbnN0YWxsX3dmX21wdSAoKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogICBXYXZlRnJvbnQgRlggY29udHJvbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjaW5jbHVkZSAieXNzMjI1LmgiCisKKy8qIENvbnRyb2wgYml0cyBmb3IgdGhlIExvYWQgQ29udHJvbCBSZWdpc3RlcgorICovCisKKyNkZWZpbmUgRlhfTFNCX1RSQU5TRkVSIDB4MDEgICAgLyogdHJhbnNmZXIgYWZ0ZXIgRFNQIExTQiBieXRlIHdyaXR0ZW4gKi8KKyNkZWZpbmUgRlhfTVNCX1RSQU5TRkVSIDB4MDIgICAgLyogdHJhbnNmZXIgYWZ0ZXIgRFNQIE1TQiBieXRlIHdyaXR0ZW4gKi8KKyNkZWZpbmUgRlhfQVVUT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50ciAoaW5wdXRfZGV2LT5kZXZubywgYyk7CisJCQl9IAorCQl9CisKKwl9IHdoaWxlIChpbnB1dF9hdmFpbCgpICYmIG4tLSA+IDApOworCisJbWktPm1fYnVzeSA9IDA7CisJc3Bpbl91bmxvY2soJmxvY2spOworCXJldHVybiBJUlFfSEFORExFRDsKK30KKworc3RhdGljIGludAord2ZfbXB1X29wZW4gKGludCBkZXYsIGludCBtb2RlLAorCSAgICAgdm9pZCAgICAgICAgICAgICgqaW5wdXQpIChpbnQgZGV2LCB1bnNpZ25lZCBjaGFyIGRhdGEpLAorCSAgICAgdm9pZCAgICAgICAgICAgICgqb3V0cHV0KSAoaW50IGRldikKKwkpCit7CisJc3RydWN0IHdmX21wdV9jb25maWcgKmRldmM7CisKKwlpZiAoZGV2IDwgMCB8fCBkZXYgPj0gbnVtX21pZGlzIHx8IG1pZGlfZGV2c1tkZXZdPT1OVUxMKQorCQlyZXR1cm4gLShFTlhJTyk7CisKKwlpZiAocGh5c19kZXYtPmRldm5vID09IGRldikgeworCQlkZXZjID0gcGh5c19kZXY7CisJfSBlbHNlIGlmIChwaHlzX2Rldi0+aXN2aXJ0dWFsICYmIHZpcnRfZGV2LT5kZXZubyA9PSBkZXYpIHsKKwkJZGV2YyA9IHZpcnRfZGV2OworCX0gZWxzZSB7CisJCXByaW50ayAoS0VSTl9FUlIgIldGLU1QVTogdW5rbm93biBkZXZpY2UgbnVtYmVyICVkXG4iLCBkZXYpOworCQlyZXR1cm4gLShFSU5WQUwpOworCX0KKworCWlmIChkZXZjLT5vcGVuZWQpIHsKKwkJcmV0dXJuIC0oRUJVU1kpOworCX0KKworCWRldmMtPm1vZGUgPSBNT0RFX01JREk7CisJZGV2Yy0+b3BlbmVkID0gbW9kZTsKKwlkZXZjLT5zeW50aG5vID0gMDsKKworCWRldmMtPmlucHV0aW50ciA9IGlucHV0OworCXJldHVybiAwOworfQorIAorc3RhdGljIHZvaWQKK3dmX21wdV9jbG9zZSAoaW50IGRldikKK3sKK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JCXJldHVybiAtKEVJTlZBTCk7CisJfQorCisJc3dpdGNoIChjbWQpIHsKKworCWNhc2UgU05EQ1RMX1NZTlRIX0lORk86CisJCWlmIChjb3B5X3RvX3VzZXIoYXJnLAorCQkJICAgICAgJndmX21wdV9zeW50aF9pbmZvW2luZGV4XSwKKwkJCSAgICAgIHNpemVvZiAoc3RydWN0IHN5bnRoX2luZm8pKSkKKwkJCXJldHVybiAtRUZBVUxUOworCQlyZXR1cm4gMDsKKwkKKwljYXNlIFNORENUTF9TWU5USF9NRU1BVkw6CisJCXJldHVybiAweDdmZmZmZmZmOworCQorCWRlZmF1bHQ6CisJCXJldHVybiAtRUlOVkFMOworCX0KK30KKworc3RhdGljIGludAord2ZfbXB1X3N5bnRoX29wZW4gKGludCBkZXYsIGludCBtb2RlKQoreworCWludCAgICAgICAgICAgICBtaWRpX2RldjsKKwlzdHJ1Y3Qgd2ZfbXB1X2NvbmZpZyAqZGV2YzsKKworCW1pZGlfZGV2ID0gc3ludGhfZGV2c1tkZXZdLT5taWRpX2RldjsKKworCWlmIChtaWRpX2RldiA8IDAgfHwgbWlkaV9kZXYgPiBudW1fbWlkaXMgfHwgbWlkaV9kZXZzW21pZGlfZGV2XT09TlVMTCkgeworCQlyZXR1cm4gLShFTlhJTyk7CisJfQorICAKKwlpZiAocGh5c19kZXYtPmRldm5vID09IG1pZGlfZGV2KSB7CisJCWRldmMgPSBwaHlzX2RldjsKKwl9IGVsc2UgaWYgKHBoeXNfZGV2LT5pc3ZpcnR1YWwgJiYgdmlydF9kZXYtPmRldm5vID09IG1pZGlfZGV2KSB7CisJCWRldmMgPSB2aXJ0X2RldjsKKwl9IGVsc2UgeworCQlwcmludGsgKEtFUk5fRVJSICJXRi1NUFU6IHVua25vd24gZGV2aWNlIG51bWJlciAlZFxuIiwgZGV2KTsKKwkJcmV0dXJuIC0oRUlOVkFMKTsKKwl9CisKKwlpZiAoZGV2Yy0+b3BlbmVkKSB7CisJCXJldHVybiAtKEVCVVNZKTs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