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b3MvbGludXgvbGludXgtMy40LngvZHJpdmVycy9zdGFnaW5nL2FuZHJvaWQvYmluZGVyLmMKQEAgLTM2LDYgKzM2LDEzIEBACiAKICNpbmNsdWRlICJiaW5kZXIuaCIKICNpbmNsdWRlICJiaW5kZXJfdHJhY2UuaCIKKyNpZmRlZiBDT05GSUdfQU5EUk9JRF9CSU5ERVJfUlBDCisjaW5jbHVkZSA8bGludXgvbW0uaD4KKyNpbmNsdWRlIDxsaW51eC9tbWFuLmg+CisjaW5jbHVkZSA8YXNtLWdlbmVyaWMvbW1hbi1jb21tb24uaD4KKworI2luY2x1ZGUgImJpbmRlcl9ycGMuaCIKKyNlbmRpZgogCiBzdGF0aWMgREVGSU5FX01VVEVYKGJpbmRlcl9tYWluX2xvY2spOwogc3RhdGljIERFRklORV9NVVRFWChiaW5kZXJfZGVmZXJyZWRfbG9jayk7CkBAIC01MSw3ICs1OCwzOCBAQAogc3RhdGljIHVpZF90IGJpbmRlcl9jb250ZXh0X21ncl91aWQgPSAtMTsKIHN0YXRpYyBpbnQgYmluZGVyX2xhc3RfaWQ7CiBzdGF0aWMgc3RydWN0IHdvcmtxdWV1ZV9zdHJ1Y3QgKmJpbmRlcl9kZWZlcnJlZF93b3JrcXVldWU7CisjaWZkZWYgQ09ORklHX0FORFJPSURfQklOREVSX1JQQworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgIEJJTkRFUiBSUEMgREVGSU5FIFNUQVJUCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNkZWZpbmUgQklOREVSX1JQQ19JR05PUkVfUFJJViAgKDB4RkZGRkZGRkYpCitzdHJ1Y3QgYmluZGVyX3RyYW5zYWN0aW9uOworc3RydWN0IGJpbmRlcl9wcm9jOworc3RydWN0IGJpbmRlcl90aHJlYWQ7CiAKK3N0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CQl9CisjZW5kaWYJCQogCQlpZiAoaGxpc3RfZW1wdHkoJm5vZGUtPnJlZnMpKSB7CiAJCQlrZnJlZShub2RlKTsKIAkJCWJpbmRlcl9zdGF0c19kZWxldGVkKEJJTkRFUl9TVEFUX05PREUpOwpAQCAtMzIwNiw2ICszNDkyLDg1NCBAQAogCX0KIAltdXRleF91bmxvY2soJmJpbmRlcl9kZWZlcnJlZF9sb2NrKTsKIH0KKyNpZmRlZiBDT05GSUdfQU5EUk9JRF9CSU5ERVJfUlBDCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgQklOREVSIFJQQyBBUEkgU1RBUlQKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RhdGljIGludCBiaW5kZXJfaW5pdF9ycGMoc3RydWN0IGJpbmRlcl9wcm9jICpvd25fcHJvYykKK3sKKwlzdHJ1Y3QgYmluZGVyX3Byb2MgKnByb2M7CisJdW5zaWduZWQgbG9uZyB1bnVzZWQ7CisJdW5zaWduZWQgbG9uZyBtbWFwX2Jhc2U7CisJdW5zaWduZWQgbG9uZyBtbWFwX3NpemU7CisKKwlzdHJ1Y3QgZmlsZSAqcGZpbGUgPSBmaWxwX29wZW4oIi9kZXYvYmluZGVyIixPX1JEV1IsMCk7CisJCisJaWYoTlVMTCA9PSBwZmlsZSkgeworCQliaW5kZXJfdXNlcl9lcnJvcigiJXM6IGZpbHBfb3BlbiBmYWlsLlxuIiwgX19mdW5jX18pOworCQlyZXR1cm4gLTE7CisJfQorCXByb2MgPSBwZmlsZS0+cHJpdmF0ZV9kYXRhOworCisJbW1hcF9zaXplID0gMTYqUEFHRV9TSVpFOworCW1tYXBfYmFzZSA9IGRvX21tYXAocGZpbGUsIDAsIG1tYXBfc2l6ZSwKKwkJCQkgICAgICAgUFJPVF9SRUFELAorCQk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iAjZW5kaWYKIAlkb3duX3dyaXRlKCZjdXJyZW50LT5tbS0+bW1hcF9zZW0pOwogCWlmIChhZGRyICYmICEoc2htZmxnICYgU0hNX1JFTUFQKSkgewpkaWZmIC0tZ2l0IGEvYXAvb3MvbGludXgvbGludXgtMy40LngvaXBjL3NobV9jdHJsLmMgYi9hcC9vcy9saW51eC9saW51eC0zLjQueC9pcGMvc2htX2N0cmwuYwppbmRleCA1OThjYjI4Li4xODNhOGJkIDEwMDc1NQotLS0gYS9hcC9vcy9saW51eC9saW51eC0zLjQueC9pcGMvc2htX2N0cmwuYworKysgYi9hcC9vcy9saW51eC9saW51eC0zLjQueC9pcGMvc2htX2N0cmwuYwpAQCAtMjMsNiArMjMsMTAgQEAKICNkZWZpbmUgU0hNX1VOSVRfQlVGRl9PUkRFUiAgICAgICAoMTIpCiAjZGVmaW5lIFNITV9LRVlTX1NUQVRVU19MRU4gICAgICAgKDQqMTAyNCkKICNkZWZpbmUgU0hNX1JFTU9URV9CVUZGX0xFTiAgICAgICAoMTI4KjEwMjQpCisjZGVmaW5lIFNITV9QT1NJWF9IQVNIX0NIQVJTICAgICAgKDI2KQorI2RlZmluZSBTSE1fUE9TSVhfSEFTSF9CQVNFICAgICAgICg2MikKKyNkZWZpbmUgU0hNX1BPU0lYX0hBU0hfTUFTSyAgICAgICAoMHg3RkYpCisKICNkZWZpbmUgU0hNX0JVRkZfQkFTRV9QSFlfQUREUiAgICAoZ19zaG1fcGh5QWRkcikKICAKICNkZWZpbmUgU0hNX1VOSVRfQlVGRl9TSVpFICAgICAgICAoMVVMPDxTSE1fVU5JVF9CVUZGX09SREVSKSAvKjRLQiovCkBAIC01MSw2ICs1NSwzNiBAQAogc3RydWN0IHNobV9lbnRpdHkgKnNobV9yZW1vdGVfbWFuYWdlcjsKIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoguabE3MPoyvY6ICAgICBzaG1faGFzaF9uYW1lX3RvX2tleQorKiCyzsr9y7XD9zoKKyogICAgKLSryOuyzsr9KSBuYW1lOiC5ss/txNq05sP7s8YKKyogICAgKLSryOuyzsr9KSBsZW46ILmyz+3E2rTmw/uzxrOktsgKKyogICAgKLSrs/ayzsr9KSDO3gorKiC3tSC72CDWtTogICAgIAorKiDG5Mv8y7XD9zogICAgIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCBmb3IgY2FsYyBoYXNoIHZhbHVlIG9mIHRoZSBuYW1lKC0yMDQ4fi00MDk2KQorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK2tleV90IHNobV9oYXNoX25hbWVfdG9fa2V5KGNvbnN0IGNoYXIgKm5hbWUsIGludCBsZW4pCit7CisgICAgaW50ICAgaSAgICAgICAgPSAwOworICAgIGtleV90IHRtcF9rZXkgID0gMDsKKyAgICBrZXlfdCBoYXNoX2tleSA9IDA7CisgICAgdW5zaWduZWQgbG9uZyBsb25nIGlkID0gMDsKKworICAgIGZvciAoOyBpIDwgbGVuOyBpKyspCisgICAgeworICAgICAgICBpZiAobmFtZVtpXSA+PSAnQScgJiYgbmFtZVtpXSA8PSAnWicpCisgICAgICAgICAgICBpZCA9IGlkKlNITV9QT1NJWF9IQVNIX0JBU0UgKyBuYW1lW2ldLSdBJzsKKyAgICAgICAgZWxzZSBpZiAobmFtZVtpXSA+PSAnYScgJiYgbmFtZVtpXSA8PSAneicpCisgICAgICAgICAgICBpZCA9IGlkKlNITV9QT1NJWF9IQVNIX0JBU0UgKyBuYW1lW2ldLSdhJyArIFNITV9QT1NJWF9IQVNIX0NIQVJTOworICAgICAgICBlbHNlIGlmIChuYW1lW2ldID49ICcwJyAmJiBuYW1lW2ldIDw9ICc5JykKKyAgICAgICAgICAgIGlkID0gaWQqU0hNX1BPU0lYX0hBU0hfQkFTRSArIG5hbWVbaV0tJzAnICsgMipTSE1fUE9TSVhfSEFTSF9DSEFSUzsKKyAgICB9CisgICAgdG1wX2tleSA9KGlkICYgU0hNX1BPU0lYX0hBU0hfTUFTSykgKyAoU0hNX1BPU0lYX0hBU0hfTUFTSyArIDEpOworICAgIGhhc2hfa2V5ID0gfnRtcF9rZXkgKyAxOyAKKyAgICByZXR1cm4gaGFzaF9rZXk7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAqILmmxNzD6Mr2OiAgICAgc2htX3F1YXJ5X2tleUFycmF5CiAqILLOyv3LtcP3OgogKiAgICAotKvI67LOyv0pICAgIHZvaWQKQEAgLTMzMCw2ICszNjQsNTggQEAKIH0KIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoguabE3MPoyvY6ICAgICBzaG1fZG9fbmV3c2VnX2NoZWNrCisqILLOyv3LtcP3OiAgICAgCisqICAgICi0q8jrss7K/SkgICAgdm9pZAorKiAgICAotKuz9rLOyv0pICAgIHZvaWQKKyogt7Ugu9gg1rU6ICAgICBTSE1fQ1RSTF9PSyBvciBTSE1fQ1RSTF9FUlJPUgorKiDG5Mv8y7XD9zogICAgIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCBmb3IgY2hlY2sga2V5IGFuZCBsZW4gICAgICAgICAgICAgICAgICAgIAorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK2ludCBzaG1fZG9fbmV3c2VnX2NoZWNrKGtleV90IGtleSwgdW5zaWduZWQgbG9uZyBsZW4pCit7CisgICAgaW50ICAgICAgICAgICAgICAgICAgcmV0ICAgICAgICA9IDA7CisgICAgaW50ICAgICAgICAgICAgICAgICAga2V5X2luZGV4ICA9IDA7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgc2htX3dlaWdodCA9IDA7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgc2htX3BhZ2VzICA9IDA7CisgICAgc3RydWN0IHNobV9rZXlfbm9kZSAgKmtleV9ub2RlICA9IE5VTEw7CisKKyAgICBpZihnX3NobV9yZWdpb24gPT0gTlVMTCkKKyAgICB7CisgICAgICAgIHByaW50aygic2htX2RvX25ld3NnX2NoZWNrOlNobSByZWdpb24gaXMgbm90IHJlYWR5XG4iKTsKKyAgICAgICAgcmV0dXJuIFNITV9DVFJMX0VSUk9SOworICAgIH0KKyAgICBzb2Z0X3NwaW5fbG9jayhTSE1fU0ZMT0NLKTsKKworICAgIGtleV9pbmRleCA9IHNobV9xdWFyeV9rZXlBcnJheShrZXkpOworCisgICAgaWYgKGtleV9pbmRleCA8IDApIAorICAgIHsKKyAgICAgICAgc29mdF9zcGluX3VubG9jayhTSE1fU0ZMT0NLKTsgICAgCisgICAgICAgIHJldHVybiBTSE1fQ1RSTF9PSzsKKyAgICB9CisgICAgCisgICAgaWYgKCgwIDw9IGtleV9pbmRleCkgJiYgKGtleV9pbmRleCA8IFNITV9VTklUX05VTV9CSVRTKSkKKyAgICB7CisgICAgICAgIGtleV9ub2RlID0gJnNobV9yZW1vdGVfbWFuYWdlci0+a2V5c19pbmZvX2hlYWRba2V5X2luZGV4XTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgc29mdF9zcGluX3VubG9jayhTSE1fU0ZMT0NLKTsKKyAgICAgICAgcGFuaWMoImtleV9pbmRleCBvdXQgb2YgcmFuZ2U6IGZhaWxlZFxuIik7CisgICAgfQorCisgICAgc2htX3BhZ2VzICA9ICBQQUdFX0FMSUdOKGxlbikgPj4gUEFHRV9TSElGVDsKKyAgICBzaG1fd2VpZ2h0ID0gYml0bWFwX3dlaWdodChrZXlfbm9kZS0+c2htX2ludXNlX2luZGV4LCBTSE1fVU5JVF9OVU1fQklUUyk7CisgICAgc29mdF9zcGluX3VubG9jayhTSE1fU0ZMT0NLKTsKKworICAgIC8qQVC6zUNBULmyz+3E2rTmtPPQodOmxqXF5CovCisgICAgaWYoc2htX3dlaWdodCAhPSBzaG1fcGFnZXMpIAorICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICBlbHNlCisgICAgICAgIHJldHVybiBTSE1fQ1RSTF9PSzsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICoguabE3MPoyvY6ICAgICBzaG1fZG9fcmVtb3RlX21hcF92bWEKICogss7K/cu1w/c6ICAgICAKICogICAgKLSryOuyzsr9KSAgICB2b2lkCkBAIC0zNzQsOSArNDYwLDE0IEBACiAgICAgdm1fYWRkciA9IHZtYS0+dm1fc3RhcnQ7CiAgICAgCiAgICAgaWYgKCgwIDw9IGtleV9pbmRleCkgJiYgKGtleV9pbmRleCA8IFNITV9VTklUX05VTV9CSVRTKSkKKyAgICB7CiAgICAgICAgIGtleV9ub2RlID0gJnNobV9yZW1vdGVfbWFuYWdlci0+a2V5c19pbmZvX2hlYWRba2V5X2luZGV4XTsKKyAgICB9CiAgICAgZWxzZQorICAgIHsKKyAgICAgICAgc29mdF9zcGluX3VubG9jayhTSE1fU0ZMT0NLKTsKICAgICAgICAgcGFuaWMoImtleV9pbmRleCBvdXQgb2YgcmFuZ2U6IGZhaWxlZFxuIik7CisgICAgfQogCiAgICAgbWVtY3B5KHNobV9pbnVzZV90bXAsIGtleV9ub2RlLT5zaG1faW51c2VfaW5kZXgsIHNpemVvZihzaG1faW51c2VfdG1wKSk7CiAKZGlmZiAtLWdpdCBhL2FwL29zL2xpbnV4L2xpbnV4LTMuNC54L2lwYy9zaG1fY3RybC5oIGIvYXAvb3MvbGludXgvbGludXgtMy40LngvaXBjL3NobV9jdHJsLmgKaW5kZXggNWE4NTBhMS4uNDcyNmVhOCAxMDA3NTUKLS0tIGEvYXAvb3MvbGludX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Nhc3Rfb2ZmOwogc3RhdGljIGlubGluZSBib29sIGJyX211bHRpY2FzdF9pc19yb3V0ZXIoc3RydWN0IG5ldF9icmlkZ2UgKmJyKQogewotCWlmKGJyX211bHRpY2FzdF9vZmYpCi0JCXJldHVybiAwOwogCXJldHVybiBici0+bXVsdGljYXN0X3JvdXRlciA9PSAyIHx8CiAJICAgICAgIChici0+bXVsdGljYXN0X3JvdXRlciA9PSAxICYmCiAJCXRpbWVyX3BlbmRpbmcoJmJyLT5tdWx0aWNhc3Rfcm91dGVyX3RpbWVyKSk7CmRpZmYgLS1naXQgYS9hcC9vcy9saW51eC9saW51eC0zLjQueC9uZXQvY29yZS9mYXN0cHJvYy9mYXN0X2NvbW1vbi5jIGIvYXAvb3MvbGludXgvbGludXgtMy40LngvbmV0L2NvcmUvZmFzdHByb2MvZmFzdF9jb21tb24uYwppbmRleCBkM2Y3NDBkLi43ODdiMjI3IDEwMDc1NQotLS0gYS9hcC9vcy9saW51eC9saW51eC0zLjQueC9uZXQvY29yZS9mYXN0cHJvYy9mYXN0X2NvbW1vbi5jCisrKyBiL2FwL29zL2xpbnV4L2xpbnV4LTMuNC54L25ldC9jb3JlL2Zhc3Rwcm9jL2Zhc3RfY29tbW9uLmMKQEAgLTE4MDEsMjQgKzE4MDEsMjQgQEAKICAgICB7CiAgICAgICAgIHNrYl9udW02Kys7CiAgICAgICAgIHNrYl9ieXRlczYgKz0gc2tiLT5sZW47Ci0gICAgICAgIAorCiAgICAgICAgIC8v1+mypbXEv+zL2deqt6KjrLT9yrXP1qOs1N3KsdaxvdO3tbvYv+zL2deqt6LKp7DcCiAgICAgICAgIGlmKGlwdjZfYWRkcl9pc19tdWx0aWNhc3QoJmlwdjZfaGRyKHNrYiktPmRhZGRyKSkKICAgICAgICAgewogICAgICAgICAgICAgbXVsdGljYXN0X251bTYrKzsKICAgICAgICAgICAgIHJldHVybiAwOwogICAgICAgICB9Ci0gICAgICAgIAotICAgICAgICBpZiAoc2tiLT5uZmN0X3JlYXNtICYmIHByaW50a19yYXRlbGltaXQoKSkgewotICAgICAgICAgICAgcHJpbnRrKCJmYXN0Nl9mdyByZWFzbSBcbiIpOworCisgICAgICAgIGlmIChza2ItPm5mY3RfcmVhc20pIHsKKyAgICAgICAgICAgIC8vcHJpbnRrKCJmYXN0Nl9mdyByZWFzbVxuIik7CiAgICAgICAgICAgICByZXR1cm4gMDsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgCS8qICBpZiAoaXB2Nl9oZHIoc2tiKS0+bmV4dGhkciAhPSBJUFBST1RPX1RDUCAmJiBpcHY2X2hkcihza2IpLT5uZXh0aGRyICE9IElQUFJPVE9fVURQKXsKICAgICAgICAgLy8gICAgcHJpbnRrKCJ3cm9uZyBwcm90b2NvbCB2NiA9ICVkXG4iLCBpcHY2X2hkcihza2IpLT5uZXh0aGRyKTsKICAgICAgICAgICAgIHJldHVybiAwOwogICAgICAgICB9Ki8KLSAgICAgICAgCisKICAgICAgICAgaWYoIWZhc3RfaXBoZHJfY2hlY2soc2tiLCBFVEhfUF9JUFY2KSkgCiAgICAgCXsKIAkgICAgCWlwNmhkcl9lcnJfbnVtKys7CmRpZmYgLS1naXQgYS9hcC9vcy9saW51eC9saW51eC0zLjQueC9uZXQvY29yZS9mYXN0cHJvYy9mYXN0X3RyYWNrLmMgYi9hcC9vcy9saW51eC9saW51eC0zLjQueC9uZXQvY29yZS9mYXN0cHJvYy9mYXN0X3RyYWNrLmMKaW5kZXggYzExODUyNi4uNWQ1NTQyNiAxMDA3NTUKLS0tIGEvYXAvb3MvbGludXgvbGludXgtMy40LngvbmV0L2NvcmUvZmFzdHByb2MvZmFzdF90cmFjay5jCisrKyBiL2FwL29zL2xpbnV4L2xpbnV4LTMuNC54L25ldC9jb3JlL2Zhc3Rwcm9jL2Zhc3RfdHJhY2suYwpAQCAtMTE5NiwyMCArMTE5Niw2IEBACiAJLndyaXRlID0gc2tiX2RlYnVnX29mZl9zZXQsDQogfTsNCiANCi1leHRlcm4gaW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NrZXRfcnBtc2cuYyBiL2FwL29zL2xpbnV4L2xpbnV4LTMuNC54L25ldC9zb2NrZXRfcnBtc2cuYwpuZXcgZmlsZSBtb2RlIDEwMDc1NQppbmRleCAwMDAwMDAwLi44NjdiOTQzCi0tLSAvZGV2L251bGwKKysrIGIvYXAvb3MvbGludXgvbGludXgtMy40LngvbmV0L3NvY2tldF9ycG1zZy5jCkBAIC0wLDAgKzEsMjY2MiBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgIEluY2x1ZGUgaGVhZGVyIGZpbGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKg0KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovDQorI2luY2x1ZGUgPGxpbnV4L21vZHVsZS5oPg0KKyNpbmNsdWRlIDxuZXQvc29jay5oPg0KKyNpbmNsdWRlIDxuZXQvYWZfdW5peC5oPg0KKyNpbmNsdWRlIDxsaW51eC9zeXNjYWxscy5oPg0KKyNpbmNsdWRlIDxsaW51eC9maWxlLmg+DQorLy8jaW5jbHVkZSAicmFtX2NvbmZpZy5oIg0KKyNpbmNsdWRlIDxsaW51eC9zb2NrZXRfcnBtc2cuaD4NCisNCisjZGVmaW5lIFNPQ0tfREFUQV9BTElHTihYKQlBTElHTihYLCBTTVBfQ0FDSEVfQllURVMpDQorI2RlZmluZSBTT0NLX0RBVEFfTUFYX0xFTiA4KjEwMjQNCisjZGVmaW5lICBJQ1BfQ0hOX1NPQ0tFVCAzMg0KKyNkZWZpbmUgc29ja19pbml0X3NlbWEgc2VtYV9pbml0DQorI2RlZmluZSBzb2NrX2dldF9zZW1hIGRvd25faW50ZXJydXB0aWJsZQ0KKyNkZWZpbmUgc29ja19wdXRfc2VtYSB1cA0KK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