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SzsKLQotCXN0YWNrX3NpemUgKz0gNDsgLyogZXh0cmEgZm9yIHNrYl9jb3B5X2JpdHMgYnVmZmVyICovCi0Jc3RhY2tfc2l6ZSA9IFNUQUNLX0FMSUdOKHN0YWNrX3NpemUpOwogCiAJLyoKIAkgKiBCUEYgcHJvZyBzdGFjayBsYXlvdXQKQEAgLTE2NSwxMiArMTY1LDEzIEBACiAJICogICAgICAgICAgICAgICAgICAgICAgICB8IC4uLiB8IGNhbGxlZSBzYXZlZCByZWdpc3RlcnMKIAkgKiAgICAgICAgICAgICAgICAgICAgICAgICstLS0tLSsKIAkgKiAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgIHwgeDI1L3gyNgotCSAqIEJQRiBmcCByZWdpc3RlciA9PiAtODA6Ky0tLS0tKworCSAqIEJQRiBmcCByZWdpc3RlciA9PiAtODA6Ky0tLS0tKyA8PSAoQlBGX0ZQKQogCSAqICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgfAogCSAqICAgICAgICAgICAgICAgICAgICAgICAgfCAuLi4gfCBCUEYgcHJvZyBzdGFjawogCSAqICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgfAotCSAqICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgfAotCSAqIGN1cnJlbnQgQTY0X1NQID0+ICAgICAgKy0tLS0tKworCSAqICAgICAgICAgICAgICAgICAgICAgICAgKy0tLS0tKyA8PSAoQlBGX0ZQIC0gTUFYX0JQRl9TVEFDSykKKwkgKiAgICAgICAgICAgICAgICAgICAgICAgIHxSU1ZEIHwgSklUIHNjcmF0Y2hwYWQKKwkgKiBjdXJyZW50IEE2NF9TUCA9PiAgICAgICstLS0tLSsgPD0gKEJQRl9GUCAtIFNUQUNLX1NJWkUpCiAJICogICAgICAgICAgICAgICAgICAgICAgICB8ICAgICB8CiAJICogICAgICAgICAgICAgICAgICAgICAgICB8IC4uLiB8IEZ1bmN0aW9uIGNhbGwgc3RhY2sKIAkgKiAgICAgICAgICAgICAgICAgICA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X2lkKQorCQlfX2ZpZWxkKGludCwgdGltZXJfaW5kZXgpCisJCV9fZmllbGQodTY0LCBjb25maWcpCisJCV9fZmllbGQoYm9vbCwgaG9zdCkKKwkpLAorCisJVFBfZmFzdF9hc3NpZ24oCisJCV9fZW50cnktPnZjcHVfaWQgPSB2Y3B1X2lkOworCQlfX2VudHJ5LT50aW1lcl9pbmRleCA9IHRpbWVyX2luZGV4OworCQlfX2VudHJ5LT5jb25maWcgPSBjb25maWc7CisJCV9fZW50cnktPmhvc3QgPSBob3N0OworCSksCisKKwlUUF9wcmludGsoInZjcHVfaWQgJWQgdGltZXIgJWQgY29uZmlnIDB4JWxseCBob3N0ICVkIiwKKwkJICBfX2VudHJ5LT52Y3B1X2lkLCBfX2VudHJ5LT50aW1lcl9pbmRleCwgX19lbnRyeS0+Y29uZmlnLAorCQkgIF9fZW50cnktPmhvc3QpCispOworCisvKgorICogVHJhY2Vwb2ludCBmb3Igc3RpbWVyX3NldF9jb3VudC4KKyAqLworVFJBQ0VfRVZFTlQoa3ZtX2h2X3N0aW1lcl9zZXRfY291bnQsCisJVFBfUFJPVE8oaW50IHZjcHVfaWQsIGludCB0aW1lcl9pbmRleCwgdTY0IGNvdW50LCBib29sIGhvc3QpLAorCVRQX0FSR1ModmNwdV9pZCwgdGltZXJfaW5kZXgsIGNvdW50LCBob3N0KSwKKworCVRQX1NUUlVDVF9fZW50cnkoCisJCV9fZmllbGQoaW50LCB2Y3B1X2lkKQorCQlfX2ZpZWxkKGludCwgdGltZXJfaW5kZXgpCisJCV9fZmllbGQodTY0LCBjb3VudCkKKwkJX19maWVsZChib29sLCBob3N0KQorCSksCisKKwlUUF9mYXN0X2Fzc2lnbigKKwkJX19lbnRyeS0+dmNwdV9pZCA9IHZjcHVfaWQ7CisJCV9fZW50cnktPnRpbWVyX2luZGV4ID0gdGltZXJfaW5kZXg7CisJCV9fZW50cnktPmNvdW50ID0gY291bnQ7CisJCV9fZW50cnktPmhvc3QgPSBob3N0OworCSksCis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mNfY291bnQoY2lyYykpCisJCXJldHVybiB0cnVlOworCXJldHVybiBmYWxzZTsKK30KKworc3RhdGljIGlubGluZSBib29sIF9fYWNwaV9hbWxfd3JpdGFibGUoc3RydWN0IGNpcmNfYnVmICpjaXJjLCB1bnNpZ25lZCBsb25nIGZsYWcpCit7CisJLyoKKwkgKiBBbm90aGVyIHdyaXRlIGlzIG5vdCBpbiBwcm9ncmVzcyBhbmQgdGhlcmUgaXMgYnVmZmVyIHNwYWNlCisJICogYXZhaWxhYmxlIGZvciB3cml0ZS4KKwkgKi8KKwlpZiAoIShhY3BpX2FtbF9pby5mbGFncyAmIGZsYWcpICYmIGNpcmNfc3BhY2UoY2lyYykpCisJCXJldHVybiB0cnVlOworCXJldHVybiBmYWxzZTsKK30KKworc3RhdGljIGlubGluZSBib29sIF9fYWNwaV9hbWxfYnVzeSh2b2lkKQoreworCWlmIChhY3BpX2FtbF9pby5mbGFncyAmIEFDUElfQU1MX0JVU1kpCisJCXJldHVybiB0cnVlOworCXJldHVybiBmYWxzZTsKK30KKworc3RhdGljIGlubGluZSBib29sIF9fYWNwaV9hbWxfb3BlbmVkKHZvaWQpCit7CisJaWYgKGFjcGlfYW1sX2lvLmZsYWdzICYgQUNQSV9BTUxfT1BFTikKKwkJcmV0dXJuIHRydWU7CisJcmV0dXJuIGZhbHNlOworfQorCitzdGF0aWMgaW5saW5lIGJvb2wgX19hY3BpX2FtbF91c2VkKHZvaWQpCit7CisJcmV0dXJuIGFjcGlfYW1sX2lvLnVzYWdlcyA/IHRydWUgOiBmYWxzZTsKK30KKworc3RhdGljIGlubGluZSBib29sIGFjcGlfYW1sX3J1bm5pbmcodm9pZCkKK3sKKwlib29sIHJldDsKKworCW11dGV4X2xvY2soJmFjcGlfYW1sX2lvLmxvY2spOworCXJldCA9IF9fYWNwaV9hbWxfcnVubmluZygpOworCW11dGV4X3VubG9jaygmYWNwaV9hbWxfaW8ubG9jayk7CisJcmV0dXJuIHJldDsKK30KKworc3RhdGljIGJ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bnZlcnRlcikgKHN0cnVjdCBhY3BpX25hbWVzcGFjZV9ub2RlICogc2NvcGUsCisJCQkJCSAgICAgdW5pb24gYWNwaV9vcGVyYW5kX29iamVjdAogCQkJCQkgICAgICpvcmlnaW5hbF9vYmplY3QsCiAJCQkJCSAgICAgdW5pb24gYWNwaV9vcGVyYW5kX29iamVjdAogCQkJCQkgICAgICoqY29udmVydGVkX29iamVjdCk7CkBAIC00MjAsNiArNDI4LDcgQEAKIAogc3RydWN0IGFjcGlfcmVnX3dhbGtfaW5mbyB7CiAJYWNwaV9hZHJfc3BhY2VfdHlwZSBzcGFjZV9pZDsKKwl1MzIgZnVuY3Rpb247CiAJdTMyIHJlZ19ydW5fY291bnQ7CiB9OwogCkBAIC04NjEsNiArODcwLDcgQEAKICNkZWZpbmUgQUNQSV9QQVJTRU9QX0NMT1NJTkdfUEFSRU4gICAgICAweDEwCiAjZGVmaW5lIEFDUElfUEFSU0VPUF9DT01QT1VORCAgICAgICAgICAgMHgyMAogI2RlZmluZSBBQ1BJX1BBUlNFT1BfQVNTSUdOTUVOVCAgICAgICAgIDB4NDAKKyNkZWZpbmUgQUNQSV9QQVJTRU9QX0VMU0VJRiAgICAgICAgICAgICAweDgwCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICoKZGlmZiAtLWdpdCBhL2RyaXZlcnMvYWNwaS9hY3BpY2EvYWNtYWNyb3MuaCBiL2RyaXZlcnMvYWNwaS9hY3BpY2EvYWNtYWNyb3MuaAppbmRleCBlODUzNjZjLi40MTFjMThiIDEwMDY0NAotLS0gYS9kcml2ZXJzL2FjcGkvYWNwaWNhL2FjbWFjcm9zLmgKKysrIGIvZHJpdmVycy9hY3BpL2FjcGljYS9hY21hY3Jvcy5oCkBAIC01LDcgKzUsNyBAQAogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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VBMRVRFICAgICAgIDB4MjAJLyogUmVnaW9uIHNldHVwIGlzIGNvbXBsZXRlICovCisjZGVmaW5lIEFPUE9CSl9JTlZBTElEICAgICAgICAgICAgICAweDQwCS8qIEhvc3QgT1Mgd29uJ3QgYWxsb3cgYSBSZWdpb24gYWRkcmVzcyAqLwogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgKgpkaWZmIC0tZ2l0IGEvZHJpdmVycy9hY3BpL2FjcGljYS9hY29wY29kZS5oIGIvZHJpdmVycy9hY3BpL2FjcGljYS9hY29wY29kZS5oCmluZGV4IGY5YWNmOTIuLmNhNGJkYTEgMTAwNjQ0Ci0tLSBhL2RyaXZlcnMvYWNwaS9hY3BpY2EvYWNvcGNvZGUuaAorKysgYi9kcml2ZXJzL2FjcGkvYWNwaWNhL2Fjb3Bjb2RlLmgKQEAgLTUsNyArNSw3IEBACiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIC8qCi0gKiBDb3B5cmlnaHQgKEMpIDIwMDAgLSAyMDE1LCBJbnRlbCBDb3JwLgorICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxNiwgSW50ZWwgQ29ycC4KICAqIEFsbCByaWdodHMgcmVzZXJ2ZWQuCiAgKgogICogUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0CkBAIC05Miw3ICs5Miw3IEBACiAjZGVmaW5lIEFSR1BfQllURUxJU1RfT1AgICAgICAgICAgICAgICAgQVJHUF9MSVNUMSAoQVJHUF9OQU1FU1RSSU5HKQogI2RlZmluZSBBUkdQX0NPTkNBVF9PUCAgICAgICAgICAgICAgICAgIEFSR1BfTElTVDMgKEFSR1BfVEVSTUFSRywgICA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ICAgICAgICAgICAgICAgIEFSR19OT05FCiAjZGVmaW5lIEFSR1BfT05FU19PUCAgICAgICAgICAgICAgICAgICAgQVJHX05PTkUKICNkZWZpbmUgQVJHUF9QQUNLQUdFX09QICAgICAgICAgICAgICAgICBBUkdQX0xJU1QzIChBUkdQX1BLR0xFTkdUSCwgIEFSR1BfQllURURBVEEsICAgICAgQVJHUF9EQVRBT0JKTElTVCkKICNkZWZpbmUgQVJHUF9QT1dFUl9SRVNfT1AgICAgICAgICAgICAgICBBUkdQX0xJU1Q1IChBUkdQX1BLR0xFTkdUSCwgIEFSR1BfTkFNRSwgICAgICAgICAgQVJHUF9CWVRFREFUQSwgIEFSR1BfV09SRERBVEEsICBBUkdQX09CSkxJU1QpCiAjZGVmaW5lIEFSR1BfUFJPQ0VTU09SX09QICAgICAgICAgICAgICAgQVJHUF9MSVNUNiAoQVJHUF9QS0dMRU5HVEgsICBBUkdQX05BTUUsICAgICAgICAgIEFSR1BfQllURURBVEEsICBBUkdQX0RXT1JEREFUQSwgQVJHUF9CWVRFREFUQSwgIEFSR1BfT0JKTElTVCkKICNkZWZpbmUgQVJHUF9RV09SRF9PUCAgICAgICAgICAgICAgICAgICBBUkdQX0xJU1QxIChBUkdQX1FXT1JEREFUQSkKLSNkZWZpbmUgQVJHUF9SRUZfT0ZfT1AgICAgICAgICAgICAgICAgICBBUkdQX0xJU1QxIChBUkdQX1NVUEVSTkFNRSkKKyNkZWZpbmUgQVJHUF9SRUZfT0ZfT1AgICAgICAgICAgICAgICAgICBBUkdQX0xJU1QxIChBUkdQX05BTUVfT1JfUkVGKQogI2RlZmluZSBBUkdQX1JFR0lPTl9PUCAgICAgICAgICAgICAgICAgIEFSR1BfTElTVDQgKEFSR1BfTkFNRSwgICAgICAgQVJHUF9CWVRFREFUQSwgICAgICBBUkdQX1RFUk1BUkcsICAgQVJHUF9URVJNQVJHKQogI2RlZmluZSBBUkdQX1JFTEVBU0VfT1AgICAgICAgICAgICAgICAgIEFSR1BfTElTV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ICAgICAgQVJHSV9JTlZBTElEX09QQ09ERQogI2RlZmluZSBBUkdJX0JZVEVMSVNUX09QICAgICAgICAgICAgICAgIEFSR0lfSU5WQUxJRF9PUENPREUKLSNkZWZpbmUgQVJHSV9DT05DQVRfT1AgICAgICAgICAgICAgICAgICBBUkdJX0xJU1QzIChBUkdJX0NPTVBVVEVEQVRBLEFSR0lfQ09NUFVURURBVEEsICAgQVJHSV9UQVJHRVRSRUYpCisjZGVmaW5lIEFSR0lfQ09OQ0FUX09QICAgICAgICAgICAgICAgICAgQVJHSV9MSVNUMyAoQVJHSV9BTllUWVBFLCAgICBBUkdJX0FOWVRZUEUsICAgICAgIEFSR0lfVEFSR0VUUkVGKQogI2RlZmluZSBBUkdJX0NPTkNBVF9SRVNfT1AgICAgICAgICAgICAgIEFSR0lfTElTVDMgKEFSR0lfQlVGRkVSLCAgICAgQVJHSV9CVUZGRVIsICAgICAgICBBUkdJX1RBUkdFVFJFRikKICNkZWZpbmUgQVJHSV9DT05EX1JFRl9PRl9PUCAgICAgICAgICAgICBBUkdJX0xJU1QyIChBUkdJX09CSkVDVF9SRUYsIEFSR0lfVEFSR0VUUkVGKQogI2RlZmluZSBBUkdJX0NPTk5FQ1RGSUVMRF9PUCAgICAgICAgICAgIEFSR0lfSU5WQUxJRF9PUENPREUKQEAgLTI4NSw2ICsyODUsNyBAQAogI2RlZmluZSBBUkdJX05BTUVQQVRIX09QICAgICAgICAgICAgICAgIEFSR0lfSU5WQUxJRF9PUENPREUKICNkZWZpbmUgQVJHSV9OT09QX09QICAgICAgICAgICAgICAgICAgICBBUkdfTk9ORQogI2RlZmluZSBBUkdJX05PVElGWV9PUCAgICAgICAgICAgICAgICAgIEFSR0lfTElTVDIgKEFSR0lfREVWSUNFX1JFRiwgQVJHSV9JTlRFR0VSKQorI2RlZmluZSBBUkdJX09CSkVDVF9UWVBFX09QICAgICAgICAgICAgIEFSR0lfTElTVDEgKEFSR0lfQU5ZVFlQRSkKICNkZWZpbmUgQVJH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hL2FtbGNvZGUuaCBiL2RyaXZlcnMvYWNwaS9hY3BpY2EvYW1sY29kZS5oCmluZGV4IDg4M2YyMGMuLmNlYjRmNzMgMTAwNjQ0Ci0tLSBhL2RyaXZlcnMvYWNwaS9hY3BpY2EvYW1sY29kZS5oCisrKyBiL2RyaXZlcnMvYWNwaS9hY3BpY2EvYW1sY29kZS5oCkBAIC03LDcgKzcsNyBAQAogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKgotICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxNSwgSW50ZWwgQ29ycC4KKyAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTYsIEludGVsIENvcnAuCiAgKiBBbGwgcmlnaHRzIHJlc2VydmVkLgogICoKICAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dApAQCAtMTIwLDcgKzEyMCw3IEBACiAjZGVmaW5lIEFNTF9DUkVBVEVfV09SRF9GSUVMRF9PUCAgICAodTE2KSAweDhiCiAjZGVmaW5lIEFNTF9DUkVBVEVfQllURV9GSUVMRF9PUCAgICAodTE2KSAweDhjCiAjZGVmaW5lIEFNTF9DUkVBVEVfQklUX0ZJRUxEX09QICAgICAodTE2KSAweDhkCi0jZGVmaW5lIEFNTF9UWVBFX09QICAgICAgICAgICAgICAgICAodTE2KSAweDhlCisjZGVmaW5lIEFNTF9PQkpFQ1RfVFlQRV9PUCAgICAgICAgICAodTE2KSAweDhlCiAjZGVmaW5lIEFNTF9DUkVBVEVfUVdPUkRfRklFTERfT1AgICAodTE2KSAweDhmCS8qIEFDUEkgMi4wICovCiAjZGVmaW5lIEFNTF9MQU5EX09QICAgICAgICAgICAgICAgICAodTE2KSAweDkwCiAjZGVmaW5lIEFNTF9MT1JfT1AgICAgICAgICAgICAgICAgICAodT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GFsbCB0YWJsZSBhbmQgZnJlZSB0aGUgYnVmZmVyICovCi0KLQkJYWNwaV90Yl9kZWxldGVfdGFibGVzX2J5X3R5cGUoQUNQSV9UQUJMRV9JRF9EU0RUKTsKLQkJcmV0dXJuX0FDUElfU1RBVFVTKHN0YXR1cyk7Ci0JfQotI2VuZGlmCi0jZW5kaWYKLQotCXJldHVybl9BQ1BJX1NUQVRVUyhzdGF0dXMpOwotfQotI2VuZGlmCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKgotICogRlVOQ1RJT046ICAgIGFjcGlfZGJfZ2V0X3RhYmxlX2Zyb21fZmlsZQotICoKLSAqIFBBUkFNRVRFUlM6ICBmaWxlbmFtZSAgICAgICAgLSBGaWxlIHdoZXJlIHRhYmxlIGlzIGxvY2F0ZWQKLSAqICAgICAgICAgICAgICByZXR1cm5fdGFibGUgICAgLSBXaGVyZSBhIHBvaW50ZXIgdG8gdGhlIHRhYmxlIGlzIHJldHVybmVkCi0gKgotICogUkVUVVJOOiAgICAgIFN0YXR1cwotICoKLSAqIERFU0NSSVBUSU9OOiBMb2FkIGFuIEFDUEkgdGFibGUgZnJvbSBhIGZpbGUKLSAqCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1hY3BpX3N0YXR1cwotYWNwaV9kYl9nZXRfdGFibGVfZnJvbV9maWxlKGNoYXIgKmZpbGVuYW1lLAotCQkJICAgIHN0cnVjdCBhY3BpX3RhYmxlX2hlYWRlciAqKnJldHVybl90YWJsZSwKLQkJCSAgICB1OCBtdXN0X2JlX2FtbF9maWxlKQotewotI2lmZGVmIEFDUElfQVBQTElDQVRJT04KIAlhY3BpX3N0YXR1cyBzdGF0dXM7CisJc3RydWN0IGFjcGlfbmV3X3RhYmxlX2Rlc2MgKnRhY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ICogRlVOQ1RJT046ICAgIGFjcGlfZGJfc2luZ2xlX3RocmVhZAotICoKLSAqIFBBUkFNRVRFUlM6ICBOb25lCi0gKgotICogUkVUVVJOOiAgICAgIE5vbmUKLSAqCi0gKiBERVNDUklQVElPTjogRGVidWdnZXIgZXhlY3V0ZSB0aHJlYWQuIFdhaXRzIGZvciBhIGNvbW1hbmQgbGluZSwgdGhlbgotICogICAgICAgICAgICAgIHNpbXBseSBkaXNwYXRjaGVzIGl0LgotICoKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXN0YXRpYyB2b2lkIGFjcGlfZGJfc2luZ2xlX3RocmVhZCh2b2lkKQotewotCi0JYWNwaV9nYmxfbWV0aG9kX2V4ZWN1dGluZyA9IEZBTFNFOwotCWFjcGlfZ2JsX3N0ZXBfdG9fbmV4dF9jYWxsID0gRkFMU0U7Ci0KLQkodm9pZClhY3BpX2RiX2NvbW1hbmRfZGlzcGF0Y2goYWNwaV9nYmxfZGJfbGluZV9idWYsIE5VTEwsIE5VTEwpOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICoKICAqIEZVTkNUSU9OOiAgICBhY3BpX2RiX3VzZXJfY29tbWFuZHMKICAqCi0gKiBQQVJBTUVURVJTOiAgcHJvbXB0ICAgICAgICAgICAgICAtIFVzZXIgcHJvbXB0IChkZXBlbmRzIG9uIG1vZGUpCi0gKiAgICAgICAgICAgICAgb3AgICAgICAgICAgICAgICAgICAtIEN1cnJlbnQgZXhlY3V0aW5nIHBhcnNlIG9wCisgKiBQQVJBTUVURVJTOiAgTm9uZQogICoKICAqIFJFVFVSTjogICAgICBOb25lCiAgKgpAQCAtMTIwNiw3ICsxMTczLDcgQEAKICAqCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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gICBTdGF0dXMKKyAqCisgKiBERVNDUklQVElPTjogQ2FsbGVkIGZvciBBTUxfQlJFQUtfUE9JTlRfT1AKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCit2b2lkIGFjcGlfZGJfc2lnbmFsX2JyZWFrX3BvaW50KHN0cnVjdCBhY3BpX3dhbGtfc3RhdGUgKndhbGtfc3RhdGUpCit7CisKKyNpZm5kZWYgQUNQSV9BUFBMSUNBVElPTgorCWlmIChhY3BpX2dibF9kYl90aHJlYWRfaWQgIT0gYWNwaV9vc19nZXRfdGhyZWFkX2lkKCkpIHsKKwkJcmV0dXJuOworCX0KKyNlbmRpZgorCisJLyoKKwkgKiBTZXQgdGhlIHNpbmdsZS1zdGVwIGZsYWcuIFRoaXMgd2lsbCBjYXVzZSB0aGUgZGVidWdnZXIgKGlmIHByZXNlbnQpCisJICogdG8gYnJlYWsgdG8gdGhlIGNvbnNvbGUgd2l0aGluIHRoZSBBTUwgZGVidWdnZXIgYXQgdGhlIHN0YXJ0IG9mIHRoZQorCSAqIG5leHQgQU1MIGluc3RydWN0aW9uLgorCSAqLworCWFjcGlfZ2JsX2NtX3NpbmdsZV9zdGVwID0gVFJVRTsKKwlhY3BpX29zX3ByaW50ZigiKipicmVhayoqIEV4ZWN1dGVkIEFNTCBCcmVha1BvaW50IG9wY29kZVxuIik7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgogICogRlVOQ1RJT046ICAgIGFjcGlfZGJfc2luZ2xlX3N0ZXAKICAqCiAgKiBQQVJBTUVURVJTOiAgd2Fsa19zdGF0ZSAgICAgIC0gQ3VycmVudCB3YWxrCkBAIC00MjAsMTUgKzQzMCw3IEBACiAKIAkJLyogVGhlc2Ugd2VyZSBjcmVhdGVkIHdpdGggb25l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KdXN0IGJhaWwgb3V0IHRlbGxpbmcKKwkJCSAqIHRoZSB3YWxrIHJvdXRpbmUgdG8gbm90IHRyYXZlcnNlIHRoaXMgYnJhbmNoLiBUaGlzIHByZXNlcnZlcworCQkJICogdGhlIHNjb3BpbmcgcnVsZSBmb3IgaGFuZGxlcnMuCisJCQkgKi8KKwkJCXJldHVybiAoQUVfQ1RSTF9ERVBUSCk7CiAJCX0KIAogCQkvKgpAQCAtMzA5LDYgKzMwNSw0NCBAQAogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICoKKyAqIEZVTkNUSU9OOiAgICBhY3BpX2V2X2ZpbmRfcmVnaW9uX2hhbmRsZXIKKyAqCisgKiBQQVJBTUVURVJTOiAgc3BhY2VfaWQgICAgICAgIC0gVGhlIGFkZHJlc3Mgc3BhY2UgSUQKKyAqICAgICAgICAgICAgICBoYW5kbGVyX29iaiAgICAgLSBIZWFkIG9mIHRoZSBoYW5kbGVyIG9iamVjdCBsaXN0CisgKgorICogUkVUVVJOOiAgICAgIE1hdGNoaW5nIGhhbmRsZXIgb2JqZWN0LiBOVUxMIGlmIHNwYWNlIElEIG5vdCBtYXRjaGVkCisgKgorICogREVTQ1JJUFRJT046IFNlYXJjaCBhIGhhbmRsZXIgb2JqZWN0IGxpc3QgZm9yIGEgbWF0Y2ggb24gdGhlIGFkZHJlc3MKKyAqICAgICAgICAgICAgICBzcGFjZSBJRC4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCit1bmlvbiBhY3BpX29wZXJhbmRfb2JqZWN0ICphY3BpX2V2X2ZpbmRfcmVnaW9uX2hhbmRsZXIoYWNwaV9hZHJfc3BhY2VfdHlwZQorCQkJCQkJICAgICAgIHNwYWNlX2lkLAorCQkJCQkJICAgICAgIHVuaW9uIG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lmCi0KICNpZm5kZWYgQUNQSV9OT19FUlJPUl9NRVNTQUdFUwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICAqCkBAIC04MCw3ICs3MCw2IEBACiAgKiBlbmFibGVkIGlmIG5lY2Vzc2FyeS4KICAqCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCiB2b2lkCiBhY3BpX2V4X2RvX2RlYnVnX29iamVjdCh1bmlvbiBhY3BpX29wZXJhbmRfb2JqZWN0ICpzb3VyY2VfZGVzYywKIAkJCXUzMiBsZXZlbCwgdTMyIGluZGV4KQpAQCAtOTksMjAgKzg4LDQwIEBACiAJCXJldHVybl9WT0lEOwogCX0KIAotCS8qCi0JICogV2Ugd2lsbCBlbWl0IHRoZSBjdXJyZW50IHRpbWVyIHZhbHVlIChpbiBtaWNyb3NlY29uZHMpIHdpdGggZWFjaAotCSAqIGRlYnVnIG91dHB1dC4gT25seSBuZWVkIHRoZSBsb3dlciAyNiBiaXRzLiBUaGlzIGFsbG93cyBmb3IgNjcKLQkgKiBtaWxsaW9uIG1pY3Jvc2Vjb25kcyBvciA2NyBzZWNvbmRzIGJlZm9yZSByb2xsb3Zlci4KLQkgKi8KLQl0aW1lciA9ICgodTMyKWFjcGlfb3NfZ2V0X3RpbWVyKCkgLyAxMCk7CS8qICgxMDAgbmFub3NlY29uZHMgdG8gbWljcm9zZWNvbmRzKSAqLwotCXRpbWVyICY9IDB4MDNGRkZGRkY7CisJLyogTnVsbCBzdHJpbmcgb3IgbmV3bGluZSAtLSBkb24ndCBlbWl0IHRoZSBsaW5lIGhlYWRlciAqLworCisJaWYgKHNvdXJjZV9kZXNjICYmCisJICAgIChBQ1BJX0dFVF9ERVNDUklQVE9SX1RZUEUoc291cmNlX2Rlc2MpID09IEFDUElfREVTQ19UW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vYmplY3QKKwkJCQkJCSAgICAoKnNvdXJjZV9kZXNjLT5yZWZlcmVuY2UuCisJCQkJCQkgICAgIHdoZXJlLCBsZXZlbCArIDQsIDApOworCQkJCQl9CiAJCQkJCWJyZWFrOwogCiAJCQkJZGVmYXVsdDoKQEAgLTMxMSw3ICszMzMsNyBAQAogCiAJZGVmYXVsdDoKIAotCQlhY3BpX29zX3ByaW50ZigiJXBcbiIsIHNvdXJjZV9kZXNjKTsKKwkJYWNwaV9vc19wcmludGYoIihEZXNjcmlwdG9yICVwKVxuIiwgc291cmNlX2Rlc2MpOwogCQlicmVhazsKIAl9CiAKQEAgLTMxOSwzMTYgKzM0MSwzIEBACiAJcmV0dXJuX1ZPSUQ7CiB9CiAjZW5kaWYKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqCi0gKiBGVU5DVElPTjogICAgYWNwaV9leF9pbnRlcnByZXRlcl90cmFjZV9lbmFibGVkCi0gKgotICogUEFSQU1FVEVSUzogIG5hbWUgICAgICAgICAgICAgICAgLSBXaGV0aGVyIG1ldGhvZCBuYW1lIHNob3VsZCBiZSBtYXRjaGVkLAotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzIHNob3VsZCBiZSBjaGVja2VkIGJlZm9yZSBzdGFydGluZwotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgdHJhY2VyCi0gKgotICogUkVUVVJOOiAgICAgIFRSVUUgaWYgaW50ZXJwcmV0ZXIgdHJhY2UgaXMgZW5hYmxlZC4KLSAqCi0gKiBERVNDUklQVElPTjogQ2hlY2sgd2hldGhlciBpbnRlcnByZXRlciB0cmFjZSBpcyBlbmFibGVkCi0gKgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotc3RhdG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1BJX1RSQUNFX09ORVNIT1QpICYmCi0JICAgICFhY3BpX2dibF90cmFjZV9tZXRob2RfbmFtZSkgewotCQlyZXR1cm4gKEZBTFNFKTsKLQl9Ci0KLQlyZXR1cm4gKFRSVUUpOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICoKLSAqIEZVTkNUSU9OOiAgICBhY3BpX2V4X2dldF90cmFjZV9ldmVudF9uYW1lCi0gKgotICogUEFSQU1FVEVSUzogIHR5cGUgICAgICAgICAgICAtIFRyYWNlIGV2ZW50IHR5cGUKLSAqCi0gKiBSRVRVUk46ICAgICAgVHJhY2UgZXZlbnQgbmFtZS4KLSAqCi0gKiBERVNDUklQVElPTjogVXNlZCB0byBvYnRhaW4gdGhlIGZ1bGwgdHJhY2UgZXZlbnQgbmFtZS4KLSAqCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaWZkZWYgQUNQSV9ERUJVR19PVVRQVVQKLQotc3RhdGljIGNvbnN0IGNoYXIgKmFjcGlfZXhfZ2V0X3RyYWNlX2V2ZW50X25hbWUoYWNwaV90cmFjZV9ldmVudF90eXBlIHR5cGUpCi17Ci0Jc3dpdGNoICh0eXBlKSB7Ci0JY2FzZSBBQ1BJX1RSQUNFX0FNTF9NRVRIT0Q6Ci0KLQkJcmV0dXJuICJNZXRob2QiOwotCi0JY2FzZSBBQ1BJX1RSQUNFX0FNTF9PUENPREU6Ci0KLQkJcmV0dXJuICJPcGNvZGUiOwotCi0JY2FzZSBBQ1BJX1RSQUNFX0FNTF9SRUdJT046Ci0KLQkJcmV0dXJuICJSZWdpb24iOwotCi0JZGVmYXVsdDoKLQotCQlyZXR1cm4gIiI7Ci0JfQotfQotCi0jZW5kaWYKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqCi0gKiBGVU5DVElPTjogICAgYWNwaV9leF90cmFjZV9wb2ludAotICoKLSAqIFBBUkFNRVRFUlM6ICB0eXBlICAgICAgICAgICAgICAgIC0gVHJhY2UgZXZlbnQgdHlwZQotICogICAgICAgICAgICAgIGJlZ2luICAgICAgICAgICAgICAgLSBUUlVFIGlmIGJlZm9yZSBleGVjdXRpb24KLSAqICAgICAgICAgICAgICBhbWwgICAgICAgICAgICAgICAgIC0gRXhlY3V0ZWQgQU1MIGFkZHJlc3MKLSAqICAgICAgICAgICAgICBwYXRobmFtZSAgICAgICAgICAgIC0gT2JqZWN0IHBhdGgKLSAqCi0gKiBSRVRVUk46ICAgICAgTm9uZQotICoKLSAqIERFU0NSSVBUSU9OOiBJbnRlcm5hbCBpbnRlcnByZXRlciBleGVjdXRpb24gdHJhY2UuCi0gKgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZAotYWNwaV9leF90cmFjZV9wb2ludChhY3BpX3RyYWNlX2V2ZW50X3R5cGUgdHlwZSwKLQkJICAgIHU4IGJlZ2luLCB1OCAqYW1sLCBjaGFyICpwYXRobmFtZSkKLXsKLQotCUFDUElfRlVOQ1RJT05fTkFNRShleF90cmFjZV9wb2ludCk7Ci0KLQlpZiAocGF0aG5hbWUpIHsKLQkJQUNQSV9ERUJVR19QUklOVCgoQUNQSV9EQl9UUkFDRV9QT0lOVCwKLQkJCQkgICIlcyAlcyBbMHglcDolc10gZXhlY3V0aW9uLlxuIiwKLQkJCQkgIGFjcGlfZXhfZ2V0X3RyYWNlX2V2ZW50X25hbWUodHlwZSksCi0JCQkJICBiZWdpbiA/ICJCZWdpbiIgOiAiRW5kIiwgYW1sLCBwYXRobmFtZSkpOwotCX0gZWxzZSB7Ci0JCUFDUElfREVCVUdfUFJJTlQoKEFDUElfREJfVFJBQ0VfUE9JTlQsCi0JCQkJICAiJXMgJXMgWzB4JXBdIGV4ZWN1dGlvbi5cbiIsCi0JCQkJICBhY3BpX2V4X2dldF90cmFjZV9ldmVudF9uYW1lKHR5cGUpLAotCQkJCSAgYmVnaW4gPyAiQmVnaW4iIDogIkVuZCIsIGFtbCkpOwotCX0KLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqCi0gKiBGVU5DVElPTjogICAgYWNwaV9leF9zdGFydF90cmFjZV9tZXRob2QKLSAqCi0gKiBQQVJBTUVURVJTOiAgbWV0aG9kX25vZGUgICAgICAgICAtIE5vZGUgb2YgdGhlIG1ldGhvZAotICogICAgICAgICAgICAgIG9ial9kZXNjICAgICAgICAgICAgLSBUaGUgbWV0aG9kIG9iamVjdAotICogICAgICAgICAgICAgIHdhbGtfc3RhdGUgICAgICAgICAgLSBjdXJyZW50IHN0YXRlLCBOVUxMIGlmIG5vdCB5ZXQgZXhlY3V0aW5nCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGEgbWV0aG9kLgotICoKLSAqIFJFVFVSTjogICAgICBOb25lCi0gKgotICogREVTQ1JJUFRJT046IFN0YXJ0IGNvbnRyb2wgbWV0aG9kIGV4ZWN1dGlvbiB0cmFjZQotICoKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQKLWFjcGlfZXhfc3RhcnRfdHJhY2VfbWV0aG9kKHN0cnVjdCBhY3BpX25hbWVzcGFjZV9ub2RlICptZXRob2Rfbm9kZSwKLQkJCSAgIHVuaW9uIGFjcGlfb3BlcmFuZF9vYmplY3QgKm9ial9kZXNjLAotCQkJICAgc3RydWN0IGFjcGlfd2Fsa19zdGF0ZSAqd2Fsa19zdGF0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iZ19sYXllciA9IGFjcGlfZ2JsX3RyYWNlX2RiZ19sYXllcjsKLQkJfQotCX0KLQkodm9pZClhY3BpX3V0X3JlbGVhc2VfbXV0ZXgoQUNQSV9NVFhfTkFNRVNQQUNFKTsKLQotZXhpdDoKLQlpZiAoZW5hYmxlZCkgewotCQlBQ1BJX1RSQUNFX1BPSU5UKEFDUElfVFJBQ0VfQU1MX01FVEhPRCwgVFJVRSwKLQkJCQkgb2JqX2Rlc2MgPyBvYmpfZGVzYy0+bWV0aG9kLmFtbF9zdGFydCA6IE5VTEwsCi0JCQkJIHBhdGhuYW1lKTsKLQl9Ci0JaWYgKHBhdGhuYW1lKSB7Ci0JCUFDUElfRlJFRShwYXRobmFtZSk7Ci0JfQotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICoKLSAqIEZVTkNUSU9OOiAgICBhY3BpX2V4X3N0b3BfdHJhY2VfbWV0aG9kCi0gKgotICogUEFSQU1FVEVSUzogIG1ldGhvZF9ub2RlICAgICAgICAgLSBOb2RlIG9mIHRoZSBtZXRob2QKLSAqICAgICAgICAgICAgICBvYmpfZGVzYyAgICAgICAgICAgIC0gVGhlIG1ldGhvZCBvYmplY3QKLSAqICAgICAgICAgICAgICB3YWxrX3N0YXRlICAgICAgICAgIC0gY3VycmVudCBzdGF0ZSwgTlVMTCBpZiBub3QgeWV0IGV4ZWN1dGluZwotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhIG1ldGhvZC4KLSAqCi0gKiBSRVRVUk46ICAgICAgTm9uZQotICoKLSAqIERFU0NSSVBUSU9OOiBTdG9wIGNvbnRyb2wgbWV0aG9kIGV4ZWN1dGlvbiB0cmFjZQotICoKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQKLWF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dGluZwotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhIG1ldGhvZC4KLSAqCi0gKiBSRVRVUk46ICAgICAgTm9uZQotICoKLSAqIERFU0NSSVBUSU9OOiBTdGFydCBvcGNvZGUgZXhlY3V0aW9uIHRyYWNlCi0gKgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZAotYWNwaV9leF9zdGFydF90cmFjZV9vcGNvZGUodW5pb24gYWNwaV9wYXJzZV9vYmplY3QgKm9wLAotCQkJICAgc3RydWN0IGFjcGlfd2Fsa19zdGF0ZSAqd2Fsa19zdGF0ZSkKLXsKLQotCUFDUElfRlVOQ1RJT05fTkFNRShleF9zdGFydF90cmFjZV9vcGNvZGUpOwotCi0JaWYgKGFjcGlfZXhfaW50ZXJwcmV0ZXJfdHJhY2VfZW5hYmxlZChOVUxMKSAmJgotCSAgICAoYWNwaV9nYmxfdHJhY2VfZmxhZ3MgJiBBQ1BJX1RSQUNFX09QQ09ERSkpIHsKLQkJQUNQSV9UUkFDRV9QT0lOVChBQ1BJX1RSQUNFX0FNTF9PUENPREUsIFRSVUUsCi0JCQkJIG9wLT5jb21tb24uYW1sLCBvcC0+Y29tbW9uLmFtbF9vcF9uYW1lKTsKLQl9Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKgotICogRlVOQ1RJT046ICAgIGFjcGlfZXhfc3RvcF90cmFjZV9vcGNvZGUKLSAqCi0gKiBQQVJBTUVURVJTOiAgb3AgICAgICAgICAgICAgICAgICAtIFRoZSBwYXJzZXIgb3Bjb2RlIG9iamVjdAotICogICAgICAgICAgICAgIHdhbGtfc3RhdGUgICAgICAgICAgLSBjdXJyZW50IHN0YXRlLCBOVUxMIGlmIG5vdCB5ZXQgZXhlY3V0a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ioqKioqKioqKioqLwogCiAvKgotICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxNSwgSW50ZWwgQ29ycC4KKyAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTYsIEludGVsIENvcnAuCiAgKiBBbGwgcmlnaHRzIHJlc2VydmVkLgogICoKICAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dApAQCAtMzEwLDYgKzMxMCw3IEBACiAKIAkJQUNQSV9FUlJPUigoQUVfSU5GTywgIlVua25vd24gQU1MIG9wY29kZSAweCVYIiwKIAkJCSAgICB3YWxrX3N0YXRlLT5vcGNvZGUpKTsKKwogCQlzdGF0dXMgPSBBRV9BTUxfQkFEX09QQ09ERTsKIAkJZ290byBjbGVhbnVwOwogCX0KZGlmZiAtLWdpdCBhL2RyaXZlcnMvYWNwaS9hY3BpY2EvZXhwcmVwLmMgYi9kcml2ZXJzL2FjcGkvYWNwaWNhL2V4cHJlcC5jCmluZGV4IDRjMjgzNmQuLmFlZDhkMzQgMTAwNjQ0Ci0tLSBhL2RyaXZlcnMvYWNwaS9hY3BpY2EvZXhwcmVwLmMKKysrIGIvZHJpdmVycy9hY3BpL2FjcGljYS9leHByZXAuYwpAQCAtMSwxMSArMSwxMSBAQAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICoKLSAqIE1vZHVsZSBOYW1lOiBleHByZXAgLSBBQ1BJIEFNTCAocC1jb2RlKSBleGVjdXRpb24gLSBmaWVsZCBwcmVwIHV0aWxpdGllcworICogTW9kdWxlIE5hbWU6IGV4cHJlcCAtIEFDUEkgQU1MIGZpZWxkIHByZXAgdXRpbGl0aWVzCiAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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C0xLDExICsxLDExIEBACiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgKgotICogTW9kdWxlIE5hbWU6IGV4c3Rvcm9iIC0gQU1MIEludGVycHJldGVyIG9iamVjdCBzdG9yZSBzdXBwb3J0LCBzdG9yZSB0byBvYmplY3QKKyAqIE1vZHVsZSBOYW1lOiBleHN0b3JvYiAtIEFNTCBvYmplY3Qgc3RvcmUgc3VwcG9ydCwgc3RvcmUgdG8gb2JqZWN0CiAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKgotICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxNSwgSW50ZWwgQ29ycC4KKyAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTYsIEludGVsIENvcnAuCiAgKiBBbGwgcmlnaHRzIHJlc2VydmVkLgogICoKICAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dApAQCAtMjAzLDggKzIwMyw5IEBACiAJCQlBQ1BJX0ZSRUUodGFyZ2V0X2Rlc2MtPnN0cmluZy5wb2ludGVyKTsKIAkJfQogCi0JCXRhcmdldF9kZXNjLT5zdHJpbmcucG9pbnRlciA9IEFDUElfQUxMT0NBVEVfWkVST0VEKChhY3BpX3NpemUpCi0JCQkJCQkJCSAgIGxlbmd0aCArIDEpOworCQl0YXJnZXRfZGVzYy0+c3RyaW5nLnBvaW50ZXIgPQorCQkgICAgQUNQSV9BTExPQ0FURV9aRVJPRUQoKGFjcGlfc2l6ZSkgbGVuZ3RoICsgMSk7CisKIAkJaWYgKCF0YXJnZXRfZGVzYy0+c3RyaW5nLnBvaW50ZXIpIHsKIAkJCXJldHVybl9BQ1BJX1NUQVRVUyhBRV9O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CisgKgorICogUEFSQU1FVEVSUzogIG5hbWUgICAgICAgICAgICAgICAgLSBXaGV0aGVyIG1ldGhvZCBuYW1lIHNob3VsZCBiZSBtYXRjaGVkLAorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzIHNob3VsZCBiZSBjaGVja2VkIGJlZm9yZSBzdGFydGluZworICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgdHJhY2VyCisgKgorICogUkVUVVJOOiAgICAgIFRSVUUgaWYgaW50ZXJwcmV0ZXIgdHJhY2UgaXMgZW5hYmxlZC4KKyAqCisgKiBERVNDUklQVElPTjogQ2hlY2sgd2hldGhlciBpbnRlcnByZXRlciB0cmFjZSBpcyBlbmFibGVkCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworc3RhdGljIHU4IGFjcGlfZXhfaW50ZXJwcmV0ZXJfdHJhY2VfZW5hYmxlZChjaGFyICpuYW1lKQoreworCisJLyogQ2hlY2sgaWYgdHJhY2luZyBpcyBlbmFibGVkICovCisKKwlpZiAoIShhY3BpX2dibF90cmFjZV9mbGFncyAmIEFDUElfVFJBQ0VfRU5BQkxFRCkpIHsKKwkJcmV0dXJuIChGQUxTRSk7CisJfQorCisJLyoKKwkgKiBDaGVjayBpZiB0cmFjaW5nIGlzIGZpbHRlcmVkOgorCSAqCisJICogMS4gSWYgdGhlIHRyYWNlciBpcyBzdGFydGVkLCBhY3BpX2dibF90cmFjZV9tZXRob2Rfb2JqZWN0IHNob3VsZCBoYXZlCisJICogICAgYmVlbiBmaWxsZWQgYnkgdGhlIHRyYWNlIHN0YXJ0ZXIKKwkgKiAyLiBJZiB0aGUgdHJhY2VyIGlzIG5vdCBzdGFydGVkLCBhY3BpX2dibF90cmFjZV9tZXRob2RfbmFtZSBzaG91bGQgYmUKKwkgKiAgICBtYXRjaGVkIGlmIGl0IGlzIHNwZWNpZmllZAorCSAqIDMuIElmIHRoZSB0cmFjZXIgaXMgb25lc2hvdCBzdHlsZSwgYWNwaV9nYmxfdHJhY2VfbWV0aG9kX25hbWUgc2hvdWxkCisJICogICAgbm90IGJlIGNsZWFyZWQgYnkgdGhlIHRyYWNlIHN0b3BwZXIgZHVyaW5nIHRoZSBmaXJzdCBtYXRjaAorCSAqLworCWlmIChhY3BpX2dibF90cmFjZV9tZXRob2Rfb2JqZWN0KSB7CisJCXJldHVybiAoVFJVRSk7CisJfQorCisJaWYgKG5hbWUgJiYKKwkgICAgKGFjcGlfZ2JsX3RyYWNlX21ldGhvZF9uYW1lICYmCisJICAgICBzdHJjbXAoYWNwaV9nYmxfdHJhY2VfbWV0aG9kX25hbWUsIG5hbWUpKSkgeworCQlyZXR1cm4gKEZBTFNFKTsKKwl9CisKKwlpZiAoKGFjcGlfZ2JsX3RyYWNlX2ZsYWdzICYgQUNQSV9UUkFDRV9PTkVTSE9UKSAmJgorCSAgICAhYWNwaV9nYmxfdHJhY2VfbWV0aG9kX25hbWUpIHsKKwkJcmV0dXJuIChGQUxTRSk7CisJfQorCisJcmV0dXJuIChUUlVFKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBGVU5DVElPTjogICAgYWNwaV9leF9nZXRfdHJhY2VfZXZlbnRfbmFtZQorICoKKyAqIFBBUkFNRVRFUlM6ICB0eXBlICAgICAgICAgICAgLSBUcmFjZSBldmVudCB0eXBlCisgKgorICogUkVUVVJOOiAgICAgIFRyYWNlIGV2ZW50IG5hbWUuCisgKgorICogREVTQ1JJUFRJT046IFVzZWQgdG8gb2J0YWluIHRoZSBmdWxsIHRyYWNlIGV2ZW50IG5hbWUuCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI2lmZGVmIEFDUElfREVCVUdfT1VUUFVUCisKK3N0YXRpYyBjb25zdCBjaGFyICphY3BpX2V4X2dldF90cmFjZV9ldmVudF9uYW1lKGFjcGlfdHJhY2VfZXZlbnRfdHlwZSB0eXBlKQoreworCisJc3dpdGNoICh0eXBlKSB7CisJY2FzZSBBQ1BJX1RSQUNFX0FNTF9NRVRIT0Q6CisKKwkJcmV0dXJuICJNZXRob2QiOworCisJY2FzZSBBQ1BJX1RSQUNFX0FNTF9PUENPREU6CisKKwkJcmV0dXJuICJPcGNvZGUiOworCisJY2FzZSBBQ1BJX1RSQUNFX0FNTF9SRUdJT046CisKKwkJcmV0dXJuICJSZWdpb24iOworCisJZGVmYXVsdDoKKworCQlyZXR1cm4gIiI7CisJfQorfQorCisjZW5kaWYKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBGVU5DVElPTjogICAgYWNwaV9leF90cmFjZV9wb2ludAorICoKKyAqIFBBUkFNRVRFUlM6ICB0eXBlICAgICAgICAgICAgICAgIC0gVHJhY2UgZXZlbnQgdHlwZQorICogICAgICAgICAgICAgIGJlZ2luICAgICAgICAgICAgICAgLSBUUlVFIGlmIGJlZm9yZSBleGVjdXRpb24KKyAqICAgICAgICAgICAgICBhbWwgICAgICAgICAgICAgICAgIC0gRXhlY3V0ZWQgQU1MIGFkZHJlc3MKKyAqICAgICAgICAgICAgICBwYXRobmFtZSAgICAgICAgICAgIC0gT2JqZWN0IHBhdGgKKyAqCisgKiBSRVRVUk46ICAgICAgTm9uZQorICoKKyAqIERFU0NSSVBUSU9OOiBJbnRlcm5hbCBpbnRlcnByZXRlciBleGVjdXRpb24gdHJhY2UuCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordm9pZAorYWNwaV9leF90cmFjZV9wb2ludChhY3BpX3RyYWNlX2V2ZW50X3R5cGUgdHlwZSwKKwkJICAgIHU4IGJlZ2luLCB1OCAqYW1sLCBjaGFyICpwYXRobmFtZSkKK3sKKworCUFDUElfRlVOQ1RJT05fTkFNRShleF90cmFjZV9wb2ludCk7CisKKwlpZiAocGF0aG5hbWUpIHsKKwkJQUNQSV9ERUJVR19QUklOVCgoQUNQSV9EQl9UUkFDRV9QT0lOVCwKKwkJCQkgICIlcyAlcyBbMHglcDolc10gZXhlY3V0aW9uLlxuIiwKKwkJCQkgIGFjcGlfZXhfZ2V0X3RyYWNlX2V2ZW50X25hbWUodHlwZSksCisJCQkJICBiZWdpbiA/ICJCZWdpbiIgOiAiRW5kIiwgYW1sLCBwYXRobmFtZSkpOworCX0gZWxzZSB7CisJCUFDUElfREVCVUdfUFJJTlQoKEFDUElfREJfVFJBQ0VfUE9JTlQsCisJCQkJICAiJXMgJXMgWzB4JXBdIGV4ZWN1dGlvbi5cbiIsCisJCQkJICBhY3BpX2V4X2dldF90cmFjZV9ldmVudF9uYW1lKHR5cGUpLAorCQkJCSAgYmVnaW4gPyAiQmVnaW4iIDogIkVuZCIsIGFtbCkpOworCX0KK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBGVU5DVElPTjogICAgYWNwaV9leF9zdGFydF90cmFjZV9tZXRob2QKKyAqCisgKiBQQVJBTUVURVJTOiAgbWV0aG9kX25vZGUgICAgICAgICAtIE5vZGUgb2YgdGhlIG1ldGhvZAorICogICAgICAgICAgICAgIG9ial9kZXNjICAgICAgICAgICAgLSBUaGUgbWV0aG9kIG9iamVjdAorICogICAgICAgICAgICAgIHdhbGtfc3RhdGUgICAgICAgICAgLSBjdXJyZW50IHN0YXRlLCBOVUxMIGlmIG5vdCB5ZXQgZXhlY3V0aW5nCisgKiAgICAgICAgICAgICAgICAgICAgICAgICA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GhuYW1lKTsKKwl9Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogRlVOQ1RJT046ICAgIGFjcGlfZXhfc3RhcnRfdHJhY2Vfb3Bjb2RlCisgKgorICogUEFSQU1FVEVSUzogIG9wICAgICAgICAgICAgICAgICAgLSBUaGUgcGFyc2VyIG9wY29kZSBvYmplY3QKKyAqICAgICAgICAgICAgICB3YWxrX3N0YXRlICAgICAgICAgIC0gY3VycmVudCBzdGF0ZSwgTlVMTCBpZiBub3QgeWV0IGV4ZWN1dGluZworICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhIG1ldGhvZC4KKyAqCisgKiBSRVRVUk46ICAgICAgTm9uZQorICoKKyAqIERFU0NSSVBUSU9OOiBTdGFydCBvcGNvZGUgZXhlY3V0aW9uIHRyYWNlCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordm9pZAorYWNwaV9leF9zdGFydF90cmFjZV9vcGNvZGUodW5pb24gYWNwaV9wYXJzZV9vYmplY3QgKm9wLAorCQkJICAgc3RydWN0IGFjcGlfd2Fsa19zdGF0ZSAqd2Fsa19zdGF0ZSkKK3sKKworCUFDUElfRlVOQ1RJT05fTkFNRShleF9zdGFydF90cmFjZV9vcGNvZGUpOworCisJaWYgKGFjcGlfZXhfaW50ZXJwcmV0ZXJfdHJhY2VfZW5hYmxlZChOVUxMKSAmJgorCSAgICAoYWNwaV9nYmxfdHJhY2VfZmxhZ3MgJiBBQ1BJX1RSQUNFX09QQ09ERSkpIHsKKwkJQUNQSV9UUkFDRV9QT0lOVChBQ1BJX1RSQUNFX0FNTF9PUENPREUsIFRSVUUsCisJCQkJIG9wLT5jb21tb24uYW1sLCBvcC0+Y29tbW9uLmFtbF9vcF9uYW1lKTsKKwl9Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogRlVOQ1RJT046ICAgIGFjcGlfZXhfc3RvcF90cmFjZV9vcGNvZGUKKyAqCisgKiBQQVJBTUVURVJTOiAgb3AgICAgICAgICAgICAgICAgICAtIFRoZSBwYXJzZXIgb3Bjb2RlIG9iamVjdAorICogICAgICAgICAgICAgIHdhbGtfc3RhdGUgICAgICAgICAgLSBjdXJyZW50IHN0YXRlLCBOVUxMIGlmIG5vdCB5ZXQgZXhlY3V0aW5nCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGEgbWV0aG9kLgorICoKKyAqIFJFVFVSTjogICAgICBOb25lCisgKgorICogREVTQ1JJUFRJT046IFN0b3Agb3Bjb2RlIGV4ZWN1dGlvbiB0cmFjZQorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3ZvaWQKK2FjcGlfZXhfc3RvcF90cmFjZV9vcGNvZGUodW5pb24gYWNwaV9wYXJzZV9vYmplY3QgKm9wLAorCQkJICBzdHJ1Y3QgYWNwaV93YWxrX3N0YXRlICp3YWxrX3N0YXRlKQoreworCisJQUNQSV9GVU5DVElPTl9OQU1FKGV4X3N0b3BfdHJhY2Vfb3Bjb2RlKTsKKworCWlmIChhY3BpX2V4X2ludGVycHJldGVyX3RyYWNlX2VuYWJsZWQoTlVMTCkgJiYKKwkgICAgKGFjcGlfZ2JsX3RyYWNlX2ZsYWdzICYgQUNQSV9UUkFDRV9PUENPREUpKSB7CisJCUFDUElfVFJBQ0VfUE9JTlQoQUNQSV9UUkFDRV9BTUxfT1BDT0RFLCBGQUxTRSwKKwkJCQkgb3AtPmNvbW1vbi5hbWwsIG9wLT5jb21tb24uYW1sX29wX25hbWUpOworCX0KK30KZGlmZiAtL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FjcGlfc2V0X2Zpcm13YXJlX3dha2luZ192ZWN0b3I2NAogICogICAgICBhY3BpX2VudGVyX3NsZWVwX3N0YXRlX3M0YmlvcwogICovCiAKICNpZiAoIUFDUElfUkVEVUNFRF9IQVJEV0FSRSkKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgKgotICogRlVOQ1RJT046ICAgIGFjcGlfaHdfc2V0X2Zpcm13YXJlX3dha2luZ192ZWN0b3JzCisgKiBGVU5DVElPTjogICAgYWNwaV9od19zZXRfZmlybXdhcmVfd2FraW5nX3ZlY3RvcgogICoKICAqIFBBUkFNRVRFUlM6ICBmYWNzICAgICAgICAgICAgICAgIC0gUG9pbnRlciB0byBGQUNTIHRhYmxlCiAgKiAgICAgICAgICAgICAgcGh5c2ljYWxfYWRkcmVzcyAgICAtIDMyLWJpdCBwaHlzaWNhbCBhZGRyZXNzIG9mIEFDUEkgcmVhbCBtb2RlCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudHJ5IHBvaW50LgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnRyeSBwb2ludAogICogICAgICAgICAgICAgIHBoeXNpY2FsX2FkZHJlc3M2NCAgLSA2NC1iaXQgcGh5c2ljYWwgYWRkcmVzcyBvZiBBQ1BJIHByb3RlY3RlZAotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RlIGVudHJ5IHBvaW50LgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RlIGVudHJ5IHBvaW50CiAgKgogICogUkVUVVJOOiAgICAgIFN0YXR1cwogICoKQEAgLTEwMywxMSArMTAxLDExIEBACiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiBzdGF0aWMgYWNwaV9zd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aXZlcnMvYWNwaS9hY3BpY2EvbnNhcmd1bWVudHMuYwppbmRleCA1ZDM0N2E3Li5mNDViZmY2IDEwMDY0NAotLS0gYS9kcml2ZXJzL2FjcGkvYWNwaWNhL25zYXJndW1lbnRzLmMKKysrIGIvZHJpdmVycy9hY3BpL2FjcGljYS9uc2FyZ3VtZW50cy5jCkBAIC01LDcgKzUsNyBAQAogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKgotICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxNSwgSW50ZWwgQ29ycC4KKyAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTYsIEludGVsIENvcnAuCiAgKiBBbGwgcmlnaHRzIHJlc2VydmVkLgogICoKICAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dApkaWZmIC0tZ2l0IGEvZHJpdmVycy9hY3BpL2FjcGljYS9uc2NvbnZlcnQuYyBiL2RyaXZlcnMvYWNwaS9hY3BpY2EvbnNjb252ZXJ0LmMKaW5kZXggZGE1NWExYy4uODc4ZThmYiAxMDA2NDQKLS0tIGEvZHJpdmVycy9hY3BpL2FjcGljYS9uc2NvbnZlcnQuYworKysgYi9kcml2ZXJzL2FjcGkvYWNwaWNhL25zY29udmVydC5jCkBAIC02LDcgKzYsNyBAQAogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKgotICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxNSwgSW50ZWwgQ29ycC4KKyAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTYsIEludGVsIENvcnAuCiAgKiBBbGwgcmlnaHRzIHJlc2VydmVkLgogICoKICAqIFJlZGlzdHJpYnV0aW9uI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QnVmZmVyLgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK2FjcGlfc3RhdHVzCithY3BpX25zX2NvbnZlcnRfdG9fcmVmZXJlbmNlKHN0cnVjdCBhY3BpX25hbWVzcGFjZV9ub2RlICogc2NvcGUsCisJCQkgICAgIHVuaW9uIGFjcGlfb3BlcmFuZF9vYmplY3QgKm9yaWdpbmFsX29iamVjdCwKKwkJCSAgICAgdW5pb24gYWNwaV9vcGVyYW5kX29iamVjdCAqKnJldHVybl9vYmplY3QpCit7CisJdW5pb24gYWNwaV9vcGVyYW5kX29iamVjdCAqbmV3X29iamVjdCA9IE5VTEw7CisJYWNwaV9zdGF0dXMgc3RhdHVzOworCXN0cnVjdCBhY3BpX25hbWVzcGFjZV9ub2RlICpub2RlOworCXVuaW9uIGFjcGlfZ2VuZXJpY19zdGF0ZSBzY29wZV9pbmZvOworCWNoYXIgKm5hbWU7CisKKwlBQ1BJX0ZVTkNUSU9OX05BTUUobnNfY29udmVydF90b19yZWZlcmVuY2UpOworCisJLyogQ29udmVydCBwYXRoIGludG8gaW50ZXJuYWwgcHJlc2VudGF0aW9uICovCisKKwlzdGF0dXMgPQorCSAgICBhY3BpX25zX2ludGVybmFsaXplX25hbWUob3JpZ2luYWxfb2JqZWN0LT5zdHJpbmcucG9pbnRlciwgJm5hbWUpOworCWlmIChBQ1BJX0ZBSUxVUkUoc3RhdHVzKSkgeworCQlyZXR1cm5fQUNQSV9TVEFUVVMoc3RhdHVzKTsKKwl9CisKKwkvKiBGaW5kIHRoZSBuYW1lc3BhY2Ugbm9kZSAqLworCisJc2NvcGVfaW5mby5zY29wZS5ub2RlID0KKwkgICAgQUNQSV9DQVNUX1BUUihzdHJ1Y3QgYWNwaV9uYW1lc3BhY2Vfbm9kZSwgc2NvcGUpOworCXN0YXR1cyA9CisJICAgIGFjcGlfbnNfbG9va3VwKCZzY29wZV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AQCAtNSw3ICs1LDcgQEAKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIC8qCi0gKiBDb3B5cmlnaHQgKEMpIDIwMDAgLSAyMDE1LCBJbnRlbCBDb3JwLgorICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxNiwgSW50ZWwgQ29ycC4KICAqIEFsbCByaWdodHMgcmVzZXJ2ZWQuCiAgKgogICogUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0CmRpZmYgLS1naXQgYS9kcml2ZXJzL2FjcGkvYWNwaWNhL3JzbGlzdC5jIGIvZHJpdmVycy9hY3BpL2FjcGljYS9yc2xpc3QuYwppbmRleCA1MGQ1YmUyLi44YzQyZGQ3IDEwMDY0NAotLS0gYS9kcml2ZXJzL2FjcGkvYWNwaWNhL3JzbGlzdC5jCisrKyBiL2RyaXZlcnMvYWNwaS9hY3BpY2EvcnNsaXN0LmMKQEAgLTUsNyArNSw3IEBACiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKgotICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxNSwgSW50ZWwgQ29ycC4KKyAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTYsIEludGVsIENvcnAuCiAgKiBBbGwgcmlnaHRzIHJlc2VydmVkLgogICoKICAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dApAQCAtODksNiArODksNyBAQAogCS8qIEdldCB0aGUgYXBwcm9wcmlhdGUgY29udmVyc2lvbiBpbmZvIHRhYmxlICovCiAKIAlhbWxfcmVzb3VyY2UgPSBBQ1BJX0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U3BhY2VJZCIpOwogCX0KIAotCXJldHVybiAoQUNQSV9DQVNUX1BUUihjaGFyLCBhY3BpX2dibF9yZWdpb25fdHlwZXNbc3BhY2VfaWRdKSk7CisJcmV0dXJuIChhY3BpX2dibF9yZWdpb25fdHlwZXNbc3BhY2VfaWRdKTsKIH0KIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKQEAgLTE1MiwxNCArMTUyLDE0IEBACiAJIlJlYWxUaW1lQ2xvY2siLAogfTsKIAotY2hhciAqYWNwaV91dF9nZXRfZXZlbnRfbmFtZSh1MzIgZXZlbnRfaWQpCitjb25zdCBjaGFyICphY3BpX3V0X2dldF9ldmVudF9uYW1lKHUzMiBldmVudF9pZCkKIHsKIAogCWlmIChldmVudF9pZCA+IEFDUElfRVZFTlRfTUFYKSB7CiAJCXJldHVybiAoIkludmFsaWRFdmVudElEIik7CiAJfQogCi0JcmV0dXJuIChBQ1BJX0NBU1RfUFRSKGNoYXIsIGFjcGlfZ2JsX2V2ZW50X3R5cGVzW2V2ZW50X2lkXSkpOworCXJldHVybiAoYWNwaV9nYmxfZXZlbnRfdHlwZXNbZXZlbnRfaWRdKTsKIH0KIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKQEAgLTE4MCw3ICsxODAsOCBAQAogICoKICAqIFRoZSB0eXBlIEFDUElfVFlQRV9BTlkgKFVudHlwZWQpIGlzIHVzZWQgYXMgYSAiZG9uJ3QgY2FyZSIgd2hlbiBzZWFyY2hpbmc7CiAgKiB3aGVuIHN0b3JlZCBpbiBhIHRhYmxlIGl0IHJlYWxseSBtZWFucyB0aGF0IHdlIGhhdmUgdGh1cyBmYXIgc2VlbiBubwotICogZXZpZGVuY2UgdG8gaW5kaWNhdGUgd2hhdCB0eXBlIGlzIGFjdHVhbGx5IG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ioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKLWNoYXIgKmFjcGlfdXRfZ2V0X25vZGVfbmFtZSh2b2lkICpvYmplY3QpCitjb25zdCBjaGFyICphY3BpX3V0X2dldF9ub2RlX25hbWUodm9pZCAqb2JqZWN0KQogewogCXN0cnVjdCBhY3BpX25hbWVzcGFjZV9ub2RlICpub2RlID0gKHN0cnVjdCBhY3BpX25hbWVzcGFjZV9ub2RlICopb2JqZWN0OwogCkBAIC0zMzMsNyArMzM0LDcgQEAKIAkvKiAxNSAqLyAiTm9kZSIKIH07CiAKLWNoYXIgKmFjcGlfdXRfZ2V0X2Rlc2NyaXB0b3JfbmFtZSh2b2lkICpvYmplY3QpCitjb25zdCBjaGFyICphY3BpX3V0X2dldF9kZXNjcmlwdG9yX25hbWUodm9pZCAqb2JqZWN0KQogewogCiAJaWYgKCFvYmplY3QpIHsKQEAgLTM0NCwxMCArMzQ1LDcgQEAKIAkJcmV0dXJuICgiTm90IGEgRGVzY3JpcHRvciIpOwogCX0KIAotCXJldHVybiAoQUNQSV9DQVNUX1BUUihjaGFyLAotCQkJICAgICAgYWNwaV9nYmxfZGVzY190eXBlX25hbWVzW0FDUElfR0VUX0RFU0NSSVBUT1JfVFlQRQotCQkJCQkJICAgICAgIChvYmplY3QpXSkpOwotCisJcmV0dXJuIChhY3BpX2dibF9kZXNjX3R5cGVfbmFtZXNbQUNQSV9HRVRfREVTQ1JJUFRPUl9UWVBFKG9iamVjdCldKTsKIH0KIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKQEAgLTQxNSw3ICs0MTMsNyBAQAogCiAvKiBOYW1lcyBmb3IgaW50ZXJuYWwgbXV0ZXggb2JqZWN0cywgdXNlZCBmb3IgZGVidWcgb3V0cHV0ICovCiAKLXN0YXRpYyBjaGFyICphY3Bp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VkFMVUUpOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICoKLSAqIEZVTkNUSU9OOiAgICBhY3BpX3V0X3JlYWRfdGFibGUKLSAqCi0gKiBQQVJBTUVURVJTOiAgZnAgICAgICAgICAgICAgIC0gRmlsZSB0aGF0IGNvbnRhaW5zIHRhYmxlCi0gKiAgICAgICAgICAgICAgdGFibGUgICAgICAgICAgIC0gUmV0dXJuIHZhbHVlLCBidWZmZXIgd2l0aCB0YWJsZQotICogICAgICAgICAgICAgIHRhYmxlX2xlbmd0aCAgICAtIFJldHVybiB2YWx1ZSwgbGVuZ3RoIG9mIHRhYmxlCi0gKgotICogUkVUVVJOOiAgICAgIFN0YXR1cwotICoKLSAqIERFU0NSSVBUSU9OOiBMb2FkIHRoZSBEU0RUIGZyb20gdGhlIGZpbGUgcG9pbnRlcgotICoKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXN0YXRpYyBhY3BpX3N0YXR1cwotYWNwaV91dF9yZWFkX3RhYmxlKEZJTEUgKiBmcCwKLQkJICAgc3RydWN0IGFjcGlfdGFibGVfaGVhZGVyICoqdGFibGUsIHUzMiAqdGFibGVfbGVuZ3RoKQotewotCXN0cnVjdCBhY3BpX3RhYmxlX2hlYWRlciB0YWJsZV9oZWFkZXI7Ci0JdTMyIGFjdHVhbDsKLQlhY3BpX3N0YXR1cyBzdGF0dXM7Ci0JdTMyIGZpbGVfc2l6ZTsKLQl1OCBzdGFuZGFyZF9oZWFkZXIgPSBUUlVFOwotCXMzMiBjb3VudDsKLQotCS8qIEdldCB0aGUgZmlsZSBzaXplICovCi0KLQlmaWxlX3NpemUgPSBjbV9nZXRfZmlsZV9zaXplKGZwKTsKLQlpZiAoZmlsZV9zaXplID09IEFDUElfVUlOVDMyX01B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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIC8qCi0gKiBDb3B5cmlnaHQgKEMpIDIwMDAgLSAyMDE1LCBJbnRlbCBDb3JwLgorICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxNiwgSW50ZWwgQ29ycC4KICAqIEFsbCByaWdodHMgcmVzZXJ2ZWQuCiAgKgogICogUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0CkBAIC0xMjcsNzMgKzEyNyw2IEBACiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgKgotICogRlVOQ1RJT046ICAgIGFjcGlfdXRfZXhlY3V0ZV9TVUIKLSAqCi0gKiBQQVJBTUVURVJTOiAgZGV2aWNlX25vZGUgICAgICAgICAtIE5vZGUgZm9yIHRoZSBkZXZpY2UKLSAqICAgICAgICAgICAgICByZXR1cm5faWQgICAgICAgICAgIC0gV2hlcmUgdGhlIF9TVUIgaXMgcmV0dXJuZWQKLSAqCi0gKiBSRVRVUk46ICAgICAgU3RhdHVzCi0gKgotICogREVTQ1JJUFRJT046IEV4ZWN1dGVzIHRoZSBfU1VCIGNvbnRyb2wgbWV0aG9kIHRoYXQgcmV0dXJucyB0aGUgc3Vic3lzdGVtCi0gKiAgICAgICAgICAgICAgSUQgb2YgdGhlIGRldmljZS4gVGhlIF9TVUIgdmFsdWUgaXMgYWx3YXlzIGEgc3RyaW5nIGNvbnRhaW5pbmcKLSAqICAgICAgICAgICAgICBlaXRoZXIgYSB2YWxpZCBQTlAgb3IgQUNQSSBJRC4KLSAqCi0gKiAgICAgICAgICAgICAgTk9URTogSW50ZXJuYWwgZnVuY3Rpb24sIG5vIHBhcmFtZXRlciB2YWxpZGF0aW9uCi0gK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ZW5hYmxlIE1TSS1YIHdpdGggZXJyb3IgJWQsICMgb2YgdmVjdG9yczogJWRcbiIsCkBAIC0xNDAxLDIwICsxNDE4LDI1IEBACiB7CiAJaW50IG52ZWM7CiAKKwkvKgorCSAqIFRyeSB0byBlbmFibGUgcGVyLXBvcnQgTVNJLVguICBJZiB0aGUgaG9zdCBpcyBub3QgY2FwYWJsZQorCSAqIGZhbGwgYmFjayB0byBzaW5nbGUgTVNJIGJlZm9yZSBmaW5hbGx5IGF0dGVtcHRpbmcgc2luZ2xlCisJICogTVNJLVguCisJICovCisJbnZlYyA9IGFoY2lfaW5pdF9tc2l4KHBkZXYsIG5fcG9ydHMsIGhwcml2LCBBSENJX0hGTEFHX01VTFRJX01TSVgpOworCWlmIChudmVjID49IDApCisJCXJldHVybiBudmVjOworCiAJbnZlYyA9IGFoY2lfaW5pdF9tc2kocGRldiwgbl9wb3J0cywgaHByaXYpOwogCWlmIChudmVjID49IDApCiAJCXJldHVybiBudmVjOwogCi0JLyoKLQkgKiBDdXJyZW50bHksIE1TSS1YIHN1cHBvcnQgb25seSBpbXBsZW1lbnRzIHNpbmdsZSBJUlEgbW9kZSBhbmQKLQkgKiBleGlzdHMgZm9yIGNvbnRyb2xsZXJzIHdoaWNoIGNhbid0IGRvIG90aGVyIHR5cGVzIG9mIElSUS4gT25seQotCSAqIHNldCBpdCB1cCBpZiBNU0kgZmFpbHMuCi0JICovCi0JbnZlYyA9IGFoY2lfaW5pdF9tc2l4KHBkZXYsIG5fcG9ydHMsIGhwcml2KTsKKwkvKiB0cnkgc2luZ2xlLW1zaXggKi8KKwludmVjID0gYWhjaV9pbml0X21zaXgocGRldiwgbl9wb3J0cywgaHByaXYsIDApOwogCWlmIChudmVjID49IDApCiAJCXJldHVybiBudmVjOwogCi0JLyogbGFnYWN5IGludHggaW50ZXJydXB0cyAqLworCS8qIGxlZ2FjeSBpbnR4IGludGVycnVwdHMgKi8KIAlwY2lfaW50eChwZGV2LCAxKTsKIAlocHJpdi0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Y2VfbGlzdF9vcHAgKmxpc3RfZGV2LAorCQkgICAgICAgc3RydWN0IGRldmljZV9vcHAgKmRldl9vcHApCit7CisJaWYgKCFyb290ZGlyKSB7CisJCXByX2RlYnVnKCIlczogVW5pbml0aWFsaXplZCByb290ZGlyXG4iLCBfX2Z1bmNfXyk7CisJCXJldHVybiAtRUlOVkFMOworCX0KKworCWlmIChkZXZfb3BwLT5kZW50cnkpCisJCXJldHVybiBkZXZpY2Vfb3BwX2RlYnVnX2NyZWF0ZV9saW5rKGxpc3RfZGV2LCBkZXZfb3BwKTsKKworCXJldHVybiBkZXZpY2Vfb3BwX2RlYnVnX2NyZWF0ZV9kaXIobGlzdF9kZXYsIGRldl9vcHApOworfQorCitzdGF0aWMgdm9pZCBvcHBfbWlncmF0ZV9kZW50cnkoc3RydWN0IGRldmljZV9saXN0X29wcCAqbGlzdF9kZXYsCisJCQkgICAgICAgc3RydWN0IGRldmljZV9vcHAgKmRldl9vcHApCit7CisJc3RydWN0IGRldmljZV9saXN0X29wcCAqbmV3X2RldjsKKwljb25zdCBzdHJ1Y3QgZGV2aWNlICpkZXY7CisJc3RydWN0IGRlbnRyeSAqZGVudHJ5OworCisJLyogTG9vayBmb3IgbmV4dCBsaXN0LWRldiAqLworCWxpc3RfZm9yX2VhY2hfZW50cnkobmV3X2RldiwgJmRldl9vcHAtPmRldl9saXN0LCBub2RlKQorCQlpZiAobmV3X2RldiAhPSBsaXN0X2RldikKKwkJCWJyZWFrOworCisJLyogbmV3X2RldiBpcyBndWFyYW50ZWVkIHRvIGJlIHZhbGlkIGhlcmUgKi8KKwlkZXYgPSBuZXdfZGV2LT5kZXY7CisJZGVidWdmc19yZW1vdmVfcmVjdXJzaXZlKG5ld19kZXYtPmRlbnRyeSk7CisKKwlvcHBfc2V0X2Rldl9uYW1lKGRldiwgZGV2X29wcC0+ZGVudHJ5X25hbWUpOworCisJZGVudHJ5ID0gZGVidWdmc19yZW5hbWUocm9vdGRpciwgbGlzdF9kZXYtPmR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hcF9mb3JtYXRfNjRfbmF0aXZlKHZvaWQgKmJ1ZiwgdW5zaWduZWQgaW50IHZhbCwKKwkJCQkgICAgdW5zaWduZWQgaW50IHNoaWZ0KQoreworCSoodTY0ICopYnVmID0gKHU2NCl2YWwgPDwgc2hpZnQ7Cit9CisjZW5kaWYKKwogc3RhdGljIHZvaWQgcmVnbWFwX3BhcnNlX2lucGxhY2Vfbm9vcCh2b2lkICpidWYpCiB7CiB9CkBAIC0zMzIsNiArMzU0LDQxIEBACiAJcmV0dXJuICoodTMyICopYnVmOwogfQogCisjaWZkZWYgQ09ORklHXzY0QklUCitzdGF0aWMgdW5zaWduZWQgaW50IHJlZ21hcF9wYXJzZV82NF9iZShjb25zdCB2b2lkICpidWYpCit7CisJY29uc3QgX19iZTY0ICpiID0gYnVmOworCisJcmV0dXJuIGJlNjRfdG9fY3B1KGJbMF0pOworfQorCitzdGF0aWMgdW5zaWduZWQgaW50IHJlZ21hcF9wYXJzZV82NF9sZShjb25zdCB2b2lkICpidWYpCit7CisJY29uc3QgX19sZTY0ICpiID0gYnVmOworCisJcmV0dXJuIGxlNjRfdG9fY3B1KGJbMF0pOworfQorCitzdGF0aWMgdm9pZCByZWdtYXBfcGFyc2VfNjRfYmVfaW5wbGFjZSh2b2lkICpidWYpCit7CisJX19iZTY0ICpiID0gYnVmOworCisJYlswXSA9IGJlNjRfdG9fY3B1KGJbMF0pOworfQorCitzdGF0aWMgdm9pZCByZWdtYXBfcGFyc2VfNjRfbGVfaW5wbGFjZSh2b2lkICpidWYpCit7CisJX19sZTY0ICpiID0gYnVmOworCisJYlswXSA9IGxlNjRfdG9fY3B1KGJbMF0pOworfQorCitzdGF0aWMgdW5zaWduZWQgaW50IHJlZ21hcF9wYXJzZV82NF9uYXRpdmUoY29uc3Qgdm9pZCAqYnVmKQoreworCXJldHVybiAqKHU2NCAqKWJ1ZjsKK30KKyNlbmRpZgorCiBzdGF0aWMgdm9pZCByZWdtYXBfbG9ja19tdXRleCh2b2lkICp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orCQlyZXR1cm4gIkNSIjsKIAotCXNnX25iID0gMDsKLQlzZ19saXN0ID0gc2c7Ci0JdG90YWwgPSByZXEtPm5ieXRlczsKKwljYXNlIEFFU19NUjoKKwkJcmV0dXJuICJNUiI7CiAKLQl3aGlsZSAodG90YWwpIHsKLQkJbGVuID0gbWluKHNnX2xpc3QtPmxlbmd0aCwgdG90YWwpOworCWNhc2UgQUVTX0lTUjoKKwkJcmV0dXJuICJJU1IiOwogCi0JCXNnX25iKys7Ci0JCXRvdGFsIC09IGxlbjsKKwljYXNlIEFFU19JTVI6CisJCXJldHVybiAiSU1SIjsKIAotCQlzZ19saXN0ID0gc2dfbmV4dChzZ19saXN0KTsKLQkJaWYgKCFzZ19saXN0KQotCQkJdG90YWwgPSAwOworCWNhc2UgQUVTX0lFUjoKKwkJcmV0dXJuICJJRVIiOworCisJY2FzZSBBRVNfSURSOgorCQlyZXR1cm4gIklEUiI7CisKKwljYXNlIEFFU19LRVlXUigwKToKKwljYXNlIEFFU19LRVlXUigxKToKKwljYXNlIEFFU19LRVlXUigyKToKKwljYXNlIEFFU19LRVlXUigzKToKKwljYXNlIEFFU19LRVlXUig0KToKKwljYXNlIEFFU19LRVlXUig1KToKKwljYXNlIEFFU19LRVlXUig2KToKKwljYXNlIEFFU19LRVlXUig3KToKKwkJc25wcmludGYodG1wLCBzeiwgIktFWVdSWyV1XSIsIChvZmZzZXQgLSBBRVNfS0VZV1IoMCkpID4+IDIpOworCQlicmVhazsKKworCWNhc2UgQUVTX0lEQVRBUigwKToKKwljYXNlIEFFU19JREFUQVIoMSk6CisJY2FzZSBBRVNfSURBVEFSKDIpOgorCWNhc2UgQUVTX0lEQVRBUigzKToKKwkJc25wcmludGYodG1wLCBzeiwgIklEQVRBUlsldV0iLCAob2Zmc2V0IC0gQUVTX0lEQVRBUigwKSkgPj4gMik7CisJCWJyZWFrOworCisJY2FzZSBBRVNfT0RBVEFSKDApOgorCWNhc2UgQUVTX09EQVRBUigxKToKKwljYXNlIE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VyOworCXVuc2lnbmVkIHNob3J0ICAgZGV2bWluX3ZlcjsKKwl1bnNpZ25lZCBpbnQgICAgIGFlX21hc2s7CisJdW5zaWduZWQgaW50ICAgICBjdHhfZW5hYmxlczsKKwljaGFyICAgICAgICAgICAgIGZ3X3R5cGU7CisJY2hhciAgICAgICAgICAgICBjdHhfbW9kZTsKKwljaGFyICAgICAgICAgICAgIG5uX21vZGU7CisJY2hhciAgICAgICAgICAgICBsbTBfbW9kZTsKKwljaGFyICAgICAgICAgICAgIGxtMV9tb2RlOworCWNoYXIgICAgICAgICAgICAgc2NzX21vZGU7CisJY2hhciAgICAgICAgICAgICBsbTJfbW9kZTsKKwljaGFyICAgICAgICAgICAgIGxtM19tb2RlOworCWNoYXIgICAgICAgICAgICAgdGluZGV4X21vZGU7CisJdW5zaWduZWQgY2hhciAgICByZXNlcnZlZFs3XTsKKwljaGFyICAgICAgICAgICAgIHNpbWdfbmFtZVsyNTZdOworCWNoYXIgICAgICAgICAgICAgYXBwbWV0YV9kYXRhWzI1Nl07Cit9OworCitzdHJ1Y3QgaWNwX3FhdF9zdW9mX2ZpbGVoZHIgeworCXVuc2lnbmVkIGludCAgICAgZmlsZV9pZDsKKwl1bnNpZ25lZCBpbnQgICAgIGNoZWNrX3N1bTsKKwljaGFyICAgICAgICAgICAgIG1pbl92ZXI7CisJY2hhciAgICAgICAgICAgICBtYWpfdmVyOworCWNoYXIgICAgICAgICAgICAgZndfdHlwZTsKKwljaGFyICAgICAgICAgICAgIHJlc2VydmVkOworCXVuc2lnbmVkIHNob3J0ICAgbWF4X2NodW5rczsKKwl1bnNpZ25lZCBzaG9ydCAgIG51bV9jaHVua3M7Cit9OworCitzdHJ1Y3QgaWNwX3FhdF9zdW9mX2NodW5rX2hkciB7CisJY2hhciBjaHVua19pZFtJQ1BfUUFUX1NVT0ZfT0JKX0lEX0xFTl07CisJdTY0IG9mZnNldDsKKwl1NjQgc2l6ZTsKK307CisKK3N0cnVjdCBpY3BfcWF0X3N1b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hW2ldKSB7CisJCQlzYnJpZGdlX3ByaW50ayhLRVJOX0VSUiwgIk1pc3NpbmcgQ0hBICVkXG4iLCBpKTsKKwkJCWdvdG8gZW5vZGV2OworCQl9CisJfQorCisJcmV0dXJuIDA7CisKK2Vub2RldjoKKwlzYnJpZGdlX3ByaW50ayhLRVJOX0VSUiwgIlNvbWUgbmVlZGVkIGRldmljZXMgYXJlIG1pc3NpbmdcbiIpOworCXJldHVybiAtRU5PREVWOworfQorCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogCQkJRXJyb3IgY2hlY2sgcm91dGluZXMKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwpAQCAtMjEyNyw4ICsyOTkxLDM2IEBACiAJaWYgKCFHRVRfQklURklFTEQobS0+c3RhdHVzLCA1OCwgNTgpKQogCQlyZXR1cm47CiAKLQlyYyA9IGdldF9tZW1vcnlfZXJyb3JfZGF0YShtY2ksIG0tPmFkZHIsICZzb2NrZXQsICZoYSwKLQkJCQkgICAmY2hhbm5lbF9tYXNrLCAmcmFuaywgJmFyZWFfdHlwZSwgbXNnKTsKKwlpZiAocHZ0LT5pbmZvLnR5cGUgPT0gS05JR0hUU19MQU5ESU5HKSB7CisJCWlmIChjaGFubmVsID09IDE0KSB7CisJCQllZGFjX2RiZygwLCAiJXMlcyBlcnJfY29kZTolMDR4OiUwNHggRURSQU0gYmFuayAlZFxuIiwKKwkJCQlvdmVyZmxvdyA/ICIgT1ZFUkZMT1ciIDogIiIsCisJCQkJKHVuY29ycmVjdGVkX2Vycm9yICYmIHJlY292ZXJhYmxlKQorCQkJCT8gIiByZWNvdmVyYWJsZSIgOiAiIiwKKwkJCQltc2NvZCwgZXJyY29kZSwKKwkJCQltLT5iYW5rKTsKKwkJfSBlbHNlIHsKKwkJCWNoYXIgQS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U1IsIDB4Zik7CisJbmI4ODAwX3dyaXRlbChwcml2LCBOQjg4MDBfVFhDX1NSLCAweGYpOworCisJZXJyID0gbmI4ODAwX2RtYV9pbml0KGRldik7CisJaWYgKGVycikKKwkJcmV0dXJuIGVycjsKKworCWVyciA9IHJlcXVlc3RfaXJxKGRldi0+aXJxLCBuYjg4MDBfaXJxLCAwLCBkZXZfbmFtZSgmZGV2LT5kZXYpLCBkZXYpOworCWlmIChlcnIpCisJCWdvdG8gZXJyX2ZyZWVfZG1hOworCisJbmI4ODAwX21hY19yeChkZXYsIHRydWUpOworCW5iODgwMF9tYWNfdHgoZGV2LCB0cnVlKTsKKworCXByaXYtPnBoeWRldiA9IG9mX3BoeV9jb25uZWN0KGRldiwgcHJpdi0+cGh5X25vZGUsCisJCQkJICAgICAgbmI4ODAwX2xpbmtfcmVjb25maWd1cmUsIDAsCisJCQkJICAgICAgcHJpdi0+cGh5X21vZGUpOworCWlmICghcHJpdi0+cGh5ZGV2KQorCQlnb3RvIGVycl9mcmVlX2lycTsKKworCW5iODgwMF9wYXVzZV9hZHYoZGV2KTsKKworCW5ldGRldl9yZXNldF9xdWV1ZShkZXYpOworCW5hcGlfZW5hYmxlKCZwcml2LT5uYXBpKTsKKwluZXRpZl9zdGFydF9xdWV1ZShkZXYpOworCisJbmI4ODAwX3N0YXJ0X3J4KGRldik7CisJcGh5X3N0YXJ0KHByaXYtPnBoeWRldik7CisKKwlyZXR1cm4gMDsKKworZXJyX2ZyZWVfaXJxOgorCWZyZWVfaXJxKGRldi0+aXJxLCBkZXYpOworZXJyX2ZyZWVfZG1hOgorCW5iODgwMF9kbWFfZnJlZShkZXYpOworCisJcmV0dXJuIGVycjsKK30KKworc3RhdGljIGludCBuYjg4MDBfc3RvcChzdHJ1Y3QgbmV0X2RldmljZSAqZGV2KQoreworCXN0cnVjdCBuYjg4MDBfcHJpdiAqcHJpdiA9IG5ldGRldl9wcml2KGRldik7CisKKwlwaHlfc3RvcChwcml2LT5waHlkZXY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ICAgICAgICAgICAgICAqLworLyogIElCTSBTeXN0ZW0gaSBhbmQgU3lzdGVtIHAgVmlydHVhbCBOSUMgRGV2aWNlIERyaXZlciAgICAgICAgICAgICAgICAgICAqLworLyogIENvcHlyaWdodCAoQykgMjAxNCBJQk0gQ29ycC4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogIFNhbnRpYWdvIExlb24gKHNhbnRpX2xlb25AeWFob28uY29tKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogIFRob21hcyBGYWxjb24gKHRsZmFsY29uQGxpbnV4LnZuZXQuaWJtLmNvbSkgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogIEpvaG4gQWxsZW4gKGphbGxlbkBsaW51eC52bmV0LmlibS5jb20pICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogIFRoaXMgcHJvZ3JhbSBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IgbW9kaWZ5ICAqLworLyogIGl0IHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgYXMgcHVibGlzaGVkIGJ5ICAqLworLyogIHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb247IGVpdGhlciB2ZXJzaW9uIDIgb2YgdGhlIExpY2Vuc2UsIG9yICAgICAqLworLyogIChhdCB5b3VyIG9wdGlvbikgYW55IGxhdGVyIHZlcnNpb24uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogIFRoaXMgcHJvZ3JhbSBpcyBkaXN0cmlidXRlZCBpbiB0aGUgaG9wZSB0aGF0IGl0IHdpbGwgYmUgdXNlZnVsLCAgICAgICAqLworLyogIGJ1dCBXSVRIT1VUIEFOWSBXQVJSQU5UWTsgd2l0aG91dCBldmVuIHRoZSBpbXBsaWVkIHdhcnJhbnR5IG9mICAgICAgICAqLworLyogIE1FUkNIQU5UQUJJTElUWSBvciBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRS4gIFNlZSB0aGUgICAgICAgICAqLworLyogIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGZvciBtb3JlIGRldGFpbHMuICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogIFlvdSBzaG91bGQgaGF2ZSByZWNlaXZlZCBhIGNvcHkgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlICAgICAqLworLyogIGFsb25nIHdpdGggdGhpcyBwcm9ncmFtLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogVGhpcyBtb2R1bGUgY29udGFpbnMgdGhlIGltcGxlbWVudGF0aW9uIG9mIGEgdmlydHVhbCBldGhlcm5ldCBkZXZpY2UgICAqLworLyogZm9yIHVzZSB3aXRoIElCTSBpL3AgU2VyaWVzIExQQVIgTGludXguIEl0IHV0aWxpemVzIHRoZSBsb2dpY2FsIExBTiAgICAqLworLyogb3B0aW9uIG9mIHRoZSBSUy82MDAwIFBsYXRmb3JtIEFyY2hpdGVjdHVyZSB0byBpbnRlcmZhY2Ugd2l0aCB2aXJ0dWFsICAqLworLyogZXRoZXJuZXQgTklDcyB0aGF0IGFyZSBwcmVzZW50ZWQgdG8gdGhl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W4gbGlldSBvZiBhIG1vcmUgY29udmVudGlvbmFsICJvbi10aGUtZmx5IiBETUEgbWFwcGluZyBzdHJhdGVneSBpbiAgICAqLworLyogd2hpY2ggc2ticyBhcmUgRE1BIG1hcHBlZCBhbmQgaW1tZWRpYXRlbHkgdW5tYXBwZWQgd2hlbiB0aGUgdHJhbnNtaXQgICAqLworLyogb3IgcmVjZWl2ZSBoYXMgYmVlbiBjb21wbGV0ZWQsIHRoZSBWTklDIGRyaXZlciBpcyByZXF1aXJlZCB0byB1c2UgICAgICAqLworLyogImxvbmcgdGVybSBtYXBwaW5nIi4gVGhpcyBlbnRhaWxzIHRoYXQgbGFyZ2UsIGNvbnRpbnVvdXMgRE1BIG1hcHBlZCAgICAqLworLyogYnVmZmVycyBhcmUgYWxsb2NhdGVkIG9uIGRyaXZlciBpbml0aWFsaXphdGlvbiBhbmQgdGhlc2UgYnVmZmVycyBhcmUgICAqLworLyogdGhlbiBjb250aW51b3VzbHkgcmV1c2VkIHRvIHBhc3Mgc2ticyB0byBhbmQgZnJvbSB0aGUgVk5JQyBzZXJ2ZXIuICAgICAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjaW5jbHVkZSA8bGludXgvbW9kdWxlLmg+CisjaW5jbHVkZSA8bGludXgvbW9kdWxlcGFyYW0uaD4KKyNpbmNsdWRlIDxsaW51eC90eXBlcy5oPgorI2luY2x1ZGUgPGxpbnV4L2Vycm5vLmg+CisjaW5jbHVkZSA8bGludXgvY29tcGxldGlvbi5oPgorI2luY2x1ZGUgPGxpbnV4L2lvcG9ydC5oPgorI2luY2x1ZGUgPGxpbnV4L2RtYS1tYXBwaW5nLmg+CisjaW5jbHVkZSA8bGludXgva2VybmVsLmg+CisjaW5jbHVkZS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zOiAlcyAlc1xuIiwgaWJtdm5pY19kcml2ZXJfbmFtZSwgaWJtdm5pY19kcml2ZXJfc3RyaW5nLAorCQlJQk1WTklDX0RSSVZFUl9WRVJTSU9OKTsKKworCXJldHVybiB2aW9fcmVnaXN0ZXJfZHJpdmVyKCZpYm12bmljX2RyaXZlcik7Cit9CisKK3N0YXRpYyB2b2lkIF9fZXhpdCBpYm12bmljX21vZHVsZV9leGl0KHZvaWQpCit7CisJdmlvX3VucmVnaXN0ZXJfZHJpdmVyKCZpYm12bmljX2RyaXZlcik7Cit9CisKK21vZHVsZV9pbml0KGlibXZuaWNfbW9kdWxlX2luaXQpOworbW9kdWxlX2V4aXQoaWJtdm5pY19tb2R1bGVfZXhpdCk7CmRpZmYgLS1naXQgYS9kcml2ZXJzL25ldC9ldGhlcm5ldC9pYm0vaWJtdm5pYy5oIGIvZHJpdmVycy9uZXQvZXRoZXJuZXQvaWJtL2libXZuaWMuaApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4xMjQyOTI1Ci0tLSAvZGV2L251bGwKKysrIGIvZHJpdmVycy9uZXQvZXRoZXJuZXQvaWJtL2libXZuaWMuaApAQCAtMCwwICsxLDEwNDYgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qICBJQk0gU3lzdGVtIGkgYW5kIFN5c3RlbSBwIFZpcnR1YWwgTklDIERldmljZSBEcml2ZXIgICAgICAgICAgICAgICAgICAgKi8KKy8qICBDb3B5cmlnaHQgKEMpIDIwMTQgSUJNIENvcnAuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qICBTYW50aWFnbyBMZW9uIChzYW50aV9sZW9uQHlhaG9vLmNvbSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qICBUaG9tYXMgRmFsY29uICh0bGZhbGNvbkBsaW51eC52bmV0LmlibS5jb20pICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qICBKb2huIEFsbGVuIChqYWxsZW5AbGludXgudm5ldC5pYm0uY29tKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qICBUaGlzIHByb2dyYW0gaXMgZnJlZSBzb2Z0d2FyZTsgeW91IGNhbiByZWRpc3RyaWJ1dGUgaXQgYW5kL29yIG1vZGlmeSAgKi8KKy8qICBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGFzIHB1Ymxpc2hlZCBieSAgKi8KKy8qICB0aGUgRnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uOyBlaXRoZXIgdmVyc2lvbiAyIG9mIHRoZSBMaWNlbnNlLCBvciAgICAgKi8KKy8qICAoYXQgeW91ciBvcHRpb24pIGFueSBsYXRlciB2ZXJzaW9uLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qICBUaGlzIHByb2dyYW0gaXMgZGlzdHJpYnV0ZWQgaW4gdGhlIGhvcGUgdGhhdCBpdCB3aWxsIGJlIHVzZWZ1bCwgICAgICAgKi8KKy8qICBidXQgV0lUSE9VVCBBTlkgV0FSUkFOVFk7IHdpdGhvdXQgZXZlbiB0aGUgaW1wbGllZCB3YXJyYW50eSBvZiAgICAgICAgKi8KKy8qICBNRVJDSEFOVEFCSUxJVFkgb3IgRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFSIFBVUlBPU0UuICBTZWUgdGhlICAgICAgICAgKi8KKy8qICBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBmb3IgbW9yZSBkZXRhaWxzLiAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qICBZb3Ugc2hvdWxkIGhhdmUgcmVjZWl2ZWQgYSBjb3B5IG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSAgICAgKi8KKy8qICBhbG9uZyB3aXRoIHRoaXMgcHJvZ3JhbS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIFRoaXMgbW9kdWxlIGNvbnRhaW5zIHRoZSBpbXBsZW1lbnRhdGlvbiBvZiBhIHZpcnR1YWwgZXRoZXJuZXQgZGV2aWNlICAgKi8KKy8qIGZvciB1c2Ugd2l0aCBJQk0gaS9wU2VyaWVzIExQQVIgTGludXguICBJdCB1dGlsaXplcyB0aGUgbG9naWNhbCBMQU4gICAgKi8KKy8qIG9wdGlvbiBvZiB0aGUgUlMvNjAwMCBQbGF0Zm9ybSBBcmNoaXRlY3R1cmUgdG8gaW50ZXJmYWNlIHdpdGggdmlydHVhbCAqLworLyogZXRoZXJuZXQgTklDcyB0aGF0IGFyZSBwcmVzZW50ZWQgdG8gdGhlIHBhcnRpdGlvbiBieSB0aGUgaHlwZXJ2aXNvci4gICAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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E1WTkVUQV9SWFFfSFdfQlVGX0FMTE9DICAgICAgICAgICAgQklUKDApCiAjZGVmaW5lICAgICAgTVZORVRBX1JYUV9QS1RfT0ZGU0VUX0FMTF9NQVNLICAgICAoMHhmICAgIDw8IDgpCiAjZGVmaW5lICAgICAgTVZORVRBX1JYUV9QS1RfT0ZGU0VUX01BU0sob2ZmcykgICAoKG9mZnMpIDw8IDgpCiAjZGVmaW5lIE1WTkVUQV9SWFFfVEhSRVNIT0xEX1JFRyhxKSAgICAgICAgICAgICAoMHgxNGMwICsgKChxKSA8PCAyKSkKQEAgLTYyLDYgKzYyLDcgQEAKICNkZWZpbmUgTVZORVRBX1dJTl9TSVpFKHcpICAgICAgICAgICAgICAgICAgICAgICgweDIyMDQgKyAoKHcpIDw8IDMpKQogI2RlZmluZSBNVk5FVEFfV0lOX1JFTUFQKHcpICAgICAgICAgICAgICAgICAgICAgKDB4MjI4MCArICgodykgPDwgMikpCiAjZGVmaW5lIE1WTkVUQV9CQVNFX0FERFJfRU5BQkxFICAgICAgICAgICAgICAgICAweDIyOTAKKyNkZWZpbmUgTVZORVRBX0FDQ0VTU19QUk9URUNUX0VOQUJMRSAgICAgICAgICAgIDB4MjI5NAogI2RlZmluZSBNVk5FVEFfUE9SVF9DT05GSUcgICAgICAgICAgICAgICAgICAgICAgMHgyNDAwCiAjZGVmaW5lICAgICAgTVZORVRBX1VOSV9QUk9NSVNDX01PREUgICAgICAgICAgICBCSVQoMCkKICNkZWZpbmUgICAgICBNVk5FVEFfREVGX1JYUShxKSAgICAgICAgICAgICAgICAgICgocSkgPDwgMSkKQEAgLTEwOSw5ICsxMTAsMTcgQEAKICNkZWZpbmUgTVZORVRBX0NQVV9NQVAoY3B1KSAgICAgICAgICAgICAgICAgICAgICAoMHgyNTQwICsgKChjcHUpIDw8IDIpKQogI2RlZmluZSAgICAgIE1WTkVUQV9DUFVfUlhRX0FDQ0VTU19BTExfTUFTSyAgICAgIDB4MDAwMDAwZmYKICNkZWZpbmUgIC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orCisjZGVmaW5lIE1MWDVfTDJfQUREUl9IQVNIX1NJWkUgKEJJVChCSVRTX1BFUl9CWVRFKSkKKyNkZWZpbmUgTUxYNV9MMl9BRERSX0hBU0goYWRkcikgKGFkZHJbNV0pCisKKy8qIEwyIC1tYWMgYWRkcmVzcyBiYXNlZC0gaGFzaCBoZWxwZXJzICovCitzdHJ1Y3QgbDJhZGRyX25vZGUgeworCXN0cnVjdCBobGlzdF9ub2RlIGhsaXN0OworCXU4ICAgICAgICAgICAgICAgIGFkZHJbRVRIX0FMRU5dOworfTsKKworI2RlZmluZSBmb3JfZWFjaF9sMmhhc2hfbm9kZShobiwgdG1wLCBoYXNoLCBpKSBcCisJZm9yIChpID0gMDsgaSA8IE1MWDVfTDJfQUREUl9IQVNIX1NJWkU7IGkrKykgXAorCQlobGlzdF9mb3JfZWFjaF9lbnRyeV9zYWZlKGhuLCB0bXAsICZoYXNoW2ldLCBobGlzdCkKKworI2RlZmluZSBsMmFkZHJfaGFzaF9maW5kKGhhc2gsIG1hYywgdHlwZSkgKHsgICAgICAgICAgICAgICAgXAorCWludCBpeCA9IE1MWDVfTDJfQUREUl9IQVNIKG1hYyk7ICAgICAgICAgICAgICAgICAgICBcCisJYm9vbCBmb3VuZCA9IGZhbHNlOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwl0eXBlICpwdHIgPSBOVUxMOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCQkJCQkJCSAgICBcCisJaGxpc3RfZm9yX2VhY2hfZW50cnkocHRyLCAmaGFzaFtpeF0sIG5vZGUuaGxpc3QpICAgIFwKKwkJaWYgKGV0aGVyX2FkZHJfZXF1YWwocHRyLT5ub2RlLmFkZHIsIG1hYykpIHtcCisJCQlmb3VuZCA9IHRydWU7ICAgICAgICAgICAgICAgICAgICAgICBcCisJCQlicmVhazsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJCX0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCWlmICghZm91bmQpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJCXB0ciA9IE5VTEw7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCXB0cjsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCit9KQorCisjZGVmaW5lIGwyYWRkcl9oYXNoX2FkZChoYXNoLCBtYWMsIHR5cGUsIGdmcCkgKHsgICAgICAgICAgICBcCisJaW50IGl4ID0gTUxYNV9MMl9BRERSX0hBU0gobWFjKTsgICAgICAgICAgICAgICAgICAgIFwKKwl0eXBlICpwdHIgPSBOVUxMOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCQkJCQkJCSAgICBcCisJcHRyID0ga3phbGxvYyhzaXplb2YodHlwZSksIGdmcCk7ICAgICAgICAgICAgICAgICAgIFwKKwlpZiAocHRyKSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCQlldGhlcl9hZGRyX2NvcHkocHRyLT5ub2RlLmFkZHIsIG1hYyk7ICAgICAgIFwKKwkJaGxpc3RfYWRkX2hlYWQoJnB0ci0+bm9kZS5obGlzdCwgJmhhc2hbaXhdKTtcCisJfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwlwdHI7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorfSkKKworI2RlZmluZSBsMmFkZHJfaGFzaF9kZWwocHRyKSAoeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCWhsaXN0X2RlbCgmcHRyLT5ub2RlLmhsaXN0KTsgICAgICAgICAgICAgICAgICAgICAgICBcCisJa2ZyZWUocHRyKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKK30pCisKK3N0cnVjdCBtbHg1X3Zwb3J0IHsKKwl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JZXJyID0gbWx4NV9xdWVyeV9uaWNfdnBvcnRfY29udGV4dChtZGV2LCB2cG9ydCwgb3V0LCBvdXRsZW4pOworCWlmIChlcnIpCisJCWdvdG8gb3V0OworCisJKnByb21pc2NfdWMgPSBNTFg1X0dFVChxdWVyeV9uaWNfdnBvcnRfY29udGV4dF9vdXQsIG91dCwKKwkJCSAgICAgICBuaWNfdnBvcnRfY29udGV4dC5wcm9taXNjX3VjKTsKKwkqcHJvbWlzY19tYyA9IE1MWDVfR0VUKHF1ZXJ5X25pY192cG9ydF9jb250ZXh0X291dCwgb3V0LAorCQkJICAgICAgIG5pY192cG9ydF9jb250ZXh0LnByb21pc2NfbWMpOworCSpwcm9taXNjX2FsbCA9IE1MWDVfR0VUKHF1ZXJ5X25pY192cG9ydF9jb250ZXh0X291dCwgb3V0LAorCQkJCW5pY192cG9ydF9jb250ZXh0LnByb21pc2NfYWxsKTsKKworb3V0OgorCWtmcmVlKG91dCk7CisJcmV0dXJuIGVycjsKK30KK0VYUE9SVF9TWU1CT0xfR1BMKG1seDVfcXVlcnlfbmljX3Zwb3J0X3Byb21pc2MpOworCitpbnQgbWx4NV9tb2RpZnlfbmljX3Zwb3J0X3Byb21pc2Moc3RydWN0IG1seDVfY29yZV9kZXYgKm1kZXYsCisJCQkJICBpbnQgcHJvbWlzY191YywKKwkJCQkgIGludCBwcm9taXNjX21jLAorCQkJCSAgaW50IHByb21pc2NfYWxsKQoreworCXZvaWQgKmluOworCWludCBpbmxlbiA9IE1MWDVfU1RfU1pfQllURVMobW9kaWZ5X25pY192cG9ydF9jb250ZXh0X2luKTsKKwlpbnQgZXJyOworCisJaW4gPSBtbHg1X3Z6YWxsb2MoaW5sZW4pOworCWlmICghaW4pIHsKKwkJbWx4NV9jb3JlX2VycihtZGV2LCAiZmFpbGVkIHRvIGFsbG9jYXRlIGluYm94XG4iKTsKKwkJcmV0dXJuIC1FTk9NRU07CisJfQorCisJTUxYNV9TRVQobW9kaWZ5X25pY192cG9ydF9j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29mKGF0dHIsIHN0cnVjdCBtbHhzd19od21vbl9hdHRyLCBkZXZfYXR0cik7CisJc3RydWN0IG1seHN3X2h3bW9uICptbHhzd19od21vbiA9IG1sd3N3X2h3bW9uX2F0dHItPmh3bW9uOworCWNoYXIgbWZzY19wbFtNTFhTV19SRUdfTUZTQ19MRU5dOworCWludCBlcnI7CisKKwltbHhzd19yZWdfbWZzY19wYWNrKG1mc2NfcGwsIG1sd3N3X2h3bW9uX2F0dHItPnR5cGVfaW5kZXgsIDApOworCWVyciA9IG1seHN3X3JlZ19xdWVyeShtbHhzd19od21vbi0+Y29yZSwgTUxYU1dfUkVHKG1mc2MpLCBtZnNjX3BsKTsKKwlpZiAoZXJyKSB7CisJCWRldl9lcnIobWx4c3dfaHdtb24tPmJ1c19pbmZvLT5kZXYsICJGYWlsZWQgdG8gcXVlcnkgUFdNXG4iKTsKKwkJcmV0dXJuIGVycjsKKwl9CisJcmV0dXJuIHNwcmludGYoYnVmLCAiJXVcbiIsCisJCSAgICAgICBtbHhzd19yZWdfbWZzY19wd21fZHV0eV9jeWNsZV9nZXQobWZzY19wbCkpOworfQorCitzdGF0aWMgc3NpemVfdCBtbHhzd19od21vbl9wd21fc3RvcmUoc3RydWN0IGRldmljZSAqZGV2LAorCQkJCSAgICAgc3RydWN0IGRldmljZV9hdHRyaWJ1dGUgKmF0dHIsCisJCQkJICAgICBjb25zdCBjaGFyICpidWYsIHNpemVfdCBsZW4pCit7CisJc3RydWN0IG1seHN3X2h3bW9uX2F0dHIgKm1sd3N3X2h3bW9uX2F0dHIgPQorCQkJY29udGFpbmVyX29mKGF0dHIsIHN0cnVjdCBtbHhzd19od21vbl9hdHRyLCBkZXZfYXR0cik7CisJc3RydWN0IG1seHN3X2h3bW9uICptbHhzd19od21vbiA9IG1sd3N3X2h3bW9uX2F0dHItPmh3bW9uOworCWNoYXIgbWZzY19wbFtNTFhTV19SRUdfTUZTQ19MRU5dOworCXVuc2lnbmVkIGxvbmcgdmFsOworCWludCBl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HMubGlzdCwgbGlzdCkgeworCQlpZiAoZXRoZXJfYWRkcl9lcXVhbChtaWQtPmFkZHIsIGFkZHIpICYmIG1pZC0+dmlkID09IHZpZCkKKwkJCXJldHVybiBtaWQ7CisJfQorCXJldHVybiBOVUxMOworfQorCitzdGF0aWMgc3RydWN0IG1seHN3X3NwX21pZCAqX19tbHhzd19zcF9tY19hbGxvYyhzdHJ1Y3QgbWx4c3dfc3AgKm1seHN3X3NwLAorCQkJCQkJY29uc3QgdW5zaWduZWQgY2hhciAqYWRkciwKKwkJCQkJCXUxNiB2aWQpCit7CisJc3RydWN0IG1seHN3X3NwX21pZCAqbWlkOworCXUxNiBtaWRfaWR4OworCisJbWlkX2lkeCA9IGZpbmRfZmlyc3RfemVyb19iaXQobWx4c3dfc3AtPmJyX21pZHMubWFwcGVkLAorCQkJCSAgICAgIE1MWFNXX1NQX01JRF9NQVgpOworCWlmIChtaWRfaWR4ID09IE1MWFNXX1NQX01JRF9NQVgpCisJCXJldHVybiBOVUxMOworCisJbWlkID0ga3phbGxvYyhzaXplb2YoKm1pZCksIEdGUF9LRVJORUwpOworCWlmICghbWlkKQorCQlyZXR1cm4gTlVMTDsKKworCXNldF9iaXQobWlkX2lkeCwgbWx4c3dfc3AtPmJyX21pZHMubWFwcGVkKTsKKwlldGhlcl9hZGRyX2NvcHkobWlkLT5hZGRyLCBhZGRyKTsKKwltaWQtPnZpZCA9IHZpZDsKKwltaWQtPm1pZCA9IG1pZF9pZHg7CisJbWlkLT5yZWZfY291bnQgPSAwOworCWxpc3RfYWRkX3RhaWwoJm1pZC0+bGlzdCwgJm1seHN3X3NwLT5icl9taWRzLmxpc3QpOworCisJcmV0dXJuIG1pZDsKK30KKworc3RhdGljIGludCBfX21seHN3X3NwX21jX2RlY19yZWYoc3RydWN0IG1seHN3X3NwICptbHhzd19zcCwKKwkJCQkgc3RydWN0IG1seHN3X3NwX21pZCAqbWlkKQoreworCWlmICgtLW1pZC0+cmVmX2NvdW50ID09IDApIHsK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Vuc2lnbmVkIGlzX3ZmOjE7CisJdW5zaWduZWQgaXNfbmZwMzIwMDoxOworCXVuc2lnbmVkIGZ3X2xvYWRlZDoxOworCisJdTMyIGN0cmw7CisJdTMyIGZsX2J1ZnN6OworCisJdTMyIHJ4X29mZnNldDsKKworI2lmZGVmIENPTkZJR19QQ0lfSU9WCisJdW5zaWduZWQgaW50IG51bV92ZnM7CisJc3RydWN0IHZmX2RhdGFfc3RvcmFnZSAqdmZpbmZvOworCWludCB2Zl9yYXRlX2xpbmtfc3BlZWQ7CisjZW5kaWYKKworCXN0cnVjdCBuZnBfY3BwICpjcHA7CisJc3RydWN0IHBsYXRmb3JtX2RldmljZSAqbmZwX2Rldl9jcHA7CisJc3RydWN0IG5mcF9jcHBfYXJlYSAqY3RybF9hcmVhOworCXN0cnVjdCBuZnBfY3BwX2FyZWEgKnR4X2FyZWE7CisJc3RydWN0IG5mcF9jcHBfYXJlYSAqcnhfYXJlYTsKKworCXN0cnVjdCBuZnBfbmV0X2Z3X3ZlcnNpb24gZndfdmVyOworCXUzMiBjYXA7CisJdTMyIG1heF9tdHU7CisKKwl1MzIgcnNzX2NmZzsKKwl1OCByc3Nfa2V5W05GUF9ORVRfQ0ZHX1JTU19LRVlfU1pdOworCXU4IHJzc19pdGJsW05GUF9ORVRfQ0ZHX1JTU19JVEJMX1NaXTsKKworCWludCBtYXhfdHhfcmluZ3M7CisJaW50IG1heF9yeF9yaW5nczsKKworCWludCBudW1fdHhfcmluZ3M7CisJaW50IG51bV9yeF9yaW5nczsKKworCWludCBzdHJpZGVfdHg7CisJaW50IHN0cmlkZV9yeDsKKworCWludCB0eGRfY250OworCWludCByeGRfY250OworCisJc3RydWN0IG5mcF9uZXRfdHhfcmluZyB0eF9yaW5nc1tORlBfTkVUX01BWF9UWF9SSU5HU107CisJc3RydWN0IG5mcF9uZXRfcnhfcmluZyByeF9yaW5nc1tORlBfTkVUX01BWF9SWF9SSU5HU107CisKKwl1OCBudW1faXJxczsKKwl1OCBud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LCBidXQgb24gdGhlIE5GUDYwMDAsIGR1ZSB0bworICogVEhCLTM1MCwgMzJrIG5lZWRzIHRvIGJlIHJlc2VydmVkLgorICovCisjZGVmaW5lIE5GUF9ORVRfQ0ZHX0JBUl9TWiAgICAgICAgICAgICAgKDMyICogMTAyNCkKKworLyoqCisgKiBPZmZzZXQgaW4gRnJlZWxpc3QgYnVmZmVyIHdoZXJlIHBhY2tldCBzdGFydHMgb24gUlgKKyAqLworI2RlZmluZSBORlBfTkVUX1JYX09GRlNFVCAgICAgICAgICAgICAgIDMyCisKKy8qKgorICogTWF4aW11bSBoZWFkZXIgc2l6ZSBzdXBwb3J0ZWQgZm9yIExTTyBmcmFtZXMKKyAqLworI2RlZmluZSBORlBfTkVUX0xTT19NQVhfSERSX1NaCQkyNTUKKworLyoqCisgKiBIYXNoIHR5cGUgcHJlLXBlbmRlZCB3aGVuIGEgUlNTIGhhc2ggd2FzIGNvbXB1dGVkCisgKi8KKyNkZWZpbmUgTkZQX05FVF9SU1NfTk9ORSAgICAgICAgICAgICAgICAwCisjZGVmaW5lIE5GUF9ORVRfUlNTX0lQVjQgICAgICAgICAgICAgICAgMQorI2RlZmluZSBORlBfTkVUX1JTU19JUFY2ICAgICAgICAgICAgICAgIDIKKyNkZWZpbmUgTkZQX05FVF9SU1NfSVBWNl9FWCAgICAgICAgICAgICAzCisjZGVmaW5lIE5GUF9ORVRfUlNTX0lQVjRfVENQICAgICAgICAgICAgNAorI2RlZmluZSBORlBfTkVUX1JTU19JUFY2X1RDUCAgICAgICAgICAgIDUKKyNkZWZpbmUgTkZQX05FVF9SU1NfSVBWNl9FWF9UQ1AgICAgICAgICA2CisjZGVmaW5lIE5GUF9ORVRfUlNTX0lQVjRfVURQICAgICAgICAgICAgNworI2RlZmluZSBORlBfTkVUX1JTU19JUFY2X1VEUCAgICAgICAgICAgIDgKKyNkZWZpbmUgTkZQX05FVF9SU1NfSVBWNl9FWF9VRFAgICAgICAgICA5CisKKy8qKgorICogQE5GUF9ORVRfVFhSX01BWDogICAgICAgICBNYXhpbXVtIG51bWJlciBvZiBUWCByaW5ncworICogQE5GUF9ORVRfVFhSX01BU0s6ICAgICAgICBNYXNrIGZvciBUWCByaW5ncworICogQE5GUF9ORVRfUlhSX01BWDogICAgICAgICBNYXhpbXVtIG51bWJlciBvZiBSWCByaW5ncworICogQE5GUF9ORVRfUlhSX01BU0s6ICAgICAgICBNYXNrIGZvciBSWCByaW5ncworICovCisjZGVmaW5lIE5GUF9ORVRfVFhSX01BWCAgICAgICAgICAgICAgICAgNjQKKyNkZWZpbmUgTkZQX05FVF9UWFJfTUFTSyAgICAgICAgICAgICAgICAoTkZQX05FVF9UWFJfTUFYIC0gMSkKKyNkZWZpbmUgTkZQX05FVF9SWFJfTUFYICAgICAgICAgICAgICAgICA2NAorI2RlZmluZSBORlBfTkVUX1JYUl9NQVNLICAgICAgICAgICAgICAgIChORlBfTkVUX1JYUl9NQVggLSAxKQorCisvKioKKyAqIFJlYWQvV3JpdGUgY29uZmlnIHdvcmRzICgweDAwMDAgLSAweDAwMmMpCisgKiBATkZQX05FVF9DRkdfQ1RSTDogICAgICAgIEdsb2JhbCBjb250cm9sCisgKiBATkZQX05FVF9DRkdfVVBEQVRFOiAgICAgIEluZGljYXRlIHdoaWNoIGZpZWxkcyBhcmUgdXBkYXRlZAorICogQE5GUF9ORVRfQ0ZHX1RYUlNfRU5BQkxFOiBCaXRtYXNrIG9mIGVuYWJsZWQgVFggcmluZ3MKKyAqIEBORlBfTkVUX0NGR19SWFJTX0VOQUJMRTogQml0bWFzayBvZiBlbmFibGVkIFJYIHJpbmdzCisgKiBATkZQX05FVF9DRkdfTVRVOiAgICAgICAgIFNldCBNVFUgc2l6ZQorICogQE5GUF9ORVRfQ0ZHX0ZMQlVGU1o6ICAgICBTZXQgZnJlZWxpc3QgYnVmZmVyIHNpemUgKG11c3QgYmUgbGFyZ2VyIHRoYW4gTVRVKQorICogQE5GUF9ORVRfQ0ZHX0VYTjogICAgICAgICBN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mFtZSwgZm10LCBhcmdzLi4uKSBcCi0JcHJpbnRrKHR5cGUgRFJWX05BTUUgIiglcyk6ICIgZm10ICJcbiIsIG5hbWUsICMjYXJncykKLQotI2RlZmluZSBhaXJvX3ByaW50X2luZm8obmFtZSwgZm10LCBhcmdzLi4uKSBcCi0JYWlyb19wcmludChLRVJOX0lORk8sIG5hbWUsIGZtdCwgIyNhcmdzKQotCi0jZGVmaW5lIGFpcm9fcHJpbnRfZGJnKG5hbWUsIGZtdCwgYXJncy4uLikgXAotCWFpcm9fcHJpbnQoS0VSTl9ERUJVRywgbmFtZSwgZm10LCAjI2FyZ3MpCi0KLSNkZWZpbmUgYWlyb19wcmludF93YXJuKG5hbWUsIGZtdCwgYXJncy4uLikgXAotCWFpcm9fcHJpbnQoS0VSTl9XQVJOSU5HLCBuYW1lLCBmbXQsICMjYXJncykKLQotI2RlZmluZSBhaXJvX3ByaW50X2VycihuYW1lLCBmbXQsIGFyZ3MuLi4pIFwKLQlhaXJvX3ByaW50KEtFUk5fRVJSLCBuYW1lLCBmbXQsICMjYXJncykKLQotI2RlZmluZSBBSVJPX0ZMQVNIKGRldikgKCgoc3RydWN0IGFpcm9faW5mbyAqKWRldi0+bWxfcHJpdiktPmZsYXNoKQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUlDIFJPVVRJTkVTICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKi8KLQotc3RhdGljIGludCBSeFNlcVZhbGlkIChzdHJ1Y3QgYWlyb19pbmZvICphaSxtaWNjbnR4ICpjb250ZXh0LGludCBtY2FzdCx1MzIgbWljU2VxKTsKLXN0YXRpYyB2b2lkIE1vdmVXaW5kb3cobWljY250eCAq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Y2NudHgpKTsKLQkJbWVtc2V0KCZhaS0+bW9kW2ldLnVDdHgsMCxzaXplb2YobWljY250eCkpOwotCX0KLQlyZXR1cm4gU1VDQ0VTUzsKLX0KLQotc3RhdGljIGNvbnN0IHU4IG1pY3NuYXBbXSA9IHsweEFBLDB4QUEsMHgwMywweDAwLDB4NDAsMHg5NiwweDAwLDB4MDJ9OwotCi0vKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotICogRGVzY3JpcHRpb246IE1pYyBhIHBhY2tldAotICogICAgCi0gKiAgICAgIElucHV0czogZXRoZXJIZWFkICogcG9pbnRlciB0byBhbiA4MDIuMyBmcmFtZQotICogICAgCi0gKiAgICAgUmV0dXJuczogQk9PTEVBTiBpZiBzdWNjZXNzZnVsLCBvdGhlcndpc2UgZmFsc2UuCi0gKiAgICAgICAgICAgICBQYWNrZXRUeExlbiB3aWxsIGJlIHVwZGF0ZWQgd2l0aCB0aGUgbWljJ2QgcGFja2V0cyBzaXplLgotICoKLSAqICAgIENhdmVhdHM6IEl0IGlzIGFzc3VtZWQgdGhhdCB0aGUgZnJhbWUgYnVmZmVyIHdpbGwgYWxyZWFkeQotICogICAgICAgICAgICAgYmUgYmlnIGVub3VnaCB0byBob2xkIHRoZSBsYXJnZXRzIG1pYyBtZXNzYWdlIHBvc3NpYmxlLgotICogICAgICAgICAgICAoTm8gbWVtb3J5IGFsbG9jYXRpb24gaXMgZG9uZSBoZXJlKS4KLSAqICAKLSAqICAgIEF1dGhvcjogc2JyYW5la3kgKDEwLzE1LzAxKQotICogICAgTWVyY2lsZXNzIGhhY2tzIGJ5IHJ3aWxjaGVyICgxLzE0LzAyKQotICovCi0KLXN0YXRpYyBpbnQgZW5jYXBzdWxhdGUoc3RydWN0IGFpcm9faW5mbyAqYWkgLGV0aGVySGVhZCAqZnJhbWUsIE1JQ0J1ZmZlciAqbWljLCBpbnQgcGF5TGVuKQotewot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haWxfbGVuLCBXTEFOX0VJRF9SU04pOworCisJLyogZmluZCB0aGUgV1BBX0lFICovCisJd3BhX2llID0gYnJjbWZfZmluZF93cGFpZSgodTggKilzZXR0aW5ncy0+YmVhY29uLnRhaWwsCisJCQkJICBzZXR0aW5ncy0+YmVhY29uLnRhaWxfbGVuKTsKKworCWlmICgod3BhX2llICE9IE5VTEwgfHwgcnNuX2llICE9IE5VTEwpKSB7CisJCWJyY21mX2RiZyhUUkFDRSwgIldQQSgyKSBJRSBpcyBmb3VuZFxuIik7CisJCWlmICh3cGFfaWUgIT0gTlVMTCkgeworCQkJLyogV1BBIElFICovCisJCQllcnIgPSBicmNtZl9jb25maWd1cmVfd3BhaWUoaWZwLCB3cGFfaWUsIGZhbHNlKTsKKwkJCWlmIChlcnIgPCAwKQorCQkJCWdvdG8gZXhpdDsKKwkJfSBlbHNlIHsKKwkJCXN0cnVjdCBicmNtZl92c190bHYgKnRtcF9pZTsKKworCQkJdG1wX2llID0gKHN0cnVjdCBicmNtZl92c190bHYgKilyc25faWU7CisKKwkJCS8qIFJTTiBJRSAqLworCQkJZXJyID0gYnJjbWZfY29uZmlndXJlX3dwYWllKGlmcCwgdG1wX2llLCB0cnVlKTsKKwkJCWlmIChlcnIgPCAwKQorCQkJCWdvdG8gZXhpdDsKKwkJfQorCX0gZWxzZSB7CisJCWJyY21mX2RiZyhUUkFDRSwgIk5vIFdQQSgyKSBJRXMgZm91bmRcbiIpOworCQlicmNtZl9jb25maWd1cmVfb3BlbnNlY3VyaXR5KGlmcCk7CisJfQorCisJYnJjbWZfY29uZmlnX2FwX21nbXRfaWUoaWZwLT52aWYsICZzZXR0aW5ncy0+YmVhY29uKTsKKworCWlmICghbWJzcykgeworCQljaGFuc3BlYyA9IGNoYW5kZWZfdG9fY2hhbnNwZWMoJmNmZy0+ZDExaW5mLAorCQkJCQkgICAgICAgJnNldHRpbmdzLT5jaGFuZGVmKTsKKwkJZXJyID0gYnJjbWZfZmlsX2lvdmFyX2ludF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Ml90b19jcHUoYXNzb2NfaW5mby0+cmVzcF9sZW4pOworCWlmIChyZXFfbGVuKSB7CisJCWVyciA9IGJyY21mX2ZpbF9pb3Zhcl9kYXRhX2dldChpZnAsICJhc3NvY19yZXFfaWVzIiwKKwkJCQkJICAgICAgIGNmZy0+ZXh0cmFfYnVmLAorCQkJCQkgICAgICAgV0xfQVNTT0NfSU5GT19NQVgpOworCQlpZiAoZXJyKSB7CisJCQlicmNtZl9lcnIoImNvdWxkIG5vdCBnZXQgYXNzb2MgcmVxICglZClcbiIsIGVycik7CisJCQlyZXR1cm4gZXJyOworCQl9CisJCWNvbm5faW5mby0+cmVxX2llX2xlbiA9IHJlcV9sZW47CisJCWNvbm5faW5mby0+cmVxX2llID0KKwkJICAgIGttZW1kdXAoY2ZnLT5leHRyYV9idWYsIGNvbm5faW5mby0+cmVxX2llX2xlbiwKKwkJCSAgICBHRlBfS0VSTkVMKTsKKwl9IGVsc2UgeworCQljb25uX2luZm8tPnJlcV9pZV9sZW4gPSAwOworCQljb25uX2luZm8tPnJlcV9pZSA9IE5VTEw7CisJfQorCWlmIChyZXNwX2xlbikgeworCQllcnIgPSBicmNtZl9maWxfaW92YXJfZGF0YV9nZXQoaWZwLCAiYXNzb2NfcmVzcF9pZXMiLAorCQkJCQkgICAgICAgY2ZnLT5leHRyYV9idWYsCisJCQkJCSAgICAgICBXTF9BU1NPQ19JTkZPX01BWCk7CisJCWlmIChlcnIpIHsKKwkJCWJyY21mX2VycigiY291bGQgbm90IGdldCBhc3NvYyByZXNwICglZClcbiIsIGVycik7CisJCQlyZXR1cm4gZXJyOworCQl9CisJCWNvbm5faW5mby0+cmVzcF9pZV9sZW4gPSByZXNwX2xlbjsKKwkJY29ubl9pbmZvLT5yZXNwX2llID0KKwkJICAgIGttZW1kdXAoY2ZnLT5leHRyYV9idWYsIGNvbm5faW5mby0+cmVzcF9pZV9sZW4sCisJCQkgICAgR0ZQX0tFUk5FTCk7CisJfSBlbHNlIHsKKwkJY29ubl9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isJc2VxX3ByaW50ZihzLCAiYm9hcmRyZXY6ICVzXG4iLCBicmNtdV9ib2FyZHJldl9zdHIocmktPmJvYXJkcmV2LCBicmV2KSk7CisJc2VxX3ByaW50ZihzLCAiZHJpdmVycmV2OiAlc1xuIiwgYnJjbXVfZG90cmV2X3N0cihyaS0+ZHJpdmVycmV2LCBkcmV2KSk7CisJc2VxX3ByaW50ZihzLCAidWNvZGVyZXY6ICV1XG4iLCByaS0+dWNvZGVyZXYpOworCXNlcV9wcmludGYocywgImJ1czogJXVcbiIsIHJpLT5idXMpOworCXNlcV9wcmludGYocywgInBoeXR5cGU6ICV1XG4iLCByaS0+cGh5dHlwZSk7CisJc2VxX3ByaW50ZihzLCAicGh5cmV2OiAldVxuIiwgcmktPnBoeXJldik7CisJc2VxX3ByaW50ZihzLCAiYW5hcmV2OiAldVxuIiwgcmktPmFuYXJldik7CisJc2VxX3ByaW50ZihzLCAibnZyYW1yZXY6ICUwOHhcbiIsIHJpLT5udnJhbXJldik7CisKKwlyZXR1cm4gMDsKK30KKworaW50IGJyY21mX2J1c19zdGFydChzdHJ1Y3QgZGV2aWNlICpkZXYpCit7CisJaW50IHJldCA9IC0xOworCXN0cnVjdCBicmNtZl9idXMgKmJ1c19pZiA9IGRldl9nZXRfZHJ2ZGF0YShkZXYpOworCXN0cnVjdCBicmNtZl9wdWIgKmRydnIgPSBidXNfaWYtPmRydnI7CisJc3RydWN0IGJyY21mX2lmICppZnA7CisJc3RydWN0IGJyY21mX2lmICpwMnBfaWZwOworCisJYnJjbWZfZGJnKFRSQUNFLCAiXG4iKTsKKworCS8qIGFkZCBwcmltYXJ5IG5ldHdvcmtpbmcgaW50ZXJmYWNlICovCisJaWZwID0gYnJjbWZfYWRkX2lmKGRydnIsIDAsIDAsIGZhbHNlLCAid2xhbiVkIiwgTlVMTCk7CisJaWYgKElTX0VSUihpZnApKQorCQlyZXR1cm4gUFRSX0VSUihpZnApOworCisJcDJwX2lmcCA9IE5VTEw7CisKKwkvKi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CisJCXNrdiA9ICh1OCAqKSZudnAtPmRhdGFbbnZwLT5lbnRyeV07CisJCWNwbGVuID0gZWt2IC0gc2t2OworCQlpZiAobnZwLT5udnJhbV9sZW4gKyBjcGxlbiArIDEgPj0gQlJDTUZfRldfTUFYX05WUkFNX1NJWkUpCisJCQlyZXR1cm4gRU5EOworCQkvKiBjb3B5IHRvIG91dHB1dCBidWZmZXIgKi8KKwkJbWVtY3B5KCZudnAtPm52cmFtW252cC0+bnZyYW1fbGVuXSwgc2t2LCBjcGxlbik7CisJCW52cC0+bnZyYW1fbGVuICs9IGNwbGVuOworCQludnAtPm52cmFtW252cC0+bnZyYW1fbGVuXSA9ICdcMCc7CisJCW52cC0+bnZyYW1fbGVuKys7CisJCXJldHVybiBJRExFOworCX0KKwludnAtPnBvcysrOworCW52cC0+Y29sdW1uKys7CisJcmV0dXJuIFZBTFVFOworfQorCitzdGF0aWMgZW51bSBudnJhbV9wYXJzZXJfc3RhdGUKK2JyY21mX252cmFtX2hhbmRsZV9jb21tZW50KHN0cnVjdCBudnJhbV9wYXJzZXIgKm52cCkKK3sKKwljaGFyICplb2MsICpzb2w7CisKKwlzb2wgPSAoY2hhciAqKSZudnAtPmRhdGFbbnZwLT5wb3NdOworCWVvYyA9IHN0cmNocihzb2wsICdcbicpOworCWlmICghZW9jKSB7CisJCWVvYyA9IHN0cmNocihzb2wsICdcMCcpOworCQlpZiAoIWVvYykKKwkJCXJldHVybiBFTkQ7CisJfQorCisJLyogZWF0IGFsbCBtb3ZpbmcgdG8gbmV4dCBsaW5lICovCisJbnZwLT5saW5lKys7CisJbnZwLT5jb2x1bW4gPSAxOworCW52cC0+cG9zICs9IChlb2MgLSBzb2wpICsgMTsKKwlyZXR1cm4gSURMRTsKK30KKworc3RhdGljIGVudW0gbnZyYW1fcGFyc2VyX3N0YXRlIGJyY21mX252cmFtX2hhbmRsZV9lbmQoc3RydWN0IG52cmFtX3BhcnNlciAqbnZwKQoreworCS8qIGZpbmFsIHN0YXRlIC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pcF9tdWx0aV92MSgmbnZwLCBkb21haW5fbnIsIGJ1c19ucik7CisJZWxzZSBpZiAobnZwLm11bHRpX2Rldl92MikKKwkJYnJjbWZfZndfc3RyaXBfbXVsdGlfdjIoJm52cCwgZG9tYWluX25yLCBidXNfbnIpOworCisJaWYgKG52cC5udnJhbV9sZW4gPT0gMCkgeworCQlrZnJlZShudnAubnZyYW0pOworCQlyZXR1cm4gTlVMTDsKKwl9CisKKwlwYWQgPSBudnAubnZyYW1fbGVuOworCSpuZXdfbGVuZ3RoID0gcm91bmR1cChudnAubnZyYW1fbGVuICsgMSwgNCk7CisJd2hpbGUgKHBhZCAhPSAqbmV3X2xlbmd0aCkgeworCQludnAubnZyYW1bcGFkXSA9IDA7CisJCXBhZCsrOworCX0KKworCXRva2VuID0gKm5ld19sZW5ndGggLyA0OworCXRva2VuID0gKH50b2tlbiA8PCAxNikgfCAodG9rZW4gJiAweDAwMDBGRkZGKTsKKwl0b2tlbl9sZSA9IGNwdV90b19sZTMyKHRva2VuKTsKKworCW1lbWNweSgmbnZwLm52cmFtWypuZXdfbGVuZ3RoXSwgJnRva2VuX2xlLCBzaXplb2YodG9rZW5fbGUpKTsKKwkqbmV3X2xlbmd0aCArPSBzaXplb2YodG9rZW5fbGUpOworCisJcmV0dXJuIG52cC5udnJhbTsKK30KKwordm9pZCBicmNtZl9md19udnJhbV9mcmVlKHZvaWQgKm52cmFtKQoreworCWtmcmVlKG52cmFtKTsKK30KKworc3RydWN0IGJyY21mX2Z3IHsKKwlzdHJ1Y3QgZGV2aWNlICpkZXY7CisJdTE2IGZsYWdzOworCWNvbnN0IHN0cnVjdCBmaXJtd2FyZSAqY29kZTsKKwljb25zdCBjaGFyICpudnJhbV9uYW1lOworCXUxNiBkb21haW5fbnI7CisJdTE2IGJ1c19ucjsKKwl2b2lkICgqZG9uZSkoc3RydWN0IGRldmljZSAqZGV2LCBjb25zdCBzdHJ1Y3QgZmlybXdhcmUgKmZ3LAorCQkgICAgIHZvaWQgK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ndzKTsKK30KKworI2lmZGVmIERFQlVHCitzdGF0aWMgaW50IGJyY21mX2RlYnVnZnNfZndzX3N0YXRzX3JlYWQoc3RydWN0IHNlcV9maWxlICpzZXEsIHZvaWQgKmRhdGEpCit7CisJc3RydWN0IGJyY21mX2J1cyAqYnVzX2lmID0gZGV2X2dldF9kcnZkYXRhKHNlcS0+cHJpdmF0ZSk7CisJc3RydWN0IGJyY21mX2Z3c19zdGF0cyAqZndzdGF0cyA9ICZidXNfaWYtPmRydnItPmZ3cy0+c3RhdHM7CisKKwlzZXFfcHJpbnRmKHNlcSwKKwkJICAgImhlYWRlcl9wdWxsczogICAgICAldVxuIgorCQkgICAiaGVhZGVyX29ubHlfcGt0OiAgICV1XG4iCisJCSAgICJ0bHZfcGFyc2VfZmFpbGVkOiAgJXVcbiIKKwkJICAgInRsdl9pbnZhbGlkX3R5cGU6ICAldVxuIgorCQkgICAibWFjX3VwZGF0ZV9mYWlsczogICV1XG4iCisJCSAgICJwc191cGRhdGVfZmFpbHM6ICAgJXVcbiIKKwkJICAgImlmX3VwZGF0ZV9mYWlsczogICAldVxuIgorCQkgICAicGt0MmJ1czogICAgICAgICAgICV1XG4iCisJCSAgICJnZW5lcmljX2Vycm9yOiAgICAgJXVcbiIKKwkJICAgInJvbGxiYWNrX3N1Y2Nlc3M6ICAldVxuIgorCQkgICAicm9sbGJhY2tfZmFpbGVkOiAgICV1XG4iCisJCSAgICJkZWxheXFfZnVsbDogICAgICAgJXVcbiIKKwkJICAgInN1cHBycV9mdWxsOiAgICAgICAldVxuIgorCQkgICAidHhzX2luZGljYXRlOiAgICAgICV1XG4iCisJCSAgICJ0eHNfZGlzY2FyZDogICAgICAgJXVcbiIKKwkJICAgInR4c19zdXBwcl9jb3JlOiAgICAldVxuIgorCQkgICAidHhzX3N1cHByX3BzOiAgICAgICV1XG4iCisJCSAgICJ0eHNfdG9zc2VkOiAgICAgICAgJXVcbiIKKwkJICAgInR4c19ob3N0X3Rvc3NlZDogICAldVxuI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VFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUworICogV0hBVFNPRVZFUiBSRVNVTFRJTkcgRlJPTSBMT1NTIE9GIFVTRSwgREFUQSBPUiBQUk9GSVRTLCBXSEVUSEVSIElOIEFOIEFDVElPTgorICogT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1IgT1RIRVIgVE9SVElPVVMgQUNUSU9OLCBBUklTSU5HIE9VVCBPRiBPUiBJTgorICogQ09OTkVDVElPTiBXSVRIIFRIRSBVU0UgT1IgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4KKyAqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogQ29tbXVuaWNhdGVzIHdpdGggdGhlIGRvbmdsZSBieSB1c2luZyBkY21kIGNvZGVzLgorICogRm9yIGNlcnRhaW4gZGNtZCBjb2RlcywgdGhlIGRvbmdsZSBpbnRlcnByZXRzIHN0cmluZyBkYXRhIGZyb20gdGhlIGhvc3QuCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjaW5jbHVkZSA8bGludXgvdHlwZXMuaD4KKyNpbmNsdWRlIDxsaW51eC9uZXRkZXZpY2UuaD4KKworI2luY2x1ZGUgPGJyY211X3V0aWxzLmg+CisjaW5jbHVkZSA8YnJjbXVfd2lmaS5oPgorCisjaW5jbHVkZSAiY29yZS5oIgorI2luY2x1ZGUgImRlYnVnLmgiCisjaW5jbHVkZSAicHJvdG8uaCIKKyNpbmNsdWRlICJtc2didWYuaCIKKyNpbmNsdWRlICJjb21tb25yaW5nLmgiCisjaW5jbHVkZSAiZmxvd3JpbmcuaCIKKyNpbmNsdWRlICJidXMuaCIKKyNpbmNsdWRlICJ0cmFjZXBvaW50LmgiCisKKworI2RlZmluZSBNU0dCVUZfSU9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bnVtIGJyY21mX3NkaW9kX3N0YXRlIHN0YXRlOworCXN0cnVjdCBicmNtZl9zZGlvZF9mcmVlemVyICpmcmVlemVyOworfTsKKworLyogc2RpbyBjb3JlIHJlZ2lzdGVycyAqLworc3RydWN0IHNkcGNtZF9yZWdzIHsKKwl1MzIgY29yZWNvbnRyb2w7CQkvKiAweDAwLCByZXY4ICovCisJdTMyIGNvcmVzdGF0dXM7CQkJLyogcmV2OCAqLworCXUzMiBQQURbMV07CisJdTMyIGJpc3RzdGF0dXM7CQkJLyogcmV2OCAqLworCisJLyogUENNQ0lBIGFjY2VzcyAqLworCXUxNiBwY21jaWFtZXNwb3J0YWxhZGRyOwkvKiAweDAxMCwgcmV2OCAqLworCXUxNiBQQURbMV07CisJdTE2IHBjbWNpYW1lc3BvcnRhbG1hc2s7CS8qIHJldjggKi8KKwl1MTYgUEFEWzFdOworCXUxNiBwY21jaWF3cmZyYW1lYmM7CQkvKiByZXY4ICovCisJdTE2IFBBRFsxXTsKKwl1MTYgcGNtY2lhdW5kZXJmbG93dGltZXI7CS8qIHJldjggKi8KKwl1MTYgUEFEWzFdOworCisJLyogaW50ZXJydXB0ICovCisJdTMyIGludHN0YXR1czsJCQkvKiAweDAyMCwgcmV2OCAqLworCXUzMiBob3N0aW50bWFzazsJCS8qIHJldjggKi8KKwl1MzIgaW50bWFzazsJCQkvKiByZXY4ICovCisJdTMyIHNiaW50c3RhdHVzOwkJLyogcmV2OCAqLworCXUzMiBzYmludG1hc2s7CQkJLyogcmV2OCAqLworCXUzMiBmdW5jaW50bWFzazsJCS8qIHJldjQgKi8KKwl1MzIgUEFEWzJdOworCXUzMiB0b3NibWFpbGJveDsJCS8qIDB4MDQwLCByZXY4ICovCisJdTMyIHRvaG9zdG1haWxib3g7CQkvKiByZXY4ICovCisJdTMyIHRvc2JtYWlsYm94ZGF0YTsJCS8qIHJldjggKi8KKwl1MzIgdG9ob3N0bWFpbGJveGRhdGE7CQkvKiByZXY4ICovCisKKwkvKiBze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mcmVlY291bnQpOworCQlnb3RvIGZhaWw7CisJfQorCisJc3Bpbl9sb2NrX2lycXNhdmUoJmRldmluZm8tPnR4X2Zsb3dibG9ja19sb2NrLCBmbGFncyk7CisJaWYgKGRldmluZm8tPnR4X2ZyZWVjb3VudCA8IGRldmluZm8tPnR4X2xvd193YXRlcm1hcmsgJiYKKwkgICAgIWRldmluZm8tPnR4X2Zsb3dibG9jaykgeworCQlicmNtZl90eGZsb3dibG9jayhkZXYsIHRydWUpOworCQlkZXZpbmZvLT50eF9mbG93YmxvY2sgPSB0cnVlOworCX0KKwlzcGluX3VubG9ja19pcnFyZXN0b3JlKCZkZXZpbmZvLT50eF9mbG93YmxvY2tfbG9jaywgZmxhZ3MpOworCXJldHVybiAwOworCitmYWlsOgorCXJldHVybiByZXQ7Cit9CisKKworc3RhdGljIGludCBicmNtZl91c2JfdXAoc3RydWN0IGRldmljZSAqZGV2KQoreworCXN0cnVjdCBicmNtZl91c2JkZXZfaW5mbyAqZGV2aW5mbyA9IGJyY21mX3VzYl9nZXRfYnVzaW5mbyhkZXYpOworCisJYnJjbWZfZGJnKFVTQiwgIkVudGVyXG4iKTsKKwlpZiAoZGV2aW5mby0+YnVzX3B1Yi5zdGF0ZSA9PSBCUkNNRk1BQ19VU0JfU1RBVEVfVVApCisJCXJldHVybiAwOworCisJLyogU3VjY2VzcywgaW5kaWNhdGUgZGV2aW5mbyBpcyBmdWxseSB1cCAqLworCWJyY21mX3VzYl9zdGF0ZV9jaGFuZ2UoZGV2aW5mbywgQlJDTUZNQUNfVVNCX1NUQVRFX1VQKTsKKworCWlmIChkZXZpbmZvLT5jdGxfdXJiKSB7CisJCWRldmluZm8tPmN0bF9pbl9waXBlID0gdXNiX3JjdmN0cmxwaXBlKGRldmluZm8tPnVzYmRldiwgMCk7CisJCWRldmluZm8tPmN0bF9vdXRfcGlwZSA9IHVzYl9zbmRjdHJscGlwZShkZXZpbmZvLT51c2JkZXYsIDApOworCisJCS8qIENUTCBXcml0ZSA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PSB3bGMtPnB1Yi0+aWVlZV9ody0+Y29uZi5jaGFuZGVmLmNoYW47CisJdWludCBpOworCXVpbnQgY2hhbjsKKwlpbnQgbWF4cHdyOworCWludCBkZWx0YTsKKwljb25zdCBzdHJ1Y3QgY291bnRyeV9pbmZvICpjb3VudHJ5OworCXN0cnVjdCBicmNtc19iYW5kICpiYW5kOworCWludCBjb25kdWN0ZWRfbWF4ID0gQlJDTVNfVFhQV1JfTUFYOworCWNvbnN0IHN0cnVjdCBsb2NhbGVfbWltb19pbmZvICpsaV9taW1vOworCWludCBtYXhwd3IyMCwgbWF4cHdyNDA7CisJaW50IG1heHB3cl9pZHg7CisJdWludCBqOworCisJbWVtc2V0KHR4cHdyLCAwLCBzaXplb2Yoc3RydWN0IHR4cHdyX2xpbWl0cykpOworCisJaWYgKFdBUk5fT04oIWNoKSkKKwkJcmV0dXJuOworCisJY291bnRyeSA9ICZ3bGNfY20tPndvcmxkX3JlZ2QtPmNvdW50cnk7CisKKwljaGFuID0gQ0hTUEVDX0NIQU5ORUwoY2hhbnNwZWMpOworCWJhbmQgPSB3bGMtPmJhbmRzdGF0ZVtjaHNwZWNfYmFuZHVuaXQoY2hhbnNwZWMpXTsKKwlsaV9taW1vID0gKGJhbmQtPmJhbmR0eXBlID09IEJSQ01fQkFORF81RykgPworCSAgICBicmNtc19jX2dldF9taW1vXzVnKGNvdW50cnktPmxvY2FsZV9taW1vXzVHKSA6CisJICAgIGJyY21zX2NfZ2V0X21pbW9fMmcoY291bnRyeS0+bG9jYWxlX21pbW9fMkcpOworCisJZGVsdGEgPSBiYW5kLT5hbnRnYWluOworCisJaWYgKGJhbmQtPmJhbmR0eXBlID09IEJSQ01fQkFORF8yRykKKwkJY29uZHVjdGVkX21heCA9IFFEQigyMik7CisKKwltYXhwd3IgPSBRREIoY2gtPm1heF9wb3dlcikgLSBkZWx0YTsKKwltYXhwd3IgPSBtYXgobWF4cHdyLCAwKTsKKwltYXhwd3IgPSBtaW4obWF4cHdyLCBj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lIEFJUk9QQ0FQICAgICAgICAgICAgICAgCUFJUk9HU1RBVFNEMzIgKyA0MAorI2RlZmluZSBBSVJPUFZMSVNUICAgICAgICAgICAgICBBSVJPUENBUCAgICAgICsgMQorI2RlZmluZSBBSVJPUFNMSVNUCQlBSVJPUFZMSVNUICAgICsgMQorI2RlZmluZSBBSVJPUENGRwkJQUlST1BTTElTVCAgICArIDEKKyNkZWZpbmUgQUlST1BTSURTCQlBSVJPUENGRyAgICAgICsgMQorI2RlZmluZSBBSVJPUEFQTElTVAkJQUlST1BTSURTICAgICArIDEKKyNkZWZpbmUgQUlST1BNQUNPTgkJQUlST1BBUExJU1QgICArIDEJLyogRW5hYmxlIG1hYyAgKi8KKyNkZWZpbmUgQUlST1BNQUNPRkYJCUFJUk9QTUFDT04gICAgKyAxIAkvKiBEaXNhYmxlIG1hYyAqLworI2RlZmluZSBBSVJPUFNUQ0xSCQlBSVJPUE1BQ09GRiAgICsgMQorI2RlZmluZSBBSVJPUFdFUEtFWQkJQUlST1BTVENMUiAgICArIDEKKyNkZWZpbmUgQUlST1BXRVBLRVlOVgkJQUlST1BXRVBLRVkgICArIDEKKyNkZWZpbmUgQUlST1BMRUFQUFdEICAgICAgICAgICAgQUlST1BXRVBLRVlOViArIDEKKyNkZWZpbmUgQUlST1BMRUFQVVNSICAgICAgICAgICAgQUlST1BMRUFQUFdEICArIDEKKworLyogRmxhc2ggY29kZXMgKi8KKworI2RlZmluZSBBSVJPRkxTSFJTVAkgICAgICAgQUlST1BXRVBLRVlOViAgKyA0MAorI2RlZmluZSBBSVJPRkxTSEdDSFIgICAgICAgICAgIEFJUk9GTFNIUlNUICAgICsgMQorI2RlZmluZSBBSVJPRkxTSFNURkwgICAgICAgICAgIEFJUk9GTFNIR0NIUiAgICsgMQorI2RlZmluZSBBSVJPRkxTSFBDSFIgICAgICAgICAgIEFJUk9GTFNIU1RGTCAgICsgMQorI2RlZmluZSBBSVJPRkxQVVRCVUYgICAgICAgICAgIEFJUk9GTFN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X3ByaW50KEtFUk5fRVJSLCBuYW1lLCBmbXQsICMjYXJncykKKworI2RlZmluZSBBSVJPX0ZMQVNIKGRldikgKCgoc3RydWN0IGFpcm9faW5mbyAqKWRldi0+bWxfcHJpdiktPmZsYXNoKQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUlDIFJPVVRJTkVTICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKi8KKworc3RhdGljIGludCBSeFNlcVZhbGlkIChzdHJ1Y3QgYWlyb19pbmZvICphaSxtaWNjbnR4ICpjb250ZXh0LGludCBtY2FzdCx1MzIgbWljU2VxKTsKK3N0YXRpYyB2b2lkIE1vdmVXaW5kb3cobWljY250eCAqY29udGV4dCwgdTMyIG1pY1NlcSk7CitzdGF0aWMgdm9pZCBlbW1oMzJfc2V0c2VlZChlbW1oMzJfY29udGV4dCAqY29udGV4dCwgdTggKnBrZXksIGludCBrZXlsZW4sCisJCQkgICBzdHJ1Y3QgY3J5cHRvX2NpcGhlciAqdGZtKTsKK3N0YXRpYyB2b2lkIGVtbWgzMl9pbml0KGVtbWgzMl9jb250ZXh0ICpjb250ZXh0KTsKK3N0YXRpYyB2b2lkIGVtbWgzMl91cGRhdGUoZW1taDMyX2NvbnRleHQgKmNvbnRleHQsIHU4ICpwT2N0ZXRzLCBpbnQgbGVuKTsKK3N0YXRpYyB2b2lkIGVtbWgzMl9maW5hbChlbW1oMzJfY29udGV4dCAqY29udGV4dCwgdTggZGlnZXN0WzRdKTsKK3N0YXRpYyBpbnQgZmxhc2hwY2hhcihzdHJ1Y3QgYWlyb19pbmZvICphaSxpbnQgYnl0ZSxpbnQgZHdlbGx0aW1lKTsKKworc3RhdGljIHZvaWQgYWdlX21pY19jb250ZXh0KG1pY2NudHggKmN1ciwgbWljY250eCAqb2xkLCB1OCAqa2V5LCBpbnQga2V5X2xlbiwKKwkJCSAgICBzdHJ1Y3QgY3J5cHRvX2NpcGhlciAqdGZtKQoreworCS8qIElmIHRoZSBjdXJyZW50IE1JQyBjb250ZXh0IGlzIHZhbGlkIGFuZCBpdHMga2V5IGlzIHRoZSBzYW1lIGFzCisJICogdGhlIE1JQyByZWdpc3RlciwgdGhlcmUncyBub3RoaW5nIHRvIGRvLgorCSAqLworCWlmIChjdXItPnZhbGlkICYmIChtZW1jbXAoY3VyLT5rZXksIGtleSwga2V5X2xlbikgPT0gMCkpCisJCXJldHVybjsKKworCS8qIEFnZSBjdXJyZW50IG1pYyBDb250ZXh0ICovCisJbWVtY3B5KG9sZCwgY3VyLCBzaXplb2YoKmN1cikpOworCisJLyogSW5pdGlhbGl6ZSBuZXcgY29udGV4dCAqLworCW1lbWNweShjdXItPmtleSwga2V5LCBrZXlfbGVuKTsKKwljdXItPndpbmRvdyAgPSAzMzsgLyogV2luZG93IGFsd2F5cyBwb2ludHMgdG8gdGhlIG1pZGRsZSAqLworCWN1ci0+cnggICAgICA9IDA7ICAvKiBSeCBTZXF1ZW5jZSBudW1iZXJzICovCisJY3VyLT50eCAgICAgID0gMDsgIC8qIFR4IHNlcXVlbmNlIG51bWJlcnMgKi8KKwljdXItPnZhbGlkICAgPSAxOyAgLyogS2V5IGlzIG5vdyB2YWxpZCAqLworCisJLyogR2l2ZSBrZXkgdG8gbWljIHNlZWQgKi8KKwllbW1oMzJfc2V0c2VlZCgmY3VyLT5zZWVkLCBrZXksIGtleV9sZW4sIHRmbSk7Cit9CisKKy8qIG1pY2luaXQgLSBJbml0aWFsaXplIG1pYyBzZWVkICovCisKK3N0YXRpYyB2b2lkIG1pY2luaXQoc3RydWN0IGFpcm9faW5mbyAqYWkpCit7CisJTUlDUmlkIG1pY19yaWQ7CisKKwljbGVhcl9iaXQoSk9CX01JQywgJmFpLT5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WkpIHsKKwlpbnQgaTsKKworCWlmIChhaS0+dGZtID09IE5VTEwpCisJICAgICAgICBhaS0+dGZtID0gY3J5cHRvX2FsbG9jX2NpcGhlcigiYWVzIiwgMCwgQ1JZUFRPX0FMR19BU1lOQyk7CisKKyAgICAgICAgaWYgKElTX0VSUihhaS0+dGZtKSkgeworICAgICAgICAgICAgICAgIGFpcm9fcHJpbnRfZXJyKGFpLT5kZXYtPm5hbWUsICJmYWlsZWQgdG8gbG9hZCB0cmFuc2Zvcm0gZm9yIEFFUyIpOworICAgICAgICAgICAgICAgIGFpLT50Zm0gPSBOVUxMOworICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUjsKKyAgICAgICAgfQorCisJZm9yIChpPTA7IGkgPCBOVU1fTU9EVUxFUzsgaSsrKSB7CisJCW1lbXNldCgmYWktPm1vZFtpXS5tQ3R4LDAsc2l6ZW9mKG1pY2NudHgpKTsKKwkJbWVtc2V0KCZhaS0+bW9kW2ldLnVDdHgsMCxzaXplb2YobWljY250eCkpOworCX0KKwlyZXR1cm4gU1VDQ0VTUzsKK30KKworc3RhdGljIGNvbnN0IHU4IG1pY3NuYXBbXSA9IHsweEFBLDB4QUEsMHgwMywweDAwLDB4NDAsMHg5NiwweDAwLDB4MDJ9OworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogRGVzY3JpcHRpb246IE1pYyBhIHBhY2tldAorICogICAgCisgKiAgICAgIElucHV0czogZXRoZXJIZWFkICogcG9pbnRlciB0byBhbiA4MDIuMyBmcmFtZQorICogICAgCisgKiAgICAgUmV0dXJuczogQk9PTEVBTiBpZiBzdWNjZXNzZnVsLCBvdGhlcndpc2UgZmFsc2UuCisgKiAgICAgICAgICAgICBQYWNrZXRUeExlbiB3aWxsIGJlIHVwZGF0ZWQgd2l0aCB0aGUgbWljJ2QgcGFja2V0cyBzaXplLgorICoKKyAqICAgIENhdmVhdHM6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dpdGNoIChtaWNFcnJvcikgeworCQljYXNlIE5PTUlDUExVTU1FRDogYWktPm1pY3N0YXRzLnJ4TUlDUGx1bW1lZCsrOyAgIGJyZWFrOworCQljYXNlIFNFUVVFTkNFOiAgICBhaS0+bWljc3RhdHMucnhXcm9uZ1NlcXVlbmNlKys7IGJyZWFrOworCQljYXNlIElOQ09SUkVDVE1JQzogYWktPm1pY3N0YXRzLnJ4SW5jb3JyZWN0TUlDKys7IGJyZWFrOworCQljYXNlIE5PTkU6ICBicmVhazsKKwkJY2FzZSBOT01JQzogYnJlYWs7CisJfQorCXJldHVybiBFUlJPUjsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIERlc2NyaXB0aW9uOiAgQ2hlY2tzIHRoZSBSeCBTZXEgbnVtYmVyIHRvIG1ha2Ugc3VyZSBpdCBpcyB2YWxpZAorICogICAgICAgICAgICAgICBhbmQgaGFzbid0IGFscmVhZHkgYmVlbiByZWNlaXZlZAorICogICAKKyAqICAgICBJbnB1dHM6IG1pY2NudHggLSBtaWMgY29udGV4dCB0byBjaGVjayBzZXEgYWdhaW5zdAorICogICAgICAgICAgICAgbWljU2VxICAtIHRoZSBNaWMgc2VxIG51bWJlcgorICogICAKKyAqICAgIFJldHVybnM6IFRSVUUgaWYgdmFsaWQgb3RoZXJ3aXNlIEZBTFNFLiAKKyAqCisgKiAgICBBdXRob3I6IHNicmFuZWt5ICgxMC8xNS8wMSkKKyAqICAgIE1lcmNpbGVzcyBoYWNrcyBieSByd2lsY2hlciAoMS8xNC8wMikKKyAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgKi8KKworc3RhdGljIGludCBSeFNlcVZhbGlkIChzdHJ1Y3QgYWlyb19pbmZvICphaSxtaWNjbn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DsKKworCQljb250ZXh0LT53aW5kb3cgPSBtaWNTZXE7ICAgICAgLy9Nb3ZlIHdpbmRvdworCX0KK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKy8qPT09PT09PT09PSBFTU1IIFJPVVRJTkVTICA9PT09PT09PT09PT09PT09PT09PSovCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKiBtaWMgYWNjdW11bGF0ZSAqLworI2RlZmluZSBNSUNfQUNDVU0odmFsKQlcCisJY29udGV4dC0+YWNjdW0gKz0gKHU2NCkodmFsKSAqIGNvbnRleHQtPmNvZWZmW2NvZWZmX3Bvc2l0aW9uKytdOworCitzdGF0aWMgdW5zaWduZWQgY2hhciBhZXNfY291bnRlclsxNl07CisKKy8qIGV4cGFuZCB0aGUga2V5IHRvIGZpbGwgdGhlIE1NSCBjb2VmZmljaWVudCBhcnJheSAqLworc3RhdGljIHZvaWQgZW1taDMyX3NldHNlZWQoZW1taDMyX2NvbnRleHQgKmNvbnRleHQsIHU4ICpwa2V5LCBpbnQga2V5bGVuLAorCQkJICAgc3RydWN0IGNyeXB0b19jaXBoZXIgKnRmbSkKK3sKKyAgLyogdGFrZSB0aGUga2V5aW5nIG1hdGVyaWFsLCBleHBhbmQgaWYgbmVjZXNzYXJ5LCB0cnVuY2F0ZSBhdCAxNi1ieXRlcyAqLworICAvKiBydW4gdGhyb3VnaCBBRVMgY291bnRlciBtb2RlIHRvIGdlbmVyYXRlIGNvbnRleHQtPmNvZWZmW10gKi8KKyAgCisJaW50IGksajsKKwl1MzIgY291bnRlcjsKKwl1OCAqY2lwaGVyLCBwbGFpblsxNl07CisKKwljcnlwdG9fY2lwaGVyX3NldGtleSh0Zm0sIHBrZXksIDE2KTsKKwljb3VudGVyID0gMDsKKwlmb3IgKGkgPSAwOyBpIDwgQVJSQVlfU0laRShjb250ZXh0LT5jb2VmZik7ICkgeworCQlhZXNfY291bnRlclsxNV0gPSAodTgpKGNvdW50ZXIgPj4gMCk7CisJCWFlc19jb3VudGVyWzE0XSA9ICh1OCkoY291bnRlciA+PiA4KTsKKwkJYWVzX2NvdW50ZXJbMTNdID0gKHU4KShjb3VudGVyID4+IDE2KTsKKwkJYWVzX2NvdW50ZXJbMTJdID0gKHU4KShjb3VudGVyID4+IDI0KTsKKwkJY291bnRlcisrOworCQltZW1jcHkgKHBsYWluLCBhZXNfY291bnRlciwgMTYpOworCQljcnlwdG9fY2lwaGVyX2VuY3J5cHRfb25lKHRmbSwgcGxhaW4sIHBsYWluKTsKKwkJY2lwaGVyID0gcGxhaW47CisJCWZvciAoaiA9IDA7IChqIDwgMTYpICYmIChpIDwgQVJSQVlfU0laRShjb250ZXh0LT5jb2VmZikpOyApIHsKKwkJCWNvbnRleHQtPmNvZWZmW2krK10gPSBudG9obCgqKF9fYmUzMiAqKSZjaXBoZXJbal0pOworCQkJaiArPSA0OworCQl9CisJfQorfQorCisvKiBwcmVwYXJlIGZvciBjYWxjdWxhdGlvbiBvZiBhIG5ldyBtaWMgKi8KK3N0YXRpYyB2b2lkIGVtbWgzMl9pbml0KGVtbWgzMl9jb250ZXh0ICpjb250ZXh0KQoreworCS8qIHByZXBhcmUgZm9yIG5ldyBtaWMgY2FsY3VsYXRpb24gKi8KKwljb250ZXh0LT5hY2N1bSA9IDA7CisJY29udGV4dC0+cG9zaXRpb24gPSAwOworfQorCisvKiBhZGQgc29tZSBieXRlcyB0byB0aGUgbWljIGNhbGN1bGF0aW9uICovCitzdGF0aWMgdm9pZCBlbW1oMzJfdXBkYXRlKGVtbWgzMl9jb250ZXh0ICpjb250ZXh0LCB1OCAqcE9jdGV0cywgaW50IGxlbikKK3sKKwlpbnQJY29lZmZfcG9zaXRpb24sIGJ5dGVfcG9zaXRpb247CisgIAorCWlmIChsZW4gPT0gMCkgcmV0dXJuOworICAKKwljb2VmZl9wb3NpdGlvbiA9IGNvbnRleHQtPnBvc2l0aW9uID4+IDI7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CQkJcmV0dXJuIEVSUk9SOworCisJCSpwYXlsb2FkTGVuID0gY3B1X3RvX2xlMTYobGVuLXNpemVvZihldGhlckhlYWQpK3NpemVvZihwTWljKSk7CisJCWFpLT50eGZpZHNbMF0udHhfZGVzYy5sZW4gKz0gc2l6ZW9mKHBNaWMpOworCQkvKiBjb3B5IGRhdGEgaW50byBhaXJvIGRtYSBidWZmZXIgKi8KKwkJbWVtY3B5IChzZW5kYnVmLCBidWZmZXIsIHNpemVvZihldGhlckhlYWQpKTsKKwkJYnVmZmVyICs9IHNpemVvZihldGhlckhlYWQpOworCQlzZW5kYnVmICs9IHNpemVvZihldGhlckhlYWQpOworCQltZW1jcHkgKHNlbmRidWYsICZwTWljLCBzaXplb2YocE1pYykpOworCQlzZW5kYnVmICs9IHNpemVvZihwTWljKTsKKwkJbWVtY3B5IChzZW5kYnVmLCBidWZmZXIsIGxlbiAtIHNpemVvZihldGhlckhlYWQpKTsKKwl9IGVsc2UgeworCQkqcGF5bG9hZExlbiA9IGNwdV90b19sZTE2KGxlbiAtIHNpemVvZihldGhlckhlYWQpKTsKKworCQlkZXYtPnRyYW5zX3N0YXJ0ID0gamlmZmllczsKKworCQkvKiBjb3B5IGRhdGEgaW50byBhaXJvIGRtYSBidWZmZXIgKi8KKwkJbWVtY3B5KHNlbmRidWYsIGJ1ZmZlciwgbGVuKTsKKwl9CisKKwltZW1jcHlfdG9pbyhhaS0+dHhmaWRzWzBdLmNhcmRfcmFtX29mZiwKKwkJJmFpLT50eGZpZHNbMF0udHhfZGVzYywgc2l6ZW9mKFR4RmlkKSk7CisKKwlPVVQ0NTAwKGFpLCBFVkFDSywgOCk7CisKKwlkZXZfa2ZyZWVfc2tiX2FueShza2IpOworCXJldHVybiAxOworfQorCitzdGF0aWMgdm9pZCBnZXRfdHhfZXJyb3Ioc3RydWN0IGFpcm9faW5mbyAqYWksIHMzMiBmaWQpCit7CisJX19sZTE2IHN0YXR1czsKKworCWlmIChmaWQgPCAwKQorCQlzdGF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ChhaSwgcmlkLCBDTURfQUNDRVNTKSkgIT0gMCkgeworCSAgICAgICAgICAgICAgICByYyA9IHN0YXR1czsKKwkgICAgICAgICAgICAgICAgZ290byBkb25lOworCSAgICAgICAgfQorCQkvLyAtLS0gbm93IHdyaXRlIHRoZSByaWQgZGF0YQorCQlpZiAoYmFwX3NldHVwKGFpLCByaWQsIDAsIEJBUDEpICE9IFNVQ0NFU1MpIHsKKwkgICAgICAgICAgICAgICAgcmMgPSBFUlJPUjsKKwkgICAgICAgICAgICAgICAgZ290byBkb25lOworCSAgICAgICAgfQorCQliYXBfd3JpdGUoYWksIHBCdWYsIGxlbiwgQkFQMSk7CisJCS8vIC0tLW5vdyBjb21taXQgdGhlIHJpZCBkYXRhCisJCXJjID0gUEM0NTAwX2FjY2Vzc3JpZChhaSwgcmlkLCAweDEwMHxDTURfQUNDRVNTKTsKKwl9Citkb25lOgorCWlmIChsb2NrKQorCQl1cCgmYWktPnNlbSk7CisgICAgICAgIHJldHVybiByYzsKK30KKworLyogQWxsb2NhdGVzIGEgRklEIHRvIGJlIHVzZWQgZm9yIHRyYW5zbWl0dGluZyBwYWNrZXRzLiAgV2Ugb25seSB1c2UKKyAgIG9uZSBmb3Igbm93LiAqLworc3RhdGljIHUxNiB0cmFuc21pdF9hbGxvY2F0ZShzdHJ1Y3QgYWlyb19pbmZvICphaSwgaW50IGxlblBheWxvYWQsIGludCByYXcpCit7CisJdW5zaWduZWQgaW50IGxvb3AgPSAzMDAwOworCUNtZCBjbWQ7CisJUmVzcCByc3A7CisJdTE2IHR4RmlkOworCV9fbGUxNiB0eENvbnRyb2w7CisKKwljbWQuY21kID0gQ01EX0FMTE9DQVRFVFg7CisJY21kLnBhcm0wID0gbGVuUGF5bG9hZDsKKwlpZiAoZG93bl9pbnRlcnJ1cHRpYmxlKCZhaS0+c2VtKSkKKwkJcmV0dXJuIEVSUk9SOworCWlmIChpc3N1ZWNvbW1hbmQoYWksICZjbWQsICZyc3ApICE9IFNVQ0NFU1M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hZ3MpOworCQkJfQorCQl9IGVsc2UgaWYgKCAhc3RybmNtcCggbGluZSwgIkRhdGFSYXRlczogIiwgMTEgKSApIHsKKwkJCWludCB2LCBpID0gMCwgayA9IDA7IC8qIGkgaXMgaW5kZXggaW50byBsaW5lLAorCQkJCQkJayBpcyBpbmRleCB0byByYXRlcyAqLworCisJCQlsaW5lICs9IDExOworCQkJd2hpbGUoKHYgPSBnZXRfZGVjX3UxNihsaW5lLCAmaSwgMykpIT0tMSkgeworCQkJCWFpLT5jb25maWcucmF0ZXNbaysrXSA9ICh1OCl2OworCQkJCWxpbmUgKz0gaSArIDE7CisJCQkJaSA9IDA7CisJCQl9CisJCQlzZXRfYml0IChGTEFHX0NPTU1JVCwgJmFpLT5mbGFncyk7CisJCX0gZWxzZSBpZiAoICFzdHJuY21wKCBsaW5lLCAiQ2hhbm5lbDogIiwgOSApICkgeworCQkJaW50IHYsIGkgPSAwOworCQkJbGluZSArPSA5OworCQkJdiA9IGdldF9kZWNfdTE2KGxpbmUsICZpLCBpKzMpOworCQkJaWYgKCB2ICE9IC0xICkgeworCQkJCWFpLT5jb25maWcuY2hhbm5lbFNldCA9IGNwdV90b19sZTE2KHYpOworCQkJCXNldF9iaXQgKEZMQUdfQ09NTUlULCAmYWktPmZsYWdzKTsKKwkJCX0KKwkJfSBlbHNlIGlmICggIXN0cm5jbXAoIGxpbmUsICJYbWl0UG93ZXI6ICIsIDExICkgKSB7CisJCQlpbnQgdiwgaSA9IDA7CisJCQlsaW5lICs9IDExOworCQkJdiA9IGdldF9kZWNfdTE2KGxpbmUsICZpLCBpKzMpOworCQkJaWYgKCB2ICE9IC0xICkgeworCQkJCWFpLT5jb25maWcudHhQb3dlciA9IGNwdV90b19sZTE2KHYpOworCQkJCXNldF9iaXQgKEZMQUdfQ09NTUlULCAmYWktPmZsYWdzKTsKKwkJCX0KKwkJfSBlbHNlIGlmICggIXN0cm5jbXAoIGxpbmUsICJXRVA6ICIsIDUgKSApIHsKKwkJCWxpbm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YWNhZGRyLCBFVEhfQUxFTik7CisKKwlpZiAocGVybSkgZGlzYWJsZV9NQUMoYWksIGxvY2spOworCXJjID0gd3JpdGVXZXBLZXlSaWQoYWksICZ3a3IsIHBlcm0sIGxvY2spOworCWlmIChwZXJtKSBlbmFibGVfTUFDKGFpLCBsb2NrKTsKKwlyZXR1cm4gcmM7Cit9CisKK3N0YXRpYyBpbnQgc2V0X3dlcF90eF9pZHgoc3RydWN0IGFpcm9faW5mbyAqYWksIHUxNiBpbmRleCwgaW50IHBlcm0sIGludCBsb2NrKQoreworCVdlcEtleVJpZCB3a3I7CisJaW50IHJjOworCisJbWVtc2V0KCZ3a3IsIDAsIHNpemVvZih3a3IpKTsKKwl3a3IubGVuID0gY3B1X3RvX2xlMTYoc2l6ZW9mKHdrcikpOworCXdrci5raW5kZXggPSBjcHVfdG9fbGUxNigweGZmZmYpOworCXdrci5tYWNbMF0gPSAoY2hhcilpbmRleDsKKworCWlmIChwZXJtKSB7CisJCWFpLT5kZWZpbmRleCA9IChjaGFyKWluZGV4OworCQlkaXNhYmxlX01BQyhhaSwgbG9jayk7CisJfQorCisJcmMgPSB3cml0ZVdlcEtleVJpZChhaSwgJndrciwgcGVybSwgbG9jayk7CisKKwlpZiAocGVybSkKKwkJZW5hYmxlX01BQyhhaSwgbG9jayk7CisJcmV0dXJuIHJjOworfQorCitzdGF0aWMgdm9pZCBwcm9jX3dlcGtleV9vbl9jbG9zZSggc3RydWN0IGlub2RlICppbm9kZSwgc3RydWN0IGZpbGUgKmZpbGUgKSB7CisJc3RydWN0IHByb2NfZGF0YSAqZGF0YTsKKwlzdHJ1Y3QgbmV0X2RldmljZSAqZGV2ID0gUERFX0RBVEEoaW5vZGUpOworCXN0cnVjdCBhaXJvX2luZm8gKmFpID0gZGV2LT5tbF9wcml2OworCWludCBpLCByYzsKKwljaGFyIGtleVsxNl07CisJdTE2IGluZGV4ID0gMDsKKwlpbnQgaiA9IDA7CisKKwltZW1zZXQoa2V5LCAwLCBzaXplb2Yoa2V5KSk7CisKKwlkYXRhID0gZmlsZS0+cHJpdmF0ZV9kYXRhOworCWlmICggIWRhdGEtPndyaXRlbGVuICkgcmV0dXJuOworCisJaWYgKGRhdGEtPndidWZmZXJbMF0gPj0gJzAnICYmIGRhdGEtPndidWZmZXJbMF0gPD0gJzMnICYmCisJICAgIChkYXRhLT53YnVmZmVyWzFdID09ICcgJyB8fCBkYXRhLT53YnVmZmVyWzFdID09ICdcbicpKSB7CisJCWluZGV4ID0gZGF0YS0+d2J1ZmZlclswXSAtICcwJzsKKwkJaWYgKGRhdGEtPndidWZmZXJbMV0gPT0gJ1xuJykgeworCQkJcmMgPSBzZXRfd2VwX3R4X2lkeChhaSwgaW5kZXgsIDEsIDEpOworCQkJaWYgKHJjIDwgMCkgeworCQkJCWFpcm9fcHJpbnRfZXJyKGFpLT5kZXYtPm5hbWUsICJmYWlsZWQgdG8gc2V0ICIKKwkJCQkgICAgICAgICAgICAgICAiV0VQIHRyYW5zbWl0IGluZGV4IHRvICVkOiAlZC4iLAorCQkJCSAgICAgICAgICAgICAgIGluZGV4LCByYyk7CisJCQl9CisJCQlyZXR1cm47CisJCX0KKwkJaiA9IDI7CisJfSBlbHNlIHsKKwkJYWlyb19wcmludF9lcnIoYWktPmRldi0+bmFtZSwgIldlcEtleSBwYXNzZWQgaW52YWxpZCBrZXkgaW5kZXgiKTsKKwkJcmV0dXJuOworCX0KKworCWZvciggaSA9IDA7IGkgPCAxNiozICYmIGRhdGEtPndidWZmZXJbaStqXTsgaSsrICkgeworCQlzd2l0Y2goaSUzKSB7CisJCWNhc2UgMDoKKwkJCWtleVtpLzNdID0gaGV4X3RvX2JpbihkYXRhLT53YnVmZmVyW2kral0pPDw0OworCQkJYnJlYWs7CisJCWNhc2UgMToKKwkJCWtleVtpLzNdIHw9IGhleF90b19iaW4oZGF0YS0+d2J1ZmZlcltpK2pdKTsKKwkJCWJyZWFrOworCQl9CisJfQorCisJcmMgPSBzZXRfd2VwX2tleShhaSwga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Bpb2J1Zixjb21wLT5sZW4sMSkpIHsKKwkJa2ZyZWUgKGlvYnVmKTsKKwkJcmV0dXJuIC1FSU87CisJfQorCWtmcmVlIChpb2J1Zik7CisJcmV0dXJuIDA7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogQW5jaWxsYXJ5IGZsYXNoIC8gbW9kIGZ1bmN0aW9ucyBtdWNoIGJsYWNrIG1hZ2ljIGx1cmtlcyBoZXJlICAgICAgICAgICAgICAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqLworCisvKgorICogRmxhc2ggY29tbWFuZCBzd2l0Y2ggdGFibGUKKyAqLworCitzdGF0aWMgaW50IGZsYXNoY2FyZChzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LCBhaXJvbmV0X2lvY3RsICpjb21wKSB7CisJaW50IHo7CisKKwkvKiBPbmx5IHN1cGVyLXVzZXIgY2FuIG1vZGlmeSBmbGFzaCAqLworCWlmICghY2FwYWJsZShDQVBfTkVUX0FETUlOKSkKKwkJcmV0dXJuIC1FUEVSTTsKKworCXN3aXRjaChjb21wLT5jb21tYW5kKQorCXsKKwljYXNlIEFJUk9GTFNIUlNUOgorCQlyZXR1cm4gY21kcmVzZXQoKHN0cnVjdCBhaXJvX2luZm8gKilkZXYtPm1sX3ByaXYpOworCisJY2FzZSBBSVJPRkxTSFNURkw6CisJCWlmICghQUlST19GTEFTSChkZXYpICYmCisJCSAgICAoQUlST19GTEFTSChkZXYpID0ga21hbGxvYyhGTEFTSFNJWkUsIEdGUF9LRVJORUwpKSA9PSBOVUxMKQorCQkJcmV0dXJuIC1FTk9NRU07CisJCXJldHVybiBzZXRmbGFzaG1vZGUoKHN0cnVjdCBhaXJvX2luZm8gKilkZXYtPm1sX3ByaXYpOworCisJY2FzZSBB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19JTkZPKCJ3cm9uZyB0YWJsZVxuIik7CisJaWYgKElTX09SRElOQUxfVEFCTEVfVFdPKG9yZGluYWxzLCBvcmQpKQorCQlyZXR1cm4gLUVJTlZBTDsKKworCXJldHVybiAtRUlOVkFMOworfQorCitzdGF0aWMgY2hhciAqc25wcmludF9saW5lKGNoYXIgKmJ1Ziwgc2l6ZV90IGNvdW50LAorCQkJICBjb25zdCB1OCAqIGRhdGEsIHUzMiBsZW4sIHUzMiBvZnMpCit7CisJaW50IG91dCwgaSwgaiwgbDsKKwljaGFyIGM7CisKKwlvdXQgPSBzbnByaW50ZihidWYsIGNvdW50LCAiJTA4WCIsIG9mcyk7CisKKwlmb3IgKGwgPSAwLCBpID0gMDsgaSA8IDI7IGkrKykgeworCQlvdXQgKz0gc25wcmludGYoYnVmICsgb3V0LCBjb3VudCAtIG91dCwgIiAiKTsKKwkJZm9yIChqID0gMDsgaiA8IDggJiYgbCA8IGxlbjsgaisrLCBsKyspCisJCQlvdXQgKz0gc25wcmludGYoYnVmICsgb3V0LCBjb3VudCAtIG91dCwgIiUwMlggIiwKKwkJCQkJZGF0YVsoaSAqIDggKyBqKV0pOworCQlmb3IgKDsgaiA8IDg7IGorKykKKwkJCW91dCArPSBzbnByaW50ZihidWYgKyBvdXQsIGNvdW50IC0gb3V0LCAiICAgIik7CisJfQorCisJb3V0ICs9IHNucHJpbnRmKGJ1ZiArIG91dCwgY291bnQgLSBvdXQsICIgIik7CisJZm9yIChsID0gMCwgaSA9IDA7IGkgPCAyOyBpKyspIHsKKwkJb3V0ICs9IHNucHJpbnRmKGJ1ZiArIG91dCwgY291bnQgLSBvdXQsICIgIik7CisJCWZvciAoaiA9IDA7IGogPCA4ICYmIGwgPCBsZW47IGorKywgbCsrKSB7CisJCQljID0gZGF0YVsoaSAqIDggKyBqKV07CisJCQlpZiAoIWlzYXNjaWkoYykgfHwgIWlzcHJpbnQoYykpCisJCQkJYyA9ICcuJzsKKworCQkJb3V0ICs9IHNucHJpbnRmK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sIGFzc2VydHMgY2xvY2sgaW5pdGlhbGl6YXRpb24KKyAgICAgICAgICAgICAgICAgICAgYW5kIHdhaXRzIGZvciBjbG9jayBzdGFiaWxpemF0aW9uCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgaW50IHN3X3Jlc2V0X2FuZF9jbG9jayhzdHJ1Y3QgaXB3MjEwMF9wcml2ICpwcml2KQoreworCWludCBpOworCXUzMiByOworCisJLy8gYXNzZXJ0IHMvdyByZXNldAorCXdyaXRlX3JlZ2lzdGVyKHByaXYtPm5ldF9kZXYsIElQV19SRUdfUkVTRVRfUkVHLAorCQkgICAgICAgSVBXX0FVWF9IT1NUX1JFU0VUX1JFR19TV19SRVNFVCk7CisKKwkvLyB3YWl0IGZvciBjbG9jayBzdGFiaWxpemF0aW9uCisJZm9yIChpID0gMDsgaSA8IDEwMDA7IGkrKykgeworCQl1ZGVsYXkoSVBXX1dBSVRfUkVTRVRfQVJDX0NPTVBMRVRFX0RFTEFZKTsKKworCQkvLyBjaGVjayBjbG9jayByZWFkeSBiaXQKKwkJcmVhZF9yZWdpc3Rlcihwcml2LT5uZXRfZGV2LCBJUFdfUkVHX1JFU0VUX1JFRywgJnIpOworCQlpZiAociAmIElQV19BVVhfSE9TVF9SRVNFVF9SRUdfUFJJTkNFVE9OX1JFU0VUKQorCQkJYnJlYWs7CisJfQorCisJaWYgKGkgPT0gMTAwMCkKKwkJcmV0dXJuIC1FSU87CS8vIFRPRE86IGJldHRlciBlcnJvciB2YWx1ZQorCisJLyogc2V0ICJpbml0aWFsaXphdGlvbiBjb21wbGV0ZSIgYml0IHRvIG1vdmUgYWRhcHRlciB0bworCSAqIEQwIHN0YXRlICovCisJd3JpdGVfcmVnaXN0ZXIocHJpdi0+bmV0X2RldiwgSVBXX1JFR19HUF9DTlRSTCwKKwkJICAgICAgIElQV19BVVhfSE9TVF9HUF9DTlRSTF9CSVRfSU5JVF9ET05FKTsKKworCS8qIHdhaXQgZm9yIGNsb2NrIHN0YWJpbGl6YXRpb24gKi8KKwlmb3IgKGkgPSAwOyBpIDwgMTAwMDA7IGkrKykgeworCQl1ZGVsYXkoSVBXX1dBSVRfQ0xPQ0tfU1RBQklMSVpBVElPTl9ERUxBWSAqIDQpOworCisJCS8qIGNoZWNrIGNsb2NrIHJlYWR5IGJpdCAqLworCQlyZWFkX3JlZ2lzdGVyKHByaXYtPm5ldF9kZXYsIElQV19SRUdfR1BfQ05UUkwsICZyKTsKKwkJaWYgKHIgJiBJUFdfQVVYX0hPU1RfR1BfQ05UUkxfQklUX0NMT0NLX1JFQURZKQorCQkJYnJlYWs7CisJfQorCisJaWYgKGkgPT0gMTAwMDApCisJCXJldHVybiAtRUlPOwkvKiBUT0RPOiBiZXR0ZXIgZXJyb3IgdmFsdWUgKi8KKworCS8qIHNldCBEMCBzdGFuZGJ5IGJpdCAqLworCXJlYWRfcmVnaXN0ZXIocHJpdi0+bmV0X2RldiwgSVBXX1JFR19HUF9DTlRSTCwgJnIpOworCXdyaXRlX3JlZ2lzdGVyKHByaXYtPm5ldF9kZXYsIElQV19SRUdfR1BfQ05UUkwsCisJCSAgICAgICByIHwgSVBXX0FVWF9IT1NUX0dQX0NOVFJMX0JJVF9IT1NUX0FMTE9XU19TVEFOREJZKTsKKworCXJldHVybiAwOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgUHJvY2VkdXJlICAgOiAgIGlwdzIxMDBfZG93bmxvYWRfZmlybXdhcmUKKyAgICBQdXJwb3NlICAgICA6ICAgSW5pdGlhemUgYWRhcHRlciBhZnRlciBwb3dlciBvbi4KKyAgICAgICAgICAgICAgICAgICAgVGhlIHNlcXVlbmNlIGlzOgorICAgICAgICAgICAgICAgICAgICAxLiBhc3NlcnQgcy93IHJlc2V0IGZpcnN0IQorICAgICAgICAgICAgICAgICAgICAyLiBhd2FrZSBjbG9ja3MgJiB3YWl0IGZvciBjbG9jayBzdGFiaWxpemF0aW9uCisgICAgICAgICAgICAgICAgICAgIDMuIGhvbGQgQVJDIChkb24ndCBhc2sgbWUgd2h5Li4uKQorICAgICAgICAgICAgICAgICAgICA0LiBsb2FkIERpbm8gdWNvZGUgYW5kIHJlc2V0L2Nsb2NrIGluaXQgYWdhaW4KKyAgICAgICAgICAgICAgICAgICAgNS4gemVyby1vdXQgc2hhcmVkIG1lbQorICAgICAgICAgICAgICAgICAgICA2LiBkb3dubG9hZCBmL3cKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RhdGljIGludCBpcHcyMTAwX2Rvd25sb2FkX2Zpcm13YXJlKHN0cnVjdCBpcHcyMTAwX3ByaXYgKnByaXYpCit7CisJdTMyIGFkZHJlc3M7CisJaW50IGVycjsKKworI2lmbmRlZiBDT05GSUdfUE0KKwkvKiBGZXRjaCB0aGUgZmlybXdhcmUgYW5kIG1pY3JvY29kZSAqLworCXN0cnVjdCBpcHcyMTAwX2Z3IGlwdzIxMDBfZmlybXdhcmU7CisjZW5kaWYKKworCWlmIChwcml2LT5mYXRhbF9lcnJvcikgeworCQlJUFdfREVCVUdfRVJST1IoIiVzOiBpcHcyMTAwX2Rvd25sb2FkX2Zpcm13YXJlIGNhbGxlZCBhZnRlciAiCisJCQkJImZhdGFsIGVycm9yICVkLiAgSW50ZXJmYWNlIG11c3QgYmUgYnJvdWdodCBkb3duLlxuIiwKKwkJCQlwcml2LT5uZXRfZGV2LT5uYW1lLCBwcml2LT5mYXRhbF9lcnJvcik7CisJCXJldHVybiAtRUlOVkFMOworCX0KKyNpZmRlZiBDT05GSUdfUE0KKwlpZiAoIWlwdzIxMDBfZmlybXdhcmUudmVyc2lvbikgeworCQllcnIgPSBpcHcyMTAwX2dldF9maXJtd2FyZShwcml2LCAmaXB3MjEwMF9maXJtd2FyZSk7C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AocHJpdi0+c25hcHNob3RbMF0pCisJCQlmb3IgKGkgPSAwOyBpIDwgNDsgaSsrKQorCQkJCWJ1ZmZlcltpXSA9CisJCQkJICAgICoodTMyICopIFNOQVBTSE9UX0FERFIobG9vcCArIGkgKiA0KTsKKwkJZWxzZQorCQkJZm9yIChpID0gMDsgaSA8IDQ7IGkrKykKKwkJCQlyZWFkX25pY19kd29yZChkZXYsIGxvb3AgKyBpICogNCwgJmJ1ZmZlcltpXSk7CisKKwkJaWYgKHByaXYtPmR1bXBfcmF3KQorCQkJbGVuICs9IHNwcmludGYoYnVmICsgbGVuLAorCQkJCSAgICAgICAiJWMlYyVjJWMiCisJCQkJICAgICAgICIlYyVjJWMlYyIKKwkJCQkgICAgICAgIiVjJWMlYyVjIgorCQkJCSAgICAgICAiJWMlYyVjJWMiLAorCQkJCSAgICAgICAoKHU4ICopIGJ1ZmZlcilbMHgwXSwKKwkJCQkgICAgICAgKCh1OCAqKSBidWZmZXIpWzB4MV0sCisJCQkJICAgICAgICgodTggKikgYnVmZmVyKVsweDJdLAorCQkJCSAgICAgICAoKHU4ICopIGJ1ZmZlcilbMHgzXSwKKwkJCQkgICAgICAgKCh1OCAqKSBidWZmZXIpWzB4NF0sCisJCQkJICAgICAgICgodTggKikgYnVmZmVyKVsweDVdLAorCQkJCSAgICAgICAoKHU4ICopIGJ1ZmZlcilbMHg2XSwKKwkJCQkgICAgICAgKCh1OCAqKSBidWZmZXIpWzB4N10sCisJCQkJICAgICAgICgodTggKikgYnVmZmVyKVsweDhdLAorCQkJCSAgICAgICAoKHU4ICopIGJ1ZmZlcilbMHg5XSwKKwkJCQkgICAgICAgKCh1OCAqKSBidWZmZXIpWzB4YV0sCisJCQkJICAgICAgICgodTggKikgYnVmZmVyKVsweGJdLAorCQkJCSAgICAgICAoKHU4ICopIGJ1ZmZlcilbMHhjXSwKKwkJCQkgICAgICAgKCh1OCAqKSBidWZmZXIpWzB4ZF0sCisJCQkJICAgICAgICgodTggKikgYnVmZmV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ZG1hX2FkZHIsCisJCQkJCSBzaXplb2Yoc3RydWN0IGlwdzIxMDBfcngpLAorCQkJCQkgUENJX0RNQV9GUk9NREVWSUNFKTsKKwkJCWRldl9rZnJlZV9za2IocHJpdi0+cnhfYnVmZmVyc1tpXS5za2IpOworCQl9CisJfQorCisJa2ZyZWUocHJpdi0+cnhfYnVmZmVycyk7CisJcHJpdi0+cnhfYnVmZmVycyA9IE5VTEw7CisKKwlJUFdfREVCVUdfSU5GTygiZXhpdFxuIik7Cit9CisKK3N0YXRpYyBpbnQgaXB3MjEwMF9yZWFkX21hY19hZGRyZXNzKHN0cnVjdCBpcHcyMTAwX3ByaXYgKnByaXYpCit7CisJdTMyIGxlbmd0aCA9IEVUSF9BTEVOOworCXU4IGFkZHJbRVRIX0FMRU5dOworCisJaW50IGVycjsKKworCWVyciA9IGlwdzIxMDBfZ2V0X29yZGluYWwocHJpdiwgSVBXX09SRF9TVEFUX0FEQVBURVJfTUFDLCBhZGRyLCAmbGVuZ3RoKTsKKwlpZiAoZXJyKSB7CisJCUlQV19ERUJVR19JTkZPKCJNQUMgYWRkcmVzcyByZWFkIGZhaWxlZFxuIik7CisJCXJldHVybiAtRUlPOworCX0KKworCW1lbWNweShwcml2LT5uZXRfZGV2LT5kZXZfYWRkciwgYWRkciwgRVRIX0FMRU4pOworCUlQV19ERUJVR19JTkZPKCJjYXJkIE1BQyBpcyAlcE1cbiIsIHByaXYtPm5ldF9kZXYtPmRldl9hZGRyKTsKKworCXJldHVybiAwOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBGaXJtd2FyZSBDb21tYW5kcworICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworc3RhdGljIGludCBpcHcyMTAwX3NldF9tYWNfYWRkcmVzcyhzdHJ1Y3QgaXB3MjEwMF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1cm4gLUVJTzsKKworCWVyciA9IGlwdzIxMDBfc2V0X21hY19hZGRyZXNzKHByaXYsIGJhdGNoX21vZGUpOworCWlmIChlcnIpCisJCXJldHVybiBlcnI7CisKKwllcnIgPSBpcHcyMTAwX3NldF9wb3J0X3R5cGUocHJpdiwgcHJpdi0+aWVlZS0+aXdfbW9kZSwgYmF0Y2hfbW9kZSk7CisJaWYgKGVycikKKwkJcmV0dXJuIGVycjsKKworCWlmIChwcml2LT5pZWVlLT5pd19tb2RlID09IElXX01PREVfQURIT0MpIHsKKwkJZXJyID0gaXB3MjEwMF9zZXRfY2hhbm5lbChwcml2LCBwcml2LT5jaGFubmVsLCBiYXRjaF9tb2RlKTsKKwkJaWYgKGVycikKKwkJCXJldHVybiBlcnI7CisJfQorCisJZXJyID0gaXB3MjEwMF9zeXN0ZW1fY29uZmlnKHByaXYsIGJhdGNoX21vZGUpOworCWlmIChlcnIpCisJCXJldHVybiBlcnI7CisKKwllcnIgPSBpcHcyMTAwX3NldF90eF9yYXRlcyhwcml2LCBwcml2LT50eF9yYXRlcywgYmF0Y2hfbW9kZSk7CisJaWYgKGVycikKKwkJcmV0dXJuIGVycjsKKworCS8qIERlZmF1bHQgdG8gcG93ZXIgbW9kZSBPRkYgKi8KKwllcnIgPSBpcHcyMTAwX3NldF9wb3dlcl9tb2RlKHByaXYsIElQV19QT1dFUl9NT0RFX0NBTSk7CisJaWYgKGVycikKKwkJcmV0dXJuIGVycjsKKworCWVyciA9IGlwdzIxMDBfc2V0X3J0c190aHJlc2hvbGQocHJpdiwgcHJpdi0+cnRzX3RocmVzaG9sZCk7CisJaWYgKGVycikKKwkJcmV0dXJuIGVycjsKKworCWlmIChwcml2LT5jb25maWcgJiBDRkdfU1RBVElDX0JTU0lEKQorCQlic3NpZCA9IHByaXYtPmJzc2lkOworCWVsc2UKKwkJYnNzaWQgPSBOVUxMOworCWVyciA9IGlwdzIxMDBfc2V0X21hbmRhdG9yeV9ic3NpZChwcml2LCBic3NpZCwgYmF0Y2hfbW9kZSk7CisJaWYgKGVycikKKwkJcmV0dXJuIGVycjsKKworCWlmIChwcml2LT5jb25maWcgJiBDRkdfU1RBVElDX0VTU0lEKQorCQllcnIgPSBpcHcyMTAwX3NldF9lc3NpZChwcml2LCBwcml2LT5lc3NpZCwgcHJpdi0+ZXNzaWRfbGVuLAorCQkJCQliYXRjaF9tb2RlKTsKKwllbHNlCisJCWVyciA9IGlwdzIxMDBfc2V0X2Vzc2lkKHByaXYsIE5VTEwsIDAsIGJhdGNoX21vZGUpOworCWlmIChlcnIpCisJCXJldHVybiBlcnI7CisKKwllcnIgPSBpcHcyMTAwX2NvbmZpZ3VyZV9zZWN1cml0eShwcml2LCBiYXRjaF9tb2RlKTsKKwlpZiAoZXJyKQorCQlyZXR1cm4gZXJyOworCisJaWYgKHByaXYtPmllZWUtPml3X21vZGUgPT0gSVdfTU9ERV9BREhPQykgeworCQllcnIgPQorCQkgICAgaXB3MjEwMF9zZXRfaWJzc19iZWFjb25faW50ZXJ2YWwocHJpdiwKKwkJCQkJCSAgICAgcHJpdi0+YmVhY29uX2ludGVydmFsLAorCQkJCQkJICAgICBiYXRjaF9tb2RlKTsKKwkJaWYgKGVycikKKwkJCXJldHVybiBlcnI7CisKKwkJZXJyID0gaXB3MjEwMF9zZXRfdHhfcG93ZXIocHJpdiwgcHJpdi0+dHhfcG93ZXIpOworCQlpZiAoZXJyKQorCQkJcmV0dXJuIGVycjsKKwl9CisKKwkvKgorCSAgIGVyciA9IGlwdzIxMDBfc2V0X2ZyYWdtZW50YXRpb25fdGhyZXNob2xkKAorCSAgIHByaXYsIHByaXYtPmZyYWdfdGhyZXNob2xkLCBiYXRjaF9tb2RlKTsKKwkgICBpZiAoZXJyKQorCSAgIHJldHVybiBlcnI7CisJICovCisKKwlJUFdfREVCVUdfSU5GTygiZXhpdFxuIik7CisKKwlyZXR1cm4gMDsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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TE9OR19QUkVBTUJMRTsKKwllbHNlIHsKKwkJZXJyID0gLUVJTlZBTDsKKwkJZ290byBkb25lOworCX0KKworCWVyciA9IGlwdzIxMDBfc3lzdGVtX2NvbmZpZyhwcml2LCAwKTsKKworICAgICAgZG9uZToKKwltdXRleF91bmxvY2soJnByaXYtPmFjdGlvbl9tdXRleCk7CisJcmV0dXJuIGVycjsKK30KKworc3RhdGljIGludCBpcHcyMTAwX3d4X2dldF9wcmVhbWJsZShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorCQkJCSAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisJCQkJICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisJLyoKKwkgKiBUaGlzIGNhbiBiZSBjYWxsZWQgYXQgYW55IHRpbWUuICBObyBhY3Rpb24gbG9jayByZXF1aXJlZAorCSAqLworCisJc3RydWN0IGlwdzIxMDBfcHJpdiAqcHJpdiA9IGxpYmlwd19wcml2KGRldik7CisKKwlpZiAocHJpdi0+Y29uZmlnICYgQ0ZHX0xPTkdfUFJFQU1CTEUpCisJCXNucHJpbnRmKHdycXUtPm5hbWUsIElGTkFNU0laLCAibG9uZyAoMSkiKTsKKwllbHNlCisJCXNucHJpbnRmKHdycXUtPm5hbWUsIElGTkFNU0laLCAiYXV0byAoMCkiKTsKKworCXJldHVybiAwOworfQorCisjaWZkZWYgQ09ORklHX0lQVzIxMDBfTU9OSVRPUgorc3RhdGljIGludCBpcHcyMTAwX3d4X3NldF9jcmNfY2hlY2soc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKwkJCQkgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKwkJCQkgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisJc3RydWN0IGlwdzIxMDBfcHJpdiAqcHJpdiA9IGxpYmlwd19wcml2KGRldik7CisJaW50IGVyciwgbW9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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIG1vZHVsZSBib2lsZXIgcGxhdGUKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKgorICogbW9kdWxlIG5hbWUsIGNvcHlyaWdodCwgdmVyc2lvbiwgZXRjLgorICovCisjZGVmaW5lIERSVl9ERVNDUklQVElPTgkiSW50ZWwoUikgV2lyZWxlc3MgV2lGaSA0OTY1IGRyaXZlciBmb3IgTGludXgiCisKKyNpZmRlZiBDT05GSUdfSVdMRUdBQ1lfREVCVUcKKyNkZWZpbmUgVkQgImQiCisjZWxzZQorI2RlZmluZSBWRAorI2VuZGlmCisKKyNkZWZpbmUgRFJWX1ZFUlNJT04gICAgIElXTFdJRklfVkVSU0lPTiBWRAorCitNT0RVTEVfREVTQ1JJUFRJT04oRFJWX0RFU0NSSVBUSU9OKTsKK01PRFVMRV9WRVJTSU9OKERSVl9WRVJTSU9OKTsKK01PRFVMRV9BVVRIT1IoRFJWX0NPUFlSSUdIVCAiICIgRFJWX0FVVEhPUik7CitNT0RVTEVfTElDRU5TRSgiR1BMIik7CitNT0RVTEVfQUxJQVMoIml3bDQ5NjUiKTsKKwordm9pZAoraWw0OTY1X2NoZWNrX2Fib3J0X3N0YXR1cyhzdHJ1Y3QgaWxfcHJpdiAqaWwsIHU4IGZyYW1lX2NvdW50LCB1MzIgc3RhdHVzKQoreworCWlmIChmcmFtZV9jb3VudCA9PSAxICYmIHN0YXR1cyA9PSBUWF9TVEFUVVNfRkFJTF9SRktJTExfRkxVU0gpIHsKKwkJSUxfRVJSKCJUeCBmbHVzaCBjb21tYW5kIHRvIGZsdXNoIG91dCBhbGwgZnJhbWVzXG4iKTsKKwkJaWYgKCF0ZXN0X2JpdChTX0VYSVRfUEVORElORywgJmlsLT5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IHF1ZXVlLCBhbmQgZW5hYmxlIHRoZSBETUEgY2hhbm5lbCB1c2VkIGZvciB0aGF0IHF1ZXVlLgorICoKKyAqIDQ5NjUgc3VwcG9ydHMgdXAgdG8gMTYgVHggcXVldWVzIGluIERSQU0sIG1hcHBlZCB0byB1cCB0byA4IFR4IERNQQorICogY2hhbm5lbHMgc3VwcG9ydGVkIGluIGhhcmR3YXJlLgorICovCitpbnQKK2lsNDk2NV9od190eF9xdWV1ZV9pbml0KHN0cnVjdCBpbF9wcml2ICppbCwgc3RydWN0IGlsX3R4X3F1ZXVlICp0eHEpCit7CisJaW50IHR4cV9pZCA9IHR4cS0+cS5pZDsKKworCS8qIENpcmN1bGFyIGJ1ZmZlciAoVEZEIHF1ZXVlIGluIERSQU0pIHBoeXNpY2FsIGJhc2UgYWRkcmVzcyAqLworCWlsX3dyKGlsLCBGSDQ5X01FTV9DQkJDX1FVRVVFKHR4cV9pZCksIHR4cS0+cS5kbWFfYWRkciA+PiA4KTsKKworCXJldHVybiAwOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogR2VuZXJpYyBSWCBoYW5kbGVyIGltcGxlbWVudGF0aW9ucworICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgdm9pZAoraWw0OTY1X2hkbF9hbGl2ZShzdHJ1Y3QgaWxfcHJpdiAqaWwsIHN0cnVjdCBpbF9yeF9idWYgKnJ4YikKK3sKKwlzdHJ1Y3QgaWxfcnhfcGt0ICpwa3QgPSByeGJfYWRkcihyeGIpOworCXN0cnVjdCBpbF9hbGl2ZV9yZXNwICpwYWxpdmU7CisJc3RydWN0IGRlbGF5ZWRfd29yayAqcHdvcms7CisKKwlwYWxpdmUgPSAmcGt0LT51LmFsaXZlX2ZyYW1lO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ZSBwZW5kaW5nXG4iLAorCQkJaW50YSAmIH5pbC0+aW50YV9tYXNrKTsKKwkJSUxfV0FSTigiICAgd2l0aCBGSDQ5X0lOVCA9IDB4JTA4eFxuIiwgaW50YV9maCk7CisJfQorCisJLyogUmUtZW5hYmxlIGFsbCBpbnRlcnJ1cHRzICovCisJLyogb25seSBSZS1lbmFibGUgaWYgZGlzYWJsZWQgYnkgaXJxICovCisJaWYgKHRlc3RfYml0KFNfSU5UX0VOQUJMRUQsICZpbC0+c3RhdHVzKSkKKwkJaWxfZW5hYmxlX2ludGVycnVwdHMoaWwpOworCS8qIFJlLWVuYWJsZSBSRl9LSUxMIGlmIGl0IG9jY3VycmVkICovCisJZWxzZSBpZiAoaGFuZGxlZCAmIENTUl9JTlRfQklUX1JGX0tJTEwpCisJCWlsX2VuYWJsZV9yZmtpbGxfaW50KGlsKTsKKworI2lmZGVmIENPTkZJR19JV0xFR0FDWV9ERUJVRworCWlmIChpbF9nZXRfZGVidWdfbGV2ZWwoaWwpICYgKElMX0RMX0lTUikpIHsKKwkJaW50YSA9IF9pbF9yZChpbCwgQ1NSX0lOVCk7CisJCWludGFfbWFzayA9IF9pbF9yZChpbCwgQ1NSX0lOVF9NQVNLKTsKKwkJaW50YV9maCA9IF9pbF9yZChpbCwgQ1NSX0ZIX0lOVF9TVEFUVVMpOworCQlEX0lTUigiRW5kIGludGEgMHglMDh4LCBlbmFibGVkIDB4JTA4eCwgZmggMHglMDh4LCAiCisJCSAgICAgICJmbGFncyAweCUwOGx4XG4iLCBpbnRhLCBpbnRhX21hc2ssIGludGFfZmgsIGZsYWdzKTsKKwl9CisjZW5kaWYKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogc3lzZnMgYXR0cmlidXRlcworICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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KiBsb2FkIGJvb3RzdHJhcCBzdGF0ZSBtYWNoaW5lLAorCQkgKiBsb2FkIGJvb3RzdHJhcCBwcm9ncmFtIGludG8gcHJvY2Vzc29yJ3MgbWVtb3J5LAorCQkgKiBwcmVwYXJlIHRvIGxvYWQgdGhlICJpbml0aWFsaXplIiB1Q29kZSAqLworCQlyZXQgPSBpbC0+b3BzLT5sb2FkX3Vjb2RlKGlsKTsKKworCQlpZiAocmV0KSB7CisJCQlJTF9FUlIoIlVuYWJsZSB0byBzZXQgdXAgYm9vdHN0cmFwIHVDb2RlOiAlZFxuIiwgcmV0KTsKKwkJCWNvbnRpbnVlOworCQl9CisKKwkJLyogc3RhcnQgY2FyZDsgImluaXRpYWxpemUiIHdpbGwgbG9hZCBydW50aW1lIHVjb2RlICovCisJCWlsNDk2NV9uaWNfc3RhcnQoaWwpOworCisJCURfSU5GTyhEUlZfTkFNRSAiIGlzIGNvbWluZyB1cFxuIik7CisKKwkJcmV0dXJuIDA7CisJfQorCisJc2V0X2JpdChTX0VYSVRfUEVORElORywgJmlsLT5zdGF0dXMpOworCV9faWw0OTY1X2Rvd24oaWwpOworCWNsZWFyX2JpdChTX0VYSVRfUEVORElORywgJmlsLT5zdGF0dXMpOworCisJLyogdHJpZWQgdG8gcmVzdGFydCBhbmQgY29uZmlnIHRoZSBkZXZpY2UgZm9yIGFzIGxvbmcgYXMgb3VyCisJICogcGF0aWVuY2UgY291bGQgd2l0aHN0YW5kICovCisJSUxfRVJSKCJVbmFibGUgdG8gaW5pdGlhbGl6ZSBkZXZpY2UgYWZ0ZXIgJWQgYXR0ZW1wdHMuXG4iLCBpKTsKKwlyZXR1cm4gLUVJTzsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogV29ya3F1ZXVlIGNhbGxiYWNrcworICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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2JpdChTX0VYSVRfUEVORElORywgJmlsLT5zdGF0dXMpKSB7CisJCQltdXRleF91bmxvY2soJmlsLT5tdXRleCk7CisJCQlyZXR1cm47CisJCX0KKworCQlfX2lsNDk2NV91cChpbCk7CisJCW11dGV4X3VubG9jaygmaWwtPm11dGV4KTsKKwl9Cit9CisKK3N0YXRpYyB2b2lkCitpbDQ5NjVfYmdfcnhfcmVwbGVuaXNoKHN0cnVjdCB3b3JrX3N0cnVjdCAqZGF0YSkKK3sKKwlzdHJ1Y3QgaWxfcHJpdiAqaWwgPSBjb250YWluZXJfb2YoZGF0YSwgc3RydWN0IGlsX3ByaXYsIHJ4X3JlcGxlbmlzaCk7CisKKwlpZiAodGVzdF9iaXQoU19FWElUX1BFTkRJTkcsICZpbC0+c3RhdHVzKSkKKwkJcmV0dXJuOworCisJbXV0ZXhfbG9jaygmaWwtPm11dGV4KTsKKwlpbDQ5NjVfcnhfcmVwbGVuaXNoKGlsKTsKKwltdXRleF91bmxvY2soJmlsLT5tdXRleCk7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIG1hYzgwMjExIGVudHJ5IHBvaW50IGZ1bmN0aW9ucworICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI2RlZmluZSBVQ09ERV9SRUFEWV9USU1FT1VUCSg0ICogSFopCisKKy8qCisgKiBOb3QgYSBtYWM4MDIxMSBlbnRyeSBwb2ludCBmdW5jdGlvbiwgYnV0IGl0IGZpdHMgaW4gd2l0aCBhbGwgdGhlCisgKiBvdGhlciBtYWM4MDIxMSBmdW5jdGlvbnMgZ3JvdXBlZCBoZXJlLgorICovCitzdGF0aWMgaW50CitpbDQ5NjVfbWFjX3NldHVwX3JlZ2lzdGVyKHN0cnVjdCBpbF9wcml2ICppb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KCF0ZXN0X2JpdChTX1JFQURZLCAmaWwtPnN0YXR1cykpIHsKKwkJCUlMX0VSUigiU1RBUlRfQUxJVkUgdGltZW91dCBhZnRlciAlZG1zLlxuIiwKKwkJCQlqaWZmaWVzX3RvX21zZWNzKFVDT0RFX1JFQURZX1RJTUVPVVQpKTsKKwkJCXJldHVybiAtRVRJTUVET1VUOworCQl9CisJfQorCisJaWw0OTY1X2xlZF9lbmFibGUoaWwpOworCitvdXQ6CisJaWwtPmlzX29wZW4gPSAxOworCURfTUFDODAyMTEoImxlYXZlXG4iKTsKKwlyZXR1cm4gMDsKK30KKwordm9pZAoraWw0OTY1X21hY19zdG9wKHN0cnVjdCBpZWVlODAyMTFfaHcgKmh3KQoreworCXN0cnVjdCBpbF9wcml2ICppbCA9IGh3LT5wcml2OworCisJRF9NQUM4MDIxMSgiZW50ZXJcbiIpOworCisJaWYgKCFpbC0+aXNfb3BlbikKKwkJcmV0dXJuOworCisJaWwtPmlzX29wZW4gPSAwOworCisJaWw0OTY1X2Rvd24oaWwpOworCisJZmx1c2hfd29ya3F1ZXVlKGlsLT53b3JrcXVldWUpOworCisJLyogVXNlciBzcGFjZSBzb2Z0d2FyZSBtYXkgZXhwZWN0IGdldHRpbmcgcmZraWxsIGNoYW5nZXMKKwkgKiBldmVuIGlmIGludGVyZmFjZSBpcyBkb3duICovCisJX2lsX3dyKGlsLCBDU1JfSU5ULCAweEZGRkZGRkZGKTsKKwlpbF9lbmFibGVfcmZraWxsX2ludChpbCk7CisKKwlEX01BQzgwMjExKCJsZWF2ZVxuIik7Cit9CisKK3ZvaWQKK2lsNDk2NV9tYWNfdHgoc3RydWN0IGllZWU4MDIxMV9odyAqaHcsCisJICAgICAgc3RydWN0IGllZWU4MDIxMV90eF9jb250cm9sICpjb250cm9sLAorCSAgICAgIHN0cnVjdCBza19idWZmICpza2IpCit7CisJc3RydWN0IGlsX3ByaXYgKmlsID0gaHctPnByaXY7CisKKwlEX01BQ0RVTVAoImVudGVyXG4iK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zICY9CisJICAgIEZJRl9PVEhFUl9CU1MgfCBGSUZfQUxMTVVMVEkgfAorCSAgICBGSUZfQkNOX1BSQlJFU1BfUFJPTUlTQyB8IEZJRl9DT05UUk9MOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBkcml2ZXIgc2V0dXAgYW5kIHRlYXJkb3duCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgdm9pZAoraWw0OTY1X2JnX3R4cG93ZXJfd29yayhzdHJ1Y3Qgd29ya19zdHJ1Y3QgKndvcmspCit7CisJc3RydWN0IGlsX3ByaXYgKmlsID0gY29udGFpbmVyX29mKHdvcmssIHN0cnVjdCBpbF9wcml2LAorCQkJCQkgIHR4cG93ZXJfd29yayk7CisKKwltdXRleF9sb2NrKCZpbC0+bXV0ZXgpOworCisJLyogSWYgYSBzY2FuIGhhcHBlbmVkIHRvIHN0YXJ0IGJlZm9yZSB3ZSBnb3QgaGVyZQorCSAqIHRoZW4ganVzdCByZXR1cm47IHRoZSBzdGF0cyBub3RpZmljYXRpb24gd2lsbAorCSAqIGtpY2sgb2ZmIGFub3RoZXIgc2NoZWR1bGVkIHdvcmsgdG8gY29tcGVuc2F0ZSBmb3IKKwkgKiBhbnkgdGVtcGVyYXR1cmUgZGVsdGEgd2UgbWlzc2VkIGhlcmUuICovCisJaWYgKHRlc3RfYml0KFNfRVhJVF9QRU5ESU5HLCAmaWwtPnN0YXR1cykgfHwKKwkgICAgdGVzdF9iaXQoU19TQ0FOTklORywgJmlsLT5zdGF0dXMpKQorCQlnb3RvIG91dDsKKworCS8qIFJlZ2FyZGxlc3Mgb2YgaWYgd2UgYXJlIGFzc29jaWF0ZWQsIHdlIG11c3QgcmVjb25maWd1cmUgdGhlCisJICogVFggcG93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biIpOworCQlnb3RvIG91dF9pb3VubWFwOworCX0KKwllcnIgPSBpbDQ5NjVfZWVwcm9tX2NoZWNrX3ZlcnNpb24oaWwpOworCWlmIChlcnIpCisJCWdvdG8gb3V0X2ZyZWVfZWVwcm9tOworCisJLyogZXh0cmFjdCBNQUMgQWRkcmVzcyAqLworCWlsNDk2NV9lZXByb21fZ2V0X21hYyhpbCwgaWwtPmFkZHJlc3Nlc1swXS5hZGRyKTsKKwlEX0lORk8oIk1BQyBhZGRyZXNzOiAlcE1cbiIsIGlsLT5hZGRyZXNzZXNbMF0uYWRkcik7CisJaWwtPmh3LT53aXBoeS0+YWRkcmVzc2VzID0gaWwtPmFkZHJlc3NlczsKKwlpbC0+aHctPndpcGh5LT5uX2FkZHJlc3NlcyA9IDE7CisKKwkvKioqKioqKioqKioqKioqKioqKioqKioqCisJICogNS4gU2V0dXAgSFcgY29uc3RhbnRzCisJICoqKioqKioqKioqKioqKioqKioqKioqKi8KKwlpbDQ5NjVfc2V0X2h3X3BhcmFtcyhpbCk7CisKKwkvKioqKioqKioqKioqKioqKioqKgorCSAqIDYuIFNldHVwIGlsCisJICoqKioqKioqKioqKioqKioqKiovCisKKwllcnIgPSBpbDQ5NjVfaW5pdF9kcnYoaWwpOworCWlmIChlcnIpCisJCWdvdG8gb3V0X2ZyZWVfZWVwcm9tOworCS8qIEF0IHRoaXMgcG9pbnQgYm90aCBodyBhbmQgaWwgYXJlIGluaXRpYWxpemVkLiAqLworCisJLyoqKioqKioqKioqKioqKioqKioqCisJICogNy4gU2V0dXAgc2VydmljZXMKKwkgKioqKioqKioqKioqKioqKioqKiovCisJc3Bpbl9sb2NrX2lycXNhdmUoJmlsLT5sb2NrLCBmbGFncyk7CisJaWxfZGlzYWJsZV9pbnRlcnJ1cHRzKGlsKTsKKwlzcGluX3VubG9ja19pcnFyZXN0b3JlKCZpbC0+bG9jaywgZmxhZ3MpOworCisJcGNpX2VuYWJsZV9tc2koaWwtPnBjaV9kZXYpOworCisJZX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fd29ya3F1ZXVlKGlsLT53b3JrcXVldWUpOworCWlsLT53b3JrcXVldWUgPSBOVUxMOworCisJZnJlZV9pcnEoaWwtPnBjaV9kZXYtPmlycSwgaWwpOworCXBjaV9kaXNhYmxlX21zaShpbC0+cGNpX2Rldik7CisJaW91bm1hcChpbC0+aHdfYmFzZSk7CisJcGNpX3JlbGVhc2VfcmVnaW9ucyhwZGV2KTsKKwlwY2lfZGlzYWJsZV9kZXZpY2UocGRldik7CisKKwlpbDQ5NjVfdW5pbml0X2RydihpbCk7CisKKwlkZXZfa2ZyZWVfc2tiKGlsLT5iZWFjb25fc2tiKTsKKworCWllZWU4MDIxMV9mcmVlX2h3KGlsLT5odyk7Cit9CisKKy8qCisgKiBBY3RpdmF0ZS9EZWFjdGl2YXRlIFR4IERNQS9GSUZPIGNoYW5uZWxzIGFjY29yZGluZyB0eCBmaWZvcyBtYXNrCisgKiBtdXN0IGJlIGNhbGxlZCB1bmRlciBpbC0+bG9jayBhbmQgbWFjIGFjY2VzcworICovCit2b2lkCitpbDQ5NjVfdHhxX3NldF9zY2hlZChzdHJ1Y3QgaWxfcHJpdiAqaWwsIHUzMiBtYXNrKQoreworCWlsX3dyX3BycGgoaWwsIElMNDlfU0NEX1RYRkFDVCwgbWFzayk7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIGRyaXZlciBhbmQgbW9kdWxlIGVudHJ5IHBvaW50CisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKiBIYXJkd2FyZSBzcGVjaWZpYyBmaWxlIGRlZmluZXMgdGhlIFBDSSBJRHMgdGFibGUgZm9yIHRoYXQgaGFyZHdhcmUgbW9kdWxlICovCitzdGF0aWMgY29uc3Qgc3RydWN0IHBjaV9kZXZpY2VfaWQgaW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gaXMgY2xlYXJlZC4KKyAqCisgKgorICogRHJpdmVyIHNlcXVlbmNlOgorICoKKyAqIGlsX3J4X3F1ZXVlX2FsbG9jKCkgICBBbGxvY2F0ZXMgcnhfZnJlZQorICogaWxfcnhfcmVwbGVuaXNoKCkgICAgIFJlcGxlbmlzaGVzIHJ4X2ZyZWUgbGlzdCBmcm9tIHJ4X3VzZWQsIGFuZCBjYWxscworICogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWxfcnhfcXVldWVfcmVzdG9jaworICogaWxfcnhfcXVldWVfcmVzdG9jaygpIE1vdmVzIGF2YWlsYWJsZSBidWZmZXJzIGZyb20gcnhfZnJlZSBpbnRvIFJ4CisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWV1ZSwgdXBkYXRlcyBmaXJtd2FyZSBwb2ludGVycywgYW5kIHVwZGF0ZXMKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBXUklURSBpZHguICBJZiBpbnN1ZmZpY2llbnQgcnhfZnJlZSBidWZmZXJzCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmUgYXZhaWxhYmxlLCBzY2hlZHVsZXMgaWxfcnhfcmVwbGVuaXNoCisgKgorICogLS0gZW5hYmxlIGludGVycnVwdHMgLS0KKyAqIElTUiAtIGlsX3J4KCkgICAgICAgICBEZXRhY2ggaWxfcnhfYnVmcyBmcm9tIHBvb2wgdXAgdG8gdGhlCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICBSRUFEIElEWCwgZGV0YWNoaW5nIHRoZSBTS0IgZnJvbSB0aGUgcG9vbC4KKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1vdmVzIHRoZSBwYWNrZXQgYnVmZmVyIGZyb20gcXVldWUgdG8gcnhfdXNlZC4KKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgIENhbGxzIGlsX3J4X3F1ZXVlX3Jlc3RvY2sgdG8gcmVmaWxsIGFueSBlbXB0eQorICogICAgICAgIC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RVMgKElOQ0xVRElORywgQlVUIE5PVAorICogTElNSVRFRCBUTywgUFJPQ1VSRU1FTlQgT0YgU1VCU1RJVFVURSBHT09EUyBPUiBTRVJWSUNFUzsgTE9TUyBPRiBVU0UsCisgKiBEQVRBLCBPUiBQUk9GSVRTOyBPUiBCVVNJTkVTUyBJTlRFUlJVUFRJT04pIEhPV0VWRVIgQ0FVU0VEIEFORCBPTiBBTlkKKyAqIFRIRU9SWSBPRiBMSUFCSUxJVFksIFdIRVRIRVIgSU4gQ09OVFJBQ1QsIFNUUklDVCBMSUFCSUxJVFksIE9SIFRPUlQKKyAqIChJTkNMVURJTkcgTkVHTElHRU5DRSBPUiBPVEhFUldJU0UpIEFSSVNJTkcgSU4gQU5ZIFdBWSBPVVQgT0YgVEhFIFVTRQorICogT0YgVEhJUyBTT0ZUV0FSRSwgRVZFTiBJRiBBRFZJU0VEIE9GIFRIRSBQT1NTSUJJTElUWSBPRiBTVUNIIERBTUFHRS4KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI2luY2x1ZGUgPGxpbnV4L3NsYWIuaD4KKyNpbmNsdWRlIDxuZXQvbWFjODAyMTEuaD4KKworI2luY2x1ZGUgIml3bC10cmFucy5oIgorCisjaW5jbHVkZSAiZGV2LmgiCisjaW5jbHVkZSAiY2FsaWIuaCIKKyNpbmNsdWRlICJhZ24uaCIKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBJTklUIGNhbGlicmF0aW9ucyBmcmFtZXdvcmsKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyogT3BhcXVlIGNhbGlicmF0aW9uIHJlc3VsdHMgKi8KK3N0cnVjdCBpd2xfY2Fs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MSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFCisgKiBPRiBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qCisgKiBQbGVhc2UgdXNlIHRoaXMgZmlsZSAoY29tbWFuZHMuaCkgb25seSBmb3IgdUNvZGUgQVBJIGRlZmluaXRpb25zLgorICogUGxlYXNlIHVzZSBpd2wteHh4eC1ody5oIGZvciBoYXJkd2FyZS1yZWxhdGVkIGRlZmluaXRpb25zLgorICogUGxlYXNlIHVzZSBkZXYuaCBmb3IgZHJpdmVyIGltcGxlbWVudGF0aW9uIGRlZmluaXRpb25zLgorICovCisKKyNpZm5kZWYgX19pd2xfY29tbWFuZHNfaF9fCisjZGVmaW5lIF9faXdsX2NvbW1hbmRzX2hfXworCisjaW5jbHVkZSA8bGludXgvaWVlZTgwMjExLmg+CisjaW5jbHVkZSA8bGludXgvdHlwZXMuaD4KKworCitlbnVtIHsKKwlSRVBMWV9BTElWRSA9IDB4MSwKKwlSRVBMWV9FUlJPUiA9IDB4MiwKKwlSRVBMWV9FQ0hPID0gMHgzLAkJLyogdGVzdCBjb21tYW5kICovCisKKwkvKiBSWE9OIGFuZCBRT1MgY29tbWFuZHMgKi8KKwlSRVBMWV9SWE9OID0gMHgxMCwKKwlSRVBMWV9SWE9OX0FTU09DID0gMHgxMSwKKwlSRVBMWV9RT1NfUEFSQU0gPSAweDEzLAorCVJFUExZX1JYT05fVElNSU5HID0gMHgxNCwKKworCS8qIE11bHRpLVN0YXRpb24gc3VwcG9ydCAqLworCVJFUExZX0FERF9TVEEgPSAweDE4LAorCVJFUExZX1JFTU9WRV9TVEEgPSAweDE5LAorCVJ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ByYXRlX25fZmxhZ3MsIHR4cG93ZXIKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qKgorICogaXdsYWduIHJhdGVfbl9mbGFncyBiaXQgZmllbGRzCisgKgorICogcmF0ZV9uX2ZsYWdzIGZvcm1hdCBpcyB1c2VkIGluIGZvbGxvd2luZyBpd2xhZ24gY29tbWFuZHM6CisgKiAgUkVQTFlfUlggKHJlc3BvbnNlIG9ubHkpCisgKiAgUkVQTFlfUlhfTVBEVSAocmVzcG9uc2Ugb25seSkKKyAqICBSRVBMWV9UWCAoYm90aCBjb21tYW5kIGFuZCByZXNwb25zZSkKKyAqICBSRVBMWV9UWF9MSU5LX1FVQUxJVFlfQ01ECisgKgorICogSGlnaC10aHJvdWdocHV0IChIVCkgcmF0ZSBmb3JtYXQgZm9yIGJpdHMgNzowIChiaXQgOCBtdXN0IGJlICIxIik6CisgKiAgMi0wOiAgMCkgICA2IE1icHMKKyAqICAgICAgICAxKSAgMTIgTWJwcworICogICAgICAgIDIpICAxOCBNYnBzCisgKiAgICAgICAgMykgIDI0IE1icHMKKyAqICAgICAgICA0KSAgMzYgTWJwcworICogICAgICAgIDUpICA0OCBNYnBzCisgKiAgICAgICAgNikgIDU0IE1icHMKKyAqICAgICAgICA3KSAgNjAgTWJwcworICoKKyAqICA0LTM6ICAwKSAgU2luZ2xlIHN0cmVhbSAoU0lTTykKKyAqICAgICAgICAxKSAgRHVhbCBzdHJlYW0gKE1JTU8pCisgKiAgICAgICAgMikgIFRyaXBsZSBzdHJlYW0gKE1JTU8pCisgKgorICogICAgNTogIFZhbHVlIG9mIDB4MjAgaW4gYml0cyA3OjAgaW5kaWNhdGVzIDYgTWJwcyBIVDQwIGR1cGxpY2F0ZSBkYXRhCisgKgorICogTGVnYWN5IE9GRE0gcmF0ZSBmb3JtYXQgZm9yIGJpdHMgNzowIChiaXQgOCBtdXN0IGJlICIwIiwgYml0IDkgIjAiKToKKyAqICAzLTA6ICAweEQpICAgNiBNYnBzCisgKiAgICAgICAgMHhGKSAgIDkgTWJwcworICogICAgICAgIDB4NSkgIDEyIE1icHMKKyAqICAgICAgICAweDcpICAxOCBNYnBzCisgKiAgICAgICAgMHg5KSAgMjQgTWJwcworICogICAgICAgIDB4QikgIDM2IE1icHMKKyAqICAgICAgICAweDEpICA0OCBNYnBzCisgKiAgICAgICAgMHgzKSAgNTQgTWJwcworICoKKyAqIExlZ2FjeSBDQ0sgcmF0ZSBmb3JtYXQgZm9yIGJpdHMgNzowIChiaXQgOCBtdXN0IGJlICIwIiwgYml0IDkgIjEiKToKKyAqICA2LTA6ICAgMTApICAxIE1icHMKKyAqICAgICAgICAgMjApICAyIE1icHMKKyAqICAgICAgICAgNTUpICA1LjUgTWJwcworICogICAgICAgIDExMCkgIDExIE1icHMKKyAqLworI2RlZmluZSBSQVRFX01DU19DT0RFX01TSyAweDcKKyNkZWZpbmUgUkFURV9NQ1NfU1BBVElBTF9QT1MgMworI2RlZmluZSBSQVRFX01DU19TUEFUSUFMX01TSyAweDE4CisjZGVmaW5lIFJBVEVfTUNTX0hUX0RVUF9QT1MgNQorI2RlZmluZSBSQVRFX01DU19IVF9EVVBfTVNLIDB4MjAKKy8qIEJvdGggbGVnYWN5IGFuZCBIVCB1c2UgYml0cyA3OjAgYXMgdGhlIENDSy9PRkRNIHJhdGUgb3IgSFQgTUNTICovCisjZGVmaW5lIFJBVEVfTUNTX1JBVEVfTVNLIDB4ZmYKKworLyogQml0IDg6ICgxKSBIVCBmb3JtYXQsICgwKSBsZWdhY3kgZm9ybWF0IGluIGJpdHMgNzowICovCisjZGVmaW5lIFJBVEVfTUNTX0ZMQUdTX1BPUyA4CisjZGVmaW5lIFJBVEVfTUNTX0hUX1BPUyA4CisjZGVmaW5lIFJBVEVfTUNTX0hUX01TSyAweDEwMAorCisvKiBCaXQgOTogKDEpIENDSywgKDApIE9GRE0uICBIVCAoYml0I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KwlfX2xlMTYgcmVzZXJ2ZWQyOworCV9fbGUzMiBsb2dfZXZlbnRfdGFibGVfcHRyOwkvKiBTUkFNIGFkZHJlc3MgZm9yIGV2ZW50IGxvZyAqLworCV9fbGUzMiBlcnJvcl9ldmVudF90YWJsZV9wdHI7CS8qIFNSQU0gYWRkcmVzcyBmb3IgZXJyb3IgbG9nICovCisJX19sZTMyIHRpbWVzdGFtcDsKKwlfX2xlMzIgaXNfdmFsaWQ7Cit9IF9fcGFja2VkOworCisvKgorICogUkVQTFlfRVJST1IgPSAweDIgKHJlc3BvbnNlIG9ubHksIG5vdCBhIGNvbW1hbmQpCisgKi8KK3N0cnVjdCBpd2xfZXJyb3JfcmVzcCB7CisJX19sZTMyIGVycm9yX3R5cGU7CisJdTggY21kX2lkOworCXU4IHJlc2VydmVkMTsKKwlfX2xlMTYgYmFkX2NtZF9zZXFfbnVtOworCV9fbGUzMiBlcnJvcl9pbmZvOworCV9fbGU2NCB0aW1lc3RhbXA7Cit9IF9fcGFja2VkOworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAoMSkKKyAqIFJYT04gQ29tbWFuZHMgJiBSZXNwb25zZXM6CisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKgorICogUnggY29uZmlnIGRlZmluZXMgJiBzdHJ1Y3R1cmUKKyAqLworLyogcnhfY29uZmlnIGRldmljZSB0eXBlcyAgKi8KK2VudW0geworCVJYT05fREVWX1RZUEVfQVAgPSAxLAorCVJYT05fREVWX1RZUEVfRVNTID0gMywKKwlSWE9OX0RFVl9UWVBFX0lCU1MgPSA0LAorCVJYT05fREVWX1RZUEVfU05JRkZFUiA9IDYsCisJUlhPTl9ERVZfVFlQRV9DUCA9IDcsCisJUlhPTl9ERVZfVFlQRV8yU1RBID0g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BhY2tlZDsKKworLyoKKyAqIFJFUExZX1dFUF9LRVkgPSAweDIwCisgKi8KK3N0cnVjdCBpd2xfd2VwX2tleSB7CisJdTgga2V5X2luZGV4OworCXU4IGtleV9vZmZzZXQ7CisJdTggcmVzZXJ2ZWQxWzJdOworCXU4IGtleV9zaXplOworCXU4IHJlc2VydmVkMlszXTsKKwl1OCBrZXlbMTZdOworfSBfX3BhY2tlZDsKKworc3RydWN0IGl3bF93ZXBfY21kIHsKKwl1OCBudW1fa2V5czsKKwl1OCBnbG9iYWxfa2V5X3R5cGU7CisJdTggZmxhZ3M7CisJdTggcmVzZXJ2ZWQ7CisJc3RydWN0IGl3bF93ZXBfa2V5IGtleVswXTsKK30gX19wYWNrZWQ7CisKKyNkZWZpbmUgV0VQX0tFWV9XRVBfVFlQRSAxCisjZGVmaW5lIFdFUF9LRVlTX01BWCA0CisjZGVmaW5lIFdFUF9JTlZBTElEX09GRlNFVCAweGZmCisjZGVmaW5lIFdFUF9LRVlfTEVOXzY0IDUKKyNkZWZpbmUgV0VQX0tFWV9MRU5fMTI4IDEzCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICg0KQorICogUnggUmVzcG9uc2VzOgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI2RlZmluZSBSWF9SRVNfU1RBVFVTX05PX0NSQzMyX0VSUk9SCWNwdV90b19sZTMyKDEgPDwgMCkKKyNkZWZpbmUgUlhfUkVTX1NUQVRVU19OT19SWEVfT1ZFUkZMT1cJY3B1X3RvX2xlMzIoMSA8PCAxKQorCisjZGVmaW5lIFJYX1JFU19QSFlfRkxBR1NfQkFORF8yNF9NU0sJY3B1X3RvX2xlMTYoMSA8PCAwKQorI2RlZmluZSBSWF9SRVNfUEhZX0ZMQUdTX01PRF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WxpZCIgYml0bWFzaworCSAqIGlmIGNvbmZpZ3VyZSB0aGUgZm9sbG93aW5nIHBhdHRlcm5zCisJICovCisJdTggcmVzZXJ2ZWQ7CisJdTggdHhfcHJpb19ib29zdDsJLyogU1cgYm9vc3Qgb2YgV2lGaSB0eCBwcmlvcml0eSAqLworCV9fbGUxNiByeF9wcmlvX2Jvb3N0OwkvKiBTVyBib29zdCBvZiBXaUZpIHJ4IHByaW9yaXR5ICovCit9OworCisjZGVmaW5lIElXTEFHTl9CVF9TQ09fQUNUSVZFCWNwdV90b19sZTMyKEJJVCgwKSkKKworc3RydWN0IGl3bGFnbl9idF9zY29fY21kIHsKKwlfX2xlMzIgZmxhZ3M7Cit9OworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAoNikKKyAqIFNwZWN0cnVtIE1hbmFnZW1lbnQgKDgwMi4xMWgpIENvbW1hbmRzLCBSZXNwb25zZXMsIE5vdGlmaWNhdGlvbnM6CisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKgorICogU3BlY3RydW0gTWFuYWdlbWVudAorICovCisjZGVmaW5lIE1FQVNVUkVNRU5UX0ZJTFRFUl9GTEFHIChSWE9OX0ZJTFRFUl9QUk9NSVNDX01TSyAgICAgICAgIHwgXAorCQkJCSBSWE9OX0ZJTFRFUl9DVEwySE9TVF9NU0sgICAgICAgIHwgXAorCQkJCSBSWE9OX0ZJTFRFUl9BQ0NFUFRfR1JQX01TSyAgICAgIHwgXAorCQkJCSBSWE9OX0ZJTFRFUl9ESVNfREVDUllQVF9NU0sgICAgIHwgXAorCQkJCSBSWE9OX0ZJTFRFUl9ESVNfR1JQX0RFQ1JZUFRfTVNLIHwgXAorCQkJCSBSWE9OX0ZJTFRFUl9BU1NPQ19NU0sgICAgICAgICAg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ioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICg3KQorICogUG93ZXIgTWFuYWdlbWVudCBDb21tYW5kcywgUmVzcG9uc2VzLCBOb3RpZmljYXRpb25zOgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyoqCisgKiBzdHJ1Y3QgaXdsX3Bvd2VydGFibGVfY21kIC0gUG93ZXIgVGFibGUgQ29tbWFuZAorICogQGZsYWdzOiBTZWUgYmVsb3c6CisgKgorICogUE9XRVJfVEFCTEVfQ01EID0gMHg3NyAoY29tbWFuZCwgaGFzIHNpbXBsZSBnZW5lcmljIHJlc3BvbnNlKQorICoKKyAqIFBNIGFsbG93OgorICogICBiaXQgMCAtICcwJyBEcml2ZXIgbm90IGFsbG93IHBvd2VyIG1hbmFnZW1lbnQKKyAqICAgICAgICAgICAnMScgRHJpdmVyIGFsbG93IFBNICh1c2UgcmVzdCBvZiBwYXJhbWV0ZXJzKQorICoKKyAqIHVDb2RlIHNlbmQgc2xlZXAgbm90aWZpY2F0aW9uczoKKyAqICAgYml0IDEgLSAnMCcgRG9uJ3Qgc2VuZCBzbGVlcCBub3RpZmljYXRpb24KKyAqICAgICAgICAgICAnMScgc2VuZCBzbGVlcCBub3RpZmljYXRpb24gKFNFTkRfUE1fTk9USUZJQ0FUSU9OKQorICoKKyAqIFNsZWVwIG92ZXIgRFRJTQorICogICBiaXQgMiAtICcwJyBQTSBoYXZlIHRvIHdhbGsgdXAgZXZlcnkgRFRJTQorICogICAgICAgICAgICcxJyBQTSBjb3VsZCBzbGVlcCBvdmVyIERUSU0gdGlsbCBsaXN0ZW4gSW50ZXJ2YWwuCisgKgorICogUENJIHBvd2VyIG1hbmFnZWQKKyAqICAgYml0IDMgLSAnMCcgKFBDSV9DRkdfTElOS19DVFJMICYgMHgxKQorICogICAgICAgICAgICcxJyAhKFBDSV9DRkdfTElOS19DVFJMICYgMHgx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X19sZTMyIGZsYWdzOworfSBfX3BhY2tlZDsKKworI2RlZmluZSBIV19DQVJEX0RJU0FCTEVEICAgMHgwMQorI2RlZmluZSBTV19DQVJEX0RJU0FCTEVEICAgMHgwMgorI2RlZmluZSBDVF9DQVJEX0RJU0FCTEVEICAgMHgwNAorI2RlZmluZSBSWE9OX0NBUkRfRElTQUJMRUQgMHgxMAorCitzdHJ1Y3QgaXdsX2N0X2tpbGxfY29uZmlnIHsKKwlfX2xlMzIgICByZXNlcnZlZDsKKwlfX2xlMzIgICBjcml0aWNhbF90ZW1wZXJhdHVyZV9NOworCV9fbGUzMiAgIGNyaXRpY2FsX3RlbXBlcmF0dXJlX1I7Cit9ICBfX3BhY2tlZDsKKworLyogMTAwMCwgYW5kIDZ4MDAgKi8KK3N0cnVjdCBpd2xfY3Rfa2lsbF90aHJvdHRsaW5nX2NvbmZpZyB7CisJX19sZTMyICAgY3JpdGljYWxfdGVtcGVyYXR1cmVfZXhpdDsKKwlfX2xlMzIgICByZXNlcnZlZDsKKwlfX2xlMzIgICBjcml0aWNhbF90ZW1wZXJhdHVyZV9lbnRlcjsKK30gIF9fcGFja2VkOworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAoOCkKKyAqIFNjYW4gQ29tbWFuZHMsIFJlc3BvbnNlcywgTm90aWZpY2F0aW9uczoKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNkZWZpbmUgU0NBTl9DSEFOTkVMX1RZUEVfUEFTU0lWRSBjcHVfdG9fbGUzMigwKQorI2RlZmluZSBTQ0FOX0NIQU5ORUxfVFlQRV9BQ1RJVkUgIGNwdV90b19sZTMyKDEpCisKKy8qKgorICogc3RydWN0IGl3bF9zY2FuX2NoYW5uZWwgLSBlbnRyeSBpbiBSRVBMWV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lCSVQoMCkKKy8qIGVycm9yIHN0YXR1c2VzIGNvbWJpbmVkIHdpdGggVFhfRkFJTEVEICovCisjZGVmaW5lIElXTF9QUk9CRV9TVEFUVVNfRkFJTF9UVEwJQklUKDEpCisjZGVmaW5lIElXTF9QUk9CRV9TVEFUVVNfRkFJTF9CVAlCSVQoMikKKworI2RlZmluZSBOVU1CRVJfT0ZfU1RBVElTVElDUyAxCS8qIGZpcnN0IF9fbGUzMiBpcyBnb29kIENSQyAqLworLyoKKyAqIFNDQU5fUkVTVUxUU19OT1RJRklDQVRJT04gPSAweDgzIChub3RpZmljYXRpb24gb25seSwgbm90IGEgY29tbWFuZCkKKyAqLworc3RydWN0IGl3bF9zY2FucmVzdWx0c19ub3RpZmljYXRpb24geworCXU4IGNoYW5uZWw7CisJdTggYmFuZDsKKwl1OCBwcm9iZV9zdGF0dXM7CisJdTggbnVtX3Byb2JlX25vdF9zZW50OyAvKiBub3QgZW5vdWdoIHRpbWUgdG8gc2VuZCAqLworCV9fbGUzMiB0c2ZfbG93OworCV9fbGUzMiB0c2ZfaGlnaDsKKwlfX2xlMzIgc3RhdGlzdGljc1tOVU1CRVJfT0ZfU1RBVElTVElDU107Cit9IF9fcGFja2VkOworCisvKgorICogU0NBTl9DT01QTEVURV9OT1RJRklDQVRJT04gPSAweDg0IChub3RpZmljYXRpb24gb25seSwgbm90IGEgY29tbWFuZCkKKyAqLworc3RydWN0IGl3bF9zY2FuY29tcGxldGVfbm90aWZpY2F0aW9uIHsKKwl1OCBzY2FubmVkX2NoYW5uZWxzOworCXU4IHN0YXR1czsKKwl1OCBidF9zdGF0dXM7CS8qIEJUIE9uL09mZiBzdGF0dXMgKi8KKwl1OCBsYXN0X2NoYW5uZWw7CisJX19sZTMyIHRzZl9sb3c7CisJX19sZTMyIHRzZl9oaWdoOworfSBfX3BhY2tlZDsKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAoOSkKKyAqIElCU1MvQVAgQ29tbWFuZHMgYW5kIE5vdGlmaWNhdGlvbnM6CisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitlbnVtIGl3bF9pYnNzX21hbmFnZXIgeworCUlXTF9OT1RfSUJTU19NQU5BR0VSID0gMCwKKwlJV0xfSUJTU19NQU5BR0VSID0gMSwKK307CisKKy8qCisgKiBCRUFDT05fTk9USUZJQ0FUSU9OID0gMHg5MCAobm90aWZpY2F0aW9uIG9ubHksIG5vdCBhIGNvbW1hbmQpCisgKi8KKworc3RydWN0IGl3bGFnbl9iZWFjb25fbm90aWYgeworCXN0cnVjdCBpd2xhZ25fdHhfcmVzcCBiZWFjb25fbm90aWZ5X2hkcjsKKwlfX2xlMzIgbG93X3RzZjsKKwlfX2xlMzIgaGlnaF90c2Y7CisJX19sZTMyIGlic3NfbWdyX3N0YXR1czsKK30gX19wYWNrZWQ7CisKKy8qCisgKiBSRVBMWV9UWF9CRUFDT04gPSAweDkxIChjb21tYW5kLCBoYXMgc2ltcGxlIGdlbmVyaWMgcmVzcG9uc2UpCisgKi8KKworc3RydWN0IGl3bF90eF9iZWFjb25fY21kIHsKKwlzdHJ1Y3QgaXdsX3R4X2NtZCB0eDsKKwlfX2xlMTYgdGltX2lkeDsKKwl1OCB0aW1fc2l6ZTsKKwl1OCByZXNlcnZlZDE7CisJc3RydWN0IGllZWU4MDIxMV9oZHIgZnJhbWVbMF07CS8qIGJlYWNvbiBmcmFtZSAqLworfSBfX3BhY2tlZDsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogKDEwKQorICogU3RhdGlzdGljcyBDb21tYW5kcyBhbmQgTm90aWZpY2F0aW9uczoKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioq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V4cGVjdGVkX2JlYWNvbnM7CisJX19sZTMyIG51bV9yZWN2ZF9iZWFjb25zOworfSBfX3BhY2tlZDsKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAoMTEpCisgKiBSeCBDYWxpYnJhdGlvbiBDb21tYW5kczoKKyAqCisgKiBXaXRoIHRoZSB1Q29kZSB1c2VkIGZvciBvcGVuIHNvdXJjZSBkcml2ZXJzLCBtb3N0IFR4IGNhbGlicmF0aW9uIChleGNlcHQKKyAqIGZvciBUeCBQb3dlcikgYW5kIG1vc3QgUnggY2FsaWJyYXRpb24gaXMgZG9uZSBieSB1Q29kZSBkdXJpbmcgdGhlCisgKiAiaW5pdGlhbGl6ZSIgcGhhc2Ugb2YgdUNvZGUgYm9vdC4gIERyaXZlciBtdXN0IGNhbGlicmF0ZSBvbmx5OgorICoKKyAqIDEpICBUeCBwb3dlciAoZGVwZW5kcyBvbiB0ZW1wZXJhdHVyZSksIGRlc2NyaWJlZCBlbHNld2hlcmUKKyAqIDIpICBSZWNlaXZlciBnYWluIGJhbGFuY2UgKG9wdGltaXplIE1JTU8sIGFuZCBkZXRlY3QgZGlzY29ubmVjdGVkIGFudGVubmFzKQorICogMykgIFJlY2VpdmVyIHNlbnNpdGl2aXR5ICh0byBvcHRpbWl6ZSBzaWduYWwgZGV0ZWN0aW9uKQorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyoqCisgKiBTRU5TSVRJVklUWV9DTUQgPSAweGE4IChjb21tYW5kLCBoYXMgc2ltcGxlIGdlbmVyaWMgcmVzcG9uc2UpCisgKgorICogVGhpcyBjb21tYW5kIHNldHMgdXAgdGhlIFJ4IHNpZ25hbCBkZXRlY3RvciBmb3IgYSBzZW5zaXRpdml0eSBsZXZlbCB0aGF0CisgKi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aGVyIGVuZXJneTsgdGhpcyBtZWFucyBtYWtpbmcgc3VyZSB0aGF0IHRoZSB2YWx1ZQorICogICBpbiBIRF9NSU5fRU5FUkdZX0NDS19ERVRfSU5ERVggaXMgYXQgb3IgKmFib3ZlKiAiTWF4IGNjayBlbmVyZ3kiLgorICoKKyAqLworCisvKgorICogVGFibGUgZW50cmllcyBpbiBTRU5TSVRJVklUWV9DTUQgKHN0cnVjdCBpd2xfc2Vuc2l0aXZpdHlfY21kKQorICovCisjZGVmaW5lIEhEX1RBQkxFX1NJWkUgICgxMSkJLyogbnVtYmVyIG9mIGVudHJpZXMgKi8KKyNkZWZpbmUgSERfTUlOX0VORVJHWV9DQ0tfREVUX0lOREVYICAgICAgICAgICAgICAgICAoMCkJLyogdGFibGUgaW5kZXhlcyAqLworI2RlZmluZSBIRF9NSU5fRU5FUkdZX09GRE1fREVUX0lOREVYICAgICAgICAgICAgICAgICgxKQorI2RlZmluZSBIRF9BVVRPX0NPUlIzMl9YMV9USF9BRERfTUlOX0lOREVYICAgICAgICAgICgyKQorI2RlZmluZSBIRF9BVVRPX0NPUlIzMl9YMV9USF9BRERfTUlOX01SQ19JTkRFWCAgICAgICgzKQorI2RlZmluZSBIRF9BVVRPX0NPUlI0MF9YNF9USF9BRERfTUlOX01SQ19JTkRFWCAgICAgICg0KQorI2RlZmluZSBIRF9BVVRPX0NPUlIzMl9YNF9USF9BRERfTUlOX0lOREVYICAgICAgICAgICg1KQorI2RlZmluZSBIRF9BVVRPX0NPUlIzMl9YNF9USF9BRERfTUlOX01SQ19JTkRFWCAgICAgICg2KQorI2RlZmluZSBIRF9CQVJLRVJfQ09SUl9USF9BRERfTUlOX0lOREVYICAgICAgICAgICAgICg3KQorI2RlZmluZSBIRF9CQVJLRVJfQ09SUl9USF9BRERfTUlOX01SQ19JTkRFWCAgICAgICAgICg4KQorI2RlZmluZSBIRF9BVVRPX0NPUlI0MF9YNF9USF9BRERfTUlOX0lOREVYICAgICAgICAgICg5KQorI2Rl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AgICA0CisjZGVmaW5lIENPRVhfQ1VfUlNSVkQxX1JQICAgICAgICAgICAgICAgICAgICAgNAorI2RlZmluZSBDT0VYX0NVX1JTUlZEMl9SUCAgICAgICAgICAgICAgICAgICAgIDQKKworI2RlZmluZSBDT0VYX0NVX1VOQVNTT0NfSURMRV9XUCAgICAgICAgICAgICAgIDMKKyNkZWZpbmUgQ09FWF9DVV9VTkFTU09DX01BTlVBTF9TQ0FOX1dQICAgICAgICAzCisjZGVmaW5lIENPRVhfQ1VfVU5BU1NPQ19BVVRPX1NDQU5fV1AgICAgICAgICAgMworI2RlZmluZSBDT0VYX0NVX0NBTElCUkFUSU9OX1dQICAgICAgICAgICAgICAgIDMKKyNkZWZpbmUgQ09FWF9DVV9QRVJJT0RJQ19DQUxJQlJBVElPTl9XUCAgICAgICAzCisjZGVmaW5lIENPRVhfQ1VfQ09OTkVDVElPTl9FU1RBQl9XUCAgICAgICAgICAgMworI2RlZmluZSBDT0VYX0NVX0FTU09DSUFURURfSURMRV9XUCAgICAgICAgICAgIDMKKyNkZWZpbmUgQ09FWF9DVV9BU1NPQ19NQU5VQUxfU0NBTl9XUCAgICAgICAgICAzCisjZGVmaW5lIENPRVhfQ1VfQVNTT0NfQVVUT19TQ0FOX1dQICAgICAgICAgICAgMworI2RlZmluZSBDT0VYX0NVX0FTU09DX0FDVElWRV9MRVZFTF9XUCAgICAgICAgIDMKKyNkZWZpbmUgQ09FWF9DVV9SRl9PTl9XUCAgICAgICAgICAgICAgICAgICAgICAzCisjZGVmaW5lIENPRVhfQ1VfUkZfT0ZGX1dQICAgICAgICAgICAgICAgICAgICAgMworI2RlZmluZSBDT0VYX0NVX1NUQU5EX0FMT05FX0RFQlVHX1dQICAgICAgICAgIDYKKyNkZWZpbmUgQ09FWF9DVV9JUEFOX0FTU09DX0xFVkVMX1dQICAgICAgICAgICAzCisjZGVmaW5lIENPRVhfQ1VfUlNSVkQxX1dQICAgICAgICAgICAgICAgICAgICAgMworI2RlZmluZSBDT0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BDb21tYW5kCisgKiBDT0VYX0VWRU5UX0NNRCA9IDB4NWMKKyAqCisgKiBzZW5kIGZyb20gaG9zdCB0byB1Q29kZSBmb3IgY29leCBldmVudCByZXF1ZXN0LgorICovCisvKiBmbGFncyBvcHRpb25zICovCisjZGVmaW5lIENPRVhfRVZFTlRfUkVRVUVTVF9NU0sJKDB4MSkKKworc3RydWN0IGl3bF9jb2V4X2V2ZW50X2NtZCB7CisJdTggZmxhZ3M7CisJdTggZXZlbnQ7CisJX19sZTE2IHJlc2VydmVkOworfSBfX3BhY2tlZDsKKworc3RydWN0IGl3bF9jb2V4X2V2ZW50X3Jlc3AgeworCV9fbGUzMiBzdGF0dXM7Cit9IF9fcGFja2VkOworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIEJsdWV0b290aCBDb2V4aXN0ZW5jZSBjb21tYW5kcworICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyoKKyAqIEJUIFN0YXR1cyBub3RpZmljYXRpb24KKyAqIFJFUExZX0JUX0NPRVhfUFJPRklMRV9OT1RJRiA9IDB4Y2UKKyAqLworZW51bSBpd2xfYnRfY29leF9wcm9maWxlX3RyYWZmaWNfbG9hZCB7CisJSVdMX0JUX0NPRVhfVFJBRkZJQ19MT0FEX05PTkUgPSAJMCwKKwlJV0xfQlRfQ09FWF9UUkFGRklDX0xPQURfTE9XID0JCTEsCisJSVdMX0JUX0NPRVhfVFJBRkZJQ19MT0FEX0hJR0ggPSAJMiwKKwlJV0xfQlRfQ09FWF9UUkFGRklDX0xPQURfQ09OVElOVU9VUyA9CTMsCisvKgorICogVGhlcmUgYXJlIG5vIG1vcmUgZXZlbiB0aG91Z2ggYmVsb3cgaXMgYSB1OCwgdGhlCisgKiBpbmRpY2F0aW9uIGZyb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3RhX2lkOworfTsKKworc3RydWN0IGl3bF9zZW5zaXRpdml0eV9yYW5nZXMgeworCXUxNiBtaW5fbnJnX2NjazsKKworCXUxNiBucmdfdGhfY2NrOworCXUxNiBucmdfdGhfb2ZkbTsKKworCXUxNiBhdXRvX2NvcnJfbWluX29mZG07CisJdTE2IGF1dG9fY29ycl9taW5fb2ZkbV9tcmM7CisJdTE2IGF1dG9fY29ycl9taW5fb2ZkbV94MTsKKwl1MTYgYXV0b19jb3JyX21pbl9vZmRtX21yY194MTsKKworCXUxNiBhdXRvX2NvcnJfbWF4X29mZG07CisJdTE2IGF1dG9fY29ycl9tYXhfb2ZkbV9tcmM7CisJdTE2IGF1dG9fY29ycl9tYXhfb2ZkbV94MTsKKwl1MTYgYXV0b19jb3JyX21heF9vZmRtX21yY194MTsKKworCXUxNiBhdXRvX2NvcnJfbWF4X2NjazsKKwl1MTYgYXV0b19jb3JyX21heF9jY2tfbXJjOworCXUxNiBhdXRvX2NvcnJfbWluX2NjazsKKwl1MTYgYXV0b19jb3JyX21pbl9jY2tfbXJjOworCisJdTE2IGJhcmtlcl9jb3JyX3RoX21pbjsKKwl1MTYgYmFya2VyX2NvcnJfdGhfbWluX21yYzsKKwl1MTYgbnJnX3RoX2NjYTsKK307CisKKworI2RlZmluZSBLRUxWSU5fVE9fQ0VMU0lVUyh4KSAoKHgpLTI3MykKKyNkZWZpbmUgQ0VMU0lVU19UT19LRUxWSU4oeCkgKCh4KSsyNzMpCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIEZ1bmN0aW9ucyBpbXBsZW1lbnRlZCBpbiBjb3JlIG1vZHVsZSB3aGljaCBhcmUgZm9yd2FyZCBkZWNsYXJlZCBoZXJlCisgKiBmb3IgdXNlIGJ5IGl3bC1bNC01XS5jCisgKgorICogTk9URTogIFRoZSBpbXBsZW1lbnRhdGlvbiBvZiB0aG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CisjaW5jbHVkZSA8bGludXgvZXRoZXJkZXZpY2UuaD4KKyNpbmNsdWRlIDxsaW51eC9pZl9hcnAuaD4KKworI2luY2x1ZGUgPG5ldC9pZWVlODAyMTFfcmFkaW90YXAuaD4KKyNpbmNsdWRlIDxuZXQvbWFjODAyMTEuaD4KKworI2luY2x1ZGUgPGFzbS9kaXY2NC5oPgorCisjaW5jbHVkZSAiaXdsLWlvLmgiCisjaW5jbHVkZSAiaXdsLXRyYW5zLmgiCisjaW5jbHVkZSAiaXdsLW9wLW1vZGUuaCIKKyNpbmNsdWRlICJpd2wtbW9kcGFyYW1zLmgiCisKKyNpbmNsdWRlICJkZXYuaCIKKyNpbmNsdWRlICJjYWxpYi5oIgorI2luY2x1ZGUgImFnbi5oIgorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBtYWM4MDIxMSBlbnRyeSBwb2ludCBmdW5jdGlvbnMKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3N0YXRpYyBjb25zdCBzdHJ1Y3QgaWVlZTgwMjExX2lmYWNlX2xpbWl0IGl3bGFnbl9zdGFfYXBfbGltaXRzW10gPSB7CisJeworCQkubWF4ID0gMSwKKwkJLnR5cGVzID0gQklUKE5MODAyMTFfSUZUWVBFX1NUQVRJT04pLAorCX0sCisJeworCQkubWF4ID0gMSwKKwkJLnR5cGVzID0gQklUKE5MODAyMTFfSUZUWVBFX0FQKSwKKwl9LAorfTsKKworc3RhdGljIGNvbnN0IHN0cnVjdCBpZWVlODAyMTFfaWZhY2VfbGltaXQgaXdsYWduXzJzdGFfbGltaXRzW10gPSB7CisJeworCQkubWF4ID0gMiwKKwkJLnR5cGVzID0gQklUKE5MODAyMTFfSUZUWVBFX1NUQVRJT04pLAorCX0sCit9OworCitzdGF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Qlwcml2LT5idF9lbmFibGVfcHNwb2xsID0gZmFsc2U7CisKKwkJcXVldWVfd29yayhwcml2LT53b3JrcXVldWUsICZwcml2LT5idF9ydW50aW1lX2NvbmZpZyk7CisJfSBlbHNlIHsKKwkJSVdMX0RFQlVHX01BQzgwMjExKHByaXYsICJBZHZhbmNlZCBCVCBjb2V4IGRpc2FibGVkLCIKKwkJCQkiaWdub3JpbmcgUlNTSSBjYWxsYmFja1xuIik7CisJfQorCisJSVdMX0RFQlVHX01BQzgwMjExKHByaXYsICJsZWF2ZVxuIik7Cit9CisKK3N0YXRpYyBpbnQgaXdsYWduX21hY19zZXRfdGltKHN0cnVjdCBpZWVlODAyMTFfaHcgKmh3LAorCQkJICAgICAgc3RydWN0IGllZWU4MDIxMV9zdGEgKnN0YSwgYm9vbCBzZXQpCit7CisJc3RydWN0IGl3bF9wcml2ICpwcml2ID0gSVdMX01BQzgwMjExX0dFVF9EVk0oaHcpOworCisJcXVldWVfd29yayhwcml2LT53b3JrcXVldWUsICZwcml2LT5iZWFjb25fdXBkYXRlKTsKKworCXJldHVybiAwOworfQorCitzdGF0aWMgaW50IGl3bGFnbl9tYWNfY29uZl90eChzdHJ1Y3QgaWVlZTgwMjExX2h3ICpodywKKwkJCSAgICAgIHN0cnVjdCBpZWVlODAyMTFfdmlmICp2aWYsIHUxNiBxdWV1ZSwKKwkJCSAgICAgIGNvbnN0IHN0cnVjdCBpZWVlODAyMTFfdHhfcXVldWVfcGFyYW1zICpwYXJhbXMpCit7CisJc3RydWN0IGl3bF9wcml2ICpwcml2ID0gSVdMX01BQzgwMjExX0dFVF9EVk0oaHcpOworCXN0cnVjdCBpd2xfdmlmX3ByaXYgKnZpZl9wcml2ID0gKHZvaWQgKil2aWYtPmRydl9wcml2OworCXN0cnVjdCBpd2xfcnhvbl9jb250ZXh0ICpjdHggPSB2aWZfcHJpdi0+Y3R4OworCWludCBxOworCisJaWYgKFdBUk5fT04oIWN0eCkpCisJCXJldHVybiAtRUlOVkFMOworCisJSVdMX0RFQlVHX01BQzgwMjExKHByaXYsICJlbnRlclxuIik7CisKKwlpZiAoIWl3bF9pc19yZWFkeV9yZihwcml2KSkgeworCQlJV0xfREVCVUdfTUFDODAyMTEocHJpdiwgImxlYXZlIC0gUkYgbm90IHJlYWR5XG4iKTsKKwkJcmV0dXJuIC1FSU87CisJfQorCisJaWYgKHF1ZXVlID49IEFDX05VTSkgeworCQlJV0xfREVCVUdfTUFDODAyMTEocHJpdiwgImxlYXZlIC0gcXVldWUgPj0gQUNfTlVNICVkXG4iLCBxdWV1ZSk7CisJCXJldHVybiAwOworCX0KKworCXEgPSBBQ19OVU0gLSAxIC0gcXVldWU7CisKKwltdXRleF9sb2NrKCZwcml2LT5tdXRleCk7CisKKwljdHgtPnFvc19kYXRhLmRlZl9xb3NfcGFybS5hY1txXS5jd19taW4gPQorCQljcHVfdG9fbGUxNihwYXJhbXMtPmN3X21pbik7CisJY3R4LT5xb3NfZGF0YS5kZWZfcW9zX3Bhcm0uYWNbcV0uY3dfbWF4ID0KKwkJY3B1X3RvX2xlMTYocGFyYW1zLT5jd19tYXgpOworCWN0eC0+cW9zX2RhdGEuZGVmX3Fvc19wYXJtLmFjW3FdLmFpZnNuID0gcGFyYW1zLT5haWZzOworCWN0eC0+cW9zX2RhdGEuZGVmX3Fvc19wYXJtLmFjW3FdLmVkY2FfdHhvcCA9CisJCQljcHVfdG9fbGUxNigocGFyYW1zLT50eG9wICogMzIpKTsKKworCWN0eC0+cW9zX2RhdGEuZGVmX3Fvc19wYXJtLmFjW3FdLnJlc2VydmVkMSA9IDA7CisKKwltdXRleF91bmxvY2soJnByaXYtPm11dGV4KTsKKworCUlXTF9ERUJVR19NQUM4MDIxMShwcml2LCAibGVhdmVcbiIpOworCXJldHVybiAwOworfQorCitzdGF0aWMgaW50IGl3bGFnbl9tYWNfdHhfbGFzdF9iZWFjb24oc3RydWN0IGllZWU4MDIxMV9odyAqaHcpCit7CisJc3RydWN0IGl3bF9wcml2ICpwcml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XJuZWwuaD4KKyNpbmNsdWRlIDxsaW51eC9tb2R1bGUuaD4KKyNpbmNsdWRlIDxsaW51eC9pbml0Lmg+CisjaW5jbHVkZSA8bGludXgvc2xhYi5oPgorI2luY2x1ZGUgPGxpbnV4L2RlbGF5Lmg+CisjaW5jbHVkZSA8bGludXgvc2NoZWQuaD4KKyNpbmNsdWRlIDxsaW51eC9za2J1ZmYuaD4KKyNpbmNsdWRlIDxsaW51eC9uZXRkZXZpY2UuaD4KKyNpbmNsdWRlIDxsaW51eC9ldGhlcmRldmljZS5oPgorI2luY2x1ZGUgPGxpbnV4L2lmX2FycC5oPgorCisjaW5jbHVkZSA8bmV0L21hYzgwMjExLmg+CisKKyNpbmNsdWRlIDxhc20vZGl2NjQuaD4KKworI2luY2x1ZGUgIml3bC1lZXByb20tcmVhZC5oIgorI2luY2x1ZGUgIml3bC1lZXByb20tcGFyc2UuaCIKKyNpbmNsdWRlICJpd2wtaW8uaCIKKyNpbmNsdWRlICJpd2wtdHJhbnMuaCIKKyNpbmNsdWRlICJpd2wtb3AtbW9kZS5oIgorI2luY2x1ZGUgIml3bC1kcnYuaCIKKyNpbmNsdWRlICJpd2wtbW9kcGFyYW1zLmgiCisjaW5jbHVkZSAiaXdsLXBycGguaCIKKworI2luY2x1ZGUgImRldi5oIgorI2luY2x1ZGUgImNhbGliLmgiCisjaW5jbHVkZSAiYWduLmgiCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIG1vZHVsZSBib2lsZXIgcGxhdGUKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjZGVmaW5lIERSVl9ERVNDUklQVElPTgkiSW50ZWwoUikgV2lyZWxlc3MgV2lGaSBMaW5rIEFHTiBkcml2ZXIgZm9yIExpbnV4IgorTU9E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xMV9zdG9wX3F1ZXVlcyhwcml2LT5odyk7CisKKwlwcml2LT51Y29kZV9sb2FkZWQgPSBmYWxzZTsKKwlpd2xfdHJhbnNfc3RvcF9kZXZpY2UocHJpdi0+dHJhbnMpOworCisJLyogU2V0IG51bV9hdXhfaW5fZmxpZ2h0IG11c3QgYmUgZG9uZSBhZnRlciB0aGUgdHJhbnNwb3J0IGlzIHN0b3BwZWQgKi8KKwlhdG9taWNfc2V0KCZwcml2LT5udW1fYXV4X2luX2ZsaWdodCwgMCk7CisKKwkvKiBDbGVhciBvdXQgYWxsIHN0YXR1cyBiaXRzIGJ1dCBhIGZldyB0aGF0IGFyZSBzdGFibGUgYWNyb3NzIHJlc2V0ICovCisJcHJpdi0+c3RhdHVzICY9IHRlc3RfYml0KFNUQVRVU19SRl9LSUxMX0hXLCAmcHJpdi0+c3RhdHVzKSA8PAorCQkJCVNUQVRVU19SRl9LSUxMX0hXIHwKKwkJCXRlc3RfYml0KFNUQVRVU19GV19FUlJPUiwgJnByaXYtPnN0YXR1cykgPDwKKwkJCQlTVEFUVVNfRldfRVJST1IgfAorCQkJdGVzdF9iaXQoU1RBVFVTX0VYSVRfUEVORElORywgJnByaXYtPnN0YXR1cykgPDwKKwkJCQlTVEFUVVNfRVhJVF9QRU5ESU5HOworCisJZGV2X2tmcmVlX3NrYihwcml2LT5iZWFjb25fc2tiKTsKKwlwcml2LT5iZWFjb25fc2tiID0gTlVMTDsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogV29ya3F1ZXVlIGNhbGxiYWNrcworICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworc3RhdGljIHZvaWQgaXdsX2JnX3J1bl90aW1lX2NhbGliX3dvcmsoc3RydWN0IHdvcmtfc3RydWN0ICp3b3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ocHJpdi0+YWdnX3FfYWxsb2MpKTsKK30KKworc3RhdGljIHZvaWQgaXdsX2JnX3Jlc3RhcnQoc3RydWN0IHdvcmtfc3RydWN0ICpkYXRhKQoreworCXN0cnVjdCBpd2xfcHJpdiAqcHJpdiA9IGNvbnRhaW5lcl9vZihkYXRhLCBzdHJ1Y3QgaXdsX3ByaXYsIHJlc3RhcnQpOworCisJaWYgKHRlc3RfYml0KFNUQVRVU19FWElUX1BFTkRJTkcsICZwcml2LT5zdGF0dXMpKQorCQlyZXR1cm47CisKKwlpZiAodGVzdF9hbmRfY2xlYXJfYml0KFNUQVRVU19GV19FUlJPUiwgJnByaXYtPnN0YXR1cykpIHsKKwkJbXV0ZXhfbG9jaygmcHJpdi0+bXV0ZXgpOworCQlpd2xhZ25fcHJlcGFyZV9yZXN0YXJ0KHByaXYpOworCQltdXRleF91bmxvY2soJnByaXYtPm11dGV4KTsKKwkJaXdsX2NhbmNlbF9kZWZlcnJlZF93b3JrKHByaXYpOworCQlpZiAocHJpdi0+bWFjODAyMTFfcmVnaXN0ZXJlZCkKKwkJCWllZWU4MDIxMV9yZXN0YXJ0X2h3KHByaXYtPmh3KTsKKwkJZWxzZQorCQkJSVdMX0VSUihwcml2LAorCQkJCSJDYW5ub3QgcmVxdWVzdCByZXN0YXJ0IGJlZm9yZSByZWdpc3RyYXRpbmcgd2l0aCBtYWM4MDIxMVxuIik7CisJfSBlbHNlIHsKKwkJV0FSTl9PTigxKTsKKwl9Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIGRyaXZlciBzZXR1cCBhbmQgdGVhcmRvd24KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3N0YXRpYyB2b2lkIGl3bF9zZXR1cF9kZWZlcnJlZF93b3JrKH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KKwkJYXRvbWljX3NldCgmcHJpdi0+cXVldWVfc3RvcF9jb3VudFtpXSwgMCk7CisJfQorCisJaWYgKGl3bF9pbml0X2Rydihwcml2KSkKKwkJZ290byBvdXRfZnJlZV9lZXByb207CisKKwkvKiBBdCB0aGlzIHBvaW50IGJvdGggaHcgYW5kIHByaXYgYXJlIGluaXRpYWxpemVkLiAqLworCisJLyoqKioqKioqKioqKioqKioqKioqCisJICogNi4gU2V0dXAgc2VydmljZXMKKwkgKioqKioqKioqKioqKioqKioqKiovCisJaXdsX3NldHVwX2RlZmVycmVkX3dvcmsocHJpdik7CisJaXdsX3NldHVwX3J4X2hhbmRsZXJzKHByaXYpOworCisJaXdsX3Bvd2VyX2luaXRpYWxpemUocHJpdik7CisJaXdsX3R0X2luaXRpYWxpemUocHJpdik7CisKKwlzbnByaW50Zihwcml2LT5ody0+d2lwaHktPmZ3X3ZlcnNpb24sCisJCSBzaXplb2YocHJpdi0+aHctPndpcGh5LT5md192ZXJzaW9uKSwKKwkJICIlcyIsIGZ3LT5md192ZXJzaW9uKTsKKworCXByaXYtPm5ld19zY2FuX3RocmVzaG9sZF9iZWhhdmlvdXIgPQorCQkhISh1Y29kZV9mbGFncyAmIElXTF9VQ09ERV9UTFZfRkxBR1NfTkVXU0NBTik7CisKKwlwcml2LT5waHlfY2FsaWJfY2hhaW5fbm9pc2VfcmVzZXRfY21kID0KKwkJZnctPnVjb2RlX2NhcGEuc3RhbmRhcmRfcGh5X2NhbGlicmF0aW9uX3NpemU7CisJcHJpdi0+cGh5X2NhbGliX2NoYWluX25vaXNlX2dhaW5fY21kID0KKwkJZnctPnVjb2RlX2NhcGEuc3RhbmRhcmRfcGh5X2NhbGlicmF0aW9uX3NpemUgKyAxOworCisJLyogaW5pdGlhbGl6ZSBhbGwgdmFsaWQgY29udGV4dHMgKi8KKwlpd2xfaW5pdF9jb250ZXh0KHByaXYsIHVjb2RlX2ZsYWdzKTsKKworCS8qKioqKioqKioqKioqKioqKioqKioqKioqK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lsbF9zZXRfaHdfc3RhdGUocHJpdi0+aHctPndpcGh5LCBzdGF0ZSk7CisKKwlyZXR1cm4gZmFsc2U7Cit9CisKK3N0YXRpYyBjb25zdCBzdHJ1Y3QgaXdsX29wX21vZGVfb3BzIGl3bF9kdm1fb3BzID0geworCS5zdGFydCA9IGl3bF9vcF9tb2RlX2R2bV9zdGFydCwKKwkuc3RvcCA9IGl3bF9vcF9tb2RlX2R2bV9zdG9wLAorCS5yeCA9IGl3bF9yeF9kaXNwYXRjaCwKKwkucXVldWVfZnVsbCA9IGl3bF9zdG9wX3N3X3F1ZXVlLAorCS5xdWV1ZV9ub3RfZnVsbCA9IGl3bF93YWtlX3N3X3F1ZXVlLAorCS5od19yZl9raWxsID0gaXdsX3NldF9od19yZmtpbGxfc3RhdGUsCisJLmZyZWVfc2tiID0gaXdsX2ZyZWVfc2tiLAorCS5uaWNfZXJyb3IgPSBpd2xfbmljX2Vycm9yLAorCS5jbWRfcXVldWVfZnVsbCA9IGl3bF9jbWRfcXVldWVfZnVsbCwKKwkubmljX2NvbmZpZyA9IGl3bF9uaWNfY29uZmlnLAorCS53aW1heF9hY3RpdmUgPSBpd2xfd2ltYXhfYWN0aXZlLAorfTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogZHJpdmVyIGFuZCBtb2R1bGUgZW50cnkgcG9pbnQKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgaW50IF9faW5pdCBpd2xfaW5pdCh2b2lkKQoreworCisJaW50IHJldDsKKworCXJldCA9IGl3bGFnbl9yYXRlX2NvbnRyb2xfcmVnaXN0ZXIoKTsKKwlpZiAocmV0KSB7CisJCXByX2VycigiVW5hYmxlIHRvIHJlZ2lzdGVyIHJhdGUgY29udHJvbCBhbGdv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dsLWlvLmgiCisjaW5jbHVkZSAiaXdsLW1vZHBhcmFtcy5oIgorI2luY2x1ZGUgIml3bC1kZWJ1Zy5oIgorI2luY2x1ZGUgImFnbi5oIgorI2luY2x1ZGUgImRldi5oIgorI2luY2x1ZGUgImNvbW1hbmRzLmgiCisjaW5jbHVkZSAidHQuaCIKKworLyogZGVmYXVsdCBUaGVybWFsIFRocm90dGxpbmcgdHJhbnNhY3Rpb24gdGFibGUKKyAqIEN1cnJlbnQgc3RhdGUgICB8ICAgICAgICAgVGhyb3R0bGluZyBEb3duICAgICAgICAgICAgICAgfCAgVGhyb3R0bGluZyBVcAorICo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogICAgICAgICAgICAgICAgIENvbmRpdGlvbiBOeHQgU3RhdGUgIENvbmRpdGlvbiBOeHQgU3RhdGUgQ29uZGl0aW9uIE54dCBTdGF0ZQorICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICogICAgIElXTF9USV8wICAgICBUID49IDExNCAgIENUX0tJTEwgIDExND5UPj0xMDUgICBUSV8xICAgICAgTi9BICAgICAgTi9BCisgKiAgICAgSVdMX1RJXzEgICAgIFQgPj0gMTE0ICAgQ1RfS0lMTCAgMTE0PlQ+PTExMCAgIFRJXzIgICAgIFQ8PTk1ICAgICBUSV8wCisgKiAgICAgSVdMX1RJXzIgICAgIFQgPj0gMTE0ICAgQ1RfS0lMTCAgICAgICAgICAgICAgICAgICAgICAgIFQ8PTEwMCAgICBUSV8xCisgKiAgICBJV0xfQ1RfS0lMTCAgICAgIE4vQSAgICAgICBOL0EgICAgICAgTi9BICAgICAgICBOL0EgICAgIFQ8PTk1ICAgICBUSV8wCisgKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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Y3QgYXMgbXVjaCBhcyBwb3NzaWJsZQorICoKKyAqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqICAgICAgICAgICAgICAgICBDb25kaXRpb24gTnh0IFN0YXRlICBDb25kaXRpb24gTnh0IFN0YXRlIENvbmRpdGlvbiBOeHQgU3RhdGUKKyAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAqICAgICBJV0xfVElfMCAgICAgVCA+PSAxMTQgICBDVF9LSUxMICAxMTQ+VD49MTA1ICAgVElfMSAgICAgIE4vQSAgICAgIE4vQQorICogICAgIElXTF9USV8xICAgICBUID49IDExNCAgIENUX0tJTEwgIDExND5UPj0xMTAgICBUSV8yICAgICBUPD05NSAgICAgVElfMAorICogICAgIElXTF9USV8yICAgICBUID49IDExNCAgIENUX0tJTEwgICAgICAgICAgICAgICAgICAgICAgICBUPD0xMDAgICAgVElfMQorICogICAgSVdMX0NUX0tJTEwgICAgICBOL0EgICAgICAgTi9BICAgICAgIE4vQSAgICAgICAgTi9BICAgICBUPD05NSAgICAgVElfMAorICo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICovCitzdGF0aWMgdm9pZCBpd2xfYWR2YW5jZV90dF9oYW5kbGVyKHN0cnVjdCBpd2xfcHJpdiAqcHJpdiwgczMyIHRlbXAsIGJvb2wgZm9yY2UpCit7CisJc3RydWN0IGl3bF90dF9tZ210ICp0dCA9ICZwcml2LT50aGVybWFsX3Rocm90dGxlOworCWludCBpOworCWJvb2wgY2hhbmdlZCA9IGZhbHNlOworCWVudW0gaXdsX3R0X3N0YXRlIG9sZF9zdGF0ZTsKKwlzdHJ1Y3QgaXdsX3R0X3R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gImFnbi5oIgorI2luY2x1ZGUgImNhbGliLmgiCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiB1Q29kZSBkb3dubG9hZCBmdW5jdGlvbnMKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgaW5saW5lIGNvbnN0IHN0cnVjdCBmd19pbWcgKgoraXdsX2dldF91Y29kZV9pbWFnZShzdHJ1Y3QgaXdsX3ByaXYgKnByaXYsIGVudW0gaXdsX3Vjb2RlX3R5cGUgdWNvZGVfdHlwZSkKK3sKKwlpZiAodWNvZGVfdHlwZSA+PSBJV0xfVUNPREVfVFlQRV9NQVgpCisJCXJldHVybiBOVUxMOworCisJcmV0dXJuICZwcml2LT5mdy0+aW1nW3Vjb2RlX3R5cGVdOworfQorCisvKgorICogIENhbGlicmF0aW9uCisgKi8KK3N0YXRpYyBpbnQgaXdsX3NldF9YdGFsX2NhbGliKHN0cnVjdCBpd2xfcHJpdiAqcHJpdikKK3sKKwlzdHJ1Y3QgaXdsX2NhbGliX3h0YWxfZnJlcV9jbWQgY21kOworCV9fbGUxNiAqeHRhbF9jYWxpYiA9IHByaXYtPm52bV9kYXRhLT54dGFsX2NhbGliOworCisJaXdsX3NldF9jYWxpYl9oZHIoJmNtZC5oZHIsIElXTF9QSFlfQ0FMSUJSQVRFX0NSWVNUQUxfRlJRX0NNRCk7CisJY21kLmNhcF9waW4xID0gbGUxNl90b19jcHUoeHRhbF9jYWxpYlswXSk7CisJY21kLmNhcF9waW4yID0gbGUxNl90b19jcHUoeHRhbF9jYWxpYlsxXSk7CisJcmV0dXJuIGl3bF9jYWxpYl9zZXQocHJpdiwgKHZvaWQgKikmY21kLCBzaXplb2YoY21kKSk7Cit9CisKK3N0YXRpYyBpbnQgaXdsX3N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ZWxlY3RvcgorICovCisjZGVmaW5lIEhCVVNfVEFSR19XUlBUUiAgICAgICAgIChIQlVTX0JBU0UrMHgwNjApCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBDU1IgdmFsdWVzCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyAvKgorICogaG9zdCBpbnRlcnJ1cHQgdGltZW91dCB2YWx1ZQorICogdXNlZCB3aXRoIHNldHRpbmcgaW50ZXJydXB0IGNvYWxlc2NpbmcgdGltZXIKKyAqIHRoZSBDU1JfSU5UX0NPQUxFU0NJTkcgaXMgYW4gOCBiaXQgcmVnaXN0ZXIgaW4gMzItdXNlYyB1bml0CisgKgorICogZGVmYXVsdCBpbnRlcnJ1cHQgY29hbGVzY2luZyB0aW1lciBpcyA2NCB4IDMyID0gMjA0OCB1c2VjcworICovCisjZGVmaW5lIElXTF9IT1NUX0lOVF9USU1FT1VUX01BWAkoMHhGRikKKyNkZWZpbmUgSVdMX0hPU1RfSU5UX1RJTUVPVVRfREVGCSgweDQwKQorI2RlZmluZSBJV0xfSE9TVF9JTlRfVElNRU9VVF9NSU4JKDB4MCkKKyNkZWZpbmUgSVdMX0hPU1RfSU5UX09QRVJfTU9ERQkJQklUKDMxKQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICAgICAgICAgICAgICAgICAgICAgICAgNzAwMC8zMDAwIHNlcmllcyBTSFIgRFRTIGFkZHJlc3NlcyAgICAgICAgICAgICAgICAgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKiBEaW9kZSBSZXN1bHRzIFJlZ2lzdGVyIFN0cnVjdHVyZTogKi8KK2VudW0gZHRk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RUQgQU5EIE9OIEFOWQorICogVEhFT1JZIE9GIExJQUJJTElUWSwgV0hFVEhFUiBJTiBDT05UUkFDVCwgU1RSSUNUIExJQUJJTElUWSwgT1IgVE9SVAorICogKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFCisgKiBPRiBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpbmNsdWRlIDxsaW51eC9jb21wbGV0aW9uLmg+CisjaW5jbHVkZSA8bGludXgvZG1hLW1hcHBpbmcuaD4KKyNpbmNsdWRlIDxsaW51eC9maXJtd2FyZS5oPgorI2luY2x1ZGUgPGxpbnV4L21vZHVsZS5oPgorI2luY2x1ZGUgPGxpbnV4L3ZtYWxsb2MuaD4KKworI2luY2x1ZGUgIml3bC1kcnYuaCIKKyNpbmNsdWRlICJpd2wtY3NyLmgiCisjaW5jbHVkZSAiaXdsLWRlYnVnLmgiCisjaW5jbHVkZSAiaXdsLXRyYW5zLmgiCisjaW5jbHVkZSAiaXdsLW9wLW1vZGUuaCIKKyNpbmNsdWRlICJpd2wtYWduLWh3LmgiCisjaW5jbHVkZSAiaXdsLWZ3LmgiCisjaW5jbHVkZSAiaXdsLWNvbmZpZy5oIgorI2luY2x1ZGUgIml3bC1tb2RwYXJhbXMuaCIKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIG1vZHVsZSBib2lsZXIgcGxhdGUKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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HIElOIEFOWSBXQVkgT1VUIE9GIFRIRSBVU0UKKyAqIE9GIFRISVMgU09GVFdBUkUsIEVWRU4gSUYgQURWSVNFRCBPRiBUSEUgUE9TU0lCSUxJVFkgT0YgU1VDSCBEQU1BR0UuCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNpZm5kZWYgX19pd2xfZHJ2X2hfXworI2RlZmluZSBfX2l3bF9kcnZfaF9fCisjaW5jbHVkZSA8bGludXgvZXhwb3J0Lmg+CisKKy8qIGZvciBhbGwgbW9kdWxlcyAqLworI2RlZmluZSBEUlZfTkFNRSAgICAgICAgIml3bHdpZmkiCisjZGVmaW5lIERSVl9DT1BZUklHSFQJIkNvcHlyaWdodChjKSAyMDAzLSAyMDE1IEludGVsIENvcnBvcmF0aW9uIgorI2RlZmluZSBEUlZfQVVUSE9SICAgICAiPGxpbnV4d2lmaUBpbnRlbC5jb20+IgorCisvKiByYWRpbyBjb25maWcgYml0cyAoYWN0dWFsIHZhbHVlcyBmcm9tIE5WTSBkZWZpbml0aW9uKSAqLworI2RlZmluZSBOVk1fUkZfQ0ZHX0RBU0hfTVNLKHgpICAgKHggJiAweDMpICAgICAgICAgLyogYml0cyAwLTEgICAqLworI2RlZmluZSBOVk1fUkZfQ0ZHX1NURVBfTVNLKHgpICAgKCh4ID4+IDIpICAmIDB4MykgLyogYml0cyAyLTMgICAqLworI2RlZmluZSBOVk1fUkZfQ0ZHX1RZUEVfTVNLKHgpICAgKCh4ID4+IDQpICAmIDB4MykgLyogYml0cyA0LTUgICAqLworI2RlZmluZSBOVk1fUkZfQ0ZHX1BOVU1fTVNLKHgpICAgKCh4ID4+IDYpICAmIDB4MykgLyogYml0cyA2LTcgICAqLworI2RlZmluZSBOVk1fUkZfQ0ZHX1RYX0FOVF9NU0soeCkgKCh4ID4+IDgpICAmIDB4RikgLyogYml0cyA4LTExICAqLworI2RlZmluZSB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5pdGlvbnMgKi8KKworLyogaW5kaXJlY3QgYWNjZXNzIGRlZmluaXRpb25zICovCisjZGVmaW5lIEFERFJFU1NfTVNLICAgICAgICAgICAgICAgICAweDAwMDBGRkZGCisjZGVmaW5lIElORElSRUNUX1RZUEVfTVNLICAgICAgICAgICAweDAwMEYwMDAwCisjZGVmaW5lIElORElSRUNUX0hPU1QgICAgICAgICAgICAgICAweDAwMDEwMDAwCisjZGVmaW5lIElORElSRUNUX0dFTkVSQUwgICAgICAgICAgICAweDAwMDIwMDAwCisjZGVmaW5lIElORElSRUNUX1JFR1VMQVRPUlkgICAgICAgICAweDAwMDMwMDAwCisjZGVmaW5lIElORElSRUNUX0NBTElCUkFUSU9OICAgICAgICAweDAwMDQwMDAwCisjZGVmaW5lIElORElSRUNUX1BST0NFU1NfQURKU1QgICAgICAweDAwMDUwMDAwCisjZGVmaW5lIElORElSRUNUX09USEVSUyAgICAgICAgICAgICAweDAwMDYwMDAwCisjZGVmaW5lIElORElSRUNUX1RYUF9MSU1JVCAgICAgICAgICAweDAwMDcwMDAwCisjZGVmaW5lIElORElSRUNUX1RYUF9MSU1JVF9TSVpFICAgICAweDAwMDgwMDAwCisjZGVmaW5lIElORElSRUNUX0FERFJFU1MgICAgICAgICAgICAweDAwMTAwMDAwCisKKy8qIGNvcnJlc3BvbmRpbmcgbGluayBvZmZzZXRzIGluIEVFUFJPTSAqLworI2RlZmluZSBFRVBST01fTElOS19IT1NUICAgICAgICAgICAgICgyKjB4NjQpCisjZGVmaW5lIEVFUFJPTV9MSU5LX0dFTkVSQUwgICAgICAgICAgKDIqMHg2NSkKKyNkZWZpbmUgRUVQUk9NX0xJTktfUkVHVUxBVE9SWSAgICAgICAoMioweDY2KQorI2RlZmluZSBFRVBST01fTElOS19DQUxJQlJBVElPTiAgICAgICgyKjB4NjcpCisjZGVmaW5lIEVFUFJPTV9MSU5LX1BST0NFU1NfQURKU1QgICAgKDIqMHg2OCkKKyNkZWZpbmUgRUVQUk9NX0xJTktfT1RIRVJTICAgICAgICAgICAoMioweDY5KQorI2RlZmluZSBFRVBST01fTElOS19UWFBfTElNSVQgICAgICAgICgyKjB4NmEpCisjZGVmaW5lIEVFUFJPTV9MSU5LX1RYUF9MSU1JVF9TSVpFICAgKDIqMHg2YikKKworLyogR2VuZXJhbCAqLworI2RlZmluZSBFRVBST01fREVWSUNFX0lEICAgICAgICAgICAgICAgICAgICAoMioweDA4KQkvKiAyIGJ5dGVzICovCisjZGVmaW5lIEVFUFJPTV9TVUJTWVNURU1fSUQJCSAgICAoMioweDBBKQkvKiAyIGJ5dGVzICovCisjZGVmaW5lIEVFUFJPTV9NQUNfQUREUkVTUyAgICAgICAgICAgICAgICAgICgyKjB4MTUpCS8qIDYgIGJ5dGVzICovCisjZGVmaW5lIEVFUFJPTV9CT0FSRF9SRVZJU0lPTiAgICAgICAgICAgICAgICgyKjB4MzUpCS8qIDIgIGJ5dGVzICovCisjZGVmaW5lIEVFUFJPTV9CT0FSRF9QQkFfTlVNQkVSICAgICAgICAgICAgICgyKjB4M0IrMSkJLyogOSAgYnl0ZXMgKi8KKyNkZWZpbmUgRUVQUk9NX1ZFUlNJT04gICAgICAgICAgICAgICAgICAgICAgKDIqMHg0NCkJLyogMiAgYnl0ZXMgKi8KKyNkZWZpbmUgRUVQUk9NX1NLVV9DQVAgICAgICAgICAgICAgICAgICAgICAgKDIqMHg0NSkJLyogMiAgYnl0ZXMgKi8KKyNkZWZpbmUgRUVQUk9NX09FTV9NT0RFICAgICAgICAgICAgICAgICAgICAgKDIqMHg0NikJLyogMiAgYnl0ZXMgKi8KKyNkZWZpbmUgRUVQUk9NX1JBRElPX0NPTkZJRyAgICAgICAgICAgICAgICAgKDIqMHg0OCkJLyogMiAgYnl0ZXMgKi8KKyNkZWZpbmUgRUVQUk9NX05VTV9NQUNfQUREUkVTUyAgICAgICAgICAgICAgKDIqMHg0QykJLyogMiAgYnl0ZXMgKi8KKworLyogY2FsaWJyYXRpb24gKi8KK3N0cnVjdCBpd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wkJcmV0dXJuIC1FTk9FTlQ7CisJfQorfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogT1RQIHJlbGF0ZWQgZnVuY3Rpb25zCisgKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgdm9pZCBpd2xfc2V0X290cF9hY2Nlc3NfYWJzb2x1dGUoc3RydWN0IGl3bF90cmFucyAqdHJhbnMpCit7CisJaXdsX3JlYWQzMih0cmFucywgQ1NSX09UUF9HUF9SRUcpOworCisJaXdsX2NsZWFyX2JpdCh0cmFucywgQ1NSX09UUF9HUF9SRUcsCisJCSAgICAgIENTUl9PVFBfR1BfUkVHX09UUF9BQ0NFU1NfTU9ERSk7Cit9CisKK3N0YXRpYyBpbnQgaXdsX252bV9pc19vdHAoc3RydWN0IGl3bF90cmFucyAqdHJhbnMpCit7CisJdTMyIG90cGdwOworCisJLyogT1RQIG9ubHkgdmFsaWQgZm9yIENQL1BQIGFuZCBhZnRlciAqLworCXN3aXRjaCAodHJhbnMtPmh3X3JldiAmIENTUl9IV19SRVZfVFlQRV9NU0spIHsKKwljYXNlIENTUl9IV19SRVZfVFlQRV9OT05FOgorCQlJV0xfRVJSKHRyYW5zLCAiVW5rbm93biBoYXJkd2FyZSB0eXBlXG4iKTsKKwkJcmV0dXJuIC1FSU87CisJY2FzZSBDU1JfSFdfUkVWX1RZUEVfNTMwMDoKKwljYXNlIENTUl9IV19SRVZfVFlQRV81MzUwOgorCWNhc2UgQ1NSX0hXX1JFVl9UWVBFXzUxMDA6CisJY2FzZSBDU1JfSFdfUkVWX1RZUEVfNTE1MDoKKwkJcmV0dXJuIDA7CisJZGVmYXVsdDoKKwkJb3RwZ3AgPSBpd2xfcmVhZDMyKHRyYW5zLCBDU1JfT1RQX0dQX1JFRy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WSBXQVkgT1VUIE9GIFRIRSBVU0UKKyAqIE9GIFRISVMgU09GVFdBUkUsIEVWRU4gSUYgQURWSVNFRCBPRiBUSEUgUE9TU0lCSUxJVFkgT0YgU1VDSCBEQU1BR0UuCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNpZm5kZWYgX19pd2xfZWVwcm9tX2hfXworI2RlZmluZSBfX2l3bF9lZXByb21faF9fCisKKyNpbmNsdWRlICJpd2wtdHJhbnMuaCIKKworaW50IGl3bF9yZWFkX2VlcHJvbShzdHJ1Y3QgaXdsX3RyYW5zICp0cmFucywgdTggKiplZXByb20sIHNpemVfdCAqZWVwcm9tX3NpemUpOworCisjZW5kaWYgIC8qIF9faXdsX2VlcHJvbV9oX18gKi8KZGlmZiAtLWdpdCBhL2RyaXZlcnMvbmV0L3dpcmVsZXNzL2ludGVsL2l3bHdpZmkvaXdsLWZoLmggYi9kcml2ZXJzL25ldC93aXJlbGVzcy9pbnRlbC9pd2x3aWZpL2l3bC1maC5oCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjVjYzZiZTkyCi0tLSAvZGV2L251bGwKKysrIGIvZHJpdmVycy9uZXQvd2lyZWxlc3MvaW50ZWwvaXdsd2lmaS9pd2wtZmguaApAQCAtMCwwICsxLDUzNSBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIFRoaXMgZmlsZSBpcyBwcm92aWRlZCB1bmRlciBhIGR1YWwgQlNEL0dQTHYyIGxpY2Vuc2UuICBXaGVuIHVzaW5nIG9yCisgKiByZWRpc3RyaWJ1dGluZyB0aGlzIGZpbGUsIHlvdSBtYXkgZG8gc28gdW5kZXIgZWl0aGVyIGxpY2Vuc2UuCisgKgorICogR1BMIExJQ0VOU0Ug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UiBDQVVTRUQgQU5EIE9OIEFOWQorICogVEhFT1JZIE9GIExJQUJJTElUWSwgV0hFVEhFUiBJTiBDT05UUkFDVCwgU1RSSUNUIExJQUJJTElUWSwgT1IgVE9SVAorICogKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFCisgKiBPRiBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZm5kZWYgX19pd2xfZmhfaF9fCisjZGVmaW5lIF9faXdsX2ZoX2hfXworCisjaW5jbHVkZSA8bGludXgvdHlwZXMuaD4KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBGbG93IEhhbmRsZXIgRGVmaW5pdGlvbnMgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKioKKyAqIFRoaXMgSS9PIGFyZWEgaXMgZGlyZWN0bHkgcmVhZC93cml0YWJsZSBieSBkcml2ZXIgKGUuZy4gTGludXggdXNlcyB3cml0ZWwoKSkKKyAqIEFkZHJlc3NlcyBhcmUgb2Zmc2V0cyBmcm9tIGRldmljZSdzIFBDSSBoYXJkd2FyZSBiYXNlIGFkZHJlc3MuCisgKi8KKyNkZWZpbmUgRkhfTUVNX0xPV0VSX0JPVU5EICAgICAgICAgICAgICAgICAgICgweDEwMDApCisjZGVmaW5lIEZIX01FTV9VUFBFUl9CT1VORCAgICAgICAgICAgICAgICAgICAoMHgyMDAwKQorCisvKioKKyAqIEtlZXAtV2FybSAoS1cpIGJ1ZmZlciBiYXNlIGFkZHJlc3MuCisgKgorICogRHJpdmVyIG11c3QgYWxsb2NhdGUgYSA0S0J5dGUgYnVmZmV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1bnNpZ25lZCBsb25nICpmbGFncykKK3sKKwl0cmFucy0+b3BzLT5yZWxlYXNlX25pY19hY2Nlc3ModHJhbnMsIGZsYWdzKTsKKwlfX3JlbGVhc2UobmljX2FjY2Vzcyk7Cit9CisKK3N0YXRpYyBpbmxpbmUgdm9pZCBpd2xfdHJhbnNfZndfZXJyb3Ioc3RydWN0IGl3bF90cmFucyAqdHJhbnMpCit7CisJaWYgKFdBUk5fT05fT05DRSghdHJhbnMtPm9wX21vZGUpKQorCQlyZXR1cm47CisKKwkvKiBwcmV2ZW50IGRvdWJsZSByZXN0YXJ0cyBkdWUgdG8gdGhlIHNhbWUgZXJyb25lb3VzIEZXICovCisJaWYgKCF0ZXN0X2FuZF9zZXRfYml0KFNUQVRVU19GV19FUlJPUiwgJnRyYW5zLT5zdGF0dXMpKQorCQlpd2xfb3BfbW9kZV9uaWNfZXJyb3IodHJhbnMtPm9wX21vZGUpOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIHRyYW5zcG9ydCBoZWxwZXIgZnVuY3Rpb25zCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdHJ1Y3QgaXdsX3RyYW5zICppd2xfdHJhbnNfYWxsb2ModW5zaWduZWQgaW50IHByaXZfc2l6ZSwKKwkJCQkgIHN0cnVjdCBkZXZpY2UgKmRldiwKKwkJCQkgIGNvbnN0IHN0cnVjdCBpd2xfY2ZnICpjZmcsCisJCQkJICBjb25zdCBzdHJ1Y3QgaXdsX3RyYW5zX29wcyAqb3BzLAorCQkJCSAgc2l6ZV90IGRldl9jbWRfaGVhZHJvb20pOwordm9pZCBpd2xfdHJhbnNfZnJlZShzdHJ1Y3QgaXdsX3RyYW5zICp0cmFucyk7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiBkcml2ZXIgKHRyYW5zcG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UpKQorCQlyZXR1cm4gLUVJTlZBTDsKKworCXJldHVybiBpd2xfbXZtX2JpbmRpbmdfdXBkYXRlKG12bSwgdmlmLCBtdm12aWYtPnBoeV9jdHh0LCB0cnVlKTsKK30KKworaW50IGl3bF9tdm1fYmluZGluZ19yZW1vdmVfdmlmKHN0cnVjdCBpd2xfbXZtICptdm0sIHN0cnVjdCBpZWVlODAyMTFfdmlmICp2aWYpCit7CisJc3RydWN0IGl3bF9tdm1fdmlmICptdm12aWYgPSBpd2xfbXZtX3ZpZl9mcm9tX21hYzgwMjExKHZpZik7CisJaW50IHJldDsKKworCWlmIChXQVJOX09OX09OQ0UoIW12bXZpZi0+cGh5X2N0eHQpKQorCQlyZXR1cm4gLUVJTlZBTDsKKworCXJldCA9IGl3bF9tdm1fYmluZGluZ191cGRhdGUobXZtLCB2aWYsIG12bXZpZi0+cGh5X2N0eHQsIGZhbHNlKTsKKworCWlmICghcmV0KQorCQlpZiAoaXdsX212bV9zZl91cGRhdGUobXZtLCB2aWYsIHRydWUpKQorCQkJSVdMX0VSUihtdm0sICJGYWlsZWQgdG8gdXBkYXRlIFNGIHN0YXRlXG4iKTsKKworCXJldHVybiByZXQ7Cit9CmRpZmYgLS1naXQgYS9kcml2ZXJzL25ldC93aXJlbGVzcy9pbnRlbC9pd2x3aWZpL212bS9jb2V4LmMgYi9kcml2ZXJzL25ldC93aXJlbGVzcy9pbnRlbC9pd2x3aWZpL212bS9jb2V4LmMKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMmUwOThmOAotLS0gL2Rldi9udWxsCisrKyBiL2RyaXZlcnMvbmV0L3dpcmVsZXNzL2ludGVsL2l3bHdpZmkvbXZtL2NvZXguYwpAQCAtMCwwICsxLDEwMDggQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBUaGlzIGZpbGUgaXMgcH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SBPRiBTVUNIIERBTUFHRS4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaW5jbHVkZSA8bGludXgvdm1hbGxvYy5oPgorCisjaW5jbHVkZSAibXZtLmgiCisjaW5jbHVkZSAiZnctZGJnLmgiCisjaW5jbHVkZSAic3RhLmgiCisjaW5jbHVkZSAiaXdsLWlvLmgiCisjaW5jbHVkZSAiZGVidWdmcy5oIgorI2luY2x1ZGUgIml3bC1mdy1lcnJvci1kdW1wLmgiCisKK3N0YXRpYyBzc2l6ZV90IGl3bF9kYmdmc190eF9mbHVzaF93cml0ZShzdHJ1Y3QgaXdsX212bSAqbXZtLCBjaGFyICpidWYsCisJCQkJCXNpemVfdCBjb3VudCwgbG9mZl90ICpwcG9zKQoreworCWludCByZXQ7CisJdTMyIHNjZF9xX21zazsKKworCWlmICghbXZtLT51Y29kZV9sb2FkZWQgfHwgbXZtLT5jdXJfdWNvZGUgIT0gSVdMX1VDT0RFX1JFR1VMQVIpCisJCXJldHVybiAtRUlPOworCisJaWYgKHNzY2FuZihidWYsICIleCIsICZzY2RfcV9tc2spICE9IDEpCisJCXJldHVybiAtRUlOVkFMOworCisJSVdMX0VSUihtdm0sICJGTFVTSElORyBxdWV1ZXM6IHNjZF9xX21zayA9IDB4JXhcbiIsIHNjZF9xX21zayk7CisKKwltdXRleF9sb2NrKCZtdm0tPm11dGV4KTsKKwlyZXQgPSAgaXdsX212bV9mbHVzaF90eF9wYXRoKG12bSwgc2NkX3FfbXNrLCAwKSA/IDogY291bnQ7CisJbXV0ZXhfdW5sb2NrKCZtdm0tPm11dGV4KTsKKworCXJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBzc2l6ZV90IGl3bF9kYmdmc19zdGFfZHJhaW5fd3JpdGUoc3RydWN0IGl3bF9tdm0gKm12bSwgY2hhciAqYnVmLAorCQkJCQkgc2l6ZV90IGNvdW50LCBsb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IE9SIEJVU0lORVNTIElOVEVSUlVQVElPTikgSE9XRVZFUiBDQVVTRUQgQU5EIE9OIEFOWQorICogVEhFT1JZIE9GIExJQUJJTElUWSwgV0hFVEhFUiBJTiBDT05UUkFDVCwgU1RSSUNUIExJQUJJTElUWSwgT1IgVE9SVAorICogKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFCisgKiBPRiBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjaWZuZGVmIF9fZndfYXBpX2QzX2hfXworI2RlZmluZSBfX2Z3X2FwaV9kM19oX18KKworLyoqCisgKiBlbnVtIGl3bF9kM193YWtldXBfZmxhZ3MgLSBEMyBtYW5hZ2VyIHdha2V1cCBmbGFncworICogQElXTF9XQUtFVVBfRDNfQ09ORklHX0ZXX0VSUk9SOiB3YWtlIHVwIG9uIGZpcm13YXJlIHN5c2Fzc2VydAorICovCitlbnVtIGl3bF9kM193YWtldXBfZmxhZ3MgeworCUlXTF9XQUtFVVBfRDNfQ09ORklHX0ZXX0VSUk9SID0gQklUKDApLAorfTsgLyogRDNfTUFOQUdFUl9XQUtFVVBfQ09ORklHX0FQSV9FX1ZFUl8zICovCisKKy8qKgorICogc3RydWN0IGl3bF9kM19tYW5hZ2VyX2NvbmZpZyAtIEQzIG1hbmFnZXIgY29uZmlndXJhdGlvbiBjb21tYW5kCisgKiBAbWluX3NsZWVwX3RpbWU6IG1pbmltdW0gc2xlZXAgdGltZSAoaW4gdXNlYykKKyAqIEB3YWtldXBfZmxhZ3M6IHdha2V1cCBmbGFncywgc2VlICZlbnVtIGl3bF9kM193YWtldXBfZmxhZ3MKKyAqIE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hbm5lbCwgb3RoZXJ3aXNlIGxvd2VyLgorICogRm9yIFZIVCAtIGJpdC0yIG1hcmtzIGlmIHRoZSBjb250cm9sIGlzIGxvd2VyL3VwcGVyIHJlbGF0aXZlIHRvIGNlbnRlci1mcmVxCisgKiAgIGJpdHMtMTowIG1hcmsgdGhlIGRpc3RhbmNlIGZyb20gdGhlIGNlbnRlciBmcmVxLiBmb3IgMjBNaHosIG9mZnNldCBpcyAwLgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNlbnRlcl9mcmVxCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8CisgKiA0ME1oeiAgICAgICAgICAgICAgICAgICAgICAgICAgfF9fX19fX198X19fX19fX3wKKyAqIDgwTWh6ICAgICAgICAgICAgICAgICAgfF9fX19fX198X19fX19fX3xfX19fX19ffF9fX19fX198CisgKiAxNjBNaHogfF9fX19fX198X19fX19fX3xfX19fX19ffF9fX19fX198X19fX19fX3xfX19fX19ffF9fX19fX198X19fX19fX3wKKyAqIGNvZGUgICAgICAwMTEgICAgIDAxMCAgICAgMDAxICAgICAwMDAgIHwgIDEwMCAgICAgMTAxICAgICAxMTAgICAgMTExCisgKi8KKyNkZWZpbmUgUEhZX1ZIVF9DVFJMX1BPU18xX0JFTE9XICAoMHgwKQorI2RlZmluZSBQSFlfVkhUX0NUUkxfUE9TXzJfQkVMT1cgICgweDEpCisjZGVmaW5lIFBIWV9WSFRfQ1RSTF9QT1NfM19CRUxPVyAgKDB4MikKKyNkZWZpbmUgUEhZX1ZIVF9DVFJMX1BPU180X0JFTE9XICAoMHgzKQorI2RlZmluZSBQSFlfVkhUX0NUUkxfUE9TXzFfQUJPVkUgICgweDQpCisjZGVmaW5lIFBIWV9WSFRfQ1RSTF9QT1NfMl9BQk9WRSAgKDB4NSkKKyNkZWZpbmUgUEhZX1ZIVF9DVFJMX1BPU18zX0FCT1ZFICAoMHg2KQorI2RlZmluZSBQSFlfVkhUX0NUUkx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nJheSBzaXplLgorCSAqLworCUJVSUxEX0JVR19PTihBUlJBWV9TSVpFKG12bS0+ZndfaWRfdG9fbWFjX2lkKSAhPSBJV0xfTVZNX1NUQVRJT05fQ09VTlQpOworCisJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisJICogMS4gQWxsb2NhdGluZyBhbmQgY29uZmlndXJpbmcgSFcgZGF0YQorCSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwlodyA9IGllZWU4MDIxMV9hbGxvY19odyhzaXplb2Yoc3RydWN0IGl3bF9vcF9tb2RlKSArCisJCQkJc2l6ZW9mKHN0cnVjdCBpd2xfbXZtKSwKKwkJCQkmaXdsX212bV9od19vcHMpOworCWlmICghaHcpCisJCXJldHVybiBOVUxMOworCisJaWYgKGNmZy0+bWF4X3J4X2FnZ19zaXplKQorCQlody0+bWF4X3J4X2FnZ3JlZ2F0aW9uX3N1YmZyYW1lcyA9IGNmZy0+bWF4X3J4X2FnZ19zaXplOworCisJaWYgKGNmZy0+bWF4X3R4X2FnZ19zaXplKQorCQlody0+bWF4X3R4X2FnZ3JlZ2F0aW9uX3N1YmZyYW1lcyA9IGNmZy0+bWF4X3R4X2FnZ19zaXplOworCisJb3BfbW9kZSA9IGh3LT5wcml2OworCisJbXZtID0gSVdMX09QX01PREVfR0VUX01WTShvcF9tb2RlKTsKKwltdm0tPmRldiA9IHRyYW5zLT5kZXY7CisJbXZtLT50cmFucyA9IHRyYW5zOworCW12bS0+Y2ZnID0gY2ZnOworCW12bS0+ZncgPSBmdzsKKwltdm0tPmh3ID0gaHc7CisKKwlpZiAoaXdsX212bV9oYXNfbmV3X3J4X2FwaShtdm0pKSB7CisJCW9wX21vZGUtPm9wcyA9ICZpd2xfbXZtX29wc19tcTsKKwl9IGVsc2UgeworCQlvcF9tb2RlLT5vcHMgPSAmaXdsX212bV9vcHM7CisKKwkJaWYgKFdBUk5fT04odHJhbnMtPm51bV9yeF9xdWV1ZXMgPiAxKSkKKwk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eXBlKSA9PSBMUV9MRUdBQ1lfRykKKworI2RlZmluZSBpc19sZWdhY3kocmF0ZSkgICAgICAgaXNfdHlwZV9sZWdhY3koKHJhdGUpLT50eXBlKQorI2RlZmluZSBpc19odF9zaXNvKHJhdGUpICAgICAgaXNfdHlwZV9odF9zaXNvKChyYXRlKS0+dHlwZSkKKyNkZWZpbmUgaXNfaHRfbWltbzIocmF0ZSkgICAgIGlzX3R5cGVfaHRfbWltbzIoKHJhdGUpLT50eXBlKQorI2RlZmluZSBpc192aHRfc2lzbyhyYXRlKSAgICAgaXNfdHlwZV92aHRfc2lzbygocmF0ZSktPnR5cGUpCisjZGVmaW5lIGlzX3ZodF9taW1vMihyYXRlKSAgICBpc190eXBlX3ZodF9taW1vMigocmF0ZSktPnR5cGUpCisjZGVmaW5lIGlzX3Npc28ocmF0ZSkgICAgICAgICBpc190eXBlX3Npc28oKHJhdGUpLT50eXBlKQorI2RlZmluZSBpc19taW1vMihyYXRlKSAgICAgICAgaXNfdHlwZV9taW1vMigocmF0ZSktPnR5cGUpCisjZGVmaW5lIGlzX21pbW8ocmF0ZSkgICAgICAgICBpc190eXBlX21pbW8oKHJhdGUpLT50eXBlKQorI2RlZmluZSBpc19odChyYXRlKSAgICAgICAgICAgaXNfdHlwZV9odCgocmF0ZSktPnR5cGUpCisjZGVmaW5lIGlzX3ZodChyYXRlKSAgICAgICAgICBpc190eXBlX3ZodCgocmF0ZSktPnR5cGUpCisjZGVmaW5lIGlzX2FfYmFuZChyYXRlKSAgICAgICBpc190eXBlX2FfYmFuZCgocmF0ZSktPnR5cGUpCisjZGVmaW5lIGlzX2dfYmFuZChyYXRlKSAgICAgICBpc190eXBlX2dfYmFuZCgocmF0ZSktPnR5cGUpCisKKyNkZWZpbmUgaXNfaHQyMChyYXRlKSAgICAgICAgICgocmF0ZSktPmJ3ID09IFJBVEVfTUNTX0NIQU5fV0lEVEhfMjApCisjZGVmaW5lIGlzX2h0NDAocmF0ZSkgICAgICAgICAoKHJhdG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IE9GIFRIRSBQT1NTSUJJTElUWSBPRiBTVUNIIERBTUFHRS4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaW5jbHVkZSA8bmV0L21hYzgwMjExLmg+CisKKyNpbmNsdWRlICJpd2wtZGVidWcuaCIKKyNpbmNsdWRlICJpd2wtaW8uaCIKKyNpbmNsdWRlICJpd2wtcHJwaC5oIgorI2luY2x1ZGUgImZ3LWRiZy5oIgorI2luY2x1ZGUgIm12bS5oIgorI2luY2x1ZGUgImZ3LWFwaS1ycy5oIgorCisvKgorICogV2lsbCByZXR1cm4gMCBldmVuIGlmIHRoZSBjbWQgZmFpbGVkIHdoZW4gUkZLSUxMIGlzIGFzc2VydGVkIHVubGVzcworICogQ01EX1dBTlRfU0tCIGlzIHNldCBpbiBjbWQtPmZsYWdzLgorICovCitpbnQgaXdsX212bV9zZW5kX2NtZChzdHJ1Y3QgaXdsX212bSAqbXZtLCBzdHJ1Y3QgaXdsX2hvc3RfY21kICpjbWQpCit7CisJaW50IHJldDsKKworI2lmIGRlZmluZWQoQ09ORklHX0lXTFdJRklfREVCVUdGUykgJiYgZGVmaW5lZChDT05GSUdfUE1fU0xFRVApCisJaWYgKFdBUk5fT04obXZtLT5kM190ZXN0X2FjdGl2ZSkpCisJCXJldHVybiAtRUlPOworI2VuZGlmCisKKwkvKgorCSAqIFN5bmNocm9ub3VzIGNvbW1hbmRzIGZyb20gdGhpcyBvcC1tb2RlIG11c3QgaG9sZAorCSAqIHRoZSBtdXRleCwgdGhpcyBlbnN1cmVzIHdlIGRvbid0IHRyeSB0byBzZW5kIHR3bworCSAqIChvciBtb3JlKSBzeW5jaHJvbm91cyBjb21tYW5kcyBhdCBhIHRpbWUuCisJICovCisJaWYgKCEoY21kLT5mbGFncyAmIENNRF9BU1lOQykpCisJCWxvY2tkZXBfYXNzZXJ0X2hlbGQoJm12bS0+bXV0ZXg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ioqKioqKioqKgorKiBSWAorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworaW50IGl3bF9wY2llX3J4X2luaXQoc3RydWN0IGl3bF90cmFucyAqdHJhbnMpOworaXJxcmV0dXJuX3QgaXdsX3BjaWVfaXJxX2hhbmRsZXIoaW50IGlycSwgdm9pZCAqZGV2X2lkKTsKK2ludCBpd2xfcGNpZV9yeF9zdG9wKHN0cnVjdCBpd2xfdHJhbnMgKnRyYW5zKTsKK3ZvaWQgaXdsX3BjaWVfcnhfZnJlZShzdHJ1Y3QgaXdsX3RyYW5zICp0cmFucyk7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiBJQ1QgLSBpbnRlcnJ1cHQgaGFuZGxpbmcKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK2lycXJldHVybl90IGl3bF9wY2llX2lzcihpbnQgaXJxLCB2b2lkICpkYXRhKTsKK2ludCBpd2xfcGNpZV9hbGxvY19pY3Qoc3RydWN0IGl3bF90cmFucyAqdHJhbnMpOwordm9pZCBpd2xfcGNpZV9mcmVlX2ljdChzdHJ1Y3QgaXdsX3RyYW5zICp0cmFucyk7Cit2b2lkIGl3bF9wY2llX3Jlc2V0X2ljdChzdHJ1Y3QgaXdsX3RyYW5zICp0cmFucyk7Cit2b2lkIGl3bF9wY2llX2Rpc2FibGVfaWN0KHN0cnVjdCBpd2xfdHJhbnMgKnRyYW5zKTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqIFRYIC8gSENNRAorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworaW50IGl3bF9wY2llX3R4X2luaXQoc3RydWN0IGl3bF90cmFucyAqdHJhbnMpOwordm9pZCBpd2xfcGNpZV90eF9zdGFydChz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IGludCB0eHFfaWQsIGludCBzc24sCisJCQkgICAgc3RydWN0IHNrX2J1ZmZfaGVhZCAqc2ticyk7Cit2b2lkIGl3bF90cmFuc19wY2llX3R4X3Jlc2V0KHN0cnVjdCBpd2xfdHJhbnMgKnRyYW5zKTsKKwordm9pZCBpd2xfdHJhbnNfcGNpZV9yZWYoc3RydWN0IGl3bF90cmFucyAqdHJhbnMpOwordm9pZCBpd2xfdHJhbnNfcGNpZV91bnJlZihzdHJ1Y3QgaXdsX3RyYW5zICp0cmFucyk7CisKK3N0YXRpYyBpbmxpbmUgdTE2IGl3bF9wY2llX3RmZF90Yl9nZXRfbGVuKHN0cnVjdCBpd2xfdGZkICp0ZmQsIHU4IGlkeCkKK3sKKwlzdHJ1Y3QgaXdsX3RmZF90YiAqdGIgPSAmdGZkLT50YnNbaWR4XTsKKworCXJldHVybiBsZTE2X3RvX2NwdSh0Yi0+aGlfbl9sZW4pID4+IDQ7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiBFcnJvciBoYW5kbGluZworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwordm9pZCBpd2xfcGNpZV9kdW1wX2NzcihzdHJ1Y3QgaXdsX3RyYW5zICp0cmFucyk7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiBIZWxwZXJzCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgaW5saW5lIHZvaWQgaXdsX2Rpc2FibGVfaW50ZXJydXB0cyhzdHJ1Y3QgaXdsX3RyYW5zICp0cmFucykKK3sKKwljbGVhcl9iaXQoU1RBVFVTX0lOVF9FTkFCTEVELCAmdHJhbnMtPnN0YXR1cyk7CisKKwkvKiBkaXNhYmxlIGludGVycnVwdHMgZnJvbSB1Q29kZS9OSUMg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obGluaywgcHJpc20yX2ludGVycnVwdCk7CisJaWYgKHJldCkKKwkJZ290byBmYWlsZWQ7CisKKwlyZXQgPSBwY21jaWFfZW5hYmxlX2RldmljZShsaW5rKTsKKwlpZiAocmV0KQorCQlnb3RvIGZhaWxlZDsKKworCXNwaW5fbG9ja19pcnFzYXZlKCZsb2NhbC0+aXJxX2luaXRfbG9jaywgZmxhZ3MpOworCWRldi0+aXJxID0gbGluay0+aXJxOworCWRldi0+YmFzZV9hZGRyID0gbGluay0+cmVzb3VyY2VbMF0tPnN0YXJ0OworCXNwaW5fdW5sb2NrX2lycXJlc3RvcmUoJmxvY2FsLT5pcnFfaW5pdF9sb2NrLCBmbGFncyk7CisKKwlsb2NhbC0+c2h1dGRvd24gPSAwOworCisJc2FuZGlza19lbmFibGVfd2lyZWxlc3MoZGV2KTsKKworCXJldCA9IHByaXNtMl9od19jb25maWcoZGV2LCAxKTsKKwlpZiAoIXJldCkKKwkJcmV0ID0gaG9zdGFwX2h3X3JlYWR5KGRldik7CisKKwlyZXR1cm4gcmV0OworCisgZmFpbGVkOgorCWtmcmVlKGh3X3ByaXYpOworCXByaXNtMl9yZWxlYXNlKCh1X2xvbmcpbGluayk7CisJcmV0dXJuIHJldDsKK30KKworCitzdGF0aWMgdm9pZCBwcmlzbTJfcmVsZWFzZSh1X2xvbmcgYXJnKQoreworCXN0cnVjdCBwY21jaWFfZGV2aWNlICpsaW5rID0gKHN0cnVjdCBwY21jaWFfZGV2aWNlICopYXJnOworCisJUERFQlVHKERFQlVHX0ZMT1csICJwcmlzbTJfcmVsZWFzZVxuIik7CisKKwlpZiAobGluay0+cHJpdikgeworCQlzdHJ1Y3QgbmV0X2RldmljZSAqZGV2ID0gbGluay0+cHJpdjsKKwkJc3RydWN0IGhvc3RhcF9pbnRlcmZhY2UgKmlmYWNlOworCisJCWlmYWNlID0gbmV0ZGV2X3ByaXYoZGV2KTsKKwkJcHJpc20yX2h3X3NodXRkb3duKGRldiwgMCk7CisJCWlmYWN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FJMX1NUQVRfUkFNQk9PVDsKKwlpc2wzOHh4X3czMl9mbHVzaChkZXZpY2VfYmFzZSwgcmVnLCBJU0wzOFhYX0NUUkxfU1RBVF9SRUcpOworCXdtYigpOworCXVkZWxheShJU0wzOFhYX1dSSVRFSU9fREVMQVkpOworCisJLyogc2V0IHRoZSByZXNldCBiaXQgbGF0Y2hlcyB0aGUgaG9zdCBvdmVycmlkZSBhbmQgUkFNQm9vdCBiaXRzCisJICogaW50byB0aGUgZGV2aWNlIGZvciBvcGVyYXRpb24gd2hlbiB0aGUgcmVzZXQgYml0IGlzIHJlc2V0ICovCisJcmVnIHw9IElTTDM4WFhfQ1RSTF9TVEFUX1JFU0VUOworCXdyaXRlbChyZWcsIGRldmljZV9iYXNlICsgSVNMMzhYWF9DVFJMX1NUQVRfUkVHKTsKKwkvKiBkb24ndCBkbyBmbHVzaCBQQ0kgcG9zdGluZyBoZXJlISAqLworCXdtYigpOworCXVkZWxheShJU0wzOFhYX1dSSVRFSU9fREVMQVkpOworCisJLyogY2xlYXIgdGhlIHJlc2V0IGJpdCBzaG91bGQgc3RhcnQgdGhlIHdob2xlIGNpcmN1cyAqLworCXJlZyAmPSB+SVNMMzhYWF9DVFJMX1NUQVRfUkVTRVQ7CisJd3JpdGVsKHJlZywgZGV2aWNlX2Jhc2UgKyBJU0wzOFhYX0NUUkxfU1RBVF9SRUcpOworCS8qIGRvbid0IGRvIGZsdXNoIFBDSSBwb3N0aW5nIGhlcmUhICovCisJd21iKCk7CisJdWRlbGF5KElTTDM4WFhfV1JJVEVJT19ERUxBWSk7CisKKwlyZXR1cm4gMDsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgIERldmljZSBJbnRlcnJ1cHQgSGFuZGxlcgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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0cnVjdHVyZXMgYXJlIGNsZWFuZWQgdXAsIHVwbG9hZAorCSAqIGZpcm13YXJlIGFuZCByZXNldCBpbnRlcmZhY2UgKi8KKwkJcmMgPSBpc2xwY2lfdXBsb2FkX2Z3KHByaXYpOworCQlpZiAocmMpIHsKKwkJCXByaW50ayhLRVJOX0VSUiAiJXM6IGlzbHBjaV9yZXNldDogZmFpbHVyZVxuIiwKKwkJCQlwcml2LT5uZGV2LT5uYW1lKTsKKwkJCXJldHVybiByYzsKKwkJfQorCX0KKworCS8qIGZpbmFsbHkgcmVzZXQgaW50ZXJmYWNlICovCisJcmMgPSBpc2xwY2lfcmVzZXRfaWYocHJpdik7CisJaWYgKHJjKQorCQlwcmludGsoS0VSTl9FUlIgInByaXNtNTQ6IFlvdXIgY2FyZC9zb2NrZXQgbWF5IGJlIGZhdWx0eSwgb3IgSVJRIGxpbmUgdG9vIGJ1c3kgOihcbiIpOworCXJldHVybiByYzsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgIE5ldHdvcmsgZGV2aWNlIGNvbmZpZ3VyYXRpb24gZnVuY3Rpb25zCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgaW50Citpc2xwY2lfYWxsb2NfbWVtb3J5KGlzbHBjaV9wcml2YXRlICpwcml2KQoreworCWludCBjb3VudGVyOworCisjaWYgVkVSQk9TRSA+IFNIT1dfRVJST1JfTUVTU0FHRVMKKwlwcmludGsoS0VSTl9ERUJVRyAiaXNscGNpX2FsbG9jX21lbW9yeVxuIik7CisjZW5kaWYKKworCS8qIHJlbWFwIHRoZSBQQ0kgZGV2aWNlIGJhc2UgYWRkcmVzcyB0byBhY2Nlc3NpYmxlICovCisJaWYgKCEocHJpdi0+ZGV2aWNlX2Jhc2UgPQorCSA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qLworCisjaW5jbHVkZSA8bGludXgvbW9kdWxlLmg+CisjaW5jbHVkZSA8bGludXgvZ2ZwLmg+CisKKyNpbmNsdWRlIDxsaW51eC9wY2kuaD4KKyNpbmNsdWRlIDxsaW51eC9kZWxheS5oPgorI2luY2x1ZGUgPGxpbnV4L25ldGRldmljZS5oPgorI2luY2x1ZGUgPGxpbnV4L2V0aGVyZGV2aWNlLmg+CisjaW5jbHVkZSA8bGludXgvaWZfYXJwLmg+CisjaW5jbHVkZSA8YXNtL2J5dGVvcmRlci5oPgorCisjaW5jbHVkZSAicHJpc21jb21wYXQuaCIKKyNpbmNsdWRlICJpc2xfMzh4eC5oIgorI2luY2x1ZGUgImlzbHBjaV9ldGguaCIKKyNpbmNsdWRlICJpc2xwY2lfbWd0LmgiCisjaW5jbHVkZSAib2lkX21ndC5oIgorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgTmV0d29yayBJbnRlcmZhY2UgZnVuY3Rpb25zCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCit2b2lkCitpc2xwY2lfZXRoX2NsZWFudXBfdHJhbnNtaXQoaXNscGNpX3ByaXZhdGUgKnByaXYsCisJCQkgICAgaXNsMzh4eF9jb250cm9sX2Jsb2NrICpjb250cm9sX2Jsb2NrKQoreworCXN0cnVjdCBza19idWZmICpza2I7CisJdTMyIGluZGV4OworCisJLyogY29tcGFyZSB0aGUgY29udHJvbCBibG9jayByZWFkIHBvaW50ZXIgd2l0aCB0aGUgZnJlZSBwb2ludGVyICovCisJd2hpbGUgKHByaXYtPmZyZWVfZGF0YV90eCAhPQorCSAgICAgICBsZTMyX3RvX2NwdShjb250cm9sX2Jsb2NrLT4KKwkJCSAgIGRldmljZV9jdXJyX2ZyYWdbSVNMMzhYWF9DQl9UWF9EQVRBX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hdC5oIgorI2luY2x1ZGUgImlzbF8zOHh4LmgiCisjaW5jbHVkZSAiaXNscGNpX21ndC5oIgorI2luY2x1ZGUgImlzbF9vaWQuaCIJCS8qIGFkZGl0aW9uYWwgdHlwZXMgYW5kIGRlZnMgZm9yIGlzbDM4eHggZncgKi8KKyNpbmNsdWRlICJpc2xfaW9jdGwuaCIKKworI2luY2x1ZGUgPG5ldC9pd19oYW5kbGVyLmg+CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgR2xvYmFsIHZhcmlhYmxlIGRlZmluaXRpb24gc2VjdGlvbgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworaW50IHBjX2RlYnVnID0gVkVSQk9TRTsKK21vZHVsZV9wYXJhbShwY19kZWJ1ZywgaW50LCAwKTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgIERyaXZlciBnZW5lcmFsIGZ1bmN0aW9ucworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmIFZFUkJPU0UgPiBTSE9XX0VSUk9SX01FU1NBR0VTCit2b2lkCitkaXNwbGF5X2J1ZmZlcihjaGFyICpidWZmZXIsIGludCBsZW5ndGgpCit7CisJaWYgKChwY19kZWJ1ZyAmIFNIT1dfQlVGRkVSX0NPTlRFTlRTKSA9PSAwKQorCQlyZXR1cm47CisKKwl3aGlsZSAobGVuZ3RoID4gMCkgeworCQlwcmludGsoIlslMDJ4XSIsICpidWZmZXIgJiAyNTUpOworCQlsZW5ndGgtLTsKKwkJYnVmZmVyKys7CisJfQorCisJcHJpbnRrKCJcbiIpOworfQorI2VuZGlmCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgIFF1ZXVlIGhhbmRsaW5nIGZvciBtYW5hZ2VtZW50IGZyYW1lcworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKgorICogSGVscGVyIGZ1bmN0aW9uIHRvIGNyZWF0ZSBhIFBJTUZPUiBtYW5hZ2VtZW50IGZyYW1lIGhlYWRlci4KKyAqLworc3RhdGljIHZvaWQKK3BpbWZvcl9lbmNvZGVfaGVhZGVyKGludCBvcGVyYXRpb24sIHUzMiBvaWQsIHUzMiBsZW5ndGgsIHBpbWZvcl9oZWFkZXJfdCAqaCkKK3sKKwloLT52ZXJzaW9uID0gUElNRk9SX1ZFUlNJT047CisJaC0+b3BlcmF0aW9uID0gb3BlcmF0aW9uOworCWgtPmRldmljZV9pZCA9IFBJTUZPUl9ERVZfSURfTUhMSV9NSUI7CisJaC0+ZmxhZ3MgPSAwOworCWgtPm9pZCA9IGNwdV90b19iZTMyKG9pZCk7CisJaC0+bGVuZ3RoID0gY3B1X3RvX2JlMzIobGVuZ3RoKTsKK30KKworLyoKKyAqIEhlbHBlciBmdW5jdGlvbiB0byBhbmFseXplIGEgUElNRk9SIG1hbmFnZW1lbnQgZnJhbWUgaGVhZGVyLgorICovCitzdGF0aWMgcGltZm9yX2hlYWRlcl90ICoKK3BpbWZvcl9kZWNvZGVfaGVhZGVyKHZvaWQgKmRhdGEsIGludCBsZW4pCit7CisJcGltZm9yX2hlYWRlcl90ICpoID0gZGF0YTsKKworCXdoaWxlICgodm9pZCAqKSBoIDwgZGF0YSArIGxlbikgeworCQlpZiAoaC0+ZmxhZ3MgJiBQSU1GT1JfRkxBR19MSVRUTEVfRU5ESUFOKSB7CisJCQlsZTMyX3RvX2NwdXMoJmgtPm9pZ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cmV0dXJuIC1FSU87CS8qIFRPRE86IGJldHRlciBlcnJvciB2YWx1ZSAqLwotCi0JLyogc2V0IEQwIHN0YW5kYnkgYml0ICovCi0JcmVhZF9yZWdpc3Rlcihwcml2LT5uZXRfZGV2LCBJUFdfUkVHX0dQX0NOVFJMLCAmcik7Ci0Jd3JpdGVfcmVnaXN0ZXIocHJpdi0+bmV0X2RldiwgSVBXX1JFR19HUF9DTlRSTCwKLQkJICAgICAgIHIgfCBJUFdfQVVYX0hPU1RfR1BfQ05UUkxfQklUX0hPU1RfQUxMT1dTX1NUQU5EQlkpOwotCi0JcmV0dXJuIDA7Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICBQcm9jZWR1cmUgICA6ICAgaXB3MjEwMF9kb3dubG9hZF9maXJtd2FyZQotICAgIFB1cnBvc2UgICAgIDogICBJbml0aWF6ZSBhZGFwdGVyIGFmdGVyIHBvd2VyIG9uLgotICAgICAgICAgICAgICAgICAgICBUaGUgc2VxdWVuY2UgaXM6Ci0gICAgICAgICAgICAgICAgICAgIDEuIGFzc2VydCBzL3cgcmVzZXQgZmlyc3QhCi0gICAgICAgICAgICAgICAgICAgIDIuIGF3YWtlIGNsb2NrcyAmIHdhaXQgZm9yIGNsb2NrIHN0YWJpbGl6YXRpb24KLSAgICAgICAgICAgICAgICAgICAgMy4gaG9sZCBBUkMgKGRvbid0IGFzayBtZSB3aHkuLi4pCi0gICAgICAgICAgICAgICAgICAgIDQuIGxvYWQgRGlubyB1Y29kZSBhbmQgcmVzZXQvY2xvY2sgaW5pdCBhZ2FpbgotICAgICAgICAgICAgICAgICAgICA1LiB6ZXJvLW91dCBzaGFyZWQgbWVtCi0gICAgICAgICAgICAgICAgICAgIDYuIGRvd25sb2FkIGYvdwotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi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V4KTsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKgotICogbWFjODAyMTEgZW50cnkgcG9pbnQgZnVuY3Rpb25zCi0gKgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jZGVmaW5lIFVDT0RFX1JFQURZX1RJTUVPVVQJKDQgKiBIWikKLQotLyoKLSAqIE5vdCBhIG1hYzgwMjExIGVudHJ5IHBvaW50IGZ1bmN0aW9uLCBidXQgaXQgZml0cyBpbiB3aXRoIGFsbCB0aGUKLSAqIG90aGVyIG1hYzgwMjExIGZ1bmN0aW9ucyBncm91cGVkIGhlcmUuCi0gKi8KLXN0YXRpYyBpbnQKLWlsNDk2NV9tYWNfc2V0dXBfcmVnaXN0ZXIoc3RydWN0IGlsX3ByaXYgKmlsLCB1MzIgbWF4X3Byb2JlX2xlbmd0aCkKLXsKLQlpbnQgcmV0OwotCXN0cnVjdCBpZWVlODAyMTFfaHcgKmh3ID0gaWwtPmh3OwotCi0JaHctPnJhdGVfY29udHJvbF9hbGdvcml0aG0gPSAiaXdsLTQ5NjUtcnMiOwotCi0JLyogVGVsbCBtYWM4MDIxMSBvdXIgY2hhcmFjdGVyaXN0aWNzICovCi0JaWVlZTgwMjExX2h3X3NldChodywgU1VQUE9SVFNfRFlOQU1JQ19QUyk7Ci0JaWVlZTgwMjExX2h3X3NldChodywgU1VQUE9SVFNfUFMpOwotCWllZWU4MDIxMV9od19zZXQoaHcsIFJFUE9SVFNfVFhfQUNLX1NUQVRVUyk7Ci0JaWVlZTgwMjExX2h3X3NldChodywgU1BFQ1RSVU1fTUdNVCk7Ci0JaWVlZTgwMjExX2h3X3NldChodywgTkVFRF9EVElNX0JFRk9SRV9BU1NPQyk7Ci0JaWVlZTgwMjExX2h3X3NldChodywgU0lHTkFMX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9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyAoSU5DTFVESU5HLCBCVVQgTk9UCi0gKiBMSU1JVEVEIFRPLCBQUk9DVVJFTUVOVCBPRiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJQ0VTOyBMT1NTIE9GIFVTRSwKLSAqIERBVEEsIE9SIFBST0ZJVFM7IE9SIEJVU0lORVNTIElOVEVSUlVQVElPTikgSE9XRVZFUiBDQVVTRUQgQU5EIE9OIEFOWQotICogVEhFT1JZIE9GIExJQUJJTElUWSwgV0hFVEhFUiBJTiBDT05UUkFDVCwgU1RSSUNUIExJQUJJTElUWSwgT1IgVE9SVAotICogKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFCi0gKiBPRiBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSA8bGludXgvc2xhYi5oPgotI2luY2x1ZGUgPG5ldC9tYWM4MDIxMS5oPgotCi0jaW5jbHVkZSAiaXdsLXRyYW5zLmgiCi0KLSNpbmNsdWRlICJkZXYuaCIKLSNpbmNsdWRlICJjYWxpYi5oIgotI2luY2x1ZGUgImFnbi5oIgotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqIElOSVQgY2FsaWJyYXRpb25zIGZyYW1ld29yawotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKiBPcGFxdWUgY2FsaWJyYXRpb24gcmVzdWx0cyAqLw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zdF9kZWwoJnJlcy0+bGlzdCk7Ci0JCWtmcmVlKHJlcyk7Ci0JfQotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqIFJVTlRJTUUgY2FsaWJyYXRpb25zIGZyYW1ld29yawotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKiAiZmFsc2UgYWxhcm1zIiBhcmUgc2lnbmFscyB0aGF0IG91ciBEU1AgdHJpZXMgdG8gbG9jayBvbnRvLAotICogICBidXQgdGhlbiBkZXRlcm1pbmVzIHRoYXQgdGhleSBhcmUgZWl0aGVyIG5vaXNlLCBvciB0cmFuc21pc3Npb25zCi0gKiAgIGZyb20gYSBkaXN0YW50IHdpcmVsZXNzIG5ldHdvcmsgKGFsc28gIm5vaXNlIiwgcmVhbGx5KSB0aGF0IGdldAotICogICAic3RlcHBlZCBvbiIgYnkgc3Ryb25nZXIgdHJhbnNtaXNzaW9ucyB3aXRoaW4gb3VyIG93biBuZXR3b3JrLgotICogVGhpcyBhbGdvcml0aG0gYXR0ZW1wdHMgdG8gc2V0IGEgc2Vuc2l0aXZpdHkgbGV2ZWwgdGhhdCBpcyBoaWdoCi0gKiAgIGVub3VnaCB0byByZWNlaXZlIGFsbCBvZiBvdXIgb3duIG5ldHdvcmsgdHJhZmZpYywgYnV0IG5vdCBzbwotICogICBoaWdoIHRoYXQgb3VyIERTUCBnZXRzIHRvbyBidXN5IHRyeWluZyB0byBsb2NrIG9udG8gbm9uLW5ldHdvcmsKLSAqICAgYWN0aXZpdHkvbm9pc2UuICovCi1zdGF0aWMgaW50IGl3bF9zZW5zX2VuZXJneV9jY2soc3RydWN0IGl3bF9wcml2ICpwcml2LAotCQkJCSAgIHUzMiBub3JtX2ZhLAotCQkJCSAgIHUzMiByeF9lbmFibGVfdGltZSwK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ExZX1JYX01QRFUgKHJlc3BvbnNlIG9ubHkpCi0gKiAgUkVQTFlfVFggKGJvdGggY29tbWFuZCBhbmQgcmVzcG9uc2UpCi0gKiAgUkVQTFlfVFhfTElOS19RVUFMSVRZX0NNRAotICoKLSAqIEhpZ2gtdGhyb3VnaHB1dCAoSFQpIHJhdGUgZm9ybWF0IGZvciBiaXRzIDc6MCAoYml0IDggbXVzdCBiZSAiMSIpOgotICogIDItMDogIDApICAgNiBNYnBzCi0gKiAgICAgICAgMSkgIDEyIE1icHMKLSAqICAgICAgICAyKSAgMTggTWJwcwotICogICAgICAgIDMpICAyNCBNYnBzCi0gKiAgICAgICAgNCkgIDM2IE1icHMKLSAqICAgICAgICA1KSAgNDggTWJwcwotICogICAgICAgIDYpICA1NCBNYnBzCi0gKiAgICAgICAgNykgIDYwIE1icHMKLSAqCi0gKiAgNC0zOiAgMCkgIFNpbmdsZSBzdHJlYW0gKFNJU08pCi0gKiAgICAgICAgMSkgIER1YWwgc3RyZWFtIChNSU1PKQotICogICAgICAgIDIpICBUcmlwbGUgc3RyZWFtIChNSU1PKQotICoKLSAqICAgIDU6ICBWYWx1ZSBvZiAweDIwIGluIGJpdHMgNzowIGluZGljYXRlcyA2IE1icHMgSFQ0MCBkdXBsaWNhdGUgZGF0YQotICoKLSAqIExlZ2FjeSBPRkRNIHJhdGUgZm9ybWF0IGZvciBiaXRzIDc6MCAoYml0IDggbXVzdCBiZSAiMCIsIGJpdCA5ICIwIik6Ci0gKiAgMy0wOiAgMHhEKSAgIDYgTWJwcwotICogICAgICAgIDB4RikgICA5IE1icHMKLSAqICAgICAgICAweDUpICAxMiBNYnBzCi0gKiAgICAgICAgMHg3KSAgMTggTWJwcwotICogICAgICAgIDB4OSkgIDI0IE1icHMKLSAqICAgICAgICAweEIpICAzNiBNYnBzCi0gKiAgICAgICAgMHgxKSAgNDggTWJwcwotICogICAgICAgIDB4MykgIDU0IE1icHMKLSAqCi0gKiBMZWdhY3kgQ0NLIHJhdGUgZ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XJjX3gxOwotCi0JdTE2IGF1dG9fY29ycl9tYXhfY2NrOwotCXUxNiBhdXRvX2NvcnJfbWF4X2Nja19tcmM7Ci0JdTE2IGF1dG9fY29ycl9taW5fY2NrOwotCXUxNiBhdXRvX2NvcnJfbWluX2Nja19tcmM7Ci0KLQl1MTYgYmFya2VyX2NvcnJfdGhfbWluOwotCXUxNiBiYXJrZXJfY29ycl90aF9taW5fbXJjOwotCXUxNiBucmdfdGhfY2NhOwotfTsKLQotCi0jZGVmaW5lIEtFTFZJTl9UT19DRUxTSVVTKHgpICgoeCktMjczKQotI2RlZmluZSBDRUxTSVVTX1RPX0tFTFZJTih4KSAoKHgpKzI3MykKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKgotICogRnVuY3Rpb25zIGltcGxlbWVudGVkIGluIGNvcmUgbW9kdWxlIHdoaWNoIGFyZSBmb3J3YXJkIGRlY2xhcmVkIGhlcmUKLSAqIGZvciB1c2UgYnkgaXdsLVs0LTVdLmMKLSAqCi0gKiBOT1RFOiAgVGhlIGltcGxlbWVudGF0aW9uIG9mIHRoZXNlIGZ1bmN0aW9ucyBhcmUgbm90IGhhcmR3YXJlIHNwZWNpZmljCi0gKiB3aGljaCBpcyB3aHkgdGhleSBhcmUgaW4gdGhlIGNvcmUgbW9kdWxlIGZpbGVzLgotICoKLSAqIE5hbWluZyBjb252ZW50aW9uIC0tCi0gKiBpd2xfICAgICAgICAgPC0tIElzIHBhcnQgb2YgaXdsd2lmaQotICogaXdsWFhYWF8gICAgIDwtLSBIYXJkd2FyZSBzcGVjaWZpYyAoaW1wbGVtZW50ZWQgaW4gaXdsLVhYWFguYyBmb3IgWFhYWCkKLSAqCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXZvaWQgaXdsX3VwZGF0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0VYSVRfUEVORElORywgJnByaXYtPnN0YXR1cykpCi0JCXJldHVybjsKLQotCWlmICh0ZXN0X2FuZF9jbGVhcl9iaXQoU1RBVFVTX0ZXX0VSUk9SLCAmcHJpdi0+c3RhdHVzKSkgewotCQltdXRleF9sb2NrKCZwcml2LT5tdXRleCk7Ci0JCWl3bGFnbl9wcmVwYXJlX3Jlc3RhcnQocHJpdik7Ci0JCW11dGV4X3VubG9jaygmcHJpdi0+bXV0ZXgpOwotCQlpd2xfY2FuY2VsX2RlZmVycmVkX3dvcmsocHJpdik7Ci0JCWlmIChwcml2LT5tYWM4MDIxMV9yZWdpc3RlcmVkKQotCQkJaWVlZTgwMjExX3Jlc3RhcnRfaHcocHJpdi0+aHcpOwotCQllbHNlCi0JCQlJV0xfRVJSKHByaXYsCi0JCQkJIkNhbm5vdCByZXF1ZXN0IHJlc3RhcnQgYmVmb3JlIHJlZ2lzdHJhdGluZyB3aXRoIG1hYzgwMjExXG4iKTsKLQl9IGVsc2UgewotCQlXQVJOX09OKDEpOwotCX0KLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKgotICogZHJpdmVyIHNldHVwIGFuZCB0ZWFyZG93bgotICoKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotc3RhdGljIHZvaWQgaXdsX3NldHVwX2RlZmVycmVkX3dvcmsoc3RydWN0IGl3bF9wcml2ICpwcml2KQotewotCXByaXYtPndvcmtxdWV1ZSA9IGNyZWF0ZV9zaW5nbGV0aHJlYWRfd29ya3F1ZXVlKERSVl9OQU1FKTsKLQotCUlOSVRfV09SSygmcHJpdi0+cmVzdGFydCwgaXdsX2JnX3Jlc3RhcnQpOwotCUlOSVRfV09SSygmcHJpdi0+YmVhY29uX3VwZGF0ZSwgaXdsX2JnX2JlY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ZHMuaCIKLSNpbmNsdWRlICJ0dC5oIgotCi0vKiBkZWZhdWx0IFRoZXJtYWwgVGhyb3R0bGluZyB0cmFuc2FjdGlvbiB0YWJsZQotICogQ3VycmVudCBzdGF0ZSAgIHwgICAgICAgICBUaHJvdHRsaW5nIERvd24gICAgICAgICAgICAgICB8ICBUaHJvdHRsaW5nIFVwCi0gKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gKiAgICAgICAgICAgICAgICAgQ29uZGl0aW9uIE54dCBTdGF0ZSAgQ29uZGl0aW9uIE54dCBTdGF0ZSBDb25kaXRpb24gTnh0IFN0YXRlCi0gKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gKiAgICAgSVdMX1RJXzAgICAgIFQgPj0gMTE0ICAgQ1RfS0lMTCAgMTE0PlQ+PTEwNSAgIFRJXzEgICAgICBOL0EgICAgICBOL0EKLSAqICAgICBJV0xfVElfMSAgICAgVCA+PSAxMTQgICBDVF9LSUxMICAxMTQ+VD49MTEwICAgVElfMiAgICAgVDw9OTUgICAgIFRJXzAKLSAqICAgICBJV0xfVElfMiAgICAgVCA+PSAxMTQgICBDVF9LSUxMICAgICAgICAgICAgICAgICAgICAgICAgVDw9MTAwICAgIFRJXzEKLSAqICAgIElXTF9DVF9LSUxMICAgICAgTi9BICAgICAgIE4vQSAgICAgICBOL0EgICAgICAgIE4vQSAgICAgVDw9OTUgICAgIFRJXzAKLSAqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAqLwotc3RhdGljIGNvbnN0IHN0cnVjdCBpd2xfdHRfdHJhbnMgdHRfcmFuZ2VfMFtJV0xfVElfU1RBVEVfTUFYIC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XIgb2YgVFggc3RyZWFtcwotICogMykgQXZvaWQgdGhyb3VnaHB1dCBwZXJmb3JtYW5jZSBpbXBhY3QgYXMgbXVjaCBhcyBwb3NzaWJsZQotICoKLSAqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAqICAgICAgICAgICAgICAgICBDb25kaXRpb24gTnh0IFN0YXRlICBDb25kaXRpb24gTnh0IFN0YXRlIENvbmRpdGlvbiBOeHQgU3RhdGUKLSAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSAqICAgICBJV0xfVElfMCAgICAgVCA+PSAxMTQgICBDVF9LSUxMICAxMTQ+VD49MTA1ICAgVElfMSAgICAgIE4vQSAgICAgIE4vQQotICogICAgIElXTF9USV8xICAgICBUID49IDExNCAgIENUX0tJTEwgIDExND5UPj0xMTAgICBUSV8yICAgICBUPD05NSAgICAgVElfMAotICogICAgIElXTF9USV8yICAgICBUID49IDExNCAgIENUX0tJTEwgICAgICAgICAgICAgICAgICAgICAgICBUPD0xMDAgICAgVElfMQotICogICAgSVdMX0NUX0tJTEwgICAgICBOL0EgICAgICAgTi9BICAgICAgIE4vQSAgICAgICAgTi9BICAgICBUPD05NSAgICAgVElfMAotICo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotICovCi1zdGF0aWMgdm9pZCBpd2xfYWR2YW5jZV90dF9oYW5kbGVyKHN0cnVjdCBpd2xfcHJpdiAqcHJpdiwgczMyIHRlbXAsIGJvb2wgZm9yY2UpCi17Ci0Jc3RydWN0IGl3bF90dF9tZ210ICp0dCA9ICZwcml2LT50aGVybWFsX3Rocm90dGxlOwotCWludCBpOwotCWJvb2wgY2hhbmdlZCA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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgPGxpbnV4L2tlcm5lbC5oPgotCi0jaW5jbHVkZSAiaXdsLWlvLmgiCi0jaW5jbHVkZSAiaXdsLWFnbi1ody5oIgotI2luY2x1ZGUgIml3bC10cmFucy5oIgotI2luY2x1ZGUgIml3bC1maC5oIgotI2luY2x1ZGUgIml3bC1vcC1tb2RlLmgiCi0KLSNpbmNsdWRlICJkZXYuaCIKLSNpbmNsdWRlICJhZ24uaCIKLSNpbmNsdWRlICJjYWxpYi5oIgotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKgotICogdUNvZGUgZG93bmxvYWQgZnVuY3Rpb25zCi0gKgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotc3RhdGljIGlubGluZSBjb25zdCBzdHJ1Y3QgZndfaW1nICoKLWl3bF9nZXRfdWNvZGVfaW1hZ2Uoc3RydWN0IGl3bF9wcml2ICpwcml2LCBlbnVtIGl3bF91Y29kZV90eXBlIHVjb2RlX3R5cGUpCi17Ci0JaWYgKHVjb2RlX3R5cGUgPj0gSVdMX1VDT0RFX1RZUEVfTUFYKQotCQlyZXR1cm4gTlVMTDsKLQotCXJldHVybiAmcHJpdi0+ZnctPmltZ1t1Y29kZV90eXBlXTsKLX0KLQotLyoKLSAqICBDYWxpYnJhdGlvbgotICovCi1zdGF0aWMgaW50IGl3bF9zZXRfWHRhbF9jYWxpYihzdHJ1Y3QgaXdsX3ByaXYgKnByaXYpCi17Ci0Jc3RydWN0IGl3bF9jYWxpYl94dGFsX2ZyZXFfY21kIGNtZDsKLQlfX2xlMTYgKnh0YWxfY2FsaWIgPSBwcml2LT5udm1fZGF0YS0+eHRhbF9jYWxpYjsKLQotCWl3bF9z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F1ZXVlIHdyaXRlIGluZGV4Ci0gKiAxMS04OiAgcXVldWUgc2VsZWN0b3IKLSAqLwotI2RlZmluZSBIQlVTX1RBUkdfV1JQVFIgICAgICAgICAoSEJVU19CQVNFKzB4MDYwKQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogQ1NSIHZhbHVlcwotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gLyoKLSAqIGhvc3QgaW50ZXJydXB0IHRpbWVvdXQgdmFsdWUKLSAqIHVzZWQgd2l0aCBzZXR0aW5nIGludGVycnVwdCBjb2FsZXNjaW5nIHRpbWVyCi0gKiB0aGUgQ1NSX0lOVF9DT0FMRVNDSU5HIGlzIGFuIDggYml0IHJlZ2lzdGVyIGluIDMyLXVzZWMgdW5pdAotICoKLSAqIGRlZmF1bHQgaW50ZXJydXB0IGNvYWxlc2NpbmcgdGltZXIgaXMgNjQgeCAzMiA9IDIwNDggdXNlY3MKLSAqLwotI2RlZmluZSBJV0xfSE9TVF9JTlRfVElNRU9VVF9NQVgJKDB4RkYpCi0jZGVmaW5lIElXTF9IT1NUX0lOVF9USU1FT1VUX0RFRgkoMHg0MCkKLSNkZWZpbmUgSVdMX0hPU1RfSU5UX1RJTUVPVVRfTUlOCSgweDApCi0jZGVmaW5lIElXTF9IT1NUX0lOVF9PUEVSX01PREUJCUJJVCgzMSkKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgIDcwMDAvMzAwMCBzZXJpZXMgU0hSIERUUyBhZGRyZXNzZXMgICAgICAgICAgICAgICAgICoKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KL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IT1NUICAgICAgICAgICAgICAgMHgwMDAxMDAwMAotI2RlZmluZSBJTkRJUkVDVF9HRU5FUkFMICAgICAgICAgICAgMHgwMDAyMDAwMAotI2RlZmluZSBJTkRJUkVDVF9SRUdVTEFUT1JZICAgICAgICAgMHgwMDAzMDAwMAotI2RlZmluZSBJTkRJUkVDVF9DQUxJQlJBVElPTiAgICAgICAgMHgwMDA0MDAwMAotI2RlZmluZSBJTkRJUkVDVF9QUk9DRVNTX0FESlNUICAgICAgMHgwMDA1MDAwMAotI2RlZmluZSBJTkRJUkVDVF9PVEhFUlMgICAgICAgICAgICAgMHgwMDA2MDAwMAotI2RlZmluZSBJTkRJUkVDVF9UWFBfTElNSVQgICAgICAgICAgMHgwMDA3MDAwMAotI2RlZmluZSBJTkRJUkVDVF9UWFBfTElNSVRfU0laRSAgICAgMHgwMDA4MDAwMAotI2RlZmluZSBJTkRJUkVDVF9BRERSRVNTICAgICAgICAgICAgMHgwMDEwMDAwMAotCi0vKiBjb3JyZXNwb25kaW5nIGxpbmsgb2Zmc2V0cyBpbiBFRVBST00gKi8KLSNkZWZpbmUgRUVQUk9NX0xJTktfSE9TVCAgICAgICAgICAgICAoMioweDY0KQotI2RlZmluZSBFRVBST01fTElOS19HRU5FUkFMICAgICAgICAgICgyKjB4NjUpCi0jZGVmaW5lIEVFUFJPTV9MSU5LX1JFR1VMQVRPUlkgICAgICAgKDIqMHg2NikKLSNkZWZpbmUgRUVQUk9NX0xJTktfQ0FMSUJSQVRJT04gICAgICAoMioweDY3KQotI2RlZmluZSBFRVBST01fTElOS19QUk9DRVNTX0FESlNUICAgICgyKjB4NjgpCi0jZGVmaW5lIEVFUFJPTV9MSU5LX09USEVSUyAgICAgICAgICAgKDIqMHg2OSkKLSNkZWZpbmUgRUVQUk9NX0xJTktfVFhQX0xJTUlUICAgICAgICAoMioweDZhKQotI2RlZmluZSBFRVBST01fTElOS19UWFBfTElNSVRfU0laRSAgICgyKjB4NmIpCi0KLS8qIEdlbmVyYWwgKi8KLSNkZWZpbmUgRUVQUk9NX0RFVklDRV9JRCAgICAgICAgICAgICAgICAgICAgKDIqMHgwOCkJLyogMiBieXRlcyAqLwotI2RlZmluZSBFRVBST01fU1VCU1lTVEVNX0lECQkgICAgKDIqMHgwQSkJLyogMiBieXRlcyAqLwotI2RlZmluZSBFRVBST01fTUFDX0FERFJFU1MgICAgICAgICAgICAgICAgICAoMioweDE1KQkvKiA2ICBieXRlcyAqLwotI2RlZmluZSBFRVBST01fQk9BUkRfUkVWSVNJT04gICAgICAgICAgICAgICAoMioweDM1KQkvKiAyICBieXRlcyAqLwotI2RlZmluZSBFRVBST01fQk9BUkRfUEJBX05VTUJFUiAgICAgICAgICAgICAoMioweDNCKzEpCS8qIDkgIGJ5dGVzICovCi0jZGVmaW5lIEVFUFJPTV9WRVJTSU9OICAgICAgICAgICAgICAgICAgICAgICgyKjB4NDQpCS8qIDIgIGJ5dGVzICovCi0jZGVmaW5lIEVFUFJPTV9TS1VfQ0FQICAgICAgICAgICAgICAgICAgICAgICgyKjB4NDUpCS8qIDIgIGJ5dGVzICovCi0jZGVmaW5lIEVFUFJPTV9PRU1fTU9ERSAgICAgICAgICAgICAgICAgICAgICgyKjB4NDYpCS8qIDIgIGJ5dGVzICovCi0jZGVmaW5lIEVFUFJPTV9SQURJT19DT05GSUcgICAgICAgICAgICAgICAgICgyKjB4NDgpCS8qIDIgIGJ5dGVzICovCi0jZGVmaW5lIEVFUFJPTV9OVU1fTUFDX0FERFJFU1MgICAgICAgICAgICAgICgyKjB4NEMpCS8qIDIgIGJ5dGVzICovCi0KLS8qIGNhbGlicmF0aW9uICovCi1zdHJ1Y3QgaXdsX2VlcHJvbV9jYWxpYl9oZHIgewotCXU4IHZlcnNpb247Ci0JdTggcGFfdHlwZTsKLQlfX2xlMTYgdm9sdGFnZTsKLX0gX19wYWNrZWQ7Ci0KLSNkZWZpbmUgRUVQUk9NX0NBTElCX0FMTAkoSU5ESVJFQ1RfQUREUkVTUyB8IElORElSR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VybiAtRU5PRU5UOwotCQl9Ci0JCXJldHVybiAwOwotCWNhc2UgQ1NSX0VFUFJPTV9HUF9HT09EX1NJR19FRVBfTEVTU19USEFOXzRLOgotCWNhc2UgQ1NSX0VFUFJPTV9HUF9HT09EX1NJR19FRVBfTU9SRV9USEFOXzRLOgotCQlpZiAobnZtX2lzX290cCkgewotCQkJSVdMX0VSUih0cmFucywgIk9UUCB3aXRoIGJhZCBzaWduYXR1cmU6IDB4JTA4eFxuIiwgZ3ApOwotCQkJcmV0dXJuIC1FTk9FTlQ7Ci0JCX0KLQkJcmV0dXJuIDA7Ci0JY2FzZSBDU1JfRUVQUk9NX0dQX0JBRF9TSUdOQVRVUkVfQk9USF9FRVBfQU5EX09UUDoKLQlkZWZhdWx0OgotCQlJV0xfRVJSKHRyYW5zLAotCQkJImJhZCBFRVBST00vT1RQIHNpZ25hdHVyZSwgdHlwZT0lcywgRUVQUk9NX0dQPTB4JTA4eFxuIiwKLQkJCW52bV9pc19vdHAgPyAiT1RQIiA6ICJFRVBST00iLCBncCk7Ci0JCXJldHVybiAtRU5PRU5UOwotCX0KLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICoKLSAqIE9UUCByZWxhdGVkIGZ1bmN0aW9ucwotICoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotc3RhdGljIHZvaWQgaXdsX3NldF9vdHBfYWNjZXNzX2Fic29sdXRlKHN0cnVjdCBpd2xfdHJhbnMgKnRyYW5zKQotewotCWl3bF9yZWFkMzIodHJhbnMsIENTUl9PVFBfR1BfUkVHKTsKLQotCWl3bF9jbGVhcl9iaXQodHJhbnMsIENTUl9PVFBfR1BfUkVHLAotCQkgICAgICBDU1JfT1RQX0dQX1JFR19PVFBfQUNDRVNTX01PREUpOwotfQotC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F9iaXQoU1RBVFVTX0ZXX0VSUk9SLCAmdHJhbnMtPnN0YXR1cykpCi0JCWl3bF9vcF9tb2RlX25pY19lcnJvcih0cmFucy0+b3BfbW9kZSk7Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogdHJhbnNwb3J0IGhlbHBlciBmdW5jdGlvbnMKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0cnVjdCBpd2xfdHJhbnMgKml3bF90cmFuc19hbGxvYyh1bnNpZ25lZCBpbnQgcHJpdl9zaXplLAotCQkJCSAgc3RydWN0IGRldmljZSAqZGV2LAotCQkJCSAgY29uc3Qgc3RydWN0IGl3bF9jZmcgKmNmZywKLQkJCQkgIGNvbnN0IHN0cnVjdCBpd2xfdHJhbnNfb3BzICpvcHMsCi0JCQkJICBzaXplX3QgZGV2X2NtZF9oZWFkcm9vbSk7Ci12b2lkIGl3bF90cmFuc19mcmVlKHN0cnVjdCBpd2xfdHJhbnMgKnRyYW5zKTsKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qIGRyaXZlciAodHJhbnNwb3J0KSByZWdpc3Rlci91bnJlZ2lzdGVyIGZ1bmN0aW9ucwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotaW50IF9fbXVzdF9jaGVjayBpd2xfcGNpX3JlZ2lzdGVyX2RyaXZlcih2b2lkKTsKLXZvaWQgaXdsX3BjaV91bnJlZ2lzdGVyX2RyaXZlcih2b2lkKTsKLQotI2VuZGlmIC8qIF9faXdsX3RyYW5zX2hfXyAqLwpkaWZmIC0tZ2l0IGEvZHJpdmVycy9uZXQvd2lyZWxlc3MvaXdsd2lmaS9tdm0vTWFrZWZpbGUgYi9kcml2ZXJzL25ldC93aXJlbGVzcy9pd2x3aWZpL212bS9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udGVyLWZyZXEKLSAqICAgYml0cy0xOjAgbWFyayB0aGUgZGlzdGFuY2UgZnJvbSB0aGUgY2VudGVyIGZyZXEuIGZvciAyME1oeiwgb2Zmc2V0IGlzIDAuCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2VudGVyX2ZyZXEKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAqIDQwTWh6ICAgICAgICAgICAgICAgICAgICAgICAgICB8X19fX19fX3xfX19fX19ffAotICogODBNaHogICAgICAgICAgICAgICAgICB8X19fX19fX3xfX19fX19ffF9fX19fX198X19fX19fX3wKLSAqIDE2ME1oeiB8X19fX19fX3xfX19fX19ffF9fX19fX198X19fX19fX3xfX19fX19ffF9fX19fX198X19fX19fX3xfX19fX19ffAotICogY29kZSAgICAgIDAxMSAgICAgMDEwICAgICAwMDEgICAgIDAwMCAgfCAgMTAwICAgICAxMDEgICAgIDExMCAgICAxMTEKLSAqLwotI2RlZmluZSBQSFlfVkhUX0NUUkxfUE9TXzFfQkVMT1cgICgweDApCi0jZGVmaW5lIFBIWV9WSFRfQ1RSTF9QT1NfMl9CRUxPVyAgKDB4MSkKLSNkZWZpbmUgUEhZX1ZIVF9DVFJMX1BPU18zX0JFTE9XICAoMHgyKQotI2RlZmluZSBQSFlfVkhUX0NUUkxfUE9TXzRfQkVMT1cgICgweDMpCi0jZGVmaW5lIFBIWV9WSFRfQ1RSTF9QT1NfMV9BQk9WRSAgKDB4NCkKLSNkZWZpbmUgUEhZX1ZIVF9DVFJMX1BPU18yX0FCT1ZFICAoMHg1KQotI2RlZmluZSBQSFlfVkhUX0NUUkxfUE9TXzNfQUJPVkUgICgweDYpCi0jZGVmaW5lIFBIWV9WSFRfQ1RSTF9QT1NfNF9BQk9WRSAgKDB4NykKLQotLyoKLSAqIEBiYW5kOiBQSFlfQkFORF8qCi0gKiBAY2hhbm5lbDogY2hhbm5lbCBudW1iZXIKLSAqIEB3aWR0aDogUE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VfWFhYCi0gKglPdGhlciBmdW5jdGlvbnM6IGl3bF9wY2llX1hYWAotICovCi1zdHJ1Y3QgaXdsX3RyYW5zICppd2xfdHJhbnNfcGNpZV9hbGxvYyhzdHJ1Y3QgcGNpX2RldiAqcGRldiwKLQkJCQkgICAgICAgY29uc3Qgc3RydWN0IHBjaV9kZXZpY2VfaWQgKmVudCwKLQkJCQkgICAgICAgY29uc3Qgc3RydWN0IGl3bF9jZmcgKmNmZyk7Ci12b2lkIGl3bF90cmFuc19wY2llX2ZyZWUoc3RydWN0IGl3bF90cmFucyAqdHJhbnMpOwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogUlgKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLWludCBpd2xfcGNpZV9yeF9pbml0KHN0cnVjdCBpd2xfdHJhbnMgKnRyYW5zKTsKLWlycXJldHVybl90IGl3bF9wY2llX2lycV9oYW5kbGVyKGludCBpcnEsIHZvaWQgKmRldl9pZCk7Ci1pbnQgaXdsX3BjaWVfcnhfc3RvcChzdHJ1Y3QgaXdsX3RyYW5zICp0cmFucyk7Ci12b2lkIGl3bF9wY2llX3J4X2ZyZWUoc3RydWN0IGl3bF90cmFucyAqdHJhbnMpOwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogSUNUIC0gaW50ZXJydXB0IGhhbmRsaW5nCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1pcnFyZXR1cm5fdCBpd2xfcGNpZV9pc3IoaW50IGlycSwgdm9pZCAqZGF0YSk7Ci1pbnQgaXdsX3BjaWVfYWxsb2NfaWN0KHN0cnVjdCBpd2xfdHJhbnMgKnRyYW5zKTsKLXZvaWQgaXdsX3BjaWVfZnJlZV9pY3Qoc3RydWN0IGl3bF90cmFucyAqdH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NhbGxlZCBMSUNFTlNFLgotICoKLSAqIENvbnRhY3QgSW5mb3JtYXRpb246Ci0gKiAgSW50ZWwgTGludXggV2lyZWxlc3MgPGlsd0BsaW51eC5pbnRlbC5jb20+Ci0gKiBJbnRlbCBDb3Jwb3JhdGlvbiwgNTIwMCBOLkUuIEVsYW0gWW91bmcgUGFya3dheSwgSGlsbHNib3JvLCBPUiA5NzEyNC02NDk3Ci0gKgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotI2luY2x1ZGUgPGxpbnV4L3NjaGVkLmg+Ci0jaW5jbHVkZSA8bGludXgvd2FpdC5oPgotI2luY2x1ZGUgPGxpbnV4L2dmcC5oPgotCi0jaW5jbHVkZSAiaXdsLXBycGguaCIKLSNpbmNsdWRlICJpd2wtaW8uaCIKLSNpbmNsdWRlICJpbnRlcm5hbC5oIgotI2luY2x1ZGUgIml3bC1vcC1tb2RlLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqCi0gKiBSWCBwYXRoIGZ1bmN0aW9ucwotICoKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qCi0gKiBSeCB0aGVvcnkgb2Ygb3BlcmF0aW9uCi0gKgotICogRHJpdmVyIGFsbG9jYXRlcyBhIGNpcmN1bGFyIGJ1ZmZlciBvZiBSZWNlaXZlIEJ1ZmZlciBEZXNjcmlwdG9ycyAoUkJEcyksCi0gKiBlYWNoIG9mIHdoaWNoIHBvaW50IHRvIFJlY2VpdmUgQnVmZmVycyB0byBiZSBmaWxsZWQgYnkgdGhlIE5JQy4gIFRoZXNlIGdldAotICogdXNlZCBub3Qgb25seSBmb3IgUnggZnJhbWVzLCBidXQgZm9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ICAgICAgICAgICAgICAgICAgICAgICAgIFVzZWQgb25seSBkdXJpbmcgaW5pdGlhbGl6YXRpb24uCi0gKiBpd2xfcGNpZV9yeHFfcmVzdG9jaygpICAgICBNb3ZlcyBhdmFpbGFibGUgYnVmZmVycyBmcm9tIHJ4X2ZyZWUgaW50byBSeAotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVldWUsIHVwZGF0ZXMgZmlybXdhcmUgcG9pbnRlcnMsIGFuZCB1cGRhdGVzCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgV1JJVEUgaW5kZXguCi0gKiBpd2xfcGNpZV9yeF9hbGxvY2F0b3IoKSAgICAgQmFja2dyb3VuZCB3b3JrIGZvciBhbGxvY2F0aW5nIHBhZ2VzLgotICoKLSAqIC0tIGVuYWJsZSBpbnRlcnJ1cHRzIC0tCi0gKiBJU1IgLSBpd2xfcngoKSAgICAgICAgICAgICBEZXRhY2ggaXdsX3J4X21lbV9idWZmZXJzIGZyb20gcG9vbCB1cCB0byB0aGUKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJFQUQgSU5ERVgsIGRldGFjaGluZyB0aGUgU0tCIGZyb20gdGhlIHBvb2wuCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICBNb3ZlcyB0aGUgcGFja2V0IGJ1ZmZlciBmcm9tIHF1ZXVlIHRvIHJ4X3VzZWQuCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICBQb3N0cyBhbmQgY2xhaW1zIHJlcXVlc3RzIHRvIHRoZSBhbGxvY2F0b3IuCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICBDYWxscyBpd2xfcGNpZV9yeHFfcmVzdG9jayB0byByZWZpbGwgYW55IGVtcHR5Ci0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbG90cy4KLSAqCi0gKiBSQkQgbGlmZS1jeWNsZToKLSAqCi0gKiBJbml0OgotICogcnhxLnBvb2wgLT4gcnhxLnJ4X3Vz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YgKGludGEgJiB+KHRyYW5zX3BjaWUtPmludGFfbWFzaykpIHsKLQkJSVdMX1dBUk4odHJhbnMsICJEaXNhYmxlZCBJTlRBIGJpdHMgMHglMDh4IHdlcmUgcGVuZGluZ1xuIiwKLQkJCSBpbnRhICYgfnRyYW5zX3BjaWUtPmludGFfbWFzayk7Ci0JfQotCi0JLyogUmUtZW5hYmxlIGFsbCBpbnRlcnJ1cHRzICovCi0JLyogb25seSBSZS1lbmFibGUgaWYgZGlzYWJsZWQgYnkgaXJxICovCi0JaWYgKHRlc3RfYml0KFNUQVRVU19JTlRfRU5BQkxFRCwgJnRyYW5zLT5zdGF0dXMpKQotCQlpd2xfZW5hYmxlX2ludGVycnVwdHModHJhbnMpOwotCS8qIFJlLWVuYWJsZSBSRl9LSUxMIGlmIGl0IG9jY3VycmVkICovCi0JZWxzZSBpZiAoaGFuZGxlZCAmIENTUl9JTlRfQklUX1JGX0tJTEwpCi0JCWl3bF9lbmFibGVfcmZraWxsX2ludCh0cmFucyk7Ci0KLW91dDoKLQlsb2NrX21hcF9yZWxlYXNlKCZ0cmFucy0+c3luY19jbWRfbG9ja2RlcF9tYXApOwotCXJldHVybiBJUlFfSEFORExFRDsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICoKLSAqIElDVCBmdW5jdGlvbnMKLSAqCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKiBGcmVlIGRyYW0gdGFibGUgKi8KLXZvaWQgaXdsX3BjaWVfZnJlZV9pY3Qoc3RydWN0IGl3bF90cmFucyAqdHJhbnMpCi17Ci0Jc3RydWN0IGl3bF90cmFuc19wY2llICp0cmFuc19wY2llID0gSVdMX1RSQU5TX0dFVF9QQ0lFX1RSQU5TKHRyYW5zKTsKLQotCWlmICh0cmF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RoZSBhc3NvY2lhdGlvbgotCSAqIHJlc3BvbnNlIHRvIHRoZSBmb2xsb3dpbmcgdmFsdWVzIHJldHVybmVkIGluIHJlc3AtPnN0YXR1c2NvZGU6Ci0JICoKLQkgKiAgICBJRUVFIFN0YXR1cyBDb2RlICAgICAgICAgICAgICAgIE1hcnZlbGwgU3RhdHVzIENvZGUKLQkgKiAgICAwICAgICAgICAgICAgICAgICAgICAgICAtPiAgICAgIDB4MDAwMCBBU1NPQ19SRVNVTFRfU1VDQ0VTUwotCSAqICAgIDEzICAgICAgICAgICAgICAgICAgICAgIC0+ICAgICAgMHgwMDA0IEFTU09DX1JFU1VMVF9BVVRIX1JFRlVTRUQKLQkgKiAgICAxNCAgICAgICAgICAgICAgICAgICAgICAtPiAgICAgIDB4MDAwNCBBU1NPQ19SRVNVTFRfQVVUSF9SRUZVU0VECi0JICogICAgMTUgICAgICAgICAgICAgICAgICAgICAgLT4gICAgICAweDAwMDQgQVNTT0NfUkVTVUxUX0FVVEhfUkVGVVNFRAotCSAqICAgIDE2ICAgICAgICAgICAgICAgICAgICAgIC0+ICAgICAgMHgwMDA0IEFTU09DX1JFU1VMVF9BVVRIX1JFRlVTRUQKLQkgKiAgICBvdGhlcnMgICAgICAgICAgICAgICAgICAtPiAgICAgIDB4MDAwMyBBU1NPQ19SRVNVTFRfUkVGVVNFRAotCSAqCi0JICogT3RoZXIgcmVzcG9uc2UgY29kZXM6Ci0JICogICAgMHgwMDAxIC0+IEFTU09DX1JFU1VMVF9JTlZBTElEX1BBUkFNRVRFUlMgKHVudXNlZCkKLQkgKiAgICAweDAwMDIgLT4gQVNTT0NfUkVTVUxUX1RJTUVPVVQgKGludGVybmFsIHRpbWVyIGV4cGlyZWQgd2FpdGluZyBmb3IKLQkgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFzc29jaWF0aW9uIHJlc3BvbnNlIGZyb20gdGhlIEFQKQotCSAqLwotCWlmIChNUlZMX0ZXX01BSk9SX1JFV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KHBhY2tldCk7Ci0JfQotCi0JbGJzX2RlYl9sZWF2ZShMQlNfREVCX1NESU8pOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiBGaXJtd2FyZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNkZWZpbmUgRldfRExfUkVBRFlfU1RBVFVTIChJRl9TRElPX0lPX1JEWSB8IElGX1NESU9fRExfUkRZKQotCi1zdGF0aWMgaW50IGlmX3NkaW9fcHJvZ19oZWxwZXIoc3RydWN0IGlmX3NkaW9fY2FyZCAqY2FyZCwKLQkJCQljb25zdCBzdHJ1Y3QgZmlybXdhcmUgKmZ3KQotewotCWludCByZXQ7Ci0JdW5zaWduZWQgbG9uZyB0aW1lb3V0OwotCXU4ICpjaHVua19idWZmZXI7Ci0JdTMyIGNodW5rX3NpemU7Ci0JY29uc3QgdTggKmZpcm13YXJlOwotCXNpemVfdCBzaXplOwotCi0JbGJzX2RlYl9lbnRlcihMQlNfREVCX1NESU8pOwotCi0JY2h1bmtfYnVmZmVyID0ga3phbGxvYyg2NCwgR0ZQX0tFUk5FTCk7Ci0JaWYgKCFjaHVua19idWZmZXIpIHsKLQkJcmV0ID0gLUVOT01FTTsKLQkJZ290byBvdXQ7Ci0JfQotCi0Jc2Rpb19jbGFpbV9ob3N0KGNhcmQtPmZ1bmMpOwotCi0JcmV0ID0gc2Rpb19zZXRfYmxvY2tfc2l6ZShjYXJkLT5mdW5jLCAzMik7Ci0JaWYgKHJldCkKLQkJZ290byByZWxlYXNlOwotCi0JZmlybXdhcmUgPSBmdy0+ZGF0YTsKLQlzaXplID0gZnctPnNpemU7Ci0KLQl3aGlsZSAoc2l6ZSkgewotCQlyZXQgPS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XRpYyBjb25zdCBzdHJ1Y3QgZGV2X3BtX29wcyBpZl9zZGlvX3BtX29wcyA9IHsKLQkuc3VzcGVuZAk9IGlmX3NkaW9fc3VzcGVuZCwKLQkucmVzdW1lCQk9IGlmX3NkaW9fcmVzdW1lLAotfTsKLQotc3RhdGljIHN0cnVjdCBzZGlvX2RyaXZlciBpZl9zZGlvX2RyaXZlciA9IHsKLQkubmFtZQkJPSAibGliZXJ0YXNfc2RpbyIsCi0JLmlkX3RhYmxlCT0gaWZfc2Rpb19pZHMsCi0JLnByb2JlCQk9IGlmX3NkaW9fcHJvYmUsCi0JLnJlbW92ZQkJPSBpZl9zZGlvX3JlbW92ZSwKLQkuZHJ2ID0gewotCQkucG0gPSAmaWZfc2Rpb19wbV9vcHMsCi0JfSwKLX07Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogTW9kdWxlIGZ1bmN0aW9ucyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotc3RhdGljIGludCBfX2luaXQgaWZfc2Rpb19pbml0X21vZHVsZSh2b2lkKQotewotCWludCByZXQgPSAwOwotCi0JbGJzX2RlYl9lbnRlcihMQlNfREVCX1NESU8pOwotCi0JcHJpbnRrKEtFUk5fSU5GTyAibGliZXJ0YXNfc2RpbzogTGliZXJ0YXMgU0RJTyBkcml2ZXJcbiIpOwotCXByaW50ayhLRVJOX0lORk8gImxpYmVydGFzX3NkaW86IENvcHlyaWdodCBQaWVycmUgT3NzbWFuXG4iKTsKLQotCXJldCA9IHNkaW9fcmVnaXN0ZXJfZHJpdmVyKCZpZl9zZGlvX2RyaXZlcik7Ci0KLQkvKiBDbGVhciB0aGUgZmxhZyBpbiBjYXNlIHVzZXIgcmVtb3Zlcy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AgICAgXAorCS5od192YWx1ZSAgICAgICAgID0gKF9jaGFubmVsKSwgICAgICAgICAgXAorCS5mbGFncyAgICAgICAgICAgID0gKF9mbGFncyksICAgICAgICAgICAgXAorCS5tYXhfYW50ZW5uYV9nYWluID0gMCwgICAgICAgICAgICAgICAgICAgXAorCS5tYXhfcG93ZXIgICAgICAgID0gMzAsICAgICAgICAgICAgICAgICAgXAorfQorCitzdGF0aWMgc3RydWN0IGllZWU4MDIxMV9jaGFubmVsIGxic18yZ2h6X2NoYW5uZWxzW10gPSB7CisJQ0hBTjJHKDEsICAyNDEyLCAwKSwKKwlDSEFOMkcoMiwgIDI0MTcsIDApLAorCUNIQU4yRygzLCAgMjQyMiwgMCksCisJQ0hBTjJHKDQsICAyNDI3LCAwKSwKKwlDSEFOMkcoNSwgIDI0MzIsIDApLAorCUNIQU4yRyg2LCAgMjQzNywgMCksCisJQ0hBTjJHKDcsICAyNDQyLCAwKSwKKwlDSEFOMkcoOCwgIDI0NDcsIDApLAorCUNIQU4yRyg5LCAgMjQ1MiwgMCksCisJQ0hBTjJHKDEwLCAyNDU3LCAwKSwKKwlDSEFOMkcoMTEsIDI0NjIsIDApLAorCUNIQU4yRygxMiwgMjQ2NywgMCksCisJQ0hBTjJHKDEzLCAyNDcyLCAwKSwKKwlDSEFOMkcoMTQsIDI0ODQsIDApLAorfTsKKworI2RlZmluZSBSQVRFVEFCX0VOVChfcmF0ZSwgX2h3X3ZhbHVlLCBfZmxhZ3MpIHsgXAorCS5iaXRyYXRlICA9IChfcmF0ZSksICAgICAgICAgICAgICAgICAgICBcCisJLmh3X3ZhbHVlID0gKF9od192YWx1ZSksICAgICAgICAgICAgICAgIFwKKwkuZmxhZ3MgICAgPSAoX2ZsYWdzKSwgICAgICAgICAgICAgICAgICAgXAorfQorCisKKy8qIFRhYmxlIDYgaW4gc2VjdGlvbiAzLjIuMS4xICovCitzdGF0aWMgc3RydWN0IGllZWU4MDIxMV9yYXRlIGxic19yYXRlc1tdID0geworCV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hZWxfbWljX2ZhaWx1cmUocHJpdi0+ZGV2LAorCQlwcml2LT5hc3NvY19ic3MsCisJCWV2ZW50ID09IE1BQ1JFR19JTlRfQ09ERV9NSUNfRVJSX01VTFRJQ0FTVCA/CisJCQlOTDgwMjExX0tFWVRZUEVfR1JPVVAgOgorCQkJTkw4MDIxMV9LRVlUWVBFX1BBSVJXSVNFLAorCQktMSwKKwkJTlVMTCwKKwkJR0ZQX0tFUk5FTCk7CisKKwlsYnNfZGViX2xlYXZlKExCU19ERUJfQ0ZHODAyMTEpOworfQorCisKKworCisvKgorICogQ29ubmVjdC9kaXNjb25uZWN0CisgKi8KKworCisvKgorICogVGhpcyByZW1vdmVzIGFsbCBXRVAga2V5cworICovCitzdGF0aWMgaW50IGxic19yZW1vdmVfd2VwX2tleXMoc3RydWN0IGxic19wcml2YXRlICpwcml2KQoreworCXN0cnVjdCBjbWRfZHNfODAyXzExX3NldF93ZXAgY21kOworCWludCByZXQ7CisKKwlsYnNfZGViX2VudGVyKExCU19ERUJfQ0ZHODAyMTEpOworCisJbWVtc2V0KCZjbWQsIDAsIHNpemVvZihjbWQpKTsKKwljbWQuaGRyLnNpemUgPSBjcHVfdG9fbGUxNihzaXplb2YoY21kKSk7CisJY21kLmtleWluZGV4ID0gY3B1X3RvX2xlMTYocHJpdi0+d2VwX3R4X2tleSk7CisJY21kLmFjdGlvbiA9IGNwdV90b19sZTE2KENNRF9BQ1RfUkVNT1ZFKTsKKworCXJldCA9IGxic19jbWRfd2l0aF9yZXNwb25zZShwcml2LCBDTURfODAyXzExX1NFVF9XRVAsICZjbWQpOworCisJbGJzX2RlYl9sZWF2ZShMQlNfREVCX0NGRzgwMjExKTsKKwlyZXR1cm4gcmV0OworfQorCisvKgorICogU2V0IFdFUCBrZXlzCisgKi8KK3N0YXRpYyBpbnQgbGJzX3NldF93ZXBfa2V5cyhzdHJ1Y3QgbGJzX3ByaXZhdGUgKnByaXYpCit7CisJc3RydWN0IGNtZF9kc184MDJfMTFfc2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lbmNlICAgeHggeHgKKwkgKiByZXN1bHQgICAgIDAwIDAwCisJICogQlNTIGlkICAgICAwMCAxMyAxOSA4MCBkYSAzMAorCSAqIGF1dGggdHlwZSAgMDAKKwkgKiByZXNlcnZlZCAgIDAwIDAwIDAwIDAwIDAwIDAwIDAwIDAwIDAwIDAwCisJICovCisJbWVtc2V0KCZjbWQsIDAsIHNpemVvZihjbWQpKTsKKwljbWQuaGRyLnNpemUgPSBjcHVfdG9fbGUxNihzaXplb2YoY21kKSk7CisJaWYgKHNtZS0+YnNzaWQpCisJCW1lbWNweShjbWQuYnNzaWQsIHNtZS0+YnNzaWQsIEVUSF9BTEVOKTsKKwkvKiBjb252ZXJ0IGF1dGhfdHlwZSAqLworCXJldCA9IGxic19hdXRoX3RvX2F1dGh0eXBlKHNtZS0+YXV0aF90eXBlKTsKKwlpZiAocmV0IDwgMCkKKwkJZ290byBkb25lOworCisJY21kLmF1dGh0eXBlID0gcmV0OworCXJldCA9IGxic19jbWRfd2l0aF9yZXNwb25zZShwcml2LCBDTURfODAyXzExX0FVVEhFTlRJQ0FURSwgJmNtZCk7CisKKyBkb25lOgorCWxic19kZWJfbGVhdmVfYXJncyhMQlNfREVCX0NGRzgwMjExLCAicmV0ICVkIiwgcmV0KTsKKwlyZXR1cm4gcmV0OworfQorCisKKy8qCisgKiBDcmVhdGUgYXNzb2NpYXRpb24gcmVxdWVzdAorICovCisjZGVmaW5lIExCU19BU1NPQ19NQVhfQ01EX1NJWkUgICAgICAgICAgICAgICAgICAgICBcCisJKHNpemVvZihzdHJ1Y3QgY21kX2RzXzgwMl8xMV9hc3NvY2lhdGUpICAgIFwKKwkgLSA1MTIgLyogY21kX2RzXzgwMl8xMV9hc3NvY2lhdGUuaWVidWYgKi8gXAorCSArIExCU19NQVhfU1NJRF9UTFZfU0laRSAgICAgICAgICAgICAgICAgICBcCisJICsgTEJTX01BWF9DSEFOTkVMX1RMVl9TSVpFICAgICAgICAgICAgICAgIFwKKwkgKyBMQlNfT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ZCBhY2Nlc3MgKi8KKwlzdGF0dXMgPSBsZTE2X3RvX2NwdShyZXNwLT5zdGF0dXNjb2RlKTsKKworCS8qIE9sZGVyIEZXIHZlcnNpb25zIG1hcCB0aGUgSUVFRSA4MDIuMTEgU3RhdHVzIENvZGUgaW4gdGhlIGFzc29jaWF0aW9uCisJICogcmVzcG9uc2UgdG8gdGhlIGZvbGxvd2luZyB2YWx1ZXMgcmV0dXJuZWQgaW4gcmVzcC0+c3RhdHVzY29kZToKKwkgKgorCSAqICAgIElFRUUgU3RhdHVzIENvZGUgICAgICAgICAgICAgICAgTWFydmVsbCBTdGF0dXMgQ29kZQorCSAqICAgIDAgICAgICAgICAgICAgICAgICAgICAgIC0+ICAgICAgMHgwMDAwIEFTU09DX1JFU1VMVF9TVUNDRVNTCisJICogICAgMTMgICAgICAgICAgICAgICAgICAgICAgLT4gICAgICAweDAwMDQgQVNTT0NfUkVTVUxUX0FVVEhfUkVGVVNFRAorCSAqICAgIDE0ICAgICAgICAgICAgICAgICAgICAgIC0+ICAgICAgMHgwMDA0IEFTU09DX1JFU1VMVF9BVVRIX1JFRlVTRUQKKwkgKiAgICAxNSAgICAgICAgICAgICAgICAgICAgICAtPiAgICAgIDB4MDAwNCBBU1NPQ19SRVNVTFRfQVVUSF9SRUZVU0VECisJICogICAgMTYgICAgICAgICAgICAgICAgICAgICAgLT4gICAgICAweDAwMDQgQVNTT0NfUkVTVUxUX0FVVEhfUkVGVVNFRAorCSAqICAgIG90aGVycyAgICAgICAgICAgICAgICAgIC0+ICAgICAgMHgwMDAzIEFTU09DX1JFU1VMVF9SRUZVU0VECisJICoKKwkgKiBPdGhlciByZXNwb25zZSBjb2RlczoKKwkgKiAgICAweDAwMDEgLT4gQVNTT0NfUkVTVUxUX0lOVkFMSURfUEFSQU1FVEVSUyAodW51c2VkKQorCSAqICAgIDB4MDAwMiAtPiBBU1NPQ19SRVNVTFRfVElNRU9VVCAoaW50ZXJuYWwgdGltZXIgZXhwaXJlZCB3YW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U0lEX0xFTiArIC8qIHNzaWQgKi8KKwkJICAgMiArIDQgKyAgICAgICAgICAgICAgICAgICAgICAvKiBiYXNpYyByYXRlcyAqLworCQkgICAyICsgMSArICAgICAgICAgICAgICAgICAgICAgIC8qIERTIHBhcmFtZXRlciAqLworCQkgICAyICsgMiArICAgICAgICAgICAgICAgICAgICAgIC8qIGF0aW0gKi8KKwkJICAgMiArIDhdOyAgICAgICAgICAgICAgICAgICAgICAvKiBleHRlbmRlZCByYXRlcyAqLworCXU4ICpmYWtlID0gZmFrZV9pZTsKKwlzdHJ1Y3QgY2ZnODAyMTFfYnNzICpic3M7CisKKwlsYnNfZGViX2VudGVyKExCU19ERUJfQ0ZHODAyMTEpOworCisJLyoKKwkgKiBGb3IgY2ZnODAyMTFfaW5mb3JtX2Jzcywgd2UnbGwgbmVlZCBhIGZha2UgSUUsIGFzIHdlIGNhbid0IGdldAorCSAqIHRoZSByZWFsIElFIGZyb20gdGhlIGZpcm13YXJlLiBTbyB3ZSBmYWJyaWNhdGUgYSBmYWtlIElFIGJhc2VkIG9uCisJICogd2hhdCB0aGUgZmlybXdhcmUgYWN0dWFsbHkgc2VuZHMgKHNuaWZmZWQgd2l0aCB3aXJlc2hhcmspLgorCSAqLworCS8qIEZha2UgU1NJRCBJRSAqLworCSpmYWtlKysgPSBXTEFOX0VJRF9TU0lEOworCSpmYWtlKysgPSBwYXJhbXMtPnNzaWRfbGVuOworCW1lbWNweShmYWtlLCBwYXJhbXMtPnNzaWQsIHBhcmFtcy0+c3NpZF9sZW4pOworCWZha2UgKz0gcGFyYW1zLT5zc2lkX2xlbjsKKwkvKiBGYWtlIHN1cHBvcnRlZCBiYXNpYyByYXRlcyBJRSAqLworCSpmYWtlKysgPSBXTEFOX0VJRF9TVVBQX1JBVEVTOworCSpmYWtlKysgPSA0OworCSpmYWtlKysgPSAweDgyOworCSpmYWtlKysgPSAweDg0OworCSpmYWtlKysgPSAweDhiOworCSpmYWtlKysgPSAweDk2OworCS8qIEZha2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kIG9uIHNjYW4gcmVzdWx0ICovCisJcmV0ID0gbGJzX3NldF9yYWRpbyhwcml2LCBwcmVhbWJsZSwgMSk7CisJaWYgKHJldCkKKwkJZ290byBvdXQ7CisKKwkvKgorCSAqIEV4YW1wbGUgQ01EXzgwMl8xMV9BRF9IT0NfSk9JTiBjb21tYW5kOgorCSAqCisJICogY29tbWFuZCAgICAgICAgIDJjIDAwICAgICAgICAgQ01EXzgwMl8xMV9BRF9IT0NfSk9JTgorCSAqIHNpemUgICAgICAgICAgICA2NSAwMAorCSAqIHNlcXVlbmNlICAgICAgICB4eCB4eAorCSAqIHJlc3VsdCAgICAgICAgICAwMCAwMAorCSAqIGJzc2lkICAgICAgICAgICAwMiAyNyAyNyA5NyAyZiA5NgorCSAqIHNzaWQgICAgICAgICAgICA0OSA0MiA1MyA1MyAwMCAwMCAwMCAwMAorCSAqICAgICAgICAgICAgICAgICAwMCAwMCAwMCAwMCAwMCAwMCAwMCAwMAorCSAqICAgICAgICAgICAgICAgICAwMCAwMCAwMCAwMCAwMCAwMCAwMCAwMAorCSAqICAgICAgICAgICAgICAgICAwMCAwMCAwMCAwMCAwMCAwMCAwMCAwMAorCSAqIHR5cGUgICAgICAgICAgICAwMiAgICAgICAgICAgIENNRF9CU1NfVFlQRV9JQlNTCisJICogYmVhY29uIHBlcmlvZCAgIDY0IDAwCisJICogZHRpbSBwZXJpb2QgICAgIDAwCisJICogdGltZXN0YW1wICAgICAgIDAwIDAwIDAwIDAwIDAwIDAwIDAwIDAwCisJICogbG9jYWx0aW1lICAgICAgIDAwIDAwIDAwIDAwIDAwIDAwIDAwIDAwCisJICogSUUgRFMgICAgICAgICAgIDAzCisJICogSUUgRFMgbGVuICAgICAgIDAxCisJICogSUUgRFMgY2hhbm5lbCAgIDAxCisJICogcmVzZXJ2ZWVkICAgICAgIDAwIDAwIDAwIDAwCisJICogSUUgSUJTUyAgICAgICAgIDA2CisJICogSUUgSUJTUyBsZW4gICAgIDAyCisJICogSUUgSUJTU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fcmFkaW8ocHJpdiwgcHJlYW1ibGUsIDEpOworCWlmIChyZXQpCisJCWdvdG8gb3V0OworCisJLyoKKwkgKiBFeGFtcGxlIENNRF84MDJfMTFfQURfSE9DX1NUQVJUIGNvbW1hbmQ6CisJICoKKwkgKiBjb21tYW5kICAgICAgICAgMmIgMDAgICAgICAgICBDTURfODAyXzExX0FEX0hPQ19TVEFSVAorCSAqIHNpemUgICAgICAgICAgICBiMSAwMAorCSAqIHNlcXVlbmNlICAgICAgICB4eCB4eAorCSAqIHJlc3VsdCAgICAgICAgICAwMCAwMAorCSAqIHNzaWQgICAgICAgICAgICA1NCA0NSA1MyA1NCAwMCAwMCAwMCAwMAorCSAqICAgICAgICAgICAgICAgICAwMCAwMCAwMCAwMCAwMCAwMCAwMCAwMAorCSAqICAgICAgICAgICAgICAgICAwMCAwMCAwMCAwMCAwMCAwMCAwMCAwMAorCSAqICAgICAgICAgICAgICAgICAwMCAwMCAwMCAwMCAwMCAwMCAwMCAwMAorCSAqIGJzcyB0eXBlICAgICAgICAwMgorCSAqIGJlYWNvbiBwZXJpb2QgICA2NCAwMAorCSAqIGR0aW0gcGVyaW9kICAgICAwMAorCSAqIElFIElCU1MgICAgICAgICAwNgorCSAqIElFIElCU1MgbGVuICAgICAwMgorCSAqIElFIElCU1MgYXRpbSAgICAwMCAwMAorCSAqIHJlc2VydmVkICAgICAgICAwMCAwMCAwMCAwMAorCSAqIElFIERTICAgICAgICAgICAwMworCSAqIElFIERTIGxlbiAgICAgICAwMQorCSAqIElFIERTIGNoYW5uZWwgICAwMQorCSAqIHJlc2VydmVkICAgICAgICAwMCAwMCAwMCAwMAorCSAqIHByb2JlIGRlbGF5ICAgICAwMCAwMAorCSAqIGNhcGFiaWxpdHkgICAgICAwMiAwMAorCSAqIHJhdGVzICAgICAgICAgICA4MiA4NCA4YiA5NiAgIChiYXNpYyByYXRlcyB3aXRoIGhhdmUgYml0IDcgc2V0KQorCSAqICAgICAgICAgICAgICAgICAwYyAxMiAx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yZCk7CitzdGF0aWMgaW50IGlmX3NkaW9fcG93ZXJfb2ZmKHN0cnVjdCBpZl9zZGlvX2NhcmQgKmNhcmQpOworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBJL08gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qCisgKiAgRm9yIFNEODM4NS9TRDg2ODYsIHRoaXMgZnVuY3Rpb24gcmVhZHMgZmlybXdhcmUgc3RhdHVzIGFmdGVyCisgKiAgdGhlIGltYWdlIGlzIGRvd25sb2FkZWQsIG9yIHJlYWRzIFJYIHBhY2tldCBsZW5ndGggd2hlbgorICogIGludGVycnVwdCAod2l0aCBJRl9TRElPX0hfSU5UX1VQTEQgYml0IHNldCkgaXMgcmVjZWl2ZWQuCisgKiAgRm9yIFNEODY4OCwgdGhpcyBmdW5jdGlvbiByZWFkcyBmaXJtd2FyZSBzdGF0dXMgb25seS4KKyAqLworc3RhdGljIHUxNiBpZl9zZGlvX3JlYWRfc2NyYXRjaChzdHJ1Y3QgaWZfc2Rpb19jYXJkICpjYXJkLCBpbnQgKmVycikKK3sKKwlpbnQgcmV0OworCXUxNiBzY3JhdGNoOworCisJc2NyYXRjaCA9IHNkaW9fcmVhZGIoY2FyZC0+ZnVuYywgY2FyZC0+c2NyYXRjaF9yZWcsICZyZXQpOworCWlmICghcmV0KQorCQlzY3JhdGNoIHw9IHNkaW9fcmVhZGIoY2FyZC0+ZnVuYywgY2FyZC0+c2NyYXRjaF9yZWcgKyAxLAorCQkJCQkmcmV0KSA8PCA4OworCisJaWYgKGVycikKKwkJKmVyciA9IHJldDsKKworCWlmIChyZXQpCisJCXJldHVybiAweGZmZmY7CisKKwlyZXR1cm4gc2NyY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KTsKKworCQlzZGlvX3JlbGVhc2VfaG9zdChjYXJkLT5mdW5jKTsKKworCQlrZnJlZShwYWNrZXQpOworCX0KKworCWxic19kZWJfbGVhdmUoTEJTX0RFQl9TRElPKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogRmlybXdhcmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjZGVmaW5lIEZXX0RMX1JFQURZX1NUQVRVUyAoSUZfU0RJT19JT19SRFkgfCBJRl9TRElPX0RMX1JEWSkKKworc3RhdGljIGludCBpZl9zZGlvX3Byb2dfaGVscGVyKHN0cnVjdCBpZl9zZGlvX2NhcmQgKmNhcmQsCisJCQkJY29uc3Qgc3RydWN0IGZpcm13YXJlICpmdykKK3sKKwlpbnQgcmV0OworCXVuc2lnbmVkIGxvbmcgdGltZW91dDsKKwl1OCAqY2h1bmtfYnVmZmVyOworCXUzMiBjaHVua19zaXplOworCWNvbnN0IHU4ICpmaXJtd2FyZTsKKwlzaXplX3Qgc2l6ZTsKKworCWxic19kZWJfZW50ZXIoTEJTX0RFQl9TRElPKTsKKworCWNodW5rX2J1ZmZlciA9IGt6YWxsb2MoNjQsIEdGUF9LRVJORUwpOworCWlmICghY2h1bmtfYnVmZmVyKSB7CisJCXJldCA9IC1FTk9NRU07CisJCWdvdG8gb3V0OworCX0KKworCXNkaW9fY2xhaW1faG9zdChjYXJkLT5mdW5jKTsKKworCXJldCA9IHNkaW9fc2V0X2Jsb2NrX3NpemUoY2FyZC0+ZnVuYywgMzIpOworCWlmIChyZXQpCisJCWdvdG8gcmVsZWFzZTsKKworCWZpcm13YXJlID0gZnctPmRhdGE7CisJc2l6ZSA9IGZ3LT5zaXplOworCisJd2h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k1XQVJFX09LKSB7CisJCWxic19kZWJfc2RpbygiZmlybXdhcmUgYWxyZWFkeSBsb2FkZWRcbiIpOworCQlpZl9zZGlvX2ZpbmlzaF9wb3dlcl9vbihjYXJkKTsKKwkJcmV0dXJuIDA7CisJfSBlbHNlIGlmICgoY2FyZC0+bW9kZWwgPT0gTU9ERUxfODY4NikgJiYgKHNjcmF0Y2ggJiAweDdmZmYpKSB7CisJCWxic19kZWJfc2RpbygiZmlybXdhcmUgbWF5IGJlIHJ1bm5pbmdcbiIpOworCQlpZl9zZGlvX2ZpbmlzaF9wb3dlcl9vbihjYXJkKTsKKwkJcmV0dXJuIDA7CisJfQorCisJcmV0ID0gbGJzX2dldF9maXJtd2FyZV9hc3luYyhjYXJkLT5wcml2LCAmY2FyZC0+ZnVuYy0+ZGV2LCBjYXJkLT5tb2RlbCwKKwkJCQkgICAgIGZ3X3RhYmxlLCBpZl9zZGlvX2RvX3Byb2dfZmlybXdhcmUpOworCitvdXQ6CisJbGJzX2RlYl9sZWF2ZV9hcmdzKExCU19ERUJfU0RJTywgInJldCAlZCIsIHJldCk7CisJcmV0dXJuIHJldDsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogUG93ZXIgbWFuYWdlbWVudCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKiBGaW5pc2ggcG93ZXIgb24gc2VxdWVuY2UgKGFmdGVyIGZpcm13YXJlIGlzIGxvYWRlZCkgKi8KK3N0YXRpYyB2b2lkIGlmX3NkaW9fZmluaXNoX3Bvd2VyX29uKHN0cnVjdCBpZl9zZGlvX2NhcmQgKmNhcmQpCit7CisJc3RydWN0IHNkaW9fZnVuYyAqZnVuYyA9IGNhcmQtPmZ1bmM7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Vhc2U6CisJc2Rpb19yZWxlYXNlX2hvc3QoZnVuYyk7CisJcmV0dXJuIHJldDsKK30KKworc3RhdGljIGludCBpZl9zZGlvX3Bvd2VyX29mZihzdHJ1Y3QgaWZfc2Rpb19jYXJkICpjYXJkKQoreworCXN0cnVjdCBzZGlvX2Z1bmMgKmZ1bmMgPSBjYXJkLT5mdW5jOworCXN0cnVjdCBsYnNfcHJpdmF0ZSAqcHJpdiA9IGNhcmQtPnByaXY7CisKKwlwcml2LT5md19yZWFkeSA9IDA7CisKKwlzZGlvX2NsYWltX2hvc3QoZnVuYyk7CisJc2Rpb19yZWxlYXNlX2lycShmdW5jKTsKKwlzZGlvX2Rpc2FibGVfZnVuYyhmdW5jKTsKKwlzZGlvX3JlbGVhc2VfaG9zdChmdW5jKTsKKwlyZXR1cm4gMDsKK30KKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qIExpYmVydGFzIGNhbGxiYWNrcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3N0YXRpYyBpbnQgaWZfc2Rpb19ob3N0X3RvX2NhcmQoc3RydWN0IGxic19wcml2YXRlICpwcml2LAorCQl1OCB0eXBlLCB1OCAqYnVmLCB1MTYgbmIpCit7CisJaW50IHJldDsKKwlzdHJ1Y3QgaWZfc2Rpb19jYXJkICpjYXJkOworCXN0cnVjdCBpZl9zZGlvX3BhY2tldCAqcGFja2V0LCAqY3VyOworCXUxNiBzaXplOworCXVuc2lnbmVkIGxvbmcgZmxhZ3M7CisKKwlsYnNfZGViX2VudGVyX2FyZ3MoTEJTX0RFQl9TRElPLCAidHlwZSAlZCwgYnl0ZXMgJWQiLCB0eXBlLCBuYik7CisKKwljYXJkID0gcHJpdi0+Y2FyZDsK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qKioqKioqKioqKioqLworLyogU0RJTyBjYWxsYmFja3MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworc3RhdGljIHZvaWQgaWZfc2Rpb19pbnRlcnJ1cHQoc3RydWN0IHNkaW9fZnVuYyAqZnVuYykKK3sKKwlpbnQgcmV0OworCXN0cnVjdCBpZl9zZGlvX2NhcmQgKmNhcmQ7CisJdTggY2F1c2U7CisKKwlsYnNfZGViX2VudGVyKExCU19ERUJfU0RJTyk7CisKKwljYXJkID0gc2Rpb19nZXRfZHJ2ZGF0YShmdW5jKTsKKworCWNhdXNlID0gc2Rpb19yZWFkYihjYXJkLT5mdW5jLCBJRl9TRElPX0hfSU5UX1NUQVRVUywgJnJldCk7CisJaWYgKHJldCB8fCAhY2F1c2UpCisJCWdvdG8gb3V0OworCisJbGJzX2RlYl9zZGlvKCJpbnRlcnJ1cHQ6IDB4JVhcbiIsICh1bnNpZ25lZCljYXVzZSk7CisKKwlzZGlvX3dyaXRlYihjYXJkLT5mdW5jLCB+Y2F1c2UsIElGX1NESU9fSF9JTlRfU1RBVFVTLCAmcmV0KTsKKwlpZiAocmV0KQorCQlnb3RvIG91dDsKKworCS8qCisJICogSWdub3JlIHRoZSBkZWZpbmUgbmFtZSwgdGhpcyByZWFsbHkgbWVhbnMgdGhlIGNhcmQgaGFzCisJICogc3VjY2Vzc2Z1bGx5IHJlY2VpdmVkIHRoZSBjb21tYW5kLgorCSAqLworCWNhcmQtPnByaXYtPmlzX2FjdGl2aXR5X2RldGVjdGVkID0gMTsKKwlpZiAoY2F1c2UgJiBJRl9TRElPX0hfSU5UX0ROTEQpCisJCWxic19ob3N0X3RvX2NhcmRfZG9uZShjYXJkLT5wcml2KTsKKworCisJaWYgKGNhdXNlICYgSUZfU0RJT19IX0lOVF9VUExEKSB7CisJCXJldC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mRsZXIuCisgKgorICogVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgd2hlbiB0aGUgJ2luZm8nIGZpbGUgaXMgb3BlbmVkIGZvciByZWFkaW5nLgorICogSXQgcHJpbnRzIHRoZSBmb2xsb3dpbmcgZHJpdmVyIHJlbGF0ZWQgaW5mb3JtYXRpb24gLQorICogICAgICAtIERyaXZlciBuYW1lCisgKiAgICAgIC0gRHJpdmVyIHZlcnNpb24KKyAqICAgICAgLSBEcml2ZXIgZXh0ZW5kZWQgdmVyc2lvbgorICogICAgICAtIEludGVyZmFjZSBuYW1lCisgKiAgICAgIC0gQlNTIG1vZGUKKyAqICAgICAgLSBNZWRpYSBzdGF0ZSAoY29ubmVjdGVkIG9yIGRpc2Nvbm5lY3RlZCkKKyAqICAgICAgLSBNQUMgYWRkcmVzcworICogICAgICAtIFRvdGFsIG51bWJlciBvZiBUeCBieXRlcworICogICAgICAtIFRvdGFsIG51bWJlciBvZiBSeCBieXRlcworICogICAgICAtIFRvdGFsIG51bWJlciBvZiBUeCBwYWNrZXRzCisgKiAgICAgIC0gVG90YWwgbnVtYmVyIG9mIFJ4IHBhY2tldHMKKyAqICAgICAgLSBUb3RhbCBudW1iZXIgb2YgZHJvcHBlZCBUeCBwYWNrZXRzCisgKiAgICAgIC0gVG90YWwgbnVtYmVyIG9mIGRyb3BwZWQgUnggcGFja2V0cworICogICAgICAtIFRvdGFsIG51bWJlciBvZiBjb3JydXB0ZWQgVHggcGFja2V0cworICogICAgICAtIFRvdGFsIG51bWJlciBvZiBjb3JydXB0ZWQgUnggcGFja2V0cworICogICAgICAtIENhcnJpZXIgc3RhdHVzIChvbiBvciBvZmYpCisgKiAgICAgIC0gVHggcXVldWUgc3RhdHVzIChzdGFydGVkIG9yIHN0b3BwZWQpCisgKgorICogRm9yIFNUQSBtb2RlIGRyaXZlcnMsIGl0IGFsc28gcHJpbnRzIHRoZSBmb2xsb3dpbmcgZXh0cmEgLQorICogICAgICAtIEVTU0lECisgKiAgIC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ZXh0KHByaXYpOworCisJcCArPSBzcHJpbnRmKHAsICJkcml2ZXJfbmFtZSA9ICIgIlwibXdpZmlleFwiXG4iKTsKKwlwICs9IHNwcmludGYocCwgImRyaXZlcl92ZXJzaW9uID0gJXMiLCBmbXQpOworCXAgKz0gc3ByaW50ZihwLCAiXG52ZXJleHQgPSAlcyIsIHByaXYtPnZlcnNpb25fc3RyKTsKKwlwICs9IHNwcmludGYocCwgIlxuaW50ZXJmYWNlX25hbWU9XCIlc1wiXG4iLCBuZXRkZXYtPm5hbWUpOworCisJaWYgKGluZm8uYnNzX21vZGUgPj0gQVJSQVlfU0laRShic3NfbW9kZXMpKQorCQlwICs9IHNwcmludGYocCwgImJzc19tb2RlPVwiJWRcIlxuIiwgaW5mby5ic3NfbW9kZSk7CisJZWxzZQorCQlwICs9IHNwcmludGYocCwgImJzc19tb2RlPVwiJXNcIlxuIiwgYnNzX21vZGVzW2luZm8uYnNzX21vZGVdKTsKKworCXAgKz0gc3ByaW50ZihwLCAibWVkaWFfc3RhdGU9XCIlc1wiXG4iLAorCQkgICAgICghcHJpdi0+bWVkaWFfY29ubmVjdGVkID8gIkRpc2Nvbm5lY3RlZCIgOiAiQ29ubmVjdGVkIikpOworCXAgKz0gc3ByaW50ZihwLCAibWFjX2FkZHJlc3M9XCIlcE1cIlxuIiwgbmV0ZGV2LT5kZXZfYWRkcik7CisKKwlpZiAoR0VUX0JTU19ST0xFKHByaXYpID09IE1XSUZJRVhfQlNTX1JPTEVfU1RBKSB7CisJCXAgKz0gc3ByaW50ZihwLCAibXVsdGljYXN0X2NvdW50PVwiJWRcIlxuIiwKKwkJCSAgICAgbmV0ZGV2X21jX2NvdW50KG5ldGRldikpOworCQlwICs9IHNwcmludGYocCwgImVzc2lkPVwiJXNcIlxuIiwgaW5mby5zc2lkLnNzaWQpOworCQlwICs9IHNwcmludGYocCwgImJzc2lkPVwiJXBNXCJcbiIsIGluZm8uYnNzaWQpOworCQlwICs9IHNwcmludGYocCwgImNoYW5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iAgICAgIC0gV01NIEFDIEJLIHBhY2tldHMgY291bnQKKyAqICAgICAgLSBNYXhpbXVtIFR4IGJ1ZmZlciBzaXplCisgKiAgICAgIC0gVHggYnVmZmVyIHNpemUKKyAqICAgICAgLSBDdXJyZW50IFR4IGJ1ZmZlciBzaXplCisgKiAgICAgIC0gUG93ZXIgU2F2ZSBtb2RlCisgKiAgICAgIC0gUG93ZXIgU2F2ZSBzdGF0ZQorICogICAgICAtIERlZXAgU2xlZXAgc3RhdHVzCisgKiAgICAgIC0gRGV2aWNlIHdha2V1cCByZXF1aXJlZCBzdGF0dXMKKyAqICAgICAgLSBOdW1iZXIgb2Ygd2FrZXVwIHRyaWVzCisgKiAgICAgIC0gSG9zdCBTbGVlcCBjb25maWd1cmVkIHN0YXR1cworICogICAgICAtIEhvc3QgU2xlZXAgYWN0aXZhdGVkIHN0YXR1cworICogICAgICAtIE51bWJlciBvZiBUeCB0aW1lb3V0cworICogICAgICAtIE51bWJlciBvZiBjb21tYW5kIHRpbWVvdXRzCisgKiAgICAgIC0gTGFzdCB0aW1lZCBvdXQgY29tbWFuZCBJRAorICogICAgICAtIExhc3QgdGltZWQgb3V0IGNvbW1hbmQgYWN0aW9uCisgKiAgICAgIC0gTGFzdCBjb21tYW5kIElECisgKiAgICAgIC0gTGFzdCBjb21tYW5kIGFjdGlvbgorICogICAgICAtIExhc3QgY29tbWFuZCBpbmRleAorICogICAgICAtIExhc3QgY29tbWFuZCByZXNwb25zZSBJRAorICogICAgICAtIExhc3QgY29tbWFuZCByZXNwb25zZSBpbmRleAorICogICAgICAtIExhc3QgZXZlbnQKKyAqICAgICAgLSBMYXN0IGV2ZW50IGluZGV4CisgKiAgICAgIC0gTnVtYmVyIG9mIGhvc3QgdG8gY2FyZCBjb21tYW5kIGZhaWx1cmVzCisgKiAgICAgIC0gTnVtYmVyIG9mIHNsZWVwIGNvbmZpcm0gY29tbWFuZCBmYWlsdXJlcworICogICAgICAtIE51bWJlciBvZiBob3N0IHRvIGN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19mb3BzID0geyAgICAgICBcCisJLnJlYWQgPSBtd2lmaWV4XyMjbmFtZSMjX3JlYWQsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwkud3JpdGUgPSBtd2lmaWV4XyMjbmFtZSMjX3dyaXRlLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCS5vcGVuID0gc2ltcGxlX29wZW4sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCit9OworCisjZGVmaW5lIE1XSUZJRVhfREZTX0ZJTEVfUkVBRF9PUFMobmFtZSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCitzdGF0aWMgY29uc3Qgc3RydWN0IGZpbGVfb3BlcmF0aW9ucyBtd2lmaWV4X2Rmc18jI25hbWUjI19mb3BzID0geyAgICAgICBcCisJLnJlYWQgPSBtd2lmaWV4XyMjbmFtZSMjX3JlYWQsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwkub3BlbiA9IHNpbXBsZV9vcGVuLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorfTsKKworI2RlZmluZSBNV0lGSUVYX0RGU19GSUxFX1dSSVRFX09QUyhuYW1lKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorc3RhdGljIGNvbnN0IHN0cnVjdCBmaWxlX29wZXJhdGlvbnMgbXdpZmlleF9kZnNfIyNuYW1lIyNfZm9wcyA9IHsgICAgICAgXAorCS53cml0ZSA9IG13aWZpZXhfIyNuYW1lIyNfd3JpdGUsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJLm9wZW4gPSBzaW1wbGVfb3BlbiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKK307CisKKworTVdJRklFWF9ERlNfRklMRV9SRUFEX09QUyhpbmZvKTsKK01XSUZJRVhfREZTX0ZJTEVfUkVBRF9PUFMoZGVidWcpOworTVdJR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gICAgIDB4MDMKKyNkZWZpbmUgTU9EX0NMQVNTX09GRE0gICAgICAgICAgMHgwNworI2RlZmluZSBNT0RfQ0xBU1NfSFQgICAgICAgICAgICAweDA4CisjZGVmaW5lIEhUX0JXXzIwICAgIDAKKyNkZWZpbmUgSFRfQldfNDAgICAgMQorCisjZGVmaW5lIERGU19DSEFOX01PVkVfVElNRSAgICAgIDEwMDAwCisKKyNkZWZpbmUgSG9zdENtZF9DTURfR0VUX0hXX1NQRUMgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMworI2RlZmluZSBIb3N0Q21kX0NNRF84MDJfMTFfU0NBTiAgICAgICAgICAgICAgICAgICAgICAgMHgwMDA2CisjZGVmaW5lIEhvc3RDbWRfQ01EXzgwMl8xMV9HRVRfTE9HICAgICAgICAgICAgICAgICAgICAweDAwMGIKKyNkZWZpbmUgSG9zdENtZF9DTURfTUFDX01VTFRJQ0FTVF9BRFIgICAgICAgICAgICAgICAgIDB4MDAxMAorI2RlZmluZSBIb3N0Q21kX0NNRF84MDJfMTFfRUVQUk9NX0FDQ0VTUyAgICAgICAgICAgICAgMHgwMDU5CisjZGVmaW5lIEhvc3RDbWRfQ01EXzgwMl8xMV9BU1NPQ0lBVEUgICAgICAgICAgICAgICAgICAweDAwMTIKKyNkZWZpbmUgSG9zdENtZF9DTURfODAyXzExX1NOTVBfTUlCICAgICAgICAgICAgICAgICAgIDB4MDAxNgorI2RlZmluZSBIb3N0Q21kX0NNRF9NQUNfUkVHX0FDQ0VTUyAgICAgICAgICAgICAgICAgICAgMHgwMDE5CisjZGVmaW5lIEhvc3RDbWRfQ01EX0JCUF9SRUdfQUNDRVNTICAgICAgICAgICAgICAgICAgICAweDAwMWEKKyNkZWZpbmUgSG9zdENtZF9DTURfUkZfUkVHX0FDQ0VTUyAgICAgICAgICAgICAgICAgICAgIDB4MDAxYgorI2RlZmluZSBIb3N0Q21kX0NNRF9QTUlDX1JFR19BQ0NFU1MgICAgICAgICAgICAgICAgICAgMHgwMGFkCisjZGVmaW5lIEhvc3RDbWRfQ01EX1JGX1RYX1BXUiAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMWUKKyNkZWZpbmUgSG9zdENtZF9DTURfUkZfQU5URU5OQSAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAyMAorI2RlZmluZSBIb3N0Q21kX0NNRF84MDJfMTFfREVBVVRIRU5USUNBVEUgICAgICAgICAgICAgMHgwMDI0CisjZGVmaW5lIEhvc3RDbWRfQ01EX01BQ19DT05UUk9MICAgICAgICAgICAgICAgICAgICAgICAweDAwMjgKKyNkZWZpbmUgSG9zdENtZF9DTURfODAyXzExX0FEX0hPQ19TVEFSVCAgICAgICAgICAgICAgIDB4MDAyYgorI2RlZmluZSBIb3N0Q21kX0NNRF84MDJfMTFfQURfSE9DX0pPSU4gICAgICAgICAgICAgICAgMHgwMDJjCisjZGVmaW5lIEhvc3RDbWRfQ01EXzgwMl8xMV9BRF9IT0NfU1RPUCAgICAgICAgICAgICAgICAweDAwNDAKKyNkZWZpbmUgSG9zdENtZF9DTURfODAyXzExX01BQ19BRERSRVNTICAgICAgICAgICAgICAgIDB4MDA0RAorI2RlZmluZSBIb3N0Q21kX0NNRF84MDJfMTFEX0RPTUFJTl9JTkZPICAgICAgICAgICAgICAgMHgwMDViCisjZGVmaW5lIEhvc3RDbWRfQ01EXzgwMl8xMV9LRVlfTUFURVJJQUwgICAgICAgICAgICAgICAweDAwNWUKKyNkZWZpbmUgSG9zdENtZF9DTURfODAyXzExX0JHX1NDQU5fUVVFUlkgICAgICAgICAgICAgIDB4MDA2YworI2RlZmluZSBIb3N0Q21kX0NNRF9XTU1fR0VUX1NUQVRVUyAgICAgICAgICAgICAgICAgICAgMHgwMDcxCisjZGVmaW5lIEhvc3RDbWRfQ01EXzgwMl8xMV9TVUJTQ1JJQkVfRVZFTlQgICAgICAgICAgICAweDAwNzUKKyNkZWZpbmUgSG9zdENtZF9DTURfODAyXzExX1RYX1JBVEVfUVVFUlkgICAgICAgICAgICAgIDB4MDA3ZgorI2RlZmluZSBIb3N0Q21kX0NNRF84MDJfMTFfSUJTU19DT0FMRVNDSU5HX1NUQVRVUyAgICAgMHgwMDgzCisjZGVmaW5lIEhvc3RDbWRfQ01EX01FTV9BQ0NFU1MgICAgICAgICAgICAgICAgICAgICAgICAweDAwODYKKyNkZWZpbmUgSG9zdENtZF9DTURfQ0ZHX0RBVEEgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDA4ZgorI2RlZmluZSBIb3N0Q21kX0NNRF9WRVJTSU9OX0VYVCAgICAgICAgICAgICAgICAgICAgICAgMHgwMDk3CisjZGVmaW5lIEhvc3RDbWRfQ01EX01FRl9DRkcgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwOWEKKyNkZWZpbmUgSG9zdENtZF9DTURfUlNTSV9JTkZPICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDBhNAorI2RlZmluZSBIb3N0Q21kX0NNRF9GVU5DX0lOSVQgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMGE5CisjZGVmaW5lIEhvc3RDbWRfQ01EX0ZVTkNfU0hVVERPV04gICAgICAgICAgICAgICAgICAgICAweDAwYWEKKyNkZWZpbmUgSE9TVF9DTURfQVBDTURfU1lTX1JFU0VUICAgICAgICAgICAgICAgICAgICAgIDB4MDBhZgorI2RlZmluZSBIb3N0Q21kX0NNRF9VQVBfU1lTX0NPTkZJRyAgICAgICAgICAgICAgICAgICAgMHgwMGIwCisjZGVmaW5lIEhvc3RDbWRfQ01EX1VBUF9CU1NfU1RBUlQgICAgICAgICAgICAgICAgICAgICAweDAwYjEKKyNkZWZpbmUgSG9zdENtZF9DTURfVUFQX0JTU19TVE9QICAgICAgICAgICAgICAgICAgICAgIDB4MDBiMgorI2RlZmluZSBIT1NUX0NNRF9BUENNRF9TVEFfTElTVCAgICAgICAgICAgICAgICAgICAgICAgMHgwMGIzCisjZGVmaW5lIEhvc3RDbWRfQ01EX1VBUF9TVEFfREVBVVRIICAgICAgICAgICAgICAgICAgICAweDAwYjUKKyNkZWZpbmUgSG9zdENtZF9DTURfMTFOX0NGRyAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDBjZAorI2RlZmluZSBIb3N0Q21kX0NNRF8xMU5fQUREQkFfUkVRICAgICAgICAgICAgICAgICAgICAgMHgwMGNlCisjZGVmaW5lIEhvc3RDbWRfQ01EXzExTl9BRERCQV9SU1AgICAgICAgICAgICAgICAgICAgICAweDAwY2YKKyNkZWZpbmUgSG9zdENtZF9DTURfMTFOX0RFTEJBICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDBkMAorI2RlZmluZSBIb3N0Q21kX0NNRF9SRUNPTkZJR1VSRV9UWF9CVUZGICAgICAgICAgICAgICAgMHgwMGQ5CisjZGVmaW5lIEhvc3RDbWRfQ01EX0NIQU5fUkVQT1JUX1JFUVVFU1QgICAgICAgICAgICAgICAweDAwZGQKKyNkZWZpbmUgSG9zdENtZF9DTURfQU1TRFVfQUdHUl9DVFJMICAgICAgICAgICAgICAgICAgIDB4MDBkZgorI2RlZmluZSBIb3N0Q21kX0NNRF9UWFBXUl9DRkcgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMGQxCisjZGVmaW5lIEhvc3RDbWRfQ01EX1RYX1JBVEVfQ0ZHICAgICAgICAgICAgICAgICAgICAgICAweDAwZDYKKyNkZWZpbmUgSG9zdENtZF9DTURfUk9CVVNUX0NPRVggICAgICAgICAgICAgICAgICAgICAgIDB4MDBlMAorI2RlZmluZSBIb3N0Q21kX0NNRF84MDJfMTFfUFNfTU9ERV9FTkggICAgICAgICAgICAgICAgMHgwMGU0CisjZGVmaW5lIEhvc3RDbWRfQ01EXzgwMl8xMV9IU19DRkdfRU5IICAgICAgICAgICAgICAgICAweDAwZTUKKyNkZWZpbmUgSG9zdENtZF9DTURfUDJQX01PREVfQ0ZHICAgICAgICAgICAgICAgICAgICAgIDB4MDBlYgorI2RlZmluZSBIb3N0Q21kX0NNRF9DQVVfUkVHX0FDQ0VTUyAgICAgICAgICAgICAgICAgICAgMHgwMGVkCisjZGVmaW5lIEhvc3RDbWRfQ01EX1NFVF9CU1NfTU9ERSAgICAgICAgICAgICAgICAgICAgICAweDAwZjcKKyNkZWZpbmUgSG9zdENtZF9DTURfUENJRV9ERVNDX0RFVEFJTFMgICAgICAgICAgICAgICAgIDB4MDBmYQorI2RlZmluZSBIb3N0Q21kX0NNRF84MDJfMTFfU0NBTl9FWFQgICAgICAgICAgICAgICAgICAgMHgwMTA3CisjZGVmaW5lIEhvc3RDbWRfQ01EX0NPQUxFU0NFX0NGRyAgICAgICAgICAgICAgICAgICAgICAweDAxMGEKKyNkZWZpbmUgSG9zdENtZF9DTURfTUdNVF9GUkFNRV9SRUcgICAgICAgICAgICAgICAgICAgIDB4MDEwYworI2RlZmluZSBIb3N0Q21kX0NNRF9SRU1BSU5fT05fQ0hBTiAgICAgICAgICAgICAgICAgICAgMHgwMTBkCisjZGVmaW5lIEhvc3RDbWRfQ01EXzExQUNfQ0ZHCQkJICAgICAgMHgwMTEyCisjZGVmaW5lIEhvc3RDbWRfQ01EX1RETFNfQ09ORklHICAgICAgICAgICAgICAgICAgICAgICAweDAxMDAKKyNkZWZpbmUgSG9zdENtZF9DTURfTUNfUE9MSUNZICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDEyMQorI2RlZmluZSBIb3N0Q21kX0NNRF9URExTX09QRVIgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMTIyCisjZGVmaW5lIEhvc3RDbWRfQ01EX1NESU9fU1BfUlhfQUdHUl9DRkcgICAgICAgICAgICAgICAweDAyMjMKKworI2RlZmluZSBQUk9UT0NPTF9OT19TRUNVUklUWSAgICAgICAgMHgwMQorI2RlZmluZSBQUk9UT0NPTF9TVEFUSUNfV0VQICAgICAgICAgMHgwMgorI2RlZmluZSBQUk9UT0NPTF9XUEEgICAgICAgICAgICAgICAgMHgwOAorI2RlZmluZSBQUk9UT0NPTF9XUEEyICAgICAgICAgICAgICAgMHgyMAorI2RlZmluZSBQUk9UT0NPTF9XUEEyX01JWEVEICAgICAgICAgMHgyOAorI2RlZmluZSBQUk9UT0NPTF9FQVAgICAgICAgICAgICAgICAgMHg0MAorI2RlZmluZSBLRVlfTUdNVF9OT05FICAgICAgICAgICAgICAgMHgwNAorI2RlZmluZSBLRVlfTUdNVF9QU0sgICAgICAgICAgICAgICAgMHgwMgorI2RlZmluZSBLRVlfTUdNVF9FQVAgICAgICAgICAgICAgICAgMHgwMQorI2RlZmluZSBDSVBIRVJfVEtJUCAgICAgICAgICAgICAgICAgMHgwNAorI2RlZmluZSBDSVBIRVJfQUVTX0NDTVAgICAgICAgICAgICAgMHgwOAorI2RlZmluZSBWQUxJRF9DSVBIRVJfQklUTUFQICAgICAgICAgMHgwYworCitlbnVtIEVOSF9QU19NT0RFUyB7CisJRU5fUFMgPSAxLAorCURJU19QUyA9IDIsCisJRU5fQVVUT19EUyA9IDMsCisJRElTX0FVVE9fRFMgPSA0LAorCVNMRUVQX0NPTkZJUk0gPSA1LAorCUdFVF9QUyA9IDAsCisJRU5fQVVUT19QUyA9IDB4ZmYsCisJRElTX0FVVE9fUFMgPSAweGZlLAorfTsKKworZW51bSBQMlBfTU9ERVMgeworCVAyUF9NT0RFX0RJU0FCTEUgPSAwLAorCVAyUF9NT0RFX0RFVklDRSA9IDEsCisJUDJQX01PREVfR08gPSAyLAorCVAyUF9NT0RFX0NMSUVOVCA9IDMsCit9OworCisjZGVmaW5lIEhvc3RDbWRfUkVUX0JJVCAgICAgICAgICAgICAgICAgICAgICAgMHg4MDAwCisjZGVmaW5lIEhvc3RDbWRfQUNUX0dFTl9HRVQgICAgICAgICAgICAgICAgICAgMHgwMDAwCisjZGVmaW5lIEhvc3RDbWRfQUNUX0dFTl9TRVQgICAgICAgICAgICAgICAgICAgMHgwMDAxCisjZGVmaW5lIEhvc3RDbWRfQUNUX0dFTl9SRU1PVkUgICAgICAgICAgICAgICAgMHgwMDA0CisjZGVmaW5lIEhvc3RDbWRfQUNUX0JJVF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0JPVEggICAgICAgICAgICAweDAwMDMKKworI2RlZmluZSBSRl9BTlRFTk5BX0FVVE8gICAgICAgICAgICAgICAgIDB4RkZGRgorCisjZGVmaW5lIEhvc3RDbWRfU0VUX1NFUV9OT19CU1NfSU5GTyhzZXEsIG51bSwgdHlwZSkgeyAgIFwKKwkoKChzZXEpICYgMHgwMGZmKSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJICgoKG51bSkgJiAweDAwMGYpIDw8IDgpKSB8ICAgICAgICAgICAgICAgICAgICAgXAorCSgoKHR5cGUpICYgMHgwMDBmKSA8PCAxMik7ICAgICAgICAgICAgICAgICAgfQorCisjZGVmaW5lIEhvc3RDbWRfR0VUX1NFUV9OTyhzZXEpICAgICAgIFwKKwkoKHNlcSkgJiBIb3N0Q21kX1NFUV9OVU1fTUFTSykKKworI2RlZmluZSBIb3N0Q21kX0dFVF9CU1NfTk8oc2VxKSAgICAgICAgIFwKKwkoKChzZXEpICYgSG9zdENtZF9CU1NfTlVNX01BU0spID4+IDgpCisKKyNkZWZpbmUgSG9zdENtZF9HRVRfQlNTX1RZUEUoc2VxKSAgICAgICBcCisJKCgoc2VxKSAmIEhvc3RDbWRfQlNTX1RZUEVfTUFTSykgPj4gMTIpCisKKyNkZWZpbmUgRVZFTlRfRFVNTVlfSE9TVF9XQUtFVVBfU0lHTkFMICAweDAwMDAwMDAxCisjZGVmaW5lIEVWRU5UX0xJTktfTE9TVCAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMworI2RlZmluZSBFVkVOVF9MSU5LX1NFTlNFRCAgICAgICAgICAgICAgIDB4MDAwMDAwMDQKKyNkZWZpbmUgRVZFTlRfTUlCX0NIQU5HRUQgICAgICAgICAgICAgICAweDAwMDAwMDA2CisjZGVmaW5lIEVWRU5UX0lOSVRfRE9ORSAgICAgICAgICAgICAgICAgMHgwMDAwMDAwNworI2RlZmluZSBFVkVOVF9ERUFVVEhFTlRJQ0FURUQgICAgICAgICAgIDB4MDAwMDAwM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PmhlYWRlci5sZW4pCisJCQkJCQkJICYgMHgwMEZGKTsKKwlpZiAobGUxNl90b19jcHUocnNuX2llX3Rsdi0+aGVhZGVyLmxlbikgPD0gKHNpemVvZihwcml2LT53cGFfaWUpIC0gMikpCisJCW1lbWNweShyc25faWVfdGx2LT5yc25faWUsICZwcml2LT53cGFfaWVbMl0sCisJCSAgICAgICBsZTE2X3RvX2NwdShyc25faWVfdGx2LT5oZWFkZXIubGVuKSk7CisJZWxzZQorCQlyZXR1cm4gLTE7CisKKwlyc25faWVfbGVuID0gc2l6ZW9mKHJzbl9pZV90bHYtPmhlYWRlcikgKworCQkJCQlsZTE2X3RvX2NwdShyc25faWVfdGx2LT5oZWFkZXIubGVuKTsKKwkqYnVmZmVyICs9IHJzbl9pZV9sZW47CisKKwlyZXR1cm4gcnNuX2llX2xlbjsKK30KKworLyoKKyAqIFRoaXMgZnVuY3Rpb24gcHJlcGFyZXMgY29tbWFuZCBmb3IgYXNzb2NpYXRpb24uCisgKgorICogVGhpcyBzZXRzIHRoZSBmb2xsb3dpbmcgcGFyYW1ldGVycyAtCisgKiAgICAgIC0gUGVlciBNQUMgYWRkcmVzcworICogICAgICAtIExpc3RlbiBpbnRlcnZhbAorICogICAgICAtIEJlYWNvbiBpbnRlcnZhbAorICogICAgICAtIENhcGFiaWxpdHkgaW5mb3JtYXRpb24KKyAqCisgKiAuLi5hbmQgdGhlIGZvbGxvd2luZyBUTFZzLCBhcyByZXF1aXJlZCAtCisgKiAgICAgIC0gU1NJRCBUTFYKKyAqICAgICAgLSBQSFkgVExWCisgKiAgICAgIC0gU1MgVExWCisgKiAgICAgIC0gUmF0ZXMgVExWCisgKiAgICAgIC0gQXV0aGVudGljYXRpb24gVExWCisgKiAgICAgIC0gQ2hhbm5lbCBUTFYKKyAqICAgICAgLSBXUEEvV1BBMiBJRQorICogICAgICAtIDExbiBUTFYKKyAqICAgICAgLSBWZW5kb3Igc3BlY2lmaWMgVExWCisgKiAgICAgIC0gV01NIFRMV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gKiBtZW1vcnkgbGF5b3V0LgorICoKKyAqIEZvciBjYXNlcyB3aGVyZSBhbiBhc3NvY2lhdGlvbiByZXNwb25zZSB3YXMgbm90IHJlY2VpdmVkIChpbmRpY2F0ZWQKKyAqIGJ5IHRoZSBDYXBJbmZvIGFuZCBBSWQgZmllbGQpOgorICoKKyAqICAgICAuLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLgorICogICAgIHwgIEhlYWRlcig0ICogc2l6ZW9mKHRfdTE2KSk6ICBTdGFuZGFyZCBjb21tYW5kIHJlc3BvbnNlIGhkciB8CisgKiAgICAgLi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS4KKyAqICAgICB8ICBjYXBfaW5mby9FcnJvciBSZXR1cm4odF91MTYpOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAorICogICAgIHwgICAgICAgICAgIDB4RkZGRigtMSk6IEludGVybmFsIGVycm9yICAgICAgICAgICAgICAgICAgICAgICB8CisgKiAgICAgfCAgICAgICAgICAgMHhGRkZFKC0yKTogQXV0aGVudGljYXRpb24gdW5oYW5kbGVkIG1lc3NhZ2UgICAgIHwKKyAqICAgICB8ICAgICAgICAgICAweEZGRkQoLTMpOiBBdXRoZW50aWNhdGlvbiByZWZ1c2VkICAgICAgICAgICAgICAgfAorICogICAgIHwgICAgICAgICAgIDB4RkZGQygtNCk6IFRpbWVvdXQgd2FpdGluZyBmb3IgQVAgcmVzcG9uc2UgICAgICB8CisgKiAgICAgLi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS4KKyAqICAgICB8ICBzdGF0dXNfY29kZSh0X3UxNik6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAorICogICAgIHwgICAgICAgIElmIGNhcF9pbmZvIGlzIC0xOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8CisgKiAgICAgfCAgICAgICAgICAgQW4gaW50ZXJuYWwgZmlybXdhcmUgZmFpbHVyZSBwcmV2ZW50ZWQgdGhlICAgICAgIHwKKyAqICAgICB8ICAgICAgICAgICBjb21tYW5kIGZyb20gYmVpbmcgcHJvY2Vzc2VkLiAgVGhlIHN0YXR1c19jb2RlICAgfAorICogICAgIHwgICAgICAgICAgIHdpbGwgYmUgc2V0IHRvIDEuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8CisgKiAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKKyAqICAgICB8ICAgICAgICBJZiBjYXBfaW5mbyBpcyAtMjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAorICogICAgIHwgICAgICAgICAgIEFuIGF1dGhlbnRpY2F0aW9uIGZyYW1lIHdhcyByZWNlaXZlZCBidXQgd2FzICAgICB8CisgKiAgICAgfCAgICAgICAgICAgbm90IGhhbmRsZWQgYnkgdGhlIGZpcm13YXJlLiAgSUVFRSBTdGF0dXMgICAgICAgIHwKKyAqICAgICB8ICAgICAgICAgICBjb2RlIGZvciB0aGUgZmFpbHVyZSBpcyByZXR1cm5lZC4gICAgICAgICAgICAgICAgfAorICogICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8CisgKiAgICAgfCAgICAgICAgSWYgY2FwX2luZm8gaXMgLTM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKKyAqICAgICB8ICAgICAgICAgICBBbiBhdXRoZW50aWNhdGlvbiBmcmFtZSB3YXMgcmVjZWl2ZWQgYW5kIHRoZSAgICAgfAorICogICAgIHwgICAgICAgICAgIHN0YXR1c19jb2RlIGlzIHRoZSBJRUVFIFN0YXR1cyByZXBvcnRlZCBpbiB0aGUgICB8CisgKiAgICAgfCAgICAgICAgICAgcmVzcG9uc2UuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKKyAqICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAorICogICAgIHwgICAgICAgIElmIGNhcF9pbmZvIGlzIC00OiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8CisgKiAgICAgfCAgICAgICAgICAgKDEpIEFzc29jaWF0aW9uIHJlc3BvbnNlIHRpbWVvdXQgICAgICAgICAgICAgICAgIHwKKyAqICAgICB8ICAgICAgICAgICAoMikgQXV0aGVudGljYXRpb24gcmVzcG9uc2UgdGltZW91dCAgICAgICAgICAgICAgfAorICogICAgIC4tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0uCisgKiAgICAgfCAgYV9pZCh0X3UxNik6IDB4RkZGRiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKKyAqICAgICAuLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLgorICoKKyAqCisgKiBGb3IgY2FzZXMgd2hlcmUgYW4gYXNzb2NpYXRpb24gcmVzcG9uc2Ugd2FzIHJlY2VpdmVkLCB0aGUgSUVFRQorICogc3RhbmRhcmQgYXNzb2NpYXRpb24gcmVzcG9uc2UgZnJhbWUgaXMgcmV0dXJuZWQ6CisgKgorICogICAgIC4tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0uCisgKiAgICAgfCAgSGVhZGVyKDQgKiBzaXplb2YodF91MTYpKTogIFN0YW5kYXJkIGNvbW1hbmQgcmVzcG9uc2UgaGRy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WVbMF0pOworCisJCWlmIChwcml2LT53YXBpX2llWzBdID09IFdMQU5fRUlEX0JTU19BQ19BQ0NFU1NfREVMQVkpCisJCQlwcml2LT5zZWNfaW5mby53YXBpX2VuYWJsZWQgPSB0cnVlOworCX0gZWxzZSB7CisJCW1lbXNldChwcml2LT53YXBpX2llLCAwLCBzaXplb2YocHJpdi0+d2FwaV9pZSkpOworCQlwcml2LT53YXBpX2llX2xlbiA9IGllX2xlbjsKKwkJbXdpZmlleF9kYmcocHJpdi0+YWRhcHRlciwgSU5GTywKKwkJCSAgICAiaW5mbzogUmVzZXQgd2FwaV9pZV9sZW49JWQgSUU9JSN4XG4iLAorCQkJICAgIHByaXYtPndhcGlfaWVfbGVuLCBwcml2LT53YXBpX2llWzBdKTsKKwkJcHJpdi0+c2VjX2luZm8ud2FwaV9lbmFibGVkID0gZmFsc2U7CisJfQorCXJldHVybiAwOworfQorCisvKgorICogSU9DVEwgcmVxdWVzdCBoYW5kbGVyIHRvIHNldC9yZXNldCBXUFMgSUUuCisgKgorICogVGhlIHN1cHBsaWVkIFdQUyBJRSBpcyB0cmVhdGVkIGFzIGEgb3BhcXVlIGJ1ZmZlci4gT25seSB0aGUgZmlyc3QgZmllbGQKKyAqIGlzIGNoZWNrZWQgdG8gaW50ZXJuYWxseSBlbmFibGUgV1BTLiBJZiBidWZmZXIgbGVuZ3RoIGlzIHplcm8sIHRoZSBleGlzdGluZworICogV1BTIElFIGlzIHJlc2V0LgorICovCitzdGF0aWMgaW50IG13aWZpZXhfc2V0X3dwc19pZShzdHJ1Y3QgbXdpZmlleF9wcml2YXRlICpwcml2LAorCQkJICAgICAgIHU4ICppZV9kYXRhX3B0ciwgdTE2IGllX2xlbikKK3sKKwlpZiAoaWVfbGVuKSB7CisJCWlmIChpZV9sZW4gPiBNV0lGSUVYX01BWF9WU0lFX0xFTikgeworCQkJbXdpZmlleF9kYmcocHJpdi0+YWRhcHRlciwgRVJST1IsCisJCQkJICAgICJpbmZvOiBmYWlsZW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ZWQgaW5mb3JtYXRpb24gLQotICogICAgICAtIERyaXZlciBuYW1lCi0gKiAgICAgIC0gRHJpdmVyIHZlcnNpb24KLSAqICAgICAgLSBEcml2ZXIgZXh0ZW5kZWQgdmVyc2lvbgotICogICAgICAtIEludGVyZmFjZSBuYW1lCi0gKiAgICAgIC0gQlNTIG1vZGUKLSAqICAgICAgLSBNZWRpYSBzdGF0ZSAoY29ubmVjdGVkIG9yIGRpc2Nvbm5lY3RlZCkKLSAqICAgICAgLSBNQUMgYWRkcmVzcwotICogICAgICAtIFRvdGFsIG51bWJlciBvZiBUeCBieXRlcwotICogICAgICAtIFRvdGFsIG51bWJlciBvZiBSeCBieXRlcwotICogICAgICAtIFRvdGFsIG51bWJlciBvZiBUeCBwYWNrZXRzCi0gKiAgICAgIC0gVG90YWwgbnVtYmVyIG9mIFJ4IHBhY2tldHMKLSAqICAgICAgLSBUb3RhbCBudW1iZXIgb2YgZHJvcHBlZCBUeCBwYWNrZXRzCi0gKiAgICAgIC0gVG90YWwgbnVtYmVyIG9mIGRyb3BwZWQgUnggcGFja2V0cwotICogICAgICAtIFRvdGFsIG51bWJlciBvZiBjb3JydXB0ZWQgVHggcGFja2V0cwotICogICAgICAtIFRvdGFsIG51bWJlciBvZiBjb3JydXB0ZWQgUnggcGFja2V0cwotICogICAgICAtIENhcnJpZXIgc3RhdHVzIChvbiBvciBvZmYpCi0gKiAgICAgIC0gVHggcXVldWUgc3RhdHVzIChzdGFydGVkIG9yIHN0b3BwZWQpCi0gKgotICogRm9yIFNUQSBtb2RlIGRyaXZlcnMsIGl0IGFsc28gcHJpbnRzIHRoZSBmb2xsb3dpbmcgZXh0cmEgLQotICogICAgICAtIEVTU0lECi0gKiAgICAgIC0gQlNTSUQKLSAqICAgICAgLSBDaGFubmVsCi0gKiAgICAgIC0gUmVnaW9uIGNvZGUKLSAqICAgICAgLSBNdWx0aWNhc3QgY291bnQKLSAqICAgICAgLSBNdWx0aWNhc3QgYWRkcmVzc2VzCi0gKi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otICogICAgICAtIFdNTSBBQyBCRSBwYWNrZXRzIGNvdW50Ci0gKiAgICAgIC0gV01NIEFDIEJLIHBhY2tldHMgY291bnQKLSAqICAgICAgLSBNYXhpbXVtIFR4IGJ1ZmZlciBzaXplCi0gKiAgICAgIC0gVHggYnVmZmVyIHNpemUKLSAqICAgICAgLSBDdXJyZW50IFR4IGJ1ZmZlciBzaXplCi0gKiAgICAgIC0gUG93ZXIgU2F2ZSBtb2RlCi0gKiAgICAgIC0gUG93ZXIgU2F2ZSBzdGF0ZQotICogICAgICAtIERlZXAgU2xlZXAgc3RhdHVzCi0gKiAgICAgIC0gRGV2aWNlIHdha2V1cCByZXF1aXJlZCBzdGF0dXMKLSAqICAgICAgLSBOdW1iZXIgb2Ygd2FrZXVwIHRyaWVzCi0gKiAgICAgIC0gSG9zdCBTbGVlcCBjb25maWd1cmVkIHN0YXR1cwotICogICAgICAtIEhvc3QgU2xlZXAgYWN0aXZhdGVkIHN0YXR1cwotICogICAgICAtIE51bWJlciBvZiBUeCB0aW1lb3V0cwotICogICAgICAtIE51bWJlciBvZiBjb21tYW5kIHRpbWVvdXRzCi0gKiAgICAgIC0gTGFzdCB0aW1lZCBvdXQgY29tbWFuZCBJRAotICogICAgICAtIExhc3QgdGltZWQgb3V0IGNvbW1hbmQgYWN0aW9uCi0gKiAgICAgIC0gTGFzdCBjb21tYW5kIElECi0gKiAgICAgIC0gTGFzdCBjb21tYW5kIGFjdGlvbgotICogICAgICAtIExhc3QgY29tbWFuZCBpbmRleAotICogICAgICAtIExhc3QgY29tbWFuZCByZXNwb25zZSBJRAotICogICAgICAtIExhc3QgY29tbWFuZCByZXNwb25zZSBpbmRleAotICogICAgICAtIExhc3QgZXZlbnQKLSAqICAgICAgLSBMYXN0IGV2ZW50IGluZGV4Ci0gKiAgICAgIC0gTnVtYmVyIG9mIGhvc3QgdG8gY2FyZCBjb21tYW5kIGZhaWx1cmVzCi0gKiAgICAgIC0gTnVtYmVyIG9mIHNsZWVwIGNvb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WYgKCFkZWJ1Z2ZzX2NyZWF0ZV9maWxlKCNuYW1lLCAwNjQ0LCBwcml2LT5kZnNfZGV2X2RpciwgICAgICAgIFwKLQkJCXByaXYsICZtd2lmaWV4X2Rmc18jI25hbWUjI19mb3BzKSkgICAgICAgICAgICAgIFwKLQkJcmV0dXJuOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi19IHdoaWxlICgwKTsKLQotI2RlZmluZSBNV0lGSUVYX0RGU19GSUxFX09QUyhuYW1lKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotc3RhdGljIGNvbnN0IHN0cnVjdCBmaWxlX29wZXJhdGlvbnMgbXdpZmlleF9kZnNfIyNuYW1lIyNfZm9wcyA9IHsgICAgICAgXAotCS5yZWFkID0gbXdpZmlleF8jI25hbWUjI19yZWFkLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0JLndyaXRlID0gbXdpZmlleF8jI25hbWUjI193cml0ZSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLQkub3BlbiA9IHNpbXBsZV9vcGVuLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotfTsKLQotI2RlZmluZSBNV0lGSUVYX0RGU19GSUxFX1JFQURfT1BTKG5hbWUpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotc3RhdGljIGNvbnN0IHN0cnVjdCBmaWxlX29wZXJhdGlvbnMgbXdpZmlleF9kZnNfIyNuYW1lIyNfZm9wcyA9IHsgICAgICAgXAotCS5yZWFkID0gbXdpZmlleF8jI25hbWUjI19yZWFkLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0JLm9wZW4gPSBzaW1wbGVfb3BlbiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLX07Ci0KLSNkZWZpbmUgTVdJRklFWF9ERlNfRklMRV9XUklURV9P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ICAgICAgICAgICAgICAweDAwMTkKLSNkZWZpbmUgSG9zdENtZF9DTURfQkJQX1JFR19BQ0NFU1MgICAgICAgICAgICAgICAgICAgIDB4MDAxYQotI2RlZmluZSBIb3N0Q21kX0NNRF9SRl9SRUdfQUNDRVNTICAgICAgICAgICAgICAgICAgICAgMHgwMDFiCi0jZGVmaW5lIEhvc3RDbWRfQ01EX1BNSUNfUkVHX0FDQ0VTUyAgICAgICAgICAgICAgICAgICAweDAwYWQKLSNkZWZpbmUgSG9zdENtZF9DTURfUkZfVFhfUFdSICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAxZQotI2RlZmluZSBIb3N0Q21kX0NNRF9SRl9BTlRFTk5BICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDIwCi0jZGVmaW5lIEhvc3RDbWRfQ01EXzgwMl8xMV9ERUFVVEhFTlRJQ0FURSAgICAgICAgICAgICAweDAwMjQKLSNkZWZpbmUgSG9zdENtZF9DTURfTUFDX0NPTlRST0wgICAgICAgICAgICAgICAgICAgICAgIDB4MDAyOAotI2RlZmluZSBIb3N0Q21kX0NNRF84MDJfMTFfQURfSE9DX1NUQVJUICAgICAgICAgICAgICAgMHgwMDJiCi0jZGVmaW5lIEhvc3RDbWRfQ01EXzgwMl8xMV9BRF9IT0NfSk9JTiAgICAgICAgICAgICAgICAweDAwMmMKLSNkZWZpbmUgSG9zdENtZF9DTURfODAyXzExX0FEX0hPQ19TVE9QICAgICAgICAgICAgICAgIDB4MDA0MAotI2RlZmluZSBIb3N0Q21kX0NNRF84MDJfMTFfTUFDX0FERFJFU1MgICAgICAgICAgICAgICAgMHgwMDRECi0jZGVmaW5lIEhvc3RDbWRfQ01EXzgwMl8xMURfRE9NQUlOX0lORk8gICAgICAgICAgICAgICAweDAwNWIKLSNkZWZpbmUgSG9zdENtZF9DTURfODAyXzExX0tFWV9NQVRFUklBTCAgICAgICAgICAgICAgIDB4MDA1ZQotI2RlZmluZSBIb3N0Q21kX0NNRF84MDJfMTFfQkdfU0NBTl9RVUVSWSAgICAgICAgICAgICAgMHgwMDZjCi0jZGVmaW5lIEhvc3RDbWRfQ01EX1dNTV9HRVRfU1RBVFVTICAgICAgICAgICAgICAgICAgICAweDAwNzEKLSNkZWZpbmUgSG9zdENtZF9DTURfODAyXzExX1NVQlNDUklCRV9FVkVOVCAgICAgICAgICAgIDB4MDA3NQotI2RlZmluZSBIb3N0Q21kX0NNRF84MDJfMTFfVFhfUkFURV9RVUVSWSAgICAgICAgICAgICAgMHgwMDdmCi0jZGVmaW5lIEhvc3RDbWRfQ01EXzgwMl8xMV9JQlNTX0NPQUxFU0NJTkdfU1RBVFVTICAgICAweDAwODMKLSNkZWZpbmUgSG9zdENtZF9DTURfTUVNX0FDQ0VTUyAgICAgICAgICAgICAgICAgICAgICAgIDB4MDA4NgotI2RlZmluZSBIb3N0Q21kX0NNRF9DRkdfREFUQSAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDhmCi0jZGVmaW5lIEhvc3RDbWRfQ01EX1ZFUlNJT05fRVhUICAgICAgICAgICAgICAgICAgICAgICAweDAwOTcKLSNkZWZpbmUgSG9zdENtZF9DTURfTUVGX0NGRyAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDA5YQotI2RlZmluZSBIb3N0Q21kX0NNRF9SU1NJX0lORk8gICAgICAgICAgICAgICAgICAgICAgICAgMHgwMGE0Ci0jZGVmaW5lIEhvc3RDbWRfQ01EX0ZVTkNfSU5JVCAgICAgICAgICAgICAgICAgICAgICAgICAweDAwYTkKLSNkZWZpbmUgSG9zdENtZF9DTURfRlVOQ19TSFVURE9XTiAgICAgICAgICAgICAgICAgICAgIDB4MDBhYQotI2RlZmluZSBIT1NUX0NNRF9BUENNRF9TWVNfUkVTRVQgICAgICAgICAgICAgICAgICAgICAgMHgwMGFmCi0jZGVmaW5lIEhvc3RDbWRfQ01EX1VBUF9TWVNfQ09ORklHICAgICAgICAgICAgICAgICAgICAweDAwYjAKLSNkZWZpbmUgSG9zdENtZF9DTURfVUFQX0JTU19TVEFSVCAgICAgICAgICAgICAgICAgICAgIDB4MDBiMQotI2RlZmluZSBIb3N0Q21kX0NNRF9VQVBfQlNTX1NUT1AgICAgICAgICAgICAgICAgICAgICAgMHgwMGIyCi0jZGVmaW5lIEhPU1RfQ01EX0FQQ01EX1NUQV9MSVNUICAgICAgICAgICAgICAgICAgICAgICAweDAwYjMKLSNkZWZpbmUgSG9zdENtZF9DTURfVUFQX1NUQV9ERUFVVEggICAgICAgICAgICAgICAgICAgIDB4MDBiNQotI2RlZmluZSBIb3N0Q21kX0NNRF8xMU5fQ0ZHICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMGNkCi0jZGVmaW5lIEhvc3RDbWRfQ01EXzExTl9BRERCQV9SRVEgICAgICAgICAgICAgICAgICAgICAweDAwY2UKLSNkZWZpbmUgSG9zdENtZF9DTURfMTFOX0FEREJBX1JTUCAgICAgICAgICAgICAgICAgICAgIDB4MDBjZgotI2RlZmluZSBIb3N0Q21kX0NNRF8xMU5fREVMQkEgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMGQwCi0jZGVmaW5lIEhvc3RDbWRfQ01EX1JFQ09ORklHVVJFX1RYX0JVRkYgICAgICAgICAgICAgICAweDAwZDkKLSNkZWZpbmUgSG9zdENtZF9DTURfQ0hBTl9SRVBPUlRfUkVRVUVTVCAgICAgICAgICAgICAgIDB4MDBkZAotI2RlZmluZSBIb3N0Q21kX0NNRF9BTVNEVV9BR0dSX0NUUkwgICAgICAgICAgICAgICAgICAgMHgwMGRmCi0jZGVmaW5lIEhvc3RDbWRfQ01EX1RYUFdSX0NGRyAgICAgICAgICAgICAgICAgICAgICAgICAweDAwZDEKLSNkZWZpbmUgSG9zdENtZF9DTURfVFhfUkFURV9DRkcgICAgICAgICAgICAgICAgICAgICAgIDB4MDBkNgotI2RlZmluZSBIb3N0Q21kX0NNRF9ST0JVU1RfQ09FWCAgICAgICAgICAgICAgICAgICAgICAgMHgwMGUwCi0jZGVmaW5lIEhvc3RDbWRfQ01EXzgwMl8xMV9QU19NT0RFX0VOSCAgICAgICAgICAgICAgICAweDAwZTQKLSNkZWZpbmUgSG9zdENtZF9DTURfODAyXzExX0hTX0NGR19FTkggICAgICAgICAgICAgICAgIDB4MDBlNQotI2RlZmluZSBIb3N0Q21kX0NNRF9QMlBfTU9ERV9DRkcgICAgICAgICAgICAgICAgICAgICAgMHgwMGViCi0jZGVmaW5lIEhvc3RDbWRfQ01EX0NBVV9SRUdfQUNDRVNTICAgICAgICAgICAgICAgICAgICAweDAwZWQKLSNkZWZpbmUgSG9zdENtZF9DTURfU0VUX0JTU19NT0RFICAgICAgICAgICAgICAgICAgICAgIDB4MDBmNwotI2RlZmluZSBIb3N0Q21kX0NNRF9QQ0lFX0RFU0NfREVUQUlMUyAgICAgICAgICAgICAgICAgMHgwMGZhCi0jZGVmaW5lIEhvc3RDbWRfQ01EXzgwMl8xMV9TQ0FOX0VYVCAgICAgICAgICAgICAgICAgICAweDAxMDcKLSNkZWZpbmUgSG9zdENtZF9DTURfQ09BTEVTQ0VfQ0ZHICAgICAgICAgICAgICAgICAgICAgIDB4MDEwYQotI2RlZmluZSBIb3N0Q21kX0NNRF9NR01UX0ZSQU1FX1JFRyAgICAgICAgICAgICAgICAgICAgMHgwMTBjCi0jZGVmaW5lIEhvc3RDbWRfQ01EX1JFTUFJTl9PTl9DSEFOICAgICAgICAgICAgICAgICAgICAweDAxMGQKLSNkZWZpbmUgSG9zdENtZF9DTURfMTFBQ19DRkcJCQkgICAgICAweDAxMTIKLSNkZWZpbmUgSG9zdENtZF9DTURfVERMU19DT05GSUcgICAgICAgICAgICAgICAgICAgICAgIDB4MDEwMAotI2RlZmluZSBIb3N0Q21kX0NNRF9NQ19QT0xJQ1kgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMTIxCi0jZGVmaW5lIEhvc3RDbWRfQ01EX1RETFNfT1BFUiAgICAgICAgICAgICAgICAgICAgICAgICAweDAxMjIKLSNkZWZpbmUgSG9zdENtZF9DTURfU0RJT19TUF9SWF9BR0dSX0NGRyAgICAgICAgICAgICAgIDB4MDIyMwotCi0jZGVmaW5lIFBST1RPQ09MX05PX1NFQ1VSSVRZICAgICAgICAweDAxCi0jZGVmaW5lIFBST1RPQ09MX1NUQVRJQ19XRVAgICAgICAgICAweDAyCi0jZGVmaW5lIFBST1RPQ09MX1dQQSAgICAgICAgICAgICAgICAweDA4Ci0jZGVmaW5lIFBST1RPQ09MX1dQQTIgICAgICAgICAgICAgICAweDIwCi0jZGVmaW5lIFBST1RPQ09MX1dQQTJfTUlYRUQgICAgICAgICAweDI4Ci0jZGVmaW5lIFBST1RPQ09MX0VBUCAgICAgICAgICAgICAgICAweDQwCi0jZGVmaW5lIEtFWV9NR01UX05PTkUgICAgICAgICAgICAgICAweDA0Ci0jZGVmaW5lIEtFWV9NR01UX1BTSyAgICAgICAgICAgICAgICAweDAyCi0jZGVmaW5lIEtFWV9NR01UX0VBUCAgICAgICAgICAgICAgICAweDAxCi0jZGVmaW5lIENJUEhFUl9US0lQICAgICAgICAgICAgICAgICAweDA0Ci0jZGVmaW5lIENJUEhFUl9BRVNfQ0NNUCAgICAgICAgICAgICAweDA4Ci0jZGVmaW5lIFZBTElEX0NJUEhFUl9CSVRNQVAgICAgICAgICAweDBjCi0KLWVudW0gRU5IX1BTX01PREVTIHsKLQlFTl9QUyA9IDEsCi0JRElTX1BTID0gMiwKLQlFTl9BVVRPX0RTID0gMywKLQlESVNfQVVUT19EUyA9IDQsCi0JU0xFRVBfQ09ORklSTSA9IDUsCi0JR0VUX1BTID0gMCwKLQlFTl9BVVRPX1BTID0gMHhmZiwKLQlESVNfQVVUT19QUyA9IDB4ZmUsCi19OwotCi1lbnVtIFAyUF9NT0RFUyB7Ci0JUDJQX01PREVfRElTQUJMRSA9IDAsCi0JUDJQX01PREVfREVWSUNFID0gMSwKLQlQMlBfTU9ERV9HTyA9IDIsCi0JUDJQX01PREVfQ0xJRU5UID0gMywKLX07Ci0KLSNkZWZpbmUgSG9zdENtZF9SRVRfQklUICAgICAgICAgICAgICAgICAgICAgICAweDgwMDAKLSNkZWZpbmUgSG9zdENtZF9BQ1RfR0VOX0dFVCAgICAgICAgICAgICAgICAgICAweDAwMDAKLSNkZWZpbmUgSG9zdENtZF9BQ1RfR0VOX1NFVCAgICAgICAgICAgICAgICAgICAweDAwMDEKLSNkZWZpbmUgSG9zdENtZF9BQ1RfR0VOX1JFTU9WRSAgICAgICAgICAgICAgICAweDAwMDQKLSNkZWZpbmUgSG9zdENtZF9BQ1RfQklUV0lTRV9TRVQgICAgICAgICAgICAgICAweDAwMDIKLSNkZWZpbmUgSG9zdENtZF9BQ1RfQklUV0lTRV9DTFIgICAgICAgICAgICAgICAweDAwMDMKLSNkZWZpbmUgSG9zdENtZF9SRVNVTFRfT0sgICAgICAgICAgICAgICAgICAgICAweDAwMDAKLQotI2RlZmluZSBIb3N0Q21kX0FDVF9NQUNfUlhfT04gICAgICAgICAgICAgICAgIDB4MDAwMQotI2RlZmluZSBIb3N0Q21kX0FDVF9NQUNfVFhfT04gICAgICAgICAgICAgICAgIDB4MDAwMgotI2RlZmluZSBIb3N0Q21kX0FDVF9NQUNfV0VQX0VOQUJMRSAgICAgICAgICAgIDB4MDAwOAotI2RlZmluZSBIb3N0Q21kX0FDVF9NQUNfRVRIRVJORVRJSV9FTkFCTEUgICAgIDB4MDAxMAotI2RlZmluZSBIb3N0Q21kX0FDVF9NQUNfUFJPTUlTQ1VPVVNfRU5BQkxFICAgIDB4MDA4MAotI2RlZmluZSBIb3N0Q21kX0FDVF9NQUNfQUxMX01VTFRJQ0FTVF9FTkFCTEUgIDB4MDEwMAotI2RlZmluZSBIb3N0Q21kX0FDVF9NQUNfQURIT0NfR19QUk9URUNUSU9OX09OICAgICAweDIwMDAKLQotI2RlZmluZSBIb3N0Q21kX0JTU19NT0RFX0lCU1MgICAgICAgICAgICAgICAweDAwMDIKLSNkZWZpbmUgSG9zdENtZF9CU1NfTU9ERV9BTlkgICAgICAgIC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gICAgICAgIHwKLSAqICAgICB8ICAgICAgICAgICAweEZGRkUoLTIpOiBBdXRoZW50aWNhdGlvbiB1bmhhbmRsZWQgbWVzc2FnZSAgICAgfAotICogICAgIHwgICAgICAgICAgIDB4RkZGRCgtMyk6IEF1dGhlbnRpY2F0aW9uIHJlZnVzZWQgICAgICAgICAgICAgICB8Ci0gKiAgICAgfCAgICAgICAgICAgMHhGRkZDKC00KTogVGltZW91dCB3YWl0aW5nIGZvciBBUCByZXNwb25zZSAgICAgIHwKLSAqICAgICAuLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLgotICogICAgIHwgIHN0YXR1c19jb2RlKHRfdTE2KTogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gKiAgICAgfCAgICAgICAgSWYgY2FwX2luZm8gaXMgLTE6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAqICAgICB8ICAgICAgICAgICBBbiBpbnRlcm5hbCBmaXJtd2FyZSBmYWlsdXJlIHByZXZlbnRlZCB0aGUgICAgICAgfAotICogICAgIHwgICAgICAgICAgIGNvbW1hbmQgZnJvbSBiZWluZyBwcm9jZXNzZWQuICBUaGUgc3RhdHVzX2NvZGUgICB8Ci0gKiAgICAgfCAgICAgICAgICAgd2lsbCBiZSBzZXQgdG8gMS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAqICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICogICAgIHwgICAgICAgIElmIGNhcF9pbmZvIGlzIC0yOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gKiAgICAgfCAgICAgICAgICAgQW4gYXV0aGVudGljYXRpb24gZnJhbWUgd2FzIHJlY2VpdmVkIGJ1dCB3YXMgICAgIHwKLSAqICAgICB8ICAgICAgICAgICBub3QgaGFuZGxlZCBieSB0aGUgZmlybXdhcmUuICBJRUVFIFN0YXR1cyAgICAgICAgfAotICogICAgIHwgICAgICAgICAgIGNvZGUgZm9yIHRoZSBmYWlsdXJlIGlzIHJldHVybmVkLiAgICAgICAgICAgICAgICB8Ci0gKiAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAqICAgICB8ICAgICAgICBJZiBjYXBfaW5mbyBpcyAtMzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICogICAgIHwgICAgICAgICAgIEFuIGF1dGhlbnRpY2F0aW9uIGZyYW1lIHdhcyByZWNlaXZlZCBhbmQgdGhlICAgICB8Ci0gKiAgICAgfCAgICAgICAgICAgc3RhdHVzX2NvZGUgaXMgdGhlIElFRUUgU3RhdHVzIHJlcG9ydGVkIGluIHRoZSAgIHwKLSAqICAgICB8ICAgICAgICAgICByZXNwb25zZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICogICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gKiAgICAgfCAgICAgICAgSWYgY2FwX2luZm8gaXMgLTQ6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAqICAgICB8ICAgICAgICAgICAoMSkgQXNzb2NpYXRpb24gcmVzcG9uc2UgdGltZW91dCAgICAgICAgICAgICAgICAgfAotICogICAgIHwgICAgICAgICAgICgyKSBBdXRoZW50aWNhdGlvbiByZXNwb25zZSB0aW1lb3V0ICAgICAgICAgICAgICB8Ci0gKiAgICAgLi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS4KLSAqICAgICB8ICBhX2lkKHRfdTE2KTogMHhGRkZGICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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Bwb3N0aW5nIGhlcmUhICovCi0Jd21iKCk7Ci0JdWRlbGF5KElTTDM4WFhfV1JJVEVJT19ERUxBWSk7Ci0KLQkvKiBjbGVhciB0aGUgcmVzZXQgYml0IHNob3VsZCBzdGFydCB0aGUgd2hvbGUgY2lyY3VzICovCi0JcmVnICY9IH5JU0wzOFhYX0NUUkxfU1RBVF9SRVNFVDsKLQl3cml0ZWwocmVnLCBkZXZpY2VfYmFzZSArIElTTDM4WFhfQ1RSTF9TVEFUX1JFRyk7Ci0JLyogZG9uJ3QgZG8gZmx1c2ggUENJIHBvc3RpbmcgaGVyZSEgKi8KLQl3bWIoKTsKLQl1ZGVsYXkoSVNMMzhYWF9XUklURUlPX0RFTEFZKTsKLQotCXJldHVybiAwOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgRGV2aWNlIEludGVycnVwdCBIYW5kbGVyCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLWlycXJldHVybl90Ci1pc2xwY2lfaW50ZXJydXB0KGludCBpcnEsIHZvaWQgKmNvbmZpZykKLXsKLQl1MzIgcmVnOwotCWlzbHBjaV9wcml2YXRlICpwcml2ID0gY29uZmlnOwotCXN0cnVjdCBuZXRfZGV2aWNlICpuZGV2ID0gcHJpdi0+bmRldjsKLQl2b2lkIF9faW9tZW0gKmRldmljZSA9IHByaXYtPmRldmljZV9iYXNlOwotCWludCBwb3dlcnN0YXRlID0gSVNMMzhYWF9QU01fUE9XRVJTQVZFX1NUQVRFOwotCi0JLyogbG9jayB0aGUgaW50ZXJydXB0IGhhbmRsZXIgKi8KLQlzcGluX2xvY2soJnByaXYtPnNsb2NrKTsKLQotCS8qIHJlY2VpdmVkIGFuIGludGVycnVwdCByZXF1ZXN0IG9uIGEgc2hhcmVkIElSU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LAotCQkJCXByaXYtPm5kZXYtPm5hbWUpOwotCQkJcmV0dXJuIHJjOwotCQl9Ci0JfQotCi0JLyogZmluYWxseSByZXNldCBpbnRlcmZhY2UgKi8KLQlyYyA9IGlzbHBjaV9yZXNldF9pZihwcml2KTsKLQlpZiAocmMpCi0JCXByaW50ayhLRVJOX0VSUiAicHJpc201NDogWW91ciBjYXJkL3NvY2tldCBtYXkgYmUgZmF1bHR5LCBvciBJUlEgbGluZSB0b28gYnVzeSA6KFxuIik7Ci0JcmV0dXJuIHJjOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgTmV0d29yayBkZXZpY2UgY29uZmlndXJhdGlvbiBmdW5jdGlvbnMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0YXRpYyBpbnQKLWlzbHBjaV9hbGxvY19tZW1vcnkoaXNscGNpX3ByaXZhdGUgKnByaXYpCi17Ci0JaW50IGNvdW50ZXI7Ci0KLSNpZiBWRVJCT1NFID4gU0hPV19FUlJPUl9NRVNTQUdFUwotCXByaW50ayhLRVJOX0RFQlVHICJpc2xwY2lfYWxsb2NfbWVtb3J5XG4iKTsKLSNlbmRpZgotCi0JLyogcmVtYXAgdGhlIFBDSSBkZXZpY2UgYmFzZSBhZGRyZXNzIHRvIGFjY2Vzc2libGUgKi8KLQlpZiAoIShwcml2LT5kZXZpY2VfYmFzZSA9Ci0JICAgICAgaW9yZW1hcChwY2lfcmVzb3VyY2Vfc3RhcnQocHJpdi0+cGRldiwgMCksCi0JCSAgICAgIElTTDM4WFhfUENJX01FTV9TSVpFKSkpIHsKLQkJLyogZXJyb3IgaW4gcmVtYXBwaW5nIHRoZSBQQ0kgZGV2aWNlIG1lbW9yeSBhZGRyZXNzIHJhbmdlICovCi0JCXByaW50ayhL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gImlzbHBjaV9ldGguaCIKLSNpbmNsdWRlICJpc2xwY2lfbWd0LmgiCi0jaW5jbHVkZSAib2lkX21ndC5oIgotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgTmV0d29yayBJbnRlcmZhY2UgZnVuY3Rpb25zCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkCi1pc2xwY2lfZXRoX2NsZWFudXBfdHJhbnNtaXQoaXNscGNpX3ByaXZhdGUgKnByaXYsCi0JCQkgICAgaXNsMzh4eF9jb250cm9sX2Jsb2NrICpjb250cm9sX2Jsb2NrKQotewotCXN0cnVjdCBza19idWZmICpza2I7Ci0JdTMyIGluZGV4OwotCi0JLyogY29tcGFyZSB0aGUgY29udHJvbCBibG9jayByZWFkIHBvaW50ZXIgd2l0aCB0aGUgZnJlZSBwb2ludGVyICovCi0Jd2hpbGUgKHByaXYtPmZyZWVfZGF0YV90eCAhPQotCSAgICAgICBsZTMyX3RvX2NwdShjb250cm9sX2Jsb2NrLT4KLQkJCSAgIGRldmljZV9jdXJyX2ZyYWdbSVNMMzhYWF9DQl9UWF9EQVRBX0xRXSkpIHsKLQkJLyogcmVhZCB0aGUgaW5kZXggb2YgdGhlIGZpcnN0IGZyYWdtZW50IHRvIGJlIGZyZWVkICovCi0JCWluZGV4ID0gcHJpdi0+ZnJlZV9kYXRhX3R4ICUgSVNMMzhYWF9DQl9UWF9RU0laRTsKLQotCQkvKiBjaGVjayBmb3IgaG9sZXMgaW4gdGhlIGFycmF5cyBjYXVzZWQgYnkgbXVsdGkgZnJhZ21lbnQgZnJhbWVzCi0JCSAqIHNlYXJjaGluZyBmb3IgdGhlIGxhc3QgZnJhZ21lbnQgb2YgYSBmcmFtZSAqLwotCQlpZiAocHJpdi0+cGNpX21hcF90eF9h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lIDxsaW51eC9uZXRkZXZpY2UuaD4KLSNpbmNsdWRlIDxsaW51eC9tb2R1bGUuaD4KLSNpbmNsdWRlIDxsaW51eC9wY2kuaD4KLSNpbmNsdWRlIDxsaW51eC9zY2hlZC5oPgotI2luY2x1ZGUgPGxpbnV4L3NsYWIuaD4KLQotI2luY2x1ZGUgPGFzbS9pby5oPgotI2luY2x1ZGUgPGxpbnV4L2lmX2FycC5oPgotCi0jaW5jbHVkZSAicHJpc21jb21wYXQuaCIKLSNpbmNsdWRlICJpc2xfMzh4eC5oIgotI2luY2x1ZGUgImlzbHBjaV9tZ3QuaCIKLSNpbmNsdWRlICJpc2xfb2lkLmgiCQkvKiBhZGRpdGlvbmFsIHR5cGVzIGFuZCBkZWZzIGZvciBpc2wzOHh4IGZ3ICovCi0jaW5jbHVkZSAiaXNsX2lvY3RsLmgiCi0KLSNpbmNsdWRlIDxuZXQvaXdfaGFuZGxlci5oPgotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgIEdsb2JhbCB2YXJpYWJsZSBkZWZpbml0aW9uIHNlY3Rpb24KLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLWludCBwY19kZWJ1ZyA9IFZFUkJPU0U7Ci1tb2R1bGVfcGFyYW0ocGNfZGVidWcsIGludCwgMCk7Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICBEcml2ZXIgZ2VuZXJhbCBmdW5jdGlvbnMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSNpZiBWRVJCT1NFID4gU0hPV19FUlJPUl9NRVN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aV9jczIiLCBTUEksIGRhbnViZV9waW5zX3NwaV9jczIpLAorCUdSUF9NVVgoInNwaV9jczMiLCBTUEksIGRhbnViZV9waW5zX3NwaV9jczMpLAorCUdSUF9NVVgoInNwaV9jczQiLCBTUEksIGRhbnViZV9waW5zX3NwaV9jczQpLAorCUdSUF9NVVgoInNwaV9jczUiLCBTUEksIGRhbnViZV9waW5zX3NwaV9jczUpLAorCUdSUF9NVVgoInNwaV9jczYiLCBTUEksIGRhbnViZV9waW5zX3NwaV9jczYpLAorCUdSUF9NVVgoImFzYzAiLCBBU0MsIGRhbnViZV9waW5zX2FzYzApLAorCUdSUF9NVVgoImFzYzAgY3RzIHJ0cyIsIEFTQywgZGFudWJlX3BpbnNfYXNjMF9jdHNfcnRzKSwKKwlHUlBfTVVYKCJzdHAiLCBTVFAsIGRhbnViZV9waW5zX3N0cCksCisJR1JQX01VWCgibm1pIiwgTk1JLCBkYW51YmVfcGluc19ubWkpLAorCUdSUF9NVVgoImdwdDEiLCBHUFQsIGRhbnViZV9waW5zX2dwdDEpLAorCUdSUF9NVVgoImdwdDIiLCBHUFQsIGRhbnViZV9waW5zX2dwdDIpLAorCUdSUF9NVVgoImdwdDMiLCBHUFQsIGRhbnViZV9waW5zX2dwdDMpLAorCUdSUF9NVVgoImNsa291dDAiLCBDR1UsIGRhbnViZV9waW5zX2Nsa291dDApLAorCUdSUF9NVVgoImNsa291dDEiLCBDR1UsIGRhbnViZV9waW5zX2Nsa291dDEpLAorCUdSUF9NVVgoImNsa291dDIiLCBDR1UsIGRhbnViZV9waW5zX2Nsa291dDIpLAorCUdSUF9NVVgoImNsa291dDMiLCBDR1UsIGRhbnViZV9waW5zX2Nsa291dDMpLAorCUdSUF9NVVgoImdudDEiLCBQQ0ksIGRhbnViZV9waW5zX3BjaV9nbnQxKSwKKwlHUlBfTVVYKCJnbnQyIiwgUENJLCBkYW51YmVfcGluc19wY2lfZ250MiksCisJR1JQX01VWCgiZ250MyIsIFBDSSwgZGFudWJlX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NUUkxfUElOKDU4LCAiR1BJT181OCIpLAorCVBJTkNUUkxfUElOKDU5LCAiR1BJT181OSIpLAorCVBJTkNUUkxfUElOKDYwLCAiR1BJT182MCIpLAorCVBJTkNUUkxfUElOKDYxLCAiR1BJT182MSIpLAorCVBJTkNUUkxfUElOKDYyLCAiR1BJT182MiIpLAorCVBJTkNUUkxfUElOKDYzLCAiR1BJT182MyIpLAorCVBJTkNUUkxfUElOKDY0LCAiR1BJT182NCIpLAorCVBJTkNUUkxfUElOKDY1LCAiR1BJT182NSIpLAorCVBJTkNUUkxfUElOKDY2LCAiR1BJT182NiIpLAorCVBJTkNUUkxfUElOKDY3LCAiR1BJT182NyIpLAorCVBJTkNUUkxfUElOKDY4LCAiR1BJT182OCIpLAorCVBJTkNUUkxfUElOKDY5LCAiR1BJT182OSIpLAorCVBJTkNUUkxfUElOKDcwLCAiR1BJT183MCIpLAorCVBJTkNUUkxfUElOKDcxLCAiR1BJT183MSIpLAorCVBJTkNUUkxfUElOKDcyLCAiR1BJT183MiIpLAorCVBJTkNUUkxfUElOKDczLCAiR1BJT183MyIpLAorCVBJTkNUUkxfUElOKDc0LCAiR1BJT183NCIpLAorCVBJTkNUUkxfUElOKDc1LCAiR1BJT183NSIpLAorCVBJTkNUUkxfUElOKDc2LCAiR1BJT183NiIpLAorCVBJTkNUUkxfUElOKDc3LCAiR1BJT183NyIpLAorCVBJTkNUUkxfUElOKDc4LCAiR1BJT183OCIpLAorCVBJTkNUUkxfUElOKDc5LCAiR1BJT183OSIpLAorCVBJTkNUUkxfUElOKDgwLCAiR1BJT184MCIpLAorCVBJTkNUUkxfUElOKDgxLCAiR1BJT184MSIpLAorCVBJTkNUUkxfUElOKDgyLCAiR1BJT184MiIpLAorCVBJTkNUUkxfUElOKDgzLCAiR1BJT184MyIpLAorCVBJTkNUUkxfUElOKDg0LCAiR1BJT184NCIpLAorCVBJTkNUUkxfUElOKDg1LCAiR1BJT184NSIpLAorCVBJTkNUUkxfUElOKDg2LCAi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QVJFX01TTV9HUElPX1BJTlMoNik7CitERUNMQVJFX01TTV9HUElPX1BJTlMoNyk7CitERUNMQVJFX01TTV9HUElPX1BJTlMoOCk7CitERUNMQVJFX01TTV9HUElPX1BJTlMoOSk7CitERUNMQVJFX01TTV9HUElPX1BJTlMoMTApOworREVDTEFSRV9NU01fR1BJT19QSU5TKDExKTsKK0RFQ0xBUkVfTVNNX0dQSU9fUElOUygxMik7CitERUNMQVJFX01TTV9HUElPX1BJTlMoMTMpOworREVDTEFSRV9NU01fR1BJT19QSU5TKDE0KTsKK0RFQ0xBUkVfTVNNX0dQSU9fUElOUygxNSk7CitERUNMQVJFX01TTV9HUElPX1BJTlMoMTYpOworREVDTEFSRV9NU01fR1BJT19QSU5TKDE3KTsKK0RFQ0xBUkVfTVNNX0dQSU9fUElOUygxOCk7CitERUNMQVJFX01TTV9HUElPX1BJTlMoMTkpOworREVDTEFSRV9NU01fR1BJT19QSU5TKDIwKTsKK0RFQ0xBUkVfTVNNX0dQSU9fUElOUygyMSk7CitERUNMQVJFX01TTV9HUElPX1BJTlMoMjIpOworREVDTEFSRV9NU01fR1BJT19QSU5TKDIzKTsKK0RFQ0xBUkVfTVNNX0dQSU9fUElOUygyNCk7CitERUNMQVJFX01TTV9HUElPX1BJTlMoMjUpOworREVDTEFSRV9NU01fR1BJT19QSU5TKDI2KTsKK0RFQ0xBUkVfTVNNX0dQSU9fUElOUygyNyk7CitERUNMQVJFX01TTV9HUElPX1BJTlMoMjgpOworREVDTEFSRV9NU01fR1BJT19QSU5TKDI5KTsKK0RFQ0xBUkVfTVNNX0dQSU9fUElOUygzMCk7CitERUNMQVJFX01TTV9HUElPX1BJTlMoMzEpOworREVDTEFSRV9NU01fR1BJT19QSU5TKDMyKTsKK0RFQ0xBUkVfTVNNX0dQSU9fUElOUygzMyk7CitERUNMQVJFX01TTV9HUElPX1BJTlMoMzQpOworREVDTEFSRV9NU01fR1BJT19QSU5TKDM1KTsKK0RFQ0xBUkVfTVNNX0dQSU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QgbXNpb2YwX2Nsa19tdXhbXSA9IHsKKwlNU0lPRjBfU0NLX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjBfc3luY19waW5zW10gPSB7CisJLyogU1lOQyAqLworCVJDQVJfR1BfUElOKDUsIDE4KSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMF9zeW5jX211eFtdID0geworCU1TSU9GMF9TWU5DX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjBfc3MxX3BpbnNbXSA9IHsKKwkvKiBTUzEgKi8KKwlSQ0FSX0dQX1BJTig1LCAxOSksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjBfc3MxX211eFtdID0geworCU1TSU9GMF9TUzFfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMF9zczJfcGluc1tdID0geworCS8qIFNTMiAqLworCVJDQVJfR1BfUElOKDUsIDIxKSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMF9zczJfbXV4W10gPSB7CisJTVNJT0YwX1NTMl9NQVJLLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YwX3R4ZF9waW5zW10gPSB7CisJLyogVFhEICovCisJUkNBUl9HUF9QSU4oNSwgMjApLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YwX3R4ZF9tdXhbXSA9IHsKKwlNU0lPRjBfVFhEX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjBfcnhkX3BpbnNbXSA9IHsKKwkvKiBSWEQgKi8KKwlSQ0FSX0dQX1BJTig1LCAyMiksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjBfcnhkX211eFtdID0geworCU1TSU9GMF9SWERfTUFSSywKK307CisvKiAtIE1T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N0IHVuc2lnbmVkIGludCBtc2lvZjFfdHhkX2FfbXV4W10gPSB7CisJTVNJT0YxX1RYRF9BX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfcnhkX2FfcGluc1tdID0geworCS8qIFJYRCAqLworCVJDQVJfR1BfUElOKDYsIDEwKSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV9yeGRfYV9tdXhbXSA9IHsKKwlNU0lPRjFfUlhEX0FfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV9jbGtfYl9waW5zW10gPSB7CisJLyogU0NLICovCisJUkNBUl9HUF9QSU4oNSwgOSksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfY2xrX2JfbXV4W10gPSB7CisJTVNJT0YxX1NDS19CX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfc3luY19iX3BpbnNbXSA9IHsKKwkvKiBTWU5DICovCisJUkNBUl9HUF9QSU4oNSwgMyksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfc3luY19iX211eFtdID0geworCU1TSU9GMV9TWU5DX0JfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV9zczFfYl9waW5zW10gPSB7CisJLyogU1MxICovCisJUkNBUl9HUF9QSU4oNSwgNCksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfc3MxX2JfbXV4W10gPSB7CisJTVNJT0YxX1NTMV9CX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfc3MyX2JfcGluc1tdID0geworCS8qIFNTMiAqLworCVJDQVJfR1BfUElOKDUsIDApLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YxX3NzMl9iX211eFtdID0geworCU1TSU9GMV9TUzJfQl9NQVJLLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YxX3R4ZF9iX3BpbnNbXSA9IHsKKwkvKiBUWEQgKi8KKwlSQ0FSX0dQX1BJTig1LCA4KSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV90eGRfYl9tdXhbXSA9IHsKKwlNU0lPRjFfVFhEX0JfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV9yeGRfYl9waW5zW10gPSB7CisJLyogUlhEICovCisJUkNBUl9HUF9QSU4oNSwgNyksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfcnhkX2JfbXV4W10gPSB7CisJTVNJT0YxX1JYRF9CX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfY2xrX2NfcGluc1tdID0geworCS8qIFNDSyAqLworCVJDQVJfR1BfUElOKDYsIDE3KSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV9jbGtfY19tdXhbXSA9IHsKKwlNU0lPRjFfU0NLX0NfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV9zeW5jX2NfcGluc1tdID0geworCS8qIFNZTkMgKi8KKwlSQ0FSX0dQX1BJTig2LCAxOCksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfc3luY19jX211eFtdID0geworCU1TSU9GMV9TWU5DX0NfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV9zczFfY19waW5zW10gPSB7CisJLyogU1MxICovCisJUkNBUl9HUF9QSU4oNiwgMjEpLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YxX3NzMV9jX211eFtdID0geworCU1TSU9GMV9TUzFfQ19NQVJLLAorfT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vZjFfc3luY19lX3BpbnNbXSA9IHsKKwkvKiBTWU5DICovCisJUkNBUl9HUF9QSU4oMywgMSksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfc3luY19lX211eFtdID0geworCU1TSU9GMV9TWU5DX0VfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV9zczFfZV9waW5zW10gPSB7CisJLyogU1MxICovCisJUkNBUl9HUF9QSU4oMywgNCksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfc3MxX2VfbXV4W10gPSB7CisJTVNJT0YxX1NTMV9FX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfc3MyX2VfcGluc1tdID0geworCS8qIFNTMiAqLworCVJDQVJfR1BfUElOKDMsIDUpLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YxX3NzMl9lX211eFtdID0geworCU1TSU9GMV9TUzJfRV9NQVJLLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YxX3R4ZF9lX3BpbnNbXSA9IHsKKwkvKiBUWEQgKi8KKwlSQ0FSX0dQX1BJTigzLCAzKSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV90eGRfZV9tdXhbXSA9IHsKKwlNU0lPRjFfVFhEX0VfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV9yeGRfZV9waW5zW10gPSB7CisJLyogUlhEICovCisJUkNBUl9HUF9QSU4oMywgMiksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfcnhkX2VfbXV4W10gPSB7CisJTVNJT0YxX1JYRF9FX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfY2xrX2ZfcGluc1tdID0geworCS8qIFNDSyAq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GljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfdHhkX2dfbXV4W10gPSB7CisJTVNJT0YxX1RYRF9HX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfcnhkX2dfcGluc1tdID0geworCS8qIFJYRCAqLworCVJDQVJfR1BfUElOKDMsIDgpLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YxX3J4ZF9nX211eFtdID0geworCU1TSU9GMV9SWERfR19NQVJLLAorfTsKKy8qIC0gTVNJT0YyIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMl9jbGtfYV9waW5zW10gPSB7CisJLyogU0NLICovCisJUkNBUl9HUF9QSU4oMSwgOSksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjJfY2xrX2FfbXV4W10gPSB7CisJTVNJT0YyX1NDS19BX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjJfc3luY19hX3BpbnNbXSA9IHsKKwkvKiBTWU5DICovCisJUkNBUl9HUF9QSU4oMSwgOCksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjJfc3luY19hX211eFtdID0geworCU1TSU9GMl9TWU5DX0FfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMl9zczFfYV9waW5zW10gPSB7CisJLyogU1MxICovCisJUkNBUl9HUF9QSU4oMSwgNiksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjJfc3MxX2FfbXV4W10gPSB7CisJTVNJT0YyX1NTMV9BX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjJfc3MyX2FfcGluc1tdID0geworCS8qIFNTMiAqLworCVJDQVJfR1BfUElOKDEsIDcpLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YyX3NzMl9hX211eFtdID0geworCU1TSU9GMl9TUzJfQV9NQVJLLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YyX3R4ZF9hX3BpbnNbXSA9IHsKKwkvKiBUWEQgKi8KKwlSQ0FSX0dQX1BJTigxLCAxMSksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjJfdHhkX2FfbXV4W10gPSB7CisJTVNJT0YyX1RYRF9BX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjJfcnhkX2FfcGluc1tdID0geworCS8qIFJYRCAqLworCVJDQVJfR1BfUElOKDEsIDEwKSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMl9yeGRfYV9tdXhbXSA9IHsKKwlNU0lPRjJfUlhEX0FfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMl9jbGtfYl9waW5zW10gPSB7CisJLyogU0NLICovCisJUkNBUl9HUF9QSU4oMCwgNCksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjJfY2xrX2JfbXV4W10gPSB7CisJTVNJT0YyX1NDS19CX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjJfc3luY19iX3BpbnNbXSA9IHsKKwkvKiBTWU5DICovCisJUkNBUl9HUF9QSU4oMCwgNSksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjJfc3luY19iX211eFtdID0geworCU1TSU9GMl9TWU5DX0JfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMl9zczFfYl9waW5zW10gPSB7CisJLyogU1MxICovCisJUkNBUl9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2KSwgUkNBUl9HUF9QSU4oMywgNyksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBzZGhpMV9jdHJsX211eFtdID0geworCVNEMV9DTEtfTUFSSywgU0QxX0NNRF9NQVJLLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgc2RoaTFfY2RfcGluc1tdID0geworCS8qIENEICovCisJUkNBUl9HUF9QSU4oMywgMTQpLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgc2RoaTFfY2RfbXV4W10gPSB7CisJU0QxX0NEX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBzZGhpMV93cF9waW5zW10gPSB7CisJLyogV1AgKi8KKwlSQ0FSX0dQX1BJTigzLCAxNSksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBzZGhpMV93cF9tdXhbXSA9IHsKKwlTRDFfV1BfTUFSSywKK307CisvKiAtIFNESEkyIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBzZGhpMl9kYXRhMV9waW5zW10gPSB7CisJLyogRDAgKi8KKwlSQ0FSX0dQX1BJTig0LCAyKSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IHNkaGkyX2RhdGExX211eFtdID0geworCVNEMl9EQVQwX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBzZGhpMl9kYXRhNF9waW5zW10gPSB7CisJLyogRFswOjNdICovCisJUkNBUl9HUF9QSU4oNCwgMiksIFJDQVJfR1BfUElOKDQsIDMpLAorCVJDQVJfR1BfUElOKDQsIDQpLCBSQ0FSX0dQX1BJTig0LCA1KSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IHNkaGkyX2RhdGE0X211eFtdID0geworCVNEMl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BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjBfdHN5bmNfcGluc1tdID0geworCS8qIFRTWU5DICovCisJNjMsCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjBfdHN5bmNfbXV4W10gPSB7CisJTVNJT0YwX1RTWU5DX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjBfc3MxX3BpbnNbXSA9IHsKKwkvKiBTUzEgKi8KKwk2MiwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMF9zczFfbXV4W10gPSB7CisJTVNJT0YwX1NTMV9NQVJLLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YwX3NzMl9waW5zW10gPSB7CisJLyogU1MyICovCisJNzEsCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjBfc3MyX211eFtdID0geworCU1TSU9GMF9TUzJfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMF9yeGRfcGluc1tdID0geworCS8qIFJYRCAqLworCTcwLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YwX3J4ZF9tdXhbXSA9IHsKKwlNU0lPRjBfUlhEX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjBfdHhkX3BpbnNbXSA9IHsKKwkvKiBUWEQgKi8KKwk2NSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMF90eGRfbXV4W10gPSB7CisJTVNJT0YwX1RYRF9NQVJLLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YwX21jazBfcGluc1tdID0geworCS8qIE1TQ0swICovCisJNjgsCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjBfbWNrMF9tdXhbXSA9IHsKKwlNU0lPRjBfTUNLMF9NQVJLLAorfTsKKworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjBfbWNrMV9waW5zW10gPSB7CisJLyogTVNDSzEgKi8KKwk2OSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMF9tY2sxX211eFtdID0geworCU1TSU9GMF9NQ0sxX01BUkssCit9OworCitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMGxfcnNja19waW5zW10gPSB7CisJLyogUlNDSyAqLworCTIxNCwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMGxfcnNja19tdXhbXSA9IHsKKwlNU0lPRjBMX1JTQ0tfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMGxfdHNja19waW5zW10gPSB7CisJLyogVFNDSyAqLworCTIxOSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMGxfdHNja19tdXhbXSA9IHsKKwlNU0lPRjBMX1RTQ0tfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMGxfcnN5bmNfcGluc1tdID0geworCS8qIFJTWU5DICovCisJMjE1LAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YwbF9yc3luY19tdXhbXSA9IHsKKwlNU0lPRjBMX1JTWU5DX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjBsX3RzeW5jX3BpbnNbXSA9IHsKKwkvKiBUU1lOQyAqLworCTIxNywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMGxfdHN5bmNfbXV4W10gPSB7CisJTVNJT0YwTF9UU1lOQ19NQVJLLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YwbF9zczFfYV9waW5zW10gPSB7CisJLyogU1MxICovCisJMj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wlNU0lPRjFfUlNZTkNfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV90c3luY19waW5zW10gPSB7CisJLyogVFNZTkMgKi8KKwkyMzEsCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfdHN5bmNfbXV4W10gPSB7CisJTVNJT0YxX1RTWU5DX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfc3MxX3BpbnNbXSA9IHsKKwkvKiBTUzEgKi8KKwkyMzgsCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfc3MxX211eFtdID0geworCU1TSU9GMV9TUzFfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV9zczJfcGluc1tdID0geworCS8qIFNTMiAqLworCTIzOSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV9zczJfbXV4W10gPSB7CisJTVNJT0YxX1NTMl9NQVJLLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YxX3J4ZF9waW5zW10gPSB7CisJLyogUlhEICovCisJMjMzLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YxX3J4ZF9tdXhbXSA9IHsKKwlNU0lPRjFfUlhEX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfdHhkX3BpbnNbXSA9IHsKKwkvKiBUWEQgKi8KKwkyMzAsCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfdHhkX211eFtdID0geworCU1TSU9GMV9UWERfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV9tY2swX3BpbnNbXSA9IHsKKwkvKiBNU0NLMCAqLworCTIzNiwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50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jX211eFtdID0geworCU1TSU9GMlJfVFNZTkNfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMnJfcnhkX3BpbnNbXSA9IHsKKwkvKiBSWEQgKi8KKwkyNDQsCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjJyX3J4ZF9tdXhbXSA9IHsKKwlNU0lPRjJSX1JYRF9NQVJLLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2Yycl90eGRfcGluc1tdID0geworCS8qIFRYRCAqLworCTI0NSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMnJfdHhkX211eFtdID0geworCU1TSU9GMlJfVFhEX01BUkssCit9OworLyogLSBNU0lPRjMgKFBpbiBmdW5jdGlvbiBuYW1lIG9mIE1TSU9GMyBpcyBuYW1lZCBCQklGMSkgLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YzX3JzY2tfcGluc1tdID0geworCS8qIFJTQ0sgKi8KKwkxMTUsCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjNfcnNja19tdXhbXSA9IHsKKwlCQklGMV9SU0NLX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjNfdHNja19waW5zW10gPSB7CisJLyogVFNDSyAqLworCTExMiwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mM190c2NrX211eFtdID0geworCUJCSUYxX1RTQ0tfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mM19yc3luY19waW5zW10gPSB7CisJLyogUlNZTkMgKi8KKwkxMTYsCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjNfcnN5bmNfbXV4W10gPSB7CisJQkJJRjFfUlNZTkNfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mM190c3luY19waW5zW10gPSB7CisJLyogVFNZTkMgKi8KKwkxMTMsCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjNfdHN5bmNfbXV4W10gPSB7CisJQkJJRjFfVFNZTkNfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mM19zczFfcGluc1tdID0geworCS8qIFNTMSAqLworCTExNywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mM19zczFfbXV4W10gPSB7CisJQkJJRjFfU1MxX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjNfc3MyX3BpbnNbXSA9IHsKKwkvKiBTUzIgKi8KKwkxMDksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjNfc3MyX211eFtdID0geworCUJCSUYxX1NTMl9NQVJLLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YzX3J4ZF9waW5zW10gPSB7CisJLyogUlhEICovCisJMTExLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YzX3J4ZF9tdXhbXSA9IHsKKwlCQklGMV9SWERfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mM190eGRfcGluc1tdID0geworCS8qIFRYRCAqLworCTExNCwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mM190eGRfbXV4W10gPSB7CisJQkJJRjFfVFhEX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjNfZmxvd19waW5zW10gPSB7CisJLyogRkxPVyAqLworCTExNywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mM19mbG93X211eFtdID0geworCUJCSUYxX0ZMT1dfTUFSSywKK307CisKIC8qI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hJX1BJTihTVU5YSV9QSU5DVFJMX1BJTihELCAxKSwKKwkJICBTVU5YSV9GVU5DVElPTigweDAsICJncGlvX2luIiksCisJCSAgU1VOWElfRlVOQ1RJT04oMHgxLCAiZ3Bpb19vdXQiKSwKKwkJICBTVU5YSV9GVU5DVElPTigweDIsICJlbWFjIikpLAkJLyogUlhEMiAqLworCVNVTlhJX1BJTihTVU5YSV9QSU5DVFJMX1BJTihELCAyKSwKKwkJICBTVU5YSV9GVU5DVElPTigweDAsICJncGlvX2luIiksCisJCSAgU1VOWElfRlVOQ1RJT04oMHgxLCAiZ3Bpb19vdXQiKSwKKwkJICBTVU5YSV9GVU5DVElPTigweDIsICJlbWFjIikpLAkJLyogUlhEMSAqLworCVNVTlhJX1BJTihTVU5YSV9QSU5DVFJMX1BJTihELCAzKSwKKwkJICBTVU5YSV9GVU5DVElPTigweDAsICJncGlvX2luIiksCisJCSAgU1VOWElfRlVOQ1RJT04oMHgxLCAiZ3Bpb19vdXQiKSwKKwkJICBTVU5YSV9GVU5DVElPTigweDIsICJlbWFjIikpLAkJLyogUlhEMCAqLworCVNVTlhJX1BJTihTVU5YSV9QSU5DVFJMX1BJTihELCA0KSwKKwkJICBTVU5YSV9GVU5DVElPTigweDAsICJncGlvX2luIiksCisJCSAgU1VOWElfRlVOQ1RJT04oMHgxLCAiZ3Bpb19vdXQiKSwKKwkJICBTVU5YSV9GVU5DVElPTigweDIsICJlbWFjIikpLAkJLyogUlhDSyAqLworCVNVTlhJX1BJTihTVU5YSV9QSU5DVFJMX1BJTihELCA1KSwKKwkJICBTVU5YSV9GVU5DVElPTigweDAsICJncGlvX2luIiksCisJCSAgU1VOWElfRlVOQ1RJT04oMHgxLCAiZ3Bpb19vdXQiKSwKKwkJICBTVU5YSV9GVU5DVElPTigweDIsICJlbWFjIikpLAkJLyogUlhDVEwvUlhEViAqLworCVNVTlhJX1BJTihTVU5YSV9QSU5DVFJMX1BJTihELCA2KSwKKwkJICBTVU5YSV9GVU5DVElPT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GJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0CmRpZmYgLS1naXQgYS9pbmNsdWRlL2FjcGkvYWNleGNlcC5oIGIvaW5jbHVkZS9hY3BpL2FjZXhjZXAuaAppbmRleCAyMDRmNTgxLi4yYzM5NjM0IDEwMDY0NAotLS0gYS9pbmNsdWRlL2FjcGkvYWNleGNlcC5oCisrKyBiL2luY2x1ZGUvYWNwaS9hY2V4Y2VwLmgKQEAgLTUsNyArNSw3IEBACiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIC8qCi0gKiBDb3B5cmlnaHQgKEMpIDIwMDAgLSAyMDE1LCBJbnRlbCBDb3JwLgorICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxNiwgSW50ZWwgQ29ycC4KICAqIEFsbCByaWdodHMgcmVzZXJ2ZWQuCiAgKgogICogUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0CkBAIC0xMjYsOCArMTI2LDkgQEAKICNkZWZpbmUgQUVfT1dORVJfSURfTElNSVQgICAgICAgICAgICAgICBFWENFUF9FTlYgKDB4MDAxQikKICNkZWZpbmUgQUVfTk9UX0NPTkZJR1VSRUQgICAgICAgICAgICAgICBFWENFUF9FTlYgKDB4MDAxQykKICNkZWZpbmUgQUVfQUNDRVNTICAgICAgICAgICAgICAgICAgICAgICBFWENFUF9FTlYgKDB4MDAxRCkKKyNkZWZpbmUgQUVfSU9fRVJST1IgICAgICAgICAgICAgICAgICAgICBFWENFUF9FTlYgKDB4MDAxRSkKIAotI2RlZmluZSBBRV9DT0RFX0VOVl9NQVggICAgICAgICAgICAgICAgIDB4MDAxRAorI2RlZmluZSBBRV9DT0RFX0VOVl9NQVggICAgICAgICAgICAgICAgIDB4MDAxRQogCiAvKgogICogUHJvZ3JhbW1lciBle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G5pY192cG9ydF9jaGFuZ2VfZXZlbnRbMHgxXTsKKwl1OCAgICAgICAgIHJlc2VydmVkXzYxWzB4YV07CisJdTggICAgICAgICBsb2dfbWF4X3ZsYW5fbGlzdFsweDVdOwogCXU4ICAgICAgICAgcmVzZXJ2ZWRfNjJbMHgzXTsKKwl1OCAgICAgICAgIGxvZ19tYXhfY3VycmVudF9tY19saXN0WzB4NV07CisJdTggICAgICAgICByZXNlcnZlZF82M1sweDNdOworCXU4ICAgICAgICAgbG9nX21heF9jdXJyZW50X3VjX2xpc3RbMHg1XTsKKworCXU4ICAgICAgICAgcmVzZXJ2ZWRfNjRbMHg4MF07CisKKwl1OCAgICAgICAgIHJlc2VydmVkXzY1WzB4M107CiAJdTggICAgICAgICBsb2dfbWF4X2wyX3RhYmxlWzB4NV07Ci0JdTggICAgICAgICByZXNlcnZlZF82M1sweDhdOworCXU4ICAgICAgICAgcmVzZXJ2ZWRfNjZbMHg4XTsKIAl1OCAgICAgICAgIGxvZ191YXJfcGFnZV9zelsweDEwXTsKIAotCXU4ICAgICAgICAgcmVzZXJ2ZWRfNjRbMHgxMDBdOwotCi0JdTggICAgICAgICByZXNlcnZlZF82NVsweDFmXTsKKwl1OCAgICAgICAgIHJlc2VydmVkXzY3WzB4NDBdOworCXU4ICAgICAgICAgZGV2aWNlX2ZyZXF1ZW5jeV9raHpbMHgyMF07CisJdTggICAgICAgICByZXNlcnZlZF82OFsweDVmXTsKIAl1OCAgICAgICAgIGNxZV96aXBbMHgxXTsKIAogCXU4ICAgICAgICAgY3FlX3ppcF90aW1lb3V0WzB4MTBdOwogCXU4ICAgICAgICAgY3FlX3ppcF9tYXhfbnVtWzB4MTBdOwogCi0JdTggICAgICAgICByZXNlcnZlZF82NlsweDIyMF07CisJdTggICAgICAgICByZXNlcnZlZF82OVsweDIyMF07CiB9OwogCi1lbnVtIHsKLQlNTFg1X0RFU1RfRk9STUFUX1NUUlVDVF9ERVNUSU5BVElPTl9UWVBFX0ZMT1dfVEF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ICAgICAgcHJvbWlzY191Y1sweDFdOworCXU4ICAgICAgICAgcHJvbWlzY19tY1sweDFdOworCXU4ICAgICAgICAgcHJvbWlzY19hbGxbMHgxXTsKKwl1OCAgICAgICAgIHJlc2VydmVkXzRbMHgyXTsKIAl1OCAgICAgICAgIGFsbG93ZWRfbGlzdF90eXBlWzB4M107Ci0JdTggICAgICAgICByZXNlcnZlZF8zWzB4Y107CisJdTggICAgICAgICByZXNlcnZlZF81WzB4Y107CiAJdTggICAgICAgICBhbGxvd2VkX2xpc3Rfc2l6ZVsweGNdOwogCiAJc3RydWN0IG1seDVfaWZjX21hY19hZGRyZXNzX2xheW91dF9iaXRzIHBlcm1hbmVudF9hZGRyZXNzOwogCi0JdTggICAgICAgICByZXNlcnZlZF80WzB4MjBdOworCXU4ICAgICAgICAgcmVzZXJ2ZWRfNlsweDIwXTsKIAogCXU4ICAgICAgICAgY3VycmVudF91Y19tYWNfYWRkcmVzc1swXVsweDQwXTsKIH07CkBAIC0yMjYzLDYgKzIzNDAsMjYgQEAKIAl1OCAgICAgICAgIHJlc2VydmVkXzZbMHhjYTBdOwogfTsKIAorc3RydWN0IG1seDVfaWZjX2Vzd192cG9ydF9jb250ZXh0X2JpdHMgeworCXU4ICAgICAgICAgcmVzZXJ2ZWRfMFsweDNdOworCXU4ICAgICAgICAgdnBvcnRfc3ZsYW5fc3RyaXBbMHgxXTsKKwl1OCAgICAgICAgIHZwb3J0X2N2bGFuX3N0cmlwWzB4MV07CisJdTggICAgICAgICB2cG9ydF9zdmxhbl9pbnNlcnRbMHgxXTsKKwl1OCAgICAgICAgIHZwb3J0X2N2bGFuX2luc2VydFsweDJdOworCXU4ICAgICAgICAgcmVzZXJ2ZWRfMVsweDE4XTsKKworCXU4ICAgICAgICAgcmVzZXJ2ZWRfMlsweDIwXTsKKworCXU4ICAgICAgICAgc3ZsYW5fY2ZpWzB4MV07CisJdTggICAgICAgICBzdmxhbl9wY3BbMHgzXTsKKwl1OCAgICAgICAgIHN2bG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CisJdTggICAgICAgICBvdGhlcl92cG9ydFsweDFdOworCXU4ICAgICAgICAgcmVzZXJ2ZWRfMlsweGZdOworCXU4ICAgICAgICAgdnBvcnRfbnVtYmVyWzB4MTBdOworCisJdTggICAgICAgICByZXNlcnZlZF8zWzB4MjBdOworfTsKKworc3RydWN0IG1seDVfaWZjX21vZGlmeV9lc3dfdnBvcnRfY29udGV4dF9vdXRfYml0cyB7CisJdTggICAgICAgICBzdGF0dXNbMHg4XTsKKwl1OCAgICAgICAgIHJlc2VydmVkXzBbMHgxOF07CisKKwl1OCAgICAgICAgIHN5bmRyb21lWzB4MjBdOworCisJdTggICAgICAgICByZXNlcnZlZF8xWzB4NDBdOworfTsKKworc3RydWN0IG1seDVfaWZjX2Vzd192cG9ydF9jb250ZXh0X2ZpZWxkc19zZWxlY3RfYml0cyB7CisJdTggICAgICAgICByZXNlcnZlZFsweDFjXTsKKwl1OCAgICAgICAgIHZwb3J0X2N2bGFuX2luc2VydFsweDFdOworCXU4ICAgICAgICAgdnBvcnRfc3ZsYW5faW5zZXJ0WzB4MV07CisJdTggICAgICAgICB2cG9ydF9jdmxhbl9zdHJpcFsweDFdOworCXU4ICAgICAgICAgdnBvcnRfc3ZsYW5fc3RyaXBbMHgxXTsKK307CisKK3N0cnVjdCBtbHg1X2lmY19tb2RpZnlfZXN3X3Zwb3J0X2NvbnRleHRfaW5fYml0cyB7CisJdTggICAgICAgICBvcGNvZGVbMHgxMF07CisJdTggICAgICAgICByZXNlcnZlZF8wWzB4MTBdOworCisJdTggICAgICAgICByZXNlcnZlZF8xWzB4MTBdOworCXU4ICAgICAgICAgb3BfbW9kWzB4MTBdOworCisJdTggICAgICAgICBvdGhlcl92cG9ydFsweDFdOworCXU4ICAgICAgICAgcmVzZXJ2ZWRfMlsweGZdOworCXU4ICAgICAgICAgdnBvcnRfbnVtYmVyWzB4MTBdOworCisJc3RydWN0IG1seDVfaWZjX2Vzd192cG9ydF9jb250ZXh0X2ZpZWxkc19zZWxlY3RfYml0cyBmaWVsZF9zZWxlY3Q7CisKKwlzdHJ1Y3QgbWx4NV9pZmNfZXN3X3Zwb3J0X2NvbnRleHRfYml0cyBlc3dfdnBvcnRfY29udGV4dDsKK307CisKIHN0cnVjdCBtbHg1X2lmY19xdWVyeV9lcV9vdXRfYml0cyB7CiAJdTggICAgICAgICBzdGF0dXNbMHg4XTsKIAl1OCAgICAgICAgIHJlc2VydmVkXzBbMHgxOF07CkBAIC00MjI4LDcgKzQzOTQsMTAgQEAKIH07CiAKIHN0cnVjdCBtbHg1X2lmY19tb2RpZnlfbmljX3Zwb3J0X2ZpZWxkX3NlbGVjdF9iaXRzIHsKLQl1OCAgICAgICAgIHJlc2VydmVkXzBbMHgxY107CisJdTggICAgICAgICByZXNlcnZlZF8wWzB4MTldOworCXU4ICAgICAgICAgbXR1WzB4MV07CisJdTggICAgICAgICBjaGFuZ2VfZXZlbnRbMHgxXTsKKwl1OCAgICAgICAgIHByb21pc2NbMHgxXTsKIAl1OCAgICAgICAgIHBlcm1hbmVudF9hZGRyZXNzWzB4MV07CiAJdTggICAgICAgICBhZGRyZXNzZXNfbGlzdFsweDFdOwogCXU4ICAgICAgICAgcm9jZV9lblsweDFdOwpAQCAtNTUxOSwxMiArNTY4OCwxNiBAQAogCiAJdTggICAgICAgICByZXNlcnZlZF80WzB4MjBdOwogCi0JdTggICAgICAgICByZXNlcnZlZF81WzB4OF07CisJdTggICAgICAgICByZXNlcnZlZF81WzB4NF07CisJdTggICAgICAgICB0YWJsZV9taXNzX21vZGVbMHg0XTsKIAl1OCAgICAgICAgIGxldmVsWzB4OF07CiAJdTggICAgICAgICByZXNlcnZlZF82WzB4OF07CiAJdTggICAgICAgICBsb2dfc2l6ZVsweDhdOwogCi0JdTggICAgICAgICByZXNlcnZlZF83WzB4MTIwXTsKKwl1OCAgICAgICAgIHJlc2VydmVkXzdbMHg4XTsKKwl1OCAgICAgICAgIHRhYmxlX21pc3NfaWRbMHgxOF07CisKKwl1OCAgICAgICAgIHJlc2VydmVkXzhbMHgxMDBdOwogfTsKIAogc3RydWN0IG1seDVfaWZjX2NyZWF0ZV9mbG93X2dyb3VwX291dF9iaXRzIHsKQEAgLTY3OTgsNCArNjk3MSw3MiBAQAogCXU4ICAgICAgICAgcmVzZXJ2ZWRfMFsweDIwMDYwXTsKIH07CiAKK3N0cnVjdCBtbHg1X2lmY19zZXRfZmxvd190YWJsZV9yb290X291dF9iaXRzIHsKKwl1OCAgICAgICAgIHN0YXR1c1sweDhdOworCXU4ICAgICAgICAgcmVzZXJ2ZWRfMFsweDE4XTsKKworCXU4ICAgICAgICAgc3luZHJvbWVbMHgyMF07CisKKwl1OCAgICAgICAgIHJlc2VydmVkXzFbMHg0MF07Cit9OworCitzdHJ1Y3QgbWx4NV9pZmNfc2V0X2Zsb3dfdGFibGVfcm9vdF9pbl9iaXRzIHsKKwl1OCAgICAgICAgIG9wY29kZVsweDEwXTsKKwl1OCAgICAgICAgIHJlc2VydmVkXzBbMHgxMF07CisKKwl1OCAgICAgICAgIHJlc2VydmVkXzFbMHgxMF07CisJdTggICAgICAgICBvcF9tb2RbMHgxMF07CisKKwl1OCAgICAgICAgIHJlc2VydmVkXzJbMHg0MF07CisKKwl1OCAgICAgICAgIHRhYmxlX3R5cGVbMHg4XTsKKwl1OCAgICAgICAgIHJlc2VydmVkXzNbMHgxOF07CisKKwl1OCAgICAgICAgIHJlc2VydmVkXzRbMHg4XTsKKwl1OCAgICAgICAgIHRhYmxlX2lkWzB4MThdOworCisJdTggICAgICAgICByZXNlcnZlZF81WzB4MTQwXTsKK307CisKK2VudW0geworCU1MWDVfTU9ESUZZX0ZMT1dfVEFCTEVfTUlTU19UQUJMRV9JRCA9IDB4MSwKK307CisKK3N0cnVjdCBtbHg1X2lmY19tb2RpZnlfZmxvd190YWJsZV9vdXRfYml0cyB7CisJdTggICAgICAgICBzdGF0dXNbMHg4XTsKKwl1OCAgICAgICAgIHJlc2VydmVkXzBbMHgxOF07CisKKwl1OCAgICAgICAgIHN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0ZXJzCisgKgorICogcmV0dXJucyB0cnVlIGlmIHRoZSB3YWl0IGxpc3QgaXMgbm90IGVtcHR5CisgKgorICogTk9URTogdGhpcyBmdW5jdGlvbiBpcyBsb2NrbGVzcyBhbmQgcmVxdWlyZXMgY2FyZSwgaW5jb3JyZWN0IHVzYWdlIF93aWxsXworICogbGVhZCB0byBzcG9yYWRpYyBhbmQgbm9uLW9idmlvdXMgZmFpbHVyZS4KKyAqCisgKiBVc2UgZWl0aGVyIHdoaWxlIGhvbGRpbmcgd2FpdF9xdWV1ZV9oZWFkX3Q6OmxvY2sgb3Igd2hlbiB1c2VkIGZvciB3YWtldXBzCisgKiB3aXRoIGFuIGV4dHJhIHNtcF9tYigpIGxpa2U6CisgKgorICogICAgICBDUFUwIC0gd2FrZXIgICAgICAgICAgICAgICAgICAgIENQVTEgLSB3YWl0ZXIKKyAqCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICg7OykgeworICogICAgICBAY29uZCA9IHRydWU7ICAgICAgICAgICAgICAgICAgICAgcHJlcGFyZV90b193YWl0KCZ3cSwgJndhaXQsIHN0YXRlKTsKKyAqICAgICAgc21wX21iKCk7ICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNtcF9tYigpIGZyb20gc2V0X2N1cnJlbnRfc3RhdGUoKQorICogICAgICBpZiAod2FpdHF1ZXVlX2FjdGl2ZSh3cSkpICAgICAgICAgaWYgKEBjb25kKQorICogICAgICAgIHdha2VfdXAod3EpOyAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjaGVkdWxlKCk7CisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmlzaF93YWl0KCZ3cSwgJndhaXQpOworICoKKyAqIEJlY2F1c2Ugd2l0aG91dCB0aGUgZXhwbGljaXQ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gICBuICAgICAgICBuICAgIG4KKyAgIG1zcDM0eDdkICBuICAgIG4gICAgbiAgICBuICAgICAgICBuICAgIG4KKyAgIG1zcDM0eDBnICB5ICAgIHkgICAgbiAgICBuICAgICAgICBuICAgIG4KKyAgIG1zcDM0eDFnICB5ICAgIHkgICAgbiAgICBuICAgICAgICBuICAgIG4KKyAgIG1zcDM0eDJnICB5ICAgIHkgICAgbiAgICB5ICAgICAgICB5ICAgIHkKKyAgIG1zcDM0eDVnICB5ICAgIHkgICAgbiAgICBuICAgICAgICBuICAgIG4KKyAgIG1zcDM0eDdnICBuICAgIG4gICAgbiAgICBuICAgICAgICBuICAgIG4KKyAgIG1zcDQ0eDBnICB5ICAgIHkgICAgeSAgICB5ICAgICAgICB5ICAgIHkKKyAgIG1zcDQ0eDhnICB5ICAgIHkgICAgeSAgICBuICAgICAgICBuICAgIG4KKyAqLworCisvKiBEU1Agb3V0cHV0cyB2cy4gbXNwIHZlcnNpb24gKi8KKy8qIENoaXAgICAgICBNQUlOIEFVWCBTQ0FSVDEgU0NBUlQyIEkyUworICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICBtc3AzNHgwYiAgeSAgICB5ICAgeSAgICAgIG4gICAgICB5CisgICBtc3AzNHgwYyAgeSAgICB5ICAgeSAgICAgIG4gICAgICB5CisgICBtc3AzNHgwZCAgeSAgICB5ICAgeSAgICAgIHkgICAgICB5CisgICBtc3AzNHg1ZCAgeSAgICBuICAgeSAgICAgIG4gICAgICB5CisgICBtc3AzNHg3ZCAgeSAgICBuICAgeSAgICAgIG4gICAgICBuCisgICBtc3AzNHgwZyAgeSAgICB5ICAgeSAgICAgIHkgICAgICB5CisgICBtc3AzNHgxZyAgeSAgICB5ICAgeSAgICAgIHkgICAgICB5CisgICBtc3AzNHgyZyAgeSAgICB5ICAgeSAgICAgIHkgICAgICB5CisgICBtc3AzNHg1ZyAgeSAgICBuICAgeSAgICAgIG4gICAgICB5CisgICBtc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eSAgIHkgICB5Ci0gKi8KLQotLyogRFNQIGlucHV0cyB2cy4gbXNwIHZlcnNpb24gKHR1bmVyIGFuZCBTQ0FSVCBpbnB1dHMgYXJlIGFsd2F5cyBhdmFpbGFibGUpICovCi0vKiBDaGlwICAgICAgSTJTMSBJMlMyIEkyUzMgTUFJTl9BVkMgTUFJTiBBVVgKLSAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICAgbXNwMzR4MGIgIHkgICAgbiAgICBuICAgIG4gICAgICAgIG4gICAgbgotICAgbXNwMzR4MGMgIHkgICAgeSAgICBuICAgIG4gICAgICAgIG4gICAgbgotICAgbXNwMzR4MGQgIHkgICAgeSAgICBuICAgIG4gICAgICAgIG4gICAgbgotICAgbXNwMzR4NWQgIHkgICAgeSAgICBuICAgIG4gICAgICAgIG4gICAgbgotICAgbXNwMzR4N2QgIG4gICAgbiAgICBuICAgIG4gICAgICAgIG4gICAgbgotICAgbXNwMzR4MGcgIHkgICAgeSAgICBuICAgIG4gICAgICAgIG4gICAgbgotICAgbXNwMzR4MWcgIHkgICAgeSAgICBuICAgIG4gICAgICAgIG4gICAgbgotICAgbXNwMzR4MmcgIHkgICAgeSAgICBuICAgIHkgICAgICAgIHkgICAgeQotICAgbXNwMzR4NWcgIHkgICAgeSAgICBuICAgIG4gICAgICAgIG4gICAgbgotICAgbXNwMzR4N2cgIG4gICAgbiAgICBuICAgIG4gICAgICAgIG4gICAgbgotICAgbXNwNDR4MGcgIHkgICAgeSAgICB5ICAgIHkgICAgICAgIHkgICAgeQotICAgbXNwNDR4OGcgIHkgICAgeSAgICB5ICAgIG4gICAgICAgIG4gICAgbgotICovCi0KLS8qIERTUCBvdXRwdXRzIHZzLiBtc3AgdmVyc2lvbiAqLwotLyogQ2hpcCAgICAgIE1BSU4gQVVYIFNDQVJUMSBTQ0FSVDIgSTJTCi0gICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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X1NFTkRfUFVMU0UgICAgICAgICAgICBMSVJDX01PREUyU0VORChMSVJDX01PREVfUFVMU0UpCisjZGVmaW5lIExJUkNfQ0FOX1NFTkRfTU9ERTIgICAgICAgICAgICBMSVJDX01PREUyU0VORChMSVJDX01PREVfTU9ERTIpCisjZGVmaW5lIExJUkNfQ0FOX1NFTkRfTElSQ0NPREUgICAgICAgICBMSVJDX01PREUyU0VORChMSVJDX01PREVfTElSQ0NPREUpCisKKyNkZWZpbmUgTElSQ19DQU5fU0VORF9NQVNLICAgICAgICAgICAgIDB4MDAwMDAwM2YKKworI2RlZmluZSBMSVJDX0NBTl9TRVRfU0VORF9DQVJSSUVSICAgICAgMHgwMDAwMDEwMAorI2RlZmluZSBMSVJDX0NBTl9TRVRfU0VORF9EVVRZX0NZQ0xFICAgMHgwMDAwMDIwMAorI2RlZmluZSBMSVJDX0NBTl9TRVRfVFJBTlNNSVRURVJfTUFTSyAgMHgwMDAwMDQwMAorCisjZGVmaW5lIExJUkNfQ0FOX1JFQ19SQVcgICAgICAgICAgICAgICBMSVJDX01PREUyUkVDKExJUkNfTU9ERV9SQVcpCisjZGVmaW5lIExJUkNfQ0FOX1JFQ19QVUxTRSAgICAgICAgICAgICBMSVJDX01PREUyUkVDKExJUkNfTU9ERV9QVUxTRSkKKyNkZWZpbmUgTElSQ19DQU5fUkVDX01PREUyICAgICAgICAgICAgIExJUkNfTU9ERTJSRUMoTElSQ19NT0RFX01PREUyKQorI2RlZmluZSBMSVJDX0NBTl9SRUNfTElSQ0NPREUgICAgICAgICAgTElSQ19NT0RFMlJFQyhMSVJDX01PREVfTElSQ0NPREUpCisKKyNkZWZpbmUgTElSQ19DQU5fUkVDX01BU0sgICAgICAgICAgICAgIExJUkNfTU9ERTJSRUMoTElSQ19DQU5fU0VORF9NQVNLKQorCisjZGVmaW5lIExJUkNfQ0FOX1NFVF9SRUNfQ0FSUklFUiAgICAgICAoTElSQ19DQU5fU0VUX1NFTkRfQ0FSUklFUiA8PCAxNik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S0+bG9jaworICoKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMT0NLIHJxKDApLT5sb2NrIC8vIG9yZGVycyBhZ2FpbnN0IENQVTAKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXF1ZXVlIFgKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBVTkxPQ0sgcnEoMCktPmxvY2sKKyAqCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTE9DSyBycSgxKS0+bG9jaworICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVucXVldWUgWAorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVOTE9DSyBycSgxKS0+bG9jaworICoKKyAqICAgICAgICAgICAgICAgICAgIExPQ0sgcnEoMSktPmxvY2sgLy8gb3JkZXJzIGFnYWluc3QgQ1BVMgorICogICAgICAgICAgICAgICAgICAgc2NoZWQtb3V0IFoKKyAqICAgICAgICAgICAgICAgICAgIHNjaGVkLWluIFgKKyAqICAgICAgICAgICAgICAgICAgIFVOTE9DSyBycSgxKS0+bG9jaworICoKKyAqCisgKiAgQkxPQ0tJTkcgLS0gYWthLiBTTEVFUCArIFdBS0VVUAorICoKKyAqIEZvciBibG9ja2luZyB3ZSAob2J2aW91c2x5KSBuZWVkIHRvIHByb3ZpZGUgdGhlIHNhbWUgZ3VhcmFudGVlIGFzIGZvcgorICogbWlncmF0aW9uLiBIb3dldmVyIHRoZSBtZWFucyBhcmUgY29tcGxldGVseSBkaWZmZXJlbnQgYXMgdGhlcmUgaXMgbm8gbG9jaworICogY2hhaW4gdG8gcHJvdmlkZSBvcmRlci4gSW5zdGVhZCB3ZSBkbzoKKyAqCisgKiAgIDEpIHNtcF9zdG9yZV9yZWxlYXNlKFgtPm9uX2NwdSwgMCkKKyAqICAgMikgc21wX2NvbmRfYWNxdWlyZSghWC0+b25fY3B1KQorICoKKyAqIEV4YW1wbGU6CisgKgorICogICBDUFUwIChzY2hlZHVsZSkgIENQVTEgKHRyeV90b193YWtlX3VwKSBDUFUyIChzY2hlZHVsZSkKKyAqCisgKiAgIExPQ0sgcnEoMCktPmxvY2sgTE9DSyBYLT5waV9sb2NrCisgKiAgIGRlcXVldWUgWAorICogICBzY2hlZC1vdXQgWAorICogICBzbXBfc3RvcmVfcmVsZWFzZShYLT5vbl9jcHUsIDApOworICoKKyAqICAgICAgICAgICAgICAgICAgICBzbXBfY29uZF9hY3F1aXJlKCFYLT5vbl9jcHUpOworICogICAgICAgICAgICAgICAgICAgIFgtPnN0YXRlID0gV0FLSU5HCisgKiAgICAgICAgICAgICAgICAgICAgc2V0X3Rhc2tfY3B1KFgsMikKKyAqCisgKiAgICAgICAgICAgICAgICAgICAgTE9DSyBycSgyKS0+bG9jaworICogICAgICAgICAgICAgICAgICAgIGVucXVldWUgWAorICogICAgICAgICAgICAgICAgICAgIFgtPnN0YXRlID0gUlVOTklORworICogICAgICAgICAgICAgICAgICAgIFVOTE9DSyBycSgyKS0+bG9jaworICoKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTE9DSyBycSgyKS0+bG9jayAvLyBvcmRlcnMgYWdhaW5zdCBDUFUxCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjaGVkLW91dCBaCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjaGVkLWluIFgKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVU5MT0NLIHJxKDIpLT5sb2NrCisgKgorICogICAgICAgICAgICAgICAgICAgIFVOTE9DSyBYLT5waV9sb2NrCisgKiAgIFVOTE9DSyBycSgwKS0+bG9jaworICoKKyAqCisgKiBIb3dldmVyOyBmb3Igd2FrZXVwcyB0aGVyZSBpcyBhIHNlY29uZCBndWFyYW50ZWUgd2UgbXVzdCBwcm92aWRlLCBuYW1lbHkgd2UKKyAqI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TE1NCwgICAgIDIzMjU0LCAgICAgMTg3MDUsICAgICAxNDk0OSwgICAgIDExOTE2LAorIC8qIC0xMCAqLyAgICAgIDk1NDgsICAgICAgNzYyMCwgICAgICA2MTAwLCAgICAgIDQ5MDQsICAgICAgMzkwNiwKKyAvKiAgLTUgKi8gICAgICAzMTIxLCAgICAgIDI1MDEsICAgICAgMTk5MSwgICAgICAxNTg2LCAgICAgIDEyNzcsCisgLyogICAwICovICAgICAgMTAyNCwgICAgICAgODIwLCAgICAgICA2NTUsICAgICAgIDUyNiwgICAgICAgNDIzLAorIC8qICAgNSAqLyAgICAgICAzMzUsICAgICAgIDI3MiwgICAgICAgMjE1LCAgICAgICAxNzIsICAgICAgIDEzNywKKyAvKiAgMTAgKi8gICAgICAgMTEwLCAgICAgICAgODcsICAgICAgICA3MCwgICAgICAgIDU2LCAgICAgICAgNDUsCisgLyogIDE1ICovICAgICAgICAzNiwgICAgICAgIDI5LCAgICAgICAgMjMsICAgICAgICAxOCwgICAgICAgIDE1LAorfTsKKworLyoKKyAqIEludmVyc2UgKDJeMzIveCkgdmFsdWVzIG9mIHRoZSBzY2hlZF9wcmlvX3RvX3dlaWdodFtdIGFycmF5LCBwcmVjYWxjdWxhdGVkLgorICoKKyAqIEluIGNhc2VzIHdoZXJlIHRoZSB3ZWlnaHQgZG9lcyBub3QgY2hhbmdlIG9mdGVuLCB3ZSBjYW4gdXNlIHRoZQorICogcHJlY2FsY3VsYXRlZCBpbnZlcnNlIHRvIHNwZWVkIHVwIGFyaXRobWV0aWNzIGJ5IHR1cm5pbmcgZGl2aXNpb25zCisgKiBpbnRvIG11bHRpcGxpY2F0aW9uczoKKyAqLworY29uc3QgdTMyIHNjaGVkX3ByaW9fdG9fd211bHRbNDBdID0geworIC8qIC0yMCAqLyAgICAgNDgzODgsICAgICA1OTg1NiwgICAgIDc2MDQwLCAgICAgOTI4MTgsICAgIDExODM0OCwKKyAvKiAtMTUgKi8gICAgMTQ3MzIwLCAgICAxODQ2OTg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WRfdW5sb2NrKG5vZGUpOworCQkJbmxtc2dfZnJlZShtc2cuc2tiKTsKKwkJCXJldHVybiAtRUlOVkFMOworCQl9CisKKwkJZXJyID0gX190aXBjX25sX2FkZF9saW5rKG5ldCwgJm1zZywgbGluaywgMCk7CisJCXRpcGNfbm9kZV9yZWFkX3VubG9jayhub2RlKTsKKwkJaWYgKGVycikgeworCQkJbmxtc2dfZnJlZShtc2cuc2tiKTsKKwkJCXJldHVybiBlcnI7CisJCX0KKwl9CisKKwlyZXR1cm4gZ2VubG1zZ19yZXBseShtc2cuc2tiLCBpbmZvKTsKK30KKworaW50IHRpcGNfbmxfbm9kZV9yZXNldF9saW5rX3N0YXRzKHN0cnVjdCBza19idWZmICpza2IsIHN0cnVjdCBnZW5sX2luZm8gKmluZm8pCit7CisJaW50IGVycjsKKwljaGFyICpsaW5rX25hbWU7CisJdW5zaWduZWQgaW50IGJlYXJlcl9pZDsKKwlzdHJ1Y3QgdGlwY19saW5rICpsaW5rOworCXN0cnVjdCB0aXBjX25vZGUgKm5vZGU7CisJc3RydWN0IG5sYXR0ciAqYXR0cnNbVElQQ19OTEFfTElOS19NQVggKyAxXTsKKwlzdHJ1Y3QgbmV0ICpuZXQgPSBzb2NrX25ldChza2ItPnNrKTsKKwlzdHJ1Y3QgdGlwY19saW5rX2VudHJ5ICpsZTsKKworCWlmICghaW5mby0+YXR0cnNbVElQQ19OTEFfTElOS10pCisJCXJldHVybiAtRUlOVkFMOworCisJZXJyID0gbmxhX3BhcnNlX25lc3RlZChhdHRycywgVElQQ19OTEFfTElOS19NQVgsCisJCQkgICAgICAgaW5mby0+YXR0cnNbVElQQ19OTEFfTElOS10sCisJCQkgICAgICAgdGlwY19ubF9saW5rX3BvbGljeSk7CisJaWYgKGVycikKKwkJcmV0dXJuIGVycjsKKworCWlmICghYXR0cnNbVElQQ19OTEFfTElOS19OQU1FXSkKKwkJcmV0dXJuIC1FSU5WQUw7CisKKwlsaW5rX25hbWUgPSBubGFfZGF0YShh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dCkgeworCQkJaWYgKG9wdHMtPnNob3J0X25hbWUgPT0gKm9wdHN0cikgeworCQkJCXByaW50X29wdGlvbl9oZWxwKG9wdHMsIDApOworCQkJCWJyZWFrOworCQkJfQorCQkJY29udGludWU7CisJCX0KKworCQlpZiAob3B0cy0+bG9uZ19uYW1lID09IE5VTEwpCisJCQljb250aW51ZTsKKworCQlpZiAoIXByZWZpeGNtcChvcHRzLT5sb25nX25hbWUsIG9wdHN0cikpCisJCQlwcmludF9vcHRpb25faGVscChvcHRzLCAwKTsKKwkJaWYgKCFwcmVmaXhjbXAoIm5vLSIsIG9wdHN0cikgJiYKKwkJICAgICFwcmVmaXhjbXAob3B0cy0+bG9uZ19uYW1lLCBvcHRzdHIgKyAzKSkKKwkJCXByaW50X29wdGlvbl9oZWxwKG9wdHMsIDApOworCX0KKworCXJldHVybiBQQVJTRV9PUFRfSEVMUDsKK30KKworCitpbnQgcGFyc2Vfb3B0X3ZlcmJvc2l0eV9jYihjb25zdCBzdHJ1Y3Qgb3B0aW9uICpvcHQsCisJCQkgICBjb25zdCBjaGFyICphcmcgX19tYXliZV91bnVzZWQsCisJCQkgICBpbnQgdW5zZXQpCit7CisJaW50ICp0YXJnZXQgPSBvcHQtPnZhbHVlOworCisJaWYgKHVuc2V0KQorCQkvKiAtLW5vLXF1aWV0LCAtLW5vLXZlcmJvc2UgKi8KKwkJKnRhcmdldCA9IDA7CisJZWxzZSBpZiAob3B0LT5zaG9ydF9uYW1lID09ICd2JykgeworCQlpZiAoKnRhcmdldCA+PSAwKQorCQkJKCp0YXJnZXQpKys7CisJCWVsc2UKKwkJCSp0YXJnZXQgPSAxOworCX0gZWxzZSB7CisJCWlmICgqdGFyZ2V0IDw9IDApCisJCQkoKnRhcmdldCktLTsKKwkJZWxzZQorCQkJKnRhcmdldCA9IC0xOworCX0KKwlyZXR1cm4gMDsKK30KKworc3RhdGljIHN0cnVjdCBvcHRpb24gKgorZmluZF9vcHRpb24oc3RydWN0IG9wdGlvbiAqb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50ZXI7CisJaW50IGVycjsKKworCWlmIChpc19waXBlKSB7CisJCWVyciA9IHBlcmZfZXZlbnRfX3N5bnRoZXNpemVfYXR0cnMoTlVMTCwgcGVyZl9zdGF0LnNlc3Npb24sCisJCQkJCQkgICBwcm9jZXNzX3N5bnRoZXNpemVkX2V2ZW50KTsKKwkJaWYgKGVyciA8IDApIHsKKwkJCXByX2VycigiQ291bGRuJ3Qgc3ludGhlc2l6ZSBhdHRycy5cbiIpOworCQkJcmV0dXJuIGVycjsKKwkJfQorCX0KKworCS8qCisJICogU3ludGhlc2l6ZSBvdGhlciBldmVudHMgc3R1ZmYgbm90IGNhcnJpZWQgd2l0aGluCisJICogYXR0ciBldmVudCAtIHVuaXQsIHNjYWxlLCBuYW1lCisJICovCisJZXZsaXN0X19mb3JfZWFjaChldnNlbF9saXN0LCBjb3VudGVyKSB7CisJCWlmICghY291bnRlci0+c3VwcG9ydGVkKQorCQkJY29udGludWU7CisKKwkJLyoKKwkJICogU3ludGhlc2l6ZSB1bml0IGFuZCBzY2FsZSBvbmx5IGlmIGl0J3MgZGVmaW5lZC4KKwkJICovCisJCWlmIChoYXNfdW5pdChjb3VudGVyKSkgeworCQkJZXJyID0gcGVyZl9ldmVudF9fc3ludGhlc2l6ZV9ldmVudF91cGRhdGVfdW5pdChOVUxMLCBjb3VudGVyLCBwcm9jZXNzX3N5bnRoZXNpemVkX2V2ZW50KTsKKwkJCWlmIChlcnIgPCAwKSB7CisJCQkJcHJfZXJyKCJDb3VsZG4ndCBzeW50aGVzaXplIGV2c2VsIHVuaXQuXG4iKTsKKwkJCQlyZXR1cm4gZXJyOworCQkJfQorCQl9CisKKwkJaWYgKGhhc19zY2FsZShjb3VudGVyKSkgeworCQkJZXJyID0gcGVyZl9ldmVudF9fc3ludGhlc2l6ZV9ldmVudF91cGRhdGVfc2NhbGUoTlVMTCwgY291bnRlciwgcHJvY2Vzc19zeW50aGVzaXplZF9ldmVudCk7CisJCQlpZiAoZXJyIDwgMCkgeworC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luc3RhbGw6CiAJJChjYWxsIGRlc2NlbmQsdG9vbHMvJChAOl91bmluc3RhbGw9KSx1bmluc3RhbGwpCiAKIC5QSE9OWTogRk9SQ0UKZGlmZiAtLWdpdCBhL3Rvb2xzL3Bvd2VyL2FjcGkvY29tbW9uL2NtZnNpemUuYyBiL3Rvb2xzL3Bvd2VyL2FjcGkvY29tbW9uL2NtZnNpemUuYwppbmRleCBlZWM2ODgwLi5lNzNhNzlmIDEwMDY0NAotLS0gYS90b29scy9wb3dlci9hY3BpL2NvbW1vbi9jbWZzaXplLmMKKysrIGIvdG9vbHMvcG93ZXIvYWNwaS9jb21tb24vY21mc2l6ZS5jCkBAIC01LDcgKzUsNyBAQAogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKgotICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxNSwgSW50ZWwgQ29ycC4KKyAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTYsIEludGVsIENvcnAuCiAgKiBBbGwgcmlnaHRzIHJlc2VydmVkLgogICoKICAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dApkaWZmIC0tZ2l0IGEvdG9vbHMvcG93ZXIvYWNwaS9jb21tb24vZ2V0b3B0LmMgYi90b29scy9wb3dlci9hY3BpL2NvbW1vbi9nZXRvcHQuYwppbmRleCAzMjZlODI2Li4wYmQzNDNmIDEwMDY0NAotLS0gYS90b29scy9wb3dlci9hY3BpL2NvbW1vbi9nZXRvcHQuYworKysgYi90b29scy9wb3dlci9hY3BpL2NvbW1vbi9nZXRvcHQuYwpAQCAtNSw3ICs1LDcgQEAKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogLyoKL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