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XJhdGUuCisgKi8KK3ZvaWQKK3RpbWVyX2ludGVycnVwdF9jcHUgKHN0cnVjdCBwdF9yZWdzICpyZWdzKQoreworCS8qIG5vdGhpbmcgdG8gZG8gaGVyZSAqLworCXJldHVybjsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qCisgKiBJbnN0YWxsIGFuZCBmcmVlIGEgaW50ZXJydXB0IGhhbmRsZXIuCisgKi8KKwordm9pZAoraXJxX2luc3RhbGxfaGFuZGxlcihpbnQgdmVjLCBpbnRlcnJ1cHRfaGFuZGxlcl90ICpoYW5kbGVyLCB2b2lkICphcmcpCit7CisKK30KKwordm9pZAoraXJxX2ZyZWVfaGFuZGxlcihpbnQgdmVjKQoreworCit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCit2b2lkCitkb19pcnFpbmZvKGNtZF90YmxfdCAqY21kdHAsIGJkX3QgKmJkLCBpbnQgZmxhZywgaW50IGFyZ2MsIGNoYXIgKmFyZ3ZbXSkKK3sKKwlwdXRzKCJJUlEgcmVsYXRlZCBmdW5jdGlvbnMgYXJlIHVuaW1wbGVtZW50ZWQgY3VycmVudGx5LlxuIik7Cit9CmRpZmYgLS1naXQgYS9hcmNoL3BwYy9jcHUvNzR4eF83eHgvaW8uUyBiL2FyY2gvcHBjL2NwdS83NHh4Xzd4eC9pby5TCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmFmMmU2ZDEKLS0tIC9kZXYvbnVsbAorKysgYi9hcmNoL3BwYy9jcHUvNzR4eF83eHgvaW8uUwpAQCAtMCwwICsxLDEyOCBAQAorLyoKKyAqICBDb3B5cmlnaHQgKEMpIDE5OTgJRGFuIE1hbGVrIDxkbWFsZWtAamxjLm5ldD4KKyAqICBDb3B5c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i8KKwkxODAsCS8qIDAwMTAxIC0gMTh4ICAgICovCisJMTAsCS8qIDAwMTEwIC0gYnlwYXNzICovCisJMjAwLAkvKiAwMDExMSAtIDIweCAgICAqLworCTIwLAkvKiAwMTAwMCAtICAyeCAgICAqLworCTIxMCwJLyogMDEwMDEgLSAyMXggICAgKi8KKwk2NSwJLyogMDEwMTAgLSAgNi41eCAgKi8KKwkxMzAsCS8qIDAxMDExIC0gMTN4ICAgICovCisJODUsCS8qIDAxMTAwIC0gIDguNXggICovCisJMjQwLAkvKiAwMTEwMSAtIDI0eCAgICAqLworCTk1LAkvKiAwMTExMCAtICA5LjV4ICAqLworCTkwLAkvKiAwMTExMSAtICA5eCAgICAqLworCTMwLAkvKiAxMDAwMCAtICAzeCAgICAqLworCTEwNSwJLyogMTAwMDEgLSAxMC41eCAgKi8KKwk1NSwJLyogMTAwMTAgLSAgNS41eCAgKi8KKwkxMTAsCS8qIDEwMDExIC0gMTF4ICAgICovCisJNDAsCS8qIDEwMTAwIC0gIDR4ICAgICovCisJMTAwLAkvKiAxMDEwMSAtIDEweCAgICAqLworCTUwLAkvKiAxMDExMCAtICA1eCAgICAqLworCTEyMCwJLyogMTAxMTEgLSAxMnggICAgKi8KKwk4MCwJLyogMTEwMDAgLSAgOHggICAgKi8KKwkxNDAsCS8qIDExMDAxIC0gMTR4ICAgICovCisJNjAsCS8qIDExMDEwIC0gIDZ4ICAgICovCisJMTYwLAkvKiAxMTAxMSAtIDE2eCAgICAqLworCTEzNSwJLyogMTExMDAgLSAxMy41eCAgKi8KKwkyODAsCS8qIDExMTAxIC0gMjh4ICAgICovCisJMCwJLyogMTExMTAgLSBvZmYgICAgKi8KKwkxMjUJLyogMTExMTEgLSAxMi41eCAgKi8KK307CisKK3N0YXRpYyBjb25zdCBpbnQgaGlkMV9meF9tdWx0aXBsaWVyc194XzEwW10gPSB7CisJMDAsCS8qIDAwMDAgLSBvZmYgKi8KKwkwMCwJLyogMDAwMSAtIG9mZiAqLworCTEwLA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mMKKworCS8qIE5PVFJFQUNIRUQgKi8KKworCS5nbG9ibAlpbnZhbGlkYXRlX2JhdHMKK2ludmFsaWRhdGVfYmF0czoKKwkvKiBpbnZhbGlkYXRlIEJBVHMgKi8KKwltdHNwcglJQkFUMFUsIHIwCisJbXRzcHIJSUJBVDFVLCByMAorCW10c3ByCUlCQVQyVSwgcjAKKwltdHNwcglJQkFUM1UsIHIwCisjaWZkZWYgQ09ORklHX0hJR0hfQkFUUworCW10c3ByICAgSUJBVDRVLCByMAorCW10c3ByICAgSUJBVDVVLCByMAorCW10c3ByICAgSUJBVDZVLCByMAorCW10c3ByICAgSUJBVDdVLCByMAorI2VuZGlmCisJaXN5bmMKKwltdHNwcglEQkFUMFUsIHIwCisJbXRzcHIJREJBVDFVLCByMAorCW10c3ByCURCQVQyVSwgcjAKKwltdHNwcglEQkFUM1UsIHIwCisjaWZkZWYgQ09ORklHX0hJR0hfQkFUUworCW10c3ByICAgREJBVDRVLCByMAorCW10c3ByICAgREJBVDVVLCByMAorCW10c3ByICAgREJBVDZVLCByMAorCW10c3ByICAgREJBVDdVLCByMAorI2VuZGlmCisJaXN5bmMKKwlzeW5jCisJYmxyCisKKwkvKiBzZXR1cF9iYXRzIC0gc2V0IHRoZW0gdXAgdG8gc29tZSBpbml0aWFsIHN0YXRlICovCisJLmdsb2JsCXNldHVwX2JhdHMKK3NldHVwX2JhdHM6CisJYWRkaXMJcjAsIHIwLCAweDAwMDAKKworCS8qIElCQVQgMCAqLworCWFkZGlzCXI0LCByMCwgQ09ORklHX1NZU19JQkFUMExAaAorCW9yaQlyNCwgcjQsIENPTkZJR19TWVNfSUJBVDBMQGwKKwlhZGRpcwlyMywgcjAsIENPTkZJR19TWVNfSUJBVDBVQGgKKwlvcmkJcjMsIHIzLCBDT05GSUdfU1lTX0lCQVQwVUBsCisJbXRzcHIJSUJBVDBMLCByNAorCW10c3ByCUlCQVQwVSwgcjMKKwlpc3luYworCisJLyogREJBVCAwICovCisJYWRkaXMJcjQ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KKwlvcmkJcjQsIHI0LCBDT05GSUdfU1lTX0RCQVQyTEBsCisJYWRkaXMJcjMsIHIwLCBDT05GSUdfU1lTX0RCQVQyVUBoCisJb3JpCXIzLCByMywgQ09ORklHX1NZU19EQkFUMlVAbAorCW10c3ByCURCQVQyTCwgcjQKKwltdHNwcglEQkFUMlUsIHIzCisJaXN5bmMKKworCS8qIElCQVQgMyAqLworCWFkZGlzCXI0LCByMCwgQ09ORklHX1NZU19JQkFUM0xAaAorCW9yaQlyNCwgcjQsIENPTkZJR19TWVNfSUJBVDNMQGwKKwlhZGRpcwlyMywgcjAsIENPTkZJR19TWVNfSUJBVDNVQGgKKwlvcmkJcjMsIHIzLCBDT05GSUdfU1lTX0lCQVQzVUBsCisJbXRzcHIJSUJBVDNMLCByNAorCW10c3ByCUlCQVQzVSwgcjMKKwlpc3luYworCisJLyogREJBVCAzICovCisJYWRkaXMJcjQsIHIwLCBDT05GSUdfU1lTX0RCQVQzTEBoCisJb3JpCXI0LCByNCwgQ09ORklHX1NZU19EQkFUM0xAbAorCWFkZGlzCXIzLCByMCwgQ09ORklHX1NZU19EQkFUM1VAaAorCW9yaQlyMywgcjMsIENPTkZJR19TWVNfREJBVDNVQGwKKwltdHNwcglEQkFUM0wsIHI0CisJbXRzcHIJREJBVDNVLCByMworCWlzeW5jCisKKyNpZmRlZiBDT05GSUdfSElHSF9CQVRTCisJLyogSUJBVCA0ICovCisJYWRkaXMgICByNCwgcjAsIENPTkZJR19TWVNfSUJBVDRMQGgKKwlvcmkgICAgIHI0LCByNCwgQ09ORklHX1NZU19JQkFUNExAbAorCWFkZGlzICAgcjMsIHIwLCBDT05GSUdfU1lTX0lCQVQ0VUBoCisJb3JpICAgICByMywgcjMsIENPTkZJR19TWVNfSUJBVDRVQGwKKwltdHNwciAgIElCQVQ0TCwgcjQKKwltdHNwciAgIElCQVQ0VSwgcjMKKwlpc3luYworCisJLyogREJBVCA0ICovCisJYWRkaXMgICByNCwgcjAsIENPTkZJR19TWVNfREJBVDRMQGgKKwlvcmkgICAgIHI0LCByNCwgQ09ORklHX1NZU19EQkFUNExAbAorCWFkZGlzICAgcjMsIHIwLCBDT05GSUdfU1lTX0RCQVQ0VUBoCisJb3JpICAgICByMywgcjMsIENPTkZJR19TWVNfREJBVDRVQGwKKwltdHNwciAgIERCQVQ0TCwgcjQKKwltdHNwciAgIERCQVQ0VSwgcjMKKwlpc3luYworCisJLyogSUJBVCA1ICovCisJYWRkaXMgICByNCwgcjAsIENPTkZJR19TWVNfSUJBVDVMQGgKKwlvcmkgICAgIHI0LCByNCwgQ09ORklHX1NZU19JQkFUNUxAbAorCWFkZGlzICAgcjMsIHIwLCBDT05GSUdfU1lTX0lCQVQ1VUBoCisJb3JpICAgICByMywgcjMsIENPTkZJR19TWVNfSUJBVDVVQGwKKwltdHNwciAgIElCQVQ1TCwgcjQKKwltdHNwciAgIElCQVQ1VSwgcjMKKwlpc3luYworCisJLyogREJBVCA1ICovCisJYWRkaXMgICByNCwgcjAsIENPTkZJR19TWVNfREJBVDVMQGgKKwlvcmkgICAgIHI0LCByNCwgQ09ORklHX1NZU19EQkFUNUxAbAorCWFkZGlzICAgcjMsIHIwLCBDT05GSUdfU1lTX0RCQVQ1VUBoCisJb3JpICAgICByMywgcjMsIENPTkZJR19TWVNfREJBVDVVQGwKKwltdHNwciAgIERCQVQ1TCwgcjQKKwltdHNwciAgIERCQVQ1VSwgcjMKKwlpc3luYworCisJLyogSUJBVCA2ICovCisJYWRkaXMgICByNCwgcjAsIENPTkZJR19TWVNfSUJBVDZMQGgKKwlvcmkgICAgIHI0LCByNCwgQ09ORklHX1NZU19JQkFUNkxAbAorCWFkZGlzICAgcjMsIHIwLCBDT05GSUdfU1lTX0lCQVQ2VUBoCisJb3JpICAgICByMywgcjMsIENPTkZJR19TWVNfSUJBVDZVQGwKKwltdHNwciAgIElCQVQ2TCwgcjQKKwltdHNwciAgIElCQVQ2VSwgcjMKKwlpc3luYworCisJLyogREJBVCA2ICovCisJYWRkaXMgICByNCwgcjAsIENPTkZJR19TWVNfREJBVDZMQGgKKwlvcmkgICAgIHI0LCByNCwgQ09ORklHX1NZU19EQkFUNkxAbAorCWFkZGlzICAgcjMsIHIwLCBDT05GSUdfU1lTX0RCQVQ2VUBoCisJb3JpICAgICByMywgcjMsIENPTkZJR19TWVNfREJBVDZVQGwKKwltdHNwciAgIERCQVQ2TCwgcjQKKwltdHNwciAgIERCQVQ2VSwgcjMKKwlpc3luYworCisJLyogSUJBVCA3ICovCisJYWRkaXMgICByNCwgcjAsIENPTkZJR19TWVNfSUJBVDdMQGgKKwlvcmkgICAgIHI0LCByNCwgQ09ORklHX1NZU19JQkFUN0xAbAorCWFkZGlzICAgcjMsIHIwLCBDT05GSUdfU1lTX0lCQVQ3VUBoCisJb3JpICAgICByMywgcjMsIENPTkZJR19TWVNfSUJBVDdVQGwKKwltdHNwciAgIElCQVQ3TCwgcjQKKwltdHNwciAgIElCQVQ3VSwgcjMKKwlpc3luYworCisJLyogREJBVCA3ICovCisJYWRkaXMgICByNCwgcjAsIENPTkZJR19TWVNfREJBVDdMQGgKKwlvcmkgICAgIHI0LCByNCwgQ09ORklHX1NZU19EQkFUN0xAbAorCWFkZGlzICAgcjMsIHIwLCBDT05GSUdfU1lTX0RCQVQ3VUBoCisJb3JpICAgICByMywgcjMsIENPTkZJR19TWVNfREJBVDdVQGwKKwltdHNwciAgIERCQVQ3TCwgcjQKKwltdHNwciAgIERCQVQ3VSwgcjMKKwlpc3luYworI2VuZGlmCisKKwkvKiBiYXRzIGFyZSBkb25lLCBub3cgaW52YWxpZGF0ZSB0aGUgVExCcyAqLworCisJYWRkaXMJcjMsIDAsIDB4MDAwMAorCWFkZGlzCXI1LCAwLCAweDQgICAgLyogdXBwZXIgYm91bmQgb2YgMHgwMDA0MDAwMCBmb3IgNzQwMC83NTAgKi8KKworCWlzeW5jCisKK3RsYmxwOgorCXRsYmllCXIzCisJc3luYworCWFkZGkJcjMsIHIzLCAweDEwMDAKKwljbXAJMCw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AqdmlkZW9faHdfaW5pdCh2b2lkKQoreworCUdyYXBoaWNEZXZpY2UgKnBHRCA9IChHcmFwaGljRGV2aWNlICopICZjdGZiOworCXN0cnVjdCBmYl9pbmZvICppbmZvOworCisJaWYgKG1wYzUxMjFfZGl1X2luaXQoKSA8IDApCisJCXJldHVybiBOVUxMOworCisJLyogZmlsbCBpbiBHcmFwaGljIGRldmljZSBzdHJ1Y3QgKi8KKwlzcHJpbnRmKHBHRC0+bW9kZUlkZW50LCAiJWR4JWR4JWQgJWRrSHogJWRIeiIsCisJCXhyZXMsIHlyZXMsIDMyLCA2NCwgNjApOworCisJcEdELT5mcmFtZUFkcnMgPSAodW5zaWduZWQgaW50KWZzbF9mYl9vcGVuKCZpbmZvKTsKKwlwR0QtPndpblNpemVYID0geHJlczsKKwlwR0QtPndpblNpemVZID0geXJlcyAtIGluZm8tPmxvZ29faGVpZ2h0OworCXBHRC0+cGxuU2l6ZVggPSBwR0QtPndpblNpemVYOworCXBHRC0+cGxuU2l6ZVkgPSBwR0QtPndpblNpemVZOworCisJcEdELT5nZGZCeXRlc1BQID0gNDsKKwlwR0QtPmdkZkluZGV4ID0gR0RGXzMyQklUX1g4ODhSR0I7CisKKwlwR0QtPmlzYUJhc2UgPSAwOworCXBHRC0+cGNpQmFzZSA9IDA7CisJcEdELT5tZW1TaXplID0gaW5mby0+c2NyZWVuX3NpemUgLSBpbmZvLT5sb2dvX3NpemU7CisKKwkvKiBDdXJzb3IgU3RhcnQgQWRkcmVzcyAqLworCXBHRC0+ZHByQmFzZSA9IDA7CisJcEdELT52cHJCYXNlID0gMDsKKwlwR0QtPmNwckJhc2UgPSAwOworCisJcmV0dXJuICh2b2lkICopcEdEOworfQorCisvKioKKyAgKiBTZXQgdGhlIExVVAorICAqCisgICogQGluZGV4OiBjb2xvciBudW1iZXIKKyAgKiBAcjogcmVkCisgICogQGI6IGJsdWUKKyAgKiBAZzogZ3JlZW4KKyAgKi8KK3ZvaWQgdmlkZW9fc2V0X2x1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rldl90ICpyZWdzID0gJmltLT5pMmMuZGV2W2J1c19udW1dOworCWludCB3cmNvdW50OworCWludCBzdGF0dXM7CisKKwlmb3IgKHdyY291bnQgPSAwOyB3cmNvdW50IDwgbGVuOyArK3dyY291bnQpIHsKKworCQltcGNfcmVnX291dCAoJnJlZ3MtPm1kciwgYnVmW3dyY291bnRdLCAwKTsKKworCQlpZiAod2FpdF9mb3JfcGluICgmc3RhdHVzKSkgeworCQkJYnJlYWs7CisJCX0KKworCQlpZiAoc3RhdHVzICYgSTJDX1JYQUspIHsKKwkJCWJyZWFrOworCQl9CisKKwl9CisKKwlyZXR1cm4gISh3cmNvdW50ID09IGxlbik7Cit9CisKK3N0YXRpYyBpbnQgcmVjZWl2ZV9ieXRlcyAodWNoYXIgY2hpcCwgY2hhciAqYnVmLCBpbnQgbGVuKQoreworCXZvbGF0aWxlIGltbWFwX3QgKmltID0gKGltbWFwX3QgKikgQ09ORklHX1NZU19JTU1SOworCXZvbGF0aWxlIGkyYzUxMnhfZGV2X3QgKnJlZ3MgPSAmaW0tPmkyYy5kZXZbYnVzX251bV07CisJaW50IGR1bW15ICAgPSAxOworCWludCByZGNvdW50ID0gMDsKKwlpbnQgc3RhdHVzOworCWludCBpOworCisJbXBjX3JlZ19vdXQgKCZyZWdzLT5tY3IsIDAsIEkyQ19UWCk7CisKKwlmb3IgKGkgPSAwOyBpIDwgbGVuOyArK2kpIHsKKwkJYnVmW3JkY291bnRdID0gbXBjX3JlZ19pbiAoJnJlZ3MtPm1kcik7CisKKwkJaWYgKGR1bW15KSB7CisJCQlkdW1teSA9IDA7CisJCX0gZWxzZSB7CisJCQlyZGNvdW50Kys7CisJCX0KKworCQlpZiAod2FpdF9mb3JfcGluICgmc3RhdHVzKSkgeworCQkJcmV0dXJuIC00OworCQl9CisJfQorCisJbXBjX3JlZ19vdXQgKCZyZWdzLT5tY3IsIEkyQ19UWEFLLCBJMkNfVFhBSyk7CisJYnVmW3JkY291bnQrK10gPSBtcGNfcmVnX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0+cGNpX2NsayA9IHBjaV9jbGs7CisJZ2QtPmNzYl9jbGsgPSBjc2JfY2xrOworCWdkLT5jcHVfY2xrID0gY29yZV9jbGs7CisJZ2QtPmJ1c19jbGsgPSBjc2JfY2xrOworCXJldHVybiAwOworCit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogZ2V0X2J1c19mcmVxCisgKiByZXR1cm4gc3lzdGVtIGJ1cyBmcmVxIGluIEh6CisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwordWxvbmcgZ2V0X2J1c19mcmVxICh1bG9uZyBkdW1teSkKK3sKKwlyZXR1cm4gZ2QtPmNzYl9jbGs7Cit9CisKK2ludCBkb19jbG9ja3MgKGNtZF90YmxfdCAqIGNtZHRwLCBpbnQgZmxhZywgaW50IGFyZ2MsIGNoYXIgKmFyZ3ZbXSkKK3sKKwljaGFyIGJ1ZlszMl07CisKKwlwcmludGYoIkNsb2NrIGNvbmZpZ3VyYXRpb246XG4iKTsKKwlwcmludGYoIiAgQ1BVOiAgICAgICAgICAgICAgICAgJS00cyBNSHpcbiIsIHN0cm1oeihidWYsIGdkLT5jcHVfY2xrKSk7CisJcHJpbnRmKCIgIENvaGVyZW50IFN5c3RlbSBCdXM6ICUtNHMgTUh6XG4iLCBzdHJtaHooYnVmLCBnZC0+Y3NiX2NsaykpOworCXByaW50ZigiICBJUFMgQnVzOiAgICAgICAgICAgICAlLTRzIE1IelxuIiwgc3RybWh6KGJ1ZiwgZ2QtPmlwc19jbGspKTsKKwlwcmludGYoIiAgUENJOiAgICAgICAgICAgICAgICAgJS00cyBNSHpcbiIsIHN0cm1oeihidWYsIGdkLT5wY2lfY2xrKSk7CisJcHJpbnRmKCIgIEREUjogICAgICAgICAgICAgICAgICUtNHMgTUh6XG4iLCBzdHJtaHooYnVmLCAyKmdkLT5jc2JfY2xrKSk7CisJcmV0dXJuIDA7Cit9CisKK1VfQk9PVF9DTUQ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nRlcnJ1cHQpCisKKy8qIENyaXRpY2FsIGludGVycnVwdCAqLworCVNURF9FWENFUFRJT04oMHhhMDAsIENyaXRpY2FsLCBVbmtub3duRXhjZXB0aW9uKQorCisvKiBTeXN0ZW0gQ2FsbCAqLworCVNURF9FWENFUFRJT04oMHhjMDAsIFN5c3RlbUNhbGwsIFVua25vd25FeGNlcHRpb24pCisKKy8qIFRyYWNlIGludGVycnVwdCAqLworCVNURF9FWENFUFRJT04oMHhkMDAsIFRyYWNlLCBVbmtub3duRXhjZXB0aW9uKQorCisvKiBQZXJmb3JtYW5jZSBNb25pdG9yIGludGVycnVwdCAqLworCVNURF9FWENFUFRJT04oMHhmMDAsIFBlcmZNb24sIFVua25vd25FeGNlcHRpb24pCisKKy8qIEludHJ1Y3Rpb24gVHJhbnNsYXRpb24gTWlzcyAqLworCVNURF9FWENFUFRJT04oMHgxMDAwLCBJbnN0cnVjdGlvblRMQk1pc3MsIFVua25vd25FeGNlcHRpb24pCisKKy8qIERhdGEgTG9hZCBUcmFuc2xhdGlvbiBNaXNzICovCisJU1REX0VYQ0VQVElPTigweDExMDAsIERhdGFMb2FkVExCTWlzcywgVW5rbm93bkV4Y2VwdGlvbikKKworLyogRGF0YSBTdG9yZSBUcmFuc2xhdGlvbiBNaXNzICovCisJU1REX0VYQ0VQVElPTigweDEyMDAsIERhdGFTdG9yZVRMQk1pc3MsIFVua25vd25FeGNlcHRpb24pCisKKy8qIEluc3RydWN0aW9uIEFkZHJlc3MgQnJlYWtwb2ludCAqLworCVNURF9FWENFUFRJT04oMHgxMzAwLCBJbnN0cnVjdGlvbkFkZHJCcmVha3BvaW50LCBEZWJ1Z0V4Y2VwdGlvbikKKworLyogU3lzdGVtIE1hbmFnZW1lbnQgaW50ZXJydXB0ICovCisJU1REX0VYQ0VQVElPTigweDE0MDAsIFN5c3RlbU1nbXRJbnRlcnJ1cHQsIFVua25vd25FeGNlcHRpb24pCisKKwkuZ2xvYmwJX2VuZF9vZl92ZWN0b3JzC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X1RBQkxFXykKKwljbXB3aQlyMCwwCisJbXRjdHIJcjAKKwlhZGRpCXIzLHIzLC00CisJYmVxCTRmCiszOglsd3p1CXI0LDQocjMpCisJbHd6dXgJcjAscjQscjExCisJYWRkCXIwLHIwLHIxMQorCXN0dwlyMTAsMChyMykKKwlzdHcJcjAsMChyNCkKKwliZG56CTNiCis0OgorY2xlYXJfYnNzOgorCS8qCisJICogTm93IGNsZWFyIEJTUyBzZWdtZW50CisJICovCisJbHd6CXIzLEdPVChfX2Jzc19zdGFydCkKKwlsd3oJcjQsR09UKF9lbmQpCisKKwljbXBsdwkwLCByMywgcjQKKwliZXEJNmYKKworCWxpCXIwLCAwCis1OgorCXN0dwlyMCwgMChyMykKKwlhZGRpCXIzLCByMywgNAorCWNtcGx3CTAsIHIzLCByNAorCWJuZQk1YgorNjoKKwltcglyMywgcjkJCS8qIEdsb2JhbCBEYXRhIHBvaW50ZXIJCSovCisJbXIJcjQsIHIxMAkJLyogRGVzdGluYXRpb24gQWRkcmVzcwkJKi8KKwlibAlib2FyZF9pbml0X3IKKworCS8qCisJICogQ29weSBleGNlcHRpb24gdmVjdG9yIGNvZGUgdG8gbG93IG1lbW9yeQorCSAqCisJICogcjM6IGRlc3RfYWRkcgorCSAqIHI3OiBzb3VyY2UgYWRkcmVzcywgcjg6IGVuZCBhZGRyZXNzLCByOTogdGFyZ2V0IGFkZHJlc3MKKwkgKi8KKwkuZ2xvYmwJdHJhcF9pbml0Cit0cmFwX2luaXQ6CisJbWZscglyNAkJLyogc2F2ZSBsaW5rIHJlZ2lzdGVyICovCisJR0VUX0dPVAorCWx3eglyNywgR09UKF9zdGFydCkKKwlsd3oJcjgsIEdPVChfZW5kX29mX3ZlY3RvcnMpCisKKwlsaQlyOSwgMHgxMDAJLyogcmVzZXQgdmVjdG9yIGF0IDB4MTAwICovCisKKwljbXBsdwkwLCByNywgcjgKKwliZ2VscgkJCS8qIHJldHVybiBpZiByNz49cjggLSBqdXN0IGluIGNhc2UgKi8K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bC5jdG9ycyAgICAgOiB7ICooLnJlbC5jdG9ycykJfQorICAucmVsYS5jdG9ycyAgICA6IHsgKigucmVsYS5jdG9ycykJfQorICAucmVsLmR0b3JzICAgICA6IHsgKigucmVsLmR0b3JzKQl9CisgIC5yZWxhLmR0b3JzICAgIDogeyAqKC5yZWxhLmR0b3JzKQl9CisgIC5yZWwuYnNzICAgICAgIDogeyAqKC5yZWwuYnNzKQkJfQorICAucmVsYS5ic3MgICAgICA6IHsgKigucmVsYS5ic3MpCQl9CisgIC5yZWwucGx0ICAgICAgIDogeyAqKC5yZWwucGx0KQkJfQorICAucmVsYS5wbHQgICAgICA6IHsgKigucmVsYS5wbHQpCQl9CisgIC5pbml0ICAgICAgICAgIDogeyAqKC5pbml0KQl9CisgIC5wbHQgOiB7ICooLnBsdCkgfQorICAudGV4dCAgICAgIDoKKyAgeworICAgIGFyY2gvcHBjL2NwdS9tcGM1MTJ4L3N0YXJ0Lm8JKC50ZXh0KQorICAgICooLnRleHQpCisgICAgKiguZ290MSkKKyAgICAuID0gQUxJR04oMTYpOworICAgICooLmVoX2ZyYW1lKQorICAgICooU09SVF9CWV9BTElHTk1FTlQoU09SVF9CWV9OQU1FKC5yb2RhdGEqKSkpCisgIH0KKyAgLmZpbmkgICAgICA6IHsgKiguZmluaSkgICAgfSA9MAorICAuY3RvcnMgICAgIDogeyAqKC5jdG9ycykgICB9CisgIC5kdG9ycyAgICAgOiB7ICooLmR0b3JzKSAgIH0KKworICAvKiBSZWFkLXdyaXRlIHNlY3Rpb24sIG1lcmdlZCBpbnRvIGRhdGEgc2VnbWVudDogKi8KKyAgLiA9ICguICsgMHgwRkZGKSAmIDB4RkZGRkYwMDA7CisgIF9lcm90ZXh0ID0gLjsKKyAgUFJPVklERSAoZXJvdGV4dCA9IC4pOworICAucmVsb2MgICA6CisgIHsKKyAgICAqKC5nb3QpCisgICAgX0dPVDJfVEFCTEVfID0gLjsKKyAgICAqKC5nb3QyKQorICAgIF9GSVhVUF9UQUJMRV8gPSAuOworICAgICooLmZpeHVwKQorICB9CisgIF9fZ290Ml9lbnRyaWVzID0gKF9GSVhVUF9UQUJMRV8gLSBfR09UMl9UQUJMRV8pID4+IDI7CisgIF9fZml4dXBfZW50cmllcyA9ICguIC0gX0ZJWFVQX1RBQkxFXykgPj4gMjsKKworICAuZGF0YSAgICA6CisgIHsKKyAgICAqKC5kYXRhKQorICAgICooLmRhdGExKQorICAgICooLnNkYXRhKQorICAgICooLnNkYXRhMikKKyAgICAqKC5keW5hbWljKQorICAgIENPTlNUUlVDVE9SUworICB9CisgIF9lZGF0YSAgPSAgLjsKKyAgUFJPVklERSAoZWRhdGEgPSAuKTsKKworICAuID0gLjsKKyAgX191X2Jvb3RfY21kX3N0YXJ0ID0gLjsKKyAgLnVfYm9vdF9jbWQgOiB7ICooLnVfYm9vdF9jbWQpIH0KKyAgX191X2Jvb3RfY21kX2VuZCA9IC47CisKKworICAuID0gLjsKKyAgX19zdGFydF9fX2V4X3RhYmxlID0gLjsKKyAgX19leF90YWJsZSA6IHsgKihfX2V4X3RhYmxlKSB9CisgIF9fc3RvcF9fX2V4X3RhYmxlID0gLjsKKworICAuID0gQUxJR04oNDA5Nik7CisgIF9faW5pdF9iZWdpbiA9IC47CisgIC50ZXh0LmluaXQgOiB7ICooLnRleHQuaW5pdCkgfQorICAuZGF0YS5pbml0IDogeyAqKC5kYXRhLmluaXQpIH0KKyAgLiA9IEFMSUdOKDQwOTYpOworICBfX2luaXRfZW5kID0gLjsKKworICBfX2Jzc19zdGFydCA9IC47CisgIC5ic3MgKE5PTE9BRCkgICAgICAgOgorICB7CisgICAqKC5zYnNzKSAqKC5zY29tbW9uKQorICAgKiguZHluYnNzKQorICAgKiguYnNzKQorICAgKihDT01NT04pCisgICAuID0gQUxJR04oNCk7CisgIH0KKyAgX2VuZCA9IC4gOworICBQUk9WSURFIChlbmQgPSAuKTsKK30KK0VOVFJZKF9zdGFydCkKZGlmZiAtLWdpdCBhL2FyY2gvcHBjL2NwdS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NjX3NpbWFzayAmPSB+KDEgPDwgKDMxIC0gdmVjKSk7CisJaXJxX3ZlY3NbdmVjXS5oYW5kbGVyID0gTlVMTDsKKwlpcnFfdmVjc1t2ZWNdLmFyZyA9IE5VTEw7Cit9CisKKy8qCisgKiAgVGltZXIgaW50ZXJydXB0IC0gZ2V0cyBjYWxsZWQgd2hlbiAgYml0IDAgb2YgREVDIGNoYW5nZXMgZnJvbQorICogIDAuIERlY3JlbWVudGVyIGlzIGVuYWJsZWQgd2l0aCBiaXQgVEJFIGluIFRCU0NSLgorICovCit2b2lkIHRpbWVyX2ludGVycnVwdF9jcHUgKHN0cnVjdCBwdF9yZWdzICpyZWdzKQoreworCXZvbGF0aWxlIGltbWFwX3QgKmltbXIgPSAoaW1tYXBfdCAqKSBDT05GSUdfU1lTX0lNTVI7CisKKyNpZiAwCisJcHJpbnRmICgiKioqIFRpbWVyIEludGVycnVwdCAqKiogIik7CisjZW5kaWYKKwkvKiBSZXNldCBUaW1lciBTdGF0dXMgQml0IGFuZCBUaW1lcnMgSW50ZXJydXB0IFN0YXR1cyAqLworCWltbXItPmltX2Nsa3JzdGsuY2Fya19wbHByY3JrID0gS0FQV1JfS0VZOworCV9fYXNtX18gKCJub3AiKTsKKwlpbW1yLT5pbV9jbGtyc3QuY2FyX3BscHJjciB8PSBQTFBSQ1JfVEVYUFMgfCBQTFBSQ1JfVE1JU1Q7CisKKwlyZXR1cm47Cit9CisKKyNpZiBkZWZpbmVkKENPTkZJR19DTURfSVJRKQorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBpcnFpbmZvIC0gcHJpbnQgaW5mb3JtYXRpb24gYWJvdXQgSVJRcworICoKKyAqLworaW50IGRvX2lycWluZm8oY21kX3RibF90ICpjbWR0cCwgaW50IGZsYWcsIGludCBhcmdjLCBjaGFyICphcmd2W10pCit7CisJaW50IHZlYzsKKworCXBya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A8IG51bTsgaSsrKQorCQlwcmludGYgKCIlYyIsIGlzcHJpbnQgKHBjW2ldKSA/IHBjW2ldIDogJy4nKTsKKwlwcmludGYgKCJcbiIpOworfQorI2Vsc2UJLyogIURFQlVHICovCisKKyNkZWZpbmUJRFBSSU5UKGEpCisKKyNlbmRpZgkvKiBERUJVRyAqLworCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tCisgKiBGdW5jdGlvbiBwcm90b3R5cGVzCisgKiAtLS0tLS0tLS0tLS0tLS0tLS0tICovCit2b2lkIHNwaV9pbml0ICh2b2lkKTsKKworc3NpemVfdCBzcGlfcmVhZCAodWNoYXIgKiwgaW50LCB1Y2hhciAqLCBpbnQpOworc3NpemVfdCBzcGlfd3JpdGUgKHVjaGFyICosIGludCwgdWNoYXIgKiwgaW50KTsKK3NzaXplX3Qgc3BpX3hmZXIgKHNpemVfdCk7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiAgRnVuY3Rpb246ICAgIHNwaV9pbml0X2YKKyAqCisgKiAgRGVzY3JpcHRpb246IEluaXQgU1BJLUNvbnRyb2xsZXIgKFJPTSBwYXJ0KQorICoKKyAqICByZXR1cm46ICAgICAgLS0tCisgKgorICogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwordm9pZCBzcGlfaW5pdF9mICh2b2lkKQoreworCWludCBpOworCisJdm9sYXRpbGUgaW1tYXBfdCAqaW1tcjsKKwl2b2xhdGlsZSBxc21jbTV4eF90ICpxc21jbTsKKworCWltbXIgPSAoaW1tYXBfdCAqKSAgQ09ORklHX1NZU19JTU1SOworCXFzbWNtID0gKHFzbWNtNXh4X3QgKikmaW1tci0+aW1fcXNtY207CisKKwlxc21jbS0+cXNtY21fcXNtY3IgPSAwOyAvKiBhbGwgYWNjZXNzZXMg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ogU1BTUiAoQ29udHJvbGwgUmVnaXN0ZXIgMykgUmVhZCBvbmx5LyByZXNldCBGbGFncyAwOCwwOSwxMAorCSAqIFNQQ1IzWzA4XSA9IDEgKDB4ODApIFFTUEkgZmluaXNoZWQKKwkgKiBTUENSM1swOV0gPSAxICgweDQwKSBNb2RlIEZhdWx0IEZsYWcKKwkgKiBTUENSM1sxMF0gPSAxICgweDIwKSBIQUxUQQorCSAqIFNQQ1IzWzExLi4xNV0gPSAwICgweDAwMDApIExhc3QgZXhlY3V0ZWQgY29tbWFuZAorCSAqLworCXFzbWNtLT5xc21jbV9zcHNyPTB4RTA7CisJLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisJICogU2V0dXAgUkFNCisJICovCisJZm9yKGk9MDtpPDMyO2krKykgeworCQkgcXNtY20tPnFzbWNtX3JlY3JhbVtpXT0weDAwMDA7CisJCSBxc21jbS0+cXNtY21fdHJhbnJhbVtpXT0weDAwMDA7CisJCSBxc21jbS0+cXNtY21fY29tZHJhbVtpXT0weDAwOworCX0KKwlyZXR1cm47Cit9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogIEZ1bmN0aW9uOiAgICBzcGlfaW5pdF9yCisgKiAgRHVtbXksIGFsbCBpbml0aWFsaXphdGlvbnMgaGF2ZSBiZWVuIGRvbmUgaW4gc3BpX2luaXRfcgorICogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KK3ZvaWQgc3BpX2luaXRfciAodm9pZCkKK3sKKwlyZXR1cm47CisKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICBGdW5jdGlvbjogICAgc3BpX3dyaXRlCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworc3NpemVfdCBzaG9ydF9zcGlfd3JpdGUgKHVjaGFyICphZGRyLCBpbnQgYWxlbiwgdWNoYXIgKmJ1ZmZlciwgaW50IGxlbikKK3sKKwlpbnQgaSxkbGVuOworCXZvbGF0aWxlIGltbWFwX3QgKmltbXI7CisJdm9sYXRpbGUgcXNtY201eHhfdCAqcXNtY207CisKKwlpbW1yID0gKGltbWFwX3QgKikgIENPTkZJR19TWVNfSU1NUjsKKwlxc21jbSA9IChxc21jbTV4eF90ICopJmltbXItPmltX3FzbWNtOworCWZvcihpPTA7aTwzMjtpKyspIHsKKwkJIHFzbWNtLT5xc21jbV9yZWNyYW1baV09MHgwMDAwOworCQkgcXNtY20tPnFzbWNtX3RyYW5yYW1baV09MHgwMDAwOworCQkgcXNtY20tPnFzbWNtX2NvbWRyYW1baV09MHgwMDsKKwl9CisJcXNtY20tPnFzbWNtX3RyYW5yYW1bMF0gPSAgU1BJX0VFUFJPTV9XUkVOOyAvKiB3cml0ZSBlbmFibGUgKi8KKwlzcGlfeGZlcigxKTsKKwlpPTA7CisJcXNtY20tPnFzbWNtX3RyYW5yYW1baSsrXSA9ICBTUElfRUVQUk9NX1dSSVRFOyAvKiBXUklURSBtZW1vcnkgYXJyYXkgKi8KKwlxc21jbS0+cXNtY21fdHJhbnJhbVtpKytdID0gIGFkZHJbMF07CisJcXNtY20tPnFzbWNtX3RyYW5yYW1baSsrXSA9ICBhZGRyWzFdOworCisJZm9yKGRsZW49MDtkbGVuPGxlbjtkbGVuKyspIHsKKwkJcXNtY20tPnFzbWNtX3RyYW5yYW1baStkbGVuXSA9IGJ1ZmZlcltkbGVuXTsgLyogV1JJVEUgbWVtb3J5IGFycmF5ICovCisJfQorCS8qIHRyYW5zbWl0IGl0ICovCisJc3BpX3hmZXIoaStkbGVuKTsKKwkvKiBpZ25vcmUgc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xlbjsKKwl9d2hpbGUoaSk7CisJcmV0dXJuIChsZW4pOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogIEZ1bmN0aW9uOiAgICBzcGlfcmVhZAorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KK3NzaXplX3Qgc2hvcnRfc3BpX3JlYWQgKHVjaGFyICphZGRyLCBpbnQgYWxlbiwgdWNoYXIgKmJ1ZmZlciwgaW50IGxlbikKK3sKKwlpbnQgaTsKKwl2b2xhdGlsZSBpbW1hcF90ICppbW1yOworCXZvbGF0aWxlIHFzbWNtNXh4X3QgKnFzbWNtOworCisJaW1tciA9IChpbW1hcF90ICopICBDT05GSUdfU1lTX0lNTVI7CisJcXNtY20gPSAocXNtY201eHhfdCAqKSZpbW1yLT5pbV9xc21jbTsKKworCWZvcihpPTA7aTwzMjtpKyspIHsKKwkJIHFzbWNtLT5xc21jbV9yZWNyYW1baV09MHgwMDAwOworCQkgcXNtY20tPnFzbWNtX3RyYW5yYW1baV09MHgwMDAwOworCQkgcXNtY20tPnFzbWNtX2NvbWRyYW1baV09MHgwMDsKKwl9CisJaT0wOworCXFzbWNtLT5xc21jbV90cmFucmFtW2krK10gPSAoU1BJX0VFUFJPTV9SRUFEKTsgLyogUkVBRCBtZW1vcnkgYXJyYXkgKi8KKwlxc21jbS0+cXNtY21fdHJhbnJhbVtpKytdID0gYWRkclswXSAmIDB4ZmY7CisJcXNtY20tPnFzbWNtX3RyYW5yYW1baSsrXSA9IGFkZHJbMV0gJiAweGZmOworCXNwaV94ZmVyKDMgKyBsZW4pOworCWZvcihpPTA7aTxsZW47aSsrKSB7CisJCSpidWZmZXIrKz0oY2hhcilxc21jbS0+cXNtY21fcmVjcmFtW2krM107CisJfQorCXJldHVybiBsZW47Cit9CisKK3NzaXplX3Qgc3BpX3JlYWQgKHVjaGFyICphZGRyLCBpbnQgYWxlbiwgdWNoYXIgKmJ1ZmZlciwgaW50IGxlbikKK3sKKwlpbnQgaW5kZXgsaSxuZXdsZW47CisJdWNoYXIgbmV3YWRkclsyXTsKKwlpbnQgY3VycmFkZHI7CisKKwljdXJyYWRkcj0oYWRkclthbGVuLTJdPDw4KSthZGRyW2FsZW4tMV07CisJaT1sZW47CisJaW5kZXg9MDsKKwlkbyB7CisJCW5ld2FkZHJbMV09KGN1cnJhZGRyICYgMHhmZik7CisJCW5ld2FkZHJbMF09KChjdXJyYWRkcj4+OCkgJiAweGZmKTsKKwkJaWYoaT5UUkFOU0ZFUl9MRU4pIHsKKwkJCW5ld2xlbj1UUkFOU0ZFUl9MRU47CisJCQlpLT1UUkFOU0ZFUl9MRU47CisJCX0KKwkJZWxzZSB7CisJCQluZXdsZW49aTsKKwkJCWk9MDsKKwkJfQorCQlzaG9ydF9zcGlfcmVhZCAobmV3YWRkciwgMiwgJmJ1ZmZlcltpbmRleF0sIG5ld2xlbik7CisJCWluZGV4Kz1uZXdsZW47CisJCWN1cnJhZGRyKz1uZXdsZW47CisJfXdoaWxlKGkpOworCXJldHVybiAobGVuKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICBGdW5jdGlvbjogICAgc3BpX3hmZXIKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCitzc2l6ZV90IHNwaV94ZmVyIChzaXplX3QgY291bnQpCit7CisJdm9sYXRpbGUgaW1tYXBfdCAqaW1tcjsKKwl2b2xhdGlsZSBxc21jbTV4eF90ICpxc21jbTsKKwlpbnQgaTsKKwlpbnQgdG07CisJdXNob3J0IHN0YXR1czsKKwlpbW1yID0gKGltbWFwX3QgKikgIENPTkZJR19TWVNfSU1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vIHRleHQgc2VnbWVudDogKi8KKyAgLiA9ICsgU0laRU9GX0hFQURFUlM7CisgIC5pbnRlcnAgOiB7ICooLmludGVycCkgfQorICAuaGFzaCAgICAgICAgICA6IHsgKiguaGFzaCkJCX0KKyAgLmR5bnN5bSAgICAgICAgOiB7ICooLmR5bnN5bSkJCX0KKyAgLmR5bnN0ciAgICAgICAgOiB7ICooLmR5bnN0cikJCX0KKyAgLnJlbC50ZXh0ICAgICAgOiB7ICooLnJlbC50ZXh0KQkJfQorICAucmVsYS50ZXh0ICAgICA6IHsgKigucmVsYS50ZXh0KQl9CisgIC5yZWwuZGF0YSAgICAgIDogeyAqKC5yZWwuZGF0YSkJCX0KKyAgLnJlbGEuZGF0YSAgICAgOiB7ICooLnJlbGEuZGF0YSkJfQorICAucmVsLnJvZGF0YSAgICA6IHsgKigucmVsLnJvZGF0YSkJfQorICAucmVsYS5yb2RhdGEgICA6IHsgKigucmVsYS5yb2RhdGEpCX0KKyAgLnJlbC5nb3QgICAgICAgOiB7ICooLnJlbC5nb3QpCQl9CisgIC5yZWxhLmdvdCAgICAgIDogeyAqKC5yZWxhLmdvdCkJCX0KKyAgLnJlbC5jdG9ycyAgICAgOiB7ICooLnJlbC5jdG9ycykJfQorICAucmVsYS5jdG9ycyAgICA6IHsgKigucmVsYS5jdG9ycykJfQorICAucmVsLmR0b3JzICAgICA6IHsgKigucmVsLmR0b3JzKQl9CisgIC5yZWxhLmR0b3JzICAgIDogeyAqKC5yZWxhLmR0b3JzKQl9CisgIC5yZWwuYnNzICAgICAgIDogeyAqKC5yZWwuYnNzKQkJfQorICAucmVsYS5ic3MgICAgICA6IHsgKigucmVsYS5ic3MpCQl9CisgIC5yZWwucGx0ICAgICAgIDogeyAqKC5yZWwucGx0KQkJfQorICAucmVsYS5wbHQgICAgICA6IHsgKigucmVsYS5wbHQpCQl9CisgIC5pbml0ICAgICAgICAgIDogeyAqKC5pbml0KQl9CisgIC5wbHQgOiB7ICooLnBsdCkgfQorICAudGV4dCAgICAgIDoKKyAgeworICAgIC8qIFdBUk5JTkcgLSB0aGUgZm9sbG93aW5nIGlzIGhhbmQtb3B0aW1pemVkIHRvIGZpdCB3aXRoaW4JKi8KKyAgICAvKiB0aGUgc2VjdG9yIGxheW91dCBvZiBvdXIgZmxhc2ggY2hpcHMhCVhYWCBGSVhNRSBYWFgJKi8KKworICAgIGFyY2gvcHBjL2NwdS9tcGM1eHgvc3RhcnQubwkoLnRleHQpCisKKyAgICAqKC50ZXh0KQorICAgICooLmdvdDEpCisgIH0KKyAgX2V0ZXh0ID0gLjsKKyAgUFJPVklERSAoZXRleHQgPSAuKTsKKyAgLnJvZGF0YSAgICA6CisgIHsKKyAgICAqKC5laF9mcmFtZSkKKyAgICAqKFNPUlRfQllfQUxJR05NRU5UKFNPUlRfQllfTkFNRSgucm9kYXRhKikpKQorICB9CisgIC5maW5pICAgICAgOiB7ICooLmZpbmkpICAgIH0gPTAKKyAgLmN0b3JzICAgICA6IHsgKiguY3RvcnMpICAgfQorICAuZHRvcnMgICAgIDogeyAqKC5kdG9ycykgICB9CisKKyAgLyogUmVhZC13cml0ZSBzZWN0aW9uLCBtZXJnZWQgaW50byBkYXRhIHNlZ21lbnQ6ICovCisgIC4gPSAoLiArIDB4MDBGRikgJiAweEZGRkZGRjAwOworICBfZXJvdGV4dCA9IC47CisgIFBST1ZJREUgKGVyb3RleHQgPSAuKTsKKyAgLnJlbG9jICAgOgorICB7CisgICAgKiguZ290KQorICAgIF9HT1QyX1RBQkxFXyA9IC47CisgICAgKiguZ290MikKKyAgICBfRklYVVBfVEFCTEVfID0gLjsKKyAgICAqKC5maXh1cCkKKyAgfQorICBfX2dvdDJfZW50cmllcyA9IChfRklYVVBfVEFCTEVfIC0gX0dPVDJfVEFCTEVfKSA+PjI7CisgIF9fZml4dXBfZW50cmllcyA9ICguIC0gX0ZJWFVQX1RBQkxFXyk+PjI7CisKKyAgLmRhdGEgICAgOgorICB7CisgICAgKiguZGF0YSkKKyAgICAqKC5kYXRhMSkKKyAgICAqKC5zZGF0YSkKKyAgICAqKC5zZGF0YTIpCisgICAgKiguZHluYW1pYykKKyAgICBDT05TVFJVQ1RPUlMKKyAgfQorICBfZWRhdGEgID0gIC47CisgIFBST1ZJREUgKGVkYXRhID0gLik7CisKKyAgLiA9IC47CisgIF9fdV9ib290X2NtZF9zdGFydCA9IC47CisgIC51X2Jvb3RfY21kIDogeyAqKC51X2Jvb3RfY21kKSB9CisgIF9fdV9ib290X2NtZF9lbmQgPSAuOworCisKKyAgLiA9IC47CisgIF9fc3RhcnRfX19leF90YWJsZSA9IC47CisgIF9fZXhfdGFibGUgOiB7ICooX19leF90YWJsZSkgfQorICBfX3N0b3BfX19leF90YWJsZSA9IC47CisKKyAgLiA9IEFMSUdOKDI1Nik7CisgIF9faW5pdF9iZWdpbiA9IC47CisgIC50ZXh0LmluaXQgOiB7ICooLnRleHQuaW5pdCkgfQorICAuZGF0YS5pbml0IDogeyAqKC5kYXRhLmluaXQpIH0KKyAgLiA9IEFMSUdOKDI1Nik7CisgIF9faW5pdF9lbmQgPSAuOworCisgIF9fYnNzX3N0YXJ0ID0gLjsKKyAgLmJzcyAoTk9MT0FEKSAgICAgICA6CisgIHsKKyAgICooLnNic3MpICooLnNjb21tb24pCisgICAqKC5keW5ic3MpCisgICAqKC5ic3MpCisgICAqKENPTU1PTikKKyAgIC4gPSBBTElHTig0KTsKKyAgfQorCisgIF9lbmQgPSAuIDsKKyAgUFJPVklERSAoZW5kID0gLik7CisvKiAgIC4gPSBlbnZfc3RhcnQ7CisJLnBwY2Vudgk6CisJeworCQljb21tb24vZW52X2VtYmVkZGVkLm8gKC5wcGNlbnYpCisJfQorKi8KK30KZGlmZiAtLWdpdCBhL2FyY2gvcHBjL2NwdS9tcGM1eHh4L01ha2VmaWxlIGIvYXJjaC9wcGMvY3B1L21wYzV4eHgvTWFrZWZpbGUKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMGVlMDYxMQotLS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bmNbNl0gKi8KKy5sb25nICAgMHgwMDAwMDAwMAkvKiBpbmNbN10gKi8KKworLmFsaWduICA4CisKKy5nbG9ibCBzY0V0aGVybmV0WG1pdF9WYXJUYWIKK3NjRXRoZXJuZXRYbWl0X1ZhclRhYjoJLyogVGFzayAxIFZhcmlhYmxlIFRhYmxlICovCisubG9uZyAgIDB4MDAwMDAwMDAJLyogdmFyWzBdICovCisubG9uZyAgIDB4MDAwMDAwMDAJLyogdmFyWzFdICovCisubG9uZyAgIDB4MDAwMDAwMDAJLyogdmFyWzJdICovCisubG9uZyAgIDB4MDAwMDAwMDAJLyogdmFyWzNdICovCisubG9uZyAgIDB4MDAwMDAwMDAJLyogdmFyWzRdICovCisubG9uZyAgIDB4MDAwMDAwMDAJLyogdmFyWzVdICovCisubG9uZyAgIDB4MDAwMDAwMDAJLyogdmFyWzZdICovCisubG9uZyAgIDB4MDAwMDAwMDAJLyogdmFyWzddICovCisubG9uZyAgIDB4MDAwMDAwMDAJLyogdmFyWzhdICovCisubG9uZyAgIDB4MDAwMDAwMDAJLyogdmFyWzldICovCisubG9uZyAgIDB4MDAwMDAwMDAJLyogdmFyWzEwXSAqLworLmxvbmcgICAoQ09ORklHX1NZU19NQkFSICsgMHg4ODAwKQkvKiB2YXJbMTFdICovCisubG9uZyAgIDB4MDAwMDAwMDAJLyogdmFyWzEyXSAqLworLmxvbmcgICAweDgwMDAwMDAwCS8qIHZhclsxM10gKi8KKy5sb25nICAgMHgxMDAwMDAwMAkvKiB2YXJbMTRdICovCisubG9uZyAgIDB4MDgwMDAwMDAJLyogdmFyWzE1XSAqLworLmxvbmcgICAweDIwMDAwMDAwCS8qIHZhclsxNl0gKi8KKy5sb25nICAgMHgwMDAwZmZmZgkvKiB2YXJbMTddICovCisubG9uZyAgIDB4ZmZmZmZmZmYJLyogdmFyWzE4XSAqLworLmxvbmcgICAweDAwMDAwMDA4CS8qIHZhclsxOV0gKi8KKy5sb25nICAgMHgwMDAwMDAwMAkvKiB2YXJ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CisJCX0KKworCX0KKworCXJldHVybiAhKHdyY291bnQgPT0gbGVuKTsKK30KKworc3RhdGljIGludCByZWNlaXZlX2J5dGVzKHVjaGFyIGNoaXAsIGNoYXIgKmJ1ZiwgaW50IGxlbikKK3sKKwlzdHJ1Y3QgbXBjNXh4eF9pMmMgKnJlZ3MgICAgPSAoc3RydWN0IG1wYzV4eHhfaTJjICopSTJDX0JBU0U7CisJaW50ICAgICAgICAgICAgICAgICBkdW1teSAgID0gMTsKKwlpbnQgICAgICAgICAgICAgICAgIHJkY291bnQgPSAwOworCWludCAgICAgICAgICAgICAgICAgc3RhdHVzOworCWludCAgICAgICAgICAgICAgICAgaTsKKworCW1wY19yZWdfb3V0KCZyZWdzLT5tY3IsIDAsIEkyQ19UWCk7CisKKwlmb3IgKGkgPSAwOyBpIDwgbGVuOyArK2kpIHsKKwkJYnVmW3JkY291bnRdID0gbXBjX3JlZ19pbigmcmVncy0+bWRyKTsKKworCQlpZiAoZHVtbXkpIHsKKwkJCWR1bW15ID0gMDsKKwkJfSBlbHNlIHsKKwkJCXJkY291bnQrKzsKKwkJfQorCisKKwkJaWYgKHdhaXRfZm9yX3Bpbigmc3RhdHVzKSkgeworCQkJcmV0dXJuIC00OworCQl9CisJfQorCisJbXBjX3JlZ19vdXQoJnJlZ3MtPm1jciwgSTJDX1RYQUssIEkyQ19UWEFLKTsKKwlidWZbcmRjb3VudCsrXSA9IG1wY19yZWdfaW4oJnJlZ3MtPm1kcik7CisKKwlpZiAod2FpdF9mb3JfcGluKCZzdGF0dXMpKSB7CisJCXJldHVybiAtNTsKKwl9CisKKwltcGNfcmVnX291dCgmcmVncy0+bWNyLCAwLCBJMkNfVFhBSyk7CisKKwlyZXR1cm4gMDsKK30KKworI2lmIGRlZmluZWQoQ09ORklHX1NZU19JMkNfSU5JVF9NUEM1WFhYKQorCisjZGVmaW5lIEZEUjUxMCh4KSAodTgpICgoKHggJiAweDIwKSA+PiAzKSB8ICh4ICYgMHgzKSkKKyNkZWZp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YWF9NQUlOX0lSUV9CQVNFOworCX0gZWxzZSBpZiAoc3RhdHVzICYgMHgyMDAwMDAwMCkgewkvKiBwZXJpcGhlcmFsICovCisJICAgICAgcGVyaXBoZXJhbDoKKwkJaXJxID0gKHN0YXR1cyA+PiAyNCkgJiAweDFmOworCQlpZiAoaXJxID09IDApIHsJLyogYmVzdGNvbW0gKi8KKwkJCXN0YXR1cyA9IGluX2JlMzIoJnNkbWEtPkludFBlbmQpOworCQkJaXJxID0gZmZzKHN0YXR1cykgKyBNUEM1WFhYX1NETUFfSVJRX0JBU0UgLSAxOworCQl9IGVsc2UKKwkJCWlycSArPSBNUEM1WFhYX1BFUlBfSVJRX0JBU0U7CisJfQorCisJcmV0dXJuIGlycTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK2ludCBpbnRlcnJ1cHRfaW5pdF9jcHUodWxvbmcgKiBkZWNyZW1lbnRlcl9jb3VudCkKK3sKKwkqZGVjcmVtZW50ZXJfY291bnQgPSBnZXRfdGJjbGsoKSAvIENPTkZJR19TWVNfSFo7CisKKwltcGM1eHh4X2luaXRfaXJxKCk7CisKKwlyZXR1cm4gKDApOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyoKKyAqIEhhbmRsZSBleHRlcm5hbCBpbnRlcnJ1cHRzCisgKi8KK3ZvaWQgZXh0ZXJuYWxfaW50ZXJydXB0KHN0cnVjdCBwdF9yZWdzICpyZWdzKQoreworCWludCBpcnEsIHVubWFzayA9IDE7CisKKwlpcnEgPSBtcGM1eHh4X2dldF9pcnEocmVncyk7CisKKwltcGM1eHh4X2ljX2Rpc2FibGVfYW5kX2FjayhpcnEpOworCisJZW5hYmxlX2ludGVycnVwdHMoKTsKKworCWlmIChpcnFfaGFuZGxlcnNbaXJxXS5oYW5kbGVyICE9IE5VTEwpCisJCSgqaXJxX2hhbmRsZXJzW2lycV0uaGFuZGxlcikgKGlycV9oYW5kbGVyc1tpcnFdLmFyZyk7CisJZWxzZSB7CisJCXByaW50ZigiXG5Cb2d1cyBFeHRlcm5hbCBJbnRlcnJ1cHQgSVJRICVkXG4iLCBpcnEpOworCQkvKgorCQkgKiB0dXJuIG9mZiB0aGUgYm9ndXMgaW50ZXJydXB0LCBvdGhlcndpc2UgaXQKKwkJICogbWlnaHQgcmVwZWF0IGZvcmV2ZXIKKwkJICovCisJCXVubWFzayA9IDA7CisJfQorCisJaWYgKHVubWFzaykKKwkJbXBjNXh4eF9pY19lbmQoaXJxKTsKK30KKwordm9pZCB0aW1lcl9pbnRlcnJ1cHRfY3B1KHN0cnVjdCBwdF9yZWdzICpyZWdzKQoreworCS8qIG5vdGhpbmcgdG8gZG8gaGVyZSAqLworCXJldHVybjsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qCisgKiBJbnN0YWxsIGFuZCBmcmVlIGEgaW50ZXJydXB0IGhhbmRsZXIuCisgKi8KKwordm9pZCBpcnFfaW5zdGFsbF9oYW5kbGVyKGludCBpcnEsIGludGVycnVwdF9oYW5kbGVyX3QgKiBoYW5kbGVyLCB2b2lkICphcmcpCit7CisJaWYgKGlycSA8IDAgfHwgaXJxID49IE5SX0lSUVMpIHsKKwkJcHJpbnRmKCJpcnFfaW5zdGFsbF9oYW5kbGVyOiBiYWQgaXJxIG51bWJlciAlZFxuIiwgaXJxKTsKKwkJcmV0dXJuOworCX0KKworCWlmIChpcnFfaGFuZGxlcnNbaXJxXS5oYW5kbGVyICE9IE5VTEwpCisJCXByaW50ZigiaXJxX2luc3RhbGxfaGFuZGxlcjogMHglMDhseCByZXBsYWNpbmcgMHglMDhseFxuIiwKKwkJICAgICAgICh1bG9uZykgaGFuZGxlciwgKHVsb25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jdGlvbnMsIG1lcmdlZCBpbnRvIHRleHQgc2VnbWVudDogKi8KKyAgLiA9ICsgU0laRU9GX0hFQURFUlM7CisgIC5pbnRlcnAgOiB7ICooLmludGVycCkgfQorICAuaGFzaCAgICAgICAgICA6IHsgKiguaGFzaCkJCX0KKyAgLmR5bnN5bSAgICAgICAgOiB7ICooLmR5bnN5bSkJCX0KKyAgLmR5bnN0ciAgICAgICAgOiB7ICooLmR5bnN0cikJCX0KKyAgLnJlbC50ZXh0ICAgICAgOiB7ICooLnJlbC50ZXh0KQkJfQorICAucmVsYS50ZXh0ICAgICA6IHsgKigucmVsYS50ZXh0KQl9CisgIC5yZWwuZGF0YSAgICAgIDogeyAqKC5yZWwuZGF0YSkJCX0KKyAgLnJlbGEuZGF0YSAgICAgOiB7ICooLnJlbGEuZGF0YSkJfQorICAucmVsLnJvZGF0YSAgICA6IHsgKigucmVsLnJvZGF0YSkJfQorICAucmVsYS5yb2RhdGEgICA6IHsgKigucmVsYS5yb2RhdGEpCX0KKyAgLnJlbC5nb3QgICAgICAgOiB7ICooLnJlbC5nb3QpCQl9CisgIC5yZWxhLmdvdCAgICAgIDogeyAqKC5yZWxhLmdvdCkJCX0KKyAgLnJlbC5jdG9ycyAgICAgOiB7ICooLnJlbC5jdG9ycykJfQorICAucmVsYS5jdG9ycyAgICA6IHsgKigucmVsYS5jdG9ycykJfQorICAucmVsLmR0b3JzICAgICA6IHsgKigucmVsLmR0b3JzKQl9CisgIC5yZWxhLmR0b3JzICAgIDogeyAqKC5yZWxhLmR0b3JzKQl9CisgIC5yZWwuYnNzICAgICAgIDogeyAqKC5yZWwuYnNzKQkJfQorICAucmVsYS5ic3MgICAgICA6IHsgKigucmVsYS5ic3MpCQl9CisgIC5yZWwucGx0ICAgICAgIDogeyAqKC5yZWwucGx0KQkJfQorICAucmVsYS5wbHQgICAgICA6IHsgKigucmVsYS5wbHQpCQl9CisgIC5pbml0ICAgICAgICAgIDogeyAqKC5pbml0KQl9CisgIC5wbHQgOiB7ICooLnBsdCkgfQorICAudGV4dCAgICAgIDoKKyAgeworICAgIC8qIFdBUk5JTkcgLSB0aGUgZm9sbG93aW5nIGlzIGhhbmQtb3B0aW1pemVkIHRvIGZpdCB3aXRoaW4gICovCisgICAgLyogdGhlIHNlY3RvciBsYXlvdXQgb2Ygb3VyIGZsYXNoIGNoaXBzISAgICBYWFggRklYTUUgWFhYICAgKi8KKworICAgIGFyY2gvcHBjL2NwdS9tcGM1eHh4L3N0YXJ0Lm8gICAgICAgICAgKC50ZXh0KQorICAgIGFyY2gvcHBjL2NwdS9tcGM1eHh4L3RyYXBzLm8gICAgICAgICAgKC50ZXh0KQorICAgIGxpYi9jcmMzMi5vICAgICAgICAgKC50ZXh0KQorICAgIGFyY2gvcHBjL2xpYi9jYWNoZS5vICAgICAgICAgICAgICgudGV4dCkKKyAgICBhcmNoL3BwYy9saWIvdGltZS5vICAgICAgICAgICAgICAoLnRleHQpCisKKyAgICAuID0gREVGSU5FRChlbnZfb2Zmc2V0KSA/IGVudl9vZmZzZXQgOiAuOworICAgIGNvbW1vbi9lbnZfZW1iZWRkZWQubyAgICAgICAgKC5wcGNlbnYpCisKKyAgICAqKC50ZXh0KQorICAgICooLmdvdDEpCisgICAgLiA9IEFMSUdOKDE2KTsKKyAgICAqKC5laF9mcmFtZSkKKyAgICAqKFNPUlRfQllfQUxJR05NRU5UKFNPUlRfQllfTkFNRSgucm9kYXRhKikpKQorICB9CisgIC5maW5pICAgICAgOiB7ICooLmZpbmkpICAgIH0gPTAKKyAgLmN0b3JzICAgICA6IHsgKiguY3RvcnMpICAgfQorICAuZHRvcnMgICAgIDogeyAqKC5kdG9ycykgICB9CisKKyAgLyogUmVhZC13cml0ZSBzZWN0aW9uLCBtZXJnZWQgaW50byBkYXRhIHNlZ21lbnQ6ICovCisgIC4gPSAoLiArIDB4MEZGRikgJiAweEZGRkZGMDAwOworICBfZXJvdGV4dCA9IC47CisgIFBST1ZJREUgKGVyb3RleHQgPSAuKTsKKyAgLnJlbG9jICAgOgorICB7CisgICAgKiguZ290KQorICAgIF9HT1QyX1RBQkxFXyA9IC47CisgICAgKiguZ290MikKKyAgICBfRklYVVBfVEFCTEVfID0gLjsKKyAgICAqKC5maXh1cCkKKyAgfQorICBfX2dvdDJfZW50cmllcyA9IChfRklYVVBfVEFCTEVfIC0gX0dPVDJfVEFCTEVfKSA+PiAyOworICBfX2ZpeHVwX2VudHJpZXMgPSAoLiAtIF9GSVhVUF9UQUJMRV8pID4+IDI7CisKKyAgLmRhdGEgICAgOgorICB7CisgICAgKiguZGF0YSkKKyAgICAqKC5kYXRhMSkKKyAgICAqKC5zZGF0YSkKKyAgICAqKC5zZGF0YTIpCisgICAgKiguZHluYW1pYykKKyAgICBDT05TVFJVQ1RPUlMKKyAgfQorICBfZWRhdGEgID0gIC47CisgIFBST1ZJREUgKGVkYXRhID0gLik7CisKKyAgLiA9IC47CisgIF9fdV9ib290X2NtZF9zdGFydCA9IC47CisgIC51X2Jvb3RfY21kIDogeyAqKC51X2Jvb3RfY21kKSB9CisgIF9fdV9ib290X2NtZF9lbmQgPSAuOworCisKKyAgLiA9IC47CisgIF9fc3RhcnRfX19leF90YWJsZSA9IC47CisgIF9fZXhfdGFibGUgOiB7ICooX19leF90YWJsZSkgfQorICBfX3N0b3BfX19leF90YWJsZSA9IC47CisKKyAgLiA9IEFMSUdOKDQwOTYpOworICBfX2luaXRfYmVnaW4gPSAuOworICAudGV4dC5pbml0IDogeyAqKC50ZXh0LmluaXQpIH0KKyAgLmRhdGEuaW5pdCA6IHsgKiguZGF0YS5pbml0KSB9CisgIC4gPSBBTElHTig0MDk2KTsKKyAgX19pbml0X2VuZCA9IC47CisKKyAgX19ic3Nfc3RhcnQgPSAuOworICAuYnNzIChOT0xPQUQpICAgICAgIDoKKyAgeworICAgKiguc2JzcykgKiguc2NvbW1vbikKKyAgICooLmR5bmJzcykKKyAgICooLmJzcykKKyAgICooQ09NTU9OKQorICAgLiA9IEFMSUdOKDQpOworICB9Cisg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vyb3RleHQgPSAuOworICBQUk9WSURFIChlcm90ZXh0ID0gLik7CisgIC5yZWxvYyAgIDoKKyAgeworICAgICooLmdvdCkKKyAgICBfR09UMl9UQUJMRV8gPSAuOworICAgICooLmdvdDIpCisgICAgX0ZJWFVQX1RBQkxFXyA9IC47CisgICAgKiguZml4dXApCisgIH0KKyAgX19nb3QyX2VudHJpZXMgPSAoX0ZJWFVQX1RBQkxFXyAtIF9HT1QyX1RBQkxFXykgPj4gMjsKKyAgX19maXh1cF9lbnRyaWVzID0gKC4gLSBfRklYVVBfVEFCTEVfKSA+PiAyOworCisgIC5kYXRhICAgIDoKKyAgeworICAgICooLmRhdGEpCisgICAgKiguZGF0YTEpCisgICAgKiguc2RhdGEpCisgICAgKiguc2RhdGEyKQorICAgICooLmR5bmFtaWMpCisgICAgQ09OU1RSVUNUT1JTCisgIH0KKyAgX2VkYXRhICA9ICAuOworICBQUk9WSURFIChlZGF0YSA9IC4pOworCisgIC4gPSAuOworICBfX3VfYm9vdF9jbWRfc3RhcnQgPSAuOworICAudV9ib290X2NtZCA6IHsgKigudV9ib290X2NtZCkgfQorICBfX3VfYm9vdF9jbWRfZW5kID0gLjsKKworCisgIC4gPSAuOworICBfX3N0YXJ0X19fZXhfdGFibGUgPSAuOworICBfX2V4X3RhYmxlIDogeyAqKF9fZXhfdGFibGUpIH0KKyAgX19zdG9wX19fZXhfdGFibGUgPSAuOworCisgIC4gPSBBTElHTig0MDk2KTsKKyAgX19pbml0X2JlZ2luID0gLjsKKyAgLnRleHQuaW5pdCA6IHsgKigudGV4dC5pbml0KSB9CisgIC5kYXRhLmluaXQgOiB7ICooLmRhdGEuaW5pdCkgfQorICAuID0gQUxJR04oNDA5Nik7CisgIF9faW5pdF9lbmQgPSAuOworCisgIF9fYnNzX3N0YXJ0ID0gLjsKKyAgLmJzcyAoTk9MT0FEKSAgICAgICA6CisgIHsKKyAgICooLnNic3MpICooLnNjb21tb24pCisgICAqKC5keW5ic3MpCisgICAqKC5ic3M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yAyNTUgbXMgKi8KK307CisKK3N0YXRpYyB1bnNpZ25lZCBjaGFyIHJvb3RfaHViX3N0cl9pbmRleDBbXSA9Cit7CisJMHgwNCwJCQkvKiAgX191OCAgYkxlbmd0aDsgKi8KKwkweDAzLAkJCS8qICBfX3U4ICBiRGVzY3JpcHRvclR5cGU7IFN0cmluZy1kZXNjcmlwdG9yICovCisJMHgwOSwJCQkvKiAgX191OCAgbGFuZyBJRCAqLworCTB4MDQsCQkJLyogIF9fdTggIGxhbmcgSUQgKi8KK307CisKK3N0YXRpYyB1bnNpZ25lZCBjaGFyIHJvb3RfaHViX3N0cl9pbmRleDFbXSA9Cit7CisJMjgsCQkJLyogIF9fdTggIGJMZW5ndGg7ICovCisJMHgwMywJCQkvKiAgX191OCAgYkRlc2NyaXB0b3JUeXBlOyBTdHJpbmctZGVzY3JpcHRvciAqLworCSdPJywJCQkvKiAgX191OCAgVW5pY29kZSAqLworCTAsCQkJCS8qICBfX3U4ICBVbmljb2RlICovCisJJ0gnLAkJCS8qICBfX3U4ICBVbmljb2RlICovCisJMCwJCQkJLyogIF9fdTggIFVuaWNvZGUgKi8KKwknQycsCQkJLyogIF9fdTggIFVuaWNvZGUgKi8KKwkwLAkJCQkvKiAgX191OCAgVW5pY29kZSAqLworCSdJJywJCQkvKiAgX191OCAgVW5pY29kZSAqLworCTAsCQkJCS8qICBfX3U4ICBVbmljb2RlICovCisJJyAnLAkJCS8qICBfX3U4ICBVbmljb2RlICovCisJMCwJCQkJLyogIF9fdTggIFVuaWNvZGUgKi8KKwknUicsCQkJLyogIF9fdTggIFVuaWNvZGUgKi8KKwkwLAkJCQkvKiAgX191OCAgVW5pY29kZSAqLworCSdvJywJCQkvKiAgX191OCAgVW5pY29kZSAqLworCTAsCQkJCS8qICBfX3U4ICBVbmljb2RlICovCisJJ28nLAkJCS8qICBfX3U4ICBVbmljb2RlICovCisJMCwJCQkJLyogIF9fdTggIFVuaWNvZGUgKi8KKwkndCcsCQkJLyogIF9fdTggI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UxMRUQsCisJLyogRGV2Tm90UmVzcCAqLwkgICAgICAgLTEsCisJLyogUElEQ2hlY2sgICAqLwkgICAgICAgVVNCX1NUX0JJVF9FUlIsCisJLyogVW5FeHBQSUQgICAqLwkgICAgICAgVVNCX1NUX0JJVF9FUlIsCisJLyogRGF0YU92ZXIgICAqLwkgICAgICAgVVNCX1NUX0JVRl9FUlIsCisJLyogRGF0YVVuZGVyICAqLwkgICAgICAgVVNCX1NUX0JVRl9FUlIsCisJLyogcmVzZXJ2ZCAgICAqLwkgICAgICAgLTEsCisJLyogcmVzZXJ2ZCAgICAqLwkgICAgICAgLTEsCisJLyogQnVmZmVyT3ZlciAqLwkgICAgICAgVVNCX1NUX0JVRl9FUlIsCisJLyogQnVmZlVuZGVyICAqLwkgICAgICAgVVNCX1NUX0JVRl9FUlIsCisJLyogTm90IEFjY2VzcyAqLwkgICAgICAgLTEsCisJLyogTm90IEFjY2VzcyAqLwkgICAgICAgLTEKK307CisKKy8qIEVEIFN0YXRlcyAqLworCisjZGVmaW5lIEVEX05FVwkJMHgwMAorI2RlZmluZSBFRF9VTkxJTksJMHgwMQorI2RlZmluZSBFRF9PUEVSCQkweDAyCisjZGVmaW5lIEVEX0RFTAkJMHgwNAorI2RlZmluZSBFRF9VUkJfREVMCTB4MDgKKworLyogdXNiX29oY2lfZWQgKi8KK3N0cnVjdCBlZCB7CisJX191MzIgaHdJTkZPOworCV9fdTMyIGh3VGFpbFA7CisJX191MzIgaHdIZWFkUDsKKwlfX3UzMiBod05leHRFRDsKKworCXN0cnVjdCBlZCAqZWRfcHJldjsKKwlfX3U4IGludF9wZXJpb2Q7CisJX191OCBpbnRfYnJhbmNoOworCV9fdTggaW50X2xvYWQ7CisJX191OCBpbnRfaW50ZXJ2YWw7CisJX191OCBzdGF0ZTsKKwlfX3U4IHR5cGU7CisJX191MTYgbGFzdF9pc287CisJc3RydWN0IGVkICplZF9ybV9saXN0OworCisJc3RydWN0IHVzYl9kZXZpY2UgKnVzYl9kZX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jUmVnKTsKKwkJfQorCQlpKys7CisJCUxlbmd0aC0tOworCQlzcGREYXRhKys7CisJfQorCisJLyogU3RvcCB0aGUgc2VydmljZSAqLworCXNwZF9zdG9wIChwaTJjUmVnKTsKKworCXJldHVybiBPSzsKK30KKworaW50IGdldEJhbmtJbmZvIChpbnQgYmFuaywgZHJhbWluZm9fdCAqIHBCYW5rKQoreworCWludCBzdGF0dXM7CisJaW50IGNoZWNrc3VtOworCWludCBjb3VudDsKKwl1OCBzcGREYXRhW1NQRF9TSVpFXTsKKworCisJaWYgKGJhbmsgPiAyIHx8IHBCYW5rID09IDApIHsKKwkJLyogaWxsZWdhbCB2YWx1ZXMgKi8KKwkJcmV0dXJuICgtNDIpOworCX0KKworCXN0YXR1cyA9IHJlYWRTcGREYXRhICgmc3BkRGF0YVswXSk7CisJaWYgKHN0YXR1cyA8IDApCisJCXJldHVybiAoLTEpOworCisJLyogY2hlY2sgdGhlIGNoZWNrc3VtICovCisJZm9yIChjb3VudCA9IDAsIGNoZWNrc3VtID0gMDsgY291bnQgPCBMT0NfQ0hFQ0tTVU07IGNvdW50KyspCisJCWNoZWNrc3VtICs9IHNwZERhdGFbY291bnRdOworCisJY2hlY2tzdW0gPSBjaGVja3N1bSAtICgoY2hlY2tzdW0gLyAyNTYpICogMjU2KTsKKworCWlmIChjaGVja3N1bSAhPSBzcGREYXRhW0xPQ19DSEVDS1NVTV0pCisJCXJldHVybiAoLTIpOworCisJLyogR2V0IHRoZSBtZW1vcnkgdHlwZSAqLworCWlmICghCisJICAgICgoc3BkRGF0YVtMT0NfVFlQRV0gPT0gVFlQRV9ERFIpCisJICAgICB8fCAoc3BkRGF0YVtMT0NfVFlQRV0gPT0gVFlQRV9TRFIpKSkKKwkJLyogbm90IG9uZSBvZiB0aGUgdHlwZXMgd2Ugc3VwcG9ydCAqLworCQlyZXR1cm4gKC0zKTsKKworCXBCYW5rLT50eXBlID0gc3BkRGF0YVtMT0NfVFlQRV07CisKKwkvKiBTZXQgbG9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WZpbmUgTE9DX0NTICAgICAgICAgICAgICAgICAgICAgIDE5CisjZGVmaW5lIExPQ19XRSAgICAgICAgICAgICAgICAgICAgICAyMAorI2RlZmluZSBMT0NfVGN5YyAgICAgICAgICAgICAgICAgICAgOQorI2RlZmluZSBMT0NfVGFjICAgICAgICAgICAgICAgICAgICAgMTAKKyNkZWZpbmUgTE9DX1RycCAgICAgICAgICAgICAgICAgICAgIDI3CisjZGVmaW5lIExPQ19UcnJkICAgICAgICAgICAgICAgICAgICAyOAorI2RlZmluZSBMT0NfVHJjZCAgICAgICAgICAgICAgICAgICAgMjkKKyNkZWZpbmUgTE9DX1RyYXMgICAgICAgICAgICAgICAgICAgIDMwCisjZGVmaW5lIExPQ19CdWZmZXJlZCAgICAgICAgICAgICAgICAyMQorLyogVHlwZXMgb2YgbWVtb3J5IHRoZSBTUEQgY2FuIHRlbGwgdXMgYWJvdXQuCisgKiBXZSBjYW4gYWN0dWFsbHkgb25seSB1c2UgU0RSQU0gYW5kIEREUi4KKyAqLworI2RlZmluZSBUWVBFX0RSQU0gICAgICAgICAgICAgICAgICAgMQkvKiBwbGFpbiBvbGQgZHJhbSAqLworI2RlZmluZSBUWVBFX0VETyAgICAgICAgICAgICAgICAgICAgMgkvKiBFRE8gZHJhbSAqLworI2RlZmluZSBUWVBFX05pYmJsZSAgICAgICAgICAgICAgICAgMwkvKiBzZXJpYWwgbmliYmxlIG1lbW9yeSAqLworI2RlZmluZSBUWVBFX1NEUiAgICAgICAgICAgICAgICAgICAgNAkvKiBTRFJBTSAqLworI2RlZmluZSBUWVBFX1JPTSAgICAgICAgICAgICAgICAgICAgNQkvKiAgKi8KKyNkZWZpbmUgVFlQRV9TR1JSQU0gICAgICAgICAgICAgICAgIDYJLyogZ3JhcGhpY3MgbWVtb3J5ICovCisjZGVmaW5lIFRZUEVfRERSICAgICAgICAgICAgICAgICAgICA3CS8qIEREUiBzZHJhbSAqLworI2RlZmluZSBTRFJBTURTX01BU0sgICAgICAgIDB4Mwk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0+cmJkQmFzZVtpeF0uZGF0YUxlbmd0aCA9IDA7CisJfQorCW9uY2UrKzsKKworCS8qCisJICogaGF2ZSB0aGUgbGFzdCBSQkQgdG8gY2xvc2UgdGhlIHJpbmcKKwkgKi8KKwlmZWMtPnJiZEJhc2VbaXggLSAxXS5zdGF0dXMgfD0gRkVDX1JCRF9XUkFQOworCWZlYy0+cmJkSW5kZXggPSAwOworCisJcmV0dXJuIDA7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3N0YXRpYyB2b2lkIG1wYzgyMjBfZmVjX3RiZF9pbml0IChtcGM4MjIwX2ZlY19wcml2ICogZmVjKQoreworCWludCBpeDsKKworCWZvciAoaXggPSAwOyBpeCA8IEZFQ19UQkRfTlVNOyBpeCsrKSB7CisJCWZlYy0+dGJkQmFzZVtpeF0uc3RhdHVzID0gMDsKKwl9CisKKwkvKgorCSAqIEhhdmUgdGhlIGxhc3QgVEJEIHRvIGNsb3NlIHRoZSByaW5nCisJICovCisJZmVjLT50YmRCYXNlW2l4IC0gMV0uc3RhdHVzIHw9IEZFQ19UQkRfV1JBUDsKKworCS8qCisJICogSW5pdGlhbGl6ZSBzb21lIGluZGljZXMKKwkgKi8KKwlmZWMtPnRiZEluZGV4ID0gMDsKKwlmZWMtPnVzZWRUYmRJbmRleCA9IDA7CisJZmVjLT5jbGVhblRiZE51bSA9IEZFQ19UQkRfTlVNOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgdm9pZCBtcGM4MjIwX2ZlY19yYmRfY2xlYW4gKG1wYzgyMjBfZmVjX3ByaXYgKiBmZWMsIEZFQ19SQkQgKiBwUmJkKQoreworCS8qCisJICogUmVzZXQgYnVmZmVyIGRlc2NyaXB0b3IgYXMgZW1wdHkKKwkgKi8KKwlpZiAoKGZlYy0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IDB4MSwgJnBoeVN0YXR1cykgIT0KKwkJCQkgICAgMCkgeworI2lmZGVmIERFQlVHCisJCQkJCXByaW50ZiAoIlBIWSBhdXRvIG5lZyAxIGZhaWxlZCAweCUwNHguLi5cbiIsIHBoeVN0YXR1cyk7CisjZW5kaWYKKwkJCQkJcmV0dXJuIC0xOworCQkJCX0KKwkJCX0gd2hpbGUgKCEocGh5U3RhdHVzICYgMHgwMDA0KSk7CisKKyNpZmRlZiBERUJVRworCQkJcHJpbnRmICgiUEhZIGF1dG8gbmVnIGNvbXBsZXRlISBcbiIpOworI2VuZGlmCisJCX0KKworCX0KKworCS8qCisJICogRW5hYmxlIEZFQy1MaXRlIGNvbnRyb2xsZXIKKwkgKi8KKwlmZWMtPmV0aC0+ZWNudHJsIHw9IDB4MDAwMDAwMDY7CisKKyNpZmRlZiBERUJVRworCWlmIChmZWMtPnhjdl90eXBlICE9IFNFVkVOV0lSRSkKKwkJbXBjODIyMF9mZWNfcGh5ZHVtcCAoZGV2LT5uYW1lKTsKKyNlbmRpZgorCisJLyoKKwkgKiBFbmFibGUgU21hcnRETUEgcmVjZWl2ZSB0YXNrCisJICovCisJRE1BX1RBU0tfRU5BQkxFIChGRUNfUkVDVl9UQVNLX05PKTsKKworI2lmZGVmIERFQlVHCisJcHJpbnRmICgibXBjODIyMF9mZWNfaW5pdC4uLiBEb25lIFxuIik7CisjZW5kaWYKKworCXJldHVybiAxOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgdm9pZCBtcGM4MjIwX2ZlY19oYWx0IChzdHJ1Y3QgZXRoX2RldmljZSAqZGV2KQoreworCW1wYzgyMjBfZmVjX3ByaXYgKmZlYyA9IChtcGM4MjIwX2ZlY19wcml2ICopIGRldi0+cHJpdjsKKwlpbnQgY291bnRlciA9IDB4ZmZmZjsKKworI2lmZGVmIERFQlVHCisJaWYgKGZlYy0+eGN2X3R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0PTAgV1M9MCBSUz0wICovCisubG9uZyAgIDB4MDgwY2YwNGQJLyogMDBEQygzODkpOiAgICAgIERSRDJCMTogaWR4MCA9IEVVMygpOyBFVTModmFyMSx2YXIxMykgICovCisubG9uZyAgIDB4MDAwMDAxZjgJLyogMDBFMCg6MCk6ICAgIE5PUCAqLworCisuYWxpZ24gOAorCisuZ2xvYmwgc2NFdGhlcm5ldFJlY3ZfVmFyVGFiCitzY0V0aGVybmV0UmVjdl9WYXJUYWI6CS8qIFRhc2sgMCBWYXJpYWJsZSBUYWJsZSAqLworLmxvbmcgICAweDAwMDAwMDAwCS8qIHZhclswXSAqLworLmxvbmcgICAweDAwMDAwMDAwCS8qIHZhclsxXSAqLworLmxvbmcgICAweDAwMDAwMDAwCS8qIHZhclsyXSAqLworLmxvbmcgICAweDAwMDAwMDAwCS8qIHZhclszXSAqLworLmxvbmcgICAweDAwMDAwMDAwCS8qIHZhcls0XSAqLworLmxvbmcgICAweDAwMDAwMDAwCS8qIHZhcls1XSAqLworLmxvbmcgICAweDAwMDAwMDAwCS8qIHZhcls2XSAqLworLmxvbmcgICAweDAwMDAwMDAwCS8qIHZhcls3XSAqLworLmxvbmcgICAweDAwMDAwMDAwCS8qIHZhcls4XSAqLworLmxvbmcgICAweGYwMDI1YjAwCS8qIHZhcls5XSAqLworLmxvbmcgICAweDAwMDAwMDA4CS8qIHZhclsxMF0gKi8KKy5sb25nICAgMHgwMDAwMDAwYwkvKiB2YXJbMTFdICovCisubG9uZyAgIDB4ODAwMDAwMDAJLyogdmFyWzEyXSAqLworLmxvbmcgICAweDAwMDAwMDAwCS8qIHZhclsxM10gKi8KKy5sb25nICAgMHgxMDAwMDAwMAkvKiB2YXJbMTRdICovCisubG9uZyAgIDB4MjAwMDAwMDAJLyogdmFyWzE1XSAqLworLmxvbmcgICAweDAwMDAwODAwCS8qIHZhclsxNl0gKi8KKy5sb25nICAgMHgwMDAwMDAwMQkvKiB2YXJbMTddICovCisubG9uZyAgIDB4MDAwMDAwMDAJLyogdmFyWzE4XSAqLworLmxvbmcgICAweDAwMDAwMDAwCS8qIHZhclsxOV0gKi8KKy5sb25nICAgMHgwMDAwMDAwMAkvKiB2YXJbMjBdICovCisubG9uZyAgIDB4MDAwMDAwMDAJLyogdmFyWzIxXSAqLworLmxvbmcgICAweDAwMDAwMDAwCS8qIHZhclsyMl0gKi8KKy5sb25nICAgMHgwMDAwMDAwMAkvKiB2YXJbMjNdICovCisubG9uZyAgIDB4MDAwMDAwMDAJLyogaW5jWzBdICovCisubG9uZyAgIDB4NjAwMDAwMDAJLyogaW5jWzFdICovCisubG9uZyAgIDB4MjAwMDAwMDQJLyogaW5jWzJdICovCisubG9uZyAgIDB4MjAwMDAwMDEJLyogaW5jWzNdICovCisubG9uZyAgIDB4ODAwMDAwMDAJLyogaW5jWzRdICovCisubG9uZyAgIDB4NDAwMDAwMDAJLyogaW5jWzVdICovCisubG9uZyAgIDB4MDAwMDAwMDAJLyogaW5jWzZdICovCisubG9uZyAgIDB4MDAwMDAwMDAJLyogaW5jWzddICovCisKKy5hbGlnbiAgOAorCisuZ2xvYmwgc2NFdGhlcm5ldFhtaXRfVmFyVGFiCitzY0V0aGVybmV0WG1pdF9WYXJUYWI6CS8qIFRhc2sgMSBWYXJpYWJsZSBUYWJsZSAqLworLmxvbmcgICAweDAwMDAwMDAwCS8qIHZhclswXSAqLworLmxvbmcgICAweDAwMDAwMDAwCS8qIHZhclsxXSAqLworLmxvbmcgICAweDAwMDAwMDAwCS8qIHZhclsyXSAqLworLmxvbmcgICAweDAwMDAwMDAwCS8qIHZhclszXSAqLworLmxvbmcgICAweDAwMDAwMDAwCS8qIHZhcls0XSAqLworLmxvbmcgICAweDAwMDAwMDAwCS8qIHZhcls1XSAqLworLmxvbmcgICAweDAwMDAwMDAwCS8qIHZhcls2XSAqLworLmxvbmcgICAweDAwMDAwMDAwCS8qIHZhcls3XSAqLworLmxvbmcgICAweDAwMDAwMDAwCS8qIHZhcls4XSAqLworLmxvbmcgIC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ikKK3sKKwlpMmNfdCAqcmVncyA9IChpMmNfdCAqKSBNTUFQX0kyQzsKKwlpbnQgZHVtbXkgPSAxOworCWludCByZGNvdW50ID0gMDsKKwlpbnQgc3RhdHVzOworCWludCBpOworCisJbXBjX3JlZ19vdXQgKCZyZWdzLT5jciwgMCwgSTJDX1RYKTsKKworCWZvciAoaSA9IDA7IGkgPCBsZW47ICsraSkgeworCQlidWZbcmRjb3VudF0gPSBtcGNfcmVnX2luICgmcmVncy0+ZHIpOworCisJCWlmIChkdW1teSkKKwkJCWR1bW15ID0gMDsKKwkJZWxzZQorCQkJcmRjb3VudCsrOworCisJCWlmICh3YWl0X2Zvcl9waW4gKCZzdGF0dXMpKQorCQkJcmV0dXJuIC00OworCX0KKworCW1wY19yZWdfb3V0ICgmcmVncy0+Y3IsIEkyQ19UWEFLLCBJMkNfVFhBSyk7CisJYnVmW3JkY291bnQrK10gPSBtcGNfcmVnX2luICgmcmVncy0+ZHIpOworCisJaWYgKHdhaXRfZm9yX3BpbiAoJnN0YXR1cykpCisJCXJldHVybiAtNTsKKworCW1wY19yZWdfb3V0ICgmcmVncy0+Y3IsIDAsIEkyQ19UWEFLKTsKKwlyZXR1cm4gMDsKK30KKworLyoqKioqKioqKioqKioqKiogSTJDIEFQSSAqKioqKioqKioqKioqKioqLworCit2b2lkIGkyY19pbml0IChpbnQgc3BlZWQsIGludCBzYWRkcikKK3sKKwlpMmNfdCAqcmVncyA9IChpMmNfdCAqKSBNTUFQX0kyQzsKKworCW1wY19yZWdfb3V0ICgmcmVncy0+Y3IsIDAsIDApOworCW1wY19yZWdfb3V0ICgmcmVncy0+YWRyLCBzYWRkciA8PCAxLCAwKTsKKworCS8qIFNldCBjbG9jaworCSAqLworCW1wY19yZWdfb3V0ICgmcmVncy0+ZmRyLCBtcGNfZ2V0X2ZkciAoc3BlZWQpLCAwKTsKKworCS8qIEVuYWJsZSBtb2R1bGUKKwkgKi8KKwltcGNfcmVnX291dCAoJnJlZ3MtPmNyLCBJ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U1RBKQorCQkJcGkyYy0+Y3IgJj0gfkkyQ19DVExfU1RBOworCisJCS8qIENoZWNrIGFnYWluIGlmIGl0IGlzIHN0aWxsIGJ1c3ksIHJldHVybiBlcnJvciBpZiBmb3VuZCAqLworCQlpZiAoY2hrX3N0YXR1cyAocGkyYywgSTJDX1NUQV9CQiwgMSkgPT0gT0spCisJCQlyZXR1cm4gRVJST1I7CisJfQorCisJcmV0dXJuIChPSyk7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBJMkMgRGlzYWJsZSAtIERpc2FibGUgdGhlIEkyQyBDb250cm9sbGVyCisgKgorICovCitTVEFUVVMgaTJjX2Rpc2FibGUgKFBTSTJDIHBpMmMpCit7CisJaTJjX2NsZWFyIChwaTJjKTsKKworCXBpMmMtPmNyICY9IEkyQ19DVExfRU47IC8qIERpc2FibGUgSTJjCQkJKi8KKworCWlmICgocGkyYy0+Y3IgJiBJMkNfQ1RMX1NUQSkgPT0gSTJDX0NUTF9TVEEpCisJCXBpMmMtPmNyICY9IH5JMkNfQ1RMX1NUQTsKKworCWlmIChjaGtfc3RhdHVzIChwaTJjLCBJMkNfU1RBX0JCLCAwKSAhPSBPSykKKwkJcmV0dXJuIEVSUk9SOworCisJcmV0dXJuIChPSyk7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBJMkMgQ2xlYXIgLSBDbGVhciB0aGUgSTJDIENvbnRyb2xsZXIKKyAqCisgKi8KK1NUQVRVUyBpMmNfY2xlYXIgKFBTSTJDIHBpMmMpCit7CisJcGkyYy0+YWRyID0gMDsKKwlwaTJjLT5mZHIgPSAwOworCXBpMmMtPmNyID0gMDsKKwlwaTJjLT5zciA9IDA7CisKKwlyZXR1cm4gKE9LKTsKK30KK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X3JlZ3MgKnJlZ3MpCit7CisJcHV0cyAoImV4dGVybmFsX2ludGVycnVwdCAob29wcyEpXG4iKTsKK30KKwordm9pZCB0aW1lcl9pbnRlcnJ1cHRfY3B1IChzdHJ1Y3QgcHRfcmVncyAqcmVncykKK3sKKwkvKiBub3RoaW5nIHRvIGRvIGhlcmUgKi8KKwlyZXR1cm47Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKgorICogSW5zdGFsbCBhbmQgZnJlZSBhIGludGVycnVwdCBoYW5kbGVyLgorICovCisKK3ZvaWQgaXJxX2luc3RhbGxfaGFuZGxlciAoaW50IHZlYywgaW50ZXJydXB0X2hhbmRsZXJfdCAqIGhhbmRsZXIsIHZvaWQgKmFyZykKK3sKKworfQorCit2b2lkIGlycV9mcmVlX2hhbmRsZXIgKGludCB2ZWMpCit7CisKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3ZvaWQKK2RvX2lycWluZm8gKGNtZF90YmxfdCAqIGNtZHRwLCBiZF90ICogYmQsIGludCBmbGFnLCBpbnQgYXJnYywgY2hhciAqYXJndltdKQoreworCXB1dHMgKCJJUlEgcmVsYXRlZCBmdW5jdGlvbnMgYXJlIHVuaW1wbGVtZW50ZWQgY3VycmVudGx5LlxuIik7Cit9CmRpZmYgLS1naXQgYS9hcmNoL3BwYy9jcHUvbXBjODIyMC9pby5TIGIvYXJjaC9wcGMvY3B1L21wYzgyMjAvaW8uUwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi41ZWNkZjU1Ci0tLSAvZGV2L251bGwKKysrIGIvYXJjaC9wcGMvY3B1L21wYzgyMjAvaW8uUwpAQCAtMCwwICsxLDEyOCBAQAorLyoKKyAqICBDb3B5cmlnaHQgKEMpIDE5O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orICAucmVsLmJzcyAgICAgICA6IHsgKigucmVsLmJzcykJCX0KKyAgLnJlbGEuYnNzICAgICAgOiB7ICooLnJlbGEuYnNzKQkJfQorICAucmVsLnBsdCAgICAgICA6IHsgKigucmVsLnBsdCkJCX0KKyAgLnJlbGEucGx0ICAgICAgOiB7ICooLnJlbGEucGx0KQkJfQorICAuaW5pdCAgICAgICAgICA6IHsgKiguaW5pdCkJfQorICAucGx0IDogeyAqKC5wbHQpIH0KKyAgLnRleHQgICAgICA6CisgIHsKKyAgICBhcmNoL3BwYy9jcHUvbXBjODIyMC9zdGFydC5vCSgudGV4dCkKKyAgICAqKC50ZXh0KQorICAgICooLmdvdDEpCisgICAgLiA9IEFMSUdOKDE2KTsKKyAgICAqKC5laF9mcmFtZSkKKyAgICAqKFNPUlRfQllfQUxJR05NRU5UKFNPUlRfQllfTkFNRSgucm9kYXRhKikpKQorICB9CisgIC5maW5pICAgICAgOiB7ICooLmZpbmkpICAgIH0gPTAKKyAgLmN0b3JzICAgICA6IHsgKiguY3RvcnMpICAgfQorICAuZHRvcnMgICAgIDogeyAqKC5kdG9ycykgICB9CisKKyAgLyogUmVhZC13cml0ZSBzZWN0aW9uLCBtZXJnZWQgaW50byBkYXRhIHNlZ21lbnQ6ICovCisgIC4gPSAoLiArIDB4MEZGRikgJiAweEZGRkZGMDAwOworICBfZXJvdGV4dCA9IC47CisgIFBST1ZJREUgKGVyb3RleHQgPSAuKTsKKyAgLnJlbG9jICAgOgorICB7CisgICAgKiguZ290KQorICAgIF9HT1QyX1RBQkxFXyA9IC47CisgICAgKiguZ290MikKKyAgICBfRklYVVBfVEFCTEVfID0gLjsKKyAgICAqKC5maXh1cCkKKyAgfQorICBfX2dvdDJfZW50cmllcyA9IChfRklYVVBfVEFCTEVfIC0gX0dPVDJfVEFCTEVfKSA+PiAyOworICBfX2ZpeHVwX2VudHJpZXMgPSAoLiAtIF9GSVhVUF9UQUJMRV8pID4+IDI7CisKKyAgLmRhdGEgICAgOgorICB7CisgICAgKiguZGF0YSkKKyAgICAqKC5kYXRhMSkKKyAgICAqKC5zZGF0YSkKKyAgICAqKC5zZGF0YTIpCisgICAgKiguZHluYW1pYykKKyAgICBDT05TVFJVQ1RPUlMKKyAgfQorICBfZWRhdGEgID0gIC47CisgIFBST1ZJREUgKGVkYXRhID0gLik7CisKKyAgLiA9IC47CisgIF9fdV9ib290X2NtZF9zdGFydCA9IC47CisgIC51X2Jvb3RfY21kIDogeyAqKC51X2Jvb3RfY21kKSB9CisgIF9fdV9ib290X2NtZF9lbmQgPSAuOworCisKKyAgLiA9IC47CisgIF9fc3RhcnRfX19leF90YWJsZSA9IC47CisgIF9fZXhfdGFibGUgOiB7ICooX19leF90YWJsZSkgfQorICBfX3N0b3BfX19leF90YWJsZSA9IC47CisKKyAgLiA9IEFMSUdOKDQwOTYpOworICBfX2luaXRfYmVnaW4gPSAuOworICAudGV4dC5pbml0IDogeyAqKC50ZXh0LmluaXQpIH0KKyAgLmRhdGEuaW5pdCA6IHsgKiguZGF0YS5pbml0KSB9CisgIC4gPSBBTElHTig0MDk2KTsKKyAgX19pbml0X2VuZCA9IC47CisKKyAgX19ic3Nfc3RhcnQgPSAuOworICAuYnNzIChOT0xPQUQpICAgICAgIDoKKyAgeworICAgKiguc2JzcykgKiguc2NvbW1vbikKKyAgICooLmR5bmJzcykKKyAgICooLmJzcykKKyAgICooQ09NTU9OKQorICAgLiA9IEFMSUdOKDQpOworICB9CisgIF9lbmQgPSAuIDsKKyAgUFJPVklERSAoZW5kID0gLik7Cit9CmRpZmYgLS1naXQgYS9hcmNoL3BwYy9jcHUvbXBjODIyMC91YXJ0LmMgYi9hcmNoL3BwYy9jcHUvbXBjODIyMC91YXJ0LmMKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMGM0YjUzNgotLS0gL2Rldi9udWxsCisrKyBiL2FyY2gvcHBjL2NwdS9tcGM4MjIwL3VhcnQuYwpAQCAtMCwwICsxLDEyNiBAQAorL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y3B1X2NsazsKKwljaGFyIGJ1ZlszMl07CisKKwlwdXRzICgiQ1BVOiAgICIpOworCisJc3dpdGNoICh2ZXJzaW9uKSB7CisJY2FzZSBDUFVfVFlQRV84MjQwOgorCQlwdXRzICgiTVBDODI0MCIpOworCQlicmVhazsKKworCWNhc2UgQ1BVX1RZUEVfODI0NToKKwkJcHV0cyAoIk1QQzgyNDUiKTsKKwkJYnJlYWs7CisKKwlkZWZhdWx0OgorCQlyZXR1cm4gLTE7CQkvKm5vdCB2YWxpZCBmb3IgdGhpcyBzb3VyY2UgKi8KKwl9CisKKwlDT05GSUdfUkVBRF9CWVRFIChSRVZJRCwgcmV2aXNpb24pOworCisJaWYgKHJldmlzaW9uKSB7CisJCXByaW50ZiAoIiBSZXZpc2lvbiAlZC4lZCIsCisJCQkocmV2aXNpb24gJiAweGYwKSA+PiA0LAorCQkJKHJldmlzaW9uICYgMHgwZikpOworCX0gZWxzZSB7CisJCXJldHVybiAtMTsJCS8qIG5vIHZhbGlkIENQVSByZXZpc2lvbiBpbmZvICovCisJfQorCisJcHJpbnRmICgiIGF0ICVzIE1IejoiLCBzdHJtaHogKGJ1ZiwgY2xvY2spKTsKKworCXByaW50ZiAoIiAldSBrQiBJLUNhY2hlIiwgY2hlY2tpY2FjaGUgKCkgPj4gMTApOworCXByaW50ZiAoIiAldSBrQiBELUNhY2hlIiwgY2hlY2tkY2FjaGUgKCkgPj4gMTApOworCisJcHV0cyAoIlxuIik7CisKKwlyZXR1cm4gMDsKK30KKworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogTDEgaS1jYWNoZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworCitpbnQgY2hlY2tpY2FjaGUgKHZvaWQpCit7CisJIC8qVE9ETyovCisJIHJldHVybiAxMjggKiA0ICogMzI7Cit9OworCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiBMMSBkLWNhY2hlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisKK2ludCBjaGVja2RjYWNoZSAodm9pZCkKK3sKKwkgLypUT0RPKi8KKwkgcmV0dXJuIDEyOCAqIDQgKiAzMjsKKworfTsKKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisKK2ludCBkb19yZXNldCAoY21kX3RibF90ICpjbWR0cCwgaW50IGZsYWcsIGludCBhcmdjLCBjaGFyICphcmd2W10pCit7CisJdWxvbmcgbXNyLCBhZGRyOworCisJLyogSW50ZXJydXB0cyBhbmQgTU1VIG9mZiAqLworCV9fYXNtX18gKCJtdHNwciAgICA4MSwgMCIpOworCisJLyogSW50ZXJydXB0cyBhbmQgTU1VIG9mZiAqLworCV9fYXNtX18gX192b2xhdGlsZV9fICgibWZtc3IgICAgJTAiOiI9ciIgKG1zcik6KTsKKworCW1zciAmPSB+MHgxMDMwOworCV9fYXNtX18gX192b2xhdGlsZV9fICgibXRtc3IgICAgJTAiOjoiciIgKG1zcikpOworCisJLyoKKwkgKiBUcnlpbmcgdG8gZXhlY3V0ZSB0aGUgbmV4dCBpbnN0cnVjdGlvbiBhdCBhIG5vbi1leGlzdGluZyBhZGRyZXNzCisJICogc2hvdWxkIGNhdXNlIGEgbWFjaGluZSBjaGVjaywgcmVzdWx0aW5nIGluIHJlc2V0CisJICovCisjaWZkZWYgQ09ORklHX1NZU19SRVNFVF9BRERSRVNTCisJYWRkciA9IENPTkZJR19TWVNfUkVTRVRfQUREUkVTUzsKKyNlbHNlCisJLyoK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VPSSgpOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogIGVwaWNJbnRFbmFibGUgLSBFbmFibGUgYW4gaW50ZXJydXB0IHNvdXJjZQorICoKKyAqICBUaGlzIHJvdXRpbmUgY2xlYXJzIHRoZSBtYXNrIGJpdCBvZiBhbiBleHRlcm5hbCwgYW4gaW50ZXJuYWwgb3IKKyAqICBhIFRpbWVyIHJlZ2lzdGVyIHRvIGVuYWJsZSB0aGUgaW50ZXJydXB0LgorICoKKyAqICBSRVRVUk5TOiAgTm9uZQorICovCit2b2lkIGVwaWNJbnRFbmFibGUoaW50IGludFZlYykKK3sKKyAgICBVTE9ORyB0bXA7CisgICAgVUxPTkcgc3JBZGRyOworCisgICAgc3JBZGRyID0gU3JjVmVjVGFibGVbaW50VmVjXS5zcmNBZGRyOyAgLyogUmV0cmlldmUgc3JjIFZlYy9QcmlvIHJlZ2lzdGVyICovCisgICAgdG1wID0gc3lzRVVNQkJBUlJlYWQoc3JBZGRyKTsKKyAgICB0bXAgJj0gfkVQSUNfVkVDX1BSSV9NQVNLOyAgICAgICAgICAgICAvKiBDbGVhciB0aGUgbWFzayBiaXQgKi8KKyAgICB0bXAgfD0gKEVQSUNfVkVDX1BSSV9ERkxUX1BSSSA8PCAxNik7ICAgLyogU2V0IHByaW9yaXR5IHRvIERlZmF1bHQgLSBDTEggKi8KKyAgICB0bXAgfD0gaW50VmVjOwkJCQkgICAgICAgICAgIC8qIFNldCBWZWN0b3IgbnVtYmVyICovCisgICAgc3lzRVVNQkJBUldyaXRlKHNyQWRkciwgdG1wKTsKKworICAgIHJldHVybjsKKyAgICB9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAgZXBpY0ludERpc2FibGUgLSBEaXNhYmxlIGFuIGludGVycnVwdCBzb3VyY2UKKyAqCisgKiAgVGhpcyByb3V0aW5lIHNldHMgdGhlIG1hc2sgYml0IG9mIGFuIGV4dGVybmFsLCBhbiBpbnRlcm5hbCBvcgorICogIGEgVGltZXIgcmVnaXN0ZXIgdG8gZGlzYWJsZSB0aGUgaW50ZXJydXB0LgorICoKKyAqICBSRVRVUk5TOiAgT0sgb3IgRVJST1IKKyAqCisgKi8KKwordm9pZCBlcGljSW50RGlzYWJsZQorICAgICgKKyAgICBpbnQgaW50VmVjICAgICAgICAvKiBJbnRlcnJ1cHQgdmVjdG9yIG51bWJlciAqLworICAgICkKKyAgICB7CisKKyAgICBVTE9ORyB0bXAsIHNyQWRkcjsKKworICAgIHNyQWRkciA9IFNyY1ZlY1RhYmxlW2ludFZlY10uc3JjQWRkcjsKKyAgICB0bXAgPSBzeXNFVU1CQkFSUmVhZChzckFkZHIpOworICAgIHRtcCB8PSAweDgwMDAwMDAwOyAgICAgICAgICAgICAgICAgICAgICAvKiBTZXQgdGhlIG1hc2sgYml0ICovCisgICAgc3lzRVVNQkJBUldyaXRlKHNyQWRkciwgdG1wKTsKKyAgICByZXR1cm47CisgICAgfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogZXBpY0ludFNvdXJjZUNvbmZpZyAtIFNldCBwcm9wZXJ0aWVzIG9mIGFuIGludGVycnVwdCBzb3VyY2UKKyAqCisgKiBUaGlzIGZ1bmN0aW9uIHNldHMgaW50ZXJydXB0IHByb3Blcml0ZXMgKFBvbGFyaXR5LCBTZW5zZSwgSW50ZXJydXB0CisgKiBQcm9yaXR5LCBhbmQgSW50ZXJydXB0IFZlY3Rvcikgb2YgYW4gSW50ZXJydXB0IFNvdXJjZS4gIFRoZSBwcm9wZXJ0aWVzCisgKiBjYW4gYmUgc2V0IHdoZW4gdGhlIGN1cnJlbnQgc291cmNlIGlzIG5vdCBpbi1yZXF1ZXN0IG9yIGluL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FjdEJpdCA9PSAxKQorCXJldHVybiBFUlJPUjsKKworICAgIHRtcCAmPSAweGZmMzBmZjAwOyAgICAgLyogRXJhc2UgcHJldmlvdXNseSBzZXQgUCxTLFByaW8sVmVjdG9yIGJpdHMgKi8KKyAgICBuZXdWYWwgPSAoUG9sYXJpdHkgPDwgMjMpIHwgKFNlbnNlIDw8IDIyKSB8IChQcmlvIDw8IDE2KSB8IFZlY3Q7CisgICAgc3lzRVVNQkJBUldyaXRlKHNyQWRkciwgdG1wIHwgbmV3VmFsICk7CisgICAgcmV0dXJuIChPSyk7CisgICAgfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogZXBpY0ludEFjayAtIGFja25vd2xlZGdlIGFuIGludGVycnVwdAorICoKKyAqIFRoaXMgZnVuY3Rpb24gcmVhZHMgdGhlIEludGVycnVwdCBhY2tub3dsZGdlIHJlZ2lzdGVyIGFuZCByZXR1cm4KKyAqIHRoZSB2ZWN0b3IgbnVtYmVyIG9mIHRoZSBoaWdoZXN0IHBlbmRpbmcgaW50ZXJydXB0LgorICoKKyAqIFJFVFVSTlM6IEludGVycnVwdCBWZWN0b3IgbnVtYmVyLgorICovCisKK3Vuc2lnbmVkIGludCBlcGljSW50QWNrKHZvaWQpCit7CisgICAgcmV0dXJuKHN5c0VVTUJCQVJSZWFkKCBFUElDX1BST0NfSU5UX0FDS19SRUcgKSk7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBlcGljRU9JIC0gc2lnbmFsIGFuIGVuZCBvZiBpbnRlcnJ1cHQKKyAqCisgKiBUaGlzIGZ1bmN0aW9uIHdyaXRlcyAweDAgdG8gdGhlIEVPSSByZWdpc3RlciB0byBzaWduYWwgZW5kIG9mIGludGVycnVwdC4KKyAqIEl0IGlzIHVzdWFsbHkgY2FsbGVkIGFmdGVyIGFuIGludGVycnVwdCByb3V0aW5lIGlzIHNlcnZlZC4KKyAqCisgKiBSRVRVUk5TOiBOb25lCisgKi8KKwordm9pZCBlcGljRU9JKHZvaWQpCisgICAgeworICAgIHN5c0VVTUJCQVJXcml0ZShFUElDX1BST0NfRU9JX1JFRywgMHgwKTsKKyAgICB9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAgZXBpY0N1clRhc2tQcmlvU2V0IC0gc2V0cyB0aGUgcHJpb3JpdHkgb2YgdGhlIFByb2Nlc3NvciBDdXJyZW50IFRhc2sKKyAqCisgKiAgVGhpcyBmdW5jdGlvbiBzaG91bGQgYmUgY2FsbGVkIGFmdGVyIGVwaWNJbml0KCkgdG8gbG93ZXIgdGhlIHByaW9yaXR5CisgKiAgb2YgdGhlIHByb2Nlc3NvciBjdXJyZW50IHRhc2suCisgKgorICogIFJFVFVSTlM6ICBPSyBvciBFUlJPUgorICovCisKK2ludCBlcGljQ3VyVGFza1ByaW9TZXQKKyAgICAoCisgICAgaW50IHByaW9OdW0gICAgICAgICAgICAgICAgIC8qIE5ldyBwcmlvcml0eSB2YWx1ZSAqLworICAgICkKKyAgICB7CisKKyAgICBpZiAoIChwcmlvTnVtIDwgMCkgfHwgKHByaW9OdW0gPiAweEYpKQorCXJldHVybiBFUlJPUjsKKyAgICBzeXNFVU1CQkFSV3JpdGUoRVBJQ19QUk9DX0NUQVNLX1BSSV9SRUcsIHByaW9OdW0pOworICAgIHJldHVybiBPSzsKKyAgICB9CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogZnVuY3Rpb246IGVwaWNJbnRUYXNrR2V0CisgKgorICogZGVzY3JpcHRpb246IEdldCB2YWx1ZSBvZiBwcm9jZXNzb3IgY3VycmVudCBpbnRlcnJ1cHQgdGFzayBwcmlvcml0eSByZWdpc3RlcgorICoKKyAqIG5vdGU6CisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCit1bnNpZ25lZCBjaGFyIGVwaWNJbnRUYXNrR2V0KCkKK3sKKyAgLyogZ2V0IHRoZSBpbnRlcnJ1cHQgdGFzayBwcmlvcml0eSByZWdpc3RlciAqLworICAgIFVMT05HIHJlZzsKKyAgICB1bnNpZ25lZCBjaGFyIHJlYzsKKworICAgIHJlZyA9IHN5c0VVTUJCQVJSZWFkKCBFUElDX1BST0NfQ1RBU0tfUFJJX1JFRyApOworICAgIHJlYyA9ICggcmVnICYgMHgwRiApOworICAgIHJldHVybiByZWM7Cit9CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBmdW5jdGlvbjogZXBpY0lTUgorICoKKyAqIGRlc2NyaXB0aW9uOiBFUElDIHNlcnZpY2Ugcm91dGluZSBjYWxsZWQgYnkgdGhlIGNvcmUgZXhjZXB0aW9uCisgKiAgICAgICAgICAgICAgYXQgMHg1MDAKKyAqCisgKiBub3RlOgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwordW5zaWduZWQgaW50IGVwaWNJU1Iodm9pZCkKK3sKKyAgIHJldHVybiAwOworfQorCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIGZ1bmN0aW9uOiBlcGljTW9kZUdldAorICoKKyAqIGRlc2NyaXB0aW9uOiBxdWVyeSBFUElDIG1vZGUsIHJldHVybiAwIGlmIHBhc3MgdGhyb3VnaCBtb2RlCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMSBpZiBtaXhlZCBtb2RlCisgKgorICogbm90ZToKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwordW5zaWduZWQgaW50IGVwaWNNb2RlR2V0KHZvaWQpCit7CisgICAgVUxPTkcgdmFsOworCisgICAgdmFsID0gc3lzRVVNQkJBUlJlYWQoIEVQSUNfR0xPQkFMX1JFRyApOworICAgIHJldHVybiAoKCB2YWwgJiAweDIwMDAwMDAwICkgPj4gMjkpOworfQorCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIGZ1bmN0aW9uOiBlcGljQ29uZmlnR2V0CisgKgorICogZGVzY3JpcHRpb246IEdldCB0aGUgRVBJQyBpbnRlcnJ1cHQgQ29uZmlndXJhdGlvbgorICogICAgICAgICAgICAgIHJldHVybiAwIGlmIG5vdCBlcnJvciwgb3RoZXJ3aXNlIHJldHVybiAxCisgKgorICogbm90ZToKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3ZvaWQgZXBpY0NvbmZpZ0dldCggdW5zaWduZWQgaW50ICpjbGtSYXRpbywgdW5zaWduZWQgaW50ICpzZXJFbmFibGUpCit7CisgICAgVUxPTkcgdmFsOworCisgICAgdmFsID0gc3lzRVVNQkJBUlJlYWQoIEVQSUNfSU5UX0NPTkZfUkVHICk7CisgICAgKmNsa1JhdGlvID0gKCB2YWwgJiAweDcwMDAwMDAwICkgPj4gMjg7CisgICAgKnNlckVuYWJsZSA9ICggdmFsICYgMHg4MDAwMDAwICkgPj4gMjc7Cit9CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICBzeXNFVU1CQkFSUmVhZCAtIFJlYWQgYSAzMi1iaXQgRVVNQkJBUiByZWdpc3RlcgorICoKKyAqICBUaGlzIHJvdXRpbmUgcmVhZHMgdGhlIGNvbnRlbnQgb2YgYSByZWdpc3RlciBpbiB0aGUgRW1iZWRkZWQKKyAqICBVdGlsaXRpZXMgTWVtb3J5IEJsb2NrLCBhbmQgc3dhcHMgdG8gYmlnIGVuZGlhbiBiZWZvcmUgcmV0dXJuaW5nCisgKiAgdGhlIHZhbHVlLgorICoKKyAqICBSRVRVUk5TOiAgVGhlIGNvbnRlbnQgb2YgdGhlIHNwZWNpZmllZCBFVU1CQkFSIHJlZ2lzdGVyLgorICovCisKK1VMT05HIHN5c0VVTUJCQVJSZWFkCisgICAgKAorICAgIFVMT05HIHJlZ051bQorICAgICkKKyAgICB7CisgICAgVUxPTkcgdGVtcDsKKworICAgIHRlbXAgPSAqKFVMT05HICopIChDT05GSUdfU1lTX0VVTUJfQUREUiArIHJlZ051bSk7CisgICAgcmV0dXJuICggTE9OR1NXQVAodGVtcCkpOworICAgIH0KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICBzeXNFVU1CQkFSV3JpdGUgLSBXcml0ZSBhIDMyLWJpdCBFVU1CQkFSIHJlZ2lzdGVyCisgKgorICogIFRoaXMgcm91dGluZSBzd2FwcyB0aGUgdmFsdWUgdG8gbGl0dGxlIGVuZGlhbiB0aGVuIHdyaXRlcyBpdCB0bworICogIGEgcmVnaXN0ZXIgaW4gdGhlIEVtYmVkZGVkIFV0aWxpdGllcyBNZW1vcnkgQmxvY2sgYWRkcmVzcyBzcGFjZS4KKyAqCisgKiAgUkVUVVJOUzogTi9BCisgKi8KKwordm9pZCBzeXNFVU1CQkFSV3JpdGUKKyAgICAoCisgICAgVUxPTkcgcmVnTnVtLCAgICAgICAgICAgICAgIC8qIEVVTUJCQVIgcmVnaXN0ZXIgYWRkcmVzcyAqLworICAgIFVMT05HIHJlZ1ZhbCAgICAgICAgICAgICAgICAvKiBWYWx1ZSB0byBiZSB3cml0dGVuICovCisgICAgKQorICAgIHsKKworICAgICooVUxPTkcgKikgKENPTkZJR19TWVNfRVVNQl9BRERSICsgcmVnTnVtKSA9IExPTkdTV0FQKHJlZ1ZhbCk7CisgICAgcmV0dXJuIDsKKyAgICB9CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBmdW5jdGlvbjogZXBpY1ZlbmRvcklkCisgKgorICogZGVzY3JpcHRpb246IHJldHVybiB0aGUgRVBJQyBWZW5kb3IgSWRlbnRpZmljYXRpb24KKyAqICAgICAgICAgICAgICByZWdpc3RlcjoKKyAqCisgKiAgICAgICAgICAgICAgc2lsaWNjb24gdmVyc2lvbiwgZGV2aWNlIGlkLCBhbmQgdmVuZG9yIGlkCisgKgorICogbm90ZToKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3ZvaWQgZXBpY1ZlbmRvcklkCisgICAoCisgICAgdW5zaWduZWQgaW50ICpzdGVwLAorICAgIHVuc2lnbmVkIGludCAqZGV2SWQsCisgICAgdW5zaWduZWQgaW50ICp2ZW5JZAorICAgKQorICAgeworICAgIFVMT05HIHZhbDsKKyAgICB2YWwgPSBzeXNFVU1CQkFSUmVhZCggRVBJQ19WRU5ET1JfSURfUkVHICk7CisgICAgKnN0ZXAgID0gKCB2YWwgJiAweDAwRkYwMDAwICkgPj4gMTY7CisgICAgKmRldklkID0gKCB2YWwgJiAweDAwMDBGRjAwICkgPj4gODsKKyAgICAqdmVuSWQgPSAoIHZhbCAmIDB4MDAwMDAwRkYgKTsKKyAgICB9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogZnVuY3Rpb246IGVwaWNGZWF0dXJlcworICoKKyAqIGRlc2NyaXB0aW9uOiByZXR1cm4gdGhlIG51bWJlciBvZiBJUlEgc3VwcG9ydGVkLAorICogICAgICAgICAgICAgIG51bWJlciBvZiBDUFUsIGFuZCB0aGUgdmVyc2lvbiBvZiB0aGUKKyAqICAgICAgICAgICAgICBPcGVuRVBJQworICoKKyAqIG5vdGU6CisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3ZvaWQgZXBpY0ZlYXR1cmVzCisgICAgKAorICAgIHVuc2lnbmVkIGludCAqbm9JUlFzLAorICAgIHVuc2lnbmVkIGludCAqbm9DUFVzLAorICAgIHVuc2lnbmVkIGludCAqdmVySWQKKyAgICApCisgICAgeworICAgIFVMT05HIHZhbDsKKworICAgIHZhbCA9IHN5c0VVTUJCQVJSZWFkKCBFUElDX0ZFQVRVUkVTX1JFRyApOworICAgICpub0lSUXMgID0gKCB2YWwgJiAweDA3RkYwMDAwICkgPj4gMTY7CisgICAgKm5vQ1BVcyAgPSAoIHZhbCAmIDB4MDAwMDFGMDAgKSA+PiA4OworICAgICp2ZXJJZCAgID0gKCB2YWwgJiAweDAwMDAwMEZGICk7Cit9CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogZnVuY3Rpb246IGVwY2lUbUZyZXF1bmN5U2V0CisgKgorICogZGVzY3JpcHRpb246IFNldCB0aGUgdGltZXIgZnJlcXVlbmN5IHJlcG9ydGluZyByZWdpc3RlcgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwordm9pZCBlcGljVG1GcmVxdWVuY3lTZXQoIHVuc2lnbmVkIGludCBmcnEgKQoreworICAgIHN5c0VVTUJCQVJXcml0ZShFUElDX1RNX0ZSRVFfUkVHLCBmcnEpOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogZnVuY3Rpb246IGVwaWNUbUZyZXF1bmN5R2V0CisgKgorICogZGVzY3JpcHRpb246IEdldCB0aGUgY3VycmVudCB2YWx1ZSBvZiB0aGUgVGltZXIgRnJlcXVlbmN5CisgKiBSZXBvcnRpbmcgcmVnaXN0ZXIKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwordW5zaWduZWQgaW50IGVwaWNUbUZyZXF1ZW5jeUdldCh2b2lkKQoreworICAgIHJldHVybiggc3lzRVVNQkJBUlJlYWQoRVBJQ19UTV9GUkVRX1JFRykpIDsKK30KKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogZnVuY3Rpb246IGVwaWNUbUJhc2VTZXQKKyAqCisgKiBkZXNjcmlwdGlvbjogU2V0IHRoZSAjbiBnbG9iYWwgdGltZXIgYmFzZSBjb3VudCByZWdpc3RlcgorICogICAgICAgICAgICAgIHJldHVybiAwIGlmIG5vIGVycm9yLCBvdGhlcndpc2UgcmV0dXJuIDEuCisgKgorICogbm90ZToKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwordW5zaWduZWQgaW50IGVwaWNUbUJhc2VTZXQKKyAgICAoCisgICAgVUxPTkcgc3JjQWRkciwgICAgICAgICAvKiBBZGRyZXNzIG9mIHRoZSBUaW1lciBCYXNlIHJlZ2lzdGVyICovCisgICAgdW5zaWduZWQgaW50IGNudCwgICAgLyogQmFzZSBjb3VudCAqLworICAgIHVuc2lnbmVkIGludCBpbmhpYml0ICAgLyogMSAtIGNvdW50IGluaGliaXQgKi8KKyAgICApCit7CisKKyAgICB1bnNpZ25lZCBpbnQgdmFsID0gMHg4MDAwMDAwMDsKKyAgICAvKiBGaXJzdCBpbmhpYml0IGNvdW50aW5nIHRoZSB0aW1lciAqLworICAgIHN5c0VVTUJCQVJXcml0ZShzcmNBZGRyLCB2YWwpIDsKKworICAgIC8qIHNldCB0aGUgbmV3IHZhbHVlICovCisgICAgdmFsID0gKGNudCAmIDB4N2ZmZmZmZmYpIHwgKChpbmhpYml0ICYgMHgxKSA8PCAzMSk7CisgICAgc3lzRVVNQkJBUldyaXRlKHNyY0FkZHIsIHZhbCkgOworICAgIHJldHVybiAwOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIGZ1bmN0aW9uOiBlcGljVG1CYXNlR2V0CisgKgorICogZGVzY3JpcHRpb246IEdldCB0aGUgY3VycmVudCB2YWx1ZSBvZiB0aGUgZ2xvYmFsIHRpbWVyIGJhc2UgY291bnQgcmVnaXN0ZXIKKyAqICAgICAgICAgICAgICByZXR1cm4gMCBpZiBubyBlcnJvciwgb3RoZXJ3aXNlIHJldHVybiAxLgorICoKKyAqIG5vdGU6CisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCit1bnNpZ25lZCBpbnQgZXBpY1RtQmFzZUdldCggVUxPTkcgc3JjQWRkciwgdW5zaWduZWQgaW50ICp2YWwgKQoreworICAgICp2YWwgPSBzeXNFVU1CQkFSUmVhZCggc3JjQWRkciApOworICAgICp2YWwgPSAqdmFsICYgMHg3ZmZmZmZmZjsKKyAgICByZXR1cm4gMDsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBmdW5jdGlvbjogZXBpY1RtQ291bnRHZXQKKyAqCisgKiBkZXNjcmlwdGlvbjogR2V0IHRoZSB2YWx1ZSBvZiBhIGdpdmVuIGdsb2JhbCB0aW1lcgorICogICAgICAgICAgICAgIGN1cnJlbnQgY291bnQgcmVnaXN0ZXIKKyAqICAgICAgICAgICAgICByZXR1cm4gMCBpZiBubyBlcnJvciwgb3RoZXJ3aXNlIHJldHVybiAxCisgKiBub3RlOgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCit1bnNpZ25lZCBpbnQgZXBpY1RtQ291bnRHZXQoIFVMT05HIHNyY0FkZHIsIHVuc2lnbmVkIGludCAqdmFsICkKK3sKKyAgICAqdmFsID0gc3lzRVVNQkJBUlJlYWQoIHNyY0FkZHIgKTsKKyAgICAqdmFsID0gKnZhbCAmIDB4N2ZmZmZmZmY7CisgICAgcmV0dXJuIDA7Cit9CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBmdW5jdGlvbjogZXBpY1RtSW5oaWJpdAorICoKKyAqIGRlc2NyaXB0aW9uOiBTdG9wIGNvdW50aW5nIG9mIGEgZ2l2ZW4gZ2xvYmFsIHRpbWVyCisgKiAgICAgICAgICAgICAgcmV0dXJuIDAgaWYgbm8gZXJyb3IsIG90aGVyd2lzZSByZXR1cm4gMQorICoKKyAqIG5vdGU6CisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCit1bnNpZ25lZCBpbnQgZXBpY1RtSW5oaWJpdCggdW5zaWduZWQgaW50IHNyY0FkZHIgKQoreworICAgIFVMT05HIHZhbDsKKworICAgIHZhbCA9IHN5c0VVTUJCQVJSZWFkKCBzcmNBZGRyICk7CisgICAgdmFsIHw9IDB4ODAwMDAwMDA7CisgICAgc3lzRVVNQkJBUldyaXRlKCBzcmNBZGRyLCB2YWwgKTsKKyAgICByZXR1cm4gMDsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogZnVuY3Rpb246IGVwaWNUbUVuYWJsZQorICoKKyAqIGRlc2NyaXB0aW9uOiBFbmFibGUgY291bnRpbmcgb2YgYSBnaXZlbiBnbG9iYWwgdGltZXIKKyAqICAgICAgICAgICAgICByZXR1cm4gMCBpZiBubyBlcnJvciwgb3RoZXJ3aXNlIHJldHVybiAxCisgKgorICogbm90ZToKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8K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vYXJjaC9wcGMvY3B1L21wYzgyNHgvZHJpdmVycy9lcGljL2VwaWMyLlMKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uNTJkMTlhYQotLS0gL2Rldi9udWxsCisrKyBiL2FyY2gvcHBjL2NwdS9tcGM4MjR4L2RyaXZlcnMvZXBpYy9lcGljMi5TCkBAIC0wLDAgKzEsMTk2IEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBjb3B5cmlnaHQgQCBNb3Rvcm9sYSwgMTk5OQorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI2luY2x1ZGUgPHBwY19hc20udG1wbD4KKyNpbmNsdWRlIDxwcGNfZGVmcy5oPgorI2luY2x1ZGUgPGFzbS9wcm9jZXNzb3IuaD4KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogZnVuY3Rpb246IENvcmVFeHRJbnRFbmFibGUKKyAqCisgKiBkZXNjcmlwdGlvbjogRW5hYmxlIDYwM2UgY29yZSBleHRlcm5hbCBpbnRlcnJ1cHQKKyAqCisgKiBub3RlOiBtdG1zciBpcyBjb250ZXh0LXN5bmNocm9uaXphdGlvbgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisJCS50ZXh0CisJCS5hbGlnbiAyCisJLmdsb2JhbCBDb3JlRXh0SW50RW5hYmxlCitDb3JlRXh0SW50RW5hYmxlOgorCSBtZm1zciAgICByMworCisJIG9yaSAgICAgIHIzLHIzLDB4ODAwMCAgICAgICAgIC8qIGVuYWJsZSBleHRlcm5hbCBpbnRlcnJ1cHQgKi8KKwkgbXRtc3IgICAgcjMKKworCSBiY2xyIDIwLCAwCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBmdW5jdGlvbjogQ29yZUV4dEludERpc2FibGUKKyAqCisgKiBkZXNjcmlwdGlvbjogRGlzYWJsZSA2MDNlIGNvcmUgZXh0ZXJuYWwgaW50ZXJydXB0CisgKgorICogbm90ZToKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCQkudGV4dAorCQkuYWxpZ24gMgorCS5nbG9iYWwgQ29yZUV4dEludERpc2FibGUKK0NvcmVFeHRJbnREaXNhYmxlOgorCW1mbXNyICAgIHI0CisKKwl4b3IJcjMscjMscjMKKwlvciAgICAgIHIzLHIzLHI0CisKKwlhbmRpcy4JcjQscjQsMHhmZmZmCisJYW5kaS4gICByMyxyMywweDdmZmYgICAgICAgICAvKiBkaXNhYmxlIGV4dGVybmFsIGludGVycnVwdCAqLworCisJb3IgICAgICByMyxyMyxyNAorCW10bXNyICAgIHIzCisKKwliY2xyIDIwLCAwCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIGZ1bmN0aW9uOiBlcGljRU9JCisgKgorICogZGVzY3JpcHRpb246IHNpZ25hbCB0aGUgRU9JIGFuZCByZXN0b3JlIG1hY2hpbmUgc3RhdHVzCisgKiAgICAgICBJbnB1dDogcjMgLSB2YWx1ZSBvZiBldW1iYmFyCisgKiAgICAgICBPdXRwdXQ6IHIzIC0gdmFsdWUgb2YgZXVtYmJhcgorICogICAgICAgICAgICAgICByNCAtIElTUiB2ZWN0b3IgdmFsdWUKKyAqIG5vdGU6CisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisJCS50ZXh0CisJCS5hbGlnbiAyCisJLmdsb2JhbCBlcGljRU9JCitlcGljRU9JOgorCWxpcwlyNSwweDAwMDYJICAgICAgICAvKiBCdWlsZCBFbmQgT2YgSW50ZXJydXB0IFJlZ2lzdGVyIG9mZnNldCAqLworCW9yaQlyNSxyNSwweDAwYjAKKwl4b3IJcjcscjcscjcJICAgICAgICAvKiBDbGVhciByN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gICAgLyogUmVzdG9yZSBTUFJHMSAqLworCisJbHd6CXI0LDB4NChyMSkgICAgICAgICAgLyogdmVjdG9yIHZhbHVlICovCisJbHd6CXIzLDB4MChyMSkgICAgICAgICAgLyogZXVtYmJhciAqLworCXN5bmMKKworCWFkZGkJcjEscjEsMHgyMAkvKiBEZWFsbG9jYXRlIHN0YWNrICovCisJbXRzcHIgICBTUFJHMCxyMQkvKiBTYXZlIHVwZGF0ZWQgU3VwZXJ2aXNvciBzdGFjayBwb2ludGVyICovCisJbWZzcHIgICByMSxTUFJHMQkvKiBSZXN0b3JlIFVzZXIgc3RhY2sgcG9pbnRlciAqLworCisJYmNsciAgICAgMjAsMAorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIGZ1bmN0aW9uOiBleGNlcHRpb24gcm91dGluZSBjYWxsZWQgYnkgZXhjZXB0aW9uIHZlY3RvcgorICogICAgICAgICAgIGF0IDB4NTAwLCBleHRlcm5hbCBpbnRlcnJ1cHQKKyAqCisgKiBkZXNjcmlwdGlvbjogS2FobHVhIEVQSUMgY29udHJvbGxlcgorICoKKyAqIGlucHV0OiAgcjMgLSBjb250ZW50IG9mIGV1bWJiYXIKKyAqIG91dHB1dDogcjMgLSBJU1IgcmV0dXJuIHZhbHVlCisgKiAgICAgICAgIHI0IC0gSW50ZXJydXB0IHZlY3RvciBudW1iZXIKKyAqIG5vdGU6CisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyAgICAgICAudGV4dAorCSAgIC5hbGlnbiAyCisgICAgICAgLmdsb2JhbCBlcGljX2V4Y2VwdGlvbgorCitlcGljX2V4Y2VwdGlvbjoKKworCS8qLS0tU0FWRSBNQUNISU5FIFNUQVRFIFRPIEEgU1RBQ0sgKi8KKwltdHNwciAgIFNQUkcxLHIxCS8qIFNhdmUgVXNlciBzdGFjayBwb2ludGVyIHRvIF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0UgUkVHSVNURVIgKi8KKwlsaXMJcjUsMHgwMDA2CSAgICAgICAgLyogQnVpbGQgSW50ZXJydXB0IEFja25vd2xlZGdlIFJlZ2lzdGVyCisJCQkJCSAgICAgKiBvZmZzZXQKKwkJCSAgICAgKi8KKwlvcmkJcjUscjUsMHgwMGEwCisJbHdicngJcjcscjUscjYgICAgLyogTG9hZCBpbnRlcnJ1cHQgdmVjdG9yIGludG8gcjcgKi8KKwlzeW5jCisKKwkvKiAtLU1BU0sgT0ZGIEFMTCBCSVRTIEVYQ0VQVCBUSEUgVkVDVE9SICovCisJeG9yCXIzLHIzLHIzCisgICAgeG9yIHI0LHI0LHI0CisJb3IgICAgcjMsIHIzLCByNiAgICAgICAgLyogIGV1bWJiYXIgaW4gcjMgKi8KKwlhbmRpLiByNCxyNywweDAwZmYJLyogTWFzayBvZmYgYml0cywgdmVjdG9yIGluIHI0ICovCisKKyAgICBzdHcgICAgIHI0LDB4MDQocjEpICAgICAvKiBzYXZlIHRoZSB2ZWN0b3IgdmFsdWUgKi8KKworICAgIGxpcyAgICAgcjUsZXBpY0lTUkBoYQorCW9yaSAgICAgcjUscjUsZXBpY0lTUkBsCisJbXRsciAgICByNQorCWJscmwKKworICAgIHhvciAgIHIzMCxyMzAscjMwCisJb3IgICAgcjMwLHIzMCxyMyAgICAgICAgLyogc2F2ZSB0aGUgcjMgd2hpY2ggY29udGFpbnRzIHRoZSByZXR1cm4gdmFsdWUgZnJvbSBlcGljSVNSICovCisKKwkvKiAtLS1SRUFEIElOIFRIRSBFVU1CQVIgUkVHSVNURVIgKi8KKyAgICBsd3ogICAgIHIzLDAocjEpCisgICAgc3luYworCisgICAgbGlzICAgICByNSxlcGljRU9JQGhhCisJb3JpICAgICByNSxyNSxlcGljRU9JQGwKKwltdGxyICAgIHI1CisJYmxybAorCisgICAgeG9yICByMyxyMyxyMworCW9yICAgcjMscjMscjMwICAgICAgICAgICAvKiByZXN0b3JlIHRoZSBJU1IgcmV0dXJuIHZhbHVlICAqLworCisJYmNsciAgICAgMjAsMApkaWZmIC0tZ2l0IGEvYXJjaC9wcGMvY3B1L21wYzgyNHgvZHJpdmVycy9lcGljL2VwaWN1dGlsLlMgYi9hcmNoL3BwYy9jcHUvbXBjODI0eC9kcml2ZXJzL2VwaWMvZXBpY3V0aWwuUwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi40ODc3MDUwCi0tLSAvZGV2L251bGwKKysrIGIvYXJjaC9wcGMvY3B1L21wYzgyNHgvZHJpdmVycy9lcGljL2VwaWN1dGlsLlMKQEAgLTAsMCArMSw1NyBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogY29weXJpZ2h0IEAgTW90b3JvbGEsIDE5OTkKKyAqCisgKgorICogVGhpcyBmaWxlIGNvbnRhaW5zIHR3byBjb21tb25seSB1c2VkCisgKiBsb3dlciBsZXZlbCB1dGlsaXR5IHJvdXRpbmVzLgorICoKKyAqIFRoZSB1dGlsaXR5IHJvdXRpbmVzIGFyZSBhbHNvIGluIG90aGVyCisgKiBLYWhsdWEgZGV2aWNlIGRyaXZlciBsaWJyYXJpZXMuIFRoZQorICogbmVlZCB0byBiZSBsaW5rZWQgaW4gb25seSBvbmNlLgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjaW5jbHVkZSA8cHBjX2FzbS50bXBsPgorI2luY2x1ZGUgPHBwY19kZWZzLmg+CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBmdW5jdGlvbjogbG9hZF9ydW50aW1lX3JlZworICoKKyAqIGlucHV0OiAgcjMgLSB2YWx1ZSBvZiBldW1iYmFyCisgKiAgICAgICAgIHI0IC0gcmVnaXN0ZXIgb2Zmc2V0IGluIGVtYmVkZGVkIHV0aWxpdHkgc3BhY2UKKyAqCisgKiBvdXRwdXQ6IHIzIC0gcmVnaXN0ZXIgY29udGVudAorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgICAudGV4dAorICAgICAgLmFsaWduIDIKKyAgICAgIC5nbG9iYWwgbG9hZF9ydW50aW1lX3JlZworCitsb2FkX3J1bnRpbWVfcmVnOgorCisJCSAgeG9yIHI1LHI1LHI1CisJICBvciAgcjUscjUscjMgICAgICAgLyogc2F2ZSBldW1iYmFyICovCisKKwkgICAgICBsd2JyeAlyMyxyNCxyNQorCSAgICAgIHN5bmMKKworCSAgICAgIGJjbHIgMjAsIDAKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIGZ1bmN0aW9uOiBzdG9yZV9ydW50aW1lX3JlZworICoKKyAqIGlucHV0OiByMyAtIHZhbHVlIG9mIGV1bWJiYXIKKyAqICAgICAgICByNCAtIHJlZ2lzdGVyIG9mZnNldCBpbiBlbWJlZGRlZCB1dGlsaXR5IHNwYWNlCisgKiAgICAgICAgcjUgLSBuZXcgdmFsdWUgdG8gYmUgc3RvcmVkCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisJICAgLnRleHQKKwkgICAuYWxpZ24gMgorCSAgIC5nbG9iYWwgc3RvcmVfcnVudGltZV9yZWcKK3N0b3JlX3J1bnRpbWVfcmVnOgorCisJCSAgeG9yIHIwLHIwLHIwCisKKwkgICAgICBzdHdicnggcjUsICByNCwgcjMKKwkgICAgICBzeW5jCisKKwkJICBiY2xyICAgMjAsMApkaWZmIC0tZ2l0IGEvYXJjaC9wcGMvY3B1L21wYzgyNHgvZHJpdmVycy9lcnJvcnMuaCBiL2FyY2gvcHBjL2NwdS9tcGM4MjR4L2RyaXZlcnMvZXJyb3JzLmgKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMjA3OTRhMgotLS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gorCSAqLworCXVkZWxheSAoMTAwMDApOworCXJldHVybiBpMmNfcmVhZCAoY2hpcCwgMCwgMSwgKHVjaGFyICopICZ0bXAsIDEpOworfQorCisjZW5kaWYgLyogQ09ORklHX0hBUkRfSTJDICovCmRpZmYgLS1naXQgYS9hcmNoL3BwYy9jcHUvbXBjODI0eC9kcml2ZXJzL2kyY19leHBvcnQuaCBiL2FyY2gvcHBjL2NwdS9tcGM4MjR4L2RyaXZlcnMvaTJjX2V4cG9ydC5oCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjYyNjRkMTgKLS0tIC9kZXYvbnVsbAorKysgYi9hcmNoL3BwYy9jcHUvbXBjODI0eC9kcml2ZXJzL2kyY19leHBvcnQuaApAQCAtMCwwICsxLDEwMyBAQAorI2lmbmRlZiBJMkNfRVhQT1JUX0gKKyNkZWZpbmUgSTJDX0VYUE9SVF9ICisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogQ29weXJpZ2h0IE1vdHJvbGEgMTk5OQorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKiBUaGVzZSBhcmUgdGhlIGRlZmluZWQgcmV0dXJuIHZhbHVlcyBmb3IgdGhlIEkyQ19kb190cmFuc2FjdGlvbiBmdW5jdGlvbi4KKyAqIEFueSBub24temVybyB2YWx1ZSBpbmRpY2F0ZXMgZmFpbHVyZS4gIEZhaWx1cmUgbW9kZXMgY2FuIGJlIGFkZGVkIGZvcgorICogbW9yZSBkZXRhaWxlZCBlcnJvciByZXBvcnRpbmcuCisgKi8KK3R5cGVkZWYgZW51bSBfaTJjX3N0YXR1cworeworIEkyQ19TVUNDRVNTICAgICA9IDAsCisgSTJDX0VSUk9SLAorfSBJMkNfU3RhdHVzOworCisvKiBUaGVzZSBhcmUgdGhlIGRlZmluZWQgdGFza3MgZm9yIEkyQ19kb190c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yb2tlbiBhdCB0aGUgbW9tZW50IGFuZCBJIGN1cnJlbnRseSBkb24ndCBuZWVkCisJICogaW50ZXJydXB0cy4gSWYgeW91IHdhbnQgdG8gZml4IGl0LCBoYXZlIGEgbG9vayBhdCB0aGUgZXBpYworCSAqIGRyaXZlcnMgaW4gZGluazMyIHYxMi4gVGhleSBkbyBldmVydGhpbmcgYW5kIE1vdG9yb2xhIHNhaWQKKwkgKiBJIGNvdWxkIHVzZSB0aGUgZGluayBzb3VyY2UgaW4gdGhpcyBwcm9qZWN0IGFzIGxvbmcgYXMKKwkgKiBjb3B5cmlnaHQgbm90aWNlcyByZW1haW4gaW50YWN0LgorCSAqLworCisJZXBpY0luaXQgKEVQSUNfRElSRUNUX0lSUSwgMCk7CisJLyogRVBJQyB3b24ndCBnZW5lcmF0ZSBJTlQgdW5sZXNzIEN1cnJlbnQgVGFzayBQcmkgPCAxNSAqLworCWVwaWNDdXJUYXNrUHJpb1NldCgwKTsKKworCXJldHVybiAoMCk7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKgorICogSGFuZGxlIGV4dGVybmFsIGludGVycnVwdHMKKyAqLwordm9pZCBleHRlcm5hbF9pbnRlcnJ1cHQgKHN0cnVjdCBwdF9yZWdzICpyZWdzKQoreworCXJlZ2lzdGVyIHVuc2lnbmVkIGxvbmcgdGVtcDsKKworCXBjaV9yZWFkbCAoQ09ORklHX1NZU19FVU1CX0FERFIgKyBFUElDX1BST0NfSU5UX0FDS19SRUcsIHRlbXApOworCXN5bmMgKCk7CQkJCQkvKiBpJ20gbm90IGNvbnZpbmNlZCB0aGlzIGlzIG5lZWRlZCwgYnV0IGRpbmsgc291cmNlIGhhcyBpdCAqLworCXRlbXAgJj0gMHhmZjsJCQkJLypnZXQgdmVjdG9yICovCisKKwkvKlRPRE86IGhhbmRsZSB0aGVtIC0uLi4gKi8KKwllcGljRU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W5zZQorICogYWxvbmcgd2l0aCB0aGlzIHByb2dyYW07IGlmIG5vdCwgd3JpdGUgdG8gdGhlIEZyZWUgU29mdHdhcmUKKyAqIEZvdW5kYXRpb24sIEluYy4sIDU5IFRlbXBsZSBQbGFjZSwgU3VpdGUgMzMwLCBCb3N0b24sCisgKiBNQSAwMjExMS0xMzA3IFVTQQorICovCisKK09VVFBVVF9BUkNIKHBvd2VycGMpCisvKiBEbyB3ZSBuZWVkIGFueSBvZiB0aGVzZSBmb3IgZWxmPworICAgX19EWU5BTUlDID0gMDsgICAgKi8KK1NFQ1RJT05TCit7CisgIC8qIFJlYWQtb25seSBzZWN0aW9ucywgbWVyZ2VkIGludG8gdGV4dCBzZWdtZW50OiAqLworICAuID0gKyBTSVpFT0ZfSEVBREVSUzsKKyAgLmludGVycCA6IHsgKiguaW50ZXJwKSB9CisgIC5oYXNoICAgICAgICAgIDogeyAqKC5oYXNoKQkJfQorICAuZHluc3ltICAgICAgICA6IHsgKiguZHluc3ltKQkJfQorICAuZHluc3RyICAgICAgICA6IHsgKiguZHluc3RyKQkJfQorICAucmVsLnRleHQgICAgICA6IHsgKigucmVsLnRleHQpCQl9CisgIC5yZWxhLnRleHQgICAgIDogeyAqKC5yZWxhLnRleHQpCX0KKyAgLnJlbC5kYXRhICAgICAgOiB7ICooLnJlbC5kYXRhKQkJfQorICAucmVsYS5kYXRhICAgICA6IHsgKigucmVsYS5kYXRhKQl9CisgIC5yZWwucm9kYXRhICAgIDogeyAqKC5yZWwucm9kYXRhKQl9CisgIC5yZWxhLnJvZGF0YSAgIDogeyAqKC5yZWxhLnJvZGF0YSkJfQorICAucmVsLmdvdCAgICAgICA6IHsgKigucmVsLmdvdCkJCX0KKyAgLnJlbGEuZ290ICAgICAgOiB7ICooLnJlbGEuZ290KQkJfQorICAucmVsLmN0b3JzICAgICA6IHsgKigucmVsLmN0b3JzKQl9CisgIC5yZWxhLmN0b3JzICAgIDogeyAqKC5yZWxhLmN0b3JzKQl9CisgIC5yZWwuZHRvcnMgICAgIDogeyAqKC5yZWwuZHRvcnMpCX0KKyAgLnJlbGEuZHRvcnMgICAgOiB7ICooLnJlbGEuZHRvcnMpCX0KKyAgLnJlbC5ic3MgICAgICAgOiB7ICooLnJlbC5ic3MpCQl9CisgIC5yZWxhLmJzcyAgICAgIDogeyAqKC5yZWxhLmJzcykJCX0KKyAgLnJlbC5wbHQgICAgICAgOiB7ICooLnJlbC5wbHQpCQl9CisgIC5yZWxhLnBsdCAgICAgIDogeyAqKC5yZWxhLnBsdCkJCX0KKyAgLmluaXQgICAgICAgICAgOiB7ICooLmluaXQpCX0KKyAgLnBsdCA6IHsgKigucGx0KSB9CisgIC50ZXh0ICAgICAgOgorICB7CisgICAgYXJjaC9wcGMvY3B1L21wYzgyNHgvc3RhcnQubwkJKC50ZXh0KQorICAgICooLnRleHQpCisgICAgKiguZ290MSkKKyAgICAuID0gQUxJR04oMTYpOworICAgICooLmVoX2ZyYW1lKQorICAgICooU09SVF9CWV9BTElHTk1FTlQoU09SVF9CWV9OQU1FKC5yb2RhdGEqKSkpCisgIH0KKyAgLmZpbmkgICAgICA6IHsgKiguZmluaSkgICAgfSA9MAorICAuY3RvcnMgICAgIDogeyAqKC5jdG9ycykgICB9CisgIC5kdG9ycyAgICAgOiB7ICooLmR0b3JzKSAgIH0KKworICAvKiBSZWFkLXdyaXRlIHNlY3Rpb24sIG1lcmdlZCBpbnRvIGRhdGEgc2VnbWVudDogKi8KKyAgLiA9ICguICsgMHgwRkZGKSAmIDB4RkZGRkYwMDA7CisgIF9lcm90ZXh0ID0gLjsKKyAgUFJPVklERSAoZXJvdGV4dCA9IC4pOworICAucmVsb2MgICA6CisgIHsKKyAgICAqKC5nb3QpCisgICAgX0dPVDJfVEFCTEVfID0gLjsKKyAgICAqKC5nb3QyKQorICAgIF9GSVhVUF9UQUJMRV8gPSAuOworICAgICooLmZpeHVwKQorICB9CisgIF9fZ290Ml9lbnRyaWVzID0gKF9GSVhVUF9UQUJMRV8gLSBfR09UMl9UQUJMRV8pID4+IDI7CisgIF9fZml4dXBfZW50cmllcyA9ICguIC0gX0ZJWFVQX1RBQkxFXykgPj4gMjsKKworICAuZGF0YSAgICA6CisgIHsKKyAgICAqKC5kYXRhKQorICAgICooLmRhdGExKQorICAgICooLnNkYXRhKQorICAgICooLnNkYXRhMikKKyAgICAqKC5keW5hbWljKQorICAgIENPTlNUUlVDVE9SUworICB9CisgIF9lZGF0YSAgPSAgLjsKKyAgUFJPVklERSAoZWRhdGEgPSAuKTsKKworICAuID0gLjsKKyAgX191X2Jvb3RfY21kX3N0YXJ0ID0gLjsKKyAgLnVfYm9vdF9jbWQgOiB7ICooLnVfYm9vdF9jbWQpIH0KKyAgX191X2Jvb3RfY21kX2VuZCA9IC47CisKKworICAuID0gLjsKKyAgX19zdGFydF9fX2V4X3RhYmxlID0gLjsKKyAgX19leF90YWJsZSA6IHsgKihfX2V4X3RhYmxlKSB9CisgIF9fc3RvcF9fX2V4X3RhYmxlID0gLjsKKworICAuID0gQUxJR04oNDA5Nik7CisgIF9faW5pdF9iZWdpbiA9IC47CisgIC50ZXh0LmluaXQgOiB7ICooLnRleHQuaW5pdCkgfQorICAuZGF0YS5pbml0IDogeyAqKC5kYXRhLmluaXQpIH0KKyAgLiA9IEFMSUdOKDQwOTYpOworICBfX2luaXRfZW5kID0gLjsKKworICBfX2Jzc19zdGFydCA9IC47CisgIC5ic3MgKE5PTE9BRCkgICAgICAgOgorICB7CisgICAqKC5zYnNzKSAqKC5zY29tbW9uKQorICAgKiguZHluYnNzKQorICAgKiguYnNzKQorICAgKihDT01NT04pCisgICAuID0gQUxJR04oNCk7CisgIH0KKyAgX2VuZCA9IC4gOworICBQUk9WSURFIChlbmQgPSAuKTsKK30KZGlmZiAtLWdpdCBhL2FyY2gvcHBjL2NwdS9tcGM4MjYwL01ha2VmaWxlIGIvYXJjaC9wcGMvY3B1L21wYzgyNjAvTWFrZWZpbGUKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5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M2Vfc2V0OworICBidWdfY3R4LmNsZWFyICAgICAgPSBiZWRidWc2MDNlX2NsZWFyOworCisgIGZvciggaSA9IDE7IGkgPD0gTUFYX0JSRUFLX1BPSU5UUzsgKytpICkKKyAgICAoKmJ1Z19jdHguY2xlYXIpKCBpICk7CisKKyAgcHV0cyAoIkJFREJVRzpyZWFkeVxuIik7CisgIHJldHVybjsKK30gLyogYmVkYnVnX2luaXRfYnJlYWtwb2ludHMgKi8KKworCisMCisvKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBTZXQvY2xlYXIvc2hvdyB0aGUgaGFyZHdhcmUgYnJlYWtwb2ludCBmb3IgdGhlIDYwM2UuICBUaGUgIm9mZiIKKyAqIHN0cmluZyB3aWxsIGRpc2FibGUgYSBzcGVjaWZpYyBicmVha3BvaW50LiAgVGhlICJzaG93IiBzdHJpbmcgd2lsbAorICogZGlzcGxheSB0aGUgY3VycmVudCBicmVha3BvaW50cy4gIE90aGVyd2lzZSBhbiBhZGRyZXNzIHdpbGwgc2V0IGEKKyAqIGJyZWFrcG9pbnQgYXQgdGhhdCBhZGRyZXNzLiAgU2V0dGluZyBhIGJyZWFrcG9pbnQgdXNlcyB0aGUgQ1BVLXNwZWNpZmljCisgKiBzZXQgcm91dGluZSB3aGljaCB3aWxsIGFzc2lnbiBhIGJyZWFrcG9pbnQgbnVtYmVyLgorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworCit2b2lkIGJlZGJ1ZzYwM2VfZG9fYnJlYWsgKGNtZF90YmxfdCAqY21kdHAsIGludCBmbGFnLCBpbnQgYXJnYywKKwkJCSBjaGFyICphcmd2W10pCit7CisgIGxvbmcJCWFkZHI7ICAgICAgICAgICAvKiBBZGRyZXNzIHRvIGJyZWFrIGF0ICAqLworICBpbnQJCXdoaWNoX2JwOyAgICAgICAvKiBCcmVha3BvaW50IG51bWJlciAgICAqLworICAvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworCisgIGlmIChhcmdjIDwgMikKKyAgeworICAgIGNtZF91c2FnZShjbWR0cCk7CisgICAgcmV0dXJuOworICB9CisKKyAgLyogVHVybiBvZmYgYSBicmVha3BvaW50ICovCisKKyAgaWYoIHN0cmNtcCggYXJndlsgMSBdLCAib2ZmIiApID09IDAgKQorICB7CisgICAgaWYoIGJ1Z19jdHguaHdfZGVidWdfZW5hYmxlZCA9PSAwICkKKyAgICB7CisgICAgICBwdXRzICggIk5vIGJyZWFrcG9pbnRzIGVuYWJsZWRcbiIgKTsKKyAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICB3aGljaF9icCA9IHNpbXBsZV9zdHJ0b3VsKCBhcmd2WyAyIF0sIE5VTEwsIDEwICk7CisKKyAgICBpZiggYnVnX2N0eC5jbGVhciApCisgICAgICAoKmJ1Z19jdHguY2xlYXIpKCB3aGljaF9icCApOworCisgICAgcHJpbnRmKCAiQnJlYWtwb2ludCAlZCByZW1vdmVkXG4iLCB3aGljaF9icCApOworICAgIHJldHVybjsKKyAgfQorCisgIC8qIFNob3cgYSBsaXN0IG9mIGJyZWFrcG9pbnRzICovCisKKyAgaWYoIHN0cmNtcCggYXJndlsgMSBdLCAic2hvdyIgKSA9PSAwICkKKyAgeworICAgIGZvciggd2hpY2hfYnAgPSAxOyB3aGljaF9icCA8PSBNQVhfQlJFQUtfUE9JTlRTOyArK3doaWNoX2JwICkKKyAgICB7CisKKyAgICAgIGFkZHIgPSBHRVRfSUFCUigpOworCisgICAgICBwcmludGYoICJCcmVha3BvaW50IFslZF06ICIsIHdoaWNoX2JwICk7CisgICAgICBpZiggKGFkZHIgJiAweDAwMDAwMDAyKSA9PSAwICkKKwlwdXRzICggIk5PVCBTRVRcbiIgKTsKKyAgICAgIGVsc2UKKwlkaXNwcGMoICh1bnNpZ25lZCBjaGFyICopKGFkZHIgJiAweEZGRkZGRkZDKSwgMCwgMSwgYmVkYnVnX3B1dHMsIEZfUkFESEVYICk7CisgICAgfQorICAgIHJldHVybjsKKyAgfQorCisgIC8qIFNldCBhIGJyZWFrcG9pbnQgYXQgdGhlIGFkZHJlc3MgKi8KKworICBpZighKCggaXNkaWdpdCggYXJndlsgMSBdWyAwIF0gKSkgfHwKKwkoKCBhcmd2WyAxIF1bIDAgXSA+PSAnYScgKSAmJiAoIGFyZ3ZbIDEgXVsgMCBdIDw9ICdmJyApKSB8fAorCSgoIGFyZ3ZbIDEgXVsgMCBdID49ICdBJyApICYmICggYXJndlsgMSBdWyAwIF0gPD0gJ0YnICkpKSkKKyAgeworICAgIGNtZF91c2FnZShjbWR0cCk7CisgICAgcmV0dXJuOworICB9CisKKyAgYWRkciA9IHNpbXBsZV9zdHJ0b3VsKCBhcmd2WyAxIF0sIE5VTEwsIDE2ICk7CisKKyAgaWYoKCBidWdfY3R4LnNldCApICYmICggd2hpY2hfYnAgPSAoKmJ1Z19jdHguc2V0KSggMCwgYWRkciApKSA+IDAgKQorICB7CisgICAgcHJpbnRmKCAiQnJlYWtwb2ludCBbJWRdOiAiLCB3aGljaF9icCApOworICAgIGRpc3BwYyggKHVuc2lnbmVkIGNoYXIgKilhZGRyLCAwLCAxLCBiZWRidWdfcHV0cywgRl9SQURIRVggKTsKKyAgfQorCisgIHJldHVybjsKK30gLyogYmVkYnVnNjAzZV9kb19icmVhayAqLworCisKKwwKKy8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIEhhbmRsZSBhIGJyZWFrcG9pbnQuICBFbnRlciBhIG1pbmkgbWFpbiBsb29wLiAgU3RheSBpbiB0aGUgbG9vcCB1bnRpbAorICogdGhlIHN0b3BwZWQgZmxhZyBpbiB0aGUgZGVidWcgY29udGV4dCBpcyBjbGVhcmVkLgorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworCit2b2lkIGJlZGJ1ZzYwM2VfYnJlYWtfaXNyKCBzdHJ1Y3QgcHRfcmVncyAqcmVncyApCit7CisgIHVuc2lnbmVkIGxvbmcJYWRkcjsgICAgICAgICAgIC8qIEFkZHJlc3Mgc3RvcHBlZCBhdCAgICovCisgIC8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisKKyAgYnVnX2N0eC5jdXJyZW50X2JwID0gMTsKKyAgYWRkciA9IEdFVF9JQUJSKCkgJiAweEZGRkZGRkZDOworCisgIGJlZGJ1Z19tYWluX2xvb3AoIGFkZHIsIHJlZ3MgKTsKKyAgcmV0dXJuOworfSAvKiBiZWRidWc2MDNlX2JyZWFrX2lzciAqLworCisKKwwKKy8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIFNlZSBpZiB0aGUgaGFyZHdhcmUgYnJlYWtwb2ludCBpcyBhdmFpbGFibGUuCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCisKK2ludCBiZWRidWc2MDNlX2ZpbmRfZW1wdHkoIHZvaWQgKQoreworICAvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworCisgIGlmKCAoR0VUX0lBQlIoKSAmJiAweDAwMDAwMDAyKSA9PSAwICkKKyAgICByZXR1cm4gMTsKKworICByZXR1cm4gMDsKK30gLyogYmVkYnVnNjAzZV9maW5kX2VtcHR5ICovCisKKworDAorLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogU2V0IGEgYnJlYWtwb2ludC4gIElmICd3aGljaF9icCcgaXMgemVybyB0aGVuIGZpbmQgYW4gdW51c2VkIGJyZWFrcG9pbnQKKyAqIG51bWJlciwgb3RoZXJ3aXNlIHJlYXNzaWduIHRoZSBnaXZlbiBicmVha3BvaW50LiAgSWYgaGFyZHdhcmUgZGVidWdnaW5nCisgKiBpcyBub3QgZW5hYmxlZCwgdGhlbiB0dXJuIGl0IG9uIHZpYSB0aGUgTVNSIGFuZCBEQkNSMC4gIFNldCB0aGUgYnJlYWsKKyAqIGFkZHJlc3MgaW4gdGhlIElBQlIgcmVnaXN0ZXIuCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCisKK2ludCBiZWRidWc2MDNlX3NldCggaW50IHdoaWNoX2JwLCB1bnNpZ25lZCBsb25nIGFkZHIgKQoreworICAvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworCisgIGlmKCggYWRkciAmIDB4MDAwMDAwMDMgKSAhPSAwICkKKyAgeworICAgIHB1dHMgKCAiQnJlYWtwb2ludHMgbXVzdCBiZSBvbiBhIDMyIGJpdCBib3VuZGFyeVxuIiApOworICAgIHJldHVybiAwOworICB9CisKKyAgLyogT25seSBsb29rIGlmIHdoaWNoX2JwID09IDAsIGVsc2UgdXNlIHdoaWNoX2JwICovCisgIGlmKCggYnVnX2N0eC5maW5kX2VtcHR5ICkgJiYgKCAhd2hpY2hfYnAgKSAmJgorICAgICAoIHdoaWNoX2JwID0gKCpidWdfY3R4LmZpbmRfZW1wdHkpKCkpID09IDAgKQorICB7CisgICAgcHV0cyAoICJBbGwgYnJlYWtwb2ludHMgaW4gdXNlXG4iICk7CisgICAgcmV0dXJuIDA7CisgIH0KKworICBpZiggd2hpY2hfYnAgPCAxIHx8IHdoaWNoX2JwID4gTUFYX0JSRUFLX1BPSU5UUyApCisgIHsKKyAgICBwcmludGYoICJJbnZhbGlkIGJyZWFrIHBvaW50ICMgJWRcbiIsIHdoaWNoX2JwICk7CisgICAgcmV0dXJuIDA7CisgIH0KKworICBpZiggISBidWdfY3R4Lmh3X2RlYnVnX2VuYWJsZWQgKQorICB7CisgICAgYnVnX2N0eC5od19kZWJ1Z19lbmFibGVkID0gMTsKKyAgfQorCisgIFNFVF9JQUJSKCBhZGRyIHwgMHgwMDAwMDAwMiApOworCisgIHJldHVybiB3aGljaF9icDsKK30gLyogYmVkYnVnNjAzZV9zZXQgKi8KKworCisMCisvKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBEaXNhYmxlIGEgc3BlY2lmaWMgYnJlYWtvaW50IGJ5IHNldHRpbmcgdGhlIElBQlIgcmVnaXN0ZXIgdG8gemVyby4KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KKworaW50IGJlZGJ1ZzYwM2VfY2xlYXIoIGludCB3aGljaF9icCApCit7CisgIC8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisKKyAgaWYoIHdoaWNoX2JwIDwgMSB8fCB3aGljaF9icCA+IE1BWF9CUkVBS19QT0lOVFMgKQorICB7CisgICAgcHJpbnRmKCAiSW52YWxpZCBicmVhayBwb2ludCAjICglZClcbiIsIHdoaWNoX2JwICk7CisgICAgcmV0dXJuIC0xOworICB9CisKKyAgU0VUX0lBQlIoIDAgKTsKKworICByZXR1cm4gMDsKK30gLyogYmVkYnVnNjAzZV9jbGVhciAqLworCisKKy8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KKyNlbmRpZgp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uXAorMToJcmx3bm0uCSUyLCUxLCU0LDMxLDMxXG5cCisJYmVxCTJmXG5cCisJYWRkaQklMCwlMCwxXG5cCisyOglzdWJpCSU0LCU0LDFcblwKKwliZG56CTFiIgorCTogIj1yIihjbnQpCisJOiAiciIodmFsdWUpLCAiciIobmJpdHMpLCAiciIoY250KSwgInIiKHBvcykKKwk6ICJjdHIiLCAiY2MiICk7CisjZWxzZQorCXVpbnQgbWFzayA9IDE7CisKKwlkbyB7CisJCWlmICh2YWx1ZSAmIG1hc2spCisJCQljbnQrKzsKKwkJbWFzayA8PD0gMTsKKwl9IHdoaWxlICgtLW5iaXRzKTsKKyNlbmRpZgorCisJcmV0dXJuIChjbnQpOworfQorCitzdGF0aWMgdWxvbmcKK2JhZGJpdHMgKHVjaGFyICpicCwgaW50IG4sIHVsb25nIHBhdCkKK3sKKwl1bG9uZyAqbHAsIGNudCA9IDA7CisJaW50IG5sOworCisJd2hpbGUgKG4gPiAwICYmICgodWxvbmcpYnAgJiAoc2l6ZW9mICh1bG9uZykgLSAxKSkgIT0gMCkgeworCQl1Y2hhciBkaWZmOworCisJCWRpZmYgPSAqYnArKyBeICh1Y2hhcilwYXQ7CisKKwkJaWYgKGRpZmYpCisJCQljbnQgKz0gbmJzICgodWxvbmcpZGlmZiwgOCk7CisKKwkJbi0tOworCX0KKworCWxwID0gKHVsb25nICopYnA7CisJbmwgPSBuIC8gc2l6ZW9mICh1bG9uZyk7CisJbiAtPSBubCAqIHNpemVvZiAodWxvbmcpOworCisJd2hpbGUgKG5sID4gMCkgeworCQl1bG9uZyBkaWZmOworCisJCWRpZmYgPSAqbHArKyBeIHBhdDsKKworCQlpZiAoZGlmZikKKwkJCWNudCArPSBuYnMgKGRpZmYsIDMyKTsKKworCQlubC0tOworCX0KKworCWJwID0gKHVjaGFyICopbHA7CisKKwl3aGlsZSAobiA+IDApIHsKKwkJdWNoYXIgZGlmZjsKKworCQlkaWZmID0gKmJwKysgXiAodWNoYXIpcGF0OworCisJCWl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BsYXllcnMuICovCisJICAgIE5ldFJlY2VpdmUoTmV0UnhQYWNrZXRzW3J4SWR4XSwgbGVuZ3RoIC0gNCk7CisJfQorCisKKwkvKiBHaXZlIHRoZSBidWZmZXIgYmFjayB0byB0aGUgU0NDLiAqLworCXJ0eC0+cnhiZFtyeElkeF0uY2JkX2RhdGxlbiA9IDA7CisKKwkvKiB3cmFwIGFyb3VuZCBidWZmZXIgaW5kZXggd2hlbiBuZWNlc3NhcnkgKi8KKwlpZiAoKHJ4SWR4ICsgMSkgPj0gUEtUQlVGU1JYKSB7CisJICAgIHJ0eC0+cnhiZFtQS1RCVUZTUlggLSAxXS5jYmRfc2MgPSAoQkRfRU5FVF9SWF9XUkFQIHwKKwkJCQkJICAgICAgIEJEX0VORVRfUlhfRU1QVFkpOworCSAgICByeElkeCA9IDA7CisJfQorCWVsc2UgeworCSAgICBydHgtPnJ4YmRbcnhJZHhdLmNiZF9zYyA9IEJEX0VORVRfUlhfRU1QVFk7CisJICAgIHJ4SWR4Kys7CisJfQorICAgIH0KKyAgICByZXR1cm4gbGVuZ3RoOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBTQ0MgRXRoZXJuZXQgSW5pdGlhbGl6YXRpb24gUm91dGluZQorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgaW50IHNlY19pbml0KHN0cnVjdCBldGhfZGV2aWNlICpkZXYsIGJkX3QgKmJpcykKK3sKKyAgICBpbnQgaTsKKyAgICB2b2xhdGlsZSBpbW1hcF90ICppbW1yID0gKGltbWFwX3QgKilDT05GSUdfU1lTX0lNTVI7CisgICAgc2NjX2VuZXRfdCAqcHJhbV9wdHI7CisgICAgdWludCBkcGFkZHI7CisgICAgdWNoYXIgZWFbNl07CisKKyAgICByeElkeCA9IDA7CisgICAgdHhJZHggPSAw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yW3dvcmRdID0gMSA8PCAoMzEgLSBiaXQpOworfQorCitzdGF0aWMgaW50IG04MjYwX2dldF9pcnEgKHN0cnVjdCBwdF9yZWdzICpyZWdzKQoreworCXZvbGF0aWxlIGltbWFwX3QgKmltbXIgPSAoaW1tYXBfdCAqKSBDT05GSUdfU1lTX0lNTVI7CisJaW50IGlycTsKKwl1bnNpZ25lZCBsb25nIGJpdHM7CisKKwkvKiBGb3IgTVBDODI2MCwgcmVhZCB0aGUgU0lWRUMgcmVnaXN0ZXIgYW5kIHNoaWZ0IHRoZSBiaXRzIGRvd24KKwkgKiB0byBnZXQgdGhlIGlycSBudW1iZXIuICAgICAgICAgKi8KKwliaXRzID0gaW1tci0+aW1faW50Y3RsLmljX3NpdmVjOworCWlycSA9IGJpdHMgPj4gMjY7CisJcmV0dXJuIGlycTsKK30KKworLyogZW5kIG9mIGNvZGUgcmlwcGVkIG91dCBvZiBhcmNoL3BwYy9rZXJuZWwvcHBjODI2MF9waWMuYwkJICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworaW50IGludGVycnVwdF9pbml0X2NwdSAodW5zaWduZWQgKmRlY3JlbWVudGVyX2NvdW50KQoreworCXZvbGF0aWxlIGltbWFwX3QgKmltbXIgPSAoaW1tYXBfdCAqKSBDT05GSUdfU1lTX0lNTVI7CisKKwkqZGVjcmVtZW50ZXJfY291bnQgPSAoZ2QtPmJ1c19jbGsgLyA0KSAvIENPTkZJR19TWVNfSFo7CisKKwkvKiBJbml0aWFsaXplIHRoZSBkZWZhdWx0IGludGVycnVwdCBtYXBwaW5nIHByaW9yaXRpZXMgKi8KKwlpbW1yLT5pbV9pbnRjdGwuaWNfc2ljciA9IDA7CisJaW1tci0+aW1faW50Y3RsLmljX3NpcHJyID0gMHgwNTMwOTc3MDsKKwlpbW1yLT5pbV9pbnRjdGwuaWNfc2NwcnJoID0gMHgwNTMwOT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pcnFdLmFyZyA9IGFyZzsKKworCW04MjYwX3VubWFza19pcnEgKGlycSk7Cit9CisKK3ZvaWQgaXJxX2ZyZWVfaGFuZGxlciAoaW50IGlycSkKK3sKKwlpZiAoaXJxIDwgMCB8fCBpcnEgPj0gTlJfSVJRUykgeworCQlwcmludGYgKCJpcnFfZnJlZV9oYW5kbGVyOiBiYWQgaXJxIG51bWJlciAlZFxuIiwgaXJxKTsKKwkJcmV0dXJuOworCX0KKworCW04MjYwX21hc2tfaXJxIChpcnEpOworCisJaXJxX2hhbmRsZXJzW2lycV0uaGFuZGxlciA9IE5VTEw7CisJaXJxX2hhbmRsZXJzW2lycV0uYXJnID0gTlVMTDsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3ZvaWQgdGltZXJfaW50ZXJydXB0X2NwdSAoc3RydWN0IHB0X3JlZ3MgKnJlZ3MpCit7CisJLyogbm90aGluZyB0byBkbyBoZXJlICovCisJcmV0dXJuOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI2lmIGRlZmluZWQoQ09ORklHX0NNRF9JUlEpCisKKy8qIHJpcHBlZCB0aGlzIG91dCBvZiBwcGM0eHgvaW50ZXJydXB0cy5jICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqIGlycWluZm8gLSBwcmludCBpbmZvcm1hdGlvbiBhYm91dCBQQ0kgZGV2aWNlcworKgorKi8KK3ZvaWQKK2RvX2lycWluZm8gKGNtZF90YmxfdCAqIGNtZHRwLCBiZF90ICogYmQsIGludCBmbGFnLCBpbnQgYXJnYywgY2hhciAqYXJndltdKQoreworCWludCBpcnEsIHJlX2VuYWJsZTsKKworCXJlX2V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lBQkNERUYiOworCitzdGF0aWMgY2hhciBxdWlja2hleCAoaW50IGkpCit7CisJcmV0dXJuIGhleF9kaWdpdFtpXTsKK30KKworc3RhdGljIHZvaWQgbWVtZHVtcCAodm9pZCAqcHYsIGludCBudW0pCit7CisJaW50IGk7CisJdW5zaWduZWQgY2hhciAqcGMgPSAodW5zaWduZWQgY2hhciAqKSBwdjsKKworCWZvciAoaSA9IDA7IGkgPCBudW07IGkrKykKKwkJcHJpbnRmICgiJWMlYyAiLCBxdWlja2hleCAocGNbaV0gPj4gNCksIHF1aWNraGV4IChwY1tpXSAmIDB4MGYpKTsKKwlwcmludGYgKCJcdCIpOworCWZvciAoaSA9IDA7IGkgPCBudW07IGkrKykKKwkJcHJpbnRmICgiJWMiLCBpc3ByaW50IChwY1tpXSkgPyBwY1tpXSA6ICcuJyk7CisJcHJpbnRmICgiXG4iKTsKK30KKyNlbHNlCS8qICFERUJVRyAqLworCisjZGVmaW5lCURQUklOVChhKQorCisjZW5kaWYJLyogREVCVUcgKi8KKworLyogLS0tLS0tLS0tLS0tLS0tLS0tLQorICogRnVuY3Rpb24gcHJvdG90eXBlcworICogLS0tLS0tLS0tLS0tLS0tLS0tLSAqLwordm9pZCBzcGlfaW5pdCAodm9pZCk7CisKK3NzaXplX3Qgc3BpX3JlYWQgKHVjaGFyICosIGludCwgdWNoYXIgKiwgaW50KTsKK3NzaXplX3Qgc3BpX3dyaXRlICh1Y2hhciAqLCBpbnQsIHVjaGFyICosIGludCk7Citzc2l6ZV90IHNwaV94ZmVyIChzaXplX3QpOworCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tCisgKiBWYXJpYWJsZXMKKyAqIC0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKworI2RlZmluZSBNQVhfQlVGRkVSCTB4MTA0CisKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAqIEluaXRpYWxseSB3ZSBwbGFjZSB0aGUgUlggYW5kIFRYIGJ1ZmZlcnMgYXQgYSBmaXhlZCBsb2NhdGlvbiBpbiBEUFJBTSEKKyAqIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KK3N0YXRpYyB1Y2hhciAqcnhidWYgPQorICAodWNoYXIgKikmKChpbW1hcF90ICopQ09ORklHX1NZU19JTU1SKS0+aW1fZHByYW1iYXNlCisJCQlbQ09ORklHX1NZU19TUElfSU5JVF9PRkZTRVRdOworc3RhdGljIHVjaGFyICp0eGJ1ZiA9CisgICh1Y2hhciAqKSYoKGltbWFwX3QgKilDT05GSUdfU1lTX0lNTVIpLT5pbV9kcHJhbWJhc2UKKwkJCVtDT05GSUdfU1lTX1NQSV9JTklUX09GRlNFVCtNQVhfQlVGRkVSXTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiAgRnVuY3Rpb246ICAgIHNwaV9pbml0X2YKKyAqCisgKiAgRGVzY3JpcHRpb246IEluaXQgU1BJLUNvbnRyb2xsZXIgKFJPTSBwYXJ0KQorICoKKyAqICByZXR1cm46ICAgICAgLS0tCisgKgorICogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KK3ZvaWQgc3BpX2luaXRfZiAodm9pZCkKK3sKKwl1bnNpZ25lZCBpbnQgZHBhZGRyOworCisJdm9sYXRpbGUgc3BpX3QgKnNwaTsKKwl2b2xhdGlsZSBpbW1hcF90ICppbW1yOworCXZvbGF0aWxlIGNwbTgyNjBfdCAqY3A7CisJdm9sYXRpbGUgY2JkX3QgKnRiZGYsICpyYmRmOworCisJaW1tciA9IChpbW1hcF90ICopICBDT05GS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X0VNUFRZOworCisJLyogU2V0IHRoZSBiZCdzIHJ4IGFuZCB0eCBidWZmZXIgYWRkcmVzcyBwb2ludGVycyAqLworCXJiZGYtPmNiZF9idWZhZGRyID0gKHVsb25nKSByeGJ1ZjsKKwl0YmRmLT5jYmRfYnVmYWRkciA9ICh1bG9uZykgdHhidWY7CisKKy8qIDEwICsgMTEgKi8KKwlpbW1yLT5pbV9zcGkuc3BpX3NwaWUgPSBTUElfRU1BU0s7CQkvKiBDbGVhciBhbGwgU1BJIGV2ZW50cwkqLworCWltbXItPmltX3NwaS5zcGlfc3BpbSA9IDB4MDA7CQkJLyogTWFzayAgYWxsIFNQSSBldmVudHMgKi8KKworCisJcmV0dXJuOworfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqICBGdW5jdGlvbjogICAgc3BpX2luaXRfcgorICoKKyAqICBEZXNjcmlwdGlvbjogSW5pdCBTUEktQ29udHJvbGxlciAoUkFNIHBhcnQpIC0KKyAqCQkgVGhlIG1hbGxvYyBlbmdpbmUgaXMgcmVhZHkgYW5kIHdlIGNhbiBtb3ZlIG91ciBidWZmZXJzIHRvCisgKgkJIG5vcm1hbCBSQU0KKyAqCisgKiAgcmV0dXJuOiAgICAgIC0tLQorICoKKyAqICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCit2b2lkIHNwaV9pbml0X3IgKHZvaWQpCit7CisJdm9sYXRpbGUgc3BpX3QgKnNwaTsKKwl2b2xhdGlsZSBpbW1hcF90ICppbW1yOworCXZvbGF0aWxlIGNwbTgyNjBfdCAqY3A7CisJdm9sYXRpbGUgY2JkX3QgKnRiZGYsICpyYmRmOworCisJaW1tciA9IChpbW1hcF90ICopICBDT05GSUdfU1lTX0lNTVI7CisJY3AgICA9IChjcG04MjYwX3QgKikgJmltbXItPmltX2NwbTsKKworCXNwaSAgPSAoc3BpX3QgKikmaW1tci0+aW1fZHByYW1iYXNlW1BST0ZGX1NQSV07CisKKwkvKiB0eCBhbmQgcnggYnVmZmVyIGRlc2NyaXB0b3JzICovCisJdGJkZiA9IChjYmRfdCAqKSAmIGltbXItPmltX2RwcmFtYmFzZVtzcGktPnNwaV90YmFzZV07CisJcmJkZiA9IChjYmRfdCAqKSAmIGltbXItPmltX2RwcmFtYmFzZVtzcGktPnNwaV9yYmFzZV07CisKKwkvKiBBbGxvY2F0ZSBtZW1vcnkgZm9yIFJYIGFuZCBUWCBidWZmZXJzICovCisJcnhidWYgPSAodWNoYXIgKikgbWFsbG9jIChNQVhfQlVGRkVSKTsKKwl0eGJ1ZiA9ICh1Y2hhciAqKSBtYWxsb2MgKE1BWF9CVUZGRVIpOworCisJcmJkZi0+Y2JkX2J1ZmFkZHIgPSAodWxvbmcpIHJ4YnVmOworCXRiZGYtPmNiZF9idWZhZGRyID0gKHVsb25nKSB0eGJ1ZjsKKworCXJldHVybjsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICBGdW5jdGlvbjogICAgc3BpX3dyaXRlCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworc3NpemVfdCBzcGlfd3JpdGUgKHVjaGFyICphZGRyLCBpbnQgYWxlbiwgdWNoYXIgKmJ1ZmZlciwgaW50IGxlbikKK3sKKwlpbnQgaTsKKworCW1lbXNldChyeGJ1ZiwgMCwgTUFYX0JVRkZFUik7CisJbWVtc2V0KHR4YnVmLCAwLCBNQVhfQlVGRkVSKTsKKwkqdHhidWYgPSBTUElfRUVQUk9NX1dSRU47CQkvKiB3cml0ZSBlbmFibGUJCSovCisJc3BpX3hmZXIoMSk7CisJbWVtY3B5KHR4YnVmLCBhZGRyLCBhbGVuKTsKKwkqdHhidWYgPSBTUElfRUVQUk9NX1dSSVRFOwkJLyogV1JJVEUgbWVtb3J5IGFycmF5CSovCisJbWVtY3B5KGFsZW4gKyB0eGJ1ZiwgYnVmZmVyLCBsZW4pOworCXNwaV94ZmVyKGFsZW4gKyBsZW4pOworCQkJCQkJLyogaWdub3JlIHJlY2VpdmVkIGRhdGEJKi8KKwlmb3IgKGkgPSAwOyBpIDwgMTAwMDsgaSsrKSB7CisJCSp0eGJ1ZiA9IFNQSV9FRVBST01fUkRTUjsJLyogcmVhZCBzdGF0dXMJCSovCisJCXR4YnVmWzFdID0gMDsKKwkJc3BpX3hmZXIoMik7CisJCWlmICghKHJ4YnVmWzFdICYgMSkpIHsKKwkJCWJyZWFrOworCQl9CisJCXVkZWxheSgxMDAwKTsKKwl9CisJaWYgKGkgPj0gMTAwMCkgeworCQlwcmludGYgKCIqKiogc3BpX3dyaXRlOiBUaW1lIG91dCB3aGlsZSB3cml0aW5nIVxuIik7CisJfQorCisJcmV0dXJuIGxlbjsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICBGdW5jdGlvbjogICAgc3BpX3JlYWQKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCitzc2l6ZV90IHNwaV9yZWFkICh1Y2hhciAqYWRkciwgaW50IGFsZW4sIHVjaGFyICpidWZmZXIsIGludCBsZW4pCit7CisJbWVtc2V0KHJ4YnVmLCAwLCBNQVhfQlVGRkVSKTsKKwltZW1zZXQodHhidWYsIDAsIE1BWF9CVUZGRVIpOworCW1lbWNweSh0eGJ1ZiwgYWRkciwgYWxlbik7CisJKnR4YnVmID0gU1BJX0VFUFJPTV9SRUFEOwkJLyogUkVBRCBtZW1vcnkgYXJyYXkJKi8KKworCS8qCisJICogVGhlcmUgaXMgYSBidWcgaW4gODYwVCAoPykgdGhhdCBjdXRzIHRoZSBsYXN0IGJ5dGUgb2YgaW5wdXQKKwkgKiBpZiB3ZSdyZSByZWFkaW5nIGludG8gRFBSQU0uIFRoZSBzb2x1dGlvbiB3ZSBjaG9vc2UgaGVyZSBpcworCSAqIHRvIGFsd2F5cyByZWFkIGxlbisxIGJ5dGVzICh3ZSBoYXZlIG9uZSBleHRyYSBieXRlIGF0IHRoZQorCSAqIGVuZCBvZiB0aGUgYnVmZmVyKS4KKwkgKi8KKwlzcGlfeGZlcihhbGVuICsgbGVuICsgMSk7CisJbWVtY3B5KGJ1ZmZlciwgYWxlbiArIHJ4YnVmLCBsZW4pOworCisJcmV0dXJuIGxlbjsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICBGdW5jdGlvbjogICAgc3BpX3hmZXIKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCitzc2l6ZV90IHNwaV94ZmVyIChzaXplX3QgY291bnQpCit7CisJdm9sYXRpbGUgaW1tYXBfdCAqaW1tcjsKKwl2b2xhdGlsZSBjcG04MjYwX3QgKmNwOworCXZvbGF0aWxlIHNwaV90ICpzcGk7CisJY2JkX3QgKnRiZGYsICpyYmRmOworCWludCB0bTsKKworCURQUklOVCAoKCIqKiogc3BpX3hmZXIgZW50ZXJlZCAqKipcbiIpKTsKKworCWltbXIgPSAoaW1tYXBfdCAqKSBDT05GSUdfU1lTX0lNTVI7CisJY3AgICA9IChjcG04MjYwX3QgKikgJmltbXItPmltX2NwbTsKKworCXNwaSAgPSAoc3BpX3QgKikmaW1tci0+aW1fZHByYW1iYXNlW1BST0ZGX1NQSV07CisKKwl0YmRmID0gKGNiZF90ICopICYgaW1tci0+aW1fZHByYW1iYXNlW3NwaS0+c3BpX3RiYXN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cHV0dGluZyBhbiBpbGxlZ2FsCisJICogaW5zdHJ1Y3Rpb24gaGVyZSAoYXQgbGVhc3QgdGhpcyBpcyB0aGUgdGhlb3J5KS4KKwkgKgorCSAqIHdlbGwgLSB0aGF0IGRpZG50IHdvcmssIHNvIGp1c3QgZG8gYW4gaW5maW5pdGUgbG9vcCEKKwkgKi8KKzE6CWIJMWIKKyNlbHNlCisJU1REX0VYQ0VQVElPTigweDEzMDAsIEluc3RydWN0aW9uQnJlYWtwb2ludCwgRGVidWdFeGNlcHRpb24pCisjZW5kaWYKKwlTVERfRVhDRVBUSU9OKDB4MTQwMCwgU01JLCBVbmtub3duRXhjZXB0aW9uKQorCisJU1REX0VYQ0VQVElPTigweDE1MDAsIFRyYXBfMTUsIFVua25vd25FeGNlcHRpb24pCisJU1REX0VYQ0VQVElPTigweDE2MDAsIFRyYXBfMTYsIFVua25vd25FeGNlcHRpb24pCisJU1REX0VYQ0VQVElPTigweDE3MDAsIFRyYXBfMTcsIFVua25vd25FeGNlcHRpb24pCisJU1REX0VYQ0VQVElPTigweDE4MDAsIFRyYXBfMTgsIFVua25vd25FeGNlcHRpb24pCisJU1REX0VYQ0VQVElPTigweDE5MDAsIFRyYXBfMTksIFVua25vd25FeGNlcHRpb24pCisJU1REX0VYQ0VQVElPTigweDFhMDAsIFRyYXBfMWEsIFVua25vd25FeGNlcHRpb24pCisJU1REX0VYQ0VQVElPTigweDFiMDAsIFRyYXBfMWIsIFVua25vd25FeGNlcHRpb24pCisJU1REX0VYQ0VQVElPTigweDFjMDAsIFRyYXBfMWMsIFVua25vd25FeGNlcHRpb24pCisJU1REX0VYQ0VQVElPTigweDFkMDAsIFRyYXBfMWQsIFVua25vd25FeGNlcHRpb24pCisJU1REX0VYQ0VQVElPTigweDFlMDAsIFRyYXBfMWUsIFVua25vd25FeGNlcHRpb24pCisJU1REX0VYQ0VQVElPTigweDFmMDAsIFRyYXBfMWYsIFVua25vd25FeGNlcHRpb24pCisJU1REX0VYQ0VQVElPTigweDIwMDAsIFRyYXBfMjAsIFVua25vd25FeGNlcHRpb24pCisJU1REX0VYQ0VQVElPTigweDIxMDAsIFRyYXBfMjEsIFVua25vd25FeGNlcHRpb24pCisJU1REX0VYQ0VQVElPTigweDIyMDAsIFRyYXBfMjIsIFVua25vd25FeGNlcHRpb24pCisJU1REX0VYQ0VQVElPTigweDIzMDAsIFRyYXBfMjMsIFVua25vd25FeGNlcHRpb24pCisJU1REX0VYQ0VQVElPTigweDI0MDAsIFRyYXBfMjQsIFVua25vd25FeGNlcHRpb24pCisJU1REX0VYQ0VQVElPTigweDI1MDAsIFRyYXBfMjUsIFVua25vd25FeGNlcHRpb24pCisJU1REX0VYQ0VQVElPTigweDI2MDAsIFRyYXBfMjYsIFVua25vd25FeGNlcHRpb24pCisJU1REX0VYQ0VQVElPTigweDI3MDAsIFRyYXBfMjcsIFVua25vd25FeGNlcHRpb24pCisJU1REX0VYQ0VQVElPTigweDI4MDAsIFRyYXBfMjgsIFVua25vd25FeGNlcHRpb24pCisJU1REX0VYQ0VQVElPTigweDI5MDAsIFRyYXBfMjksIFVua25vd25FeGNlcHRpb24pCisJU1REX0VYQ0VQVElPTigweDJhMDAsIFRyYXBfMmEsIFVua25vd25FeGNlcHRpb24pCisJU1REX0VYQ0VQVElPTigweDJiMDAsIFRyYXBfMmIsIFVua25vd25FeGNlcHRpb24pCisJU1REX0VYQ0VQVElPTigweDJjMDAsIFRyYXBfMmMsIFVua25vd25FeGNlcHRpb24pCisJU1REX0VYQ0VQVElPTigweDJkMDAsIFRyYXBfMmQsIFVua25vd25FeGNlcHRpb24pCisJU1REX0VYQ0VQVElPTigweDJlMDAsIFRyYXBfMmUsIFVua25vd25FeGNlcHRpb24pCisJU1REX0VYQ0VQVElPTigweDJmMDAsIFRyYXBfMmYsIFVua25vd25FeGNlcHRpb24pCisKKworCS5nbG9ibAlfZW5kX29mX3ZlY3RvcnMKK19lbmRfb2ZfdmVjdG9yczoKKworCS4gPSAweDMwMDAKKworLyo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lLiAgKi8KK2V4dGVybiB1bnNpZ25lZCBsb25nIHNlYXJjaF9leGNlcHRpb25fdGFibGUodW5zaWduZWQgbG9uZyk7CisKKy8qIFRISVMgTkVFRFMgQ0hBTkdJTkcgdG8gdXNlIHRoZSBib2FyZCBpbmZvIHN0cnVjdHVyZS4KKyovCisjZGVmaW5lIEVORF9PRl9NRU0JMHgwMjAwMDAwMAorCisvKgorICogVHJhcCAmIEV4Y2VwdGlvbiBzdXBwb3J0CisgKi8KKwordm9pZAorcHJpbnRfYmFja3RyYWNlKHVuc2lnbmVkIGxvbmcgKnNwKQoreworCWludCBjbnQgPSAwOworCXVuc2lnbmVkIGxvbmcgaTsKKworCXB1dHMgKCJDYWxsIGJhY2t0cmFjZTogIik7CisJd2hpbGUgKHNwKSB7CisJCWlmICgodWludClzcCA+IEVORF9PRl9NRU0pCisJCQlicmVhazsKKworCQlpID0gc3BbMV07CisJCWlmIChjbnQrKyAlIDcgPT0gMCkKKwkJCXB1dGMgKCdcbicpOworCQlwcmludGYoIiUwOGxYICIsIGkpOworCQlpZiAoY250ID4gMzIpIGJyZWFrOworCQlzcCA9ICh1bnNpZ25lZCBsb25nICopKnNwOworCX0KKwlwdXRjICgnXG4nKTsKK30KKwordm9pZCBzaG93X3JlZ3Moc3RydWN0IHB0X3JlZ3MgKiByZWdzKQoreworCWludCBpOworCisJcHJpbnRmKCJOSVA6ICUwOGxYIFhFUjogJTA4bFggTFI6ICUwOGxYIFJFR1M6ICVwIFRSQVA6ICUwNGx4IERBUjogJTA4bFhcbiIsCisJICAgICAgIHJlZ3MtPm5pcCwgcmVncy0+eGVyLCByZWdzLT5saW5rLCByZWdzLCByZWdzLT50cmFwLCByZWdzLT5kYXIpOworCXByaW50ZigiTVNSOiAlMDhseCBFRTogJTAxeCBQUjogJTAxeCBGUDogJTAxeCBNRTogJTAxeCBJUi9EUjogJTAxeCUwMXhcbiIsCisJICAgICAgIHJlZ3MtPm1zciwgcmVncy0+bXNyJk1TUl9FRSA/I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Lmhhc2gpCQl9CisgIC5keW5zeW0gICAgICAgIDogeyAqKC5keW5zeW0pCQl9CisgIC5keW5zdHIgICAgICAgIDogeyAqKC5keW5zdHIpCQl9CisgIC5yZWwudGV4dCAgICAgIDogeyAqKC5yZWwudGV4dCkJCX0KKyAgLnJlbGEudGV4dCAgICAgOiB7ICooLnJlbGEudGV4dCkJfQorICAucmVsLmRhdGEgICAgICA6IHsgKigucmVsLmRhdGEpCQl9CisgIC5yZWxhLmRhdGEgICAgIDogeyAqKC5yZWxhLmRhdGEpCX0KKyAgLnJlbC5yb2RhdGEgICAgOiB7ICooLnJlbC5yb2RhdGEpCX0KKyAgLnJlbGEucm9kYXRhICAgOiB7ICooLnJlbGEucm9kYXRhKQl9CisgIC5yZWwuZ290ICAgICAgIDogeyAqKC5yZWwuZ290KQkJfQorICAucmVsYS5nb3QgICAgICA6IHsgKigucmVsYS5nb3QpCQl9CisgIC5yZWwuY3RvcnMgICAgIDogeyAqKC5yZWwuY3RvcnMpCX0KKyAgLnJlbGEuY3RvcnMgICAgOiB7ICooLnJlbGEuY3RvcnMpCX0KKyAgLnJlbC5kdG9ycyAgICAgOiB7ICooLnJlbC5kdG9ycykJfQorICAucmVsYS5kdG9ycyAgICA6IHsgKigucmVsYS5kdG9ycykJfQorICAucmVsLmJzcyAgICAgICA6IHsgKigucmVsLmJzcykJCX0KKyAgLnJlbGEuYnNzICAgICAgOiB7ICooLnJlbGEuYnNzKQkJfQorICAucmVsLnBsdCAgICAgICA6IHsgKigucmVsLnBsdCkJCX0KKyAgLnJlbGEucGx0ICAgICAgOiB7ICooLnJlbGEucGx0KQkJfQorICAuaW5pdCAgICAgICAgICA6IHsgKiguaW5pdCkJfQorICAucGx0IDogeyAqKC5wbHQpIH0KKyAgLnRleHQgICAgICA6CisgIHsKKyAgICBhcmNoL3BwYy9jcHUvbXBjODI2MC9zdGFydC5vCQkoLnRleHQpCisgICAgKigudGV4dCkKKyAgICAqKC5nb3QxKQorICAgIC4gPSBBTElHTigxNik7CisgICAgKiguZWhfZnJhbWUpCisgICAgKihTT1JUX0JZX0FMSUdOTUVOVChTT1JUX0JZX05BTUUoLnJvZGF0YSopKSkKKyAgfQorICAuZmluaSAgICAgIDogeyAqKC5maW5pKSAgICB9ID0wCisgIC5jdG9ycyAgICAgOiB7ICooLmN0b3JzKSAgIH0KKyAgLmR0b3JzICAgICA6IHsgKiguZHRvcnMpICAgfQorCisgIC8qIFJlYWQtd3JpdGUgc2VjdGlvbiwgbWVyZ2VkIGludG8gZGF0YSBzZWdtZW50OiAqLworICAuID0gKC4gKyAweDBGRkYpICYgMHhGRkZGRjAwMDsKKyAgX2Vyb3RleHQgPSAuOworICBQUk9WSURFIChlcm90ZXh0ID0gLik7CisgIC5yZWxvYyAgIDoKKyAgeworICAgICooLmdvdCkKKyAgICBfR09UMl9UQUJMRV8gPSAuOworICAgICooLmdvdDIpCisgICAgX0ZJWFVQX1RBQkxFXyA9IC47CisgICAgKiguZml4dXApCisgIH0KKyAgX19nb3QyX2VudHJpZXMgPSAoX0ZJWFVQX1RBQkxFXyAtIF9HT1QyX1RBQkxFXykgPj4gMjsKKyAgX19maXh1cF9lbnRyaWVzID0gKC4gLSBfRklYVVBfVEFCTEVfKSA+PiAyOworCisgIC5kYXRhICAgIDoKKyAgeworICAgICooLmRhdGEpCisgICAgKiguZGF0YTEpCisgICAgKiguc2RhdGEpCisgICAgKiguc2RhdGEyKQorICAgICooLmR5bmFtaWMpCisgICAgQ09OU1RSVUNUT1JTCisgIH0KKyAgX2VkYXRhICA9ICAuOworICBQUk9WSURFIChlZGF0YSA9IC4pOworCisgIC4gPSAuOworICBfX3VfYm9vdF9jbWRfc3RhcnQgPSAuOworICAudV9ib290X2NtZCA6IHsgKigudV9ib290X2NtZCkgfQorICBfX3VfYm9vdF9jbWRfZW5kID0gLjsKKworCisgIC4gPSAuOworICBfX3N0YXJ0X19fZXhfdGFibGUgPSAuOworICBfX2V4X3RhYmxlIDogeyAqKF9fZXhfdGFibGUpIH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xrOworfQorCisKKyNpZiBkZWZpbmVkKENPTkZJR19XQVRDSERPRykKK3ZvaWQgd2F0Y2hkb2dfcmVzZXQgKHZvaWQpCit7CisJaW50IHJlX2VuYWJsZSA9IGRpc2FibGVfaW50ZXJydXB0cygpOworCisJLyogUmVzZXQgdGhlIDgzeHggd2F0Y2hkb2cgKi8KKwl2b2xhdGlsZSBpbW1hcF90ICppbW1yID0gKGltbWFwX3QgKikgQ09ORklHX1NZU19JTU1SOworCWltbXItPndkdC5zd3NyciA9IDB4NTU2YzsKKwlpbW1yLT53ZHQuc3dzcnIgPSAweGFhMzk7CisKKwlpZiAocmVfZW5hYmxlKQorCQllbmFibGVfaW50ZXJydXB0cyAoKTsKK30KKyNlbmRpZgorCisvKgorICogSW5pdGlhbGl6ZXMgb24tY2hpcCBldGhlcm5ldCBjb250cm9sbGVycy4KKyAqIHRvIG92ZXJyaWRlLCBpbXBsZW1lbnQgYm9hcmRfZXRoX2luaXQoKQorICovCitpbnQgY3B1X2V0aF9pbml0KGJkX3QgKmJpcykKK3sKKyNpZiBkZWZpbmVkKENPTkZJR19VRUNfRVRIKQorCXVlY19zdGFuZGFyZF9pbml0KGJpcyk7CisjZW5kaWYKKworI2lmIGRlZmluZWQoQ09ORklHX1RTRUNfRU5FVCkKKwl0c2VjX3N0YW5kYXJkX2luaXQoYmlzKTsKKyNlbmRpZgorCXJldHVybiAwOworfQorCisvKgorICogSW5pdGlhbGl6ZXMgb24tY2hpcCBNTUMgY29udHJvbGxlcnMuCisgKiB0byBvdmVycmlkZSwgaW1wbGVtZW50IGJvYXJkX21tY19pbml0KCkKKyAqLworaW50IGNwdV9tbWNfaW5pdChiZF90ICpiaXMpCit7CisjaWZkZWYgQ09ORklHX0ZTTF9FU0RIQworCXJldHVybiBmc2xfZXNkaGNfbW1jX2luaXQoYmlzKTsKKyNlbHNlCisJcmV0dXJuIDA7CisjZW5kaWYKK30KKworI2lmZGVmIENPTkZJR19CT09UQ09VTlRfTElNSVQKKworI2lm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lleHAyX2NsazsKKyNlbmRpZgorI2lmIGRlZmluZWQoQ09ORklHX01QQzgzN3gpIHx8IGRlZmluZWQoQ09ORklHX01QQzgzMTUpCisJZ2QtPnNhdGFfY2xrID0gc2F0YV9jbGs7CisjZW5kaWYKKwlnZC0+cGNpX2NsayA9IHBjaV9zeW5jX2luOworCWdkLT5jcHVfY2xrID0gZ2QtPmNvcmVfY2xrOworCWdkLT5idXNfY2xrID0gZ2QtPmNzYl9jbGs7CisJcmV0dXJuIDA7CisKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBnZXRfYnVzX2ZyZXEKKyAqIHJldHVybiBzeXN0ZW0gYnVzIGZyZXEgaW4gSHoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCit1bG9uZyBnZXRfYnVzX2ZyZXEodWxvbmcgZHVtbXkpCit7CisJcmV0dXJuIGdkLT5jc2JfY2xrOworfQorCitpbnQgZG9fY2xvY2tzIChjbWRfdGJsX3QgKiBjbWR0cCwgaW50IGZsYWcsIGludCBhcmdjLCBjaGFyICphcmd2W10pCit7CisJY2hhciBidWZbMzJdOworCisJcHJpbnRmKCJDbG9jayBjb25maWd1cmF0aW9uOlxuIik7CisJcHJpbnRmKCIgIENvcmU6ICAgICAgICAgICAgICAgICUtNHMgTUh6XG4iLCBzdHJtaHooYnVmLCBnZC0+Y29yZV9jbGspKTsKKwlwcmludGYoIiAgQ29oZXJlbnQgU3lzdGVtIEJ1czogJS00cyBNSHpcbiIsIHN0cm1oeihidWYsIGdkLT5jc2JfY2xrKSk7CisjaWYgZGVmaW5lZChDT05GSUdfTVBDODM2MCkgfHwgZGVmaW5lZChDT05GSUdfTVBDODMyeCkKKwlwcmludGYoIiAgUUU6ICAgICAgICAgICAgICAgICAgJS00cyBNSHpcbiIsIHN0cm1oeihidWYsIGdkLT5xZV9jbGspKTsKKwlwcmludGYoIiAgQlJHOiAgICAgICAgICAgICAgICAgJS00cyBNSHpcbiIsIHN0cm1oeihidWYsIGdkLT5icmdfY2xrKSk7CisjZW5kaWYKKwlwcmludGYoIiAgTG9jYWwgQnVzIENvbnRyb2xsZXI6JS00cyBNSHpcbiIsIHN0cm1oeihidWYsIGdkLT5sYml1X2NsaykpOworCXByaW50ZigiICBMb2NhbCBCdXM6ICAgICAgICAgICAlLTRzIE1IelxuIiwgc3RybWh6KGJ1ZiwgZ2QtPmxjbGtfY2xrKSk7CisJcHJpbnRmKCIgIEREUjogICAgICAgICAgICAgICAgICUtNHMgTUh6XG4iLCBzdHJtaHooYnVmLCBnZC0+bWVtX2NsaykpOworI2lmIGRlZmluZWQoQ09ORklHX01QQzgzNjApCisJcHJpbnRmKCIgIEREUiBTZWNvbmRhcnk6ICAgICAgICUtNHMgTUh6XG4iLCBzdHJtaHooYnVmLCBnZC0+bWVtX3NlY19jbGspKTsKKyNlbmRpZgorCXByaW50ZigiICBTRUM6ICAgICAgICAgICAgICAgICAlLTRzIE1IelxuIiwgc3RybWh6KGJ1ZiwgZ2QtPmVuY19jbGspKTsKKwlwcmludGYoIiAgSTJDMTogICAgICAgICAgICAgICAgJS00cyBNSHpcbiIsIHN0cm1oeihidWYsIGdkLT5pMmMxX2NsaykpOworI2lmICFkZWZpbmVkKENPTkZJR19NUEM4MzJ4KQorCXByaW50ZigiICBJMkMyOiAgICAgICAgICAgICAgICAlLTRzIE1IelxuIiwgc3RybWh6KGJ1ZiwgZ2QtPmkyYzJfY2xrKSk7CisjZW5kaWYKKyNpZiBkZWZpbmVkKENPTkZJR19NUEM4MzE1KQorCXByaW50ZigiICBURE06ICAgICAgICAgICAgICAgICAlLTRzIE1IelxuIiwgc3RybWh6KGJ1ZiwgZ2QtPnRkbV9jbGspKTsKKyNlbmRpZgorI2lmIGRlZmluZWQoQ09ORklHX01QQzgzN3gpCisJcHJpbnRmKCIgIFNESEM6ICAgICAgICAgICAgICAgICUtNHMgTUh6XG4iLCBzdHJtaHooYnVmLCBnZC0+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VRTCisJLyogSUJBVCA0ICovCisJYWRkaXMgICByNCwgcjAsIENPTkZJR19TWVNfSUJBVDRMQGgKKwlvcmkgICAgIHI0LCByNCwgQ09ORklHX1NZU19JQkFUNExAbAorCWFkZGlzICAgcjMsIHIwLCBDT05GSUdfU1lTX0lCQVQ0VUBoCisJb3JpICAgICByMywgcjMsIENPTkZJR19TWVNfSUJBVDRVQGwKKwltdHNwciAgIElCQVQ0TCwgcjQKKwltdHNwciAgIElCQVQ0VSwgcjMKKworCS8qIERCQVQgNCAqLworCWFkZGlzICAgcjQsIHIwLCBDT05GSUdfU1lTX0RCQVQ0TEBoCisJb3JpICAgICByNCwgcjQsIENPTkZJR19TWVNfREJBVDRMQGwKKwlhZGRpcyAgIHIzLCByMCwgQ09ORklHX1NZU19EQkFUNFVAaAorCW9yaSAgICAgcjMsIHIzLCBDT05GSUdfU1lTX0RCQVQ0VUBsCisJbXRzcHIgICBEQkFUNEwsIHI0CisJbXRzcHIgICBEQkFUNFUsIHIzCisKKwkvKiBJQkFUIDUgKi8KKwlhZGRpcyAgIHI0LCByMCwgQ09ORklHX1NZU19JQkFUNUxAaAorCW9yaSAgICAgcjQsIHI0LCBDT05GSUdfU1lTX0lCQVQ1TEBsCisJYWRkaXMgICByMywgcjAsIENPTkZJR19TWVNfSUJBVDVVQGgKKwlvcmkgICAgIHIzLCByMywgQ09ORklHX1NZU19JQkFUNVVAbAorCW10c3ByICAgSUJBVDVMLCByNAorCW10c3ByICAgSUJBVDVVLCByMworCisJLyogREJBVCA1ICovCisJYWRkaXMgICByNCwgcjAsIENPTkZJR19TWVNfREJBVDVMQGgKKwlvcmkgICAgIHI0LCByNCwgQ09ORklHX1NZU19EQkFUNUxAbAorCWFkZGlzICAgcjMsIHIwLCBDT05GSUdfU1lTX0RCQVQ1VUBoCisJb3JpICAgICByMywgcjMsIENPTkZJR19TWVNfREJBVDVVQGwKKwltdHNwciAgIERCQVQ1TCwgcjQKKwltdHNwciAgIERCQVQ1VSwgcjMK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jdG9ycyAgICA6IHsgKigucmVsYS5jdG9ycykJfQorICAucmVsLmR0b3JzICAgICA6IHsgKigucmVsLmR0b3JzKQl9CisgIC5yZWxhLmR0b3JzICAgIDogeyAqKC5yZWxhLmR0b3JzKQl9CisgIC5yZWwuYnNzICAgICAgIDogeyAqKC5yZWwuYnNzKQkJfQorICAucmVsYS5ic3MgICAgICA6IHsgKigucmVsYS5ic3MpCQl9CisgIC5yZWwucGx0ICAgICAgIDogeyAqKC5yZWwucGx0KQkJfQorICAucmVsYS5wbHQgICAgICA6IHsgKigucmVsYS5wbHQpCQl9CisgIC5pbml0ICAgICAgICAgIDogeyAqKC5pbml0KQl9CisgIC5wbHQgOiB7ICooLnBsdCkgfQorICAudGV4dCAgICAgIDoKKyAgeworICAgIGFyY2gvcHBjL2NwdS9tcGM4M3h4L3N0YXJ0Lm8JKC50ZXh0KQorICAgICooLnRleHQpCisgICAgKiguZ290MSkKKyAgICAuID0gQUxJR04oMTYpOworICAgICooLmVoX2ZyYW1lKQorICAgICooU09SVF9CWV9BTElHTk1FTlQoU09SVF9CWV9OQU1FKC5yb2RhdGEqKSkpCisgIH0KKyAgLmZpbmkgICAgICA6IHsgKiguZmluaSkgICAgfSA9MAorICAuY3RvcnMgICAgIDogeyAqKC5jdG9ycykgICB9CisgIC5kdG9ycyAgICAgOiB7ICooLmR0b3JzKSAgIH0KKworICAvKiBSZWFkLXdyaXRlIHNlY3Rpb24sIG1lcmdlZCBpbnRvIGRhdGEgc2VnbWVudDogKi8KKyAgLiA9ICguICsgMHgwRkZGKSAmIDB4RkZGRkYwMDA7CisgIF9lcm90ZXh0ID0gLjsKKyAgUFJPVklERSAoZXJvdGV4dCA9IC4pOworICAucmVsb2MgICA6CisgIHsKKyAgICAqKC5nb3QpCisgICAgX0dPVDJfVEFCTEVfID0gLjsKKyAgICAqKC5nb3QyKQorICAgIF9GSVhVUF9UQUJMRV8gPSAuOworICAgICooLmZpeHVwKQorICB9CisgIF9fZ290Ml9lbnRyaWVzID0gKF9GSVhVUF9UQUJMRV8gLSBfR09UMl9UQUJMRV8pID4+IDI7CisgIF9fZml4dXBfZW50cmllcyA9ICguIC0gX0ZJWFVQX1RBQkxFXykgPj4gMjsKKworICAuZGF0YSAgICA6CisgIHsKKyAgICAqKC5kYXRhKQorICAgICooLmRhdGExKQorICAgICooLnNkYXRhKQorICAgICooLnNkYXRhMikKKyAgICAqKC5keW5hbWljKQorICAgIENPTlNUUlVDVE9SUworICB9CisgIF9lZGF0YSAgPSAgLjsKKyAgUFJPVklERSAoZWRhdGEgPSAuKTsKKworICAuID0gLjsKKyAgX191X2Jvb3RfY21kX3N0YXJ0ID0gLjsKKyAgLnVfYm9vdF9jbWQgOiB7ICooLnVfYm9vdF9jbWQpIH0KKyAgX191X2Jvb3RfY21kX2VuZCA9IC47CisKKworICAuID0gLjsKKyAgX19zdGFydF9fX2V4X3RhYmxlID0gLjsKKyAgX19leF90YWJsZSA6IHsgKihfX2V4X3RhYmxlKSB9CisgIF9fc3RvcF9fX2V4X3RhYmxlID0gLjsKKworICAuID0gQUxJR04oNDA5Nik7CisgIF9faW5pdF9iZWdpbiA9IC47CisgIC50ZXh0LmluaXQgOiB7ICooLnRleHQuaW5pdCkgfQorICAuZGF0YS5pbml0IDogeyAqKC5kYXRhLmluaXQpIH0KKyAgLiA9IEFMSUdOKDQwOTYpOworICBfX2luaXRfZW5kID0gLjsKKworICBfX2Jzc19zdGFydCA9IC47CisgIC5ic3MgKE5PTE9BRCkgICAgICAgOgorICB7CisgICAqKC5zYnNzKSAqKC5zY29tbW9uKQorICAgKiguZHluYnNzKQorICAgKiguYnNzKQorICAgKihDT01NT04pCisgICAuID0gQUxJR04oNCk7CisgIH0KKyAgX2VuZCA9IC4gOworICBQUk9WSURFIChlbmQgPSAuKTsKK30KK0VOVFJZKF9zdGFydCkKZGlmZiAtLWdpdCBhL2FyY2gvcHBjL2NwdS9tcGM4NXh4L01ha2VmaWxlIGIvYXJjaC9wcGMvY3B1L21wYzg1eH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iW2ldLm9wZW5fZHJhaW47CisJCWFzc2lnbgkJPSBxZV9pb3BfY29uZl90YWJbaV0uYXNzaWduOworCQlxZV9jb25maWdfaW9waW4ocG9ydCwgcGluLCBkaXIsIG9wZW5fZHJhaW4sIGFzc2lnbik7CisJfQorfQorI2VuZGlmCisKKyNpZmRlZiBDT05GSUdfQ1BNMgordm9pZCBjb25maWdfODU2MF9pb3BvcnRzICh2b2xhdGlsZSBjY3NyX2NwbV90ICogY3BtKQoreworCWludCBwb3J0bnVtOworCisJZm9yIChwb3J0bnVtID0gMDsgcG9ydG51bSA8IDQ7IHBvcnRudW0rKykgeworCQl1aW50IHBtc2sgPSAwLAorCQkgICAgIHBwYXIgPSAwLAorCQkgICAgIHBzb3IgPSAwLAorCQkgICAgIHBkaXIgPSAwLAorCQkgICAgIHBvZHIgPSAwLAorCQkgICAgIHBkYXQgPSAwOworCQlpb3BfY29uZl90ICppb3BjID0gKGlvcF9jb25mX3QgKikgJiBpb3BfY29uZl90YWJbcG9ydG51bV1bMF07CisJCWlvcF9jb25mX3QgKmVpb3BjID0gaW9wYyArIDMyOworCQl1aW50IG1zayA9IDE7CisKKwkJLyoKKwkJICogTk9URToKKwkJICogaW5kZXggMCByZWZlcnMgdG8gcGluIDMxLAorCQkgKiBpbmRleCAzMSByZWZlcnMgdG8gcGluIDAKKwkJICovCisJCXdoaWxlIChpb3BjIDwgZWlvcGMpIHsKKwkJCWlmIChpb3BjLT5jb25mKSB7CisJCQkJcG1zayB8PSBtc2s7CisJCQkJaWYgKGlvcGMtPnBwYXIpCisJCQkJCXBwYXIgfD0gbXNrOworCQkJCWlmIChpb3BjLT5wc29yKQorCQkJCQlwc29yIHw9IG1zazsKKwkJCQlpZiAoaW9wYy0+cGRpcikKKwkJCQkJcGRpciB8PSBtc2s7CisJCQkJaWYgKGlvcGMtPnBvZHIpCisJCQkJCXBvZHIgfD0gbXNrOworCQkJCWlmIChpb3BjLT5wZGF0KQorCQkJCQlwZGF0IHw9IG1zazsK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gICAqKCh1aW50ICopcnR4LnR4YmRbdHhJZHhdLmNiZF9idWZhZGRyICsgaSo0ICsgMSksKigodWludCAqKXJ0eC50eGJkW3R4SWR4XS5jYmRfYnVmYWRkciArIGkqNCArIDIpLCBcCisgICAgKigodWludCAqKXJ0eC50eGJkW3R4SWR4XS5jYmRfYnVmYWRkciArIGkqNCArIDMpKTsKKyAgICB9CisjZW5kaWYKKworICAgIC8qIHJldHVybiBvbmx5IHN0YXR1cyBiaXRzICovCisgICAgcmVzdWx0ID0gcnR4LnR4YmRbdHhJZHhdLmNiZF9zYyAmIEJEX0VORVRfVFhfU1RBVFM7CisgICAgdHhJZHggPSAodHhJZHggKyAxKSAlIFRYX0JVRl9DTlQ7CisKK291dDoKKyAgICByZXR1cm4gcmVzdWx0OworfQorCitzdGF0aWMgaW50IGZlY19yZWN2KHN0cnVjdCBldGhfZGV2aWNlKiBkZXYpCit7CisgICAgaW50IGxlbmd0aDsKKworICAgIGZvciAoOzspCisgICAgeworCWlmIChydHgucnhiZFtyeElkeF0uY2JkX3NjICYgQkRfRU5FVF9SWF9FTVBUWSkgeworCSAgICBsZW5ndGggPSAtMTsKKwkgICAgYnJlYWs7ICAgICAvKiBub3RoaW5nIHJlY2VpdmVkIC0gbGVhdmUgZm9yKCkgbG9vcCAqLworCX0KKwlsZW5ndGggPSBydHgucnhiZFtyeElkeF0uY2JkX2RhdGxlbjsKKworCWlmIChydHgucnhiZFtyeElkeF0uY2JkX3NjICYgMHgwMDNmKSB7CisJICAgIHByaW50ZigiZmVjOiByeCBlcnJvciAlMDR4XG4iLCBydHgucnhiZFtyeElkeF0uY2JkX3NjKTsKKwl9CisJZWxzZSB7CisJICAgIC8qIFBhc3MgdGhlIHBhY2tldCB1cCB0byB0aGUgcHJvdG9jb2wgbGF5ZXJzLiAqLworCSAgICBOZXRSZWNlaXZlKE5ldFJ4UGFja2V0c1tyeElkeF0sIGxlbmd0aCAtIDQpOworCX0KKworCisJLyogR2l2ZSB0aGUgYnVmZ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lzciwgTVBDODV4eF9ERVZESVNSX0NQVTApOworCQlicmVhazsKKwljYXNlIDE6CisJCXNldGJpdHNfYmUzMigmZ3VyLT5kZXZkaXNyLCBNUEM4NXh4X0RFVkRJU1JfQ1BVMSk7CisJCWJyZWFrOworCWRlZmF1bHQ6CisJCXByaW50ZigiSW52YWxpZCBjcHUgbnVtYmVyIGZvciBkaXNhYmxlICVkXG4iLCBucik7CisJCXJldHVybiAxOworCX0KKworCXJldHVybiAwOworfQorI2VuZGlmCisKK3N0YXRpYyB1OCBib290X2VudHJ5X21hcFs0XSA9IHsKKwkwLAorCUJPT1RfRU5UUllfUElSLAorCUJPT1RfRU5UUllfUjNfTE9XRVIsCisJQk9PVF9FTlRSWV9SNl9MT1dFUiwKK307CisKK2ludCBjcHVfcmVsZWFzZShpbnQgbnIsIGludCBhcmdjLCBjaGFyICphcmd2W10pCit7CisJdTMyIGksIHZhbCwgKnRhYmxlID0gKHUzMiAqKWdldF9zcGluX3ZpcnRfYWRkcigpICsgbnIgKiBOVU1fQk9PVF9FTlRSWTsKKwl1NjQgYm9vdF9hZGRyOworCisJaWYgKG5yID09IGdldF9teV9pZCgpKSB7CisJCXByaW50ZigiSW52YWxpZCB0byByZWxlYXNlIHRoZSBib290IGNvcmUuXG5cbiIpOworCQlyZXR1cm4gMTsKKwl9CisKKwlpZiAoYXJnYyAhPSA0KSB7CisJCXByaW50ZigiSW52YWxpZCBudW1iZXIgb2YgYXJndW1lbnRzIHRvIHJlbGVhc2UuXG5cbiIpOworCQlyZXR1cm4gMTsKKwl9CisKKwlib290X2FkZHIgPSBzaW1wbGVfc3RydG91bGwoYXJndlswXSwgTlVMTCwgMTYpOworCisJLyogaGFuZGxlIHBpciwgcjMsIHI2ICovCisJZm9yIChpID0gMTsgaSA8IDQ7IGkrKykgeworCQlpZiAoYXJndltpXVswXSAhPSAnLScpIHsKKwkJCXU4IGVudHJ5ID0gYm9vdF9lbnRyeV9tYXBbaV07CisJCQl2YWwgPSBzaW1wbG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9CisKK3ZvaWQgc2V0X3RsYih1OCB0bGIsIHUzMiBlcG4sIHU2NCBycG4sCisJICAgICB1OCBwZXJtcywgdTggd2ltZ2UsCisJICAgICB1OCB0cywgdTggZXNlbCwgdTggdHNpemUsIHU4IGlwcm90KQoreworCXUzMiBfbWFzMCwgX21hczEsIF9tYXMyLCBfbWFzMywgX21hczc7CisKKwlpZiAodGxiID09IDEpCisJCXVzZV90bGJfY2FtKGVzZWwpOworCisJX21hczAgPSBGU0xfQk9PS0VfTUFTMCh0bGIsIGVzZWwsIDApOworCV9tYXMxID0gRlNMX0JPT0tFX01BUzEoMSwgaXByb3QsIDAsIHRzLCB0c2l6ZSk7CisJX21hczIgPSBGU0xfQk9PS0VfTUFTMihlcG4sIHdpbWdlKTsKKwlfbWFzMyA9IEZTTF9CT09LRV9NQVMzKHJwbiwgMCwgcGVybXMpOworCV9tYXM3ID0gRlNMX0JPT0tFX01BUzcocnBuKTsKKworCXdyaXRlX3RsYihfbWFzMCwgX21hczEsIF9tYXMyLCBfbWFzMywgX21hczcpOworCisjaWZkZWYgQ09ORklHX0FERFJfTUFQCisJaWYgKCh0bGIgPT0gMSkgJiYgKGdkLT5mbGFncyAmIEdEX0ZMR19SRUxPQykpCisJCWFkZHJtYXBfc2V0X2VudHJ5KGVwbiwgcnBuLCAoMVVMIDw8ICgodHNpemUgKiAyKSArIDEwKSksIGVzZWwpOworI2VuZGlmCit9CisKK3ZvaWQgZGlzYWJsZV90bGIodTggZXNlbCkKK3sKKwl1MzIgX21hczAsIF9tYXMxLCBfbWFzMiwgX21hczMsIF9tYXM3OworCisJZnJlZV90bGJfY2FtKGVzZWwpOworCisJX21hczAgPSBGU0xfQk9PS0VfTUFTMCgxLCBlc2VsLCAwKTsKKwlfbWFzMSA9IDA7CisJX21hczIgPSAwOworCV9tYXMzID0gMDsKKwlfbWFzNyA9IDA7CisKKwltdHNwcihNQVMwLCBfbWFzMCk7CisJbXRzcHIoTUFTMSwgX21hczEpOworCW10c3ByKE1BUzIsIF9tYXMyKTsKKwltdHNwcihNQVMzLCBfbWFzMyk7CisjaWZkZWYgQ09ORklHX0VOQUJMRV8zNkJJVF9QSFlTCisJbXRzcHIoTUFTNywgX21hczcpOworI2VuZGlmCisJYXNtIHZvbGF0aWxlKCJpc3luYzttc3luYzt0bGJ3ZTtpc3luYyIpOworCisjaWZkZWYgQ09ORklHX0FERFJfTUFQCisJaWYgKGdkLT5mbGFncyAmIEdEX0ZMR19SRUxPQykKKwkJYWRkcm1hcF9zZXRfZW50cnkoMCwgMCwgMCwgZXNlbCk7CisjZW5kaWYKK30KKworc3RhdGljIHZvaWQgdGxic3ggKGNvbnN0IHZvbGF0aWxlIHVuc2lnbmVkICphZGRyKQoreworCV9fYXNtX18gX192b2xhdGlsZV9fICgidGxic3ggMCwlMCIgOiA6ICJyIiAoYWRkciksICJtIiAoKmFkZHIpKTsKK30KKworLyogcmV0dXJuIC0xIGlmIHdlIGRpZG4ndCBmaW5kIGFueXRoaW5nICovCitpbnQgZmluZF90bGJfaWR4KHZvaWQgKmFkZHIsIHU4IHRsYnNlbCkKK3sKKwl1MzIgX21hczAsIF9tYXMxOworCisJLyogemVybyBvdXQgU2VhcmNoIFBJRCwgQVMgKi8KKwltdHNwcihNQVM2LCAwKTsKKworCXRsYnN4KGFkZHIpOworCisJX21hczAgPSBtZnNwcihNQVMwKTsKKwlfbWFzMSA9IG1mc3ByKE1BUzEpOworCisJLyogd2UgZm91bmQgc29tZXRoaW5nLCBhbmQgaXRzIGluIHRoZSBUTEIgd2UgZXhwZWN0ICovCisJaWYgKChNQVMxX1ZBTElEICYgX21hczEpICYmCisJCShNQVMwX1RMQlNFTCh0bGJzZWwpID09IChfbWFzMCAmIE1BUzBfVExCU0VMX01TSykpKSB7CisJCXJldHVybiAoKF9tYXMwICYgTUFTMF9FU0VMX01TSykgPj4gMTYpOworCX0KKworCXJldHVybiAtMTsKK30KKworI2lmZGVmIENPTkZJR19BRERSX01BUAordm9pZCBpbml0X2FkZHJf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N0ciAgICAgICAgOiB7ICooLmR5bnN0cikJCX0KKyAgLnJlbC50ZXh0ICAgICAgOiB7ICooLnJlbC50ZXh0KQkJfQorICAucmVsYS50ZXh0ICAgICA6IHsgKigucmVsYS50ZXh0KQl9CisgIC5yZWwuZGF0YSAgICAgIDogeyAqKC5yZWwuZGF0YSkJCX0KKyAgLnJlbGEuZGF0YSAgICAgOiB7ICooLnJlbGEuZGF0YSkJfQorICAucmVsLnJvZGF0YSAgICA6IHsgKigucmVsLnJvZGF0YSkJfQorICAucmVsYS5yb2RhdGEgICA6IHsgKigucmVsYS5yb2RhdGEpCX0KKyAgLnJlbC5nb3QgICAgICAgOiB7ICooLnJlbC5nb3QpCQl9CisgIC5yZWxhLmdvdCAgICAgIDogeyAqKC5yZWxhLmdvdCkJCX0KKyAgLnJlbC5jdG9ycyAgICAgOiB7ICooLnJlbC5jdG9ycykJfQorICAucmVsYS5jdG9ycyAgICA6IHsgKigucmVsYS5jdG9ycykJfQorICAucmVsLmR0b3JzICAgICA6IHsgKigucmVsLmR0b3JzKQl9CisgIC5yZWxhLmR0b3JzICAgIDogeyAqKC5yZWxhLmR0b3JzKQl9CisgIC5yZWwuYnNzICAgICAgIDogeyAqKC5yZWwuYnNzKQkJfQorICAucmVsYS5ic3MgICAgICA6IHsgKigucmVsYS5ic3MpCQl9CisgIC5yZWwucGx0ICAgICAgIDogeyAqKC5yZWwucGx0KQkJfQorICAucmVsYS5wbHQgICAgICA6IHsgKigucmVsYS5wbHQpCQl9CisgIC5pbml0ICAgICAgICAgIDogeyAqKC5pbml0KQl9CisgIC5wbHQgOiB7ICooLnBsdCkgfQorICAudGV4dCAgICAgIDoKKyAgeworICAgICooLnRleHQpCisgICAgKiguZ290MSkKKyAgIH0gOnRleHQKKyAgICBfZXRleHQgPSAuOworICAgIFBST1ZJREUgKGV0ZXh0ID0gLik7CisgICAgLnJvZGF0YSAgICA6CisgICB7CisgICAgKiguZWhfZnJhbWUpCisgICAgKihTT1JUX0JZX0FMSUdOTUVOVChTT1JUX0JZX05BTUUoLnJvZGF0YSopKSkKKyAgfSA6dGV4dAorICAuZmluaSAgICAgIDogeyAqKC5maW5pKSAgICB9ID0wCisgIC5jdG9ycyAgICAgOiB7ICooLmN0b3JzKSAgIH0KKyAgLmR0b3JzICAgICA6IHsgKiguZHRvcnMpICAgfQorCisgIC8qIFJlYWQtd3JpdGUgc2VjdGlvbiwgbWVyZ2VkIGludG8gZGF0YSBzZWdtZW50OiAqLworICAuID0gKC4gKyAweDAwRkYpICYgMHhGRkZGRkYwMDsKKyAgX2Vyb3RleHQgPSAuOworICBQUk9WSURFIChlcm90ZXh0ID0gLik7CisgIC5yZWxvYyAgIDoKKyAgeworICAgICooLmdvdCkKKyAgICBfR09UMl9UQUJMRV8gPSAuOworICAgICooLmdvdDIpCisgICAgX0ZJWFVQX1RBQkxFXyA9IC47CisgICAgKiguZml4dXApCisgIH0KKyAgX19nb3QyX2VudHJpZXMgPSAoX0ZJWFVQX1RBQkxFXyAtIF9HT1QyX1RBQkxFXykgPj4gMjsKKyAgX19maXh1cF9lbnRyaWVzID0gKC4gLSBfRklYVVBfVEFCTEVfKSA+PiAyOworCisgIC5kYXRhICAgIDoKKyAgeworICAgICooLmRhdGEpCisgICAgKiguZGF0YTEpCisgICAgKiguc2RhdGEpCisgICAgKiguc2RhdGEyKQorICAgICooLmR5bmFtaWMpCisgICAgQ09OU1RSVUNUT1JTCisgIH0KKyAgX2VkYXRhICA9ICAuOworICBQUk9WSURFIChlZGF0YSA9IC4pOworCisgIC4gPSAuOworICBfX3VfYm9vdF9jbWRfc3RhcnQgPSAuOworICAudV9ib290X2NtZCA6IHsgKigudV9ib290X2NtZCkgfQorICBfX3VfYm9vdF9jbWRfZW5kID0gLjsKKworICAuID0gLjsKKyAgX19zdGFydF9fX2V4X3RhYmxlID0gLjsKKyAgX19leF90YWJsZSA6IHsgKihfX2V4X3RhYmxlKSB9CisgIF9fc3RvcF9fX2V4X3RhYmxlID0gLjsKKworICAuID0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WwuY3RvcnMgICAgIDogeyAqKC5yZWwuY3RvcnMpCX0KKyAgLnJlbGEuY3RvcnMgICAgOiB7ICooLnJlbGEuY3RvcnMpCX0KKyAgLnJlbC5kdG9ycyAgICAgOiB7ICooLnJlbC5kdG9ycykJfQorICAucmVsYS5kdG9ycyAgICA6IHsgKigucmVsYS5kdG9ycykJfQorICAucmVsLmJzcyAgICAgICA6IHsgKigucmVsLmJzcykJCX0KKyAgLnJlbGEuYnNzICAgICAgOiB7ICooLnJlbGEuYnNzKQkJfQorICAucmVsLnBsdCAgICAgICA6IHsgKigucmVsLnBsdCkJCX0KKyAgLnJlbGEucGx0ICAgICAgOiB7ICooLnJlbGEucGx0KQkJfQorICAuaW5pdCAgICAgICAgICA6IHsgKiguaW5pdCkJfQorICAucGx0IDogeyAqKC5wbHQpIH0KKyAgLnRleHQgICAgICA6CisgIHsKKyAgICAqKC50ZXh0KQorICAgICooLmdvdDEpCisgICB9IDp0ZXh0CisgICAgX2V0ZXh0ID0gLjsKKyAgICBQUk9WSURFIChldGV4dCA9IC4pOworICAgIC5yb2RhdGEgICAgOgorICAgeworICAgICooLmVoX2ZyYW1lKQorICAgICooU09SVF9CWV9BTElHTk1FTlQoU09SVF9CWV9OQU1FKC5yb2RhdGEqKSkpCisgIH0gOnRleHQKKyAgLmZpbmkgICAgICA6IHsgKiguZmluaSkgICAgfSA9MAorICAuY3RvcnMgICAgIDogeyAqKC5jdG9ycykgICB9CisgIC5kdG9ycyAgICAgOiB7ICooLmR0b3JzKSAgIH0KKworICAvKiBSZWFkLXdyaXRlIHNlY3Rpb24sIG1lcmdlZCBpbnRvIGRhdGEgc2VnbWVudDogKi8KKyAgLiA9ICguICsgMHgwMEZGKSAmIDB4RkZGRkZGMDA7CisgIF9lcm90ZXh0ID0gLjsKKyAgUFJPVklERSAoZXJvdGV4dCA9IC4pOworICAucmVsb2MgICA6CisgIHsKKyAgICAqKC5nb3QpCisgICAgX0dPVDJfVEFCTEVfID0gLjsKKyAgICAqKC5nb3QyKQorICAgIF9GSVhVUF9UQUJMRV8gPSAuOworICAgICooLmZpeHVwKQorICB9CisgIF9fZ290Ml9lbnRyaWVzID0gKF9GSVhVUF9UQUJMRV8gLSBfR09UMl9UQUJMRV8pID4+IDI7CisgIF9fZml4dXBfZW50cmllcyA9ICguIC0gX0ZJWFVQX1RBQkxFXykgPj4gMjsKKworICAuZGF0YSAgICA6CisgIHsKKyAgICAqKC5kYXRhKQorICAgICooLmRhdGExKQorICAgICooLnNkYXRhKQorICAgICooLnNkYXRhMikKKyAgICAqKC5keW5hbWljKQorICAgIENPTlNUUlVDVE9SUworICB9CisgIF9lZGF0YSAgPSAgLjsKKyAgUFJPVklERSAoZWRhdGEgPSAuKTsKKworICAuID0gLjsKKyAgX191X2Jvb3RfY21kX3N0YXJ0ID0gLjsKKyAgLnVfYm9vdF9jbWQgOiB7ICooLnVfYm9vdF9jbWQpIH0KKyAgX191X2Jvb3RfY21kX2VuZCA9IC47CisKKyAgLiA9IC47CisgIF9fc3RhcnRfX19leF90YWJsZSA9IC47CisgIF9fZXhfdGFibGUgOiB7ICooX19leF90YWJsZSkgfQorICBfX3N0b3BfX19leF90YWJsZSA9IC47CisKKyAgLiA9IEFMSUdOKDI1Nik7CisgIF9faW5pdF9iZWdpbiA9IC47CisgIC50ZXh0LmluaXQgOiB7ICooLnRleHQuaW5pdCkgfQorICAuZGF0YS5pbml0IDogeyAqKC5kYXRhLmluaXQpIH0KKyAgLiA9IEFMSUdOKDI1Nik7CisgIF9faW5pdF9lbmQgPSAuOworCisgIC5ib290cGcgUkVTRVRfVkVDVE9SX0FERFJFU1MgLSAweGZmYyA6CisgIHsKKyAgICBhcmNoL3BwYy9jcHUvbXBjODV4eC9zdGFydC5vCSguYm9vdHBnKQorICB9IDp0ZXh0ID0gMHhmZmZmCisKKyAgLnJlc2V0dmVjIFJFU0VUX1ZFQ1RPUl9BRERSRVNTIDoKKyAgeworICAgICooLnJlc2V0dmVjKQorICB9IDp0ZXh0ID0g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QorCVJFU1RfMTBHUFJTKDEzLCByMSkKKwlSRVNUXzhHUFJTKDIzLCByMSkKKwlSRVNUX0dQUigzMSwgcjEpCisJbHd6CXIyLF9OSVAocjEpCS8qIFJlc3RvcmUgZW52aXJvbm1lbnQgKi8KKwlsd3oJcjAsX01TUihyMSkKKwltdHNwcglTUlIwLHIyCisJbXRzcHIJU1JSMSxyMAorCWx3eglyMCxHUFIwKHIxKQorCWx3eglyMixHUFIyKHIxKQorCWx3eglyMSxHUFIxKHIxKQorCVNZTkMKKwlyZmkKKworCS5nbG9ibAlkY19yZWFkCitkY19yZWFkOgorCWJscgorCisJLmdsb2JsIGdldF9wdnIKK2dldF9wdnI6CisJbWZzcHIJcjMsIFBWUgorCWJscgorCisJLmdsb2JsIGdldF9zdnIKK2dldF9zdnI6CisJbWZzcHIJcjMsIFNWUgorCWJscgorCisKKy8qCisgKiBGdW5jdGlvbjoJaW44CisgKiBEZXNjcmlwdGlvbjoJSW5wdXQgOCBiaXRzCisgKi8KKwkuZ2xvYmwJaW44Citpbjg6CisJbGJ6CXIzLDB4MDAwMChyMykKKwlibHIKKworLyoKKyAqIEZ1bmN0aW9uOglvdXQ4CisgKiBEZXNjcmlwdGlvbjoJT3V0cHV0IDggYml0cworICovCisJLmdsb2JsCW91dDgKK291dDg6CisJc3RiCXI0LDB4MDAwMChyMykKKwlibHIKKworLyoKKyAqIEZ1bmN0aW9uOglvdXQxNgorICogRGVzY3JpcHRpb246CU91dHB1dCAxNiBiaXRzCisgKi8KKwkuZ2xvYmwJb3V0MTYKK291dDE2OgorCXN0aAlyNCwweDAwMDAocjMpCisJYmxyCisKKy8qCisgKiBGdW5jdGlvbjoJb3V0MTZyCisgKiBEZXNjcmlwdGlvbjoJQnl0ZSByZXZlcnNlIGFuZCBvdXRwdXQgMTYgYml0cworICovCisJLmdsb2JsCW91dDE2cgorb3V0MTZyOgorCXN0aGJyeAlyNCxyMCxyMworCWJscgorCisvKgorICogRnVuY3Rpb246CW91dDMyCisgK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CWJyZWFrOworCQlzcCA9ICh1bnNpZ25lZCBsb25nICopKnNwOworCX0KKwlwcmludGYoIlxuIik7Cit9CisKK3ZvaWQKK3Nob3dfcmVncyhzdHJ1Y3QgcHRfcmVncyAqcmVncykKK3sKKwlpbnQgaTsKKworCXByaW50ZigiTklQOiAlMDhsWCBYRVI6ICUwOGxYIExSOiAlMDhsWCBSRUdTOiIKKwkgICAgICAgIiAlcCBUUkFQOiAlMDRseCBEQVI6ICUwOGxYXG4iLAorCSAgICAgICByZWdzLT5uaXAsIHJlZ3MtPnhlciwgcmVncy0+bGluaywgcmVncywgcmVncy0+dHJhcCwgcmVncy0+ZGFyKTsKKwlwcmludGYoIk1TUjogJTA4bHggRUU6ICUwMXggUFI6ICUwMXggRlA6IgorCSAgICAgICAiICUwMXggTUU6ICUwMXggSVIvRFI6ICUwMXglMDF4XG4iLAorCSAgICAgICByZWdzLT5tc3IsIHJlZ3MtPm1zciAmIE1TUl9FRSA/IDEgOiAwLAorCSAgICAgICByZWdzLT5tc3IgJiBNU1JfUFIgPyAxIDogMCwgcmVncy0+bXNyICYgTVNSX0ZQID8gMSA6IDAsCisJICAgICAgIHJlZ3MtPm1zciAmIE1TUl9NRSA/IDEgOiAwLCByZWdzLT5tc3IgJiBNU1JfSVIgPyAxIDogMCwKKwkgICAgICAgcmVncy0+bXNyICYgTVNSX0RSID8gMSA6IDApOworCisJcHJpbnRmKCJcbiIpOworCWZvciAoaSA9IDA7IGkgPCAzMjsgaSsrKSB7CisJCWlmICgoaSAlIDgpID09IDApIHsKKwkJCXByaW50ZigiR1BSJTAyZDogIiwgaSk7CisJCX0KKworCQlwcmludGYoIiUwOGxYICIsIHJlZ3MtPmdwcltpXSk7CisJCWlmICgoaSAlIDgpID09IDcpIHsKKwkJCXByaW50ZigiXG4iKTsKKwkJfQorCX0KK30KKworCit2b2lkCitfZXhjZXB0aW9uKGludCBzaWduciwgc3RydWN0IHB0X3JlZ3MgKnJlZ3MpCit7CisJc2hvd19yZWdz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Y3QgcHRfcmVncyopKTsKK2ludCAgYmVkYnVnODYwX2ZpbmRfZW1wdHkgX19QKCh2b2lkKSk7CitpbnQgIGJlZGJ1Zzg2MF9zZXQgX19QKChpbnQsdW5zaWduZWQgbG9uZykpOworaW50ICBiZWRidWc4NjBfY2xlYXIgX19QKChpbnQpKTsKKworDAorLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogSW5pdGlhbGl6ZSB0aGUgZ2xvYmFsIGJ1Z19jdHggc3RydWN0dXJlIGZvciB0aGUgTVBDODYwLiAgQ2xlYXIgYWxsCisgKiBvZiB0aGUgYnJlYWtwb2ludHMuCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCisKK3ZvaWQgYmVkYnVnODYwX2luaXQoIHZvaWQgKQoreworICBpbnQJaTsKKyAgLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKworICBidWdfY3R4Lmh3X2RlYnVnX2VuYWJsZWQgPSAwOworICBidWdfY3R4LnN0b3BwZWQgPSAwOworICBidWdfY3R4LmN1cnJlbnRfYnAgPSAwOworICBidWdfY3R4LnJlZ3MgPSBOVUxMOworCisgIGJ1Z19jdHguZG9fYnJlYWsgICA9IGJlZGJ1Zzg2MF9kb19icmVhazsKKyAgYnVnX2N0eC5icmVha19pc3IgID0gYmVkYnVnODYwX2JyZWFrX2lzcjsKKyAgYnVnX2N0eC5maW5kX2VtcHR5ID0gYmVkYnVnODYwX2ZpbmRfZW1wdHk7CisgIGJ1Z19jdHguc2V0ICAgICAgICA9IGJlZGJ1Zzg2MF9zZXQ7CisgIGJ1Z19jdHguY2xlYXIgICAgICA9IGJlZGJ1Zzg2MF9jbGVhcjsKKworICBmb3IoIGkgPSAxOyBpIDw9IE1BWF9CUkVBS19QT0lOVFM7ICsraSApCisgICAgKCpidWdfY3R4LmNsZWFyKSggaSApOworCisgIHB1dHMgKCJCRURCVUc6cmVhZHlcbiIpOworICByZXR1cm47Cit9IC8qIGJlZGJ1Z19pbml0X2JyZWFrcG9pbnRzICovCisKKworDAorLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogU2V0L2NsZWFyL3Nob3cgb25lIG9mIHRoZSBoYXJkd2FyZSBicmVha3BvaW50cyBmb3IgdGhlIDg2MC4gIFRoZSAib2ZmIgorICogc3RyaW5nIHdpbGwgZGlzYWJsZSBhIHNwZWNpZmljIGJyZWFrcG9pbnQuICBUaGUgInNob3ciIHN0cmluZyB3aWxsCisgKiBkaXNwbGF5IHRoZSBjdXJyZW50IGJyZWFrcG9pbnRzLiAgT3RoZXJ3aXNlIGFuIGFkZHJlc3Mgd2lsbCBzZXQgYQorICogYnJlYWtwb2ludCBhdCB0aGF0IGFkZHJlc3MuICBTZXR0aW5nIGEgYnJlYWtwb2ludCB1c2VzIHRoZSBDUFUtc3BlY2lmaWMKKyAqIHNldCByb3V0aW5lIHdoaWNoIHdpbGwgYXNzaWduIGEgYnJlYWtwb2ludCBudW1iZXIuCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCisKK3ZvaWQgYmVkYnVnODYwX2RvX2JyZWFrIChjbWRfdGJsX3QgKmNtZHRwLCBpbnQgZmxhZywgaW50IGFyZ2MsCisJCQkgY2hhciAqYXJndltdKQoreworICBsb25nCQlhZGRyID0gMDsgICAgICAgLyogQWRkcmVzcyB0byBicmVhayBhdCAgKi8KKyAgaW50CQl3aGljaF9icDsgICAgICAgLyogQnJlYWtwb2ludCBudW1iZXIgICAgKi8KKyAgLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKworICBpZiAoYXJnYyA8IDIpCisgIHsKKyAgICBjbWRfdXNhZ2UoY21kdHApOworICAgIHJldHVybjsKKyAgfQorCisgIC8qIFR1cm4gb2ZmIGEgYnJlYWtwb2ludCAqLworCisgIGlmKCBzdHJjbXAoIGFyZ3ZbIDEgXSwgIm9mZiIgKSA9PSAwICkKKyAgeworICAgIGlmKCBidWdfY3R4Lmh3X2RlYnVnX2VuYWJsZWQgPT0gMCApCisgICAgeworICAgICAgcHJpbnRmKCAiTm8gYnJlYWtwb2ludHMgZW5hYmxlZFxuIiApOworICAgICAgcmV0dXJuOworICAgIH0KKworICAgIHdoaWNoX2JwID0gc2ltcGxlX3N0cnRvdWwoIGFyZ3ZbIDIgXSwgTlVMTCwgMTAgKTsKKworICAgIGlmKCBidWdfY3R4LmNsZWFyICkKKyAgICAgICgqYnVnX2N0eC5jbGVhcikoIHdoaWNoX2JwICk7CisKKyAgICBwcmludGYoICJCcmVha3BvaW50ICVkIHJlbW92ZWRcbiIsIHdoaWNoX2JwICk7CisgICAgcmV0dXJuOworICB9CisKKyAgLyogU2hvdyBhIGxpc3Qgb2YgYnJlYWtwb2ludHMgKi8KKworICBpZiggc3RyY21wKCBhcmd2WyAxIF0sICJzaG93IiApID09IDAgKQorICB7CisgICAgZm9yKCB3aGljaF9icCA9IDE7IHdoaWNoX2JwIDw9IE1BWF9CUkVBS19QT0lOVFM7ICsrd2hpY2hfYnAgKQorICAgIHsKKworICAgICAgc3dpdGNoKCB3aGljaF9icCApCisgICAgICB7CisgICAgICBjYXNlIDE6IGFkZHIgPSBHRVRfQ01QQSgpOyBicmVhazsKKyAgICAgIGNhc2UgMjogYWRkciA9IEdFVF9DTVBCKCk7IGJyZWFrOworICAgICAgY2FzZSAzOiBhZGRyID0gR0VUX0NNUEMoKTsgYnJlYWs7CisgICAgICBjYXNlIDQ6IGFkZHIgPSBHRVRfQ01QRCgpOyBicmVhazsKKyAgICAgIH0KKworICAgICAgcHJpbnRmKCAiQnJlYWtwb2ludCBbJWRdOiAiLCB3aGljaF9icCApOworICAgICAgaWYoIGFkZHIgPT0gMCApCisJcHJpbnRmKCAiTk9UIFNFVFxuIiApOworICAgICAgZWxzZQorCWRpc3BwYyggKHVuc2lnbmVkIGNoYXIgKilhZGRyLCAwLCAxLCBiZWRidWdfcHV0cywgRl9SQURIRVggKTsKKyAgICB9CisgICAgcmV0dXJuOworICB9CisKKyAgLyogU2V0IGEgYnJlYWtwb2ludCBhdCB0aGUgYWRkcmVzcyAqLworCisgIGlmKCAhaXNkaWdpdCggYXJndlsgMSBdWyAwIF0pKQorICB7CisgICAgY21kX3VzYWdlKGNtZHRwKTsKKyAgICByZXR1cm47CisgIH0KKworICBhZGRyID0gc2ltcGxlX3N0cnRvdWwoIGFyZ3ZbIDEgXSwgTlVMTCwgMTYgKSAmIDB4ZmZmZmZmZmM7CisKKyAgaWYoKCBidWdfY3R4LnNldCApICYmICggd2hpY2hfYnAgPSAoKmJ1Z19jdHguc2V0KSggMCwgYWRkciApKSA+IDAgKQorICB7CisgICAgcHJpbnRmKCAiQnJlYWtwb2ludCBbJWRdOiAiLCB3aGljaF9icCApOworICAgIGRpc3BwYyggKHVuc2lnbmVkIGNoYXIgKilhZGRyLCAwLCAxLCBiZWRidWdfcHV0cywgRl9SQURIRVggKTsKKyAgfQorCisgIHJldHVybjsKK30gLyogYmVkYnVnODYwX2RvX2JyZWFrICovCisKKworDAorLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogSGFuZGxlIGEgYnJlYWtwb2ludC4gIEZpcnN0IGRldGVybWluZSB3aGljaCBicmVha3BvaW50IHdhcyBoaXQgYnkKKyAqIGxvb2tpbmcgYXQgdGhlIERlQnVnIFN0YXR1cyBSZWdpc3RlciAoREJTUiksIGNsZWFyIHRoZSBicmVha3BvaW50CisgKiBhbmQgZW50ZXIgYSBtaW5pIG1haW4gbG9vc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gYmVkYnVnX21haW5fbG9vcCggYWRkciwgcmVncyApOworICByZXR1cm47Cit9IC8qIGJlZGJ1Zzg2MF9icmVha19pc3IgKi8KKworCisMCisvKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMb29rIHRocm91Z2ggYWxsIG9mIHRoZSBoYXJkd2FyZSBicmVha3BvaW50cyBhdmFpbGFibGUgdG8gc2VlIGlmIG9uZQorICogaXMgdW51c2VkLgorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworCitpbnQgYmVkYnVnODYwX2ZpbmRfZW1wdHkoIHZvaWQgKQoreworICAvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworCisgIGlmKCBHRVRfQ01QQSgpID09IDAgKQorICAgIHJldHVybiAxOworCisgIGlmKCBHRVRfQ01QQigpID09IDAgKQorICAgIHJldHVybiAyOworCisgIGlmKCBHRVRfQ01QQygpID09IDAgKQorICAgIHJldHVybiAzOworCisgIGlmKCBHRVRfQ01QRCgpID09IDAgKQorICAgIHJldHVybiA0OworCisgIHJldHVybiAwOworfSAvKiBiZWRidWc4NjBfZmluZF9lbXB0eSAqLworCisKKwwKKy8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIFNldCBhIGJyZWFrcG9pbnQuICBJZiAnd2hpY2hfYnAnIGlzIHplcm8gdGhlbiBmaW5kIGFuIHVudXNlZCBicmVha3BvaW50CisgKiBudW1iZXIsIG90aGVyd2lzZSByZWFzc2lnbiB0aGUgZ2l2ZW4gYnJlYWtwb2ludC4gIElmIGhhcmR3YXJlIGRlYnVnZ2luZworICogaXMgbm90IGVuYWJsZWQsIHRoZW4gdHVybiBpd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gKElEQ19FTkFCTEUpOworCWVsc2UKKwkJd3JfaWNfY3N0IChJRENfRElTQUJMRSk7CisKKwlfX2FzbV9fIHZvbGF0aWxlICgiaXN5bmMiKTsKKworCXJldHVybiBsaW5lcyA8PCA0OworfTsKKworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogTDEgZC1jYWNoZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogdGhlIHN0YW5kYXJkIDg2MCBoYXMgMTI4IHNldHMgb2YgMTYgYnl0ZXMgaW4gMiB3YXlzICg9IDQga0IpICAgICAgICAgICAgICAqLworLyogdGhlIDg2MCBQIChwbHVzKSBoYXMgMjU2IHNldHMgb2YgMTYgYnl0ZXMgaW4gMiB3YXlzICg9IDgga0IpICAgICAgICAgICAgICAqLworLyogY2FsbCB3aXRoIGNhY2hlIGRpc2FibGVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworCitpbnQgY2hlY2tkY2FjaGUgKHZvaWQpCit7CisJdm9sYXRpbGUgaW1tYXBfdCAqaW1tYXAgPSAoaW1tYXBfdCAqKSBDT05GSUdfU1lTX0lNTVI7CisJdm9sYXRpbGUgbWVtY3RsOHh4X3QgKm1lbWN0bCA9ICZpbW1hcC0+aW1fbWVtY3RsOworCXUzMiBjYWNoZW9uID0gcmRfZGNfY3N0ICgpICYgSURDX0VOQUJMRUQ7CisKKyNpZmRlZiBDT05GSUdfSVA4NngKKwl1MzIgayA9IG1lbWN0bC0+bWVtY19icjEgJiB+MHgwMDAwN2ZmZjsJLyogcHJvYmUgaW4gZmxhc2ggbWVtb3J5YXJlYSAqLworI2Vsc2UKKwl1MzIgayA9IG1lbWN0bC0+bWVtY19icjAgJiB+MHgwMDAwN2ZmZjsJLy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YKKwkJCX0KKwkJfQorCX0KKwlpZiAocGh5YWRkciA8IDApIHsKKwkJcHJpbnRmKCJObyBQSFkgZGV2aWNlIGZvdW5kLlxuIik7CisJfQorCXJldHVybiBwaHlhZGRyOworfQorI2VuZGlmCS8qIENPTkZJR19TWVNfRElTQ09WRVJfUEhZICovCisKKyNpZiAoZGVmaW5lZChDT05GSUdfTUlJKSB8fCBkZWZpbmVkKENPTkZJR19DTURfTUlJKSkgJiYgIWRlZmluZWQoQ09ORklHX0JJVEJBTkdNSUkpCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBtaWlfaW5pdCAtLSBJbml0aWFsaXplIHRoZSBNSUkgdmlhIEZFQyAxIGZvciBNSUkgY29tbWFuZCB3aXRob3V0IGV0aGVybmV0CisgKiBUaGlzIGZ1bmN0aW9uIGlzIGEgc3Vic2V0IG9mIGV0aF9pbml0CisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICovCitzdGF0aWMgdm9pZCBfX21paV9pbml0KHZvaWQpCit7CisJdm9sYXRpbGUgaW1tYXBfdCAqaW1tciA9IChpbW1hcF90ICopIENPTkZJR19TWVNfSU1NUjsKKwl2b2xhdGlsZSBmZWNfdCAqZmVjcCA9ICYoaW1tci0+aW1fY3BtLmNwX2ZlYyk7CisKKwlpZiAoZmVjX3Jlc2V0KGZlY3ApIDwgMCkKKwkJcHJpbnRmICgiRkVDX1JFU0VUX0RFTEFZIHRpbWVvdXRcbiIpOworCisJLyogV2UgdXNlIHN0cmljdGx5IHBvbGxpbmcgbW9kZSBvbmx5CisJICovCisJZmVjcC0+ZmVjX2ltYXNrID0gMDsKKworCS8qIENsZWFyIGFueSBwZW5kaW5nIGludGVycnVwdAorCSAqLworCWZlY3AtPmZlY19pZXZlbnQgPSAweGZmYzA7CisKKw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pICEhISBTb3JyeSEKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworaW50IGZlYzh4eF9taWlwaHlfcmVhZChjaGFyICpkZXZuYW1lLCB1bnNpZ25lZCBjaGFyIGFkZHIsCisJCXVuc2lnbmVkIGNoYXIgIHJlZywgdW5zaWduZWQgc2hvcnQgKnZhbHVlKQoreworCXNob3J0IHJkcmVnOyAgICAvKiByZWdpc3RlciB3b3JraW5nIHZhbHVlICovCisKKyNpZmRlZiBNSUlfREVCVUcKKwlwcmludGYgKCJtaWlwaHlfcmVhZCgweCV4KSBAIDB4JXggPSAiLCByZWcsIGFkZHIpOworI2VuZGlmCisJcmRyZWcgPSBtaWlfc2VuZChta19taWlfcmVhZChhZGRyLCByZWcpKTsKKworCSp2YWx1ZSA9IHJkcmVnOworI2lmZGVmIE1JSV9ERUJVRworCXByaW50ZiAoIjB4JTA0eFxuIiwgKnZhbHVlKTsKKyNlbmRpZgorCXJldHVybiAwOworfQorCitpbnQgZmVjOHh4X21paXBoeV93cml0ZShjaGFyICpkZXZuYW1lLCB1bnNpZ25lZCBjaGFyICBhZGRyLAorCQl1bnNpZ25lZCBjaGFyICByZWcsIHVuc2lnbmVkIHNob3J0IHZhbHVlKQoreworCXNob3J0IHJkcmVnOyAgICAvKiByZWdpc3RlciB3b3JraW5nIHZhbHVlICovCisjaWZkZWYgTUlJX0RFQlVHCisJcHJpbnRmICgibWlpcGh5X3dyaXRlKDB4JXgpIEAgMHgleCA9ICIsIHJlZywgYWRkcik7CisjZW5kaWYKKwlyZHJlZyA9IG1paV9zZW5kKG1rX21paV93cml0ZShhZGRyLCByZWcsIHZhbHVlKSk7CisKKyNpZmRlZiBNSUlfREVCVUcKKwlwcmludGYgKCIweCUwNHhcbiIsIHZhbHVlKTsKKyNlbmRpZgorCXJldHVybiAwOworfQorI2VuZGlmCisKKyNlbmRpZgpkaWZmIC0tZ2l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RlIDxtcGM4eHhfaXJxLmg+CisjaW5jbHVkZSA8YXNtL3Byb2Nlc3Nvci5oPgorI2luY2x1ZGUgPGNvbW1wcm9jLmg+CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qCisgKiBDUE0gaW50ZXJydXB0IHZlY3RvciBmdW5jdGlvbnMuCisgKi8KK3N0cnVjdCBpbnRlcnJ1cHRfYWN0aW9uIHsKKwlpbnRlcnJ1cHRfaGFuZGxlcl90ICpoYW5kbGVyOworCXZvaWQgKmFyZzsKK307CisKK3N0YXRpYyBzdHJ1Y3QgaW50ZXJydXB0X2FjdGlvbiBjcG1fdmVjc1tDUE1WRUNfTlJdOworc3RhdGljIHN0cnVjdCBpbnRlcnJ1cHRfYWN0aW9uIGlycV92ZWNzW05SX0lSUVNdOworCitzdGF0aWMgdm9pZCBjcG1faW50ZXJydXB0X2luaXQgKHZvaWQpOworc3RhdGljIHZvaWQgY3BtX2ludGVycnVwdCAodm9pZCAqcmVncyk7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK2ludCBpbnRlcnJ1cHRfaW5pdF9jcHUgKHVuc2lnbmVkICpkZWNyZW1lbnRlcl9jb3VudCkKK3sKKwl2b2xhdGlsZSBpbW1hcF90ICppbW1yID0gKGltbWFwX3QgKikgQ09ORklHX1NZU19JTU1SOworCisJKmRlY3JlbWVudGVyX2NvdW50ID0gZ2V0X3RiY2xrICgpIC8gQ09ORklHX1NZU19IWjsKKworCS8qIGRpc2FibGUgYWxsIGludGVycnVwdHMgKi8KKwlpbW1yLT5pbV9zaXVfY29uZi5zY19zaW1hc2sgPSAwOworCisJLyogQ29uZmlndXJlIENQTSBpbnRlcnJ1cHRzICovCisJY3BtX2ludGVycnVwdF9pbml0ICgpOworCisJcmV0dXJuICgwKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyoKKyAqIEhhbmRsZSBleHRlcm5hbCBpbnRlcnJ1cHRzCisgKi8KK3ZvaWQgZXh0ZXJuYWxfaW50ZXJydXB0IChzdHJ1Y3QgcHRfcmVncyAqcmVncykKK3sKKwl2b2xhdGlsZSBpbW1hcF90ICppbW1yID0gKGltbWFwX3QgKikgQ09ORklHX1NZU19JTU1SOworCWludCBpcnE7CisJdWxvbmcgc2ltYXNrLCBuZXdtYXNrOworCXVsb25nIHZlYywgdl9iaXQ7CisKKwkvKgorCSAqIHJlYWQgdGhlIFNJVkVDIHJlZ2lzdGVyIGFuZCBzaGlmdCB0aGUgYml0cyBkb3duCisJICogdG8gZ2V0IHRoZSBpcnEgbnVtYmVyCisJICovCisJdmVjID0gaW1tci0+aW1fc2l1X2NvbmYuc2Nfc2l2ZWM7CisJaXJxID0gdmVjID4+IDI2OworCXZfYml0ID0gMHg4MDAwMDAwMFVMID4+IGlycTsKKworCS8qCisJICogUmVhZCBJbnRlcnJ1cHQgTWFzayBSZWdpc3RlciBhbmQgTWFzayBJbnRlcnJ1cHRzCisJICovCisJc2ltYXNrID0gaW1tci0+aW1fc2l1X2NvbmYuc2Nfc2ltYXNrOworCW5ld21hc2sgPSBzaW1hc2sgJiAofigweEZGRkYwMDAwID4+IGlycSkpOworCWltbXItPmltX3NpdV9jb25mLnNjX3NpbWFzayA9IG5ld21hc2s7CisKKwlpZiAoIShpcnEgJiAweDEpKSB7CQkvKiBFeHRlcm5hbCBJbnRlcnJ1cHQgPyAgICAgKi8KKwkJdWxvbmcgc2llbDsKKworCQkvKgorCQkgKiBSZWFkIEludGVycnVwdCBFZGdlL0xldmVsIFJlZ2lzdGVyCisJCSAqLworCQlzaWVsID0gaW1tci0+aW1fc2l1X2NvbmYuc2Nfc2llbDsKKworCQlpZiAoc2llbCAmIHZfYml0KSB7CS8qIGVkZ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nID0gTlVMTDsKKwl9Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3N0YXRpYyB2b2lkIGNwbV9pbnRlcnJ1cHRfaW5pdCAodm9pZCkKK3sKKwl2b2xhdGlsZSBpbW1hcF90ICppbW1yID0gKGltbWFwX3QgKikgQ09ORklHX1NZU19JTU1SOworCisJLyoKKwkgKiBJbml0aWFsaXplIHRoZSBDUE0gaW50ZXJydXB0IGNvbnRyb2xsZXIuCisJICovCisKKwlpbW1yLT5pbV9jcGljLmNwaWNfY2ljciA9CisJCShDSUNSX1NDRF9TQ0M0IHwKKwkJIENJQ1JfU0NDX1NDQzMgfAorCQkgQ0lDUl9TQ0JfU0NDMiB8CisJCSBDSUNSX1NDQV9TQ0MxKSB8ICgoQ1BNX0lOVEVSUlVQVCAvIDIpIDw8IDEzKSB8IENJQ1JfSFBfTUFTSzsKKworCWltbXItPmltX2NwaWMuY3BpY19jaW1yID0gMDsKKworCS8qCisJICogSW5zdGFsbCB0aGUgZXJyb3IgaGFuZGxlci4KKwkgKi8KKwlpcnFfaW5zdGFsbF9oYW5kbGVyIChDUE1WRUNfRVJST1IsIGNwbV9lcnJvcl9pbnRlcnJ1cHQsIE5VTEwpOworCisJaW1tci0+aW1fY3BpYy5jcGljX2NpY3IgfD0gQ0lDUl9JRU47CisKKwkvKgorCSAqIEluc3RhbGwgdGhlIGNwbSBpbnRlcnJ1cHQgaGFuZGxlcgorCSAqLworCWlycV9pbnN0YWxsX2hhbmRsZXIgKENQTV9JTlRFUlJVUFQsIGNwbV9pbnRlcnJ1cHQsIE5VTEwpOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKgorICogdGltZXJfaW50ZXJydXB0IC0gZ2V0cyBjYWxsZWQgd2hlbiB0aGUgZGVjcmVtZW50ZXIg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jLiwgNTkgVGVtcGxlIFBsYWNlLCBTdWl0ZSAzMzAsIEJvc3RvbiwKKyAqIE1BIDAyMTExLTEzMDcgVVNBCisgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qICoqIEhFQURFUiBGSUxFUwkJCQkJCQkqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyogI2RlZmluZSBERUJVRyAqLworCisjaW5jbHVkZSA8Y29uZmlnLmg+CisjaW5jbHVkZSA8Y29tbW9uLmg+CisjaW5jbHVkZSA8Y29tbWFuZC5oPgorI2luY2x1ZGUgPHdhdGNoZG9nLmg+CisjaW5jbHVkZSA8dmVyc2lvbi5oPgorI2luY2x1ZGUgPHN0ZGFyZy5oPgorI2luY2x1ZGUgPGxjZHZpZGVvLmg+CisjaW5jbHVkZSA8bGludXgvdHlwZXMuaD4KKyNpbmNsdWRlIDxzdGRpb19kZXYuaD4KKyNpZiBkZWZpbmVkKENPTkZJR19QT1NUKQorI2luY2x1ZGUgPHBvc3QuaD4KKyNlbmRpZgorI2luY2x1ZGUgPGxjZC5oPgorCisjaWZkZWYgQ09ORklHX0xDRAorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogKiogQ09ORklHIFNUVUZGIC0tIHNob3VsZCBiZSBtb3ZlZCB0byBib2FyZCBjb25maWcgZmlsZQkJKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZuZGVmIENPTkZJR19MQ0RfSU5GTworI2RlZmluZSBDT05GSUdfTENEX0lORk8JCS8qIERpc3BsYXkgTG9nbywgKEMpIGFuZCBzeXN0ZW0gaW5mbwkq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lkKTsKKyNlbmRpZgorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogLS0tLS0tLS0tLS0tLS0tLS0gY2hpcHNldCBzcGVjaWZpYyBmdW5jdGlvbnMgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qCisgKiBDYWxjdWxhdGUgZmIgc2l6ZSBmb3IgVklERU9MRkJfQVRBRy4KKyAqLwordWxvbmcgY2FsY19mYnNpemUgKHZvaWQpCit7CisJdWxvbmcgc2l6ZTsKKwlpbnQgbGluZV9sZW5ndGggPSAocGFuZWxfaW5mby52bF9jb2wgKiBOQklUUyAocGFuZWxfaW5mby52bF9icGl4KSkgLyA4OworCisJc2l6ZSA9IGxpbmVfbGVuZ3RoICogcGFuZWxfaW5mby52bF9yb3c7CisKKwlyZXR1cm4gc2l6ZTsKK30KKwordm9pZCBsY2RfY3RybF9pbml0ICh2b2lkICpsY2RiYXNlKQoreworCXZvbGF0aWxlIGltbWFwX3QgKmltbXIgPSAoaW1tYXBfdCAqKSBDT05GSUdfU1lTX0lNTVI7CisJdm9sYXRpbGUgbGNkODIzX3QgKmxjZHAgPSAmaW1tci0+aW1fbGNkOworCisJdWludCBsY2NydG1wOworCXVpbnQgbGNoY3JfaHBjX3RtcDsKKworCS8qIEluaXRpYWxpemUgdGhlIExDRCBjb250cm9sIHJlZ2lzdGVyIGFjY29yZGluZyB0byB0aGUgTENECisJICogcGFyYW1ldGVycyBkZWZpbmVkLiAgV2UgZG8gZXZlcnl0aGluZyBoZXJlIGJ1dCBlbmFibGUKKwkgKiB0aGUgY29udHJvbGxlci4K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S0tLS0tLS0gKi8KK3N0YXRpYyB1Y2hhciAqcnhidWYgPQorICAodWNoYXIgKikmKChjcG04eHhfdCAqKSYoKGltbWFwX3QgKilDT05GSUdfU1lTX0lNTVIpLT5pbV9jcG0pLT5jcF9kcG1lbQorCQkJW0NPTkZJR19TWVNfU1BJX0lOSVRfT0ZGU0VUXTsKK3N0YXRpYyB1Y2hhciAqdHhidWYgPQorICAodWNoYXIgKikmKChjcG04eHhfdCAqKSYoKGltbWFwX3QgKilDT05GSUdfU1lTX0lNTVIpLT5pbV9jcG0pLT5jcF9kcG1lbQorCQkJW0NPTkZJR19TWVNfU1BJX0lOSVRfT0ZGU0VUK01BWF9CVUZGRVJdOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqICBGdW5jdGlvbjogICAgc3BpX2luaXRfZgorICoKKyAqICBEZXNjcmlwdGlvbjogSW5pdCBTUEktQ29udHJvbGxlciAoUk9NIHBhcnQpCisgKgorICogIHJldHVybjogICAgICAtLS0KKyAqCisgKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwordm9pZCBzcGlfaW5pdF9mICh2b2lkKQoreworCXVuc2lnbmVkIGludCBkcGFkZHI7CisKKwl2b2xhdGlsZSBzcGlfdCAqc3BpOworCXZvbGF0aWxlIGltbWFwX3QgKmltbXI7CisJdm9sYXRpbGUgY3BpYzh4eF90ICpjcGk7CisJdm9sYXRpbGUgY3BtOHh4X3QgKmNwOworCXZvbGF0aWxlIGlvcDh4eF90ICppb3A7CisJdm9sYXRpbGUgY2JkX3QgKnRiZGYsICpyYmRmOworCisJaW1tciA9IChpbW1hcF90ICopICBDT05GSUdfU1lTX0lNTVI7CisJY3BpICA9IChjcGljOHh4X3QgKikmaW1tci0+aW1fY3BpYzsKKwlpb3AgID0gKGlvcDh4eF90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5IGZvciBSWCBhbmQgVFggYnVmZmVycyAqLworCXJ4YnVmID0gKHVjaGFyICopIG1hbGxvYyAoTUFYX0JVRkZFUik7CisJdHhidWYgPSAodWNoYXIgKikgbWFsbG9jIChNQVhfQlVGRkVSKTsKKworCXJiZGYtPmNiZF9idWZhZGRyID0gKHVsb25nKSByeGJ1ZjsKKwl0YmRmLT5jYmRfYnVmYWRkciA9ICh1bG9uZykgdHhidWY7CisKKwlyZXR1cm47Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAgRnVuY3Rpb246ICAgIHNwaV93cml0ZQorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KK3NzaXplX3Qgc3BpX3dyaXRlICh1Y2hhciAqYWRkciwgaW50IGFsZW4sIHVjaGFyICpidWZmZXIsIGludCBsZW4pCit7CisJaW50IGk7CisKKwltZW1zZXQocnhidWYsIDAsIE1BWF9CVUZGRVIpOworCW1lbXNldCh0eGJ1ZiwgMCwgTUFYX0JVRkZFUik7CisJKnR4YnVmID0gU1BJX0VFUFJPTV9XUkVOOwkJLyogd3JpdGUgZW5hYmxlCQkqLworCXNwaV94ZmVyKDEpOworCW1lbWNweSh0eGJ1ZiwgYWRkciwgYWxlbik7CisJKnR4YnVmID0gU1BJX0VFUFJPTV9XUklURTsJCS8qIFdSSVRFIG1lbW9yeSBhcnJheQkqLworCW1lbWNweShhbGVuICsgdHhidWYsIGJ1ZmZlciwgbGVuKTsKKwlzcGlfeGZlcihhbGVuICsgbGVuKTsKKwkJCQkJCS8qIGlnbm9yZSByZWNlaXZlZCBkYXRhCSovCisJZm9yIChpID0gMDsgaSA8IDEwMDA7IGkrKykgeworCQkqdHhidWYgPSBTUElfRUVQUk9NX1JEU1I7CS8qIHJlYWQgc3RhdHVzCQkqLworCQl0eGJ1ZlsxXSA9IDA7CisJCXNwaV94ZmVyKDIpOworCQlpZiAoIShyeGJ1ZlsxXSAmIDEpKSB7CisJCQlicmVhazsKKwkJfQorCQl1ZGVsYXkoMTAwMCk7CisJfQorCWlmIChpID49IDEwMDApIHsKKwkJcHJpbnRmICgiKioqIHNwaV93cml0ZTogVGltZSBvdXQgd2hpbGUgd3JpdGluZyFcbiIpOworCX0KKworCXJldHVybiBsZW47Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAgRnVuY3Rpb246ICAgIHNwaV9yZWFkCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworc3NpemVfdCBzcGlfcmVhZCAodWNoYXIgKmFkZHIsIGludCBhbGVuLCB1Y2hhciAqYnVmZmVyLCBpbnQgbGVuKQoreworCW1lbXNldChyeGJ1ZiwgMCwgTUFYX0JVRkZFUik7CisJbWVtc2V0KHR4YnVmLCAwLCBNQVhfQlVGRkVSKTsKKwltZW1jcHkodHhidWYsIGFkZHIsIGFsZW4pOworCSp0eGJ1ZiA9IFNQSV9FRVBST01fUkVBRDsJCS8qIFJFQUQgbWVtb3J5IGFycmF5CSovCisKKwkvKgorCSAqIFRoZXJlIGlzIGEgYnVnIGluIDg2MFQgKD8pIHRoYXQgY3V0cyB0aGUgbGFzdCBieXRlIG9mIGlucHV0CisJICogaWYgd2UncmUgcmVhZGluZyBpbnRvIERQUkFNLiBUaGUgc29sdXRpb24gd2UgY2hvb3NlIGhlcmUgaXMKKwkgKiB0byBhbHdheXMgcmVhZCBsZW4rMSBieXRlcyAod2UgaGF2ZSBvbmUgZXh0cmEgYnl0ZSBhdCB0aGUKKwkgKiBlbmQgb2YgdGhlIGJ1ZmZlcikuCisJICovCisJc3BpX3hmZXIoYWxlbiArIGxlbiArIDEpOworCW1lbWNweShidWZmZXIsIGFsZW4gKyByeGJ1ZiwgbGVuKTsKKworCXJldHVybiBsZW47Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAgRnVuY3Rpb246ICAgIHNwaV94ZmVyCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworc3NpemVfdCBzcGlfeGZlciAoc2l6ZV90IGNvdW50KQoreworCXZvbGF0aWxlIGltbWFwX3QgKmltbXI7CisJdm9sYXRpbGUgY3BtOHh4X3QgKmNwOworCXZvbGF0aWxlIHNwaV90ICpzcGk7CisJY2JkX3QgKnRiZGYsICpyYmRmOworCXVzaG9ydCBsb29wOworCWludCB0bTsKKworCURQUklOVCAoKCIqKiogc3BpX3hmZXIgZW50ZXJlZCAqKipcbiIpKTsKKworCWltbXIgPSAoaW1tYXBfdCAqKSBDT05GSUdfU1lTX0lNTVI7CisJY3AgICA9IChjcG04eHhfdCAqKSAmaW1tci0+aW1fY3BtOworCisjaWZkZWYgQ09ORklHX1NZU19TUElfVUNPREVfUEFUQ0gKKwlzcGkgID0gKHNwaV90ICopJmNwLT5jcF9kcG1lbVtzcGktPnNwaV9ycGJhc2VdOworI2Vsc2UKKwlzcGkgID0gKHNwaV90ICopJmNwLT5jcF9kcGFyYW1bUFJPRkZfU1BJXTsKKwkvKiBEaXNhYmxlIHJlbG9jYXRpb24gKi8KKwlzcGktPnNwaV9ycGJhc2UgPSAwOworI2VuZGlmCisKKwl0YmRmID0gKGNiZF90ICopICYgY3AtPmNwX2RwbWVtW3NwaS0+c3BpX3RiYXNlXTsKKwlyYmRmID0gKGNiZF90ICopICYgY3AtPmNwX2RwbWVtW3NwaS0+c3BpX3JiYXNlXTsKKworCS8qIFNldCBDUyBmb3IgZGV2aWNlICovCisJY3AtPmNwX3BiZGF0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R3YXJlCisgKiBGb3VuZGF0aW9uLCBJbmMuLCA1OSBUZW1wbGUgUGxhY2UsIFN1aXRlIDMzMCwgQm9zdG9uLAorICogTUEgMDIxMTEtMTMwNyBVU0EKKyAqLworCisvKiAjZGVmaW5lIERFQlVHICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiAqKiBIRUFERVIgRklMRVMJCQkJCQkJKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNpbmNsdWRlIDxzdGRhcmcuaD4KKyNpbmNsdWRlIDxjb21tb24uaD4KKyNpbmNsdWRlIDxjb25maWcuaD4KKyNpbmNsdWRlIDx2ZXJzaW9uLmg+CisjaW5jbHVkZSA8dGltZXN0YW1wLmg+CisjaW5jbHVkZSA8aTJjLmg+CisjaW5jbHVkZSA8bGludXgvdHlwZXMuaD4KKyNpbmNsdWRlIDxzdGRpb19kZXYuaD4KKworI2lmZGVmIENPTkZJR19WSURFTworCitERUNMQVJFX0dMT0JBTF9EQVRBX1BUUjsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qICoqIERFQlVHIFNFVFRJTkdTCQkJCQkJCSovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjaWYgMAorI2RlZmluZSBWSURFT19ERUJVR19DT0xPUkJBUlMJLyogRm9yY2UgY29sb3JiYXJzIG91dHB1dCAqLworI2VuZGlmCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiAqKiBWSURFTyBNT0RFIFNFVFRJTkdTCQkJCQkJKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNpZiAwCisjZGVmaW5lIFZJREVPX01PREVfRVhURU5ERUQJCS8qIEFsbG93IHNjcmVlbiBzaXplIGJpZ2dlciB0aGFuIHZpc2libGUgYXJlYSAqLworI2RlZmluZSBWSURFT19NT0RFX05UU0MKKyNlbmRpZgorCisjZGVmaW5lIFZJREVPX01PREVfUEFMCisKKyNpZiAwCisjZGVmaW5lIFZJREVPX0JMSU5LCQkJLyogVGhpcyBlbmFibGVzIGN1cnNvciBibGlua2luZyAodW5kZXIgY29uc3RydWN0aW9uKSAqLworI2VuZGlmCisKKyNkZWZpbmUgVklERU9fSU5GTwkJCS8qIFNob3cgVS1Cb290IGluZm9ybWF0aW9uICovCisjZGVmaW5lIFZJREVPX0lORk9fWAkJVklERU9fTE9HT19XSURUSCs4CisjZGVmaW5lIFZJREVPX0lORk9fWQkJMTYKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qICoqIFZJREVPIEVOQ09ERVIgQ09OU1RBTlRTCQkJCQkJKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNpZmRlZiBDT05GSUdfVklERU9fRU5DT0RFUl9BRDcxNzYKKworI2luY2x1ZGUgPHZpZGVvX2FkNzE3Ni5oPgkvKiBTZXRzIGVuY29kZXIgZGF0YSwgbW9kZSwgYW5kIHZpc2libGUgYW5kIGFjdGl2ZSBhcmVhICovCisKKyNkZWZpbmUgVklERU9fSTJDCQkxCisjZGVmaW5lIFZJREVPX0kyQ19BRERSCQlDT05GSUdfVklERU9fRU5DT0RFUl9BRDcxNzZfQUREUgorI2VuZGlmCisKKyNpZmRlZiBDT05GSUdfVklERU9fRU5DT0RFUl9BRDcxNzcKKworI2luY2x1ZGUgPHZpZGVvX2FkNzE3Ny5oPgkvKiBTZXRzIGVuY29kZXIgZGF0YSwgbW9kZSwgYW5kIHZpc2libGUgYW5kIGFjdGl2ZSBhcmVhICovCisKKyNkZWZpbmUgVklERU9fSTJDCQkxCisjZGVmaW5lIFZJREVPX0kyQ19BRERSCQlDT05GSUdfVklERU9fRU5DT0RFUl9BRDcxNzdfQUREUgorI2VuZGlmCisKKyNpZmRlZiBDT05GSUdfVklERU9fRU5DT0RFUl9BRDcxNzkKKworI2luY2x1ZGUgPHZpZGVvX2FkNzE3OS5oPgkvKiBTZXRzIGVuY29kZXIgZGF0YSwgbW9kZSwgYW5kIHZpc2libGUgYW5kIGFjdGl2ZSBhcmVhICovCisKKyNkZWZpbmUgVklERU9fSTJDCQkxCisjZGVmaW5lIFZJREVPX0kyQ19BRERSCQlDT05GSUdfVklERU9fRU5DT0RFUl9BRDcxNzlfQUREUgorI2VuZGlmCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiAqKiBWSURFTyBNT0RFIENPTlNUQU5UUwkJCQkJCSovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjaWZkZWYgVklERU9fTU9ERV9FWFRFTkRFRAorI2RlZmluZSBWSURFT19DT0xTCVZJREVPX0FDVElWRV9DT0xTCisjZGVmaW5lIFZJREVPX1JPV1MJVklERU9fQUNUSVZFX1JPV1MKKyNlbHNlCisjZGVmaW5lIFZJREVPX0NPTFMJVklERU9fVklTSUJMRV9DT0xTCisjZGVmaW5lIFZJREVPX1JPV1MJVklERU9fVklTSUJMRV9ST1dTCisjZW5kaWYKKworI2RlZmluZSBWSURFT19QSVhFTF9TSVpFCShWSURFT19NT0RFX0JQUC84KQorI2RlZmluZSBWSURFT19TSVpFCQkoVklERU9fUk9XUypWSURFT19DT0xTKlZJREVPX1BJWEVMX1NJWkUpCS8qIFRvdGFsIHNpemUgb2YgYnVmZmVyICovCisjZGVmaW5lIFZJREVPX1BJWF9CTE9DS1MJKFZJREVPX1NJWkUgPj4gMikJLyogTnVtYmVyIG9mIGludHMgKi8KKyNkZWZpbmUgVklERU9fTElORV9MRU4JCShWSURFT19DT0xTKlZJREVPX1BJWEVMX1NJWkUpCS8qIE51bWJlciBvZiBieXRlcyBwZXIgbGluZSAqLworI2RlZmluZSBWSURFT19CVVJTVF9MRU4JCShWSURFT19DT0xTLzgpCisKKyNpZmRlZiBWSURFT19NT0RFX1lVWVYKKyNkZWZpbmUgVklERU9fQkdfQ09MCTB4ODBEODgwRDgJLyogQmFja2dyb3VuZCBjb2xvciBpbiBZVVlWIGZvcm1hdCAqLworI2Vsc2UKKyNkZWZpbmUgVklERU9fQkdfQ09MCTB4RjhGOEY4RjgJLyogQmFja2dyb3VuZCBjb2xvciBpbiBSR0IgZm9ybWF0ICovCisjZW5kaWYKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qICoqIEZPTlQgQU5EIExPR08gREFUQQkJCQkJCSovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjaW5jbHVkZSA8dmlkZW9fZm9udC5oPgkJCS8qIEdldCBmb250IGRhdGEsIHdpZHRoIGFuZCBoZWlnaHQgKi8KKworI2lmZGVmIENPTkZJR19WSURFT19MT0dPCisjaW5jbHVkZSA8dmlkZW9fbG9nby5oPgkJCS8qIEdldCBsb2dvIGRhdGEsIHdpZHRoIGFuZCBoZWlnaHQgKi8KKworI2RlZmluZSBWSURFT19MT0dPX1dJRFRICURFRl9VX0JPT1RfTE9HT19XSURUSAorI2RlZmluZSBWSURFT19MT0dPX0hFSUdIVAlERUZfVV9CT09UX0xPR09fSEVJR0hUCisjZGVmaW5lIFZJREVPX0xPR09fQUREUgkJJnVfYm9vdF9sb2dvCisjZW5kaWYKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qICoqIFZJREVPIENPTlRST0xMRVIgQ09OU1RBTlRTCQkJCQkqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyogVkNDUiAtIFZJREVPIENPTlRST0xMRVIgQ09ORklHVVJBVElPTiBSRUdJU1RFUiAqLworCisjZGVmaW5lIFZJREVPX1ZDQ1JfVk9OCTAJCS8qIFZpZGVvIGNvbnRyb2xsZXIgT04gKi8KKyNkZWZpbmUgVklERU9fVkNDUl9DU1JDCTEJCS8qIENsb2NrIHNvdXJjZSAqLworI2RlZmluZSBWSURFT19WQ0NSX1BERgkxMwkJLyogUGl4ZWwgZGlzcGxheSBmb3JtYXQgKi8KKyNkZWZpbmUgVklERU9fVkNDUl9JRU4JMTEJCS8qIEludGVycnVwdCBlbmFibGUgKi8KKworLyogVlNSIC0gVklERU8gU1RBVFVTIFJFR0lTVEVSICovCisKKyNkZWZpbmUgVklERU9fVlNSX0NBUwk2CQkvKiBBY3RpdmUgc2V0ICovCisjZGVmaW5lIFZJREVPX1ZTUl9FT0YJMAkJLyogRW5kIG9mIGZyYW1lICovCisKKy8qIFZDTVIgLSBWSURFTyBDT01NQU5EIFJFR0lTVEVSICovCisKKyNkZWZpbmUgVklERU9fVkNNUl9CRAkwCQkvKiBCbGFuayBkaXNwbGF5ICovCisjZGVmaW5lIFZJREVPX1ZDTVJfQVNFTAkxCQkvKiBBY3RpdmUgc2V0IHNlbGVjdGlvbiAqLworCisvKiBWQkNCIC0gVklERU8gQkFDS0dST1VORCBDT0xPUiBCVUZGRVIgUkVHSVNURVIgKi8KKworI2RlZmluZSBWSURFT19CQ1NSNF9SRVNFVF9CSVQJMjEJLyogQkNTUjQgLSBFeHRlcm4gdmlkZW8gZW5jb2RlciByZXNldCAqLworI2RlZmluZSBWSURFT19CQ1NSNF9FWFRDTEtfQklUCTIyCS8qIEJDU1I0IC0gRXh0ZXJuIGNsb2NrIGVuYWJsZSAqLworI2RlZmluZSBWSURFT19CQ1NSNF9WSURMRURfQklUCTIzCS8qIEJDU1I0IC0gVmlkZW8gbGVkIGRpc2FibGUgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qICoqIENPTlNPTEUgQ09OU1RBTlRTCQkJCQkJCSovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjaWZkZWYJQ09ORklHX1ZJREVPX0xPR08KKyNkZWZpbmUgQ09OU09MRV9ST1dTCQkoKFZJREVPX1JPV1MgLSBWSURFT19MT0dPX0hFSUdIVCkgLyBWSURFT19GT05UX0hFSUdIVCkKKyNkZWZpbmUgVklERU9fTE9HT19TS0lQCQkoVklERU9fQ09MUyAtIFZJREVPX0xPR09fV0lEVEgpCisjZWxzZQorI2RlZmluZSBDT05TT0xFX1JPV1MJCShWSURFT19ST1dTIC8gVklERU9fRk9OVF9IRUlHSFQpCisjZW5kaWYKKworI2RlZmluZSBDT05TT0xFX0NPTFMJCShWSURFT19DT0xTIC8gVklERU9fRk9OVF9XSURUSCkKKyNkZWZpbmUgQ09OU09MRV9ST1dfU0laRQkoVklERU9fRk9OVF9IRUlHSFQgKiBWSURFT19MSU5FX0xFTikKKyNkZWZpbmUgQ09OU09MRV9ST1dfRklSU1QJKHZpZGVvX2NvbnNvbGVfYWRkcmVzcykKKyNkZWZpbmUgQ09OU09MRV9ST1dfU0VDT05ECSh2aWRlb19jb25zb2xlX2FkZHJlc3MgKyBDT05TT0xFX1JPV19TSVpFKQorI2RlZmluZSBDT05TT0xFX1JPV19MQVNUCSh2aWRlb19jb25zb2xlX2FkZHJlc3MgKyBDT05TT0xFX1NJWkUgLSBDT05TT0xFX1JPV19TSVpFKQorI2RlZmluZSBDT05TT0xFX1NJWkUJCShDT05TT0xFX1JPV19TSVpFICogQ09OU09MRV9ST1dTKQorI2RlZmluZSBDT05TT0xFX1NDUk9MTF9TSVpFCShDT05TT0xFX1NJWkUgLSBDT05TT0xFX1JPV19TSVpFKQorCisvKgorICogU2ltcGxlIGNvbG9yIGRlZmluaXRpb25zCisgKi8KKyNkZWZpbmUgQ09OU09MRV9DT0xPUl9CTEFDSwkgMAorI2RlZmluZSBDT05TT0xFX0NPTE9SX1JFRAkgMQorI2RlZmluZSBDT05TT0xFX0NPTE9SX0dSRUVOCSAyCisjZGVmaW5lIENPTlNPTEVfQ09MT1JfWUVMTE9XCSAzCisjZGVmaW5lIENPTlNPTEVfQ09MT1JfQkxVRQkgNAorI2RlZmluZSBDT05TT0xFX0NPTE9SX01BR0VOVEEJIDUKKyNkZWZpbmUgQ09OU09MRV9DT0xPUl9DWUFOCSA2CisjZGVmaW5lIENPTlNPTEVfQ09MT1JfR1JFWQkxMworI2RlZmluZSBDT05TT0xFX0NPTE9SX0dSRVkyCTE0CisjZGVmaW5lIENPTlNPTEVfQ09MT1JfV0hJVEUJMTUJLyogTXVzdCByZW1haW4gbGFzdCAvIGhpZ2hlc3QgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qICoqIEJJVE9QUyBNQUNST1MJCQkJCQkJKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNkZWZpbmUgSElTSE9SVChpKQkoKGkgPj4gMTYpJjB4ZmZmZikKKyNkZWZpbmUgTE9TSE9SVChpKQkoaSAmIDB4ZmZmZikKKyNkZWZpbmUgSElDSEFSKHMpCSgoaSA+PiA4KSYweGZmKQorI2RlZmluZSBMT0NIQVIocykJKGkgJiAweGZmKQorI2RlZmluZSBISShjKQkJKChjID4+IDQpJjB4ZikKKyNkZWZpbmUgTE8oYykJCShjICYgMHhmKQorI2RlZmluZSBTV0FQSU5UKGkpCShISVNIT1JUKGkpIHwgKExPU0hPUlQoaSkgPDwgMTYpKQorI2RlZmluZSBTV0FQU0hPUlQocykJKEhJQ0hBUihzKSB8IChMT0NIQVIocykgPDwgOCkpCisjZGVmaW5lIFNXQVBDSEFSKGMpCShISShjKSB8IChMTyhjKSA8PCA0KSkKKyNkZWZpbmUgQklUTUFTSyhiKQkoMSA8PCAoYikpCisjZGVmaW5lIEdFVEJJVCh2LGIpCSgoKHYpICYgQklUTUFTSyhiKSkgPiAwKQorI2RlZmluZSBTRVRCSVQodixiLGQpCSh2ID0gKCgoZCk+MCkgPyAodikgfCBCSVRNQVNLKGIpOiAodikgJiB+QklUTUFTSyhiKSkpCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiAqKiBTVFJVQ1RVUkVTCQkJCQkJCSovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCit0eXBlZGVmIHN0cnVjdCB7CisJdW5zaWduZWQgY2hhciBWLCBZMSwgVSwgWTI7Cit9IHRZVVlWOworCisvKiBUaGlzIHN0cnVjdHVyZSBpcyBiYXNlZCBvbiB0aGUgVmlkZW8gUmFtIGluIHRoZSBNUEM4MjMuICovCit0eXBlZGVmIHN0cnVjdCBWUkFNIHsKKwl1bnNpZ25lZAloeDoyLAkJLyogSG9yaXpvbnRhbCBzeW5jICovCisJCQl2eDoyLAkJLyogVmVydGljYWwgc3luYyAqLworCQkJZng6MiwJCS8qIEZyYW1lICovCisJCQlieDoyLAkJLyogQmxh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B5IHBhbm5pbmcgdmFsdWUgKC0xMjcgKzEyNykgKi8KKwljb25zb2xlX2NvbCA9IDAsCQkvKiBDdXJzb3IgY29sICovCisJY29uc29sZV9yb3cgPSAwLAkJLyogQ3Vyc29yIHJvdyAqLworCXZpZGVvX3BhbGV0dGVbMTZdOwkJLyogT3VyIHBhbGV0dGUgKi8KKworc3RhdGljIGNvbnN0IGludCB2aWRlb19mb250X2RyYXdfdGFibGVbXSA9CisJeyAweDAwMDAwMDAwLCAweDAwMDBmZmZmLCAweGZmZmYwMDAwLCAweGZmZmZmZmZmIH07CisKK3N0YXRpYyBjaGFyCisJdmlkZW9fY29sb3JfZmcgPSAwLAkJLyogQ3VycmVudCBmZyBjb2xvciBpbmRleCAoMC0xNSkgKi8KKwl2aWRlb19jb2xvcl9iZyA9IDAsCQkvKiBDdXJyZW50IGJnIGNvbG9yIGluZGV4ICgwLTE1KSAqLworCXZpZGVvX2VuYWJsZSA9IDA7CQkvKiBWaWRlbyBoYXMgYmVlbiBpbml0aWFsaXplZD8gKi8KKworc3RhdGljIHZvaWQKKwkqdmlkZW9fZmJfYWRkcmVzcywJCS8qIEZyYW1lIGJ1ZmZlciBhZGRyZXNzICovCisJKnZpZGVvX2NvbnNvbGVfYWRkcmVzczsJCS8qIENvbnNvbGUgZnJhbWUgYnVmZmVyIHN0YXJ0IGFkZHJlc3MgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qICoqIE1FTU9SWSBGVU5DVElPTlMgKDMyYml0KQkJCQkJCSovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgdm9pZCBtZW1zZXRsIChpbnQgKnAsIGludCBjLCBpbnQgdikKK3sKKwl3aGlsZSAoYy0tKQorCQkqKHArKykgPSB2OworfQorCitzdGF0aWMgdm9pZCBtZW1jcHlsIChpbnQgKmQsIGludCAqcywgaW50IGMpCit7CisJd2hpbGUgKGMtLSkKKwkJKihkKyspID0gKihzKyspOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogKiogVklERU8gRFJBV0lORyBBTkQgQ09MT1IgRlVOQ1RJT05TCQkJCQkqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworc3RhdGljIGludCB2aWRlb19tYXByZ2IgKGludCByLCBpbnQgZywgaW50IGIpCit7CisjaWZkZWYgVklERU9fTU9ERV9ZVVlWCisJdW5zaWduZWQgaW50IHBSLCBwRywgcEI7CisJdFlVWVYgWVVZVjsKKwl1bnNpZ25lZCBpbnQgKnJldCA9ICh1bnNpZ25lZCBpbnQgKikgJllVWVY7CisKKwkvKiBUcmFuc2Zvcm0gKDAtMjU1KSBjb21wb25lbnRzIHRvICgwLTEwMCkgKi8KKworCXBSID0gciAqIDEwMCAvIDI1NTsKKwlwRyA9IGcgKiAxMDAgLyAyNTU7CisJcEIgPSBiICogMTAwIC8gMjU1OworCisJLyogQ2FsY3VsYXRlIFlVViB2YWx1ZXMgKDAtMjU1KSBmcm9tIFJHQiBiZWV0d2VlbiAwLTEwMCAqLworCisJWVVZVi5ZMSA9IFlVWVYuWTIgPSAyMDkgKiAocFIgKyBwRyArIHBCKSAvIDMwMCArIDE2OworCVlVWVYuVQk9IHBSIC0gKHBHICogMyAvIDQpIC0gKHBCIC8gNCkgKyAxMjg7CisJWVVZVi5WCT0gcEIgLSAocFIgLyA0KSAtIChwRyAqIDMgLyA0KSArIDEyODsKKwlyZXR1cm4gKnJldDsKKyNlbmRpZgorI2lmZGVmIFZJREVPX01PREVfUkdCCisJcmV0dXJuICgociA+PiAzKSA8PCAxMSkgfCAoKGcgPiAyKSA8PCA2KSB8IChiID4+IDMpOworI2VuZGlmCit9CisKK3N0YXRpYyB2b2lkIHZpZGVvX3NldHBhbGV0dGUgKGludCBjb2xvciwgaW50IHIsIGludCBnLCBpbnQgYikKK3sKKwljb2xvciAmPSAweGY7CisKKwl2aWRlb19wYWxldHRlW2NvbG9yXSA9IHZpZGVvX21hcHJnYiAociwgZywgYik7CisKKwkvKiBTd2FwIHZhbHVlcyBpZiBvdXIgcGFubmluZyBvZmZzZXQgaXMgb2RkICovCisJaWYgKHZpZGVvX3Bhbm5pbmdfdmFsdWVfeCAmIDEpCisJCXZpZGVvX3BhbGV0dGVbY29sb3JdID0gU1dBUElOVCAodmlkZW9fcGFsZXR0ZVtjb2xvcl0pOworfQorCitzdGF0aWMgdm9pZCB2aWRlb19maWxsIChpbnQgY29sb3IpCit7CisJbWVtc2V0bCAodmlkZW9fZmJfYWRkcmVzcywgVklERU9fUElYX0JMT0NLUywgY29sb3IpOworfQorCitzdGF0aWMgdm9pZCB2aWRlb19zZXRmZ2NvbG9yIChpbnQgaSkKK3sKKwl2aWRlb19jb2xvcl9mZyA9IGkgJiAweGY7Cit9CisKK3N0YXRpYyB2b2lkIHZpZGVvX3NldGJnY29sb3IgKGludCBpKQoreworCXZpZGVvX2NvbG9yX2JnID0gaSAmIDB4ZjsKK30KKworc3RhdGljIGludCB2aWRlb19waWNrY29sb3IgKGludCBpKQoreworCXJldHVybiB2aWRlb19wYWxldHRlW2kgJiAweGZdOworfQorCisvKiBBYnNvbHV0ZSBjb25zb2xlIHBsb3R0aW5nIGZ1bmN0aW9ucyAqLworCisjaWZkZWYgVklERU9fQkxJTksKK3N0YXRpYyB2b2lkIHZpZGVvX3JldmNoYXIgKGludCB4eCwgaW50IHl5KQoreworCWludCByb3dzOworCXU4ICpkZXN0OworCisJZGVzdCA9IHZpZGVvX2ZiX2FkZHJlc3MgKyB5eSAqIFZJREVPX0xJTkVfTEVOICsgeHggKiAyOworCisJZm9yIChyb3dzID0gVklERU9fRk9OVF9IRUlHSFQ7IHJvd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aGFyICopcywgc3RybGVuICgoY2hhciAqKXMpKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qICoqIFZJREVPIENPTlRST0xMRVIgTE9XLUxFVkVMIEZVTkNUSU9OUwkJCQkqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI2lmICFkZWZpbmVkKENPTkZJR19SUlZJU0lPTikKK3N0YXRpYyB2b2lkIHZpZGVvX21vZGVfZHVwZWZpZWxkIChWUkFNICogc291cmNlLCBWUkFNICogZGVzdCwgaW50IGVudHJpZXMpCit7CisJaW50IGk7CisKKwlmb3IgKGkgPSAwOyBpIDwgZW50cmllczsgaSsrKSB7CisJCWRlc3RbaV0gPSBzb3VyY2VbaV07CS8qIENvcHkgdGhlIGVudGlyZSByZWNvcmQgKi8KKwkJZGVzdFtpXS5meCA9ICghZGVzdFtpXS5meCkgKiAzOwkvKiBOZWdhdGUgZmllbGQgYml0ICovCisJfQorCisJZGVzdFswXS5sY3ljKys7CQkJLyogQWRkIGEgY3ljbGUgdG8gdGhlIGZpcnN0IGVudHJ5ICovCisJZGVzdFtlbnRyaWVzIC0gMV0ubHN0ID0gMTsJLyogU2V0IGVuZCBvZiByYW0gZW50cmllcyAqLworfQorI2VuZGlmCisKK3N0YXRpYyB2b2lkIGlubGluZSB2aWRlb19tb2RlX2FkZGVudHJ5IChWUkFNICogdnIsCisJaW50IEh4LCBpbnQgVngsIGludCBGeCwgaW50IEJ4LAorCWludCBWRFMsIGludCBJTlQsIGludCBMQ1lDLCBpbnQgTFAsIGludCBMU1QpCit7CisJdnItPmh4ID0gSHg7CisJdnItPnZ4ID0gVng7CisJdnItPmZ4ID0gRng7CisJdnItPmJ4ID0gQng7CisJdnItPnZkcyA9IFZEUzsKKwl2ci0+aW50ZXIgPSBJTlQ7CisJd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gY29uc29sZV9zY3JvbGx1cCAodm9pZCkKK3sKKwkvKiBDb3B5IHVwIHJvd3MgaWdub3JpbmcgdGhlIGZpcnN0IG9uZSAqLworCW1lbWNweWwgKENPTlNPTEVfUk9XX0ZJUlNULCBDT05TT0xFX1JPV19TRUNPTkQsIENPTlNPTEVfU0NST0xMX1NJWkUgPj4gMik7CisKKwkvKiBDbGVhciB0aGUgbGFzdCBvbmUgKi8KKwltZW1zZXRsIChDT05TT0xFX1JPV19MQVNULCBDT05TT0xFX1JPV19TSVpFID4+IDIsIFZJREVPX0JHX0NPTCk7Cit9CisKK3N0YXRpYyBpbmxpbmUgdm9pZCBjb25zb2xlX2JhY2sgKHZvaWQpCit7CisJY29uc29sZV9jb2wtLTsKKworCWlmIChjb25zb2xlX2NvbCA8IDApIHsKKwkJY29uc29sZV9jb2wgPSBDT05TT0xFX0NPTFMgLSAxOworCQljb25zb2xlX3Jvdy0tOworCQlpZiAoY29uc29sZV9yb3cgPCAwKQorCQkJY29uc29sZV9yb3cgPSAwOworCX0KKworCXZpZGVvX3B1dGNoYXIgKCBjb25zb2xlX2NvbCAqIFZJREVPX0ZPTlRfV0lEVEgsCisJCQljb25zb2xlX3JvdyAqIFZJREVPX0ZPTlRfSEVJR0hULCAnICcpOworfQorCitzdGF0aWMgaW5saW5lIHZvaWQgY29uc29sZV9uZXdsaW5lICh2b2lkKQoreworCWNvbnNvbGVfcm93Kys7CisJY29uc29sZV9jb2wgPSAwOworCisJLyogQ2hlY2sgaWYgd2UgbmVlZCB0byBzY3JvbGwgdGhlIHRlcm1pbmFsICovCisJaWYgKGNvbnNvbGVfcm93ID49IENPTlNPTEVfUk9XUykgeworCQkvKiBTY3JvbGwgZXZlcnl0aGluZyB1cCAqLworCQljb25zb2xlX3Njcm9sbHVwICgpOworCisJCS8qIERlY3JlbWVudCByb3cgbnVtYmVyICovCisJCWNvbnNvbGVfcm93LS07CisJfQorfQorCit2b2lkIHZpZGVvX3B1dGMgKGNvbnN0IGNoYX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WRlb19lbmFibGUpCisJCXdoaWxlIChjb3VudC0tKQorCQkJc2VyaWFsX3B1dGMgKCpzKyspOworCWVsc2UKKwkJd2hpbGUgKGNvdW50LS0pCisJCQl2aWRlb19wdXRjICgqcysrKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qICoqIENVUlNPUiBCTElOS0lORyBGVU5DVElPTlMJCQkJCQkqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI2lmZGVmIFZJREVPX0JMSU5LCisKKyNkZWZpbmUgQkxJTktfVElNRVJfSUQJCTAKKyNkZWZpbmUgQkxJTktfVElNRVJfSFoJCTIKKworc3RhdGljIHVuc2lnbmVkIGNoYXIgYmxpbmtfZW5hYmxlZCA9IDA7CitzdGF0aWMgdGltZXJfdCBibGlua190aW1lcjsKKworc3RhdGljIHZvaWQgYmxpbmtfdXBkYXRlICh2b2lkKQoreworCXN0YXRpYyBpbnQgYmxpbmtfcm93ID0gLTEsIGJsaW5rX2NvbCA9IC0xLCBibGlua19vbGQgPSAwOworCisJLyogQ2hlY2sgaWYgd2UgaGF2ZSBhIG5ldyBwb3NpdGlvbiB0byBpbnZlcnQgKi8KKwlpZiAoKGNvbnNvbGVfcm93ICE9IGJsaW5rX3JvdykgfHwgKGNvbnNvbGVfY29sICE9IGJsaW5rX2NvbCkpIHsKKwkJLyogQ2hlY2sgaWYgd2UgbmVlZCB0byByZXZlcnNlIGxhc3QgY2hhcmFjdGVyICovCisJCWlmIChibGlua19vbGQpCisJCQl2aWRlb19yZXZjaGFyICggYmxpbmtfY29sICogVklERU9fRk9OVF9XSURUSCwKKwkJCQkJKGJsaW5rX3JvdworI2lmZGVmIENPTkZJR19WSURFT19MT0dPCisJCQkJCSArIFZJREVPX0xPR09fSEVJR0hUCisjZW5kaWYKKwkJCQkJKSAqIFZJREVPX0ZPTlRfSEVJR0hUKTsKKworCQkvKiBVcGRhdGUgdmFsdWVzICovCisJCWJsaW5rX3JvdyA9IGNvbnNvbGVfcm93OworCQlibGlua19jb2wgPSBjb25zb2xlX2NvbDsKKwkJYmxpbmtfb2xkID0gMDsKKwl9CisKKy8qIFJldmVyc2UgdGhpcyBjaGFyYWN0ZXIgKi8KKwlibGlua19vbGQgPSAhYmxpbmtfb2xkOworCXZpZGVvX3JldmNoYXIgKCBjb25zb2xlX2NvbCAqIFZJREVPX0ZPTlRfV0lEVEgsCisJCQkoY29uc29sZV9yb3cKKyNpZmRlZiBDT05GSUdfVklERU9fTE9HTworCQkJKyBWSURFT19MT0dPX0hFSUdIVAorI2VuZGlmCisJCQkpICogVklERU9fRk9OVF9IRUlHSFQpOworCit9CisKKy8qCisgKiBIYW5kbGVyIGZvciBibGlua2luZyBjdXJzb3IKKyAqLworc3RhdGljIHZvaWQgYmxpbmtfaGFuZGxlciAodm9pZCAqYXJnKQoreworLyogQmxpbmsgKi8KKwlibGlua191cGRhdGUgKCk7CisvKiBBY2sgdGhlIHRpbWVyICovCisJdGltZXJfYWNrICgmYmxpbmtfdGltZXIpOworfQorCitpbnQgYmxpbmtfc2V0IChpbnQgYmxpbmspCit7CisJaW50IHJldCA9IGJsaW5rX2VuYWJsZWQ7CisKKwlpZiAoYmxpbmspCisJCXRpbWVyX2VuYWJsZSAoJmJsaW5rX3RpbWVyKTsKKwllbHNlCisJCXRpbWVyX2Rpc2FibGUgKCZibGlua190aW1lcik7CisKKwlibGlua19lbmFibGVkID0gYmxpbms7CisKKwlyZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW5saW5lIHZvaWQgYmxpbmtfY2xvc2UgKHZvaWQpCit7CisJdGltZXJfY2xvc2UgKCZibGlua190aW1lcik7Cit9CisKK3N0YXRpYyBpbmxpbmUgdm9pZCBibGlua19pbml0ICh2b2lkKQoreworCXRpbWVyX2luaXQgKCZibGlua190aW1lciwKKwkJCUJMSU5LX1RJTUVSX0lELCBCTElOS19USU1FUl9IWiwKKwkJCWJsaW5rX2hhbmRsZXIpOworfQorI2VuZGlmCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiAqKiBMT0dPIFBMT1RUSU5HIEZVTkNUSU9OUwkJCQkJCSovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjaWZkZWYgQ09ORklHX1ZJREVPX0xPR08KK3ZvaWQgZWFzeWxvZ29fcGxvdCAoZmFzdGltYWdlX3QgKiBpbWFnZSwgdm9pZCAqc2NyZWVuLCBpbnQgd2lkdGgsIGludCB4LAorCQkJCQlpbnQgeSkKK3sKKwlpbnQgc2tpcCA9IHdpZHRoIC0gaW1hZ2UtPndpZHRoLCB4Y291bnQsIHljb3VudCA9IGltYWdlLT5oZWlnaHQ7CisKKyNpZmRlZiBWSURFT19NT0RFX1lVWVYKKwl1c2hvcnQgKnNvdXJjZSA9ICh1c2hvcnQgKikgaW1hZ2UtPmRhdGE7CisJdXNob3J0ICpkZXN0ICAgPSAodXNob3J0ICopIHNjcmVlbiArIHkgKiB3aWR0aCArIHg7CisKKwl3aGlsZSAoeWNvdW50LS0pIHsKKwkJeGNvdW50ID0gaW1hZ2UtPndpZHRoOworCQl3aGlsZSAoeGNvdW50LS0pCisJCQkqZGVzdCsrID0gKnNvdXJjZSsrOworCQlkZXN0ICs9IHNraXA7CisJfQorI2VuZGlmCisjaWZkZWYgVklERU9fTU9ERV9SR0IKKwl1bnNpZ25lZCBjaGFyCisJKnNvdXJjZSA9ICh1bnNpZ25lZCBzaG9ydCAqKSBpbWFnZS0+ZGF0YSwKKwkJCSpkZXN0ID0gKHVuc2lnbmVkIHNob3J0ICopIHNjcmVlbiArICgoeSAqIHdpZHRoKSArIHgpICogMzsKKworCXdoaWxlICh5Y291bnQtLSkgeworCQl4Y291bnQgPSBpbWFnZS0+d2lkdGggKiAzOworCQltZW1jcHkgKGRlc3QsIHNvdXJjZSwgeGNvdW50KTsKKwkJc291cmNlICs9IHhjb3VudDsKKwkJZGVzdCArPSB5Y291bnQ7CisJfQorI2VuZGlmCit9CisKK3N0YXRpYyB2b2lkICp2aWRlb19sb2dvICh2b2lkKQoreworCXUxNiAqc2NyZWVuID0gdmlkZW9fZmJfYWRkcmVzcywgd2lkdGggPSBWSURFT19DT0xTOworI2lmZGVmIFZJREVPX0lORk8KKyMgaWZuZGVmIENPTkZJR19GQURTCisJY2hhciB0ZW1wWzMyXTsKKyMgZW5kaWYKKwljaGFyIGluZm9bODBdOworI2VuZGlmIC8qIFZJREVPX0lORk8gKi8KKworCWVhc3lsb2dvX3Bsb3QgKFZJREVPX0xPR09fQUREUiwgc2NyZWVuLCB3aWR0aCwgMCwgMCk7CisKKyNpZmRlZiBWSURFT19JTkZPCisJc3ByaW50ZiAoaW5mbywgIiVzICglcyAtICVzKSAiLAorCQkgVV9CT09UX1ZFUlNJT04sIFVfQk9PVF9EQVRFLCBVX0JPT1RfVElNRSk7CisJdmlkZW9fZHJhd3N0cmluZyAoVklERU9fSU5GT19YLCBWSURFT19JTkZPX1ksIGluZm8pOworCisJc3ByaW50ZiAoaW5mbywgIihDKSAyMDAyIERFTlggU29mdHdhcmUgRW5naW5lZXJpbmciKTsKKwl2aWRlb19kcmF3c3RyaW5nIChWSURFT19JTkZPX1gsIFZJREVPX0lORk9fWSArIFZJREVPX0ZPTlRfSEVJR0hULAorCQkJCQlpbmZvKTsKKworCXNwcmludGYgKGluZm8sICIgICAgV29sZmdhbmcgREVOSywgd2RAZGVueC5kZSIpOworCXZpZGVvX2RyYXdzdHJpbmcgKFZJREVPX0lORk9fWCwgVklERU9fSU5GT19ZICsgVklERU9fRk9OVF9IRUlHSFQgKiAyLAorCQkJCQlpbmZvKTsKKyNpZm5kZWYgQ09ORklHX0ZBRFMJCS8qIGFsbCBub3JtYWwgYm9hcmRzICovCisJLyogbGVhdmUgb25lIGJsYW5rIGxpbmUgKi8KKworCXNwcmludGYgKGluZm8sICJNUEM4MjMgQ1BVIGF0ICVzIE1IeiwgJWxkIE1CIFJBTSwgJWxkIE1CIEZsYXNoIiwKKwkJc3RybWh6KHRlbXAsIGdkLT5jcHVfY2xrKSwKKwkJZ2QtPnJhbV9zaXplID4+IDIwLAorCQlnZC0+YmQtPmJpX2ZsYXNoc2l6ZSA+PiAyMCApOworCXZpZGVvX2RyYXdzdHJpbmcgKFZJREVPX0lORk9fWCwgVklERU9fSU5GT19ZICsgVklERU9fRk9OVF9IRUlHSFQgKiA0LAorCQkJCQlpbmZvKTsKKyNlbHNlCQkJCS8qIEZBRFMgOi0oICovCisJc3ByaW50ZiAoaW5mbywgIk1QQzgyMyBDUFUgYXQgNTAgTUh6IG9uIEZBRFM4MjMgYm9hcmQiKTsKKwl2aWRlb19kcmF3c3RyaW5nIChWSURFT19JTkZPX1gsIFZJREVPX0lORk9fWSArIFZJREVPX0ZPTlRfSEVJR0hULAorCQkJCQkgIGluZm8pOworCisJc3ByaW50ZiAoaW5mbywgIjJNQiBGTEFTSCAtIDhNQiBEUkFNIC0gNE1CIFNSQU0iKTsKKwl2aWRlb19kcmF3c3RyaW5nIChWSURFT19JTkZPX1gsIFZJREVPX0lORk9fWSArIFZJREVPX0ZPTlRfSEVJR0hUICogMiwKKwkJCQkJICBpbmZvKTsKKyNlbmRpZgorI2VuZGlmCisKKwlyZXR1cm4gdmlkZW9fZmJfYWRkcmVzcyArIFZJREVPX0xPR09fSEVJR0hUICogVklERU9fTElORV9MRU47Cit9CisjZW5kaWYKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qICoqIFZJREVPIEhJR0gtTEVWRUwgRlVOQ1RJT05TCQkJCQkqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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gMi41bnMgPiB0Q0sgPj0gMS44NzVucworICogICAgICAgNyBpZiAxLjg3NW5zID4gdENLID49IDEuNW5zCisgKiAgICAgICA4IGlmIDEuNW5zID4gdENLID49IDEuMjVucworICovCitzdGF0aWMgaW5saW5lIHVuc2lnbmVkIGludCBjb21wdXRlX2Nhc193cml0ZV9sYXRlbmN5KHZvaWQpCit7CisJdW5zaWduZWQgaW50IGN3bDsKKwljb25zdCB1bnNpZ25lZCBpbnQgbWNsa19wcyA9IGdldF9tZW1vcnlfY2xrX3BlcmlvZF9wcygpOworCisJaWYgKG1jbGtfcHMgPj0gMjUwMCkKKwkJY3dsID0gNTsKKwllbHNlIGlmIChtY2xrX3BzID49IDE4NzUpCisJCWN3bCA9IDY7CisJZWxzZSBpZiAobWNsa19wcyA+PSAxNTAwKQorCQljd2wgPSA3OworCWVsc2UgaWYgKG1jbGtfcHMgPj0gMTI1MCkKKwkJY3dsID0gODsKKwllbHNlCisJCWN3bCA9IDg7CisJcmV0dXJuIGN3bDsKK30KKworLyogQ2hpcCBTZWxlY3QgQ29uZmlndXJhdGlvbiAoQ1NuX0NPTkZJRykgKi8KK3N0YXRpYyB2b2lkIHNldF9jc25fY29uZmlnKGludCBpLCBmc2xfZGRyX2NmZ19yZWdzX3QgKmRkciwKKwkJCSAgICAgICBjb25zdCBtZW1jdGxfb3B0aW9uc190ICpwb3B0cywKKwkJCSAgICAgICBjb25zdCBkaW1tX3BhcmFtc190ICpkaW1tX3BhcmFtcykKK3sKKwl1bnNpZ25lZCBpbnQgY3Nfbl9lbiA9IDA7IC8qIENoaXAgU2VsZWN0IGVuYWJsZSAqLworCXVuc2lnbmVkIGludCBpbnRsdl9lbiA9IDA7IC8qIE1lbW9yeSBjb250cm9sbGVyIGludGVybGVhdmUgZW5hYmxlICovCisJdW5zaWduZWQgaW50IGludGx2X2N0bCA9IDA7IC8qIEludGVybGVhdmluZyBjb250cm9sICovCisJdW5zaWduZWQgaW50IGFwX25fZW4gPSAwOyAvKiBDa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jX2xvdyAqLworCXVuc2lnbmVkIGNoYXIgcmVmcmVjX2N0cmw7CisJLyogTGFzdCBkYXRhIHRvIHByZWNoYXJnZSBtaW5pbXVtIGludGVydmFsICh0V1IpICovCisJdW5zaWduZWQgY2hhciB3cnJlY19tY2xrOworCS8qIEFjdGl2YXRlLXRvLWFjdGl2YXRlIGludGVydmFsICh0UlJEKSAqLworCXVuc2lnbmVkIGNoYXIgYWN0dG9hY3RfbWNsazsKKwkvKiBMYXN0IHdyaXRlIGRhdGEgcGFpciB0byByZWFkIGNvbW1hbmQgaXNzdWUgaW50ZXJ2YWwgKHRXVFIpICovCisJdW5zaWduZWQgY2hhciB3cnRvcmRfbWNsazsKKworCXByZXRvYWN0X21jbGsgPSBwaWNvc190b19tY2xrKGNvbW1vbl9kaW1tLT50UlBfcHMpOworCWFjdHRvcHJlX21jbGsgPSBwaWNvc190b19tY2xrKGNvbW1vbl9kaW1tLT50UkFTX3BzKTsKKwlhY3R0b3J3X21jbGsgPSBwaWNvc190b19tY2xrKGNvbW1vbl9kaW1tLT50UkNEX3BzKTsKKworCS8qCisJICogVHJhbnNsYXRlIENBUyBMYXRlbmN5IHRvIGEgRERSIGNvbnRyb2xsZXIgZmllbGQgdmFsdWU6CisJICoKKwkgKiAgICAgIENBUyBMYXQgRERSIEkgICBERFIgSUkgIEN0cmwKKwkgKiAgICAgIENsb2NrcyAgU1BEIEJpdCBTUEQgQml0IFZhbHVlCisJICogICAgICAtLS0tLS0tIC0tLS0tLS0gLS0tLS0tLSAtLS0tLQorCSAqICAgICAgMS4wICAgICAwICAgICAgICAgICAgICAgMDAwMQorCSAqICAgICAgMS41ICAgICAxICAgICAgICAgICAgICAgMDAxMAorCSAqICAgICAgMi4wICAgICAyICAgICAgIDIgICAgICAgMDAxMQorCSAqICAgICAgMi41ICAgICAzICAgICAgICAgICAgICAgMDEwMAorCSAqICAgICAgMy4wICAgICA0ICAgICAgIDMgICAgICAgMDEwMQorCSAqICAgICAgMy41ICAgICA1ICAgICAgICAgICAgICAgMDExMAorCSAqICAgICAgNC4wICAgICAgICAgICAgIDQgICAgICAgMDExMQorCSAqICAgICAgNC41ICAgICAgICAgICAgICAgICAgICAgMTAwMAorCSAqICAgICAgNS4wICAgICAgICAgICAgIDUgICAgICAgMTAwMQorCSAqLworI2lmIGRlZmluZWQoQ09ORklHX0ZTTF9ERFIxKQorCWNhc2xhdF9jdHJsID0gKGNhc19sYXRlbmN5ICsgMSkgJiAweDA3OworI2VsaWYgZGVmaW5lZChDT05GSUdfRlNMX0REUjIpCisJY2FzbGF0X2N0cmwgPSAyICogY2FzX2xhdGVuY3kgLSAxOworI2Vsc2UKKwkvKgorCSAqIGlmIHRoZSBDQVMgbGF0ZW5jeSBtb3JlIHRoYW4gOCBjeWNsZSwKKwkgKiB3ZSBuZWVkIHNldCBleHRlbmQgYml0IGZvciBpdCBhdAorCSAqIFRJTUlOR19DRkdfM1tFWFRfQ0FTTEFUXQorCSAqLworCWlmIChjYXNfbGF0ZW5jeSA+IDgpCisJCWNhc19sYXRlbmN5IC09IDg7CisJY2FzbGF0X2N0cmwgPSAyICogY2FzX2xhdGVuY3kgLSAxOworI2VuZGlmCisKKwlyZWZyZWNfY3RybCA9IHBpY29zX3RvX21jbGsoY29tbW9uX2RpbW0tPnRSRkNfcHMpIC0gODsKKwl3cnJlY19tY2xrID0gcGljb3NfdG9fbWNsayhjb21tb25fZGltbS0+dFdSX3BzKTsKKwlpZiAocG9wdHMtPk9URl9idXJzdF9jaG9wX2VuKQorCQl3cnJlY19tY2xrICs9IDI7CisKKwlhY3R0b2FjdF9tY2xrID0gcGljb3NfdG9fbWNsayhjb21tb25fZGltbS0+dFJSRF9wcyk7CisJLyoKKwkgKiBKRURFQyBoYXMgbWluIHJlcXVpcmVtZW50IGZvciB0UlJECisJICovCisjaWYgZGVmaW5lZChDT05GSUdfRlNMX0REUjMpCisJaWYgKGFjdHRvYWN0X21jbGsgPCA0KQorCQlhY3R0b2FjdF9tY2xrID0gNDsKKyN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vbGVfbnMgPSAoc3BkX3ZhbCAmIDB4RjApID4+IDQ7CisJdW5zaWduZWQgaW50IHRlbnRoX25zID0gc3BkX3ZhbCAmIDB4MEY7CisJdW5zaWduZWQgaW50IHBzID0gd2hvbGVfbnMgKiAxMDAwICsgdGVudGhzX3BzW3RlbnRoX25zXTsKKworCXJldHVybiBwczsKK30KKworc3RhdGljIHVuc2lnbmVkIGludAorY29udmVydF9iY2RfaHVuZHJlZHRoc190b19jeWNsZV90aW1lX3BzKHVuc2lnbmVkIGludCBzcGRfdmFsKQoreworCXVuc2lnbmVkIGludCB0ZW50aF9ucyA9IChzcGRfdmFsICYgMHhGMCkgPj4gNDsKKwl1bnNpZ25lZCBpbnQgaHVuZHJlZHRoX25zID0gc3BkX3ZhbCAmIDB4MEY7CisJdW5zaWduZWQgaW50IHBzID0gdGVudGhfbnMgKiAxMDAgKyBodW5kcmVkdGhfbnMgKiAxMDsKKworCXJldHVybiBwczsKK30KKworc3RhdGljIHVuc2lnbmVkIGludCBieXRlNDBfdGFibGVfcHNbOF0gPSB7CisJMCwKKwkyNTAsCisJMzMwLAorCTUwMCwKKwk2NjAsCisJNzUwLAorCTAsCS8qIHN1cHBvc2VkIHRvIGJlIFJGQywgYnV0IG5vdCBzdXJlIHdoYXQgdGhhdCBtZWFucyAqLworCTAJLyogVW5kZWZpbmVkICovCit9OworCitzdGF0aWMgdW5zaWduZWQgaW50Citjb21wdXRlX3RyZmNfcHNfZnJvbV9zcGQodW5zaWduZWQgY2hhciB0cmN0cmZjX2V4dCwgdW5zaWduZWQgY2hhciB0cmZjKQoreworCXVuc2lnbmVkIGludCB0cmZjX3BzOworCisJdHJmY19wcyA9ICgoKHRyY3RyZmNfZXh0ICYgMHgxKSAqIDI1NikgKyB0cmZjKSAqIDEwMDAKKwkJKyBieXRlNDBfdGFibGVfcHNbKHRyY3RyZmNfZXh0ID4+IDEpICYgMHg3XTsKKworCXJldHVybiB0cmZjX3BzOworfQorCitzdGF0aWMgdW5zaWduZWQgaW50Citjb21wdXRlX3RyY19wc19mcm9tX3NwZCh1bnNpZ25lZCBjaGFyIHRyY3RyZmNfZXh0LCB1bnNpZ25lZCBjaGFyIHRyYykKK3sKKwl1bnNpZ25lZCBpbnQgdHJjX3BzOworCisJdHJjX3BzID0gdHJjICogMTAwMCArIGJ5dGU0MF90YWJsZV9wc1sodHJjdHJmY19leHQgPj4gNCkgJiAweDddOworCisJcmV0dXJuIHRyY19wczsKK30KKworLyoKKyAqIHRDS21heCBmcm9tIEREUiBJIFNQRCBCeXRlIDQzCisgKgorICogQml0cyA3OjIgPT0gd2hvbGUgbnMKKyAqIEJpdHMgMTowID09IHF1YXJ0ZXIgbnMKKyAqICAgIDAwICAgID09IDAuMDAgbnMKKyAqICAgIDAxICAgID09IDAuMjUgbnMKKyAqICAgIDEwICAgID09IDAuNTAgbnMKKyAqICAgIDExICAgID09IDAuNzUgbnMKKyAqCisgKiBSZXR1cm5zIHBpY29zZWNvbmRzLgorICovCitzdGF0aWMgdW5zaWduZWQgaW50Citjb21wdXRlX3Rja21heF9mcm9tX3NwZF9wcyh1bnNpZ25lZCBpbnQgYnl0ZTQzKQoreworCXJldHVybiAoYnl0ZTQzID4+IDIpICogMTAwMCArIChieXRlNDMgJiAweDMpICogMjUwOworfQorCisvKgorICogRGV0ZXJtaW5lIFJlZnJlc2ggUmF0ZS4gIElnbm9yZSBzZWxmIHJlZnJlc2ggYml0IG9uIEREUiBJLgorICogVGFibGUgZnJvbSBTUEQgU3BlYywgQnl0ZSAxMiwgY29udmVydGVkIHRvIHBpY29zZWNvbmRzIGFuZAorICogZmlsbGVkIGluIHdpdGggImRlZmF1bHQiIG5vcm1hbCB2YWx1ZXMuCisgKi8KK3N0YXRpYyB1bnNpZ25lZCBpbnQKK2RldGVybWluZV9yZWZyZXNoX3JhdGVfcHMoY29uc3QgdW5zaWduZWQgaW50IHNwZF9yZWZyZXNoKQoreworCXVuc2lnbmVkIGludCByZWZyZXNoX3RpbWVfcHNbOF0gPSB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AorICogICAgICAgICAgICAgRkRCS19WYWxpZF9XaW5kb3dbaV1bal0gPSAxOyAgICAgICAgUkZEQy5SRkZECisgKiAgICAgICAgIH0KKyAqICAgICAgfQorICogIH0KKyAqLworc3RhdGljIHUzMiBEUVNfY2FsaWJyYXRpb25fbWV0aG9kQShzdHJ1Y3QgZGRyYXV0b2NhbCAqY2FsKQoreworCXVsb25nIHJmZGNfcmVnOworCXVsb25nIHJmZmQ7CisKKwl1bG9uZyBycWRjX3JlZzsKKwl1bG9uZyBycWZkOworCisJdTMyICptZW1iYXNlOworCXVsb25nIGJ4Y2Y7CisJaW50IHJxZmRfYXZlcmFnZTsKKwlpbnQgYnhjcl9udW07CisJaW50IHJmZmRfYXZlcmFnZTsKKwlpbnQgcGFzczsKKwl1MzIgcGFzc2VkID0gMDsKKworCWludCBpbl93aW5kb3c7CisJc3RydWN0IGF1dG9jYWxfcmVncyBjdXJyX3dpbl9taW47CisJc3RydWN0IGF1dG9jYWxfcmVncyBjdXJyX3dpbl9tYXg7CisJc3RydWN0IGF1dG9jYWxfcmVncyBiZXN0X3dpbl9taW47CisJc3RydWN0IGF1dG9jYWxfcmVncyBiZXN0X3dpbl9tYXg7CisJc3RydWN0IGF1dG9jYWxfcmVncyBsb29wX3dpbl9taW47CisJc3RydWN0IGF1dG9jYWxfcmVncyBsb29wX3dpbl9tYXg7CisKKyNpZmRlZiBERUJVRworCXVsb25nIHRlbXA7CisjZW5kaWYKKwl1bG9uZyByZGNjOworCisJY2hhciBzbGFzaFtdID0gIlxcfC8tXFx8Ly0iOworCWludCBsb29waSA9IDA7CisKKwkvKiBzdGFydCAqLworCWluX3dpbmRvdyA9IDA7CisKKwltZW1zZXQoJmN1cnJfd2luX21pbiwgMCwgc2l6ZW9mKGN1cnJfd2luX21pbikpOworCW1lbXNldCgmY3Vycl93aW5fbWF4LCAwLCBzaXplb2YoY3Vycl93aW5fbWF4KSk7CisJbWVtc2V0KCZiZXN0X3dpbl9taW4sIDAsIHNpemVvZih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S0tLS0tLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0tLQorICogIDA5LVNlcC05OCAgIENyZWF0ZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1DRworICogIDAyLU5vdi05OCAgIFJlbW92ZWQgRXh0ZXJuYWwgYXJiaXRlciBzZWxlY3RlZCBtZXNzYWdlICAgICAgICAgICAgICAgICAgIEpXQgorICogIDI3LU5vdi05OCAgIFplcm8gb3V0IFBUTUJBUjIgYW5kIGRpc2FibGUgaW4gUFRNMk1TICAgICAgICAgICAgICAgICAgICAgIEpXQgorICogIDA0LUphbi05OSAgIFplcm8gb3V0IG90aGVyIHVudXNlZCBQTU0gYW5kIFBUTSByZWdzLiBDaGFuZ2UgYnVzIHNjYW4gICAgIE1DRworICogICAgICAgICAgICAgIGZyb20gKDAgdG8gbikgdG8gKDEgdG8gbikuCisgKiAgMTctTWF5LTk5ICAgUG9ydCB0byBXYWxudXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSldCCisgKiAgMTctSnVuLTk5ICAgVXBkYXRlZCBmb3IgVkdBIHN1cHBvcnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSldCCisgKiAgMjEtSnVuLTk5ICAgVXBkYXRlZCB0byBhbGxvdyBTUkFNIHJlZ2lvbiB0byBiZSBhIHRhcmdldCBmcm9tIFBDSSBidXMgICAgSldCCisgKiAgMTktSnVsLTk5ICAgVXBkYXRlZCBmb3IgNDA1R1AgcGFzcyAxIGVycmF0YSAjMjYgKExvdyBQQ0kgc3Vic2VxdWVudCAgICAgTUNHCisgKiAgICAgICAgICAgICAgdGFyZ2V0IGxhdGVuY3kgdGltZXIgdmFsdWVzIGFyZSBub3Qgc3VwcG9ydGVkKS4KKyAqICAgICAgICAgICAgICBTaG91bGQgYmUgZml4ZWQgaW4gcGFzcyAyLgorICogIDA5LVNlcC05OSAgIFJlbW92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Z19jdHguZG9fYnJlYWsgPSBiZWRidWc0MDVfZG9fYnJlYWs7CisJYnVnX2N0eC5icmVha19pc3IgPSBiZWRidWc0MDVfYnJlYWtfaXNyOworCWJ1Z19jdHguZmluZF9lbXB0eSA9IGJlZGJ1ZzQwNV9maW5kX2VtcHR5OworCWJ1Z19jdHguc2V0ID0gYmVkYnVnNDA1X3NldDsKKwlidWdfY3R4LmNsZWFyID0gYmVkYnVnNDA1X2NsZWFyOworCisJZm9yIChpID0gMTsgaSA8PSBNQVhfQlJFQUtfUE9JTlRTOyArK2kpCisJCSgqYnVnX2N0eC5jbGVhcikgKGkpOworCisJcHV0cyAoIkJFREJVRzpyZWFkeVxuIik7CisJcmV0dXJuOworfQkvKiBiZWRidWdfaW5pdF9icmVha3BvaW50cyAqLworDAorCisKKy8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIFNldC9jbGVhci9zaG93IG9uZSBvZiB0aGUgaGFyZHdhcmUgYnJlYWtwb2ludHMgZm9yIHRoZSA0MDUuCVRoZSAib2ZmIgorICogc3RyaW5nIHdpbGwgZGlzYWJsZSBhIHNwZWNpZmljIGJyZWFrcG9pbnQuICBUaGUgInNob3ciIHN0cmluZyB3aWxsCisgKiBkaXNwbGF5IHRoZSBjdXJyZW50IGJyZWFrcG9pbnRzLiAgT3RoZXJ3aXNlIGFuIGFkZHJlc3Mgd2lsbCBzZXQgYQorICogYnJlYWtwb2ludCBhdCB0aGF0IGFkZHJlc3MuCVNldHRpbmcgYSBicmVha3BvaW50IHVzZXMgdGhlIENQVS1zcGVjaWZpYworICogc2V0IHJvdXRpbmUgd2hpY2ggd2lsbCBhc3NpZ24gYSBicmVha3BvaW50IG51bWJlci4KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KKwordm9pZCBiZWRidWc0MDVfZG9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FzZSAyOgorCQkJCWFkZHIgPSBHRVRfSUFDMiAoKTsKKwkJCQlicmVhazsKKwkJCWNhc2UgMzoKKwkJCQlhZGRyID0gR0VUX0lBQzMgKCk7CisJCQkJYnJlYWs7CisJCQljYXNlIDQ6CisJCQkJYWRkciA9IEdFVF9JQUM0ICgpOworCQkJCWJyZWFrOworCQkJfQorCisJCQlwcmludGYgKCJCcmVha3BvaW50IFslZF06ICIsIHdoaWNoX2JwKTsKKwkJCWlmIChhZGRyID09IDApCisJCQkJcHJpbnRmICgiTk9UIFNFVFxuIik7CisJCQllbHNlCisJCQkJZGlzcHBjICgodW5zaWduZWQgY2hhciAqKSBhZGRyLCAwLCAxLCBiZWRidWdfcHV0cywKKwkJCQkJCUZfUkFESEVYKTsKKwkJfQorCQlyZXR1cm47CisJfQorCisJLyogU2V0IGEgYnJlYWtwb2ludCBhdCB0aGUgYWRkcmVzcyAqLworCisJaWYgKCFpc2RpZ2l0IChhcmd2WzFdWzBdKSkgeworCQljbWRfdXNhZ2UoY21kdHApOworCQlyZXR1cm47CisJfQorCisJYWRkciA9IHNpbXBsZV9zdHJ0b3VsIChhcmd2WzFdLCBOVUxMLCAxNikgJiAweGZmZmZmZmZjOworCisJaWYgKChidWdfY3R4LnNldCkgJiYgKHdoaWNoX2JwID0gKCpidWdfY3R4LnNldCkgKDAsIGFkZHIpKSA+IDApIHsKKwkJcHJpbnRmICgiQnJlYWtwb2ludCBbJWRdOiAiLCB3aGljaF9icCk7CisJCWRpc3BwYyAoKHVuc2lnbmVkIGNoYXIgKikgYWRkciwgMCwgMSwgYmVkYnVnX3B1dHMsIEZfUkFESEVYKTsKKwl9CisKKwlyZXR1cm47Cit9CS8qIGJlZGJ1ZzQwNV9kb19icmVhayAqLworDAorCisKKy8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIEhhbmRsZSBhIGJyZWFrcG9pbnQuCSBGaXJzdCB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mFsICYgREJTUl9JQTMpIHsKKwkJYnVnX2N0eC5jdXJyZW50X2JwID0gMzsKKwkJYWRkciA9IEdFVF9JQUMzICgpOworCQlTRVRfREJTUiAoREJTUl9JQTMpOwkvKiBXcml0ZSBhIDEgdG8gY2xlYXIgKi8KKwl9IGVsc2UgaWYgKGRic3JfdmFsICYgREJTUl9JQTQpIHsKKwkJYnVnX2N0eC5jdXJyZW50X2JwID0gNDsKKwkJYWRkciA9IEdFVF9JQUM0ICgpOworCQlTRVRfREJTUiAoREJTUl9JQTQpOwkvKiBXcml0ZSBhIDEgdG8gY2xlYXIgKi8KKwl9CisKKwliZWRidWdfbWFpbl9sb29wIChhZGRyLCByZWdzKTsKKwlyZXR1cm47Cit9CS8qIGJlZGJ1ZzQwNV9icmVha19pc3IgKi8KKwwKKworCisvKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMb29rIHRocm91Z2ggYWxsIG9mIHRoZSBoYXJkd2FyZSBicmVha3BvaW50cyBhdmFpbGFibGUgdG8gc2VlIGlmIG9uZQorICogaXMgdW51c2VkLgorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworCitpbnQgYmVkYnVnNDA1X2ZpbmRfZW1wdHkgKHZvaWQpCit7CisJLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKworCWlmIChHRVRfSUFDMSAoKSA9PSAwKQorCQlyZXR1cm4gMTsKKworCWlmIChHRVRfSUFDMiAoKSA9PSAwKQorCQlyZXR1cm4gMjsKKworCWlmIChHRVRfSUFDMyAoKSA9PSAwKQorCQlyZXR1cm4gMzsKKworCWlmIChHRVRfSUFDNCAoKSA9PSAwKQorCQlyZXR1cm4gNDsKKworCXJldHVybiAwOworfQkvKiBiZWRidWc0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Hx8IHdoaWNoX2JwID4gTUFYX0JSRUFLX1BPSU5UUykgeworCQlwcmludGYgKCJJbnZhbGlkIGJyZWFrIHBvaW50ICMgJWRcbiIsIHdoaWNoX2JwKTsKKwkJcmV0dXJuIDA7CisJfQorCisJaWYgKCFidWdfY3R4Lmh3X2RlYnVnX2VuYWJsZWQpIHsKKwkJU0VUX01TUiAoR0VUX01TUiAoKSB8IDB4MjAwKTsJLyogc2V0IE1TUlsgREUgXSAqLworCQlTRVRfREJDUjAgKEdFVF9EQkNSMCAoKSB8IERCQ1IwX0lETSk7CisJCWJ1Z19jdHguaHdfZGVidWdfZW5hYmxlZCA9IDE7CisJfQorCisJc3dpdGNoICh3aGljaF9icCkgeworCWNhc2UgMToKKwkJU0VUX0lBQzEgKGFkZHIpOworCQlTRVRfREJDUjAgKEdFVF9EQkNSMCAoKSB8IERCQ1IwX0lBMSk7CisJCWJyZWFrOworCisJY2FzZSAyOgorCQlTRVRfSUFDMiAoYWRkcik7CisJCVNFVF9EQkNSMCAoR0VUX0RCQ1IwICgpIHwgREJDUjBfSUEyKTsKKwkJYnJlYWs7CisKKwljYXNlIDM6CisJCVNFVF9JQUMzIChhZGRyKTsKKwkJU0VUX0RCQ1IwIChHRVRfREJDUjAgKCkgfCBEQkNSMF9JQTMpOworCQlicmVhazsKKworCWNhc2UgNDoKKwkJU0VUX0lBQzQgKGFkZHIpOworCQlTRVRfREJDUjAgKEdFVF9EQkNSMCAoKSB8IERCQ1IwX0lBNCk7CisJCWJyZWFrOworCX0KKworCXJldHVybiB3aGljaF9icDsKK30JLyogYmVkYnVnNDA1X3NldCAqLworDAorCisKKy8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIERpc2FibGUgYSBzcGVjaWZpYyBicmVha29pbnQgYnkgc2V0dGluZyB0aGUgYXBwcm9wcmlhdGUgSUFDeCByZWdpc3RlcgorICogdG8gemVybyBhbmQgY2xhcmluZyB0aGUgaW5zdHJ1Y3Rpb24gYWRkcmVzcyBicmVha3BvaW50IGluIERCQ1IwLgorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworCitpbnQgYmVkYnVnNDA1X2NsZWFyIChpbnQgd2hpY2hfYnApCit7CisJLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKworCWlmICh3aGljaF9icCA8IDEgfHwgd2hpY2hfYnAgPiBNQVhfQlJFQUtfUE9JTlRTKSB7CisJCXByaW50ZiAoIkludmFsaWQgYnJlYWsgcG9pbnQgIyAoJWQpXG4iLCB3aGljaF9icCk7CisJCXJldHVybiAtMTsKKwl9CisKKwlzd2l0Y2ggKHdoaWNoX2JwKSB7CisJY2FzZSAxOgorCQlTRVRfSUFDMSAoMCk7CisJCVNFVF9EQkNSMCAoR0VUX0RCQ1IwICgpICYgfkRCQ1IwX0lBMSk7CisJCWJyZWFrOworCisJY2FzZSAyOgorCQlTRVRfSUFDMiAoMCk7CisJCVNFVF9EQkNSMCAoR0VUX0RCQ1IwICgpICYgfkRCQ1IwX0lBMik7CisJCWJyZWFrOworCisJY2FzZSAzOgorCQlTRVRfSUFDMyAoMCk7CisJCVNFVF9EQkNSMCAoR0VUX0RCQ1IwICgpICYgfkRCQ1IwX0lBMyk7CisJCWJyZWFrOworCisJY2FzZSA0OgorCQlTRVRfSUFDNCAoMCk7CisJCVNFVF9EQkNSMCAoR0VUX0RCQ1IwICgpICYgfkRCQ1IwX0lBNCk7CisJCWJyZWFrOworCX0KKworCXJldHVybiAwOworfQkvKiBiZWRidWc0MDVfY2xlYXIgKi8KKworCisvKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCisjZW5kaWYKZGlmZiAtLWdpdCBhL2FyY2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21tdS5oPgorCisjZGVmaW5lIF9BU01MQU5HVUFHRQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiAgWFhYIC0gREFOR0VSCisgKiAgICAgICAgVGhlc2Ugcm91dGluZXMgbWFrZSB1c2Ugb2Ygc2VsZiBtb2RpZnlpbmcgY29kZS4gIERPIE5PVCBDQUxMIFRIRU0KKyAqCSAgVU5USUwgVEhFWSBBUkUgUkVMT0NBVEVEIFRPIFJBTS4gIEFkZGl0aW9uYWxseSwgSSBkbyBub3QKKyAqCSAgcmVjb21tZW5kIHRoZW0gZm9yIHVzZSBpbiBhbnl0aGluZyBvdGhlciB0aGFuIGFuIGludGVyYWN0aXZlCisgKiAgICAgICAgZGVidWdnaW5nIGVudmlyb25tZW50LiAgVGhpcyBpcyBtYWlubHkgZHVlIHRvIHBlcmZvcm1hbmNlIHJlYXNvbnMuCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qCisgKiBzdGF0aWMgdm9pZCBfY3JlYXRlX01GRENSKHVuc2lnbmVkIHNob3J0IGRjcm4pCisgKgorICogQnVpbGRzIGEgJ21mZGNyJyBpbnN0cnVjdGlvbiBmb3IgZ2V0X2RjcgorICogZnVuY3Rpb24uCisgKi8KKwkJLnNlY3Rpb24gIi50ZXh0IgorCQkuYWxpZ24gMgorCQkudHlwZQkgX2NyZWF0ZV9NRkRDUixAZnVuY3Rpb24KK19jcmVhdGVfTUZEQ1I6CisJCS8qCisJCSAqIEJ1aWxkIHVwIGEgJ21mZGNyJyBpbnN0cnVjdGlvbiBmb3JtYXR0ZWQgYXMgZm9sbG93czoKKwkJICoKKwkJICogIE9QQ0QgfCAgIFJUICAgfCAgICBEQ1JGICAgICAgfCAgICAgWE8gICAgICAgfCBDUiB8CisJCSAqIC0tL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UlJPUjogUGlwZWxpbmVkIE5pYmJsZSBESU1NIik7CisJCQkJCWJyZWFrOworCQkJCWNhc2UgNDoKKwkJCQkJcHJpbnRmKCJFUlJPUjogU0RSQU0gRElNTSIpOworCQkJCQlicmVhazsKKwkJCQljYXNlIDU6CisJCQkJCXByaW50ZigiRVJST1I6IE11bHRpcGxleGVkIFJPTSBESU1NIik7CisJCQkJCWJyZWFrOworCQkJCWNhc2UgNjoKKwkJCQkJcHJpbnRmKCJFUlJPUjogU0dSQU0gRElNTSIpOworCQkJCQlicmVhazsKKwkJCQljYXNlIDc6CisJCQkJCXByaW50ZigiRVJST1I6IEREUjEgRElNTSIpOworCQkJCQlicmVhazsKKwkJCQlkZWZhdWx0OgorCQkJCQlwcmludGYoIkVSUk9SOiBVbmtub3duIERJTU0gKHR5cGUgJWQpIiwKKwkJCQkJICAgICAgICh1bnNpZ25lZCBpbnQpZGltbV90eXBlKTsKKwkJCQkJYnJlYWs7CisJCQkJfQorCQkJCXByaW50ZigiIGRldGVjdGVkIGluIHNsb3QgJWx1LlxuIiwgZGltbV9udW0pOworCQkJCXByaW50ZigiT25seSBERFIyIFNEUkFNIERJTU1zIGFyZSBzdXBwb3J0ZWQuIgorCQkJCSAgICAgICAiXG4iKTsKKwkJCQlwcmludGYoIlJlcGxhY2UgdGhlIG1vZHVsZSB3aXRoIGEgRERSMiBESU1NLiIKKwkJCQkgICAgICAgIlxuXG4iKTsKKwkJCQlzcGRfZGRyX2luaXRfaGFuZygpOworCQkJfQorCQkJZGltbV9mb3VuZCA9IFRSVUU7CisJCQlkZWJ1ZygiRElNTSBzbG90ICVsdTogcG9wdWxhdGVkIHdpdGggJWx1LXJhbmsgRERSMiBESU1NIgorCQkJICAgICAgIlxuIiwgZGltbV9udW0sIHJhbmtzX29uX2RpbW0pOworCQkJaWYgKHJhbmtzX29uX2RpbW0gPiBtYXhfcmFua3NfcGVyX2RpbW0pIHsKKwkJCQlwcmludGYoIldBUk5JTkc6IERSQU0gRElNTSB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MikgJiB+bWFzazI7CisJCXZhbCB8PSBHUElPX0lOX1NFTCA+PiBwaW4yOworCQlvdXRfYmUzMigodm9pZCAqKUdQSU8wX0lTUjFMICsgb2ZmcyArIG9mZnMyLCB2YWwpOworCX0KK30KKyNlbmRpZiAvKiBHUElPX09TUkwgKi8KKwordm9pZCBncGlvX3dyaXRlX2JpdChpbnQgcGluLCBpbnQgdmFsKQoreworCXUzMiBvZmZzID0gMDsKKworCWlmIChwaW4gPj0gR1BJT19NQVgpIHsKKwkJb2ZmcyA9IDB4MTAwOworCQlwaW4gLT0gR1BJT19NQVg7CisJfQorCisJaWYgKHZhbCkKKwkJb3V0X2JlMzIoKHZvaWQgKilHUElPMF9PUiArIG9mZnMsCisJCQkgaW5fYmUzMigodm9pZCAqKUdQSU8wX09SICsgb2ZmcykgfCBHUElPX1ZBTChwaW4pKTsKKwllbHNlCisJCW91dF9iZTMyKCh2b2lkICopR1BJTzBfT1IgKyBvZmZzLAorCQkJIGluX2JlMzIoKHZvaWQgKilHUElPMF9PUiArIG9mZnMpICYgfkdQSU9fVkFMKHBpbikpOworfQorCitpbnQgZ3Bpb19yZWFkX291dF9iaXQoaW50IHBpbikKK3sKKwl1MzIgb2ZmcyA9IDA7CisKKwlpZiAocGluID49IEdQSU9fTUFYKSB7CisJCW9mZnMgPSAweDEwMDsKKwkJcGluIC09IEdQSU9fTUFYOworCX0KKworCXJldHVybiAoaW5fYmUzMigodm9pZCAqKUdQSU8wX09SICsgb2ZmcykgJiBHUElPX1ZBTChwaW4pID8gMSA6IDApOworfQorCitpbnQgZ3Bpb19yZWFkX2luX2JpdChpbnQgcGluKQoreworCXUzMiBvZmZzID0gMDsKKworCWlmIChwaW4gPj0gR1BJT19NQVgpIHsKKwkJb2ZmcyA9IDB4MTAwOworCQlwaW4gLT0gR1BJT19NQVg7CisJfQorCisJcmV0dXJuIChpbl9iZTMyKCh2b2lkICopR1BJTzBfSVIgKyBvZmZzKSAmIEdQSU9fVkFMKHBpbikgPyAx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cih1bnNpZ25lZCBsb25nIHZhbCkKK3sKKwlhc20gdm9sYXRpbGUoIm10dGNyICUwIiA6IDogInIiICh2YWwpKTsKK30KKworCitzdGF0aWMgX19pbmxpbmVfXyB2b2lkIHNldF9ldnByKHVuc2lnbmVkIGxvbmcgdmFsKQoreworCWFzbSB2b2xhdGlsZSgibXRldnByICUwIiA6IDogInIiICh2YWwpKTsKK30KKyNlbmRpZiAvKiBkZWZpbmVkKENPTkZJR180NDAgKi8KKworaW50IGludGVycnVwdF9pbml0X2NwdSAodW5zaWduZWQgKmRlY3JlbWVudGVyX2NvdW50KQoreworCWludCB2ZWM7CisJdW5zaWduZWQgbG9uZyB2YWw7CisKKwkvKiBkZWNyZW1lbnRlciBpcyBhdXRvbWF0aWNhbGx5IHJlbG9hZGVkICovCisJKmRlY3JlbWVudGVyX2NvdW50ID0gMDsKKworCS8qCisJICogTWFyayBhbGwgaXJxcyBhcyBmcmVlCisJICovCisJZm9yICh2ZWMgPSAwOyB2ZWMgPCBJUlFfTUFYOyB2ZWMrKykgeworCQlpcnFfdmVjc1t2ZWNdLmhhbmRsZXIgPSBOVUxMOworCQlpcnFfdmVjc1t2ZWNdLmFyZyA9IE5VTEw7CisJCWlycV92ZWNzW3ZlY10uY291bnQgPSAwOworCX0KKworI2lmZGVmIENPTkZJR180eHgKKwkvKgorCSAqIEluaXQgUElUCisJICovCisjaWYgZGVmaW5lZChDT05GSUdfNDQwKQorCXZhbCA9IG1mc3ByKCBTUFJOX1RDUiApOworCXZhbCAmPSAofjB4MDQ0MDAwMDApOwkJLyogY2xlYXIgRElTICYgQVJFICovCisJbXRzcHIoIFNQUk5fVENSLCB2YWwgKTsKKwltdHNwciggU1BSTl9ERUMsIDAgKTsJCS8qIFByZXZlbnQgZXhjZXB0aW9uIGFmdGVyIFRTUiBjbGVhciovCisJbXRzcHIoIFNQUk5fREVDQVIsIDAgKTsJCS8qIGNsZWFyIHJlbG9hZCAqLworCW10c3ByKCBTUFJOX1RTUiwgMHgwODAwMDAwMCApOwkvKiBjbGVhciBERUMgc3RhdHVzICovCisJdmFsID0gZ2QtPmJkLT5iaV9pbnRmcmVxLzEwMDA7CS8qIDEgbXNlYyAqLworCW10c3ByKCBTUFJOX0RFQ0FSLCB2YWwgKTsJCS8qIFNldCBhdXRvLXJlbG9hZCB2YWx1ZSAqLworCW10c3ByKCBTUFJOX0RFQywgdmFsICk7CQkvKiBTZXQgaW5pdGFsIHZhbCAqLworI2Vsc2UKKwlzZXRfcGl0KGdkLT5iZC0+YmlfaW50ZnJlcSAvIDEwMDApOworI2VuZGlmCisjZW5kaWYgIC8qIENPTkZJR180eHggKi8KKworI2lmZGVmIENPTkZJR19BRENJT1AKKwkvKgorCSAqIEluaXQgUElUCisJICovCisJc2V0X3BpdCg2NjAwMCk7CisjZW5kaWYKKworCS8qCisJICogRW5hYmxlIFBJVAorCSAqLworCXZhbCA9IG1mc3ByKFNQUk5fVENSKTsKKwl2YWwgfD0gMHgwNDQwMDAwMDsKKwltdHNwcihTUFJOX1RDUiwgdmFsKTsKKworCS8qCisJICogU2V0IEVWUFIgdG8gMAorCSAqLworCXNldF9ldnByKDB4MDAwMDAwMDApOworCisJLyoKKwkgKiBDYWxsIHVpYyBvciB4aWxpbnhfaXJxIHBpY19lbmFibGUKKwkgKi8KKwlwaWNfZW5hYmxlKCk7CisKKwlyZXR1cm4gKDApOworfQorCit2b2lkIHRpbWVyX2ludGVycnVwdF9jcHUoc3RydWN0IHB0X3JlZ3MgKnJlZ3MpCit7CisJLyogbm90aGluZyB0byBkbyBoZXJlICovCisJcmV0dXJuOworfQorCit2b2lkIGludGVycnVwdF9ydW5faGFuZGxlcihpbnQgdmVjKQoreworCWlycV92ZWNzW3ZlY10uY291bnQrKzsKKworCWlmIChpcnFfdmVjc1t2ZWNdLmhhbmRsZXIgIT0gTlVMTCkgeworCQkvKiBjYWxsIGlzciAqLworCQkoKmlycV92ZWNzW3ZlY10uaGFuZGxlcikgKGlycV92ZWNzW3ZlY10uYXJn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worCisJfQkJCS8qIGVuZCBmb3IgbG9vcCAqLworfQkJCQkvKiBlbmQgZHVtcCAqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiAoUmUpc3RhcnQgYXV0b25lZ290aWF0aW9uCQkJCSAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitpbnQgcGh5X3NldHVwX2FuZWcgKGNoYXIgKmRldm5hbWUsIHVuc2lnbmVkIGNoYXIgYWRkcikKK3sKKwl1MTYgYm1jcjsKKworI2lmIGRlZmluZWQoQ09ORklHX1BIWV9EWU5BTUlDX0FORUcpCisJLyoKKwkgKiBTZXQgdXAgYWR2ZXJ0aXNlbWVudCBiYXNlZCBvbiBjYXBhYmxpbGl0aWVzIHJlcG9ydGVkIGJ5IHRoZSBQSFkuCisJICogVGhpcyBzaG91bGQgd29yayBmb3IgYm90aCBjb3BwZXIgYW5kIGZpYmVyLgorCSAqLworCXUxNiBibXNyOworI2lmIGRlZmluZWQoQ09ORklHX1BIWV9HSUdFKQorCXUxNiBleHNyID0gMHgwMDAwOworI2VuZGlmCisKKwltaWlwaHlfcmVhZCAoZGV2bmFtZSwgYWRkciwgUEhZX0JNU1IsICZibXNyKTsKKworI2lmIGRlZmluZWQoQ09ORklHX1BIWV9HSUdFKQorCWlmIChibXNyICYgUEhZX0JNU1JfRVhUX1NUQVQpCisJCW1paXBoeV9yZWFkIChkZXZuYW1lLCBhZGRyLCBQSFlfRVhTUiwgJmV4c3IpOworCisJaWYgKGV4c3IgJiAoUEhZX0VYU1JfMTAwMFhGIHwgUEhZX0VYU1JfMTAwMFhIKSkgeworCQkvKiAxMDAwQkFTRS1YICovCisJCXUxNiBhbmFyID0gMHgwMDAwOworCisJCWlmIChleHNyICYgUEhZX0VYU1JfMTAwMFhGKQorCQkJYW5hciB8PSBQSFlfWF9BTkxQQVJfRkQ7CisKKwkJ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worCS8qCisJICogRGV0ZXJtaW5lIGZvcndhcmQgZGl2aWRlciBCIChzaG91bGQgYmUgZXF1YWwgdG8gQSkKKwkgKi8KKwlzeXNJbmZvLT5wbGxGd2REaXZCID0gOCAtICgocGxsbXIxICYgUExMTVIxX0ZXRFZCX01BU0spID4+IDEyKTsKKworCS8qCisJICogRGV0ZXJtaW5lIEZCS19ESVYuCisJICovCisJc3lzSW5mby0+cGxsRmJrRGl2ID0gKChwbGxtcjEgJiBQTExNUjFfRkJNVUxfTUFTSykgPj4gMjApOworCWlmIChzeXNJbmZvLT5wbGxGYmtEaXYgPT0gMCkKKwkJc3lzSW5mby0+cGxsRmJrRGl2ID0gMTY7CisKKwkvKgorCSAqIERldGVybWluZSBQTEJfRElWLgorCSAqLworCXN5c0luZm8tPnBsbFBsYkRpdiA9ICgocGxsbXIwICYgUExMTVIwX0NQVV9UT19QTEJfTUFTSykgPj4gMTYpICsgMTsKKworCS8qCisJICogRGV0ZXJtaW5lIFBDSV9ESVYuCisJICovCisJc3lzSW5mby0+cGxsUGNpRGl2ID0gKHBsbG1yMCAmIFBMTE1SMF9QQ0lfVE9fUExCX01BU0spICsgMTsKKworCS8qCisJICogRGV0ZXJtaW5lIEVYVEJVU19ESVYuCisJICovCisJc3lzSW5mby0+cGxsRXh0QnVzRGl2ID0gKChwbGxtcjAgJiBQTExNUjBfRVhCX1RPX1BMQl9NQVNLKSA+PiA4KSArIDI7CisKKwkvKgorCSAqIERldGVybWluZSBPUEJfRElWLgorCSAqLworCXN5c0luZm8tPnBsbE9wYkRpdiA9ICgocGxsbXIwICYgUExMTVIwX09QQl9UT19QTEJfTUFTSykgPj4gMTIpICsgMTsKKworCS8qCisJICogRGV0ZXJtaW5lIHRoZSBNIGZhY3RvcgorCSAqLworCW0gPSBzeXNJbmZvLT5wbGxGYmtEaXYgKiBzeXNJbmZvLT5wbGxGd2REaXZCOworCisJLyoKKwkgKiBEZXRlcm1pbmUgVkNPIGNsb2NrIGZyZXF1ZW5je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LCAweGQ0LCAweDI5LCAweGQzLAorCQkweDI2LCAweGNjLCAweDE5LCAweGIzLAorCQkweDY3LCAweGNlLCAweDFkLCAweGJiLAorCQkweDc3LCAweGVlLCAweDVkLCAweGJhLAorCQkweDc0LCAweGU5LCAweDUyLCAweGE1LAorCQkweDRiLCAweDk2LCAweDJjLCAweGQ4LAorCQkweDMxLCAweGUzLCAweDQ2LCAweDhkLAorCQkweDFiLCAweGI3LCAweDZmLCAweGRlLAorCQkweDNkLCAweGZiLCAweDc2LCAweGVkLAorCQkweDVhLCAweGI1LCAweDZiLCAweGQ2LAorCQkweDJkLCAweGRiLCAweDM2LCAweGVjLAorCisJfTsKKworCWlmICgoaW5kZXggJiAweDdmKSA9PSAwKQorCQlyZXR1cm4gMTsKKwl3aGlsZSAocmV0IDwgc2l6ZW9mIChmYmR2X3RiKSkgeworCQlpZiAoZmJkdl90YltyZXRdID09IGluZGV4KQorCQkJYnJlYWs7CisJCXJldCsrOworCX0KKwlyZXQrKzsKKworCXJldHVybiByZXQ7Cit9CisKKyNkZWZpbmUgUExMX0ZCS19QTExfTE9DQUwJMAorI2RlZmluZSBQTExfRkJLX0NQVQkJMQorI2RlZmluZSBQTExfRkJLX1BFUkNMSwkJNQorCit2b2lkIGdldF9zeXNfaW5mbyAoc3lzX2luZm9fdCAqIHN5c0luZm8pCit7CisJdW5zaWduZWQgbG9uZyBzeXNDbGtQZXJpb2RQcyA9IE9ORV9CSUxMSU9OIC8gKENPTkZJR19TWVNfQ0xLX0ZSRVEgLyAxMDAwKTsKKwl1bnNpZ25lZCBsb25nIG0gPSAxOworCXVuc2lnbmVkIGludCAgdG1wOworCXVuc2lnbmVkIGNoYXIgZndkdmFbMTZdID0geworCQkxLCAyLCAxNCwgOSwgNCwgMTEsIDE2LCAxMywKKwkJMTIsIDUsIDYsIDE1LCAxMCwgNywgOCwgMywKKwl9OworCXVuc2lnbmVkIGNoYXIgc2VsLCBjcHVkdjAsIHBsYjJ4RGl2OworCisJbWZjcH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JR19JT1A0ODAKKwlnZC0+Y3B1X2NsayA9IDY2MDAwMDAwOworCWdkLT5idXNfY2xrID0gNjYwMDAwMDA7CisjZW5kaWYKKwlyZXR1cm4gKDApOworfQorCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogZ2V0X2J1c19mcmVxCisgKiByZXR1cm4gUExCIGJ1cyBmcmVxIGluIEh6CisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwordWxvbmcgZ2V0X2J1c19mcmVxICh1bG9uZyBkdW1teSkKK3sKKwl1bG9uZyB2YWw7CisKKyNpZiBkZWZpbmVkKENPTkZJR180MDVHUCkgfHwgZGVmaW5lZChDT05GSUdfNDA1Q1IpIHx8IFwKKyAgICBkZWZpbmVkKENPTkZJR180MDVFUCkgfHwgZGVmaW5lZChDT05GSUdfNDA1RVopIHx8IFwKKyAgICBkZWZpbmVkKENPTkZJR180MDVFWCkgfHwgZGVmaW5lZChDT05GSUdfNDA1KSB8fCBcCisgICAgZGVmaW5lZChDT05GSUdfNDQwKQorCXN5c19pbmZvX3Qgc3lzX2luZm87CisKKwlnZXRfc3lzX2luZm8gKCZzeXNfaW5mbyk7CisJdmFsID0gc3lzX2luZm8uZnJlcVBMQjsKKworI2VsaWYgZGVmaW5lZChDT05GSUdfSU9QNDgwKQorCisJdmFsID0gNjY7CisKKyNlbHNlCisjIGVycm9yIGdldF9idXNfZnJlcSgpIG5vdCBpbXBsZW1lbnRlZAorI2VuZGlmCisKKwlyZXR1cm4gdmFsOworfQorCisjaWYgIWRlZmluZWQoQ09ORklHX0lPUDQ4MCkKK3Vsb25nIGdldF9PUEJfZnJlcSAodm9pZCkKK3sKKwlQUEM0eHhfU1lTX0lORk8gc3lzX2luZm87CisKKwlnZXRfc3lzX2luZm8gKCZzeXNfaW5mbyk7CisKKwlyZXR1cm4gc3lzX2luZm8uZnJlcU9QQjsKK30KKyNlbmRpZgpkaWZmIC0tZ2l0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S0tLS0tLS0tLS0tICovCisJLyogRE1BIFN0YXR1cywgY2xlYXIgdG8gY29tZSB1cCBjbGVhbiAqLworCS8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKwlhZGRpcwlyMyxyMCwgMHhGRkZGCQkvKiBDbGVhciBhbGwgZXhpc3RpbmcgRE1BIHN0YXR1cyAqLworCW9yaQlyMyxyMywgMHhGRkZGCisJbXRkY3IJRE1BU1IsIHIzCisKKwlibAlwcGM0MDVlcF9pbml0CQkvKiBkbyBwcGM0MDVlcCBzcGVjaWZpYyBpbml0ICovCisjZW5kaWYgLyogQ09ORklHXzQwNUVQICovCisKKyNpZiBkZWZpbmVkKENPTkZJR19TWVNfT0NNX0RBVEFfQUREUikgJiYgZGVmaW5lZChDT05GSUdfU1lTX09DTV9EQVRBX1NJWkUpCisjaWYgZGVmaW5lZChDT05GSUdfNDA1RVopCisJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisJICogU2V0dXAgT0NNIC0gT24gQ2hpcCBNZW1vcnkgLSBQUEM0MDVFWiB1c2VzIE9DTSBDb250cm9sbGVyIFYyCisJICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisJLyoKKwkgKiBXZSBjYW4gbWFwIHRoZSBPQ00gb24gdGhlIFBMQjMsIHNvIG1hcCBpdCBhdAorCSAqIENPTkZJR19TWVNfT0NNX0RBVEFfQUREUiArIDB4ODAwMAorCSAqLworCWxpcwlyMyxDT05GSUdfU1lTX09DTV9EQVRBX0FERFJAaAkvKiBPQ00gbG9jYXRpb24gKi8KKwlvcmkJcjMscjMsQ09ORklHX1NZU19PQ01fREFUQV9BRERSQGwKKwlvcmkJcjMscjMsMHgwMjcwCQkvKiAx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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKwkuZ2xvYmwJaW4zMgoraW4zMjoKKwlsd3oJMywweDAwMDAoMykKKwlibHIKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogUFBDNDA1RVAgc3BlY2lmaWMgc3R1ZmYJCQkJCQkgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZkZWYgQ09ORklHXzQwNUVQCitwcGM0MDVlcF9pbml0OgorCisjaWZkZWYgQ09ORklHX0JVQklOR0EKKwkvKgorCSAqIEluaXRpYWxpemUgRUJDIGNoaXAgc2VsZWN0cyAxICYgNCBhbmQgR1BJTyBwaW5zIChmb3IgYWx0ZXJuYXRlCisJICogZnVuY3Rpb24pIHRvIHN1cHBvcnQgRlBHQSBhbmQgTlZSQU0gYWNjZXNzZXMgYmVsb3cuCisJICovCisKKwlsaXMJcjMsR1BJTzBfT1NSSEBoCQkvKiBjb25maWcgR1BJTyBvdXRwdXQgc2VsZWN0ICovCisJb3JpCXIzLHIzLEdQSU8wX09TUkhAbAorCWxpcwlyNCxDT05GSUdfU1lTX0dQSU8wX09TUkhAaAorCW9yaQlyNCxyNCxDT05GSUdfU1lTX0dQSU8wX09TUkhAbAorCXN0dwlyNCwwKHIzKQorCWxpcwlyMyxHUElPMF9PU1JMQGgKKwlvcmkJcjMscjMsR1BJTzBfT1NSTEBsCisJbGlzCXI0LENPTkZJR19TWVNfR1BJTzBfT1NSTEBoCisJb3JpCXI0LHI0LENPTkZJR19TWVNfR1BJTzBfT1NSTEBsCisJc3R3CXI0LDAocjMpCisKKwlsaXMJcjMsR1BJTzBfSVNSMUhAaAkvKiBjb25maWcgR1BJTyBpbnB1dCBzZWxlY3QgKi8KKwlvcmkJcjMscjMsR1BJTzBfSVNSMUhAbAor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LnJvZGF0YSkJfQorICAucmVsYS5yb2RhdGEgICA6IHsgKigucmVsYS5yb2RhdGEpCX0KKyAgLnJlbC5nb3QgICAgICAgOiB7ICooLnJlbC5nb3QpCQl9CisgIC5yZWxhLmdvdCAgICAgIDogeyAqKC5yZWxhLmdvdCkJCX0KKyAgLnJlbC5jdG9ycyAgICAgOiB7ICooLnJlbC5jdG9ycykJfQorICAucmVsYS5jdG9ycyAgICA6IHsgKigucmVsYS5jdG9ycykJfQorICAucmVsLmR0b3JzICAgICA6IHsgKigucmVsLmR0b3JzKQl9CisgIC5yZWxhLmR0b3JzICAgIDogeyAqKC5yZWxhLmR0b3JzKQl9CisgIC5yZWwuYnNzICAgICAgIDogeyAqKC5yZWwuYnNzKQkJfQorICAucmVsYS5ic3MgICAgICA6IHsgKigucmVsYS5ic3MpCQl9CisgIC5yZWwucGx0ICAgICAgIDogeyAqKC5yZWwucGx0KQkJfQorICAucmVsYS5wbHQgICAgICA6IHsgKigucmVsYS5wbHQpCQl9CisgIC5pbml0ICAgICAgICAgIDogeyAqKC5pbml0KQl9CisgIC5wbHQgOiB7ICooLnBsdCkgfQorICAudGV4dCAgICAgIDoKKyAgeworICAgICooLnRleHQpCisgICAgKiguZ290MSkKKyAgIH0gOnRleHQKKyAgICBfZXRleHQgPSAuOworICAgIFBST1ZJREUgKGV0ZXh0ID0gLik7CisgICAgLnJvZGF0YSAgICA6CisgICB7CisgICAgKiguZWhfZnJhbWUpCisgICAgKihTT1JUX0JZX0FMSUdOTUVOVChTT1JUX0JZX05BTUUoLnJvZGF0YSopKSkKKyAgfSA6dGV4dAorICAuZmluaSAgICAgIDogeyAqKC5maW5pKSAgICB9ID0wCisgIC5jdG9ycyAgICAgOiB7ICooLmN0b3JzKSAgIH0KKyAgLmR0b3JzICAgICA6IHsgKiguZHRvcnMpICAgfQorCisgIC8qIFJlYWQtd3JpdGUgc2VjdGlvbiwgbWVyZ2VkIGludG8gZGF0YSBzZWdtZW50OiAqLworICAuID0gKC4gKyAweDAwRkYpICYgMHhGRkZGRkYwMDsKKyAgX2Vyb3RleHQgPSAuOworICBQUk9WSURFIChlcm90ZXh0ID0gLik7CisgIC5yZWxvYyAgIDoKKyAgeworICAgICooLmdvdCkKKyAgICBfR09UMl9UQUJMRV8gPSAuOworICAgICooLmdvdDIpCisgICAgX0ZJWFVQX1RBQkxFXyA9IC47CisgICAgKiguZml4dXApCisgIH0KKyAgX19nb3QyX2VudHJpZXMgPSAoX0ZJWFVQX1RBQkxFXyAtIF9HT1QyX1RBQkxFXykgPj4gMjsKKyAgX19maXh1cF9lbnRyaWVzID0gKC4gLSBfRklYVVBfVEFCTEVfKSA+PiAyOworCisgIC5kYXRhICAgIDoKKyAgeworICAgICooLmRhdGEpCisgICAgKiguZGF0YTEpCisgICAgKiguc2RhdGEpCisgICAgKiguc2RhdGEyKQorICAgICooLmR5bmFtaWMpCisgICAgQ09OU1RSVUNUT1JTCisgIH0KKyAgX2VkYXRhICA9ICAuOworICBQUk9WSURFIChlZGF0YSA9IC4pOworCisgIC4gPSAuOworICBfX3VfYm9vdF9jbWRfc3RhcnQgPSAuOworICAudV9ib290X2NtZCA6IHsgKigudV9ib290X2NtZCkgfQorICBfX3VfYm9vdF9jbWRfZW5kID0gLjsKKworICAuID0gLjsKKyAgX19zdGFydF9fX2V4X3RhYmxlID0gLjsKKyAgX19leF90YWJsZSA6IHsgKihfX2V4X3RhYmxlKSB9CisgIF9fc3RvcF9fX2V4X3RhYmxlID0gLjsKKworICAuID0gQUxJR04oMjU2KTsKKyAgX19pbml0X2JlZ2luID0gLjsKKyAgLnRleHQuaW5pdCA6IHsgKigudGV4dC5pbml0KSB9CisgIC5kYXRhLmluaXQgOiB7ICooLmRhdGEuaW5pdCkgfQorICAuID0gQUxJR04oMjU2KTsKKyAgX19pbml0X2VuZCA9IC47CisKKyNpZmRlZiBDT05GSUdfNDQwCisgIC5ib290cGcgUkVTRVRfVkVDVE9SX0FERFJFU1MgLSAweGZmYyA6CisgIHsKKyAg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JMHgwNCwJCQkvKiAgX191OCAgYkxlbmd0aDsgKi8KKwkweDAzLAkJCS8qICBfX3U4ICBiRGVzY3JpcHRvclR5cGU7IFN0cmluZy1kZXNjcmlwdG9yICovCisJMHgwOSwJCQkvKiAgX191OCAgbGFuZyBJRCAqLworCTB4MDQsCQkJLyogIF9fdTggIGxhbmcgSUQgKi8KK307CisKK3N0YXRpYyB1bnNpZ25lZCBjaGFyIHJvb3RfaHViX3N0cl9pbmRleDFbXSA9Cit7CisJMjgsCQkJLyogIF9fdTggIGJMZW5ndGg7ICovCisJMHgwMywJCQkvKiAgX191OCAgYkRlc2NyaXB0b3JUeXBlOyBTdHJpbmctZGVzY3JpcHRvciAqLworCSdPJywJCQkvKiAgX191OCAgVW5pY29kZSAqLworCTAsCQkJCS8qICBfX3U4ICBVbmljb2RlICovCisJJ0gnLAkJCS8qICBfX3U4ICBVbmljb2RlICovCisJMCwJCQkJLyogIF9fdTggIFVuaWNvZGUgKi8KKwknQycsCQkJLyogIF9fdTggIFVuaWNvZGUgKi8KKwkwLAkJCQkvKiAgX191OCAgVW5pY29kZSAqLworCSdJJywJCQkvKiAgX191OCAgVW5pY29kZSAqLworCTAsCQkJCS8qICBfX3U4ICBVbmljb2RlICovCisJJyAnLAkJCS8qICBfX3U4ICBVbmljb2RlICovCisJMCwJCQkJLyogIF9fdTggIFVuaWNvZGUgKi8KKwknUicsCQkJLyogIF9fdTggIFVuaWNvZGUgKi8KKwkwLAkJCQkvKiAgX191OCAgVW5pY29kZSAqLworCSdvJywJCQkvKiAgX191OCAgVW5pY29kZSAqLworCTAsCQkJCS8qICBfX3U4ICBVbmljb2RlICovCisJJ28nLAkJCS8qICBfX3U4ICBVbmljb2RlICovCisJMCwJCQkJLyogIF9fdTggIFVuaWNvZGUgKi8KKwkndCcsCQkJLyogIF9fdTggIFVuaWNvZGUgKi8KKwkwLAkJCQkvKiAgX191OCAgVW5pY29kZSAqLworCScgJywJCQkvKiAgX191OCAgVW5pY29kZSAqLworC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NkZWZpbmUgVERfVF9EQVRBMSAgMHgwMzAwMDAwMAorI2RlZmluZSBURF9UX1RPR0dMRSAweDAwMDAwMDAwCisjZGVmaW5lIFREX1IJICAgIDB4MDAwNDAwMDAKKyNkZWZpbmUgVERfREkJICAgIDB4MDBFMDAwMDAKKyNkZWZpbmUgVERfRElfU0VUKFgpICgoKFgpICYgMHgwNyk8PCAyMSkKKyNkZWZpbmUgVERfRFAJICAgIDB4MDAxODAwMDAKKyNkZWZpbmUgVERfRFBfU0VUVVAgMHgwMDAwMDAwMAorI2RlZmluZSBURF9EUF9JTiAgICAweDAwMTAwMDAwCisjZGVmaW5lIFREX0RQX09VVCAgIDB4MDAwODAwMDAKKworI2RlZmluZSBURF9JU08JICAgIDB4MDAwMTAwMDAKKyNkZWZpbmUgVERfREVMCSAgICAweDAwMDIwMDAwCisKKy8qIENDIENvZGVzICovCisjZGVmaW5lIFREX0NDX05PRVJST1IJICAgMHgwMAorI2RlZmluZSBURF9DQ19DUkMJICAgMHgwMQorI2RlZmluZSBURF9DQ19CSVRTVFVGRklORyAgMHgwMgorI2RlZmluZSBURF9DQ19EQVRBVE9HR0xFTSAgMHgwMworI2RlZmluZSBURF9DQ19TVEFMTAkgICAweDA0CisjZGVmaW5lIFREX0RFVk5PVFJFU1AJICAgMHgwNQorI2RlZmluZSBURF9QSURDSEVDS0ZBSUwJICAgMHgwNgorI2RlZmluZSBURF9VTkVYUEVDVEVEUElEICAgMHgwNworI2RlZmluZSBURF9EQVRBT1ZFUlJVTgkgICAweDA4CisjZGVmaW5lIFREX0RBVEFVTkRFUlJVTgkgICAweDA5CisjZGVmaW5lIFREX0JVRkZFUk9WRVJSVU4gICAweDBDCisjZGVmaW5lIFREX0JVRkZFUlVOREVSUlVOICAweDBECisjZGVmaW5lIFREX05PVEFDQ0VTU0VECSAgIDB4MEYKKworI2RlZmluZSBNQVhQU1cgMQorCitzdHJ1Y3QgdGQgeworCV9fdTMyIGh3SU5GTzsKKwlfX3UzMiBod0NC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