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T19EQVRBX0RJUl9ISUdIKSAmPQorCQl+RFMxNjIwX1RMT1c7CisJKih2dV9sb25nICopIChTTTUwMV9NTUlPX0JBU0UgKyBTTTUwMV9HUElPX0RBVEFfRElSX0hJR0gpIHw9CisJCShQV1JfT0ZGIHwgQlVaWkVSIHwgRlBfREFUQV9UUkkpOwogCi0gICAgaW5pdF9kb25lID0gMTsKKwlpbml0X2RvbmUgPSAxOwogLyogIGRwcmludGYoInNtNTAxX2dwaW9faW5pdDogZG9uZS5cbiIpOyAqLwotICAgIHJldHVybiAwOworCXJldHVybiAwOwogfQogCiAKQEAgLTE2MywzNDcgKzE3MywzNTggQEAKICAqIHJlYWQgYW5kIHByaW50cyB0aGUgZGlwIHN3aXRjaAogICogYW5kL29yIGV4dGVybmFsIGNvbmZpZyBpbnB1dHMgKDRiaXRzKSAwLi4uMHgwRgogICovCi1pbnQgY21kX2RpcCAoY21kX3RibF90ICpjbWR0cCwgaW50IGZsYWcsIGludCBhcmdjLCBjaGFyICphcmd2W10pCitpbnQgY21kX2RpcCAoY21kX3RibF90ICogY21kdHAsIGludCBmbGFnLCBpbnQgYXJnYywgY2hhciAqYXJndltdKQogewotICAgIHZ1X2xvbmcgcmMgPSAwOworCXZ1X2xvbmcgcmMgPSAwOwogCi0gICAgc201MDFfZ3Bpb19pbml0KCk7CisJc201MDFfZ3Bpb19pbml0ICgpOwogCi0gICAgLyogcmVhZCBkaXAgc3dpdGNoICovCi0gICAgcmMgPSAqKHZ1X2xvbmcgKikgKFNNNTAxX01NSU9fQkFTRSArIFNNNTAxX0dQSU9fREFUQV9MT1cpOwotICAgIHJjID0gfnJjOwotICAgIHJjICY9IERJUDsKLSAgICByYyA9IChpbnQpKHJjID4+IDI0KTsKKwkvKiByZWFkIGRpcCBzd2l0Y2ggKi8KKwlyYyA9ICoodnVfbG9uZyAqKSAoU001MDFfTU1JT19CQVNFICsgU001MDFfR1BJT19EQVRBX0xPVyk7CisJcmMgPSB+cmM7CisJcmMgJj0gRElQO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AQAogLyoKKyAqIChDKSBDb3B5cmlnaHQgMjAwNgorICogU3RlZmFuIFJvZXNlLCBERU5YIFNvZnR3YXJlIEVuZ2luZWVyaW5nLCBzckBkZW54LmRlLgorICoKICAqIChDKSBDb3B5cmlnaHQgMjAwMgogICogS3lsZSBIYXJyaXMsIE5leHVzIFRlY2hub2xvZ2llcywgSW5jLiBraGFycmlzQG5leHVzLXRlY2gubmV0CiAgKgpAQCAtMjUsMjQgKzI4LDIxIEBACiAgKiBNQSAwMjExMS0xMzA3IFVTQQogICovCiAKLSNpbmNsdWRlIDxhc20vYXJjaC9peHA0MjUuaD4KICNpbmNsdWRlIDxjb21tb24uaD4KKyNpbmNsdWRlIDxjb21tYW5kLmg+CisjaW5jbHVkZSA8bWFsbG9jLmg+CisjaW5jbHVkZSA8YXNtL2FyY2gvaXhwNDI1Lmg+CiAKIERFQ0xBUkVfR0xPQkFMX0RBVEFfUFRSOwogCiAvKgogICogTWlzY2VsYW5lb3VzIHBsYXRmb3JtIGRlcGVuZGVudCBpbml0aWFsaXNhdGlvbnMKICAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQogaW50IGJvYXJkX3Bvc3RfaW5pdCAodm9pZCkKIHsKIAlyZXR1cm4gKDApOwogfQogCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQogaW50IGJvYXJkX2luaXQgKHZvaWQpCiB7CiAJLyogYXJjaCBudW1iZXIgb2YgSVhEUCAqLwpAQCAtNTEsMTAgKzUxLDU4IEBACiAJLyogYWRyZXNzIG9mIGJvb3QgcGFyYW1ldGVycyAqLwogCWdkLT5iZC0+YmlfYm9vdF9wYXJhbXMgPSAweDAwMDAwMTAwOwogCisjaWZkZWYgQ09ORklHX0lYRFBHNDI1CisJLyogYXJjaCBudW1iZXIgb2YgSVhEUCAqLworCWdkLT5iZC0+YmlfYXJjaF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i5vCQkoLnRleHQpCisKKyAgICAuID0gREVGSU5FRChlbnZfb2Zmc2V0KSA/IGVudl9vZmZzZXQgOiAuOworICAgIGNvbW1vbi9lbnZpcm9ubWVudC5vCSgucHBjZW52KQorCiAgICAgKigudGV4dCkKICAgICAqKC5maXh1cCkKICAgICAqKC5nb3QxKQotICAgIC4gPSBBTElHTigxNik7CisgIH0KKyAgX2V0ZXh0ID0gLjsKKyAgUFJPVklERSAoZXRleHQgPSAuKTsKKyAgLnJvZGF0YSAgICA6CisgIHsKICAgICAqKC5yb2RhdGEpCiAgICAgKigucm9kYXRhMSkKLSAgICAqKC5yb2RhdGEuc3RyMS40KQotICAgICooLmVoX2ZyYW1lKQogICB9CiAgIC5maW5pICAgICAgOiB7ICooLmZpbmkpICAgIH0gPTAKICAgLmN0b3JzICAgICA6IHsgKiguY3RvcnMpICAgfQogICAuZHRvcnMgICAgIDogeyAqKC5kdG9ycykgICB9CiAKICAgLyogUmVhZC13cml0ZSBzZWN0aW9uLCBtZXJnZWQgaW50byBkYXRhIHNlZ21lbnQ6ICovCi0gIC4gPSAoLiArIDB4MEZGRikgJiAweEZGRkZGMDAwOworICAuID0gKC4gKyAweDAwRkYpICYgMHhGRkZGRkYwMDsKICAgX2Vyb3RleHQgPSAuOwogICBQUk9WSURFIChlcm90ZXh0ID0gLik7CisKICAgLnJlbG9jICAgOgogICB7CisgICAgX19nb3Rfc3RhcnQgPSAuOwogICAgICooLmdvdCkKKyAgICBfX2dvdF9lbmQgPSAuOwogICAgIF9HT1QyX1RBQkxFXyA9IC47CiAgICAgKiguZ290MikKICAgICBfRklYVVBfVEFCTEVfID0gLjsKICAgICAqKC5maXh1cCkKICAgfQotICBfX2dvdDJfZW50cmllcyA9IChfRklYVVBfVEFCTEVfIC0gX0dPVDJfVEFCTEVfKSA+PiAyOwotICBfX2ZpeHVwX2VudHJpZXMgPSAoLiAtIF9GSVhVUF9UQUJMRV8pID4+IDI7CisgIF9fZ290Ml9lbnRyaWVzID0gKF9GSVhVUF9UQUJMRV8gLSBfR09UMl9UQUJMRV8pID4+MjsKKyAgX19maXh1cF9lbnRyaWVzID0gKC4gLSBfRklYVVBfVEFCTEVfKT4+MjsKIAogICAuZGF0YSAgICA6CiAgIHsKQEAgLTEwMSwyMiArMTIyLDI0IEBACiAgIF9fZXhfdGFibGUgOiB7ICooX19leF90YWJsZSkgfQogICBfX3N0b3BfX19leF90YWJsZSA9IC47CiAKLSAgLiA9IEFMSUdOKDQwOTYpOworICAuID0gQUxJR04oMjU2KTsKICAgX19pbml0X2JlZ2luID0gLjsKICAgLnRleHQuaW5pdCA6IHsgKigudGV4dC5pbml0KSB9CiAgIC5kYXRhLmluaXQgOiB7ICooLmRhdGEuaW5pdCkgfQotICAuID0gQUxJR04oNDA5Nik7CisgIC4gPSBBTElHTigyNTYpOwogICBfX2luaXRfZW5kID0gLjsKIAogICBfX2Jzc19zdGFydCA9IC47CiAgIC5ic3MgICAgICAgOgogICB7CisgICBfc2JzcyA9IC47CiAgICAqKC5zYnNzKSAqKC5zY29tbW9uKQogICAgKiguZHluYnNzKQogICAgKiguYnNzKQogICAgKihDT01NT04pCisgICAuID0gQUxJR04oNCk7CisgICBfZWJzcyA9IC47CiAgIH0KICAgX2VuZCA9IC4gOwogICBQUk9WSURFIChlbmQgPSAuKTsKIH0KLUVOVFJZKF9zdGFydCkKZGlmZiAtLWdpdCBhL2JvYXJkL201MjcyYzMvZmxhc2guYyBiL2JvYXJkL201MjcyYzMvZmxhc2guYwppbmRleCBmMTU2MzQyLi5lYTBiMWZkIDEwMDY0NAotLS0gYS9ib2FyZC9tNTI3MmMzL2ZsYXNoLmMKKysrIGIvYm9hcmQvbTUyNzJjMy9mbGFzaC5jCkBAIC02NSw2ICs2NSw3IEBACiAJcHJpbnRmICgiXG4iKTsKIAogICAgICAgRG9uZToKKwlyZXR1cm47CiB9CiAKIApkaWZmIC0tZ2l0IGEvYm9hcmQvbTUyODJldmIvZmxhc2guYyBiL2JvYXJkL201MjgyZXZ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doICovCisjZGVmaW5lIFNBX0kJICAgIDB4MDAwMDA0MDAJICAgIC8qIENhY2hpbmcgaW5oaWJpdGVkICovCisjZGVmaW5lIFNBX00JICAgIDB4MDAwMDAyMDAJICAgIC8qIE1lbW9yeSBjb2hlcmVuY2UgKi8KKyNkZWZpbmUgU0FfRwkgICAgMHgwMDAwMDEwMAkgICAgLyogR3VhcmRlZCAqLworI2RlZmluZSBTQV9FCSAgICAweDAwMDAwMDgwCSAgICAvKiBFbmRpYW4gKi8KKworLyogQWNjZXNzIGNvbnRyb2wgKi8KKyNkZWZpbmUgQUNfWAkgICAgMHgwMDAwMDAyNAkgICAgLyogRXhlY3V0ZSAqLworI2RlZmluZSBBQ19XCSAgICAweDAwMDAwMDEyCSAgICAvKiBXcml0ZSAqLworI2RlZmluZSBBQ19SCSAgICAweDAwMDAwMDA5CSAgICAvKiBSZWFkICovCisKKy8qIFNvbWUgaGFuZHkgbWFjcm9zICovCisKKyNkZWZpbmUgRVBOKGUpCQkoKGUpICYgMHhmZmZmZmMwMCkKKyNkZWZpbmUgVExCMChlcG4sc3opCSggKEVQTigoZXBuKSkgfCAoc3opIHwgVExCX1ZBTElEICkgKQorI2RlZmluZSBUTEIxKHJwbixlcnBuKQkoICgocnBuKSYweGZmZmZmYzAwKSB8IChlcnBuKSApCisjZGVmaW5lIFRMQjIoYSkJCSggKGEpJjB4MDAwMDBmYmYgKQorCisjZGVmaW5lIHRsYnRhYl9zdGFydFwKKwltZmxyICAgIHIxICA7XAorCWJsIDBmCSAgICA7CisKKyNkZWZpbmUgdGxidGFiX2VuZFwKKwkubG9uZyAwLCAwLCAwCTsgICBcCiswOgltZmxyICAgIHIwCTsgICBcCisJbXRsciAgICByMQk7ICAgXAorCWJscgkJOworCisjZGVmaW5lIHRsYmVudHJ5KGVwbixzeixycG4sZXJwbixhdHRyKVwKKwkubG9uZyBUTEIwKGVwbixzeiksVExCMShycG4sZXJwbiksVExCMihhdHRyKQorCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogVExCIFRBQkxFCisgKgorICogVGhpcyB0YWJsZSBpcyB1c2VkIGJ5IHRoZSBjcHUgYm9vdCBjb2RlIHRvIHNldHVwIHRoZSBpbml0aWFsIHRsYgorICogZW50cmllcy4gUmF0aGVyIHRoYW4gbWFrZSBicm9hZCBhc3N1bXB0aW9ucyBpbiB0aGUgY3B1IHNvdXJjZSB0cmVlLAorICogdGhpcyB0YWJsZSBsZXRzIGVhY2ggYm9hcmQgc2V0IHRoaW5ncyB1cCBob3dldmVyIHRoZXkgbGlrZS4KKyAqCisgKiAgUG9pbnRlciB0byB0aGUgdGFibGUgaXMgcmV0dXJuZWQgaW4gcjEKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworICAgIC5zZWN0aW9uIC5ib290cGcsImF4IgorICAgIC5nbG9ibCB0bGJ0YWIKKwordGxidGFiOgorICAgIHRsYnRhYl9zdGFydAorCisgICAgLyoKKyAgICAgKiBCT09UX0NTIChGTEFTSCkgbXVzdCBiZSBmaXJzdC4gQmVmb3JlIHJlbG9jYXRpb24gU0FfSSBjYW4gYmUgb2ZmIHRvIHVzZSB0aGUKKyAgICAgKiBzcGVlZCB1cCBib290IHByb2Nlc3MuIEl0IGlzIHBhdGNoZWQgYWZ0ZXIgcmVsb2NhdGlvbiB0byBlbmFibGUgU0FfSQorICAgICAqLworICAgIHRsYmVudHJ5KCBDRkdfQk9PVF9CQVNFX0FERFIsIFNaXzI1Nk0sIENGR19CT09UX0JBU0VfQUREUiwgMCwgQUNfUnxBQ19XfEFDX1h8U0FfRy8qfFNBX0kqLykKKworICAgIC8qIFRMQi1lbnRyeSBmb3IgaW5pdC1yYW0gaW4gZGNhY2hlIChTQV9JIG11c3QgYmUgdHVybmVkIG9mZiEpICovCisgICAgdGxiZW50cnk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dGhlIHN0cmFwIHJlZ2lzdGVyLCBvciBnZW5lcmljIGhvc3QvYWRhcHRlciBhc3N1bXB0aW9ucy4KKyAqCisgKglSYXRoZXIgdGhhbiBoYXJkLWNvZGUgYSBiYWQgYXNzdW1wdGlvbiBpbiB0aGUgZ2VuZXJhbCA0NDAgY29kZSwgdGhlCisgKgk0NDAgcGNpIGNvZGUgcmVxdWlyZXMgdGhlIGJvYXJkIHRvIGRlY2lkZSBhdCBydW50aW1lLgorICoKKyAqCVJldHVybiAwIGZvciBhZGFwdGVyIG1vZGUsIG5vbi16ZXJvIGZvciBob3N0IChtb25hcmNoKSBtb2RlLgorICoKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmIGRlZmluZWQoQ09ORklHX1BDSSkKK2ludCBpc19wY2lfaG9zdChzdHJ1Y3QgcGNpX2NvbnRyb2xsZXIgKmhvc2UpCit7CisJLyogUENTNDQwRVAgaXMgYWx3YXlzIGNvbmZpZ3VyZWQgYXMgaG9zdC4gKi8KKwlyZXR1cm4gKDEpOworfQorI2VuZGlmCQkJCS8qIGRlZmluZWQoQ09ORklHX1BDSSkgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICBod193YXRjaGRvZ19yZXNldAorICoKKyAqCVRoaXMgcm91dGluZSBpcyBjYWxsZWQgdG8gcmVzZXQgKGtlZXAgYWxpdmUpIHRoZSB3YXRjaGRvZyB0aW1lcgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWYgZGVmaW5lZChDT05GSUdfSFdfV0FUQ0hET0cpCit2b2lkIGh3X3dhdGNoZG9nX3Jlc2V0KHZvaWQpCit7CisKK30KKyNlbmRpZgpkaWZmIC0tZ2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mbyAqbXRkKQoreworCXJldHVybiByZWFkYigmKHBkbmIzX25kZmMtPmRhdGEpKTsKK30KKworc3RhdGljIHZvaWQgcGRuYjNfbmFuZF93cml0ZV9idWYoc3RydWN0IG10ZF9pbmZvICptdGQsIGNvbnN0IHVfY2hhciAqYnVmLCBpbnQgbGVuKQoreworCWludCBpOworCisJZm9yIChpID0gMDsgaSA8IGxlbjsgaSsrKSB7CisJCWlmIChod2N0bCAmIDB4MSkKKwkJCXdyaXRlYihidWZbaV0sICYocGRuYjNfbmRmYy0+Y21kKSk7CisJCWVsc2UgaWYgKGh3Y3RsICYgMHgyKQorCQkJd3JpdGViKGJ1ZltpXSwgJihwZG5iM19uZGZjLT5hZGRyKSk7CisJCWVsc2UKKwkJCXdyaXRlYihidWZbaV0sICYocGRuYjNfbmRmYy0+ZGF0YSkpOworCX0KK30KKworc3RhdGljIHZvaWQgcGRuYjNfbmFuZF9yZWFkX2J1ZihzdHJ1Y3QgbXRkX2luZm8gKm10ZCwgdV9jaGFyICpidWYsIGludCBsZW4pCit7CisJaW50IGk7CisKKwlpZiAobGVuICUgNCkgeworCQlmb3IgKGkgPSAwOyBpIDwgbGVuOyBpKyspCisJCQlidWZbaV0gPSByZWFkYigmKHBkbmIzX25kZmMtPmRhdGEpKTsKKwl9IGVsc2UgeworCQl1bG9uZyAqcHRyID0gKHVsb25nICopYnVmOworCQlpbnQgY291bnQgPSBsZW4gPj4gMjsKKworCQlmb3IgKGkgPSAwOyBpIDwgY291bnQ7IGkrKykKKwkJCSpwdHIrKyA9IHJlYWRsKCYocGRuYjNfbmRmYy0+ZGF0YSkpOworCX0KK30KKworc3RhdGljIGludCBwZG5iM19uYW5kX3ZlcmlmeV9idWYoc3RydWN0IG10ZF9pbmZvICptdGQsIGNvbnN0IHVfY2hhciAqYnVmLCBpbnQgbGVuKQoreworCWludCBpOworCisJZm9yIChpID0gMDsgaSA8IGxlbjsgaSsrKQorCQlpZiAoYnVmW2ldICE9IHJlYWRiKCYocGRuY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hpcHMhCVhYWCBGSVhNRSBYWFgJKi8KKworICAgIGNwdS9tY2Y1MngyL3N0YXJ0Lm8JCSgudGV4dCkKKyAgICBsaWJfbTY4ay90cmFwcy5vCQkoLnRleHQpCisgICAgY3B1L21jZjUyeDIvaW50ZXJydXB0cy5vCSgudGV4dCkKKyAgICBjb21tb24vZGxtYWxsb2MubwkJKC50ZXh0KQorICAgIGxpYl9nZW5lcmljL3psaWIubwkJKC50ZXh0KQorCisgICAgLiA9IERFRklORUQoZW52X29mZnNldCkgPyBlbnZfb2Zmc2V0IDogLjsKKyAgICBjb21tb24vZW52aXJvbm1lbnQubwkoLnRleHQpCisKICAgICAqKC50ZXh0KQogICAgICooLmZpeHVwKQogICAgICooLmdvdDEpCi0gICAgLiA9IEFMSUdOKDE2KTsKKyAgfQorICBfZXRleHQgPSAuOworICBQUk9WSURFIChldGV4dCA9IC4pOworICAucm9kYXRhICAgIDoKKyAgewogICAgICooLnJvZGF0YSkKICAgICAqKC5yb2RhdGExKQotICAgICooLnJvZGF0YS5zdHIxLjQpCi0gICAgKiguZWhfZnJhbWUpCiAgIH0KICAgLmZpbmkgICAgICA6IHsgKiguZmluaSkgICAgfSA9MAogICAuY3RvcnMgICAgIDogeyAqKC5jdG9ycykgICB9CiAgIC5kdG9ycyAgICAgOiB7ICooLmR0b3JzKSAgIH0KIAogICAvKiBSZWFkLXdyaXRlIHNlY3Rpb24sIG1lcmdlZCBpbnRvIGRhdGEgc2VnbWVudDogKi8KLSAgLiA9ICguICsgMHgwRkZGKSAmIDB4RkZGRkYwMDA7CisgIC4gPSAoLiArIDB4MDBGRikgJiAweEZGRkZGRjAwOwogICBfZXJvdGV4dCA9IC47CiAgIFBST1ZJREUgKGVyb3RleHQgPSAuKTsKKwogICAucmVsb2MgICA6CiAgIHsKKyAgICBfX2dvdF9zdGFydCA9IC47CiAgICAgKiguZ290KQorICAgIF9fZ290X2VuZCA9IC47CiAgICAgX0dPVDJfVEFCTEVfID0gLjsKICAgICAqKC5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VmIENGR19USU1JTkdfVElHSFQKKyNpZm5kZWYgQ0ZHX1RJTUlOR19USUdIVAorCXRDSCA9IE1JTigoKHVuc2lnbmVkIGxvbmcpIChOQU5EX1RJTUlOR190Q0ggKiBERkNfQ0xLX1BFUl9VUykgKyAxKSwKKwkJICBERkNfTUFYX3RDSCk7CisJdENTID0gTUlOKCgodW5zaWduZWQgbG9uZykgKE5BTkRfVElNSU5HX3RDUyAqIERGQ19DTEtfUEVSX1VTKSArIDEpLAorCQkgIERGQ19NQVhfdENTKTsKKwl0V0ggPSBNSU4oKCh1bnNpZ25lZCBsb25nKSAoTkFORF9USU1JTkdfdFdIICogREZDX0NMS19QRVJfVVMpICsgMSksCisJCSAgREZDX01BWF90V0gpOworCXRXUCA9IE1JTigoKHVuc2lnbmVkIGxvbmcpIChOQU5EX1RJTUlOR190V1AgKiBERkNfQ0xLX1BFUl9VUykgKyAxKSwKKwkJICBERkNfTUFYX3RXUCk7CisJdFJIID0gTUlOKCgodW5zaWduZWQgbG9uZykgKE5BTkRfVElNSU5HX3RSSCAqIERGQ19DTEtfUEVSX1VTKSArIDEpLAorCQkgIERGQ19NQVhfdFJIKTsKKwl0UlAgPSBNSU4oKCh1bnNpZ25lZCBsb25nKSAoTkFORF9USU1JTkdfdFJQICogREZDX0NMS19QRVJfVVMpICsgMSksCisJCSAgREZDX01BWF90UlApOworCXRSID0gTUlOKCgodW5zaWduZWQgbG9uZykgKE5BTkRfVElNSU5HX3RSICogREZDX0NMS19QRVJfVVMpICsgMSksCisJCSBERkNfTUFYX3RSKTsKKwl0V0hSID0gTUlOKCgodW5zaWduZWQgbG9uZykgKE5BTkRfVElNSU5HX3RXSFIgKiBERkNfQ0xLX1BFUl9VUykgKyAxKSwKKwkJICAgREZDX01BWF90V0hSKTsKKwl0QVIgPSBNSU4oKCh1bnNpZ25lZCBsb25nKSAoTkFORF9USU1JTkdfdEFSICogREZDX0NMS19QRVJfVVMpICsgMSksCisJCSAgREZDX01BWF90QVIpOworI2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WNjUG9ydElkIHBvcnRJZCkKK3sKKworICBJeEV0aEFjY1N0YXR1cyByZXQ9SVhfRVRIX0FDQ19TVUNDRVNTOworCisgICBpZiAoICEgSVhfRVRIX0FDQ19JU19TRVJWSUNFX0lOSVRJQUxJWkVEKCkgKQorICAgeworICAgCXJldHVybihJWF9FVEhfQUNDX0ZBSUwpOworICAgfQorCisgICAvKgorICAgICogQ2hlY2sgZm9yIHZhbGlkIHBvcnQKKyAgICAqLworCisgICBpZiAoICEgSVhfRVRIX0FDQ19JU19QT1JUX1ZBTElEKHBvcnRJZCkgKQorICAgeworICAgICAgIHJldHVybiAoSVhfRVRIX0FDQ19JTlZBTElEX1BPUlQpOworICAgfQorCisgICBpZiAoSVhfRVRIX0FDQ19TVUNDRVNTICE9IGl4RXRoQWNjU2luZ2xlRXRoTnBlQ2hlY2socG9ydElkKSkKKyAgIHsKKyAgICAgICBJWF9FVEhfQUNDX1dBUk5JTkdfTE9HKCJFdGhBY2M6IFVuYXZhaWxhYmxlIEV0aCAlZDogQ2Fubm90IGluaXRpYWxpemUgRXRoIHBvcnQuXG4iLChJTlQzMikgcG9ydElkLDAsMCwwLDAsMCk7CisgICAgICAgcmV0dXJuIElYX0VUSF9BQ0NfU1VDQ0VTUyA7CisgICB9CisKKyAgIGlmICggSVhfRVRIX0lTX1BPUlRfSU5JVElBTElaRUQocG9ydElkKSApCisgICB7CisgICAJLyogQWxyZWFkeSBpbml0aWFsaXplZCAqLworICAgCXJldHVybihJWF9FVEhfQUNDX0ZBSUwpOworICAgfQorCisgICBpZihpeEV0aEFjY01hY0luaXQocG9ydElkKSE9SVhfRVRIX0FDQ19TVUNDRVNTKQorICAgeworICAgICAgIHJldHVybiBJWF9FVEhfQUNDX0ZBSUw7CisgICB9CisKKyAgIC8qCisgICAgICogU2V0IHRoZSBwb3J0IGluaXQgZmxhZy4KKyAgICAgKi8KKworICAgIGl4RXRoQWNjUG9ydERhdGFbcG9ydElkXS5wb3J0SW5pdGlhbGl6ZWQ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K307CisKKy8qKgorICoKKyAqIEBicmllZiBEYXRhIHN0cnVjdHVyZSB1c2VkIHRvIHJlZ2lzdGVyICYgaW5pdGlhbGl6ZSB0aGUgUXVldWVzCisgKgorICogVGhlIHN0cnVjdHVyZSB3aWxsIGJlIGZpbGxlZCBhdCBydW4gdGltZSBkZXBlbmRpbmcgb24gdGhlIE5QRQorICogaW1hZ2UgYWxyZWFkeSBsb2FkZWQgYW5kIHRoZSBRb1MgY29uZmlndXJlZCBpbiBldGhEQi4KKyAqCisgKi8KK0lYX0VUSF9BQ0NfUFJJVkFURQorSXhFdGhBY2NRcmVnSW5mbyBpeEV0aEFjY1FtZ3JSeFF1ZXVlc0luZm9bSVhfRVRIQUNDX01BWF9SWF9RVUVVRVMrMV09Cit7CisgIHsgIC8qIFBsYWNlSG9sZGVyIGZvciByeCBxdWV1ZXMKKyAgICAgICogZGVwZW5kaW5nIG9uIHRoZSBRb1MgY29uZmlndXJlZAorICAgICAgKi8KKyAgICAgKEl4UU1nclFJZCkwLAorICAgICAoY2hhciAqKSBOVUxMLAorICAgICAoSXhRTWdyQ2FsbGJhY2spIE5VTEwsCisgICAgIChJeFFNZ3JDYWxsYmFja0lkKSAwLAorICAgICAwLAorICAgICAwLAorICAgICAwLAorICAgICAwLAorICAgICAwLAorICAgICAwCisgIH0sCisKKyAgeyAgLyogUGxhY2VIb2xkZXIgZm9yIHJ4IHF1ZXVlcworICAgICAgKiBkZXBlbmRpbmcgb24gdGhlIFFvUyBjb25maWd1cmVkCisgICAgICAqLworICAgICAoSXhRTWdyUUlkKTAsCisgICAgIChjaGFyICopIE5VTEwsCisgICAgIChJeFFNZ3JDYWxsYmFjaykgTlVMTCwKKyAgICAgKEl4UU1nckNhbGxiYWNrSWQpIDAsCisgICAgIDAsCisgICAgIDAsCisgICAgIDAsCisgICAgIDAsCisgICAgIDAsCisgICAgIDAKKyAgfSwKKworICB7ICAvKiBQbGFjZUhvbGRlciBmb3IgcnggcXVldWVzCisgICAgICAqIGRlcGVuZGluZyBvbiB0aGUgUW9TIGNvbmZpZ3VyZWQKKyAgICAgICovCisgICAgIChJeFFNZ3JRSWQpMCwKKyAgICAgKGNoYXIgKikgTlVMTCwKKyAgICAgKEl4UU1nckNhbGxiYWNrKSBOVUxMLAorICAgICAoSXhRTWdyQ2FsbGJhY2tJZCkgMCwKKyAgICAgMCwKKyAgICAgMCwKKyAgICAgMCwKKyAgICAgMCwKKyAgICAgMCwKKyAgICAgMAorICB9LAorCisgIHsgIC8qIFBsYWNlSG9sZGVyIGZvciByeCBxdWV1ZXMKKyAgICAgICogZGVwZW5kaW5nIG9uIHRoZSBRb1MgY29uZmlndXJlZAorICAgICAgKi8KKyAgICAgKEl4UU1nclFJZCkwLAorICAgICAoY2hhciAqKSBOVUxMLAorICAgICAoSXhRTWdyQ2FsbGJhY2spIE5VTEwsCisgICAgIChJeFFNZ3JDYWxsYmFja0lkKSAwLAorICAgICAwLAorICAgICAwLAorICAgICAwLAorICAgICAwLAorICAgICAwLAorICAgICAwCisgIH0sCisKKyAgeyAgLyogUGxhY2VIb2xkZXIgZm9yIHJ4IHF1ZXVlcworICAgICAgKiBkZXBlbmRpbmcgb24gdGhlIFFvUyBjb25maWd1cmVkCisgICAgICAqLworICAgICAoSXhRTWdyUUlkKTAsCisgICAgIChjaGFyICopIE5VTEwsCisgICAgIChJeFFNZ3JDYWxsYmFjaykgTlVMTCwKKyAgICAgKEl4UU1nckNhbGxiYWNrSWQpIDAsCisgICAgIDAsCisgICAgIDAsCisgICAgIDAsCisgICAgIDAsCisgICAgIDAsCisgICAgIDAKKyAgfSwKKworICB7ICAvKiBQbGFjZUhvbGRlciBmb3IgcnggcXVldWVzCisgICAgICAqIGRlcGVuZGluZyBvbiB0aGUgUW9TIGNvbmZpZ3VyZWQKKyAgICAgICovCisgICAgICAoSXhRTWdyUUlkKTAsCisgICAgIChjaGFyICopIE5VTEwsCisgICAgIChJeFFNZ3JDYWxsYmFjaykgTlVMTCwKKyAgICAgKEl4UU1nckNhbGxiYWNrSWQpIDAsCisgICAgIDAsCisgICAgIDAsCisgICAgIDAsCisgICAgIDAsCisgICAgIDAsCisgICAgIDAKKyAgfSwKKworICB7ICAvKiBQbGFjZUhvbGRlciBmb3IgcnggcXVldWVzCisgICAgICAqIGRlcGVuZGluZyBvbiB0aGUgUW9TIGNvbmZpZ3VyZWQKKyAgICAgICovCisgICAgIChJeFFNZ3JRSWQpMCwKKyAgICAgKGNoYXIgKikgTlVMTCwKKyAgICAgKEl4UU1nckNhbGxiYWNrKSBOVUxMLAorICAgICAoSXhRTWdyQ2FsbGJhY2tJZCkgMCwKKyAgICAgMCwKKyAgICAgMCwKKyAgICAgMCwKKyAgICAgMCwKKyAgICAgMCwKKyAgICAgMAorICB9LAorCisgIHsgIC8qIFBsYWNlSG9sZGVyIGZvciByeCBxdWV1ZXMKKyAgICAgICogZGVwZW5kaW5nIG9uIHRoZSBRb1MgY29uZmlndXJlZAorICAgICAgKi8KKyAgICAgKEl4UU1nclFJZCkwLAorICAgICAoY2hhciAqKSBOVUxMLAorICAgICAoSXhRTWdyQ2FsbGJhY2spIE5VTEwsCisgICAgIChJeFFNZ3JDYWxsYmFja0lkKSAwLAorICAgICAwLAorICAgICAwLAorICAgICAwLAorICAgICAwLAorICAgICAwLAorICAgICAwCisgIH0sCisKKyAgeyAgLyogTnVsbCBUZXJtaW5hdGlvbiBlbnRyeQorICAgICAgKi8KKyAgICAgKEl4UU1nclFJZCkwLAorICAgICAoY2hhciAqKSBOVUxMLAorICAgICAoSXhRTWdyQ2FsbGJhY2spIE5VTEwsCisgICAgIChJeFFNZ3JDYWxsYmFja0lkKSAwLAorICAgICAwLAorICAgICAwLAorICAgICAwLAorICAgICAwLAorICAgICAwLAorICAgICAwCisgIH0KKworfTsKKworLyogZm9yd2FyZCBkZWNsYXJhdGlvbnMgKi8KK0lYX0VUSF9BQ0NfUFJJVkFURSBJeEV0aEFjY1N0YXR1cworaXhFdGhBY2NRTWdyUXVldWVTZXR1cChJeEV0a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JrIGxldmVsIGZvciBuZWFybHkgZnVsbCBjb25kaXRpb24uCisJICogKHRoZSBoaWdoIHdhdGVybWFyayBsZXZlbCBhcmUgYSBwb3dlciBvZiAyCisJICogc3RhcnRpbmcgZnJvbSB0aGUgdG9wIG9mIHRoZSBxdWV1ZSkKKwkgKgorCSAqIE51bWJlciBvZiAgICAgd2F0ZXJtYXJrCisgICAgICAgICAqICAgcG9ydHMgICAgICAgIGxldmVsCisgICAgICAgICAqICAgIDEgICAgICAgICAgICAgMAorCSAqICAgIDIgICAgICAgICAgICAgMQorCSAqICAgIDMgICAgICAgICAgICAgMgorCSAqICAgIDQgICAgICAgICAgICAgNAorCSAqICAgIDUgICAgICAgICAgICAgNAorCSAqICAgIDYgICAgICAgICAgICAgOAorCSAqICAgIG4gICAgICAgICAgYXBwcm94LiAyKipjZWlsKGxvZzIobikpCisJICovCisJaWYgKHJ4UXVldWVzW3J4UXVldWVdLm5wZUNvdW50ID09IDEpCisJeworCSAgICBxSW5mb0Rlcy0+QWxtb3N0RnVsbFRocmVzaG9sZCA9IElYX1FNR1JfUV9XTV9MRVZFTDA7CisJfQorCWVsc2UgaWYgKHJ4UXVldWVzW3J4UXVldWVdLm5wZUNvdW50ID09IDIpCisJeworCSAgICBxSW5mb0Rlcy0+QWxtb3N0RnVsbFRocmVzaG9sZCA9IElYX1FNR1JfUV9XTV9MRVZFTDE7CisJfQorCWVsc2UgaWYgKHJ4UXVldWVzW3J4UXVldWVdLm5wZUNvdW50ID09IDMpCisJeworCSAgICBxSW5mb0Rlcy0+QWxtb3N0RnVsbFRocmVzaG9sZCA9IElYX1FNR1JfUV9XTV9MRVZFTDI7CisJfQorCWVsc2UKKwl7CisJICAgIC8qIHJlYWNoIHRoZSBtYXhpbXVtIG51bWJlciBmb3IgQ1NSIDIuMCAqLworICAgICAgICAgICAgSVhfRVRIX0FDQ19XQVJOSU5HX0xPRygiaXhFdGhBY2NRTWdyUXVldWVzQ29uZmlnOiBtYXhpbXVtIG51bWJl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Ugb2YgY29wcm9jZXNzb3JzICovCisgICAgaWYgKChJWF9GRUFUVVJFX0NUUkxfU0lMSUNPTl9UWVBFX0EwICE9CisgICAgICAgIChpeEZlYXR1cmVDdHJsUHJvZHVjdElkUmVhZCgpICYgSVhfRkVBVFVSRV9DVFJMX1NJTElDT05fU1RFUFBJTkdfTUFTSykpCisgICAgICAgIHx8IChJWF9GRUFUVVJFX0NUUkxfREVWSUNFX1RZUEVfSVhQNDJYICE9IGl4RmVhdHVyZUN0cmxEZXZpY2VSZWFkICgpKSkKKyAgICAgIHsKKyAgICAgICAgICAgIGlmICgoSVhfRVRIX1BPUlRfMSA9PSBwb3J0SWQpICYmCisgICAgICAgICAgICAgICAgKGl4RmVhdHVyZUN0cmxDb21wb25lbnRDaGVjayhJWF9GRUFUVVJFQ1RSTF9FVEgwKSA9PQorICAgICAgICAgICAgICAgICBJWF9GRUFUVVJFX0NUUkxfQ09NUE9ORU5UX0VOQUJMRUQpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHJldHVybiBJWF9FVEhfQUNDX1NVQ0NFU1M7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmICgoSVhfRVRIX1BPUlRfMiA9PSBwb3J0SWQpICYmCisgICAgICAgICAgICAgICAgKGl4RmVhdHVyZUN0cmxDb21wb25lbnRDaGVjayhJWF9GRUFUVVJFQ1RSTF9FVEgxKSA9PQorICAgICAgICAgICAgICAgICBJWF9GRUFUVVJFX0NUUkxfQ09NUE9ORU5UX0VOQUJMRUQpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHJldHVybiBJWF9FVEhfQUNDX1NVQ0NFU1M7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmICgoSVhfRVRIX1BPUlRfMyA9PSBwb3J0SWQpICYmCisgICAgICAgICAgICAgICAgKGl4RmVhdHVyZUN0cmxDb21wb25lbnRDaGVjayhJWF9GRUFUVVJFQ1RSTF9OUEVBX0VUSCkgPT0KKyAgICAgIC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UHRyKSk7CisKKwlpZiAocmVzdWx0ICE9IElYX0VUSF9EQl9TVUNDRVNTICYmIHJlc3VsdCAhPSBJWF9FVEhfREJfRkVBVFVSRV9VTkFWQUlMQUJMRSkKKwl7CisgICAgICAgICAgICBpZiAoKGl4RXRoQWNjTWFjU3RhdGVbcG9ydElkXS5wb3J0RGlzYWJsZVN0YXRlID09IEFDVElWRSkgJiYgKHJlc3VsdCAhPSBJWF9FVEhfREJfQlVTWSkpCisgICAgICAgICAgICB7CisJICAgICAgICBSWF9TVEFUU19JTkMocG9ydElkLCByeFVuZXhwZWN0ZWRFcnJvcik7CisgICAgICAgICAgICAgICAgSVhfRVRIX0FDQ19GQVRBTF9MT0coIml4RXRoUnhGcmFtZVByb2Nlc3M6IEZhaWxlZCB0byBhZGQgc291cmNlIE1BQyBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0byB0aGUgTGVhcm5pbmcvRmlsdGVyaW5nIGRhdGFiYXNlXG4iLCAwLCAwLCAwLCAwLCAwLCAwKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiB3ZSBleHBlY3QgdGhpcyB0byBmYWlsIGR1cmluZyBQb3J0RGlzYWJsZSwgYXMgRXRoREIgaXMgZGlzYWJsZWQgZm9yCisgICAgICAgICAgICAgICAgICogdGhhdCBwb3J0IGFuZCB3aWxsIHJlZnVzZSB0byBsZWFybiBuZXcgYWRkcmVzc2VzCisJCSAqLworICAgICAgICAgICAgfQorCX0KKwllbHNlCisJeworCSAgICBSWF9TVEFUU19JTkMocG9ydElkLCByeFVubGVhcm5lZE1hY0FkZHJlc3MpOworCX0KKyAgICB9CisjZW5kaWYKKworICAgIC8qIGNoZWNrIGlmIHRoaXMgZnJhbWUgc2hvdWxkIGhhdmUgYmVlbiBmaWx0ZXJlZAorICAgICAqIGJ5IHRoZSBOUEUgYW5kIHRha2UgdGhlIGFwcHJvcHJ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01MRU4obWJ1ZlB0cikgPSBJWF9PU0FMX01CVUZfUEtUX0xFTihtYnVmUHRyKSA9CisgICAgICAgICAgICAgICAgSVhfRVRITlBFX0FDQ19SWEZSRUVfQlVGRkVSX0xFTkdUSF9NSU47CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICAvKiByZXN0b3JlIG9yaWdpbmFsIGxlbmd0aCAqLworICAgICAgICAgICAgSVhfT1NBTF9NQlVGX01MRU4obWJ1ZlB0cikgPSBJWF9PU0FMX01CVUZfUEtUX0xFTihtYnVmUHRyKSA9CisgICAgICAgICAgICAgICAgKCBJWF9PU0FMX01CVUZfQUxMT0NBVEVEX0JVRkZfTEVOKG1idWZQdHIpIC0KKyAgICAgICAgICAgICAgICAgKElYX09TQUxfTUJVRl9NREFUQShtYnVmUHRyKSAtIChVSU5UOCAqKUlYX09TQUxfTUJVRl9BTExPQ0FURURfQlVGRl9EQVRBKG1idWZQdHIpKSApOworICAgICAgICB9CisKKyAgICAgICAgLyogcmVwbGVuaXNoIGZyb20gaGVyZSAqLworICAgICAgICBpZiAoaXhFdGhBY2NQb3J0UnhGcmVlUmVwbGVuaXNoKHBvcnRJZCwgbWJ1ZlB0cikgIT0gSVhfRVRIX0FDQ19TVUNDRVNTKQorICAgICAgICB7CisgICAgICAgICAgICAgICAgSVhfRVRIX0FDQ19GQVRBTF9MT0coIml4RXRoUnhGcmFtZVByb2Nlc3M6IEZhaWxlZCB0byByZXBsZW5pc2ggd2l0aCBmaWx0ZXJlZCBmcmFtZVwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb24gcG9ydCAlZFxuIiwgcG9ydElkLCAwLCAwLCAwLCAwLCAwKTsKKyAgICAgICAgfQorCisgICAgICAgIFJYX1NUQVRTX0lOQyhwb3J0SWQsIHJ4RmlsdGVyZWQpOworCisgICAgICAgIC8qIGluZGljYXRlIHRoYXQgZnJhbWUgc2hvdWxkIG5vdCBiZSBzdWJq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kIGluIHRoaXMgbG9hZFxuIik7CisjZW5kaWYKKworICAgIC8qIHByaW50IHNuYXBzaG90ICovCisgICAgZm9yKHBvcnRJZD0wOyBwb3J0SWQgPCBJWF9FVEhfQUNDX05VTUJFUl9PRl9QT1JUUzsgcG9ydElkKyspCisgICAgeworICAgICAgICAvKiBJZiBub3QgSVhQNDJYIEEwIHN0ZXBwaW5nLCBwcm9jZWVkIHRvIGNoZWNrIGZvciBleGlzdGVuY2Ugb2YgY29wcm9jZXNzb3JzICovCisgICAgICAgIGlmICgoSVhfRkVBVFVSRV9DVFJMX1NJTElDT05fVFlQRV9BMCAhPQorCSAgICAgKGl4RmVhdHVyZUN0cmxQcm9kdWN0SWRSZWFkKCkgJiBJWF9GRUFUVVJFX0NUUkxfU0lMSUNPTl9TVEVQUElOR19NQVNLKSkKKwkgICAgfHwgKElYX0ZFQVRVUkVfQ1RSTF9ERVZJQ0VfVFlQRV9JWFA0MlggIT0gaXhGZWF0dXJlQ3RybERldmljZVJlYWQgKCkpKQorICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKChJWF9FVEhfUE9SVF8xID09IHBvcnRJZCkgJiYKKyAgICAgICAgICAgICAgICAgICAgKGl4RmVhdHVyZUN0cmxDb21wb25lbnRDaGVjayhJWF9GRUFUVVJFQ1RSTF9FVEgwKSA9PQorICAgICAgICAgICAgICAgICAgICAgSVhfRkVBVFVSRV9DVFJMX0NPTVBPTkVOVF9ESVNBQkxFRCkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlIDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKChJWF9FVEhfUE9SVF8yID09IHBvcnRJZCkgJiYKKyAgICAgICAgICAgICAgICAgICAgKGl4RmVhdHVyZUN0cmxDb21wb25lbnRDaGVjayhJWF9GRUFUVVJFQ1RSTF9FVEgxKSA9PQorICAgICAgICAgICAgICAgICAgICAgSVhfRkVBVFVSRV9DVFJMX0NPTVBPTkVOVF9ESVNBQkxFRCkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBjb250aW51ZSA7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICgoSVhfRVRIX1BPUlRfMyA9PSBwb3J0SWQpICYmCisgICAgICAgICAgICAgICAgICAgIChpeEZlYXR1cmVDdHJsQ29tcG9uZW50Q2hlY2soSVhfRkVBVFVSRUNUUkxfTlBFQV9FVEgpID09CisgICAgICAgICAgICAgICAgICAgICBJWF9GRUFUVVJFX0NUUkxfQ09NUE9ORU5UX0RJU0FCTEVEKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlIDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgIH0KKworCXByaW50ZigiUE9SVCAldSAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuIiwKKwkgICAgICAgcG9ydElkKTsKKyNpZm5kZWYgTkRFQlVHCisJcHJpbnRmKCJUeCBEb25lIEZyYW1lcyAgICAgICAgICAgICAgICA6ICV1XG4iLAorCSAgICAgICB0eFtwb3J0SWRdLnR4RG9uZUNsaWVudENhbGxiYWNrICsKKwkgICAgICAgdHhbcG9ydElkXS50eERvbmVTd1FEdXJpbmdEaXNhYmxlICsKKwkgICAgICAgdHhbcG9ydElkXS50eERvbmVEdXJpbmdEaXNhYmxlKTsKKwlwcmludGYoIlR4IEZyYW1lcyAgICAgICAgICAgICAgICAgICAgIDogJXVcbiIsCisJICAgICAgIHR4W3BvcnRJZF0udHhRT0sgKyB0eFtwb3J0SWRdLnR4UURlbGF5ZWQpOworCXByaW50ZigiVHggSC9XIFEgQWRkZWQgT0sgICAgICAgICAgICAgOiAldVxuIiwKKwkgICAgICAgdHhbcG9ydElkXS50eFFPSyk7CisJcHJpbnRmKCJUeCBIL1cgUSBEZWxheWVkICAgICAgICAgICAgICA6ICV1XG4iLAorCSAgICAgICB0eFtwb3J0SWRdLnR4UURlbGF5ZWQpOworCXByaW50ZigiVHggRnJvbSBTL1cgUSBBZGRlZCBPSyAgICAgICAgOiAldVxuIiwKKwkgICAgICAgdHhbcG9ydElkXS50eEZyb21Td1FPSyk7CisJcHJpbnRmKCJUeCBGcm9tIFMvVyBRIERlbGF5ZWQgICAgICAgICA6ICV1XG4iLAorCSAgICAgICB0eFtwb3J0SWRdLnR4RnJvbVN3UURlbGF5ZWQpOworCXByaW50ZigiVHggT3ZlcmZsb3cgICAgICAgICAgICAgICAgICAgOiAldVxuIiwKKwkgICAgICAgdHhbcG9ydElkXS50eE92ZXJmbG93KTsKKwlwcmludGYoIlR4IE11dHVhbCBMb2NrICAgICAgICAgICAgICAgIDogJXVcbiIsCisJICAgICAgIHR4W3BvcnRJZF0udHhMb2NrKTsKKwlwcmludGYoIlR4IExhdGUgTnRmIEVuYWJsZWQgICAgICAgICAgIDogJXVcbiIsCisJICAgICAgIHR4W3BvcnRJZF0udHhMYXRlTm90aWZpY2F0aW9uRW5hYmxlZCk7CisJcHJpbnRmKCJUeCBMb3cgVGhyZXNoIENCICAgICAgICAgICAgICA6ICV1XG4iLAorCSAgICAgICB0eFtwb3J0SWRdLnR4TG93VGhyZXNoQ2FsbGJhY2spOworCXByaW50ZigiVHggRG9uZSBmcm9tIEgvVyBRIChEaXNhYmxlKSAgOiAldVxuIiwKKwkgICAgICAgdHhbcG9ydElkXS50eERvbmVEdXJpbmdEaXNhYmxlKTsKKwlwcmludGYoIlR4IERvbmUgZnJvbSBTL1cgUSAoRGlzYWJsZSkgIDogJXVcbiIsCisJICAgICAgIHR4W3BvcnRJZF0udHhEb25lU3dRRHVyaW5nRGlzYWJsZSk7CisJZm9yIChwcmlvcml0eSA9IElYX0VUSF9BQ0NfVFhfUFJJT1JJVFlfMDsKKwkgICAgIHByaW9yaXR5IDw9IElYX0VUSF9BQ0NfVFhfUFJJT1JJVFlfNzsKKwkgICAgIHByaW9yaXR5KyspCisJeworCSAgICBpZiAodHhbcG9ydElkX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nggRnJlZSBGcm9tIFMvVyBRIERlbGF5ZWQgICAgOiAldVxuIiwKKwkgICAgICAgcnhbcG9ydElkXS5yeEZyZWVSZXBGcm9tU3dRRGVsYXllZCk7CisJcHJpbnRmKCJSeCBGcmVlIE92ZXJmbG93ICAgICAgICAgICAgICA6ICV1XG4iLAorCSAgICAgICByeFtwb3J0SWRdLnJ4RnJlZU92ZXJmbG93KTsKKwlwcmludGYoIlJ4IEZyZWUgTXV0dWFsIExvY2sgICAgICAgICAgIDogJXVcbiIsCisJICAgICAgIHJ4W3BvcnRJZF0ucnhGcmVlTG9jayk7CisJcHJpbnRmKCJSeCBGcmVlIExhdGUgTnRmIEVuYWJsZWQgICAgICA6ICV1XG4iLAorCSAgICAgICByeFtwb3J0SWRdLnJ4RnJlZUxhdGVOb3RpZmljYXRpb25FbmFibGVkKTsKKwlwcmludGYoIlJ4IEZyZWUgTG93IENCICAgICAgICAgICAgICAgIDogJXVcbiIsCisJICAgICAgIHJ4W3BvcnRJZF0ucnhGcmVlTG93Q2FsbGJhY2spOworCXByaW50ZigiUnggRnJvbSBIL1cgUSAoRGlzYWJsZSkgICAgICAgOiAldVxuIiwKKwkgICAgICAgcnhbcG9ydElkXS5yeER1cmluZ0Rpc2FibGUpOworCXByaW50ZigiUnggRnJvbSBTL1cgUSAoRGlzYWJsZSkgICAgICAgOiAldVxuIiwKKwkgICAgICAgcnhbcG9ydElkXS5yeFN3UUR1cmluZ0Rpc2FibGUpOworCXByaW50ZigiUnggdW5sZWFybmVkIE1hYyBBZGRyZXNzICAgICAgOiAldVxuIiwKKwkgICAgICAgcnhbcG9ydElkXS5yeFVubGVhcm5lZE1hY0FkZHJlc3MpOworICAgICAgICBwcmludGYoIlJ4IEZpbHRlcmVkIChSeCA9PiBSeEZyZWUpICAgIDogJXVcbiIsCisgICAgICAgICAgICByeFtwb3J0SWRdLnJ4RmlsdGVyZWQpOworCisJZm9yIChwcmlvcml0eSA9IElYX0VUSF9BQ0NfVFhfUFJJT1JJ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51bWJlciBvZiByZXRyaWVzIGR1cmluZyBpeEV0aEFjY1BvcnREaXNhYmxlLCB3aGljaAorICogaXMgYXBwcm94aW1hdGVseSAxMCBzZWNvbmRzCisqLworI2RlZmluZSBJWF9FVEhfQUNDX01BWF9SRVRSWSA1MDAKKworLyogTWF4aW11bSBudW1iZXIgb2YgcmV0cmllcyBkdXJpbmcgaXhFdGhBY2NQb3J0RGlzYWJsZSB3aGVuIGV4cGVjdGluZworICogdGltZW91dAorICovCisjZGVmaW5lIElYX0VUSF9BQ0NfTUFYX1JFVFJZX1RJTUVPVVQgNQorCisjZGVmaW5lIElYX0VUSF9BQ0NfVkFMSURBVEVfUE9SVF9JRChwb3J0SWQpIFwKKyAgICBkbyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgIGlmKCFJWF9FVEhfQUNDX0lTX1BPUlRfVkFMSUQocG9ydElkKSkgICBcCisgICAgICAgIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwkgICAgcmV0dXJuIElYX0VUSF9BQ0NfSU5WQUxJRF9QT1JUOyAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgIH0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICB9IHdoaWxlKDApCisKK1BVQkxJQyBJeEV0aEFjY01hY1N0YXRlIGl4RXRoQWNjTWFjU3RhdGVbSVhfRVRIX0FDQ19OVU1CRVJfT0ZfUE9SVFNdOworCitQUklWQVRFIFVJTlQzMiBpeEV0aEFjY01hY0Jhc2VbSVhfRVRIX0FDQ19OVU1CRVJfT0ZfUE9SVFNdOworCisvKkZvcndhcmQgZnVuY3Rpb24gZGVjbGFyYXRpb25zKi8KK1BS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ZhbHVlID0gcmVndmFsICYgMHhmZmZmOworICAgIGl4T3NhbE11dGV4VW5sb2NrKCZtaWlBY2Nlc3NMb2NrKTsKKyAgICByZXR1cm4gSVhfRVRIX0FDQ19TVUNDRVNTOworICAgIAorfQorCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIGl4RXRoQWNjTWlpV3JpdGVSdG4gLSB3cml0ZSBhIDE2IGJpdCB2YWx1ZSB0byBhIFBIWQorICovCitJeEV0aEFjY1N0YXR1cworaXhFdGhBY2NNaWlXcml0ZVJ0biAoVUlOVDggcGh5QWRkciwgCisJCSAgICAgVUlOVDggcGh5UmVnLCAKKwkJICAgICBVSU5UMTYgdmFsdWUpCit7CisgICAgVUlOVDMyIG1kaW9Db21tYW5kOworICAgIFVJTlQzMiByZWd2YWw7CisgICAgVUlOVDE2IHJlYWRWYWw7CisgICAgVUlOVDMyIG1paVRpbWVvdXQ7CisKKyAgICBpZiAoIUlYX0VUSF9BQ0NfSVNfU0VSVklDRV9JTklUSUFMSVpFRCgpKQorICAgIHsKKwlyZXR1cm4gKElYX0VUSF9BQ0NfRkFJTCk7CisgICAgfQorCisgICAgaWYgKChwaHlBZGRyID49IElYUDQyNV9FVEhfQUNDX01JSV9NQVhfQUREUikgCisJfHwgKHBoeVJlZyA+PSBJWFA0MjVfRVRIX0FDQ19NSUlfTUFYX1JFRykpCisgICAgeworCXJldHVybiAoSVhfRVRIX0FDQ19GQUlMKTsKKyAgICB9CisgICAKKyAgICAvKiBlbnN1cmUgdGhhdCBhIFBIWSBpcyBwcmVzZW50IGF0IHRoaXMgYWRkcmVzcyAqLworICAgIGlmKGl4RXRoQWNjTWlpUmVhZFJ0bihwaHlBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICBJWF9FVEhfQUNDX01JSV9DVFJMX1JFRywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJnJlYWRWYWwpICE9IEl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8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqICBQaHkgcXVlcnkgZnVuY3Rpb25zCisgKgorICovCitJeEV0aEFjY1N0YXR1cworaXhFdGhBY2NNaWlTdGF0c1Nob3cgKFVJTlQzMiBwaHlBZGRyKQoreworICAgIFVJTlQxNiByZWd2YWw7CisgICAgcHJpbnRmKCJSZWdpc2VycyBvbiBQSFkgYXQgYWRkcmVzcyAweCV4XG4iLCBwaHlBZGRyKTsKKyAgICBpeEV0aEFjY01paVJlYWRSdG4ocGh5QWRkciwgSVhfRVRIX0FDQ19NSUlfQ1RSTF9SRUcsICZyZWd2YWwpOworICAgIHByaW50ZigiICAgIENvbnRyb2wgUmVnaXN0ZXIgICAgICAgICAgICAgICAgICA6ICAgICAgMHglNC40eFxuIiwgcmVndmFsKTsKKyAgICBpeEV0aEFjY01paVJlYWRSdG4ocGh5QWRkciwgIElYX0VUSF9BQ0NfTUlJX1NUQVRfUkVHLCAmcmVndmFsKTsKKyAgICBwcmludGYoIiAgICBTdGF0dXMgUmVnaXN0ZXIgICAgICAgICAgICAgICAgICAgOiAgICAgIDB4JTQuNHhcbiIsIHJlZ3ZhbCk7CisgICAgaXhFdGhBY2NNaWlSZWFkUnRuKHBoeUFkZHIsICBJWF9FVEhfQUNDX01JSV9QSFlfSUQxX1JFRywgJnJlZ3ZhbCk7CisgICAgcHJpbnRmKCIgICAgUEhZIElEMSBSZWdpc3RlciAgICAgICAgICAgICAgICAgIDogICAgICAweCU0LjR4XG4iLCByZWd2YWwpOworICAgIGl4RXRoQWNjTWlpUmVhZFJ0bihwaHlBZGRyLCAgSVhfRVRIX0FDQ19NSUlfUEhZX0lEMl9SRUcsICZyZWd2YWwpOworICAgIHByaW50ZigiICAgIFBIWSBJRDIgUmVnaXN0ZXIgICAgICAgICAgICAgICAgICA6ICAgICAgMHglNC40eFxuIiwgcmVndmFsKTsKKyAgICBpeEV0aEFjY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GEgcG9ydCB0aGF0IG5lZWRzIGFnaW5nICovCisgICAgZm9yIChwb3J0SW5kZXggPSAwIDsgcG9ydEluZGV4IDwgSVhfRVRIX0RCX05VTUJFUl9PRl9QT1JUUyA7IHBvcnRJbmRleCsrKQorICAgIHsKKyAgICAgICAgaWYgKGl4RXRoREJQb3J0SW5mb1twb3J0SW5kZXhdLmFnaW5nRW5hYmxlZCAmJiBpeEV0aERCUG9ydEluZm9bcG9ydEluZGV4XS5lbmFibGVkKQorICAgICAgICB7CisgICAgICAgICAgICBhZ2luZ1JlcXVpcmVkID0gVFJVRTsKKyAgICAgICAgfQorICAgIH0KKworICAgIGlmIChhZ2luZ1JlcXVpcmVkKQorICAgIHsKKyAgICAgICAgLyogYXNrIGVhY2ggTlBFIHBvcnQgdG8gd3JpdGUgYmFjayB0aGUgZGF0YWJhc2UgZm9yIGFnaW5nIGluc3BlY3Rpb24gKi8KKyAgICAgICAgZm9yIChwb3J0SW5kZXggPSAwIDsgcG9ydEluZGV4IDwgSVhfRVRIX0RCX05VTUJFUl9PRl9QT1JUUyA7IHBvcnRJbmRleCsrKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoaXhFdGhEQlBvcnREZWZpbml0aW9uc1twb3J0SW5kZXhdLnR5cGUgPT0gSVhfRVRIX05QRQorICAgICAgICAgICAgICAgICYmIGl4RXRoREJQb3J0SW5mb1twb3J0SW5kZXhdLmFnaW5nRW5hYmxlZAorICAgICAgICAgICAgICAgICYmIGl4RXRoREJQb3J0SW5mb1twb3J0SW5kZXhdLmVuYWJsZWQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgSXhOcGVNaE1lc3NhZ2UgbWVzc2FnZTsKKyAgICAgICAgICAgICAgICBJWF9TVEFUVVMgcmVzdWx0OworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIC8qIHNlbmQgRURCX0dldE1BQ0FkZHJlc3NEYXRhYmFzZSBtZXNzYWdlICovCisgICAgICAgICAgICAgICAgRklMTF9HRVRNQUNBRERSRVNTREFUQUJBU0UobWVzc2FnZSwgCisgICAgICAgICAgICAgICAgICAgIDAgLyogdW51c2VkICovLCAKKyAgICAgICAgICAgICAgICAgICAgSVhfT1NBTF9NTVVfVklSVF9UT19QSFlTKGl4RXRoREJQb3J0SW5mb1twb3J0SW5kZXhdLnVwZGF0ZU1ldGhvZC5ucGVVcGRhdGVab25lKSk7CisKKyAgICAgICAgICAgICAgICBJWF9FVEhEQl9TRU5EX05QRV9NU0coSVhfRVRIX0RCX1BPUlRfSURfVE9fTlBFKHBvcnRJbmRleCksIG1lc3NhZ2UsIHJlc3VsdCk7CisKKyAgICAgICAgICAgICAgICBpZiAocmVzdWx0ID09IElYX1NVQ0NFU1MpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvKiBhbmFseXplIE5QRSBjb3B5ICovCisgICAgICAgICAgICAgICAgICAgIGl4RXRoREJOUEVTeW5jU2Nhbihwb3J0SW5kZXgsIGl4RXRoREJQb3J0SW5mb1twb3J0SW5kZXhdLnVwZGF0ZU1ldGhvZC5ucGVVcGRhdGVab25lLCBGVUxMX0VMVF9CWVRFX1NJWkUpOworCisgICAgICAgICAgICAgICAgICAgIElYX0VUSF9EQl9TVVBQT1JUX1RSQUNFKCJEQjogKEFQSSkgRmluaXNoZWQgc2Nhbm5pbmcgTlBFIHRyZWUgb24gcG9ydCAlZFxuIiwgcG9ydEluZGV4KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaXhFdGhEQlBvcnRJbmZvW3BvcnRJbmRleF0uYWdpbmdFbmFibGVkICAgICAgICAgICAgICAgID0gRkFMU0U7CisgICAgICAgICAgICAgICAgICAgIGl4RXRoREJQb3J0SW5mb1twb3J0SW5kZXhdLnVwZGF0ZU1ldGhvZC51cGRhdGVFbmFibGVkICA9IEZBTFNFOworICAgICAgICAgICAgICAgICAgICBpeEV0aERCUG9ydEluZm9bcG9ydEluZGV4XS51cGRhdGVNZXRob2QudXNlckNvbnRyb2xsZWQgPSBUUlVFOworCisgICAgICAgICAgICAgICAgICAgIGl4T3NhbExvZyhJWF9PU0FMX0xPR19MVkxfRkFUQUwsCisgICAgICAgICAgICAgICAgICAgICAgICBJWF9PU0FMX0xPR19ERVZfU1RET1VULCAKKyAgICAgICAgICAgICAgICAgICAgICAgICJFdGhEQjogKE1haW50ZW5hbmNlKSB3YXJuaW5nLCBkaXNhYmxpbmcgYWdpbmcgYW5kIHVwZGF0ZXMgZm9yIHBvcnQgJWQgKGFzc3VtZWQgZGVhZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICBwb3J0SW5kZXgsIDAsIDAsIDAsIDAsIDApOworCisgICAgICAgICAgICAgICAgICAgIGl4RXRoREJEYXRhYmFzZUNsZWFyKHBvcnRJbmRleCwgSVhfRVRIX0RCX0FMTF9SRUNPUkRfVFlQRVMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8qIGJyb3dzZSBkYXRhYmFzZSBhbmQgYWdlIGVudHJpZXMgKi8KKyAgICAgICAgQlVTWV9SRVRSWShpeEV0aERCSW5pdEhhc2hJdGVyYXRvcigmZGJIYXNodGFibGUsICZpdGVyYXRvcikpOworCisgICAgICAgIHdoaWxlIChJU19JVEVSQVRPUl9WQUxJRCgmaXRlcmF0b3IpKQorICAgICAgICB7CisgICAgICAgICAgICBNYWNEZXNjcmlwdG9yICpkZXNjcmlwdG9yID0gKE1hY0Rlc2NyaXB0b3IgKikgaXRlcmF0b3Iubm9kZS0+ZGF0YTsKKyAgICAgICAgICAgIFVJTlQzMiAqYWdlICAgICAgICAgICAgICAgPSBOVUxMOworICAgICAgICAgICAgQk9PTCBzdGF0aWNFbnRyeSAgICAgICAgICA9IFRSVUU7CisKKyAgICAgICAgICAgIGlmIChkZXNjcmlwdG9yLT50eXBlID09IElYX0VUSF9EQl9GSUxURVJJTkdfUkVDT1JEKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGFnZSAgICAgICAgID0gJmRlc2NyaXB0b3ItPnJlY29yZERhdGEuZmlsdGVyaW5nRGF0YS5hZ2U7CisgICAgICAgICAgICAgICAgc3RhdGljRW50cnkgPSBkZXNjcmlwdG9yLT5yZWNvcmREYXRhLmZpbHRlcmluZ0RhdGEuc3RhdGljRW50cnk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmIChkZXNjcmlwdG9yLT50eXBlID09IElYX0VUSF9EQl9GSUxURVJJTkdfVkxBTl9SRUNPUkQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgYWdlICAgICAgICAgPSAmZGVzY3JpcHRvci0+cmVjb3JkRGF0YS5maWx0ZXJpbmdWbGFuRGF0YS5hZ2U7CisgICAgICAgICAgICAgICAgc3RhdGljRW50cnkgPSBkZXNjcmlwdG9yLT5yZWNvcmREYXRhLmZpbHRlcmluZ1ZsYW5EYXRhLnN0YXRpY0VudHJ5OworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0YXRpY0VudHJ5ID0gVFJVRTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKGl4RXRoREJQb3J0SW5mb1tkZXNjcmlwdG9yLT5wb3J0SURdLmFnaW5nRW5hYmxlZCAmJiAoc3RhdGljRW50cnkgPT0gRkFMU0UpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIG1hbnVhbGx5IGluY3JlbWVudCB0aGUgYWdlIGlmIHRoZSBwb3J0IGhhcyBubyBzdWNoIGNhcGFiaWxpdHkgKi8KKyAgICAgICAgICAgICAgICBpZiAoKGl4RXRoREJQb3J0RGVmaW5pdGlvbnNbZGVzY3JpcHRvci0+cG9ydElEXS5jYXBhYmlsaXRpZXMgJiBJWF9FVEhfRU5UUllfQUdJTkcpID09IDApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAqYWdlICs9IChJWF9FVEhfREJfTUFJTlRFTkFOQ0VfVElNRSAvIDYwKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvKiBhZ2UgZW50cnkgaWYgaXQgZXhjZWVkZWQgdGhlIG1heGltdW0gdGltZSB0byBsaXZlICovCisgICAgICAgICAgICAgICAgaWYgKCphZ2UgPj0gKElYX0VUSF9EQl9MRUFSTklOR19FTlRSWV9BR0VfVElNRSAvIDYwKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8qIGFkZCBwb3J0IHRvIHRoZSBzZXQgb2YgdXBkYXRlIHRyaWdnZXIgcG9ydHMgKi8KKyAgICAgICAgICAgICAgICAgICAgSk9JTl9QT1JUX1RPX01BUCh0cmlnZ2VyUG9ydHMsIGRlc2NyaXB0b3ItPnBvcnRJRCk7CisKKyAgICAgICAgICAgICAgICAgICAgLyogZGVsZXRlIGVudHJ5ICovCisgICAgICAgICAgICAgICAgICAgIEJVU1lfUkVUUlkoaXhFdGhEQlJlbW92ZUVudHJ5QXRIYXNoSXRlcmF0b3IoJmRiSGFzaHRhYmxlLCAmaXRlcmF0b3IpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLyogbW92ZSB0byB0aGUgbmV4dCByZWNvcmQgKi8KKyAgICAgICAgICAgICAgICAgICAgQlVTWV9SRVRSWShpeEV0aERCSW5jcmVtZW50SGFzaEl0ZXJhdG9yKCZkYkhhc2h0YWJsZSwgJml0ZXJhdG9yKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIG1vdmUgdG8gdGhlIG5leHQgcmVjb3JkICovCisgICAgICAgICAgICAgICAgQlVTWV9SRVRSWShpeEV0a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09GX1BPUlRTXTsKKworI2RlZmluZSBJWF9FVEhfREJfREVGQVVMVF9GUkFNRV9TSVpFICgxNTE4KQorCisvKioKKyAqIEBicmllZiBpbml0aWFsaXplcyBhIHBvcnQKKyAqCisgKiBAcGFyYW0gcG9ydElEIElEIG9mIHRoZSBwb3J0IHRvIGJlIGluaXRpYWxpemVkCisgKgorICogTm90ZSB0aGF0IHJlZHVuZGFudCBpbml0aWFsaXphdGlvbnMgYXJlIHNpbGVudGx5CisgKiBkZWFsdCB3aXRoIGFuZCBkbyBub3QgY29uc3RpdHV0ZSBhbiBlcnJvcgorICoKKyAqIFRoaXMgZnVuY3Rpb24gaXMgZnVsbHkgZG9jdW1lbnRlZCBpbiB0aGUgbWFpbgorICogaGVhZGVyIGZpbGUsIEl4RXRoREIuaAorICovCitJWF9FVEhfREJfUFVCTElDCit2b2lkIGl4RXRoREJQb3J0SW5pdChJeEV0aERCUG9ydElkIHBvcnRJRCkKK3sKKyAgICBQb3J0SW5mbyAqcG9ydEluZm87CisKKyAgICBpZiAocG9ydElEID49IElYX0VUSF9EQl9OVU1CRVJfT0ZfUE9SVFMpCisgICAgeworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgcG9ydEluZm8gPSAmaXhFdGhEQlBvcnRJbmZvW3BvcnRJRF07CisKKyAgICBpZiAoaXhFdGhEQlNpbmdsZUV0aE5wZUNoZWNrKHBvcnRJRCkgIT0gSVhfRVRIX0RCX1NVQ0NFU1MpCisgICAgeworICAgICAgICBXQVJOSU5HX0xPRygiRXRoREI6IFVuYXZhaWxhYmxlIEV0aCAlZDogQ2Fubm90IGluaXRpYWxpemUgRXRoREIgUG9ydC5cbiIsIChVSU5UMzIpIHBvcnRJRCk7CisKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGlmIChwb3J0SW5mby0+aW5pdGlhbGl6ZWQpCisgICAgeworICAgICAgICAvKiByZWR1bmRhbnQgKi8KKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIC8qI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RlIHRyaWdnZXIgcG9ydHMgKi8KKyAgICAgICAgICAgIEpPSU5fUE9SVF9UT19NQVAodHJpZ2dlclBvcnRzLCBwb3J0SUQpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLyogbW92ZSB0byB0aGUgbmV4dCByZWNvcmQgKi8KKyAgICAgICAgICAgIEJVU1lfUkVUUlkoaXhFdGhEQkluY3JlbWVudEhhc2hJdGVyYXRvcigmZGJIYXNodGFibGUsICZpdGVyYXRvcikpOworICAgICAgICB9CisgICAgfQorCisgICAgaWYgKGl4RXRoREJQb3J0RGVmaW5pdGlvbnNbcG9ydElEXS50eXBlID09IElYX0VUSF9OUEUpCisgICAgeworICAgICAgICBpZiAocG9ydEluZm8tPnVwZGF0ZU1ldGhvZC5zZWFyY2hUcmVlICE9IE5VTEwpCisgICAgICAgIHsKKyAgICAgICAgICAgIGl4RXRoREJGcmVlTWFjVHJlZU5vZGUocG9ydEluZm8tPnVwZGF0ZU1ldGhvZC5zZWFyY2hUcmVlKTsKKyAgICAgICAgICAgIHBvcnRJbmZvLT51cGRhdGVNZXRob2Quc2VhcmNoVHJlZSA9IE5VTEw7CisgICAgICAgIH0KKworICAgICAgICBpeEV0aERCTlBFVXBkYXRlSGFuZGxlcihwb3J0SUQsIElYX0VUSF9EQl9GSUxURVJJTkdfUkVDT1JEKTsKKyAgICB9CisKKyAgICAvKiBtYXJrIGFzIGRpc2FibGVkICovCisgICAgcG9ydEluZm8tPmVuYWJsZWQgPSBGQUxTRTsKKworICAgIC8qIGRpc2FibGUgdXBkYXRlcyB1bmxlc3MgdGhlIHVzZXIgaGFzIHNwZWNpZmljYWxseSBhbHRlcmVkIHRoZSBkZWZhdWx0IGJlaGF2aW9yICovCisgICAgaWYgKGl4RXRoREJQb3J0RGVmaW5pdGlvbnNbcG9ydElEXS50eXBlID09IElYX0VUSF9OUEUpCisgICAgeworICAgICAgICBpZiAoIXBvcnRJbmZvLT51cGRhdGVNZXR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cmRUeXBlID09IElYX0VUSF9EQl9XSUZJX1JFQ09SRCB8fCByZWNvcmRUeXBlID09IElYX0VUSF9EQl9GSVJFV0FMTF9SRUNPUkQpCisgICAgeworICAgICAgICBJWF9FVEhfREJfQ0hFQ0tfUE9SVF9FWElTVFMocG9ydElEKTsKKworICAgICAgICByZXN1bHQgPSBpeEV0aERCUG9ydFNlYXJjaChtYWNBZGRyLCBwb3J0SUQsIHJlY29yZFR5cGUpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICByZXR1cm4gSVhfRVRIX0RCX0lOVkFMSURfQVJHOworICAgIH0KKworICAgIGlmIChyZXN1bHQgPT0gTlVMTCkKKyAgICB7CisgICAgICAgIHJldHVybiBJWF9FVEhfREJfTk9fU1VDSF9BRERSOworICAgIH0KKworICAgICgoTWFjRGVzY3JpcHRvciAqKSByZXN1bHQtPmRhdGEpLT51c2VyID0gZmllbGQ7CisKKyAgICBpeEV0aERCUmVsZWFzZUhhc2hOb2RlKHJlc3VsdCk7CisKKyAgICByZXR1cm4gSVhfRVRIX0RCX1NVQ0NFU1M7Cit9CisKKy8qKgorICogQGJyaWVmIFJldHJpZXZlcyBhIHVzZXItZGVmaW5lZCBmaWVsZCBmcm9tIGEgZGF0YWJhc2UgcmVjb3JkCisgKgorICogTm90ZSB0aGF0IHRoaXMgZnVuY3Rpb24gaXMgZnVsbHkgZG9jdW1lbnRlZCBpbiB0aGUgbWFpbiBjb21wb25lbnQKKyAqIGhlYWRlciBmaWxlLgorICovCitJWF9FVEhfREJfUFVCTElDCitJeEV0aERCU3RhdHVzIGl4RXRoREJVc2VyRmllbGRHZXQoSXhFdGhEQlJlY29yZFR5cGUgcmVjb3JkVHlwZSwgSXhFdGhEQk1hY0FkZHIgKm1hY0FkZHIsIEl4RXRoREJQb3J0SWQgcG9ydElELCBJeEV0aERCVmxhbklkIHZsYW5JRCwgdm9pZCAqKmZpZWxkKQoreworICAgIEhhc2hOb2RlICpyZXN1bHQgPSBOVUxMOworC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FdGhEQkV2ZW50UHJvY2Vzc29yUnVubmluZyA9IFRSVUU7CisKKyAgICBJWF9FVEhfREJfRVZFTlRTX1RSQUNFKCJEQjogKEV2ZW50cykgRXZlbnQgcHJvY2Vzc29yIGxvb3Agd2FzIHN0YXJ0ZWRcbiIpOworCisgICAgd2hpbGUgKCFpeEV0aERCTGVhcm5pbmdTaHV0ZG93bikKKyAgICB7CisgICAgICAgIEJPT0wga2VlcFByb2Nlc3NpbmcgICAgPSBUUlVFOworICAgICAgICBVSU5UMzIgcHJvY2Vzc2VkRXZlbnRzID0gMDsKKworICAgICAgICBJWF9FVEhfREJfRVZFTlRTX1ZFUkJPU0VfVFJBQ0UoIkRCOiAoRXZlbnRzKSBXYWl0aW5nIGZvciBuZXcgbGVhcm5pbmcgZXZlbnQuLi5cbiIpOworCisgICAgICAgIGl4T3NhbFNlbWFwaG9yZVdhaXQoJmV2ZW50UXVldWVTZW1hcGhvcmUsIElYX09TQUxfV0FJVF9GT1JFVkVSKTsKKworICAgICAgICBJWF9FVEhfREJfRVZFTlRTX1ZFUkJPU0VfVFJBQ0UoIkRCOiAoRXZlbnRzKSBSZWNlaXZlZCBuZXcgZXZlbnRcbiIpOworCisgICAgICAgIGlmICghaXhFdGhEQkxlYXJuaW5nU2h1dGRvd24pCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIHBvcnQgdXBkYXRlIGhhbmRsaW5nICovCisgICAgICAgICAgICBTRVRfRU1QVFlfREVQRU5ERU5DWV9NQVAodHJpZ2dlclBvcnRzKTsKKworICAgICAgICAgICAgd2hpbGUgKGtlZXBQcm9jZXNzaW5nKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFBvcnRFdmVudCBsb2NhbF9ldmVudDsKKyAgICAgICAgICAgICAgICBVSU5UMzIgaW50TG9ja0tleTsKKworICAgICAgICAgICAgICAgIC8qIGxvY2sgcXVldWUgKi8KKyAgICAgICAgICAgICAgICBpeE9zYWxNdXRleExvY2soJmV2ZW50UXVldWVMb2NrLCBJWF9PU0FMX1dBSVRfRk9SRVZFUik7CisKKyAgICAgICAgICAgICAgICAvKiBsb2NrIE5QRSBpbnRlcnJ1cHRzICovCisgICAgICAgICAgICAgICAgaW50TG9ja0tleSA9IGl4T3NhbElycUxvY2soKTsKKworICAgICAgICAgICAgICAgIC8qIGV4dHJhY3QgZXZlbnQgKi8KKyAgICAgICAgICAgICAgICBsb2NhbF9ldmVudCA9ICooUVVFVUVfVEFJTCgmZXZlbnRRdWV1ZSkpOworCisgICAgICAgICAgICAgICAgU0hJRlRfVVBEQVRFX1FVRVVFKCZldmVudFF1ZXVlKTsKKworICAgICAgICAgICAgICAgIGl4T3NhbElycVVubG9jayhpbnRMb2NrS2V5KTsKKworICAgICAgICAgICAgICAgIGl4T3NhbE11dGV4VW5sb2NrKCZldmVudFF1ZXVlTG9jayk7CisKKyAgICAgICAgICAgICAgICBJWF9FVEhfREJfRVZFTlRTX1RSQUNFKCJEQjogKEV2ZW50cykgUHJvY2Vzc2luZyBldmVudCB3aXRoIElEIDB4JVhcbiIsIGxvY2FsX2V2ZW50LmV2ZW50VHlwZSk7CisKKyAgICAgICAgICAgICAgICBpeEV0aERCUHJvY2Vzc0V2ZW50KCZsb2NhbF9ldmVudCwgdHJpZ2dlclBvcnRzKTsKKworICAgICAgICAgICAgICAgIHByb2Nlc3NlZEV2ZW50cysrOworCisgICAgICAgICAgICAgICAgaWYgKHByb2Nlc3NlZEV2ZW50cyA+IEVWRU5UX1BST0NFU1NJTkdfTElNSVQgLyogbWF4aW11bSBidXJzdCByZWFjaGVkPyAqLworICAgICAgICAgICAgICAgICAgICB8fCBpeE9zYWxTZW1hcGhvcmVUcnlXYWl0KCZldmVudFF1ZXVlU2VtYXBob3JlKSAhPSBJWF9TVUNDRVNTKSAvKiBvciBlbXB0eSBxdWV1ZT8gKi8KKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGtlZXBQcm9jZXNzaW5nID0gRkFMU0U7CisgICAgICAgICAg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TG9jaygpOworCisgICAgaWYgKENBTl9FTlFVRVVFKCZldmVudFF1ZXVlKSkKKyAgICB7CisgICAgICAgIFBvcnRFdmVudCAqcXVldWVFdmVudCA9IFFVRVVFX0hFQUQoJmV2ZW50UXVldWUpOworCisgICAgICAgIC8qIHVwZGF0ZSBmaWVsZHMgb24gdGhlIHF1ZXVlICovCisgICAgICAgIG1lbWNweShxdWV1ZUV2ZW50LT5tYWNBZGRyLm1hY0FkZHJlc3MsIG1hY0FkZHItPm1hY0FkZHJlc3MsIHNpemVvZiAoSXhFdGhEQk1hY0FkZHIpKTsKKyAgICAgICAgCisgICAgICAgIHF1ZXVlRXZlbnQtPmV2ZW50VHlwZSAgICAgPSBldmVudFR5cGU7CisgICAgICAgIHF1ZXVlRXZlbnQtPnBvcnRJRCAgICAgICAgPSBwb3J0SUQ7CisgICAgICAgIHF1ZXVlRXZlbnQtPnN0YXRpY0VudHJ5ICAgPSBzdGF0aWNFbnRyeTsKKworICAgICAgICBQVVNIX1VQREFURV9RVUVVRSgmZXZlbnRRdWV1ZSk7CisKKyAgICAgICAgLyogaW1jcmVtZW50IGV2ZW50IHF1ZXVlIHNlbWFwaG9yZSAqLworICAgICAgICBpeE9zYWxTZW1hcGhvcmVQb3N0KCZldmVudFF1ZXVlU2VtYXBob3JlKTsKKyAgICAgICAgCisgICAgICAgIC8qIHVubG9jayBpbnRlcnJ1cHRzICovCisgICAgICAgIGl4T3NhbElycVVubG9jayhpbnRMb2NrS2V5KTsKKworICAgICAgICByZXR1cm4gSVhfRVRIX0RCX1NVQ0NFU1M7CisgICAgfQorICAgIGVsc2UgLyogZXZlbnQgcXVldWUgZnVsbCAqLworICAgIHsKKyAgICAgICAgLyogdW5sb2NrIGludGVycnVwdHMgKi8KKyAgICAgICAgaXhPc2FsSXJxVW5sb2NrKGludExvY2tLZXkpOworCisgICAgICAgIHJldHVybiBJWF9FVEhfREJfQlVTWTsKKyAgICB9Cit9CisKKy8qKgorICogQGJyaWVmIExvY2tzIG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luaXRpb25zW3BvcnRJbmRleF0udHlwZSA9PSBJWF9FVEhfTlBFKQorICAgICAgICB7CisKKyAgICAgICAgICAgIGlmIChpeE5wZURsTG9hZGVkSW1hZ2VHZXQoSVhfRVRIX0RCX1BPUlRfSURfVE9fTlBFKHBvcnRJbmRleCksICZpbWFnZUlkKSAhPSBJWF9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFdBUk5JTkdfTE9HKCJEQjogKEZlYXR1cmVTY2FuKSBOcGVEbCBkaWQgbm90IHByb3ZpZGUgdGhlIGltYWdlIElEIGZvciBOUEUgcG9ydCAlZFxuIiwgcG9ydEluZGV4KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBpbml0aWFsaXplIGFuZCBlbXB0eSBOUEUgcmVzcG9uc2UgbXV0ZXggKi8KKyAgICAgICAgICAgICAgICBpeE9zYWxNdXRleEluaXQoJnBvcnRJbmZvLT5ucGVBY2tMb2NrKTsKKyAgICAgICAgICAgICAgICBpeE9zYWxNdXRleExvY2soJnBvcnRJbmZvLT5ucGVBY2tMb2NrLCBJWF9PU0FMX1dBSVRfRk9SRVZFUik7CisKKyAgICAgICAgICAgICAgICAvKiBjaGVjayBOUEUgcmVzcG9uc2UgdG8gR2V0U3RhdHVzICovCisgICAgICAgICAgICAgICAgbXNnLmRhdGFbMF0gPSBJWF9FVEhOUEVfTlBFX0dFVFNUQVRVUyA8PCAyNDsKKyAgICAgICAgICAgICAgICBtc2cuZGF0YVsxXSA9IDA7CisgICAgICAgICAgICAgICAgSVhfRVRIREJfU0VORF9OUEVfTVNHKElYX0VUSF9EQl9QT1JUX0lEX1RPX05QRShwb3J0SW5kZXgpLCBtc2csIHJlc3VsdCk7CisgICAgICAgICAgICAgICAgaWYgKHJlc3VsdCAhPSBJWF9TVUNDRVNTKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgV0FSTklOR19MT0coIkRCOiAoRmVhdHVyZVNjYW4pIHdhcm5pbmcsIGNvdWxkIG5vdCBzZW5kIG1lc3NhZ2UgdG8gdGhlIE5QRVxuIik7CisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIH0KKworCisgICAgICAgICAgICAgICAgaWYgKGltYWdlSWQuZnVuY3Rpb25hbGl0eUlkID09IDB4MDAKKyAgICAgICAgICAgICAgICAgICAgfHwgaW1hZ2VJZC5mdW5jdGlvbmFsaXR5SWQgPT0gMHgwMworICAgICAgICAgICAgICAgICAgICB8fCBpbWFnZUlkLmZ1bmN0aW9uYWxpdHlJZCA9PSAweDA0CisgICAgICAgICAgICAgICAgICAgIHx8IGltYWdlSWQuZnVuY3Rpb25hbGl0eUlkID09IDB4ODApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwb3J0SW5mby0+ZmVhdHVyZUNhcGFiaWxpdHkgfD0gSVhfRVRIX0RCX0ZJTFRFUklORzsKKyAgICAgICAgICAgICAgICAgICAgcG9ydEluZm8tPmZlYXR1cmVDYXBhYmlsaXR5IHw9IElYX0VUSF9EQl9GSVJFV0FMTDsKKyAgICAgICAgICAgICAgICAgICAgcG9ydEluZm8tPmZlYXR1cmVDYXBhYmlsaXR5IHw9IElYX0VUSF9EQl9TUEFOTklOR19UUkVFX1BST1RPQ09MOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmIChpbWFnZUlkLmZ1bmN0aW9uYWxpdHlJZCA9PSAweDAxCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgaW1hZ2VJZC5mdW5jdGlvbmFsaXR5SWQgPT0gMHg4MSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBvcnRJbmZvLT5mZWF0dXJlQ2FwYWJpbGl0eSB8PSBJWF9FVEhfREJfRklMVEVSSU5HOworICAgICAgICAgICAgICAgICAgICBwb3J0SW5mby0+ZmVhdHVyZUNhcGFiaWxpdHkgfD0gSVhfRVRIX0RCX0ZJUkVXQUxMOworICAgICAgICAgICAgICAgICAgICBwb3J0SW5mby0+ZmVhdHVyZUNhcGFiaWxpdHkgfD0gSVhfRVRIX0RCX1NQQU5OSU5HX1RSRUVfUFJPVE9DT0w7CisgICAgICAgICAgICAgICAgICAgIHBvcnRJbmZvLT5mZWF0dXJlQ2FwYWJpbGl0eSB8PSBJWF9FVEhfREJfVkxBTl9RT1M7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYgKGltYWdlSWQuZnVuY3Rpb25hbGl0eUlkID09IDB4MDIKKyAgICAgICAgICAgICAgICAgICAgICAgICB8fCBpbWFnZUlkLmZ1bmN0aW9uYWxpdHlJZCA9PSAweDgyKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcG9ydEluZm8tPmZlYXR1cmVDYXBhYmlsaXR5IHw9IElYX0VUSF9EQl9XSUZJX0hFQURFUl9DT05WRVJTSU9OOworICAgICAgICAgICAgICAgICAgICBwb3J0SW5mby0+ZmVhdHVyZUNhcGFiaWxpdHkgfD0gSVhfRVRIX0RCX0ZJUkVXQUxMOworICAgICAgICAgICAgICAgICAgICBwb3J0SW5mby0+ZmVhdHVyZUNhcGFiaWxpdHkgfD0gSVhfRVRIX0RCX1NQQU5OSU5HX1RSRUVfUFJPVE9DT0w7CisgICAgICAgICAgICAgICAgICAgIHBvcnRJbmZvLT5mZWF0dXJlQ2FwYWJpbGl0eSB8PSBJWF9FVEhfREJfVkxBTl9RT1M7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLyogcmVzZXQgQVFNIHF1ZXVlcyAqLworICAgICAgICAgICAgICAgIG1lbXNldChwb3J0SW5mby0+aXhFdGhEQlRyYWZmaWNDbGFzc0FRTUFzc2lnbm1lbnRzLCAwLCBzaXplb2YgKHBvcnRJbmZvLT5peEV0aERCVHJhZmZpY0NsYXNzQV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aXR5SWQpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8qIGZvdW5kIGl0ICovCisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIC8qIHNlbGVjdCB0aGUgZGVmYXVsdCBjYXNlIGlmIHdlIHdlbnQgb3ZlciB0aGUgYXJyYXkgYm91bmRhcnkgKi8KKyAgICAgICAgICAgICAgICBpZiAodHJhZmZpY0NsYXNzRGVmaW5pdGlvbkluZGV4ID09IHNpemVvZiAoaXhFdGhEQlRyYWZmaWNDbGFzc0RlZmluaXRpb25zKSAvIHNpemVvZiAoaXhFdGhEQlRyYWZmaWNDbGFzc0RlZmluaXRpb25zWzBdKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHRyYWZmaWNDbGFzc0RlZmluaXRpb25JbmRleCA9IDA7IC8qIHRoZSBmaXJzdCByZWNvcmQgaXMgdGhlIGRlZmF1bHQgY2FzZSAqLworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIC8qIHNlbGVjdCBxdWV1ZSBhc3NpZ25tZW50IHN0cnVjdHVyZSBiYXNlZCBvbiB0aGUgdHJhZmZpYyBjbGFzcyBjb25maWd1cmF0aW9uIGluZGV4ICovCisgICAgICAgICAgICAgICAgcXVldWVTdHJ1Y3R1cmVJbmRleCA9IGl4RXRoREJUcmFmZmljQ2xhc3NEZWZpbml0aW9uc1t0cmFmZmljQ2xhc3NEZWZpbml0aW9uSW5kZXhdW0lYX0VUSF9EQl9RVUVVRV9BU1NJR05NRU5UX0lOREVYXTsKKworICAgICAgICAgICAgICAgIC8qIG9ubHkgdHJhZmZpYyBjbGFzcyAwIGlzIGFjdGl2ZSBhdCBpbml0aWFsaXphdGlvbiB0aW1lICovCisgICAgICAgICAgICAgICAgcG9ydEluZm8tPml4RXRoREJUcmFmZmljQ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l9UUkFGRklDX0NMQVNTX0NPVU5UX0lOREVYXTsKKworICAgICAgICAgICAgICAgICAgICAvKiBzZXQgQVFNIHF1ZXVlcyAqLworICAgICAgICAgICAgICAgICAgICBmb3IgKHF1ZXVlSW5kZXggPSAwIDsgcXVldWVJbmRleCA8IElYX0lFRUU4MDJfMVFfUU9TX1BSSU9SSVRZX0NPVU5UIDsgcXVldWVJbmRleCsrKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBwb3J0SW5mby0+aXhFdGhEQlRyYWZmaWNDbGFzc0FRTUFzc2lnbm1lbnRzW3F1ZXVlSW5kZXhdID0gaXhFdGhEQlF1ZXVlQXNzaWdubWVudHNbcXVldWVTdHJ1Y3R1cmVJbmRleF1bcXVldWVJbmRleF07CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAvKiBzZXQgZGVmYXVsdCBQVklEICgwKSBhbmQgZGVmYXVsdCB0cmFmZmljIGNsYXNzIDAgKi8KKyAgICAgICAgICAgICAgICAgICAgaXhFdGhEQlBvcnRWbGFuVGFnU2V0KHBvcnRJbmRleCwgMCk7CisKKyAgICAgICAgICAgICAgICAgICAgLyogZW5hYmxlIHJlY2VwdGlvbiBvZiBhbGwgZnJhbWVzICovCisgICAgICAgICAgICAgICAgICAgIGl4RXRoREJBY2NlcHRhYmxlRnJhbWVUeXBlU2V0KHBvcnRJbmRleCwgSVhfRVRIX0RCX0FDQ0VQVF9BTExfRlJBTUVTKTsKKworICAgICAgICAgICAgICAgICAgICAvKiBjbGVhciBmdWxsIFZMQU4gbWVtYmVyc2hpcCAqLworICAgICAgICAgICAgICAgICAgICBpeEV0aERCUG9ydFZsYW5NZW1iZXJzaGlwUmFuZ2VSZW1vdmUocG9ydEluZGV4LCAwLCBJWF9FVEhfREJfODAyXzFRX01BWF9WTEFOX0lEKTsKKworICAgICAgICAgICAgICAgICAgICAvKiBjbGVhciBUVEkgdGFibGUgLSBubyBWTEFOIHRhZ2dlZCBmcmFtZXMgd2lsbCBiZSB0cmFuc21pdHRlZCAqLworICAgICAgICAgICAgICAgICAgICBpeEV0aERCRWdyZXNzVmxhblJhbmdlVGFnZ2luZ0VuYWJsZWRTZXQocG9ydEluZGV4LCAwLCA0MDk0LCBGQUxTRSk7CisKKyAgICAgICAgICAgICAgICAgICAgLyogc2V0IG1lbWJlcnNoaXAgb24gMCwgb3RoZXJ3aXNlIG5vIFR4IG9yIFJ4IGlzIHdvcmtpbmcgKi8KKyAgICAgICAgICAgICAgICAgICAgaXhFdGhEQlBvcnRWbGFuTWVtYmVyc2hpcEFkZChwb3J0SW5kZXgsIDApOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIC8qIFFvUyBub3QgYXZhaWxhYmxlIGluIHRoaXMgaW1hZ2UgKi8KKyNlbmRpZiAvKiB0ZXN0LW9ubHkgKi8KKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8qIGluaXRpYWxpemUgdHJhZmZpYyBjbGFzcyBhdmFpbGFiaWxpdHkgKG9ubHkgY2xhc3MgMCBpcyBhdmFpbGFibGUpICovCisgICAgICAgICAgICAgICAgICAgIHBvcnRJbmZvLT5peEV0aERCVHJhZmZpY0NsYXNzQXZhaWxhYmxlID0gMTsKKworICAgICAgICAgICAgICAgICAgICAvKiBwb2ludCBhbGwgQVFNIHF1ZXVlcyB0byB0cmFmZmljIGNsYXNzIDAgKi8KKyAgICAgICAgICAgICAgICAgICAgZm9yIChxdWV1ZUluZGV4ID0gMCA7IHF1ZXVlSW5kZXggPCBJWF9JRUVFODAyXzFRX1FPU19QUklPUklUWV9DT1VOVCA7IHF1ZXVlSW5kZXgrKykKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgcG9ydEluZm8tPml4RXRoREJUcmFmZmljQ2xhc3NBUU1Bc3NpZ25tZW50c1txdWV1ZUluZGV4XSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXhFdGhEQlF1ZXVlQXNzaWdubWVudHNbcXVldWVTdHJ1Y3R1cmVJbmRleF1bMF07CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisKKyNpZmRlZiBDT05GSUdfV0lUSF9WTEFOIC8qIHRlc3Qtb25seTogVkxBTiBzdXBwb3J0IG5vdCBpbmNsdWRlZCB0byBzYXZlIHNwYWNlISEhICovCisgICAgICAgICAgICAgICAgLyogZG93bmxvYWQgcHJpb3JpdHkgbWFwcGluZyB0YWJsZSBhbmQgUnggcXVldWUgY29uZmlndXJhdGlvbiAqLworICAgICAgICAgICAgICAgIG1lbXNldCAoZGVmYXVsdFByaW9yaXR5VGFibGUsIDAsIHNpemVvZiAoZGVmYXVsdFByaW9yaXR5VGFibGUpKTsKKyAgICAgICAgICAgICAgICBpeEV0aERCUHJpb3JpdHlNYXBwaW5nVGFibGVTZXQocG9ydEluZGV4LCBkZWZhdWx0UHJpb3JpdHlUYWJsZSk7CisjZW5kaWYKKworICAgICAgICAgICAgICAgIC8qIGJ5IGRlZmF1bHQgd2UgdHVybiBvZmYgaW52YWxpZCBzb3VyY2UgTUFDIGFkZHJlc3MgZmlsdGVyaW5nICovCisgICAgICAgICAgICAgICAgaXhFdGhEQkZpcmV3YWxsSW52YWxpZEFkZHJlc3NGaWx0ZXJFbmFibGUocG9ydEluZGV4LCBGQUxTRSk7CisKKyAgICAgICAgICAgICAgICAvKiBkaXNhYmxlIHBvcnQsIFZMQU4sIEZpcmV3YWxsIGZlYXR1cmUgYml0cyAqLworICAgICAgICAgICAgICAgIHBvcnRJbmZvLT5mZWF0dXJlU3RhdHVzICY9IH5JWF9FVEhfREJfVkxBTl9RT1M7CisgICAgICAgICAgICAgICAgcG9ydEluZm8tPmZlYXR1cmVTdGF0dXMgJj0gfklYX0VUSF9EQl9GSVJFV0FMTDsKKyAgICAgICAgICAgICAgICBwb3J0SW5mby0+ZW5hYmxlZCAgICAgICAgPSBGQUxTRT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ElYX0VUSF9EQl9GSUxURVJJTkcgfCBJWF9FVEhfREJfV0lGSV9IRUFERVJfQ09OVkVSU0lPTikpCisgICAgICAgICAgICA9PSAoSVhfRVRIX0RCX0ZJTFRFUklORyB8IElYX0VUSF9EQl9XSUZJX0hFQURFUl9DT05WRVJTSU9OKSkKKyAgICB7CisgICAgICAgIHJldHVybiBJWF9FVEhfREJfTk9fUEVSTUlTU0lPTjsKKyAgICB9CisKKyAgICAvKiBsZWFybmluZyBtdXN0IGJlIGVuYWJsZWQgYmVmb3JlIGZpbHRlcmluZyAqLworICAgIGlmIChlbmFibGUgJiYgKGZlYXR1cmUgPT0gSVhfRVRIX0RCX0ZJTFRFUklORykgJiYgKChwb3J0SW5mby0+ZmVhdHVyZVN0YXR1cyAmIElYX0VUSF9EQl9MRUFSTklORykgPT0gMCkpCisgICAgeworICAgICAgICByZXR1cm4gSVhfRVRIX0RCX05PX1BFUk1JU1NJT047CisgICAgfQorCisgICAgLyogZmlsdGVyaW5nIG11c3QgYmUgZGlzYWJsZWQgYmVmb3JlIGxlYXJuaW5nICovCisgICAgaWYgKCFlbmFibGUgJiYgKGZlYXR1cmUgPT0gSVhfRVRIX0RCX0xFQVJOSU5HKSAmJiAoKHBvcnRJbmZvLT5mZWF0dXJlU3RhdHVzICYgSVhfRVRIX0RCX0ZJTFRFUklORykgIT0gMCkpCisgICAgeworICAgICAgICByZXR1cm4gSVhfRVRIX0RCX05PX1BFUk1JU1NJT047CisgICAgfQorCisgICAgLyogcmVkdW5kYW50IGVuYWJsaW5nIG9yIGRpc2FibGluZyAqLworICAgIGlmICgoIWVuYWJsZSAmJiAoKHBvcnRJbmZvLT5mZWF0dXJlU3RhdHVzICYgZmVhdHVyZSkgPT0gMCkpCisgICAgICAgIHx8IChlbmFibGUgJiYgKChwb3J0SW5mby0+ZmVhdHVyZVN0YXR1cyAmIGZlYXR1cmUpICE9IDApKSkKKyAgICB7CisgICAgICAgIC8qIGRvIG5vdGhpbmcgKi8KKyAgICAg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DQ0VQVF9BTExfRlJBTUVTKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBJWF9FVEhfREJfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBpeEV0aERCSW5ncmVzc1ZsYW5UYWdnaW5nRW5hYmxlZFNldChwb3J0SUQsIElYX0VUSF9EQl9QQVNTX1RIUk9VR0gpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvKiBzZXQgbWVtYmVyc2hpcCBhbmQgVFRJIHRhYmxlcyAqLworICAgICAgICAgICAgbWVtc2V0ICh2bGFuU2V0LCAweEZGLCBzaXplb2YgKHZsYW5TZXQpKTsKKworICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBJWF9FVEhfREJfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiB1c2UgdGhlIGludGVybmFsIGZ1bmN0aW9uIHRvIGJ5cGFzcyBQVklEIGNoZWNrICovCisgICAgICAgICAgICAgICAgc3RhdHVzID0gaXhFdGhEQlBvcnRWbGFuVGFibGVTZXQocG9ydElELCBwb3J0SW5mby0+dmxhbk1lbWJlcnNoaXAsIHZsYW5TZXQpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoc3RhdHVzID09IElYX0VUSF9EQl9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIHVzZSB0aGUgaW50ZXJuYWwgZnVuY3Rpb24gdG8gYnlwYXNzIFBWSUQgY2hlY2sgKi8KKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBpeEV0aERCUG9ydFZsYW5UYWJsZVNldChwb3J0SUQsIHBvcnRJbmZvLT50cmFuc21pdFRhZ2dpbmdJbmZvLCB2bGFuU2V0KTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLyogcmVzZXQgdGhlIFBWSUQgKi8KKyAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gSVhfRVRIX0RCX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gaXhFdGhEQlBvcnRWbGFuVGFnU2V0KHBvcnRJRCwgMCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8qIGVuYWJsZSBUUElEIHBvcnQgZXh0cmFjdGlvbiAqLworICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBJWF9FVEhfREJfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBpeEV0aERCVmxhblBvcnRFeHRyYWN0aW9uRW5hYmxlKHBvcnRJRCwgVFJVRSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoZmVhdHVyZSA9PSBJWF9FVEhfREJfRklSRVdBTEwpCisjZW5kaWYKKyAgICAgICAgeworICAgICAgICAgICAgLyogZmlyZXdhbGwgc3RhcnRzIGluIGJsYWNrLWxpc3QgbW9kZSB1bmxlc3Mgb3RoZXJ3aXNlIGNvbmZpZ3VyZWQgYmVmb3JlICoKKyAgICAgICAgICAgICAqIG5vdGUgdGhhdCBpbnZhbGlkIHNvdXJjZSBNQUMgYWRkcmVzcyBmaWx0ZXJpbmcgaXMgZGlzYWJsZWQgYnkgZGVmYXVsdCAqLworICAgICAgICAgICAgaWYgKHBvcnRJbmZvLT5maXJld2FsbE1vZGUgIT0gSVhfRVRIX0RCX0ZJUkVXQUxMX0JMQUNLX0xJU1QKKyAgICAgICAgICAgICAgICAmJiBwb3J0SW5mby0+ZmlyZXdhbGxNb2RlICE9IElYX0VUSF9EQl9GSVJFV0FMTF9XSElURV9MSVNUKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0YXR1cyA9IGl4RXRoREJGaXJld2FsbE1vZGVTZXQocG9ydElELCBJWF9FVEhfREJfRklSRVdBTExfQkxBQ0tfTElTVCk7CisKKyAgICAgICAgICAgICAgICBpZiAoc3RhdHVzID09IElYX0VUSF9EQl9TVUNDRVNTKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gaXhFdGhEQkZpcmV3YWxsSW52YWxpZEFkZHJlc3NGaWx0ZXJFbmFibGUocG9ydElELCBGQUxTRSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKHN0YXR1cyAhPSBJWF9FVEhfREJfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgLyogY2hlY2tzIGZhaWxlZCwgZGlzYWJsZSAqLworICAgICAgICAgICAgcG9ydEluZm8tPmZlYXR1cmVTdGF0dXMgJj0gfmZlYXR1cmU7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgLyogdHVybiBvZmYgZmVhdHVyZXMgKi8KKyAgICAgICAgaWYgKGZlYXR1cmUgPT0gSVhfRVRIX0RCX0ZJUkVXQUxMKQorICAgICAgICB7CisgICAgICAgICAgICAvKiB0dXJuaW5nIG9mZiB0aGUgZmlyZXdhbGwgaXMgZXF1aXZhbGVudCB0bzoKKyAgICAgICAgICAgICAgICAtIHNldCB0byBibGFjay1saXN0IG1vZGUKKyAgICAgICAgICAgICAgICAtIGNsZWFyIGFsbCB0aGUgZW50cmllcyBhbmQgZG93bmxvYWQgdGhlIG5ldyB0YWJsZQorICAgICAgICAgICAgICAgIC0gdHVybiBvZmYgdGhlIGludmFsaWQgc291cmNlIGFkZHJlc3MgY2hlY2tpbmcKKyAgICAgICAgICAgICovCisKKyAgICAgICAgICAgIHN0YXR1cyA9IGl4RXRoREJEYXRhYmFzZUNsZWFyKHBvcnRJRCwgSVhfRVRIX0RCX0ZJUkVXQUxMX1JFQ09SRCk7CisKKyAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gSVhfRVRIX0RCX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gaXhFdGhEQkZpcmV3YWxsTW9kZVNldChwb3J0SUQsIElYX0VUSF9EQl9GSVJFV0FMTF9CTEFDS19MSVNUKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBJWF9FVEhfREJfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBpeEV0aERCRmlyZXdhbGxJbnZhbGlkQWRkcmVzc0ZpbHRlckVuYWJsZShwb3J0SUQsIEZBTFNFKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBJWF9FVEhfREJfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBpeEV0aERCRmlyZXdhbGxUYWJsZURvd25sb2FkKHBvcnRJRCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoZmVhdHVyZSA9PSBJWF9FVEhfREJfV0lGSV9IRUFERVJfQ09OVkVSU0lPTikKKyAgICAgICAgeworICAgICAgICAgICAgLyogdHVybiBvZmYgaGVhZGVyIGNvbnZlcnNpb24gKi8KKyAgICAgICAgICAgIHN0YXR1cyA9IGl4RXRoREJEYXRhYmFzZUNsZWFyKHBvcnRJRCwgSVhfRVRIX0RCX1dJRklfUkVDT1JEKTsKKworICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBJWF9FVEhfREJfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBpeEV0aERCV2lGaUNvbnZlcnNpb25UYWJsZURvd25sb2FkKHBvcnRJRCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyNpZmRlZiBDT05GSUdfV0lUSF9WTEFOIC8qIHRlc3Qtb25seTogVkxBTiBzdXBwb3J0IG5vdCBpbmNsdWRlZCB0byBzYXZlIHNwYWNlISEhICovCisgICAgICAgIGVsc2UgaWYgKGZlYXR1cmUgPT0gSVhfRVRIX0RCX1ZMQU5fUU9TKQorICAgICAgICB7CisgICAgICAgICAgICAvKiB0dXJuIG9mZiBWTEFOL1FvUzoKKyAgICAgICAgICAgICAgICAtIHNldCBhIHByaW9yaXR5IG1hcHBpbmcgdGFibGUgd2l0aCBvbmUgdHJhZmZpYyBjbGFzcworICAgICAgICAgICAgICAgIC0gc2V0IHRoZSBhY2NlcHRhYmxlIGZyYW1lIGZpbHRlciB0byBhY2NlcHQgYWxsCisgICAgICAgICAgICAgICAgLSBzZXQgdGhlIEluZ3Jlc3MgdGFnZ2luZyBtb2RlIHRvIHBhc3MtdGhyb3VnaAorICAgICAgICAgICAgICAgIC0gY2xlYXIgdGhlIFZMQU4gbWVtYmVyc2hpcCBsaXN0CisgICAgICAgICAgICAgICAgLSBjbGVhciB0aGUgVFRJIHRhYmxlCisgICAgICAgICAgICAgICAgLSBzZXQgdGhlIGRlZmF1bHQgODAyLjFRIHRhZyB0byAwIChWTEFOIElEIDAsIFByaSAwLCBDRkkgMCkKKyAgICAgICAgICAgICAgICAtIGRpc2FibGUgVFBJRCBwb3J0IGV4dHJhY3Rpb24KKyAgICAgICAgICAgICovCisKKyAgICAgICAgICAgIC8qIGluaXRpYWxpemUgYWxsID0+IHRyYWZmaWMgY2xhc3MgMCBwcmlvcml0eSBtYXBwaW5nIHRhYmxlICovCisgICAgICAgICAgICBtZW1zZXQgKGRlZmF1bHRQcmlvcml0eVRhYmxlLCAwLCBzaXplb2YgKGRlZmF1bHRQcmlvcml0eVRhYmxlKSk7CisgICAgICAgICAgICBwb3J0SW5mby0+aXhFdGhEQlRyYWZmaWNDbGFzc0NvdW50ID0gMTsKKyAgICAgICAgICAgIHN0YXR1cyA9IGl4RXRoREJQcmlvcml0eU1hcHBpbmdUYWJsZVNldChwb3J0SUQsIGRlZmF1bHRQcmlvcml0eVRhYmxlKTsKKworICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBJWF9FVEhfREJfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBpeEV0aERCQWNjZXB0YWJsZUZyYW1lVHlwZVNldChwb3J0SUQsIElYX0VUSF9EQl9BQ0NFUFRfQUxMX0ZSQU1FUyk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gSVhfRVRIX0RCX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gaXhFdGhEQkluZ3Jlc3NWbGFuVGFnZ2luZ0VuYWJsZWRTZXQocG9ydElELCBJWF9FVEhfREJfUEFTU19USFJPVUdIKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLyogY2xlYXIgbWVtYmVyc2hpcCBhbmQgVFRJIHRhYmxlcyAqLworICAgICAgICAgICAgbWVtc2V0ICh2bGFuU2V0LCAwLCBzaXplb2YgKHZsYW5TZXQpKTsKKworICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBJWF9FVEhfREJfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiB1c2UgdGhlIGludGVybmFsIGZ1bmN0aW9uIHRvIGJ5cGFzcyBQVklEIGNoZWNrICovCisgICAgICAgICAgICAgICAgc3RhdHVzID0gaXhFdGhEQlBvcnRWbGFuVGFibGVTZXQocG9ydElELCBwb3J0SW5mby0+dmxhbk1lbWJlcnNoaXAsIHZsYW5TZXQpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoc3RhdHVzID09IElYX0VUSF9EQl9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIHVzZSB0aGUgaW50ZXJuYWwgZnVuY3Rpb24gdG8gYnlwYXNzIFBWSUQgY2hlY2sgKi8KKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBpeEV0aERCUG9ydFZsYW5UYWJsZVNldChwb3J0SUQsIHBvcnRJbmZvLT50cmFuc21pdFRhZ2dpbmdJbmZvLCB2bGFuU2V0KTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLyogcmVzZXQgdGhlIFBWSUQgKi8KKyAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gSVhfRVRIX0RCX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gaXhFdGhEQlBvcnRWbGFuVGFnU2V0KHBvcnRJRCwgMCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8qIGRpc2FibGUgVFBJRCBwb3J0IGV4dHJhY3Rpb24gKi8KKyAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gSVhfRVRIX0RCX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gaXhFdGhEQlZsYW5Qb3J0RXh0cmFjdGlvbkVuYWJsZShwb3J0SUQsIEZBTFNFKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorI2VuZGlmCisKKyAgICAgICAgaWYgKHN0YXR1cyA9PSBJWF9FVEhfREJfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgLyogY2hlY2tzIHBhc3NlZCwgZGlzYWJsZSAqLworICAgICAgICAgICAgcG9ydEluZm8tPmZlYXR1cmVTdGF0dXMgJj0gfmZlYXR1cmU7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKiByZXN0b3JlIHBvcnQgZW5hYmxlZCBzdGF0ZSAqLworICAgIHBvcnRJbmZvLT5lbmFibGVkID0gcG9ydEVuYWJsZWQ7CisKKyAgICByZXR1cm4gc3RhdHVzOworfQorCisvKioKKyAqIEBicmllZiByZXR1cm5zIHRoZSBzdGF0dXMgb2YgYSBmZWF0dXJlCisgKgorICogQHBhcmFtIHBvcnRJRCBwb3J0IElECisgKiBAcGFyYW0gcHJlc2VudCBsb2NhdGlvbiB0byBzdG9yZSBhIGJvb2xlYW4gdmFsdWUgaW5kaWNhdGluZworICogaWYgdGhlIGZ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BoYXNoVmFsdWUgJSBoYXNoVGFibGUtPm51bUJ1Y2tldHM7CisgICAgSGFzaE5vZGUgKmJ1Y2tldCAgID0gaGFzaFRhYmxlLT5oYXNoQnVja2V0c1tidWNrZXRJbmRleF07CisgICAgSGFzaE5vZGUgKm5ld05vZGU7CisKKyAgICBMb2NrU3RhY2sgbG9ja3M7CisKKyAgICBJTklUX1NUQUNLKCZsb2Nrcyk7CisKKyAgICAvKiBsb2NrIGJ1Y2tldCAqLworICAgIFBVU0hfTE9DSygmbG9ja3MsICZoYXNoVGFibGUtPmJ1Y2tldExvY2tzW2J1Y2tldEluZGV4XSk7CisKKyAgICAvKiBsb2NrIGluc2VydGlvbiBlbGVtZW50IChmaXJzdCBpbiBjaGFpbiksIGlmIGFueSAqLworICAgIGlmIChidWNrZXQgIT0gTlVMTCkKKyAgICB7CisgICAgICAgIFBVU0hfTE9DSygmbG9ja3MsICZidWNrZXQtPmxvY2spOworICAgIH0KKworICAgIC8qIGdldCBuZXcgbm9kZSAqLworICAgIG5ld05vZGUgPSBpeEV0aERCQWxsb2NIYXNoTm9kZSgpOworCisgICAgaWYgKG5ld05vZGUgPT0gTlVMTCkKKyAgICB7CisgICAgICAgIC8qIHVubG9jayBldmVyeXRoaW5nICovCisgICAgICAgIFVOUk9MTF9TVEFDSygmbG9ja3MpOworCisgICAgICAgIHJldHVybiBJWF9FVEhfREJfTk9NRU07CisgICAgfQorCisgICAgLyogaW5pdCBsb2NrIC0gbm90ZSB0aGF0IG11dGV4ZXMgYXJlIHVubG9ja2VkIGFmdGVyIE11dGV4SW5pdCAqLworICAgIGl4T3NhbEZhc3RNdXRleEluaXQoJm5ld05vZGUtPmxvY2spOworCisgICAgLyogcG9wdWxhdGUgbmV3IGxpbmsgKi8KKyAgICBuZXdOb2RlLT5kYXRhID0gZW50cnk7CisKKyAgICAvKiBhZGQgdG8gYnVja2V0ICovCisgICAgbmV3Tm9kZS0+bmV4dCAgICAgICAgICAgICAgICAgICAgICAgPSBidWNr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SygmbG9ja3MsICZub2RlLT5uZXh0LT5sb2NrKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKHByZXZpb3VzTm9kZSA9PSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIG5vZGUgaXMgaGVhZCBvZiBjaGFpbiAqLworICAgICAgICAgICAgICAgIFBVU0hfTE9DSygmbG9ja3MsICZoYXNoVGFibGUtPmJ1Y2tldExvY2tzW2J1Y2tldEluZGV4XSk7CisKKyAgICAgICAgICAgICAgICBoYXNoVGFibGUtPmhhc2hCdWNrZXRzW2J1Y2tldEluZGV4XSA9IG5vZGUtPm5leHQ7CisKKyAgICAgICAgICAgICAgICBQT1BfTE9DSygmbG9ja3MpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIHJlbGluayAqLworICAgICAgICAgICAgICAgIHByZXZpb3VzTm9kZS0+bmV4dCA9IG5vZGUtPm5leHQ7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIFVOUk9MTF9TVEFDSygmbG9ja3MpOworCisgICAgICAgICAgICAvKiBmcmVlIG5vZGUgKi8KKyAgICAgICAgICAgIGhhc2hUYWJsZS0+ZnJlZUZ1bmN0aW9uKG5vZGUtPmRhdGEpOworICAgICAgICAgICAgaXhFdGhEQkZyZWVIYXNoTm9kZShub2RlKTsKKworICAgICAgICAgICAgcmV0dXJuIElYX0VUSF9EQl9TVUNDRVNTOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKHByZXZpb3VzTm9kZSAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIHVubG9jayBwcmV2aW91cyBub2RlICovCisgICAgICAgICAgICAgICAgU0hJRlRfU1RBQ0soJmxvY2tzKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLyogYWR2YW5jZSB0byBuZXh0IGVsZW1lb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ZlcmVuY2UsIG5vZGUtPmRhdGEpKQorICAgICAgICB7CisgICAgICAgICAgICBVTkxPQ0soJm5vZGUtPmxvY2spOworCisgICAgICAgICAgICByZXR1cm4gSVhfRVRIX0RCX1NVQ0NFU1M7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBVTkxPQ0soJm5vZGUtPmxvY2spOworCisgICAgICAgICAgICBub2RlID0gbm9kZS0+bmV4dDsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qIG5vdCBmb3VuZCAqLworICAgIHJldHVybiBJWF9FVEhfREJfTk9fU1VDSF9BRERSOworfQorCisvKioKKyAqIEBicmllZiByZWxlYXNlcyB0aGUgd3JpdGUgYWNjZXNzIGxvY2sKKyAqCisgKiBAcHJlIHRoZSBub2RlIHNob3VsZCBoYXZlIGJlZW4gb2J0YWluZWQgdmlhIEByZWYgaXhFdGhEQlNlYXJjaEhhc2hFbnRyeSgpCisgKgorICogQHNlZSBpeEV0aERCU2VhcmNoSGFzaEVudHJ5KCkKKyAqCisgKiBAaW50ZXJuYWwKKyAqLwordm9pZCBpeEV0aERCUmVsZWFzZUhhc2hOb2RlKEhhc2hOb2RlICpub2RlKQoreworICAgIFVOTE9DSygmbm9kZS0+bG9jayk7Cit9CisKKy8qKgorICogQGJyaWVmIGluaXRpYWxpemVzIGEgaGFzaCBpdGVyYXRvcgorICoKKyAqIEBwYXJhbSBoYXNoVGFibGUgaGFzaCB0YWJsZSB0byBiZSBpdGVyYXRlZAorICogQHBhcmFtIGl0ZXJhdG9yIGl0ZXJhdG9yIG9iamVjdAorICoKKyAqIElmIHRoZSBpbml0aWFsaXphdGlvbiBpcyBzdWNjZXNzZnVsIHRoZSBpdGVyYXRvciB3aWxsIHBvaW50IHRvIHRoZQorICogZmlyc3QgaGFzaCB0YWJsZSByZWNvcmQgKGlmIGFueSkuCisgKiBUZXN0aW5nIGlmIHRoZSBpdGVyYXRvciBoYXMgbm90IHBhc3NlZCB0aG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zZUhhc2hOb2RlKCkgb24gZW50cmllcyBwb2ludGVkIGJ5IHRoZSBpdGVyYXRvciwgYXMgdGhpcworICogbWlnaHQgcGxhY2UgdGhlIGRhdGFiYXNlIGluIGEgcGVybWFuZW50IGludmFsaWQgbG9jayBzdGF0ZQorICoKKyAqIEBpbnRlcm5hbAorICovCitJeEV0aERCU3RhdHVzIGl4RXRoREJJbmNyZW1lbnRIYXNoSXRlcmF0b3IoSGFzaFRhYmxlICpoYXNoVGFibGUsIEhhc2hJdGVyYXRvciAqaXRlcmF0b3IpCit7CisgICAgLyogdW5sZXNzIGl0ZXJhdG9yIGlzIGp1c3QgaW5pdGlhbGl6ZWQuLi4gKi8KKyAgICBpZiAoaXRlcmF0b3ItPm5vZGUgIT0gTlVMTCkKKyAgICB7CisgICAgICAgIC8qIHRyeSBuZXh0IGluIGNoYWluICovCisgICAgICAgIGlmIChpdGVyYXRvci0+bm9kZS0+bmV4dCAhPSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgICBUUllfTE9DSygmaXRlcmF0b3ItPm5vZGUtPm5leHQtPmxvY2spOworCisgICAgICAgICAgICBpZiAoaXRlcmF0b3ItPnByZXZpb3VzTm9kZSAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFVOTE9DSygmaXRlcmF0b3ItPnByZXZpb3VzTm9kZS0+bG9jayk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGl0ZXJhdG9yLT5wcmV2aW91c05vZGUgPSBpdGVyYXRvci0+bm9kZTsKKyAgICAgICAgICAgIGl0ZXJhdG9yLT5ub2RlICAgICAgICAgPSBpdGVyYXRvci0+bm9kZS0+bmV4dDsKKworICAgICAgICAgICAgcmV0dXJuIElYX0VUSF9EQl9TVUNDRVNTOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLyogbGFzdCBpbiBjaGFpbiwgcHJlcGFyZSBmb3IgbmV4dCBidWNrZXQgKi8KKyAgICAgICAgICAgIGl0ZXJhdG9yLT5idWNrZXRJbmRleCsrOworICAgICAgICB9CisgICAgfQorCisgICAvKiB0cnkgbmV4dCB1c2VkIGJ1Y2tldCAqLworICAgIGZvciAoOyBpdGVyYXRvci0+YnVja2V0SW5kZXggPCBoYXNoVGFibGUtPm51bUJ1Y2tldHMgOyBpdGVyYXRvci0+YnVja2V0SW5kZXgrKykKKyAgICB7CisgICAgICAgIEhhc2hOb2RlICoqbm9kZVB0ciA9ICYoaGFzaFRhYmxlLT5oYXNoQnVja2V0c1tpdGVyYXRvci0+YnVja2V0SW5kZXhdKTsKKyAgICAgICAgSGFzaE5vZGUgKm5vZGUgPSAqbm9kZVB0cjsKKyNpZiAoQ1BVIT1TSU1TUEFSQ1NPTEFSSVMpICYmICFkZWZpbmVkIChfX3dpbmNlKQorICAgICAgICBpZiAoKChpdGVyYXRvci0+YnVja2V0SW5kZXggJiBJWF9FVEhEQl9CVUNLRVRfSU5ERVhfTUFTSykgPT0gMCkgJiYKKyAgICAgICAgICAgIChpdGVyYXRvci0+YnVja2V0SW5kZXggPCAoaGFzaFRhYmxlLT5udW1CdWNrZXRzIC0gSVhfRVRIREJfQlVDS0VUUFRSX0FIRUFEKSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIHByZWxvYWQgbmV4dCBjYWNoZSBsaW5lICgyIGNhY2hlIGxpbmUgYWhlYWQpICovCisgICAgICAgICAgICBub2RlUHRyICs9IElYX0VUSERCX0JVQ0tFVFBUUl9BSEVBRDsKKyAgICAgICAgICAgIF9fYXNtX18gKCJwbGQgWyUwXTtcbiI6IDogInIiIChub2RlUHRyKSk7CisgICAgICAgIH0KKyNlbmRpZgorICAgICAgICBpZiAobm9kZSAhPSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgICBUUllfTE9DSygmbm9kZS0+bG9jayk7CisKKyAgICAgICAgICAgIC8qIHVubG9jayBsYXN0IG9uZSBvciB0d28gbm9kZXMgaW4gdGhlIHByZXZpb3VzIGNoYWluICovCisgICAgICAgICAgICBpZiAoaXRlcmF0b3ItPm5vZGUgIT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBVTkxPQ0soJml0ZXJhdG9yLT5ub2RlLT5sb2NrKTsKKworICAgICAgICAgICAgICAgIGlmIChpdGVyYXRvci0+cHJldmlvdXNOb2RlICE9IE5VTEwpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBVTkxPQ0soJml0ZXJhdG9yLT5wcmV2aW91c05vZGUtPmxvY2spOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAorICAgICAgICAgICAgLyogcmVkaXJlY3QgaXRlcmF0b3IgKi8KKyAgICAgICAgICAgIGl0ZXJhdG9yLT5wcmV2aW91c05vZGUgPSBOVUxMOworICAgICAgICAgICAgaXRlcmF0b3ItPm5vZGUgICAgICAgICA9IG5vZGU7CisKKyAgICAgICAgICAgIHJldHVybiBJWF9FVEhfREJfU1VDQ0VTUzsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qIGNvdWxkIG5vdCBhZHZhbmNlIGl0ZXJhdG9yICovCisgICAgaWYgKGl0ZXJhdG9yLT5ub2RlICE9IE5VTEwpCisgICAgeworICAgICAgICBVTkxPQ0soJml0ZXJhdG9yLT5ub2RlLT5sb2NrKTsKKworICAgICAgICBpZiAoaXRlcmF0b3ItPnByZXZpb3VzTm9kZSAhPSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgICBVTkxPQ0soJml0ZXJhdG9yLT5wcmV2aW91c05vZGUtPmxvY2spOworICAgICAgICB9CisKKyAgICAgICAgaXRlcmF0b3ItPm5vZGUgPSBOVUxMOworICAgIH0KKworICAgIHJldHVybiBJWF9FVEhfREJfRU5EOworfQorCisvKioKKyAqIEBicmllZiByZW1vdmVzIGFuIGVudHJ5IHBvaW50ZWQgYnkgYW4gaXRlcmF0b3IKKyAqCisgKiBAcGFyYW0gaGFzaFRhYmxlIGl0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6YXRpb24gdGltZSBieSBAcmVmIGl4RXRoREJJbml0KCkuCisgKgorICogQGludGVybmFsCisgKi8KK0lYX0VUSF9EQl9QVUJMSUMKK3ZvaWQgaXhFdGhEQkluaXRNZW1vcnlQb29scyh2b2lkKQoreworICAgIGludCBsb2NhbF9pbmRleDsKKworICAgIC8qIEhhc2hOb2RlIHBvb2wgKi8KKyAgICBpeE9zYWxNdXRleEluaXQoJm5vZGVQb29sTG9jayk7CisKKyAgICBmb3IgKGxvY2FsX2luZGV4ID0gMCA7IGxvY2FsX2luZGV4IDwgTk9ERV9QT09MX1NJWkUgOyBsb2NhbF9pbmRleCsrKQorICAgIHsKKyAgICAgICAgSGFzaE5vZGUgKmZyZWVOb2RlID0gJm5vZGVQb29sQXJlYVtsb2NhbF9pbmRleF07CisKKyAgICAgICAgZnJlZU5vZGUtPm5leHRGcmVlID0gbm9kZVBvb2w7CisgICAgICAgIG5vZGVQb29sICAgICAgICAgICA9IGZyZWVOb2RlOworICAgIH0KKworICAgIC8qIE1hY0Rlc2NyaXB0b3IgcG9vbCAqLworICAgIGl4T3NhbE11dGV4SW5pdCgmbWFjUG9vbExvY2spOworCisgICAgZm9yIChsb2NhbF9pbmRleCA9IDAgOyBsb2NhbF9pbmRleCA8IE1BQ19QT09MX1NJWkUgOyBsb2NhbF9pbmRleCsrKQorICAgIHsKKyAgICAgICAgTWFjRGVzY3JpcHRvciAqZnJlZURlc2NyaXB0b3IgPSAmbWFjUG9vbEFyZWFbbG9jYWxfaW5kZXhdOworCisgICAgICAgIGZyZWVEZXNjcmlwdG9yLT5uZXh0RnJlZSA9IG1hY1Bvb2w7CisgICAgICAgIG1hY1Bvb2wgICAgICAgICAgICAgICAgICA9IGZyZWVEZXNjcmlwdG9yOworICAgIH0KKworICAgIC8qIE1hY1RyZWVOb2RlIHBvb2wgKi8KKyAgICBpeE9zYWxNdXRleEluaXQoJnRyZWVQb29sTG9jayk7CisKKyAgICBmb3IgKGxvY2FsX2luZGV4ID0gMCA7IGxvY2FsX2luZGV4IDwgVFJFRV9QT09MX1NJWkUgOyBsb2NhbF9pbmRleCsrKQorICAgIHsKKyAgICAgICAgTWFjVHJlZU5vZGUgKmZyZWVOb2RlID0gJnRyZWVQb29sQXJlYVtsb2NhbF9pbmRleF07CisKKyAgICAgICAgZnJlZU5vZGUtPm5leHRGcmVlID0gdHJlZVBvb2w7CisgICAgICAgIHRyZWVQb29sICAgICAgICAgICA9IGZyZWVOb2RlOworICAgIH0KK30KKworLyoqCisgKiBAYnJpZWYgYWxsb2NhdGVzIGEgaGFzaCBub2RlIGZyb20gdGhlIHBvb2wKKyAqCisgKiBBbGxvY2F0ZXMgYSBoYXNoIG5vZGUgYW5kIHJlc2V0cyBpdHMgdmFsdWUuCisgKgorICogQHJldHVybiB0aGUgYWxsb2NhdGVkIGhhc2ggbm9kZSBvciBOVUxMIGlmIHRoZSBwb29sIGlzIGVtcHR5CisgKgorICogQGludGVybmFsCisgKi8KK0lYX0VUSF9EQl9QVUJMSUMKK0hhc2hOb2RlKiBpeEV0aERCQWxsb2NIYXNoTm9kZSh2b2lkKQoreworICAgIEhhc2hOb2RlICphbGxvY2F0ZWROb2RlID0gTlVMTDsKKworICAgIGlmIChub2RlUG9vbCAhPSBOVUxMKQorICAgIHsKKyAgICAgICAgTE9DS19OT0RFX1BPT0w7CisKKyAgICAgICAgYWxsb2NhdGVkTm9kZSA9IG5vZGVQb29sOworICAgICAgICBub2RlUG9vbCAgICAgID0gbm9kZVBvb2wtPm5leHRGcmVlOworCisgICAgICAgIFVOTE9DS19OT0RFX1BPT0w7CisKKyAgICAgICAgbWVtc2V0KGFsbG9jYXRlZE5vZGUsIDAsIHNpemVvZihIYXNoTm9kZSkpOworICAgIH0KKworICAgIHJldHVybiBhbGxvY2F0ZWROb2RlOworfQorCisvKioKKyAqIEBicmllZiBmcmVlcyBhIGhhc2ggbm9kZSBpbnRvIHRoZSBwb29sCisgKgorICogQHBhcmFtIGhhc2hOb2RlIG5vZGUgdG8gYmU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gKiBJZiB0aGUgcmVmZXJlbmNlIGNvdW50IHJlYWNoZXMgMCAoc3RydWN0dXJlIGlzIG5vIGxvbmdlciB1c2VkIGFueXdoZXJlKQorICogdGhlbiB0aGUgZGVzY3JpcHRvciBpcyBmcmVlZCBiYWNrIGludG8gdGhlIHBvb2wgdXNpbmcgaXhFdGhEQlBvb2xGcmVlTWFjRGVzY3JpcHRvcigpLgorICoKKyAqIEBzZWUgaXhFdGhEQlBvb2xGcmVlTWFjRGVzY3JpcHRvcigpCisgKgorICogQGludGVybmFsCisgKi8KK0lYX0VUSF9EQl9QVUJMSUMKK3ZvaWQgaXhFdGhEQkZyZWVNYWNEZXNjcmlwdG9yKE1hY0Rlc2NyaXB0b3IgKm1hY0Rlc2NyaXB0b3IpCit7CisgICAgaWYgKG1hY0Rlc2NyaXB0b3IgIT0gTlVMTCkKKyAgICB7CisgICAgICAgIExPQ0tfTUFDX1BPT0w7CisKKyAgICAgICAgaWYgKG1hY0Rlc2NyaXB0b3ItPnJlZkNvdW50ID4gMCkKKyAgICAgICAgeworICAgICAgICAgICAgbWFjRGVzY3JpcHRvci0+cmVmQ291bnQtLTsKKworICAgICAgICAgICAgaWYgKG1hY0Rlc2NyaXB0b3ItPnJlZkNvdW50ID09IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVU5MT0NLX01BQ19QT09MOworCisgICAgICAgICAgICAgICAgaXhFdGhEQlBvb2xGcmVlTWFjRGVzY3JpcHRvcihtYWNEZXNjcmlwdG9yKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBVTkxPQ0tfTUFDX1BPT0w7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBVTkxPQ0tfTUFDX1BPT0w7CisgICAgICAgIH0KKyAgICB9Cit9CisKKy8qKgorICogQGJyaWVmIGNsb25lcyBhIG1hYyB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ICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIGNsb25lZE1hY05vZGU7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHJldHVybiBOVUxMOworICAgIH0KK30KKworI2lmbmRlZiBOREVCVUcKKy8qIERlYnVnIHN0YXRpc3RpY2FsIGZ1bmN0aW9ucyBmb3IgbWVtb3J5IHVzYWdlICovCisKK2V4dGVybiBIYXNoVGFibGUgZGJIYXNodGFibGU7CitpbnQgaXhFdGhEQk51bUhhc2hFbGVtZW50cyh2b2lkKTsKKworaW50IGl4RXRoREJOdW1IYXNoRWxlbWVudHModm9pZCkKK3sgICAKKyAgICBVSU5UMzIgYnVja2V0SW5kZXg7CisgICAgaW50IG51bUVsZW1lbnRzID0gMDsKKyAgICBIYXNoVGFibGUgKmhhc2hUYWJsZSA9ICZkYkhhc2h0YWJsZTsKKworICAgIGZvciAoYnVja2V0SW5kZXggPSAwIDsgYnVja2V0SW5kZXggPCBoYXNoVGFibGUtPm51bUJ1Y2tldHMgOyBidWNrZXRJbmRleCsrKQorICAgIHsKKyAgICAgICAgaWYgKGhhc2hUYWJsZS0+aGFzaEJ1Y2tldHNbYnVja2V0SW5kZXhdICE9IE5VTEwpCisgICAgICAgIHsKKyAgICAgICAgICAgIEhhc2hOb2RlICpub2RlID0gaGFzaFRhYmxlLT5oYXNoQnVja2V0c1tidWNrZXRJbmRleF07CisKKyAgICAgICAgICAgIHdoaWxlIChub2RlICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbnVtRWxlbWVudHMrKzsKKworICAgICAgICAgICAgICAgIG5vZGUgPSBub2RlLT5uZXh0OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIG51bUVsZW1lbnRzOworfQorCitVSU5UMzIgaXhFdGhEQlNlYXJjaFRyZWVVc2FnZUdldChNYWNUcmVlTm9kZSAqdHJlZSkKK3sKKyAgICBpZiAodHJlZSA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgcmV0dXJuIDA7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHJldHVybiAxIC8qIHRoaXMgbm9kZSAqLyArIGl4RXRoREJTZWFyY2hUcmVlVXNhZ2VHZXQodHJlZS0+bGVmdCkgKyBpeEV0aERCU2VhcmNoVHJlZVVzYWdlR2V0KHRyZWUtPnJpZ2h0KTsKKyAgICB9Cit9CisKK2ludCBpeEV0aERCU2hvd01lbW9yeVN0YXR1cyh2b2lkKQoreworICAgIE1hY0Rlc2NyaXB0b3IgKm1hYzsKKyAgICBNYWNUcmVlTm9kZSAqdHJlZTsKKyAgICBIYXNoTm9kZSAqbm9kZTsKKworICAgIGludCBtYWNDb3VudGVyICA9IDA7CisgICAgaW50IHRyZWVDb3VudGVyID0gMDsKKyAgICBpbnQgbm9kZUNvdW50ZXIgPSAwOworCisgICAgaW50IHRvdGFsVHJlZVVzYWdlICAgICAgICAgICAgPSAwOworICAgIGludCB0b3RhbERlc2NyaXB0b3JVc2FnZSAgICAgID0gMDsKKyAgICBpbnQgdG90YWxDbG9uZURlc2NyaXB0b3JVc2FnZSA9IDA7CisgICAgaW50IHRvdGFsTm9kZVVzYWdlICAgICAgICAgICAgPSAwOworCisgICAgVUlOVDMyIHBvcnRJbmRleDsKKworICAgIExPQ0tfTk9ERV9QT09MOworICAgIExPQ0tfTUFDX1BPT0w7CisgICAgTE9DS19UUkVFX1BPT0w7CisKKyAgICBtYWMgID0gbWFjUG9vbDsKKyAgICB0cmVlID0gdHJlZVBvb2w7CisgICAgbm9kZSA9IG5vZGVQb29sOworCisgICAgd2hpbGUgKG1hYyAhPSBOVUxMKQorICAgIHsKKyAgICAgICAgbWFjQ291bnRlcisrOworCisgICAgICAgIG1hYyA9IG1hYy0+bmV4dEZyZWU7CisKKyAgICAgICAgaWYgKG1hY0NvdW50ZXIgPiBNQUNfUE9PTF9TSVpFKQorICAgICAgICB7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICAgIHdoaWxlICh0cmVlICE9IE5VTEwpCisgICAgeworICAgICAgICB0cmVlQ291bnRlcisrOworCisgICAgICAgIHRyZWUgPSB0cmVlLT5uZXh0RnJlZTsKKworICAgICAgICBpZiAodHJlZUNvdW50ZXIgPiBUUkVFX1BPT0xfU0laRSkKKyAgICAgICAgeworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisKKyAgICB3aGlsZSAobm9kZSAhPSBOVUxMKQorICAgIHsKKyAgICAgICAgbm9kZUNvdW50ZXIrKzsKKworICAgICAgICBub2RlID0gbm9kZS0+bmV4dEZyZWU7CisKKyAgICAgICAgaWYgKG5vZGVDb3VudGVyID4gTk9ERV9QT09MX1NJWkUpCisgICAgICAgIHsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorCisgICAgZm9yIChwb3J0SW5kZXggPSAwIDsgcG9ydEluZGV4IDwgSVhfRVRIX0RCX05VTUJFUl9PRl9QT1JUUyA7IHBvcnRJbmRleCsrKQorICAgIHsKKyAgICAgICAgaW50IHRyZWVVc2FnZSA9IGl4RXRoREJTZWFyY2hUcmVlVXNhZ2VHZXQoaXhFdGhEQlBvcnRJbmZvW3BvcnRJbmRleF0udXBkYXRlTWV0aG9kLnNlYXJjaFRyZWUpOworCisgICAgICAgIHRvdGFsVHJlZVVzYWdlICAgICAgICAgICAgKz0gdHJlZVVzYWdlOworICAgICAgICB0b3RhbENsb25lRGVzY3JpcHRvclVzYWdlICs9IHRyZWVVc2FnZTsgLyogZWFjaCB0cmVlIG5vZGUgY29udGFpbnMgYSBkZXNjcmlwdG9yICovCisgICAgfQorCisgICAgdG90YWxOb2RlVXNhZ2UgICAgICAgID0gaXhFdGhEQk51bUhhc2hFbGVtZW50cygpOworICAgIHRvdGFsRGVzY3JpcHRvclVzYWdlICs9IHRvdGFsTm9kZVVzYWdlOyAvKiBlYWNoIGhhc2ggdGFibGUgZW50cnkgY29udGFpbnMg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ZXh0RnJlZTsKKworICAgICAgICAgICAgd2hpbGUgKGNvbXBhcmlzb24gIT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAocmVmZXJlbmNlID09IGNvbXBhcmlzb24pCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwcmludGYoIldhcm5pbmc6IHJlYWNoZWQgYSBkdXBsaWNhdGUgKCVwKSwgaW52YWxpZCBNQUMgcG9vbCBzdGF0ZVxuIiwgcmVmZXJlbmNlKTsKKworICAgICAgICAgICAgICAgICAgICByZXR1cm4gMTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBjb21wYXJpc29uID0gY29tcGFyaXNvbi0+bmV4dEZyZWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHJlZmVyZW5jZSA9IHJlZmVyZW5jZS0+bmV4dEZyZWU7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcmludGYoIk5vIGR1cGxpY2F0ZXMgZm91bmQgaW4gdGhlIE1BQyBwb29sIChzYW5pdHkgY2hlY2sgb2spXG4iKTsKKworICAgIHJldHVybiAwOworfQorCisjZW5kaWYgLyogTkRFQlVHICovCisKKy8qKgorICogQH0gRXRoTWVtb3J5TWFuYWdlbWVudAorICovCmRpZmYgLS1naXQgYS9jcHUvaXhwL25wZS9JeEV0aERCTlBFQWRhcHRvci5jIGIvY3B1L2l4cC9ucGUvSXhFdGhEQk5QRUFkYXB0b3IuYwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4xMTJhNDZjCi0tLSAvZGV2L251bGwKKysrIGIvY3B1L2l4cC9ucGUvSXhFdGhEQk5QRUFkYXB0b3IuYwpAQCAtMCwwICsxLDcxOSBAQAorLyoqCisgKiBAZmlsZSBJeEV0aERCREJOUEVBZGFwdG9yLmMKKyAqCisgKiBAYnJpZWYgUm91dGluZXMgdGhhdCByZWFkIGFuZCB3cml0ZSBsZWFybmluZy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XBkYXRlWm9uZSA9IElYX09TQUxfQ0FDSEVfRE1BX01BTExPQyhGVUxMX0dXX0JZVEVfU0laRSk7CisgICAgICAgICAgICB1cGRhdGUtPnZsYW5VcGRhdGVab25lICA9IElYX09TQUxfQ0FDSEVfRE1BX01BTExPQyhGVUxMX1ZMQU5fQllURV9TSVpFKTsKKworICAgICAgICAgICAgaWYgKHVwZGF0ZS0+bnBlVXBkYXRlWm9uZSA9PSBOVUxMCisgICAgICAgICAgICAgICAgfHwgdXBkYXRlLT5ucGVHd1VwZGF0ZVpvbmUgPT0gTlVMTAorICAgICAgICAgICAgICAgIHx8IHVwZGF0ZS0+dmxhblVwZGF0ZVpvbmUgPT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBFUlJPUl9MT0coIkZhdGFsIGVycm9yOiBJWF9BQ0NfRFJWX0RNQV9NQUxMT0MoKSByZXR1cm5lZCBOVUxMLCBubyBOUEUgdXBkYXRlIHpvbmVzIGF2YWlsYWJsZVxuIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbWVtc2V0KHVwZGF0ZS0+bnBlVXBkYXRlWm9uZSwgMCwgRlVMTF9FTFRfQllURV9TSVpFKTsKKyAgICAgICAgICAgICAgICBtZW1zZXQodXBkYXRlLT5ucGVHd1VwZGF0ZVpvbmUsIDAsIEZVTExfR1dfQllURV9TSVpFKTsKKyAgICAgICAgICAgICAgICBtZW1zZXQodXBkYXRlLT52bGFuVXBkYXRlWm9uZSwgMCwgRlVMTF9WTEFOX0JZVEVfU0laRSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICAvKiB1bnVzZWQgKi8KKyAgICAgICAgICAgIHVwZGF0ZS0+bnBlVXBkYXRlWm9uZSAgID0gTlVMTDsKKyAgICAgICAgICAgIHVwZGF0ZS0+bnBlR3dVcGRhdGVab25l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sKKyAgICAgICAgfQorICAgIH0KK30KKworLyoqCisgKiBAYnJpZWYgZ2VuZXJhbC1wdXJwb3NlIE5QRSBjYWxsYmFjayBmdW5jdGlvbgorICoKKyAqIEBwYXJhbSBucGVJRCBOUEUgSUQKKyAqIEBwYXJhbSBtc2cgTlBFIG1lc3NhZ2UKKyAqCisgKiBUaGlzIGZ1bmN0aW9uIHdpbGwgdW5ibG9jayB0aGUgY2FsbGVyIGJ5IHVubG9ja2luZworICogdGhlIG5wZUFja0xvY2sgbXV0ZXggZGVmaW5lZCBmb3IgZWFjaCBOUEUgcG9ydAorICoKKyAqIEBpbnRlcm5hbAorICovCitJWF9FVEhfREJfUFVCTElDCit2b2lkIGl4RXRoREJOcGVNc2dBY2soSXhOcGVNaE5wZUlkIG5wZUlELCBJeE5wZU1oTWVzc2FnZSBtc2cpCit7CisgICAgSXhFdGhEQlBvcnRJZCBwb3J0SUQgPSBJWF9FVEhfREJfTlBFX1RPX1BPUlRfSUQobnBlSUQpOworICAgIFBvcnRJbmZvICpwb3J0SW5mbzsKKworICAgIGlmIChwb3J0SUQgPj0gSVhfRVRIX0RCX05VTUJFUl9PRl9QT1JUUykKKyAgICB7CisgICAgICAgIC8qIGludmFsaWQgcG9ydCAqLworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgaWYgKGl4RXRoREJQb3J0RGVmaW5pdGlvbnNbcG9ydElEXS50eXBlICE9IElYX0VUSF9OUEUpCisgICAgeworICAgICAgICAvKiBub3QgYW4gTlBFICovCisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBwb3J0SW5mbyA9ICZpeEV0aERCUG9ydEluZm9bcG9ydElEXTsKKyAgICAKKyAgICBpeE9zYWxNdXRleFVubG9jaygmcG9ydEluZm8tPm5wZUFja0xvY2spOworfQorCisvKioKKyAqIEBicmllZiBzeW5jaHJvbml6ZXMgdGhlIGRhdGFiYXNlIHdpdGggdHJlZQorICoKKyAqIEBwYXJhbSBwb3J0SUQgcG9ydCBJRCBv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kZUFkZHJlc3MpKTsKKworICAgICAgICAgICAgLyogY2hlY2sgb25seSBhY3RpdmUgZW50cmllcyBiZWxvbmdpbmcgdG8gdGhpcyBwb3J0ICovCisgICAgICAgICAgICBpZiAoaXhFdGhEQlBvcnRJbmZvW3BvcnRJRF0uYWdpbmdFbmFibGVkICYmIElYX0VEQl9OUEVfTk9ERV9BQ1RJVkUoZWx0Tm9kZUFkZHJlc3MpICYmIChwb3J0SUQgPT0gZW50cnlQb3J0SUQpCisgICAgICAgICAgICAgICAgJiYgKChpeEV0aERCUG9ydERlZmluaXRpb25zW3BvcnRJRF0uY2FwYWJpbGl0aWVzICYgSVhfRVRIX0VOVFJZX0FHSU5HKSA9PSAwKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBzZWFyY2ggcmVjb3JkICovCisgICAgICAgICAgICAgICAgSGFzaE5vZGUgKm5vZGUgPSBpeEV0aERCU2VhcmNoKChJeEV0aERCTWFjQWRkciAqKSBlbHROb2RlQWRkcmVzcywgSVhfRVRIX0RCX0FMTF9GSUxURVJJTkdfUkVDT1JEUyk7CisKKyAgICAgICAgICAgICAgICAvKiBzYWZldHkgY2hlY2ssIG1heWJlIHVzZXIgZGVsZXRlZCByZWNvcmQgcmlnaHQgYmVmb3JlIHN5bmM/ICovCisgICAgICAgICAgICAgICAgaWYgKG5vZGUgIT0gTlVMTCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8qIGZvdW5kIHJlY29yZCAqLworICAgICAgICAgICAgICAgICAgICBNYWNEZXNjcmlwdG9yICpkZXNjcmlwdG9yID0gKE1hY0Rlc2NyaXB0b3IgKikgbm9kZS0+ZGF0YTsKKworICAgICAgICAgICAgICAgICAgICBJWF9FVEhfREJfTlBFX1ZFUkJPU0VfVFJBQ0UoIkRCOiAoTlBFQWRhcHRvcikgc3luY2VkIGVudHJ5IFslc10gYWxyZWFkeSBpbiB0aGUgZGF0YWJhc2UsIHVwZGF0aW5nIGZpZWxkc1xuIiwgbWFjMnN0cmluZyhlbHROb2RlQWRkcmVzcykpOworCisgICAgICAgICAgICAgICAgICAgIC8qIHJlc2V0IGFnZSAtIHNldCB0byAtMSBzbyB0aGF0IG1haW50ZW5hbmNlIHdpbGwgcmVzdG9yZSBpdCB0byAwIChvciBtb3JlKSB3aGVuIGluY3JlbWVudGluZyAqLworICAgICAgICAgICAgICAgICAgICBpZiAoIWRlc2NyaXB0b3ItPnJlY29yZERhdGEuZmlsdGVyaW5nRGF0YS5zdGF0aWNFbnRyeSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRlc2NyaXB0b3ItPnR5cGUgPT0gSVhfRVRIX0RCX0ZJTFRFUklOR19SRUNPUkQpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+cmVjb3JkRGF0YS5maWx0ZXJpbmdEYXRhLmFnZSA9IEFHRV9SRVNFVDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGRlc2NyaXB0b3ItPnR5cGUgPT0gSVhfRVRIX0RCX0ZJTFRFUklOR19WTEFOX1JFQ09SRCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5yZWNvcmREYXRhLmZpbHRlcmluZ1ZsYW5EYXRhLmFnZSA9IEFHRV9SRVNFVDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIC8qIGVuZCB0cmFuc2FjdGlvbiAqLworICAgICAgICAgICAgICAgICAgICBpeEV0aERCUmVsZWFzZUhhc2hOb2RlKG5vZGUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICA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lOVDMyICplcERlbHRhLCBVSU5UMzIgKmJsb2NrcykKK3sKKyAgICBNYWNUcmVlTm9kZVN0YWNrICpzdGFjazsKKyAgICBVSU5UMzIgbWF4T2Zmc2V0ID0gMDsKKyAgICBVSU5UMzIgZW1wdHlPZmZzZXQ7CisKKyAgICBzdGFjayA9IGl4T3NhbENhY2hlRG1hTWFsbG9jKHNpemVvZiAoTWFjVHJlZU5vZGVTdGFjaykpOworICAgIAorICAgIGlmIChzdGFjayA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgRVJST1JfTE9HKCJEQjogKE5QRUFkYXB0b3IpIGZhaWxlZCB0byBhbGxvY2F0ZSB0aGUgbm9kZSBzdGFjayBmb3IgbGVhcm5pbmcgdHJlZSBsaW5lYXJpemF0aW9uLCBvdXQgb2YgbWVtb3J5P1xuIik7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICAvKiB6ZXJvIG91dCBlbXB0eSByb290ICovCisgICAgbWVtc2V0KGJhc2VBZGRyZXNzLCAwLCBFTFRfRU5UUllfU0laRSk7CisKKyAgICBOT0RFX1NUQUNLX0lOSVQoc3RhY2spOworCisgICAgaWYgKHRyZWUgIT0gTlVMTCkKKyAgICB7CisgICAgICAgIC8qIHB1c2ggdHJlZSByb290IGF0IG9mZnNldCAxICovCisgICAgICAgIE5PREVfU1RBQ0tfUFVTSChzdGFjaywgdHJlZSwgMSk7CisKKyAgICAgICAgbWF4T2Zmc2V0ID0gMTsKKyAgICB9CisKKyAgICB3aGlsZSAoTk9ERV9TVEFDS19OT05FTVBUWShzdGFjaykpCisgICAgeworICAgICAgICBNYWNUcmVlTm9kZSAqbm9kZTsKKyAgICAgICAgVUlOVDMyIG9mZnNldDsKKworICAgICAgICBOT0RFX1NUQUNLX1BPUChzdGFjaywgbm9kZSwgb2Zmc2V0KTsKKworICAgICAgICAvKiB1cGRhdGUgbWF4aW11bSBvZmZzZXQgKi8KKyAgICAgICAgaWYgKG9mZnNldCA+IG1heE9mZnNldCkKKyAgICAgICAgeworICAgICAgICAgICAgbWF4T2Zmc2V0ID0gb2Zmc2V0OworICAgICAgICB9CisKKyAgICAgICAgSVhfRVRIX0RCX05QRV9WRVJCT1NFX1RSQUNFKCJEQjogKE5QRUFkYXB0b3IpIHdyaXRpbmcgTUFDIFslc10gYXQgb2Zmc2V0ICVkXG4iLCBtYWMyc3RyaW5nKG5vZGUtPmRlc2NyaXB0b3ItPm1hY0FkZHJlc3MpLCBvZmZzZXQpOworCisgICAgICAgIC8qIGFkZCBub2RlIHRvIE5QRSBFTFQgYXQgcG9zaXRpb24gaW5kaWNhdGVkIGJ5IG9mZnNldCAqLworICAgICAgICBpZiAob2Zmc2V0IDwgTUFYX0VMVF9TSVpFKQorICAgICAgICB7CisgICAgICAgICAgICBpeEV0aERCTlBFTm9kZVdyaXRlW3R5cGVdKCh2b2lkICopICgoKFVJTlQzMikgYmFzZUFkZHJlc3MpICsgb2Zmc2V0ICogRUxUX0VOVFJZX1NJWkUpLCBub2RlKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChub2RlLT5sZWZ0ICE9IE5VTEwpCisgICAgICAgIHsKKyAgICAgICAgICAgIE5PREVfU1RBQ0tfUFVTSChzdGFjaywgbm9kZS0+bGVmdCwgTEVGVF9DSElMRF9PRkZTRVQob2Zmc2V0KSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICAvKiBlbnN1cmUgdGhpcyBlbnRyeSBpcyB6ZXJvZWQgKi8KKyAgICAgICAgICAgIG1lbXNldCgodm9pZCAqKSAoKFVJTlQzMikgYmFzZUFkZHJlc3MgKyBMRUZUX0NISUxEX09GRlNFVChvZmZzZXQpICogRUxUX0VOVFJZX1NJWkUpLCAwLCBFTFRfRU5UUllfU0laRSk7CisgICAgICAgIH0KKworICAgICAgICBpZiAobm9kZS0+cmlnaHQgIT0gTlVMTCkKKyAgICAgICAgeworICAgICAgICAgICAgTk9ERV9TVEFDS19QVVNIKHN0YWNrLC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GF5CisgKiB0aGUgaGlzdG9yeSBvZiBtZXNzYWdlcyBzZW50IHRvIHRoZSBOUEVzICh1cCB0byAxMDApLgorICovCitJWF9FVEhfREJfUFVCTElDCit2b2lkIGl4RXRoREJTaG93TnBlTXNnSGlzdG9yeSgpCit7CisgICAgVUlOVDMyIGkgPSAwOworICAgIFVJTlQzMiBiYXNlLCBsZW47CisKKyAgICBpZiAobnBlTXNnSGlzdG9yeUxlbiA8PSBJWF9FVEhfREJfTlBFX01TR19ISVNUT1JZX0RFUFRIKQorICAgIHsKKyAgICAgICAgYmFzZSA9IDA7CisgICAgICAgIGxlbiAgPSBucGVNc2dIaXN0b3J5TGVuOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBiYXNlID0gbnBlTXNnSGlzdG9yeUxlbiAlIElYX0VUSF9EQl9OUEVfTVNHX0hJU1RPUllfREVQVEg7CisgICAgICAgIGxlbiAgPSBJWF9FVEhfREJfTlBFX01TR19ISVNUT1JZX0RFUFRIOworICAgIH0KKworICAgIHByaW50ZigiTlBFIG1lc3NhZ2UgaGlzdG9yeSBbbGFzdCAlZCBtZXNzYWdlcywgZnJvbSBsZWFzdCB0byBtb3N0IHJlY2VudF06XG4iLCBsZW4pOworCisgICAgZm9yICg7IGkgPCBsZW4gOyBpKyspCisgICAgeworICAgICAgICBVSU5UMzIgcG9zID0gKGJhc2UgKyBpKSAlIElYX0VUSF9EQl9OUEVfTVNHX0hJU1RPUllfREVQVEg7CisgICAgICAgIHByaW50ZigibXNnWyVkXTogMHglMDh4OjB4JTA4eFxuIiwgaSwgbnBlTXNnSGlzdG9yeVtwb3NdWzBdLCBucGVNc2dIaXN0b3J5W3Bvc11bMV0pOworICAgIH0KK30KKworSVhfRVRIX0RCX1BVQkxJQwordm9pZCBpeEV0aERCRUxUU2hvdyhJeEV0aERCUG9ydElkIHBvcnRJRCkKK3sKKyAgICBJeE5wZU1oTWVzc2FnZSBtZXNzYWdlOworICAgIElYX1NUQVRVUyByZXN1bHQ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KKyAgICAgICAgICAgICAgICBwcmludGYoIiVzIC0gcG9ydCAlZCAtICVzICIsIG1hYzJzdHJpbmcoKHVuc2lnbmVkIGNoYXIgKikgZWx0Tm9kZUFkZHJlc3MpLCBlbnRyeVBvcnRJRCwgCisgICAgICAgICAgICAgICAgICAgIElYX0VEQl9OUEVfTk9ERV9BQ1RJVkUoZWx0Tm9kZUFkZHJlc3MpID8gImFjdGl2ZSIgOiAiaW5hY3RpdmUiKTsKKworICAgICAgICAgICAgICAgIC8qIHNhZmV0eSBjaGVjaywgbWF5YmUgdXNlciBkZWxldGVkIHJlY29yZCByaWdodCBiZWZvcmUgc3luYz8gKi8KKyAgICAgICAgICAgICAgICBpZiAobm9kZSAhPSBOVUxMKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLyogZm91bmQgcmVjb3JkICovCisgICAgICAgICAgICAgICAgICAgIE1hY0Rlc2NyaXB0b3IgKmRlc2NyaXB0b3IgPSAoTWFjRGVzY3JpcHRvciAqKSBub2RlLT5kYXRhOworCisgICAgICAgICAgICAgICAgICAgIHByaW50ZigiLSAlcyAiLAorICAgICAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+dHlwZSA9PSBJWF9FVEhfREJfRklMVEVSSU5HX1JFQ09SRCA/ICJmaWx0ZXJpbmciIDoKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPnR5cGUgPT0gSVhfRVRIX0RCX0ZJTFRFUklOR19WTEFOX1JFQ09SRCA/ICJ2bGFuIiA6CisgICAgICAgICAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT50eXBlID09IElYX0VUSF9EQl9XSUZJX1JFQ09SRCA/ICJ3aWZpIiA6ICJvdGhlciAoY2hlY2sgbWFpbiBEQikiKTsKKworICAgICAgICAgICAgICAgICAgICBpZiAoZGVzY3JpcHRvci0+dHlwZSA9PSBJWF9FVEhfREJfRklMVEVSSU5HX1JFQ09SRCkgcHJpbnRmKCItIGFnZSAlZCAtICVzICIsIAorICAgICAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+cmVjb3JkRGF0YS5maWx0ZXJpbmdEYXRhLmFnZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPnJlY29yZERhdGEuZmlsdGVyaW5nRGF0YS5zdGF0aWNFbnRyeSA/ICJzdGF0aWMiIDogImR5bmFtaWMiKTsKKworICAgICAgICAgICAgICAgICAgICBpZiAoZGVzY3JpcHRvci0+dHlwZSA9PSBJWF9FVEhfREJfRklMVEVSSU5HX1ZMQU5fUkVDT1JEKSBwcmludGYoIi0gYWdlICVkIC0gJXMgLSB0Y2kgJWQgIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPnJlY29yZERhdGEuZmlsdGVyaW5nVmxhbkRhdGEuYWdlLAorICAgICAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+cmVjb3JkRGF0YS5maWx0ZXJpbmdWbGFuRGF0YS5zdGF0aWNFbnRyeSA/ICJzdGF0aWMiIDogImR5bmFtaWMiLAorICAgICAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+cmVjb3JkRGF0YS5maWx0ZXJpbmdWbGFuRGF0YS5pZWVlODAyXzFxVGFnKTsKKworICAgICAgICAgICAgICAgICAgICAvKiBlbmQgdHJhbnNhY3Rpb24gKi8KKyAgICAgICAgICAgICAgICAgICAgaXhFdGhEQlJlbGVhc2VIYXNoTm9kZShub2RlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCItIG5vdCBzeW5jZWQiKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBwcmludGYoIlxuIik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgaXhPc2FsTG9nKEl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ICpwb3J0ICAgPSAmaXhFdGhEQlBvcnRJbmZvW3BvcnRJbmRleF07CisgICAgICAgIEJPT0wgbWFwc0NvbGxpZGU7CisgICAgICAgIAorICAgICAgICBNQVBTX0NPTExJREUobWFwc0NvbGxpZGUsIHRyaWdnZXJQb3J0cywgcG9ydC0+ZGVwZW5kZW5jeVBvcnRNYXApOworCisgICAgICAgIGlmIChtYXBzQ29sbGlkZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogZG8gdHJpZ2dlcnMgaW5mbHVlbmNlIHRoaXMgcG9ydD8gKi8KKyAgICAgICAgICAgICYmICFJU19QT1JUX0lOQ0xVREVEKHBvcnRJbmRleCwgdXBkYXRlUG9ydHMpICAvKiBhbmQgaXQncyBub3QgYWxyZWFkeSBpbiB0aGUgdXBkYXRlIGxpc3QgKi8KKyAgICAgICAgICAgICYmIHBvcnQtPnVwZGF0ZU1ldGhvZC51cGRhdGVFbmFibGVkKSAgICAgICAgICAvKiBhbmQgd2UncmUgYWxsb3dlZCB0byB1cGRhdGUgaXQgKi8KKyAgICAgICAgeworICAgICAgICAgICAgSVhfRVRIX0RCX1VQREFURV9UUkFDRSgiREI6IChVcGRhdGUpIEFkZGluZyBwb3J0ICVkIHRvIHVwZGF0ZSBzZXRcbiIsIHBvcnRJbmRleCk7CisKKyAgICAgICAgICAgIEpPSU5fUE9SVF9UT19NQVAodXBkYXRlUG9ydHMsIHBvcnRJbmRleCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBJWF9FVEhfREJfVVBEQVRFX1RSQUNFKCJEQjogKFVwZGF0ZSkgRGlkbid0IGFkZCBwb3J0ICVkIHRvIHVwZGF0ZSBzZXQsIHJlYXNvbnMgZm9sbG93OlxuIiwgcG9ydEluZGV4KTsKKworICAgICAgICAgICAgaWYgKCFtYXBzQ29sbGlkZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBJWF9FVEhfREJfVVBEQV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GhlbSAqLworICAgICAgICAgICAgaWYgKCFwb3J0LT51cGRhdGVNZXRob2Quc2VhcmNoVHJlZVBlbmRpbmdXcml0ZSAmJiBJU19QT1JUX0lOQ0xVREVEKHBvcnRJbmRleCwgdXBkYXRlUG9ydHMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEdFVF9NQVBfU0laRShwb3J0LT5kZXBlbmRlbmN5UG9ydE1hcCwgc2l6ZSk7CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgSVhfRVRIX0RCX1VQREFURV9UUkFDRSgiREI6IChVcGRhdGUpIERlcGVuZGVuY3kgbWFwIGZvciBwb3J0ICVkOiBzaXplICVkXG4iLAorICAgICAgICAgICAgICAgICAgICBwb3J0SW5kZXgsIHNpemUpOworCisgICAgICAgICAgICAgICAgaWYgKHNpemUgPCBtaW5pbWFsU2l6ZSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIG1pblBvcnRJbmRleCA9IHBvcnRJbmRleDsKKyAgICAgICAgICAgICAgICAgICAgbWluaW1hbFNpemUgID0gc2l6ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgSVhfRVRIX0RCX1VQREFURV9UUkFDRSgiREI6IChVcGRhdGUpIFNraXBwZWQgcG9ydCAlZCBmcm9tIHRyZWUgZGlmZiAoJXMpXG4iLCBwb3J0SW5kZXgsCisgICAgICAgICAgICAgICAgICAgIHBvcnQtPnVwZGF0ZU1ldGhvZC5zZWFyY2hUcmVlUGVuZGluZ1dyaXRlID8gInBlbmRpbmcgd3JpdGUgYWNjZXNzIiA6ICJpZ25vcmVkIGJ5IHF1ZXJ5Iik7CisgICAgICAgICAgICB9ICAgICAgICAgICAgCisgICAgICAgIH0KKworICAgICAgICAvKiBpZiBhIHBvcnQgd2FzIGZvdW5kIHRoYW4gbWluaW1hbFNpemUgaXMgbm90IE1BWF9QT1JUX1NJWkUgKi8KKyAgICAgICAgaWYgKG1pbmltYWxTaXplICE9IE1BWF9QT1JUX1NJWkUpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIG1pblBvcnRJbmRleCBpcyB0aGUgcG9ydCB3ZSBzZWVrICovCisgICAgICAgICAgICBQb3J0SW5mbyAqcG9ydCA9ICZpeEV0aERCUG9ydEluZm9bbWluUG9ydEluZGV4XTsKKworICAgICAgICAgICAgSXhFdGhEQlBvcnRNYXAgcXVlcnk7CisgICAgICAgICAgICBNYWNUcmVlTm9kZSAqYmFzZVRyZWU7CisKKyAgICAgICAgICAgIC8qIG5vdyB0cnkgdG8gZmluZCBhIHBvcnQgd2l0aCBtaW5pbWFsIG1hcCBkaWZmZXJlbmNlICovCisgICAgICAgICAgICBQb3J0SW5mbyAqbWluaW1hbERpZmZQb3J0ID0gTlVMTDsKKyAgICAgICAgICAgIFVJTlQzMiBtaW5pbWFsRGlmZiAgICAgICAgPSBNQVhfUE9SVF9TSVpFOworICAgICAgICAgICAgCisgICAgICAgICAgICBJWF9FVEhfREJfVVBEQVRFX1RSQUNFKCJEQjogKFVwZGF0ZSkgTWluaW1hbCBzaXplIHBvcnQgaXMgJWRcbiIsIG1pblBvcnRJbmRleCk7CisKKyAgICAgICAgICAgIGZvciAocG9ydEluZGV4ID0gMCA7IHBvcnRJbmRleCA8IElYX0VUSF9EQl9OVU1CRVJfT0ZfUE9SVFMgOyBwb3J0SW5kZXgrKykKKyAgICAgICAgICAgIHsgICAKKyAgICAgICAgICAgICAgICBQb3J0SW5mbyAqZGlmZlBvcnQgPSAmaXhFdGhEQlBvcnRJbmZvW3BvcnRJbmRleF07CisgICAgICAgICAgICAgICAgQk9PTCBtYXBJc1N1YnNldDsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBJU19NQVBfU1VCU0VUKG1hcElzU3Vic2V0LCBkaWZmUG9ydC0+ZGVwZW5kZW5jeVBvcnRNYXAsIHBvcnQtPmRlcGVuZGVuY3lQb3J0TWFwKTsKKyAgICAgICAgICAgICAgICAKKworICAgICAgICAgICAgICAgIGlmIChwb3J0SW5kZXggIT0gbWluUG9ydEluZGV4CisgICAgICAgICAgICAgICAgICAgICYmIGRpZmZQb3J0LT51cGRhdGVNZXRob2Quc2VhcmNoVHJlZSAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICYmIG1hcElzU3Vic2V0KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLyogY29tcHV0ZSBzaXplIGFuZCBwaWNrIG9ubHkgbWluaW1hbCBzaXplIGRpZmZlcmVuY2UgKi8KKyAgICAgICAgICAgICAgICAgICAgVUlOVDMyIGRpZmZQb3J0U2l6ZTsKKyAgICAgICAgICAgICAgICAgICAgVUlOVDMyIHNpemVEaWZmZXJlbmNlOworCisgICAgICAgICAgICAgICAgICAgIEdFVF9NQVBfU0laRShkaWZmUG9ydC0+ZGVwZW5kZW5jeVBvcnRNYXAsIGRpZmZQb3J0U2l6ZSk7CisgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgSVhfRVRIX0RCX1VQREFURV9UUkFDRSgiREI6IChVcGRhdGUpIENoZWNraW5nIHBvcnQgJWQgZm9yIGRpZmZlcmVuY2VzLi4uXG4iLCBwb3J0SW5kZXgpOworCisgICAgICAgICAgICAgICAgICAgIHNpemVEaWZmZXJlbmNlID0gbWluaW1hbFNpemUgLSBkaWZmUG9ydFNpemU7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNpemVEaWZmZXJlbmNlIDwgbWluaW1hbERpZmYpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1pbmltYWxEaWZmUG9ydCA9IGRpZmZQb3J0OworICAgICAgICAgICAgICAgICAgICAgICAgbWluaW1hbERpZmYgICAgID0gc2l6ZURpZmZlcmVuY2U7CisgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIElYX0VUSF9EQl9VUERBVEVfVFJBQ0UoIkRCOiAoVXBkYXRlKSBNaW5pbWFsIGRpZmZlcmVuY2UgMHgleCB3YXMgZm91bmQgb24gcG9ydCAlZFxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtaW5pbWFsRGlmZiwgcG9ydEluZGV4KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLyogY2hlY2sgaWYgZmlsdGVyaW5nIGlzIGVuYWJsZWQgb24gdGhpcyBwb3J0ICovCisgICAgICAgICAgICBpZiAoKHBvcnQtPmZlYXR1cmVTdGF0dXMgJiBJWF9FVEhfREJfRklMVEVSSU5HKSAhPSAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIGlmIG1pbmltYWxEaWZmIGlzIG5vdCBNQVhfUE9SVF9TSVpFIG1pbmltYWxEaWZmUG9ydCBwb2ludHMgdG8gdGhlIG1vc3Qgc2ltaWxhciBwb3J0ICovCisgICAgICAgICAgICAgICAgaWYgKG1pbmltYWxEaWZmICE9IE1BWF9QT1JUX1NJWkUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBiYXNlVHJlZSA9IGl4RXRoREJDbG9uZU1hY1RyZWVOb2RlKG1pbmltYWxEaWZmUG9ydC0+dXBkYXRlTWV0aG9kLnNlYXJjaFRyZWUpOworICAgICAgICAgICAgICAgICAgICBESUZGX01BUFMocXVlcnksIHBvcnQtPmRlcGVuZGVuY3lQb3J0TWFwICwgbWluaW1hbERpZmZQb3J0LT5kZXBlbmRlbmN5UG9ydE1hcCk7CisgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICBJWF9FVEhfREJfVVBEQVRFX1RSQUNFKCJEQjogKFVwZGF0ZSkgRm91bmQgbWluaW1hbCBkaWZmLCBleHRlbmRpbmcgdHJlZSAlZCBvbiBxdWVyeVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIG1pbmltYWxEaWZmUG9ydC0+cG9ydElEKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSAvKiAuLiBvdGhlcndpc2Ugbm8gc2ltaWxhciBwb3J0IHdhcyBmb3VuZCwgYnVpbGQgdHJlZSBmcm9tIHNjcmF0Y2ggKi8KKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGJhc2VUcmVlID0gTlVMTDsKKyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIENPUFlfREVQRU5ERU5DWV9NQVAocXVlcnksIHBvcnQtPmRlcGVuZGVuY3lQb3J0TWFwKTsKKyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIElYX0VUSF9EQl9VUERBVEVfVFJBQ0UoIkRCOiAoVXBkYXRlKSBObyBzaW1pbGFyIGRpZmYsIGNyZWF0aW5nIHRyZWUgZnJvbSBxdWVyeVxuIik7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgSVNfRU1QVFlfREVQRU5ERU5DWV9NQVAocmVzdWx0LCBxdWVyeSk7CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgaWYgKCFyZXN1bHQpIC8qIG90aGVyd2lzZSB3ZSBkb24ndCBuZWVkIGFueXRoaW5nIG1vcmUgb24gdG9wIG9mIHRoZSBjbG9uZWQgdHJlZSAqLworICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgSVhfRVRIX0RCX1VQREFURV9UUkFDRSgiREI6IChVcGRhdGUpIEFkZGluZyBxdWVyeSB0cmVlIHRvIHBvcnQgJWRcbiIsIG1pblBvcnRJbmRleCk7CisgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgLyogYnVpbGQgbGVhcm5pbmcgdHJlZSAqLworICAgICAgICAgICAgICAgICAgICBwb3J0LT51cGRhdGVNZXRob2Quc2VhcmNoVHJlZSA9IGl4RXRoREJRdWVyeShiYXNlVHJlZSwgcXVlcnksIElYX0VUSF9EQl9BTExfRklMVEVSSU5HX1JFQ09SRFMsIE1BWF9FTFRfU0laRSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIElYX0VUSF9EQl9VUERBVEVfVFJBQ0UoIkRCOiAoVXBkYXRlKSBRdWVyeSBpcyBlbXB0eSwgYXNzdW1pbmcgaWRlbnRpY2FsIG5lYXJlc3QgdHJlZVxuIik7CisgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIHBvcnQtPnVwZGF0ZU1ldGhvZC5zZWFyY2hUcmVlID0gYmFzZVRyZWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIGZpbHRlcmluZyBpcyBub3QgZW5hYmxlZCwgd2lsbCBkb3dubG9hZCBhbiBlbXB0eSB0cmVlICovCisgICAgICAgICAgICAgICAgaWYgKHBvcnQtPnVwZGF0ZU1ldGhvZC5zZWFyY2hUcmVlICE9IE5VTEwpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpeEV0aERCRnJlZU1hY1RyZWVOb2RlKHBvcnQtPnVwZGF0ZU1ldGhvZC5zZWFyY2hUcmVlKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBwb3J0LT51cGRhdGVNZXRob2Quc2VhcmNoVHJlZSA9IE5VTEw7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8qIG1hcmsgdHJlZSBhcyB2YWxpZCAqLworICAgICAgICAgICAgcG9ydC0+dXBkYXRlTWV0aG9kLnNlYXJjaFRyZWVQZW5kaW5nV3JpdGUgPSBUUlVFOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICA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RF9UT19OUEUocG9ydElEKSwgbWVzc2FnZSwgcmVzdWx0KTsKKworICAgICAgICBpZiAocmVzdWx0ID09IElYX1NVQ0NFU1MpCisJeworICAgICAgICAgICAgSVhfRVRIX0RCX1VQREFURV9UUkFDRSgiREI6IChQb3J0VXBkYXRlKSBGaW5pc2hlZCBkb3dubG9hZGluZyBOUEUgdHJlZSBvbiBwb3J0ICVkXG4iLCBwb3J0SUQpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgaXhFdGhEQlBvcnRJbmZvW3BvcnRJRF0uYWdpbmdFbmFibGVkICAgICAgICAgICAgICAgID0gRkFMU0U7CisgICAgICAgICAgICBpeEV0aERCUG9ydEluZm9bcG9ydElEXS51cGRhdGVNZXRob2QudXBkYXRlRW5hYmxlZCAgPSBGQUxTRTsKKyAgICAgICAgICAgIGl4RXRoREJQb3J0SW5mb1twb3J0SURdLnVwZGF0ZU1ldGhvZC51c2VyQ29udHJvbGxlZCA9IFRSVUU7CisKKyAgICAgICAgICAgIEVSUk9SX0xPRygiRXRoREI6IChQb3J0VXBkYXRlKSBkaXNhYmxpbmcgYWdpbmcgYW5kIHVwZGF0ZXMgb24gcG9ydCAlZCAoYXNzdW1lZCBkZWFkKVxuIiwgcG9ydElEKTsKKworICAgICAgICAgICAgaXhFdGhEQkRhdGFiYXNlQ2xlYXIocG9ydElELCBJWF9FVEhfREJfQUxMX1JFQ09SRF9UWVBFUyk7CisKKyAgICAgICAgICAgIHJldHVybiBJWF9FVEhfREJfRkFJTDsKKyAgICAgICAgfQorCisJcmV0dXJuIElYX0VUSF9EQl9TVUNDRVNTOworICAgIH0KKyAgICBlbHNlIGlmICh0eXBlID09IElYX0VUSF9EQl9GSVJFV0FMTF9SRUNPUkQpCisgICAgeworICAgICAgICByZXR1cm4gaXhFdGhEQkZpcmV3YWxsVXBkYXRlKHBvcnRJRCwgcG9ydC0+dXBkYXRlTWV0aG9kLm5wZVVwZGF0ZVpvbmUs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JfVVBEQVRFX1RSQUNFKCJtYXRjaFxuIik7CisKKyAgICAgICAgICAgIGlmIChkZXNjcmlwdG9yQ2xvbmUgIT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBhZGQgZGVzY3JpcHRvciB0byB0cmVlICovCisgICAgICAgICAgICAgICAgc2VhcmNoVHJlZSA9IGl4RXRoREJUcmVlSW5zZXJ0KHNlYXJjaFRyZWUsIGRlc2NyaXB0b3JDbG9uZSk7CisKKyAgICAgICAgICAgICAgICBlbnRyeUNvdW50Kys7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBJWF9FVEhfREJfVVBEQVRFX1RSQUNFKCJubyBtYXRjaFxuIik7CisgICAgICAgIH0KKworICAgICAgICBpZiAoZW50cnlDb3VudCA8IG1heEVudHJpZXMpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIGFkdmFuY2UgdG8gdGhlIG5leHQgcmVjb3JkICovCisJICAgICAgICBCVVNZX1JFVFJZKGl4RXRoREJJbmNyZW1lbnRIYXNoSXRlcmF0b3IoJmRiSGFzaHRhYmxlLCAmaXRlcmF0b3IpKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIHRoZSBOUEUgd29uJ3QgYWNjZXB0IG1vcmUgZW50cmllcyBzbyB3ZSBjYW4gc3RvcCBub3cgKi8KKyAgICAgICAgICAgIGl4RXRoREJSZWxlYXNlSGFzaEl0ZXJhdG9yKCZpdGVyYXRvcik7CisKKyAgICAgICAgICAgIElYX0VUSF9EQl9VUERBVEVfVFJBQ0UoIkRCOiAoUG9ydFVwZGF0ZSkgbnVtYmVyIG9mIGVsZW1lbnRzIHJlYWNoZWQgbWF4aW11bSBzdXBwb3J0ZWQgYnkgcG9ydFxuIik7CisKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorCisgICAgSVhfR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VUxMKQorICAgIHsKKyAgICAgICAgLyogb3V0IG9mIG1lbW9yeSAqLworICAgICAgICBFUlJPUl9MT0coIldhcm5pbmc6IGl4RXRoREJBbGxvY01hY1RyZWVOb2RlIHJldHVybmVkIE5VTEwgaW4gZmlsZSAlczolZCAob3V0IG9mIG1lbW9yeT8pXG4iLCBfX0ZJTEVfXywgX19MSU5FX18pOworCisgICAgICAgIGl4RXRoREJGcmVlTWFjRGVzY3JpcHRvcihkZXNjcmlwdG9yKTsKKworICAgICAgICByZXR1cm4gTlVMTDsKKyAgICB9CisKKyAgICAvKiBwb3B1bGF0ZSBub2RlICovCisgICAgbmV3Tm9kZS0+ZGVzY3JpcHRvciA9IGRlc2NyaXB0b3I7CisKKyAgICAvKiBhbiBlbXB0eSBpbml0aWFsIHRyZWUgaXMgYSBzcGVjaWFsIGNhc2UgKi8KKyAgICBpZiAoc2VhcmNoVHJlZSA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgcmV0dXJuIG5ld05vZGU7CisgICAgfQorCisgICAgLyogZ2V0IGluc2VydGlvbiBsb2NhdGlvbiAqLworICAgIHdoaWxlIChpbnNlcnRMb2NhdGlvbiA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgTWFjVHJlZU5vZGUgKm5leHROb2RlOworCisgICAgICAgIC8qIGNvbXBhcmUgZ2l2ZW4ga2V5IHdpdGggY3VycmVudCBub2RlIGtleSAqLworICAgICAgICBpbnNlcnRQb3NpdGlvbiA9IGl4RXRoREJBZGRyZXNzQ29tcGFyZShkZXNjcmlwdG9yLT5tYWNBZGRyZXNzLCBjdXJyZW50Tm9kZS0+ZGVzY3JpcHRvci0+bWFjQWRkcmVzcyk7CisKKyAgICAgICAgLyogbmF2aWdhdGUgZG93biAqLworICAgICAgICBpZiAoaW5zZXJ0UG9zaXRpb24gPT0gUklHSFQpCisgICAgICAgIHsKKyAgICAgICAgICAgIG5leHROb2RlID0gY3VycmVudE5vZGUtPnJpZ2h0OworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGluc2VydFBvc2l0aW9uID09IExFRlQpCisgICAgICAgIHsKKyAgICAgICAgICAgIG5leHROb2RlID0gY3VycmVudE5vZGUtPmxlZnQ7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICAvKiBlcnJvciwgZHVwbGljYXRlIGtleSAqLworICAgICAgICAgICAgRVJST1JfTE9HKCJXYXJuaW5nOiB0cmFwcGVkIGluc2VydGlvbiBvZiBhIGR1cGxpY2F0ZSBNQUMgYWRkcmVzcyBpbiBhbiBOUEUgc2VhcmNoIHRyZWVcbiIpOworCisgICAgICAgICAgICAvKiB0aGlzIHdpbGwgZnJlZSB0aGUgTUFDIGRlc2NyaXB0b3IgYXMgd2VsbCAqLworICAgICAgICAgICAgaXhFdGhEQkZyZWVNYWNUcmVlTm9kZShuZXdOb2RlKTsKKworICAgICAgICAgICAgcmV0dXJuIHNlYXJjaFRyZWU7CisgICAgICAgIH0KKworICAgICAgICAvKiB3aGVuIHdlIGNhbiBubyBsb25nZXIgZGl2ZSB0aHJvdWdoIHRoZSB0cmVlIHdlIGZvdW5kIHRoZSBpbnNlcnRpb24gcGxhY2UgKi8KKyAgICAgICAgaWYgKG5leHROb2RlICE9IE5VTEwpCisgICAgICAgIHsKKyAgICAgICAgICAgIGN1cnJlbnROb2RlID0gbmV4dE5vZGU7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBpbnNlcnRMb2NhdGlvbiA9IGN1cnJlbnROb2RlOworICAgICAgICB9CisgICAgfQorCisgICAgLyogaW5zZXJ0IG5vZGUgKi8KKyAgICBpZiAoaW5zZXJ0UG9zaXRpb24gPT0gUklHSFQpCisgICAgeworICAgICAgICBpbnNlcnRMb2NhdGlvbi0+cmlnaHQgPSBuZXdOb2RlOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBpbnNlcnRMb2NhdGlvbi0+bGVmdCA9IG5ld05vZGU7CisgIC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HJlbWFpbmRlcjsKKyAgICAgICAgICAgIHJlbWFpbmRlciA9IHJlbWFpbmRlci0+cmlnaHQ7CisgICAgICAgICAgICAoKnNpemUpKys7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICAvKiByb3RhdGUgYXJvdW5kIHJlbWFpbmRlciAqLworICAgICAgICAgICAgdGVtcFB0ciAgICAgICAgID0gcmVtYWluZGVyLT5sZWZ0OworICAgICAgICAgICAgcmVtYWluZGVyLT5sZWZ0ID0gdGVtcFB0ci0+cmlnaHQ7CisgICAgICAgICAgICB0ZW1wUHRyLT5yaWdodCAgPSByZW1haW5kZXI7CisgICAgICAgICAgICByZW1haW5kZXIgICAgICAgPSB0ZW1wUHRyOworICAgICAgICAgICAgdmluZVRhaWwtPnJpZ2h0ID0gdGVtcFB0cjsKKyAgICAgICAgfQorICAgIH0KK30KKworLyoqCisgKiBAYnJpZWYgY29udmVydHMgYSB2aW5lIGludG8gYSBiYWxhbmNlZCB0cmVlCisgKgorICogQHBhcmFtIHJvb3QgdmluZSB0byBjb252ZXJ0CisgKiBAcGFyYW0gc2l6ZSBkZXB0aCBvZiB2aW5lCisgKgorICogQGludGVybmFsCisgKi8KK0lYX0VUSF9EQl9QUklWQVRFCit2b2lkIGl4RXRoREJSZWJhbGFuY2VWaW5lVG9UcmVlKE1hY1RyZWVOb2RlICpyb290LCBVSU5UMzIgc2l6ZSkKK3sKKyAgICBVSU5UMzIgbGVhZkNvdW50ID0gc2l6ZSArIDEgLSAoMSA8PCBpeEV0aERCUmViYWxhbmNlTG9nMkZsb29yKHNpemUgKyAxKSk7CisKKyAgICBpeEV0aERCUmViYWxhbmNlQ29tcHJlc3Npb24ocm9vdCwgbGVhZkNvdW50KTsKKworICAgIHNpemUgPSBzaXplIC0gbGVhZkNvdW50OworCisgICAgd2hpbGUgKHNpemUgPiAxKQorICAgIHsKKyAgICAgICAgaXhFdGhEQlJlYmFsYW5jZUNvbXByZXNzaW9uKHJvb3QsIHNpemUgLyAyKTsKKworICAgICAgICBzaXplIC89IDI7CisgICAgfQorfQorCisvKioKKyAqIEBicmllZiBjb21wcmVzc2VzIGEgdmluZS90cmVlIHN0YWdlIGludG8gYSBtb3JlIGJhbGFuY2VkIHZpbmUvdHJlZQorICoKKyAqIEBwYXJhbSByb290IHJvb3Qgb2YgdGhlIHRyZWUgdG8gY29tcHJlc3MKKyAqIEBwYXJhbSBjb3VudCBudW1iZXIgb2YgInNwaW5lIiBub2RlcworICoKKyAqIEBpbnRlcm5hbAorICovCitJWF9FVEhfREJfUFJJVkFURQordm9pZCBpeEV0aERCUmViYWxhbmNlQ29tcHJlc3Npb24oTWFjVHJlZU5vZGUgKnJvb3QsIFVJTlQzMiBjb3VudCkKK3sKKyAgICBNYWNUcmVlTm9kZSAqc2Nhbm5lciA9IHJvb3Q7CisgICAgTWFjVHJlZU5vZGUgKmNoaWxkOworICAgIFVJTlQzMiBsb2NhbF9pbmRleDsKKworICAgIGZvciAobG9jYWxfaW5kZXggPSAwIDsgbG9jYWxfaW5kZXggPCBjb3VudCA7IGxvY2FsX2luZGV4KyspCisgICAgeworICAgICAgICBjaGlsZCAgICAgICAgICA9IHNjYW5uZXItPnJpZ2h0OworICAgICAgICBzY2FubmVyLT5yaWdodCA9IGNoaWxkLT5yaWdodDsKKyAgICAgICAgc2Nhbm5lciAgICAgICAgPSBzY2FubmVyLT5yaWdodDsKKyAgICAgICAgY2hpbGQtPnJpZ2h0ICAgPSBzY2FubmVyLT5sZWZ0OworICAgICAgICBzY2FubmVyLT5sZWZ0ICA9IGNoaWxkOworICAgIH0KK30KKworLyoqCisgKiBAYnJpZWYgY29tcHV0ZXMgfF9sb2cyKHgpX3wgKGEuay5hLiBmbG9vcihsb2cyKHgpKSkKKyAqCisgKiBAcGFyYW0geCBudW1iZXIgdG8gY29tcHV0ZSB8X2xvZzIoeClffCBmb3IKKyAqCisgKiBAcmV0dXJuIHxfbG9nMih4KV98CisgKgorICogQGludGVybmFsCis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gICAgICAgIG1hcE5vbmUgICA9IEZBTFNFOworICAgICAgICAgICAgCisgICAgICAgICAgICBpZiAocG9ydEluZGV4ICE9IHBvcnRJRCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBtYXBTZWxmID0gRkFMU0U7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIHByaW50ZigiJXMlZCIsIGZpcnN0UG9ydCA/ICJ7IiA6ICIsICIsIHBvcnRJbmRleCk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGZpcnN0UG9ydCA9IEZBTFNFOworICAgICAgICB9CisgICAgfQorICAgIAorICAgIGlmIChtYXBOb25lKQorICAgIHsKKyAgICAgICAgbWFwU2VsZiA9IEZBTFNFOworICAgIH0KKyAgICAKKyAgICBwcmludGYoIiVzICglcylcbiIsIGZpcnN0UG9ydCA/ICIiIDogIn0iLCBtYXBTZWxmID8gInNlbGYiIDogbWFwTm9uZSA/ICJub25lIiA6ICJncm91cCIpOworICAgIAorICAgIHJldHVybiBJWF9FVEhfREJfU1VDQ0VTUzsKK30KKworLyoqCisgKiBAYnJpZWYgZGlzcGxheXMgYWxsIHRoZSBmaWx0ZXJpbmcgcmVjb3JkcyBiZWxvbmdpbmcgdG8gYSBwb3J0CisgKgorICogQHBhcmFtIHBvcnRJRCBJRCBvZiB0aGUgcG9ydCB0byBkaXNwbGF5CisgKgorICogTm90ZSB0aGF0IHRoaXMgZnVuY3Rpb24gaXMgZG9jdW1lbnRlZCBpbiB0aGUgbWFpbiBjb21wb25lbnQKKyAqIGhlYWRlciBmaWxlLCBJeEV0aERCLmguCisgKgorICogQHdhcm5pbmcgZGVwcmVjYXRlZCwgdXNlIEByZWYgaXhFdGhEQkZpbHRlcmluZ0RhdGFiYXNlU2hvd1JlY29yZHMoKSAKKyAqIGluc3RlYWQuIENhbGxpbmcgdGhpcyBmdW5jdGlvbiBpcyBlcXVpdmFsZW50IHRvIGNhbGxpbmcKKyAqIGl4RXRoREJGaW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biIpOworICAgIH0KKworICAgIHByaW50ZigiICAgIE1BQyBhZGRyZXNzICAgIHwgICBBZ2UgIHwgVHlwZSBcbiIpOworICAgIHByaW50ZigiX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19cbiIpOworCisgICAgLyogYnJvd3NlIGRhdGFiYXNlICovCisgICAgQlVTWV9SRVRSWShpeEV0aERCSW5pdEhhc2hJdGVyYXRvcigmZGJIYXNodGFibGUsICZpdGVyYXRvcikpOworCisgICAgd2hpbGUgKElTX0lURVJBVE9SX1ZBTElEKCZpdGVyYXRvcikpCisgICAgeworICAgICAgTWFjRGVzY3JpcHRvciAqZGVzY3JpcHRvciA9IChNYWNEZXNjcmlwdG9yICopIGl0ZXJhdG9yLm5vZGUtPmRhdGE7CisKKyAgICAgIGlmIChkZXNjcmlwdG9yLT5wb3J0SUQgPT0gcG9ydElEICYmIGRlc2NyaXB0b3ItPnR5cGUgPT0gSVhfRVRIX0RCX0ZJTFRFUklOR19SRUNPUkQpCisgICAgICB7CisgICAgICAgICAgcmVjb3JkQ291bnQrKzsKKworICAgICAgICAgIC8qIGRpc3BsYXkgZW50cnkgKi8KKyAgICAgICAgICBwcmludGYoIiAlMDJYOiUwMlg6JTAyWDolMDJYOiUwMlg6JTAyWCB8ICU1ZCAgfCAlc1xuIiwKKyAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1swXSwKKyAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1sxXSwKKyAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1syXSwKKyAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1szXSwKKyAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1s0XSwKKyAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1s1XSwKKyAgICAgICAgICAgICAgZGVzY3JpcHRvci0+cmVjb3JkRGF0YS5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jcmlwdG9yLT5tYWNBZGRyZXNzWzFdLAorICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbMl0sCisgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1szXSwKKyAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5tYWNBZGRyZXNzWzRdLAorICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbNV0sCisgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+cmVjb3JkRGF0YS5maWx0ZXJpbmdEYXRhLmFnZSwKKyAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5yZWNvcmREYXRhLmZpbHRlcmluZ0RhdGEuc3RhdGljRW50cnkgPyAic3RhdGljIiA6ICJkeW5hbWljIik7CisgICAgICAgICB9CisgICAgfQorICAgIGVsc2UgaWYgKHJlY29yZEZpbHRlciA9PSBJWF9FVEhfREJfRklMVEVSSU5HX1JFQ09SRCkKKyAgICB7CisgICAgICAgIC8qIGRpc3BsYXkgZmlsdGVyaW5nIHJlY29yZCBoZWFkZXIgLSBsZWF2ZSB0aGlzIGNvbW1lbnRlZCBjb2RlIGluIHBsYWNlLCBpdHMgcHVycG9zZSBpcyB0byBhbGlnbiB0aGUgcHJpbnQgZm9ybWF0IHdpdGggdGhlIGhlYWRlcgorICAgICAgICBwcmludGYoIiAgICBNQUMgYWRkcmVzcyAgICB8ICAgQWdlICB8ICAgVHlwZSAgIFxuIik7CisgICAgICAgIHByaW50ZigiX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXG4iKTsgICovCisKKyAgICAgICAgaWYgKGRlc2NyaXB0b3ItPnR5cGUgPT0gSVhfRVRIX0RCX0ZJTFRFUklOR19SRUNPUkQpCisgICAgICAgIHsKKyAgICAgICAgIHByaW50ZigiJTAyWDolMDJYOiUwMlg6JTAyWDolMDJYOiUwMlggfCAlM2QgfCAlcyBcbiIsCisgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1swXSwKKyAgICAgICAgICAgICBkZXNjcmlwdG9yLT5tYWNBZGRyZXNzWzFdLAorICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbMl0sCisgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1szXSwKKyAgICAgICAgICAgICBkZXNjcmlwdG9yLT5tYWNBZGRyZXNzWzRdLAorICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbNV0sCisgICAgICAgICAgICAgZGVzY3JpcHRvci0+cmVjb3JkRGF0YS5maWx0ZXJpbmdEYXRhLmFnZSwKKyAgICAgICAgICAgICBkZXNjcmlwdG9yLT5yZWNvcmREYXRhLmZpbHRlcmluZ0RhdGEuc3RhdGljRW50cnkgPyAic3RhdGljIiA6ICJkeW5hbWljIik7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAocmVjb3JkRmlsdGVyID09IElYX0VUSF9EQl9XSUZJX1JFQ09SRCkKKyAgICB7CisgICAgICAgIC8qIGRpc3BsYXkgV2lGaSByZWNvcmQgaGVhZGVyIC0gbGVhdmUgdGhpcyBjb21tZW50ZWQgY29kZSBpbiBwbGFjZSwgaXRzIHB1cnBvc2UgaXMgdG8gYWxpZ24gdGhlIHByaW50IGZvcm1hdCB3aXRoIHRoZSBoZWFkZXIgCisgICAgICAgIHByaW50ZigiICAgIE1BQyBhZGRyZXNzICAgIHwgICBHVyBNQUMgYWRkcmVzcyAgXG4iKTsKKyAgICAgICAgcHJpbnRmKCJfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19cbiIpOyAqLworCisgICAgICAgIGlmIChkZXNjcmlwdG9yLT50eXBlID09IElYX0VUSF9EQl9XSUZJX1JFQ09SRCkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKGRlc2NyaXB0b3ItPnJlY29yZERhdGEud2lmaURhdGEudHlwZSA9PSBJWF9FVEhfREJfV0lGSV9BUF9UT19BUCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBnYXRld2F5IGFkZHJlc3MgcHJlc2VudCAqLworICAgICAgICAgICAgICAgIHByaW50ZigiJTAyWDolMDJYOiUwMlg6JTAyWDolMDJYOiUwMlggfCAlMDJYOiUwMlg6JTAyWDolMDJYOiUwMlg6JTAyWCBcbiIsCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbMF0sCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbMV0sCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbMl0sCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbM10sCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbNF0sCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbNV0sCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPnJlY29yZERhdGEud2lmaURhdGEuZ3dNYWNBZGRyZXNzWzBdLAorICAgICAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5yZWNvcmREYXRhLndpZmlEYXRhLmd3TWFjQWRkcmVzc1sxXSwKKyAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+cmVjb3JkRGF0YS53aWZpRGF0YS5nd01hY0FkZHJlc3NbMl0sCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPnJlY29yZERhdGEud2lmaURhdGEuZ3dNYWNBZGRyZXNzWzNdLAorICAgICAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5yZWNvcmREYXRhLndpZmlEYXRhLmd3TWFjQWRkcmVzc1s0XSwKKyAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+cmVjb3JkRGF0YS53aWZpRGF0YS5nd01hY0FkZHJlc3NbNV0pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIG5vIGdhdGV3YXkgKi8KKyAgICAgICAgICAgICAgICBwcmludGYoIiUwMlg6JTAyWDolMDJYOiUwMlg6JTAyWDolMDJYIHwgLS0tLW5vIGdhdGV3YXktLS0tLSBcbiIsCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbMF0sCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbMV0sCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbMl0sCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbM10sCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbNF0sCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbNV0pOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIGVsc2UgaWYgKHJlY29yZEZpbHRlciA9PSBJWF9FVEhfREJfRklSRVdBTExfUkVDT1JEKQorICAgIHsKKyAgICAgICAgLyogZGlzcGxheSBGaXJld2FsbCByZWNvcmQgaGVhZGVyIC0gbGVhdmUgdGhpcyBjb21tZW50ZWQgY29kZSBpbiBwbGFjZSwgaXRzIHB1cnBvc2UgaXMgdG8gYWxpZ24gdGhlIHByaW50IGZvcm1hdCB3aXRoIHRoZSBoZWFkZXIgCisgICAgICAgIHByaW50ZigiICAgIE1BQyBhZGRyZXNzICAgXG4iKTsKKyAgICAgICAgcHJpbnRmKCJfX19fX19fX19fX19fX19fX19cbiIpOyAqLworCisgICAgICAgIGlmIChkZXNjcmlwdG9yLT50eXBlID09IElYX0VUSF9EQl9GSVJFV0FMTF9SRUNPUkQpCisgICAgICAgIHsKKyAgICAgICAgICAgIHByaW50ZigiJTAyWDolMDJYOiUwMlg6JTAyWDolMDJYOiUwMlggXG4iLAorICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbMF0sCisgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1sxXSwKKyAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5tYWNBZGRyZXNzWzJdLAorICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbM10sCisgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1s0XSwKKyAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5tYWNBZGRyZXNzWzVdKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlIGlmIChyZWNvcmRGaWx0ZXIgPT0gSVhfRVRIX0RCX0FMTF9SRUNPUkRfVFlQRVMpCisgICAgeworICAgICAgICAvKiBkaXNwbGF5IGNvbXBvc2l0ZSByZWNvcmQgaGVhZGVyIC0gbGVhdmUgdGhpcyBjb21tZW50ZWQgY29kZSBpbiBwbGFjZSwgaXRzIHB1cnBvc2UgaXMgdG8gYWxpZ24gdGhlIHByaW50IGZvcm1hdCB3aXRoIHRoZSBoZWFkZXIgCisgICAgICAgIHByaW50ZigiICAgIE1BQyBhZGRyZXNzICAgfCBSZWNvcmQgfCBBZ2V8ICBUeXBlICAgfCBWTEFOIHxDRkl8IFFvUyB8ICBHVyBNQUMgYWRkcmVzcyAgIFxuIik7CisgICAgICAgIHByaW50ZigiX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX1xuIik7ICovCisKKyAgICAgICAgaWYgKGRlc2NyaXB0b3ItPnR5cGUgPT0gSVhfRVRIX0RCX0ZJTFRFUklOR19WTEFOX1JFQ09SRCkKKyAgICAgICAgeworICAgICAgICAgICAgcHJpbnRmKCIlMDJYOiUw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ci0+dHlwZSA9PSBJWF9FVEhfREJfRklMVEVSSU5HX1JFQ09SRCkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIHByaW50ZigiJTAyWDolMDJYOiUwMlg6JTAyWDolMDJYOiUwMlggfCBGaWx0ZXIgfCAlMmQgfCAlcyB8IC0tLS0gfCAtIHwgLS0tIHwgLS0tLS0tLS0tLS0tLS0tLS1cbiIsCisgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1swXSwKKyAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5tYWNBZGRyZXNzWzFdLAorICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbMl0sCisgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1szXSwKKyAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5tYWNBZGRyZXNzWzRdLAorICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbNV0sCisgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+cmVjb3JkRGF0YS5maWx0ZXJpbmdEYXRhLmFnZSwKKyAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5yZWNvcmREYXRhLmZpbHRlcmluZ0RhdGEuc3RhdGljRW50cnkgPyAic3RhdGljICIgOiAiZHluYW1pYyIpOworICAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChkZXNjcmlwdG9yLT50eXBlID09IElYX0VUSF9EQl9XSUZJX1JFQ09SRCkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKGRlc2NyaXB0b3ItPnJlY29yZERhdGEud2lmaURhdGEudHlwZSA9PSBJWF9FVEhfREJfV0lGSV9BUF9UT19BUCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBnYXRld2F5IGFkZHJlc3MgcHJlc2VudCAqLworICAgICAgICAgICAgICAgIHByaW50ZigiJTAyWDolMDJYOiUwMlg6JTAyWDolMDJYOiUwMlggfCAgV2lGaSAgfCAtLSB8IEFQPT5BUCAgfCAtLS0tIHwgLSB8IC0tLSB8ICUwMlg6JTAyWDolMDJYOiUwMlg6JTAyWDolMDJYXG4iLAorICAgICAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5tYWNBZGRyZXNzWzBdLAorICAgICAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5tYWNBZGRyZXNzWzFdLAorICAgICAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5tYWNBZGRyZXNzWzJdLAorICAgICAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5tYWNBZGRyZXNzWzNdLAorICAgICAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5tYWNBZGRyZXNzWzRdLAorICAgICAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5tYWNBZGRyZXNzWzVdLAorICAgICAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5yZWNvcmREYXRhLndpZmlEYXRhLmd3TWFjQWRkcmVzc1swXSwKKyAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+cmVjb3JkRGF0YS53aWZpRGF0YS5nd01hY0FkZHJlc3NbMV0sCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPnJlY29yZERhdGEud2lmaURhdGEuZ3dNYWNBZGRyZXNzWzJdLAorICAgICAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5yZWNvcmREYXRhLndpZmlEYXRhLmd3TWFjQWRkcmVzc1szXSwKKyAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+cmVjb3JkRGF0YS53aWZpRGF0YS5nd01hY0FkZHJlc3NbNF0sCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPnJlY29yZERhdGEud2lmaURhdGEuZ3dNYWNBZGRyZXNzWzVdKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBubyBnYXRld2F5ICovCisgICAgICAgICAgICAgICAgcHJpbnRmKCIlMDJYOiUwMlg6JTAyWDolMDJYOiUwMlg6JTAyWCB8ICBXaUZpICB8IC0tIHwgQVA9PlNUICB8IC0tLS0gfCAtIHwgLS0tIHwgLS0gbm8gZ2F0ZXdheSAtLSBcbiIsCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbMF0sCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbMV0sCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbMl0sCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbM10sCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbNF0sCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbNV0pOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGRlc2NyaXB0b3ItPnR5cGUgPT0gSVhfRVRIX0RCX0ZJUkVXQUxMX1JFQ09SRCkKKyAgICAgICAgeworICAgICAgICAgICAgcHJpbnRmKCIlMDJYOiUwMlg6JTAyWDolMDJYOiUwMlg6JTAyWCB8ICAgRlcgICB8IC0tIHwgLS0tLS0tLSB8IC0tLS0gfCAtIHwgLS0tIHwgLS0tLS0tLS0tLS0tLS0tLS1cbiIsCisgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1swXSwKKyAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5tYWNBZGRyZXNzWzFdLAorICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbMl0sCisgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1szXSwKKyAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5tYWNBZGRy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PTCkgIT0gMCkgPyAib24iIDogIm9mZiIpOworICAgIH0KKworICAgIHByaW50ZigiXG4iKTsKKworICAgIC8qIGRlcGVuZGVuY3kgbWFwICovCisgICAgaXhFdGhEQkRlcGVuZGVuY3lQb3J0TWFwU2hvdyhwb3J0SUQsIHBvcnRJbmZvLT5kZXBlbmRlbmN5UG9ydE1hcCk7CisKKyAgICAvKiBOUEUgZHluYW1pYyB1cGRhdGVzICovCisgICAgaWYgKGl4RXRoREJQb3J0RGVmaW5pdGlvbnNbcG9ydElEXS50eXBlID09IElYX0VUSF9OUEUpIAorICAgIHsKKyAgICAgICAgcHJpbnRmKCIgLSBOUEUgZHluYW1pYyB1cGRhdGUgaXMgJXNcbiIsIHBvcnRJbmZvLT51cGRhdGVNZXRob2QudXBkYXRlRW5hYmxlZCA/ICJlbmFibGVkIiA6ICJkaXNhYmxlZCIpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBwcmludGYoIiAtIGR5bmFtaWMgdXBkYXRlIGRpc2FibGVkIChub3QgYW4gTlBFKVxuIik7CisgICAgfQorCisgICAgaWYgKChwb3J0SW5mby0+ZmVhdHVyZUNhcGFiaWxpdHkgJiBJWF9FVEhfREJfV0lGSV9IRUFERVJfQ09OVkVSU0lPTikgIT0gMCkKKyAgICB7CisgICAgICAgIGlmICgocG9ydEluZm8tPmZlYXR1cmVTdGF0dXMgJiBJWF9FVEhfREJfV0lGSV9IRUFERVJfQ09OVkVSU0lPTikgIT0gMCkKKyAgICAgICAgeworICAgICAgICAgICAgLyogV2lGaSBoZWFkZXIgY29udmVyc2lvbiAqLworICAgICAgICAgICAgaWYgKChwb3J0SW5mby0+ZnJhbWVDb250cm9sRHVyYXRpb25JRCAKKyAgICAgICAgICAgICAgICArIHBvcnRJbmZvLT5iYnNpZFswXSAKKyAgICAgICAgICAgICAgICArIHBvcnRJbmZvLT5iYnNpZFsxXSAKKyAgICAgICAgICAgICAgICArIHBvcnRJbmZvLT5iYnNpZFsyXSAKKyAgICAgICAgICAgICAgICArIHBvcnRJbmZvLT5iYnNpZFszXSAKKyAgICAgICAgICAgICAgICArIHBvcnRJbmZvLT5iYnNpZFs0XSAKKyAgICAgICAgICAgICAgICArIHBvcnRJbmZvLT5iYnNpZFs1XSkgPT0gMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwcmludGYoIiAtIFdpRmkgaGVhZGVyIGNvbnZlcnNpb24gbm90IGNvbmZpZ3VyZWRcbiIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeyAgCisgICAgICAgICAgICAgICAgcHJpbnRmKCIgLSBXaUZpIGhlYWRlciBjb252ZXJzaW9uOiBCQlNJRCBbJTAyWDolMDJYOiUwMlg6JTAyWDolMDJYOiUwMlhdLCBGcmFtZSBDb250cm9sIDB4JVgsIER1cmF0aW9uL0lEIDB4JVhcbiIsIAorICAgICAgICAgICAgICAgICAgICBwb3J0SW5mby0+YmJzaWRbMF0sCisgICAgICAgICAgICAgICAgICAgIHBvcnRJbmZvLT5iYnNpZFsxXSwKKyAgICAgICAgICAgICAgICAgICAgcG9ydEluZm8tPmJic2lkWzJdLAorICAgICAgICAgICAgICAgICAgICBwb3J0SW5mby0+YmJzaWRbM10sCisgICAgICAgICAgICAgICAgICAgIHBvcnRJbmZvLT5iYnNpZFs0XSwKKyAgICAgICAgICAgICAgICAgICAgcG9ydEluZm8tPmJic2lkWzVdLAorICAgICAgICAgICAgICAgICAgICBwb3J0SW5mby0+ZnJhbWVDb250cm9sRHVyYXRpb25JRCA+PiAxNiwKKyAgICAgICAgICAgICAgICAgICAgcG9ydEluZm8tPmZyYW1lQ29udHJvbER1cmF0aW9uSUQgJiAweEZGRkYpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgcHJpbnRmKCIgLSBXaUZpIGhlYWRlciBjb252ZXJzaW9uIG5vdCBlbmFibGVkXG4iKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qIEZpcmV3YWxsICovCisgICAgaWYgKChwb3J0SW5mby0+ZmVhdHVyZUNhcGFiaWxpdHkgJiBJWF9FVEhfREJfRklSRVdBTEwpICE9IDApCisgICAgeworICAgICAgICBpZiAoKHBvcnRJbmZvLT5mZWF0dXJlU3RhdHVzICYgSVhfRVRIX0RCX0ZJUkVXQUxMKSAhPSAwKQorICAgICAgICB7CisgICAgICAgICAgICBwcmludGYoIiAtIEZpcmV3YWxsIGlzIGluICVzLWxpc3QgbW9kZVxuIiwgcG9ydEluZm8tPmZpcmV3YWxsTW9kZSA9PSBJWF9FVEhfREJfRklSRVdBTExfQkxBQ0tfTElTVCA/ICJibGFjayIgOiAid2hpdGUiKTsKKyAgICAgICAgICAgIHByaW50ZigiIC0gSW52YWxpZCBzb3VyY2UgTUFDIGFkZHJlc3MgZmlsdGVyaW5nIGlzICVzXG4iLCBwb3J0SW5mby0+c3JjQWRkcmVzc0ZpbHRlckVuYWJsZWQgPyAiZW5hYmxlZCIgOiAiZGlzYWJsZWQiKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIHByaW50ZigiIC0gRmlyZXdhbGwgbm90IGVuYWJsZWRcbiIpOworICAgICAgICB9CisgICAgfQorICAKKyAgICAvKiBicm93c2UgZGF0YWJhc2UgaWYgYXNrZWQgdG8gZGlzcGxheSByZWNvcmRzICovCisgICAgaWYgKHJlY29yZEZpbHRlciAhPSBJWF9FVEhfREJfTk9fUkVDT1JEX1RZUEUpCisgICAgeworICAgICAgICBwcmludGYoIlxuIik7CisgICAgICAgIGl4RXRoREJIZWFkZXJTaG93KHJlY29yZEZpbHRlcik7CisKKyAgICAgICAgQlVTWV9SRVRSWShpeEV0aERCSW5pdEhhc2hJdGVyYXRvcigmZGJIYXNodGFibGUsICZpdGVyYXRvcikpOworCisgICAgICAgIHdoaWxlIChJU19JVEVSQVRPUl9WQUxJRCgmaXRlcmF0b3IpKQorICAgICAgICB7CisgICAgICAgICAgICBNYWNEZXNjcmlwdG9yICpkZXNjcmlwdG9yID0gKE1hY0Rlc2NyaXB0b3IgKikgaXRlcmF0b3Iubm9kZS0+ZGF0YTsKKworICAgICAgICAgICAgaWYgKGRlc2NyaXB0b3ItPnBvcnRJRCA9PSBwb3J0SUQgJiYgKGRlc2NyaXB0b3ItPnR5cGUgJiByZWNvcmRGaWx0ZXIpICE9IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcmVjb3JkQ291bnQrKzsKKworICAgICAgICAgICAgICAgIC8qIGRpc3BsYXkgZW50cnkgKi8KKyAgICAgICAgICAgICAgICBpeEV0aERCUmVjb3JkU2hvdyhkZXNjcmlwdG9yLCByZWNvcmRGaWx0ZXIpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvKiBtb3ZlIHRvIHRoZSBuZXh0IHJlY29yZCAqLworICAgICAgICAgICAgQlVTWV9SRVRSWV9XSVRIX1JFU1VMVChpeEV0aERCSW5jcmVtZW50SGFzaEl0ZXJhdG9yKCZkYkhhc2h0YWJsZSwgJml0ZXJhdG9yKSwgbG9jYWxfcmVzdWx0KTsKKworICAgICAgICAgICAgLyogZGVidWcgKi8KKyAgICAgICAgICAgIGlmIChsb2NhbF9yZXN1bHQgPT0gSVhfRVRIX0RCX0JVU1kpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcHJpbnRmKCJFdGhEQiAoQVBJKTogRXJyb3IsIGRhdGFiYXNlIGJyb3dzZXIgZmFpbGVkIChubyBhY2Nlc3MpLCBnaXZpbmcgdXBcbiIpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICBwcmludGYoIlxuRm91bmQgJWQgcmVjb3Jkc1xuXG4iLCByZWNvcmRDb3VudCk7CisgICAgfQorfQorCisvKioKKyAqIEBicmllZiBkaXNwbGF5cyBhIHJlY29yZCBoZWFkZXIKKyAqCisgKiBAcGFyYW0gcmVjb3JkRmlsdGVyIHJlY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QgfCBDRkkgfCBRb1MgY2xhc3MgXG4iKTsKKyAgICBwcmludGYoIl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19cbiIpOworICB9CisgIGVsc2UgaWYgKHJlY29yZEZpbHRlciA9PSBJWF9FVEhfREJfRklMVEVSSU5HX1JFQ09SRCkKKyAgeworICAgIC8qIGRpc3BsYXkgZmlsdGVyaW5nIHJlY29yZCBoZWFkZXIgKi8KKyAgICBwcmludGYoIiAgICBNQUMgYWRkcmVzcyAgICB8ICAgQWdlICB8ICAgVHlwZSAgIFxuIik7CisgICAgcHJpbnRmKCJfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19cbiIpOworICB9CisgIGVsc2UgaWYgKHJlY29yZEZpbHRlciA9PSBJWF9FVEhfREJfV0lGSV9SRUNPUkQpCisgIHsKKyAgICAvKiBkaXNwbGF5IFdpRmkgcmVjb3JkIGhlYWRlciAqLworICAgIHByaW50ZigiICAgIE1BQyBhZGRyZXNzICAgIHwgICBHVyBNQUMgYWRkcmVzcyAgXG4iKTsKKyAgICBwcmludGYoIl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX1xuIik7CisgIH0KKyAgZWxzZSBpZiAocmVjb3JkRmlsdGVyID09IElYX0VUSF9EQl9GSVJFV0FMTF9SRUNPUkQpCisgIHsKKyAgICAvKiBkaXNwbGF5IEZpcmV3YWxsIHJlY29yZCBoZWFkZXIgKi8KKyAgICBwcmludGYoIiAgICBNQUMgYWRkcmVzcyAgIFxuIik7CisgICAgcHJpbnRmKCJfX19fX19fX19fX19fX19fX19cbiIpOworICB9CisgIGVsc2UgaWYgKHJlY29yZEZpbHRlciA9PSBJWF9FVEhfREJfQUxMX1JFQ09SRF9UWVBFUykKKyAgeworICAgIC8qIGRpc3BsYXkgY29tcG9zaXRlIHJlY29yZCBoZWFkZXIgKi8KKyAgICBwcmludGYoIiAgICBNQUMgYWRkc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RElTQUJMRUQpKQorICAgICAgICB7CisJICAgIHJldHVybiBJWF9FVEhfREJfRkFJTDsJICAgIAorICAgICAgICB9CisgICAgfQorICAgIAorICAgIHJldHVybiBJWF9FVEhfREJfU1VDQ0VTUzsKK30KKworSVhfRVRIX0RCX1BVQkxJQworQk9PTCBpeEV0aERCQ2hlY2tTaW5nbGVCaXRWYWx1ZShVSU5UMzIgdmFsdWUpCit7CisjaWYgKENQVSAhPSBTSU1TUEFSQ1NPTEFSSVMpICYmICFkZWZpbmVkIChfX3dpbmNlKQorICAgIFVJTlQzMiBzaGlmdDsKKyAgICAKKyAgICAvKiB1c2UgdGhlIGNvdW50LWxlYWRpbmctemVyb3MgWFNjYWxlIGluc3RydWN0aW9uICovCisgICAgX19hc21fXyAoImNseiAlMCwgJTFcbiIgOiAiPXIiIChzaGlmdCkgOiAiciIgKHZhbHVlKSk7CisgICAgCisgICAgcmV0dXJuICgodmFsdWUgPDwgc2hpZnQpID09IDB4ODAwMDAwMDBVTCk7CisgICAgCisjZWxzZQorCQorICAgIHdoaWxlICh2YWx1ZSAhPSAwKQorICAgIHsKKyAgICAgICAgaWYgKHZhbHVlID09IDEpIHJldHVybiBUUlVFOworICAgICAgICBlbHNlIGlmICgodmFsdWUgJiAxKSA9PSAxKSByZXR1cm4gRkFMU0U7CisKKyAgICAgICAgdmFsdWUgPj49IDE7CisgICAgfQorICAgIAorICAgIHJldHVybiBGQUxTRTsKKworI2VuZGlmCit9CisKK2NvbnN0IGNoYXIgKm1hYzJzdHJpbmcoY29uc3QgdW5zaWduZWQgY2hhciAqbWFjKQoreworICBzdGF0aWMgY2hhciBzdHJbMTldOworICAKKyAgaWYgKG1hYyA9PSBOVUxMKQorICB7CisgICAgcmV0dXJuIE5VTEw7CisgIH0gIAorCisgIHNwcmludGYoc3RyLCAiJTAyWDolMDJYOiUwMlg6JTAyWDolMDJYOiUwMlgiLCBtYWNbMF0sIG1hY1sxXSwgbWFjWzJdLCBtYWNbM10sIG1hY1s0XS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FjdGlvbiA9PSBSRU1PVkVfVkxBTiAmJiB2bGFuSURNYXggPT0gdmxhbklETWluICYmIElYX0VUSF9EQl9HRVRfVkxBTl9JRChpeEV0aERCUG9ydEluZm9bcG9ydElEXS52bGFuVGFnKSA9PSB2bGFuSURNaW4pCisgICAgeworICAgICAgICByZXR1cm4gSVhfRVRIX0RCX05PX1BFUk1JU1NJT047CisgICAgfQorICAgIAorICAgIC8qIGNvbXB1dGUgc2V0IG9mZnNldHMgKi8KKyAgICBzZXRPZmZzZXRNaW4gPSBWTEFOX1NFVF9PRkZTRVQodmxhbklETWluKTsKKyAgICBzZXRPZmZzZXRNYXggPSBWTEFOX1NFVF9PRkZTRVQodmxhbklETWF4KTsKKworICAgIC8qIGNoYW5nZSBWTEFOIHJhbmdlICovCisgICAgZm9yICg7IHZsYW5JRE1pbiA8PSB2bGFuSURNYXggOyB2bGFuSURNaW4rKykKKyAgICB7CisgICAgICAgIC8qIGNoYW5nZSB2bGFuIGluIGxvY2FsIG1lbWJlcnNoaXAgdGFibGUgKi8KKyAgICAgICAgaXhFdGhEQkxvY2FsVmxhbk1lbWJlcnNoaXBDaGFuZ2UodmxhbklETWluLCB0YWJsZSwgYWN0aW9uKTsKKyAgICB9CisKKyAgICAvKiBpZiB0aGUgcmFuZ2UgaXMgd2l0aGluIG9uZSBzZXQgKG1heCA4IFZMQU5zIGluIG9uZSB0YWJsZSBieXRlKSB3ZSBjYW4ganVzdCB1cGRhdGUgdGhhdCBlbnRyeSBpbiB0aGUgTlBFICovCisgICAgaWYgKHNldE9mZnNldE1pbiA9PSBzZXRPZmZzZXRNYXgpCisgICAgeworICAgICAgICAvKiBzZW5kIHVwZGF0ZWQgZW50cnkgdG8gTlBFICovCisgICAgICAgIHJldHVybiBpeEV0aERCVmxhblRhYmxlRW50cnlVcGRhdGUocG9ydElELCBzZXRPZmZzZXRNaW4pOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICAvKiB1cGRhdGUgYSB6b25lIG9mIH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0dXJuIElYX0VUSF9EQl9TVUNDRVNTIGlmIHRoZSBvcGVyYXRpb24gY29tcGxldGVkIHN1Y2Nlc3NmdWxseQorICogb3IgYW4gYXBwcm9wcmlhdGUgZXJyb3IgbWVzc2FnZSBvdGhlcndpc2UKKyAqLworSVhfRVRIX0RCX1BVQkxJQyAKK0l4RXRoREJTdGF0dXMgaXhFdGhEQlByaW9yaXR5TWFwcGluZ1RhYmxlU2V0KEl4RXRoREJQb3J0SWQgcG9ydElELCBJeEV0aERCUHJpb3JpdHlUYWJsZSBwcmlvcml0eVRhYmxlKQoreworICAgIFVJTlQzMiBjbGFzc0luZGV4OworICAgIAorICAgIElYX0VUSF9EQl9DSEVDS19QT1JUKHBvcnRJRCk7CisgICAgCisgICAgSVhfRVRIX0RCX0NIRUNLX1NJTkdMRV9OUEUocG9ydElEKTsKKyAgICAKKyAgICBJWF9FVEhfREJfQ0hFQ0tfRkVBVFVSRShwb3J0SUQsIElYX0VUSF9EQl9WTEFOX1FPUyk7CisgICAgCisgICAgSVhfRVRIX0RCX0NIRUNLX1JFRkVSRU5DRShwcmlvcml0eVRhYmxlKTsKKyAgICAgICAgICAgCisgICAgZm9yIChjbGFzc0luZGV4ID0gMCA7IGNsYXNzSW5kZXggPCBJWF9JRUVFODAyXzFRX1FPU19QUklPUklUWV9DT1VOVCA7IGNsYXNzSW5kZXgrKykKKyAgICB7CisgICAgICAgIC8qIGNoZWNrIHJhbmdlICovCisgICAgICAgIGlmIChwcmlvcml0eVRhYmxlW2NsYXNzSW5kZXhdID49IGl4RXRoREJQb3J0SW5mb1twb3J0SURdLml4RXRoREJUcmFmZmljQ2xhc3NDb3VudCkKKyAgICAgICAgeworICAgICAgICAgICAgcmV0dXJuIElYX0VUSF9EQl9JTlZBTElEX1BSSU9SSVRZOworICAgICAgICB9CisgICAgfQorICAgIAorICAgIC8qIHNldCBuZXcgdHJhZmZpYyBjbGFzc2VzICovCisgICAgZm9yIChjbGFzc0luZGV4ID0gMCA7IGNsYX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Aqc3RhdGlvbnMpCit7CisgICAgTWFjVHJlZU5vZGVTdGFjayAqc3RhY2s7CisgICAgTWFjVHJlZU5vZGUgKmdhdGV3YXlzLCAqaW5zZXJ0aW9uUGxhY2U7CisgICAgVUlOVDMyIGd3SW5kZXggPSAxOyAvKiBza2lwIHRoZSBlbXB0eSByb290ICovCisgICAgCisgICAgaWYgKHN0YXRpb25zID09IE5VTEwpCisgICAgeworICAgICAgICByZXR1cm4gTlVMTDsKKyAgICB9CisKKyAgICBzdGFjayA9IGl4T3NhbENhY2hlRG1hTWFsbG9jKHNpemVvZiAoTWFjVHJlZU5vZGVTdGFjaykpOworCisgICAgaWYgKHN0YWNrID09IE5VTEwpCisgICAgeworICAgICAgICBFUlJPUl9MT0coIkRCOiAoV2lGaSkgZmFpbGVkIHRvIGFsbG9jYXRlIHRoZSBub2RlIHN0YWNrIGZvciBnYXRld2F5IHRyZWUgbGluZWFyaXphdGlvbiwgb3V0IG9mIG1lbW9yeT9cbiIpOworICAgICAgICByZXR1cm4gTlVMTDsKKyAgICB9CisgICAgCisgICAgLyogaW5pdGlhbGl6ZSByb290IG5vZGUgKi8KKyAgICBnYXRld2F5cyA9IGluc2VydGlvblBsYWNlID0gTlVMTDsKKyAgICAgICAgCisgICAgLyogc3RhcnQgYnJvd3NpbmcgdGhlIHN0YXRpb24gdHJlZSAqLworICAgIE5PREVfU1RBQ0tfSU5JVChzdGFjayk7CisgICAgCisgICAgLyogaW5pdGlhbGl6ZSBzdGFjayBieSBwdXNoaW5nIHRoZSB0cmVlIHJvb3QgYXQgb2Zmc2V0IDAgKi8KKyAgICBOT0RFX1NUQUNLX1BVU0goc3RhY2ssIHN0YXRpb25zLCAwKTsKKyAgICAKKyAgICB3aGlsZSAoTk9ERV9TVEFDS19OT05FTVBUWShzdGFjaykpCisgICAgeworICAgICAgICBNYWNUcmVlTm9kZSAqbm9kZTsKKyAgICAgICAgVUlOVDMyIG9mZnNldDsKKyAgICAgICAKKyAgICAgICAgTk9ERV9TVEFDS19QT1Aoc3RhY2ssIG5vZGUsIG9mZnNldCk7CisKKyAgICAgICAgLyogd2UgY2FuIHN0b3JlIG1heGltdW0gMzEgKDMyIHRvdGFsLCAxIGVtcHR5IHJvb3QpIGVudHJpZXMgaW4gdGhlIGdhdGV3YXkgdHJlZSAqLworICAgICAgICBpZiAob2Zmc2V0ID4gKE1BWF9HV19TSVpFIC0gMSkpIGJyZWFrOworICAgICAgICAKKyAgICAgICAgLyogY2hlY2sgaWYgdGhpcyByZWNvcmQgaGFzIGEgZ2F0ZXdheSBhZGRyZXNzICovCisgICAgICAgIGlmIChub2RlLT5kZXNjcmlwdG9yICE9IE5VTEwgJiYgbm9kZS0+ZGVzY3JpcHRvci0+cmVjb3JkRGF0YS53aWZpRGF0YS50eXBlID09IElYX0VUSF9EQl9XSUZJX0FQX1RPX0FQKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBmb3VuZCBhIHJlY29yZCwgY3JlYXRlIGFuIGluc2VydGlvbiBwbGFjZSAqLworICAgICAgICAgICAgaWYgKGluc2VydGlvblBsYWNlICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaW5zZXJ0aW9uUGxhY2UtPnJpZ2h0ID0gaXhFdGhEQkFsbG9jTWFjVHJlZU5vZGUoKTsKKyAgICAgICAgICAgICAgICBpbnNlcnRpb25QbGFjZSAgICAgICAgPSBpbnNlcnRpb25QbGFjZS0+cmlnaHQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZ2F0ZXdheXMgICAgICAgPSBpeEV0aERCQWxsb2NNYWNUcmVlTm9kZSgpOworICAgICAgICAgICAgICAgIGluc2VydGlvblBsYWNlID0gZ2F0ZXdheXM7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChpbnNlcnRpb25QbGFjZSA9PSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIG5vIG5vZGVzIGxlZnQsIGJhaWwgb3V0IHdpdGggd2hhdCB3ZSBoYXZlICovCisgICAgICAgICAgICAgICAgaXhPc2FsQ2FjaGVEbWFGcmVlKHN0YWNrKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gZ2F0ZXdheXM7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIC8qIGNsb25lIHRoZSBvcmlnaW5hbCByZWNvcmQgZm9yIHRoZSBnYXRld2F5IHRyZWUgKi8KKyAgICAgICAgICAgIGluc2VydGlvblBsYWNlLT5kZXNjcmlwdG9yID0gaXhFdGhEQkNsb25lTWFjRGVzY3JpcHRvcihub2RlLT5kZXNjcmlwdG9yKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgLyogaW5zZXJ0IGFuZCB1cGRhdGUgdGhlIG9mZnNldCBpbiB0aGUgb3JpZ2luYWwgcmVjb3JkICovCisgICAgICAgICAgICBub2RlLT5kZXNjcmlwdG9yLT5yZWNvcmREYXRhLndpZmlEYXRhLmd3QWRkcmVzc0luZGV4ID0gZ3dJbmRleCsrOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICAvKiBicm93c2UgdGhlIHRyZWUgKi8KKyAgICAgICAgaWYgKG5vZGUtPmxlZnQgIT0gTlVMTCkKKyAgICAgICAgeworICAgICAgICAgICAgTk9ERV9TVEFDS19QVVNIKHN0YWNrLCBub2RlLT5sZWZ0LCBMRUZUX0NISUxEX09GRlNFVChvZmZzZXQpKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChub2RlLT5yaWdodCAhPSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgICBOT0RFX1NUQUNLX1BVU0goc3RhY2ssIG5vZGUtPnJpZ2h0LCBSSUdIVF9DSElMRF9PRkZTRVQob2Zmc2V0KSk7CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgaXhPc2FsQ2FjaGVEbWFGcmVlKHN0YWNrKTsKKyAgICByZXR1cm4gZ2F0ZXdheXM7ICAgIA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WRkciA8IElYUDQyNV9FVEhfQUNDX01JSV9NQVhfQUREUikgJiYgCisgICAgICAoSVhfRVRIX01JSV9JTlZBTElEX1BIWV9JRCAhPSBpeEV0aE1paVBoeUlkW3BoeUFkZHJdKSkKKyAgeworICAgICAgLyogcmVhZC93cml0ZSB0aGUgY29udHJvbCByZWdpc3RlciAqLworICAgICAgaWYoaXhFdGhBY2NNaWlSZWFkUnRuIChwaHlBZGRyLAorCQkJICAgICBJWF9FVEhfTUlJX0NUUkxfUkVHLCAKKwkJCSAgICAgJnJlZ3ZhbCkgCisJID09IElYX0VUSF9BQ0NfU1VDQ0VTUykKKyAgICAgIHsKKwkgIGlmKGl4RXRoQWNjTWlpV3JpdGVSdG4gKHBoeUFkZHIsIAorCQkJCSAgSVhfRVRIX01JSV9DVFJMX1JFRywgCisJCQkJICByZWd2YWwgfCBJWF9FVEhfTUlJX0NSX0xPT1BCQUNLKQorCSAgICAgPT0gSVhfRVRIX0FDQ19TVUNDRVNTKQorCSAgeworCSAgICAgIHJldHVybiBJWF9TVUNDRVNTOworCSAgfQorICAgICAgfQorICB9CisgIHJldHVybiBJWF9GQUlMOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogIERpc2FibGUgdGhlIFBIWSBMb29wYmFjayBhdCB0aGUgc3BlY2lmaWVkIGFkZHJlc3MKKyAqLworUFVCTElDIElYX1NUQVRVUworaXhFdGhNaWlQaHlMb29wYmFja0Rpc2FibGUgKFVJTlQzMiBwaHlBZGRyKQoreworICBVSU5UMTYgcmVndmFsIDsgIAorCisgIGlmICgocGh5QWRkciA8IElYUDQyNV9FVEhfQUNDX01JSV9NQVhfQUREUikgJiYgCisgICAgICAoSVhfRVRIX01JSV9JTlZBTElEX1BIWV9JRCAhPSBpeEV0aE1paVBoeUlkW3BoeUFkZHJdKSkKKyAgeworICAgICAgLyogcmVhZC93cml0ZSB0aGUgY29udHJvbCBy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lfQ1JfTk9STV9FTik7CisJICAgIHJldHVybiBJWF9TVUNDRVNTOworCX0gLyogZW5kIG9mIGlmLWVsc2UoaXhFdGhNaWlQaHlJZCkgKi8KKyAgICB9IC8qIGVuZCBvZiBpZihwaHlBZGRyKSAqLworICAgIHJldHVybiBJWF9GQUlMOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiAgTGluayBzdGF0ZSBxdWVyeSBmdW5jdGlvbnMKKyAqLworCitQVUJMSUMgSVhfU1RBVFVTCitpeEV0aE1paUxpbmtTdGF0dXMoVUlOVDMyIHBoeUFkZHIsCisgICAgICAgICAgIEJPT0wgKmxpbmtVcCwKKyAgICAgICAgICAgQk9PTCAqc3BlZWQxMDAsCisgICAgICAgICAgIEJPT0wgKmZ1bGxEdXBsZXgsCisgICAgICAgICAgIEJPT0wgKmF1dG9uZWcpCit7CisgICAgVUlOVDE2IGN0cmxSZWd2YWwsIHN0YXRSZWd2YWwsIHJlZ3ZhbCwgcmVndmFsNCwgcmVndmFsNTsKKworICAgIC8qIGNoZWNrIHRoZSBwYXJhbWV0ZXJzICovCisgICAgaWYgKChsaW5rVXAgPT0gTlVMTCkgfHwgCisJKHNwZWVkMTAwID09IE5VTEwpIHx8IAorCShmdWxsRHVwbGV4ID09IE5VTEwpIHx8CisJKGF1dG9uZWcgPT0gTlVMTCkpCisgICAgeworCXJldHVybiBJWF9GQUlMOworICAgIH0KKworICAgICpsaW5rVXAgPSBGQUxTRTsKKyAgICAqc3BlZWQxMDAgPSBGQUxTRTsKKyAgICAqZnVsbER1cGxleCA9IEZBTFNFOworICAgICphdXRvbmVnID0gRkFMU0U7CisKKyAgICBpZiAoKHBoeUFkZHIgPCBJWFA0MjVfRVRIX0FDQ19NSUlfTUFYX0FERFIpICYmCisJKGl4RXRoTWlpUGh5SWRbcGh5QWRkcl0gIT0gSVhfRVRIX01JSV9JTlZBTElEX1BIWV9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UmVhZCgpOworCisgIC8qIEZvciBleGFtcGxlOiBUbyBjaGVjayBmb3IgSGFzaGluZyBDb3Byb2Nlc3NvciAoYml0LTIpIAorICAgKiAgICAgICAgICAgICAgICAgICBleHBVbml0ZWcgICAgPSAweDAwMTAKKyAgICogICAgICAgICAgICAgICAgICB+ZXhwVW5pdFJlZyAgID0gMHgxMTAxIAorICAgKiAgICAgICAgICAgICAgICAgIGNvbXBvbmVudFR5cGUgPSAweDAxMDAKKyAgICogICAgfmV4cFVuaXRSZWcgJiBjb21wb25lbnRUeXBlID0gMHgwMTAwIChOb3QgemVybykgICAgICAgICAgICAgICAgICAgICAgCisgICAqLworIAorICAvKiAKKyAgICogSW52ZXJzZSB0aGUgYml0IHZhbHVlIGJlY2F1c2UgYXZhaWxhYmxlIGNvbXBvbmVudCBpcyAwIGluIHZhbHVlIAorICAgKi8KKyAgZXhwVW5pdFJlZyA9IH5leHBVbml0UmVnIDsKKworICBpZiAoZXhwVW5pdFJlZyAmIG1hc2spCisgIHsKKyAgICAgcmV0dXJuIChJWF9GRUFUVVJFX0NUUkxfQ09NUE9ORU5UX0VOQUJMRUQpOworICB9ICAgCisgIGVsc2UKKyAgeyAgCisgICAgIHJldHVybiAoSVhfRkVBVFVSRV9DVFJMX0NPTVBPTkVOVF9ESVNBQkxFRCk7CisgIH0gCit9CisKKworLyoqCisgKiBGdW5jdGlvbiBkZWZpbml0aW9uOiBpeEZlYXR1cmVDdHJsUHJvZHVjdElkUmVhZAorICovCitJeEZlYXR1cmVDdHJsUHJvZHVjdElkCitpeEZlYXR1cmVDdHJsUHJvZHVjdElkUmVhZCAoKQoreworI2lmIENQVSE9U0lNU1BBUkNTT0xBUklTCisgIEl4RmVhdHVyZUN0cmxQcm9kdWN0SWQgIHBkSWQgPSAwIDsKKyAgIAorICAvKiBVc2UgQVJNIGluc3RydWN0aW9uIHRvIG1vdmUgcmVnaXN0ZXIwIGZyb20gY29wcm9jZXNzb3IgdG8gQVJNIHJlZ2lzdGVy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E1pY3JvY29kZUltYWdlTGlicmFyeU92ZXJyaWRlIC0gIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJpbnZhbGlkIHBhcmFtZXRlclxuIik7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHN0YXR1cyA9IGl4TnBlRGxJbWFnZU1nck1pY3JvY29kZUltYWdlTGlicmFyeU92ZXJyaWRlIChjbGllbnRJbWFnZUxpYnJhcnkpOworICAgICAgICBpZiAoc3RhdHVzICE9IElYX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIHN0YXR1cyA9IElYX0ZBSUw7CisgICAgICAgIH0KKyAgICB9IC8qIGVuZCBvZiBpZi1lbHNlKGNsaWVudEltYWdlTGlicmFyeSkgKi8KKworICAgIElYX05QRURMX1RSQUNFMSAoSVhfTlBFRExfRk5fRU5UUllfRVhJVCwKKyAgICAgICAgICAgICAgICAgICAgICJFeGl0aW5nIGl4TnBlRGxNaWNyb2NvZGVJbWFnZUxpYnJhcnlPdmVycmlkZSA6ICIKKyAgICAgICAgICAgICAgICAgICAgICJzdGF0dXMgPSAlZFxuIiwgc3RhdHVzKTsKKyAgICByZXR1cm4gc3RhdHVzOworfQorCisvKgorICogRnVuY3Rpb24gZGVmaW5pdGlvbjogaXhOcGVEbEltYWdlRG93bmxvYWQKKyAqLworUFVCTElDIElYX1NUQVRVUworaXhOcGVEbEltYWdlRG93bmxvYWQgKEl4TnBlRGxJbWFnZUlkICppbWFnZUlkUHRyLAorICAgICAgICAgICAgICAgICAgICAgIEJPT0wgdmVyaWZ5KQoreworICAgIFVJTlQzMiAgICAgICAgaW1hZ2VTaXplOworICAgIFVJTlQzMiAgICAgICAqaW1hZ2VDb2RlUHRyICA9IE5VTEw7CisgICAgSVhfU1RBVFVTICAgICBzdGF0dXM7CisgICAgSXhOcGVEbE5wZUlkICBucGVJZCAgICAgICAgICAgPSBpbWFnZUlkUHRyLT5ucGVJZDsKKworICAgIElYX05QRURMX1RSQUNFMCAoSVhfTlBFRExfRk5fRU5UUllfRVhJVCwKKyAgICAgICAgICAgICAgICAgICAgICJFbnRlcmluZyBpeE5wZURsSW1hZ2VEb3dubG9hZFxuIik7CisKKyAgICBpeE5wZURsU3RhdHMuYXR0ZW1wdGVkRG93bmxvYWRzKys7CisKKyAgICAvKiBDaGVjayBpbnB1dCBwYXJhbWV0ZXJzICovCisgICAgaWYgKChucGVJZCA+PSBJWF9OUEVETF9OUEVJRF9NQVgpIHx8IChucGVJZCA8IDApKQorICAgIHsKKyAgICAgICAgc3RhdHVzID0gSVhfTlBFRExfUEFSQU1fRVJSOworICAgICAgICBJWF9OUEVETF9FUlJPUl9SRVBPUlQgKCJpeE5wZURsSW1hZ2VEb3dubG9hZCAtIGludmFsaWQgcGFyYW1ldGVyXG4iKTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgLyogRW5zdXJlIGluaXRpYWxpc2F0aW9uIGhhcyBiZWVuIGNvbXBsZXRlZCAqLworICAgICAgICBpeE5wZURsTnBlTWdySW5pdCgpOworCisJLyogSWYgbm90IElYUDQyWCBBMCBzdGVwcGluZywgcHJvY2VlZCB0byBjaGVjayBmb3IgZXhpc3RlbmNlIG9mIG5wZSdzICovCisJaWYgKChJWF9GRUFUVVJFX0NUUkxfU0lMSUNPTl9UWVBFX0EwICE9CisJICAgICAoaXhGZWF0dXJlQ3RybFByb2R1Y3RJZFJlYWQoKSAmIElYX0ZFQVRVUkVfQ1RSTF9TSUxJQ09OX1NURVBQSU5HX01BU0spKQorCSAgICB8fCAoSVhfRkVBVFVSRV9DVFJMX0RFVklDRV9UWVBFX0lYUDQyWCAhPSBpeEZlYXR1cmVDdHJsRGV2aWNlUmVhZCAoKSkpCisJeworICAgICAgICAgICAgaWYgKG5wZUlkID09IElYX05QRURMX05QRUlEX05QRUEpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKGl4RmVhdHVyZUN0cmxDb21wb25lbnRDaGVjayhJWF9GRUFUVVJFQ1RSTF9OUEVBKSA9PQorICAgICAgICAgICAgICAgICAgICBJWF9GRUFUVVJFX0NUUkxfQ09NUE9ORU5UX0RJU0FCTEVEKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgSVhfTlBFRExfV0FSTklOR19SRVBPUlQoIldhcm5pbmc6IHRoZSBOUEUgQSBjb21wb25lbnQgeW91IHNwZWNpZmllZCBkb2VzIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIG5vdCBleGlzdFxuIik7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBJWF9TVUNDRVNTOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gLyogZW5kIG9mIGlmKG5wZUlkKSAqLworICAgICAgICAgICAgZWxzZSBpZiAobnBlSWQgPT0gSVhfTlBFRExfTlBFSURfTlBFQikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoaXhGZWF0dXJlQ3RybENvbXBvbmVudENoZWNrKElYX0ZFQVRVUkVDVFJMX05QRUIpPT0KKyAgICAgICAgICAgICAgICAgICAgSVhfRkVBVFVSRV9DVFJMX0NPTVBPTkVOVF9ESVNBQkxFRCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIElYX05QRURMX1dBUk5JTkdfUkVQT1JUKCJXYXJuaW5nOiB0aGUgTlBFIEIgY29tcG9uZW50IHlvdSBzcGVjaWZpZWQiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgZG9lcyBub3QgZXhpc3RcbiIpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gSVhfU1VDQ0VTUzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IC8qIGVuZCBvZiBlbHNlaWYobnBlSWQpICovCisgICAgICAgICAgICBlbHNlIGlmIChucGVJZCA9PSBJWF9OUEVETF9OUEVJRF9OUEVDKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChpeEZlYXR1cmVDdHJsQ29tcG9uZW50Q2hlY2soSVhfRkVBVFVSRUNUUkxfTlBFQyk9PQorICAgICAgICAgICAgICAgICAgICBJWF9GRUFUVVJFX0NUUkxfQ09NUE9ORU5UX0RJU0FCTEVEKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgSVhfTlBFRExfV0FSTklOR19SRVBPUlQoIldhcm5pbmc6IHRoZSBOUEUgQyBjb21wb25lbnQgeW91IHNwZWNpZmllZCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBkb2VzIG5vdCBleGlzdFxuIik7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBJWF9TVUNDRVNTOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gLyogZW5kIG9mIGVsc2VpZihucGVJZCkgKi8KKyAgICAgICAgfSAvKiBlbmQgb2YgaWYoSVhfRkVBVFVSRV9DVFJMX1NJTElDT05fVFlQRV9CMCkgKi8gLypFbmQgb2YgU2lsaWNvbiBUeXBlIENoZWNrKi8KKworICAgICAgICAvKiBzdG9wIGFuZCByZXNldCB0aGUgTlBFICovCisgICAgICAgIGlmIChJWF9TVUNDRVNTICE9IGl4TnBlRGxOcGVTdG9wQW5kUmVzZXQgKG5wZUlkKSkKKyAgICAgICAgeworICAgICAgICAgICAgSVhfTlBFRExfRVJST1JfUkVQT1JUICgiRmFpbGVkIHRvIHN0b3AgYW5kIHJlc2V0IE5QRVxuIik7CisgICAgICAgICAgICByZXR1cm4gSVhfRkFJTDsKKyAgICAgICAgfQorCisgICAgICAgIC8qIExvY2F0ZSBpbWFnZSAqLworICAgICAgICBzdGF0dXMgPSBpeE5wZURsSW1hZ2VNZ3JJbWFnZUxvY2F0ZSAoaW1hZ2VJZFB0ciwgJmltYWdlQ29kZVB0ciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZpbWFnZVNpemUpOworICAgICAgICBpZiAoSVhfU1VDQ0VTUyA9PSBzdGF0dXMpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgKiBJZiBkb3dubG9hZCB3YXMgc3VjY2Vzc2Z1bCwgc3RvcmUgaW1hZ2UgSWQgaW4gbGlzdCBvZgorICAgICAgICAgICAgICogY3VycmVudGx5IGxvYWRlZCBpbWFnZXMuIElmIGEgY3JpdGljYWwgZXJyb3Igb2NjdXJlZAorICAgICAgICAgICAgICogZHVyaW5nIGRvd25sb2FkLCByZWNvcmQgdGhhdCB0aGUgTlBFIGhhcyBhbiBpbnZhbGlkIGltYWdlCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHN0YXR1cyA9IGl4TnBlRGxOcGVNZ3JJbWFnZUxvYWQgKG5wZUlkLCBpbWFnZUNvZGVQdHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ZXJpZnkpOworICAgICAgICAgICAgaWYgKElYX1NVQ0NFU1MgPT0gc3RhdHVzKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGl4TnBlRGxOcGVTdGF0ZVtucGVJZF0uaW1hZ2VJZCA9ICppbWFnZUlkUHRyOworICAgICAgICAgICAgICAgIGl4TnBlRGxOcGVTdGF0ZVtucGVJZF0udmFsaWRJbWFnZSA9IFRSVUU7CisgICAgICAgICAgICAgICAgaXhOcGVEbFN0YXRzLnN1Y2Nlc3NmdWxEb3dubG9hZHMrKzsKKworICAgICAgICAgICAgICAgIHN0YXR1cyA9ICBpeE5wZURsTnBlRXhlY3V0aW9uU3RhcnQgKG5wZUlkKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKChzdGF0dXMgPT0gSVhfTlBFRExfQ1JJVElDQUxfTlBFX0VSUikgfHwKKyAgICAgICAgICAgICAgICAgICAgIChzdGF0dXMgPT0gSVhfTlBFRExfQ1JJVElDQUxfTUlDUk9DT0RFX0VSUikpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaXhOcGVEbE5wZVN0YXRlW25wZUlkXS5pbWFnZUlkID0gKmltYWdlSWRQdHI7CisgICAgICAgICAgICAgICAgaXhOcGVEbE5wZVN0YXRlW25wZUlkXS52YWxpZEltYWdlID0gRkFMU0U7CisgICAgICAgICAgICAgICAgaXhOcGVEbFN0YXRzLmNyaXRpY2FsRmFpbERvd25sb2FkcysrOworICAgICAgICAgICAgfQorICAgICAgICB9IC8qIGVuZCBvZiBpZihJWF9TVUNDRVNTKSAqLyAvKiBjb25kaXRpb246IGltYWdlIGxvY2F0ZWQgc3VjY2Vzc2Z1bGx5IGluIG1pY3JvY29kZSBpbWFnZSAqLworICAgIH0gLyogZW5kIG9mIGlmLWVsc2UobnBlSWQpICovIC8qIGNvbmRpdGlvbjogcGFyYW1ldGVyIGNoZWNrcyBvayAqLworCisgICAgSVhfTlBFRExfVFJBQ0UxIChJWF9OUEVETF9GTl9FTlRSWV9FWElULAorICAgICAgICAgICAgICAgICAgICAgIkV4aXRpbmcgaXhOcGVEbEltYWdlRG93bmxvYWQgOiBzdGF0dXMgPSAlZFxuIiwgc3RhdHVzKTsKKyAgICByZXR1cm4gc3RhdHVzOworfQorCisvKgorICogRnVuY3Rpb24gZGVmaW5pdGlvbjogaXhOcGVEbEF2YWlsYWJsZUltYWdlc0NvdW50R2V0CisgKi8KK1BVQkxJQyBJWF9TVEFUVVMKK2l4TnBlRGxBdmFpbGFibGVJbWFnZXNDb3VudEdldCAoVUlOVDMyICpudW1JbWFnZXNQdHIpCit7CisgICAgSVhfU1RBVFVTIHN0YXR1czsKKworICAgIElYX05QRURMX1RSQUNFMCAoSVhfTlBFRExfRk5fRU5UUllfRVhJVCwKKyAgICAgICAgICAgICAgICAgICAgICJFbnRlcmluZyBpeE5wZURsQXZhaWxhYmxlSW1hZ2VzQ291bnRHZXRcbiIpOworCisgICAgLyogQ2hlY2sgaW5wdXQgcGFyYW1ldGVycyAqLworICAgIGlmIChudW1JbWFnZXNQdHIgPT0gTlVMTCkKKyAgICB7CisgICAgICAgIHN0YXR1cyA9IElYX05QRURMX1BBUkFNX0VSUjsKKyAgICAgICAgSVhfTlBFRExfRVJST1JfUkVQT1JUICgiaXhOcGVEbEF2YWlsYWJsZUltYWdlc0NvdW50R2V0IC0gIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJpbnZhbGlkIHBhcmFtZXRlclxuIik7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIC8qCisgICAgICAgICAqIFVzZSBJbWFnZU1nciBtb2R1bGUgdG8gZ2V0IG5vLiBvZiBpbWFnZXMgbGlzdGVkIGluIEltYWdlIExpYnJhcnkgSGVhZGVyLgorICAgICAgICAgKiBJZiBOVUxMIGlzIHBhc3NlZCBhcyBpbWFnZUxpc3RQdHIgcGFyYW1ldGVyIHRvIGZvbGxvd2luZyBmdW5jdGlvbiwKKyAgICAgICAgICogaXQgd2lsbCBvbmx5IGZpbGwgbnVtYmVyIG9mIGltYWdlcyBpbnRvIG51bUltYWdlc1B0cgorICAgICAgICAgKi8KKyAgICAgICAgc3RhdHVzID0gaXhOcGVEbEltYWdlTWdySW1hZ2VMaXN0RXh0cmFjdCAoTlVMTCwgbnVtSW1hZ2VzUHRyKTsKKyAgICB9IC8qIGVuZCBvZiBpZi1lbHNlKG51bUltYWdlc1B0cikgKi8KKworICAgIElYX05QRURMX1RSQUNFMSAoSVhfTlBFRExfRk5fRU5UUllfRVhJVCwKKyAgICAgICAgICAgICAgICAgICAgICJFeGl0aW5nIGl4TnBlRGxBdmFpbGFibGVJbWFnZXNDb3VudEdldCA6ICIKKyAgICAgICAgICAgICAgICAgICAgICJzdGF0dXMgPSAlZFxuIiwgc3RhdHVzKTsKKyAgICByZXR1cm4gc3RhdHVzOworfQorCisvKgorICogRnVuY3Rpb24gZGVmaW5pdGlvbjogaXhOcGVEbEF2YWlsYWJsZUltYWdlc0xpc3RHZXQKKyAqLworUFVCTElDIElYX1NUQVRVUworaXhOcGVEbEF2YWlsYWJsZUltYWdlc0xpc3RHZXQgKEl4TnBlRGxJbWFnZUlkICppbWFnZUlkTGlzdFB0ciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBVSU5UMzIgKmxpc3RTaXplUHRyKQoreworICAgIElYX1NUQVRVUyBzdGF0dXM7CisKKyAgICBJWF9OUEVETF9UUkFDRTAgKElYX05QRURMX0ZOX0VOVFJZX0VYSVQsCisgICAgICAgICAgICAgICAgICAgICAiRW50ZXJpbmcgaXhOcGVEbEF2YWlsYWJsZUltYWdlc0xpc3RHZXRcbiIpOworCisgICAgLyogQ2hlY2sgaW5wdXQgcGFyYW1ldGVycyAqLworICAgIGlmICgoaW1hZ2VJZExpc3RQdHIgPT0gTlVMTCkgfHwgKGxpc3RTaXplUHRyID09IE5VTEwpKQorICAgIHsKKyAgICAgICAgc3RhdHVzID0gSVhfTlBFRExfUEFSQU1fRVJSOworICAgICAgICBJWF9OUEVETF9FUlJPUl9SRVBPUlQgKCJpeE5wZURsQXZhaWxhYmxlSW1hZ2VzTGlzdEdldCAtICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiaW52YWxpZCBwYXJhbWV0ZXJcbiIpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICAvKiBDYWxsIEltYWdlTWdyIHRvIGdldCBsaXN0IG9mIGltYWdlcyBsaXN0ZWQgaW4gSW1hZ2UgTGlicmFyeSBIZWFkZXIgKi8KKyAgICAgICAgc3RhdHVzID0gaXhOcGVEbEltYWdlTWdySW1hZ2VMaXN0RXh0cmFjdCAoaW1hZ2VJZExpc3RQdHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RTaXplUHRyKTsKKyAgICB9IC8qIGVuZCBvZiBpZi1lbHNlKGltYWdlSWRMaXN0UHRyKSAqLworCisgICAgSVhfTlBFRExfVFJBQ0UxIChJWF9OUEVETF9GTl9FTlRSWV9FWElULAorICAgICAgICAgICAgICAgICAgICAgIkV4aXRpbmcgaXhOcGVEbEF2YWlsYWJsZUltYWdlc0xpc3RHZXQgOiBzdGF0dXMgPSAlZFxuIiwKKyAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyk7CisgICAgcmV0dXJuIHN0YXR1czsKK30KKworLyoKKyAqIEZ1bmN0aW9uIGRlZmluaXRpb246IGl4TnBlRGxMb2FkZWRJbWFnZUdldAorICovCitQVUJMSUMgSVhfU1RBVFVTCitpeE5wZURsTG9hZGVkSW1hZ2VHZXQgKEl4TnBlRGxOcGVJZCBucGVJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgSXhOcGVEbEltYWdlSWQgKmltYWdlSWRQdHIpCit7CisgICAgSVhfU1RBVFVTIHN0YXR1cyA9IElYX1NVQ0NFU1M7CisKKyAgICBJWF9OUEVETF9UUkFDRTAgKElYX05QRURMX0ZOX0VOVFJZX0VYSVQsCisgICAgICAgICAgICAgICAgICAgICAiRW50ZXJpbmcgaXhOcGVEbExvYWRlZEltYWdlR2V0XG4iKTsKKworICAgIC8qIENoZWNrIGlucHV0IHBhcmFtZXRlcnMgKi8KKyAgICBpZiAoKG5wZUlkID49IElYX05QRURMX05QRUlEX01BWCkgfHwgKG5wZUlkIDwgMCkgfHwgKGltYWdlSWRQdHIgPT0gTlVMTCkpCisgICAgeworICAgICAgICBzdGF0dXMgPSBJWF9OUEVETF9QQVJBTV9FUlI7CisgICAgICAgIElYX05QRURMX0VSUk9SX1JFUE9SVCAoIml4TnBlRGxMb2FkZWRJbWFnZUdldCAtIGludmFsaWQgcGFyYW1ldGVyXG4iKTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKworICAgICAgICAgLyogSWYgbm90IElYUDQyWCBBMCBzdGVwcGluZywgcHJvY2VlZCB0byBjaGVjayBmb3IgZXhpc3RlbmNlIG9mIG5wZSdzICovCisgICAgICAgICBpZiAoKElYX0ZFQVRVUkVfQ1RSTF9TSUxJQ09OX1RZUEVfQTAgIT0KKwkgICAgICAoaXhGZWF0dXJlQ3RybFByb2R1Y3RJZFJlYWQoKSAmIElYX0ZFQVRVUkVfQ1RSTF9TSUxJQ09OX1NURVBQSU5HX01BU0spKQorCSAgICAgfHwgKElYX0ZFQVRVUkVfQ1RSTF9ERVZJQ0VfVFlQRV9JWFA0MlggIT0gaXhGZWF0dXJlQ3RybERldmljZVJlYWQgKCkpKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAobnBlSWQgPT0gSVhfTlBFRExfTlBFSURfTlBFQSAmJgorICAgICAgICAgICAgICAgIChpeEZlYXR1cmVDdHJsQ29tcG9uZW50Q2hlY2soSVhfRkVBVFVSRUNUUkxfTlBFQSkgPT0KKyAgICAgICAgICAgICAgICAgSVhfRkVBVFVSRV9DVFJMX0NPTVBPTkVOVF9ESVNBQkxFRCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgSVhfTlBFRExfV0FSTklOR19SRVBPUlQoIldhcm5pbmc6IHRoZSBOUEUgQSBjb21wb25lbnQgeW91IHNwZWNpZmllZCBkb2VzIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgbm90IGV4aXN0XG4iKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gSVhfU1VDQ0VTUzsKKyAgICAgICAgICAgIH0gLyogZW5kIG9mIGlmKG5wZUlkKSAqLworCisgICAgICAgICAgICBpZiAobnBlSWQgPT0gSVhfTlBFRExfTlBFSURfTlBFQiAmJgorICAgICAgICAgICAgICAgIChpeEZlYXR1cmVDdHJsQ29tcG9uZW50Q2hlY2soSVhfRkVBVFVSRUNUUkxfTlBFQikgPT0KKyAgICAgICAgICAgICAgICAgSVhfRkVBVFVSRV9DVFJMX0NPTVBPTkVOVF9ESVNBQkxFRCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgSVhfTlBFRExfV0FSTklOR19SRVBPUlQoIldhcm5pbmc6IHRoZSBOUEUgQiBjb21wb25lbnQgeW91IHNwZWNpZmllZCBkb2VzIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgbm90IGV4aXN0XG4iKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gSVhfU1VDQ0VTUzsKKyAgICAgICAgICAgIH0gLyogZW5kIG9mIGlmKG5wZUlkKSAqLworCisgICAgICAgICAgICBpZiAobnBlSWQgPT0gSVhfTlBFRExfTlBFSURfTlBFQyAmJgorICAgICAgICAgICAgICAgIChpeEZlYXR1cmVDdHJsQ29tcG9uZW50Q2hlY2soSVhfRkVBVFVSRUNUUkxfTlBFQykgPT0KKyAgICAgICAgICAgICAgICAgSVhfRkVBVFVSRV9DVFJMX0NPTVBPTkVOVF9ESVNBQkxFRCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgSVhfTlBFRExfV0FSTklOR19SRVBPUlQoIldhcm5pbmc6IHRoZSBOUEUgQyBjb21wb25lbnQgeW91IHNwZWNpZmllZCBkb2VzIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgbm90IGV4aXN0XG4iKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gSVhfU1VDQ0VTUzsKKyAgICAgICAgICAgIH0gLyogZW5kIG9mIGlmKG5wZUlkKSAqLworICAgICAgICB9IC8qIGVuZCBvZiBpZiBub3QgSVhQNDJ4LUEwIHNpbGljb24gKi8KKworICAgICAgICBpZiAoaXhOcGVEbE5wZVN0YXRlW25wZUlkXS52YWxpZEltYWdlKQorICAgICAgICB7CisgICAgICAgICAgICAvKiB1c2UgbnBlSWQgdG8gZ2V0IGltYWdlSWQgZnJvbSBsaXN0IG9mIGN1cnJlbnRseSBsb2FkZWQKKyAgICAgICAgICAgICAgIGltYWdlcyAqLworICAgICAgICAgICAgKmltYWdlSWRQdHIgPSBpeE5wZURsTnBlU3RhdGVbbnBlSWRdLmltYWdlSWQ7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBzdGF0dXMgPSBJWF9GQUlMOworICAgICAgICB9IC8qIGVuZCBvZiBpZi1lbHNlKGl4TnBlRGxOcGVTdGF0ZSkgKi8KKyAgICB9IC8qIGVuZCBvZiBpZi1lbHNlKG5wZUlkKSAqLworCisgICAgSVhfTlBFRExfVFJBQ0UxIChJWF9OUEVETF9GTl9FTlRSWV9FWElULAorICAgICAgICAgICAgICAgICAgICAgIkV4aXRpbmcgaXhOcGVEbExvYWRlZEltYWdlR2V0IDogc3RhdHVzID0gJWRcbiIsCisgICAgICAgICAgICAgICAgICAgICBzdGF0dXMpOworICAgIHJldHVybiBzdGF0dXM7Cit9CisKKy8qCisgKiBGdW5jdGlvbiBkZWZpbml0aW9uOiBpeE5wZURsTGF0ZXN0SW1hZ2VHZXQKKyAqLworUFVCTElDIElYX1NUQVRVUworaXhOcGVEbExhdGVzdEltYWdlR2V0ICgKKyAgICBJeE5wZURsTnBlSWQgbnBlSWQsCisgICAgSXhOcGVEbEZ1bmN0aW9uYWxpdHlJZCBmdW5jdGlvbmFsaXR5SWQsCisgICAgSXhOcGVEbEltYWdlSWQgKmltYWdlSWRQdHIpCit7CisgICAgSVhfU1RBVFVTIHN0YXR1czsKKworICAgIElYX05QRURMX1RSQUNFMCAoSVhfTlBFRExfRk5fRU5UUllfRVhJVCwKKyAgICAgICAgICAgICAgICAgICAgICJFbnRlcmluZyBpeE5wZURsTGF0ZXN0SW1hZ2VHZXRcbiIpOworCisgICAgLyogQ2hlY2sgaW5wdXQgcGFyYW1ldGVycyAqLworICAgIGlmICgobnBlSWQgPj0gSVhfTlBFRExfTlBFSURfTUFYKSB8fAorICAgICAgICAobnBlSWQgPCAwKSB8fAorICAgICAgICAoaW1hZ2VJZFB0ciA9PSBOVUxMKSkKKyAgICB7CisgICAgICAgIHN0YXR1cyA9IElYX05QRURMX1BBUkFNX0VSUjsKKyAgICAgICAgSVhfTlBFRExfRVJST1JfUkVQT1JUICgiaXhOcGVEbExhdGVzdEltYWdlR2V0IC0gIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJpbnZhbGlkIHBhcmFtZXRlclxuIik7CisgICAgfSAvKiBlbmQgb2YgaWYobnBlSWQpICovCisgICAgZWxzZQorICAgIHsKKworCS8qIElmIG5vdCBJWFA0MlggQTAgc3RlcHBpbmcsIHByb2NlZWQgdG8gY2hlY2sgZm9yIGV4aXN0ZW5jZSBvZiBucGUncyAqLworCWlmICgoSVhfRkVBVFVSRV9DVFJMX1NJTElDT05fVFlQRV9BMCAhPQorCSAgICAgKGl4RmVhdHVyZUN0cmxQcm9kdWN0SWRSZWFkKCkgJiBJWF9GRUFUVVJFX0NUUkxfU0lMSUNPTl9TVEVQUElOR19NQVNLKSkKKwkgICAgfHwgKElYX0ZFQVRVUkVfQ1RSTF9ERVZJQ0VfVFlQRV9JWFA0MlggIT0gaXhGZWF0dXJlQ3RybERldmljZVJlYWQgKCkpKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAobnBlSWQgPT0gSVhfTlBFRExfTlBFSURfTlBFQSAmJgorICAgICAgICAgICAgICAgIChpeEZlYXR1cmVDdHJsQ29tcG9uZW50Q2hlY2soSVhfRkVBVFVSRUNUUkxfTlBFQSkgPT0KKyAgICAgICAgICAgICAgICAgSVhfRkVBVFVSRV9DVFJMX0NPTVBPTkVOVF9ESVNBQkxFRCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgSVhfTlBFRExfV0FSTklOR19SRVBPUlQoIldhcm5pbmc6IHRoZSBOUEUgQSBjb21wb25lbnQgeW91IHNwZWNpZmllZCBkb2VzIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgbm90IGV4aXN0XG4iKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gSVhfU1VDQ0VTUzsKKyAgICAgICAgICAgIH0gLyogZW5kIG9mIGlmKG5wZUlkKSAqLworCisgICAgICAgICAgICBpZiAobnBlSWQgPT0gSVhfTlBFRExfTlBFSURfTlBFQiAmJgorICAgICAgICAgICAgICAgIChpeEZlYXR1cmVDdHJsQ29tcG9uZW50Q2hlY2soSVhfRkVBVFVSRUNUUkxfTlBFQikgPT0KKyAgICAgICAgICAgICAgICAgSVhfRkVBVFVSRV9DVFJMX0NPTVBPTkVOVF9ESVNBQkxFRCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgSVhfTlBFRExfV0FSTklOR19SRVBPUlQoIldhcm5pbmc6IHRoZSBOUEUgQiBjb21wb25lbnQgeW91IHNwZWNpZmllZCBkb2VzIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgbm90IGV4aXN0XG4iKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gSVhfU1VDQ0VTUzsKKyAgICAgICAgICAgIH0gLyogZW5kIG9mIGlmKG5wZUlkKSAqLworCisgICAgICAgICAgICBpZiAobnBlSWQgPT0gSVhfTlBFRExfTlBFSURfTlBFQyAmJgorICAgICAgICAgICAgICAgIChpeEZlYXR1cmVDdHJsQ29tcG9uZW50Q2hlY2soSVhfRkVBVFVSRUNUUkxfTlBFQykgPT0KKyAgICAgICAgICAgICAgICAgSVhfRkVBVFVSRV9DVFJMX0NPTVBPTkVOVF9ESVNBQkxFRCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgSVhfTlBFRExfV0FSTklOR19SRVBPUlQoIldhcm5pbmc6IHRoZSBOUEUgQyBjb21wb25lbnQgeW91IHNwZWNpZmllZCBkb2VzIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgbm90IGV4aXN0XG4iKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gSVhfU1VDQ0VTUzsKKyAgICAgICAgICAgIH0gLyogZW5kIG9mIGlmKG5wZUlkKSAqLworICAgICAgICB9IC8qIGVuZCBvZiBpZiBub3QgSVhQNDJ4LUEwIHNpbGljb24gKi8KKworICAgICAgICBpbWFnZUlkUHRyLT5ucGVJZCA9IG5wZUlkOworICAgICAgICBpbWFnZUlkUHRyLT5mdW5jdG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bE5wZU1nckluaXQoKTsKKworICAgIC8qIElmIG5vdCBJWFA0MlggQTAgc3RlcHBpbmcsIHByb2NlZWQgdG8gY2hlY2sgZm9yIGV4aXN0ZW5jZSBvZiBucGUncyAqLworICAgIGlmICgoSVhfRkVBVFVSRV9DVFJMX1NJTElDT05fVFlQRV9BMCAhPQorCSAoaXhGZWF0dXJlQ3RybFByb2R1Y3RJZFJlYWQoKSAmIElYX0ZFQVRVUkVfQ1RSTF9TSUxJQ09OX1NURVBQSU5HX01BU0spKQorCXx8IChJWF9GRUFUVVJFX0NUUkxfREVWSUNFX1RZUEVfSVhQNDJYICE9IGl4RmVhdHVyZUN0cmxEZXZpY2VSZWFkICgpKSkKKyAgICB7CisgICAgICAgIC8qCisgICAgICAgICAqIENoZWNrIHdoZXRoZXIgTlBFIGlzIHByZXNlbnQKKyAgICAgICAgICovCisgICAgICAgIGlmIChJWF9OUEVETF9OUEVJRF9OUEVBID09IG5wZUlkKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBDaGVjayB3aGV0aGVyIE5QRSBBIGlzIHByZXNlbnQgKi8KKyAgICAgICAgICAgIGlmIChpeEZlYXR1cmVDdHJsQ29tcG9uZW50Q2hlY2soSVhfRkVBVFVSRUNUUkxfTlBFQSk9PQorICAgICAgICAgICAgICAgIElYX0ZFQVRVUkVfQ1RSTF9DT01QT05FTlRfRElTQUJMRUQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogTlBFIEEgZG9lcyBub3QgcHJlc2VudCAqLworICAgICAgICAgICAgICAgIElYX05QRURMX1dBUk5JTkdfUkVQT1JUICgiaXhOcGVEbE5wZVN0b3BBbmRSZXNldCAtIFdhcm5pbmc6TlBFQSBkb2VzIG5vdCBwcmVzZW50LlxuIik7CisgICAgICAgICAgICAgICAgcmV0dXJuIElYX1NVQ0NFU1M7CisgICAgICAgICAgICB9CisgICAgICAgIH0gLyogZW5kIG9mIGlmKElYX05QRURMX05QRUlEX05QRUEpICovCisgICAgICAgIGVsc2UgaWYgKElYX05QRURMX05QRUlEX05QRUIgPT0gbnBlSWQpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIENoZWNrIHdoZXRoZXIgTlBFIEIgaXMgcHJlc2VudCAqLworICAgICAgICAgICAgaWYgKGl4RmVhdHVyZUN0cmxDb21wb25lbnRDaGVjayhJWF9GRUFUVVJFQ1RSTF9OUEVCKT09CisgICAgICAgICAgICAgICAgSVhfRkVBVFVSRV9DVFJMX0NPTVBPTkVOVF9ESVNBQkxFRCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBOUEUgQiBkb2VzIG5vdCBwcmVzZW50ICovCisgICAgICAgICAgICAgICAgSVhfTlBFRExfV0FSTklOR19SRVBPUlQgKCJpeE5wZURsTnBlU3RvcEFuZFJlc2V0IC0gV2FybmluZzpOUEVCIGRvZXMgbm90IHByZXNlbnQuXG4iKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gSVhfU1VDQ0VTUzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSAvKiBlbmQgb2YgZWxzZWlmKElYX05QRURMX05QRUlEX05QRUIpICovCisgICAgICAgIGVsc2UgaWYgKElYX05QRURMX05QRUlEX05QRUMgPT0gbnBlSWQpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIENoZWNrIHdoZXRoZXIgTlBFIEMgaXMgcHJlc2VudCAqLworICAgICAgICAgICAgaWYgKGl4RmVhdHVyZUN0cmxDb21wb25lbnRDaGVjayhJWF9GRUFUVVJFQ1RSTF9OUEVDKT09CisgICAgICAgICAgICAgICAgSVhfRkVBVFVSRV9DVFJMX0NPTVBPTkVOVF9ESVNBQkxFRCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBOUEUgQyBkb2VzIG5vdCBwcmVzZW50ICovCisgICAgICAgICAgICAgICAgSVhfTlBFRExfV0FSTklOR19SRVBPUlQgKCJpeE5wZURsTnBlU3RvcEFuZFJlc2V0IC0gV2FybmluZzpOUEVDIGRvZXMgbm90IHByZXNlbnQuXG4iKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gSVhfU1VDQ0VTUzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSAvKiBlbmQgb2YgZWxzZWlmKElYX05QRURMX05QRUlEX05QRUMpICovCisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLyogSW52YWxpZCBOUEUgSUQgKi8KKyAgICAgICAgICAgIElYX05QRURMX0VSUk9SX1JFUE9SVCAoIml4TnBlRGxOcGVTdG9wQW5kUmVzZXQgLSBpbnZhbGlkIE5wZSBJRFxuIik7CisgICAgICAgICAgICBzdGF0dXMgPSBJWF9OUEVETF9QQVJBTV9FUlI7CisgICAgICAgIH0gLyogZW5kIG9mIGlmLWVsc2UoSVhfTlBFRExfTlBFSURfTlBFQykgKi8KKyAgICB9IC8qIGVuZCBvZiBpZiBub3QgSVhQNDJ4LUEwIFNpbGljb24gKi8KKworICAgIGlmIChzdGF0dXMgPT0gSVhfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIC8qIGNhbGwgTnBlTWdyIGZ1bmN0aW9uIHRvIHN0b3AgdGhlIE5QRSAqLworICAgICAgICBzdGF0dXMgPSBpeE5wZURsTnBlTWdyTnBlU3RvcCAobnBlSWQpOworICAgICAgICBpZiAoc3RhdHVzID09IElYX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIGNhbGwgTnBlTWdyIGZ1bmN0aW9uIHRvIHJlc2V0IHRoZSBOUEUgKi8KKyAgICAgICAgICAgIHN0YXR1cyA9IGl4TnBlRGxOcGVNZ3JOcGVSZXNldCAobnBlSWQpOworICAgICAgICB9CisgICAgfSAvKiBlbmQgb2YgaWYoc3RhdHVzKSAqLworCisgICAgSVhfTlBFRExfVFJBQ0UxIChJWF9OUEVETF9GTl9FTlRSWV9FWElULAorICAgICAgICAgICAgICAgICAgICAgIkV4aXRpbmcgaXhOcGVEbE5wZVN0b3BBbmRSZXNldCA6I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EVJRF9OUEVBID09IG5wZUlkKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBDaGVjayB3aGV0aGVyIE5QRSBBIGlzIHByZXNlbnQgKi8KKyAgICAgICAgICAgIGlmIChpeEZlYXR1cmVDdHJsQ29tcG9uZW50Q2hlY2soSVhfRkVBVFVSRUNUUkxfTlBFQSk9PQorICAgICAgICAgICAgICAgIElYX0ZFQVRVUkVfQ1RSTF9DT01QT05FTlRfRElTQUJMRUQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogTlBFIEEgZG9lcyBub3QgcHJlc2VudCAqLworICAgICAgICAgICAgICAgIElYX05QRURMX1dBUk5JTkdfUkVQT1JUICgiaXhOcGVEbE5wZUV4ZWN1dGlvblN0YXJ0IC0gV2FybmluZzpOUEVBIGRvZXMgbm90IHByZXNlbnQuXG4iKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gSVhfU1VDQ0VTUzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSAvKiBlbmQgb2YgaWYoSVhfTlBFRExfTlBFSURfTlBFQSkgKi8KKyAgICAgICAgZWxzZSBpZiAoSVhfTlBFRExfTlBFSURfTlBFQiA9PSBucGVJZCkKKyAgICAgICAgeworICAgICAgICAgICAgLyogQ2hlY2sgd2hldGhlciBOUEUgQiBpcyBwcmVzZW50ICovCisgICAgICAgICAgICBpZiAoaXhGZWF0dXJlQ3RybENvbXBvbmVudENoZWNrKElYX0ZFQVRVUkVDVFJMX05QRUIpPT0KKyAgICAgICAgICAgICAgICBJWF9GRUFUVVJFX0NUUkxfQ09NUE9ORU5UX0RJU0FCTEVEKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIE5QRSBCIGRvZXMgbm90IHByZXNlbnQgKi8KKyAgICAgICAgICAgICAgICBJWF9OUEVETF9XQVJOSU5HX1JFUE9SVCAoIml4TnBlRGxOcGVFeGVjdXRpb25TdGFydCAtIFdhcm5pbmc6TlBFQiBkb2VzIG5vdCBwcmVzZW50LlxuIik7CisgICAgICAgICAgICAgICAgcmV0dXJuIElYX1NVQ0NFU1M7CisgICAgICAgICAgICB9CisgICAgICAgIH0gLyogZW5kIG9mIGVsc2VpZihJWF9OUEVETF9OUEVJRF9OUEVCKSAqLworICAgICAgICBlbHNlIGlmIChJWF9OUEVETF9OUEVJRF9OUEVDID09ICBucGVJZCkKKyAgICAgICAgeworICAgICAgICAgICAgLyogQ2hlY2sgd2hldGhlciBOUEUgQyBpcyBwcmVzZW50ICovCisgICAgICAgICAgICBpZiAoaXhGZWF0dXJlQ3RybENvbXBvbmVudENoZWNrKElYX0ZFQVRVUkVDVFJMX05QRUMpPT0KKyAgICAgICAgICAgICAgICBJWF9GRUFUVVJFX0NUUkxfQ09NUE9ORU5UX0RJU0FCTEVEKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIE5QRSBDIGRvZXMgbm90IHByZXNlbnQgKi8KKyAgICAgICAgICAgICAgICBJWF9OUEVETF9XQVJOSU5HX1JFUE9SVCAoIml4TnBlRGxOcGVFeGVjdXRpb25TdGFydCAtIFdhcm5pbmc6TlBFQyBkb2VzIG5vdCBwcmVzZW50LlxuIik7CisgICAgICAgICAgICAgICAgcmV0dXJuIElYX1NVQ0NFU1M7CisgICAgICAgICAgICB9CisgICAgICAgIH0gLyogZW5kIG9mIGVsc2VpZihJWF9OUEVETF9OUEVJRF9OUEVDKSAqLworICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIEludmFsaWQgTlBFIElEICovCisgICAgICAgICAgICBJWF9OUEVETF9FUlJPUl9SRVBPUlQgKCJpeE5wZURsTnBlRXhlY3V0aW9uU3RhcnQgLSBpbnZhbGlkIE5wZSBJRFxuIik7CisgICAgICAgICAgICByZXR1cm4gSVhfTlBFRExfUEFSQU1fRVJSOworICAgICAgICB9IC8qIGVuZCBvZiBpZi1lbHNlKElYX05QRURMX05QRUlEX05QRUMpICovCisgICAgfSAvKiBlbmQgb2YgaWYgbm90IElYUDQyeC1BMCBTaWxpY29uICovCisKKyAgICBpZiAoVFJVRSA9PSBpeE5wZURsTnBlU3RhcnRlZFtucGVJZF0pCisgICAgeworICAgICAgICAvKiBOUEUgaGFzIGJlZW4gc3RhcnRlZC4gKi8KKyAgICAgICAgcmV0dXJuIElYX1NVQ0NFU1MgOworICAgIH0KKworICAgIC8qIEVuc3VyZSBpbml0aWFsaXNhdGlvbiBoYXMgYmVlbiBjb21wbGV0ZWQgKi8KKyAgICBpeE5wZURsTnBlTWdySW5pdCgpOworCisgICAgLyogY2FsbCBOcGVNZ3IgZnVuY3Rpb24gdG8gc3RhcnQgdGhlIE5QRSAqLworICAgIHN0YXR1cyA9IGl4TnBlRGxOcGVNZ3JOcGVTdGFydCAobnBlSWQpOworCisgICAgaWYgKElYX1NVQ0NFU1MgPT0gc3RhdHVzKQorICAgIHsKKyAgICAgICAgLyogSW5kaWNhdGUgTlBFIGhhcyBzdGFydGVkICovCisgICAgICAgIGl4TnBlRGxOcGVTdGFydGVkW25wZUlkXSA9IFRSVUUgOworICAgIH0KKworICAgIElYX05QRURMX1RSQUNFMSAoSVhfTlBFRExfRk5fRU5UUllfRVhJVCwKKyAgICAgICAgICAgICAgICAgICAgICJFeGl0aW5nIGl4TnBlRGxOcGVFeGVjdXRpb25TdGFydCA6IHN0YXR1cyA9ICVkXG4iLAorICAgICAgICAgICAgICAgICAgICAgc3RhdHVzKTsKKworICAgIHJldHVybiBzdGF0dXM7Cit9CisKKy8qCisgKiBGdW5jdGlvbiBkZWZpbml0aW9uOiBpeE5wZURsTnBlRXhlY3V0aW9uU3RvcAorICovCitQVUJMSUMgSVhfU1RBVFVTCitpeE5wZURsTnBlRXhlY3V0aW9uU3RvcCAoSXhOcGVEbE5wZUlkIG5wZUlkKQoreworICAgIElYX1NUQVRVUyBzdGF0dXMgPSBJWF9TVUNDRVNTOworCisgICAgSVhfTlBFRExfVFJBQ0UwIChJWF9OUEVETF9GTl9FTlRSWV9FWElULAorICAgICAgICAgICAgICAgICA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dCBwcmVzZW50LlxuIik7CisgICAgICAgICAgICAgICAgcmV0dXJuIElYX1NVQ0NFU1M7CisgICAgICAgICAgICB9CisgICAgICAgIH0gLyogZW5kIG9mIGlmKElYX05QRURMX05QRUlEX05QRUEpICovCisgICAgICAgIGVsc2UgaWYgKElYX05QRURMX05QRUlEX05QRUIgPT0gbnBlSWQpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIENoZWNrIHdoZXRoZXIgTlBFIEIgaXMgcHJlc2VudCAqLworICAgICAgICAgICAgaWYgKGl4RmVhdHVyZUN0cmxDb21wb25lbnRDaGVjayhJWF9GRUFUVVJFQ1RSTF9OUEVCKT09CisgICAgICAgICAgICAgICAgSVhfRkVBVFVSRV9DVFJMX0NPTVBPTkVOVF9ESVNBQkxFRCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBOUEUgQiBkb2VzIG5vdCBwcmVzZW50ICovCisgICAgICAgICAgICAgICAgSVhfTlBFRExfV0FSTklOR19SRVBPUlQgKCJpeE5wZURsTnBlRXhlY3V0aW9uU3RvcCAtIFdhcm5pbmc6TlBFQiBkb2VzIG5vdCBwcmVzZW50LlxuIik7CisgICAgICAgICAgICAgICAgcmV0dXJuIElYX1NVQ0NFU1M7CisgICAgICAgICAgICB9CisgICAgICAgIH0gLyogZW5kIG9mIGVsc2VpZihJWF9OUEVETF9OUEVJRF9OUEVCKSAqLworICAgICAgICBlbHNlIGlmIChJWF9OUEVETF9OUEVJRF9OUEVDID09IG5wZUlkKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBDaGVjayB3aGV0aGVyIE5QRSBDIGlzIHByZXNlbnQgKi8KKyAgICAgICAgICAgIGlmIChpeEZlYXR1cmVDdHJsQ29tcG9uZW50Q2hlY2soSVhfRkVBVFVSRUNUUkxfTlBFQyk9PQorICAgICAgICAgICAgICAgIElYX0ZFQVRVUkVfQ1RSTF9DT01QT05FTlRfRElTQUJMRUQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogTlBFIEMgZG9lcyBub3QgcHJlc2VudCAqLworICAgICAgICAgICAgICAgIElYX05QRURMX1dBUk5JTkdfUkVQT1JUICgiaXhOcGVEbE5wZUV4ZWN1dGlvblN0b3AgLSBXYXJuaW5nOk5QRUMgZG9lcyBub3QgcHJlc2VudC5cbiIpOworICAgICAgICAgICAgICAgIHJldHVybiBJWF9TVUNDRVNTOworICAgICAgICAgICAgfQorICAgICAgICB9IC8qIGVuZCBvZiBlbHNlaWYoSVhfTlBFRExfTlBFSURfTlBFQykgKi8KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICAvKiBJbnZhbGlkIE5QRSBJRCAqLworICAgICAgICAgICAgSVhfTlBFRExfRVJST1JfUkVQT1JUICgiaXhOcGVEbE5wZUV4ZWN1dGlvblN0b3AgLSBpbnZhbGlkIE5wZSBJRFxuIik7CisgICAgICAgICAgICBzdGF0dXMgPSBJWF9OUEVETF9QQVJBTV9FUlI7CisgICAgICAgIH0gLyogZW5kIG9mIGlmLWVsc2UoSVhfTlBFRExfTlBFSURfTlBFQykgKi8KKyAgICB9IC8qIGVuZCBvZiBpZiBub3QgSVhQNDJYLUFPIFNpbGljb24gKi8KKworICAgIGlmIChzdGF0dXMgPT0gSVhfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIC8qIGNhbGwgTnBlTWdyIGZ1bmN0aW9uIHRvIHN0b3AgdGhlIE5QRSAqLworICAgICAgICBzdGF0dXMgPSBpeE5wZURsTnBlTWdyTnBlU3RvcCAobnBlSWQpOworICAgIH0KKworICAgIElYX05QRURMX1RSQUNFMSAoSVhfTlBFRExfRk5fRU5UUllfRVhJVCwKKyAgICAgICAgICAgICAgICAgICAgICJFeGl0aW5nIGl4TnBlRGxOcGVFeGVjdXRpb25TdG9wIDogc3RhdHVzID0gJWRcbiIsCisgICAgICAgICAgICAgICAgICAgICBzdGF0dXMpOworCisgICAgaWYgKElYX1NVQ0NFU1MgPT0gc3RhdHVzKQorICAgIHsKKyAgICAgICAgLyogSW5kaWNhdGUgTlBFIGhhcyBiZWVuIHN0b3BwZWQgKi8KKyAgICAgICAgaXhOcGVEbE5wZVN0YXJ0ZWRbbnBlSWRdID0gRkFMU0UgOworICAgIH0KKworICAgIHJldHVybiBzdGF0dXM7Cit9CisKKy8qCisgKiBGdW5jdGlvbiBkZWZpbml0aW9uOiBpeE5wZURsVW5sb2FkCisgKi8KK1BVQkxJQyBJWF9TVEFUVVMKK2l4TnBlRGxVbmxvYWQgKHZvaWQpCit7CisgICAgSVhfU1RBVFVTIHN0YXR1czsKKworICAgIElYX05QRURMX1RSQUNFMCAoSVhfTlBFRExfRk5fRU5UUllfRVhJVCwKKyAgICAgICAgICAgICAgICAgICAgICJFbnRlcmluZyBpeE5wZURsVW5sb2FkXG4iKTsKKworICAgIHN0YXR1cyA9IGl4TnBlRGxOcGVNZ3JVbmluaXQoKTsKKworICAgIElYX05QRURMX1RSQUNFMSAoSVhfTlBFRExfRk5fRU5UUllfRVhJVCwKKyAgICAgICAgICAgICAgICAgICAgICJFeGl0aW5nIGl4TnBlRGxVbmxvYWQgOiBzdGF0dXMgPSAlZFxuIiwKKyAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyk7CisgICAgcmV0dXJuIHN0YXR1czsKK30KKworLyoKKyAqIEZ1bmN0aW9uIGRlZmluaXRpb246IGl4TnBlRGxTdGF0c1Nob3cKKyAqLworUFVCTElDIHZvaWQKK2l4TnBlRGxTdGF0c1Nob3cgKHZvaWQpCit7CisgICAgaXhPc2FsTG9nIChJWF9PU0FMX0xPR19MVkxfVVNFUiwKKyAgICAgICAgICAgICAgIElYX09TQUxfTE9HX0RFVl9TVERPVVQsCisgICAgICAgICAgICAgICAiXG5peE5wZURsU3RhdHNTaG93OlxuIgorICAgICAgICAgICAgICAgIlx0RG93bmxvYWRzIEF0dGVtcHRlZCBieSB1c2VyOiAldVxuIgorICAgICAgICAgICAgICAgIlx0U3VjY2Vzc2Z1bCBEb3dubG9hZHM6ICV1XG4iCisgICAgICAgICAgICAgICAiXHRGYWlsZWQgRG93bmxvYWRzIChkdWUgdG8gQ3JpdGljYWwgRXJyb3IpOiAldVxuXG4iLAorICAgICAgICAgICAgICAgaXhOcGVEbFN0YXRzLmF0dGVtcHRlZERvd25sb2FkcywKKyAgICAgICAgICAgICAgIGl4TnBlRGxTdGF0cy5zdWNjZXNzZnVsRG93bmxvYWRzLAorICAgICAgICAgICAgICAgaXhOcGVEbFN0YXRzLmNyaXRpY2FsRmFpbERvd25sb2FkcywKKyAgICAgICAgICAgICAgIDAsMCwwKTsKKworICAgIGl4TnBlRGxJbWFnZU1nclN0YXRzU2hvdyAoKTsKKyAgICBpeE5wZURsTnBlTWdyU3RhdHNTaG93ICgpOworfQorCisvKgorICogRnVuY3Rpb24gZGVmaW5pdGlvbjogaXhOcGVEbFN0YXRzUmVzZXQKKyAqLworUFVCTElDIHZvaWQKK2l4TnBlRGxTdGF0c1Jlc2V0ICh2b2lkKQoreworICAgIGl4TnBlRGxTdGF0cy5hdHRlbXB0ZWREb3dubG9hZHMgPSAwOworICAgIGl4TnBlRGxTdGF0cy5zdWNjZXNzZnVsRG93bmxvYWRzID0gMDsKKyAgICBpeE5wZURsU3RhdHMuY3JpdGljYWxGYWlsRG93bmxvYWRzID0gMDsKKworICAgIGl4TnBlRGxJbWFnZU1nclN0YXRzUmVzZXQgKCk7CisgICAgaXhOcGVEbE5wZU1nclN0YXRzUmVzZXQgKCk7Cit9CisKKy8qCisgKiBGdW5jdGlvbiBkZWZpbml0aW9uOiBpeE5wZURsTnBlSW5pdEFuZFN0YXJ0SW50ZXJuYWwKKyAqLworUFJJVkFURSBJWF9TVEFUVVMKK2l4TnBlRGxOcGVJbml0QW5kU3RhcnRJbnRlcm5hbCAoVUlOVDMyICppbWFnZUxpYnJhcnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVJTlQzMiBpbWFnZUlkKQoreworICAgIFVJTlQzMiAgICAgICAgaW1hZ2VTaXplOworICAgIFVJTlQzMiAgICAgICAqaW1hZ2VDb2RlUHRyICA9IE5VTEw7CisgICAgSVhfU1RBVFVTICAgICBzdGF0dXM7CisgICAgSXhOcGVEbE5wZUlkICBucGVJZCA9IElYX05QRURMX05QRUlEX0ZST01fSU1BR0VJRF9HRVQoaW1hZ2VJZCk7CisgICAgSXhGZWF0dXJlQ3RybERldmljZUlkIGRldmljZUlkID0gSVhfTlBFRExfREVWSUNFSURfRlJPTV9JTUFHRUlEX0dFVChpbWFnZUlkKTsKKworICAgIElYX05QRURMX1RSQUNFMCAoSVhfTlBFRExfRk5fRU5UUllfRVhJVCwKKyAgICAgICAgICAgICAgICAgICAgICJFbnRlcmluZyBpeE5wZURsTnBlSW5pdEFuZFN0YXJ0SW50ZXJuYWxcbiIpOworCisgICAgaXhOcGVEbFN0YXRzLmF0dGVtcHRlZERvd25sb2FkcysrOworCisgICAgLyogQ2hlY2sgaW5wdXQgcGFyYW1ldGVyIGRldmljZSBjb3JyZWN0bmVzcyAqLworICAgIGlmICgoZGV2aWNlSWQgPj0gSVhfRkVBVFVSRV9DVFJMX0RFVklDRV9UWVBFX01BWCkgfHwKKyAgICAgICAgKGRldmljZUlkIDwgSVhfRkVBVFVSRV9DVFJMX0RFVklDRV9UWVBFX0lYUDQyWCkpCisgICAgeworICAgICAgICBzdGF0dXMgPSBJWF9OUEVETF9QQVJBTV9FUlI7CisgICAgICAgIElYX05QRURMX0VSUk9SX1JFUE9SVCAoIml4TnBlRGxOcGVJbml0QW5kU3RhcnRJbnRlcm5hbCAtICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiaW52YWxpZCBwYXJhbWV0ZXJcbiIpOworICAgIH0gLyogRW5kIHZhbGlkIGRldmljZSBpZCBjaGVja2luZyAqLworCisgICAgLyogQ2hlY2sgaW5wdXQgcGFyYW1ldGVycyAqLworICAgIGVsc2UgaWYgKChucGVJZCA+PSBJWF9OUEVETF9OUEVJRF9NQVgpIHx8IChucGVJZCA8IDApKQorICAgIHsKKyAgICAgICAgc3RhdHVzID0gSVhfTlBFRExfUEFSQU1fRVJSOworICAgICAgICBJWF9OUEVETF9FUlJPUl9SRVBPUlQgKCJpeE5wZURsTnBlSW5pdEFuZFN0YXJ0SW50ZXJuYWwgLSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImludmFsaWQgcGFyYW1ldGVyXG4iKTsKKyAgICB9CisKKyAgICBlbHNlCisgICAgeworICAgICAgICAvKiBFbnN1cmUgaW5pdGlhbGlzYXRpb24gaGFzIGJlZW4gY29tcGxldGVkICovCisgICAgICAgIGl4TnBlRGxOcGVNZ3JJbml0KCk7CisKKyAgICAgICAgLyogQ2hlY2tpbmcgaWYgaW1hZ2UgYmVpbmcgbG9hZGVkIGlzIG1lYW50IGZvciBkZXZpY2UgdGhhdCBpcyBydW5uaW5nLgorICAgICAgICAgKiBJbWFnZSBpcyBmb3J3YXJkIGNvbXBhdGlibGUuIGkuZSBJbWFnZSBidWlsdCBmb3IgSVhQNDJYIHNob3VsZCBydW4KKyAgICAgICAgICogb24gSVhQNDZYIGJ1dCBub3QgdmljZSB2ZXJzYS4qLworICAgICAgICBpZiAoZGV2aWNlSWQgPiAoaXhGZWF0dXJlQ3RybERldmljZVJlYWQoKSAmIElYX0ZFQVRVUkVfQ1RSTF9ERVZJQ0VfVFlQRV9NQVNLKSkKKyAgICAgICAgeworICAgICAgICAgICAgSVhfTlBFRExfRVJST1JfUkVQT1JUICgiaXhOcGVEbE5wZUluaXRBbmRTdGFydEludGVybmFsIC0gIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiRGV2aWNlIHR5cGUgbWlzbWF0Y2guIE5QRSBJbWFnZSBub3QgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAibWVhbnQgZm9yIGRldmljZSBpbiB1c2UgXG4iKTsKKyAgICAgICAgICAgIHJldHVybiBJWF9OUEVETF9ERVZJQ0VfRVJSOworICAgICAgICB9LyogaWYgc3RhdGVtZW50IC0gbWF0Y2hpbmcgaW1hZ2UgZGV2aWNlIGFuZCBjdXJyZW50IGRldmljZSAqLworCisJLyogSWYgbm90IElYUDQyWCBBMCBzdGVwcGluZywgcHJvY2VlZCB0byBjaGVjayBmb3IgZXhpc3RlbmNlIG9mIG5wZSdzICovCisJaWYgKChJWF9GRUFUVVJFX0NUUkxfU0lMSUNPTl9UWVBFX0EwICE9CisJICAgICAoaXhGZWF0dXJlQ3RybFByb2R1Y3RJZFJlYWQoKSAmIElYX0ZFQVRVUkVfQ1RSTF9TSUxJQ09OX1NURVBQSU5HX01BU0spKQorCSAgICB8fCAoSVhfRkVBVFVSRV9DVFJMX0RFVklDRV9UWVBFX0lYUDQyWCAhPSBpeEZlYXR1cmVDdHJsRGV2aWNlUmVhZCAoKSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChucGVJZCA9PSBJWF9OUEVETF9OUEVJRF9OUEVBKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChpeEZlYXR1cmVDdHJsQ29tcG9uZW50Q2hlY2soSVhfRkVBVFVSRUNUUkxfTlBFQSkgPT0KKyAgICAgICAgICAgICAgICAgICAgSVhfRkVBVFVSRV9DVFJMX0NPTVBPTkVOVF9ESVNBQkxFRCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIElYX05QRURMX1dBUk5JTkdfUkVQT1JUKCJXYXJuaW5nOiB0aGUgTlBFIEEgY29tcG9uZW50IHlvdSBzcGVjaWZpZWQgZG9lcyIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBub3QgZXhpc3RcbiIpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gSVhfU1VDQ0VTUzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IC8qIGVuZCBvZiBpZihucGVJZCkgKi8KKyAgICAgICAgICAgIGVsc2UgaWYgKG5wZUlkID09IElYX05QRURMX05QRUlEX05QRUIpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKGl4RmVhdHVyZUN0cmxDb21wb25lbnRDaGVjayhJWF9GRUFUVVJFQ1RSTF9OUEVCKT09CisgICAgICAgICAgICAgICAgICAgIElYX0ZFQVRVUkVfQ1RSTF9DT01QT05FTlRfRElTQUJMRUQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBJWF9OUEVETF9XQVJOSU5HX1JFUE9SVCgiV2FybmluZzogdGhlIE5QRSBCIGNvbXBvbmVudCB5b3Ugc3BlY2lmaWVkIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIGRvZXMgbm90IGV4aXN0XG4iKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIElYX1NVQ0NFU1M7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSAvKiBlbmQgb2YgZWxzZWlmKG5wZUlkKSAqLworICAgICAgICAgICAgZWxzZSBpZiAobnBlSWQgPT0gSVhfTlBFRExfTlBFSURfTlBFQykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoaXhGZWF0dXJlQ3RybENvbXBvbmVudENoZWNrKElYX0ZFQVRVUkVDVFJMX05QRUMpPT0KKyAgICAgICAgICAgICAgICAgICAgSVhfRkVBVFVSRV9DVFJMX0NPTVBPTkVOVF9ESVNBQkxFRCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIElYX05QRURMX1dBUk5JTkdfUkVQT1JUKCJXYXJuaW5nOiB0aGUgTlBFIEMgY29tcG9uZW50IHlvdSBzcGVjaWZpZWQiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgZG9lcyBub3QgZXhpc3RcbiIpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gSVhfU1VDQ0VTUzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IC8qIGVuZCBvZiBlbHNlaWYobnBlSWQpICovCisgICAgICAgIH0gLyogZW5kIG9mIGlmIG5vdCBJWFA0MlgtQTAgU2lsaWNvbiAqLworCisgICAgICAgIC8qIHN0b3AgYW5kIHJlc2V0IHRoZSBOUEUgKi8KKyAgICAgICAgc3RhdHVzID0gaXhOcGVEbE5wZVN0b3BBbmRSZXNldCAobnBlSWQpOworICAgICAgICBpZiAoSVhfU1VDQ0VTUyAhPSBzdGF0dXMpCisgICAgICAgIHsKKyAgICAgICAgICAgIElYX05QRURMX0VSUk9SX1JFUE9SVCAoIkZhaWxlZCB0byBzdG9wIGFuZCByZXNldCBOUEVcbiIpOworICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICAgICAgfQorCisgICAgICAgIC8qIExvY2F0ZSBpbWFnZSAqLworICAgICAgICBzdGF0dXMgPSBpeE5wZURsSW1hZ2VNZ3JJbWFnZUZpbmQgKGltYWdlTGlicmFyeSwgaW1hZ2VJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmaW1hZ2VDb2RlUHRyLCAmaW1hZ2VTaXplKTsKKyAgICAgICAgaWYgKElYX1NVQ0NFU1MgPT0gc3RhdHVzKQorICAgICAgICB7CisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogSWYgZG93bmxvYWQgd2FzIHN1Y2Nlc3NmdWwsIHN0b3JlIGltYWdlIElkIGluIGxpc3Qgb2YKKyAgICAgICAgICAgICAqIGN1cnJlbnRseSBsb2FkZWQgaW1hZ2VzLiBJZiBhIGNyaXRpY2FsIGVycm9yIG9jY3VyZWQKKyAgICAgICAgICAgICAqIGR1cmluZyBkb3dubG9hZCwgcmVjb3JkIHRoYXQgdGhlIE5QRSBoYXMgYW4gaW52YWxpZCBpbWFnZQorICAgICAgICAgICAgICovCisgICAgICAgICAgICBzdGF0dXMgPSBpeE5wZURsTnBlTWdySW1hZ2VMb2FkIChucGVJZCwgaW1hZ2VDb2RlUHRyLCBUUlVFKTsKKyAgICAgICAgICAgIGlmIChJWF9TVUNDRVNTID09IHN0YXR1cykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpeE5wZURsTnBlU3RhdGVbbnBlSWRdLnZhbGlkSW1hZ2UgPSBUUlVFOworICAgICAgICAgICAgICAgIGl4TnBlRGxTdGF0cy5zdWNjZXNzZnVsRG93bmxvYWRzKys7CisKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBpeE5wZURsTnBlRXhlY3V0aW9uU3RhcnQgKG5wZUlkKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKChzdGF0dXMgPT0gSVhfTlBFRExfQ1JJVElDQUxfTlBFX0VSUikgfHwKKyAgICAgICAgICAgICAgICAgICAgIChzdGF0dXMgPT0gSVhfTlBFRExfQ1JJVElDQUxfTUlDUk9DT0RFX0VSUikpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaXhOcGVEbE5wZVN0YXRlW25wZUlkXS52YWxpZEltYWdlID0gRkFMU0U7CisgICAgICAgICAgICAgICAgaXhOcGVEbFN0YXRzLmNyaXRpY2FsRmFpbERvd25sb2FkcysrOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvKiBOT1RFIC0gVGhlIGZvbGxvd2luZyBzZWN0aW9uIG9mIGNvZGUgaXMgaGVyZSB0byBzdXBwb3J0CisgICAgICAgICAgICAgKiBhIGRlcHJlY2F0ZWQgZnVuY3Rpb24gaXhOcGVEbExvYWRlZEltYWdlR2V0KCkuICBXaGVuIHRoYXQKKyAgICAgICAgICAgICAqIGZ1bmN0aW9uIGlzIHJlbW92ZWQgZnJvbSB0aGUgQVBJLCB0aGlzIGNvZGUgc2hvdWxkIGJlIHJldmlzZWQuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGl4TnBlRGxOcGVTdGF0ZVtucGVJZF0uaW1hZ2VJZC5ucGVJZCA9IG5wZUlkOworICAgICAgICAgICAgaXhOcGVEbE5wZVN0YXRlW25wZUlkXS5pbWFnZUlkLmZ1bmN0aW9uYWxpdHlJZCA9CisgICAgICAgICAgICAgICAgSVhfTlBFRExfRlVOQ1RJT05JRF9GUk9NX0lNQUdFSURfR0VUKGltYWdlSWQpOworICAgICAgICAgICAgaXhOcGVEbE5wZVN0YXRlW25wZUlkXS5pbWFnZUlkLm1ham9yID0KKyAgICAgICAgICAgICAgICBJWF9OUEVETF9NQUpPUl9GUk9NX0lNQUdFSURfR0VUKGltYWdlSWQpOworICAgICAgICAgICAgaXhOcGVEbE5wZVN0YXRlW25wZUlkXS5pbWFnZUlkLm1pbm9yID0KKyAgICAgICAgICAgICAgICBJWF9OUEVETF9NSU5PUl9GUk9NX0lNQUdFSURfR0VUKGltYWdlSWQpOworICAgICAgICB9IC8qIGVuZCBvZiBpZihJWF9TVUNDRVNTKSAqLyAvKiBjb25kaXRpb246IGltYWdlIGxvY2F0ZWQgc3VjY2Vzc2Z1bGx5IGluIG1pY3JvY29kZSBpbWFnZSAqLworICAgIH0gLyogZW5kIG9mIGlmLWVsc2UobnBlSWQtZGV2aWNlSWQpICovIC8qIGNvbmRpdGlvbjogcGFyYW1ldGVyIGNoZWNrcyBvayAqLworCisgICAgSVhfTlBFRExfVFJBQ0UxIChJWF9OUEVETF9GTl9FTlRSWV9FWElULAorICAgICAgICAgICAgICAgICAgICAgIkV4aXRpbmcgaXhOcGVEbE5wZUluaXRBbmRTdGFydEludGVybmFsIDogIgorICAgICAgICAgICAgICAgICAgICAgInN0YXR1cyA9ICVkXG4iLCBzdGF0dXMpOworICAgIHJldHVybiBzdGF0dXM7Cit9CisKKy8qCisgKiBGdW5jdGlvbiBkZWZpbml0aW9uOiBpeE5wZURsQ3VzdG9tSW1hZ2VOcGVJbml0QW5kU3RhcnQKKyAqLworUFVCTElDIElYX1NUQVRVUworaXhOcGVEbEN1c3RvbUltYWdlTnBlSW5pdEFuZFN0YXJ0IChVSU5UMzIgKmltYWdlTGlicmFyeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVUlOVDMyI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WFnZUlkLT5taW5vciA8IGZvcm1hdHRlZEltYWdlSWQubWlub3IpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGltYWdlSWQtPm1pbm9yID0gZm9ybWF0dGVkSW1hZ2VJZC5taW5vcjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpbWFnZUlkLT5tYWpvciA9IGZvcm1hdHRlZEltYWdlSWQubWFqb3I7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHN0YXR1cyA9IElYX1NVQ0NFU1M7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpbWFnZUNvdW50Kys7CisJfQorCWlmIChzdGF0dXMgIT0gSVhfU1VDQ0VTUykKKwl7CisJICAgIElYX05QRURMX0VSUk9SX1JFUE9SVCAoIml4TnBlRGxJbWFnZU1nckxhdGVzdEltYWdlRXh0cmFjdDogIgorCQkJCSAgICJpbWFnZUlkIG5vdCBmb3VuZCBpbiBpbWFnZSBsaWJyYXJ5IGhlYWRlclxuIik7CisJICAgIGl4TnBlRGxJbWFnZU1nclN0YXRzLmltYWdlSWROb3RGb3VuZCsrOworCX0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKwlJWF9OUEVETF9FUlJPUl9SRVBPUlQgKCJpeE5wZURsSW1hZ2VNZ3JMYXRlc3RJbWFnZUdldDogIgorCQkJICAgICAgICJpbnZhbGlkIHNpZ25hdHVyZSBpbiBpbWFnZSBsaWJyYXJ5XG4iKTsKKyAgICB9CisKKyAgICBJWF9OUEVETF9UUkFDRTEgKElYX05QRURMX0ZOX0VOVFJZX0VYSVQsCisJCSAgICAgIkV4aXRpbmcgaXhOcGVEbEltYWdlTWdyTGF0ZXN0SW1hZ2VHZXQ6IHN0YXR1cyA9ICVkXG4iLCBzdGF0dXMpOworICAgIHJldHVybiBzdGF0dXM7Cit9CisKKy8qCisgKiBGdW5jdGlvbiBkZWZpbml0aW9uOiBpeE5wZURsSW1hZ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SBkZWZhdWx0CisgICAgICogb25lIGZyb20gSXhOcGVNaWNyb2NvZGUuaAorICAgICAqLworICAgIGlmIChpbWFnZUxpYnJhcnkgPT0gTlVMTCkKKyAgICB7CisjaWZkZWYgSVhfTlBFRExfUkVBRF9NSUNST0NPREVfRlJPTV9GSUxFCisJaWYgKGl4TnBlTWljcm9jb2RlX2JpbmFyeUFycmF5ID09IE5VTEwpCisgICAgICAgIHsKKwkgICAgcHJpbnRrIChLRVJOX0VSUiAiaXhwNDAwLm86ICBFUlJPUiwgbm8gTWljcm9jb2RlIGZvdW5kIGluIG1lbW9yeVxuIik7CisJICAgIHJldHVybiBJWF9GQUlMOworCX0KKwllbHNlCisJeworCSAgICBpbWFnZUxpYnJhcnkgPSBpeE5wZU1pY3JvY29kZV9iaW5hcnlBcnJheTsKKwl9CisjZWxzZQorCWltYWdlTGlicmFyeSA9IEl4TnBlTWljcm9Db2RlSW1hZ2VMaWJyYXJ5OworI2VuZGlmIC8qIElYX05QRURMX1JFQURfTUlDUk9DT0RFX0ZST01fRklMRSAqLworICAgIH0KKworICAgIC8qIEZvciBiYWNrd2FyZCdzIGNvbXBhdGliaWxpdHkgd2l0aCBwcmV2aW91cyBpbWFnZSBmb3JtYXQgKi8KKyAgICBpZiAoaXhOcGVEbEltYWdlTWdyU2lnbmF0dXJlQ2hlY2soaW1hZ2VMaWJyYXJ5KSkKKyAgICB7CisgICAgICAgIHJldHVybiBpeE5wZURsSW1hZ2VNZ3JJbWFnZUZpbmRfbGVnYWN5KGltYWdlTGlicmFyeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1hZ2VJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1hZ2VQdHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltYWdlU2l6ZSk7CisgICAgfQorCisgICAgd2hpbGUgKCooaW1hZ2VMaWJyYXJ5K29mZnNldCkgPT0gTlBFX0lNQUdFX01BUktFUikKKyAgICB7CisgICAgICAgIGltYWdlID0gKEl4TnBlRGxJbWFnZU1nckltYWdlSGVhZGVyICopKGltYWdlTGlicmFyeStvZmZzZXQpOworICAgICAgICBvZmZzZXQgKz0gc2l6ZW9mKEl4TnBlRGxJbWFnZU1nckltYWdlSGVhZGVyKS9zaXplb2YoVUlOVDMyKTsKKyAgICAgICAgCisgICAgICAgIGlmIChpbWFnZS0+aWQgPT0gaW1hZ2VJZCkKKyAgICAgICAgeworICAgICAgICAgICAgKmltYWdlUHRyID0gaW1hZ2VMaWJyYXJ5ICsgb2Zmc2V0OworICAgICAgICAgICAgKmltYWdlU2l6ZSA9IGltYWdlLT5zaXplOworICAgICAgICAgICAgcmV0dXJuIElYX1NVQ0NFU1M7CisgICAgICAgIH0KKyAgICAgICAgLyogMiBjb25zZWN1dGl2ZSBOUEVfSU1BR0VfTUFSS0VSJ3MgaW5kaWNhdGVzIGVuZCBvZiBsaWJyYXJ5ICovCisgICAgICAgIGVsc2UgaWYgKGltYWdlLT5pZCA9PSBOUEVfSU1BR0VfTUFSS0VSKQorICAgICAgICB7CisJICAgIElYX05QRURMX0VSUk9SX1JFUE9SVCAoIml4TnBlRGxJbWFnZU1nckltYWdlRmluZDogIgorCQkJCSAgICJpbWFnZUlkIG5vdCBmb3VuZCBpbiBpbWFnZSBsaWJyYXJ5IGhlYWRlclxuIik7CisJICAgIGl4TnBlRGxJbWFnZU1nclN0YXRzLmltYWdlSWROb3RGb3VuZCsrOworICAgICAgICAgICAgLyogcmVhY2hlZCBlbmQgb2YgbGlicmFyeSwgaW1hZ2Ugbm90IGZvdW5kICovCisgICAgICAgICAgICByZXR1cm4gSVhfRkFJTDsKKyAgICAgICAgfQorICAgICAgICBvZmZzZXQgKz0gaW1hZ2UtPnNpemU7CisgICAgfQorCisgICAgLyogSWYgd2UgZ2V0IGhlcmUsIG91ciBpbWFnZSBsaWJyYXJ5IG1heSBiZSBjb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AgICAgIGl4TnBlRGxOcGVNZ3JTdGF0cy5zdGF0ZUluZm9CbG9ja3NMb2FkZWQsCisgICAgICAgICAgICAgICBpeE5wZURsTnBlTWdyU3RhdHMuY3JpdGljYWxOcGVFcnJvcnMsCisgICAgICAgICAgICAgICBpeE5wZURsTnBlTWdyU3RhdHMuY3JpdGljYWxNaWNyb2NvZGVFcnJvcnMsCisgICAgICAgICAgICAgICAwKTsKKworICAgIGl4T3NhbExvZyAoSVhfT1NBTF9MT0dfTFZMX1VTRVIsCisgICAgICAgICAgICAgICBJWF9PU0FMX0xPR19ERVZfU1RET1VULAorICAgICAgICAgICAgICAgIlx0U3VjY2Vzc2Z1bCBOUEUgU3RhcnRzOiAldVxuIgorICAgICAgICAgICAgICAgIlx0U3VjY2Vzc2Z1bCBOUEUgU3RvcHM6ICV1XG4iCisgICAgICAgICAgICAgICAiXHRTdWNjZXNzZnVsIE5QRSBSZXNldHM6ICV1XG5cbiIsCisgICAgICAgICAgICAgICBpeE5wZURsTnBlTWdyU3RhdHMubnBlU3RhcnRzLAorICAgICAgICAgICAgICAgaXhOcGVEbE5wZU1nclN0YXRzLm5wZVN0b3BzLAorICAgICAgICAgICAgICAgaXhOcGVEbE5wZU1nclN0YXRzLm5wZVJlc2V0cywKKyAgICAgICAgICAgICAgIDAsMCwwKTsKKworICAgIGl4TnBlRGxOcGVNZ3JVdGlsc1N0YXRzU2hvdyAoKTsKK30KKworCisvKgorICogRnVuY3Rpb24gZGVmaW5pdGlvbjogaXhOcGVEbE5wZU1nclN0YXRzUmVzZXQKKyAqLwordm9pZAoraXhOcGVEbE5wZU1nclN0YXRzUmVzZXQgKHZvaWQpCit7CisgICAgaXhOcGVEbE5wZU1nclN0YXRzLmluc3RydWN0aW9uQmxvY2tzTG9hZGVkID0gMDsKKyAgICBpeE5wZURsTnBlTWdyU3RhdHMuZGF0YUJsb2Nrc0xvYWRlZCA9IDA7CisgICAgaXhOcGVEbE5wZU1nclN0YXRzLnN0YXRlSW5mb0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BhcgorICogLS0gRW5kIG9mIENvcHlyaWdodCBOb3RpY2UgLS0KKyovCisKKworLyoKKyAqIFB1dCB0aGUgc3lzdGVtIGRlZmluZWQgaW5jbHVkZSBmaWxlcyByZXF1aXJlZC4KKyAqLworI2RlZmluZSBJWF9OUEVfRExfTUFYX05VTV9PRl9SRVRSSUVTIDEwMDAwMDAgLyoqPCBNYXhpbXVtIG51bWJlciBvZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogcmV0cmllcyBiZWZvcmUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHRpbWVvdXQKKwkJCQkJICAgICAgICAgICAgICAgICAgICAgICAgICAqLyAgCisKKy8qCisgKiBQdXQgdGhlIHVzZXIgZGVmaW5lZCBpbmNsdWRlIGZpbGVzIHJlcXVpcmVkLgorICovCisjaW5jbHVkZSAiSXhPc2FsLmgiCisjaW5jbHVkZSAiSXhOcGVEbC5oIgorI2luY2x1ZGUgIkl4TnBlRGxOcGVNZ3JVdGlsc19wLmgiCisjaW5jbHVkZSAiSXhOcGVEbE5wZU1nckVjUmVnaXN0ZXJzX3AuaCIKKyNpbmNsdWRlICJJeE5wZURsTWFjcm9zX3AuaCIKKworLyoKKyAqICNkZWZpbmVzIGFuZCBtYWNyb3MgdXNlZCBpbiB0aGlzIGZpbGUuCisgKi8KKworLyogdXNlZCB0byBiaXQtbWFzayBhIG51bWJlciBvZiBieXRlcyAqLworI2RlZmluZSBJWF9OUEVETF9NQVNLX0xPV0VSX0JZVEVfT0ZfV09SRCAgMHgwMDAwMDBGRgorI2RlZmluZSBJWF9OUEVETF9NQVNLX0xPV0VSX1NIT1JUX09GX1dPUkQgMHgwMDAwRkZGRgorI2RlZmluZSBJWF9OUEVETF9NQVNLX0ZVTExfV09SRCAgICAgICAgICAgMHhGRkZGRkZGRgorCisjZGVmaW5lIElYX05QRURMX0JZVEVTX1BFUl9XT1JEICAgICAgICAgICA0Cis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NFRF9JTUVNX0JJVFM7CisKKyAgICAgICAgaW5zTWVtRGF0YVJ0bj1peE5wZURsTnBlTWdyUmVhZENvbW1hbmRJc3N1ZSAobnBlQmFzZUFkZHJlc3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSVhfTlBFRExfRVhDVExfQ01EX1JEX0lOU19NRU0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5zTWVtQWRkcmVzcyk7CisKKyAgICAgICAgaW5zTWVtRGF0YVJ0biY9SVhfTlBFRExfTUFTS19VTlVTRURfSU1FTV9CSVRTOworCisJaWYgKGluc01lbURhdGEgIT0gaW5zTWVtRGF0YVJ0bikKKwl7CisJICAgIGl4TnBlRGxOcGVNZ3JVdGlsc1N0YXRzLmluc01lbVdyaXRlRmFpbHMrKzsKKwkgICAgcmV0dXJuIElYX0ZBSUw7CisJfQorICAgIH0KKworICAgIGl4TnBlRGxOcGVNZ3JVdGlsc1N0YXRzLmluc01lbVdyaXRlcysrOworICAgIHJldHVybiBJWF9TVUNDRVNTOworfQorCisKKy8qCisgKiBGdW5jdGlvbiBkZWZpbml0aW9uOiBpeE5wZURsTnBlTWdyRGF0YU1lbVdyaXRlCisgKi8KK0lYX1NUQVRVUworaXhOcGVEbE5wZU1nckRhdGFNZW1Xcml0ZSAoCisgICAgVUlOVDMyIG5wZUJhc2VBZGRyZXNzLAorICAgIFVJTlQzMiBkYXRhTWVtQWRkcmVzcywKKyAgICBVSU5UMzIgZGF0YU1lbURhdGEsCisgICAgQk9PTCB2ZXJpZnkpCit7CisgICAgaXhOcGVEbE5wZU1ncldyaXRlQ29tbWFuZElzc3VlIChucGVCYXNlQWRkcmVzcywKKwkJCQkgICAgSVhfTlBFRExfRVhDVExfQ01EX1dSX0RBVEFfTUVNLAorCQkJCSAgICBkYXRhTWVtQWRkcmVzcywgZGF0YU1lbURhdGEpOworICAgIGlmICh2ZXJpZnkpCisgICAgeworICAgICAgICAv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50IHJlZ2lzdGVyIGluY3JlbWVudHMgd2hlbiBOUEUgY29tcGxldGVzIGFuIGluc3RydWN0aW9uICovCisJICAgIElYX05QRURMX1JFR19SRUFEIChucGVCYXNlQWRkcmVzcywgSVhfTlBFRExfUkVHX09GRlNFVF9XQywKKwkJICAgICZuZXdXYXRjaGNvdW50KTsKKwkJCSAgIAorICAgICAgICByZXRyaWVzQ291bnQrKzsKKyAgICB9ICAgIAorCisgICAgaWYgKElYX05QRV9ETF9NQVhfTlVNX09GX1JFVFJJRVMgPiByZXRyaWVzQ291bnQpCisgICAgeworICAgICAgICBpeE5wZURsTnBlTWdyVXRpbHNTdGF0cy5kYmdJbnN0cnVjdGlvbkV4ZWNzKys7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIC8qIFJldHVybiB0aW1lb3V0IHN0YXR1cyBhcyB0aGUgaW5zdHJ1Y3Rpb24gaGFzIG5vdCBiZWVuIGV4ZWN1dGVkCisgICAgICAgICAqIGFmdGVyIG1heGltdW0gcmV0cmllcyAqLworICAgICAgICBzdGF0dXMgPSBJWF9OUEVETF9DUklUSUNBTF9OUEVfRVJSOworICAgIH0KKyAgICAKKyAgICBJWF9OUEVETF9UUkFDRTAgKElYX05QRURMX0ZOX0VOVFJZX0VYSVQsCisJCSAgICAgIkV4aXRpbmcgaXhOcGVEbE5wZU1nckRlYnVnSW5zdHJ1Y3Rpb25FeGVjXG4iKTsKKwkJICAgICAKKyAgICByZXR1cm4gc3RhdHVzOworfSAgICAKKworCisvKgorICogRnVuY3Rpb24gZGVmaW5pdGlvbjogaXhOcGVEbE5wZU1nckRlYnVnSW5zdHJ1Y3Rpb25Qb3N0RXhlYworICovCit2b2lkCitpeE5wZURsTnBlTWdyRGVidWdJbnN0cnVjdGlvblBvc3RFeGVjKAorICAgIFVJTlQzMiBucGVCYXNlQWRkcmVzcykKK3sKKyAgICAvKiBjbGVhciBhY3RpdmUgYml0IGluIGRlYnVnIGxldmVsICovCisgICAgaXhOcGVE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gTWVtb3J5IHdyaXRlczogJXVcbiIKKyAgICAgICAgICAgICAgICJcdERhdGEgTWVtb3J5IHdyaXRlcyBmYWlsZWQ6ICV1XG4iLAorICAgICAgICAgICAgICAgaXhOcGVEbE5wZU1nclV0aWxzU3RhdHMuaW5zTWVtV3JpdGVzLAorICAgICAgICAgICAgICAgaXhOcGVEbE5wZU1nclV0aWxzU3RhdHMuaW5zTWVtV3JpdGVGYWlscywKKyAgICAgICAgICAgICAgIGl4TnBlRGxOcGVNZ3JVdGlsc1N0YXRzLmRhdGFNZW1Xcml0ZXMsCisgICAgICAgICAgICAgICBpeE5wZURsTnBlTWdyVXRpbHNTdGF0cy5kYXRhTWVtV3JpdGVGYWlscywKKyAgICAgICAgICAgICAgIDAsMCk7CisKKyAgICBpeE9zYWxMb2cgKElYX09TQUxfTE9HX0xWTF9VU0VSLAorICAgICAgICAgICAgICAgSVhfT1NBTF9MT0dfREVWX1NURE9VVCwKKyAgICAgICAgICAgICAgICJcdEV4ZWN1dGluZyBDb250ZXh0IFN0YWNrIFJlZ2lzdGVyIHdyaXRlczogJXVcbiIKKyAgICAgICAgICAgICAgICJcdEV4ZWN1dGluZyBDb250ZXh0IFN0YWNrIFJlZ2lzdGVyIHJlYWRzOiAldVxuIgorICAgICAgICAgICAgICAgIlx0UGh5c2ljYWwgUmVnaXN0ZXIgd3JpdGVzOiAldVxuIgorICAgICAgICAgICAgICAgIlx0Q29udGV4dCBTdG9yZSBSZWdpc3RlciB3cml0ZXM6ICV1XG4iCisgICAgICAgICAgICAgICAiXHRFeGVjdXRpb24gQmFja2dvdW5kIENvbnRleHQgTmV4dFBDIHdyaXRlczogJXVcbiIKKyAgICAgICAgICAgICAgICJcdERlYnVnIEluc3RydWN0aW9ucyBFeGVjdXRlZDogJXVcblxuIiwKKyAgICAgICAgICAgICAgIGl4TnBlRGxOcGVNZ3JVdGlsc1N0YXRzLmVjc1JlZ1dyaXRlcywKKyAgICAgICAgICAgICAgIGl4TnBlRGxOcGVNZ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isgICAgICovCisgICAgaXhOcGVNaENvbmZpZ0luaXRpYWxpemUgKG5wZUludGVycnVwdHMpOworCisgICAgaXhOcGVNaEluaXRpYWxpemVkID0gVFJVRTsKKworICAgIElYX05QRU1IX1RSQUNFMCAoSVhfTlBFTUhfRk5fRU5UUllfRVhJVCwgIkV4aXRpbmcgIgorICAgICAgICAgICAgICAgICAgICAgIml4TnBlTWhJbml0aWFsaXplXG4iKTsKKworICAgIHJldHVybiBJWF9TVUNDRVNTOworfQorCisvKgorICogRnVuY3Rpb24gZGVmaW5pdGlvbjogaXhOcGVNaFVubG9hZAorICovCisKK1BVQkxJQyBJWF9TVEFUVVMgaXhOcGVNaFVubG9hZCAodm9pZCkKK3sKKyAgICBJWF9OUEVNSF9UUkFDRTAgKElYX05QRU1IX0ZOX0VOVFJZX0VYSVQsICJFbnRlcmluZyAiCisgICAgICAgICAgICAgICAgICAgICAiaXhOcGVNaFVubG9hZFxuIik7CisKKyAgICBpZiAoIWl4TnBlTWhJbml0aWFsaXplZCkKKyAgICB7CisJcmV0dXJuIElYX0ZBSUw7CisgICAgfQorCisgICAgLyogVW5pbml0aWFsaXplIHRoZSBDb25maWd1cmF0aW9uIG1vZHVsZSAqLworICAgIGl4TnBlTWhDb25maWdVbmluaXQgKCk7CisKKyAgICBpeE5wZU1oSW5pdGlhbGl6ZWQgPSBGQUxTRTsKKworICAgIElYX05QRU1IX1RSQUNFMCAoSVhfTlBFTUhfRk5fRU5UUllfRVhJVCwgIkV4aXRpbmcgIgorICAgICAgICAgICAgICAgICAgICAgIml4TnBlTWhVbmxvYWRcbiIpOworCisgICAgcmV0dXJuIElYX1NVQ0NFU1M7Cit9CisKKworLyoKKyAqIEZ1bmN0aW9uIGRlZmluaXRpb246IGl4TnBlTWhVbnNvbGljaXRlZENhbGxiYWNrUmVnaXN0ZXIKKyAqLworCitQVUJMSUMgSVhfU1RBVFVTIGl4TnBlTWhVbnNvbGljaXRlZENhbGxiYWNrUmVnaXN0ZXIgKAorICAgIEl4TnBlTWhOcGVJZCBucGVJZCwKKyAgICBJeE5wZU1oTWVzc2FnZUlkIG1lc3NhZ2VJZCwKKyAgICBJeE5wZU1oQ2FsbGJhY2sgdW5zb2xpY2l0ZWRDYWxsYmFjaykKK3sKKyAgICBJWF9OUEVNSF9UUkFDRTAgKElYX05QRU1IX0ZOX0VOVFJZX0VYSVQsICJFbnRlcmluZyAiCisgICAgICAgICAgICAgICAgICAgICAiaXhOcGVNaFVuc29saWNpdGVkQ2FsbGJhY2tSZWdpc3RlclxuIik7CisKKyAgICAvKiBjaGVjayB0aGF0IHdlIGFyZSBpbml0aWFsaXplZCAqLworICAgIGlmICghaXhOcGVNaEluaXRpYWxpemVkKQorICAgIHsKKyAgICAgICAgSVhfTlBFTUhfRVJST1JfUkVQT1JUICgiSXhOcGVNaCBjb21wb25lbnQgaXMgbm90IGluaXRpYWxpemVkXG4iKTsKKyAgICAgICAgcmV0dXJuIElYX0ZBSUw7CisgICAgfQorCisgICAgLyogY2hlY2sgdGhlIG5wZUlkIHBhcmFtZXRlciAqLworICAgIGlmICghaXhOcGVNaENvbmZpZ05wZUlkSXNWYWxpZCAobnBlSWQpKQorICAgIHsKKyAgICAgICAgSVhfTlBFTUhfRVJST1JfUkVQT1JUICgiTlBFIElEIGludmFsaWRcbiIpOworICAgICAgICByZXR1cm4gSVhfRkFJTDsKKyAgICB9CisKKyAgICAvKiBjaGVjayB0aGUgbWVzc2FnZUlkIHBhcmFtZXRlciAqLworICAgIGlmICgobWVzc2FnZUlkIDwgSVhfTlBFTUhfTUlOX01FU1NBR0VfSUQpCisgICAgICAgIHx8IChtZXNzYWdlSWQgPiBJWF9OUEVNSF9NQVhfTUVTU0FHRV9JRCkpCisgICAgeworICAgICAgICBJWF9OUEVNSF9FUlJPUl9SRVBPUlQgKCJNZXNzYWdlIElEIGlzIG91dCBvZiByYW5nZVxuIik7CisgICAgICAgIHJldHVybiBJWF9GQUlMOworICAgIH0KKworICAgIC8qIHRoZSB1bnNvbGlj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GljaXRlZENhbGxiYWNrICE9IE5VTEwpCisgICAgeworICAgICAgICBJWF9OUEVNSF9FUlJPUl9SRVBPUlQgKCJTb2xpY2l0ZWQgbWVzc2FnZSBJRCBjb25mbGljdHMgd2l0aCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInVuc29saWNpdGVkIG1lc3NhZ2UgSURcbiIpOworICAgICAgICByZXR1cm4gSVhfRkFJTDsKKyAgICB9CisKKyAgICAvKiBwYXJhbWV0ZXJzIGFyZSBvayAuLi4gKi8KKworICAgIC8qIGdldCB0aGUgbG9jayB0byBwcmV2ZW50IG90aGVyIGNsaWVudHMgZnJvbSBlbnRlcmluZyAqLworICAgIGl4TnBlTWhDb25maWdMb2NrR2V0IChucGVJZCk7CisKKyAgICAvKiBzZW5kIHRoZSBtZXNzYWdlICovCisgICAgc3RhdHVzID0gaXhOcGVNaFNlbmRNZXNzYWdlV2l0aFJlc3BvbnNlU2VuZCAoCisgICAgICAgIG5wZUlkLCBtZXNzYWdlLCBzb2xpY2l0ZWRNZXNzYWdlSWQsIHNvbGljaXRlZENhbGxiYWNrLAorICAgICAgICBtYXhTZW5kUmV0cmllcyk7CisgICAgaWYgKHN0YXR1cyAhPSBJWF9TVUNDRVNTKQorICAgIHsKKyAgICAgICAgSVhfTlBFTUhfRVJST1JfUkVQT1JUICgiRmFpbGVkIHRvIHNlbmQgbWVzc2FnZVxuIik7CisgICAgfQorCisgICAgLyogcmVsZWFzZSB0aGUgbG9jayB0byBhbGxvdyBvdGhlciBjbGllbnRzIGJhY2sgaW4gKi8KKyAgICBpeE5wZU1oQ29uZmlnTG9ja1JlbGVhc2UgKG5wZUlkKTsKKworICAgIElYX05QRU1IX1RSQUNFMSAoSVhfTlBFTUhfRk5fRU5UUllfRVhJVCwgIkV4aXRpbmcgIgorICAgICAgICAgICAgICAgICAgICAgIml4TnBlTWhNZXNzYWdlV2l0aFJlc3BvbnNlU2VuZCIKKyAgICAgICAgICAgICAgICAgICAgICIgOiBzdGF0dXMgPSAlZFxuIiwgc3RhdHVzKTsKKworICAgIHJldHVybiBzdGF0dXM7Cit9CisKKy8qCisgKiBGdW5jdGlvbiBkZWZpbml0aW9uOiBpeE5wZU1oTWVzc2FnZXNSZWNlaXZlCisgKi8KKworUFVCTElDIElYX1NUQVRVUyBpeE5wZU1oTWVzc2FnZXNSZWNlaXZlICgKKyAgICBJeE5wZU1oTnBlSWQgbnBlSWQpCit7CisgICAgSVhfU1RBVFVTIHN0YXR1cyA9IElYX1NVQ0NFU1M7CisKKyAgICBJWF9OUEVNSF9UUkFDRTAgKElYX05QRU1IX0ZOX0VOVFJZX0VYSVQsICJFbnRlcmluZyAiCisgICAgICAgICAgICAgICAgICAgICAiaXhOcGVNaE1lc3NhZ2VzUmVjZWl2ZVxuIik7CisKKyAgICAvKiBjaGVjayB0aGF0IHdlIGFyZSBpbml0aWFsaXplZCAqLworICAgIGlmICghaXhOcGVNaEluaXRpYWxpemVkKQorICAgIHsKKyAgICAgICAgSVhfTlBFTUhfRVJST1JfUkVQT1JUICgiSXhOcGVNaCBjb21wb25lbnQgaXMgbm90IGluaXRpYWxpemVkXG4iKTsKKyAgICAgICAgcmV0dXJuIElYX0ZBSUw7CisgICAgfQorCisgICAgLyogY2hlY2sgdGhlIG5wZUlkIHBhcmFtZXRlciAqLworICAgIGlmICghaXhOcGVNaENvbmZpZ05wZUlkSXNWYWxpZCAobnBlSWQpKQorICAgIHsKKyAgICAgICAgSVhfTlBFTUhfRVJST1JfUkVQT1JUICgiTlBFIElEIGludmFsaWRcbiIpOworICAgICAgICByZXR1cm4gSVhfRkFJTDsKKyAgICB9CisKKyAgICAvKiBwYXJhbWV0ZXJzIGFyZSBvayAuLi4gKi8KKworICAgIC8qIGdldCB0aGUgbG9jayB0byBwcmV2ZW50IG90aGVyIGNsaWVudHMgZnJvbSBlbnRlcmluZyAqLworICAgIGl4TnBlTWhDb25maWdMb2NrR2V0IChucGVJZCk7CisKKyAgICAvKiByZWNlaXZlIG1lc3N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orICogQHBhcgorICogLS0gRW5kIG9mIENvcHlyaWdodCBOb3RpY2UgLS0KKyovCisKKy8qCisgKiBQdXQgdGhlIHN5c3RlbSBkZWZpbmVkIGluY2x1ZGUgZmlsZXMgcmVxdWlyZWQuCisgKi8KKworCisvKgorICogUHV0IHRoZSB1c2VyIGRlZmluZWQgaW5jbHVkZSBmaWxlcyByZXF1aXJlZC4KKyAqLworCisjaW5jbHVkZSAiSXhPc2FsLmgiCisKKyNpbmNsdWRlICJJeE5wZU1oTWFjcm9zX3AuaCIKKworI2luY2x1ZGUgIkl4TnBlTWhDb25maWdfcC5oIgorCisvKgorICogI2RlZmluZXMgYW5kIG1hY3JvcyB1c2VkIGluIHRoaXMgZmlsZS4KKyAqLworI2RlZmluZSBJWF9OUEVfTUhfTUFYX05VTV9PRl9SRVRSSUVTIDEwMDAwMDAgLyoqPCBNYXhpbXVtIG51bWJlciBvZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogcmV0cmllcyBiZWZvcmUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHRpbWVvdXQKKwkJCQkJICAgICAgICAgICAgICAgICAgICAgICAgICAqLyAgCisKKy8qCisgKiBUeXBlZGVmcyB3aG9zZSBzY29wZSBpcyBsaW1pdGVkIHRvIHRoaXMgZmlsZS4KKyAqLworCisvKioKKyAqIEBzdHJ1Y3QgSXhOcGVNaENvbmZpZ1N0YXRzCisgKgorICogQGJyaWVmIFRoaXMgc3RydWN0dXJlIGlzIHVzZWQgdG8gbWFpbnRhaW4gc3RhdGlzdGljcyBmb3IgdGhlCisgKiBDb25maWd1cmF0aW9uIG1vZHVsZS4KKyAqLworCit0eXBlZGVmIHN0cnVjdAoreworICAgIFVJTlQzMiBvdXRGaWZvUmVhZHM7ICAgICAgICAvKio8IG91dEZpZm8gcmVhZHMgKi8KKyAgICBVSU5UMzIgaW5GaWZvV3JpdGVzOyAgICAgICAgLyoqPCBpbkZpZm8gd3JpdGVzICovCisgICAgVUlOVDMyIG1heEluRmlmb0Z1bGxSZXRyaWVzOyAgIC8qKjwgbWF4IHJldHJpZXMgaWYgaW5GSUZPIGZ1bGwgICAqLworICAgIFVJTlQzMiBtYXhPdXRGaWZvRW1wdHlSZXRyaWVzOyAvKio8IG1heCByZXRyaWVzIGlmIG91dEZJRk8gZW1wdHkgKi8KK30gSXhOcGVNaENvbmZpZ1N0YXRzOworCisvKgorICogVmFyaWFibGUgZGVjbGFyYXRpb25zIGdsb2JhbCB0byB0aGlzIGZpbGUgb25seS4gIEV4dGVybnMgYXJlIGZvbGxvd2VkIGJ5CisgKiBzdGF0aWMgdmFyaWFibGVzLgorICovCisKK0l4TnBlTWhDb25maWdOcGVJbmZvIGl4TnBlTWhDb25maWdOcGVJbmZvW0lYX05QRU1IX05VTV9OUEVTXSA9Cit7CisgICAgeworICAgICAgICAwLAorICAgICAgICBJWF9OUEVNSF9OUEVBX0lOVCwKKwkwLAorICAgICAgICAwLAorICAgICAgICAwLAorICAgICAgICAwLAorICAgICAgICAwLAorICAgICAgICBOVUxMLAorICAgICAgICBGQUxTRQorICAgIH0sCisgICAgeworICAgICAgICAwLAorICAgICAgICBJWF9OUEVNSF9OUEVCX0lOVCwKKwkwLAorCTAsCisgICAgICAgIDAsCisgICAgICAgIDAsCisgICAgICAgIDAsCisgICAgICAgIE5VTEwsCisgICAgICAgIEZBTFNFCisgICAgfSwKKyAgICB7CisgICAgICAgIDAsCisgICAgICAgIElYX05QRU1IX05QRUNfSU5ULAorICAgICAgICAwLAorICAgICAgICAwLAorICAgICAgICAwLAorICAgICAgICAwLAorICAgICAgICAwLAorICAgICAgICBOVUxMLAorICAgICAgICBGQUxTRQorICAgIH0KK307CisKK1BSSVZBVEUgSXhOcGVNaENvbmZpZ1N0YXRzIGl4TnBlTWhDb25maWdTdGF0c1tJWF9OUEVNSF9OVU1fTlBFU107CisKKy8qCisgKiBFeHRlcm4gZnVuY3Rpb24gcHJvdG90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gICAgICAgIC8qIGludm9rZSB0aGUgSVNSIHJvdXRpbmUgKi8KKyAgICAgICAgICAgIGl4TnBlTWhDb25maWdOcGVJbmZvW25wZUlkXS5pc3IgKG5wZUlkKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIGlmIHdlIGRvbid0IHNlcnZpY2UgdGhlIGludGVycnVwdCB0aGUgTlBFIHdpbGwgY29udGludWUgKi8KKyAgICAgICAgICAgIC8qIHRvIHRyaWdnZXIgdGhlIGludGVycnVwdCBpbmRlZmluaXRlbHkgKi8KKyAgICAgICAgICAgIElYX05QRU1IX0VSUk9SX1JFUE9SVCAoIk5vIElTUiByZWdpc3RlcmVkIHRvIHNlcnZpY2UgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiaW50ZXJydXB0XG4iKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIElYX05QRU1IX1RSQUNFMCAoSVhfTlBFTUhfRk5fRU5UUllfRVhJVCwgIkV4aXRpbmcgIgorICAgICAgICAgICAgICAgICAgICAgIml4TnBlTWhDb25maWdJc3JcbiIpOworfQorCisvKgorICogRnVuY3Rpb24gZGVmaW5pdGlvbjogaXhOcGVNaENvbmZpZ0luaXRpYWxpemUKKyAqLworCit2b2lkIGl4TnBlTWhDb25maWdJbml0aWFsaXplICgKKyAgICBJeE5wZU1oTnBlSW50ZXJydXB0cyBucGVJbnRlcnJ1cHRzKQoreworICAgIEl4TnBlTWhOcGVJZCBucGVJZDsKKyAgICBVSU5UMzIgdmlydHVhbEFkZHJbSVhfTlBFTUhfTlVNX05QRVNdOworCisgICAgSVhfTlBFTUhfVFJBQ0UwIChJWF9OUEVNSF9GTl9FTlRSWV9FWElULCAiRW50ZXJpbmcgIgorICAgICAgICAgICAgICAgICAgICAgIml4TnBlTWhDb25maWdJbml0aWFsaXplXG4iKTsKKworICAgIC8qIFJlcXVlc3QgYSBtYXBwaW5nIGZvciB0aGUgTlBFLUEgY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AgICAgIGl4TnBlTWhDb25maWdOcGVJbnRlcnJ1cHRFbmFibGUgKG5wZUlkKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIGRpc2FibGUgdGhlIE5QRSdzICJvdXRGSUZPIG5vdCBlbXB0eSIgaW50ZXJydXB0ICovCisgICAgICAgICAgICBpeE5wZU1oQ29uZmlnTnBlSW50ZXJydXB0RGlzYWJsZSAobnBlSWQpOworICAgICAgICB9CisgICAgfQorCisgICAgSVhfTlBFTUhfVFJBQ0UwIChJWF9OUEVNSF9GTl9FTlRSWV9FWElULCAiRXhpdGluZyAiCisgICAgICAgICAgICAgICAgICAgICAiaXhOcGVNaENvbmZpZ0luaXRpYWxpemVcbiIpOworfQorCisvKgorICogRnVuY3Rpb24gZGVmaW5pdGlvbjogaXhOcGVNaENvbmZpZ1VuaW5pdAorICovCisKK3ZvaWQgaXhOcGVNaENvbmZpZ1VuaW5pdCAodm9pZCkKK3sKKyAgICBJeE5wZU1oTnBlSWQgbnBlSWQ7CisKKyAgICBJWF9OUEVNSF9UUkFDRTAgKElYX05QRU1IX0ZOX0VOVFJZX0VYSVQsICJFbnRlcmluZyAiCisgICAgICAgICAgICAgICAgICAgICAiaXhOcGVNaENvbmZpZ1VuaW5pdFxuIik7CisKKyAgICAvKiBmb3IgZWFjaCBOUEUgLi4uICovCisgICAgZm9yIChucGVJZCA9IDA7IG5wZUlkIDwgSVhfTlBFTUhfTlVNX05QRVM7IG5wZUlkKyspCisgICAgeworICAgICAgICAvKiBkZWNsYXJlIGEgY29udmVuaWVuY2UgcG9pbnRlciAqLworICAgICAgICBJeE5wZU1oQ29uZmlnTnBlSW5mbyAqbnBlSW5mbyA9ICZpeE5wZU1oQ29uZmlnTnBlSW5mb1tucGVJZF07CisgICAgICAgIAorICAgICAgICAvKiBkaXNjb25uZWN0IElTUiAqLworICAgICAgICBpeE9zYWxJcnFVbmJpbmQobnBlSW5mby0+aW50ZXJydXB0S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IGNvbnRyb2wgcmVnaXN0ZXIgKi8KKyAgICAgICAgLyogd2UgbXVzdCBzZXQgdGhlIE9GRVdFIChPdXRGaWZvRW5hYmxlV3JpdGVFbmFibGUpIGF0IHRoZSBzYW1lICovCisgICAgICAgIC8qIHRpbWUgZm9yIHRoZSB3cml0ZSB0byBoYXZlIGVmZmVjdCAqLworICAgICAgICBJWF9OUEVNSF9SRUdJU1RFUl9XUklURV9CSVRTIChjb250cm9sUmVnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoSVhfTlBFTUhfTlBFX0NUTF9PRkUgfAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSVhfTlBFTUhfTlBFX0NUTF9PRkVXRSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChJWF9OUEVNSF9OUEVfQ1RMX09GRSB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJWF9OUEVNSF9OUEVfQ1RMX09GRVdFKSk7CisgICAgfQorCisgICAgLyogcmV0dXJuIHRoZSBwcmV2aW91cyBzdGF0ZSBvZiB0aGUgaW50ZXJydXB0ICovCisgICAgcmV0dXJuIChvZmUgIT0gMCk7Cit9CisKKy8qCisgKiBGdW5jdGlvbiBkZWZpbml0aW9uOiBpeE5wZU1oQ29uZmlnTnBlSW50ZXJydXB0RGlzYWJsZQorICovCisKK0JPT0wgaXhOcGVNaENvbmZpZ05wZUludGVycnVwdERpc2FibGUgKAorICAgIEl4TnBlTWhOcGVJZCBucGVJZCkKK3sKKyAgICBVSU5UMzIgb2ZlOworICAgIHZvbGF0aWxlIFVJTlQzMiAqY29udHJvbFJlZyA9CisgICAgICAgIChVSU5UMzIgKilpeE5wZU1oQ29uZmlnTnBlSW5mb1tucGVJZF0uY29udHJvbFJlZ2lzdGVyOworCisgICAgLyogZ2V0IHRoZSBPRkUgKE91dEZpZm9FbmFibGUpIGJpdCBvZiB0aGUgY29udHJvbCByZWdpc3RlciAqLworICAgIElYX05QRU1IX1JFR0lTVEVSX1JFQURfQklUUyAoY29udHJvbFJlZywgJm9mZSwgSVhfTlBFTUhfTlBFX0NUTF9PRkUpOworCisgICAgLyogaWYgdGhlIGludGVycnVwdCBpcyBlbmFibGVkIHRoZW4gd2UgbXVzdCBkaXNhYmxlIGl0ICovCisgICAgaWYgKG9mZSkKKyAgICB7CisgICAgICAgIC8qIHVuc2V0IHRoZSBPRkUgKE91dEZpZm9FbmFibGUpIGJpdCBvZiB0aGUgY29udHJvbCByZWdpc3RlciAqLworICAgICAgICAvKiB3ZSBtdXN0IHNldCB0aGUgT0ZFV0UgKE91dEZpZm9FbmFibGVXcml0ZUVuYWJsZSkgYXQgdGhlIHNhbWUgKi8KKyAgICAgICAgLyogdGltZSBmb3IgdGhlIHdyaXRlIHRvIGhhdmUgZWZmZWN0ICovCisgICAgICAgIElYX05QRU1IX1JFR0lTVEVSX1dSSVRFX0JJVFMgKGNvbnRyb2xSZWcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgwICAgICAgICAgICAgICAgICAgICB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJWF9OUEVNSF9OUEVfQ1RMX09GRVdFKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKElYX05QRU1IX05QRV9DVExfT0ZFIHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElYX05QRU1IX05QRV9DVExfT0ZFV0UpKTsKKyAgICB9CisKKyAgICAvKiByZXR1cm4gdGhlIHByZXZpb3VzIHN0YXRlIG9mIHRoZSBpbnRlcnJ1cHQgKi8KKyAgICByZXR1cm4gKG9mZSAhPSAwKTsKK30KKworLyoKKyAqIEZ1bmN0aW9uIGRlZmluaXRpb246IGl4TnBlTWhDb25maWdNZXNzYWdlSWRHZXQKKyAqLworCitJeE5wZU1oTWVzc2FnZUlkIGl4TnBlTWhDb25maWdNZXNzYWdlSW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UuICovCisKKyAgICAgICAgLyogd2UgYXNzdW1lIHRoZSBtZXNzYWdlIGlzIHVuc29saWNpdGVkLiAgb25seSBpZiB0aGVyZSBpcyBubyAqLworICAgICAgICAvKiB1bnNvbGljaXRlZCBjYWxsYmFjayBmb3IgdGhpcyBtZXNzYWdlIHR5cGUgZG8gd2UgYXNzdW1lIHRoZSAqLworICAgICAgICAvKiBtZXNzYWdlIGlzIHNvbGljaXRlZC4gIGl0IGlzIG11Y2ggZmFzdGVyIHRvIGNoZWNrIGZvciBhbiAqLworICAgICAgICAvKiB1bnNvbGljaXRlZCBjYWxsYmFjaywgc28gZG9pbmcgdGhpcyBjaGVjayBmaXJzdCBzaG91bGQgcmVzdWx0ICovCisgICAgICAgIC8qIGluIGJldHRlciBwZXJmb3JtYW5jZS4gKi8KKworICAgICAgICBpeE5wZU1oVW5zb2xpY2l0ZWRDYk1nckNhbGxiYWNrUmV0cmlldmUgKAorICAgICAgICAgICAgbnBlSWQsIG1lc3NhZ2VJZCwgJmNhbGxiYWNrKTsKKworICAgICAgICBpZiAoY2FsbGJhY2sgIT0gTlVMTCkKKyAgICAgICAgeworCSAgICBJWF9OUEVNSF9UUkFDRTAgKElYX05QRU1IX0RFQlVHLAorCQkJICAgICAiRm91bmQgbWF0Y2hpbmcgdW5zb2xpY2l0ZWQgY2FsbGJhY2tcbiIpOworCisgICAgICAgICAgICAvKiB1cGRhdGUgc3RhdGlzdGljYWwgaW5mbyAqLworICAgICAgICAgICAgaXhOcGVNaFJlY2VpdmVTdGF0c1tucGVJZF0udW5zb2xpY2l0ZWQrKzsKKyAgICAgICAgfQorCisgICAgICAgIC8qIGlmIG5vIHVuc29saWNpdGVkIGNhbGxiYWNrIHdhcyBmb3VuZCB0cnkgdG8gZmluZCBhIG1hdGNoaW5nICovCisgICAgICAgIC8qIHNvbGljaXRlZCBjYWxsYmFjayBmb3IgdGhpcyBtZXNzYWdlICovCisgICAgICAgIGlmIChjYWxsYmFjayA9PSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgICBpeE5wZU1oU29saWNpdGVkQ2JNZ3JDYWxsYmFja1JldHJpZXZlICgKKyAgICAgICAgICAgICAgICBucGVJZCwgbWVzc2FnZUlkLCAmY2FsbGJhY2spOworCisgICAgICAgICAgICBpZiAoY2FsbGJhY2sgIT0gTlVMTCkKKyAgICAgICAgICAgIHsKKwkJSVhfTlBFTUhfVFJBQ0UwIChJWF9OUEVNSF9ERUJVRywKKwkJCQkgIkZvdW5kIG1hdGNoaW5nIHNvbGljaXRlZCBjYWxsYmFja1xuIik7CisKKyAgICAgICAgICAgICAgICAvKiB1cGRhdGUgc3RhdGlzdGljYWwgaW5mbyAqLworICAgICAgICAgICAgICAgIGl4TnBlTWhSZWNlaXZlU3RhdHNbbnBlSWRdLnNvbGljaXRlZCsrOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLyogaWYgYSBjYWxsYmFjayAoZWl0aGVyIHVuc29saWNpdGVkIG9yIHNvbGljaXRlZCkgd2FzIGZvdW5kICovCisgICAgICAgIGlmIChjYWxsYmFjayAhPSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBpbnZva2UgdGhlIGNhbGxiYWNrIHRvIHBhc3MgdGhlIG1lc3NhZ2UgYmFjayB0byB0aGUgY2xpZW50ICovCisgICAgICAgICAgICBjYWxsYmFjayAobnBlSWQsIG1lc3NhZ2UpOworCisgICAgICAgICAgICAvKiB1cGRhdGUgc3RhdGlzdGljYWwgaW5mbyAqLworICAgICAgICAgICAgaXhOcGVNaFJlY2VpdmVTdGF0c1tucGVJZF0uY2FsbGJhY2tzKys7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSAvKiBubyBjYWxsYmFjayAobmVpdGhlciB1bnNvbGljaXRlZCBub3Igc29saWNpdGVkKSB3YXMgZm91bmQgKi8KKyAgICAgICAgeworCSAgICBJWF9OUEVNSF9UUkFDRTIgKElYX05QRU1IX1dBUk5JTkcsCisJCQkgICAgICJObyBtYXRjaGlu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gICAgLyogaWYgdGhpcyBlbnRyeSBpcyBiZWZvcmUgdGhlIGxhc3QgZW50cnkgKi8KKyAgICAgICAgICAgIGlmIChsb2NhbEluZGV4IDwgSVhfTlBFTUhfTUFYX0NBTExCQUNLUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBjaGFpbiB0aGlzIGVudHJ5IHRvIHRoZSBmb2xsb3dpbmcgZW50cnkgKi8KKyAgICAgICAgICAgICAgICBsaXN0LT5lbnRyaWVzW2xvY2FsSW5kZXhdLm5leHQgPSAmKGxpc3QtPmVudHJpZXNbbG9jYWxJbmRleCArIDFdKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgLyogdGhpcyBlbnRyeSBpcyB0aGUgbGFzdCBlbnRyeSAqLworICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIHRoZSBsYXN0IGVudHJ5IGlzbid0IGNoYWluZWQgdG8gYW55dGhpbmcgKi8KKyAgICAgICAgICAgICAgICBsaXN0LT5lbnRyaWVzW2xvY2FsSW5kZXhdLm5leHQgPSBOVUxMOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLyogc2V0IHRoZSBmcmVlIGxpc3QgcG9pbnRlciB0byBwb2ludCB0byB0aGUgZmlyc3QgcmVhbCBlbnRyeSAqLworICAgICAgICAvKiAoYWxsIHJlYWwgZW50cmllcyBiZWdpbiBjaGFpbmVkIHRvZ2V0aGVyIG9uIHRoZSBmcmVlIGxpc3QpICovCisgICAgICAgIGxpc3QtPmZyZWVIZWFkID0gJihsaXN0LT5lbnRyaWVzWzFdKTsKKworICAgICAgICAvKiBzZXQgdGhlIGNhbGxiYWNrIGxpc3QgcG9pbnRlcnMgdG8gcG9pbnQgdG8gdGhlIGR1bW15IGVudHJ5ICovCisgICAgICAgIC8qICh0aGUgY2FsbGJhY2sgbGlzdCBpcyBpbml0aWFsbHkgZW1wdHkpICovCisgICAgICAgIGxpc3QtPmNhbGxiYWNrSGVh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b2xsb3dlZCBieQorICogc3RhdGljIHZhcmlhYmxlcy4KKyAqLworCisvKiAKKyAqIEEgdW5pdCBvZiAzMiwgdXNlZCB0byBwcm92aWRlIGJpdC1zaGlmdCBmb3IgcG9vbAorICogbWFuYWdlbWVudC4gTmVlZHMgc29tZSB3b3JrIGlmIHVzZXJzIHdhbnQgbW9yZSB0aGFuIDMyIHBvb2xzLgorICovCisjZGVmaW5lIElYX09TQUxfQlVGRl9GUkVFX0JJVFMgMzIKKworUFJJVkFURSBVSU5UMzIgaXhPc2FsQnVmZkZyZWVQb29sc1tJWF9PU0FMX01CVUZfTUFYX1BPT0xTIC8KKyAgICBJWF9PU0FMX0JVRkZfRlJFRV9CSVRTXTsKKworUFVCTElDIElYX09TQUxfTUJVRl9QT09MIGl4T3NhbEJ1ZmZQb29sc1tJWF9PU0FMX01CVUZfTUFYX1BPT0xTXTsKKworc3RhdGljIGludCBpeE9zYWxCdWZmUG9vbHNJblVzZSA9IDA7CisKKyNpZmRlZiBJWF9PU0FMX0JVRkZFUl9BTExPQ19TRVBBUkFURUxZCitQUklWQVRFIElYX09TQUxfTUJVRiAqCitpeE9zYWxCdWZmUG9vbE1idWZJbml0IChVSU5UMzIgbWJ1ZlNpemVBbGlnbmVkLAorICAgICAgICAgICAgICAgICAgICAgIFVJTlQzMiBkYXRhU2l6ZUFsaWduZWQsCisgICAgICAgICAgICAgICAgICAgICAgSVhfT1NBTF9NQlVGX1BPT0wgKnBvb2xQdHIpOworI2VuZGlmCisKK1BSSVZBVEUgSVhfT1NBTF9NQlVGX1BPT0wgKiBpeE9zYWxQb29sQWxsb2MgKHZvaWQpOyAgICAgICAgICAgICAgICAgICAgICAKKworLyoKKyAqIEZ1bmN0aW9uIGRlZmluaXRpb246IGl4T3NhbFBvb2xBbGxvYworICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitQUklWQVRFIElYX09TQUxfTUJVRl9QT09MICoKK2l4T3NhbFBvb2xBbGxvYyAodm9pZCk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QWxpZ25lZCwgZGF0YVNpemVBbGlnbmVkOworICAgIElYX09TQUxfTUJVRiAqY3VycmVudE1idWZQdHIgPSBOVUxMOworI2Vsc2UKKyAgICB2b2lkICpwb29sQnVmUHRyOworICAgIHZvaWQgKnBvb2xEYXRhUHRyOworICAgIGludCBtYnVmTWVtU2l6ZTsKKyAgICBpbnQgZGF0YU1lbVNpemU7CisjZW5kaWYKKworICAgIElYX09TQUxfTUJVRl9QT09MICpwb29sUHRyID0gTlVMTDsKKyAgICAKKyAgICBpZiAoY291bnQgPD0gMCkKKyAgICB7CisgICAgICAgIGl4T3NhbExvZyAoSVhfT1NBTF9MT0dfTFZMX0VSUk9SLAorICAgICAgICAgICAgSVhfT1NBTF9MT0dfREVWX1NURE9VVCwKKyAgICAgICAgICAgICJpeE9zYWxQb29sSW5pdCgpOiAiICJjb3VudCA9IDAgXG4iLCAwLCAwLCAwLCAwLCAwLCAwKTsKKyAgICAgICAgcmV0dXJuIE5VTEw7ICAgICAgICAKKyAgICB9CisKKyAgICBpZiAobmFtZSA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgaXhPc2FsTG9nIChJWF9PU0FMX0xPR19MVkxfRVJST1IsCisgICAgICAgICAgICBJWF9PU0FMX0xPR19ERVZfU1RET1VULAorICAgICAgICAgICAgIml4T3NhbFBvb2xJbml0KCk6ICIgIk5VTEwgbmFtZSBcbiIsIDAsIDAsIDAsIDAsIDAsIDApOworICAgICAgICByZXR1cm4gTlVMTDsgICAgICAgIAorICAgIH0KKyAgICAKKyAgICBpZiAoc3RybGVuIChuYW1lKSA+IElYX09TQUxfTUJVRl9QT09MX05BTUVfTEVOKQorICAgIHsKKyAgICAgICAgaXhPc2FsTG9nIChJWF9PU0FMX0xPR19MVkxfRVJST1IsCisgICAgICAgICAgICBJWF9PU0FMX0xPR19ERVZfU1RET1VULAorICAgICAgICAgICAgIml4T3NhbFBvb2xJbml0KCk6ICIKKyAgICAgICAgICAgICJFUlJPUiAtIG5hbWUgbGVuZ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X0VSUk9SLAorICAgICAgICAgICAgSVhfT1NBTF9MT0dfREVWX1NURE9VVCwKKyAgICAgICAgICAgICJpeE9zYWxQb29sSW5pdCgpOiAiICJGYWlsIHRvIGdldCBwb29sIHB0ciBcbiIsIDAsIDAsIDAsIDAsIDAsIDApOworICAgICAgICByZXR1cm4gTlVMTDsKKyAgICB9CisKKyAgICBwb29sUHRyLT5wb29sQWxsb2NUeXBlID0gSVhfT1NBTF9NQlVGX1BPT0xfVFlQRV9TWVNfQUxMT0M7CisKKyNlbmRpZiAvKiBJWF9PU0FMX0JVRkZFUl9BTExPQ19TRVBBUkFURUxZICovCisgICAgcmV0dXJuIHBvb2xQdHI7Cit9CisKK1BVQkxJQyBJWF9PU0FMX01CVUZfUE9PTCAqCitpeE9zYWxOb0FsbG9jUG9vbEluaXQgKHZvaWQgKnBvb2xCdWZQdHIsCisgICAgdm9pZCAqcG9vbERhdGFQdHIsIFVJTlQzMiBjb3VudCwgVUlOVDMyIHNpemUsIGNvbnN0IGNoYXIgKm5hbWUpCit7CisgICAgVUlOVDMyIGksICBtYnVmU2l6ZUFsaWduZWQsIHNpemVBbGlnbmVkOworICAgIElYX09TQUxfTUJVRiAqY3VycmVudE1idWZQdHIgPSBOVUxMOworICAgIElYX09TQUxfTUJVRiAqbmV4dE1idWZQdHIgPSBOVUxMOworICAgIElYX09TQUxfTUJVRl9QT09MICpwb29sUHRyID0gTlVMTDsKKworICAgIC8qCisgICAgICogY2hlY2sgcGFyYW1ldGVycyAKKyAgICAgKi8KKyAgICBpZiAocG9vbEJ1ZlB0ciA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgaXhPc2FsTG9nIChJWF9PU0FMX0xPR19MVkxfRVJST1IsCisgICAgICAgICAgICBJWF9PU0FMX0xPR19ERVZfU1RET1VULAorICAgICAgICAgICAgIml4T3NhbE5vQWxsb2NQb29sSW5pdCgpOiAiCisgICAgICAgICAgICAiRVJST1IgLSBOVUxMIHBvb2xCdWZQdHIgXG4iLCAwLCAwLCAwLCAwLCAwLCAwKTsKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorCisgICAgaWYgKGNvdW50IDw9IDApCisgICAgeworICAgICAgICBpeE9zYWxMb2cgKElYX09TQUxfTE9HX0xWTF9FUlJPUiwKKyAgICAgICAgICAgIElYX09TQUxfTE9HX0RFVl9TVERPVVQsCisgICAgICAgICAgICAiaXhPc2FsTm9BbGxvY1Bvb2xJbml0KCk6ICIKKyAgICAgICAgICAgICJFUlJPUiAtIGNvdW50IG11c3QgPiAwICAgXG4iLCAwLCAwLCAwLCAwLCAwLCAwKTsKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorCisgICAgaWYgKG5hbWUgPT0gTlVMTCkKKyAgICB7CisgICAgICAgIGl4T3NhbExvZyAoSVhfT1NBTF9MT0dfTFZMX0VSUk9SLAorICAgICAgICAgICAgSVhfT1NBTF9MT0dfREVWX1NURE9VVCwKKyAgICAgICAgICAgICJpeE9zYWxOb0FsbG9jUG9vbEluaXQoKTogIgorICAgICAgICAgICAgIkVSUk9SIC0gTlVMTCBuYW1lIHB0ciAgXG4iLCAwLCAwLCAwLCAwLCAwLCAwKTsKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorCisgICAgaWYgKHN0cmxlbiAobmFtZSkgPiBJWF9PU0FMX01CVUZfUE9PTF9OQU1FX0xFTikKKyAgICB7CisgICAgICAgIGl4T3NhbExvZyAoSVhfT1NBTF9MT0dfTFZMX0VSUk9SLAorICAgICAgICAgICAgSVhfT1NBTF9MT0dfREVWX1NURE9VVCwKKyAgICAgICAgICAgICJpeE9zYWxOb0FsbG9jUG9vbEluaXQoKTogIgorICAgICAgICAgICAgIkVSUk9SIC0gbmFtZSBsZW5ndGggc2hvdWxkIGJlIG5vIGdyZWF0ZXIgdGhhbiAlZCAgXG4iLAorICAgICAgICAgICAgSVhfT1NBTF9NQlVGX1BPT0xfTkFNRV9MRU4sIDAsIDAsIDAsIDAsIDApOworICAgICAgICByZXR1cm4gTlVMTDsKKyAgICB9CisKKyAgICBwb29sUHRyID0gaXhPc2FsUG9vbEFsbG9jICgpOworCisgICAgaWYgKHBvb2xQdHIgPT0gTlVMTCkKKyAgICB7CisgICAgICAgIHJldHVybiBOVUxMOworICAgIH0KKworICAgIC8qCisgICAgICogQWRqdXN0IHNpemVzIHRvIGVuc3VyZSBhbGlnbm1lbnQgb24gY2FjaGUgbGluZSBib3VuZGFyaWVzIAorICAgICAqLworICAgIG1idWZTaXplQWxpZ25lZCA9CisgICAgICAgIElYX09TQUxfTUJVRl9QT09MX1NJWkVfQUxJR04gKHNpemVvZiAoSVhfT1NBTF9NQlVGKSk7CisgICAgLyoKKyAgICAgKiBjbGVhciB0aGUgbWJ1ZiBtZW1vcnkgYXJlYSAKKyAgICAgKi8KKyAgICBtZW1zZXQgKHBvb2xCdWZQdHIsIDAsIG1idWZTaXplQWxpZ25lZCAqIGNvdW50KTsKKworICAgIGlmIChwb29sRGF0YVB0ciAhPSBOVUxMKQorICAgIHsKKyAgICAgICAgLyoKKyAgICAgICAgICogQWRqdXN0IHNpemVzIHRvIGVuc3VyZSBhbGlnbm1lbnQgb24gY2FjaGUgbGluZSBib3VuZGFyaWVzIAorICAgICAgICAgKi8KKyAgICAgICAgc2l6ZUFsaWduZWQgPSBJWF9PU0FMX01CVUZfUE9PTF9TSVpFX0FMSUdOIChzaXplKTsKKyAgICAgICAgLyoKKyAgICAgICAgICogY2xlYXIgdGhlIGRhdGEgbWVtb3J5IGFyZWEgCisgICAgICAgICAqLworICAgICAgICBtZW1zZXQgKHBvb2xEYXRhUHRyLCAwLCBzaXplQWxpZ25lZCAqIGNvdW50KTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgc2l6ZUFsaWduZWQgPSAwOworICAgIH0KKworICAgIC8qCisgICAgICogaW5pdGlhbGlzZSBwb29sIGZpZWxkcyAKKyAgICAgKi8KKyAgICBzdHJjcHkgKChwb29sUHRyKS0+bmFtZSwgbmFtZSk7CisKKyAgICBwb29sUHRyLT5kYXRhTWVtUHRyID0gcG9vbERhdGFQdHI7CisgICAgcG9vbFB0ci0+bWJ1Zk1lbVB0ciA9IHBvb2xCdWZQdHI7CisgICAgcG9vbFB0ci0+YnVmRGF0YVNpemUgPSBzaXplQWxpZ25lZDsKKyAgICBwb29sUHRyLT50b3RhbEJ1ZnNJblBvb2wgPSBjb3VudDsKKyAgICBwb29sUHRyLT5tYnVmTWVtU2l6ZSA9IG1idWZTaXplQWxpZ25lZCAqIGNvdW50OworICAgIHBvb2xQdHItPmRhdGFNZW1TaXplID0gc2l6ZUFsaWduZWQgKiBjb3VudDsKKworICAgIGN1cnJlbnRNYnVmUHRyID0gKElYX09TQUxfTUJVRiAqKSBwb29sQnVmUHRyOworCisgICAgcG9vbFB0ci0+bmV4dEZyZWVCdWYgPSBjdXJyZW50TWJ1ZlB0cjsKKworICAgIGZvciAoaSA9IDA7IGkgPCBjb3VudDsgaSsrKQorICAgIHsKKyAgICAgICAgaWYgKGkgPCAoY291bnQgLSAxKSkKKyAgICAgICAgeworICAgICAgICAgICAgbmV4dE1idWZQdHIgPQorICAgICAgICAgICAgICAgIChJWF9PU0FMX01CVUYgKikgKCh1bnNpZ25lZCkgY3VycmVudE1idWZQdHIgKworICAgICAgICAgICAgICAgIG1idWZTaXplQWxpZ25lZCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7ICAgICAgICAgICAgICAgICAgICAgICAvKiBsYXN0IG1idWYgaW4gY2hhaW4gKi8KKyAgICAgICAgICAgIG5leHRNYnVmUHRyID0gTlVMTDsKKyAgICAgICAgfQorICAgICAgICBJWF9PU0FMX01CVUZfTkVYVF9CVUZGRVJfSU5fUEtUX1BUUiAoY3VycmVudE1idWZQdHIpID0gbmV4dE1idWZQdHI7CisgICAgICAgIElYX09TQUxfTUJVRl9ORVRfUE9PTCAoY3VycmVudE1idWZQdHIpID0gcG9vbFB0cjsKKworICAgICAgICBJWF9PU0FMX01CVUZfU1lTX1NJR05BVFVSRV9JTklUKGN1cnJlbnRNYnVmUHRyKTsKKworICAgICAgICBpZiAocG9vbERhdGFQdHIgIT0gTlVMTCkKKyAgICAgICAgeworICAgICAgICAgICAgSVhfT1NBTF9NQlVGX01EQVRBIChjdXJyZW50TWJ1ZlB0cikgPSBwb29sRGF0YVB0cjsKKyAgICAgICAgICAgIElYX09TQUxfTUJVRl9BTExPQ0FURURfQlVGRl9EQVRBKGN1cnJlbnRNYnVmUHRyKSA9IChVSU5UMzIpIHBvb2xEYXRhUHRyOworCisgICAgICAgICAgICBJWF9PU0FMX01CVUZfTUxFTiAoY3VycmVudE1idWZQdHIpID0gc2l6ZUFsaWduZWQ7CisgICAgICAgICAgICBJWF9PU0FMX01CVUZfQUxMT0NBVEVEX0JVRkZfTEVOKGN1cnJlbnRNYnVmUHRyKSA9IHNpemVBbGlnbmVkOworCisgICAgICAgICAgICBwb29sRGF0YVB0ciA9ICh2b2lkICopICgodW5zaWduZWQpIHBvb2xEYXRhUHRyICsgc2l6ZUFsaWduZWQpOworICAgICAgICB9CisKKyAgICAgICAgY3VycmVudE1idWZQdHIgPSBuZXh0TWJ1ZlB0cjsKKyAgICB9CisKKyAgICAvKgorICAgICAqIHVwZGF0ZSB0aGUgbnVtYmVyIG9mIGZyZWUgYnVmZmVycyBpbiB0aGUgcG9vbCAKKyAgICAgKi8KKyAgICBwb29sUHRyLT5mcmVlQnVmc0luUG9vbCA9IGNvdW50OworCisgICAgcG9vbFB0ci0+cG9vbEFsbG9jVHlwZSA9IElYX09TQUxfTUJVRl9QT09MX1RZUEVfVVNFUl9BTExPQzsKKworICAgIHJldHVybiBwb29sUHRyOworfQorCisvKiAKKyAqIEdldCBhIG1idWYgcHRyIGZyb20gdGhlIHBvb2wKKyAqLworUFVCTElDIElYX09TQUxfTUJVRiAqCitpeE9zYWxNYnVmQWxsb2MgKElYX09TQUxfTUJVRl9QT09MICogcG9vbFB0cikKK3sKKyAgICBpbnQgbG9jazsKKyAgICBJWF9PU0FMX01CVUYgKm5ld0J1ZlB0ciA9IE5VTEw7CisKKyAgICAvKgorICAgICAqIGNoZWNrIHBhcmFtZXRlcnMgCisgICAgICovCisgICAgaWYgKHBvb2xQdHIgPT0gTlVMTCkKKyAgICB7CisgICAgICAgIGl4T3NhbExvZyAoSVhfT1NBTF9MT0dfTFZMX0VSUk9SLAorICAgICAgICAgICAgSVhfT1NBTF9MT0dfREVWX1NURE9VVCwKKyAgICAgICAgICAgICJpeE9zYWxNYnVmQWxsb2MoKTogIgorICAgICAgICAgICAgIkVSUk9SIC0gSW52YWxpZCBQYXJhbWV0ZXJcbiIsIDAsIDAsIDAsIDAsIDAsIDApOworICAgICAgICByZXR1cm4gTlVMTDsKKyAgICB9CisKKyAgICBsb2NrID0gaXhPc2FsSXJxTG9jayAoKTsKKworICAgIG5ld0J1ZlB0ciA9IHBvb2xQdHItPm5leHRGcmVlQnVmOworICAgIGlmIChuZXdCdWZQdHIpCisgICAgeworICAgICAgICBwb29sUHRyLT5uZXh0RnJlZUJ1ZiA9CisgICAgICAgICAgICBJWF9PU0FMX01CVUZfTkVYVF9CVUZGRVJfSU5fUEtUX1BUUiAobmV3QnVmUHRyKTsKKyAgICAgICAgSVhfT1NBTF9NQlVGX05FWFRfQlVGRkVSX0lOX1BLVF9QVFIgKG5ld0J1ZlB0cikgPSBOVUxMOworCisgICAgICAgIC8qCisgICAgICAgICAqIHVwZGF0ZSB0aGUgbnVtYmVyIG9mIGZyZWUgYnVmZmVycyBpbiB0aGUgcG9vbCAKKyAgICAgICAgICovCisgICAgICAgIHBvb2xQdHItPmZyZWVCdWZzSW5Qb29sLS07CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIC8qIFJldHVybiBOVUxMIHRvIGluZGljYXRlIHRvIGNhbGxlciB0aGF0IHJlcXVlc3QgaXMgZGVuaWVkLiAqLworICAgICAgICBpeE9zYWxJcnFVbmxvY2sgKGxvY2spOworCisgICAgICAgIHJldHVybiBOVUxMOworICAgIH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ChJWF9PU0FMX01CVUYgKiBidWZQdHIpCit7CisgICAgd2hpbGUgKChidWZQdHIgPSBpeE9zYWxNYnVmRnJlZSAoYnVmUHRyKSkpOworfQorCisvKgorICogRnVuY3Rpb24gZGVmaW5pdGlvbjogaXhPc2FsQnVmZlBvb2xTaG93CisgKi8KK1BVQkxJQyB2b2lkCitpeE9zYWxNYnVmUG9vbFNob3cgKElYX09TQUxfTUJVRl9QT09MICogcG9vbFB0cikKK3sKKyAgICBJWF9PU0FMX01CVUYgKm5leHRCdWZQdHI7CisgICAgaW50IGNvdW50ID0gMDsKKyAgICBpbnQgbG9jazsKKworICAgIC8qCisgICAgICogY2hlY2sgcGFyYW1ldGVycyAKKyAgICAgKi8KKyAgICBpZiAocG9vbFB0ciA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgaXhPc2FsTG9nIChJWF9PU0FMX0xPR19MVkxfRVJST1IsCisgICAgICAgICAgICBJWF9PU0FMX0xPR19ERVZfU1RET1VULAorICAgICAgICAgICAgIml4T3NhbEJ1ZmZQb29sU2hvdygpOiAiCisgICAgICAgICAgICAiRVJST1IgLSBJbnZhbGlkIFBhcmFtZXRlciIsIDAsIDAsIDAsIDAsIDAsIDApOworICAgICAgICAvKgorICAgICAgICAgKiByZXR1cm4gSVhfRkFJTDsgCisgICAgICAgICAqLworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgbG9jayA9IGl4T3NhbElycUxvY2sgKCk7CisgICAgY291bnQgPSBwb29sUHRyLT5mcmVlQnVmc0luUG9vbDsKKyAgICBuZXh0QnVmUHRyID0gcG9vbFB0ci0+bmV4dEZyZWVCdWY7CisgICAgaXhPc2FsSXJxVW5sb2NrIChsb2NrKTsKKworICAgIGl4T3NhbExvZyAoSVhfT1NBTF9MT0dfTFZMX01FU1NBR0UsCisgICAgICAgIElYX09TQUxfTE9HX0RFVl9TVERPVVQsICI9PT0gUE9PTCBJTkZPUk1BVElPTiA9PT1cbiIsIDAsIDAsIDAsCisgICAgICAgIDAs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hfT1NBTF9MT0dfTFZMX0VSUk9SLCBJWF9PU0FMX0xPR19ERVZfU1RET1VULAorICAgICAgICAgICAgICAgICJpeE9zYWxCdWZmUG9vbEJ1ZkRhdGFQdHJSZXNldCIKKyAgICAgICAgICAgICAgICAiOiBpbnZhbGlkIG1idWYsIGNhbm5vdCByZXNldCBtRGF0YSBwb2ludGVyXG4iLCAwLCAwLAorICAgICAgICAgICAgICAgIDAsIDAsIDAsIDApOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIElYX09TQUxfTUJVRl9NREFUQSAoYnVmUHRyKSA9IChVSU5UOCopSVhfT1NBTF9NQlVGX0FMTE9DQVRFRF9CVUZGX0RBVEEgKGJ1ZlB0cik7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGlmIChwb29sRGF0YVB0cikKKyAgICAgICAgeworICAgICAgICAgICAgdW5zaWduZWQgaW50IGJ1ZlNpemUgPSBwb29sUHRyLT5idWZEYXRhU2l6ZTsKKyAgICAgICAgICAgIHVuc2lnbmVkIGludCBidWZEYXRhQWRkciA9CisgICAgICAgICAgICAgICAgKHVuc2lnbmVkIGludCkgSVhfT1NBTF9NQlVGX01EQVRBIChidWZQdHIpOworICAgICAgICAgICAgdW5zaWduZWQgaW50IHBvb2xEYXRhQWRkciA9ICh1bnNpZ25lZCBpbnQpIHBvb2xEYXRhUHRyOworCisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogdGhlIHBvaW50ZXIgaXMgc3RpbGwgcG9pbnRpbmcgc29tZXdoZXJlIGluIHRoZSBtYnVmIHBheWxvYWQuCisgICAgICAgICAgICAgKiBUaGlzIG9wZXJhdGlvbiBtb3ZlcyB0aGUgcG9pbnRlciB0byB0aGUgYmVnaW5uaW5nIG9mIHRoZSAKKyAgICAgICAgICAgICAqIG1idWYgcGF5bG9hZAorICAgICAgICAgICAgICovCisgICAgICAgICAgICBidWZEYXRhQWRkciA9ICgoYnVmRGF0YUFkZHIgLSBwb29sRGF0YUFkZHIpIC8gYnVmU2l6ZSkgKiBidWZTaXplOworICAgICAgICAgICAgSVhfT1NBTF9NQlVGX01EQVRBIChidWZQdHIpID0gJnBvb2xEYXRhUHRyW2J1ZkRhdGFBZGRyXTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIGl4T3NhbExvZyAoSVhfT1NBTF9MT0dfTFZMX1dBUk5JTkcsIElYX09TQUxfTE9HX0RFVl9TVERPVVQsCisgICAgICAgICAgICAgICAgIml4T3NhbEJ1ZmZQb29sQnVmRGF0YVB0clJlc2V0IgorICAgICAgICAgICAgICAgICI6IGNhbm5vdCBiZSB1c2VkIGlmIHVzZXIgc3VwcGxpZWQgTlVMTCBwb2ludGVyIGZvciBwb29sIGRhdGEgYXJlYSAiCisgICAgICAgICAgICAgICAgIndoZW4gcG9vbCB3YXMgY3JlYXRlZFxuIiwgMCwgMCwgMCwgMCwgMCwgMCk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICB9CisKK30KKworLyoKKyAqIEZ1bmN0aW9uIGRlZmluaXRpb246IGl4T3NhbEJ1ZmZQb29sVW5pbml0CisgKi8KK1BVQkxJQyBJWF9TVEFUVVMKK2l4T3NhbEJ1ZmZQb29sVW5pbml0IChJWF9PU0FMX01CVUZfUE9PTCAqIHBvb2wpCit7CisgICAgaWYgKCFwb29sKQorICAgIHsKKyAgICAgICAgaXhPc2FsTG9nIChJWF9PU0FMX0xPR19MVkxfRVJST1IsIElYX09TQUxfTE9HX0RFVl9TVERPVVQsCisgICAgICAgICAgICAiaXhPc2FsQnVmZlBvb2xVbmluaXQ6IE5VTEwgcHRyIFxuIiwgMCwgMCwgMCwgMCwgMCwgMCk7CisgICAgICAgIHJldHVybiBJWF9GQUlMOworICAgIH0KKworICAgIGlmIChwb29sLT5mcmVlQnVmc0luUG9vbCAhPSBwb29sLT50b3RhbEJ1ZnNJblBvb2wpCisgICAgeworICAgICAgICBpeE9zYWx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ZpeE9zYWxHbG9iYWxNZW1vcnlNYXBbbWFwSW5kZXhdOworCisgICAgICAgIGlmIChzZWFyY2hDcml0ZXJpYSA9PSBTRUFSQ0hfUEhZU0lDQUxfQUREUkVTUworICAgICAgICAgICAgJiYgcmVxdWVzdGVkQWRkcmVzcyA+PSBtYXAtPnBoeXNpY2FsQWRkcmVzcworICAgICAgICAgICAgJiYgKHJlcXVlc3RlZEFkZHJlc3MgKyBzaXplKSA8PSAobWFwLT5waHlzaWNhbEFkZHJlc3MgKyBtYXAtPnNpemUpCisgICAgICAgICAgICAmJiAobWFwLT5tYXBFbmRpYW5UeXBlICYgcmVxdWVzdGVkRW5kaWFuVHlwZSkgIT0gMCkKKyAgICAgICAgeworICAgICAgICAgICAgcmV0dXJuIG1hcDsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChzZWFyY2hDcml0ZXJpYSA9PSBTRUFSQ0hfVklSVFVBTF9BRERSRVNTCisgICAgICAgICAgICAmJiByZXF1ZXN0ZWRBZGRyZXNzID49IG1hcC0+dmlydHVhbEFkZHJlc3MKKyAgICAgICAgICAgICYmIHJlcXVlc3RlZEFkZHJlc3MgPD0gKG1hcC0+dmlydHVhbEFkZHJlc3MgKyBtYXAtPnNpemUpCisgICAgICAgICAgICAmJiAobWFwLT5tYXBFbmRpYW5UeXBlICYgcmVxdWVzdGVkRW5kaWFuVHlwZSkgIT0gMCkKKyAgICAgICAgeworICAgICAgICAgICAgcmV0dXJuIG1hcDsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChzZWFyY2hDcml0ZXJpYSA9PSBTRUFSQ0hfUEhZU0lDQUxfQUREUkVTUykKKyAgICAgICAgeworICAgICAgICAgICAgaXhPc2FsTG9nIChJWF9PU0FMX0xPR19MVkxfREVCVUczLAorICAgICAgICAgICAgICAgIElYX09TQUxfTE9HX0RFVl9TVERPVVQsCisgICAgICAgICAgICAgICAgIk9zYWw6IENoZWNraW5nIFtwaHlzIGFkZHIgMHgleDpzaXplID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ZWRFbmRpYW5UeXBlKTsKKyAgICBpZiAobWFwICE9IE5VTEwpCisgICAgeworICAgICAgICBVSU5UMzIgb2Zmc2V0ID0gcmVxdWVzdGVkQWRkcmVzcyAtIG1hcC0+cGh5c2ljYWxBZGRyZXNzOworCisgICAgICAgIGl4T3NhbExvZyAoSVhfT1NBTF9MT0dfTFZMX0RFQlVHMywKKyAgICAgICAgICAgIElYX09TQUxfTE9HX0RFVl9TVERPVVQsICJPU0FMOiBGb3VuZCBtYXAgWyIsIDAsIDAsIDAsIDAsIDAsIDApOworICAgICAgICBpeE9zYWxMb2cgKElYX09TQUxfTE9HX0xWTF9ERUJVRzMsCisgICAgICAgICAgICBJWF9PU0FMX0xPR19ERVZfU1RET1VULCBtYXAtPm5hbWUsIDAsIDAsIDAsIDAsIDAsIDApOworICAgICAgICBpeE9zYWxMb2cgKElYX09TQUxfTE9HX0xWTF9ERUJVRzMsCisgICAgICAgICAgICBJWF9PU0FMX0xPR19ERVZfU1RET1VULAorICAgICAgICAgICAgIjphZGRyIDB4JXg6IHZpcnQgMHgleDpzaXplIDB4JXg6cmVmICVkOmVuZGlhblR5cGUgJWRdXG4iLAorICAgICAgICAgICAgbWFwLT5waHlzaWNhbEFkZHJlc3MsIG1hcC0+dmlydHVhbEFkZHJlc3MsCisgICAgICAgICAgICBtYXAtPnNpemUsIG1hcC0+cmVmQ291bnQsIG1hcC0+bWFwRW5kaWFuVHlwZSwgMCk7CisKKyAgICAgICAgaWYgKG1hcC0+dHlwZSA9PSBJWF9PU0FMX0RZTkFNSUNfTUFQICYmIG1hcC0+dmlydHVhbEFkZHJlc3MgPT0gMCkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKG1hcC0+bWFwRnVuY3Rpb24gIT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBtYXAtPm1hcEZ1bmN0aW9uIChtYXApOworCisgICAgICAgICAgICAgICAgaWYgKG1hcC0+dmlydHVhbEFkZHJlc3MgPT0gMCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICAgICAqIGZhaWxlZCAKKyAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgIGl4T3NhbExvZyAoSVhfT1NBTF9MT0dfTFZMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAgICAgICAgSVhfT1NBTF9MT0dfREVWX1NUREVSUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICJPU0FMOiBSZW1hcCBmYWlsZWQgLSBbYWRkciAweCV4OnNpemUgMHgleDplbmRpYW5UeXBlICVkXVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVlc3RlZEFkZHJlc3MsIHNpemUsIHJlcXVlc3RlZEVuZGlhblR5cGUsIDAsIDAsIDApOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gTlVMTDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgKiBlcnJvciwgbm8gbWFwIGZ1bmN0aW9uIGZvciBhIGR5bmFtaWMgbWFwIAorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGl4T3NhbExvZyAoSVhfT1NBTF9MT0dfTFZMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAgICBJWF9PU0FMX0xPR19ERVZfU1RERVJSLAorICAgICAgICAgICAgICAgICAgICAiT1NBTDogTm8gbWFwIGZ1bmN0aW9uIGZvciBhIGR5bmFtaWMgbWFwIC0gIgorICAgICAgICAgICAgICAgICAgICAiW2FkZHIgMHgleDpzaXplIDB4JXg6ZW5kaWFuVHlwZSAlZF1cbiIsCisgICAgICAgICAgICAgICAgICAgIHJlcXVlc3RlZEFkZHJlc3MsIHNpemUsIHJlcXVlc3RlZEVuZGlhblR5cGUsIDAsIDAsIDApOworCisgICAgICAgICAgICAgICAgcm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ZXMgbm90CisgKiByZXR1cm4gYSB2YWx1ZS4KKyAqCisgKiBOb3RlOiB0aGlzIGZ1bmN0aW9uIGlzIG5vdCB0byBiZSB1c2VkIGRpcmVjdGx5LiBVc2UgSVhfT1NBTF9NRU1fVU5NQVAKKyAqIGluc3RlYWQuCisgKi8KK1BVQkxJQyB2b2lkCitpeE9zYWxJb01lbVVubWFwIChVSU5UMzIgcmVxdWVzdGVkQWRkcmVzcywgVUlOVDMyIGVuZGlhblR5cGUpCit7CisgICAgSXhPc2FsTWVtb3J5TWFwICptYXA7CisKKyAgICBpZiAoZW5kaWFuVHlwZSA9PSBJWF9PU0FMX0xFKQorICAgIHsKKyAgICAgICAgaXhPc2FsTG9nIChJWF9PU0FMX0xPR19MVkxfRVJST1IsCisgICAgICAgICAgICBJWF9PU0FMX0xPR19ERVZfU1RET1VULAorICAgICAgICAgICAgIml4T3NhbElvTWVtVW5tYXA6IFBsZWFzZSBzcGVjaWZ5IGNvbXBvbmVudCBjb2hlcmVuY3kgbW9kZSB0byB1c2UgTUVNIGZ1bmN0aW9ucyBcbiIsCisgICAgICAgICAgICAwLCAwLCAwLCAwLCAwLCAwKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGlmIChyZXF1ZXN0ZWRBZGRyZXNzID09IDApCisgICAgeworICAgICAgICAvKgorICAgICAgICAgKiBpbnZhbGlkIHZpcnR1YWwgYWRkcmVzcyAKKyAgICAgICAgICovCisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBtYXAgPQorICAgICAgICBpeE9zYWxNZW1NYXBGaW5kIChyZXF1ZXN0ZWRBZGRyZXNzLCAwLCBTRUFSQ0hfVklSVFVBTF9BRERSRVNTLAorICAgICAgICBlbmRpYW5UeXBlKTsKKworICAgIGlmIChtYXAgIT0gTlVMTCkKKyAgICB7CisgICAgICAgIGlmIChtYXAtPnJlZkNvdW50ID4gMCkKKyAgICAgICAgeworICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAqIGRlY3JlbWVudCByZWZlcmVuY2UgY291bnQgCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIG1hcC0+cmVmQ291bnQtLTsKKworICAgICAgICAgICAgaWYgKG1hcC0+cmVmQ291bnQgPT0gMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAqIG5vIGxvbmdlciB1c2VkLCBkZWFsbG9jYXRlIAorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGlmIChtYXAtPnR5cGUgPT0gSVhfT1NBTF9EWU5BTUlDX01BUAorICAgICAgICAgICAgICAgICAgICAmJiBtYXAtPnVubWFwRnVuY3Rpb24gIT0gTlVMTCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIG1hcC0+dW5tYXBGdW5jdGlvbiAobWFwKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgaXhPc2FsTG9nIChJWF9PU0FMX0xPR19MVkxfV0FSTklORywKKyAgICAgICAgICAgIElYX09TQUxfTE9HX0RFVl9TVERFUlIsCisgICAgICAgICAgICAiT1NBTDogaXhPc1NlcnZNZW1Vbm1hcCBkaWRuJ3QgZmluZCB0aGUgcmVxdWVzdGVkIG1hcCAiCisgICAgICAgICAgICAiW3ZpcnQgYWRkciAweCV4OiBlbmRpYW5UeXBlICVkXSwgaWdub3JpbmcgY2FsbFxuIiwKKyAgICAgICAgICAgIHJlcXVlc3RlZEFkZHJlc3MsIGVuZGlhblR5cGUsIDAsIDAsIDAsIDApOworICAgIH0KK30KKworLyogCisgKiBUaGlzIGZ1bmN0aW9uIENvbnZlcnRzIGEgdmlydHVhbCBhZGRyZXNzIGludG8gYSBwaHlzaWNhbCAKKyAqIGFkZHJlc3MsIGluY2x1ZGluZyB0aGUgZHluYW1pY2FsbHkgbWFwcGVkIG1lbW9yeS4KKyAqIAorICogUGF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AgICB7CisgICAgICAgIC8qCisgICAgICAgICAqIFJldHVybiBlcnJvcgorICAgICAgICAgKi8KKyAgICAgICAgcmV0dXJuIChJWF9PU0FMX0xPR19FUlJPUik7CisgICAgfQorfQorCitQVUJMSUMgVUlOVDMyCitpeE9zYWxMb2dMZXZlbFNldCAoVUlOVDMyIGxldmVsKQoreworICAgIFVJTlQzMiBvbGRMZXZlbDsKKworICAgIC8qCisgICAgICogQ2hlY2sgdmFsdWUgZmlyc3QKKyAgICAgKi8KKyAgICBpZiAoKGxldmVsIDwgSVhfT1NBTF9MT0dfTFZMX05PTkUpIHx8IChsZXZlbCA+IElYX09TQUxfTE9HX0xWTF9BTEwpKQorICAgIHsKKyAgICAgICAgaXhPc2FsTG9nIChJWF9PU0FMX0xPR19MVkxfTUVTU0FHRSwKKyAgICAgICAgICAgIElYX09TQUxfTE9HX0RFVl9TVERPVVQsCisgICAgICAgICAgICAiaXhPc2FsTG9nTGV2ZWxTZXQ6IExvZyBMZXZlbCBpcyBiZXR3ZWVuICVkIGFuZCVkIFxuIiwKKyAgICAgICAgICAgIElYX09TQUxfTE9HX0xWTF9OT05FLCBJWF9PU0FMX0xPR19MVkxfQUxMLCAwLCAwLCAwLCAwKTsKKyAgICAgICAgcmV0dXJuIElYX09TQUxfTE9HX0xWTF9OT05FOworICAgIH0KKyAgICBvbGRMZXZlbCA9IGl4T3NhbEN1cnJMb2dMZXZlbDsKKworICAgIGl4T3NhbEN1cnJMb2dMZXZlbCA9IGxldmVsOworCisgICAgcmV0dXJuIG9sZExldmVsOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIFRhc2sgc2VydmljZXMKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitQVUJMSUMgdm9pZAoraXhPc2FsQnVzeVNsZWVwIChVSU5UMzIgbWljcm9zZWNvbmRzKQoreworCXVkZWxheShtaWNyb3NlY29uZHMpOworfQorCitQVUJMSUMgdm9pZAo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NPTkZJR19ORl9PRkZTRVQgICAgICAgICAgMHgxRAorCisjZGVmaW5lIElYX1FNR1JfQkFTRV9BRERSXzE2X1dPUkRfQUxJR04gICAgIDB4NDAKKyNkZWZpbmUgSVhfUU1HUl9CQVNFX0FERFJfMTZfV09SRF9TSElGVCAgICAgMHg2CisKKyNkZWZpbmUgSVhfUU1HUl9ORV9ORl9DTEVBUl9NQVNLICAgICAgICAgICAgMHgwM0ZGRkZGRgorI2RlZmluZSBJWF9RTUdSX05FX01BU0sgICAgICAgICAgICAgICAgICAgICAweDcKKyNkZWZpbmUgSVhfUU1HUl9ORl9NQVNLICAgICAgICAgICAgICAgICAgICAgMHg3CisjZGVmaW5lIElYX1FNR1JfU0laRV9NQVNLICAgICAgICAgICAgICAgICAgIDB4MworI2RlZmluZSBJWF9RTUdSX0VOVFJZX1NJWkVfTUFTSyAgICAgICAgICAgICAweDMKKyNkZWZpbmUgSVhfUU1HUl9CQUREUl9NQVNLICAgICAgICAgICAgICAgICAgMHgwMDNGQzAwMAorI2RlZmluZSBJWF9RTUdSX1JEUFRSX01BU0sgICAgICAgICAgICAgICAgICAweDdGCisjZGVmaW5lIElYX1FNR1JfV1JQVFJfTUFTSyAgICAgICAgICAgICAgICAgIDB4N0YKKyNkZWZpbmUgSVhfUU1HUl9SRFdSUFRSX01BU0sgICAgICAgICAgICAgICAgMHgwMDAwM0ZGRgorCisjZGVmaW5lIElYX1FNR1JfQVFNX0FERFJFU1NfU1BBQ0VfU0laRV9JTl9XT1JEUyAweDEwMDAKKworLyogQmFzZSBhZGRyZXNzIG9mIEFRTSBTUkFNICovCisjZGVmaW5lIElYX1FNR1JfQVFNX1NSQU1fQkFTRV9BRERSRVNTX09GRlNFVCBcCisoKElYX1FNR1JfUVVFQ09ORklHX0JBU0VfT0ZGU0VUKSArIChJWF9RTUdSX1FVRUNPTkZJR19TSVpFKSkKKworLyogTWluIGJ1ZmZlciBzaXplIHVzZWQgZm9yIGdlbmVyYXRpbmcgYnVmZmVy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5IHNpemUgaW4gd29yZHMgKi8KKyAgICBxRW50cnlTaXplSW53b3JkcyA9IGl4UU1nclFFbnRyeVNpemVJbldvcmRzR2V0IChxSWQpOworCisgICAgLyogR2V0IHRoZSBxdWV1ZSBzaXplIGluIHdvcmRzICovCisgICAgcVNpemVJbldvcmRzID0gaXhRTWdyUVNpemVJbldvcmRzR2V0IChxSWQpOworCisgICAgLyogUmVhZCB0aGUgY29uZmlnIHJlZ2lzdGVyICovCisgICAgaXhRTWdyQXFtSWZXb3JkUmVhZCAoY2ZnUmVnQWRkcmVzcywgJmNvbmZpZ1JlZ1dvcmRPbkVudHJ5KTsKKworICAgIC8qIEdldCB0aGUgZW50cnkgYWRkcmVzcyAqLworICAgIGl4UU1nckFxbUlmRW50cnlBZGRyZXNzR2V0IChlbnRyeUluZGV4LAorCQkJCWNvbmZpZ1JlZ1dvcmRPbkVudHJ5LAorCQkJCXFFbnRyeVNpemVJbndvcmRzLAorCQkJCXFTaXplSW5Xb3JkcywKKwkJCQkmZW50cnlBZGRyZXNzKTsKKworICAgIC8qIEdldCB0aGUgbG9jayBvciByZXR1cm4gYnVzeSAqLworICAgIGlmIChJWF9TVUNDRVNTICE9IGl4T3NhbEZhc3RNdXRleFRyeUxvY2soJml4UU1nckFxbUlmUGVla1Bva2VGYXN0TXV0ZXhbcUlkXSkpCisgICAgeworCXJldHVybiBJWF9GQUlMOworICAgIH0KKworICAgIHdoaWxlKHFFbnRyeVNpemVJbndvcmRzLS0pCisgICAgeworCWl4UU1nckFxbUlmV29yZFJlYWQgKGVudHJ5QWRkcmVzcysrLCBlbnRyeSsrKTsKKyAgICB9CisKKyAgICAvKiBSZWxlYXNlIHRoZSBsb2NrICovCisgICAgaXhPc2FsRmFzdE11dGV4VW5sb2NrKCZpeFFNZ3JBcW1JZlBlZWtQb2tlRmFzdE11dGV4W3FJZF0pOworCisgICAgLyogUmVhZCB0aGUgY29uZmlnIHJlZ2lzdGVyICovCisgICAgaXhRTWdyQXFtSWZXb3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yAgICAgICAgIHN0aWNreUludFNpbGljb24pICAKKyAgICB7CisgICAgICAgIGl4UU1nclN0aWNreUludGVycnVwdFJlZ0VuYWJsZSgpOworICAgIH0KK30KKworSVhfU1RBVFVTCitpeFFNZ3JEaXNwYXRjaGVyUHJpb3JpdHlTZXQgKEl4UU1nclFJZCBxSWQsCisJCQkgICAgIEl4UU1nclByaW9yaXR5IHByaW9yaXR5KQoreyAgIAorICAgIGludCBpeFFNZ3JMb2NrS2V5OworCisgICAgaWYgKCFpeFFNZ3JRSXNDb25maWd1cmVkKHFJZCkpCisgICAgeworCXJldHVybiBJWF9RTUdSX1FfTk9UX0NPTkZJR1VSRUQ7CisgICAgfQorICAgIAorICAgIGlmICghSVhfUU1HUl9ESVNQQVRDSEVSX1BSSU9SSVRZX0NIRUNLKHByaW9yaXR5KSkKKyAgICB7CisJcmV0dXJuIElYX1FNR1JfUV9JTlZBTElEX1BSSU9SSVRZOworICAgIH0KKworICAgIGl4UU1nckxvY2tLZXkgPSBpeE9zYWxJcnFMb2NrKCk7CisgICAgCisgICAgLyogQ2hhbmdlIHByaW9yaXR5ICovCisgICAgZGlzcGF0Y2hRSW5mb1txSWRdLnByaW9yaXR5ID0gcHJpb3JpdHk7CisgICAgLyogU2V0IGZsYWcgKi8KKyAgICByZWJ1aWxkVGFibGUgPSBUUlVFOworCisgICAgaXhPc2FsSXJxVW5sb2NrKGl4UU1nckxvY2tLZXkpOworCisjaWZuZGVmIE5ERUJVRworICAgIC8qIFVwZGF0ZSBzdGF0aXN0aWNzICovCisgICAgZGlzcGF0Y2hlclN0YXRzLnF1ZXVlU3RhdHNbcUlkXS5wcmlvcml0eUNoYW5nZUNudCsrOworI2VuZGlmCisKKyAgICByZXR1cm4gSVhfU1VDQ0VTUzsKK30KKworSVhfU1RBVFVTCitpeFFNZ3JOb3RpZmljYXRpb25DYWxsYmFja1NldCAoSXhRTWdyUUlkIHFJZCwKKwkJCSAgICAgICBJeFFNZ3JDYWxsYmFjayBjYWxsY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ludFJlZ1ZhbEFmdGVyV3JpdGUgLi4uICovCisgICAgfSAvKiBmb3IgKHByaW9yaXR5VGFibGVJbmRleD0wIC4uLiAqLworICAgIH0KKworICAgIC8qIFJlYnVpbGQgdGhlIHByaW9yaXR5IHRhYmxlIGlmIG5lZWRlZCAqLworICAgIGlmIChyZWJ1aWxkVGFibGUpCisgICAgeworCWl4UU1nckRpc3BhdGNoZXJSZUJ1aWxkUHJpb3JpdHlUYWJsZSAoKTsKKyAgICB9CisKKyNpZm5kZWYgTkRFQlVHCisgICAgLyogVXBkYXRlIHN0YXRpc3RpY3MgKi8KKyAgICBkaXNwYXRjaGVyU3RhdHMubG9vcFJ1bkNudCsrOworI2VuZGlmCit9CisKKworCit2b2lkCitpeFFNZ3JEaXNwYXRjaGVyTG9vcFJ1bkIwIChJeFFNZ3JEaXNwYXRjaEdyb3VwIGdyb3VwKQoreworICAgIFVJTlQzMiBpbnRSZWdWYWw7ICAgICAgICAgICAgICAgIC8qIEludGVycnVwdCByZWcgdmFsICovCisgICAgVUlOVDMyIGludFJlZ0NoZWNrTWFzazsgICAgICAgICAgLyogTWFzayBmb3IgY2hlY2tpbmcgaW50ZXJydXB0IGJpdHMgKi8KKyAgICBJeFFNZ3JRSW5mbyAqY3VyckRpc3BhdGNoUUluZm87CisKKworICAgIGludCBwcmlvcml0eVRhYmxlSW5kZXg7IC8qIFByaW9yaXR5IHRhYmxlIGluZGV4ICovCisgICAgaW50IHFJbmRleDsgICAgICAgICAgICAgLyogQ3VycmVudCBxdWV1ZSBiZWluZyBwcm9jZXNzZWQgKi8KKworI2lmbmRlZiBOREVCVUcKKyAgICBJWF9PU0FMX0FTU0VSVCgoZ3JvdXAgPT0gSVhfUU1HUl9RVUVVUFBfR1JPVVApIHx8CisgICAgICAgICAgICAgIChncm91cCA9PSBJWF9RTUdSX1FVRUxPV19HUk9VUCkpOworICAgIElYX09TQUxfQVNTRVJUKChncm91cCA9PSBJWF9RTUdSX1FVRVVQUF9HUk9VUCkgfHwgCisJICAgICAgKGdyb3VwID09IElYX1FNR1JfUVVFTE9XX0dST1VQKSk7CisjZW5kaWYKKworICAgIC8qIFJlYWQgdGhlIGludGVycnVwdCByZWdpc3RlciAqLworICAgIGl4UU1nckFxbUlmUUludGVycnVwdFJlZ1JlYWQgKGdyb3VwLCAmaW50UmVnVmFsKTsKKworCisgICAgLyogTm8gcXVldWUgaGFzIGludGVycnVwdCByZWdpc3RlciBzZXQgKi8KKyAgICBpZiAoaW50UmVnVmFsICE9IDApCisgICAgeworCisgICAgICAgICAgICAvKiBXcml0ZSBpdCBiYWNrIHRvIGNsZWFyIHRoZSBpbnRlcnJ1cHQgKi8KKyAgICAgICAgICAgIGl4UU1nckFxbUlmUUludGVycnVwdFJlZ1dyaXRlIChncm91cCwgaW50UmVnVmFsKTsKKworICAgICAgICAgICAgLyogZ2V0IHRoZSBmaXJzdCBxdWV1ZSBJZCBmcm9tIHRoZSBpbnRlcnJ1cHQgcmVnaXN0ZXIgdmFsdWUgKi8KKyAgICAgICAgICAgIHFJbmRleCA9IChCSVRTX1BFUl9XT1JEIC0gMSkgLSBpeFFNZ3JDb3VudExlYWRpbmdaZXJvcyhpbnRSZWdWYWwpOworCisgICAgICAgICAgICBpZiAoSVhfUU1HUl9RVUVVUFBfR1JPVVAgPT0gZ3JvdXApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogU2V0IHRoZSBxdWV1ZSByYW5nZSBiYXNlZCBvbiB0aGUgcXVldWUgZ3JvdXAgdG8gcHJvY2Nlc3MgKi8KKyAgICAgICAgICAgICAgICBxSW5kZXggKz0gSVhfUU1HUl9NSU5fUVVFVVBQX1FJRDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLyogY2hlY2sgaWYgdGhlIGludGVycnVwdCByZWdpc3RlciBjb250YWlucworICAgICAgICAgICAgICogb25seSAxIGJpdCBzZXQKKyAgICAgICAgICAgICAqIEZvciBleGFtcGxlOgorICAgICAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50UmVnVmFsID0gMHgwMDEwCisgICAgICAgICAgICAgKiAgICAgICAgICAgICAgIGN1cnJEaXNwYXRjaFFJbmZvLT5pbnRSZWdDaGVja01hc2sgPSAweDAwMTAKKyAgICAgICAgICAgICAqICAgIGludFJlZ1ZhbCA9PSBjdXJyRGlzcGF0Y2hRSW5mby0+aW50UmVnQ2hlY2tNYXNrIGlzIFRSVUUuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICBjdXJyRGlzcGF0Y2hRSW5mbyA9ICZkaXNwYXRjaFFJbmZvW3FJbmRleF07CisgICAgICAgICAgICAgaWYgKGludFJlZ1ZhbCA9PSBjdXJyRGlzcGF0Y2hRSW5mby0+aW50UmVnQ2hlY2tNYXNrKQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBvbmx5IDEgcXVldWUgZXZlbnQgdHJpZ2dlcmVkIGEgbm90aWZpY2F0aW9uICoKKyAgICAgICAgICAgICAgICAgKiBDYWxsIHRoZSBjYWxsYmFjayBmdW5jdGlvbiBmb3IgdGhpcyBxdWV1ZQorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGN1cnJEaXNwYXRjaFFJbmZvLT5jYWxsYmFjayAocUluZGV4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJEaXNwYXRjaFFJbmZvLT5jYWxsYmFja0lkKTsKKyNpZm5kZWYgTkRFQlVHCisgICAgICAgICAgICAgICAgLyogVXBkYXRlIHN0YXRpc3RpY3MgKi8KKyAgICAgICAgICAgICAgICBkaXNwYXRjaGVyU3RhdHMucXVldWVTdGF0c1txSW5kZXhdLmNhbGxiYWNrQ250Kys7CisjZW5kaWYKKyAgICAgICAgICAgICB9CisgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgLyogdGhlIGV2ZW50IGlzIHRyaWdnZXJlZCBieSBtb3JlIHRoYW4gMSBxdWV1ZSwKKyAgICAgICAgICAgICAgICAgICogdGhlIHF1ZXVlIHNlYXJjaCB3aWxsIGJlIHN0YXJ0aW5nIGZyb20gdGhlIGJlZ2lubmluZworICAgICAgICAgICAgICAgICAgKiBvciB0aGUgbWlkZGxlIG9mIHRoZSBwcmlvcml0eSB0YWJsZQorICAgICAgICAgICAgICAgICAgKgorICAgICAgICAgICAgICAgICAgKiB0aGUgc2VyYWNoIHdpbGwgZW5kIHdoZW4gYWxsIHRoZSBiaXRzIG9mIHRoZSBpbnRlcnJ1cHQKKyAgICAgICAgICAgICAgICAgICogcmVnaXN0ZXIgYXJlIGNsZWFyZWQuIFRoZXJlIGlzIG5vIG5lZWQgdG8gbWFpbnRhaW4KKyAgICAgICAgICAgICAgICAgICogYSBzZXBlcmF0ZSB2YWx1ZSBhbmQgdGVzdCBpdCBhdCBlYWNoIGl0ZXJhdGlvbi4KKyAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgIGlmIChJWF9RTUdSX1FVRUxPV19HUk9VUCA9PSBncm91cCkKKyAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgLyogY2hlY2sgaWYgYW55IGJpdCByZWxhdGVkIHRvIHF1ZXVlcyBpbiB0aGUgZmlyc3QKKyAgICAgICAgICAgICAgICAgICAgICAqIGhhbGYgb2YgdGhlIHByaW9yaXR5IHRhYmxlIGlzIHNldAorICAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgICBpZiAoaW50UmVnVmFsICYgbG93UHJpb3JpdHlUYWJsZUZpcnN0SGFsZk1hc2spCisgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgcHJpb3JpdHlUYWJsZUluZGV4ID0gSVhfUU1HUl9NSU5fTE9XX1FVRV9QUklPUklUWV9UQUJMRV9JTkRFWDsKKyAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICBwcmlvcml0eVRhYmxlSW5kZXggPSBJWF9RTUdSX01JRF9MT1dfUVVFX1BSSU9SSVRZX1RBQkxFX0lOREVYOworICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAvKiBjaGVjayBpZiBhbnkgYml0IHJlbGF0ZWQgdG8gcXVldWVzIGluIHRoZSBmaXJzdAorICAgICAgICAgICAgICAgICAgICAgICogaGFsZiBvZiB0aGUgcHJpb3JpdHkgdGFibGUgaXMgc2V0CisgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgIGlmIChpbnRSZWdWYWwgJiB1cHBQcmlvcml0eVRhYmxlRmlyc3RIYWxmTWFzaykKKyAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICBwcmlvcml0eVRhYmxlSW5kZXggPSBJWF9RTUdSX01JTl9VUFBfUVVFX1BSSU9SSVRZX1RBQkxFX0lOREVYOworICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgIHByaW9yaXR5VGFibGVJbmRleCA9IElYX1FNR1JfTUlEX1VQUF9RVUVfUFJJT1JJVFlfVEFCTEVfSU5ERVg7CisgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAvKiBpdGVyYXRlIGZvbGxvd2luZyB0aGUgcHJpb3JpdHkgdGFibGUgdW50aWwgYWxsIHRoZSBiaXRzCisgICAgICAgICAgICAgICAgICAqIG9mIHRoZSBpbnRlcnJ1cHQgcmVnaXN0ZXIgYXJlIGNsZWFyZWQuCisgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICBkbworICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICBxSW5kZXggPSBwcmlvcml0eVRhYmxlW3ByaW9yaXR5VGFibGVJbmRleCsrXTsKKyAgICAgICAgICAgICAgICAgICAgIGN1cnJEaXNwYXRjaFFJbmZvID0gJmRpc3BhdGNoUUluZm9bcUluZGV4XTsKKyAgICAgICAgICAgICAgICAgICAgIGludFJlZ0NoZWNrTWFzayA9IGN1cnJEaXNwYXRjaFFJbmZvLT5pbnRSZWdDaGVja01hc2s7CisKKyAgICAgICAgICAgICAgICAgICAgIC8qIElmIHRoaXMgcXVldWUgY2F1c2VkIHRoaXMgaW50ZXJydXB0IHRvIGJlIHJhaXNlZCAqLworICAgICAgICAgICAgICAgICAgICAgaWYgKGludFJlZ1ZhbCAmIGludFJlZ0NoZWNrTWFzaykKKyAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAvKiBDYWxsIHRoZSBjYWxsYmFjayBmdW5jdGlvbiBmb3IgdGhpcyBxdWV1ZSAqLworICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJEaXNwYXRjaFFJbmZvLT5jYWxsYmFjayAocUluZGV4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJEaXNwYXRjaFFJbmZvLT5jYWxsYmFja0lkKTsKKyNpZm5kZWYgTkRFQlVHCisgICAgICAgICAgICAgICAgICAgICAgICAgLyogVXBkYXRlIHN0YXRpc3RpY3MgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICBkaXNwYXRjaGVyU3RhdHMucXVldWVTdGF0c1txSW5kZXhdLmNhbGxiYWNrQ250Kys7CisjZW5kaWYKKworICAgICAgICAgICAgICAgICAgICAgICAgIC8qIENsZWFyIHRoZSBpbnRlcnJ1cHQgcmVnaXN0ZXIgYml0ICovCisgICAgICAgICAgICAgICAgICAgICAgICAgaW50UmVnVmFsICY9IH5pbnRSZWdDaGVja01hc2s7CisgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICB3aGlsZShpbnRSZWdWYWwpOworICAgICAgICAgICAgIH0gLypFbmQgb2YgaW50UmVnVmFsID09IGN1cnJEaXNwYXRjaFFJbmZvLT5pbnRSZWdDaGVja01hc2sgKi8KKyAgICAgfSAvKiBFbmQgb2YgaW50UmVnVmFsICE9IDAgKi8KKworI2lmbmRlZiBOREVCVUcKKyAgICAvKiBVcGRhdGUgc3RhdGlzdGljcyAqLworICAgIGRpc3BhdGNoZXJTdGF0cy5sb29wUnVuQ250Kys7CisjZW5kaWYKKworICAgIC8qIFJlYnVpbGQgdGhlIHByaW9yaXR5IHRhYmxlIGlmIG5lZWRlZCAqLworICAgIGlmIChyZWJ1aWxkVGFibGUpCisgICAgeworICAgICAgICBpeFFNZ3JEaXNwYXRjaGVyUmVCdWlsZFByaW9yaXR5VGFibGUgKCk7CisgICAgfQorfQorCit2b2lkCitpeFFNZ3JEaXNwYXRjaGVyTG9vcFJ1bkIwTExQIChJeFFNZ3JEaXNwYXRjaEdyb3VwIGdyb3VwKQoreworICAgIFVJTlQzMiBpbnRSZWdWYWwgPTA7ICAgICAgICAgICAgICAgIC8qIEludGVycnVwdCByZWcgdmFsICovCisgICAgVUlOVDMyIGludFJlZ0NoZWNrTWFzazsgICAgICAgICAgLyogTWFzayBmb3IgY2hlY2tpbmcgaW50ZXJydXB0IGJpdHMgKi8KKyAgICBJeFFNZ3JRSW5mbyAqY3VyckRpc3BhdGNoUUluZm87CisKKyAgICBpbnQgcHJpb3JpdHlUYWJsZUluZGV4OyAvKiBQcmlvcml0eSB0YWJsZSBpbmRleCAqLworICAgIGludCBxSW5kZXg7ICAgICAgICAgICAgIC8qIEN1cnJlbnQgcXVldWUgYmVpbmcgcHJvY2Vzc2VkICovCisKKyAgICBVSU5UMzIgaW50UmVnVmFsQ29weSA9IDA7CisgICAgVUlOVDMyIGludE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uIGhhcyBiZWVuIGNsZWFyZWQKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgaW50UmVnVmFsQ29weSA9IGludFJlZ1ZhbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIG5vIHN0aWNreSBmb3IgdXBwZXIgUSdzLCBzbyB3cml0ZSBiYWNrIG5vdyAqLworICAgICAgICAgICAgaXhRTWdyQXFtSWZRSW50ZXJydXB0UmVnV3JpdGUgKGdyb3VwLCBpbnRSZWdWYWwpOworICAgICAgICB9CisKKyAgICAgICAgLyogZ2V0IHRoZSBmaXJzdCBxdWV1ZSBJZCBmcm9tIHRoZSBpbnRlcnJ1cHQgcmVnaXN0ZXIgdmFsdWUgKi8KKyAgICAgICAgcUluZGV4ID0gKEJJVFNfUEVSX1dPUkQgLSAxKSAtIGl4UU1nckNvdW50TGVhZGluZ1plcm9zKGludFJlZ1ZhbCk7CisKKyAgICAgICAgaWYgKElYX1FNR1JfUVVFVVBQX0dST1VQID09IGdyb3VwKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBTZXQgdGhlIHF1ZXVlIHJhbmdlIGJhc2VkIG9uIHRoZSBxdWV1ZSBncm91cCB0byBwcm9jY2VzcyAqLworICAgICAgICAgICAgcUluZGV4ICs9IElYX1FNR1JfTUlOX1FVRVVQUF9RSUQ7CisgICAgICAgIH0KKworICAgICAgICAvKiBjaGVjayBpZiB0aGUgaW50ZXJydXB0IHJlZ2lzdGVyIGNvbnRhaW5zCisgICAgICAgICogb25seSAxIGJpdCBzZXQKKyAgICAgICAgKiBGb3IgZXhhbXBsZToKKyAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRSZWdWYWwgPSAweDAwMTAKKyAgICAgICAgKiAgICAgICAgICAgICAgIGN1cnJEaXNwYXRjaFFJbmZvLT5pbnRSZWdDaGVja01hc2sgPSAweDAwMTAKKyAgICAgICAgKiAgICBpbnRSZWdWYWwgPT0gY3VyckRpc3BhdGNoUUluZm8tPmludFJlZ0NoZWNrTWFzayBpcyBUUlVFLgorICAgICAgICAqLworICAgICAgICBjdXJyRGlzcGF0Y2hRSW5mbyA9ICZkaXNwYXRjaFFJbmZvW3FJbmRleF07CisgICAgICAgIGlmIChpbnRSZWdWYWwgPT0gY3VyckRpc3BhdGNoUUluZm8tPmludFJlZ0NoZWNrTWFzaykKKyAgICAgICAgeworCisgICAgICAgICAgICAvKiAKKyAgICAgICAgICAgICAqIGNoZWNrIGlmIFEgdHlwZSBwZXJpb2RpYyAtICBvbmx5IGxvd2VyIHF1ZXVlcyBjYW4KKyAgICAgICAgICAgICAqIGhhdmUgdGhlcmUgdHlwZSBzZXQgdG8gcGVyaW9kaWMgCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGlmIChJWF9RTUdSX1RZUEVfUkVBTFRJTUVfUEVSSU9ESUMgPT0gaXhRTWdyUVR5cGVzW3FJbmRleF0pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogCisgICAgICAgICAgICAgICAgICogRGlzYWJsZSB0aGUgbm90aWZpY2F0aW9ucyBvbiBhbnkgc3BvcmFkaWNzIAorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGZvciAoaT0wOyBpIDw9IElYX1FNR1JfTUFYX0xPV19RVUVfVEFCTEVfSU5ERVg7IGkrKykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmIChJWF9RTUdSX1RZUEVfUkVBTFRJTUVfU1BPUkFESUMgPT0gaXhRTWdyUVR5cGVzW2ldKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBpeFFNZ3JOb3RpZmljYXRpb25EaXNhYmxlKGkpOworI2lmbmRlZiBOREVCVUcKKyAgICAgICAgICAgICAgICAgICAgICAgIC8qIFVwZGF0ZSBzdGF0aXN0aWNzICovCisgICAgICAgICAgICAgICAgICAgICAgICBkaXNwYXRjaGVyU3RhdHMucXVldWVTdGF0c1tpXS5kaXNhYmxlQ291bnQrKzsKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBjdXJyRGlzcGF0Y2hRSW5mby0+Y2FsbGJhY2sgKHFJbmRleCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VyckRpc3BhdGNoUUluZm8tPmNhbGxiYWNrSWQpOworI2lmbmRlZiBOREVCVUcKKyAgICAgICAgICAgIC8qIFVwZGF0ZSBzdGF0aXN0aWNzICovCisgICAgICAgICAgICBkaXNwYXRjaGVyU3RhdHMucXVldWVTdGF0c1txSW5kZXhdLmNhbGxiYWNrQ250Kys7CisjZW5kaWYKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIHRoZSBldmVudCBpcyB0cmlnZ2VyZWQgYnkgbW9yZSB0aGFuIDEgcXVldWUsCisgICAgICAgICAgICAqIHRoZSBxdWV1ZSBzZWFyY2ggd2lsbCBiZSBzdGFydGluZyBmcm9tIHRoZSBiZWdpbm5pbmcKKyAgICAgICAgICAgICogb3IgdGhlIG1pZGRsZSBvZiB0aGUgcHJpb3JpdHkgdGFibGUKKyAgICAgICAgICAgICoKKyAgICAgICAgICAgICogdGhlIHNlcmFjaCB3aWxsIGVuZCB3aGVuIGFsbCB0aGUgYml0cyBvZiB0aGUgaW50ZXJydXB0CisgICAgICAgICAgICAqIHJlZ2lzdGVyIGFyZSBjbGVhcmVkLiBUaGVyZSBpcyBubyBuZWVkIHRvIG1haW50YWluCisgICAgICAgICAgICAqIGEgc2VwZXJhdGUgdmFsdWUgYW5kIHRlc3QgaXQgYXQgZWFjaCBpdGVyYXRpb24uCisgICAgICAgICAgICAqLworICAgICAgICAgICAgaWYgKElYX1FNR1JfUVVFTE9XX0dST1VQID09IGdyb3VwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIGNoZWNrIGlmIGFueSBiaXQgcmVsYXRlZCB0byBxdWV1ZXMgaW4gdGhlIGZpcnN0CisgICAgICAgICAgICAgICAgICogaGFsZiBvZiB0aGUgcHJpb3JpdHkgdGFibGUgaXMgc2V0CisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgaWYgKGludFJlZ1ZhbCAmIGxvd1ByaW9yaXR5VGFibGVGaXJzdEhhbGZNYXNrKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcHJpb3JpdHlUYWJsZUluZGV4ID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElYX1FNR1JfTUlOX0xPV19RVUVfUFJJT1JJVFlfVEFCTEVfSU5ERVg7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHByaW9yaXR5VGFibGVJbmRleCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJWF9RTUdSX01JRF9MT1dfUVVFX1BSSU9SSVRZX1RBQkxFX0lOREVYOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBjaGVjayBpZiBhbnkgYml0IHJlbGF0ZWQgdG8gcXVldWVzIGluIHRoZSBmaXJzdAorICAgICAgICAgICAgICAgICAqIGhhbGYgb2YgdGhlIHByaW9yaXR5IHRhYmxlIGlzIHNldAorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGlmIChpbnRSZWdWYWwgJiB1cHBQcmlvcml0eVRhYmxlRmlyc3RIYWxmTWFzaykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHByaW9yaXR5VGFibGVJbmRleCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJWF9RTUdSX01JTl9VUFBfUVVFX1BSSU9SSVRZX1RBQkxFX0lOREVYOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwcmlvcml0eVRhYmxlSW5kZXggPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSVhfUU1HUl9NSURfVVBQX1FVRV9QUklPUklUWV9UQUJMRV9JTkRFWDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8qIGl0ZXJhdGUgZm9sbG93aW5nIHRoZSBwcmlvcml0eSB0YWJsZSB1bnRpbCBhbGwgdGhlIGJpdHMKKyAgICAgICAgICAgICAqIG9mIHRoZSBpbnRlcnJ1cHQgcmVnaXN0ZXIgYXJlIGNsZWFyZWQuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGRvCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcUluZGV4ID0gcHJpb3JpdHlUYWJsZVtwcmlvcml0eVRhYmxlSW5kZXgrK107CisgICAgICAgICAgICAgICAgY3VyckRpc3BhdGNoUUluZm8gPSAmZGlzcGF0Y2hRSW5mb1txSW5kZXhdOworICAgICAgICAgICAgICAgIGludFJlZ0NoZWNrTWFzayA9IGN1cnJEaXNwYXRjaFFJbmZvLT5pbnRSZWdDaGVja01hc2s7CisKKyAgICAgICAgICAgICAgICAvKiBJZiB0aGlzIHF1ZXVlIGNhdXNlZCB0aGlzIGludGVycnVwdCB0byBiZSByYWlzZWQgKi8KKyAgICAgICAgICAgICAgICBpZiAoaW50UmVnVmFsICYgaW50UmVnQ2hlY2tNYXNrKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLyogCisgICAgICAgICAgICAgICAgICAgICAqIGNoZWNrIGlmIFEgdHlwZSBwZXJpb2RpYyAtIG9ubHkgbG93ZXIgcXVldWVzIGNhbgorICAgICAgICAgICAgICAgICAgICAgKiBoYXZlIHRoZXJlIHR5cGUgc2V0IHRvIHBlcmlvZGljLiBUaGVyZSBjYW4gb25seSBiZSBvbmUKKyAgICAgICAgICAgICAgICAgICAgICogcGVyaW9kaWMgcXVldWUsIHNvIHRoZSBzcG9yYWRpY3MgYXJlIG9ubHkgZGlzYWJsZWQgb25jZS4KKyAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgIGlmIChJWF9RTUdSX1RZUEVfUkVBTFRJTUVfUEVSSU9ESUMgPT0gaXhRTWdyUVR5cGVzW3FJbmRleF0pCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8qIAorICAgICAgICAgICAgICAgICAgICAgICAgICogRGlzYWJsZSB0aGUgbm90aWZpY2F0aW9ucyBvbiBhbnkgc3BvcmFkaWNzIAorICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGk9MDsgaSA8PSBJWF9RTUdSX01BWF9MT1dfUVVFX1RBQkxFX0lOREVYOyBpKyspCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKElYX1FNR1JfVFlQRV9SRUFMVElNRV9TUE9SQURJQyA9PSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl4UU1nclFUeXBlc1tpXSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl4UU1nck5vdGlmaWNhdGlvbkRpc2FibGUoaSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiByZW1vdmUgZnJvbSBpbnRSZWdWYWwgYXMgd2UgZG9uJ3Qgd2FudCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogdG8gc2VydmljZSBhbnkgc3BvcmFkaWNzIG5vdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50UmVnVmFsICY9IH5kaXNwYXRjaFFJbmZvW2ldLmludFJlZ0NoZWNrTWFzazsKKyNpZm5kZWYgTkRFQlVHCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFVwZGF0ZSBzdGF0aXN0aWNzICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BhdGNoZXJTdGF0cy5xdWV1ZVN0YXRzW2ldLmRpc2FibGVDb3VudCsrOworI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgY3VyckRpc3BhdGNoUUluZm8tPmNhbGxiYWNrIChxSW5kZXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VyckRpc3BhdGNoUUluZm8tPmNhbGxiYWNrSWQpOworI2lmbmRlZiBOREVCVUcKKyAgICAgICAgICAgICAgICAgICAgLyogVXBkYXRlIHN0YXRpc3RpY3MgKi8KKyAgICAgICAgICAgICAgICAgICAgZGlzcGF0Y2hlclN0YXRzLnF1ZXVlU3RhdHNbcUluZGV4XS5jYWxsYmFja0NudCsrOworI2VuZGlmCisgICAgICAgICAgICAgICAgICAgIC8qIENsZWFyIHRoZSBpbnRlcnJ1cHQgcmVnaXN0ZXIgYml0ICovCisgICAgICAgICAgICAgICAgICAgIGludFJlZ1ZhbCAmPSB+aW50UmVnQ2hlY2tNYXNrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHdoaWxlKGludFJlZ1ZhbCk7CisgICAgICAgIH0gLypFbmQgb2YgaW50UmVnVmFsID09IGN1cnJEaXNwYXRjaFFJbmZvLT5pbnRSZWdDaGV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ICAgICAgICBpZiAoaXhRTWdyUVR5cGVzW2ldICE9IElYX1FNR1JfVFlQRV9SRUFMVElNRV9PVEhFUikKKyAgICAgICAgeworICAgICAgICAgICAgcHJpbnRmICgiICUyZCAiLCBpKTsKKworICAgICAgICAgICAgaWYgKGl4UU1nclFUeXBlc1tpXSA9PSBJWF9RTUdSX1RZUEVfUkVBTFRJTUVfU1BPUkFESUMpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcHJpbnRmICgiU3BvcmFkaWMiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwcmludGYgKCJQZXJpb2RpYyIpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgIAorICAgICAgICAgICAgaXhRTWdyQXFtSWZRSW50ZXJydXB0RW5hYmxlUmVnUmVhZCAoSVhfUU1HUl9RVUVMT1dfR1JPVVAsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZpbnRFbmFibGVSZWdWYWwpOworICAgICAgICAgICAgCQorCisJICAgIGludEVuYWJsZVJlZ1ZhbCAmPSBkaXNwYXRjaFFJbmZvW2ldLmludFJlZ0NoZWNrTWFzazsKKyAgICAgICAgICAgIGludEVuYWJsZVJlZ1ZhbCA9IGludEVuYWJsZVJlZ1ZhbCA+PiBpOworCisgICAgICAgICAgICBwcmludGYgKCIgJTEwZCAlMTBkICUxMGQgJTEwZFxuIiwKKyAgICAgICAgICAgICAgICAgICAgZGlzcGF0Y2hlclN0YXRzLnF1ZXVlU3RhdHNbaV0uZW5hYmxlQ291bnQsCisgICAgICAgICAgICAgICAgICAgIGRpc3BhdGNoZXJTdGF0cy5xdWV1ZVN0YXRzW2ldLmRpc2FibGVDb3VudCwKKyAgICAgICAgICAgICAgICAgICAgaW50RW5hYmxlUmVnVmFsLAorICAgICAgICAgICAgICAgICAgICBkaXNwYXRjaGVyU3RhdHMucXVldWVTdGF0c1tpXS5jYWxsYmFja0NudCk7CisKKyAgICAgICAgICAgIGlmIChyZXNldFN0YXRzKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGRpc3BhdGNoZXJTdGF0cy5xdWV1ZVN0YXRzW2ldLmVuYWJsZUNvdW50ID0KKyAgICAgICAgICAgICAgICBkaXNwYXRjaGVyU3RhdHMucXVldWVTdGF0c1tpXS5kaXNhYmxlQ291bnQgPSAKKyAgICAgICAgICAgICAgICBkaXNwYXRjaGVyU3RhdHMucXVldWVTdGF0c1tpXS5jYWxsYmFja0NudCA9IDA7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisjZWxzZQorICAgIElYX1FNR1JfTE9HMCgiTGl2ZWxvY2sgUHJldmVudGlvbiBzdGF0aXN0aWNzIGFyZSBvbmx5IGNvbGxlY3RlZCBpbiBkZWJ1ZyBtb2RlXG4iKTsKKyNlbmRpZgorfQorCit2b2lkCitpeFFNZ3JQZXJpb2RpY0RvbmUgKHZvaWQpCit7CisgICAgVUlOVDMyIGkgPSAwOworICAgIFVJTlQzMiBpeFFNZ3JMb2NrS2V5ID0gMDsKKworICAgIC8qIAorICAgICAqIGZvciB0aGUgbG93ZXIgcXVldWVzCisgICAgICovCisgICAgZm9yIChpPTA7IGkgPD0gSVhfUU1HUl9NQVhfTE9XX1FVRV9UQUJMRV9JTkRFWDsgaSsrKQorICAgIHsKKyAgICAgICAgLyoKKyAgICAgICAgICogY2hlY2sgZm9yIHNwb3JhZGljcyAKKyAgICAgICAgICovCisgICAgICAgIGlmIChJWF9RTUdSX1RZUEVfUkVBTFRJTUVfU1BPUkFESUMgPT0gaXhRTWdyUVR5cGVzW2ldKQorICAgICAgICB7CisgICAgICAgICAgICAgLyogCisgICAgICAgICAgICAgICogZW5hYmxlIGFueSBzcG9yYWRpY3MgCisgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgaXhRTWdyTG9ja0tleSA9IGl4T3NhbElycUxvY2soKTsKKyAgICAgICAgICAgICBpeFFNZ3JBcW1JZlFJbnRlcnJ1cHRFbmFibGUoaSk7CisgICAgICAgICAgICAgaXhPc2FsSXJxVW5sb2NrKGl4UU1nckxvY2tLZXkpOworI2lmbmRlZiBOREVCVUcKKyAgICAgICAgICAgICAvKiAKKyAgICAgICAgICAgICAgKiBVcGRhdGUgc3RhdGlzdGljcyAKKyAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICBkaXNwYXRjaGVyU3RhdHMucXVldWVTdGF0c1tpXS5lbmFibGVDb3VudCsrOworICAgICAgICAgICAgIGRpc3BhdGNoZXJTdGF0cy5xdWV1ZVN0YXRzW2ldLm5vdGlmaWNhdGlvbkVuYWJsZWQgPSBUUlVFOworI2VuZGlmCisgICAgICAgIH0KKyAgICB9Cit9CitJWF9TVEFUVVMKK2l4UU1nckNhbGxiYWNrVHlwZVNldCAoSXhRTWdyUUlkIHFJZCwgCisgICAgICAgICAgICAgICAgICAgICAgIEl4UU1nclR5cGUgdHlwZSkKK3sKKyAgICBVSU5UMzIgaXhRTWdyTG9ja0tleSA9IDA7CisgICAgSXhRTWdyVHlwZSBpeFFNZ3JPbGRUeXBlID0wOworCisjaWZuZGVmIE5ERUJVRworICAgIGlmICghaXhRTWdyUUlzQ29uZmlndXJlZChxSWQpKQorICAgIHsKKyAgICAgICAgcmV0dXJuIElYX1FNR1JfUV9OT1RfQ09ORklHVVJFRDsKKyAgICB9CisgICAgaWYgKHFJZCA+PSBJWF9RTUdSX01JTl9RVUVVUFBfUUlEKQorICAgIHsKKyAgICAgICAgcmV0dXJuIElYX1FNR1JfUEFSQU1FVEVSX0VSUk9SOworICAgIH0KKyAgICBpZighSVhfUU1HUl9ESVNQQVRDSEVSX0NBTExCQUNLX1RZUEVfQ0hFQ0sodHlwZSkpCisgICAgeworICAgICAgICByZXR1cm4gSVhfUU1HUl9QQVJBTUVURVJfRVJST1I7CisgICAgfQorI2VuZGlmCisKKyAgICBpeFFNZ3JPbGRUeXBlID0gaXhRTWdyUVR5cGV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7CisgICAgcHJpbnRmKCJXYXRlcm1hcmsgc2V0IGNvdW50Li4uLi4lZFxuIiwgcUNmZ1N0YXRzLT53bVNldENudCk7CisgICAgcHJpbnRmKCI9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4iKTsKKyAgICBwcmludGYoIk9uIHRoZSBmbHkgSW50ZXJydXB0IFJlZ2lzdGVyIFN0YXRzLi4uLi4uLi5cbiIpOworICAgIHByaW50ZigiPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuIik7CisgICAgcHJpbnRmKCJMb3dlciBJbnRlcnJ1cHQgUmVnaXN0ZXIuLi4uLi4uLi4uLi4weCUwOHhcbiIsbG93SW50UmVnUmVhZCk7CisgICAgcHJpbnRmKCJVcHBlciBJbnRlcnJ1cHQgUmVnaXN0ZXIuLi4uLi4uLi4uLi4weCUwOHhcbiIsdXBJbnRSZWdSZWFkKTsKKyAgICBwcmludGYoIj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiIpOworICAgIHByaW50ZigiUXVldWUgU3BlY2lmaWMgU3RhdHMuLi4uLi4uLlxuIik7CisgICAgcHJpbnRmKCI9PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4iKTsKKworICAgIGZvciAoaT0wOyBpPElYX1FNR1JfTUFYX05VTV9RVUVVRVM7IGkrKykKKyAgICB7CisJaWYgKGl4UU1nclFJc0NvbmZpZ3VyZWQoaSkpCisJeworCSAgICBpeFFNZ3JRU2hvdyhpKTsKKwl9CisgICAgfQorCisgICAgcHJpbnRmKCI9PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4iKTsKK30KKworSVhfU1RBVFVTCitpeFFNZ3JRU2hvdyAoSXhRTWdyUUlkIHFJZCkKK3sKKyAgICBJeFFNZ3JRQ2ZnU3RhdHMgKnFDZmdTdGF0cyA9IE5VTEw7CisgICAgSXhRTWdyRGlzcGF0Y2hlclN0YXRzICpkaXNwYXRj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Z1bGwiOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBJWF9RTUdSX1FfU09VUkNFX0lEX05PVF9FOgorICAgICAgICAgICAgICAgIGxvY2FsRXZlbnQgPSAiTm90IEVtcHR5IjsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgSVhfUU1HUl9RX1NPVVJDRV9JRF9OT1RfTkU6CisgICAgICAgICAgICAgICAgbG9jYWxFdmVudCA9ICJOb3QgTmVhcmx5IEVtcHR5IjsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgSVhfUU1HUl9RX1NPVVJDRV9JRF9OT1RfTkY6CisgICAgICAgICAgICAgICAgbG9jYWxFdmVudCA9ICJOb3QgTmVhcmx5IEZ1bGwiOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBJWF9RTUdSX1FfU09VUkNFX0lEX05PVF9GOgorICAgICAgICAgICAgICAgIGxvY2FsRXZlbnQgPSAiTm90IEZ1bGwiOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgZGVmYXVsdCA6CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgcHJpbnRmKCIgICAgTm90aWZpY2F0aW9ucyBsb2NhbEV2ZW50Li4uLi4uICVzXG4iLCBsb2NhbEV2ZW50KTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgcHJpbnRmKCIgICAgTm90aWZpY2F0aW9ucy4uLi4uLi4uLi4uLiBub3QgZW5hYmxlZFxuIik7CisgICAgfQorICAgIHByaW50ZigiICBJeFFNZ3JEaXNwYXRjaGVyIFN0YXRzXG4iKTsKKyAgICBwcmludGYoIiAgICBDYWxsYmFjayBjb3VudC4uLi4uLi4uLi4uLi4uLi4lZFxuIiwKKwkgIGRpc3BhdGNoZXJTdGF0cy0+cXVldWVTdGF0c1txSWRdLmNhbGxiYWNrQ250KT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gICAgCisgICAgaXhRTWdyQXFtSWZRUHVzaCAocUlkLCBlbnRyeVNpemVJbldvcmRzLCBlbnRyeSk7CisKKyAgICAvKiByZXNldCB0aGUgY3VycmVudCByZWFkIGNvdW50IGlmIHRoZSBjb3VudGVyIHdyYXBwZWQgYXJvdW5kIAorICAgICogKHVuc2lnbmVkIGFyaXRobWV0aWMpCisgICAgKi8KKyAgICBpbmZvUHRyID0gJml4UU1nclFJbmxpbmVkUmVhZFdyaXRlSW5mb1txSWRdOworICAgIGlmIChpbmZvUHRyLT5xV3JpdGVDb3VudCsrID49IGluZm9QdHItPnFTaXplSW5FbnRyaWVzKQorICAgIHsKKwlpbmZvUHRyLT5xV3JpdGVDb3VudCA9IGluZm9QdHItPnFTaXplSW5FbnRyaWVzOworICAgIH0KKworICAgIC8qIENoZWNrIGlmIG92ZXJmbG93IG9jY3VycmVkIG9uIHRoZSB3cml0ZSovCisgICAgaWYgKGl4UU1nckFxbUlmT3ZlcmZsb3dDaGVjayAocUlkKSkKKyAgICB7CisJcmV0dXJuIElYX1FNR1JfUV9PVkVSRkxPVzsKKyAgICB9CisgICAgICAgICAKKyAgICByZXR1cm4gSVhfU1VDQ0VTUzsKK30KKworSVhfU1RBVFVTCitpeFFNZ3JRUGVlayAoSXhRTWdyUUlkIHFJZCwKKwkgICAgIHVuc2lnbmVkIGludCBlbnRyeUluZGV4LAorCSAgICAgVUlOVDMyICplbnRyeSkKK3sKKyAgICB1bnNpZ25lZCBpbnQgbnVtRW50cmllczsKKworI2lmbmRlZiBOREVCVUcKKyAgICBpZiAoKE5VTEwgPT0gZW50cnkpIHx8IChlbnRyeUluZGV4ID49IElYX1FNR1JfUV9TSVpFX0lOVkFMSUQpKQorICAgIHsKKwlyZXR1cm4gSVhfUU1HUl9QQVJBTUVURVJfRVJST1I7CisgICAgfQorCisgICAgaWYgKCFpeFFNZ3JRSXNDb25maWd1cmVkKHFJZCkpCisgICAgeworCXJldHVybiBJWF9RTUdSX1FfTk9UX0NPTkZJR1VSRUQ7CisgICAgfQorI2VuZGlmCisgICAgCisgICAgaWYgKElYX1NVQ0NFU1MgIT0gaXhRTWdyUU51bUVudHJpZXNHZXQgKHFJZCwgJm51bUVudHJpZXMpKQorICAgIHsKKwlyZXR1cm4gSVhfRkFJTDsKKyAgICB9CisKKyAgICBpZiAoZW50cnlJbmRleCA+PSBudW1FbnRyaWVzKSAvKiBlbnRyeUluZGV4IHN0YXJ0cyBhdCAwICovCisgICAgeworCXJldHVybiBJWF9RTUdSX0VOVFJZX0lOREVYX09VVF9PRl9CT1VORFM7CisgICAgfQorCisgICAgcmV0dXJuIGl4UU1nckFxbUlmUVBlZWsgKHFJZCwgZW50cnlJbmRleCwgZW50cnkpOworfQorCitJWF9TVEFUVVMKK2l4UU1nclFQb2tlIChJeFFNZ3JRSWQgcUlkLAorCSAgICAgdW5zaWduZWQgZW50cnlJbmRleCwKKwkgICAgIFVJTlQzMiAqZW50cnkpCit7CisgICAgdW5zaWduZWQgaW50IG51bUVudHJpZXM7CisKKyNpZm5kZWYgTkRFQlVHCisgICAgaWYgKChOVUxMID09IGVudHJ5KSB8fCAoZW50cnlJbmRleCA+IDEyOCkpCisgICAgeworCXJldHVybiBJWF9RTUdSX1BBUkFNRVRFUl9FUlJPUjsKKyAgICB9CisKKyAgICBpZiAoIWl4UU1nclFJc0NvbmZpZ3VyZWQocUlkKSkKKyAgICB7CisJcmV0dXJuIElYX1FNR1JfUV9OT1RfQ09ORklHVVJFRDsKKyAgICB9CisjZW5kaWYKKyAgICAgICAgCisgICAgaWYgKElYX1NVQ0NFU1MgIT0gaXhRTWdyUU51bUVudHJpZXNHZXQgKHFJZCwgJm51bUVudHJpZXMpKQorICAgIHsKKwlyZXR1cm4gSVhfRkFJTDsKKyAgICB9CisKKyAgICBpZiAobnVtRW50cmllcyA8IChlbnRyeUluZGV4ICsgMSkpIC8qIGVudHJ5SW5kZXggc3RhcnRzIGF0IDAgKi8KKyAgICB7CisJcmV0dXJuIElYX1FNR1JfRU5UUllfSU5ERVhfT1VUX09GX0JPVU5EUzsKKyAgICB9CisKKyAgICByZXR1cm4gaXhRTWdyQXFtSWZRUG9rZSAocUlkLCBlbnRyeUluZGV4LCBlbnRyeSk7Cit9CisKK0lYX1NUQVRVUworaXhRTWdyUVN0YXR1c0dldFdpdGhDaGVja3MgKEl4UU1nclFJZCBxSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgSXhRTWdyUVN0YXR1cyAqcVN0YXR1cykKK3sKKyAgICBpZiAoTlVMTCA9PSBxU3RhdHVzKQorICAgIHsKKwlyZXR1cm4gSVhfUU1HUl9QQVJBTUVURVJfRVJST1I7CisgICAgfQorICAgCisgICAgaWYgKCFpeFFNZ3JRSXNDb25maWd1cmVkIChxSWQpKSAKKyAgICB7CisgICAgICAgIHJldHVybiBJWF9RTUdSX1FfTk9UX0NPTkZJR1VSRUQ7CisgICAgfQorCisgICAgaXhRTWdyQXFtSWZRdWVTdGF0UmVhZCAocUlkLCBxU3RhdHVzKTsKKworICAgIHJldHVybiBJWF9TVUNDRVNTOworfQorCitJWF9TVEFUVVMKK2l4UU1nclFOdW1FbnRyaWVzR2V0IChJeFFNZ3JRSWQgcUlkLAorCQkgICAgICB1bnNpZ25lZCAqbnVtRW50cmllc1B0cikKK3sKKyAgICBVSU5UMzIgcVB0cnM7CisgICAgVUlOVDMyIHFTdGF0dXM7CisgICAgdW5zaWduZWQgbnVtRW50cmllczsKKyAgICBJeFFNZ3JRSW5saW5lZFJlYWRXcml0ZUluZm8gKmluZm9QdHI7CisKKworI2lmbmRlZiBOREVCVUcKKyAgICBpZiAoTlVMTCA9PSBudW1FbnRyaWVzUHRyKQorICAgIHsKKwlyZXR1cm4gSVhfUU1HUl9QQVJBTUVURVJfRVJST1I7CisgICAgfQorCisgICAgLyogQ2hlY2sgUUlkICovCisgICAgaWYgKCFpeFFNZ3JRSXNDb25maWd1cmVkKHFJZCkpCisgICAgeworCXJldHVybiBJWF9RTUdSX1FfTk9UX0NPTkZJ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sCisgICAgICAgICAgICAgICAgICAgIHN0YXR1cyAmIH5pbmZvUHRyLT5xVWZsb3dTdGF0Qml0TWFzayk7CisgICAgICAgICAqZW50cnlQdHIgPSAwOworICAgICAgICAgIGluZm9QdHItPnFSZWFkQ291bnQgPSAwOworICAgICAgICAgICAgcmV0dXJuIElYX1FNR1JfUV9VTkRFUkZMT1c7CisgICAgIH0KKyAgICAgICB9CisgICAgICAgLyogc3RvcmUgdGhlIHJlc3VsdCAqLworICAgICAgKmVudHJ5UHRyID0gZW50cnk7CisKKyAgICAgIC8qIE5vIHVuZGVyZmxvdyBvY2N1cmVkIDogc29tZW9uZSBpcyBmaWxsaW5nIHRoZSBxdWV1ZQorICAgICAgICogb3IgdGhlIHF1ZXVlIGNvbnRhaW5zIG51bGwgZW50cmllcy4KKyAgICAgICAqIFRoZSBjdXJyZW50IGNvdW50ZXIgbmVlZHMgdG8gYmUKKyAgICAgICAqIHVwZGF0ZWQgZnJvbSB0aGUgY3VycmVudCBudW1iZXIgb2YgZW50cmllcyBpbiB0aGUgcXVldWUKKyAgICAgICAqLworCisgICAgIC8qIGdldCBzbmFwc2hvdCBvZiBxdWV1ZSBwb2ludGVycyAqLworICAgICAgICBxUHRycyA9IElYX09TQUxfUkVBRF9MT05HKGluZm9QdHItPnFDb25maWdSZWdBZGRyKTsKKworICAgICAgIC8qIE1vZCBzdWJ0cmFjdGlvbiBvZiBwb2ludGVycyB0byBnZXQgbnVtYmVyIG9mIHdvcmRzIGluIFEuICovCisgICAgICBxUHRycyA9IChxUHRycyAtIChxUHRycyA+PiA3KSkgJiAweDdmOyAKKyAgCisgICAgICAgaWYgKHFQdHJzID09IDApCisgICAgIHsKKyAgICAgICAvKiBubyBlbnRyeSBpbiB0aGUgcXVldWUgKi8KKyAgICAgaW5mb1B0ci0+cVJlYWRDb3VudCA9IDA7CisgICAgICAgIH0KKyAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAvKiBjb252ZXJ0IHRoZSBudW1iZXIgb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UgdG8KKyAgICAqIGRvIHNvbWUgQ1BVLCBlLmcuIGluY3JlbWVudCBwb2ludGVycyBhbmQgZGVjcmVtZW50IAorICAgKiBjb3VudGVycy4KKyAgICAgKi8KKworIC8qIGZldGNoIGEgcXVldWUgZW50cnkgKi8KKyAgIG51bGxDaGVja0VudHJ5ID0gSVhfT1NBTF9SRUFEX0xPTkcoaW5mb1B0ci0+cUFjY1JlZ0FkZHIpOworCisgLyogaXRlcmF0ZSB0aGUgc3BlY2lmaWVkIG51bWJlciBvZiBxdWV1ZSBlbnRyaWVzICovIAorICAgIHdoaWxlICgtLW51bUVudHJpZXMpCisgICAgeworICAgICAgIC8qIGNoZWNrIHRoZSByZXN1bHQgb2YgdGhlIHByZXZpb3VzIHJlYWQgKi8KKyAgICAgaWYgKG51bGxDaGVja0VudHJ5ID09IDApCisgICAgICAgIHsKKyAgICAgICAvKiBpZiB3ZSByZWFkIGEgTlVMTCBlbnRyeSwgc3RvcC4gV2UgaGF2ZSB1bmRlcmZsb3dlZCAqLworICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAvKiB3cml0ZSB0aGUgZW50cnkgKi8KKyAgICAgICAqZW50cmllcyA9IG51bGxDaGVja0VudHJ5OworICAgICAgLyogZmV0Y2ggbmV4dCBlbnRyeSAqLworICAgICAgbnVsbENoZWNrRW50cnkgPSBJWF9PU0FMX1JFQURfTE9ORyhxQWNjUmVnQWRkcik7CisgICAgICAvKiBpbmNyZW1lbnQgdGhlIHdyaXRlIGFkZHJlc3MgKi8KKyAgICAgICBlbnRyaWVzKys7CisgICAgICB9CisgICB9CisgICAvKiB3cml0ZSB0aGUgcHJlLWZldGNoZWQgZW50cnkgKi8KKyAgICplbnRyaWVzID0gbnVsbENoZWNrRW50cnk7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgSXhRTWdyUUVudHJ5U2l6ZUluV29yZHMgZW50cnlTaXplSW5Xb3JkcyA9IGluZm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9IGluZm9QdHItPnFBY2NSZWdBZGRyOworICAgIHdoaWxlICgtLWVudHJ5U2l6ZSkKKyB7CisgICAgICAgKytlbnRyeTsKKyAgICAgICAgSVhfT1NBTF9XUklURV9MT05HKCsrcUFjY1JlZ0FkZHIsICplbnRyeSk7CisgICAgfQorICAgZW50cnlTaXplID0gaW5mb1B0ci0+cUVudHJ5U2l6ZUluV29yZHM7CisgICAgfQorCisgICAgLyogb3ZlcmZsb3cgaXMgYXZhaWxhYmxlIGZvciBsb3dlciBxdWV1ZXMgb25seSAqLworICAgIGlmIChxSWQgPCBJWF9RTUdSX01JTl9RVUVVUFBfUUlEKQorICAgIHsgICAKKyAgVUlOVDMyIHFTaXplID0gaW5mb1B0ci0+cVNpemVJbkVudHJpZXM7CisgLyogaW5jcmVtZW50IHRoZSBjdXJyZW50IG51bWJlciBvZiBlbnRyaWVzIGluIHRoZSBxdWV1ZQorICAqIGFuZCBjaGVjayBmb3Igb3ZlcmZsb3cgCisgICAqLworIGlmIChpbmZvUHRyLT5xV3JpdGVDb3VudCsrID09IHFTaXplKQorICAgIHsKKyAgICAgICAvKiB0aGUgcXVldWUgbWF5IGhhdmUgb3ZlcmZsb3cgKi8KKyAgICAgICBVSU5UMzIgcVB0cnM7IC8qIHF1ZXVlIGludGVybmFsIHBvaW50ZXJzICovCisgIAorICAgICAgIC8qIGdldCB0aGUgcXVldWUgc3RhdHVzICovCisgICAgICBVSU5UMzIgc3RhdHVzID0gSVhfT1NBTF9SRUFEX0xPTkcoaW5mb1B0ci0+cVVPU3RhdFJlZ0FkZHIpOworCisgICAgICAgLyogcmVhZCB0aGUgc3RhdHVzIHR3aWNlIGJlY2F1c2UgdGhlIHN0YXR1cyBtYXkgCisgICAgICAgICAqIG5vdCBiZSBpbW1lZGlhdGVseSByZWFkeSBhZnRlciB0aGUgd3JpdGUgb3BlcmF0aW9uCisgICAgICAgICovCisgICAgIGlmICgoc3RhdHVzICYgaW5mb1B0ci0+cU9mbG93U3RhdEJpdE1hc2spIHx8CisgICAgICAgICgoc3RhdHVzID0gSVhfT1NBTF9SRUFEX0xPTkcoaW5mb1B0ci0+cVVPU3RhdFJlZ0FkZHIpKQorICAgICAgICAgJiBpbmZvUHRyLT5xT2Zsb3dTdGF0Qml0TWFzaykpCisgICAgIHsKKyAgICAgICAvKiB0aGUgcXVldWUgaXMgZnVsbCwgY2xlYXIgdGhlIG92ZXJmbG93IHN0YXR1cworICAgICAgKiAgYml0IGlmIGl0IHdhcyBzZXQgCisgICAgICAgKi8KKyAgICAgSVhfT1NBTF9XUklURV9MT05HKGluZm9QdHItPnFVT1N0YXRSZWdBZGRyLAorICAgICAgICAgICAgICAgICAgICBzdGF0dXMgJiB+aW5mb1B0ci0+cU9mbG93U3RhdEJpdE1hc2spOworICAgICBpbmZvUHRyLT5xV3JpdGVDb3VudCA9IGluZm9QdHItPnFTaXplSW5FbnRyaWVzOworICAgICByZXR1cm4gSVhfUU1HUl9RX09WRVJGTE9XOworICAgICAgfQorICAgICAgIC8qIE5vIG92ZXJmbG93IG9jY3VyZWQgOiBzb21lb25lIGlzIGRyYWluaW5nIHRoZSBxdWV1ZQorICAgICAgICogYW5kIHRoZSBjdXJyZW50IGNvdW50ZXIgbmVlZHMgdG8gYmUKKyAgICAgICAqIHVwZGF0ZWQgZnJvbSB0aGUgY3VycmVudCBudW1iZXIgb2YgZW50cmllcyBpbiB0aGUgcXVldWUKKyAgICAgICAqLworCisgICAgIC8qIGdldCBxIHBvaW50ZXIgc25hcHNob3QgKi8KKyAgICAgICAgcVB0cnMgPSBJWF9PU0FMX1JFQURfTE9ORyhpbmZvUHRyLT5xQ29uZmlnUmVnQWRkcik7CisKKyAgICAgICAvKiBNb2Qgc3VidHJhY3Rpb24gb2YgcG9pbnRlcnMgdG8gZ2V0IG51bWJlciBvZiB3b3JkcyBpbiBRLiAqLworICAgICAgcVB0cnMgPSAocVB0cnMgLSAocVB0cnMgPj4gNykpICYgMHg3ZjsgCisKKyAgICAgaWYgKHFQdHJzID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ICAgVUlOVDMyIHN0YXR1czsKKworICAgIC8qIHVwZGF0ZSB0aGUgY3VycmVudCB3cml0ZSBjb3VudCAqLworICAgIGluZm9QdHItPnFXcml0ZUNvdW50ICs9IG51bUVudHJpZXM7CisKKyAgICBpZiAoaW5mb1B0ci0+cUVudHJ5U2l6ZUluV29yZHMgPT0gSVhfUU1HUl9RX0VOVFJZX1NJWkUxKQorICAgIHsKKyAgICB2b2xhdGlsZSBVSU5UMzIgKnFBY2NSZWdBZGRyID0gaW5mb1B0ci0+cUFjY1JlZ0FkZHI7CisgICAgd2hpbGUgKG51bUVudHJpZXMtLSkKKyAgICB7CisgICAgICAgSVhfT1NBTF9XUklURV9MT05HKHFBY2NSZWdBZGRyLCAqZW50cmllcyk7CisgICAgICAgIGVudHJpZXMrKzsKKyAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworIEl4UU1nclFFbnRyeVNpemVJbldvcmRzIGVudHJ5U2l6ZUluV29yZHMgPSBpbmZvUHRyLT5xRW50cnlTaXplSW5Xb3JkczsKKyAgaW50IGk7CisKKyAgLyogd3JpdGUgZWFjaCBxdWV1ZSBlbnRyeSAqLworICAgIHdoaWxlIChudW1FbnRyaWVzLS0pCisgICAgeworICAgICAgIC8qIHdyaXRlIHRoZSBxdWV1ZUVudHJ5U2l6ZSBudW1iZXIgb2Ygd29yZHMgZm9yIGVhY2ggZW50cnkgKi8KKyAgICAgICBmb3IgKGkgPSAwOyBpIDwgZW50cnlTaXplSW5Xb3JkczsgaSsrKQorICAgICAgeworICAgICAgIElYX09TQUxfV1JJVEVfTE9ORygoaW5mb1B0ci0+cUFjY1JlZ0FkZHIgKyBpKSwgKmVudHJpZXMpOworICAgICBlbnRyaWVzKys7CisgICAgICB9CisgICB9CisgICAgfQorCisgICAgLyogY2hlY2sgaWYgdGhlIHdyaXRlIGNvdW50IG92ZXJmbG93cyAqLworICAgIGlmIChpbmZvUHRyLT5xV3JpdGVDb3VudCA+IGluZm9QdHItPnFTaXplSW5FbnRy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VDbGVhcigpLCBpeEF0bVNjaFRhYmxlVXBkYXRlKCkuICAqLworUFVCTElDIElYX1NUQVRVUworaXhBdG1TY2hUYWJsZVVwZGF0ZSggSXhBdG1Mb2dpY2FsUG9ydCBwb3J0LAorICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgaW50IG1heENlbGxzLAorICAgICAgICAgICAgICAgICAgICAgSXhBdG1TY2hlZHVsZVRhYmxlICoqcmV0dGFibGUpOworCisvKiogIAorICogQGluZ3JvdXAgSXhBdG1TY2gKKyAqCisgKiBAZm4gaXhBdG1TY2hTaG93KHZvaWQpCisgKgorICogIEBicmllZiBVdGlsaXR5IGZ1bmN0aW9uIHdoaWNoIHdpbGwgcHJpbnQgc3RhdGlzdGljcyBvbiB0aGUgY3VycmVudAorICogICAgICAgICBhbmQgYWNjdW11bGF0ZWQgc3RhdGUgb2YgVkNzIGFuZCB0cmFmZmljIGluIHRoZSBBVE0KKyAqICAgICAgICAgc2NoZWR1bGVyIGNvbXBvbmVudC4gIE91dHB1dCBpcyBzZW50IHRvIHRoZSBkZWZhdWx0IG91dHB1dAorICogICAgICAgICBkZXZpY2UuCisgKgorICogQHBhcmFtIG5vbmUKKyAqIEByZXR1cm4gbm9uZQorICovCitQVUJMSUMgdm9pZAoraXhBdG1TY2hTaG93KHZvaWQpOworCisvKiogIAorICogQGluZ3JvdXAgSXhBdG1TY2gKKyAqCisgKiBAZm4gaXhBdG1TY2hTdGF0c0NsZWFyKHZvaWQpCisgKgorICogIEBicmllZiBVdGlsaXR5IGZ1bmN0aW9uIHdoaWNoIHdpbGwgcmVzZXQgYWxsIGNvdW50ZXIgc3RhdGlzdGljcyBpbgorICogICAgICAgICB0aGUgQVRNIHNjaGVkdWxlciB0byB6ZXJvLgorICoKKyAqIEBwYXJhbSBub25lCisgKiBAcmV0dXJuIG5vbmUKKyAqLworUFVCTElDIHZvaWQKK2l4QXRtU2NoU3RhdHNDbGVhcih2b2lkKTsKKworI2VuZGlmCisvKiBJWEFUT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RNVFlQRVNfSAorI2RlZmluZSBJWEFUTVRZUEVTX0gKKworI2luY2x1ZGUgIkl4TnBlQS5oIgorCisvKioKKyAqIEBlbnVtIEl4QXRtTG9naWNhbFBvcnQKKyAqCisgKiBAYnJpZWYgTG9naWNhbCBQb3J0IERlZmluaXRpb25zICA6CisgKgorICogT25seSAxIHBvcnQgaXMgYXZhaWxhYmxlIGluIFNQSFkgY29uZmlndXJhdGlvbgorICogMTIgcG9ydHMgYXJlIGVuYWJsZWQgaW4gTVBIWSBjb25maWd1cmF0aW9uCisgKgorICovCit0eXBlZGVmIGVudW0KK3sKKyAgICBJWF9VVE9QSUFfUE9SVF8wID0gMCwgIC8qKjwgUG9ydCAwICovCisjaWZkZWYgSVhfTlBFX01QSFlNVUxUSVBPUlQKKyAgICBJWF9VVE9QSUFfUE9SVF8xLCAgICAgIC8qKjwgUG9ydCAxICovCisgICAgSVhfVVRPUElBX1BPUlRfMiwgICAgICAvKio8IFBvcnQgMiAqLworICAgIElYX1VUT1BJQV9QT1JUXzMsICAgICAgLyoqPCBQb3J0IDMgKi8KKyAgICBJWF9VVE9QSUFfUE9SVF80LCAgICAgIC8qKjwgUG9ydCA0ICovCisgICAgSVhfVVRPUElBX1BPUlRfNSwgICAgICAvKio8IFBvcnQgNSAqLworICAgIElYX1VUT1BJQV9QT1JUXzYsICAgICAgLyoqPCBQb3J0IDYgKi8KKyAgICBJWF9VVE9QSUFfUE9SVF83LCAgICAgIC8qKjwgUG9ydCA3ICovCisgICAgSVhfVVRPUElBX1BPUlRfOCwgICAgICAvKio8IFBvcnQgOCAqLworICAgIElYX1VUT1BJQV9QT1JUXzksICAgICAgLyoqPCBQb3J0IDkgKi8KKyAgICBJWF9VVE9QSUFfUE9SVF8xMCwgICAgIC8qKjwgUG9ydCAxMCAqLworICAgIElYX1VUT1BJQV9QT1JUXzExLCAgICAgLyoqPCBQb3J0IDExICovCisjZW5kaWYgLyogSVhfTlBFX01QSFkgKi8KKyAgICBJWF9VVE9QSU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WwgbnVtYmVyIG9mIGNlbGxzIHNjaGVkdWxlZCBhbmQgdGhlIHRvdGFsIG51bWJlciBvZgorICogIGVudHJpZXMgaW4gdGhlIHRhYmxlIGFyZSBhbHNvIGluZGljYXRlZC4KKyAqCisgKi8KK3R5cGVkZWYgc3RydWN0Cit7CisgICAgdW5zaWduZWQgdGFibGVTaXplOyAgICAgIC8qKjwgTnVtYmVyIG9mIGVudHJpZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogSW5kaWNhdGVzIHRoZSB0b3RhbCBudW1iZXIgb2YKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogICBlbnRyaWVzIGluIHRoZSB0YWJsZS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgdW5zaWduZWQgdG90YWxDZWxsU2xvdHM7IC8qKjwgTnVtYmVyIG9mIGNlbGxzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIEluZGljYXRlcyB0aGUgdG90YWwgbnVtYmVyIG9mIEFUTQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiAgIGNlbGxzIHdoaWNoIGFyZSBzY2hlZHVsZWQgYnkgYWxsIHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiAgIGVudHJpZXMgaW4gdGhlIHRhYmxlLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICBJeEF0bVNjaGVkdWxlVGFibGVFbnRyeSAqdGFibGU7IC8qKjwgUG9pbnRlciB0byBzY2hlZHVsZSBlbnRyaWVzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogUG9pbnRlciB0byBhbiBhcnJheQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogICBjb250YWluaW5nIH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4QXRtZEFjYyBzdGF0cworICoKKyAqIEBwYXJhbSBub25lCisgKgorICogQHJldHVybiBub25lCisgKgorICovCitQVUJMSUMgdm9pZAoraXhBdG1kQWNjU3RhdHNSZXNldCAodm9pZCk7CisKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgUGFydCBvZiB0aGUgSXhBdG1kQWNjIGludGVyZmFjZSByZWxhdGVkIHRvIFJYIHRyYWZmaWMKKyAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworCisvKioKKyAqCisgKiBAaW5ncm91cCBJeEF0bWRBY2NBUEkKKyAqCisgKiBAZm4gaXhBdG1kQWNjUnhWY0Nvbm5lY3QgKEl4QXRtTG9naWNhbFBvcnQgcG9ydCwKKyAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgdnBpLAorICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGludCB2Y2ksCisgICAgICAgICAgICAgICAgICAgICAgSXhBdG1kQWNjQWFsVHlwZSBhYWxTZXJ2aWNlVHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICBJeEF0bVJ4UXVldWVJZCByeFF1ZXVlSWQsCisgICAgICAgICAgICAgICAgICAgICAgSXhBdG1kQWNjVXNlcklkIHVzZXJDYWxsYmFja0lkLAorICAgICAgICAgICAgICAgICAgICAgIEl4QXRtZEFjY1J4VmNSeENhbGxiYWNrIHJ4Q2FsbGJhY2ssCisgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgaW50IG1pbmltdW1SZXBsZW5pc2hDb3VudCwKKyAgICAgICAgICAgICAgICAgICAgICBJeEF0bUNvbm5JZCAqIGNvbm5JZFB0ciwKKyAgICAgICAgICAgICAgICAgICAgICBJeEF0bU5wZVJ4VmNJZCAqIG5wZVZjSWRQdHIgKQorICoKKyAq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UgcmVzZXJ2ZWQgT0FNIFZQSS9WQ0ksCisgKiAgICAgICAgICAgICBwb3J0IGlzIG5vdCBpbml0aWFsaXNlZCwKKyAqICAgICAgICAgICAgIG9yIHNvbWUgb3RoZXIgZXJyb3Igb2NjdXJzIGR1cmluZyBwcm9jZXNzaW5nLgorICoKKyAqLworUFVCTElDIElYX1NUQVRVUyBpeEF0bWRBY2NSeFZjQ29ubmVjdCAoSXhBdG1Mb2dpY2FsUG9ydCBwb3J0LAorICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGludCB2cGksCisgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgaW50IHZjaSwKKyAgICAgICAgICAgICAgICAgICAgICBJeEF0bWRBY2NBYWxUeXBlIGFhbFNlcnZpY2VUeXBlLAorICAgICAgICAgICAgICAgICAgICAgIEl4QXRtUnhRdWV1ZUlkIHJ4UXVldWVJZCwKKyAgICAgICAgICAgICAgICAgICAgICBJeEF0bWRBY2NVc2VySWQgdXNlckNhbGxiYWNrSWQsCisgICAgICAgICAgICAgICAgICAgICAgSXhBdG1kQWNjUnhWY1J4Q2FsbGJhY2sgcnhDYWxsYmFjaywKKyAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgbWluaW11bVJlcGxlbmlzaENvdW50LAorICAgICAgICAgICAgICAgICAgICAgIEl4QXRtQ29ubklkICogY29ubklkUHRyLAorICAgICAgICAgICAgICAgICAgICAgIEl4QXRtTnBlUnhWY0lkICogbnBlVmNJZFB0ciApOworCisvKioKKyAqCisgKiBAaW5ncm91cCBJeEF0bWRBY2NBUEkKKyAqIAorICogQGZuIGl4QXRtZEFjY1J4VmNGcmVlUmVwbGVuaXNoIChJeEF0bUNvbm5JZCBjb25uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICBJWF9PU0FMX01CVUYgKiBtYnVmUHRyKQorICoKKyAqIEBicmllZiBQcm92aWRlIGZyZWUgbWJ1ZnMgZm9yIGRhdGEgcmVjZXB0aW9uIG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3RlIC0gdGhlIGV4YWN0IGRlc2NyaXB0aW9uIG9mIGFsbCBwYXJhbWV0ZXJzIGlzIGRvbmUgaW4gdGhlIFV0b3BpYSByZWZlcmVuY2UKKyAqICAgZG9jdW1lbnRzLgorICoKKyAqLwordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgICAvKioKKyAgICAqIEBpbmdyb3VwIEl4QXRtZEFjY1V0b3BpYUN0cmxBUEkKKyAgICAqIEBzdHJ1Y3QgVXRUeENvbmZpZ18KKyAgICAqIEBicmllZiBVdG9waWEgVHggQ29uZmlnIFJlZ2lzdGVyCisgICAgKi8KKyAgICBzdHJ1Y3QgVXRUeENvbmZpZ18KKyAgICB7CisKKyAgICB1bnNpZ25lZCBpbnQgcmVzZXJ2ZWRfMToxOyAgLyoqPCBbMzFdIFRoZXNlIGJpdHMgYXJlIGFsd2F5cyAwLiovCisgICAgdW5zaWduZWQgaW50IHR4SW50ZXJmYWNlOjE7ICAgICAvKio8IFszMF0gVXRvcGlhIFRyYW5zbWl0IEludGVyZmFjZS4gVGhlIGZvbGxvd2luZyBlbmNvZGluZworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGlzIHVzZWQgdG8gc2V0IHRoZSBVdG9waWEgVHJhbnNtaXQgaW50ZXJmYWNlIGFzIEFUTSBtYXN0ZXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBvciBQSFkgc2xhdmU6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogQGxpIDEgLSBQSFkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBAbGkgMCAtIEFUTQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgIHVuc2lnbmVkIGludCB0eE1vZGU6MTsgICAgICAvKio8IFsyOV0gVXRvcGlhIFRyYW5zbWl0IE1vZGUuIFRoZSBmb2xsb3dpbmcgZW5jb2RpbmcgaXMgdXNlZAorICAgICogIHRvIHNldCB0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XJzLCB0byBiZSBhY2Nlc3NlZCBkdXJpbmcgYSByZWFkIG9wZXJhdGlvbgorKgorKiBAbm90ZSAtIHRoZSBleGFjdCBkZXNjcmlwdGlvbiBvZiBhbGwgcGFyYW1ldGVycyBpcyBkb25lIGluIHRoZSBVdG9waWEgcmVmZXJlbmNlCisqICAgZG9jdW1lbnRzLgorKgorKi8KK3R5cGVkZWYgc3RydWN0Cit7CisKKyAgICB1bnNpZ25lZCBpbnQgdXRUeENlbGxDb3VudDsgIC8qKjwgY291bnQgb2YgY2VsbHMgdHJhbnNtaXR0ZWQgKi8KKworICAgIHVuc2lnbmVkIGludCB1dFR4SWRsZUNlbGxDb3VudDsgICAgLyoqPCBjb3VudCBvZiBpZGxlIGNlbGxzIHRyYW5zbWl0dGVkICovCisKKyAgICAvKioKKyAgICAqIEBpbmdyb3VwIEl4QXRtZEFjY1V0b3BpYUN0cmxBUEkKKyAgICAqIEBzdHJ1Y3QgVXRUeENlbGxDb25kaXRpb25TdGF0dXNfCisgICAgKiBAYnJpZWYgVXRvcGlhIFR4IFN0YXR1cyBSZWdpc3RlcgorICAgICovCisgICAgc3RydWN0IFV0VHhDZWxsQ29uZGl0aW9uU3RhdHVzXworICAgIHsKKworICAgIHVuc2lnbmVkIGludCByZXNlcnZlZF8xOjI7ICAgLyoqPCBbMzE6MzBdIFRoZXNlIGJpdHMgYXJlIGFsd2F5cyAwICovCisgICAgdW5zaWduZWQgaW50IHR4RklGTzJVbmRlcmZsb3c6MTsgLyoqPCBbMjldIFRoaXMgYml0IGlzIHNldCBpZiA2NC1ieXRlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBUcmFuc21pdCBGSUZPMiBpbmRpY2F0ZXMgYSBGSUZPIHVuZGVyZmxvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogZXJyb3IgY29uZGl0aW9uLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgdW5zaWduZWQgaW50IHR4RklGTzFVbmRlcmZsb3c6MTsgLyoqPCBbMjhdIFRoaXMgYml0IGlzIHNldCBpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogNjQtYnl0ZSBUcmFuc21pdCBGSUZPMSBpbmRpY2F0ZXMgYSBGSUZPCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiB1bmRlcmZsb3cgZXJyb3IgY29uZGl0aW9uLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgdW5zaWduZWQgaW50IHR4RklGTzJPdmVyZmxvdzoxOyAgLyoqPCBbMjddIFRoaXMgYml0IGlzIHNldCBpZiA2NC1ieXRlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBUcmFuc21pdCBGSUZPMiBpbmRpY2F0ZXMgYSBGSUZPIG92ZXJmbG93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBlcnJvciBjb25kaXRpb24uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICB1bnNpZ25lZCBpbnQgdHhGSUZPMU92ZXJmbG93OjE7IC8qKjwgWzI2XSBUaGlzIGJpdCBpcyBzZXQgaWYgNjQtYnl0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBUcmFuc21pdCBGSUZPMSBpbmRpY2F0ZXMgYSBGSUZPIG92ZXJmbG93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGVycm9yIGNvbmRpdGlvbi4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgdW5zaWduZWQgaW50IHR4SWRsZUNlbGxDb3VudE92cjoxOyAvKio8IFsyNV0gVGhpcyBiaXQgaXMgc2V0IGlmIHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBUeElkbGVDZWxsQ291bnQgcmVnaXN0ZXIgb3ZlcmZsb3dzLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICB1bnNpZ25lZCBpbnQgdHhDZWxsQ291bnRPdnI6MTsgLyoqPCBbMjRdIFRoaXMgYml0IGlzIHNldCBpZiB0aGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBUeENlbGxDb3VudCByZWdpc3RlciBvdmVyZmxvd3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICB1bnNpZ25lZCBpbnQgcmVzZXJ2ZWRfMjoyNDsgICAgLyoqPCBbMjM6MF0gVGhlc2UgYml0cyBhcmUgYWx3YXlzIDAgKi8KKyAgICB9IHV0VHhDZWxsQ29uZGl0aW9uU3RhdHVzOyAgICAvKio8IFR4IGNlbGxzIGNvbmRpdGlvbiBzdGF0dXMgKi8KKworICAgIHVuc2lnbmVkIGludCB1dFJ4Q2VsbENvdW50OyAvKio8IGNvdW50IG9mIGNlbGwgcmVjZWl2ZWQgKi8KKyAgICB1bnNpZ25lZCBpbnQgdXRSeElkbGVDZWxsQ291bnQ7ICAgIC8qKjwgY291bnQgb2YgaWRsZSBjZWxsIHJlY2VpdmVkICovCisgICAgdW5zaWduZWQgaW50IHV0UnhJbnZhbGlkSEVDb3VudDsgICAgIC8qKjwgY291bnQgb2YgaW52YWxpZCBjZWxsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiByZWNlaXZlZCBiZWNhdXNlIG9mIEhFQyBlcnJvcnMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgIHVuc2lnbmVkIGludCB1dFJ4SW52YWxpZFBhckNvdW50OyAgLyoqPCBjb3VudCBvZiBpbnZhbGlkIGNlbGwgcmVjZWl2ZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGJlY2F1c2Ugb2YgcGFyaXR5IGVycm9ycworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgdW5zaWduZWQgaW50IHV0UnhJbnZhbGlkU2l6ZUNvdW50OyAgLyoqPCBjb3VudCBvZiBpbnZhbGlkIGNlbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHJlY2VpdmVkIGJlY2F1c2Ugb2YgY2VsbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogc2l6ZSBlcnJvcnMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworCisgICAgLyoqCisgICAgKiBAaW5ncm91cCBJeEF0bWRBY2NVdG9waWFDdHJsQVBJCisgICAgKiBAc3RydWN0IFV0UnhDZWxsQ29uZGl0aW9uU3RhdHVzXworICAgICogQGJyaWVmIFV0b3BpYSBSeCBTdGF0dXMgUmVnaXN0ZXIKKyAgICAqLworICAgIHN0cnVjdCBVdFJ4Q2VsbENvbmRpdGlvblN0YXR1c18KKyAgICB7CisKKyAgICB1bnNpZ25lZCBpbnQgcmVzZXJ2ZWRfMTozOyAgLyoqPCBbMzE6MjldIFRoZXNlIGJpdHMgYXJlIGFsd2F5cyAwLiovCisgICAgdW5zaWduZWQgaW50IHJ4Q2VsbENvdW50T3ZyOjE7ICAgICAgLyoqPCBbMjhdIFRoaXMgYml0IGlzIHNldCBpZiB0aGUgUnhDZWxsQ291bnQgcmVnaXN0ZXIgb3ZlcmZsb3dzLiAqLworICAgIHVuc2lnbmVkIGludCBpbnZhbGlkSGVjQ291bnRPdnI6MTsgICAgLyoqPCBbMjddIFRoaXMgYml0IGlzIHNldCBpZiB0aGUgSW52YWxpZEhlY0NvdW50IHJlZ2lzdGVyIG92ZXJmbG93cy4qLworICAgIHVuc2lnbmVkIGludCBpbnZhbGlkUGFyQ291bnRPdnI6MTsgICAgLyoqPCBbMjZdIFRoaXMgYml0IGlzIHNldCBpZiB0aGUgSW52YWxpZFBhckNvdW50IHJlZ2lzdGVyIG92ZXJ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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGluZGljYXRlcyBhIEZJRk8gb3ZlcmZsb3cgZXJyb3IgY29uZGl0aW9uLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgdW5zaWduZWQgaW50IHJ4RklGTzFPdmVyZmxvdzoxOyAgICAvKio8IFsxNl0gVGhpcyBiaXQgaXMgc2V0IGlmIDY0LWJ5dGUgUmVjZWl2ZSBGSUZPMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBpbmRpY2F0ZXMgYSBGSUZPIG92ZXJmbG93IGVycm9yIGNvbmRpdGlvbi4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgdW5zaWduZWQgaW50IHJlc2VydmVkXzM6MTY7ICAgICAgLyoqPCBbMTU6MF0gVGhlc2UgYml0cyBhcmUgYWx3YXlzIDAuICovCisgICAgfSB1dFJ4Q2VsbENvbmRpdGlvblN0YXR1czsgICAgLyoqPCBSeCBjZWxscyBjb25kaXRpb24gc3RhdHVzICovCisKK30gSXhBdG1kQWNjVXRvcGlhU3RhdHVzOworCisvKioKKyAqIEB9IGRlZmdyb3VwIEl4QXRtZEFjY1V0b3BpYUN0cmxBUEkKKyAqLworCisgLyoqCisgKgorICogQGluZ3JvdXAgSXhBdG1kQWNjQ3RybEFQSQorICoKKyAqIEBmbiBpeEF0bWRBY2NVdG9waWFDb25maWdTZXQgKGNvbnN0IEl4QXRtZEFjY1V0b3BpYUNvbmZpZyAqCisgICAgICAgICAgICAgICAgICAgICAgICBpeEF0bWRBY2NVdG9waWFDb25maWdQdHIpCisgKgorICogQGJyaWVmIFNlbmQgdGhlIGNvbmZpZ3VyYXRpb24gc3RydWN0dXJlIHRvIHRoZSBVdG9waWEgaW50ZXJmYWNlCisgKgorICogVGhpcyBmdW5jdGlvbiBkb3dubG9hZHMgdGhlIEBhIEl4QXRtZEFjY1V0b3BpYUNvbmZpZyB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ybiBJeEV0aEFjY1N0YXR1cworICogQGxpIEBhIElYX0VUSF9BQ0NfU1VDQ0VTUzogaWYgdGhlIGV0aGVybmV0IHBvcnQgaXMgbm90IHByZXNlbnQsIGEgd2FybmluZyBpcyBpc3N1ZWQuCisgKiBAbGkgQGEgSVhfRVRIX0FDQ19GQUlMIDogVGhlIE5QRSBwcm9jZXNzb3IgaGFzIGZhaWxlZCB0byBpbml0aWFsaXplLgorICogQGxpIEBhIElYX0VUSF9BQ0NfSU5WQUxJRF9QT1JUIDogcG9ydElkIGlzIGludmFsaWQuCisgKgorICogPGhyPgorICovCitQVUJMSUMgSXhFdGhBY2NTdGF0dXMgaXhFdGhBY2NQb3J0SW5pdChJeEV0aEFjY1BvcnRJZCBwb3J0SWQpOworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisKKyAjIyMjIyAgICAgIyMgICAgICMjIyMjICAgICMjICAgICAgICAgICAgIyMjIyMgICAgICMjICAgICAjIyMjIyAgIyAgICAjCisgIyAgICAjICAgIyAgIyAgICAgICMgICAgICMgICMgICAgICAgICAgICMgICAgIyAgICMgICMgICAgICAjICAgICMgICAgIworICMgICAgIyAgIyAgICAjICAgICAjICAgICMgICAgIyAgICAgICAgICAjICAgICMgICMgICAgIyAgICAgIyAgICAjIyMjIyMKKyAjICAgICMgICMjIyMjIyAgICAgIyAgICAjIyMjIyMgICAgICAgICAgIyMjIyMgICAjIyMjIyMgICAgICMgICAgIyAgICAjCisgIyAgICAjICAjICAgICMgICAgICMgICAgIyAgICAjICAgICAgICAgICMgICAgICAgIyAgICAjICAgICAjICAgICMgICAgIworICMjIyMjICAgIyAgICAjICAgICAjICAgICMgICAgIyAgICAgICAgICAjICAgICAgICMgICAgIyAgICAgIyAgICAjICAgICMKKworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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HRoZW0gdXAgdG8gdGhlIHByZXZpb3VzIDY0IGJ5dGVzIGJvdW5kYXJ5LiBUaGUgdXNlciBoYXMgdG8gYmUgYXdhcmUgCisgKiB0aGF0IHRoZSBsZW5ndGggb2YgdGhlIHJlY2VpdmVkIG1idWZzIG1heSBiZSBzbWFsbGVyIHRoYW4gdGhlIGxlbmd0aAorICogb2YgdGhlIHN1cHBsaWVkIG1idWZzLgorICoKKyAqIEB3YXJuaW5nIFRoaXMgZnVuY3Rpb24gY2hlY2tzIHRoZSBwYXJhbWV0ZXJzIGlmIHRoZSBOREVCVUcgCisgKiBmbGFnIGlzIG5vdCBkZWZpbmVkLiBUdXJuaW5nIG9uIHRoZSBhcmd1bWVudCBjaGVja2luZyAoZGlzYWJsZWQgYnkgCisgKiBkZWZhdWx0KSByZXN1bHRzIGluIGEgbG93ZXIgRXRoQWNjIHBlcmZvcm1hbmNlIGFzIHRoaXMgZnVuY3Rpb24KKyAqIGlzIHBhcnQgb2YgdGhlIGRhdGEgcGF0aC4KKyAqCisgKiA8aHI+CisgKi8KK1BVQkxJQyBJeEV0aEFjY1N0YXR1cworaXhFdGhBY2NQb3J0UnhGcmVlUmVwbGVuaXNoKCBJeEV0aEFjY1BvcnRJZCBwb3J0SWQsIElYX09TQUxfTUJVRiAqYnVmZmVyKTsKKworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKworICAjIyMjICAgICMjIyMgICAjICAgICMgICAjIyMjIyAgIyMjIyMgICAgIyMjIyAgICMKKyAjICAgICMgICMgICAgIyAgIyMgICAjICAgICAjICAgICMgICAgIyAgIyAgICAjICAjCisgIyAgICAgICAjICAgICMgICMgIyAgIyAgICAgIyAgICAjICAgICMgICMgICAgIyAgIworICMgICAgICAgIyAgICAjICAjICAjICMgICAgICMgICAgIyMjIyMgICAjICAgICMgICMKKyAjICAgICMgICMgICAgIyAgIyAgICMjICAgICAjICAgICMgICAjICAgIyAgICAjICAjCisgICMjIyMgICAgIyMjIyAgICMgICAgIyAgICAgIyAgICAjICAgICMgICAjIyMjICAgIyMjIyMjCisKKworICAgICAgICAgIyMjIyMgICAjICAgICAgICAgIyMgICAgIyAgICAjICAjIyMjIyMKKyAgICAgICAgICMgICAgIyAgIyAgICAgICAgIyAgIyAgICMjICAgIyAgIworICAgICAgICAgIyAgICAjICAjICAgICAgICMgICAgIyAgIyAjICAjICAjIyMjIworICAgICAgICAgIyMjIyMgICAjICAgICAgICMjIyMjIyAgIyAgIyAjICAjCisgICAgICAgICAjICAgICAgICMgICAgICAgIyAgICAjICAjICAgIyMgICMKKyAgICAgICAgICMgICAgICAgIyMjIyMjICAjICAgICMgICMgICAgIyAgIyMjIyMjCisKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyoqCisgKiBAaW5ncm91cCBJeEV0aEFjYworICoKKyAqIEBmbiBpeEV0aEFjY1BvcnRFbmFibGUoSXhFdGhBY2NQb3J0SWQgcG9ydElkKQorICoKKyAqIEBicmllZiBUaGlzIGVuYWJsZXMgYW4gRXRoZXJuZXQgcG9ydCBmb3IgYm90aCBUeCBhbmQgUnguIAorICoKKyAqIEBsaSBSZWVudHJhbnQgICAgLSB5ZXMKKyAqIEBsaSBJU1IgQ2FsbGFibGUgLSBubworICoKKyAqIEBwcmUgVGhlIHBvcnQgbXVzdCBmaXJzdCBiZSBpbml0aWFsaXplZCB2aWEgQGEgaXhFdGhBY2NQb3J0SW5pdCBhbmQgdGhlIE1BQyBhZGRyZXNzIAorICogbXVzdCBiZSBzZXQgdXNpbmcgQGEgaXhFdGhBY2NVbmljYXN0TWFjQWRkcmVzc1NldCBiZWZvcmUgZW5hYmxpbmcgaXQKKyAqIFRoZSByeCBhbmQgVHggRG9uZSBjYWxsYmFja3MgcmVnaXN0cmF0aW9uIHZpYSBAYQorICogaXhFdGhBY2NQb3J0VHhEb25lQ2FsbGJhY2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U3RhdHVzCisgKiBAbGkgQGEgSVhfRVRIX0FDQ19TVUNDRVNTIDogTUFDIGNvcmUgcmVzZXQKKyAqIEBsaSBAYSBJWF9FVEhfQUNDX0ZBSUwgOiBJbnZhbGlkIHBvcnQgb3IgRXRoZXJuZXQgc2VydmljZSBub3QgaW5pdGlhbGl6ZWQKKyAqCisgKiA8aHI+CisgKi8KK1BVQkxJQyBJeEV0aEFjY1N0YXR1cyAKK2l4RXRoQWNjUG9ydE1hY1Jlc2V0KEl4RXRoQWNjUG9ydElkIHBvcnRJZCk7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgIyMjIyAgICAjIyMjIyAgICAjIyAgICAgIyMjIyMgICAgICMgICAgICMjIyMgICAgIyMjIyMgICAgICMgICAgICMjIyMgICAgIyMjIworICMgICAgICAgICAgIyAgICAgIyAgIyAgICAgICMgICAgICAgIyAgICAjICAgICAgICAgICMgICAgICAgIyAgICAjICAgICMgICMKKyAgIyMjIyAgICAgICMgICAgIyAgICAjICAgICAjICAgICAgICMgICAgICMjIyMgICAgICAjICAgICAgICMgICAgIyAgICAgICAgIyMjIworICAgICAgIyAgICAgIyAgICAjIyMjIyMgICAgICMgICAgICAgIyAgICAgICAgICMgICAgICMgICAgICAgIyAgICAjICAgICAgICAgICAgIworICMgICAgIyAgICAgIyAgICAjICAgICMgICAgICMgICAgICAgIyAgICAjICAgICMgICAgICMgICAgICAgIyAgICAjICAgICMgICMgICAgIworICAjIyMjICAgICAgIyAgICAjICAgICMgICAgICMgICAgICAgIyAgICAgIyMjIyAgICAgICMgICAgICAgIyAgICAgIyMjIyAgICAjIyMjCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisKKy8qKgorICoKKyAqIEBicmllZiBUaGlzIHN0cnVjdCBkZWZ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RlckRpc2NhcmRzOyAgICAgICAgICAgICAgLyoqPCBOUEU6IGRpc2NhcmRlZCBmcmFtZXMgY291bnQgKHJ4KSAqLworICAgIFVJTlQzMiBSeFZMQU5JZEZpbHRlckRpc2NhcmRzOyAgICAgICAgICAgICAgICAvKio8IE5QRTogZGlzY2FyZGVkIGZyYW1lcyBjb3VudCAocngpICovCisgICAgVUlOVDMyIFJ4SW52YWxpZFNvdXJjZURpc2NhcmRzOyAgICAgICAgICAgICAgIC8qKjwgTlBFOiBkaXNjYXJkZWQgZnJhbWVzIGNvdW50IChyeCkgKi8KKyAgICBVSU5UMzIgUnhCbGFja0xpc3REaXNjYXJkczsgICAgICAgICAgICAgICAgICAgLyoqPCBOUEU6IGRpc2NhcmRlZCBmcmFtZXMgY291bnQgKHJ4KSAqLworICAgIFVJTlQzMiBSeFdoaXRlTGlzdERpc2NhcmRzOyAgICAgICAgICAgICAgICAgICAvKio8IE5QRTogZGlzY2FyZGVkIGZyYW1lcyBjb3VudCAocngpICovCisgICAgVUlOVDMyIFJ4VW5kZXJmbG93RW50cnlEaXNjYXJkczsgICAgICAgICAgICAgIC8qKjwgTlBFOiBkaXNjYXJkZWQgZnJhbWVzIGNvdW50IChyeCkgKi8KKyAgICBVSU5UMzIgZG90M1N0YXRzU2luZ2xlQ29sbGlzaW9uRnJhbWVzOyAgICAgIC8qKjwgbGluayBlcnJvciBjb3VudCAodHgpICovCisgICAgVUlOVDMyIGRvdDNTdGF0c011bHRpcGxlQ29sbGlzaW9uRnJhbWVzOyAgICAvKio8IGxpbmsgZXJyb3IgY291bnQgKHR4KSAqLworICAgIFVJTlQzMiBkb3QzU3RhdHNEZWZlcnJlZFRyYW5zbWlzc2lvbnM7ICAgICAgLyoqPCBsaW5rIGVycm9yIGNvdW50ICh0eCkgKi8KKyAgICBVSU5UMzIgZG90M1N0YXRzTGF0ZUNvbGxpc2lvbnM7ICAgICAgICAgICAgIC8qKjwgbGluayBlcnJvciBjb3VudCAodHgpICovCisgICAg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worCisvKioKKyAqIEBpbmdyb3VwIEl4RXRoQWNjCisgKgorICogQGZuIGl4RXRoQWNjU3RhdHNTaG93KEl4RXRoQWNjUG9ydElkIHBvcnRJZCkKKyAqCisgKgorICogQGJyaWVmIERpc3BsYXlzIGEgcG9ydHMgc3RhdGlzdGljcyBvbiB0aGUgc3RhbmRhcmQgaW8gY29uc29sZSB1c2luZyBwcmludGYuCisgKgorICogQGxpIFJlZW50cmFudCAgICAtIG5vCisgKiBAbGkgSVNSIENhbGxhYmxlIC0gbm8KKyAqCisgKiBAcHJlCisgKgorICogQHBhcmFtIHBvcnRJZCBAcmVmIEl4RXRoQWNjUG9ydElkIFtpbl0KKyAqCisgKiBAcmV0dXJuIHZvaWQKKyAqCisgKiA8aHI+CisgKi8KK1BVQkxJQyB2b2lkIGl4RXRoQWNjU3RhdHNTaG93KEl4RXRoQWNjUG9ydElkIHBvcnRJZCk7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisKKyAjICAgICMgICAgICMgICAgICAgIyAgICAgICAgICAgICMgICAgIyAgIyMjIyMgICAgICAjICAgICAjIyMjCisgIyMgICMjICAgICAjICAgICAgICMgICAgICAgICAgICAjIyAgIyMgICMgICAgIyAgICAgIyAgICAjICAgICMKKyAjICMjICMgICAgICMgICAgICAgIyAgICAgICAgICAgICMgIyMgIyAgIyAgICAjICAgICAjICAgICMgICAgIworICMgICAgIyAgICAgIyAgICAgICAjICAgICAgICAgICAgIyAgICAjICAjICAgICMgICAgICMgICAgIyAgICAjCisgIyAgICAjICAgICAjICAgICAgICMgICAgICAgICAgICAjICAgICMgICMgICAgIyAgICAgIyAgICAjICAgICMKKyAjICAgICMgICAgICMgICAgICAgIyAgICAgICAgICAgICMgICAgIyAgIyMjIyMgICAgICAjICAgICAjIyMjCisKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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YWJhc2UgQVBJIHJldHVybiB2YWx1ZXMKKyAqLwordHlwZWRlZiBlbnVtIC8qIEl4RXRoREJTdGF0dXMgKi8KK3sKKyAgSVhfRVRIX0RCX1NVQ0NFU1MgPSBJWF9TVUNDRVNTLCAgIC8qKjwgU3VjY2VzcyAqLworICBJWF9FVEhfREJfRkFJTCA9IElYX0ZBSUwsICAgICAgICAgLyoqPCBGYWlsdXJlICovCisgIElYX0VUSF9EQl9JTlZBTElEX1BPUlQsICAgICAgICAgICAvKio8IEludmFsaWQgcG9ydCAqLworICBJWF9FVEhfREJfUE9SVF9VTklOSVRJQUxJWkVELCAgICAgLyoqPCBQb3J0IG5vdCBpbml0aWFsaXplZCAqLworICBJWF9FVEhfREJfTUFDX1VOSU5JVElBTElaRUQsICAgICAgLyoqPCBNQUMgbm90IGluaXRpYWxpemVkICovCisgIElYX0VUSF9EQl9JTlZBTElEX0FSRywgICAgICAgICAgICAvKio8IEludmFsaWQgYXJndW1lbnQgKi8KKyAgSVhfRVRIX0RCX05PX1NVQ0hfQUREUiwgICAgICAgICAgIC8qKjwgQWRkcmVzcyBub3QgZm91bmQgZm9yIHNlYXJjaCBvciBkZWxldGUgb3BlcmF0aW9ucyAqLworICBJWF9FVEhfREJfTk9NRU0sICAgICAgICAgICAgICAgICAgLyoqPCBMZWFybmluZyBkYXRhYmFzZSBtZW1vcnkgZnVsbCAqLworICBJWF9FVEhfREJfQlVTWSwgICAgICAgICAgICAgICAgICAgLyoqPCBMZWFybmluZyBkYXRhYmFzZSBjYW5ub3QgY29tcGxldGUgb3BlcmF0aW9uLCBhY2Nlc3MgdGVtcG9yYXJpbHkgYmxvY2tlZCAqLworICBJWF9FVEhfREJfRU5ELCAgICAgICAgICAgICAgICAgICAgLyoqPCBEYXRhYmFzZSBicm93c2VyIHBhc3NlZCB0aGUgZW5kIG9mIHRoZSByZWNvcmQgc2V0ICovCisgIElYX0VUSF9EQl9JTlZBTElEX1ZMQU4sICAgICAgICAgICAvKio8IEludmFs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NUID0gMHgxLCAgLyoqPCBGaXJld2FsbCBvcGVyYXRlcyBpbiB3aGl0ZS1saXN0IG1vZGUgKE1BQyBhZGRyZXNzIGJhc2VkIGFkbWlzc2lvbikgKi8KKyAgSVhfRVRIX0RCX0ZJUkVXQUxMX0JMQUNLX0xJU1QgPSAweDIgICAvKio8IEZpcmV3YWxsIG9wZXJhdGVzIGluIGJsYWNrLWxpc3QgbW9kZSAoTUFDIGFkZHJlc3MgYmFzZWQgYmxvY2tpbmcpICovCit9IEl4RXRoREJGaXJld2FsbE1vZGU7CisgIAordHlwZWRlZiBlbnVtCit7CisgIElYX0VUSF9EQl9GSUxURVJJTkdfUkVDT1JEICAgICAgICA9IDB4MDEsIC8qKjwgPHRhYmxlPjxjYXB0aW9uPiBGaWx0ZXJpbmcgcmVjb3JkIDwvY2FwdGlvbj4gCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqICAgICAgPHRyPjx0ZD4gTUFDIGFkZHJlc3MgPHRkPiBzdGF0aWMvZHluYW1pYyB0eXBlIDx0ZD4gYWdlIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiAgIDwvdGFibGU+IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgSVhfRVRIX0RCX0ZJTFRFUklOR19WTEFOX1JFQ09SRCAgID0gMHgwMiwgLyoqPCA8dGFibGU+PGNhcHRpb24+IFZMQU4tZW5hYmxlZCBmaWx0ZXJpbmcgcmVjb3JkIDwvY2FwdGlvbj4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogICAgICA8dHI+PHRkPiBNQUMgYWRkcmVzcyA8dGQ+IHN0YXRpYy9keW5hbWljIHR5cGUgPHRkPiBhZ2UgPHRkPiA4MDIuMVEgdGFnIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiAgIDwvdGFibGU+IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgSVhfRVRIX0RCX1dJRklfUkVDT1JEICAgICAgICAgICAgID0gMHgwNCwgLyoqPCA8dGFibGU+PGNhcHRpb24+IFdpRmkgaGVhZGVyIGNvbnZlcnNpb24gcmVjb3JkIDwvY2FwdGlvbj4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogICAgICA8dHI+PHRkPiBNQUMgYWRkcmVzcyA8dGQ+IG9wdGlvbmFsIGdhdGV3YXkgTUFDIGFkZHJlc3MgPHRkPiAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogICA8L3RhYmxlPgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgSVhfRVRIX0RCX0ZJUkVXQUxMX1JFQ09SRCAgICAgICAgID0gMHgwOCwgLyoqPCA8dGFibGU+PGNhcHRpb24+IEZpcmV3YWxsIHJlY29yZCA8L2NhcHRpb24+CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqICAgICAgPHRyPjx0ZD4gTUFDIGFkZHJlc3MgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqICAgPC90YWJsZT4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgIElYX0VUSF9EQl9HQVRFV0FZX1JFQ09SRCAgICAgICAgICA9IDB4MTAsIC8qKjwgPGk+Rm9yIGludGVybmFsIHVzZSBvbmx5PC9pPiAqLworICBJWF9FVEhfREJfTUFYX1JFQ09SRF9UWVBFX0lOREVYICAgPSAweDEwLCAvKio8IDxpPkZvciBpbnRlcm5hbCB1c2Ugb25seTwvaT4gKi8KKyAgSVhfRVRIX0RCX05PX1JFQ09SRF9UWVBFICAgICAgICAgID0gMCwgICAgLyoqPCBOb25lIG9mIHRoZS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oZWFkZXIgY29udmVyc2lvbiByZWNvcmQgPC9jYXB0aW9uPgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dHI+PHRkPiBNQUMgYWRkcmVzcyA8dGQ+IG9wdGlvbmFsIGdhdGV3YXkgTUFDIGFkZHJlc3MgPHRkPiA8L3RyPgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RhYmxlPgorICoKKyAqICAgIC0gSVhfRVRIX0RCX0ZJUkVXQUxMX1JFQ09SRCAgICAgICA8dGFibGU+PGNhcHRpb24+IEZpcmV3YWxsIHJlY29yZCA8L2NhcHRpb24+CisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0cj48dGQ+IE1BQyBhZGRyZXNzIDwvdHI+CisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvdGFibGU+CisgKiAgICAtIElYX0VUSF9EQl9BTExfUkVDT1JEX1RZUEVTCisgKiAKKyAqIEFueSBjb21iaW5hdGlvbiBvZiB0aGUgYWJvdmUgdHlwZXMgaXMgdmFsaWQgZS5nLiAKKyAqCisgKiAgICAoSVhfRVRIX0RCX0ZJTFRFUklOR19SRUNPUkQgfCBJWF9FVEhfREJfRklMVEVSSU5HX1ZMQU5fUkVDT1JEIHwgSVhfRVRIX0RCX0ZJUkVXQUxMX1JFQ09SRCksIAorICoKKyAqIGFsdGhvdWdoIHNvbWUgbWlnaHQgYmUgcmVkdW5kYW50IChpdCBpcyBub3QgYW4gZXJyb3IgdG8gZG8gc28pIGUuZy4KKyAqCisgKiAgICAoSVhfRVRIX0RCX0ZJTFRFUklOR19SRUNPUkQgfCBJWF9FVEhfREJfQUxMX1JFQ09SRF9UWVBFUykKKyAqCisgKiBAcGFyYW0gcG9ydElEIEByZWYgSXhFdGhEQlBvcnRJZCBbaW5dIC0gSUQgb2YgdGhlIHBvcnQKKyAqIEB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2RlZmluZSBJTklUX1NUQUNLKHN0YWNrKSBcCisgICAgeyBcCisgICAgICAgIChzdGFjayktPmJhc2VQb2ludGVyICA9IDA7IFwKKyAgICAgICAgKHN0YWNrKS0+c3RhY2tQb2ludGVyID0gMDsgXAorICAgIH0KKworI2RlZmluZSBQVVNIX0xPQ0soc3RhY2ssIGxvY2spIFwKKyAgICB7IFwKKyAgICAgICAgaWYgKChzdGFjayktPnN0YWNrUG9pbnRlciA9PSBNQVhfTE9DS1MpIFwKKyAgICAgICAgeyBcCisgICAgICAgICAgICBFUlJPUl9MT0coIkV0aGVybmV0IERCOiBtYXhpbXVtIG51bWJlciBvZiBlbGVtZW50cyBpbiBhIGxvY2sgc3RhY2sgaGFzIGJlZW4gZXhjZWVkZWQgb24gcHVzaCwgaGVhdnkgY2hhaW5pbmc/XG4iKTsgXAorICAgICAgICAgICAgVU5ST0xMX1NUQUNLKHN0YWNrKTsgXAorICAgICAgICAgICAgXAorICAgICAgICAgICAgcmV0dXJuIElYX0VUSF9EQl9OT01FTTsgXAorICAgICAgICB9IFwKKyAgICAgICAgXAorICAgICAgICBpZiAoaXhPc2FsRmFzdE11dGV4VHJ5TG9jayhsb2NrKSA9PSBJWF9TVUNDRVNTKSBcCisgICAgICAgIHsgXAorICAgICAgICAgICAgKHN0YWNrKS0+bG9ja3NbKHN0YWNrKS0+c3RhY2tQb2ludGVyKytdID0gKGxvY2spOyBcCisgICAgICAgIH0gXAorICAgICAgICBlbHNlIFwKKyAgICAgICAgeyBcCisgICAgICAgICAgICBVTlJPTExfU1RBQ0soc3RhY2spOyBcCisgICAgICAgICAgICBcCisgICAgICAgICAgICByZXR1cm4gSVhfRVRIX0RCX0JVU1k7IFwKKyAgICAgICAgfSBcCisgICAgfQorCisjZGVmaW5lIFBPUF9MT0NLKHN0YWNrKSBcCisgICAgeyBcCisgICAgICAgIGl4T3NhbEZhc3RNdXRleFVubG9jaygoc3RhY2spLT5sb2Nrc1stLShzdGFjayktPnN0YWNrUG9pb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QUJJTElUWSwgV0hFVEhFUiBJTiBDT05UUkFDVCwgU1RSSUNUCisgKiBMSUFCSUxJVFksIE9SIFRPUlQgKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZCisgKiBPVVQgT0YgVEhFIFVTRSBPRiBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFIFBPU1NJQklMSVRZIE9GCisgKiBTVUNIIERBTUFHRS4KKyAqIAorICogQHBhcgorICogLS0gRW5kIG9mIENvcHlyaWdodCBOb3RpY2UgLS0KKyAqLworCisjaW5jbHVkZSA8SXhPc2FsLmg+CisKKyNpZmRlZiBJWF9VTklUX1RFU1QKKyNkZWZpbmUgTlVMTF9QUklOVF9ST1VUSU5FKGZvcm1hdCwgYXJnLi4uKSAvKiBub3RoaW5nICovCisjZWxzZQorI2RlZmluZSBOVUxMX1BSSU5UX1JPVVRJTkUgaWYoMCkgcHJpbnRmCisjZW5kaWYKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogICAgICAgICAgICAgICAgIEdsb2JhbHMgICAgICAgICAgICAgICAgICAgICAgICAgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qIHNhZmUgdG8gcGVybWFuZW50bHkgbGVhdmUgdGhlc2Ugb24gKi8KKyNkZWZpbmUgSEFTX0VSUk9SX0xPRworI2RlZmluZSBIQVNfRVJST1JfSVJRX0xPRworI2RlZmluZSBIQVNfV0FSTklOR19MT0cKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogICAgICAgICAgICAgIExvZyBDb25maWd1cmF0aW9uICAgICAgICAgICAgICAgICAgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyogZGVidWcgb3V0cHV0IGNhbiBiZSB0dXJuZWQgb24gdW5sZXNzIHNwZWNpZmljYWxseQorICAgZGVjbGFyZWQgYXMgYSBub24tZGVidWcgYnVpbGQgKi8KKyNpZm5kZWYgTkRFQlVHCisKKyN1bmRlZiBIQVNfRVZFTlRTX1RSQUNFCisjdW5kZWYgSEFTX0VWRU5UU19WRVJCT1NFX1RSQUNFCisKKyN1bmRlZiBIQVNfU1VQUE9SVF9UUkFDRQorI3VuZGVmIEhBU19TVVBQT1JUX1ZFUkJPU0VfVFJBQ0UKKworI3VuZGVmIEhBU19OUEVfVFJBQ0UKKyN1bmRlZiBIQVNfTlBFX1ZFUkJPU0VfVFJBQ0UKKyN1bmRlZiBIQVNfRFVNUF9OUEVfVFJFRQorCisjdW5kZWYgSEFTX1VQREFURV9UUkFDRQorI3VuZGVmIEhBU19VUERBVEVfVkVSQk9TRV9UUkFDRQorCisjZW5kaWYgLyogTkRFQlVHICovCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogICAgICAgICAgICAgIExvZyBNYWNyb3MgICAgICAgICAgICAgICAgICAgICAgICAgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyoqKioqKioqKioqKioqIEdsb2JhbHMgKioqKioqKioqKioqKioqKioqLworCisjaWZkZWYgSEFTX0VSUk9SX0xPRworCisgICAgI2RlZmluZSBFUlJPUl9MT0cgcHJpbnRmCisKKyNlbHNlCisKKyAgICAjZGVmaW5lIEVSUk9SX0xPRyBOVUxMX1BSSU5UX1JPVVRJTkUKKworI2VuZGlmCisKKyNpZmRlZiBIQVNfRVJST1JfSVJRX0xPRworCisgICAgI2RlZmluZSBFUlJPUl9JUlFfTE9HKGZvcm1hdCwgYXJnMSwgYXJnMiwgYXJnMywgYXJnNCwgYXJnNSwgYXJnNikgaXhPc2FsTG9nKElYX09TQUxfTE9HX0xWTF9FUlJPUiwgSVhfT1NBTF9MT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AgIHwgY2xhc3NJbmRleDsgXAorICAgICAgICBcCisgICAgICAgIG1lc3NhZ2UuZGF0YVsxXSA9IHRyYWZmaWNDbGFzcyA8PCAyNCBcCisgICAgICAgICAgICB8IDB4MSA8PCAyMyBcCisgICAgICAgICAgICB8IGFxbVF1ZXVlIDw8IDE2IFwKKyAgICAgICAgICAgIHwgYXFtUXVldWUgPDwgNDsgXAorICAgIH0gd2hpbGUgKDApOworCisjZGVmaW5lIEZJTExfU0VUUE9SVElERVhUUkFDVElPTk1PREUobWVzc2FnZSwgcG9ydElELCBlbmFibGUpIFwKKyAgICBkbyB7IFwKKyAgICAgICAgbWVzc2FnZS5kYXRhWzBdID0gSVhfRVRITlBFX1ZMQU5fU0VUUE9SVElERVhUUkFDVElPTk1PREUgPDwgMjQgXAorICAgICAgICAgICAgfCBwb3J0SUQgPDwgMTYgXAorICAgICAgICAgICAgfCAoZW5hYmxlID8gMHgxIDogMHgwKTsgXAorICAgICAgICBcCisgICAgICAgIG1lc3NhZ2UuZGF0YVsxXSA9IDA7IFwKKyAgICB9IHdoaWxlICgwKTsKKworCisjZGVmaW5lIEZJTExfU0VUQkxPQ0tJTkdTVEFURV9NU0cobWVzc2FnZSwgcG9ydElELCBibG9ja2VkKSBcCisgICAgZG8geyBcCisgICAgICAgIG1lc3NhZ2UuZGF0YVswXSA9IElYX0VUSE5QRV9TVFBfU0VUQkxPQ0tJTkdTVEFURSA8PCAyNCBcCisgICAgICAgICAgICB8IHBvcnRJRCA8PCAxNiBcCisgICAgICAgICAgICB8IChibG9ja2VkID8gMHgxIDogMHgwKTsgXAorICAgICAgICBcCisgICAgICAgIG1lc3NhZ2UuZGF0YVsxXSA9IDA7IFwKKyAgICB9IHdoaWxlICgwKTsKKworI2RlZmluZSBGSUxMX1NFVEJCU0lEX01TRyhtZXNzYWdlLCBwb3J0SUQsIGJic2lkKSBcCisgICAgZG8geyBcCisgICAgICAgIG1lc3NhZ2UuZGF0YVswXSA9IElYX0VUSE5QRV9QQ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ICAgNCwgICAgICAgICAgICAgICAgICAgIDAgfSwgLyogZGVmYXVsdCBjYXNlIC0gRE8gTk9UIFJFTU9WRSAqLworICAgIHsgICAgICAgICAgICAweDA0LCAgICAgICAgICAgICAgICAgICAgICA0LCAgICAgICAgICAgICAgICAgICAgMSB9LCAvKiBOUEUgQSBpbWFnZSBJRCAwLjQuMC4wICovCisgICAgeyAgICAgICAgICAgIDB4MDksICAgICAgICAgICAgICAgICAgICAgIDMsICAgICAgICAgICAgICAgICAgICAyIH0sIC8qIE5QRSBBIGltYWdlIElEIDAuOS4wLjAgKi8KKyAgICB7ICAgICAgICAgICAgMHg4MCwgICAgICAgICAgICAgICAgICAgICAgOCwgICAgICAgICAgICAgICAgICAgIDMgfSwgLyogTlBFIEEgaW1hZ2UgSUQgMTAuODAuMDIuMCAqLworICAgIHsgICAgICAgICAgICAweDgxLCAgICAgICAgICAgICAgICAgICAgICA4LCAgICAgICAgICAgICAgICAgICAgMyB9LCAvKiBOUEUgQSBpbWFnZSBJRCAxMC44MS4wMi4wICovCisgICAgeyAgICAgICAgICAgIDB4ODIsICAgICAgICAgICAgICAgICAgICAgIDgsICAgICAgICAgICAgICAgICAgICAzIH0gIC8qIE5QRSBBIGltYWdlIElEIDEwLjgyLjAyLjAgKi8KK307CisKKy8qKgorICogQGJyaWVmIElFRUUgODAyLjFRIHJlY29tbWVuZGVkIFFvUyBQcmlvcml0eSA9PiB0cmFmZmljIGNsYXNzIG1hcHMKKyAqCisgKiBAdmVyYmF0aW0KKyAgICAgICAgICAgICAgICAgICAgTnVtYmVyIG9mIGF2YWlsYWJsZSB0cmFmZmljIGNsYXNzZXMKKyAgICAgICAgICAgICAgICAgICAgMSAyIDMgNCA1IDYgNyA4CisgICAgUW9TIFByaW9yaXR5CisgICAgICAgIDAgICAgICAgICAgIDAgMCAwIDEgMSAxIDEgMgorICAgICAgICAxICAgICAgICAgICAwIDAgMCAwIDAgMCAwIDAKKyAgICAgICAgMiAgICAgICAgICAgMCAwIDA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EVfTElORV9TSVpFKS9zaXplb2Yodm9pZCAqKSkKKworI2RlZmluZSBJWF9FVEhEQl9CVUNLRVRfSU5ERVhfTUFTSyAgICgoKElYX09TQUxfQ0FDSEVfTElORV9TSVpFKS9zaXplb2Yodm9pZCAqKSkgLSAxKQorCisvKiBsb2NrcyAqLworI2RlZmluZSBNQVhfTE9DS1MgKDIwKSAvKio8IG1heGltdW0gbnVtYmVyIG9mIGxvY2tzIHVzZWQgc2ltdWx0YW5lb3VzbHksIGRvIG5vdCB0YW1wZXIgd2l0aCAqLworCisvKiBsZWFybmluZyB0cmVlIGNvbnN0YW50cyAqLworI2RlZmluZSBJTklUSUFMX0VMVF9TSVpFICAgICg4KSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qKjwgaW5pdGlhbCBieXRlIHNpemUgb2YgdHJlZSAoZW1wdHkgdW51c2VkIHJvb3Qgc2l6ZSkgKi8KKyNkZWZpbmUgTUFYX0VMVF9TSVpFICAgICAgICAoNTEyKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKio8IG1heGltdW0gbnVtYmVyIG9mIGVudHJpZXMgKGluY2x1ZGVzIHVudXNlZCByb290KSAqLworI2RlZmluZSBNQVhfR1dfU0laRSAgICAgICAgICgzMikgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qKjwgbWF4aW11bSBudW1iZXIgb2YgZ2F0ZXdheSBlbnRyaWVzIChpbmNsdWRpbmcgdW51c2VkIHJvb3QpICovCisjZGVmaW5lIE1BWF9GV19TSVpFICAgICAgICAgKDMyKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyoqPCBtYXhpbXVtIG51bWJlciBvZiBmaXJld2FsbCBlbnRyaWVzIChpbmNsdWRpbmcgdW51c2VkIHJvb3QpICovCisjZGVmaW5lIEVMVF9FTlRSWV9TSVpFICAgICAgKDgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyoqPCBlbnRyeSBzaXplLCBpbiBieXRlcyAqLworI2RlZmluZSBF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pIDw8IChsbykpCisKKy8qKgorICogQGRlZiBCSVRTKHgsaGksbG8pCisgKgorICogQGJyaWVmIE1hY3JvIGZvciBiaXRzCisgKi8KKyNkZWZpbmUgQklUUyh4LGhpLGxvKSAgICAgICAgICAgICAgICAgICgoKHgpICYgTUFTSyhoaSxsbykpID4+IChsbykpCisKKy8qKgorICogQGRlZiBJWF9FVEhOUEVfUU1fUV9SWEVORVRfTEVOR1RIX01BU0sKKyAqCisgKiBAYnJpZWYgUU1nciBRdWV1ZSBMRU5HVEggZmllbGQgbWFzaworICovCisjZGVmaW5lIElYX0VUSE5QRV9RTV9RX1JYRU5FVF9MRU5HVEhfTUFTSyAgIDB4M2ZmZgorCisvKioKKyAqIEBkZWYgSVhfRVRITlBFX1FNX1FfRklFTERfRkxBR19SCisgKgorICogQGJyaWVmIFFNZ3IgUXVldWUgRkxBRyBmaWVsZCByaWdodCBib3VuZGFyeQorICovCisjZGVmaW5lIElYX0VUSE5QRV9RTV9RX0ZJRUxEX0ZMQUdfUiAgICAgICAgICAgICAyMAorCisvKioKKyAqIEBkZWYgSVhfRVRITlBFX1FNX1FfRklFTERfRkxBR19NQVNLCisgKgorICogQGJyaWVmIFFNZ3IgUXVldWUgRkxBRyBmaWVsZCBtYXNrCisgKgorICogTXVsdGljYXN0IGJpdCA6IEJJVCg0KQorICogQnJvYWRjYXN0IGJpdCA6IEJJVCg1KQorICogSVAgYml0ICAgICAgICA6IEJJVCg2KSAobGludXggb25seSkKKyAqCisgKi8KKyNpZmRlZiBfX3Z4d29ya3MKKyNkZWZpbmUgSVhfRVRITlBFX1FNX1FfRklFTERfRkxBR19NQVNLICAgICAgICAgICAweDMwCisjZWxzZQorI2RlZmluZSBJWF9FVEhOUEVfUU1fUV9GSUVMRF9GTEFHX01BU0sgICAgICAgICAgIDB4NzAKKyNlbmRpZgorCisKKy8qKgorICogQGRlZiBJWF9FVEhOUEVfUU1fUV9GSUVMRF9OUEVJRF9MCisgKgorICogQGJyaWVmIFFNZ3IgUXVldWUgTlBFIElEIGZpZWxkIGxlZnQgYm91bmRhcnkKKyAqLworI2RlZmluZSBJWF9FVEhOUEVfUU1fUV9GSUVMRF9OUEVJRF9MICAgICAgICAgICAgMQorCisvKioKKyAqIEBkZWYgSVhfRVRITlBFX1FNX1FfRklFTERfTlBFSURfUgorICoKKyAqIEBicmllZiBRTWdyIFF1ZXVlIE5QRSBJRCBmaWVsZCByaWdodCBib3VuZGFyeQorICovCisjZGVmaW5lIElYX0VUSE5QRV9RTV9RX0ZJRUxEX05QRUlEX1IgICAgICAgICAgICAwCisKKy8qKgorICogQGRlZiBJWF9FVEhOUEVfUU1fUV9GSUVMRF9QUklPUl9MCisgKgorICogQGJyaWVmIFFNZ3IgUXVldWUgUHJpb3JpdHkgZmllbGQgbGVmdCBib3VuZGFyeQorICovCisjZGVmaW5lIElYX0VUSE5QRV9RTV9RX0ZJRUxEX1BSSU9SX0wgICAgICAgICAgICAyCisKKy8qKgorICogQGRlZiBJWF9FVEhOUEVfUU1fUV9GSUVMRF9QUklPUl9SCisgKgorICogQGJyaWVmIFFNZ3IgUXVldWUgUHJpb3JpdHkgZmllbGQgcmlnaHQgYm91bmRhcnkKKyAqLworI2RlZmluZSBJWF9FVEhOUEVfUU1fUV9GSUVMRF9QUklPUl9SICAgICAgICAgICAgMAorCisvKioKKyAqIEBkZWYgSVhfRVRITlBFX1FNX1FfRklFTERfQUREUl9MIAorICoKKyAqIEBicmllZiBRTWdyIFF1ZXVlIEFkZHJlc3MgZmllbGQgbGVmdCBib3VuZGFyeQorICovCisjZGVmaW5lIElYX0VUSE5QRV9RTV9RX0ZJRUxEX0FERFJfTCAgICAgICAgICAgICAzMQorCisvKioKKyAqIEBkZWYgSVhfRVRITlBFX1FNX1FfRklFTERfQUREUl9SCisgKgorICogQGJyaWVmIFFNZ3IgUXVldWUgQWRkcmVzcyBmaWVsZCByaWdodCBib3VuZGFyeQorICovCisjZGVmaW5lIElYX0VUSE5QRV9RTV9RX0ZJRUxEX0FER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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qKgorICogQGRlZmdyb3VwIEl4RmVhdHVyZUN0cmxBUEkgSVhQNDAwIEZlYXR1cmUgQ29udHJvbCAoSXhGZWF0dXJlQ3RybCkgQVBJCisgKgorICogQGJyaWVmIFRoZSBQdWJsaWMgQVBJIGZvciB0aGUgSVhQNDAwIEZlYXR1cmUgQ29udHJvbC4KKyAqIAorICogQHsKKyAqLworCisjaWZuZGVmIElYRkVBVFVSRUNUUkxfSAorI2RlZmluZSBJWEZFQVRVUkVDVFJMX0gKKworLyoKKyAqIFVzZXIgZGVmaW5lZCBpbmNsdWRlIGZpbGVzCisgKi8KKyNpbmNsdWRlICJJeE9zYWwuaCIKKworLyoKKyAqICNkZWZpbmVzIGFuZCBtYWNyb3MKKyAqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogVGhlIGZvbGxvd2luZyBhcmUgSXhGZWF0dXJlQ3RybENvbXBvbmVudENoZWNrIHJldHVybiB2YWx1ZXMuCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKioKKyAqIEBpbmdyb3VwIEl4RmVhdHVyZUN0cmxBUEkgCisgKgorICogQGRlZiAgSVhfRkVBVFVSRV9DVFJMX0NPTVBPTkVOVF9ESVNBQkxFRAorICoKKyAqIEBicmllZiBIYXJkd2FyZSBDb21wb25lbnQgaXMgZGlzYWJsZWQvdW5hdmFpbGFibGUuCisgKiAgICAgICAgUmV0dXJuIHN0YXR1cyBieSBpeEZlYXR1cmVDdHJsQ29tcG9uZW50Q2hlY2soKSAgCisgKi8KKyNkZWZpbmUgIElYX0ZFQVRVUkVfQ1RSTF9DT01QT05FTlRfRElTQUJMRUQgMAorCisvKioKKyAqIEBpbmdyb3VwIEl4RmVhdHVyZUN0cmxBUEkgCisgKgorICogQGRlZiAgSVhfRkVBVFVSRV9DVFJMX0NPTVBPTkVOVF9FTkFCTEVECisgKgorICogQGJyaWVmIEhhcmR3YXJlIENvbXBvbmVudCBpcyBhdmFpbGFibGUuIAorICogICAgICAgIFJldHVybiBzdGF0dXMgYnkgaXhGZWF0dXJlQ3RybENvbXBvbmVudENoZWNrKCkgIAorICovCisjZGVmaW5lICBJWF9GRUFUVVJFX0NUUkxfQ09NUE9ORU5UX0VOQUJMRUQgIDEKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBQcm9kdWN0IElEIGluIFhTY2FsZSBDUDE1IC0gUmVnaXN0ZXIgMAorICogIC0gSXQgY29udGFpbnMgaW5mb3JtYXRpb24gb24gdGhlIG1heGltdW0gWFNjYWxlIENvcmUgRnJlcXVlbmN5IGFuZAorICogICAgU2lsaWNvbiBTdGVwcGluZy4gIAorICogIC0gWFNjYWxlIENvcmUgRnJlcXVlbmN5IElkIGluZGljYXRlcyBvbmx5IHRoZSBtYXhpbXVtIFhTY2FsZSBmcmVxdWVuY3kKKyAqICAgIGFjaGlldmFibGUgYW5kIG5vdCB0aGUgcnVubmluZyBYU2NhbGUgZnJlcXVlbmN5IChtYXliZSBzdGVwcGVkIGRvd24pLiAgICAKKyAqICAtIFRoZSByZWdpc3RlciBpcyByZWFkIGJ5IHVzaW5nIGl4RmVhdHVyZUN0cmxQcm9kdWN0SWRSZWFkLgorICogIC0gVXNhZ2UgZXhhbXBsZTogCisgKiAgICAgICAgICBwcm9kdWN0SWQgPSBpeEZlYXR1cmVDdHJsUHJvZHVjdElkUmVhZCgpOworICogICAgICAgICAgaWYoIChwcm9kdWN0SWQgJiBJWF9GRUFUVVJFX0NUUkxfU0lMSUNPTl9TVEVQUElOR19NQVNLKSA9PSAKKyAqICAgICAgICAgICAgICBJWF9GRUFUVVJFX0NUUkxfU0lMSUNPTl9UWVBFX0EwICkKKyAqICAgICAgICAgIG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RnJlcXVlbmN5IElELiAKKyAqIAorICogIFNpIFN0ZXBwaW5nIElkICAgICAgICAgICAgOiAgQSAgICAgICAtIDB4MCAgICAKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEIgICAgICAgLSAweDEgCisgKiAgCisgKiAgWFNjYWxlIENvcmUgZnJlcSBJZCAtIERldmljZSBJRCBbMTE6OV0gOiBJWFA0MlggLSAweDAKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElYUDQ2WCAtIDB4MQorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qKgorICogQGluZ3JvdXAgSXhGZWF0dXJlQ3RybEFQSSAKKyAqCisgKiBAZGVmIElYX0ZFQVRVUkVfQ1RSTF9TSUxJQ09OX1RZUEVfQTAKKyAqCisgKiBAYnJpZWYgVGhpcyBpcyB0aGUgdmFsdWUgb2YgQTAgU2lsaWNvbiBpbiBwcm9kdWN0IElELiAKKyAqLworI2RlZmluZSBJWF9GRUFUVVJFX0NUUkxfU0lMSUNPTl9UWVBFX0EwICAgMAorCisvKioKKyAqIEBpbmdyb3VwIEl4RmVhdHVyZUN0cmxBUEkgCisgKgorICogQGRlZiBJWF9GRUFUVVJFX0NUUkxfU0lMSUNPTl9UWVBFX0IwCisgKgorICogQGJyaWVmIFRoaXMgaXMgdGhlIHZhbHVlIG9mIEIwIFNpbGljb24gaW4gcHJvZHVjdCBJRC4KKyAqLworI2RlZmluZSBJWF9GRUFUVVJFX0NUUkxfU0lMSUNPTl9UWVBFX0IwICAgMQorCisvKioKKyAqIEBpbmdyb3VwIEl4RmVhdHVyZUN0cmxBUEkgCisgKgorICogQGRlZiBJWF9GRUFUVVJFX0NUUkxfU0lMSUNPTl9TVEVQUElOR19NQVNLCisgKgorICogQGJyaWVmIFRoaXMgaXMgdGhlIG1hc2sgb2Ygc2lsaWNvb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MIENvcHJvY2Vzc29yICAgICAgICAgLSBBbHdheXMgYXZhaWxhYmxlIGluIElYUDQ2WAorICogICAgNyAgICAgICAgICAgICBIU1MgQ29wcm9jZXNzcHIKKyAqICAgIDggICAgICAgICAgICAgVXRvcGlhIENvcHJvY2Vzc29yCisgKiAgICA5ICAgICAgICAgICAgIEV0aGVybmV0IDAgQ29wcm9jZXNzb3IKKyAqICAgMTAgICAgICAgICAgICAgRXRoZXJuZXQgMSBDb3Byb2Nlc3NvcgorICogICAxMSAgICAgICAgICAgICBOUEUgQQorICogICAxMiAgICAgICAgICAgICBOUEUgQgorICogICAxMyAgICAgICAgICAgICBOUEUgQworICogICAxNCAgICAgICAgICAgICBQQ0kgQ29udHJvbGxlcgorICogICAxNSAgICAgICAgICAgICBFQ0MvVGltZVN5bmMgQ29wcm9jZXNzb3IgLSAgT25seSBhcHBsaWNhYmxlIHRvIElYUDQ2WAorICogIDE2LTE3ICAgICAgICAgICBVdG9waWEgUEhZIExpbWl0IFN0YXR1cyA6IDB4MCAtIDMyIFBIWQorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MSAtIDE2IFBIWQorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MiAtICA4IFBIWQorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MyAtICA0IFBIWQorICoKKyAqICBQb3J0aW9ucyBiZWxvdyBhcmUgb25seSBhcHBsaWNhYmxlIHRvIElYUDQ2WAorICogICAxOCAgICAgICAgICAgICBVU0IgSG9zdCBDb3Byb2Nlc3NvcgorICogICAxOSAgICAgICAgICAgICBOUEUgQSBFdGhlcm5ldCAtIDAgZm9yIEVuYWJsZSBpZiBVdG9waWEgPSAxCisgKiAgIDIwICAgICAgICAgICAgIE5QRSBCIEV0aGVybmV0IGNvcHJvY2Vzc29yIDEtMy4KKyAqICAgMjEgICAgICAgICAgICAgUlNBIENyeXB0byBCbG9jayBjb3Byb2Nlc3Nvci4KKyAqICAyMi0yMyAgICAgICAgICAgUHJvY2Vzc29yIGZyZXF1ZW5jeSA6IDB4MCAtIDUzMyBNSHoKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MSAtIDY2NyBNSHoKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MiAtIDQwMCBNSHoKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MyAtIDI2NiBNSHoKKyAqICAyNC0zMSAgICAgICAgICAgUmVzZXJ2ZWQKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLypTZWN0aW9uIGdlbmVyaWMgdG8gYm90aCBJWFA0MlggYW5kIElYUDQ2WCovCisKKy8qKgorICogQGluZ3JvdXAgSXhGZWF0dXJlQ3RybEFQSQorICoKKyAqIEBlbnVtIEl4RmVhdHVyZUN0cmxDb21wb25lbnRUeXBlCisgKgorICogQGJyaWVmIEVudW1lcmF0aW9uIGZvciBjb21wb25lbnRzIGF2YWlsYXZibGUKKyAqCisgKi8KK3R5cGVkZWYgZW51bQoreworICAgIElYX0ZFQVRVUkVDVFJMX1JDT01QID0gMCwgLyoqPGJpdCBsb2NhdGlvbiBmb3IgUkNvbXAgQ2lyY3VpdHJ5Ki8KKyAgICBJWF9GRUFUVVJFQ1RSTF9VU0IsICAgICAgIC8qKjxiaXQgbG9jYXRpb24gZm9yIFVTQiBDb250cm9sbGVyKi8KKyAgICBJWF9GRUFUVVJFQ1RSTF9IQVNILCAgICAgIC8qKjxiaXQgbG9jYXRpb24gZm9yIEhhc2hpbmcgQ29wcm9jZXNzb3IqLworICAgIElYX0ZFQVRVUkVDVFJMX0FFUywgICAgICAgLyoqPGJpdCBsb2NhdGlvbiBmb3IgQUVTIENvcHJvY2Vzc29yKi8KKyAgICBJWF9GR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TUyAtIHN1Y2Nlc3NmdWxseSBkaXNwbGF5ZWQgc3RhdGlzdGljcyBhbmQgc3RhdHVzIHJlZ2lzdGVyCisgKgkJLSBJWF9JMkNfTk9UX0lOSVQgLSBJMkMgbm90IGluaXQgeWV0LgorICogICAgICAgICAgICAgIAorICogQGxpICAgUmVlbnRyYW50ICAgIDogeWVzCisgKiBAbGkgICBJU1IgQ2FsbGFibGUgOiBubworICoKKyAqLworUFVCTElDIElYX0kyQ19TVEFUVVMKK2l4STJjRHJ2U2hvdyh2b2lkKTsKKworLyoqCisgKiBAaW5ncm91cCBJeEkyY0RydgorICogCisgKiBAZm4gaXhJMmNEcnZEZWxheVR5cGVTZWxlY3QgKEl4STJjRGVsYXlNb2RlIGRlbGF5TWVjaGFuaXNtU2VsZWN0KQorICoKKyAqIEBicmllZiBTZXRzIHRoZSBkZWxheSB0eXBlIG9mIGVpdGhlciBsb29waW5nIGRlbGF5IG9yIE9TIHNjaGVkdWxlciBkZWxheQorICogICAgICAgICAgYWNjb3JkaW5nIHRvIHRoZSBhcmd1bWVudCBwcm92aWRlZC4KKyAqCisgKiBAcGFyYW0gLSAiSXhJMmNEZWxheU1vZGUgW2luXSBkZWxheVR5cGVTZWxlY3QiIC0gdGhlIEkyQyBkZWxheSB0eXBlIHNlbGVjdGVkCisgKgorICogR2xvYmFsIERhdGEJOgorICoJCS0gTm9uZS4KKyAqICAgICAgICAgICAgICAgICAgICAgICAgCisgKiBUaGlzIEFQSSB3aWxsIHNldCB0aGUgZGVsYXkgdHlwZSB1c2VkIGJ5IHRoZSBJMkMgRHJpdmVyIHRvIGVpdGhlciBsb29waW5nCisgKiBkZWxheSBvciBPUyBzY2hlZHVsZXIgZGVsYXkuCisgKgorICogQHJldHVybiAKKyAqCQktIE5vbmUKKyAqICAgICAgICAgICAgICAKKyAqIEBsaSAgIFJlZW50cmFudCAgICA6IHllcworICogQGxpICAgSVNSIENhbGxhYmxlIDogbm8KKyAqCisgKi8KK1BVQkxJQyB2b2l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iBAcGFyYW0gaW1hZ2VJZExpc3RQdHIgQHJlZiBJeE5wZURsSW1hZ2VJZCogW291dF0gLSBBcnJheSB0byBjb250YWluIGxpc3Qgb2YKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1hZ2UgSWRzIChtZW1vcnkKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxsb2NhdGVkIGJ5IENsaWVudCkuCisgKiBAcGFyYW0gbGlzdFNpemVQdHIgVUlOVDMyKiBbaW5vdXRdICAtIEFzIGFuIGlucHV0LCB0aGlzIHBhcmFtIHNob3VsZCBwb2ludAorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0byB0aGUgbWF4IG51bWJlciBvZiBJZHMgdGhlCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpPmltYWdlSWRMaXN0UHRyPC9pPiBhcnJheSBjYW4KKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaG9sZC4gTnBlRGwgd2lsbCByZXBsYWNlIHRoZSBpbnB1dAorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSBvZiB0aGlzIHBhcmFtZXRlciB3aXRoIHRoZQorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudW1iZXIgb2YgaW1hZ2UgSWRzIGFjdHVhbGx5IGZpbGxlZAorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRvIHRoZSBhcnJheSBiZWZvcmUgcmV0dXJuaW5nLgorICoKKyAqIEZpbmRzIGxpc3Qgb2YgaW1hZ2VzIGF2YWlsYWJsZSBpbiB0aGUgbWljcm9jb2RlIGltYWdlIGxpYnJhcnkuCisgKiBGaWxscyB0aGVzZSBpbnRvIHRoZSBhcnJheSBwb2ludGVkIHRvIGJ5IDxpPmltYWdlSWRM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29kZSBpbWFnZSBsaWJyYXJ5LgorICoKKyAqIEBwYXJhbSBJeE5wZURsSW1hZ2VJZCogW291dF0gaW1hZ2VMaXN0UHRyIC0gcG9pbnRlciB0byBhcnJheSB0byBjb250YWluCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhIGxpc3Qgb2YgaW1hZ2VzLiBJZiBOVUxMLAorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25seSB0aGUgbnVtYmVyIG9mIGltYWdlcyAKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzIHJldHVybmVkIChpbgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGk+bnVtSW1hZ2VzPC9pPikKKyAqIEBwYXJhbSBVSU5UMzIqIFtpbm91dF0gbnVtSW1hZ2VzIC0gQXMgaW5wdXQsIGl0IHBvaW50cyB0byBhIHZhcmlhYmxlCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGFpbmluZyB0aGUgbnVtYmVyIG9mIGltYWdlcyB3aGljaAorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbiBiZSBzdG9yZWQgaW4gdGhlCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGk+aW1hZ2VMaXN0UHRyPC9pPiBhcnJheS4gSXRzIHZhbHVlCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXMgaWdub3JlZCBhcyBpbnB1dCBpZgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpPmltYWdlTGlzdFB0cjwvaT4gaXMgTlVMTC4gQXMgYW4KKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXRwdXQsIGl0IHdpbGwgY29udGFpbiBudW1iZXIgb2YKK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U0VUX1NUQVQKKyAqIEBicmllZiBPZmZzZXQgKGluIGJ5dGVzKSBvZiBTVEFUIChNZXNzYWdpbmcgU3RhdHVzKSByZWdpc3RlciBmcm9tIE5QRSBCYXNlCisgKiAgICAgICAgQWRkcmVzcworICovCisjZGVmaW5lIElYX05QRURMX1JFR19PRkZTRVRfU1RBVAkgICAgIDB4MDAwMDAwMkMJCQorCisvKioKKyAqIEBkZWYgSVhfTlBFRExfUkVHX09GRlNFVF9DVEwKKyAqIEBicmllZiBPZmZzZXQgKGluIGJ5dGVzKSBvZiBDVEwgKE1lc3NhZ2luZyBDb250cm9sKSByZWdpc3RlciBmcm9tIE5QRSBCYXNlCisgKiAgICAgICAgQWRkcmVzcworICovCisjZGVmaW5lIElYX05QRURMX1JFR19PRkZTRVRfQ1RMCSAgICAgICAgICAgICAweDAwMDAwMDMwCQkKKworLyoqCisgKiBAZGVmIElYX05QRURMX1JFR19PRkZTRVRfTUJTVAorICogQGJyaWVmIE9mZnNldCAoaW4gYnl0ZXMpIG9mIE1CU1QgKE1haWxib3ggU3RhdHVzKSByZWdpc3RlciBmcm9tIE5QRSBCYXNlCisgKiAgICAgICAgQWRkcmVzcworICovCisjZGVmaW5lIElYX05QRURMX1JFR19PRkZTRVRfTUJTVAkgICAgIDB4MDAwMDAwMzQJCQorCisvKioKKyAqIEBkZWYgSVhfTlBFRExfUkVHX09GRlNFVF9GSUZPCisgKiBAYnJpZWYgT2Zmc2V0IChpbiBieXRlcykgb2YgRklGTyAobWVzc2FnaW5nIGluL291dCBGSUZPKSByZWdpc3RlciBmcm9tIE5QRQorICogICAgICAgIEJhc2UgQWRkcmVzcworICovCisjZGVmaW5lIElYX05QRURMX1JFR19PRkZTRVRfRklGTwkgICAgIDB4MDAwMDAwMzgJCQorCisKKy8qCisgKiBOb24temVybyByZXNldCB2YWx1ZXMgZm9yIHRoZSBDb25maWd1cmF0aW9uIEJ1cyByZWdpc3RlcnMKKyAqLworCisvKioKKyAqIEBkZWYgSVhfT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ICAgICAgKFNURVZUID0gb2ZmLCAweDgwKQorICovCisjZGVmaW5lIElYX05QRURMX0NUWFRfUkVHX1JFU0VUX1NURVZUICAgICAweDgwCisKKy8qKgorICogQGRlZiBJWF9OUEVETF9DVFhUX1JFR19SRVNFVF9TVEFSVFBDCisgKiBAYnJpZWYgUmVzZXQgdmFsdWUgb2YgU1RBUlRQQyBOUEUgaW50ZXJuYWwgQ29udGV4dCBTdG9yZSByZWdpc3RlcgorICogICAgICAgIChTVEFSVFBDID0gMHgwMDAwKQorICovCisjZGVmaW5lIElYX05QRURMX0NUWFRfUkVHX1JFU0VUX1NUQVJUUEMgICAweDAwMDAKKworLyoqCisgKiBAZGVmIElYX05QRURMX0NUWFRfUkVHX1JFU0VUX1JFR01BUAorICogQGJyaWVmIFJlc2V0IHZhbHVlIG9mIFJFR01BUCBOUEUgaW50ZXJuYWwgQ29udGV4dCBTdG9yZSByZWdpc3RlcgorICogICAgICAgIChSRUdNQVAgPSBkMC0+cDAsIGQ4LT5wMiwgZDE2LT5wNCkKKyAqLworI2RlZmluZSBJWF9OUEVETF9DVFhUX1JFR19SRVNFVF9SRUdNQVAgICAgMHgwODIwCisKKy8qKgorICogQGRlZiBJWF9OUEVETF9DVFhUX1JFR19SRVNFVF9DSU5ERVgKKyAqIEBicmllZiBSZXNldCB2YWx1ZSBvZiBDSU5ERVggTlBFIGludGVybmFsIENvbnRleHQgU3RvcmUgcmVnaXN0ZXIKKyAqICAgICAgICAoQ0lOREVYID0gMCkKKyAqLworI2RlZmluZSBJWF9OUEVETF9DVFhUX1JFR19SRVNFVF9DSU5ERVggICAgMHgwMAorCisKKy8qCisgKiBudW1lcmljIHJhbmdlIG9mIGNvbnRleHQgbGV2ZWxzIGF2YWlsYWJsZSBvbiBhbiBOUEUKKyAqLworCisvKioKKyAqIEBkZWYgSVhfTlBFRExfQ1RYVF9OVU1fTUlOCisgKiBAYnJpZWYgTG93ZXN0IE5QRSBDb250ZXh0IG51bWJlciBpbiByYW5nZQorICovCisjZGVmaW5lIElYX05QRURMX0NUWFRfTlVNX01JTiAgICAgICAgICAgICAwCisKKy8qKgorICogQGRlZiBJWF9OUEVETF9DVFhUX05VTV9NQVgKKyAqIEBicmllZiBIaWdoZXN0IE5QRSBDb250ZXh0IG51bWJlciBpbiByYW5nZQorICovCisjZGVmaW5lIElYX05QRURMX0NUWFRfTlVNX01BWCAgICAgICAgICAgICAxNQorCisKKy8qCisgKiBQaHlzaWNhbCBOUEUgaW50ZXJuYWwgcmVnaXN0ZXJzCisgKi8KKworLyoqCisgKiBAZGVmIElYX05QRURMX1RPVEFMX05VTV9QSFlTX1JFRworICogQGJyaWVmIE51bWJlciBvZiBQaHlzaWNhbCByZWdpc3RlcnMgY3VycmVudGx5IHN1cHBvcnRlZAorICogICAgICAgIEluaXRpYWwgTlBFIGltcGxlbWVudGF0aW9ucyB3aWxsIGhhdmUgYSAzMi13b3JkIHJlZ2lzdGVyIGZpbGUuCisgKiAgICAgICAgTGF0ZXIgaW1wbGVtZW50YXRpb25zIG1heSBoYXZlIGEgNjQtd29yZCByZWdpc3RlciBmaWxlLgorICovCisjZGVmaW5lIElYX05QRURMX1RPVEFMX05VTV9QSFlTX1JFRyAgICAgICAgICAgICAgIDMyCisKKy8qKgorICogQGRlZiBJWF9OUEVETF9PRkZTRVRfUEhZU19SRUdfQUREUl9SRUdNQVAKKyAqIEBicmllZiBMU0Itb2Zmc2V0IG9mIFJlZ21hcCBudW1iZXIgaW4gUGh5c2ljYWwgTlBFIHJlZ2lzdGVyIGFkZHJlc3MsIHVzZWQKKyAqICAgICAgICBmb3IgUGh5c2ljYWwgVG8gTG9naWNhbCByZWdpc3RlciBhZGRyZXNzIG1hcHBpbmcgaW4gdGhlIE5QRQorICovCisjZGVmaW5lIElYX05QRURMX09GRlNFVF9QSFlTX1JFR19BRERSX1JFR01BUCAgICAgIDEKKworLyoqCisgKiBAZGVmIElYX05QRURMX01BU0tfUEhZU19SRUdfQUREUl9MT0dJQ0FMX0FERFIKK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y8qKgorICogQGZuIElYX1NUQVRVUyBpeE5wZURsTnBlTWdyQ3R4dFJlZ1dyaXRlIChVSU5UMzIgbnBlQmFzZUFkZHJlc3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVJTlQzMiBjdHh0TnVtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJeE5wZURsQ3R4dFJlZ051bSBjdHh0UmVnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBVSU5UMzIgY3R4dFJlZ1ZhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQk9PTCB2ZXJpZnkpCisgKiAKKyAqIEBicmllZiBXcml0ZXMgYSB2YWx1ZSB0byBhIENvbnRleHQgU3RvcmUgcmVnaXN0ZXIgb24gYW4gTlBFCisgKgorICogQHBhcmFtIFVJTlQzMiBbaW5dIG5wZUJhc2VBZGRyZXNzICAgICAtIEJhc2UgQWRkcmVzcyBvZiBOUEUKKyAqIEBwYXJhbSBVSU5UMzIgW2luXSBjdHh0TnVtICAgICAgICAgICAgLSBjb250ZXh0IHN0b3JlIHRvIGFjY2VzcworICogQHBhcmFtIEl4TnBlRGxDdHh0UmVnTnVtIFtpbl0gY3R4dFJlZyAtIHdoaWNoIENvbnRleHQgU3RvcmUgcmVnIHRvIHdyaXRlCisgKiBAcGFyYW0gVUlOVDMyIFtpbl0gY3R4dFJlZ1ZhbCAgICAgICAgIC0gdmFsdWUgdG8gd3JpdGUgdG8gdGhlIENvbnRleHQgU3RvcmUKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWdpc3RlcgorICogQHBhcmFtIEJPT0wgICBbaW5dIHZlcmlmeSAgICAgICAgICAgICAtIGlmIFRSVUUsIHZlcmlmeSB0aGUgcmVnaXN0ZXIgaXMKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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uZCBvZiBDb3B5cmlnaHQgTm90aWNlIC0tCisgKi8KKworI2luY2x1ZGUgIkl4VHlwZXMuaCIKKworI2lmbmRlZiBJeE9zUHJpbnRmX0gKKworI2lmbmRlZiBfX2RveHlnZW5faGlkZQorI2RlZmluZSBJeE9zUHJpbnRmX0gKKyNlbmRpZiAvKiBfX2RveHlnZW5faGlkZSAqLworCisjaWZkZWYgX193aW5jZQorCisjaWZuZGVmIElYX1VTRV9TRVJDT05TT0xFCisKK3N0YXRpYyBpbnQKK2l4TG9nTXNnKAorICAgIGNoYXIgKnBGb3JtYXQsIAorICAgIC4uLgorICAgICkKK3sgICAgCisjaWZuZGVmIElOX0tFUk5FTAorICAgIHN0YXRpYyBXQ0hBUiAgICBwT3V0cHV0U3RyaW5nWzI1Nl07IAorCXN0YXRpYyBjaGFyICAgICBwTmFycm93U3RyWzI1Nl07CisgICAgaW50ICAgICAgICAgICAgIHJldHVybkNudCA9IDA7IAorICAgIHZhX2xpc3QgYXA7CisgICAgCisgICAgcE91dHB1dFN0cmluZ1swXSA9IDA7IAorCXBOYXJyb3dTdHJbMF0gPSAwOwkKKyAgICAKKyAgICB2YV9zdGFydChhcCwgcEZvcm1hdCk7CisKKwlyZXR1cm5DbnQgPSBfdnNucHJpbnRmKHBOYXJyb3dTdHIsIDI1NiwgcEZvcm1hdCwgYXApOworCisgICAgTXVsdGlCeXRlVG9XaWRlQ2hhcigKKyAgICAgICAgICAgIENQX0FDUCwgCisgICAgICAgICAgICBNQl9QUkVDT01QT1NFRCwgCisgICAgICAgICAgICBwTmFycm93U3RyLCAKKyAgICAgICAgICAgIC0xLCAKKyAgICAgICAgICAgIHBPdXRwdXRTdHJpbmcsIAorICAgICAgICAgICAgMjU2CisgICAgICAgICAgICApOyAKKworICAgIE91dHB1dERlYnVnU3RyaW5nKHBPdXRwdXRTdHJpbmcpOworCisgICAgcmV0dXJuIHJldHVybkNudDsgCisjZWxzZQorICAgIHJldHVybiAwOyAKKyNlbmRpZgorfQorI2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mMgICAgICAgICAgICAgICAgIDQwCisjZGVmaW5lIGl4X2ludGVncmF0aW9uX3NzcEFjYyAgNDEKKyNkZWZpbmUgaXhfaW50ZWdyYXRpb25faTJjICAgICA0MgorI2RlZmluZSBpeF9vc2FsCQkgICAgICAgNDMKKyNkZWZpbmUgaXhfaW50ZWdyYXRpb25fcGFyaXR5RU5BY2MgIDQ0CisjZGVmaW5lIGl4X2ludGVncmF0aW9uX3RpbWVTeW5jQWNjICA0NQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiB0aW1lU3luY0FjYworICoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZiAoSVhfQ09NUE9ORU5UX05BTUUgPT0gaXhfdGltZVN5bmNBY2MpCisKKyNpZiBkZWZpbmVkIChJWF9PU1NFUlZfVlhXT1JLU19MRSkKKworI2RlZmluZSBDU1JfTEVfREFUQV9DT0hFUkVOVF9NQVBQSU5HCisKKyNlbmRpZiAvKiBJWF9PU1NFUlZfVlhXT1JLU19MRSAqLworCisjZW5kaWYgLyogdGltZVN5bmNBY2MgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogcGFyaXR5RU5BY2MKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWYgKElYX0NPTVBPTkVOVF9OQU1FID09IGl4X3Bhcml0eUVOQWNjKQorCisjaWYgZGVmaW5lZCAoSVhfT1NTRVJWX1ZYV09SS1NfTEUpCisKKyNkZWZpbmUgQ1NSX0xFX0RBVEFfQ09IRVJFTlRfTUFQUElORworCisjZW5kaWYgLyogSVhfT1NTRVJWX1ZYV09SS1NfTEUgKi8KKworI2VuZGlmIC8qIHBhcml0eUVOQWNjICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIGNvZGVsZXRzX3Bhcml0eUVOQWNjCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmIChJWF9DT01QT05FTlRfTkFNRSA9PSBpeF9jb2RlbGV0c19wYXJpdHlFTkFjYykKKworI2lmIGRlZmluZWQgKElYX09TU0VSVl9WWFdPUktTX0xFKQorCisjZGVmaW5lIENTUl9MRV9EQVRBX0NPSEVSRU5UX01BUFBJTkcKKworI2VuZGlmIC8qIElYX09TU0VSVl9WWFdPUktTX0xFICovCisKKyNlbmRpZiAvKiBjb2RlbGV0c19wYXJpdHlFTkFjYyAqLworCisjZW5kaWYgLyogSXhPc1NlcnZpY2VzQ29tcG9uZW50c19IICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIGludGVncmF0aW9uX3RpbWVTeW5jQWNjCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmIChJWF9DT01QT05FTlRfTkFNRSA9PSBpeF9pbnRlZ3JhdGlvbl90aW1lU3luY0FjYykKKworI2lmIGRlZmluZWQgKElYX09TU0VSVl9WWFdPUktTX0xFKQorCisjZGVmaW5lIENTUl9MRV9EQVRBX0NPSEVSRU5UX01BUFBJTkcKKworI2VuZGlmIC8qIElYX09TU0VSVl9WWFdPUktTX0xFICovCisKKyNlbmRpZiAvKiBpbnRlZ3JhdGlvbl90aW1lU3luY0FjYyAqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBpbnRlZ3JhdGlvbl9wYXJpdHlFTkFjYworICoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZiAoSVhfQ09NUE9ORU5UX05BTUUgPT0gaXhfaW50ZWdyYXRpb25fcGFyaXR5RU5BY2MpCisKKyNpZiBkZWZpbmVkIChJWF9PU1NFUlZfVlhXT1JLU19MRSkKKworI2RlZmluZSBDU1JfTEVfREFUQV9DT0hFUkVOVF9NQVBQSU5HCisKKyNlbmRpZiAvKiBJWF9PU1NFUlZfVlhXT1JLU19MRSAqLworCisjZW5kaWYgLyogaW50ZWdyYXRpb25fcGFyaXR5RU5BY2MgKi8KZGlmZiAtLWdpdCBhL2NwdS9peHAvbnBlL2luY2x1ZGUvSXhPc1NlcnZpY2VzRW5kaWFuZXN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IGFic3RyYWN0IHRoZWlyIE9TIGRlcGVuZGVuY3kgdG8gdGhpcyBtb2R1bGUuCisgKiBTZXJ2aWNlcyBvdmVydmlldworICoJLSMgRGF0YSB0eXBlcywgY29uc3RhbnRzLCBkZWZpbmVzCisgKgktIyBJbnRlcnJ1cHRzCisgKiAgICAgICAgICAgICAgLSBiaW5kIGludGVycnVwdHMgdG8gaGFuZGxlcnMKKyAqICAgICAgICAgICAgICAtIHVuYmluZCBpbnRlcnJ1cHRzIGZyb20gaGFuZGxlcnMKKyAqICAgICAgICAgICAgIAktIGRpc2FibGVzIGFsbCBpbnRlcnJ1cHRzIAorICogICAgICAgICAgICAgIC0gZW5hYmxlcyBhbGwgaW50ZXJydXB0cyAKKyAqICAgICAgICAgICAgICAtIHNlbGVjdGl2ZWx5IGRpc2FibGVzIGludGVycnVwdHMgCisgKiAgICAgICAgICAgICAgLSBlbmFibGVzIGFuIGludGVycnVwdCBsZXZlbCAKKyAqICAgICAgICAgICAgICAtIGRpc2FibGVzIGFuIGludGVycnVwdCBsZXZlbCAKKyAqICAgICAgLSMgTWVtb3J5CisgKiAgICAgICAgICAgICAgLSBhbGxvY2F0ZXMgbWVtb3J5CisgKiAgICAgICAgICAgICAgLSBmcmVlcyBtZW1vcnkgCisgKiAgICAgICAgICAgICAgLSBjb3BpZXMgbWVtb3J5IHpvbmVzIAorICogICAgICAgICAgICAgIC0gZmlsbHMgYSBtZW1vcnkgem9uZSAKKyAqICAgICAgICAgICAgICAtIGFsbG9jYXRlcyBjYWNoZS1zYWZlIG1lbW9yeSAKKyAqICAgICAgICAgICAgICAtIGZyZWVzIGNhY2hlLXNhZmUgbWVtb3J5IAorICogICAgICAgICAgICAgIC0gcGh5c2ljYWwgdG8gdmlydHVhbCBhZGRyZXNzIHRyYW5zbGF0aW9uIAorICogICAgICAgICAgICAgIC0gdmlydHVhbCB0byBwaHlzaWNhbCBhZGRyZXNzIHRyYW5zbGF0aW9uIAorICogICAgICAgICAgICAgIC0gY2FjaGUgdG8gbWVtb3J5IGZsdXNoIAorICogICAgICAgICAgICAgIC0gY2FjaGUgbGluZSBpbnZhbGlkYXRlIAorICogICAgICAtIyBUaHJlYWRzCisgKiAgICAgICAgICAgICAgLSBjcmVhdGVzIGEgbmV3IHRocmVhZCAKKyAqICAgICAgICAgICAgICAtIHN0YXJ0cyBhIG5ld2x5IGNyZWF0ZWQgdGhyZWFkIAorICogICAgICAgICAgICAgIC0ga2lsbHMgYW4gZXhpc3RpbmcgdGhyZWFkIAorICogICAgICAgICAgICAgIC0gZXhpdHMgYSBydW5uaW5nIHRocmVhZCAKKyAqICAgICAgICAgICAgICAtIHNldHMgdGhlIHByaW9yaXR5IG9mIGFuIGV4aXN0aW5nIHRocmVhZCAKKyAqICAgICAgICAgICAgICAtIHN1c3BlbmRzIHRocmVhZCBleGVjdXRpb24gCisgKiAgICAgICAgICAgICAgLSByZXN1bWVzIHRocmVhZCBleGVjdXRpb24gCisgKiAgICAgIC0jIElQQworICogICAgICAgICAgICAgIC0gY3JlYXRlcyBhIG1lc3NhZ2UgcXVldWUgCisgKiAgICAgICAgICAgICAgLSBkZWxldGVzIGEgbWVzc2FnZSBxdWV1ZSAKKyAqICAgICAgICAgICAgICAtIHNlbmRzIGEgbWVzc2FnZSB0byBhIG1lc3NhZ2UgcXVldWUgCisgKiAgICAgICAgICAgICAgLSByZWNlaXZlcyBhIG1lc3NhZ2UgZnJvbSBhIG1lc3NhZ2UgcXVldWUKKyAqICAgICAgLSMgVGhyZWFkIFN5bmNocm9uaXNhdGlvbgorICogICAgICAgICAgICAgIC0gaW5pdGlhbGl6ZXMgYSBtdXRleCAKKyAqICAgICAgICAgICAgICAtIGxvY2tzIGEgbXV0ZXggCisgKiAgICAgICAgICAgICAgLSB1bmxvY2tzIGEgbXV0ZXggCisgKiAgICAgICAgICAgICAgLSBub24tYmxvY2tpbmcgYXR0ZW1wdCB0byBsb2NrIGEgbXV0ZXggCisgKiAgICAgICAgICAgICAgLSBkZXN0cm95cyBhIG11dGV4IG9iamVjdCAKKyAqICAgICAgICAgICAgICAtIGluaXRpYWxpemVzIGEgZmFzdCBtdXRleCAKKyAqICAgICAgICAgICAgICAtIG5vbi1ibG9ja2luZyBhdHRlbXB0IHRvIGxvY2sgYSBmYXN0IG11dGV4IAorICogICAgICAgICAgICAgIC0gdW5sb2NrcyBhIGZhc3QgbXV0ZXggCisgKiAgICAgICAgICAgICAgLSBkZXN0cm95cyBhIGZhc3QgbXV0ZXggb2JqZWN0IAorICogICAgICAgICAgICAgIC0gaW5pdGlhbGl6ZXMgYSBzZW1hcGhvcmUgCisgKiAgICAgICAgICAgICAgLSBwb3N0cyB0byAoaW5jcmVtZW50cykgYSBzZW1hcGhvcmUgCisgKiAgICAgICAgICAgICAgLSB3YWl0cyBvbiAoZGVjcmVtZW50cykgYSBzZW1hcGhvcmUgCisgKiAgICAgICAgICAgICAgLSBub24tYmxvY2tpbmcgd2FpdCBvbiBzZW1hcGhvcmUgCisgKiAgICAgICAgICAgICAgLSBnZXRzIHNlbWFwaG9yZSB2YWx1ZSAKKyAqICAgICAgICAgICAgICAtIGRlc3Ryb3lzIGEgc2VtYXBob3JlIG9iamVjdCAKKyAqICAgICAgICAgICAgICAtIHlpZWxkcyBleGVjdXRpb24gb2YgY3VycmVudCB0aHJlYWQgCisgKiAgICAgIC0jIFRpbWUgZnVuY3Rpb25zCisgKiAgICAgICAgICAgICAgLSB5aWVsZGluZyBzbGVlcCBmb3IgYSBudW1iZXIgb2YgbWlsbGlzZWNvbmRzIAorICogICAgICAgICAgICAgIC0gYnVzeSBzbGVlcCBmb3IgYSBudW1iZXIgb2YgbWljcm9zZWNvbmRzIAorICogICAgICAgICAgICAgIC0gdmFsdWUgb2YgdGhlIHRpbWVzdGFtcCBjb3VudGVyIAorICogICAgICAgICAgICAgIC0gcmVzb2x1dGlvbiBvZiB0aGUgdGltZXN0YW1wIGNvdW50ZXIgCisgKiAgICAgICAgICAgICAgLSBzeXN0ZW0gY2xvY2sgcmF0ZSwgaW4gdGlja3MgCisgKiAgICAgICAgICAgICAgLSBjdXJyZW50IHN5c3RlbSB0aW1lIAorICogICAgICAgICAgICAgIC0gY29udmVydHMgaXhPc2FsVGltZVZhbCBpbnRvIHRpY2tzIAorICogICAgICAgICAgICAgIC0gY29udmVydHMgdGlja3MgaW50byBpeE9zYWxUaW1lVmFsIAorICogICAgICAgICAgICAgIC0gY29udmVydHMgaXhPc2FsVGltZVZhbCB0byBtaWxsaXNlY29uZHMgCisgKiAgICAgICAgICAgICAgLSBjb252ZXJ0cyBtaWxsaXNlY29uZHMgdG8gSXhPc2FsVGltZXZhbCAKKyAqICAgICAgICAgICAgICAtICJlcXVhbCIgY29tcGFyaXNvbiBmb3IgSXhPc2FsVGltZXZhbCAKKyAqICAgICAgICAgICAgICAtICJsZXNzIHRoYW4iIGNvbXBhcmlzb24gZm9yIEl4T3NhbFRpbWV2YWwgCisgKiAgICAgICAgICAgICAgLSAiZ3JlYXRlciB0aGFuIiBjb21wYXJpc29uIGZvciBJeE9zYWxUaW1ldmFsIAorICogICAgICAgICAgICAgIC0gImFkZCIgb3BlcmF0b3IgZm9yIEl4T3NhbFRpbWV2YWwgCisgKiAgICAgICAgICAgICAgLSAic3VidHJhY3QiIG9wZXJhdG9yIGZvciBJeE9zYWxUaW1ldmFsIAorICogICAgICAtIyBMb2dnaW5nCisgKiAgICAgICAgICAgICAgLSBzZXRzIHRoZSBjdXJyZW50IGxvZ2dpbmcgdmVyYm9zaXR5IGxldmVsIAorICogICAgICAgICAgICAgIC0gaW50ZXJydXB0LXNhZmUgbG9nZ2luZyBmdW5jdGlvbiAKKyAqICAgICAgLSMgVGltZXIgc2VydmljZXMKKyAqICAgICAgICAgICAgICAtIHNjaGVkdWxlcyBhIHJlcGVhdGluZyB0aW1lciAKKyAqICAgICAgICAgICAgICAtIHNjaGVkdWxlcyBhIHNpbmdsZS1zaG90IHRpbWVyIAorICogICAgICAgICAgICAgIC0gY2FuY2VscyBhIHJ1bm5pbmcgdGltZXIgCisgKiAgICAgICAgICAgICAgLSBkaXNwbGF5cyBhbGwgdGhlIHJ1bm5pbmcgdGltZXJzIAorICogICAgICAtIyBPcHRpb25hbCBNb2R1bGVzCisgKiAgICAgICAgICAgICAgLSBCdWZmZXIgbWFuYWdlbWVudCBtb2R1bGUKKyAqICAgICAgICAgICAgICAtIEkvTyBtZW1vcnkgYW5kIGVuZGlhbmVzcyBzdXBwb3J0IG1vZHVsZQorICoKKyAqIEB7CisgKi8KKworCisvKgorICogUHJvdG90eXBlcworICovCisKKy8qID09PT09PT09PT09PT09PT09PT09PT09PT09ICBJbnRlcnJ1cHRzICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogCisgKi8KKworLyoqIAorICogQGluZ3JvdXAgSXhPc2FsCisgKgorICogQGJyaWVmIEJpbmRzIGFuIGludGVycnVwdCBoYW5kbGVyIHRvIGFuIGludGVycnVwdCBsZXZlbAorICoKKyAqIEBwYXJhbSBpcnFMZXZlbCAoaW4pICAgLSBpbnRlcnJ1cHQgbGV2ZWwKKyAqIEBwYXJhbSBpcnFIYW5kbGVyIChpbikgLSBpbnRlcnJ1cHQgaGFuZGxlcgorICogQHBhcmFtIHBhcmFtZXRlciAoaW4pICAtIGN1c3RvbSBwYXJhbWV0ZXIgdG8gYmUgcGFzc2VkIHRvIHRoZQorICogICAgICAgICAgICAgICAgICAgICAgICAgIGludGVycnVwdCBoYW5kbGVyCisgKgorICogQmluZHMgYW4gaW50ZXJydXB0IGhhbmRsZXIgdG8gYW4gaW50ZXJydXB0IGxldmVsLiBUaGUgb3BlcmF0aW9uIHdpbGwKKyAqIGZhaWwgaWYgdGhlIHdyb25nIGxldmVsIGlzIHNlbGVjdGVkLCBpZiB0aGUgaGFuZGxlciBpcyBOVUxMLCBvciBpZiB0aGUKKyAqIGludGVycnVwdCBpcyBhbHJlYWR5IGJvdW5kLiBUaGlzIGZ1bmN0aW9ucyBiaW5kcyB0aGUgc3BlY2lmaWVkIEMKKyAqIHJvdX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GUgaW50ZXJydXB0cyBiZWxvdyB0aGUgc3BlY2lmaWVkIGludGVycnVwdCBsZXZlbCAKKyAqIAorICogQGxpIFJlZW50cmFudDogbm8KKyAqIEBsaSBJUlEgc2FmZTogIHllcworICoKKyAqIEBub3RlIERlcGVuZGluZyBvbiB0aGUgaW1wbGVtZW50YXRpb24gdGhpcyBmdW5jdGlvbiBjYW4gZGlzYWJsZSBhbGwKKyAqICAgICAgIHRoZSBpbnRlcnJ1cHRzIAorICoKKyAqIEByZXR1cm4gcHJldmlvdXMgaW50ZXJydXB0IGxldmVsCisgKi8KK1BVQkxJQyBVSU5UMzIgaXhPc2FsSXJxTGV2ZWxTZXQgKFVJTlQzMiBpcnFMZXZlbCk7CisKKy8qKiAKKyAqIEBpbmdyb3VwIEl4T3NhbAorICoKKyAqIEBicmllZiBFbmFibGVzIGFuIGludGVycnVwdCBsZXZlbAorICoKKyAqIEBwYXJhbSBpcnFMZXZlbCCtIGludGVycnVwdCBsZXZlbCB0byBlbmFibGUKKyAqCisgKiBFbmFibGVzIHRoZSBzcGVjaWZpZWQgaW50ZXJydXB0IGxldmVsCisgKgorICogQGxpIFJlZW50cmFudDogbm8KKyAqIEBsaSBJUlEgc2FmZTogIHllcworICoKKyAqIEByZXR1cm4gLSBub25lCisgKi8KK1BVQkxJQyB2b2lkIGl4T3NhbElycUVuYWJsZSAoVUlOVDMyIGlycUxldmVsKTsKKworLyoqIAorICogQGluZ3JvdXAgSXhPc2FsCisgKgorICogQGJyaWVmIERpc2FibGVzIGFuIGludGVycnVwdCBsZXZlbAorICoKKyAqIEBwYXJhbSBpcnFMZXZlbCCtIGludGVycnVwdCBsZXZlbCB0byBkaXNhYmxlCisgKgorICogRGlzYWJsZXMgdGhlIHNwZWNpZmllZCBpbnRlcnJ1cHQgbGV2ZWwKKyAqCisgKiBAbGkgUmVlbnRyYW50OiBubworICogQGxpIElSUSBzYWZlOiAgeWVzCisgKgorICogQHJldHVybiAtIG5vbmUKKyAqLworUFVCTElD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FsQ29yZVdvcmRTd2FwIChVSU5UMzIgd29yZEluKQoreworICAgIC8qCisgICAgICogU3RvcmFnZSBmb3IgdGhlIHN3YXBwZWQgd29yZCAKKyAgICAgKi8KKyAgICBVSU5UMzIgd29yZE91dDsKKworICAgIC8qCisgICAgICogd29yZEluID0gQSwgQiwgQywgRCAKKyAgICAgKi8KKyAgICBfX2FzbV9fICgiIGVvciByMSwgJTEsICUxLCByb3IgIzE2OyIJLyogUjEgPSAgICAgIEFeQywgQl5ELCBDXkEsIEReQiAqLworCSAgICAgIiBiaWMgcjEsIHIxLCAjMHgwMGZmMDAwMDsiCS8qIFIxID0gICAgICBBXkMsIDAgICwgQ15BLCBEXkIgKi8KKwkgICAgICIgbW92ICUwLCAlMSwgcm9yICM4OyIJLyogd29yZE91dCA9IEQsICAgQSwgICBCLCAgIEMgICAqLworCSAgICAgIiBlb3IgJTAsICUwLCByMSwgbHNyICM4OyIJLyogd29yZE91dCA9IEQsICAgQywgICBCLCAgIEEgICAqLworICA6ICI9ciIgKHdvcmRPdXQpOiAiciIgKHdvcmRJbik6InIxIik7CisKKyAgICByZXR1cm4gd29yZE91dDsKK30KKworI2RlZmluZSBJWF9PU0FMX1NXQVBfTE9ORyh3RGF0YSkgICAgICAgICAgKGl4T3NhbENvcmVXb3JkU3dhcCh3RGF0YSkpCisjZWxzZQorI2RlZmluZSBJWF9PU0FMX1NXQVBfTE9ORyh3RGF0YSkgICAgICAgICAgKCh3RGF0YSA+PiAyNCkgfCAoKCh3RGF0YSA+PiAxNikgJiAweEZGKSA8PCA4KSB8ICgoKHdEYXRhID4+IDgpICYgMHhGRikgPDwgMTYpIHwgKCh3RGF0YSAmIDB4RkYpIDw8IDI0KSkKKyNlbmRpZgorCisjZWxzZSAvKiBuZGVmIF9fd2luY2UgKi8KKyNkZWZpbmUgSVhfT1NBTF9TV0FQX0xPTkcod0RhdGEpICAgICAgICAoKCgoVUlOVDMyKXdEYXRhIDw8IDI0KSB8ICgoVUlOVDMyKXdE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5lZCAoSVhfT1NBTF9WWFdPUktTX0xFKSB8fCBkZWZpbmVkIChJWF9PU0FMX0xJTlVYX0xFKSB8fCBkZWZpbmVkIChJWF9PU0FMX1dJTkNFX0xFKSB8fCBkZWZpbmVkIChJWF9PU0FMX0VCT09UX0xFKQorCisjaW5jbHVkZSAiSXhPc2FsT3NJeHA0MDBDdXN0b21pemVkTWFwcGluZy5oIgorCisjZW5kaWYKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogVHVybiBvZmYgSVhfU1RBVElDX01FTU9SWSBtYXAgZm9yIGNvbXBvbmVudHMgdXNpbmcgZHluYW1pYyBtYXBzICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmZGVmIElYX09TQUxfRFlOQU1JQ19NRU1PUllfTUFQCisKKyN1bmRlZiBJWF9PU0FMX1NUQVRJQ19NRU1PUllfTUFQCisKKyNlbmRpZgorCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIFR1cm4gb2ZmIEJFIGFjY2VzcyBmb3IgY29tcG9uZW50cyB1c2luZyBMRSBvciBubyBtYXBwaW5nICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNpZiAoIGRlZmluZWQgKElYX09TQUxfTEVfQUNfTUFQUElORykgfHwgZGVmaW5lZCAoSVhfT1NBTF9MRV9EQ19NQVBQSU5HKSB8fCBkZWZpbmVkIChJWF9PU0FMX05PX01BUFBJTkcpICkKKworI3VuZGVmIElYX09TQUxfQkVfTUFQUElORworCisjZW5kaWYKKworCisvKioqKioqKioqKioqKioqKioKKyAqIFNhZmV0eSBjaGVja3MgKgorICoqKioqKioqKioqKioqKioqLworCisvKiBEZWZhdWx0I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ICAgICAgICAgKHJlYWR3KChVSU5UMzIpIChzQ29va2llKSApKQorI2RlZmluZSBJWF9PU0FMX1JFQURfQllURV9DT09LSUUoYkNvb2tpZSkgICAgICAgICAgIChyZWFkYigoVUlOVDMyKSAoYkNvb2tpZSkgKSkKKyNkZWZpbmUgSVhfT1NBTF9XUklURV9MT05HX0NPT0tJRSh3Q29va2llLCB3RGF0YSkgICAod3JpdGVsKHdEYXRhLCAoVUlOVDMyKSAod0Nvb2tpZSkgKSkKKyNkZWZpbmUgSVhfT1NBTF9XUklURV9TSE9SVF9DT09LSUUoc0Nvb2tpZSwgc0RhdGEpICAod3JpdGV3KHNEYXRhLCAoVUlOVDMyKSAoc0Nvb2tpZSkgKSkKKyNkZWZpbmUgSVhfT1NBTF9XUklURV9CWVRFX0NPT0tJRShiQ29va2llLCBiRGF0YSkgICAod3JpdGViKGJEYXRhLCAoVUlOVDMyKSAoYkNvb2tpZSkgKSkKKworI2VuZGlmIC8qIGxpbnV4ICovCisKKyNpZmRlZiBfX3dpbmNlCisKKy8qIFdpbkNFIC0gc3BlY2lmaWMgY29va2llIHJlYWRzL3dyaXRlcy4gKi8KKworc3RhdGljIF9faW5saW5lX18gVUlOVDMyCitpeE9zYWxXaW5DRVJlYWRMQ29va2llICh2b2xhdGlsZSBVSU5UMzIgKiBsQ29va2llKQoreworICAgIHJldHVybiAqbENvb2tpZTsKK30KKworc3RhdGljIF9faW5saW5lX18gVUlOVDE2CitpeE9zYWxXaW5DRVJlYWRXQ29va2llICh2b2xhdGlsZSBVSU5UMTYgKiB3Q29va2llKQoreworI2lmIDAKKyAgICBVSU5UMzIgYXV4VmFsID0gKigodm9sYXRpbGUgVUlOVDMyICopIHdDb29raWUpOworICAgIGlmICgodW5zaWduZWQpIHdDb29raWUgJiAzKQorCXJldHVybiAoVUlOVDE2KSAoYXV4VmFsID4+IDE2KTsKKyAgICBlbHNlCisJcmV0dXJuIChVSU5UMTYpIChhdXhWYWwgJiAweGZmZmYpOworI2Vsc2UKKyAgICByZXR1cm4gKndDb29raWU7CisjZW5kaWYKK30KKworc3RhdGljIF9faW5saW5lX18gVUlOVDgKK2l4T3NhbFdpbkNFUmVhZEJDb29raWUgKHZvbGF0aWxlIFVJTlQ4ICogYkNvb2tpZSkKK3sKKyNpZiAwCisgICAgVUlOVDMyIGF1eFZhbCA9ICooKHZvbGF0aWxlIFVJTlQzMiAqKSBiQ29va2llKTsKKyAgICByZXR1cm4gKFVJTlQ4KSAoKGF1eFZhbCA+PiAoMyAtICgoKHVuc2lnbmVkKSBiQ29va2llICYgMykgPDwgMykpICYgMHhmZikpOworI2Vsc2UKKyAgICByZXR1cm4gKmJDb29raWU7CisjZW5kaWYKK30KKworc3RhdGljIF9faW5saW5lX18gdm9pZAoraXhPc2FsV2luQ0VXcml0ZUxDb29raWUgKHZvbGF0aWxlIFVJTlQzMiAqIGxDb29raWUsIFVJTlQzMiBsVmFsKQoreworICAgICpsQ29va2llID0gbFZhbDsKK30KKworc3RhdGljIF9faW5saW5lX18gdm9pZAoraXhPc2FsV2luQ0VXcml0ZVdDb29raWUgKHZvbGF0aWxlIFVJTlQxNiAqIHdDb29raWUsIFVJTlQxNiB3VmFsKQoreworI2lmIDAKKyAgICB2b2xhdGlsZSBVSU5UMzIgKmF1eENvb2tpZSA9CisJKHZvbGF0aWxlIFVJTlQzMiAqKSAoKHVuc2lnbmVkKSB3Q29va2llICYgfjMpOworICAgIGlmICgodW5zaWduZWQpIHdDb29raWUgJiAzKQorICAgIHsKKwkqYXV4Q29va2llICY9IDB4ZmZmZjsKKwkqYXV4Q29va2llIHw9IChVSU5UMzIpIHdWYWwgPDwgMTY7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisJKmF1eENvb2tpZSAmPSB+MHhmZmZmOworCSphdXhDb29raWUgfD0gKFVJTlQzMikgd1ZhbCAmIDB4ZmZmZjsKKyAgICB9CisjZWxzZQorICAgICp3Q29va2llID0gd1ZhbDsKKyNlbmRpZgorfQorCitzdGF0aWMgX19pbmx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bEdsb2JhbE1lbW9yeU1hcFtdID0geworICAgICB7CisgICAgIC8qIEdsb2JhbCBCRSBhbmQgTEVfQUMgbWFwICovCisgICAgIElYX09TQUxfU1RBVElDX01BUCwJLyogdHlwZSAgICAgICAgICAgICovCisgICAgIDB4MDAwMDAwMDAsCQkvKiBwaHlzaWNhbEFkZHJlc3MgKi8KKyAgICAgMHgzMDAwMDAwMCwJCS8qIHNpemUgICAgICAgICAgICAqLworICAgICAweDAwMDAwMDAwLAkJLyogdmlydHVhbEFkZHJlc3MgICovCisgICAgIE5VTEwsCQkJLyogbWFwRnVuY3Rpb24gICAgICovCisgICAgIE5VTEwsCQkJLyogdW5tYXBGdW5jdGlvbiAgICovCisgICAgIDAsCQkJCS8qIHJlZkNvdW50ICAgICAgICAqLworICAgICBJWF9PU0FMX0JFIHwgSVhfT1NBTF9MRV9BQywvKiBlbmRpYW5UeXBlICAgICAgKi8KKyAgICAgImdsb2JhbF9sb3ciCQkvKiBuYW1lICAgICAgICAgICAgKi8KKyAgICAgfSwKKworICAgIC8qIFNEUkFNIExFX0RDIGFsaWFzICovCisgICAgeworICAgICBJWF9PU0FMX1NUQVRJQ19NQVAsCS8qIHR5cGUgICAgICAgICAgICAqLworICAgICAweDAwMDAwMDAwLAkJLyogcGh5c2ljYWxBZGRyZXNzICovCisgICAgIDB4MTAwMDAwMDAsCQkvKiBzaXplICAgICAgICAgICAgKi8KKyAgICAgMHgzMDAwMDAwMCwJCS8qIHZpcnR1YWxBZGRyZXNzICAqLworICAgICBOVUxMLAkJCS8qIG1hcEZ1bmN0aW9uICAgICAqLworICAgICBOVUxMLAkJCS8qIHVubWFwRnVuY3Rpb24gICAqLworICAgICAwLAkJCQkvKiByZWZDb3VudCAgICAgICAgKi8KKyAgICAgSVhfT1NBTF9MRV9EQywJCS8qIGVuZGlhblR5cGUgICAgICAqLworICAgICAic2RyYW1fZGMiCQkJLyogbmFtZSAgICAgICAgICAgICovCisgICAgIH0sCisKKyAgICAvKiBRTUdSIExFX0RDIGFsaWFzICovCisgICAgeworICAgICBJWF9PU0FMX1NUQVRJQ19NQVAsCS8qIHR5cGUgICAgICAgICAgICAqLworICAgICAweDYwMDAwMDAwLAkJLyogcGh5c2ljYWxBZGRyZXNzICovCisgICAgIDB4MDAxMDAwMDAsCQkvKiBzaXplICAgICAgICAgICAgKi8KKyAgICAgMHg2MDAwMDAwMCwJCS8qIHZpcnR1YWxBZGRyZXNzICAqLworICAgICBOVUxMLAkJCS8qIG1hcEZ1bmN0aW9uICAgICAqLworICAgICBOVUxMLAkJCS8qIHVubWFwRnVuY3Rpb24gICAqLworICAgICAwLAkJCQkvKiByZWZDb3VudCAgICAgICAgKi8KKyAgICAgSVhfT1NBTF9MRV9EQywJCS8qIGVuZGlhblR5cGUgICAgICAqLworICAgICAicW1ncl9kYyIJCQkvKiBuYW1lICAgICAgICAgICAgKi8KKyAgICAgfSwKKworICAgIC8qIFFNR1IgQkUgYWxpYXMgKi8KKyAgICB7CisgICAgIElYX09TQUxfU1RBVElDX01BUCwJLyogdHlwZSAgICAgICAgICAgICovCisgICAgIDB4NjAwMDAwMDAsCQkvKiBwaHlzaWNhbEFkZHJlc3MgKi8KKyAgICAgMHgwMDEwMDAwMCwJCS8qIHNpemUgICAgICAgICAgICAqLworICAgICAweDYwMDAwMDAwLAkJLyogdmlydHVhbEFkZHJlc3MgICovCisgICAgIE5VTEwsCQkJLyogbWFwRnVuY3Rpb24gICAgICovCisgICAgIE5VTEwsCQkJLyogdW5tYXBGdW5jdGlvbiAgICovCisgICAgIDAsCQkJCS8qIHJlZkNvdW50ICAgICAgICAqLworICAgICBJWF9PU0FMX0JFIHwgSVhfT1NBTF9MRV9BQywvKiBlbmRpYW5UeXBlICAgICAgKi8KKyAgICAgInFtZ3JfYmUiCQkJLyogbmFtZSAgICAgICAgICAgICovCisgICAgIH0sCisKKyAgICAvKiBHbG9iYWwgQkUgYW5kIExFX0FDIG1hcCAqLworICAgIHsKKyAgICAgSVhfT1NBTF9TVEFUSUNfTUFQLAkvKiB0eXBlICAgICAgICAgICAgKi8KKyAgICAgMHg0MDAwMDAwMCwJCS8qIHBoeXNpY2FsQWRkcmVzcyAqLworICAgICAweDIwMDAwMDAwLAkJLyogc2l6ZSAgICAgICAgICAgICovCisgICAgIDB4NDAwMDAwMDAsCQkvKiB2aXJ0dWFsQWRkcmVzcyAgKi8KKyAgICAgTlVMTCwJCQkvKiBtYXBGdW5jdGlvbiAgICAgKi8KKyAgICAgTlVMTCwJCQkvKiB1bm1hcEZ1bmN0aW9uICAgKi8KKyAgICAgMCwJCQkJLyogcmVmQ291bnQgICAgICAgICovCisgICAgIElYX09TQUxfQkUgfCBJWF9PU0FMX0xFX0FDLC8qIGVuZGlhblR5cGUgICAgICAqLworICAgICAiTWlzYyBDZmciCQkJLyogbmFtZSAgICAgICAgICAgICovCisgICAgIH0sCisKKyAgICAvKiBHbG9iYWwgQkUgYW5kIExFX0FDIG1hcCAqLworICAgIHsKKyAgICAgSVhfT1NBTF9TVEFUSUNfTUFQLAkvKiB0eXBlICAgICAgICAgICAgKi8KKyAgICAgMHg3MDAwMDAwMCwJCS8qIHBoeXNpY2FsQWRkcmVzcyAqLworICAgICAweDhGRkZGRkZGLAkJLyogc2l6ZSAgICAgICAgICAgICovCisgICAgIDB4NzAwMDAwMDAsCQkvKiB2aXJ0dWFsQWRkcmVzcyAgKi8KKyAgICAgTlVMTCwJCQkvKiBtYXBGdW5jdGlvbiAgICAgKi8KKyAgICAgTlVMTCwJCQkvKiB1bm1hcEZ1bmN0aW9uICAgKi8KKyAgICAgMCwJCQkJLyogcmVmQ291bnQgICAgICAgICovCisgICAgIElYX09TQUxfQkUgfCBJWF9PU0FMX0xFX0FDLC8qIGVuZGlhblR5cGUgICAgICAqLworICAgICAiRXhwIENmZyIJCQkvKiBuYW1lICAgICAgICAgICAgKi8KKyAgICAgfSwKK307CisKKyNlbmRpZiAvKiBJeE9zYWxJb01lbV9DICovCisjZW5kaWYgLyogI2RlZmluZSBJeE9zYW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QgTm90aWNlIC0tCisgKi8KKworI2lmbmRlZiBJeE9zYWxPc0l4cDQwMEN1c3RvbWl6ZWRNYXBwaW5nX0gKKyNkZWZpbmUgSXhPc2FsT3NJeHA0MDBDdXN0b21pemVkTWFwcGluZ19ICisKKy8qCisgKiBvbmx5IGluY2x1ZGUgdGhpcyBmaWxlIGluIExpdHRsZSBFbmRpYW4KKyAqLworCisjaWYgZGVmaW5lZCAoSVhfT1NBTF9MSU5VWF9CRSkKKyNlcnJvciBPbmx5IGluY2x1ZGUgSXhPc2FsT3NJeHA0MDBDdXN0b21pemVkTWFwcGluZy5oIGluIExpdHRsZSBFbmRpYW4KKyNlbmRpZgorCisgLyoKKyAgKiBDb21wb25lbnRzIGRvbid0IGhhdmUgdG8gYmUgaW4gdGhpcyBsaXN0IGlmCisgICogdGhlIGRlZmF1bHQgbWFwcGluZyBpcyBPSy4KKyAgKi8KKyNkZWZpbmUgaXhfb3NhbCAgICAgICAgICAgICAgICAxCisjZGVmaW5lIGl4X2RtYUFjYyAgICAgICAgICAgICAgMgorI2RlZmluZSBpeF9hdG1kQWNjICAgICAgICAgICAgIDMKKworI2RlZmluZSBpeF9hdG1zY2ggICAgICAgICAgICAgIDUKKyNkZWZpbmUgaXhfZXRoQWNjICAgICAgICAgICAgICA2CisjZGVmaW5lIGl4X25wZU1oICAgICAgICAgICAgICAgNworI2RlZmluZSBpeF9xbWdyICAgICAgICAgICAgICAgIDgKKyNkZWZpbmUgaXhfbnBlRGwgICAgICAgICAgICAgICA5CisjZGVmaW5lIGl4X2F0bW0gICAgICAgICAgICAgICAgMTAKKyNkZWZpbmUgaXhfaHNzQWNjICAgICAgICAgICAgICAxMQorI2RlZmluZSBpeF9ldGhEQiAgICAgICAgICAgICAgIDEyCisjZGVmaW5lIGl4X2V0aE1paSAgICAgICAgICAgICAgMTMKKyNkZWZpbmUgaXhfdGltZXJDdHJsICAgICAgICAgICAxNAorI2RlZmluZSBpeF9hZHNsICAgICAgICAgICAgICAgIDE1CisjZGVmaW5lIGl4X3VzYiAgICAgICAgICAgICAgICAgMTYKKyNkZWZpbmUgaXhfdWFydEFjYyAgICAgICAgICAgICAxNworI2RlZmluZSBpeF9mZWF0dXJlQ3RybCAgICAgICAgIDE4CisjZGVmaW5lIGl4X2NyeXB0b0FjYyAgICAgICAgICAgMTkKKyNkZWZpbmUgaXhfdW5sb2FkQWNjICAgICAgICAgICAzMworI2RlZmluZSBpeF9wZXJmUHJvZkFjYyAgICAgICAgIDM0CisjZGVmaW5lIGl4X3Bhcml0eUVOQWNjICAgICAgICAgICAgICAgICA0OQorI2RlZmluZSBpeF9zc3BBY2MgICAgICAgICAgICAgICAgICAgICAgNTEKKyNkZWZpbmUgaXhfdGltZVN5bmNBY2MgICAgICAgICAgICAgICAgIDUyCisjZGVmaW5lIGl4X2kyYyAgICAgICAgICAgICAgICAgICAgICAgICA1MworCisjZGVmaW5lIGl4X2NvZGVsZXRzX3VhcnRBY2MgICAgMjEKKyNkZWZpbmUgaXhfY29kZWxldHNfdGltZXJzICAgICAyMgorI2RlZmluZSBpeF9jb2RlbGV0c19hdG0gICAgICAgIDIzCisjZGVmaW5lIGl4X2NvZGVsZXRzX2V0aEFhbDVBcHAgMjQKKyNkZWZpbmUgaXhfY29kZWxldHNfZGVtb1V0aWxzICAyNgorI2RlZmluZSBpeF9jb2RlbGV0c191c2IgICAgICAgIDI3CisjZGVmaW5lIGl4X2NvZGVsZXRzX2hzc0FjYyAgICAgMjgKKyNkZWZpbmUgaXhfY29kZWxldHNfZG1hQWNjICAgICAgICAgNDAKKyNkZWZpbmUgaXhfY29kZWxldHNfY3J5cHRvQWNjCSAgIDQxCisjZGVmaW5lIGl4X2NvZGVsZXRzX3BlcmZQcm9mQWNjICAgIDQyCisjZGVmaW5lIGl4X2NvZGVsZXRzX2V0aEFjYyAgICAgICAgIDQzCisjZGVmaW5lIGl4X2NvZGVsZXRzX3Bhcml0eUVOQWNjICAgICAgICA1NAorI2RlZmluZSBpeF9jb2RlbGV0c190aW1lU3luY0FjYyAgICAgICAgNTUKKworCisjZW5kaWYgLyogSXhPc2FsT3NJeHA0MDBDdXN0b21pemVkTWFwcGluZ19IICovCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogb3NhbAorICoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZiAoSVhfQ09NUE9ORU5UX05BTUUgPT0gaXhfb3NhbCkKKworI2RlZmluZSBJWF9PU0FMX0xFX0FDX01BUFBJTkcKKworI2VuZGlmIC8qIG9zYWwgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogZG1hQWNjCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmIChJWF9DT01QT05FTlRfTkFNRSA9PSBpeF9kbWFBY2MpCisKKyNkZWZpbmUgSVhfT1NBTF9MRV9BQ19NQVBQSU5HCisKKyNlbmRpZiAvKiBkbWFBY2MgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogYXRtZEFjYworICoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZiAoSVhfQ09NUE9ORU5UX05BTUUgPT0gaXhfYXRtZEFjYykKKworI2RlZmluZSBJWF9PU0FMX0xFX0FDX01BUFBJTkcKKworI2VuZGlmIC8qIGF0bWRBY2MgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogYXRtc2NoCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmIChJWF9DT01QT05FTlRfTkFNRSA9PSBpeF9hdG1zY2gpCisKKyNkZWZpbmUgSVhfT1NBTF9MRV9BQ19NQVBQSU5HCisKKyNlbmRpZiAvKiBhdG1zY2ggKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogZXRoQWNjCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmIChJWF9DT01QT05FTlRfTkFNRSA9PSBpeF9ldGhBY2MpCisKKyNkZWZpbmUgSVhfT1NBTF9MRV9BQ19NQVBQSU5HCisKKyNlbmRpZiAvKiBldGhBY2MgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogbnBlTWgKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWYgKElYX0NPTVBPTkVOVF9OQU1FID09IGl4X25wZU1oKQorCisjZGVmaW5lIElYX09TQUxfTEVfQUNfTUFQUElORworCisjZW5kaWYgLyogbnBlTWggKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogcW1ncgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZiAoSVhfQ09NUE9ORU5UX05BTUUgPT0gaXhfcW1ncikKKworI2RlZmluZSBJWF9PU0FMX0xFX0RDX01BUFBJTkcKKworI2VuZGlmIC8qIHFtZ3IgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogbnBlRGwKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWYgKElYX0NPTVBPTkVOVF9OQU1FID09IGl4X25wZURsKQorCisjZGVmaW5lIElYX09TQUxfTEVfQUNfTUFQUElORworCisjZW5kaWYgLyogbnBlRGwgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogYXRtbQorICoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZiAoSVhfQ09NUE9ORU5UX05BTUUgPT0gaXhfYXRtbSkKKworI2RlZmluZSBJWF9PU0FMX0xFX0FDX01BUFBJTkcKKworI2VuZGlmIC8qIGF0bW0gKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogZXRoTWlpCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmIChJWF9DT01QT05FTlRfTkFNRSA9PSBpeF9ldGhNaWkpCisKKyNkZWZpbmUgSVhfT1NBTF9MRV9BQ19NQVBQSU5HCisKKyNlbmRpZiAvKiBldGhNaWkgKi8KKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBhZHNsCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmIChJWF9DT01QT05FTlRfTkFNRSA9PSBpeF9hZHNsKQorCisjZGVmaW5lIElYX09TQUxfTEVfQUNfTUFQUElORworCisjZW5kaWYgLyogYWRzbCAqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiB1c2IKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWYgKElYX0NPTVBPTkVOVF9OQU1FID09IGl4X3VzYikKKworI2RlZmluZSBJWF9PU0FMX0xFX0FDX01BUFBJTkcKKworI2VuZGlmIC8qIHVzYiAqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiB1YXJ0QWNjCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmIChJWF9DT01QT05FTlRfTkFNRSA9PSBpeF91YXJ0QWNjKQorCisjZGVmaW5lIElYX09TQUxfTEVfQUNfTUFQUElORworCisjZW5kaWYgLyogdWFydEFjYyAqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBmZWF0dXJlQ3RybAorICoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZiAoSVhfQ09NUE9ORU5UX05BTUUgPT0gaXhfZmVhdHVyZUN0cmwpCisKKyNkZWZpbmUgSVhfT1NBTF9MRV9BQ19NQVBQSU5HCisKKyNlbmRpZiAvKiBmZWF0dXJlQ3RybCAqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBjcnlwdG9BY2MKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWYgKElYX0NPTVBPTkVOVF9OQU1FID09IGl4X2NyeXB0b0FjYykKKworI2RlZmluZSBJWF9PU0FMX0xFX0FDX01BUFBJTkcKKworI2VuZGlmIC8qIGNyeXB0b0FjYyAqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBjb2RlbGV0c191c2IKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWYgKElYX0NPTVBPTkVOVF9OQU1FID09IGl4X2NvZGVsZXRzX3VzYikKKworI2RlZmluZSBJWF9PU0FMX0xFX0FDX01BUFBJTkcKKworI2VuZGlmIC8qIGNvZGVsZXRzX3VzYiAqLworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIGNvZGVsZXRzX3VhcnRBY2MKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWYgKElYX0NPTVBPTkVOVF9OQU1FID09IGl4X2NvZGVsZXRzX3VhcnRBY2MpCisKKyNkZWZpbmUgSVhfT1NBTF9MRV9BQ19NQVBQSU5HCisKKyNlbmRpZiAvKiBjb2RlbGV0c191YXJ0QWNjICovCisKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBjb2RlbGV0c190aW1lcnMKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWYgKElYX0NPTVBPTkVOVF9OQU1FID09IGl4X2NvZGVsZXRzX3RpbWVycykKKworI2RlZmluZSBJWF9PU0FMX0xFX0FDX01BUFBJTkcKKworI2VuZGlmIC8qIGNvZGVsZXRzX3RpbWVycyAqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBjb2RlbGV0c19hdG0KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWYgKElYX0NPTVBPTkVOVF9OQU1FID09IGl4X2NvZGVsZXRzX2F0bSkKKworI2RlZmluZSBJWF9PU0FMX0xFX0FDX01BUFBJTkcKKworI2VuZGlmIC8qIGNvZGVsZXRzX2F0bSAqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBjb2RlbGV0c19ldGhBYWw1QXBwCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmIChJWF9DT01QT05FTlRfTkFNRSA9PSBpeF9jb2RlbGV0c19ldGhBYWw1QXBwKQorCisjZGVmaW5lIElYX09TQUxfTEVfQUNfTUFQUElORworCisjZW5kaWYgLyogY29kZWxldHNfZXRoQWFsNUFwcCAqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBjb2RlbGV0c19ldGhBY2MKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWYgKElYX0NPTVBPTkVOVF9OQU1FID09IGl4X2NvZGVsZXRzX2V0aEFjYykKKworI2RlZmluZSBJWF9PU0FMX0xFX0FDX01BUFBJTkcKKworI2VuZGlmIC8qIGNvZGVsZXRzX2V0aEFjYyAqLworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIGNvZGVsZXRzX2RlbW9VdGlscworICoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZiAoSVhfQ09NUE9ORU5UX05BTUUgPT0gaXhfY29kZWxldHNfZGVtb1V0aWxzKQorCisjZGVmaW5lIElYX09TQUxfTEVfQUNfTUFQUElORworCisjZW5kaWYgLyogY29kZWxldHNfZGVtb1V0aWxzICovCisKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBwZXJmUHJvZkFjYworICoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZiAoSVhfQ09NUE9ORU5UX05BTUUgPT0gaXhfcGVyZlByb2ZBY2MpCisKKyNkZWZpbmUgSVhfT1NBTF9MRV9BQ19NQVBQSU5HCisKKyNlbmRpZiAvKiBwZXJmUHJvZkFjYyAqLworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIHVubG9hZEFjYworICoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZiAoSVhfQ09NUE9ORU5UX05BTUUgPT0gaXhfdW5sb2FkQWNjKQorCisjZGVmaW5lIElYX09TQUxfTEVfQUNfTUFQUElORworCisjZW5kaWYgLyogdW5sb2FkQWNjICovCisKKworCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogcGFyaXR5RU5BY2MKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWYgKElYX0NPTVBPTkVOVF9OQU1FID09IGl4X3Bhcml0eUVOQWNjKQorCisjZGVmaW5lIElYX09TQUxfTEVfQUNfTUFQUElORworCisjZW5kaWYgLyogcGFyaXR5RU5BY2MgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogY29kZWxldHNfcGFyaXR5RU5BY2MKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWYgKElYX0NPTVBPTkVOVF9OQU1FID09IGl4X2NvZGVsZXRzX3Bhcml0eUVOQWNjKQorCisjZGVmaW5lIElYX09TQUxfTEVfQUNfTUFQUElORworCisjZW5kaWYgLyogY29kZWxldHNfcGFyaXR5RU5BY2MgKi8KKworCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogdGltZVN5bmNBY2MKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWYgKElYX0NPTVBPTkVOVF9OQU1FID09IGl4X3RpbWVTeW5jQWNjKQorCisjZGVmaW5lIElYX09TQUxfTEVfQUNfTUFQUElORworCisjZW5kaWYgLyogdGltZVN5bmNBY2MgKi8KKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBjb2RlbGV0c190aW1lU3luY0FjYworICoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZiAoSVhfQ09NUE9ORU5UX05BTUUgPT0gaXhfY29kZWxldHNfdGltZVN5bmNBY2MpCisKKyNkZWZpbmUgSVhfT1NBTF9MRV9BQ19NQVBQSU5HCisKKyNlbmRpZiAvKiBjb2RlbGV0c190aW1lU3luY0FjYyAqLworCisKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBpMmMKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWYgKElYX0NPTVBPTkVOVF9OQU1FID09IGl4X2kyYykKKworI2RlZmluZSBJWF9PU0FMX0xFX0FDX01BUFBJTkcKKworI2VuZGlmIC8qIGkyYyAqLworCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogc3NwQWNjCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmIChJWF9D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iBAYnJpZWYgVGltZXZhbCBzdHJ1Y3R1cmUKKyAqCisgKiBAbm90ZSBDb250YWluIHN1YmZpZWxkcyBvZiBzZWNvbmRzIGFuZCBuYW5vc2Vjb25kcy4uCisgKi8KK3R5cGVkZWYgc3RydWN0Cit7CisgICAgVUlOVDMyIHNlY3M7CQkvKio8IHNlY29uZHMgKi8KKyAgICBVSU5UMzIgbnNlY3M7CQkvKio8IG5hbm9zZWNvbmRzICovCit9IEl4T3NhbFRpbWV2YWw7CisKKworLyoqCisgKiBAaW5ncm91cCBJeE9zYWxUeXBlcworICogQGJyaWVmIEl4T3NhbFRpbWVyCisgKgorICogQG5vdGUgT1NBTCB0aW1lciBoYW5kbGUKKyAqCisgKi8KK3R5cGVkZWYgVUlOVDMyIEl4T3NhbFRpbWVyOworCisKKy8qKgorICogQGluZ3JvdXAgSXhPc2FsVHlwZXMKKyAqCisgKiBAZGVmIElYX09TQUxfV0FJVF9GT1JFVkVSCisgKgorICogQGJyaWVmIERlZmluaXRpb24gZm9yIHRpbWVvdXQgZm9yZXZlciwgT1Mtc3BlY2lmaWMuCisgKgorICovCisjZGVmaW5lIElYX09TQUxfV0FJVF9GT1JFVkVSIElYX09TQUxfT1NfV0FJVF9GT1JFVkVSCisKKy8qKgorICogQGluZ3JvdXAgSXhPc2FsVHlwZXMKKyAqCisgKiBAZGVmIElYX09TQUxfV0FJVF9OT05FCisgKgorICogQGJyaWVmIERlZmluaXRpb24gZm9yIHRpbWVvdXQgMCwgT1Mtc3BlY2lmaWMuCisgKgorICovCisjZGVmaW5lIElYX09TQUxfV0FJVF9OT05FICAgIElYX09TQUxfT1NfV0FJVF9OT05FCisKKworLyoqCisgKiBAaW5ncm91cCBJeE9zYWxUeXBlcworICogQGJyaWVmIEl4T3NhbE11dGV4CisgKgorICogQG5vdGUgTXV0ZXggaGFuZGxlLCBPUy1zcGVjaWZpYworICoKKyAqLwordHlwZWRlZiBJeE9zYWxPc011dGV4IEl4T3NhbE11dGV4OworCisvKio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AorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV4cCBCdXMgQ3RybHIgKEluYm91bmQgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaS5lLiwgRXh0ZXJuYWwgTWFzdGVyKSAqLworICBJeFBhcml0eUVOQWNjUGFyaXR5RXJyb3JBZGRyZXNzICAgIHBlY0FkZHJlc3M7ICAgICAgLyoqPCBBZGRyZXNzIGZhdWx0eSBsb2NhdGlvbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWYWxpZCBvbmx5IGZvciBBUU0sIEREUiBNQ1UsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHAgQnVzIEN0cmxyICovCisgIEl4UGFyaXR5RU5BY2NQYXJpdHlFcnJvckRhdGEgICAgICAgcGVjRGF0YTsgICAgICAgICAvKio8IERhdGEgcmVhZCBmcm9tIHRoZSBmYXVsdHkgbG9jYXRpb24KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVmFsaWQgb25seSBmb3IgQVFNIGFuZCBERFIgTUNVCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZvciBERFIgTUNVIGl0IGlzIHRoZSBiaXQgbG9jYXRpb24KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2YgdGhlIFNpbmdsZS1iaXQgcGFyaXR5ICovCisgIEl4UGFyaXR5RU5BY2NQYXJpdHlFcnJvclJlcXVlc3RlciAgcGVjUmVxdWVzdGVyOyAgICAvKio8IFJlcXVlc3RlciBvZiBTRFJBTSBtZW1vcnkgYWNjZXNzCisgIC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ZCBvZmYgYXQgdGhlIGludGVycnVwdCBjb250cm9sbGVyIAorICogICAgICAgICAgICAgICAgICAgIHNvIHRoYXQgaXQgd2lsbCBub3QgdHJpZ2dlciBjb250aW51b3VzbHkuCisgKiAgICAgICAgICAgICAgICAgICAgICBDbGllbnQgYXBwbGljYXRpb24gaGFzIHRvIHRha2UgYXBwcm9wcmlhdGUgYWN0aW9uIGFuZCAKKyAqICAgICAgICAgICAgICAgICAgICAgIHJlLWNvbmZpZ3VyZSB0aGUgcGFyaXR5IGVycm9yIGRldGVjdGlvbiBzdWJzZXF1ZW50bHkuIAorICogICAgICAgICAgICAgICAgICAgICAgVGhlIGNsaWVudCBhcHBsaWNhdGlvbiB3aWxsIG5vdCBiZSBub3RpZmllZCBvZiBmdXJ0aGVyCisgKiAgICAgICAgICAgICAgICAgICAgICBpbnRlcnJ1cHRzLCB1bnRpbCB0aGUgcmUtY29uZmlndXJhdGlvbiBpcyBkb25lIHVzaW5nCisgKiAgICAgICAgICAgICAgICAgICAgICBAcmVmIGl4UGFyaXR5RU5BY2NQYXJpdHlEZXRlY3Rpb25Db25maWd1cmUuCisgKgorICogIE5QRS1DICAgICAgICAgICAgIEludGVycnVwdCB3aWxsIGJlIG1hc2tlZCBvZmYgYXQgdGhlIGludGVycnVwdCBjb250cm9sbGVyIAorICogICAgICAgICAgICAgICAgICAgICAgQ2xpZW50IGFwcGxpY2F0aW9uIGhhcyB0byB0YWtlIGFwcHJvcHJpYXRlIGFjdGlvbiBhbmQgCisgKiAgICAgICAgICAgICAgICAgICAgICByZS1jb25maWd1cmUgdGhlIHBhcml0eSBlcnJvciBkZXRlY3Rpb24gc3Vic2VxdWVudGx5LiAKKyAqICAgICAgICAgICAgICAgICAgICAgIFRoZSBjbGllbnQgYXBwbGljYXRpb24gd2lsbCBub3QgYmUgbm90aWZpZWQgb2YgZnVydGhlcgorICogICAgICAgICAgICAgICAgICAgICAgaW50ZXJydXB0cywgdW50aWwgdGhlIHJlLWNvbmZpZ3VyYXRpb24gaXMgZG9uZSB1c2luZworICogICAgICAgICAgICAgICAgICAgICAgQHJlZiBpeFBhcml0eUVOQWNjUGFyaXR5RGV0ZWN0aW9uQ29uZmlndXJlLgorICoKKyAqICBTV0NQICAgICAgICAgICAgICBJbnRlcnJ1cHQgd2lsbCBiZSBtYXNrZWQgb2ZmIGF0IHRoZSBpbnRlcnJ1cHQgY29udHJvbGxlci4KKyAqICAgICAgICAgICAgICAgICAgICAgIENsaWVudCBhcHBsaWNhdGlvbiBoYXMgdG8gdGFrZSBhcHByb3ByaWF0ZSBhY3Rpb24gYW5kIAorICogICAgICAgICAgICAgICAgICAgICAgcmUtY29uZmlndXJlIHRoZSBwYXJpdHkgZXJyb3IgZGV0ZWN0aW9uIHN1YnNlcXVlbnRseS4gCisgKiAgICAgICAgICAgICAgICAgICAgICBUaGUgY2xpZW50IGFwcGxpY2F0aW9uIHdpbGwgbm90IGJlIG5vdGlmaWVkIG9mIGZ1cnRoZXIKKyAqICAgICAgICAgICAgICAgICAgICAgIGludGVycnVwdHMsIHVudGlsIHRoZSByZS1jb25maWd1cmF0aW9uIGlzIGRvbmUgdXNpbmcKKyAqICAgICAgICAgICAgICAgICAgICAgIEByZWYgaXhQYXJpdHlFTkFjY1Bhcml0eURldGVjdGlvbkNvbmZpZ3VyZS4KKyAqCisgKiAgQVFNICAgICAgICAgICAgICAgSW50ZXJydXB0IHdpbGwgYmUgbWFza2VkIG9mZiBhdCB0aGUgaW50ZXJydXB0IGNvbnRyb2xsZXIuCisgKiAgICAgICAgICAgICAgICAgICAgICAgICBDbGllbnQgYXBwbGljYXRpb24gaGFzIHRvIHRha2UgYXBwcm9wcmlhdGUgYWN0aW9uIGFuZCAKKyAqICAgICAgICAgICAgICAgICAgICAgICAgIHJlLWNvbmZpZ3VyZSB0aGUgcGFyaXR5IGVycm9yIGRldGVjdGlvbiBzdWJzZXF1ZW50bHkuIAorICogICAgICAgICAgICAgICAgICAgICAgICAgVGhlIGNsaWVudCBhcHBsaWNhdGlvbiB3aWxsIG5vdCBiZSBub3RpZmllZCBvZiBmdXJ0aGVyCisgKiAgICAgICAgICAgICAgICAgICAgICAgICBpbnRlcnJ1cHRzLCB1bnRpbCB0aGUgcmUtY29uZmlndXJhdGlvbiBpcyBkb25lIHVzaW5nCisgKiAgICAgICAgICAgICAgICAgICAgICAgICBAcmVmIGl4UGFyaXR5RU5BY2NQYXJpdHlEZXRlY3Rpb25Db25maWd1cmUuCisgKgorICogIE1DVSAgICAgICAgICAgICAgIFBhcml0eSBpbnRlcnJ1cHQgY29uZGl0aW9uIGlzIGNsZWFyZWQgYXQgdGhlIFNEUkFNIE1DVSBmb3IgCisgKiAgICAgICAgICAgICAgICAgICAgdGhlIGZvbGxvd2luZzoKKyAqICAgICAgICAgICAgICAgICAgICAxLiBTaW5nbGUtYml0CisgKiAgICAgICAgICAgICAgICAgICAgMi4gTXVsdGktYml0CisgKiAgICAgICAgICAgICAgICAgICAgMy4gT3ZlcmZsb3cgY29uZGl0aW9uIGkuZS4sIG1vcmUgdGhhbiB0d28gcGFyaXR5IGNvbmRpdGlvbnMgCisgKiAgICAgICAgICAgICAgICAgICAgICAgb2NjdXJyZWQKKyAqICAgICAgICAgICAgICAgICAgICBOb3RlIHRoYXQgc2luZ2xlLXBhcml0eSBlcnJvcnMgZG8gbm90IHJlc3VsdCBpbiBkYXRhIGFib3J0CisgKiAgICAgICAgICAgICAgICAgICAgYW5kIG5vdCBhbGwgZGF0YSBhYm9ydHMgY2F1c2VkIGJ5IG11bHRpLWJpdCBwYXJpdHkgZXJyb3IuCisgKgorICogIEVYUCAgICAgICAgICAgICAgIFBhcml0eSBpbnRlcnJ1cHQgY29uZGl0aW9uIGlzIGNsZWFyZWQgYXQgdGhlIGV4cGFuc2lvbiBidXMgCisgKiAgICAgICAgICAgICAgICAgICAgY29udHJvbGxlciBmb3IgdGhlIGZvbGxvd2luZzoKKyAqICAgICAgICAgICAgICAgICAgICAxLiBFeHRlcm5hbCBtYXN0ZXIgaW5pdGlhdGVkIEluYm91bmQgd3JpdGUKKyAqICAgICAgICAgICAgICAgICAgICAyLiBJbnRlcm5hbCBtYXN0ZXIgKElYUDQwMCkgaW5pdGlhdGVkIE91dGJvdW5kIHJlYWQKKyAqICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIDwvcHJlPgorICogQGxpICAgUmUtZW50cmFudCAgIDogTm8KKyAqIEBsaSAgIElTUiBDYWxsYWJsZSA6IE5vCisgKgorICogQHJldHVybiBAbGkgSVhfUEFSSVRZRU5BQ0NfU1VDQ0VTUy1UaGUgcGFyYW1ldGVycyBjaGVjayBwYXNzZWQgYW5kIHRoZSByZXF1ZXN0CisgKiAgICAgICAgICAgICB0byBjbGVhciB0aGUgcGFyaXR5IGVycm9yIGludGVycnVwdCBjb25kaXRpb24gaXMgc3VjY2Vzc2Z1bC4KKyAqICAgICAgICAgQGxpIElYX1BBUklUWUVOQUNDX0lOVkFMSURfUEFSQU1FVEVSUy1UaGUgcmVxdWVzdCBmYWlsZWQgZHVlIHRvIAorICogICAgICAgICAgICAgTlVMTCBwYXJhbWV0ZXJzIGhhdmUgYmVlbiBwYXNzZWQgb3IgY29udGVudHMgaGF2ZSBiZWVuCisgKiAgICAgICAgICAgICBzdXBwbGllZCB3aXRoIGludmFsaWQgdmFsdWVzLgorICogICAgICAgICBAbGkgSVhfUEFSSVRZRU5BQ0NfT1BFUkFUSU9OX0ZBSUxFRCAtIFRoZSByZXF1ZXN0IGZhaWxlZCBiZWNhdXNlIAorICogICAgICAgICAgICAgdGhlIG9wZXJhdGlvbiBkaWRuJ3Qgc3VjY2VlZCBvbiB0aGUgaGFyZHdhcmUuCisgKiAgICAgICAgIEBsaSBJWF9QQVJJVFlFTkFDQ19OT1RfSU5JVElBTElTRUQgLSBUaGUgb3BlcmF0aW9uIHJlcXVlc3RlZCBwcmlvcgorICogICAgICAgICAgICAgdG8gdGhlIGlu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9QRVJGUFJPRl9BQ0NfU1RBVFVTX1hDWUNMRV9USFJFQURfQ1JFQVRFX0ZBSUwsIC8qKjwgCisJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIEZhaWwgY3JlYXRlIHRocmVhZAorCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKwlJWF9QRVJGUFJPRl9BQ0NfU1RBVFVTX1hDWUNMRV9QUklPUklUWV9SRVNUT1JFX0ZBSUwsICAvKio8CisJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKmNhbm5vdCByZXN0b3JlCisJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKnByaW9yaXR5CisJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKwlJWF9QRVJGUFJPRl9BQ0NfU1RBVFVTX1hDWUNMRV9NRUFTVVJFTUVOVF9OT1RfUlVOTklORywgLyoqPCB4Y3ljbGUgbm90IHJ1bm5pbmcqLworICAgCUlYX1BFUkZQUk9GX0FDQ19TVEFUVVNfWFNDQUxFX1BNVV9OVU1fSU5WQUxJRCwgLyoqPCBpbnZhbGlkIG51bWJlciAKKyAgIAkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqZW50ZXJlZAorICAgCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisJSVhfUEVSRlBST0ZfQUNDX1NUQVRVU19YU0NBTEVfUE1VX0VWRU5UX0lOVkFMSUQsIC8qKjwgaW52YWxpZCBwbXUgZXZlbnQqLworCUlYX1BFUkZQUk9GX0FDQ19TVEFUVVNfWFNDQUxFX1BNVV9TVEFSVF9OT1RfQ0FMTEVELCAvKio8YSBzdGFydCBwcm9jZXNzCisJ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mQWNjWHNjYWxlUG11RXZlbnRTYW1wU3RvcCgKKyAgICBJeFBlcmZQcm9mQWNjWHNjYWxlUG11U2FtcGxlUGNQcm9maWxlICpldmVudFByb2ZpbGUxLAorICAgIEl4UGVyZlByb2ZBY2NYc2NhbGVQbXVTYW1wbGVQY1Byb2ZpbGUgKmV2ZW50UHJvZmlsZTIsCisgICAgSXhQZXJmUHJvZkFjY1hzY2FsZVBtdVNhbXBsZVBjUHJvZmlsZSAqZXZlbnRQcm9maWxlMywKKyAgICBJeFBlcmZQcm9mQWNjWHNjYWxlUG11U2FtcGxlUGNQcm9maWxlICpldmVudFByb2ZpbGU0KTsKKworLyoqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAqIEBpbmdyb3VwIEl4UGVyZlByb2ZBY2MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgKiBAZm4gaXhQZXJmUHJvZkFjY1hzY2FsZVBtdVJlc3VsdHNHZXQoSXhQZXJmUHJvZkFjY1hzY2FsZVBtdVJlc3VsdHMgKnJlc3VsdHMpICAgICAKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgKiBAYnJpZWYgUmVhZHMgdGhlIGN1cnJlbnQgdmFsdWUgb2YgdGhlIGNvdW50ZXJzIGFuZCB0aGVpciBvdmVyZmxvdyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgKiBAcGFyYW0gKnJlc3Vs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ICAgICAgICAgICAKKyAqIEByZXR1cm4gLSBub25lCisgKiAgICAgICAgICAgICAgCisgKiBAbGkgICBSZWVudHJhbnQgICAgOiBubworICogQGxpICAgSVNSIENhbGxhYmxlIDogbm8KKyAqCisgKi8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorUFVCTElDIHZvaWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAoraXhQZXJmUHJvZkFjY1hzY2FsZVBtdVJlc3VsdHNHZXQoSXhQZXJmUHJvZkFjY1hzY2FsZVBtdVJlc3VsdHMgKnJlc3VsdHMpOyAgICAKKworLyoqCisgKiBAaW5ncm91cCBJeFBlcmZQcm9mQWNjCisgKiAKKyAqIEBmbiBpeFBlcmZQcm9mQWNjQnVzUG11U3RhcnQoCisgICAgICAgIEl4UGVyZlByb2ZBY2NCdXNQbXVNb2RlIG1vZGUsIAorICAgICAgICBJeFBlcmZQcm9mQWNjQnVzUG11RXZlbnRDb3VudGVyczEgcGVjRXZlbnQxLAorICAgICAgICBJeFBlcmZQcm9mQWNjQnVzUG11RXZlbnRDb3VudGVyczIgcGVjRXZlbnQyLCAKKyAgICAgICAgSXhQZXJmUHJvZkFjY0J1c1BtdUV2ZW50Q291bnRlcnMzIHBlY0V2ZW50MywgCisgICAgICAgIEl4UGVyZlByb2ZBY2NCdXNQbXVFdmVudENvdW50ZXJzNCBwZWNFdmVudDQsCisgICAgICAgIEl4UGVyZlByb2ZBY2NCdXNQbXVFdmVudENvdW50ZXJzNSBwZWNFdmVudDUsIAorICAgICAgICBJeFBlcmZQcm9mQWNjQnVzUG11RXZlbnRDb3VudGVyczYgcGVjRXZlbnQ2LCAKKyAgICAgICAgSXhQZXJmUHJvZkFjY0J1c1BtdUV2ZW50Q291bnRlcnM3IHBlY0V2ZW50NykKKyAqIEBicmllZiBJbml0aWFsaXplcyBhbGwgdGhl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MpOworCisvKioKKyAqIEBpbmdyb3VwIEl4UGVyZlByb2ZBY2MKKyAqIAorICogQGZuIGl4UGVyZlByb2ZBY2NCdXNQbXVQTVNSR2V0ICgKKwlVSU5UMzIgKnBtc3JWYWx1ZSkKKyAqIEBicmllZiBHZXQgdmFsdWVzIG9mIFBNU1IgIAorICoKKyAqIFRoaXMgQVBJIGdldHMgdGhlIFByZXZpb3VzIE1hc3RlciBTbGF2ZSBSZWdpc3RlcgorICogdmFsdWUgYW5kIHJldHVybnMgaXQgdG8gdGhlIGNhbGxpbmcgZnVuY3Rpb24uIFRoaXMgdmFsdWUgaW5kaWNhdGVzCisgKiB3aGljaCBtYXN0ZXIgb3Igc2xhdmUgYWNjZXNzZWQgdGhlIG5vcnRoLCBzb3V0aCBidXMgb3Igc2RyYW0gbGFzdC4KKyAqIFRoZSB2YWx1ZSByZXR1cm5lZCBieSB0aGlzIGZ1bmN0aW9uIGlzIGEgMzIgYml0IHZhbHVlIGFuZCBpcyByZWFkCisgKiBmcm9tIGxvY2F0aW9uIG9mIGFuIG9mZnNldCAweDAwMjQgb2YgdGhlIGJhc2UgdmFsdWUuCisgKgorICogVGhlIFBNU1IgdmFsdWUgcmV0dXJuZWQgaW5kaWNhdGUgdGhlIGZvbGxvd2luZzoKKyAqIDxwcmU+CisgKgorICogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogKiAgQml0ICAgICogIE5hbWUgICogICAgICAgRGVzY3JpcHRpb24gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorICogKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiAKKyAqICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICogWzMxOjE4XSAgKlJlc2VydmVkKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICogWzE3OjEyXSAqICBQU1MgICAqIEluZGljYXRlcyB3aGljaCBvZiB0aGUgc2xhdmVzIG9uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICogICAgICAgICAqICAgICAgICAqICBBUkJTIHdhcyBwcmV2aW91c2x5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICogICAgICAgICAqICAgICAgICAqIGFjY2Vzc2VkIGJ5IHRoZSBBSEJTLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogCisgKiAqICAgICAgICAgKiAgICAgICAgKiBbMDAwMDAxXSBFeHBhbnNpb24gQnVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAqICAgICAgICAgKiAgICAgICAgKiBbMDAwMDEwXSBTRFJBTSBDb250cm9sbGVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAqICAgICAgICAgKiAgICAgICAgKiBbMDAwMTAwXSBQQ0kgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAqICAgICAgICAgKiAgICAgICAgKiBbMDAxMDAwXSBRdWV1ZSBNYW5hZ2VyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIAorICogKiAgICAgICAgICogICAgICAgICogWzAxMDAwMF0gQUhCLUFQQiBCcmlkZ2UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiAKKyAqICogICAgICAgICAqICAgICAgICAqIFsxMDAwMDBdIFJlc2VydmVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICogWzExOjhdICAqICBQU04gICAqIEluZGljYXRlcyB3aGljaCBvZiB0aGUgU2xhdmVzIG9uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICogICAgICAgICAqICAgICAgICAqIEFSQk4gd2FzIHByZXZpb3VzbHkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICogICAgICAgICAqICAgICAgICAqIGFjY2Vzc2VkIHRoZSBBSEJOLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICogICAgICAgICAqICAgICAgICAqIFswMDAxXSBTRFJBTSBDb250cm9sbGVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICogICAgICAgICAqICAgICAgICAqIFswMDEwXSBBSEItQUhCIEJyaWRnZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICogICAgICAgICAqICAgICAgICAqIFswMTAwXSBSZXNlcnZlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICogICAgICAgICAqICAgICAgICAqIFsxMDAwXSBSZXNlcnZlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICogIFs3OjRdICAqICBQTVMgICAqIEluZGljYXRlcyB3aGljaCBvZiB0aGUgTWFzdGVycyBvbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICogICAgICAgICAqICAgICAgICAqIEFSQlMgd2FzIHByZXZpb3VzbHkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICogICAgICAgICAqICAgICAgICAqIGFjY2Vzc2luZyB0aGUgQUhCUy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICogICAgICAgICAqICAgICAgICAqIFswMDAxXSBHYXNrZXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICogICAgICAgICAqICAgICAgICAqIFswMDEwXSBBSEItQUhCIEJyaWRnZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICogICAgICAgICAqICAgICAgICAqIFswMTAwXSBQQ0kgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICogICAgICAgICAqICAgICAgICAqIFsxMDAwXSBBUEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICogIFszOjBdICAqICBQTU4gICAqIEluZGljYXRlcyB3aGljaCBvZiB0aGUgTWFzdGVycyBvbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICogICAgICAgICAqICAgICAgICAqIEFSQk4gd2FzIHByZXZpb3VzbHkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICogICAgICAgICAqICAgICAgICAqIGFjY2Vzc2luZyB0aGUgQUhCTi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICogICAgICAgICAqICAgICAgICAqIFswMDAxXSBOUEVBICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICogICAgICAgICAqICAgICAgICAqIFswMDEwXSBOUEVCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICogICAgICAgICAqICAgICAgICAqIFswMTAwXSBOUEVDICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICogICAgICAgICAqICAgICAgICAqIFsxMDAwXSBSZXNlcnZlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIDwvcHJlPgorICoKKyAqIEBwYXJhbSAqcG1zclZhbHVlIFVJTlQzMiBbb3V0XSAtIFBvaW50ZXIgdG8gcmV0dXJuIFBNU1IgdmFsdWUuIFVzZXJzIG5lZWQgdG8KKyAqIAkJCQkJCQkgIGFsbG9jYXRlIHN0b3JhZ2UgZm9yIHBzbXJWYWx1ZS4gICAKKyAqCisgKiBAcmV0dXJuIG5vbmUgCisgKgorICogQGxpICAgUmVlbnRyYW50ICAgIDogbm8KKyAqIEBsaSAgIElTUiBDYWxsYWJsZSA6IG5vCisgKgorICoqLworUFVCTElDIHZvaWQKK2l4UGVyZlByb2ZBY2NCdXNQbXVQTVNSR2V0ICgKK1VJTlQzMiAqcG1zclZhbHVlKTsKKworCisvKiogCisgKiBUaGUgQVBJcyBiZWxvdyBhcmUgc3BlY2lmaWNhbGx5IHVzZWQgZm9yIFhjeWNsZSBtb2R1bGUuIAorICoqLworCisvKioKKyAqIEBpbmdyb3VwIEl4UGVyZlByb2ZBY2MKKyAqIAorICogQGZuIGl4UGVyZlByb2ZBY2NYY3ljbGVCYXNlbGluZVJ1biAoCisJCVVJTlQzMiAqbnVtQmFzZWxpbmVDeWNsZSkgCisgKgorICogQ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FFNZ3JEaXNwYXRjaGVyTG9vcFJ1bkEwICgpLgorICoKKyAqLworI2RlZmluZSBpeFFNZ3JEaXNwYXRjaGVyTG9vcFJ1biBpeFFNZ3JEaXNwYXRjaGVyTG9vcFJ1bkEwCisKKworLyoqCisgKgorICogQGluZ3JvdXAgSXhRTWdyQVBJCisgKgorICogQGRlZiBJWF9RTUdSX1FVRVVFCisgKgorICogQGJyaWVmICBEZWZpbml0aW9uIG9mIEFRTSBxdWV1ZSBudW1iZXJzCisgKgorICovCisjZGVmaW5lIElYX1FNR1JfUVVFVUVfMCAoMCkgICAgICAvKio8IFF1ZXVlIE51bWJlciAwICovCisjZGVmaW5lIElYX1FNR1JfUVVFVUVfMSAoMSkgICAgICAvKio8IFF1ZXVlIE51bWJlciAxICovCisjZGVmaW5lIElYX1FNR1JfUVVFVUVfMiAoMikgICAgICAvKio8IFF1ZXVlIE51bWJlciAyICovCisjZGVmaW5lIElYX1FNR1JfUVVFVUVfMyAoMykgICAgICAvKio8IFF1ZXVlIE51bWJlciAzICovCisjZGVmaW5lIElYX1FNR1JfUVVFVUVfNCAoNCkgICAgICAvKio8IFF1ZXVlIE51bWJlciA0ICovCisjZGVmaW5lIElYX1FNR1JfUVVFVUVfNSAoNSkgICAgICAvKio8IFF1ZXVlIE51bWJlciA1ICovCisjZGVmaW5lIElYX1FNR1JfUVVFVUVfNiAoNikgICAgICAvKio8IFF1ZXVlIE51bWJlciA2ICovCisjZGVmaW5lIElYX1FNR1JfUVVFVUVfNyAoNykgICAgICAvKio8IFF1ZXVlIE51bWJlciA3ICovCisjZGVmaW5lIElYX1FNR1JfUVVFVUVfOCAoOCkgICAgICAvKio8IFF1ZXVlIE51bWJlciA4ICovCisjZGVmaW5lIElYX1FNR1JfUVVFVUVfOSAoOSkgICAgICAvKio8IFF1ZXVlIE51bWJlciA5ICovCisjZGVmaW5lIElYX1FNR1JfUVVFVUVfMTAgKDEwKSAgICAvKio8IFF1ZXVlIE51bWJlciAxMCAqLworI2Rl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WF9RTUdSX1FVRVVFXzE0CisjZWxzZQorI2RlZmluZSBJWF9OUEVfQV9RTVFfT0FNX0ZSRUVfVkMgICAgICAgSVhfUU1HUl9RVUVVRV8zCisjZW5kaWYgLyogTVBIWSAqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogUXVldWUgYXNzaWdubWVudHMgZm9yIEhTUworICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qKioqICBIU1MgUG9ydCAwICoqKiovCisKKy8qKgorICogQGRlZiBJWF9OUEVfQV9RTVFfSFNTMF9DSExfUlhfVFJJRworICoKKyAqIEBicmllZiBIYXJkd2FyZSBRTWdyIFF1ZXVlIElEIGZvciBIU1MgUG9ydCAwIENoYW5uZWxpemVkIFJlY2VpdmUgdHJpZ2dlcgorICovCisjZGVmaW5lIElYX05QRV9BX1FNUV9IU1MwX0NITF9SWF9UUklHICAgSVhfUU1HUl9RVUVVRV8xMgorCisvKioKKyAqIEBkZWYgSVhfTlBFX0FfUU1RX0hTUzBfUEtUX1JYCisgKgorICogQGJyaWVmIEhhcmR3YXJlIFFNZ3IgUXVldWUgSUQgZm9yIEhTUyBQb3J0IDAgUGFja2V0aXplZCBSZWNlaXZlCisgKi8KKyNkZWZpbmUgSVhfTlBFX0FfUU1RX0hTUzBfUEtUX1JYICAgICAgICBJWF9RTUdSX1FVRVVFXzEzCisKKy8qKgorICogQGRlZiBJWF9OUEVfQV9RTVFfSFNTMF9QS1RfVFgwCisgKgorICogQGJyaWVmIEhhcmR3YXJlIFFNZ3IgUXVldWUgSUQgZm9yIEhTUyBQb3J0IDAgUGFja2V0aXplZCBUcmFuc21pdCBxdWV1ZSAwCisgKi8KKyNkZWZpbmUgSVhfTlBFX0FfUU1RX0hTUzBfUEtUX1RYMCAgICAgICBJWF9RTUdS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9CX1JFUVVFU1RfUUlEIElYX1FNR1JfUVVFVUVfMjQgICAvKio8IFF1ZXVlIElkIGZvciBOUEUgQiBETUEgUmVxdWVzdCAqLworI2RlZmluZSBJWF9ETUFfTlBFX0JfRE9ORV9RSUQgICAgSVhfUU1HUl9RVUVVRV8yNiAgIC8qKjwgUXVldWUgSWQgZm9yIE5QRSBCIERNQSBEb25lICAgICovCisjZGVmaW5lIElYX0RNQV9OUEVfQ19SRVFVRVNUX1FJRCBJWF9RTUdSX1FVRVVFXzI1ICAgLyoqPCBRdWV1ZSBJZCBmb3IgTlBFIEMgRE1BIFJlcXVlc3QgKi8KKyNkZWZpbmUgSVhfRE1BX05QRV9DX0RPTkVfUUlEICAgIElYX1FNR1JfUVVFVUVfMjcgICAvKio8IFF1ZXVlIElkIGZvciBOUEUgQyBETUEgRG9uZSAgICAqLworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogUXVldWUgYXNzaWdubWVudHMgZm9yIEV0aGVybmV0CisgKgorICogTm90ZTogUnggcXVldWUgZGVmaW5pdGlvbnMsIHdoaWNoIGluY2x1ZGUgUW9TIHRyYWZmaWMgY2xhc3MgZGVmaW5pdGlvbnMKKyAqIGFyZSBtYW5hZ2VkIGJ5IEV0aERCIGFuZCBkZWNsYXJlZCBpbiBJeEV0aERCUW9TLmgKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyoqCisqCisqIEBkZWYgSVhfRVRIX0FDQ19SWF9GUkFNRV9FVEhfUSAKKyoKKyogQGJyaWVmICBFdGgwL0V0aDEgTlBFIEZyYW1lIFJlY2lldmUgUS4KKyoKKyogQG5vdGUgVEhJUyBJUyBOT1QgVVNFRCAtIHRoZSBSeCBxdWV1ZXMgYXJlIHJl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gKiBUaGlzIEFQSSB3aWxsIHJldHVybiB0aGUgbGV2ZWwgb2YgdGhlIFR4IEZJRk8KKyAqCisgKiBAcmV0dXJuIAorICogICAgICAtIDAuLjE2OyAwIGNhbiBhbHNvIG1lYW4gU1NQIG5vdCBpbml0aWFsaXplZCBhbmQgd2lsbCBuZWVkIHRvIGJlIGluaXQuCisgKiAgICAgICAgICAgICAgCisgKiBAbGkgICBSZWVudHJhbnQgICAgOiB5ZXMKKyAqIEBsaSAgIElTUiBDYWxsYWJsZSA6IHllcworICoKKyAqLworUFVCTElDIFVJTlQ4CitpeFNzcEFjY1R4RklGT0xldmVsR2V0ICgKKwl2b2lkKTsKKworLyoqCisgKiBAaW5ncm91cCBJeFNzcEFjYworICogCisgKiBAZm4gaXhTc3BBY2NSeEZJRk9MZXZlbEdldCAoCisJCXZvaWQpCisgKgorICogQGJyaWVmIE9idGFpbiB0aGUgUnggRklGTydzIGxldmVsCisgKgorICogQHBhcmFtIC0gTm9uZQorICoKKyAqIEdsb2JhbCBEYXRhCToKKyAqCQktIE5vbmUuCisgKiAgICAgICAgICAgICAgICAgICAgICAgIAorICogVGhpcyBBUEkgd2lsbCByZXR1cm4gdGhlIGxldmVsIG9mIHRoZSBSeCBGSUZPCisgKgorICogQHJldHVybiAKKyAqICAgICAgLSAwLi4xNjsgMCBjYW4gYWxzbyBtZWFuIFNTUCBub3QgaW5pdGlhbGl6ZWQgYW5kIHdpbGwgbmVlZCB0byBiZSBpbml0LgorICogICAgICAgICAgICAgIAorICogQGxpICAgUmVlbnRyYW50ICAgIDogeWVzCisgKiBAbGkgICBJU1IgQ2FsbGFibGUgOiB5ZXMKKyAqCisgKi8KK1BVQkxJQyBVSU5UOAoraXhTc3BBY2NSeEZJRk9MZXZlbEdldCAoCisJdm9pZCk7CisKKy8qKgorICogQGluZ3JvdXAgSXhTc3BBY2MKKyAqIAorICogQGZuIGl4U3NwQWNjUnhGSUZPT3ZlcnJ1bkNoZWNrICgKKwkJdm9pZCkKKy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ludGVybmFsIGVycm9yIG9jY3VycmVkCisgKi8KK1BVQkxJQyBJeFRpbWVTeW5jQWNjU3RhdHVzCitpeFRpbWVTeW5jQWNjQXV4VGltZUludGVycnVwdERpc2FibGUoSXhUaW1lU3luY0FjY0F1eE1vZGUgYXV4TW9kZSk7CisKKy8qKgorICogQGluZ3JvdXAgSXhUaW1lU3luY0FjYworICogCisgKiBAZm4gSXhUaW1lU3luY0FjY1N0YXR1cyBpeFRpbWVTeW5jQWNjQXV4VGltZVBvbGwoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSXhUaW1lU3luY0FjY0F1eE1vZGUgYXV4TW9kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCT09MICphdXhQb2xsRmxhZywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJeFRpbWVTeW5jQWNjVGltZVZhbHVlICphdXhUaW1lKQorICoKKyAqIEBicmllZiBQb2xsIGZvciB0aGUgQXV4aWxpYXJ5IFRpbWUgU3RhbXAgY2FwdHVyZWQgZm9yIHRoZSBtb2RlIGluZGljYXRlZCAKKyAqIChNYXN0ZXIgb3IgU2xhdmUpCisgKgorICogQHBhcmFtIGF1eE1vZGUgW2luXSAtIEF1eGlsaWFyeSBTbmFwc2hvdCBSZWdpc3RlciAoU2xhdmUgb3IgTWFzdGVyKSB0byBiZSBjaGVja2VkCisgKiBAcGFyYW0gYXV4UG9sbEZsYWcgW291dF0gLSBUUlVFIGlmIHRoZSB0aW1lIHN0YW1wIGNhcHR1cmVkIGluIGF1eGlsaWFyeSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc25hcHNob3QgcmVnaXN0ZXIKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZBTFNFIGlmIHRoZSB0aW1lIHN0YW1wIG5vdCBjYXB0dXJlZCBpbiAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXV4aWxpYXJ5IHNuYXBzaG90IHJlZ2lz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SVCBtb2RlIG9mIG9wZXJhdGlvbgorICovCisjZGVmaW5lIElYX01PREVfR0VUCTMKKworLyoqCisgKiBAaW5ncm91cCBJb2N0bENvbW1hbmREZWZpbmVzCisgKgorICogQGRlZiBJWF9PUFRTX1NFVAorICoKKyAqIEBicmllZiBTZXQgdGhlIFVBUlQgZGV2aWNlIG9wdGlvbnMKKyAqLworI2RlZmluZSBJWF9PUFRTX1NFVAk0CisKKy8qKgorICogQGluZ3JvdXAgSW9jdGxDb21tYW5kRGVmaW5lcworICoKKyAqIEBkZWYgSVhfT1BUU19HRVQKKyAqCisgKiBAYnJpZWYgR2V0IHRoZSBVQVJUIGRldmljZSBvcHRpb25zCisgKi8KKyNkZWZpbmUgSVhfT1BUU19HRVQJNQorCisvKioKKyAqIEBpbmdyb3VwIElvY3RsQ29tbWFuZERlZmluZXMKKyAqCisgKiBAZGVmIElYX1NUQVRTX0dFVAorICoKKyAqIEBicmllZiBHZXQgdGhlIFVBUlQgc3RhdGlzdGljcworICovCisjZGVmaW5lIElYX1NUQVRTX0dFVAk2CisKKworLyogUE9TSVggc3R5bGUgaW9jdGwgYXJndW1lbnRzICovCisKKy8qKgorICogQGRlZmdyb3VwIElvY3RsQXJnRGVmaW5lcyBEZWZpbmVzIGZvciBJT0NUTCBBcmd1bWVudHMKKyAqCisgKiBAYnJpZWYgUE9TSVggc3R5bGUgSU9DVEwgYXJndW1lbnRzIHdoaWNoIGNhbiBiZSB1c2VkCisgKiAgICAgICAgd2l0aCBAcmVmIGl4VUFSVElvY3RsCisgKgorICogQHNhIGl4VUFSVE1vZGUKKyAqLworCisKKy8qKgorICogQGluZ3JvdXAgSW9jdGxBcmdEZWZpbmVzCisgKgorICogQGRlZiBDTE9DQUwKKyAqCisgKiBAYnJpZWYgU29mdHdhcmUgZmxvdyBjb250cm9sCisgKi8KKyNpZmRlZiBDTE9DQUwKKyN1bmRlZiBDTE9DQUwKKyNlbmRpZgorI2RlZmluZSBDTE9DQUwJCTB4MQorCisvKio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HVlIGNhbiBiZSBmcm9tIDAgdG8gKDEgPDwgKGFyZ19GaWVsZE1TQkJpdCArIDEgLQorICogICAgICAgICAgYXJnX0ZpZWxkTFNCQml0KSkgLSAxLgorICovCisjZGVmaW5lIElYX0dFVF9CSVRfRklFTEQxNiggXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ19QYWNrZWREYXRhMTYsIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdfRmllbGRMU0JCaXQsIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdfRmllbGRNU0JCaXQgXAorICAgICAgICAgICAgICAgICAgICAgICAgICApIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoaXhfdWludDE2KShhcmdfUGFja2VkRGF0YTE2KSAmIElYX0JJVF9GSUVMRF9NQVNLMTYoYXJnX0ZpZWxkTFNCQml0LCBhcmdfRmllbGRNU0JCaXQpKSA+PiBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ19GaWVsZExTQkJpdCkKKworCisvKioKKyAqIE1BQ1JPIE5BTUU6IElYX01BS0VfQklUX0ZJRUxEMTYKKyAqCisgKiBERVNDUklQVElPTjogVGhpcyBtYWNybyB3aWxsIGNyZWF0ZSBhIHRlbXBvcmFyeSAxNiBiaXQgdmFsdWUgd2l0aCB0aGUgYml0IGZpZWxkCisgKiAgICAgICAgICBkZXNpcmVkIHNldCB0byB0aGUgZGVzaXJlZCB2YWx1ZS4KKyAqCisgKiBAUGFyYW06ICAtIElOIGFyZ19CaXRGaWVsZFZhbHVlIGlzIHRoZSBuZXcgdmFsdWUgb2YgdGhlIGJpdCBmaWVsZC4gVGhlIHZhbHVlIGNhbiBiZSBmcm9tIDAgdG8gCisgKiAgICAgICAgICAoMSA8PCAoYXJnX0ZpZWxkTVNCQml0ICsgMSAtIGFyZ19GaWVsZExTQkJpdCkpIC0gMS4KKyAqIEBQYXJhbTogIC0gSU4gYXJnX0ZpZWxkTFNCQml0IGFuIHVuc2lnbmVkIGludGVnZXIgdmFsdWUgcmVwcmVzZW50aW5nIHRoZSBwb3NpdGlvbiBvZiB0aGUgbGVhc3Qgc2lnbmlmaWNhbnQKKyAqICAgICAgICAgIGJpdCBvZiB0aGUgYml0IGZpZWxkLgorICogQFBhcmFtOiAgLSBJTiBhcmdfRmllbGRNU0JCaXQgYW4gdW5zaWduZWQgaW50ZWdlciB2YWx1ZSByZXByZXNlbnRpbmcgdGhlIHBvc2l0aW9uIG9mIHRoZSBtb3N0IHNpZ25pZmljYW50CisgKiAgICAgICAgICBiaXQgb2YgdGhlIGJpdCBmaWVsZC4KKyAqIAorICogQFJldHVybjogUmV0dXJucyBhIHRlbXBvcmFyeSBpeF91aW50MTYgdmFsdWUgdGhhdCBoYXMgdGhlIGJpdCBmaWVsZCBzZXQgdG8gdGhlIGFwcHJvcHJpYXRlIHZhbHVlLgorICovCisjZGVmaW5lIElYX01BS0VfQklUX0ZJRUxEMTYoIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnX0JpdEZpZWxkVmFsdWUsIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnX0ZpZWxkTFNCQml0LCBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ19GaWVsZE1TQkJpdCBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICApIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGl4X3VpbnQxNikoYXJnX0JpdEZpZWxkVmFsdWUpIDw8IGFyZ19GaWVsZExTQkJpdCkgJiBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICBJWF9CSVRfRklFTERfTUFTSzE2KGFyZ19GaWVsZExTQkJpdCwgYXJnX0ZpZWxkTVNCQml0KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorLyoqCisgKiBNQUNSTyBOQU1FOiBJWF9TRVRfQklUX0ZJRUxEMTYKKyAqCisgKiBERVNDUklQVElPTjogU2V0cyBhIG5ld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gICAgICAgICAgICAgIGFyZ19GaWVsZExTQkJpdCwgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ19GaWVsZE1TQkJpdCBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICkgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAoYXJnX1BhY2tlZERhdGExNiA9ICgoKGl4X3VpbnQxNikoYXJnX1BhY2tlZERhdGExNikgJiBcCisgICAgICAgICAgICAgICAgICAgICAgICAgIH4oSVhfQklUX0ZJRUxEX01BU0sxNihhcmdfRmllbGRMU0JCaXQsIGFyZ19GaWVsZE1TQkJpdCkpKSB8IFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgSVhfTUFLRV9CSVRfRklFTEQxNihhcmdfQml0RmllbGRWYWx1ZSwgYXJnX0ZpZWxkTFNCQml0LCBhcmdfRmllbGRNU0JCaXQpKSkgCisKKworLyoqCisgKiBNQUNSTyBOQU1FOiBJWF9CSVRfRklFTERfTUFTSzMyCisgKgorICogREVTQ1JJUFRJT046IEJ1aWxkcyB0aGUgbWFzayByZXF1aXJlZCB0byBleHRyYWN0IHRoZSBiaXQgZmllbGQgZnJvbSBhIDMyIGJpdCB1bnNpZ25lZCBpbnRlZ2VyIHZhbHVlLgorICoKKyAqIEBQYXJhbTogIC0gSU4gYXJnX0ZpZWxkTFNCQml0IGFuIHVuc2lnbmVkIGludGVnZXIgdmFsdWUgcmVwcmVzZW50aW5nIHRoZSBwb3NpdGlvbiBvZiB0aGUgbGVhc3Qgc2lnbmlmaWNhbnQKKyAqICAgICAgICAgIGJpdCBvZiB0aGUgYml0IGZpZWxkLgorICogQFBhcmFtOiAgLSBJTiBhcmdfRmllbGRNU0JCaXQgYW4gdW5zaWduZWQgaW50ZWdlciB2YWx1ZSByZXByZXNlbnRpbmcgdGhlIHBvc2l0aW9uIG9mIHRoZSBtb3N0IHNpZ25pZmljYW50CisgKiAgICAgICAgICBiaXQgb2YgdGhlIGJpdCBmaWVsZC4KKyAqCisgKiBAUm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lIGxlYXN0IHNpZ25pZmljYW50CisgKiAgICAgICAgICBiaXQgb2YgdGhlIGJpdCBmaWVsZC4KKyAqIEBQYXJhbTogIC0gSU4gYXJnX0ZpZWxkTVNCQml0IGFuIHVuc2lnbmVkIGludGVnZXIgdmFsdWUgcmVwcmVzZW50aW5nIHRoZSBwb3NpdGlvbiBvZiB0aGUgbW9zdCBzaWduaWZpY2FudAorICogICAgICAgICAgYml0IG9mIHRoZSBiaXQgZmllbGQuCisgKgorICogQFJldHVybjogUmV0dXJucyB0aGUgdmFsdWUgb2YgdGhlIGJpdCBmaWVsZC4gVGhlIHZhbHVlIGNhbiBiZSBmcm9tIDAgdG8gKDEgPDwgKGFyZ19GaWVsZE1TQkJpdCArIDEgLQorICogICAgICAgICAgYXJnX0ZpZWxkTFNCQml0KSkgLSAxLgorICovCisjZGVmaW5lIElYX0dFVF9CSVRfRklFTEQzMiggXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ19QYWNrZWREYXRhMzIsIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdfRmllbGRMU0JCaXQsIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdfRmllbGRNU0JCaXQgXAorICAgICAgICAgICAgICAgICAgICAgICAgICApIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoaXhfdWludDMyKShhcmdfUGFja2VkRGF0YTMyKSAmIElYX0JJVF9GSUVMRF9NQVNLMzIoYXJnX0ZpZWxkTFNCQml0LCBhcmdfRmllbGRNU0JCaXQpKSA+PiBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ19GaWVsZExTQkJpdCkKKworCisKKworLyoqCisgKiBNQUNSTyBOQU1FOiBJWF9NQUtFX0JJVF9GSUVMRDMyCisgKgorICogREVTQ1JJUFRJT046IFRoaXMgbWFjcm8gd2lsbCBjcmVhdGUgYSB0ZW1wb3JhcnkgMzIgYml0IHZhbHVlIHdpdGggdGhlIGJpdCBmaWVsZ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ZyB0aGUgcG9zaXRpb24gb2YgdGhlIG1vc3Qgc2lnbmlmaWNhbnQKKyAqICAgICAgICAgIGJpdCBvZiB0aGUgYml0IGZpZWxkLgorICoKKyAqIEBSZXR1cm46IFJldHVybnMgdGhlIHVwZGF0ZWQgdmFsdWUgb2YgYXJnX1BhY2tlZERhdGEzMi4KKyAqLworI2RlZmluZSBJWF9TRVRfQklUX0ZJRUxEMzIoIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdfUGFja2VkRGF0YTMyLCBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnX0JpdEZpZWxkVmFsdWUsIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdfRmllbGRMU0JCaXQsIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdfRmllbGRNU0JCaXQgXAorICAgICAgICAgICAgICAgICAgICAgICAgICApIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKGFyZ19QYWNrZWREYXRhMzIgPSAoKChpeF91aW50MzIpKGFyZ19QYWNrZWREYXRhMzIpICYgXAorICAgICAgICAgICAgICAgICAgICAgICAgICB+KElYX0JJVF9GSUVMRF9NQVNLMzIoYXJnX0ZpZWxkTFNCQml0LCBhcmdfRmllbGRNU0JCaXQpKSkgfCBcCisgICAgICAgICAgICAgICAgICAgICAgICAgIElYX01BS0VfQklUX0ZJRUxEMzIoYXJnX0JpdEZpZWxkVmFsdWUsIGFyZ19GaWVsZExTQkJpdCwgYXJnX0ZpZWxkTVNCQml0KSkpIAorCisKKworI2lmIGRlZmluZWQoX19jcGx1c3BsdXMpCit9CisjZW5kaWYgLyogZW5kIGRlZmluZWQoX19jcGx1c3BsdXMpICovCisKKyNlbmRpZiAvKiBlbmQgIWRlZmluZWQoX19JWF9NQUNST1NfSF9fKSAqLwpkaWZmIC0tZ2l0IGEvY3B1L2l4cC9ucGUvaW5jbHVkZS9peF9vc190eXBlLmggYi9jcHUvaXhwL25wZS9pbmNsdW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mFuc2FjdG9yL1dvcmtCZW5jaCBPUyBjYWxscy4KKyAqCisgKgorICogICBPU1NMIFRocmVhZCBBUElzOgorICogICAgICAgICAgICAgVGhlIE9TU0wgdGhyZWFkIGZ1bmN0aW9ucyB0aGF0IGFsbG93IGZvciB0aHJlYWQgY3JlYXRpb24sCisgKiAgICAgICAgICAgICBnZXQgdGhyZWFkIGlkLCB0aHJlYWQgZGVsZXRpb24gYW5kIHNldCB0aHJlYWQgcHJpcm9pdHkuCisgKgorICogICAgICAgICAgICAgaXhfb3NzbF90aHJlYWRfY3JlYXRlCisgKiAgICAgICAgICAgICBpeF9vc3NsX3RocmVhZF9nZXRfaWQKKyAqICAgICAgICAgICAgIGl4X29zc2xfdGhyZWFkX2V4aXQKKyAqICAgICAgICAgICAgIGl4X29zc2xfdGhyZWFkX2tpbGwKKyAqICAgICAgICAgICAgIGl4X29zc2xfdGhyZWFkX3NldF9wcmlvcml0eQorICogICAgICAgICAgICAgaXhfb3NzbF90aHJlYWRfX2RlbGF5CisgKiAKKyAqICAgT1NTTCBTZW1hcGhvcmUgQVBJczoKKyAqICAgICAgICAgICAgIFRoZSBPU1NMIHNlbWFwaG9yZSBmdW5jdGlvbnMgdGhhdCBhbGxvdyBmb3IgaW5pdGlhbGl6YXRpb24sCisgKiAgICAgICAgICAgICBwb3N0aW5nLCB3YWl0aW5nIGFuZCBkZWxldGlvbiBvZiBzZW1hcGhvcmVzLgorICoKKyAqICAgICAgICAgICAgIGl4X29zc2xfc2VtX2luaXQKKyAqICAgICAgICAgICAgIGl4X29zc2xfc2VtX2ZpbmkKKyAqICAgICAgICAgICAgIGl4X29zc2xfc2VtX3Rha2UKKyAqICAgICAgICAgICAgIGl4X29zc2xfc2VtX2dpdmUKKyAqICAgICAgICAgICAgIGl4X29zc2xfc2VtX2ZsdXNoCisgKgorICogICBPU1NMIE11dGV4IEFQSXM6CisgKiAgICAgICAgICAgICBUaGUgT1NTTCB3cmFwcGVyIGZ1bmN0aW9ucyB0aGF0IGFsbG93IGZvciBpbml0aWFsaXphdGlvbiwKKyAqICAgICAgICAgICAgIHBvc3RpbmcsIHdhaXRpbmcgYW5kIGRlbGV0aW9uIG9mIG11dGV4ZXMuCisgKgorICogICAgICAgICAgICAgaXhfb3NzbF9tdXRleF9pbml0CisgKiAgICAgICAgICAgICBpeF9vc3NsX211dGV4X2ZpbmkKKyAqICAgICAgICAgICAgIGl4X29zc2xfbXV0ZXhfbG9jaworICogICAgICAgICAgICAgaXhfb3NzbF9tdXRleF91bmxvY2sKKyAqCisgKiAgIE9TU0wgVGltZXIgQVBJczoKKyAqICAgICAJICAgICAgIFRoZSB0aW1lciBBUElzIHByb3ZpZGUgc2xlZXAgYW5kIGdldCB0aW1lIGZ1bmN0aW9ucy4KKyAqCisgKiAgICAgICAgICAgICBpeF9vc3NsX3NsZWVwCisgKiAgICAgICAgICAgICBpeF9vc3NsX3NsZWVwX3RpY2sKKyAqICAgICAgICAgICAgIGl4X29zc2xfdGltZV9nZXQKKyAqIAorICogICBPU0FQSXMgZm9yIFRyYW5zYWN0b3IvV29ya0JlbmNoOgorICogICAgICAgICAgICAgVGhlc2UgT1NBUEkgZnVuY3Rpb25zIGFyZSB1c2VkIGZvciB0cmFuc2F0b3IgT1MgY2FsbHMuIAorICogICAgICAgICAgICAgVGhleSBhcmUgZGVmaW5lZCBpbiBvc0FwaS5oLiAKKyAqCisgKiAgICAgICAgICAgICBTZW1fSW5pdCAJCQkKKyAqICAgICAgICAgICAgIFNlbV9EZXN0cm95IAkJCisgKiAgICAgICAgICAgICBTZW1fV2FpdCAJCQkKKyAqICAgICAgICAgICAgIFNlbV9XYWl0CQkJCisgKiAgICAgICAgICAgICBUaHJlYWRfQ3JlYXRlCQkKKyAqICAgICAgICAgICAgIFRocmVhZF9DYW5jZWwgCQkKKyAqICAgICAgICAgICAgIFRocmVhZF9TZXRQcmlvcml0eSAJCQorICogICAgICAgICAgICAgZGVsYXlNcyAJCQkKKyAqICAgICAgICAgICAgIGRlbGF5VGljawkJCQorICogICAgICAgICAgICAgCisgKgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAgICAgIAorICoKKyAqID0gQVVUSE9SCisgKiAgICAgIEludGVsIENvcnBvcmF0aW9uCisgKgorICogPSBBQ0tOT1dMRURHRU1FTlRTCisgKiAgICAgIAorICoKKyAqID0gQ1JFQVRJT04gVElNRQorICogICAgICAxLzgvMjAwMiAxOjUzOjQyIFBNCisgKgorICogPSBDSEFOR0UgSElTVE9SWQorICogICAwMi8yMi8yMDAyIDogUmVuYW1lZCBvc2FwaS5oIG9zX2FwaS5oCisgKiAgICAgICAgICAgICAgICBNb3ZlZCBPUyBoZWFkZXIgZmlsZSBpbmNsdWRlcyBmcm9tIE9TU0wuaCB0byBvc19hcGkuaAorICogICAgICAgICAgICAgICAgTW92ZWQgT1Mgc3BlY2lmaWMgZGF0YXR5cGVzIHRvIG9zX2FwaS5oIAorICogICAgICAgICAgICAgICAgTW9kaWZpZWQgZGF0YSB0eXBlcywgbWFjcm9zIGFuZCBmdW5jdGlvbnMgYXMgcGVyCisgKiAgICAgICAgICAgICAgICAnQycgY29kaW5nIGd1aWRlbGluZXMuCisgKgorICoKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqLworCisjaWZuZGVmIF9JWF9PU1NMX0gKKyNpZm5kZWYgX19kb3h5Z2VuX2hpZGUKKyNkZWZpbmUgX0lYX09TU0xfSAorI2VuZGlmIC8qIF9fZG94eWdlbl9oaWRlICovCisKKyNpbmNsdWRlICJJeE9zYWxCYWNrd2FyZC5oIgorIAorI2VuZGlmIC8qIF9JWF9PU1NMX0ggKi8KKworLyoqCisgKiBAfSBkZWZncm91cCBJeE9TU0wKKyAqLwpkaWZmIC0tZ2l0IGEvY3B1L2l4cC9ucGUvaW5jbHVkZS9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pCitleHRlcm4gIkMiCit7CisjZW5kaWYgLyogZW5kIGRlZmluZWQoX19jcGx1c3BsdXMpICovCisKKworLyoqCisgKiBEZWZpbmUgZ2VuZXJpYyBpbnRlZ3JhbCBkYXRhIHR5cGVzIHRoYXQgd2lsbCBndWFyYW50ZWUgdGhlIHNpemUuCisgKi8KKworLyoqCisgKiBUWVBFTkFNRTogaXhfaW50OAorICogCisgKiBERVNDUklQVElPTjogVGhpcyB0eXBlIGRlZmluZXMgYW4gOCBiaXQgc2lnbmVkIGludGVnZXIgdmFsdWUuCisgKgorICovCit0eXBlZGVmIHNpZ25lZCBjaGFyIGl4X2ludDg7CisKKworLyoqCisgKiBUWVBFTkFNRTogaXhfdWludDgKKyAqIAorICogREVTQ1JJUFRJT046IFRoaXMgdHlwZSBkZWZpbmVzIGFuIDggYml0IHVuc2lnbmVkIGludGVnZXIgdmFsdWUuCisgKgorICovCit0eXBlZGVmIHVuc2lnbmVkIGNoYXIgaXhfdWludDg7CisKKworLyoqCisgKiBUWVBFTkFNRTogaXhfaW50MTYKKyAqIAorICogREVTQ1JJUFRJT046IFRoaXMgdHlwZSBkZWZpbmVzIGFuIDE2IGJpdCBzaWduZWQgaW50ZWdlciB2YWx1ZS4KKyAqCisgKi8KK3R5cGVkZWYgc2lnbmVkIHNob3J0IGludCBpeF9pbnQxNjsKKworCisvKioKKyAqIFRZUEVOQU1FOiBpeF91aW50MTYKKyAqIAorICogREVTQ1JJUFRJT046IFRoaXMgdHlwZSBkZWZpbmVzIGFuIDE2IGJpdCB1bnNpZ25lZCBpbnRlZ2VyIHZhbHVlLgorICoKKyAqLwordHlwZWRlZiB1bnNpZ25lZCBzaG9ydCBpbnQgaXhfdWludDE2OworCisKKy8qKgorICogVFlQRU5BTUU6IGl4X2ludDMyCisgKiAKKyAqIERFU0NSSVBUSU9OOiBUaGlzIHR5cGUgZGVmaW5lcyBhbiAzMiBiaXQgc2lnbmVkIGludGVnZXIgdmFsdWUuCisgKgorICovCit0eXBlZG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FRoaXMgZmlsZSAgY29udGFpbnMgZGVmaW5pdGlvbnMgYW5kIGVuY2Fwc3VsYXRpb25zIGZvciBPUyBzcGVjaWZpYyBkYXRhIHR5cGVzLiBUaGVzZQorICogICBlbmNhcHN1bGF0ZWQgIGRhdGEgdHlwZXMgYXJlICB1c2VkIGJ5IE9TU0wgaGVhZGVyIGZpbGVzIGFuZCBPUyBBUEkgZnVuY3Rpb25zLgorICoKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogICAgICAKKyAqCisgKiA9IEFVVEhPUgorICogICAgICBJbnRlbCBDb3Jwb3JhdGlvbgorICoKKyAqID0gQUtOT1dMRURHRU1FTlRTCisgKiAgICAgIAorICoKKyAqID0gQ1JFQVRJT04gVElNRQorICogICAgICAxLzgvMjAwMiAxOjUzOjQyIFBNCisgKgorICogPSBDSEFOR0UgSElTVE9SWQorIAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICovCisKKyNpZm5kZWYgX09TX0RBVEFUWVBFU19ICisjZGVmaW5lIF9PU19EQVRBVFlQRVNfSAorCisjaW5jbHVkZSAiSXhPc2FsQmFja3dhcmQuaCIKKworI2VuZGlmIC8qIF9PU19EQVRBVFlQRVNfSCAqLworCmRpZmYgLS1naXQgYS9jcHUvaXhwL25wZS9taWlwaHkuYyBiL2NwdS9peHAvbnBlL21paXBoeS5jCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmM2M2M1NGUKLS0tIC9kZXYvbnVsbAorKysgYi9jcHUvaXhwL25wZS9taWlwaHkuYwpAQCAtMCwwICsxLDExOCBAQAorLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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KworCisJZm9yIChpID0gMDsgaSA8IDB4MUE7IGkrKykgeworCQlpZiAobWlpcGh5X3JlYWQgKGRldm5hbWUsIGFkZHIsIGksICZkYXRhKSkgeworCQkJcHJpbnRmICgicmVhZCBlcnJvciBmb3IgcmVnICVseFxuIiwgaSk7CisJCQlyZXR1cm47CisJCX0KKwkJcHJpbnRmICgiUGh5IHJlZyAlbHggPT0+ICU0eFxuIiwgaSwgZGF0YSk7CisKKwkJLyoganVtcCB0byB0aGUgbmV4dCBzZXQgb2YgcmVncyAqLworCQlpZiAoaSA9PSAweDA3KQorCQkJaSA9IDB4MGY7CisKKwl9CQkJLyogZW5kIGZvciBsb29wICovCit9CQkJCS8qIGVuZCBkdW1wICovCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogKFJlKXN0YXJ0IGF1dG9uZWdvdGlhdGlvbgkJCQkgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworaW50IHBoeV9zZXR1cF9hbmVnIChjaGFyICpkZXZuYW1lLCB1bnNpZ25lZCBjaGFyIGFkZHIpCit7CisJdW5zaWduZWQgc2hvcnQgY3RsLCBhZHY7CisKKwkvKiBTZXR1cCBzdGFuZGFyZCBhZHZlcnRpc2UgKi8KKwltaWlwaHlfcmVhZCAoZGV2bmFtZSwgYWRkciwgUEhZX0FOQVIsICZhZHYpOworCWFkdiB8PSAoUEhZX0FOTFBBUl9BQ0sgfCBQSFlfQU5MUEFSX1JGIHwgUEhZX0FOTFBBUl9UNCB8CisJCVBIWV9BTkxQQVJfVFhGRCB8IFBIWV9BTkxQQVJfVFggfCBQSFlfQU5MUEFSXzEwRkQgfAorCQlQSFlfQU5MUEFSXzEwKTsKKwltaWlwaHlfd3JpdGUgKGRldm5hbWUsIGFkZHIsIFBIWV9BTkFSLCBhZHYpOworCisJLyogU3RhcnQvUmVzdGFydCBhbmV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KyAqLworLyogIFNpemUgZGVmaW50aW9ucworICogIENvcHlyaWdodCAoQykgQVJNIExpbWl0ZWQgMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KKyAqLworCisjaWZuZGVmIF9fc2l6ZXNfaAorI2RlZmluZSBfX3NpemVzX2ggICAgICAgICAgICAgICAgICAgICAgIDEKKworLyogaGFuZHkgc2l6ZXMgKi8KKyNkZWZpbmUgU1pfMUsgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwNDAwCisjZGVmaW5lIFNaXzRLICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMTAwMAorI2RlZmluZSBTWl84SyAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMDIwMDAKKyNkZWZpbmUgU1pfMTZLICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDA0MDAwCisjZGVmaW5lIFNaXzY0SyAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAxMDAwMAorI2RlZmluZSBTWl8xMjhLICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMjAwMDAKKyNkZWZpbmUgU1pfMjU2SyAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDQwMDAwCisjZGVmaW5lIFNaXzUxMksgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDA4MDAwMAorCisjZGVmaW5lIFNaXzFNICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDEwMDAwMAorI2RlZmluZSBTWl8yTSAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAyMDAwMDAKKyNkZWZpbmUgU1pfNE0gICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwNDAwMDAwCisjZGVmaW5lIFNaXzhNICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDgwMDAwMAorI2RlZmluZSBTWl8xNk0gICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDEwMDAwMDAKKyNkZWZpbmUgU1pfMzJNICAgICAgICAgICAgICAgICAgICAgICAgICAweDAyMDAwMDAwCisjZGVmaW5lIFNaXzY0TSAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwNDAwMDAwMAorI2RlZmluZSBTWl8xMjhNICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDgwMDAwMDAKKyNkZWZpbmUgU1pfMjU2TSAgICAgICAgICAgICAgICAgICAgICAgICAweDEwMDAwMDAwCisjZGVmaW5lIFNaXzUxMk0gICAgICAgICAgICAgICAgICAgICAgICAgMHgyMDAwMDAwMAorCisjZGVmaW5lIFNaXzFHICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg0MDAwMDAwMAorI2RlZmluZSBTWl8yRyAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4ODAwMDAwMDAKKworI2VuZGlmCisKKy8qICAgICAgICAgRU5EICovCmRpZmYgLS1naXQgYS9pbmNsdWRlL2FzbS1hcm0vbWFjaC10eXBlcy5oIGIvaW5jbHVkZS9hc20tYXJtL21hY2gtdHlwZXMuaAppbmRleCBmZDAzNzQ4Li43ZDc4ODhlIDEwMDY0NAotLS0gYS9pbmNsdWRlL2FzbS1hcm0vbWFjaC10eXBlcy5oCisrKyBiL2luY2x1ZGUvYXNtLWFybS9tYWNoLXR5cGVzLmgKQEAgLTczNiw2ICs3MzYsNyBAQAogI2RlZmluZSBNQUNIX1RZUEVfTE4yNDEwU0JDICAgICAgICAgICAgNzI1CiAjZGVmaW5lIE1BQ0hfVFlQRV9DQjNSVUZDICAgICAgICAgICAgICA3MjYKICNkZWZpbmUgTUFDSF9UWVBFX01QMlVTQiAgICAgICAgICAgICAgIDcyNworI2RlZmluZSBNQUNIX1RZUEVfUEROQjMgICAgICAgICAgICAgICAxMDAyCiAKICNpZmRlZiBDT05GSUdfQVJDSF9FQlNBMTEwCiAjIGlmZGVmIG1hY2hpbmVfYXJjaF90eXBlCmRpZmYgLS1naXQgYS9pbmNsdWRlL2FzbS1hcm0vdS1ib290LmggYi9pbmNsdWRlL2FzbS1hcm0vdS1ib290LmgKaW5k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wZWRlZiBzdHJ1Y3QgaW50X2N0cmwgeworCXVpbnQJaW50X2ljcjE7CisJdWludAlpbnRfaWNyMjsKKwl1aW50CWludF9pY3IzOworCXVpbnQJaW50X2ljcjQ7CisJdWludAlpbnRfaXNyOworCXVpbnQJaW50X3BpdHI7CisJdWludAlpbnRfcGl3cjsKKwl1Y2hhcglyZXMxWzNdOworCXVjaGFyCWludF9waXZyOworfSBpbnRjdHJsX3Q7CisKKy8qIFRpbWVyIG1vZHVsZSByZWdpc3RlcnMKKyAqLwordHlwZWRlZiBzdHJ1Y3QgdGltZXJfY3RybCB7CisJdXNob3J0CXRpbWVyX3RtcjsKKwl1c2hvcnQJcmVzMTsKKwl1c2hvcnQJdGltZXJfdHJyOworCXVzaG9ydAlyZXMyOworCXVzaG9ydAl0aW1lcl90Y2FwOworCXVzaG9ydAlyZXMzOworCXVzaG9ydAl0aW1lcl90Y247CisJdXNob3J0CXJlczQ7CisJdXNob3J0CXRpbWVyX3RlcjsKKwl1Y2hhcglyZXM1WzE0XTsKK30gdGltZXJfdDsKKworIC8qIEZhc3QgZXRoZXJuZXQgY29udHJvbGxlciByZWdpc3RlcnMKKyAgKi8KK3R5cGVkZWYgc3RydWN0IGZlYyB7CisJdWludCAgICByZXMxOworCXVpbnQgICAgZmVjX2lldmVudDsKKwl1aW50ICAgIGZlY19pbWFzazsKKwl1aW50ICAgIHJlczI7CisJdWludCAgICBmZWNfcl9kZXNfYWN0aXZlOworCXVpbnQgICAgZmVjX3hfZGVzX2FjdGl2ZTsKKwl1aW50ICAgIHJlczNbM107CisJdWludCAgICBmZWNfZWNudHJsOworCXVpbnQgICAgcmVzNFs2XTsKKwl1aW50ICAgIGZlY19taWlfZGF0YTsKKwl1aW50ICAgIGZlY19taWlfc3BlZWQ7CisJdWludCAgICByZXM1WzddOworCXVpbnQgICAgZmVjX21pYmM7CisJdWludCAgICByZXM2WzddOworCXVpbnQgICAgZmVjX3JfY250cmw7CisJdWludCAgICByZXM3WzE1XTsKKw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AqIE1lbW9yeSBtYXAKQEAgLTQxOSwyNSArNDE5LDI1IEBACiAvKgogICogR1BJTyBjb25maWd1cmF0aW9uIG9uIEJDMzQ1MAogICoKLSAqICBQU0MxOiAgIFVBUlQxIChTZXJ2aWNlLVVBUlQpICAgICAgICAgWzB4IHh4eHh4eHg0XQotICogIFBTQzI6ICAgVUFSVDIgICAgICAgICAgICAgICAgICAgICAgICBbMHggeHh4eHh4NHhdCi0gKiAgICBvcjogICBBQy85NyBpZiBDT05GSUdfQkMzNDUwX0FDOTcgIFsweCB4eHh4eHgyeF0KLSAqICBQU0MzOiAgIFVTQjIgICAgICAgICAgICAgICAgICAgICAgICAgWzB4IHh4eHh4MXh4XQotICogIFVTQjogICAgVUFSVDQoZXh0LikvVUFSVDUoaW50LikgICAgICBbMHggeHh4eDJ4eHhdCi0gKiAgICAgICAgICAgICh0aGlzIGhhcyB0byBtYXRjaCAKLSAqICAgICAgICAgICAgQ09ORklHX1VTQl9DT05GSUcgd2hpY2ggaXMKLSAqICAgICAgICAgICAgdXNlZCBieSB1c2Jfb2hjaS5jIHRvIHNldCAKLSAqICAgICAgICAgICAgdGhlIFVTQiBwb3J0cykKLSAqICBFdGg6ICAgIDEwLzEwME1iaXQgRXRoZXJuZXQgICAgICAgICAgWzB4IHh4eDB4eHh4XQotICogICAgICAgICAgICAodGhpcyBpcyByZXNldCB0byAnNScgCi0gKiAgICAgICAgICAgIGluIEZFQyBkcml2ZXI6IGZlYy5jKQotICogIFBTQzY6ICAgVUFSVDYgKGludC4gdG8gUFMvMiBjb250ci4pICBbMHggeHg1eHh4eHhdCi0gKiAgQVRBL0NTOiA/Pz8gICAgICAgICAgICAgICAgICAgICAgICAgIFsweCB4MXh4eHh4eF0KLSAqICAgICAgICAgIEZJWE1FISBVTSBGaWcgMi0xMCBzdWdnZXN0cyAgWzB4IHgweHh4eHh4XQorICogIFBTQzE6ICAgVUFSVDEgKFNlcnZpY2UtVUFSVCkJIFsweCB4eHh4eHh4NF0KKyA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dQSU8wCQkJMAorI2RlZmluZSBHUElPMQkJCTEKIAotI2RlZmluZSBHUElPMF9PUiAgICAgICAgICAgICAgIChHUElPX0JBU0UwKzB4MCkKLSNkZWZpbmUgR1BJTzBfVENSICAgICAgICAgICAgICAoR1BJT19CQVNFMCsweDQpCi0jZGVmaW5lIEdQSU8wX09EUiAgICAgICAgICAgICAgKEdQSU9fQkFTRTArMHgxOCkKLSNkZWZpbmUgR1BJTzBfSVIgICAgICAgICAgICAgICAoR1BJT19CQVNFMCsweDFDKQorI2lmIGRlZmluZWQoQ09ORklHXzQ0MEdQKQorI2RlZmluZSBHUElPMF9CQVNFICAgICAgICAgICAgIChDRkdfUEVSSVBIRVJBTF9CQVNFKzB4MDAwMDA3MDApCisKKyNkZWZpbmUgR1BJTzBfT1IgICAgICAgICAgICAgICAoR1BJTzBfQkFTRSsweDApCisjZGVmaW5lIEdQSU8wX1RDUiAgICAgICAgICAgICAgKEdQSU8wX0JBU0UrMHg0KQorI2RlZmluZSBHUElPMF9PRFIgICAgICAgICAgICAgIChHUElPMF9CQVNFKzB4MTgpCisjZGVmaW5lIEdQSU8wX0lSICAgICAgICAgICAgICAgKEdQSU8wX0JBU0UrMHgxQykKICNlbmRpZiAvKiBDT05GSUdfNDQwR1AgKi8KIAogI2lmIGRlZmluZWQoQ09ORklHXzQ0MEVQKSB8fCBkZWZpbmVkKENPTkZJR180NDBHUikKLSNkZWZpbmUgR1BJT19CQVNFMCAgICAgICAgICAgICAoQ0ZHX1BFUklQSEVSQUxfQkFTRSsweDAwMDAwQjAwKQotI2RlZmluZSBHUElPX0JBU0UxICAgICAgICAgICAgIChDRkdfUEVSSVBIRVJBTF9CQVNFKzB4MDAwMDBDMDApCisjZGVmaW5lIEdQSU8wX0JBU0UgICAgICAgICAgICAgKENGR19QRVJJUEhFUkFMX0JBU0UrMHgwMDAwMEIwMCkKKyNkZWZpbmUgR1BJTzFfQkFTRSAgICAgICAgICAgICAoQ0ZHX1BFUklQSEVSQUxfQkFTRSsweDAwMDAwQzAwKQogCi0jZGVmaW5lIEdQSU8wX09SICAgICAgICAgICAgICAgKEdQSU9fQkFTRTArMHgwKQotI2RlZmluZSBHUElPMF9UQ1IgICAgICAgICAgICAgIChHUElPX0JBU0UwKzB4NCkKLSNkZWZpbmUgR1BJTzBfT1NSTCAgICAgICAgICAgICAoR1BJT19CQVNFMCsweDgpCi0jZGVmaW5lIEdQSU8wX09TUkggICAgICAgICAgICAgKEdQSU9fQkFTRTArMHhDKQotI2RlZmluZSBHUElPMF9UU1JMICAgICAgICAgICAgIChHUElPX0JBU0UwKzB4MTApCi0jZGVmaW5lIEdQSU8wX1RTUkggICAgICAgICAgICAgKEdQSU9fQkFTRTArMHgxNCkKLSNkZWZpbmUgR1BJTzBfT0RSICAgICAgICAgICAgICAoR1BJT19CQVNFMCsweDE4KQotI2RlZmluZSBHUElPMF9JUiAgICAgICAgICAgICAgIChHUElPX0JBU0UwKzB4MUMpCi0jZGVmaW5lIEdQSU8wX1JSMSAgICAgICAgICAgICAgKEdQSU9fQkFTRTArMHgyMCkKLSNkZWZpbmUgR1BJTzBfUlIyICAgICAgICAgICAgICAoR1BJT19CQVNFMCsweDI0KQotI2RlZmluZSBHUElPMF9SUjMJICAgICAgIChHUElPX0JBU0UwKzB4MjgpCi0jZGVmaW5lIEdQSU8wX0lTUjFMICAgICAgICAgICAgKEdQSU9fQkFTRTArMHgzMCkKLSNkZWZpbmUgR1BJTzBfSVNSMUggICAgICAgICAgICAoR1BJT19CQVNFMCsweDM0KQotI2RlZmluZSBHUElPMF9JU1IyTCAgICAgICAgICAgIChHUElPX0JBU0UwKzB4MzgpCi0jZGVmaW5lIEdQSU8wX0lTUjJIICAgICAgICAgICAgKEdQSU9fQkFTRTArMHgzQykKLSNkZWZpbmUgR1BJTzBfSVNSM0wgICAgICAgICAgICAoR1BJT19CQVNFMCsweDQwKQotI2RlZmluZSBHUElPMF9JU1IzSCAgICAgICAgICAgIChHUElPX0JBU0UwKzB4NDQpCisvK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Hg0KQorI2RlZmluZSBHUElPMF9PU1JMICAgICAgICAgICAgIChHUElPMF9CQVNFKzB4OCkKKyNkZWZpbmUgR1BJTzBfT1NSSCAgICAgICAgICAgICAoR1BJTzBfQkFTRSsweEMpCisjZGVmaW5lIEdQSU8wX1RTUkwgICAgICAgICAgICAgKEdQSU8wX0JBU0UrMHgxMCkKKyNkZWZpbmUgR1BJTzBfVFNSSCAgICAgICAgICAgICAoR1BJTzBfQkFTRSsweDE0KQorI2RlZmluZSBHUElPMF9PRFIgICAgICAgICAgICAgIChHUElPMF9CQVNFKzB4MTgpCisjZGVmaW5lIEdQSU8wX0lSICAgICAgICAgICAgICAgKEdQSU8wX0JBU0UrMHgxQykKKyNkZWZpbmUgR1BJTzBfUlIxICAgICAgICAgICAgICAoR1BJTzBfQkFTRSsweDIwKQorI2RlZmluZSBHUElPMF9SUjIgICAgICAgICAgICAgIChHUElPMF9CQVNFKzB4MjQpCisjZGVmaW5lIEdQSU8wX1JSMwkgICAgICAgKEdQSU8wX0JBU0UrMHgyOCkKKyNkZWZpbmUgR1BJTzBfSVNSMUwgICAgICAgICAgICAoR1BJTzBfQkFTRSsweDMwKQorI2RlZmluZSBHUElPMF9JU1IxSCAgICAgICAgICAgIChHUElPMF9CQVNFKzB4MzQpCisjZGVmaW5lIEdQSU8wX0lTUjJMICAgICAgICAgICAgKEdQSU8wX0JBU0UrMHgzOCkKKyNkZWZpbmUgR1BJTzBfSVNSMkggICAgICAgICAgICAoR1BJTzBfQkFTRSsweDNDKQorI2RlZmluZSBHUElPMF9JU1IzTCAgICAgICAgICAgIChHUElPMF9CQVNFKzB4NDApCisjZGVmaW5lIEdQSU8wX0lTUjNIICAgICAgICAgICAgKEdQSU8wX0JBU0UrMHg0NCkKKworI2RlZmluZSBHUElPMV9PUiAgICAgICAgICAgICAgIChHUElPMV9CQVNFKzB4MCkKKyNkZWZpbmUgR1BJTzFfVENSICAgICAgICAgICAgICAoR1BJTzFfQkFTRSsweDQpCisjZGVmaW5lIEdQSU8xX09TUkwgICAgICAgICAgICAgKEdQSU8xX0JBU0UrMHg4KQorI2RlZmluZSBHUElPMV9PU1JIICAgICAgICAgICAgIChHUElPMV9CQVNFKzB4QykKKyNkZWZpbmUgR1BJTzFfVFNSTCAgICAgICAgICAgICAoR1BJTzFfQkFTRSsweDEwKQorI2RlZmluZSBHUElPMV9UU1JIICAgICAgICAgICAgIChHUElPMV9CQVNFKzB4MTQpCisjZGVmaW5lIEdQSU8xX09EUiAgICAgICAgICAgICAgKEdQSU8xX0JBU0UrMHgxOCkKKyNkZWZpbmUgR1BJTzFfSVIgICAgICAgICAgICAgICAoR1BJTzFfQkFTRSsweDFDKQorI2RlZmluZSBHUElPMV9SUjEgICAgICAgICAgICAgIChHUElPMV9CQVNFKzB4MjApCisjZGVmaW5lIEdQSU8xX1JSMiAgICAgICAgICAgICAgKEdQSU8xX0JBU0UrMHgyNCkKKyNkZWZpbmUgR1BJTzFfUlIzICAgICAgICAgICAgICAoR1BJTzFfQkFTRSsweDI4KQorI2RlZmluZSBHUElPMV9JU1IxTCAgICAgICAgICAgIChHUElPMV9CQVNFKzB4MzApCisjZGVmaW5lIEdQSU8xX0lTUjFIICAgICAgICAgICAgKEdQSU8xX0JBU0UrMHgzNCkKKyNkZWZpbmUgR1BJTzFfSVNSMkwgICAgICAgICAgICAoR1BJTzFfQkFTRSsweDM4KQorI2RlZmluZSBHUElPMV9JU1IySCAgICAgICAgICAgIChHUElPMV9CQVNFKzB4M0MpCisjZGVmaW5lIEdQSU8xX0lTUjNMICAgICAgICAgICAgKEdQSU8xX0JBU0UrMHg0MCkKKyNkZWZpbmUgR1BJTzFfSVNSM0ggICAgICAgICAgICAoR1BJTzFfQkFTRSsweDQ0KQogI2VuZGlmCiAKKyNkZWZpbmUgR1BJT19HUk9VUF9NQVgJICAgIDIKKyNkZWZpbmUgR1BJT19NQVgJICAgIDMyCisjZGVmaW5lIEdQSU9fQUxUMV9TRUwJICAgIDB4NDAwMDAwMDAJICAgIC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