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HJlc3NlZCB2bWxpbnV4IGltYWdlIGZyb20gdGhlIG9yaWdpbmFsIHZtbGludXgKICMKIAotdGFyZ2V0cyA6PSB2bWxpbnV4LmxkcyB2bWxpbnV4IHZtbGludXguYmluIHZtbGludXguYmluLmd6IHZtbGludXguYmluLmJ6MiB2bWxpbnV4LmJpbi5sem1hIHZtbGludXguYmluLmx6byBoZWFkXyQoQklUUykubyBtaXNjLm8gcGlnZ3kubwordGFyZ2V0cyA6PSB2bWxpbnV4LmxkcyB2bWxpbnV4IHZtbGludXguYmluIHZtbGludXguYmluLmd6IHZtbGludXguYmluLmJ6MiB2bWxpbnV4LmJpbi5sem1hIHZtbGludXguYmluLmx6byBoZWFkXyQoQklUUykubyBtaXNjLm8gc3RyaW5nLm8gY21kbGluZS5vIGVhcmx5X3NlcmlhbF9jb25zb2xlLm8gcGlnZ3kubwogCiBLQlVJTERfQ0ZMQUdTIDo9IC1tJChCSVRTKSAtRF9fS0VSTkVMX18gJChMSU5VWF9JTkNMVURFKSAtTzIKIEtCVUlMRF9DRkxBR1MgKz0gLWZuby1zdHJpY3QtYWxpYXNpbmcgLWZQSUMKQEAgLTIzLDcgKzIzLDcgQEAKIAogaG9zdHByb2dzLXkJOj0gbWtwaWdneQogCi0kKG9iaikvdm1saW51eDogJChvYmopL3ZtbGludXgubGRzICQob2JqKS9oZWFkXyQoQklUUykubyAkKG9iaikvbWlzYy5vICQob2JqKS9waWdneS5vIEZPUkNFCiskKG9iaikvdm1saW51eDogJChvYmopL3ZtbGludXgubGRzICQob2JqKS9oZWFkXyQoQklUUykubyAkKG9iaikvbWlzYy5vICQob2JqKS9zdHJpbmcubyAkKG9iaikvY21kbGluZS5vICQob2JqKS9lYXJseV9zZXJpYWxfY29uc29sZS5vICQob2JqKS9waWdneS5vIEZPUkNFCiAJJChjYWxsIGlmX2NoYW5nZWQsbGQpCiAJQDoKIApkaWZmIC0tZ2l0IGEvYXJjaC94ODYvYm9vdC9jb21wcmVzc2VkL2NtZGxpbm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DNmOCAvKiB0dHlTMCAqLworCisjZGVmaW5lIFhNVFJEWSAgICAgICAgICAweDIwCisKKyNkZWZpbmUgRExBQgkJMHg4MAorCisjZGVmaW5lIFRYUiAgICAgICAgICAgICAwICAgICAgIC8qICBUcmFuc21pdCByZWdpc3RlciAoV1JJVEUpICovCisjZGVmaW5lIFJYUiAgICAgICAgICAgICAwICAgICAgIC8qICBSZWNlaXZlIHJlZ2lzdGVyICAoUkVBRCkgICovCisjZGVmaW5lIElFUiAgICAgICAgICAgICAxICAgICAgIC8qICBJbnRlcnJ1cHQgRW5hYmxlICAgICAgICAgICovCisjZGVmaW5lIElJUiAgICAgICAgICAgICAyICAgICAgIC8qICBJbnRlcnJ1cHQgSUQgICAgICAgICAgICAgICovCisjZGVmaW5lIEZDUiAgICAgICAgICAgICAyICAgICAgIC8qICBGSUZPIGNvbnRyb2wgICAgICAgICAgICAgICovCisjZGVmaW5lIExDUiAgICAgICAgICAgICAzICAgICAgIC8qICBMaW5lIGNvbnRyb2wgICAgICAgICAgICAgICovCisjZGVmaW5lIE1DUiAgICAgICAgICAgICA0ICAgICAgIC8qICBNb2RlbSBjb250cm9sICAgICAgICAgICAgICovCisjZGVmaW5lIExTUiAgICAgICAgICAgICA1ICAgICAgIC8qICBMaW5lIFN0YXR1cyAgICAgICAgICAgICAgICovCisjZGVmaW5lIE1TUiAgICAgICAgICAgICA2ICAgICAgIC8qICBNb2RlbSBTdGF0dXMgICAgICAgICAgICAgICovCisjZGVmaW5lIERMTCAgICAgICAgICAgICAwICAgICAgIC8qICBEaXZpc29yIExhdGNoIExvdyAgICAgICAgICovCisjZGVmaW5lIERMSCAgICAgICAgICAgICAxICAgICAgIC8qICBEaXZpc29yIGxhdGNoIEhpZ2ggICAgICAgICovCisKKyNkZWZpbmUgREVGQVVMVF9CQVVEIDk2MDAKKworc3RhdGljIHZvaWQgZWFybHlfc2VyaWFsX2luaXQoaW50IHBvcnQsIGludCBiYXVkKQoreworCXVuc2lnbmVkIGNoYX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IWJhc2UpIHsKKwkJcHJpbnRrKEtFUk5fRVJSICJmYWlsZWQgdG8gcmVtYXAgT0ZXJ3MgcGdkIC0gZGlzYWJsaW5nIE9GVyFcbiIpOworCQlvbHBjX29md19jaWYgPSBOVUxMOworCQlyZXR1cm47CisJfQorCW9md19wZGUgPSAmYmFzZVtPTFBDX09GV19QREVfTlJdOworCisJLyogaW5zdGFsbCBPRlcncyBQREUgcGVybWFuZW50bHkgaW50byB0aGUga2VybmVsJ3MgcGd0YWJsZSAqLworCXNldF9wZ2QoJnN3YXBwZXJfcGdfZGlyW09MUENfT0ZXX1BERV9OUl0sICpvZndfcGRlKTsKKwkvKiBpbXBsaWNpdCBvcHRpbWl6YXRpb24gYmFycmllciBoZXJlIGR1ZSB0byB1bmlubGluZSBmdW5jdGlvbiByZXR1cm4gKi8KKworCWVhcmx5X2lvdW5tYXAoYmFzZSwgc2l6ZW9mKG9scGNfb2Z3X3BnZCkgKiBQVFJTX1BFUl9QR0QpOworfQorCitpbnQgX19vbHBjX29mdyhjb25zdCBjaGFyICpuYW1lLCBpbnQgbnJfYXJncywgY29uc3Qgdm9pZCAqKmFyZ3MsIGludCBucl9yZXMsCisJCXZvaWQgKipyZXMpCit7CisJaW50IG9md19hcmdzW01BWEFSR1MgKyAzXTsKKwl1bnNpZ25lZCBsb25nIGZsYWdzOworCWludCByZXQsIGksICpwOworCisJQlVHX09OKG5yX2FyZ3MgKyBucl9yZXMgPiBNQVhBUkdTKTsKKworCWlmICghb2xwY19vZndfY2lmKQorCQlyZXR1cm4gLUVJTzsKKworCW9md19hcmdzWzBdID0gKGludCluYW1lOworCW9md19hcmdzWzFdID0gbnJfYXJnczsKKwlvZndfYXJnc1syXSA9IG5yX3JlczsKKworCXAgPSAmb2Z3X2FyZ3NbM107CisJZm9yIChpID0gMDsgaSA8IG5yX2FyZ3M7IGkrKywgcCsrKQorCQkqcCA9IChpbnQpYXJnc1tpXTsKKworCS8qIGNhbGwgaW50byBvZncgKi8KKwlzcGlu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F90IGJ1ZltdID0ge2FkZHIsIHZhbH07CisJaW50IHJldDsKKworCXJldCA9IGkyY19tYXN0ZXJfc2VuZChjbGllbnQsIGJ1ZiwgQVJSQVlfU0laRShidWYpKTsKKwlpZiAocmV0IDwgMCkKKwkJc2lsMTY0X2VycihjbGllbnQsICJFcnJvciAlZCB3cml0aW5nIHRvIHN1YmFkZHJlc3MgMHgleFxuIiwKKwkJCSAgIHJldCwgYWRkcik7Cit9CisKK3N0YXRpYyB1aW50OF90CitzaWwxNjRfcmVhZChzdHJ1Y3QgaTJjX2NsaWVudCAqY2xpZW50LCB1aW50OF90IGFkZHIpCit7CisJdWludDhfdCB2YWw7CisJaW50IHJldDsKKworCXJldCA9IGkyY19tYXN0ZXJfc2VuZChjbGllbnQsICZhZGRyLCBzaXplb2YoYWRkcikpOworCWlmIChyZXQgPCAwKQorCQlnb3RvIGZhaWw7CisKKwlyZXQgPSBpMmNfbWFzdGVyX3JlY3YoY2xpZW50LCAmdmFsLCBzaXplb2YodmFsKSk7CisJaWYgKHJldCA8IDApCisJCWdvdG8gZmFpbDsKKworCXJldHVybiB2YWw7CisKK2ZhaWw6CisJc2lsMTY0X2VycihjbGllbnQsICJFcnJvciAlZCByZWFkaW5nIGZyb20gc3ViYWRkcmVzcyAweCV4XG4iLAorCQkgICByZXQsIGFkZHIpOworCXJldHVybiAwOworfQorCitzdGF0aWMgdm9pZAorc2lsMTY0X3NhdmVfc3RhdGUoc3RydWN0IGkyY19jbGllbnQgKmNsaWVudCwgdWludDhfdCAqc3RhdGUpCit7CisJaW50IGk7CisKKwlmb3IgKGkgPSAweDg7IGkgPD0gMHhlOyBpKyspCisJCXN0YXRlW2ldID0gc2lsMTY0X3JlYWQoY2xpZW50LCBpKTsKK30KKworc3RhdGljIHZvaWQKK3NpbDE2NF9yZXN0b3JlX3N0YXRlKHN0cnVjdCBpMmNfY2xpZW50ICpjbGllbnQsIHVpbnQ4X3QgKnN0YXRlKQoreworCWludCBpOworCisJZm9yIChpID0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KLSMgICAgZGVmaW5lIE5WMDNfQk9PVF8wX1JBTV9BTU9VTlRfOE1CICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMAotIyAgICBkZWZpbmUgTlYwM19CT09UXzBfUkFNX0FNT1VOVF8yTUIgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAxCi0jICAgIGRlZmluZSBOVjAzX0JPT1RfMF9SQU1fQU1PVU5UXzRNQiAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDIKLSMgICAgZGVmaW5lIE5WMDNfQk9PVF8wX1JBTV9BTU9VTlRfOE1CX1NEUkFNICAgICAgICAgICAgICAgMHgwMDAwMDAwMwotIyAgICBkZWZpbmUgTlYwNF9CT09UXzBfUkFNX0FNT1VOVF8zMk1CICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAwCi0jICAgIGRlZmluZSBOVjA0X0JPT1RfMF9SQU1fQU1PVU5UXzRNQiAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDEKLSMgICAgZGVmaW5lIE5WMDRfQk9PVF8wX1JBTV9BTU9VTlRfOE1CICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMgotIyAgICBkZWZpbmUgTlYwNF9CT09UXzBfUkFNX0FNT1VOVF8xNk1CICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAzCi0KLSNkZWZpbmUgTlYwNF9GSUZPX0RBVEEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDEwMDIwYwotIyAgICBkZWZpbmUgTlYxMF9GSUZPX0RBVEFfUkFNX0FNT1VOVF9NQl9NQVNLICAgICAgICAgICAgICAweGZmZjAwMDAwCi0jICAgIGRlZmluZSBOVjEwX0ZJRk9fREFUQV9SQU1fQU1PVU5UX01CX1NISUZUICAgICAgICAgICAgIDIwCisjZGVmaW5lIE5WX1BFWFRERVZfQk9PVF8wCQkJCQkweDAwMTAxMDAwCisjZGVmaW5lIE5WX1BFWFRERVZfQk9PVF8wX1JBTUNGRwkJCQkweDAwMDAwMDNjCisjCWRlZmluZSBOVl9QRVhUREVWX0JPT1RfMF9TVFJBUF9GUF9JRkFDRV8xMkJJVAkJKDggPDwgMTIpCisjZGVmaW5lIE5WX1BFWFRERVZfQk9PVF8zCQkJCQkweDAwMTAxMDBjCiAKICNkZWZpbmUgTlZfUkFNSU4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDcwMDAwMAogCkBAIC0xMzEsMjMgKzE3Niw2IEBACiAjZGVmaW5lIE5WMDRfUFRJTUVSX1RJTUVfMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDk0MTAKICNkZWZpbmUgTlYwNF9QVElNRVJfQUxBUk1fMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwOTQyMAogCi0jZGVmaW5lIE5WMDRfUEZCX0NGRzAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAxMDAyMDAKLSNkZWZpbmUgTlYwNF9QRkJfQ0ZHMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDEwMDIwNAotI2RlZmluZSBOVjQwX1BGQl8wMjBDICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMTAwMjBDCi0jZGVmaW5lIE5WMTBfUEZCX1RJTEUoaSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDAwMTAwMjQwICsgKGkqMTYpKQotI2RlZmluZSBOVjEwX1BGQl9USUxFX19TSVpFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA4Ci0jZGVmaW5lIE5WMTBfUEZCX1RMSU1JVChpKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDAwMTAwMjQ0ICsgKGkqMTYpKQotI2RlZmluZSBOVjEwX1BGQl9UU0laRShpKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgwMDEwMDI0OCArIChpKjE2KSkKLSNkZWZpbmUgTlYxMF9QRkJfVFNUQVRVUyhpKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MDAxMDAyNEMgKyAoaSoxNikpCi0jZGVmaW5lIE5WMTBfUEZCX0NMT1NFX1BBR0UyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAxMDAzM0MKLSNkZWZpbmUgTlY0MF9QRkJfVElMRShpKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MDAxMDA2MDAgKyAoaSoxNikpCi0jZGVmaW5lIE5WNDBfUEZCX1RJTEVfX1NJWkVfMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEyCi0jZGVmaW5lIE5WNDBfUEZCX1RJTEVfX1NJWkVfMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE1Ci0jZGVmaW5lIE5WNDBfUEZCX1RMSU1JVChpKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDAwMTAwNjA0ICsgKGkqMTYpKQotI2RlZmluZSBOVjQwX1BGQl9UU0laRShpKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgwMDEwMDYwOCArIChpKjE2KSkKLSNkZWZpbmUgTlY0MF9QRkJfVFNUQVRVUyhpKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MDAxMDA2MEMgKyAoaSoxNikpCi0jZGVmaW5lIE5WNDBfUEZCX1VOS184MDAJCQkJCTB4MDAxMDA4MDAKLQogI2RlZmluZSBOVjA0X1BHUkFQSF9ERUJVR18wICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwNDAwMDgwCiAjZGVmaW5lIE5WMDRfUEdSQVBIX0RFQlVHXzEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDA0MDAwODQKICNkZWZpbmUgTlYwNF9QR1JBUEhfREVCVUdfMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDQwMDA4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VmaW5lICAgICBWXzAzODAwMF9BUlJBWV8xRF9USUxFRF9USElOMSAgICAgICAgICAgICAgMHgwMDAwMDAwMgorI2RlZmluZSAgICAgVl8wMzgwMDBfQVJSQVlfMkRfVElMRURfVEhJTjEgICAgICAgICAgICAgIDB4MDAwMDAwMDQKICNkZWZpbmUgICBTXzAzODAwMF9USUxFX1RZUEUoeCkgICAgICAgICAgICAgICAgICAgICAgICAoKCh4KSAmIDB4MSkgPDwgNykKICNkZWZpbmUgICBHXzAzODAwMF9USUxFX1RZUEUoeCkgICAgICAgICAgICAgICAgICAgICAgICAoKCh4KSA+PiA3KSAmIDB4MSkKICNkZWZpbmUgICBDXzAzODAwMF9USUxFX1RZUEUgICAgICAgICAgICAgICAgICAgICAgICAgICAweEZGRkZGRjdGCkBAIC0xMzU3LDYgKzEzNjcsOCBAQAogI2RlZmluZSAgIFNfMDI4MDEwX0FSUkFZX01PREUoeCkgICAgICAgICAgICAgICAgICAgICAgICgoKHgpICYgMHhGKSA8PCAxNSkKICNkZWZpbmUgICBHXzAyODAxMF9BUlJBWV9NT0RFKHgpICAgICAgICAgICAgICAgICAgICAgICAoKCh4KSA+PiAxNSkgJiAweEYpCiAjZGVmaW5lICAgQ18wMjgwMTBfQVJSQVlfTU9ERSAgICAgICAgICAgICAgICAgICAgICAgICAgMHhGRkY4N0ZGRgorI2RlZmluZSAgICAgVl8wMjgwMTBfQVJSQVlfMURfVElMRURfVEhJTjEgICAgICAgICAgICAgIDB4MDAwMDAwMDIKKyNkZWZpbmUgICAgIFZfMDI4MDEwX0FSUkFZXzJEX1RJTEVEX1RISU4xICAgICAgICAgICAgICAweDAwMDAwMDA0CiAjZGVmaW5lICAgU18wMjgwMTBfVElMRV9TVVJGQUNFX0VOQUJMRSh4KSAgICAgICAgICAgICAgKCgoeCkgJiAweDEpIDw8IDI1KQogI2RlZmluZSAgIEdfMDI4MDEwX1RJTEVfU1VSRkFDRV9FTkFCTEUoeCkgICAgICAgICAgICAgICgoKHgpID4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idXMgeworCWNvbnN0IGNoYXIJKm5hbWU7CisJY29uc3QgY2hhcgkqYWRkcmVzc2VzOworCWludAkJKCptYXRjaCkoc3RydWN0IGRldmljZV9ub2RlICpwYXJlbnQpOworCXZvaWQJCSgqY291bnRfY2VsbHMpKHN0cnVjdCBkZXZpY2Vfbm9kZSAqY2hpbGQsCisJCQkJICAgICAgIGludCAqYWRkcmMsIGludCAqc2l6ZWMpOworCXU2NAkJKCptYXApKHUzMiAqYWRkciwgY29uc3QgdTMyICpyYW5nZSwKKwkJCQlpbnQgbmEsIGludCBucywgaW50IHBuYSk7CisJaW50CQkoKnRyYW5zbGF0ZSkodTMyICphZGRyLCB1NjQgb2Zmc2V0LCBpbnQgbmEpOworCXVuc2lnbmVkIGludAkoKmdldF9mbGFncykoY29uc3QgdTMyICphZGRyKTsKK307CisKKy8qCisgKiBEZWZhdWx0IHRyYW5zbGF0b3IgKGdlbmVyaWMgYnVzKQorICovCisKK3N0YXRpYyB2b2lkIG9mX2J1c19kZWZhdWx0X2NvdW50X2NlbGxzKHN0cnVjdCBkZXZpY2Vfbm9kZSAqZGV2LAorCQkJCSAgICAgICBpbnQgKmFkZHJjLCBpbnQgKnNpemVjKQoreworCWlmIChhZGRyYykKKwkJKmFkZHJjID0gb2Zfbl9hZGRyX2NlbGxzKGRldik7CisJaWYgKHNpemVjKQorCQkqc2l6ZWMgPSBvZl9uX3NpemVfY2VsbHMoZGV2KTsKK30KKworc3RhdGljIHU2NCBvZl9idXNfZGVmYXVsdF9tYXAodTMyICphZGRyLCBjb25zdCB1MzIgKnJhbmdlLAorCQlpbnQgbmEsIGludCBucywgaW50IHBuYSkKK3sKKwl1NjQgY3AsIHMsIGRhOworCisJY3AgPSBvZl9yZWFkX251bWJlcihyYW5nZSwgbmEpOworCXMgID0gb2ZfcmVhZF9udW1iZXIocmFuZ2UgKyBuYSArIHBuYSwgbnMpOworCWRhID0gb2ZfcmVhZF9udW1iZXIoYWRkciwgbmEpOworCisJcHJfZGVidWc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AJX19BVFRSX1JPKGNhcmRfaWQpLApAQCAtMTIxNSw4NiArMTIzMyw1NyBAQAogCXJldHVybiAwOwogfQogCi0KLS8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotCi0gICAgVGhlIGNhcmQgc3RhdHVzIGV2ZW50IGhhbmRsZXIuCi0KLT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwotCi0vKiBOb3JtYWxseSwgdGhlIGV2ZW50IGlzIHBhc3NlZCB0byBpbmRpdmlkdWFsIGRyaXZlcnMgYWZ0ZXIKLSAqIGluZm9ybWluZyB1c2Vyc3BhY2UuIE9ubHkgZm9yIENTX0VWRU5UX0NBUkRfUkVNT1ZBTCB0aGlzCi0gKiBpcyBpbnZlcnNlZCB0byBtYWludGFpbiBoaXN0b3JpYyBjb21wYXRpYmlsaXR5LgotICovCi0KLXN0YXRpYyBpbnQgZHNfZXZlbnQoc3RydWN0IHBjbWNpYV9zb2NrZXQgKnNrdCwgZXZlbnRfdCBldmVudCwgaW50IHByaW9yaXR5KQorc3RhdGljIGludCBwY21jaWFfYnVzX3JlbW92ZShzdHJ1Y3QgcGNtY2lhX3NvY2tldCAqc2t0KQogewotCXN0cnVjdCBwY21jaWFfc29ja2V0ICpzID0gcGNtY2lhX2dldF9zb2NrZXQoc2t0KTsKKwlhdG9taWNfc2V0KCZza3QtPnByZXNlbnQsIDApOworCXBjbWNpYV9jYXJkX3JlbW92ZShza3QsIE5VTEwpOwogCi0JaWYgKCFzKSB7Ci0JCWRldl9wcmludGsoS0VSTl9FUlIsICZza3QtPmRldiwKLQkJCSAgICJQQ01DSUEgb2J0YWluaW5nIHJlZmVyZW5jZSB0byBzb2NrZXQgIglcCi0JCQkgICAiZmFpbGVkLCBldmVudCAweCV4IGxvc3QhXG4iLCBldmVudCk7Ci0JCXJldHVybiAtRU5PRE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Yy0+aW8uQmFzZVBvcnQyOwotCWNvbmZpZy0+TnVtUG9ydHMyID0gYy0+aW8uTnVtUG9ydHMyOwotCWNvbmZpZy0+QXR0cmlidXRlczIgPSBjLT5pby5BdHRyaWJ1dGVzMjsKLQljb25maWctPklPQWRkckxpbmVzID0gYy0+aW8uSU9BZGRyTGluZXM7Ci0KLQlyZXR1cm4gMDsKLX0gLyogcGNjYXJkX2dldF9jb25maWd1cmF0aW9uX2luZm8gKi8KLQotCi0vKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLQotICAgIFRoZXNlIG1hbmFnZSBhIHJpbmcgYnVmZmVyIG9mIGV2ZW50cyBwZW5kaW5nIGZvciBvbmUgdXNlciBwcm9jZXNzCi0KLT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwotCi0KLXN0YXRpYyBpbnQgcXVldWVfZW1wdHkodXNlcl9pbmZvX3QgKnVzZXIpCi17Ci0gICAgcmV0dXJuICh1c2VyLT5ldmVudF9oZWFkID09IHVzZXItPmV2ZW50X3RhaWwpOwotfQotCi1zdGF0aWMgZXZlbnRfdCBnZXRfcXVldWVkX2V2ZW50KHVzZXJfaW5mb190ICp1c2VyKQotewotICAgIHVzZXItPmV2ZW50X3RhaWwgPSAodXNlci0+ZXZlbnRfdGFpbCsxKSAlIE1BWF9FVkVOVFM7Ci0gICAgcmV0dXJuIHVzZXItPmV2ZW50W3VzZXItPmV2ZW50X3RhaWxdOwotfQotCi1zdGF0aWMgdm9pZCBxdWV1ZV9ldmVudCh1c2VyX2luZm9fdCAqdXNlciwgZXZlbnRfdCBldmVudCkKLXsKLSAgICB1c2VyLT5ldmVudF9oZWFkID0gKHVzZXItPmV2ZW50X2hlYWQrMSkgJSBNQVhfRVZFTlRTOwotICAgIGlmICh1c2VyLT5ldmVudF9oZWFkID09IHVzZXItPmV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UgKmZpbGUsIGNoYXIgX191c2VyICpidWYsCi0JCSAgICAgICBzaXplX3QgY291bnQsIGxvZmZfdCAqcHBvcykKLXsKLSAgICBzdHJ1Y3QgcGNtY2lhX3NvY2tldCAqczsKLSAgICB1c2VyX2luZm9fdCAqdXNlcjsKLSAgICBpbnQgcmV0OwotCi0gICAgcHJfZGVidWcoImRzX3JlYWQoc29ja2V0ICVkKVxuIiwgaW1pbm9yKGZpbGUtPmZfcGF0aC5kZW50cnktPmRfaW5vZGUpKTsKLQotICAgIGlmIChjb3VudCA8IDQpCi0JcmV0dXJuIC1FSU5WQUw7Ci0KLSAgICB1c2VyID0gZmlsZS0+cHJpdmF0ZV9kYXRhOwotICAgIGlmIChDSEVDS19VU0VSKHVzZXIpKQotCXJldHVybiAtRUlPOwotCi0gICAgcyA9IHVzZXItPnNvY2tldDsKLSAgICByZXQgPSB3YWl0X2V2ZW50X2ludGVycnVwdGlibGUocy0+cXVldWUsICFxdWV1ZV9lbXB0eSh1c2VyKSk7Ci0gICAgaWYgKHJldCA9PSAwKQotCXJldCA9IHB1dF91c2VyKGdldF9xdWV1ZWRfZXZlbnQodXNlciksIChpbnQgX191c2VyICopYnVmKSA/IC1FRkFVTFQgOiA0OwotCi0gICAgcmV0dXJuIHJldDsKLX0gLyogZHNfcmVhZCAqLwotCi0vKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KLQotc3RhdGljIHNzaXplX3QgZHNfd3JpdGUoc3RydWN0IGZpbGUgKmZpbGUsIGNvbnN0IGNoYXIgX191c2VyICpidWYsCi0JCQlzaXplX3QgY291bnQsIGxvZmZfdCAqcHBvcykKLXsKLSAgICBwcl9kZWJ1ZygiZHNfd3JpdGUoc29ja2V0ICVkKVxuIiwgaW1pbm9yKGZpbGUtPmZfcGF0aC5kZW50cnktPmRfaW5vZGUpKTsKLQotICAgIGlmIChjb3VudCAhPSA0KQotCXJldHVybiAtRU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yBnb2luZyB0aHJvdWdoIHRoZQorICAgICAgICAgICAgICAgIG1lc2ggd2lsbCBiZSBzZW50IHVzaW5nIG11bHRpcGxlIGludGVyZmFjZXMgYXQgdGhlCisgICAgICAgICAgICAgICAgc2FtZSB0aW1lIChpZiBhdmFpbGFibGUpLgorCitXaGF0OiAgICAgICAgICAgL3N5cy9jbGFzcy9uZXQvPG1lc2hfaWZhY2U+L21lc2gvb3JpZ19pbnRlcnZhbAorRGF0ZTogICAgICAgICAgIE1heSAyMDEwCitDb250YWN0OiAgICAgICAgTWFyZWsgTGluZG5lciA8bGluZG5lcl9tYXJla0B5YWhvby5kZT4KK0Rlc2NyaXB0aW9uOgorICAgICAgICAgICAgICAgIERlZmluZXMgdGhlIGludGVydmFsIGluIG1pbGxpc2Vjb25kcyBpbiB3aGljaCBiYXRtYW4KKyAgICAgICAgICAgICAgICBzZW5kcyBpdHMgcHJvdG9jb2wgbWVzc2FnZXMuCisKK1doYXQ6ICAgICAgICAgICAvc3lzL2NsYXNzL25ldC88bWVzaF9pZmFjZT4vbWVzaC92aXNfbW9kZQorRGF0ZTogICAgICAgICAgIE1heSAyMDEwCitDb250YWN0OiAgICAgICAgTWFyZWsgTGluZG5lciA8bGluZG5lcl9tYXJla0B5YWhvby5kZT4KK0Rlc2NyaXB0aW9uOgorICAgICAgICAgICAgICAgIEVhY2ggYmF0bWFuIG5vZGUgb25seSBtYWludGFpbnMgaW5mb3JtYXRpb24gYWJvdXQgaXRzCisgICAgICAgICAgICAgICAgb3duIGxvY2FsIG5laWdoYm9yaG9vZCwgdGhlcmVmb3JlIGdlbmVyYXRpbmcgZ3JhcGhzCisgICAgICAgICAgICAgICAgc2hvd2luZyB0aGUgdG9wb2xvZ3kgb2YgdGhlIGVudGlyZSBtZXNoIGlzIG5vdCBlYXNpbHkKKyAgICAgICAgICAgICAgICBmZWFzaWJsZSB3aXRob3V0IGhhdmluZyBhIGNlbnRyYWwgaW5zdGFuY2UgdG8gY29sbGVjdAorICAgICA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05FWEFOVCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBDSV9ERVZJQ0VfSURfQ044NDc0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGRldikpKQotI2VuZGlmCiAgICAgewogICAgICAgICBpZiAoYzRfaGR3X2luaXQgKHBkZXYsIGZvdW5kKSkKICAgICAgICAgICAgIGZvdW5kKys7CmRpZmYgLS1naXQgYS9kcml2ZXJzL3N0YWdpbmcvY3h0MWUxL2xpbnV4LmMgYi9kcml2ZXJzL3N0YWdpbmcvY3h0MWUxL2xpbnV4LmMKaW5kZXggMTM0ZTc1Ni4uZWIwZjRiZCAxMDA2NDQKLS0tIGEvZHJpdmVycy9zdGFnaW5nL2N4dDFlMS9saW51eC5jCisrKyBiL2RyaXZlcnMvc3RhZ2luZy9jeHQxZTEvbGludXguYwpAQCAtMTQyLDEwICsxNDIsNiBAQAogfQogCiAKLSNpZiBMSU5VWF9WRVJTSU9OX0NPREUgPCBLRVJORUxfVkVSU0lPTigyLDUsMCkKLSNkZWZpbmUgREVWX1RPX1BSSVYoZGV2KSAoICogKHN0cnVjdCBjNF9wcml2ICoqKSAoKGhkbGNfZGV2aWNlKikoZGV2KSsxKSkKLSNlbHNlCi0KIGNoYXIgICAgICAgKgogZ2V0X2hkbGNfbmFtZSAoaGRsY19kZXZpY2UgKiBoZGxjKQogewpAQCAtMTU0LDcgKzE1MCw2IEBACiAKICAgICByZXR1cm4gZGV2LT5uYW1lOwogfQotI2VuZGlmCiAKIAogc3RhdGljICAgICAgc3RhdHVzX3QKQEAgLTE2Nyw3ICsxNjIsNiBAQAogfQogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotI2lmIExJTlVYX1ZFUlNJT05fQ09ERSA+IEtFUk5FTF9WRVJTSU9OKDIsNSw0MSkKICNpbmNsdWRlIDxsaW51eC93b3JrcXVldWUuaD4KIAogLyoqKgpAQCAtMjU5LDcgKzI1Myw2IEBACiAgICAgICAgIHBpLT53cV9wb3J0ID0gMDsKICAgICB9CiB9Ci0jZW5kaWYKIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIApAQCAtMjkxLDQ4ICsyODQsNiBAQAogfQogCiAKLSNpZiBMSU5VWF9WRVJTSU9OX0NPREUgPCBLRVJORUxfVkVSU0lPTigyLDUsMCkKLSNpZiAhZGVmaW5lZChHRU5FUklDX0hETENfVkVSU0lPTikgfHwgKEdFTkVSSUNfSERMQ19WRVJTSU9OIDwgNCkKLQotLyoqIExpbnV4IDIuNC4xOC0xOSAqKi8KLVNUQVRJQyBpbnQKLWNoYW5fb3BlbiAoaGRsY19kZXZpY2UgKiBoZGxjKQotewotICAgIHN0YXR1c190ICAgIHJldDsKLQotICAgIGlmICgocmV0ID0gYzRfY2hhbl91cCAoREVWX1RPX1BSSVYgKGhkbGMpLT5jaSwgREVWX1RPX1BSSVYgKGhkbGMpLT5jaGFubnVtKSkpCi0gICAgICAgIHJldHVybiAtcmV0OwotICAgIE1PRF9JTkNfVVNFX0NPVU5UOwotICAgIG5ldGlmX3N0YXJ0X3F1ZXVlIChoZGxjX3RvX2RldiAoaGRsYykpOwotICAgIHJldHVybiAwOyAgICAgICAgICAgICAgICAgICAgICAgLyogbm8gZXJyb3IgPSBzdWNjZXNzICovCi19Ci0KLSNlbHNlCi0KLS8qKiBMaW51eCAyLjQuMjAgYW5kIGhpZ2hlciAqKi8KLVNUQVRJQyBpbnQKLWNoYW5fb3BlbiAoc3RydWN0IG5ldF9kZXZpY2UgKiBuZGV2KQotewotICAgIGhkbGNfZGV2aWNlICpoZGxjID0gZGV2X3RvX2hkbGMgKG5kZXYpOwotICAgIHN0YXR1c190ICAgIHJldDsKLQotICAgIGhkbGMtPnByb3RvID0gSUZfUFJPVE9fSERMQzsKLSAgICBpZiAoKHJ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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBpbnRlcnJ1cHQgdG8gc25lYWsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHRocnUgKi8KLSNlbmRpZgotCiAgICAgLyoKICAgICAgKiBJZiBhbiBPTlIgd2FzIHNlZW4sIHRoZW4gY2hhbm5lbCByZXF1aXJlcyBwb2tpbmcgdG8gcmVzdGFydAogICAgICAqIHRyYW5zbWlzc2lvbi4KICAgICAgKi8KICAgICBpZiAoY2gtPmNoX3N0YXJ0X3R4KQogICAgIHsKLSNpZiBMSU5VWF9WRVJTSU9OX0NPREUgPD0gS0VSTkVMX1ZFUlNJT04oMiw1LDQxKQotICAgICAgICBTRF9TRU1fVEFLRSAoJmNpLT5zZW1fd2RidXN5LCAiX3dkXyIpOyAgLyogb25seSAxIHRocnUgaGVyZSwgcGVyCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBib2FyZCAqLwotICAgICAgICBpZiAoKGNoLT5jaF9zdGFydF90eCA9PSBDSF9TVEFSVF9UWF9PTlIpICYmIChjaC0+cC5jaGFuX21vZGUgPT0gQ0ZHX0NIX1BST1RPX1RSQU5TKSkKLSAgICAgICAgewotICAgICAgICAgICAgLyogT05SIHJlc3RhcnQgdHJhbnNtaXNzaW9uIGZyb20gYmFja2dyb3VuZCBsb29wICovCi0gICAgICAgICAgICBjaS0+d2Rfbm90aWZ5ID0gV0RfTk9USUZZX09OUjsgICAgICAvKiBlbmFibGVkIGdsb2JhbCB3YXRjaGRvZwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogc2Nhbi10aHJ1ICAqLwotICAgICAgICB9IGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgLyogc3RhcnQgZmlyc3QgdHJhbnNtaXNzaW9uIGZyb20gYmFja2dyb3VuZCBsb29wICovCi0gICAgICAgICAgICBjaS0+d2Rfbm90aWZ5ID0gV0RfTk9USUZZXzFUWDsgICAgICAvKiBlbmFibGVkIGdsb2JhbCB3YXRjaGRvZwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogc2Nhbi10aHJ1ICAqLwotICAgICAgICB9CiAgICAgICAgIG11c3ljY19jaGFuX3Jlc3RhcnQgKGNoKTsKLSAgICAgICAgU0RfU0VNX0dJVkUgKCZjaS0+c2VtX3dkYnVzeSk7Ci0jZWxzZQotICAgICAgICBtdXN5Y2NfY2hhbl9yZXN0YXJ0IChjaCk7Ci0jZW5kaWYKICAgICB9CiAjaWZkZWYgU0JFX1dBTjI1NlQzX0VOQUJMRQogICAgIHdhbjI1NnQzX2xlZCAoY2ksIExFRF9UWCwgTEVEVl9HKTsKQEAgLTIwNDcsMTM5ICsxOTc4LDQgQEAKIH0KIAogCi0jaWYgMAotaW50Ci1tdXN5Y2Nfc2V0X2NoYW4gKGNpX3QgKiBjaSwgaW50IGNoYW5udW0sIHN0cnVjdCBzYmVjb21fY2hhbl9wYXJhbSAqIHApCi17Ci0gICAgbWNoX3QgICAgICAqY2g7Ci0gICAgaW50ICAgICAgICAgcm9rID0gMDsKLSAgICBpbnQgICAgICAgICBuID0gMDsKLQotICAgIGlmIChjaGFubnVtIDwgMCB8fCBjaGFubnVtID49IChNVVNZQ0NfTlBPUlRTICogTVVTWUNDX05DSEFOUykpICAgICAgLyogc2FuaXR5IGNoayBwYXJhbSAqLwotICAgICAgICByZXR1cm4gRUNIUk5HOwotICAgIGlmICghKGNoID0gc2RfZmluZF9jaGFuIChjaSwgY2hhbm51bSkpKQotICAgICAgICByZXR1cm4gRU5PRU5UOwotICAgIGlmIChjaC0+Y2hhbm51bSAhPSBwLT5jaGFubnVtKQotICAgICAgICByZXR1cm4gRUlOVkFMOwotICAgIGlmIChzZF9saW5lX2lzX29rIChjaC0+dXNlcikpCi0gICAgewotICAgICAgICByb2sgPSAxOwotICAgICAgICBzZF9saW5lX2lzX2Rvd24gKGNoLT51c2VyKTsKLSAgICB9Ci0gICAgaWYgKGNoLT5zdGF0ZSA9PSBVUCAmJiAgICAgICAgICAvKiBicmluZyBkb3duIGluIGN1cnJlbnQgY29uZmlndXJhdGlvbiAqLwotICAgICAgICAoY2gtPnAuc3RhdHVzICE9IHAtPnN0YXR1cyB8fAotICAgICAgICAgY2gtPnAuY2hhbl9tb2RlICE9IHAtPmNoYW5fbW9kZSB8fAotICAgICAgICAgY2gtPnAuaW50cl9tYXNrICE9IHAtPmludHJfbWFzayB8fAotICAgICAgICAgY2gtPnR4ZF9mcmVlIDwgY2gtPnR4ZF9udW0pKQotICAgIHsKLSAgICAgICAgaWYgKChuID0gbXVzeWNjX2NoYW5fZG93biAoY2ksIGNoYW5udW0pKSkKLSAgICAgICAgICAgIHJldHVybiBuOwotICAgICAgICBpZiAoY2gtPnAubW9kZV81NmsgIT0gcC0+bW9kZV81NmspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGNoLT5wID0gKnA7ICAgICAgICAgICAgIC8qIGNvcHkgaW4gbmV3IHBhcmFtZXRlcnMgKi8KLSAgICAgICAgICAgIG11c3ljY191cGRhdGVfdGltZXNsb3RzICgmY2ktPnBvcnRbY2gtPmNoYW5udW0gLyBNVVNZQ0NfTkNIQU5TXSk7Ci0gICAgICAgIH0gZWxzZQotICAgICAgICAgICAgY2gtPnAgPSAqcDsgICAgICAgICAgICAgLyogY29weSBpbiBuZXcgcGFyYW1ldGVycyAqLwotICAgICAgICBpZiAoKG4gPSBtdXN5Y2NfY2hhbl91cCAoY2ksIGNoYW5udW0pKSkKLSAgICAgICAgICAgIHJldHVybiBuOwotICAgICAgICBzZF9lbmFibGVfeG1pdCAoY2gtPnVzZXIpOyAgLyogcmUtZW5hYmxlIHRvIGNhdGNoIGZsb3cgY29udHJvbGxlZAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogY2hhbm5lbCAqLwotICAgIH0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AgIFNEX1NFTV9UQUtFICgmY2ktPnNlbV93ZGJ1c3ksICJfd2RfIik7ICAgIC8qIG9ubHkgMSB0aHJ1IGhlcmUsIHBlcgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGJvYXJkICovCi0jZW5kaWYKLQogICAgIGNpLT53ZGNvdW50Kys7CiAgICAgY2hlY2tQb3J0cyAoY2kpOwotI2lmIExJTlVYX1ZFUlNJT05fQ09ERSA8PSBLRVJORUxfVkVSU0lPTigyLDUsNDEpCi0gICAgaWYgKGNpLT53ZF9ub3RpZnkpCi0gICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpcyB0aGVyZSBhIHN0YXRlIGNoYW5nZSB0byBzZWFyY2ggZm9yICovCi0gICAgICAgIGludCAgICAgICAgIHBvcnQsIGdjaGFuOwotCi0gICAgICAgIGNpLT53ZF9ub3RpZnkgPSAwOyAgICAgICAgICAvKiByZXNldCBub3RpZmljYXRpb24gKi8KLSAgICAgICAgZm9yIChnY2hhbiA9IDA7IGdjaGFuIDwgTVVTWUNDX05DSEFOUzsgZ2NoYW4rKykKLSAgICAgICAgewotICAgICAgICAgICAgZm9yIChwb3J0ID0gMDsgcG9ydCA8IGNpLT5tYXhfcG9ydDsgcG9ydCsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIG1jaF90ICAgICAgKmNoID0gY2ktPnBvcnRbcG9ydF0uY2hhbltnY2hhbl07Ci0KLSAgICAgICAgICAgICAgICBpZiAoIWNoIHx8IGNpLT5zdGF0ZSAhPSBDX1JVTk5JTkcpICAgICAgLyogc3RhdGUgY2hhbmdlZCB3aGlsZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBhY3F1aXJpbmcgc2VtYXBob3JlICovCi0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIGlmIChjaC0+c3RhdGUgPT0gVVApLyogY2hhbm5lbCBtdXN0IGJlIHNldCB1cCAqLwotICAgICAgICAgICAgICAgIHsKLSNpZiAwCi0jaWZkZWYgUkxEX1RSQU5TX0RFQlVHCi0gICAgICAgICAgICAgICAgICAgIGlmICgxIHx8IGxvZ19sZXZlbCA+PSBMT0dfTU9OSVRPUikKLSNlbHNlCi0gICAgICAgICAgICAgICAgICAgIGlmIChsb2dfbGV2ZWwgPj0gTE9HX01PTklUT1IpCi0jZW5kaWYKLSAgICAgICAgICAgICAgICAgICAgICAgIHByX2luZm8oIiVzOiB3YXRjaGRvZyByZXZpdmluZyBQb3J0ICVkIENoYW5uZWwgJWQgWyVkXSBzdHMgJXgvJXgsIHN0YXJ0X1RYICV4IGZyZWUgJXggc3RhcnRfUlggJXhcbiIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgY2ktPmRldm5hbWUsIGNoLT5jaGFubnVtLCBwb3J0LCBnY2hhbiwgY2gtPmNoYW5udW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoLT5wLnN0YXR1cywgY2gtPnN0YXR1cywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaC0+Y2hfc3RhcnRfdHgsIGNoLT50eGRfZnJlZSwgY2gtPmNoX3N0YXJ0X3J4KTsKLSNlbmRpZgotCi0gICAgICAgICAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgICAgICAgICAvKiogY2hlY2sgZm9yIFJYIHJlc3RhcnQgcmVxdWVzdCAqKi8KLSAgICAgICAgICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSAgICAgICAgICAgICAgICAgICAgaWYgKGNoLT5jaF9zdGFydF9yeCAmJgotICAgICAgICAgICAgICAgICAgICAgICAgKGNoLT5zdGF0dXMgJiBSWF9FTkFCTEVEKSkgICAgICAvKiByZXF1aXJlcyBzdGFydCBvbgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBlbmFibGVkIFJYICovCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNoLT5jaF9zdGFydF9yeCA9IDA7ICAgIC8qIHdlIGFyZSByZXN0YXJ0aW5nIFJYLi4uICovCi0jaWZkZWYgUkxEX1RSQU5TX0RFQlVHCi0gICAgICAgICAgICAgICAgICAgICAgICBwcl9pbmZvKCIrKyBjNF93YXRjaGRvZygpIENIQU4gUlggQUNUSVZBVEU6IGNoYW4gJWRcbiIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoLT5jaGFubnVtKTsKLSNlbmRpZgotI2lmZGVmIFJMRF9SWEFDVF9ERUJVRwotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtZGVzYyAqbWQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGljIGludCAgaGVyZWI0ID0gNzsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChoZXJlYjQpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZXJlYjQtLTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWQgPSAmY2gtPm1kcltjaC0+cnhpeF9pcnFfc3J2XTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJfaW5mbygiKysgYzRfd2F0Y2hkb2dbJWRdIENIQU4gUlggQUNUSVZBVEU6IHJ4aXhfaXJxX3NydiAlZCwgbWQgJXAgc3RzICV4LCByeHBrdCAlbHVcbiIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2gtPmNoYW5udW0sIGNoLT5yeGl4X2lycV9zcnYsIG1kLCBsZTMyX3RvX2NwdSAobWQtPnN0YXR1cyksIGNoLT5zLnJ4X3BhY2tldHMpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtdXN5Y2NfZHVtcF9yeGJ1ZmZlcl9yaW5nIChjaCwgMSk7ICAgICAgLyogUkxEIERFQlVHICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgfQotI2VuZGlmCi0gICAgICAgICAgICAgICAgICAgICAgICBtdXN5Y2Nfc2Vydl9yZXEgKGNoLT51cCwgU1JfQ0hBTk5FTF9BQ1RJVkFURSB8IFNSX1JYX0RJUkVDVElPTiB8IGdjaGFuKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgICAgICAgICAgLyoqIGNoZWNrIGZvciBUWCByZXN0YXJ0IHJlcXVlc3QgKiovCi0gICAgICAgICAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChjaC0+Y2hfc3RhcnRfdHggJiYKLSAgICAgICAgICAgICAgICAgICAgICAgIChjaC0+c3RhdHVzICYgVFhfRU5BQkxFRCkpICAgICAgLyogcmVxdWlyZXMgc3RhcnQgb24KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogZW5hYmxlZCBUWCAqLwotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWRlc2MgKm1kOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAgICAgICAgICogZmluZCBuZXh0IHVucHJvY2Vzc2VkIG1lc3NhZ2UsIHRoZW4gc2V0IFRYIHRocCB0bwotICAgICAgICAgICAgICAgICAgICAgICAgICogaXQKLSAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgbXVzeWNjX3VwZGF0ZV90eF90aHAgKGNoKTsKLQotI2lmIDAKLSAgICAgICAgICAgICAgICAgICAgICAgIHNwaW5fbG9ja19pcnFzYXZlICgmY2gtPmNoX3R4bG9jaywgZmxhZ3MpOwotI2VuZGlmCi0gICAgICAgICAgICAgICAgICAgICAgICBtZCA9IGNoLT50eGRfaXJxX3NydjsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICghbWQpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJfaW5mbygiLS0gYzRfd2F0Y2hkb2dbJWRdOiBXQVJOSU5HLCBzdGFydGluZyBOVUxMIG1kXG4iLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2gtPmNoYW5udW0pOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByX2luZm8oIi0tICAgY2hhbiAlZCB0eGRfaXJxX3NydiAlcCBzdHMgJXggdXNyX2FkZCAlcCBzdHMgJXgsIHR4cGt0ICVsdVxuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoLT5jaGFubnVtLCBjaC0+dHhkX2lycV9zcnYsIGxlMzJfdG9fY3B1ICgoc3RydWN0IG1kZXNjICopIChjaC0+dHhkX2lycV9zcnYpLT5zdGF0dXMpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2gtPnR4ZF91c3JfYWRkLCBsZTMyX3RvX2NwdSAoKHN0cnVjdCBtZGVzYyAqKSAoY2gtPnR4ZF91c3JfYWRkKS0+c3RhdHVzKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoLT5zLnR4X3BhY2tldHMpOwotI2lmIDAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcGluX3VubG9ja19pcnFyZXN0b3JlICgmY2gtPmNoX3R4bG9jaywgZmxhZ3MpOwotI2VuZGlmCi0gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1kLT5kYXRhICYmICgobGUzMl90b19jcHUgKG1kLT5zdGF0dXMpKSAmIE1VU1lDQ19UWF9PV05FRCkpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0jaWZkZWYgUkxEX1RSQU5TX0RFQlVHCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJfaW5mbygiKysgYzRfd2F0Y2hkb2dbJWRdIENIQU4gVFggQUNUSVZBVEU6IHN0YXJ0X3R4ICV4XG4iLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2gtPmNoYW5udW0sIGNoLT5jaF9zdGFydF90eCk7Ci0jZW5kaWYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaC0+Y2hfc3RhcnRfdHggPSAwOyAgICAgICAgLyogd2UgYXJlIHJlc3RhcnRpbmcKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogVFguLi4gKi8KLSNpZiAwCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3Bpbl91bmxvY2tfaXJxcmVzdG9yZSAoJmNoLT5jaF90eGxvY2ssIGZsYWdzKTsgICAvKiBhbGxvdyBpbnRlcnJ1cHRzIGZvcgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogc2VydmljZSByZXF1ZXN0ICovCi0jZW5kaWYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtdXN5Y2Nfc2Vydl9yZXEgKGNoLT51cCwgU1JfQ0hBTk5FTF9BQ1RJVkFURSB8IFNSX1RYX0RJUkVDVElPTiB8IGdjaGFuKTsKLSNpZmRlZiBSTERfVFJBTlNfREVCVUcKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMSB8fCBsb2dfbGV2ZWwgPj0gTE9HX01PTklUT1IpCi0jZWxzZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsb2dfbGV2ZWwgPj0gTE9HX01PTklUT1IpCi0jZW5kaWYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJfaW5mbygiKysgU0FDS1tQJWQvQyVkXSBhY2snZCwgY29udGludWluZy4uLlxuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaC0+dXAtPnBvcnRudW0sIGNoLT5jaGFubnVtKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLSNlbHNlCiAgICAgY2ktPndkX25vdGlmeSA9IDA7Ci0jZW5kaWYKLSNpZiAwCi0gICAgU0RfU0VNX0dJVkUgKCZjaS0+c2VtX3dkYnVzeSk7LyogcmVsZWFzZSBwZXItYm9hcmQgaG9sZCAqLwotI2VuZGlmCiB9CiAKIApAQCAtNjkwLDkgKzU1OCw3IEBACiAgICAgICAgIGZvciAocG9ydG51bSA9IDA7IHBvcnRudW0gPCBjaS0+bWF4X3BvcnQ7IHBvcnRudW0rKykKICAgICAgICAgewogICAgICAgICAgICAgcGkgPSAmY2ktPnBvcnRbcG9ydG51bV07Ci0jaWYgTElOVVhfVkVSU0lPTl9DT0RFID4gS0VSTkVMX1ZFUlNJT04oMiw1LDQxKQogICAgICAgICAgICAgYzRfd3FfcG9ydF9jbGVhbnVwIChwaSk7Ci0jZW5kaWYKICAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCBNVVNZQ0NfTkNIQU5TOyBqKyspCiAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgaWYgKHBpLT5jaGFuW2pdKQpAQCAtNzAwLDEwICs1NjYsNiBAQAogICAgICAgICAgICAgfQogICAgICAgICAgICAgT1Nfa2ZyZWUgKHBpLT5yZWdyYW1fc2F2ZWQpOwogICAgICAgICB9Ci0jaWYgMAotICAgICAgICAvKiBvYnNvbGV0Z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0gKyBFVkVOX0RNQV9TVEFSVCksIGJ1ZmZlcl9hZGRyKTsKLQl9Ci0gICAgICBlbHNlCi0JewotCSAgV3JpdGVNUmVnKChkdDMxNTVfbGJhc2VbbWlub3JdICsgRVZFTl9ETUFfU1RBUlQpLCBidWZmZXJfYWRkcik7Ci0KLQkgIFdyaXRlTVJlZygoZHQzMTU1X2xiYXNlW21pbm9yXSArIE9ERF9ETUFfU1RBUlQpLCBidWZmZXJfYWRkcgotCQkgICAgKyBkdDMxNTVfc3RhdHVzW21pbm9yXS5jb25maWcuY29scyk7Ci0JfQotCi0gICAgICAvKiBEbyBlcnJvciBjaGVja2luZyAqLwotICAgICAgaTJjX29kZF9jc3IuZmxkLkRPTkVfT0REID0gMTsKLSAgICAgIGlmIChpMmNfb2RkX2Nzci5mbGQuRVJST1JfT0REKQotCWR0MzE1NV9lcnJubyA9IERUX0VSUl9PVkVSUlVOOwotCi0gICAgICBXcml0ZUkyQyhkdDMxNTVfbGJhc2VbbWlub3JdLCBPRERfQ1NSLCBpMmNfb2RkX2Nzci5yZWcpOwotCi0gICAgICByZXR1cm47Ci0gICAgfQotICAvKiBJZiB3ZSBnZXQgaGVyZSwgdGhlIE9kZCBGaWVsZCB3YXNuJ3QgaXQgZWl0aGVyLi4uICovCi0gIHByaW50aygibmVpdGhlciBldmVuIG5vciBvZGQuICBzaGFyZWQgcGVyaGFwcz9cbiIpOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqIGluaXRfaXNyKGludCBtaW5vcikKLSAqICAgdHVybnMgb24gaW50ZXJ1cHQgZ2VuZXJhdGlvbiBmb3IgdGhlIGNhcmQKLSAqICAgZGVzaWduYXRlZCBieSAibWlub3IiLgotICogICBJdCBpcyBjYWxsZWQgKm9ubHkqIGZyb20gaW5zaWRlIGlvY3RsKCkuCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovC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IKLQotI2RlZmluZSBGT1VSX01CICAgICAgICAgKDB4MDQwMDAwMCkgIC8qIENhbid0IERNQSBhY2Nyb3NzIGEgNE1CIGJvdW5kYXJ5ISovCi0jZGVmaW5lIFVQUEVSXzEwX0JJVFMgICAoMHgzRkY8PDIyKSAgLyogQ2FuJ3QgRE1BIGFjY3Jvc3MgYSA0TUIgYm91bmRhcnkhKi8KLQotCi0vKiBQb2ludGVyIGludG8gZ2xvYmFsIHN0cnVjdHVyZSBmb3IgaGFuZGxpbmcgYnVmZmVycyAqLwotc3RydWN0IGR0MzE1NV9mYnVmZmVyICpkdDMxNTVfZmJ1ZmZlcltNQVhCT0FSRFNdID0ge05VTEwKLSNpZiBNQVhCT0FSRFMgPT0gMgotCQkJCQkJICAgICAgLCBOVUxMCi0jZW5kaWYKLX07Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqIFNpbXBsZSBhcnJheSBiYXNlZCBxdWUgc3RydWN0Ci0gKgotICogU29tZSBoYW5keSBmdW5jdGlvbnMgdXNpbmcgdGhlIGJ1ZmZlcmluZyBzdHJ1Y3R1cmUuCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogYXJlX2VtcHR5X2J1ZmZlcnMKLSAqIG0gaXMgbWlub3IgIyBvZiBkZXZpY2UKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1ib29sIGFyZV9lbXB0eV9idWZmZXJzKGludCBtKQotewotICByZXR1cm4gZHQzMTU1X2ZidWZmZXJbbV0tPmVtcHR5X2xlbjsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiBwdXNoX2VtcHR5Ci0gKiBtIGlzIG1pbm9yICMgb2YgZGV2aWNlCi0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ZmZlclttXS0+cmVhZHlfaGVhZCA9ICgoaGVhZCArIDEpICUKLQkJCQkgICAgICAoZHQzMTU1X2ZidWZmZXJbbV0tPm5idWZmZXJzKSk7Ci0gIGR0MzE1NV9mYnVmZmVyW21dLT5yZWFkeV9sZW4rKzsKLQotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqIGdldF90YWlsKCkKLSAqIG0gaXMgbWlub3IgIyBvZiBkZXZpY2UKLSAqCi0gKiBTaW1wbHkgY29tcHR1dGVzIHRoZSB0YWlsIGdpdmVuIHRoZSBoZWFkIGFuZCB0aGUgbGVuZ3RoLgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotc3RhdGljIGludCBnZXRfdGFpbChpbnQgbSkKLXsKLSAgcmV0dXJuIChkdDMxNTVfZmJ1ZmZlclttXS0+cmVhZHlfaGVhZCAtCi0JICAgZHQzMTU1X2ZidWZmZXJbbV0tPnJlYWR5X2xlbiArCi0JICAgZHQzMTU1X2ZidWZmZXJbbV0tPm5idWZmZXJzKSUKLQkgIChkdDMxNTVfZmJ1ZmZlclttXS0+bmJ1ZmZlcnMpOwotfQotCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiBwb3BfcmVhZHkoKQotICogbSBpcyBtaW5vciAjIG9mIGRldmljZQotICoKLSAqIFRoaXMgYXNzdW1lcyB0aGF0IHRoZXJlIGlzIGEgcmVhZHkgYnVmZmVyIHJlYWR5Li4uIHNob3VsZAotICogYmUgY2hlY2tlZCAoZS5nLiB3aXRoIGlzX3JlYWR5X2J1Zl9lbXB0eSgpICBwcmlvciB0byBjYWxsLgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotaW50IHBvcF9yZWFkeShpbnQgbSkKLXsKLSAgaW50IHRhaWw7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b2xsb3dpbmc6CitFWFRSQV9DRkxBR1MgKz0gLURFQVNZQ0FQX0lTX1ZJREVPREVWX0NMSUVOVAorRVhUUkFfQ0ZMQUdTICs9IC1ERUFTWUNBUF9ORUVEU19WNEwyX0RFVklDRV9ICitFWFRSQV9DRkxBR1MgKz0gLURFQVNZQ0FQX05FRURTX1Y0TDJfRk9QUworCmRpZmYgLS1naXQgYS9kcml2ZXJzL3N0YWdpbmcvZWFzeWNhcC9SRUFETUUgYi9kcml2ZXJzL3N0YWdpbmcvZWFzeWNhcC9SRUFETUUKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMzc3NTQ4MQotLS0gL2Rldi9udWxsCisrKyBiL2RyaXZlcnMvc3RhZ2luZy9lYXN5Y2FwL1JFQURNRQpAQCAtMCwwICsxLDEzMCBAQAorCisgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICogICBFYXN5Q0FQIFVTQiAyLjAgVmlkZW8gQWRhcHRlciB3aXRoIEF1ZGlvLCBNb2RlbCBEQzYwICAqCisgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5kICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgICAgICAgICogICAgICAgICAgICAgRWFzeUNBUDAwMiA0LUNoYW5uZWwgVVNCIDIuMCBEVlIgICAgICAgICAgICAqCisgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICBNaWtlIFRob21hcyAgPHJtdGhvbWFzQHNjaW9sdXMub3JnPgorCisKKworU1VQUE9SVEVEIEhBUkRXQVJFCistLS0tLS0tLS0tLS0tLS0tLS0KKworVGhpcyBkcml2ZXIgaXMgaW50ZW5kZWQgZm9yIHVzZSB3aXRoIGhhcmR3YXJlIGhhdmluZyBVU0IgSUQgMDVlMTowNDA4L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kVOQ0VTCistLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KK1RoaXMgZHJpdmVyIG1ha2VzIHVzZSBvZiBpbmZvcm1hdGlvbiBjb250YWluZWQgaW4gdGhlIFN5bnRlayBTZW1pY29uIERDLTExMjUKK0RyaXZlciwgcHJlc2VudGx5IG1haW50YWluZWQgYXQgaHR0cDovL3NvdXJjZWZvcmdlLm5ldC9wcm9qZWN0cy9zeW50ZWtkcml2ZXIvCitieSBOaWNvbGFzIFZpdmllbi4gIFBhcnRpY3VsYXJseSB1c2VmdWwgaGFzIGJlZW4gYSBwYXRjaCB0byB0aGUgbGF0dGVyIGRyaXZlcgorcHJvdmlkZWQgYnkgSXZvciBIZXdpdHQgaW4gSmFudWFyeSAyMDA5LiAgVGhlIE5UU0MgaW1wbGVtZW50YXRpb24gaXMgdGFrZW4KK2Zyb20gdGhlIHdvcmsgb2YgQmVuIFRyYXNrLgorCmRpZmYgLS1naXQgYS9kcml2ZXJzL3N0YWdpbmcvZWFzeWNhcC9lYXN5Y2FwLmggYi9kcml2ZXJzL3N0YWdpbmcvZWFzeWNhcC9lYXN5Y2FwLmgKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uYWQ4MzZkMgotLS0gL2Rldi9udWxsCisrKyBiL2RyaXZlcnMvc3RhZ2luZy9lYXN5Y2FwL2Vhc3ljYXAuaApAQCAtMCwwICsxLDY0MiBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyogIGVhc3ljYXAuaCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisvKgorICogIElNQUdFIFBST1BFUlRJRVMKKyAqLworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworX191MzIgICAgICAgICAgICAgICAgICAgcGl4ZWxmb3JtYXQ7CitfX3UzMiAgICAgICAgICAgICAgICAgICBmaWVsZDsKK2ludCAgICAgICAgICAgICAgICAgICAgIHdpZHRoOworaW50ICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OworaW50ICAgICAgICAgICAgICAgICAgICAgYnl0ZXNwZXJwaXhlbDsKK2Jvb2wgICAgICAgICAgICAgICAgICAgIGJ5dGVzd2Fwb3JkZXI7Citib29sICAgICAgICAgICAgICAgICAgICBkZWNpbWF0ZXBpeGVsOworYm9vbCAgICAgICAgICAgICAgICAgICAgb2ZmZXJmaWVsZHM7CitpbnQgICAgICAgICAgICAgICAgICAgICBmcmFtZV9idWZmZXJfdXNlZDsKK2ludCAgICAgICAgICAgICAgICAgICAgIGZyYW1lX2J1ZmZlcl9tYW55OworaW50ICAgICAgICAgICAgICAgICAgICAgdmlkZW9maWVsZGFtb3VudDsKKworaW50ICAgICAgICAgICAgICAgICAgICAgYnJpZ2h0bmVzczsKK2ludCAgICAgICAgICAgICAgICAgICAgIGNvbnRyYXN0OworaW50ICAgICAgICAgICAgICAgICAgICAgc2F0dXJhdGlvbjsKK2ludCAgICAgICAgICAgICAgICAgICAgIGh1ZTsKKworaW50IGFsbG9jYXRpb25fdmlkZW9fdXJiOworaW50IGFsbG9jYXRpb25fdmlkZW9fcGFnZTsKK2ludCBhbGxvY2F0aW9uX3ZpZGVvX3N0cnVjdDsKK2ludCByZWdpc3RlcmVkX3ZpZGVvOworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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FwICopOworaW50ICAgICAgICAgICAgICBmaWVsZDJmcmFtZShzdHJ1Y3QgZWFzeWNhcCAqKTsKK2ludCAgICAgICAgICAgICAgcmVkYXViKHN0cnVjdCBlYXN5Y2FwICosIHZvaWQgKiwgdm9pZCAqLCBcCisJCQkJCQlpbnQsIGludCwgX191OCwgX191OCwgYm9vbCk7Cit2b2lkICAgICAgICAgICAgIGRlYnJpZWYoc3RydWN0IGVhc3ljYXAgKik7Cit2b2lkICAgICAgICAgICAgIHNheXJlYWRvbmx5KHN0cnVjdCBlYXN5Y2FwICopOwordm9pZCAgICAgICAgICAgICBlYXN5Y2FwX3Rlc3RjYXJkKHN0cnVjdCBlYXN5Y2FwICosIGludCk7CitpbnQgICAgICAgICAgICAgIGV4cGxhaW5faW9jdGwoX191MzIpOworaW50ICAgICAgICAgICAgICBleHBsYWluX2NpZChfX3UzMik7CitpbnQgICAgICAgICAgICAgIGZpbGxpbl9mb3JtYXRzKHZvaWQpOworaW50ICAgICAgICAgICAgICBhZGp1c3Rfc3RhbmRhcmQoc3RydWN0IGVhc3ljYXAgKiwgdjRsMl9zdGRfaWQpOworaW50ICAgICAgICAgICAgICBhZGp1c3RfZm9ybWF0KHN0cnVjdCBlYXN5Y2FwICosIF9fdTMyLCBfX3UzMiwgX191MzIsIFwKKwkJCQkJCQkJaW50LCBib29sKTsKK2ludCAgICAgICAgICAgICAgYWRqdXN0X2JyaWdodG5lc3Moc3RydWN0IGVhc3ljYXAgKiwgaW50KTsKK2ludCAgICAgICAgICAgICAgYWRqdXN0X2NvbnRyYXN0KHN0cnVjdCBlYXN5Y2FwICosIGludCk7CitpbnQgICAgICAgICAgICAgIGFkanVzdF9zYXR1cmF0aW9uKHN0cnVjdCBlYXN5Y2FwICosIGludCk7CitpbnQgICAgICAgICAgICAgIGFkanVzdF9odWUoc3RydWN0IGVhc3ljYXAgKiwgaW50KTsKK2ludCAgICAgICAgICAgICAgYWRqdXN0X3ZvbHVtZShzdHJ1Y3QgZWFzeWNh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Y2hlY2tfc2FhKHN0cnVjdCB1c2JfZGV2aWNlICopOworaW50ICAgICAgICAgICAgICByZWFkeV9zYWEoc3RydWN0IHVzYl9kZXZpY2UgKik7CitpbnQgICAgICAgICAgICAgIG1lcml0X3NhYShzdHJ1Y3QgdXNiX2RldmljZSAqKTsKK2ludCAgICAgICAgICAgICAgY2hlY2tfdnQoc3RydWN0IHVzYl9kZXZpY2UgKik7CitpbnQgICAgICAgICAgICAgIHNlbGVjdF9pbnB1dChzdHJ1Y3QgdXNiX2RldmljZSAqLCBpbnQsIGludCk7CitpbnQgICAgICAgICAgICAgIHNldF9yZXNvbHV0aW9uKHN0cnVjdCB1c2JfZGV2aWNlICosIFwKKwkJCQkJCV9fdTE2LCBfX3UxNiwgX191MTYsIF9fdTE2KTsKKworaW50ICAgICAgICAgICAgICByZWFkX3NhYShzdHJ1Y3QgdXNiX2RldmljZSAqLCBfX3UxNik7CitpbnQgICAgICAgICAgICAgIHJlYWRfc3RrKHN0cnVjdCB1c2JfZGV2aWNlICosIF9fdTMyKTsKK2ludCAgICAgICAgICAgICAgd3JpdGVfc2FhKHN0cnVjdCB1c2JfZGV2aWNlICosIF9fdTE2LCBfX3UxNik7CitpbnQgICAgICAgICAgICAgIHdhaXRfaTJjKHN0cnVjdCB1c2JfZGV2aWNlICopOworaW50ICAgICAgICAgICAgICB3cml0ZV8wMDAoc3RydWN0IHVzYl9kZXZpY2UgKiwgX191MTYsIF9fdTE2KTsKK2ludCAgICAgICAgICAgICAgc3RhcnRfMTAwKHN0cnVjdCB1c2JfZGV2aWNlICopOworaW50ICAgICAgICAgICAgICBzdG9wXzEwMChzdHJ1Y3QgdXNiX2RldmljZSAqKTsKK2ludCAgICAgICAgICAgICAgd3JpdGVfMzAwKHN0cnVjdCB1c2JfZGV2aWNlICopOworaW50ICAgICAgICAgICAgICByZWFkX3Z0KHN0cnVjdCB1c2JfZGV2aWNlICosIF9fdTE2KTsKK2ludCAgICAgICAgICAgICAgd3JpdGVfdnQoc3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tIFkudHZfdXNlYykpCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKy8qCisgKiAgKHVuc2lnbmVkIGNoYXIgKilQICAgICAgICAgICBwb2ludGVyIHRvIG5leHQgYnl0ZSBwYWlyCisgKiAgICAgICAobG9uZyBpbnQgKilYICAgICAgICAgICBwb2ludGVyIHRvIGFjY3VtdWxhdGluZyBjb3VudAorICogICAgICAgKGxvbmcgaW50ICopWSAgICAgICAgICAgcG9pbnRlciB0byBhY2N1bXVsYXRpbmcgc3VtCisgKiAgKGxvbmcgbG9uZyBpbnQgKilaICAgICAgICAgICBwb2ludGVyIHRvIGFjY3VtdWxhdGluZyBzdW0gb2Ygc3F1YXJlcworICovCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisjZGVmaW5lIFNVTU1FUihQLCBYLCBZLCBaKSBkbyB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCXVuc2lnbmVkIGNoYXIgKnA7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCXVuc2lnbmVkIGludCB1MCwgdTEsIHUyOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCWxvbmcgaW50IHM7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCXAgPSAodW5zaWduZWQgY2hhciAqKShQKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCXUwID0gKHVuc2lnbmVkIGludCkgKCpwKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCXUxID0gKHVuc2lnbmVkIGludCkgKCoocCArIDEpKTsgICAgICAgICAgICAgICAgICAgICAgXAorCXUyID0gKHVuc2lnbmVkIGludCkgKCh1MSA8PCA4KSB8IHUwKTsgICAgICAgICAgICAgICAgXAorCWlmICgweDgwMDAgJiB1MikgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCQlzID0gLShsb25nIGludCkoMHg3RkZGICYgKH51MikpOyAgICAgICAgICAgICBcCisJZWxzZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJCXMgPSAgKGxvbmcgaW50KSgweDdGRkYgJiB1Mik7ICAgICAgICAgICAgICAgIFwKKwkqKChYKSkgKz0gKGxvbmcgaW50KSAxOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwkqKChZKSkgKz0gKGxvbmcgaW50KSBzOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwkqKChaKSkgKz0gKChsb25nIGxvbmcgaW50KShzKSAqIChsb25nIGxvbmcgaW50KShzKSk7IFwKK30gd2hpbGUgKDApCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisKKyNlbmRpZiAvKkVBU1lDQVBfSCovCmRpZmYgLS1naXQgYS9kcml2ZXJzL3N0YWdpbmcvZWFzeWNhcC9lYXN5Y2FwX2RlYnVnLmggYi9kcml2ZXJzL3N0YWdpbmcvZWFzeWNhcC9lYXN5Y2FwX2RlYnVnLmgKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMWQxMGQ3ZQotLS0gL2Rldi9udWxsCisrKyBiL2RyaXZlcnMvc3RhZ2luZy9lYXN5Y2FwL2Vhc3ljYXBfZGVidWcuaApAQCAtMCwwICsxLDI3IEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorKiAgZWFzeWNhcF9kZWJ1Zy5oICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyoKKyAqCisgKiAgQ29weXJpZ2h0IChDKSAyMDEwIFIuTS4gVGhvbWFzICA8cm10aG9tYXNAc2Npb2x1cy5vcmc+CisgKgorICoKKyAqICBUaGlzIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0IGFuZC9vciBtb2RpZnkKKyAqICBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGFzIHB1Ymxpc2hlZCBieQorICogIHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb247IGVpdGhlciB2ZXJzaW9uIDIgb2YgdGhlIExpY2Vuc2UsIG9yCisgKiAgKGF0IHlvdXIgb3B0aW9uKSBhbnkgbGF0ZXIgdmVyc2lvbi4KKyAqCisgKiAgVGhlIHNvZnR3YXJlIGlzIGRpc3RyaWJ1dGVkIGluIHRoZSBob3BlIHRoYXQgaXQgd2lsbCBiZSB1c2VmdWwsCisgKiAgYnV0IFdJVEhPVVQgQU5ZIFdBUlJBTlRZOyB3aXRob3V0IGV2ZW4gdGhlIGltcGxpZWQgd2FycmFudHkgb2YKKyAqICBNRVJDSEFOVEFCSUxJVFkgb3IgRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFSIFBVUlBPU0UuICBTZWUgdGhlCisgKiAgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgZm9yIG1vcmUgZGV0YWlscy4KKyAqCisgKiAgWW91IHNob3VsZCBoYXZlIHJlY2VpdmVkIGEgY29weSBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UKKyAqICBhbG9uZyB3aXRoIHRoaXMgc29mdHdhcmU7IGlmIG5vdCwgd3JpdGUgdG8gdGhlIEZyZWUgU29mdHdhcmUKKyAqICBGb3VuZGF0aW9uLCBJbmMuLCA1OSBUZW1wbGUgUGxhY2UsIFN1aXRlIDMzMCwgQm9zdG9uLCBNQSAgMDIxMTEtMTMwNyAgVVNBCisgKgorKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK2V4dGVybiBpbnQgZWFzeWNhcF9kZWJ1ZzsKZGlmZiAtLWdpdCBhL2RyaXZlcnMvc3RhZ2luZy9lYXN5Y2FwL2Vhc3ljYXBfaW9jdGwuYyBiL2RyaXZlcnMvc3RhZ2luZy9lYXN5Y2FwL2Vhc3ljYXBfaW9jdGwuYwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4yNzZiNjNkCi0tLSAvZGV2L251bGwKKysrIGIvZHJpdmVycy9zdGFnaW5nL2Vhc3ljYXAvZWFzeWNhcF9pb2N0bC5jCkBAIC0wLDAgKzEsMjY4NyBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorKiAgZWFzeWNhcF9pb2N0bC5jICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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YXNlIFNORENUTF9EU1BfU1RFUkVPOiB7CisJaW50IGluY29taW5nOworCUpPVCg4LCAiU05EQ1RMX0RTUF9TVEVSRU9cbiIpOworCWlmICgwICE9IGNvcHlfZnJvbV91c2VyKCZpbmNvbWluZywgKHZvaWQgX191c2VyICopYXJnLCBzaXplb2YoaW50KSkpCisJCXJldHVybiAtRUZBVUxUOworCUpPVCg4LCAiLi4uLi4uLi4uLi4gJWk9aW5jb21pbmdcbiIsIGluY29taW5nKTsKKworI2lmIGRlZmluZWQoVVBTQU1QTEUpCisJaWYgKHRydWUgPT0gcGVhc3ljYXAtPm1pY3JvcGhvbmUpCisJCWluY29taW5nID0gMTsKKwllbHNlCisJCWluY29taW5nID0gMTsKKyNlbHNlCisJaWYgKHRydWUgPT0gcGVhc3ljYXAtPm1pY3JvcGhvbmUpCisJCWluY29taW5nID0gMDsKKwllbHNlCisJCWluY29taW5nID0gMTsKKyNlbmRpZiAvKlVQU0FNUExFKi8KKworCWlmICgwICE9IGNvcHlfdG9fdXNlcigodm9pZCBfX3VzZXIgKilhcmcsICZpbmNvbWluZywgc2l6ZW9mKGludCkpKQorCQlyZXR1cm4gLUVGQVVMVDsKKwlicmVhazsKK30KK2Nhc2UgU05EQ1RMX0RTUF9TUEVFRDogeworCWludCBpbmNvbWluZzsKKwlKT1QoOCwgIlNORENUTF9EU1BfU1BFRURcbiIpOworCWlmICgwICE9IGNvcHlfZnJvbV91c2VyKCZpbmNvbWluZywgKHZvaWQgX191c2VyICopYXJnLCBzaXplb2YoaW50KSkpCisJCXJldHVybiAtRUZBVUxUOworCUpPVCg4LCAiLi4uLi4uLi4uLi4gJWk9aW5jb21pbmdcbiIsIGluY29taW5nKTsKKworI2lmIGRlZmluZWQoVVBTQU1QTEUpCisJaWYgKHRydWUgPT0gcGVhc3ljYXAtPm1pY3JvcGhvbmUpCisJCWluY29taW5nID0gMzIwMDA7CisJZWxzZQorCQlpbmNvbWluZyA9IDQ4MDAwOworI2Vsc2UKKwlpZiA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i0tLSAvZGV2L251bGwKKysrIGIvZHJpdmVycy9zdGFnaW5nL2Vhc3ljYXAvZWFzeWNhcF9pb2N0bC5oCkBAIC0wLDAgKzEsMjggQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisqICBlYXN5Y2FwX2lvY3RsLmggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKgorICoKKyAqICBDb3B5cmlnaHQgKEMpIDIwMTAgUi5NLiBUaG9tYXMgIDxybXRob21hc0BzY2lvbHVzLm9yZz4KKyAqCisgKgorICogIFRoaXMgaXMgZnJlZSBzb2Z0d2FyZTsgeW91IGNhbiByZWRpc3RyaWJ1dGUgaXQgYW5kL29yIG1vZGlmeQorICogIGl0IHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgYXMgcHVibGlzaGVkIGJ5CisgKiAgdGhlIEZyZWUgU29mdHdhcmUgRm91bmRhdGlvbjsgZWl0aGVyIHZlcnNpb24gMiBvZiB0aGUgTGljZW5zZSwgb3IKKyAqICAoYXQgeW91ciBvcHRpb24pIGFueSBsYXRlciB2ZXJzaW9uLgorICoKKyAqICBUaGUgc29mdHdhcmUgaXMgZGlzdHJpYnV0ZWQgaW4gdGhlIGhvcGUgdGhhdCBpdCB3aWxsIGJlIHVzZWZ1bCwKKyAqICBidXQgV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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorKiAgZWFzeWNhcF9sb3cuYyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKgorICoKKyAqICBDb3B5cmlnaHQgKEMpIDIwMTAgUi5NLiBUaG9tYXMgIDxybXRob21hc0BzY2lvbHVzLm9yZz4KKyAqCisgKgorICogIFRoaXMgaXMgZnJlZSBzb2Z0d2FyZTsgeW91IGNhbiByZWRpc3RyaWJ1dGUgaXQgYW5kL29yIG1vZGlmeQorICogIGl0IHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgYXMgcHVibGlzaGVkIGJ5CisgKiAgdGhlIEZyZWUgU29mdHdhcmUgRm91bmRhdGlvbjsgZWl0aGVyIHZlcnNpb24gMiBvZiB0aGUgTGljZW5zZSwgb3IKKyAqICAoYXQgeW91ciBvcHRpb24pIGFueSBsYXRlciB2ZXJzaW9uLgorICoKKyAqICBUaGUgc29mdHdhcmUgaXMgZGlzdHJpYnV0ZWQgaW4gdGhlIGhv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wkiMHglMDNYLCAweCUwM1gsICIgXAorCSIweCUwM1gsIDB4JTAzWFxuIiwgXAorCWdldDAsIGdldDEsIGdldDIsIGdldDMsIGdldDQsIGdldDUsIGdldDYsIGdldDcpOworSk9UKDgsICAiLi4uLmNmIFBBTF83MjB4NTI2OiAiIFwKKwkiMHglMDNYLCAweCUwM1gsICIgXAorCSIweCUwM1gsIDB4JTAzWCwgIiBcCisJIjB4JTAzWCwgMHglMDNYLCAiIFwKKwkiMHglMDNYLCAweCUwM1hcbiIsIFwKKwkweDAwMCwgMHgwMDAsIDB4MDAxLCAweDAwMCwgMHg1QTAsIDB4MDA1LCAweDEyMSwgMHgwMDEpOworSk9UKDgsICAiLi4uLmNmIFBBTF83MDR4NTI2OiAiIFwKKwkiMHglMDNYLCAweCUwM1gsICIgXAorCSIweCUwM1gsIDB4JTAzWCwgIiBcCisJIjB4JTAzWCwgMHglMDNYLCAiIFwKKwkiMHglMDNYLCAweCUwM1hcbiIsIFwKKwkweDAwNCwgMHgwMDAsIDB4MDAxLCAweDAwMCwgMHg1ODQsIDB4MDA1LCAweDEyMSwgMHgwMDEpOworSk9UKDgsICAiLi4uLmNmIFZHQV82NDB4NDgwOiAiIFwKKwkiMHglMDNYLCAweCUwM1gsICIgXAorCSIweCUwM1gsIDB4JTAzWCwgIiBcCisJIjB4JTAzWCwgMHglMDNYLCAiIFwKKwkiMHglMDNYLCAweCUwM1hcbiIsIFwKKwkweDAwOCwgMHgwMDAsIDB4MDIwLCAweDAwMCwgMHg1MDgsIDB4MDA1LCAweDExMCwgMHgwMDEpOworcmV0dXJuIDA7Cit9CisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK2ludAorY29uZmlybV9zdHJlYW0oc3RydWN0IHVzYl9kZXZpY2UgKnApCit7CitfX3UxNiBnZXQyOworX191OCBpZ290OworCitHRVQocCwgMHgwMTAwLCAmaWdvdCk7ICBnZXQyID0gMHg4MCAmIGlnb3Q7CitpZiAoMHg4MCA9PSBnZXQyKQorCUpPVCg4LCAiY29uZmlybV9zdHJlYW06ICBPS1xuIik7CitlbHNlCisJSk9UKDgsICJjb25maXJtX3N0cmVhbTogIFNUVUNLXG4iKTsKK3JldHVybiAwOworfQorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitpbnQKK3NldHVwX3N0ayhzdHJ1Y3QgdXNiX2RldmljZSAqcCkKK3sKK2ludCBpMDsKKworaTAgPSAwOword2hpbGUgKDB4RkZGICE9IHN0azExNjBjb25maWdbaTBdLnJlZykgeworCVNFVChwLCBzdGsxMTYwY29uZmlnW2kwXS5yZWcsIHN0azExNjBjb25maWdbaTBdLnNldCk7CisJaTArKzsKKwl9CisKK3dyaXRlXzMwMChwKTsKKworcmV0dXJuIDA7Cit9CisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK2ludAorc2V0dXBfc2FhKHN0cnVjdCB1c2JfZGV2aWNlICpwKQoreworaW50IGkwLCBpcjsKKworCitzZXQydG83OChwKTsKKworCitpMCA9IDA7Cit3aGlsZSAoMHhGRiAhPSBzYWE3MTEzY29uZmlnW2kwXS5yZWcpIHsKKwlpciA9IHdyaXRlX3NhYShwLCBzYWE3MTEzY29uZmlnW2kwXS5yZWcsIHNhYTcxMTNjb25maWdbaTBdLnNldCk7CisJaTArKzsKKwl9CityZXR1cm4gMDsKK30KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworaW50Cit3cml0ZV8wMDAoc3RydWN0IHVzYl9kZXZpY2UgKnAsIF9fdTE2IHNldDIsIF9fdTE2IHNldDApCit7CitfX3U4IGlnb3QwLCBpZ290MjsKKworR0VUKHAsIDB4MDAwMiwgJmlnb3QyKTsKK0dFVChwLCAweDAwMDAsICZpZ290MCk7CitTRVQocCwgMHgwMDAyLCBzZXQyKTsKK1NFVChwLCAweDAwMDAsIHNldDApOworcmV0dXJuIDA7Cit9CisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK2ludAord3JpdGVfc2FhKHN0cnVjdCB1c2JfZGV2aWNlICpwLCBfX3UxNiByZWcwLCBfX3UxNiBzZXQwKQoreworU0VUKHAsIDB4MjAwLCAweDAwKTsKK1NFVChwLCAweDIwNCwgcmVnMCk7CitTRVQocCwgMHgyMDUsIHNldDApOworU0VUKHAsIDB4MjAwLCAweDAxKTsKK3JldHVybiB3YWl0X2kyYyhwKTsKK30KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisvKgorICogIFJFR0lTVEVSIDUwMDogIFNFVFRJTkcgVkFMVUUgVE8gMHgwMDhCIFJFQURTIEZST00gVlQxNjEyQSAoPykKKyAqICBSRUdJU1RFUiA1MDA6ICBTRVRUSU5HIFZBTFVFIFRPIDB4MDA4QyBXUklURVMgVE8gIFZUMTYxMkEKKyAqICBSRUdJU1RFUiA1MDI6ICBMRUFTVCBTSUdOSUZJQ0FOVCBCWVRFIE9GIFZBTFVFIFRPIFNFVAorICogIFJFR0lTVEVSIDUwMzogIE1PU1QgU0lHTklGSUNBTlQgQllURSBPRiBWQUxVRSBUTyBTRVQKKyAqICBSRUdJU1RFUiA1MDQ6ICBUQVJHRVQgQUREUkVTUyBPTiBWVDE2MTJBCisgKi8KKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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HsKKwlpZiAoMHgwRiA9PSBzYWE3MTEzY29uZmlnW2kwXS5yZWcpIHsKKwkJaTArKzsgY29udGludWU7CisJfQorCisJaXIgPSByZWFkX3NhYShwLCBzYWE3MTEzY29uZmlnW2kwXS5yZWcpOworCWlmIChpciAhPSBzYWE3MTEzY29uZmlnW2kwXS5zZXQpIHsKKwkJU0FZKCJTQUEgcmVnaXN0ZXIgMHglMDJYIGhhcyAweCUwMlgsIGV4cGVjdGVkIDB4JTAyWFxuIiwgXAorCQkJc2FhNzExM2NvbmZpZ1tpMF0ucmVnLCBpciwgc2FhNzExM2NvbmZpZ1tpMF0uc2V0KTsKKwkJcmMtLTsKKwl9CisJaTArKzsKK30KK2lmICgtOCA+IHJjKQorCXJldHVybiByYzsKK2Vsc2UKKwlyZXR1cm4gMDsKK30KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworaW50CittZXJpdF9zYWEoc3RydWN0IHVzYl9kZXZpY2UgKnApCit7CitpbnQgcmM7CisKK3JjID0gcmVhZF9zYWEocCwgMHgxRik7CitpZiAoKDAgPiByYykgfHwgKDB4MDIgJiByYykpCisJcmV0dXJuIDEgOworZWxzZQorCXJldHVybiAwOworfQorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitpbnQKK3JlYWR5X3NhYShzdHJ1Y3QgdXNiX2RldmljZSAqcCkKK3sKK2ludCBqLCByYzsKK3N0YXRpYyBpbnQgbWF4ID0gMTA7CisKK2ogPSAwOword2hpbGUgKG1heCA+IGopIHsKKwlyYyA9IHJlYWRfc2FhKHAsIDB4MUYpOworCWlmICgwIDw9IHJjKSB7CisJCWlmICgoMSA9PSAoMHgwMSAmIHJjKSkmJigwID09ICgweDQwICYgcmMpKSkKKwkJCWJyZWFrOworCX0KKwltc2xlZXAoMTAwKTsgIGorKz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nJlZykgeworCQlpMCsrOyBjb250aW51ZTsKKwl9CisJaWYgKDB4MDAyID09IHN0azExNjBjb25maWdbaTBdLnJlZykgeworCQlpMCsrOyBjb250aW51ZTsKKwl9CisKKwlpciA9IHJlYWRfc3RrKHAsIHN0azExNjBjb25maWdbaTBdLnJlZyk7CisKKwlpZiAoMHgxMDAgPT0gc3RrMTE2MGNvbmZpZ1tpMF0ucmVnKSB7CisJCWlmICgoaXIgIT0gKDB4RkYgJiBzdGsxMTYwY29uZmlnW2kwXS5zZXQpKSAmJiBcCisJCQkoaXIgIT0gKDB4ODAgfCAoMHhGRiAmIHN0azExNjBjb25maWdbaTBdLnNldCkpKSAmJiBcCisJCQkJKDB4RkZGRiAhPSBzdGsxMTYwY29uZmlnW2kwXS5zZXQpKSB7CisJCQlTQVkoIlNUSyByZWdpc3RlciAweCUwM1ggaGFzIDB4JTAyWCwgIiBcCisJCQkJCSJleHBlY3RlZCAweCUwMlhcbiIsIFwKKwkJCQkJc3RrMTE2MGNvbmZpZ1tpMF0ucmVnLCBpciwgXAorCQkJCQlzdGsxMTYwY29uZmlnW2kwXS5zZXQpOworCQkJfQorCQlpMCsrOyBjb250aW51ZTsKKwkJfQorCisJaWYgKChpciAhPSAoMHhGRiAmIHN0azExNjBjb25maWdbaTBdLnNldCkpICYmIFwKKwkJCSgweEZGRkYgIT0gc3RrMTE2MGNvbmZpZ1tpMF0uc2V0KSkgeworCQlTQVkoIlNUSyByZWdpc3RlciAweCUwM1ggaGFzIDB4JTAyWCwgIiBcCisJCQkJCSJleHBlY3RlZCAweCUwMlhcbiIsIFwKKwkJCQkJc3RrMTE2MGNvbmZpZ1tpMF0ucmVnLCBpciwgXAorCQkJCQlzdGsxMTYwY29uZmlnW2kwXS5zZXQpOworCQl9CisJaTArKzsKKwl9CityZXR1cm4gMDsKK30KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworaW50CityZWFkX3NhYShzdHJ1Y3QgdXNiX2RldmljZSAqcCwgX191MTYgcmVnMCkKK3sKK19fdTggaWdvdDsKKworU0VUKHAsIDB4MjA4LCByZWcwKTsKK1NFVChwLCAweDIwMCwgMHgyMCk7CitpZiAoMCAhPSB3YWl0X2kyYyhwKSkKKwlyZXR1cm4gLTE7CitpZ290ID0gMDsKK0dFVChwLCAweDAyMDksICZpZ290KTsKK3JldHVybiBpZ290OworfQorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitpbnQKK3JlYWRfc3RrKHN0cnVjdCB1c2JfZGV2aWNlICpwLCBfX3UzMiByZWcwKQoreworX191OCBpZ290OworCitpZ290ID0gMDsKK0dFVChwLCByZWcwLCAmaWdvdCk7CityZXR1cm4gaWdvdDsKK30KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKy8qCisgKiAgICBIQVJEV0FSRSAgICBVU0VSU1BBQ0UgSU5QVVQgTlVNQkVSICAgUEhZU0lDQUwgSU5QVVQgICBEUklWRVIgaW5wdXQgVkFMVUUKKyAqCisgKiAgQ1ZCUytTLVZJREVPICAgICAgICAgICAwIG9yIDEgICAgICAgICAgICAgIENWQlMgICAgICAgICAgICAgICAgIDEKKyAqICAgRk9VUi1DVkJTICAgICAgICAgICAgIDAgb3IgMSAgICAgICAgICAgICAgQ1ZCUzEgICAgICAgICAgICAgICAgMQorICogICBGT1VSLUNWQlMgICAgICAgICAgICAgICAgMiAgICAgICAgICAgICAgICBDVkJTMiAgICAgICAgICAgICAgICAyCisgKiAgIEZPVVItQ1ZCUyAgICAgICAgICAgICAgICAzICAgICAgICAgICAgICAgIENWQlMzICAgICAgICAgICAgICAgIDMKKyAqICAgRk9VUi1DVkJTICAgICAgICAgICAgICAgIDQgICAgICAgICAgICAgICAgQ1ZCUzQgICAgICAgICAgICAgICAgNAorICogIENWQlMrUy1WSURFTyAgICAgICAgICAgICAgNSAgICAgICAgICAgICAgIFMtVklERU8gICAgICAgICAgICAgICA1CisgKgorICogIFdIRU4gNT09aW5wdXQgVEhFIEFSR1VNRU5UIG1vZGUgTVVTVCBBTFNPIEJFIFNVUFBMSUVEOgorICoKKyAqICAgICBtb2RlICA3ICAgPT4gR0FJTiBUTyBCRSBTRVQgRVhQTElDSVRMWSBVU0lORyBSRUdJU1RFUiAweDA1IChVTlRFU1RFRCkKKyAqICAgICBtb2RlICA5ICAgPT4gVVNFIEFVVE9NQVRJQyBHQUlOIENPTlRST0wgKERFRkFVTFQpCisgKgorKi8KKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KK2ludAorc2VsZWN0X2lucHV0KHN0cnVjdCB1c2JfZGV2aWNlICpwLCBpbnQgaW5wdXQsIGludCBtb2RlKQoreworCitzdG9wXzEwMChwKTsKKworbXNsZWVwKDIwKTsKK3N3aXRjaCAoaW5wdXQpIHsKK2Nhc2UgMDoKK2Nhc2UgMTogeworCVNFVChwLCAweDAwMDAsIDB4MDA5OCk7IGJyZWFrOworfQorY2FzZSAyOiB7CisJU0VUKHAsIDB4MDAwMCwgMHgwMDkwKTsgYnJlYWs7Cit9CitjYXNlIDM6IHsKKwlTRVQocCwgMHgwMDAwLCAweDAwODgpOyBicmVhazsKK30KK2Nhc2UgNDogeworCVNFVChwLCAweDAwMDAsIDB4MDA4MCk7IGJyZWFrOworfQorY2FzZSA1OiB7CisJaWYgKDkgIT0gbW9kZSkKKwkJbW9kZSA9IDc7CisJc3dpdGNoIChtb2RlKS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CisJfQorCWlmICgwICE9IHdyaXRlX3NhYShwLCAweDA5LCAweDgwKSkgeworCQlTQVkoIkVSUk9SOiBmYWlsZWQgdG8gc2V0IFNBQSByZWdpc3RlciAweDA5ICIgXAorCQkJCQkiZm9yIGlucHV0ICVpXG4iLCBpbnB1dCk7CisJfQorCWJyZWFrOworfQorZGVmYXVsdDoKKwl7CisJU0FZKCJFUlJPUjogIGJhZCBpbnB1dDogJWlcbiIsIGlucHV0KTsKKwlyZXR1cm4gLTE7Cit9Cit9Cittc2xlZXAoMjApOworU0VUKHAsIDB4MDAwMiwgMHgwMDkzKTsKK21zbGVlcCgyMCk7CisKK3N0YXJ0XzEwMChwKTsKKworcmV0dXJuIDA7Cit9CisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK2ludAorc2V0X3Jlc29sdXRpb24oc3RydWN0IHVzYl9kZXZpY2UgKnAsIFwKKwkJCQlfX3UxNiBzZXQwLCBfX3UxNiBzZXQxLCBfX3UxNiBzZXQyLCBfX3UxNiBzZXQzKQoreworX191MTYgdTB4MDExMSwgdTB4MDExMywgdTB4MDExNSwgdTB4MDExNzsKKwordTB4MDExMSA9ICgoMHhGRjAwICYgc2V0MCkgPj4gOCk7Cit1MHgwMTEzID0gKCgweEZGMDAgJiBzZXQxKSA+PiA4KTsKK3UweDAxMTUgPSAoKDB4RkYwMCAmIHNldDIpID4+IDgpOwordTB4MDExNyA9ICgoMHhGRjAwICYgc2V0MykgPj4gOCk7CisKK1NFVChwLCAweDAxMTAsICgweDAwRkYgJiBzZXQwKSk7CitTRVQocCwgMHgwMTExLCB1MHgwMTExKTsKK1NFVChwLCAweDAxMTIsICgweDAwRkYgJiBzZXQxKSk7CitTRVQocCwgMHgwMTEzLCB1MHgwMTEzKTsKK1NFVChwLCAweDAxMTQsICgweDAwRkYgJiBzZXQyKSk7CitTRVQocCwgMHgwMTE1LCB1MHgwMTE1KTsKK1NFVChwLCAweDAxMTYsICgweDAwRkYgJiBzZXQzKSk7CitTRVQocCwgMHgwMTE3LCB1MHgwMTE3KTsKKworcmV0dXJuIDA7Cit9CisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK2ludAorc3RhcnRfMTAwKHN0cnVjdCB1c2JfZGV2aWNlICpwKQoreworX191MTYgZ2V0MDsKK19fdTggaWdvdDsKKworR0VUKHAsIDB4MDEwMCwgJmlnb3QpOyAgZ2V0MCA9IGlnb3Q7Cittc2xlZXAoMHgxZjQpOworU0VUKHAsIDB4MDEwMCwgKDB4ODAgfCBnZXQwKSk7Cittc2xlZXAoMHgxZjQpOworcmV0dXJuIDA7Cit9CisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK2ludAorc3RvcF8xMDAoc3RydWN0IHVzYl9kZXZpY2UgKnApCit7CitfX3UxNiBnZXQwOworX191OCBpZ290OworCitHRVQocCwgMHgwMTAwLCAmaWdvdCk7ICBnZXQwID0gaWdvdDsKK21zbGVlcCgweDFmNCk7CitTRVQocCwgMHgwMTAwLCAoMHg3RiAmIGdldDApKTsKK21zbGVlcCgweDFmNCk7CityZXR1cm4gMDsKK30KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisvKgorICogIEZVTkNUSU9OIHdhaXRfaTJjKCkgUkVUVVJOUyAwIE9OIFNVQ0NFU1MKKyovCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KK2ludAord2FpdF9pMmMoc3RydWN0IHVzYl9kZXZpY2UgKnApCit7CitfX3UxNiBnZXQwOworX191OCBpZ290OworY29uc3QgaW50IG1heCA9IDQ7CitpbnQgazsKKworZm9yIChrID0gMDsgIGsgPCBtYXg7ICBrKyspIHsKKwlHRVQocCwgMHgwMjAxLCAmaWdvdCk7ICBnZXQwID0gaWdvdDsKKwlzd2l0Y2ggKGdldDApIHsKKwljYXNlIDB4MDQ6CisJY2FzZSAweDAxOiB7CisJCXJldHVybiAwOworCX0KKwljYXNlIDB4MDA6IHsKKwkJbXNsZWVwKDEwKTsKKwkJY29udGludWU7CisJfQorCWRlZmF1bHQ6IHsKKwkJcmV0dXJuIGdldDAgLSAxOworCX0KKwl9Cit9CityZXR1cm4gLTE7Cit9CisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK2ludAorcmVnc2V0KHN0cnVjdCB1c2JfZGV2aWNlICpwdXNiX2RldmljZSwgX191MTYgaW5kZXgsIF9fdTE2IHZhbHVlKQoreworX191MTYgaWdvdDsKK2ludCByYzAsIHJjMTsKKworaWYgKCFwdXNiX2RldmljZSkKKwlyZXR1cm4gLUVGQVVMVDsKKworcmMxID0gMDsgIGlnb3QgPSAwOworcmMwID0gdXNiX2NvbnRyb2xfbXNnKHB1c2JfZGV2aWNlLCB1c2Jfc25kY3RybHBpcGUocHVzYl9kZXZpY2UsIDApLCBcCisJCShfX3U4KTB4MDEsIFwKKwkJKF9fdTgpKFVTQl9ESVJfT1VUIHwgVVNCX1RZUEVfVkVORE9SIHwgVVNCX1JFQ0lQX0RFVklDRSksIFwKKwkJKF9fdTE2KXZhbHVlLCBcCisJCShfX3UxNilpbmRleCwgXAorCQkodm9pZCAqKU5VTEwsIFwKKwkJKF9fdTE2KTAsIFwKKwkJKGludCk1MDApOworCisjaWYgZGV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Cit9CitkZWZhdWx0OiB7CisJaWYgKHZhbHVlICE9IGlnb3QpIHsKKwkJSk9UKDgsICJ1bmV4cGVjdGVkIDB4JTAyWCAhPSAweCUwMlggIiBcCisJCQkJCSJmb3IgU1RLIHJlZ2lzdGVyIDB4JTAzWFxuIiwgXAorCQkJCQlpZ290LCB2YWx1ZSwgaW5kZXgpOworCX0KK2JyZWFrOworfQorfQorI2VuZGlmIC8qICEgTk9SRUFEQkFDSyovCisKK3JldHVybiAoMCA+IHJjMCkgPyByYzAgOiByYzE7Cit9CisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitpbnQKK3JlZ2dldChzdHJ1Y3QgdXNiX2RldmljZSAqcHVzYl9kZXZpY2UsIF9fdTE2IGluZGV4LCB2b2lkICpwdm9pZCkKK3sKK2ludCBpcjsKKworaWYgKCFwdXNiX2RldmljZSkKKwlyZXR1cm4gLUVGQVVMVDsKKworaXIgPSB1c2JfY29udHJvbF9tc2cocHVzYl9kZXZpY2UsIHVzYl9yY3ZjdHJscGlwZShwdXNiX2RldmljZSwgMCksIFwKKwkJKF9fdTgpMHgwMCwgXAorCQkoX191OCkoVVNCX0RJUl9JTiB8IFVTQl9UWVBFX1ZFTkRPUiB8IFVTQl9SRUNJUF9ERVZJQ0UpLCBcCisJCShfX3UxNikweDAwLCBcCisJCShfX3UxNilpbmRleCwgXAorCQkodm9pZCAqKXB2b2lkLCBcCisJCXNpemVvZihfX3U4KSwgXAorCQkoaW50KTUwMDAwKTsKK3JldHVybiAweEZGICYgaXI7Cit9CisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitpbnQKK3dha2V1cF9kZXZpY2Uoc3RydWN0IHVzYl9kZXZpY2UgKnB1c2JfZGV2aWNlKQoreworcmV0dXJuIHVzYl9jb250cm9sX21zZyhwdXN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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworCit3cml0ZV92dChwdXNiX2RldmljZSwgMHgwMDAyLCAweDgwMDApOword3JpdGVfdnQocHVzYl9kZXZpY2UsIDB4MDAxQywgMHg4MDAwKTsKKword3JpdGVfdnQocHVzYl9kZXZpY2UsIDB4MDAwRSwgMHgwMDAwKTsKK3dyaXRlX3Z0KHB1c2JfZGV2aWNlLCAweDAwMTAsIDB4MDAwMCk7Cit3cml0ZV92dChwdXNiX2RldmljZSwgMHgwMDEyLCAweDgwMDApOword3JpdGVfdnQocHVzYl9kZXZpY2UsIDB4MDAxNiwgMHgwMDAwKTsKKword3JpdGVfdnQocHVzYl9kZXZpY2UsIDB4MDAxQSwgMHgwNDA0KTsKK3dyaXRlX3Z0KHB1c2JfZGV2aWNlLCAweDAwMDIsIDB4MDAwMCk7Cit3cml0ZV92dChwdXNiX2RldmljZSwgMHgwMDFDLCAweDAwMDApOworCitjaGVja192dChwdXNiX2RldmljZSk7CisKK3JldHVybiAwOworfQorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworaW50CitjaGVja192dChzdHJ1Y3QgdXNiX2RldmljZSAqcHVzYl9kZXZpY2UpCit7CitpbnQgaWdvdDsKKworaWdvdCA9IHJlYWRfdnQocHVzYl9kZXZpY2UsIDB4MDAwMik7CitpZiAoMCA+IGlnb3QpCisJU0FZKCJFUlJPUjogZmFpbGVkIHRvIHJlYWQgVlQxNjEyQSByZWdpc3RlciAweDAyXG4iKTsKK2lmICgweDgwMDAgJiBpZ290KQorCVNBWSgicmVnaXN0ZXIgMHglMDJYIG11dGVkXG4iLCAweDAyKTsKKworaWdvdCA9IHJlYWRfdnQocHVzYl9kZXZpY2UsIDB4MDAwRSk7CitpZiAoMCA+IGlnb3QpCisJU0FZKCJFUlJPUjogZmFpbGVkIHRvIHJlY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Cit3cml0ZV92dChwdXNiX2RldmljZSwgMHgwMDAyLCAweDgwMDApOworCitpZ290ID0gcmVhZF92dChwdXNiX2RldmljZSwgMHgwMDFDKTsKK2lmICgwID4gaWdvdCkgeworCVNBWSgiRVJST1I6IGZhaWxlZCB0byByZWFkIFZUMTYxMkEgcmVnaXN0ZXIgMHgxQ1xuIik7CisJbXV0ZSA9IDB4MDAwMDsKK30gZWxzZQorCW11dGUgPSAweDgwMDAgJiAoKHVuc2lnbmVkIGludClpZ290KTsKKworSk9UKDgsICIweCUwNFg9KG11dGV8dTh8KHU4PDw4KSlcbiIsIG11dGUgfCB1OCB8ICh1OCA8PCA4KSk7CisKK3dyaXRlX3Z0KHB1c2JfZGV2aWNlLCAweDAwMUMsIDB4ODAwMCk7Cit3cml0ZV92dChwdXNiX2RldmljZSwgMHgwMDFDLCAobXV0ZSB8IHU4IHwgKHU4IDw8IDgpKSk7Cit3cml0ZV92dChwdXNiX2RldmljZSwgMHgwMDAyLCAweDAwMDApOworCityZXR1cm4gMDsKK30KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK2ludAorYXVkaW9fZ2FpbmdldChzdHJ1Y3QgdXNiX2RldmljZSAqcHVzYl9kZXZpY2UpCit7CitpbnQgaWdvdDsKKworaWdvdCA9IHJlYWRfdnQocHVzYl9kZXZpY2UsIDB4MDAxQyk7CitpZiAoMCA+IGlnb3QpCisJU0FZKCJFUlJPUjogZmFpbGVkIHRvIHJlYWQgVlQxNjEyQSByZWdpc3RlciAweDFDXG4iKTsKK3JldHVybiBpZ290OworfQorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworaW50CitzZXQydG83OChzdHJ1Y3QgdXNiX2RldmljZSAqcCkKK3sKK2ludCBpcjsKKworbXNsZWVwKDIwKTsKK2lyID0gcmVnc2V0KHAsIDB4MDAwMiwgMHgwMDc4KTsKK2lmICgwID4gaXIpCisJU0FZKCJFUlJPUjogZmFpbGVkIHRvIHNldCByZWdpc3RlciAweDAwMDIgdG8gMHgwMDc4XG4iKTsKK21zbGVlcCgyMCk7CityZXR1cm4gaXI7Cit9CisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitpbnQKK3NldDJ0bzkzKHN0cnVjdCB1c2JfZGV2aWNlICpwKQoreworaW50IGlyOworCittc2xlZXAoMjApOworaXIgPSByZWdzZXQocCwgMHgwMDAyLCAweDAwOTMpOworaWYgKDAgPiBpcikKKwlTQVkoIkVSUk9SOiBmYWlsZWQgdG8gc2V0IHJlZ2lzdGVyIDB4MDAwMiB0byAweDAwNzhcbiIpOworbXNsZWVwKDIwKTsKK3JldHVybiBpcjsKK30KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KZGlmZiAtLWdpdCBhL2RyaXZlcnMvc3RhZ2luZy9lYXN5Y2FwL2Vhc3ljYXBfbWFpbi5jIGIvZHJpdmVycy9zdGFnaW5nL2Vhc3ljYXAvZWFzeWNhcF9tYWluLmMKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMDljMTk0YwotLS0gL2Rldi9udWxsCisrKyBiL2RyaXZlcnMvc3RhZ2luZy9lYXN5Y2FwL2Vhc3ljYXBfbWFpbi5jCkBAIC0wLDAgKzEsNDM1NCBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorKiAgZWFzeWNhcF9tYWluLmMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorKiAgVmlkZW8gZHJpdmVyIGZvciBFYXN5Q0FQIFVTQjIuMCBWaWRlbyBDYXB0dXJlIERldmljZSBEQzYwICAgICAgICAgICAgICAgICAgKgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyoKKyAqCisgKiAgQ29weXJpZ2h0IChDKSAyMDEwIFIuTS4gVGhvbWFzIDxybXRob21hc0BzY2lvbHVzLm9yZz4KKyAqCisgKgorICogIFRoaXMgaXMgZnJlZSBzb2Z0d2FyZTsgeW91IGNhbiByZWRpc3RyaWJ1dGUgaXQgYW5kL29yIG1vZGlmeQorICogIGl0IHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgYXMgcHVibGlzaGVkIGJ5CisgKiAgdGhlIEZyZWUgU29mdHdhcmUgRm91bmRhdGlvbjsgZWl0aGVyIHZlcnNpb24gMiBvZiB0aGUgTGljZW5zZSwgb3IKKyAqICAoYXQgeW91ciBvcHRpb24pIGFueSBsYXRlciB2ZXJzaW9uLgorICoKKyAqICBUaGUgc29mdHdhcmUgaXMgZGlzdHJpYnV0ZWQgaW4gdGhlIGhvcGUgdGhhdCBpdCB3aWxsIGJlIHVzZWZ1bCwKKyAqICBidXQgV0lUSE9VVCBBTlkgV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PSByYykgeworCQlTQVkoIkVSUk9SOiB3aGlsZSAlaT12aWRlb19pZGxlLCB1c2Jfc3VibWl0X3VyYigpIGZhaWxlZCAiIFwKKwkJCQkJIndpdGggcmM6XG4iLCBwZWFzeWNhcC0+dmlkZW9faWRsZSk7CisJCXN3aXRjaCAocmMpIHsKKwkJY2FzZSAtRU5PTUVNOiB7CisJCQlTQVkoIkVOT01FTVxuIik7IGJyZWFrOworCQl9CisJCWNhc2UgLUVOT0RFVjogeworCQkJU0FZKCJFTk9ERVZcbiIpOyBicmVhazsKKwkJfQorCQljYXNlIC1FTlhJTzogeworCQkJU0FZKCJFTlhJT1xuIik7IGJyZWFrOworCQl9CisJCWNhc2UgLUVJTlZBTDogeworCQkJU0FZKCJFSU5WQUxcbiIpOyBicmVhazsKKwkJfQorCQljYXNlIC1FQUdBSU46IHsKKwkJCVNBWSgiRUFHQUlOXG4iKTsgYnJlYWs7CisJCX0KKwkJY2FzZSAtRUZCSUc6IHsKKwkJCVNBWSgiRUZCSUdcbiIpOyBicmVhazsKKwkJfQorCQljYXNlIC1FUElQRTogeworCQkJU0FZKCJFUElQRVxuIik7IGJyZWFrOworCQl9CisJCWNhc2UgLUVNU0dTSVpFOiB7CisJCQlTQVkoIkVNU0dTSVpFXG4iKTsgIGJyZWFrOworCQl9CisJCWNhc2UgLUVOT1NQQzogeworCQkJU0FZKCJFTk9TUENcbiIpOyBicmVhazsKKwkJfQorCQlkZWZhdWx0OiB7CisJCQlTQVkoIjB4JTA4WFxuIiwgcmMpOyBicmVhazsKKwkJfQorCQl9CisJfQorfQorcmV0dXJuOworfQorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworLyoKKyAqCisgKi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oZWFzeWNhcF9tb2R1bGVfZXhpdCk7CisKK01PRFVMRV9MSUNFTlNFKCJHUEwiKTsKK01PRFVMRV9BVVRIT1IoIlIuTS4gVGhvbWFzIDxybXRob21hc0BzY2lvbHVzLm9yZz4iKTsKK01PRFVMRV9ERVNDUklQVElPTihFQVNZQ0FQX0RSSVZFUl9ERVNDUklQVElPTik7CitNT0RVTEVfVkVSU0lPTihFQVNZQ0FQX0RSSVZFUl9WRVJTSU9OKTsKKyNpZiBkZWZpbmVkKEVBU1lDQVBfREVCVUcpCitNT0RVTEVfUEFSTV9ERVNDKGVhc3ljYXBfZGVidWcsICJkZWJ1ZzogMCAoZGVmYXVsdCksIDEsIDIsLi4uIik7CisjZW5kaWYgLypFQVNZQ0FQX0RFQlVHKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KZGlmZiAtLWdpdCBhL2RyaXZlcnMvc3RhZ2luZy9lYXN5Y2FwL2Vhc3ljYXBfc2V0dGluZ3MuYyBiL2RyaXZlcnMvc3RhZ2luZy9lYXN5Y2FwL2Vhc3ljYXBfc2V0dGluZ3MuYwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zOGQ5NDA1Ci0tLSAvZGV2L251bGwKKysrIGIvZHJpdmVycy9zdGFnaW5nL2Vhc3ljYXAvZWFzeWNhcF9zZXR0aW5ncy5jCkBAIC0wLDAgKzEsNDg5IEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisqICBlYXN5Y2FwX3NldHRpbmdzLmMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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Y2FwX3NvdW5kLmMgYi9kcml2ZXJzL3N0YWdpbmcvZWFzeWNhcC9lYXN5Y2FwX3NvdW5kLmMKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uNjM1NjJiZAotLS0gL2Rldi9udWxsCisrKyBiL2RyaXZlcnMvc3RhZ2luZy9lYXN5Y2FwL2Vhc3ljYXBfc291bmQuYwpAQCAtMCwwICsxLDEwNDYgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyogIGVhc3ljYXBfc291bmQuYyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyogIEF1ZGlvIGRyaXZlciBmb3IgRWFzeUNBUCBVU0IyLjAgVmlkZW8gQ2FwdHVyZSBEZXZpY2UgREM2MCAgICAgICAgICAgICAgICAgICoKKyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qCisgKgorICogIENvcHlyaWdodCAoQykgMjAxMCBSLk0uIFRob21hcyAgPHJtdGhvbWFzQHNjaW9sdXMub3JnPgorICoKKyAqCisgKiAgVGhpcyBpcyBmcmVlIHNvZ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0YV9idWZmZXIgKnBkYXRhX2J1ZmZlcjsKK3NpemVfdCBzenJldDsKKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworLyoKKyAqICBETyBBIEJMT0NLSU5HIFJFQUQgVE8gVFJBTlNGRVIgREFUQSBUTyBVU0VSIFNQQUNFLgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqKioqKiAgTi5CLiAgSUYgVEhJUyBGVU5DVElPTiBSRVRVUk5TIDAsIE5PVEhJTkcgSVMgU0VFTiBJTiBVU0VSIFNQQUNFLiAqKioqKioKKyAqKioqKiAgICAgICAgVEhJUyBDT05ESVRJT04gU0lHTklGSUVTIEVORC1PRi1GSUxFLiAgICAgICAgICAgICAgICAgICAgICAqKioqKioKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqLworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworCitKT1QoOCwgIj09PT09IGVhc3lzbmRfcmVhZCgpOiBrb3VudD0laSwgKnBvZmY9JWlcbiIsIChpbnQpa291bnQsIChpbnQpKCpwb2ZmKSk7CisKK3BlYXN5Y2FwID0gKHN0cnVjdCBlYXN5Y2FwICopKGZpbGUtPnByaXZhdGVfZGF0YSk7CitpZiAoTlVMTCA9PSBwZWFzeWNhcCkgeworCVNBWSgiRVJST1IgaW4gZWFzeXNuZF9yZWFkKCk6IHBlYXN5Y2FwIGlzIE5VTExcbiIpOworCXJldHVybiAtRUZBVUxUOworfQorLyotLS0tLS0tLS0tLS0tLS0t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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCmRpZmYgLS1naXQgYS9kcml2ZXJzL3N0YWdpbmcvZWFzeWNhcC9lYXN5Y2FwX3NvdW5kLmggYi9kcml2ZXJzL3N0YWdpbmcvZWFzeWNhcC9lYXN5Y2FwX3NvdW5kLmgKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uNDkxMjczOQotLS0gL2Rldi9udWxsCisrKyBiL2RyaXZlcnMvc3RhZ2luZy9lYXN5Y2FwL2Vhc3ljYXBfc291bmQuaApAQCAtMCwwICsxLDI4IEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorKiAgZWFzeWNhcF9zb3VuZC5oICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyoKKyAqCisgKiAgQ29weXJpZ2h0IChDKSAyMDEwIFIuTS4gVGhvbWFzICA8cm10aG9tYXNAc2Npb2x1cy5vcmc+CisgKgorICoKKyAqICBUaGlzIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0IGFuZC9vciBtb2RpZnkKKyAqICBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGFzIHB1Ymxpc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GFuZGFyZC5oIGIvZHJpdmVycy9zdGFnaW5nL2Vhc3ljYXAvZWFzeWNhcF9zdGFuZGFyZC5oCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmNhZGM4ZDIKLS0tIC9kZXYvbnVsbAorKysgYi9kcml2ZXJzL3N0YWdpbmcvZWFzeWNhcC9lYXN5Y2FwX3N0YW5kYXJkLmgKQEAgLTAsMCArMSwyNyBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyogIGVhc3ljYXBfc3RhbmRhcmQuaCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qCisgKgorICogIENvcHlyaWdodCAoQykgMjAxMCBSLk0uIFRob21hcyAgPHJtdGhvbWFzQHNjaW9sdXMub3JnPgorICoKKyAqCisgKiAgVGhpcyBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IgbW9kaWZ5CisgKiAgaXQgdW5kZXIgdGhlIHRlcm1zIG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBhcyBwdWJsaXNoZWQgYnkKKyAqICB0aGUgRnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uOyBlaXRoZXIgdmVyc2lvbiAyIG9mIHRoZSBMaWNlbnNlLCBvcgorICogIChhdCB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ysgYi9kcml2ZXJzL3N0YWdpbmcvZWFzeWNhcC9lYXN5Y2FwX3Rlc3RjYXJkLmMKQEAgLTAsMCArMSwzOTIgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyogIGVhc3ljYXBfdGVzdGNhcmQuYyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qCisgKgorICogIENvcHlyaWdodCAoQykgMjAxMCBSLk0uIFRob21hcyAgPHJtdGhvbWFzQHNjaW9sdXMub3JnPgorICoKKyAqCisgKiAgVGhpcyBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IgbW9kaWZ5CisgKiAgaXQgdW5kZXIgdGhlIHRlcm1zIG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBhcyBwdWJsaXNoZWQgYnkKKyAqICB0aGUgRnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uOyBlaXRoZXIgdmVyc2lvbiAyIG9mIHRoZSBMaWNlbnNlLCBvcgorICogIChhdCB5b3VyIG9wdGlvbikgYW55IGxhdGVyIHZlcnNpb24uCisgKgorICogIFRoZSBzb2Z0d2FyZSBpcyBkaXN0cmlidXRlZCBpbiB0aGUgaG9wZSB0aGF0IGl0IHdpbGwgYmUgdXNlZnVsLAorICogIGJ1dCBX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AgICAgICAgICAgcmV0dXJuIEZBTFNFOwogICAgICAgICB9CiAKQEAgLTI2MCwxMCArMjU3LDEwIEBACiAgICAgICAgIGNvbnN0IFRBQkxFIGZpcnN0ZXAgPSB7IDAsIDQsIDggfTsKICAgICAgICAgdTMyX3QgbGV2ZWwgPSBwYXJhbTsKIAotICAgICAgICBpZiAobGV2ZWwgPj0gTihmaXJzdGVwKSkKKyAgICAgICAgaWYgKGxldmVsID49IEFSUkFZX1NJWkUoZmlyc3RlcCkpCiAgICAgICAgIHsKICAgICAgICAgICAgIHptX2RlYnVnX21zZzEoImxldmVsIG91dCBvZiByYW5nZSwgZGVzaXJlZCBsZXZlbCA6ICIsIGxldmVsKTsKLSAgICAgICAgICAgIHptX2RlYnVnX21zZzEoIm1heCBsZXZlbCA6ICIsIE4oZmlyc3RlcCkpOworICAgICAgICAgICAgem1fZGVidWdfbXNnMSgibWF4IGxldmVsIDogIiwgQVJSQVlfU0laRShmaXJzdGVwKSk7CiAgICAgICAgICAgICByZXR1cm4gRkFMU0U7CiAgICAgICAgIH0KICAgICAgICAgemZEZWxheVdyaXRlSW50ZXJuYWxSZWcoZGV2LCBBUl9QSFlfRklORF9TSUcsCkBAIC0yODMsMTAgKzI4MCwxMCBAQAogICAgICAgICBjb25zdCBUQUJMRSBjeWNwd3JUaHIxID0geyAyLCA0LCA2LCA4LCAxMCwgMTIsIDE0LCAxNiB9OwogICAgICAgICB1MzJfdCBsZXZlbCA9IHBhcmFtOwogCi0gICAgICAgIGlmIChsZXZlbCA+PSBOKGN5Y3B3clRocjEpKQorICAgICAgICBpZiAobGV2ZWwgPj0gQVJSQVlfU0laRShjeWNwd3JUaHIxKSkKICAgICAgICAgewogICAgICAgICAgICAgem1fZGVidWdfbXNnMSgibGV2ZWwgb3V0IG9mIHJhbmdlLCBkZXNpcmVkIGxldmVsIDogIiwgbGV2ZWwpOwotICAgICAgICAgICAgem1fZGVidWdfbXNnMSgibWF4IGxldmVsIDogIiwgTihjeWNwd3JUa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VyYi0+c3RhdHVzICE9IC1FTk9FTlQpICYmICh1cmItPnN0YXR1cyAhPSAtRUNPTk5SRVNFVCkKLSAgICAgICAgICAgICYmICh1cmItPnN0YXR1cyAhPSAtRVNIVVRET1dOKSkKLSAgICAgICAgewotICAgICAgICAgICAgICAgIGlmICh1cmItPnN0YXR1cyA9PSAtRVBJUEUpewotICAgICAgICAgICAgICAgICAgICAvL3ByaW50ayhLRVJOX0VSUiAibm9uemVybyByZWFkIGJ1bGsgc3RhdHVzIHJlY2VpdmVkOiAtRVBJUEUiKTsKLSAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gLTE7Ci0gICAgICAgICAgICAgICAgfQorICAgIGlmICh1cmItPnN0YXR1cyAhPSAwKSB7CisJcHJpbnRrKCJ6ZkxueFVzYkRhdGFJbl9jYWxsYmFjaygpIDogc3RhdHVzPTB4JXhcbiIsIHVyYi0+c3RhdHVzKTsKKwlpZiAoKHVyYi0+c3RhdHVzICE9IC1FTk9FTlQpICYmICh1cmItPnN0YXR1cyAhPSAtRUNPTk5SRVNFVCkKKwkJJiYgKHVyYi0+c3RhdHVzICE9IC1FU0hVVERPV04pKSB7CisJCWlmICh1cmItPnN0YXR1cyA9PSAtRVBJUEUpIHsKKwkJCS8qcHJpbnRrKEtFUk5fRVJSICJub256ZXJvIHJlYWQgYnVsayBzdGF0dXMgcmVjZWl2ZWQ6IC1FUElQRSIpOyovCisJCQlzdGF0dXMgPSAtMTsKKwkJfQogCi0gICAgICAgICAgICAgICAgaWYgKHVyYi0+c3RhdHVzID09IC1FUFJPVE8pewotICAgICAgICAgICAgICAgICAgICAvL3ByaW50ayhLRVJOX0VSUiAibm9uemVybyByZWFkIGJ1bGsgc3RhdHVzIHJlY2VpdmVkOiAtRVBST1RPIik7Ci0gICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IC0xOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgfQorCQlpZiAodXJiLT5zdGF0dXMgPT0gLUVQUk9UTykgeworCQ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nRrKCJHZXQgYSBwYWNrZXQsIGluZGV4OiAlZCwgcGt0X2xlbjogMHglMDR4XG4iLCBpbmRleCwgcGt0X2xlbik7Ci0gICAgICAgICAgICAjaWYgMAotICAgICAgICAgICAgLyogRHVtcCBkYXRhICovCi0gICAgICAgICAgICBmb3IgKGlpID0gaW5kZXg7IGlpIDwgcGt0X2xlbis0OykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwcmludGsoIiUwMnggIiwgKGJ1Zi0+ZGF0YVtpaV0gJiAweGZmKSk7CisJCS8qcHJpbnRrKCJHZXQgYSBwYWNrZXQsIGluZGV4OiAlZCwgcGt0X2xlbjogMHglMDR4XG4iLCBpbmRleCwgcGt0X2xlbik7Ki8KKwkJI2lmIDAKKwkJLyogRHVtcCBkYXRhICovCisJCWZvciAoaWkgPSBpbmRleDsgaWkgPCBwa3RfbGVuKzQ7KSB7CisJCQlwcmludGsoIiUwMnggIiwgKGJ1Zi0+ZGF0YVtpaV0gJiAweGZmKSk7CiAKLSAgICAgICAgICAgICAgICBpZiAoKCsraWkgJSAxNikgPT0gMCkKLSAgICAgICAgICAgICAgICAgICAgcHJpbnRrKCJcbiIpOwotICAgICAgICAgICAgfQorCQkJaWYgKCgrK2lpICUgMTYpID09IDApCisJCQlwcmludGsoIlxuIik7CisJCQl9CiAKLSAgICAgICAgICAgIHByaW50aygiXG4iKTsKLSAgICAgICAgICAgICNlbmRpZgorCQkJcHJpbnRrKCJcbiIpOworCQkjZW5kaWYKIAotICAgICAgICAgICAgcGFkX2xlbiA9IDQgLSAocGt0X2xlbiAmIDB4Myk7CisJCXBhZF9sZW4gPSA0IC0gKHBrdF9sZW4gJiAweDMpOwogCi0gICAgICAgICAgICBpZihwYWRfbGVuID09IDQpCi0gICAgICAgICAgICAgICAgcGFkX2xlbiA9IDA7CisJCWlmIChwYWRfbGVuID09IDQpCisJCXBhZF9sZW4gPSAwOwogCi0gICAgICAgICAgICBjaGtfaWR4ID0gaW5kZXg7Ci0g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gcG9pbnRlciAqLwotICAgICAgICAgICAgICAgIG1hY3AtPnJlYW1pbl9idWYgPSBuZXdfYnVmOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAjaWZkZWYgWk1fRE9OVF9DT1BZX1JYX0JVRkZFUgotICAgICAgICAgICAgICAgIGlmIChyeEJ1ZlBvb2xJbmRleCA9PSAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgbmV3X2J1ZiA9IHNrYl9jbG9uZShidWYsIEdGUF9BVE9NSUMpOworCQkJLyogUmVjb3JkIHRoZSBidWZmZXIgcG9pbnRlciAqLworCQkJbWFjcC0+cmVhbWluX2J1ZiA9IG5ld19idWY7CisJCX0gZWxzZSAgeworCQkJI2lmZGVmIFpNX0RPTlRfQ09QWV9SWF9CVUZGRVIKKwkJCWlmIChyeEJ1ZlBvb2xJbmRleCA9PSAwKSB7CisJCQkJbmV3X2J1ZiA9IHNrYl9jbG9uZShidWYsIEdGUF9BVE9NSUMpOwogCi0gICAgICAgICAgICAgICAgICAgIG5ld19idWYtPmRhdGEgPSAmKGJ1Zi0+ZGF0YVtjaGtfaWR4KzRdKTsKLSAgICAgICAgICAgICAgICAgICAgbmV3X2J1Zi0+bGVuID0gcGt0X2xlbjsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgI2VuZGlmCi0gICAgICAgICAgICAgICAgLyogQWxsb2NhdGUgYSBza2IgYnVmZmVyICovCi0gICAgICAgICAgICAgICAgbmV3X2J1ZiA9IGRldl9hbGxvY19za2IoWk1fTUFYX1JYX0JVRkZFUl9TSVpFKTsKKwkJCQluZXdfYnVmLT5kYXRhID0gJihidWYtPmRhdGFbY2hrX2lkeCs0XSk7CisJCQkJbmV3X2J1Zi0+bGVuID0gcGt0X2xlbjsKKwkJCX0gZWxzZSAgeworCQkJCSNlbmRpZgorCQkJC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b250ZXh0OworICAgIC8qZGV2X3QqIGRldiA9IHVyYi0+Y29udGV4dDsqLwogCi0gICAgLy9wcmludGsoS0VSTl9FUlIgInpmd1VzYlJlZ091dF9jYWxsYmFja1xuIik7CisJLypwcmludGsoS0VSTl9FUlIgInpmd1VzYlJlZ091dF9jYWxsYmFja1xuIik7Ki8KIH0KIAogdm9pZCB6ZkxueFVzYlJlZ0luX2NhbGxiYWNrKHVyYl90ICp1cmIpCiB7Ci0gICAgemRldl90KiBkZXYgPSB1cmItPmNvbnRleHQ7CisgICAgemRldl90ICpkZXYgPSB1cmItPmNvbnRleHQ7CiAgICAgdTMyX3QgcnNwWzY0LzRdOwogICAgIGludCBzdGF0dXM7CiAgICAgc3RydWN0IHVzYmRydl9wcml2YXRlICptYWNwID0gZGV2LT5tbF9wcml2OwogCiAgICAgLyogQ2hlY2sgc3RhdHVzIGZvciBVUkIgKi8KLSAgICBpZiAodXJiLT5zdGF0dXMgIT0gMCl7Ci0gICAgICAgIHByaW50aygiemZMbnhVc2JSZWdJbl9jYWxsYmFjaygpIDogc3RhdHVzPTB4JXhcbiIsIHVyYi0+c3RhdHVzKTsKLSAgICAgICAgaWYgKCh1cmItPnN0YXR1cyAhPSAtRU5PRU5UKSAmJiAodXJiLT5zdGF0dXMgIT0gLUVDT05OUkVTRVQpCi0gICAgICAgICAgICAmJiAodXJiLT5zdGF0dXMgIT0gLUVTSFVURE9XTikpCi0gICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAodXJiLT5zdGF0dXMgPT0gLUVQSVBFKXsKLSAgICAgICAgICAgICAgICAgICAgLy9wcmludGsoS0VSTl9FUlIgIm5vbnplcm8gcmVhZCBidWxrIHN0YXR1cyByZWNlaXZlZDogLUVQSVBFIik7Ci0gICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IC0xOwotICAgICAgICAgICAgICAgIH0KKyAgICBpZiAodXJiLT5zdGF0dXMgIT0gMCkgeworCXByaW50aygiemZMbnhVc2JSZWdJbl9jYW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YgKGkgJSAxNiA9PSAxNSkKKwkJcHJpbnRrKCJcbiIpOworCQl9CisJCXByaW50aygiXG4iKTsKKwl9CiAgICAgI2VuZGlmCiAgICAgI2lmIDAKICAgICAvKiBGb3IgZGVidWcgcHVycG9zZSAqLwotICAgIGlmKFR4RGF0YS0+aGRyWzldICYgMHg0MCkKLSAgICB7Ci0gICAgICAgIGludCBpOwotICAgICAgICB1MTZfdCBjdHJsTGVuID0gVHhEYXRhLT5oZHJbMF0gKyAoVHhEYXRhLT5oZHJbMV0gPDwgOCk7CisgICAgaWYgKFR4RGF0YS0+aGRyWzldICYgMHg0MCkgeworCWludCBpOworCXUxNl90IGN0cmxMZW4gPSBUeERhdGEtPmhkclswXSArIChUeERhdGEtPmhkclsxXSA8PCA4KTsKIAotICAgICAgICBpZiAoY3RybExlbiAhPSBsZW4gKyA0KQotICAgICAgICB7Ci0gICAgICAgIC8qIER1bXAgY29udHJvbCBzZXR0aW5nICovCi0gICAgICAgIGZvcihpID0gMDsgaSA8IDg7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgcHJpbnRrKEtFUk5fRVJSICIweCUwMnggIiwgVHhEYXRhLT5oZHJbaV0pOwotICAgICAgICB9Ci0gICAgICAgIHByaW50ayhLRVJOX0VSUiAiXG4iKTsKKwlpZiAoY3RybExlbiAhPSBsZW4gKyA0KSB7CisJLyogRHVtcCBjb250cm9sIHNldHRpbmcgKi8KKwlmb3IgKGkgPSAwOyBpIDwgODsgaSsrKSB7CisJCXByaW50ayhLRVJOX0VSUiAiMHglMDJ4ICIsIFR4RGF0YS0+aGRyW2ldKTsKKwl9CisJcHJpbnRrKEtFUk5fRVJSICJcbiIpOwogCi0gICAgICAgIHByaW50ayhLRVJOX0VSUiAiY3RyTGVuOiAlZCwgaGRyTGVuOiAlZCwgc25hcExlbjogJWRcbiIsIGN0cmxMZW4sIFR4RGF0YS0+aGRybGVuLCBUeERhdGEtPnNuYXBMZW4pOwotICAgICAgICBwcmludGsoS0VSTl9FU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Fuc2Zlcl9idWZmZXIsIGJ1ZmZlcl9sZW5ndGgsIGNvbXBsZXRlLCBjb250ZXh0KTsKKwl1cmItPnRyYW5zZmVyX2ZsYWdzIHw9IFVSQl9aRVJPX1BBQ0tFVDsKKyAgICB9IGVsc2UgeworCXVzYl9maWxsX2J1bGtfdXJiKHVyYiwgdXNiLCB1c2JfcmN2YnVsa3BpcGUodXNiLCBlcG51bSksCisJCXRyYW5zZmVyX2J1ZmZlciwgYnVmZmVyX2xlbmd0aCwgY29tcGxldGUsIGNvbnRleHQpOwogICAgIH0KIAotICAgIGlmIChlcG51bSA9PSA0KQotICAgIHsKLSAgICAgICAgaWYgKHVyYi0+aGNwcml2KQotICAgICAgICB7Ci0gICAgICAgICAgICAvL3ByaW50aygiQ1dZIC0gdXJiLT5oY3ByaXYgc2V0IGJ5IHVua25vd24gcmVhc29uLCByZXNldCBpdFxuIik7Ci0gICAgICAgICAgICAvL3VyYi0+aGNwcml2ID0gMDsKLSAgICAgICAgfQotICAgIH0KKyAgICBpZiAoZXBudW0gPT0gNCkgeworCWlmICh1cmItPmhjcHJpdikgeworCQkvKnByaW50aygiQ1dZIC0gdXJiLT5oY3ByaXYgc2V0IGJ5IHVua25vd24gcmVhc29uLCByZXNldCBpdFxuIik7CisJCS8vdXJiLT5oY3ByaXYgPSAwOyovCisJCX0KKwl9CiAKICAgICByZXQgPSB1c2Jfc3VibWl0X3VyYih1cmIsIEdGUF9BVE9NSUMpOwotICAgIGlmICgoZXBudW0gPT0gNCkgJiAocmV0ICE9IDApKQotICAgIHsKLSAgICAgICAgLy9wcmludGsoIkNXWSAtIHJldCA9ICV4XG4iLCByZXQpOworICAgIGlmICgoZXBudW0gPT0gNCkgJiAocmV0ICE9IDApKSB7CisJLypwcmludGsoIkNXWSAtIHJldCA9ICV4XG4iLCByZXQpOyovCiAgICAgfQogICAgIHJldHVybiByZXQ7CiB9CiAKIHUzMl90IHpmTG54VXNiU3VibWl0SW50VXJiKHVyYl90ICp1cmIsIH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dihkZXYpOworCS8qemZpSHdXYXRjaERvZ1JlaW5pdChkZXYpOyovCisJcHJpbnRrKCgiXG4gKioqKioqKioqKioqIEh3IHdhdGNoRG9nIG9jY3VyISEgKioqKioqKioqKioqKiogXG4iKSk7CisJemZpV2xhblN1c3BlbmQoZGV2KTsKKwl6ZmlXbGFuUmVzdW1lKGRldiAsIDApOworCXpmSHBTdGFydFJlY3YoZGV2KTsKICAgICB9CiAKICAgICBjbGVhcl9iaXQoMCwgKHZvaWQgKikmc21wX2tldmVudF9Mb2NrKTsKQEAgLTEwODMsNDEgKzEwMTAsMzggQEAKIHsKICAgICBzdHJ1Y3QgdXNiZHJ2X3ByaXZhdGUgKm1hY3AgPSBkZXYtPm1sX3ByaXY7CiAKLSAgICBpZiAobWFjcCA9PSBOVUxMKQotICAgIHsKLSAgICAgICAgcHJpbnRrKCJtYWNwIGlzIE5VTExcbiIpOwotICAgICAgICByZXR1cm47CisgICAgaWYgKG1hY3AgPT0gTlVMTCkgeworCXByaW50aygibWFjcCBpcyBOVUxMXG4iKTsKKwlyZXR1cm47CiAgICAgfQogCi0gICAgaWYgKDAgJiYgbWFjcC0+a2V2ZW50X3JlYWR5ICE9IDEpCi0gICAgewotICAgICAgICBwcmludGsoIktldmVudCBub3QgcmVhZHlcbiIpOwotICAgICAgICByZXR1cm47CisgICAgaWYgKDAgJiYgbWFjcC0+a2V2ZW50X3JlYWR5ICE9IDEpIHsKKwlwcmludGsoIktldmVudCBub3QgcmVhZHlcbiIpOworCXJldHVybjsKICAgICB9CiAKICAgICBzZXRfYml0KGZsYWcsICZtYWNwLT5rZXZlbnRfZmxhZ3MpOwogCi0gICAgaWYgKCFzY2hlZHVsZV93b3JrKCZtYWNwLT5rZXZlbnQpKQotICAgIHsKLSAgICAgICAgLy9GYWlscyBpcyBOb3JtYWwKLSAgICAgICAgLy9wcmludGsoS0VSTl9FUlIgInNjaGVkdWxlX3Rhc2sgZmFpbGVkLCBmbGFnID0gJXhcbiIsIGZsYWcpO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w3ICs4NjcsNyBAQAogICAgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAgICAgRGVzY3JpcHRpb246CiAgICAgICAgIFdoZW4gcmVjZWl2aW5nIHRoZSBsYXN0IHBhY2tldCBvZiA0LXdheSBwYWlyd2lzZWtleSBoYW5kc2hha2UuCi0gICAgICAgIEluaXRpbGl6ZSAyLXdheSBncm91cGtleSBoYW5kc2hha2UgZm9sbG93aW5nLgorICAgICAgICBJbml0aWFsaXplIDItd2F5IGdyb3Vwa2V5IGhhbmRzaGFrZSBmb2xsb3dpbmcuCiAgICAgUmV0dXJuOgogICAgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAqLwpkaWZmIC0tZ2l0IGEvZHJpdmVycy9zdGFnaW5nL3J0Mjg2MC9jb21tb24vcnRtcF90aW1lci5jIGIvZHJpdmVycy9zdGFnaW5nL3J0Mjg2MC9jb21tb24vcnRtcF90aW1lci5jCmluZGV4IDQyZTQ3ZDkuLmFiNTIwOTAgMTAwNjQ0Ci0tLSBhL2RyaXZlcnMvc3RhZ2luZy9ydDI4NjAvY29tbW9uL3J0bXBfdGltZXIuYworKysgYi9kcml2ZXJzL3N0YWdpbmcvcnQyODYwL2NvbW1vbi9ydG1wX3RpbWVyLmMKQEAgLTE0Myw4ICsxNDMsOCBAQAogCXN0cnVjdCBydF9ydG1wX29zX3Rhc2sgKnBUYXNrOwogCXN0cnVjdCBydF9ydG1wX2FkYXB0ZXIgKnBBZDsKIAotCXBUYXNrID0gKHN0cnVjdCBydF9ydG1wX29zX3Rhc2sgKilDb250ZXh0OwotCXBBZCA9IChzdHJ1Y3QgcnRfcnRtcF9hZGFwdGVyICopcFRhc2stPnByaXY7CisJcFRhc2sgPSBDb250ZXh0OworCXBBZCA9IHBUYXNrLT5wcml2OwogCiAJUnRtcE9TVG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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqIFRoaXMgcHJvZ3JhbSBpcyBkaXN0cmlidXRlZCBpbiB0aGUgaG9wZSB0aGF0IGl0IHdpbGwgYmUgdXNlZnVsLCAgICAgICAqCi0gKiBidXQgV0lUSE9VVCBBTlkgV0FSUkFOVFk7IHdpdGhvdXQgZXZlbiB0aGUgaW1wbGllZCB3YXJyYW50eSBvZiAgICAgICAgKgotICogTUVSQ0hBTlRBQklMSVRZIG9yIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFLiAgU2VlIHRoZSAgICAgICAgICoKLSAqIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGZvciBtb3JlIGRldGFpbHMuICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogWW91IHNob3VsZCBoYXZlIHJlY2VpdmVkIGEgY29weSBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgICAgICoKLSAqIGFsb25nIHdpdGggdGhpcyBwcm9ncmFtOyBpZiBub3QsIHdyaXRlIHRvIHRoZSAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb24sIEluYy4sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogNTkgVGVtcGxlIFBsYWNlIC0gU3VpdGUgMzMwLCBCb3N0b24sIE1BICAwMjExMS0xMzA3LCBVU0EuICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKioqKioqKioqKioqKioqKioqKioqK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FyaWx5IHVzZSBNQU5BR0UgUVVFVUUgaW5zdGVhZCBvZiBOb3JtYWwgUXVldWUuCi0gKiBXQiAyMDA4LTA1LTI3Ci0gKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIENvcHlyaWdodChjKSAyMDA4IC0gMjAxMCBSZWFsdGVrIENvcnBvcmF0aW9uLiBBbGwgcmlnaHRzIHJlc2VydmVkLgorICoKKyAqIFRoaXMgcHJvZ3JhbSBpcyBkaXN0cmlidXRlZCBpbiB0aGUgaG9wZSB0aGF0IGl0IHdpbGwgYmUgdXNlZnVsLCBidXQgV0lUSE9VVAorICogQU5ZIFdBUlJBTlRZOyB3aXRob3V0IGV2ZW4gdGhlIGltcGxpZWQgd2FycmFudHkgb2YgTUVSQ0hBTlRBQklMSVRZIG9yCisgKiBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRS4gIFNlZSB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgZm9yCisgKiBtb3JlIGRldGFpbHMuCisgKgorICogWW91IHNob3VsZCBoYXZlIHJlY2VpdmVkIGEgY29weSBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgYWxvbmcgd2l0aAorICogdGhpcyBwcm9ncmFtOyBpZiBub3QsIHdyaXRlIHRvIHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb24sIEluYy4sCisgKiA1MSBGcmFua2xpbiBTdHJlZXQsIEZpZnRoIEZsb29yLCBCb3N0b24sIE1BIDAyMTEwLCBVU0EKKyAqCisgKiBUaGUgZnVsbCBHTlUgR2VuZXJhbCBQdW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NyBAQAogCiAgICAgICAgICAgICAgICAgd2hpbGUoIWxpc3RfZW1wdHkoJnBSeFRTLT5SeFBlbmRpbmdQa3RMaXN0KSkKICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLy8gICAgICBQbGF0Zm9ybUFjcXVpcmVTcGluTG9jayhBZGFwdGVyLCBSVF9SWF9TUElOTE9DSyk7CiAgICAgICAgICAgICAgICAgICAgICAgICBzcGluX2xvY2tfaXJxc2F2ZSgmKGllZWUtPnJlb3JkZXJfc3BpbmxvY2spLCBmbGFncyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvL3BSeFJlb3JkZXJFbnRyeSA9IGxpc3RfZW50cnkoJnBSeFRTLT5SeFBlbmRpbmdQa3RMaXN0LnByZXYsUlhfUkVPUkRFUl9FTlRSWSxMaXN0KTsKIAkJCXBSeFJlb3JkZXJFbnRyeSA9IChQUlhfUkVPUkRFUl9FTlRSWSlsaXN0X2VudHJ5KHBSeFRTLT5SeFBlbmRpbmdQa3RMaXN0LnByZXYsUlhfUkVPUkRFUl9FTlRSWSxMaXN0KTsKICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RfZGVsX2luaXQoJnBSeFJlb3JkZXJFbnRyeS0+TGlzdCk7CiAgICAgICAgICAgICAgICAgICAgICAgICB7CkBAIC01MTQsMTEgKzUyMCw4IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByeGIgPSBOVUxMOwogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgbGlzdF9hZGRfdGFpbCgmcFJ4UmVvcmRlckVudHJ5LT5MaXN0LCZpZWVlLT5SeFJlb3JkZXJfVW51c2VkX0xpc3QpOwotICAgICAgICAgICAgICAgICAgICAgICAgLy9QbGF0Zm9ybVJlbGVhc2VTcGluTG9jayhBZGFwdGVyLCBSVF9SWF9TUElOTE9DSyk7CiAgICAgICAgICAgICAgICAgICAgICAgICBzcGluX3VubG9ja19pcnFyZ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lbmRpZgpkaWZmIC0tZ2l0IGEvZHJpdmVycy9zdGFnaW5nL3J0bDgxOTJzdS9yODE5MlNfZmlybXdhcmUuYyBiL2RyaXZlcnMvc3RhZ2luZy9ydGw4MTkyc3UvcjgxOTJTX2Zpcm13YXJlLmMKaW5kZXggNTAzNmQ1NC4uZGIwZDJkNSAxMDA2NDQKLS0tIGEvZHJpdmVycy9zdGFnaW5nL3J0bDgxOTJzdS9yODE5MlNfZmlybXdhcmUuYworKysgYi9kcml2ZXJzL3N0YWdpbmcvcnRsODE5MnN1L3I4MTkyU19maXJtd2FyZS5jCkBAIC0xLDE2ICsxLDIyIEBACi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqIFByb2NlZHVyZTogICAgSW5pdCBib290IGNvZGUvZmlybXdhcmUgY29kZS9kYXRhIHNlc3Npb24KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIENvcHlyaWdodChjKSAyMDA4IC0gMjAxMCBSZWFsdGVrIENvcnBvcmF0aW9uLiBBbGwgcmlnaHRzIHJlc2VydmVkLgogICoKLSAqIERlc2NyaXB0aW9uOiBUaGlzIHJvdXRpbmUgd2lsbCBpbnRpYWxpemUgZmlybXdhcmUuIElmIGFueSBlcnJvciBvY2N1cnMgZHVyaW5nIHRoZSBpbml0aWFsaXphdGlvbgotICogCQlwcm9jZXNzLCB0aGUgcm91dGluZSBzaGFsbCB0ZXJtaW5hdGUgaW1tZWRpYXRlbHkgYW5kIHJldHVybiBmYWlsLgotICoJCU5JQyBkcml2ZXIgc2hvdWxkIGNhbGwgTmRpc09wZW5GaWxlIG9ubHkgZnJvbSBNaW5pcG9ydEluaXRpYWxpemUuCisgKiBUaGlzIHByb2dyYW0gaXMgZGlzdHJpYnV0ZW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PmRpcl9kZXYtPm5hbWUsIHJ0bDgxOTJfcHJvYyk7CiAJCXByaXYtPmRpcl9kZXYgPSBOVUxMOwogCX0KIH0KQEAgLTExNDUsNiArMTE1MiwyNSBAQAogCQkgICAgICBkZXYtPm5hbWUpOwogCX0KIH0KKworc3RhdGljIGludCBwcm9jX25ldGRldl9ldmVudChzdHJ1Y3Qgbm90aWZpZXJfYmxvY2sgKnRoaXMsCisJCQkgICAgIHVuc2lnbmVkIGxvbmcgZXZlbnQsIHZvaWQgKnB0cikKK3sKKwlzdHJ1Y3QgbmV0X2RldmljZSAqbmV0X2RldiA9IHB0cjsKKworCWlmIChuZXRfZGV2LT5uZXRkZXZfb3BzID09ICZydGw4MTkyX25ldGRldl9vcHMgJiYKKwkgICAgZXZlbnQgPT0gTkVUREVWX0NIQU5HRU5BTUUpIHsKKwkJcnRsODE5Ml9wcm9jX3JlbW92ZV9vbmUobmV0X2Rldik7CisJCXJ0bDgxOTJfcHJvY19pbml0X29uZShuZXRfZGV2KTsKKwl9CisKKwlyZXR1cm4gTk9USUZZX0RPTkU7Cit9CisKK3N0YXRpYyBzdHJ1Y3Qgbm90aWZpZXJfYmxvY2sgcHJvY19uZXRkZXZfbm90aWZpZXIgPSB7CisJLm5vdGlmaWVyX2NhbGwgPSBwcm9jX25ldGRldl9ldmVudCwKK307CisKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLU1JU0MgU1RVRkYtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KQEAgLTczNTUsNiArNzM4MSw4IEBACiAgICAgICAgIFJUX1RSQUNFKENPTVBfSU5JVCwgIk9vcHM6IGknbSBjb21pbmd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rKykgewogCkBAIC0xMDExLDYgKzEwMTMsNzAgQEAKIAlyZXR1cm4gcmV0OwogfQogCitzdGF0aWMgaW50IHI4MTkyX3d4X3NldF9wbWtpZChzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisJaW50IGk7CisJc3RydWN0IHI4MTkyX3ByaXYgKnByaXYgPSBpZWVlODAyMTFfcHJpdihkZXYpOworCXN0cnVjdCBpZWVlODAyMTFfZGV2aWNlKiBpZWVlID0gcHJpdi0+aWVlZTgwMjExOworCXN0cnVjdCBpd19wbWtzYSogIHBQTUsgPSAoc3RydWN0IGl3X3Bta3NhKilleHRyYTsKKwlpbnQJaW50UmV0dXJuID0gZmFsc2U7CisKKwlzd2l0Y2ggKHBQTUstPmNtZCkKKwl7CisJCWNhc2UgSVdfUE1LU0FfQUREOgorCQkJZm9yIChpID0gMDsgaSA8IE5VTV9QTUtJRF9DQUNIRTsgaSsrKQorCQkJeworCQkJCWlmIChtZW1jbXAoaWVlZS0+UE1LSURMaXN0W2ldLkJzc2lkLCBwUE1LLT5ic3NpZC5zYV9kYXRhLCBFVEhfQUxFTikgPT0gMCkKKwkJCQl7CisgICAgICAgICAgICAgICAgICAgIAkJCW1lbWNweShpZWVlLT5QTUtJRExpc3RbaV0uUE1LSUQsIHBQTUstPnBta2lkLCBJV19QTUtJRF9MRU4pOworCQkJCQltZW1jcHkoaWVlZS0+UE1LSURMaXN0W2ldLkJzc2lkLCBwUE1LLT5ic3NpZC5zYV9kYXRhLCBFVEhfQUxFTik7CisJCQkJCWllZWUtPlBNS0lETGlzdFtpXS5iVXNlZCA9IHRydWU7CisJCQkJCWludFJldHVybiA9IHRydWU7CisJ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c2MsICpwY2JfZGVzYzsKLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLURlZmluZSAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLSNkZWZpbmUgTUdOXzFNICAgICAgICAgICAgICAgICAgMHgwMgotI2RlZmluZSBNR05fMk0gICAgICAgICAgICAgICAgICAweDA0Ci0jZGVmaW5lIE1HTl81XzVNICAgICAgICAgICAgICAgIDB4MGIKLSNkZWZpbmUgTUdOXzExTSAgICAgICAgICAgICAgICAgMHgxNgotCi0jZGVmaW5lIE1HTl82TSAgICAgICAgICAgICAgICAgIDB4MGMKLSNkZWZpbmUgTUdOXzlNICAgICAgICAgICAgICAgICAgMHgxMgotI2RlZmluZSBNR05fMTJNICAgICAgICAgICAgICAgICAweDE4Ci0jZGVmaW5lIE1HTl8xOE0gICAgICAgICAgICAgICAgIDB4MjQKLSNkZWZpbmUgTUdOXzI0TSAgICAgICAgICAgICAgICAgMHgzMAotI2RlZmluZSBNR05fMzZNICAgICAgICAgICAgICAgICAweDQ4Ci0jZGVmaW5lIE1HTl80OE0gICAgICAgICAgICAgICAgIDB4NjAKLSNkZWZpbmUgTUdOXzU0TSAgICAgICAgICAgICAgICAgMHg2YwotCi0jZGVmaW5lIE1HTl9NQ1MwICAgICAgICAgICAgICAgIDB4ODAKLSNkZWZpbmUgTUdOX01DUzEgICAgICAgICAgICAgICAgMHg4MQotI2RlZmluZSBNR05fTUNTMiAgICAgICAgICAgICAgICAweDgyCi0jZGVmaW5lIE1HTl9NQ1MzICAgICAgICAgICAgICAgIDB4ODMKLSNkZWZpbmUgTUdOX01DUzQgICAgICAgICAgICAgICAgMHg4NAotI2RlZmluZSBNR05fTUNTNSAgICAgICAgICAgICAgICAweDg1Ci0jZGVmaW5lIE1HTl9NQ1M2ICAgICAgICAgICAgICAgIDB4ODYKLSNkZWZpbmUgTUdOX01DUzcgICAgICAgICAgICAgICAgMHg4NwotI2R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yMTFfREVCVUcoSUVFRTgwMjExX0RMX1RYLCBmLCAjIyBhKQotI2RlZmluZSBJRUVFODAyMTFfREVCVUdfUlgoZiwgYS4uLikgIElFRUU4MDIxMV9ERUJVRyhJRUVFODAyMTFfRExfUlgsIGYsICMjIGEpCi0jZGVmaW5lIElFRUU4MDIxMV9ERUJVR19RT1MoZiwgYS4uLikgIElFRUU4MDIxMV9ERUJVRyhJRUVFODAyMTFfRExfUU9TLCBmLCAjIyBhKQotCi0jaWZkZWYgQ09ORklHX0lFRUU4MDIxMV9ERUJVRwotLyogQWRkZWQgYnkgQW5uaWUsIDIwMDUtMTEtMjIuICovCi0jZGVmaW5lIE1BWF9TVFJfTEVOICAgICA2NAotLyogSSB3YW50IHRvIHNlZSBBU0NJSSAzMyB0byAxMjYgb25seS4gT3RoZXJ3aXNlLCBJIHByaW50ICc/Jy4gQW5uaWUsIDIwMDUtMTEtMjIuKi8KLSNkZWZpbmUgUFJJTlRBQkxFKF9jaCkgIChfY2ggPiAnIScgJiYgX2NoIDwgJ34nKQotI2RlZmluZSBJRUVFODAyMTFfUFJJTlRfU1RSKF9Db21wLCBfVGl0bGVTdHJpbmcsIF9QdHIsIF9MZW4pICAgICAgICAgICAgICAgICAgICAgICAgICAgIAlcCi0JCQlpZiAoKF9Db21wKSAmIGxldmVsKSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0JCQkJaW50ICAgICAgICAgICAgIF9faTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLQkJCQl1OCAgYnVmZmVyW01BWF9TVFJfTEVOXTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAJXAotCQkJCWludCBsZW5ndGggPSAoX0xlbiA8IE1BWF9TVFJfTEVOKSA/IF9MZW4gOiAoTUFYX1NUUl9MRU4gLSAxKTsgIAlcCi0JCQkJbWVtc2V0KGJ1ZmZlciwgMCwgTUFYX1NUUl9MRU4pOyAgICAgICAgICAgICAgICAgICAgICAJCVwKLQkJCQltZW1jcHkoYnVmZmVyLCAodTggKilfUHRyLCBsZW5ndGgpOyAgICAgICAgICAgIAkJXAotCQkJCWZvciAoX19pID0gMDsgX19pIDwgTUFYX1NUUl9MRU47IF9faSsrKSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotCQkJCSAgICAgaWYgKCFQUklOVEFCTEUoYnVmZmVyW19faV0pKSAgIFwKLQkJCQkJCWJ1ZmZlcltfX2ldID0gJz8nOyAgICAgCVwKLQkJCQl9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotCQkJCWJ1ZmZlcltsZW5ndGhdID0gJ1wwJzsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0JCQkJcHJpbnRrKCJSdGw4MTl4OiAiKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAlcCi0JCQkJcHJpbnRrKF9UaXRsZVN0cmluZyk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0JCQkJcHJpbnRrKCI6ICVkLCA8JXM+XG4iLCBfTGVuLCBidWZmZXIpOyAgICAgICAgICAgICAgICAgICAgICAgICBcCi0JCQl9Ci0jZWxzZQotI2RlZmluZSBJRUVFODAyMTFfUFJJTlRfU1RSKF9Db21wLCBfVGl0bGVTdHJpbmcsIF9QdHIsIF9MZW4pICBkbyB7fSB3aGlsZSAoMCkKLSNlbmRpZgotCi0jaW5jbHVkZSA8bGludXgvbmV0ZGV2aWNlLmg+Ci0jaW5jbHVkZSA8bGludXgvaWZfYXJwLmg+IC8qIEFSUEhSRF9FVEhFUiAqLwotCi0jaWZuZGVmIFdJUkVMRVNTX1NQWQotI2RlZmluZSBXSVJFTEVTU19TUFkJCS8qI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mtzdGF0dXMpLAorCQkJCSAgICAgICAwLCAwKTsKKyNlbGlmIGRlZmluZWQoQ09ORklHX1g4NikKKwkJc2xpY191cHJfcXVldWVfcmVxdWVzdChhZGFwdGVyLAorCQkJCSAgICAgICBTTElDX1VQUl9STFNSLAorCQkJCSAgICAgICAodTMyKSAmcHNobWVtLT5saW5rc3RhdHVzLAorCQkJCSAgICAgICBTTElDX0dFVF9BRERSX0hJR0gocHNobWVtKSwgMCwgMCk7CisjZWxzZQorCQlTdG9wIENvbXBpbGF0aW9uOworI2VuZGlmCisJCXJldHVybjsKKwl9CisJaWYgKGFkYXB0ZXItPnN0YXRlICE9IEFEQVBUX1VQKQorCQlyZXR1cm47CisKKwlBU1NFUlQoKGFkYXB0ZXItPmRldmlkID09IFNMSUNfMUdCX0RFVklDRV9JRCkKKwkgICAgICAgfHwgKGFkYXB0ZXItPmRldmlkID09IFNMSUNfMkdCX0RFVklDRV9JRCkpOworCisJbGlua3VwID0gbGlua3N0YXR1cyAmIEdJR19MSU5LVVAgPyBMSU5LX1VQIDogTElOS19ET1dOOworCWlmIChsaW5rc3RhdHVzICYgR0lHX1NQRUVEXzEwMDApCisJCWxpbmtzcGVlZCA9IExJTktfMTAwME1COworCWVsc2UgaWYgKGxpbmtzdGF0dXMgJiBHSUdfU1BFRURfMTAwKQorCQlsaW5rc3BlZWQgPSBMSU5LXzEwME1COworCWVsc2UKKwkJbGlua3NwZWVkID0gTElOS18xME1COworCisJaWYgKGxpbmtzdGF0dXMgJiBHSUdfRlVMTERVUExFWCkKKwkJbGlua2R1cGxleCA9IExJTktfRlVMTEQ7CisJZWxzZQorCQlsaW5rZHVwbGV4ID0gTElOS19IQUxGRDsKKworCWlmICgoYWRhcHRlci0+bGlua3N0YXRlID09IExJTktfRE9XTikgJiYgKGxpbmt1cCA9PSBMSU5LX0RPV04pKQorCQlyZXR1cm47CisKKwkvKiBsaW5rIHVwIGV2ZW50LCBidXQgbm90aGluZyBoYXMgY2hhbmdlZCAqLworC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vcnMgICAgICAgICA6ICU4LjhYXG4iLAogCQkJKHUzMikgYWRhcHRlci0+c2xpY19zdGF0cy5pZmFjZS54bWl0X2NvbGxpc2lvbnMpOwogCXNlcV9wcmludGYoc2VxLCAicGVyZjogTWF4IHJjdiBmcmFtZXMvaXNyICAgICAgICAgICA6ICU4LjhYXG4iLApAQCAtNDAzOSw5ICsyNDI1LDE1NTUgQEAKIAl9CiB9CiAKLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKioqKioqKioqKioqKioqKiAgIE1PRFVMRSBJTklUSUFUSU9OIC8gVEVSTUlOQVRJT04gRlVOQ1RJT05TICAgKioqKioqKioqKioqKioqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qCisgKiBzbGljX2xpbmtfZXZlbnRfaGFuZGxlciAtCisgKgorICogSW5pdGlhdGUgYSBsaW5rIGNvbmZpZ3VyYXRpb24gc2VxdWVuY2UuICBUaGUgbGluayBjb25maWd1cmF0aW9uIGJlZ2lucworICogYnkgaXNzdWluZyBhIFJFQURfTElOS19TVEFUVVMgY29tbWFuZCB0byB0aGUgVXRpbGl0eSBQcm9jZXNzb3Igb24gdGhlCisgKiBTTElDLiAgU2luY2UgdGhlIGNvbW1hbmQgZmluaXNoZXMgYXN5bmNocm9ub3VzbHksIHRoZSBzbGljX3Vwcl9jb21sZXRlCisgKiByb3V0aW5lIHdpbGwgZm9sbG93IGl0IHVwIHdpdGhhIFVQIGNvbmZpZ3VyYXRpb24gd3JpdGUgY29tbWFuZCwgd2hpY2gKKyAqIHdpbGwgYWxzbyBjb21wbGV0ZSBhc3luY2hyb25vdXNseS4KKyAqCisgKi8KK3N0YXRpYyB2b2lkIHNsaWNfbGlua19ldmVudF9oYW5kbGVyKHN0cnVjdCBhZGFwdGVyICphZ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T1Aoc29sb19kZXYtPnZpbl92c3RhcnQgKworCQkJCSAgICAgIHNvbG9fZGV2LT52aWRlb192c2l6ZSkpOworCisJc29sb19yZWdfd3JpdGUoc29sb19kZXYsIFNPTE9fVklfQUNUX0lfUywKKwkJICAgICAgIFNPTE9fVklfSF9TVEFSVChzb2xvX2Rldi0+dm91dF9oc3RhcnQpIHwKKwkJICAgICAgIFNPTE9fVklfVl9TVEFSVChzb2xvX2Rldi0+dm91dF92c3RhcnQpIHwKKwkJICAgICAgIFNPTE9fVklfVl9TVE9QKHNvbG9fZGV2LT52b3V0X3ZzdGFydCArCisJCQkJICAgICAgc29sb19kZXYtPnZpZGVvX3ZzaXplKSk7CisKKwlzb2xvX3JlZ193cml0ZShzb2xvX2RldiwgU09MT19WSV9BQ1RfUCwKKwkJICAgICAgIFNPTE9fVklfSF9TVEFSVCgwKSB8CisJCSAgICAgICBTT0xPX1ZJX1ZfU1RBUlQoMSkgfAorCQkgICAgICAgU09MT19WSV9WX1NUT1AoU09MT19QUk9HUkVTU0lWRV9WU0laRSkpOworCisJc29sb19yZWdfd3JpdGUoc29sb19kZXYsIFNPTE9fVklfQ0hfRk9STUFULAorCQkgICAgICAgU09MT19WSV9GRF9TRUxfTUFTSygwKSB8IFNPTE9fVklfUFJPR19NQVNLKDApKTsKKworCXNvbG9fcmVnX3dyaXRlKHNvbG9fZGV2LCBTT0xPX1ZJX0ZNVF9DRkcsIDApOworCXNvbG9fcmVnX3dyaXRlKHNvbG9fZGV2LCBTT0xPX1ZJX1BBR0VfU1csIDIpOworCisJaWYgKHNvbG9fZGV2LT52aWRlb190eXBlID09IFNPTE9fVk9fRk1UX1RZUEVfTlRTQykgeworCQlzb2xvX3JlZ193cml0ZShzb2xvX2RldiwgU09MT19WSV9QQl9DT05GSUcsCisJCQkgICAgICAgU09MT19WSV9QQl9VU0VSX01PREUpOworCQlzb2xvX3JlZ193cml0ZShzb2xvX2RldiwgU09MT19WSV9QQl9SQU5HRV9IViwKKwkJCSA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kZHIsIHUzMiBleHRfYWRkciwgdTMyIHNpemUpCit7CisJc3RydWN0IHNvbG9fcDJtX2RldiAqcDJtX2RldjsKKwl1bnNpZ25lZCBpbnQgdGltZW91dCA9IDA7CisKKwlXQVJOX09OKCFzaXplKTsKKwlXQVJOX09OKGlkID49IFNPTE9fTlJfUDJNKTsKKwlpZiAoIXNpemUgfHwgaWQgPj0gU09MT19OUl9QMk0pCisJCXJldHVybiAtRUlOVkFMOworCisJcDJtX2RldiA9ICZzb2xvX2Rldi0+cDJtX2RldltpZF07CisKKwlkb3duKCZwMm1fZGV2LT5zZW0pOworCitzdGFydF9kbWE6CisJSU5JVF9DT01QTEVUSU9OKHAybV9kZXYtPmNvbXBsZXRpb24pOworCXAybV9kZXYtPmVycm9yID0gMDsKKwlzb2xvX3JlZ193cml0ZShzb2xvX2RldiwgU09MT19QMk1fVEFSX0FEUihpZCksIGRtYV9hZGRyKTsKKwlzb2xvX3JlZ193cml0ZShzb2xvX2RldiwgU09MT19QMk1fRVhUX0FEUihpZCksIGV4dF9hZGRyKTsKKwlzb2xvX3JlZ193cml0ZShzb2xvX2RldiwgU09MT19QMk1fRVhUX0NGRyhpZCksCisJCSAgICAgICBTT0xPX1AyTV9DT1BZX1NJWkUoc2l6ZSA+PiAyKSk7CisJc29sb19yZWdfd3JpdGUoc29sb19kZXYsIFNPTE9fUDJNX0NPTlRST0woaWQpLAorCQkgICAgICAgU09MT19QMk1fQlVSU1RfU0laRShTT0xPX1AyTV9CVVJTVF8yNTYpIHwKKwkJICAgICAgICh3ciA/IFNPTE9fUDJNX1dSSVRFIDogMCkgfCBTT0xPX1AyTV9UUkFOU19PTik7CisKKwl0aW1lb3V0ID0gd2FpdF9mb3JfY29tcGxldGlvbl90aW1lb3V0KCZwMm1fZGV2LT5jb21wbGV0aW9uLCBIWik7CisKKwlzb2xvX3JlZ193cml0ZShzb2xvX2RldiwgU09MT19QMk1fQ09OVFJPTChpZCksIDApOworCisJLyogWFhYIFJlYWxseSBsb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19kZXYsIGlkLCAxLCB3cl9idWYsIGJhc2UsIHNpemUpOworCXNvbG9fcDJtX2RtYShzb2xvX2RldiwgaWQsIDAsIHJkX2J1ZiwgYmFzZSwgc2l6ZSk7CisKKwlmb3IgKGkgPSAwOyBpIDwgc2l6ZTsgaSsrKQorCQlpZiAod3JfYnVmW2ldICE9IHJkX2J1ZltpXSkKKwkJCWVycl9jbnQrKzsKKworCWtmcmVlKHdyX2J1Zik7CisJa2ZyZWUocmRfYnVmKTsKKworCXJldHVybiBlcnJfY250OworfQorCisjZGVmaW5lIFRFU1RfQ0hVTktfU0laRQkJKDggKiAxMDI0KQorCitzdGF0aWMgdm9pZCBydW5fcDJtX3Rlc3Qoc3RydWN0IHNvbG82MDEwX2RldiAqc29sb19kZXYpCit7CisJdW5zaWduZWQgbG9uZyBsb25nIGVycnMgPSAwOworCXUzMiBzaXplID0gU09MT19KUEVHX0VYVF9BRERSKHNvbG9fZGV2KSArIFNPTE9fSlBFR19FWFRfU0laRShzb2xvX2Rldik7CisJaW50IGksIGQ7CisKKwlwcmludGsoS0VSTl9XQVJOSU5HICIlczogVGVzdGluZyAldSBieXRlcyBvZiBleHRlcm5hbCByYW1cbiIsCisJICAgICAgIFNPTE82MDEwX05BTUUsIHNpemUpOworCisJZm9yIChpID0gMDsgaSA8IHNpemU7IGkgKz0gVEVTVF9DSFVOS19TSVpFKQorCQlmb3IgKGQgPSAwOyBkIDwgNDsgZCsrKQorCQkJZXJycyArPSBwMm1fdGVzdChzb2xvX2RldiwgZCwgaSwgVEVTVF9DSFVOS19TSVpFKTsKKworCXByaW50ayhLRVJOX1dBUk5JTkcgIiVzOiBGb3VuZCAlbGx1IGVycm9ycyBkdXJpbmcgcDJtIHRlc3RcbiIsCisJICAgICAgIFNPTE82MDEwX05BTUUsIGVycnMpOworCisJcmV0dXJuOworfQorI2Vsc2UKKyNkZWZpbmUgcnVuX3AybV90ZXN0KF9fc29sbykJZG97fXdoaWxlKDApCisjZW5kaWYKKwordm9pZ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KykgeworCQkJdGJsX3R3Mjg2NF9jb21tb25bMHgwNyB8IChpIDw8IDQpXSB8PSAweDEwOworCQkJdGJsX3R3Mjg2NF9jb21tb25bMHgwOCB8IChpIDw8IDQpXSB8PSAweDA2OworCQkJdGJsX3R3Mjg2NF9jb21tb25bMHgwYSB8IChpIDw8IDQpXSB8PSAweDA4OworCQkJdGJsX3R3Mjg2NF9jb21tb25bMHgwYiB8IChpIDw8IDQpXSB8PSAweDEzOworCQkJdGJsX3R3Mjg2NF9jb21tb25bMHgwZSB8IChpIDw8IDQpXSB8PSAweDAxOworCQl9CisJCXRibF90dzI4NjRfY29tbW9uWzB4OWRdID0gMHg5MDsKKwkJdGJsX3R3Mjg2NF9jb21tb25bMHhmM10gPSAweDAwOworCQl0YmxfdHcyODY0X2NvbW1vblsweGY0XSA9IDB4YTA7CisJfQorCisJZm9yIChpID0gMDsgaSA8IDB4ZmY7IGkrKykgeworCQkvKiBTa2lwIHJlYWQgb25seSByZWdpc3RlcnMgKi8KKwkJaWYgKGkgPj0gMHhiOCAmJiBpIDw9IDB4YzEgKQorCQkJY29udGludWU7CisJCWlmICgoaSAmIH4weDMwKSA9PSAweDAwIHx8CisJCSAgICAoaSAmIH4weDMwKSA9PSAweDBjIHx8CisJCSAgICAoaSAmIH4weDMwKSA9PSAweDBkKQorCQkJY29udGludWU7CisJCWlmIChpID09IDB4NzQgfHwgaSA9PSAweDc3IHx8IGkgPT0gMHg3OCB8fAorCQkgICAgaSA9PSAweDc5IHx8IGkgPT0gMHg3YSkKKwkJCWNvbnRpbnVlOworCQlpZiAoaSA9PSAweGZkKQorCQkJY29udGludWU7CisKKwkJdHdfd3JpdGVfYW5kX3ZlcmlmeShzb2xvX2RldiwgZGV2X2FkZHIsIGksCisJCQkJICAgIHRibF90dzI4NjRfY29tbW9uW2ldKTsKKwl9CisKKwlyZXR1cm4gMDsKK30KKworc3RhdGljIGludCB0dzI4MTVfc2V0dXAoc3RydWN0IHNvbG82MDEwX2RldiAqc29s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b2wgKi8KKwl0YmxfbnRzY190dzI4MTVfY29tbW9uWzB4MDJdID0gREVGQVVMVF9IREVMQVlfTlRTQyAmIDB4ZmY7CisJdGJsX250c2NfdHcyODE1X2NvbW1vblsweDA2XSB8PSAweDAzICYgKERFRkFVTFRfSERFTEFZX05UU0MgPj4gOCk7CisKKwkvKiBIb3Jpem9udGFsIEFjdGl2ZSBDb250cm9sICovCisJdGJsX250c2NfdHcyODE1X2NvbW1vblsweDAzXSA9IERFRkFVTFRfSEFDVElWRV9OVFNDICYgMHhmZjsKKwl0YmxfbnRzY190dzI4MTVfY29tbW9uWzB4MDZdIHw9CisJCSgoMHgwMyAmIChERUZBVUxUX0hBQ1RJVkVfTlRTQyA+PiA4KSkgPDwgMik7CisKKwkvKiBWZXJ0aWNhbCBEZWxheSBDb250cm9sICovCisJdGJsX250c2NfdHcyODE1X2NvbW1vblsweDA0XSA9IERFRkFVTFRfVkRFTEFZX05UU0MgJiAweGZmOworCXRibF9udHNjX3R3MjgxNV9jb21tb25bMHgwNl0gfD0KKwkJKCgweDAxICYgKERFRkFVTFRfVkRFTEFZX05UU0MgPj4gOCkpIDw8IDQpOworCisJLyogVmVydGljYWwgQWN0aXZlIENvbnRyb2wgKi8KKwl0YmxfbnRzY190dzI4MTVfY29tbW9uWzB4MDVdID0gREVGQVVMVF9WQUNUSVZFX05UU0MgJiAweGZmOworCXRibF9udHNjX3R3MjgxNV9jb21tb25bMHgwNl0gfD0KKwkJKCgweDAxICYgKERFRkFVTFRfVkFDVElWRV9OVFNDID4+IDgpKSA8PCA1KTsKKworCXRibF9wYWxfdHcyODE1X2NvbW1vblsweDA2XSA9IDA7CisKKwkvKiBIb3Jpem9udGFsIERlbGF5IENvbnRyb2wgKi8KKwl0YmxfcGFsX3R3MjgxNV9jb21tb25bMHgwMl0gPSBERUZBVUxUX0hERUxBWV9QQUwgJiAweGZmOworCXRibF9wYWxfdHcyODE1X2NvbW1vblsweDA2XSB8PSAweDAzICYgKERFRkFVTFRfS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FsdWUpOworCQlicmVhazsKKwlkZWZhdWx0OgorCQlyZXR1cm4gLUVJTlZBTDsKKwl9CisKKwlyZXR1cm4gMDsKK30KKworc3RhdGljIGludCBzb2xvX3NfZXh0X2N0cmxzKHN0cnVjdCBmaWxlICpmaWxlLCB2b2lkICpwcml2LAorCQkJICAgIHN0cnVjdCB2NGwyX2V4dF9jb250cm9scyAqY3RybHMpCit7CisJc3RydWN0IHNvbG9fZW5jX2ZoICpmaCA9IHByaXY7CisJc3RydWN0IHNvbG9fZW5jX2RldiAqc29sb19lbmMgPSBmaC0+ZW5jOworCWludCBpOworCisJZm9yIChpID0gMDsgaSA8IGN0cmxzLT5jb3VudDsgaSsrKSB7CisJCXN0cnVjdCB2NGwyX2V4dF9jb250cm9sICpjdHJsID0gKGN0cmxzLT5jb250cm9scyArIGkpOworCQlpbnQgZXJyOworCisJCXN3aXRjaCAoY3RybC0+aWQpIHsKKwkJY2FzZSBWNEwyX0NJRF9SRFNfVFhfUkFESU9fVEVYVDoKKwkJCWlmIChjdHJsLT5zaXplIC0gMSA+IE9TRF9URVhUX01BWCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXJyID0gLUVSQU5HRTsKKwkJCWVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgCWVyciA9IGNvcHlfZnJvbV91c2VyKHNvbG9fZW5jLT5vc2RfdGV4dCwKKwkJCQkJCSAgICAgY3RybC0+c3RyaW5nLAorCQkJCQkJICAgICBPU0RfVEVYVF9NQVgpOworCQkJCXNvbG9fZW5jLT5vc2RfdGV4dFtPU0RfVEVYVF9NQVhdID0gJ1wwJzsKKwkJCQlpZiAoIWVycikKKwkJCQkJZXJyID0gc29sb19vc2RfcHJpbnQoc29sb19lbmMpOworCQkJfQorCQkJYnJlYWs7CisJCWRlZmF1bHQ6CisJCQllcnIgPSAtRUlOVkFMOworCQl9CisKKwkJaWYgKGVyciA8IDApIHsKKwkJCWN0cmxzLT5lcnJvcl9pZHggPSBpOworCQk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ICBXUklURV9NQUlOX0NNRCAgICAgICAgMTEKKyNkZWZpbmUgICBSRUFEX01BSU5fQ01EICAgICAgICAgMTIKKyNkZWZpbmUgICBXUklURV9TUEFSRV9DTUQgICAgICAgMTMKKyNkZWZpbmUgICBSRUFEX1NQQVJFX0NNRCAgICAgICAgMTQKKyNkZWZpbmUgICBXUklURV9NQUlOX1NQQVJFX0NNRCAgMTUKKyNkZWZpbmUgICBSRUFEX01BSU5fU1BBUkVfQ01EICAgMTYKKyNkZWZpbmUgICBNRU1DT1BZX0NNRCAgICAgICAgICAgMTcKKyNkZWZpbmUgICBEVU1NWV9DTUQgICAgICAgICAgICAgOTkKKworI2RlZmluZSAgICAgRVZFTlRfUEFTUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwCisjZGVmaW5lICAgICBFVkVOVF9DT1JSRUNUQUJMRV9EQVRBX0VSUk9SX0ZJWEVEICAgICAgICAgMHgwMQorI2RlZmluZSAgICAgRVZFTlRfVU5DT1JSRUNUQUJMRV9EQVRBX0VSUk9SICAgICAgICAgICAgICAweDAyCisjZGVmaW5lICAgICBFVkVOVF9USU1FX09VVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDMKKyNkZWZpbmUgICAgIEVWRU5UX1BST0dSQU1fRkFJTFVSRSAgICAgICAgICAgICAgICAgICAgICAgMHgwNAorI2RlZmluZSAgICAgRVZFTlRfRVJBU0VfRkFJTFVSRSAgICAgICAgICAgICAgICAgICAgICAgICAweDA1CisjZGVmaW5lICAgICBFVkVOVF9NRU1DT1BZX0ZBSUxVUkUgICAgICAgICAgICAgICAgICAgICAgIDB4MDYKKyNkZWZpbmUgICAgIEVWRU5UX0ZBSUwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwNworCisjZGVmaW5lICAgICBFVkVOVF9OT05FICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MjIKKyNkZWZpbmUgICAgIEVWRU5UX0RNQV9DTURfQ09NU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RhdGFCbG9ja051bSA9IERldmljZUluZm8ud0RhdGFCbG9ja051bTsKKworCXJldHVybiBQQVNTOworfQorCisvKiAuLi4uLiAqLworc3RhdGljIGludCBhbGxvY2F0ZV9tZW1vcnkodm9pZCkKK3sKKwl1MzIgYmxvY2tfdGFibGVfc2l6ZSwgcGFnZV9zaXplLCBibG9ja19zaXplLCBtZW1fc2l6ZTsKKwl1MzIgdG90YWxfYnl0ZXMgPSAwOworCWludCBpOworI2lmIENNRF9ETUEKKwlpbnQgajsKKyNlbmRpZgorCisJbmFuZF9kYmdfcHJpbnQoTkFORF9EQkdfVFJBQ0UsICIlcywgTGluZSAlZCwgRnVuY3Rpb246ICVzXG4iLAorCQlfX0ZJTEVfXywgX19MSU5FX18sIF9fZnVuY19fKTsKKworCXBhZ2Vfc2l6ZSA9IERldmljZUluZm8ud1BhZ2VTaXplOworCWJsb2NrX3NpemUgPSBEZXZpY2VJbmZvLndQYWdlc1BlckJsb2NrICogRGV2aWNlSW5mby53UGFnZURhdGFTaXplOworCisJYmxvY2tfdGFibGVfc2l6ZSA9IERldmljZUluZm8ud0RhdGFCbG9ja051bSAqCisJCShzaXplb2YodTMyKSArIHNpemVvZih1OCkgKyBzaXplb2YodTE2KSk7CisJYmxvY2tfdGFibGVfc2l6ZSArPSAoRGV2aWNlSW5mby53UGFnZURhdGFTaXplIC0KKwkJKGJsb2NrX3RhYmxlX3NpemUgJSBEZXZpY2VJbmZvLndQYWdlRGF0YVNpemUpKSAlCisJCURldmljZUluZm8ud1BhZ2VEYXRhU2l6ZTsKKworCS8qIE1hbGxvYyBtZW1vcnkgZm9yIGJsb2NrIHRhYmxlcyAqLworCWdfcEJsb2NrVGFibGUgPSBrbWFsbG9jKGJsb2NrX3RhYmxlX3NpemUsIEdGUF9BVE9NSUMpOworCWlmICghZ19wQmxvY2tUYWJsZSkKKwkJZ290byBibG9ja190YWJsZV9mYWlsOworCW1lbXNldChnX3BCbG9ja1RhYmxlLCAwLCBibG9ja190YWJsZV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b20gZmxhc2ggd2l0aG91dAorKiAgICAgICB1c2luZyBvciBkaXN0dXJiaW5nIGNhY2hlLkl0IGlzIGFzc3VtZWQgdGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQKKyogICAgICAgd2l0aCBDTUQtRE1BIGRpc2FibGVkLgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitpbnQgR0xPQl9GVExfUmVhZF9JbW1lZGlhdGUodTggKnJlYWRfZGF0YSwgdTY0IGFkZHIpCit7CisJaW50IHdSZXN1bHQgPSBGQUlMOworCXUzMiBCbG9jazsKKwl1MTYgUGFnZTsKKwl1MzIgcGh5X2JsazsKKwl1MzIgKnBidCA9ICh1MzIgKilnX3BCbG9ja1RhYmxlOworCisJbmFuZF9kYmdfcHJpbnQoTkFORF9EQkdfVFJBQ0UsICIlcywgTGluZSAlZCwgRnVuY3Rpb246ICVzXG4iLAorCQlfX0ZJTEVfXywgX19MSU5FX18sIF9fZnVuY19fKTsKKworCUJsb2NrID0gQkxLX0ZST01fQUREUihhZGRyKTsKKwlQYWdlID0gUEFHRV9GUk9NX0FERFIoYWRkciwgQmxvY2spOworCisJaWYgKCFJU19TUEFSRV9CTE9DSyhCbG9jaykpCisJCXJldHVybiBGQUlMOworCisJcGh5X2JsayA9IHBidFtCbG9ja107CisJd1Jlc3VsdCA9IEdMT0JfTExEX1JlYWRfUGFnZV9NYWluKHJlYWRfZGF0YSwgcGh5X2JsaywgUGFnZSwgMSk7CisKKwlpZiAoRGV2aWNlSW5mby5NTENEZXZpY2UpIHsKKwkJZ19wUmVhZENvdW50ZXJbcGh5X2JsayAtIERldmljZUluZm8ud1NwZWN0cmFTdGFydEJsb2NrXSsrOworCQlpZiAoZ19wUmVhZENvdW50ZXJbcGh5X2JsayAtIERldmljZUluZm8ud1NwZWN0cmFTdGFydEJsb2NrXQorCQkJPj0gTUFYX1JFQURfQ09VTlRFUikKKwkJCUZUTF9SZWFkX0Rpc3R1cmJhbmNlKHBoeV9ibGspOworCQlpZiAoZ19jQmxvY2tUYWJsZVN0YXR1cyAhPSBJTl9QUk9HUkVTU19CTE9DS19UQUJMRSkgeworCQkJZ19jQmxvY2tUYWJsZVN0YXR1cyA9IElOX1BST0dSRVNTX0JMT0NLX1RBQkxFOworCQkJRlRMX1dyaXRlX0lOX1Byb2dyZXNzX0Jsb2NrX1RhYmxlX1BhZ2UoKTsKKwkJfQorCX0KKworCXJldHVybiB3UmVzdWx0OworfQorI2VuZGlmCisKKyNpZmRlZiBTVVBQT1JUX0JJR19FTkRJQU4KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyogRnVuY3Rpb246ICAgICBGVExfSW52ZXJ0X0Jsb2NrX1RhYmxlCisqIElucHV0czogICAgICAgbm9uZQorKiBPdXRwdXRzOiAgICAgIG5vbmUKKyogRGVzY3JpcHRpb246ICBSZS1mb3JtYXQgdGhlIGJsb2NrIHRhYmxlIGluIHJhbSBiYXNlZCBvbiBCSUdfRU5ESUFOIGFuZAorKiAgICAgICAgICAgICAgICAgICAgIExBUkdFX0JMT0NLTlVNIGlmIG5lY2Vzc2FyeQorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3N0YXRpYyB2b2lkIEZUTF9JbnZlcnRfQmxvY2tfVGFibGUodm9pZCkKK3sKKwl1MzIgaTsKKwl1MzIgKnBidCA9ICh1MzIgKilnX3BCbG9ja1RhYmxlOworCisJbmFuZF9kYmdfcHJpbnQoTkFORF9EQkdfVFJBQ0UsICIlcywgTGluZSAlZCwgRnVuY3Rpb246ICVzXG4iLAorCQlfX0ZJTEVfXywgX19MSU5FX18sIF9fZnVuY19fKTsKKworI2lmZGVmIFNVUFBPUlRfTEFSR0VfQkxPQ0tOVU0KKwlmb3IgKGkgPSAwOyBpIDwgRGV2aWN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BwYWdlcyBpbiBhIGJsb2NrLiBUaGlzCisqICAgICAgICAgICAgICAgY292ZXJzIGFsbCBrbm93biBmbGFzaCBkZXZpY2VzLiBIb3dldmVyLCBzaW5jZSBmbGFzaAorKiAgICAgICAgICAgICAgIG1hbnVmYWN0dXJlcnMgaGF2ZSBubyBzdGFuZGFyZCBvZiB3aGVyZSB0aGUgTURGIGlzIHN0b3JlZCwKKyogICAgICAgICAgICAgICB0aGlzIGNhbm5vdCBndWFyYW50ZWUgdGhhdCB0aGUgTURGIGlzIHByb3RlY3RlZCBmb3IgZnV0dXJlCisqICAgICAgICAgICAgICAgZGV2aWNlcyB0b28uIFRoZSBpbml0aWFsIHNjYW5uaW5nIGZvciB0aGUgYmxvY2sgdGFibGUgYXNzdXJlcworKiAgICAgICAgICAgICAgIHRoaXMuIEl0IGlzIG9rIGV2ZW4gaWYgdGhlIGJsb2NrIHRhYmxlIGlzIG91dGRhdGVkLCBhcyBhbGwKKyogICAgICAgICAgICAgICB3ZSdyZSBsb29raW5nIGZvciBhcmUgYmFkIGJsb2NrIG1hcmtlcnMuCisqICAgICAgICAgICAgICAgVXNlIHRoaXMgd2hlbiBtb3VudGluZyBhIGZpbGUgc3lzdGVtIG9yIHN0YXJ0aW5nIGEKKyogICAgICAgICAgICAgICBuZXcgZmxhc2guCisqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgaW50ICBGVExfRm9ybWF0X0ZsYXNoKHU4IHZhbGlkX2Jsb2NrX3RhYmxlKQoreworCXUzMiBpLCBqOworCXUzMiAqcGJ0ID0gKHUzMiAqKWdfcEJsb2NrVGFibGU7CisJdTMyIHRlbXBOb2RlOworCWludCByZXQ7CisKKyNpZiBDTURfRE1BCisJdTMyICpwYnRTdGFydGluZ0NvcHkgPSAodTMyICopZ19wQlRTdGFydGluZ0NvcHk7CisJaWYgKGZ0bF9jbWRfY250KQorCQlyZXR1c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lZFxuIiwKKwkJRGV2aWNlSW5mby53QmxvY2tTaXplKTsKKwluYW5kX2RiZ19wcmludChOQU5EX0RCR19ERUJVRywgIkJsb2NrRGF0YVNpemU6ICVkXG4iLAorCQlEZXZpY2VJbmZvLndCbG9ja0RhdGFTaXplKTsKKwluYW5kX2RiZ19wcmludChOQU5EX0RCR19ERUJVRywgIkRhdGFCbG9ja051bTogJWRcbiIsCisJCURldmljZUluZm8ud0RhdGFCbG9ja051bSk7CisJbmFuZF9kYmdfcHJpbnQoTkFORF9EQkdfREVCVUcsICJQbGFuZU51bTogJWRcbiIsCisJCURldmljZUluZm8uYlBsYW5lTnVtKTsKKwluYW5kX2RiZ19wcmludChOQU5EX0RCR19ERUJVRywgIkRldmljZU1haW5BcmVhU2l6ZTogJWRcbiIsCisJCURldmljZUluZm8ud0RldmljZU1haW5BcmVhU2l6ZSk7CisJbmFuZF9kYmdfcHJpbnQoTkFORF9EQkdfREVCVUcsICJEZXZpY2VTcGFyZUFyZWFTaXplOiAlZFxuIiwKKwkJRGV2aWNlSW5mby53RGV2aWNlU3BhcmVBcmVhU2l6ZSk7CisJbmFuZF9kYmdfcHJpbnQoTkFORF9EQkdfREVCVUcsICJEZXZpY2VzQ29ubmVjdGVkOiAlZFxuIiwKKwkJRGV2aWNlSW5mby53RGV2aWNlc0Nvbm5lY3RlZCk7CisJbmFuZF9kYmdfcHJpbnQoTkFORF9EQkdfREVCVUcsICJEZXZpY2VXaWR0aDogJWRcbiIsCisJCURldmljZUluZm8ud0RldmljZVdpZHRoKTsKKwluYW5kX2RiZ19wcmludChOQU5EX0RCR19ERUJVRywgIkhXUmV2aXNpb246IDB4JXhcbiIsCisJCURldmljZUluZm8ud0hXUmV2aXNpb24pOworCW5hbmRfZGJnX3ByaW50KE5BTkRfREJHX0RFQlVHLCAiSFdGZWF0dXJlczogMHgleFxuIiwKKwkJRGV2aWNlSW5mby53SFdGZWF0dXJlcyk7CisJbmFuZF9kYmdfcHJpbnQoTkFORF9EQkd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9fb2ZfcGxhbmVzKSB7CisJY2FzZSAwOgorCWNhc2UgMToKKwljYXNlIDM6CisJY2FzZSA3OgorCQlEZXZpY2VJbmZvLmJQbGFuZU51bSA9IG5vX29mX3BsYW5lcyArIDE7CisJCWJyZWFrOworCWRlZmF1bHQ6CisJCXN0YXR1cyA9IEZBSUw7CisJCWJyZWFrOworCX0KKworCWZpbmRfdmFsaWRfYmFua3MoKTsKKworCWRldGVjdF9wYXJ0aXRpb25fZmVhdHVyZSgpOworCisJZHVtcF9kZXZpY2VfaW5mbygpOworCisJcmV0dXJuIHN0YXR1czsKK30KKwordTE2IE5BTkRfVW5sb2NrQXJyYXlBbGwodm9pZCkKK3sKKwl1NjQgc3RhcnRfYWRkciwgZW5kX2FkZHI7CisKKwluYW5kX2RiZ19wcmludChOQU5EX0RCR19UUkFDRSwgIiVzLCBMaW5lICVkLCBGdW5jdGlvbjogJXNcbiIsCisJCSAgICAgICBfX0ZJTEVfXywgX19MSU5FX18sIF9fZnVuY19fKTsKKworCXN0YXJ0X2FkZHIgPSAwOworCWVuZF9hZGRyID0gKCh1NjQpRGV2aWNlSW5mby53QmxvY2tTaXplICoKKwkJKERldmljZUluZm8ud1RvdGFsQmxvY2tzIC0gMSkpID4+CisJCURldmljZUluZm8ubkJpdHNJblBhZ2VEYXRhU2l6ZTsKKworCWluZGV4X2FkZHIoKHUzMikoTU9ERV8xMCB8ICh1MzIpc3RhcnRfYWRkciksIDB4MTApOworCWluZGV4X2FkZHIoKHUzMikoTU9ERV8xMCB8ICh1MzIpZW5kX2FkZHIpLCAweDExKTsKKworCXJldHVybiBQQVNTOworfQorCit2b2lkIE5BTkRfTExEX0VuYWJsZV9EaXNhYmxlX0ludGVycnVwdHModTE2IElOVF9FTkFCTEUpCit7CisJbmFuZF9kYmdfcHJpbnQoTkFORF9EQkdfVFJBQ0UsICIlcywgTGluZSAlZCwgRnVuY3Rpb246ICVzXG4iLAorCQkgICAgICAgX19GSUxFX18sIF9fTElORV9fLCBfX2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9WRVJTSU9OICAgICAgICAgICJkcml2ZXIgdmVyc2lvbiAyMDEwMDMxMSIKKworCisvKioqKiogQ29tbW9uIFBhcmFtZXRlcnMgKioqKiovCisjZGVmaW5lIFJFVFJZX1RJTUVTICAgICAgICAgICAgICAgICAgIDMKKworI2RlZmluZSBSRUFEX0JBREJMT0NLX0lORk8gICAgICAgICAgICAxCisjZGVmaW5lIFJFQURCQUNLX1ZFUklGWSAgICAgICAgICAgICAgIDAKKyNkZWZpbmUgQVVUT19GT1JNQVRfRkxBU0ggICAgICAgICAgICAgMAorCisvKioqKiogQ2FjaGUgUGFyYW1ldGVycyAqKioqKi8KKyNkZWZpbmUgQ0FDSEVfSVRFTV9OVU0gICAgICAgICAgICAxMjgKKyNkZWZpbmUgQkxLX05VTV9GT1JfTDJfQ0FDSEUgICAgICAgIDE2CisKKy8qKioqKiBCbG9jayBUYWJsZSBQYXJhbWV0ZXJzICoqKioqLworI2RlZmluZSBCTE9DS19UQUJMRV9JTkRFWCAgICAgICAgICAgICAwCisKKy8qKioqKiBXZWFyIExldmVsaW5nIFBhcmFtZXRlcnMgKioqKiovCisjZGVmaW5lIFdFQVJfTEVWRUxJTkdfR0FURSAgICAgICAgIDB4MTAKKyNkZWZpbmUgV0VBUl9MRVZFTElOR19CTE9DS19OVU0gICAgICAxMAorCisjZGVmaW5lIERFQlVHX0JORFJZICAgICAgICAgICAgIDAKKworLyoqKioqIFByb2R1Y3QgRmVhdHVyZSBTdXBwb3J0ICoqKioqLworI2RlZmluZSBGTEFTSF9FTVUgICAgICAgICAgICAgICBkZWZpbmVkKENPTkZJR19TUEVDVFJBX0VNVSkKKyNkZWZpbmUgRkxBU0hfTkFORCAgICAgICAgICAgICAgZGVmaW5lZChDT05GSUdfU1BFQ1RSQV9NUlNUX0hXKQorI2RlZmluZSBGTEFTSF9NVEQgICAgICAgICAgICAgICBkZWZpbmVkKENPTkZJR19TUEVDVFJBX01URCkKKyNkZWZpbmUgQ01EX0RNQSAgICAgICAgICA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NkZWZpbmUgICBEU1BfTUFJTEJPWDFfSU5UICAgICAgICAgICAgICAxMAorLyoKKyAqICBCaXQgZGVmaW5pdGlvbiBvZiAgSW50ZXJydXB0ICBMZXZlbCAgUmVnaXN0ZXJzCisgKi8KKworLyogTWFpbCBCb3ggZGVmaW5lcyAqLworI2RlZmluZSBNQl9BUk0yRFNQMV9SRUdfT0ZGU0VUICAgICAgICAgIDB4MDAKKworI2RlZmluZSBNQl9BUk0yRFNQMUJfUkVHX09GRlNFVCAgICAgICAgIDB4MDQKKworI2RlZmluZSBNQl9EU1AyQVJNMUJfUkVHX09GRlNFVCAgICAgICAgIDB4MEMKKworI2RlZmluZSBNQl9BUk0yRFNQMV9GTEFHX1JFR19PRkZTRVQgICAgIDB4MTgKKworI2RlZmluZSBNQl9BUk0yRFNQX0ZMQUcgICAgICAgICAgICAgICAgIDB4MDAwMQorCisjZGVmaW5lIE1CT1hfQVJNMkRTUCBIV19NQk9YX0lEMAorI2RlZmluZSBNQk9YX0RTUDJBUk0gSFdfTUJPWF9JRDEKKyNkZWZpbmUgTUJPWF9BUk0gSFdfTUJPWF9VMF9BUk0KKyNkZWZpbmUgTUJPWF9EU1AgSFdfTUJPWF9VMV9EU1AxCisKKyNkZWZpbmUgRU5BQkxFICAgICAgICAgICAgICAgICAgICAgICAgICB0cnVlCisjZGVmaW5lIERJU0FCTEUgICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2UKKworI2RlZmluZSBISUdIX0xFVkVMICAgICAgICAgICAgICAgICAgICAgIHRydWUKKyNkZWZpbmUgTE9XX0xFVkVMICAgICAgICAgICAgICAgICAgICAgICBmYWxzZQorCisvKiBNYWNybydzICovCisjZGVmaW5lIENMRUFSX0JJVChyZWcsIG1hc2spICAgICAgICAgICAgIChyZWcgJj0gfm1hc2spCisjZGVmaW5lIFNFVF9CSVQocmVnLCBtYXNrKSAgICAgICAgICAgICAgIChyZWcgfD0gbWFzaykKKworI2RlZmluZSBTRVRfR1JPVVBfQklUUzE2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lkZ2VfY2hubF9kZXN0cm95KGNobmxfbWdyX29iaik7CisJCSpjaGFubmVsX21nciA9IE5VTEw7CisJfSBlbHNlIHsKKwkJLyogUmV0dXJuIGNoYW5uZWwgbWFuYWdlciBvYmplY3QgdG8gY2FsbGVyLi4uICovCisJCSpjaGFubmVsX21nciA9IGNobmxfbWdyX29iajsKKwl9CisJcmV0dXJuIHN0YXR1czsKK30KKworLyoKKyAqICA9PT09PT09PSBicmlkZ2VfY2hubF9kZXN0cm95ID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgQ2xvc2UgYWxsIG9wZW4gY2hhbm5lbHMsIGFuZCBkZXN0cm95IHRoZSBjaGFubmVsIG1hbmFnZXIuCisgKi8KK2ludCBicmlkZ2VfY2hubF9kZXN0cm95KHN0cnVjdCBjaG5sX21nciAqaGNobmxfbWdyKQoreworCWludCBzdGF0dXMgPSAwOworCXN0cnVjdCBjaG5sX21nciAqY2hubF9tZ3Jfb2JqID0gaGNobmxfbWdyOworCXUzMiBjaG5sX2lkOworCisJaWYgKGhjaG5sX21ncikgeworCQkvKiBDbG9zZSBhbGwgb3BlbiBjaGFubmVsczogKi8KKwkJZm9yIChjaG5sX2lkID0gMDsgY2hubF9pZCA8IGNobmxfbWdyX29iai0+bWF4X2NoYW5uZWxzOworCQkgICAgIGNobmxfaWQrKykgeworCQkJc3RhdHVzID0KKwkJCSAgICBicmlkZ2VfY2hubF9jbG9zZShjaG5sX21ncl9vYmotPmFwX2NoYW5uZWwKKwkJCQkJICAgICAgW2NobmxfaWRdKTsKKwkJCWlmIChzdGF0dXMpCisJCQkJZGV2X2RiZyhicmlkZ2UsICIlczogRXJyb3Igc3RhdHVzIDB4JXhcbiIsCisJCQkJCV9fZnVuY19fLCBzdGF0dXMpOworCQl9CisKKwkJLyogRnJlZSBjaGFubmVsIG1hbmFnZXIgb2JqZWN0OiAqLworCQlrZnJlZShjaG5sX21ncl9vYmotPmFwX2NoYW5uZWwpOworCisJCS8qIFNldCBoY2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N0cnVjdCBjaG5sX21nciAqY2hubF9tZ3Jfb2JqID0gKHN0cnVjdCBjaG5sX21nciAqKWhjaG5sX21ncjsKKworCWlmIChtZ3JfaW5mbyAhPSBOVUxMKSB7CisJCWlmIChjaF9pZCA8PSBDSE5MX01BWENIQU5ORUxTKSB7CisJCQlpZiAoaGNobmxfbWdyKSB7CisJCQkJLyogUmV0dXJuIHRoZSByZXF1ZXN0ZWQgaW5mb3JtYXRpb246ICovCisJCQkJbWdyX2luZm8tPmNobmxfb2JqID0KKwkJCQkgICAgY2hubF9tZ3Jfb2JqLT5hcF9jaGFubmVsW2NoX2lkXTsKKwkJCQltZ3JfaW5mby0+b3Blbl9jaGFubmVscyA9CisJCQkJICAgIGNobmxfbWdyX29iai0+b3Blbl9jaGFubmVsczsKKwkJCQltZ3JfaW5mby0+ZHdfdHlwZSA9IGNobmxfbWdyX29iai0+ZHdfdHlwZTsKKwkJCQkvKiB0b3RhbCAjIG9mIGNobmxzICovCisJCQkJbWdyX2luZm8tPm1heF9jaGFubmVscyA9CisJCQkJICAgIGNobmxfbWdyX29iai0+bWF4X2NoYW5uZWxzOworCQkJfSBlbHNlIHsKKwkJCQlzdGF0dXMgPSAtRUZBVUxUOworCQkJfQorCQl9IGVsc2UgeworCQkJc3RhdHVzID0gLUVDSFJORzsKKwkJfQorCX0gZWxzZSB7CisJCXN0YXR1cyA9IC1FRkFVTFQ7CisJfQorCisJcmV0dXJuIHN0YXR1czsKK30KKworLyoKKyAqICA9PT09PT09PSBicmlkZ2VfY2hubF9pZGxlID09PT09PT09CisgKiAgICAgIElkbGVzIGEgcGFydGljdWxhciBjaGFubmVsLgorICovCitpbnQgYnJpZGdlX2NobmxfaWRsZShzdHJ1Y3QgY2hubF9vYmplY3QgKmNobmxfb2JqLCB1MzIgdGltZW91dCwKKwkJCSAgICBib29sIGZsdXNoX2RhdGEpCit7CisJczggY2hubF9tb2RlOworCXN0cnVjdCBjaG5sX21nciAqY2hubF9tZ3Jfb2JqOworCWlud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wlrZnJlZShjaGlycF9saXN0KTsKK30KKworLyoKKyAqICA9PT09PT09PSBtYWtlX25ld19jaGlycCA9PT09PT09PQorICogICAgICBBbGxvY2F0ZSB0aGUgbWVtb3J5IGZvciBhIG5ldyBjaGFubmVsIElSUC4KKyAqLworc3RhdGljIHN0cnVjdCBjaG5sX2lycCAqbWFrZV9uZXdfY2hpcnAodm9pZCkKK3sKKwlzdHJ1Y3QgY2hubF9pcnAgKmNobmxfcGFja2V0X29iajsKKworCWNobmxfcGFja2V0X29iaiA9IGt6YWxsb2Moc2l6ZW9mKHN0cnVjdCBjaG5sX2lycCksIEdGUF9LRVJORUwpOworCWlmIChjaG5sX3BhY2tldF9vYmogIT0gTlVMTCkgeworCQkvKiBsc3RfaW5pdF9lbGVtIG9ubHkgcmVzZXRzIHRoZSBsaXN0J3MgbWVtYmVyIHZhbHVlcy4gKi8KKwkJbHN0X2luaXRfZWxlbSgmY2hubF9wYWNrZXRfb2JqLT5saW5rKTsKKwl9CisKKwlyZXR1cm4gY2hubF9wYWNrZXRfb2JqOworfQorCisvKgorICogID09PT09PT09IHNlYXJjaF9mcmVlX2NoYW5uZWwgPT09PT09PT0KKyAqICAgICAgU2VhcmNoIGZvciBhIGZyZWUgY2hhbm5lbCBzbG90IGluIHRoZSBhcnJheSBvZiBjaGFubmVsIHBvaW50ZXJzLgorICovCitzdGF0aWMgaW50IHNlYXJjaF9mcmVlX2NoYW5uZWwoc3RydWN0IGNobmxfbWdyICpjaG5sX21ncl9vYmosCisJCQkJICAgICAgdTMyICpjaG5sKQoreworCWludCBzdGF0dXMgPSAtRU5PU1I7CisJdTMyIGk7CisKKwlEQkNfUkVRVUlSRShjaG5sX21ncl9vYmopOworCisJZm9yIChpID0gMDsgaSA8IGNobmxfbWdyX29iai0+bWF4X2NoYW5uZWxzOyBpKyspIHsKKwkJaWYgKGNobmxfbWdyX29iai0+YXBfY2hhbm5lbFtpXSA9PSBOVUxMKSB7CisJCQlzdGF0dXMgPSAwOworCQkJ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50ZiBzdHlsZQorICoJLi4uCQlhZGRpdGlvbmFsIGluZm9ybWF0aW9uCisgKgorICogRWZmZWN0OgorICoJUmVwb3J0cyBvciByZWNvcmRzIHRoZSBlcnJvciBhcyBhcHByb3ByaWF0ZS4KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwordm9pZCBkbG9hZF9lcnJvcihzdHJ1Y3QgZGxvYWRfc3RhdGUgKmRsdGhpcywgY29uc3QgY2hhciAqZXJydHh0LCAuLi4pCit7CisJdmFfbGlzdCBhcmdzOworCisJdmFfc3RhcnQoYXJncywgZXJydHh0KTsKKwlkbHRoaXMtPm15c3ltLT5lcnJvcl9yZXBvcnQoZGx0aGlzLT5teXN5bSwgZXJydHh0LCBhcmdzKTsKKwl2YV9lbmQoYXJncyk7CisJZGx0aGlzLT5kbG9hZF9lcnJjb3VudCArPSAxOworCit9CQkJCS8qIGRsb2FkX2Vycm9yICovCisKKyNkZWZpbmUgRExfRVJST1IoenphLCB6emIpIGRsb2FkX2Vycm9yKGRsdGhpcywgenphLCB6emIpCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBQcm9jZWR1cmUgZGxvYWRfc3ltc19lcnJvcgorICoKKyAqIFBhcmFtZXRlcnM6CisgKgllcnJ0eHQJZGVzY3JpcHRpb24gb2YgdGhlIGVycm9yLCBwcmludGYgc3R5bGUKKyAqCS4uLgkJYWRkaXRpb25hbCBpbmZvcm1hdGlvbgorICoKKyAqIEVmZmVjdDoKKyAqCVJlcG9ydHMgb3IgcmVjb3JkcyB0aGUgZXJyb3IgYXMgYXBwcm9wcmlhdGUuCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KK3ZvaWQgZGxvYWRfc3ltc19lcn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gY29uc3QgY2hhciBzZWNuX2VycmlkW10gPSB7ICJzZWN0aW9uIiB9OworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogUHJvY2VkdXJlIGRsb2FkX3NlY3Rpb25zCisgKgorICogUGFyYW1ldGVyczoKKyAqCW5vbmUKKyAqCisgKiBFZmZlY3Q6CisgKglMb2FkcyB0aGUgc2VjdGlvbiByZWNvcmRzIGludG8gYW4gaW50ZXJuYWwgdGFibGUuCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KK3ZvaWQgZGxvYWRfc2VjdGlvbnMoc3RydWN0IGRsb2FkX3N0YXRlICpkbHRoaXMpCit7CisJczE2IHNpejsKKwlzdHJ1Y3QgZG9mZl9zY25oZHJfdCAqc2hwOworCXVuc2lnbmVkIG5zZWNzID0gZGx0aGlzLT5kZmlsZV9oZHIuZGZfbm9fc2NuczsKKworCS8qIGFsbG9jYXRlIHNwYWNlIGZvciB0aGUgRE9GRiBzZWN0aW9uIHJlY29yZHMgKi8KKwlzaXogPSBuc2VjcyAqIHNpemVvZihzdHJ1Y3QgZG9mZl9zY25oZHJfdCk7CisJc2hwID0KKwkgICAgKHN0cnVjdCBkb2ZmX3Njbmhkcl90ICopZGx0aGlzLT5teXN5bS0+ZGxvYWRfYWxsb2NhdGUoZGx0aGlzLT5teXN5bSwKKwkJCQkJCQkJICBzaXopOworCWlmICghc2hwKSB7CQkvKiBub3QgZW5vdWdoIHN0b3JhZ2UgKi8KKwkJRExfRVJST1IoZXJyX2FsbG9jLCBzaXopOworCQlyZXR1cm47CisJfQorCWRsdGhpcy0+c2VjdF9oZHJzID0gc2hwOworCisJLyogcmVhZCBpbiB0aGUgc2VjdGlvbiByZWNvcmRzICovCisJaWYgKGRsdGhpcy0+c3RybS0+cmVhZF9idWZmZXIoZGx0aGlzLT5zdHJtLCBzaHAsIHNpeikgIT0gc2l6KSB7CisJCURMX0VSUk9SKHJlYWRzdHJtLCBzZWNuX2VycmlkKTsKKwkJcmV0dXJuOworCX0KKworCS8qIGlmIHdlIG5lZWQgdG8gZml4IHVwIGJ5dGUgb3JkZXIsIGRvIGl0IG5vdyAqLworCWlmIChkbHRoaXMtPnJlb3JkZXJfbWFwKQorCQlkbG9hZF9yZW9yZGVyKHNocCwgc2l6LCBkbHRoaXMtPnJlb3JkZXJfbWFwKTsKKworCS8qIGNoZWNrIGZvciB2YWxpZGl0eSAqLworCWlmICh+ZGxvYWRfY2hlY2tzdW0oZGx0aGlzLT5zZWN0X2hkcnMsIHNpeikgIT0KKwkgICAgZGx0aGlzLT52ZXJpZnkuZHZfc2NuX3JlY19jaGVja3N1bSkgeworCQlETF9FUlJPUihlcnJfY2hlY2tzdW0sIHNlY25fZXJyaWQpOworCQlyZXR1cm47CisJfQorCit9CQkJCS8qIGRsb2FkX3NlY3Rpb25zICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogUHJvY2VkdXJlIGFsbG9jYXRlX3NlY3Rpb25zCisgKgorICogUGFyYW1ldGVyczoKKyAqCWFsbG9jCXRhcmdldCBtZW1vcnkgYWxsb2NhdG9yIGNsYXNzCisgKgorICogRWZmZWN0OgorICoJQXNzaWducyBuZXcgKHRhcmdldCkgYWRkcmVzc2VzIGZvciBzZWN0aW9ucworICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KK3N0YXRpYyB2b2lkIGFsbG9jYXRlX3NlY3Rpb25zKHN0cnVjdCBkbG9hZF9zdGF0ZSAqZGx0aGlzKQoreworCXUxNiBjdXJyX3NlY3QsIG5zZWNzLCBzaXo7CisJc3RydWN0IGRvZmZfc2NuaGRyX3QgKnNocDsKKw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kciAtIHNocC0+ZHNfcGFkZHI7CisJCQlkbHRoaXMtPmFsbG9jYXRlZF9zZWNuX2NvdW50ICs9IDE7CisJCX0JCS8qIGFsbG9jYXRlIHRhcmdldCBzdG9yYWdlICovCisJCXNocCArPSAxOworCQlhc2VjcyArPSAxOworCX0KKyNpZiBCSVRTX1BFUl9BVSA8PSBCSVRTX1BFUl9CWVRFCisJZGx0aGlzLT5kZWJ1Z19zdHJpbmdfc2l6ZSArPQorCSAgICBzdHJsZW4oZGx0aGlzLT5zdHJfaGVhZCArIGRsdGhpcy0+ZGVidWdfc3RyaW5nX3NpemUpICsgMTsKKyNlbmRpZgorfQkJCQkvKiBhbGxvY2F0ZSBzZWN0aW9ucyAqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogUHJvY2VkdXJlIHNlY3Rpb25fdGFibGVfZnJlZQorICoKKyAqIFBhcmFtZXRlcnM6CisgKglub25lCisgKgorICogRWZmZWN0OgorICoJRnJlZXMgYW55IHN0YXRlIHVzZWQgYnkgdGhlIHN5bWJvbCB0YWJsZS4KKyAqCisgKiBXQVJOSU5HOgorICoJVGhpcyByb3V0aW5lIGlzIG5vdCBhbGxvd2VkIHRvIGRlY2xhcmUgZXJyb3JzIQorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCitzdGF0aWMgdm9pZCBzZWN0aW9uX3RhYmxlX2ZyZWUoc3RydWN0IGRsb2FkX3N0YXRlICpkbHRoaXMpCit7CisJc3RydWN0IGRvZmZfc2NuaGRyX3QgKnNocDsKKworCXNocCA9IGRsdGhpcy0+c2VjdF9oZHJzOworCWlmIChzaHApCisJCWRsdGhpcy0+bXlzeW0tPmRsb2FkX2RlYWxsb2NhdGUoZGx0aGlzLT5teXN5bSwgc2hwKTsKKworfQkJCQkvKiBzZWN0aW9uX3RhYmxlX2ZyZWUgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIFByb2NlZHVyZSBkbG9hZF9zdHJpbmdzCisgKgorICogUGFyYW1ldGVyczoKKyAqICBzZWNfbmFtZXNfb25seSAgIElmIHRydWUgb25seSByZWFkIGluIHRoZSAic2VjdGlvbiBuYW1lcyIKKyAqCQkgICAgIHBvcnRpb24gb2YgdGhlIHN0cmluZyB0YWJsZQorICoKKyAqIEVmZmVjdDoKKyAqCUxvYWRzIHRoZSBET0ZGIHN0cmluZyB0YWJsZSBpbnRvIG1lbW9yeS4gRE9GRiBrZWVwcyBhbGwgc3RyaW5ncyBpbiBhCisgKiBiaWcgdW5zb3J0ZWQgYXJyYXkuICBXZSBqdXN0IHJlYWQgdGhhdCBhcnJheSBpbnRvIG1lbW9yeSBpbiBidWxrLgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCitzdGF0aWMgY29uc3QgY2hhciBzdHJpbmd0YmxbXSA9IHsgInN0cmluZyB0YWJsZSIgfTsKKwordm9pZCBkbG9hZF9zdHJpbmdzKHN0cnVjdCBkbG9hZF9zdGF0ZSAqZGx0aGlzLCBib29sIHNlY19uYW1lc19vbmx5KQoreworCXUzMiBzc2l6OworCWNoYXIgKnN0cmJ1ZjsKKworCWlmIChzZWNfbmFtZXNfb25seSkgeworCQlzc2l6ID0gQllURV9UT19IT1NUKERPRkZfQUxJR04KKwkJCQkgICAgKGRsdGhpcy0+ZGZpbGVfaGRyLmRmX3Njbl9uYW1lX3NpemUpKTsKKwl9IGVsc2UgeworCQlzc2l6ID0gQllURV9UT19IT1NUKERPRkZfQUxJR04KKwkJCQkgICAgKGRsdGhpcy0+ZGZpbGVfaGRyLmRmX3N0cnRhYl9zaXplKSk7CisJfQorCWlmIChzc2l6ID09IDApCisJCXJldHVybj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ZG9lcyBub3QgIG5lY2Vzc2FyaWx5IHByb2Nlc3MgdGhlIHdob2xlCisgKiAuY2luaXQgc2VjdGlvbiBpbiBvbmUgYnVmZmVyLCBjbG9hZF9jaW5pdCgpIG11c3QgYmUgcHJlcGFyZWQgdG8KKyAqIGludGVycHJldCB0aGUgZGF0YSBwaWVjZW1lYWwuICBBIHN0YXRlIG1hY2hpbmUgaXMgdXNlZCBmb3IgdGhpcworICogcHVycG9zZS4KKyAqLworCisvKiBUaGUgZm9sbG93aW5nIGFyZSBvbmx5IGZvciB1c2UgYnkgcmVsb2MuYyBhbmQgdGhpbmdzIGl0IGNhbGxzICovCitzdGF0aWMgY29uc3Qgc3RydWN0IGxkcl9zZWN0aW9uX2luZm8gY2luaXRfaW5mb19pbml0ID0geyBjaW5pdG5hbWUsIDAsIDAsCisJKGxkcl9hZGRyKS0xLCAwLCBETE9BRF9CU1MsIDAKK307CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBQcm9jZWR1cmUgY2xvYWRfY2luaXQKKyAqCisgKiBQYXJhbWV0ZXJzOgorICoJaXBhY2tldAkJUG9pbnRlciB0byBkYXRhIHBhY2tldCB0byBiZSBsb2FkZWQKKyAqCisgKiBFZmZlY3Q6CisgKglJbnRlcnByZXRzIHRoZSBkYXRhIGluIHRoZSBidWZmZXIgYXMgLmNpbml0IGRhdGEsIGFuZCBwZXJmb3JtcyB0aGUKKyAqIGFwcHJvcHJpYXRlIGluaXRpYWxpemF0aW9ucy4KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworc3RhdGljIHZvaWQgY2xvYWRfY2luaXQoc3RydWN0IGRsb2FkX3N0YXRlICpkbHRoaXMsCisJCQlzdHJ1Y3QgaW1hZ2VfcGFja2V0X3QgKmlwYWNrZXQpCit7CisjaWYgVERBV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ioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogUHJvY2VkdXJlIGRsb2FkX2NoZWNrc3VtCisgKgorICogUGFyYW1ldGVyczoKKyAqCWRhdGEJMzItYml0IGFsaWduZWQgcG9pbnRlciB0byBkYXRhIHRvIGJlIGNoZWNrc3VtbWVkCisgKglzaXoJCXNpemUgb2YgdGhlIGRhdGEgdG8gYmUgY2hlY2tzdW1tZWQgaW4gc2l6ZW9mKCkgdW5pdHMuCisgKgorICogRWZmZWN0OgorICoJUmV0dXJucyBhIGNoZWNrc3VtIG9mIHRoZSBzcGVjaWZpZWQgYmxvY2sKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KK3UzMiBkbG9hZF9jaGVja3N1bSh2b2lkICpkYXRhLCB1bnNpZ25lZCBzaXopCit7CisJdTMyIHN1bTsKKwl1MzIgKmRwOworCWludCBsZWZ0OworCisJc3VtID0gMDsKKwlkcCA9ICh1MzIgKikgZGF0YTsKKwlmb3IgKGxlZnQgPSBzaXo7IGxlZnQgPiAwOyBsZWZ0IC09IHNpemVvZih1MzIpKQorCQlzdW0gKz0gKmRwKys7CisJcmV0dXJuIHN1bTsKK30JCQkJLyogZGxvYWRfY2hlY2tzdW0gKi8KKworI2lmIEhPU1RfRU5ESUFOTkVTUworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIFByb2NlZHVyZSBkbG9hZF9yZXZlcnNlX2NoZWNrc3VtCisgKgorICogUGFyYW1ldGVyczoKKyAqCWRhdGEJMzItYml0IGFsaWduZWQgcG9pbnRlciB0byBkYXRhIHRvIGJlIGNoZWNrc3VtbWVkCisgKglzaXoJCXNpemUgb2YgdGhlIGRhdGEgdG8gYmUgY2hlY2tzdW1tZWQga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BPRkZTRVQgICAgX3VfcmVsb2MuX3JfZmllbGQuX29mZnNldAorI2RlZmluZSBGSUVMRFNaICAgX3VfcmVsb2MuX3JfZmllbGQuX2ZpZWxkc3oKKyNkZWZpbmUgV09SRFNaICAgIF91X3JlbG9jLl9yX2ZpZWxkLl93b3Jkc3oKKyNkZWZpbmUgUl9ESVNQICAgICAgX3VfcmVsb2MuX3Jfc3ltLl9kaXNwCisjZW5kaWYKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qICovCisvKiBJbXBvcnRhbnQgRE9GRiBtYWNyb3MgdXNlZCBmb3IgZmlsZSBwcm9jZXNzaW5nICovCisvKiAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworLyogRE9GRiBWZXJzaW9ucyAqLworI2RlZmluZSAgICAgICAgIERPRkYwICAgICAgICAgICAgICAgICAgICAgICAwCisKKy8qIFJldHVybiB0aGUgYWRkcmVzcy9zaXplID49IHRvIGFkZHIgdGhhdCBpcyBhdCBhIDMyLWJpdCBib3VuZGFyeSAqLworLyogVGhpcyBhc3N1bWVzIHRoYXQgYSBieXRlIGlzIDggYml0cyAqLworI2RlZmluZSAgICAgICAgIERPRkZfQUxJR04oYWRkcikgICAgICAgICAgICAoKChhZGRyKSArIDMpICYgfjNVTCkKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qICovCisvKiBUaGUgRE9GRiBzZWN0aW9uIGhlYWRlciBmbGFncyBmaWVsZCBpcyBsYWlkIG91dCBhcyBmb2xsb3dzOiAqLworLyogKi8KKy8qICBCaXRzIDAtMyA6IFNlY3Rpb24gVHlwZSAqLworLyogIEJpdCAgICA0IDogU2V0IHdoZW4g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CSVRTX1BFUl9CWVRFCitzdGF0aWMgY29uc3QgY2hhciBlcnJfYWxsb2NbXSA9IHsgIlN5bXMtPmRsb2FkX2FsbG9jYXRlKCAlZCApIGZhaWxlZCIgfTsKK3N0YXRpYyBjb25zdCBjaGFyIHN0YmxbXSA9IHsgIkJhZCBzdHJpbmcgdGFibGUgb2Zmc2V0ICIgRk1UX1VJMzIgfTsKKyNlbmRpZgorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qKioqKioqKioqKioqKioqKioqKiogU1VQUE9SVCBGVU5DVElPTlMgKioqKioqKioqKioqKioqKioqKioqKiAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKyNpZiBCSVRTX1BFUl9BVSA+IEJJVFNfUEVSX0JZVEUKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogUHJvY2VkdXJlIHVucGFja19zZWNfbmFtZQorICoKKyAqIFBhcmFtZXRlcnM6CisgKiAgZGx0aGlzCQlIYW5kbGUgZnJvbSBkbG9hZF9tb2R1bGVfb3BlbiBmb3IgdGhpcyBtb2R1bGUKKyAqCXNvZmZzZXQJICAgIEJ5dGUgb2Zmc2V0IGludG8gdGhlIHN0cmluZyB0YWJsZQorICogIGRzdCAgICAgICAgIFBsYWNlIHRvIHN0b3JlIHRoZSBleHBhbmRlZCBzdHJpbmcKKyAqCisgKiBFZmZlY3Q6CisgKglTdG9yZXMgYSBzdHJpbmcgZnJvbSB0aGUgc3RyaW5nIHRhYmxlIGludG8gdGhlIGRlc3RpbmF0aW9uLCBleHBhbmRpbmcKKyAqIGl0IGluIHRoZSBwcm9jZXNzLiAgUmV0dXJucyBhIHBvaW50ZXIganVzdCBwYXN0IHRoZSBlbmQgb2YgdGhlIHN0b3JlZ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9IChzdHJ1Y3QgbGRyX3NlY3Rpb25faW5mbyAqKSZkbHRoaXMtPnNlY3RfaGRyc1tzZWNdOworCQluZXh0ID0gdW5wYWNrX3NlY19uYW1lKGRsdGhpcywgKih1MzIgKikgJnNocC0+bmFtZSwgY3Vycik7CisJCWlmIChuZXh0ID09IE5VTEwpCisJCQlicmVhazsJLyogZXJyb3IgKi8KKwkJc2hwLT5uYW1lID0gY3VycjsKKwkJY3VyciA9IG5leHQ7CisJfQorfQorCisjZW5kaWYKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKioqKioqKioqKioqKioqKioqKioqIEVYUE9SVEVEIEZVTkNUSU9OUyAqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIFByb2NlZHVyZSBkbG9hZF9tb2R1bGVfb3BlbgorICoKKyAqIFBhcmFtZXRlcnM6CisgKgltb2R1bGUJVGhlIGlucHV0IHN0cmVhbSB0aGF0IHN1cHBsaWVzIHRoZSBtb2R1bGUgaW1hZ2UKKyAqCXN5bXMJSG9zdC1zaWRlIG1hbGxvYy9mcmVlIGFuZCBlcnJvciByZXBvcnRpbmcgZnVuY3Rpb25zLgorICoJCQlPdGhlciBtZXRob2RzIGFyZSB1bnVzZWQuCisgKgorICogRWZmZWN0OgorICoJUmVhZHMgaGVhZGVyIGluZm9ybWF0aW9uIGZyb20gYSBkeW5hbWljIGxvYWRlciBtb2R1bGUgdXNpbmcgdGhlCisgICAgc3BlY2lmaWVkCisgKiBzdHJlYW0gb2JqZWN0LCBhbmQgcmV0dXJucyBhIGhhbmRsZSBmb3IgdGhlIG1vZHVsZSBpbmZvcm1hdGlvbi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pOworCXUzMiBiaXQ7CisJdTMyICp3b3JkOworCisJZm9yICh3b3JkID0gbWFwLT53b3JkcywgaSA9IDA7IGkgPCBtYXAtPndjbnQ7IHdvcmQrKywgaSsrKSB7CisJCWlmICh+KndvcmQpIHsKKwkJCWZvciAoYml0ID0gMDsgYml0IDwgQklUU19QRVJfTE9ORzsgYml0KyssIGJpdF9hY2MrKykgeworCQkJCWlmIChiaXRfYWNjID09IG1hcC0+bGVuKQorCQkJCQlyZXR1cm4gR0JfTk9CSVRTOworCisJCQkJaWYgKH4qd29yZCAmICgxTCA8PCBiaXQpKSB7CisJCQkJCWJpdF9sb2NhdGlvbiA9IGkgKiBCSVRTX1BFUl9MT05HICsgYml0OworCQkJCQlyZXR1cm4gYml0X2xvY2F0aW9uOworCQkJCX0KKworCQkJfQorCQl9IGVsc2UgeworCQkJYml0X2FjYyArPSBCSVRTX1BFUl9MT05HOworCQl9CisJfQorCisJcmV0dXJuIEdCX05PQklUUzsKK30KKworLyoKKyAqICA9PT09PT09PSBnYl9zZXQgPT09PT09PT0KKyAqICBwdXJwb3NlOgorICogICAgICBTZXRzIGEgYml0IGluIHRoZSBiaXQgbWFwLgorICovCisKK3ZvaWQgZ2Jfc2V0KHN0cnVjdCBnYl90X21hcCAqbWFwLCB1MzIgYml0bikKK3sKKwl1MzIgbWFzazsKKworCW1hc2sgPSAxTCA8PCAoYml0biAlIEJJVFNfUEVSX0xPTkcpOworCW1hcC0+d29yZHNbYml0biAvIEJJVFNfUEVSX0xPTkddIHw9IG1hc2s7Cit9CisKKy8qCisgKiAgPT09PT09PT0gZ2JfdGVzdCA9PT09PT09PQorICogIHB1cnBvc2U6CisgKiAgICAgIFJldHVybnMgdHJ1ZSBpZiB0aGUgYml0IGlzIHNldCBpbiB0aGUgc3BlY2lmaWVkIGxvY2F0aW9uLgorICovCisKK2Jvb2wgZ2JfdGVzdChzdHJ1Y3QgZ2JfdF9tYXAgKm1hcCwgdTMyIGJpdG4pCit7CisJYm9vbCBzdG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cnRzIGEgc3RydWN0IGRzcF91dWlkIHRvIGEgc3RyaW5nLgorICogICAgICBOb3RlOiBzbnByaW50ZiBmb3JtYXQgc3BlY2lmaWVyIGlzOgorICogICAgICAlW2ZsYWdzXSBbd2lkdGhdIFsucHJlY2lzaW9uXSBbe2ggfCBsIHwgSTY0IHwgTH1ddHlwZQorICovCit2b2lkIHV1aWRfdXVpZF90b19zdHJpbmcoc3RydWN0IGRzcF91dWlkICp1dWlkX29iaiwgY2hhciAqc3pfdXVpZCwKKwkJCSBzMzIgc2l6ZSkKK3sKKwlzMzIgaTsJCQkvKiByZXR1cm4gcmVzdWx0IGZyb20gc25wcmludGYuICovCisKKwlEQkNfUkVRVUlSRSh1dWlkX29iaiAmJiBzel91dWlkKTsKKworCWkgPSBzbnByaW50Zihzel91dWlkLCBzaXplLAorCQkgICAgICIlLjhYXyUuNFhfJS40WF8lLjJYJS4yWF8lLjJYJS4yWCUuMlglLjJYJS4yWCUuMlgiLAorCQkgICAgIHV1aWRfb2JqLT51bF9kYXRhMSwgdXVpZF9vYmotPnVzX2RhdGEyLCB1dWlkX29iai0+dXNfZGF0YTMsCisJCSAgICAgdXVpZF9vYmotPnVjX2RhdGE0LCB1dWlkX29iai0+dWNfZGF0YTUsCisJCSAgICAgdXVpZF9vYmotPnVjX2RhdGE2WzBdLCB1dWlkX29iai0+dWNfZGF0YTZbMV0sCisJCSAgICAgdXVpZF9vYmotPnVjX2RhdGE2WzJdLCB1dWlkX29iai0+dWNfZGF0YTZbM10sCisJCSAgICAgdXVpZF9vYmotPnVjX2RhdGE2WzRdLCB1dWlkX29iai0+dWNfZGF0YTZbNV0pOworCisJREJDX0VOU1VSRShpICE9IC0xKTsKK30KKworc3RhdGljIHMzMiB1dWlkX2hleF90b19iaW4oY2hhciAqYnVmLCBzMzIgbGVuKQoreworCXMzMiBpOworCXMzMiByZXN1bHQgPSAwOworCWludCB2YWx1ZTsKKworCWZvciAoaSA9IDA7IGkgPCBsZW47IGkrKykgeworCQl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cmVzcyBvZiBpbnN0YW5jZSBvZiBNTVUgbW9kdWxlCisgKgorICogUkVUVVJOUzoKKyAqCisgKiAgICAgICBUeXBlCQk6IGh3X3N0YXR1cworICogICAgICAgRGVzY3JpcHRpb24gICAgIDogMAkJIC0tIE5vIGVycm9ycyBvY2N1cmVkCisgKgkJCSBSRVRfQkFEX05VTExfUEFSQU0gICAgIC0tIEEgUG9pbnRlcgorICoJCQkJCQlQYXJhbWF0ZXIgd2FzIHNldCB0byBOVUxMCisgKgorICogUFVSUE9TRToJICAgICAgOiBGbHVzaCB0aGUgVExCIGVudHJ5IHBvaW50ZWQgYnkgdGhlCisgKgkJCWxvY2sgY291bnRlciByZWdpc3RlcgorICoJCQlldmVuIGlmIHRoaXMgZW50cnkgaXMgc2V0IHByb3RlY3RlZAorICoKKyAqIE1FVEhPRDoJICAgICAgIDogQ2hlY2sgdGhlIElucHV0IHBhcmFtZXRlciBhbmQgRmx1c2ggYQorICoJCQkgc2luZ2xlIGVudHJ5IGluIHRoZSBUTEIuCisgKi8KK3N0YXRpYyBod19zdGF0dXMgbW11X2ZsdXNoX2VudHJ5KGNvbnN0IHZvaWQgX19pb21lbSAqYmFzZV9hZGRyZXNzKTsKKworLyoKKyAqIEZVTkNUSU9OCSAgICAgIDogbW11X3NldF9jYW1fZW50cnkKKyAqCisgKiBJTlBVVFM6CisgKgorICogICAgICAgSWRlbnRpZmllciAgICAgIDogYmFzZV9hZGRyZXNzCisgKiAgICAgICBUeXBFCQk6IGNvbnN0IHUzMgorICogICAgICAgRGVzY3JpcHRpb24gICAgIDogQmFzZSBBZGRyZXNzIG9mIGluc3RhbmNlIG9mIE1NVSBtb2R1bGUKKyAqCisgKiAgICAgICBJZGVudGlmaWVyICAgICAgOiBwYWdlX3N6CisgKiAgICAgICBUeXBFCQk6IGNvbnN0IHUzMgorICogICAgICAgRGVzY3JpcHRpb24gICAgIDogSXQgaW5kaWNhdGVzIHRoZSBwYWdlIHNpemUKKyAqCisgKiAgICAgICBJ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50cnkoY29uc3Qgdm9pZCBfX2lvbWVtICpiYXNlX2FkZHJlc3MsCisJCQkJICAgY29uc3QgdTMyIHBhZ2Vfc3osCisJCQkJICAgY29uc3QgdTMyIHByZXNlcnZlZF9iaXQsCisJCQkJICAgY29uc3QgdTMyIHZhbGlkX2JpdCwKKwkJCQkgICBjb25zdCB1MzIgdmlydHVhbF9hZGRyX3RhZyk7CisKKy8qCisgKiBGVU5DVElPTgkgICAgICA6IG1tdV9zZXRfcmFtX2VudHJ5CisgKgorICogSU5QVVRTOgorICoKKyAqICAgICAgIElkZW50aWZpZXIgICAgICA6IGJhc2VfYWRkcmVzcworICogICAgICAgVHlwZQkgICAgCTogY29uc3QgdTMyCisgKiAgICAgICBEZXNjcmlwdGlvbiAgICAgOiBCYXNlIEFkZHJlc3Mgb2YgaW5zdGFuY2Ugb2YgTU1VIG1vZHVsZQorICoKKyAqICAgICAgIElkZW50aWZpZXIgICAgICA6IHBoeXNpY2FsX2FkZHIKKyAqICAgICAgIFR5cGUJICAgIAk6IGNvbnN0IHUzMgorICogICAgICAgRGVzY3JpcHRpb24gICAgIDogUGh5c2ljYWwgQWRkcmVzcyB0byB3aGljaCB0aGUgY29ycmVzcG9uZGluZworICoJCQkgdmlydHVhbCAgIEFkZHJlc3Mgc2hvdWxkcG9pbnQKKyAqCisgKiAgICAgICBJZGVudGlmaWVyICAgICAgOiBlbmRpYW5pc20KKyAqICAgICAgIFR5cGUJICAgIAk6IGh3X2VuZGlhbmlzbV90CisgKiAgICAgICBEZXNjcmlwdGlvbiAgICAgOiBlbmRpYW5pc20gZm9yIHRoZSBnaXZlbiBwYWdlCisgKgorICogICAgICAgSWRlbnRpZmllciAgICAgIDogZWxlbWVudF9zaXplCisgKiAgICAgICBUeXBlCSAgICAJOiBod19lbGVtZW50X3NpemVfdAorICogICAgICAgRGVzY3JpcHRpb24gICAgIDogVGhlIGVsZW1lbnQgc2l6ZSAoIDgsMTYsIDMyIG9yIDY0IGJpdCkKKyAqCisgKi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NtX3QgZW5kaWFuaXNtOworCWVudW0gaHdfZWxlbWVudF9zaXplX3QgZWxlbWVudF9zaXplOworCWVudW0gaHdfbW11X21peGVkX3NpemVfdCBtaXhlZF9zaXplOworCWJvb2wgZG9ub3Rsb2NrbXB1cGFnZTsKK307CisKK2V4dGVybiBod19zdGF0dXMgaHdfbW11X2VuYWJsZShjb25zdCB2b2lkIF9faW9tZW0gKmJhc2VfYWRkcmVzcyk7CisKK2V4dGVybiBod19zdGF0dXMgaHdfbW11X2Rpc2FibGUoY29uc3Qgdm9pZCBfX2lvbWVtICpiYXNlX2FkZHJlc3MpOworCitleHRlcm4gaHdfc3RhdHVzIGh3X21tdV9udW1fbG9ja2VkX3NldChjb25zdCB2b2lkIF9faW9tZW0gKmJhc2VfYWRkcmVzcywKKwkJCQkgICAgICAgdTMyIG51bV9sb2NrZWRfZW50cmllcyk7CisKK2V4dGVybiBod19zdGF0dXMgaHdfbW11X3ZpY3RpbV9udW1fc2V0KGNvbnN0IHZvaWQgX19pb21lbSAqYmFzZV9hZGRyZXNzLAorCQkJCSAgICAgICB1MzIgdmljdGltX2VudHJ5X251bSk7CisKKy8qIEZvciBNTVUgZmF1bHRzICovCitleHRlcm4gaHdfc3RhdHVzIGh3X21tdV9ldmVudF9hY2soY29uc3Qgdm9pZCBfX2lvbWVtICpiYXNlX2FkZHJlc3MsCisJCQkJICB1MzIgaXJxX21hc2spOworCitleHRlcm4gaHdfc3RhdHVzIGh3X21tdV9ldmVudF9kaXNhYmxlKGNvbnN0IHZvaWQgX19pb21lbSAqYmFzZV9hZGRyZXNzLAorCQkJCSAgICAgIHUzMiBpcnFfbWFzayk7CisKK2V4dGVybiBod19zdGF0dXMgaHdfbW11X2V2ZW50X2VuYWJsZShjb25zdCB2b2lkIF9faW9tZW0gKmJhc2VfYWRkcmVzcywKKwkJCQkgICAgIHUzMiBpcnFfbWFzayk7CisKK2V4dGVybiBod19zdGF0dXMgaHdfbW11X2V2ZW50X3N0YXR1cyhjb25zdC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ljZSBPYmplY3QgaGFuZGxlIGZvciBhIGdpdmVuIGRldm5vZGUuCisgKiAgUGFyYW1ldGVyczoKKyAqICAgICAgZGV2X25vZGVfb2JqOiAgIFBsYXRmb3JtJ3MgZGV2X25vZGUgaGFuZGxlIHdlIGFyZSBzdG9yaW5nIHZhbHVlIHdpdGguCisgKiAgICAgIHZhbHVlOiAgICBBcmJpdHJhcnkgdmFsdWUgdG8gc3RvcmUuCisgKiAgUmV0dXJuczoKKyAqICAgICAgMDogICAgICAgICAgICAgICAgU3VjY2Vzcy4KKyAqICAgICAgLUVGQVVMVDogIGRldl9ub2RlX29iaiBpcyBpbnZhbGlkLgorICogICAgICAtRVBFUk06ICAgICAgICAgICAgICBJbnRlcm5hbCBFcnJvci4KKyAqICBSZXF1aXJlczoKKyAqICAgICAgQ0ZHIGluaXRpYWxpemVkLgorICogIEVuc3VyZXM6CisgKiAgICAgIDA6ICAgIFRoZSBQcml2YXRlIHUzMiB3YXMgc3VjY2Vzc2Z1bGx5IHNldC4KKyAqLworZXh0ZXJuIGludCBjZmdfc2V0X2Rldl9vYmplY3Qoc3RydWN0IGNmZ19kZXZub2RlICpkZXZfbm9kZV9vYmosCisJCQkJICAgICB1MzIgdmFsdWUpOworCisvKgorICogID09PT09PT09IENGR19TZXREcnZPYmplY3QgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBTdG9yZSB0aGUgRHJpdmVyIE9iamVjdCBoYW5kbGUuCisgKiAgUGFyYW1ldGVyczoKKyAqICAgICAgdmFsdWU6ICAgICAgICAgIEFyYml0cmFyeSB2YWx1ZSB0byBzdG9yZS4KKyAqICAgICAgZHdfdHlwZSAgICAgICAgICBUeXBlIG9mIE9iamVjdCB0byBTdG9yZQorICogIFJldHVybnM6CisgKiAgICAgIDA6ICAgICAgICBTdWNjZXNzLgorICogICAgICAtRVBFUk06ICAgICAgSW50ZXJuYWwgRXJyb3IuCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIENGRyBpbml0aWFsa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vciBvcGVuaW5nIG5ldyBjaGFubmVscworICogICAgICBhbmQgY2xvc2luZyBvbGQgb25lcyBmb3IgYSBnaXZlbiBib2FyZC4KKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBjaGFubmVsX21ncjogICAgTG9jYXRpb24gdG8gc3RvcmUgYSBjaGFubmVsIG1hbmFnZXIgb2JqZWN0IG9uIG91dHB1dC4KKyAqICAgICAgaGRldl9vYmo6ICAgICBIYW5kbGUgdG8gYSBkZXZpY2Ugb2JqZWN0LgorICogICAgICBtZ3JfYXR0cnRzOiAgICAgIENoYW5uZWwgbWFuYWdlciBhdHRyaWJ1dGVzLgorICogICAgICBtZ3JfYXR0cnRzLT5tYXhfY2hhbm5lbHM6ICAgTWF4IGNoYW5uZWxzCisgKiAgICAgIG1ncl9hdHRydHMtPmJpcnE6ICAgICAgICBDaGFubmVsJ3MgSS9PIElSUSBudW1iZXIuCisgKiAgICAgIG1ncl9hdHRydHMtPmlycV9zaGFyZWQ6ICAgICBUUlVFIGlmIHRoZSBJUlEgaXMgc2hhcmVhYmxlLgorICogICAgICBtZ3JfYXR0cnRzLT53b3JkX3NpemU6ICAgRFNQIFdvcmQgc2l6ZSBpbiBlcXVpdmFsZW50IFBDIGJ5dGVzLi4KKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgICAgICAgICBTdWNjZXNzOworICogICAgICAtRUZBVUxUOiAgICAgICAgICAgIGhkZXZfb2JqIGlzIGludmFsaWQuCisgKiAgICAgIC1FSU5WQUw6IG1heF9jaGFubmVscyBpcyAwLgorICogICAgICAgICAgICAgICBJbnZhbGlkIERTUCB3b3JkIHNpemUgKG11c3QgYmUgPiAwKS4KKyAqICAgICAgICAgICAgICAgSW52YWxpZCBiYXNlIGFkZHJlc3MgZm9yIERTUCBjb21tdW5pY2F0aW9ucy4KKyAqICAgICAgLUVOT01FTTogICAgICAgICAgICBJbnN1ZmZpY2llbnQgbWVtb3J5IGZvciByZXF1ZXN0ZWQgcmVzb3VyY2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gICAgaGNobmxfbWdyOiAgICAgICAgICAgQ2hhbm5lbCBtYW5hZ2VyIG9iamVjdC4KKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgICAgIFN1Y2Nlc3MuCisgKiAgICAgIC1FRkFVTFQ6ICAgICAgICBoY2hubF9tZ3Igd2FzIGludmFsaWQuCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIGNobmxfaW5pdCh2b2lkKSBjYWxsZWQuCisgKiAgRW5zdXJlczoKKyAqICAgICAgMDogICAgICAgICAgICBDYW5jZWxzIEkvTyBvbiBlYWNoIG9wZW4gY2hhbm5lbC4KKyAqICAgICAgICAgICAgICAgICAgICAgICAgICBDbG9zZXMgZWFjaCBvcGVuIGNoYW5uZWwuCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgY2hubF9jcmVhdGUgbWF5IHN1YnNlcXVlbnRseSBiZSBjYWxsZWQgZm9yIHRoZQorICogICAgICAgICAgICAgICAgICAgICAgICAgIHNhbWUgYm9hcmQuCisgKi8KK2V4dGVybiBpbnQgY2hubF9kZXN0cm95KHN0cnVjdCBjaG5sX21nciAqaGNobmxfbWdyKTsKKworLyoKKyAqICA9PT09PT09PSBjaG5sX2V4aXQgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBEaXNjb250aW51ZSB1c2FnZSBvZiB0aGUgQ0hOTCBtb2R1bGUuCisgKiAgUGFyYW1ldGVyczoKKyAqICBSZXR1cm5zOgorICogIFJlcXVpcmVzOgorICogICAgICBjaG5sX2luaXQodm9pZCkgcHJldmlvdXNseSBjYWxsZWQuCisgKiAgRW5zdXJlczoKKyAqICAgICAgUmVzb3VyY2VzLCBpZiBhbnkgYWNxdWlyZWQgaW4gY2hubF9pbml0KHZvaWQpLCBhcmUgZnJlZWQgd2hlbiB0aGUgbGFzdAorICogICAgICBjbGllbnQgb2YgQ0hOTCBjYWxscyBjaG5sX2V4aXQodm9pZCkuCisgKi8KK2V4dGVybiB2b2lkIGNobmxfZXhpdCh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AqLworZXh0ZXJuIGludCBjbW1fY3JlYXRlKHN0cnVjdCBjbW1fb2JqZWN0ICoqcGhfY21tX21nciwKKwkJCSAgICAgc3RydWN0IGRldl9vYmplY3QgKmhkZXZfb2JqLAorCQkJICAgICBjb25zdCBzdHJ1Y3QgY21tX21ncmF0dHJzICptZ3JfYXR0cnRzKTsKKworLyoKKyAqICA9PT09PT09PSBjbW1fZGVzdHJveSA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIERlc3Ryb3kgdGhlIGNvbW11bmljYXRpb24gbWVtb3J5IG1hbmFnZXIgb2JqZWN0LgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIGhjbW1fbWdyOiAgIENtbSBNZ3IgaGFuZGxlLgorICogICAgICBmb3JjZTogICAgIEZvcmNlIGRlYWxsb2NhdGlvbiBvZiBhbGwgY21tIG1lbW9yeSBpbW1lZGlhdGVseSBpZiBzZXQgVFJVRS4KKyAqICAgICAgICAgICAgICAgICBJZiBGQUxTRSwgYW5kIG91dHN0YW5kaW5nIGFsbG9jYXRpb25zIHdpbGwgcmV0dXJuIC1FUEVSTQorICogICAgICAgICAgICAgICAgIHN0YXR1cy4KKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgQ01NIG9iamVjdCAmIHJlc291cmNlcyBkZWxldGVkLgorICogICAgICAtRVBFUk06ICAgICAgVW5hYmxlIHRvIGZyZWUgQ01NIG9iamVjdCBkdWUgdG8gb3V0c3RhbmRpbmcgYWxsb2NhdGlvbi4KKyAqICAgICAgLUVGQVVMVDogICAgVW5hYmxlIHRvIGZyZWUgQ01NIGR1ZSB0byBiYWQgaGFuZGxlLgorICogIFJlcXVpcmVzOgorICogICAgICBDTU0gaXMgaW5pdGlhbGl6ZWQuCisgKiAgICAgIGhjbW1fbWdyICE9IE5VTEwuCisgKiAgRW5zdXJlczoKKyAqICAgICAgTWVtb3J5IHJlc291cmNlcyB1c2VkIGJ5IENtbSBNZ3IgYXJlIGZyZWVkLgorICovCitleHRlcm4gaW50IGNtbV9kZXN0cm95KHN0cnVjdCBjbW1fb2JqZWN0ICpoY21tX21nciwgYm9vbCBmb3JjZSk7CisKKy8qCisgKiAgPT09PT09PT0gY21tX2V4aXQgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgIERpc2NvbnRpbnVlIHVzYWdlIG9mIG1vZHVsZS4gQ2xlYW51cCBDTU0gbW9kdWxlIGlmIENNTSBjUmVmIHJlYWNoZXMgemVyby4KKyAqICBQYXJhbWV0ZXJzOgorICogICAgIG4vYQorICogIFJldHVybnM6CisgKiAgICAgbi9hCisgKiAgUmVxdWlyZXM6CisgKiAgICAgQ01NIGlzIGluaXRpYWxpemVkLgorICogIEVuc3VyZXM6CisgKi8KK2V4dGVybiB2b2lkIGNtbV9leGl0KHZvaWQpOworCisvKgorICogID09PT09PT09IGNtbV9mcmVlX2J1ZiA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIEZyZWUgdGhlIGdpdmVuIGJ1ZmZlci4KKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBoY21tX21ncjogICAgQ21tIE1nciBoYW5kbGUuCisgKiAgICAgIHBidWY6ICAgICAgIFBvaW50ZXIgdG8gbWVtb3J5IGFsbG9jYXRlZCBieSBjbW1fY2FsbG9jX2J1ZigpLgorICogICAgICB1bF9zZWdfaWQ6ICAgIFNNIHNlZ21lbnQgSWQgdXNlZCBpbiBDTU1fQ2FsbG9jKCkgYXR0cnMuCisgKiAgICAgICAgICAgICAgICAgIFNldCB0byAwIHRvIHVzZSBkZWZhdWx0IHNlZ21lbnQuCisgKiAgUmV0dXJuczoKKyAqICAgICAgMAorICogICAgICAtRVBFUk0KKyAqICBSZXF1aXJlczoKKyAqICAgICAgQ01NIGluaXRpYWxpemVkLgorICogICAgICBidWZfcGEgIT0gTlVMTAorICogIEVuc3VyZXM6CisgKgorICovCitleHRlcm4gaW50IGNtbV9mcmVlX2J1ZihzdHJ1Y3QgY21tX29iamVjdCAqaGNtbV9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tYXRpb24gb24gb3V0cHV0LgorICoKKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgU3VjY2Vzcy4KKyAqICAgICAgLUVGQVVMVDogICAgSW52YWxpZCBoYW5kbGUuCisgKiAgICAgIC1FSU5WQUwgSW52YWxpZCBpbnB1dCBhcmd1bWVudC4KKyAqICBSZXF1aXJlczoKKyAqICBFbnN1cmVzOgorICoKKyAqLworZXh0ZXJuIGludCBjbW1fZ2V0X2luZm8oc3RydWN0IGNtbV9vYmplY3QgKmhjbW1fbWdyLAorCQkJICAgICAgIHN0cnVjdCBjbW1faW5mbyAqY21tX2luZm9fb2JqKTsKKworLyoKKyAqICA9PT09PT09PSBjbW1faW5pdCA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIEluaXRpYWxpemVzIHByaXZhdGUgc3RhdGUgb2YgQ01NIG1vZHVsZS4KKyAqICBQYXJhbWV0ZXJzOgorICogIFJldHVybnM6CisgKiAgICAgIFRSVUUgaWYgaW5pdGlhbGl6ZWQ7IEZBTFNFIGlmIGVycm9yIG9jY3VyZWQuCisgKiAgUmVxdWlyZXM6CisgKiAgRW5zdXJlczoKKyAqICAgICAgQ01NIGluaXRpYWxpemVkLgorICovCitleHRlcm4gYm9vbCBjbW1faW5pdCh2b2lkKTsKKworLyoKKyAqICA9PT09PT09PSBjbW1fcmVnaXN0ZXJfZ3Bwc21fc2VnID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgUmVnaXN0ZXIgYSBibG9jayBvZiBTTSB3aXRoIHRoZSBDTU0uCisgKiAgUGFyYW1ldGVyczoKKyAqICAgICAgaGNtbV9tZ3I6ICAgICAgICAgSGFuZGxlIHRvIGEgQ21tIE1nci4KKyAqICAgICAgbHBHUFBCYXNlUEE6ICAgICBHUFAgQmFzZSBQaHlzaWNhbCBhZGRyZXNzLgorICogICAgICB1bF9zaXplOiAgICAgICAgICBTaXplIGluIEdQUCBieXRlcy4KKyAqICAgICAgZHNwX2FkZHJfb2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ldGUgdHJhbnNsYXRvciByZXNvdXJjZXMKKyAqICBQYXJhbWV0ZXJzOgorICogICAgICB4bGF0b3I6ICAgIGhhbmRsZSB0byB0cmFuc2xhdG9yLgorICogICAgICBmb3JjZTogICAgIGZvcmNlID0gVFJVRSB3aWxsIGZyZWUgWExhdG9ycyBTTSBidWZmZXJzL2RzY3JpcHRycy4KKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgU3VjY2Vzcy4KKyAqICAgICAgLUVGQVVMVDogICAgQmFkIHRyYW5zbGF0b3IgaGFuZGxlLgorICogICAgICAtRVBFUk06ICAgICAgVW5hYmxlIHRvIGZyZWUgdHJhbnNsYXRvciByZXNvdXJjZXMuCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIHJlZnMgPiAwCisgKiAgRW5zdXJlczoKKyAqCisgKi8KK2V4dGVybiBpbnQgY21tX3hsYXRvcl9kZWxldGUoc3RydWN0IGNtbV94bGF0b3JvYmplY3QgKnhsYXRvciwKKwkJCQkgICAgYm9vbCBmb3JjZSk7CisKKy8qCisgKiAgPT09PT09PT0gY21tX3hsYXRvcl9mcmVlX2J1ZiA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIEZyZWUgU00gYnVmZmVyIGFuZCBkZXNjcmlwdG9yLgorICogICAgICBEb2VzIG5vdCBmcmVlIGNsaWVudCBwcm9jZXNzIFZNLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIHhsYXRvcjogICAgaGFuZGxlIHRvIHRyYW5zbGF0b3IuCisgKiAgICAgIGJ1Zl92YSAgICAgIFZpcnR1YWwgYWRkcmVzcyBvZiBQQSB0byBmcmVlLgorICogIFJldHVybnM6CisgKiAgICAgIDA6ICAgICAgICBTdWNjZXNzLgorICogICAgICAtRUZBVUxUOiAgICBCYWQgdHJhbnNsYXRvciBoYW5kbGUuCisgKiAgUmVxdWlyZXM6CisgKiAgRW5zdXJlczoKKyAqCisgKi8KK2V4dGVybiBpbnQgY21tX3hsYXRvcl9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3IsCisJCQkgICAgIGNoYXIgKnN0cl96bF9maWxlLAorCQkJICAgICBjb25zdCBzdHJ1Y3QgY29kX2F0dHJzICphdHRycyk7CisKKy8qCisgKiAgPT09PT09PT0gY29kX2RlbGV0ZSA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIERlbGV0ZSBhIGNvZGUgbWFuYWdlciBvYmplY3QuCisgKiAgUGFyYW1ldGVyczoKKyAqICAgICAgY29kX21ncl9vYmo6ICAgaGFuZGxlIG9mIG1hbmFnZXIgdG8gYmUgZGVsZXRlZAorICogIFJldHVybnM6CisgKiAgICAgIE5vbmUuCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIENPRCBtb2R1bGUgaW5pdGlhbGl6ZWQuCisgKiAgICAgIHZhbGlkIGNvZF9tZ3Jfb2JqLgorICogIEVuc3VyZXM6CisgKi8KK2V4dGVybiB2b2lkIGNvZF9kZWxldGUoc3RydWN0IGNvZF9tYW5hZ2VyICpjb2RfbWdyX29iaik7CisKKy8qCisgKiAgPT09PT09PT0gY29kX2V4aXQgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBEaXNjb250aW51ZSB1c2FnZSBvZiB0aGUgQ09EIG1vZHVsZS4KKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBOb25lLgorICogIFJldHVybnM6CisgKiAgICAgIE5vbmUuCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIENPRCBpbml0aWFsaXplZC4KKyAqICBFbnN1cmVzOgorICogICAgICBSZXNvdXJjZXMgYWNxdWlyZWQgaW4gY29kX2luaXQodm9pZCkgYXJlIGZyZWVkLgorICovCitleHRlcm4gdm9pZCBjb2RfZXhpdCh2b2lkKTsKKworLyoKKyAqICA9PT09PT09PSBjb2RfZ2V0X2Jhc2VfbGliID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgR2V0IGhhbmRsZSB0byB0aGUgYmFzZSBpbWFnZSBEQkwgbGlicmFyeS4KKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBjb2RfbWdyX29iajogICBoYW5kbGUgb2YgbWFuYWdlciB0byBiZSBkZWxldGVkCisgKiAgICAgIHBsaWI6ICAgICAgIGxvY2F0aW9uIHRvIHN0b3JlIGxpYnJhcnkgaGFuZGxlIG9uIG91dHB1dC4KKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICBTdWNjZXNzLgorICogIFJlcXVpcmVzOgorICogICAgICBDT0QgbW9kdWxlIGluaXRpYWxpemVkLgorICogICAgICB2YWxpZCBjb2RfbWdyX29iai4KKyAqICAgICAgcGxpYiAhPSBOVUxMLgorICogIEVuc3VyZXM6CisgKi8KK2V4dGVybiBpbnQgY29kX2dldF9iYXNlX2xpYihzdHJ1Y3QgY29kX21hbmFnZXIgKmNvZF9tZ3Jfb2JqLAorCQkJCSAgIHN0cnVjdCBkYmxsX2xpYnJhcnlfb2JqICoqcGxpYik7CisKKy8qCisgKiAgPT09PT09PT0gY29kX2dldF9iYXNlX25hbWUgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBHZXQgdGhlIG5hbWUgb2YgdGhlIGJhc2UgaW1hZ2UgREJMIGxpYnJhcnkuCisgKiAgUGFyYW1ldGVyczoKKyAqICAgICAgY29kX21ncl9vYmo6ICAgaGFuZGxlIG9mIG1hbmFnZXIgdG8gYmUgZGVsZXRlZAorICogICAgICBzel9uYW1lOiAgICBsb2NhdGlvbiB0byBzdG9yZSBsaWJyYXJ5IG5hbWUgb24gb3V0cHV0LgorICogICAgICB1c2l6ZTogICAgICAgc2l6ZSBvZiBuYW1lIGJ1ZmZlci4KKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICBTdWNjZXNzLgorICogICAgICAtRVBFUk06ICBCdWZmZXIgdG9vIHNtYWxsLgorICogIFJlcXVpcmVzOgorICogICAgICBDT0QgbW9kdWxlIGluaXRpYWxpemVkLgorICogICAgICB2YWxpZCBjb2RfbWdyX29iai4KKyAqICAgICAgc3pfbmFtZSAhPSBOVUxMLgorICogIEVuc3VyZXM6CisgKi8KK2V4dGVybiBpbnQgY29kX2dldF9iYXNlX25hbWUoc3RydWN0IGNvZF9tYW5hZ2VyICpjb2RfbWdyX29iaiwKKwkJCQkgICAgY2hhciAqc3pfbmFtZSwgdTMyIHVzaXplKTsKKworLyoKKyAqICA9PT09PT09PSBjb2RfZ2V0X2VudHJ5ID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgUmV0cmlldmUgdGhlIGVudHJ5IHBvaW50IG9mIGEgbG9hZGVkIERTUCBwcm9ncmFtIGltYWdlCisgKiAgUGFyYW1ldGVyczoKKyAqICAgICAgY29kX21ncl9vYmo6ICAgaGFuZGxlIG9mIG1hbmFnZXIgdG8gYmUgZGVsZXRlZAorICogICAgICBlbnRyeV9wdDogICBwb2ludGVyIHRvIGxvY2F0aW9uIGZvciBlbnRyeSBwb2ludAorICogIFJldHVybnM6CisgKiAgICAgIDA6ICAgICAgIFN1Y2Nlc3MuCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIENPRCBtb2R1bGUgaW5pdGlhbGl6ZWQuCisgKiAgICAgIHZhbGlkIGNvZF9tZ3Jfb2JqLgorICogICAgICBlbnRyeV9wdCAhPSBOVUxMLgorICogIEVuc3VyZXM6CisgKi8KK2V4dGVybiBpbnQgY29kX2dldF9lbnRyeShzdHJ1Y3QgY29kX21hbmFnZXIgKmNvZF9tZ3Jfb2JqLAorCQkJCXUzMiAqZW50cnlfcHQpOworCisvKgorICogID09PT09PT09IGNvZF9nZXRfbG9hZGVyID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgR2V0IGhhbmRsZSB0byB0aGUgREJMIGxvYWRlci4KKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBjb2RfbWdyX29iajogICBoYW5kbGUgb2YgbWFuYWdlciB0byBiZSBkZWxldGVkCisgKiAgICAgIGxvYWRlcjogICAgIGxvY2F0aW9uIHRvIHN0b3JlIGxvYWRlciBoYW5kbGUgb24gb3V0cHV0LgorICogIFJldHVybnM6CisgKiAgICAgIDA6ICAgIFN1Y2Nlc3MuCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIENPRCBtb2R1bGUgaW5pdGlhbGl6ZWQuCisgKiAgICAgIHZhbGlkIGNvZF9tZ3Jfb2JqLgorICogICAgICBsb2FkZXIgIT0gTlVMTC4KKyAqICBFbnN1cmVzOgorICovCitleHRlcm4gaW50IGNvZF9nZXRfbG9hZGVyKHN0cnVjdCBjb2RfbWFuYWdlciAqY29kX21ncl9vYmosCisJCQkJIHN0cnVjdCBkYmxsX3Rhcl9vYmogKipsb2FkZXIpOworCisvKgorICogID09PT09PT09IGNvZF9nZXRfc2VjdGlvbiA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIFJldHJpZXZlIHRoZSBzdGFydGluZyBhZGRyZXNzIGFuZCBsZW5ndGggb2YgYSBzZWN0aW9uIGluIHRoZSBDT0ZGIGZpbGUKKyAqICAgICAgZ2l2ZW4gdGhlIHNlY3Rpb24gbmFtZS4KKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBsaWIgICAgICAgICBMaWJyYXJ5IGhhbmRsZSByZXR1cm5lZCBmcm9tIGNvZF9vcGVuKCkuCisgKiAgICAgIHN0cl9zZWN0OiAgIG5hbWUgb2YgdGhlIHNlY3Rpb24sIHdpdGggb3Igd2l0aG91dCBsZWFkaW5nICIuIgorICogICAgICBhZGRyOiAgICAgICBMb2NhdGlvbiB0byBzdG9yZSBhZGRyZXNzLgorICogICAgICBsZW46ICAgICAgICBMb2NhdGlvbiB0byBzdG9yZSBsZW5ndGguCisgKiAgUmV0dXJuczoKKyAqICAgICAgMDogICAgICAgICAgICAgICAgU3VjY2VzcworICogICAgICAtRVNQSVBFOiAgU3ltYm9scyBjb3VsZCBub3QgYmUgZm91bmQgb3IgaGF2ZSBub3QgYmVlbiBsb2FkZWQgb250bworICogICAgICAgICAgICAgICAgdGhlIGJvYXJkLgorICogIFJlcXVpcmVzOgorICogICAgICBDT0QgbW9kdWxlIGlu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hPSBOVUxMLgorICogIEVuc3VyZXM6CisgKi8KK2V4dGVybiBpbnQgY29kX2xvYWRfYmFzZShzdHJ1Y3QgY29kX21hbmFnZXIgKmNvZF9tZ3Jfb2JqLAorCQkJCXUzMiBudW1fYXJnYywgY2hhciAqYXJnc1tdLAorCQkJCWNvZF93cml0ZWZ4biBwZm5fd3JpdGUsIHZvaWQgKmFyYiwKKwkJCQljaGFyICplbnZwW10pOworCisvKgorICogID09PT09PT09IGNvZF9vcGVuID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgT3BlbiBhIGxpYnJhcnkgZm9yIHJlYWRpbmcgc2VjdGlvbnMuIERvZXMgbm90IGxvYWQgb3Igc2V0IHRoZSBiYXNlLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIGhtZ3I6ICAgICAgICAgICBtYW5hZ2VyIHRvIGxvYWQgdGhlIGNvZGUgd2l0aAorICogICAgICBzel9jb2ZmX3BhdGg6ICAgQ29mZiBmaWxlIHRvIG9wZW4uCisgKiAgICAgIGZsYWdzOiAgICAgICAgICBDT0RfTk9MT0FEIChkb24ndCBsb2FkIHN5bWJvbHMpIG9yIENPRF9TWU1CIChsb2FkCisgKiAgICAgICAgICAgICAgICAgICAgICBzeW1ib2xzKS4KKyAqICAgICAgbGliX29iajogICAgICAgIEhhbmRsZSByZXR1cm5lZCB0aGF0IGNhbiBiZSB1c2VkIGluIGNhbGxzIHRvIGNvZF9jbG9zZQorICogICAgICAgICAgICAgICAgICAgICAgYW5kIGNvZF9nZXRfc2VjdGlvbi4KKyAqICBSZXR1cm5zOgorICogICAgICBTX09LOiAgICAgICAgICAgICAgICAgICBTdWNjZXNzLgorICogICAgICAtRUJBREY6ICAgICAgIEZhaWxlZCB0byBvcGVuIHRhcmdldCBjb2RlLgorICogIFJlcXVpcmVzOgorICogICAgICBDT0QgbW9kdWxlIGluaXRpYWxpemVkLgorICogICAgICBobWdyIGlzIHZhbGlkLgorICogICAgICBmbGFncyA9PSBDT0RfTk9MT0FEIHx8IGZsYWdzID09IENPRF9TWU1CLgorICogICAgICBzel9jb2ZmX3BhdGggIT0gTlVMTC4KKyAqICBFbnN1cmVzOgorICovCitleHRlcm4gaW50IGNvZF9vcGVuKHN0cnVjdCBjb2RfbWFuYWdlciAqaG1nciwKKwkJCSAgIGNoYXIgKnN6X2NvZmZfcGF0aCwKKwkJCSAgIHUzMiBmbGFncywgc3RydWN0IGNvZF9saWJyYXJ5b2JqICoqbGliX29iaik7CisKKy8qCisgKiAgPT09PT09PT0gY29kX29wZW5fYmFzZSA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIE9wZW4gYmFzZSBpbWFnZSBmb3IgcmVhZGluZyBzZWN0aW9ucy4gRG9lcyBub3QgbG9hZCB0aGUgYmFzZS4KKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBobWdyOiAgICAgICAgICAgbWFuYWdlciB0byBsb2FkIHRoZSBjb2RlIHdpdGgKKyAqICAgICAgc3pfY29mZl9wYXRoOiAgIENvZmYgZmlsZSB0byBvcGVuLgorICogICAgICBmbGFnczogICAgICAgICAgU3BlY2lmaWVzIHdoZXRoZXIgdG8gbG9hZCBzeW1ib2xzLgorICogIFJldHVybnM6CisgKiAgICAgIDA6ICAgICAgICAgICAgU3VjY2Vzcy4KKyAqICAgICAgLUVCQURGOiAgIEZhaWxlZCB0byBvcGVuIHRhcmdldCBjb2RlLgorICogIFJlcXVpcmVzOgorICogICAgICBDT0QgbW9kdWxlIGluaXRpYWxpemVkLgorICogICAgICBobWdyIGlzIHZhbGlkLgorICogICAgICBzel9jb2ZmX3BhdGggIT0gTlVMTC4KKyAqICBFbnN1cmVzOgorICovCitleHRlcm4gaW50IGNvZF9vcGVuX2Jhc2Uoc3RydWN0IGNvZF9tYW5hZ2VyICpobWdyLCBjaGFyICpzel9jb2ZmX3BhdGgsCisJCQkJZGJsbF9mbGFncyBmbGFncyk7CisKKy8qCisgKiAgPT09PT09PT0gY29kX3JlYWRfc2VjdGlvbiA9P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VyIGhhbmRsZSBpcyBjcmVhdGVkLgorICovCitleHRlcm4gaW50IGRjZF9jcmVhdGVfbWFuYWdlcihjaGFyICpzel96bF9kbGxfbmFtZSwKKwkJCQkgICAgIHN0cnVjdCBkY2RfbWFuYWdlciAqKmRjZF9tZ3IpOworCisvKgorICogID09PT09PT09IGRjZF9kZXN0cm95X21hbmFnZXIgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBUaGlzIGZ1bmN0aW9uIGRlc3Ryb3lzIGEgRENEIG1vZHVsZSBtYW5hZ2VyLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIGhkY2RfbWdyOiAgICAgICAgQSBEQ0QgbWFuYWdlciBoYW5kbGUuCisgKiAgUmV0dXJuczoKKyAqICAgICAgMDogICAgICAgIFN1Y2Nlc3MuCisgKiAgICAgIC1FRkFVTFQ6ICAgIEludmFsaWQgRENEIG1hbmFnZXIgaGFuZGxlLgorICogIFJlcXVpcmVzOgorICogICAgICBEQ0QgaW5pdGlhbGl6ZWQuCisgKiAgRW5zdXJlczoKKyAqLworZXh0ZXJuIGludCBkY2RfZGVzdHJveV9tYW5hZ2VyKHN0cnVjdCBkY2RfbWFuYWdlciAqaGRjZF9tZ3IpOworCisvKgorICogID09PT09PT09IGRjZF9lbnVtZXJhdGVfb2JqZWN0ID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgVGhpcyBmdW5jdGlvbiBlbnVtZXJhdGVzIGN1cnJlbnRseSB2aXNpYmxlIERTUC9CSU9TIEJyaWRnZSBvYmplY3RzCisgKiAgICAgIGFuZCByZXR1cm5zIHRoZSBVVUlEIGFuZCB0eXBlIG9mIGVhY2ggZW51bWVyYXRlZCBvYmplY3QuCisgKiAgUGFyYW1ldGVyczoKKyAqICAgICAgaW5kZXg6ICAgICAgICAgICAgICBUaGUgb2JqZWN0IGVudW1lcmF0aW9uIGluZGV4LgorICogICAgICBvYmpfdHlwZTogICAgICAgICAgICBUeXBlIG9mIG9iamVjdCB0byBlbnVtZXJhdGUuCisgKiAgICAgIHV1aWRfb2JqOiAgICAgICAgICAgICAgUG9pbnRlciB0byBhIGRzcF91dWlkIG9iamVjdC4KKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgICAgIFN1Y2Nlc3MuCisgKiAgICAgIC1FUEVSTTogICAgICAgICAgVW5hYmxlIHRvIGVudW1lcmF0ZSB0aHJvdWdoIHRoZSBEQ0QgZGF0YWJhc2UuCisgKiAgICAgIEVOT0RBVEE6ICBFbnVtZXJhdGlvbiBjb21wbGV0ZWQuIFRoaXMgaXMgbm90IGFuIGVycm9yIGNvZGUuCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIERDRCBpbml0aWFsaXplZC4KKyAqICAgICAgdXVpZF9vYmogaXMgYSB2YWxpZCBwb2ludGVyLgorICogIEVuc3VyZXM6CisgKiAgRGV0YWlsczoKKyAqICAgICAgVGhpcyBmdW5jdGlvbiBjYW4gYmUgdXNlZCBpbiBjb25qdW5jdGlvbiB3aXRoIGRjZF9nZXRfb2JqZWN0X2RlZiB0bworICogICAgICByZXRyaWV2ZSBvYmplY3QgcHJvcGVydGllcy4KKyAqLworZXh0ZXJuIGludCBkY2RfZW51bWVyYXRlX29iamVjdChzMzIgaW5kZXgsCisJCQkJICAgICAgIGVudW0gZHNwX2RjZG9ianR5cGUgb2JqX3R5cGUsCisJCQkJICAgICAgIHN0cnVjdCBkc3BfdXVpZCAqdXVpZF9vYmopOworCisvKgorICogID09PT09PT09IGRjZF9leGl0ID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgVGhpcyBmdW5jdGlvbiBjbGVhbnMgdXAgdGhlIERDRCBtb2R1bGUuCisgKiAgUGFyYW1ldGVyczoKKyAqICBSZXR1cm5zOgorICogIFJlcXVpcmVzOgorICogICAgICBEQ0QgaW5pdGlhbGl6ZWQuCisgKiAgRW5zdXJlczoKKyAqLworZXh0ZXJuIHZvaWQgZGNkX2V4aXQodm9pZCk7CisKKy8qCisgKiAgPT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ICAgICAgVmFsaWQgaGRjZF9tZ3IuCisgKiAgICAgIHV1aWRfb2JqICE9IE5VTEwKKyAqICAgICAgZGVwX2xpYl91dWlkcyAhPSBOVUxMLgorICogIEVuc3VyZXM6CisgKi8KK2V4dGVybiBpbnQgZGNkX2dldF9kZXBfbGlicyhzdHJ1Y3QgZGNkX21hbmFnZXIgKmhkY2RfbWdyLAorCQkJCSAgIHN0cnVjdCBkc3BfdXVpZCAqdXVpZF9vYmosCisJCQkJICAgdTE2IG51bV9saWJzLAorCQkJCSAgIHN0cnVjdCBkc3BfdXVpZCAqZGVwX2xpYl91dWlkcywKKwkJCQkgICBib29sICpwcnN0bnRfZGVwX2xpYnMsCisJCQkJICAgZW51bSBubGRyX3BoYXNlIHBoYXNlKTsKKworLyoKKyAqICA9PT09PT09PSBkY2RfZ2V0X251bV9kZXBfbGlicyA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIEdpdmVuIHRoZSB1dWlkIG9mIGEgbGlicmFyeSwgZGV0ZXJtaW5lIGl0cyBudW1iZXIgb2YgZGVwZW5kZW50CisgKiAgICAgIGxpYnJhcmllcy4KKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBoZGNkX21ncjogICAgICAgIEEgRENEIG1hbmFnZXIgaGFuZGxlLgorICogICAgICB1dWlkX29iajogICAgICAgICAgUG9pbnRlciB0byBhIGRzcF91dWlkIGZvciBhIGxpYnJhcnkuCisgKiAgICAgIG51bV9saWJzOiAgICAgICBTaXplIG9mIHV1aWQgYXJyYXkgKG51bWJlciBvZiBsaWJyYXJ5IHV1aWRzKS4KKyAqICAgICAgbnVtX3BlcnNfbGliczogIG51bWJlciBvZiBwZXJzaXN0ZW50IGRlcGVuZGVudCBsaWJyYXJ5LgorICogICAgICBwaGFzZTogICAgICAgICAgUGhhc2UgdG8gb2J0YWluIGNvcnJlY3QgaW5wdXQgbGlicmFyeQorICogIFJldHVybnM6CisgKiAgICAgIDA6IFN1Y2Nlc3MuCisgKiAgICAgIC1FTk9NRU06IE1lbW9yeSBhbGxvY2F0aW9uIGZhaWx1cmUuCisgKiAgICAgIC1FQUNDRVM6IEZhaWx1cmUgdG8gcmVhZCBzZWN0aW9uIGNvbnRhaW5pbmcgbGlicmFyeSBpbmZvLgorICogICAgICAtRVBFUk06IEdlbmVyYWwgZmFpbHVyZS4KKyAqICBSZXF1aXJlczoKKyAqICAgICAgRENEIGluaXRpYWxpemVkLgorICogICAgICBWYWxpZCBoZGNkX21nci4KKyAqICAgICAgdXVpZF9vYmogIT0gTlVMTAorICogICAgICBudW1fbGlicyAhPSBOVUxMLgorICogIEVuc3VyZXM6CisgKi8KK2V4dGVybiBpbnQgZGNkX2dldF9udW1fZGVwX2xpYnMoc3RydWN0IGRjZF9tYW5hZ2VyICpoZGNkX21nciwKKwkJCQkgICAgICAgc3RydWN0IGRzcF91dWlkICp1dWlkX29iaiwKKwkJCQkgICAgICAgdTE2ICpudW1fbGlicywKKwkJCQkgICAgICAgdTE2ICpudW1fcGVyc19saWJzLAorCQkJCSAgICAgICBlbnVtIG5sZHJfcGhhc2UgcGhhc2UpOworCisvKgorICogID09PT09PT09IGRjZF9nZXRfbGlicmFyeV9uYW1lID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgVGhpcyBmdW5jdGlvbiByZXR1cm5zIHRoZSBuYW1lIG9mIGEgKGR5bmFtaWMpIGxpYnJhcnkgZm9yIGEgZ2l2ZW4KKyAqICAgICAgVVVJRC4KKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBoZGNkX21ncjogQSBEQ0QgbWFuYWdlciBoYW5kbGUuCisgKiAgICAgIHV1aWRfb2JqOglQb2ludGVyIHRvIGEgZHNwX3V1aWQgdGhhdCByZXByZXNlbnRzIGEgdW5pcXVlIERTUC9CSU9TCisgKiAgICAgICAgICAgICAgICAgICAgICBCcmlkZ2Ugb2JqZWN0LgorICogICAgICBzdHJfbGliX25hbWU6IEJ1ZmZlciB0byBob2xkIGxpYnJhcnkgbmFtZS4KKyA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OiAgICAgICAgICAgIEEgRENEIG1hbmFnZXIgaGFuZGxlLgorICogICAgICB1dWlkX29iajogICAgICAgICAgICAgIFBvaW50ZXIgdG8gYSBkc3BfdXVpZCB0aGF0IHJlcHJlc2VudHMgYSB1bmlxdWUKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICBEU1AvQklPUyBCcmlkZ2Ugb2JqZWN0LgorICogICAgICBvYmpfdHlwZTogICAgICAgICAgICBUaGUgdHlwZSBvZiBEU1AvQklPUyBCcmlkZ2Ugb2JqZWN0IHRvIGJlCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmZXJlbmNlZCAobm9kZSwgcHJvY2Vzc29yLCBldGMpLgorICogICAgICBvYmpfZGVmOiAgICAgICAgICAgIFBvaW50ZXIgdG8gYW4gb2JqZWN0IGRlZmluaXRpb24gc3RydWN0dXJlLiBBCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gb2YgdmFyaW91cyBwb3NzaWJsZSBEQ0Qgb2JqZWN0IHR5cGVzLgorICogIFJldHVybnM6CisgKiAgICAgIDA6IFN1Y2Nlc3MuCisgKiAgICAgIC1FQUNDRVM6IFVuYWJsZSB0byBhY2Nlc3MvcmVhZC9wYXJzZS9sb2FkIGNvbnRlbnQgb2Ygb2JqZWN0IGNvZGUKKyAqICAgICAgICAgICAgICAgc2VjdGlvbi4KKyAqICAgICAgLUVQRVJNOiAgICAgICAgICBHZW5lcmFsIGZhaWx1cmUuCisgKiAgICAgIC1FRkFVTFQ6ICAgICAgICBJbnZhbGlkIERDRF9ITUFOQUdFUiBoYW5kbGUuCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIERDRCBpbml0aWFsaXplZC4KKyAqICAgICAgb2JqX3V1aWQgaXMgbm9uLU5VTEwuCisgKiAgICAgIG9ial9kZWYgaXMgbm9uLU5VTEwuCisgKiAgRW5zdXJlczoKKyAqLworZXh0ZXJuIGludCBkY2RfZ2V0X29iamVjdF9kZWYoc3RydWN0IGRjZF9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JzOgorICogIFJldHVybnM6CisgKiAgICAgIEZBTFNFOiAgSW5pdGlhbGl6YXRpb24gZmFpbGVkLgorICogICAgICBUUlVFOiAgIEluaXRpYWxpemF0aW9uIHN1Y2NlZWRlZC4KKyAqICBSZXF1aXJlczoKKyAqICBFbnN1cmVzOgorICogICAgICBEQ0QgaW5pdGlhbGl6ZWQuCisgKi8KK2V4dGVybiBib29sIGRjZF9pbml0KHZvaWQpOworCisvKgorICogID09PT09PT09IGRjZF9yZWdpc3Rlcl9vYmplY3QgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBUaGlzIGZ1bmN0aW9uIHJlZ2lzdGVycyBhIERTUC9CSU9TIEJyaWRnZSBvYmplY3QgaW4gdGhlIERDRCBkYXRhYmFzZS4KKyAqICBQYXJhbWV0ZXJzOgorICogICAgICB1dWlkX29iajogICAgICAgICAgUG9pbnRlciB0byBhIGRzcF91dWlkIHRoYXQgaWRlbnRpZmllcyBhIERTUC9CSU9TCisgKiAgICAgICAgICAgICAgICAgICAgICBCcmlkZ2Ugb2JqZWN0LgorICogICAgICBvYmpfdHlwZTogICAgICAgIFR5cGUgb2Ygb2JqZWN0LgorICogICAgICBwc3pfcGF0aF9uYW1lOiAgICBQYXRoIHRvIHRoZSBvYmplY3QncyBDT0ZGIGZpbGUuCisgKiAgUmV0dXJuczoKKyAqICAgICAgMDogICAgICAgIFN1Y2Nlc3MuCisgKiAgICAgIC1FUEVSTTogICAgICBGYWlsZWQgdG8gcmVnaXN0ZXIgb2JqZWN0LgorICogIFJlcXVpcmVzOgorICogICAgICBEQ0QgaW5pdGlhbGl6ZWQuCisgKiAgICAgIHV1aWRfb2JqIGFuZCBzelBhdGhOYW1lIGFyZSBub24tTlVMTCB2YWx1ZXMuCisgKiAgICAgIG9ial90eXBlIGlzIGEgdmFsaWQgdHlwZSB2YWx1ZS4KKyAqICBFbnN1cmVzOgorICovCitleHRlcm4gaW50IGRjZF9yZWdpc3Rlcl9vYmplY3Qoc3RydWN0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3MuCisgKi8KKyNkZWZpbmUgREJMTF9OT0xPQUQgICAweDAJLyogRG9uJ3QgbG9hZCBzeW1ib2xzLCBjb2RlLCBvciBkYXRhICovCisjZGVmaW5lIERCTExfU1lNQiAgICAgMHgxCS8qIGxvYWQgc3ltYm9scyAqLworI2RlZmluZSBEQkxMX0NPREUgICAgIDB4MgkvKiBsb2FkIGNvZGUgKi8KKyNkZWZpbmUgREJMTF9EQVRBICAgICAweDQJLyogbG9hZCBkYXRhICovCisjZGVmaW5lIERCTExfRFlOQU1JQyAgMHg4CS8qIGR5bmFtaWMgbG9hZCAqLworI2RlZmluZSBEQkxMX0JTUyAgICAgIDB4MjAJLyogVW5pdGlhbGl6ZWQgc2VjdGlvbiAqLworCisjZGVmaW5lIERCTExfTUFYUEFUSExFTkdUSCAgICAgICAyNTUKKworLyoKKyAqICA9PT09PT09PSBEQkxMX1RhcmdldCA9PT09PT09PQorICoKKyAqLworc3RydWN0IGRibGxfdGFyX29iajsKKworLyoKKyAqICA9PT09PT09PSBkYmxsX2ZsYWdzID09PT09PT09CisgKiAgU3BlY2lmaWVzIHdoZXRoZXIgdG8gbG9hZCBjb2RlLCBkYXRhLCBvciBzeW1ib2xzCisgKi8KK3R5cGVkZWYgczMyIGRibGxfZmxhZ3M7CisKKy8qCisgKiAgPT09PT09PT0gREJMTF9MaWJyYXJ5ID09PT09PT09CisgKgorICovCitzdHJ1Y3QgZGJsbF9saWJyYXJ5X29iajsKKworLyoKKyAqICA9PT09PT09PSBkYmxsX3NlY3RfaW5mbyA9PT09PT09PQorICogIEZvciBjb2xsZWN0aW5nIGluZm8gb24gb3ZlcmxheSBzZWN0aW9ucworICovCitzdHJ1Y3QgZGJsbF9zZWN0X2luZm8geworCWNvbnN0IGNoYXIgKm5hbWU7CS8qIG5hbWUgb2Ygc2VjdGlvbiAqLworCXUzMiBzZWN0X3J1bl9hZGRyOwkvKiBydW4gYWRkcmVzcyBvZiBzZWN0aW9uICovCisJdTMyIHNlY3RfbG9hZ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nVuIHRpbWUgbGlicmFyeSBmdW5jdGlvbnMgb2YgdGhlIHNhbWUgbmFtZS4KKwkgKi8KKwkgczMyKCpmcmVhZCkgKHZvaWQgKiwgc2l6ZV90LCBzaXplX3QsIHZvaWQgKik7CisJIHMzMigqZnNlZWspICh2b2lkICosIGxvbmcsIGludCk7CisJIHMzMigqZnRlbGwpICh2b2lkICopOworCSBzMzIoKmZjbG9zZSkgKHZvaWQgKik7CisJdm9pZCAqKCpmb3BlbikgKGNvbnN0IGNoYXIgKiwgY29uc3QgY2hhciAqKTsKK307CisKKy8qCisgKiAgPT09PT09PT0gZGJsbF9jbG9zZSA9PT09PT09PQorICogIENsb3NlIGxpYnJhcnkgb3BlbmVkIHdpdGggZGJsbF9vcGVuLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIGxpYiAgICAgICAgICAgICAtIEhhbmRsZSByZXR1cm5lZCBmcm9tIGRibGxfb3BlbigpLgorICogIFJldHVybnM6CisgKiAgUmVxdWlyZXM6CisgKiAgICAgIERCTCBpbml0aWFsaXplZC4KKyAqICAgICAgVmFsaWQgbGliLgorICogIEVuc3VyZXM6CisgKi8KK3R5cGVkZWYgdm9pZCAoKmRibGxfY2xvc2VfZnhuKSAoc3RydWN0IGRibGxfbGlicmFyeV9vYmogKmxpYnJhcnkpOworCisvKgorICogID09PT09PT09IGRibGxfY3JlYXRlID09PT09PT09CisgKiAgQ3JlYXRlIGEgdGFyZ2V0IG9iamVjdCwgc3BlY2lmeWluZyB0aGUgYWxsb2MsIGZyZWUsIGFuZCB3cml0ZSBmdW5jdGlvbnMuCisgKiAgUGFyYW1ldGVyczoKKyAqICAgICAgdGFyZ2V0X29iaiAgICAgICAgIC0gTG9jYXRpb24gdG8gc3RvcmUgdGFyZ2V0IGhhbmRsZSBvbiBvdXRwdXQuCisgKiAgICAgIHBhdHRycyAgICAgICAgICAtIEF0dHJpYnV0ZXMuCisgKiAgUmV0dXJuczoKKyAqICAgICAgMDogICAgICAgIFN1Y2Nlc3MuCisgKiAgICAgIC1FTk9NRU06ICAgIE1lbW9yeSBhbGxvY2F0aW9uIGZhaWxlZC4KKyAqICBSZXF1aXJlczoKKyAqICAgICAgREJMIGluaXRpYWxpemVkLgorICogICAgICBwYXR0cnMgIT0gTlVMTC4KKyAqICAgICAgdGFyZ2V0X29iaiAhPSBOVUxMOworICogIEVuc3VyZXM6CisgKiAgICAgIFN1Y2Nlc3M6ICAgICAgICAqdGFyZ2V0X29iaiAhPSBOVUxMLgorICogICAgICBGYWlsdXJlOiAgICAgICAgKnRhcmdldF9vYmogPT0gTlVMTC4KKyAqLwordHlwZWRlZiBpbnQoKmRibGxfY3JlYXRlX2Z4bikgKHN0cnVjdCBkYmxsX3Rhcl9vYmogKip0YXJnZXRfb2JqLAorCQkJCSAgICAgIHN0cnVjdCBkYmxsX2F0dHJzICphdHRycyk7CisKKy8qCisgKiAgPT09PT09PT0gZGJsbF9kZWxldGUgPT09PT09PT0KKyAqICBEZWxldGUgdGFyZ2V0IG9iamVjdCBhbmQgZnJlZSByZXNvdXJjZXMgZm9yIGFueSBsb2FkZWQgbGlicmFyaWVzLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIHRhcmdldCAgICAgICAgICAtIEhhbmRsZSByZXR1cm5lZCBmcm9tIERCTExfQ3JlYXRlKCkuCisgKiAgUmV0dXJuczoKKyAqICBSZXF1aXJlczoKKyAqICAgICAgREJMIGluaXRpYWxpemVkLgorICogICAgICBWYWxpZCB0YXJnZXQuCisgKiAgRW5zdXJlczoKKyAqLwordHlwZWRlZiB2b2lkICgqZGJsbF9kZWxldGVfZnhuKSAoc3RydWN0IGRibGxfdGFyX29iaiAqdGFyZ2V0KTsKKworLyoKKyAqICA9PT09PT09PSBkYmxsX2V4aXQgPT09PT09PT0KKyAqICBEaXNjb250aW51ZSB1c2Ugb2YgREJMIG1vZHVsZS4KKyAqICBQYXJhbWV0ZXJzOgorICogIFJldHVybnM6CisgKiAgUmVxdWlyZXM6CisgKiAgICAgIHJlZnMgPiAwLgorICogIEVuc3VyZXM6CisgKiAgICAgIHJlZnMgPj0gMC4KKyAqLwordHlwZWRlZiB2b2lkICgqZGJsbF9leGl0X2Z4bikgKHZvaWQpOworCisvKgorICogID09PT09PT09IGRibGxfZ2V0X2FkZHIgPT09PT09PT0KKyAqICBHZXQgYWRkcmVzcyBvZiBuYW1lIGluIHRoZSBzcGVjaWZpZWQgbGlicmFyeS4KKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBsaWIgICAgICAgICAgICAgLSBIYW5kbGUgcmV0dXJuZWQgZnJvbSBkYmxsX29wZW4oKS4KKyAqICAgICAgbmFtZSAgICAgICAgICAgIC0gTmFtZSBvZiBzeW1ib2wKKyAqICAgICAgc3ltX3ZhbCAgICAgICAgIC0gTG9jYXRpb24gdG8gc3RvcmUgc3ltYm9sIGFkZHJlc3Mgb24gb3V0cHV0LgorICogIFJldHVybnM6CisgKiAgICAgIFRSVUU6ICAgICAgICAgICBTdWNjZXNzLgorICogICAgICBGQUxTRTogICAgICAgICAgU3ltYm9sIG5vdCBmb3VuZC4KKyAqICBSZXF1aXJlczoKKyAqICAgICAgREJMIGluaXRpYWxpemVkLgorICogICAgICBWYWxpZCBsaWJyYXJ5LgorICogICAgICBuYW1lICE9IE5VTEwuCisgKiAgICAgIHN5bV92YWwgIT0gTlVMTC4KKyAqICBFbnN1cmVzOgorICovCit0eXBlZGVmIGJvb2woKmRibGxfZ2V0X2FkZHJfZnhuKSAoc3RydWN0IGRibGxfbGlicmFyeV9vYmogKmxpYiwgY2hhciAqbmFtZSwKKwkJCQkgIHN0cnVjdCBkYmxsX3N5bV92YWwgKipzeW1fdmFsKTsKKworLyoKKyAqICA9PT09PT09PSBkYmxsX2dldF9hdHRycyA9PT09PT09PQorICogIFJldHJpZXZlIHRoZSBhdHRyaWJ1dGVzIG9mIHRoZSB0YXJnZXQuCisgKiAgUGFyYW1ldGVyczoKKyAqICAgICAgdGFyZ2V0ICAgICAgICAgIC0gSGFuZGxlIHJldHVybmVkIGZyb20gREJMTF9DcmVhdGUoKS4KKyAqICAgICAgcGF0dHJzICAgICAgICAgIC0gTG9jYXRpb24gdG8gc3RvcmUgYXR0cmlidXRlcyBvbiBvdXRwdXQuCisgKiAgUmV0dXJuczoKKyAqICBSZXF1aXJlczoKKyAqICAgICAgREJMIGluaXRpYWxpemVkLgorICogICAgICBWYWxpZCB0YXJnZXQuCisgKiAgICAgIHBhdHRycyAhPSBOVUxMLgorICogIEVuc3VyZXM6CisgKi8KK3R5cGVkZWYgdm9pZCAoKmRibGxfZ2V0X2F0dHJzX2Z4bikgKHN0cnVjdCBkYmxsX3Rhcl9vYmogKnRhcmdldCwKKwkJCQkgICAgc3RydWN0IGRibGxfYXR0cnMgKmF0dHJzKTsKKworLyoKKyAqICA9PT09PT09PSBkYmxsX2dldF9jX2FkZHIgPT09PT09PT0KKyAqICBHZXQgYWRkcmVzcyBvZiAiQyIgbmFtZSBvbiB0aGUgc3BlY2lmaWVkIGxpYnJhcnkuCisgKiAgUGFyYW1ldGVyczoKKyAqICAgICAgbGliICAgICAgICAgICAgIC0gSGFuZGxlIHJldHVybmVkIGZyb20gZGJsbF9vcGVuKCkuCisgKiAgICAgIG5hbWUgICAgICAgICAgICAtIE5hbWUgb2Ygc3ltYm9sCisgKiAgICAgIHN5bV92YWwgICAgICAgICAtIExvY2F0aW9uIHRvIHN0b3JlIHN5bWJvbCBhZGRyZXNzIG9uIG91dHB1dC4KKyAqICBSZXR1cm5zOgorICogICAgICBUUlVFOiAgICAgICAgICAgU3VjY2Vzcy4KKyAqICAgICAgRkFMU0U6ICAgICAgICAgIFN5bWJvbCBub3QgZm91bmQuCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIERCTCBpbml0aWFsaXplZC4KKyAqICAgICAgVmFsaWQgdGFyZ2V0LgorICogICAgICBuYW1lICE9IE5VTEwuCisgKiAgICAgIHN5bV92YWwgIT0gTlVMTC4KKyAqICBFbnN1cmVzOgorICovCit0eXBlZGVmIGJvb2woKmRibGxfZ2V0X2NfYWRkcl9meG4pIChzdHJ1Y3QgZGJsbF9saWJyYXJ5X29iaiAqbGliLCBjaGFyICpuYW1lLAorCQkJCSAgICBzdHJ1Y3QgZGJsbF9zeW1fdmFsICoqc3ltX3ZhbCk7CisKKy8qCisgKiAgPT09PT09PT0gZGJsbF9nZXRfc2VjdCA9PT09PT09PQorICogIEdldCBhZGRyZXNzIGFuZCBzaXplIG9mIGEgbmFtZWQgc2VjdGlvbi4KKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBsaWIgICAgICAgICAgICAgLSBMaWJyYXJ5IGhhbmRsZSByZXR1cm5lZCBmcm9tIGRibGxfb3BlbigpLgorICogICAgICBuYW1lICAgICAgICAgICAgLSBOYW1lIG9mIHNlY3Rpb24uCisgKiAgICAgIHBhZGRyICAgICAgICAgICAtIExvY2F0aW9uIHRvIHN0b3JlIHNlY3Rpb24gYWRkcmVzcyBvbiBvdXRwdXQuCisgKiAgICAgIHBzaXplICAgICAgICAgICAtIExvY2F0aW9uIHRvIHN0b3JlIHNlY3Rpb24gc2l6ZSBvbiBvdXRwdXQuCisgKiAgUmV0dXJuczoKKyAqICAgICAgMDogICAgICAgIFN1Y2Nlc3MuCisgKiAgICAgIC1FTlhJTzogICAgU2VjdGlvbiBub3QgZm91bmQuCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIERCTCBpbml0aWFsaXplZC4KKyAqICAgICAgVmFsaWQgbGliLgorICogICAgICBuYW1lICE9IE5VTEwuCisgKiAgICAgIHBhZGRyICE9IE5VTEw7CisgKiAgICAgIHBzaXplICE9IE5VTEwuCisgKiAgRW5zdXJlczoKKyAqLwordHlwZWRlZiBpbnQoKmRibGxfZ2V0X3NlY3RfZnhuKSAoc3RydWN0IGRibGxfbGlicmFyeV9vYmogKmxpYiwKKwkJCQkJY2hhciAqbmFtZSwgdTMyICogYWRkciwgdTMyICogc2l6ZSk7CisKKy8qCisgKiAgPT09PT09PT0gZGJsbF9pbml0ID09PT09PT09CisgKiAgSW5pdGlhbGl6ZSBEQkwgbW9kdWxlLgorICogIFBhcmFtZXRlcnM6CisgKiAgUmV0dXJuczoKKyAqICAgICAgVFJVRTogICAgICAgICAgIFN1Y2Nlc3MuCisgKiAgICAgIEZBTFNFOiAgICAgICAgICBGYWlsdXJlLgorICogIFJlcXVpcmVzOgorICogICAgICByZWZzID49IDAuCisgKiAgRW5zdXJlczoKKyAqICAgICAgU3VjY2VzczogICAgICAgIHJlZnMgPiAwLgorICogICAgICBGYWlsdXJlOiAgICAgICAgcmVmcyA+PSAwLgorICovCit0eXBlZGVmIGJvb2woKmRibGxfaW5pdF9meG4pICh2b2lkKTsKKworLyoKKyAqICA9PT09PT09PSBkYmxsX2xvYWQgPT09PT09PT0KKyAqICBMb2FkIGxpYnJhcnkgb250byB0aGUgdGFyZ2V0LgorICoKKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBsaWIgICAgICAgICAgICAgLSBMaWJyYXJ5IGhhbmRsZSByZXR1cm5lZCBmcm9tIGRibGxfb3BlbigpLgorICogICAgICBmbGFncyAgICAgICAgICAgLSBMb2FkIGNvZGUsIGRhdGEgYW5kL29yIHN5bWJvbHMuCisgKiAgICAgIGF0dHJzICAgICAgICAgICAtIE1heSBjb250YWluIGFsbG9jLCBmcmVlLCBhbmQgd3JpdGUgZnVuY3Rpb24uCisgKiAgICAgIGVudHJ5X3B0ICAgICAgICAtIExvY2F0aW9uIHRvIHN0b3JlIHByb2dyYW0gZW50cnkgb24gb3V0cHV0LgorICogIFJldHVybnM6CisgKiAgICAgIDA6ICAgICAgICBTdWNjZXNzLgorICogICAgICAtRUJBREY6ICAgICBGaWxlIHJlYWQgZmFpbGVkLgorICogICAgICAtRUlMU0VROiAgIEZhaWx1cmUgaW4gZHluYW1pYyBsb2FkZXIgbGlicmFyeS4KKyAqICBSZXF1aXJlczoKKyAqICAgICAgREJMIGluaXRpYWxpemVkLgorICogICAgICBWYWxpZCBsaWIuCisgKiAgICAgIGVudHJ5ICE9IE5VTE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CSBzdHJ1Y3QgZGJsbF9hdHRycyAqYXR0cnMpOworCisvKgorICogID09PT09PT09IGRibGxfb3BlbiA9PT09PT09PQorICogIGRibGxfb3BlbigpIHJldHVybnMgYSBsaWJyYXJ5IGhhbmRsZSB0aGF0IGNhbiBiZSB1c2VkIHRvIGxvYWQvdW5sb2FkCisgKiAgdGhlIHN5bWJvbHMvY29kZS9kYXRhIHZpYSBkYmxsX2xvYWQoKS9kYmxsX3VubG9hZCgpLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIHRhcmdldCAgICAgICAgICAtIEhhbmRsZSByZXR1cm5lZCBmcm9tIGRibGxfY3JlYXRlKCkuCisgKiAgICAgIGZpbGUgICAgICAgICAgICAtIE5hbWUgb2YgZmlsZSB0byBvcGVuLgorICogICAgICBmbGFncyAgICAgICAgICAgLSBJZiBmbGFncyAmIERCTExfU1lNQiwgbG9hZCBzeW1ib2xzLgorICogICAgICBsaWJfb2JqICAgICAgICAgLSBMb2NhdGlvbiB0byBzdG9yZSBsaWJyYXJ5IGhhbmRsZSBvbiBvdXRwdXQuCisgKiAgUmV0dXJuczoKKyAqICAgICAgMDogICAgICAgICAgICBTdWNjZXNzLgorICogICAgICAtRU5PTUVNOiAgICAgICAgTWVtb3J5IGFsbG9jYXRpb24gZmFpbHVyZS4KKyAqICAgICAgLUVCQURGOiAgICAgICAgIEZpbGUgb3Blbi9yZWFkIGZhaWx1cmUuCisgKiAgICAgICAgICAgICAgICAgICAgICBVbmFibGUgdG8gZGV0ZXJtaW5lIHRhcmdldCB0eXBlLgorICogIFJlcXVpcmVzOgorICogICAgICBEQkwgaW5pdGlhbGl6ZWQuCisgKiAgICAgIFZhbGlkIHRhcmdldC4KKyAqICAgICAgZmlsZSAhPSBOVUxMLgorICogICAgICBsaWJfb2JqICE9IE5VTEwuCisgKiAgICAgIGRibGxfYXR0cnMgZm9wZW4gZnVuY3Rpb24gbm9uLU5VTEwuCisgKiAgRW5zdXJlczoKKyAqICAgICAgU3VjY2VzczogICAgICAgIFZhbGlkICpsaWJfb2JqLgorICogICAgICBGYWlsdXJlOiAgICAgICAgKmxpYl9vYmogPT0gTlVMTC4KKyAqLwordHlwZWRlZiBpbnQoKmRibGxfb3Blbl9meG4pIChzdHJ1Y3QgZGJsbF90YXJfb2JqICp0YXJnZXQsIGNoYXIgKmZpbGUsCisJCQkJICAgIGRibGxfZmxhZ3MgZmxhZ3MsCisJCQkJICAgIHN0cnVjdCBkYmxsX2xpYnJhcnlfb2JqICoqbGliX29iaik7CisKKy8qCisgKiAgPT09PT09PT0gZGJsbF9yZWFkX3NlY3QgPT09PT09PT0KKyAqICBSZWFkIENPRkYgc2VjdGlvbiBpbnRvIGEgY2hhcmFjdGVyIGJ1ZmZlci4KKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBsaWIgICAgICAgICAgICAgLSBMaWJyYXJ5IGhhbmRsZSByZXR1cm5lZCBmcm9tIGRibGxfb3BlbigpLgorICogICAgICBuYW1lICAgICAgICAgICAgLSBOYW1lIG9mIHNlY3Rpb24uCisgKiAgICAgIHBidWYgICAgICAgICAgICAtIEJ1ZmZlciB0byB3cml0ZSBzZWN0aW9uIGNvbnRlbnRzIGludG8uCisgKiAgICAgIHNpemUgICAgICAgICAgICAtIEJ1ZmZlciBzaXplCisgKiAgUmV0dXJuczoKKyAqICAgICAgMDogICAgICAgIFN1Y2Nlc3MuCisgKiAgICAgIC1FTlhJTzogICAgTmFtZWQgc2VjdGlvbiBkb2VzIG5vdCBleGlzdHMuCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIERCTCBpbml0aWFsaXplZC4KKyAqICAgICAgVmFsaWQgbGliLgorICogICAgICBuYW1lICE9IE5VTEwuCisgKiAgICAgIHBidWYgIT0gTlVMTC4KKyAqICAgICAgc2l6ZSAhPSAwLgorICogIEVuc3VyZXM6CisgKi8KK3R5cGVkZWYgaW50KCpkYmxsX3JlYWRfc2VjdF9meG4pIChzdHJ1Y3QgZGJsbF9saWJyYXJ5X29iaiAqbGliLAorCQkJCQkgY2hhciAqbmFtZSwgY2hhciAqY29udGVudCwKKwkJCQkJIHUzMiBjb250X3NpemUpOworCisvKgorICogID09PT09PT09IGRibGxfc2V0X2F0dHJzID09PT09PT09CisgKiAgU2V0IHRoZSBhdHRyaWJ1dGVzIG9mIHRoZSB0YXJnZXQuCisgKiAgUGFyYW1ldGVyczoKKyAqICAgICAgdGFyZ2V0ICAgICAgICAgIC0gSGFuZGxlIHJldHVybmVkIGZyb20gZGJsbF9jcmVhdGUoKS4KKyAqICAgICAgcGF0dHJzICAgICAgICAgIC0gTmV3IGF0dHJpYnV0ZXMuCisgKiAgUmV0dXJuczoKKyAqICBSZXF1aXJlczoKKyAqICAgICAgREJMIGluaXRpYWxpemVkLgorICogICAgICBWYWxpZCB0YXJnZXQuCisgKiAgICAgIHBhdHRycyAhPSBOVUxMLgorICogIEVuc3VyZXM6CisgKi8KK3R5cGVkZWYgdm9pZCAoKmRibGxfc2V0X2F0dHJzX2Z4bikgKHN0cnVjdCBkYmxsX3Rhcl9vYmogKnRhcmdldCwKKwkJCQkgICAgc3RydWN0IGRibGxfYXR0cnMgKmF0dHJzKTsKKworLyoKKyAqICA9PT09PT09PSBkYmxsX3VubG9hZCA9PT09PT09PQorICogIFVubG9hZCBsaWJyYXJ5IGxvYWRlZCB3aXRoIGRibGxfbG9hZCgpLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIGxpYiAgICAgICAgICAgICAtIEhhbmRsZSByZXR1cm5lZCBmcm9tIGRibGxfb3BlbigpLgorICogICAgICBhdHRycyAgICAgICAgICAgLSBDb250YWlucyBmcmVlKCkgZnVuY3Rpb24gYW5kIGhhbmRsZSB0byBwYXNzIHRvIGl0LgorICogIFJldHVybnM6CisgKiAgUmVxdWlyZXM6CisgKiAgICAgIERCTCBpbml0aWFsaXplZC4KKyAqICAgICAgVmFsaWQgbGliLgorICogIEVuc3VyZXM6CisgKi8KK3R5cGVkZWYgdm9pZCAoKmRibGxfdW5sb2FkX2Z4bikgKHN0cnVjdCBkYmxsX2xpYnJhcnlfb2JqICpsaWJyYXJ5LAorCQkJCSBzdHJ1Y3QgZGJsbF9hdHRycyAqYXR0cnMpOworCisvKgorICogID09PT09PT09IGRibGxfdW5sb2FkX3NlY3QgPT09PT09PT0KKyAqICBVbmxvYWQgYSBuYW1lZCBzZWN0aW9uIGZyb20gYW4gbGlicmFyeSAoZm9yIG92ZXJsYXkgc3VwcG9ydCkuCisgKiAgUGFyYW1ldGVyczoKKyAqICAgICAgbGliICAgICAgICAgICAgIC0gSGFuZGxlIHJldHVybmVkIGZyb20gZGJsbF9vcGVuKCkuCisgKiAgICAgIHNlY19uYW1lICAgICAgICAtIE5hbWUgb2Ygc2VjdGlvbiB0byBsb2FkLgorICogICAgICBhdHRycyAgICAgICAgICAgLSBDb250YWlucyBmcmVlKCkgZnVuY3Rpb24gYW5kIGhhbmRsZSB0byBwYXNzIHRvIGl0LgorICogIFJldHVybnM6CisgKiAgICAgIDA6ICAgICAgICBTdWNjZXNzLgorICogICAgICAtRU5YSU86ICAgIE5hbWVkIHNlY3Rpb24gbm90IGZvdW5kLgorICogICAgICAtRU5PU1lTCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIERCTCBpbml0aWFsaXplZC4KKyAqICAgICAgVmFsaWQgbGliLgorICogICAgICBzZWNfbmFtZSAhPSBOVUxMLgorICogIEVuc3VyZXM6CisgKi8KK3R5cGVkZWYgaW50KCpkYmxsX3VubG9hZF9zZWN0X2Z4bikgKHN0cnVjdCBkYmxsX2xpYnJhcnlfb2JqICpsaWIsCisJCQkJCSAgIGNoYXIgKnN6X3NlY3RfbmFtZSwKKwkJCQkJICAgc3RydWN0IGRibGxfYXR0cnMgKmF0dHJzKTsKKworc3RydWN0IGRibGxfZnhucyB7CisJZGJsbF9jbG9zZV9meG4gY2xvc2VfZnhuOworCWRibGxfY3JlYXRlX2Z4biBjcmVhdGVfZnhuOworCWRibGxfZGVsZXRlX2Z4biBkZWxldGVfZnhuOworCWRibGx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ERyaXZlciBmb3IgYQorICogICAgICAnQnJpZGdlIGRldmljZS4KKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBkZXZpY2Vfb2JqOiAgICAgUHRyIHRvIGxvY2F0aW9uIHRvIHJlY2VpdmUgdGhlIGRldmljZSBvYmplY3QgaGFuZGxlLgorICogICAgICBkcml2ZXJfZmlsZV9uYW1lOiBOYW1lIG9mIEJyaWRnZSBkcml2ZXIgUEUgRExMIGZpbGUgdG8gbG9hZC4gIElmIHRoZQorICogICAgICAgICAgICAgICAgICAgICAgYWJzb2x1dGUgcGF0aCBpcyBub3QgcHJvdmlkZWQsIHRoZSBmaWxlIGlzIGxvYWRlZAorICogICAgICAgICAgICAgICAgICAgICAgdGhyb3VnaCAnQnJpZGdlJ3MgbW9kdWxlIHNlYXJjaCBwYXRoLgorICogICAgICBob3N0X2NvbmZpZzogICAgSG9zdCBjb25maWd1cmF0aW9uIGluZm9ybWF0aW9uLCB0byBiZSBwYXNzZWQgZG93bgorICogICAgICAgICAgICAgICAgICAgICAgdG8gdGhlIEJyaWRnZSBkcml2ZXIgd2hlbiBicmlkZ2VfZGV2X2NyZWF0ZSgpIGlzIGNhbGxlZC4KKyAqICAgICAgcERzcENvbmZpZzogICAgIERTUCByZXNvdXJjZXMsIHRvIGJlIHBhc3NlZCBkb3duIHRvIHRoZSBCcmlkZ2UgZHJpdmVyCisgKiAgICAgICAgICAgICAgICAgICAgICB3aGVuIGJyaWRnZV9kZXZfY3JlYXRlKCkgaXMgY2FsbGVkLgorICogICAgICBkZXZfbm9kZV9vYmo6ICAgICAgIFBsYXRmb3JtIHNwZWNpZmljIGRldmljZSBub2RlLgorICogIFJldHVybnM6CisgKiAgICAgIDA6ICAgICAgICAgICAgTW9kdWxlIGlzIGxvYWRlZCwgZGV2aWNlIG9iamVjdCBoYXMgYmVlbiBjcmVhdGVkCisgKiAgICAgIC1FTk9NRU06ICAgICAgICBJbnN1ZmZpY2llbnQgbWVtb3J5IHRvIGNyZWF0ZSBu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EF1dG9fU3RhcnQpIG9yIHByb2NfbG9hZCB0aGlzIGZ4biBpcyBjYWxsZWQuIFRoaXMgY3JlYXRlcworICogICAgICB0aGUgTm9kZSBNYW5hZ2VyIGFuZCB1cGRhdGVzIHRoZSBERVYgT2JqZWN0LgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIGhkZXZfb2JqOiBIYW5kbGUgdG8gZGV2aWNlIG9iamVjdCBjcmVhdGVkIHdpdGggZGV2X2NyZWF0ZV9kZXZpY2UoKS4KKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICBTdWNjZXNzZnVsIENyZWF0aW9uIG9mIE5vZGUgTWFuYWdlcgorICogICAgICAtRVBFUk06ICBTb21lIEVycm9yIE9jY3VycmVkLgorICogIFJlcXVpcmVzOgorICogICAgICBERVYgSW5pdGlhbGl6ZWQKKyAqICAgICAgVmFsaWQgaGRldl9vYmoKKyAqICBFbnN1cmVzOgorICogICAgICAwIGFuZCBoZGV2X29iai0+aG5vZGVfbWdyICE9IE5VTEwKKyAqICAgICAgZWxzZSAgICBoZGV2X29iai0+aG5vZGVfbWdyID09IE5VTEwKKyAqLworZXh0ZXJuIGludCBkZXZfY3JlYXRlMihzdHJ1Y3QgZGV2X29iamVjdCAqaGRldl9vYmopOworCisvKgorICogID09PT09PT09IGRldl9kZXN0cm95MiA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIERlc3Ryb3lzIHRoZSBOb2RlIG1hbmFnZXIgZm9yIHRoaXMgZGV2aWNlLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIGhkZXZfb2JqOiBIYW5kbGUgdG8gZGV2aWNlIG9iamVjdCBjcmVhdGVkIHdpdGggZGV2X2NyZWF0ZV9kZXZpY2UoKS4KKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICBTdWNjZXNzZnVsIENyZWF0aW9uIG9mIE5vZGUgTWFuYWdlcgorICogICAgICAtRVBFUk06ICBTb21lIEVycm9yIE9jY3VycmVkLgorICogIFJlcXVpcmVzOgorICogICAgICBERVYgSW5pdGlhbGl6ZWQKKyAqICAgICAgVmFsaWQgaGRldl9vYmoKKyAqICBFbnN1cmVzOgorICogICAgICAwIGFuZCBoZGV2X29iai0+aG5vZGVfbWdyID09IE5VTEwKKyAqICAgICAgZWxzZSAgICAtRVBFUk0uCisgKi8KK2V4dGVybiBpbnQgZGV2X2Rlc3Ryb3kyKHN0cnVjdCBkZXZfb2JqZWN0ICpoZGV2X29iaik7CisKKy8qCisgKiAgPT09PT09PT0gZGV2X2Rlc3Ryb3lfZGV2aWNlID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgRGVzdHJveXMgdGhlIGNoYW5uZWwgbWFuYWdlciBmb3IgdGhpcyBkZXZpY2UsIGlmIGFueSwgY2FsbHMKKyAqICAgICAgYnJpZGdlX2Rldl9kZXN0cm95KCksIGFuZCB0aGVuIGF0dGVtcHRzIHRvIHVubG9hZCB0aGUgQnJpZGdlIG1vZHVsZS4KKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBoZGV2X29iajogICAgIEhhbmRsZSB0byBkZXZpY2Ugb2JqZWN0IGNyZWF0ZWQgd2l0aAorICogICAgICAgICAgICAgICAgICAgICAgZGV2X2NyZWF0ZV9kZXZpY2UoKS4KKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgU3VjY2Vzcy4KKyAqICAgICAgLUVGQVVMVDogICAgSW52YWxpZCBoZGV2X29iai4KKyAqICAgICAgLUVQRVJNOiAgICAgVGhlIEJyaWRnZSBkcml2ZXIgZmFpbGVkIGl0J3MgYnJpZGdlX2Rldl9kZXN0cm95KCkgZnVuY3Rpb24uCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIERFViBJbml0aWFsaXplZC4KKyAqICBFbnN1cmVzOgorICovCitleHRlcm4gaW50IGRldl9kZXN0cm95X2RldmljZShzdHJ1Y3QgZGV2X29iamVjdAorCQkJCSAgICAgKmhkZXZfb2JqKTsKKworLyoKKyAqICA9PT09PT09PSBkZXZfZ2V0X2NobmxfbWdyID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgUmV0cmlldmUgdGhlIGhhbmRsZSB0byB0aGUgY2hhbm5lbCBtYW5hZ2VyIGNyZWF0ZWQgZm9yIHRoaXMgZGV2aWNlLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIGhkZXZfb2JqOiAgICAgSGFuZGxlIHRvIGRldmljZSBvYmplY3QgY3JlYXRlZCB3aXRoCisgKiAgICAgICAgICAgICAgICAgICAgICBkZXZfY3JlYXRlX2RldmljZSgpLgorICogICAgICAqbWdyOiAgICAgICAgICAgUHRyIHRvIGxvY2F0aW9uIHRvIHN0b3JlIGhhbmRsZS4KKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgU3VjY2Vzcy4KKyAqICAgICAgLUVGQVVMVDogICAgSW52YWxpZCBoZGV2X29iai4KKyAqICBSZXF1aXJlczoKKyAqICAgICAgbWdyICE9IE5VTEwuCisgKiAgICAgIERFViBJbml0aWFsaXplZC4KKyAqICBFbnN1cmVzOgorICogICAgICAwOiAgICAgICAgKm1nciBjb250YWlucyBhIGhhbmRsZSB0byBhIGNoYW5uZWwgbWFuYWdlciBvYmplY3QsCisgKiAgICAgICAgICAgICAgICAgICAgICBvciBOVUxMLgorICogICAgICBlbHNlOiAgICAgICAgICAgKm1nciBpcyBOVUxMLgorICovCitleHRlcm4gaW50IGRldl9nZXRfY2hubF9tZ3Ioc3RydWN0IGRldl9vYmplY3QgKmhkZXZfb2JqLAorCQkJCSAgIHN0cnVjdCBjaG5sX21nciAqKm1ncik7CisKKy8qCisgKiAgPT09PT09PT0gZGV2X2dldF9jbW1fbWdyID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgUmV0cmlldmUgdGhlIGhhbmRsZSB0byB0aGUgc2hhcmVkIG1lbW9yeSBtYW5hZ2VyIGNyZWF0ZWQgZm9yIHRoaXMKKyAqICAgICAgZGV2aWNlLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIGhkZXZfb2JqOiAgICAgSGFuZGxlIHRvIGRldmljZSBvYmplY3QgY3JlYXRlZCB3aXRoCisgKiAgICAgICAgICAgICAgICAgICAgICBkZXZfY3JlYXRlX2RldmljZSgpLgorICogICAgICAqbWdyOiAgICAgICAgICAgUHRyIHRvIGxvY2F0aW9uIHRvIHN0b3JlIGhhbmRsZS4KKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgU3VjY2Vzcy4KKyAqICAgICAgLUVGQVVMVDogICAgSW52YWxpZCBoZGV2X29iai4KKyAqICBSZXF1aXJlczoKKyAqICAgICAgbWdyICE9IE5VTEwuCisgKiAgICAgIERFViBJbml0aWFsaXplZC4KKyAqICBFbnN1cmVzOgorICogICAgICAwOiAgICAgICAgKm1nciBjb250YWlucyBhIGhhbmRsZSB0byBhIGNoYW5uZWwgbWFuYWdlciBvYmplY3QsCisgKiAgICAgICAgICAgICAgICAgICAgICBvciBOVUxMLgorICogICAgICBlbHNlOiAgICAgICAgICAgKm1nciBpcyBOVUxMLgorICovCitleHRlcm4gaW50IGRldl9nZXRfY21tX21ncihzdHJ1Y3QgZGV2X29iamVjdCAqaGRldl9vYmosCisJCQkJICBzdHJ1Y3QgY21tX29iamVjdCAqKm1ncik7CisKKy8qCisgKiAgPT09PT09PT0gZGV2X2dldF9kbW1fbWdyID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgUmV0cmlldmUgdGhlIGhhbmRsZSB0byB0aGUgZHluYW1pYyBtZW1vcnkgbWFuYWdlciBjcmVhdGVkIGZvciB0aGlzCisgKiAgICAgIGRldmljZS4KKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBoZGV2X29iajogICAgIEhhbmRsZSB0byBkZXZpY2Ugb2JqZWN0IGNyZWF0ZWQgd2l0aAorICogICAgICAgICAgICAgICAgICAgICAgZGV2X2NyZWF0ZV9kZXZpY2UoKS4KKyAqICAgICAgKm1ncjogICAgICAgICAgIFB0ciB0byBsb2NhdGlvbiB0byBzdG9yZSBoYW5kbGUuCisgKiAgUmV0dXJuczoKKyAqICAgICAgMDogICAgICAgIFN1Y2Nlc3MuCisgKiAgICAgIC1FRkFVTFQ6ICAgIEludmFsaWQgaGRldl9vYmouCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIG1nciAhPSBOVUxMLgorICogICAgICBERVYgSW5pdGlhbGl6ZWQuCisgKiAgRW5zdXJlczoKKyAqICAgICAgMDogICAgICAgICptZ3IgY29udGFpbnMgYSBoYW5kbGUgdG8gYSBjaGFubmVsIG1hbmFnZXIgb2JqZWN0LAorICogICAgICAgICAgICAgICAgICAgICAgb3IgTlVMTC4KKyAqICAgICAgZWxzZTogICAgICAgICAgICptZ3IgaXMgTlVMTC4KKyAqLworZXh0ZXJuIGludCBkZXZfZ2V0X2RtbV9tZ3Ioc3RydWN0IGRldl9vYmplY3QgKmhkZXZfb2JqLAorCQkJCSAgc3RydWN0IGRtbV9vYmplY3QgKiptZ3IpOworCisvKgorICogID09PT09PT09IGRldl9nZXRfY29kX21nciA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIFJldHJpZXZlIHRoZSBDT0QgbWFuYWdlciBjcmVhdGUgZm9yIHRoaXMgZGV2aWNlLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIGhkZXZfb2JqOiAgICAgSGFuZGxlIHRvIGRldmljZSBvYmplY3QgY3JlYXRlZCB3aXRoCisgKiAgICAgICAgICAgICAgICAgICAgICBkZXZfY3JlYXRlX2RldmljZSgpLgorICogICAgICAqY29kX21ncjogICAgICAgUHRyIHRvIGxvY2F0aW9uIHRvIHN0b3JlIGhhbmRsZS4KKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgU3VjY2Vzcy4KKyAqICAgICAgLUVGQVVMVDogICAgSW52YWxpZCBoZGV2X29iai4KKyAqICBSZXF1aXJlczoKKyAqICAgICAgY29kX21nciAhPSBOVUxMLgorICogICAgICBERVYgSW5pdGlhbGl6ZWQuCisgKiAgRW5z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GVoX21nciAqKmRlaF9tYW5hZ2VyKTsKKworLyoKKyAqICA9PT09PT09PSBkZXZfZ2V0X2Rldl9ub2RlID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgUmV0cmlldmUgdGhlIHBsYXRmb3JtIHNwZWNpZmljIGRldmljZSBJRCBmb3IgdGhpcyBkZXZpY2UuCisgKiAgUGFyYW1ldGVyczoKKyAqICAgICAgaGRldl9vYmo6ICAgICBIYW5kbGUgdG8gZGV2aWNlIG9iamVjdCBjcmVhdGVkIHdpdGgKKyAqICAgICAgICAgICAgICAgICAgICAgIGRldl9jcmVhdGVfZGV2aWNlKCkuCisgKiAgICAgIGRldl9uZGU6ICAgICAgICBQdHIgdG8gbG9jYXRpb24gdG8gZ2V0IHRoZSBkZXZpY2Ugbm9kZSBoYW5kbGUuCisgKiAgUmV0dXJuczoKKyAqICAgICAgMDogICAgICAgIFJldHVybnMgYSBERVZOT0RFIGluICpkZXZfbm9kZV9vYmouCisgKiAgICAgIC1FRkFVTFQ6ICAgIEludmFsaWQgaGRldl9vYmouCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIGRldl9uZGUgIT0gTlVMTC4KKyAqICAgICAgREVWIEluaXRpYWxpemVkLgorICogIEVuc3VyZXM6CisgKiAgICAgIDA6ICAgICAgICAqZGV2X25kZSBjb250YWlucyBhIHBsYXRmb3JtIHNwZWNpZmljIGRldmljZSBJRDsKKyAqICAgICAgZWxzZTogICAgICAgICAgICpkZXZfbmRlIGlzIE5VTEwuCisgKi8KK2V4dGVybiBpbnQgZGV2X2dldF9kZXZfbm9kZShzdHJ1Y3QgZGV2X29iamVjdCAqaGRldl9vYmosCisJCQkJICAgc3RydWN0IGNmZ19kZXZub2RlICoqZGV2X25kZSk7CisKKy8qCisgKiAgPT09PT09PT0gZGV2X2dldF9kZXZfdHlwZSA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIFJldHJpZXZlIHRoZSBwbGF0Zm9ybSBzcGVjaWZpYyBkZXZpY2UgSUQgZm9yIHRoaXMgZGV2aWNlLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIGhkZXZfb2JqOiAgICAgSGFuZGxlIHRvIGRldmljZSBvYmplY3QgY3JlYXRlZCB3aXRoCisgKiAgICAgICAgICAgICAgICAgICAgICBkZXZfY3JlYXRlX2RldmljZSgpLgorICogICAgICBkZXZfbmRlOiAgICAgICAgUHRyIHRvIGxvY2F0aW9uIHRvIGdldCB0aGUgZGV2aWNlIG5vZGUgaGFuZGxlLgorICogIFJldHVybnM6CisgKiAgICAgIDA6ICAgICAgICBTdWNjZXNzCisgKiAgICAgIC1FRkFVTFQ6ICAgIEludmFsaWQgaGRldl9vYmouCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIGRldl9uZGUgIT0gTlVMTC4KKyAqICAgICAgREVWIEluaXRpYWxpemVkLgorICogIEVuc3VyZXM6CisgKiAgICAgIDA6ICAgICAgICAqZGV2X25kZSBjb250YWlucyBhIHBsYXRmb3JtIHNwZWNpZmljIGRldmljZSBJRDsKKyAqICAgICAgZWxzZTogICAgICAgICAgICpkZXZfbmRlIGlzIE5VTEwuCisgKi8KK2V4dGVybiBpbnQgZGV2X2dldF9kZXZfdHlwZShzdHJ1Y3QgZGV2X29iamVjdCAqZGV2aWNlX29iaiwKKwkJCQkJdTggKmRldl90eXBlKTsKKworLyoKKyAqICA9PT09PT09PSBkZXZfZ2V0X2ZpcnN0ID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgUmV0cmlldmUgdGhlIGZpcnN0IERldmljZSBPYmplY3QgaGFuZGxlIGZyb20gYW4gaW50ZXJuYWwgbGlua2VkIGxpc3Qgb2YKKyAqICAgICAgb2YgREVWX09CSkVDVHMgbWFpbnRhaW5lZCBieSBERVYuCisgKiAgUGFyYW1ldGVyczoKKyAqICBSZXR1cm5zOgorICogICAgICBOVUxMIGlmIHRoZXJlIGFyZSBubyBkZXZpY2Ugb2JqZWN0cyBzdG9yZWQ7IGVsc2UKKyA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orICogICAgICAtRUZBVUxUOiAgICBJbnZhbGlkIGhkZXZfb2JqLgorICogIFJlcXVpcmVzOgorICogICAgICBpZl9meG5zICE9IE5VTEwuCisgKiAgICAgIERFViBJbml0aWFsaXplZC4KKyAqICBFbnN1cmVzOgorICogICAgICAwOiAgICAgICAgKmlmX2Z4bnMgY29udGFpbnMgYSBwb2ludGVyIHRvIHRoZSBCcmlkZ2UKKyAqICAgICAgICAgICAgICAgICAgICAgIGRyaXZlciBpbnRlcmZhY2U7CisgKiAgICAgIGVsc2U6ICAgICAgICAgICAqaWZfZnhucyBpcyBOVUxMLgorICovCitleHRlcm4gaW50IGRldl9nZXRfaW50Zl9meG5zKHN0cnVjdCBkZXZfb2JqZWN0ICpoZGV2X29iaiwKKwkJCSAgICBzdHJ1Y3QgYnJpZGdlX2Rydl9pbnRlcmZhY2UgKippZl9meG5zKTsKKworLyoKKyAqICA9PT09PT09PSBkZXZfZ2V0X2lvX21nciA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIFJldHJpZXZlIHRoZSBoYW5kbGUgdG8gdGhlIElPIG1hbmFnZXIgY3JlYXRlZCBmb3IgdGhpcyBkZXZpY2UuCisgKiAgUGFyYW1ldGVyczoKKyAqICAgICAgaGRldl9vYmo6ICAgICBIYW5kbGUgdG8gZGV2aWNlIG9iamVjdCBjcmVhdGVkIHdpdGgKKyAqICAgICAgICAgICAgICAgICAgICAgIGRldl9jcmVhdGVfZGV2aWNlKCkuCisgKiAgICAgICptZ3I6ICAgICAgICAgICBQdHIgdG8gbG9jYXRpb24gdG8gc3RvcmUgaGFuZGxlLgorICogIFJldHVybnM6CisgKiAgICAgIDA6ICAgICAgICBTdWNjZXNzLgorICogICAgICAtRUZBVUxUOiAgICBJbnZhbGlkIGhkZXZfb2JqLgorICogIFJlcXVpcmVzOgorICogICAgICBtZ3IgIT0gTlVMTC4KKyAqICAgICAgREVWIEluaXRpYWxpemVkLgorICogIEVuc3VyZXM6CisgKiAgICAgIDA6ICA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tZ3IgKiptc2dfbWFuKTsKKworLyoKKyAqICA9PT09PT09PT0gZGV2X2dldF9ub2RlX21hbmFnZXIgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBSZXRyaWV2ZSB0aGUgTm9kZSBNYW5hZ2VyIEhhbmRsZSBmcm9tIHRoZSBEZXZPYmplY3QuIEl0IGlzIGFuCisgKiAgICAgIGFjY2Vzc29yIGZ1bmN0aW9uCisgKiAgUGFyYW1ldGVyczoKKyAqICAgICAgaGRldl9vYmo6ICAgICBIYW5kbGUgdG8gdGhlIERldiBPYmplY3QKKyAqICAgICAgbm9kZV9tYW46ICAgICAgIExvY2F0aW9uIHdoZXJlIEhhbmRsZSB0byB0aGUgTm9kZSBNYW5hZ2VyIHdpbGwgYmUKKyAqICAgICAgICAgICAgICAgICAgICAgIHJldHVybmVkLi4KKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgU3VjY2VzcworICogICAgICAtRUZBVUxUOiAgICBJbnZhbGlkIERldiBPYmplY3QgaGFuZGxlLgorICogIFJlcXVpcmVzOgorICogICAgICBERVYgSW5pdGlhbGl6ZWQuCisgKiAgICAgIG5vZGVfbWFuIGlzIG5vdCBudWxsCisgKiAgRW5zdXJlczoKKyAqICAgICAgMDogICAgICAgICpub2RlX21hbiBjb250YWlucyBhIGhhbmRsZSB0byBhIE5vZGUgbWFuYWdlciBvYmplY3QuCisgKiAgICAgIGVsc2U6ICAgICAgICAgICAqbm9kZV9tYW4gaXMgTlVMTC4KKyAqLworZXh0ZXJuIGludCBkZXZfZ2V0X25vZGVfbWFuYWdlcihzdHJ1Y3QgZGV2X29iamVjdAorCQkJCSAgICAgICAqaGRldl9vYmosCisJCQkJICAgICAgIHN0cnVjdCBub2RlX21nciAqKm5vZGVfbWFuKTsKKworLyoKKyAqICA9PT09PT09PSBkZXZfZ2V0X3N5bWJvbCA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIEdldCB0aGUgdmFsdWUgb2YgYSBzeW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HRoZQorICogICAgICBicmlkZ2VfZGV2X2NyZWF0ZSBmeG4uCisgKiAgUGFyYW1ldGVyczoKKyAqICAgICAgaGRldl9vYmo6ICAgICBIYW5kbGUgdG8gZGV2aWNlIG9iamVjdCBjcmVhdGVkIHdpdGggZGV2X2NyZWF0ZV9kZXZpY2UoKQorICogICAgICAqcGhicmlkZ2VfY29udGV4dDogIFB0ciB0byBsb2NhdGlvbiB0byBzdG9yZSBjb250ZXh0IGhhbmRsZS4KKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgU3VjY2Vzcy4KKyAqICAgICAgLUVGQVVMVDogICAgSW52YWxpZCBoZGV2X29iai4KKyAqICBSZXF1aXJlczoKKyAqICAgICAgcGhicmlkZ2VfY29udGV4dCAhPSBOVUxMLgorICogICAgICBERVYgSW5pdGlhbGl6ZWQuCisgKiAgRW5zdXJlczoKKyAqICAgICAgMDogICAgICAgICpwaGJyaWRnZV9jb250ZXh0IGNvbnRhaW5zIGNvbnRleHQgaGFuZGxlOworICogICAgICBlbHNlOiAgICAgICAgICAgKnBoYnJpZGdlX2NvbnRleHQgaXMgTlVMTDsKKyAqLworZXh0ZXJuIGludCBkZXZfZ2V0X2JyaWRnZV9jb250ZXh0KHN0cnVjdCBkZXZfb2JqZWN0ICpoZGV2X29iaiwKKwkJCQkgICAgICBzdHJ1Y3QgYnJpZGdlX2Rldl9jb250ZXh0CisJCQkJICAgICAgKipwaGJyaWRnZV9jb250ZXh0KTsKKworLyoKKyAqICA9PT09PT09PSBkZXZfZXhpdCA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIERlY3JlbWVudCByZWZlcmVuY2UgY291bnQsIGFuZCBmcmVlIHJlc291cmNlcyB3aGVuIHJlZmVyZW5jZSBjb3VudCBpcworICogICAgICAwLgorICogIFBhcmFtZXRlcnM6CisgKiAgUmV0dXJuczoKKyAqICBSZXF1aXJlczoKKyAqICAgICAgREVWIGlzIGluaXRpYWxpemVkLgorICogIEVuc3VyZXM6CisgKiAgICAgIFdoZW4gcmVmZXJlbmNlIGNvdW50ID09IDAsIERFVidzIHByaXZhdGUgcmVzb3VyY2VzIGFyZSBmcmVlZC4KKyAqLworZXh0ZXJuIHZvaWQgZGV2X2V4aXQodm9pZCk7CisKKy8qCisgKiAgPT09PT09PT0gZGV2X2luaXQgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBJbml0aWFsaXplIERFVidzIHByaXZhdGUgc3RhdGUsIGtlZXBpbmcgYSByZWZlcmVuY2UgY291bnQgb24gZWFjaCBjYWxsLgorICogIFBhcmFtZXRlcnM6CisgKiAgUmV0dXJuczoKKyAqICAgICAgVFJVRSBpZiBpbml0aWFsaXplZDsgRkFMU0UgaWYgZXJyb3Igb2NjdXJlZC4KKyAqICBSZXF1aXJlczoKKyAqICBFbnN1cmVzOgorICogICAgICBUUlVFOiBBIHJlcXVpcmVtZW50IGZvciB0aGUgb3RoZXIgcHVibGljIERFViBmdW5jdGlvbnMuCisgKi8KK2V4dGVybiBib29sIGRldl9pbml0KHZvaWQpOworCisvKgorICogID09PT09PT09IGRldl9pc19sb2NrZWQgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBQcmVkaWNhdGUgZnVuY3Rpb24gdG8gZGV0ZXJtaW5lIGlmIHRoZSBkZXZpY2UgaGFzIGJlZW4KKyAqICAgICAgbG9ja2VkIGJ5IGEgY2xpZW50IGZvciBleGNsdXNpdmUgYWNjZXNzLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIGhkZXZfb2JqOiAgICAgSGFuZGxlIHRvIGRldmljZSBvYmplY3QgY3JlYXRlZCB3aXRoCisgKiAgICAgICAgICAgICAgICAgICAgICBkZXZfY3JlYXRlX2RldmljZSgpLgorICogIFJldHVybnM6CisgKiAgICAgIDA6ICAgICAgICBUUlVFOiBkZXZpY2UgaGFzIGJlZW4gbG9ja2VkLgorICogICAgICAwOiAgICAgRkFMU0U6IGRldmljZSBub3QgbG9ja2VkLgorICogICAgICAtRUZBVUxUOiAgICBoZGV2X29iaiB3YXMgaW52YWxpZC4KKyAqICBSZXF1aXJlczoKKyAqICAgICAgREVWIEluaXRpYWxpemVkLgorICogIEVuc3VyZXM6CisgKi8KK2V4dGVybiBpbnQgZGV2X2lzX2xvY2tlZChzdHJ1Y3QgZGV2X29iamVjdCAqaGRldl9vYmopOworCisvKgorICogID09PT09PT09IGRldl9pbnNlcnRfcHJvY19vYmplY3QgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBJbnNlcnRzIHRoZSBQcm9jZXNzb3IgT2JqZWN0IGludG8gdGhlIExpc3Qgb2YgUFJPQyBPYmplY3RzCisgKiAgICAgIGtlcHQgaW4gdGhlIERFViBPYmplY3QKKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBwcm9jX29iajogICAgSGFuZGxlIHRvIHRoZSBQcm9jIE9iamVjdAorICogICAgICBoZGV2X29iaiAgICAgIEhhbmRsZSB0byB0aGUgRGV2IE9iamVjdAorICogICAgICBiQXR0YWNoZWROZXcgICAgU3BlY2lmaWVzIGlmIHRoZXJlIGFyZSBhbHJlYWR5IHByb2Nlc3NvcnMgYXR0YWNoZWQKKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgU3VjY2Vzc2Z1bGx5IGluc2VydGVkIGludG8gdGhlIGxpc3QKKyAqICBSZXF1aXJlczoKKyAqICAgICAgcHJvY19vYmogaXMgbm90IE5VTEwKKyAqICAgICAgaGRldl9vYmogaXMgYSB2YWxpZCBoYW5kbGUgdG8gdGhlIERFVi4KKyAqICAgICAgREVWIEluaXRpYWxpemVkLgorICogICAgICBMaXN0KG9mIFByb2Mgb2JqZWN0IGluIERldikgRXhpc3RzLgorICogIEVuc3VyZXM6CisgKiAgICAgIDAgJiB0aGUgUFJPQyBPYmplY3QgaXMgaW5zZXJ0ZWQgYW5kIHRoZSBsaXN0IGlzIG5vdCBlbXB0eQorICogIERldGFpbHM6CisgKiAgICAgIElmIHRoZSBMaXN0IG9mIFByb2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B3ZXJlIGFzeW5jaHJvbm91c2x5IG5vdGlmaWVkLgorICogICAgICAtRUlOVkFMOiAgIEludmFsaWQgaGRldl9vYmouCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIERFViBJbml0aWFsaXplZC4KKyAqICBFbnN1cmVzOgorICogICAgICAwOiBOb3RpZmljYXRpb25zIGFyZSBxdWV1ZWQgYnkgdGhlIG9wZXJhdGluZyBzeXN0ZW0gdG8gYmUKKyAqICAgICAgZGVsaXZlcmVkIHRvIGNsaWVudHMuICBUaGlzIGZ1bmN0aW9uIGRvZXMgbm90IGVuc3VyZSB0aGF0CisgKiAgICAgIHRoZSBub3RpZmljYXRpb25zIHdpbGwgZXZlciBiZSBkZWxpdmVyZWQuCisgKi8KK2V4dGVybiBpbnQgZGV2X25vdGlmeV9jbGllbnRzKHN0cnVjdCBkZXZfb2JqZWN0ICpoZGV2X29iaiwgdTMyIHJldCk7CisKKy8qCisgKiAgPT09PT09PT0gZGV2X3JlbW92ZV9kZXZpY2UgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBEZXN0cm95cyB0aGUgRGV2aWNlIE9iamVjdCBjcmVhdGVkIGJ5IGRldl9zdGFydF9kZXZpY2UuCisgKiAgUGFyYW1ldGVyczoKKyAqICAgICAgZGV2X25vZGVfb2JqOiAgICAgICBEZXZpY2Ugbm9kZSBhcyBpdCBpcyBrbm93IHRvIE9TLgorICogIFJldHVybnM6CisgKiAgICAgIDA6ICAgICAgICBJZiBzdWNjZXNzOworICogICAgICA8ZXJyb3IgY29kZT4gICAgT3RoZXJ3aXNlLgorICogIFJlcXVpcmVzOgorICogIEVuc3VyZXM6CisgKi8KK2V4dGVybiBpbnQgZGV2X3JlbW92ZV9kZXZpY2Uoc3RydWN0IGNmZ19kZXZub2RlICpkZXZfbm9kZV9vYmopOworCisvKgorICogID09PT09PT09IGRldl9zZXRfY2hubF9tZ3IgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBTZXQgdGhlIGNo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1dGVzLgorICogIFJldHVybnM6CisgKiAgICAgIDA6ICAgICAgICAgICAgICAgIFN1Y2Nlc3M7CisgKiAgICAgIC1FTk9NRU06ICAgICAgICAgICAgSW5zdWZmaWNpZW50IG1lbW9yeSBmb3IgcmVxdWVzdGVkIHJlc291cmNlcy4KKyAqICAgICAgLUVQRVJNOiAgICAgICAgICAgICAgVW5hYmxlIHRvIGNyZWF0ZSBkaXNwYXRjaGVyLgorICogIFJlcXVpcmVzOgorICogICAgICBkaXNwX2luaXQodm9pZCkgY2FsbGVkLgorICogICAgICBkaXNwX2F0dHJzICE9IE5VTEwuCisgKiAgICAgIGhkZXZfb2JqICE9IE5VTEwuCisgKiAgICAgIGRpc3BhdGNoX29iaiAhPSBOVUxMLgorICogIEVuc3VyZXM6CisgKiAgICAgIDA6ICAgICAgICBJU19WQUxJRCgqZGlzcGF0Y2hfb2JqKS4KKyAqICAgICAgZXJyb3I6ICAgICAgICAgICpkaXNwYXRjaF9vYmogPT0gTlVMTC4KKyAqLworZXh0ZXJuIGludCBkaXNwX2NyZWF0ZShzdHJ1Y3QgZGlzcF9vYmplY3QgKipkaXNwYXRjaF9vYmosCisJCQkgICAgICBzdHJ1Y3QgZGV2X29iamVjdCAqaGRldl9vYmosCisJCQkgICAgICBjb25zdCBzdHJ1Y3QgZGlzcF9hdHRyICpkaXNwX2F0dHJzKTsKKworLyoKKyAqICA9PT09PT09PSBkaXNwX2RlbGV0ZSA9PT09PT09PQorICogIERlbGV0ZSB0aGUgTk9ERSBEaXNwYXRjaGVyLgorICoKKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBkaXNwX29iajogIE5vZGUgRGlzcGF0Y2hlciBvYmplY3QuCisgKiAgUmV0dXJuczoKKyAqICBSZXF1aXJlczoKKyAqICAgICAgZGlzcF9pbml0KHZvaWQpIGNhbGxlZC4KKyAqICAgICAgVmFsaWQgZGlzcF9vYmouCisgKiAgRW5zdXJlczoKKyAqICAgICAgZGlzcF9vYmogaXMgaW52YWxpZC4KKyAqLworZXh0ZXJuIHZvaWQgZGlzcF9kZWxldGUoc3RydWN0IGRpc3Bfb2JqZWN0ICpkaXNwX29iaik7CisKKy8qCisgKiAgPT09PT09PT0gZGlzcF9leGl0ID09PT09PT09CisgKiAgRGlzY29udGludWUgdXNhZ2Ugb2YgRElTUCBtb2R1bGUuCisgKgorICogIFBhcmFtZXRlcnM6CisgKiAgUmV0dXJuczoKKyAqICBSZXF1aXJlczoKKyAqICAgICAgZGlzcF9pbml0KHZvaWQpIHByZXZpb3VzbHkgY2FsbGVkLgorICogIEVuc3VyZXM6CisgKiAgICAgIEFueSByZXNvdXJjZXMgYWNxdWlyZWQgaW4gZGlzcF9pbml0KHZvaWQpIHdpbGwgYmUgZnJlZWQgd2hlbiBsYXN0IERJU1AKKyAqICAgICAgY2xpZW50IGNhbGxzIGRpc3BfZXhpdCh2b2lkKS4KKyAqLworZXh0ZXJuIHZvaWQgZGlzcF9leGl0KHZvaWQpOworCisvKgorICogID09PT09PT09IGRpc3BfaW5pdCA9PT09PT09PQorICogIEluaXRpYWxpemUgdGhlIERJU1AgbW9kdWxlLgorICoKKyAqICBQYXJhbWV0ZXJzOgorICogIFJldHVybnM6CisgKiAgICAgIFRSVUUgaWYgaW5pdGlhbGl6YXRpb24gc3VjY2VlZGVkLCBGQUxTRSBvdGhlcndpc2UuCisgKiAgRW5zdXJlczoKKyAqLworZXh0ZXJuIGJvb2wgZGlzcF9pbml0KHZvaWQpOworCisvKgorICogID09PT09PT09IGRpc3Bfbm9kZV9jaGFuZ2VfcHJpb3JpdHkgPT09PT09PT0KKyAqICBDaGFuZ2UgdGhlIHByaW9yaXR5IG9mIGEgbm9kZSBjdXJyZW50bHkgcnVubmluZyBvbiB0aGUgdGFyZ2V0LgorICoKKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBkaXNwX29iajogICAgICAgICAgICBOb2RlIERpc3BhdGNoZXIgb2JqZWN0LgorICogICAgICBobm9kZTogICAgICAgICAgICAgICAgICBOb2RlIG9iamVjdCByZXByZXNlbnRpbmcgYSBub2RlIGN1cnJlbnRseQorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGxvY2F0ZWQgb3IgcnVubmluZyBvbiB0aGUgRFNQLgorICogICAgICB1bEZ4bkFkZHJlc3M6ICAgICAgICAgICBBZGRyZXNzIG9mIFJNUyBmdW5jdGlvbiBmb3IgY2hhbmdpbmcgcHJpb3JpdHkuCisgKiAgICAgIG5vZGVfZW52OiAgICAgICAgICAgICAgICBBZGRyZXNzIG9mIG5vZGUncyBlbnZpcm9ubWVudCBzdHJ1Y3R1cmUuCisgKiAgICAgIHByaW86ICAgICAgICAgICAgICBOZXcgcHJpb3JpdHkgbGV2ZWwgdG8gc2V0IG5vZGUncyBwcmlvcml0eSB0by4KKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgICAgICAgICBTdWNjZXNzLgorICogICAgICAtRVRJTUU6ICAgICAgICAgICBBIHRpbWVvdXQgb2NjdXJyZWQgYmVmb3JlIHRoZSBEU1AgcmVzcG9uZGVkLgorICogIFJlcXVpcmVzOgorICogICAgICBkaXNwX2luaXQodm9pZCkgY2FsbGVkLgorICogICAgICBWYWxpZCBkaXNwX29iai4KKyAqICAgICAgaG5vZGUgIT0gTlVMTC4KKyAqICBFbnN1cmVzOgorICovCitleHRlcm4gaW50IGRpc3Bfbm9kZV9jaGFuZ2VfcHJpb3JpdHkoc3RydWN0IGRpc3Bfb2JqZWN0CisJCQkJCSAgICAqZGlzcF9vYmosCisJCQkJCSAgICBzdHJ1Y3Qgbm9kZV9vYmplY3QgKmhub2RlLAorCQkJCQkgICAgdTMyIHJtc19meG4sCisJCQkJCSAgICBub2RlZW52IG5vZGVfZW52LCBzMzIgcHJpbyk7CisKKy8qCisgKiAgPT09PT09PT0gZGlzcF9ub2RlX2NyZWF0ZSA9PT09PT09PQorICogIENyZWF0ZSBhIG5vZGUgb24gdGhlIERTUCBieSByZW1vdGVseSBjYWxsaW5nIHRoZSBub2RlJ3MgY3JlYXRlIGZ1bmN0aW9uLgorICoKKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBkaXNwX29iajogICAgTm9kZSBEaXNwYXRjaGVyIG9iamVjdC4KKyAqICAgICAgaG5vZGU6ICAgICAgICAgIE5vZGUgaGFuZGxlIG9idGFpbmVkIGZyb20gbm9kZV9hbGxvY2F0ZSgpLgorICogICAgICB1bF9meG5fYWRkcjogICAgICBBZGRyZXNzIG9yIFJNUyBjcmVhdGUgbm9kZSBmdW5jdGlvbi4KKyAqICAgICAgdWxfY3JlYXRlX2Z4bjogICAgQWRkcmVzcyBvZiBub2RlJ3MgY3JlYXRlIGZ1bmN0aW9uLgorICogICAgICBwYXJnczogICAgICAgICAgQXJndW1lbnRzIHRvIHBhc3MgdG8gUk1TIG5vZGUgY3JlYXRlIGZ1bmN0aW9uLgorICogICAgICBub2RlX2VudjogICAgICAgTG9jYXRpb24gdG8gc3RvcmUgbm9kZSBlbnZpcm9ubWVudCBwb2ludGVyIG9uCisgKiAgICAgICAgICAgICAgICAgICAgICBvdXRwdXQuCisgKiAgUmV0dXJuczoKKyAqICAgICAgMDogICAgICAgIFN1Y2Nlc3MuCisgKiAgICAgIC1FVElNRTogICBBIHRpbWVvdXQgb2NjdXJyZWQgYmVmb3JlIHRoZSBEU1AgcmVzcG9uZGVkLgorICogICAgICAtRVBFUk06ICAgICAgQSBmYWlsdXJlIG9jY3VycmVkLCB1bmFibGUgdG8gY3JlYXRlIG5vZGUuCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIGRpc3BfaW5pdCh2b2lkKSBjYWxsZWQuCisgKiAgICAgIFZhbGlkIGRpc3Bfb2JqLgorICogICAgICBwYXJncyAhPSBOVUxMLgorICogICAgICBobm9kZSAhPSBOVUxMLgorICogICAgICBub2RlX2VudiAhPSBOVUxMLgorICogICAgICBub2RlX2dldF90eXBlKGhub2RlKSAhPSBOT0RFX0RFVklDRS4KKyAqICBFbnN1cmVzOgorICovCitleHRlcm4gaW50IGRpc3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HRvIHN0b3JlIGNyZWF0ZWQgRFJWIE9iamVjdCBoYW5kbGUuCisgKiAgUmV0dXJuczoKKyAqICAgICAgMDogICAgICAgIFN1Y2VzcworICogICAgICAtRU5PTUVNOiAgICBGYWlsZWQgaW4gTWVtb3J5IGFsbG9jYXRpb24KKyAqICAgICAgLUVQRVJNOiAgICAgIEdlbmVyYWwgRmFpbHVyZQorICogIFJlcXVpcmVzOgorICogICAgICBEUlYgSW5pdGlhbGl6ZWQgKHJlZnMgPiAwICkKKyAqICAgICAgZHJ2X29iaiAhPSBOVUxMLgorICogIEVuc3VyZXM6CisgKiAgICAgIDA6ICAgICAgICAtICpkcnZfb2JqIGlzIGEgdmFsaWQgRFJWIGludGVyZmFjZSB0byB0aGUgZGV2aWNlLgorICogICAgICAgICAgICAgICAgICAgICAgLSBMaXN0IG9mIERldk9iamVjdCBDcmVhdGVkIGFuZCBJbml0aWFsaXplZC4KKyAqICAgICAgICAgICAgICAgICAgICAgIC0gTGlzdCBvZiBkZXZfbm9kZSBTdHJpbmcgY3JlYXRlZCBhbmQgaW50aWFsaXplZC4KKyAqICAgICAgICAgICAgICAgICAgICAgIC0gUmVnaXN0cnkgaXMgdXBkYXRlZCB3aXRoIHRoZSBEUlYgT2JqZWN0LgorICogICAgICAhMDogICAgICAgRFJWIE9iamVjdCBub3QgY3JlYXRlZAorICogIERldGFpbHM6CisgKiAgICAgIFRoZXJlIGlzIG9uZSBEcml2ZXIgT2JqZWN0IGZvciB0aGUgRHJpdmVyIHJlcHJlc2VudGluZworICogICAgICB0aGUgZHJpdmVyIGl0c2VsZi4gSXQgY29udGFpbnMgdGhlIGxpc3Qgb2YgZGV2aWNlCisgKiAgICAgIE9iamVjdHMgYW5kIHRoZSBsaXN0IG9mIERldmljZSBFeHRlbnNpb25zIGluIHRoZSBzeXN0ZW0uCisgKiAgICAgIEFsc28gaXQgY2FuIGhvbGQgb3RoZXIgbmVjY2Vzc2FyeQorICogICAgICBpbmZvcm1hdGlvbiBpbiBpdHMgc3RvcmFnZSBhcmVhLgorICovCitleHRlcm4gaW50IGRydl9jcmVhdGUoc3RydWN0IGRydl9vYmplY3QgKipkcnZfb2JqKTsKKworLyoKKyAqICA9PT09PT09PSBkcnZfZGVzdHJveSA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIGRlc3Ryb3lzIHRoZSBEZXYgT2JqZWN0IGxpc3QsIERydkV4dCBsaXN0CisgKiAgICAgIGFuZCBkZXN0cm95IHRoZSBEUlYgb2JqZWN0CisgKiAgICAgIENhbGxlZCB1cG9uIGRyaXZlciB1bkxvYWRpbmcub3IgdW5zdWNjZXNmdWwgbG9hZGluZyBvZiB0aGUgZHJpdmVyLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIGRyaXZlcl9vYmo6ICAgICBIYW5kbGUgdG8gRHJpdmVyIG9iamVjdCAuCisgKiAgUmV0dXJuczoKKyAqICAgICAgMDogICAgICAgIFN1Y2Nlc3MuCisgKiAgICAgIC1FUEVSTTogICAgICBGYWlsZWQgdG8gZGVzdHJveSBEUlYgT2JqZWN0CisgKiAgUmVxdWlyZXM6CisgKiAgICAgIERSViBJbml0aWFsaXplZCAoY1JlZ3MgPiAwICkKKyAqICAgICAgaGRydl9vYmogaXMgbm90IE5VTEwgYW5kIGEgdmFsaWQgRFJWIGhhbmRsZSAuCisgKiAgICAgIExpc3Qgb2YgRGV2T2JqZWN0IGlzIEVtcHR5LgorICogICAgICBMaXN0IG9mIERydkV4dCBpcyBFbXB0eQorICogIEVuc3VyZXM6CisgKiAgICAgIDA6ICAgICAgICAtIERSViBPYmplY3QgZGVzdHJveWVkIGFuZCBoZHJ2X29iaiBpcyBub3QgYSB2YWxpZAorICogICAgICAgICAgICAgICAgICAgICAgICBEUlYgaGFuZGxlLgorICogICAgICAgICAgICAgICAgICAgICAgLSBSZWdpc3RyeSBpcyB1cGRhdGVkIHdpdGggIjAiIGFzIHRoZSBEUlYgT2JqZWN0LgorICovCitleHRlcm4gaW50IGRydl9kZ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JuczoKKyAqICAgICAgZHdfZGV2X2V4dGVuc2lvbjogICAgIFB0ciB0byB0aGUgRmlyc3QgRGV2aWNlIEV4dGVuc2lvbiBhcyBhIHUzMgorICogICAgICAwOiAgICAgICAgICAgICAgICAgIEZhaWxlZCB0byBHZXQgdGhlIERldmljZSBFeHRlbnNpb24KKyAqICBFbnN1cmVzOgorICovCitleHRlcm4gdTMyIGRydl9nZXRfZmlyc3RfZGV2X2V4dGVuc2lvbih2b2lkKTsKKworLyoKKyAqICA9PT09PT09PSBkcnZfZ2V0X2Rldl9vYmplY3QgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBHaXZlbiBhIGluZGV4LCByZXR1cm5zIGEgaGFuZGxlIHRvIERldk9iamVjdCBmcm9tIHRoZSBsaXN0CisgKiAgUGFyYW1ldGVyczoKKyAqICAgICAgaGRydl9vYmo6ICAgICBIYW5kbGUgdG8gdGhlIE1hbmFnZXIKKyAqICAgICAgZGV2aWNlX29iajogICAgIExvY2F0aW9uIHRvIHN0b3JlIHRoZSBEZXYgSGFuZGxlCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIERSViBJbml0aWFsaXplZAorICogICAgICBpbmRleCA+PSAwCisgKiAgICAgIGhkcnZfb2JqIGlzIG5vdCBOVUxMIGFuZCBWYWxpZCBEUlYgT2JqZWN0CisgKiAgICAgIGRldmljZV9vYmogaXMgbm90IE5VTEwKKyAqICAgICAgRGV2aWNlIE9iamVjdCBMaXN0IG5vdCBFbXB0eQorICogIFJldHVybnM6CisgKiAgICAgIDA6ICAgICAgICBTdWNjZXNzCisgKiAgICAgIC1FUEVSTTogICAgICBGYWlsZWQgdG8gR2V0IHRoZSBEZXYgT2JqZWN0CisgKiAgRW5zdXJlczoKKyAqICAgICAgMDogICAgICAgICpkZXZpY2Vfb2JqICE9IE5VTEwKKyAqICAgICAgLUVQRVJNOiAgICAgICpkZXZpY2Vfb2JqID0gTlVMTAorICovCitleHRlcm4gaW50IGRydl9nZXRfZGV2X29iamVjdCh1MzIgaW5kZXgsCisJCQkJICAgICBzdHJ1Y3QgZHJ2X29iamVjdCAqaGRydl9vYmosCisJCQkJICAgICBzdHJ1Y3QgZGV2X29iamVjdCAqKmRldmljZV9vYmopOworCisvKgorICogID09PT09PT09IGRydl9nZXRfbmV4dF9kZXZfb2JqZWN0ID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgUmV0dXJucyB0aGUgUHRyIHRvIHRoZSBOZXh0IERldmljZSBPYmplY3QgZnJvbSB0aGUgdGhlIExpc3QKKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBoZGV2X29iajogICAgIEhhbmRsZSB0byB0aGUgRGV2aWNlIE9iamVjdAorICogIFJlcXVpcmVzOgorICogICAgICBEUlYgSW5pdGlhbGl6ZWQKKyAqICAgICAgaGRldl9vYmogIT0gMAorICogIFJldHVybnM6CisgKiAgICAgIGR3X2Rldl9vYmplY3Q6ICAgIFB0ciB0byB0aGUgTmV4dCBEZXYgT2JqZWN0IGFzIGEgdTMyCisgKiAgICAgIDA6ICAgICAgICAgICAgICBJZiBpdCBmYWlsIHRvIGdldCB0aGUgbmV4dCBEZXYgT2JqZWN0LgorICogIEVuc3VyZXM6CisgKi8KK2V4dGVybiB1MzIgZHJ2X2dldF9uZXh0X2Rldl9vYmplY3QodTMyIGhkZXZfb2JqKTsKKworLyoKKyAqICA9PT09PT09PSBkcnZfZ2V0X25leHRfZGV2X2V4dGVuc2lvbiA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIFJldHVybnMgdGhlIFB0ciB0byB0aGUgTmV4dCBEZXZpY2UgRXh0ZW5zaW9uIGZyb20gdGhlIHRoZSBMaXN0CisgKiAgUGFyYW1ldGVyczoKKyAqICAgICAgZGV2X2V4dGVuc2lvbjogICAgICBIYW5kbGUgdG8gdGhlIERldmljZSBFeHRlbnNpb24KKyAqICBSZXF1aXJlczoKKyAqICAgICAgRFJWIEluaXRpYWxpemVkCisgKiAgICAgIGRldl9leHRlbnNpb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ogIFBhcmFtZXRlcnM6CisgKiAgICAgIGhjaG5sX21ncjogICAgICAgQ2hhbm5lbCBtYW5hZ2VyIG9iamVjdC4KKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgU3VjY2Vzcy4KKyAqICAgICAgLUVGQVVMVDogICAgaGNobmxfbWdyIHdhcyBpbnZhbGlkLgorICogIFJlcXVpcmVzOgorICogIEVuc3VyZXM6CisgKiAgICAgIDA6IENhbmNlbHMgSS9PIG9uIGVhY2ggb3BlbiBjaGFubmVsLiBDbG9zZXMgZWFjaCBvcGVuIGNoYW5uZWwuCisgKiAgICAgICAgICBjaG5sX2NyZWF0ZSBtYXkgc3Vic2VxdWVudGx5IGJlIGNhbGxlZCBmb3IgdGhlIHNhbWUgZGV2aWNlLgorICovCit0eXBlZGVmIGludCgqZnhuX2NobmxfZGVzdHJveSkgKHN0cnVjdCBjaG5sX21nciAqaGNobmxfbWdyKTsKKy8qCisgKiAgPT09PT09PT0gYnJpZGdlX2RlaF9ub3RpZnkgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBXaGVuIG5vdGlmaWVkIG9mIERTUCBlcnJvciwgdGFrZSBhcHByb3ByaWF0ZSBhY3Rpb24uCisgKiAgUGFyYW1ldGVyczoKKyAqICAgICAgaGRlaF9tZ3I6ICAgICAgICBIYW5kbGUgdG8gREVIIG1hbmFnZXIgb2JqZWN0LgorICogICAgICBldm50X21hc2s6ICAgIEluZGljYXRlIHRoZSB0eXBlIG9mIGV4Y2VwdGlvbgorICogICAgICBlcnJvcl9pbmZvOiAgICBFcnJvciBpbmZvcm1hdGlvbgorICogIFJldHVybnM6CisgKgorICogIFJlcXVpcmVzOgorICogICAgICBoZGVoX21nciAhPSBOVUxMOworICogICAgIGV2bnRfbWFzayB3aXRoIGEgdmFsaWQgZXhjZXB0aW9uCisgKiAgRW5zdXJlczoKKyAqLwordHlwZWRlZiB2b2lkICgqZnhuX2RlaF9ub3RpZnkpIChzdHJ1Y3QgZGVoX21nciAqaGRlaF9tZ3IsCisJCQkJdTMyIGV2bnRfbWFzaywgdTMyIGVycm9yX2luZm8pOworCisvKgorICogID09PT09PT09IGJyaWRnZV9jaG5sX29wZW4gPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBPcGVuIGEgbmV3IGhhbGYtZHVwbGV4IGNoYW5uZWwgdG8gdGhlIERTUCBib2FyZC4KKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBjaG5sOiAgICAgICAgICAgTG9jYXRpb24gdG8gc3RvcmUgYSBjaGFubmVsIG9iamVjdCBoYW5kbGUuCisgKiAgICAgIGhjaG5sX21ncjoJSGFuZGxlIHRvIGNoYW5uZWwgbWFuYWdlciwgYXMgcmV0dXJuZWQgYnkKKyAqICAgICAgCQlDSE5MX0dldE1ncigpLgorICogICAgICBjaG5sX21vZGU6ICAgICAgICAgIE9uZSBvZiB7Q0hOTF9NT0RFVE9EU1AsIENITkxfTU9ERUZST01EU1B9IHNwZWNpZmllcworICogICAgICAgICAgICAgICAgICAgICAgZGlyZWN0aW9uIG9mIGRhdGEgdHJhbnNmZXIuCisgKiAgICAgIGNoX2lkOiAgICAgICAgSWYgQ0hOTF9QSUNLRlJFRSBpcyBzcGVjaWZpZWQsIHRoZSBjaGFubmVsIG1hbmFnZXIgd2lsbAorICogICAgICAgICAgICAgICAgICAgICAgc2VsZWN0IGEgZnJlZSBjaGFubmVsIGlkIChkZWZhdWx0KTsKKyAqICAgICAgICAgICAgICAgICAgICAgIG90aGVyd2lzZSB0aGlzIGZpZWxkIHNwZWNpZmllcyB0aGUgaWQgb2YgdGhlIGNoYW5uZWwuCisgKiAgICAgIHBhdHRyczogICAgICAgICBDaGFubmVsIGF0dHJpYnV0ZXMuICBBdHRyaWJ1dGUgZmllbGRzIGFyZSBhcyBmb2xsb3dzOgorICogICAgICBwYXR0cnMtPnVpb19yZXFzOiBTcGVjaWZpZXMgdGhlIG1heGltdW0gbnVtYmVyIG9mIEkvTyByZXF1ZXN0cyB3aGljaCBjYW4KKyAqICAgICAgICAgICAgICAgICAgICAgIGJlIHBlbmRpbmcgYXQgYW55IGdpdmVuIHRpbWUuIEFsbCByZXF1ZXN0IHBhY2tldHMgYXJlCisgKiAgICAgICAgICAgICAgICAgICAgICBwcmVhbGxvY2F0ZWQgd2hlbiB0aGUgY2hhbm5lbCBpcyBvcGVuZWQuCisgKiAgICAgIHBhdHRycy0+ZXZlbnRfb2JqOiBUaGlzIGZpZWxkIGFsbG93cyB0aGUgdXNlciB0byBzdXBwbHkgYW4gYXV0byByZXNldAorICogICAgICAgICAgICAgICAgICAgICAgZXZlbnQgb2JqZWN0IGZvciBjaGFubmVsIEkvTyBjb21wbGV0aW9uIG5vdGlmaWNhdGlvbnMuCisgKiAgICAgICAgICAgICAgICAgICAgICBJdCBpcyB0aGUgcmVzcG9uc2liaWxpdHkgb2YgdGhlIHVzZXIgdG8gZGVzdHJveSB0aGlzCisgKiAgICAgICAgICAgICAgICAgICAgICBvYmplY3QgQUZURVIgY2xvc2luZyB0aGUgY2hhbm5lbC4KKyAqICAgICAgICAgICAgICAgICAgICAgIFRoaXMgY2hhbm5lbCBldmVudCBvYmplY3QgY2FuIGJlIHJldHJpZXZlZCB1c2luZworICogICAgICAgICAgICAgICAgICAgICAgQ0hOTF9HZXRFdmVudEhhbmRsZSgpLgorICogICAgICBwYXR0cnMtPmhSZXNlcnZlZDogVGhlIGtlcm5lbCBtb2RlIGhhbmRsZSBvZiB0aGlzIGV2ZW50IG9iamVjdC4KKyAqCisgKiAgUmV0dXJuczoKKyAqICAgICAgMDogICAgICAgICAgICAgICAgU3VjY2Vzcy4KKyAqICAgICAgLUVGQVVMVDogICAgICAgICAgICBoY2hubF9tZ3IgaXMgaW52YWxpZC4KKyAqICAgICAgLUVOT01FTTogICAgICAgICAgICBJbnN1ZmZpY2llbnQgbWVtb3J5IGZvciByZXF1ZXN0ZWQgcmVzb3VyY2VzLgorICogICAgICAtRUlOVkFMOiAgICAgICAgSW52YWxpZCBudW1iZXIgb2YgSU9SZXFzLgorICogICAgICAtRU5PU1I6ICAgIE5vIGZyZWUgY2hhbm5lbHMgYXZhaWxhYmxlLgorICogICAgICAtRUNIUk5HOiAgICAgICBDaGFubmVsIElEIGlzIG91dCBvZiByYW5nZS4KKyAqICAgICAgLUVBTFJFQURZOiAgICAgICAgQ2hhbm5lbCBpcyBpbiB1c2UuCisgKiAgICAgIC1FSU86ICAgICAgICAgTm8gZnJlZSBJTyByZXF1ZXN0IHBhY2tldHMgYXZhaWxhYmxlIGZvcgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWV1aW5nLgorICogIFJlcXVpcmVzOgorICogICAgICBjaG5sICE9IE5VTEwuCisgKiAgICAgIHBhdHRycyAhPSBOVUxMLgorICogICAgICBwYXR0cnMtPmV2ZW50X29iaiBpcyBhIHZhbGlkIGV2ZW50IGhhbmRsZS4KKyAqICAgICAgcGF0dHJzLT5oUmVzZXJ2ZWQgaXMgdGhlIGtlcm5lbCBtb2RlIGhhbmRsZSBmb3IgcGF0dHJzLT5ldmVudF9vYmouCisgKiAgRW5zdXJlczoKKyAqICAgICAgMDogICAgICAgICAgICAgICAgKmNobmwgaXMgYSB2YWxpZCBjaGFubmVsLgorICogICAgICBlbHNlOiAgICAgICAgICAgICAgICAgICAqY2hubCBpcyBzZXQgdG8gTlVMTCBpZiAoY2hubCAhPSBOVUxMKTsKKyAqLwordHlwZWRlZiBpbnQoKmZ4bl9jaG5sX29wZW4pIChzdHJ1Y3QgY2hubF9vYmplY3QKKwkJCQkgICAgKipjaG5sLAorCQkJCSAgICBzdHJ1Y3QgY2hubF9tZ3IgKmhjaG5sX21nciwKKwkJCQkgICAgczggY2hubF9tb2RlLAorCQkJCSAgICB1MzIgY2hfaWQsCisJCQkJICAgIGNvbnN0IHN0cnVjdAorCQkJCSAgICBjaG5sX2F0dHIgKiBwYXR0cnMpOworCisvKgorICogID09PT09PT09IGJyaWRnZV9jaG5sX2Nsb3NlID09PT09PT09CisgKiAgUHVycG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y3QsCisgKiAgICAgICAgICAgICAgICAgICAgICBpZiAoY2hhbm5lbF9pbmZvICE9IE5VTEwpLgorICovCit0eXBlZGVmIGludCgqZnhuX2NobmxfZ2V0aW5mbykgKHN0cnVjdCBjaG5sX29iamVjdCAqY2hubF9vYmosCisJCQkJICAgICAgIHN0cnVjdCBjaG5sX2luZm8gKmNoYW5uZWxfaW5mbyk7CisKKy8qCisgKiAgPT09PT09PT0gYnJpZGdlX2NobmxfZ2V0X21ncl9pbmZvID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgUmV0cmlldmUgaW5mb3JtYXRpb24gcmVsYXRlZCB0byB0aGUgY2hhbm5lbCBtYW5hZ2VyLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIGhjaG5sX21ncjogICAgICAgICAgIEhhbmRsZSB0byBhIHZhbGlkIGNoYW5uZWwgbWFuYWdlciwgb3IgTlVMTC4KKyAqICAgICAgY2hfaWQ6ICAgICAgICAgICAgQ2hhbm5lbCBJRC4KKyAqICAgICAgbWdyX2luZm86ICAgICAgICAgICBMb2NhdGlvbiB0byBzdG9yZSBjaGFubmVsIG1hbmFnZXIgaW5mby4KKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgICAgIFN1Y2Nlc3M7CisgKiAgICAgIC1FRkFVTFQ6IEludmFsaWQgaGNobmxfbWdyIG9yIG1ncl9pbmZvLgorICogICAgICAtRUNIUk5HOiAgIEludmFsaWQgY2hhbm5lbCBJRC4KKyAqICBSZXF1aXJlczoKKyAqICBFbnN1cmVzOgorICogICAgICAwOiAgICAgICAgICAgIG1ncl9pbmZvIHBvaW50cyB0byBhIGZpbGxlZCBpbiBjaG5sX21ncmluZm8KKyAqICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QsIGlmIChtZ3JfaW5mbyAhPSBOVUxMKS4KKyAqLwordHlwZWRlZiBpbnQoKmZ4bl9jaG5sX2dldG1ncmluZm8pIChzdHJ1Y3QgY2hubF9tZ3IKKwk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JTyBjb21wbGV0aW9uCisgKiAgICAgICAgICAgICAgICAgICAgICAoRFNQX1NUUkVBTUlPQ09NUExFVElPTikgb3IgZW5kIG9mIHN0cmVhbQorICogICAgICAgICAgICAgICAgICAgICAgKERTUF9TVFJFQU1ET05FKS4KKyAqICAgICAgbm90aWZ5X3R5cGU6ICAgIERTUF9TSUdOQUxFVkVOVC4KKyAqICAgICAgaG5vdGlmaWNhdGlvbjogIEhhbmRsZSBvZiBhIGRzcF9ub3RpZmljYXRpb24gb2JqZWN0LgorICogIFJldHVybnM6CisgKiAgICAgIDA6ICAgICAgICBTdWNjZXNzLgorICogICAgICAtRU5PTUVNOiAgICBJbnN1ZmZpY2llbnQgbWVtb3J5LgorICogICAgICAtRUlOVkFMOiAgICAgZXZlbnRfbWFzayBpcyAwIGFuZCBobm90aWZpY2F0aW9uIHdhcyBub3QKKyAqICAgICAgICAgICAgICAgICAgICAgIHByZXZpb3VzbHkgcmVnaXN0ZXJlZC4KKyAqICAgICAgLUVGQVVMVDogICAgTlVMTCBobm90aWZpY2F0aW9uLCBobm90aWZpY2F0aW9uIGV2ZW50IG5hbWUKKyAqICAgICAgICAgICAgICAgICAgICAgIHRvbyBsb25nLCBvciBobm90aWZpY2F0aW9uIGV2ZW50IG5hbWUgTlVMTC4KKyAqICBSZXF1aXJlczoKKyAqICAgICAgVmFsaWQgY2hubF9vYmouCisgKiAgICAgIGhub3RpZmljYXRpb24gIT0gTlVMTC4KKyAqICAgICAgKGV2ZW50X21hc2sgJiB+KERTUF9TVFJFQU1JT0NPTVBMRVRJT04gfCBEU1BfU1RSRUFNRE9ORSkpID09IDAuCisgKiAgICAgIG5vdGlmeV90eXBlID09IERTUF9TSUdOQUxFVkVOVC4KKyAqICBFbnN1cmVzOgorICovCit0eXBlZGVmIGludCgqZnhuX2NobmxfcmVnaXN0ZXJub3RpZnkpCisgKHN0cnVjdCBjaG5sX29iamVjdCAqY2hubF9vYmosCisgIHUzMiBldmVudF9tYXNrLCB1MzIgbm90aWZ5X3R5cGUsIHN0cnVjdCBkc3Bfbm90aWZpY2F0aW9uICpobm90aWZpY2F0aW9uKTsKKworLyoKKyAqICA9PT09PT09PSBicmlkZ2VfZGV2X2NyZWF0ZSA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIENvbXBsZXRlIGNyZWF0aW9uIG9mIHRoZSBkZXZpY2Ugb2JqZWN0IGZvciB0aGlzIGJvYXJkLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIGRldmljZV9jdHg6ICAgICBQdHIgdG8gbG9jYXRpb24gdG8gc3RvcmUgYSBCcmlkZ2UgZGV2aWNlIGNvbnRleHQuCisgKiAgICAgIGhkZXZfb2JqOiAgICAgSGFuZGxlIHRvIGEgRGV2aWNlIE9iamVjdCwgY3JlYXRlZCBhbmQgbWFuYWdlZCBieSBEU1AgQVBJLgorICogICAgICBjb25maWdfcGFyYW06ICAgICAgICBQdHIgdG8gY29uZmlndXJhdGlvbiBwYXJhbWV0ZXJzIHByb3ZpZGVkIGJ5IHRoZQorICogICAgICAgICAgICAgICAgICAgICAgQ29uZmlndXJhdGlvbiBNYW5hZ2VyIGR1cmluZyBkZXZpY2UgbG9hZGluZy4KKyAqICAgICAgcERzcENvbmZpZzogICAgIERTUCByZXNvdXJjZXMsIGFzIHNwZWNpZmllZCBpbiB0aGUgcmVnaXN0cnkga2V5IGZvciB0aGlzCisgKiAgICAgICAgICAgICAgICAgICAgICBkZXZpY2UuCisgKiAgUmV0dXJuczoKKyAqICAgICAgMDogICAgICAgICAgICBTdWNjZXNzLgorICogICAgICAtRU5PTUVNOiAgICAgICAgVW5hYmxlIHRvIGFsbG9jYXRlIG1lbW9yeSBmb3IgZGV2aWNlIGNvbnRleHQuCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIGRldmljZV9jdHggIT0gTlVMTDsKKyAqICAgICAgaGRldl9vYmogIT0gTlVMTDsKKyAqICAgICAgY29uZmlnX3BhcmFtICE9IE5VTEw7CisgKiAgICAgIHBEc3BDb25maWcgIT0gTlVMTDsKKyAqICAgICAgRmllbGRzIGluIGNvbmZpZ19wYXJhbSBhbmQgcERzcENvbmZpZyBjb250YWluIHZhbGlkIHZhbHVlcy4KKyAqICBFbnN1cmVzOgorICogICAgICAwOiAgICAgICAgQWxsIEJyaWRnZSBkcml2ZXIgc3BlY2lmaWMgRFNQIHJlc291cmNlIGFuZCBvdGhlcgorICogICAgICAgICAgICAgICAgICAgICAgYm9hcmQgY29udGV4dCBoYXMgYmVlbiBhbGxvY2F0ZWQuCisgKiAgICAgIC1FTk9NRU06ICAgIEJyaWRnZSBmYWlsZWQgdG8gYWxsb2NhdGUgcmVzb3VyY2VzLgorICogICAgICAgICAgICAgICAgICAgICAgQW55IGFjcXVpcmVkIHJlc291cmNlcyBoYXZlIGJlZW4gZnJlZWQuICBUaGUgRFNQIEFQSQorICogICAgICAgICAgICAgICAgICAgICAgd2lsbCBub3QgY2FsbCBicmlkZ2VfZGV2X2Rlc3Ryb3koKSBpZgorICogICAgICAgICAgICAgICAgICAgICAgYnJpZGdlX2Rldl9jcmVhdGUoKSBmYWlscy4KKyAqICBEZXRhaWxzOgorICogICAgICBDYWxsZWQgZHVyaW5nIHRoZSBDT05GSUdNRydzIERldmljZV9Jbml0IHBoYXNlLiBCYXNlZCBvbiBob3N0IGFuZAorICogICAgICBEU1AgY29uZmlndXJhdGlvbiBpbmZvcm1hdGlvbiwgY3JlYXRlIGEgYm9hcmQgY29udGV4dCwgYSBoYW5kbGUgdG8KKyAqICAgICAgd2hpY2ggaXMgcGFzc2VkIGludG8gb3RoZXIgQnJpZGdlIEJSRCBhbmQgQ0hOTCBmdW5jdGlvbnMuICBUaGUKKyAqICAgICAgYm9hcmQgY29udGV4dCBjb250YWlucyBzdGF0ZSBpbmZvcm1hdGlvbiBmb3IgdGhlIGRldmljZS4gU2luY2UgdGhlCisgKiAgICAgIGFkZHJlc3NlcyBvZiBhbGwgcG9pbnRlciBwYXJhbWV0ZXJzIG1heSBiZSBpbnZh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uX2Rldl9kZXN0cm95KSAoc3RydWN0IGJyaWRnZV9kZXZfY29udGV4dCAqZGV2X2N0eHQpOworCisvKgorICogID09PT09PT09IGJyaWRnZV9pb19jcmVhdGUgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBDcmVhdGUgYW4gb2JqZWN0IHRoYXQgbWFuYWdlcyBJL08gYmV0d2VlbiBDSE5MIGFuZCBtc2dfY3RybC4KKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBpb19tYW46ICAgICAgICAgTG9jYXRpb24gdG8gc3RvcmUgSU8gbWFuYWdlciBvbiBvdXRwdXQuCisgKiAgICAgIGhjaG5sX21ncjogICAgICAgSGFuZGxlIHRvIGNoYW5uZWwgbWFuYWdlci4KKyAqICAgICAgaG1zZ19tZ3I6ICAgICAgICBIYW5kbGUgdG8gbWVzc2FnZSBtYW5hZ2VyLgorICogIFJldHVybnM6CisgKiAgICAgIDA6ICAgICAgICBTdWNjZXNzLgorICogICAgICAtRU5PTUVNOiAgICBNZW1vcnkgYWxsb2NhdGlvbiBmYWlsdXJlLgorICogICAgICAtRVBFUk06ICAgICAgQ3JlYXRpb24gZmFpbGVkLgorICogIFJlcXVpcmVzOgorICogICAgICBoZGV2X29iaiAhPSBOVUxMOworICogICAgICBDaGFubmVsIG1hbmFnZXIgYWxyZWFkeSBjcmVhdGVkOworICogICAgICBNZXNzYWdlIG1hbmFnZXIgYWxyZWFkeSBjcmVhdGVkOworICogICAgICBtZ3JfYXR0cnRzICE9IE5VTEw7CisgKiAgICAgIGlvX21hbiAhPSBOVUxMOworICogIEVuc3VyZXM6CisgKi8KK3R5cGVkZWYgaW50KCpmeG5faW9fY3JlYXRlKSAoc3RydWN0IGlvX21nciAqKmlvX21hbiwKKwkJCQkgICAgc3RydWN0IGRldl9vYmplY3QgKmhkZXZfb2JqLAorCQkJCSAgICBjb25zdCBzdHJ1Y3QgaW9fYXR0cnMgKm1ncl9hdHRydHMpOworCisvKgorICogID09PT09PT09IGJyaWRn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gICAgICAgICAgICAgICAgc21hbGwpLgorICogIFJlcXVpcmVzOgorICogICAgICBWYWxpZCBtc2dfcXVldWVfb2JqLgorICogICAgICBwbXNnICE9IE5VTEwuCisgKiAgRW5zdXJlczoKKyAqLwordHlwZWRlZiBpbnQoKmZ4bl9tc2dfcHV0KSAoc3RydWN0IG1zZ19xdWV1ZSAqbXNnX3F1ZXVlX29iaiwKKwkJCQkgIGNvbnN0IHN0cnVjdCBkc3BfbXNnICpwbXNnLCB1MzIgdXRpbWVvdXQpOworCisvKgorICogID09PT09PT09IGJyaWRnZV9tc2dfcmVnaXN0ZXJfbm90aWZ5ID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgUmVnaXN0ZXIgbm90aWZpY2F0aW9uIGZvciB3aGVuIGEgbWVzc2FnZSBpcyByZWFkeS4KKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBtc2dfcXVldWVfb2JqOiAgICAgIEhhbmRsZSB0byBtc2dfY3RybCBxdWV1ZSByZXR1cm5lZCBmcm9tCisgKiAgICAgICAgICAgICAgICAgICAgICBicmlkZ2VfbXNnX2NyZWF0ZV9xdWV1ZS4KKyAqICAgICAgZXZlbnRfbWFzazogICAgIFR5cGUgb2YgZXZlbnRzIHRvIGJlIG5vdGlmaWVkIGFib3V0OiBNdXN0IGJlCisgKiAgICAgICAgICAgICAgICAgICAgICBEU1BfTk9ERU1FU1NBR0VSRUFEWSwgb3IgMCB0byB1bnJlZ2lzdGVyLgorICogICAgICBub3RpZnlfdHlwZTogICAgRFNQX1NJR05BTEVWRU5ULgorICogICAgICBobm90aWZpY2F0aW9uOiAgSGFuZGxlIG9mIG5vdGlmaWNhdGlvbiBvYmplY3QuCisgKiAgUmV0dXJuczoKKyAqICAgICAgMDogICAgICAgIFN1Y2Nlc3MuCisgKiAgICAgIC1FTk9NRU06ICAgIEluc3VmZmljaWVudCBtZW1vcnkuCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIFZhbGlkIG1zZ19xdWV1ZV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Y3JlYXRlcyBhbmQgcmV0dXJucyB0aGlzIGlkZW50aWZpZXIuCisgKiAgUmV0dXJuczoKKyAqICAgICAgVFJVRSBpbmRpY2F0ZXMgdGhlIGRldmljZSBzdWNjZXNzZnVsbHkgZGUtaW5pdGlhbGl6ZWQuIE90aGVyd2lzZSBpdAorICogICAgICByZXR1cm5zIEZBTFNFLgorICogIFJlcXVpcmVzOgorICogICAgICBkZXZpY2VfY29udGV4dCE9IE5VTEwuIEZvciBhIGJ1aWx0IGluIGRldmljZSB0aGlzIHNob3VsZCBuZXZlcgorICogICAgICBnZXQgY2FsbGVkLgorICogIEVuc3VyZXM6CisgKi8KK2V4dGVybiBib29sIGRzcF9kZWluaXQodTMyIGRldmljZV9jb250ZXh0KTsKKworLyoKKyAqICA9PT09PT09PSBkc3BfaW5pdCA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIFRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkIGJ5IERldmljZSBNYW5hZ2VyIHRvIGluaXRpYWxpemUgYSBkZXZpY2UuCisgKiAgICAgIFRoaXMgZnVuY3Rpb24gaXMgbm90IGNhbGxlZCBieSBhcHBsaWNhdGlvbnMKKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBkd19jb250ZXh0OiAgU3BlY2lmaWVzIGEgcG9pbnRlciB0byBhIHN0cmluZyBjb250YWluaW5nIHRoZSByZWdpc3RyeQorICogICAgICAgICAgICAgICAgICBwYXRoIHRvIHRoZSBhY3RpdmUga2V5IGZvciB0aGUgc3RyZWFtIGludGVyZmFjZSBkcml2ZXIuCisgKiAgICAgICAgICAgICAgICAgIEhLRVlfTE9DQUxfTUFDSElORVxEcml2ZXJzXEFjdGl2ZQorICogIFJldHVybnM6CisgKiAgICAgIFJldHVybnMgYSBoYW5kbGUgdG8gdGhlIGRldmljZSBjb250ZXh0IGNyZWF0ZWQuIFRoaXMgaXMgdGhlIG91ciBhY3R1YWwKKyAqICAgICAgRGV2aWNlIE9iamVjdCByZXByZX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MgYXJlIHJlcG9ydGVkIHVzaW5nIHN5bXMtPmVycm9yX3JlcG9ydCgpLgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KK2V4dGVybiBpbnQgZHluYW1pY191bmxvYWRfbW9kdWxlKHZvaWQgKm1oYW5kbGUsCS8qIHRoZSBtb2R1bGUKKwkJCQkJCQkgKiBoYW5kbGUgKi8KKwkJCQkgLyogaG9zdCBzdXBwb3J0IGZvciBzeW1ib2xzIGFuZAorCQkJCSAgKiBzdG9yYWdlICovCisJCQkJIHN0cnVjdCBkeW5hbWljX2xvYWRlcl9zeW0gKnN5bXMsCisJCQkJIC8qIHRoZSB0YXJnZXQgbWVtb3J5IGFsbG9jYXRvciAqLworCQkJCSBzdHJ1Y3QgZHluYW1pY19sb2FkZXJfYWxsb2NhdGUgKmFsbG9jLAorCQkJCSAvKiB0aGUgdGFyZ2V0IG1lbW9yeSBpbml0aWFsaXplciAqLworCQkJCSBzdHJ1Y3QgZHluYW1pY19sb2FkZXJfaW5pdGlhbGl6ZSAqaW5pdCk7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBBIGNsYXNzIHVzZWQgYnkgdGhlIGR5bmFtaWMgbG9hZGVyIGZvciBpbnB1dCBvZiB0aGUgbW9kdWxlIGltYWdlCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCitzdHJ1Y3QgZHluYW1pY19sb2FkZXJfc3RyZWFtIHsKKy8qIHB1YmxpYzogKi8KKyAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAqIHJlYWRfYnVmZmVyCisgICAgICoKKyAgICAgKiBQQVJBTUVURVJTIDoKKyAgICAgKiAgYnVmZmVyICBQb2ludGVyIHRvIHRoZSBidWZmZXIgdG8gZmlsbAorICAgICAqICBidWZzaXogIEFtb3VudCBvZiBkYXRhIGRlc2lyZWQgaW4gc2l6ZW9mKCkgdW5pdHMKKyAgICAgKgorICAgICAqIEVGRkVDVCA6CisgICAgICogIFJlYWRzIHRoZSBzcGVjaWZpZWQgYW1vdW50IG9mIGRhdGEgZnJvbSB0aGUgbW9kdWxlIGlucHV0IHN0cmVhbQorICAgICAqIGludG8gdGhlIHNwZWNpZmllZCBidWZmZXIuICBSZXR1cm5zIHRoZSBhbW91bnQgb2YgZGF0YSByZWFkIGluIHNpemVvZigpCisgICAgICogdW5pdHMgKHdoaWNoIGlmIGxlc3MgdGhhbiB0aGUgc3BlY2lmaWNhdGlvbiwgcmVwcmVzZW50cyBhbiBlcnJvcikuCisgICAgICoKKyAgICAgKiBOT1RFUzoKKyAgICAgKiAgSW4gcmVsZWFzZSAxIGluY3JlbWVudHMgdGhlIGZpbGUgcG9zaXRpb24gYnkgdGhlIG51bWJlciBvZiBieXRlcyByZWFkCisgICAgICoKKyAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisJaW50ICgqcmVhZF9idWZmZXIpIChzdHJ1Y3QgZHluYW1pY19sb2FkZXJfc3RyZWFtICp0aGlzcHRyLAorCQkJICAgIHZvaWQgKmJ1ZmZlciwgdW5zaWduZWQgYnVmc2l6KTsKKworICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICogc2V0X2ZpbGVfcG9zbiAocmVsZWFzZSAxIG9ubHkpCisgICAgICoKKyAgICAgKiBQQVJBTUVURVJTIDoKKyAgICAgKiAgcG9zbiAgRGVzaXJlZCBmaWxlIHBvc2l0aW9uIHJlbGF0aXZlIHRvIHN0YXJ0IG9mIGZpbGUgaW4gc2l6ZW9mKCkgdW5pdHMuCisgICAgICoKKyAgICAgKiBFRkZFQ1QgOgorICAgICAqICBBZGp1c3RzIHRoZSBpbnRlcm5hbCBzdGF0ZSBvZiB0aGUgc3RyZWFtIG9iamVjdCBzbyB0aGF0IHRoZSBuZXh0CisgICAgICogcmVhZF9idWZmZXIgY2FsbCB3aWxsIGJlZ2luIHRvIHJlYWQgYXQgdGhlIHNwZWNpZmllZCBvZmZzZXQgZnJvbQorICAgICAqIHRoZSBiZWdpbm5pbmcgb2YgdGhlIGlucHV0IG1vZHVsZS4gIFJldHVybnMgMCBmb3Igc3VjY2Vzcywgbm9uLXplcm8KKyAgICAgKiBmb3IgZmFpbHVyZS4KKyAgICAgKgorICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwlpbnQgKCpzZXRfZmlsZV9wb3NuKSAoc3RydWN0IGR5bmFtaWNfbG9hZGVyX3N0cmVhbSAqdGhpc3B0ciwKKwkJCSAgICAgIC8qIHRvIGJlIGVsaW1pbmF0ZWQgaW4gcmVsZWFzZSAyICovCisJCQkgICAgICB1bnNpZ25lZCBpbnQgcG9zbik7CisKK307CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBBIGNsYXNzIHVzZWQgYnkgdGhlIGR5bmFtaWMgbG9hZGVyIGZvciBzeW1ib2wgdGFibGUgc3VwcG9ydCBhbmQKKyAqIG1pc2NlbGxhbmVvdXMgaG9zdC1zaWRlIGZ1bmN0aW9ucworICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCit0eXBlZGVmIHUzMiBsZHJfYWRkcjsKKworLyoKKyAqIHRoZSBzdHJ1Y3R1cmUgb2YgYSBzeW1ib2wga25vd24gdG8gdGhlIGR5bmFtaWMgbG9hZGVyCisgKi8KK3N0cnVjdCBkeW5sb2FkX3N5bWJvbCB7CisJbGRyX2FkZHIgdmFsdWU7Cit9OworCitzdHJ1Y3QgZHluYW1pY19sb2FkZXJfc3ltIHsKKy8qIHB1YmxpYzogKi8KKyAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAqIGZpbmRfbWF0Y2hpbmdfc3ltYm9sCisgICAgICoKKyAgICAgKiBQQVJBTUVURVJTIDoKKyAgICAgKiAgbmFtZSAgICBUaGUgbmFtZSBvZiB0aGUgZGVzaXJlZCBzeW1ib2wKKyAgICAgKgorICAgICAqIEVGRkVDVCA6CisgICAgICogIExvY2F0ZXMgYSBzeW1ib2wgbWF0Y2hpbmcgdGhlIG5hbWUgc3BlY2lmaWVkLiAgQSBwb2ludGVyIHRvIHRoZQorICAgICAqIHN5bWJvbCBpcyByZXR1cm5lZCBpZiBpdCBleGlzdHM7IDAgaXMgcmV0dXJuZWQgaWYgbm8gc3VjaCBzeW1ib2wgaXMKKyAgICAgKiBmb3VuZC4KKyAgICAgKgorICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwlzdHJ1Y3QgZHlubG9hZF9zeW1ib2wgKigqZmluZF9tYXRjaGluZ19zeW1ib2wpCisJIChzdHJ1Y3QgZHluYW1pY19sb2FkZXJfc3ltICp0aGlzcHRyLCBjb25zdCBjaGFyICpuYW1lKTsKKworICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICogYWRkX3RvX3N5bWJvbF90YWJsZQorICAgICAqCisgICAgICogUEFSQU1FVEVSUyA6CisgICAgICogIG5uYW1lICAgICAgIFBvaW50ZXIgdG8gdGhlIG5hbWUgb2YgdGhlIG5ldyBzeW1ib2wKKyAgICAgKiAgbW9kdWxlaWQgICAgQW4gb3BhcXVlIG1vZHVsZSBpZCBhc3NpZ25lZCBieSB0aGUgZHluYW1pYyBsb2FkZXIKKyAgICAgKgorICAgICAqIEVGRkVDVCA6CisgICAgICogIFRoZSBuZXcgc3ltYm9sIGlzIGFkZGVkIHRvIHRoZSB0YWJsZS4gIEEgcG9pbnRlciB0byB0aGUgc3ltYm9sIGlzCisgICAgICogcmV0dXJuZWQsIG9yIE5VTEwgaXMgcmV0dXJuZWQgZm9yIGZhaWx1cmUuCisgICAgICoKKyAgICAgKiBOT1RFUzoKKyAgICAgKiAgSXQgaXMgcGVybWlzc2libGUgZm9yIHRoaXMgZnVuY3Rpb24gdG8gcmV0dXJuIE5VTEw7IHRoZSBlZmZlY3QgaXMgdGhhdAorICAgICAqIHRoZSBuYW1lZCBzeW1ib2wgd2lsbCBub3QgYmUgYXZhaWxhYmxlIHRvIHJlc29sdmUgcmVmZXJlbmNlcyBpbgorICAgICAqIHN1YnNlcXVlbnQgbG9hZHMuICBSZXR1cm5pbmcgTlVMTCB3aWxsIG5vdCBjYXVzZSB0aGUgY3VycmVudCBsb2FkCisgICAgICogdG8gZmFpbC4KKyAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisJc3RydWN0IGR5bmxvYWRfc3ltYm9sICooKmFkZF90b19zeW1ib2xfdGFibGUpCisJIChzdHJ1Y3QgZHluYW1pY19sb2FkZXJfc3ltICoKKwkgIHRoaXNwdHIsIGNvbnN0IGNoYXIgKm5uYW1lLCB1bnNpZ25lZCBtb2R1bGVpZCk7CisKKyAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAqIHB1cmdlX3N5bWJvbF90YWJsZQorICAgICAqCisgICAgICogUEFSQU1FVEVSUyA6CisgICAgICogIG1vZHVsZWlkICAgIEFuIG9wYXF1ZSBtb2R1bGUgaWQgYXNzaWduZWQgYnkgdGhlIGR5bmFtaWMgbG9hZGVyCisgICAgICoKKyAgICAgKiBFRkZFQ1QgOgorICAgICAqICBFYWNoIHN5bWJvbCBpbiB0aGUgc3ltYm9sIHRhYmxlIHdob3NlIG1vZHVsZWlkIG1hdGNoZXMgdGhlIGFyZ3VtZW50CisgICAgICogaXMgcmVtb3ZlZCBmcm9tIHRoZSB0YWJsZS4KKyAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisJdm9pZCAoKnB1cmdlX3N5bWJvbF90YWJsZSkgKHN0cnVjdCBkeW5hbWljX2xvYWRlcl9zeW0gKnRoaXNwdHIsCisJCQkJICAgIHVuc2lnbmVkIG1vZHVsZWlkKTsKKworICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICogZGxvYWRfYWxsb2NhdGUKKyAgICAgKgorICAgICAqIFBBUkFNRVRFUlMgOgorICAgICAqICBtZW1zaXogIHNpemUgb2YgZGVzaXJlZCBtZW1vcnkgaW4gc2l6ZW9mKCkgdW5pdHMKKyAgICAgKgorICAgICAqIEVGRkVDVCA6CisgICAgICogIFJldHVybnMgYSBwb2ludGVyIHRvIHNvbWUgImhvc3QiIG1lbW9yeSBmb3IgdXNlIGJ5IHRoZSBkeW5hbWljCisgICAgICogbG9hZGVyLCBvciBOVUxMIGZvciBmYWlsdXJlLgorICAgICAqIFRoaXMgZnVuY3Rpb24gaXMgc2VydmVzIGFzIGEgcmVwbGFjZWFibGUgZm9ybSBvZiAibWFsbG9jIiB0bworICAgICAqIGFsbG93IHRoZSB1c2VyIHRvIGNvbmZpZ3VyZSB0aGUgbWVtb3J5IHVzYWdlIG9mIHRoZSBkeW5hbWljIGxvYWRlci4KKyAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisJdm9pZCAqKCpkbG9hZF9hbGxvY2F0ZSkgKHN0cnVjdCBkeW5hbWljX2xvYWRlcl9zeW0gKnRoaXNwdHIsCisJCQkJIHVuc2lnbmVkIG1lbXNpeik7CisKKyAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAqIGRsb2FkX2RlYWxsb2NhdGUKKyAgICAgKgorICAgICAqIFBBUkFNRVRFUlMgOgorICAgICAqICBtZW1wdHIgIHBvaW50ZXIgdG8gcHJldmlvdXNseSBhbGxvY2F0ZWQgbWVtb3J5CisgICAgICoKKyAgICAgKiBFRkZFQ1QgOgorICAgICAqICBSZWxlYXNlcyB0aGUgcHJldmlvdXNseSBhbGxvY2F0ZWQgImhvc3QiIG1lbW9yeS4KKyAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisJdm9pZCAoKmRsb2FkX2RlYWxsb2NhdGUpIChzdHJ1Y3QgZHluYW1pY19sb2FkZXJfc3ltICp0aGlzcHRyLAorCQkJCSAgdm9pZCAqbWVtcHRyKTsKKworICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICogZXJyb3JfcmVwb3J0CisgICAgICoKKyAgICAgKiBQQVJBTUVURVJTIDoKKyAgICAgKiAgZXJyc3RyICBwb2ludGVyIHRvIGFuIGVycm9yIHN0cmluZworICAgICAqICBhcmdzICAgIGFkZGl0aW9uYWwgYXJndW1lbnRzCisgICAgICoKKyAgICAgKiBFRkZFQ1QgOgorICAgICAqICBUaGlzIGZ1bmN0aW9uIHByb3ZpZGVzIGFuIGVycm9yIHJlcG9ydGluZyBpbnRlcmZhY2UgZm9yIHRoZSBkeW5hbWljCisgICAgICogbG9hZGVyLiAgVGhlIGVycm9yIHN0cmluZyBhbmQgYXJndW1lbnRzIGFyZSBkZXNpZ25lZCBhcyBmb3IgdGhlCisgICAgICogbGlicmFyeSBmdW5jdGlvbiB2cHJpbnRmLgorICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwl2b2lkICgqZXJyb3JfcmVwb3J0KSAoc3RydWN0IGR5bmFtaWNfbG9hZGVyX3N5bSAqdGhpc3B0ciwKKwkJCSAgICAgIGNvbnN0IGNoYXIgKmVycnN0ciwgdmFfbGlzdCBhcmdzKTsKKworfTsJCQkJLyogY2xhc3MgZHluYW1pY19sb2FkZXJfc3ltICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBBIGNsYXNzIHVzZWQgYnkgdGhlIGR5bmFtaWMgbG9hZGVyIHRvIGF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1Y2Nlc3MsIEZBTFNFIGZvciBmYWlsdXJlLgorICAgICoKKyAgICAqIE5vdGVzOgorICAgICogICBGcmVxdWVudGx5IGxvYWRfYWRkciBhbmQgcnVuX2FkZHIgYXJlIHRoZSBzYW1lLCBidXQgaWYgdGhleSBhcmUgbm90CisgICAgKiBsb2FkX2FkZHIgaXMgdXNlZCB3aXRoIGR5bmFtaWNfbG9hZGVyX2luaXRpYWxpemUsIGFuZCBydW5fYWRkciBpcworICAgICogdXNlZCBmb3IgYWxtb3N0IGFsbCByZWxvY2F0aW9ucy4gIFRoaXMgZnVuY3Rpb24gc2hvdWxkIGFsd2F5cyBpbml0aWFsaXplCisgICAgKiBib3RoIGZpZWxkcy4KKyAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwlpbnQgKCpkbG9hZF9hbGxvY2F0ZSkgKHN0cnVjdCBkeW5hbWljX2xvYWRlcl9hbGxvY2F0ZSAqdGhpc3B0ciwKKwkJCSAgICAgICBzdHJ1Y3QgbGRyX3NlY3Rpb25faW5mbyAqaW5mbywgdW5zaWduZWQgYWxpZ24pOworCisgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAqIEZ1bmN0aW9uIGRlYWxsb2NhdGUKKyAgICAqCisgICAgKiBQYXJhbWV0ZXJzOgorICAgICogICBpbmZvICAgICAgICBBIHBvaW50ZXIgdG8gYW4gaW5mb3JtYXRpb24gYmxvY2sgZm9yIHRoZSBzZWN0aW9uCisgICAgKgorICAgICogRWZmZWN0OgorICAgICogICBSZWxlYXNlcyB0aGUgdGFyZ2V0IG1lbW9yeSBwcmV2aW91c2x5IGFsbG9jYXRlZC4KKyAgICAqCisgICAgKiBOb3RlczoKKyAgICAqIFRoZSBjb250ZW50IG9mIHRoZSBpbmZvLT5uYW1lIGZpZWxkIGlzIHVuZGVmaW5lZCBvbiBjYWxsIHRvIHRoaXMgZnVuY3Rpb24uCisgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisJdm9pZCAoKmRsb2FkX2RlYWxsb2NhdGUpIChzdHJ1Y3QgZHluYW1pY19sb2FkZXJfYWxsb2NhdGUgKnRoaXNwdHIsCisJCQkJICBzdHJ1Y3QgbGRyX3NlY3Rpb25faW5mbyAqaW5mbyk7CisKK307CQkJCS8qIGNsYXNzIGR5bmFtaWNfbG9hZGVyX2FsbG9jYXRlICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBBIGNsYXNzIHVzZWQgYnkgdGhlIGR5bmFtaWMgbG9hZGVyIHRvIGxvYWQgZGF0YSBpbnRvIGEgdGFyZ2V0LiAgVGhpcyBjbGFzcworICogcHJvdmlkZXMgdGhlIGludGVyZmFjZS1zcGVjaWZpYyBmdW5jdGlvbnMgbmVlZGVkIHRvIGxvYWQgZGF0YS4KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworc3RydWN0IGR5bmFtaWNfbG9hZGVyX2luaXRpYWxpemUgeworLyogcHVibGljOiAqLworICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgKiBGdW5jdGlvbiBjb25uZWN0CisgICAgKgorICAgICogUGFyYW1ldGVyczoKKyAgICAqICAgbm9uZQorICAgICoKKyAgICAqIEVmZmVjdDoKKyAgICAqICAgQ29ubmVjdCB0byB0aGUgaW5pdGlhbGl6YXRpb24gaW50ZXJmYWNlLiBSZXR1cm5zIFRSVUUgZm9yIHN1Y2Nlc3MsCisgICAgKiBGQUxTRSBmb3IgZmFpbHVyZS4KKyAgICAqCisgICAgKiBOb3RlczoKKyAgICAqICAgVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgcHJpb3IgdG8gdXNlIG9mIGFueSBvdGhlciBmdW5jdGlvbnMgaW4KKyAgICAqIHRoaXMgaW50ZXJmYWNlLgorICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCWludCAoKmNvbm5lY3QpIChzdHJ1Y3QgZHluYW1pY19sb2FkZXJfaW5pdGlhbGl6ZSAqdGhpc3B0cik7CisKKyAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICogRnVuY3Rpb24gcmVhZG1lbQorICAgICoKKyAgICAqIFBhcmFtZXRlcnM6CisgICAgKiAgIGJ1ZnIgICAgICAgIFBvaW50ZXIgdG8gYSB3b3JkLWFsaWduZWQgYnVmZmVyIGZvciB0aGUgcmVzdWx0CisgICAgKiAgIGxvY24gICAgICAgIFRhcmdldCBhZGRyZXNzIG9mIGZpcnN0IGRhdGEgZWxlbWVudAorICAgICogICBpbmZvICAgICAgICBTZWN0aW9uIGluZm8gZm9yIHRoZSBzZWN0aW9uIGluIHdoaWNoIHRoZSBhZGRyZXNzIHJlc2lkZXMKKyAgICAqICAgYnl0c2l6ICAgICAgU2l6ZSBvZiB0aGUgZGF0YSB0byBiZSByZWFkIGluIHNpemVvZigpIHVuaXRzCisgICAgKgorICAgICogRWZmZWN0OgorICAgICogICBGaWxscyB0aGUgc3BlY2l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KiBGQUxTRSBmb3IgZmFpbHVyZS4KKyAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwlpbnQgKCp3cml0ZW1lbSkgKHN0cnVjdCBkeW5hbWljX2xvYWRlcl9pbml0aWFsaXplICp0aGlzcHRyLAorCQkJIHZvaWQgKmJ1ZnIsCisJCQkgbGRyX2FkZHIgbG9jbiwKKwkJCSBzdHJ1Y3QgbGRyX3NlY3Rpb25faW5mbyAqaW5mbywgdW5zaWduZWQgYnl0c2l6KTsKKworICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgKiBGdW5jdGlvbiBmaWxsbWVtCisgICAgKgorICAgICogUGFyYW1ldGVyczoKKyAgICAqICAgbG9jbiAgICAgICAgVGFyZ2V0IGFkZHJlc3Mgb2YgZmlyc3QgZGF0YSBlbGVtZW50IHRvIGJlIHdyaXR0ZW4KKyAgICAqICAgaW5mbyAgICAgICAgU2VjdGlvbiBpbmZvIGZvciB0aGUgc2VjdGlvbiBpbiB3aGljaCB0aGUgYWRkcmVzcyByZXNpZGVzCisgICAgKiAgIGJ5dHNpeiAgICAgIFNpemUgb2YgdGhlIGRhdGEgdG8gYmUgd3JpdHRlbiBpbiBzaXplb2YoKSB1bml0cworICAgICogICB2YWwgICAgICAgICBWYWx1ZSB0byBiZSB3cml0dGVuIGluIGVhY2ggYnl0ZQorICAgICogRWZmZWN0OgorICAgICogICBGaWxscyB0aGUgc3BlY2lmaWVkIGFyZWEgb2YgdGFyZ2V0IG1lbW9yeS4gIFJldHVybnMgVFJVRSBmb3Igc3VjY2VzcywKKyAgICAqIEZBTFNFIGZvciBmYWlsdXJlLgorICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCWludCAoKmZpbGxtZW0pIChzdHJ1Y3QgZHluYW1pY19sb2FkZXJfaW5pdGlhbGl6ZSAqdGhpc3B0ciwKKwkJCWxkcl9hZGRyIGxvY24sIHN0cnVjdCBsZHJfc2VjdGlvbl9pbmZvICppbmZvLAorCQkJdW5zaWduZWQgYnl0c2l6LCB1bnNpZ25lZCB2YWwpOworCisgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAqIEZ1bmN0aW9uIGV4ZWN1dGUKKyAgICAqCisgICAgKiBQYXJhbWV0ZXJzOgorICAgICogICBzdGFydCAgICAgICBTdGFydGluZyBhZGRyZXNzCisgICAgKgorICAgICogRWZmZWN0OgorICAgICogICBUaGUgdGFyZ2V0IGNvZGUgYXQgdGhlIHNwZWNpZmllZCBzdGFydGluZyBhZGRyZXNzIGlzIGV4ZWN1dGVkLgorICAgICoKKyAgICAqIE5vdGVzOgorICAgICogICBUaGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCBhdCB0aGUgZW5kIG9mIHRoZSBkeW5hbWljIGxvYWQgcHJvY2VzcworICAgICogaWYgdGhlIGlucHV0IG1vZHVsZSBoYXMgc3BlY2lmaWVkIGEgc3RhcnRpbmcgYWRkcmVzcy4KKyAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwlpbnQgKCpleGVjdXRlKSAoc3RydWN0IGR5bmFtaWNfbG9hZGVyX2luaXRpYWxpemUgKnRoaXNwdHIsCisJCQlsZHJfYWRkciBzdGFydCk7CisKKyAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICogRnVuY3Rpb24gcmVsZWFzZQorICAgICoKKyAgICAqIFBhcmFtZXRlcnM6CisgICAgKiAgIG5vbmUKKyAgIC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T5iaXJxOiAgICAgICAgSS9PIElSUSBudW1iZXIuCisgKiAgICAgIG1ncl9hdHRydHMtPmlycV9zaGFyZWQ6ICAgICBUUlVFIGlmIHRoZSBJUlEgaXMgc2hhcmVhYmxlLgorICogICAgICBtZ3JfYXR0cnRzLT53b3JkX3NpemU6ICAgRFNQIFdvcmQgc2l6ZSBpbiBlcXVpdmFsZW50IFBDIGJ5dGVzLi4KKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgICAgICAgICBTdWNjZXNzOworICogICAgICAtRU5PTUVNOiAgICAgICAgICAgIEluc3VmZmljaWVudCBtZW1vcnkgZm9yIHJlcXVlc3RlZCByZXNvdXJjZXMuCisgKiAgICAgIC1FSU86ICAgICAgICAgICAgIFVuYWJsZSB0byBwbHVnIGNoYW5uZWwgSVNSIGZvciBjb25maWd1cmVkIElSUS4KKyAqICAgICAgLUVJTlZBTDogSW52YWxpZCBEU1Agd29yZCBzaXplIChtdXN0IGJlID4gMCkuCisgKiAgICAgICAgICAgICAgIEludmFsaWQgYmFzZSBhZGRyZXNzIGZvciBEU1AgY29tbXVuaWNhdGlvbnMuCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIGlvX2luaXQodm9pZCkgY2FsbGVkLgorICogICAgICBpb19tYW4gIT0gTlVMTC4KKyAqICAgICAgbWdyX2F0dHJ0cyAhPSBOVUxMLgorICogIEVuc3VyZXM6CisgKi8KK2V4dGVybiBpbnQgaW9fY3JlYXRlKHN0cnVjdCBpb19tZ3IgKippb19tYW4sCisJCQkgICAgc3RydWN0IGRldl9vYmplY3QgKmhkZXZfb2JqLAorCQkJICAgIGNvbnN0IHN0cnVjdCBpb19hdHRycyAqbWdyX2F0dHJ0cyk7CisKKy8qCisgKiAgPT09PT09PT0gaW9fZGVzdHJveSA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIERlc3Ryb3kgdGhlIElPIG1hbmFnZXIuCisgKiAgUGFyYW1ldGVyczoKKyAqICAgICAgaGlvX21ncjogICAgICAgICBJT21hbmFnZXIgb2JqZWN0LgorICogIFJldHVybnM6CisgKiAgICAgIDA6ICAgICAgICBTdWNjZXNzLgorICogICAgICAtRUZBVUxUOiAgICBoaW9fbWdyIHdhcyBpbnZhbGlkLgorICogIFJlcXVpcmVzOgorICogICAgICBpb19pbml0KHZvaWQpIGNhbGxlZC4KKyAqICBFbnN1cmVzOgorICovCitleHRlcm4gaW50IGlvX2Rlc3Ryb3koc3RydWN0IGlvX21nciAqaGlvX21ncik7CisKKy8qCisgKiAgPT09PT09PT0gaW9fZXhpdCA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIERpc2NvbnRpbnVlIHVzYWdlIG9mIHRoZSBJTyBtb2R1bGUuCisgKiAgUGFyYW1ldGVyczoKKyAqICBSZXR1cm5zOgorICogIFJlcXVpcmVzOgorICogICAgICBpb19pbml0KHZvaWQpIHByZXZpb3VzbHkgY2FsbGVkLgorICogIEVuc3VyZXM6CisgKiAgICAgIFJlc291cmNlcywgaWYgYW55IGFjcXVpcmVkIGluIGlvX2luaXQodm9pZCksIGFyZSBmcmVlZCB3aGVuIHRoZSBsYXN0CisgKiAgICAgIGNsaWVudCBvZiBJTyBjYWxscyBpb19leGl0KHZvaWQpLgorICovCitleHRlcm4gdm9pZCBpb19leGl0KHZvaWQpOworCisvKgorICogID09PT09PT09IGlvX2luaXQgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBJbml0aWFsaXplIHRoZSBJTyBtb2R1bGUncyBwcml2YXRlIHN0YXRlLgorICogIFBhcmFtZXRlcnM6CisgKiAgUmV0dXJuczoKKyAqICAgICAgVFJVRSBpZiBpbml0aWFsaXplZDsgRkFMU0UgaWYgZXJyb3Igb2NjdXJyZWQuCisgKiAgUmVxdWlyZXM6CisgKiAgRW5zdXJlczoKKyAqICAgICAgQSByZXF1aXJlbWVudCBmb3IgZWFjaCBvZiB0aGUgb3RoZXIgcHVibGljIENITkwgZnVuY3Rpb25zLgorICovCitleHRlc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QQyBmb3IgSU8uCisgKiAgUGFyYW1ldGVyczoKKyAqICAgICAgcGlvX21ncjogICAgIFB0ciB0byBhIEkvTyBtYW5hZ2VyLgorICogIFJldHVybnM6CisgKiAgUmVxdWlyZXM6CisgKiAgICAgIHBjaG5sICE9IE5VTEwKKyAqICBFbnN1cmVzOgorICovCitleHRlcm4gdm9pZCBpb3NtX3NjaGVkdWxlKHN0cnVjdCBpb19tZ3IgKmlvX21hbmFnZXIpOworCisvKgorICogRFNQLURNQSBJTyBmdW5jdGlvbnMKKyAqLworCisvKgorICogID09PT09PT09IGlvX2RkbWFfaW5pdF9jaG5sX2Rlc2MgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBJbml0aWFsaXplIERTUCBETUEgY2hhbm5lbCBkZXNjcmlwdG9yLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIGhpb19tZ3I6ICAgICAgICAgSGFuZGxlIHRvIGEgSS9PIG1hbmFnZXIuCisgKiAgICAgIGRkbWFfY2hubF9pZDogICAgRERNQSBjaGFubmVsIGlkZW50aWZpZXIuCisgKiAgICAgIG51bV9kZXNjOiAgICAgICBOdW1iZXIgb2YgYnVmZmVyIGRlc2NyaXB0b3JzKGVxdWFscyAjIG9mIElPUmVxcyAmCisgKiAgICAgICAgICAgICAgICAgICAgICBDaGlycHMpCisgKiAgICAgIGRzcDogICAgICAgICAgIERzcCBhZGRyZXNzOworICogIFJldHVybnM6CisgKiAgUmVxdWlyZXM6CisgKiAgICAgZGRtYV9jaG5sX2lkIDwgRERNQV9NQVhERE1BQ0hOTFMKKyAqICAgICBudW1fZGVzYyA+IDAKKyAqICAgICBwVmEgIT0gTlVMTAorICogICAgIHBEc3BQYSAhPSBOVUxMCisgKgorICogIEVuc3VyZXM6CisgKi8KK2V4dGVybiB2b2lkIGlvX2RkbWFfaW5pdF9jaG5sX2Rlc2Moc3RydWN0IGlvX21nciAqaGlvX21nciwgdTMyIGRkbWFfY2hubF9pZCwKKwkJCQkgICB1MzI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8gZGVmYXVsdCAoY2xlYXJlZCkgdmFsdWVzCisgKiAgRGV0YWlsczoKKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBlbGVtX2xpc3Q6ICBQb2ludGVyIHRvIGxpc3QgZWxlbWVudCB0byBiZSByZXNldAorICogIFJldHVybnM6CisgKiAgUmVxdWlyZXM6CisgKiAgICAgIExTVCBpbml0aWFsaXplZC4KKyAqICBFbnN1cmVzOgorICogIE5vdGVzOgorICogICAgICBUaGlzIGZ1bmN0aW9uIG11c3Qgbm90IGJlIGNhbGxlZCB0byAicmVzZXQiIGFuIGVsZW1lbnQgaW4gdGhlIG1pZGRsZQorICogICAgICBvZiBhIGxpc3QgY2hhaW4gLS0gdGhhdCB3b3VsZCBicmVhayB0aGUgY2hhaW4uCisgKgorICovCitzdGF0aWMgaW5saW5lIHZvaWQgbHN0X2luaXRfZWxlbShzdHJ1Y3QgbGlzdF9oZWFkICplbGVtX2xpc3QpCit7CisJaWYgKGVsZW1fbGlzdCkgeworCQllbGVtX2xpc3QtPm5leHQgPSBOVUxMOworCQllbGVtX2xpc3QtPnByZXYgPSBOVUxMOworCX0KK30KKworLyoKKyAqICA9PT09PT09PSBsc3RfaW5zZXJ0X2JlZm9yZSA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgSW5zZXJ0IHRoZSBlbGVtZW50IGJlZm9yZSB0aGUgZXhpc3RpbmcgZWxlbWVudC4KKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBsc3Q6ICAgICAgICAgICAgUG9pbnRlciB0byBsaXN0IGNvbnRyb2wgc3RydWN0dXJlLgorICogICAgICBlbGVtX2xpc3Q6ICAgICAgICAgIFBvaW50ZXIgdG8gZWxlbWVudCBpbiBsaXN0IHRvIGluc2VydC4KKyAqICAgICAgZWxlbV9leGlzdGluZzogIFBvaW50ZXIgdG8gZXhpc3RpbmcgbGlzdCBlbGVtZW50LgorICogIFJldHVybnM6CisgKiAgUmVxdWlyZXM6CisgKiAgICAgIC0gTFNU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VVCBMSU1JVEFUSU9OLCBUSEUgSU1QTElFRAorICogV0FSUkFOVElFUyBPRiBNRVJDSEFOVElCSUxJVFkgQU5EIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFLgorICovCisKKyNpZm5kZWYgTUdSXworI2RlZmluZSBNR1JfCisKKyNpbmNsdWRlIDxkc3BicmlkZ2UvbWdycHJpdi5oPgorCisjZGVmaW5lIE1BWF9FVkVOVFMgMzIKKworLyoKKyAqICA9PT09PT09PSBtZ3Jfd2FpdF9mb3JfYnJpZGdlX2V2ZW50cyA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIEJsb2NrIG9uIGFueSBCcmlkZ2UgZXZlbnQocykKKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBhbm90aWZpY2F0aW9ucyAgOiBhcnJheSBvZiBwb2ludGVycyB0byBub3RpZmljYXRpb24gb2JqZWN0cy4KKyAqICAgICAgY291bnQgICAgICAgICAgOiBudW1iZXIgb2YgZWxlbWVudHMgaW4gYWJvdmUgYXJyYXkKKyAqICAgICAgcHVfaW5kZXggICAgICAgICA6IGluZGV4IG9mIHNpZ25hbGVkIGV2ZW50IG9iamVjdAorICogICAgICB1dGltZW91dCAgICAgICAgOiB0aW1lb3V0IGludGVydmFsIGluIG1pbGxpc2VvY25kcworICogIFJldHVybnM6CisgKiAgICAgIDAgICAgICAgICA6IFN1Y2Nlc3MuCisgKiAgICAgIC1FVElNRSAgICA6IFdhaXQgdGltZWQgb3V0LiAqcHVfaW5kZXggaXMgdW5kZXRlcm1pbmVkLgorICogIERldGFpbHM6CisgKi8KKworaW50IG1ncl93YWl0X2Zvcl9icmlkZ2VfZXZlbnRzKHN0cnVjdCBkc3Bfbm90aWZpY2F0aW9uCisJCQkJICAgICAgKiphbm90aWZpY2F0aW9ucywKKwkJCQkgICAgICB1MzIgY291bnQsIHUzMiAqcHVfaW5kZXgsCisJCQkJICAgICAgdTMyIHV0aW1lb3V0KTsKKworLyoKKyAqICA9PT09PT09PSBtZ3JfY3JlYXRlID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgQ3JlYXRlcyB0aGUgTWFuYWdlciBPYmplY3QuIFRoaXMgaXMgZG9uZSBkdXJpbmcgdGhlIGRyaXZlciBsb2FkaW5nLgorICogICAgICBUaGVyZSBpcyBvbmx5IG9uZSBNYW5hZ2VyIE9iamVjdCBpbiB0aGUgRFNQL0JJT1MgQnJpZGdlLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIG1ncl9vYmo6ICAgICAgICBMb2NhdGlvbiB0byBzdG9yZSBjcmVhdGVkIE1HUiBPYmplY3QgaGFuZGxlLgorICogICAgICBkZXZfbm9kZV9vYmo6ICAgICAgIERldmljZSBvYmplY3QgYXMga25vd24gdG8gdGhlIHN5c3RlbS4KKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgU3VjY2VzcworICogICAgICAtRU5PTUVNOiAgICBGYWlsZWQgdG8gQ3JlYXRlIHRoZSBPYmplY3QKKyAqICAgICAgLUVQRVJNOiAgICAgIEdlbmVyYWwgRmFpbHVyZQorICogIFJlcXVpcmVzOgorICogICAgICBNR1IgSW5pdGlhbGl6ZWQgKHJlZnMgPiAwICkKKyAqICAgICAgbWdyX29iaiAhPSBOVUxMLgorICogIEVuc3VyZXM6CisgKiAgICAgIDA6ICAgICAgICAqbWdyX29iaiBpcyBhIHZhbGlkIE1HUiBpbnRlcmZhY2UgdG8gdGhlIGRldmljZS4KKyAqICAgICAgICAgICAgICAgICAgICAgIE1HUiBPYmplY3Qgc3RvcmVzIHRoZSBEQ0QgTWFuYWdlciBIYW5kbGUuCisgKiAgICAgICAgICAgICAgICAgICAgICBNR1IgT2JqZWN0IHN0b3JlZCBpbiB0aGUgUmVnc2l0cnkuCisgKiAgICAgICEwOiAgICAgICBNR1IgT2JqZWN0IG5vdCBjcmVhdGVkCisgKiAgRGV0YWlsczoKKyAqICAgICAgRENEIERsbCBpcyBsb2FkZWQgYW5kIE1HUiBPYmplY3Qgc3RvcmVzIHRoZSBoYW5kbGUgb2YgdGhlIERMTC4KKyAqLworZXh0ZXJuIGludCBtZ3JfY3JlYXRlKHN0cnVjdCBtZ3Jfb2JqZWN0ICoqbWdyX29iaiwKKwkJCSAgICAgc3RydWN0IGNmZ19kZXZub2RlICpkZXZfbm9kZV9vYmopOworCisvKgorICogID09PT09PT09IG1ncl9kZXN0cm95ID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgRGVzdHJveXMgdGhlIE1HUiBvYmplY3QuIENhbGxlZCB1cG9uIGRyaXZlciB1bmxvYWRpbmcuCisgKiAgUGFyYW1ldGVyczoKKyAqICAgICAgaG1ncl9vYmo6ICAgICBIYW5kbGUgdG8gTWFuYWdlciBvYmplY3QgLgorICogIFJldHVybnM6CisgKiAgICAgIDA6ICAgICAgICBTdWNjZXNzLgorICogICAgICAgICAgICAgICAgICAgICAgRENEIE1hbmFnZXIgZnJlZWQ7IE1HUiBPYmplY3QgZGVzdHJveWVkOworICogICAgICAgICAgICAgICAgICAgICAgTUdSIE9iamVjdCBkZWxldGVkIGZyb20gdGhlIFJlZ2lzdHJ5LgorICogICAgICAtRVBFUk06ICAgICAgRmFpbGVkIHRvIGRlc3Ryb3kgTUdSIE9iamVjdAorICogIFJlcXVpcmVzOgorICogICAgICBNR1IgSW5pdGlhbGl6ZWQgKHJlZnMgPiAwICkKKyAqICAgICAgaG1ncl9vYmogaXMgYSB2YWxpZCBNR1IgaGFuZGxlIC4KKyAqICBFbnN1cmVzOgorICogICAgICAwOiAgICAgICAgTUdSIE9iamVjdCBkZXN0cm95ZWQgYW5kIGhtZ3Jfb2JqIGlzIEludmFsaWQgTUdSCisgKiAgICAgICAgICAgICAgICAgICAgICBIYW5kbGUuCisgKi8KK2V4dGVybiBpbnQgbWdyX2Rlc3Ryb3koc3RydWN0IG1ncl9vYmplY3QgKmhtZ3Jfb2JqKTsKKworLyoKKyAqICA9PT09PT09PSBtZ3JfZW51bV9ub2RlX2luZm8gPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBFbnVtZXJhdGUgYW5kIGdldCBjb25maWd1cmF0aW9uIGluZm9ybWF0aW9uIGFib3V0IG5vZGVzIGNvbmZpZ3VyZWQKKyAqICAgICAgaW4gdGhlIG5vZGUgZGF0YWJhc2UuCisgKiAgUGFyYW1ldGVyczoKKyAqICAgICAgbm9kZV9pZDogICAgICAgICAgICAgIFRoZSBub2RlIGluZGV4IChiYXNlIDApLgorICogICAgICBwbmRiX3Byb3BzOiAgICAgICAgICBQdHIgdG8gdGhlIGRzcF9uZGJwcm9wcyBzdHJ1Y3R1cmUgZm9yIG91dHB1dC4KKyAqICAgICAgdW5kYl9wcm9wc19zaXplOiAgICAgIFNpemUgb2YgdGhlIGRzcF9uZGJwcm9wcyBzdHJ1Y3R1cmUuCisgKiAgICAgIHB1X251bV9ub2RlczogICAgICAgICBMb2NhdGlvbiB3aGVyZSB0aGUgbnVtYmVyIG9mIG5vZGVzIGNvbmZpZ3VyZWQKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICBpbiB0aGUgZGF0YWJhc2Ugd2lsbCBiZSByZXR1cm5lZC4KKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgICAgIFN1Y2Nlc3MuCisgKiAgICAgIC1FSU5WQUw6ICAgIFBhcmFtZXRlciBub2RlX2lkIGlzID4gdGhhbiB0aGUgbnVtYmVyIG9mIG5vZGVzLgorICogICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZ3V0cmVkIGluIHRoZSBzeXN0ZW0KKyAqICAgICAgLUVJRFJNOiAgRHVyaW5nIEVudW1lcmF0aW9uIHRoZXJlIGhhcyBiZWVuIGEgY2hhbmdlIGluCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBudW1iZXIgb2Ygbm9kZXMgY29uZmlndXJlZCBvciBpbiB0aGUKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIHByb3BlcnRpZXMgb2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2Vzc29yX2lkLAorCQkJCQkgIHN0cnVjdCBkc3BfcHJvY2Vzc29yaW5mbworCQkJCQkgICpwcm9jZXNzb3JfaW5mbywKKwkJCQkJICB1MzIgcHJvY2Vzc29yX2luZm9fc2l6ZSwKKwkJCQkJICB1OCAqcHVfbnVtX3Byb2NzKTsKKy8qCisgKiAgPT09PT09PT0gbWdyX2V4aXQgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBEZWNyZW1lbnQgcmVmZXJlbmNlIGNvdW50LCBhbmQgZnJlZSByZXNvdXJjZXMgd2hlbiByZWZlcmVuY2UgY291bnQgaXMKKyAqICAgICAgMC4KKyAqICBQYXJhbWV0ZXJzOgorICogIFJldHVybnM6CisgKiAgUmVxdWlyZXM6CisgKiAgICAgIE1HUiBpcyBpbml0aWFsaXplZC4KKyAqICBFbnN1cmVzOgorICogICAgICBXaGVuIHJlZmVyZW5jZSBjb3VudCA9PSAwLCBNR1IncyBwcml2YXRlIHJlc291cmNlcyBhcmUgZnJlZWQuCisgKi8KK2V4dGVybiB2b2lkIG1ncl9leGl0KHZvaWQpOworCisvKgorICogID09PT09PT09IG1ncl9nZXRfZGNkX2hhbmRsZSA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIFJldHJpZXZlcyB0aGUgTUdSIGhhbmRsZS4gQWNjZXNzb3IgRnVuY3Rpb24KKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBtZ3JfaGFuZGxlOiAgICAgSGFuZGxlIHRvIHRoZSBNYW5hZ2VyIE9iamVjdAorICogICAgICBkY2RfaGFuZGxlOiAgICAgUHRyIHRvIHJlY2VpdmUgdGhlIERDRCBIYW5kbGUuCisgKiAgUmV0dXJuczoKKyAqICAgICAgMDogICAgICAgIFN1Y2VzcworICogICAgICAtRVBFUk06ICAgICAgRmFpbHVyZSB0byBnZXQgdGhlIEhhbmRsZQorICogIFJlcXVpcmVzOgorICogICAgICBNR1IgaXMgaW5pdGlhbGl6ZWQuCisgKiAgICAg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yZWF0ZWQgYmVmb3JlCisgKiAgICAgIHRoZSBJTyBNYW5hZ2VyLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIG1zZ19tYW46ICAgICAgICAgICAgTG9jYXRpb24gdG8gc3RvcmUgbXNnX2N0cmwgbWFuYWdlciBoYW5kbGUgb24gb3V0cHV0LgorICogICAgICBoZGV2X29iajogICAgICAgICBUaGUgZGV2aWNlIG9iamVjdC4KKyAqICAgICAgbXNnX2NhbGxiYWNrOiAgICAgICAgQ2FsbGVkIHdoZW5ldmVyIGFuIFJNU19FWElUIG1lc3NhZ2UgaXMgcmVjZWl2ZWQuCisgKiAgUmV0dXJuczoKKyAqICBSZXF1aXJlczoKKyAqICAgICAgbXNnX21vZF9pbml0KHZvaWQpIGNhbGxlZC4KKyAqICAgICAgbXNnX21hbiAhPSBOVUxMLgorICogICAgICBoZGV2X29iaiAhPSBOVUxMLgorICogICAgICBtc2dfY2FsbGJhY2sgIT0gTlVMTC4KKyAqICBFbnN1cmVzOgorICovCitleHRlcm4gaW50IG1zZ19jcmVhdGUoc3RydWN0IG1zZ19tZ3IgKiptc2dfbWFuLAorCQkJICAgICBzdHJ1Y3QgZGV2X29iamVjdCAqaGRldl9vYmosCisJCQkgICAgIG1zZ19vbmV4aXQgbXNnX2NhbGxiYWNrKTsKKworLyoKKyAqICA9PT09PT09PSBtc2dfZGVsZXRlID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgRGVsZXRlIGEgbXNnX2N0cmwgbWFuYWdlciBhbGxvY2F0ZWQgaW4gbXNnX2NyZWF0ZSgpLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIGhtc2dfbWdyOiAgICAgICAgICAgIEhhbmRsZSByZXR1cm5lZCBmcm9tIG1zZ19jcmVhdGUoKS4KKyAqICBSZXR1cm5zOgorICogIFJlcXVpcmVzOgorICogICAgICBtc2dfbW9kX2luaXQodm9pZCkgY2FsbGVkLgorICogICAgICBWYWxpZCBobXNnX21nci4KKyAqICBFb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G9hZGVyIHRoYXQgd2lsbCBsb2FkIHRoZSBub2RlLgorICogICAgICBwcml2X3JlZjogICAgICAgSGFuZGxlIHRvIGlkZW50aWZ5IHRoZSBub2RlLgorICogICAgICBub2RlX3Byb3BzOiAgICAgUG9pbnRlciB0byBhIGRjZF9ub2RlcHJvcHMgZm9yIHRoZSBub2RlLgorICogICAgICBubGRyX25vZGVvYmo6ICAgTG9jYXRpb24gdG8gc3RvcmUgbm9kZSBoYW5kbGUgb24gb3V0cHV0LiBUaGlzIGhhbmRsZQorICogICAgICAgICAgICAgICAgICAgICAgd2lsbCBiZSBwYXNzZWQgdG8gbmxkcl9sb2FkL25sZHJfdW5sb2FkLgorICogICAgICBwZl9waGFzZV9zcGxpdDogICBwb2ludGVyIHRvIGludCB2YXJpYWJsZSByZWZlcmVuY2VkIGluIG5vZGUuYworICogIFJldHVybnM6CisgKiAgICAgIDA6ICAgICAgICBTdWNjZXNzLgorICogICAgICAtRU5PTUVNOiAgICBJbnN1ZmZpY2llbnQgbWVtb3J5IG9uIEdQUC4KKyAqICBSZXF1aXJlczoKKyAqICAgICAgbmxkcl9pbml0KHZvaWQpIGNhbGxlZC4KKyAqICAgICAgVmFsaWQgbmxkcl9vYmouCisgKiAgICAgIG5vZGVfcHJvcHMgIT0gTlVMTC4KKyAqICAgICAgbmxkcl9ub2Rlb2JqICE9IE5VTEwuCisgKiAgRW5zdXJlczoKKyAqICAgICAgMDogICAgICAgIElzVmFsaWROb2RlKCpubGRyX25vZGVvYmopLgorICogICAgICBlcnJvcjogICAgICAgICAgKm5sZHJfbm9kZW9iaiA9PSBOVUxMLgorICovCit0eXBlZGVmIGludCgqbmxkcl9hbGxvY2F0ZWZ4bikgKHN0cnVjdCBubGRyX29iamVjdCAqbmxkcl9vYmosCisJCQkJICAgICAgIHZvaWQgKnByaXZfcmVmLAorCQkJCSAgICAgICBjb25zdCBzdHJ1Y3QgZGNkX25vZGVwcm9wcworCQkJCSAgICAgICAqIG5vZGVfcHJvcHMs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ICAgICAgICAgICAgICAgICBpcyBhbHJlYWR5IGluIHVzZS4KKyAqICAgICAgLUVJTFNFUTogICAgICAgICAgIEZhaWx1cmUgaW4gZHluYW1pYyBsb2FkZXIgbGlicmFyeS4KKyAqICBSZXF1aXJlczoKKyAqICAgICAgbmxkcl9pbml0KHZvaWQpIGNhbGxlZC4KKyAqICAgICAgVmFsaWQgbmxkcl9ub2RlX29iai4KKyAqICBFbnN1cmVzOgorICovCit0eXBlZGVmIGludCgqbmxkcl9sb2FkZnhuKSAoc3RydWN0IG5sZHJfbm9kZW9iamVjdCAqbmxkcl9ub2RlX29iaiwKKwkJCQkgICBlbnVtIG5sZHJfcGhhc2UgcGhhc2UpOworCisvKgorICogID09PT09PT09IG5sZHJfdW5sb2FkID09PT09PT09CisgKiAgVW5sb2FkIGNyZWF0ZSwgZGVsZXRlLCBvciBleGVjdXRlIHBoYXNlIGZ1bmN0aW9uIG9mIGEgbm9kZSBvbiB0aGUgRFNQLgorICoKKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBubGRyX25vZGVfb2JqOiAgICAgIEhhbmRsZSByZXR1cm5lZCBmcm9tIG5sZHJfYWxsb2NhdGUoKS4KKyAqICAgICAgcGhhc2U6ICAgICAgICAgIE5vZGUgZnVuY3Rpb24gdG8gdW5sb2FkIChjcmVhdGUsIGRlbGV0ZSwgb3IgZXhlY3V0ZSkuCisgKiAgUmV0dXJuczoKKyAqICAgICAgMDogICAgICAgIFN1Y2Nlc3MuCisgKiAgICAgIC1FTk9NRU06ICAgIEluc3VmZmljaWVudCBtZW1vcnkgb24gR1BQLgorICogIFJlcXVpcmVzOgorICogICAgICBubGRyX2luaXQodm9pZCkgY2FsbGVkLgorICogICAgICBWYWxpZCBubGRyX25vZGVfb2JqLgorICogIEVuc3VyZXM6CisgKi8KK3R5cGVkZWYgaW50KCpubGRyX3VubG9hZGZ4bikgKHN0cnVjdCBubGRyX25vZGVvYmplY3QgKm5sZHJfbm9kZV9vYmosCisJCQkJICAgICBl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kZV91dWlkOiAgICAgICAgICBQb2ludGVyIHRvIGEgZHNwX3V1aWQgZm9yIHRoZSBub2RlLgorICogICAgICBwYXJnczogICAgICAgICAgICAgIE9wdGlvbmFsIGFyZ3VtZW50cyB0byBiZSBwYXNzZWQgdG8gdGhlIG5vZGUuCisgKiAgICAgIGF0dHJfaW46ICAgICAgICAgICAgT3B0aW9uYWwgcG9pbnRlciB0byBub2RlIGF0dHJpYnV0ZXMgKHByaW9yaXR5LAorICogICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVvdXQuLi4pCisgKiAgICAgIG5vZGVyZXM6ICAgICAgICAgICAgIExvY2F0aW9uIHRvIHN0b3JlIG5vZGUgcmVzb3VyY2UgaW5mby4KKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgICAgIFN1Y2Nlc3MuCisgKiAgICAgIC1FTk9NRU06ICAgICAgICBJbnN1ZmZpY2llbnQgbWVtb3J5IG9uIEdQUC4KKyAqICAgICAgLUVOT0tFWTogICAgICAgICAgTm9kZSBVVUlEIGhhcyBub3QgYmVlbiByZWdpc3RlcmVkLgorICogICAgICAtRVNQSVBFOiAgICAgICAgaUFsZyBmdW5jdGlvbnMgbm90IGZvdW5kIGZvciBhIERBSVMgbm9kZS4KKyAqICAgICAgLUVET006ICAgICAgICAgYXR0cl9pbiAhPSBOVUxMIGFuZCBhdHRyX2luLT5wcmlvIG91dCBvZgorICogICAgICAgICAgICAgICAgICAgICAgICAgIHJhbmdlLgorICogICAgICAtRVBFUk06ICAgICAgICAgIEEgZmFpbHVyZSBvY2N1cmVkLCB1bmFibGUgdG8gYWxsb2NhdGUgbm9kZS4KKyAqICAgICAgLUVCQURSOiAgICBQcm9jY2Vzc29yIGlzIG5vdCBpbiB0aGUgcnVubmluZyBzdGF0ZS4KKyAqICBSZXF1aXJlczoKKyAqICAgICAgbm9kZV9pbml0KHZvaWQpIGNhbGxlZC4KKyAqICAgICAgaHByb2Nlc3NvciAhPSBOVUxMLgorICogICAgICBub2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hlIGFsbG9jYXRlZAorICogICAgICAgICAgICAgICAgICAgICAgYnVmZmVyIG9uIG91dHB1dC4KKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgU3VjY2Vzcy4KKyAqICAgICAgLUVGQVVMVDogICAgSW52YWxpZCBub2RlIGhhbmRsZS4KKyAqICAgICAgLUVOT01FTTogICAgSW5zdWZmaWNlbnQgbWVtb3J5LgorICogICAgICAtRVBFUk06ICAgICAgR2VuZXJhbCBGYWlsdXJlLgorICogICAgICAtRUlOVkFMOiAgICAgIEludmFsaWQgU2l6ZS4KKyAqICBSZXF1aXJlczoKKyAqICAgICAgbm9kZV9pbml0KHZvaWQpIGNhbGxlZC4KKyAqICAgICAgcGJ1ZmZlciAhPSBOVUxMLgorICogIEVuc3VyZXM6CisgKi8KK2V4dGVybiBpbnQgbm9kZV9hbGxvY19tc2dfYnVmKHN0cnVjdCBub2RlX29iamVjdCAqaG5vZGUsCisJCQkJICAgICB1MzIgdXNpemUsIHN0cnVjdCBkc3BfYnVmZmVyYXR0cgorCQkJCSAgICAgKnBhdHRyLCB1OCAqKnBidWZmZXIpOworCisvKgorICogID09PT09PT09IG5vZGVfY2hhbmdlX3ByaW9yaXR5ID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgQ2hhbmdlIHRoZSBwcmlvcml0eSBvZiBhbiBhbGxvY2F0ZWQgbm9kZS4KKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBobm9kZTogICAgICAgICAgICAgIE5vZGUgaGFuZGxlIHJldHVybmVkIGZyb20gbm9kZV9hbGxvY2F0ZS4KKyAqICAgICAgcHJpbzogICAgICAgICAgTmV3IHByaW9yaXR5IGxldmVsIHRvIHNldCBub2RlJ3MgcHJpb3JpdHkgdG8uCisgKiAgUmV0dXJuczoKKyAqICAgICAgMDogICAgICAgICAgICBTdWNjZXNzLgorICogICAgICAtRUZBVUxUOiAgICAgICAgSW52YWxpZCBobm9kZS4KKyAqICAgICAgLUVET006ICAgICAgICA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GEgbm9kZSBoYW5kbGUgcmV0dXJuZWQgZnJvbSBhIHN1Y2Nlc3NmdWwgY2FsbAorICogICAgICAgICAgICAgICAgICAgICAgdG8gTm9kZV9BbGxvY2F0ZSgpLgorICogICAgICBub2RlMjogICAgICAgICBIYW5kbGUgb2Ygc2Vjb25kIG5vZGUuIE11c3QgYmUgZWl0aGVyIE5PREVfSEdQUE5PREUKKyAqICAgICAgICAgICAgICAgICAgICAgIGlmIHRoaXMgaXMgYSBjb25uZWN0aW9uIGZyb20gRFNQIG5vZGUgdG8gR1BQLCBvciBhCisgKiAgICAgICAgICAgICAgICAgICAgICBub2RlIGhhbmRsZSByZXR1cm5lZCBmcm9tIGEgc3VjY2Vzc2Z1bCBjYWxsIHRvCisgKiAgICAgICAgICAgICAgICAgICAgICBub2RlX2FsbG9jYXRlKCkuCisgKiAgICAgIHN0cmVhbTE6ICAgICAgICBPdXRwdXQgc3RyZWFtIGluZGV4IG9uIGZpcnN0IG5vZGUsIHRvIGJlIGNvbm5lY3RlZAorICogICAgICAgICAgICAgICAgICAgICAgdG8gc2Vjb25kIG5vZGUncyBpbnB1dCBzdHJlYW0uIFZhbHVlIG11c3QgcmFuZ2UgZnJvbQorICogICAgICAgICAgICAgICAgICAgICAgMCA8PSBzdHJlYW0xIDwgbnVtYmVyIG9mIG91dHB1dCBzdHJlYW1zLgorICogICAgICBzdHJlYW0yOiAgICAgICAgSW5wdXQgc3RyZWFtIGluZGV4IG9uIHNlY29uZCBub2RlLiBWYWx1ZSBtdXN0IHJhbmdlCisgKiAgICAgICAgICAgICAgICAgICAgICBmcm9tIDAgPD0gc3RyZWFtMiA8IG51bWJlciBvZiBpbnB1dCBzdHJlYW1zLgorICogICAgICBwYXR0cnM6ICAgICAgICAgU3RyZWFtIGF0dHJpYnV0ZXMgKE5VTEwgPT0+IHVzZSBkZWZhdWx0cykuCisgKiAgICAgIGNvbm5fcGFyYW06ICAgICBBIHBvaW50ZXIgdG8gYSBkc3BfY2JkYXRhIHN0cnVjdHVyZSB0aGF0IGRlZmluZXMKKyAqICAgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24gcGFyYW1ldGVyIGZvciBkZXZpY2Ugbm9kZXMgdG8gcGFzcyB0byBEU1AKKyAqICAgICAgICAgICAgICAgICAgICAgIHNpZGUuCisgKiAgICAgICAgICAgICAgICAgICAgICBJZiB0aGUgdmFsdWUgb2YgdGhpcyBwYXJhbWV0ZXIgaXMgTlVMTCwgdGhlbiB0aGlzIEFQSQorICogICAgICAgICAgICAgICAgICAgICAgYmVoYXZlcyBsaWtlIERTUE5vZGVfQ29ubmVjdC4gVGhpcyBwYXJhbWV0ZXIgd2lsbCBoYXZlCisgKiAgICAgICAgICAgICAgICAgICAgICBsZW5ndGggb2YgdGhlIHN0cmluZyBhbmQgdGhlIG51bGwgdGVybWluYXRlZCBzdHJpbmcgaW4KKyAqICAgICAgICAgICAgICAgICAgICAgIGRzcF9jYmRhdGEgc3RydWN0LiBUaGlzIGNhbiBiZSBleHRlbmRlZCBpbiBmdXR1cmUgdHAKKyAqICAgICAgICAgICAgICAgICAgICAgIHBhc3MgYmluYXJ5IGRhdGEuCisgKiAgUmV0dXJuczoKKyAqICAgICAgMDogICAgICAgICAgICAgICAgU3VjY2Vzcy4KKyAqICAgICAgLUVGQVVMVDogICAgICAgICAgICBJbnZhbGlkIG5vZGUxIG9yIG5vZGUyLgorICogICAgICAtRU5PTUVNOiAgICAgICAgICAgIEluc3VmZmljaWVudCBob3N0IG1lbW9yeS4KKyAqICAgICAgLUVJTlZBTDogICAgICAgICAgICAgQSBzdHJlYW0gaW5kZXggcGFyYW1ldGVyIGlzIGludmFsaWQuCisgKiAgICAgIC1FSVNDT05OOiAgQSBjb25uZWN0aW9uIGFscmVhZHkgZXhpc3RzIGZvciBvbmUgb2YgdGhlCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGljZXMgc3RyZWFtMSBvciBzdHJlYW0yLgorICogICAgICAtRUJBRFI6ICAgICAgIC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kZSB0aGF0IGNvbnRhaW5zIHRoZSBub2RlJ3MgY3JlYXRlCisgKiAgICAgIGZ1bmN0aW9uLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIGhub2RlOiAgICAgICAgICAgICAgTm9kZSBoYW5kbGUgcmV0dXJuZWQgZnJvbSBub2RlX2FsbG9jYXRlKCkuCisgKiAgUmV0dXJuczoKKyAqICAgICAgMDogICAgICAgICAgICBTdWNjZXNzLgorICogICAgICAtRUZBVUxUOiAgICAgICAgSW52YWxpZCBobm9kZS4KKyAqICAgICAgLUVTUElQRTogICAgICAgIENyZWF0ZSBmdW5jdGlvbiBub3QgZm91bmQgaW4gdGhlIENPRkYgZmlsZS4KKyAqICAgICAgLUVCQURSOiAgICBOb2RlIGlzIG5vdCBpbiB0aGUgTk9ERV9BTExPQ0FURUQgc3RhdGUuCisgKiAgICAgIC1FTk9NRU06ICAgICAgICBNZW1vcnkgYWxsb2NhdGlvbiBmYWlsdXJlIG9uIHRoZSBEU1AuCisgKiAgICAgIC1FVElNRTogICAgICAgQSB0aW1lb3V0IG9jY3VycmVkIGJlZm9yZSB0aGUgRFNQIHJlc3BvbmRlZC4KKyAqICAgICAgLUVQRVJNOiAgICAgICAgICBBIGZhaWx1cmUgb2NjdXJyZWQsIHVuYWJsZSB0byBjcmVhdGUgbm9kZS4KKyAqICBSZXF1aXJlczoKKyAqICAgICAgbm9kZV9pbml0KHZvaWQpIGNhbGxlZC4KKyAqICBFbnN1cmVzOgorICovCitleHRlcm4gaW50IG5vZGVfY3JlYXRlKHN0cnVjdCBub2RlX29iamVjdCAqaG5vZGUpOworCisvKgorICogID09PT09PT09IG5vZGVfY3JlYXRlX21nciA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIENyZWF0ZSBhIE5PREUgTWFuYWdlciBvYmplY3QuIFRoaXMgb2JqZWN0IGhhbmRsZXMgdGhlIGNyZWF0aW9uLAorICogICAgICBkZWxldGlvbiwgYW5kIGV4ZWN1dGlvbiBvZiBub2RlcyBvbiB0aGUgRFNQIHRhcmdldC4gVGhlIE5PREUgTWFuYWdlcgorICogICAgICBhbHNvIG1haW50YWlucyBhIHBpcGUgbWFwIG9mIHVzZWQgYW5kIGF2YWlsYWJsZSBub2RlIGNvbm5lY3Rpb25zLgorICogICAgICBFYWNoIERFViBvYmplY3Qgc2hvdWxkIGhhdmUgZXhhY3RseSBvbmUgTk9ERSBNYW5hZ2VyIG9iamVjdC4KKyAqCisgKiAgUGFyYW1ldGVyczoKKyAqICAgICAgbm9kZV9tYW46ICAgICAgIExvY2F0aW9uIHRvIHN0b3JlIG5vZGUgbWFuYWdlciBoYW5kbGUgb24gb3V0cHV0LgorICogICAgICBoZGV2X29iajogICAgIERldmljZSBmb3IgdGhpcyBwcm9jZXNzb3IuCisgKiAgUmV0dXJuczoKKyAqICAgICAgMDogICAgICAgIFN1Y2Nlc3M7CisgKiAgICAgIC1FTk9NRU06ICAgIEluc3VmZmljaWVudCBtZW1vcnkgZm9yIHJlcXVlc3RlZCByZXNvdXJjZXMuCisgKiAgICAgIC1FUEVSTTogICAgICBHZW5lcmFsIGZhaWx1cmUuCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIG5vZGVfaW5pdCh2b2lkKSBjYWxsZWQuCisgKiAgICAgIG5vZGVfbWFuICE9IE5VTEwuCisgKiAgICAgIGhkZXZfb2JqICE9IE5VTEwuCisgKiAgRW5zdXJlczoKKyAqICAgICAgMDogICAgICAgIFZhbGlkZSAqbm9kZV9tYW4uCisgKiAgICAgIGVycm9yOiAgICAgICAgICAqbm9kZV9tYW4gPT0gTlVMTC4KKyAqLworZXh0ZXJuIGludCBub2RlX2NyZWF0ZV9tZ3Ioc3RydWN0IG5vZGVfbWdyICoqbm9kZV9tYW4sCisJCQkJICBzdHJ1Y3QgZGV2X29iamVjdCAqaGRldl9vYmopOworCisvKgorICogID09PT09PT09IG5vZGVfZGVsZXRlID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgRGVsZXRlIHJlc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ICogICAgICAwOiAgICAgICAgICAgIGhub2RlIGlzIGludmFsaWQuCisgKi8KK2V4dGVybiBpbnQgbm9kZV9kZWxldGUoc3RydWN0IG5vZGVfcmVzX29iamVjdCAqbm9kZXJlcywKKwkJCSAgICAgIHN0cnVjdCBwcm9jZXNzX2NvbnRleHQgKnByX2N0eHQpOworCisvKgorICogID09PT09PT09IG5vZGVfZGVsZXRlX21nciA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIERlbGV0ZSB0aGUgTk9ERSBNYW5hZ2VyLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIGhub2RlX21ncjogICAgICAgTm9kZSBtYW5hZ2VyIG9iamVjdC4KKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgU3VjY2Vzcy4KKyAqICBSZXF1aXJlczoKKyAqICAgICAgbm9kZV9pbml0KHZvaWQpIGNhbGxlZC4KKyAqICAgICAgVmFsaWQgaG5vZGVfbWdyLgorICogIEVuc3VyZXM6CisgKi8KK2V4dGVybiBpbnQgbm9kZV9kZWxldGVfbWdyKHN0cnVjdCBub2RlX21nciAqaG5vZGVfbWdyKTsKKworLyoKKyAqICA9PT09PT09PSBub2RlX2VudW1fbm9kZXMgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBFbnVtZXJhdGUgdGhlIG5vZGVzIGN1cnJlbnRseSBhbGxvY2F0ZWQgZm9yIHRoZSBEU1AuCisgKiAgUGFyYW1ldGVyczoKKyAqICAgICAgaG5vZGVfbWdyOiAgICAgICBOb2RlIG1hbmFnZXIgcmV0dXJuZWQgZnJvbSBub2RlX2NyZWF0ZV9tZ3IoKS4KKyAqICAgICAgbm9kZV90YWI6ICAgICAgIEFycmF5IHRvIGNvcHkgbm9kZSBoYW5kbGVzIGludG8uCisgKiAgICAgIG5vZGVfdGFiX3NpemU6ICAgTnVtYmVyIG9mIGhhbmRsZXMgdGhhdCBjYW4gYmUgd3JpdHRlbiB0byBub2RlX3RhYi4KKyAqICAg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cnlpbmcgdG8gcmV0cmlldmUgYSBtZXNzYWdlLgorICogICAgICAtRVRJTUU6ICAgVGltZW91dCBvY2N1cnJlZCBhbmQgbm8gbWVzc2FnZSBpcyBhdmFpbGFibGUuCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIG5vZGVfaW5pdCh2b2lkKSBjYWxsZWQuCisgKiAgICAgIG1lc3NhZ2UgIT0gTlVMTC4KKyAqICBFbnN1cmVzOgorICovCitleHRlcm4gaW50IG5vZGVfZ2V0X21lc3NhZ2Uoc3RydWN0IG5vZGVfb2JqZWN0ICpobm9kZSwKKwkJCQkgICBzdHJ1Y3QgZHNwX21zZyAqbWVzc2FnZSwgdTMyIHV0aW1lb3V0KTsKKworLyoKKyAqICA9PT09PT09PSBub2RlX2dldF9ubGRyX29iaiA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIFJldHJpZXZlIHRoZSBObGRyIG1hbmFnZXIKKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBobm9kZV9tZ3I6ICAgICAgIE5vZGUgTWFuYWdlcgorICogICAgICBubGRyX292bHlvYmo6ICAgUG9pbnRlciB0byBhIE5sZHIgbWFuYWdlciBoYW5kbGUKKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgU3VjY2Vzcy4KKyAqICAgICAgLUVGQVVMVDogICAgSW52YWxpZCBobm9kZS4KKyAqICBFbnN1cmVzOgorICovCitleHRlcm4gaW50IG5vZGVfZ2V0X25sZHJfb2JqKHN0cnVjdCBub2RlX21nciAqaG5vZGVfbWdyLAorCQkJCSAgICBzdHJ1Y3Qgbmxkcl9vYmplY3QgKipubGRyX292bHlvYmopOworCisvKgorICogID09PT09PT09IG5vZGVfaW5pdCA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIEluaXRpYWxpemUgdGhlIE5PREUgbW9kdWxlLgorICogIFBhcmFtZXRlcnM6CisgKiAgUmV0dXJuczoKKyAqICAgICAgVFJVRSBpZiBpbml0aWFsaXphdGl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KiAgICAgICAgICAgICAgICAgICAgICAgICAgcnVubmluZyBvbiB0aGUgRFNQLgorICogIFJldHVybnM6CisgKiAgICAgIDA6ICAgICAgICAgICAgU3VjY2Vzcy4KKyAqICAgICAgLUVGQVVMVDogICAgICAgIEludmFsaWQgaG5vZGUuCisgKiAgICAgIC1FUEVSTTogTm9kZSBpcyBub3QgYSB0YXNrIG9yIHNvY2tldCBub2RlLgorICogICAgICAgICAgICAgIEZhaWxlZCB0byBwYXVzZSBub2RlLgorICogICAgICAtRVRJTUU6ICAgICAgIEEgdGltZW91dCBvY2N1cnJlZCBiZWZvcmUgdGhlIERTUCByZXNwb25kZWQuCisgKiAgICAgIERTUF9FV1JPTkdTVFNBVEU6ICAgTm9kZSBpcyBub3QgaW4gTk9ERV9SVU5OSU5HIHN0YXRlLgorICogIFJlcXVpcmVzOgorICogICAgICBub2RlX2luaXQodm9pZCkgY2FsbGVkLgorICogIEVuc3VyZXM6CisgKi8KK2V4dGVybiBpbnQgbm9kZV9wYXVzZShzdHJ1Y3Qgbm9kZV9vYmplY3QgKmhub2RlKTsKKworLyoKKyAqICA9PT09PT09PSBub2RlX3B1dF9tZXNzYWdlID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgU2VuZCBhIG1lc3NhZ2UgdG8gYSBtZXNzYWdlIG5vZGUsIHRhc2sgbm9kZSwgb3IgWERBSVMgc29ja2V0IG5vZGUuCisgKiAgICAgIFRoaXMgZnVuY3Rpb24gd2lsbCBibG9jayB1bnRpbCB0aGUgbWVzc2FnZSBzdHJlYW0gY2FuIGFjY29tbW9kYXRlCisgKiAgICAgIHRoZSBtZXNzYWdlLCBvciBhIHRpbWVvdXQgb2NjdXJzLiBUaGUgbWVzc2FnZSB3aWxsIGJlIGNvcGllZCwgc28gTXNnCisgKiAgICAgIGNhbiBiZSByZS11c2VkIGltbWVkaWF0ZWx5IGFmdGVyIHJldHVybi4KKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBobm9kZTogICAgICAgIC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YW1ldGVyczoKKyAqICAgICAgaG5vZGU6ICAgICAgICAgIE5vZGUgaGFuZGxlIHJldHVybmVkIGJ5IG5vZGVfYWxsb2NhdGUoKS4KKyAqICAgICAgZXZlbnRfbWFzazogICAgIE1hc2sgb2YgdHlwZXMgb2YgZXZlbnRzIHRvIGJlIG5vdGlmaWVkIGFib3V0LgorICogICAgICBub3RpZnlfdHlwZTogICAgVHlwZSBvZiBub3RpZmljYXRpb24gdG8gYmUgc2VudC4KKyAqICAgICAgaG5vdGlmaWNhdGlvbjogIEhhbmRsZSB0byBiZSB1c2VkIGZvciBub3RpZmljYXRpb24uCisgKiAgUmV0dXJuczoKKyAqICAgICAgMDogICAgICAgIFN1Y2Nlc3MuCisgKiAgICAgIC1FRkFVTFQ6ICAgIEludmFsaWQgaG5vZGUuCisgKiAgICAgIC1FTk9NRU06ICAgIEluc3VmZmljaWVudCBtZW1vcnkgb24gR1BQLgorICogICAgICAtRUlOVkFMOiAgICAgZXZlbnRfbWFzayBpcyBpbnZhbGlkLgorICogICAgICAtRU5PU1lTOiAgIE5vdGlmaWNhdGlvbiB0eXBlIHNwZWNpZmllZCBieSBub3RpZnlfdHlwZSBpcyBub3QKKyAqICAgICAgICAgICAgICAgICAgICAgIHN1cHBvcnRlZC4KKyAqICBSZXF1aXJlczoKKyAqICAgICAgbm9kZV9pbml0KHZvaWQpIGNhbGxlZC4KKyAqICAgICAgaG5vdGlmaWNhdGlvbiAhPSBOVUxMLgorICogIEVuc3VyZXM6CisgKi8KK2V4dGVybiBpbnQgbm9kZV9yZWdpc3Rlcl9ub3RpZnkoc3RydWN0IG5vZGVfb2JqZWN0ICpobm9kZSwKKwkJCQkgICAgICAgdTMyIGV2ZW50X21hc2ssIHUzMiBub3RpZnlfdHlwZSwKKwkJCQkgICAgICAgc3RydWN0IGRzcF9ub3RpZmljYXRpb24KKwkJCQkgICAgICAgKmhub3RpZmljYXRpb24pOworCisvKgorICogID09PT09PT09IG5vZGVfcnVuID09PT09PT09Cisg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N1cmVzOgorICovCitleHRlcm4gaW50IG5vZGVfcnVuKHN0cnVjdCBub2RlX29iamVjdCAqaG5vZGUpOworCisvKgorICogID09PT09PT09IG5vZGVfdGVybWluYXRlID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgU2lnbmFsIGEgbm9kZSBydW5uaW5nIG9uIHRoZSBEU1AgdGhhdCBpdCBzaG91bGQgZXhpdCBpdHMgZXhlY3V0ZQorICogICAgICBwaGFzZSBmdW5jdGlvbi4KKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBobm9kZTogICAgICAgICAgICAgIE5vZGUgb2JqZWN0IHJlcHJlc2VudGluZyBhIG5vZGUgY3VycmVudGx5CisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgcnVubmluZyBvbiB0aGUgRFNQLgorICogICAgICBwc3RhdHVzOiAgICAgICAgICAgIExvY2F0aW9uIHRvIHN0b3JlIGV4ZWN1dGUtcGhhc2UgZnVuY3Rpb24gcmV0dXJuCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUuCisgKiAgUmV0dXJuczoKKyAqICAgICAgMDogICAgICAgICAgICBTdWNjZXNzLgorICogICAgICAtRUZBVUxUOiAgICAgICAgSW52YWxpZCBobm9kZS4KKyAqICAgICAgLUVUSU1FOiAgICAgICBBIHRpbWVvdXQgb2NjdXJyZWQgYmVmb3JlIHRoZSBEU1AgcmVzcG9uZGVkLgorICogICAgICAtRVBFUk06IFR5cGUgb2Ygbm9kZSBzcGVjaWZpZWQgY2Fubm90IGJlIHRlcm1pbmF0ZWQuCisgKiAgICAgICAgICAgICAgVW5hYmxlIHRvIHRlcm1pbmF0ZSB0aGUgbm9kZS4KKyAqICAgICAgLUVCQURSOiAgICBPcGVyYXRpb24gbm90IHZhbGlkIGZvciB0aGUgY3VycmVudCBub2RlIHN0YXRlLgorICogIFJlcXVpcmVzOgorICogICAgICBub2RlX2luaXQodm9pZCkgY2FsbGVkLgorICogICAgICBwc3RhdHVzICE9IE5VTEw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ZXNlcnZlZCB3aGVuIG5vZGVfY29ubmVjdCgpIGlzIGNhbGxlZAorICogICAgICB0byBjb25uZWN0IHRoZSBub2RlIHdpdGggdGhlIGhvc3QuIFRoaXMgaW5kZXggc2hvdWxkIGJlIHBhc3NlZCB0bworICogICAgICB0aGUgQ0hOTF9PcGVuIGZ1bmN0aW9uIHdoZW4gdGhlIHN0cmVhbSBpcyBhY3R1YWxseSBvcGVuZWQuCisgKiAgUGFyYW1ldGVyczoKKyAqICAgICAgaG5vZGU6ICAgICAgICAgIE5vZGUgb2JqZWN0IGFsbG9jYXRlZCBmcm9tIG5vZGVfYWxsb2NhdGUoKS4KKyAqICAgICAgZGlyOiAgICAgICAgICAgSW5wdXQgKERTUF9UT05PREUpIG9yIG91dHB1dCAoRFNQX0ZST01OT0RFKS4KKyAqICAgICAgaW5kZXg6ICAgICAgICAgU3RyZWFtIGluZGV4LgorICogICAgICBjaGFuX2lkOiAgICAgICAgTG9jYXRpb24gdG8gc3RvcmUgY2hhbm5lbCBpbmRleC4KKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgU3VjY2Vzcy4KKyAqICAgICAgLUVGQVVMVDogICAgSW52YWxpZCBobm9kZS4KKyAqICAgICAgLUVQRVJNOiAgTm90IGEgdGFzayBvciBEQUlTIHNvY2tldCBub2RlLgorICogICAgICAtRUlOVkFMOiAgICAgVGhlIG5vZGUncyBzdHJlYW0gY29ycmVzcG9uZGluZyB0byBpbmRleCBhbmQgZGlyCisgKiAgICAgICAgICAgICAgICAgICAgICBpcyBub3QgYSBzdHJlYW0gdG8gb3IgZnJvbSB0aGUgaG9zdC4KKyAqICBSZXF1aXJlczoKKyAqICAgICAgbm9kZV9pbml0KHZvaWQpIGNhbGxlZC4KKyAqICAgICAgVmFsaWQgZGlyLgorICogICAgICBjaGFuX2lkICE9IE5VTEwuCisgKiAgRW5zdXJlczoKKyAqLworZXh0ZXJuIGludCBub2RlX2dldF9jaGFubmVsX2lkKHN0cnVjdCBub2RlX29iamVjdCAqaG5vZGUsCisJCQkJICAgICAgdTMyIGRpciwgdTMyIGluZGV4LCB1MzIgKmNoYW5faWQpOworCisvKgorICogID09PT09PT09IG5vZGVfZ2V0X3N0cm1fbWdyID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgR2V0IHRoZSBTVFJNIG1hbmFnZXIgZm9yIGEgbm9kZS4KKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBobm9kZTogICAgICAgICAgTm9kZSBhbGxvY2F0ZWQgd2l0aCBub2RlX2FsbG9jYXRlKCkuCisgKiAgICAgIHN0cm1fbWFuOiAgICAgICBMb2NhdGlvbiB0byBzdG9yZSBTVFJNIG1hbmFnZXIgb24gb3V0cHV0LgorICogIFJldHVybnM6CisgKiAgICAgIDA6ICAgICAgICBTdWNjZXNzLgorICogICAgICAtRUZBVUxUOiAgICBJbnZhbGlkIGhub2RlLgorICogIFJlcXVpcmVzOgorICogICAgICBzdHJtX21hbiAhPSBOVUxMLgorICogIEVuc3VyZXM6CisgKi8KK2V4dGVybiBpbnQgbm9kZV9nZXRfc3RybV9tZ3Ioc3RydWN0IG5vZGVfb2JqZWN0ICpobm9kZSwKKwkJCQkgICAgc3RydWN0IHN0cm1fbWdyICoqc3RybV9tYW4pOworCisvKgorICogID09PT09PT09IG5vZGVfZ2V0X3RpbWVvdXQgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBHZXQgdGhlIHRpbWVvdXQgdmFsdWUgb2YgYSBub2RlLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIGhub2RlOiAgICAgIE5vZGUgYWxsb2NhdGVkIHdpdGggbm9kZV9hbGxvY2F0ZSgpLCBvciBEU1BfSEdQUE5PREUuCisgKiAgUmV0dXJuczoKKyAqICAgICAgTm9kZSdzIHRpbWVvdXQgdmFsdWUuCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIFZhbGlkIGhub2RlLgorICogIEVuc3VyZXM6CisgKi8KK2V4dGVybiB1MzIgbm9kZV9nZXRfdGltZW91dChzdHJ1Y3Qgbm9kZV9vYmplY3QgKmhub2RlKTsKKworLyoKKyAqICA9PT09PT09PSBub2RlX2dldF90eXBlID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgR2V0IHRoZSB0eXBlIChkZXZpY2UsIG1lc3NhZ2UsIHRhc2ssIG9yIFhEQUlTIHNvY2tldCkgb2YgYSBub2RlLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIGhub2RlOiAgICAgIE5vZGUgYWxsb2NhdGVkIHdpdGggbm9kZV9hbGxvY2F0ZSgpLCBvciBEU1BfSEdQUE5PREUuCisgKiAgUmV0dXJuczoKKyAqICAgICAgTm9kZSB0eXBlOiAgTk9ERV9ERVZJQ0UsIE5PREVfVEFTSywgTk9ERV9YREFJUywgb3IgTk9ERV9HUFAuCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIFZhbGlkIGhub2RlLgorICogIEVuc3VyZXM6CisgKi8KK2V4dGVybiBlbnVtIG5vZGVfdHlwZSBub2RlX2dldF90eXBlKHN0cnVjdCBub2RlX29iamVjdCAqaG5vZGUpOworCisvKgorICogID09PT09PT09IGdldF9ub2RlX2luZm8gPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBHZXQgbm9kZSBpbmZvcm1hdGlvbiB3aXRob3V0IGhvbGRpbmcgc2VtYXBob3JlLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIGhub2RlOiAgICAgIE5vZGUgYWxsb2NhdGVkIHdpdGggbm9kZV9hbGxvY2F0ZSgpLCBvciBEU1BfSEdQUE5PREUuCisgKiAgUmV0dXJuczoKKyAqICAgICAgTm9kZSBpbmZvOiAgcHJpb3JpdHksIGRldmljZSBvd25lciwgbm8uIG9mIHN0cmVhbXMsIGV4ZWN1dGlvbiBzdGF0ZQorICogICAgICAgICAgICAgICAgICBOREIgcHJvcGVydGllcy4KKyAqICBSZXF1aXJlczoKKyAqICAgICAgVmFsaWQgaG5vZGUuCisgKiAgRW5z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fbm9kZV9vYmosCisJCQkJICBzdHJ1Y3QgZGV2X29iamVjdCAqaGRldl9vYmopOworCisvKgorICogID09PT09PT09IHByb2NfY3RybCA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIFBhc3MgY29udHJvbCBpbmZvcm1hdGlvbiB0byB0aGUgR1BQIGRldmljZSBkcml2ZXIgbWFuYWdpbmcgdGhlIERTUAorICogICAgICBwcm9jZXNzb3IuIFRoaXMgd2lsbCBiZSBhbiBPRU0tb25seSBmdW5jdGlvbiwgYW5kIG5vdCBwYXJ0IG9mIHRoZQorICogICAgICAnQnJpZGdlIGFwcGxpY2F0aW9uIGRldmVsb3BlcidzIEFQSS4KKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBocHJvY2Vzc29yICA6ICAgICAgIFRoZSBwcm9jZXNzb3IgaGFuZGxlLgorICogICAgICBkd19jbWQgICAgICAgOiAgICAgICBQcml2YXRlIGRyaXZlciBJT0NUTCBjbWQgSUQuCisgKiAgICAgIHBhcmdzICAgICAgIDogICAgICAgUHRyIHRvIGFuIGRyaXZlciBkZWZpbmVkIGFyZ3VtZW50IHN0cnVjdHVyZS4KKyAqICBSZXR1cm5zOgorICogICAgICAwICAgICA6ICAgICAgIFNVQ0NFU1MKKyAqICAgICAgLUVGQVVMVCA6ICAgICAgIEludmFsaWQgcHJvY2Vzc29yIGhhbmRsZS4KKyAqICAgICAgLUVUSU1FOiAgICAgICBBIFRpbWVvdXQgT2NjdXJlZCBiZWZvcmUgdGhlIENvbnRyb2wgaW5mb3JtYXRpb24KKyAqCQkJICBjb3VsZCBiZSBzZW50LgorICogICAgICAtRVBFUk0gICA6ICAgICAgIEdlbmVyYWwgRmFpbHVyZS4KKyAqICBSZXF1aXJlczoKKyAqICAgICAgUFJPQyBJbml0aWFsaXplZC4KKyAqICBFbnN1cmVzCisgKiAgRGV0YWlsczoKKyAqICAgICAgVGhpcyBmdW5jdGlvbiBDYWxscyBicmlkZ2VfZGV2X2N0cmwuCisgKi8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W5mb3JtYXRpb24uCisgKiAgRGV0YWlsczoKKyAqICBSZXF1aXJlcworICogICAgICBwdV9udW1fbm9kZXMgaXMgbm90IE5VTEwuCisgKiAgICAgIHB1X2FsbG9jYXRlZCBpcyBub3QgTlVMTC4KKyAqICAgICAgbm9kZV90YWIgaXMgbm90IE5VTEwuCisgKiAgICAgIFBST0MgSW5pdGlhbGl6ZWQuCisgKiAgRW5zdXJlczoKKyAqICBEZXRhaWxzOgorICovCitleHRlcm4gaW50IHByb2NfZW51bV9ub2Rlcyh2b2lkICpocHJvY2Vzc29yLAorCQkJCSAgdm9pZCAqKm5vZGVfdGFiLAorCQkJCSAgdTMyIG5vZGVfdGFiX3NpemUsCisJCQkJICB1MzIgKnB1X251bV9ub2RlcywKKwkJCQkgIHUzMiAqcHVfYWxsb2NhdGVkKTsKKworLyoKKyAqICA9PT09PT09PSBwcm9jX2dldF9yZXNvdXJjZV9pbmZvID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgRW51bWVyYXRlIHRoZSByZXNvdXJjZXMgY3VycmVudGx5IGF2YWlsYWJsZSBvbiBhIHByb2Nlc3Nvci4KKyAqICBQYXJhbWV0ZXJzOgorICogICAgICBocHJvY2Vzc29yICA6ICAgICAgIFRoZSBwcm9jZXNzb3IgaGFuZGxlLgorICogICAgICByZXNvdXJjZV90eXBlOiAgICAgIFR5cGUgb2YgcmVzb3VyY2UgLgorICogICAgICByZXNvdXJjZV9pbmZvOiAgICAgIFB0ciB0byB0aGUgZHNwX3Jlc291cmNlaW5mbyBzdHJ1Y3R1cmUuCisgKiAgICAgIHJlc291cmNlX2luZm9fc2l6ZTogIFNpemUgb2YgdGhlIHN0cnVjdHVyZS4KKyAqICBSZXR1cm5zOgorICogICAgICAwICAgICA6ICAgICAgIFN1Y2Nlc3MuCisgKiAgICAgIC1FRkFVTFQgOiAgICAgICBJbnZhbGlkIHByb2Nlc3NvciBoYW5kbGUuCisgKiAgICAgIC1FQkFEUjogICAgVGhlIHByb2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IFBhcmFtZXRlcnM6CisgKiAgUmV0dXJuczoKKyAqICBSZXF1aXJlczoKKyAqICAgICAgUFJPQyBpcyBpbml0aWFsaXplZC4KKyAqICBFbnN1cmVzOgorICogICAgICBXaGVuIHJlZmVyZW5jZSBjb3VudCA9PSAwLCBQUk9DJ3MgcHJpdmF0ZSByZXNvdXJjZXMgYXJlIGZyZWVkLgorICovCitleHRlcm4gdm9pZCBwcm9jX2V4aXQodm9pZCk7CisKKy8qCisgKiA9PT09PT09PSBwcm9jX2dldF9kZXZfb2JqZWN0ID09PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIFJldHVybnMgdGhlIERFViBIYW5sZGUgZm9yIGEgZ2l2ZW4gUHJvY2Vzc29yIGhhbmRsZQorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIGhwcm9jZXNzb3IgIDogICBQcm9jZXNzb3IgSGFuZGxlCisgKiAgICAgIGRldmljZV9vYmogOiAgICBMb2NhdGlvbiB0byBzdG9yZSB0aGUgREVWIEhhbmRsZS4KKyAqICBSZXR1cm5zOgorICogICAgICAwICAgICA6ICAgU3VjY2VzczsgKmRldmljZV9vYmogaGFzIERldiBoYW5kbGUKKyAqICAgICAgLUVQRVJNICAgOiAgIEZhaWx1cmU7ICpkZXZpY2Vfb2JqIGlzIHplcm8uCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIGRldmljZV9vYmogaXMgbm90IE5VTEwKKyAqICAgICAgUFJPQyBJbml0aWFsaXplZC4KKyAqICBFbnN1cmVzOgorICogICAgICAwICAgICA6ICAgKmRldmljZV9vYmogaXMgbm90IE5VTEwKKyAqICAgICAgLUVQRVJNICAgOiAgICpkZXZpY2Vfb2JqIGlzIE5VTEwuCisgKi8KK2V4dGVybiBpbnQgcHJvY19nZXRfZGV2X29iamVjdCh2b2lkICpocHJvY2Vzc29yLAorCQkJCSAgICAgIHN0cnVjdCBkZXZfb2JqZWN0ICoqZGV2aWNlX29iaik7CisKKy8qCisgKiAgPT09PT09PT0g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IFBST0MgSW5pdGlhbGl6ZWQuCisgKiAgRW5zdXJlczoKKyAqICBEZXRhaWxzOgorICovCitleHRlcm4gaW50IHByb2NfZ2V0X3Byb2Nlc3Nvcl9pZCh2b2lkICpwcm9jLCB1MzIgKiBwcm9jX2lkKTsKKworLyoKKyAqICA9PT09PT09PSBwcm9jX2dldF90cmFjZSA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIFJldHJpZXZlIHRoZSB0cmFjZSBidWZmZXIgZnJvbSB0aGUgc3BlY2lmaWVkIERTUCBwcm9jZXNzb3IuCisgKiAgUGFyYW1ldGVyczoKKyAqICAgICAgaHByb2Nlc3NvciAgOiAgIFRoZSBwcm9jZXNzb3IgaGFuZGxlLgorICogICAgICBwYnVmCTogICBQdHIgdG8gYnVmZmVyIHRvIGhvbGQgdHJhY2Ugb3V0cHV0LgorICogICAgICBtYXhfc2l6ZSAgICA6ICAgTWF4aW11bSBzaXplIG9mIHRoZSBvdXRwdXQgYnVmZmVyLgorICogIFJldHVybnM6CisgKiAgICAgIDAgICAgIDogICBTdWNjZXNzLgorICogICAgICAtRUZBVUxUIDogICBJbnZhbGlkIHByb2Nlc3NvciBoYW5kbGUuCisgKiAgICAgIC1FUEVSTSAgIDogICBHZW5lcmFsIGZhaWx1cmUgd2hpbGUgcmV0aXJldmluZyBwcm9jZXNzb3IgdHJhY2UKKyAqCQkgICAgICBCdWZmZXIuCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIHBidWYgaXMgbm90IE5VTEwKKyAqICAgICAgbWF4X3NpemUgaXMgPiAwLgorICogICAgICBQUk9DIEluaXRpYWxpemVkLgorICogIEVuc3VyZXM6CisgKiAgRGV0YWlsczoKKyAqLworZXh0ZXJuIGludCBwcm9jX2dldF90cmFjZSh2b2lkICpocHJvY2Vzc29yLCB1OCAqIHBidWYsIHUzMiBtYXhfc2l6ZSk7CisKKy8qCisgKiAgPT09PT09PT0gcHJvY19sb2FkID09PT09PT09CisgKiAgUHVycG9zZToK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WdzCSA6ICAgUmVzZXJ2ZWQuCisgKiAgUmV0dXJuczoKKyAqICAgICAgMAkgOiAgIFN1Y2Nlc3MuCisgKiAgICAgIC1FRkFVTFQgICAgIDogICBJbnZhbGlkIHByb2Nlc3NvciBoYW5kbGUuCisgKiAgICAgIC1FUEVSTSAgICAgICA6ICAgR2VuZXJhbCBmYWlsdXJlLgorICogIFJlcXVpcmVzOgorICogICAgICBQUk9DIEluaXRpYWxpemVkLgorICogIEVuc3VyZXM6CisgKiAgRGV0YWlsczoKKyAqICAgICAgQWxsIHRoZSBhcmd1bWVudHMgYXJlIGN1cnJlbnRseSBpZ25vcmVkLgorICovCitleHRlcm4gaW50IHByb2NfZmx1c2hfbWVtb3J5KHZvaWQgKmhwcm9jZXNzb3IsCisJCQkJICAgIHZvaWQgKnBtcHVfYWRkciwgdTMyIHVsX3NpemUsIHUzMiB1bF9mbGFncyk7CisKKy8qCisgKiAgPT09PT09PT0gcHJvY19pbnZhbGlkYXRlX21lbW9yeSA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIEludmFsaWRhdGVzIGEgYnVmZmVyIGZyb20gdGhlIE1QVSBkYXRhIGNhY2hlLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIGhwcm9jZXNzb3IgICAgICA6ICAgVGhlIHByb2Nlc3NvciBoYW5kbGUuCisgKiAgICAgIHBtcHVfYWRkcgk6ICAgQnVmZmVyIHN0YXJ0IGFkZHJlc3MKKyAqICAgICAgdWxfc2l6ZQkgIDogICBCdWZmZXIgc2l6ZQorICogIFJldHVybnM6CisgKiAgICAgIDAJIDogICBTdWNjZXNzLgorICogICAgICAtRUZBVUxUICAgICA6ICAgSW52YWxpZCBwcm9jZXNzb3IgaGFuZGxlLgorICogICAgICAtRVBFUk0gICAgICAgOiAgIEdlbmVyYWwgZmFpbHVyZS4KKyAqICBSZXF1aXJlczoKKyAqICAgICAgUFJPQyBJbml0aWFsaXplZC4KKyAqICBFbnN1cmVzOgorICogIERldGFpb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ICAgOiAgIFB0ciB0byBEU1Agc2lkZSByZXNlcnZlZCB1OCBhZGRyZXNzLgorICogIFJldHVybnM6CisgKiAgICAgIDAJIDogICBTdWNjZXNzLgorICogICAgICAtRUZBVUxUICAgICA6ICAgSW52YWxpZCBwcm9jZXNzb3IgaGFuZGxlLgorICogICAgICAtRVBFUk0gICAgICAgOiAgIEdlbmVyYWwgZmFpbHVyZS4KKyAqICAgICAgLUVOT01FTSAgICAgOiAgIENhbm5vdCByZXNlcnZlIGNodW5rIG9mIHRoaXMgc2l6ZS4KKyAqICBSZXF1aXJlczoKKyAqICAgICAgcHBfcnN2X2FkZHIgaXMgbm90IE5VTEwKKyAqICAgICAgUFJPQyBJbml0aWFsaXplZC4KKyAqICBFbnN1cmVzOgorICogIERldGFpbHM6CisgKi8KK2V4dGVybiBpbnQgcHJvY19yZXNlcnZlX21lbW9yeSh2b2lkICpocHJvY2Vzc29yLAorCQkJCSAgICAgIHUzMiB1bF9zaXplLCB2b2lkICoqcHBfcnN2X2FkZHIsCisJCQkJICAgICAgc3RydWN0IHByb2Nlc3NfY29udGV4dCAqcHJfY3R4dCk7CisKKy8qCisgKiAgPT09PT09PT0gcHJvY191bl9tYXAgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBSZW1vdmVzIGEgTVBVIGJ1ZmZlciBtYXBwaW5nIGZyb20gdGhlIERTUCBhZGRyZXNzIHNwYWNlLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIGhwcm9jZXNzb3IgICAgICA6ICAgVGhlIHByb2Nlc3NvciBoYW5kbGUuCisgKiAgICAgIG1hcF9hZGRyCTogICBTdGFydGluZyBhZGRyZXNzIG9mIHRoZSBtYXBwZWQgbWVtb3J5IHJlZ2lvbi4KKyAqICBSZXR1cm5zOgorICogICAgICAwCSA6ICAgU3VjY2Vzcy4KKyAqICAgICAgLUVGQVVMVCAgICAgOiAgIEludmFsaWQgcHJvY2Vzc29yIGhhbmRsZS4KKyAqICAgICAgLUVQRVJNICAgICAgIDogICBHZW5lcmFsIGZhaWx1cmUuCisgKiAgICAgIC1FTk9FTlQgICA6ICAgQ2Fubm90IGZpbmQgYSBtYXBwZWQgcmVnaW9uIHN0YXJ0aW5nIHdpdGggdGhpcworICoJCSAgICAgIDogICBhZGRyZXNzLgorICogIFJlcXVpcmVzOgorICogICAgICBtYXBfYWRkciBpcyBub3QgTlVMTAorICogICAgICBQUk9DIEluaXRpYWxpemVkLgorICogIEVuc3VyZXM6CisgKiAgRGV0YWlsczoKKyAqLworZXh0ZXJuIGludCBwcm9jX3VuX21hcCh2b2lkICpocHJvY2Vzc29yLCB2b2lkICptYXBfYWRkciwKKwkJCSAgICAgIHN0cnVjdCBwcm9jZXNzX2NvbnRleHQgKnByX2N0eHQpOworCisvKgorICogID09PT09PT09IHByb2NfdW5fcmVzZXJ2ZV9tZW1vcnkgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBGcmVlcyBhIHByZXZpb3VzbHkgcmVzZXJ2ZWQgcmVnaW9uIG9mIERTUCBhZGRyZXNzIHNwYWNlLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIGhwcm9jZXNzb3IgICAgICA6ICAgVGhlIHByb2Nlc3NvciBoYW5kbGUuCisgKiAgICAgIHByc3ZfYWRkcgk6ICAgUHRyIHRvIERTUCBzaWRlIHJlc2VydmVkQllURSBhZGRyZXNzLgorICogIFJldHVybnM6CisgKiAgICAgIDAJIDogICBTdWNjZXNzLgorICogICAgICAtRUZBVUxUICAgICA6ICAgSW52YWxpZCBwcm9jZXNzb3IgaGFuZGxlLgorICogICAgICAtRVBFUk0gICAgICAgOiAgIEdlbmVyYWwgZmFpbHVyZS4KKyAqICAgICAgLUVOT0VOVCAgIDogICBDYW5ub3QgZmluZCBhIHJlc2VydmVkIHJlZ2lvbiBzdGFydGluZyB3aXRoIHRoaXMKKyAqCQkgICAgICA6ICAgYWRkcmVzcy4KKyAqICBSZXF1aXJlczoKKyAqICAgICAgcHJzdl9hZGRyIGl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XBseSBwdXQgdGhlIERTUCBpbiBkZWVwIHNsZWVwLikKKyAqCisgKgl0aW1lb3V0OiAgICAgICAgICAgIE1heGltdW0gdGltZSAobXNlYykgdGhhdCBQV1Igc2hvdWxkIHdhaXQgZm9yCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlybWF0aW9uIHRoYXQgdGhlIERTUCBzbGVlcCBzdGF0ZSBoYXMgYmVlbgorICogICAgICAgICAgICAgICAgICAgICAgICAgIHJlYWNoZWQuICBJZiBQV1Igc2hvdWxkIHNpbXBseSBzZW5kIHRoZSBjb21tYW5kIHRvCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIERTUCB0byBnbyB0byBzbGVlcCBhbmQgdGhlbiByZXR1cm4gKGkuZS4sCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgYXN5bmNocm91bm91cyBzbGVlcCksIHRoZSB0aW1lb3V0IHNob3VsZCBiZQorICogICAgICAgICAgICAgICAgICAgICAgICAgIHNwZWNpZmllZCBhcyB6ZXJvLgorICoKKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgICAgIFN1Y2Nlc3MuCisgKiAgICAgIDA6IFN1Y2Nlc3MsIGJ1dCB0aGUgRFNQIHdhcyBhbHJlYWR5IGFzbGVlcC4KKyAqICAgICAgLUVJTlZBTDogICAgVGhlIHNwZWNpZmllZCBzbGVlcF9jb2RlIGlzIG5vdCBzdXBwb3J0ZWQuCisgKiAgICAgIC1FVElNRTogICAgICAgQSB0aW1lb3V0IG9jY3VyZWQgd2hpbGUgd2FpdGluZyBmb3IgRFNQIHNsZWVwCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlybWF0aW9uLgorICogICAgICAtRVBFUk06ICAgICAgICAgIEdlbmVyYWwgZmFpbHVyZSwgdW5hYmxlIHRvIHNlbmQgc2xlZXAgY29tbWFuZCB0bworICogICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBEU1AuCisgKi8KK2V4dGVybiBpbnQgcHdyX3NsZWVwX2RzcChjb25zdCB1MzIgc2xlZXBfY29kZSwgY29uc3QgdTMyIHRpbWVvdXQpOworCisvKgorICogID09PT09PT09IHB3cl93YWtlX2RzcCA9PT09PT09PQorICogICAgU2lnbmFsIHRoZSBEU1AgdG8gd2FrZSBmcm9tIHNsZWVwLgorICoKKyAqICBQYXJhbWV0ZXJzOgorICoJdGltZW91dDogICAgICAgICAgICBNYXhpbXVtIHRpbWUgKG1zZWMpIHRoYXQgUFdSIHNob3VsZCB3YWl0IGZvcgorICogICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpcm1hdGlvbiB0aGF0IHRoZSBEU1AgaXMgYXdha2UuICBJZiBQV1Igc2hvdWxkCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgc2ltcGx5IHNlbmQgYSBjb21tYW5kIHRvIHRoZSBEU1AgdG8gd2FrZSBhbmQgdGhlbgorICogICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAoaS5lLiwgYXN5bmNocm91bm91cyB3YWtlKSwgdGltZW91dCBzaG91bGQKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICBiZSBzcGVjaWZpZWQgYXMgemVyby4KKyAqCisgKiAgUmV0dXJuczoKKyAqICAgICAgMDogICAgICAgICAgICBTdWNjZXNzLgorICogICAgICAwOiAgU3VjY2VzcywgYnV0IHRoZSBEU1Agd2FzIGFscmVhZHkgYXdha2UuCisgKiAgICAgIC1FVElNRTogICAgICAgQSB0aW1lb3V0IG9jY3VyZWQgd2hpbGUgd2FpdGluZyBmb3Igd2FrZQorICogICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpcm1hdGlvbi4KKyAqICAgICAgLUVQRVJNOiAgICAgICAgICBHZW5lcmFsIGZhaWx1cmUsIHVuYWJsZSB0byBzZW5kIHdha2UgY29tbWFuZCB0bworICogICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBEU1AuCisgKi8KK2V4dGVybiBpbnQgcHdyX3dha2VfZHNwKGNvbnN0IHUzMiB0aW1lb3V0KTsKKworLyoKKyAqICA9PT09PT09PSBwd3JfcG1fcHJlX3NjYWxlID09PT09PT09CisgKiAgICBQcmVzY2FsZSBub3RpZmljYXRpb24gdG8gRFNQLgorICoKKyAqICBQYXJhbWV0ZXJzOgorICoJdm9sdGFnZV9kb21haW46ICAgVGhlIHZvbHRhZ2UgZG9tYWluIGZvciB3aGljaCBub3RpZmljYXRpb24gaXMgc2VudAorICogICAgbGV2ZWw6CQkJVGhlIGxldmVsIG9mIHZvbHRhZ2UgZG9tYWluCisgKgorICogIFJldHVybnM6CisgKiAgICAgIDA6ICAgICAgICAgICAgU3VjY2Vzcy4KKyAqICAgICAgMDogIFN1Y2Nlc3MsIGJ1dCB0aGUgRFNQIHdhcyBhbHJlYWR5IGF3YWtlLgorICogICAgICAtRVRJTUU6ICAgICAgIEEgdGltZW91dCBvY2N1cmVkIHdoaWxlIHdhaXRpbmcgZm9yIHdha2UKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maXJtYXRpb24uCisgKiAgICAgIC1FUEVSTTogICAgICAgICAgR2VuZXJhbCBmYWlsdXJlLCB1bmFibGUgdG8gc2VuZCB3YWtlIGNvbW1hbmQgdG8KKyAqICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgRFNQLgorICovCitleHRlcm4gaW50IHB3cl9wbV9wcmVfc2NhbGUodTE2IHZvbHRhZ2VfZG9tYWluLCB1MzIgbGV2ZWwpOworCisvKgorICogID09PT09PT09IHB3cl9wbV9wb3N0X3NjYWxlID09PT09PT09CisgKiAgICBQb3N0U2NhbGUgbm90aWZpY2F0aW9uIHRvIERTUC4KKyAqCisgKiAgUGFyYW1ldGVyczoKKyAqCXZvbHRhZ2VfZG9tYWluOiAgIFRoZSB2b2x0YWdlIGRvbWFpbiBmb3Igd2hpY2ggbm90aWZpY2F0aW9uIGlzIHNlbnQKKyAqICAgIGxldmVsOgkJCVRoZSBsZXZlbCBvZiB2b2x0YWdlIGRvbWFpbgorIC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ciA9PT09PT09PQorICogIERTUCBhZGRyZXNzICsgc2VnaWQKKyAqLworc3RydWN0IHJtbV9hZGRyIHsKKwl1MzIgYWRkcjsKKwlzMzIgc2VnaWQ7Cit9OworCisvKgorICogID09PT09PT09IHJtbV9zZWdtZW50ID09PT09PT09CisgKiAgTWVtb3J5IHNlZ21lbnQgb24gdGhlIERTUCBhdmFpbGFibGUgZm9yIHJlbW90ZSBhbGxvY2F0aW9ucy4KKyAqLworc3RydWN0IHJtbV9zZWdtZW50IHsKKwl1MzIgYmFzZTsJCS8qIEJhc2Ugb2YgdGhlIHNlZ21lbnQgKi8KKwl1MzIgbGVuZ3RoOwkJLyogU2l6ZSBvZiB0aGUgc2VnbWVudCAodGFyZ2V0IE1BVXMpICovCisJczMyIHNwYWNlOwkJLyogQ29kZSBvciBkYXRhICovCisJdTMyIG51bWJlcjsJCS8qIE51bWJlciBvZiBBbGxvY2F0ZWQgQmxvY2tzICovCit9OworCisvKgorICogID09PT09PT09IFJNTV9UYXJnZXQgPT09PT09PT0KKyAqLworc3RydWN0IHJtbV90YXJnZXRfb2JqOworCisvKgorICogID09PT09PT09IHJtbV9hbGxvYyA9PT09PT09PQorICoKKyAqICBybW1fYWxsb2MgaXMgdXNlZCB0byByZW1vdGVseSBhbGxvY2F0ZSBvciByZXNlcnZlIG1lbW9yeSBvbiB0aGUgRFNQLgorICoKKyAqICBQYXJhbWV0ZXJzOgorICogICAgICB0YXJnZXQgICAgICAgICAgLSBUYXJnZXQgcmV0dXJuZWQgZnJvbSBybW1fY3JlYXRlKCkuCisgKiAgICAgIHNlZ2lkICAgICAgICAgICAtIE1lbW9yeSBzZWdtZW50IHRvIGFsbG9jYXRlIGZyb20uCisgKiAgICAgIHNpemUgICAgICAgICAgICAtIFNpemUgKHRhcmdldCBNQVVTKSB0byBhbGxvY2F0ZS4KKyAqICAgICAgYWxpZ24gICAgICAgICAgIC0gYWxpZ25tZW50LgorICogICAgICBkc3BfYWRkcmVzcyAgICAgLSBJZiByZ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W9yeSBzZWdtZW50cyBmb3IgcmVtb3RlIGFsbG9jYXRpb24uIElmCisgKiAgc2VnX3RhYiA9PSBOVUxMIG9yIG51bV9zZWdzID09IDAsIG1lbW9yeSBjYW4gb25seSBiZSByZXNlcnZlZCB0aHJvdWdoCisgKiAgcm1tX2FsbG9jKCkuCisgKgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIHRhcmdldF9vYmo6ICAgICAgICAtIExvY2F0aW9uIHRvIHN0b3JlIHRhcmdldCBvbiBvdXRwdXQuCisgKiAgICAgIHNlZ190YWI6ICAgICAgICAgLSBUYWJsZSBvZiBtZW1vcnkgc2VnbWVudHMuCisgKiAgICAgIG51bV9zZWdzOiAgICAgICAgLSBOdW1iZXIgb2YgbWVtb3J5IHNlZ21lbnRzLgorICogIFJldHVybnM6CisgKiAgICAgIDA6ICAgICAgICBTdWNjZXNzLgorICogICAgICAtRU5PTUVNOiAgICBNZW1vcnkgYWxsb2NhdGlvbiBmYWlsZWQuCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIFJNTSBpbml0aWFsaXplZC4KKyAqICAgICAgdGFyZ2V0X29iaiAhPSBOVUxMLgorICogICAgICBudW1fc2VncyA9PSAwIHx8IHNlZ190YWIgIT0gTlVMTC4KKyAqICBFbnN1cmVzOgorICogICAgICBTdWNjZXNzOiAgICAgICAgVmFsaWQgKnRhcmdldF9vYmouCisgKiAgICAgIEZhaWx1cmU6ICAgICAgICAqdGFyZ2V0X29iaiA9PSBOVUxMLgorICovCitleHRlcm4gaW50IHJtbV9jcmVhdGUoc3RydWN0IHJtbV90YXJnZXRfb2JqICoqdGFyZ2V0X29iaiwKKwkJCSAgICAgc3RydWN0IHJtbV9zZWdtZW50IHNlZ190YWJbXSwgdTMyIG51bV9zZWdzKTsKKworLyoKKyAqICA9PT09PT09PSBybW1fZGVsZXRlID09PT09PT09CisgKiAgRGVsZXRlIHRhcmdldCBhbGxvY2F0ZWQgaW4gcm1tX2NyZWF0ZSgpLgorICoKKyAq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BzdHJlYW0gaGF2ZSBub3QKKyAqICAgICAgICAgICAgICAgICAgICAgIGJlZW4gcmVjbGFpbWVkLgorICogICAgICAtRVBFUk06ICAgICAgRmFpbHVyZSB0byBjbG9zZSBzdHJlYW0uCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIHN0cm1faW5pdCh2b2lkKSBjYWxsZWQuCisgKiAgRW5zdXJlczoKKyAqLworZXh0ZXJuIGludCBzdHJtX2Nsb3NlKHN0cnVjdCBzdHJtX3Jlc19vYmplY3QgKnN0cm1yZXMsCisJCQkgICAgIHN0cnVjdCBwcm9jZXNzX2NvbnRleHQgKnByX2N0eHQpOworCisvKgorICogID09PT09PT09IHN0cm1fY3JlYXRlID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgQ3JlYXRlIGEgU1RSTSBtYW5hZ2VyIG9iamVjdC4gVGhpcyBvYmplY3QgaG9sZHMgaW5mb3JtYXRpb24gYWJvdXQgdGhlCisgKiAgICAgIGRldmljZSBuZWVkZWQgdG8gb3BlbiBzdHJlYW1zLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIHN0cm1fbWFuOiAgICAgICBMb2NhdGlvbiB0byBzdG9yZSBoYW5kbGUgdG8gU1RSTSBtYW5hZ2VyIG9iamVjdCBvbgorICogICAgICAgICAgICAgICAgICAgICAgb3V0cHV0LgorICogICAgICBkZXZfb2JqOiAgICAgICAgICAgRGV2aWNlIGZvciB0aGlzIHByb2Nlc3Nvci4KKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgU3VjY2VzczsKKyAqICAgICAgLUVOT01FTTogICAgSW5zdWZmaWNpZW50IG1lbW9yeSBmb3IgcmVxdWVzdGVkIHJlc291cmNlcy4KKyAqICAgICAgLUVQRVJNOiAgICAgIEdlbmVyYWwgZmFpbHVyZS4KKyAqICBSZXF1aXJlczoKKyAqICAgICAgc3RybV9pbml0KHZvaWQpIGNhbGxlZC4KKyAqICAgICAgc3RybV9tYW4gIT0gTlVMTC4KKy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pb24gaXMgdXNlZCB3aGVuIGNsb3NpbmcKKyAqICAgICAgYSBzdHJlYW0sIHNvIHRoZSBldmVudCBjYW4gYmUgY2xvc2VkLgorICogIFBhcmFtZXRlcjoKKyAqICAgICAgc3RyZWFtX29iajogICAgICBTdHJlYW0gaGFuZGxlIHJldHVybmVkIGZyb20gc3RybV9vcGVuKCkuCisgKiAgICAgIHBoX2V2ZW50OiAgICAgICAgTG9jYXRpb24gdG8gc3RvcmUgZXZlbnQgaGFuZGxlIG9uIG91dHB1dC4KKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgU3VjY2Vzcy4KKyAqICAgICAgLUVGQVVMVDogICAgSW52YWxpZCBzdHJlYW1fb2JqLgorICogIFJlcXVpcmVzOgorICogICAgICBzdHJtX2luaXQodm9pZCkgY2FsbGVkLgorICogICAgICBwaF9ldmVudCAhPSBOVUxMLgorICogIEVuc3VyZXM6CisgKi8KK2V4dGVybiBpbnQgc3RybV9nZXRfZXZlbnRfaGFuZGxlKHN0cnVjdCBzdHJtX29iamVjdCAqc3RyZWFtX29iaiwKKwkJCQkJdm9pZCAqKnBoX2V2ZW50KTsKKworLyoKKyAqICA9PT09PT09PSBzdHJtX2dldF9pbmZvID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgR2V0IGluZm9ybWF0aW9uIGFib3V0IGEgc3RyZWFtLiBVc2VyJ3MgZHNwX3N0cmVhbWluZm8gaXMgY29udGFpbmVkCisgKiAgICAgIGluIHN0cmVhbV9pbmZvIHN0cnVjdC4gc3RyZWFtX2luZm8gYWxzbyBjb250YWlucyBCcmlkZ2UgcHJpdmF0ZSBpbmZvLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIHN0cmVhbV9vYmo6ICAgICAgICAgU3RyZWFtIGhhbmRsZSByZXR1cm5lZCBmcm9tIHN0cm1fb3BlbigpLgorICogICAgICBzdHJlYW1faW5mbzogICAgICAgIExvY2F0aW9uIHRvIHN0b3JlIHN0cmVhbSBpbmZv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mVzOgorICovCitleHRlcm4gaW50IHN0cm1faXNzdWUoc3RydWN0IHN0cm1fb2JqZWN0ICpzdHJlYW1fb2JqLCB1OCAqIHBidWYsCisJCQkgICAgIHUzMiB1bF9ieXRlcywgdTMyIHVsX2J1Zl9zaXplLCB1MzIgZHdfYXJnKTsKKworLyoKKyAqICA9PT09PT09PSBzdHJtX29wZW4gPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBPcGVuIGEgc3RyZWFtIGZvciBzZW5kaW5nL3JlY2VpdmluZyBkYXRhIGJ1ZmZlcnMgdG8vZnJvbSBhIHRhc2sgb2YKKyAqICAgICAgREFJUyBzb2NrZXQgbm9kZSBvbiB0aGUgRFNQLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIGhub2RlOiAgICAgICAgICBOb2RlIGhhbmRsZSByZXR1cm5lZCBmcm9tIG5vZGVfYWxsb2NhdGUoKS4KKyAqICAgICAgZGlyOiAgICAgICAgICAgRFNQX1RPTk9ERSBvciBEU1BfRlJPTU5PREUuCisgKiAgICAgIGluZGV4OiAgICAgICAgIFN0cmVhbSBpbmRleC4KKyAqICAgICAgcGF0dHI6ICAgICAgICAgIFBvaW50ZXIgdG8gc3RydWN0dXJlIGNvbnRhaW5pbmcgYXR0cmlidXRlcyB0byBiZQorICogICAgICAgICAgICAgICAgICAgICAgYXBwbGllZCB0byBzdHJlYW0uIENhbm5vdCBiZSBOVUxMLgorICogICAgICBzdHJtcmVzOiAgICAgTG9jYXRpb24gdG8gc3RvcmUgc3RyZWFtIHJlc3VvcmNlIGluZm8gaGFuZGxlIG9uIG91dHB1dC4KKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgU3VjY2Vzcy4KKyAqICAgICAgLUVGQVVMVDogICAgSW52YWxpZCBobm9kZS4KKyAqICAgICAgLUVQRVJNOiBJbnZhbGlkIGRpcmVjdGlvbi4KKyAqICAgICAgICAgICAgICBobm9kZSBpcyBub3QgYSB0YXNrIG9yIERBSVMgc29ja2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hdCB0cmF2ZWxzIHdpdGgKKyAqICAgICAgICAgICAgICAgICAgICAgIHRoZSBidWZmZXIgd2lsbCBiZSB3cml0dGVuLgorICogIFJldHVybnM6CisgKiAgICAgIDA6ICAgICAgICBTdWNjZXNzLgorICogICAgICAtRUZBVUxUOiAgICBJbnZhbGlkIHN0cmVhbV9vYmouCisgKiAgICAgIC1FVElNRTogICBBIHRpbWVvdXQgb2NjdXJyZWQgYmVmb3JlIGEgYnVmZmVyIGNvdWxkIGJlCisgKiAgICAgICAgICAgICAgICAgICAgICByZXRyaWV2ZWQuCisgKiAgICAgIC1FUEVSTTogICAgICBGYWlsdXJlIG9jY3VycmVkLCB1bmFibGUgdG8gcmVjbGFpbSBidWZmZXIuCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIHN0cm1faW5pdCh2b2lkKSBjYWxsZWQuCisgKiAgICAgIGJ1Zl9wdHIgIT0gTlVMTC4KKyAqICAgICAgbmJ5dGVzICE9IE5VTEwuCisgKiAgICAgIHBkd19hcmcgIT0gTlVMTC4KKyAqICBFbnN1cmVzOgorICovCitleHRlcm4gaW50IHN0cm1fcmVjbGFpbShzdHJ1Y3Qgc3RybV9vYmplY3QgKnN0cmVhbV9vYmosCisJCQkgICAgICAgdTggKipidWZfcHRyLCB1MzIgKiBuYnl0ZXMsCisJCQkgICAgICAgdTMyICpidWZmX3NpemUsIHUzMiAqcGR3X2FyZyk7CisKKy8qCisgKiAgPT09PT09PT0gc3RybV9yZWdpc3Rlcl9ub3RpZnkgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBSZWdpc3RlciB0byBiZSBub3RpZmllZCBvbiBzcGVjaWZpYyBldmVudHMgZm9yIHRoaXMgc3RyZWFtLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIHN0cmVhbV9vYmo6ICAgICBTdHJlYW0gaGFuZGxlIHJldHVybmVkIGJ5IHN0cm1fb3BlbigpLgorICogICAgICBldmVudF9tYXNrOiAgICAgTWFzayBvZiB0eXBlcyBvZiBldmVudHMgdG8gYmUgbm90aWZpZWQgYWJvdXQuCisgKiAgICAgIG5vdGlmeV90eXBlOiAgICBUeXBlIG9mIG5vdGlmaWNhdGlvbiB0byBiZSBzZW50LgorICogICAgICBobm90aWZpY2F0aW9uOiAgSGFuZGxlIHRvIGJlIHVzZWQgZm9yIG5vdGlmaWNhdGlvbi4KKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgU3VjY2Vzcy4KKyAqICAgICAgLUVGQVVMVDogICAgSW52YWxpZCBzdHJlYW1fb2JqLgorICogICAgICAtRU5PTUVNOiAgICBJbnN1ZmZpY2llbnQgbWVtb3J5IG9uIEdQUC4KKyAqICAgICAgLUVJTlZBTDogICAgIGV2ZW50X21hc2sgaXMgaW52YWxpZC4KKyAqICAgICAgLUVOT1NZUzogICBOb3RpZmljYXRpb24gdHlwZSBzcGVjaWZpZWQgYnkgbm90aWZ5X3R5cGUgaXMgbm90CisgKiAgICAgICAgICAgICAgICAgICAgICBzdXBwb3J0ZWQuCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIHN0cm1faW5pdCh2b2lkKSBjYWxsZWQuCisgKiAgICAgIGhub3RpZmljYXRpb24gIT0gTlVMTC4KKyAqICBFbnN1cmVzOgorICovCitleHRlcm4gaW50IHN0cm1fcmVnaXN0ZXJfbm90aWZ5KHN0cnVjdCBzdHJtX29iamVjdCAqc3RyZWFtX29iaiwKKwkJCQkgICAgICAgdTMyIGV2ZW50X21hc2ssIHUzMiBub3RpZnlfdHlwZSwKKwkJCQkgICAgICAgc3RydWN0IGRzcF9ub3RpZmljYXRpb24KKwkJCQkgICAgICAgKmhub3RpZmljYXRpb24pOworCisvKgorICogID09PT09PT09IHN0cm1fc2VsZWN0ID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgU2VsZWN0IGEgcmVhZHkgc3RyZWFtLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIHN0cm1fdGFiOiAgICAgICBBcnJheSBvZiBzdHJlYW0gaGFuZGxlcyByZXR1cm5lZCBmcm9tIHN0cm1fb3BlbigpLgorICogICAgICBzdHJtczogICAgICAgICAgTnVtYmVyIG9mIHN0cmVhbSBoYW5kbGVzIGluIGFycmF5LgorICogICAgICBwbWFzazogICAgICAgICAgTG9jYXRpb24gdG8gc3RvcmUgbWFzayBvZiByZWFkeSBzdHJlYW1zIG9uIG91dHB1dC4KKyAqICAgICAgdXRpbWVvdXQ6ICAgICAgIFRpbWVvdXQgdmFsdWUgKG1pbGxpc2Vjb25kcykuCisgKiAgUmV0dXJuczoKKyAqICAgICAgMDogICAgICAgIFN1Y2Nlc3MuCisgKiAgICAgIC1FRE9NOiAgICAgc3RybXMgb3V0IG9mIHJhbmdlLgorCisgKiAgICAgIC1FRkFVTFQ6ICAgIEludmFsaWQgc3RyZWFtIGhhbmRsZSBpbiBhcnJheS4KKyAqICAgICAgLUVUSU1FOiAgIEEgdGltZW91dCBvY2N1cnJlZCBiZWZvcmUgYSBzdHJlYW0gYmVjYW1lIHJlYWR5LgorICogICAgICAtRVBFUk06ICAgICAgRmFpbHVyZSBvY2N1cnJlZCwgdW5hYmxlIHRvIHNlbGVjdCBhIHN0cmVhbS4KKyAqICBSZXF1aXJlczoKKyAqICAgICAgc3RybV9pbml0KHZvaWQpIGNhbGxlZC4KKyAqICAgICAgc3RybV90YWIgIT0gTlVMTC4KKyAqICAgICAgc3RybXMgPiAwLgorICogICAgICBwbWFzayAhPSBOVUxMLgorICogIEVuc3VyZXM6CisgKiAgICAgIDA6ICAgICAgICAqcG1hc2sgIT0gMCB8fCB1dGltZW91dCA9PSAwLgorICogICAgICBFcnJvcjogICAgICAgICAgKnBtYXNrID09IDAuCisgKi8KK2V4dGVybiBpbnQgc3RybV9zZWxlY3Qoc3RydWN0IHN0cm1fb2JqZWN0ICoqc3RybV90YWIsCisJCQkgICAgICB1MzIgc3RybXMsIHUzMiAqcG1hc2ssIHUzMiB1dGltZW91dCk7CisKKy8qCisgKiAgPT09PT09PT0gc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VydHMgYSBkc3BfdXVpZCB0byBhbiBBTlNJIHN0cmluZy4KKyAqICBQYXJhbWV0ZXJzOgorICogICAgICB1dWlkX29iajogICAgICBQb2ludGVyIHRvIGEgZHNwX3V1aWQgb2JqZWN0LgorICogICAgICBzel91dWlkOiAgICBQb2ludGVyIHRvIGEgYnVmZmVyIHRvIHJlY2VpdmUgYSBOVUxMLXRlcm1pbmF0ZWQgVVVJRAorICogICAgICAgICAgICAgICAgICBzdHJpbmcuCisgKiAgICAgIHNpemU6CSAgICBNYXhpbXVtIHNpemUgb2YgdGhlIHN6X3V1aWQgc3RyaW5nLgorICogIFJldHVybnM6CisgKiAgUmVxdWlyZXM6CisgKiAgICAgIHV1aWRfb2JqICYgc3pfdXVpZCBhcmUgbm9uLU5VTEwgdmFsdWVzLgorICogIEVuc3VyZXM6CisgKiAgICAgIExlbmdodGggb2Ygc3pfdXVpZCBpcyBsZXNzIHRoYW4gTUFYVVVJRExFTi4KKyAqICBEZXRhaWxzOgorICogICAgICBVVUlEIHN0cmluZyBsaW1pdCBjdXJyZW50bHkgc2V0IGF0IE1BWFVVSURMRU4uCisgKi8KK3ZvaWQgdXVpZF91dWlkX3RvX3N0cmluZyhzdHJ1Y3QgZHNwX3V1aWQgKnV1aWRfb2JqLCBjaGFyICpzel91dWlkLAorCQkJIHMzMiBzaXplKTsKKworLyoKKyAqICA9PT09PT09PSB1dWlkX3V1aWRfZnJvbV9zdHJpbmcgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBDb252ZXJ0cyBhbiBBTlNJIHN0cmluZyB0byBhIGRzcF91dWlkLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIHN6X3V1aWQ6ICAgIFBvaW50ZXIgdG8gYSBzdHJpbmcgdGhhdCByZXByZXNlbnRzIGEgZHNwX3V1aWQgb2JqZWN0LgorICogICAgICB1dWlkX29iajogICAgICBQb2ludGVyIHRvIGEgZHNwX3V1aWQgb2JqZWN0LgorICogIFJldHVybnM6CisgKiAg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3Igc3RydWN0dXJlICovCisJCQljaG5sX21ncl9vYmogPSAoc3RydWN0IGNobmxfbWdyXyAqKWhjaG5sX21ncjsKKwkJCWNobmxfbWdyX29iai0+aW50Zl9meG5zID0gaW50Zl9meG5zOworCQkJLyogRmluYWxseSwgcmV0dXJuIHRoZSBuZXcgY2hhbm5lbCBtYW5hZ2VyIGhhbmRsZTogKi8KKwkJCSpjaGFubmVsX21nciA9IGhjaG5sX21ncjsKKwkJfQorCX0KKworCURCQ19FTlNVUkUoc3RhdHVzIHx8IGNobmxfbWdyX29iaik7CisKKwlyZXR1cm4gc3RhdHVzOworfQorCisvKgorICogID09PT09PT09IGNobmxfZGVzdHJveSA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIENsb3NlIGFsbCBvcGVuIGNoYW5uZWxzLCBhbmQgZGVzdHJveSB0aGUgY2hhbm5lbCBtYW5hZ2VyLgorICovCitpbnQgY2hubF9kZXN0cm95KHN0cnVjdCBjaG5sX21nciAqaGNobmxfbWdyKQoreworCXN0cnVjdCBjaG5sX21ncl8gKmNobmxfbWdyX29iaiA9IChzdHJ1Y3QgY2hubF9tZ3JfICopaGNobmxfbWdyOworCXN0cnVjdCBicmlkZ2VfZHJ2X2ludGVyZmFjZSAqaW50Zl9meG5zOworCWludCBzdGF0dXM7CisKKwlEQkNfUkVRVUlSRShyZWZzID4gMCk7CisKKwlpZiAoY2hubF9tZ3Jfb2JqKSB7CisJCWludGZfZnhucyA9IGNobmxfbWdyX29iai0+aW50Zl9meG5zOworCQkvKiBMZXQgQnJpZGdlIGNoYW5uZWwgbW9kdWxlIGRlc3Ryb3kgdGhlIGNobmxfbWdyOiAqLworCQlzdGF0dXMgPSAoKmludGZfZnhucy0+cGZuX2NobmxfZGVzdHJveSkgKGhjaG5sX21ncik7CisJfSBlbHNlIHsKKwkJc3RhdHVzID0gLUVGQVVMVDsKKwl9CisKKwlyZXR1cm4gc3RhdHVzOworfQorCisvKgorICogID09PT09PT09IGNobmxfZXh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zdHJ1Y3QgZGV2X29iamVjdCAqaGRldl9vYmo7CisKKwlEQkNfUkVRVUlSRShyZWZzID4gMCk7CisJREJDX1JFUVVJUkUocGhfY21tX21nciAhPSBOVUxMKTsKKwlpZiAoaHByb2Nlc3NvciAhPSBOVUxMKQorCQlzdGF0dXMgPSBwcm9jX2dldF9kZXZfb2JqZWN0KGhwcm9jZXNzb3IsICZoZGV2X29iaik7CisJZWxzZQorCQloZGV2X29iaiA9IGRldl9nZXRfZmlyc3QoKTsJLyogZGVmYXVsdCAqLworCisJaWYgKCFzdGF0dXMpCisJCXN0YXR1cyA9IGRldl9nZXRfY21tX21ncihoZGV2X29iaiwgcGhfY21tX21ncik7CisKKwlyZXR1cm4gc3RhdHVzOworfQorCisvKgorICogID09PT09PT09IGNtbV9nZXRfaW5mbyA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIFJldHVybiB0aGUgY3VycmVudCBtZW1vcnkgdXRpbGl6YXRpb24gaW5mb3JtYXRpb24uCisgKi8KK2ludCBjbW1fZ2V0X2luZm8oc3RydWN0IGNtbV9vYmplY3QgKmhjbW1fbWdyLAorCQkJc3RydWN0IGNtbV9pbmZvICpjbW1faW5mb19vYmopCit7CisJc3RydWN0IGNtbV9vYmplY3QgKmNtbV9tZ3Jfb2JqID0gKHN0cnVjdCBjbW1fb2JqZWN0ICopaGNtbV9tZ3I7CisJdTMyIHVsX3NlZzsKKwlpbnQgc3RhdHVzID0gMDsKKwlzdHJ1Y3QgY21tX2FsbG9jYXRvciAqYWx0cjsKKwlzdHJ1Y3QgY21tX21ub2RlICptbm9kZV9vYmogPSBOVUxMOworCisJREJDX1JFUVVJUkUoY21tX2luZm9fb2JqICE9IE5VTEwpOworCisJaWYgKCFoY21tX21ncikgeworCQlzdGF0dXMgPSAtRUZBVUxUOworCQlyZXR1cm4gc3RhdHVzOworCX0KKwltdXRleF9sb2NrKCZjbW1fbWdyX29iai0+Y21tX2xvY2spOworCWNtbV9pbmZvX29iai0+dWxf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xldGUobWdyX25ldyk7CisJCXJldHVybiAtRVNQSVBFOworCX0KKworCS8qIHJldHVybiB0aGUgbmV3IG1hbmFnZXIgKi8KKwkqbWdyID0gbWdyX25ldzsKKworCXJldHVybiAwOworfQorCisvKgorICogID09PT09PT09IGNvZF9kZWxldGUgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBEZWxldGUgYSBjb2RlIG1hbmFnZXIgb2JqZWN0LgorICovCit2b2lkIGNvZF9kZWxldGUoc3RydWN0IGNvZF9tYW5hZ2VyICpjb2RfbWdyX29iaikKK3sKKwlEQkNfUkVRVUlSRShyZWZzID4gMCk7CisJREJDX1JFUVVJUkUoY29kX21ncl9vYmopOworCisJaWYgKGNvZF9tZ3Jfb2JqLT5iYXNlX2xpYikgeworCQlpZiAoY29kX21ncl9vYmotPmxvYWRlZCkKKwkJCWNvZF9tZ3Jfb2JqLT5meG5zLnVubG9hZF9meG4oY29kX21ncl9vYmotPmJhc2VfbGliLAorCQkJCQkJCSZjb2RfbWdyX29iai0+YXR0cnMpOworCisJCWNvZF9tZ3Jfb2JqLT5meG5zLmNsb3NlX2Z4bihjb2RfbWdyX29iai0+YmFzZV9saWIpOworCX0KKwlpZiAoY29kX21ncl9vYmotPnRhcmdldCkgeworCQljb2RfbWdyX29iai0+Znhucy5kZWxldGVfZnhuKGNvZF9tZ3Jfb2JqLT50YXJnZXQpOworCQljb2RfbWdyX29iai0+Znhucy5leGl0X2Z4bigpOworCX0KKwlrZnJlZShjb2RfbWdyX29iaik7Cit9CisKKy8qCisgKiAgPT09PT09PT0gY29kX2V4aXQgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBEaXNjb250aW51ZSB1c2FnZSBvZiB0aGUgQ09EIG1vZHVsZS4KKyAqCisgKi8KK3ZvaWQgY29kX2V4aXQodm9pZCkKK3sKKwlEQkNfUkVRVUlSRShyZWZzID4gMCk7CisKKwlyZWZzLS07CisKKwlEQkNfRU5TVVJFKHJlZnMgPj0gMCk7Cit9CisKKy8qCisgKiAgPT09PT09PT0gY29kX2dldF9iYXNlX2xpYiA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIEdldCBoYW5kbGUgdG8gdGhlIGJhc2UgaW1hZ2UgREJMIGxpYnJhcnkuCisgKi8KK2ludCBjb2RfZ2V0X2Jhc2VfbGliKHN0cnVjdCBjb2RfbWFuYWdlciAqY29kX21ncl9vYmosCisJCQkgICAgc3RydWN0IGRibGxfbGlicmFyeV9vYmogKipwbGliKQoreworCWludCBzdGF0dXMgPSAwOworCisJREJDX1JFUVVJUkUocmVmcyA+IDApOworCURCQ19SRVFVSVJFKGNvZF9tZ3Jfb2JqKTsKKwlEQkNfUkVRVUlSRShwbGliICE9IE5VTEwpOworCisJKnBsaWIgPSAoc3RydWN0IGRibGxfbGlicmFyeV9vYmogKiljb2RfbWdyX29iai0+YmFzZV9saWI7CisKKwlyZXR1cm4gc3RhdHVzOworfQorCisvKgorICogID09PT09PT09IGNvZF9nZXRfYmFzZV9uYW1lID09PT09PT09CisgKi8KK2ludCBjb2RfZ2V0X2Jhc2VfbmFtZShzdHJ1Y3QgY29kX21hbmFnZXIgKmNvZF9tZ3Jfb2JqLCBjaGFyICpzel9uYW1lLAorCQkJICAgICB1MzIgdXNpemUpCit7CisJaW50IHN0YXR1cyA9IDA7CisKKwlEQkNfUkVRVUlSRShyZWZzID4gMCk7CisJREJDX1JFUVVJUkUoY29kX21ncl9vYmopOworCURCQ19SRVFVSVJFKHN6X25hbWUgIT0gTlVMTCk7CisKKwlpZiAodXNpemUgPD0gQ09EX01BWFBBVEhMRU5HVEgpCisJCXN0cm5jcHkoc3pfbmFtZSwgY29kX21ncl9vYmotPnN6X3psX2ZpbGUsIHVzaXplKTsKKwllbHNlCisJCXN0YXR1cyA9IC1FUEVSTTsKKworCXJldHVybiBzdGF0dXM7Cit9CisKKy8qCisgKiAgPT09PT09PT0gY29kX2dldF9lbnRyeSA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICA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9fZnVuY19fLCBsaWIsIG5hbWUsIHBhZGRyLCBwc2l6ZSwgc3RhdHVzKTsKKworCXJldHVybiBzdGF0dXM7Cit9CisKKy8qCisgKiAgPT09PT09PT0gZGJsbF9pbml0ID09PT09PT09CisgKi8KK2Jvb2wgZGJsbF9pbml0KHZvaWQpCit7CisJREJDX1JFUVVJUkUocmVmcyA+PSAwKTsKKworCWlmIChyZWZzID09IDApCisJCWdoX2luaXQoKTsKKworCXJlZnMrKzsKKworCXJldHVybiB0cnVlOworfQorCisvKgorICogID09PT09PT09IGRibGxfbG9hZCA9PT09PT09PQorICovCitpbnQgZGJsbF9sb2FkKHN0cnVjdCBkYmxsX2xpYnJhcnlfb2JqICpsaWIsIGRibGxfZmxhZ3MgZmxhZ3MsCisJCSAgICAgc3RydWN0IGRibGxfYXR0cnMgKmF0dHJzLCB1MzIgKmVudHJ5KQoreworCXN0cnVjdCBkYmxsX2xpYnJhcnlfb2JqICp6bF9saWIgPSAoc3RydWN0IGRibGxfbGlicmFyeV9vYmogKilsaWI7CisJc3RydWN0IGRibGxfdGFyX29iaiAqZGJ6bDsKKwlib29sIGdvdF9zeW1ib2xzID0gdHJ1ZTsKKwlzMzIgZXJyOworCWludCBzdGF0dXMgPSAwOworCWJvb2wgb3BlbmVkX2RvZmYgPSBmYWxzZTsKKwlEQkNfUkVRVUlSRShyZWZzID4gMCk7CisJREJDX1JFUVVJUkUoemxfbGliKTsKKwlEQkNfUkVRVUlSRShlbnRyeSAhPSBOVUxMKTsKKwlEQkNfUkVRVUlSRShhdHRycyAhPSBOVUxMKTsKKworCS8qCisJICogIExvYWQgaWYgbm90IGFscmVhZHkgbG9hZGVkLgorCSAqLworCWlmICh6bF9saWItPmxvYWRfcmVmID09IDAgfHwgIShmbGFncyAmIERCTExfRFlOQU1JQykpIHsKKwkJZGJ6bCA9IHpsX2xpYi0+dGFyZ2V0X29iajsKKwkJZGJ6bC0+YXR0cnMgPSAqYXR0cnM7CisJCS8qIENyZWF0ZSBhI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BPUworCSAqIHJlc291cmNlcyAqLworCWRvZl9jbG9zZSh6bF9saWIpOworZnVuY19lbmQ6CisJREJDX0VOU1VSRSh6bF9saWItPmxvYWRfcmVmID49IDApOworfQorCisvKgorICogID09PT09PT09IGRibGxfdW5sb2FkX3NlY3QgPT09PT09PT0KKyAqICBOb3Qgc3VwcG9ydGVkIGZvciBDT0ZGLgorICovCitpbnQgZGJsbF91bmxvYWRfc2VjdChzdHJ1Y3QgZGJsbF9saWJyYXJ5X29iaiAqbGliLCBjaGFyICpzZWNfbmFtZSwKKwkJCSAgICBzdHJ1Y3QgZGJsbF9hdHRycyAqYXR0cnMpCit7CisJREJDX1JFUVVJUkUocmVmcyA+IDApOworCURCQ19SRVFVSVJFKHNlY19uYW1lICE9IE5VTEwpOworCisJcmV0dXJuIC1FTk9TWVM7Cit9CisKKy8qCisgKiAgPT09PT09PT0gZG9mX2Nsb3NlID09PT09PT09CisgKi8KK3N0YXRpYyB2b2lkIGRvZl9jbG9zZShzdHJ1Y3QgZGJsbF9saWJyYXJ5X29iaiAqemxfbGliKQoreworCWlmICh6bF9saWItPmRlc2MpIHsKKwkJZGxvYWRfbW9kdWxlX2Nsb3NlKHpsX2xpYi0+ZGVzYyk7CisJCXpsX2xpYi0+ZGVzYyA9IE5VTEw7CisJfQorCS8qIGNsb3NlIGZpbGUgKi8KKwlpZiAoemxfbGliLT5mcCkgeworCQkoemxfbGliLT50YXJnZXRfb2JqLT5hdHRycy5mY2xvc2UpICh6bF9saWItPmZwKTsKKwkJemxfbGliLT5mcCA9IE5VTEw7CisJfQorfQorCisvKgorICogID09PT09PT09IGRvZl9vcGVuID09PT09PT09CisgKi8KK3N0YXRpYyBpbnQgZG9mX29wZW4oc3RydWN0IGRibGxfbGlicmFyeV9vYmogKnpsX2xpYikKK3sKKwl2b2lkICpvcGVuID0gKih6bF9saWItPnRhcmdldF9vYmotPmF0dHJzLmZvcGVuKTsKKwlpbnQgc3RhdHVzID0gMDsKKworCS8qIEZpcnN0I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CX0KKworCXJldCA9IGhhc2ggJSBtYXhfYnVja2V0OworCisJcmV0dXJuIHJldDsKK30KKworLyoKKyAqICA9PT09PT09PSBuYW1lX21hdGNoID09PT09PT09CisgKi8KK3N0YXRpYyBib29sIG5hbWVfbWF0Y2godm9pZCAqa2V5LCB2b2lkICpzcCkKK3sKKwlEQkNfUkVRVUlSRShrZXkgIT0gTlVMTCk7CisJREJDX1JFUVVJUkUoc3AgIT0gTlVMTCk7CisKKwlpZiAoKGtleSAhPSBOVUxMKSAmJiAoc3AgIT0gTlVMTCkpIHsKKwkJaWYgKHN0cmNtcCgoY2hhciAqKWtleSwgKChzdHJ1Y3QgZGJsbF9zeW1ib2wgKilzcCktPm5hbWUpID09CisJCSAgICAwKQorCQkJcmV0dXJuIHRydWU7CisJfQorCXJldHVybiBmYWxzZTsKK30KKworLyoKKyAqICA9PT09PT09PSBub19vcCA9PT09PT09PQorICovCitzdGF0aWMgaW50IG5vX29wKHN0cnVjdCBkeW5hbWljX2xvYWRlcl9pbml0aWFsaXplICp0aGlzcHRyLCB2b2lkICpidWZyLAorCQkgbGRyX2FkZHIgbG9jbiwgc3RydWN0IGxkcl9zZWN0aW9uX2luZm8gKmluZm8sIHVuc2lnbmVkIGJ5dHNpemUpCit7CisJcmV0dXJuIDE7Cit9CisKKy8qCisgKiAgPT09PT09PT0gc3ltX2RlbGV0ZSA9PT09PT09PQorICovCitzdGF0aWMgdm9pZCBzeW1fZGVsZXRlKHZvaWQgKnZhbHVlKQoreworCXN0cnVjdCBkYmxsX3N5bWJvbCAqc3AgPSAoc3RydWN0IGRibGxfc3ltYm9sICopdmFsdWU7CisKKwlrZnJlZShzcC0+bmFtZSk7Cit9CisKKy8qCisgKiAgRHluYW1pYyBMb2FkZXIgRnVuY3Rpb25zCisgKi8KKworLyogZHluYW1pY19sb2FkZXJfc3RyZWFtICovCisvKgorICogID09PT09PT09IGRibGxfcmVhZF9idWZmZXIgPT09PT09PT0KKyAqLworc3RhdGljIGludCBkYmxs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Rldl9vYmotPmhub2RlX21nciA9IE5VTEw7CisKKwlEQkNfRU5TVVJFKCghc3RhdHVzICYmIGRldl9vYmotPmhub2RlX21nciAhPSBOVUxMKQorCQkgICB8fCAoc3RhdHVzICYmIGRldl9vYmotPmhub2RlX21nciA9PSBOVUxMKSk7CisJcmV0dXJuIHN0YXR1czsKK30KKworLyoKKyAqICA9PT09PT09PSBkZXZfZGVzdHJveTIgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBEZXN0cm95cyB0aGUgTm9kZSBtYW5hZ2VyIGZvciB0aGlzIGRldmljZS4KKyAqLworaW50IGRldl9kZXN0cm95MihzdHJ1Y3QgZGV2X29iamVjdCAqaGRldl9vYmopCit7CisJaW50IHN0YXR1cyA9IDA7CisJc3RydWN0IGRldl9vYmplY3QgKmRldl9vYmogPSBoZGV2X29iajsKKworCURCQ19SRVFVSVJFKHJlZnMgPiAwKTsKKwlEQkNfUkVRVUlSRShoZGV2X29iaik7CisKKwlpZiAoZGV2X29iai0+aG5vZGVfbWdyKSB7CisJCWlmIChub2RlX2RlbGV0ZV9tZ3IoZGV2X29iai0+aG5vZGVfbWdyKSkKKwkJCXN0YXR1cyA9IC1FUEVSTTsKKwkJZWxzZQorCQkJZGV2X29iai0+aG5vZGVfbWdyID0gTlVMTDsKKworCX0KKworCURCQ19FTlNVUkUoKCFzdGF0dXMgJiYgZGV2X29iai0+aG5vZGVfbWdyID09IE5VTEwpIHx8IHN0YXR1cyk7CisJcmV0dXJuIHN0YXR1czsKK30KKworLyoKKyAqICA9PT09PT09PSBkZXZfZGVzdHJveV9kZXZpY2UgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBEZXN0cm95cyB0aGUgY2hhbm5lbCBtYW5hZ2VyIGZvciB0aGlzIGRldmljZSwgaWYgYW55LCBjYWxscworICogICAgICBicmlkZ2VfZGV2X2Rlc3Ryb3koKSwgYW5kIHRoZW4gYXR0ZW1wdHMgdG8gdW5sb2FkIHRoZSBCcmlkZ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obWdyICE9IE5VTEwgJiYgKm1nciA9PSBOVUxMKSk7CisJcmV0dXJuIHN0YXR1czsKK30KKworLyoKKyAqICA9PT09PT09PSBkZXZfZ2V0X2NvZF9tZ3IgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBSZXRyaWV2ZSB0aGUgQ09EIG1hbmFnZXIgY3JlYXRlIGZvciB0aGlzIGRldmljZS4KKyAqLworaW50IGRldl9nZXRfY29kX21ncihzdHJ1Y3QgZGV2X29iamVjdCAqaGRldl9vYmosCisJCQkgICBzdHJ1Y3QgY29kX21hbmFnZXIgKipjb2RfbWdyKQoreworCWludCBzdGF0dXMgPSAwOworCXN0cnVjdCBkZXZfb2JqZWN0ICpkZXZfb2JqID0gaGRldl9vYmo7CisKKwlEQkNfUkVRVUlSRShyZWZzID4gMCk7CisJREJDX1JFUVVJUkUoY29kX21nciAhPSBOVUxMKTsKKworCWlmIChoZGV2X29iaikgeworCQkqY29kX21nciA9IGRldl9vYmotPmNvZF9tZ3I7CisJfSBlbHNlIHsKKwkJKmNvZF9tZ3IgPSBOVUxMOworCQlzdGF0dXMgPSAtRUZBVUxUOworCX0KKworCURCQ19FTlNVUkUoIXN0YXR1cyB8fCAoY29kX21nciAhPSBOVUxMICYmICpjb2RfbWdyID09IE5VTEwpKTsKKwlyZXR1cm4gc3RhdHVzOworfQorCisvKgorICogID09PT09PT09PSBkZXZfZ2V0X2RlaF9tZ3IgPT09PT09PT0KKyAqLworaW50IGRldl9nZXRfZGVoX21ncihzdHJ1Y3QgZGV2X29iamVjdCAqaGRldl9vYmosCisJCQkgICBzdHJ1Y3QgZGVoX21nciAqKmRlaF9tYW5hZ2VyKQoreworCWludCBzdGF0dXMgPSAwOworCisJREJDX1JFUVVJUkUocmVmcyA+IDApOworCURCQ19SRVFVSVJFKGRlaF9tYW5hZ2VyICE9IE5VTEwpOworCURCQ19SRVFVSVJFKGhkZXZfb2JqKTsKKwlpZiAoaGRldl9vYmopIHsKKwkJKmRlaF9tYW5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3RydWN0IGRldl9vYmplY3QgKmhkZXZfb2JqLAorCQkJICBzdHJ1Y3QgaW9fbWdyICoqaW9fbWFuKQoreworCWludCBzdGF0dXMgPSAwOworCisJREJDX1JFUVVJUkUocmVmcyA+IDApOworCURCQ19SRVFVSVJFKGlvX21hbiAhPSBOVUxMKTsKKwlEQkNfUkVRVUlSRShoZGV2X29iaik7CisKKwlpZiAoaGRldl9vYmopIHsKKwkJKmlvX21hbiA9IGhkZXZfb2JqLT5oaW9fbWdyOworCX0gZWxzZSB7CisJCSppb19tYW4gPSBOVUxMOworCQlzdGF0dXMgPSAtRUZBVUxUOworCX0KKworCXJldHVybiBzdGF0dXM7Cit9CisKKy8qCisgKiAgPT09PT09PT0gZGV2X2dldF9uZXh0ID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgUmV0cmlldmUgdGhlIG5leHQgRGV2aWNlIE9iamVjdCBoYW5kbGUgZnJvbSBhbiBpbnRlcm5hbCBsaW5rZWQgbGlzdAorICogICAgICBvZiBERVZfT0JKRUNUcyBtYWludGFpbmVkIGJ5IERFViwgYWZ0ZXIgaGF2aW5nIHByZXZpb3VzbHkgY2FsbGVkCisgKiAgICAgIGRldl9nZXRfZmlyc3QoKSBhbmQgemVybyBvciBtb3JlIGRldl9nZXRfbmV4dAorICovCitzdHJ1Y3QgZGV2X29iamVjdCAqZGV2X2dldF9uZXh0KHN0cnVjdCBkZXZfb2JqZWN0ICpoZGV2X29iaikKK3sKKwlzdHJ1Y3QgZGV2X29iamVjdCAqbmV4dF9kZXZfb2JqZWN0ID0gTlVMTDsKKworCWlmIChoZGV2X29iaikgeworCQluZXh0X2Rldl9vYmplY3QgPSAoc3RydWN0IGRldl9vYmplY3QgKikKKwkJICAgIGRydl9nZXRfbmV4dF9kZXZfb2JqZWN0KCh1MzIpIGhkZXZfb2JqKTsKKwl9CisKKwlyZXR1cm4gbmV4dF9kZXZfb2JqZWN0OworfQorCisvKgorICogID09PT09PT09PSBkZXZfZ2V0X21zZ19tZ3IgPT09PT09PT0KKyAqLwordm9pZCBkZXZfZ2V0X21zZ19tZ3Ioc3RydWN0IGRldl9vYmplY3QgKmhkZXZfb2JqLCBzdHJ1Y3QgbXNnX21nciAqKm1zZ19tYW4pCit7CisJREJDX1JFUVVJUkUocmVmcyA+IDApOworCURCQ19SRVFVSVJFKG1zZ19tYW4gIT0gTlVMTCk7CisJREJDX1JFUVVJUkUoaGRldl9vYmopOworCisJKm1zZ19tYW4gPSBoZGV2X29iai0+aG1zZ19tZ3I7Cit9CisKKy8qCisgKiAgPT09PT09PT0gZGV2X2dldF9ub2RlX21hbmFnZXIgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBSZXRyaWV2ZSB0aGUgTm9kZSBNYW5hZ2VyIEhhbmRsZQorICovCitpbnQgZGV2X2dldF9ub2RlX21hbmFnZXIoc3RydWN0IGRldl9vYmplY3QgKmhkZXZfb2JqLAorCQkJCXN0cnVjdCBub2RlX21nciAqKm5vZGVfbWFuKQoreworCWludCBzdGF0dXMgPSAwOworCXN0cnVjdCBkZXZfb2JqZWN0ICpkZXZfb2JqID0gaGRldl9vYmo7CisKKwlEQkNfUkVRVUlSRShyZWZzID4gMCk7CisJREJDX1JFUVVJUkUobm9kZV9tYW4gIT0gTlVMTCk7CisKKwlpZiAoaGRldl9vYmopIHsKKwkJKm5vZGVfbWFuID0gZGV2X29iai0+aG5vZGVfbWdyOworCX0gZWxzZSB7CisJCSpub2RlX21hbiA9IE5VTEw7CisJCXN0YXR1cyA9IC1FRkFVTFQ7CisJfQorCisJREJDX0VOU1VSRSghc3RhdHVzIHx8IChub2RlX21hbiAhPSBOVUxMICYmICpub2RlX21hbiA9PSBOVUxMKSk7CisJcmV0dXJuIHN0YXR1czsKK30KKworLyoKKyAqICA9PT09PT09PSBkZXZfZ2V0X3N5bWJvbCA9PT09PT09PQorICovCitpbnQgZGV2X2dldF9zeW1ib2woc3RydWN0IGRldl9vYmplY3QgKmhkZXZfb2JqLAorCQkJICBj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V2X29iai0+aGJyaWRnZV9jb250ZXh0OworCX0gZWxzZSB7CisJCSpwaGJyaWRnZV9jb250ZXh0ID0gTlVMTDsKKwkJc3RhdHVzID0gLUVGQVVMVDsKKwl9CisKKwlEQkNfRU5TVVJFKCFzdGF0dXMgfHwgKChwaGJyaWRnZV9jb250ZXh0ICE9IE5VTEwpICYmCisJCQkJCSAgICAgKCpwaGJyaWRnZV9jb250ZXh0ID09IE5VTEwpKSk7CisJcmV0dXJuIHN0YXR1czsKK30KKworLyoKKyAqICA9PT09PT09PSBkZXZfZXhpdCA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIERlY3JlbWVudCByZWZlcmVuY2UgY291bnQsIGFuZCBmcmVlIHJlc291cmNlcyB3aGVuIHJlZmVyZW5jZSBjb3VudCBpcworICogICAgICAwLgorICovCit2b2lkIGRldl9leGl0KHZvaWQpCit7CisJREJDX1JFUVVJUkUocmVmcyA+IDApOworCisJcmVmcy0tOworCisJaWYgKHJlZnMgPT0gMCkgeworCQljbW1fZXhpdCgpOworCQlkbW1fZXhpdCgpOworCX0KKworCURCQ19FTlNVUkUocmVmcyA+PSAwKTsKK30KKworLyoKKyAqICA9PT09PT09PSBkZXZfaW5pdCA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIEluaXRpYWxpemUgREVWJ3MgcHJpdmF0ZSBzdGF0ZSwga2VlcGluZyBhIHJlZmVyZW5jZSBjb3VudCBvbiBlYWNoIGNhbGwuCisgKi8KK2Jvb2wgZGV2X2luaXQodm9pZCkKK3sKKwlib29sIGNtbV9yZXQsIGRtbV9yZXQsIHJldCA9IHRydWU7CisKKwlEQkNfUkVRVUlSRShyZWZzID49IDApOworCisJaWYgKHJlZnMgPT0gMCkgeworCQljbW1fcmV0ID0gY21tX2luaXQoKTsKKwkJZG1tX3JldCA9IGRtbV9pbml0KCk7CisKKwkJcmV0ID0gY21tX3JldCAmJiBkbW1fcmV0OworCisJCWlmICghcmV0KSB7CisJCQlpZiAoY21tX3JldCkKKwkJCQljbW1fZXhpdCgpOworCisJCQlpZiAoZG1tX3JldCkKKwkJCQlkbW1fZXhpdCgpOworCisJCX0KKwl9CisKKwlpZiAocmV0KQorCQlyZWZzKys7CisKKwlEQkNfRU5TVVJFKChyZXQgJiYgKHJlZnMgPiAwKSkgfHwgKCFyZXQgJiYgKHJlZnMgPj0gMCkpKTsKKworCXJldHVybiByZXQ7Cit9CisKKy8qCisgKiAgPT09PT09PT0gZGV2X25vdGlmeV9jbGllbnRzID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgTm90aWZ5IGFsbCBjbGllbnRzIG9mIHRoaXMgZGV2aWNlIG9mIGEgY2hhbmdlIGluIGRldmljZSBzdGF0dXMuCisgKi8KK2ludCBkZXZfbm90aWZ5X2NsaWVudHMoc3RydWN0IGRldl9vYmplY3QgKmhkZXZfb2JqLCB1MzIgcmV0KQoreworCWludCBzdGF0dXMgPSAwOworCisJc3RydWN0IGRldl9vYmplY3QgKmRldl9vYmogPSBoZGV2X29iajsKKwl2b2lkICpwcm9jX29iajsKKworCWZvciAocHJvY19vYmogPSAodm9pZCAqKWxzdF9maXJzdChkZXZfb2JqLT5wcm9jX2xpc3QpOworCSAgICAgcHJvY19vYmogIT0gTlVMTDsKKwkgICAgIHByb2Nfb2JqID0gKHZvaWQgKilsc3RfbmV4dChkZXZfb2JqLT5wcm9jX2xpc3QsCisJCQkJCSAoc3RydWN0IGxpc3RfaGVhZCAqKXByb2Nfb2JqKSkKKwkJcHJvY19ub3RpZnlfY2xpZW50cyhwcm9jX29iaiwgKHUzMikgcmV0KTsKKworCXJldHVybiBzdGF0dXM7Cit9CisKKy8qCisgKiAgPT09PT09PT0gZGV2X3JlbW92ZV9kZXZpY2UgPT09PT09PT0KKyAqLworaW50IGRldl9yZW1vdmVfZGV2aWNlKHN0cnVjdCBjZmdfZGV2bm9kZSAqZGV2X25vZGVfb2JqKQoreworCXN0cnVjdCBkZXZfb2JqZWN0ICpoZGV2X29iajsJ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IgPT0gaG1ncikpOworCXJldHVybiBzdGF0dXM7Cit9CisKKy8qCisgKiAgPT09PT09PT0gZGV2X3NldF9tc2dfbWdyID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgU2V0IHRoZSBtZXNzYWdlIG1hbmFnZXIgZm9yIHRoaXMgZGV2aWNlLgorICovCit2b2lkIGRldl9zZXRfbXNnX21ncihzdHJ1Y3QgZGV2X29iamVjdCAqaGRldl9vYmosIHN0cnVjdCBtc2dfbWdyICpobWdyKQoreworCURCQ19SRVFVSVJFKHJlZnMgPiAwKTsKKwlEQkNfUkVRVUlSRShoZGV2X29iaik7CisKKwloZGV2X29iai0+aG1zZ19tZ3IgPSBobWdyOworfQorCisvKgorICogID09PT09PT09IGRldl9zdGFydF9kZXZpY2UgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBJbml0aWFsaXplcyB0aGUgbmV3IGRldmljZSB3aXRoIHRoZSBCUklER0UgZW52aXJvbm1lbnQuCisgKi8KK2ludCBkZXZfc3RhcnRfZGV2aWNlKHN0cnVjdCBjZmdfZGV2bm9kZSAqZGV2X25vZGVfb2JqKQoreworCXN0cnVjdCBkZXZfb2JqZWN0ICpoZGV2X29iaiA9IE5VTEw7CS8qIGhhbmRsZSB0byAnQnJpZGdlIERldmljZSAqLworCS8qIEJyaWRnZSBkcml2ZXIgZmlsZW5hbWUgKi8KKwljaGFyIGJyaWRnZV9maWxlX25hbWVbQ0ZHX01BWFNFQVJDSFBBVEhMRU5dID0gIlVNQSI7CisJaW50IHN0YXR1czsKKwlzdHJ1Y3QgbWdyX29iamVjdCAqaG1ncl9vYmogPSBOVUxMOworCisJREJDX1JFUVVJUkUocmVmcyA+IDApOworCisJLyogR2l2ZW4gYWxsIHJlc291cmNlcywgY3JlYXRlIGEgZGV2aWNlIG9iamVjdC4gKi8KKwlzdGF0dXMgPSBkZXZfY3JlYXRlX2RldmljZSgmaGRldl9vYmosIGJyaWRnZV9maWxlX25hbWUsCisJCQkJICAg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fbWdyID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgQ3JlYXRlIGEgQ09EIG1hbmFnZXIgZm9yIHRoaXMgZGV2aWNlLgorICogIFBhcmFtZXRlcnM6CisgKiAgICAgIGRldl9vYmo6ICAgICAgICAgICAgIFBvaW50ZXIgdG8gZGV2aWNlIG9iamVjdCBjcmVhdGVkIHdpdGgKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGV2X2NyZWF0ZV9kZXZpY2UoKQorICogIFJldHVybnM6CisgKiAgICAgIDA6ICAgICAgICAgICAgICAgIFN1Y2Nlc3MuCisgKiAgICAgIC1FRkFVTFQ6ICAgICAgICAgICAgSW52YWxpZCBoZGV2X29iai4KKyAqICBSZXF1aXJlczoKKyAqICAgICAgU2hvdWxkIG9ubHkgYmUgY2FsbGVkIG9uY2UgYnkgZGV2X2NyZWF0ZV9kZXZpY2UoKSBmb3IgYSBnaXZlbiBEZXZPYmplY3QuCisgKiAgRW5zdXJlczoKKyAqLworc3RhdGljIGludCBpbml0X2NvZF9tZ3Ioc3RydWN0IGRldl9vYmplY3QgKmRldl9vYmopCit7CisJaW50IHN0YXR1cyA9IDA7CisJY2hhciAqc3pfZHVtbXlfZmlsZSA9ICJkdW1teSI7CisKKwlEQkNfUkVRVUlSRShyZWZzID4gMCk7CisJREJDX1JFUVVJUkUoIWRldl9vYmogfHwgKGRldl9vYmotPmNvZF9tZ3IgPT0gTlVMTCkpOworCisJc3RhdHVzID0gY29kX2NyZWF0ZSgmZGV2X29iai0+Y29kX21nciwgc3pfZHVtbXlfZmlsZSwgTlVMTCk7CisKKwlyZXR1cm4gc3RhdHVzOworfQorCisvKgorICogID09PT09PT09IGRldl9pbnNlcnRfcHJvY19vYmplY3QgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBJbnNlcnQgYSBQcm9jT2JqZWN0IGludG8gdGhlIGxpc3QgbWFpbnRhaW5lZCBieSBERVYuCisgKiAgUGFyYW1ldGVyczoKKyAqICAgICAgcF9wcm9jX29iamVjdDogICAgICAgIFB0ciB0byBQcm9jT2JqZWN0IHRvIGluc2VydC4KKyAqICAgICAgZGV2X29iajogICAgICAgICBQdHIgdG8gRGV2IE9iamVjdCB3aGVyZSB0aGUgbGlzdCBpcy4KKyAgKiAgICAgYWxyZWFkeV9hdHRhY2hlZDogIFB0ciB0byByZXR1cm4gdGhlIGJvb2wKKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgICAgSWYgc3VjY2Vzc2Z1bC4KKyAqICBSZXF1aXJlczoKKyAqICAgICAgTGlzdCBFeGlzdHMKKyAqICAgICAgaGRldl9vYmogaXMgVmFsaWQgaGFuZGxlCisgKiAgICAgIERFViBJbml0aWFsaXplZAorICogICAgICBhbHJlYWR5X2F0dGFjaGVkICE9IE5VTEwKKyAqICAgICAgcHJvY19vYmogIT0gMAorICogIEVuc3VyZXM6CisgKiAgICAgIDAgYW5kIExpc3QgaXMgbm90IEVtcHR5LgorICovCitpbnQgZGV2X2luc2VydF9wcm9jX29iamVjdChzdHJ1Y3QgZGV2X29iamVjdCAqaGRldl9vYmosCisJCQkJICB1MzIgcHJvY19vYmosIGJvb2wgKmFscmVhZHlfYXR0YWNoZWQpCit7CisJaW50IHN0YXR1cyA9IDA7CisJc3RydWN0IGRldl9vYmplY3QgKmRldl9vYmogPSAoc3RydWN0IGRldl9vYmplY3QgKiloZGV2X29iajsKKworCURCQ19SRVFVSVJFKHJlZnMgPiAwKTsKKwlEQkNfUkVRVUlSRShkZXZfb2JqKTsKKwlEQkNfUkVRVUlSRShwcm9jX29iaiAhPSAwKTsKKwlEQkNfUkVRVUlSRShkZXZfb2JqLT5wcm9jX2xpc3QgIT0gTlVMTCk7CisJREJDX1JFUVVJUkUoYWxyZWFkeV9hdHRhY2hlZCAhPSBOVUxMKTsKKwlpZiAoIUxTVF9JU19FTVBUWShkZXZfb2JqLT5wcm9jX2xpc3QpKQorCQkqYWxyZWFkeV9hdHRhY2hlZCA9IHRydWU7CisKKwkvKiBBZGQgRGV2T2JqZWN0IHRvIHRhaWwuICovCisJbHN0X3B1dF90YWlsKGRldl9vYmotPnByb2NfbGlzdCwgKHN0cnVjdCBsaXN0X2hlYWQgKilwcm9jX29iaik7CisKKwlEQkNfRU5TVVJFKCFzdGF0dXMgJiYgIUxTVF9JU19FTVBUWShkZXZfb2JqLT5wcm9jX2xpc3QpKTsKKworCXJldHVybiBzdGF0dXM7Cit9CisKKy8qCisgKiAgPT09PT09PT0gZGV2X3JlbW92ZV9wcm9jX29iamVjdCA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIFNlYXJjaCBmb3IgYW5kIHJlbW92ZSBhIFByb2Mgb2JqZWN0IGZyb20gdGhlIGdpdmVuIGxpc3QgbWFpbnRhaW5lZAorICogICAgICBieSB0aGUgREVWCisgKiAgUGFyYW1ldGVyczoKKyAqICAgICAgcF9wcm9jX29iamVjdDogICAgICAgIFB0ciB0byBQcm9jT2JqZWN0IHRvIGluc2VydC4KKyAqICAgICAgZGV2X29iaiAgICAgICAgICBQdHIgdG8gRGV2IE9iamVjdCB3aGVyZSB0aGUgbGlzdCBpcy4KKyAqICBSZXR1cm5zOgorICogICAgICAwOiAgICAgICAgICAgIElmIHN1Y2Nlc3NmdWwuCisgKiAgUmVxdWlyZXM6CisgKiAgICAgIExpc3QgZXhpc3RzIGFuZCBpcyBub3QgZW1wdHkKKyAqICAgICAgcHJvY19vYmogIT0gMAorICogICAgICBoZGV2X29iaiBpcyBhIHZhbGlkIERldiBoYW5kbGUuCisgKiAgRW5zdXJlczoKKyAqICBEZXRhaWxzOgorICogICAgICBMaXN0IHdpbGwgYmUgZGVsZXRlZCB3aGVuIHRoZSBERVYgaXMgZGVzdHJveWVkLgorICovCitpbnQgZGV2X3JlbW92ZV9wcm9jX29iamVjdChzdHJ1Y3QgZGV2X29iamVjdCAqaGRldl9vYmosIHUzMiBwcm9jX29iaikKK3sKKwlpbnQgc3RhdHVzID0gLUVQRVJNOworCXN0cnVj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tbV9tZ3I7CisJaW50IHN0YXR1cyA9IDA7CisKKwlEQkNfUkVRVUlSRShyZWZzID4gMCk7CisJaWYgKGRtbV9tZ3IpIHsKKwkJc3RhdHVzID0gZG1tX2RlbGV0ZV90YWJsZXMoZG1tX29iaik7CisJCWlmICghc3RhdHVzKQorCQkJa2ZyZWUoZG1tX29iaik7CisJfSBlbHNlCisJCXN0YXR1cyA9IC1FRkFVTFQ7CisKKwlyZXR1cm4gc3RhdHVzOworfQorCisvKgorICogID09PT09PT09IGRtbV9kZWxldGVfdGFibGVzID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgRGVsZXRlIERNTSBUYWJsZXMuCisgKi8KK2ludCBkbW1fZGVsZXRlX3RhYmxlcyhzdHJ1Y3QgZG1tX29iamVjdCAqZG1tX21ncikKK3sKKwlpbnQgc3RhdHVzID0gMDsKKworCURCQ19SRVFVSVJFKHJlZnMgPiAwKTsKKwkvKiBEZWxldGUgYWxsIERNTSB0YWJsZXMgKi8KKwlpZiAoZG1tX21ncikKKwkJdmZyZWUodmlydHVhbF9tYXBwaW5nX3RhYmxlKTsKKwllbHNlCisJCXN0YXR1cyA9IC1FRkFVTFQ7CisJcmV0dXJuIHN0YXR1czsKK30KKworLyoKKyAqICA9PT09PT09PSBkbW1fZXhpdCA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIERpc2NvbnRpbnVlIHVzYWdlIG9mIG1vZHVsZTsgZnJlZSByZXNvdXJjZXMgd2hlbiByZWZlcmVuY2UgY291bnQKKyAqICAgICAgcmVhY2hlcyAwLgorICovCit2b2lkIGRtbV9leGl0KHZvaWQpCit7CisJREJDX1JFUVVJUkUocmVmcyA+IDApOworCisJcmVmcy0tOworfQorCisvKgorICogID09PT09PT09IGRtbV9nZXRfaGFuZGxlID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgUmV0dXJuIHRoZSBkeW5hbWljIG1lbW9yeSBtYW5hZ2VyIG9iamVjdCBmb3IgdGhpcyBkZXZpY2UuCisgKiAgICAgIFRoaXMgaXMgdHlwaWNhbGx5IGNhbGxlZCBmcm9tIHRoZSBjbGllbnQgcHJvY2Vzcy4KKyAqLworaW50IGRtbV9nZXRfaGFuZGxlKHZvaWQgKmhwcm9jZXNzb3IsIHN0cnVjdCBkbW1fb2JqZWN0ICoqZG1tX21hbmFnZXIpCit7CisJaW50IHN0YXR1cyA9IDA7CisJc3RydWN0IGRldl9vYmplY3QgKmhkZXZfb2JqOworCisJREJDX1JFUVVJUkUocmVmcyA+IDApOworCURCQ19SRVFVSVJFKGRtbV9tYW5hZ2VyICE9IE5VTEwpOworCWlmIChocHJvY2Vzc29yICE9IE5VTEwpCisJCXN0YXR1cyA9IHByb2NfZ2V0X2Rldl9vYmplY3QoaHByb2Nlc3NvciwgJmhkZXZfb2JqKTsKKwllbHNlCisJCWhkZXZfb2JqID0gZGV2X2dldF9maXJzdCgpOwkvKiBkZWZhdWx0ICovCisKKwlpZiAoIXN0YXR1cykKKwkJc3RhdHVzID0gZGV2X2dldF9kbW1fbWdyKGhkZXZfb2JqLCBkbW1fbWFuYWdlcik7CisKKwlyZXR1cm4gc3RhdHVzOworfQorCisvKgorICogID09PT09PT09IGRtbV9pbml0ID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgSW5pdGlhbGl6ZXMgcHJpdmF0ZSBzdGF0ZSBvZiBETU0gbW9kdWxlLgorICovCitib29sIGRtbV9pbml0KHZvaWQpCit7CisJYm9vbCByZXQgPSB0cnVlOworCisJREJDX1JFUVVJUkUocmVmcyA+PSAwKTsKKworCWlmIChyZXQpCisJCXJlZnMrKzsKKworCURCQ19FTlNVUkUoKHJldCAmJiAocmVmcyA+IDApKSB8fCAoIXJldCAmJiAocmVmcyA+PSAwKSkpOworCisJdmlydHVhbF9tYXBwaW5nX3RhYmxlID0gTlVMTDsKKwl0YWJsZV9zaXplID0gMDsKKworCXJldHVybiByZXQ7Cit9CisKKy8qCisgKiAgPT09PT09PT0gZG1tX21hcF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ZtZ3IpCisJCQkJbWdyX2V4aXQoKTsKKworCQkJaWYgKGZzdHJtKQorCQkJCXN0cm1fZXhpdCgpOworCisJCQlpZiAoZnByb2MpCisJCQkJcHJvY19leGl0KCk7CisKKwkJCWlmIChmbm9kZSkKKwkJCQlub2RlX2V4aXQoKTsKKworCQkJaWYgKGZkaXNwKQorCQkJCWRpc3BfZXhpdCgpOworCisJCQlpZiAoZmNobmwpCisJCQkJY2hubF9leGl0KCk7CisKKwkJCWlmIChmbXNnKQorCQkJCW1zZ19leGl0KCk7CisKKwkJCWlmIChmaW8pCisJCQkJaW9fZXhpdCgpOworCisJCQlpZiAoZmRldikKKwkJCQlkZXZfZXhpdCgpOworCisJCQlpZiAoZmNvZCkKKwkJCQljb2RfZXhpdCgpOworCisJCQlpZiAoZnJtbSkKKwkJCQlybW1fZXhpdCgpOworCisJCX0KKwl9CisJaWYgKHJldCkKKwkJYXBpX2NfcmVmcysrOworCisJcmV0dXJuIHJldDsKK30KKworLyoKKyAqICA9PT09PT09PSBhcGlfaW5pdF9jb21wbGV0ZTIgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBQZXJmb3JtIGFueSByZXF1aXJlZCBicmlkZ2UgaW5pdGlhbGl6YXRpb24gd2hpY2ggY2Fubm90CisgKiAgICAgIGJlIHBlcmZvcm1lZCBpbiBhcGlfaW5pdCgpIG9yIGRldl9zdGFydF9kZXZpY2UoKSBkdWUKKyAqICAgICAgdG8gdGhlIGZhY3QgdGhhdCBzb21lIHNlcnZpY2VzIGFyZSBub3QgeWV0CisgKiAgICAgIGNvbXBsZXRlbHkgaW5pdGlhbGl6ZWQuCisgKiAgUGFyYW1ldGVyczoKKyAqICBSZXR1cm5zOgorICogICAgICAwOglBbGxvdyB0aGlzIGRldmljZSB0byBsb2FkCisgKiAgICAgIC1FUEVSTTogICAgICBGYWlsdXJlLgorICogIFJlcXVpcmVzOgorICogICAgICBCcmlkZ2UgQVBJIGluaXRpYWxpemVkLgorICogIEVuc3V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wkJCQkJYXJncy0+YXJnc19wcm9jX3VucnN2bWVtLnByc3ZfYWRkciwKKwkJCQkJcHJfY3R4dCk7CisJcmV0dXJuIHN0YXR1czsKK30KKworLyoKKyAqID09PT09PT09IHByb2N3cmFwX3N0b3AgPT09PT09PT0KKyAqLwordTMyIHByb2N3cmFwX3N0b3AodW5pb24gdHJhcHBlZF9hcmdzICphcmdzLCB2b2lkICpwcl9jdHh0KQoreworCXUzMiByZXQ7CisKKwlyZXQgPSBwcm9jX3N0b3AoKChzdHJ1Y3QgcHJvY2Vzc19jb250ZXh0ICopcHJfY3R4dCktPmhwcm9jZXNzb3IpOworCisJcmV0dXJuIHJldDsKK30KKworLyoKKyAqID09PT09PT09IGZpbmRfaGFuZGxlID09PT09PT09PQorICovCitpbmxpbmUgdm9pZCBmaW5kX25vZGVfaGFuZGxlKHN0cnVjdCBub2RlX3Jlc19vYmplY3QgKipub2RlcmVzLAorCQkJCXZvaWQgKnByX2N0eHQsIHZvaWQgKmhub2RlKQoreworCXJjdV9yZWFkX2xvY2soKTsKKwkqbm9kZXJlcyA9IGlkcl9maW5kKCgoc3RydWN0IHByb2Nlc3NfY29udGV4dCAqKXByX2N0eHQpLT5ub2RlX2lkLAorCQkJCQkJCQkoaW50KWhub2RlIC0gMSk7CisJcmN1X3JlYWRfdW5sb2NrKCk7CisJcmV0dXJuOworfQorCisKKy8qCisgKiA9PT09PT09PSBub2Rld3JhcF9hbGxvY2F0ZSA9PT09PT09PQorICovCit1MzIgbm9kZXdyYXBfYWxsb2NhdGUodW5pb24gdHJhcHBlZF9hcmdzICphcmdzLCB2b2lkICpwcl9jdHh0KQoreworCWludCBzdGF0dXMgPSAwOworCXN0cnVjdCBkc3BfdXVpZCBub2RlX3V1aWQ7CisJdTMyIGNiX2RhdGFfc2l6ZSA9IDA7CisJdTMyIF9fdXNlciAqcHNpemUgPSAodTMyIF9fdXNlciAqKSBhcmdzLT5hcmdzX25vZGVfYWxsb2NhdGUucGFyZ3M7CisJdTggK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ICogID09PT09PT09IGlvX2Rlc3Ryb3kgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBEZWxldGUgSU8gbWFuYWdlci4KKyAqLworaW50IGlvX2Rlc3Ryb3koc3RydWN0IGlvX21nciAqaGlvX21ncikKK3sKKwlzdHJ1Y3QgYnJpZGdlX2Rydl9pbnRlcmZhY2UgKmludGZfZnhuczsKKwlzdHJ1Y3QgaW9fbWdyXyAqcGlvX21nciA9IChzdHJ1Y3QgaW9fbWdyXyAqKWhpb19tZ3I7CisJaW50IHN0YXR1czsKKworCURCQ19SRVFVSVJFKHJlZnMgPiAwKTsKKworCWludGZfZnhucyA9IHBpb19tZ3ItPmludGZfZnhuczsKKworCS8qIExldCBCcmlkZ2UgY2hhbm5lbCBtb2R1bGUgZGVzdHJveSB0aGUgaW9fbWdyOiAqLworCXN0YXR1cyA9ICgqaW50Zl9meG5zLT5wZm5faW9fZGVzdHJveSkgKGhpb19tZ3IpOworCisJcmV0dXJuIHN0YXR1czsKK30KKworLyoKKyAqICA9PT09PT09PSBpb19leGl0ID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgRGlzY29udGludWUgdXNhZ2Ugb2YgdGhlIElPIG1vZHVsZS4KKyAqLwordm9pZCBpb19leGl0KHZvaWQpCit7CisJREJDX1JFUVVJUkUocmVmcyA+IDApOworCisJcmVmcy0tOworCisJREJDX0VOU1VSRShyZWZzID49IDApOworfQorCisvKgorICogID09PT09PT09IGlvX2luaXQgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBJbml0aWFsaXplIHRoZSBJTyBtb2R1bGUncyBwcml2YXRlIHN0YXRlLgorICovCitib29sIGlvX2luaXQodm9pZCkKK3sKKwlib29sIHJldCA9IHRydWU7CisKKwlEQkNfUkVRVUlSRShyZWZzID49IDApOworCisJaWYgKHJldCkKKwkJcmVmcysrOworCisJREJDX0VOU1VSRSgocmV0ICYmIChyZWZzID4gMCkpIHx8ICghcmV0ICYmIChyZWZzID49IDApK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29iai0+Y29kX21nciA9IGNvZF9tZ3I7CisKKwkJLyogUmV0dXJuIGhhbmRsZSB0byB0aGlzIERDRCBpbnRlcmZhY2UuICovCisJCSpkY2RfbWdyID0gZGNkX21ncl9vYmo7CisJfSBlbHNlIHsKKwkJc3RhdHVzID0gLUVOT01FTTsKKworCQkvKgorCQkgKiBJZiBhbGxvY2F0aW9uIG9mIERjZE1hbmFnZXIgb2JqZWN0IGZhaWxlZCwgZGVsZXRlIHRoZQorCQkgKiBDT0QgbWFuYWdlci4KKwkJICovCisJCWNvZF9kZWxldGUoY29kX21ncik7CisJfQorCisJREJDX0VOU1VSRSgoIXN0YXR1cykgfHwKKwkJCSgoZGNkX21ncl9vYmogPT0gTlVMTCkgJiYgKHN0YXR1cyA9PSAtRU5PTUVNKSkpOworCitmdW5jX2VuZDoKKwlyZXR1cm4gc3RhdHVzOworfQorCisvKgorICogID09PT09PT09IGRjZF9kZXN0cm95X21hbmFnZXIgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBGcmVlcyBEQ0QgTWFuYWdlciBvYmplY3QuCisgKi8KK2ludCBkY2RfZGVzdHJveV9tYW5hZ2VyKHN0cnVjdCBkY2RfbWFuYWdlciAqaGRjZF9tZ3IpCit7CisJc3RydWN0IGRjZF9tYW5hZ2VyICpkY2RfbWdyX29iaiA9IGhkY2RfbWdyOworCWludCBzdGF0dXMgPSAtRUZBVUxUOworCisJREJDX1JFUVVJUkUocmVmcyA+PSAwKTsKKworCWlmIChoZGNkX21ncikgeworCQkvKiBEZWxldGUgdGhlIENPRCBtYW5hZ2VyLiAqLworCQljb2RfZGVsZXRlKGRjZF9tZ3Jfb2JqLT5jb2RfbWdyKTsKKworCQkvKiBEZWFsbG9jYXRlIGEgRENEIG1hbmFnZXIgb2JqZWN0LiAqLworCQlrZnJlZShkY2RfbWdyX29iaik7CisKKwkJc3RhdHVzID0gMDsKKwl9CisKKwlyZXR1cm4gc3RhdHVzOworfQorCisvKgorICogID09PT09PT09IGR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GVuZCBvZiBlbnVtZXJhdGlvbi4gUmVzZXQgZW51bV9yZWZzLiAqLworCQkJZW51bV9yZWZzID0gMDsKKworCQkJLyoKKwkJCSAqIFRPRE86IFJldmlzaXQsIHRoaXMgaXMgbm90IGFuIGVycnJvciBjYXNlIGJ1dCBjb2RlCisJCQkgKiBleHBlY3RzIG5vbi16ZXJvIHZhbHVlLgorCQkJICovCisJCQlzdGF0dXMgPSBFTk9EQVRBOworCQl9IGVsc2UgeworCQkJc3RhdHVzID0gLUVQRVJNOworCQl9CisJfQorCisJREJDX0VOU1VSRSh1dWlkX29iaiB8fCAoc3RhdHVzID09IC1FUEVSTSkpOworCisJcmV0dXJuIHN0YXR1czsKK30KKworLyoKKyAqICA9PT09PT09PSBkY2RfZXhpdCA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIERpc2NvbnRpbnVlIHVzYWdlIG9mIHRoZSBEQ0QgbW9kdWxlLgorICovCit2b2lkIGRjZF9leGl0KHZvaWQpCit7CisJc3RydWN0IGRjZF9rZXlfZWxlbSAqcnYsICpydl90bXA7CisJREJDX1JFUVVJUkUocmVmcyA+IDApOworCisJcmVmcy0tOworCWlmIChyZWZzID09IDApIHsKKwkJY29kX2V4aXQoKTsKKwkJbGlzdF9mb3JfZWFjaF9lbnRyeV9zYWZlKHJ2LCBydl90bXAsICZyZWdfa2V5X2xpc3QsIGxpbmspIHsKKwkJCWxpc3RfZGVsKCZydi0+bGluayk7CisJCQlrZnJlZShydi0+cGF0aCk7CisJCQlrZnJlZShydik7CisJCX0KKwl9CisKKwlEQkNfRU5TVVJFKHJlZnMgPj0gMCk7Cit9CisKKy8qCisgKiAgPT09PT09PT0gZGNkX2dldF9kZXBfbGlicyA9PT09PT09PQorICovCitpbnQgZGNkX2dldF9kZXBfbGlicyhzdHJ1Y3QgZGNkX21hbmFnZXIgKmhkY2RfbWdyLAorCQkJICAgIHN0cnVjdCBkc3BfdXVpZCAqdXVpZF9vYmosCisJCQkgICAgdTE2IG51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YmplY3Qgb3BlcmF0aW9uLgorCSAqLworCXN0YXR1cyA9IGRjZF9yZWdpc3Rlcl9vYmplY3QodXVpZF9vYmosIG9ial90eXBlLCBOVUxMKTsKKworCXJldHVybiBzdGF0dXM7Cit9CisKKy8qCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogRENEIEhlbHBlciBGdW5jdGlvbnMKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKi8KKworLyoKKyAqICA9PT09PT09PSBhdG9pID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgVGhpcyBmdW5jdGlvbiBjb252ZXJ0cyBzdHJpbmdzIGluIGRlY2ltYWwgb3IgaGV4IGZvcm1hdCB0byBpbnRlZ2Vycy4KKyAqLworc3RhdGljIHMzMiBhdG9pKGNoYXIgKnBzel9idWYpCit7CisJY2hhciAqcGNoID0gcHN6X2J1ZjsKKwlzMzIgYmFzZSA9IDA7CisJdW5zaWduZWQgbG9uZyByZXM7CisJaW50IHJldF92YWw7CisKKwl3aGlsZSAoaXNzcGFjZSgqcGNoKSkKKwkJcGNoKys7CisKKwlpZiAoKnBjaCA9PSAnLScgfHwgKnBjaCA9PSAnKycpIHsKKwkJYmFzZSA9IDEwOworCQlwY2grKzsKKwl9IGVsc2UgaWYgKCpwY2ggJiYgdG9sb3dlcihwY2hbc3RybGVuKHBjaCkgLSAxXSkgPT0gJ2gnKSB7CisJCWJhc2UgPSAxNjsKKwl9CisKKwlyZXRfdmFsID0gc3RyaWN0X3N0cnRvdWwocGNoLCBiYXNlLCAmcmVzKTsKKworCXJldHVybiByZXRfdmFsID8gOiByZXM7Cit9CisKKy8qCisgKiAgPT09PT09PT0gZ2V0X2F0dHJzX2Zyb21fYnVmID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgUGFyc2UgdGhlIGN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iai0+dWxfYnVmc2l6ZSwgR0ZQX0tFUk5FTCk7CisJCWlmIChkaXNwX29iai0+cGJ1ZiA9PSBOVUxMKQorCQkJc3RhdHVzID0gLUVOT01FTTsKKwl9CitmdW5jX2NvbnQ6CisJaWYgKCFzdGF0dXMpCisJCSpkaXNwYXRjaF9vYmogPSBkaXNwX29iajsKKwllbHNlCisJCWRlbGV0ZV9kaXNwKGRpc3Bfb2JqKTsKKworCURCQ19FTlNVUkUoKHN0YXR1cyAmJiAqZGlzcGF0Y2hfb2JqID09IE5VTEwpIHx8CisJCQkJKCFzdGF0dXMgJiYgKmRpc3BhdGNoX29iaikpOworCXJldHVybiBzdGF0dXM7Cit9CisKKy8qCisgKiAgPT09PT09PT0gZGlzcF9kZWxldGUgPT09PT09PT0KKyAqICBEZWxldGUgdGhlIE5PREUgRGlzcGF0Y2hlci4KKyAqLwordm9pZCBkaXNwX2RlbGV0ZShzdHJ1Y3QgZGlzcF9vYmplY3QgKmRpc3Bfb2JqKQoreworCURCQ19SRVFVSVJFKHJlZnMgPiAwKTsKKwlEQkNfUkVRVUlSRShkaXNwX29iaik7CisKKwlkZWxldGVfZGlzcChkaXNwX29iaik7Cit9CisKKy8qCisgKiAgPT09PT09PT0gZGlzcF9leGl0ID09PT09PT09CisgKiAgRGlzY29udGludWUgdXNhZ2Ugb2YgRElTUCBtb2R1bGUuCisgKi8KK3ZvaWQgZGlzcF9leGl0KHZvaWQpCit7CisJREJDX1JFUVVJUkUocmVmcyA+IDApOworCisJcmVmcy0tOworCisJREJDX0VOU1VSRShyZWZzID49IDApOworfQorCisvKgorICogID09PT09PT09IGRpc3BfaW5pdCA9PT09PT09PQorICogIEluaXRpYWxpemUgdGhlIERJU1AgbW9kdWxlLgorICovCitib29sIGRpc3BfaW5pdCh2b2lkKQoreworCWJvb2wgcmV0ID0gdHJ1ZTsKKworCURCQ19SRVFVSVJFKHJlZnMgPj0gMCk7CisKKwlpZiAocmV0KQorCQlyZWZzKys7CisKKwlEQkNf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lkIGRydl9leGl0KHZvaWQpCit7CisJREJDX1JFUVVJUkUocmVmcyA+IDApOworCisJcmVmcy0tOworCisJREJDX0VOU1VSRShyZWZzID49IDApOworfQorCisvKgorICogID09PT09PT09ID0gZHJ2X2Rlc3Ryb3kgPT09PT09PT0gPQorICogIHB1cnBvc2U6CisgKiAgICAgIEludm9rZWQgZHVyaW5nIGJyaWRnZSBkZS1pbml0aWFsaXphdGlvbgorICovCitpbnQgZHJ2X2Rlc3Ryb3koc3RydWN0IGRydl9vYmplY3QgKmRyaXZlcl9vYmopCit7CisJaW50IHN0YXR1cyA9IDA7CisJc3RydWN0IGRydl9vYmplY3QgKnBkcnZfb2JqZWN0ID0gKHN0cnVjdCBkcnZfb2JqZWN0ICopZHJpdmVyX29iajsKKworCURCQ19SRVFVSVJFKHJlZnMgPiAwKTsKKwlEQkNfUkVRVUlSRShwZHJ2X29iamVjdCk7CisKKwkvKgorCSAqICBEZWxldGUgdGhlIExpc3QgaWYgaXQgZXhpc3RzLlNob3VsZCBub3QgY29tZSBoZXJlCisJICogIGFzIHRoZSBkcnZfcmVtb3ZlX2Rldl9vYmplY3QgYW5kIHRoZSBMYXN0IGRydl9yZXF1ZXN0X3Jlc291cmNlcworCSAqICByZW1vdmVzIHRoZSBsaXN0IGlmIHRoZSBsaXN0cyBhcmUgZW1wdHkuCisJICovCisJa2ZyZWUocGRydl9vYmplY3QtPmRldl9saXN0KTsKKwlrZnJlZShwZHJ2X29iamVjdC0+ZGV2X25vZGVfc3RyaW5nKTsKKwlrZnJlZShwZHJ2X29iamVjdCk7CisJLyogVXBkYXRlIHRoZSBEUlYgT2JqZWN0IGluIFJlZ2lzdHJ5IHRvIGJlIDAgKi8KKwkodm9pZCljZmdfc2V0X29iamVjdCgwLCBSRUdfRFJWX09CSkVDVCk7CisKKwlyZXR1cm4gc3RhdHVzOworfQorCisvKgorICogID09PT09PT09IGRydl9nZXRfZGV2X29iamVjdCA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiA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YXR1cyA9IC1FUEVSTTsKKwl9CisKKwlyZXR1cm4gc3RhdHVzOworfQorCisvKgorICogID09PT09PT09IGRydl9nZXRfZmlyc3RfZGV2X29iamVjdCA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIFJldHJpZXZlIHRoZSBmaXJzdCBEZXZpY2UgT2JqZWN0IGhhbmRsZSBmcm9tIGFuIGludGVybmFsIGxpbmtlZCBsaXN0IG9mCisgKiAgICAgIG9mIERFVl9PQkpFQ1RzIG1haW50YWluZWQgYnkgRFJWLgorICovCit1MzIgZHJ2X2dldF9maXJzdF9kZXZfb2JqZWN0KHZvaWQpCit7CisJdTMyIGR3X2Rldl9vYmplY3QgPSAwOworCXN0cnVjdCBkcnZfb2JqZWN0ICpwZHJ2X29iajsKKworCWlmICghY2ZnX2dldF9vYmplY3QoKHUzMiAqKSAmcGRydl9vYmosIFJFR19EUlZfT0JKRUNUKSkgeworCQlpZiAoKHBkcnZfb2JqLT5kZXZfbGlzdCAhPSBOVUxMKSAmJgorCQkgICAgIUxTVF9JU19FTVBUWShwZHJ2X29iai0+ZGV2X2xpc3QpKQorCQkJZHdfZGV2X29iamVjdCA9ICh1MzIpIGxzdF9maXJzdChwZHJ2X29iai0+ZGV2X2xpc3QpOworCX0KKworCXJldHVybiBkd19kZXZfb2JqZWN0OworfQorCisvKgorICogID09PT09PT09IERSVl9HZXRGaXJzdERldk5vZGVTdHJpbmcgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBSZXRyaWV2ZSB0aGUgZmlyc3QgRGV2aWNlIEV4dGVuc2lvbiBmcm9tIGFuIGludGVybmFsIGxpbmtlZCBsaXN0IG9mCisgKiAgICAgIG9mIFBvaW50ZXIgdG8gZGV2X25vZGUgU3RyaW5ncyBtYWludGFpbmVkIGJ5IERSVi4KKyAqLwordTMyIGRydl9nZXRfZmlyc3RfZGV2X2V4dGVuc2lvbih2b2lkKQoreworCXUzMiBkd19kZXZfZXh0ZW5zaW9uID0gMDsKK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ai0+ZGV2X25vZGVfc3RyaW5nKSkgeworCQkJZHdfZGV2X2V4dGVuc2lvbiA9CisJCQkgICAgKHUzMikgbHN0X25leHQocGRydl9vYmotPmRldl9ub2RlX3N0cmluZywKKwkJCQkJICAgKHN0cnVjdCBsaXN0X2hlYWQgKilkZXZfZXh0ZW5zaW9uKTsKKwkJfQorCX0KKworCXJldHVybiBkd19kZXZfZXh0ZW5zaW9uOworfQorCisvKgorICogID09PT09PT09IGRydl9pbml0ID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgSW5pdGlhbGl6ZSBEUlYgbW9kdWxlIHByaXZhdGUgc3RhdGUuCisgKi8KK2ludCBkcnZfaW5pdCh2b2lkKQoreworCXMzMiByZXQgPSAxOwkJLyogZnVuY3Rpb24gcmV0dXJuIHZhbHVlICovCisKKwlEQkNfUkVRVUlSRShyZWZzID49IDApOworCisJaWYgKHJldCkKKwkJcmVmcysrOworCisJREJDX0VOU1VSRSgocmV0ICYmIChyZWZzID4gMCkpIHx8ICghcmV0ICYmIChyZWZzID49IDApKSk7CisKKwlyZXR1cm4gcmV0OworfQorCisvKgorICogID09PT09PT09IGRydl9pbnNlcnRfZGV2X29iamVjdCA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIEluc2VydCBhIERldk9iamVjdCBpbnRvIHRoZSBsaXN0IG9mIE1hbmFnZXIgb2JqZWN0LgorICovCitpbnQgZHJ2X2luc2VydF9kZXZfb2JqZWN0KHN0cnVjdCBkcnZfb2JqZWN0ICpkcml2ZXJfb2JqLAorCQkJCSBzdHJ1Y3QgZGV2X29iamVjdCAqaGRldl9vYmopCit7CisJc3RydWN0IGRydl9vYmplY3QgKnBkcnZfb2JqZWN0ID0gKHN0cnVjdCBkcnZfb2JqZWN0ICopZHJpdmVyX29iajsKKworCURCQ19SRVFVSVJFKHJlZnMgPiAwKTsKKwlEQkNfUkVRVUlSRShoZGV2X29iaiAhPSBOVUxMKTsKKwlEQkNfUkVRVUlSRShwZHJ2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GSUdfVElEU1BCUklER0VfRFZGUworCWlmIChjcHVmcmVxX3VucmVnaXN0ZXJfbm90aWZpZXIoJml2YV9jbGtfbm90aWZpZXIsCisJCQkJCQlDUFVGUkVRX1RSQU5TSVRJT05fTk9USUZJRVIpKQorCQlwcl9lcnIoIiVzOiBjcHVmcmVxX3VucmVnaXN0ZXJfbm90aWZpZXIgZmFpbGVkIGZvciBpdmEyX2NrXG4iLAorCQkgICAgICAgX19mdW5jX18pOworI2VuZGlmIC8qICNpZmRlZiBDT05GSUdfVElEU1BCUklER0VfRFZGUyAqLworCisJaWYgKGRyaXZlcl9jb250ZXh0KSB7CisJCS8qIFB1dCB0aGUgRFNQIGluIHJlc2V0IHN0YXRlICovCisJCXJldCA9IGRzcF9kZWluaXQoZHJpdmVyX2NvbnRleHQpOworCQlkcml2ZXJfY29udGV4dCA9IDA7CisJCURCQ19BU1NFUlQocmV0ID09IHRydWUpOworCX0KKworZnVuY19jb250OgorCW1lbV9leHRfcGh5c19wb29sX3JlbGVhc2UoKTsKKworCWRzcF9jbGtfZXhpdCgpOworCXNlcnZpY2VzX2V4aXQoKTsKKworCWRldm5vID0gTUtERVYoZHJpdmVyX21ham9yLCAwKTsKKwljZGV2X2RlbCgmYnJpZGdlX2NkZXYpOworCXVucmVnaXN0ZXJfY2hyZGV2X3JlZ2lvbihkZXZubywgMSk7CisJaWYgKGJyaWRnZV9jbGFzcykgeworCQkvKiByZW1vdmUgdGhlIGRldmljZSBmcm9tIHN5c2ZzICovCisJCWRldmljZV9kZXN0cm95KGJyaWRnZV9jbGFzcywgTUtERVYoZHJpdmVyX21ham9yLCAwKSk7CisJCWNsYXNzX2Rlc3Ryb3koYnJpZGdlX2NsYXNzKTsKKworCX0KKwlyZXR1cm4gMDsKK30KKworI2lmZGVmIENPTkZJR19QTQorc3RhdGljIGludCBCUklER0VfU1VTUEVORChzdHJ1Y3QgcGxhdGZvcm1fZGV2aWNlICpwZGV2LCBwbV9tZXNzYWdlX3Qgc3RhdGU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bGUpCit7CisJaW50IHN0YXR1cyA9IC1FUEVSTTsKKwlzdHJ1Y3QgbWdyX29iamVjdCAqcG1ncl9vYmogPSAoc3RydWN0IG1ncl9vYmplY3QgKiltZ3JfaGFuZGxlOworCisJREJDX1JFUVVJUkUocmVmcyA+IDApOworCURCQ19SRVFVSVJFKGRjZF9oYW5kbGUgIT0gTlVMTCk7CisKKwkqZGNkX2hhbmRsZSA9ICh1MzIpIE5VTEw7CisJaWYgKHBtZ3Jfb2JqKSB7CisJCSpkY2RfaGFuZGxlID0gKHUzMikgcG1ncl9vYmotPmhkY2RfbWdyOworCQlzdGF0dXMgPSAwOworCX0KKwlEQkNfRU5TVVJFKCghc3RhdHVzICYmICpkY2RfaGFuZGxlICE9ICh1MzIpIE5VTEwpIHx8CisJCSAgIChzdGF0dXMgJiYgKmRjZF9oYW5kbGUgPT0gKHUzMikgTlVMTCkpOworCisJcmV0dXJuIHN0YXR1czsKK30KKworLyoKKyAqICA9PT09PT09PSBtZ3JfaW5pdCA9PT09PT09PQorICogICAgICBJbml0aWFsaXplIE1HUidzIHByaXZhdGUgc3RhdGUsIGtlZXBpbmcgYSByZWZlcmVuY2UgY291bnQgb24gZWFjaCBjYWxsLgorICovCitib29sIG1ncl9pbml0KHZvaWQpCit7CisJYm9vbCByZXQgPSB0cnVlOworCWJvb2wgaW5pdF9kY2QgPSBmYWxzZTsKKworCURCQ19SRVFVSVJFKHJlZnMgPj0gMCk7CisKKwlpZiAocmVmcyA9PSAwKSB7CisJCWluaXRfZGNkID0gZGNkX2luaXQoKTsJLyogIERDRCBNb2R1bGUgKi8KKworCQlpZiAoIWluaXRfZGNkKQorCQkJcmV0ID0gZmFsc2U7CisJfQorCisJaWYgKHJldCkKKwkJcmVmcysrOworCisJREJDX0VOU1VSRSgocmV0ICYmIChyZWZzID4gMCkpIHx8ICghcmV0ICYmIChyZWZzID49IDApKSk7CisKKwlyZXR1cm4gcmV0OworfQorCisvKgorICogID09PT09PT09IG1ncl93YWl0X2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1RBU0sgfHwgbm9kZV90eXBlID09IE5PREVfREFJU1NPQ0tFVCkgeworCQkJdGFza19hcmdfb2JqID0gJihobm9kZS0+Y3JlYXRlX2FyZ3MuYXNhLnRhc2tfYXJnX29iaik7CisJCQl0YXNrX2FyZ19vYmotPnByaW8gPSBwbmRiX3Byb3BzLT5wcmlvOworCQkJdGFza19hcmdfb2JqLT5zdGFja19zaXplID0gcG5kYl9wcm9wcy0+c3RhY2tfc2l6ZTsKKwkJCXRhc2tfYXJnX29iai0+c3lzX3N0YWNrX3NpemUgPQorCQkJICAgIHBuZGJfcHJvcHMtPnN5c19zdGFja19zaXplOworCQkJdGFza19hcmdfb2JqLT5zdGFja19zZWcgPSBwbmRiX3Byb3BzLT5zdGFja19zZWc7CisJCQlkZXZfZGJnKGJyaWRnZSwgIihub2RlKSBQcmlvcml0eTogMHgleCBTdGFjayBTaXplOiAiCisJCQkJIjB4JXggd29yZHMgU3lzdGVtIFN0YWNrIFNpemU6IDB4JXggd29yZHMgIgorCQkJCSJTdGFjayBTZWdtZW50OiAweCV4IHByb2ZpbGUgY291bnQgOiAweCV4XG4iLAorCQkJCXRhc2tfYXJnX29iai0+cHJpbywgdGFza19hcmdfb2JqLT5zdGFja19zaXplLAorCQkJCXRhc2tfYXJnX29iai0+c3lzX3N0YWNrX3NpemUsCisJCQkJdGFza19hcmdfb2JqLT5zdGFja19zZWcsCisJCQkJcG5kYl9wcm9wcy0+Y291bnRfcHJvZmlsZXMpOworCQl9CisJfQorCisJcmV0dXJuIHN0YXR1czsKK30KKworLyoKKyAqICA9PT09PT09PSBnZXRfcHJvY19wcm9wcyA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIFJldHJpZXZlIHRoZSBwcm9jZXNzb3IgcHJvcGVydGllcy4KKyAqLworc3RhdGljIGludCBnZXRfcHJvY19wcm9wcyhzdHJ1Y3Qgbm9kZV9tZ3IgKmhub2RlX21nciwKKwkJCQkgc3RydWN0IGRldl9vYmplY3QgKmhkZXZ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3RhdGUgPT0gQlJEX0lETEUpIHx8CisJCSAgIHN0YXR1cyk7CisJcmV0dXJuIHN0YXR1czsKK30KKworLyoKKyAqICA9PT09PT09PSBnZXRfZW52cF9jb3VudCA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIFJldHVybiB0aGUgbnVtYmVyIG9mIGVsZW1lbnRzIGluIHRoZSBlbnZwIGFycmF5LCBpbmNsdWRpbmcgdGhlCisgKiAgICAgIHRlcm1pbmF0aW5nIE5VTEwgZWxlbWVudC4KKyAqLworc3RhdGljIHMzMiBnZXRfZW52cF9jb3VudChjaGFyICoqZW52cCkKK3sKKwlzMzIgcmV0ID0gMDsKKwlpZiAoZW52cCkgeworCQl3aGlsZSAoKmVudnArKykKKwkJCXJldCsrOworCisJCXJldCArPSAxOwkvKiBJbmNsdWRlIHRoZSB0ZXJtaW5hdGluZyBOVUxMIGluIHRoZSBjb3VudC4gKi8KKwl9CisKKwlyZXR1cm4gcmV0OworfQorCisvKgorICogID09PT09PT09IHByZXBlbmRfZW52cCA9PT09PT09PQorICogIFB1cnBvc2U6CisgKiAgICAgIFByZXBlbmQgYW4gZW52aXJvbm1lbnQgdmFyaWFibGU9dmFsdWUgcGFpciB0byB0aGUgbmV3IGVudnAgYXJyYXksIGFuZAorICogICAgICBjb3B5IGluIHRoZSBleGlzdGluZyB2YXI9dmFsdWUgcGFpcnMgaW4gdGhlIG9sZCBlbnZwIGFycmF5LgorICovCitzdGF0aWMgY2hhciAqKnByZXBlbmRfZW52cChjaGFyICoqbmV3X2VudnAsIGNoYXIgKiplbnZwLCBzMzIgZW52cF9lbGVtcywKKwkJCSAgIHMzMiBjbmV3X2VudnAsIGNoYXIgKnN6X3ZhcikKK3sKKwljaGFyICoqcHBfZW52cCA9IG5ld19lbnZwOworCisJREJDX1JFUVVJUkUobmV3X2VudnApOworCisJLyogUHJlcGVuZCBuZXcgZW52aXJvbiB2YXI9dmFsdWUgc3RyaW5nICovCisJKm5ld19lbnZwKysgPSBzel92YXI7CisKKwkvKiBDb3B5IHVzZXIncyBlbnZpcm9ubWVudCBpbnRvIG91ciBvd24uICovCisJd2hpbGUgKGVudnBfZWxlbXMtLSkKKwkJKm5ld19lbnZwKysgPSAqZW52cCsrOworCisJLyogRW5zdXJlIE5VTEwgdGVybWluYXRlcyB0aGUgbmV3IGVudmlyb25tZW50IHN0cmluZ3MgYXJyYXkuICovCisJaWYgKGVudnBfZWxlbXMgPT0gMCkKKwkJKm5ld19lbnZwID0gTlVMTDsKKworCXJldHVybiBwcF9lbnZwOworfQorCisvKgorICogID09PT09PT09IHByb2Nfbm90aWZ5X2NsaWVudHMgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBOb3RpZnkgdGhlIHByb2Nlc3NvciB0aGUgZXZlbnRzLgorICovCitpbnQgcHJvY19ub3RpZnlfY2xpZW50cyh2b2lkICpwcm9jLCB1MzIgZXZlbnRzKQoreworCWludCBzdGF0dXMgPSAwOworCXN0cnVjdCBwcm9jX29iamVjdCAqcF9wcm9jX29iamVjdCA9IChzdHJ1Y3QgcHJvY19vYmplY3QgKilwcm9jOworCisJREJDX1JFUVVJUkUocF9wcm9jX29iamVjdCk7CisJREJDX1JFUVVJUkUoaXNfdmFsaWRfcHJvY19ldmVudChldmVudHMpKTsKKwlEQkNfUkVRVUlSRShyZWZzID4gMCk7CisJaWYgKCFwX3Byb2Nfb2JqZWN0KSB7CisJCXN0YXR1cyA9IC1FRkFVTFQ7CisJCWdvdG8gZnVuY19lbmQ7CisJfQorCisJbnRmeV9ub3RpZnkocF9wcm9jX29iamVjdC0+bnRmeV9vYmosIGV2ZW50cyk7CitmdW5jX2VuZDoKKwlyZXR1cm4gc3RhdHVzOworfQorCisvKgorICogID09PT09PT09IHByb2Nfbm90aWZ5X2FsbF9jbGllbnRzID09PT09PT09CisgKiAgUHVycG9zZToKKyAqICAgICAgTm90aWZ5IHRoZSBwcm9jZXNzb3IgdGhlIGV2ZW50cy4gVGhpcyBpbmNsdWRlcyBub3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9iamVjdCAqLworCXN0cm1fbWdyX29iaiA9IGt6YWxsb2Moc2l6ZW9mKHN0cnVjdCBzdHJtX21nciksIEdGUF9LRVJORUwpOworCWlmIChzdHJtX21ncl9vYmogPT0gTlVMTCkKKwkJc3RhdHVzID0gLUVOT01FTTsKKwllbHNlCisJCXN0cm1fbWdyX29iai0+ZGV2X29iaiA9IGRldl9vYmo7CisKKwkvKiBHZXQgQ2hhbm5lbCBtYW5hZ2VyIGFuZCBCcmlkZ2UgZnVuY3Rpb24gaW50ZXJmYWNlICovCisJaWYgKCFzdGF0dXMpIHsKKwkJc3RhdHVzID0gZGV2X2dldF9jaG5sX21ncihkZXZfb2JqLCAmKHN0cm1fbWdyX29iai0+aGNobmxfbWdyKSk7CisJCWlmICghc3RhdHVzKSB7CisJCQkodm9pZClkZXZfZ2V0X2ludGZfZnhucyhkZXZfb2JqLAorCQkJCQkJJihzdHJtX21ncl9vYmotPmludGZfZnhucykpOworCQkJREJDX0FTU0VSVChzdHJtX21ncl9vYmotPmludGZfZnhucyAhPSBOVUxMKTsKKwkJfQorCX0KKworCWlmICghc3RhdHVzKQorCQkqc3RybV9tYW4gPSBzdHJtX21ncl9vYmo7CisJZWxzZQorCQlrZnJlZShzdHJtX21ncl9vYmopOworCisJREJDX0VOU1VSRSgoIXN0YXR1cyAmJiAqc3RybV9tYW4pIHx8IChzdGF0dXMgJiYgKnN0cm1fbWFuID09IE5VTEwpKTsKKworCXJldHVybiBzdGF0dXM7Cit9CisKKy8qCisgKiAgPT09PT09PT0gc3RybV9kZWxldGUgPT09PT09PT0KKyAqICBQdXJwb3NlOgorICogICAgICBEZWxldGUgdGhlIFNUUk0gTWFuYWdlciBPYmplY3QuCisgKi8KK3ZvaWQgc3RybV9kZWxldGUoc3RydWN0IHN0cm1fbWdyICpzdHJtX21ncl9vYmopCit7CisJREJDX1JFUVVJUkUocmVmcyA+IDApOworCURCQ19SRVFVSVJFKHN0cm1fbWdyX29iaik7CisKKwlrZnJlZShzdHJtX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zLAorCQkJCSAgICAgdW5zaWduZWQgY291bnQsIHVuc2lnbmVkIHRpbWVvdXQsCisJCQkJICAgICB1bnNpZ25lZCAqaW5kZXgpCit7CisJdW5zaWduZWQgaTsKKwlpbnQgc3RhdHVzID0gLUVQRVJNOworCXN0cnVjdCBjb21wbGV0aW9uIG1fY29tcDsKKworCWluaXRfY29tcGxldGlvbigmbV9jb21wKTsKKworCWlmIChTWU5DX0lORklOSVRFID09IHRpbWVvdXQpCisJCXRpbWVvdXQgPSBNQVhfU0NIRURVTEVfVElNRU9VVDsKKworCXNwaW5fbG9ja19iaCgmc3luY19sb2NrKTsKKwlmb3IgKGkgPSAwOyBpIDwgY291bnQ7IGkrKykgeworCQlpZiAoY29tcGxldGlvbl9kb25lKCZldmVudHNbaV0tPmNvbXApKSB7CisJCQlJTklUX0NPTVBMRVRJT04oZXZlbnRzW2ldLT5jb21wKTsKKwkJCSppbmRleCA9IGk7CisJCQlzcGluX3VubG9ja19iaCgmc3luY19sb2NrKTsKKwkJCXN0YXR1cyA9IDA7CisJCQlnb3RvIGZ1bmNfZW5kOworCQl9CisJfQorCisJZm9yIChpID0gMDsgaSA8IGNvdW50OyBpKyspCisJCWV2ZW50c1tpXS0+bXVsdGlfY29tcCA9ICZtX2NvbXA7CisKKwlzcGluX3VubG9ja19iaCgmc3luY19sb2NrKTsKKworCWlmICghd2FpdF9mb3JfY29tcGxldGlvbl9pbnRlcnJ1cHRpYmxlX3RpbWVvdXQoJm1fY29tcCwKKwkJCQkJbXNlY3NfdG9famlmZmllcyh0aW1lb3V0KSkpCisJCXN0YXR1cyA9IC1FVElNRTsKKworCXNwaW5fbG9ja19iaCgmc3luY19sb2NrKTsKKwlmb3IgKGkgPSAwOyBpIDwgY291bnQ7IGkrKykgeworCQlpZiAoY29tcGxldGlvbl9kb25lKCZldmVudHNbaV0tPmNvbXApKSB7CisJCQlJTklUX0NPTVBMRVRJT04oZXZlbnRzW2ldLT5jb21wKTsKKwkJCSppbmRleCA9IGk7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EFfUFRSKCYocEZyYW1lLT5wSGRyLT5zQTMpKSkKKyAgICBwSXRlbSA9IChQV0xBTl9JRSkoKHVuc2lnbmVkIGNoYXIgKikoV0xBTl9IRFJfQTNfREFUQV9QVFIoJihwRnJhbWUtPnBIZHItPnNBMykpKQogICAgICAgICAgICAgICAgICAgICAgICArIFdMQU5fQkVBQ09OX09GRl9TU0lEKTsKLSAgICB3aGlsZSggKChQQllURSlwSXRlbSkgPCAocEZyYW1lLT5wQnVmICsgcEZyYW1lLT5sZW4pICl7CisgICAgd2hpbGUoICgodW5zaWduZWQgY2hhciAqKXBJdGVtKSA8IChwRnJhbWUtPnBCdWYgKyBwRnJhbWUtPmxlbikgKXsKIAogICAgICAgICBzd2l0Y2ggKHBJdGVtLT5ieUVsZW1lbnRJRCkgewogICAgICAgICAgICAgY2FzZSBXTEFOX0VJRF9TU0lEOgpAQCAtMTc5LDcgKzE3OSw3IEBACiAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICBjYXNlIFdMQU5fRUlEX1JTTl9XUEE6CiAgICAgICAgICAgICAgICAgaWYgKHBGcmFtZS0+cFJTTldQQSA9PSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChXUEFiX0lzX1JTTigoUFdMQU5fSUVfUlNOX0VYVClwSXRlbSkgPT0gVFJVRSkKKyAgICAgICAgICAgICAgICAgICAgaWYgKFdQQWJfSXNfUlNOKChQV0xBTl9JRV9SU05fRVhUKXBJdGVtKSA9PSB0cnVlKQogICAgICAgICAgICAgICAgICAgICAgICAgcEZyYW1lLT5wUlNOV1BBID0gKFBXTEFOX0lFX1JTTl9FWFQpcEl0ZW07CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGJyZWFrOwpAQCAtMjIzLDcgKzIyMyw3IEBACiAgICAgICAgICAgICAgICAgYnJlYWs7CiAKICAgICAgICAgfQotICAgICAgICBwSXRlbSA9IChQV0xBTl9JRSkoKChQQllURSlwSXRlbSkgKyA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PnBIZHItPnNBMykpCisgICAgcEZyYW1lLT5wd0xpc3RlbkludGVydmFsID0gKHVuc2lnbmVkIHNob3J0ICopKFdMQU5fSERSX0EzX0RBVEFfUFRSKCYocEZyYW1lLT5wSGRyLT5zQTMpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIFdMQU5fUkVBU1NPQ1JFUV9PRkZfTElTVEVOX0lOVCk7CiAgICAgcEZyYW1lLT5wQWRkckN1cnJBUCA9IChQSUVFRV9BRERSKShXTEFOX0hEUl9BM19EQVRBX1BUUigmKHBGcmFtZS0+cEhkci0+c0EzKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgV0xBTl9SRUFTU09DUkVRX09GRl9DVVJSX0FQKTsKQEAgLTU1Myw5ICs1NTQsOSBAQAogICAgIHBGcmFtZS0+cEhkciA9IChQVVdMQU5fODAyMTFIRFIpcEZyYW1lLT5wQnVmOwogCiAgICAgLy8gRml4ZWQgRmllbGRzCi0gICAgcEZyYW1lLT5wd0NhcEluZm8gPSAoUFdPUkQpKFdMQU5fSERSX0EzX0RBVEFfUFRSKCYocEZyYW1lLT5wSGRyLT5zQTMpKQorICAgIHBGcmFtZS0+cHdDYXBJbmZvID0gKHVuc2lnbmVkIHNob3J0ICopKFdMQU5fSERSX0EzX0RBVEFfUFRSKCYocEZyYW1lLT5wSGRyLT5zQTMpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIFdMQU5fUkVBU1NPQ1JFUV9PRkZfQ0FQX0lORk8pOwotICAgIHBGcmFtZS0+cHdMaXN0ZW5JbnRlcnZhbCA9IChQV09SRCkoV0xBTl9IRFJfQTNfREFUQV9QVFIoJihwRnJhbWUtPnBIZHItPnNBMykpCisgICAgcEZyYW1lLT5wd0xpc3RlbkludGVydmFsID0gKHVuc2lnbmVkIHNob3J0ICopKFdMQU5fSERSX0EzX0RBVEFfUFRSKCYocEZyYW1lLT5wSGRyLT5zQTMpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIFdMQU5fUkVBU1NPQ1JFUV9PRkZfTElTVEVOX0lOVCk7CiAgICAgcEZyYW1lLT5wQWRkckN1cnJBUCA9IChQSUVFRV9BRERSKShXTEFOX0hEUl9BM19EQVRBX1BUUigmKHBGcmFtZS0+cEhkci0+c0EzKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgV0xBTl9SRUFTU09DUkVRX09GRl9DVVJSX0FQKTsKQEAgLTU2NCw3ICs1NjUsNyBAQAogICAgIHBJdGVtID0gKFBXTEFOX0lFKShXTEFOX0hEUl9BM19EQVRBX1BUUigmKHBGcmFtZS0+cEhkci0+c0EzKSkKICAgICAgICAgICAgICAgICAgICAgICAgKyBXTEFOX1JFQVNTT0NSRVFfT0ZGX1NTSUQpOwogCi0gICAgd2hpbGUoKChQQllURSlwSXRlbSkgPCAocEZyYW1lLT5wQnVmICsgcEZyYW1lLT5sZW4pKSB7CisgICAgd2hpbGUoKCh1bnNpZ25lZCBjaGFyICopcEl0ZW0pIDwgKHBGcmFtZS0+cEJ1ZiArIHBGcmFtZS0+bGVuKSkgewogCiAgICAgICAgIHN3aXRjaCAocEl0ZW0tPmJ5RWxlbWVudElEKXsKICAgICAgICAgICAgIGNhc2UgV0xBTl9FSURfU1NJRDoKQEAgLTU4Myw3ICs1ODQsNyBAQAogICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgY2FzZSBXTEFOX0VJRF9SU05fV1BBOgogICAgICAgICAgICAgICAgIGlmIChwRnJhbWUtPnBSU05XUEEgPT0gTlVMTCkgewotICAgICAgICAgICAgICAgICAgICBpZiAoV1BBYl9Jc19SU04oKFBXTEFOX0lFX1JTTl9FWFQpcEl0ZW0pID09IFRSVUUpCisgICAgICAgICAgICAgICAgICAgIGlmIChXUEFiX0lzX1JTTigoUFdMQU5fSUVfUlNOX0VYVClwSXRlbSkgPT0gdHJ1ZSkKICAgICAgICAgICAgICAgICAg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KICAgICBwRnJhbWUtPnBxd1RpbWVzdGFtcCA9IChQUVdPUkQpKFdMQU5fSERSX0EzX0RBVEFfUFRSKCYocEZyYW1lLT5wSGRyLT5zQTMpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBXTEFOX1BST0JFUkVTUF9PRkZfVFMpOwotICAgIHBGcmFtZS0+cHdCZWFjb25JbnRlcnZhbCA9IChQV09SRCkoV0xBTl9IRFJfQTNfREFUQV9QVFIoJihwRnJhbWUtPnBIZHItPnNBMykpCisgICAgcEZyYW1lLT5wd0JlYWNvbkludGVydmFsID0gKHVuc2lnbmVkIHNob3J0ICopKFdMQU5fSERSX0EzX0RBVEFfUFRSKCYocEZyYW1lLT5wSGRyLT5zQTMpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBXTEFOX1BST0JFUkVTUF9PRkZfQkNOX0lOVCk7Ci0gICAgcEZyYW1lLT5wd0NhcEluZm8gPSAoUFdPUkQpKFdMQU5fSERSX0EzX0RBVEFfUFRSKCYocEZyYW1lLT5wSGRyLT5zQTMpKQorICAgIHBGcmFtZS0+cHdDYXBJbmZvID0gKHVuc2lnbmVkIHNob3J0ICopKFdMQU5fSERSX0EzX0RBVEFfUFRSKCYocEZyYW1lLT5wSGRyLT5zQTMpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIFdMQU5fUFJPQkVSRVNQX09GRl9DQVBfSU5GTyk7CiAKICAgICAvLyBJbmZvcm1hdGlvbiBlbGVtZW50cwogICAgIHBJdGVtID0gKFBXTEFOX0lFKShXTEFOX0hEUl9BM19EQVRBX1BUUigmKHBGcmFtZS0+cEhkci0+c0EzKSkKICAgICAgICAgICAgICAgICAgICAgICAgKyBXTEFOX1BST0JFUkVTUF9PRkZfU1NJRCk7CiAKLSAgICB3aGlsZSggKChQQllURSlwSXRlbSkgPCAocEZyYW1lLT5wQnVmICsgcEZyYW1lLT5sZW4pICkgeworICAgIHdoaWxlKCAoKHVuc2lnbmVkIGNoYXIgKilwSXRlbSkgPCAocEZyYW1lLT5wQnVmICsgcEZyYW1lLT5sZW4pICkgewogICAgICAgICBzd2l0Y2ggKHBJdGVtLT5ieUVsZW1lbnRJRCkgewogICAgICAgICAgICAgY2FzZSBXTEFOX0VJRF9TU0lEOgogICAgICAgICAgICAgICAgIGlmIChwRnJhbWUtPnBTU0lEID09IE5VTEwpCkBAIC03NzgsNyArNzc5LDcgQEAKICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgIGNhc2UgV0xBTl9FSURfUlNOX1dQQToKICAgICAgICAgICAgICAgICBpZiAocEZyYW1lLT5wUlNOV1BBID09IE5VTEwpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKFdQQWJfSXNfUlNOKChQV0xBTl9JRV9SU05fRVhUKXBJdGVtKSA9PSBUUlVFKQorICAgICAgICAgICAgICAgICAgICBpZiAoV1BBYl9Jc19SU04oKFBXTEFOX0lFX1JTTl9FWFQpcEl0ZW0pID09IHRydWUpCiAgICAgICAgICAgICAgICAgICAgICAgICBwRnJhbWUtPnBSU05XUEEgPSAoUFdMQU5fSUVfUlNOX0VYVClwSXRlbTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgYnJlYWs7CkBAIC04MjEsNyArODIyLDcgQEAKICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgfQogCi0gICAgICAgIHBJdGVtID0gKFBXTEFOX0lFKSgoKFBCWVRFKXBJdGVtKSArIDIgKyAgcEl0ZW0tPmxlbik7CisgICAgICAgIHBJdGVtID0gKFBXTEFOX0lFKSgoKHVuc2lnbmVkIGNoYXIgKilwSXRlbSkgKyAyICsgIHBJdGVtLT5sZW4pOwogICAgIH0KICAgICByZXR1cm47CiB9CkBAIC04NDYsMTEgKzg0NywxMSBAQAogICAgIHBGcmFtZS0+cEhkciA9IChQVVdMQU5fODAyMTFIRFIpcEZyYW1lLT5wQnVmOwogCiAgICAgLy8gRml4ZWQgRmllbGR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U3RhcnRUaW1lWzhdOworICAgIHVuc2lnbmVkIGNoYXIgYWJ5RHVyYXRpb25bMl07CisgICAgdW5zaWduZWQgY2hhciBhYnlSUElkZW5zaXR5WzhdOwogfSBNRUFTRVVSRV9SRVBfUlBJLCAqUE1FQVNFVVJFX1JFUF9SUEk7CiAKIHR5cGVkZWYgdW5pb24gX01FQVNFVVJFX1JFUCB7CkBAIC00MDYsODUgKzQwNiw4NSBAQAogfSBNRUFTRVVSRV9SRVAsICpQTUVBU0VVUkVfUkVQOwogCiB0eXBlZGVmIHN0cnVjdCBfV0xBTl9JRV9NRUFTVVJFX1JFUSB7Ci0gICAgQllURSAgICAgICAgICAgICAgICBieUVsZW1lbnRJRDsKLSAgICBCWVRFICAgICAgICAgICAgICAgIGxlbjsKLSAgICBCWVRFICAgICAgICAgICAgICAgIGJ5VG9rZW47Ci0gICAgQllURSAgICAgICAgICAgICAgICBieU1vZGU7Ci0gICAgQllURSAgICAgICAgICAgICAgICBieVR5cGU7CisgICAgdW5zaWduZWQgY2hhciBieUVsZW1lbnRJRDsKKyAgICB1bnNpZ25lZCBjaGFyIGxlbjsKKyAgICB1bnNpZ25lZCBjaGFyIGJ5VG9rZW47CisgICAgdW5zaWduZWQgY2hhciBieU1vZGU7CisgICAgdW5zaWduZWQgY2hhciBieVR5cGU7CiAgICAgTUVBU0VVUkVfUkVRICAgICAgICBzUmVxOwogfSBXTEFOX0lFX01FQVNVUkVfUkVRLCAqUFdMQU5fSUVfTUVBU1VSRV9SRVE7CiAKIHR5cGVkZWYgc3RydWN0IF9XTEFOX0lFX01FQVNVUkVfUkVQIHsKLSAgICBCWVRFICAgICAgICAgICAgICAgIGJ5RWxlbWVudElEOwotICAgIEJZVEUgICAgICAgICAgICAgICAgbGVuOwotICAgIEJZVEUgICAgICAgICAgICAgICAgYnlUb2tlbjsKLSAgICBCWVRFICAgICAgICAgICAgICAgIGJ5TW9kZTsKLSAgICBCWVRFICAgICAgICAgICAgICAgIGJ5VHlwZTsKKyAgICB1bnNpZ25lZCBjaGFyIGJ5RWxlbWVudElEOworICAgIHVuc2lnbmVkIGNoYXIgbGVuOworICAgIHVuc2lnbmVkIGNoYXIgYnlUb2tlbjsKKyAgICB1bnNpZ25lZCBjaGFyIGJ5TW9kZTsKKyAgICB1bnNpZ25lZCBjaGFyIGJ5VHlwZTsKICAgICBNRUFTRVVSRV9SRVAgICAgICAgIHNSZXA7CiB9IFdMQU5fSUVfTUVBU1VSRV9SRVAsICpQV0xBTl9JRV9NRUFTVVJFX1JFUDsKIAogdHlwZWRlZiBzdHJ1Y3QgX1dMQU5fSUVfQ0hfU1cgewotICAgIEJZVEUgICAgICAgICAgICAgICAgYnlFbGVtZW50SUQ7Ci0gICAgQllURSAgICAgICAgICAgICAgICBsZW47Ci0gICAgQllURSAgICAgICAgICAgICAgICBieU1vZGU7Ci0gICAgQllURSAgICAgICAgICAgICAgICBieUNoYW5uZWw7Ci0gICAgQllURSAgICAgICAgICAgICAgICBieUNvdW50OworICAgIHVuc2lnbmVkIGNoYXIgYnlFbGVtZW50SUQ7CisgICAgdW5zaWduZWQgY2hhciBsZW47CisgICAgdW5zaWduZWQgY2hhciBieU1vZGU7CisgICAgdW5zaWduZWQgY2hhciBieUNoYW5uZWw7CisgICAgdW5zaWduZWQgY2hhciBieUNvdW50OwogfSBXTEFOX0lFX0NIX1NXLCAqUFdMQU5fSUVfQ0hfU1c7CiAKIHR5cGVkZWYgc3RydWN0IF9XTEFOX0lFX1FVSUVUIHsKLSAgICBCWVRFICAgICAgICAgICAgICAgIGJ5RWxlbWVudElEOwotICAgIEJZVEUgICAgICAgICAgICAgICAgbGVuOwotICAgIEJZVEUgICAgICAgICAgICAgICAgYnlRdWlldENvdW50OwotICAgIEJZVEUgICAgICAgICAgICAgICAgYnlRdWlldFBlcmlvZDsKLSAgICBCWVRFICAgICAgICAgICAgICAgIGFieVF1aWV0RHVyYXRpb25bMl07Ci0gICAgQllURSAgICAgICAgICAgICAgICBhYnlRdWlldE9mZnNldFsyXTsKKyAgICB1bnNpZ25lZCBjaGFyIGJ5RWxlbWVudElEOworICAgIHVuc2lnbmVkIGNoYXIgbGVuOworICAgIHVuc2lnbmVkIGNoYXIgYnlRdWlldENvdW50OworICAgIHVuc2lnbmVkIGNoYXIgYnlRdWlldFBlcmlvZDsKKyAgICB1bnNpZ25lZCBjaGFyIGFieVF1aWV0RHVyYXRpb25bMl07CisgICAgdW5zaWduZWQgY2hhciBhYnlRdWlldE9mZnNldFsyXTsKIH0gV0xBTl9JRV9RVUlFVCwgKlBXTEFOX0lFX1FVSUVUOwogCiB0eXBlZGVmIHN0cnVjdCBfV0xBTl9JRV9DT1VOVFJZIHsKLSAgICBCWVRFICAgICAgICAgICAgICAgIGJ5RWxlbWVudElEOwotICAgIEJZVEUgICAgICAgICAgICAgICAgbGVuOwotICAgIEJZVEUgICAgICAgICAgICAgICAgYWJ5Q291bnRyeVN0cmluZ1szXTsKLSAgICBCWVRFICAgICAgICAgICAgICAgIGFieUNvdW50cnlJbmZvWzNdOworICAgIHVuc2lnbmVkIGNoYXIgYnlFbGVtZW50SUQ7CisgICAgdW5zaWduZWQgY2hhciBsZW47CisgICAgdW5zaWduZWQgY2hhciBhYnlDb3VudHJ5U3RyaW5nWzNdOworICAgIHVuc2lnbmVkIGNoYXIgYWJ5Q291bnRyeUluZm9bM107CiB9IFdMQU5fSUVfQ09VTlRSWSwgKlBXTEFOX0lFX0NPVU5UUlk7CiAKIHR5cGVkZWYgc3RydWN0IF9XTEFOX0lFX1BXX0NPTlNUIHsKLSAgICBCWVRFICAgICAgICAgICAgICAgIGJ5RWxlbWVudElEOwotICAgIEJZVEUgICAgICAgICAgICAgICAgbGVuOwotICAgIEJZVEUgICAgICAgICAgICAgICAgYnlQb3dlcjsKKyAgICB1bnNpZ25lZCBjaGFyIGJ5RWxlbWVudElEOworICAgIHVuc2lnbmVkIGNoYXIgbGVuOworICAgIHVuc2lnbmVkIGNoYXIgYnlQb3dlcjsKIH0gV0xBTl9JRV9Q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bWdtdCBmcmFtZSB0eXBlcyB3aWxsIHN0YXJ0IHdpdGggdGhlc2UgbWVtYmVycwogdHlwZWRlZiBzdHJ1Y3QgdGFnV0xBTl9GUl9NR01UIHsKIAotICAgIFVJTlQgICAgICAgICAgICAgICAgICB1VHlwZTsKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgbGVuOwotICAgIFBCWVRFICAgICAgICAgICAgICAgICBwQnVmOworICAgIHVuc2lnbmVkIGludAl1VHlwZTsKKyAgICB1bnNpZ25lZCBpbnQJbGVuOworICAgIHVuc2lnbmVkIGNoYXIgKnBCdWY7CiAgICAgUFVXTEFOXzgwMjExSERSICAgICAgIHBIZHI7CiAKIH0gV0xBTl9GUl9NR01ULCAgKlBXTEFOX0ZSX01HTVQ7CkBAIC01MDUsMTQgKzUwNSwxNCBAQAogLy8gQmVhY29uIGZyYW1lCiB0eXBlZGVmIHN0cnVjdCB0YWdXTEFOX0ZSX0JFQUNPTiB7CiAKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICB1VHlwZTsKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICBsZW47Ci0gICAgUEJZVEUgICAgICAgICAgICAgICAgICAgcEJ1ZjsKKyAgICB1bnNpZ25lZCBpbnQJdVR5cGU7CisgICAgdW5zaWduZWQgaW50CWxlbjsKKyAgICB1bnNpZ25lZCBjaGFyICpwQnVmOwogICAgIFBVV0xBTl84MDIxMUhEUiAgICAgICAgIHBIZHI7CiAgICAgLy8gZml4ZWQgZmllbGRzCiAgICAgUFFXT1JEICAgICAgICAgICAgICAgICAgcHF3VGltZXN0YW1wOwotICAgIFBXT1JEICAgICAgICAgICAgICAgICAgIHB3QmVhY29uSW50ZXJ2YWw7Ci0gICAgUFdPUkQgICAgICAgICAgICAgICAgICAgcHdDYXBJbmZvOworICAgIHVuc2lnbmVkIHNob3J0ICpwd0JlYWNvbkludGVydmFsOworICAgIHVuc2lnbmVkIHNob3J0ICpwd0NhcEluZm87CiAgICAgLyotLSBpbmZv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MgLS0tLS0tLS0tLSovCiAKIH0gV0xBTl9GUl9ESVNBU1NPQywgKlBXTEFOX0ZSX0RJU0FTU09DOwpAQCAtNTY0LDEzICs1NjQsMTMgQEAKIC8vIEFzc29jaWF0aW9uIFJlcXVlc3QKIHR5cGVkZWYgc3RydWN0IHRhZ1dMQU5fRlJfQVNTT0NSRVEgewogCi0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgdVR5cGU7Ci0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgbGVuOwotICAgIFBCWVRFICAgICAgICAgICAgICAgICAgIHBCdWY7CisgICAgdW5zaWduZWQgaW50CXVUeXBlOworICAgIHVuc2lnbmVkIGludAlsZW47CisgICAgdW5zaWduZWQgY2hhciAqcEJ1ZjsKICAgICBQVVdMQU5fODAyMTFIRFIgICAgICAgICBwSGRyOwogICAgIC8qLS0gZml4ZWQgZmllbGRzIC0tLS0tLS0tLS0tKi8KLSAgICBQV09SRCAgICAgICAgICAgICAgICAgICBwd0NhcEluZm87Ci0gICAgUFdPUkQgICAgICAgICAgICAgICAgICAgcHdMaXN0ZW5JbnRlcnZhbDsKKyAgICB1bnNpZ25lZCBzaG9ydCAqcHdDYXBJbmZvOworICAgIHVuc2lnbmVkIHNob3J0ICpwd0xpc3RlbkludGVydmFsOwogICAgIC8qLS0gaW5mbyBlbGVtZW50cyAtLS0tLS0tLS0tKi8KICAgICBQV0xBTl9JRV9TU0lEICAgICAgICAgICBwU1NJRDsKICAgICBQV0xBTl9JRV9TVVBQX1JBVEVTICAgICBwU3VwcFJhdGVzOwpAQCAtNTg1LDE0ICs1ODUsMTQgQEAKIC8vIEFzc29jaWF0aW9uIFJlc3BvbnNlCiB0eXBlZGVmIHN0cnVjdCB0YWdXTEFOX0ZSX0FTU09DUkVTUCB7CiAKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICB1VHlwZTsKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICBsZW47Ci0gICAgUEJZVEUgICAgICAgICAgICAg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PUkQgICAgICAgICAgICAgICAgICAgcHdDYXBJbmZvOwotICAgIFBXT1JEICAgICAgICAgICAgICAgICAgIHB3TGlzdGVuSW50ZXJ2YWw7CisgICAgdW5zaWduZWQgc2hvcnQgKnB3Q2FwSW5mbzsKKyAgICB1bnNpZ25lZCBzaG9ydCAqcHdMaXN0ZW5JbnRlcnZhbDsKICAgICBQSUVFRV9BRERSICAgICAgICAgICAgICBwQWRkckN1cnJBUDsKIAogICAgIC8qLS0gaW5mbyBlbGVtZW50cyAtLS0tLS0tLS0tKi8KQEAgLTYyNCwxNCArNjI0LDE0IEBACiAvLyBSZWFzc29jaWF0aW9uIFJlc3BvbnNlCiB0eXBlZGVmIHN0cnVjdCB0YWdXTEFOX0ZSX1JFQVNTT0NSRVNQIHsKIAotICAgIFVJTlQgICAgICAgICAgICAgICAgICAgIHVUeXBlOwotICAgIFVJTlQgICAgICAgICAgICAgICAgICAgIGxlbjsKLSAgICBQQllURSAgICAgICAgICAgICAgICAgICBwQnVmOworICAgIHVuc2lnbmVkIGludAl1VHlwZTsKKyAgICB1bnNpZ25lZCBpbnQJbGVuOworICAgIHVuc2lnbmVkIGNoYXIgKnBCdWY7CiAgICAgUFVXTEFOXzgwMjExSERSICAgICAgICAgcEhkcjsKICAgICAvKi0tIGZpeGVkIGZpZWxkcyAtLS0tLS0tLS0tLSovCi0gICAgUFdPUkQgICAgICAgICAgICAgICAgICAgcHdDYXBJbmZvOwotICAgIFBXT1JEICAgICAgICAgICAgICAgICAgIHB3U3RhdHVzOwotICAgIFBXT1JEICAgICAgICAgICAgICAgICAgIHB3QWlkOworICAgIHVuc2lnbmVkIHNob3J0ICpwd0NhcEluZm87CisgICAgdW5zaWduZWQgc2hvcnQgKnB3U3RhdHVzOworICAgIHVuc2lnbmVkIHNob3J0ICpwd0FpZDsKICAgICAvKi0tIGluZm8gZWxlbWVudHMgLS0tLS0tLS0tLSovCiAgICAgUFdMQU5fSUVfU1VQUF9SQVRFUyAgICAgcFN1cHBSYXRlczsKICAgICBQV0xBTl9JRV9TVVBQX1JBVEVTICAgICBwRXh0U3VwcFJhdGVzOwpAQCAtNjQxLDkgKzY0MSw5IEBACiAvLyBQcm9iZSBSZXF1ZXN0CiB0eXBlZGVmIHN0cnVjdCB0YWdXTEFOX0ZSX1BST0JFUkVRIHsKIAotICAgIFVJTlQgICAgICAgICAgICAgICAgICAgIHVUeXBlOwotICAgIFVJTlQgICAgICAgICAgICAgICAgICAgIGxlbjsKLSAgICBQQllURSAgICAgICAgICAgICAgICAgICBwQnVmOworICAgIHVuc2lnbmVkIGludAl1VHlwZTsKKyAgICB1bnNpZ25lZCBpbnQJbGVuOworICAgIHVuc2lnbmVkIGNoYXIgKnBCdWY7CiAgICAgUFVXTEFOXzgwMjExSERSICAgICAgICAgcEhkcjsKICAgICAvKi0tIGZpeGVkIGZpZWxkcyAtLS0tLS0tLS0tLSovCiAgICAgLyotLSBpbmZvIGVsZW1lbnRzIC0tLS0tLS0tLS0qLwpAQCAtNjU2LDE0ICs2NTYsMTQgQEAKIC8vIFByb2JlIFJlc3BvbnNlCiB0eXBlZGVmIHN0cnVjdCB0YWdXTEFOX0ZSX1BST0JFUkVTUCB7CiAKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICB1VHlwZTsKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICBsZW47Ci0gICAgUEJZVEUgICAgICAgICAgICAgICAgICAgcEJ1ZjsKKyAgICB1bnNpZ25lZCBpbnQJdVR5cGU7CisgICAgdW5zaWduZWQgaW50CWxlbjsKKyAgICB1bnNpZ25lZCBjaGFyICpwQnVmOwogICAgIFBVV0xBTl84MDIxMUhEUiAgICAgICAgIHBIZHI7CiAgICAgLyotLSBmaXhlZCBmaWVsZHMgLS0tLS0tLS0tLS0qLwogICAgIFBRV09SRCAgICAgICAgICAgICAgICAgIHBxd1RpbWVzdGFtcDsKLSAgICBQV09SRCAgICAgICAgICAgICAgICAgICBwd0JlYWNvbkludGVydmFsOwotICAgIFBXT1JEIC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MDsKKyAgICB1bnNpZ25lZCBpbnQgdUxlbmd0aCA9IDA7CiAgICAgUFdMQU5fSUVfQ0hfU1cgICAgICAgICAgcENoYW5uZWxTd2l0Y2ggPSBOVUxMOwogCiAKICAgICAvLyBkZWNvZGUgdGhlIGZyYW1lCiAgICAgdUxlbmd0aCA9ICgoUFNSeE1nbXRQYWNrZXQpcFJ4UGFja2V0KS0+Y2JNUERVTGVuOwogICAgIGlmICh1TGVuZ3RoID4gV0xBTl9BM0ZSX01BWExFTikgewotICAgICAgICByZXR1cm4gKEZBTFNFKTsKKyAgICAgICAgcmV0dXJuIChmYWxzZSk7CiAgICAgfQogCiAKQEAgLTIzMyw3ICsyMzUsNyBAQAogICAgICAgICAgICAgICAgIHJldHVybiAoc19iUnhUUENSZXEocE1nbXQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoUFdMQU5fRlJBTUVfVFBDUkVRKSBwQWN0aW9uLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChQU1J4TWdtdFBhY2tldClwUnhQYWNrZXQpLT5ieVJ4UmF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChCWVRFKSAoKFBTUnhNZ210UGFja2V0KXBSeFBhY2tldCktPnVSU1NJKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodW5zaWduZWQgY2hhcikgKChQU1J4TWdtdFBhY2tldClwUnhQYWNrZXQpLT51UlNTSSkpOwogICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgY2FzZSBBQ1RJT05fVFBDUkVQOgogICAgICAgICAgICAgICAgIGJyZWFrOwpAQCAtMjQ0LDcgKzI0Niw3IEBACiAgICAgICAgICAgICAgICAgICAgIC8vIHZhbGlkIGVsZW1lbnQgaWQKICAgICAgICAgICAgICAgICAgICAgQ0FSRGJDaGFubmVsU3dpdGNoKCBwTWdtdC0+cEFkYXB0ZXIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENoYW5uZWxTd2l0Y2gtPmJ5TW9kZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDQVJEYnlHZXRDaGFubmVsTWFwcGluZyhwTWdtdC0+cEFkYXB0ZXIsIHBDaGFubmVsU3dpdGNoLT5ieUNoYW5uZWwsIHBNZ210LT5lQ3VycmVudFBIWU1vZGUpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldF9jaGFubmVsX21hcHBpbmcocE1nbXQtPnBBZGFwdGVyLCBwQ2hhbm5lbFN3aXRjaC0+YnlDaGFubmVsLCBwTWdtdC0+ZUN1cnJlbnRQSFlNb2RlKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2hhbm5lbFN3aXRjaC0+YnlDb3VudAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7CiAgICAgICAgICAgICAgICAgfQpAQCAtMjU4LDEzICsyNjAsMTMgQEAKICAgICAgICAgcEFjdGlvbi0+YnlDYXRlZ29yeSB8PSAweDgwOwogCiAgICAgICAgLy9yZXR1cm4gKENBUkRiU2VuZFBhY2tldChwTWdtdC0+cEFkYXB0ZXIsIHBBY3Rpb24sIFBLVF9UWVBFXzgwMl8xMV9NTkcsIHVMZW5ndGgpKTsKLSAgICAgICAgcmV0dXJuIChUUlVFKTsKKyAgICAgICAgcmV0dXJuICh0cnVlKTsKICAgICB9Ci0gICAgcmV0dXJuIChUUlVFKTsKKyAgICByZXR1cm4gKHRydWUpOwogfQogCiAKLUJPT0wgSUVFRTExaGJNU1JSZXBUeCAoCitib29sIElFRUUxMWhiTVNSUmVwVHggKAogICAgIHZvaWQgKnBNZ210SGFuZGxlCiAgICAgKQogewpAQCAtMjc1LDcgKzI3Nyw3IEBACiAKICAgICBwVHhQYWNrZXQgPSAoUFNUeE1nbXRQYWNrZXQpcE1nbXQtPmFieUN1cnJlbnRNU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bnQ7CisgICAgdW5zaWduZWQgaW50IGNiVXNDb3VudCA9IDA7CisgICAgdW5zaWduZWQgaW50IGNiVG1wOworICAgIGJvb2wgYkV4dEJpdDsKKyAgICB1bnNpZ25lZCBjaGFyIGJ5UHJlYW1ibGVUeXBlID0gcERldmljZS0+YnlQcmVhbWJsZVR5cGU7CisgICAgYm9vbCBiQ0NLID0gcERldmljZS0+YkNDSzsKIAogICAgIGNiQml0Q291bnQgPSBjYkZyYW1lTGVuZ3RoICogODsKLSAgICBiRXh0Qml0ID0gRkFMU0U7CisgICAgYkV4dEJpdCA9IGZhbHNlOwogCiAgICAgc3dpdGNoICh3UmF0ZSkgewogICAgIGNhc2UgUkFURV8xTSA6CkBAIC0xODc5LDcgKzE4NzksNyBAQAogICAgICAgICBicmVhazsKIAogICAgIGNhc2UgUkFURV81TSA6Ci0gICAgICAgIGlmIChiQ0NLID09IEZBTFNFKQorICAgICAgICBpZiAoYkNDSyA9PSBmYWxzZSkKICAgICAgICAgICAgIGNiQml0Q291bnQgKys7CiAgICAgICAgIGNiVXNDb3VudCA9IChjYkJpdENvdW50ICogMTApIC8gNTU7CiAgICAgICAgIGNiVG1wID0gKGNiVXNDb3VudCAqIDU1KSAvIDEwOwpAQCAtMTg5MywxNCArMTg5MywxNCBAQAogCiAgICAgY2FzZSBSQVRFXzExTSA6CiAKLSAgICAgICAgaWYgKGJDQ0sgPT0gRkFMU0UpCisgICAgICAgIGlmIChiQ0NLID09IGZhbHNlKQogICAgICAgICAgICAgY2JCaXRDb3VudCArKzsKICAgICAgICAgY2JVc0NvdW50ID0gY2JCaXRDb3VudCAvIDExOwogICAgICAgICBjYlRtcCA9IGNiVXNDb3VudCAqIDExOwogICAgICAgICBpZiAoY2JUbXAgIT0gY2JCaXRDb3VudCkgewogICAgICAgICAgICAgY2JVc0NvdW50ICsrOwogICAgICAgICAgICAgaWYgKChjYkJpdENvdW50IC0gY2JUbXApIDw9IDMpCi0gICAgICAgICAgICAgICAgYkV4dEJpdC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J5MFs1XVs1XSA9IHsKK2NvbnN0IHVuc2lnbmVkIHNob3J0IGF3SFdSZXRyeTBbNV1bNV0gPSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHtSQVRFXzE4TSwgUkFURV8xOE0sIFJBVEVfMTJNLCBSQVRFXzEyTSwgUkFURV8xMk19LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7UkFURV8yNE0sIFJBVEVfMjRNLCBSQVRFXzE4TSwgUkFURV8xMk0sIFJBVEVfMTJNfSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge1JBVEVfMzZNLCBSQVRFXzM2TSwgUkFURV8yNE0sIFJBVEVfMThNLCBSQVRFXzE4TX0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHtSQVRFXzQ4TSwgUkFURV80OE0sIFJBVEVfMzZNLCBSQVRFXzI0TSwgUkFURV8yNE19LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7UkFURV81NE0sIFJBVEVfNTRNLCBSQVRFXzQ4TSwgUkFURV8zNk0sIFJBVEVfMzZNfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07Ci1jb25zdCBXT1JEICAgICAgICAgICAgIGF3SFdSZXRyeTFbNV1bNV0gPSB7Citjb25zdCB1bnNpZ25lZCBzaG9ydCBhd0hXUmV0cnkxWzVdWzVdID0gewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7UkFURV8xOE0sIFJBVEVfMThNLCBSQVRFXzEyTSwgUkFURV82TSwgUkFURV82TX0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHtSQVRFXzI0TSwgUkFURV8yNE0sIFJBVEVfMThNLCBSQVRFXzZNLCBSQVRFXzZNfSwKICAgICAgICAgICAgICAgICAgICA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Q3VyckJTUy0+YkFjdGl2ZSkgJiYKLSAgICAgICAgICAgICAgICAocEN1cnJCU1MtPmJTZWxlY3RlZCA9PSBGQUxTRSkpIHsKLSAgICAgICAgICAgICAgICBpZiAoSVNfRVRIX0FERFJFU1NfRVFVQUwocEN1cnJCU1MtPmFieUJTU0lELCBwYnlCU1NJRCkpIHsKKyAgICAgICAgICAgICAgICAocEN1cnJCU1MtPmJTZWxlY3RlZCA9PSBmYWxzZSkpIHsKKyAgICAgICAgICAgICAgICBpZiAoIWNvbXBhcmVfZXRoZXJfYWRkcihwQ3VyckJTUy0+YWJ5QlNTSUQsIHBieUJTU0lEKSkgewogICAgICAgICAgICAgICAgICAgICBpZiAocFNTSUQgIT0gTlVMTCkgewogICAgICAgICAgICAgICAgICAgICAgICAgLy8gY29tcGFyZSBzc2lkCiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoICFtZW1jbXAocFNTSUQtPmFieVNTSUQsCkBAIC0xNzIsNyArMTczLDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChwTWdtdC0+ZUNvbmZpZ01vZGUgPT0gV01BQ19DT05GSUdfSUJTU19TVEEpICYmIFdMQU5fR0VUX0NBUF9JTkZPX0lCU1MocEN1cnJCU1MtPndDYXBJbmZvKSkgfHwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChwTWdtdC0+ZUNvbmZpZ01vZGUgPT0gV01BQ19DT05GSUdfRVNTX1NUQSkgJiYgV0xBTl9HRVRfQ0FQX0lORk9fRVNTKHBDdXJyQlNTLT53Q2FwSW5mbykpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ3VyckJTUy0+YlNlbGVjdGVkID0gVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEN1cnJCU1MtPmJTZWxlY3RlZCA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybihwQ3VyckJTUyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgfQpAQCAtMTgxLDcgKzE4Miw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChwTWdtdC0+ZUNvbmZpZ01vZGUgPT0gV01BQ19DT05GSUdfSUJTU19TVEEpICYmIFdMQU5fR0VUX0NBUF9JTkZPX0lCU1MocEN1cnJCU1MtPndDYXBJbmZvKSkgfHwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHBNZ210LT5lQ29uZmlnTW9kZSA9PSBXTUFDX0NPTkZJR19FU1NfU1RBKSAmJiBXTEFOX0dFVF9DQVBfSU5GT19FU1MocEN1cnJCU1MtPndDYXBJbmZvKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ3VyckJTUy0+YlNlbGVjdGVkID0gVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ3VyckJTUy0+YlNlbGVjdGVkID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4ocEN1cnJCU1MpOwogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICB9CkBAIC0xOTMsNyArMTk0LDcgQEAKICAgICAgICAgZm9yIChpaSA9IDA7IGlpIDxNQVhfQlNTX05VTTsgaWkrKykgewogICAgICAgICAgICAgcEN1cnJCU1MgPSAmKHBNZ210LT5zQlNTTGlzdFtpaV0pOwogCS8vMjAwNy0wNzIxLTAxPEFkZD5ieSBNaWtlTGl1Ci0JICBwQ3VyckJTUy0+YlNlbGVjdGVkID0gRkFMU0U7CisJICBwQ3VyckJTUy0+YlNlbGVjdGVkID0gZmFsc2U7CiAgICAgICAgICAgaWYgKHBDdXJyQlNTLT5iQWN0aXZlKSB7CiAKICAgICAgICAgICAgICAgICBpZiAocFNTSUQgIT0gTlVMTCkgewpAQCAtMjI0LDE5ICsyMjUsMTkgQEAKICAgICAgICAgICAgICAgICB9CiAvKgogICAgICAgICAgICAgICAgIGlmIChwTWdtdC0+ZUF1dGhlbk1vZGUgPCBXTUFDX0FVVEhfV1BBKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChwQ3VyckJTUy0+YldQQVZhbGlkID09IFRSVUUpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHBDdXJyQlNTLT5iV1BBVmFsaWQgPT0gdHJ1ZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgLy8gV1BBIEFQIHdpbGwgcmVqZWN0IGNvbm5lY3Rpb24gb2Ygc3RhdGlvbiB3aXRob3V0IFdQQSBlbmFibGUuCiAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHBNZ210LT5lQXV0aGVuTW9kZSA9PSBXTUFDX0FVVEhfV1BBKSB8fAogICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBNZ210LT5lQXV0aGVuTW9kZSA9PSBXTUFDX0FVVEhfV1BBUFNLKSkgewotICAgICAgICAgICAgICAgICAgICBpZiAocEN1cnJCU1MtPmJXUEFWYWxpZCA9PSBGQUxTRSkgeworICAgICAgICAgICAgICAgICAgICBpZiAocEN1cnJCU1MtPmJXUEFWYWxpZCA9PSBmYWxzZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgLy8gc3RhdGlvbiB3aXRoIFdQQSBlbmFibGUgY2FuJ3Qgam9pbiBOb25XUEEgQVAuCiAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHBNZ210LT5lQXV0aGVuTW9kZSA9PSBXTUFDX0FVVEhfV1BBMikgfHwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwTWdtdC0+ZUF1dGhlbk1vZGUgPT0gV01BQ19BVVRIX1dQQTJQU0spKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChwQ3VyckJTUy0+YldQQTJWYWxpZCA9PSBGQUxTRSkgeworICAgICAgICAgICAgICAgICAgICBpZiAocEN1cnJCU1MtPmJXUEEyVmFsaWQgPT0gZmFsc2UpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHN0YXRpb24gd2l0aCBXUEEyIGVuYWJsZSBjYW4ndCBqb2luIE5vbldQQTIgQVAuCiAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgICAgICAgICAgfQpAQCAtMjUzLDkgKzI1NCw5IEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgICAgaWYgKHBTZWxlY3QgIT0gTlVMTCkgewotICAgICAgICAgICAgcFNlbGVjdC0+YlNlbGVjdGVkID0gVFJVRTsKKyAgICAgICAgICAgIHBTZWxlY3QtPmJTZWxlY3RlZCA9IHRydWU7CiAvKgotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBEZXZpY2UtPmJSb2FtaW5nID09IEZBTFNFKSAgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBEZXZpY2UtPmJSb2FtaW5nID09IGZhbHNlKSAgewogCS8vICAgICAgIEVpbnNuIEFkZCBAMjAwNzA5MDcKIAkJCW1lbXNldChwYnlEZXNpcmVTU0lELCAwLCBXTEFOX0lFSERSX0xFTiArIFdMQU5fU1NJRF9NQVhMRU4gKyAxKTsKIAkJCW1lbWNweShwYnlEZXNpcmVTU0lELHBDdXJyQlNTLT5hYnlTU0lELFdMQU5fSUVIRFJfTEVOICsgV0xBTl9TU0lEX01BWExFTiArIDEpIDsKQEAgLTI4MywxOCArMjg0LDE4IEBACiB2b2lkCiBCU1N2Q2xlYXJCU1NMaXN0KAogICAgIHZvaWQgKmhEZXZpY2VDb250ZXh0LAotICAgIEJPT0wgYktlZXBDdXJyQlNTSUQKKyAgICBib29sIGJLZWVwQ3VyckJTU0lECiAgICAgKQogewogICAgIFBTRGV2aWNlICAgICBwRGV2aWNlID0gKFBTRGV2aWNlKWhEZXZpY2VDb250ZXh0OwogICAgIFBTTWdtdE9iamVjdCAgICBwTWdtdCA9IHBEZXZpY2UtPnBNZ210OwotICAgIFVJTlQgICAgICAgICAgICBpaTsKKyAgICB1bnNpZ25lZCBpbnQgaWk7CiAKICAgICBmb3IgKGlpID0gMDsgaWkgPCBNQVhfQlNTX05VTTsgaWkrKykgewogICAgICAgICBpZiAoYktlZXBDdXJyQlNTSUQpIHsKICAgICAgICAgICAgIGlmIChwTWdtdC0+c0JTU0xpc3RbaWldLmJBY3RpdmUgJiYKLSAgICAgICAgICAgICAgICBJU19FVEhfQUREUkVTU19FUVVBTChwTWdtdC0+c0JTU0xpc3RbaWldLmFieUJTU0lELCBwTWdtdC0+YWJ5Q3VyckJTU0lEKSkgewotICAgICAgICAgICAgICAgLy8gYktlZXBDdXJyQlNTSUQgPSBGQUxTRTsKKyAgICAgICAgICAgICAgICAhY29tcGFyZV9ldGhlcl9hZGRyKHBNZ210LT5zQlNTTGlzdFtpaV0uYWJ5QlNTSUQsIHBNZ210LT5hYnlDdXJyQlNTSUQpKSB7CisgICAgICAgICAgICAgICAvLyBiS2VlcEN1cnJCU1NJRCA9IGZhbHNlOwogICAgICAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICAgICAgfQogICAgICAgICB9CkBAIC0zMDQsNyArMzA1LDcgQEAKICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgfQogCi0gICAgICAgIHBNZ210LT5zQlNTTGlzdFtpaV0uYkFjdGl2ZSA9IEZBTFNFOworICAgICAgICBwTWdtdC0+c0JTU0xpc3RbaWldLmJBY3RpdmUgPSBmYWxzZTsKICAgICAgICAgbWVtc2V0KCZwTWdtdC0+c0JTU0xpc3RbaWldLCAwLCBzaXplb2YoS25vd25CU1MpKTsKICAgICB9CiAgICAgQlNTdkNsZWFyQW55QlNTSm9pblJlY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TTGlzdC0+YWJ5QlNTSUQsICZwQlNTTGlzdC0+c1JTTkNhcE9iaik7CiAKLSAgICAgICAgICAgIGlmICgocERldmljZS0+YkxpbmtQYXNzID09IFRSVUUpICYmIChwTWdtdC0+ZUN1cnJTdGF0ZSA9PSBXTUFDX1NUQVRFX0FTU09DKSkgewotICAgICAgICAgICAgICAgIGlmICgoS2V5YkdldFRyYW5zbWl0S2V5KCYocERldmljZS0+c0tleSksIHBEZXZpY2UtPmFieUJTU0lELCBQQUlSV0lTRV9LRVksICZwVHJhbnNtaXRLZXkpID09IFRSVUUpIHx8Ci0gICAgICAgICAgICAgICAgICAgIChLZXliR2V0VHJhbnNtaXRLZXkoJihwRGV2aWNlLT5zS2V5KSwgcERldmljZS0+YWJ5QlNTSUQsIEdST1VQX0tFWSwgJnBUcmFuc21pdEtleSkgPT0gVFJVRSkpIHsKKyAgICAgICAgICAgIGlmICgocERldmljZS0+YkxpbmtQYXNzID09IHRydWUpICYmIChwTWdtdC0+ZUN1cnJTdGF0ZSA9PSBXTUFDX1NUQVRFX0FTU09DKSkgeworICAgICAgICAgICAgICAgIGlmICgoS2V5YkdldFRyYW5zbWl0S2V5KCYocERldmljZS0+c0tleSksIHBEZXZpY2UtPmFieUJTU0lELCBQQUlSV0lTRV9LRVksICZwVHJhbnNtaXRLZXkpID09IHRydWUpIHx8CisgICAgICAgICAgICAgICAgICAgIChLZXliR2V0VHJhbnNtaXRLZXkoJihwRGV2aWNlLT5zS2V5KSwgcERldmljZS0+YWJ5QlNTSUQsIEdST1VQX0tFWSwgJnBUcmFuc21pdEtleSkgPT0gdHJ1ZSkpIHsKICAgICAgICAgICAgICAgICAgICAgcERldmljZS0+Z3NQTUtJRENhbmRpZGF0ZS5TdGF0dXNUeXBlID0gTmRpczgwMl8xMVN0YXR1c1R5cGVfUE1LSURfQ2FuZGlkYXRlTGlzdDsKICAgICAgICAgICAgICAgICAgICAgcERldmljZS0+Z3NQTUtJRENhbmRpZGF0ZS5WZXJzaW9u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JiYgKHBJRV9RdWlldCAhPSBOVUxMKSkgeworICAgIGlmICgoYlBhcnNpbmdRdWlldCA9PSB0cnVlKSAmJiAocElFX1F1aWV0ICE9IE5VTEwpKSB7CiAgICAgICAgIGlmICgoKChQV0xBTl9JRV9RVUlFVClwSUVfUXVpZXQpLT5sZW4gPT0gOCkgJiYKICAgICAgICAgICAgICgoKFBXTEFOX0lFX1FVSUVUKXBJRV9RdWlldCktPmJ5UXVpZXRDb3VudCAhPSAwKSkgewogICAgICAgICAgICAgLy8gdmFsaWQgRUlECiAgICAgICAgICAgICBpZiAocFF1aWV0ID09IE5VTEwpIHsKICAgICAgICAgICAgICAgICBwUXVpZXQgPSAoUFdMQU5fSUVfUVVJRVQpcElFX1F1aWV0OwogICAgICAgICAgICAgICAgIENBUkRiU2V0UXVpZXQoICBwTWdtdC0+cEFkYXB0ZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRSVUUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRydWUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBRdWlldC0+YnlRdWlldENvdW50LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUXVpZXQtPmJ5UXVpZXRQZXJpb2QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICooKFBXT1JEKXBRdWlldC0+YWJ5UXVpZXREdXJhdGlvbiksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICooKFBXT1JEKXBRdWlldC0+YWJ5UXVpZXRPZmZzZXQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICooKHVuc2lnbmVkIHNob3J0ICopcFF1aWV0LT5hYnlRdWlldER1cmF0aW9uKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKigodW5zaWduZWQgc2hvcnQgKilwUXVpZXQtPmFieVF1aWV0T2Zmc2V0KQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICBwUXVpZXQgPSAoUFdMQU5fSUVfUVVJRVQpcElFX1F1aWV0OwogICAgICAgICAgICAgICAgIENBUkRiU2V0UXVpZXQoICBwTWdtdC0+cEFkYXB0ZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZBTFNFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYWxzZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFF1aWV0LT5ieVF1aWV0Q291bnQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBRdWlldC0+YnlRdWlldFBlcmlvZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKigoUFdPUkQpcFF1aWV0LT5hYnlRdWlldER1cmF0aW9uKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKigoUFdPUkQpcFF1aWV0LT5hYnlRdWlldE9mZnNldCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKigodW5zaWduZWQgc2hvcnQgKilwUXVpZXQtPmFieVF1aWV0RHVyYXRpb24pLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKCh1bnNpZ25lZCBzaG9ydCAqKXBRdWlldC0+YWJ5UXVpZXRPZmZzZXQpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9CiAKLSAgICBpZiAoKGJQYXJzaW5nUXVpZXQgPT0gVFJVRSkgJiYKKyAgICBpZiAoKGJQYXJzaW5nUXVpZXQgPT0gdHJ1ZSkgJiYKICAgICAgICAgKHBRdWlldCAhPSBOVUxMKSkgewogICAgICAgICBDQVJEYlN0YXJ0UXVpZXQocE1nbXQtPnBBZGFwdGVyKTsKICAgICB9CkBAIC01NjgsNyArNTY4LDcgQEAKICAgICAgICAgcEJTU0xpc3QtPnVJRUxlbmd0aCA9IFdMQU5fQk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PSBSU1NJX1NUQVRfQ09VTlQ7CkBAIC03MDMsMzkgKzcwMywzOCBAQAogICAgIH0KIAogICAgIGlmICgocElFX0NvdW50cnkgIT0gTlVMTCkgJiYKLSAgICAgICAgKHBNZ210LT5iMTFoRW5hYmxlID09IFRSVUUpKSB7Ci0gICAgICAgIENBUkR2U2V0Q291bnRyeUluZm8ocE1nbXQtPnBBZGFwdGVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBCU1NMaXN0LT5lTmV0d29ya1R5cGVJblVzZSwKKyAgICAgICAgKHBNZ210LT5iMTFoRW5hYmxlID09IHRydWUpKSB7CisgICAgICAgIHNldF9jb3VudHJ5X2luZm8ocE1nbXQtPnBBZGFwdGVyLCBwQlNTTGlzdC0+ZU5ldHdvcmtUeXBlSW5Vc2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcElFX0NvdW50cnkpOwogICAgIH0KIAotICAgIGlmICgoYlBhcnNpbmdRdWlldCA9PSBUUlVFKSAmJiAocElFX1F1aWV0ICE9IE5VTEwpKSB7CisgICAgaWYgKChiUGFyc2luZ1F1aWV0ID09IHRydWUpICYmIChwSUVfUXVpZXQgIT0gTlVMTCkpIHsKICAgICAgICAgaWYgKCgoKFBXTEFOX0lFX1FVSUVUKXBJRV9RdWlldCktPmxlbiA9PSA4KSAmJgogICAgICAgICAgICAgKCgoUFdMQU5fSUVfUVVJRVQpcElFX1F1aWV0KS0+YnlRdWlldENvdW50ICE9IDApKSB7CiAgICAgICAgICAgICAvLyB2YWxpZCBFSUQKICAgICAgICAgICAgIGlmIChwUXVpZXQgPT0gTlVMTCkgewogICAgICAgICAgICAgICAgIHBRdWlldCA9IChQV0xBTl9JRV9RVUlFVClwSUVfUXVpZXQ7CiAgICAgICAgICAgICAgICAgQ0FSRGJTZXRRdWlldCggIHBNZ210LT5wQWRhcHRlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVFJVRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ1ZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFF1aWV0LT5ieVF1aWV0Q291bnQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBRdWlldC0+YnlRdWlldFBlcmlvZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKigoUFdPUkQpcFF1aWV0LT5hYnlRdWlldER1cmF0aW9uKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKigoUFdPUkQpcFF1aWV0LT5hYnlRdWlldE9mZnNldCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKigodW5zaWduZWQgc2hvcnQgKilwUXVpZXQtPmFieVF1aWV0RHVyYXRpb24pLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKCh1bnNpZ25lZCBzaG9ydCAqKXBRdWlldC0+YWJ5UXVpZXRPZmZzZXQpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7CiAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgIHBRdWlldCA9IChQV0xBTl9JRV9RVUlFVClwSUVfUXVpZXQ7CiAgICAgICAgICAgICAgICAgQ0FSRGJTZXRRdWlldCggIHBNZ210LT5wQWRhcHRlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkFMU0UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUXVpZXQtPmJ5UXVpZXRDb3VudCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFF1aWV0LT5ieVF1aWV0UGVyaW9kLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKChQV09SRClwUXVpZXQtPmFieVF1aWV0RHVyYXRpb24pLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKChQV09SRClwUXVpZXQtPmFieVF1aWV0T2Zmc2V0KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKCh1bnNpZ25lZCBzaG9ydCAqKXBRdWlldC0+YWJ5UXVpZXREdXJhdGlvbiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICooKHVuc2lnbmVkIHNob3J0ICopcFF1aWV0LT5hYnlRdWlldE9mZnNldCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KIAotICAgIGlmICgoYlBhcnNpbmdRdWlldCA9PSBUUlVFKSAmJgorICAgIGlmICgoYlBhcnNpbmdRdWlldCA9PSB0cnVlKSAmJgogICAgICAgICAocFF1aWV0ICE9IE5VTEwpKSB7CiAgICAgICAgIENBUkRiU3RhcnRRdWlldChwTWdtdC0+cEFkYXB0ZXIpOwogICAgIH0KQEAgLTc0NSw3ICs3NDQsNyBAQAogICAgICAgICBwQlNTTGlzdC0+dUlFTGVuZ3RoID0gV0xBTl9CRUFDT05fRlJfTUFYTEVOOwogICAgIG1lbWNweShwQlNTTGlzdC0+YWJ5SUVzLCBwYnlJRXMsIHBCU1NMaXN0LT51SUVMZW5ndGgpOwogCi0gICAgcmV0dXJuIFRSVUU7CisgICAgcmV0dXJuIHRydWU7CiB9CiAKIApAQCAtNzYyLDI3ICs3NjEsMjQgQEAKICAqCiAtKi8KIAotQk9PTAotQlNTREJiSXNTVEFJbk5vZGVEQigKLSAgICB2b2lkICpwTWdtdE9iamVjdCwKLSAgICBQQllURSBhYnlEc3RBZGRyLAotICAgIFBVSU5UIHB1Tm9kZUluZGV4Ci0gICAgKQorYm9vbAorQlNTREJiSXNTVEFJbk5vZGVEQih2b2lkICpwTWdtdE9iamVjdCwgdW5zaWduZWQgY2hhciAqYWJ5RHN0QWRkciwKKwkJdW5zaWduZWQgaW50ICpwdU5vZGVJbmRleCkKIHsKICAgICBQU01nbXRPYmplY3QgICAgcE1nbXQgPSAoUFNNZ210T2JqZWN0KSBwTWdtdE9iamVjdDsKLSAgICBVSU5UICAgICAgICAgICAgaWk7CisgICAgdW5zaWduZWQgaW50IGlpOwogCiAgICAgLy8gSW5kZXggPSAwIHJlc2VydmVkIGZvciBBUCBOb2RlCiAgICAgZm9yIChpaSA9IDE7IGlpIDwgKE1BWF9OT0RFX05VTSArIDEpOyBpaSsrKSB7CiAgICAgICAgIGlmIChwTWdtdC0+c05vZGVEQlRhYmxlW2lpXS5iQWN0aXZlKSB7Ci0gICAgICAgICAgICBpZiAoSVNfRVRIX0FERFJFU1NfRVFVQUwoYWJ5RHN0QWRkciwgcE1nbXQtPnNOb2RlREJUYWJsZVtpaV0uYWJ5TUFDQWRkcikpIHsKKyAgICAgICAgICAgIGlmICghY29tcGFyZV9ldGhlcl9hZGRyKGFieURzdEFkZHIsIHBNZ210LT5zTm9kZURCVGFibGVbaWldLmFieU1BQ0FkZHIpKSB7CiAgICAgICAgICAgICAgICAgKnB1Tm9kZUluZGV4ID0gaWk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIFRSVUU7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9CiAKLSAgIHJldHVybiBGQUxTRTsKKyAgIHJldHVybiBmYWxzZTsKIH07CiAKIApAQCAtNzk4LDE3ICs3OTQsMTQgQEAKICAqCiAtKi8KIHZvaWQKLUJTU3ZDcmVhdGVPbmVOb2RlKAotICAgIHZvaWQgKmhEZXZpY2VDb250ZXh0LAotICAgIFBVSU5UIHB1Tm9kZUluZGV4Ci0gICAgKQorQlNTdkNyZWF0ZU9uZU5vZGUodm9pZCAqaERldmljZUNvbnRleHQsIHVuc2lnbmVkIGludCAqcHVOb2RlSW5kZXgpCiB7CiAKICAgICBQU0RldmljZSAgICAgcERldmljZSA9IChQU0RldmljZSloRGV2aWNlQ29udGV4dDsKICAgICBQU01nbXRPYmplY3QgICAgcE1nbXQgPSBwRGV2aWNlLT5wTWdtdDsKLSAgICBVSU5UICAgICAgICAgICAgaW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2ZSA9IHRydWU7CiAgICAgaWYgKHBEZXZpY2UtPmVDdXJyZW50UEhZVHlwZSA9PSBQSFlfVFlQRV8xMUIpIHsKICAgICAgICAgdVJhdGVMZW4gPSBXTEFOX1JBVEVTX01BWExFTl8xMUI7CiAgICAgfQpAQCAtOTIyLDcgKzkxNSw3IEBACiAgICAgUkFURXZQYXJzZU1heFJhdGUoKHZvaWQgKilwRGV2aWNlLAogICAgICAgICAgICAgICAgICAgICAgICAoUFdMQU5fSUVfU1VQUF9SQVRFUylwTWdtdC0+YWJ5Q3VyclN1cHBSYXRlcywKICAgICAgICAgICAgICAgICAgICAgICAgKFBXTEFOX0lFX1NVUFBfUkFURVMpcE1nbXQtPmFieUN1cnJFeHRTdXBwUmF0ZXMsCi0gICAgICAgICAgICAgICAgICAgICAgIFRSVUUsCisgICAgICAgICAgICAgICAgICAgICAgIHRydWUsCiAgICAgICAgICAgICAgICAgICAgICAgICYocE1nbXQtPnNOb2RlREJUYWJsZVswXS53TWF4QmFzaWNSYXRlKSwKICAgICAgICAgICAgICAgICAgICAgICAgJihwTWdtdC0+c05vZGVEQlRhYmxlWzBdLndNYXhTdXBwUmF0ZSksCiAgICAgICAgICAgICAgICAgICAgICAgICYocE1nbXQtPnNOb2RlREJUYWJsZVswXS53U3VwcFJhdGUpLApAQCAtOTY5LDEzICs5NjIsMTMgQEAKICAgICBpZiAoIXBEZXZpY2UtPmJFbmFibGVIb3N0V0VQKQogICAgICAgICBtZW1zZXQoJnBNZ210LT5zTm9kZURCVGFibGVbMF0sIDAsIHNpemVvZihLbm93bk5vZGVEQikpOwogICAgIG1lbXNldChwTWdtdC0+c05vZGVEQlRhYmxlWzBdLmFieU1BQ0FkZHIsIDB4ZmYsIFdMQU5fQUREUl9MRU4pOwotICAgIHBNZ210LT5zTm9kZURCVGFibGVbMF0uYkFjdGl2ZSA9IFRSVUU7Ci0gICAgcE1nbXQtPnNOb2RlREJUYWJsZVswXS5iUFNFbmFibGUgPSBGQUxTRTsKKy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91dCEhIVxuIik7CiAJCSAgIHBEZXZpY2UtPmJ5UmVBc3NvY0NvdW50ID0gMDsKICAgICAgICAgICAgICAgICAgICAgICNpZmRlZiBXUEFfU1VQUExJQ0FOVF9EUklWRVJfV0VYVF9TVVBQT1JUCi0gICAgICAgICAgICAgICAgICAgIC8vIGlmKHBEZXZpY2UtPmJXUEFTdXBwV2V4dEVuYWJsZWQgPT0gVFJVRSkKKyAgICAgICAgICAgICAgICAgICAgLy8gaWYocERldmljZS0+YldQQVN1cHBXZXh0RW5hYmxlZCA9PSB0cnVlKQogICAgICAgICAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgCXVuaW9uIGl3cmVxX2RhdGEgIHdycXU7CiAgICAgICAgICAgICAgICAgICAJbWVtc2V0KCZ3cnF1LCAwLCBzaXplb2YgKHdycXUpKTsKQEAgLTExMDYsNyArMTA5OSw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgI2VuZGlmCiAgICAgIH0KLSAgIGVsc2UgaWYocERldmljZS0+YkxpbmtQYXNzID09IFRSVUUpCisgICBlbHNlIGlmKHBEZXZpY2UtPmJMaW5rUGFzcyA9PSB0cnVlKQogICAgCXBEZXZpY2UtPmJ5UmVBc3NvY0NvdW50ID0gMDsKIH0KIApAQCAtMTIwMCwyNyArMTE5MywyNyBAQAogICAgICAgICBpZiAoV0xBTl9HRVRfRVJQX1VTRV9QUk9URUNUSU9OKHBEZXZpY2UtPmJ5RVJQRmxhZykpIHsKICAgICAgICAgICAgIGlmICghcERldmljZS0+YlByb3RlY3RNb2RlKSB7CiAgICAgICAgICAgICAgICAgTUFDdkVuYWJsZVByb3RlY3RNRChwRGV2aWNlLT5Qb3J0T2Zmc2V0KTsKLSAgICAgICAgICAgICAgICBwRGV2aWNlLT5iUHJvdGVjdE1vZGUgPSBUUlVFOworICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJQcm90ZWN0TW9kZSA9IHRydWU7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICBpZiAocERldmljZS0+YlByb3RlY3RNb2RlKSB7CiAgICAgICAgICAgICAgICAgTUFDdkRpc2FibGVQcm90ZWN0TUQocERldmljZS0+UG9ydE9mZnNldCk7Ci0gICAgICAgICAgICAgICAgcERldmljZS0+YlByb3RlY3RNb2RlID0gRkFMU0U7CisgICAgICAgICAgICAgICAgcERldmljZS0+YlByb3RlY3RNb2RlID0gZmFsc2U7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgICAgLy8gb24vb2ZmIHNob3J0IHNsb3QgdGltZQogCiAgICAgICAgIGlmICh1Tm9uU2hvcnRTbG90U1RBQ250ID4gMCkgewogICAgICAgICAgICAgaWYgKHBEZXZpY2UtPmJTaG9ydFNsb3RUaW1lKSB7Ci0gICAgICAgICAgICAgICAgcERldmljZS0+YlNob3J0U2xvdFRpbWUgPSBGQUxTRTsKKyAgICAgICAgICAgICAgICBwRGV2aWNlLT5iU2hvcnRTbG90VGltZSA9IGZhbHNlOwogICAgICAgICAgICAgICAgIEJCdlNldFNob3J0U2xvdFRpbWUocERldmljZSk7CiAgICAgICAgICAgICAgICAgdlVwZGF0ZUlGUygodm9pZCAqKXBEZXZpY2UpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgaWYgKCFwRGV2aWNlLT5iU2hvcnRTbG90VGltZSkgewotICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJTaG9ydFNsb3RUaW1lID0gVFJVRTsKKyAgICAgICAgICAgICAgICBwRGV2aWNlLT5iU2hvcnRTbG90VGltZSA9IHRydWU7CiAgICAgICAgICAgICAgICAgQkJ2U2V0U2hvcnRTbG90VGltZShwRGV2aWNlKTsKICAgICAgICAgICAgICAgICB2VXBkYXRlSUZTKCh2b2lkICopcERldmljZSk7CiAgICAgICAgICAgICB9CkBAIC0xMjMxLDEzICsxMjI0LDEzIEBACiAgICAgICAgIGlmICh1TG9uZ1ByZWFtYmxlU1RBQ250ID4gMCkgewogICAgICAgICAgICAgaWYgKCFwRGV2aWNlLT5iQmFya2VyUHJlYW1ibGVNZCkgewogICAgICAgICAgICAgICAgIE1BQ3ZFbmFibGVCYXJrZXJQcmVhbWJsZU1kKHBEZXZpY2UtPlBvcnRPZmZzZXQpOwotICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJCYXJrZXJQcmVhbWJsZU1kID0gVFJVRTsKKyAgICAgICAgICAgICAgICBwRGV2aWNlLT5iQmFya2VyUHJlYW1ibGVNZCA9IHRydWU7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICBpZiAocERldmljZS0+YkJhcmtlclByZWFtYmxlTWQpIHsKICAgICAgICAgICAgICAgICBNQUN2RGlzYWJsZUJhcmtlclByZWFtYmxlTWQocERldmljZS0+UG9ydE9mZnNldCk7Ci0gICAgICAgICAgICAgICAgcERldmljZS0+YkJhcmtlclByZWFtYmxlTWQgPSBGQUxTRTsKKyAgICAgICAgICAgICAgICBwRGV2aWNlLT5iQmFya2VyUHJlYW1ibGVNZCA9IGZhbHNlOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAKQEAgLTEyNDcsOSArMTI0MCw5IEBACiAgICAgLy8gQ2hlY2sgaWYgYW55IFNUQSBpbiBQUyBtb2RlLCBlbmFibGUgRFRJTSBtdWx0aWNhc3QgZGVsaXZlcgogICAgIGlmIChwTWdtdC0+ZUN1cnJNb2RlID09IFdNQUNfTU9ERV9FU1NfQVApIHsKICAgICAgICAgaWYgKHVTbGVlcHlTVEFDbnQgPiAwKQotICAgICAgICAgICAgcE1nbXQtPnNOb2RlREJUYWJsZVswXS5iUFNFbmFibGUgPSBUUlVFOworICAgICAgICAgICAgcE1nbXQtPnNOb2RlREJUYWJsZVswXS5iUFNFbmFibGUgPSB0cnVlOwogICAgICAgICBlbHNlCi0gICAgICAgICAgICBwTWdtd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LDcgQEAKICAgICAgICAgICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlWzBdLnVJbkFjdGl2ZUNvdW50ID0gMDsKICAgICAgICAgICAgICAgICBwTWdtdC0+ZUN1cnJTdGF0ZSA9IFdNQUNfU1RBVEVfU1RBUlRFRDsKICAgICAgICAgICAgICAgICBuZXRpZl9zdG9wX3F1ZXVlKHBEZXZpY2UtPmRldik7Ci0gICAgICAgICAgICAgICAgcERldmljZS0+YkxpbmtQYXNzID0gRkFMU0U7CisgICAgICAgICAgICAgICAgcERldmljZS0+YkxpbmtQYXNzID0gZmFsc2U7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9CkBAIC0xMzkxLDIzICsxMzg0LDIzIEBACiB2b2lkCiBCU1N2VXBkYXRlTm9kZVR4Q291bnRlcigKICAgICB2b2lkICpoRGV2aWNlQ29udGV4dCwKLSAgICBCWVRFICAgICAgICBieVRzcjAsCi0gICAgQllURSAgICAgICAgYnlUc3IxLAotICAgIFBCWVRFICAgICAgIHBieUJ1ZmZlciwKLSAgICBVSU5UICAgICAgICB1RklGT0hlYWRlclNpemUKKyAgICB1bnNpZ25lZCBjaGFyIGJ5VHNyMCwKKyAgICB1bnNpZ25lZCBjaGFyIGJ5VHNyMSwKKyAgICB1bnNpZ25lZCBjaGFyICpwYnlCdWZmZXIsCisgICAgdW5zaWduZWQgaW50IHVGSUZPSGVhZGVyU2l6ZQogICAgICkKIHsKICAgICBQU0RldmljZSAgICAgICAgcERldmljZSA9IChQU0RldmljZSloRGV2aWNlQ29udGV4dDsKICAgICBQU01nbXRPYmplY3QgICAgcE1nbXQgPSBwRGV2aWNlLT5wTWdtdDsKLSAgICBVSU5UICAgICAgICAgICAgdU5vZGVJbmRleCA9IDA7Ci0gICAgQllURSAgICAgICAgICAgIGJ5VHhSZXRyeSA9IChieVRzcjAgJiBUU1IwX05DUik7CisgICAgdW5zaWduZWQgaW50IHVOb2RlSW5kZXggPSAwOworICAgIHVuc2lnbmVkIG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IRFJfTEVOICsgV0xBTl9SQVRFU19NQVhMRU4gKyAxXTsKLSAgICBVSU5UICAgICAgICAgICAgdVJTU0k7Ci0gICAgQllURSAgICAgICAgICAgIGJ5U1E7Ci0gICAgV09SRCAgICAgICAgICAgIHdCZWFjb25JbnRlcnZhbDsKLSAgICBXT1JEICAgICAgICAgICAgd0NhcEluZm87Ci0gICAgQllURSAgICAgICAgICAgIGFieVNTSURbV0xBTl9JRUhEUl9MRU4gKyBXTEFOX1NTSURfTUFYTEVOICsgMV07Ci0gICAgQllURSAgICAgICAgICAgIGJ5UnhSYXRlOworICAgIGJvb2wgYkFjdGl2ZTsKKyAgICB1bnNpZ25lZCBjaGFyIGFieUJTU0lEW1dMQU5fQlNTSURfTEVOXTsKKyAgICB1bnNpZ25lZCBpbnQJdUNoYW5uZWw7CisgICAgdW5zaWduZWQgY2hhciBhYnlTdXBwUmF0ZXNbV0xBTl9JRUhEUl9MRU4gKyBXTEFOX1JBVEVTX01BWExFTiArIDFdOworICAgIHVuc2lnbmVkIGNoYXIgYWJ5RXh0U3VwcFJhdGVzW1dMQU5fSUVIRFJfTEVOICsgV0xBTl9SQVRFU19NQVhMRU4gKyAxXTsKKyAgICB1bnNpZ25lZCBpbnQJdVJTU0k7CisgICAgdW5zaWduZWQgY2hhciBieVNROworICAgIHVuc2lnbmVkIHNob3J0IHdCZWFjb25JbnRlcnZhbDsKKyAgICB1bnNpZ25lZCBzaG9ydCB3Q2FwSW5mbzsKKyAgICB1bnNpZ25lZCBjaGFyIGFieVNTSURbV0xBTl9JRUhEUl9MRU4gKyBXTEFOX1NTSURfTUFYTEVOICsgMV07CisgICAgdW5zaWduZWQgY2hhciBieVJ4UmF0ZTsKIAotLy8gICAgV09SRCAgICAgICAgICAgIHdBVElNV2luZG93OwotICAgIEJZVEUgICAgICAgICAgICBieVJTU0lTdGF0Q250OwotICAgIExPTkcgICAgICAgICAgICBsZEJtTUFYOwotICAgIExPTkcgICAgICAgICAgICBsZEJtQXZlcmFnZVtSU1NJX1NUQVRfQ09VTlRdOwotICAgIExPTkcgICAgICAgICAgICBsZEJtQXZlclJhbmdlOworLy8gICAgdW5zaWduZWQgc2hvcnQgd0FUSU1XaW5kb3c7CisgICAgdW5zaWduZWQgY2hhciBieVJTU0lTdGF0Q250OworICAgIGxvbmcgICAgICAgICAgICBsZEJtTUFYOworICAgIGxvbmcgICAgICAgICAgICBsZEJtQXZlcmFnZVtSU1NJX1NUQVRfQ09VTlRdOworICAgIGxvbmcgICAgICAgICAgICBsZEJtQXZlclJhbmdlOwogICAgIC8vRm9yIGFueSBCU1NJRCBzZWxlY3Rpb24gaW1wcm92bWVudAotICAgIEJPT0wgICAgICAgICAgICBiU2VsZWN0ZWQ7CisgICAgYm9vbCBiU2VsZWN0ZWQ7CiAKICAgICAvLysrIFdQQSBpbmZvcm1hdGlvbnMKLSAgICBCT09MICAgICAgICAgICAgYldQQVZhbGlkOwotICAgIEJZVEUgICAgICAgICAgICBieUdLVHlwZTsKLSAgICBCWVRFICAgICAgICAgICAgYWJ5UEtUeXBlWzRdOwotICAgIFdPUkQgICAgICAgICAgICB3UEtDb3VudDsKLSAgICBCWVRFICAgICAgICAgICAgYWJ5QXV0aFR5cGVbNF07Ci0gICAgV09SRCAgICAgICAgICAgIHdBdXRoQ291bnQ7Ci0gICAgQllURSAgICAgICAgICAgIGJ5RGVmYXVsdEtfYXNfUEs7Ci0gICAgQllURSAgICAgICAgICAgIGJ5UmVwbGF5SWR4OworICAgIGJvb2wgYldQQVZhbGlkOworICAgIHVuc2lnbmVkIGNoYXIgYnlHS1R5cGU7CisgICAgdW5zaWduZWQgY2hhciBhYnlQS1R5cGVbNF07CisgICAgdW5zaWduZWQgc2hvcnQgd1BLQ291bnQ7CisgICAgdW5zaWduZWQgY2hhciBhYnlBdXRoVHlwZVs0XTsKKyAgICB1bnNpZ25lZCBzaG9ydCB3QXV0aENvdW50OworICAgIHVuc2lnbmVkIGNoYXIgYnlEZWZhdWx0S19hc19QSzsKKyAgICB1bnNpZ25lZCBjaGFyIGJ5UmVwbGF5SWR4OwogICAgIC8vLS0KIAogICAgIC8vKysgV1BBMiBpbmZvcm1hdGlvbnMKLSAgICBCT09MICAgICAgICAgICAgYldQQTJWYWxpZDsKLSAgICBCWVRFICAgICAgICAgICAgYnlDU1NHSzsKLSAgICBXT1JEICAgICAgICAgICAgd0NTU1BLQ291bnQ7Ci0gICAgQllURSAgICAgICAgICAgIGFieUNTU1BLWzRdOwotICAgIFdPUkQgICAgICAgICAgICB3QUtNU1NBdXRoQ291bnQ7Ci0gICAgQllURSAgICAgICAgICAgIGFieUFLTVNTQXV0aFR5cGVbNF07CisgICAgYm9vbCBiV1BBMlZhbGlkOworICAgIHVuc2lnbmVkIGNoYXIgYnlDU1NHSzsKKyAgICB1bnNpZ25lZCBzaG9ydCB3Q1NTUEtDb3VudDsKKyAgICB1bnNpZ25lZCBjaGFyIGFieUNTU1BLWzRdOworICAgIHVuc2lnbmVkIHNob3J0IHdBS01TU0F1dGhDb3VudDsKKyAgICB1bnNpZ25lZCBjaGFyIGFieUFLTVNTQXV0aFR5cGVbNF07CiAKICAgICAvLysrICB3cGFjdGwKLSAgICBCWVRFICAgICAgICAgICAgYnlXUEFJRVtNQVhfV1BBX0lFX0xFTl07Ci0gICAgQllURSAgICAgICAgICAgIGJ5UlNOSUVbTUFYX1dQQV9JRV9MRU5dOwotICAgIFdPUkQgICAgICAgICAgICB3V1BBTGVuOwotICAgIFdPUkQgICAgICAgICAgICB3UlNOTGVuOworICAgIHVuc2lnbmVkIGNoYXIgYnlXUEFJRVtNQVhfV1BBX0lFX0xFTl07CisgICAgdW5zaWduZWQgY2hhciBieVJTTklFW01BWF9XUEFfSUVfTEVOXTsKKyAgICB1bnNpZ25lZCBzaG9ydCB3V1BBTGVuOworICAgIHVuc2lnbmVkIHNob3J0IHdSU05MZW47CiAKICAgICAvLyBDbGVhciBjb3VudAotICAgIFVJTlQgICAgICAgICAgICB1Q2xlYXJDb3VudDsKLS8vICAgIE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vciBlYWNoIGNvdW50cnkKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1TQ291bnRyeVRhYmxlIENoYW5uZWxSdWxlVGFiW0NDT0RFX01BWCsxXSA9Ci17Ci0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiBUaGlzIHRhYmxlIGlzIGJhc2VkIG9uIEF0aGVybyBkcml2ZXIgcnVsZXMKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiBDb3VudHJ5ICAgICAgICAgIEF2YWlsYWJsZSBjaGFubmVscywgZW5kZWQgd2l0aCAwICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAgIDIgICAzICAgNCAgIDUgICA2ICAgNyAgIDggICA5ICAxMCAgMTEgIDEyICAxMyAgMTQgIDE1ICAxNiAgMTcgIDE4ICAxOSAgMjAgIDIxICAyMiAgMjMgIDI0ICAyNSAgMjYgIDI3ICAyOCAgMjkgIDMwICAzMSAgMzIgIDMzICAzNCAgMzUgIDM2ICAzNyAgMzggIDM5ICA0MCAgNDEgIDQyICA0MyAgNDQgIDQ1ICA0NiAgNDcgIDQ4ICA0OSAgNTAgIDUxICA1MiAgNTMgIDU0ICA1NSAgNTYgICovCi17Q0NPREVfRkNDLCAgICAgICAgICAgICAgICAgICAgIHsnVScsJ1MnfSwgIHsgICAxLCAgMSwgIDEsICAxLCAgMSwgIDEsICAxLCAgMSwgIDEsICAxLCAgMSwgIDAsICAwLCAgMCwgIDAsICAwLCAgMCwgIDAsICAwLCAgMCwgIDAsICAwLCAgMCwgIDAsICAwLCAgMCwgIDAsICAwLCAgMCwgIDEsICAwLCAgMSwgIDAsICAx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gICAgICByZXR1cm4oZmFsc2UpOwogICAgICAgICAgICAgfQogICAgICAgICB9Ci0gICAgICAgIHBEZXZpY2UtPmJJc0JlYWNvbkJ1ZlJlYWR5U2V0ID0gRkFMU0U7CisgICAgICAgIHBEZXZpY2UtPmJJc0JlYWNvbkJ1ZlJlYWR5U2V0ID0gZmFsc2U7CiAgICAgICAgIHBEZXZpY2UtPmNiQmVhY29uQnVmUmVhZHlTZXRDbnQgPSAwOwogICAgICAgICBNQUN2UmVnQml0c09mZihwRGV2aWNlLT5Qb3J0T2Zmc2V0LCBNQUNfUkVHX1RDUiwgVENSX0FVVE9CQ05UWCk7CiAgICAgfQogICAgIC8vIHdhaXQgYWxsIFREMCBjb21wbGV0ZQotICAgIGlmIChwRGV2aWNlLT5iU3RvcFR4MFBrdCA9PSBUUlVFKSB7CisgICAgaWYgKHBEZXZpY2UtPmJTdG9wVHgwUGt0ID09IHRydWUpIHsKICAgICAgICAgIGlmIChwRGV2aWNlLT5pVERVc2VkW1RZUEVfVFhETUEwXSAhPSAwKXsKLSAgICAgICAgICAgIHJldHVybihGQUxTRSk7CisgICAgICAgICAgICByZXR1cm4oZmFsc2UpOwogICAgICAgICB9CiAgICAgfQogICAgIC8vIHdhaXQgYWxsIERhdGEgVEQgY29tcGxldGUKLSAgICBpZiAocERldmljZS0+YlN0b3BEYXRhUGt0ID09IFRSVUUpIHsKKyAgICBpZiAocERldmljZS0+YlN0b3BEYXRhUGt0ID09IHRydWUpIHsKICAgICAgICAgaWYgKHBEZXZpY2UtPmlURFVzZWRbVFlQRV9BQzBETUFdICE9IDApewotICAgICAgICAgICAgcmV0dXJuKEZBTFNFKTsKKyAgICAgICAgICAgIHJldHVybihmYWxzZSk7CiAgICAgICAgIH0KICAgICB9CiAKLSAgICByZXR1cm4oVFJVRSk7CisgICAgcmV0dXJuKHRydWUpOwogfQogCiAKQEAgLTEyNTIsMzMgKzc2OCwzMyBAQAogICogIE91dDoKICAqICAgICAgbm9uZQogICoKLSAqIFJ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RlWzFdKTsKLSAgICBmb3IoaWk9MDtpaTxDQVJEX01BWF9DSEFOTkVMX1RCTDtpaSsrKSB7Ci0gICAgICAgIGlmIChwRGV2aWNlLT5hYnlSZWdQd3JbaWkrMV0gPT0gMCkgewotICAgICAgICAgICAgcERldmljZS0+YWJ5UmVnUHdyW2lpKzFdID0gcERldmljZS0+YWJ5T0ZETURlZmF1bHRQd3JbaWkrMV07Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKHBEZXZpY2UtPmFieUxvY2FsUHdyW2lpKzFdID09IDApIHsKLSAgICAgICAgICAgIHBEZXZpY2UtPmFieUxvY2FsUHdyW2lpKzFdID0gcERldmljZS0+YWJ5T0ZETURlZmF1bHRQd3JbaWkrMV07Ci0gICAgICAgIH0KLSAgICB9Ci19Ci0KLQotCiAvKgogICoKICAqIERlc2NyaXB0aW9uOgpAQCAtMTcwNiwyNyArMTEzOSwyNyBAQAogICogUmV0dXJuIFZhbHVlOiBub25lLgogICoKIC0qLwotQk9PTAorYm9vbAogQ0FSRGJTdGFydE1lYXN1cmUgKAogICAgIHZvaWQgKnBEZXZpY2VIYW5kbGVyLAogICAgIHZvaWQgKnB2TWVhc3VyZUVJRHMsCi0gICAgVUlOVCAgICAgICAgICAgICB1TnVtT2ZNZWFzdXJlRUlEcworICAgIHVuc2lnbmVkIGludCB1TnVtT2ZNZWFzdXJlRUlEcwogICAgICkKIHsKICAgICBQU0RldmljZSAgICAgICAgICAgICAgICBwRGV2aWNlID0gKFBTRGV2aWNlKSBwRGV2aWNlSGFuZGxlcjsKICAgICBQV0xBTl9JRV9NRUFTVVJFX1JFUSAgICBwRUlEID0gKFBXTEFOX0lFX01FQVNVUkVfUkVRKSBwdk1lYXN1cmVFSURzOwogICAgIFFXT1JEICAgICAgICAgICAgICAgICAgIHF3Q3VyclRTRjsKICAgICBRV09SRCAgICAgICAgICAgICAgICAgICBxd1N0YXJ0VFNGOwotICAgIEJPT0wgICAgICAgICAgICAgICAgICAgIGJFeHBpcmV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3dpdGNoaW5nCiAKICAgICAgICAgICAgIGlmICgoTE9EV09SRChxd1N0YXJ0VFNGKSA9PSAwKSAmJiAoSElEV09SRChxd1N0YXJ0VFNGKSA9PSAwKSkgewpAQCAtMTc1OSw3ICsxMTkyLDcgQEAKICAgICAgICAgICAgICAgICBpZiAoTE9EV09SRChxd0N1cnJUU0YpID4gTE9EV09SRChxd1N0YXJ0VFNGKSkgewogICAgICAgICAgICAgICAgICAgICBISURXT1JEKHF3U3RhcnRUU0YpKys7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJFeHBpcmVkID0gRkFMU0U7CisgICAgICAgICAgICAgICAgYkV4cGlyZWQgPSBmYWxzZTsKICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgLy8gc3RhcnQgYXQgc2V0dGluZyBzdGFydCBUU0YgLSAxVFUoZm9yIGNoYW5uZWwgc3dpdGNoaW5nKQpAQCAtMTc3MywxMSArMTIwNiwxMSBAQAogICAgICAgICAgICAgICAgICgoSElEV09SRChxd0N1cnJUU0YpID09IEhJRFdPUkQocXdTdGFydFRTRikpICYmCiAgICAgICAgICAgICAgICAgKExPRFdPUkQocXdDdXJyVFNGKSA8IExPRFdPUkQocXdTdGFydFRTRikpKQogICAgICAgICAgICAgICAgICkgewotICAgICAgICAgICAgICAgIGJFeHBpcmVkID0gRkFMU0U7CisgICAgICAgICAgICAgICAgYkV4cGlyZWQgPSBmYWxzZTsKICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIFZOVFdJRkliTWVhc3VyZVJlcG9ydCggIHBEZXZpY2UtPnBNZ210LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkFMU0UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYWxzZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBEZXZpY2UtPnBDdXJyTWVhc3VyZUVJRCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1FQVNVUkVfTU9ERV9MQVRFLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERldmljZS0+YnlCYXNpY01hcCwKQEAgLTE3ODcsNyArMTIyMCw3IEBACiAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAvLyBoYXJkd2FyZSBkbyBub3Qgc3VwcG9ydCBtZWFzdXJlCiAgICAgICAgICAgICBWTlRXSUZJYk1lYXN1cmVSZXBvcnQoICBwRGV2aWNlLT5wTWdtdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZBTFNFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT5wQ3Vyck1lYXN1cmVFSUQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNRUFTVVJFX01PREVfSU5DQVBBQkxFLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERldmljZS0+YnlCYXNpY01hcCwKQEAgLTE3OTcsNyArMTIzMCw3IEBACiAgICAgICAgIH0KICAgICB9IHdoaWxlIChwRGV2aWNlLT51TnVtT2ZNZWFzdXJlRUlEcyAhPSAwKTsKIAotICAgIGlmIChiRXhwaXJlZCA9PSBGQUxTRSkgeworICAgIGlmIChiRXhwaXJlZCA9PSBmYWxzZSkgewogICAgICAgICBNQUN2U2VsZWN0UGFnZTEocERldmljZS0+UG9ydE9mZnNldCk7CiAgICAgICAgIFZOU3ZPdXRQb3J0RChwRGV2aWNlLT5Qb3J0T2Zmc2V0ICsgTUFDX1JFR19NU1JTVEFSVCwgTE9EV09SRChxd1N0YXJ0VFNGKSk7CiAgICAgICAgIFZOU3ZPdXRQb3J0RChwRGV2aWNlLT5Qb3J0T2Zmc2V0ICsgTUFDX1JFR19NU1JTVEFSVCArIDQsIEhJRFdPUkQocXdTdGFydFRTRikpOwpAQCAtMTgwNyw3ICsxMjQwLDcgQEAKICAgICB9IGVsc2UgewogICAgICAgICAvLyBhbGwgbWVhc3VyZSBzdGFydCB0aW1lIGV4cGlyZWQgd2Ugc2hvdWxkIGNvbXBsZXRlIGFjdGlvbgogICAgICAgICBWTlRXSUZJYk1lYXN1cmVSZXBvcnQoICBwRGV2aWNlLT5wTWdtdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVFJVRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ1ZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERldmljZS0+YnlCYXNpY01hcCwKQEAgLTE4MTUsNyArMTI0OCw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBEZXZpY2UtPmFieVJQSXMKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsKICAgICB9Ci0gICAgcmV0dXJuIChUUlVFKTsKKyAgICByZXR1cm4gKHRydWUpOwogfQogCiAKQEAgLTE4MzMsMTkgKzEyNjYsMTkgQEAKICAqIFJldHVybiBWYWx1ZTogbm9uZS4KICAqCiAtKi8KLUJPT0wKK2Jvb2wKIENBUkRiQ2hhbm5lbFN3aXRjaCAoCiAgICAgdm9pZCAqcERldmljZUhhbmRsZXIsCi0gICAgQllURSAgICAgICAgICAgICBieU1vZGUsCi0gICAgQllURSAgICAgICAgICAgICBieU5ld0NoYW5uZWwsCi0gICAgQllURSAgICAgICAgICAgICBieUNvdW50CisgICAgdW5zaWduZWQgY2hhciBieU1vZGUsCisgICAgdW5zaWduZWQgY2hhciBieU5ld0NoYW5uZWwsCisgICAgdW5zaWduZWQgY2hhciBieUNvdW50CiAgICAgKQogewogICAgIFBTRGV2aWNlICAgIHBE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sZXIsCi0gICAgQk9PTCAgICAgICAgICAgICBiUmVzZXRRdWlldCwKLSAgICBCWVRFICAgICAgICAgICAgIGJ5UXVpZXRDb3VudCwKLSAgICBCWVRFICAgICAgICAgICAgIGJ5UXVpZXRQZXJpb2QsCi0gICAgV09SRCAgICAgICAgICAgICB3UXVpZXREdXJhdGlvbiwKLSAgICBXT1JEICAgICAgICAgICAgIHdRdWlldE9mZnNldAorICAgIGJvb2wgYlJlc2V0UXVpZXQsCisgICAgdW5zaWduZWQgY2hhciBieVF1aWV0Q291bnQsCisgICAgdW5zaWduZWQgY2hhciBieVF1aWV0UGVyaW9kLAorICAgIHVuc2lnbmVkIHNob3J0IHdRdWlldER1cmF0aW9uLAorICAgIHVuc2lnbmVkIHNob3J0IHdRdWlldE9mZnNldAogICAgICkKIHsKICAgICBQU0RldmljZSAgICBwRGV2aWNlID0gKFBTRGV2aWNlKSBwRGV2aWNlSGFuZGxlcjsKLSAgICBVSU5UICAgICAgICBpaSA9IDA7CisgICAgdW5zaWduZWQgaW50IGlpID0gMDsKIAotICAgIGlmIChiUmVzZXRRdWlldCA9PSBUUlVFKSB7CisgICAgaWYgKGJSZXNldFF1aWV0ID09IHRydWUpIHsKICAgICAgICAgTUFDdlJlZ0JpdHNPZmYocERldmljZS0+UG9ydE9mZnNldCwgTUFDX1JFR19NU1JDVEwsIChNU1JDVExfUVVJRVRUWENISyB8IE1TUkNUTF9RVUlFVEVOKSk7CiAgICAgICAgIGZvcihpaT0wO2lpPE1BWF9RVUlFVF9DT1VOVDtpaSsrKSB7Ci0gICAgICAgICAgICBwRGV2aWNlLT5zUXVpZXRbaWldLmJFbmFibGUgPSBGQUxTRTsKKyAgICAgICAgICAgIHBEZXZpY2UtPnNRdWlldFtpaV0uYkVuYWJsZSA9IGZhbHNlOwogICAgICAgICB9CiAgICAgICAgIHBEZXZpY2UtPnVRdWlldEVucXVldWUgPSAwOwotICAgICAgICBwRGV2aWNlLT5iRW5hYmxlRmlyc3RRdWlldCA9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gbG9uZyBkd0dhcCA9IDA7CisgICAgdW5zaWduZWQgbG9uZyBkd0R1cmF0aW9uID0gMDsKIAogICAgIGZvcihpaT0wO2lpPE1BWF9RVUlFVF9DT1VOVDtpaSsrKSB7Ci0gICAgICAgIGlmICgocERldmljZS0+c1F1aWV0W2lpXS5iRW5hYmxlID09IFRSVUUpICYmCisgICAgICAgIGlmICgocERldmljZS0+c1F1aWV0W2lpXS5iRW5hYmxlID09IHRydWUpICYmCiAgICAgICAgICAgICAoZHdTdGFydFRpbWUgPiBwRGV2aWNlLT5zUXVpZXRbaWldLmR3U3RhcnRUaW1lKSkgewogICAgICAgICAgICAgZHdTdGFydFRpbWUgPSBwRGV2aWNlLT5zUXVpZXRbaWldLmR3U3RhcnRUaW1lOwogICAgICAgICAgICAgdUN1cnJlbnRRdWlldEluZGV4ID0gaWk7CkBAIC0xOTU0LDIyICsxMzg3LDIyIEBACiAgICAgfQogICAgIGlmIChkd1N0YXJ0VGltZSA9PSAweEZGRkZGRkZGKSB7CiAgICAgICAgIC8vIG5vIG1vcmUgcXVpZXQKLSAgICAgICAgcERldmljZS0+YlF1aWV0RW5hYmxlID0gRkFMU0U7CisgICAgICAgIHBEZXZpY2UtPmJRdWlldEVuYWJsZSA9IGZhbHNlOwogICAgICAgICBNQUN2UmVnQml0c09mZihwRGV2aWNlLT5Qb3J0T2Zmc2V0LCBNQUNfUkVHX01TUkNUTCwgKE1TUkNUTF9RVUlFVFRYQ0hLIHwgTVNSQ1RMX1FVSUVURU4pKTsKICAgICB9IGVsc2UgewotICAgICAgICBpZiAocERldmljZS0+YlF1aWV0RW5hYmxlID09IEZBTFNFKSB7CisgICAgICAgIGlmIChwRGV2aWNlLT5iUXVpZXRFbmFibGUgPT0gZmFsc2UpIHsKICAgICAgICAgICAgIC8vIGZpcnN0IHF1aWV0CiAgICAgICAgICAgICBwRGV2aWNlLT5ieVF1aWV0U3RhcnRDb3VudC0tOwogICAgICAgICAgICAgZHdOZXh0VGltZSA9IHBEZ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VNSQ1RMX1FVSUVURU4pKTsKICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgcERldmljZS0+YkVuYWJsZUZpcnN0UXVpZXQgPSBUUlVFOworICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJFbmFibGVGaXJzdFF1aWV0ID0gdHJ1ZTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIE1BQ3ZTZWxlY3RQYWdlMChwRGV2aWNlLT5Qb3J0T2Zmc2V0KTsKICAgICAgICAgfSBlbHNlIHsKQEAgLTE5NzcsOCArMTQxMCw4IEBACiAgICAgICAgICAgICAgICAgLy8gb3ZlcmxhcCB3aXRoIHByZXZpb3VzIFF1aWV0CiAgICAgICAgICAgICAgICAgZHdHYXAgPSAgcERldmljZS0+ZHdDdXJyZW50UXVpZXRFbmRUaW1lIC0gcERldmljZS0+c1F1aWV0W3VDdXJyZW50UXVpZXRJbmRleF0uZHdTdGFydFRpbWU7CiAgICAgICAgICAgICAgICAgaWYgKGR3R2FwID49IHBEZXZpY2UtPnNRdWlldFt1Q3VycmVudFF1aWV0SW5kZXhdLndEdXJhdGlvbikgewotICAgICAgICAgICAgICAgICAgICAvLyByZXR1cm4gRkFMU0UgdG8gaW5kaWNhdGUgbmV4dCBxdWlldCBleHBpcmVkLCBzaG91bGQgY2FsbCB0aGlzIGZ1bmN0aW9uIGFnYWluCi0gICAgICAgICAgICAgICAgICAgIHJldHVybiAoRkFMU0UpOworICAgICAgICAgICAgICAgICAgICAvLyByZXR1cm4gZmFsc2UgdG8gaW5kaWNhdGUgbmV4dCBxdWlldCBleHBpcmVkLCBzaG91bGQgY2FsbCB0aGlzIGZ1bmN0aW9uIGFnYWluCisgICAgICAgICAgICAgICAgICAgIHJldHVybiAoZmFsc2UpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBkd0R1cmF0aW9uID0gcERldmljZS0+c1F1aWV0W3VDdXJyZW50UXVpZXRJbmRleF0ud0R1cmF0aW9uIC0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GltZTsKICAgICAgICAgcERldmljZS0+ZHdDdXJyZW50UXVpZXRFbmRUaW1lICs9IHBEZXZpY2UtPnNRdWlldFt1Q3VycmVudFF1aWV0SW5kZXhdLndEdXJhdGlvbjsKICAgICAgICAgaWYgKHBEZXZpY2UtPnNRdWlldFt1Q3VycmVudFF1aWV0SW5kZXhdLmJ5UGVyaW9kID09IDApIHsKICAgICAgICAgICAgIC8vIG5vdCBwZXJpb2QgZGlzYWJsZSBjdXJyZW50IHF1aWV0IGVsZW1lbnQKLSAgICAgICAgICAgIHBEZXZpY2UtPnNRdWlldFt1Q3VycmVudFF1aWV0SW5kZXhdLmJFbmFibGUgPSBGQUxTRTsKKyAgICAgICAgICAgIHBEZXZpY2UtPnNRdWlldFt1Q3VycmVudFF1aWV0SW5kZXhdLmJFbmFibGUgPSBmYWxzZTsKICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgIC8vIHNldCBuZXh0IHBlcmlvZCBzdGFydCB0aW1lCi0gICAgICAgICAgICBkd05leHRUaW1lID0gKERXT1JEKSBwRGV2aWNlLT5zUXVpZXRbdUN1cnJlbnRRdWlldEluZGV4XS5ieVBlcmlvZDsKKyAgICAgICAgICAgIGR3TmV4dFRpbWUgPSAodW5zaWduZWQgbG9uZykgcERldmljZS0+c1F1aWV0W3VDdXJyZW50UXVpZXRJbmRleF0uYnlQZXJpb2Q7CiAgICAgICAgICAgICBkd05leHRUaW1lICo9IHBEZXZpY2UtPndCZWFjb25JbnRlcnZhbDsKICAgICAgICAgICAgIHBEZXZpY2UtPnNRdWlldFt1Q3VycmVudFF1aWV0SW5kZXhdLmR3U3RhcnRUaW1lID0gZHdOZXh0VGltZTsKICAgICAgICAgfQogICAgICAgICBpZiAocERldmljZS0+ZHdDdXJyZW50UXVpZXRFbmRUaW1lID4gMHg4MDAxMDAwMCkgewogICAgICAgICAgICAgLy8gZGVjcmVhbWVudCBhbGwgdGltZSB0byBhdm9pZCB3cmFwIGFyb3VuZAogICAgICAgICAgICAgZm9yKGlpPTA7aWk8TUFYX1FVSUVUX0NPVU5UO2lpKyspIHsKLSAgICAgICAgICAgICAgICBpZiAocERldmljZS0+c1F1aWV0W2lpXS5iRW5hYmxlID09IFRSVUUpIHsKKyAgICAgICAgICAgICAgICBpZiAocERldmljZS0+c1F1aWV0W2lpXS5iRW5hYmxlID09IHRydWUpIHsKICAgICAgICAgICAgICAgICAgICAgcERldmljZS0+c1F1aWV0W2lpXS5kd1N0YXJ0VGltZSAtPSAweDgwMDAwMDAwOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgICAgIHBEZXZpY2UtPmR3Q3VycmVudFF1aWV0RW5kVGltZSAtPSAweDgwMDAwMDAwOwogICAgICAgICB9CiAgICAgfQotICAgIHJldHVybiAoVFJVRSk7Ci19Ci0KLQotLyoKLSAqCi0gKiBEZXNjcmlwdGlvbjoKLSAqICAgIFNldCBDaGFubmVsIEluZm8gb2YgQ291bnRyeQotICoKLSAqIFBhcmFtZXRlcnM6Ci0gKiAgSW46Ci0gKiAgICAgIGhEZXZpY2VDb250ZXh0IC0gZGV2aWNlIHN0cnVjdHVyZSBwb2ludAotICogIE91dDoKLSAqICAgICAgbm9uZQotICoKLSAqIFJldHVybiBWYWx1ZTogbm9uZS4KLSAqCi0tKi8KLXZvaWQKLUNBUkR2U2V0Q291bnRyeUluZm8gKAotICAgIHZvaWQgKnBEZXZpY2VIYW5kbGVyLAotICAgIENBUkRfUEhZX1RZUEUgICAgZVBIWVR5cGUsCi0gICAgdm9pZCAqcElFCi0gICAgKQotewotICAgIFBTRGV2aWNlICAgICAgICAgICAgcERldmljZSA9IChQU0RldmljZSkgcERldmljZUhhbmRsZXI7Ci0gICAgVUlOVCAgICAgICAgICAgICAgICBpaSA9IDA7Ci0gICAgVUlOVCAgICAgICAgICAgICAgICB1dSA9IDA7Ci0gICAgVUlOVCAgICAgICAgICAgICAgICBzdGVwID0gMDsKLSAgICBVSU5UICAgICAgICAgICAgICAgIHVOdW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IYW5kbGVyOwotICAgIFVJTlQgICAgICAgIGlpID0gMDsKLQotICAgIGZvciAoaWkgPSAxOyBpaSA8PSAgQ0JfTUFYX0NIQU5ORUw7IGlpKyspIHsKLSAgICAgICAgc0NoYW5uZWxUYmxbaWldLmJ5TUFQID0gMDsKLSAgICB9Ci19Ci0KLQotQllURQotQ0FSRGJ5QXV0b0NoYW5uZWxTZWxlY3QoCi0gICAgdm9pZCAqcERldmljZUhhbmRsZXIsCi0gICAgQ0FSRF9QSFlfVFlQRSAgIGVQSFlUeXBlCi0gICAgKQotewotLy8gICAgUFNEZXZpY2UgICAgICAgIHBEZXZpY2UgPSAoUFNEZXZpY2UpIHBEZXZpY2VIYW5kbGVyOwotICAgIFVJTlQgICAgICAgICAgICBpaSA9IDA7Ci0gICAgQllURSAgICAgICAgICAgIGJ5T3B0aW9uQ2hhbm5lbCA9IDA7Ci0gICAgSU5UICAgICAgICAgICAgIGFpV2VpZ2h0W0NCX01BWF9DSEFOTkVMXzI0RysxXSA9IHstMTAwMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDB9OwotCi0gICAgaWYgKGVQSFlUeXBlID09IFBIWV9UWVBFXzExQSkgewotICAgICAgICBmb3IoaWk9Q0JfTUFYX0NIQU5ORUxfMjRHKzE7aWk8PUNCX01BWF9DSEFOTkVMO2lpKyspIHsKLSAgICAgICAgICAgIGlmIChzQ2hhbm5lbFRibFtpaV0uYlZhbGlkID09IFRSVUUpIHsKLSAgICAgICAgICAgICAgICBpZiAoYnlPcHRpb25DaGFubmVsID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgYnlPcHRpb25DaGFubmVsID0gKEJZVEUpIGlpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoc0NoYW5uZWxUYmxbaWldLmJ5TUFQID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuICgoQllURSkgaWkpOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoICEoc0NoYW5uZWxUYmxbaWldLmJ5TUFQICYgMHgwOCkpIHsKLSAgICAgICAgICAgICAgICAgICAgYnlPcHRpb25DaGFubmVsID0gKEJZVEUpIGlpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0gZWxzZSB7Ci0gICAgICAgIGJ5T3B0aW9uQ2hhbm5lbCA9IDA7Ci0gICAgICAgIGZvcihpaT0xO2lpPD1DQl9NQVhfQ0hBTk5FTF8yNEc7aWkrKykgewotICAgICAgICAgICAgaWYgKHNDaGFubmVsVGJsW2lpXS5iVmFsaWQgPT0gVFJVRSkgewotICAgICAgICAgICAgICAgIGlmIChzQ2hhbm5lbFRibFtpaV0uYnlNQVAgPT0gMCkgewotICAgICAgICAgICAgICAgICAgICBhaVdlaWdodFtpaV0gKz0gMTAwOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc0NoYW5uZWxUYmxbaWldLmJ5TUFQICYgMHgwMSkgewotICAgICAgICAgICAgICAgICAgICBpZiAoaWkgPiAzKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBhaVdlaWdodFtpaS0zXSAtPSAxMDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBpZiAoaWkgPiAyKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBhaVdlaWdodFtpaS0yXSAtPSAyMDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBpZiAoaWkgPiAxKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBhaVdlaWdodFtpaS0xXSAtPSA0MDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBhaVdlaWdodFtpaV0gLT0gODA7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChpaSA8IENCX01BWF9DSEFOTkVMXzI0RykgewotICAgICAgICAgICAgICAgICAgICAgICAgYWlXZWlnaHRbaWkrMV0gLT0gNDA7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgaWYgKGlpIDwgKENCX01BWF9DSEFOTkVMXzI0RyAtIDEpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBhaVdlaWdodFtpaSsyXSAtPSAyMDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBpZiAoaWkgPCAoQ0JfTUFYX0NIQU5ORUxfMjRHIC0gMikpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGFpV2VpZ2h0W2lpKzNdIC09IDEwOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGZvcihpaT0xO2lpPD1DQl9NQVhfQ0hBTk5FTF8yNEc7aWkrKykgewotICAgICAgICAgICAgaWYgKChzQ2hhbm5lbFRibFtpaV0uYlZhbGlkID09IFRSVUUpICYmCi0gICAgICAgICAgICAgICAgKGFpV2VpZ2h0W2lpXSA+IGFpV2VpZ2h0W2J5T3B0aW9uQ2hhbm5lbF0pKSB7Ci0gICAgICAgICAgICAgICAgYnlPcHRpb25DaGFubmVsID0gKEJZVEUpIGlpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotICAgIHJldHVybiAoYnlPcHRpb25DaGFubmVsKTsKLX0KLQotCi0KIC8veHh4CiB2b2lkCiBDQVJEdlNhZmVSZXNldFR4ICgKQEAgLTI0MjYsNyArMTU1Miw3IEBACiAgICAgKQogewogICAgIFBTRGV2aWNlICAgIHBEZXZpY2UgPSAoUFNEZXZpY2UpIHBEZXZpY2VIYW5kbGVyOwotICAgIFVJTlQgICAgICAgIHV1OworICAgIHVuc2lnbmVkIGludCB1dTsKICAgICBQU1R4RGVzYyAgICBwQ3VyclREOwogCiAgICAgLy8gaW5pdGlhbGl6ZSBURCBpbmRleApAQCAtMjQ4Miw3ICsxNjA4LDcgQEAKICAgICApCiB7CiAgICAgUFNEZX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UgKHZvaWQgKnBEZXZpY2VIYW5kbGVyKQogewogICAgIFBTRGV2aWNlIHBEZXZpY2UgPSAoUFNEZXZpY2UpIHBEZXZpY2VIYW5kbGVyOwogICAgIGludCBpaTsKIAogICAgIGZvciAoaWkgPSBSQVRFXzU0TTsgaWkgPj0gUkFURV82TTsgaWkgLS0pIHsKLSAgICAgICAgaWYgKChwRGV2aWNlLT53QmFzaWNSYXRlKSAmICgoV09SRCkoMTw8aWkpKSkKLSAgICAgICAgICAgIHJldHVybiBUUlVFOworICAgICAgICBpZiAoKHBEZXZpY2UtPndCYXNpY1JhdGUpICYgKCh1bnNpZ25lZCBzaG9ydCkoMTw8aWkpKSkKKyAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgIH0KLSAgICByZXR1cm4gRkFMU0U7CisgICAgcmV0dXJuIGZhbHNlOwogfQogCi1CWVRFIENBUkRieUdldFBrdFR5cGUgKHZvaWQgKnBEZXZpY2VIYW5kbGVyKQordW5zaWduZWQgY2hhciBDQVJEYnlHZXRQa3RUeXBlICh2b2lkICpwRGV2aWNlSGFuZGxlcikKIHsKICAgICBQU0RldmljZSBwRGV2aWNlID0gKFBTRGV2aWNlKSBwRGV2aWNlSGFuZGxlcjsKIAogICAgIGlmIChwRGV2aWNlLT5ieUJCVHlwZSA9PSBCQl9UWVBFXzExQSB8fCBwRGV2aWNlLT5ieUJCVHlwZSA9PSBCQl9UWVBFXzExQikgewotICAgICAgICByZXR1cm4gKEJZVEUpcERldmljZS0+YnlCQlR5cGU7CisgICAgICAgIHJldHVybiAodW5zaWduZWQgY2hhcilwRGV2aWNlLT5ieUJCVHlwZTsKICAgICB9CiAgICAgZWxzZSBpZiAoQ0FSRGJJc09GRE1pbkJhc2ljUmF0ZSgodm9pZCAqKXBEZXZpY2UpKSB7CiAgICAgICAgIHJldHVybiBQS19UWVBFXzExR0E7CkBAIC0yODczLDcgKzE5OTksNyBAQAogICogUmV0dXJuIFZhbHVlOiBub25lCiAgKgogICovCi12b2lkI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VJTlQgICAgICAgICAgICAgdU51bU9mTWVhc3VyZUVJRHMKKyAgICB1bnNpZ25lZCBpbnQgdU51bU9mTWVhc3VyZUVJRHMKICAgICApOwogCi1CT09MCitib29sCiBDQVJEYkNoYW5uZWxTd2l0Y2ggKAogICAgIHZvaWQgKnBEZXZpY2VIYW5kbGVyLAotICAgIEJZVEUgICAgICAgICAgICAgYnlNb2RlLAotICAgIEJZVEUgICAgICAgICAgICAgYnlOZXdDaGFubmVsLAotICAgIEJZVEUgICAgICAgICAgICAgYnlDb3VudAorICAgIHVuc2lnbmVkIGNoYXIgYnlNb2RlLAorICAgIHVuc2lnbmVkIGNoYXIgYnlOZXdDaGFubmVsLAorICAgIHVuc2lnbmVkIGNoYXIgYnlDb3VudAogICAgICk7CiAKLUJPT0wKK2Jvb2wKIENBUkRiU2V0UXVpZXQgKAogICAgIHZvaWQgKnBEZXZpY2VIYW5kbGVyLAotICAgIEJPT0wgICAgICAgICAgICAgYlJlc2V0UXVpZXQsCi0gICAgQllURSAgICAgICAgICAgICBieVF1aWV0Q291bnQsCi0gICAgQllURSAgICAgICAgICAgICBieVF1aWV0UGVyaW9kLAotICAgIFdPUkQgICAgICAgICAgICAgd1F1aWV0RHVyYXRpb24sCi0gICAgV09SRCAgICAgICAgICAgICB3UXVpZXRPZmZzZXQKKyAgICBib29sIGJSZXNldFF1aWV0LAorICAgIHVuc2lnbmVkIGNoYXIgYnlRdWlldENvdW50LAorICAgIHVuc2lnbmVkIGNoYXIgYnlRdWlldFBlcmlvZCwKKyAgICB1bnNpZ25lZCBzaG9ydCB3UXVpZXREdXJhdGlvbiwKKyAgICB1bnNpZ25lZCBzaG9ydCB3UXVpZXRPZmZzZXQKICAgICApOwogCi1CT09MCitib29sCiBDQVJEYlN0YXJ0UXVpZXQgKAogICAgIHZvaWQgKnBEZXZpY2VIYW5kbGVyCiAgICAgKTsKIAogdm9pZAotQ0FSRHZTZXRDb3VudHJ5SW5mbyAoCi0gICAgdm9pZCAqcERldmljZUhhbmRsZXIsCi0gICAgQ0FSRF9QSFlfVFlQRSAgICBlUEhZVHlwZSwKLSAgICB2b2lkICpwSUUKLSAgICApOwotCi12b2lkCiBDQVJEdlNldFBvd2VyQ29uc3RyYWludCAoCiAgICAgdm9pZCAqcERldmljZUhhbmRsZXIsCi0gICAgQllURSAgICAgICAgICAgICBieUNoYW5uZWwsCi0gICAgSTggICAgICAgICAgICAgICBieVBvd2VyCisgICAgdW5zaWduZWQgY2hhciBieUNoYW5uZWwsCisgICAgY2hhciBieVBvd2VyCiAgICAgKTsKIAogdm9pZAogQ0FSRHZHZXRQb3dlckNhcGFiaWxpdHkgKAogICAgIHZvaWQgKnBEZXZpY2VIYW5kbGVyLAotICAgIFBCWVRFICAgICAgICAgICBwYnlNaW5Qb3dlciwKLSAgICBQQllURSAgICAgICAgICAgcGJ5TWF4UG93ZXIKKyAgICB1bnNpZ25lZCBjaGFyICpwYnlNaW5Qb3dlciwKKyAgICB1bnNpZ25lZCBjaGFyICpwYnlNYXhQb3dlcgogICAgICk7CiAKLUJZVEUKLUNBUkRieVNldFN1cHBvcnRDaGFubmVscyAoCi0gICAgdm9pZCAqcERldmljZUhhbmRsZXIsCi0gICAgUEJZVEUgICAgICAgIHBieUlFcwotICAgICk7Ci0KLUk4CitjaGFyCiBDQVJEYnlHZXRUcmFuc21pdFBvd2VyICgKICAgICB2b2lkICpwRGV2aWNlSGFuZGxlcgogICAgICk7CiAKLUJPT0wKLUNBUkRiQ2hhbm5lbEdldExpc3QgKAotICAgICBVSU5UICAgICAgIHVDb3VudHJ5Q29kZUlkeCwKLSAgICBQQllURSAgICAgIHBieUNoYW5uZWxUYWJsZQotICAgICk7Ci0KLXZvaWQKLUNBUkR2U2V0Q291bnRyeUlFKAotICAgIHZvaWQgKnBEZXZpY2VIYW5kbGVyLAotICAgIHZvaWQgKnBJRQotICAgICk7Ci0KLUJPT0wKLUNBUkRiR2V0Q2hhbm5lbE1hcEluZm8oCi0gICAgdm9pZCAqcERldmljZU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HJ1ZSwgICAgIDB9LAorICB7MTEyLCA1NTYwLCB0cnVlLCAgICAgMH0sCisgIHsxMTYsIDU1ODAsIHRydWUsICAgICAwfSwKKyAgezEyMCwgNTYwMCwgdHJ1ZSwgICAgIDB9LAorICB7MTI0LCA1NjIwLCB0cnVlLCAgICAgMH0sCisgIHsxMjgsIDU2NDAsIHRydWUsICAgICAwfSwKKyAgezEzMiwgNTY2MCwgdHJ1ZSwgICAgIDB9LAorICB7MTM2LCA1NjgwLCB0cnVlLCAgICAgMH0sCisgIHsxNDAsIDU3MDAsIHRydWUsICAgICAwfSwKKyAgezE0OSwgNTc0NSwgdHJ1ZSwgICAgIDB9LAorICB7MTUzLCA1NzY1LCB0cnVlLCAgICAgMH0sCisgIHsxNTcsIDU3ODUsIHRydWUsICAgICAwfSwKKyAgezE2MSwgNTgwNSwgdHJ1ZSwgICAgIDB9LAorICB7MTY1LCA1ODI1LCB0cnVlLCAgICAgMH0KK307CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIFRoZSBSYWRhciByZWd1bGF0aW9uIHJ1bGVzIGZvciBlYWNoIGNvdW50cnkKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgc3RydWN0Cit7CisJdW5zaWduZWQgY2hhciBieUNoYW5uZWxDb3VudHJ5Q29kZTsgICAgICAgICAgICAgLyogVGhlIGNvdW50cnkgY29kZSAgICAgICAgICovCisJY2hhciBjaENvdW50cnlDb2RlWzJdOworCXVuc2lnbmVkIGNoYXIgYkNoYW5uZWxJZHhMaXN0W0NCX01BWF9DSEFOTkVMXTsgIC8qIEF2YWlsYWJsZSBjaGFubmVscyBJbmRleCAqLworCXVuc2lnbmVkIGNoYXIgYnlQb3dlcltDQl9NQVhfQ0hBTk5FTF07Cit9IENoYW5uZWxSdWxlVGFiW10gPQoreworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogVGhpcyB0YWJsZSBpcyBiYXNlZCBvbiBBdGhlcm8gZHJpdmVyIHJ1bGVzCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogQ291bnRyeSAgICAgICAgICBBdmFpbGFibGUgY2hhbm5lbHMsIGVuZGVkIHdpdGggMCAgICAgICAgICAgICAgICAgICAgKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgICAyICAgMyAgIDQgICA1ICAgNiAgIDcgICA4ICAgOSAgMTAgIDExICAxMiAgMTMgIDE0ICAxNSAgMTYgIDE3ICAxOCAgMTkgIDIwICAyMSAgMjIgIDIzICAyNCAgMjUgIDI2ICAyNyAgMjggIDI5ICAzMCAgMzEgIDMyICAzMyAgMzQgIDM1ICAzNiAgMzcgIDM4ICAzOSAgNDAgIDQxICA0MiAgNDMgIDQ0ICA0NSAgNDYgIDQ3ICA0OCAgNDkgIDUwICA1MSAgNTIgIDUzICA1NCAgNTUgIDU2ICAqLwore0NDT0RFX0ZDQywgICAgICAgICAgICAgICAgICAgICB7J1UnLCdTJ30sICB7ICAgMSwgIDEsICAxLCAgMSwgIDEsICAxLCAgMSwgIDEsICAxLCAgMSwgIDEsICAwLCAgMCwgIDAsICAwLCAgMCwgIDAsICAwLCAgMCwgIDAsICAwLCAgMCwgIDAsICAwLCAgMCwgIDAsICAwLCAgMCwgIDAsICAxLCAgMCwgIDEsICAwLCAgMSwgIDAsICAxLCAgMSwgIDEsICAxLCAgMSwgIDAsICAwLCAgMCwgIDAsICAwLCAgMCwgIDAsICAwLCAgMCwgIDAsICAwLCAgMSwgIDEsICAxLCAgMSwgIDF9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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gICBmb3IoaWkgPSBwc05vZGVEQlRhYmxlLT53VHhEYXRhUmF0ZTsgaWkgPiAwOykgewogICAgICAgICBpaS0tOwogICAgICAgICBpZiAoIChkd1Rocm91Z2hwdXRUYmxbaWldID4gZHdUaHJvdWdocHV0KSAmJgotICAgICAgICAgICAgIChiQXV0b1JhdGVbaWldPT1UUlVFKSApIHsKKyAgICAgICAgICAgICAoYkF1dG9SYXRlW2lpXT09dHJ1ZSkgKSB7CiAgICAgICAgICAgICBkd1Rocm91Z2hwdXQgPSBkd1Rocm91Z2hwdXRUYmxbaWldOwotICAgICAgICAgICAgd0lkeERvd25SYXRlID0gKFdPUkQpIGlpOworICAgICAgICAgICAgd0lkeERvd25SYXRlID0gKHVuc2lnbmVkIHNob3J0KSBpaTsKICAgICAgICAgfQogICAgIH0KICAgICBwc05vZGVEQlRhYmxlLT53VHhEYXRhUmF0ZSA9IHdJZHhEb3duUmF0ZTsKQEAgLTQwOSwxNCArNDA5LDE0IEBACiAgKiBSZXR1cm4gVmFsdWU6IE5vbmUKICAqCiAtKi8KLUJZVEUKK3Vuc2lnbmVkIGNoYXIKIFJBVEV1U2V0SUUgKAogICAgIFBXTEFOX0lFX1NVUFBfUkFURVMgcFNyY1JhdGVzLAogICAgIFBXTEFOX0lFX1NVUFBfUkFURVMgcERzdFJhdGVzLAotICAgIFVJTlQgICAgICAgICAgICAgICAgdVJhdGVMZW4KKyAgICB1bnNpZ25lZCBpbnQgdVJhdGVMZW4KICAgICApCiB7Ci0gICAgVUlOVCBpaSwgdXUsIHVSYXRlQ250ID0gMDsKKyAgICB1bnNpZ25lZCBpbnQgaWksIHV1LCB1UmF0ZUNudCA9IDA7CiAKICAgICBpZiAoKHBTcmNSYXRlcyA9PSBOVUxMKSB8fCAocERzdFJhdGVzID09IE5VTEwpKQogICAgICAgICByZXR1cm4gMDsKQEAgLTQzMiw2ICs0MzIsNiBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQotICAgIHJldHVybiAoQ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0JVUlOVCAgICAgICAgICAgIHVMaWZldGltZTsKKyAgICB1bnNpZ25lZCBzaG9ydCB3U2VxdWVuY2U7CisgICAgdW5zaWduZWQgc2hvcnQgd0ZyYWdOdW07CisgICAgdW5zaWduZWQgY2hhciBhYnlBZGRyMltFVEhfQUxFTl07CisgICAgdW5zaWduZWQgaW50IHVMaWZldGltZTsKICAgICBzdHJ1Y3Qgc2tfYnVmZiogc2tiOwotICAgIFBCWVRFICAgICAgICAgICBwYnlSeEJ1ZmZlcjsKLSAgICBVSU5UICAgICAgICAgICAgY2JGcmFtZUxlbmd0aDsKLSAgICBCT09MICAgICAgICAgICAgYkluVXNlOworICAgIHVuc2lnbmVkIGNoYXIgKnBieVJ4QnVmZmVyOworICAgIHVuc2lnbmVkIGludCBjYkZyYW1lTGVuZ3RoOworICAgIGJvb2wgYkluVXNlOwogfSBTRGVGcmFnQ29udHJvbEJsb2NrLCAqUFNEZUZyYWdDb250cm9sQmxvY2s7CiAKIApAQCAtMzg2LDcgKzM4Niw3IEBACiAgICAgaW50ICAgICAgICAgc2hvcnRfcmV0cnk7CiAgICAgaW50ICAgICAgICAgbG9uZ19yZXRyeTsKICAgICBpbnQgICAgICAgICBiYnBfdHlwZTsKLSAgICBVMzIgICAgICAgICBmbGFnczsKKyAgICB1MzIgICAgICAgICBmbGFnczsKIH0gT1BUSU9OUywgKlBPUFRJT05TOwogCiAKQEAgLTQxNywyMSArNDE3LDIxIEBACiAgICAgZG1hX2FkZHJfdCAgICAgICAgICAgICAgICAgIHR4X2J1ZnNfZG1hMTsKICAgICBkbWFfYWRkcl90ICAgICAgICAgICAgICAgICAgdHhfYmVhY29uX2RtYTsKIAotICAgIFBCWVRFICAgICAgICAgICAgICAgICAgICAgICB0eDBfYnVmczsKLSAgICBQQllURSAgICAgICAgICAgICAgICAgICAgICAgdHgxX2J1ZnM7Ci0gICAgUEJZVEUgICAgICAgICAgICAgICAgICAgICAgIHR4X2JlYWNvbl9idWZzOworICAgIHVuc2lnbmVkIGNoYXIgKnR4MF9idWZzOworICAgIHVuc2lnbmVkIGNoYXIgKnR4MV9idWZzOworICAgIHVuc2lnbmVkIGNoYXIgKnR4X2JlYWNvbl9idWZzOwogCiAgICAgQ0hJUF9UWVBFICAgICAgICAgICAgICAgICAgIGNoaXBfaWQ7CiAKLSAgICBVMzIgICAgICAgICAgICAgICAgICAgICAgICAgUG9ydE9mZnNldDsKLSAgICBEV09SRCAgICAgICAgICAgICAgICAgICAgICAgZHdJc3I7Ci0gICAgVTMyICAgICAgICAgICAgICAgICAgICAgICAgIG1lbWFkZHI7Ci0gICAgVTMyICAgICAgICAgICAgICAgICAgICAgICAgIGlvYWRkcjsKLSAgICBVMzIgICAgICAgICAgICAgICAgICAgICAgICAgaW9fc2l6ZTsKKyAgICB1bnNpZ25lZCBsb25nICAgICAgICAgICAgICAgUG9ydE9mZnNldDsKKyAgICB1bnNpZ25lZCBsb25nIGR3SXNyOworICAgIHUzMiAgICAgICAgICAgICAgICAgICAgICAgICBtZW1hZGRyOworICAgIHUzMiAgICAgICAgICAgICAgICAgICAgICAgICBpb2FkZHI7CisgICAgdTMyICAgICAgICAgICAgICAgICAgICAgICAgIGlvX3NpemU7CiAKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICAgICAgYnlSZXZJZDsKLSAgICBXT1JEICAgICAgICAgICAgICAgICAgICAgICAgU3ViU3lzdGVtSUQ7Ci0gICAgV09SRCAgICAgICAgICAgICAgICAgICAgICAgIFN1YlZlbmRvcklEOworICAgIHVuc2lnbmVkIGNoYXIgYnlSZXZJZDsKKyAgICB1bnNpZ25lZCBzaG9ydCBTdWJTeXN0ZW1JRDsKKyAgICB1bnNpZ25lZCBzaG9ydCBTdWJWZW5kb3JJRDsKIAogICAgIGludCAgICAgICAgICAgICAgICAgICAgICAgICBuVHhRdWV1ZXM7CiAgICAgdm9sYXRpbGUgaW50ICAgICAgICAgICAgICAgIGlURFVzZWRbVFlQRV9NQVhURF07CkBAIC00NDgsMTcgKzQ0OCwxNyBAQAogICAgIFNDYWNoZSAgICAgICAgICAgICAgICAgICAgICBzRHVwUnhDYWNoZTsKIAogICAgIFNEZUZyYWdDb250cm9sQmxvY2sgICAgICAgICBzUnhERkNCW0NCX01BWF9SWF9GUkFHXTsKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICAgICAgY2JERkNCOwotICAgIFVJTlQgICAgICAgICAgICAgICAgICAgICAgICBjYkZyZWVERkNCOwotICAgIFVJTlQgICAgICAgICAgICAgICAgICAgICAgICB1Q3VycmVudERGQ0JJZHg7CisgICAgdW5zaWduZWQgaW50CWNiREZDQjsKKyAgICB1bnNpZ25lZCBpbnQJY2JGcmVlREZDQjsKKyAgICB1bnNpZ25lZCBpbnQJdUN1cnJlbnRERkNCSWR4OwogCiAgICAgT1BUSU9OUyAgICAgICAgICAgICAgICAgICAgIHNPcHRzOwogCi0gICAgVTMyICAgICAgICAgICAgICAgICAgICAgICAgIGZsYWdzOworICAgIHUzMiAgICAgICAgICAgICAgICAgICAgICAgICBmbGFnczsKIAotICAgIFUzMiAgICAgICAgICAgICAgICAgICAgICAgICByeF9idWZfc3o7CisgICAgdTMyICAgICAgICAgICAgICAgICAgICAgICAgIHJ4X2J1Zl9zejsKICAgICBpbnQgICAgICAgICAgICAgICAgICAgICAgICAgbXVsdGljYXN0X2xpbWl0OwotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgICAgICBieVJ4TW9kZTsKKyAgICB1bnNpZ25lZCBjaGFyIGJ5UnhNb2RlOwogCiAgICAgc3BpbmxvY2tfdCAgICAgICAgICAgICAgICAgIGxvY2s7CiAvL1BMSUNFX0RFQlVHLT4KQEAgLTQ3MiwxOSArNDcyLDE5IEBACiAvL1BMSUNFX0RFQlVHIDwtCiAKIAotICAgIFUzMiAgICAgICAgICAgICAgICAgICAgICAgICByeF9ieXRlczsKKyAgICB1MzIgICAgICAgICAgICAgICAgICAgICAgICAgcnhfYnl0ZXM7CiAKICAgICAvLyBWZXJzaW9uIGNvbnRyb2wKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICAgICAgYnlMb2NhbElEOwotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgICAgICBieVJGVHlwZTsKKyAgICB1bnNpZ25lZCBjaGFyIGJ5TG9jYWxJRDsKKyAgICB1bnNpZ25lZCBjaGFyIGJ5UkZUeXBlOwogCi0gICAgQllURSAgICAgICAgICAgICAgICAgICAgICAgIGJ5TWF4UHdyTGV2ZWw7Ci0gICAgQllURSAgICAgICAgICAgICAgICAgICAgICAgIGJ5Wm9uZVR5cGU7Ci0gICAgQk9PTCAgICAgICAgICAgICAgICAgICAgICAgIGJab25lUmVnRXhpc3Q7Ci0gICBCWVRFICAgICAgICAgICAgICAgICAgICAgICAgYnlPcmlnaW5hbFpvbmV0eXBlOwotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgICAgICBhYnlNYWNDb250ZXh0W01BQ19NQVhfQ09OVEVYVF9SRUddOwotICAgIEJPT0wgICAgICAgICAgICAgICAgICAgICAgICBiTGlua1Bhc3M7ICAgICAgICAgIC8vIGxpbmsgc3RhdHVzOiBPSyBvciBmYWlsCi0gICAgQllURSAgICAgICAgICAgICAgICAgICAgICAgIGFieUN1cnJlbnROZXRBZGRyW0VUSF9BTEVOXTsKKyAgICB1bnNpZ25lZCBjaGFyIGJ5TWF4UHdyTGV2ZWw7CisgICAgdW5zaWduZWQgY2hhciBieVpvbmVUeXBlOworICAgIGJvb2wgYlpvbmVSZWdFeGlzdDsKKyAgIHVuc2lnbmVkIGNoYXIgYnlPcmlnaW5hbFpvbmV0eXBlOworICAgIHVuc2lnbmVkIGNoYXIgYWJ5TWFjQ29udGV4dFtNQUNfTUFYX0NPTlRFWFRfUkVHXTsKKyAgICBib29sIGJMaW5rUGFzczsgICAgICAgICAgLy8gbGluayBzdGF0dXM6IE9LIG9yIGZhaWwKKyAgICB1bnNpZ25lZCBjaGFyIGFieUN1cnJlbnROZXRBZGRyW0VUSF9BTEVOXTsKIAogICAgIC8vIEFkYXB0ZXIgc3RhdGlzdGljcwogICAgIFNTdGF0Q291bnRlciAgICAgICAgICAgICAgICBzY1N0YXRpc3RpYzsKQEAgLTQ5NywyNDkgKzQ5NywyNDkgQEAKICAgICBTTWdtdE9iamVjdCAgICAgICAgICAgICAgICAgc01nbXRPYmo7CiAKICAgICAvLyA4MDIuMTEgTUFDIHNwZWNpZmljCi0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgICAgIHVDdXJyUlNTSTsKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICAgICAgYnlDdXJyU1E7CisgICAgdW5zaWduZWQgaW50CXVDdXJyUlNTSTsKKyAgICB1bnNpZ25lZCBjaGFyIGJ5Q3VyclNROwogCi0gICAgRFdPUkQgICAgICAgICAgICAgICAgICAgICAgIGR3VHhBbnRlbm5hU2VsOwotICAgIERXT1JEICAgICAgICAgICAgICAgICAgICAgICBkd1J4QW50ZW5uYVNlbDsKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICAgICAgYnlBbnRlbm5hQ291bnQ7Ci0gICAgQllURSAgICAgICAgICAgICAgICAgICAgICAgIGJ5UnhBbnRlbm5hTW9kZTsKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICAgICAgYnlUeEFudGVubmFNb2RlOwotICAgIEJPT0wgICAgICAgICAgICAgICAgICAgICAgICBiVHhSeEFudEludjsKKyAgICB1bnNpZ25lZCBsb25nIGR3VHhBbnRlbm5hU2VsOworICAgIHVuc2lnbmVkIGxvbmcgZHdSeEFudGVubmFTZWw7CisgICAgdW5zaWduZWQgY2hhciBieUFudGVubmFDb3VudDsKKyAgICB1bnNpZ25lZCBjaGFyIGJ5UnhBbnRlbm5hTW9kZTsKKyAgICB1bnNpZ25lZCBjaGFyIGJ5VHhBbnRlbm5hTW9kZTsKKyAgICBib29sIGJUeFJ4QW50SW52OwogCi0gICAgUEJZVEUgICAgICAgICAgICAgICAgICAgICAgIHBieVRtcEJ1ZmY7Ci0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgICAgIHVTSUZTOyAgICAvL0N1cnJlbnQgU0lGUwotICAgIFVJTlQgICAgICAgICAgICAgICAgICAgICAgICB1RElGUzsgICAgLy9DdXJyZW50IERJRlMKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICAgICAgdUVJRlM7ICAgIC8vQ3VycmVudCBFSUZTCi0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgICAgIHVTbG90OyAgICAvL0N1cnJlbnQgU2xvdFRpbWUKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICAgICAgdUN3TWluOyAgIC8vQ3VycmVudCBDd01pbgotICAgIFVJTlQgICAgICAgICAgICAgICAgICAgICAgICB1Q3dNYXg7ICAgLy9Dd01heCBpcyBmaXhlZCBvbiAxMDIzLgorICAgIHVuc2lnbmVkIGNoYXIgKnBieVRtcEJ1ZmY7CisgICAgdW5zaWduZWQgaW50CXVTSUZTOyAgICAvL0N1cnJlbnQgU0lGUworICAgIHVuc2lnbmVkIGludAl1RElGUzsgICAgLy9DdXJyZW50IERJRlMKKyAgICB1bnNpZ25lZCBpbnQJdUVJRlM7ICAgIC8vQ3VycmVudCBFSUZTCisgICAgdW5zaWduZWQgaW50CXVTbG90OyAgICAvL0N1cnJlbnQgU2xvdFRpbWUKKyAgICB1bnNpZ25lZCBpbnQJdUN3TWluOyAgIC8vQ3VycmVudCBDd01pbgorICAgIHVuc2lnbmVkIGludAl1Q3dNYXg7ICAgLy9Dd01heCBpcyBmaXhlZCBvbiAxMDIzLgogICAgIC8vIFBIWSBwYXJhbWV0ZXIKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICAgICAgYnlTSUZTOwotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgICAgICBieURJRlM7Ci0gICAgQllURSAgICAgICAgICAgICAgICAgICAgICAgIGJ5RUlGUzsKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICAgICAgYnlTbG90OwotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgICAgICBieUNXTWF4TWluOworICAgIHVuc2lnbmVkIGNoYXIgYnlTSUZTOworICAgIHVuc2lnbmVkIGNoYXIgYnlESUZTOworICAgIHVuc2lnbmVkIGNoYXIgYnlFSUZTOworICAgIHVuc2lnbmVkIGNoYXIgYnlTbG90OworICAgIHVuc2lnbmVkIGNoYXIgYnlDV01heE1pbjsKICAgICBDQVJEX1BIWV9UWVBFICAgICAgICAgICAgICAgZUN1cnJlbnRQSFlUeXBlOwogCiAKICAgICBWSUFfQkJfVFlQRSAgICAgICAgICAgICAgICAgYnlCQlR5cGU7IC8vMDogMTFBLCAxOjExQiwgMjoxMUcKICAgICBWSUFfUEtUX1RZUEUgICAgICAgICAgICAgICAgYnlQYWNrZXRUeXBlOyAvLzA6MTFhLDE6MTFiLDI6MTFnYihvbmx5IENDSyBpbiBCYXNpY1JhdGUpLDM6MTFnYShPRkRNIGluIEJhc2ljIFJhdGUpCi0gICAgV09SRCAgICAgICAgICAgICAgICAgICAgICAgIHdCYXNpY1JhdGU7Ci0gICAgQllURSAgICAgICAgICAgICAgICAgICAgICAgIGJ5QUNLUmF0ZTsKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICAgICAgYnlUb3BPRkRNQmFzaWNSYXRlOwotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgICAgICBieVRvcENDS0Jhc2ljUmF0ZTsKKyAgICB1bnNpZ25lZCBzaG9ydCB3QmFzaWNSYXRlOworICAgIHVuc2lnbmVkIGNoYXIgYnlBQ0tSYXRlOworICAgIHVuc2lnbmVkIGNoYXIgYnlUb3BPRkRNQmFzaWNSYXRlOworICAgIHVuc2lnbmVkIGNoYXIgYnlUb3BDQ0tCYXNpY1JhdGU7CiAKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICAgICAgYnlNaW5DaGFubmVsOwotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgICAgICBieU1heENoYW5uZWw7Ci0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgICAgIHVDb25uZWN0aW9uUmF0ZTsKKyAgICB1bnNpZ25lZCBjaGFyIGJ5TWluQ2hhbm5lbDsKKyAgICB1bnNpZ25lZCBjaGFyIGJ5TWF4Q2hhbm5lbDsKKyAgICB1bnNpZ25lZCBpbnQJdUNvbm5lY3Rpb25SYXRlOwogCi0gICAgQllURSAgICAgICAgICAgICAgICAgICAgICAgIGJ5UHJlYW1ibGVUeXBlOwotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgICAgICBieVNob3J0UHJlYW1ibGU7CisgICAgdW5zaWduZWQgY2hhciBieVByZWFtYmxlVHlwZTsKKyAgICB1bnNpZ25lZCBjaGFyIGJ5U2hvcnRQcmVhbWJsZTsKIAotICAgIFdPUkQgICAgICAgICAgICAgICAgICAgICAgICB3Q3VycmVudFJhdGU7Ci0gICAgV09SRCAgICAgICAgICAgICAgICAgICAgICAgIHdSVFNUaHJlc2hvbGQ7Ci0gICAgV09SRCAgICAgICAgICAgICAgICAgICAgICAgIHdGcmFnbWVudGF0aW9uVGhyZXNob2xkOwotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgICAgICBieVNob3J0UmV0cnlMaW1pdDsKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICAgICAgYnlMb25nUmV0cnlMaW1pdDsKKyAgICB1bnNpZ25lZCBzaG9ydCB3Q3VycmVudFJhdGU7CisgICAgdW5zaWduZWQgc2hvcnQgd1JUU1RocmVzaG9sZDsKKyAgICB1bnNpZ25lZCBzaG9ydCB3RnJhZ21lbnRhdGlvblRocmVzaG9sZDsKKyAgICB1bnNpZ25lZCBjaGFyIGJ5U2hvcnRSZXRyeUxpbWl0OworICAgIHVuc2lnbmVkIGNoYXIgYnlMb25nUmV0cnlMaW1pdDsKICAgICBDQVJEX09QX01PREUgICAgICAgICAgICAgICAgZU9QTW9kZTsKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICAgICAgYnlPcE1vZGU7Ci0gICAgQk9PTCAgICAgICAgICAgICAgICAgICAgICAgIGJCU1NJREZpbHRlcjsKLSAgICBXT1JEICAgICAgICAgICAgICAgICAgICAgICAgd01heFRyYW5zbWl0TVNEVUxpZmV0aW1lOwotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgICAgICBhYnlCU1NJRFtFVEhfQUxFTl07Ci0gICAgQllURSAgICAgICAgICAgICAgICAgICAgICAgIGFieURlc2lyZUJTU0lEW0VUSF9BTEVOXTsKLSAgICBXT1JEICAgICAgICAgICAgICAgICAgICAgICAgd0NUU0R1cmF0aW9uOyAgICAgICAvLyB1cGRhdGUgd2hpbGUgc3BlZWQgY2hhbmdlCi0gICAgV09SRCAgICAgICAgICAgICAgICAgICAgICAgIHdBQ0tEdXJhdGlvbjsgICAgICAgLy8gdXBkYXRlIHdoaWxlIHNwZWVkIGNoYW5nZQotICAgIFdPUkQgICAgICAgICAgICAgICAgICAgICAgICB3UlRTVHJhbnNtaXRMZW47ICAgIC8vIHVwZGF0ZSB3aGlsZSBzcGVlZCBjaGFuZ2UKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICAgICAgYnlSVFNTZXJ2aWNlRmllbGQ7ICAvLyB1cGRhdGUgd2hpbGUgc3BlZWQgY2hhbmdlCi0gICAgQllURSAgICAgICAgICAgICAgICAgICAgICAgIGJ5UlRTU2lnbmFsRmllbGQ7ICAgLy8gdXBkYXRlIHdoaWxlIHNwZWVkIGNoYW5nZQorICAgIHVuc2lnbmVkIGNoYXIgYnlPcE1vZGU7CisgICAgYm9vbCBiQlNTSURGaWx0ZXI7CisgICAgdW5zaWduZWQgc2hvcnQgd01heFRyYW5zbWl0TVNEVUxpZmV0aW1lOworICAgIHVuc2lnbmVkIGNoYXIgYWJ5QlNTSURbRVRIX0FMRU5dOworICAgIHVuc2lnbmVkIGNoYXIgYWJ5RGVzaXJlQlNTSURbRVRIX0FMRU5dOworICAgIHVuc2lnbmVkIHNob3J0IHdDVFNEdXJhdGlvbjsgICAgICAgLy8gdXBkYXRlIHdoaWxlIHNwZWVkIGNoYW5nZQorICAgIHVuc2lnbmVkIHNob3J0IHdBQ0tEdXJhdGlvbjsgICAgICAgLy8gdXBkYXRlIHdoaWxlIHNwZWVkIGNoYW5nZQorICAgIHVuc2lnbmVkIHNob3J0IHdSVFNUcmFuc21pdExlbjsgICAgLy8gdXBkYXRlIHdoaWxlIHNwZWVkIGNoYW5nZQorICAgIHVuc2lnbmVkIGNoYXIgYnlSVFNTZXJ2aWNlRmllbGQ7ICAvLyB1cGRhdGUgd2hpbGUgc3BlZWQgY2hhbmdlCisgICAgdW5zaWduZWQgY2hhciBieVJUU1NpZ25hbEZpZWxkOyAgIC8vIHVwZGF0ZSB3aGlsZSBzcGVlZCBjaGFuZ2UKIAotICAgIERXT1JEICAgICAgICAgICAgICAgICAgICAgICBkd01heFJlY2VpdmVMaWZldGltZTsgICAgICAgLy8gZG90MTFNYXhSZWNlaXZlTGlmZXRpbWUKKyAgICB1bnNpZ25lZCBsb25nIGR3TWF4UmVjZWl2ZUxpZmV0aW1lOyAgICAgICAvLyBkb3QxMU1heFJlY2VpdmVMaWZldGltZQogCi0gICAgQk9PTCAgICAgICAgICAgICAgICAgICAgICAgIGJDQ0s7Ci0gICAgQk9PTCAgICAgICAgICAgICAgICAgICAgICAgIGJFbmNyeXB0aW9uRW5hYmxlOwotICAgIEJPT0wgICAgICAgICAgICAgICAgICAgICAgICBiTG9uZ0hlYWRlcjsKLSAgICBCT09MICAgICAgICAgICAgICAgICAgICAgICAgYlNob3J0U2xvdFRpbWU7Ci0gICAgQk9PTCAgICAgICAgICAgICAgICAgICAgICAgIGJQcm90ZWN0TW9kZTsKLSAgICBCT09MICAgICAgICAgICAgICAgICAgICAgICAgYk5vbkVSUFByZXNlbnQ7Ci0gICAgQk9PTCAgICAgICAgICAgICAgICAgICAgICAgIGJCYXJrZXJQcmVhbWJsZU1kOworICAgIGJvb2wgYkNDSzsKKyAgICBib29sIGJFbmNyeXB0aW9uRW5hYmxlOworICAgIGJvb2wgYkxvbmdIZWFkZXI7CisgICAgYm9vbCBiU2hvcnRTbG90VGltZTsKKyAgICBib29sIGJQcm90ZWN0TW9kZTsKKyAgICBib29sIGJOb25FUlBQcmVzZW50OworICAgIGJvb2wgYkJhcmtlclByZWFtYmxlTWQ7CiAKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICAgICAgYnlFUlBGbGFnOwotICAgIFdPUkQgICAgICAgICAgICAgICAgICAgICAgICB3VXNlUHJvdGVjdENudERvd247CisgICAgdW5zaWduZWQgY2hhciBieUVSUEZsYWc7CisgICAgdW5zaWduZWQgc2hvcnQgd1VzZVByb3RlY3RDbnREb3duOwogCi0gICAgQk9PTCAgICAgICAgICAgICAgICAgICAgICAgIGJSYWRpb0NvbnRyb2xPZmY7Ci0gICAgQk9PTCAgICAgICAgICAgICAgICAgICAgICAgIGJSYWRpb09mZjsKLSAgICBCT09MICAgICAgICAgICAgICAgICAgICBiRW5hYmxlUFNNb2RlOwotICAgIFdPUkQgICAgICAgICAgICAgICAgICAgIHdMaXN0ZW5JbnRlcnZhbDsKLSAgICBCT09MICAgICAgICAgICAgICAgICAgICBiUFdCaXRPbjsKKyAgICBib29sIGJSYWRpb0NvbnRyb2xPZmY7CisgICAgYm9vbCBiUmFkaW9PZmY7CisgICAgYm9vbCBiRW5hYmxlUFNNb2RlOworICAgIHVuc2lnbmVkIHNob3J0IHdMaXN0ZW5JbnRlcnZhbDsKKyAgICBib29sIGJQV0JpdE9uOwogICAgIFdNQUNfUE9XRVJfTU9ERSAgICAgICAgIGVQU01vZGU7CiAKIAogICAgIC8vIEdQSU8gUmFkaW8gQ29udHJvbAotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgIGJ5UmFkaW9DdGw7Ci0gICAgQllURSAgICAgICAgICAgICAgICAgICAgYnlHUElPOwotICAgIEJPT0wgICAgICAgICAgICAgICAgICAgIGJIV1JhZGlvT2ZmOwotICAgIEJPT0wgICAgICAgICAgICAgICAgICAgIGJQcnZBY3RpdmU0UmFkaW9PRkY7Ci0gICAgQk9PTCAgICAgICAgICAgICAgICAgICAgYkdQSU9CbG9ja1JlYWQ7CisgICAgdW5zaWduZWQgY2hhciBieVJhZGlvQ3RsOworICAgIHVuc2lnbmVkIGNoYXIgYnlHUElPOworICAgIGJvb2wgYkhXUmFkaW9PZmY7CisgICAgYm9vbCBiUHJ2QWN0aXZlNFJhZGlvT0ZGOworICAgIGJvb2wgYkdQSU9CbG9ja1JlYWQ7CiAKICAgICAvLyBCZWFjb24gcmVsZWF0ZWQKLSAgICBXT1JEICAgICAgICAgICAgICAgICAgICB3U2VxQ291bnRlcjsKLSAgICBXT1JEICAgICAgICAgICAgICAgICAgICB3QkNOQnVmTGVuOwotICAgIEJPT0wgICAgICAgICAgICAgICAgICAgIGJCZWFjb25CdWZSZWFkeTsKLSAgICBCT09MICAgICAgICAgICAgICAgICAgICBiQmVhY29uU2VudDsKLSAgICBCT09MICAgICAgICAgICAgICAgICAgICBiSXNCZWFjb25CdWZSZWFkeVNldDsKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICBjYkJlYWNvbkJ1ZlJlYWR5U2V0Q250OwotICAgIEJPT0wgICAgICAgICAgICAgICAgICAgIGJGaXhSYXRlOwotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgIGJ5Q3VycmVudENoOwotICAgIFVJTlQgICAgICAgICAgICAgICAgICAgIHVTY2FuVGltZTsKKyAgICB1bnNpZ25lZCBzaG9ydCB3U2VxQ291bnRlcjsKKyAgICB1bnNpZ25lZCBzaG9ydCB3QkNOQnVmTGVuOworICAgIGJvb2wgYkJlYWNvbkJ1ZlJlYWR5OworICAgIGJvb2wgYkJlYWNvblNlbnQ7CisgICAgYm9vbCBiSXNCZWFjb25CdWZSZWFkeVNldDsKKyAgICB1bnNpZ25lZCBpbnQJY2JCZWFjb25CdWZSZWFkeVNldENudDsKKyAgICBib29sIGJGaXhSYXRlOworICAgIHVuc2lnbmVkIGNoYXIgYnlDdXJyZW50Q2g7CisgICAgdW5zaWduZWQgaW50CXVTY2FuVGltZTsKIAogICAgIENNRF9TVEFURSAgICAgICAgICAgICAgIGVDb21tYW5kU3RhdGU7CiAKICAgICBDTURfQ09ERSAgICAgICAgICAgICAgICBlQ29tbWFuZDsKLSAgICBCT09MICAgICAgICAgICAgICAgICAgICBiQmVhY29uVHg7CisgICAgYm9vbCBiQmVhY29uVHg7CiAKLSAgICBCT09MICAgICAgICAgICAgICAgICAgICBiU3RvcEJlYWNvbjsKLSAgICBCT09MICAgICAgICAgICAgICAgICAgICBiU3RvcERhdGFQa3Q7Ci0gICAgQk9PTCAgICAgICAgICAgICAgICAgICAgYlN0b3BUeDBQa3Q7Ci0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgdUF1dG9SZUNvbm5lY3RUaW1lOworICAgIGJvb2wgYlN0b3BCZWFjb247CisgICAgYm9vbCBiU3RvcERhdGFQa3Q7CisgICAgYm9vbCBiU3RvcFR4MFBrdDsKKyAgICB1bnNpZ25lZCBpbnQJdUF1dG9SZUNvbm5lY3RUaW1lOwogCiAgICAgLy8gODAyLjExIGNvdW50ZXIKIAogICAgIENNRF9JVEVNICAgICAgICAgICAgICAgIGVDbWRRdWV1ZVtDTURfUV9TSVpFXTsKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICB1Q21kRGVxdWV1ZUlkeDsKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICB1Q21kRW5xdWV1ZUlkeDsKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICBjYkZyZWVDbWRRdWV1ZTsKLSAgICBCT09MICAgICAgICAgICAgICAgICAgICBiQ21kUnVubmluZzsKLSAgICBCT09MICAgICAgICAgICAgICAgICAgICBiQ21kQ2xlYXI7CisgICAgdW5zaWduZWQgaW50CXVDbWREZXF1ZXVlSWR4OworICAgIHVuc2lnbmVkIGludAl1Q21kRW5xdWV1ZUlkeDsKKyAgICB1bnNpZ25lZCBpbnQJY2JGcmVlQ21kUXVldWU7CisgICAgYm9vbCBiQ21kUnVubmluZzsKKyAgICBib29sIGJDbWRDbGVhcjsKIAogCiAKLSAgICBCT09MICAgICAgICAgICAgICAgICAgICBiUm9hbWluZzsKKyAgICBib29sIGJSb2FtaW5nOwogICAgIC8vV09XCi0gICAgQllURSAgICAgICAgICAgICAgICAgICAgYWJ5SVBBZGRyWzRdOworICAgIHVuc2lnbmVkIGNoYXIgYWJ5SVBBZGRyWzRdOwogCi0gICAgVUxPTkcgICAgICAgICAgICAgICAgICAgdWxUeFBvd2VyOworICAgIHVuc2lnbmVkIGxvbmcgdWxUeFBvd2VyOwogICAgIE5ESVNfODAyXzExX1dFUF9TVEFUVVMgIGVFbmNyeXB0aW9uU3RhdHVzOwotICAgIEJPT0wgICAgICAgICAgICAgICAgICAgIGJUcmFuc21pdEtleTsKKyAgICBib29sIGJUcmFuc21pdEtleTsKIC8vMjAwNy0wOTI1LTAxPEFkZD5ieSBNaWtlTGl1CiAvL21pa2UgYWRkIDpzYXZlIG9sZCBFbmNyeXB0aW9uCiAgICAgTkRJU184MDJfMTFfV0VQX1NUQVRVUyAgZU9sZEVuY3J5cHRpb25TdGF0dXM7CiAKICAgICBTS2V5TWFuYWdlbWVudCAgICAgICAgICBzS2V5OwotICAgIERXT1JEICAgICAgICAgICAgICAgICAgIGR3SVZDb3VudGVyOworICAgIHVuc2lnbmVkIGxvbmcgZHdJVkNvdW50ZXI7CiAKICAgICBRV09SRCAgICAgICAgICAgICAgICAgICBxd1BhY2tldE51bWJlcjsgLy9Gb3IgQ0NNUCBhbmQgVEtJUCBhcyBUU0MoNiBieXRlcykKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICB1Q3VycmVudFdFUE1vZGU7CisgICAgdW5zaWduZWQgaW50CXVDdXJyZW50V0VQTW9kZTsKIAogICAgIFJDNEV4dCAgICAgICAgICAgICAgICAgIFNCb3g7Ci0gICAgQllURSAgICAgICAgICAgICAgICAgICAgYWJ5UFJOR1tXTEFOX1dFUE1BWF9LRVlMRU4rM107Ci0gICAgQllURSAgICAgICAgICAgICAgICAgICAgYnlLZXlJbmRleDsKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICB1S2V5TGVuZ3RoOwotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgIGFieUtleVtXTEFOX1dFUDIzMl9LRVlMRU5dOworICAgIHVuc2lnbmVkIGNoYXIgYWJ5UFJOR1tXTEFOX1dFUE1BWF9LRVlMRU4rM107CisgICAgdW5zaWduZWQgY2hhciBieUtleUluZGV4OworICAgIHVuc2lnbmVkIGludAl1S2V5TGVuZ3RoOworICAgIHVuc2lnbmVkIGNoYXIgYWJ5S2V5W1dMQU5fV0VQMjMyX0tFWUxFTl07CiAKLSAgICBCT09MICAgICAgICAgICAgICAgICAgICBiQUVTOwotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgIGJ5Q250TWVhc3VyZTsKKyAgICBib29sIGJBRVM7CisgICAgdW5zaWduZWQgY2hhciBieUNudE1lYXN1cmU7CiAKICAgICAvLyBmb3IgQVAgbW9kZQotICAgIFVJTlQgICAgICAgICAgICAgICAgICAgIHVBc3NvY0NvdW50OwotICAgIEJPT0wgICAgICAgICAgICAgICAgICAgIGJNb3JlRGF0YTsKKyAgICB1bnNpZ25lZCBpbnQJdUFzc29jQ291bnQ7CisgICAgYm9vbCBiTW9yZURhdGE7CiAKICAgICAvLyBRb1MKLSAgICBCT09MICAgICAgICAgICAgICAgICAgICBiR3JwQWNrUG9saWN5OworICAgIGJvb2wgYkdycEFja1BvbGljeTsKIAogICAgIC8vIGZvciBPSURfODAyXzExX0FTU09DSUFUSU9OX0lORk9STUFUSU9OCi0gICAgQk9PTCAgICAgICAgICAgICAgICAgICAgYkFzc29jSW5mb1NldDsKKyAgICBib29sIGJBc3NvY0luZm9TZXQ7CiAKIAotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgIGJ5QXV0b0ZCQ3RybDsKKyAgICB1bnNpZ25lZCBjaGFyIGJ5QXV0b0ZCQ3RybDsKIAotICAgIEJPT0wgICAgICAgICAgICAgICAgICAgIGJUeE1JQ0ZhaWw7Ci0gICAgQk9PTCAgICAgICAgICAgICAgICAgICAgYlJ4TUlDRmFpbDsKKyAgICBib29sIGJUeE1JQ0ZhaWw7CisgICAgYm9vbCBiUnhNSUNGYWlsOwogCiAKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICB1UkFURUlkeDsKKyAgICB1bnNpZ25lZCBpbnQJdVJBVEVJZHg7CiAKIAogICAgIC8vIEZvciBVcGRhdGUgQmFzZUJhbmQgVkdBIEdhaW4gT2Zmc2V0Ci0gICAgQk9PTCAgICAgICAgICAgICAgICAgICAgYlVwZGF0ZUJCVkdBOwotICAgIFVJTlQgICAgICAgICAgICAgICAgICAgIHVCQlZHQURpZmZDb3VudDsKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICBieUJCVkdBTmV3OwotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgIGJ5QkJWR0FDdXJyZW50OwotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgIGFieUJCVkdBW0JCX1ZHQV9MRVZFTF07Ci0gICAgTE9ORyAgICAgICAgICAgICAgICAgICAgbGRCbVRocmVzaG9sZFtCQl9WR0FfTEVWRUxdOworICAgIGJvb2wgYlVwZGF0ZUJCVkdBOworICAgIHVuc2lnbmVkIGludAl1QkJWR0FEaWZmQ291bnQ7CisgICAgdW5zaWduZWQgY2hhciBieUJCVkdBTmV3OworICAgIHVuc2lnbmVkIGNoYXIgYnlCQlZHQUN1cnJlbnQ7CisgICAgdW5zaWduZWQgY2hhciBhYnlCQlZHQVtCQl9WR0FfTEVWRUxdOworICAgIGxvbmcgICAgICAgICAgICAgICAgICAgIGxkQm1UaHJlc2hvbGRbQkJfVkdBX0xFVkVMXTsKIAotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgIGJ5QkJQcmVFRFJTU0k7Ci0gICAgQllURSAgICAgICAgICAgICAgICAgICAgYnlCQlByZUVESW5kZXg7CisgICAgdW5zaWduZWQgY2hhciBieUJCUHJlRURSU1NJOworICAgIHVuc2lnbmVkIGNoYXIgYnlCQlByZUVESW5kZXg7CiAKIAotICAgIEJPT0wgICAgICAgICAgICAgICAgICAgIGJSYWRpb0NtZDsKLSAgICBEV09SRCAgICAgICAgICAgICAgICAgICBkd0RpYWdSZWZDb3VudDsKKyAgICBib29sIGJSYWRpb0NtZDsKKyAgICB1bnNpZ25lZCBsb25nIGR3RGlhZ1JlZkNvdW50OwogCiAgICAgLy8gRm9yIEZPRSBUdW5pbmcKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICBieUZPRVR1bmluZzsKKyAgICB1bnNpZ25lZCBjaGFyIGJ5Rk9FVHVuaW5nOwogCiAgICAgLy8gRm9yIEF1dG8gUG93ZXIgVHVubmluZwogCi0gICAgQllURSAgICAgICAgICAgICAgICAgICAgYnlBdXRvUHdyVHVubmluZzsKLSAgICBTSE9SVCAgICAgICAgICAgICAgICAgICBzUFNldFBvaW50Q0NLOwotICAgIFNIT1JUICAgICAgICAgICAgICAgICAgIHNQU2V0UG9pbnRPRkRNRzsKLSAgICBTSE9SVCAgICAgICAgICAgICAgICAgICBzUFNldFBvaW50T0ZETUE7Ci0gICAgTE9ORyAgICAgICAgICAgICAgICAgICAgbFBGb3JtdWxhT2Zmc2V0OwotICAgIFNIT1JUICAgICAgICAgICAgICAgICAgIHNQVGhyZXNob2xkOwotICAgIENIQVIgICAgICAgICAgICAgICAgICAgIGNBZGp1c3RTdGVwOwotICAgIENIQVIgICAgICAgICAgICAgICAgICAgIGNNaW5UeEFHQzsKKyAgICB1bnNpZ25lZCBjaGFyIGJ5QXV0b1B3clR1bm5pbmc7CisgICAgc2hvcnQgICAgICAgICAgICAgICAgICAgc1BTZXRQb2ludENDSzsKKyAgICBzaG9ydCAgICAgICAgICAgICAgICAgICBzUFNldFBvaW50T0ZETUc7CisgICAgc2hvcnQgICAgICAgICAgICAgICAgICAgc1BTZXRQb2ludE9GRE1BOworICAgIGxvbmcgICAgICAgICAgICAgICAgICAgIGxQRm9ybXVsYU9mZnNldDsKKyAgICBzaG9ydCAgICAgICAgICAgICAgICAgICBzUFRocmVzaG9sZDsKKyAgICBjaGFyICAgICAgICAgICAgICAgICAgICBjQWRqdXN0U3RlcDsKKyAgICBjaGFyICAgICAgICAgICAgICAgICAgICBjTWluVHhBR0M7CiAKICAgICAvLyBGb3IgUkYgUG93ZXIgdGFibGUKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICBieUNDS1B3cjsKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICBieU9GRE1Qd3JHOwotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgIGJ5Q3VyUHdyOwotICAgIEk4ICAgICAgICAgICAgICAgICAgICAgIGJ5Q3VyUHdyZEJtOwotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgIGFieUNDS1B3clRibFtDQl9NQVhfQ0hBTk5FTF8yNEcrMV07Ci0gICAgQllURSAgICAgICAgICAgICAgICAgICAgYWJ5T0ZETVB3clRibFtDQl9NQVhfQ0hBTk5FTCsxXTsKLSAgICBJOCAgICAgICAgICAgICAgICAgICAgICBhYnlDQ0tEZWZhdWx0UHdyW0NCX01BWF9DSEFOTkVMXzI0RysxXTsKLSAgICBJOCAgICAgICAgICAgICAgICAgICAgICBhYnlPRkRNRGVmYXVsdFB3cltDQl9NQVhfQ0hBTk5FTCsxXTsKLSAgICBJOCAgICAgICAgICAgICAgICAgICAgICBhYnlSZWdQd3JbQ0JfTUFYX0NIQU5ORUwrMV07Ci0gICAgSTggICAgICAgICAgICAgICAgICAgICAgYWJ5TG9jYWxQd3JbQ0JfTUFYX0NIQU5ORUwrMV07CisgICAgdW5zaWduZWQgY2hhciBieUNDS1B3cjsKKyAgICB1bnNpZ25lZCBjaGFyIGJ5T0ZETVB3ckc7CisgICAgdW5zaWduZWQgY2hhciBieUN1clB3cjsKKyAgICBjaGFyCSBieUN1clB3cmRCbTsKKyAgICB1bnNpZ25lZCBjaGFyIGFieUNDS1B3clRibFtDQl9NQVhfQ0hBTk5FTF8yNEcrMV07CisgICAgdW5zaWduZWQgY2hhciBhYnlPRkRNUHdy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2VyOwogI2VuZGlmCiAKICNpZmRlZiBXUEFfU01fVHJhbnN0YXR1cwotICAgIEJPT0wgIGZXUEFfQXV0aGVuZWQ7ICAgICAgICAgICAvL2lzIFdQQS9XUEEtUFNLIG9yIFdQQTIvV1BBMi1QU0sgYXV0aGVuPz8KKyAgICBib29sIGZXUEFfQXV0aGVuZWQ7ICAgICAgICAgICAvL2lzIFdQQS9XUEEtUFNLIG9yIFdQQTIvV1BBMi1QU0sgYXV0aGVuPz8KICNlbmRpZgotICAgIEJZVEUgICAgICAgICAgICBieVJlQXNzb2NDb3VudDsgICAvL21pa2UgYWRkOnJlLWFzc29jaWF0aW9uIHJldHJ5IHRpbWVzIQotICAgIEJZVEUgICAgICAgICAgICBieUxpbmtXYWl0Q291bnQ7CisgICAgdW5zaWduZWQgY2hhciBieVJlQXNzb2NDb3VudDsgICAvL21pa2UgYWRkOnJlLWFzc29jaWF0aW9uIHJldHJ5IHRpbWVzIQorICAgIHVuc2lnbmVkIGNoYXIgYnlMaW5rV2FpdENvdW50OwogCiAKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICBhYnlOb2RlTmFtZVsxN107CisgICAgdW5zaWduZWQgY2hhciBhYnlOb2RlTmFtZVsxN107CiAKLSAgICBCT09MICAgICAgICAgICAgICAgICAgICBiRGl2ZXJzaXR5UmVnQ3RsT047Ci0gICAgQk9PTCAgICAgICAgICAgICAgICAgICAgYkRpdmVyc2l0eUVuYWJsZTsKLSAgICBVTE9ORyAgICAgICAgICAgICAgICAgICB1bERpdmVyc2l0eU5WYWx1ZTsKLSAgICBVTE9ORyAgICAgICAgICAgICAgICAgICB1bERpdmVyc2l0eU1WYWx1ZTsKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICBieVRNYXg7Ci0gICAgQllURSAgICAgICAgICAgICAgICAgICAgYnlUTWF4MjsKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICBieVRNYXgzOwotICAgIFVMT05HICAgICAgICAgICAgICAgICAgIHVsU1EzV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gIGIxMWhFbmFibGU7Ci0gICAgQllURSAgICAgICAgICAgICAgICAgICAgYWJ5Q291bnRyeUNvZGVbM107CisgICAgYm9vbCBiMTFoRW5hYmxlOworICAgIHVuc2lnbmVkIGNoYXIgYWJ5Q291bnRyeUNvZGVbM107CiAgICAgLy8gZm9yIDgwMi4xMWggREZTCi0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgdU51bU9mTWVhc3VyZUVJRHM7CisgICAgdW5zaWduZWQgaW50CXVOdW1PZk1lYXN1cmVFSURzOwogICAgIFBXTEFOX0lFX01FQVNVUkVfUkVRICAgIHBDdXJyTWVhc3VyZUVJRDsKLSAgICBCT09MICAgICAgICAgICAgICAgICAgICBiTWVhc3VyZUluUHJvZ3Jlc3M7Ci0gICAgQllURSAgICAgICAgICAgICAgICAgICAgYnlPcmdDaGFubmVsOwotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgIGJ5T3JnUkNSOwotICAgIERXT1JEICAgICAgICAgICAgICAgICAgIGR3T3JnTUFSMDsKLSAgICBEV09SRCAgICAgICAgICAgICAgICAgICBkd09yZ01BUjQ7Ci0gICAgQllURSAgICAgICAgICAgICAgICAgICAgYnlCYXNpY01hcDsKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICBieUNDQUZyYWN0aW9uOwotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgIGFieVJQSXNbOF07Ci0gICAgRFdPUkQgICAgICAgICAgICAgICAgICAgZHdSUElzWzhdOwotICAgIEJPT0wgICAgICAgICAgICAgICAgICAgIGJDaGFubmVsU3dpdGNoOwotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgIGJ5TmV3Q2hhbm5lbDsKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICBieUNoYW5uZWxTd2l0Y2hDb3VudDsKLSAgICBCT09MICAgICAgICAgICAgICAgICAgICBiUXVpZXRFbmFibGU7Ci0gICAgQk9PTCAgICAgICAgICAgICAgICAgICAgYkVuYWJsZUZpcnN0UXVpZXQ7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b3VudHJ5SW5mbzI0RzsKKyAgICBib29sIGJDb3VudHJ5SW5mbzVHOworICAgIGJvb2wgYkNvdW50cnlJbmZvMjRHOwogCi0gICAgV09SRCAgICAgICAgICAgICAgICAgICAgd0JlYWNvbkludGVydmFsOworICAgIHVuc2lnbmVkIHNob3J0IHdCZWFjb25JbnRlcnZhbDsKIAogICAgIC8vV1BBIHN1cHBsaWNhbnQgZGVhbW9uCiAJc3RydWN0IG5ldF9kZXZpY2UgICAgICAgKndwYWRldjsKLQlCT09MICAgICAgICAgICAgICAgICAgICBiV1BBREVWVXA7CisJYm9vbCBiV1BBREVWVXA7CiAgICAgc3RydWN0IHNrX2J1ZmYgICAgICAgICAgKnNrYjsKICNpZmRlZiBXUEFfU1VQUExJQ0FOVF9EUklWRVJfV0VYVF9TVVBQT1JUCiAvKgotICAgICAgICBCT09MICAgICAgICAgICAgICAgICBid2V4dHN0ZXAwOwotICAgICAgICBCT09MICAgICAgICAgICAgICAgICBid2V4dHN0ZXAxOwotICAgICAgICBCT09MICAgICAgICAgICAgICAgICBid2V4dHN0ZXAyOwotICAgICAgICBCT09MICAgICAgICAgICAgICAgICBid2V4dHN0ZXAzOworICAgICAgICBib29sIGJ3ZXh0c3RlcDA7CisgICAgICAgIGJvb2wgYndleHRzdGVwMTsKKyAgICAgICAgYm9vbCBid2V4dHN0ZXAyOworICAgICAgICBib29sIGJ3ZXh0c3RlcDM7CiAgICAgICAgICovCi0gICAgICAgIFVJTlQgICAgICAgICAgICAgICAgICAgYndleHRjb3VudDsKLSAgICAgICAgQk9PTCAgICAgICAgICAgICAgICAgYldQQVN1cHBXZXh0RW5hYmxlZDsKKyAgICAgICAgdW5zaWduZWQgaW50CWJ3ZXh0Y291bnQ7CisgICAgICAgIGJvb2wgYldQQVN1cHBXZXh0RW5hYmxlZDsKICNlbmRpZgogCiAgICAgLy8tLQogI2lmZGVmIEhPU1RBUAogICAgIC8vIHVzZXIgc3BhY2UgZGFlbW9uOiBob3N0YXBkLCBpcyB1c2VkIGZvciBIT1NUQVAKLQlCT09MICAgICAgICAgICAgICAgICAgICBiRW5hYmxlSG9zdGFwZDsKLQlCT09MICAgICAgICAgICAgICAgICAgICBiRW5hYmxlODAyMXg7Ci0JQk9PTCAgICAgICAgICAgICAgICAgICAgYkVuYWJsZUhvc3RXRVA7CisJYm9vbCBiRW5hYmxlSG9zdGFwZDsKKwlib29sIGJFbmFibGU4MDIxeDsKKwlib29sIGJFbmFibGVIb3N0V0VQOwogCXN0cnVjdCBuZXRfZGV2aWNlICAgICAgICphcGRldjsKIAlpbnQgKCp0eF84MDIxMSkoc3RydWN0IHNrX2J1ZmYgKnNrYiwgc3RydWN0IG5ldF9kZXZpY2UgKmRldik7CiAjZW5kaWYKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICB1Q2hhbm5lbDsKLSAgICBCT09MICAgICAgICAgICAgICAgICAgICBiTUFDU3VzcGVuZDsKKyAgICB1bnNpZ25lZCBpbnQJdUNoYW5uZWw7CisgICAgYm9vbCBiTUFDU3VzcGVuZDsKIAogCXN0cnVjdCBpd19zdGF0aXN0aWNzCXdzdGF0czsJCS8vIHdpcmVsZXNzIHN0YXRzCi0gICAgQk9PTCAgICAgICAgICAgICAgICAgICAgYkNvbW1pdDsKKyAgICBib29sIGJDb21taXQ7CiAKIH0gREVWSUNFX0lORk8sICpQU0RldmljZTsKIApAQCAtODgwLDcgKzg4MCw3IEBACiAKIAogCi1pbmxpbmUgc3RhdGljIEJPT0wgZGV2aWNlX2dldF9pcChQU0RldmljZSBwSW5mbykgeworaW5saW5lIHN0YXRpYyBib29sIGRldmljZV9nZXRfaXAoUFNEZXZpY2UgcEluZm8pIHsKICAgICBzdHJ1Y3QgaW5fZGV2aWNlKiBpbl9kZXY9KHN0cnVjdCBpbl9kZXZpY2UqKSBwSW5mby0+ZGV2LT5pcF9wdHI7CiAgICAgc3RydWN0IGluX2lmYWRkciogaWZhOwogCkBAIC04ODgsMTAgKzg4OCwxMCBAQAogICAgICAgICBp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7CiAKICAgICAgaWYgKHBEZXZpY2UtPnVOdW1PZk1lYXN1cmVFSURzID09IDApIHsKICAgICAgICAgVk5UV0lGSWJNZWFzdXJlUmVwb3J0KCAgcERldmljZS0+cE1nbXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRSVUUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRydWUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBEZXZpY2UtPnBDdXJyTWVhc3VyZUVJRCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnlSZXN1bHQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJ5QmFzaWNNYXAsCkBAIC01MDUsNyArNTA3LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsKICAgICB9IGVsc2UgewogICAgICAgICBWTlRXSUZJYk1lYXN1cmVSZXBvcnQoICBwRGV2aWNlLT5wTWdtdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkFMU0UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT5wQ3Vyck1lYXN1cmVFSUQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5UmVzdWx0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT5ieUJhc2ljTWFwLApAQCAtNTI1LDEyICs1MjcsMTIgQEAKIAogc3RhdGljIHZvaWQgZGV2aWNlX2luaXRfcmVnaXN0ZXJzKFBTRGV2aWNlIHBEZXZpY2UsIERFVklDRV9JTklUX1RZUEUgSW5pdFR5cGUpCiB7Ci0gICAgVUlOVCAgICBpaTsKLSAgICBCWVRFICAgIGJ5VmFsdWU7Ci0JQllURSAgICBieVZhbHVlMTsKLSAgICBCWVRFICAgIGJ5Q0NLUHdyZEJtID0gMD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NlCiAgICAgICAgICAgICAgICAgcERldmljZS0+YnlSeEFudGVubmFNb2RlID0gQU5UX0I7CkBAIC02MDMsMjYgKzYwNSwyNiBAQAogYnlWYWx1ZTEgPSBTUk9NYnlSZWFkRW1iZWRkZWQocERldmljZS0+UG9ydE9mZnNldCwgRUVQX09GU19BTlRFTk5BKTsKICAgICAgICAgICAvLyAgaWYgKHBEZXZpY2UtPmJEaXZlcnNpdHlSZWdDdGxPTikKICAgICAgICAgICBpZigoYnlWYWx1ZTEmMHgwOCk9PTApCi0gICAgICAgICAgICAgICAgcERldmljZS0+YkRpdmVyc2l0eUVuYWJsZSA9IEZBTFNFOy8vU1JPTWJ5UmVhZEVtYmVkZGVkKHBEZXZpY2UtPlBvcnRPZmZzZXQsIDB4NTApOworICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJEaXZlcnNpdHlFbmFibGUgPSBmYWxzZTsvL1NST01ieVJlYWRFbWJlZGRlZChwRGV2aWNlLT5Qb3J0T2Zmc2V0LCAweDUwKTsKICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICBwRGV2aWNlLT5iRGl2ZXJzaXR5RW5hYmxlID0gVFJVRTsKKyAgICAgICAgICAgICAgICBwRGV2aWNlLT5iRGl2ZXJzaXR5RW5hYmxlID0gdHJ1ZTsKICNpZmRlZglQTElDRV9ERUJVRwogCQkvL3ByaW50aygiYXV4IHxtYWluIGFudGVubmE6IFJ4QW50ZW5uYU1vZGUgaXMgJWRcbiIscERldmljZS0+YnlSeEFudGVubmFNb2RlKTsKICNlbmRpZgogCX0gZWxzZSAgewotICAgICAgICAgICAgcERldmljZS0+YkRpdmVyc2l0eUVuYWJsZSA9IEZBTFNFOworICAgICAgICAgICAgcERldmljZS0+YkRpdmVyc2l0eUVuYWJsZSA9IGZhbHNlOwogICAgICAgICAgICAgcERldmljZS0+YnlBbnRlbm5hQ291bnQgPSAxOwogICAgICAgICAgICAgcERldmljZS0+ZHdUeEFudGVubmFTZWwgPSAwOwogICAgICAgICAgICAgcERldmljZS0+ZHdSeEFudGVubmFTZWwgPSAwOwogICAgICAgICAgICAgaWYgKGJ5VmFsdWUgJiBFRVBfQU5URU5OQV9BVVgpIHsKICAgICAgICAgICAgICAgICBwRGV2aWNlLT5ieVR4QW50ZW5uYU1vZGUgPSBBTlRfQTsKLSAgICAgICAgICAgICAgICBpZiAocERldmljZS0+YlR4UnhBbnRJbnYgPT0gVFJVRSkKKyAgICAgICAgICAgICAgICBpZiAocERldmljZS0+YlR4UnhBbnRJbnYgPT0gdHJ1ZSkKICAgICAgICAgICAgICAgICAgICAgcERldmljZS0+YnlSeEFudGVubmFNb2RlID0gQU5UX0I7CiAgICAgICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT5ieVJ4QW50ZW5uYU1vZGUgPSBBTlRfQTsKICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgcERldmljZS0+YnlUeEFudGVubmFNb2RlID0gQU5UX0I7Ci0gICAgICAgICAgICAgICAgaWYgKHBEZXZpY2UtPmJUeFJ4QW50SW52ID09IFRSVUUpCisgICAgICAgICAgICAgICAgaWYgKHBEZXZpY2UtPmJUeFJ4QW50SW52ID09IHRydWUpCiAgICAgICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJ5UnhBbnRlbm5hTW9kZSA9IEFOVF9BOwogICAgICAgICAgICAgICAgIGVsc2UKICAgICAgICAgICAgICAgICAgICAgcERldmljZS0+YnlSeEFudGVubmFNb2RlID0gQU5UX0I7CkBAIC02MzgsNyArNjQwLDcgQEAKIC8vMjAwOC04LTQgPGFkZD4gYnkgY2hlc3RlcgogLy96b25ldHlwZSBpbml0aWFsCiAgcERldmljZS0+YnlPcmlnaW5hbFpvbmV0eXBlID0gcERldmljZS0+YWJ5RUVQUk9NW0VFUF9PRlNfWk9ORVRZUEVdOwotIHpvbmV0eXBlID0gQ29uZmlnX0ZpbGVPcGVyYXRpb24ocERldmljZSxGQUxTRSxOVU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V9hbGxvY19yeF9idWY6c2tiIGlzICV4XG4iLHBSREluZm8tPnNrYik7CiAjZW5kaWYKICAgICBpZiAocFJESW5mby0+c2tiPT1OVUxMKQotICAgICAgICByZXR1cm4gRkFMU0U7CisgICAgICAgIHJldHVybiBmYWxzZTsKICAgICBBU1NFUlQocFJESW5mby0+c2tiKTsKICAgICBwUkRJbmZvLT5za2ItPmRldiA9IHBEZXZpY2UtPmRldjsKICAgICBwUkRJbmZvLT5za2JfZG1hID0gcGNpX21hcF9zaW5nbGUocERldmljZS0+cGNpZCwgc2tiX3RhaWxfcG9pbnRlcihwUkRJbmZvLT5za2IpLApAQCAtMTY0MywzNSArMTY0NiwzNSBAQAogICAgIHBSRC0+bV9yZDFSRDEud1JlcUNvdW50ID0gY3B1X3RvX2xlMTYocERldmljZS0+cnhfYnVmX3N6KTsKICAgICBwUkQtPmJ1ZmZfYWRkciA9IGNwdV90b19sZTMyKHBSREluZm8tPnNrYl9kbWEpOwogCi0gICAgcmV0dXJuIFRSVUU7CisgICAgcmV0dXJuIHRydWU7CiB9CiAKIAogCi1CT09MIGRldmljZV9hbGxvY19mcmFnX2J1ZihQU0RldmljZSBwRGV2aWNlLCBQU0RlRnJhZ0NvbnRyb2xCbG9jayBwRGVGKSB7Citib29sIGRldmljZV9hbGxvY19mcmFnX2J1ZihQU0RldmljZSBwRGV2aWNlLCBQU0RlRnJhZ0NvbnRyb2xCbG9jayBwRGVGKSB7CiAKICAgICBwRGVGLT5za2IgPSBkZXZfYWxsb2Nfc2tiKChpbnQpcERldmljZS0+cnhfYnVmX3N6KTsKICAgICBpZiAocERlRi0+c2tiID09IE5VTEwpCi0gICAgICAgIHJldHVybiBGQUxTRTsKKyAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgIEFTU0VSVChwRGVGLT5za2IpOwogICAgIHBEZUYtPnNrYi0+ZGV2ID0gcERldmljZS0+ZGV2OwogCi0gICAgcmV0dXJuIFRSVUU7CisgICAgcmV0dXJuIHRydWU7CiB9CiAKIAogCi1zdGF0aWMgaW50IGRldmljZV90eF9zcnYoUFNEZXZpY2UgcERldmljZSwgVUlOVCB1SWR4KSB7CitzdGF0aWMgaW50IGRldmljZV90eF9zcnYoUFNEZXZpY2UgcERldmljZSwgdW5zaWduZWQgaW50IHVJZHgpIHsKICAgICBQU1R4RGVzYyAgICAgICAgICAgICAgICAgcFREOwotICAgIEJPT0wgICAgICAgICAgICAgICAgICAgICBiRnVsbD1GQUxTRTsKKyAgICBib29sIGJGdWxsPWZhbHNlOwogICAgIGludCAgICAgICAgICAgICAgICAgICAgICB3b3JrcyA9IDA7Ci0gICAgQllURSAgICAgICAgICAgICAgICAgICAgIGJ5VHNyMDsKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICAgYnlUc3IxOwotICAgIFVJTlQgICAgICAgICAgICAgICAgICAgICB1RnJhbWVTaXplLCB1RklGT0hlYWRlclNpemU7CisgICAgdW5zaWduZWQgY2hhciBieVRzcjA7CisgICAgdW5zaWduZWQgY2hhciBieVRzcjE7CisgICAgdW5zaWduZWQgaW50CXVGcmFtZVNpemUsIHVGSUZPSGVhZGVyU2l6ZTsKICAgICBQU1R4QnVmSGVhZCAgICAgICAgICAgICAgcFR4QnVmSGVhZDsKICAgICBzdHJ1Y3QgbmV0X2RldmljZV9zdGF0cyogcFN0YXRzID0gJnBEZXZpY2UtPnN0YXRzOwogICAgIHN0cnVjdCBza19idWZmKiAgICAgICAgICBza2I7Ci0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgIHVOb2RlSW5kZXg7CisgICAgdW5zaWduZWQgaW50CXVOb2RlSW5kZXg7CiAgICAgUFNNZ210T2JqZWN0ICAgICAgICAgICAgIHBNZ210ID0gcERldmljZS0+cE1nbXQ7CiAKIApAQCAtMTY5NywyMCArMTcwMCwyMCBAQAogCiAgICAgICAgICAgICAgICAgU1RBdlVwZGF0ZVREU3RhdENvdW50ZXIoJnBEZXZpY2UtPnNjU3RhdGlzdGljLAogICAgICAgICAgICAgICAgICAgICAgICAgYnlUc3IwLCBieVRzcjEsCi0gICAgICAgICAgICAgICAgICAgICAgICAoUEJZVEUpKHBURC0+cFRESW5mby0+YnVmICsgdUZJRk9IZWFkZXJTaXplKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCBjaGFyICopKHBURC0+cFRESW5mby0+YnVmICsgdUZJRk9IZWFkZXJTaXplKSwKICAgICAgICAgICAgICAgICAgICAgICAgIHVGcmFtZVNpemUsIHVJZHgpOwogCiAKICAgICAgICAgICAgICAgICBCU1N2VXBkYXRlTm9kZVR4Q291bnRlcihwRGV2aWNlLAogICAgICAgICAgICAgICAgICAgICAgICAgIGJ5VHNyMCwgYnlUc3IxLAotICAgICAgICAgICAgICAgICAgICAgICAgIChQQllURSkocFRELT5wVERJbmZvLT5idWYpLAorICAgICAgICAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCBjaGFyICopKHBURC0+cFRESW5mby0+YnVmKSwKICAgICAgICAgICAgICAgICAgICAgICAgICB1RklGT0hlYWRlclNpemUKICAgICAgICAgICAgICAgICAgICAgICAgICApOwogCiAgICAgICAgICAgICAgICAgaWYgKCAhKGJ5VHNyMSAmIFRTUjFfVEVSUikpIHsKICAgICAgICAgICAgICAgICAgICAgaWYgKGJ5VHNyMCAhPSAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPIiBUeFslZF0gT0sgYnV0IGhhcyBlcnJvci4gdHNyMVslMDJYXSB0c3IwWyUwMlhdLlxuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIChJTlQpdUlkeCwgYnlUc3IxLCBieVRzcjApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgKGludCl1SWR4LCBieVRzcjEsIGJ5VHNyMCk7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgaWYgKChwVHhCdWZIZWFkLT53RnJhZ0N0bCAmIEZSQUdDVExfRU5ERlJBRykgIT0gRlJBR0NUTF9OT05GUkFHKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT5zODAyXzExQ291bnRlci5UcmFuc21pdHRlZEZyYWdtZW50Q291bnQgKys7CkBAIC0xNzIwLDcgKzE3MjMsNyBAQAogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8iIFR4WyVkXSBkcm9wcGVkICYgdHNyMVslMDJYXSB0c3IwWyUwMlhdLlxuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIChJTlQpdUlkeCwgYnlUc3IxLCBieVRzcjApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgKGludCl1SWR4LCBieVRzcjEsIGJ5VHNyMCk7CiAgICAgICAgICAgICAgICAgICAgIHBTdGF0cy0+dHhfZXJyb3JzKys7CiAgICAgICAgICAgICAgICAgICAgIHBTdGF0cy0+dHhfZHJvcHBlZCsrOwogICAgICAgICAgICAgICAgIH0KQEAgLTE3NDIsMTkgKzE3NDUsMTkgQEAKICAgICAgICAgICAgIGlmIChieVRzcjEgJiBUU1IxX1RFUlIpIHsKICAgICAgICAgICAgIGlmICgocFRELT5wVERJbmZvLT5ieUZsYWdzICYgVERfRkxBR1NfUFJJVl9TS0IpICE9IDApIHsKICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPIiBUeFslZF0gZmFpbCBoYXMgZXJyb3IuIHRzcjFbJTAyWF0gdHNyMFslMDJYXS5cbiIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIChJTlQpdUlkeCwgYnlUc3IxLCBieVRzcjApOworICAgICAgICAgICAgICAgICAgICAgICAgICAoaW50KXVJZHgsIGJ5VHNyMSwgYnlUc3IwKTsKICAgICAgICAgICAgIH0KIAogLy8gICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyIgVHhbJWRdIGZhaWwgaGFzIGVycm9yLiB0c3IxWyUwMlhdIHRzcjBbJTAyWF0uXG4iLAotLy8gICAgICAgICAgICAgICAgICAgICAgICAgIChJTlQpdUlkeCwgYnlUc3IxLCBieVRzcjApOworLy8gICAgICAgICAgICAgICAgICAgICAgICAgIChpbnQpdUlkeCwgYnlUc3IxLCBieVRzcjApOwogCiAgICAgICAgICAgICAgICAgaWYgKChwTWdtdC0+ZUN1cnJNb2RlID09IFdNQUNfTU9ERV9FU1NfQVApICYmCiAgICAgICAgICAgICAgICAgICAgIChwVEQtPnBUREluZm8tPmJ5RmxhZ3MgJiBURF9GTEFHU19ORVRJRl9TS0IpKSB7Ci0gICAgICAgICAgICAgICAgICAgIFdPUkQgICAgd0FJRDsKLSAgICAgICAgICAgICAgICAgICAgQllURSAgICBieU1hc2tbOF0gPSB7MSwgMiwgNCwgOCwgMHgxMCwgMHgyMCwgMHg0MCwgMHg4MH07CisgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIHNob3J0IHdBSUQ7CisgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXIgYnlNYXNrWzhdID0gezEsIDIsIDQsIDgsIDB4MTAsIDB4MjAsIDB4NDAsIDB4ODB9OwogCiAgICAgICAgICAgICAgICAgICAgIHNrYiA9IHBURC0+cFRESW5mby0+c2tiOwotICAgICAgICAgICAgICAgICAgICBpZiAoQlNTREJiSXNTVEFJbk5vZGVEQihwTWdtdCwgKFBCWVRFKShza2ItPmRhdGEpLCAmdU5vZGVJbmRleCkpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKEJTU0RCYklzU1RBSW5Ob2RlREIocE1nbXQsICh1bnNpZ25lZCBjaGFyICopKHNrYi0+ZGF0YSksICZ1Tm9kZUluZGV4KSkgewogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBNZ210LT5zTm9kZURCVGFibGVbdU5vZGVJbmRleF0uYlBTRW5hYmxlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2tiX3F1ZXVlX3RhaWwoJnBNZ210LT5zTm9kZURCVGFibGVbdU5vZGVJbmRleF0uc1R4UFNRdWV1ZSwgc2tiKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlW3VOb2RlSW5kZXhdLndFblF1ZXVlQ250Kys7CkBAIC0xNzYzLDcgKzE3NjYsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNZ210LT5hYnlQU1R4TWFwW3dBSUQgPj4gM10gfD0gIGJ5TWFza1t3QUlEICYgN107CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRELT5wVERJbmZvLT5ieUZsYWdzICY9IH4oVERfRkxBR1NfTkVUSUZfU0tCKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPICJ0eF9zcnY6dHggZmFpbCByZS1xdWV1ZSBzdGEgaW5kZXg9ICVkLCBRdWVDbnQ9ICVkXG4iCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAsKElOVCl1Tm9kZUluZGV4LCBwTWdtdC0+c05vZGVEQlRhYmxlW3VOb2RlSW5kZXhdLndFblF1ZXVlQ250KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICwoaW50KXVOb2RlSW5kZXgsIHBNZ210LT5zTm9kZURCVGFibGVbdU5vZGVJbmRleF0ud0VuUXVldWVDbnQpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTdGF0cy0+dHhfZXJyb3JzLS07CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YXRzLT50eF9kcm9wcGVkLS07CiAgICAgICAgICAgICAgICAgICAgICAgICB9CkBAIC0xNzgwLDEwICsxNzgzLDEwIEBACiAgICAgICAgIC8vIFJFU0VSVl9BQzBETUEgcmVzZXJ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ERldmljZS0+YndleHRzdGVwMiA9IEZBTFNFOwotICAgICBwRGV2aWNlLT5id2V4dHN0ZXAzID0gRkFMU0U7CisgICAgIHBEZXZpY2UtPmJ3ZXh0c3RlcDAgPSBmYWxzZTsKKyAgICAgcERldmljZS0+YndleHRzdGVwMSA9IGZhbHNlOworICAgICBwRGV2aWNlLT5id2V4dHN0ZXAyID0gZmFsc2U7CisgICAgIHBEZXZpY2UtPmJ3ZXh0c3RlcDMgPSBmYWxzZTsKICAgICAgKi8KICAgICAgICBwRGV2aWNlLT5id2V4dGNvdW50PTA7Ci0gICAgIHBEZXZpY2UtPmJXUEFTdXBwV2V4dEVuYWJsZWQgPSBGQUxTRTsKKyAgICAgcERldmljZS0+YldQQVN1cHBXZXh0RW5hYmxlZCA9IGZhbHNlOwogI2VuZGlmCiAgICAgcERldmljZS0+YnlSZUFzc29jQ291bnQgPSAwOwotICAgcERldmljZS0+YldQQURFVlVwID0gRkFMU0U7CisgICBwRGV2aWNlLT5iV1BBREVWVXAgPSBmYWxzZTsKICAgICAvLyBQYXRjaDogaWYgV0VQIGtleSBhbHJlYWR5IHNldCBieSBpd2NvbmZpZyBidXQgZGV2aWNlIG5vdCB5ZXQgb3BlbgotICAgIGlmICgocERldmljZS0+YkVuY3J5cHRpb25FbmFibGUgPT0gVFJVRSkgJiYgKHBEZXZpY2UtPmJUcmFuc21pdEtleSA9PSBUUlVFKSkgeworICAgIGlmICgocERldmljZS0+YkVuY3J5cHRpb25FbmFibGUgPT0gdHJ1ZSkgJiYgKHBEZXZpY2UtPmJUcmFuc21pdEtleSA9PSB0cnVlKSkgewogICAgICAgICBLZXliU2V0RGVmYXVsdEtleSgmKHBEZXZpY2UtPnNLZXkpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIChEV09SRCkocERldmljZS0+YnlLZXlJbmRleCB8ICgxIDw8IDMxKSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHVuc2lnbmVkIGxvbmcpKHBEZXZpY2UtPmJ5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9IDA7CisgICAgdW5zaWduZWQgY2hhciAqcGJNUERVOworICAgIHVuc2lnbmVkIGludCBjYk1QRFVMZW4gPSAwOwogCiAKICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPICJkZXZpY2VfZG1hMF90eF84MDIxMVxuIik7CkBAIC0yMDk2LDcgKzIwOTksNyBAQAogICAgICAgICByZXR1cm4gMDsKICAgICB9CiAKLSAgICBpZiAocERldmljZS0+YlN0b3BUeDBQa3QgPT0gVFJVRSkgeworICAgIGlmIChwRGV2aWNlLT5iU3RvcFR4MFBrdCA9PSB0cnVlKSB7CiAgICAgICAgIGRldl9rZnJlZV9za2JfaXJxKHNrYik7CiAgICAgICAgIHNwaW5fdW5sb2NrX2lycSgmcERldmljZS0+bG9jayk7CiAgICAgICAgIHJldHVybiAwOwpAQCAtMjExNSwzNiArMjExOCwzNiBAQAogCiAKIAotQk9PTCBkZXZpY2VfZG1hMF94bWl0KFBTRGV2aWNlIHBEZXZpY2UsIHN0cnVjdCBza19idWZmICpza2IsIFVJTlQgdU5vZGVJbmRleCkgeworYm9vbCBkZXZpY2VfZG1hMF94bWl0KFBTRGV2aWNlIHBEZXZpY2UsIHN0cnVjdCBza19idWZmICpza2IsIHVuc2lnbmVkIGludCB1Tm9kZUluZGV4KSB7CiAgICAgUFNNZ210T2JqZWN0ICAgIHBNZ210ID0gcERldmljZS0+cE1nbXQ7CiAgICAgUFNUeERlc2MgICAgICAgIHBIZWFkVEQsIHBMYXN0VEQ7Ci0gICAgVUlOVCAgICAgICAgICAgIGNiRnJhbWVCb2R5U2l6ZTsKLSAgICBVSU5UICAgICAgICAgICAgdU1BQ2ZyYWdOdW07Ci0gICAgQllURSAgICAgICAgICAgIGJ5UGt0VHlwZTsKLSAgICBCT09MICAgICAgICAgICAgYk5lZWRFbmNyeXB0aW9uID0gRkFMU0U7CisgICAgdW5zaWduZWQgaW50IGNiRnJhbWVCb2R5U2l6ZTsKKyAgICB1bnNpZ25lZCBpbnQgdU1BQ2ZyYWdOdW07CisgICAgdW5zaWduZWQgY2hhciBieVBrdFR5cGU7CisgICAgYm9vbCBiTmVlZEVuY3J5cHRpb24gPSBmYWxzZTsKICAgICBQU0tleUl0ZW0gICAgICAgcFRyYW5zbWl0S2V5ID0gTlVMTDsKLSAgICBVSU5UICAgICAgICAgICAgY2JIZWFkZXJTaXplOwotICAgIFVJTlQgICAgICAgICAgICBpaTsKKyAgICB1bnNpZ25lZCBpbnQgY2JIZWFkZXJTaXplOworICAgIHVuc2lnbmVkIGludCBpaTsKICAgICBTS2V5SXRlbSAgICAgICAgU1RlbXBLZXk7Ci0vLyAgICBCWVRFICAgICAgICAgICAgYnlLZXlJbmRleCA9IDA7CisvLyAgICB1bnNpZ25lZCBjaGFyIGJ5S2V5SW5kZXggPSAwOwogCiAKLSAgICBpZiAocERldmljZS0+YlN0b3BUeDBQa3QgPT0gVFJVRSkgeworICAgIGlmIChwRGV2aWNlLT5iU3RvcFR4MFBrdCA9PSB0cnVlKSB7CiAgICAgICAgIGRldl9rZnJlZV9za2JfaXJxKHNrYik7Ci0gICAgICAgIHJldHVybiBGQUxTRTsKKyAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgIH07CiAKICAgICBpZiAoQVZBSUxfVEQocERldmljZSwgVFlQRV9UWERNQTApIDw9IDApIHsKICAgICAgICAgZGV2X2tmcmVlX3NrYl9pcnEoc2tiKTsKICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyAiZGV2aWNlX2RtYTBfeG1pdCwgdGQwIDw9MFxuIik7Ci0gICAgICAgIHJldHVybiBGQUxTRTsKKyAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgIH0KIAogICAgIGlmIChwTWdtdC0+ZUN1cnJNb2RlID09IFdNQUNfTU9ERV9FU1NfQVApIHsKICAgICAgICAgaWYgKHBEZXZpY2UtPnVBc3NvY0NvdW50ID09IDApIHsKICAgICAgICAgICAgIGRldl9rZnJlZV9za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lID49IFJBVEVfMTFNKSB7CiAgICAgICAgICAgICAgICAgcERldmljZS0+d0N1cnJlbnRSYXRlID0gUkFURV8xMU07CiAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHBEZXZpY2UtPndDdXJyZW50UmF0ZSA9IChXT1JEKXBEZXZpY2UtPnVDb25uZWN0aW9uUmF0ZTsKKyAgICAgICAgICAgICAgICBwRGV2aWNlLT53Q3VycmVudFJhdGUgPSAodW5zaWduZWQgc2hvcnQpcERldmljZS0+dUNvbm5lY3Rpb25SYXRlOwogICAgICAgICAgICAgfQogICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgaWYgKHBEZXZpY2UtPnVDb25uZWN0aW9uUmF0ZSA+PSBSQVRFXzU0TSkKICAgICAgICAgICAgICAgICBwRGV2aWNlLT53Q3VycmVudFJhdGUgPSBSQVRFXzU0TTsKICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICBwRGV2aWNlLT53Q3VycmVudFJhdGUgPSAoV09SRClwRGV2aWNlLT51Q29ubmVjdGlvblJhdGU7CisgICAgICAgICAgICAgICAgcERldmljZS0+d0N1cnJlbnRSYXRlID0gKHVuc2lnbmVkIHNob3J0KXBEZXZpY2UtPnVDb25uZWN0aW9uUmF0ZTsKICAgICAgICAgfQogICAgIH0KICAgICBlbHNlIHsKQEAgLTIyMDIsMTUgKzIyMDUsMTUgQEAKICAgICB9IGVsc2UgaWYgKHBEZXZpY2UtPmVDdXJyZW50UEhZVHlwZSA9PSBQSFlfVFlQRV8xMUEpIHsKICAgICAgICAgYnlQa3RUeXBlID0gUEtfVFlQRV8xMUE7CiAgICAgfSBlbHNlIHsKLSAgICAgICAgaWYgKHBEZXZpY2UtPmJQcm90ZWN0TW9kZSA9PSBUUlVFKSB7CisgICAgICAgIGlmIChwRGV2aWNlLT5iUHJvdGVjdE1vZGUgPT0gdHJ1ZSkgewogICAgICAgICAgICAgYnlQa3RUeXBlID0gUEtfVFlQRV8xMUdCOwogICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgYnlQa3RUeXBlID0gUEtfVFlQRV8xMUdBOwogICAgICAgICB9CiAgICAgfQogCi0gICAgaWYgKHBEZXZpY2UtPmJFbmNyeXB0aW9uRW5hYmxlID09IFRSVUUpCi0gICAgICAgIGJOZWVkRW5jcnlwdGlvbiA9IFRSVUU7CisgICAgaWYgKHBEZXZpY2UtPmJFbmNyeXB0aW9uRW5hYmxlID09IHRydWUpCisgICAgICAgIGJOZWVkRW5jcnlwdGlvbiA9IHRydWU7CiAKICAgICBpZiAocERldmljZS0+YkVuYWJsZUhvc3RXRVApIHsKICAgICAgICAgcFRyYW5zbWl0S2V5ID0gJlNUZW1wS2V5OwpAQCAtMjIyNiw3ICsyMjI5LDcgQEAKICAgICB9CiAgICAgdkdlbmVyYXRlRklGT0hlYWRlcihwRGV2aWNlLCBieVBrdFR5cGUsIHBEZXZpY2UtPnBieVRtcEJ1ZmYsIGJOZWVkRW5jcnlwdGlvbiwKICAgICAgICAgICAgICAgICAgICAgICAgIGNiRnJhbWVCb2R5U2l6ZSwgVFlQRV9UWERNQTAsIHBIZWFkVEQsCi0gICAgICAgICAgICAgICAgICAgICAgICAmcERldmljZS0+c1R4RXRoSGVhZGVyLCAoUEJZVEUpc2tiLT5kYXRhLCBwVHJhbnNtaXRLZXksIHVOb2RlSW5kZXgsCisgICAgICAgICAgICAgICAgICAgICAgICAmcERldmljZS0+c1R4RXRoSGVhZGVyLCAodW5zaWduZWQgY2hhciAqKXNrYi0+ZGF0YSwgcFRyYW5zbWl0S2V5LCB1Tm9kZUluZGV4LAogICAgICAgICAgICAgICAgICAgICAgICAgJnVNQUNmcmFnTnVtLAogICAgICAgICAgICAgICAgICAgICAgICAgJmNiSGVhZGVyU2l6ZQogICAgICAgICAgICAgICAgICAgICAgICAgKTsKQEAgLTIyMzYsNyArMjIzOSw3IEBACiAgICAgICAgIE1BQ2JQU1dha2V1cChwRGV2aWNlLT5Qb3J0T2Zmc2V0KTsKIC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1bnNpZ25lZCBpbnQgdU1BQ2ZyYWdOdW0gPSAxOworICAgIHVuc2lnbmVkIGludCBjYkZyYW1lQm9keVNpemU7CisgICAgdW5zaWduZWQgY2hhciBieVBrdFR5cGU7CisgICAgdW5zaWduZWQgaW50IGNiSGVhZGVyU2l6ZTsKKyAgICBib29sIGJOZWVkRW5jcnlwdGlvbiA9IGZhbHNlOwogICAgIFBTS2V5SXRlbSAgICAgICBwVHJhbnNtaXRLZXkgPSBOVUxMOwogICAgIFNLZXlJdGVtICAgICAgICBTVGVtcEtleTsKLSAgICBVSU5UICAgICAgICAgICAgaWk7Ci0gICAgQk9PTCAgICAgICAgICAgIGJUS0lQX1VzZUdUSyA9IEZBTFNFOwotICAgIEJPT0wgICAgICAgICAgICBiTmVlZERlQXV0aCA9IEZBTFNFOwotICAgIFBCWVRFICAgICAgICAgICBwYnlCU1NJRDsKLSAgICBCT09MICAgICAgICAgICAgYk5vZGVFeGlzdCA9IEZBTFNFOworICAgIHVuc2lnbmVkIGludCBpaTsKKyAgICBib29sIGJUS0lQX1VzZUdUSyA9IGZhbHNlOworICAgIGJvb2wgYk5lZWREZUF1dGggPSBmYWxzZTsKKyAgICB1bnNpZ25lZCBjaGFyICpwYnlCU1NJRDsKKyAgICBib29sIGJOb2RlRXhpc3QgPSBmYWxzZTsKIAogCiAKICAgICBzcGluX2xvY2tfaXJxKCZwRGV2aWNlLT5sb2NrKTsKLSAgICBpZiAocERldmljZS0+YkxpbmtQYXNzID09IEZBTFNFKSB7CisgICAgaWYgKHBEZXZpY2UtPmJMaW5rUGFzcyA9PSBmYWxzZSkgewogICAgICAgICBkZXZfa2ZyZWVfc2tiX2lycShza2IpOwogICAgICAgICBzcGluX3VubG9ja19pcnEoJnBEZXZpY2UtPmxvY2spOwogICAgICAgICByZXR1cm4gMDsKQEAgLTIzMDcsOSArMjMxMCw5IEBACiAgICAgICAgICAgICBzcGluX3VubG9ja19pcnEoJnBEZXZpY2UtPmxvY2spOwogICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgIH0KLSAgICAgICAgaWYgKElTX01VTFRJQ0FTVF9BRERSRVNTKChQQllURSkoc2tiLT5kYXRhKSkpIHsKKyAgICAgICAgaWYgKGlzX211bHRpY2FzdF9ldGhlcl9hZGRyKCh1bnNpZ25lZCBjaGFyICopKHNrYi0+ZGF0YSkpKSB7CiAgICAgICAgICAgICB1Tm9kZUluZGV4ID0gMDsKLSAgICAgICAgICAgIGJOb2RlRXhpc3QgPSBUUlVFOworICAgICAgICAgICAgYk5vZGVFeGlzdCA9IHRydWU7CiAgICAgICAgICAgICBpZiAocE1nbXQtPnNOb2RlREJUYWJsZVswXS5iUFNFbmFibGUpIHsKICAgICAgICAgICAgICAgICBza2JfcXVldWVfdGFpbCgmKHBNZ210LT5zTm9kZURCVGFibGVbMF0uc1R4UFNRdWV1ZSksIHNrYik7CiAgICAgICAgICAgICAgICAgcE1nbXQtPnNOb2RlREJUYWJsZVswXS53RW5RdWV1ZUNudCsrOwpAQCAtMjMxOSw3ICsyMzIyLDcgQEAKICAgICAgICAgICAgICAgICByZXR1cm4gMDsKICAgICAgICAgICAgIH0KIH1lbHNlIHsKLSAgICAgICAgICAgIGlmIChCU1NEQmJJc1NUQUluTm9kZURCKHBNZ210LCAoUEJZVEUpKHNrYi0+ZGF0YSksICZ1Tm9kZUluZGV4KSkgeworICAgICAgICAgICAgaWYgKEJTU0RCYklzU1RBSW5Ob2RlREIocE1nbXQsICh1bnNpZ25lZCBjaGFyICopKHNrYi0+ZGF0YSksICZ1Tm9kZUluZGV4KSkgewogICAgICAgICAgICAgICAgIGlmIChwTWdtdC0+c05vZGVEQlRhYmxlW3VOb2RlSW5kZXhdLmJQU0VuYWJsZSkgewogICAgICAgICAgICAgICAgICAgICBza2JfcXVldWVfdGFpbCgmcE1nbXQtPnNOb2RlREJUYWJsZVt1Tm9kZUluZGV4XS5zVHhQU1F1ZXVlLCBza2IpOwogICAgICAgICAgICAgICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlW3VOb2RlSW5kZXhdLndFblF1ZXVlQ250Kys7CkBAIC0yMzM4LDEyICsyMzQxLDEyIEBACiAgICAgICAgICAgICAgICAgfWVsc2UgewogICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT5ieVByZWFtYmxlVHlwZSA9IFBSRUFNQkxFX0xPTkc7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJOb2RlRXhpc3QgPSBUUlVFOworICAgICAgICAgICAgICAgIGJOb2RlRXhpc3QgPSB0cnVlOwogCiAgICAgICAgICAgICB9CiAgICAgICAgIH0KIAotICAgICAgICBpZiAoYk5vZGVFeGlzdCA9PSBGQUxTRSkgeworICAgICAgICBpZiAoYk5vZGVFeGlzdCA9PSBmYWxzZSkgewogICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fREVCVUciVW5rbm93biBTVEEgbm90IGZvdW5kIGluIG5vZGUgREIgXG4iKTsKICAgICAgICAgICAgIGRldl9rZnJlZV9za2JfaXJxKHNrYik7CiAgICAgICAgICAgICBzcGluX3VubG9ja19pcnEoJnBEZXZpY2UtPmxvY2spOwpAQCAtMjM1Niw3ICsyMzU5LDcgQEAKICAgICBwSGVhZFRELT5tX3RkMVREMS5ieVRDUiA9IChUQ1JfRURQfFRDUl9TVFApOwogCiAKLSAgICBtZW1jcHkocERldmljZS0+c1R4RXRoSGVhZGVyLmFieURzdEFkZHIsIChQQllURSkoc2tiLT5kYXRhKSwgRVRIX0hMRU4pOworICAgIG1lbWNweShwRGV2aWNlLT5zVHhFdGhIZWFkZXIuYWJ5RHN0QWRkciwgKHVuc2lnbmVkIGNoYXIgKikoc2tiLT5kYXRhKSwgRVRIX0hMRU4pOwogICAgIGNiRnJhbWVCb2R5U2l6ZSA9IHNrYi0+bGVuIC0gRVRIX0hMRU47CiAgICAgLy8gODAyLjFICiAgICAgaWYgKG50b2hzKHBEZXZpY2UtPnNUeEV0aEhlYWRlci53VHlwZSkgP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VFJVRSkgewotICAgICAgICAgICAgICAgICAgICAgICAgYlRLSVBfVXNlR1RLID0gVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgaWYoS2V5YkdldFRyYW5zbWl0S2V5KCYocERldmljZS0+c0tleSksIHBieUJTU0lELCBHUk9VUF9LRVksICZwVHJhbnNtaXRLZXkpID09IHRydWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJUS0lQX1VzZUdUSyA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9ERUJVRyJHZXQgR1RLLlxuIik7CiAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgfQpAQCAtMjM5MiwxMiArMjM5NSwxMiBAQAogICAgICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0RFQlVHIlxuIik7CiAKICAgICAgICAgICAgICAgICAvLyBnZXQgcGFpcndpc2Uga2V5Ci0gICAgICAgICAgICAgICAgaWYoS2V5YkdldFRyYW5zbWl0S2V5KCYocERldmljZS0+c0tleSksIHBieUJTU0lELCBQQUlSV0lTRV9LRVksICZwVHJhbnNtaXRLZXkpID09IFRSVUUpCisgICAgICAgICAgICAgICAgaWYoS2V5YkdldFRyYW5zbWl0S2V5KCYocERldmljZS0+c0tleSksIHBieUJTU0lELCBQQUlSV0lTRV9LRVksICZwVHJhbnNtaXRLZXkpID09IHRydWUpCiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgLy8gZ2V0IGdyb3VwIGtleQogICAgICAgICAgICAgcGJ5QlNTSUQgPSBwRGV2aWNlLT5hYnlCcm9hZGNhc3RBZGRyOwotICAgICAgICAgICAgaWYoS2V5YkdldFRyYW5zbWl0S2V5KCYocERldmljZS0+c0tleSksIHBieUJTU0lELCBHUk9VUF9LRVksICZwVHJhbnNtaXRLZXkpID09IEZBTFNFKSB7CisgICAgICAgICAgICBpZihLZXliR2V0VHJhbnNtaXRLZXkoJihwRGV2aWNlLT5zS2V5KSwgcGJ5QlNTSUQsIEdST1VQX0tFWSwgJnBUcmFuc21pdEtleSkgPT0gZmFsc2UpIHsKICAgICAgICAgICAgICAgICBwVHJhbnNtaXRLZXkgPSBOVUxMOwogICAgICAgICAgICAgICAgIGlmIChwRGV2aWNlLT5wTWdtdC0+ZUN1cnJNb2RlID09IFdNQUNfTU9ERV9JQlNTX1NUQSkgewogICAgICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9ERUJVRyJJQlNTIGFuZCBLRVkgaXMgTlVMTC4gWyVkXVxuIiwgcERldmljZS0+cE1nbXQtPmVDdXJyTW9kZSk7CkBAIC0yNDA1LDE1ICsyNDA4LDE1IEBACiAgICAgICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9ERUJVRyJOT1QgSUJTUyBhbmQgS0VZIGlzIE5VTEwuIFslZF1cbiIsIHBEZXZpY2UtPnBNZ210LT5lQ3Vyck1vZGUpOwogICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBiVEtJUF9Vc2VHVEsgPSBUUlVFOworICAgICAgICAgICAgICAgIGJUS0lQX1VzZUdUSyA9IHRydWU7CiAgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fREVCVUciR2V0IEdUSy5cbiIpOwogICAgICAgICAgICAgfQotICAgICAgICB9IHdoaWxlKEZBTFNFKTsKKyAgICAgICAgfSB3aGlsZShmYWxzZSk7CiAgICAgfQogCiAgICAgaWYgKHBEZXZpY2UtPmJFbmFibGVIb3N0V0VQKSB7CiAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0RFQlVHImFjZG1hMDogU1RBIGluZGV4ICVkXG4iLCB1Tm9kZUluZGV4KTsKLSAgICAgICAgaWYgKHBEZXZpY2UtPmJFbmNyeXB0aW9uRW5hYmxlID09IFRSVUUpIHsKKyAgICAgICAgaWYgKHBEZXZpY2UtPmJFbmNyeXB0aW9uRW5hYmxlID09IHRydWUpIHsKICAgICAgICAgICAgIHBUcmFuc21pdEtleSA9ICZTVGVtcEtleTsKICAgICAgICAgICAgIHBUcmFuc21pdEtleS0+YnlDaXBoZXJTdWl0ZSA9IHBNZ210LT5zTm9kZURCVGFibGVbdU5vZGVJbmRleF0uYnlDaXBoZXJTdWl0ZTsKICAgICAgICAgICAgIHBUcmFuc21pdEtleS0+ZHdLZXlJbmRleCA9IHBNZ210LT5zTm9kZURCVGFibGVbdU5vZGVJbmRleF0uZHdLZXlJbmRleDsKQEAgLTI0NDMsNyArMjQ0Niw3IEBACiAgICAgICAgIH0KICAgICB9CiAKLSAgICBieVBrdFR5cGUgPSAoQllURSlwRGV2aWNlLT5ieVBhY2tldFR5cGU7CisgICAgYnlQa3RUeXBlID0gKHVuc2lnbmVkIGNoYXIpcERldmljZS0+YnlQYWNrZXRUeXBlOwogCiAgICAgaWYgKHBEZXZpY2UtPmJGaXhSYXRlKSB7CiAjaWZkZWYJUExJQ0VfREVCVUcKQEAgLTI0NTQsNyArMjQ1Nyw3IEBACiAgICAgICAgICAgICBpZiAocERldmljZS0+dUNvbm5lY3Rpb25SYXRlID49IFJBVEVfMTFNKSB7CiAgICAgICAgICAgICAgICAgcERldmljZS0+d0N1cnJlbnRSYXRlID0gUkFURV8xMU07CiAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHBEZXZpY2UtPndDdXJyZW50UmF0ZSA9IChXT1JEKXBEZXZpY2UtPnVDb25uZWN0aW9uUmF0ZTsKKyAgICAgICAgICAgICAgICBwRGV2aWNlLT53Q3VycmVudFJhdGUgPSAodW5zaWduZWQgc2hvcnQpcERldmljZS0+dUNvbm5lY3Rpb25SYXRlOwogICAgICAgICAgICAgfQogICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgaWYgKChwRGV2aWNlLT5lQ3VycmVudFBIWVR5cGUgPT0gUEhZX1RZUEVfMTFBKSAmJgpAQCAtMjQ2NCwxMSArMjQ2NywxMSBAQAogICAgICAgICAgICAgICAgIGlmIChwRGV2aWNlLT51Q29ubmVjdGlvblJhdGUgPj0gUkFURV81NE0pCiAgICAgICAgICAgICAgICAgICAgIHBEZXZpY2UtPndDdXJyZW50UmF0ZSA9IFJBVEVfNTRNOwogICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgcERldmljZS0+d0N1cnJlbnRSYXRlID0gKFdPUkQpcERldmljZS0+dUNvbm5lY3Rpb25SYXRlOworICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT53Q3VycmVudFJhdGUgPSAodW5zaWduZWQgc2hvcnQpcERldmljZS0+dUNvbm5lY3Rpb25SYXRlOwogCiAgICAgICAgICAgICB9CiAgICAgICAgIH0KLSAgICAgICAgcERldmljZS0+YnlBQ0tSYXRlID0gKEJZVEUpIHBEZXZpY2UtPndDdXJyZW50UmF0ZTsKKyAgICAgICAgcERldmljZS0+YnlBQ0tSYXRlID0gKHVuc2lnbmVkIGNoYXIpIHBEZXZpY2UtPndDdXJyZW50UmF0ZTsKICAgICAgICAgcERldmljZS0+YnlUb3BDQ0tCYXNpY1JhdGUgPSBSQVRFXzFNOwogICAgICAgICBwRGV2aWNlLT5ieVRvcE9GRE1CYXNpY1JhdGUgPSBSQVRFXzZNOwogICAgIH0KQEAgLTI1MjEsNyArMjUyNCw3IEBACiAgICAgfSBlbHNlIGlmIChwRGV2aWNlLT5lQ3VycmVudFBIWVR5cGUgPT0gUEhZX1RZUEVfMTFBKSB7CiAgICAgICAgIGJ5UGt0VHlwZSA9IFBLX1RZUEVfMTFBOwogICAgIH0gZWxzZSB7Ci0gICAgICAgIGlmIChwRGV2aWNlLT5iUHJvdGVjdE1vZGUgPT0gVFJVRSkgeworICAgICAgICBpZiA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TyJEb24ndCBGaW5kIFRYIEtFWVxuIik7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGVsc2UgewotICAgICAgICAgICAgICAgICAgICBpZiAoYlRLSVBfVXNlR1RLID09IFRSVUUpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGJUS0lQX1VzZUdUSyA9PSB0cnVlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPImVycm9yOiBLRVkgaXMgR1RLISF+flxuIik7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPIkZpbmQgUFRLIFslbFhdXG4iLCBwVHJhbnNtaXRLZXktPmR3S2V5SW5kZXgpOwotICAgICAgICAgICAgICAgICAgICAgICAgYk5lZWRFbmNyeXB0aW9uID0gVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJOZWVkRW5jcnlwdGlvbiA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIGlmIChwRGV2aWNlLT5ieUNudE1lYXN1cmUgPT0gMikgewotICAgICAgICAgICAgICAgIGJOZWVkRGVBdXRoID0gVFJVRTsKKyAgICAgICAgICAgICAgICBiTmVlZERlQXV0aCA9IHRydWU7CiAgICAgICAgICAgICAgICAgcERldmljZS0+czgwMl8xMUNvdW50ZXIuVEtJUENvdW50ZXJNZWFzdXJlc0ludm9rZWQrKzsKICAgICAgICAgICAgIH0KIApAQCAtMjU2MSw3ICsyNTY0LDcgQEAKICAgICAgICAgICAgICAgICBpZiAoKHVOb2RlSW5kZXggIT0gMCkgJiYKICAgICAgICAgICAgICAgICAgICAgKHBNZ210LT5zTm9kZURCVGFibGVbdU5vZGVJbmRleF0uZHdLZXlJbmRleCAmIFBBSVJXSVNFX0tFWSkpIHsKICAgICAgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyJGaW5kIFBUSyBbJWxYXVxuIiwgcFRyYW5zbWl0S2V5LT5kd0tleUluZGV4KTsKLSAgICAgICAgICAgICAgICAgICAgYk5lZWRFbmNyeXB0aW9uID0gVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgYk5lZWRFbmNyeXB0aW9uID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIH0KICAgICAgICAgfQpAQCAtMjU4NCw3ICsyNTg3LDcgQEAKICNlbmRpZgogICAgIHZHZW5lcmF0ZUZJRk9IZWFkZXIocERldmljZSwgYnlQa3RUeXBlLCBwRGV2aWNlLT5wYnlUbXBCdWZmLCBiTmVlZEVuY3J5cHRpb24sCiAgICAgICAgICAgICAgICAgICAgICAgICBjYkZyYW1lQm9keVNpemUsIFRZUEVfQUMwRE1BLCBwSGVhZFRELAotICAgICAgICAgICAgICAgICAgICAgICAgJnBEZXZpY2UtPnNUeEV0aEhlYWRlciwgKFBCWVRFKXNrYi0+ZGF0YSwgcFRyYW5zbWl0S2V5LCB1Tm9kZUluZGV4LAorICAgICAgICAgICAgICAgICAgICAgICAgJnBEZXZpY2UtPnNUeEV0aEhlYWRlciwgKHVuc2lnbmVkIGNoYXIgKilza2ItPmRhdGEsIHBUcmFuc21pdEtleSwgdU5vZGVJbmRleCwKICAgICAgICAgICAgICAgICAgICAgICAgICZ1TUFDZnJhZ051bSwKICAgICAgICAgICAgICAgICAgICAgICAgICZjYkhlYWRlclNpemUKICAgICAgICAgICAgICAgICAgICAgICAgICk7CkBAIC0yNTkzLDcgKzI1OTYsNyBAQAogICAgICAgICAvLyBEaXNhYmxlIFBTCiAgICAgICAgIE1BQ2JQU1dha2V1cChwRGV2aWNlLT5Qb3J0T2Zmc2V0KTsKICAgICB9Ci0gICAgc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ICAgICAgICAgICBkbyB7CiAgICAgICAgICAgICAgICAgICAgIDsKLSAgICAgICAgICAgICAgICB9IHdoaWxlIChDQVJEYlN0YXJ0UXVpZXQocERldmljZSkgPT0gRkFMU0UpOworICAgICAgICAgICAgICAgIH0gd2hpbGUgKENBUkRiU3RhcnRRdWlldChwRGV2aWNlKSA9PSBmYWxzZSk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KIAogICAgICAgICBpZiAocERldmljZS0+ZHdJc3IgJiBJU1JfVEJUVCkgewotICAgICAgICAgICAgaWYgKHBEZXZpY2UtPmJFbmFibGVGaXJzdFF1aWV0ID09IFRSVUUpIHsKKyAgICAgICAgICAgIGlmIChwRGV2aWNlLT5iRW5hYmxlRmlyc3RRdWlldCA9PSB0cnVlKSB7CiAgICAgICAgICAgICAgICAgcERldmljZS0+YnlRdWlldFN0YXJ0Q291bnQtLTsKICAgICAgICAgICAgICAgICBpZiAocERldmljZS0+YnlRdWlldFN0YXJ0Q291bnQgPT0gMCkgewotICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT5iRW5hYmxlRmlyc3RRdWlldCA9IEZBTFNFOworICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT5iRW5hYmxlRmlyc3RRdWlldCA9IGZhbHNlOwogICAgICAgICAgICAgICAgICAgICBNQUN2U2VsZWN0UGFnZTEocERldmljZS0+UG9ydE9mZnNldCk7CiAgICAgICAgICAgICAgICAgICAgIE1BQ3ZSZWdCaXRzT24ocERldmljZS0+UG9ydE9mZnNldCwgTUFDX1JFR19NU1JDVEwsIChNU1JDVExfUVVJRVRUWENISyB8IE1TUkNUTF9RVUlFVEVOKSk7CiAgICAgICAgICAgICAgICAgICAgIE1BQ3ZTZWxlY3RQYWdlMChwRGV2aWNlLT5Qb3J0T2Zmc2V0KTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoKHBEZXZpY2UtPmJDaGFubmVsU3dpdGNoID09IFRSVUUpICYmCisgICAgICAgICAgICBpZiAoKHBEZXZpY2UtPmJDaGFubmVsU3dpdGNoID09IHRydWUpICYmCiAgICAgICAgICAgICAgICAgKHBEZXZpY2UtPmVPUE1vZGUgPT0gT1BfTU9ERV9JTkZSQVNUUlVDVFVSRSkpIHsKICAgICAgICAgICAgICAgICBwRGV2aWNlLT5ieUNoYW5uZWxTd2l0Y2hDb3VudC0tOwogICAgICAgICAgICAgICAgIGlmIChwRGV2aWNlLT5ieUNoYW5uZWxTd2l0Y2hDb3VudCA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJDaGFubmVsU3dpdGNoID0gRkFMU0U7Ci0gICAgICAgICAgICAgICAgICAgIENBUkRiU2V0Q2hhbm5lbChwRGV2aWNlLCBwRGV2aWNlLT5ieU5ld0NoYW5uZWwpOworICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT5iQ2hhbm5lbFN3aXRjaCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBzZXRfY2hhbm5lbChwRGV2aWNlLCBwRGV2aWNlLT5ieU5ld0NoYW5uZWwpOwogICAgICAgICAgICAgICAgICAgICBWTlRXSUZJYkNoYW5uZWxTd2l0Y2gocERldmljZS0+cE1nbXQsIHBEZXZpY2UtPmJ5TmV3Q2hhbm5lbCk7CiAgICAgICAgICAgICAgICAgICAgIE1BQ3ZTZWxlY3RQYWdlMShwRGV2aWNlLT5Qb3J0T2Zmc2V0KTsKICAgICAgICAgICAgICAgICAgICAgTUFDdlJlZ0JpdHNPbihwRGV2aWNlLT5Qb3J0T2Zmc2V0LCBNQUNfUkVHX01TUkNUTCsxLCBNU1JDVEwxX1RYUEFVU0UpOwpAQCAtMjgyNywxMiArMjgzMCwxMiBAQAogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGlmIChwRGV2aWNlLT5lT1BNb2RlID09IE9QX01PREVfQURIT0MpIHsKLSAgICAgICAgICAgICAgICAvL3BEZXZpY2UtPmJCZWFjb25TZW50ID0gRkFMU0U7CisgICAgICAgICAgICAgICAgLy9wRGV2aWNlLT5iQmVhY29uU2VudCA9IGZhbHNlOwogICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBpZiAoKHBEZXZpY2UtPmJVcGRhdGVCQlZHQSkgJiYgKHBEZXZpY2UtPmJMaW5rUGFzcyA9PSBUUlVFKSAmJiAocERldmljZS0+dUN1cnJSU1NJICE9IDApKSB7Ci0gICAgICAgICAgICAgICAgICAgIExPTkcgICAgICAgICAgICBsZEJtOworICAgICAgICAgICAgICAgIGlmICgocERldmljZS0+YlVwZGF0ZUJCVkdBKSAmJiAocERldmljZS0+YkxpbmtQYXNzID09IHRydWUpICYmIChwRGV2aWNlLT51Q3VyclJTU0kgIT0gMCkpIHsKKyAgICAgICAgICAgICAgICAgICAgbG9uZyAgICAgICAgICAgIGxkQm07CiAKLSAgICAgICAgICAgICAgICAgICAgUkZ2UlNTSVRvZEJtKHBEZXZpY2UsIChCWVRFKSBwRGV2aWNlLT51Q3VyclJTU0ksICZsZEJtKTsKKyAgICAgICAgICAgICAgICAgICAgUkZ2UlNTSVRvZEJtKHBEZXZpY2UsICh1bnNpZ25lZCBjaGFyKSBwRGV2aWNlLT51Q3VyclJTU0ksICZsZEJtKTsKICAgICAgICAgICAgICAgICAgICAgZm9yIChpaT0wO2lpPEJCX1ZHQV9MRVZFTDtpaSsrKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobGRCbSA8IHBEZXZpY2UtPmxkQm1UaHJlc2hvbGRbaWldKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERldmljZS0+YnlCQlZHQU5ldyA9IHBEZXZpY2UtPmFieUJCVkdBW2lpXTsKQEAgLTI4NTgsNyArMjg2MSw3IEBACiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogCi0gICAgICAgICAgICBwRGV2aWNlLT5iQmVhY29uU2VudCA9IEZBTFNFOworICAgICAgICAgICAgcERldmljZS0+YkJlYWNvblNlbnQgPSBmYWxzZTsKICAgICAgICAgICAgIGlmIChwRGV2aWNlLT5iRW5hYmxlUFNNb2RlKSB7CiAgICAgICAgICAgICAgICAgUFNiSXNOZXh0VEJUVFdha2VVcCgodm9pZCAqKXBEZXZpY2UpOwogICAgICAgICAgICAgfTsKQEAgLTI4NzksMzEgKzI4ODIsMzEgQEAKICAgICAgICAgaWYgKHBEZXZpY2UtPmR3SXNyICYgSVNSX0JOVFgpIHsKIAogICAgICAgICAgICAgaWYgKHBEZXZpY2UtPmVPUE1vZGUgPT0gT1BfTU9ERV9BREhPQykgewotICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJJc0JlYWNvbkJ1ZlJlYWR5U2V0ID0gRkFMU0U7CisgICAgICAgICAgICAgICAgcERldmljZS0+YklzQmVhY29uQnVmUmVhZHlTZXQgPSBmYWxzZTsKICAgICAgICAgICAgICAgICBwRGV2aWNlLT5jYkJlYWNvbkJ1ZlJlYWR5U2V0Q250ID0gMDsKICAgICAgICAgICAgIH07CiAKICAgICAgICAgICAgIGlmIChwRGV2aWNlLT5lT1BNb2RlID09IE9QX01PREVfQVApIHsKICAgICAgICAgICAgICAgICBpZihwTWdtdC0+YnlEVElNQ291bnQgPiAwKSB7CiAgICAgICAgICAgICAgICAgICAgcE1nbXQtPmJ5RFRJTUNvdW50IC0tOwotICAgICAgICAgICAgICAgICAgIHBNZ210LT5zTm9kZURCVGFibGVbMF0uYlJ4UFNQb2xsID0gRkFMU0U7CisgICAgICAgICAgICAgICAgICAgcE1nbXQtPnNOb2RlREJUYWJsZVswXS5iUnhQU1BvbGwgPSBmYWxzZTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgIGlmKHBNZ210LT5ieURUSU1Db3VudCA9PSAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBjaGVjayBpZiBtdXRsdGNhc3QgdHggYnVmZmVycmluZwogICAgICAgICAgICAgICAgICAgICAgICAgcE1nbXQtPmJ5RFRJTUNvdW50ID0gcE1nbXQtPmJ5RFRJTVBlcmlvZCAtIDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlWzBdLmJSeFBTUG9sbCA9IFRSVUU7CisgICAgICAgICAgICAgICAgICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlWzBdLmJSeFBTUG9sbCA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgICAgICBiU2NoZWR1bGVDb21tYW5kKCh2b2lkICopcERldmljZSwgV0xBTl9DTURfUlhfUFNQT0xMLCBOVUxMKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHBEZXZpY2UtPmJCZWFjb25TZW50ID0gVFJVRTsKKyAgICAgICAgICAgIHBEZXZpY2UtPmJCZWFjb25TZW50ID0gdHJ1ZTsKIAotICAgICAgICAgICAgaWYgKHBEZXZpY2UtPmJDaGFubmVsU3dpdGNoID09IFRSVUUpIHsKKyAgICAgICAgICAgIGlmIChwRGV2aWNlLT5iQ2hhbm5lbFN3aXRjaCA9PSB0cnVlKSB7CiAgICAgICAgICAgICAgICAgcERldmljZS0+YnlDaGFubmVsU3dpdGNoQ291bnQtLTsKICAgICAgICAgICAgICAgICBpZiAocERldmljZS0+YnlDaGFubmVsU3dpdGNoQ291bnQgPT0gMCkgewotICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT5iQ2hhbm5lbFN3aXRjaCA9IEZBTFNFOwotICAgICAgICAgICAgICAgICAgICBDQVJEYlNldENoYW5uZWwocERldmljZSwgcERldmljZS0+YnlOZXdDaGFubmVsKTsKKyAgICAgICAgICAgICAgICAgICAgcERldmljZS0+YkNoYW5uZWxTd2l0Y2ggPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgc2V0X2NoYW5uZWwocERldmljZSwgcERldmljZS0+Yn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XgKKyAgICB1bnNpZ25lZCBpbnQgRnJhbWVTaXplLAorICAgIHVuc2lnbmVkIGludCBjYkhlYWRlck9mZnNldCwKKyAgICBpbnQgICAgICBpU0FOb2RlSW5kZXgsCisgICAgaW50ICAgICAgaURBTm9kZUluZGV4CiAgICAgKTsKIAogCi1zdGF0aWMgQk9PTCBzX2JIYW5kbGVSeEVuY3J5cHRpb24oCitzdGF0aWMgYm9vbCBzX2JIYW5kbGVSeEVuY3J5cHRpb24oCiAgICAgUFNEZXZpY2UgICAgIHBEZXZpY2UsCi0gICAgUEJZVEUgICAgICAgIHBieUZyYW1lLAotICAgIFVJTlQgICAgICAgICBGcmFtZVNpemUsCi0gICAgUEJZVEUgICAgICAgIHBieVJzciwKLSAgICBQQllURSAgICAgICBwYnlOZXdSc3IsCisgICAgdW5zaWduZWQgY2hhciAqcGJ5RnJhbWUsCisgICAgdW5zaWduZWQgaW50IEZyYW1lU2l6ZSwKKyAgICB1bnNpZ25lZCBjaGFyICpwYnlSc3IsCisgICAgdW5zaWduZWQgY2hhciAqcGJ5TmV3UnNyLAogICAgIFBTS2V5SXRlbSAgICpwS2V5T3V0LAotICAgIGludCAqICAgICAgIHBiRXh0SVYsCi0gICAgUFdPUkQgICAgICAgcHdSeFRTQzE1XzAsCi0gICAgUERXT1JEICAgICAgcGR3UnhUU0M0N18xNgorICAgIGJvb2wgKnBiRXh0SVYsCisgICAgdW5zaWduZWQgc2hvcnQgKnB3UnhUU0MxNV8wLAorICAgIHVuc2lnbmVkIGxvbmcgKnBkd1J4VFNDNDdfMTYKICAgICApOwogCi1zdGF0aWMgQk9PTCBzX2JIb3N0V2VwUnhFbmNyeXB0aW9uKAorc3RhdGljIGJvb2wgc19iSG9zdFdlcFJ4RW5jcnlwdGlvbigKIAogICAgIFBTRGV2aWNlICAgICBwRGV2aWNlLAotICAgIFBCWVRFICAgICAgICBwYnlGcmFtZSwKLSAgICBVSU5UICAgICAgICAgRnJhbWVTaXplLAotICAgIFBCWVRFICAg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l8xMUhlYWRlcjsKLSAgICBQQllURSAgICAgICAgICAgcGJ5UnNyOwotICAgIFBCWVRFICAgICAgICAgICBwYnlOZXdSc3I7Ci0gICAgUEJZVEUgICAgICAgICAgIHBieVJTU0k7CisgICAgdW5zaWduZWQgY2hhciAqcGJ5UnNyOworICAgIHVuc2lnbmVkIGNoYXIgKnBieU5ld1JzcjsKKyAgICB1bnNpZ25lZCBjaGFyICpwYnlSU1NJOwogICAgIFBRV09SRCAgICAgICAgICBwcXdUU0ZUaW1lOwotICAgIFBXT1JEICAgICAgICAgICBwd0ZyYW1lU2l6ZTsKLSAgICBQQllURSAgICAgICAgICAgcGJ5RnJhbWU7Ci0gICAgQk9PTCAgICAgICAgICAgIGJEZUZyYWdSeCA9IEZBTFNFOwotICAgIEJPT0wgICAgICAgICAgICBiSXNXRVAgPSBGQUxTRTsKLSAgICBVSU5UICAgICAgICAgICAgY2JIZWFkZXJPZmZzZXQ7Ci0gICAgVUlOVCAgICAgICAgICAgIEZyYW1lU2l6ZTsKLSAgICBXT1JEICAgICAgICAgICAgd0V0aGVyVHlwZSA9IDA7Ci0gICAgSU5UICAgICAgICAgICAgIGlTQU5vZGVJbmRleCA9IC0xOwotICAgIElOVCAgICAgICAgICAgICBpREFOb2RlSW5kZXggPSAtMTsKLSAgICBVSU5UICAgICAgICAgICAgaWk7Ci0gICAgVUlOVCAgICAgICAgICAgIGNiSVZPZmZzZXQ7Ci0gICAgQk9PTCAgICAgICAgICAgIGJFeHRJViA9IEZBTFNFOwotICAgIFBCWVRFICAgICAgICAgICBwYnlSeFN0czsKLSAgICBQQllURSAgICAgICAgICAgcGJ5UnhSYXRlOwotICAgIFBCWVRFICAgICAgICAgICBwYnlTUTsKLSAgICBVSU5UICAgICAgICAgICAgY2JIZWFkZXJTaXplOworICAgIHVuc2lnbmVkIHNob3J0ICpwd0ZyYW1lU2l6ZTsKKyAgICB1bnNpZ25lZCBjaGFyICpwYnlGcmFtZTsKKyAgICBib29sIGJEZUZyYWdSeCA9IGZhbHNlOworICAgIGJvb2wgYklzV0VQID0gZmFsc2U7CisgICAgdW5zaWduZWQgaW50IGNiSGVhZGVyT2Zmc2V0OworICAgIHVuc2lnbmVkIGludCBGcmFtZVNpemU7CisgICAgdW5zaWduZWQgc2hvcnQgd0V0aGVyVHlwZSA9IDA7CisgICAgaW50ICAgICAgICAgICAgIGlTQU5vZGVJbmRleCA9IC0xOworICAgIGludCAgICAgICAgICAgICBpREFOb2RlSW5kZXggPSAtMTsKKyAgICB1bnNpZ25lZCBpbnQgaWk7CisgICAgdW5zaWduZWQgaW50IGNiSVZPZmZzZXQ7CisgICAgYm9vbCBiRXh0SVYgPSBmYWxzZTsKKyAgICB1bnNpZ25lZCBjaGFyICpwYnlSeFN0czsKKyAgICB1bnNpZ25lZCBjaGFyICpwYnlSeFJhdGU7CisgICAgdW5zaWduZWQgY2hhciAqcGJ5U1E7CisgICAgdW5zaWduZWQgaW50IGNiSGVhZGVyU2l6ZTsKICAgICBQU0tleUl0ZW0gICAgICAgcEtleSA9IE5VTEw7Ci0gICAgV09SRCAgICAgICAgICAgIHdSeFRTQzE1XzAgPSAwOwotICAgIERXT1JEICAgICAgICAgICBkd1J4VFNDNDdfMTYgPSAwOworICAgIHVuc2lnbmVkIHNob3J0IHdSeFRTQzE1XzAgPSAwOworICAgIHVuc2lnbmVkIGxvbmcgZHdSeFRTQzQ3XzE2ID0gMDsKICAgICBTS2V5SXRlbSAgICAgICAgU1RlbXBLZXk7CiAgICAgLy8gODAyLjExaCBSUEkKLSAgICBEV09SRCAgICAgICAgICAgZHdEdXJhdGlvbiA9IDA7Ci0gICAgTE9ORyAgICAgICAgICAgIGxkQm0gPSAwOwotICAgIExPTkcgICAgICAgICAgICBsZEJtVGhyZXNob2xkID0gMDsKKyAgICB1bnNpZ25lZCBsb25nIGR3RHVyYXRpb24gPSAwOworICAgIGxvbmcgICAgICAgICAgICBsZEJtID0gMDsKKyAgICBsb25nICAgICAgICAgICAgbGRCbVRocmVzaG9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XTUFDX01PREVfSUJTU19TVEEpKSB7CiAgICAgICAgIGlmIChJU19DVExfUFNQT0xMKHBieUZyYW1lKSB8fCAhSVNfVFlQRV9DT05UUk9MKHBieUZyYW1lKSkgewogICAgICAgICAgICAgcDgwMl8xMUhlYWRlciA9IChQUzgwMl8xMUhlYWRlcikgKHBieUZyYW1lKTsKICAgICAgICAgICAgIC8vIGdldCBTQSBOb2RlSW5kZXgKLSAgICAgICAgICAgIGlmIChCU1NEQmJJc1NUQUluTm9kZURCKHBNZ210LCAoUEJZVEUpKHA4MDJfMTFIZWFkZXItPmFieUFkZHIyKSwgJmlTQU5vZGVJbmRleCkpIHsKKyAgICAgICAgICAgIGlmIChCU1NEQmJJc1NUQUluTm9kZURCKHBNZ210LCAodW5zaWduZWQgY2hhciAqKShwODAyXzExSGVhZGVyLT5hYnlBZGRyMiksICZpU0FOb2RlSW5kZXgpKSB7CiAgICAgICAgICAgICAgICAgcE1nbXQtPnNOb2RlREJUYWJsZVtpU0FOb2RlSW5kZXhdLnVsTGFzdFJ4SmlmZmVyID0gamlmZmllczsKICAgICAgICAgICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlW2lTQU5vZGVJbmRleF0udUluQWN0aXZlQ291bnQgPSAwOwogICAgICAgICAgICAgfQpAQCAtNDkwLDE3ICs0NzAsMTcgQEAKICAgICB9CiAKICAgICBpZiAocE1nbXQtPmVDdXJyTW9kZSA9PSBXTUFDX01PREVfRVNTX0FQKSB7Ci0gICAgICAgIGlmIChzX2JBUE1vZGVSeEN0bChwRGV2aWNlLCBwYnlGcmFtZSwgaVNBTm9kZUluZGV4KSA9PSBUUlVFKSB7Ci0gICAgICAgICAgICByZXR1cm4gRkFMU0U7CisgICAgICAgIGlmIChzX2JBUE1vZGVSeEN0bChwRGV2aWNlLCBwYnlGcmFtZSwgaVNBTm9kZUluZGV4KSA9PSB0cnVlKSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgIH0KICAgICB9CiAKIAogICAgIGlmIChJU19GQ19XRVAocGJ5RnJhbWUpKSB7Ci0gICAgICAgIEJPT0wgICAgIGJSeERlY3J5T0sgPSBGQUxTRTsKKyAgICAgICAgYm9vbCBiUnhEZWNyeU9LID0gZmFsc2U7CiAKICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyJyeCBXRVAgcGt0XG4iKTsKLSAgICAgICAgYklzV0VQID0gVFJVRTsKKyAgICAgICAgYklzV0VQID0gdHJ1ZTsKICAgICAgICAgaWYgKChwRGV2aWNlLT5iRW5hYmxlSG9zdFdFUCkgJiYgKGlTQU5vZGVJbmRleCA+PSAwKSkgewogICAgICAgICAgICAgcEtleSA9ICZTVGVtcEtleTsKICAgICAgICAgICAgIHBLZXktPmJ5Q2lwaGVyU3VpdGUgPSBwTWdtdC0+c05vZGVEQlRhYmxlW2lTQU5vZGVJbmRleF0uYnlDaXBoZXJTdWl0ZTsKQEAgLTU1MiwxMSArNTMyLDExIEBACiAvLyAgICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT5zODAyXzExQ291bnRlci5XRVBJQ1ZFcnJvckNvdW50LlF1YWRQYXJ0Kys7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgcmV0dXJuIEZBTFNFOworICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgIH0KICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8iV0VQIEZ1bmMgRmFpbFxuIik7Ci0gICAgICAgICAgICByZXR1cm4gRkFMU0U7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgIH0KICAgICAgICAgaWYgKChwS2V5ICE9IE5VTEwpICYmIChwS2V5LT5ieUNpcGhlclN1aXRlID09IEtFWV9DVExfQ0NNUCkpCiAgICAgICAgICAgICBGcmFtZVNpemUgLT0gODsgICAgICAgICAvLyBNZXNzYWdlIEludGVncml0eSBDb2RlCkBAIC01ODQsMTggKzU2NCwxOCBAQAogCiAgICAgICAgIH0KICAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgICByZXR1cm4gRkFMU0U7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgIH0KICAgICB9CiAKIAogLy8gTWFuYWdlbWVudCAmIENvbnRyb2wgZnJhbWUgSGFuZGxlCi0gICAgaWYgKChJU19UWVBFX0RBVEEoKHNrYi0+ZGF0YSs0KSkpID09IEZBTFNFKSB7CisgICAgaWYgKChJU19UWVBFX0RBVEEoKHNrYi0+ZGF0YSs0KSkpID09IGZhbHNlKSB7CiAgICAgICAgIC8vIEhhbmRsZSBDb250cm9sICYgTWFuYWdlIEZyYW1lCiAKICAgICAgICAgaWYgKElTX1RZUEVfTUdNVCgoc2tiLT5kYXRhKzQpKSkgewotICAgICAgICAgICAgUEJZVEUgcGJ5RGF0YTE7Ci0gICAgICAgICAgICBQQllURSBwYnlEYXRhMjsKKyAgICAgICAgICAgIHVuc2lnbmVkIGNoYXIgKnBieURhdGExOworICAgICAgICAgICAgdW5zaWduZWQgY2hhciAqcGJ5RGF0YTI7CiAKICAgICAgICAgICAgIHBSeFBhY2tldC0+cDgwMjExSGVhZGVyID0gKFBVV0xBTl84MDIxMUhEUikoc2tiLT5kYXRhKzQpOwogICAgICAgICAgICAgcFJ4UGFja2V0LT5jYk1QRFVMZW4gPSBGcmFtZVNpemU7CkBAIC02NDksMTMgKzYyOSwxMyBAQAogICAgIAkgICAgICAgIHNrYi0+cHJvdG9jb2wgPSBodG9ucyhFVEhfUF84MDJfMik7CiAJICAgICAgICAgICAgbWVtc2V0KHNrYi0+Y2IsIDAsIHNpemVvZihza2ItPmNiKSk7CiAJICAgICAgICAgICAgbmV0aWZfcngoc2tiKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gVFJVRTsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKIAkgICAgICAgIH0KICAgICAgICAgfQogICAgICAgICBlbHNlIHsKICAgICAgICAgICAgIC8vIENvbnRyb2wgRnJhbWUKICAgICAgICAgfTsKLSAgICAgICAgcmV0dXJuIEZBTFNFOworICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgfQogICAgIGVsc2UgewogICAgICAgICBpZiAocE1nbXQtPmVDdXJyTW9kZSA9PSBXTUFDX01PREVfRVNTX0FQKSB7CkBAIC02NjcsMTIgKzY0NywxMiBAQAogICAgICAgICAgICAgICAgICAgICAgICAgcERldmljZS0+ZGV2LT5uYW1lKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICByZXR1cm4gRkFMU0U7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgLy8gZGlzY2FyZCBEQVRBIHBhY2tldCB3aGlsZSBub3QgYXNzb2NpYXRlIHx8IEJTU0lEIGVycm9yCi0gICAgICAgICAgICBpZiAoKHBEZXZpY2UtPmJMaW5rUGFzcyA9PSBGQUxTRSkgfHwKKyAgICAgICAgICAgIGlmICgocERldmljZS0+YkxpbmtQYXNzID09IGZhbHNlKSB8fAogICAgICAgICAgICAgICAgICEoKnBieVJzciAmIFJTUl9CU1NJRE9LKSkgewogICAgICAgICAgICAgICAgIGlmIChiRGVGcmFnUngpIHsKICAgICAgICAgICAgICAgICAgICAgaWYgKCFkZXZpY2VfYWxsb2NfZnJhZ19idWYocERldmljZSwgJnBEZXZpY2UtPnNSeERGQ0JbcERldmljZS0+dUN1cnJlbnRERkNCSWR4XSkpIHsKQEAgLTY4MCwxMiArNjYwLDEyIEBACiAgICAgICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT5kZXYtPm5hbWUpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHJldHVybiBGQUxTRTsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgICB9CiAgICAvL21pa2UgYWRkOnN0YXRpb24gbW9kZSBjaGVjayBlYXBvbC1rZXkgY2hhbGxlbmdlLS0tPgogICAgCSAgewotICAgCSAgICBCWVRFICBQcm90b2NvbF9WZXJzaW9uOyAgICAvLzgwMi4xeCBBdXRoZW50aWNhdGlvbgotCSAgICBCWVRFICBQYWNrZXRfVHlwZTsgICAgICAgICAgIC8vODAyLjF4IEF1dGhlbnRpY2F0aW9uCisgICAJICAgIHVuc2lnbmVkIGNoYXIgUHJvdG9jb2xfVmVyc2lvbjsgICAgLy84MDIuMXggQXV0aGVudGljYXRpb24KKwkgICAgdW5zaWduZWQgY2hhciBQYWNrZXRfVHlwZTsgICAgICAgICAgIC8vODAyLjF4IEF1dGhlbnRpY2F0aW9uCiAgICAgICAgICAgICAgIGlmIChiSXNXRVApCiAgICAgICAgICAgICAgICAgICBjYklWT2Zmc2V0ID0gODsKICAgICAgICAgICAgICAgZWxzZQpAQCAtNjk3LDcgKzY3Nyw3IEBACiAJICAgICBpZiAod0V0aGVyVHlwZSA9PSBFVEhfUF9QQUUpIHsgICAgICAgICAvL1Byb3RvY29sIFR5cGUgaW4gTExDLUhlYWRlcgogICAgICAgICAgICAgICAgICAgaWYoKChQcm90b2NvbF9WZXJzaW9uPT0xKSB8fChQcm90b2NvbF9WZXJzaW9uPT0yKSkgJiYKIAkJICAgICAoUGFja2V0X1R5cGU9PTMpKSB7ICAvLzgwMi4xeCBPUiBlYXBvbC1rZXkgY2hhbGxlbmdlIGZyYW1lIHJlY2VpdmUKLSAgICAgICAgICAgICAgICAgICAgICAgIGJSeGVhcG9sX2tleSA9IFRSVUU7CisgICAgICAgICAgICAgICAgICAgICAgICBiUnhlYXBvbF9rZXkgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgfQogCSAgICAgIH0KICAgIAkgIH0KQEAgLTcxNiw4ICs2O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tdC0+ZUN1cnJNb2RlID09IFdNQUNfTU9ERV9FU1NfQVApICYmIChwRGV2aWNlLT5iRW5hYmxlODAyMXggPT0gVFJVRSkpewotICAgICAgICBCWVRFICAgIGFieU1hY0hkclsyNF07CisgICAgaWYgKChwTWdtdC0+ZUN1cnJNb2RlID09IFdNQUNfTU9ERV9FU1NfQVApICYmIChwRGV2aWNlLT5iRW5hYmxlODAyMXggPT0gdHJ1ZSkpeworICAgICAgICB1bnNpZ25lZCBjaGFyIGFieU1hY0hkclsyNF07CiAKICAgICAgICAgLy8gT25seSA4MDIuMXggcGFja2V0IGluY29taW5nIGFsbG93ZWQKICAgICAgICAgaWYgKGJJc1dFUCkKQEAgLTc2Nyw3ICs3NDcsNyBAQAogICAgICAgICBpZiAod0V0aGVyVHlwZSA9PSBFVEhfUF9QQUUpIHsKICAgICAgICAgICAgIHNrYi0+ZGV2ID0gcERldmljZS0+YXBkZXY7CiAKLSAgICAgICAgICAgIGlmIChiSXNXRVAgPT0gVFJVRSkgeworICAgICAgICAgICAgaWYgKGJJc1dFUCA9PSB0cnVlKSB7CiAgICAgICAgICAgICAgICAgLy8gc3RyaXAgSVYgaGVhZGVyKDgpCiAgICAgICAgICAgICAgICAgbWVtY3B5KCZhYnlNYWNIZHJbMF0sIChza2ItPmRhdGEgKyA0KSwgMjQpOwogICAgICAgICAgICAgICAgIG1lbWNweSgoc2tiLT5kYXRhICsgNCArIGNiSVZPZmZzZXQpLCAmYWJ5TWFjSGRyWzBdLCAyNCk7CkBAIC03ODEsMTIgKzc2MSwxMiBAQAogICAgICAgICAgICAgc2tiLT5wcm90b2NvbCA9IGh0b25zKEVUSF9QXzgwMl8yKTsKICAgICAgICAgICAgIG1lbXNldChza2ItPmNiLCAwLCBzaXplb2Yoc2tiLT5jYikpOwogICAgICAgICAgICAgbmV0aWZfcngoc2tiKTsKLSAgICAgICAgICAgIHJldHVybiBUUlVFOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAKIH0KICAgICAgICAgLy8gY2hlY2sgaWYgODAyLjF4IGF1dGhvcml6ZWQKICAgICAgICAgaWYgKCEocE1nbXQtPnNOb2RlREJUYWJsZVtpU0FOb2RlSW5kZXhdLmR3RmxhZ3MgJiBXTEFOX1NUQV9BVVRIT1JJWkVEKSkKLSAgICAgICAgICAgIHJldHVybiBGQUxTRTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICB9CiAKIApAQCAtODAwLDUzICs3ODAsNTMgQEAKICAgICAvLyBTb2Z0IE1JQwogICAgIGlmICgocEtleSAhPSBOVUxMKSAmJiAocEtleS0+YnlDaXBoZXJTdWl0ZSA9PSBLRVlfQ1RMX1RLSVApKSB7CiAgICAgICAgIGlmIChiSXNXRVApIHsKLSAgICAgICAgICAgIFBEV09SRCAgICAgICAgICBwZHdNSUNfTDsKLSAgICAgICAgICAgIFBEV09SRCAgICAgICAgICBwZHdNSUNfUjsKLSAgICAgICAgICAgIERXT1JEICAgICAgICAgICBkd01JQ19Qcmlvcml0eTsKLSAgICAgICAgICAgIERXT1JEICAgICAgICAgICBkd01JQ0tleTAgPSAwLCBkd01JQ0tleTEgPSAwOwotICAgICAgICAgICAgRFdPUkQgICAgICAgICAgIGR3TG9jYWxNSUNfTCA9IDA7Ci0gICAgICAgICAgICBEV09SRCAgICAgICAgICAgZHdMb2NhbE1JQ19SID0gMDsKKyAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgKnBkd01JQ19MOworICAgICAgICAgICAgdW5zaWduZWQgbG9uZyAqcGR3TUlDX1I7CisgICAgICAgICAgICB1bnNpZ25lZCBsb25nIGR3TUlDX1ByaW9yaXR5OworICAgICAgICAgICAgdW5zaWduZWQgbG9uZyBkd01JQ0tleTAgPSAwLCBkd01JQ0tleTEgPSAwOworICAgICAgICAgICAgdW5zaWduZWQgbG9uZyBkd0xvY2FsTUlDX0wgPSAwOworICAgICAgICAgICAgdW5zaWduZWQgbG9uZyBkd0xvY2FsTUlDX1IgPSAwOwogICAgICAgICAgICAgdmlhd2dldF93cGFfaGVhZGVyICp3cGFoZHI7CiAKIAogICAgICAgICAgICAgaWYgKHBNZ210LT5lQ3Vyck1vZGUgPT0gV01BQ19NT0RFX0VTU19BUCkgewotICAgICAgICAgICAgICAgIGR3TUlDS2V5MCA9IGNwdV90b19sZTMyKCooUERXT1JEKSgmcEtleS0+YWJ5S2V5WzI0XSkpOwotICAgICAgICAgICAgICAgIGR3TUlDS2V5MSA9IGNwdV90b19sZTMyKCooUERXT1JEKSgmcEtleS0+YWJ5S2V5WzI4XSkpOworICAgICAgICAgICAgICAgIGR3TUlDS2V5MCA9IGNwdV90b19sZTMyKCoodW5zaWduZWQgbG9uZyAqKSgmcEtleS0+YWJ5S2V5WzI0XSkpOworICAgICAgICAgICAgICAgIGR3TUlDS2V5MSA9IGNwdV90b19sZTMyKCoodW5zaWduZWQgbG9uZyAqKSgmcEtleS0+YWJ5S2V5WzI4XSkpOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgICAgaWYgKHBEZXZpY2UtPnBNZ210LT5lQXV0aGVuTW9kZSA9PSBXTUFDX0FVVEhfV1BBTk9ORSkgewotICAgICAgICAgICAgICAgICAgICBkd01JQ0tleTAgPSBjcHVfdG9fbGUzMigqKFBEV09SRCkoJnBLZXktPmFieUtleVsxNl0pKTsKLSAgICAgICAgICAgICAgICAgICAgZHdNSUNLZXkxID0gY3B1X3RvX2xlMzIoKihQRFdPUkQpKCZwS2V5LT5hYnlLZXlbMjBdKSk7CisgICAgICAgICAgICAgICAgICAgIGR3TUlDS2V5MCA9IGNwdV90b19sZTMyKCoodW5zaWduZWQgbG9uZyAqKSgmcEtleS0+YWJ5S2V5WzE2XSkpOworICAgICAgICAgICAgICAgICAgICBkd01JQ0tleTEgPSBjcHVfdG9fbGUzMigqKHVuc2lnbmVkIGxvbmcgKikoJnBLZXktPmFieUtleVsyMF0pKTsKICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChwS2V5LT5kd0tleUluZGV4ICYgQklUMjgpID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgZHdNSUNLZXkwID0gY3B1X3RvX2xlMzIoKihQRFdPUkQpKCZwS2V5LT5hYnlLZXlbMTZdKSk7Ci0gICAgICAgICAgICAgICAgICAgIGR3TUlDS2V5MSA9IGNwdV90b19sZTMyKCooUERXT1JEKSgmcEtleS0+YWJ5S2V5WzIwXSkpOworICAgICAgICAgICAgICAgICAgICBkd01JQ0tleTAgPSBjcHVfdG9fbGUzMigqKHVuc2lnbmVkIGxvbmcgKikoJnBLZXktPmFieUtleVsxNl0pKTsKKyAgICAgICAgICAgICAgICAgICAgZHdNSUNLZXkxID0gY3B1X3RvX2xlMzIoKih1bnNpZ25lZCBsb25nICopKCZwS2V5LT5hYnlLZXlbMjBdKSk7CiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgZHdNSUNLZXkwID0gY3B1X3RvX2xlMzIoKihQRFdPUkQpKCZwS2V5LT5hYnlLZXlbMjRdKSk7Ci0gICAgICAgICAgICAgICAgICAgIGR3TUlDS2V5MSA9IGNwdV90b19sZTMyKCooUERXT1JEKSgmcEtleS0+YWJ5S2V5WzI4XSkpOworICAgICAgICAgICAgICAgICAgICBkd01JQ0tleTAgPSBjcHVfdG9fbGUzMigqKHVuc2lnbmVkIGxvbmcgKikoJnBLZXktPmFieUtleVsyNF0pKTsKKyAgICAgICAgICAgICAgICAgICAgZHdNSUNLZXkxID0gY3B1X3RvX2xlMzIoKih1bnNpZ25lZCBsb25nICopKCZwS2V5LT5hYnlLZXlbMjhdKSk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICBNSUNfdkluaXQoZHdNSUNLZXkwLCBkd01JQ0tleTEpOwotICAgICAgICAgICAgTUlDX3ZBcHBlbmQoKFBCWVRFKSYocERldmljZS0+c1J4RXRoSGVhZGVyLmFieURzdEFkZHJbMF0pLCAxMik7CisgICAgICAgIC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lcysrOwogICAgICAgICAgICAgICAgIGlmIChiRGVGcmFnUngpIHsKQEAgLTg1OCw3ICs4MzgsNyBAQAogICAgICAgICAgICAgICAgLy8yMDA4LTA0MDktMDcsIDxBZGQ+IGJ5IEVpbnNuIExpdQogICAgICAgICNpZmRlZiBXUEFfU1VQUExJQ0FOVF9EUklWRVJfV0VYVF9TVVBQT1JUCiAJCQkJLy9zZW5kIGV2ZW50IHRvIHdwYV9zdXBwbGljYW50Ci0JCQkJLy9pZihwRGV2aWNlLT5iV1BBRGV2RW5hYmxlID09IFRSVUUpCisJCQkJLy9pZihwRGV2aWNlLT5iV1BBRGV2RW5hYmxlID09IHRydWUpCiAJCQkJewogCQkJCQl1bmlvbiBpd3JlcV9kYXRhIHdycXU7CiAJCQkJCXN0cnVjdCBpd19taWNoYWVsbWljZmFpbHVyZSBldjsKQEAgLTkwNiw3ICs4ODYsNyBAQAogICAgICAgICAgICAgICAgICAgICAgcERldmljZS0+c2tiID0gZGV2X2FsbG9jX3NrYigoaW50KXBEZXZpY2UtPnJ4X2J1Zl9zeik7CiAgICAgICAgICAgICAgICAgIH07CiAKLSAgICAgICAgICAgICAgICByZXR1cm4gRkFMU0U7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogCiAgICAgICAgICAgICB9CiAgICAgICAgIH0KQEAgLTkxNywxMyArODk3LDEzIEBACiAgICAgaWYgKChwS2V5ICE9IE5VTEwpICYmICgocEtleS0+YnlDaXBoZXJTdWl0ZSA9PSBLRVlfQ1RMX1RLSVApIHx8CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAocEtleS0+YnlDaXBoZXJTdWl0ZSA9PSBLRVlfQ1RMX0NDTVApKSkgewogICAgICAgICBpZiAoYklzV0VQKSB7Ci0gICAgICAgICAgICBXT1JEICAgICAgICB3TG9jYWxUU0MxNV8wID0gMDsKLSAgICAgICAgICAgIERXT1JEICAgICAgIGR3TG9jYWxUU0M0N18xNiA9IDA7Ci0gICAgICAgICAgICBVTE9OR0xPTkcgICAgICAgUlNDID0gMDsKKyAgICAgICAgICAgIHVuc2lnbmVkIHNob3J0IHdMb2NhbFRTQzE1XzAgPSAwOworICAgICAgICAgICAgdW5zaWduZWQgbG9uZyBkd0xvY2FsVFNDNDdfMTYgPSAwOworICAgICAgICAgICAgdW5zaWduZWQgbG9uZyBsb25nICAgICAgIFJTQyA9IDA7CiAgICAgICAgICAgICAvLyBlbmRpYW4gaXNzdWVzCi0gICAgICAgICAgICBSU0MgPSAqKChVTE9OR0xPTkcgKikgJihwS2V5LT5LZXlSU0MpKTsKLSAgICAgICAgICAgIHdMb2NhbFRTQzE1XzAgPSAoV09SRCkgUlNDOwotICAgICAgICAgICAgZHdMb2NhbFRTQzQ3XzE2ID0gKERXT1JEKSAoUlNDPj4xNik7CisgICAgICAgICAgICBSU0MgPSAqKCh1bnNpZ25lZCBsb25nIGxvbmcgKikgJihwS2V5LT5LZXlSU0MpKTsKKyAgICAgICAgICAgIHdMb2NhbFRTQzE1XzAgPSAodW5zaWduZWQgc2hvcnQpIFJTQzsKKyAgICAgICAgICAgIGR3TG9jYWxUU0M0N18xNiA9ICh1bnNpZ25lZCBsb25nKSAoUlNDPj4xNik7CiAKICAgICAgICAgICAgIFJTQyA9IGR3UnhUU0M0N18xNjsKICAgICAgICAgICAgIFJTQyA8PD0gMTY7CkBAIC05NTAsNyArOTMwLDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERldmljZS0+ZGV2LT5uYW1lKTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICByZXR1cm4gRkFMU0U7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KQEAgLTk2MywxMyArOTQzLDEzIEBACiAgICAgfQogCiAKLSAgICBzX3ZQcm9jZXNzUnhNQUNIZWFkZXIocERldmljZSwgKFBCWVRFKShza2ItPmRhdGErNCksIEZyYW1lU2l6ZSwgYklzV0VQLCBiRXh0SVYsICZjYkhlYWRlck9mZnNldCk7CisgICAgc192UHJvY2Vzc1J4TUFDSGVhZGVyKHBEZXZpY2UsICh1bnNpZ25lZCBjaGFyICopKHNrYi0+ZGF0YSs0KSwgRnJhbWVTaXplLCBiSXNXRVAsIGJFeHRJViwgJmNiSGVhZGVyT2Zmc2V0KTsKICAgICBGcmFtZVNpemUgLT0gY2JIZWFkZXJPZmZzZXQ7CiAgICAgY2JIZWFkZXJPZmZzZXQgKz0gNDsgICAgICAgIC8vIDQgaXMgUmN2IGJ1ZmZlciBoZWFkZXIKIAogICAgIC8vIE51bGwgZGF0YSwgZnJhbWVzaXplID0gMTQKICAgICBpZiAoRnJhbWVTaXplIDwgMTUpCi0gICAgICAgIHJldHVybiBGQUxTRTsKKyAgICAgICAgcmV0dXJuIGZhbHNlOwogCiAgICAgaWYgKHBNZ210LT5lQ3Vyck1vZGUgPT0gV01BQ19NT0RFX0VTU19BUCkgewogICAgICAgICBpZiAoc19iQVBNb2RlUnhEYXRhKHBEZXZpY2UsCkBAIC05NzgsNyArOTU4LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYkhlYWRlck9mZnNldCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpU0FOb2RlSW5kZXgsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaURBTm9kZUluZGV4Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSA9PSBGQUxTRSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgPT0gZmFsc2UpIHsKIAogICAgICAgICAgICAgaWYgKGJEZUZyYWdSeCkgewogICAgICAgICAgICAgICAgIGlmICghZGV2aWNlX2FsbG9jX2ZyYWdfYnVmKHBEZXZpY2UsICZwRGV2aWNlLT5zUnhERkNCW3BEZXZpY2UtPnVDdXJyZW50REZDQklkeF0pKSB7CkBAIC05ODYsMTAgKzk2NiwxMCBAQAogICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT5kZXYtPm5hbWUpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiBGQUxTRTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgfQogCi0vLyAgICAgICAgaWYocERldmljZS0+YlJ4TUlDRmFpbCA9PSBGQUxTRSkgeworLy8gICAgICAgIGlmKHBEZXZpY2UtPmJSeE1JQ0ZhaWwgPT0gZmFsc2UpIHsKIC8vICAgICAgICAgICBmb3IgKGlpID0wOyBpaSA8IDEwMDsgaWkrKykKIC8vICAgICAgICAgICAgICAgIHByaW50aygiICUwMngiLCAqKHNrYi0+ZGF0YSArIGlpKSk7CiAvLyAgICAgICAgICAgcHJpbnRrKCJcbiIpOwpAQCAtMTAxNiw3ICs5OTYsNyBAQAogICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT5kZXYtPm5hbWUpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KLQkJCXJldHVybiBGQUxTRTsKKwkJCXJldHVybiBmYWxzZTsKIAkJfQogCX0KICovCkBAIC0xMDMxLDE3ICsxMDExLDE3IEBACiAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9FUlIsS0VSTl9FUlIgIiVzOiBjYW4gbm90IGFsbG9jIG1vcmUgZnJhZyBidWZzXG4iLAogICAgICAgICAgICAgICAgIHBEZXZpY2UtPmRldi0+bmFtZSk7CiAgICAgICAgIH0KLSAgICAgICAgcmV0dXJuIEZBTFNFOworICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgfQogCi0gICAgcmV0dXJuIFRSVUU7CisgICAgcmV0dXJuIHRydWU7CiB9CiAKIAotc3RhdGljIEJPT0wgc19iQVBNb2RlUnhDdGwgKAorc3RhdGljIGJvb2wgc19iQVBNb2RlUnhDdGwgKAogICAgIFBTRGV2aWNlIHBEZXZpY2UsCi0gICAgUEJZVEUgICAgcGJ5RnJhbWUsCi0gICAgSU5UICAgICAgaVNBTm9kZUluZGV4CisgICAgdW5zaWduZWQgY2hhciAqcGJ5RnJhbWUsCisgICAgaW50ICAgICAgaVNBTm9kZUluZGV4CiAgICAgKQogewogICAgIFBTODAyXzExSGVhZGVyICAgICAgcDgwMl8xMUhlYWRlcjsKQEAgLTEwNjMsMzAgKzEwNDMsMzAgQEAKICAgICAgICAgICAgICAgICAgICAgLy8gcmVhc29uID0gKDYpIGNsYXNzIDIgcmVjZWl2ZWQgZnJvbSBub25hdXRoIHN0YQogICAgICAgICAgICAgICAgICAgICB2TWdyRGVBdXRoZW5CZWdpblN0YShwRGV2aWNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWdtdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFBCWVRFKShwODAyXzExSGVhZGVyLT5hYnlBZGRyMiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCBjaGFyICopKHA4MDJfMTFIZWFkZXItPmFieUFkZHIyKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFdMQU5fTUdNVF9SRUFTT05fQ0xBU1MyX05PTkFVVEgpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmU3RhdHVzCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7CiAgICAgICAgICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8gImRwYzogc2VuZCB2TWdyRGVBdXRoZW5CZWdpblN0YSAxXG4iKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFRSVUU7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICAgICAgICAgIH07CiAgICAgICAgICAgICAgICAgaWYgKHBNZ210LT5zTm9kZURCVGFibGVbaVNBTm9kZUluZGV4XS5lTm9kZVN0YXRlIDwgTk9ERV9BU1NPQykgewogICAgICAgICAgICAgICAgICAgICAvLyBzZW5kIGRlYXNzb2Mgbm90aWZpY2F0aW9uCiAgICAgICAgICAgICAgICAgICAgIC8vIHJlYXNvbiA9ICg3KSBjbGFzcyAzIHJlY2VpdmVkIGZyb20gbm9uYXNzb2Mgc3RhCiAgICAgICAgICAgICAgICAgICAgIHZNZ3JEaXNhc3NvY0JlZ2luU3RhKHBEZXZpY2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNZ210LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoUEJZVEUpKHA4MDJfMTFIZWFkZXItPmFieUFkZHIyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHVuc2lnbmVkIGNoYXIgKikocDgwMl8xMUhlYWRlci0+YWJ5QWRkcjIpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoV0xBTl9NR01UX1JFQVNPTl9DTEFTUzNfTk9OQVNTT0MpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmU3RhdHVzCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7CiAgICAgICAgICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8gImRwYzogc2VuZCB2TWdyRGlzYXNzb2NCZWdpblN0YSAyXG4iKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFRSVUU7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICAgICAgICAgIH07CiAKICAgICAgICAgICAgICAgICBpZiAocE1nbXQtPnNOb2RlREJUYWJsZVtpU0FOb2RlSW5kZXhdLmJQU0VuYWJsZSkgewogICAgICAgICAgICAgICAgICAgICAvLyBkZWxjYXJlIHJlY2VpdmVkIHBzLXBvbGwgZXZlbnQKICAgICAgICAgICAgICAgICAgICAgaWYgKElTX0NUTF9QU1BPTEwocGJ5RnJhbWUpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlW2lTQU5vZGVJbmRleF0uYlJ4UFNQb2xsID0gVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBNZ210LT5zTm9kZURCVGFibGVbaVNBTm9kZUluZGV4XS5iUnhQU1BvbGwgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgICAgICAgYlNjaGVkdWxlQ29tbWFuZCgodm9pZCAqKXBEZXZpY2UsIFdMQU5fQ01EX1JYX1BTUE9MTCwgTlVMTCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPICJkcGM6IFdMQU5fQ01EX1JYX1BTUE9MTCAxXG4iKTsKICAgICAgICAgICAgICAgICAgICAgfQpAQCAtMTA5NCw4ICsxMDc0LDggQEAKICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNoZWNrIERhdGEgUFMgc3RhdGUKICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGlmIFBXIGJpdCBvZmYsIHNlbmQgb3V0IGFsbCBQUyBidWZmZXJyaW5nIHBhY2tldHMuCiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIUlTX0ZDX1BPV0VSTUdUKHBieUZyYW1lKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNZ210LT5zTm9kZURCVGFibGVbaVNBTm9kZUluZGV4XS5iUFNFbmFibGUgPSBGQUxTRTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlW2lTQU5vZGVJbmRleF0uYlJ4UFNQb2xsID0gVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlW2lTQU5vZGVJbmRleF0uYlBTRW5hYmxlID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1nbXQtPnNOb2RlREJUYWJsZVtpU0FOb2RlSW5kZXhdLmJSeFBTUG9sbCA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYlNjaGVkdWxlQ29tbWFuZCgodm9pZCAqKXBEZXZpY2UsIFdMQU5fQ01EX1JYX1BTUE9MTCwgTlVMTCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyAiZHBjOiBXTEFOX0NNRF9SWF9QU1BPTEwgMlxuIik7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CkBAIC0xMTAzLDE1ICsxMDgzLDE1IEBACiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgICAgIGlmIChJU19GQ19QT1dFUk1HVChwYnlGcmFtZSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgcE1nbXQtPnNOb2RlREJUYWJsZVtpU0FOb2RlSW5kZXhdLmJQU0VuYWJsZSA9IFRSVUU7CisgICAgICAgICAgICAgICAgICAgICAgIHBNZ210LT5zTm9kZURCVGFibGVbaVNBTm9kZUluZGV4XS5iUFNFbmFibGUgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgICAgICAvLyBPbmNlIGlmIFNUQSBpbiBQUyBzdGF0ZSwgZW5hYmxlIG11bHRpY2FzdCBidWZmZXJyaW5nCi0gICAgICAgICAgICAgICAgICAgICAgIHBNZ210LT5zTm9kZURCVGFibGVbMF0uYlBTRW5hYmxlID0gVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgICAgcE1nbXQtPnNOb2RlREJUYWJsZVswXS5iUFNFbmFibGUgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAvLyBjbGVhciBhbGwgcGVuZGluZyBQUyBmcmFtZS4KICAgICAgICAgICAgICAgICAgICAgICBpZiAocE1nbXQtPnNOb2RlREJUYWJsZVtpU0FOb2RlSW5kZXhdLndFblF1ZXVlQ250ID4gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlW2lTQU5vZGVJbmRleF0uYlBTRW5hYmxlID0gRkFMU0U7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgIHBNZ210LT5zTm9kZURCVGFibGVbaVNBTm9kZUluZGV4XS5iUnhQU1BvbGwgPSBUUlVFOworICAgICAgICAgICAgICAgICAgICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlW2lTQU5vZGVJbmRleF0uYlBTRW5hYmxlID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHBNZ210LT5zTm9kZURCVGFibGVbaVNBTm9kZUluZGV4XS5iUnhQU1BvbGwgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgICAgICAgICBiU2NoZWR1bGVDb21tYW5kKCh2b2lkICopcERldmljZSwgV0xBTl9DTURfUlhfUFNQT0xMLCBOVUxMKTsKICAgICAgICAgICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPICJkcGM6IFdMQU5fQ01EX1JYX1BTUE9MTCAzXG4iKTsKIApAQCAtMTEyMiw3ICsxMTAyLDcgQEAKICAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgICAgdk1nckRlQXV0aGVuQmVnaW5TdGEocERldmljZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNZ210LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFBCWVRFKShwODAyXzExSGVhZGVyLT5hYnlBZGRyMiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodW5zaWduZWQgY2hhciAqKShwODAyXzExSGVhZGVyLT5hYnlBZGRyMiksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoV0xBTl9NR01UX1JFQVNPTl9DTEFTUzJfTk9OQVVUSCksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmU3RhdHVzCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwpAQCAtMTE1NCwzMSArMTEzNCwzMSBAQAogICAgICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPICJkcGM6IHdGcmFtZUN0bD0gJXhcbiIsIHA4MDJfMTFIZWFkZXItPndGcmFtZUN0bCApOwogICAgICAgICAgICAgICAgICAgICBWTlN2SW5Qb3J0QihwRGV2aWNlLT5Qb3J0T2Zmc2V0ICsgTUFDX1JFR19SQ1IsICYocERldmljZS0+YnlSeE1vZGUpKTsKICAgICAgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyAiZHBjOnBEZXZpY2UtPmJ5UnhNb2RlID0gJXhcbiIsIHBEZXZpY2UtPmJ5UnhNb2RlICk7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBUUlVFOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KLSAgICByZXR1cm4gRkFMU0U7CisgICAgcmV0dXJuIGZhbHNlOwogCiB9CiAKLXN0YXRpYyBCT09MIHNfYkhhbmRsZVJ4RW5jcnlwdGlvbiAoCitzdGF0aWMgYm9vbCBzX2JIYW5kbGVSeEVuY3J5cHRpb24gKAogICAgIFBTRGV2aWNlICAgICBwRGV2aWNlLAotICAgIFBCWVRFICAgICAgICBwYnlGcmFtZSwKLSAgICBVSU5UICAgICAgICAgRnJhbWVTaXplLAotICAgIFBCWVRFICAgICAgICBwYnlSc3IsCi0gICAgUEJZVEUgICAgICAgcGJ5TmV3UnNyLAorICAgIHVuc2lnbmVkIGNoYXIgKnBieUZyYW1lLAorICAgIHVuc2lnbmVkIGludCBGcmFtZVNpemUsCisgICAgdW5zaWduZWQgY2hhciAqcGJ5UnNyLAorICAgIHVuc2lnbmVkIGNoYXIgKnBieU5ld1JzciwKICAgICBQU0tleUl0ZW0gICAqcEtleU91dCwKLSAgICBpbnQgKiAgICAgICBwYkV4dElWLAotICAgIFBXT1JEICAgICAgIHB3UnhUU0MxNV8wLAotICAgIFBEV09SRCAgICAgIHBkd1J4VFNDNDdfMTYKKyAgICBib29sICpwYkV4dElWLAorICAgIHVuc2lnbmVkIHNob3J0ICpwd1J4VFNDMTVfMCwKKyAgICB1bnNpZ25lZCBsb25nICpwZHdSeFRTQzQ3XzE2CiAgICAgKQogewotICAgIFVJTlQgICAgICAgICAgICBQYXlsb2FkTGVuID0gRnJhbWVTaXplOwotICAgIFBCWVRFICAgICAgICAgICBwYnlJVjsKLSAgICBCWVRFICAgICAgICAgICAgYnlLZXlJZHg7CisgICAgdW5zaWduZWQgaW50IFBheWxvYWRMZW4gPSBGcmFtZVNpemU7CisgICAgdW5zaWduZWQgY2hhciAqcGJ5SVY7CisgICAgdW5zaWduZWQgY2hhciBieUtleUlkeDsKICAgICBQU0tleUl0ZW0gICAgICAgcEtleSA9IE5VTEw7Ci0gICAgQllURSAgICAgICAgICAgIGJ5RGVjTW9kZSA9IEtFWV9DVExfV0VQOworICAgIHVuc2lnbmVkIGNoYXIgYnlEZWNNb2RlID0gS0VZX0NUTF9XRVA7CiAgICAgUFNNZ210T2JqZWN0ICAgIHBNZ210ID0gcERldmljZS0+cE1nbXQ7CiAKIApAQCAtMTE4Niw4ICsxMTY2LDggQEAKICAgICAqcGR3UnhUU0M0N18xNiA9IDA7CiAKICAgICBwYnlJViA9IHBieUZyYW1lICsgV0xBTl9IRFJfQUREUjNfTEVOOwotICAgIGlmICggV0xBTl9HRVRfRkNfVE9EUygqKFBXT1JEKXBieUZyYW1lKSAmJgotICAgICAgICAgV0xBTl9HRVRfRkNfRlJPTURTKCooUFdPUkQpcGJ5RnJhbWUpICkgeworICAgIGlmICggV0xBTl9HRVRfRkNfVE9EUygqKHVuc2lnbmVkIHNob3J0ICopcGJ5RnJhbWUpICYmCisgICAgICAgICBXTEFOX0dFVF9GQ19GUk9NRFMoKih1bnNpZ25lZCBzaG9ydCAqKXBieUZyYW1lKSApIHsKICAgICAgICAgIHBieUlWICs9IDY7ICAgICAgICAgICAgIC8vIDYgaXMgODAyLjExIGFkZHJlc3M0CiAgICAgICAgICBQYXlsb2FkTGVuIC09IDY7CiAgICAgfQpAQCAtMTIwNCw3ICsxMTg0LDcgQEAKICAgICAgICAgICAgIChwRGV2aWNlLT5wTWdtdC0+YnlDU1NQSyAhPSBLRVlfQ1RMX05PTkUpKSB7CiAgICAgICAgICAgICAvLyB1bmljYXN0IHBrdCB1c2UgcGFpcndpc2Uga2V5CiAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPInVuaWNhc3QgcGt0XG4iKTsKLSAgICAgICAgICAgIGlmIChLZXliR2V0S2V5KCYocERldmljZS0+c0tleSksIHBEZXZpY2UtPmFieUJTU0lELCAweEZGRkZGRkZGLCAmcEtleSkgPT0gVFJVRSkgeworICAgICAgICAgICAgaWYgKEtleWJHZXRLZXkoJihwRGV2aWNlLT5zS2V5KSwgcERldmljZS0+YWJ5QlNTSUQsIDB4RkZGRkZGRkYsICZwS2V5KSA9PSB0cnVlKSB7CiAgICAgICAgICAgICAgICAgaWYgKHBEZXZpY2UtPnBNZ210LT5ieUNTU1BLID09IEtFWV9DVExfVEtJUCkKICAgICAgICAgICAgICAgICAgICAgYnlEZWNNb2RlID0gS0VZX0NUTF9US0lQOwogICAgICAgICAgICAgICAgIGVsc2UgaWYgKHBEZXZpY2UtPnBNZ210LT5ieUNTU1BLID09IEtFWV9DVExfQ0NNUCkKQEAgLTEyMzgsMjQgKzEyMTgsMjQgQEAKICAgICAgICAgREJHX1BSVChNU0dfTEVW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BpZiAoYnlEZWNNb2RlICE9IHBLZXktPmJ5Q2lwaGVyU3VpdGUpIHsKICAgICAgICAgaWYgKGJ5RGVjTW9kZSA9PSBLRVlfQ1RMX1dFUCkgewogLy8gICAgICAgICAgICBwRGV2aWNlLT5zODAyXzExQ291bnRlci5XRVBVbmRlY3J5cHRhYmxlQ291bnQuUXVhZFBhcnQrKzsKLSAgICAgICAgfSBlbHNlIGlmIChwRGV2aWNlLT5iTGlua1Bhc3MgPT0gVFJVRSkgeworICAgICAgICB9IGVsc2UgaWYgKHBEZXZpY2UtPmJMaW5rUGFzcyA9PSB0cnVlKSB7CiAvLyAgICAgICAgICAgIHBEZXZpY2UtPnM4MDJfMTFDb3VudGVyLkRlY3J5cHRGYWlsdXJlQ291bnQuUXVhZFBhcnQrKzsKICAgICAgICAgfQotICAgICAgICByZXR1cm4gRkFMU0U7CisgICAgICAgIHJldHVybiBmYWxzZTsKICAgICB9CiAKICAgICBpZiAoYnlEZWNNb2RlID09IEtFWV9DVExfV0VQKSB7CiAgICAgICAgIC8vIGhhbmRsZSBXRVAKICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyJieURlY01vZGUgPT0gS0VZX0NUTF9XRVAgXG4iKTsKICAgICAgICAgaWYgKChwRGV2aWNlLT5ieUxvY2FsSUQgPD0gUkVWX0lEX1ZUMzI1M19BMSkgfHwKLSAgICAgICAgICAgICgoKFBTS2V5VGFibGUpKHBLZXktPnB2S2V5VGFibGUpKS0+YlNvZnRXRVAgPT0gVFJVRSkgfHwKLSAgICAgICAgICAgIChiT25GbHkgPT0gRkFMU0UpKSB7CisgICAgICAgICAgICAoKChQU0tleVRhYmxlKShwS2V5LT5wdktleVRhYmxlKSktPmJTb2Z0V0VQID09IHRydWUpIHx8CisgICAgICAgICAgICAoYk9uRmx5ID09IGZhbHNlKSkgewogICAgICAgICAgICAgLy8gU29mdHdhcmUgV0VQCiAgICAgICAgICAgICAvLyAxLiAzMjUzQQogIC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KSB7CisgICAgICAgICAgICBpZiAoKHBEZXZpY2UtPmJ5TG9jYWxJRCA8PSBSRVZfSURfVlQzMjUzX0ExKSB8fCAoYk9uRmx5ID09IGZhbHNlKSkgewogICAgICAgICAgICAgICAgIC8vIFNvZnR3YXJlIFRLSVAKICAgICAgICAgICAgICAgICAvLyAxLiAzMjUzIEEKICAgICAgICAgICAgICAgICAvLyAyLiBOb3RPbkZseQpAQCAtMTQxNyw3ICsxMzk3LDcgQEAKICAgICAgICAgfQogCiAgICAgICAgIGlmIChieURlY01vZGUgPT0gS0VZX0NUTF9DQ01QKSB7Ci0gICAgICAgICAgICBpZiAoYk9uRmx5ID09IEZBTFNFKSB7CisgICAgICAgICAgICBpZiAoYk9uRmx5ID09IGZhbHNlKSB7CiAgICAgICAgICAgICAgICAgLy8gU29mdHdhcmUgQ0NNUAogICAgICAgICAgICAgICAgIC8vIE5vdE9uRmx5CiAgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyJzb2Z0IEtFWV9DVExfQ0NNUFxuIik7CkBAIC0xNDMzLDM0ICsxNDEzLDM0IEBACiAgICAgfS8vIGVuZCBvZiBUS0lQL0FFUwogCiAgICAgaWYgKCgqKHBieUlWKzMpICYgMHgyMCkgIT0gMCkKLSAgICAgICAgKnBiRXh0SVYgPSBUUlVFOwotICAgIHJldHVybiBUUlVFOworICAgICAgICAqcGJFeHRJViA9IHRydWU7CisgICAgcmV0dXJuIHRydWU7CiB9CiAKIAogCi1zdGF0aWMgQk9PTCBzX2JBUE1vZGVSeERhdGEgKAorc3RhdGljIGJvb2wgc19iQVBNb2RlUnhEYXRhICgKICAgICBQU0RldmljZSBwRGV2aWNlLAogICAgIHN0cnVjdCBza19idWZmKiBza2IsCi0gICAgVUlOVCAgICAgRnJhbWVTaXplLAotICAgIFVJTlQgICAgIGNiSGVhZGVyT2Zmc2V0LAotICAgIElOVCAgICAgIGlTQU5vZGVJbmRleCwKLSAgICBJTlQgICAgICBpREFOb2RlSW5kZXgKKyAgICB1bnNpZ25lZCBpbnQgRnJhbWVTaXplLAorICAgIHVuc2lnbmVkIGludCBjYkhlYWRlck9mZnNldCwKKyAgICBpbnQgICAgICBpU0FOb2RlSW5kZXgsCisgICAgaW50ICAgICAgaURBTm9kZUluZGV4CiAgICAgKQogewogICAgIFBTTWdtdE9iamVjdCAgICAgICAgcE1nbXQgPSBwRGV2aWNlLT5wTWdtdDsKLSAgICBCT09MICAgICAgICAgICAgICAgIGJSZWxheUFuZEZvcndhcmQgPSBGQUxTRTsKLSAgICBCT09MICAgICAgICAgICAgICAgIGJSZWxheU9ubHkgPSBGQUxTRTsKLSAgICBCWVRFICAgICAgICAgICAgICAgIGJ5TWFza1s4XSA9IHsxLCAyLCA0LCA4LCAweDEwLCAweDIwLCAweDQwLCAweDgwfTsKLSAgICBXT1JEICAgICAgICAgICAgICAgIHdBSUQ7CisgICAgYm9vbCBiUmVsYXlBbmRGb3J3YXJkID0gZmFsc2U7CisgICAgYm9vbCBiUmVsYXlPbmx5ID0gZmFsc2U7CisgICAgdW5zaWduZWQgY2hhciBieU1hc2tbOF0gPSB7MSwgMiwgNCwgOCwgMHgxMCwgMHgyMCwgMHg0MCwgMHg4MH07CisgICAgdW5zaWduZWQgc2hvcnQgd0FJRDsKIAogCiAgICAgc3RydWN0IHNrX2J1ZmYqIHNrYmNweSA9IE5VTEw7CiAKICAgICBpZiAoRnJhbWVTaXplID4gQ0JfTUFYX0JVRl9TSVpFKQotICAgICAgICByZXR1cm4gRkFMU0U7CisgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAvLyBjaGVjayBEQQotICAgIGlmKElTX01VTFRJQ0FTVF9BRERSRVNTKChQQllURSkoc2tiLT5kYXRhK2NiSGVhZGVyT2Zmc2V0KSkpIHsKKyAgICBpZihpc19tdWx0aWNhc3RfZXRoZXJfYWRkcigodW5zaWduZWQgY2hhciAqKShza2ItPmRhdGErY2JIZWFkZXJPZmZzZXQpKSkgewogICAgICAgIGlmIChwTWdtdC0+c05vZGVEQlRhYmxlWzBdLmJQU0VuYWJsZSkgewogCiAgICAgICAgICAgIHNrYmNweSA9IGRldl9hbGxvY19za2IoKGludClwRGV2aWNlLT5yeF9idWZfc3opOwpAQCAtMTQ4MSwxMiArMTQ2MSwxMiBAQAogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewotICAgICAgICAgICBiUmVsYXlBbmRGb3J3YXJkID0gVFJVRTsKKyAgICAgICAgICAgYlJlbGF5QW5kRm9yd2FyZCA9IHRydWU7CiAgICAgICAgfQogICAgIH0KICAgICBlbHNlIHsKICAgICAgICAgLy8gY2hlY2sgaWYgcmVsYXkKLSAgICAgICAgaWYgKEJTU0RCYklzU1RBSW5Ob2RlREIocE1nbXQsIChQQllURSkoc2tiLT5kYXRhK2NiSGVhZGVyT2Zmc2V0KSwgJmlEQU5vZGVJbmRleCkpIHsKKyAgICAgICAgaWYgKEJTU0RCYklzU1RBSW5Ob2RlREIocE1nbXQsICh1bnNpZ25lZCBjaGFyICopKHNrYi0+ZGF0YStjYkhlYWRlck9mZnNldCksICZpREFOb2RlSW5kZXgpKSB7CiAgICAgICAgICAgICBpZiAocE1nbXQtPnNOb2RlREJUYWJsZVtpREFOb2RlSW5kZXhdLmVOb2RlU3RhdGUgPj0gTk9ERV9BU1NPQykgewogICAgICAgICAgICAgICAgIGlmIChwTWdtdC0+c05vZGVEQlRhYmxlW2lEQU5vZGVJbmRleF0uYlBTRW5hYmxlKSB7CiAgICAgICAgICAgICAgICAgICAgIC8vIHF1ZXVlIHRoaXMgc2tiIHVudGlsIG5leHQgUFMgdHgsIGFuZCB0aGVuIHJlbGVhc2UuCkBAIC0xNTAwLDEwICsxNDgwLDEwIEBACiAgICAgICAgICAgICAgICAgICAgIHBNZ210LT5hYnlQU1R4TWFwW3dBSUQgPj4gM10gfD0gIGJ5TWFza1t3QUlEICYgN107CiAgICAgICAgICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8gInJlbGF5OiBpbmRleD0gJWQsIHBNZ210LT5hYnlQU1R4TWFwWyVkXT0gJWRcbiIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaURBTm9kZUluZGV4LCAod0FJRCA+PiAzKSwgcE1nbXQtPmFieVBTVHhNYXBbd0FJRCA+PiAzXSk7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBUUlVFOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGJSZWxheU9ubHkgPSBUUlVFOworICAgICAgICAgICAgICAgICAgICBiUmVsYXlPbmx5ID0gdHJ1ZTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH07CkBAIC0xNTE1LDE2ICsxNDk1LDE2IEBACiAgICAgICAgICAgICBpREFOb2RlSW5kZXggPSAwOwogCiAgICAgICAgIGlmICgocERldmljZS0+dUFzc29jQ291bnQgPiAxKSAmJiAoaURBTm9kZUluZGV4ID49IDApKSB7Ci0gICAgICAgICAgICBST1VURWJSZWxheShwRGV2aWNlLCAoUEJZVEUpKHNrYi0+ZGF0YSArIGNiSGVhZGVyT2Zmc2V0KSwgRnJhbWVTaXplLCAoVUlOVClpREFOb2RlSW5kZXgpOworICAgICAgICAgICAgUk9VVEViUmVsYXkocERldmljZSwgKHVuc2lnbmVkIGNoYXIgKikoc2tiLT5kYXRhICsgY2JIZWFkZXJPZmZzZXQpLCBGcmFtZVNpemUsICh1bnNpZ25lZCBpbnQpaURBTm9kZUluZGV4KTsKICAgICAgICAgfQogCiAgICAgICAgIGlmIChiUmVsYXlPbmx5KQotICAgICAgICAgICAgcmV0dXJuIEZBTFNFOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgIH0KICAgICAvLyBub25lIGFzc29jaWF0ZSwgZG9uJ3QgZ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ICAgICAgICAgICAgICAgcGFyYW0tPnN0YV9hZGRyLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlW2lOb2RlSW5kZXhdLmR3S2V5SW5kZXgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBEZXZpY2UtPlBvcnRPZmZzZXQpID09IEZBTFNFKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBEZXZpY2UtPlBvcnRPZmZzZXQpID09IGZhbHNlKSB7CiAgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyAiS2V5YlJlbW92ZUtleSBmYWlsIFxuIik7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlW2lOb2RlSW5kZXhdLmJPbkZseSA9IEZBTFNFOworICAgICAgICAgICAgcE1nbXQtPnNOb2RlREJUYWJsZVtpTm9kZUluZGV4XS5iT25GbHkgPSBmYWxzZTsKICAgICAgICAgfQogICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlW2lOb2RlSW5kZXhdLmJ5S2V5SW5kZXggPSAwOwogICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlW2lOb2RlSW5kZXhdLmR3S2V5SW5kZXggPSAwOwpAQCAtNTUzLDE2ICs1NTMsMTYgQEAKICAgICAgICAgICAgIHBhcmFtLT51LmNyeXB0LmtleV9sZW4KICAgICAgICAgICAgKTsKIAotICAgIGR3S2V5SW5kZXggPSAoRFdPUkQpKHBhcmFtLT51LmNyeXB0LmlkeCk7CisgICAgZHdLZXlJbmRleCA9ICh1bnNpZ25lZCBsb25nKShwYXJhbS0+dS5jcnlwdC5pZHgpOwogICAgIGlmIChwYXJhbS0+dS5jcnlwdC5mbGFncyAmIEhPU1RBUF9DUllQVF9GTEFHX1NFVF9UWF9LRVkpIHsKLSAgICAgICAgcERldmljZS0+YnlLZXlJbmRleCA9IChCWVRFKWR3S2V5SW5kZXg7Ci0gICAgICAgIHBEZXZpY2UtPmJUcmFuc21pdEtleSA9IFRSVUU7CisgICAgICAgIHBEZXZpY2UtPmJ5S2V5SW5kZXggPSAodW5zaWduZWQgY2hhcilkd0tleUluZGV4OworICAgICAgICBwRGV2aWNlLT5iVHJhbnNtaXRLZXkgPSB0cnVlOwogICAgICAgICBkd0tleUluZGV4IHw9ICgxIDw8IDMxKTsKICAgICB9CiAKIAlpZiAocGFyYW0tPnUuY3J5cHQuYWxnID09IFdQQV9BTEdfV0VQKSB7CiAKLSAgICAgICAgaWYgKChwRGV2aWNlLT5iRW5hYmxlODAyMXggPT0gRkFMU0UpIHx8IChpTm9kZUluZGV4ID09IDApKSB7CisgICAgICAgIGlmICgocERldmljZS0+YkVuYWJsZTgwMjF4ID09IGZhbHNlKSB8fCAoaU5vZGVJbmRleCA9PSAwKSkgewogICAgICAgICAgICAgS2V5YlNldERlZmF1bHRLZXkoJihwRGV2aWNlLT5zS2V5KSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHdLZXlJbmRleCAmIH4oQklUMzAgfCBVU0VfS0VZUlNDKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW0tPnUuY3J5cHQua2V5X2xlbiwKQEAgLTU4MCwyMSArNTgwLDIxIEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkd0tleUluZGV4ICYgfihVU0VfS0VZUlNDKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtLT51LmNyeXB0LmtleV9sZW4sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoUFFXT1JEKSAmKEtleVJTQyksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAoUEJZVEUpYWJ5S2V5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgKHVuc2lnbmVkIGNoYXIgKilhYnlLZXksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgS0VZX0NUTF9XRVAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERldmljZS0+UG9ydE9mZnNldCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT5ieUxvY2FsSUQpID09IFRSVUUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT5ieUxvY2FsSUQpID09IHRydWUpIHsKIAotICAgICAgICAgICAgICAgIHBNZ210LT5zTm9kZURCVGFibGVbaU5vZGVJbmRleF0uYk9uRmx5ID0gVFJVRTsKKyAgICAgICAgICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlW2lOb2RlSW5kZXhdLmJPbkZseSA9IHRydWU7CiAKICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgLy8gS2V5IFRhYmxlIEZ1bGwKLSAgICAgICAgICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlW2lOb2RlSW5kZXhdLmJPbkZseSA9IEZBTFNFOwotICAgICAgICAgICAgICAgIGJLZXlUYWJsZUZ1bGwgPSBUUlVFOworICAgICAgICAgICAgICAgIHBNZ210LT5zTm9kZURCVGFibGVbaU5vZGVJbmRleF0uYk9uRmx5ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgYktleVRhYmxlRnVsbCA9IHRydWU7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgICAgcERldmljZS0+ZUVuY3J5cHRpb25TdGF0dXMgPSBOZGlzODAyXzExRW5jcnlwdGlvbjFFbmFibGVkOwotICAgICAgICBwRGV2aWNlLT5iRW5jcnlwdGlvbkVuYWJsZSA9IFRSVUU7CisgICAgICAgIHBEZXZpY2UtPmJFbmNyeXB0aW9uRW5hYmxlID0gdHJ1ZTsKICAgICAgICAgcE1nbXQtPmJ5Q1NTUEsgPSBLRVlfQ1RMX1dFUDsKICAgICAgICAgcE1nbXQtPmJ5Q1NTR0sgPSBLRVlfQ1RMX1dFUDsKICAgICAgICAgcE1nbXQtPnNOb2RlREJUYWJsZVtpTm9kZUluZGV4XS5ieUNpcGhlclN1aXRlID0gS0VZX0NUTF9XRVA7CkBAIC02NDAsNyArNjQwLDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5S2V5RGVjTW9kZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBEZXZpY2UtPlBvcnRPZmZzZXQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT5ieUxvY2FsSUQpOwotICAgICAgIHBNZ210LT5zTm9kZURCVGFibGVbaU5vZGVJbmRleF0uYk9uRmx5ID0gVFJVRTsKKyAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlW2lOb2RlSW5kZXhdLmJPbkZseSA9IHRydWU7CiAKICAgICB9IGVsc2UgewogICAgICAgICBkd0tleUluZGV4IHw9ICgxIDw8IDMwKTsgLy8gc2V0IHBhaXJ3aXNlIGtleQpAQCAtNjQ5LDIzICs2NDksMjMgQEAKICAgICAgICAgICAgICAgICAgICAgICAgZHdLZXlJbmRleCwKICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW0tPnUuY3J5cHQua2V5X2xlbiwKICAgICAgICAgICAgICAgICAgICAgICAgKFBRV09SRCkgJihLZXlSU0MpLAotICAgICAgICAgICAgICAgICAgICAgICAoUEJZVEUpYWJ5S2V5LAorICAgICAgICAgICAgICAgICAgICAgICAodW5zaWduZWQgY2hhciAqKWFieUtleSwKICAgICAgICAgICAgICAgICAgICAgICAgIGJ5S2V5RGVjTW9kZSwKICAgICAgICAgICAgICAgICAgICAgICAgIHBEZXZpY2UtPlBvcnRPZmZzZXQsCi0gICAgICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT5ieUxvY2FsSUQpID09IFRSVUUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJ5TG9jYWxJRCkgPT0gdHJ1ZSkgewogCi0gICAgICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlW2lOb2RlSW5kZXhdLmJPbkZseSA9IFRSVUU7CisgIC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zJdOworCXUzMiAgIHVsbFR4RGlyZWN0ZWRGcmFtZXNbMl07CisJdTMyICAgdWxsVHhCcm9hZGNhc3RCeXRlc1syXTsKKwl1MzIgICB1bGxUeE11bHRpY2FzdEJ5dGVzWzJdOworCXUzMiAgIHVsbFR4RGlyZWN0ZWRCeXRlc1syXTsKIH0gU1N0YXRNSUJDb3VudCwgKlBTU3RhdE1JQkNvdW50OwogCiAKIHR5cGVkZWYgc3RydWN0IHRhZ1NOb2RlSXRlbSB7CiAgICAgLy8gU1RBIGluZm8KLSAgICBVMTYgICAgICAgICAgICB3QUlEOwotICAgIFU4ICAgICAgICAgICAgIGFieU1BQ0FkZHJbNl07Ci0gICAgVTE2ICAgICAgICAgICAgd1R4RGF0YVJhdGU7Ci0gICAgVTE2ICAgICAgICAgICAgd0luQWN0aXZlQ291bnQ7Ci0gICAgVTE2ICAgICAgICAgICAgd0VuUXVldWVDbnQ7Ci0gICAgVTE2ICAgICAgICAgICAgd0ZsYWdzOwotICAgIEJPT0wgICAgICAgICAgIGJQV0JpdE9uOwotICAgIFU4ICAgICAgICAgICAgIGJ5S2V5SW5kZXg7Ci0gICAgVTE2ICAgICAgICAgICAgd1dlcEtleUxlbmd0aDsKLSAgICBVOCAgICAgICAgICAgIGFieVdlcEtleVtXRVBfS0VZTUFYTEVOXTsKKyAgICB1MTYgICAgICAgICAgICB3QUlEOworICAgIHU4ICAgICAgICAgICAgIGFieU1BQ0FkZHJbNl07CisgICAgdTE2ICAgICAgICAgICAgd1R4RGF0YVJhdGU7CisgICAgdTE2ICAgICAgICAgICAgd0luQWN0aXZlQ291bnQ7CisgICAgdTE2ICAgICAgICAgICAgd0VuUXVldWVDbnQ7CisgICAgdTE2ICAgICAgICAgICAgd0ZsYWdzOworICAgIGJvb2wgYlBXQml0T247CisgICAgdTggICAgICAgICAgICAgYnlLZXlJbmRleDsKKyAgICB1MTYgICAgICAgICAgICB3V2VwS2V5TGVuZ3RoOworICAgIHU4ICAgICAgICAgICAgYWJ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FsbGJhY2spOwotICAgICAgICAgICAgcERldmljZS0+Yk1BQ1N1c3BlbmQgPSBGQUxTRTsKKyAgICAgICAgICAgIHBEZXZpY2UtPmJNQUNTdXNwZW5kID0gZmFsc2U7CiAgICAgICAgIH0KICAgICAgICAgc3Bpbl9sb2NrX2lycSgmcERldmljZS0+bG9jayk7CiAgICAgICAgIGlmIChtZW1jbXAocE1nbXQtPmFieUN1cnJCU1NJRCwgJmFieU51bGxBZGRyWzBdLCA2KSA9PSAwKQotICAgICAgICAgICAgQlNTdkNsZWFyQlNTTGlzdCgodm9pZCAqKXBEZXZpY2UsIEZBTFNFKTsKKyAgICAgICAgICAgIEJTU3ZDbGVhckJTU0xpc3QoKHZvaWQgKilwRGV2aWNlLCBmYWxzZSk7CiAgICAgICAgIGVsc2UKICAgICAgICAgICAgIEJTU3ZDbGVhckJTU0xpc3QoKHZvaWQgKilwRGV2aWNlLCBwRGV2aWNlLT5iTGlua1Bhc3MpOwogCkBAIC0xMzAsNyArMTMwLDcgQEAKIAkJCWJyZWFrOwogCQl9OwogCi0gICAgICAgICAgaWYoc1pvbmVUeXBlQ21kLmJXcml0ZT09VFJVRSkgeworICAgICAgICAgIGlmKHNab25lVHlwZUNtZC5iV3JpdGU9PXRydWUpIHsKIAkgIC8vLy8vL3dyaXRlIHpvbmV0eXBlCiAgICAgICAgICAgICAgICAgaWYoc1pvbmVUeXBlQ21kLlpvbmVUeXBlID09IFpvbmVUeXBlX1VTQSkgewogICAgICAgICAgICAgICAgICAgLy9zZXQgdG8gVVNBCkBAIC0xNDcsNyArMTQ3LDcgQEAKICAgICAgICAgICAgIH0KIAllbHNlIHsKICAgICAgICAgICAvLy8vLy8vcmVhZCB6b25ldHlwZQotCSAgQllURSAgICAgICAgICAgICAgICAgICAgICAgem9uZXR5cGU9MDsKKwkgIHVuc2lnbmVkIGNoYXIgem9uZXR5cGU9MDsKIAogCiAgICAgICAgICAgIGlmKHpvbmV0eXBlID09IDB4MDApICB7IC8vVVNBCkB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KLSAgICAgICAgICAgIHBEZXZpY2UtPmJFbmNyeXB0aW9uRW5hYmxlID0gRkFMU0U7CisJICAgIGlmIChzV0VQQ21kLmJFbmFibGVXZXAgIT0gdHJ1ZSkgeworICAgICAgICAgICAgcERldmljZS0+YkVuY3J5cHRpb25FbmFibGUgPSBmYWxzZTsKICAgICAgICAgICAgIHBEZXZpY2UtPmVFbmNyeXB0aW9uU3RhdHVzID0gTmRpczgwMl8xMUVuY3J5cHRpb25EaXNhYmxlZDsKICAgICAgICAgICAgIE1BQ3ZEaXNhYmxlRGVmYXVsdEtleShwRGV2aWNlLT5Qb3J0T2Zmc2V0KTsKICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8gIldFUCBmdW5jdGlvbiBkaXNhYmxlLiBcbiIpOwpAQCAtMjU3LDE1ICsyNTcsMTUgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGR3S2V5SW5kZXgsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzV0VQQ21kLmF1V2VwS2V5TGVuZ3RoW2lpXSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoUEJZVEUpJnNXRVBDbWQuYWJ5V2VwS2V5W2lpXVswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCBjaGFyICopJnNXRVBDbWQuYWJ5V2VwS2V5W2lpXVswXSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEtFWV9DVExfV0VQLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERldmljZS0+UG9ydE9mZnNldCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJ5TG9jYWxJRCk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgICAg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BEZXZpY2UtPlBvcnRPZmZzZXQsIElNUl9NQVNLX1ZBTFVFKTsKICAgICAgICAgICAgIGFkZF90aW1lcigmcE1nbXQtPnNUaW1lclNlY29uZENhbGxiYWNrKTsKLSAgICAgICAgICAgIHBEZXZpY2UtPmJNQUNTdXNwZW5kID0gRkFMU0U7CisgICAgICAgICAgICBwRGV2aWNlLT5iTUFDU3VzcGVuZCA9IGZhbHNlOwogICAgICAgICB9CiAgICAgICAgIGJyZWFrOwogCkBAIC00NTgsMTEgKzQ1OCwxMSBAQAogCQl9OwogCiAJCWlmIChzVmFsdWUuZHdWYWx1ZSA9PSAxKSB7Ci0gICAgICAgICAgICBwRGV2aWNlLT5iRW5hYmxlODAyMXggPSBUUlVFOworICAgICAgICAgICAgcERldmljZS0+YkVuYWJsZTgwMjF4ID0gdHJ1ZTsKICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8gIkVuYWJsZSA4MDIuMXhcbiIpOwogICAgICAgICB9CiAgICAgICAgIGVsc2UgewotICAgICAgICAgICAgcERldmljZS0+YkVuYWJsZTgwMjF4ID0gRkFMU0U7CisgICAgICAgICAgICBwRGV2aWNlLT5iRW5hYmxlODAyMXggPSBmYWxzZTsKICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8gIkRpc2FibGUgODAyLjF4XG4iKTsKICAgICAgICAgfQogCkBAIC00NzgsMTEgKzQ3OCwxMSBAQAogCQl9OwogCiAJCWlmIChzVmFsdWUuZHdWYWx1ZSA9PSAxKSB7Ci0gICAgICAgICAgICBwRGV2aWNlLT5iRW5hYmxlSG9zdFdFUCA9IFRSVUU7CisgICAgICAgICAgICBwRGV2aWNlLT5iRW5hYmxlSG9zdFdFUCA9IHRydWU7CiAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPICJFbmFibGUgSG9zdFdFUFxuIik7CiAgICAgICAgI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9PZmYgPT0gdHJ1ZSkgewogICAgICAgICAgICAgQ0FSRGJSYWRpb1Bvd2VyT24ocERldmljZSk7CiAgICAgICAgICAgICB2TWdyVGltZXJJbml0KHBEZXZpY2UpOwogICAgICAgICAgICAgTUFDdkludEVuYWJsZShwRGV2aWNlLT5Qb3J0T2Zmc2V0LCBJTVJfTUFTS19WQUxVRSk7CkBAIC01NTQsMTIgKzU1NCwxMiBAQAogICAgICAgICBlbHNlCiAgICAgICAgICAgICBwTWdtdC0+d0lCU1NCZWFjb25QZXJpb2QgPSAxMDA7CiAKLSAgICAgICAgaWYgKHNTdGFydEFQQ21kLmJTaGFyZUtleUF1dGggPT0gVFJVRSl7Ci0gICAgICAgICAgICBwTWdtdC0+YlNoYXJlS2V5QWxnb3JpdGhtID0gVFJVRTsKKyAgICAgICAgaWYgKHNTdGFydEFQQ21kLmJTaGFyZUtleUF1dGggPT0gdHJ1ZSl7CisgICAgICAgICAgICBwTWdtdC0+YlNoYXJlS2V5QWxnb3JpdGhtID0gdHJ1ZTsKICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8gIlNoYXJlIEtleSBcbiIpOwogICAgICAgICB9CiAgICAgICAgIGVsc2UgewotICAgICAgICAgICAgcE1nbXQtPmJTaGFyZUtleUFsZ29yaXRobSA9IEZBTFNFOworICAgICAgICAgICAgcE1nbXQtPmJTaGFyZUtleUFsZ29yaXRobSA9IGZhbHNlOwogICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyAiT3BlbiBTeXN0ZW0gXG4iKTsKICAgICAgICAgfQogICAgICAgICBtZW1jcHkocE1nbXQtPmFieUlCU1NTdXBwUmF0ZXMsIGFieVN1cHBSYXRlcywgNik7CkBAIC02MzUsOSArNjM1LDkgQEAKICAgICAJCSAgICBwTm9kZUxpc3QtPnNOb2RlTGlzdFtqal0ud0FJRCA9IHBOb2RlLT53QUlEOwogICAgIAkJICAgI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2MCwgMHg2QywgMHg5MH07CisgICAgdW5zaWduZWQgY2hhciBhYnlTdXBwb3J0ZWRSYXRlc1sxM109IHsweDAyLCAweDA0LCAweDBCLCAweDE2LCAweDBjLCAweDEyLCAweDE4LCAweDI0LCAweDMwLCAweDQ4LCAweDYwLCAweDZDLCAweDkwfTsKIAogCiAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyAiIFNJT0NHSVdSQU5HRSBcbiIpOwpAQCAtNjg4LDcgKzY4OCw3IEBACiAJUFNEZXZpY2UJICAgICAgICBwRGV2aWNlID0gKFBTRGV2aWNlKW5ldGRldl9wcml2KGRldik7CiAgICAgUFNNZ210T2JqZWN0ICAgICAgICBwTWdtdCA9ICYocERldmljZS0+c01nbXRPYmopOwogICAgIGludCByYyA9IDA7Ci0gICAgQllURSAgICAgICAgICAgICAgICAgWmVyb0JTU0lEW1dMQU5fQlNTSURfTEVOXT17MHgwMCwweDAwLDB4MDAsMHgwMCwweDAwLDB4MDB9OworICAgIHVuc2lnbmVkIGNoYXIgWmVyb0JTU0lEW1dMQU5fQlNTSURfTEVOXT17MHgwMCwweDAwLDB4MDAsMHgwMCwweDAwLDB4MDB9OwogCiAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyAiIFNJT0NTSVdBUCBcbiIpOwogaWYgKHBNZ210LT5lU2NhblN0YXRlID09ICBXTUFDX0lTX1NDQU5OSU5HKSB7CkBAIC03MDEsMTIgKzcwMSwxMiBAQAogCWVsc2UgewogCQltZW1jcHkocE1nbXQtPmFieURlc2lyZUJTU0lELCB3cnEtPnNhX2RhdGEsIDYpOwogCQkgICAgICAgICAgICAgICAgLy8yMDA4LTA0MDktMDUsIDxBZGQ+IGJ5IEVpbnNuIExpdQotCQlpZigocERldmljZS0+YkxpbmtQYXNzID09IFRSVUUpICYmCisJCWlmKChwRGV2aWNlLT5iTGlua1Bhc3MgPT0gdHJ1ZSkgJiYKICAgICAgICAgICAgICAgICAgICAgIChtZW1jbXAocE1nbXQtPmFieURlc2lyZUJTU0lELCBwTWdtdC0+YWJ5Q3VyckJTU0lELCA2KT09IDApKXsKIAkJCXJldHVybiByYzsKIAkJCX0KIAkvL21pa2UgOmFkZAotCSBpZiAoKElTX0JST0FEQ0FTVF9BRERSRVNTKHBNZ210LT5hYnlEZXNpcmVCU1NJRCkpIHx8CisJIGlmICgoaXNfYnJvYWRjYXN0X2V0aGVyX2FkZHIocE1nbXQtPmFieURlc2lyZUJTU0lEKSkgfHwKIAkgICAgIChtZW1jbXAocE1nbXQtPmFieURlc2lyZUJTU0lELCBaZXJvQlNTSUQsIDYpID09IDApKXsKIAkgICAgICBQUklOVF9LKCJTSU9DU0lXQVA6aW52YWxpZCBkZXNpcmVkIEJTU0lEIHJldHVybiFcbiIpOwogICAgICAgICAgICAgICAgcmV0dXJuIHJjOwpAQCAtNzE0LDEwICs3MTQsMTAgQEAKICAgICAgICAvL21pa2UgYWRkOiBpZiBkZXNpcmVkIEFQIGlzIGhpZGRlbiBzc2lkKHRoZXJlIGFyZSB0d28gc2FtZSBCU1NJRCBpbiBsaXN0KSwKICAgICAgICAvLyAgICAgICAgICAgICAgICAgIHRoZW4gaWdub3JlLGJlY2F1c2UgeW91IGRvbid0IGtub3duIHdoaWNoIG9uZSB0byBiZSBjb25uZWN0IHdpdGg/PwogICAgICAgIAl7Ci0gICAgICAgICAgIFVJTlQgICAgICAgICAgICBpaSAsIHVTYW1lQnNzaWROdW09MDsKKyAgICAgICAgICAgdW5zaWduZWQgaW50IGlpICwgdVNhbWVCc3NpZE51bT0wOwogICAgICAgICAgICAgICAgICAgZm9yIChpaSA9IDA7IGlpIDwgTUFYX0JTU19OVU07IGlpKyspIHsKICAgICAgICAgICAgICAgICAgICAgIGlmIChwTWdtdC0+c0JTU0xpc3RbaWldLmJBY3RpdmUgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgIElTX0VUSF9BRERSRVNTX0VRVUFMKHBNZ210LT5zQlNT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7CisgICAgICAgICAgIHVuc2lnbmVkIGNoYXIgYWJ5VG1wRGVzaXJlU1NJRFtXTEFOX0lFSERSX0xFTiArIFdMQU5fU1NJRF9NQVhMRU4gKyAxXTsKKwkgIHVuc2lnbmVkIGludCBpaSAsIHVTYW1lQnNzaWROdW09MDsKIAogCSAgbWVtY3B5KGFieVRtcERlc2lyZVNTSUQscE1nbXQtPmFieURlc2lyZVNTSUQsc2l6ZW9mKGFieVRtcERlc2lyZVNTSUQpKTsKICAgICAgICAgICAgIHBDdXJyID0gQlNTcFNlYXJjaEJTU0xpc3QocERldmljZSwKQEAgLTkwNiw3ICs5MDYsNyBAQAogICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICBieSBtZWFucyBvZiBqdWRnaW5nIGlmIHRoZXJlIGFyZSB0d28gc2FtZSBCU1NJRCBleGlzdCBpbiBsaXN0ID8KICAgICAgICAgICAgICAgICAgIGZvciAoaWkgPSAwOyBpaSA8IE1BWF9CU1NfTlVNOyBpaSsrKSB7CiAgICAgICAgICAgICAgICAgICAgICBpZiAocE1nbXQtPnNCU1NMaXN0W2lpXS5iQWN0aXZlICYmCi0gICAgICAgICAgICAgICAgICAgICAgICBJU19FVEhfQUREUkVTU19FUVVBTChwTWdtdC0+c0JTU0xpc3RbaWldLmFieUJTU0lELCBwQ3Vyci0+YWJ5QlNTSUQpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAhY29tcGFyZV9ldGhlcl9hZGRyKHBNZ210LT5zQlNTTGlzdFtpaV0uYWJ5QlNTSUQsIHBDdXJyLT5hYnlCU1NJRCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIHVTYW1lQnNzaWROdW0rKzsKICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgIH0KQEAgLTkyNyw3ICs5MjcsNyBAQAogCX0KIAogICAgIGlmIChwRGV2aWNlLT5mbGFncyAmIERFVklDRV9GTEFHU19PUEVORUQpIHsKLQkgICAgcERldmljZS0+YkNvb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AgICBpZiAocERldmljZS0+YkZpeFJhdGUgPT0gVFJVRSkKLQkgICAgICAgIHdycS0+Zml4ZWQgPSBUUlVFOworCSAgICBpZiAocERldmljZS0+YkZpeFJhdGUgPT0gdHJ1ZSkKKwkgICAgICAgIHdycS0+Zml4ZWQgPSB0cnVlOwogICAgIH0KIAogCkBAIC0xMjk0LDcgKzEyOTQsNyBAQAogewogICAgIFBTRGV2aWNlCSAgICAgICAgcERldmljZSA9IChQU0RldmljZSluZXRkZXZfcHJpdihkZXYpOwogICAgIFBTTWdtdE9iamVjdCAgICAgICAgcE1nbXQgPSAmKHBEZXZpY2UtPnNNZ210T2JqKTsKLQlEV09SRCBkd0tleUluZGV4ID0gKERXT1JEKSh3cnEtPmZsYWdzICYgSVdfRU5DT0RFX0lOREVYKTsKKwl1bnNpZ25lZCBsb25nIGR3S2V5SW5kZXggPSAodW5zaWduZWQgbG9uZykod3JxLT5mbGFncyAmIElXX0VOQ09ERV9JTkRFWCk7CiAJaW50IGlpLHV1LCByYyA9IDA7CiAJaW50IGluZGV4ID0gKHdycS0+ZmxhZ3MgJiBJV19FTkNPREVfSU5ERVgpOwogCkBAIC0xMzU4LDcgKzEzNTgsNyBAQAogICAgICAgICBpZiAocERldmljZS0+ZmxhZ3MgJiBERVZJQ0VfRkxBR1NfT1BFTkVEKSB7CiAgICAgICAgICAgICBzcGluX2xvY2tfaXJxKCZwRGV2aWNlLT5sb2NrKTsKICAgICAgICAgICAgIEtleWJTZXREZWZhdWx0S2V5KCYocERldmljZS0+c0tleSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKERXT1JEKShkd0tleUluZGV4IHwgKDEgPDwgMzEpKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAodW5zaWduZWQgbG9uZykoZHdLZXlJbmRleCB8ICgxIDw8IDMxKSksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAJd3JxLT5sZW5ndGgsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCw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ZmFsc2UpCiAJCXJldHVybiAwOwotCXBNZ210LT5iU2hhcmVLZXlBbGdvcml0aG0gPSBGQUxTRTsKLSAgICAgICAgcERldmljZS0+YkVuY3J5cHRpb25FbmFibGUgPSBGQUxTRTsKKwlwTWdtdC0+YlNoYXJlS2V5QWxnb3JpdGhtID0gZmFsc2U7CisgICAgICAgIHBEZXZpY2UtPmJFbmNyeXB0aW9uRW5hYmxlID0gZmFsc2U7CiAgICAgICAgIHBEZXZpY2UtPmVFbmNyeXB0aW9uU3RhdHVzID0gTmRpczgwMl8xMUVuY3J5cHRpb25EaXNhYmxlZDsKICAgICAgICAgaWYgKHBEZXZpY2UtPmZsYWdzICYgREVWSUNFX0ZMQUdTX09QRU5FRCkgewogICAgICAgICAgICAgc3Bpbl9sb2NrX2lycSgmcERldmljZS0+bG9jayk7CkBAIC0xNDUwLDcgKzE0NTAsNyBAQAogICAgICAgICBpZiAocERldmljZS0+ZmxhZ3MgJiBERVZJQ0VfRkxBR1NfT1BFTkVEKSB7CiAgICAgICAgICAgICBzcGluX2xvY2tfaXJxKCZwRGV2aWNlLT5sb2NrKTsKICAgICAgICAgICAgIEtleWJTZXREZWZhdWx0S2V5KCYocERldmljZS0+c0tleSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKERXT1JEKShwRGV2aWNlLT5ieUtleUluZGV4IHwgKDEgPDwgMzEpKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAodW5zaWduZWQgbG9uZykocERldmljZS0+YnlLZXlJbmRleCB8ICgxIDw8IDMxKSksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERldmljZS0+dUtleUxlbmd0aCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBEZXZpY2UtPmFieUtleSwKQEAgLTE0NjAsMTAgKzE0NjAsMTAgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsKICAgICAgICAgICAgIHNwaW5fdW5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S2V5WzBdLmJLZXlWYWxpZCA9PSBGQUxTRSkgJiYKLSAgICAgICAgICAgIChwVGFibGUtPktleVRhYmxlW2ldLkdyb3VwS2V5WzFdLmJLZXlWYWxpZCA9PSBGQUxTRSkgJiYKLSAgICAgICAgICAgIChwVGFibGUtPktleVRhYmxlW2ldLkdyb3VwS2V5WzJdLmJLZXlWYWxpZCA9PSBGQUxTRSkgJiYKLSAgICAgICAgICAgIChwVGFibGUtPktleVRhYmxlW2ldLkdyb3VwS2V5WzNdLmJLZXlWYWxpZCA9PSBGQUxTRSkKKyAgICAgICAgaWYgKChwVGFibGUtPktleVRhYmxlW2ldLmJJblVzZSA9PSB0cnVlKSAmJgorICAgICAgICAgICAgKHBUYWJsZS0+S2V5VGFibGVbaV0uUGFpcndpc2VLZXkuYktleVZhbGlkID09IGZhbHNlKSAmJgorICAgICAgICAgICAgKHBUYWJsZS0+S2V5VGFibGVbaV0uR3JvdXBLZXlbMF0uYktleVZhbGlkID09IGZhbHNlKSAmJgorICAgICAgICAgICAgKHBUYWJsZS0+S2V5VGFibGVbaV0uR3JvdXBLZXlbMV0uYktleVZhbGlkID09IGZhbHNlKSAmJgorICAgICAgICAgICAgKHBUYWJsZS0+S2V5VGFibGVbaV0uR3JvdXBLZXlbMl0uYktleVZhbGlkID09IGZhbHNlKSAmJgorICAgICAgICAgICAgKHBUYWJsZS0+S2V5VGFibGVbaV0uR3JvdXBLZXlbM10uYktleVZhbGlkID09IGZhbHNlKQogICAgICAgICAgICAgKSB7CiAKLSAgICAgICAgICAgIHBUYWJsZS0+S2V5VGFibGVbaV0uYkluVXNlID0gRkFMU0U7CisgICAgICAgICAgICBwVGFibGUtPktleVRhYmxlW2ldLmJJblVzZSA9IGZhbHNlOwogICAgICAgICAgICAgcFRhYmxlLT5LZXlUYWJsZVtpXS53S2V5Q3RsID0gMDsKLSAgICAgICAgICAgIHBUYWJsZS0+S2V5VGFibGVbaV0uYlNvZnRXRVAgPSBGQUxTRTsKKyAgICAgICAg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GlkID0gZmFsc2U7CiAgICAgICAgICAgICBwVGFibGUtPktleVRhYmxlW2ldLkdyb3VwS2V5W2pqXS5wdktleVRhYmxlID0gKHZvaWQgKikmcFRhYmxlLT5LZXlUYWJsZVtpXTsKICAgICAgICAgfQogICAgICAgICBwVGFibGUtPktleVRhYmxlW2ldLndLZXlDdGwgPSAwOwogICAgICAgICBwVGFibGUtPktleVRhYmxlW2ldLmR3R1RLZXlJbmRleCA9IDA7Ci0gICAgICAgIHBUYWJsZS0+S2V5VGFibGVbaV0uYlNvZnRXRVAgPSBGQUxTRTsKKyAgICAgICAgcFRhYmxlLT5LZXlUYWJsZVtpXS5iU29mdFdFUCA9IGZhbHNlOwogICAgICAgICBNQUN2RGlzYWJsZUtleUVudHJ5KGR3SW9CYXNlLCBpKTsKICAgICB9CiB9CkBAIC0xMjgsMTMgKzEyOCwxMyBAQAogICogIE91dDoKICAqICAgICAgcEtleSAgICAgICAgICAgIC0gS2V5IHJldHVybgogICoKLSAqIFJldHVybiBWYWx1ZTogVFJVRSBpZiBmb3VuZCBvdGhlcndpc2UgRkFMU0UKKyAqIFJldHVybiBWYWx1ZTogdHJ1ZSBpZiBmb3VuZCBvdGhlcndpc2UgZmFsc2UKICAqCiAgKi8KLUJPT0wgS2V5YkdldEtleSAoCitib29sIEtleWJHZXRLZXkgKAogICAgIFBTS2V5TWFuYWdlbWVudCBwVGFibGUsCi0gICAgUEJZVEUgICAgICAgICAgIHBieUJTU0lELAotICAgIERXT1JEICAgICAgICAgICBkd0tleUluZGV4LAorICAgIHVuc2lnbmVkIGNoYXIgKnBieUJTU0lELAorICAgIHVuc2lnbmVkIGxvbmcgZHdLZXlJbmRleCwKICAgICBQU0tleUl0ZW0gICAgICAgKnBLZXkKICAgICApCiB7CkBAIC0xNDQsMzEgKzE0NCwzMSBAQAogCiAgICAgKnBLZXkgPSBOVUxMOwogICAgIGZvciAoaT0wO2k8TUFYX0tFWV9UQUJMRTtpKyspIHsKLSAgICAgICAgaWYgKChwVGFibGUtPktleVRhYmxlW2ldLmJJblVzZSA9PSBUUlVFKSAmJgotICAgICAgICAgICAgSVNfRVRIX0FERFJFU1NfRVFVQUwocFRhYmxlLT5LZXlUYWJsZVtpXS5hYnlCU1NJRCxwYnlCU1NJRCkpIHsKKyAgICAgICAgaWYgKChwVGFibGUtPktleVRhYmxlW2ldLmJJblVzZSA9PSB0cnVlKSAmJgorICAgICAgICAgICAgIWNvbXBhcmVfZXRoZXJfYWRkcihwVGFibGUtPktleVRhYmxlW2ldLmFieUJTU0lELCBwYnlCU1NJRCkpIHsKICAgICAgICAgICAgIGlmIChkd0tleUluZGV4ID09IDB4RkZGRkZGRkYpIHsKLSAgICAgICAgICAgICAgICBpZiAocFRhYmxlLT5LZXlUYWJsZVtpXS5QYWlyd2lzZUtleS5iS2V5VmFsaWQgPT0gVFJVRSkgeworICAgICAgICAgICAgICAgIGlmIChwVGFibGUtPktleVRhYmxlW2ldLlBhaXJ3aXNlS2V5LmJLZXlWYWxpZCA9PSB0cnVlKSB7CiAgICAgICAgICAgICAgICAgICAgICpwS2V5ID0gJihwVGFibGUtPktleVRhYmxlW2ldLlBhaXJ3aXNlS2V5KTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChUUlVFKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuICh0cnVlKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiAoRkFMU0UpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gKGZhbHNlKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9IGVsc2UgaWYgKGR3S2V5SW5kZXggPCBNQVhfR1JPVVBfS0VZKSB7Ci0gICAgICAgICAgICAgICAgaWYgKHBUYWJsZS0+S2V5VGFibGVbaV0uR3JvdXBLZXlbZHdLZXlJbmRleF0uYktleVZhbGlkID09IFRSVUUpIHsKKyAgICAgICAgICAgICAgICBpZiAocFRhYmxlLT5LZXlUYWJsZVtpXS5Hcm91cEtleVtkd0tleUluZGV4XS5iS2V5VmFsaWQgPT0gdHJ1ZSkgewogICAgICAgICAgICAgICAgICAgICAqcEtleSA9ICYocFRhYmxlLT5LZXlUYWJsZVtpXS5Hcm91cEtleVtkd0tleUluZGV4XSk7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiAoVFJVRSk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiAodHJ1ZSk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGVsc2UgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gKEZBTFNFKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChmYWxzZSk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIChGQUxTRSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIChmYWxzZSk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9Ci0gICAgcmV0dXJuIChGQUxTRSk7CisgICAgcmV0dXJuIChmYWxzZSk7CiB9CiAKIApAQCAtMTg2LDM3ICsxODYsMzcgQEAKICAqICBPdXQ6CiAgKiAgICAgIG5vbmUKICAqCi0gKiBSZXR1cm4gVmFsdWU6IFRSVUUgaWYgc3VjY2VzcyBvdGhlcndpc2UgRkFMU0UKKyAqIFJldHVybiBWYWx1ZTogdHJ1ZSBpZiBzdWNjZXNzIG90aGVyd2lzZSBmYWxzZQogICoKICAqLwotQk9PTCBLZXliU2V0S2V5ICgKK2Jvb2wgS2V5YlNldEtleSAoCiAgICAgUFNLZXlNYW5hZ2VtZW50IHBUYWJsZSwKLSAgICBQQllURSAgICAgICAgICAgcGJ5QlNTSUQsCi0gICAgRFdPUkQgICAgICAgICAgIGR3S2V5SW5kZXgsCi0gICAgVUxPTkcgICAgICAgICAgIHVLZXlMZW5ndGgsCisgICAgdW5zaWduZWQgY2hhciAqcGJ5QlNTSUQsCisgICAgdW5zaWduZWQgbG9uZyBkd0tleUluZGV4LAorICAgIHVuc2lnbmVkIGxvbmcgdUtleUxlbmd0aCwKICAgICBQUVdPUkQgICAgICAgICAgcEtleVJTQywKLSAgICBQQllURSAgICAgICAgICAgcGJ5S2V5LAotICAgIEJZVEUgICAgICAgICAgICBieUtleURlY01vZGUsCi0gICAgRFdPUkRfUFRSICAgICAgIGR3SW9CYXNlLAotICAgIEJZVEUgICAgICAgICAgICBieUxvY2FsSUQKKyAgICB1bnNpZ25lZCBjaGFyICpwYnlLZXksCisgICAgdW5zaWduZWQgY2hhciBieUtleURlY01vZGUsCisgICAgdW5zaWduZWQgbG9uZyBkd0lvQmFzZSwKKyAgICB1bnNpZ25lZCBjaGFyIGJ5TG9jYWxJRAogICAgICkKIHsKICAgICBpbnQgICAgICAgICBpLGo7Ci0gICAgVUlOVCAgICAgICAgaWk7CisgICAgdW5zaWduZWQgaW50IGlpOwogICAgIFBTS2V5SXRlbSAgIHBLZXk7Ci0gICAgVUlOVCAgICAgICAgdUtleUlkeDsKKyAgICB1bnNpZ25lZCBpbnQgdUtleUlkeDsKIAogICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8iRW50ZXIgS2V5YlNldEtleTogJWxYXG4iLCBkd0tleUluZGV4KTsKIAogICAgIGogPSAoTUFYX0tFWV9UQUJMRS0xKTsKICAgICBmb3IgKGk9MDtpPChNQVhfS0VZX1RBQkxFLTEpO2krKykgewotICAgICAgICBpZiAoKHBUYWJsZS0+S2V5VGFibGVbaV0uYkluVXNlID09IEZBTFNFKSAmJgorICAgICAgICBpZiAoKHBUYWJsZS0+S2V5VGFibGVbaV0uYkluVXNlID09IGZhbHNlKSAmJgogICAgICAgICAgICAgKGogPT0gKE1BWF9LRVlfVEFCTEUtMSkpKSB7CiAgICAgICAgICAgICAvLyBmb3VuZCBlbXB0eSB0YWJsZQogICAgICAgICAgICAgaiA9IGk7CiAgICAgICAgIH0KLSAgICAgICAgaWYgKChwVGFibGUtPktleVRhYmxlW2ldLmJJblVzZSA9PSBUUlVFKSAmJgotICAgICAgICAgICAgSVNfRVRIX0FERFJFU1NfRVFVQUwocFRhYmxlLT5LZXlUYWJsZVtpXS5hYnlCU1NJRCxwYnlCU1NJRCkpIHsKKyAgICAgICAgaWYgKChwVGFibGUtPktleVRhYmxlW2ldLmJJblVzZSA9PSB0cnVlKSAmJgorICAgICAgICAgICAgIWNvbXBhcmVfZXRoZXJfYWRkcihwVGFibGUtPktleVRhYmxlW2ldLmFieUJTU0lELCBwYnlCU1NJRCkpIHsKICAgICAgICAgICAgIC8vIGZvdW5kIHRhYmxlIGFscmVhZHkgZXhpc3QKICAgICAgICAgICAgIGlmICgoZHdLZXlJbmRleCAmIFBBSVJXSVNFX0tFWSkgIT0gMCkgewogICAgICAgICAgICAgICAgIC8vIFBhaXJ3aXNlIGtleQpAQCAtMjI3LDcgKzIyNyw3IEBACiAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgIC8vIEdyb3VwIGtleQogICAgICAgICAgICAgICAgIGlmICgoZHdLZXlJbmRleCAmIDB4MDAwMDAwRkYpID49IE1BWF9HUk9VUF9LRVkpCi0gICAgICAgICAgICAgICAgICAgIHJldHVybiAoRkFMU0UpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gKGZhbHNlKTsKICAgICAgICAgICAgICAgICBwS2V5ID0gJihwVGFibGUtPktleVRhYmxlW2ldLkdyb3VwS2V5W2R3S2V5SW5kZXggJiAweDAwMDAwMEZGXSk7CiAgICAgICAgICAgICAgICAgaWYgKChkd0tleUluZGV4ICYgVFJBTlNNSVRfS0VZKSAhPSAwKSAgewogICAgICAgICAgICAgICAgICAgICAvLyBHcm91cCB0cmFuc21pdCBrZXkKQEAgLTI0MSw3ICsyNDEsNyBAQAogICAgICAgICAgICAgfQogICAgICAgICAgICAgcFRhYmxlLT5LZXlUYWJsZVtpXS53S2V5Q3RsIHw9IDB4ODAwMDsgICAgICAgICAgICAgIC8vIGVuYWJsZSBvbi1mbHkKIAotICAgICAgICAgICAgcEtleS0+YktleVZhbGlkID0gVFJVRTsKKyAgICAgICAgICAgIHBLZXktPmJLZXlWYWxpZCA9IHRydWU7CiAgICAgICAgICAgICBwS2V5LT51S2V5TGVuZ3RoID0gdUtleUxlbmd0aDsKICAgICAgICAgICAgIHBLZXktPmR3S2V5SW5kZXggPSBkd0tleUluZGV4OwogICAgICAgICAgICAgcEtleS0+YnlDaXBoZXJTdWl0ZSA9IGJ5S2V5RGVjTW9kZTsKQEAgLTI1Miw3ICsyNTIsNyBAQAogICAgICAgICAgICAgICAgIGlmICh1S2V5TGVuZ3RoID09IFdMQU5fV0VQMTA0X0tFWUxFTikKICAgICAgICAgICAgICAgICAgICAgcEtleS0+YWJ5S2V5WzE1XSB8PSAweDgwOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgTUFDdlNldEtleUVudHJ5KGR3SW9CYXNlLCBwVGFibGUtPktleVRhYmxlW2ldLndLZXlDdGwsIGksIHVLZXlJZHgsIHBieUJTU0lELCAoUERXT1JEKXBLZXktPmFieUtleSwgYnlMb2NhbElEKTsKKyAgICAgICAgICAgIE1BQ3ZTZXRLZXlFbnRyeShkd0lvQmFzZSwgcFRhYmxlLT5LZXlUYWJsZVtpXS53S2V5Q3RsLCBpLCB1S2V5SWR4LCBwYnlCU1NJRCwgKHVuc2lnbmVkIGxvbmcgKilwS2V5LT5hYnlLZXksIGJ5TG9jYWxJRCk7CiAKICAgICAgICAgICAgIGlmICgoZHdLZXlJbmRleCAmIFVTRV9LRVlSU0MpID09IDApIHsKICAgICAgICAgICAgICAgICAvLyBSU0Mgc2V0IGJ5IE5JQwpAQCAtMjc3LDEyICsyNzcsMTIgQEAKICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8icEtleS0+d1RTQzE1XzA6ICV4XG4gIiwgcEtleS0+d1RTQzE1XzApOwogICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyJwS2V5LT5kd0tleUluZGV4OiAlbHhcbiAiLCBwS2V5LT5kd0tleUluZGV4KTsKIAotICAgICAgICAgICAgcmV0dXJuIChUUlVFKTsKKyAgICAgICAgICAgIHJldHVybiAodHJ1ZSk7CiAgICAgICAgIH0KICAgICB9CiAgICAgaWYgKGogPCAoTUFYX0tFWV9UQUJMRS0xKSkgewogICAgICAgICBtZW1jcHkocFRhYmxlLT5LZXlUYWJsZVtqXS5hYnlCU1NJRCxwYnlCU1NJRCxFVEhfQUxFTik7Ci0gICAgICAgIHBUYWJsZS0+S2V5VGFibGVbal0uYkluVXNlID0gVFJVRTsKKyAgICAgICAgcFRhYmxlLT5LZXlUYWJsZVtqXS5iSW5Vc2UgPSB0cnVlOwogICAgICAgICBpZiAoKGR3S2V5SW5kZXggJiBQQUlSV0lTRV9LRVkpICE9IDApICB7CiAgICAgICAgICAgICAvLyBQYWlyd2lzZSBrZXkKICAgICAgICAgICAgIHBLZXkgPSAmKHBUYWJsZS0+S2V5VGFibGVbal0uUGFpcndpc2VLZXkpOwpAQCAtMjkyLDcgKzI5Miw3IEBACiAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAvLyBHcm91cCBrZXkKICAgICAgICAgICAgIGlmICgoZHdLZXlJbmRleCAmIDB4MDAwMDAwRkYpID49IE1BWF9HUk9VUF9LRVkpCi0gICAgICAgICAgICAgICAgcmV0dXJuIChGQUxTRSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIChmYWxzZSk7CiAgICAgICAgICAgICBwS2V5ID0gJihwVGFibGUtPktleVRhYmxlW2pdLkdyb3VwS2V5W2R3S2V5SW5kZXggJiAweDAwMDAwMEZGXSk7CiAgICAgICAgICAgICBpZiAoKGR3S2V5SW5kZXggJiBUUkFOU01JVF9LRVkpICE9IDApICB7CiAgICAgICAgICAgICAgICAgLy8gR3JvdXAgdHJhbnNtaXQga2V5CkBAIC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k9MDtpPE1BWF9LRVlfVEFCTEU7aSsrKSB7Ci0gICAgICAgICAgICAgICAgcFRhYmxlLT5LZXlUYWJsZVtpXS5QYWlyd2lzZUtleS5iS2V5VmFsaWQgPSBGQUxTRTsKKyAgICAgICAgICAgICAgICBwVGFibGUtPktleVRhYmxlW2ldLlBhaXJ3aXNlS2V5LmJLZXlWYWxpZCA9IGZhbHNlOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgc192Q2hlY2tLZXlUYWJsZVZhbGlkKHBUYWJsZSwgZHdJb0Jhc2UpOwotICAgICAgICAgICAgcmV0dXJuIFRSVUU7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgfQogICAgICAgICBlbHNlIGlmICgoZHdLZXlJbmRleCAmIDB4MDAwMDAwRkYpIDwgTUFYX0dST1VQX0tFWSkgewogICAgICAgICAgICAgZm9yIChpPTA7aTxNQVhfS0VZX1RBQkxFO2krKykgewotICAgICAgICAgICAgICAgIHBUYWJsZS0+S2V5VGFibGVbaV0uR3JvdXBLZXlbZHdLZXlJbmRleCAmIDB4MDAwMDAwRkZdLmJLZXlWYWxpZCA9IEZBTFNFOworICAgICAgICAgICAgICAgIHBUYWJsZS0+S2V5VGFibGVbaV0uR3JvdXBLZXlbZHdLZXlJbmRleCAmIDB4MDAwMDAwRkZdLmJLZXlWYWxpZCA9IGZhbHNlOwogICAgICAgICAgICAgICAgIGlmICgoZHdLZXlJbmRleCAmIDB4N0ZGRkZGRkYpID09IChwVGFibGUtPktleVRhYmxlW2ldLmR3R1RLZXlJbmRleCAmIDB4N0ZGRkZGRkYpKSB7CiAgICAgICAgICAgICAgICAgICAgIC8vIHJlbW92ZSBHcm91cCB0cmFuc21pdCBrZXkKICAgICAgICAgICAgICAgICAgICAgcFRhYmxlLT5LZXlUYWJsZVtpXS5kd0dUS2V5SW5kZXggPSAwOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgICAgIHNfdkNoZWNrS2V5VGFibGVWYWxpZChwVGFibGUsIGR3SW9CYXNlKTsKLSAgICAgICAgICAgIHJldHVybiBUUlVFOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgIH0KICAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgICByZXR1cm4gRkFMU0U7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgIH0KICAgICB9CiAKICAgICBmb3IgKGk9MDtpPE1BWF9LRVlfVEFCTEU7aSsrKSB7Ci0gICAgICAgIGlmICgocFRhYmxlLT5LZXlUYWJsZVtpXS5iSW5Vc2UgPT0gVFJVRSkgJiYKLSAgICAgICAgICAgIElTX0VUSF9BRERSRVNTX0VRVUFMKHBUYWJsZS0+S2V5VGFibGVbaV0uYWJ5QlNTSUQscGJ5QlNTSUQpKSB7CisgICAgICAgIGlmICgocFRhYmxlLT5LZXlUYWJsZVtpXS5iSW5Vc2UgPT0gdHJ1ZSkgJiYKKyAgICAgICAgICAgICFjb21wYXJlX2V0aGVyX2FkZHIocFRhYmxlLT5LZXlUYWJsZVtpXS5hYnlCU1NJRCwgcGJ5QlNTSUQpKSB7CiAgICAgICAgICAgICBpZiAoKGR3S2V5SW5kZXggJiBQQUlSV0lTRV9LRVkpICE9IDApIHsKLSAgICAgICAgICAgICAgICBwVGFibGUtPktleVRhYmxlW2ldLlBhaXJ3aXNlS2V5LmJLZXlWYWxpZCA9IEZBTFNFOworICAgICAgICAgICAgICAgIHBUYWJsZS0+S2V5VGFibGVbaV0uUGFpcndpc2VLZXkuYktleVZhbGlkID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgc192Q2hlY2tLZXlUYWJsZVZhbGlkKHBUYWJsZSwgZHdJb0Jhc2UpOwotICAgICAgICAgICAgICAgIHJldHVybiAoVFJVRSk7CisgICAgICAgICAgICAgICAgcmV0dXJuICh0cnVlKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGVsc2UgaWYgKChkd0tleUluZGV4ICYgMHgwMDAwMDBGRikgPCBNQVhfR1JPVVBfS0VZKSB7Ci0gICAgICAgICAgICAgICAgcFRhYmxlLT5LZXlUYWJsZVtpXS5Hcm91cEtleVtkd0tleUluZGV4ICYgMHgwMDAwMDBGRl0uYktleVZhbGlkID0gRkFMU0U7CisgICAgICAgICAgICAgICAgcFRhYmxlLT5LZXlUYWJsZVtpXS5Hcm91cEtleVtkd0tleUluZGV4ICYgMHgwMDAwMDBGRl0uYktleVZhbGlkID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgaWYgKChkd0tleUluZGV4ICYgMHg3RkZGRkZGRikgPT0gKHBUYWJsZS0+S2V5VGFibGVbaV0uZHdHVEtleUluZGV4ICYgMHg3RkZGRkZGRikpIHsKICAgICAgICAgICAgICAgICAgICAgLy8gcmVtb3ZlIEdyb3VwIHRyYW5zbWl0IGtleQogICAgICAgICAgICAgICAgICAgICBwVGFibGUtPktleVRhYmxlW2ldLmR3R1RLZXlJbmRleCA9IDA7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIHNfdkNoZWNrS2V5VGFibGVWYWxpZChwVGFibGUsIGR3SW9CYXNlKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gKFRSVUUpOworICAgICAgICAgICAgICAgIHJldHVybiAodHJ1ZSk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBlbHNlIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gKEZBTFNFKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gKGZhbHNlKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KLSAgICByZXR1cm4gKEZBTFNFKTsKKyAgICByZXR1cm4gKGZhbHNlKTsKIH0KIAogCkBAIC00MzIsMzAgKzQzMiwzMCBAQAogICogIE91dDoKICAqICAgICAgbm9uZQogICoKLSAqIFJldHVybiBWYWx1ZTogVFJVRSBpZiBzdWNjZXNzIG90aGVyd2lzZSBGQUxTRQorICogUmV0dXJuIFZhbHVlOiB0cnVlIGlmIHN1Y2Nlc3Mgb3RoZXJ3aXNlIGZhbHNlCiAgKgogICovCi1CT09MIEtleWJSZW1vdmVBbGxLZXkgKAorYm9vbCBLZXliUmVtb3ZlQWxsS2V5ICgKICAgICBQU0tleU1hbmFnZW1lbnQgcFRhYmxlLAotICAgIFBCWVRFICAgICAgICAgICBwYnlCU1NJRCwKLSAgICBEV09SRF9QVFIgICAgICAgZHdJb0Jhc2UKKyAgICB1bnNpZ25lZCBjaGFyICpwYnlCU1NJRCwKKyAgICB1bnNpZ25lZCBsb25nIGR3SW9CYXNlCiAgICAgKQogewogICAgIGludCAgaSx1OwogCiAgICAgZm9yIChpPTA7aTxNQVhfS0VZX1RBQkxFO2krKykgewotICAgICAgICBpZiAoKHBUYWJsZS0+S2V5VGFibGVbaV0uYkluVXNlID09IFRSVUUpICYmCi0gICAgICAgICAgICBJU19FVEhfQUREUkVTU19FUVVBTChwVGFibGUtPktleVRhYmxlW2ldLmFieUJTU0lELHBieUJTU0lEKSkgewotICAgICAgICAgICAgcFRhYmxlLT5LZXlUYWJsZVtpXS5QYWlyd2lzZUtleS5iS2V5VmFsaWQgPSBGQUxTRTsKKyAgICAgICAgaWYgKChwVGFibGUtPktleVRhYmxlW2ldLmJJblVzZSA9PSB0cnVlKSAmJgorICAgICAgICAgICAgIWNvbXBhcmVfZXRoZXJfYWRkcihwVGFibGUtPktleVRhYmxlW2ldLmFieUJTU0lELCBwYnlCU1NJRCkpIHsKKyAgICAgICAgICAgIHBUYWJsZS0+S2V5VGFibGVbaV0uUGFpcndpc2VLZXkuYktleVZhbGlkID0gZmFsc2U7CiAgICAgICAgICAgICBmb3IodT0wO3U8TUFYX0dST1VQX0tFWTt1KyspIHsKLSAgICAgICAgICAgICAgICBwVGFibGUtPktleVRhYmxlW2ldLkdyb3VwS2V5W3VdLmJLZXlWYWxpZCA9IEZBTFNFOworICAgICAgICAgICAgICAgIHBUYWJsZS0+S2V5VGFibGVbaV0uR3JvdXBLZXlbdV0uYktleVZhbGlkID0gZmFsc2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UKICAqCiAgKi8KLUJPT0wgS2V5YkdldFRyYW5zbWl0S2V5ICgKK2Jvb2wgS2V5YkdldFRyYW5zbWl0S2V5ICgKICAgICBQU0tleU1hbmFnZW1lbnQgcFRhYmxlLAotICAgIFBCWVRFICAgICAgICAgICBwYnlCU1NJRCwKLSAgICBEV09SRCAgICAgICAgICAgZHdLZXlUeXBlLAorICAgIHVuc2lnbmVkIGNoYXIgKnBieUJTU0lELAorICAgIHVuc2lnbmVkIGxvbmcgZHdLZXlUeXBlLAogICAgIFBTS2V5SXRlbSAgICAgICAqcEtleQogICAgICkKIHsKQEAgLTUyOCwxMiArNTI4LDEyIEBACiAKICAgICAqcEtleSA9IE5VTEw7CiAgICAgZm9yIChpPTA7aTxNQVhfS0VZX1RBQkxFO2krKykgewotICAgICAgICBpZiAoKHBUYWJsZS0+S2V5VGFibGVbaV0uYkluVXNlID09IFRSVUUpICYmCi0gICAgICAgICAgICBJU19FVEhfQUREUkVTU19FUVVBTChwVGFibGUtPktleVRhYmxlW2ldLmFieUJTU0lELHBieUJTU0lEKSkgeworICAgICAgICBpZiAoKHBUYWJsZS0+S2V5VGFibGVbaV0uYkluVXNlID09IHRydWUpICYmCisgICAgICAgICAgICAhY29tcGFyZV9ldGhlcl9hZGRyKHBUYWJsZS0+S2V5VGFibGVbaV0uYWJ5QlNTSUQsIHBieUJTU0lEKSkgewogCiAgICAgICAgICAgICBpZiAoZHdLZXlUeXBlID09IFBBSVJXSVNFX0tFWSkgewogCi0gICAgICAgICAgICAgICAgaWYgKHBUYWJsZS0+S2V5VGFibGVbaV0uUGFpcndpc2VLZXkuYktleVZhbGlkID09IFRSVUUpIHsKKyAgICAgICAgICAgICAgICBpZiAocFRhYmxlLT5LZXlUYWJsZVtpXS5QYWlyd2lzZUtleS5iS2V5VmFsaWQgPT0gdHJ1ZSkgewogICAgICAgICAgICAgICAgICAgICAqcEtleSA9ICYocFRhYmxlLT5LZXlUYWJsZVtpXS5QYWlyd2lzZUtleSk7CiAKICAgICAgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyJLZXliR2V0VHJhbnNtaXRLZXk6Iik7CkBAIC01NDQsMTkgKzU0NCwxOSBAQAogICAgICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPIlxuIik7CiAKIAotICAgICAgICAgICAgICAgICAgICByZXR1cm4gKFRSVUUpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gKHRydWUpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyJQYWlyd2lzZUtleS5iS2V5VmFsaWQgPT0gRkFMU0VcbiIpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gKEZBTFNFKTsKKyAgICAgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyJQYWlyd2lzZUtleS5iS2V5VmFsaWQgPT0gZmFsc2VcbiIpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gKGZhbHNlKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9IC8vIEVuZCBvZiBUeXBlID09IFBBSVJXSVNFCiAgICAgICAgICAgICBlbHNlIHsKICAgICAgICAgICAgICAgICBpZiAocFRhYmxlLT5LZXlUYWJsZVtpXS5kd0dUS2V5SW5kZXggPT0gMCkgewogICAgICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPIkVSUk9SOiBkd0dUS2V5SW5kZXggPT0gMCAhISFcbiIpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gRkFMU0U7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKHBUYWJsZS0+S2V5VGFibGVbaV0uR3JvdXBLZXlbKHBUYWJsZS0+S2V5VGFibGVbaV0uZHdHVEtleUluZGV4JjB4MDAwMDAwRkYpXS5iS2V5VmFsaWQgPT0gVFJVRSkgeworICAgICAgICAgICAgICAgIGlmIChwVGFibGUtPktleVRhYmxlW2ldLkdyb3VwS2V5WyhwVGFibGUtPktleVRhYmxlW2ldLmR3R1RLZXlJbmRleCYweDAwMDAwMEZGKV0uYktleVZhbGlkID09IHRydWUpIHsKICAgICAgICAgICAgICAgICAgICAgKnBLZXkgPSAmKHBUYWJsZS0+S2V5VGFibGVbaV0uR3JvdXBLZXlbKHBUYWJsZS0+S2V5VGFibGVbaV0uZHdHVEtleUluZGV4JjB4MDAwMDAwRkYpXSk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8iS2V5YkdldFRyYW5zbWl0S2V5OiIpOwpAQCAtNTY3LDExICs1NjcsMTEgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8iXG4iKTsKICAgICAgICAgICAgICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8iZHdHVEtleUluZGV4OiAlbFhcbiIsIHBUYWJsZS0+S2V5VGFibGVbaV0uZHdHVEtleUluZGV4KTsKIAotICAgICAgICAgICAgICAgICAgICByZXR1cm4gKFRSVUUpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gKHRydWUpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyJHcm91cEtleS5iS2V5VmFsaWQgPT0gRkFMU0VcbiIpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gKEZBTFNFKTsKKyAgICAgICAgICAgICAgIC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2V5VmFsaWQgPT0gVFJVRSkpIHsKKyAgICAgICAgaWYgKChwVGFibGUtPktleVRhYmxlW2ldLmJJblVzZSA9PSB0cnVlKSAmJgorICAgICAgICAgICAgKHBUYWJsZS0+S2V5VGFibGVbaV0uUGFpcndpc2VLZXkuYktleVZhbGlkID09IHRydWUpKSB7CiAgICAgICAgICAgICAqcEtleSA9ICYocFRhYmxlLT5LZXlUYWJsZVtpXS5QYWlyd2lzZUtleSk7Ci0gICAgICAgICAgICByZXR1cm4gKFRSVUUpOworICAgICAgICAgICAgcmV0dXJuICh0cnVlKTsKICAgICAgICAgfQogICAgIH0KLSAgICByZXR1cm4gKEZBTFNFKTsKKyAgICByZXR1cm4gKGZhbHNlKTsKIH0KIAogLyoKQEAgLTYyOCwzNCArNjI4LDM0IEBACiAgKiAgT3V0OgogICogICAgICBub25lCiAgKgotICogUmV0dXJuIFZhbHVlOiBUUlVFIGlmIHN1Y2Nlc3Mgb3RoZXJ3aXNlIEZBTFNFCisgKiBSZXR1cm4gVmFsdWU6IHRydWUgaWYgc3VjY2VzcyBvdGhlcndpc2UgZmFsc2UKICAqCiAgKi8KLUJPT0wgS2V5YlNldERlZmF1bHRLZXkgKAorYm9vbCBLZXliU2V0RGVmYXVsdEtleSAoCiAgICAgUFNLZXlNYW5hZ2VtZW50IHBUYWJsZSwKLSAgICBEV09SRCAgICAgICAgICAgZHdLZXlJbmRleCwKLSAgICBVTE9ORyAgICAgICAgICAgdUtleUxlbmd0aCwKKyAgICB1bnNpZ25lZCBsb25nIGR3S2V5SW5kZXgsCisgICAgdW5zaWduZWQgbG9uZyB1S2V5TGVuZ3RoLAogICAgIFBRV09SRCAgICAgICAgICBwS2V5UlNDLAotICAgIFBCWVRFICAgICAgICAgICBwYnlLZXksCi0gICAgQllURSAgICAgICAgICAgIGJ5S2V5RGVjTW9kZSwKLSAgICBEV09SRF9QVFIgICAgICAgZHdJb0Jhc2UsCi0gICAgQllURSAgICAgICAgICAgIGJ5TG9jYWxJRAorICAgIHVuc2lnbmVkIGNoYXIgKnBieUtleSwKKyAgICB1bnNpZ25lZCBjaGFyIGJ5S2V5RGVjTW9kZSwKKyAgICB1bnNpZ25lZCBsb25nIGR3SW9CYXNlLAorICAgIHVuc2lnbmVkIGNoYXIgYnlMb2NhbElECiAgICAgKQogewotICAgIFVJTlQgICAgICAgIGlpOworICAgIHVuc2lnbmVkIGludCBpaTsKICAgICBQU0tleUl0ZW0gICBwS2V5OwotICAgIFVJTlQgICAgICAgIHVLZXlJZHg7CisgICAgdW5zaWduZWQgaW50IHVLZXlJZHg7CiAKICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPIkVudGVyIEtleWJTZXREZWZhdWx0S2V5OiAlMXgsICVkIFxuIiwgKGludClkd0tleUluZGV4LCAoaW50KXVLZXlMZW5ndGgpOwogCiAKICAgICBpZiAoKGR3S2V5SW5kZXggJiBQQUlSV0lTRV9LRVkpICE9IDApIHsgICAgICAgICAgICAgICAgICAvLyBQYWlyd2lzZSBrZXkKLSAgICAgICAgcmV0dXJuIChGQUxTRSk7CisgICAgICAgIHJldHVybiAoZmFsc2UpOwogICAgIH0gZWxzZSBpZiAoKGR3S2V5SW5kZXggJiAweDAwMDAwMEZGKSA+PSBNQVhfR1JPVVBfS0VZKSB7Ci0gICAgICAgIHJldHVybiAoRkFMU0UpOworICAgICAgICByZXR1cm4gKGZhbHNlKTsKICAgICB9CiAKLSAgICBwVGFibGUtPktleVRhYmxlW01BWF9LRVlfVEFCTEUtMV0uYkluVXNlID0gVFJVRTsKKyAgICBwVGFibGUtPktleVRhYmxlW01BWF9LRVlfVEFCTEUtMV0uYkluVXNlID0gdHJ1ZTsKICAgICBmb3IoaWk9MDtpaTxFVEhfQUxFTjtpaSsrKQogICAgICAgICBwVGFibGUtPktleVRhYmxlW01BWF9LRVlfVEFCTEUtMV0uYWJ5QlNTSURbaWldID0gMHhGRjsKIApAQCAtNjc2LDEzICs2NzYsMTMgQEAKICAgICBpZ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sdWU6IHRydWUgaWYgc3VjY2VzcyBvdGhlcndpc2UgZmFsc2UKICAqCiAgKi8KLUJPT0wgS2V5YlNldEFsbEdyb3VwS2V5ICgKK2Jvb2wgS2V5YlNldEFsbEdyb3VwS2V5ICgKICAgICBQU0tleU1hbmFnZW1lbnQgcFRhYmxlLAotICAgIERXT1JEICAgICAgICAgICBkd0tleUluZGV4LAotICAgIFVMT05HICAgICAgICAgICB1S2V5TGVuZ3RoLAorICAgIHVuc2lnbmVkIGxvbmcgZHdLZXlJbmRleCwKKyAgICB1bnNpZ25lZCBsb25nIHVLZXlMZW5ndGgsCiAgICAgUFFXT1JEICAgICAgICAgIHBLZXlSU0MsCi0gICAgUEJZVEUgICAgICAgICAgIHBieUtleSwKLSAgICBCWVRFICAgICAgICAgICAgYnlLZXlEZWNNb2RlLAotICAgIERXT1JEX1BUUiAgICAgICBkd0lvQmFzZSwKLSAgICBCWVRFICAgICAgICAgICAgYnlMb2NhbElECisgICAgdW5zaWduZWQgY2hhciAqcGJ5S2V5LAorICAgIHVuc2lnbmVkIGNoYXIgYnlLZXlEZWNNb2RlLAorICAgIHVuc2lnbmVkIGxvbmcgZHdJb0Jhc2UsCisgICAgdW5zaWduZWQgY2hhciBieUxvY2FsSUQKICAgICApCiB7CiAgICAgaW50ICAgICAgICAgaTsKLSAgICBVSU5UICAgICAgICBpaTsKKyAgICB1bnNpZ25lZCBpbnQgaWk7CiAgICAgUFNLZXlJdGVtICAgcEtleTsKLSAgICBVSU5UICAgICAgICB1S2V5SWR4OworICAgIHVuc2lnbmVkIGludCB1S2V5SWR4OwogCiAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyJFbnRlciBLZXliU2V0QWxsR3JvdXBLZXk6ICVsWFxuIiwgZHdLZXlJbmRleCk7CiAKIAogICAgIGlmICgoZHdLZXlJbmRleCAmIFBBSVJXSVNFX0tFWSkgIT0gMCkgeyAgICAgICAgICAgICAgICAgIC8vIFBhaXJ3aXNlIGtleQotICAgICAgICByZXR1cm4gKEZBTFNFKTsKKyAgICAgICAgcmV0dXJuIChmYWxzZSk7CiAgICAgfSBlbHNlIGlmICgoZHdLZXlJbmRleCAmIDB4MDAwMDAwRkYpID49IE1BWF9HUk9VUF9LRVkpIHsKLSAgICAgICAgcmV0dXJuIChGQUxTRSk7CisgICAgICAgIHJldHVybiAoZmFsc2UpOwogICAgIH0KIAogICAgIGZvciAoaT0wOyBpIDwgTUFYX0tFWV9UQUJMRS0xOyBpKyspIHsKLSAgICAgICAgaWYgKHBUYWJsZS0+S2V5VGFibGVbaV0uYkluVXNlID09IFRSVUUpIHsKKyAgICAgICAgaWYgKHBUYWJsZS0+S2V5VGFibGVbaV0uYkluVXNlID09IHRydWUpIHsKICAgICAgICAgICAgIC8vIGZvdW5kIHRhYmxlIGFscmVhZHkgZXhpc3QKICAgICAgICAgICAgIC8vIEdyb3VwIGtleQogICAgICAgICAgICAgcEtleSA9ICYocFRhYmxlLT5LZXlUYWJsZVtpXS5Hcm91cEtleVtkd0tleUluZGV4ICYgMHgwMDAwMDBGRl0pOwpAQCAtNzgxLDcgKzc4MSw3IEBACiAKICAgICAgICAgICAgIHBUYWJsZS0+S2V5VGFibGVbaV0ud0tleUN0bCB8PSAweDgwMDA7ICAgICAgICAgICAgICAvLyBlbmFibGUgb24tZmx5CiAKLSAgICAgICAgICAgIHBLZXktPmJLZXlWYWxpZCA9IFRSVUU7CisgICAgICAgICAgICBwS2V5LT5iS2V5VmFsaWQgPSB0cnVlOwogICAgICAgICAgICAgcEtleS0+dUtleUxlbmd0aCA9IHVLZXlMZW5ndGg7CiAgICAgICAgICAgICBwS2V5LT5kd0tleUluZGV4ID0gZHdLZXlJbmRleDsKICAgICAgICAgICAgIHBLZXktPmJ5Q2lwaGVyU3VpdGUgPSBieUtleURlY01vZGU7CkBAIC03OTIsNyArNzkyLDcgQEAKICAgICAgICAgICAgICAgICBpZiAodUtleUxlbmd0aCA9PSBXTEFOX1dFUDEwNF9LRVl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T1JEX1BUUiAgICAgICBkd0lvQmFzZQorICAgIHVuc2lnbmVkIGNoYXIgKnBieUJTU0lELAorICAgIHVuc2lnbmVkIGxvbmcgZHdLZXlJbmRleCwKKyAgICB1bnNpZ25lZCBsb25nIGR3SW9CYXNlCiAgICAgKTsKIAotQk9PTCBLZXliR2V0VHJhbnNtaXRLZXkoCitib29sIEtleWJHZXRUcmFuc21pdEtleSgKICAgICBQU0tleU1hbmFnZW1lbnQgcFRhYmxlLAotICAgIFBCWVRFICAgICAgICAgICBwYnlCU1NJRCwKLSAgICBEV09SRCAgICAgICAgICAgZHdLZXlUeXBlLAorICAgIHVuc2lnbmVkIGNoYXIgKnBieUJTU0lELAorICAgIHVuc2lnbmVkIGxvbmcgZHdLZXlUeXBlLAogICAgIFBTS2V5SXRlbSAgICAgICAqcEtleQogICAgICk7CiAKLUJPT0wgS2V5YkNoZWNrUGFpcmV3aXNlS2V5KAorYm9vbCBLZXliQ2hlY2tQYWlyZXdpc2VLZXkoCiAgICAgUFNLZXlNYW5hZ2VtZW50IHBUYWJsZSwKICAgICBQU0tleUl0ZW0gICAgICAgKnBLZXkKICAgICApOwogCi1CT09MIEtleWJSZW1vdmVBbGxLZXkoCitib29sIEtleWJSZW1vdmVBbGxLZXkoCiAgICAgUFNLZXlNYW5hZ2VtZW50IHBUYWJsZSwKLSAgICBQQllURSAgICAgICAgICAgcGJ5QlNTSUQsCi0gICAgRFdPUkRfUFRSICAgICAgIGR3SW9CYXNlCisgICAgdW5zaWduZWQgY2hhciAqcGJ5QlNTSUQsCisgICAgdW5zaWduZWQgbG9uZyBkd0lvQmFzZQogICAgICk7CiAKIHZvaWQgS2V5dlJlbW92ZVdFUEtleSgKICAgICBQU0tleU1hbmFnZW1lbnQgcFRhYmxlLAotICAgIERXT1JEICAgICAgICAgICBkd0tleUluZGV4LAotICAgIERXT1JEX1BUUiAgICAgICBkd0lvQmFzZQorICAgIHVuc2lnbmVkIGxvbmcgZHdLZXlJbmRleCwKKyAgICB1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mZiB3b3cgdGVtcCBmb3IgdHVybiBvZmYgUnggc2FmZWx5CiAKQEAgLTg1OCw3ICs4NTgsNyBAQAogICAgIGlmICh3dyA9PSBXX01BWF9USU1FT1VUKSB7CiAgICAgICAgIERCR19QT1JUODAoMHgxMCk7CiAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8iIERCR19QT1JUODAoMHgxMClcbiIpOwotICAgICAgICByZXR1cm4oRkFMU0UpOworICAgICAgICByZXR1cm4oZmFsc2UpOwogICAgIH0KICAgICBmb3IgKHd3ID0gMDsgd3cgPCBXX01BWF9USU1FT1VUOyB3dysrKSB7CiAgICAgICAgIFZOU3ZJblBvcnREKGR3SW9CYXNlICsgTUFDX1JFR19SWERNQUNUTDEsICZkd0RhdGEpOwpAQCAtODY4LDcgKzg2OCw3IEBACiAgICAgaWYgKHd3ID09IFdfTUFYX1RJTUVPVVQpIHsKICAgICAgICAgREJHX1BPUlQ4MCgweDExKTsKICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyIgREJHX1BPUlQ4MCgweDExKVxuIik7Ci0gICAgICAgIHJldHVybihGQUxTRSk7CisgICAgICAgIHJldHVybihmYWxzZSk7CiAgICAgfQogCiAgICAgLy8gdHJ5IHRvIHNhZmUgc2h1dGRvd24gUlgKQEAgLTg4Miw5ICs4ODIsOSBAQAogICAgIGlmICh3dyA9PSBXX01BWF9USU1FT1VUKSB7CiAgICAgICAgIERCR19QT1JUODAoMHgxMik7CiAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8iIERCR19QT1JUODAoMHgxMilcbiIpOwotICAgICAgICByZXR1cm4oRkFMU0UpOworICAgICAgICByZXR1cm4oZmFsc2UpOwogICAgIH0KLSAgICByZXR1cm4gVFJVRTsKKyAgICByZXR1cm4gdHJ1ZTsKIH0KIAogLyoKQEAgLTg5NywxNCArODk3LDE0IEBACiAgKiAgT3V0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jaGFyIGJ5RGF0YTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICBWTlN2SW5Qb3J0Qihkd0lvQmFzZSArIGJ5UmVnT2ZzLCAmYnlEYXRhKTsgICAgICAgICAgICAgIFwKICAgICBWTlN2T3V0UG9ydEIoZHdJb0Jhc2UgKyBieVJlZ09mcywgYnlEYXRhIHwgKGJ5Qml0cykpOyAgIFwKIH0KIAogI2RlZmluZSBNQUN2V29yZFJlZ0JpdHNPbihkd0lvQmFzZSwgYnlSZWdPZnMsIHdCaXRzKSAgICAgICAgXAogeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgIFdPUkQgd0RhdGE7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgIHVuc2lnbmVkIHNob3J0IHdEYXRhOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgIFZOU3ZJblBvcnRXKGR3SW9CYXNlICsgYnlSZWdPZnMsICZ3RGF0YSk7ICAgICAgICAgICAgICAgXAogICAgIFZOU3ZPdXRQb3J0Vyhkd0lvQmFzZSArIGJ5UmVnT2ZzLCB3RGF0YSB8ICh3Qml0cykpOyAgICAgXAogfQogCiAjZGVmaW5lIE1BQ3ZEV29yZFJlZ0JpdHNPbihkd0lvQmFzZSwgYnlSZWdPZnMsIGR3Qml0cykgICAgICBcCiB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgRFdPUkQgZHdEYXRhOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgdW5zaWduZWQgbG9uZyBkd0RhdGE7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAgICAgVk5TdkluUG9ydEQoZHdJb0Jhc2UgKyBieVJlZ09mcywgJmR3RGF0YSk7ICAgICAgICAgICAgICBcCiAgICAgVk5Tdk91dFBvcnREKGR3SW9CYXNlICsgYnlSZWdPZnMsIGR3RGF0YSB8IChkd0JpdHMpKTsgICBcCiB9CiAKICNkZWZpbmUgTUFDdlJlZ0JpdHNPbkV4KGR3SW9CYXNlLCBieVJlZ09mcywgYnlNYXNrLCBieUJpdHMpIFwKIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICBCWVRFIGJ5RGF0YTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICB1bnNpZ25lZCBjaGFyIGJ5RGF0YTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICBWTlN2SW5Qb3J0Qihkd0lvQmFzZSArIGJ5UmVnT2ZzLCAmYnlEYXRhKTsgICAgICAgICAgICAgIFwKICAgICBieURhdGEgJj0gYnlNYXNrOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICBWTlN2T3V0UG9ydEIoZHdJb0Jhc2UgKyBieVJlZ09mcywgYnlEYXRhIHwgKGJ5Qml0cykpOyAgIFwKQEAgLTY5MiwyMSArNjkyLDIxIEBACiAKICNkZWZpbmUgTUFDdlJlZ0JpdHNPZmYoZHdJb0Jhc2UsIGJ5UmVnT2ZzLCBieUJpdHMpICAgICAgICAgIFwKIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICBCWVRFIGJ5RGF0YTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICB1bnNpZ25lZCBjaGFyIGJ5RGF0YTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICBWTlN2SW5Qb3J0Qihkd0lvQmFzZSArIGJ5UmVnT2ZzLCAmYnlEYXRhKTsgICAgICAgICAgICAgIFwKICAgICBWTlN2T3V0UG9ydEIoZHdJb0Jhc2UgKyBieVJlZ09mcywgYnlEYXRhICYgfihieUJpdHMpKTsgIFwKIH0KIAogI2RlZmluZSBNQUN2V29yZFJlZ0JpdHNPZmYoZHdJb0Jhc2UsIGJ5UmVnT2ZzLCB3Qml0cykgICAgICAgXAogeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgIFdPUkQgd0RhdGE7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgIHVuc2lnbmVkIHNob3J0IHdEYXRhOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgIFZOU3ZJblBvcnRXKGR3SW9CYXNlICsgYnlSZWdPZnMsICZ3RGF0YSk7ICAgICAgICAgICAgICAgXAogICAgIFZOU3ZPdXRQb3J0Vyhkd0lvQmFzZSArIGJ5UmVnT2ZzLCB3RGF0YSAmIH4od0JpdHMpKTsgICAgXAogfQogCiAjZGVmaW5lIE1BQ3ZEV29yZFJlZ0JpdHNPZmYoZHdJb0Jhc2UsIGJ5UmVnT2ZzLCBkd0JpdHMpICAgICBcCiB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgRFdPUkQgZHdEYXRhOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgdW5zaWduZWQgbG9uZyBkd0RhdGE7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAgICAgVk5TdkluUG9ydEQoZHdJb0Jhc2UgKyBieVJlZ09mcywgJmR3RGF0YSk7ICAgICAgICAgICAgICBcCiAgICAgVk5Tdk91dFBvcnREKGR3SW9CYXNlICsgYnlSZWdPZnMsIGR3RGF0YSAmIH4oZHdCaXRzKSk7ICBcCiB9CkBAIC03MTQsMzcgKzcxNCwzNyBAQAogI2RlZmluZSBNQUN2R2V0Q3VyclJ4MERlc2NBZGRyKGR3SW9CYXNlLCBwZHdDdXJyRGVzY0FkZHIpICAgIFwKIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICBWTlN2SW5Qb3J0RChkd0lvQmFzZSArIE1BQ19SRUdfUlhETUFQVFIwLCAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICAoUERXT1JEKXBkd0N1cnJEZXNjQWRkcik7ICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAodW5zaWduZWQgbG9uZyAqKXBkd0N1cnJEZXNjQWRkcik7ICAgICAgICAgIFwKIH0KIAogI2RlZmluZSBNQUN2R2V0Q3VyclJ4MURlc2NBZGRyKGR3SW9CYXNlLCBwZHdDdXJyRGVzY0FkZHIpICAgXAogeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgIFZOU3ZJblBvcnREKGR3SW9CYXNlICsgTUFDX1JFR19SWERNQVBUUjEsICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgIChQRFdPUkQpcGR3Q3VyckRlc2NBZGRyKTsgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICh1bnNpZ25lZCBsb25nICopcGR3Q3VyckRlc2NBZGRyKTsgICAgICAgICAgXAogfQogCiAjZGVmaW5lIE1BQ3ZHZXRDdXJyVHgwRGVzY0FkZHIoZHdJb0Jhc2UsIHBkd0N1cnJEZXNjQWRkcikgICBcCiB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAgICAgVk5TdkluUG9ydEQoZHdJb0Jhc2UgKyBNQUNfUkVHX1RYRE1BUFRSMCwgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgKFBEV09SRClwZHdDdXJyRGVzY0FkZHIpOyAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgKHVuc2lnbmVkIGxvbmcgKilwZHdDdXJyRGVzY0FkZHIpOyAgICAgICAgICBcCiB9CiAKICNkZWZpbmUgTUFDdkdldEN1cnJBQzBEZXNjQWRkcihkd0lvQmFzZSwgcGR3Q3VyckRlc2NBZGRyKSAgIFwKIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICBWTlN2SW5Qb3J0RChkd0lvQmFzZSArIE1BQ19SRUdfQUMwRE1BUFRSLCAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICAoUERXT1JEKXBkd0N1cnJEZXNjQWRkcik7ICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAodW5zaWduZWQgbG9uZyAqKXBkd0N1cnJEZXNjQWRkcik7ICAgICAgICAgIFwKIH0KIAogI2RlZmluZSBNQUN2R2V0Q3VyclN5bmNEZXNjQWRkcihkd0lvQmFzZSwgcGR3Q3VyckRlc2NBZGRyKSAgXAogeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgIFZOU3ZJblBvcnREKGR3SW9CYXNlICsgTUFDX1JFR19TWU5DRE1BUFRSLCAgICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgIChQRFdPUkQpcGR3Q3VyckRlc2NBZGRyKTsgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICh1bnNpZ25lZCBsb25nICopcGR3Q3VyckRlc2NBZGRyKTsgICAgICAgICAgXAogfQogCiAjZGVmaW5lIE1BQ3ZHZXRDdXJyQVRJTURlc2NBZGRyKGR3SW9CYXNlLCBwZHdDdXJyRGVzY0FkZHIpICBcCiB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAgICAgVk5TdkluUG9ydEQoZHdJb0Jhc2UgKyBNQUNfUkVHX0FUSU1ETUFQVFIsICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgKFBEV09SRClwZHdDdXJyRGVzY0FkZHIpOyAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgKHVuc2lnbmVkIGxvbmcgKilwZHdDdXJyRGVzY0FkZHIpOyAgICAgICAgICBcCiB9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAKIC8vIHNldCB0aGUgY2hpcCB3aXRoIGN1cnJlbnQgQkNOIHR4IGRlc2NyaXB0b3IgYWRkcmVzcwpAQCAtNzY1LDcgKzc2NSw3IEBACiB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAgICAgVk5Tdk91dFBvcnRCKGR3SW9CYXNlICsgTUFDX1JFR19QQUdFMVNFTCwgMSk7ICAgICAgICAgICBcCiAgICAgVk5TdkluUG9ydEIoZHdJb0Jhc2UgKyBNQUNfUkVHX0JTU0lEMCwgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgKFBCWVRFKXBieUV0aGVyQWRkcik7ICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgKHVuc2lnbmVkIGNoYXIgKilwYnlFdGhlckFkZHIpOyAgICAgICAgICAgICBcCiAgICAgVk5TdkluUG9ydEIoZHdJb0Jhc2UgKyBNQUNfUkVHX0JTU0lEMCArIDEsICAgICAgICAgICAgICBcCiAgICAgICAgICAgICAgICAgcGJ5RXRoZXJBZGRyICsgMSk7ICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAgICAgVk5TdkluUG9ydEIoZHdJb0Jhc2UgKyBNQUNfUkVHX0JTU0lEMCArIDIsICAgICAgICAgICAgICBcCkBAIC04MDEsNyArODAxLDcgQEAKIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICBWTlN2T3V0UG9ydEIoZHdJb0Jhc2UgKyBNQUNfUkVHX1BBR0UxU0VMLCAxKTsgICAgICAgICAgIFwKICAgICBWTlN2SW5Qb3J0Qihkd0lvQmFzZSArIE1BQ19SRUdfUEFSMCwgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICAoUEJZVEUpcGJ5RXRoZXJBZGRyKTsgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAodW5zaWduZWQgY2hhciAqKXBieUV0aGVyQWRkcik7ICAgICAgICAgICAgIFwKICAgICBWTlN2SW5Qb3J0Qihkd0lvQmFzZSArIE1BQ19SRUdfUEFSMCArIDEsICAgICAgICAgICAgICAgIFwKICAgICAgICAgICAgICAgICBwYnlFdGhlckFkZHIgKyAxKTsgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICBWTlN2SW5Qb3J0Qihkd0lvQmFzZSArIE1BQ19SRUdfUEFSMCArIDIsICAgICAgICAgICAgICAgIFwKQEAgLTg3Myw3ICs4NzMsNyBAQAogCiAjZGVmaW5lIE1BQ3ZSZWNlaXZlMChkd0lvQmFzZSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICBEV09SRCBkd0RhdGE7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgdW5zaWduZWQgbG9uZyBkd0RhdGE7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgIFZOU3ZJblBvcnREKGR3SW9CYXNlICsgTUFDX1JFR19SWERNQUNUTDAsICZkd0RhdGEpOyAgICAgICAgIFwKICAgICBpZiAoZHdEYXRhICYgRE1BQ1RMX1JVTikgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAgICAgICAgIFZOU3ZPdXRQb3J0RChkd0lvQmFzZSArIE1BQ19SRUdfUlhETUFDVEwwLCBETUFDVExfV0FLRSk7XApAQCAtODg1LDcgKzg4NSw3IEBACiAKICNkZWZpbmUgTUFDdlJlY2VpdmUxKGR3SW9CYXNlKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgIERXT1JEIGR3RGF0YTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgdW5zaWduZWQgbG9uZyBkd0RhdGE7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgIFZOU3ZJblBvcnREKGR3SW9CYXNlICsgTUFDX1JFR19SWERNQUNUTDEsICZkd0RhdGEpOyAgICAgICAgIFwKICAgICBpZiAoZHdEYXRhICYgRE1BQ1RMX1JVTikgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAgICAgICAgIFZOU3ZPdXRQb3J0RChkd0lvQmFzZSArIE1BQ19SRUdfUlhETUFDVEwxLCBETUFDVExfV0FLRSk7XApAQCAtOTAyLDcgKzkwMiw3IEBACiAKICNkZWZpbmUgTUFDdlRyYW5zbWl0MChkd0lvQmFzZSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgIERXT1JEIGR3RGF0YTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgdW5zaWduZWQgbG9uZyBkd0RhdGE7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgIFZOU3ZJblBvcnREKGR3SW9CYXNlICsgTUFDX1JFR19UWERNQUNUTDAsICZkd0RhdGEpOyAgICAgICAgIFwKICAgICBpZiAoZHdEYXRhICYgRE1BQ1RMX1JVTikgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAgICAgICAgIFZOU3ZPdXRQb3J0RChkd0lvQmFzZSArIE1BQ19SRUdfVFhETUFDVEwwLCBETUFDVExfV0FLRSk7XApAQCAtOTE0LDcgKzkxNCw3IEBACiAKICNkZWZpbmUgTUFDdlRyYW5zbWl0QUMwKGR3SW9CYXNlKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgIERXT1JEIGR3RGF0YTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgdW5zaWduZWQgbG9uZyBkd0RhdGE7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgIFZOU3ZJblBvcnREKGR3SW9CYXNlICsgTUFDX1JFR19BQzBETUFDVEwsICZkd0RhdGEpOyAgICAgICAgIFwKICAgICBpZiAoZHdEYXRhICYgRE1BQ1RMX1JVTikgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAgICAgICAgIFZOU3ZPdXRQb3J0RChkd0lvQmFzZSArIE1BQ19SRUdfQUMwRE1BQ1RMLCBETUFDVExfV0FLRSk7XApAQCAtOTI2LDcgKzkyNiw3IEBACiAKICNkZWZpbmUgTUFDdlRyYW5zbWl0U1lOQyhkd0lvQmFzZSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgRFdPUkQgZHdEYXRhOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgdW5zaWduZWQgbG9uZyBkd0RhdGE7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICBWTlN2SW5Qb3J0RChkd0lvQmFzZSArIE1BQ19SRUdfU1lOQ0RNQUNUTCwgJmR3RGF0YSk7ICAgICAgICAgXAogICAgIGlmIChkd0RhdGEgJiBETUFDVExfUlVOKSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAgICAgICAgIFZOU3ZPdXRQb3J0RChkd0lvQmFzZSArIE1BQ19SRUdfU1lOQ0RNQUNUTCwgRE1BQ1RMX1dBS0UpO1wKQEAgLTkzOCw3ICs5MzgsNyBAQAogCiAjZGVmaW5lIE1BQ3ZUcmFuc21pdEFUSU0oZHdJb0Jhc2UpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgIERXT1JEIGR3RGF0YTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgIHVuc2lnbmVkIGxvbmcgZHdEYXRhOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAgICAgVk5TdkluUG9ydEQoZHdJb0Jhc2UgKyBNQUNfUkVHX0FUSU1ETUFDVEwsICZkd0RhdGEpOyAgICAgICAgIFwKICAgICBpZiAoZHdEYXRhICYgRE1BQ1RMX1JVTikgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgICAgICBWTlN2T3V0UG9ydEQoZHdJb0Jhc2UgKyBNQUNfUkVHX0FUSU1ETUFDVEwsIERNQUNUTF9XQUtFKTtcCkBAIC05NTUsNyArOTU1LDcgQEAKIAogI2RlZmluZSBNQUN2Q2xlYXJTdGNrRFMoZHdJb0Jhc2UpICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgIEJZVEUgYnlPcmdWYWx1ZTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgIHVuc2lnbmVkIGNoYXIgYnlPcmdWYWx1ZTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgIFZOU3ZJblBvcnRCKGR3SW9CYXNlICsgTUFDX1JFR19TVElDS0hXLCAmYnlPcmdWYWx1ZSk7ICAgXAogICAgIGJ5T3JnVmFsdWUgPSBieU9yZ1ZhbHVlICYgMHhGQzsgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgIFZOU3ZPdXRQb3J0Qihkd0lvQmFzZSArIE1BQ19SRUdfU1RJQ0tIVywgYnlPcmdWYWx1ZSk7ICAgXApAQCAtMTAwMiw3ICsxMDAyLDcgQEAKIAogI2RlZmluZSBNQUN2RW5hYmxlUHJvdGVjdE1EKGR3SW9CYXNlKSAgICAgICAgICAgICAgICAgICAgXAogeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgIERXT1JEIGR3T3JnVmFsdWU7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgIHVuc2lnbmVkIGxvbmcgZHdPcmdWYWx1ZTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgIFZOU3ZJblBvcnREKGR3SW9CYXNlICsgTUFDX1JFR19FTkNGRyAsICZkd09yZ1ZhbHVlKTsgXAogICAgIGR3T3JnVmFsdWUgPSBkd09yZ1ZhbHVlIHwgRW5DRkdfUHJvdGVjdE1kOyAgICAgICAgICAgXAogICAgIFZOU3ZPdXRQb3J0RChkd0lvQmFzZSArIE1BQ19SRUdfRU5DRkcsIGR3T3JnVmFsdWUpOyAgXApAQCAtMTAxMCw3ICsxMDEwLDcgQEAKIAogI2RlZmluZSBNQUN2RGlzYWJsZVByb3RlY3RNRChkd0lvQmFzZSkgICAgICAgICAgICAgICAgICAgXAogeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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SAgICAgICAgICAgIFwKIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICBEV09SRCBkd09yZ1ZhbHVlOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICB1bnNpZ25lZCBsb25nIGR3T3JnVmFsdWU7ICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICBWTlN2SW5Qb3J0RChkd0lvQmFzZSArIE1BQ19SRUdfRU5DRkcgLCAmZHdPcmdWYWx1ZSk7IFwKICAgICBkd09yZ1ZhbHVlID0gZHdPcmdWYWx1ZSAmIH5FbkNGR19CYXJrZXJQcmVhbTsgICAgICAgIFwKICAgICBWTlN2T3V0UG9ydEQoZHdJb0Jhc2UgKyBNQUNfUkVHX0VOQ0ZHLCBkd09yZ1ZhbHVlKTsgIFwKQEAgLTEwMzQsMTAgKzEwMzQsMTAgQEAKIAogI2RlZmluZSBNQUN2U2V0QkJUeXBlKGR3SW9CYXNlLCBieVR5cCkgICAgICAgICAgICAgICAgICAgXAogeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgIERXT1JEIGR3T3JnVmFsdWU7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgIHVuc2lnbmVkIGxvbmcgZHdPcmdWYWx1ZTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgIFZOU3ZJblBvcnREKGR3SW9CYXNlICsgTUFDX1JFR19FTkNGRyAsICZkd09yZ1ZhbHVlKTsgXAogICAgIGR3T3JnVmFsdWUgPSBkd09yZ1ZhbHVlICYgfkVuQ0ZHX0JCVHlwZV9NQVNLOyAgICAgICAgXAotICAgIGR3T3JnVmFsdWUgPSBkd09yZ1ZhbHVlIHwgKERXT1JEKSBieVR5cDsgICAgICAgICAgICAgXAorICAgIGR3T3JnVmFsdWUgPSBkd09yZ1ZhbHVlIHwgKHV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worICAgIHA4MDJfMTFDb3VudGVyLT5NdWx0aWNhc3RUcmFuc21pdHRlZEZyYW1lQ291bnQgPSAodW5zaWduZWQgbG9uZyBsb25nKSAocFN0YXRpc3RpYy0+ZHdUc3JCcm9hZGNhc3RbVFlQRV9BQzBETUFdICsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTdGF0aXN0aWMtPmR3VHNyQnJvYWRjYXN0W1RZUEVfVFhETUEwXSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU3RhdGlzdGljLT5kd1Rzck11bHRpY2FzdFtUWVBFX0FDMERNQV0gKwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YXRpc3RpYy0+ZHdUc3JNdWx0aWNhc3RbVFlQRV9UWERNQTBdKTsKLSAgICBwODAyXzExQ291bnRlci0+RmFpbGVkQ291bnQgPSAoVUxPTkdMT05HKSAocFN0YXRpc3RpYy0+ZHdUc3JFcnJbVFlQRV9BQzBETUFdICsgcFN0YXRpc3RpYy0+ZHdUc3JFcnJbVFlQRV9UWERNQTBdKTsKLSAgICBwODAyXzExQ291bnRlci0+UmV0cnlDb3VudCA9IChVTE9OR0xPTkcpIChwU3RhdGlzdGljLT5kd1RzclJldHJ5W1RZUEVfQUMwRE1BXSArIHBTdGF0aXN0aWMtPmR3VHNyUmV0cnlbVFlQRV9UWERNQTBdKTsKLSAgICBwODAyXzExQ291bnRlci0+TXVsdGlwbGVSZXRyeUNvdW50ID0gKFVMT05HTE9ORykgKHBTdGF0aXN0aWMtPmR3VHNyTW9yZVRoYW5PbmNlUmV0cnlbVFlQRV9BQzBETUFdICsKKyAgICBwODAyXzExQ291bnRlci0+RmFpbGVkQ291bnQgPSAodW5zaWduZWQgbG9uZyBsb25nKSAocFN0YXRpc3RpY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bMjU2XTsgICAgICAgICAgICAgICAvLyBtYXggc2l6ZSAyNTUgcGx1cyB6ZXJvIGVuZGluZwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGUuZy4gImludGVyZmFjZSAxIgotICAgIExPTkcgICAgaWZUeXBlOwotICAgIExPTkcgICAgaWZNdHU7Ci0gICAgRFdPUkQgICBpZlNwZWVkOwotICAgIEJZVEUgICAgaWZQaHlzQWRkcmVzc1tFVEhfQUxFTl07Ci0gICAgTE9ORyAgICBpZkFkbWluU3RhdHVzOwotICAgIExPTkcgICAgaWZPcGVyU3RhdHVzOwotICAgIERXT1JEICAgaWZMYXN0Q2hhbmdlOwotICAgIERXT1JEICAgaWZJbk9jdGV0czsKLSAgICBEV09SRCAgIGlmSW5VY2FzdFBrdHM7Ci0gICAgRFdPUkQgICBpZkluTlVjYXN0UGt0czsKLSAgICBEV09SRCAgIGlmSW5EaXNjYXJkczsKLSAgICBEV09SRCAgIGlmSW5FcnJvcnM7Ci0gICAgRFdPUkQgICBpZkluVW5rbm93blByb3RvczsKLSAgICBEV09SRCAgIGlmT3V0T2N0ZXRzOwotICAgIERXT1JEICAgaWZPdXRVY2FzdFBrdHM7Ci0gICAgRFdPUkQgICBpZk91dE5VY2FzdFBrdHM7Ci0gICAgRFdPUkQgICBpZk91dERpc2NhcmRzOwotICAgIERXT1JEICAgaWZPdXRFcnJvcnM7Ci0gICAgRFdPUkQgICBpZk91dFFMZW47Ci0gICAgRFdPUkQgICBpZlNwZWNpZmljOworICAgIGxvbmcgICAgaWZUeXBlOworICAgIGxvbmcgICAgaWZNdHU7CisgICAgdW5zaWduZWQgbG9uZyBpZlNwZWVkOworICAgIHVuc2lnbmVkIGNoYXIgaWZQaHlzQWRkcmVzc1tFVEhfQUxFTl07CisgICAgbG9uZyAgICBpZkFkbWluU3RhdHVzOworICAgIGxvbmcgICAgaWZPcGVyU3RhdHVzOworICAgIHVuc2lnbmVkIGxvbmcgaWZMYXN0Q2hh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gICAgICAgICAgICAgICAgICAgICAgICBCWVRFIGJ5UlNSLCBCWVRFIGJ5TmV3UlNSLCBCWVRFIGJ5UnhSYXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUEJZVEUgcGJ5QnVmZmVyLCBVSU5UIGNiRnJhbWVMZW5ndGgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhciBieVJTUiwgdW5zaWduZWQgY2hhciBieU5ld1JTUiwgdW5zaWduZWQgY2hhciBieVJ4UmF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXIgKnBieUJ1ZmZlciwgdW5zaWduZWQgaW50IGNiRnJhbWVMZW5ndGgpOwogCiB2b2lkIFNUQXZVcGRhdGVSRFN0YXRDb3VudGVyRXgoUFNTdGF0Q291bnRlciBwU3RhdGlzdGljLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQllURSBieVJTUiwgQllURSBieU5ld1JzciwgQllURSBieVJ4UmF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBCWVRFIHBieUJ1ZmZlciwgVUlOVCBjYkZyYW1lTGVuZ3RoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXIgYnlSU1IsIHVuc2lnbmVkIGNoYXIgYnlOZXdSc3IsIHVuc2lnbmVkIGNoYXIgYnlSeFJhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyICpwYnlCdWZmZXIsIHVuc2lnbmVkIGludCBjYkZyYW1lTGVuZ3RoKTsKIAotdm9pZCBTVEF2VXBkYXRlVERTdGF0Q291bnRlcihQU1N0YXRDb3VudGVyIHBTdGF0aXN0aWMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJZVEUgYnlUU1IwLCBCWVRFIGJ5VFNSMSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUEJZVEUg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ICAgIEZBTFNFLCBpZiBmYWlsCisgKiAgICB0cnVlLCBpZiBwb3dlciBkb3duIHN1Y2Nlc3MKKyAqICAgIGZhbHNlLCBpZiBmYWlsCiAtKi8KIAogCi1CT09MCitib29sCiBQU2JDb25zaWRlclBvd2VyRG93bigKICAgICB2b2lkICpoRGV2aWNlQ29udGV4dCwKLSAgICBCT09MIGJDaGVja1J4RE1BLAotICAgIEJPT0wgYkNoZWNrQ291bnRUb1dha2VVcAorICAgIGJvb2wgYkNoZWNrUnhETUEsCisgICAgYm9vbCBiQ2hlY2tDb3VudFRvV2FrZVVwCiAgICAgKQogewogICAgIFBTRGV2aWNlICAgICAgICBwRGV2aWNlID0gKFBTRGV2aWNlKWhEZXZpY2VDb250ZXh0OwogICAgIFBTTWdtdE9iamVjdCAgICBwTWdtdCA9IHBEZXZpY2UtPnBNZ210OwotICAgIFVJTlQgICAgICAgICAgICB1SWR4OworICAgIHVuc2lnbmVkIGludCB1SWR4OwogCiAgICAgLy8gY2hlY2sgaWYgYWxyZWFkeSBpbiBEb3plIG1vZGUKICAgICBpZiAoTUFDYklzUmVnQml0c09uKHBEZXZpY2UtPlBvcnRPZmZzZXQsIE1BQ19SRUdfUFNDVEwsIFBTQ1RMX1BTKSkKLSAgICAgICAgcmV0dXJuIFRSVUU7CisgICAgICAgIHJldHVybiB0cnVlOwogCiAgICAgaWYgKHBNZ210LT5lQ3Vyck1vZGUgIT0gV01BQ19NT0RFX0lCU1NfU1RBKSB7CiAgICAgICAgIC8vIGNoZWNrIGlmIGluIFRJTSB3YWtlIHBlcmlvZAogICAgICAgICBpZiAocE1nbXQtPmJJblRJTVdha2UpCi0gICAgICAgICAgICByZXR1cm4gRkFMU0U7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgfQogCiAgICAgLy8gY2hlY2sgc2NhbiBzdGF0ZQogICAgIGlmIChwRGV2aWNlLT5iQ21kUnVubmluZykKLSAgICAgICAgcmV0dXJuIEZBTFNFOworICAgICAgICByZ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AgICBwVHhQYWNrZXQgPSBOVUxMOwogICAgIFBTTWdtdE9iamVjdCAgICAgICAgcE1nbXQgPSBwRGV2aWNlLT5wTWdtdDsKLSAgICBVSU5UICAgICAgICAgICAgICAgIHVJZHg7CisgICAgdW5zaWduZWQgaW50IHVJZHg7CiAKIAotICAgIGlmIChwRGV2aWNlLT5iTGlua1Bhc3MgPT0gRkFMU0UpIHsKLSAgICAgICAgcmV0dXJuIEZBTFNFOworICAgIGlmIChwRGV2aWNlLT5iTGlua1Bhc3MgPT0gZmFsc2UpIHsKKyAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgIH0KICAgICAjaWZkZWYgVHhJblNsZWVwCi0gICAgIGlmICgocERldmljZS0+YkVuYWJsZVBTTW9kZSA9PSBGQUxTRSkgJiYKLQkgIChwRGV2aWNlLT5mVHhEYXRhSW5TbGVlcCA9PSBGQUxTRSkpewotICAgICAgICByZXR1cm4gRkFMU0U7CisgICAgIGlmICgocERldmljZS0+YkVuYWJsZVBTTW9kZSA9PSBmYWxzZSkgJiYKKwkgIChwRGV2aWNlLT5mVHhEYXRhSW5TbGVlcCA9PSBmYWxzZSkpeworICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgfQogI2Vsc2UKLSAgICBpZiAocERldmljZS0+YkVuYWJsZVBTTW9kZSA9PSBGQUxTRSkgewotICAgICAgICByZXR1cm4gRkFMU0U7CisgICAgaWYgKHBEZXZpY2UtPmJFbmFibGVQU01vZGUgPT0gZmFsc2UpIHsKKyAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgIH0KICNlbmRpZgogICAgIGlmIChwRGV2aWNlLT5iRW5hYmxlUFNNb2RlKSB7CiAgICAgICAgIGZvciAodUlkeCA9IDA7IHVJZHggPCBUWVBFX01BWFREOyB1SWR4ICsrKSB7CiAgICAgICAgICAgICBpZiAocERldmljZS0+aVREVXNlZFt1SWR4XSAhPSAwKQotICAgICAgICAgICAgICAgIHJldHVybiBGQUxTRTsKKyAgICAgICAgICAgICAgIC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NzTWdtdF94bWl0KHBEZXZpY2UsIHBUeFBhY2tldCkgIT0gQ01EX1NUQVRVU19QRU5ESU5HKSB7CiAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8gIlNlbmQgTnVsbCBQYWNrZXQgZmFpbGVkICFcbiIpOwotICAgICAgICByZXR1cm4gRkFMU0U7CisgICAgICAgIHJldHVybiBmYWxzZTsKICAgICB9CiAgICAgZWxzZSB7CiAKQEAgLTM2OSw3ICszNjksNyBAQAogICAgIH0KIAogCi0gICAgcmV0dXJuIFRSVUUgOworICAgIHJldHVybiB0cnVlIDsKIH0KIAogLyorCkBAIC0zODIsNyArMzgyLDcgQEAKICAqCiAtKi8KIAotQk9PTAorYm9vbAogUFNiSXNOZXh0VEJUVFdha2VVcCgKICAgICB2b2lkICpoRGV2aWNlQ29udGV4dAogICAgICkKQEAgLTM5MCw3ICszOTAsNyBAQAogCiAgICAgUFNEZXZpY2UgICAgICAgICBwRGV2aWNlID0gKFBTRGV2aWNlKWhEZXZpY2VDb250ZXh0OwogICAgIFBTTWdtdE9iamVjdCAgICAgICAgcE1nbXQgPSBwRGV2aWNlLT5wTWdtdDsKLSAgICBCT09MICAgICAgICAgICAgICAgIGJXYWtlVXAgPSBGQUxTRTsKKyAgICBib29sIGJXYWtlVXAgPSBmYWxzZTsKIAogICAgIGlmIChwTWdtdC0+d0xpc3RlbkludGVydmFsID49IDIpIHsKICAgICAgICAgaWYgKHBNZ210LT53Q291bnRUb1dha2VVcCA9PSAwKSB7CkBAIC00MDIsNyArNDAyLDcgQEAKICAgICAgICAgaWYgKHBNZ210LT53Q291bnRUb1dha2VVcCA9PSAxKSB7CiAgICAgICAgICAgICAvLyBUdXJuIG9uIHdha2UgdXAgdG8gbGlzdGVuIG5leHQgYmVhY29uCiAgICAgICAgICAgICBNQUN2UmVnQml0c09uKHBEZXZpY2UtPlBvcnRPZmZzZXQsIE1BQ19SRUdfUFNDVEwsIFBTQ1RMX0xOQk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QEAgLTkyMywyMCArOTIzLDIwIEBACiAgICAgICAgIGNhc2UgUkZfQUwyMjMwUzoKIAogICAgICAgICAgICAgaWYgKHVDaGFubmVsID4gQ0JfTUFYX0NIQU5ORUxfMjRHKQotICAgICAgICAgICAgICAgIHJldHVybiBGQUxTRTsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAKICAgICAgICAgICAgIGJ5SW5pdENvdW50ID0gQ0JfQUwyMjMwX0lOSVRfU0VRICsgMjsgLy8gSW5pdCBSZWcgKyBDaGFubmVsIFJlZyAoMikKICAgICAgICAgICAgIGJ5U2xlZXBDb3VudCA9IDA7CiAgICAgICAgICAgICBpZiAoYnlJbml0Q291bnQgPiAoTUlTQ0ZJRk9fU1lOREFUQVNJWkUgLSBieVNsZWVwQ291bnQpKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIEZBTFNFOworICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgZm9yIChpaSA9IDA7IGlpIDwgQ0JfQUwyMjMwX0lOSVRfU0VROyBpaSsrICkgewotICAgICAgICAgICAgICAgIE1BQ3ZTZXRNSVNDRmlmbyhkd0lvQmFzZSwgKFdPUkQpKE1JU0NGSUZPX1NZTkRBVEFfSURYICsgaWkpLCBkd0FMMjIzMEluaXRUYWJsZVtpaV0pOworICAgICAgICAgICAgICAgIE1BQ3ZTZXRNSVNDRmlmbyhkd0lvQmFzZSwgKHVuc2lnbmVkIHNob3J0KShNSVNDRklGT19TWU5EQVRBX0lEWCArIGlpKSwgZHdBTDIyMzBJbml0VGFibGVbaWldKTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIE1BQ3ZTZXRNSVNDRmlmbyhkd0lvQmFzZSwgKFdPUkQpKE1JU0NGSUZPX1NZTkRBVEFfSURYICsgaWkpLCBkd0FMMjIzMENoYW5uZWxUYWJsZTBbdUNoYW5uZWwtMV0pOworICAgICAgICAgICAgTUFDdlNldE1JU0NGaWZvKGR3SW9CYXNlLCAodW5zaWduZWQgc2hvcnQpKE1JU0NGSUZPX1NZTkRBVEFfSURYICsgaWkpLCBkd0FMMjIzMENoYW5uZWxUYWJsZTBbdUNoYW5uZWwtMV0pOwogICAgICAgICAgICAgaWkgKys7Ci0gICAgICAgICAgICBNQUN2U2V0TUlTQ0ZpZm8oZHdJb0Jhc2UsIChXT1JEKShNSVNDRklGT19TWU5EQVRBX0lEWCArIGlpKSwgZHdBTDIyMzBDaGFubmVsVGFibGUxW3VDaGFubmVsLTFdKTsKKyAgICAgICAgICAgIE1BQ3ZTZXRNSVNDRmlmbyhkd0lvQmFzZSwgKHVuc2lnbmVkIHNob3J0KShNSVNDRklGT19TWU5EQVRBX0lEWCArIGlpKSwgZHdBTDIyMzBDaGFubmVsVGFibGUxW3VDaGFubmVsLTFdKTsKICAgICAgICAgICAgIGJyZWFrOwogCiAgICAgICAgIC8ve3sgUm9iZXJ0WXU6IDIwMDUwMTA0CkBAIC05NDUsNDIgKzk0NSw0MiBAQAogICAgICAgICAgICAgYnlJbml0Q291bnQgPSBDQl9BTDcyMzBfSU5JVF9TRVEgKyAzOyAvLyBJbml0IFJlZyArIENoYW5uZWwgUmVnICgzKQogICAgICAgICAgICAgYnlTbGVlcENvdW50ID0gMDsKICAgICAgICAgICAgIGlmIChieUluaXRDb3VudCA+IChNSVNDRklGT19TWU5EQVRBU0laRSAtIGJ5U2xlZXBDb3VudCkpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gRkFMU0U7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICBpZiAodUNoYW5uZWwgPD0gQ0JfTUFYX0NIQU5ORUxfMjRHKQogICAgICAgICAgICAgewogICAgICAgICAgICAgICAgIGZvciAoaWkgPSAwOyBpaSA8IENCX0FMNzIzMF9JTklUX1NFUTsgaWkrKyApIHsKLSAgICAgICAgICAgICAgICAgICAgTUFDdlNldE1JU0NGa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RTsKKyAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgIH0KIAogICAgIHN3aXRjaCAodVJBVEUpIHsKQEAgLTEwNzAsNyArMTA3MCw3IEBACiAjaWYgMAogCiAgICAgLy8gODAyLjExaCBUUEMKLSAgICBpZiAocERldmljZS0+YkxpbmtQYXNzID09IFRSVUUpIHsKKyAgICBpZiAocERldmljZS0+YkxpbmtQYXNzID09IHRydWUpIHsKICAgICAgICAgLy8gZG8gbm90IG92ZXIgbG9jYWwgY29uc3RyYWludAogICAgICAgICBpZiAoYnlQd3JkQm0gPiBwRGV2aWNlLT5hYnlMb2NhbFB3clt1Q0hdKSB7CiAgICAgICAgICAgICBwRGV2aWNlLT5ieUN1clB3cmRCbSA9IHBEZXZpY2UtPmFieUxvY2FsUHdyW3VDSF07CkBAIC0xMTExLDExICsxMTExLDExIEBACiAKIC8vICAgIGlmIChwRGV2aWNlLT5ieUxvY2FsSUQgPD0gUkVWX0lEX1ZUMzI1M19CMSkgewogICAgIGlmIChwRGV2aWNlLT5ieUN1clB3ciA9PSBieVB3cikgewotICAgICAgICByZXR1cm4gVFJVRTsKKyAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgfQogICAgIGJSZXN1bHQgPSBSRmJSYXdTZXRQb3dlcihwRGV2aWNlLCBieVB3ciwgdVJBVEUpOwogLy8gICAgfQotICAgIGlmIChiUmVzdWx0ID09IFRSVUUpIHsKKyAgICBpZiAoYlJlc3VsdCA9PSB0cnVlKSB7CiAgICAgICAgcERldmljZS0+YnlDdXJQd3IgPSBieVB3cjsKICAgICB9CiAgICAgcmV0dXJuIGJSZXN1bHQ7CkBAIC0xMTMxLDIxICsxMTMxLDIxIEBACiAgKiAgT3V0OgogICogICAgICBub25lCiAgKgotICogUmV0dXJuIFZhbHVlOiBUUlVFIGlmIHN1Y2NlZWRlZDsgRkFMU0UgaWYgZmFpbGVkLgorICogUmV0dXJuIFZhbHVlOiB0cnVlIGlmIHN1Y2NlZWRlZDsgZmFsc2UgaWY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AgICAgICAgICAgd0N1cnJlbnRSYXRlLAotICAgIEJZVEUgICAgICAgICAgICAgYnlGQk9wdGlvbgorICAgIHVuc2lnbmVkIHNob3J0IHdDdXJyZW50UmF0ZSwKKyAgICB1bnNpZ25lZCBjaGFyIGJ5RkJPcHRpb24KICAgICApOwogCiBzdGF0aWMKIHZvaWQKIHNfdkdlbmVyYXRlVHhQYXJhbWV0ZXIoCiAgICAgUFNEZXZpY2UgICAgICAgICBwRGV2aWNlLAotICAgIEJZVEUgICAgICAgICAgICBieVBrdFR5cGUsCisgICAgdW5zaWduZWQgY2hhciBieVBrdFR5cGUsCiAgICAgdm9pZCAqICAgICAgICAgICBwVHhCdWZIZWFkLAogICAgIHZvaWQgKiAgICAgICAgICAgcHZScnZUaW1lLAogICAgIHZvaWQgKiAgICAgICAgICAgcHZSVFMsCiAgICAgdm9pZCAqICAgICAgICAgICBwdkNUUywKLSAgICBVSU5UICAgICAgICAgICAgIGNiRnJhbWVTaXplLAotICAgIEJPT0wgICAgICAgICAgICAgYk5lZWRBQ0ssCi0gICAgVUlOVCAgICAgICAgICAgICB1RE1BSWR4LAorICAgIHVuc2lnbmVkIGludAljYkZyYW1lU2l6ZSwKKyAgICBib29sIGJOZWVkQUNLLAorICAgIHVuc2lnbmVkIGludAl1RE1BSWR4LAogICAgIFBTRXRoZXJuZXRIZWFkZXIgcHNFdGhIZWFkZXIsCi0gICAgV09SRCAgICAgICAgICAgICB3Q3VycmVudFJhdGUKKyAgICB1bnNpZ25lZCBzaG9ydCB3Q3VycmVudFJhdGUKICAgICApOwogCiAKIAogc3RhdGljIHZvaWQgc192RmlsbEZyYWdQYXJhbWV0ZXIoCiAgICAgUFNEZXZpY2UgcERldmljZSwKLSAgICBQQllURSAgICBwYnlCdWZmZXIsCi0gICAgVUlOVCAgICAgdVR4VHlwZSwKKyAgICB1bnNpZ25lZCBjaGFyICpwYnlCdWZmZXIsCisgICAgdW5zaWduZWQgaW50CXVUeFR5cGUsCiAgICAgdm9pZC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XRlID09IEtFWV9DVExfV0VQKSB7CiAgICAgICAgIGlmIChwVHJhbnNtaXRLZXktPnVLZXlMZW5ndGggPT0gV0xBTl9XRVAyMzJfS0VZTEVOICl7Ci0gICAgICAgICAgICBtZW1jcHkocERldmljZS0+YWJ5UFJORywgKFBCWVRFKSYoZHdSZXZJVkNvdW50ZXIpLCAzKTsKKyAgICAgICAgICAgIG1lbWNweShwRGV2aWNlLT5hYnlQUk5HLCAodW5zaWduZWQgY2hhciAqKSYoZHdSZXZJVkNvdW50ZXIpLCAzKTsKICAgICAgICAgICAgIG1lbWNweShwRGV2aWNlLT5hYnlQUk5HKzMsIHBUcmFuc21pdEtleS0+YWJ5S2V5LCBwVHJhbnNtaXRLZXktPnVLZXlMZW5ndGgpOwogICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgbWVtY3B5KHBieUJ1ZiwgKFBCWVRFKSYoZHdSZXZJVkNvdW50ZXIpLCAzKTsKKyAgICAgICAgICAgIG1lbWNweShwYnlCdWYsICh1bnNpZ25lZCBjaGFyICopJihkd1JldklWQ291bnRlciksIDMpOwogICAgICAgICAgICAgbWVtY3B5KHBieUJ1ZiszLCBwVHJhbnNtaXRLZXktPmFieUtleSwgcFRyYW5zbWl0S2V5LT51S2V5TGVuZ3RoKTsKICAgICAgICAgICAgIGlmKHBUcmFuc21pdEtleS0+dUtleUxlbmd0aCA9PSBXTEFOX1dFUDQwX0tFWUxFTikgewotICAgICAgICAgICAgICAgIG1lbWNweShwYnlCdWYrOCwgKFBCWVRFKSYoZHdSZXZJVkNvdW50ZXIpLCAzKTsKKyAgICAgICAgICAgICAgICBtZW1jcHkocGJ5QnVmKzgsICh1bnNpZ25lZCBjaGFyICopJihkd1JldklWQ291bnRlciksIDMpOwogICAgICAgICAgICAgICAgIG1lbWNweShwYnlCdWYrMTEsIHBUcmFuc21pdEtleS0+YWJ5S2V5LCBwVHJhbnNtaXRLZXktPnVLZXlMZW5ndGgpOwogICAgICAgICAgICAgfQogICAgICAgICA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3B1X3RvX2xlMTYoKHVuc2lnbmVkIHNob3J0KShwVHJhbnNtaXRLZXktPndUU0MxNV8wKSk7CiAgICAgICAgIC8vQXBwZW5kIElWJkV4dElWIGFmdGVyIE1hYyBIZWFkZXIKICAgICAgICAgKnBkd0V4dElWID0gY3B1X3RvX2xlMzIocFRyYW5zbWl0S2V5LT5kd1RTQzQ3XzE2KTsKIAogICAgICAgICAvL0ZpbGwgTUlDSERSMAogICAgICAgICAqcE1JQ0hEUiA9IDB4NTk7Ci0gICAgICAgICooKFBCWVRFKShwTUlDSERSKzEpKSA9IDA7IC8vIFR4UHJpb3JpdHkKKyAgICAgICAgKigodW5zaWduZWQgY2hhciAqKShwTUlDSERSKzEpKSA9IDA7IC8vIFR4UHJpb3JpdHkKICAgICAgICAgbWVtY3B5KHBNSUNIRFIrMiwgJihwTUFDSGVhZGVyLT5hYnlBZGRyMlswXSksIDYpOwotICAgICAgICAqKChQQllURSkocE1JQ0hEUis4KSkgPSBISUJZVEUoSElXT1JEKHBUcmFuc21pdEtleS0+ZHdUU0M0N18xNikpOwotICAgICAgICAqKChQQllURSkocE1JQ0hEUis5KSkgPSBMT0JZVEUoSElXT1JEKHBUcmFuc21pdEtleS0+ZHdUU0M0N18xNikpOwotICAgICAgICAqKChQQllURSkocE1JQ0hEUisxMCkpID0gSElCWVRFKExPV09SRChwVHJhbnNtaXRLZXktPmR3VFNDNDdfMTYpKTsKLSAgICAgICAgKigoUEJZVEUpKHBNSUNIRFIrMTEpKSA9IExPQllURShMT1dPUkQocFRyYW5zbWl0S2V5LT5kd1RTQzQ3XzE2KSk7Ci0gICAgICAgICooKFBCWVRFKShwTUlDSERSKzEyKSkgPSBISUJZVEUocFRyYW5zbWl0S2V5LT53VFNDMTVfMCk7Ci0gICAgICAgICooKFBCWVRFKShwTUlDSERSKzEzKSkgPSBMT0JZVEUocFRyYW5zbWl0S2V5LT53VFNDMTVfMCk7Ci0gICAgICAgICooKFBCWVRFKShwTUlDSERSKzE0KSkgPSBISUJZVEUod1BheWxvYWRMZW4pOwotICAgICAgICAqKChQQllURSkocE1JQ0hEUisxNSkpID0gTE9CWVRFKHdQYXlsb2FkTGVuKTsKKyAgICAgICAgKigodW5zaWduZWQgY2hhciAqKShwTUlDSERSKzgpKSA9IEhJQllURShISVdPUkQocFRyYW5zbWl0S2V5LT5kd1RTQzQ3XzE2KSk7CisgICAgICAgICooKHVuc2lnbmVkIGNoYXIgKikocE1JQ0hEUis5KSkgPSBMT0JZVEUoSElXT1JEKHBUcmFuc21pdEtleS0+ZHdUU0M0N18xNikpOworICAgICAgICAqKCh1bnNpZ25lZCBjaGFyICopKHBNSUNIRFIrMTApKSA9IEhJQllURShMT1dPUkQocFRyYW5zbWl0S2V5LT5kd1RTQzQ3XzE2KSk7CisgICAgICAgICooKHVuc2lnbmVkIGNoYXIgKikocE1JQ0hEUisxMSkpID0gTE9CWVRFKExPV09SRChwVHJhbnNtaXRLZXktPmR3VFNDNDdfMTYpKTsKKyAgICAgICAgKigodW5zaWduZWQgY2hhciAqKShwTUlDSERSKzEyKSkgPSBISUJZVEUocFRyYW5zbWl0S2V5LT53VFNDMTVfMCk7CisgICAgICAgICooKHVuc2lnbmVkIGNoYXIgKikocE1JQ0hEUisxMykpID0gTE9CWVRFKHBUcmFuc21pdEtleS0+d1RTQzE1XzApOworICAgICAgICAqKCh1bnNpZ25lZCBjaGFyICopKHBNSUNIRFIrMTQpKSA9IEhJQllURSh3UGF5bG9hZExlbik7CisgICAgICAgICooKHVuc2lnbmVkIGNoYXIgKikocE1JQ0hEUisxNSkpID0gTE9CWVRFKHdQYXlsb2FkTGVuKTsKIAogICAgICAgICAvL0ZpbGwgTUlDSERSMQotICAgICAgICAqKChQQllURSkocE1JQ0hEUisxNikpID0gMDsgLy8gSExFTlsxNTo4XQorICAgICAgICAqKCh1bnNpZ25lZCBjaGFyICopKHBNSUNIRFIrMTYpKSA9IDA7IC8vIEhMRU5bMTU6OF0KICAgICAgICAgaWYgKHBEZXZpY2UtPm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lLCAyKTsgLy8gTVNLU0VRQ1RMCiAgICAgICAgIGlmIChwRGV2aWNlLT5iTG9uZ0hlYWRlcikgewogICAgICAgICAgICAgbWVtY3B5KHBNSUNIRFIrNDAsICYocE1BQ0hlYWRlci0+YWJ5QWRkcjRbMF0pLCA2KTsKICAgICAgICAgfQpAQCAtMzMyLDEzICszMjEsMTMgQEAKIHNfdlNXZW5jcnlwdGlvbiAoCiAgICAgUFNEZXZpY2UgICAgICAgICAgICBwRGV2aWNlLAogICAgIFBTS2V5SXRlbSAgICAgICAgICAgcFRyYW5zbWl0S2V5LAotICAgIFBCWVRFICAgICAgICAgICAgICAgcGJ5UGF5bG9hZEhlYWQsCi0gICAgV09SRCAgICAgICAgICAgICAgICB3UGF5bG9hZFNpemUKKyAgICB1bnNpZ25lZCBjaGFyICpwYnlQYXlsb2FkSGVhZCwKKyAgICB1bnNpZ25lZCBzaG9ydCB3UGF5bG9hZFNpemUKICAgICApCiB7Ci0gICAgVUlOVCAgIGNiSUNWbGVuID0gNDsKLSAgICBEV09SRCAgZHdJQ1YgPSAweEZGRkZGRkZGTDsKLSAgICBQRFdPUkQgcGR3SUNWOworICAgIHVuc2lnbmVkIGludCBjYklDVmxlbiA9IDQ7CisgICAgdW5zaWduZWQgbG9uZyBkd0lDViA9IDB4RkZGRkZGRkZMOworICAgIHVuc2lnbmVkIGxvbmcgKnBkd0lDVjsKIAogICAgIGlmIChwVHJhbnNtaXRLZXkgPT0gTlVMTCkKICAgICAgICAgcmV0dXJuOwpAQCAtMzQ3LDcgKzMzNiw3IEBACiAgICAgICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KICAgICAgICAgLy8gQXBwZW5kIElDViBhZnRlciBwYXlsb2FkCiAgICAgICAgIGR3SUNWID0gQ1JDZHdHZXRDcmMzMkV4KHBieVBheWxvYWRIZWFkLCB3UGF5bG9hZFNpemUsIGR3SUNWKTsvL0lDVihQYXlsb2FkKQotICAgICAgICBwZHdJQ1YgPSAoUERXT1JEKShwYnlQYXlsb2FkSGVhZCArIHdQYXlsb2FkU2l6ZSk7CisgICAgICAgIHBkd0lDViA9ICh1bnNpZ25lZCBsb25nICopKHBieVBheWxvYWRIZWFkICsgd1BheWxvYWRTaXplKTsKICAgICAgICAgLy8gZmluYWxseSwgd2UgbXVzdCBpbnZlcnQgZHdDUkMgdG8gZ2V0IHRoZSBjb3JyZWN0IGFuc3dlcgogICAgICAgICAqcGR3SUNWID0gY3B1X3RvX2xlMzIofmR3SUNWKTsKICAgICAgICAgLy8gUkM0IGVuY3J5cHRpb24KQEAgLTM1OCw3ICszNDcsNyBAQAogICAgICAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAgICAgICAgIC8vQXBwZW5kIElDViBhZnRlciBwYXlsb2FkCiAgICAgICAgIGR3SUNWID0gQ1JDZHdHZXRDcmMzMkV4KHBieVBheWxvYWRIZWFkLCB3UGF5bG9hZFNpemUsIGR3SUNWKTsvL0lDVihQYXlsb2FkKQotICAgICAgICBwZHdJQ1YgPSAoUERXT1JEKShwYnlQYXlsb2FkSGVhZCArIHdQYXlsb2FkU2l6ZSk7CisgICAgICAgIHBkd0lDViA9ICh1bnNpZ25lZCBsb25nICopKHBieVBheWxvYWRIZWFkICsgd1BheWxvYWRTaXplKTsKICAgICAgICAgLy8gZmluYWxseSwgd2UgbXVzdCBpbnZlcnQgZHdDUkMgdG8gZ2V0IHRoZSBjb3JyZWN0IGFuc3dlcgogICAgICAgICAqcGR3SUNWID0gY3B1X3RvX2xlMzIofmR3SUNWKTsKICAgICAgICAgLy8gUkM0IGVuY3J5cHRpb24KQEAgLTM3NywyNSArMzY2LDI1IEBACiAgICAgICAgICAgICAgUEtfVFlQRV8xMUdBICAgIDMKICovCiBzdGF0aWMKLVVJTlQKK3Vuc2lnbmVkIGludAogc191R2V0VHh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ERldmljZSwgREFUQURVUl9BLCBjYkZyYW1lTGVuZ3RoLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnlQa3RUeXBlLCB3Q3VycmVudFJhdGUsIGJOZWVkQWNrLCB1RnJhZ0lkeCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNiTGFzdEZyYWdtZW50U2l6ZSwgdU1BQ2ZyYWdOdW0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBieUZCT3B0aW9uKSk7IC8vMTogMi40R0h6Ci0gICAgICAgICAgICBwQnVmLT53RHVyYXRpb25fYiA9IGNwdV90b19sZTE2KChXT1JEKXNfdUdldERhdGFEdXJhdGlvbihwRGV2aWNlLCBEQVRBRFVSX0IsIGNiRnJhbWVMZW5ndGgsCisgICAgICAgICAgICBwQnVmLT53RHVyYXRpb25fYiA9IGNwdV90b19sZTE2KCh1bnNpZ25lZCBzaG9ydClzX3VHZXREYXRhRHVyYXRpb24ocERldmljZSwgREFUQURVUl9CLCBjYkZyYW1lTGVuZ3RoLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUEtfVFlQRV8xMUIsIHBEZXZpY2UtPmJ5VG9wQ0NLQmFzaWNSYXRlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYk5lZWRBY2ssIHVGcmFnSWR4LCBjYkxhc3RGcmFnbWVudFNpemUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1TUFDZnJhZ051bSwgYnlGQk9wdGlvbikpOyAvLzE6IDIuNApAQCAtNzcxLDIxICs3NjAsMjEgQEAKICAgICAgICAgICAgIFBTVHhEYXRhSGVhZF9nX0ZCIHBCdWYgPSAoU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yYXRpb24gYW5kIFRpbWVTdGFtcE9mZgogCi0gICAgICAgICAgICBwQnVmLT53RHVyYXRpb24gPSBjcHVfdG9fbGUxNigoV09SRClzX3VHZXREYXRhRHVyYXRpb24ocERldmljZSwgREFUQURVUl9BLCBjYkZyYW1lTGVuZ3RoLCBieVBrdFR5cGUsCisgICAgICAgICAgICBwQnVmLT53RHVyYXRpb24gPSBjcHVfdG9fbGUxNigodW5zaWduZWQgc2hvcnQpc191R2V0RGF0YUR1cmF0aW9uKHBEZXZpY2UsIERBVEFEVVJfQSwgY2JGcmFtZUxlbmd0aCwgYnlQa3RUeXBlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdDdXJyZW50UmF0ZSwgYk5lZWRBY2ssIHVGcmFnSWR4LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNiTGFzdEZyYWdtZW50U2l6ZSwgdU1BQ2ZyYWdOdW0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnlGQk9wdGlvbikpOwpAQCAtODM1LDExICs4MjQsMTEgQEAKICAgICAgICAgICAgIFBTVHhEYXRhSGVhZF9hYiBwQnVmID0gKFBTVHhEYXRhSGVhZF9hYilwVHhEYXRhSGVhZDsKICAgICAgICAgICAgIC8vR2V0IFNpZ25hbEZpZWxkLFNlcnZpY2VGaWVsZCxMZW5ndGgKICAgICAgICAgICAgIEJCdkNhY3VsYXRlUGFyYW1ldGVyKHBEZXZpY2UsIGNiRnJhbWVMZW5ndGgsIHdDdXJyZW50UmF0ZSwgYnlQa3RUeXBlLAotICAgICAgICAgICAgICAgIChQV09SRCkmKHdMZW4pLCAoUEJZVEUpJihwQnVmLT5ieVNlcnZpY2VGaWVsZCksIChQQllURSkmKHBCdWYtPmJ5U2lnbmFsRmllbGQpCisgICAgICAgICAgICAgICAgKHVuc2lnbmVkIHNob3J0ICopJih3TGVuKSwgKHVuc2lnbmVkIGNoYXIgKikmKHBCdWYtPmJ5U2VydmljZUZpZWxkKSwgKHVuc2lnbmVkIGNoYXIgKikmKHBCdWYtPmJ5U2lnbmFsRmllbGQpCiAgICAgICAgICAgICApOwogICAgICAgICAgICAgcEJ1Zi0+d1RyYW5zbWl0TGVuZ3RoID0gY3B1X3RvX2xlMTYod0xlbik7CiAgICAgICAgICAgICAvL0dldCBEdXJhdGlvbiBhbmQgVGltZVN0YW1wT2ZmCi0gICAgICAgICAgICBwQnVmLT53RHVyYXRpb24gPSBjcHVfdG9fbGUxNigoV09SRClzX3VHZXREYXRhRHVyYXRpb24ocERldmljZSwgREFUQURVUl9CLCBjYkZyYW1lTGVuZ3RoLCBieVBrdFR5cGUsCisgICAgICAgICAgICBwQnVmLT53RHVyYXRpb24gPSBjcHVfdG9fbGUxNigodW5zaWduZWQgc2hvcnQpc191R2V0RGF0YUR1cmF0aW9uKHBEZXZpY2UsIERBVEFEVVJfQiwgY2JGcmFtZUxlbmd0aCwgYnlQa3RUeXBlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdDdXJyZW50UmF0ZSwgYk5lZWRBY2ssIHVGcmFnSWR4LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNiTGFzdEZyYWdtZW50U2l6ZSwgdU1BQ2ZyYWdOdW0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnlGQk9wdGlvbikpOwpAQCAtODU0LDE4ICs4NDMsMTggQEAKIHZvaWQKIHNfdkZpbGxSVFNIZWFkICgKICAgICBQU0RldmljZSAgICAgICAgIHBEZXZpY2UsCi0gICAgQllURSAgICAgICAgICAgICBieVBrdFR5cGUsCisgICAgdW5zaWduZWQgY2hhciBieVBrdFR5cGUsCiAgICAgdm9pZCAqICAgICAgICAgICBwdlJUU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RnJhZ1R5cGU7IC8vMDA6Tm9uLUZyYWcsIDAxOlN0YXJ0LCAxMDpNaWQsIDExOkxhc3QKLSAgICBVSU5UICAgICAgICAgICB1RHVyYXRpb247Ci0gICAgUEJZVEUgICAgICAgICAgcGJ5QnVmZmVyOwotLy8gICAgVUlOVCAgICAgICAgICAgdUtleUVudHJ5SWR4ID0gTlVNX0tFWV9FTlRSWSsxOwotLy8gICAgQllURSAgICAgICAgICAgYnlLZXlTZWwgPSAweEZGOwotICAgIFVJTlQgICAgICAgICAgIGNiSVZsZW4gPSAwOwotICAgIFVJTlQgICAgICAgICAgIGNiSUNWbGVuID0gMDsKLSAgICBVSU5UICAgICAgICAgICBjYk1JQ2xlbiA9IDA7Ci0gICAgVUlOVCAgICAgICAgICAgY2JGQ1NsZW4gPSA0OwotICAgIFVJTlQgICAgICAgICAgIGNiODAyXzFfSF9sZW4gPSAwOwotICAgIFVJTlQgICAgICAgICAgIHVMZW5ndGggPSAwOwotICAgIFVJTlQgICAgICAgICAgIHVUbXBMZW4gPSAwOwotLy8gICAgQllURSAgICAgICAgICAgYWJ5VG1wWzhdOwotLy8gICAgRFdPUkQgICAgICAgICAgZHdDUkM7Ci0gICAgVUlOVCAgICAgICAgICAgY2JNSUNIRFIgPSAwOwotICAgIERXT1JEICAgICAgICAgIGR3TUlDS2V5MCwgZHdNSUNLZXkxOwotICAgIERXT1JEICAgICAgICAgIGR3TUlDX1ByaW9yaXR5OwotICAgIFBEV09SRCAgICAgICAgIHBkd01JQ19MOwotICAgIFBEV09SRCAgICAgICAgIHBkd01JQ19SOwotICAgIERXT1JEICAgICAgICAgIGR3U2FmZU1JQ19MLCBkd1NhZmVNSUNfUjsgLy9GaXggIkxhc3QgRnJhZyBTaXplIiA8ICJNSUMgbGVuZ3RoIi4KLSAgICBCT09MICAgICAgICAgICBiTUlDMkZyYWcgPSBGQUxTRTsKLSAgICBVSU5UICAgICAgICAgICB1TUlDRnJhZ0xlbiA9IDA7Ci0gICAgVUlOVC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pemUpOwogICAgICAgICAgICAgICAgIHBNSUNIRFIgPSAoUFNNSUNIRFJIZWFkKSAocGJ5VHhCdWZmZXJBZGRyICsgd1R4QnVmU2l6ZSArIHNpemVvZihTUnJ2VGltZV9nUlRTKSk7CiAgICAgICAgICAgICAgICAgcHZSVFMgPSAoUFNSVFNfZ19GQikgKHBieVR4QnVmZmVyQWRkciArIHdUeEJ1ZlNpemUgKyBzaXplb2YoU1JydlRpbWVfZ1JUUykgKyBjYk1JQ0hEUik7CkBAIC0xNTA4LDcgKzE0ODMsNyBAQAogICAgIGVsc2Ugey8vODAyLjExYS9iIHBhY2tldAogCiAgICAgICAgIGlmIChieUZCT3B0aW9uID09IEFVVE9fRkJfTk9ORSkgewotICAgICAgICAgICAgaWYgKGJSVFMgPT0gVFJVRSkgeworICAgICAgICAgICAgaWYgKGJSVFMgPT0gdHJ1ZSkgewogICAgICAgICAgICAgICAgIHB2UnJ2VGltZSA9IChQU1JydlRpbWVfYWIpIChwYnlUeEJ1ZmZlckFkZHIgKyB3VHhCdWZTaXplKTsKICAgICAgICAgICAgICAgICBwTUlDSERSID0gKFBTTUlDSERSSGVhZCkgKHBieVR4QnVmZmVyQWRkciArIHdUeEJ1ZlNpemUgKyBzaXplb2YoU1JydlRpbWVfYWIpKTsKICAgICAgICAgICAgICAgICBwdlJUUyA9IChQU1JUU19hYikgKHBieVR4QnVmZmVyQWRkciArIHdUeEJ1ZlNpemUgKyBzaXplb2YoU1JydlRpbWVfYWIpICsgY2JNSUNIRFIpOwpAQCAtMTUyNiw3ICsxNTAxLDcgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgIC8vIEF1dG8gRmFsbCBCYWNrCi0gICAgICAgICAgICBpZiAoYlJUUyA9PSBUUlVFKSB7Ly9SVFNfbmVlZAorICAgICAgICAgICAgaWYgKGJSVFMgPT0gdHJ1ZSkgey8vUlRTX25lZWQKICAgICAgICAgICAgICAgICBwdlJydlRpbWUgPSAo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eXB0ID09IFRSVUUpIHsKKyAgICAgICAgICAgICAgICBpZiAoYk5lZWRFbmNyeXB0ID09IHRydWUpIHsKICAgICAgICAgICAgICAgICAgICAgLy9GaWxsIFRYS0VZCi0gICAgICAgICAgICAgICAgICAgIHNfdkZpbGxUeEtleShwRGV2aWNlLCAoUEJZVEUpKHBzVHhCdWZIZC0+YWR3VHhLZXkpLCBwYnlJVkhlYWQsIHBUcmFuc21pdEtleSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBieU1hY0hkciwgKFdPUkQpY2JGcmFnUGF5bG9hZFNpemUsIChQQllURSlwTUlDSERSKTsKKyAgICAgICAgICAgICAgICAgICAgc192RmlsbFR4S2V5KHBEZXZpY2UsICh1bnNpZ25lZCBjaGFyICopKHBzVHhCdWZIZC0+YWR3VHhLZXkpLCBwYnlJVkhlYWQsIHBUcmFuc21pdEtleSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBieU1hY0hkciwgKHVuc2lnbmVkIHNob3J0KWNiRnJhZ1BheWxvYWRTaXplLCAodW5zaWduZWQgY2hhciAqKXBNSUNIRFIpOwogICAgICAgICAgICAgICAgICAgICAvL0ZpbGwgSVYoRXh0SVYsUlNOSERSKQogICAgICAgICAgICAgICAgICAgICBpZiAocERldmljZS0+YkVuYWJsZUhvc3RXRVApIHsKICAgICAgICAgICAgICAgICAgICAgICAgIHBNZ210LT5zTm9kZURCVGFibGVbdU5vZGVJbmRleF0uZHdUU0M0N18xNiA9IHBUcmFuc21pdEtleS0+ZHdUU0M0N18xNjsKQEAgLTE2MjUsMTMgKzE2MDAsMTMgQEAKICAgICAgICAgICAgICAgICBpZiAobnRvaHMocHNFdGhIZWFkZXItPndUeXBlKSA+IEVUSF9EQVRBX0xFTikgewogICAgICAgICAgICAgICAgICAgICBpZiAoKHBzRXRoSGVhZGVyLT53VHlwZSA9PSBUWVBFX1BLVF9JUFgpIHx8CiAgICAgICAgICAgICAgICAgICAgICAgICAocHNFdGhIZWFkZXItPndUeXBlID09IGNwdV90b19sZTE2KDB4RjM4MCkpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtZW1jcHkoKFBCWVRFKSAocGJ5UGF5bG9hZEhlYWQpLCAmcERldmljZS0+YWJ5U05BUF9CcmlkZ2V0dW5uZWxbMF0sIDYpOworICAgICAgICAgICAgICAgICAgICAgICAgbWVtY3B5KCh1bnNpZ25lZCBjaGFyICopIChwYnlQYXlsb2FkSGVhZCksICZwRGV2aWNlLT5hYnlTTkFQX0JyaWRnZXR1bm5lbFswXSwgNik7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtZW1jcHkoKFBCWVRFKSAocGJ5UGF5bG9hZEhlYWQpLCAmcERldmljZS0+YWJ5U05BUF9SRkMxMDQyWzBdLCA2KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1lbWNweSgodW5zaWduZWQgY2hhciAqKSAocGJ5UGF5bG9hZEhlYWQpLCAmcERldmljZS0+YWJ5U05BUF9SRkMxMDQyWzBdLCA2KTsKICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBwYnlUeXBlID0gKFBCWVRFKSAocGJ5UGF5bG9hZEhlYWQgKyA2KTsKLSAgICAgICAgICAgICAgICAgICAgbWVtY3B5KHBieVR5cGUsICYocHNFdGhIZWFkZXItPndUeXBlKSwgc2l6ZW9mKFdPUkQpKTsKKyAgICAgICAgICAgICAgICAgICAgcGJ5VHlwZSA9ICh1bnNpZ25lZCBjaGFyICopIChwYnlQYXlsb2FkSGVhZCArIDYpOworICAgICAgICAgICAgICAgICAgICBtZW1jcHkocGJ5VHlwZSwgJihwc0V0aEhlYWRlci0+d1R5cGUpLCBzaXplb2YodW5zaWduZWQgc2hvcnQpKTsKICAgICAgICAgICAgICAgICAgICAgY2I4MDJfMV9IX2xlbiA9IDg7CiAgICAgICAgICAgICAgICAgfQogCkBAIC0xNjQxLDE1ICsxNjE2LDE1IEBACiAgICAgICAgICAgICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICAgICAgICAgICAgICAgICAvL0ZpbGwgTUlDSERSCiAgICAgICAgICAgICAgICAgLy9pZiAocERldmljZS0+YkFFUykgewotICAgICAgICAgICAgICAgIC8vICAgIHNfdkZpbGxNSUNIRFIocERldmljZSwgKFBCWVRFKXBNSUNIRFIsIHBieU1hY0hkciwgKFdPUkQpY2JGcmFnUGF5bG9hZFNpemUpOworICAgICAgICAgICAgICAgIC8vICAgIHNfdkZpbGxNSUNIRFIocERldmljZSwgKHVuc2lnbmVkIGNoYXIgKilwTUlDSERSLCBwYnlNYWNIZHIsICh1bnNpZ25lZCBzaG9ydCljYkZyYWdQYXlsb2FkU2l6ZSk7CiAgICAgICAgICAgICAgICAgLy99CiAgICAgICAgICAgICAgICAgLy9jYlJlcUNvdW50ICs9IHNfdURvRW5jcnlwdGlvbihwRGV2aWNlLCBwc0V0aEhlYWRlciwgKHZvaWQgKilwc1R4QnVmSGQsIGJ5S2V5U2VsLAotICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYnlQYXlsb2FkSGVhZCwgKFdPUkQpY2JGcmFnUGF5bG9hZFNpemUsIHVETUFJZHgpOworICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYnlQYXlsb2FkSGVhZCwgKHVuc2lnbmVkIHNob3J0KWNiRnJhZ1BheWxvYWRTaXplLCB1RE1BSWR4KTsKIAogCiAKLSAgICAgICAgICAgICAgICAvL3BieUJ1ZmZlciA9IChQQllURSlwRGV2aWNlLT5hYW1UeEJ1Zlt1RE1BSWR4XVt1RGVzY0lkeF0ucGJ5VkFkZHI7Ci0gICAgICAgICAgICAgICAgcGJ5QnVmZmVyID0gKFBCWVRFKXBIZWFkVEQtPnBUREluZm8tPmJ1ZjsKKyAgICAgICAgICAg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AtMTY3Miw3ICsxNjQ3LDcgQEAKICAgICAgICAgICAgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogICAgICAgICAgICAgICAgIGlmICgocERldmljZS0+YnlMb2NhbElEIDw9IFJFVl9JRF9WVDMyNTNfQTEpKSB7CiAgICAgICAgICAgICAgICAgICAgIGlmIChiTmVlZEVuY3J5cHQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNfdlNXZW5jcnlwdGlvbihwRGV2aWNlLCBwVHJhbnNtaXRLZXksIChwYnlCdWZmZXIgKyB1TGVuZ3RoIC0gY2I4MDJfMV9IX2xlbiksIChXT1JEKWNiRnJhZ1BheWxvYWRTaXplKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNfdlNXZW5jcnlwdGlvbihwRGV2aWNlLCBwVHJhbnNtaXRLZXksIChwYnlCdWZmZXIgKyB1TGVuZ3RoIC0gY2I4MDJfMV9IX2xlbiksICh1bnNpZ25lZCBzaG9ydCljYkZyYWdQYXlsb2FkU2l6ZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICBjYlJlcUNvdW50ICs9IGNiSUNWbGVuOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQpAQCAtMTcxMSwxMyArMTY4NiwxMyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1RnJhZ0lkeCwgY2JMYXN0RnJhZ21lbnRTaXplLCB1TUFDZnJhZ051bSwgYnlGQk9wdGlvbiwgcERldmljZS0+d0N1cnJlbnRSYXRlKTsKIAogICAgICAgICAgICAgICAgIC8vIEdlbmVyYXRlIFRYIE1BQyBIZWFkZXIKLSAgICAgICAgICAgICAgICB2R2VuZXJhdGVNQUNIZWFkZXIocERldmljZSwgcGJ5TWFjSGRyLCAoV09SRCl1RHVyYXRpb24sIHBzRXRoSGVhZGVyLCBiTmVlZEVuY3J5cHQsCisgICAgICAgICAgICAgICAgdkdlbmVyYXRlTUFDSGVhZGVyKHBEZXZpY2UsIHBieU1hY0hkciwgKHVuc2lnbmVkIHNob3J0KXVEdXJhdGlvbiwgcHNFdGhIZWFkZXIsIGJOZWVkRW5jcnlwdCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd0ZyYWdUeXBlLCB1RE1BSWR4LCB1RnJhZ0lkeCk7CiAKLSAgICAgICAgICAgICAgICBpZiAoYk5lZWRFbmNyeXB0ID09IFRSVUUpIHsKKyAgICAgICAgICAgICAgICBpZiAoYk5lZWRFbmNyeXB0ID09IHRydWUpIHsKICAgICAgICAgICAgICAgICAgICAgLy9GaWxsIFRYS0VZCi0gICAgICAgICAgICAgICAgICAgIHNfdkZpbGxUeEtleShwRGV2aWNlLCAoUEJZVEUpKHBzVHhCdWZIZC0+YWR3VHhLZXkpLCBwYnlJVkhlYWQsIHBUcmFuc21pdEtleSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBieU1hY0hkciwgKFdPUkQpY2JMYXN0RnJhZ1BheWxvYWRTaXplLCAoUEJZVEUpcE1JQ0hEUik7CisgICAgICAgICAgICAgICAgICAgIHNfdkZpbGxUeEtleShwRGV2aWNlLCAodW5zaWduZWQgY2hhciAqKShwc1R4QnVmSGQtPmFkd1R4S2V5KSwgcGJ5SVZIZWFkLCBwVHJhbnNtaXRLZXksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYnlNYWNIZHIsICh1bnNpZ25lZCBzaG9ydCljYkxhc3RGcmFnUGF5bG9hZFNpemUsICh1bnNpZ25lZCBjaGFyICopcE1JQ0hEUik7CiAKICAgICAgICAgICAgICAgICAgICAgaWYgKHBEZXZpY2UtPmJFbmFibGVIb3N0V0VQKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlW3VOb2RlSW5kZXhdLmR3VFNDNDdfMTYgPSBwVHJhbnNtaXRLZXktPmR3VFNDNDdfMTY7CkBAIC0xNzM0LDggKzE3MDksOCBAQAogCiAKIAotICAgICAgICAgICAgICAgIHBieUJ1ZmZlciA9IChQQllURSlwSGVhZFRELT5wVERJbmZvLT5idWY7Ci0gICAgICAgICAgICAgICAgLy9wYnlCdWZmZXIgPSAoUEJZVEUpcERldmljZS0+YWFtVHhCdWZbdURNQUlkeF1bdG1wRGVzY0lkeF0ucGJ5VkFkZHI7CisgICAgICAgICAgICAgICAgcGJ5QnVmZmVyID0gKHVuc2lnbmVkIGNoYXIgKilwSGVhZFRELT5wVERJbmZvLT5idWY7CisgICAgICAgICAgICAgICAgLy9wYnlCdWZmZXIgPSAodW5zaWduZWQgY2hhciAqKXBEZXZpY2UtPmFhbVR4QnVmW3VETUFJZHhdW3RtcERlc2NJZHhdLnBieVZBZGRyOwogCiAgICAgICAgICAgICAgICAgdUxlbmd0aCA9IGNiSGVhZGVyTGVuZ3RoICsgY2JNQUNIZExlbiArIHVQYWRkaW5nICsgY2JJVmxlbjsKIApAQCAtMTc0Myw3ICsxNzE4LDcgQEAKICAgICAgICAgICAgICAgICBtZW1jcHkocGJ5QnVmZmVyLCAodm9pZCAqKXBzVHhCdWZIZCwgdUxlbmd0aCk7CiAKICAgICAgICAgICAgICAgICAvLyBDb3B5IHRoZSBQYWNrZXQgaW50byBhIHR4IEJ1ZmZlcgotICAgICAgICAgICAgICAgIGlmIChiTUlDMkZyYWcgPT0gRkFMU0UpIHsKKyAgICAgICAgICAgICAgICBpZiAoYk1JQzJGcmFnID09IGZhbHNlKSB7CiAKICAgICAgICAgICAgICAgICAgICAgbWVtY3B5KChwYnlCdWZmZXIgKyB1TGVuZ3RoKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBQYWNrZXQgKyAxNCArIHVUb3RhbENvcHlMZW5ndGgpLApAQCAtMTc1MywzNiArMTcyOCwzNiBAQAogICAgICAgICAgICAgICAgICAgICB1VG1wTGVuID0gY2JMYXN0RnJhZ1BheWxvYWRTaXplIC0gY2JNSUNsZW47CiAKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKChiTmVlZEVuY3J5cHQgPT0gVFJVRSkgJiYgKHBUcmFuc21pdEtleSAhPSBOVUxMKSAmJiAocFRyYW5zbWl0S2V5LT5ieUNpcGhlclN1aXRlID09IEtFWV9DVExfVEtJUCkpIHsKKyAgICAgICAgICAgICAgICBpZiAoKGJOZWVkRW5jcnlwdCA9PSB0cnVlKSAmJiAocFRyYW5zbWl0S2V5ICE9IE5VTEwpICYmIChwVHJhbnNtaXRLZXktPmJ5Q2lwaGVyU3VpdGUgPT0gS0VZX0NUTF9US0lQKSkgewogICAgICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPIkxBU1Q6IHVNSUNGcmFnTGVuOiVkLCBjYkxhc3RGcmFnUGF5bG9hZFNpemU6JWQsIHVUbXBMZW46JWRcbiIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVNSUNGcmFnTGVuLCBjYkxhc3RGcmFnUGF5bG9hZFNpemUsIHVUbXBMZW4pOwogCi0gICAgICAgICAgICAgICAgICAgIGlmIChiTUlDMkZyYWcgPT0gRkFMU0UpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGJNSUMyRnJhZyA9PSBmYWxzZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVUbXBMZW4gIT0gMCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNSUNfdkFwcGVuZCgocGJ5QnVmZmVyICsgdUxlbmd0aCksIHVUbXBMZW4pOwotICAgICAgICAgICAgICAgICAgICAgICAgcGR3TUlDX0wgPSAoUERXT1JEKShwYnlCdWZmZXIgKyB1TGVuZ3RoICsgdVRtcExlbik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwZHdNSUNfUiA9IChQRFdPUkQpKHBieUJ1ZmZlciArIHVMZW5ndGggKyB1VG1wTGVuICsgNCk7CisgICAgICAgICAgICAgICAgICAgICAgICBwZHdNSUNfTCA9ICh1bnNpZ25lZCBsb25nICopKHBieUJ1ZmZlciArIHVMZW5ndGggKyB1VG1wTGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBkd01JQ19SID0gKHVuc2lnbmVkIGxvbmcgKikocGJ5QnVmZmVyICsgdUxlbmd0aCArIHVUbXBMZW4gKyA0KTsKICAgICAgICAgICAgICAgICAgICAgICAgIE1JQ192R2V0TUlDKHBkd01JQ19MLCBwZHdNSUNfUik7CiAgICAgICAgICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPIkxhc3QgTUlDOiVsWCwgJWxYXG4iLCAqcGR3TUlDX0wsICpwZHdNSUNfUik7CiAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodU1JQ0ZyYWdMZW4gPj0gNCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lbWNweSgocGJ5QnVmZmVyICsgdUxlbmd0aCksICgoUEJZVEUpJmR3U2FmZU1JQ19SICsgKHVNSUNGcmFnTGVuIC0gNCkpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lbWNweSgocGJ5QnVmZmVyICsgdUxlbmd0aCksICgodW5zaWduZWQgY2hhciAqKSZkd1NhZmVNSUNfUiArICh1TUlDRnJhZ0xlbiAtIDQpKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY2JNSUNsZW4gLSB1TUlDRnJhZ0xlbikpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8iTEFTVDogdU1JQ0ZyYWdMZW4gPj0gNDogJVgsICVkXG4iLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICooUEJZVEUpKChQQllURSkmZHdTYWZlTUlDX1IgKyAodU1JQ0ZyYWdMZW4gLSA0KSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKih1bnNpZ25lZCBjaGFyICopKCh1bnNpZ25lZCBjaGFyICopJmR3U2FmZU1JQ19SICsgKHVNSUNGcmFnTGVuIC0gNCkpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjYk1JQ2xlbiAtIHVNSUNGcmFnTGVuKSk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVtY3B5KChwYnlCdWZmZXIgKyB1TGVuZ3RoKSwgKChQQllURSkmZHdTYWZlTUlDX0wgKyB1TUlDRnJhZ0xlbiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVtY3B5KChwYnlCdWZmZXIgKyB1TGVuZ3RoKSwgKCh1bnNpZ25lZCBjaGFyICopJmR3U2FmZU1JQ19MICsgdU1JQ0ZyYWdMZW4pLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICg0IC0gdU1JQ0ZyYWdMZW4pKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZW1jcHkoKHBieUJ1ZmZlciArIHVMZW5ndGggKyAoNCAtIHVNSUNGcmFnTGVuKSksICZkd1NhZmVNSUNfUiwgNCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyJMQVNUOiB1TUlDRnJhZ0xlbiA8IDQ6ICVYLCAlZFxuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKFBCWVRFKSgoUEJZVEUpJmR3U2FmZU1JQ19SICsgdU1JQ0ZyYWdMZW4gLSA0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHVuc2lnbmVkIGNoYXIgKikoKHVuc2lnbmVkIGNoYXIgKikmZHdTYWZlTUlDX1IgKyB1TUlDRnJhZ0xlbiAtIDQpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjYk1JQ2xlbiAtIHVNSUNGcmFnTGVuKSk7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAvKgogICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpaSA9IDA7IGlpIDwgY2JMYXN0RnJhZ1BheWxvYWRTaXplICsgOCArIDI0OyBpaSsrKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyIlMDJ4ICIsICooKFBCWVRFKSgocGJ5QnVmZmVyICsgdUxlbmd0aCkgKyBpaSAtIDggLSAyNCkpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPIiUwMnggIiwgKigodW5zaWduZWQgY2hhciAqKSgocGJ5QnVmZmVyICsgdUxlbmd0aCkgKyBpaSAtIDggLSAyNCkpKTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8iXG5cbiIpOwogICAgICAgICAgICAgICAgICAgICAgICAgKi8KQEAgLTE3OTgsNyArMTc3Myw3IEBACiAgICAgICAgICAgICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICAgICAgICAgICAgICAgICBpZiAoKHBEZXZpY2UtPmJ5TG9jYWxJRCA8PSBSRVZfSURfVlQzMjUzX0ExKSkgewogICAgICAgICAgICAgICAgICAgICBpZiAoYk5lZWRFbmNyeXB0KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzX3ZTV2VuY3J5cHRpb24ocERldmljZSwgcFRyYW5zbWl0S2V5LCAocGJ5QnVmZmVyICsgdUxlbmd0aCksIChXT1JEKWNiTGFzdEZyYWdQYXlsb2FkU2l6ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzX3ZTV2VuY3J5cHRpb24ocERldmljZSwgcFRyYW5zbWl0S2V5LCAocGJ5QnVmZmVyICsgdUxlbmd0aCksICh1bnNpZ25lZCBzaG9ydCljYkxhc3RGcmFnUGF5bG9hZFNpemUpOwogICAgICAgICAgICAgICAgICAgICAgICAgY2JSZXFDb3VudCArPSBjYklDVmxlbjsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KQEAgLTE4NDEsMTQgKzE4MTYsMTQgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdUZyYWdJZHgsIGNiTGFzdEZyYWdtZW50U2l6ZSwgdU1BQ2ZyYWdOdW0sIGJ5RkJPcHRpb24sIHBEZXZpY2UtPndDdXJyZW50UmF0ZSk7CiAKICAgICAgICAgICAgICAgICAvLyBHZW5lcmF0ZSBUWCBNQUMgSGVhZGVyCi0gICAgICAgICAgICAgICAgdkdlbmVyYXRlTUFDSGVhZGVyKHBEZXZpY2UsIHBieU1hY0hkciwgKFdPUkQpdUR1cmF0aW9uLCBwc0V0aEhlYWRlciwgYk5lZWRFbmNyeXB0LAorICAgICAgICAgICAgICAgIHZHZW5lcmF0ZU1BQ0hlYWRlcihwRGV2aWNlLCBwYnlNYWNIZHIsICh1bnNpZ25lZCBzaG9ydCl1RHVyYXRpb24sIHBzRXRoSGVhZGVyLCBiTmVlZEVuY3J5cHQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdGcmFnVHlwZSwgdURNQUlkeCwgdUZyYWdJZHgpOwogCiAKLSAgICAgICAgICAgICAgICBpZiAoYk5lZWRFbmNyeXB0ID09IFRSVUUpIHsKKyAgICAgICAgICAgICAgICBpZiAoYk5lZWRFbmNyeXB0ID09IHRydWUpIHsKICAgICAgICAgICAgICAgICAgICAgLy9GaWxsIFRYS0VZCi0gICAgICAgICAgICAgICAgICAgIHNfdkZpbGxUeEtleShwRGV2aWNlLCAoUEJZVEUpKHBzVHhCdWZIZC0+YWR3VHhLZXkpLCBwYnlJVkhlYWQsIHBUcmFuc21pdEtleSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBieU1hY0hkciwgKFdPUkQpY2JGcmFnUGF5bG9hZFNpemUsIChQQllURSlwTUlDSERSKTsKKyAgICAgICAgICAgICAgICAgICAgc192RmlsbFR4S2V5KHBEZXZpY2UsICh1bnNpZ25lZCBjaGFyICopKHBzVHhCdWZIZC0+YWR3VHhLZXkpLCBwYnlJVkhlYWQsIHBUcmFuc21pdEtleSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBieU1hY0hkciwgKHVuc2lnbmVkIHNob3J0KWNiRnJhZ1BheWxvYWRTaXplLCAodW5zaWduZWQgY2hhciAqKXBNSUNIRFIpOwogCiAgICAgICAgICAgICAgICAgICAgIGlmIChwRGV2aWNlLT5iRW5hYmxlSG9zdFdFUCkgewogICAgICAgICAgICAgICAgICAgICAgICAgcE1nbXQtPnNOb2RlREJUYWJsZVt1Tm9kZUluZGV4XS5kd1RTQzQ3XzE2ID0gcFRyYW5zbWl0S2V5LT5kd1RTQzQ3XzE2OwpAQCAtMTg2MiwxNCArMTgzNywxNCBAQAogICAgICAgICAgICAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiAgICAgICAgICAgICAgICAgLy9GaWxsIE1JQ0hEUgogICAgICAgICAgICAgICAgIC8vaWYgKHBEZXZpY2UtPmJBRVMpIHsKLSAgICAgICAgICAgICAgICAvLyAgICBzX3ZGaWxsTUlDSERSKHBEZXZpY2UsIChQQllURSlwTUlDSERSLCBwYnlNYWNIZHIsIChXT1JEKWNiRnJhZ1BheWxvYWRTaXplKTsKKyAgICAgICAgICAgICAgICAvLyAgICBzX3ZGaWxsTUlDSERSKHBEZXZpY2UsICh1bnNpZ25lZCBjaGFyICopcE1JQ0hEUiwgcGJ5TWFjSGRyLCAodW5zaWduZWQgc2hvcnQpY2JGcmFnUGF5bG9hZFNpemUpOwogICAgICAgICAgICAgICAgIC8vfQogICAgICAgICAgICAgICAgIC8vY2JSZXFDb3VudCArPSBzX3VEb0VuY3J5cHRpb24ocERldmljZSwgcHNFdGhIZWFkZXIsICh2b2lkICopcHNUeEJ1ZkhkLCBieUtleVNlbCwKLSAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBieVBheWxvYWRIZWFkLCAoV09SRCljYkZyYWdQYXlsb2FkU2l6ZSwgdURNQUlkeCk7CisgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYnlQYXlsb2FkSGVhZCwgKHVuc2lnbmVkIHNob3J0KWNiRnJhZ1BheWxvYWRTaXplLCB1RE1BSWR4KTsKIAogCi0gICAgICAgICAgICAgICAgcGJ5QnVmZmVyID0gKFBCWVRFKXBIZWFkVEQtPnBUREluZm8tPmJ1ZjsKLSAgICAgICAgICAgICAgICAvL3BieUJ1ZmZlciA9IChQQllURSlwRGV2aWNlLT5hYW1UeEJ1Zlt1RE1BSWR4XVt0bXBEZXNjSWR4XS5wYnlWQWRkcjsKKyAgICAgICAgICAgICAgICBwYnlCdWZmZXIgPSAodW5zaWduZWQgY2hhciAqKXBIZWFkVEQtPnBUREluZm8tPmJ1ZjsKKyAgICAgICAgICAgICAgICAvL3BieUJ1ZmZlciA9ICh1bnNpZ25lZCBjaGFyICopcERldmljZS0+YWFtVHhCdWZbdURNQUlkeF1bdG1wRGVzY0lkeF0ucGJ5VkFkZHI7CiAKIAogICAgICAgICAgICAgICAgIHVMZW5ndGggPSBjYkhlYWRlckxlbmd0aCArIGNiTUFDSGRMZW4gKyB1UGFkZGluZyArIGNiSVZsZW47CkBAIC0xODg2LDE3ICsxODYxLDE3IEBACiAKICAgICAgICAgICAgICAgICB1VG90YWxDb3B5TGVuZ3RoICs9IHVUbXBMZW47CiAKLSAgICAgICAgICAgICAgICBpZiAoKGJOZWVkRW5jcnlwdCA9PSBUUlVFKSAmJiAocFRyYW5zbWl0S2V5ICE9IE5VTEwpICYmIChwVHJhbnNtaXRLZXktPmJ5Q2lwaGVyU3VpdGUgPT0gS0VZX0NUTF9US0lQKSkgeworICAgICAgICAgICAgICAgIGlmICgoYk5lZWRFbmNyeXB0ID09IHRydWUpICYmIChwVHJhbnNtaXRLZXkgIT0gTlVMTCkgJiYgKHBUcmFuc21pdEtleS0+YnlDaXBoZXJTdWl0ZSA9PSBLRVlfQ1RMX1RLSVApKSB7CiAKICAgICAgICAgICAgICAgICAgICAgTUlDX3ZBcHBlbmQoKHBieUJ1ZmZlciArIHVMZW5ndGgpLCB1VG1wTGVuKTsKIAogICAgICAgICAgICAgICAgICAgICBpZiAodVRtcExlbiA8IGNiRnJhZ1BheWxvYWRTaXplKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBiTUlDMkZyYWcgPSBUUlVFOworICAgICAgICAgICAgICAgICAgICAgICAgYk1JQzJGcmFnID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgIHVNSUNGcmFnTGVuID0gY2JGcmFnUGF5bG9hZFNpemUgLSB1VG1wTGVuOwogICAgICAgICAgICAgICAgICAgICAgICAgQVNTRVJUKHVNSUNGcmFnTGVuIDwgY2JNSUNsZW4pOwogCi0gICAgICAgICAgICAgICAgICAgICAgICBwZHdNSUNfTCA9IChQRFdPUkQpKHBieUJ1ZmZlciArIHVMZW5ndGggKyB1VG1wTGVuKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBkd01JQ19SID0gKFBEV09SRCkocGJ5QnVmZmVyICsgdUxlbmd0aCArIHVUbXBMZW4gKyA0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBkd01JQ19MID0gKHVuc2lnbmVkIGxvbmcgKikocGJ5QnVmZmVyICsgdUxlbmd0aCArIHVUbXBMZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgcGR3TUlDX1IgPSAodW5zaWduZWQgbG9uZyAqKShwYnlCdWZmZXIgKyB1TGVuZ3RoICsgdVRtcExlbiArIDQpOwogICAgICAgICAgICAgICAgICAgICAgICAgTUlDX3ZHZXRNSUMocGR3TUlDX0wsIHBkd01JQ19SKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGR3U2FmZU1JQ19MID0gKnBkd01JQ19MOwogICAgICAgICAgICAgICAgICAgICAgICAgZHdTYWZlTUlDX1IgPSAqcGR3TUlDX1I7CkBAIC0xOTA2LDcgKzE4ODEsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyJGaWxsIE1JQyBpbiBNaWRkbGUgZnJhZyBbJWRdXG4iLCB1TUlDRnJhZ0xlbik7CiAgICAgICAgICAgICAgICAgICAgICAgICAvKgogICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpaSA9IDA7IGlpIDwgdU1JQ0ZyYWdMZW47IGlpKyspIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPIiUwMnggIiwgKigoUEJZVEUpKChwYnlCdWZmZXIgKyB1TGVuZ3RoICsgdVRtcExlbikgKyBpaSkpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPIiUwMnggIiwgKigodW5zaWduZWQgY2hhciAqKSgocGJ5QnVmZmVyICsgdUxlbmd0aCArIHVUbXBMZW4pICsgaWkpKSk7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPIlxuIik7CiAgICAgICAgICAgICAgICAgICAgICAgICAqLwpAQCAtMTkxNSw3ICsxODkwLDcgQEAKICAgICAgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyJNaWRkbGUgZnJhZyBsZW46ICVkXG4iLCB1VG1wTGVuKTsKICAgICAgICAgICAgICAgICAgICAgLyoKICAgICAgICAgICAgICAgICAgICAgZm9yIChpaSA9IDA7IGlpIDwgdVRtcExlbjsgaWkrKykgewotICAgICAgICAgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyIlMDJ4ICIsICooKFBCWVRFKSgocGJ5QnVmZmVyICsgdUxlbmd0aCkgKyBpaSkpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8iJTAyeCAiLCAqKCh1bnNpZ25lZCBjaGFyICopKChwYnlCdWZmZXIgKyB1TGVuZ3RoKSArIGlpKSkpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8iXG5cbiIpOwogICAgICAgICAgICAgICAgICAgICAqLwpAQCAtMTkyNiw3ICsxOTAxLDcgQEAKIAogICAgICAgICAgICAgICAgIGlmICgocERldmljZS0+YnlMb2NhbElEIDw9IFJFVl9JRF9WVDMyNTNfQTEpKSB7CiAgICAgICAgICAgICAgICAgICAgIGlmIChiTmVlZEVuY3J5cHQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNfdlNXZW5jcnlwdGlvbihwRGV2aWNlLCBwVHJhbnNtaXRLZXksIChwYnlCdWZmZXIgKyB1TGVuZ3RoKSwgKFdPUkQpY2JGcmFnUGF5bG9hZFNpemUpOworICAgICAgICAgICAgICAgICAgICAgICAgc192U1dlbmNyeXB0aW9uKHBEZXZpY2UsIHBUcmFuc21pdEtleSwgKHBieUJ1ZmZlciArIHVMZW5ndGgpLCAodW5zaWduZWQgc2hvcnQpY2JGcmFnUGF5bG9hZFNpemUpOwogICAgICAgICAgICAgICAgICAgICAgICAgY2JSZXFDb3V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UUpIHsKKyAgICAgICAgaWYgKGJOZWVkRW5jcnlwdCA9PSB0cnVlKSB7CiAgICAgICAgICAgICAvL0ZpbGwgVFhLRVkKLSAgICAgICAgICAgIHNfdkZpbGxUeEtleShwRGV2aWNlLCAoUEJZVEUpKHBzVHhCdWZIZC0+YWR3VHhLZXkpLCBwYnlJVkhlYWQsIHBUcmFuc21pdEtleSwKLSAgICAgICAgICAgICAgICAgICAgICAgICBwYnlNYWNIZHIsIChXT1JEKWNiRnJhbWVCb2R5U2l6ZSwgKFBCWVRFKXBNSUNIRFIpOworICAgICAgICAgICAgc192RmlsbFR4S2V5KHBEZXZpY2UsICh1bnNpZ25lZCBjaGFyICopKHBzVHhCdWZIZC0+YWR3VHhLZXkpLCBwYnlJVkhlYWQsIHBUcmFuc21pdEtleSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBwYnlNYWNIZHIsICh1bnNpZ25lZCBzaG9ydCljYkZyYW1lQm9keVNpemUsICh1bnNpZ25lZCBjaGFyICopcE1JQ0hEUik7CiAKICAgICAgICAgICAgIGlmIChwRGV2aWNlLT5iRW5hYmxlSG9zdFdFUCkgewogICAgICAgICAgICAgICAgIHBNZ210LT5zTm9kZURCVGFibGVbdU5vZGVJbmRleF0uZHdUU0M0N18xNiA9IHBUcmFuc21pdEtleS0+ZHdUU0M0N18xNjsKQEAgLTE5ODksMTMgKzE5NjQsMTMgQEAKICAgICAgICAgaWYgKG50b2hzKHBzRXRoSGVhZGVyLT53VHlwZSkgPiBFVEhfREFUQV9MRU4pIHsKICAgICAgICAgICAgIGlmICgocHNFdGhIZWFkZXItPndUeXBlID09IFRZUEVfUEtUX0lQWCkgfHwKICAgICAgICAgICAgICAgICAocHNFdGhIZWFkZXItPndUeXBlID09IGNwdV90b19sZTE2KDB4RjM4MCkpKSB7Ci0gICAgICAgICAgICAgICAgbWVtY3B5KChQQllURSkgKHBieVBheWxvYWRIZWFkKSwgJnBEZXZpY2UtPmFieVNOQVBfQnJpZGdldHVubmVsWzBdLCA2KTsKKyAgICAgICAgICAgICAgICBtZW1jcHkoKHVuc2lnbmVkIGNoYXIgKikgKHBieVBheWxvYWRIZWFkKSwgJnBEZXZpY2UtPmFieVNOQVBfQnJpZGdldHVubmVsWzBdLCA2KTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGVsc2UgewotICAgICAgICAgICAgICAgIG1lbWNweSgoUEJZVEUpIChwYnlQYXlsb2FkSGVhZCksICZwRGV2aWNlLT5hYnlTTkFQX1JGQzEwNDJbMF0sIDYpOworICAgICAgICAgICAgICAgIG1lbWNweSgodW5zaWduZWQgY2hhciAqKSAocGJ5UGF5bG9hZEhlYWQpLCAmcERldmljZS0+YWJ5U05BUF9SRkMxMDQyWzBdLCA2KTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHBieVR5cGUgPSAoUEJZVEUpIChwYnlQYXlsb2FkSGVhZCArIDYpOwotICAgICAgICAgICAgbWVtY3B5KHBieVR5cGUsICYocHNFdGhIZWFkZXItPndUeXBlKSwgc2l6ZW9mKFdPUkQpKTsKKyAgICAgICAgICAgIHBieVR5cGUgPSAodW5zaWduZWQgY2hhciAqKSAocGJ5UGF5bG9hZEhlYWQgKyA2KTsKKyAgICAgICAgICAgIG1lbWNweShwYnlUeXBlLCAmKHBzRXRoSGVhZGVyLT53VHlwZSksIHNpemVvZih1bnNpZ25lZCBzaG9ydCkpOwogICAgICAgICAgICAgY2I4MDJfMV9IX2xlbiA9IDg7CiAgICAgICAgIH0KIApAQCAtMjAwNiwxMSArMTk4MSwxMSBAQAogICAgICAgICAvL0ZpbGwgTUlDSERSCiAgICAgICAgIC8vaWYgKHBEZXZpY2UtPmJBRVMpIHsKICAgICAgICAgLy8gICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyJGaWxsIE1JQ0hEUi4uLlxuIik7Ci0gICAgICAgIC8vICAgIHNfdkZpbGxNSUNIRFIocERldmljZSwgKFBCWVRFKXBNSUNIRFIsIHBieU1hY0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lID09IEtFWV9DVExfVEtJUCkpewogCiAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPIkxlbmd0aDolZCwgJWRcbiIsIGNiRnJhbWVCb2R5U2l6ZSAtIGNiODAyXzFfSF9sZW4sIHVMZW5ndGgpOwogICAgICAgICAgICAgLyoKICAgICAgICAgICAgIGZvciAoaWkgPSAwOyBpaSA8IChjYkZyYW1lQm9keVNpemUgLSBjYjgwMl8xX0hfbGVuKTsgaWkrKykgewotICAgICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8iJTAyeCAiLCAqKChQQllURSkoKHBieUJ1ZmZlciArIHVMZW5ndGgpICsgaWkpKSk7CisgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyIlMDJ4ICIsICooKHVuc2lnbmVkIGNoYXIgKikoKHBieUJ1ZmZlciArIHVMZW5ndGgpICsgaWkpKSk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPIlxuIik7CiAgICAgICAgICAgICAqLwogCiAgICAgICAgICAgICBNSUNfdkFwcGVuZCgocGJ5QnVmZmVyICsgdUxlbmd0aCAtIGNiODAyXzFfSF9sZW4pLCBjYkZyYW1lQm9keVNpemUpOwogCi0gICAgICAgICAgICBwZHdNSUNfTCA9IChQRFdPUkQpKHBieUJ1ZmZlciArIHVMZW5ndGggLSBjYjgwMl8xX0hfbGVuICsgY2JGcmFtZUJvZHlTaXplKTsKLSAgICAgICAgICAgIHBkd01JQ19SID0gKFBEV09SRCkocGJ5QnVmZmVyICsgdUxlbmd0aCAtIGNiODAyXzFfSF9sZW4gKyBjYkZyYW1lQm9keVNpemUgKyA0KTsKKyAgICAgICAgICAgIHBkd01JQ19MID0gKHVuc2lnbmVkIGxvbmcgKikocGJ5QnVmZmVyICsgdUxlbmd0aCAtIGNiODAyXzFfSF9sZW4gKyBjYkZyYW1lQm9keVNpemUpOworICAgICAgICAgICAgcGR3TUlDX1IgPSAodW5zaWduZWQgbG9uZyAqKShwYnlCdWZmZXIgKyB1TGVuZ3RoIC0gY2I4MDJfMV9IX2xlbiArIGNiRnJhbWVCb2R5U2l6ZSArIDQpOwogCiAgICAgICAgICAgICBNSUNfdkdldE1JQyhwZHdNSUNfTCwgcGR3TUlDX1IpOwogICAgICAgICAgICAgTUlDX3ZVbkluaXQoKTsKIAogCi0gICAgICAgICAgICBpZiAocERldmljZS0+YlR4TUlDRmFpbCA9PSBUUlVFKSB7CisgICAgICAgICAgICBpZiAocERldmljZS0+YlR4TUlDRmFpbCA9PSB0cnVlKSB7CiAgICAgICAgICAgICAgICAgKnBkd01JQ19MID0gMDsKICAgICAgICAgICAgICAgICAqcGR3TUlDX1IgPSAwOwotICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJUeE1JQ0ZhaWwgPSBGQUxTRTsKKyAgICAgICAgICAgICAgICBwRGV2aWNlLT5iVHhNSUNGYWlsID0gZmFsc2U7CiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8idUxlbmd0aDogJWQsICVkXG4iLCB1TGVuZ3RoLCBjYkZyYW1lQm9keVNpemUpOwpAQCAtMjA1Myw3ICsyMDI4LDcgQEAKICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8iTUlDOiVseCwgJWx4XG4iLCAqcGR3TUlDX0wsICpwZHdNSUNfUik7CiAvKgogICAgICAgICAgICAgZm9yIChpaSA9IDA7IGlpIDwgODsgaWkrKykgewotICAgICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8iJTAyeCAiLCAqKCgoUEJZVEUpKHBkd01JQ19MKSArIGlpKSkpOworICAgICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8iJTAyeCAiLCAqKCgodW5zaWduZWQgY2hhciAqKShwZHdNSUNfTCkgKyBpaSkpKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8iXG4iKTsKICovCkBAIC0yMDY0LDcgKzIwMzksNyBAQAogICAgICAgICBpZiAoKHBEZXZpY2UtPmJ5TG9jYWxJRCA8PSBSRVZfSURfVlQzMjUzX0ExKSl7CiAgICAgICAgICAgICBpZiAoYk5lZWRFbmNyeXB0KSB7CiAgICAgICAgICAgICAgICAgc192U1dlbmNyeXB0aW9uKHBEZXZpY2UsIHBUcmFuc21pdEtleSwgKHBieUJ1ZmZlciArIHVMZW5ndGggLSBjYjgwMl8xX0hfbGVuKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFdPUkQpKGNiRnJhbWVCb2R5U2l6ZSArIGNiTUlDbGVuKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCBzaG9ydCkoY2JGcmFtZUJvZHlTaXplICsgY2JNSUNsZW4pKTsKICAgICAgICAgICAgICAgICBjYlJlcUNvdW50ICs9IGNiSUNWbGVuOwogICAgICAgICAgICAgfQogICAgICAgICB9CkBAIC0yMDc4LDcgKzIwNTMsNyBAQAogICAgICAgICBwdGRDdXJyLT5idWZmX2FkZHIgPSBjcHVfdG9fbGUzMihwdGRDdXJyLT5wVERJbmZvLT5za2JfZG1hKTsKICAgCSAgICAvL1NldCBUU1IxICYgUmVxQ291bnQgaW4gVHhEZXNjSGVhZAogICAgICAgICBwdGRDdXJyLT5tX3RkMVREMS5ieVRDUiB8PSAoVENSX1NUUCB8IFRDUl9FRFAgfCBFRE1TRFUpOwotICAgICAgICBwdGRDdXJyLT5tX3RkMVREMS53UmVxQ291bnQgPSBjcHVfdG9fbGUxNigoV09SRCkoY2JSZXFDb3VudCkpOworICAgICAgICBwdGRDdXJyLT5tX3RkMVREMS53UmVxQ291bnQgPSBjcHVfdG9fbGUxNigodW5zaWduZWQgc2hvcnQpKGNiUmVxQ291bnQpKTsKIAogICAgICAgICBwRGV2aWNlLT5pVERVc2VkW3VETUFJZHhdKys7CiAKQEAgLTIwOTQsMjYgKzIwNjksMTYgQEAKIAogCiB2b2lkCi12R2VuZXJhdGVGSUZPSGVhZGVyICgKLSAgICBQU0RldmljZSAgICAgICAgIHBEZXZpY2UsCi0gICAgQllURSAgICAgICAgICAgICBieVBrdFR5cGUsCi0gICAgUEJZVEUgICAgICAgICAgICBwYnlUeEJ1ZmZlckFkZHIsCi0gICAgQk9PTCAgICAgICAgICAgICBiTmVlZEVuY3J5cHQsCi0gICAgVUlOVCAgICAgICAgICAgICBjYlBheWxvYWRTaXplLAotICAgIFVJTlQgICAgICAgICAgICAgdURNQUlkeCwKLSAgICBQU1R4RGVzYyAgICAgICAgIHBIZWFkVEQsCi0gICAgUFNFdGhlcm5ldEhlYWRlciBwc0V0aEhlYWRlciwKLSAgICBQQllURSAgICAgICAgICAgIHBQYWNrZXQsCi0gICAgUFNLZXlJdGVtICAgICAgICBwVHJhbnNtaXRLZXksCi0gICAgVUlOVCAgICAgICAgICAgICB1Tm9kZUluZGV4LAotICAgIFBVSU5UICAgICAgICAgICAgcHVNQUNmcmFnTnVtLAotICAgIFBVSU5UICAgICAgICAgICAgcGNiSGVhZGVyU2l6ZQotICAgICkKK3ZHZW5lcmF0ZUZJRk9IZWFkZXIoUFNEZXZpY2UgcERldmljZSwgdW5zaWduZWQgY2hhciBieVBrdFR5cGUsIHVuc2lnbmVkIGNoYXIgKnBieVR4QnVmZmVyQWRkciwKKwlib29sIGJOZWVkRW5jcnlwdCwgdW5zaWduZWQgaW50IGNiUGF5bG9hZFNpemUsIHVuc2lnbmVkIGludCB1RE1BSWR4LAorCVBTVHhEZXNjIHBIZWFkVEQsIFBTRXRoZXJuZXRIZWFkZXIgcHNFdGhIZWFkZXIsIHVuc2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9IGZhbHNlOwogICAgIFBTVHhCdWZIZWFkICAgICBwVHhCdWZIZWFkOwotICAgIFVJTlQgICAgICAgICAgICBjYkZyYW1lU2l6ZTsKLSAgICBVSU5UICAgICAgICAgICAgY2JJVmxlbiA9IDA7Ci0gICAgVUlOVCAgICAgICAgICAgIGNiSUNWbGVuID0gMDsKLSAgICBVSU5UICAgICAgICAgICAgY2JNSUNsZW4gPSAwOwotICAgIFVJTlQgICAgICAgICAgICBjYkZDU2xlbiA9IDQ7Ci0gICAgVUlOVCAgICAgICAgICAgIHVQYWRkaW5nID0gMDsKLSAgICBXT1JEICAgICAgICAgICAgd1R4QnVmU2l6ZTsKLSAgICBVSU5UICAgICAgICAgICAgY2JNYWNIZExlbjsKKyAgICB1bnNpZ25lZCBpbnQgY2JGcmFtZVNpemU7CisgICAgdW5zaWduZWQgaW50IGNiSVZsZW4gPSAwOworICAgIHVuc2lnbmVkIGludCBjYklDVmxlbiA9IDA7CisgICAgdW5zaWduZWQgaW50IGNiTUlDbGVuID0gMDsKKyAgICB1bnNpZ25lZCBpbnQgY2JGQ1NsZW4gPSA0OworICAgIHVuc2lnbmVkIGludCB1UGFkZGluZyA9IDA7CisgICAgdW5zaWduZWQgc2hvcnQgd1R4QnVmU2l6ZTsKKyAgICB1bnNpZ25lZCBpbnQgY2JNYWNIZExlbjsKICAgICBTRXRoZXJuZXRIZWFkZXIgc0V0aEhlYWRlcjsKICAgICB2b2lkICogICAgICAgICAgcHZScnZUaW1lOwogICAgIHZvaWQgKiAgICAgICAgICBwTUlDSERSOwogICAgIFBTTWdtdE9iamVjdCAgICBwTWdtdCA9IHBEZXZpY2UtPnBNZ210OwotICAgIFdPUkQgICAgICAgICAgICB3Q3VycmVudFJhdGUgPSBSQVRFXzFNOworICAgIHVuc2lnbmVkIHNob3J0IHdDdXJyZW50UmF0ZSA9IFJBVEVfMU07CiAKIAogICAgIGlmIChBVkFJTF9URChwRGV2aWNlLCBUWVBFX1RYRE1BMCkgPD0gMCkgewp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dWZIZWFkLT5hZHdUeEtleSwgTlVMTCk7CisgICAgICAgIC8vc192RmlsbFR4S2V5KHBEZXZpY2UsICh1bnNpZ25lZCBjaGFyICopcFR4QnVmSGVhZC0+YWR3VHhLZXksIE5VTEwpOwogCiAgICAgICAgIC8vRmlsbCBJVihFeHRJVixSU05IRFIpCiAgICAgICAgIC8vc192RmlsbFByZVBheWxvYWQocERldmljZSwgcGJ5SVZIZWFkLCBOVUxMKTsKQEAgLTI1NTgsMTYgKzI1MjAsMTYgQEAKICAgICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICAgICAgICAgLy9GaWxsIE1JQ0hEUgogICAgICAgICAvL2lmIChwRGV2aWNlLT5iQUVTKSB7Ci0gICAgICAgIC8vICAgIHNfdkZpbGxNSUNIRFIocERldmljZSwgKFBCWVRFKXBNSUNIRFIsIChQQllURSlwTUFDSGVhZGVyLCAoV09SRCljYkZyYW1lQm9keVNpemUpOworICAgICAgICAvLyAgICBzX3ZGaWxsTUlDSERSKHBEZXZpY2UsICh1bnNpZ25lZCBjaGFyICopcE1JQ0hEUiwgKHVuc2lnbmVkIGNoYXIgKilwTUFDSGVhZGVyLCAodW5zaWduZWQgc2hvcnQpY2JGcmFtZUJvZHlTaXplKTsKICAgICAgICAgLy99CiAgICAgICAgIGRvIHsKICAgICAgICAgICAgIGlmICgocERldmljZS0+ZU9QTW9kZSA9PSBPUF9NT0RFX0lORlJBU1RSVUNUVVJFKSAmJgotICAgICAgICAgICAgICAgIChwRGV2aWNlLT5iTGlua1Bhc3MgPT0gVFJVRSkpIHsKKyAgICAgICAgICAgICAgICAocERldmljZS0+YkxpbmtQYXNzID09IHRydWUpKSB7CiAgICAgICAgICAgICAgICAgcGJ5QlNTSUQgPSBwRGV2aWNlLT5hYnlCU1NJRDsKICAgICAgICAgICAgICAgICAvLyBnZXQgcGFpcndpc2Uga2V5Ci0gICAgICAgICAgICAgICAgaWYgKEtleWJHZXRUcmFuc21pdEtleSgmKHBEZXZpY2UtPnNLZXkpLCBwYnlCU1NJRCwgUEFJUldJU0VfS0VZLCAmcFRyYW5zbWl0S2V5KSA9PSBGQUxTRSkgeworICAgICAgICAgICAgICAgIGlmIChLZXliR2V0VHJhbnNtaXRLZXkoJihwRGV2aWNlLT5zS2V5KSwgcGJ5QlNTSUQsIFBBSVJXSVNFX0tFWSwgJnBUcmFuc21pdEtleSkgPT0gZmFsc2UpIHsKICAgICAgICAgICAgICAgICAgICAgLy8gZ2V0IGdyb3VwIGtleQotICAgICAgICAgICAgICAgICAgICBpZihLZXliR2V0VHJhbnNtaXRLZXkoJihwRGV2aWNlLT5zS2V5KSwgcGJ5QlNTSUQsIEdST1VQX0tFWSwgJnBUcmFuc21pdEtleSkgPT0gVFJVRSkgeworICAgICAgICAgICAgICAgICAgICBpZihLZXliR2V0VHJhbnNtaXRLZXkoJihwRGV2aWNlLT5zS2V5KSwgcGJ5QlNTSUQsIEdST1VQX0tFWSwgJnBUcmFuc21pdEtleSkgPT0gdHJ1ZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyJHZXQgR1RLLlxuIik7CiAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgfQpAQCAtMjU3OCwxOSArMjU0MCwxOSBAQAogICAgICAgICAgICAgfQogICAgICAgICAgICAgLy8gZ2V0IGdyb3VwIGtleQogICAgICAgICAgICAgcGJ5QlNTSUQgPSBwRGV2aWNlLT5hYnlCcm9hZGNhc3RBZGRyOwotICAgICAgICAgICAgaWYoS2V5YkdldFRyYW5zbWl0S2V5KCYocERldmljZS0+c0tleSksIHBieUJTU0lELCBHUk9VUF9LRVksICZwVHJhbnNtaXRLZXkpID09IEZBTFNFKSB7CisgICAgICAgICAgICBpZihLZXliR2V0VHJhbnNtaXRLZXkoJihwRGV2aWNlLT5zS2V5KSwgcGJ5QlNTSUQsIEdST1VQX0tFWSwg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Njk4LDM4IEBACiAKIAogCi1VSU5UCit1bnNpZ25lZCBpbnQKIGNiR2V0RnJhZ0NvdW50ICgKICAgICBQU0RldmljZSAgICAgICAgIHBEZXZpY2UsCiAgICAgUFNLZXlJdGVtICAgICAgICBwVHJhbnNtaXRLZXksCi0gICAgVUlOVCAgICAgICAgICAgICBjYkZyYW1lQm9keVNpemUsCisgICAgdW5zaWduZWQgaW50IGNiRnJhbWVCb2R5U2l6ZSwKICAgICBQU0V0aGVybmV0SGVhZGVyIHBzRXRoSGVhZGVyCiAgICAgKQogewotICAgIFVJTlQgICAgICAgICAgIGNiTUFDSGRMZW47Ci0gICAgVUlOVCAgICAgICAgICAgY2JGcmFtZVNpemU7Ci0gICAgVUlOVCAgICAgICAgICAgY2JGcmFnbWVudFNpemU7IC8vSGRyKyhJVikrcGF5b2FkKyhNSUMpKyhJQ1YpK0ZDUwotICAgIFVJTlQgICAgICAgICAgIGNiRnJhZ1BheWxvYWRTaXplOwotICAgIFVJTlQgICAgICAgICAgIGNiTGFzdEZyYWdQYXlsb2FkU2l6ZTsKLSAgICBVSU5UICAgICAgICAgICBjYklWbGVuID0gMDsKLSAgICBVSU5UICAgICAgICAgICBjYklDVmxlbiA9IDA7Ci0gICAgVUlOVCAgICAgICAgICAgY2JNSUNsZW4gPSAwOwotICAgIFVJTlQgICAgICAgICAgIGNiRkNTbGVuID0gNDsKLSAgICBVSU5UICAgICAgICAgICB1TUFDZnJhZ051bSA9IDE7Ci0gICAgQk9PTCAgICAgICAgICAgYk5lZWRBQ0s7CisgICAgdW5zaWduZWQgaW50IGNiTUFDSGRMZW47CisgICAgdW5zaWduZWQgaW50IGNiRnJhbWVTaXplOworICAgIHVuc2lnbmVkIGludCBjYkZyYWdtZW50U2l6ZTsgLy9IZHIrKElWKStwYXlvYWQrKE1JQykrKElDVikrRkNTCisgICAgdW5zaWduZWQgaW50IGNiRnJhZ1BheWxvYWRTaXplOworICAgIHVuc2lnbmVkIGludCBjYkxhc3RGcmFnUGF5bG9hZFNpemU7CisgICAgdW5zaWduZWQgaW50IGNiSVZsZW4gPSAwOworICAgIHVuc2lnbmVkIGludCBjYklDVmxlbiA9IDA7CisgICAgdW5zaWduZWQgaW50IGNiTUlDbGVuID0gMDsKKyAgICB1bnNpZ25lZCBpbnQgY2JGQ1NsZW4gPSA0OworICAgIHVuc2lnbmVkIGludCB1TUFDZnJhZ051bSA9IDE7CisgICAgYm9vbCBiTmVlZEFDSzsKIAogCiAKICAgICBpZiAoKHBEZXZpY2UtPmVPUE1vZGUgPT0gT1BfTU9ERV9BREhPQykgfHwKICAgICAgICAgKHBEZXZpY2UtPmVPUE1vZGUgPT0gT1BfTU9ERV9BUCkpIHsKLSAgICAgICAgaWYgKElTX01VTFRJQ0FTVF9BRERSRVNTKCYocHNFdGhIZWFkZXItPmFieURzdEFkZHJbMF0pKSB8fAotICAgICAgICAgICAgSVNfQlJPQURDQVNUX0FERFJFU1MoJihwc0V0aEhlYWRlci0+YWJ5RHN0QWRkclswXSkpKSB7Ci0gICAgICAgICAgICBiTmVlZEFDSyA9IEZBTFNFOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgewotICAgICAgICAgICAgYk5lZWRBQ0sgPSBUUlVFOwotICAgICAgICB9CisgICAgICAgIGlmIChpc19tdWx0aWNhc3RfZXRoZXJfYWRkcigmKHBzRXRoSGVhZGVyLT5hYnlEc3RBZGRyWzBdKSkpCisgICAgICAgICAgICBiTmVlZEFDSyA9IGZhbHNlOworICAgICAgICBlbHNlCisgICAgICAgICAgICBiTmVlZEFDSyA9IHRydWU7CiAgICAgfQogICAgIGVsc2UgewogICAgICAgICAvLyBNU0RVcyBpbiBJbmZyYSBtb2RlIGFsd2F5cyBuZWVkIEFDSwotICAgICAgICBiTmVlZEFDSyA9IFRSVUU7CisgICAgICAgIGJOZWVkQUNLID0gdHJ1ZTsKICAgICB9CiAKICAgICBpZiAocERldmljZS0+YkxvbmdIZWFkZXIpCkBAIC0yNzc5LDcgKzI3MzgsNyBAQ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ICAgIHVuc2lnbmVkIGludCBjYlJlcUNvdW50OwogICAgIFBTODAyXzExSGVhZGVyICBwTUFDSGVhZGVyOwotICAgIFVJTlQgICAgICAgICAgICBjYkhlYWRlclNpemU7Ci0gICAgVUlOVCAgICAgICAgICAgIGNiRnJhbWVCb2R5U2l6ZTsKLSAgICBCT09MICAgICAgICAgICAgYk5lZWRBQ0s7Ci0gICAgQk9PTCAgICAgICAgICAgIGJJc1BTUE9MTCA9IEZBTFNFOworICAgIHVuc2lnbmVkIGludCBjYkhlYWRlclNpemU7CisgICAgdW5zaWduZWQgaW50IGNiRnJhbWVCb2R5U2l6ZTsKKyAgICBib29sIGJOZWVkQUNLOworICAgIGJvb2wgYklzUFNQT0xMID0gZmFsc2U7CiAgICAgUFNUeEJ1ZkhlYWQgICAgIHBUeEJ1ZkhlYWQ7Ci0gICAgVUlOVCAgICAgICAgICAgIGNiRnJhbWVTaXplOwotICAgIFVJTlQgICAgICAgICAgICBjYklWbGVuID0gMDsKLSAgICBVSU5UICAgICAgICAgICAgY2JJQ1ZsZW4gPSAwOwotICAgIFVJTlQgICAgICAgICAgICBjYk1JQ2xlbiA9IDA7Ci0gICAgVUlOVCAgICAgICAgICAgIGNiRkNTbGVuID0gNDsKLSAgICBVSU5UICAgICAgICAgICAgdVBhZGRpbmcgPSAwOwotICAgIFVJTlQgICAgICAgICAgICBjYk1JQ0hEUiA9IDA7Ci0gICAgVUlOVCAgICAgICAgICAgIHVMZW5ndGggPSAwOwotICAgIERXT1JEICAgICAgICAgICBkd01JQ0tleTAsIGR3TUlDS2V5MTsKLSAgICBEV09SRCAgICAgICAgICAgZHdNSUNfUHJpb3JpdHk7Ci0gICAgUERXT1JEICAgICAgICAgIHBkd01JQ19MOwotICAgIFBEV09SRCAgICAgICAgICBwZHdNSUNfUjsKLSAgICBXT1JEICAgICAgICAgICAgd1R4QnVmU2l6ZTsKLSAgICBVSU5UICAgICAgICAgICAgY2JNYWNIZExlbjsKKyAgICB1bnNpZ25lZCB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NUX0FERFJFU1MoJihwODAyMTFIZWFkZXItPnNBMy5hYnlBZGRyMVswXSkpIHx8Ci0gICAgICAgIElTX0JST0FEQ0FTVF9BRERSRVNTKCYocDgwMjExSGVhZGVyLT5zQTMuYWJ5QWRkcjFbMF0pKSkgewotICAgICAgICBiTmVlZEFDSyA9IEZBTFNFOworICAgIGlmIChpc19tdWx0aWNhc3RfZXRoZXJfYWRkcigmKHA4MDIxMUhlYWRlci0+c0EzLmFieUFkZHIxWzBdKSkpIHsKKyAgICAgICAgYk5lZWRBQ0sgPSBmYWxzZTsKICAgICAgICAgaWYgKHBEZXZpY2UtPmJFbmFibGVIb3N0V0VQKSB7CiAgICAgICAgICAgICB1Tm9kZUluZGV4ID0gMDsKLSAgICAgICAgICAgIGJOb2RlRXhpc3QgPSBUUlVFOworICAgICAgICAgICAgYk5vZGVFeGlzdCA9IHRydWU7CiAgICAgICAgIH07CiAgICAgfQogICAgIGVsc2UgewogICAgICAgICBpZiAocERldmljZS0+YkVuYWJsZUhvc3RXRVApIHsKLSAgICAgICAgICAgIGlmIChCU1NEQmJJc1NUQUluTm9kZURCKHBEZXZpY2UtPnBNZ210LCAoUEJZVEUpKHA4MDIxMUhlYWRlci0+c0EzLmFieUFkZHIxKSwgJnVOb2RlSW5kZXgpKQotICAgICAgICAgICAgICAgIGJOb2RlRXhpc3QgPSBUUlVFOworICAgICAgICAgICAgaWYgKEJTU0RCYklzU1RBSW5Ob2RlREIocERldmljZS0+cE1nbXQsICh1bnNpZ25lZCBjaGFyICopKHA4MDIxMUhlYWRlci0+c0EzLmFieUFkZHIxKSwgJnVOb2RlSW5kZXgpKQorICAgICAgICAgICAgICAgIGJOb2RlRXhpc3QgPSB0cnVlOwogICAgICAgICB9OwotICAgICAgICBiTmVlZEFDSyA9IFRSVUU7CisgICAgICAgIGJOZWVkQUNLID0gdHJ1ZTsKICAgICAgICAgcFR4QnVmSGVhZC0+d0ZJRk9DdGwgfD0gRklGT0NUTF9ORUVEQUNLOwogICA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ZHdNSUNfUiA9ICh1bnNpZ25lZCBsb25nICopKHBieVR4QnVmZmVyQWRkciArIHVMZW5ndGggKyBjYkZyYW1lQm9keVNpemUgKyA0KTsKIAogICAgICAgICAgICAgTUlDX3ZHZXRNSUMocGR3TUlDX0wsIHBkd01JQ19SKTsKICAgICAgICAgICAgIE1JQ192VW5Jbml0KCk7CiAKLSAgICAgICAgICAgIGlmIChwRGV2aWNlLT5iVHhNSUNGYWlsID09IFRSVUUpIHsKKyAgICAgICAgICAgIGlmIChwRGV2aWNlLT5iVHhNSUNGYWlsID09IHRydWUpIHsKICAgICAgICAgICAgICAgICAqcGR3TUlDX0wgPSAwOwogICAgICAgICAgICAgICAgICpwZHdNSUNfUiA9IDA7Ci0gICAgICAgICAgICAgICAgcERldmljZS0+YlR4TUlDRmFpbCA9IEZBTFNFOworICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJUeE1JQ0ZhaWwgPSBmYWxzZTsKICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyJ1TGVuZ3RoOiAlZCwgJWRcbiIsIHVMZW5ndGgsIGNiRnJhbWVCb2R5U2l6ZSk7CkBAIC0zMTYwLDggKzMxMTgsOCBAQAogICAgICAgICB9CiAKIAotICAgICAgICBzX3ZGaWxsVHhLZXkocERldmljZSwgKFBCWVRFKShwVHhCdWZIZWFkLT5hZHdUeEtleSksIHBieUlWSGVhZCwgcFRyYW5zbWl0S2V5LAotICAgICAgICAgICAgICAgICAgICAgcGJ5TWFjSGRyLCAoV09SRCljYkZyYW1lQm9keVNpemUsIChQQllURSlwTUlDSERSKTsKKyAgICAgICAgc192RmlsbFR4S2V5KHBEZXZpY2UsICh1bnNpZ25lZCBjaGFyICopKHBUeEJ1ZkhlYWQtPmFkd1R4S2V5KSwgcGJ5SVZIZWFkLCBwVHJhbnNtaXRLZXksCisgICAgICAgICAgICAgICAgICAgICBwYnlNYWNIZHIsICh1bnNp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xvbmcgZHdSeEJ1ZmZlckFkZHIsIHVuc2lnbmVkIGludCBjYlBhY2tldFNpemUsCisJYm9vbCBiSXNXRVAsIHVuc2lnbmVkIGludCAqcGNiSGVhZFNpemUpOwogKi8KIAogCiB2b2lkCiB2R2VuZXJhdGVNQUNIZWFkZXIgKAogICAgIFBTRGV2aWNlICAgICAgICAgcERldmljZSwKLSAgICBQQllURSAgICAgICAgICAgIHBieUJ1ZmZlckFkZHIsCi0gICAgV09SRCAgICAgICAgICAgICB3RHVyYXRpb24sCisgICAgdW5zaWduZWQgY2hhciAqcGJ5QnVmZmVyQWRkciwKKyAgICB1bnNpZ25lZCBzaG9ydCB3RHVyYXRpb24sCiAgICAgUFNFdGhlcm5ldEhlYWRlciBwc0V0aEhlYWRlciwKLSAgICBCT09MICAgICAgICAgICAgIGJOZWVkRW5jcnlwdCwKLSAgICBXT1JEICAgICAgICAgICAgIHdGcmFnVHlwZSwKLSAgICBVSU5UICAgICAgICAgICAgIHVETUFJZHgsCi0gICAgVUlOVCAgICAgICAgICAgICB1RnJhZ0lkeAorICAgIGJvb2wgYk5lZWRFbmNyeXB0LAorICAgIHVuc2lnbmVkIHNob3J0IHdGcmFnVHlwZSwKKyAgICB1bnNpZ25lZCBpbnQgdURNQUlkeCwKKyAgICB1bnNpZ25lZCBpbnQgdUZyYWdJZHgKICAgICApOwogCiAKLVVJTlQKK3Vuc2lnbmVkIGludAogY2JHZXRGcmFnQ291bnQoCiAgICAgUFNEZXZpY2UgICAgICAgICBwRGV2aWNlLAogICAgIFBTS2V5SXRlbSAgICAgICAgcFRyYW5zbWl0S2V5LAotICAgIFVJTlQgICAgICAgICAgICAgY2JGcmFtZUJvZHlTaXplLAorICAgIHVuc2lnbmVkIGludAljYkZyYW1lQm9keVNpemUsCiAgICAgUFNFdGhlcm5ldEhlYWRlciBwc0V0aEhlYWRlcgogICAgICk7CiAKIAogdm9pZAotdkdlbmVyYXRlRklGT0hlYWRlciAoCi0gICAgUFNEZXZpY2UgIC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BjaGFyIGJ5QkNGRzA7ICAgICAgICAgICAgICAgICAgICAvLyAweDA1ICh1bnNpZ25lZCBzaG9ydCkKKyAgICB1bnNpZ25lZCBjaGFyIGJ5QkNGRzE7CiAKLSAgICBCWVRFICAgIGJ5RkNSMDsgICAgICAgICAgICAgICAgICAgICAvLyAweDA2IChXT1JEKQotICAgIEJZVEUgICAgYnlGQ1IxOwotICAgIEJZVEUgICAgYnlQTUMwOyAgICAgICAgICAgICAgICAgICAgIC8vIDB4MDcgKFdPUkQpCi0gICAgQllURSAgICBieVBNQzE7Ci0gICAgQllURSAgICBieU1BWExBVDsgICAgICAgICAgICAgICAgICAgLy8gMHgwOCAoV09SRCkKLSAgICBCWVRFICAgIGJ5TUlOR05UOwotICAgIEJZVEUgICAgYnlDRkcwOyAgICAgICAgICAgICAgICAgICAgIC8vIDB4MDkgKFdPUkQpCi0gICAgQllURSAgICBieUNGRzE7Ci0gICAgV09SRCAgICB3Q0lTUFRSOyAgICAgICAgICAgICAgICAgICAgLy8gMHgwQSAoV09SRCkKLSAgICBXT1JEICAgIHdSc3YwOyAgICAgICAgICAgICAgICAgICAgICAvLyAweDBCIChXT1JEKQotICAgIFdPUkQgICAgd1JzdjE7ICAgICAgICAgICAgICAgICAgICAgIC8vIDB4MEMgKFdPUkQpCi0gICAgQllURSAgICBieUJCUEFJUjsgICAgICAgICAgICAgICAgICAgLy8gMHgwRCAoV09SRCkKLSAgICBCWVRFICAgIGJ5UkZUWVBFOwotICAgIEJZVEUgICAgYnlNaW5DaGFubmVsOyAgICAgICAgICAgICAgIC8vIDB4MEUgKFdPUkQpCi0gICAgQllURSAgICBieU1heENoYW5uZWw7Ci0gICAgQllURSAgICBieVNpZ25hdHVyZTsgICAgICAgICAgICAgICAgLy8gMHgwRiAoV09SRCkKLSAgICBCWVRFICAgIGJ5Q2hlY2tTdW07CisgICAgdW5zaWduZWQgY2hhciBieUZDUjA7ICAgICAgICAgICAgICAgICAgICAgLy8gMHgwNiAodW5zaWduZWQgc2hvcnQpCisgICAgdW5zaWduZWQgY2hhciBieUZDUjE7CisgICAgdW5zaWduZWQgY2hhciBieVBNQzA7ICAgICAgICAgICAgICAgICAgICAgLy8gMHgwNyAodW5zaWduZWQgc2hvcnQpCisgICAgdW5zaWduZWQgY2hhciBieVBNQzE7CisgICAgdW5zaWduZWQgY2hhciBieU1BWExBVDsgICAgICAgICAgICAgICAgICAgLy8gMHgwOCAodW5zaWduZWQgc2hvcnQpCisgICAgdW5zaWduZWQgY2hhciBieU1JTkdOVDsKKyAgICB1bnNpZ25lZCBjaGFyIGJ5Q0ZHMDsgICAgICAgICAgICAgICAgICAgICAvLyAweDA5ICh1bnNpZ25lZCBzaG9ydCkKKyAgICB1bnNpZ25lZCBjaGFyIGJ5Q0ZHMTsKKyAgICB1bnNpZ25lZCBzaG9ydCB3Q0lTUFRSOyAgICAgICAgICAgICAgICAgICAgLy8gMHgwQSAodW5zaWduZWQgc2hvcnQpCisgICAgdW5zaWduZWQgc2hvcnQgd1JzdjA7ICAgICAgICAgICAgICAgICAgICAgIC8vIDB4MEIgKHVuc2lnbmVkIHNob3J0KQorICAgIHVuc2lnbmVkIHNob3J0IHdSc3YxOyAgICAgICAgICAgICAgICAgICAgICAvLyAweDBDICh1bnNpZ25lZCBzaG9ydCkKKyAgICB1bnNpZ25lZCBjaGFyIGJ5QkJQQUlSOyAgICAgICAgICAgICAgICAgICAvLyAweDBEICh1bnNpZ25lZCBzaG9ydCkKKyAgICB1bnNpZ25lZCBjaGFyIGJ5UkZUWVBFOworICAgIHVuc2lnbmVkIGNoYXIgYnlNaW5DaGFubmVsOyAgICAgICAgICAgICAgIC8vIDB4MEUgKHVuc2lnbmVkIHNob3J0KQorICAgIHVuc2lnbmVkIGNoYXIgYnlNYXhDaGFubmVsOworICAgIHVuc2lnbmVkIGNoYXIgYnlTaWduYXR1cmU7ICAgICAgICAgICAgICAgIC8vIDB4MEYgKHVuc2lnbmVkIHNob3J0KQorICAgIHVuc2lnbmVkIGNoY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ICAgICAgICAgICBcCiAJKihwd0RhdGEpID0gcmVhZHcocHdBZGRyKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKIH0KIAogI2RlZmluZSBWTlN2SW5Qb3J0RChkd0lPQWRkcmVzcywgcGR3RGF0YSkgeyAgICAgICAgICAgICAgICAgICAgIFwKLQl2b2xhdGlsZSBEV09SRCogcGR3QWRkciA9ICgoUERXT1JEKShkd0lPQWRkcmVzcykpOyAgICAgICAgICBcCisJdm9sYXRpbGUgdW5zaWduZWQgbG9uZyAqcGR3QWRkciA9ICgodW5zaWduZWQgbG9uZyAqKShkd0lPQWRkcmVzcykpOyAgICAgICAgICBcCiAJKihwZHdEYXRhKSA9IHJlYWRsKHBkd0FkZHIpOyAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKIH0KIAogCiAjZGVmaW5lIFZOU3ZPdXRQb3J0Qihkd0lPQWRkcmVzcywgYnlEYXRhKSB7ICAgICAgICAgICAgICAgICAgICAgXAotICAgIHZvbGF0aWxlIEJZVEUqIHBieUFkZHIgPSAoKFBCWVRFKShkd0lPQWRkcmVzcykpOyAgICAgICAgICAgIFwKLSAgICB3cml0ZWIoKEJZVEUpYnlEYXRhLCBwYnlBZGRyKTsJCQkJCQkJXAorICAgIHZvbGF0aWxlIHVuc2lnbmVkIGNoYXIgKiBwYnlBZGRyID0gKCh1bnNpZ25lZCBjaGFyICopKGR3SU9BZGRyZXNzKSk7ICAgICAgICAgICAgXAorICAgIHdyaXRlYigodW5zaWduZWQgY2hhcilieURhdGEsIHBieUFkZHIpOwkJCQkJCQlcCiB9CiAKIAogI2RlZmluZSBWTlN2T3V0UG9ydFcoZHdJT0FkZHJlc3MsIHdEYXRhKSB7ICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICB2b2xhdGlsZSBXT1JEKiBwd0FkZHIgPSAoKFBXT1JEKShkd0lPQWRkcmVzcykpOyAgICAgICAgICAgICBcCi0gICAgd3JpdGV3KChXT1JEKXdEYXRhLCBwd0FkZHIpOwkJCQkJCQlcCisgICAgdm9sYXRpbGUgdW5zaWduZWQgc2hvcnQgKnB3QWRkciA9ICgodW5zaWduZWQgc2hvcnQgKikoZHdJT0FkZHJlc3MpKTsgICAgICAgICAgICAgXAorICAgIHdyaXRldygodW5zaWduZWQgc2hvcnQpd0RhdGEsIHB3QWRkcik7CQkJCQkJCVwKIH0KIAogI2RlZmluZSBWTlN2T3V0UG9ydEQoZHdJT0FkZHJlc3MsIGR3RGF0YSkgeyAgICAgICAgICAgICAgICAgICAgIFwKLSAgICB2b2xhdGlsZSBEV09SRCogcGR3QWRkciA9ICgoUERXT1JEKShkd0lPQWRkcmVzcykpOyAgICAgICAgICBcCi0gICAgd3JpdGVsKChEV09SRClkd0RhdGEsIHBkd0FkZHIpOwkJCQkJICAgIFwKKyAgICB2b2xhdGlsZSB1bnNpZ25lZCBsb25nICpwZHdBZGRyID0gKCh1bnNpZ25lZCBsb25nICopKGR3SU9BZGRyZXNzKSk7ICAgICAgICAgIFwKKyAgICB3cml0ZWwoKHVuc2lnbmVkIGxvbmcpZHdEYXRhLCBwZHdBZGRyKTsJCQkJCSAgICBcCiB9CiAKICNlbmRpZgpAQCAtMTQwLDggKzE0MCw4IEBACiAKIAogI2RlZmluZSBQQ0F2RGVsYXlCeUlPKHVEZWxheVVuaXQpIHsgICAgICAgICAgICAgXAotICAgIEJZVEUgICAgYnlEYXRhOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgIFVMT05HICAgaWk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgIHVuc2lnbmVkIGNoYXIgYnlEYXRhOyAgICAgICAgICAgICAgICAgICAgICAgXAorICAgIHVuc2lnbmVkIGxvbmcgaWk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgIGlmICh1RGVsYXlVbml0IDw9IDUwKSB7ICAgICAgICAgICAgICAgICAgICAg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CAqKnB2Rmlyc3RCU1MKLSAgICApCitWTlRXSUZJdlF1ZXJ5QlNTTGlzdCh2b2lkICpwTWdtdEhhbmRsZSwgdW5zaWduZWQgaW50ICpwdUJTU0NvdW50LCB2b2lkICoqcHZGaXJzdEJTUykKIHsKLSAgICBVSU5UICAgICAgICAgICAgaWkgPSAwOworICAgIHVuc2lnbmVkIGludCBpaSA9IDA7CiAgICAgUFNNZ210T2JqZWN0ICAgIHBNZ210ID0gKFBTTWdtdE9iamVjdClwTWdtdEhhbmRsZTsKICAgICBQS25vd25CU1MgICAgICAgcEJTUyA9IE5VTEw7Ci0gICAgVUlOVCAgICAgICAgICAgIHVDb3VudCA9IDA7CisgICAgdW5zaWduZWQgaW50IHVDb3VudCA9IDA7CiAKICAgICAqcHZGaXJzdEJTUyA9IE5VTEw7CiAKQEAgLTQ3MSw3ICs0NjcsNyBAQAogICAgICAgICBpZiAocEJTUyA+ICYocE1nbXQtPnNCU1NMaXN0W01BWF9CU1NfTlVNXSkpIHsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQotICAgICAgICBpZiAocEJTUy0+YkFjdGl2ZSA9PSBUUlVFKSB7CisgICAgICAgIGlmIChwQlNTLT5iQWN0aXZlID09IHRydWUpIHsKICAgICAgICAgICAgICpwdk5leHRCU1MgPSBwQlNTOwogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CkBAIC00OTcsMjQgKzQ5MywyNCBAQAogdm9pZAogVk5UV0lGSXZVcGRhdGVOb2RlVHhDb3VudGVyKAogICAgIHZvaWQgKnBNZ210SGFuZGxlLAotICAgIFBCWVRFICAgIHBieURlc3RBZGRyZXNzLAotICAgIEJPT0wgICAgIGJUeE9rLAotICAgIFdPUkQgICAgIHdSYXRlLAotICAgIFBCWVRFICAgIHBieVR4RmFpbENvdW50CisgICAgdW5zaWduZWQgY2hhciAqcGJ5RGVzdEFkZHJlc3MsCisgICAgYm9vbCBiVHhPaywKKyAgICB1bnNpZ25lZCBzaG9ydCB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0ZSA9IFZOVFdJRklieUdldEFDS1R4UmF0ZSggUkFURV8xMU0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTdXBwb3J0UmF0ZUlFcywKQEAgLTYwMSwxNSArNTk3LDE1IEBACiAgICAgcmV0dXJuOwogfQogCi1CWVRFCit1bnNpZ25lZCBjaGFyCiBWTlRXSUZJYnlHZXRLZXlDeXBoZXIoCiAgICAgdm9pZCAqcE1nbXRIYW5kbGUsCi0gICAgQk9PTCAgICAgYkdyb3VwS2V5CisgICAgYm9vbCBiR3JvdXBLZXkKICAgICApCiB7CiAgICAgUFNNZ210T2JqZWN0ICAgIHBNZ210ID0gKFBTTWdtdE9iamVjdClwTWdtdEhhbmRsZTsKIAotICAgIGlmIChiR3JvdXBLZXkgPT0gVFJVRSkgeworICAgIGlmIChiR3JvdXBLZXkgPT0gdHJ1ZSkgewogICAgICAgICByZXR1cm4gKHBNZ210LT5ieUNTU0dLKTsKICAgICB9IGVsc2UgewogICAgICAgICByZXR1cm4gKHBNZ210LT5ieUNTU1BLKTsKQEAgLTYxOCw3ICs2MTQsNyBAQAogCiAKIC8qCi1CT09MCitib29sCiBWTlRXSUZJYkluaXQoCiAgICAgdm9pZCAqcEFkYXB0ZXJIYW5kbGVyLAogICAgIHZvaWQgKipwTWdtdEhhbmRsZXIKQEAgLTYyNiwxMyArNjIyLDEzIEBACiB7CiAKICAgICBQU01nbXRPYmplY3QgICAgICAgIHBNZ210ID0gTlVMTDsKLSAgICBVSU5UICAgICAgICAgICAgICAgIGlpOworICAgIHVuc2lnbmVkIGludCBpaTsKIAogCiAgICAgcE1nbXQgPSAoUFNNZ210T2JqZWN0KWttYWxsb2Moc2l6ZW9mKFNNZ210T2JqZWN0KSwgKGludClHRlBfQVRPTUlDKTsKICAgICBpZiAocE1nbXQgPT0gTlVMTCkgewogICAgICAgICAqcE1nbXRIYW5kbGVyID0gTlVMTDsKLSAgICAgICAgcmV0dXJuIEZBTFNFOworIC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CArMzQ4LDE0IEBACiAgICAgUFdMQU5fSUVfU1NJRCAgIHBJdGVtU1NJRDsKICAgICBQV0xBTl9JRV9TU0lEICAgcEl0ZW1TU0lEQ3VycjsKICAgICBDTURfU1RBVFVTICAgICAgU3RhdHVzOwotICAgIFVJTlQgICAgICAgICAgICBpaTsKLSAgICBCWVRFICAgICAgICAgICAgYnlNYXNrWzhdID0gezEsIDIsIDQsIDgsIDB4MTAsIDB4MjAsIDB4NDAsIDB4ODB9OworICAgIHVuc2lnbmVkIGludCBpaTsKKyAgICB1bnNpZ25lZCBjaGFyIGJ5TWFza1s4XSA9IHsxLCAyLCA0LCA4LCAweDEwLCAweDIwLCAweDQwLCAweDgwfTsKICAgICBzdHJ1Y3Qgc2tfYnVmZiAgKnNrYjsKIAogCiAgICAgaWYgKHBEZXZpY2UtPmR3RGlhZ1JlZkNvdW50ICE9IDApCiAgICAgICAgIHJldHVybjsKLSAgICBpZiAocERldmljZS0+YkNtZFJ1bm5pbmcgIT0gVFJVRSkKKyAgICBpZiAocERldmljZS0+YkNtZFJ1bm5pbmcgIT0gdHJ1ZSkKICAgICAgICAgcmV0dXJuOwogCiAgICAgc3Bpbl9sb2NrX2lycSgmcERldmljZS0+bG9jayk7CkBAIC0zNjQsNyArMzY1LDcgQEAKICAgICAgICAgY2FzZSBXTEFOX0NNRF9TQ0FOX1NUQVJUOgogCiAJcERldmljZS0+YnlSZUFzc29jQ291bnQgPSAwOwotICAgICAgICAgICAgaWYgKHBEZXZpY2UtPmJSYWRpb09mZiA9PSBUUlVFKSB7CisgICAgICAgICAgICBpZiAocERldmljZS0+YlJhZGlvT2ZmID09IHRydWUpIHsKICAgICAgICAgICAgICAgICBzX2JDb21tYW5kQ29tcGxldGUocERldmljZSk7CiAgICAgICAgICAgICAgICAgc3Bpbl91bmxvY2tfaXJxKCZwRGV2aWNlLT5sb2NrKTsKICAgICAgICAgICAgICAgICByZXR1cm47CkBAIC0zOTYsNyArMzk3LDcgQEAKIAogICAgICAgIC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S0+YnlNYXhDaGFubmVsICl7CiAgICAgICAgICAgICAgICAgICAgIHBNZ210LT51U2NhbkNoYW5uZWw9cERldmljZS0+YnlNYXhDaGFubmVsKzE7CiAJCSBwTWdtdC0+ZUNvbW1hbmRTdGF0ZSA9IFdMQU5fQ01EX1NDQU5fRU5EOwpAQCAtNDQ5LDcgKzQ1MCw3IEBACiAgICAgICAgICAgICAgICAgfQogCiAKLSAgICAgICAgICAgICAgICBpZiAoKHBNZ210LT5iMTFoRW5hYmxlID09IEZBTFNFKSB8fAorICAgICAgICAgICAgICAgIGlmICgocE1nbXQtPmIxMWhFbmFibGUgPT0gZmFsc2UpIHx8CiAgICAgICAgICAgICAgICAgICAgIChwTWdtdC0+dVNjYW5DaGFubmVsIDwgQ0JfTUFYX0NIQU5ORUxfMjRHKSkgewogICAgICAgICAgICAgICAgICAgICBzX3ZQcm9iZUNoYW5uZWwocERldmljZSk7CiAgICAgICAgICAgICAgICAgICAgIHNwaW5fdW5sb2NrX2lycSgmcERldmljZS0+bG9jayk7CkBAIC00NjksNyArNDcwLDcgQEAKIAogICAgICAgICAgICAgLy8gU2V0IEJhc2ViYW5kJ3Mgc2Vuc2l0aXZpdHkgYmFjay4KICAgICAgICAgICAgIC8vIFNldCBjaGFubmVsIGJhY2sKLSAgICAgICAgICAgIENBUkRiU2V0Q2hhbm5lbChwTWdtdC0+cEFkYXB0ZXIsIHBNZ210LT51Q3VyckNoYW5uZWwpOworICAgICAgICAgICAgc2V0X2NoYW5uZWwocE1nbXQtPnBBZGFwdGVyLCBwTWdtdC0+dUN1cnJDaGFubmVsKTsKICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8gIlNjYW5uaW5nLCBzZXQgYmFjayB0byBjaGFubmVsOiBbJWRdXG4iLCBwTWdtdC0+dUN1cnJDaGFubmVsKTsKICAgICAgICAgICAgIGlmIChwTWdtdC0+ZUN1cnJNb2RlID09IFdNQUNfTU9ERV9JQlNTX1NUQSkgewogICAgICAgICAgICAgICAgIENBUkRiU2V0QlNTSUQocE1nbXQtPnBBZGFwdGVyLCBwTWdtdC0+YWJ5Q3VyckJTU0lELCBPUF9NT0RFX0FESE9DKTsKQEAgLTUwMiwxNCArNTAzLDE0IEBACiAgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyJTZW5kIERpc2Fzc29jaWF0aW9uIFBhY2tldC4uXG4iKTsKICAgICAgICAgICAgICAgICAvLyByZWFzb24gPSA4IDogZGlzYXNzb2MgYmVjYXVzZSBzdGEgaGFzIGxlZnQKICAgICAgICAgICAgICAgICB2TWdyRGlzYXNzb2NCZWdpblN0YSgodm9pZCAqKXBEZXZpY2UsIHBNZ210LCBwTWdtdC0+YWJ5Q3VyckJTU0lELCAoOCksICZTdGF0dXMpOwotICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJMaW5rUGFzcyA9IEZBTFNFOworICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJMaW5rUGFzcyA9IGZhbHNlOwogICAgICAgICAgICAgICAgIC8vIHVubG9jayBjb21tYW5kIGJ1c3kKICAgICAgICAgICAgICAgICBwSXRlbVNTSUQgPSAoUFdMQU5fSUVfU1NJRClwTWdtdC0+YWJ5Q3VyclNTSUQ7CiAgICAgICAgICAgICAgICAgcEl0ZW1TU0lELT5sZW4gPSAwOwogICAgICAgICAgICAgICAgIG1lbXNldChwSXRlbVNTSUQtPmFieVNTSUQsIDAsIFdMQU5fU1NJRF9NQVhMRU4pOwogICAgICAgICAgICAgICAgIHBNZ210LT5lQ3VyclN0YXRlID0gV01BQ19TVEFURV9JRExFOwotICAgICAgICAgICAgICAgIHBNZ210LT5zTm9kZURCVGFibGVbMF0uYkFjdGl2ZSA9IEZBTFNFOwotLy8gICAgICAgICAgICAgICAgcERldmljZS0+YkJlYWNvbkJ1ZlJlYWR5ID0gRkFMU0U7CisgICAgICAgICAgICAgICAgcE1nbXQtPnNOb2RlREJUYWJsZVswXS5iQWN0aXZlID0gZmFsc2U7CisvLyAgICAgICAgICAgICAgICBwRGV2aWNlLT5iQmVhY29uQnVmUmVhZHkgPSBmYWxzZTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIG5ldGlmX3N0b3BfcXVldWUocERldmljZS0+ZGV2KTsKICAgICAgICAgICAgIHBEZXZpY2UtPmVDb21tYW5kU3RhdGUgPSBXTEFOX0RJU0FTU09DSUFURV9XQUlUOwpAQCAtNTM5LDcgKzU0MCw3IEBACiAKICAgICAgICAgY2FzZSBXTEFOX0NNRF9TU0lEX1NUQVJUOgogICAgICAgICAJcERldmljZS0+YnlSZUFzc29jQ291bnQgPSAwOwotICAgICAgICAgICAgaWYgKHBEZXZpY2UtPmJSYWRpb09mZiA9PSBUUlVFKSB7CisgICAgICAgICAgICBpZiAocERldmljZS0+YlJhZGlvT2ZmID09IHRydWUpIHsKICAgICAgICAgICAgICAgICBzX2JDb21tYW5kQ29tcGxldGUocERldmljZSk7CiAgICAgICAgICAgICAgICAgc3Bpbl91bmxvY2tfaXJxKCZwRGV2aWNlLT5sb2NrKTsKICAgICAgICAgICAgICAgICByZXR1cm47CkBAIC01NzMsNyArNTc0LDcgQEAKICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICBuZXRpZl9zdG9wX3F1ZXVlKHBEZXZpY2UtPmRldik7Ci0gICAgICAgICAgICAgICAgcERldmljZS0+YkxpbmtQYXNzID0gRkFMU0U7CisgICAgICAgICAgICAgICAgcERldmljZS0+YkxpbmtQYXNzID0gZmFsc2U7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICAvLyBzZXQgaW5pdGlhbCBzdGF0ZQogICAgICAgICAgICAgcE1nbXQtPmVDdXJyU3RhdGUgPSBXTUFDX1NUQVRFX0lETEU7CkBAIC02MDcsOSArNjA4LDkgQEAKICAgICAgICAgICAgICAgICAgICAgaWYgKG5ldGlmX3F1ZXVlX3N0b3BwZWQocERldmljZS0+ZGV2KSl7CiAgICAgICAgICAgICAgICAgICAgICAgICBuZXRpZl93YWtlX3F1ZXVlKHBEZXZpY2UtPmRldik7CiAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgcERldmljZS0+YkxpbmtQYXNzID0gVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgcERldmljZS0+YkxpbmtQYXNzID0gdHJ1ZTsKIAotICAgICAgICAgICAgICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlWzBdLmJBY3RpdmUgPSBUUlVFOworICAgICAgICAgICAgICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlWzBdLmJBY3RpdmUgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlWzBdLnVJbkFjdGl2ZUNvdW50ID0gMDsKICAgICAgICAgICAgICAgICAgICAgYkNsZWFyQlNTSURfU0NBTihwRGV2aWNlKTsKICAgICAgICAgICAgICAgICB9CkBAIC02MzUsMTIgKzYzNiwxMiBAQAogICAgICAgICAgICAgICAgICAgICBpZiAobmV0aWZfcXVldWVfc3RvcHBlZChwRGV2aWNlLT5kZXYpKXsKICAgICAgICAgICAgICAgICAgICAgICAgIG5ldGlmX3dha2VfcXVldWUocERldmljZS0+ZGV2KTsKICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT5iTGlua1Bhc3MgPSBUUlVFOworICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT5iTGlua1Bhc3MgPSB0cnVlOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyAiRGlzY29ubmVjdCBTU0lEIG5vbmVcbiIpOwogCQkgICNpZmRlZiBXUEFfU1VQUExJQ0FOVF9EUklWRVJfV0VYVF9TVVBQT1JUCi0gICAgICAgICAgICAgICAgICAgIC8vIGlmKHBEZXZpY2UtPmJXUEFTdXBwV2V4dEVuYWJsZWQgPT0gVFJVRSkKKyAgICAgICAgICAgICAgICAgICAgLy8gaWYocERldmljZS0+YldQQVN1cHBXZXh0RW5hYmxlZCA9PSB0cnVlKQogICAgICAgICAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgCXVuaW9uIGl3cmVxX2RhdGEgIHdycXU7CiAgICAgICAgICAgICAgICAgICAJbWVtc2V0KCZ3cnF1LCAwLCBzaXplb2YgKHdycXUpKTsKQEAgLTY4NSw3ICs2ODYsNyBAQAogCSAgICAgICAgICBwRGV2aWNlLT5ieUxpbmtXYWl0Q291bnQgPSAwOwogCQkgI2lmIDAKICAgICAgICAgICAgICAgICAgICAgICNpZmRlZiBXUEFfU1VQUExJQ0FOVF9EUklWRVJfV0VYVF9TVVBQT1JUCi0gICAgICAgICAgICAgICAgICAgIC8vIGlmKHBEZXZpY2UtPmJXUEFTdXBwV2V4dEVuYWJsZWQgPT0gVFJVRSkKKyAgICAgICAgICAgICAgICAgICAgLy8gaWYocERldmljZS0+YldQQVN1cHBXZXh0RW5hYmxlZCA9PSB0cnVlKQogICAgICAgICAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgCXVuaW9uIGl3cmVxX2RhdGEgIHdycXU7CiAgICAgICAgICAgICAgICAgICAJbWVtc2V0KCZ3cnF1LCAwLCBzaXplb2YgKHdycXUpKTsKQEAgLTcwNyw3ICs3MDgsNyBAQAogICAgICAgICAgICAgICAgIGlmIChwTWdtdC0+ZUF1dGhlbk1vZGUgPj0gV01BQ19BVVRIX1dQQSkgewogICAgICAgICAgICAgICAgICAgICBLZXliUmVtb3ZlQWxsS2V5KCYocERldmljZS0+c0tleSksIHBEZXZpY2UtPmFieUJTU0lELCBwRGV2aWNlLT5Qb3J0T2Zmc2V0KTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgcERldmljZS0+YkxpbmtQYXNzID0gVFJVRTsKKyAgICAgICAgICAgICAgICBwRGV2aWNlLT5iTGlua1Bhc3MgPSB0cnVlOwogICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJ5TGlua1dhaXRDb3VudCA9IDA7CiAgICAgICAgICAgICAgICAgcERldmljZS0+YnlSZUFzc29jQ291bnQgPSAwOwogICAgICAgICAgICAgICAgIGJDbGVhckJTU0lEX1NDQU4ocERldmljZSk7CkBAIC03MTksMjAgKzcyMCwyMCBAQAogICAgICAgICAgICAgICAgICAgICBuZXRpZl93YWtlX3F1ZXVlKHBEZXZpY2UtPmRldik7CiAgICAgICAgICAgICAgICAgfQogCSAgICAgI2lmZGVmIFR4SW5TbGVlcAotCQkgaWYocERldmljZS0+SXNUeERhdGFUcmlnZ2VyICE9IEZBTFNFKSAgIHsgICAgLy9UeERhdGFUaW1lciBpcyBub3QgdHJpZ2dlcmVkIGF0IHRoZSBmaXJzdCB0aW1lCisJCSBpZihwRGV2aWNlLT5Jc1R4RGF0YVRyaWdnZXIgIT0gZmFsc2UpICAgeyAgICAvL1R4RGF0YVRpbWVyIGlzIG5vdCB0cmlnZ2VyZWQgYXQgdGhlIGZpcnN0IHRpbWUKICAgICAgICAgICAgICAgICAgICAgIC8vIHByaW50aygiUmUtaW5pdGlhbCBUeERhdGFUaW1lcioqKipcbiIpOwogCQkgICAgZGVsX3RpbWVyKCZwRGV2aWNlLT5zVGltZXJUeERhdGEpOwogICAgICAgICAgICAgICAgICAgICAgIGluaXRfdGltZXIoJnBEZXZpY2UtPnNUaW1lclR4RGF0YSk7Ci0gICAgICAgICAgICAgICAgICAgICAgcERldmljZS0+c1RpbWVyVHhEYXRhLmRhdGEgPSAoVUxPTkcpcERldmljZTsKKyAgICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT5zVGltZXJUeERhdGEuZGF0YSA9ICh1bnNpZ25lZCBsb25nKSBwRGV2aWNlOwogICAgICAgICAgICAgICAgICAgICAgIHBEZXZpY2UtPnNUaW1lclR4RGF0YS5mdW5jdGlvbiA9IChUaW1lckZ1bmN0aW9uKUJTU3ZTZWNvbmRUeERhdGE7CiAgICAgICAgICAgICAgICAgICAgICAgcERldmljZS0+c1RpbWVyVHhEYXRhLmV4cGlyZXMgPSBSVU5fQVQoMTAqSFopOyAgICAgIC8vMTBzIGNhbGxiYWNrCi0gICAgICAgICAgICAgICAgICAgICAgcERldmljZS0+ZlR4RGF0YUluU2xlZXAgPSBGQUxTRTsKKyAgICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT5mVHhEYXRhSW5TbGVlcCA9IGZhbHNlOwogICAgICAgICAgICAgICAgICAgICAgIHBEZXZpY2UtPm5UeERhdGFUaW1lQ291dCA9IDA7CiAJCSB9CiAJCSBlbHNlIHsKIAkJICAgLy8gcHJpbnRrKCJtaWtlOi0tPkZpcnN0IHRpbWUgdHJpZ2VyIFRpbWVyVHhEYXRhIEluU2xlZXBcbiIpOwogCQkgfQotCQlwRGV2aWNlLT5Jc1R4RGF0YVRyaWdnZXIgPSBUUlVFOworCQlwRGV2aWNlLT5Jc1R4RGF0YVRyaWdnZXIgPSB0cnVlOwogICAgICAgICAgICAgICAgIGFkZF90aW1lcigmcERldmljZS0+c1RpbWVyVHhEYXRhKTsKICAgICAgICAgICAgICAjZW5kaWYKICAgICAgICAgICAgIH0KQEAgLTc0OSw3ICs3NTAsNyBAQAogCSAgICAgICAgICBwRGV2aWNlLT5ieUxpbmtXYWl0Q291bnQgPSAwOwogCQkjaWYgMAogICAgICAgICAgICAgICAgICAgICAgI2lmZGVmIFdQQV9TVVBQTElDQU5UX0RSSVZFUl9XRVhUX1NVUFBPUlQKLSAgICAgICAgICAgICAgICAgICAgLy8gaWYocERldmljZS0+YldQQVN1cHBXZXh0RW5hYmxlZCA9PSBUUlVFKQorICAgICAgICAgICAgICAgICAgICAvLyBpZihwRGV2aWNlLT5iV1BBU3VwcFdleHRFbmFibGVkID09IHRydWUpCiAgICAgICAgICAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAJdW5pb24gaXdyZXFfZGF0YSAgd3JxdTsKICAgICAgICAgICAgICAgICAgIAltZW1zZXQoJndycXUsIDAsIHNpemVvZiAod3JxdSkpOwpAQCAtNzcwLDE0ICs3NzEsMTQgQEAKICAgICAgICAgICAgICAgICBkZWxfdGltZXIoJnBNZ210LT5zVGltZXJTZWNvbmRDYWxsYmFjayk7CiAgICAgICAgICAgICAgICAgcE1nbXQtPmVDdXJyU3RhdGUgPSBXTUFDX1NUQVRFX0lETEU7CiAgICAgICAgICAgICAgICAgcE1nbXQtPmVDdXJyTW9kZSA9IFdNQUNfTU9ERV9TVEFOREJZOwotICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJMaW5rUGFzcyA9IEZBTFNFOwotICAgICAgICAgICAgICAgIGlmIChwRGV2aWNlLT5iRW5hYmxlSG9zdFdFUCA9PSBUUlVFKQorICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJMaW5rUGFzcyA9IGZhbHNlOworICAgICAgICAgICAgICAgIGlmIChwRGV2aWNlLT5iRW5hYmxlSG9zdFdFUCA9PSB0cnVlKQogICAgICAgICAgICAgICAgICAgICBCU1N2Q2xlYXJOb2RlREJUYWJsZShwRGV2aWNlLCAxKTsKICAgICAgICAgICAgICAgICBlbHNlCiAgICAgICAgICAgICAgICAgICAgIEJTU3ZDbGVhck5vZGVEQlRhYmxlKHBEZXZpY2UsIDApOwogICAgICAgICAgICAgICAgIHBEZXZpY2UtPnVBc3NvY0NvdW50ID0gMDsKICAgICAgICAgICAgICAgICBwTWdtdC0+ZUN1cnJTdGF0ZSA9IFdNQUNfU1RBVEVfSURMRTsKLSAgICAgICAgICAgICAgICBwRGV2aWNlLT5iRml4UmF0ZSA9IEZBTFNFOworICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJGaXhSYXRlID0gZmFsc2U7CiAKICAgICAgICAgICAgICAgICB2TWdyQ3JlYXRlT3duSUJTUygodm9pZCAqKXBEZXZpY2UsICZTdGF0dXMpOwogICAgICAgICAgICAgICAgIGlmIChTdGF0dXMgIT0gQ01EX1NUQVRVU19TVUNDRVNTKXsKQEAgLTc5MSw3ICs3OTIsNyBAQAogICAgICAgICAgICAgICAgIGlmIChuZXRpZl9xdWV1ZV9zdG9wcGVkKHBEZXZpY2UtPmRldikpewogICAgICAgICAgICAgICAgICAgICBuZXRpZl93YWtlX3F1ZXVlKHBEZXZpY2UtPmRldik7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJMaW5rUGFzcyA9IFRSVUU7CisgICAgICAgICAgICAgICAgcERldmljZS0+YkxpbmtQYXNzID0gdHJ1ZTsKICAgICAgICAgICAgICAgICBhZGRfdGltZXIoJnBNZ210LT5zVGltZXJTZWNvbmRDYWxsYmFjayk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBzX2JDb21tYW5kQ29tcGxldGUocERldmljZSk7CkBAIC04MDMsMTAgKzgwNCwxMCBAQAogICAgICAgICAgICAgICAgIHdoaWxlICgoc2tiID0gc2tiX2RlcXVldWUoJnBNZ210LT5zTm9kZURCVGFibGVbMF0uc1R4UFNRdWV1ZSkpICE9IE5VTEwpIHsKICAgICAgICAgICAgICAgICAgICAgaWYgKHNrYl9xdWV1ZV9lbXB0eSgmcE1nbXQtPnNOb2RlREJUYWJsZVswXS5zVHhQU1F1ZXVlKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgcE1nbXQtPmFieVBTVHhNYXBbMF0gJj0gfmJ5TWFza1swXTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJNb3JlRGF0YSA9IEZBTFNFOworICAgICAgICAgICAgICAgICAgICAgICAgcERldmljZS0+Yk1vcmVEYXRhID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT5iTW9yZURhdGEgPSBUUlVFOworICAgICAgICAgICAgICAgICAgICAgICAgcERldmljZS0+Yk1vcmVEYXRhID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBpZiAoIWRldmljZV9kbWEwX3htaXQocERldmljZSwgc2tiLCAwKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyAiTXVsdGljYXN0IHBzIHR4IGZhaWwgXG4iKTsKQEAgLTgyNiwxMCArODI3LDEwIEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gY2xlYXIgdHggbWFwCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1nbXQtPmFieVBTVHhNYXBbcE1nbXQtPnNOb2RlREJUYWJsZVtpaV0ud0FJRCA+PiAzXSAmPQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfmJ5TWFza1twTWdtdC0+c05vZGVEQlRhYmxlW2lpXS53QUlEICYgN107Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcERldmljZS0+Yk1vcmVEYXRhID0gRkFMU0U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERldmljZS0+Yk1vcmVEYXRhID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT5iTW9yZURhdGEgPSBUUlVFOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJNb3JlRGF0YSA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWRldmljZV9kbWEwX3htaXQocERldmljZSwgc2tiLCBpaSkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPICJzdGEgcHMgdHggZmFpbCBcbiIpOwpAQCAtODQ2LDcgKzg0Nyw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB+YnlNYXNrW3BNZ210LT5zTm9kZURCVGFibGVbaWldLndBSUQgJiA3XTsKICAgICAgICAgICAgICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8gIkluZGV4PSVkIFBTIHF1ZXVlIGNsZWFyIFxuIiwgaWkpOwogICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIHBNZ210LT5zTm9kZURCVGFibGVbaWldLmJSeFBTUG9sbCA9IEZBTFNFOworICAgICAgICAgICAgICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlW2lpXS5iUnhQU1BvbGwgPSBmYWxzZTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAKQEAgLTg1Niw3ICs4NTcsNyBAQAogCiAgICAgICAgIGNhc2UgV0xBTl9DTURfUkFESU9fU1RBUlQgOgogICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyJlQ29tbWFuZFN0YXRlID09IFdMQU5fQ01EX1JBRElPX1NUQVJUXG4iKTsKLSAgICAgICAgICAgIGlmIChwRGV2aWNlLT5iUmFkaW9DbWQgPT0gVFJVRSkKKyAgICAgICAgICAgIGlmIChwRGV2aWNlLT5iUmFkaW9DbWQgPT0gdHJ1ZSkKICAgICAgICAgICAgICAgICBDQVJEYlJhZGlvUG93ZXJPbihwRGV2aWNlKTsKICAgICAgICAgICAgIGVsc2UKICAgICAgICAgICAgICAgICBDQVJEYlJhZGlvUG93ZXJPZmYocERldmljZSk7CkBAIC04OTYsMjMgKzg5NywyMyBAQAogCiAKIHN0YXRpYwotQk9PTAorYm9vbAogc19iQ29tbWFuZENvbXBsZXRlICgKICAgICBQU0RldmljZSBwRGV2aWNlCiAgICAgKQogewogICAgIFBXTEFOX0lFX1NTSUQgcFNTSUQ7Ci0gICAgQk9PTCAgICAgICAgICBiUmFk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ZXZpY2UtPmJDbWRSdW5uaW5nID09IGZhbHNlKSB7CiAgICAgICAgIHNfYkNvbW1hbmRDb21wbGV0ZShwRGV2aWNlKTsKICAgICB9CiAgICAgZWxzZSB7CiAgICAgfQotICAgIHJldHVybiAoVFJVRSk7CisgICAgcmV0dXJuICh0cnVlKTsKIAogfQogCkBAIC0xMDU3LDE2ICsxMDU4LDE2IEBACiAgKiAgT3V0OgogICogICAgICBub25lCiAgKgotICogUmV0dXJuIFZhbHVlOiBUUlVFIGlmIHN1Y2Nlc3M7IG90aGVyd2lzZSBGQUxTRQorICogUmV0dXJuIFZhbHVlOiB0cnVlIGlmIHN1Y2Nlc3M7IG90aGVyd2lzZSBmYWxzZQogICoKICAqLwotQk9PTCBiQ2xlYXJCU1NJRF9TQ0FOICgKK2Jvb2wgYkNsZWFyQlNTSURfU0NBTiAoCiAgICAgdm9pZCAqaERldmljZUNvbnRleHQKICAgICApCiB7CiAgICAgUFNEZXZpY2UgICAgICAgIHBEZXZpY2UgPSAoUFNEZXZpY2UpaERldmljZUNvbnRleHQ7Ci0gICAgVUlOVCAgICAgICAgICAgIHVDbWREZXF1ZXVlSWR4ID0gcERldmljZS0+dUNtZERlcXVldWVJZHg7Ci0gICAgVUlOVCAgICAgICAgICAgIGlpOworICAgIHVuc2lnbmVkIGludCB1Q21kRGVxdWV1ZUlkeCA9IHBEZXZpY2UtPnVDbWREZXF1ZXVlSWR4OworICAgIHVuc2lnbmVkIGludCBpaTsKIAogICAgIGlmICgocERldmljZS0+Y2JGcmVlQ21kUXVldWUgPCBDTURfUV9TSVpFKSAmJiAodUNtZERlcXVldWVJZHggIT0gcERldmljZS0+dUNtZEVucXVldWVJZHgpKSB7CiAgICAgICAgIGZvciAoaWkgPSAwOyBpaSA8IChDTURfUV9TSVpFIC0gcERldmljZS0+Y2JGcmVlQ21kUXVldWUpOyBpaSArKykgewpAQCAtMTA3Nyw3ICsxMDc4LDcgQEAKICAgICAgICAgICAgICAgICBicmVhazsKICAgICAg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XNlIGZhbHNlCiAgKgogICovCiAKLUJPT0wgV0NUTGJJc0R1cGxpY2F0ZSAoUFNDYWNoZSBwQ2FjaGUsIFBTODAyXzExSGVhZGVyIHBNQUNIZWFkZXIpCitib29sIFdDVExiSXNEdXBsaWNhdGUgKFBTQ2FjaGUgcENhY2hlLCBQUzgwMl8xMUhlYWRlciBwTUFDSGVhZGVyKQogewotICAgIFVJTlQgICAgICAgICAgICB1SW5kZXg7Ci0gICAgVUlOVCAgICAgICAgICAgIGlpOworICAgIHVuc2lnbmVkIGludCB1SW5kZXg7CisgICAgdW5zaWduZWQgaW50IGlpOwogICAgIFBTQ2FjaGVFbnRyeSAgICBwQ2FjaGVFbnRyeTsKIAogICAgIGlmIChJU19GQ19SRVRSWShwTUFDSGVhZGVyKSkgewpAQCAtNzgsMTAgKzc4LDEwIEBACiAgICAgICAgIGZvciAoaWkgPSAwOyBpaSA8IERVUExJQ0FURV9SWF9DQUNIRV9MRU5HVEg7IGlpKyspIHsKICAgICAgICAgICAgIHBDYWNoZUVudHJ5ID0gJihwQ2FjaGUtPmFzQ2FjaGVFbnRyeVt1SW5kZXhdKTsKICAgICAgICAgICAgIGlmICgocENhY2hlRW50cnktPndGbVNlcXVlbmNlID09IHBNQUNIZWFkZXItPndTZXFDdGwpICYmCi0gICAgICAgICAgICAgICAgKElTX0VUSF9BRERSRVNTX0VRVUFMICgmKHBDYWNoZUVudHJ5LT5hYnlBZGRyMlswXSksICYocE1BQ0hlYWRlci0+YWJ5QWRkcjJbMF0pKSkKKyAgICAgICAgICAgICAgICAoIWNvbXBhcmVfZXRoZXJfYWRkcigmKHBDYWNoZUVudHJ5LT5hYnlBZGRyMlswXSksICYocE1BQ0hlYWRlci0+YWJ5QWRkcjJbMF0pKSkKICAgICAgICAgICAgICAgICApIHsKICAgICAgICAgICAgICAgICAvKiBEdXBsaWNhdGUgbWF0Y2ggKi8KLSAgICAgICAgICAgICAgICByZXR1cm4gVFJVRTsKKyAgICAgICAgICAgICAgICByZ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cnJlbnRERkNCSWR4XS5wYnlSeEJ1ZmZlciwgKChQQllURSkgKHBNQUNIZWFkZXIpICsgdUhlYWRlclNpemUpLCAoY2JGcmFtZUxlbmd0aCAtIHVIZWFkZXJTaXplKSk7CisgICAgICAgICAgICAgICAgbWVtY3B5KHBEZXZpY2UtPnNSeERGQ0JbcERldmljZS0+dUN1cnJlbnRERkNCSWR4XS5wYnlSeEJ1ZmZlciwgKCh1bnNpZ25lZCBjaGFyICopIChwTUFDSGVhZGVyKSArIHVIZWFkZXJTaXplKSwgKGNiRnJhbWVMZW5ndGggLSB1SGVhZGVyU2l6ZSkpOwogICAgICAgICAgICAgICAgIHBEZXZpY2UtPnNSeERGQ0JbcERldmljZS0+dUN1cnJlbnRERkNCSWR4XS5jYkZyYW1lTGVuZ3RoICs9IChjYkZyYW1lTGVuZ3RoIC0gdUhlYWRlclNpemUpOwogICAgICAgICAgICAgICAgIHBEZXZpY2UtPnNSeERGQ0JbcERldmljZS0+dUN1cnJlbnRERkNCSWR4XS5wYnlSeEJ1ZmZlciArPSAoY2JGcmFtZUxlbmd0aCAtIHVIZWFkZXJTaXplKTsKICAgICAgICAgICAgICAgICBwRGV2aWNlLT5zUnhERkNCW3BEZXZpY2UtPnVDdXJyZW50REZDQklkeF0ud0ZyYWdOdW0rKzsKQEAgLTIyOSwyMSArMjI5LDIxIEBACiAgICAgICAgICAgICBlbHNlIHsKICAgICAgICAgICAgICAgICAvLyBzZXEgZXJyb3Igb3IgZnJhZyAjIGVycm9yIGZsdXNoIERGQ0IKICAgICAgICAgICAgICAgICBwRGV2aWNlLT5jYkZyZWVERkNCKys7Ci0gICAgICAgICAgICAgICAgcERldmljZS0+c1J4REZDQltwRGV2aWNlLT51Q3VycmVudERGQ0JJZHhdLmJJblVzZSA9IEZBTFNFOwotICAgICAgICAgICAgICAgIHJldHVybihGQUxTRSk7CisgICAgICAgICAgICAgICAgcERldmljZS0+c1J4REZDQltwRGV2aWNlLT51Q3VycmVudERGQ0JJZHhdLmJJblVzZSA9IGZhbHNlOworICAgICAgICAgICAgICAgIHJldHVybihmYWxzZSk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgICByZXR1cm4oRkFMU0UpOworICAgICAgICAgICAgcmV0dXJuKGZhbHNlKTsKICAgICAgICAgfQogICAgICAgICBpZiAoSVNfTEFTVF9GUkFHTUVOVF9QS1QocE1BQ0hlYWRlcikpIHsKICAgICAgICAgICAgIC8vZW5xIGRlZnJhZ2NvbnRyb2xibG9jawogICAgICAgICAgICAgcERldmljZS0+Y2JGcmVlREZDQisrOwotICAgICAgICAgICAgcERldmljZS0+c1J4REZDQltwRGV2aWNlLT51Q3VycmVudERGQ0JJZHhdLmJJblVzZSA9IEZBTFNFOworICAgICAgICAgICAgcERldmljZS0+c1J4REZDQltwRGV2aWNlLT51Q3VycmVudERGQ0JJZHhdLmJJblVzZSA9IGZhbHNlOwogICAgICAgICAgICAgLy9EQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPICJMYXN0IHBEZXZpY2UtPnVDdXJyZW50REZDQklkeD0gJWRcbiIsIHBEZXZpY2UtPnVDdXJyZW50REZDQklkeCk7Ci0gICAgICAgICAgICByZXR1cm4oVFJVRSk7CisgICAgICAgICAgICByZXR1cm4odHJ1ZSk7CiAgICAgICAgIH0KLSAgICAgICAgcmV0dXJuKEZBTFNFKTsKKyAgICAgICAgcmV0dXJuKGZhbHNlKTsKICAgICB9CiB9CiAKZGlmZiAtLWdpdCBhL2RyaXZlcnMvc3RhZ2luZy92dDY2NTUvd2N0bC5oIGIvZHJpdmVycy9zdGFnaW5nL3Z0NjY1NS93Y3RsLmgKaW5kZXggYTFhYzQ3OS4uYTkyYmI2ZCAxMDA2NDQKLS0tIGEvZHJpdmVycy9zdGFnaW5nL3Z0NjY1NS93Y3RsLmgKKysrIGIvZHJpdmVycy9zdGFnaW5nL3Z0NjY1NS93Y3RsLmgKQEAgLTk3LDE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bmRleF0ud0NhcEluZm8gPSBjcHVfdG9fbGUxNigqc0ZyYW1lLnB3Q2FwSW5mbyk7CiAgICAgICAgIHBNZ210LT5zTm9kZURCVGFibGVbdU5vZGVJbmRleF0ud0xpc3RlbkludGVydmFsID0gY3B1X3RvX2xlMTYoKnNGcmFtZS5wd0xpc3RlbkludGVydmFsKTsKICAgICAgICAgcE1nbXQtPnNOb2RlREJUYWJsZVt1Tm9kZUluZGV4XS5iUFNFbmFibGUgPQotICAgICAgICAgICAgICAgIFdMQU5fR0VUX0ZDX1BXUk1HVChzRnJhbWUucEhkci0+c0EzLndGcmFtZUN0bCkgPyBUUlVFIDogRkFMU0U7CisgICAgICAgICAgICAgICAgV0xBTl9HRVRfRkNfUFdSTUdUKHNGcmFtZS5wSGRyLT5zQTMud0ZyYW1lQ3RsKSA/IHRydWUgOiBmYWxzZTsKICAgICAgICAgLy8gVG9kbzogY2hlY2sgc3RhIGJhc2ljIHJhdGUsIGlmIGFwIGNhbid0IHN1cHBvcnQsIHNldCBzdGF0dXMgY29kZQogICAgICAgICBpZiAocERldmljZS0+ZUN1cnJlbnRQSFlUeXBlID09IFBIWV9UWVBFXzExQikgewogICAgICAgICAgICAgdVJhdGVMZW4gPSBXTEFOX1JBVEVTX01BWExFTl8xMUI7CkBAIC03MzksNyArNzQwLDcgQEAKICAgICAgICAgUkFURXZQYXJzZU1heFJhdGUoKHZvaWQgKilwRGV2aWNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgKFBXTEFOX0lFX1NVUFBfUkFURVMpYWJ5Q3VyclN1cHBSYXRlcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgIChQV0xBTl9JRV9TVVBQX1JBVEVTKWFieUN1cnJFeHRTdXBwUmF0ZXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBGQUxTRSwgLy8gZG8gbm90IGNoYW5nZSBvdXIgYmFzaWMgcmF0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2UsIC8vIGRvIG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cHBSYXRlID4gUkFURV8xMU0pCi0gICAgICAgICAgIHBNZ210LT5zTm9kZURCVGFibGVbdU5vZGVJbmRleF0uYkVSUEV4aXN0ID0gVFJVRTsKKyAgICAgICAgICAgcE1nbXQtPnNOb2RlREJUYWJsZVt1Tm9kZUluZGV4XS5iRVJQRXhpc3QgPSB0cnVlOwogCiAgICAgICAgIGlmIChwTWdtdC0+c05vZGVEQlRhYmxlW3VOb2RlSW5kZXhdLndNYXhTdXBwUmF0ZSA8PSBSQVRFXzExTSkgewogICAgICAgICAgICAgLy8gQiBvbmx5IFNUQSBqb2luCi0gICAgICAgICAgICBwRGV2aWNlLT5iUHJvdGVjdE1vZGUgPSBUUlVFOwotICAgICAgICAgICAgcERldmljZS0+Yk5vbkVSUFByZXNlbnQgPSBUUlVFOworICAgICAgICAgICAgcERldmljZS0+YlByb3RlY3RNb2RlID0gdHJ1ZTsKKyAgICAgICAgICAgIHBEZXZpY2UtPmJOb25FUlBQcmVzZW50ID0gdHJ1ZTsKICAgICAgICAgfQotICAgICAgICBpZiAocE1nbXQtPnNOb2RlREJUYWJsZVt1Tm9kZUluZGV4XS5iU2hvcnRQcmVhbWJsZSA9PSBGQUxTRSkgewotICAgICAgICAgICAgcERldmljZS0+YkJhcmtlclByZWFtYmxlTWQgPSBUUlVFOworICAgICAgICBpZiAocE1nbXQtPnNOb2RlREJUYWJsZVt1Tm9kZUluZGV4XS5iU2hvcnRQcmVhbWJsZSA9PSBmYWxzZSkgeworICAgICAgICAgICAgcERldmljZS0+YkJhcmtlclByZWFtYmxlTWQgPSB0cnVlOwogICAgICAgICB9CiAKICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfSU5GTywgS0VSTl9JTkZPICJBc3NvY2lhdGUgQUlEPSAlZCBcbiIsIHdBc3NvY0FJRCk7CkBAIC04NDUsMTcgKzg0NiwxNyBAQAogICAgIFBTRGV2aWNlIHBEZXZpY2UsCiAgICAgUFNNZ210T2JqZWN0IHBNZ210LAogICAgIFBTUnh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ICAgREJHX1BSVChNU0dfTEVWRUxfTk9USUNFLCBLRVJOX0lORk8gICJBUCBkZWF1dGhlZCBtZSwgcmVhc29uPSVkLlxuIiwgY3B1X3RvX2xlMTYoKCooc0ZyYW1lLnB3UmVhc29uKSkpKTsKICAgICAgICAgICAgIC8vIFRPRE86IHVwZGF0ZSBCU1MgbGlzdCBmb3Igc3BlY2lmaWMgQlNTSUQgaWYgcHJlLWF1dGhlbnRpY2F0aW9uIGNhc2UKLSAgICAgICAgICAgIGlmIChJU19FVEhfQUREUkVTU19FUVVBTChzRnJhbWUucEhkci0+c0EzLmFieUFkZHIzLCBwTWdtdC0+YWJ5Q3VyckJTU0lEKSkgeworICAgICAgICAgICAgaWYgKCFjb21wYXJlX2V0aGVyX2FkZHIoc0ZyYW1lLnBIZHItPnNBMy5hYnlBZGRyMywgcE1nbXQtPmFieUN1cnJCU1NJRCkpIHsKICAgICAgICAgICAgICAgICBpZiAocE1nbXQtPmVDdXJyU3RhdGUgPj0gV01BQ19TVEFURV9BVVRIUEVORElORykgewotICAgICAgICAgICAgICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlWzBdLmJBY3RpdmUgPSBGQUxTRTsKKyAgICAgICAgICAgICAgICAgICAgcE1nbXQtPnNOb2RlREJUYWJsZVswXS5iQWN0aXZlID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgICAgIHBNZ210LT5lQ3Vyck1vZGUgPSBXTUFDX01PREVfU1RBTkRCWTsKICAgICAgICAgICAgICAgICAgICAgcE1nbXQtPmVDdXJyU3RhdGUgPSBXTUFDX1NUQVRFX0lETEU7CiAgICAgICAgICAgICAgICAgICAgIG5ldGlmX3N0b3BfcXVldWUocERldmljZS0+ZGV2KTsKLSAgICAgICAgICAgICAgICAgICAgcERldmljZS0+YkxpbmtQYXNzID0gRkFMU0U7CisgICAgICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJMaW5rUGFzcyA9IGZhbHNlOwogICAgICAgICAgICAgICAgIH0KICAgICAgICA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AgICAvL0V1cm9wZToxfjEzCiAgICAgICAgICAgICAgICAgICAgICBpZigoYnlDdXJyQ2hhbm5lbDwxKSB8fChieUN1cnJDaGFubmVsPjEzKSkKLQkgICAgICAgICAgICAgICAgZXhjZWVkID0gVFJVRTsKKwkgICAgICAgICAgICAgICAgZXhjZWVkID0gdHJ1ZTsKIAkgICAgICAgICBicmVhazsKIAlkZWZhdWx0OiAgICAgICAgICAgICAgICAgICAgLy9yZXNlcnZlIGZvciBvdGhlciB6b25ldHlwZQogCQlicmVhazsKQEAgLTE4NjgsMzkgKzE4NjksMzkgQEAKICAgICBQU0RldmljZSBwRGV2aWNlLAogICAgIFBTTWdtdE9iamVjdCBwTWdtdCwKICAgICBQU1J4TWdtdFBhY2tldCBwUnhQYWNrZXQsCi0gICAgQk9PTCBiSW5TY2FuCisgICAgYm9vbCBiSW5TY2FuCiAgICAgKQogewogCiAgICAgUEtub3duQlNTICAgICAgICAgICBwQlNTTGlzdDsKICAgICBXTEFOX0ZSX0JFQUNPTiAgICAgIHNGcmFtZTsKICAgICBRV09SRCAgICAgICAgICAgICAgIHF3VFNGT2Zmc2V0OwotICAgIEJPT0wgICAgICAgICAgICAgICAgYklzQlNTSURFcXVhbCA9IEZBTFNFOwotICAgIEJPT0wgICAgICAgICAgICAgICAgYklzU1NJREVxdWFsID0gRkFMU0U7Ci0gICAgQk9PTCAgICAgICAgICAgICAgICBiVFNGTGFyZ2VEaWZmID0gRkFMU0U7Ci0gICAgQk9PTCAgICAgICAgICAgICAgICBiVFNGT2Zmc2V0UG9zdGl2ZSA9IEZBTFNFOwotICAgIEJPT0wgICAgICAgICAgICAgICAgYlVwZGF0ZVRTRiA9IEZBTFNFOwotICAgIEJPT0wgICAgICAgICAgICAgICAgYklzQVBCZWFjb24gPSBGQUxTRTsKLSAgICBCT09MICAgICAgICAgICAgICAgIGJJc0NoYW5uZWxFcXVhbCA9IEZBTFNFOwotICAgIFVJTlQgICAgICAgICAgICAgICAgdUxvY2F0ZUJ5dGVJbmRleDsKLSAgICBCWVRFICAgICAgICAgICAgICAgIGJ5VElNQml0T24gPSAwOwotICAgIFdPUkQgICAgICAgICAgICAgICAgd0FJRE51bWJlciA9IDA7Ci0gICAgVUlOVCAgICAgICAgICAgICAgICB1Tm9kZUluZGV4OworICAgIGJvb2wgYklzQlNTSURFcXVhbCA9IGZhbHNlOworICAgIGJvb2wgYklzU1NJREVxdWFsID0gZmFsc2U7CisgICAgYm9vbCBiVFNGTGFyZ2VEaWZmID0gZmFsc2U7CisgICAgYm9vbCBiVFNGT2Zmc2V0UG9zdGl2ZSA9IGZhbHNlOworICAgIGJvb2wgYlVwZGF0ZVRTRiA9IGZhbHNlOworICAgIGJvb2wgYklzQVBCZWFjb24gPSBmYWxzZTsKKyAgICBib29sIGJJc0NoYW5uZWxFcXVhbCA9IGZhbHNlOworICAgIHVuc2lnbmVkIGludCB1TG9jYXRlQnl0ZUluZGV4OworICAgIHVuc2lnbmVkIGNoYXIgYnlUSU1CaXRPbiA9IDA7CisgICAgdW5zaWduZWQgc2hvcnQgd0FJRE51bWJlciA9IDA7CisgICAgdW5zaWduZWQgaW50IHVOb2RlSW5kZXg7CiAgICAgUVdPUkQgICAgICAgICAgICAgICBxd1RpbWVzdGFtcCwgcXdMb2NhbFRTRjsKICAgICBRV09SRCAgICAgICAgICAgICAgIHF3Q3VyclRTRjsKLSAgICBXT1JEICAgICAgICAgICAgICAgIHdTdGFydEluZGV4ID0gMDsKLSAgICBXT1JEICAgICAgICAgICAgICAgIHdBSURJbmRleCA9IDA7Ci0gICAgQllURSAgICAgICAgICAgICAgICBieUN1cnJDaGFubmVsID0gcFJ4UGFja2V0LT5ieVJ4Q2hhbm5lbDsKKyAgICB1bnNpZ25lZCBzaG9ydCB3U3RhcnRJbmRleCA9IDA7CisgICAgdW5zaWduZWQgc2hvcnQgd0FJREluZGV4ID0gMDsKKyAgICB1bnNpZ25lZCBjaGFyIGJ5Q3VyckNoYW5uZWwgPSBwUnhQYWNrZXQtPmJ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ICAgIH0KQEAgLTIwMzUsNyArMjAzNiw3IEBACiAgICAgICAgICAgICAgICBwTWdtdC0+YWJ5Q3VyckJTU0lELAogICAgICAgICAgICAgICAgV0xBTl9CU1NJRF9MRU4pID09IDApIHsKIAotICAgICAgICBiSXNCU1NJREVxdWFsID0gVFJVRTsKKyAgICAgICAgYklzQlNTSURFcXVhbCA9IHRydWU7CiAKIC8vIDIwMDgtMDUtMjEgPGFkZD4gYnkgUmljaGFyZHRhaQogICAgICAgICBwRGV2aWNlLT51Q3VyclJTU0kgPSBwUnhQYWNrZXQtPnVSU1NJOwpAQCAtMjA1MiwzMCArMjA1MywzMCBAQAogICAgICAgICAgICAgICAgICAgICgoUFdMQU5fSUVfU1NJRClwTWdtdC0+YWJ5Q3VyclNTSUQpLT5hYnlTU0lELAogICAgICAgICAgICAgICAgICAgIHNGcmFtZS5wU1NJRC0+bGVuCiAgICAgICAgICAgICAgICAgICAgKSA9PSAwKSB7Ci0gICAgICAgICAgICBiSXNTU0lERXF1YWwgPSBUUlVFOworICAgICAgICAgICAgYklzU1NJREVxdWFsID0gdHJ1ZTsKICAgICAgICAgfTsKICAgICB9CiAKLSAgICBpZiAoKFdMQU5fR0VUX0NBUF9JTkZPX0VTUygqc0ZyYW1lLnB3Q2FwSW5mbyk9PSBUUlVFKSAmJgotICAgICAgICAoYklzQlNTSURFcXVhbCA9PSBUUlVFKSAmJgotICAgICAgICAoYklzU1NJREVxdWFsID09IFRSVUUpICYmCisgICAgaWYgKChXTEFOX0dFVF9DQVBfSU5GT19FU1MoKnNGcmFtZS5wd0NhcEluZm8pPT0gdHJ1ZSkgJiYKKyAgICAgICAgKGJJc0JTU0lERXF1YWwgPT0gdHJ1ZSkgJiYKKyAgICAgICAgKGJJc1NTSURFcXVhbCA9PSB0cnVlKSAmJgogICAgICAgICAocE1nbXQtPmVDdXJyTW9kZSA9PSBXTUFDX01PREVfRVNTX1NUQSkgJiYKICAgICAgICAgKHBNZ210LT5lQ3VyclN0YXRlID09IFdNQUNfU1RBVEVfQVNTT0MpKSB7CiAgICAgICAgIC8vIGFkZCBzdGF0ZSBjaGVjayB0byBwcmV2ZW50IHJlY29ubmVjdCBmYWlsIHNpbmNlIHdlJ2xsIHJlY2VpdmUgQmVhY29uCiAKLSAgICAgICAgYklzQVBCZWFjb24gPSBUUlVFOworICAgICAgICBiSXNBUEJlYWNvbiA9IHRydWU7CiAKICAgICAgICAgaWYgKHBCU1NMaXN0ICE9IE5VTEwpIHsKIAogICAgICAgICAgICAgLy8gQ29tcGFyZSBQSFkgcGFyYW1hdGVyIHNldHRpbmcKICAgICAgICAgICAgIGlmIChwTWdtdC0+d0N1cnJDYXBJbmZvICE9IHBCU1NMaXN0LT53Q2FwSW5mbykgewotICAgICAgICAgICAgICAgIGJVcGRhdGVQaHlQYXJhbWV0ZXIgPSBUUlVFOworICAgICAgICAgICAgICAgIGJVcGRhdGVQaHlQYXJhbWV0ZXIgPSB0cnVlOwogICAgICAgICAgICAgICAgIHBNZ210LT53Q3VyckNhcEluZm8gPSBwQlNTTGlzdC0+d0NhcEluZm87CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAoc0ZyYW1lLnBFUlAgIT0gTlVMTCkgewogICAgICAgICAgICAgICAgIGlmICgoc0ZyYW1lLnBFUlAtPmJ5RWxlbWVudElEID09IFdMQU5fRUlEX0VSUCkgJiYKICAgICAgICAgICAgICAgICAgICAgKHBNZ210LT5ieUVSUENvbnRleHQgIT0gc0ZyYW1lLnBFUlAtPmJ5Q29udGV4dCkpIHsKLSAgICAgICAgICAgICAgICAgICAgYlVwZGF0ZVBoeVBhcmFtZXRlciA9IFRSVUU7CisgICAgICAgICAgICAgICAgICAgIGJVcGRhdGVQaHlQYXJhbWV0ZXIgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgICBwTWdtdC0+YnlFUlBDb250ZXh0ID0gc0ZyYW1lLnBFUlAtPmJ5Q29udGV4dDsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CkBAIC0yMDk0LDcgKzIwOTUsNyBAQAogICAgICAgICAgICAgUkFURXZQYXJzZU1heFJhdGUoICh2b2lkICopcERldmljZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoUFdMQU5fSUVfU1VQUF9SQVRFUylwTWdtdC0+YWJ5Q3VyclN1cHBSYXRlcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoUFdMQU5fSUVfU1VQUF9SQVRFUylwTWdtdC0+YWJ5Q3VyckV4dFN1cHBSYXRlcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUUlVFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRydWUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJihwTWdtdC0+c05vZGVEQlRhYmxlWzBdLndNYXhCYXNpY1JhdGUpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYocE1nbXQtPnNOb2RlREJUYWJsZVswXS53TWF4U3VwcFJhdGUpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYocE1nbXQtPnNOb2RlREJUYWJsZVswXS53U3VwcFJhdGUpLApAQCAtMjEwNCw3ICsyMTA1LDcgQEAKICNpZmRlZglQTElDRV9ERUJVRwogCQkvL3ByaW50aygiUnhCZWFjb246TWF4U3VwcFJhdGUgaXMgJWRcbiIscE1nbXQtPnNOb2RlREJUYWJsZVswXS53TWF4U3VwcFJhdGUpOwogI2VuZGlmCi0JCQlpZiAoYlVwZGF0ZVBoeVBhcmFtZXRlciA9PSBUUlVFKSB7CisJCQlpZiAoYlVwZGF0ZVBoeVBhcmFtZXRlciA9PSB0cnVlKSB7CiAgICAgICAgICAgICAgICAgQ0FSRGJTZXRQaHlQYXJhbWV0ZXIoIHBNZ210LT5wQWRhcHRlciwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1nbXQtPmVDdXJyZW50UEhZTW9kZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1nbXQtPndDdXJyQ2FwSW5mbywKQEAgLTIxMTUsMTkgKzIxMTYsMTkgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGlmIChzRnJhbWUucElFX1Bvd2VyQ29uc3RyYWludCAhPSBOVUxMKSB7CiAgICAgICAgICAgICAgICAgQ0FSRHZTZXRQb3dlckNvbnN0cmFpbnQocE1nbXQtPnBBZGFwdGVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChCWVRFKSBwQlNTTGlzdC0+dUNoYW5uZWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHVuc2lnbmVkIGNoYXIpIHBCU1NMaXN0LT51Q2hhbm5lbCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzRnJhbWUucElFX1Bvd2VyQ29uc3RyYWludC0+YnlQb3dlcgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAoc0ZyYW1lLnBJRV9DSFNXICE9IE5VTEwpIHsKICAgICAgICAgICAgICAgICBDQVJEYkNoYW5uZWxTd2l0Y2goIHBNZ210LT5wQWRhcHRlciwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNGcmFtZS5wSUVfQ0hTVy0+YnlNb2RlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ0FSRGJ5R2V0Q2hhbm5lbE1hcHBpbmcocE1nbXQtPnBBZGFwdGVyLCBzRnJhbWUucElFX0NIU1ctPmJ5TW9kZSwgcE1nbXQtPmVDdXJyZW50UEhZTW9kZSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXRfY2hhbm5lbF9tYXBwaW5nKHBNZ210LT5wQWRhcHRlciwgc0ZyYW1lLnBJRV9DSFNXLT5ieU1vZGUsIHBNZ210LT5lQ3VycmVudFBIWU1vZGUpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc0ZyYW1lLnBJRV9DSFNXLT5ieUNvdW50CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwogCi0gICAgICAgICAgICB9IGVsc2UgaWYgKGJJc0NoYW5uZWxFcXVhbCA9PSBGQUxTRSkgewotICAgICAgICAgICAgICAgIENBUkRiU2V0Q2hhbm5lbChwTWdtdC0+cEFkYXB0ZXIsIHBCU1NMaXN0LT51Q2hhbm5lbCk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKGJJc0NoYW5uZWxFcXVhbCA9PSBmYWxzZSkgeworICAgICAgICAgICAgICAgIHNldF9jaGFubmVsKHBNZ210LT5wQWRhcHRlciwgcEJTU0xpc3QtPnVDaGFubmVsKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KQEAgLTIxNDgsMTcgKzIxNDksMTcgQEAKICAgICAvLyBjaGVjayBpZiBiZWFjb24gVFNGIGxhcmdlciBvciBzbWFsbCB0aGFuIG91ciBsb2NhbCBUU0YKICAgICBpZiAoSElEV09SRChxd1RpbWVzdGFtcCkgPT0gSElEV09SRChxd0xvY2FsVFNGKSkgewogICAgICAgICBpZiAoTE9EV09SRChxd1RpbWVzdGFtcCkgPj0gTE9EV09SRChxd0xvY2FsVFNGKSkgewotICAgICAgICAgICAgYlRTRk9mZnNldFBvc3RpdmUgPSBUUlVFOworICAgICAgICAgICAgYlRTRk9mZnNldFBvc3RpdmUgPSB0cnVlOwogICAgICAgICB9CiAgICAgICAgIGVsc2UgewotICAgICAgICAgICAgYlRTRk9mZnNldFBvc3RpdmUgPSBGQUxTRTsKKyAgICAgICAgICAgIGJUU0ZPZmZzZXRQb3N0aXZlID0gZmFsc2U7CiAgICAgICAgIH0KICAgICB9CiAgICAgZWxzZSBpZiAoSElEV09SRChxd1RpbWVzdGFtcCkgPiBISURXT1JEKHF3TG9jYWxUU0YpKSB7Ci0gICAgICAgIGJUU0ZPZmZzZXR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FtZS5wVElNLT5ieVZpcnRCaXRNYXBbdUxvY2F0ZUJ5dGVJbmRleF0gJiBieVRJTUJpdE9uID8gdHJ1ZSA6IGZhbHNlOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgcE1nbXQtPmJJblRJTSA9IEZBTFNFOworICAgICAgICAgICAgICAgICAgICBwTWdtdC0+YkluVElNID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGVsc2UgewotICAgICAgICAgICAgICAgIHBNZ210LT5iSW5USU0gPSBGQUxTRTsKKyAgICAgICAgICAgICAgICBwTWdtdC0+YkluVElNID0gZmFsc2U7CiAgICAgICAgICAgICB9OwogCiAgICAgICAgICAgICBpZiAocE1nbXQtPmJJblRJTSB8fAogICAgICAgICAgICAgICAgIChwTWdtdC0+Yk11bHRpY2FzdFRJTSAmJiAocE1nbXQtPmJ5RFRJTUNvdW50ID09IDApKSkgewotICAgICAgICAgICAgICAgIHBNZ210LT5iSW5USU1XYWtlID0gVFJVRTsKKyAgICAgICAgICAgICAgICBwTWdtdC0+YkluVElNV2FrZSA9IHRydWU7CiAgICAgICAgICAgICAgICAgLy8gc2VuZCBvdXQgcHMtcG9sbCBwYWNrZXQKIC8vICAgICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8gIkJDTjpJbiBUSU1cbiIpOwogICAgICAgICAgICAgICAgIGlmIChwTWdtdC0+YkluVElNKSB7CkBAIC0yMjIxLDE0ICsyMjIyLDE0IEBACiAKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGVsc2UgewotICAgICAgICAgICAgICAgIHBNZ210LT5iSW5USU1XYWtlID0gRkFMU0U7CisgICAgICAgICAgICAgICAgcE1nbXQtPmJJblRJTVdha2UgPSBmYWxzZTsKICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPICJCQ046IE5vdCBJbiBUSU0uLlxuIik7Ci0gICAgICAgICAgICAgICAgaWYgKHBEZXZpY2UtPmJQV0JpdE9uID09IEZBTFNFKSB7CisgICAgICAgICAgICAgICAgaWYgKHBEZXZpY2UtPmJQV0JpdE9uID09IGZhbHNlKSB7CiAgICAgICAgICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8gIkJDTjogU2VuZCBOdWxsIFBhY2tldFxuIik7CiAgICAgICAgICAgICAgICAgICAgIGlmIChQU2JTZW5kTnVsbFBhY2tldChwRGV2aWNlKSkKLSAgICAgICAgICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJQV0JpdE9uID0gVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJQV0JpdE9uID0gdHJ1ZTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYoUFNiQ29uc2lkZXJQb3dlckRvd24ocERldmljZSwgRkFMU0UsIEZBTFNFKSkgeworICAgICAgICAgICAgICAgIGlmKFBTYkNvbnNpZGVyUG93ZXJEb3duKHBEZXZpY2UsIGZhbHNlLCBmYWxzZSkpIHsKICAgICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPICJCQ046IFBvd2VyIGRvd24gbm93Li4uXG4iKTsKICAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICAgfQpAQCAtMjI0Niw3ICsyMjQ3LDcgQEAKICAgICAgICAgICAgIC8vIGFkaG9jIG1vZGU6VFNGIHVwZGF0ZWQgb25seSB3aGVuIGJlYWNvbiBsYXJnZXIgdGhlbiBsb2NhbCBUU0YKICAgICAgICAgICAgIGlmIChiVFNGTGFyZ2VEaWZmICYmIGJUU0ZPZmZzZXRQb3N0aXZlICYmCiAgICAgICAgICAgICAgICAgKHBNZ210LT5lQ3VyclN0YXRlID09IFdNQUNfU1RBVEVfSk9JTlRFRCkpCi0gICAgICAgICAgICAgICAgYlVwZGF0ZVRTRiA9IFRSVUU7CisgICAgICAgICAgICAgICAgYlVwZGF0ZVRTRiA9IHRydWU7CiAKICAgICAgICAgICAgIC8vIER1cmluZyBkcGMsIGFscmVhZHkgaW4gc3BpbmxvY2tlZC4KICAgICAgICAgICAgIGlmIChCU1NEQmJJc1NUQUluTm9kZURCKHBNZ210LCBzRnJhbWUucEhkci0+c0EzLmFieUFkZHIyLCAmdU5vZGVJbmRleCkpIHsKQEAgLTIyNTksNyArMjI2MCw3IEBACiAgICAgICAgICAgICAgICAgUkFURXZQYXJzZU1heFJhdGUoICh2b2lkICopcERldmljZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFBXTEFOX0lFX1NVUFBfUkFURVMpcE1nbXQtPmFieUN1cnJTdXBwUmF0ZXMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRSVUUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRydWUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYocE1nbXQtPnNOb2RlREJUYWJsZVt1Tm9kZUluZGV4XS53TWF4QmFzaWNSYXRlKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJihwTWdtdC0+c05vZGVEQlRhYmxlW3VOb2RlSW5kZXhdLndNYXhTdXBwUmF0ZSksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYocE1nbXQtPnNOb2RlREJUYWJsZVt1Tm9kZUluZGV4XS53U3VwcFJhdGUpLApAQCAtMjI4MCw3ICsyMjgxLDcgQEAKICAgICAgICAgICAgICAgICBSQVRFdlBhcnNlTWF4UmF0ZSggKHZvaWQgKilwRGV2aWNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoUFdMQU5fSUVfU1VQUF9SQVRFUylwTWdtdC0+YWJ5Q3VyclN1cHBSYXRlcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVFJVRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ1ZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJihwTWdtdC0+c05vZGVEQlRhYmxlW3VOb2RlSW5kZXhdLndNYXhCYXNpY1JhdGUpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmKHBNZ210LT5zTm9kZURCVGFibGVbdU5vZGVJbmRleF0ud01heFN1cHBSYXRlKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJihwTWdtdC0+c05vZGVEQlRhYmxlW3VOb2RlSW5kZXhdLndTdXBwUmF0ZSksCkBAIC0yMzAwLDcgKzIzMDEsNyBAQAogLyoKICAgICAgICAgICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlW3VOb2RlSW5kZXhdLmJTaG9ydFNsb3RUaW1lID0gV0xBTl9HRVRfQ0FQX0lORk9fU0hPUlRTTE9UVElNRSgqc0ZyYW1lLnB3Q2FwSW5mbyk7CiAgICAgICAgICAgICAgICAgaWYocE1nbXQtPnNOb2RlREJUYWJsZVt1Tm9kZUluZGV4XS53TWF4U3VwcFJhdGUgPiBSQVRFXzExTSkKLSAgICAgICAgICAgICAgICAgICAgICAgcE1nbXQtPnNOb2RlREJUYWJsZVt1Tm9kZUluZGV4XS5iRVJQRXhpc3QgPSBUUlVFOworICAgICAgICAgICAgICAgICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlW3VOb2RlSW5kZXhdLmJFUlBFeGlzdCA9IHRydWU7CiAqLwogICAgICAgICAgICAgfQogCkBAIC0yMzA4LDExICsyMzA5LDExIEBACiAgICAgICAgICAgICBpZiAocE1nbXQtPmVDdXJyU3RhdGUgPT0gV01BQ19TVEFURV9TVEFSVEVEKSB7CiAgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyAiQ3VycmVudCBJQlNTIFN0YXRlOiBbU3RhcnRlZF0uLi4uLi4uLnRvOiBbSm9pbnRlZF0gXG4iKTsKICAgICAgICAgICAgICAgICBwTWdtdC0+ZUN1cnJTdGF0ZSA9IFdNQUNfU1RBVEVfSk9JTlRFRDsKLSAgICAgICAgICAgICAgICBwRGV2aWNlLT5iTGlua1Bhc3MgPSBUUlVFOworICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJMaW5rUGFzcyA9IHRydWU7CiAgICAgICAgICAgICAgICAgaWYgKG5ldGlmX3F1ZXVlX3N0b3BwZWQocERldmljZS0+ZGV2KSl7CiAgICAgICAgICAgICAgICAgICAgIG5ldGlmX3dha2VfcXVldWUocERldmljZS0+ZGV2KTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgcE1nbXQtPnNOb2RlREJUYWJsZVswXS5iQWN0aXZlID0gVFJVRTsKKyAgICAgICAgICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlWzBdLmJBY3RpdmUgPSB0cnVlOwogICAgICAgICAgICAgICAgIHBNZ210LT5zTm9kZURCVGFibGVbMF0udUluQWN0aXZlQ291bnQgPSAwOwogCiAgICAgICAgICAgICB9OwpAQCAtMjM5MiwxNiArMjM5MywxNiBAQAogewogICAgIFBTRGV2aWNlICAgICAgICAgICAgcERldmljZSA9IChQU0RldmljZSloRGV2aWNlQ29udGV4dDsKICAgICBQU01nbXRPYmplY3QgICAgICAgIHBNZ210ID0gcERldmljZS0+cE1nbXQ7Ci0gICAgV09SRCAgICAgICAgICAgICAgICB3TWF4QmFzaWNSYXRlOwotICAgIFdPUkQgICAgICAgICAgICAgICAgd01heFN1cHBSYXRlOwotICAgIEJZVEUgICAgICAgICAgICAgICAgYnlUb3BDQ0tCYXNpY1JhdGU7Ci0gICAgQllURSAgICAgICAgICAgICAg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xTTsKKyAgICB1bnNpZ25lZCBjaGFyIGJ5VG9wT0ZETUJhc2ljUmF0ZSA9IFJBVEVfMU07CiAKIAogICAgIGZvciAoaWkgPSAwOyBpaSA8IE1BWF9CU1NfTlVNOyBpaSsrKSB7Ci0gICAgICAgIGlmIChwTWdtdC0+c0JTU0xpc3RbaWldLmJBY3RpdmUgPT0gVFJVRSkKKyAgICAgICAgaWYgKHBNZ210LT5zQlNTTGlzdFtpaV0uYkFjdGl2ZSA9PSB0cnVlKQogICAgICAgICAgICAgYnJlYWs7CiAgICAgfQogCkBAIC0yNzA4LDE0ICsyNzA5LDE0IEBACiAgICAgLy8gcGF0Y2ggZm9yIENJU0NPIG1pZ3JhdGlvbiBtb2RlCiAvKgogICAgICAgICAgICAgaWYgKHBEZXZpY2UtPmVFbmNyeXB0aW9uU3RhdHVzID09IE5kaXM4MDJfMTFFbmNyeXB0aW9uMkVuYWJsZWQpIHsKLSAgICAgICAgICAgICAgICBpZiAoV1BBX1NlYXJjaFJTTigwLCBXUEFfVEtJUCwgcEN1cnIpID09IEZBTFNFKSB7CisgICAgICAgICAgICAgICAgaWYgKFdQQV9TZWFyY2hSU04oMCwgV1BBX1RLSVAsIHBDdXJyKSA9PSBmYWxzZSkgewogICAgICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPIk5vIG1hdGNoIFJTTiBpbmZvLiArKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKytcbiIpOwogICAgICAgICAgICAgICAgICAgICAvLyBlbmNyeXB0aW9uIG1vZGUgZXJyb3IKICAgICAgICAgICAgICAgICAgICAgcE1nbXQtPmVDdXJyU3RhdGUgPSBXTUFDX1NUQVRFX0lETEU7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9IGVsc2UgaWYgKHBEZXZpY2UtPmVFbmNyeXB0aW9uU3RhdHVzID09IE5kaXM4MDJfMTFFbmNyeXB0aW9uM0VuYWJsZWQpIHsKLSAgICAgICAgICAgICAgICBpZiAoV1BBX1NlYXJjaFJTTigwLCBXUEFfQUVTQ0NNUCwgcEN1cnIpID09IEZBTFNFKSB7CisgICAgICAgICAgICAgICAgaWYgKFdQQV9TZWFyY2hSU04oMCwgV1BBX0FFU0NDTVAsIHBDdXJyKSA9PSBmYWxzZSkgewogICAgICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPIk5vIG1hdGNoIFJTTiBpbmZvLiArKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKytcbiIpOwogICAgICAgICAgICAgICAgICAgICAvLyBlbmNyeXB0aW9uIG1vZGUgZXJyb3IKICAgICAgICAgICAgICAgICAgICAgcE1nbXQtPmVDdXJyU3RhdGUgPSBXTUFDX1NUQVRFX0lETEU7CkBAIC0yNzI2LDcgKzI3MjcsNyBAQAogICAgICAgICB9CiAKICNpZmRlZiBXUEFfU1VQUExJQ0FOVF9EUklWRVJfV0VYVF9TVVBQT1JUCi0JLy9pZihwRGV2aWNlLT5iV1BBU3VwcFdleHRFbmFibGVkID09IFRSVUUpCisJLy9pZihwRGV2aWNlLT5iV1BBU3VwcFdleHRFbmFibGVkID09IHRydWUpCiAgICAgICAgICAgICBFbmN5cHRpb25fUmVidWlsZChwRGV2aWNlLCBwQ3Vycik7CiAjZW5kaWYKICAgICAgICAgLy8gSW5mcmFzdHJ1Y3R1cmUgQlNTCkBAIC0yNzY0LDE1ICsyNzY1LDE1IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVSYXRlTGVuKTsKICAgICAgICAgICAgIC8vIFN0dWZmaW5nIFJhdGUgSUUKICAgICAgICAgICAgIGlmICgocEl0ZW1FeHRSYXRlcy0+bGVuID4gMCkgJiYgKHBJdGVtUmF0ZXMtPmxlbiA8IDgpKSB7Ci0gICAgICAgICAgICAgICAgZm9yIChpaSA9IDA7IGlpIDwgKFVJTlQpKDggLSBwSXRlbVJhdGVzLT5sZW4pOyApIHsKKyAgICAgICAgICAgICAgICBmb3IgKGlpID0gMDsgaWkgPCAodW5zaWduZWQgaW50KSg4IC0gcEl0ZW1SYXRlcy0+bGVuKTsgKSB7CiAgICAgICAgICAgICAgICAgICAgIHBJdGVtUmF0ZXMtPmFieVJhdGVzW3BJdGVtUmF0ZXMtPmxlbiArIGlpXSA9IHBJdGVtRXh0UmF0ZXMtPmFieVJhdGVzW2lpXTsKICAgICAgICAgICAgICAgICAgICAgaWkgKys7CiAgICAgICAgICAgICAgICAgICAgIGlmIChwSXRlbUV4dFJhdGVzLT5sZW4gPD0gaWkpCiAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgcEl0ZW1SYXRlcy0+bGVuICs9IChCWVRFKWlpOworICAgICAgICAgICAgICAgIHBJdGVtUmF0ZXMtPmxlbiArPSAodW5zaWduZWQgY2hhcilpaTsKICAgICAgICAgICAgICAgICBpZiAocEl0ZW1FeHRSYXRlcy0+bGVuIC0gaWkgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIHBJdGVtRXh0UmF0ZXMtPmxlbiAtPSAoQllURSlpaTsKKyAgICAgICAgICAgICAgICAgICAgcEl0ZW1FeHRSYXRlcy0+bGVuIC09ICh1bnNpZ25lZCBjaGFyKWlpOwogICAgICAgICAgICAgICAgICAgICBmb3IgKHV1ID0gMDsgdXUgPCBwSXRlbUV4dFJhdGVzLT5sZW47IHV1ICsrKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBwSXRlbUV4dFJhdGVzLT5hYnlSYXRlc1t1dV0gPSBwSXRlbUV4dFJhdGVzLT5hYnlSYXRlc1t1dSArIGlpXTsKICAgICAgICAgICAgICAgICAgICAgfQpAQCAtMjc4MSw3ICsyNzgyLDcgQEA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U5GTyJiQWRkX1BNS0lEX0NhbmRpZGF0ZTogMSglZClcbiIsIGJSZXN1bHQpOwotICAgICAgICAgICAgICAgIGlmIChiUmVzdWx0ID09IEZBTFNFKSB7CisgICAgICAgICAgICAgICAgaWYgKGJSZXN1bHQgPT0gZmFsc2UpIHsKICAgICAgICAgICAgICAgICAgICAgdkZsdXNoX1BNS0lEX0NhbmRpZGF0ZSgodm9pZCAqKXBEZXZpY2UpOwogICAgICAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPInZGbHVzaF9QTUtJRF9DYW5kaWRhdGU6IDRcbiIpOwogICAgICAgICAgICAgICAgICAgICBiQWRkX1BNS0lEX0NhbmRpZGF0ZSgodm9pZCAqKXBEZXZpY2UsIHBNZ210LT5hYnlDdXJyQlNTSUQsICZwQ3Vyci0+c1JTTkNhcE9iaik7CkBAIC0yODMxLDEzICsyODMyLDEzIEBACiAgICAgICAgIGlmIChwTWdtdC0+ZUF1dGhlbk1vZGUgPT0gV01BQ19BVVRIX1dQQU5PTkUpIHsKIAogICAgICAgICAgICAgaWYgKHBEZXZpY2UtPmVFbmNyeXB0aW9uU3RhdHVzID09IE5kaXM4MDJfMTFFbmNyeXB0aW9uMkVuYWJsZWQpIHsKLSAgICAgICAgICAgICAgICBpZiAoV1BBX1NlYXJjaFJTTigwLCBXUEFfVEtJUCwgcEN1cnIpID09IEZBTFNFKSB7CisgICAgICAgICAgICAgICAgaWYgKFdQQV9TZWFyY2hSU04oMCwgV1BBX1RLSVAsIHBDdXJyKSA9PSBmYWxzZSkgewogICAgICAgICAgICAgICAgICAgICAvLyBlbmNyeXB0aW9uIG1vZGUgZXJyb3IKICAgICAgICAgICAgICAgICAgICAgcE1nbXQtPmVDdXJyU3RhdGUgPSBXTUFDX1NUQVRFX0lETEU7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9IGVsc2UgaWYgKHBEZXZpY2UtPmVFbmNyeXB0aW9uU3RhdHVzID09IE5kaXM4MDJfMTFFbmNyeXB0aW9uM0VuYWJsZWQpIHsKLSAgICAgICAgICAgICAgICBpZiAoV1BBX1NlYXJjaFJTTigwLCBXUEFfQUVTQ0NNUCwgcEN1cnIpID09IEZBTFNFKSB7CisgICAgICAgICAgICAgICAgaWYgKFdQQV9TZWFyY2hSU04oMCwgV1BBX0FFU0NDTVAsIHBDdXJyKSA9PSBmYWxzZSkgewogICAgICAgICAgICAgICAgICAgICAvLyBlbmNyeXB0aW9uIG1vZGUgZXJyb3IKICAgICAgICAgICAgICAgICAgICAgcE1nbXQtPmVDdXJyU3RhdGUgPSBXTUFDX1NUQVRFX0lETEU7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKQEAgLTI4NjgsNyArMjg2OSw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTl9SQVRFU19NQVhMRU5fMTFCKTsKICAgICAgICAgICAgIC8vIHNldCBiYXNpYyByYXRlCiAgICAgICAgICAgICBSQVRFdlBhcnNlTWF4UmF0ZSgodm9pZCAqKXBEZXZpY2UsIChQV0xBTl9JRV9TVVBQX1JBVEVTKXBNZ210LT5hYnlDdXJyU3VwcFJhdGVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwgVFJVRSwgJndNYXhCYXNpY1JhdGUsICZ3TWF4U3VwcFJhdGUsICZ3U3VwcFJhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLCB0cnVlLCAmd01heEJhc2ljUmF0ZSwgJndNYXhTdXBwUmF0ZSwgJndTdXBwUmF0ZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZieVRvcENDS0Jhc2ljUmF0ZSwgJmJ5VG9wT0ZETUJhc2ljUmF0ZSk7CiAKICAgICAgICAgICAgIHBNZ210LT53Q3VyckNhcEluZm8gPSBwQ3Vyci0+d0Nhc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AgdW5zaWduZWQgaW50IGlpLCBqajsKKyAgICBib29sIGJTdGFydEZvdW5kID0gZmFsc2U7CisgICAgYm9vbCBiTXVsdGljYXN0ID0gZmFsc2U7CisgICAgdW5zaWduZWQgc2hvcnQgd1N0YXJ0SW5kZXggPSAwOworICAgIHVuc2lnbmVkIHNob3J0IHdFbmRJbmRleCA9IDA7CiAKIAogICAgIC8vIEZpbmQgc2l6ZSBvZiBwYXJ0aWFsIHZpcnR1YWwgYml0bWFwCkBAIC0zMTY3LDEzICszMTY4LDEzIEBACiAgICAgICAgICAgICAvLyBNYXNrIG91dCB0aGUgYnJvYWRjYXN0IGJpdCB3aGljaCBpcyBpbmRpY2F0ZWQgc2VwYXJhdGVseS4KICAgICAgICAgICAgIGJNdWx0aWNhc3QgPSAoYnlNYXAgJiBieU1hc2tbMF0pICE9IDA7CiAgICAgICAgICAgICBpZihiTXVsdGljYXN0KSB7Ci0gICAgICAgICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlWzBdLmJSeFBTUG9sbCA9IFRSVUU7CisgICAgICAgICAgICAgICBwTWdtdC0+c05vZGVEQlRhYmxlWzBdLmJSeFBTUG9sbCA9IHRydWU7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBieU1hcCA9IDA7CiAgICAgICAgIH0KICAgICAgICAgaWYgKGJ5TWFwKSB7CiAgICAgICAgICAgICBpZiAoIWJTdGFydEZvdW5kKSB7Ci0gICAgICAgICAgICAgICAgYlN0YXJ0Rm91bmQgPSBUUlVFOworICAgICAgICAgICAgICAgIGJTdGFydEZvdW5kID0gdHJ1ZTsKICAgICAgICAgICAgICAgICB3U3RhcnRJbmRleCA9IGlpOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgd0VuZEluZGV4ID0gaWk7CkBAIC0zMjI0LDMwICszMjI1LDMwIEBACiBzX01nck1ha2VCZWFjb24oCiAgICAgUFNEZXZpY2UgcERldmljZSwKICAgICBQU01nbXRPYmplY3QgcE1nbXQsCi0gICAgV09SRC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YW1lLnBDdXJyU3VwcENoKTsKICAgICAgICAgfQogICAgIH0KIApAQCAtMzc2NSw3ICszNzY2LDcgQEAKICAgICAgICAgICAgIHNGcmFtZS5wUlNOV1BBLT5QS1NMaXN0WzBdLmFieU9VSVszXSA9IFdQQV9OT05FOwogICAgICAgICB9CiAgICAgICAgIC8vIEF1dGggS2V5IE1hbmFnZW1lbnQgU3VpdGUKLSAgICAgICAgcGJ5UlNOID0gKFBCWVRFKShzRnJhbWUucEJ1ZiArIHNGcmFtZS5sZW4gKyAyICsgc0ZyYW1lLnBSU05XUEEtPmxlbik7CisgICAgICAgIHBieVJTTiA9ICh1bnNpZ25lZCBjaGFyICopKHNGcmFtZS5wQnVmICsgc0ZyYW1lLmxlbiArIDIgKyBzRnJhbWUucFJTTldQQS0+bGVuKTsKICAgICAgICAgKnBieVJTTisrPTB4MDE7CiAgICAgICAgICpwYnlSU04rKz0weDAwOwogICAgICAgICAqcGJ5UlNOKys9MHgwMDsKQEAgLTM3OTksOCArMzgwMCw4IEBACiAgICAgfSBlbHNlIGlmICgoKHBNZ210LT5lQXV0aGVuTW9kZSA9PSBXTUFDX0FVVEhfV1BBMikgfHwKICAgICAgICAgICAgICAgICAocE1nbXQtPmVBdXRoZW5Nb2RlID09IFdNQUNfQVVUSF9XUEEyUFNLKSkgJiYKICAgICAgICAgICAgICAgIChwTWdtdC0+cEN1cnJCU1MgIT0gTlVMTCkpIHsKLSAgICAgICAgVUlOVCAgICAgICAgICAgICAgICBpaTsKLSAgICAgICAgUFdPUkQgICAgICAgICAgICAgICBwd1BNS0lEOworICAgICAgICB1bnNpZ25lZCBpbnQgaWk7CisgICAgICAgIHVuc2lnbmVkIHNob3J0ICpwd1BNS0lEOwogCiAgICAgICAgIC8vIFdQQSBJRQogICAgICAgICBzRnJhbWUucFJTTiA9IChQV0xBTl9JRV9SU04pKHNGcmFtZS5wQnVmICsgc0ZyYW1lLmxlbik7CkBAIC0zODU0LDcgKzM4NTUsNyBAQAogICAgICAgIC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BQb2ludCB0byBQTUtJRCBjb3VudAogICAgICAgICAgICAgKnB3UE1LSUQgPSAwOyAgICAgICAgICAgIC8vIEluaXRpYWxpemUgUE1LSUQgY291bnQKICAgICAgICAgICAgIHBieVJTTiArPSAyOyAgICAgICAgICAgICAvLyBQb2ludCB0byBQTUtJRCBsaXN0CiAgICAgICAgICAgICBmb3IgKGlpID0gMDsgaWkgPCBwRGV2aWNlLT5nc1BNS0lELkJTU0lESW5mb0NvdW50OyBpaSsrKSB7CkBAIC0zOTE3LDkgKzM5MTgsOSBAQAogc19NZ3JNYWtlUmVBc3NvY1JlcXVlc3QoCiAgICAgUFNEZXZpY2UgcERldmljZSwKICAgICBQU01nbXRPYmplY3QgcE1nbXQsCi0gICAgUEJZVEUgcERBZGRyLAotICAgIFdPUkQgd0N1cnJDYXBJbmZvLAotICAgIFdPUkQgd0xpc3RlbkludGVydmFsLAorICAgIHVuc2lnbmVkIGNoYXIgKnBEQWRkciwKKyAgICB1bnNpZ25lZCBzaG9ydCB3Q3VyckNhcEluZm8sCisgICAgdW5zaWduZWQgc2hvcnQgd0xpc3RlbkludGVydmFsLAogICAgIFBXTEFOX0lFX1NTSUQgcEN1cnJTU0lELAogICAgIFBXTEFOX0lFX1NVUFBfUkFURVMgcEN1cnJSYXRlcywKICAgICBQV0xBTl9JRV9TVVBQX1JBVEVTIHBDdXJyRXh0U3VwcFJhdGVzCkBAIC0zOTI3LDE1ICszOTI4LDE1IEBACiB7CiAgICAgUFNUeE1nbXRQYWNrZXQgICAgICBwVHhQYWNrZXQgPSBOVUxMOwogICAgIFdMQU5fRlJfUkVBU1NPQ1JFUSAgc0ZyYW1lOwotICAgIFBCWVRFICAgICAgICAgICAgICAgcGJ5SUVzOwotICAgIFBCWVRFICAgICAgICAgICAgICAgcGJ5UlNOOworICAgIHVuc2lnbmVkIGNoYXIgKnBieUlFczsKKyAgICB1bnNpZ25lZCBjaGFyICpwYnlSU047CiAKIAogICAgIHBUeFBhY2tldCA9IChQU1R4T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IDIgKyBzRnJhbWUucFJTTldQQS0+bGVuKTsKICAgICAgICAgKnBieVJTTisrPTB4MDE7CiAgICAgICAgICpwYnlSU04rKz0weDAwOwogICAgICAgICAqcGJ5UlNOKys9MHgwMDsKQEAgLTQwNTUsOCArNDA1Niw4IEBACiAgICAgfSBlbHNlIGlmICgoKHBNZ210LT5lQXV0aGVuTW9kZSA9PSBXTUFDX0FVVEhfV1BBMikgfHwKICAgICAgICAgICAgICAgICAocE1nbXQtPmVBdXRoZW5Nb2RlID09IFdNQUNfQVVUSF9XUEEyUFNLKSkgJiYKICAgICAgICAgICAgICAgIChwTWdtdC0+cEN1cnJCU1MgIT0gTlVMTCkpIHsKLSAgICAgICAgVUlOVCAgICAgICAgICAgICAgICBpaTsKLSAgICAgICAgUFdPUkQgICAgICAgICAgICAgICBwd1BNS0lEOworICAgICAgICB1bnNpZ25lZCBpbnQgaWk7CisgICAgICAgIHVuc2lnbmVkIHNob3J0ICpwd1BNS0lEOwogCiAgICAgICAgIC8qIFdQQSBJRSAqLwogICAgICAgICBzRnJhbWUucFJTTiA9IChQV0xBTl9JRV9SU04pKHNGcmFtZS5wQnVmICsgc0ZyYW1lLmxlbik7CkBAIC00MTEwLDcgKzQxMTEsNyBAQAogICAgICAgICBzRnJhbWUucFJTTi0+bGVuICs9NjsKIAogICAgICAgICAvLyBSU04gQ2FwYWJpbGl0ZXMKLSAgICAgICAgaWYgKHBNZ210LT5wQ3VyckJTUy0+c1JTTkNhcE9iai5iUlNOQ2FwRXhpc3QgPT0gVFJVRSkgeworICAgICAgICBpZiAocE1nbXQtPnBDdXJyQlNTLT5zUlNOQ2FwT2JqLmJSU05DYXBFeGlzdCA9PSB0cnVlKSB7CiAgICAgICAgICAgICBtZW1jcHkoJnNGcmFtZS5wUlNOLT5hYnlSU05bMTZdLCAmcE1nbXQtPnBDdXJyQlNTLT5zUlNOQ2FwT2JqLndSU05DYXAsIDIpOwogICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgc0ZyYW1lLnBSU04tPmFieVJTTlsxNl0gPSAwOwpAQCAtNDExOCwxMCArNDExOSwxMCBAQAogICAgICAgICB9CiAgICAgICAgIHNGcmFtZS5wUlNOLT5sZW4gKz0yOwogCi0gICAgICAgIGlmICgocERldmljZS0+Z3NQTUtJRC5CU1NJREluZm9Db3VudCA+IDApICYmIChwRGV2aWNlLT5iUm9hbWluZyA9PSBUUlVFKSAmJiAocE1nbXQtPmVBdXRoZW5Nb2RlID09IFdNQUNfQVVUSF9XUEEyKSkgeworICAgICAgICBpZiAoKHBEZXZpY2UtPmdzUE1LSUQuQlNTSURJbmZvQ291bnQgPiAwKSAmJiAocERldmljZS0+YlJvYW1pbmcgPT0gdHJ1ZSkgJiYgKHBNZ210LT5lQXV0aGVuTW9kZSA9PSBXTUFDX0FVVEhfV1BBMikpIHsKICAgICAgICAgICAgIC8vIFJTTiBQTUtJRAogICAgICAgICAgICAgcGJ5UlNOID0gJnNGcmFtZS5wUlNOLT5hYnlSU05bMThdOwotICAgICAgICAgICAgcHdQTUtJRCA9IChQV09SRClwYnlSU047IC8vIFBvaW50IHRvIFBNS0lEIGNvdW50CisgICAgICAgICAgICBwd1BNS0lEID0gKHVuc2lnbmVkIHNob3J0ICopcGJ5UlNOOyAvLyBQb2ludCB0byBQTUtJRCBjb3VudAogICAgICAgICAgICAgKnB3UE1LSUQgPSAwOyAgICAgICAgICAgIC8vIEluaXRpYWxpemUgUE1LSUQgY291bnQKICAgICAgICAgICAgIHBieVJTTiArPSAyOyAgICAgICAgICAgICAvLyBQb2ludCB0byBQTUtJRCBsaXN0CiAgICAgICAgICAgICBmb3IgKGlpID0gMDsgaWkgPCBwRGV2aWNlLT5nc1BNS0lELkJTU0lESW5mb0NvdW50OyBpaSsrKSB7CkBAIC00MTY5LDEwICs0MTcwLDEwIEBACiBzX01nck1ha2VBc3NvY1Jlc3BvbnNlKAogICAgIFBTRGV2aWNlIHBEZXZpY2UsCiAgICAgUFNNZ210T2JqZWN0IHBNZ210LAotIC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gICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8gInJ4IHJlYXNzb2NyZXNwXG4iKTsKLSAgICAgICAgICAgIHNfdk1nclJ4QXNzb2NSZXNwb25zZShwRGV2aWNlLCBwTWdtdCwgcFJ4UGFja2V0LCBUUlVFKTsKKyAgICAgICAgICAgIHNfdk1nclJ4QXNzb2NSZXNwb25zZShwRGV2aWNlLCBwTWdtdCwgcFJ4UGFja2V0LCB0cnVlKTsKICAgICAgICAgICAgIGJyZWFrOwogCiAgICAgICAgIGNhc2UgV0xBTl9GU1RZUEVfUFJPQkVSRVE6CkBAIC00NjIzLDcgKzQ2MjQsNyBAQAogICAgICAgICAgICAgLy8gRnJhbWUgQ2xhc2UgPSAwCiAgICAgICAgICAgICAvL0RCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8gInJ4IGJlYWNvblxuIik7CiAgICAgICAgICAgICBpZiAocE1nbXQtPmVTY2FuU3RhdGUgIT0gV01BQ19OT19TQ0FOTklORykgewotICAgICAgICAgICAgICAgIGJJblNjYW4gPSBUUlVFOworICAgICAgICAgICAgICAgIGJJblNjYW4gPSB0cnVlOwogICAgICAgICAgICAgfTsKICAgICAgICAgICAgIHNfdk1nclJ4QmVhY29uKHBEZXZpY2UsIHBNZ210LCBwUnhQYWNrZXQsIGJJblNjYW4pOwogICAgICAgICAgICAgYnJlYWs7CkBAIC00NjgwLDEwICs0NjgxLDEwIEBACiAgKiAgUHJlcGFyZSBiZWFjb24gdG8gc2VuZAogICoKICAqIFJldHVybiBWYWx1ZToKLSAqICAgIFRSVUUgaWYgc3VjY2VzczsgRkFMU0UgaWYgZmFpbGVkLgorICogICAgdHJ1ZSBpZiBzdWNjZXNzOyBmYWxzZSBpZiBmYWlsZWQuCiAgKgogLSovCi1CT09MCitib29sCiBiTWdyUHJlcGFyZUJlYWNvblRvU2VuZCgKICAgICB2b2lkICpoRGV2aWNlQ29udGV4dCwKICAgICBQU01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R1cm4gdHJ1ZTsKIH0KIAogLyoKQEAgLTQ4ODEsMjAgKzQ4ODIsMjAgQEAKICAgICBtZW1zZXQoJnBEZXZpY2UtPmdzUE1LSURDYW5kaWRhdGUsIDAsIHNpemVvZihTUE1LSURDYW5kaWRhdGVFdmVudCkpOwogfQogCi1zdGF0aWMgQk9PTAorc3RhdGljIGJvb2wKIHNfYkNpcGhlck1hdGNoICgKICAgICBQS25vd25CU1MgICAgICAgICAgICAgICAgICAgICAgICBwQlNTTm9kZSwKICAgICBORElTXzgwMl8xMV9FTkNSWVBUSU9OX1NUQVRVUyAgICBFbmNTdGF0dXMsCi0gICAgUEJZVEUgICAgICAgICAgICAgICAgICAgICAgICAgICBwYnlDQ1NQSywKLSAgICBQQllURSAgICAgICAgICAgICAgICAgICAgICAgICAgIHBieUNDU0dLCisgICAgdW5zaWduZWQgY2hhciAqcGJ5Q0NTUEssCisgICAgdW5zaWduZWQgY2hhciAqcGJ5Q0NTR0sKICAgICApCiB7Ci0gICAgQllURSBieU11bHRpY2FzdENpcGhlciA9IEtFWV9DVExfSU5WQUxJRDsKLSAgICBCWVRFIGJ5Q2lwaGVyTWFzayA9IDB4MDA7CisgICAgdW5zaWduZWQgY2hhciBieU11bHRpY2FzdENpcGhlciA9IEtFWV9DVExfSU5WQUxJRDsKKyAgICB1bnNpZ25lZCBjaGFyIGJ5Q2lwaGVyTWFzayA9IDB4MDA7CiAgICAgaW50IGk7CiAKICAgICBpZiAocEJTU05vZGUgPT0gTlVMTCkKLSAgICAgICAgcmV0dXJuIEZBTFNFOworICAgICAgICByZXR1cm4gZmFsc2U7CiAKICAgICAvLyBjaGVjayBjYXAuIG9mIEJTUwogICAgIGlmICgoV0xBTl9HRVRfQ0FQX0lORk9fUFJJVkFDWShwQlNTTm9kZS0+d0NhcEluZm8pICE9IDApICYmCkBAIC00OTA0LDcgKzQ5MDUsNyBAQAogICAgIH0KIAogICAgIGlmICgoV0xBTl9HRVRfQ0FQX0lORk9fUFJJVkFDWShwQlNTTm9kZS0+d0NhcEluZm8pICE9IDApICYmCi0gICAgICAgIChwQlNTTm9kZS0+YldQQTJWYWxpZCA9PSBUUlVFKSAmJgorICAgICAgICAocEJTU05vZGUtPmJXUEEyVmFsaWQgPT0gdHJ1ZSkgJiYKICAgICAgICAgICAvLzIwMDgwMTIzLTAxLDxBZGQ+IGJ5IEVpbnNuIExpdQogICAgICAgICAoKEVuY1N0YXR1cyA9PSBOZGlzODAyXzExRW5jcnlwdGlvbjNFbmFibGVkKXx8KEVuY1N0YXR1cyA9PSBOZGlzODAyXzExRW5jcnlwdGlvbjJFbmFibGVkKSkpIHsKICAgICAgICAgLy9XUEEyCkBAIC00OTM4LDcgKzQ5MzksNyBAQAogICAgICAgICB9CiAKICAgICB9IGVsc2UgaWYgKChXTEFOX0dFVF9DQVBfSU5GT19QUklWQUNZKHBCU1NOb2RlLT53Q2FwSW5mbykgIT0gMCkgJiYKLSAgICAgICAgICAgICAgICAocEJTU05vZGUtPmJXUEFWYWxpZCA9PSBUUlVFKSAmJgorICAgICAgICAgICAgICAgIChwQlNTTm9kZS0+YldQQVZhbGlkID09IHRydWUpICYmCiAgICAgICAgICAgICAgICAgKChFbmNTdGF0dXMgPT0gTmRpczgwMl8xMUVuY3J5cHRpb24zRW5hYmxlZCkgfHwgKEVuY1N0YXR1cyA9PSBOZGlzODAyXzExRW5jcnlwdGlvbjJFbmFibGVkKSkpIHsKICAgICAgICAgLy9XUEEKICAgICAgICAgLy8gY2hlY2sgR3JvdXAgS2V5IENpcGhlcgpAQCAtNDk3OCw5ICs0OTc5LDkgQEAKICAgICAgICAgICAgIChieUNpcGhlck1hc2sgPT0gMCkpIHsKICAgICAgICAgICAgICpwYnlDQ1NHSyA9IEtFWV9DVExfV0VQOwogICAgICAgICAgICAgKnBieUNDU1BLID0gS0VZX0NUTF9OT05FOwotICAgICAgICAgICAgcmV0dXJuIFRSVUU7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHJldHVybiBGQUxTRTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgfQogCiAgICAgfSBlbHNlIGlmIChFbmNTdGF0dXMgPT0gTmRpczgwMl8xMUVuY3J5cHRpb24yRW5hYmxlZCkgewpAQCAtNDk4OCw0NSArNDk4OSw0NSBAQAogICAgICAgICAgICAgKGJ5Q2lwaGVyTWFzayA9PSAwKSkgewogICAgICAgICAgICAgKnBieUNDU0dLID0gS0VZX0NUTF9US0lQOwogICAgICAgICAgICAgKnBieUNDU1BLID0gS0VZX0NUTF9OT05FOwotICAgICAgICAgICAgcmV0dXJuIFRSVUU7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgfSBlbHNlIGlmICgoYnlNdWx0aWNhc3RDaXBoZXIgPT0gS0VZX0NUTF9XRVApICYmCiAgICAgICAgICAgICAgICAgICAgKChieUNpcGhlck1hc2sgJiAweDAyKSAhPSAwKSkgewogICAgICAgICAgICAgKnBieUNDU0dLID0gS0VZX0NUTF9XRVA7CiAgICAgICAgICAgICAqcGJ5Q0NTUEsgPSBLRVlfQ1RMX1RLSVA7Ci0gICAgICAgICAgICByZXR1cm4gVFJVRTsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICB9IGVsc2UgaWYgKChieU11bHRpY2FzdENpcGhlciA9PSBLRVlfQ1RMX1RLSVApICYmCiAgICAgICAgICAgICAgICAgICAgKChieUNpcGhlck1hc2sgJiAweDAyKSAhPSAwKSkgewogICAgICAgICAgICAgKnBieUNDU0dLID0gS0VZX0NUTF9US0lQOwogICAgICAgICAgICAgKnBieUNDU1BLID0gS0VZX0NUTF9US0lQOwotICAgICAgICAgICAgcmV0dXJuIFRSVUU7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHJldHVybiBGQUxTRTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgfQogICAgIH0gZWxzZSBpZiAoRW5jU3RhdHVzID09IE5kaXM4MDJfMTFFbmNyeXB0aW9uM0VuYWJsZWQpIHsKICAgICAgICAgaWYgKChieU11bHRpY2FzdENpcGhlciA9PSBLRVlfQ1RMX0NDTVApICYmCiAgICAgICAgICAgICAoYnlDaXBoZXJNYXNrID09IDApKSB7CiAgICAgICAgICAgICAvLyBXaGVuIENDTVAgaXMgZW5hYmxlLCAiVXNlIGdyb3VwIGNpcGhlciBzdWl0ZSIgc2hhbGwgbm90IGJlIGEgdmFsaWQgb3B0aW9uLgotICAgICAgICAgICAgcmV0dXJuIEZBTFNFOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICB9IGVsc2UgaWYgKChieU11bHRpY2FzdENpcGhlciA9PSBLRVlfQ1RMX1dFUCkgJiYKICAgICAgICAgICAgICAgICAgICAoKGJ5Q2lwaGVyTWFzayAmIDB4MDQpICE9IDApKSB7CiAgICAgICAgICAgICAqcGJ5Q0NTR0sgPSBLRVlfQ1RMX1dFUDsKICAgICAgICAgICAgICpwYnlDQ1NQSyA9IEtFWV9DVExfQ0NNUDsKLSAgICAgICAgICAgIHJldHVybiBUUlVFOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgIH0gZWxzZSBpZiAoKGJ5TXVsdGljYXN0Q2lwaGVyID09IEtFWV9DVExfVEtJUCkgJiYKICAgICAgICAgICAgICAgICAgICAoKGJ5Q2lwaGVyTWFzayAmIDB4MDQpICE9IDApKSB7CiAgICAgICAgICAgICAqcGJ5Q0NTR0sgPSBLRVlfQ1RMX1RLSVA7CiAgICAgICAgICAgICAqcGJ5Q0NTUEsgPSBLRVlfQ1RMX0NDTVA7Ci0gICAgICAgICAgICByZXR1cm4gVFJVRTsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICB9IGVsc2UgaWYgKChieU11bHRpY2FzdENpcGhlciA9PSBLRVlfQ1RMX0NDTVApICYmCiAgICAg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FOX0JFQUNPTl9GUl9NQVhMRU5dOwogICAgIC8vIHN0b3JlIFJlcUlFcyBzZXQgYnkgT0lEXzgwMl8xMV9BU1NPQ0lBVElPTl9JTkZPUk1BVElPTgotICAgIFVMT05HICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXF1ZXN0SUVMZW5ndGg7Ci0gICAgQllURSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFieVJlcUlFc1tXTEFOX0JFQUNPTl9GUl9NQVhMRU5dOworICAgIHVuc2lnbmVkIGxvbmcgUmVxdWVzdElFTGVuZ3RoOworICAgIHVuc2lnbmVkIGNoYXIgYWJ5UmVxSUVzW1dMQU5fQkVBQ09OX0ZSX01BWExFTl07CiB9IFNBc3NvY0luZm8sICpQU0Fzc29jSW5mbzsKIC8vLS0tCiAKQEAgLTIyNCw4ICsyMjQsOCBAQAogdHlwZWRlZiBzdHJ1Y3QgdGFnU1R4TWdtdFBhY2tldCB7CiAKICAgICBQVVdMQU5fODAyMTFIRFIgICAgIHA4MDIxMUhlYWRlcjsKLSAgICBVSU5UICAgICAgICAgICAgICAgIGNiTVBEVUxlbjsKLSAgICBVSU5UICAgICAgICAgICAgICAgIGNiUGF5bG9hZExlbjsKKyAgICB1bnNpZ25lZCBpbnQgY2JNUERVTGVuOworICAgIHVuc2lnbmVkIGludCBjYlBheWxvYWRMZW47CiAKIH0gU1R4TWdtdFBhY2tldCwgKlBTVHhNZ210UGFja2V0OwogCkBAIC0yMzUsMTIgKzIzNSwxMiBAQAogCiAgICAgUFVXTEFOXzgwMjExSERSICAgICBwODAyMTFIZWFkZXI7CiAgICAgUVdPUkQgICAgICAgICAgICAgICBxd0xvY2FsVFNGOwotICAgIFVJTlQgICAgICAgICAgICAgICAgY2JNUERVTGVuOwotICAgIFVJTlQgICAgICAgICAgICAgICAgY2JQYXlsb2FkTGVuOwotICAgIFVJTlQgICAgICAgICAgICAgICAgdVJTU0k7Ci0gICAgQllURSAgICAgICAgICAgICAgICBieVNROwotICAgIEJZVEUgICAgICAgICAgICAgICAgYnlSeFJhdGU7Ci0gICAgQllURSAgICAgICAgICAgICAgICBieVJ4Q2hhbm5lbDsKKyAgICB1bnNpZ25lZCBpbnQgY2JNUERVTGVuOworICAgIHVuc2lnbmVkIGludCBjYlBheWxvYWRMZW47CisgICAgdW5zaWduZWQgaW50IHVSU1NJOworICAgIHVuc2lnbmVkIGNoYXIgYnlTUTsKKyAgICB1bnNpZ25lZCBjaGFyIGJ5UnhSYXRlOworICAgIHVuc2lnbmVkIGNoYXIgYnlSeENoYW5uZWw7CiAKIH0gU1J4TWdtdFBhY2tldCwgKlBTUnhNZ210UGFja2V0OwogCkBAIC0yNTEsNyArMjUxLDcgQEAKIAogICAgIHZvaWQgKiAgICAgICAgICAgICAgICAgICBwQWRhcHRlcjsKICAgICAvLyBNQUMgYWRkcmVzcwotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgIGFieU1BQ0FkZHJbV0xBTl9BRERSX0xFTl07CisgICAgdW5zaWduZWQgY2hhciBhYnlNQUNBZGRyW1dMQU5fQUREUl9MRU5dOwogCiAgICAgLy8gQ29uZmlndXJhdGlvbiBNb2RlCiAgICAgV01BQ19DT05GSUdfTU9ERSAgICAgICAgZUNvbmZpZ01vZGU7IC8vIE1BQyBwcmUtY29uZmlnZWQgbW9kZQpAQCAtMjY0LDg2ICsyNjQsODYgQEAKICAgICBXTUFDX0JTU19TVEFURSAgICAgICAgICBlQ3VyclN0YXRlOyAgLy8gTUFDIGN1cnJlbnQgQlNTIHN0YXRlCiAKICAgICBQS25vd25CU1MgICAgICAgICAgICAgICBwQ3VyckJTUzsKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICBieUNTU0dLOwotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgIGJ5Q1NTUEs7CisgICAgdW5zaWduZWQgY2hhciBieUNTU0dLOworICAgIHVuc2lnbmVkIGNoYXIgYnlDU1NQSzsKIAotLy8gICAgQllURSAgICAgICAgICAgICAgICAgICAgYWJ5TmV3U3VwcFJhdGVzW1dMQU5fSUVIRFJfTEVOICsgV0xBTl9SQVRFU19NQVhMRU5dOwotLy8gICAgQllURSAgICAgICAgICAgICAgICAgICAgYWJ5TmV3RXh0U3VwcFJhdGVzW1dMQU5fSUVIRFJfTEVOICsgV0xBTl9SQVRFU19NQVhMRU5dOworLy8gICAgdW5zaWduZWQgY2hhciBhYnlOZXdTdXBwUmF0ZXNbV0xBTl9JRUhEUl9MRU4gKyBXTEFOX1JBVEVTX01BWExFTl07CisvLyAgICB1bnNpZ25lZCBjaGFyIGFieU5ld0V4dFN1cHBSYXRlc1tXTEFOX0lFSERSX0xFTiArIFdMQU5fUkFURVNfTUFYTEVOXTsKIAogICAgIC8vIEN1cnJlbnQgc3RhdGUgdmFycwotICAgIFVJTlQgICAgICAgICAgICAgICAgICAgIHVDdXJyQ2hhbm5lbDsKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICBhYnlDdXJyU3VwcFJhdGVzW1dMQU5fSUVIRFJfTEVOICsgV0xBTl9SQVRFU19NQVhMRU4gKyAxXTsKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICBhYnlDdXJyRXh0U3VwcFJhdGVzW1dMQU5fSUVIRFJfTEVOICsgV0xBTl9SQVRFU19NQVhMRU4gKyAxXTsKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICBhYnlDdXJyU1NJRFtXTEFOX0lFSERSX0xFTiArIFdMQU5fU1NJRF9NQVhMRU4gKyAxXTsKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICBhYnlDdXJyQlNTSURbV0xBTl9CU1NJRF9MRU5dOwotICAgIFdPUkQgICAgICAgICAgICAgICAgICAgIHdDdXJyQ2FwSW5mbzsKLSAgICBXT1JEICAgICAgICAgICAgICAgICAgICB3Q3VyckFJRDsKLSAgICBXT1JEICAgICAgICAgICAgICAgICAgICB3Q3VyckFUSU1XaW5kb3c7Ci0gICAgV09SRCAgICAgICAgICAgICAgICAgICAgd0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ICAgIEJZVEUgICAgICAgICAgICAgICAgICAgIGFieURlc2lyZUJTU0lEW1dMQU5fQlNTSURfTEVOXTsKKyAgICB1bnNpZ25lZCBjaGFyIGFieURlc2lyZVNTSURbV0xBTl9JRUhEUl9MRU4gKyBXTEFOX1NTSURfTUFYTEVOICsgMV07CisgICAgdW5zaWduZWQgY2hhciBhYnlEZXNpcmVCU1NJRFtXTEFOX0JTU0lEX0xFTl07CiAKICAgICAvLyBBZGhvYyBvciBBUCBjb25maWd1cmF0aW9uIHZhcnMKLSAgLy9CWVRFICAgICAgICAgICAgICAgICAgICBhYnlBZEhvY1NTSURbV0xBTl9JRUhEUl9MRU4gKyBXTEFOX1NTSURfTUFYTEVOICsgMV07Ci0gICAgV09SRCAgICAgICAgICAgICAgICAgICAgd0lCU1NCZWFjb25QZXJpb2Q7Ci0gICAgV09SRCAgICAgICAgICAgICAgICAgICAgd0lCU1NBVElNV2luZG93OwotICAgIFVJTlQgICAgICAgICAgICAgICAgICAgIHVJQlNTQ2hhbm5lbDsKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICBhYnlJQlNTU3VwcFJhdGVzW1dMQU5fSUVIRFJfTEVOICsgV0xBTl9SQVRFU19NQVhMRU4gKyAxXTsKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICBieUFQQkJUeXBlOwotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgIGFieVdQQUlFW01BWF9XUEFfSUVfTEVOXTsKLSAgICBXT1JEICAgICAgICAgICAgICAgICAgICB3V1BBSUVMZW47CisgIC8vdW5zaWduZWQgY2hhciBhYnlBZEhvY1NTSURbV0xBTl9JRUhEUl9MRU4gKyBXTEFOX1NTSURfTUFYTEVOICsgMV07CisgICAgdW5zaWduZWQgc2hvcnQgd0lCU1NCZWFjb25QZXJpb2Q7CisgICAgdW5zaWduZWQgc2hvcnQgd0lCU1NBVElNV2luZG93OworICAgIHVuc2lnbmVkIGludAl1SUJTU0NoYW5uZWw7CisgICAgdW5zaWduZWQgY2hhciBhYnlJQlNTU3VwcFJhdGVzW1dMQU5fSUVIRFJfTEVOICsgV0xBTl9SQVRFU19NQVhMRU4gKyAxXTsKKyAgICB1bnNpZ25lZCBjaGFyIGJ5QVBCQlR5cGU7CisgICAgdW5zaWduZWQgY2hhciBhYnlXUEFJRVtNQVhfV1BBX0lFX0xFTl07CisgICAgdW5zaWduZWQgc2hvcnQgd1dQQUlFTGVuOwogCi0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgdUFzc29jQ291bnQ7Ci0gICAgQk9PTCAgICAgICAgICAgICAgICAgICAgYk1vcmVEYXRhOworICAgIHVuc2lnbmVkIGludAl1QXNzb2NDb3VudDsKKyAgICBib29sIGJNb3JlRGF0YTsKIAogICAgIC8vIFNjYW4gc3RhdGUgdmFycwogICAgIFdNQUNfU0NBTl9TVEFURSAgICAgICAgIGVTY2FuU3RhdGU7CiAgICAgV01BQ19TQ0FOX1RZUEUgICAgICAgICAgZVNjYW5UeXBlOwotICAgIFVJTlQgICAgICAgICAgICAgICAgICAgIHVTY2FuU3RhcnRDaDsKLSAgICBVSU5UICAgICAgICAgICAgICAgICAgICB1U2NhbkVuZENoOwotICAgIFdPUkQgICAgICAgICAgICAgICAgICAgIHdTY2FuU3RlcHM7Ci0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgdVNjYW5CU1NUeXBlOworICAgIHVuc2lnbmVkIGludAl1U2NhblN0YXJ0Q2g7CisgICAgdW5zaWduZWQgaW50CXVTY2FuRW5kQ2g7CisgICAgdW5zaWduZWQgc2hvcnQgd1NjYW5TdGVwczsKKyAgICB1bnNpZ25lZCBpbnQJdVNjYW5CU1NUeXBlOwogICAgIC8vIERlc2lyZSBzY2FubmlnIHZhcnMKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICBhYnlTY2FuU1NJRFtXTEFOX0lFSERSX0xFTiArIFdMQU5fU1NJRF9NQVhMRU4gKyAxXTsKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICBhYnlTY2FuQlNTSURbV0xBTl9CU1NJRF9MRU5dOworICAgIHVuc2lnbmVkIGNoYXIgYWJ5U2NhblNTSURbV0xBTl9JRUhEUl9MRU4gKyBXTEFOX1NTSURfTUFYTEVOICsgMV07CisgICAgdW5zaWduZWQgY2hhciBhYnlTY2FuQlNTSURbV0xBTl9CU1NJRF9MRU5dOwogCiAgICAgLy8gUHJpdmFjeQogICAgIFdNQUNfQVVUSEVOVElDQVRJT05fTU9ERSBlQXV0aGVuTW9kZTsKICAgICBXTUFDX0VOQ1JZUFRJT05fTU9ERSAgICBlRW5jcnlwdGlvbk1vZGU7Ci0gICAgQk9PTCAgICAgICAgICAgICAgICAgICAgYlNoYXJlS2V5QWxnb3JpdGhtOwotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgIGFieUNoYWxsZW5nZVtXTEFOX0NIQUxMRU5HRV9MRU5dOwotICAgIEJPT0wgICAgICAgICAgICAgICAgICAgIGJQcml2YWN5SW52b2tlZDsKKyAgICBib29sIGJTaGFyZUtleUFsZ29yaXRobTsKKyAgICB1bnNpZ25lZCBjaGFyIGFieUNoYWxsZW5nZVtXTEFOX0NIQUxMRU5HRV9MRU5dOworICAgIGJvb2wgYlByaXZhY3lJbnZva2VkOwogCiAgICAgLy8gUmVjZWl2ZWQgYmVhY29uIHN0YXRlIHZhcnMKLSAgICBCT09MICAgICAgICAgICAgICAgICAgICBiSW5USU07Ci0gICAgQk9PTCAgICAgICAgICAgICAgICAgICAgYk11bHRpY2FzdFRJTTsKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICBieURUSU1Db3VudDsKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICBieURUSU1QZXJpb2Q7CisgICAgYm9vbCBiSW5USU07CisgICAgYm9vbCBiTXVsdGljYXN0VElNOworICAgIHVuc2lnbmVkIGNoYXIgYnlEVElNQ291bnQ7CisgICAgdW5zaWduZWQgY2hhciBieURUSU1QZXJpb2Q7CiAKICAgICAvLyBQb3dlciBzYXZpbmcgc3RhdGUgdmFycwogICAgIFdNQUNfUE9XRVJfTU9ERSAgICAgICAgIGVQU01vZGU7Ci0gICAgV09SRCAgICAgICAgICAgICAgICAgICAgd0xpc3RlbkludGVydmFsOwotICAgIFdPUkQgICAgICAgICAgICAgICAgICAgIHdDb3VudFRvV2FrZVVwOwotICAgIEJPT0wgICAgICAgICAgICAgICAgICAgIGJJblRJTVdha2U7Ci0gICAgUEJZVEUgICAgICAgICAgICAgICAgICAgcGJ5UFNQYWNrZXRQb29sOwotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgIGJ5UFNQYWNrZXRQb29sW3NpemVvZihTVHhNZ210UGFja2V0KSArIFdMQU5fTlVMTERBVEFfRlJfTUFYTEVOXTsKLSAgICBCT09MICAgICAgICAgICAgICAgICAgICBiUnhCZWFjb25JblRCVFRXYWtlOwotICAgIEJZVEUgICAgICAgICAgICAgICAgICAgIGFieVBTVHhNYXBbTUFYX05PREVfTlVNICsgMV07CisgICAgdW5zaWduZWQgc2hvcnQgd0xpc3RlbkludGVydmFsOworICAgIHVuc2lnbmVkIHNob3J0IHdDb3VudFRvV2FrZVVwOworICAgIGJvb2wgYkluVElNV2FrZTsKKyAgICB1bnNpZ25lZCBjaGFyICpwYnlQU1BhY2tldFBvb2w7CisgICAgdW5zaWduZWQgY2hhciBieVBTUGFja2V0UG9vbFtzaXplb2YoU1R4TWdtdFBhY2tldCkgKyBXTEFOX05VTExEQVRBX0ZSX01BWExFTl07CisgICAgYm9vbCBiUnhCZWFjb25JblRCVFRXYWtlOworICAgIHVuc2lnbmVkIGNoYXIgYWJ5UFNUeE1hcFtNQVhfTk9ERV9OVU0gKyAxXTsKIAogICAgIC8vIG1hbmFnZW1lbnQgY29tbWFuZCByZWxhdGVkCi0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgdUNtZEJ1c3k7Ci0gICAgVUlOVCAgICAgICAgICAgICAgICAgICAgdUNtZEhvc3RBUEJ1c3k7CisgICAgdW5zaWduZWQgaW50CXVDbWRCdXN5OworICAgIHVuc2lnbmVkIGludAl1Q21kSG9zdEFQQnVzeTsKIAogICAgIC8vIG1hbmFnZW1lbnQgcGFja2V0IHBvb2wKLSAgICBQQllURSAgICAgICAgICAgICAgICAgICBwYnlNZ210UGFja2V0UG9vbDsKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICBieU1nbXRQYWNrZXRQb29sW3NpemVvZihTVHhNZ210UGFja2V0KSArIFdMQU5fQTNGUl9NQVhMRU5dOworICAgIHVuc2lnbmVkIGNoYXIgKnBieU1nbXRQYWNrZXRQb29sOworICAgIHVuc2lnbmVkIGNoYXIgYnlNZ210UGFja2V0UG9vbFtzaXplb2YoU1R4TWdtdFBhY2tldCkgKyBXTEFOX0EzRlJfTUFYTEVOXTsKIAogCiAgICAgLy8gT25lIHNlY29uZCBjYWxsYmFjayB0aW1lcgpAQCAtMzY2LDcgKzM2Niw3IEBACiAKICAgICAvLyBXUEEyIFBNS0lEIENhY2hlCiAgICAgU1BNS0lEQ2FjaGUgICAgICAgICAgICAgZ3NQTUtJRENhY2hlOwotICAgIEJPT0wgICAgICAgICAgICAgICAgICAgIGJSb2FtaW5nOworICAgIGJvb2wgYlJvYW1pbmc7CiAKICAgICAvLyByYXRlIGZhbGwgYmFjayB2YXJzCiAKQEAgLTM3NywxNiArMzc3LDE2IEBACiAKIAogICAgIC8vIGZvciA4MDIuMTFoCi0gICAgQk9PTCAgICAgICAgICAgICAgICAgICAgYjExaEVuYWJsZTsKLSAgICBCT09MICAgICAgICAgICAgICAgICAgICBiU3dpdGNoQ2hhbm5lbDsKLSAgICBCWVRFICAgICAgICAgICAgICAgICAgICBieU5ld0NoYW5uZWw7CisgICAgYm9vbCBiMTFoRW5hYmxlOworICAgIGJvb2wgYlN3aXRjaENoYW5uZWw7CisgICAgdW5zaWduZWQgY2hhciBieU5ld0NoYW5uZWw7CiAgICAgUFdMQU5fSUVfTUVBU1VSRV9SRVAgICAgcEN1cnJNZWFzdXJlRUlEUmVwOwotICAgIFVJTlQgICA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ICAgICAgICBmb3IoaSA9IDA7IChpIDwgcFJTTi0+d1BLQ291bnQpICYmIChqIDwgc2l6ZW9mKHBCU1NMaXN0LT5hYnlQS1R5cGUpL3NpemVvZihCWVRFKSk7IGkrKykgeworICAgICAgICAgICAgZm9yKGkgPSAwOyAoaSA8IHBSU04tPndQS0NvdW50KSAmJiAoaiA8IHNpemVvZihwQlNTTGlzdC0+YWJ5UEtUeXBlKS9zaXplb2YodW5zaWduZWQgY2hhcikpOyBpKyspIHsKICAgICAgICAgICAgICAgICBpZihwUlNOLT5sZW4gPj0gMTIraSo0KzQpIHsgLy9vdWkxKDQpK3ZlcigyKStHS1MoNCkrUEtTQ250KDIpK1BLUyg0KmkpCiAgICAgICAgICAgICAgICAgICAgIGlmICggIW1lbWNtcChwUlNOLT5QS1NMaXN0W2ldLmFieU9VSSwgYWJ5T1VJMDAsIDQpKQogICAgICAgICAgICAgICAgICAgICAgICAgcEJTU0xpc3QtPmFieVBLVHlwZVtqKytdID0gV1BBX05PTkU7CkBAIC0xNjYsNyArMTY2LDcgQEAKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgLy9EQkdfUFJOX0dSUDE0KCgiYWJ5UEtUeXBlWyVkXTogJVhcbiIsIGotMSwgcEJTU0xpc3QtPmFieVBLVHlwZVtqLTFdKSk7CiAgICAgICAgICAgICB9IC8vZm9yCi0gICAgICAgICAgICBwQlNTTGlzdC0+d1BLQ291bnQgPSAoV09SRClqOworICAgICAgICAgICAgcEJTU0xpc3QtPndQS0NvdW50ID0gKHVuc2lnbmVkIHNob3J0KWo7CiAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPIndQS0NvdW50OiAlZFxuIiwgcEJTU0xpc3QtPndQS0NvdW50KTsKICAgICAgICAgfQogCkBAIC0xODAsNyArMTgwLDcgQEAKICAgICAgICAgICAgIGogPSAwOwogICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyJ3QXV0aENvdW50OiAlZCwgc2l6ZW9mKHBCU1NMaXN0LT5hYnlBdXRoVHlwZSk6ICV6dVxuIiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgcElFX1JTTl9BdXRoLT53QXV0aENvdW50LCBzaXplb2YocEJTU0xpc3QtPmFieUF1dGhUeXBlKSk7Ci0gICAgICAgICAgICBmb3IoaSA9IDA7IChpIDwgcElFX1JTTl9BdXRoLT53QXV0aENvdW50KSAmJiAoaiA8IHNpemVvZihwQlNTTGlzdC0+YWJ5QXV0aFR5cGUpL3NpemVvZihCWVRFKSk7IGkrKykgeworICAgICAgICAgICAgZm9yKGkgPSAwOyAoaSA8IHBJRV9SU05fQXV0aC0+d0F1dGhDb3VudCkgJiYgKGogPCBzaXplb2YocEJTU0xpc3QtPmFieUF1dGhUeXBlKS9zaXplb2YodW5zaWduZWQgY2hhcikpOyBpKyspIHsKICAgICAgICAgICAgICAgICBpZihwUlNOLT5sZW4gPj0gMTQrNCsobStpKSo0KSB7IC8vb3VpMSg0KSt2ZXIoMikrR0tTKDQpK1BLU0NudCgyKStQS1MoNCptKStBS0MoMikrQUtTKDQqaSkKICAgICAgICAgICAgICAgICAgICAgaWYgKCAhbWVtY21wKHBJRV9SU05fQXV0aC0+QXV0aEtTTGlzdFtpXS5hYnlPVUksIGFieU9VSTAxLCA0KSkKICAgICAgICAgICAgICAgICAgICAgICAgIHBCU1NMaXN0LT5hYnlBdXRoVHlwZVtqKytdID0gV1BBX0FVVEhfSUVFRTgwMl8xWDsKQEAgLTE5NSw3ICsxOTUsNyBAQAogICAgICAgICAgICAgICAgIC8vREJHX1BSTl9HUlAxNCgoImFieUF1dGhUeXBlWyVkXTogJVhcbiIsIGotMSwgcEJTU0xpc3QtPmFieUF1dGhUeXBlW2otMV0pKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGlmKGogPiAwKQotICAgICAgICAgICAgICAgIHBCU1NMaXN0LT53QXV0aENvdW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J5Q2FwczsKKyAgICAgICAgICAgICAgICBwQlNTTGlzdC0+c1JTTkNhcE9iai5iUlNOQ2FwRXhpc3QgPSB0cnVlOworICAgICAgICAgICAgICAgIHBCU1NMaXN0LT5zUlNOQ2FwT2JqLndSU05DYXAgPSAqKHVuc2lnbmVkIHNob3J0ICopcGJ5Q2FwczsKICAgICAgICAgICAgICAgICAvL0RCR19QUk5fR1JQMTQoKCJwYnlDYXBzOiAlWFxuIiwgKnBieUNhcHMpKTsKICAgICAgICAgICAgICAgICAvL0RCR19QUk5fR1JQMTQoKCJieURlZmF1bHRLX2FzX1BLOiAlWFxuIiwgcEJTU0xpc3QtPmJ5RGVmYXVsdEtfYXNfUEspKTsKICAgICAgICAgICAgICAgICAvL0RCR19QUk5fR1JQMTQoKCJieVJlcGxheUlkeDogJVhcbiIsIHBCU1NMaXN0LT5ieVJlcGxheUlkeCkpOwogICAgICAgICAgICAgfQogICAgICAgICB9Ci0gICAgICAgIHBCU1NMaXN0LT5iV1BBVmFsaWQgPSBUUlVFOworICAgICAgICBwQlNTTGlzdC0+YldQQVZhbGlkID0gdHJ1ZTsKICAgICB9CiB9CiAKQEAgLTIzNywyNCArMjM3LDI0IEBACiAgKiBSZXR1cm4gVmFsdWU6IG5vbmUuCiAgKgogLSovCi1CT09MCitib29sCiBXUEFfU2VhcmNoUlNOICgKLSAgICBCWVRFICAgICAgICAgICAgICAgIGJ5Q21kLAotICAgIEJZVEUgICAgICAgICAgICAgICAgYnlFbmNyeXB0LAorICAgIHVuc2lnbmVkIGNoYXIgYnlDbWQsCisgICAgdW5zaWduZWQgY2hhciBieUVuY3J5cHQsCiAgICAgUEtub3duQlNTICAgICAgICBwQlNTTGlzdAogICAgICkKIHsKICAgICBpbnQgaWk7Ci0gICAgQllURSBieVBLVHlwZSA9IFdQQV9OT05FOworICAgIHVuc2lnbmVkIGNoYXIgYnlQS1R5cGUgPSBXUEFfTk9ORTsKIAotICAgIGlmIChwQlNTTGlzdC0+YldQQVZhbGlkID09IEZBTFNFKQotICAgICAgICByZXR1cm4gRkFMU0U7CisgICAgaWYgKHBCU1NMaXN0LT5iV1BBVmFsaWQgPT0gZmFsc2UpCisgICAgICAgIHJldHVybiBmYWxzZTsKIAogICAgIHN3aXRjaChieUNtZCkgewogICAgIGNhc2UgMDoKIAogICAgICAgICBpZiAoYnlFbmNyeXB0ICE9IHBCU1NMaXN0LT5ieUdLVHlwZSkKLSAgICAgICAgICAgIHJldHVybiBGQUxTRTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKIAogICAgICAgICBpZiAocEJTU0xpc3QtPndQS0NvdW50ID4gMCkgewogICAgICAgICAgICAgZm9yIChpaSA9IDA7IGlpIDwgcEJTU0xpc3QtPndQS0NvdW50OyBpaSArKykgewpAQCAtMjY4LDkgKzI2OCw5IEBACiAgICAgICAgICAgICAgICAgICAgICBieVBLVHlwZSA9IFdQQV9XRVAxMDQ7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAoYnlFbmNyeXB0ICE9IGJ5UEtUeXBlKQotICAgICAgICAgICAgICAgIHJldHVybiBGQUxTRTsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgIH0KLSAgICAgICAgcmV0dXJuIFRSVUU7CisgICAgICAgIHJldHVybiB0cnVlOwogLy8gICAgICAgIGlmIChwQlNTTGlzdC0+d0F1dGhDb3VudCA+IDApCiAvLyAgICAgICAgICAgIGZvciAoaWk9MDsgaWkgPCBwQlNTTGlzdC0+d0F1dGhDb3VudDsgaWkgKyspCiAvLyAgICAgICAgICAgICAgICBpZiAoYnlBdXRoID09IHBCU1NMaXN0LT5hYnlBdXRoVHlwZVtpaV0pCkBAIC0yODAsNyArMjgwLDcgQEAKICAgICBkZWZhdWx0OgogICAgICAgICBicmVhazsKICAgICB9Ci0gICAgcmV0dXJuIEZBTFNFOworICAgIHJldHVybiBmYWxzZTsKIH0KIAogLyorCkBAIC0yOTcsMjAgKzI5NywyMCBAQAogICogUmV0d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UzogJVhcbiIsIHBCU1NOb2RlLT5ieUNTU0dLKTsKIAogICAgICAgICBpZiAocFJTTi0+bGVuID09IDYpIHsKLSAgICAgICAgICAgIHBCU1NOb2RlLT5iV1BBMlZhbGlkID0gVFJVRTsKKyAgICAgICAgICAgIHBCU1NOb2RlLT5iV1BBMlZhbGlkID0gdHJ1ZTsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQogCiAgICAgICAgIGlmIChwUlNOLT5sZW4gPj0gOCkgeyAvLyB2ZXIoMikgKyBHSyg0KSArIFBLIGNvdW50KDIpCi0gICAgICAgICAgICBwQlNTTm9kZS0+d0NTU1BLQ291bnQgPSAqKChQV09SRCkgJihwUlNOLT5hYnlSU05bNF0pKTsKKyAgICAgICAgICAgIHBCU1NOb2RlLT53Q1NTUEtDb3VudCA9ICooKHVuc2lnbmVkIHNob3J0ICopICYocFJTTi0+YWJ5UlNOWzRdKSk7CiAgICAgICAgICAgICBqID0gMDsKICAgICAgICAgICAgIHBieU9VSSA9ICYocFJTTi0+YWJ5UlNOWzZdKTsKIAotICAgICAgICAgICAgZm9yIChpID0gMDsgKGkgPCBwQlNTTm9kZS0+d0NTU1BLQ291bnQpICYmIChqIDwgc2l6ZW9mKHBCU1NOb2RlLT5hYnlDU1NQSykvc2l6ZW9mKEJZVEUpKTsgaSsrKSB7CisgICAgICAgICAgICBmb3IgKGkgPSAwOyAoaSA8IHBCU1NOb2RlLT53Q1NTUEtDb3VudCkgJiYgKGogPCBzaXplb2YocEJTU05vZGUtPmFieUNTU1BLKS9zaXplb2YodW5zaWduZWQgY2hhcikpOyBpKyspIHsKIAogICAgICAgICAgICAgICAgIGlmIChwUlNOLT5sZW4gPj0gOCtpKjQrNCkgeyAvLyB2ZXIoMikrR0soNCkrUEtDbnQoMikrUEtTKDQqaSkKICAgICAgICAgICAgICAgICAgICAgaWYgKCAhbWVtY21wKHBieU9VSSwgYWJ5T1VJR0ssIDQpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBwQlNTTm9kZS0+YWJ5Q1NTUEtbaisrXSA9IFdMQU5fMTFpX0NTU19VU0VfR1JPVVA7Ci0gICAgICAgICAgICAgICAgICAgICAgICBiVXNlR0sgPSBUUlVFOworICAgICAgICAgICAgICAgICAgICAgICAgYlVzZUdLID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICggIW1lbWNtcChwYnlPVUksIGFieU9VSVdFUDQwLCA0KSkgewogICAgICAgICAgICAgICAgICAgICAgICAgLy8gSW52aWFsaWQgQ1NTLCBjb250aW51ZSB0byBwYXJzaW5nCiAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoICFtZW1jbXAocGJ5T1VJLCBhYnlPVUlUS0lQLCA0KSkgewpAQCAtMTk1LDcgKzE5NSw3IEBACiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgfSAvL2ZvcgogCi0gICAgICAgICAgICBpZiAoYlVzZUdLID09IFRSVUUpIHsKKyAgICAgICAgICAgIGlmIChiVXNlR0sgPT0gdHJ1ZSkgewogICAgICAgICAgICAgICAgIGlmIChqICE9IDEpIHsKICAgICAgICAgICAgICAgICAgICAgLy8gaW52YWxpZCBDU1MsIFRoaXMgc2hvdWxkIGJlIG9ubHkgUEsgQ1NTLgogICAgICAgICAgICAgICAgICAgICByZXR1cm47CkBAIC0yMDksMTcgKzIwOSwxNyBAQAogICAgICAgICAgICAgICAgIC8vIGludmFsaWQgQ1NTLCBObyB2YWxpZCBQSy4KICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICBwQlNTTm9kZS0+d0NTU1BLQ291bnQgPSAoV09SRClqOworICAgICAgICAgICAgcEJTU05vZGUtPndDU1NQS0NvdW50ID0gKHVuc2lnbmVkIHNob3J0KWo7CiAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPIndDU1NQS0NvdW50OiAlZFxuIiwgcEJTU05vZGUtPndDU1NQS0NvdW50KTsKICAgICAgICAgfQogCi0gICAgICAgIG0gPSAqKChQV09SRCkgJihwUlNOLT5hYnlSU05bNF0pKTsKKyAgICAgICAgbSA9ICooKHVuc2lnbmVkIHNob3J0ICopICYocFJTTi0+YWJ5UlNOWzRdKSk7CiAKICAgICAgICAgaWYgKHBSU04tPmxlbiA+PSAxMCttKjQpIHsgLy8gdmVyKDIpICsgR0soNCkgKyBQSyBjb3VudCgyKSArIFBLUyg0Km0pICsgQUtNU1MgY291bnQoMikKLSAgICAgICAgICAgIHBCU1NOb2RlLT53QUtNU1NBdXRoQ291bnQgPSAqKChQV09SRCkgJihwUlNOLT5hYnlSU05bNis0Km1dKSk7OworICAgICAgICAgICAgcEJTU05vZGUtPndBS01TU0F1dGhDb3VudCA9ICooKHVuc2lnbmVkIHNob3J0ICopICYocFJTTi0+YWJ5UlNOWzYrNCptXSkpOzsKICAgICAgICAgICAgIGogPSAwOwogICAgICAgICAgICAgcGJ5T1VJID0gJihwUlNOLT5hYnlSU05bOCs0Km1dKTsKLSAgICAgICAgICAgIGZvciAoaSA9IDA7IChpIDwgcEJTU05vZGUtPndBS01TU0F1dGhDb3VudCkgJiYgKGogPCBzaXplb2YocEJTU05vZGUtPmFieUFLTVNTQXV0aFR5cGUpL3NpemVvZihCWVRFKSk7IGkrKykgeworICAgICAgICAgICAgZm9yIChpID0gMDsgKGkgPCBwQlNTTm9kZS0+d0FLTVNTQXV0aENvdW50KSAmJiAoaiA8IHNpemVvZihwQlNTTm9kZS0+YWJ5QUtNU1NBdXRoVHlwZSkvc2l6ZW9mKHVuc2lnbmVkIGNoYXIpKTsgaSsrKSB7CiAgICAgICAgICAgICAgICAgaWYgKHBSU04tPmxlbiA+PSAxMCsobStpKSo0KzQpIHsgLy8gdmVyKDIpK0dLKDQpK1BLQ250KDIpK1BLUyg0Km0pK0FLTVNTKDIpK0FLUyg0KmkpCiAgICAgICAgICAgICAgICAgICAgIGlmICggIW1lbWNtcChwYnlPVUksIGFieU9VSTgwMjFYLCA0KSkKICAgICAgICAgICAgICAgICAgICAgICAgIHBCU1NOb2RlLT5hYnlBS01TU0F1dGhUeXBlW2orK10gPSBXTEFOXzExaV9BS01TU184MDJfMVg7CkBAIC0yMzIsMTcgKzIzMiwxNyBAQAogICAgICAgICAgICAgICAgIH0gZWxzZQogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHBCU1NOb2RlLT53QUtNU1NBdXRoQ291bnQgPSAoV09SRClqOworICAgICAgICAgICAgcEJTU05vZGUtPndBS01TU0F1dGhDb3VudCA9ICh1bnNpZ25lZCBzaG9ydClqOwogICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyJ3QUtNU1NBdXRoQ291bnQ6ICVkXG4iLCBwQlNTTm9kZS0+d0FLTVNTQXV0aENvdW50KTsKIAotICAgICAgICAgICAgbiA9ICooKFBXT1JEKSAmKHBSU04tPmFieVJTTls2KzQqbV0pKTs7CisgICAgICAgICAgICBuID0gKigodW5zaWduZWQgc2hvcnQgKikgJihwUlNOLT5hYnlSU05bNis0Km1dKSk7OwogICAgICAgICAgICAgaWYgKHBSU04tPmxlbiA+PSAxMis0Km0rNCpuKSB7IC8vIHZlcigyKStHSyg0KStQS0NudCgyKStQS1MoNCptKStBS01TU0NudCgyKStBS01TUyg0Km4pK0NhcCgyKQotICAgICAgICAgICAgICAgIHBCU1NOb2RlLT5zUlNOQ2FwT2JqLmJSU05DYXBFeGlzdCA9IFRSVUU7Ci0gICAgICAgICAgICAgICAgcEJTU05vZGUtPnNSU05DYXBPYmoud1JTTkNhcCA9ICooKFBXT1JEKSAmKHBSU04tPmFieVJTTls4KzQqbSs0Km5dKSk7CisgICAgICAgICAgICAgICAgcEJTU05vZGUtPnNSU05DYXBPYmouYlJTTkNhcEV4aXN0ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBwQlNTTm9kZS0+c1JTTkNhcE9iai53UlNOQ2FwID0gKigodW5zaWduZWQgc2hvcnQgKikgJihwUlNOLT5hYnlSU05bOCs0Km0rNCpuXSkpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgICAgIC8vaWdub3JlIFBNS0lEIGxpc3RzIGJjcyBvbmx5IChSZSlBc3NvY3JlcXVlc3QgaGFzIHRoaXMgZmllbGQKLSAgICAgICAgcEJTU05vZGUtPmJXUEEyVmFsaWQgPSBUUlVFOworICAgICAgICBwQlNTTm9kZS0+YldQQTJWYWxpZCA9IHRydWU7CiAgICAgfQogfQogCkBAIC0yNjEsMTYgKzI2MSwxNiBAQAogICogUmV0dXJuIFZhbHVlOiBsZW5ndGggb2YgSUVzLgogICoKIC0qLwotVUlOVAordW5zaWduZWQgaW50CiBXUEEydVNldElFcygKICAgICB2b2lkICpwTWdtdEhhbmRsZSwKICAgICBQV0xBTl9JRV9SU04gcFJTTklFcwogICAgICkKIHsKICAgICBQU01nbXRPYmplY3QgICAgcE1nbXQgPSAoUFNNZ210T2JqZWN0KSBwTWdtdEhhbmRsZTsKLSAgICBQQllURSAgICAgICAgICAgcGJ5QnVmZmVyID0gTlVMTDsKLSAgICBVSU5UICAgICAgICAgICAgaWkgPSAwOwotICAgIFBXT1JEICAgICAgICAgICBwd1BNS0lEID0gTlVMTDsKKyAgICB1bnNpZ25lZCBjaGFyICpwYnlCdWZmZXIgPSBOVUxMOworICAgIHVuc2lnbmVkIGludCBpaSA9IDA7CisgICAgdW5zaWduZWQgc2hvcnQgKnB3UE1LSUQgPSBOVUxMOwogCiAgICAgaWYgKHBSU05JRXMgPT0gTlVMTCkgewogICAgICAgICByZXR1cm4oMCk7CkBAIC0yNzksNyArMjc5LDcgQEAKICAgICAgICAgIChwTWdtdC0+ZUF1dGhlbk1vZGUgPT0gV01BQ19BVVRIX1dQQTJQU0spKSAmJgogICAgICAgICAocE1nbXQtPnBDdXJyQlNTICE9IE5VTEwpKSB7CiAgICAgICAgIC8qIFdQQTIgSUUgKi8KLSAgICAgICAgcGJ5QnVmZmVyID0gKFBCWVRFKSBwUlNOSUVzOworICAgICAgICBwYnlCdWZmZXIgPSAodW5zaWduZWQgY2hhciAqKSBwUlNOSUVzOwogICAgICAgICBwUlNOSUVzLT5ieUVsZW1lbnRJRCA9IFdMQU5fRUlEX1JTTjsKICAgICAgICAgcFJTTklFcy0+bGVuID0gNjsgLy9WZXJzaW9uKDIpK0dLKDQpCiAgICAgICAgIHBSU05JRXMtPndWZXJzaW9uID0gMTsKQEAgLTMzMCw3ICszMzAsNyBAQAogICAgICAgICBwUlNOSUVzLT5sZW4gKz02OwogCiAgICAgICAgIC8vIFJTTiBDYXBhYmlsaXRlcwotICAgICAgICBpZiAocE1nbXQtPnBDdXJyQlNTLT5zUlNOQ2FwT2JqLmJSU05DYXBFeGlzdCA9PSBUUlVFKSB7CisgICAgICAgIGlmIChwTWdtdC0+cEN1cnJCU1MtPnNSU05DYXBPYmouYlJTTkNhcEV4aXN0ID09IHRydWUpIHsKICAgICAgICAgICAgIG1lbWNweSgmcFJTTklFcy0+YWJ5UlNOWzE2XSwgJnBNZ210LT5wQ3VyckJTUy0+c1JTTkNhcE9iai53UlNOQ2FwLCAyKTsKICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgIHBSU05JRXMtPmFieVJTTlsxNl0gPSAwOwpAQCAtMzM5LDEwICszMzksMTAgQEAKICAgICAgICAgcFJTTklFcy0+bGVuICs9MjsKIAogICAgICAgICBpZiAoKHBNZ210LT5nc1BNS0lEQ2FjaGUuQlNTSURJbmZvQ291bnQgPiAwKSAmJgotICAgICAgICAgICAgKHBNZ210LT5iUm9hbWluZyA9PSBUUlVFKSAmJgorICAgICAgICAgICAgKHBNZ210LT5iUm9hbWluZyA9PSB0cnVlKSAmJgogICAgICAgICAgICAgKHBNZ210LT5lQXV0aGVuTW9kZSA9PSBXTUFDX0FVVEhfV1BBMikpIHsKICAgICAgICAgICAgIC8vIFJTTiBQTUtJRAotICAgICAgICAgICAgc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gIGZvciAodXU9MDsgdXU8TUFYX0tFWV9UQUJMRTsgdXUrKykgewogICAgICAgICAgICAgTUFDdkRpc2FibGVLZXlFbnRyeShwRGV2aWNlLT5Qb3J0T2Zmc2V0LCB1dSk7CkBAIC0yNDMsNyArMjQzLDcgQEAKIHNwaW5fbG9ja19pcnEoJnBEZXZpY2UtPmxvY2spOwogICAgIAl9CiAKLSAgICBkd0tleUluZGV4ID0gKERXT1JEKShwYXJhbS0+dS53cGFfa2V5LmtleV9pbmRleCk7CisgICAgZHdLZXlJbmRleCA9ICh1bnNpZ25lZCBsb25nKShwYXJhbS0+dS53cGFfa2V5LmtleV9pbmRleCk7CiAKIAlpZiAocGFyYW0tPnUud3BhX2tleS5hbGdfbmFtZSA9PSBXUEFfQUxHX1dFUCkgewogICAgICAgICBpZiAoZHdLZXlJbmRleCA+IDMpIHsKQEAgLTI1MSw4ICsyNTEsOCBAQAogICAgICAgICB9CiAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgaWYgKHBhcmFtLT51LndwYV9rZXkuc2V0X3R4KSB7Ci0gICAgICAgICAgICAgICAgcERldmljZS0+YnlLZXlJbmRleCA9IChCWVRFKWR3S2V5SW5kZXg7Ci0gICAgICAgICAgICAgICAgcERldmljZS0+YlRyYW5zbWl0S2V5ID0gVFJVRTsKKyAgICAgICAgICAgICAgICBwRGV2aWNlLT5ieUtleUluZGV4ID0gKHVuc2lnbmVkIGNoYXIpZHdLZXlJbmRleDsKKyAgICAgICAgICAgICAgICBwRGV2aWNlLT5iVHJhbnNtaXRLZXkgPSB0cnVlOwogCQkgICAgICAgIGR3S2V5SW5kZXggfD0gKDEgPDwgMzEpOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgS2V5YlNldERlZmF1bHRLZXkoJihwRGV2aWNlLT5zS2V5KSwKQEAgLTI2Niw3ICsyNjYsNyBAQAogCiAgICAgICAgIH0KICAgICAgICAgcERldmljZS0+ZUVuY3J5cHRpb25TdGF0dXMgPSBOZGlzODAyXzExR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gICAgICAgICAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCBjaGFyICopYWJ5S2V5LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5S2V5RGVjTW9kZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT5Qb3J0T2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJ5TG9jYWxJRCkgPT0gVFJVRSkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT5ieUxvY2FsSUQpID09IHRydWUpICYmCiAgICAgICAgICAgICAoS2V5YlNldERlZmF1bHRLZXkoJihwRGV2aWNlLT5zS2V5KSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkd0tleUluZGV4LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtLT51LndwYV9rZXkua2V5X2xlbiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoUFFXT1JEKSAmKEtleVJTQyksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKFBCWVRFKWFieUtleSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAodW5zaWduZWQgY2hhciAqKWFieUtleSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBieUtleURlY01vZGUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERldmljZS0+UG9ydE9mZnNldCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT5ieUxvY2FsSUQpID09IFRSVUUpICkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBEZXZpY2UtPmJ5TG9jYWxJRCkgPT0gdHJ1ZSkgKSB7CiAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyAiR1JPVVAgS2V5IEFzc2lnbi5cbiIpOwogCiAgICAgICAgIH0gZWxzZSB7CkBAIC00MDAsMTUgKzQwMCwxNSBAQAogICAgICAgICAgICAgICAgICAgICAgICBkd0tleUluZGV4LAogICAgICAgICAgICAgICAgICAgICAgICBwYXJhbS0+dS53cGFfa2V5LmtleV9sZW4sCiAgICAgICAgICAgICAgICAgICAgICAgIChQUVdPUkQpICYoS2V5UlNDKSwKLSAgICAgICAgICAgICAgICAgICAgICAgKFBCWVRFKWFieUtleSwKKyAgICAgICAgICAgICAgICAgICAgICAgKHVuc2lnbmVkIGNoYXIgKilhYnlLZXksCiAgICAgICAgICAgICAgICAgICAgICAgICBieUtleURlY01vZGUsCiAgICAgICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT5Qb3J0T2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAgICAgcERldmljZS0+YnlMb2NhbElEKSA9PSBUUlVFKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT5ieUxvY2FsSUQpID09IHRydWUpIHsKICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8gIlBhaXJ3aXNlIEtleSBTZXRcbiIpOwogCiAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAvLyBLZXkgVGFibGUgRnVsbAotICAgICAgICAgICAgaWYgKElTX0VUSF9BRERSRVNTX0VRVUFMKCZwYXJhbS0+YWRkclswXSwgcERldmljZS0+YWJ5QlNTSUQpKSB7CisgICAgICAgICAgICBpZiAoIWNvbXBhcmVfZXRoZXJfYWRkcigmcGFyYW0tPmFkZHJbMF0sIHBEZXZpY2UtPmFieUJTU0lEKSkgewogICAgICAgICAgICAgICAgIC8vREJHX1BSTl9XTEFOMDMoKCJyZXR1cm4gTkRJU19TVEFUVVNfSU5WQUxJRF9EQVRBIC1LZXkgVGFibGUgRnVsbC4yXG4iKSk7CiAgICAgICAgICAgICAgICAgLy9zcGluX3VubG9ja19pcnEoJnBEZXZpY2UtPmxvY2spOwogICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwpAQCAtNDIyLDEwICs0MjIsMTAgQEAKICAgIC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UtPmJ5UGFja2V0VHlwZTsKIAogICAgIGlmIChwRGV2aWNlLT5iRml4UmF0ZSkgewogICAgICAgICBpZiAocERldmljZS0+ZUN1cnJlbnRQSFlUeXBlID09IFBIWV9UWVBFXzExQikgewogICAgICAgICAgICAgaWYgKHBEZXZpY2UtPnVDb25uZWN0aW9uUmF0ZSA+PSBSQVRFXzExTSkgewogICAgICAgICAgICAgICAgIHBEZXZpY2UtPndDdXJyZW50UmF0ZSA9IFJBVEVfMTFNOwogICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBwRGV2aWNlLT53Q3VycmVudFJhdGUgPSAoV09SRClwRGV2aWNlLT51Q29ubmVjdGlvblJhdGU7CisgICAgICAgICAgICAgICAgcERldmljZS0+d0N1cnJlbnRSYXRlID0gKHVuc2lnbmVkIHNob3J0KXBEZXZpY2UtPnVDb25uZWN0aW9uUmF0ZTsKICAgICAgICAgICAgIH0KICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgIGlmICgocERldmljZS0+ZUN1cnJlbnRQSFlUeXBlID09IFBIWV9UWVBFXzExQSkgJiYKQEAgLTE0OSw3ICsxNDksNyBAQAogICAgICAgICAgICAgICAgIGlmIChwRGV2aWNlLT51Q29ubmVjdGlvblJhdGUgPj0gUkFURV81NE0pCiAgICAgICAgICAgICAgICAgICAgIHBEZXZpY2UtPndDdXJyZW50UmF0ZSA9IFJBVEVfNTRNOwogICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgcERldmljZS0+d0N1cnJlbnRSYXRlID0gKFdPUkQpcERldmljZS0+dUNvbm5lY3Rpb25SYXRlOworICAgICAgICAgICAgICAgICAgICBwRGV2aWNlLT53Q3VycmVudFJhdGUgPSAodW5zaWduZWQgc2hvcnQpcERldmljZS0+dUNvbm5lY3Rpb25SYXRlOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQpAQCAtMTcyLDcgKzE3Miw3IEBACiAgICAgICAgIE1BQ2J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9FSURfRFNfUEFSTVM6Ci0gICAgICAgICAgICAgICAgaWYgKHBGcmFtZS0+cERTUGFybXMgPT0gTlVMTCkKLSAgICAgICAgICAgICAgICAgICAgcEZyYW1lLT5wRFNQYXJtcyA9IChQV0xBTl9JRV9EU19QQVJNUylwSXRlbTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgV0xBTl9FSURfQ0ZfUEFSTVM6Ci0gICAgICAgICAgICAgICAgaWYgKHBGcmFtZS0+cENGUGFybXMgPT0gTlVMTCkKLSAgICAgICAgICAgICAgICAgICAgcEZyYW1lLT5wQ0ZQYXJtcyA9IChQV0xBTl9JRV9DRl9QQVJNUylwSXRlbTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgV0xBTl9FSURfSUJTU19QQVJNUzoKLSAgICAgICAgICAgICAgICBpZiAocEZyYW1lLT5wSUJTU1Bhcm1zID09IE5VTEwpCi0gICAgICAgICAgICAgICAgICAgIHBGcmFtZS0+cElCU1NQYXJtcyA9IChQV0xBTl9JRV9JQlNTX1BBUk1TKXBJdGVtOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSBXTEFOX0VJRF9USU06Ci0gICAgICAgICAgICAgICAgaWYgKHBGcmFtZS0+cFRJTSA9PSBOVUxMKQotICAgICAgICAgICAgICAgICAgICBwRnJhbWUtPnBUSU0gPSAoUFdMQU5fSUVfVElNKXBJdGVtOwotICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFdMQU5fRUlEX1NTSUQ6CisgICAgICAgICAgICBpZiAocEZyYW1lLT5wU1NJRCA9PSBOVUxMKQorICAgICAgICAgICAgICAgIHBGcmFtZS0+cFNTSUQgPSAoUFdMQU5fSUVfU1NJRClwSXRlbTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFdMQU5fRUlEX1NVUFBfUkFURVM6CisgICAgICAgICAgICBpZiAocEZyYW1lLT5wU3VwcFJhdGVzID09IE5VTEwpCisgICAgICAgICAgICAgICAgcEZyYW1lLT5wU3VwcFJhdGVzID0gKFBXTEFOX0lFX1NVUFBfUkFURVMpcEl0ZW07CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBXTEFOX0VJRF9GSF9QQVJNUzoKKyAgICAgICAgICAgIC8qIHBGcmFtZS0+cEZIUGFybXMgPSAoUFdMQU5fSUVfRkhfUEFSTVMpcEl0ZW07ICovCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBXTEFOX0VJRF9EU19QQVJNUzoKKyAgICAgICAgICAgIGlmIChwRnJhbWUtPnBEU1Bhcm1zID09IE5VTEwpCisgICAgICAgICAgICAgICAgcEZyYW1lLT5wRFNQYXJtcyA9IChQV0xBTl9JRV9EU19QQVJNUylwSXRlbTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFdMQU5fRUlEX0NGX1BBUk1TOgorICAgICAgICAgICAgaWYgKHBGcmFtZS0+cENGUGFybXMgPT0gTlVMTCkKKyAgICAgICAgICAgICAgICBwRnJhbWUtPnBDRlBhcm1zID0gKFBXTEFOX0lFX0NGX1BBUk1TKXBJdGVtOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgV0xBTl9FSURfSUJTU19QQVJNUzoKKyAgICAgICAgICAgIGlmIChwRnJhbWUtPnBJQlNTUGFybXMgPT0gTlVMTCkKKyAgICAgICAgICAgICAgICBwRnJhbWUtPnBJQlNTUGFybXMgPSAoUFdMQU5fSUVfSUJTU19QQVJNUylwSXRlbTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFdMQU5fRUlEX1RJTToKKyAgICAgICAgICAgIGlmIChwRnJhbWUtPnBUSU0gPT0gTlVMTCkKKyAgICAgICAgICAgICAgICBwRnJhbWUtPnBUSU0gPSAoUFdMQU5fSUVfVElNKXBJdGVtOworICAgICAgICAgICAgYnJlYWs7CiAKLSAgICAgICAgICAgIGNhc2UgV0xBTl9FSURfUlNOOgotICAgICAgICAgICAgICAgIGlmIChwRnJhbWUtPnBSU04gPT0gTlVMTCkgewotICAgICAgICAgICAgICAgICAgICBwRnJhbWUtPnBSU04gPSAoUFdMQU5fSUVfUlNOKXBJdGVtOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgV0xBTl9FSURfUlNOX1dQQToKLSAgICAgICAgICAgICAgICBpZiAocEZyYW1lLT5wUlNOV1BBID09IE5VTEwpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKFdQQWJfSXNfUlNOKChQV0xBTl9JRV9SU05fRVhUKXBJdGVtKSA9PSBUUlVFKQotICAgICAgICAgICAgICAgICAgICAgICAgcEZyYW1lLT5wUlNOV1BBID0gKFBXTEFOX0lFX1JTTl9FWFQpcEl0ZW07Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFdMQU5fRUlEX1JTTjoKKyAgICAgICAgICAgIGlmIChwRnJhbWUtPnBSU04gPT0gTlVMTCkgCisgICAgICAgICAgICAgICAgcEZyYW1lLT5wUlNOID0gKFBXTEFOX0lFX1JTTilwSXRlbTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFdMQU5fRUlEX1JTTl9XUEE6CisgICAgICAgICAgICBpZiAocEZyYW1lLT5wUlNOV1BBID09IE5VTEwpIHsKKyAgICAgICAgICAgICAgICBpZiAoV1BBYl9Jc19SU04oKFBXTEFOX0lFX1JTTl9FWFQpcEl0ZW0pID09IFRSVUUpCisgICAgICAgICAgICAgICAgICAgIHBGcmFtZS0+cFJTTldQQSA9IChQV0xBTl9JRV9SU05fRVhUKXBJdGVtOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CiAKLSAgICAgICAgICAgIGNhc2UgV0xBTl9FSURfRVJQOgotICAgICAgICAgICAgICAgIGlmIChwRnJhbWUtPnBFUlAgPT0gTlVMTCkKLSAgICAgICAgICAgICAgICAgICAgcEZyYW1lLT5wRVJQID0gKFBXTEFOX0lFX0VSUClwSXRlbTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgV0xBTl9FSURfRVhUU1VQUF9SQVRFUzoKLSAgICAgICAgICAgICAgICBpZiAocEZyYW1lLT5wRXh0U3VwcFJhdGVzID09IE5VTEwpCi0gICAgICAgICAgICAgICAgICAgIHBGcmFtZS0+cEV4dFN1cHBSYXRlcyA9IChQV0xBTl9JRV9TVVBQX1JBVEVTKXBJdGVtOwotICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFdMQU5fRUlEX0VSUDoKKyAgICAgICAgICAgIGlmIChwRnJhbWUtPnBFUlAgPT0gTlVMTCkKKyAgICAgICAgICAgICAgICBwRnJhbWUtPnBFUlAgPSAoUFdMQU5fSUVfRVJQKXBJdGVtOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgV0xBTl9FSURfRVhUU1VQUF9SQVRFUzoKKyAgICAgICAgICAgIGlmIChwRnJhbWUtPnBFeHRTdXBwUmF0ZXMgPT0gTlVMTCkKKyAgICAgICAgICAgICAgICBwRnJhbWUtPnBFeHRTdXBwUmF0ZXMgPSAoUFdMQU5fSUVfU1VQUF9SQVRFUylwSXRlbTsKKyAgICAgICAgICAgIGJyZWFrOwogCi0gICAgICAgICAgICBjYXNlIFdMQU5fRUlEX0NPVU5UUlk6ICAgICAgLy83Ci0gICAgICAgICAgICAgICAgaWYgKHBGcmFtZS0+cElFX0NvdW50cnkgPT0gTlVMTCkKLSAgICAgICAgICAgICAgICAgICAgcEZyYW1lLT5wSUVfQ291bnRyeSA9IChQV0xBTl9JRV9DT1VOVFJZKXBJdGVtOwotICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFdMQU5fRUlEX0NPVU5UUlk6ICAgICAgLyogNyAqLworICAgICAgICAgICAgaWYgKHBGcmFtZS0+cElFX0NvdW50cnkgPT0gTlVMTCkKKyAgICAgICAgICAgICAgICBwRnJhbWUtPnBJRV9Db3VudHJ5ID0gKFBXTEFOX0lFX0NPVU5UUlkpcEl0ZW07CisgICAgICAgICAgICBicmVhazsKIAotICAgICAgICAgICAgY2FzZSBXTEFOX0VJRF9QV1JfQ09OU1RSQUlOVDogICAvLzMyCi0gICAgICAgICAgICAgICAgaWYgKHBGcmFtZS0+cElFX1Bvd2VyQ29uc3RyYWludCA9PSBOVUxMKQotICAgICAgICAgICAgICAgICAgICBwRnJhbWUtPnBJRV9Qb3dlckNvbnN0cmFpbnQgPSAoUFdMQU5fSUVfUFdfQ09OU1QpcEl0ZW07Ci0gICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgV0xBTl9FSURfUFdSX0NPTlNUUkFJTlQ6ICAgLyogMzIgKi8KKyAgICAgICAgICAgIGlmIChwRnJhbWUtPnBJRV9Qb3dlckNvbnN0cmFpbnQgPT0gTlVMTCkKKyAgICAgICAgICAgICAgICBwRnJhbWUtPnBJRV9Qb3dlckNvbnN0cmFpbnQgPSAoUFdMQU5fSUVfUFdfQ09OU1QpcEl0ZW07CisgICAgICAgICAgICBicmVhazsKIAotICAgICAgICAgICAgY2FzZSBXTEFOX0VJRF9DSF9TV0lUQ0g6ICAgIC8vMzcKLSAgICAgICAgICAgICAgICBpZiAocEZyYW1lLT5wSUVfQ0hTVyA9PSBOVUxMKQotICAgICAgICAgICAgICAgICAgICBwRnJhbWUtPnBJRV9DSFNXID0gKFBXTEFOX0lFX0NIX1NXKXBJdGVtOwotICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFdMQU5fRUlEX0NIX1NXSVRDSDogICAgLyogMzcgKi8KKyAgICAgICAgICAgIGlmIChwRnJhbWUtPnBJRV9DSFNXID09IE5VTEwpCisgICAgICAgICAgICAgICAgcEZyYW1lLT5wSUVfQ0hTVyA9IChQV0xBTl9JRV9DSF9TVylwSXRlbTsKKyAgICAgICAgICAgIGJyZWFrOwogCi0gICAgICAgICAgICBjYXNlIFdMQU5fRUlEX1FVSUVUOiAgICAgICAgLy80MAotICAgICAgICAgICAgICAgIGlmIChwRnJhbWUtPnBJRV9RdWlldCA9PSBOVUxMKQotICAgICAgICAgICAgICAgICAgICBwRnJhbWUtPnBJRV9RdWlldCA9IChQV0xBTl9JRV9RVUlFVClwSXRlbTsKLSAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBXTEFOX0VJRF9RVUlFVDogICAgICAgIC8qIDQwICovCisgICAgICAgICAgICBpZiAocEZyYW1lLT5wSUVfUXVpZXQgPT0gTlVMTCkKKyAgICAgICAgICAgICAgICBwRnJhbWUtPnBJRV9RdWlldCA9IChQV0xBTl9JRV9RVUlFVClwSXRlbTsKKyAgICAgICAgICAgIGJyZWFrOwogCi0gICAgICAgICAgICBjYXNlIFdMQU5fRUlEX0lCU1NfREZTOgotICAgICAgICAgICAgICAgIGlmIChwRnJhbWUtPnBJRV9JQlNTREZTID09IE5VTEwpCi0gICAgICAgICAgICAgICAgICAgIHBGcmFtZS0+cElFX0lCU1NERlMgPSAoUFdMQU5fSUVfSUJTU19ERlMpcEl0ZW07Ci0gICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgV0xBTl9FSURfSUJTU19ERlM6CisgICAgICAgICAgICBpZiAocEZyYW1lLT5wSUVfSUJTU0RGUyA9PSBOVUxMKQorICAgICAgICAgICAgICAgIHBGcmFtZS0+cElFX0lCU1NERlMgPSAoUFdMQU5fSUVfSUJTU19ERlMpcEl0ZW07CisgICAgICAgICAgICBicmVhazsKIAotICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPICJVbnJlY29nbml6ZWQgRUlEPSVkZCBpbiBiZWFjb24gZGVjb2RlLlxuIiwgcEl0ZW0tPmJ5RWxlbWVudElEKTsKK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yMTFIRFIpcEZyYW1lLT5wQnVmOwotICAgIC8vIEZpeGVkIEZpZWxkcworICAgIC8qIEZpeGVkIEZpZWxkcyAqLwogICAgIHBGcmFtZS0+cHdDYXBJbmZvID0gKFBXT1JEKShXTEFOX0hEUl9BM19EQVRBX1BUUigmKHBGcmFtZS0+cEhkci0+c0EzKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBXTEFOX0FTU09DUkVRX09GRl9DQVBfSU5GTyk7CiAgICAgcEZyYW1lLT5wd0xpc3RlbkludGVydmFsID0gKFBXT1JEKShXTEFOX0hEUl9BM19EQVRBX1BUUigmKHBGcmFtZS0+cEhkci0+c0EzKSkKQEAgLTM3Niw0NyArMzc1LDQ2IEBACiAgICAgUFdMQU5fSUUgICBwSXRlbTsKIAogICAgIHBGcmFtZS0+cEhkciA9IChQVVdMQU5fODAyMTFIRFIpcEZyYW1lLT5wQnVmOwotICAgIC8vIEZpeGVkIEZpZWxkcworICAgIC8qIEZpeGVkIEZpZWxkcyAqLwogICAgIHBGcmFtZS0+cHdDYXBJbmZvID0gKFBXT1JEKShXTEFOX0hEUl9BM19EQVRBX1BUUigmKHBGcmFtZS0+cEhkci0+c0EzKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBXTEFOX0FTU09DUkVRX09GRl9DQVBfSU5GTyk7CiAgICAgcEZyYW1lLT5wd0xpc3RlbkludGVydmFsID0gKFBXT1JEKShXTEFOX0hEUl9BM19EQVRBX1BUUigmKHBGcmFtZS0+cEhkci0+c0EzKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBXTEFOX0FTU09DUkVRX09GRl9MSVNURU5fSU5UKTsKIAotICAgIC8vIEluZm9ybWF0aW9uIGVsZW1lbnRzCisgICAgLyogSW5mb3JtYXRpb24gZWxlbWVudHMgKi8KICAgICBwSXRlbSA9IChQV0xBTl9JRSkoV0xBTl9IRFJfQTNfREFUQV9QVFIoJihwRnJhbWUtPnBIZHItPnNBMykpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBXTEFOX0FTU09DUkVRX09GRl9TU0lEKTsKIAogICAgIHdoaWxlICgoKFBCWVRFKXBJdGVtKSA8IChwRnJhbWUtPnBCdWYgKyBwRnJhbWUtPmxlbikpIHsKLSAgICAgICAgc3dpdGNoIChwSXRlbS0+YnlFbGVtZW50SUQpewotICAgICAgICAgICAgY2FzZSBXTEFOX0VJRF9TU0lEOgotICAgICAgICAgICAgICAgIGlmIChwRnJhbWUtPnBTU0lEID09IE5VTEwpCi0gICAgICAgICAgICAgICAgICAgIHBGcmFtZS0+cFNTSUQgPSAoUFdMQU5fSUVfU1NJRClwSXRlbTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgV0xBTl9FSURfU1VQUF9SQVRFUzoKLSAgICAgICAgICAgICAgICBpZiAocEZyYW1lLT5wU3VwcFJhdGVzID09IE5VTEwpCi0gICAgICAgICAgICAgICAgICAgIHBGcmFtZS0+cFN1cHBSYXRlcyA9IChQV0xBTl9JRV9TVVBQX1JBVEVTKXBJdGVtOwotICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICBzd2l0Y2ggKHBJdGVtLT5ieUVsZW1lbnRJRCkgeworICAgICAgICBjYXNlIFdMQU5fRUlEX1NTSUQ6CisgICAgICAgICAgICBpZiAocEZyYW1lLT5wU1NJRCA9PSBOVUxMKQorICAgICAgICAgICAgICAgIHBGcmFtZS0+cFNTSUQgPSAoUFdMQU5fSUVfU1NJRClwSXRlbTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFdMQU5fRUlEX1NVUFBfUkFURVM6CisgICAgICAgICAgICBpZiAocEZyYW1lLT5wU3VwcFJhdGVzID09IE5VTEwpCisgICAgICAgICAgICAgICAgcEZyYW1lLT5wU3VwcFJhdGVzID0gKFBXTEFOX0lFX1NVUFBfUkFURVMpcEl0ZW07CisgICAgICAgICAgICBicmVhazsKIAotICAgICAgICAgICAgY2FzZSBXTEFOX0VJRF9SU046Ci0gICAgICAgICAgICAgICAgaWYgKHBGcmFtZS0+cFJTTiA9PSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgICAgIHBGcmFtZS0+cFJTTiA9IChQV0xBTl9JRV9SU04pcEl0ZW07Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSBXTEFOX0VJRF9SU05fV1BBOgotICAgICAgICAgICAgICAgIGlmIChwRnJhbWUtPnBSU05XUEEgPT0gTlVMTCkgewotICAgICAgICAgICAgICAgICAgICBpZiAoV1BBYl9Jc19SU04oKFBXTEFOX0lFX1JTTl9FWFQpcEl0ZW0pID09IFRSVUUpCi0gICAgICAgICAgICAgICAgICAgICAgICBwRnJhbWUtPnBSU05XUEEgPSAoUFdMQU5fSUVfUlNOX0VYVClwSXRlbTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIFdMQU5fRUlEX0VYVFNVUFBfUkFURVM6Ci0gICAgICAgICAgICAgICAgaWYgKHBGcmFtZS0+cEV4dFN1cHBSYXRlcyA9PSBOVUxMKQotICAgICAgICAgICAgICAgICAgICBwRnJhbWUtPnBFeHRTdXBwUmF0ZXMgPSAoUFdMQU5fSUVfU1VQUF9SQVRFUylwSXRlbTsKLSAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBXTEFOX0VJRF9SU046CisgICAgICAgICAgICBpZiAocEZyYW1lLT5wUlNOID09IE5VTEwpCisgICAgICAgICAgICAgICAgcEZyYW1lLT5wUlNOID0gKFBXTEFOX0lFX1JTTilwSXRlbTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFdMQU5fRUlEX1JTTl9XUEE6CisgICAgICAgICAgICBpZiAocEZyYW1lLT5wUlNOV1BBID09IE5VTEwpIHsKKyAgICAgICAgICAgICAgICBpZiAoV1BBYl9Jc19SU04oKFBXTEFOX0lFX1JTTl9FWFQpcEl0ZW0pID09IFRSVUUpCisgICAgICAgICAgICAgICAgICAgIHBGcmFtZS0+cFJTTldQQSA9IChQV0xBTl9JRV9SU05fRVhUKXBJdGVtOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgV0xBTl9FSURfRVhUU1VQUF9SQVRFUzoKKyAgICAgICAgICAgIGlmIChwRnJhbWUtPnBFeHRTdXBwUmF0ZXMgPT0gTlVMTCkKKyAgICAgICAgICAgICAgICBwRnJhbWUtPnBFeHRTdXBwUmF0ZXMgPSAoUFdMQU5fSUVfU1VQUF9SQVRFUylwSXRlbTsKKyAgICAgICAgICAgIGJyZWFrOwogCi0gICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8gIlVucmVjb2duaXplZCBFSUQ9JWRkIGluIGFzc29jcmVxIGRlY29kZS5cbiIsCi0gICAgICAgICAgICAgICAgICAgICAgICBwSXRlbS0+YnlFbGVtZW50SUQpOwotICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyAiVW5yZWNvZ25pemVkIEVJRD0lZGQgaW4gYXNzb2NyZXEgZGVjb2RlLlxuIiwKKyAgICAgICAgICAgICAgICAgICAgcEl0ZW0tPmJ5RWxlbWVudElEKTsKKyAgICAgICAgICAgIGJyZWFrOwogICAgICAgICB9CiAgICAgICAgIHBJdGVtID0gKFBXTEFOX0lFKSgoKFBCWVRFKXBJdGVtKSArIDIgKyBwSXRlbS0+bGVuKTsKICAgICB9CkBAIC00NDEsNyArNDM5LDcgQEAKIHsKICAgICBwRnJhbWUtPnBIZHIgPSAoUFVXTEFOXzgwMjExSERSKXBGcmFtZS0+cEJ1ZjsKIAotICAgIC8vIEZpeGVkIEZpZW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bWUtPmxlbikpIHsKIAotICAgICAgICBzd2l0Y2ggKHBJdGVtLT5ieUVsZW1lbnRJRCl7Ci0gICAgICAgICAgICBjYXNlIFdMQU5fRUlEX1NTSUQ6Ci0gICAgICAgICAgICAgICAgaWYgKHBGcmFtZS0+cFNTSUQgPT0gTlVMTCkKLSAgICAgICAgICAgICAgICAgICAgcEZyYW1lLT5wU1NJRCA9IChQV0xBTl9JRV9TU0lEKXBJdGVtOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSBXTEFOX0VJRF9TVVBQX1JBVEVTOgotICAgICAgICAgICAgICAgIGlmIChwRnJhbWUtPnBTdXBwUmF0ZXMgPT0gTlVMTCkKLSAgICAgICAgICAgICAgICAgICAgcEZyYW1lLT5wU3VwcFJhdGVzID0gKFBXTEFOX0lFX1NVUFBfUkFURVMpcEl0ZW07Ci0gICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIHN3aXRjaCAocEl0ZW0tPmJ5RWxlbWVudElEKSB7CisgICAgICAgIGNhc2UgV0xBTl9FSURfU1NJRDoKKyAgICAgICAgICAgIGlmIChwRnJhbWUtPnBTU0lEID09IE5VTEwpCisgICAgICAgICAgICAgICAgcEZyYW1lLT5wU1NJRCA9IChQV0xBTl9JRV9TU0lEKXBJdGVtOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgV0xBTl9FSURfU1VQUF9SQVRFUzoKKyAgICAgICAgICAgIGlmIChwRnJhbWUtPnBTdXBwUmF0ZXMgPT0gTlVMTCkKKyAgICAgICAgICAgICAgICBwRnJhbWUtPnBTdXBwUmF0ZXMgPSAoUFdMQU5fSUVfU1VQUF9SQVRFUylwSXRlbTsKKyAgICAgICAgICAgIGJyZWFrOwogCi0gICAgICAgICAgICBjYXNlIFdMQU5fRUlEX1JTTjoKLSAgICAgICAgICAgICAgICBpZiAocEZyYW1lLT5wUlNOID09IE5VTEwpIHsKLSAgICAgICAgICAgICAgICAgICAgcEZyYW1lLT5wUlNOID0gKFBXTEFOX0lFX1JTTilwSXRlbTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIFdMQU5fRUlEX1JTTl9XUEE6Ci0gICAgICAgICAgICAgICAgaWYgKHBGcmFtZS0+cFJTTldQQSA9PSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChXUEFiX0lzX1JTTigoUFdMQU5fSUVfUlNOX0VYVClwSXRlbSkgPT0gVFJVRSkKLSAgICAgICAgICAgICAgICAgICAgICAgIHBGcmFtZS0+cFJTTldQQSA9IChQV0xBTl9JRV9SU05fRVhUKXBJdGVtOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBXTEFOX0VJRF9SU046CisgICAgICAgICAgICBpZiAocEZyYW1lLT5wUlNOID09IE5VTEwpCisgICAgICAgICAgICAgICAgcEZyYW1lLT5wUlNOID0gKFBXTEFOX0lFX1JTTilwSXRlbTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFdMQU5fRUlEX1JTTl9XUEE6CisgICAgICAgICAgICBpZiAocEZyYW1lLT5wUlNOV1BBID09IE5VTEwpIHsKKyAgICAgICAgICAgICAgICBpZiAoV1BBYl9Jc19SU04oKFBXTEFOX0lFX1JTTl9FWFQpcEl0ZW0pID09IFRSVUUpCisgICAgICAgICAgICAgICAgICAgIHBGcmFtZS0+cFJTTldQQSA9IChQV0xBTl9JRV9SU05fRVhUKXBJdGVtOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CiAKLSAgICAgICAgICAgIGNhc2UgV0xBTl9FSURfRVhUU1VQUF9SQVRFUzoKLSAgICAgICAgICAgICAgICBpZiAocEZyYW1lLT5wRXh0U3VwcFJhdGVzID09IE5VTEwpCi0gICAgICAgICAgICAgICAgICAgIHBGcmFtZS0+cEV4dFN1cHBSYXRlcyA9IChQV0xBTl9JRV9TVVBQX1JBVEVTKXBJdGVtOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPICJVbnJlY29nbml6ZWQgRUlEPSVkZCBpbiByZWFzc29jcmVxIGRlY29kZS5cbiIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcEl0ZW0tPmJ5RWxlbWVudElEKTsKLSAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBXTEFOX0VJRF9FWFRTVVBQX1JBVEVTOgorICAgICAgICAgICAgaWYgKHBGcmFtZS0+cEV4dFN1cHBSYXRlcyA9PSBOVUxMKQorICAgICAgICAgICAgICAgIHBGcmFtZS0+cEV4dFN1cHBSYXRlcyA9IChQV0xBTl9JRV9TVVBQX1JBVEVTKXBJdGVtOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPICJVbnJlY29nbml6ZWQgRUlEPSVkZCBpbiByZWFzc29jcmVxIGRlY29kZS5cbiIsCisgICAgICAgICAgICAgICAgICAgICAgICBwSXRlbS0+YnlFbGVtZW50SUQpOworICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgIH0KICAgICAgICAgcEl0ZW0gPSAoUFdMQU5fSUUpKCgoUEJZVEUpcEl0ZW0pICsgMiArIHBJdGVtLT5sZW4pOwogICAgIH0KQEAgLTY0NiwzMCArNjQyLDMwIEBACiAKICAgICBwRnJhbWUtPnBIZHIgPSAoUFVXTEFOXzgwMjExSERSKXBGcmFtZS0+cEJ1ZjsKIAotICAgIC8vIEluZm9ybWF0aW9uIGVsZW1lbnRzCisgICAgLyogSW5mb3JtYXRpb24gZWxlbWVudHMgKi8KICAgICBwSXRlbSA9IChQV0xBTl9JRSkoV0xBTl9IRFJfQTN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AgICAgICAgYnJlYWs7CiAKLSAgICAgICAgICAgIGNhc2UgV0xBTl9FSURfRVhUU1VQUF9SQVRFUzoKLSAgICAgICAgICAgICAgICBpZiAocEZyYW1lLT5wRXh0U3VwcFJhdGVzID09IE5VTEwpCi0gICAgICAgICAgICAgICAgICAgIHBGcmFtZS0+cEV4dFN1cHBSYXRlcyA9IChQV0xBTl9JRV9TVVBQX1JBVEVTKXBJdGVtOwotICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFdMQU5fRUlEX0VYVFNVUFBfUkFURVM6CisgICAgICAgICAgICBpZiAocEZyYW1lLT5wRXh0U3VwcFJhdGVzID09IE5VTEwpCisgICAgICAgICAgICAgICAgcEZyYW1lLT5wRXh0U3VwcFJhdGVzID0gKFBXTEFOX0lFX1NVUFBfUkFURVMpcEl0ZW07CisgICAgICAgICAgICBicmVhazsKIAotICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPICJCYWQgRUlEPSVkZCBpbiBwcm9iZXJlcVxuIiwgcEl0ZW0tPmJ5RWxlbWVudElEKTsKLSAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8gIkJhZCBFSUQ9JWRkIGluIHByb2JlcmVxXG4iLCBwSXRlbS0+YnlFbGVtZW50SUQpOworICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgIH0KIAogICAgICAgICBwSXRlbSA9IChQV0xBTl9JRSkoKChQQllURSlwSXRlbSkgKyAyICsgIHBJdGVtLT5sZW4pOwpAQCAtNjk3LDcgKzY5Myw3IEBACiB7CiAgICAgcEZyYW1lLT5wSGRyID0gKFBVV0xBTl84MDIxMUhEUilwRnJhbWUtPnBCdWY7CiAKLSAgICAvLyBGaXhlZCBGaWVsZHMKKyAgICAvKiBG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XNlIFdMQU5fRUlEX0RTX1BBUk1TOgotICAgICAgICAgICAgICAgIGlmIChwRnJhbWUtPnBEU1Bhcm1zID09IE5VTEwpCi0gICAgICAgICAgICAgICAgICAgIHBGcmFtZS0+cERTUGFybXMgPSAoUFdMQU5fSUVfRFNfUEFSTVMpcEl0ZW07Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIFdMQU5fRUlEX0NGX1BBUk1TOgotICAgICAgICAgICAgICAgIGlmIChwRnJhbWUtPnBDRlBhcm1zID09IE5VTEwpCi0gICAgICAgICAgICAgICAgICAgIHBGcmFtZS0+cENGUGFybXMgPSAoUFdMQU5fSUVfQ0ZfUEFSTVMpcEl0ZW07Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIFdMQU5fRUlEX0lCU1NfUEFSTVM6Ci0gICAgICAgICAgICAgICAgaWYgKHBGcmFtZS0+cElCU1NQYXJtcyA9PSBOVUxMKQotICAgICAgICAgICAgICAgICAgICBwRnJhbWUtPnBJQlNTUGFybXMgPSAoUFdMQU5fSUVfSUJTU19QQVJNUylwSXRlbTsKLSAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFdMQU5fRUlEX0ZIX1BBUk1TOgorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgV0xBTl9FSURfRFNfUEFSTVM6CisgICAgICAgICAgICBpZiAocEZyYW1lLT5wRFNQYXJtcyA9PSBOVUxMKQorICAgICAgICAgICAgICAgIHBGcmFtZS0+cERTUGFybXMgPSAoUFdMQU5fSUVfRFNfUEFSTVMpcEl0ZW07CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBXTEFOX0VJRF9DRl9QQVJNUzoKKyAgICAgICAgICAgIGlmIChwRnJhbWUtPnBDRlBhcm1zID09IE5VTEwpCisgICAgICAgICAgICAgICAgcEZyYW1lLT5wQ0ZQYXJtcyA9IChQV0xBTl9JRV9DRl9QQVJNUylwSXRlbTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFdMQU5fRUlEX0lCU1NfUEFSTVM6CisgICAgICAgICAgICBpZiAocEZyYW1lLT5wSUJTU1Bhcm1zID09IE5VTEwpCisgICAgICAgICAgICAgICAgcEZyYW1lLT5wSUJTU1Bhcm1zID0gKFBXTEFOX0lFX0lCU1NfUEFSTVMpcEl0ZW07CisgICAgICAgICAgICBicmVhazsKIAotICAgICAgICAgICAgY2FzZSBXTEFOX0VJRF9SU046Ci0gICAgICAgICAgICAgICAgaWYgKHBGcmFtZS0+cFJTTiA9PSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgICAgIHBGcmFtZS0+cFJTTiA9IChQV0xBTl9JRV9SU04pcEl0ZW07Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSBXTEFOX0VJRF9SU05fV1BBOgotICAgICAgICAgICAgICAgIGlmIChwRnJhbWUtPnBSU05XUEEgPT0gTlVMTCkgewotICAgICAgICAgICAgICAgICAgICBpZiAoV1BBYl9Jc19SU04oKFBXTEFOX0lFX1JTTl9FWFQpcEl0ZW0pID09IFRSVUUpCi0gICAgICAgICAgICAgICAgICAgICAgICBwRnJhbWUtPnBSU05XUEEgPSAoUFdMQU5fSUVfUlNOX0VYVClwSXRlbTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIFdMQU5fRUlEX0VSUDoKLSAgICAgICAgICAgICAgICBpZiAocEZyYW1lLT5wRVJQID09IE5VTEwpCi0gICAgICAgICAgICAgICAgICAgIHBGcmFtZS0+cEVSUCA9IChQV0xBTl9JRV9FUlApcEl0ZW07Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIFdMQU5fRUlEX0VYVFNVUFBfUkFURVM6Ci0gICAgICAgICAgICAgICAgaWYgKHBGcmFtZS0+cEV4dFN1cHBSYXRlcyA9PSBOVUxMKQotICAgICAgICAgICAgICAgICAgICBwRnJhbWUtPnBFeHRTdXBwUmF0ZXMgPSAoUFdMQU5fSUVfU1VQUF9SQVRFUylwSXRlbTsKLSAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBXTEFOX0VJRF9SU046CisgICAgICAgICAgICBpZiAocEZyYW1lLT5wUlNOID09IE5VTEwpCisgICAgICAgICAgICAgICAgcEZyYW1lLT5wUlNOID0gKFBXTEFOX0lFX1JTTilwSXRlbTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFdMQU5fRUlEX1JTTl9XUEE6CisgICAgICAgICAgICBpZiAocEZyYW1lLT5wUlNOV1BBID09IE5VTEwpIHsKKyAgICAgICAgICAgICAgICBpZiAoV1BBYl9Jc19SU04oKFBXTEFOX0lFX1JTTl9FWFQpcEl0ZW0pID09IFRSVUUpCisgICAgICAgICAgICAgICAgICAgIHBGcmFtZS0+cFJTTldQQSA9IChQV0xBTl9JRV9SU05fRVhUKXBJdGVtOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgV0xBTl9FSURfRVJQOgorICAgICAgICAgICAgaWYgKHBGcmFtZS0+cEVSUCA9PSBOVUxMKQorICAgICAgICAgICAgICAgIHBGcmFtZS0+cEVSUCA9IChQV0xBTl9JRV9FUlApcEl0ZW07CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBXTEFOX0VJRF9FWFRTVVBQX1JBVEVTOgorICAgICAgICAgICAgaWYgKHBGcmFtZS0+cEV4dFN1cHBSYXRlcyA9PSBOVUxMKQorICAgICAgICAgICAgICAgIHBGcmFtZS0+cEV4dFN1cHBSYXRlcyA9IChQV0xBTl9JRV9TVVBQX1JBVEVTKXBJdGVtOworICAgICAgICAgICAgYnJlYWs7CiAKLSAgICAgICAgICAgIGNhc2UgV0xBTl9FSURfQ09VTlRSWTogICAgICAvLzcKLSAgICAgICAgICAgICAgICBpZiAocEZyYW1lLT5wSUVfQ291bnRyeSA9PSBOVUxMKQotICAgICAgICAgICAgICAgICAgICBwRnJhbWUtPnBJRV9Db3VudHJ5ID0gKFBXTEFOX0lFX0NPVU5UUlkpcEl0ZW07Ci0gICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgV0xBTl9FSURfQ09VTlRSWTogICAgICAvKiA3ICovCisgICAgICAgICAgICBpZiAocEZyYW1lLT5wSUVfQ291bnRyeSA9PSBOVUxMKQorICAgICAgICAgICAgICAgIHBGcmFtZS0+cElFX0NvdW50cnkgPSAoUFdMQU5fSUVfQ09VTlRSWSlwSXRlbTsKKyAgICAgICAgICAgIGJyZWFrOwogCi0gICAgICAgICAgICBjYXNlIFdMQU5fRUlEX1BXUl9DT05TVFJBSU5UOiAgIC8vMzIKLSAgICAgICAgICAgICAgICBpZiAocEZyYW1lLT5wSUVfUG93ZXJDb25zdHJhaW50ID09IE5VTEwpCi0gICAgICAgICAgICAgICAgICAgIHBGcmFtZS0+cElFX1Bvd2VyQ29uc3RyYWludCA9IChQV0xBTl9JRV9QV19DT05TVClwSXRlbTsKLSAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBXTEFOX0VJRF9QV1JfQ09OU1RSQUlOVDogICAvKiAzMiAqLworICAgICAgICAgICAgaWYgKHBGcmFtZS0+cElFX1Bvd2VyQ29uc3RyYWludCA9PSBOVUxMKQorICAgICAgICAgICAgICAgIHBGcmFtZS0+cElFX1Bvd2VyQ29uc3RyYWludCA9IChQV0xBTl9JRV9QV19DT05TVClwSXRlbTsKKyAgICAgICAgICAgIGJyZWFrOwogCi0gICAgICAgICAgICBjYXNlIFdMQU5fRUlEX0NIX1NXSVRDSDogICAgLy8zNwotICAgICAgICAgICAgICAgIGlmIChwRnJhbWUtPnBJRV9DSFNXID09IE5VTEwpCi0gICAgICAgICAgICAgICAgICAgIHBGcmFtZS0+cElFX0NIU1cgPSAoUFdMQU5fSUVfQ0hfU1cpcEl0ZW07Ci0gICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgV0xBTl9FSURfQ0hfU1dJVENIOiAgICAvKiAzNyAqLworICAgICAgICAgICAgaWYgKHBGcmFtZS0+cElFX0NIU1cgPT0gTlVMTCkKKyAgICAgICAgICAgICAgICBwRnJhbWUtPnBJRV9DSFNXID0gKFBXTEFOX0lFX0NIX1NXKXBJdGVtOworICAgICAgICAgICAgYnJlYWs7CiAKLSAgICAgICAgICAgIGNhc2UgV0xBTl9FSURfUVVJRVQ6ICAgICAgICAvLzQwCi0gICAgICAgICAgICAgICAgaWYgKHBGcmFtZS0+cElFX1F1aWV0ID09IE5VTEwpCi0gICAgICAgICAgICAgICAgICAgIHBGcmFtZS0+cElFX1F1aWV0ID0gKFBXTEFOX0lFX1FVSUVUKXBJdGVtOwotICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFdMQU5fRUlEX1FVSUVUOiAgICAgICAgLyogNDAgKi8KKyAgICAgICAgICAgIGlmIChwRnJhbWUtPnBJRV9RdWlldCA9PSBOVUxMKQorICAgICAgICAgICAgICAgIHBGcmFtZS0+cElFX1F1aWV0ID0gKFBXTEFOX0lFX1FVSUVUKXBJdGVtOworICAgICAgICAgICAgYnJlYWs7CiAKLSAgICAgICAgICAgIGNhc2UgV0xBTl9FSURfSUJTU19ERlM6Ci0gICAgICAgICAgICAgICAgaWYgKHBGcmFtZS0+cElFX0lCU1NERlMgPT0gTlVMTCkKLSAgICAgICAgICAgICAgICAgICAgcEZyYW1lLT5wSUVfSUJTU0RGUyA9IChQV0xBTl9JRV9JQlNTX0RGUylwSXRlbTsKLSAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBXTEFOX0VJRF9JQlNTX0RGUzoKKyAgICAgICAgICAgIGlmIChwRnJhbWUtPnBJRV9JQlNTREZTID09IE5VTEwpCisgICAgICAgICAgICAg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gICAgICAgICAgICAgICAgICAgaWYgKGlpIDwgNSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB3RmFsbEJhY2tSYXRlID0gYXdIV1JldHJ5MFt3UmF0ZS1SQVRFXzE4TV1baWldOwotICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdGYWxsQmFja1JhdGUgPSBhd0hXUmV0cnkwW3dSYXRlLVJBVEVfMThNXVs0XTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBNZ210LT5zTm9kZURCVGFibGVbMF0udVR4RmFpbFt3RmFsbEJhY2tSYXRlXSsrOwotICAgICAgICAgICAgICAgICAgICB9CisJCQlmb3IgKGlpID0gMDsgaWkgPCBieVR4UmV0cnk7IGlpKyspIHsKKwkJCQlpZiAoaWkgPCA1KQorCQkJCQl3RmFsbEJhY2tSYXRlID0KKwkJCQkJCWF3SFdSZXRyeTBbd1JhdGUtUkFURV8xOE1dW2lpXTsKKwkJCQllbHNlCisJCQkJCXdGYWxsQmFja1JhdGUgPQorCQkJCQkJYXdIV1JldHJ5MFt3UmF0ZS1SQVRFXzE4TV1bNF07CisJCQkJcE1nbXQtPnNOb2RlREJUYWJsZVswXS51VHhGYWlsW3dGYWxsQmFja1JhdGVdKys7CisJCQl9CiAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChieUZhbGxCYWNrID09IEFVVE9fRkJfMSkgewotICAgICAgICAgICAgICAgICAgICBmb3IoaWk9MDtpaTxieVR4UmV0cnk7aWkrKykgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlpIDwgNSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB3RmFsbEJhY2tSYXRlID0gYXdIV1JldHJ5MVt3UmF0ZS1SQVRFXzE4TV1baWldOwotICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdGYWxsQmFja1JhdGUgPSBhd0hXUmV0cnkxW3dSYXRlLVJBVEVfMThNXVs0XTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBNZ210LT5zTm9kZURCVGFibGVbMF0udVR4RmFpbFt3RmFsbEJhY2tSYXRlXSsrOwotICAgICAgICAgICAgICAgICAgICB9CisJCQlmb3IgKGlpID0gMDsgaWkgPCBieVR4UmV0cnk7IGlpKyspIHsKKwkJCQlpZiAoaWkgPCA1KQorCQkJCQl3RmFsbEJhY2tSYXRlID0KKwkJCQkJCWF3SFdSZXRyeTFbd1JhdGUtUkFURV8xOE1dW2lpXTsKKwkJCQllbHNlCisJCQkJCXdGYWxsQmFja1JhdGUgPQorCQkJCQkJYXdIV1JldHJ5MVt3UmF0ZS1SQVRFXzE4TV1bNF07CisJCQkJcE1nbXQtPnNOb2RlREJUYWJsZVswXS51VHhGYWlsW3dGYWxsQmFja1JhdGVdKys7CisJCQl9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICB9OwpAQCAtMTQ3NiwyMSArMTQ1NSwyMyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICh3UmF0ZSA8IFJBVEVfMThNKSApIHsKICAgICAgICAgICAgICAgICAgICAgICAgIHBNZ210LT5zTm9kZURCVGFibGVbdU5vZGVJbmRleF0udVR4RmFpbFt3UmF0ZV0rPWJ5VHhSZXRyeTsKICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChieUZhbGxCYWNrID09IEFVVE9fRkJfMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgZm9yKGlpPTA7aWk8YnlUeFJldHJ5O2lpKyspIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaWkgPCA1KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3RmFsbEJhY2tSYXRlID0gYXdIV1JldHJ5MFt3UmF0ZS1SQVRFXzE4TV1baWldOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd0ZhbGxCYWNrUmF0ZSA9IGF3SFdSZXRyeTBbd1JhdGUtUkFURV8xOE1dWzRdOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNZ210LT5zTm9kZURCVGFibGVbdU5vZGVJbmRleF0udVR4RmFpbFt3RmFsbEJhY2tSYXRlXSsrOworCQkJZm9yIChpaSA9IDA7IGlpIDwgYnlUeFJldHJ5OyBpaSsrKSB7CisJCQkJaWYgKGlpIDwgNSkKKwkJCQkJd0ZhbGxCYWNrUmF0ZSA9CisJCQkJCQlhd0hXUmV0cnkwW3dSYXRlLVJBVEVfMThNXVtpaV07CisJCQkJZWxzZQorCQkJCQl3RmFsbEJhY2tSYXRlID0KKwkJCQkJCWF3SFdSZXRyeTBbd1JhdGUtUkFURV8xOE1dWzRdOworCQkJCXBNZ210LT5zTm9kZURCVGFibGVbdU5vZGVJbmRleF0udVR4RmFpbFt3RmFsbEJhY2tSYXRlXSsrOwogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGJ5RmFsbEJhY2sgPT0gQVVUT19GQl8xKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmb3IoaWk9MDtpaTxieVR4UmV0cnk7aWkrKykgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpaSA8IDUpCisJCSAgICAgIGZvciAoaWkgPSAwOyBpaSA8IGJ5VHhSZXRyeTsgaWkrKykgeworCQkJaWYgKGlpIDwgNSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd0ZhbGxCYWNrUmF0ZSA9IGF3SFdSZXRyeTFbd1JhdGUtUkFURV8xOE1dW2lpXTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisJCQllbHNlCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdGYWxsQmFja1JhdGUgPSBhd0hXUmV0cnkxW3dSYXRlLVJBVEVfMThNXVs0XTsKLSAgICAgICAgICAgICAgICAgICAgIC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HsKICAgICAgICAgICAgICAgICAgICAgIGlmIChwTWdtdC0+c0JTU0xpc3RbaWldLmJBY3RpdmUgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgIElTX0VUSF9BRERSRVNTX0VRVUFMKHBNZ210LT5zQlNTTGlzdFtpaV0uYWJ5QlNTSUQscE1nbXQtPmFieURlc2lyZUJTU0lEKSkgeworCQkJICFjb21wYXJlX2V0aGVyX2FkZHIocE1nbXQtPnNCU1NMaXN0W2lpXS5hYnlCU1NJRCwKKwkJCQkJICAgICBwTWdtdC0+YWJ5RGVzaXJlQlNTSUQpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICB1U2FtZUJzc2lkTnVtKys7CiAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICB9CkBAIC05NTcsNyArODczLDggQEAKICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgYnkgbWVhbnMgb2YganVkZ2luZyBpZiB0aGVyZSBhcmUgdHdvIHNhbWUgQlNTSUQgZXhpc3QgaW4gbGlzdCA/CiAgICAgICAgICAgICAgICAgICBmb3IgKGlpID0gMDsgaWkgPCBNQVhfQlNTX05VTTsgaWkrKykgewogICAgICAgICAgICAgICAgICAgICAgaWYgKHBNZ210LT5zQlNTTGlzdFtpaV0uYkFjdGl2ZSAmJgotICAgICAgICAgICAgICAgICAgICAgICAgSVNfRVRIX0FERFJFU1NfRVFVQUwocE1nbXQtPnNCU1NMaXN0W2lpXS5hYnlCU1NJRCwgcEN1cnItPmFieUJTU0lEKSkgeworCQkJICFjb21wYXJlX2V0aGVyX2FkZHIocE1nbXQtPnNCU1NMaXN0W2lpXS5hYnlCU1NJRCwKKwkJCQkJICAgICBwQ3Vyci0+YWJ5QlNTSUQpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICB1U2FtZUJzc2lkTnVtKys7CiAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICB9CkBAIC0xMDU3LDcgKzk3NCw3IEBACi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lS2V5LmJLZXlWYWxpZCA9PSBUUlVFKSB7CiAgICAgICAgICAgICAgICAgICAgICpwS2V5ID0gJihwVGFibGUtPktleVRhYmxlW2ldLlBhaXJ3aXNlS2V5KTsKQEAgLTI0NSw3ICsyNDUsNyBAQAogICAgICAgICAgICAgaiA9IGk7CiAgICAgICAgIH0KICAgICAgICAgaWYgKChwVGFibGUtPktleVRhYmxlW2ldLmJJblVzZSA9PSBUUlVFKSAmJgotICAgICAgICAgICAgSVNfRVRIX0FERFJFU1NfRVFVQUwocFRhYmxlLT5LZXlUYWJsZVtpXS5hYnlCU1NJRCxwYnlCU1NJRCkpIHsKKwkgICAgIWNvbXBhcmVfZXRoZXJfYWRkcihwVGFibGUtPktleVRhYmxlW2ldLmFieUJTU0lELCBwYnlCU1NJRCkpIHsKICAgICAgICAgICAgIC8vIGZvdW5kIHRhYmxlIGFscmVhZHkgZXhpc3QKICAgICAgICAgICAgIGlmICgoZHdLZXlJbmRleCAmIFBBSVJXSVNFX0tFWSkgIT0gMCkgewogICAgICAgICAgICAgICAgIC8vIFBhaXJ3aXNlIGtleQpAQCAtNDAyLDcgKzQwMiw3IEBACiAgICAgaW50ICAgICBpOwogICAgIEJPT0wgICAgYlJldHVyblZhbHVlID0gRkFMU0U7CiAKLSAgICBpZiAoSVNfQlJPQURDQVNUX0FERFJFU1MocGJ5QlNTSUQpKSB7CisgICAgaWYgKGlzX2Jyb2FkY2FzdF9ldGhlcl9hZGRyKHBieUJTU0lEKSkgewogICAgICAgICAvLyBkZWFsdGUgYWxsIGtleQogICAgICAgICBpZiAoKGR3S2V5SW5kZXggJiBQQUlSV0lTRV9LRVkpICE9IDApIHsKICAgICAgICAgICAgIGZvciAoaT0wO2k8TUFYX0tFWV9UQUJMRTtpKyspIHsKQEAgLTQyNyw3ICs0MjcsNyBAQAogICAgIH0gZWxzZSB7CiAgICAgICAgIGZvciAoaT0wO2k8TUFYX0tFWV9UQUJMRTtpKyspIHsKICAgICAgICAgICAgIGlmICggKHBUYWJsZS0+S2V5VGFibGVbaV0uYkluVXNlID09IFRSVUUpICYmCi0gICAgICAgICAgICAgICAgIElTX0VUSF9BRERSRVNTX0VRVUFMKHBUYWJsZS0+S2V5VGFibGVbaV0uYWJ5QlNTSUQscGJ5QlNTSUQpKSB7CisJCSAhY29tcGFyZV9ldGhlcl9hZGRyKHBUYWJsZS0+S2V5VGFibGVbaV0uYWJ5QlNTSUQsIHBieUJTU0lEKSkgewogCiAgICAgICAgICAgICAgICAgaWYgKChkd0tleUluZGV4ICYgUEFJUldJU0VfS0VZKSAhPSAwKSB7CiAgICAgICAgICAgICAgICAgICAgIHBUYWJsZS0+S2V5VGFibGVbaV0uUGFpcndpc2VLZXkuYktleVZhbGlkID0gRkFMU0U7CkBAIC00ODMsMTEgKzQ4MywxMSBAQAogCiAgICAgZm9yIChpPTA7aTxNQVhfS0VZX1RBQkxFO2krKykgewogICAgICAgICBpZiAoKHBUYWJsZS0+S2V5VGFibGVbaV0uYkluVXNlID09IFRSVUUpICYmCi0gICAgICAgICAgICBJU19FVEhfQUREUkVTU19FUVVBTChwVGFibGUtPktleVRhYmxlW2ldLmFieUJTU0lELHBieUJTU0lEKSkgeworCSAgICAhY29tcGFyZV9ldGhlcl9hZGRyKHBUYWJsZS0+S2V5VGFibGVbaV0uYWJ5QlNTSUQsIHBieUJTU0lEKSkgewogICAgICAgICAgICAgcFRhYmxlLT5LZXlUYWJsZVtpXS5QYWlyd2lzZUtleS5iS2V5VmFsaWQgPSBGQUxTRTsKLSAgICAgICAgICAgIGZvcih1PTA7dTxNQVhfR1JPVVBfS0VZO3UrKykgewotICAgICAgICAgICAgICAgIHBUYWJsZS0+S2V5VGFibGVbaV0uR3JvdXBLZXlbdV0uYktleVZhbGlkID0gRkFMU0U7Ci0gICAgICAgICAgICB9CisJICAgIGZvciAodSA9IDA7IHUgPCBNQVhfR1JPVVBfS0VZOyB1KyspCisJCXBUYWJsZS0+S2V5VGFibGVbaV0uR3JvdXBLZXlbdV0uYktle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VNTKCYocHNFdGhIZWFkZXItPmFieURzdEFkZHJbMF0pKSB8fAotICAgICAgICAgICAgICAgIElTX0JST0FEQ0FTVF9BRERSRVNTKCYocHNFdGhIZWFkZXItPmFieURzdEFkZHJbMF0pKSkgewotICAgICAgICAgICAgICAgIGJOZWVkQUNLID0gRkFMU0U7Ci0gICAgICAgICAgICAgICAgcFR4QnVmSGVhZC0+d0ZJRk9DdGwgPSBwVHhCdWZIZWFkLT53RklGT0N0bCAmICh+RklGT0NUTF9ORUVEQUNLKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgewotICAgICAgICAgICAgICAgIGJOZWVkQUNLID0gVFJVRTsKLSAgICAgICAgICAgICAgICBwVHhCdWZIZWFkLT53RklGT0N0bCB8PSBGSUZPQ1RMX05FRURBQ0s7Ci0gICAgICAgICAgICB9CisJaWYgKChwRGV2aWNlLT5lT1BNb2RlID09IE9QX01PREVfQURIT0MpIHx8CisJICAgIChwRGV2aWNlLT5lT1BNb2RlID09IE9QX01PREVfQVApKSB7CisJCWlmIChpc19tdWx0aWNhc3RfZXRoZXJfYWRkcihwc0V0aEhlYWRlci0+YWJ5RHN0QWRkcikpIHsKKwkJCWJOZWVkQUNLID0gRkFMU0U7CisJCQlwVHhCdWZIZWFkLT53RklGT0N0bCA9CisJCQkJcFR4QnVmSGVhZC0+d0ZJRk9DdGwgJiAofkZJRk9DVExfTkVFREFDSyk7CisJCX0gZWxzZSB7CisJCQliTmVlZEFDSyA9IFRSVUU7CisJCQlwVHhCdWZIZWFkLT53RklGT0N0bCB8PSBGSUZPQ1RMX05FRURBQ0s7CisJCX0KICAgICAgICAgfQogICAgICAgICBlbHNlIHsKICAgICAgICAgICAgIC8vIE1TRFVzIGluIEluZnJhIG1vZGUgYWx3YXlzIG5lZWQgQUNLCkBAIC0xNzA4LDcgKzE3MDAsNyBAQAogICAgIH0KIAogICAgIC8vIDgwMi4xSAotICAgIGlmIChudG9ocyhwc0V0aEhlYWRlci0+d1R5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KLSAgLy8gIGV4dGVybiBTV1BBUmVzdWx0IHdwYV9SZXN1bHQ7Ci0vLyNlbmRpZgogICAgICBCT09MICAgICAgICAgICAgYlR4ZWFwb2xfa2V5ID0gRkFMU0U7CiAKIApAQCAtMjc4Myw3ICsyNzYxLDcgQEAKICAgICAgICAgICAgIHJldHVybiAwOwogICAgICAgICB9CiAKLSAgICAgICAgaWYgKElTX01VTFRJQ0FTVF9BRERSRVNTKChQQllURSkoc2tiLT5kYXRhKSkpIHsKKwlpZiAoaXNfbXVsdGljYXN0X2V0aGVyX2FkZHIoKFBCWVRFKShza2ItPmRhdGEpKSkgewogICAgICAgICAgICAgdU5vZGVJbmRleCA9IDA7CiAgICAgICAgICAgICBiTm9kZUV4aXN0ID0gVFJVRTsKICAgICAgICAgICAgIGlmIChwTWdtdC0+c05vZGVEQlRhYmxlWzBdLmJQU0VuYWJsZSkgewpAQCAtMjk3NSw3ICsyOTUzLDcgQEAKICAgICBlbHNlIHsKICAgICAgICAgaWYgKHBEZXZpY2UtPmVPUE1vZGUgPT0gT1BfTU9ERV9BREhPQykgewogICAgICAgICAgICAgLy8gQWRob2MgVHggcmF0ZSBkZWNpZGVkIGZyb20gbm9kZSBEQgotICAgICAgICAgICAgaWYgKElTX01VTFRJQ0FTVF9BRERSRVNTKCYocERldmljZS0+c1R4RXRoSGVhZGVyLmFieURzdEFkZHJbMF0pKSkgeworCSAgICBpZiAoaXNfbXVsdGljYXN0X2V0aGVyX2FkZHIocERldmljZS0+c1R4RXRoSGVhZGVyLmFieURzdEFkZHIpKSB7CiAgICAgICAgICAgICAgICAgLy8gTXVsdGljYXN0IHVzZSBoaWdoZXN0IGRhdGEgcmF0ZQogICAgICAgICAgICAgICAgIHBEZXZpY2UtPndDdXJyZW50UmF0ZSA9IHBNZ210LT5zTm9kZURCVGFibGVbMF0ud1R4RGF0YVJhdGU7CiAgICAgICAgICAgICAgICAgLy8gcHJlYW1ibGUgdHlwZQpAQCAtMzA3MSwyOCArMzA0OSwxMiBAQAogICAgICAgICB9CiAgICAgICAgIGVsc2UgewogCi0jaWYgMAotICAgICAgICAgICAgaWYoKHBEZXZpY2UtPmZXUEFfQXV0aGVuZWQgPT0gRkFMU0UpICYmCi0JCSgocE1nbXQtPmVBdXRoZW5Nb2RlID09IFdNQUNfQVVUSF9XUEFQU0spfHwocE1nbXQtPmVBdXRoZW5Nb2RlID0gV01BQ19BVVRIX1dQQTJQU0spKSl7Ci0gICAgICAgICAgICAgICAgICBkZXZfa2ZyZWVfc2tiX2lycShza2IpOwotICAgICAgICAgICAgICAgICAgcFN0YXRzLT50eF9kcm9wcGVkKys7Ci0gICAgICAgICAgICAgICAgICByZXR1cm4gU1RBVFVTX0ZBSUxVUkU7Ci0gICAgICAgICAgICB9Ci0JICAgICAgICBlbHNlIGlmIChwVHJhbnNtaXRLZXkgPT0gTlVMTCkgewotICAgICAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8icmV0dXJuIG5vIHR4IGtleVxuIik7Ci0gICAgICAgICAgICAgICAgZGV2X2tmcmVlX3NrYl9pcnEoc2tiKTsKLSAgICAgICAgICAgICAgICBwU3RhdHMtPnR4X2Ryb3BwZWQrKzsKLSAgICAgICAgICAgICAgICByZXR1cm4gU1RBVFVTX0ZBSUxVUkU7Ci0gICAgICAgICAgICB9Ci0jZWxzZQogICAgICAgICAgICAgaWYgKHBUcmFuc21pdEtleSA9PSBOVUxMKSB7CiAgICAgICAgICAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyJyZXR1cm4gbm8gdHgga2V5XG4iKTsKICAgICAgICAgICAgICAgICBkZXZfa2ZyZWVfc2tiX2lycShza2IpOwogICAgICAgICAgICAgICAgIHBTdGF0cy0+dHhfZHJvcHBlZCsrOwogICAgICAgICAgICAgICAgIHJldHVybiBTVEFUVVNfRkFJTFVSRTsKICAgICAgICAgICAgIH0KLSNlbmRpZgotCiAgICAgICAgIH0KICAg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2ZXJzL3N0YWdpbmcvdnQ2NjU2L3VzYnBpcGUuYwpAQCAtMTA3LDEwICsxMDcsNyBAQAogCiAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLSAgRXhwb3J0IEZ1bmN0aW9ucyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwogCi0KLQotTlRTVEFUVVMKLVBJUEVuc0NvbnRyb2xPdXRBc3luKAoraW50IFBJUEVuc0NvbnRyb2xPdXRBc3luKAogICAgICBQU0RldmljZSAgICAgcERldmljZSwKICAgICAgQllURSAgICAgICAgIGJ5UmVxdWVzdCwKICAgICAgV09SRCAgICAgICAgIHdWYWx1ZSwKQEAgLTExOSw4ICsxMTYsNyBAQAogICAgICBQQllURSAgICAgICAgcGJ5QnVmZmVyCiAgICAgKQogewotICAgIE5UU1RBVFVTICAgICAgICAgICAgICAgIG50U3RhdHVzOwotCisJaW50IG50U3RhdHVzOwogCiAgICAgaWYgKE1QX1RFU1RfRkxBRyhwRGV2aWNlLCBmTVBfRElTQ09OTkVDVEVEKSkKICAgICAgICAgcmV0dXJuIFNUQVRVU19GQUlMVVJFOwpAQCAtMTU2LDEyICsxNTIsNyBAQAogICAgIHJldHVybiBudFN0YXR1czsKIH0KIAotCi0KLQotCi1OVFNUQVRVUwotUElQRW5zQ29udHJvbE91dCgKK2ludCBQSVBFbnNDb250cm9sT3V0KAogICAgICBQU0RldmljZSAgICAgcERldmljZSwKICAgICAgQllURSAgICAgICAgIGJ5UmVxdWVzdCwKICAgICAgV09SRCAgICAgICAgIHdWYWx1ZSwKQEAgLTE3MCwxMCArMTYxLDkgQEAKICAgICAgUEJZVEUgICAgICAgIHBieUJ1ZmZlcgogICAgICkKIHsKLSAgICBOVFNUQVRVUyAgICAgICAgICAgIG50U3RhdHVzID0gMDsKKwlpbnQgbnRTdGF0dXMgPSAwOwogICAgIGludCBpaTsKIAotCiAgICAgaWYgKE1QX1RFU1RfRkxBRyhwRGV2aWNlLCBmTVBfRElTQ09OT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Tm93IHRoYXQgd2UgaGF2ZSBjcmVhdGVkIHRoZSB1cmIsIHdlIHdpbGwgc2VuZCBhCiAgICAgLy8gcmVxdWVzdCB0byB0aGUgVVNCIGRldmljZSBvYmplY3QuCiAgICAgLy8KLSNpZiAwICAgICAgICAgICAgLy9yZXNlcnZlIGludCBVUkIgc3VibWl0Ci0JdXNiX2ZpbGxfaW50X3VyYihwRGV2aWNlLT5wSW50ZXJydXB0VVJCLAotCSAgICAgICAgICAgICAgICAgcERldmljZS0+dXNiLAotCSAgICAgICAgICAgICAgICAgdXNiX3JjdmludHBpcGUocERldmljZS0+dXNiLCAxKSwKLQkJCSAodm9pZCAqKSBwRGV2aWNlLT5pbnRCdWYucERhdGFCdWYsCi0JICAgICAgICAgICAgICAgICBNQVhfSU5URVJSVVBUX1NJWkUsCi0JICAgICAgICAgICAgICAgICBzX25zSW50ZXJydXB0VXNiSW9Db21wbGV0ZVJlYWQsCi0JICAgICAgICAgICAgICAgICBwRGV2aWNlLAotCSAgICAgICAgICAgICAgICAgcERldmljZS0+aW50X2ludGVydmFsCi0JICAgICAgICAgICAgICAgICApOwotI2Vsc2UgICAgICAgICAgICAvL3JlcGxhY2UgaW50IFVSQiBzdWJtaXQgYnkgYnVsayB0cmFuc2ZlcgotI2lmbmRlZiBTYWZlX0Nsb3NlCi0JdXNiX2ZpbGxfaW50X3VyYihwRGV2aWNlLT5wSW50ZXJydXB0VVJCLAotCSAgICAgICAgICAgICAgICAgcERldmljZS0+dXNiLAotCSAgICAgICAgICAgICAgICAgdXNiX3JjdmludHBpcGUocERldmljZS0+dXNiLCAxKSwKLQkJCSAodm9pZCAqKSBwRGV2aWNlLT5pbnRCdWYucERhdGFCdWYsCi0JICAgICAgICAgICAgICAgICBNQVhfSU5URVJSVVBUX1NJWkUsCi0JICAgICAgICAgICAgICAgICBzX25zSW50ZXJydXB0VXNiSW9Db21wbGV0ZVJlYWQsCi0JICAgICAgICAgICAgICAgICBwRGV2aWNlLAotCSAgICAgICAgIC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F0dXMpOwotICAgIH0KLSAgICNlbHNlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vcmVwbGFjZSBpbnQgVVJCIHN1Ym1pdCBieSBidWxrIHRyYW5zZmVyCi0gICAgI2lmZGVmIFNhZmVfQ2xvc2UKICAgICAgICB1c2JfZmlsbF9idWxrX3VyYihwRGV2aWNlLT5wSW50ZXJydXB0VVJCLAogCQkgICAgICBwRGV2aWNlLT51c2IsCiAJCSAgICAgIHVzYl9yY3ZidWxrcGlwZShwRGV2aWNlLT51c2IsIDEpLApAQCAtNTE0LDExICs0NjMsNiBAQAogCWlmIChudFN0YXR1cyAhPSAwKSB7CiAJICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8iU3VibWl0IGludCBVUkIgZmFpbGVkICVkXG4iLCBudFN0YXR1cyk7CiAgICAgICAgICAgIH0KLQotICAgICNlbHNlCi0gICAgICAgIHRhc2tsZXRfc2NoZWR1bGUoJnBEZXZpY2UtPkV2ZW50V29ya0l0ZW0pOwotICAgICNlbmRpZgotI2VuZGlmCiAgICAgfQogICAgIC8vCiAgICAgLy8gV2UgcmV0dXJuIFNUQVRVU19NT1JFX1BST0NFU1NJTkdfUkVRVUlSRUQgc28gdGhhdCB0aGUgY29tcGxldGlvbgpAQCAtNTQwLDEzICs0ODQsOSBAQAogICogUmV0dXJuIFZhbHVlOiBTVEFUVVNfSU5TVUZGSUNJRU5UX1JFU09VUkNFUyBvciByZXN1bHQgb2YgSW9DYWxsRHJpdmVyCiAgKgogICovCi1OVFNUQVRVUwotUElQRW5zQnVsa0luVXNiUmVhZCgKLSAgICAgUFNEZXZpY2UgcERldmljZSwKLSAgICAgUFJDQiAgICAgcFJDQgotICAgICkKK2ludCBQSVBFbnNCdWxrSW5Vc2JSZWFkKFBTRGV2aWNlIHBEZXZpY2UsIFBSQ0IgcFJDQikKIHsKL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1F1YWwKICAgICAgICAgICAgcERldmljZS0+c2NTdGF0aXN0aWMuUnhPa0NudCArKzsKLQkjZW5kaWYKICAgICB9CiAKIApAQCAtNjkwLDcgKzYyNCw3IEBACiAgICAgICBQVVNCX1NFTkRfQ09OVEVYVCBwQ29udGV4dAogICAgICkKIHsKLSAgICBOVFNUQVRVUyAgICAgICAgICAgIHN0YXR1czsKKyAgICBpbnQgc3RhdHVzOwogICAgIHN0cnVjdCB1cmIgICAgICAgICAgKnBVcmI7CiAKIApAQCAtNzcxLDcgKzcwNSw3IEBACiAgICAgKQogewogICAgIFBTRGV2aWNlICAgICAgICAgICAgcERldmljZTsKLSAgICBOVFNUQVRVUyAgICAgICAgICAgIHN0YXR1czsKKyAgICBpbnQgc3RhdHVzOwogICAgIENPTlRFWFRfVFlQRSAgICAgICAgQ29udGV4dFR5cGU7CiAgICAgdW5zaWduZWQgbG9uZyAgICAgICAgICAgICAgIHVsQnVmTGVuOwogICAgIFBVU0JfU0VORF9DT05URVhUICAgcENvbnRleHQ7CkBAIC04MDMsMTAgKzczNyw3IEBACiAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8iV3JpdGUgJWQgYnl0ZXNcbiIsKGludCl1bEJ1Zkxlbik7CiAgICAgICAgIHBEZXZpY2UtPnVsQnVsa091dEJ5dGVzV3JpdGUgKz0gdWxCdWZMZW47CiAgICAgICAgIHBEZXZpY2UtPnVsQnVsa091dENvbnRDUkNFcnJvciA9IDA7Ci0JLy8yMDA3LTAxMTUtMDY8QWRkPmJ5IE1pa2VMaXUKLSAgICAgICAgICAgI2lmZGVmIFR4SW5TbGVlcAotICAgICAgICAgICAgIHBEZXZpY2UtPm5UeERhdGFUaW1lQ291dCA9IDA7Ci0gICAgICAgICAgICNlbmRpZgorCXBEZXZpY2UtPm5UeERhdGFUaW1lQ291dCA9IDA7CiAKICAgICB9IGVsc2UgewogICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRyw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BZGhvY19TVEEKICAgICAgICAgICAgIG1lbWNweShwTWdtdC0+YWJ5QWRIb2NTU0lELHBNZ210LT5hYnlEZXNpcmVTU0lELAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChQV0xBTl9JRV9TU0lEKXBNZ210LT5hYnlEZXNpcmVTU0lEKS0+bGVuICsgV0xBTl9JRUhEUl9MRU4pOwotCSNlbmRpZgorCiAgICAgICAgICAgICBwSXRlbVNTSUQgPSAoUFdMQU5fSUVfU1NJRClwTWdtdC0+YWJ5RGVzaXJlU1NJRDsKICAgICAgICAgICAgIHBJdGVtU1NJREN1cnIgPSAoUFdMQU5fSUVfU1NJRClwTWdtdC0+YWJ5Q3VyclNTSUQ7CiAgICAgICAgICAgICBEQkdfUFJUKE1TR19MRVZFTF9ERUJVRywgS0VSTl9JTkZPIiBjbWQ6IGRlc2lyZSBzc2lkID0gJXNcbiIsIHBJdGVtU1NJRC0+YWJ5U1NJRCk7CkBAIC03MTYsMTggKzcxNCw2IEBACiAJICAgICAgIHJldHVybjsKIAkgICB9CiAJICAgICAgICAgIHBEZXZpY2UtPmJ5TGlua1dhaXRDb3VudCA9IDA7Ci0JCSAjaWYgMAotICAgICAgICAgICAgICAgICAgICAgI2lmZGVmIFdQQV9TVVBQTElDQU5UX0RSSVZFUl9XRVhUX1NVUFBPUlQKLSAgICAgICAgICAgICAgICAgICAgLy8gaWYocERldmljZS0+YldQQVN1cHBXZXh0RW5hYmxlZCA9PSBUUlVFKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgCXVuaW9uIGl3cmVxX2RhdGEgIHdycXU7Ci0gICAgICAgICAgICAgICAgICAJbWVtc2V0KCZ3cnF1LCAwLCBzaXplb2YgKHdycXUpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgd3JxdS5hcF9hZGRyLnNhX2ZhbWlseSA9IEFSUEhSRF9FVEhFUjsKLSAgICAgICAgICAgICAgICAgIAlwcmludGsoIndpcmVsZXNz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0NQRU5ESU5HKSB7CkBAIC03ODUsMTggKzc2OCw2IEBACiAJICAgICAgIHJldHVybjsKIAkgICB9CiAJICAgICAgICAgIHBEZXZpY2UtPmJ5TGlua1dhaXRDb3VudCA9IDA7Ci0JCSNpZiAwCi0gICAgICAgICAgICAgICAgICAgICAjaWZkZWYgV1BBX1NVUFBMSUNBTlRfRFJJVkVSX1dFWFRfU1VQUE9SVAotICAgICAgICAgICAgICAgICAgICAvLyBpZihwRGV2aWNlLT5iV1BBU3VwcFdleHRFbmFibGVkID09IFRSVUUpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAJdW5pb24gaXdyZXFfZGF0YSAgd3JxdTsKLSAgICAgICAgICAgICAgICAgIAltZW1zZXQoJndycXUsIDAsIHNpemVvZiAod3JxdSkpOwotICAgICAgICAgICAgICAgICAgICAgICAgICB3cnF1LmFwX2FkZHIuc2FfZmFtaWx5ID0gQVJQSFJEX0VUSEVSOwotICAgICAgICAgICAgICAgICAgCXByaW50aygid2lyZWxlc3Nfc2VuZF9ldmVudC0tLT5TSU9DR0lXQVAoZGlzYXNzb2NpYXRlZDpBU1NPQ0lBVEVfV0FJVF90aW1lb3V0KVxuIik7Ci0gICAgICAgICAgICAgICAgICAJd2lyZWxlc3Nfc2VuZF9ldmVudChwRGV2aWNlLT5kZXYsIFNJT0NHSVdBUCwgJndycXUsIE5VTEwpOwotICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICNlbmRpZgotCQkjZW5kaWYKIAogICAgICAgICAgICAgc19iQ29tbWFuZENvbXBsZXRlKHBEZXZpY2UpOwogICAgICAgICAgICAgYnJlYWs7CkBAIC05MDcsNyArODc4LDcgQEAKICAgICAgICAvLyAgICAgICAgIENBUkRiUmFkaW9Qb3dlck9mZihwRGV2aWNlKTsKICAgICAgICAvLzIwMDgtMDktMDk8QWRkPiBCWSBNaWtlOkhvdCBLZXkgZm9yIFJhZGlvIE9uL09mZ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2FjaGVFbnRyeVt1SW5kZXhdKTsKICAgICAgICAgICAgIGlmICgocENhY2hlRW50cnktPndGbVNlcXVlbmNlID09IHBNQUNIZWFkZXItPndTZXFDdGwpICYmCi0gICAgICAgICAgICAgICAgKElTX0VUSF9BRERSRVNTX0VRVUFMICgmKHBDYWNoZUVudHJ5LT5hYnlBZGRyMlswXSksICYocE1BQ0hlYWRlci0+YWJ5QWRkcjJbMF0pKSkgJiYKKwkJKCFjb21wYXJlX2V0aGVyX2FkZHIoJihwQ2FjaGVFbnRyeS0+YWJ5QWRkcjJbMF0pLAorCQkJCSAgICAgJihwTUFDSGVhZGVyLT5hYnlBZGRyMlswXSkpKSAmJgogICAgICAgICAgICAgICAgIChMT0JZVEUocENhY2hlRW50cnktPndGcmFtZUN0bCkgPT0gTE9CWVRFKHBNQUNIZWFkZXItPndGcmFtZUN0bCkpCiAgICAgICAgICAgICAgICAgKSB7CiAgICAgICAgICAgICAgICAgLyogRHVwbGljYXRlIG1hdGNoICovCkBAIC0xMTEsMjIgKzExMiwyMSBAQAogICogUmV0dXJuIFZhbHVlOiBpbmRleCBudW1iZXIgaW4gRGVmcmFnbWVudCBEYXRhYmFzZQogICoKICAqLworCiB1bnNpZ25lZCBpbnQgV0NUTHVTZWFyY2hERkNCKFBTRGV2aWNlIHBEZXZpY2UsIFBTODAyXzExSGVhZGVyIHBNQUNIZWFkZXIpCiB7CiAJdW5zaWduZWQgaW50IGlpOwogCi0gICAgZm9yKGlpPTA7aWk8cERldmljZS0+Y2JERkNCO2lpKyspIHsKLSAgICAgICAgaWYgKChwRGV2aWNlLT5zUnhERkNCW2lpXS5iSW5Vc2UgPT0gVFJVRSkgJiYKLSAgICAgICAgICAgIChJU19FVEhfQUREUkVTU19FUVVBTCAoJihwRGV2aWNlLT5zUnhERkNCW2lpXS5hYnlBZGRyMlswXSksICYocE1BQ0hlYWRlci0+YWJ5QWRkcjJbMF0pKSkKLSAgICAgICAgICAgICkgewotICAgICAgICAgICAgLy8KLSAgICAgICAgICAgIHJldHVybihpaSk7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgcmV0dXJuKHBEZXZpY2UtPmNiREZDQik7CisJZm9yIChpaSA9IDA7IGlpIDwgcERldmljZS0+Y2JERkNCOyBpaSsrKSB7CisJCWlmICgocERldmljZS0+c1J4REZDQltpaV0uYkluVXNlID09IFRSVUUpICYmCisJCSAgICAoIWNvbXBhcmVfZXRoZXJfYWRkcigmKHBEZXZpY2UtPnNSeERGQ0JbaWldLmFieUFkZHIyWzBdKSwKKwkJCQkJICAmKHBNQUNIZWFkZXItPmFieUFkZHIyWzBdKSkpKSB7CisJCQlyZXR1cm4gaWk7CisJCX0KKwl9CisJcmV0dXJuIHBEZXZpY2UtPmNiREZDQjsKIH0KIAotCiAvKgogICogRGVzY3JpcHRpb246CiAgKiAgICAgIEluc2VydCByZWNlaXZlZCBmcmFnbWVudCBwYWNrZXQgaW4gRGVmcmFnbWVudCBEYXRhYmFzZQpAQCAtMTQ3LDcgKzE0Nyw3IEBACiAKICAgICBpZiAocERldmljZS0+Y2JGcmVlREZDQiA9PSAwKQogICAgICAgICByZXR1cm4ocERldmljZS0+Y2JERkNCKTsKLSAgICBmb3IoaWk9MDtpaTxwRGV2aWNlLT5jYkRGQ0I7aWkrKykgeworICAgIGZvciAoaWkgPSAwOyBpaSA8IHBEZXZpY2UtPmNiREZDQjsgaWkrKykgewogICAgICAgICBpZiAocERldmljZS0+c1J4REZDQltpaV0uYkluVXNlID09IEZBTFNFKSB7CiAgICAgICAgICAgICBwRGV2aWNlLT5jYkZyZWVERkNCLS07CiAgICAgICAgICAgICBwRGV2aWNlLT5zUnhERkNCW2lpXS51TGlmZXRpbWUgPSBwRGV2aWNlLT5kd01heFJlY2VpdmVMaWZldGltZTsKZGlmZiAtLWdpdCBhL2RyaXZlcnMvc3RhZ2luZy92dDY2NTYvd21nci5jIGIvZHJpdmVycy9zdGFnaW5nL3Z0NjY1Ni93bWdyLmMKaW5kZXggOTNjMTVmMC4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JyU3RhdGU7ICAvLyBNQUMgY3VycmVudCBCU1Mgc3RhdGUKLSAgICAjaWZkZWYgU25kRXZ0X1RvQVBJCiAgICAgV01BQ19CU1NfU1RBVEUgICAgICAgICAgZUxhc3RTdGF0ZTsgIC8vIE1BQyBsYXN0IEJTUyBzdGF0ZQotICAgICNlbmRpZgogCiAgICAgUEtub3duQlNTICAgICAgICAgICAgICAgcEN1cnJCU1M7CiAgICAgQllURSAgICAgICAgICAgICAgICAgICAgYnlDU1NHSzsKQEAgLTI5MywxMCArMjkxLDcgQEAKICAgICBCWVRFICAgICAgICAgICAgICAgICAgICBhYnlEZXNpcmVCU1NJRFtXTEFOX0JTU0lEX0xFTl07CiAKIC8vcmVzdG9yZSBCU1MgaW5mbyBmb3IgQWQtSG9jIG1vZGUKLS8vMjAwODAxMzEtMDUsPEFkZD4gYnkgTWlrZSBMaXUKLSNpZmRlZiBBZGhvY19TVEEKICAgICAgQllURSAgICAgICAgICAgICAgICAgICAgYWJ5QWRIb2NTU0lEW1dMQU5fSUVIRFJfTEVOICsgV0xBTl9TU0lEX01BWExFTiArIDFdOwotI2VuZGlmCiAKICAgICAvLyBBZGhvYyBvciBBUCBjb25maWd1cmF0aW9uIHZhcnMKICAgICBXT1JEICAgICAgICAgICAgICAgICAgICB3SUJTU0JlYWNvblBlcmlvZDsKQEAgLTM0MywxMSArMzM4LDExIEBACiAgICAgQk9PTCAgICAgICAgICAgICAgICAgICAgYlJ4QmVhY29uSW5UQlRUV2FrZTsKICAgICBCWVRFICAgICAgICAgICAgICAgICAgICBhYnlQU1R4TWFwW01BWF9OT0RFX05VTSArIDFdOwogCi0gICAgLy8gbWFuYWdtZW50IGNvbW1hbmQgcmVsYXRlZAorICAgIC8vIG1hbmFnZW1lbnQgY29tbWFuZCByZWxhdGVkCiAgICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgICAgICB1Q21kQnVzeTsKICAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICAgICAgICAgIHVDbW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bmdlIHRleHQgZXh0ZW5zaW9uCi0vLyAzMn4yNTUgcmVzZXJ2ZWQKLS8vLS0gIDExRyAgLS0KKy8qIDE3fjMxIHJlc2VydmVkIGZvciBjaGFsbGVuZ2UgdGV4dCBleHRlbnNpb24gKi8KKy8qIDMyfjI1NSByZXNlcnZlZCAqLworLyotLSAgMTFHICAtLSAqLwogI2RlZmluZSBFTEVNRU5UX0lEX0VSUF9JTkZPUk1BVElPTgkJCTQyCiAjZGVmaW5lIEVMRU1FTlRfSURfRVhURU5ERURfU1VQUE9SVEVEX1JBVEVTIDUwCiAKLS8vLS0gIFdQQSAgLS0KKy8qIC0tICBXUEEgIC0tICovCiAKICNkZWZpbmUgRUxFTUVOVF9JRF9SU05fV1BBCQkJCQkyMjEKICNpZmRlZiBfV1BBMl8KICNkZWZpbmUgRUxFTUVOVF9JRF9SU05fV1BBMgkJCQkgICAgNDgKLSNlbmRpZiAvL2VuZGlmIFdQQTIKKyNlbmRpZiAvKiBlbmRpZiBXUEEyICovCiAKICNkZWZpbmUgV0xBTl9NQVhfUEFJUldJU0VfQ0lQSEVSX1NVSVRFX0NPVU5UICAgICgodTE2KSA2KQogI2RlZmluZSBXTEFOX01BWF9BVVRIX0tFWV9NR1RfU1VJVEVfTElTVF9DT1VOVCAgKCh1MTYpIDIpCiAKLS8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLy8gIFJlYXNvbiBDb2RlIChUYWJsZSAxOCk6IGluZGljYXRlIHRoZSByZWFzb24gb2YgRGlzQXNzb2MsIERlQXV0aGVuCi0vLyAgbGVuZ3RoIG9mIFJlYXNvbkNvZGUgaXMgMiBPY3RzLgotLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisvKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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0NzYxNCkpLCBGSVhFRChERUcyUkFEKDAuMjIzODExKSksCisgICAgRklYRUQoREVHMlJBRCgwLjExMTkwNikpLCBGSVhFRChERUcyUkFEKDAuMDU1OTUzKSksIEZJWEVEKERFRzJSQUQoMC4wMjc5NzcpKQogfTsKIAogLyoqKioqKioqKioqKioqKioqKiBMT0NBTCBGVU5DVElPTiBERUNMQVJBVElPTiBTRUNUSU9OICoqKioqKioqKioqKioqKioqKioqKiovCi0vL3ZvaWQgICAgX3BoeV9yZl93cml0ZV9kZWxheShzdHJ1Y3QgaHdfZGF0YSAqcGh3X2RhdGEpOwotLy92b2lkICAgIHBoeV9pbml0X3JmKHN0cnVjdCBod19kYXRhICpwaHdfZGF0YSk7CisKKy8qCisgKiB2b2lkICAgIF9waHlfcmZfd3JpdGVfZGVsYXkoc3RydWN0IGh3X2RhdGEgKnBod19kYXRhKTsKKyAqIHZvaWQgICAgcGh5X2luaXRfcmYoc3RydWN0IGh3X2RhdGEgKnBod19kYXRhKTsKKyAqLwogCiAvKioqKioqKioqKioqKioqKioqIEZVTkNUSU9OIERFRklOSVRJT04gU0VDVElPTiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIApAQCAtNDYsOSArNDgsNyBAQAogICAgIHZhbCA9IChkYXRhICYgMHgwRkZGKTsKIAogICAgIGlmICgoZGF0YSAmIEJJVCgxMikpICE9IDApCi0gICAgewogICAgICAgICB2YWwgfD0gMHhGRkZGRjAwMDsKLSAgICB9CiAKICAgICByZXR1cm4gKChzMzIpIHZhbCk7CiB9CkBAIC01OCwxMyArNTgsOSBAQAogICAgIHUzMiAgICAgdmFsOwogCiAgICAgaWYgKGRhdGEgPiA0MDk1KQotICAgIHsKICAgICAgICAgZGF0YSA9IDQwOTU7Ci0gICAgfQogICAgIGVsc2UgaWYgKGRhdGEgPCAtNDA5NikKLSAgICB7CiAgICAgICAgIGRhdGEgPSAtNDA5NjsKLSAgICB9CiAKICAgICB2YWwgPSBkYXRhICYgMHgxRkZGOwogCkBAIC03OSw5ICs3NSw3IEBACiAgICAgdmFsID0gKGRhdGEgJiAweDAwMDcpOwogCiAgICAgaWYgKChkYXRhICYgQklUKDMpKSAhPSAwKQotICAgIHsKICAgICAgICAgdmFsIHw9IDB4RkZGRkZGRjg7Ci0gICAgfQogCiAgICAgcmV0dXJuIHZhbDsKIH0KQEAgLTkxLDEzICs4NSw5IEBACiAgICAgdTMyICAgICB2YWw7CiAKICAgICBpZiAoZGF0YSA+IDcpCi0gICAgewogICAgICAgICBkYXRhID0gNzsKLSAgICB9CiAgICAgZWxzZSBpZiAoZGF0YSA8IC04KQotICAgIHsKICAgICAgICAgZGF0YSA9IC04OwotICAgIH0KIAogICAgIHZhbCA9IGRhdGEgJiAweDAwMEY7CiAKQEAgLTExMiw5ICsxMDIsNyBAQAogICAgIHZhbCA9IChkYXRhICYgMHgwMDBGKTsKIAogICAgIGlmICgoZGF0YSAmIEJJVCg0KSkgIT0gMCkKLSAgICB7CiAgICAgICAgIHZhbCB8PSAweEZGRkZGRkYwOwotICAgIH0KIAogICAgIHJldHVybiB2YWw7CiB9CkBAIC0xMjQsMTMgKzExMiw5IEBACiAgICAgdTMyICAgICB2YWw7CiAKICAgICBpZiAoZGF0YSA+IDE1KQotICAgIHsKICAgICAgICAgZGF0YSA9IDE1OwotICAgIH0KICAgICBlbHNlIGlmIChkYXRhIDwgLTE2KQotICAgIHsKICAgICAgICAgZGF0YSA9IC0xNjsKLSAgICB9CiAKICAgICB2YWwgPSBkYXRhICYgMHgwMDFGOwogCkBAIC0xNDUsOSArMTI5LDcgQEAKICAgICB2YWwgPSAoZGF0YSAmIDB4MDAxRik7CiAKICAgICBpZiAoKGRhdGEgJiBCSVQoNSkpICE9IDApCi0gICAgewogICAgICAgICB2YWwgfD0gMHhGRkZGRkZFMDsKLSAgICB9CiAKICAgICByZXR1cm4gdmFsOwogfQpAQCAtMTU3LDEzICsxMzksOSBAQAogICAgIHUzMiAgICAgdmFsOwogCiAgICAgaWYgKGRhdG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JyQW5nbGUpCi0gICAgICAgIHsKLSAgICAgICAgICAgIE5ld1g9WCAtIChZID4+IFN0ZXApOwotICAgICAgICAgICAgWT0oWCA+PiBTdGVwKSArIFk7Ci0gICAgICAgICAgICBYPU5ld1g7CisgICAgICAgIGlmIChUYXJnZXRBbmdsZSA+IEN1cnJBbmdsZSkgeworICAgICAgICAgICAgTmV3WCA9IFggLSAoWSA+PiBTdGVwKTsKKyAgICAgICAgICAgIFkgPSAoWCA+PiBTdGVwKSArIFk7CisgICAgICAgICAgICBYID0gTmV3WDsKICAgICAgICAgICAgIEN1cnJBbmdsZSArPSBBbmdsZXNbU3RlcF07Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBOZXdYPVggKyAoWSA+PiBTdGVwKTsKLSAgICAgICAgICAgIFk9LShYID4+IFN0ZXApICsgWTsKLSAgICAgICAgICAgIFg9TmV3WDsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIE5ld1ggPSBYICsgKFkgPj4gU3RlcCk7CisgICAgICAgICAgICBZID0gLShYID4+IFN0ZXApICsgWTsKKyAgICAgICAgICAgIFggPSBOZXdYOwogICAgICAgICAgICAgQ3VyckFuZ2xlIC09IEFuZ2xlc1tTdGVwXTsKICAgICAgICAgfQogICAgIH0KIAotICAgIGlmIChhbmdsZSA+IDApCi0gICAgeworICAgIGlmIChhbmdsZSA+IDApIHsKICAgICAgICAgKmNvcyA9IFg7CiAgICAgICAgICpzaW4gPSBZOwotICAgIH0KLSAgICBlbHNlCi0gICAgeworICAgIH0gZWxzZSB7CiAgICAgICAgICpjb3MgPSBYOwogICAgICAgICAqc2luID0gLVk7CiAgICAgfQpAQCAtMzQzLDcgKzMwMSw3IEBACiAJCW51bWJlciArPSAweDEwMDA7CiAJcmV0dXJuIFdiMzVSZWdfUmVhZFN5bmMocEh3RGF0YSwgbnVtYmVyLCBwVmFsdWUpOwogfQotI2RlZmluZSBod19nZXRfZHh4X3JlZ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0vLyAqKioqKioqKioqKipmb3Igd2luYm9uZCBjYWxpYnJhdGlvbioqKioqKioqKgotLy8KKy8qKioqKioqKioqKioqKmZvciB3aW5ib25kIGNhbGlicmF0aW9uKioqKioqKioqLwogCi0vLwotLy8KLS8vICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogdm9pZCBfcnhhZGNfZGNfb2Zmc2V0X2NhbmNlbGxhdGlvbl93aW5ib25kKHN0cnVjdCBod19kYXRhICpwaHdfZGF0YSwgdTMyIGZyZXF1ZW5jeSkKIHsKICAgICB1MzIgICAgIHJlZ19hZ2NfY3RybDM7CkBAIC0zOTIsMzUgKzM0NSwzMSBAQAogICAgIFBIWV9ERUJVRygoIltDQUxdIC0+IFsxXV9yeGFkY19kY19vZmZzZXRfY2FuY2VsbGF0aW9uKClcbiIpKTsKICAgICBwaHlfaW5pdF9yZihwaHdfZGF0YSk7CiAKLSAgICAvLyBzZXQgY2FsaWJyYXRpb24gY2hhbm5lbAotICAgIGlmKCAoUkZfV0JfMjQyID09IHBod19kYXRhLT5waHlfdHlwZSkgfHwKLQkJKFJGX1dCXzI0Ml8xID09IHBod19kYXRhLT5waHlfdHlwZSkgKSAvLyAyMDA2MDYxOS41IEFkZAotICAgIHsKLSAgICAgICAgaWYgKChmcmVxdWVuY3kgPj0gMjQxMikgJiYgKGZyZXF1ZW5jeSA8PSAyNDg0KSkKLSAgICAgICAgewotICAgICAgICAgICAgLy8gdzg5cmYyNDIgY2hhbmdlIGZyZXF1ZW5jeSB0byAyMzkwTWh6CisgICAgLyogc2V0IGNhbGlicmF0aW9uIGNoYW5uZWwgKi8KKyAgICBpZiAoKFJGX1dCXzI0MiA9PSBwaHdfZGF0YS0+cGh5X3R5cGUpIHx8CisJCShSRl9XQl8yNDJfMSA9PSBwaHdfZGF0YS0+cGh5X3R5cGUpKSAvKiAyMDA2MD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G9jKCk7CisJaWYgKGRldiA9PSBOVUxMKSB7CisJCURCR19FUlJPUihEYmdJbmZvLCAid2xfZGV2aWNlX2FsbG9jIHJldHVybmVkIE5VTExcbiIpOworCQlyZXR1cm4gLUVOT01FTTsKKwl9CiAKLSAgICBsaW5rLT5pby5OdW1Qb3J0czEgICAgICA9IEhDRl9OVU1fSU9fUE9SVFM7Ci0gICAgbGluay0+aW8uQXR0cmlidXRlczEgICAgPSBJT19EQVRBX1BBVEhfV0lEVEhfMTY7Ci0gICAgbGluay0+aW8uSU9BZGRyTGluZXMgICAgPSA2OwotICAgIGxpbmstPmNvbmYuQXR0cmlidXRlcyAgID0gQ09ORl9FTkFCTEVfSVJROwotICAgIGxpbmstPmNvbmYuSW50VHlwZSAgICAgID0gSU5UX01FTU9SWV9BTkRfSU87Ci0gICAgbGluay0+Y29uZi5Db25maWdJbmRleCAgPSA1OwotICAgIGxpbmstPmNvbmYuUHJlc2VudCAgICAgID0gUFJFU0VOVF9PUFRJT047CisJbGluay0+cmVzb3VyY2VbMF0tPmVuZCAgPSBIQ0ZfTlVNX0lPX1BPUlRTOworCWxpbmstPnJlc291cmNlWzBdLT5mbGFncz0gSU9fREFUQV9QQVRIX1dJRFRIXzE2OworCWxpbmstPmNvbmYuQXR0cmlidXRlcyAgID0gQ09ORl9FTkFCTEVfSVJROworCWxpbmstPmNvbmYuSW50VHlwZSAgICAgID0gSU5UX01FTU9SWV9BTkRfSU87CisJbGluay0+Y29uZi5Db25maWdJbmRleCAgPSA1OworCWxpbmstPmNvbmYuUHJlc2VudCAgICAgID0gUFJFU0VOVF9PUFRJT047CiAKLSAgICBsaW5rLT5wcml2ID0gZGV2OwotICAgIGxwID0gd2xfcHJpdihkZXYpOwotICAgIGxwLT5saW5rID0gbGluazsKKwlsaW5rLT5wcml2ID0gZGV2OworCWxwID0gd2xfcHJpdihkZXYpOworCWxwLT5saW5rID0gbGluazsKIAotICAgIHdsX2FkYXB0ZXJfaW5zZXJ0KGxpbmspOworCXdsX2FkYXB0ZXJfaW5zZXJ0KGxpbmspOwogCi0gICAgREJHX0xFQVZFKCBEYmdJbmZvICk7Ci0gICAgcmV0dXJuIDA7Ci19IC8vIHdsX2FkYXB0ZXJfYXR0YWNoCisJREJHX0xFQVZFKERiZ0luZm8pOworCXJldHVybiAwOworfSAvKiB3bF9hZGFwdGVyX2F0dGFjaCAqLwogLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KIAogCkBAIC0xOTAsMjUgKzE4OCwyNCBAQAogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIHN0YXRpYyB2b2lkIHdsX2FkYXB0ZXJfZGV0YWNoKHN0cnVjdCBwY21jaWFfZGV2aWNlICpsaW5rKQogewotICAgIHN0cnVjdCBuZXRfZGV2aWNlICAgKmRldiA9IGxpbmstPnByaXY7Ci0gICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworCXN0cnVjdCBuZXRfZGV2aWNlICAgKmRldiA9IGxpbmstPnByaXY7CisJLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCiAKKwlEQkdfRlVOQygid2xfYWRhcHRlcl9kZXRhY2giKTsKKwlEQkdfRU5URVIoRGJnSW5mbyk7CisJREJHX1BBUkFNKERiZ0luZm8sICJsaW5rIiwgIjB4JXAiLCBsaW5rKTsKIAotICAgIERCR19GVU5DKCAid2xfYWRhcHRlcl9kZXRhY2giICk7Ci0gICAgREJHX0VOVEVSKCBEYmdJbmZvICk7Ci0gICAgREJHX1BBUkFNKCBEYmdJbmZvLCAibGluayIsICIweCVwIiwgbGluayApOworCXdsX2FkYXB0ZXJfcmVsZWFzZShsaW5rKTsKIAotICAgIHdsX2FkYXB0ZXJfcmVsZWFzZShsaW5rKTsKKwlpZiAoZGV2KSB7CisJCXVucmVnaXN0ZXJfd2xhZ3Nfc3lzZnMoZGV2KTsKKwkJdW5yZWdpc3Rlcl9uZXRkZXYoZGV2KTsKKwl9CiAKLSAgICBpZiAoZGV2KSB7Ci0JdW5yZWdpc3Rlcl93bGFnc19zeXNmcyhkZXYpOwotCXVucmVnaXN0ZXJfbmV0ZGV2KGRldik7Ci0gICAgfQorCXdsX2RldmljZV9kZWFsbG9jKGRldik7CiAKLSAgICB3bF9kZXZpY2VfZGVhbGxvYyhkZXYpOwotCi0gICAgREJHX0xFQVZFKCBEYmdJbmZvICk7Ci19IC8vIHdsX2FkYXB0ZXJfZGV0YWNoCisJREJHX0xFQVZFKERiZ0luZm8pOworfSAvKiB3bF9hZGFwdGVyX2RldGFjaCAqLwogLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KIAogCkBAIC0yMzIsMzMgKzIyOSwzMyBAQAogICogICAgICBOL0EKICAqCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotdm9pZCB3bF9hZGFwdGVyX3JlbGVhc2UoIHN0cnVjdCBwY21jaWFfZGV2aWNlICpsaW5rICkKK3ZvaWQgd2xfYWRhcHRlcl9yZWxlYXNlKHN0cnVjdCBwY21jaWFfZGV2aWNlICpsaW5rKQogewotICAgIERCR19GVU5DKCAid2xfYWRhcHRlcl9yZWxlYXNlIiApOwotICAgIERCR19FTlRFUiggRGJnSW5mbyApOwotICAgIERCR19QQVJBTSggRGJnSW5mbywgImxpbmsiLCAiMHglcCIsIGxpbmspOworCURCR19GVU5DKCJ3bF9hZGFwdGVyX3JlbGVhc2UiKTsKKwlEQkdfRU5URVIoRGJnSW5mbyk7CisJREJHX1BBUkFNKERiZ0luZm8sICJsaW5rIiwgIjB4JXAiLCBsaW5rKTsKIAotICAgIC8qIFN0b3AgaGFyZHdhcmUgKi8KLSAgICB3bF9yZW1vdmUobGluay0+cHJpdik7CisJLyogU3RvcCBoYXJkd2FyZSAqLworCXdsX3JlbW92ZShsaW5rLT5wcml2KTsKIAotICAgIHBjbWNpYV9kaXNhYmxlX2RldmljZShsaW5rKTsKKwlwY21jaWFfZGlzYWJsZV9kZXZpY2UobGluayk7CiAKLSAgICBEQkdfTEVBVkUoIERiZ0luZm8gKTsKLX0gLy8gd2xfYWRhcHRlcl9yZWxlYXNlCisJREJHX0xFQVZFKERiZ0luZm8pOworfSAvKiB3bF9hZGFwdGVyX3JlbGVhc2UgKi8KIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKIHN0YXRpYyBpbnQgd2xfYWRhcHRlcl9zdXNwZW5kKHN0cnVjdCBwY21jaWFfZGV2aWNlICpsaW5rKQogewotICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYgPSBsaW5rLT5wcml2OworCXN0cnVjdCBuZXRfZGV2aWNlICpkZXYgPSBsaW5rLT5wcml2OwogCi0gICAgLy9pZiAobGluay0+b3BlbikgeworCS8qIGlmIChsaW5rLT5vcGVuKSB7ICovCiAJbmV0aWZfZGV2aWNlX2RldGFjaChkZXYpOwogCXdsX3N1c3BlbmQoZGV2KTsKLS8vLy8gQ0hFQ0shICAgICAgICAgICAgcGNtY2lhX3JlbGVhc2VfY29uZmlndXJhdGlvbihsaW5rLT5oYW5kbGUpOwotICAgIC8vfQorCS8qIENIRUNLISBwY21jaWFfcmVsZWFzZV9jb25maWd1cmF0aW9uKGxpbmstPmhhbmRsZSk7ICovCisJLyogfSAqLwogCi0gICAgcmV0dXJuIDA7Ci19IC8vIHdsX2FkYXB0ZXJfc3VzcGVuZAorCXJldHVybiAwOworfSAvKiB3bF9hZGFwdGVyX3N1c3BlbmQgKi8KIAogc3RhdGljIGludCB3bF9hZGFwdGVyX3Jlc3VtZShzdHJ1Y3QgcGNtY2lhX2RldmljZSAqbGluaykKIHsKQEAgLTI2NiwxMCArMjYzLDEwIEBACiAKIAl3bF9yZXN1bWUoZGV2KTsKIAotCW5ldGlmX2RldmljZV9hdHRhY2goIGRldiApOworCW5ldGlmX2RldmljZV9hdHRhY2goZGV2KTsKIAogCXJldHVybiAwOwotfSAvLyB3bF9hZGFwdGVyX3Jlc3VtZQorfSAvKiB3bF9hZGFwdGVyX3Jlc3VtZSAqLwogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICoJd2xfYWRhcHRlcl9pbnNlcnQoKQpAQCAtMjkxLDYwICsyODgsNjAgQEAKICAqICAgICAgTi9BCiAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXZvaWQgd2xfYWRhcHRlcl9pbnNlcnQoIHN0cnVjdCBwY21jaWFfZGV2aWNlICpsaW5rICkKK3ZvaWQgd2xfYWRhcHRlcl9pbnNlcnQoc3RydWN0IHBjbWNpYV9kZXZpY2UgKmxpbmspCiB7Ci0gICAgc3RydWN0IG5ldF9kZXZpY2UgICAgICAgKmRldjsKLSAgICBpbnQgaTsKLSAgICBpbnQgICAgICAgICAgICAgICAgICAgICByZXQ7Ci0gICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworCXN0cnVjdCBuZXRfZGV2aWNlICpkZXY7CisJaW50IGk7CisJaW50IHJldDsKKwkvKi0tLS0tLS0tLS0tLS0tL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yAiLAotICAgICAgICAgICAgICAgZGV2LT5uYW1lLCBkZXYtPmJhc2VfYWRkciwgZGV2LT5pcnEpOwotICAgIGZvciggaSA9IDA7IGkgPCBFVEhfQUxFTjsgaSsrICkgewotICAgICAgICBwcmludGsoIiUwMlglYyIsIGRldi0+ZGV2X2FkZHJbaV0sICgoaSA8IChFVEhfQUxFTi0xKSkgPyAnOicgOiAnXG4nKSk7Ci0gICAgfQorCXByaW50ayhLRVJOX0lORk8gIiVzOiBXaXJlbGVzcywgaW9fYWRkciAlIzAzbHgsIGlycSAlZCwgIiJtYWNfYWRkcmVzcyAiLAorCQlkZXYtPm5hbWUsIGRldi0+YmFzZV9hZGRyLCBkZXYtPmlycSk7CisJZm9yIChpID0gMDsgaSA8IEVUSF9BTEVOOyBpKyspCisJCXByaW50aygiJTAyWCVjIiwgZGV2LT5kZXZfYWRkcltpXSwgKChpIDwgKEVUSF9BTEVOLTEpKSA/ICc6JyA6ICdcbicpKTsKIAotICAgIERCR19MRUFWRSggRGJnSW5mbyApOwotICAgIHJldHVybjsKKwlEQkdfTEVBVkUoRGJnSW5mbyk7CisJcmV0dXJuOwogCiBmYWlsZWQ6Ci0gICAgd2xfYWRhcHRlcl9yZWxlYXNlKCBsaW5rICk7CisJd2xfYWRhcHRlcl9yZWxlYXNlKGxpbmspOwogCi0gICAgREJHX0xFQVZFKERiZ0luZm8pOwotICAgIHJldHVybjsKLX0gLy8gd2xfYWRhcHRlcl9pbnNlcnQKKwlEQkdfTEVBVkUoRGJnSW5mbyk7CisJcmV0dXJuOworfSAvKiB3bF9hZGFwdGVyX2luc2VydCAqLwogLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KIAogCkBAIC0zNjcsMzggKzM2NCwzNiBAQAogICogICAgICBlcnJubyB2YWx1ZSBvdGhlcndpc2UKICAqCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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SU5GTyApOwotICAgIERCR19QQVJBTSggRGJnSW5mbywgImRldiIsICIlcyAoMHglcCkiLCBkZXYtPm5hbWUsIGRldiApOworCWlmICghcGNtY2lhX2Rldl9wcmVzZW50KGxpbmspKSB7CisJCURCR19MRUFWRShEYmdJbmZvKTsKKwkJcmV0dXJuIC1FTk9ERVY7CisJfQogCi0gICAgaWYoIXBjbWNpYV9kZXZfcHJlc2VudChsaW5rKSkKLSAgICB7Ci0gICAgICAgIERCR19MRUFWRSggRGJnSW5mbyApOwotICAgICAgICByZXR1cm4gLUVOT0RFVjsKLSAgICB9CisJbGluay0+b3BlbisrOwogCi0gICAgbGluay0+b3BlbisrOworCWhjZl9zdGF0dXMgPSB3bF9vcGVuKGRldik7CiAKLSAgICBoY2Zfc3RhdHVzID0gd2xfb3BlbiggZGV2ICk7CisJaWYgKGhjZl9zdGF0dXMgIT0gSENGX1NVQ0NFU1MpIHsKKwkJbGluay0+b3Blbi0tOworCQlyZXN1bHQgPSAtRU5PREVWOworCX0KIAotICAgIGlmKCBoY2Zfc3RhdHVzICE9IEhDRl9TVUNDRVNTICkgewotICAgICAgICBsaW5rLT5vcGVuLS07Ci0gICAgICAgIHJlc3VsdCA9IC1FTk9ERVY7Ci0gICAgfQotCi0gICAgREJHX0xFQVZFKCBEYmdJbmZvICk7Ci0gICAgcmV0dXJuIHJlc3VsdDsKLX0gLy8gd2xfYWRhcHRlcl9vcGVuCisJREJHX0xFQVZFKERiZ0luZm8pOworCXJldHVybiByZXN1bHQ7Cit9IC8qIHdsX2FkYXB0ZXJfb3BlbiAqLwogLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KIAogCkBAIC00MjEsNTYgKzQxNiw1NSBAQAogICogICAgICBlcnJubyB2YWx1ZSBvdGhlcndpc2UKICAqCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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fSAvLyB3bF9hZGFwdGVyX2luaXRfbW9kdWxlCisJREJHX0xFQVZFKERiZ0luZm8pOworCXJldHVybiByZXQ7Cit9IC8qIHdsX2FkYXB0ZXJfaW5pdF9tb2R1bGUgKi8KIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKIApAQCAtNTI4LDE4ICs1MjEsMTggQEAKICAqICAgICAgTi9BCiAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXZvaWQgd2xfYWRhcHRlcl9jbGVhbnVwX21vZHVsZSggdm9pZCApCit2b2lkIHdsX2FkYXB0ZXJfY2xlYW51cF9tb2R1bGUodm9pZCkKIHsKLSAgICBEQkdfRlVOQyggIndsX2FkYXB0ZXJfY2xlYW51cF9tb2R1bGUiICk7Ci0gICAgREJHX0VOVEVSKCBEYmdJbmZvICk7Ci0gICAgREJHX1RSQUNFKCBEYmdJbmZvLCAid2xfYWRhcHRlcl9jbGVhbnVwX21vZHVsZSgpIC0tIFBDTUNJQVxuIiApOworCURCR19GVU5DKCJ3bF9hZGFwdGVyX2NsZWFudXBfbW9kdWxlIik7CisJREJHX0VOVEVSKERiZ0luZm8pOworCURCR19UUkFDRShEYmdJbmZvLCAid2xfYWRhcHRlcl9jbGVhbnVwX21vZHVsZSgpIC0tIFBDTUNJQVxuIik7CiAKIAotICAgIHBjbWNpYV91bnJlZ2lzdGVyX2RyaXZlcigmd2xhZ3M0OV9kcml2ZXIpOworCXBjbWNpYV91bnJlZ2lzdGVyX2RyaXZlcigmd2xhZ3M0OV9kcml2ZXIpOwogCi0gICAgREJHX0xFQVZFKCBEYmdJbmZvICk7Ci0gICAgcmV0dXJuOwotfSAvLyB3bF9hZGFwdGVyX2NsZWFudXBfbW9kdWxlCisJREJHX0xFQVZFKERiZ0luZm8pOworCXJldHVybjsKK30gLyogd2xfYWRhcHRlcl9jbGVhbnVwX21vZHVsZSAqLwogLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KIAogCkBAIC01NjIsMTcgKzU1NSwxNiBAQAogICogICAgICAwIG90aGVyd2lzZQogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1pbnQgd2xfYWRhcHRlcl9pc19vcGVuKCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2ICkKK2ludCB3bF9hZGFwdGVyX2lzX29wZW4oc3RydWN0IG5ldF9kZXZpY2UgKmRldikKIHsKLSAgICBzdHJ1Y3Qgd2xfcHJpdmF0ZSAqbHAgPSB3bF9wcml2KGRldik7Ci0gICAgc3RydWN0IHBjbWNpYV9kZXZpY2UgKmxpbmsgPSBscC0+bGluazsKKwlzdHJ1Y3Qgd2xfcHJpdmF0ZSAqbHAgPSB3bF9wcml2KGRldik7CisJc3RydWN0IHBjbWNpYV9kZXZpY2UgKmxpbmsgPSBscC0+bGluazsKIAotICAgIGlmKCFwY21jaWFfZGV2X3ByZXNlbnQobGluaykpIHsKLSAgICAgICAgcmV0dXJuIDA7Ci0gICAgfQorCWlmICghcGNtY2lhX2Rldl9wcmVzZW50KGxpbmspKQorCQlyZXR1cm4gMDsKIAotICAgIHJldHVybiggbGluay0+b3BlbiApOwotfSAvLyB3bF9hZGFwdGVyX2lzX29wZW4KKwlyZXR1cm4gbGluay0+b3BlbjsKK30gLyogd2xfYWRhcHRlcl9pc19vcGVuICovCiAvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwogCiAKQEAgLTU5Niw5NyArNTg4LDk1IEBACiAgKiAgICAgIGEgcG9pbnRlciB0byBhIHN0cm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Y2ltYWwgZGlnaXQgY2hhcmFjdGVyCi0gKgotICogIFJFVFVSTlM6Ci0gKgotICogICAgICB0aGUgY29udmVydGVkIGludGVnZXIKLSAqCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotaW50IGhleGRpZ2l0MmludCggY2hhciBjICkKLXsKLSAgIGlmKCBjID49ICcwJyAmJiBjIDw9ICc5JyApCi0gICAgICAgcmV0dXJuIGMgLSAnMCc7Ci0KLSAgIGlmKCBjID49ICdBJyAmJiBjIDw9ICdGJyApCi0gICAgICAgcmV0dXJuIGMgLSAnQScgKyAxMDsKLQotICAgaWYoIGMgPj0gJ2EnICYmIGMgPD0gJ2YnICkKLSAgICAgICByZXR1cm4gYyAtICdhJyArIDEwOwotCi0gICByZXR1cm4gMDsKLX0gLy8gaGV4ZGlnaXQyaW50Ci0vKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwotCi0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICoJa2V5X3N0cmluZzJrZXkoKQogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICAqCkBAIC0zMjgsNyArMjkzLDcgQEAKICAgICAgICAgcCA9IChjaGFyICopa2V5LT5rZXk7CiAKICAgICAgICAgZm9yKCBpID0gMjsgaSA8IGw7IGkrPTIgKSB7Ci0gICAgICAgICAgICpwKysgPSAoIGhleGRpZ2l0MmludCgga3NbaV0gKSA8PCA0ICkgKyBoZXhkaWdpdDJpbnQgKGtzW2krMV0gKTsKKwkJCSpwKysgPSAoaGV4X3RvX2Jpbihrc1tpXSkgPDwgNCkgKyBoZXhfd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xlX2RvdDExV0VQRGVmYXVsdEtleTM7CisJCWJyZWFrOworCisJZGVmYXVsdDoKKwkJZXJyID0gLUVJTlZBTDsKKwkJZ290byBleGl0OworCX0KKworCXJlc3VsdCA9IHByaXNtMl9kb21pYnNldF9wc3RyMzIod2xhbmRldiwgZGlkLCAxMywgIjAwMDAwMDAwMDAwMDAiKTsKKworZXhpdDoKKwlpZiAocmVzdWx0KQorCQllcnIgPSAtRUZBVUxUOworCisJcmV0dXJuIGVycjsKK30KKworaW50IHByaXNtMl9zZXRfZGVmYXVsdF9rZXkoc3RydWN0IHdpcGh5ICp3aXBoeSwgc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKwkJCSAgIHU4IGtleV9pbmRleCkKK3sKKwl3bGFuZGV2aWNlX3QgKndsYW5kZXYgPSBkZXYtPm1sX3ByaXY7CisKKwlpbnQgZXJyID0gMDsKKwlpbnQgcmVzdWx0ID0gMDsKKworCXJlc3VsdCA9IHByaXNtMl9kb21pYnNldF91aW50MzIod2xhbmRldiwKKwkJRElEbWliX2RvdDExc210X2RvdDExUHJpdmFjeVRhYmxlX2RvdDExV0VQRGVmYXVsdEtleUlELAorCQlrZXlfaW5kZXgpOworCisJaWYgKHJlc3VsdCkKKwkJZXJyID0gLUVGQVVMVDsKKworCXJldHVybiBlcnI7Cit9CisKKworaW50IHByaXNtMl9nZXRfc3RhdGlvbihzdHJ1Y3Qgd2lwaHkgKndpcGh5LCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorCQkgICAgICAgdTggKm1hYywgc3RydWN0IHN0YXRpb25faW5mbyAqc2luZm8pCit7CisJd2xhbmRldmljZV90ICp3bGFuZGV2ID0gZGV2LT5tbF9wcml2OworCXN0cnVjdCBwODAyMTFtc2dfbG54cmVxX2NvbW1zcXVhbGl0eSBxdWFsaXR5OworCWludCByZXN1bHQ7CisKKwltZW1zZXQoc2luZm8sIDAsIHNpemVvZigqc2luZm8pKTsKKworCWlmICgod2xhbmRldiA9PSBOVUxMK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AmJgogCQkJCQkoWEdJMjFfTENEQ2FwTGlzdFttXS5MVkRTVkRFID09IFhHSWJpb3NfbW9kZVt4Z2lmYl9tb2RlX2lkeF0ueXJlcykpIHsKIAkJCQkJCVhHSU5ld19TZXRSZWcxKCBYR0lfUHIuUDNkNCAsIDB4MzYsIG0pIDsKQEAgLTMzNDEsMTQgKzMyNTYsMTQgQEAKIAkgICAgICAgICAgaW5YR0lJRFhSRUcoWEdJQ1IsMHgzOCx0bXApOwogCQkgICAgICBpZigodG1wICYgMHgwMykgPT0gMHgwMykKIAkJICAgICAgewotLy8JCSAgICAgICAgICBYR0lfUHIuWEdJX1VzZUxDREEgPSBUUlVFOworLyoJCSAgICAgICAgICBYR0lfUHIuWEdJX1VzZUxDREEgPSAxOyAqLwogCQkgICAgICB9ZWxzZQogCQkgICAgICB7CiAJCSAgICAgLy8gIEN1cnJlbnRseSBvbiBMQ0RBPyAoU29tZSBuZXdlciBCSU9TZXMgc2V0IEQwIGluIENSMzUpCiAJCSAgICAgICAgIGluWEdJSURYUkVHKFhHSUNSLDB4MzUsdG1wKTsKIAkJICAgICAgICAgaWYodG1wICYgMHgwMSkKIAkJICAgICAgICAgewotLy8JCSAgICAgICAgICAgICAgWEdJX1ByLlhHSV9Vc2VMQ0RBID0gVFJVRTsKKy8qCQkgICAgICAgICAgICAgIFhHSV9Qci5YR0lfVXNlTENEQSA9IDE7ICovCiAJCSAgICAgICAgICAgfWVsc2UKIAkJICAgICAgICAgICB7CiAJCSAgICAgICAgICAgICAgIGluWEdJSURYUkVHKFhHSUNSLDB4MzAsdG1wKTsKQEAgLTMzNTcsNyArMzI3Miw3IEBACiAJCSAgICAgICAgICAgICAgICAgICBpblhHSUlEWFJFRyhYR0lQQVJUMSwweDEzLHRtcCk7CiAJCQkgICAgICAgICAgICAgICBpZih0bXAgJiAweDA0KQogCQkJICAgICAgICAgICAgICAgewotLy8JCQkgICAgICAgICAgICAgICAgWEdJX1ByLlhHSV9Vc2VMQ0RBID0gVFJ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pbmUgX09TREVGX0hfCi0KLS8qICNkZWZpbmUgV0lOQ0VfSEVBREVSKi8KLS8qI2RlZmluZSBXSU4yMDAwKi8KLS8qICNkZWZpbmUgVEMgKi8KLSNkZWZpbmUgTElOVVhfS0VSTkVMCi0vKiAjZGVmaW5lIExJTlVYX1hGODYgKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0jaWZkZWYgTElOVVhfS0VSTkVMCi0vLyNpbmNsdWRlIDxsaW51eC9jb25maWcuaD4KLSNlbmRpZgotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotI2lmZGVmIFRDCi0jZW5kaWYKLSNpZmRlZiBXSU4yMDAwCi0jZW5kaWYKLSNpZmRlZiBXSU5DRV9IRUFERVIKLSNlbmRpZgotI2lmZGVmIExJTlVYX1hGODYKLSNkZWZpbmUgTElOVVgKLSNlbmRpZgotI2lmZGVmIExJTlVYX0tFUk5FTAotI2RlZmluZSBMSU5VWAotI2VuZGlmCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotI2lmZGVmIFRDCi0jZGVmaW5lIFhHSV9TZXRNZW1vcnkoTWVtb3J5QWRkcmVzcyxNZW1vcnlTaXplLHZhbHVlKSBtZW1zZXQoTWVtb3J5QWRkcmVzcywgdmFsdWUsIE1lbW9yeVNpemUpOwotI2VuZGlmCi0jaWZkZWYgV0lOMjAwMAotI2RlZmluZSBYR0lfU2V0TWVtb3J5KE1lbW9yeUFkZHJlc3MsTWVtb3J5U2l6ZSx2YWx1ZSkgTWVtRmlsbCgoUFZPSUQpIE1lbW9yeUFkZHJlc3MsKFVMT05HKSBNZW1vcnlTaXplLChVQ0hBUikgdmFsdWUpOwotI2VuZGlmCi0jaWZkZWYgV0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qKioqKioqKioqKioqKi8KLS8qICBUQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpZmRlZiBUQwotI2RlZmluZSBPdXRQb3J0Qnl0ZShwLHYpIG91dHAoKHVuc2lnbmVkIHNob3J0KShwKSwodW5zaWduZWQgY2hhcikodikpCi0jZGVmaW5lIE91dFBvcnRXb3JkKHAsdikgb3V0cCgodW5zaWduZWQgc2hvcnQpKHApLCh1bnNpZ25lZCBzaG9ydCkodikpCi0jZGVmaW5lIE91dFBvcnRMb25nKHAsdikgb3V0cCgodW5zaWduZWQgc2hvcnQpKHApLCh1bnNpZ25lZCBsb25nKSh2KSkKLSNkZWZpbmUgSW5Qb3J0Qnl0ZShwKSAgICBpbnAoKHVuc2lnbmVkIHNob3J0KShwKSkKLSNkZWZpbmUgSW5Qb3J0V29yZChwKSAgICBpbnAoKHVuc2lnbmVkIHNob3J0KShwKSkKLSNkZWZpbmUgSW5Qb3J0TG9uZyhwKSAgICAoKGlucCgodW5zaWduZWQgc2hvcnQpKHArMikpPDwxNikgfCBpbnAoKHVuc2lnbmVkIHNob3J0KShwKSkpCi0jZW5kaWYKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgTElOVVggWEY4NiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaWZkZWYgTElOVVhfWEY4NgotI2RlZmluZSBPdXRQb3J0Qnl0ZShwLHYpIG91dGIoKENBUkQxNikocCksKENBUkQ4KSh2KSkKLSNkZWZpbmUgT3V0UG9ydFdvcmQocCx2KSBvdXR3KChDQVJEMTYpKHApLChDQVJEMTYpKHYpKQotI2RlZmluZSBPdXRQb3J0TG9uZyhwLHYpIG91dGwoKENBUkQxNikocCksKENBUkQzMikodikpCi0jZGVmaW5lIEluUG9ydEJ5dGUocCkgICAgaW5iKChDQVJEMTYpKHApKQotI2RlZmluZSBJblBvcnRXb3JkKHApICAgIGludygoQ0FSRDE2KShwKSkKLSNkZWZpbmUgSW5Qb3J0TG9uZyhwKSAgICBpbmwoKENBUkQxNikocCkpCi0jZW5kaWYKLQotI2lmZGVmIExJTlVYX0tFUk5FTAotI2RlZmluZSBPdXRQb3J0Qnl0ZShwLHYpIG91dGIoKHU4KSh2KSwocCkpCi0jZGVmaW5lIE91dFBvcnRXb3JkKHAsdikgb3V0dygodTE2KSh2KSwocCkpCi0jZGVmaW5lIE91dFBvcnRMb25nKHAsdikgb3V0bCgodTMyKSh2KSwocCkpCi0jZGVmaW5lIEluUG9ydEJ5dGUocCkgICAgaW5iKHApCi0jZGVmaW5lIEluUG9ydFdvcmQocCkgICAgaW53KHApCi0jZGVmaW5lIEluUG9ydExvbmcocCkgICAgaW5sKHApCi0jZW5kaWYKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgV0lOIDIwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaWZkZWYgV0lOMjAwMAotI2RlZmluZSBPdXRQb3J0Qnl0ZShwLHYpIFZpZGVvUG9ydFdyaXRlUG9ydFVjaGFyICgoUFVDSEFSKSAocCksIChVQ0hBUikgKHYpKQotI2RlZmluZSBPdXRQb3J0V29yZChwLHYpIFZpZGVvUG9ydFdyaXRlUG9ydFVzaG9ydCgoUFVTSE9SVCkgKHApLCAoVVNIT1JUKSAodikpCi0jZGVmaW5lIE91dFBvcnRMb25nKHAsdikgVmlkZW9Qb3J0V3JpdGVQb3J0VWxvbmcgKChQVUxPTkcpIChwKSwgKFVMT05HKSAodikpCi0jZGVmaW5lIEluUG9ydEJ5dGUocCkgICAgVmlkZW9Qb3J0UmVhZFBvcnRVY2hhciAgKChQVUNIQVIpIChwKSkKLSNkZWZpbmUgSW5Qb3J0V29yZChwKSAgICBWaWRlb1BvcnRSZWFkUG9ydFVzaG9ydCAoKFBVU0hPUlQpIChwKSkKLSNkZWZpbmUgSW5Qb3J0TG9uZyhwKSAgICBWaWRlb1BvcnRSZWFkUG9ydFVsb25nICAoKFBVTE9ORykgKHApKQotI2VuZGlmCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgV0lOIENFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2lmZGVmIFdJTkNFX0hFQURFUgotI2RlZmluZSBPdXRQb3J0Qnl0ZShwLHYpIFdSSVRFX1BPUlRfVUNIQVIgKChQVUNIQVIpIChwKSwgKFVDSEFSKSAodikpCi0jZGVmaW5lIE91dFBvcnRXb3JkKHAsdikgV1JJVEVfUE9SVF9VU0hPUlQoKFBVU0hPUlQpIChwKSwgKFVTSE9SVCkgKHYpKQotI2RlZmluZSBPdXRQb3J0TG9uZyhwLHYpIFdSSVRFX1BPUlRfVUxPTkcgKChQVUxPTkcpIChwKSwgKFVMT05HKSAodikpCi0jZGVmaW5lIEluUG9ydEJ5dGUocCkgICAgUkVBRF9QT1JUX1VDSEFSICAoKFBVQ0hBUikgKHApKQotI2RlZmlu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IDsKLSAgICBVTE9ORyB1bEJ1ZmZlclNpemUgPSAyNTYgOwotICAgIFVDSEFSIGJNQVNLX09VVFBVVFNUQVRFX0NSVDJMQ0QgPSAyIDsgLyogMDQyMyBzaGFtcG9vICovCi0KLSAgICBiR2V0RGRjSW5mbyggcEhXREUgLCBNQVNLX09VVFBVVFNUQVRFX0NSVDJMQ0QgLCBwakVESURCdWYgLCB1bEJ1ZmZlclNpemUgKSA7Ci0gICAgaWYgKCAoICooICggUFVMT05HIClwakVESURCdWYgKSA9PSAweEZGRkZGRjAwICkgJiYgKCAqKCAoIFBVTE9ORyApKCBwakVESURCdWYgKyA0ICkgKSA9PSAweDAwRkZGRkZGICkgKQotICAgIHsKLSAgICAgICAgdGVtcGFoID0gUGFuZWwxMDI0eDc2OCA7Ci0gICAgICAgIHRlbXBibD0oICooIHBqRURJREJ1ZiArIDB4M0EgKSApICYgMHhmMCA7Ci0KLSAgICAgICAgaWYgKCB0ZW1wYmwgIT0gMHg0MCApCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRlbXBhaCA9IFBhbmVsMTYwMHgxMjAwIDsKLSAgICAgICAgICAgIGlmICggdGVtcGJsICE9IDB4NjAgKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRlbXBhaCA9IFBhbmVsMTI4MHgxMDI0IDsKLSAgICAgICAgICAgICAgICB0ZW1wYmggPSAoICooIHBqRURJREJ1ZiArIDB4M0IgKSApIDsKLSAgICAgICAgICAgICAgICBpZiAoIHRlbXBiaCAhPSAweDAwICkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHRlbXBhaCA9IFBhbmVsMTI4MHg5NjAgOwotICAgICAgICAgICAgICAgICAgICBpZiAoIHRlbXBiaCAhPSAweDBDMCApCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBieCA9ICggKCAqKCBwakVESURCdWYgKyAweDI0ICkgKSA8PCA4ICkgfCAoICooIHBqRURJREJ1ZiArIDB4MjMgKSApIDsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBhaCA9IFBhbmVsMTI4MHgxMDI0IDsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICggISggdGVtcGJ4ICYgMHgwMTAwICkgKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBhaCA9IFBhbmVsMTAyNHg3NjggOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICggISggdGVtcGJ4ICYgMHgwRTAwICkgKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcGFoID0gUGFuZWwxMjgweDEwMjQgOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIGlmICggdGVtcGJ4ICYgMHgwMEZGICkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgdGVtcCA9IFNjYWxpbmdMQ0QgOwotICAgICAgICAgICAgICAgICAgICAgICAgWEdJTmV3X1NldFJlZ09SKCBwVkJJbmZvLT5QM2Q0ICwgMHgzNyAsIHRlbXAgKSA7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgWEdJTmV3X1NldFJlZ0FORE9SKCBwVkJJbmZvLT5QM2Q0ICwgMHgzNiAsICggfjB4MDcgKSAsIHRlbXBhaCApIDsKLSAgICAgICAgdGVtcGFoID0gKCAoICooIHBqRURJREJ1ZiArIDB4NDcgKSApICYgMHgwNiApIDsJCS8qIFBvbGFyaXR5ICovCi0gICAgICAgIHRlbXBhaCA9ICggdGVtcGFoIF4gMHgwNiApIDw8IDQgOwotICAgICAgICB0ZW1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nNlKHRlbXBieCAsIHRlbXBjeCwgcFZCSW5mbykgKQotICAgICAgICAgICAgICAgIGJDb25uZWN0U3RhdHVzfD0gQVZJREVPU2Vuc2UgOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKCAhKCBiQ29ubmVjdFN0YXR1cyAmIFNWSURFT1NlbnNlICkgKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRlbXBieCA9IFhHSTMzMF9WaWRlb1NlbnNlRGF0YTIgOwotICAgICAgICAgICAgICAgIHRlbXBjeCA9IDB4MDgwNCA7Ci0gICAgICAgICAgICAgICAgaWYgKCBYR0lOZXdfU2Vuc2UoIHRlbXBieCAsIHRlbXBjeCwgcFZCSW5mbyApICkKLSAgICAgICAgICAgICAgICAgICAgYkNvbm5lY3RTdGF0dXMgfD0gQVZJREVPU2Vuc2UgOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgCX0gLyogZW5kICovCi0gICAgICAgIC8qIER5U2Vuc2VWQkNudCAqLwotCi0gICAgICAgIHRlbXBieCA9IDAgOwotICAgICAgICB0ZW1wY3ggPSAwIDsKLSAgICAgICAgWEdJTmV3X1NlbnNlKHRlbXBieCAsIHRlbXBjeCwgcFZCSW5mbyApIDsKLQotICAgICAgICBpZiAoICEoIGJDb25uZWN0U3RhdHVzICYgTW9uaXRvcjJTZW5zZSApICkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKCBYR0lfU2Vuc2VMQ0QoIHBIV0RFICwgcFZCSW5mbyApICkKLSAgICAgICAgICAgICAgICBiQ29ubmVjdFN0YXR1cyB8PSBMQ0RTZW5zZSA7Ci0gICAgICAgIH0KLQotICAgICAgICBYR0lOZXdfU2V0UmVnQU5ET1IoIHBWQkluZm8tPlAzZDQgLCAweDMyICwgfiggQVZJREVPU2Vuc2UgfCBTVklERU9TZW5zZSB8IExDRFNlbnNlIHwgTW9uaXRvcjJTZW5zZSB8IE1vbml0b3IxU2Vuc2UgKSAsIGJDb25uZWN0U3RhdHVzICkgOwotCi0gICAgICAgIFhHSU5ld19TZXRSZWcxKCBwVkJJbmZvLT5QYXJ0NFBvcnQgLCAweDBEICwgcHJlX1BhcnQ0X0QgKSA7Ci0gICAgICAgIFhHSU5ld19TZXRSZWcxKCBwVkJJbmZvLT5QYXJ0MlBvcnQgLCAweDAwICwgcHJlX1BhcnQyXzAgKSA7Ci0gICAgICAgIFhHSU5ld19TZXRSZWcxKCBwVkJJbmZvLT5QM2M0ICwgMHgxRSAsIHByZV9TUjFFICkgOwotCi0gICAgICAgIGlmICggWEdJX0lzMzAxQyggcFZCSW5mbyApICkJLyogMzAxQyBvbmx5ICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRlbXBheCA9IFhHSU5ld19HZXRSZWcxKCBwVkJJbmZvLT5QYXJ0MlBvcnQgLCAweDAwICkgOwotICAgICAgICAgICAgaWYgKCB0ZW1wYXggJiAweDIwICkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKiBSZXNldCBWQlBybyAqLwotICAgICAgICAgICAgICAgIGZvciggdGVtcGN4ID0gMiA7IHRlbXBjeCA+IDAgOyB0ZW1wY3gtLSApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICB0ZW1wYXggXj0gMHgyMCA7Ci0gICAgICAgICAgICAgICAgICAgIFhHSU5ld19TZXRSZWcxKCBwVkJJbmZvLT5QYXJ0MlBvcnQgLCAweDAwICwgdGVtcGF4ICkgOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICAvKiBFbmQgb2YgZHluYW1pYyBzZW5zZSBWQiAqLwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBYR0lfU2Vuc2VDUlQxKHBWQkluZm8pIDsKLSAgICAgICAgWEdJX0dldFNlbnNlU3RhdHVzKCBId0RldmljZUV4dGVuc2lvbiwgcFZCSW5mbyApIDsJLyogc2Vuc2UgQ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ld19TZXRSZWcxKCBwVkJJbmZvLT5QM2M0ICwgMHgxZiAsICggVUNIQVIgKSggdGVtcCB8IDB4NDAgKSApIDsKKwkgICAgWEdJTmV3X1NldFJlZzEocFZCSW5mby0+UDNjNCwgMHgxZiwgKHVuc2lnbmVkIGNoYXIpKHRlbXAgfCAweDQwKSk7CiAgICAgICAgICAgICBicmVhayA7CiAgICAgICAgIGNhc2UgMHgwMDAwMDIwMDogLyogc3VzcGVuZCAqLwogICAgICAgICAgICAgaWYgKCBwWEdJSFdERS0+akNoaXBUeXBlID09IFhHMjEgKQpAQCAtNjA5LDEyICsyOTEsMTIgQEAKICAgICAgICAgICAgICAgICBYR0lfRGlzcGxheU9mZiggcFhHSUhXREUsIHBWQkluZm8gKTsKICAgICAgICAgICAgICAgICBYR0lfWEcyN0JMU2lnbmFsVkREKCAweDIwICwgMHgwMCwgcFZCSW5mbyApIDsgLyogTFZEUyBzaWduYWwgb2ZmICovCiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICBYR0lOZXdfU2V0UmVnMSggcFZCSW5mby0+UDNjNCAsIDB4MWYgLCAoIFVDSEFSICkoIHRlbXAgfCAweDgwICkgKSA7CisJICAgIFhHSU5ld19TZXRSZWcxKHBWQkluZm8tPlAzYzQsIDB4MWYsICh1bnNpZ25lZCBjaGFyKSh0ZW1wIHwgMHg4MCkpOwogICAgICAgICAgICAgYnJlYWsgOwogICAgICAgICBjYXNlIDB4MDAwMDA0MDA6IC8qIG9mZiAqLwogICAgICAgICAgICAgaWYgKCAocFhHSUhXREUtPnVqVkJDaGlwSUQgPT0gVkJfQ0hJUF8zMDEgKSB8fCAoIHBYR0lIV0RFLT51alZCQ2hpcElEID09IFZCX0NISVBfMzAyICkgKQogICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIFhHSU5ld19TZXRSZWcxKCBwVkJJbmZvLT5QM2M0ICwgMHgxZiAsICggVUNIQVIgKSggdGVtcCB8IDB4YzAgKSApIDsKKwkJWEdJTmV3X1NldFJ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2luZm8gKnBWQkluZm8pCiB7Ci0gICAgVVNIT1JUIFBhbmVsVHlwZVRhYmxlWyAxNiBdID0geyBTeW5jTk4gfCBQYW5lbFJHQjE4Qml0IHwgUGFuZWw4MDB4NjAwICB8IF9QYW5lbFR5cGUwMCAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTeW5jTk4gfCBQYW5lbFJHQjE4Qml0IHwgUGFuZWwxMDI0eDc2OCB8IF9QYW5lbFR5cGUwMSAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTeW5jTk4gfCBQYW5lbFJHQjE4Qml0IHwgUGFuZWw4MDB4NjAwICB8IF9QYW5lbFR5cGUwMiAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTeW5jTk4gfCBQYW5lbFJHQjE4Qml0IHwgUGFuZWw2NDB4NDgwICB8IF9QYW5lbFR5cGUwMyAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTeW5jTk4gfCBQYW5lbFJHQjE4Qml0IHwgUGFuZWwxMDI0eDc2OCB8IF9QYW5lbFR5cGUwNCAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTeW5jTk4gfCBQYW5lbFJHQjE4Qml0IHwgUGFuZWwxMDI0eDc2OCB8IF9QYW5lbFR5cGUwNSAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTeW5jTk4gfCBQYW5lbFJHQjE4Qml0IHwgUGFuZWwxMDI0eDc2OCB8IF9QYW5lbFR5cGUwNiAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTeW5jTk4gfCBQYW5lbFJHQjI0Qml0IHwgUGFuZWwxMDI0eDc2OCB8IF9QYW5lbFR5cGUwNyAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTeW5jTk4gfCBQYW5lbFJHQjE4Qml0IHwgUGFuZWw4MDB4NjAwICB8IF9QYW5lb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CBYR0lOZXdfRFJBTVR5cGVbMTddWzVdPXt7MHgwQywweDBBLDB4MDIsMHg0MCwweDM5fSx7MHgwRCwweDBBLDB4MDEsMHg0MCwweDQ4fSwKLSAgICAgICAgICAgICAgICAgICAgIHsweDBDLDB4MDksMHgwMiwweDIwLDB4MzV9LHsweDBELDB4MDksMHgwMSwweDIwLDB4NDR9LAotICAgICAgICAgICAgICAgICAgICAgezB4MEMsMHgwOCwweDAyLDB4MTAsMHgzMX0sezB4MEQsMHgwOCwweDAxLDB4MTAsMHg0MH0sCi0gICAgICAgICAgICAgICAgICAgICB7MHgwQywweDBBLDB4MDEsMHgyMCwweDM0fSx7MHgwQywweDA5LDB4MDEsMHgwOCwweDMyfSwKLSAgICAgICAgICAgICAgICAgICAgIHsweDBCLDB4MDgsMHgwMiwweDA4LDB4MjF9LHsweDBDLDB4MDgsMHgwMSwweDA4LDB4MzB9LAotICAgICAgICAgICAgICAgICAgICAgezB4MEEsMHgwOCwweDAyLDB4MDQsMHgxMX0sezB4MEIsMHgwQSwweDAxLDB4MTAsMHgyOH0sCi0gICAgICAgICAgICAgICAgICAgICB7MHgwOSwweDA4LDB4MDIsMHgwMiwweDAxfSx7MHgwQiwweDA5LDB4MDEsMHgwOCwweDI0fSwKLSAgICAgICAgICAgICAgICAgICAgIHsweDBCLDB4MDgsMHgwMSwweDA0LDB4MjB9LHsweDBBLDB4MDgsMHgwMSwweDAyLDB4MTB9LAotICAgICAgICAgICAgICAgICAgICAgezB4MDksMHgwOCwweDAxLDB4MDEsMHgwMH19OwordW5zaWduZWQgc2hvcnQgWEdJTmV3X0RSQU1UeXBlWzE3XVs1XSA9IHsKKwl7MHgwQywgMHgwQSwgMHgwMiwgMHg0MCwgMHgzOX0sIHsweDBELCAweDBBLCAweDAxLCAweDQwLCAweDQ4fSwKKwl7MHgwQywgMHgwOSwgMHgwMiwgMHgyMCwgMHgzNX0sIHsweDBELCAweDA5LCAweDAxLCAweDIwLCAweDQ0fSwKKwl7MHgwQyw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KLSAgICBVTE9ORyBUZW1wIDsKKyAgICB1bnNpZ25lZCBsb25nIFRlbXAgOwogCiAgICAgcFZCSW5mby0+Uk9NQWRkciA9IEh3RGV2aWNlRXh0ZW5zaW9uLT5walZpcnR1YWxSb21CYXNlIDsKIAogICAgIHBWQkluZm8tPkZCQWRkciA9IEh3RGV2aWNlRXh0ZW5zaW9uLT5walZpZGVvTWVtb3J5QWRkcmVzcyA7CiAKLSAgICBwVkJJbmZvLT5CYXNlQWRkciA9IChVTE9ORylId0RldmljZUV4dGVuc2lvbi0+cGpJT0FkZHJlc3MgOworICAgIHBWQkluZm8tPkJhc2VBZGRyID0gKHVuc2lnbmVkIGxvbmcpSHdEZXZpY2VFeHRlbnNpb24tPnBqSU9BZGRyZXNzIDsKIAotICAgIHBWaWRlb01lbW9yeSA9ICggUFVDSEFSIClwVkJJbmZvLT5ST01BZGRyOworICAgIHBWaWRlb01lbW9yeSA9ICh1bnNpZ25lZCBjaGFyICopcFZCSW5mby0+Uk9NQWRkcjsKIAogCiAvLyAgICBOZXdkZWJ1Z2NvZGUoIDB4OTkgKSA7CiAKIAogICAgLyogaWYgKCBwVkJJbmZvLT5ST01BZGRyID09IDAgKSAqLwotICAgLyogcmV0dXJuKCBGQUxTRSApIDsgKi8KKyAgIC8qIHJldHVybiggMCApIDsgKi8KIAotICAgIGlmICggcFZCSW5mby0+RkJBZGRyID09IDAgKQoteworICAgIGlmIChwVkJJbmZvLT5GQkFkZHIgPT0gMCkgewogICAgICAgIHByaW50aygiXG4gcFZCSW5mby0+RkJBZGRyID09IDAgIik7Ci0gICAgICAgcmV0dXJuKCBGQUxTRSApIDsKLX0KKyAgICAgICByZXR1cm4gMDsKKyAgICB9CiBwcmludGsoIjEiKTsKLSAgICBpZiAoIHBWQkluZm8tPkJhc2VBZGRyID09IDAgKQotewotICAgICAgIHByaW50aygiXG5wVkJJbmZvLT5CYXNlQWRkciA9PSAwICIpOwotICAgICAgICByZXR1cm4oIEZBTFNFICkgOworaWYg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gICAgICAgaWYgKCBId0RldmljZUV4dGVuc2lvbi0+YlNraXBEcmFtU2l6aW5nID09IFRSVUUgKQotICAgICAgICB7CisJaWYgKEh3RGV2aWNlRXh0ZW5zaW9uLT5iU2tpcERyYW1TaXppbmcgPT0gMSkgewogICAgICAgICAgICAgcFNSID0gSHdEZXZpY2VFeHRlbnNpb24tPnBTUiA7CiAgICAgICAgICAgICBpZiAoIHBTUiE9TlVMTCApCiAgICAgICAgICAgICB7CkBAIC01MTksMTUgKzQ3NCw2IEBACiAgICAgICAgIH0gICAJLyogU2tpcERyYW1TaXppbmcgKi8KICAgICAgICAgZWxzZQogICAgICAgICB7Ci0jaWYgMAotICAgICAgICAgICBpZiAoIEh3RGV2aWNlRXh0ZW5zaW9uLT5qQ2hpcFR5cGUgPT0gWEcyMCApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAJWEdJTmV3X1NldFJlZzEoIHBWQkluZm8tPlAzYzQgLCAweDEzICwgcFZCSW5mby0+U1IxNVswXVtYR0lOZXdfUkFNVHlwZV0gKSA7Ci0gICAgICAgICAgICAgICAgWEdJTmV3X1NldFJlZzEoIHBWQkluZm8tPlAzYzQgLCAweDE0ICwgcFZCSW5mby0+U1IxNVsxXVtYR0lOZXdfUkFNVHlwZV0gKSA7Ci0gICAgICAgICAgICAgICAgWEdJTmV3X1NldFJlZzEoIHBWQkluZm8tPlAzYzQgLCAweDIwICwgMHgyMCApIDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSNlbmRpZgogewogcHJpbnRrKCIyMCIpOwogCkBAIC01NDQsNyArNDkwLDcgQEAKICAgICAvKiBTZXREZWZFeHQyUmVncyBiZWdpbiAqLwogLyoKICAgICBBR1AgPSAxIDsKLSAgICB0ZW1wID0oIFVDSEFSIClYR0lOZXdfR2V0UmVnMSggcFZCSW5mby0+UDNjNCAsIDB4M0EgKSA7CisgICAgdGVtcCA9KHVuc2lnbmVkIGNoYXIpWEdJTmV3X0dldFJlZzEoc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uZyAqKSggcFZCSW5mby0+RkJBZGRyICkgKSA9IFBvc2l0aW9uIDsgKi8KKwkgICAgKigodW5zaWduZWQgbG9uZyAqKShwVkJJbmZvLT5GQkFkZHIgKyBQb3NpdGlvbikpID0gUG9zaXRpb247CisJICAgIFBvc2l0aW9uICs9IEluY3JlbWVudDsKICAgICB9CiAKICAgICBmb3IoIGkgPSAwICwgUG9zaXRpb24gPSAwIDsgaSA8IDIgOyBpKysgKQogICAgIHsKICAgICAgICAgLyogaWYgKCBwVkJJbmZvLT5GQkFkZHJbIFBvc2l0aW9uIF0gIT0gUG9zaXRpb24gKSAqLwotICAgICAgICAvKiBpZiAoICggKiggUFVMT05HICkoIHBWQkluZm8tPkZCQWRkciApICkgIT0gUG9zaXRpb24gKSAqLwotICAgICAgICBpZiAoICggKiggUFVMT05HICkoIHBWQkluZm8tPkZCQWRkciArIFBvc2l0aW9uICkgKSAhPSBQb3NpdGlvbiApCi0gICAgICAgICAgICByZXR1cm4oIDAgKSA7Ci0gICAgICAgIFBvc2l0aW9uICs9IEluY3JlbWVudCA7CisgICAgICAgIC8qIGlmICggKCAqKHVuc2lnbmVkIGxvbmcgKikoIHBWQkluZm8tPkZCQWRkciApICkgIT0gUG9zaXRpb24gKSAqLworCSAgICBpZiAoKCoodW5zaWduZWQgbG9uZyAqKShwVkJJbmZvLT5GQkFkZHIgKyBQb3NpdGlvbikpICE9IFBvc2l0aW9uKQorCQkgICAgcmV0dXJuIDA7CisJICAgIFBvc2l0aW9uICs9IEluY3JlbWVudDsKICAgICB9CiAgICAgcmV0dXJuKCAxICk7CiB9CkBAIC0xOTY1LDEwICsxOTM0LDEyIEBACiAvKiBPdXRwdXQgOiAqLwogLyogRGVzY3JpcHRpb24gOiAqLwogLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCi1pbnQgWEdJTmV3X0NoZWNrRERSUmF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yBdIDsKLSAgICAgICAgICAgIGlpICs9IDB4MDggOwotICAgICAgICB9Ci0KLSAgICAgICAgaSA9IHBWaWRlb01lbW9yeVsgMHgxQzAgXSB8ICggcFZpZGVvTWVtb3J5WyAweDFDMSBdIDw8IDggKSA7Ci0KLSAgICAgICAgZm9yKCBqID0gMCA7IGogPCA4IDsgaisrICkKLSAgICAgICAgewotICAgICAgICAgICAgZm9yKCBrID0gMCA7IGsgPCA0IDsgaysrICkKLSAgICAgICAgICAgICAgICBwVkJJbmZvLT5DUjZCWyBqIF1bIGsgXSA9IHBWaWRlb01lbW9yeVsgaSArIDQgKiBqICsgayBdIDsKLSAgICAgICAgfQotCi0gICAgICAgIGkgPSBwVmlkZW9NZW1vcnlbIDB4MUMyIF0gfCAoIHBWaWRlb01lbW9yeVsgMHgxQzMgXSA8PCA4ICkgOwotCi0gICAgICAgIGZvciggaiA9IDAgOyBqIDwgOCA7IGorKyApCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciggayA9IDAgOyBrIDwgNCA7IGsrKyApCi0gICAgICAgICAgICAgICAgcFZCSW5mby0+Q1I2RVsgaiBdWyBrIF0gPSBwVmlkZW9NZW1vcnlbIGkgKyA0ICogaiArIGsgXSA7Ci0gICAgICAgIH0KLQotICAgICAgICBpID0gcFZpZGVvTWVtb3J5WyAweDFDNCBdIHwgKCBwVmlkZW9NZW1vcnlbIDB4MUM1IF0gPDwgOCApIDsKLSAgICAgICAgZm9yKCBqID0gMCA7IGogPCA4IDsgaisrICkKLSAgICAgICAgewotICAgICAgICAgICAgZm9yKCBrID0gMCA7IGsgPCAzMiA7IGsrKyApCi0gICAgICAgICAgICAgICAgcFZCSW5mby0+Q1I2RlsgaiBdWyBrIF0gPSBwVmlkZW9NZW1vcnlbIGkgKyAzMiAqIGogKyBrIF0gOwotICAgICAgICB9Ci0KLSAgICAgICAgaSA9IHBWaWRlb01lbW9yeVsgMHgxQzYgXSB8ICggcFZpZGVvTWVtb3J5WyAweDFDNyBdIDw8IDggKSA7Ci0KLSAgICAgICAgZm9yKCBqID0gMCA7IGogPCA4IDsgaisrICkKLSAgICAgICAgewotICAgICAgICAgICAgZm9yKCBrID0gMCA7IGsgPCAyIDsgaysrICkKLSAgICAgICAgICAgICAgICBwVkJJbmZvLT5DUjg5WyBqIF1bIGsgXSA9IHBWaWRlb01lbW9yeVsgaSArIDIgKiBqICsgayBdIDsKLSAgICAgICAgfQotCi0gICAgICAgIGkgPSBwVmlkZW9NZW1vcnlbIDB4MUM4IF0gfCAoIHBWaWRlb01lbW9yeVsgMHgxQzkgXSA8PCA4ICkgOwotICAgICAgICBmb3IoIGogPSAwIDsgaiA8IDEyIDsgaisrICkKLSAgICAgICAgICAgIHBWQkluZm8tPkFHUFJlZ1sgaiBdID0gcFZpZGVvTWVtb3J5WyBpICsgaiBdIDsKLQotICAgICAgICBpID0gcFZpZGVvTWVtb3J5WyAweDFDRiBdIHwgKCBwVmlkZW9NZW1vcnlbIDB4MUQwIF0gPDwgOCApIDsKLSAgICAgICAgZm9yKCBqID0gMCA7IGogPCA0IDsgaisrICkKLSAgICAgICAgICAgIHBWQkluZm8tPlNSMTZbIGogXSA9IHBWaWRlb01lbW9yeVsgaSArIGogXSA7Ci0KLSAgICAgICAgaWYgKCBDaGlwVHlwZSA9PSBYRzIxICkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKHBWaWRlb01lbW9yeVsgMHg2NyBdICYgMHg4MCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAqcFZCSW5mby0+cERWT1NldHRpbmcgPSBwVmlkZW9NZW1vcnlbIDB4NjcgXTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmICggKHBWaWRlb01lbW9yeVsgMHg2NyBdICYgMHhDMCkgPT0gMHhDMCApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgKnBWQkluZm8tPnBDUjJFID0gcFZpZGVvTWVtb3J5WyBpICsgNCBdIDsKLSAgICAgICAgICAgICAgICAqcFZCSW5mby0+cENSMkYgPSBwVmlkZW9NZW1vcnlbIGkgKyA1IF0gOwotICAgICAgICAgICAgICAgICpwVkJJbmZvLT5wQ1I0NiA9IHBWaWRlb01lbW9yeVsgaSArIDYgXSA7Ci0gICAgICAgICAgICAgICAgKnBWQkluZm8tPnBDUjQ3ID0gcFZpZGVvTWVtb3J5WyBpICsgNyBdIDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmICggQ2hpcFR5cGUgPT0gWEcyNyApCi0gICAgICAgIHsKLSAgICAgICAgICAgIGpqID0gaStqOwotICAgICAgICAgICAgZm9yKCBpID0gMCA7IGkgPD0gMHhCIDsgaSsrLGpqKysgKQotICAgICAgICAgICAgICBwVkJJbmZvLT5wQ1JEMFtpXSA9IHBWaWRlb01lbW9yeVsgamogXSA7Ci0gICAgICAgICAgICBmb3IoIGkgPSAweDAgOyBpIDw9IDB4MSA7IGkrKyxqaisrICkKLSAgICAgICAgICAgICAgcFZCSW5mby0+cENSREVbaV0gPSBwVmlkZW9NZW1vcnlbIGpqIF0gOwotCi0gICAgICAgICAgICAqcFZCSW5mby0+cFNSNDAgPSBwVmlkZW9NZW1vcnlbIGpqIF0gOwotICAgICAgICAgICAgamorKzsKLSAgICAgICAgICAgICpwVkJJbmZvLT5wU1I0MSA9IHBWaWRlb01lbW9yeVsgamogXSA7Ci0KLSAgICAgICAgICAgIGlmIChwVmlkZW9NZW1vcnlbIDB4NjcgXSAmIDB4ODApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgKnBWQkluZm8tPnBEVk9TZXR0aW5nID0gcFZpZGVvTWVtb3J5WyAweDY3IF07Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoIChwVmlkZW9NZW1vcnlbIDB4NjcgXSAmIDB4QzApID09IDB4QzAgKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGpqKys7Ci0gICAgICAgICAgICAgICAgKnBWQkluZm8tPnBDUjJFID0gcFZ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gICAgICAgMHgxNSwweDE1LDB4MTUsMHgxNSwweDE1LDB4MTUsMHgxNSwweDE1LAotICAgICAgICAgICAgICAgMHgxNSwweDE1LDB4MTUsMHgxNSwweDE1LDB4MTUsMHgxNSwweDE1LAotICAgICAgICAgICAgICAgMHgzRiwweDNGLDB4M0YsMHgzRiwweDNGLDB4M0YsMHgzRiwweDNGfTsKLQotVVNIT1JUIFhHSU5ld19DR0FfREFDW109ezB4MDAsMHgxMCwweDA0LDB4MTQsMHgwMSwweDExLDB4MDksMHgxNSwKLSAgICAgICAgICAgICAgIDB4MDAsMHgxMCwweDA0LDB4MTQsMHgwMSwweDExLDB4MDksMHgxNSwKLSAgICAgICAgICAgICAgIDB4MkEsMHgzQSwweDJFLDB4M0UsMHgyQiwweDNCLDB4MkYsMHgzRiwKLSAgICAgICAgICAgICAgIDB4MkEsMHgzQSwweDJFLDB4M0UsMHgyQiwweDNCLDB4MkYsMHgzRiwKLSAgICAgICAgICAgICAgIDB4MDAsMHgxMCwweDA0LDB4MTQsMHgwMSwweDExLDB4MDksMHgxNSwKLSAgICAgICAgICAgICAgIDB4MDAsMHgxMCwweDA0LDB4MTQsMHgwMSwweDExLDB4MDksMHgxNSwKLSAgICAgICAgICAgICAgIDB4MkEsMHgzQSwweDJFLDB4M0UsMHgyQiwweDNCLDB4MkYsMHgzRiwKLSAgICAgICAgICAgICAgIDB4MkEsMHgzQSwweDJFLDB4M0UsMHgyQiwweDNCLDB4MkYsMHgzRn07Ci0KLVVTSE9SVCBYR0lOZXdfRUdBX0RBQ1tdPXsweDAwLDB4MTAsMHgwNCwweDE0LDB4MDEsMHgxMSwweDA1LDB4MTUsCi0gICAgICAgICAgICAgICAweDIwLDB4MzAsMHgyNCwweDM0LDB4MjEsMHgzMSwweDI1LDB4MzUsCi0gICAgICAgICAgICAgICAweDA4LDB4MTgsMHgwQywweDFDLDB4MDksMHgxOSwweDBELDB4MUQsCi0gICAgICAgICAgICAgICAweDI4LDB4MzgsMHgyQywweDNDLDB4MjksMHgzOSwweDJELDB4M0QsCi0gICAgICAgICAgICAgICAweDAyLDB4MTIsMHgwNiwweDE2LDB4MDMsMHgxMywweDA3LDB4MTcsCi0gICAgICAgICAgICAgICAweDIyLDB4MzIsMHgyNiwweDM2LDB4MjMsMHgzMywweDI3LDB4MzcsCi0gICAgICAgICAgICAgICAweDBBLDB4MUEsMHgwRSwweDFFLDB4MEIsMHgxQiwweDBGLDB4MUYsCi0gICAgICAgICAgICAgICAweDJBLDB4M0EsMHgyRSwweDNFLDB4MkIsMHgzQiwweDJGLDB4M0Z9OwotCi1VU0hPUlQgWEdJTmV3X1ZHQV9EQUNbXT17MHgwMCwweDEwLDB4MDQsMHgxNCwweDAxLDB4MTEsMHgwOSwweDE1LAotICAgICAgICAgICAgICAgMHgyQSwweDNBLDB4MkUsMHgzRSwweDJCLDB4M0IsMHgyRiwweDNGLAotICAgICAgICAgICAgICAgMHgwMCwweDA1LDB4MDgsMHgwQiwweDBFLDB4MTEsMHgxNCwweDE4LAotICAgICAgICAgICAgICAgMHgxQywweDIwLDB4MjQsMHgyOCwweDJELDB4MzIsMHgzOCwweDNGLAotCi0gICAgICAgICAgICAgICAweDAwLDB4MTAsMHgxRiwweDJGLDB4M0YsMHgxRiwweDI3LDB4MkYsCi0gICAgICAgICAgICAgICAweDM3LDB4M0YsMHgyRCwweDMxLDB4MzYsMHgzQSwweDNGLDB4MDAsCi0gICAgICAgICAgICAgICAweDA3LDB4MEUsMHgxNSwweDFDLDB4MEUsMHgxMSwweDE1LDB4MTgsCi0gICAgICAgICAgICAgICAweDFDLDB4MTQsMHgxNiwweDE4LDB4MUEsMHgxQywweDAwLDB4MDQsCi0gICAgICAgICAgICAgICAweDA4LDB4MEMsMHgxMCwweDA4LDB4MEEsMHgwQywweDBFLDB4MTAsCi0gICAgICAgICAgICAgICAweDBCLDB4MEMsMHgwRCwweDBGLDB4MTB9OwordW5zaWduZWQgc2hvcnQgWEdJTmV3X1ZHQV9EQUNbXSA9IHsKK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3MDA3IDsKLSAgICAgICAgICAgIFhHSV9HZXRWQkluZm8oTW9kZU5vICwgTW9kZUlkSW5kZXggLCBId0RldmljZUV4dGVuc2lvbiwgcFZCSW5mbyApIDsKLSAgICAgICAgICAgIFhHSV9HZXRUVkluZm8oTW9kZU5vICwgTW9kZUlkSW5kZXgsIHBWQkluZm8gKSA7Ci0gICAgICAgICAgICBYR0lfR2V0TENESW5mbyhNb2RlTm8gLCBNb2RlSWRJbmRleCwgcFZCSW5mbyApIDsKLSAgICAgICAgICAgIGlmKCAhKFhHSV9YRzIxQ2hlY2tDSDcwMDdUVk1vZGUoTW9kZU5vLCBNb2RlSWRJbmRleCwgcFZCSW5mbyApKSApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgIHJldHVybiBGQUxTRTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotI2VuZGlmCi0KLQotICAgICAgICBpZiAoIHBWQkluZm8tPklGX0RFRl9MVkRTID09IDEgKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoICFYR0lfWEcyMUNoZWNrTFZEU01vZGUoTW9kZU5vICwgTW9kZUlkSW5kZXgsIHBWQkluZm8pICkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgcmV0dXJuIEZBTFNFOwotICAgICAgICAgICAgfQotICAgICAgICB9CisJICAgIGlmIChwVkJJbmZvLT5JRl9ERUZfTFZEUyA9PSAxKQorCQkgICAgaWYgKCFYR0lfWEcyMUNoZWNrTFZEU01vZGUoTW9kZU5vICwgTW9kZUlkSW5kZXgsIHBWQkluZm8pKQorCQkJICAgIHJldHVybiAwOwogCiAgICAgICAgIGlmICggTW9kZU5vIDw9IDB4MTMgKQogICAgICAgICB7CkBAIC02NDIsNyArNjA5LDcgQEAKICAgICBYR0lfTG9ja0NSVDIoIEh3RGV2aWNlRXh0ZW5zaW9uLCBwVkJJbmZvICkgOwogfQogCi0gICAgcmV0dXJuKCBUUlVFICkgOworICAgIHJldHVybiAxOwogfQogCiAKQE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0lORk8gcFZCSW5mbyApCit1bnNpZ25lZCBjaGFyIFhHSV9TZWFyY2hNb2RlSUQodW5zaWduZWQgc2hvcnQgTW9kZU5vLAorCQkJICAgICAgIHVuc2lnbmVkIHNob3J0ICpNb2RlSWRJbmRleCwKKwkJCSAgICAgICBzdHJ1Y3QgdmJfZGV2aWNlX2luZm8gKnBWQkluZm8pCiB7CiAKLSNpZmRlZiBUQwogCi0gICAgaWYgKCBNb2RlTm8gPD0gNSApCi0gICAgICAgIE1vZGVObyB8PSAxIDsKLQotICAgIGlmICggTW9kZU5vIDw9IDB4MTMgKQotICAgIHsKLSAgICAgICAgLyogZm9yICgqTW9kZUlkSW5kZXg9MDsqTW9kZUlkSW5kZXg8c2l6ZW9mKHBWQkluZm8tPlNNb2RlSURUYWJsZSkvc2l6ZW9mKFhHSV9TdFN0cnVjdCk7KCpNb2RlSWRJbmRleCkrKykgKi8KLSAgICAgICAgZm9yKCAqTW9kZUlkSW5kZXggPSAwIDsgOyAoICpNb2RlSWRJbmRleCApKysgKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoIHBWQkluZm8tPlNNb2RlSURUYWJsZVsgKk1vZGVJZEluZGV4IF0uU3RfTW9kZUlEID09IE1vZGVObyApCi0gICAgICAgICAgICAgICAgYnJlYWsgOwotICAgICAgICAgICAgaWYgKCBwVkJJbmZvLT5TTW9kZUlEVGFibGVbICpNb2RlSWRJbmRleCBdLlN0X01vZGVJRCA9PSAweEZGICkKLSAgICAgICAgICAgICAgICByZXR1cm4oIEZBTFNFICkgOwotICAgICAgICB9Ci0KLSAgICAgICAgVkdBX0lORk8gPSAoIFBVQ0hBUiApTUtfRlAoIDAgLCAweDQ4OSApIDsKLQotICAgICAgICBpZiAoIE1vZGVObyA9PSAweDA3ICkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKCAoICpWR0FfSU5GTyAmIDB4MTAgKSAhPSAwICkKLSAgICAgICAgICAgICAgICAoICpNb2RlSWRJbmRleCApKysgOyAvKiA0MDAgbGluZXMgKi8KLSAgICAgICAgICAgIC8qIGVsc2UgMzUwIGxpbmVzICovCi0gICAgICAgIH0KLQotICAgICAgICBpZiAoIE1vZGVObyA8PSAzICkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKCAoICpWR0FfSU5GTyAmIDB4ODAgKSA9PSAwICkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAoICpNb2RlSWRJbmRleCApKysgOwotICAgICAgICAgICAgICAgIGlmICggKCAqVkdBX0lORk8gJiAweDEwICkgIT0gMCApCi0gICAgICAgICAgICAgICAgICAgICggKk1vZGVJZEluZGV4ICkrKyA7IC8qIDQwMCBsaW5lcyAqLwotICAgICAgICAgICAgICAgIC8qIGVsc2UgMzUwIGxpbmVzICovCi0gICAgICAgICAgICB9Ci0gICAgICAgICAgICAvKiBlbHNlIDIwMCBsaW5lcyAqLwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIC8qIGZvciAoKk1vZGVJZEluZGV4PTA7Kk1vZGVJZEluZGV4PHNpemVvZihwVkJJbmZvLT5FTW9kZUlEVGFibGUpL3NpemVvZihYR0lfRXh0U3RydWN0KTsoKk1vZGVJZEluZGV4KSsrKSAqLwotICAgICAgICBmb3IoICpNb2RlSWRJbmRleCA9IDAgOyA7ICggKk1vZGVJZEluZGV4ICkrKyApCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICggcFZCSW5mby0+RU1vZGVJRFRhYmxlWyAqTW9kZUlkSW5kZXggXS5FeHRfTW9kZUlEID09IE1vZGVObyApCi0gICAgICAgICAgICAgICAgYnJlYWsgOwotICAgICAgICAgICAgaWYgKCBwVkJJbmZvLT5FTW9kZUlEVGFibGVbICpNb2RlSWRJbmRleCBdLkV4dF9Nb2RlSUQgPT0gMHhGRiApCi0gICAgICAgICAgICAgICAgcmV0dXJuKCBGQUxTRSApIDsKLSAgICAgICAgfQotICAgIH0KLQotCi0jZW5kaWYKLQotI2lmZGVmIFdJTjIwMDAKLQotICAgIGlmICggTW9kZU5vIDw9IDUgKQotICAgICAgICBNb2RlTm8gfD0gMSA7Ci0gICAgaWYgKCBNb2RlTm8gPD0gMHgxMyApCi0gICAgewotICAgICAgICAvKiBmb3IgKCpNb2RlSWRJbmRleD0wOypNb2RlSWRJbmRleDxzaXplb2YocFZCSW5mby0+U01vZGVJRFRhYmxlKS9zaXplb2YoWEdJX1N0U3RydWN0KTsoKk1vZGVJZEluZGV4KSsrKSAqLwotICAgICAgICBmb3IoICpNb2RlSWRJbmRleCA9IDAgOyA7ICggKk1vZGVJZEluZGV4ICkrKyApCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICggcFZCSW5mby0+U01vZGVJRFRhYmxlWyAqTW9kZUlkSW5kZXggXS5TdF9Nb2RlSUQgPT0gTW9kZU5vICkKLSAgICAgICAgICAgICAgICBicmVhayA7Ci0gICAgICAgICAgICBpZiAoIHBWQkluZm8tPlNNb2RlSURUYWJsZVsgKk1vZGVJZEluZGV4IF0uU3RfTW9kZUlEID09IDB4RkYgKQotICAgICAgICAgICAgICAgIHJldHVybiggRkFMU0UgKSA7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoIE1vZGVObyA9PSAweDA3ICkKLSAgICAgICAgICAgICggKk1vZGVJZEluZGV4ICkrKyA7IC8qIDQwMCBsaW5lcyAqLwotCi0gICAgICAgIGlmICggTW9kZU5vIDw9MyApCi0gICAgICAgICAgICAoICpNb2RlSWRJbmRleCApICs9IDIgOyAvKiA0MDAgbGluZXMgKi8KLSAgICAgICAgLyogZWxzZSAzNTAgbGluZXMgKi8KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgLyogZm9yICgqTW9kZUlkSW5kZXg9MDsqTW9kZUlkSW5kZXg8c2l6ZW9mKHBWQkluZm8tPkVNb2RlSURUYWJsZSkvc2l6ZW9mKFhHSV9FeHRTdHJ1Y3QpOygqTW9kZUlkSW5kZXgpKyspICovCi0gICAgICAgIGZvciggKk1v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YgKCBwVkJJbmZvLT5TTW9kZUlEVGFibGVbICpNb2RlSWRJbmRleCBdLlN0X01vZGVJRCA9PSAweEZGICkKLSAgICAgICAgICAgICAgICByZXR1cm4oIEZBTFNFICkgOworCQlpZiAocFZCSW5mby0+U01vZGVJRFRhYmxlWypNb2RlSWRJbmRleF0uU3RfTW9kZUlEID09IE1vZGVObykKKwkJCWJyZWFrOworCQlpZiAocFZCSW5mby0+U01vZGVJRFRhYmxlWypNb2RlSWRJbmRleF0uU3RfTW9kZUlEID09IDB4RkYpCisJCQlyZXR1cm4gMDsKICAgICAgICAgfQogCiAgICAgICAgIGlmICggTW9kZU5vID09IDB4MDcgKQpAQCAtNDE2MiwxOSArNDAzOCwxOSBAQAogICAgIH0KICAgICBlbHNlCiAgICAgewotICAgICAgICAvKiBmb3IgKCpNb2RlSWRJbmRleD0wOypNb2RlSWRJbmRleDxzaXplb2YocFZCSW5mby0+RU1vZGVJRFRhYmxlKS9zaXplb2YoWEdJX0V4dFN0cnVjdCk7KCpNb2RlSWRJbmRleCkrKykgKi8KKwkvKiBmb3IgKCpNb2RlSWRJbmRleD0wOypNb2RlSWRJbmRleDxzaXplb2YocFZCSW5mby0+RU1vZGVJRFRhYmxlKS9zaXplb2Yoc3RydWN0IFhHSV9FeHRTdHJ1Y3QpOygqTW9kZUlkSW5kZXgpKyspICovCiAgICAgICAgIGZvciggKk1vZGVJZEluZGV4ID0gMCA7IDsgKCAqTW9kZUlkSW5kZXggKSsrICkKICAgICAgICAgewotICAgICAgICAgICAgaWYgKCBwVkJJbmZvLT5FTW9kZUlEVGFibGVbICpNb2RlSWRJbmRleCBdLkV4dF9Nb2RlSUQgPT0gTW9kZU5vICkKLSAgICAgICAgICAgICAgICBicmVhayA7Ci0gICAgICAgICAgICBpZiAoIHBWQkluZm8tPkVNb2RlSURUYWJsZVsgKk1vZGVJZEluZGV4IF0uRXh0X01vZGVJRCA9PSAweEZGICkKLSAgICAgICAgICAgICAgICByZXR1cm4oIEZBTFNF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i8KLWludCBJTlQxQVJldHVybkNvZGUoIHVuaW9uIFJFR1MgcmVncyApCi17Ci0gICAgaWYgKCByZWdzLnguY2ZsYWcgKQotICAgIHsKLSAgICAgICAgLyogcHJpbnRmKCAiRXJyb3IgdG8gZmluZCBwY2kgZGV2aWNlIVxuIiApIDsgKi8KLSAgICAgICAgcmV0dXJuKCAxICkgOwotICAgIH0KLQotICAgIHN3aXRjaChyZWdzLmguYWgpCi0gICAgewotICAgICAgICBjYXNlIDA6IHJldHVybiAwOwotICAgICAgICAgICAgYnJlYWsgOwotICAgICAgICBjYXNlIDB4ODE6Ci0gICAgICAgICAgICBwcmludGYoICJGdW5jdGlvbiBub3Qgc3VwcG9ydFxuIiApIDsKLSAgICAgICAgICAgIGJyZWFrIDsKLSAgICAgICAgY2FzZSAweDgzOgotICAgICAgICAgICAgcHJpbnRmKCAiYmFkIHZlbmRvciBpZFxuIiApIDsKLSAgICAgICAgICAgIGJyZWFrIDsKLSAgICAgICAgY2FzZSAweDg2OgotICAgICAgICAgICAgcHJpbnRmKCAiZGV2aWNlIG5vdCBmb3VuZFxuIiApIDsKLSAgICAgICAgICAgIGJyZWFrIDsKLSAgICAgICAgY2FzZSAweDg3OgotICAgICAgICAgICAgcHJpbnRmKCAiYmFkIHJlZ2lzdGVyIG51bWJlclxuIiApIDsKLSAgICAgICAgICAgIGJyZWFrIDsKLSAgICAgICAgY2FzZSAweDg4OgotICAgICAgICAgICAgcHJpbnRmKCAic2V0IGZhaWxlZFxuIiApIDsKLSAgICAgICAgICAgIGJyZWFrIDsKLSAgICAgICAgY2FzZSAweDg5OgotICAgICAgICAgICAgcHJpbnRmKCAiYnVmZmVyIHRvbyBzbWFsbCIgKSA7Ci0gICAgICAgICAgICBicmVhayA7Ci0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICBicmVhayA7Ci0gICAgfQotICAgIHJldHVybiggMSApIDsKLX0KLQotCi0vKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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FVklDRV9JTkZPIHBWQkluZm8gKQordm9pZCBYR0lfU2V0R3JvdXAyKHVuc2lnbmVkIHNob3J0IE1vZGVObywgdW5zaWduZWQgc2hvcnQgTW9kZUlkSW5kZXgsIHVuc2lnbmVkIHNob3J0IFJlZnJlc2hSYXRlVGFibGVJbmRleCwKKwkJICAgc3RydWN0IHhnaV9od19kZXZpY2VfaW5mbyAqSHdEZXZpY2VFeHRlbnNpb24sIHN0cnVjdCB2Yl9kZXZpY2VfaW5mbyAqcFZCSW5mbykKIHsKLSAgICBVU0hPUlQgaSAsCisgICAgdW5zaWduZWQgc2hvcnQgaSAsCiAgICAgICAgICAgIGogLAogICAgICAgICAgICB0ZW1wYXggLAogICAgICAgICAgICB0ZW1wYnggLApAQCAtNjE1NSw5ICs1OTA4LDkgQEAKICAgICAgICAgICAgbW9kZWZsYWcgLAogICAgICAgICAgICByZXNpbmZvICwKICAgICAgICAgICAgY3J0MmNydGMgOwotICAgIFVDSEFSICpUaW1pbmdQb2ludCA7CisgICAgdW5zaWduZWQgY2hhciAqVGltaW5nUG9pbnQgOwogCi0gICAgVUxPTkcgbG9uZ3RlbXAgLAorICAgIHVuc2lnbmVkIGxvbmcgbG9uZ3RlbXAgLAogICAgICAgICAgIHRlbXBlYXggLAogICAgICAgICAgIHRlbXBlYnggLAogICAgICAgICAgIHRlbXAyICwKQEAgLTYyNjYsNyArNjAxOSw3IEBACiAgICAgICAgIHRlbXBheCA9ICggdGVtcGF4ICYgMHgwMEZGICkgfCAoICggdGVtcGF4ICYgMHgwMEZGICkgPDwgOCApIDsKICAgICAgICAgcHVzaDEgPSB0ZW1wYXggOwogICAgICAgICB0ZW1wID0gKCB0ZW1wYXggJiAweEZGMDAgKSA+PiA4IDsKLSAgICAgICAgdGVtcCArPSAoIFVTSE9SVCApVGltaW5nUG9pbnRbIDAgXSA7CisJdGVtcCArPSAodW5zaWduZWQgc2hvcnQpVGltaW5nUG9pbnRbMF07CiAKICAgICAgICAgaWYgKCBwVkJJb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ICp0ZW1wZGkgPSAwIDsKIAogICAgIHRlbXBieCA9IEJYIDsKIApAQCAtNzk1NSw1MyArNzcxNiw5IEBACiAKICAgICBpZiAoIHRhYmxlID09IDB4MDAgKSAvKiAwNy8wNS8yMiAqLwogICAgIHsKLSNpZmRlZiBXSU4yMDAwCi0gICAgICAgIGlmICggcFZCSW5mby0+SUZfREVGX0NINzAwNyA9PSAxICkKLSAgICAgICAgewotICAgICAgICAgIHN3aXRjaCggdGVtcGRpWyBpIF0uREFUQVBUUiApCi0gICAgICAgICAgewotICAgICAgICAgICAgY2FzZSAwOgotICAgICAgICAgICAgICAgIHJldHVybiAmQ0g3MDA3VFZDUlQxVU5UU0NfSFsgdGVtcGFsIF0gOwotICAgICAgICAgICAgICAgIGJyZWFrIDsKLSAgICAgICAgICAgIGNhc2UgMToKLSAgICAgICAgICAgICAgICByZXR1cm4gJkNINzAwN1RWQ1JUMU9OVFNDX0hbIHRlbXBhbCBdIDsKLSAgICAgICAgICAgICAgICBicmVhayA7Ci0gICAgICAgICAgICBjYXNlIDI6Ci0gICAgICAgICAgICAgICAgcmV0dXJuICZDSDcwMDdUVkNSVDFVUEFMX0hbIHRlbXBhbCBdIDsKLSAgICAgICAgICAgICAgICBicmVhayA7Ci0gICAgICAgICAgICBjYXNlIDM6Ci0gICAgICAgICAgICAgICAgcmV0dXJuICZDSDcwMDdUVkNSVDFPUEFMX0hbIHRlbXBhbCBdIDsKLSAgICAgICAgICAgICAgICBicmVhayA7Ci0gICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgIGJyZWFrIDsKLSAgICAgICAgICB9Ci0gICAgICAgIH0KLSNlbmRpZgogICAgIH0KICAgICBlbHNlIGlmICggdGFibGUgPT0gMHgwMSApCiAgICAgewotI2lmZGVmIFdJTjIwMDAKLSAgICAgICAgaWYgKCBwVkJJbmZvLT5JRl9ERUZfQ0g3MDA3ID09IDEgKQotICAgICAgICB7Ci0gICAgICAgICAgc3dpdGNoKCB0ZW1wZGlbIGkgXS5EQVRBUFRSICkKLSAgICAgICAgICB7Ci0gICAgICAgICAgICBjYXNlIDA6Ci0gICAgICAgICAgICAgICAgcmV0dXJuICZDSDcwMDdUVkNSVDFVTlRTQ19WWyB0ZW1wYWwgXSA7Ci0gICAgICAgICAgICAgICAgYnJlYWsgOwotICAgICAgICAgICAgY2FzZSAxOgotICAgICAgICAgICAgICAgIHJldHVybiAmQ0g3MDA3VFZDUlQxT05UU0NfVlsgdGVtcGFsIF0gOwotICAgICAgICAgICAgICAgIGJyZWFrIDsKLSAgICAgICAgICAgIGNhc2UgMjoKLSAgICAgICAgICAgICAgICByZXR1cm4gJkNINzAwN1RWQ1JUMVVQQUxfVlsgdGVtcGFsIF0gOwotICAgICAgICAgICAgICAgIGJyZWFrIDsKLSAgICAgICAgICAgIGNhc2UgMzoKLSAgICAgICAgICAgICAgICByZXR1cm4gJkNINzAwN1RWQ1JUMU9QQUxfVlsgdGVtcGFsIF0gOwotICAgICAgICAgICAgICAgIGJyZWFrIDsKLSAgICAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICAgICAgYnJlYWsgOwotICAgICAgICAgIH0KLSAgICAgICAgfQotI2VuZGlmCiAgICAgfQogICAgIGVsc2UgaWYgKCB0YWJsZSA9PSAweDA0ICkKICAgICB7CkBAIC04MDc1LDQ5ICs3NzkyLDYgQEAKICAgICB9CiAgICAgZWxzZSBpZiggdGFibGUgPT0gMHgwNiApCiAgICAgewotI2lmZGVmIFdJTjIwMDAKLSAgICAgICAgaWYgKCBwVkJJbmZvLT5JRl9ERUZfQ0g3MDA3ID09IDEgKQotICAgICAgICB7Ci0gICAgICAgICAgLyogVmlkZW9EZWJ1Z1ByaW50KCgwLCAiWEdJX0dldFRWUHRyOiBwVkJJbmZvLT5JRl9ERUZfQ0g3MDA3PT0xXG4iKSk7ICovCi0gICAgICAgICAgc3dpdGNoKCB0ZW1wZGlbIGkgXS5EQVRBUFRSICkKLSAgICAgICAgICB7Ci0gICAgICAgICAgICBjYXNlIDA6Ci0gICAgICAgICAgICAgICAgcmV0dXJuICZDSDcwMDdUVlJlZ19VTlRTQ1sgdGVtcGFsIF0gOwotICAgICAgICAgICAgICAgIGJyZWFrIDsKLSAgICAgICAgICAgIGNhc2UgMToKLSAgICAgICAgICAgICAgICByZXR1cm4gJkNINzAwN1RWUmVnX09OVFNDWyB0ZW1wYWwgXSA7Ci0gICAgICAgICAgICAgICAgYnJlYWsgOwotICAgICAgICAgICAgY2FzZSAyOgotICAgICAgICAgICAgICAgIHJldHVybiAmQ0g3MDA3VFZSZWdfVVBBTFsgdGVtcGFsIF0gOwotICAgICAgICAgICAgICAgIGJyZWFrIDsKLSAgICAgICAgICAgIGNhc2UgMzoKLSAgICAgICAgICAgICAgICByZXR1cm4gJkNINzAwN1RWUmVnX09QQUxbIHRlbXBhbCBdIDsKLSAgICAgICAgICAgICAgICBicmVhayA7Ci0gICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgIGJyZWFrIDsKLSAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBzd2l0Y2goIHRlbXBkaVsgaSBdLkRBVEFQVFIgKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICBjYXNlIDA6Ci0gICAgICAgICAgICAgICAgcmV0dXJuICZYR0lfQ0hUVlJlZ1VOVFNDWyB0ZW1wYWwgXSA7Ci0gICAgICAgICAgICAgICAgYnJlYWsgOwotICAgICAgICAgICAgICBjYXNlIDE6Ci0gICAgICAgICAgICAgICAgcmV0dXJuICZYR0lfQ0hUVlJlZ09OVFNDWyB0ZW1wYWwgXSA7Ci0gICAgICAgICAgICAgICAgYnJlYWsgOwotICAgICAgICAgICAgICBjYXNlIDI6Ci0gICAgICAgICAgICAgICAgcmV0dXJuICZYR0lfQ0hUVlJlZ1VQQUxbIHRlbXBhbCBdIDsKLSAgICAgICAgICAgICAgICBicmVhayA7Ci0gICAgICAgICAgICAgIGNh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hciBYR0lfWEcyMUNoZWNrTFZEU01vZGUodW5zaWduZWQgc2hvcnQgTW9kZU5vLAorCQkJCSAgICB1bnNpZ25lZCBzaG9ydCBNb2RlSWRJbmRleCwKKwkJCQkgICAgc3RydWN0IHZiX2RldmljZV9pbmZvICpwVkJJbmZvKQogewotICAgIFVTSE9SVCB4cmVzICwKKyAgICB1bnNpZ25lZCBzaG9ydCB4cmVzICwKICAgICAgICAgICAgeXJlcyAsCiAgICAgICAgICAgIGNvbG9yZGVwdGggLAogICAgICAgICAgICBtb2RlZmxhZyAsCkBAIC04NDQ1LDEwICs4MTE5LDEwIEBACiAKICAgICBsdmRzdGFibGVpbmRleCA9IFhHSV9HZXRMVkRTT0VNVGFibGVJbmRleCggcFZCSW5mbyApOwogICAgIGlmICggeHJlcyA+IChwVkJJbmZvLT5YRzIxX0xWRFNDYXBMaXN0W2x2ZHN0YWJsZWluZGV4XS5MVkRTSERFKSApCi0gICAgICByZXR1cm4gRkFMU0U7CisJICAgIHJldHVybiAwOwogCiAgICAgaWYgKCB5cmVzID4gKHBWQkluZm8tPlhHMjFfTFZEU0NhcExpc3RbbHZkc3RhYmxlaW5kZXhdLkxWRFNWREUpICkKLSAgICAgIHJldHVybiBGQUxTRTsKKwkgICAgcmV0dXJuIDA7CiAKICAgICBpZiAoIE1vZGVObyA+IDB4MTMgKQogICAgIHsKQEAgLTg0NTYsMTggKzgxMzAsMTcgQEAKICAgICAgICAgICAgKCB5cmVzICE9IChwVkJJbmZvLT5YRzIxX0xWRFNDYXBMaXN0W2x2ZHN0YWJsZWluZGV4XS5MVkRTVkRFKSkgKQogICAgICAgewogICAgICAgICAgIGNvbG9yZGVwdGggPSBYR0lfR2V0Q29sb3JEZXB0aCggTW9kZU5vICwgTW9kZUlkSW5kZXgsIHBWQkluZm8gKSA7Ci0gICAgICAgICAgaWYgKCBjb2xvcmRlcHRoID4gMiApCi0gICAgICAgICAgewotICAgICAgICAgICAgcmV0dXJuIEZBTFNFOwotICAgICAgICA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wgLAorICAgIHVuc2lnbmVkIHNob3J0IHRlbXBibCAsCiAgICAgICAgICAgIHRlbXBhaCA7CiAKICAgICBpZiAoIHBWQkluZm8tPlNldEZsYWcgPT0gV2luOXhET1NNb2RlICkKQEAgLTkxNDYsNyArODgyMiw3IEBACiAgICAgICAgIHsKICAgICAgICAgICAgIGlmICggKCBwVkJJbmZvLT5TZXRGbGFnICYgRW5hYmxlQ2hCICkgfHwgKCBwVkJJbmZvLT5WQkluZm8gJiAoIFNldENSVDJUb0xDRCB8IFNldENSVDJUb1RWIHwgU2V0Q1JUMlRvUkFNREFDICkgKSApCiAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdGVtcGFoID0gKCBVQ0hBUiApWEdJTmV3X0dldFJlZzEoIHBWQkluZm8tPlAzYzQgLCAweDMyICkgOworCQl0ZW1wYWggPSAodW5zaWduZWQgY2hhcilYR0lOZXdfR2V0UmVnMShwVkJJbmZvLT5QM2M0LCAweDMyKTsKICAgICAgICAgICAgICAgICB0ZW1wYWggJj0gMHhERjsKICAgICAgICAgICAgICAgICBpZiAoIHBWQkluZm8tPlZCSW5mbyAmIFNldEluU2xhdmVNb2RlICkKICAgICAgICAgICAgICAgICB7CkBAIC05MTU2LDggKzg4MzIsNyBAQAogICAgICAgICAgICAgICAgIFhHSU5ld19TZXRSZWcxKCBwVkJJbmZvLT5QM2M0ICwgMHgzMiAsIHRlbXBhaCApIDsKICAgICAgICAgICAgICAgICBYR0lOZXdfU2V0UmVnT1IoIHBWQkluZm8tPlAzYzQgLCAweDFFICwgMHgyMCApIDsKIAotCi0gICAgICAgICAgICAgICAgdGVtcGFoID0gKCBVQ0hBUiApWEdJTmV3X0dldFJlZzEoIHBWQkluZm8tPlBhcnQxUG9ydCAsIDB4MkUgKSA7CisJCXRlbXBhaCA9ICh1bnNpZ25lZCBjaGFyKVhHSU5ld19HZXRSZWcxKHBWQkluZm8tPlBhcnQxUG9ydCwgMHgyRSk7CiAKICAgICAgICAgICAgICAgICBp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AgICAgVUNIQVIgICAgICBMQ0RfVkNMSzsKLSAgICAgICAgICAgICAgICBVQ0hBUiAgICAgIExDREFfVkNMS0RhdGExOwotICAgICAgICAgICAgICAgIFVDSEFSICAgICAgTENEQV9WQ0xLRGF0YTI7Ci0gICAgICAgICAgICAgICAgVUNIQVIgICAgICBMQ1VDSEFSX1ZDTEtEYXRhMTsKLSAgICAgICAgICAgICAgICBVQ0hBUiAgICAgIExDVUNIQVJfVkNMS0RhdGEyOwotICAgICAgICAgICAgICAgIFVDSEFSICAgICAgUFNDX1MxOwotICAgICAgICAgICAgICAgIFVDSEFSICAgICAgUFNDX1MyOwotICAgICAgICAgICAgICAgIFVDSEFSICAgICAgUFNDX1MzOwotICAgICAgICAgICAgICAgIFVDSEFSICAgICAgUFNDX1M0OwotICAgICAgICAgICAgICAgIFVDSEFSICAgICAgUFNDX1M1OwotICAgICAgICAgICAgICAgIFVDSEFSICAgICAgUFdEXzJCOwotICAgICAgICAgICAgICAgIFVDSEFSICAgICAgUFdEXzJDOwotICAgICAgICAgICAgICAgIFVDSEFSICAgICAgUFdEXzJEOwotICAgICAgICAgICAgICAgIFVDSEFSICAgICAgUFdEXzJFOwotICAgICAgICAgICAgICAgIFVDSEFSICAgICAgUFdEXzJGOwotICAgICAgICAgICAgICAgIFVDSEFSICAgICAgU3BlY3RydW1fMzE7Ci0gICAgICAgICAgICAgICAgVUNIQVIgICAgICBTcGVjdHJ1bV8zMjsKLSAgICAgICAgICAgICAgICBVQ0hBUiAgICAgIFNwZWN0cnVtXzMzOwotICAgICAgICAgICAgICAgIFVDSEFSICAgICAgU3BlY3RydW1fMzQ7Ci19IFhHSTMzMF9MQ0RDYXBTdHJ1Y3Q7CisJCXVuc2lnbmVkIGNoYXIJICAgTENEX0lEOworCQl1bnNpZ25lZCBzaG9ydAkgICBMQ0RfQ2FwYWJpbGl0eTsKKwkJdW5zaWduZWQgY2hhcgkgICBMQ0RfU2V0RmxhZzsKKwkJdW5zaWduZWQgY2hhcgk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dHk7Ci0gICAgICAgICAgICAgICAgVVNIT1JUICAgICBMVkRTSFQ7Ci0gICAgICAgICAgICAgICAgVVNIT1JUICAgICBMVkRTVlQ7Ci0gICAgICAgICAgICAgICAgVVNIT1JUICAgICBMVkRTSERFOwotICAgICAgICAgICAgICAgIFVTSE9SVCAgICAgTFZEU1ZERTsKLSAgICAgICAgICAgICAgICBVU0hPUlQgICAgIExWRFNIRlA7Ci0gICAgICAgICAgICAgICAgVVNIT1JUICAgICBMVkRTVkZQOwotICAgICAgICAgICAgICAgIFVTSE9SVCAgICAgTFZEU0hTWU5DOwotICAgICAgICAgICAgICAgIFVTSE9SVCAgICAgTFZEU1ZTWU5DOwotICAgICAgICAgICAgICAgIFVDSEFSICAgICAgVkNMS0RhdGExOwotICAgICAgICAgICAgICAgIFVDSEFSICAgICAgVkNMS0RhdGEyOwotICAgICAgICAgICAgICAgIFVDSEFSICAgICAgUFNDX1MxOwotICAgICAgICAgICAgICAgIFVDSEFSICAgICAgUFNDX1MyOwotICAgICAgICAgICAgICAgIFVDSEFSICAgICAgUFNDX1MzOwotICAgICAgICAgICAgICAgIFVDSEFSICAgICAgUFNDX1M0OwotICAgICAgICAgICAgICAgIFVDSEFSICAgICAgUFNDX1M1OwotfSBYR0kyMV9MVkRTQ2FwU3RydWN0OworCQl1bnNpZ25lZCBzaG9ydAkgICBMVkRTX0NhcGFiaWxpdHk7CisJCXVuc2lnbmVkIHNob3J0CSAgIExWRFNIVDsKKwkJdW5zaWduZWQgc2hvcnQJICAgTFZEU1ZUOworCQl1bnNpZ25lZCBzaG9ydAkgICBMVkRTSERFOworCQl1bnNpZ25lZCBzaG9ydAkgICBMVkRTVkRFOworCQl1bnNpZ25lZCBzaG9ydAkgICBMVkRTSEZQOworCQl1bnNpZ25lZCBzaG9ydAkgICBMVkRTVkZQOworCQl1bnNpZ25lZCBzaG9ydAkgICBMVkRTSFNZTkM7CisJCXVuc2lnbmVkIHNob3J0CSAgIExWRFNWU1lOQzsKKwkJdW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DA3VFZWQ0xLMzBfMiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDSDcwMDdUVlZDTEszMF8yLApAQCAtMzU0Niw3ICszNTE5LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDSDcwMDdUVlZDTEs0N184CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OwogCi1VQ0hBUiBYR0k3MDA3X0NIVFZWQ0xLT05UU0NbXT17Q0g3MDA3VFZWQ0xLMjZfNCwKK3Vuc2lnbmVkIGNoYXIgWEdJNzAwN19DSFRWVkNMS09OVFNDW10gPSB7Q0g3MDA3VFZWQ0xLMjZfNCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDSDcwMDdUVlZDTEsyNl80LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENINzAwN1RWVkNMSzI2XzQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ0g3MDA3VFZWQ0xLMjZfNCwKQEAgLTM1NTQsNyArMzUyNyw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ0g3MDA3VFZWQ0xLNDNfNgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKIAotVUNIQVIgWEdJNzAwN19DSFRWVkNMS1VQQUxbXT17Q0g3MDA3VFZWQ0xLMzFfNSwKK3Vuc2lnbmVkIGNoYXIgWEdJNzAwN19DSFRWVkNMS1VQQUxbXSA9IHtDSDcwMDdUVlZDTEszMV81LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ0g3MDA3VFZWQ0xLMzFfNSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENINzAwN1RWVkNMSzMxXzUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDSDcwMDdUVlZDTEszMV81LApAQCAtMzU2Miw3ICszNTM1LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENINzAwN1RWVkNMSzM5CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CiAKLVVDSEFSIFhHSTcwMDdfQ0hUVlZDTEtPUEFMW109e0NINzAwN1RWVkNMSzMxXzUsCit1bnNpZ25lZCBjaGFyIFhHSTcwMDdfQ0hUVlZDTEtPUEFMW10gPSB7Q0g3MDA3VFZWQ0xLMzFfNSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENINzAwN1RWVkNMSzMxXzUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDSDcwMDdUVlZDTEszMV81LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ0g3MDA3VFZWQ0xLMzFfNSwKQEAgLTM1NzAsNyArMzU0Myw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDSDcwMDdUVlZDTEszNgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OwogCi1YR0kzMzBfVkNMS0RhdGFTdHJ1Y3QgWEdJX0NINzAwN1ZDTEtEYXRhW109CitzdHJ1Y3QgWEdJMzMwX1ZDTEtEYXRhU3RydWN0IFhHSV9DSDcwMDdWQ0xLRGF0YVtdID0KIHsKICB7IDB4NjAsMHgzNiwzMH0sICAvKiAwIDMwLjIgTUhaICovCiAgeyAweDQwLDB4NEEsMjh9LCAgLyogMSAyOC4xOSBNSFogKi8KQEAgLTM1ODUsNyArMzU1OCw3IEBACiAgeyAweEZGLDB4MDAsMCB9ICAgLyogRW5kIG1hcmsgICAgICAqLwogfTsKIAotWEdJMzMwX1ZDTEtEYXRhU3RydWN0IFhHSV9WQ0xLRGF0YVtdPQorc3RydWN0IFhHSTMzMF9WQ0xLRGF0YVN0cnVjdCBYR0lfVkNMS0RhdGFbXSA9CiB7CiAgICAgICAgICAgICAgICAJLyogU1IyQixTUjJDLFNSMkQgKi8KICAJCXsgICAgICAweDFCLDB4RTEsMjUgICAgICAgICAgICAgICB9LC8qIDAwICgyNS4xNzVNSHopICovCkBAIC0zNzg2LDcgKzM3NTksNyBAQAogICAgICAgICAgICAgICAgIHsgICAgICAweEZGLDB4MDAsMCAgICAgICAgICAgICAgICB9LyogRW5kIG1hcmsgKi8KICB9ICA7CiAKLVhHSTMzMF9WQ0xLRGF0YVN0cnVjdCBYR0lfVkJWQ0xLRGF0YVtdPQorc3RydWN0IFhHSTMzMF9WQ0xLRGF0YVN0cnVjdCBYR0lfVkJWQ0xLRGF0YVtdID0KIHsKICAgICAgICAgICAgICAgICB7ICAgICAgMHgxQiwweEUxLDI1ICAgICAgICAgICAgICAgfSwvKiAwMCAoMjUuMTc1TUh6KSAqLwogCkBAIC0zOTg3LDcgKzM5NjAsNyBAQAogICAgICAgICAgICAgICAgIHsgICAgICAweEZGLDB4MDAsMCAgICAgICAgICAgICAgICB9ICAgICAgLyogRW5kIG1hcmsgKi8KIH07CiAKLVVDSEFSIFhHSTY2MF9UVkRlbGF5TGlzdFtdPQordW5zaWduZWQgY2hhciBYR0k2NjBfVFZEZWxheUxpc3RbXSA9CiB7CiAgICAgICAgICAgMHg0NCwgICAgICAgICAgICAvKiA7IDAgRXh0TlRTQ0RlbGF5ICovCiAgICAgICAgICAgMHg0NCwgICAgICAgICAgICAvKiA7IDEgU3ROVFNDRGVsYXkgKi8KQEAgLTQwMDMsNyArMzk3Niw3IEBACiAgICAgICAgICAgMHg0NCAgICAgICAgICAgICAvKiA7IEIgU3RZUGJQckRlYWx5KDc1MHApICovCiB9OwogCi1VQ0hBUiBYR0k2NjBfVFZEZWxheUxpc3QyW109Cit1bnNpZ25lZCBjaGFyIFhHSTY2MF9UVkRlbGF5TGlzdDJbXSA9CiB7CiAgICAgICAgICAgMHg0NCwgICAgICAgICAgIC8qIDsgMCBFeHROVFNDRGVsYXkgKi8KICAgICAgICAgICAweDQ0LCAgICAgICAgICAgLyogOyAxIFN0TlRTQ0RlbGF5ICovCkBAIC00MDE5LDcgKzM5OTIsNyBAQAogICAgICAgICAgIDB4NDQgICAgICAgICAgICAvKiA7IEIgU3RZUGJQckRlYWx5KDc1MHApICovCiB9OwogCi1VQ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pLiAqLwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTm90ZSA6IHJlc3RvcmUgU1IgcmVnaXN0ZXJzIGlmICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogYlNraXBEcmFtU2l6aW5nID0gVFJVRSAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogYlNraXBEcmFtU2l6aW5nID0gMSAqLwogCi0gICAgUFhHSV9EU1JlZyAgcENSOyAgICAgICAgICAgICAvKiByZXN0b3JlIENSIHJlZ2lzdGVycyBpbiBpbml0aWFsIGZ1bmN0aW9uLiAqLworICAgIHN0cnVjdCBYR0lfRFNSZWcgICpwQ1I7ICAgICAgICAgICAgIC8qIHJlc3RvcmUgQ1IgcmVnaXN0ZXJzIGluIGluaXRpYWwgZnVuY3Rpb24uICovCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBlbmQgZGF0YSA6KGlkeCwgdmFsKSA9ICAoRkYsIEZGKSAqLwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTm90ZSA6IHJlc3RvcmUgY1IgcmVnaXN0ZXJzIGlmICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogYlNraXBEcmFtU2l6aW5nID0gVFJVRSAqLwotLyoKLSNlbmRpZgotKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGJTa2lwRHJhbVNpemluZyA9IDEgKi8KIAotICAgIFBYR0lfUVVFUllTUEFDRSAgcFF1ZXJ5VkdBQ29uZmlnU3BhY2U7CisJdW5zaWduZWQgY2hhcigqcFF1ZXJ5VkdBQ29uZmlnU3BhY2UpKHN0cnVjdCB4Z2lfaHdfZGV2aWNlX2luZm8gKiwKKwkJCQkJICAgIHVuc2lnbmVkIGxvbmcsIHVuc2lnbmVkIGxvbmcsCisJCQkJCSAgICB1bnNpZ25lZCBsb25nICopOwogCi0gICAgUFhHSV9RVUVSWVNQQUN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S0tLS0tLS0tLS0tLS0tLS0tLS0tCiAKICMgRGVmYXVsdCBpcyBidWlsdC1pbiwgdW5sZXNzIHdlIGtub3cgb3RoZXJ3aXNlCi1tb2RrZXJuX2NmbGFncyA9ICQoaWYgJChwYXJ0LW9mLW1vZHVsZSksICQoQ0ZMQUdTX01PRFVMRSksICQoQ0ZMQUdTX0tFUk5FTCkpCittb2RrZXJuX2NmbGFncyA9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCSQoaWYgJChwYXJ0LW9mLW1vZHVsZSksICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCQkkKEtCVUlMRF9DRkxBR1NfTU9EVUxFKSAkKENGTEFHU19NT0RVTEUpLCBcCisJCSQoS0JVSUxEX0NGTEFHU19LRVJORUwpICQoQ0ZMQUdTX0tFUk5FTCkpCiBxdWlldF9tb2R0YWcgOj0gJChlbXB0eSkgICAkKGVtcHR5KQogCiAkKHJlYWwtb2Jqcy1tKSAgICAgICAgOiBwYXJ0LW9mLW1vZHVsZSA6PSB5CkBAIC0xNTYsMTQgKzE1OSwxNCBAQAogCiBjbWRfZ2Vuc3ltdHlwZXMgPSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgICQoQ1BQKSAtRF9fR0VOS1NZTVNfXyAkKGNfZmxhZ3MpICQ8IHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAkKEdFTktTWU1TKSAtVCAkQCAtYSAkKEFSQ0gpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgJChHRU5LU1lNUykgJChpZiAkKDEpLCAtVCAkKDIpKSAtYSAkKEFSQ0gpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgICAkKGlmICQoS0JVSUxEX1BSRVNFUlZFKSwtcCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgJChpZiAkKDEpLC1yICQoZmlyc3R3b3JkICQod2lsZGNhcmQgJChAOi5zeW10eXBlcz0uc3ltcmVmKSAvZGV2L251bGwpKSkKKyAgICAgLXIgJChmaXJzdHdvcmQgJCh3aWxkY2FyZCAkKDI6LnN5bXR5cGVzPS5zeW1yZWYpIC9kZXYvbnVsbCkpCiAKIHF1aWV0X2NtZF9jY19zeW10eXBlc19jID0gU1lNICQocXVpZXRfbW9kdGFnKSAkQAogY21kX2NjX3N5bXR5cGVzX2MgPSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICBzZXQgLWU7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgJChjYWxsIGNtZF9nZW5zeW10eXBlcywgdHJ1ZSkgPi9kZXYvbnVsbDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICQoY2FsbCBjbWRfZ2Vuc3ltdHlwZXMsdHJ1ZSwkQCkgPi9kZXYvbnVsbDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICB0ZXN0IC1zICRAIHx8IHJtIC1mICRACiAKICQob2JqKS8lLnN5bXR5cGVzIDogJChzcmMpLyUuYyBGT1JDRQpAQCAtMTkyLDE2ICsxOTUsMTYgQEAKICMgICB0aGUgYWN0dWFsIHZhbHVlIG9mIHRoZSBjaGVja3N1bSBnZW5lcmF0ZWQgYnkgZ2Vua3N5bXMKIAogY21kX2NjX29fYyA9ICQoQ0MpICQoY19mbGFncykgLWMgLW8gJChARCkvLnRtcF8kKEBGKSAkPAotY21kX21vZHZlcnNpb25zID0JCQkJCQkJXAotCWlmICQoT0JKRFVNUCkgLWggJChARCkvLnRtcF8kKEBGKSB8IGdyZXAgLXEgX19rc3ltdGFiOyB0aGVuCVwKLQkJJChjYWxsIGNtZF9nZW5zeW10eXBlcywgJChLQlVJTERf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2FnZS9NYWtlZmlsZQorKysgYi9zY3JpcHRzL3BhY2thZ2UvTWFrZWZpbGUKQEAgLTExMSwxMyArMTExLDM4IEBACiBjbGVhbi1kaXJzICs9ICQob2JqdHJlZSkvdGFyLWluc3RhbGwvCiAKIAorIyBwZXJmLXBrZyAtIGdlbmVyYXRlIGEgc291cmNlIHRhcmJhbGwgd2l0aCBwZXJmIHNvdXJjZQorIyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworcGVyZi10YXI9cGVyZi0kKEtFUk5FTFZFUlNJT04pCisKK3F1aWV0X2NtZF9wZXJmX3RhciA9IFRBUgorICAgICAgY21kX3BlcmZfdGFyID0gXAorZ2l0IGFyY2hpdmUgLS1wcmVmaXg9JChwZXJmLXRhcikvIEhFQURee3RyZWV9ICAgICAgICAgICAgICAgICAgICAgICBcCisJJCQoY2F0ICQoc3JjdHJlZSkvdG9vbHMvcGVyZi9NQU5JRkVTVCkgLW8gJChwZXJmLXRhcikudGFyOyAgXAorbWtkaXIgLXAgJChwZXJmLXRhcik7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCitnaXQgcmV2LXBhcnNlIEhFQUQgPiAkKHBlcmYtdGFyKS9IRUFEOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKK3RhciByZiAkKHBlcmYtdGFyKS50YXIgJChwZXJmLXRhcikvSEVBRDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorcm0gLXIgJChwZXJmLXRhcik7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiskKGlmICQoZmluZHN0cmluZyB0YXItc3JjLCRAKSwsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyQoaWYgJChmaW5kc3RyaW5nIGJ6MiwkQCksYnppcDIsICAgIC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fY3B1LAorCWNvbW1vbl9zZWNzLCBjb21tb25fbnNlY3MsIGNvbW1vbl9waWQsIGNvbW1vbl9jb21tLAorCXBhcmVudF9jb21tLCBwYXJlbnRfcGlkLCBjaGlsZF9jb21tLCBjaGlsZF9waWQpOgorCXBhc3MKKworZGVmIHNjaGVkX19zY2hlZF9wcm9jZXNzX3dhaXQoZXZlbnRfbmFtZSwgY29udGV4dCwgY29tbW9uX2NwdSwKKwljb21tb25fc2VjcywgY29tbW9uX25zZWNzLCBjb21tb25fcGlkLCBjb21tb25fY29tbSwKKwljb21tLCBwaWQsIHByaW8pOgorCXBhc3MKKworZGVmIHNjaGVkX19zY2hlZF9wcm9jZXNzX2V4aXQoZXZlbnRfbmFtZSwgY29udGV4dCwgY29tbW9uX2NwdSwKKwljb21tb25fc2VjcywgY29tbW9uX25zZWNzLCBjb21tb25fcGlkLCBjb21tb25fY29tbSwKKwljb21tLCBwaWQsIHByaW8pOgorCXBhc3MKKworZGVmIHNjaGVkX19zY2hlZF9wcm9jZXNzX2ZyZWUoZXZlbnRfbmFtZSwgY29udGV4dCwgY29tbW9uX2NwdSwKKwljb21tb25fc2VjcywgY29tbW9uX25zZWNzLCBjb21tb25fcGlkLCBjb21tb25fY29tbSwKKwljb21tLCBwaWQsIHByaW8pOgorCXBhc3MKKworZGVmIHNjaGVkX19zY2hlZF9taWdyYXRlX3Rhc2soZXZlbnRfbmFtZSwgY29udGV4dCwgY29tbW9uX2NwdSwKKwljb21tb25fc2VjcywgY29tbW9uX25zZWNzLCBjb21tb25fcGlkLCBjb21tb25fY29tbSwKKwljb21tLCBwaWQsIHByaW8sIG9yaWdfY3B1LAorCWRlc3RfY3B1KToKKwloZWFkZXJzID0gRXZlbnRIZWFkZXJzKGNvbW1vbl9jcHUsIGNvbW1vbl9zZWNzLCBjb21tb25fbnNlY3MsCisJCQkJY29tbW9uX3BpZCwgY29tbW9uX2NvbW0pCisJcGFyc2VyLm1pZ3JhdGUoaGVhZGVycywgcGlkLCBw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