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bXAgY2Fwv827p7bL0uyzo8vAu/rP1rOhyv2+3bW8s/bKtc/WCisqIAorKiDQ3rjEyNXG2iAgICAgICAgsOaxvrrFICAgICAg0N64xLHqvMcgICAgICAgINDeuMTIyyAgICAgICAgICDQ3rjExNrI3QorKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyogMjAxOS8xMC8xMCAgICAgIFYxLjAgICAgICAgIENyZWF0ZSAgICAgICAgICAwMDEzMDU3NCAgICAgICAgILS0vagKKyogCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgzbfOxLz+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaW5jbHVkZSAicmFtZHVtcF9wdWIuaCIKKyNpbmNsdWRlICJyYW1kdW1wX29zcy5oIgorI2luY2x1ZGUgPGxpbnV4L21vZHVsZS5oPgorCisjaWZkZWYgX19jcGx1c3BsdXMKK2V4dGVybiAiQyIgeworI2VuZGlmCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgILOjwb+2qNLlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgILrqtqjS5SAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgyv2+3cDg0M22qNLlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICC6r8r9yfnD9yAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIL7Wsr++ssysseTBv7ao0uUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgaW50IHJhbWR1bXBfY2FwX2luaXRfZmxhZzsKK3N0YXRpYyBpbnQgcmFtZHVtcF9jb3VudDsKKworI2RlZmluZSBSQU1EVU1QX09OX0RFRkFVTFRfVkFMICAoMSkKKyNkZWZpbmUgcmFtZHVtcF9jYXBfY21tX2J1ZiAgCShaWF9ERFJfQ0FQQlVGX0JBU0UgKyBJQ1BfQ0FQX0JVRl9MRU4gKyBUT09MX0NBUF9CVUZfTEVOKQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgyKu+1rHkwb+2qNLlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKgorICogcnVuIHRpbWUgY29udHJvbCBkdW1wIG9yIG5vdCwgdXNlICggZWNobyAiMCIgPiByYW1kdW1wX29uICkgdG8gY2xvc2UgcmFtZHVtcAorICovCitpbnQgc3lzY3RsX3JhbWR1bXBfb25fcGFuaWMgPSBSQU1EVU1QX09OX0RFRkFVTFRfVkFMOworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgvtayv7qvyv3Ktc/WICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiC5psTcw+jK9jogICAgIHJhbWR1bXBfY2FwX2ljcF9oYW5kbGUKKyogss7K/cu1w/c6ICAgICAKKyogICAotKvI67LOyv0pICBidWY6IGljcCBtc2cgYWRkcgorKiAgICAgICAgICAgICAgIGxlbjogaWNwIG1zZyBsZW4KKyogICAotKuz9rLOyv0pICB2b2lkCisqILe1ILvYINa1OiAgICAgdm9pZAorKiDG5Mv8y7XD9zogICAgIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCBmb3IgcmFtZHVtcCBjbGllbnQgaWNwIG1zZyBoYW5kbGUsIGNvbW1vbiBlbnRyeQorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3N0YXRpYyB2b2lkIHJhbWR1bXBfY2FwX2ljcF9oYW5kbGUodm9pZCAqYnVmLCB1bnNpZ25lZCBpbnQgbGVuKQoreworICAgIHJhbWR1bXBfbXNnX3QgKmljcF9tc2cgPSAocmFtZHVtcF9tc2dfdCAqKWJ1ZjsKKyAgIAorCXN3aXRjaChpY3BfbXNnLT5tc2dfaWQpCisgICAgeworICAgICAgICBjYXNlIFJBTURVTVBfTVNHX0VYQ0VQVDoKKyAgICAgICAgeworICAgICAgICAgICAgT1NTX1BBTklDKCJ0cmFucyBzZXJ2ZXIgcmVjZWl2ZWQgZm9yY2VkIGR1bXAgcmVxdWVzdCBmcm9tIEFwIHNlcnZlciFcbiIpOworCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGRlZmF1bHQ6CisJCXsKKwkJCU9TU19QQU5JQygidHJhbnMgc2VydmVyIHJlY2VpdmVkIGZvcmNlZCBkdW1wIHJlcXVlc3QgZnJvbSBBcCBzZXJ2ZXIhXG4iKTsKKwkJCisJCQlicmVhazsKKwkJfQorICAgIH0KK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoguabE3MPoyvY6ICAgIHJhbWR1bXBfb3NzX2ljcF9jcmVhdGVfY2hhbm5lbAorKiCyzsr9y7XD9zogICAgIAorKiAgICi0q8jrss7K/SkgYWN0b3JJRDogaWNwIHNlbmQgY29yZSBpZAorICAgICAgICAgICAgICAgY2hJRDogICAgaWNwIGNoYW5uZWwgaWQKKyAgICAgICAgICAgICAgIHNpemU6ICAgIGljcCBjaGFubmVsIHNpemUKKyogICAotKuz9rLOyv0pIHZvaWQgCisqILe1ILvYINa1OiAgICBpbnQ6IGlmIG1zZyBzZW5kIHN1Y2Nlc3MgCisqIMbky/zLtcP3OiAgICAKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgaW50IHJhbWR1bXBfY2FwX2ljcF9jcmVhdGVfY2hhbm5lbCgKKyAgICAgICAgcmFtZHVtcF9vc3NfaWNwX2FjdG9yaWQgYWN0b3JJRCwgCisgICAgICAgIHJhbWR1bXBfb3NzX2ljcF9jaGFubmVsaWQgY2hJRCwgCisgICAgICAgIHVuc2lnbmVkIGludCBzaXplKQoreworICAgIHJldHVybiB6RHJ2UnBNc2dfQ3JlYXRlQ2hhbm5lbChhY3RvcklELCBjaElELCBzaXplKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoguabE3MPoyvY6ICAgIHJhbWR1bXBfb3NzX2ljcF9yZWdjYWxsYmFjaworKiCyzsr9y7XD9zogICAgIAorKiAgICi0q8jrss7K/SkgYWN0b3JJRDogaWNwIHNlbmQgY29yZSBpZAorICAgICAgICAgICAgICAgY2hJRDogICAgaWNwIGNoYW5uZWwgaWQKKyAgICAgICAgICAgICAgIGNhbGxiYWNrOmljcCBjYWxsYmFjayBmdW4KKyogICAotKuz9rLOyv0pIHZvaWQgCisqILe1ILvYINa1OiAgICBpbnQ6IGlmIG1zZyBzZW5kIHN1Y2Nlc3MgCisqIMbky/zLtcP3OiAgICAKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgaW50IHJhbWR1bXBfY2FwX2ljcF9yZWdjYWxsYmFjayAoCisgICAgICAgIHJhbWR1bXBfb3NzX2ljcF9hY3RvcmlkIGFjdG9ySUQsIAorICAgICAgICB1bnNpZ25lZCBpbnQgY2hJRCwgCisgICAgICAgIHJhbWR1bXBfb3NzX2ljcF9jYWxsYmFjayBjYWxsYmFjaykKK3sKKyAgICByZXR1cm4gekRydlJwTXNnX1JlZ0NhbGxCYWNrKGFjdG9ySUQsY2hJRCxjYWxsYmFjayk7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqILmmxNzD6Mr2OiAgICAgcmFtZHVtcF9jYXBfaWNwX2luaXQKKyogss7K/cu1w/c6ICAgICAKKyogICAotKvI67LOyv0pICB2b2lkCisqICAgKLSrs/ayzsr9KSAgdm9pZAorKiC3tSC72CDWtTogICAgIHZvaWQKKyogxuTL/Mu1w/c6ICAgICBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgZm9yIHJhbWR1bXAgY2xpZW50IGljcCBpbml0CisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RhdGljIGludCByYW1kdW1wX2NhcF9pY3BfaW5pdCh2b2lkKQoreworICAgIGludCByZXQgPSAwOworCQorICAgIHJldCA9IHJhbWR1bXBfY2FwX2ljcF9jcmVhdGVfY2hhbm5lbCgKKyAgICAgICAgICAgIEFQX0lELCAKKyAgICAgICAgICAgIFJBTURVTVBfQ0hBTk5FTCwgCisgICAgICAgICAgICBSQU1EVU1QX0NIQU5ORUxfU0laRSk7CisKKyAgICBpZiAocmV0ICE9IFJBTURVTVBfU1VDQ0VTUykgCisgICAgICAgIHJldHVybiByZXQ7CisgICAgcmV0ID0gcmFtZHVtcF9jYXBfaWNwX3JlZ2NhbGxiYWNrKAorICAgICAgICAgICAgQVBfSUQsCisgICAgICAgICAgICBSQU1EVU1QX0NIQU5ORUwsIAorICAgICAgICAgICAgcmFtZHVtcF9jYXBfaWNwX2hhbmRsZSk7CisKKyAgICBpZiAocmV0ICE9IFJBTURVTVBfU1VDQ0VTUykKKyAgICAgICAgcmV0dXJuIHJldDsKKwkKKwlyZXR1cm4gUkFNRFVNUF9TVUNDRVNTOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiC5psTcw+jK9jogICAgIHJhbWR1bXBfbm90aWZ5X3NlcnZlcl9wYW5pYworKiCyzsr9y7XD9zogICAgIAorKiAgICi0q8jrss7K/SkgIHZvaWQKKyogICAotKuz9rLOyv0pICB2b2lkCisqILe1ILvYINa1OiAgICAgdm9pZAorKiDG5Mv8y7XD9zogICAgIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCBmb3IgY2FwIG5vdGlmeSByYW1kdW1wIHNlcnZlciB0byBwYW5pYworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3N0YXRpYyB2b2lkIHJhbWR1bXBfbm90aWZ5X3NlcnZlcl9wYW5pYygpCit7CisgICAgaW50IFJsdCA9IDA7CisKKyAgICBUX1pEcnZScE1zZ19Nc2cgdE1zZyA9e0FQX0lELCBSQU1EVU1QX0NIQU5ORUwsIDEsIE5VTEwsIDB9OworCisgICAgUmx0ID0gekRydlJwTXNnX1dyaXRlTG9ja0lycSgmdE1zZyk7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqILmmxNzD6Mr2OiAgICByYW1kdW1wX2NhcF9zdG9yZV9yYW1fY29uZgorKiCyzsr9y7XD9zogICAgIAorKiAgICi0q8jrss7K/SkgbWVtOiBhZGRyCisqICAgKLSrs/ayzsr9KSB2b2lkIAorKiC3tSC72CDWtTogICAgdW5zaWdlbmQgY2hhcio6IGNoYW5nZWQgYWRkcgorKiDG5Mv8y7XD9zogICAgVGhpcyBmdW5jdGlvbiBpcyB1c2VkIHRvIHN0b3JlIHJhbSBjb25mCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RhdGljIHVuc2lnbmVkIGNoYXIgKnJhbWR1bXBfY2FwX3N0b3JlX3JhbV9jb25mKHVuc2lnbmVkIGNoYXIgKm1lbSkKK3sKKwl1bnNpZ25lZCBsb25nIGNhcF9jbW1fcGh5ID0gMDsKKwkKKwljYXBfY21tX3BoeSA9IFJBTURVTVBfQ0FQX0NNTV9CVUZfQUREUjsKKwkJCisJbWVtICs9IHNwcmludGYoCisgICAgICAgICAgICBtZW0sIAorICAgICAgICAgICAgImRhdGEubG9hZC5iaW5hcnkgJnJhbWR1bXBfZGlyXFwlcyAweCV4LS0weCV4IC9ub2NsZWFyXG4iLAorICAgICAgICAgICAgImNhcF9kZHIiLAorICAgICAgICAgICAgKHVuc2lnbmVkIGxvbmcpRERSX0JBU0VfQ0FQX0FERFJfUEEsIAorICAgICAgICAgICAgKHVuc2lnbmVkIGludCkoRERSX0JBU0VfQ0FQX0FERFJfUEEgKyBERFJfQkFTRV9MRU5fQ0FQKSk7CisgICAJbWVtICs9IHNwcmludGYoCisgICAgICAgICAgICBtZW0sIAorICAgICAgICAgICAgImRhdGEubG9hZC5iaW5hcnkgJnJhbWR1bXBfZGlyXFwlcyAweCV4LS0weCV4IC9ub2NsZWFyXG4iLAorICAgICAgICAgICAgImNhcC5jbW0iLAorICAgICAgICAgICAgY2FwX2NtbV9waHksIAorICAgICAgICAgICAgKHVuc2lnbmVkIGludCkoY2FwX2NtbV9waHkgKyBSQU1EVU1QX0NBUF9DTU1fQlVGX0xFTikpOworCXJldHVybiBtZW07Cit9CisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiC5psTcw+jK9jogICAgcmFtZHVtcF9jYXBfY21tX2NyZWF0ZQorKiCyzsr9y7XD9zogICAgIAorKiAgICi0q8jrss7K/Skgdm9pZAorKiAgICi0q7P2ss7K/Skgdm9pZAorKiC3tSC72CDWtTogICAgdm9pZAorKiDG5Mv8y7XD9zogICAgVGhpcyBmdW5jdGlvbiBpcyB1c2VkIGZvciBzZXJ2ZXIgdG8gZ2VuZXJhdGUgY21tIHNjcmlwdHMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgdm9pZCByYW1kdW1wX2NhcF9jbW1fY3JlYXRlKHZvaWQpCit7CisgICAgdW5zaWduZWQgY2hhciAqcGNtbV9idWYgPSByYW1kdW1wX2NhcF9jbW1fYnVmOworCisgICAgLy8gc3RvcmUgdGhlIGNtbSBCRUdJTgorICAgIHBjbW1fYnVmICs9IHNwcmludGYocGNtbV9idWYsICJFTlRSWSAmcmFtZHVtcF9kaXJcbiIpOworCisJLy8gc3RvcmUgcHJvY21vZGVzIHJlZ3MKKyAgICBwY21tX2J1ZiA9IHJhbWR1bXBfYXJjaF9zdG9yZV9tb2Rlc19yZWdzKHBjbW1fYnVmKTsKKworCS8vIHN0b3JlIHJhbSBjb25maWcgCisgICAgcGNtbV9idWYgPSByYW1kdW1wX2NhcF9zdG9yZV9yYW1fY29uZihwY21tX2J1Zik7CisKKwkvLyBzdG9yZSBtZW1vcnkgbWFwIGNvbnRyb2wgcmVncworICAgIHBjbW1fYnVmID0gcmFtZHVtcF9hcmNoX3N0b3JlX21tX3JlZ3MocGNtbV9idWYpOworCisgICAgLy8gc3RvcmUgZW5kIHN5bWJvbAorICAgIHBjbW1fYnVmICs9IHNwcmludGYocGNtbV9idWYsICJFTkRET1xuIik7CisKK30KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICDIq77Wuq/K/cq1z9YgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqILmmxNzD6Mr2OiAgICAgcmFtZHVtcF9yYW1fY29uZl90YWJsZV9hZGQKKyogss7K/cu1w/c6ICAgICAKKyogICAotKvI67LOyv0pICByYW1fbmFtZTogICAgZHVtcCByYW0gbmFtZQorICAgICAgICAgICAgICAgIHJhbV9zdGFydDogICBkdW1wIHJhbSBzdGFydCh2aXJ0dWFsIGFkZHIpCisgICAgICAgICAgICAgICAgcmFtX3NpemU6ICAgIGR1bXAgcmFtIHNpemUKKyAgICAgICAgICAgICAgICByYW1fdmlydDogICAgZHVtcCByYW0gdmlydCBhZGRyCisgICAgICAgICAgICAgICAgcmFtX2ZsYWc6ICAgIGR1bXAgcmFtIGZsYWcoY29weS9leHRlci9jYWxsYmFjaykKKyAgICAgICAgICAgICAgICByYW1fZXh0cmE6ICAgZHVtcCByYW0gZXh0cmEgYWNjZXNzIGFkZHIKKyogICAotKuz9rLOyv0pICB2b2lkCisqILe1ILvYINa1OiAgICAgdm9pZAorKiDG5Mv8y7XD9zogICAgIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCB0byBhZGQgZHVtcCByYW0gY29uZiBpbnRvIHB1YmxpYyB0YWJsZQorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3ZvaWQgcmFtZHVtcF9yYW1fY29uZl90YWJsZV9hZGQoCisgICAgICAgIGNoYXIgKnJhbV9uYW1lLCAKKyAgICAgICAgdW5zaWduZWQgbG9uZyByYW1fcGh5LCAKKyAgICAgICAgdW5zaWduZWQgbG9uZyByYW1fc2l6ZSwgCisgICAgICAgIHVuc2lnbmVkIGxvbmcgcmFtX3ZpcnQsCisgICAgICAgIHVuc2lnbmVkIGxvbmcgcmFtX2ZsYWcsCisgICAgICAgIHVuc2lnbmVkIGxvbmcgcmFtX2V4dHJhKQoreworICAgIDsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoguabE3MPoyvY6ICAgICByYW1kdW1wX2luaXQKKyogss7K/cu1w/c6ICAgICAKKyogICAotKvI67LOyv0pICB2b2lkCisqICAgKLSrs/ayzsr9KSAgdm9pZAorKiC3tSC72CDWtTogICAgIFJBTURVTVBfU1VDQ0VTUyBvciBSQU1EVU1QX0ZBSUxFRAorKiDG5Mv8y7XD9zogICAgIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCBmb3IgcmFtZHVtcCBpbml0CisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworaW50IHJhbWR1bXBfaW5pdCh2b2lkKQoreworICAgIGludCByZXQgPSAwOworCQorICAgIGlmIChyYW1kdW1wX2NhcF9pbml0X2ZsYWcgPT0gUkFNRFVNUF9UUlVFKQorICAgICAgICByZXR1cm4gUkFNRFVNUF9TVUNDRVNTOworCisJcmV0ID0gcmFtZHVtcF9jYXBfaWNwX2luaXQoKTsKKwlpZiAocmV0ICE9IFJBTURVTVBfSUNQX1NVQ0NFU1MpIAorICAgICAgICByZXR1cm4gcmV0OworCisJT1NTX1BSSU5URigiUmFtZHVtcCBjYXAgaW5pdCBzdWNjZXNzIVxuIik7CisgICAgcmFtZHVtcF9jYXBfaW5pdF9mbGFnID0gUkFNRFVNUF9UUlVFOworCQorICAgIHJldHVybiBSQU1EVU1QX1NVQ0NFU1M7Cit9Cittb2R1bGVfaW5pdChyYW1kdW1wX2luaXQpOworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiC5psTcw+jK9jogICAgIHJhbWR1bXBfZW50cnkKKyogss7K/cu1w/c6ICAgICAKKyogICAotKvI67LOyv0pICB2b2lkCisqICAgKLSrs/ayzsr9KSAgdm9pZAorKiC3tSC72CDWtTogICAgIHZvaWQKKyogxuTL/Mu1w/c6ICAgICBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgZm9yIHJhbWR1bXAgZW50cnkKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCit2b2lkIHJhbWR1bXBfZW50cnkgKHZvaWQpCit7CisJIHVuc2lnbmVkIGxvbmcgZmxhZ3M7CisJIGlmIChzeXNjdGxfcmFtZHVtcF9vbl9wYW5pYyA9PSBGQUxTRSkKKyAgICAgICAgcmV0dXJuOworCisgICAgLyoKKyAgICAgKiB3ZSBuZWVkIGxvY2sgdGhlIGlycSwgdGhpcyBjYW5gdCBiZSBpbnRlcnJ1cHQuCisgICAgICovCisgICAgT1NTX0xPQ0soZmxhZ3MpOworCisgICAgaWYgKCFyYW1kdW1wX2NhcF9pbml0X2ZsYWcpCisgICAgICAgIHdoa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P7s8Y6ICAgICByYW1kdW1wX29zcy5jCisqIM7EvP6x6sq2OiAgICAgcmFtZHVtcF9vc3MuYworKiDE2sjd1arSqjogICAgIHJhbWR1bXCy2df3z7XNs9LAwLW907/aL8r9vt294bm5tqjS5c23zsS8/gorKiDKudPDt723qDogICAgIMjnufu4/Lu7stnX98+1zbOjrLjEzbfOxLz+xNq907/au/LV38r9vt22qNLl0OjSqtbY0MLKysXkCisqIAorKiDQ3rjEyNXG2iAgICAgICAgsOaxvrrFICAgICAg0N64xLHqvMcgICAgICAgINDeuMTIyyAgICAgICAgICDQ3rjExNrI3QorKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyogMjAxNi82LzEwICAgICAgVjEuMCAgICAgICAgQ3JlYXRlICAgICAgICAgICDV1L78v/wgICAgICAgICAgtLS9qAorKiAKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICDNt87EvP4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpbmNsdWRlICJyYW1kdW1wX3B1Yi5oIgorI2luY2x1ZGUgInJhbWR1bXBfb3NzLmgiCisjaW5jbHVkZSA8bGludXgvbW9kdWxlLmg+CisKKyNpZmRlZiBfX2NwbHVzcGx1cworZXh0ZXJuICJDIiB7CisjZW5kaWYKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIM3isr+6r8r9yfnD9yAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAguuq2qNLlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICDK/b7dwODQzbao0uUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIMirvtax5MG/yfnD9yAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgyKu+1rqvyv3J+cP3ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNpZmRlZiBfT1NfTElOVVggCisvKiBpY3AgYXBpICovICAKK2V4dGVybiBpbnQgekRydlJwTXNnX0NyZWF0ZUNoYW5uZWwoCisgICAgICAgICAgICAgIFRfWkRydlJwTXNnX0FjdG9ySUQgYWN0b3JJRCwgCisgICAgICAgICAgICAgIFRfWkRydlJwTXNnX0NoSUQgY2hJRCwgCisgICAgICAgICAgICAgIHVuc2lnbmVkIGludCBzaXplKTsKK2V4dGVybiBpbnQgekRydlJwTXNnX1JlZ0NhbGxCYWNrKAorICAgICAgICAgICAgICBUX1pEcnZScE1zZ19BY3RvcklEIGFjdG9ySUQsIAorICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgY2hJRCwgCisgICAgICAgICAgICAgIFRfWkRydlJwTXNnX0NhbGxiYWNrRnVuY3Rpb24gY2FsbGJhY2spOworZXh0ZXJuIGludCB6RHJ2UnBNc2dfV3JpdGVMb2NrSXJxKGNvbnN0IFRfWkRydlJwTXNnX01zZyAqcE1zZyk7CitleHRlcm4gdm9pZCBwYW5pYyhjb25zdCBjaGFyICpmbXQsIC4uLik7CisKK2V4dGVybiBpbnQgekRydlVzYlBvbGxfSW5pdCh2b2lkKTsKK2V4dGVybiBpbnQgekRydlVzYlBvbGxfSXNyKHZvaWQpOworZXh0ZXJuIGJvb2wgekRydlVzYlBvbGxfaXNDb25uZWN0KHZvaWQpOworZXh0ZXJuIGludCB6RHJ2VXNiUG9sbF9SZWFkKHVuc2lnbmVkIGNoYXIqIHBCdWYsdW5zaWduZWQgbG9uZyBsZW5ndGgpOworZXh0ZXJuIGludCB6RHJ2VXNiUG9sbF9Xcml0ZSh1bnNpZ25lZCBjaGFyKiBwQnVmLHVuc2lnbmVkIGxvbmcgbGVuZ3RoKTsKKyNpZiBkZWZpbmVkIENPTkZJR19QUklOVEsKK2V4dGVybiB2b2lkIGdldF9sb2didWZfaW5mbyh1bnNpZ25lZCBsb25nICphZGRyLCB1bnNpZ25lZCBsb25nICpzaXplKTsKKyNlbmRpZgorI2VuZGlmIC8vI2lmZGVmIF9PU19MSU5VWCAKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIMirvta6r8r9yrXP1iAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiC5psTcw+jK9jogICAgIHJhbWR1bXBfb3NzX2NyZWF0ZV90aHJlYWQKKyogss7K/cu1w/c6ICAgICAKKyogICAotKvI67LOyv0pICB2b2lkCisqICAgKLSrs/ayzsr9KSAgdm9pZAorKiC3tSC72CDWtTogICAgIHZvaWQKKyogxuTL/Mu1w/c6ICAgIAorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3ZvaWQgcmFtZHVtcF9vc3NfY3JlYXRlX3RocmVhZCAoCisgICAgICAgIHVuc2lnbmVkIGNoYXIgKm5hbWUsIAorICAgICAgICByYW1kdW1wX29zc190aHJlYWRfZW50cnlfdCBlbnRyeSkKK3sKKyNpZmRlZiBfT1NfVE9TCisjZGVmaW5lIFJBTURVTVBfVEhSRUFEX1NUQUNLX0RFRl9TSVpFIDIwNDgKKyNkZWZpbmUgUkFNRFVNUF9USFJFQURfREVGX1BSSU8gMjAKKyNkZWZpbmUgUkFNRFVNUF9USFJFQURfREVGX0FSRyAwCisjZGVmaW5lIFJBTURVTVBfVEhSRUFEX0FVVE9SVU4gMQorI2RlZmluZSBSQU1EVU1QX1RIUkVBRF9QUkVFTVBUIDEKKworICAgIHpPc3NfQ3JlYXRlVGhyZWFkKAorICAgICAgICBuYW1lLGVudHJ5LCAKKyAgICAgICAgUkFNRFVNUF9USFJFQURfREVGX0FSRywKKyAgICAgICAgUkFNRFVNUF9USFJFQURfU1RBQ0tfREVGX1NJWkUsCisgICAgICAgIFJBTURVTVBfVEhSRUFEX0RFRl9QUklPLAorICAgICAgICBSQU1EVU1QX1RIUkVBRF9QUkVFTVBULAorICAgICAgICBSQU1EVU1QX1RIUkVBRF9BVVRPUlVOKTsKKyNlbmRpZgorfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiC5psTcw+jK9jogICAgIHJhbWR1bXBfb3NzX21tYXAKKyogss7K/cu1w/c6ICAgICAKKyogICAotKvI67LOyv0pICB2b2lkCisqICAgKLSrs/ayzsr9KSAgdm9pZAorKiC3tSC72CDWtTogICAgIHZvaWQKKyogxuTL/Mu1w/c6ICAgIAorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3Vuc2lnbmVkIGxvbmcgcmFtZHVtcF9vc3NfbW1hcCAodW5zaWduZWQgbG9uZyBhZGRyLCB1bnNpZ25lZCBsb25nIHNpemUpCit7CisjaWZkZWYgX09TX0xJTlVYCisgICAgcmV0dXJuIGlvcmVtYXAoYWRkcixzaXplKTsKKyNlbGlmIGRlZmluZWQgKF9PU19UT1MpCisKKyNpZmRlZiBfX1VTRV9NTVVfXworICAgIFRfelRvc19NbXVSYW1kdW1wVGFibGUgbW11VGFibGUgPSB7MH07CisgICAgelRvc19NbXVHZXRNYXBwaW5nUmVnaW9uKGFkZHIsIHNpemUsICZtbXVUYWJsZSk7CisgICAgLyogCisgICAgICogVE9ETyEKKyAgICAgKiBjdXJyZW50IHRvcyBtbWFwIG9uZSB0byBvbmUKKyAgICAgKiBuZWVkIG5ldyBBUEkgbGlrZSBpb3JlbWFwIHJlYWxpemUKKyAgICAgKi8KKyAgICByZXR1cm4gYWRkcjsKKyNlbmRpZgorCisjZW5kaWYKK30KKworI2lmZGVmIF9VU0VfQ0FQX1NZUworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoguabE3MPoyvY6ICAgIHJhbWR1bXBfb3NzX2ljcF9zZW5kX2NhcAorKiCyzsr9y7XD9zogICAgIAorKiAgICi0q8jrss7K/SkgaWNwX21zZzogbXNnIGluZm8KKyAgICAgICAgICAgICAgIGNsaWVudF9pZDogY2xpZW50IGlkCisqICAgKLSrs/ayzsr9KSB2b2lkIAorKiC3tSC72CDWtTogICAgaW50OiBpZiBtc2cgc2VuZCBzdWNjZXNzIAorKiDG5Mv8y7XD9zogICAgVGhpcyBmdW5jdGlvbiBpcyB1c2VkIGZvciBzZXJ2ZXIgdG8gc2VuZCBtc2cgdG8gY2xpZW50CisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworaW50IHJhbWR1bXBfb3NzX2ljcF9zZW5kX2NhcChyYW1kdW1wX29zc19tc2dfdCAqaWNwX21zZywgdW5zaWduZWQgaW50IGNsaWVudF9pZCkKK3sKKyAgICBpbnQgcmV0OworICAgIHJhbWR1bXBfb3NzX2ljcF9tc2cgcnBtc2cgPSB7MH07CisKKyAgICBycG1zZy5hY3RvcklEID0gY2xpZW50X2lkOworICAgIHJwbXNnLmNoSUQgPSBjaGFubmVsXzEwOworICAgIHJwbXNnLmZsYWcgPSAxOworICAgIHJwbXNnLmJ1ZiA9IGljcF9tc2c7CisgICAgcnBtc2cubGVuID0gc2l6ZW9mKCppY3BfbXNnKTsKKworICAgIC8qCisgICAgICogY2xlYW4gYWxsIHRoZSBjYWNoZXMgdG8gbWFrZSBzdXJlIGFsbCBkYXRhIGluIGRkciAKKyAgICAgKi8KKyAgICByYW1kdW1wX2FyY2hfY2xlYW5fY2FjaGVzKCk7CisKKyAgICByZXQgPSB6RHJ2UnBNc2dfV3JpdGVfQ2FwKCZycG1zZyk7CisKKyAgICBpZiAocmV0ICE9IHJwbXNnLmxlbikKKyAgICB7CisgICAgICAgIE9TU19QUklOVEYoCisgICAgICAgICAgICAiW3JhbWR1bXBdIGljcG1zZyBzZW5kIGZhaWwsIHJldCAhPSBycG1zZy5sZW5bcmV0OiVkXSwgW2NsaWVudF9pZDolZF1cbiIsIAorICAgICAgICAgICAgcmV0LCAKKyAgICAgICAgICAgIGNsaWVudF9pZCk7CisgICAgICAgIHJldHVybiByZXQ7CisgICAgfQorCisgICAgcmV0dXJuIFJBTURVTVBfSUNQX1NVQ0NFU1M7Cit9CisjZW5kaWYKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoguabE3MPoyvY6ICAgIHJhbWR1bXBfb3NzX2ljcF9zZW5kCisqILLOyv3LtcP3OiAgICAgCisqICAgKLSryOuyzsr9KSBpY3BfbXNnOiBtc2cgaW5mbworICAgICAgICAgICAgICAgY2xpZW50X2lkOiBjbGllbnQgaWQKKyogICAotKuz9rLOyv0pIHZvaWQgCisqILe1ILvYINa1OiAgICBpbnQ6IGlmIG1zZyBzZW5kIHN1Y2Nlc3MgCisqIMbky/zLtcP3OiAgICBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgZm9yIHNlcnZlciB0byBzZW5kIG1zZyB0byBjbGllbnQKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitpbnQgcmFtZHVtcF9vc3NfaWNwX3NlbmQocmFtZHVtcF9vc3NfbXNnX3QgKmljcF9tc2csIHVuc2lnbmVkIGludCBjbGllbnRfaWQpCit7CisgICAgaW50IHJldDsKKyAgICByYW1kdW1wX29zc19pY3BfbXNnIHJwbXNnID0gezB9OworCisgICAgcnBtc2cuYWN0b3JJRCA9IGNsaWVudF9pZDsKKyAgICBycG1zZy5jaElEID0gY2hhbm5lbF80MDsKKyAgICBycG1zZy5mbGFnID0gMTsKKyAgICBycG1zZy5idWYgPSBpY3BfbXNnOworICAgIHJwbXNnLmxlbiA9IHNpemVvZigqaWNwX21zZyk7CisKKyAgICAvKgorICAgICAqIGNsZWFuIGFsbCB0aGUgY2FjaGVzIHRvIG1ha2Ugc3VyZSBhbGwgZGF0YSBpbiBkZHIgCisgICAgICovCisgICAgcmFtZHVtcF9hcmNoX2NsZWFuX2NhY2hlcygpOworCisgICAgcmV0ID0gcmFtZHVtcF9vc3NfaWNwX3dyaXRlKCZycG1zZyk7CisKKyAgICBpZiAocmV0ICE9IHJwbXNnLmxlbikKKyAgICB7CisjaWZkZWYgX09TX0xJTlVYCisgICAgICAgIE9TU19QUklOVEYoCisgICAgICAgICAgICAiW3JhbWR1bXBdIGljcG1zZyBzZW5kIGZhaWwsIHJldCAhPSBycG1zZy5sZW5bcmV0OiVkXSwgW2NsaWVudF9pZDolZF1cbiIsIAorICAgICAgICAgICAgcmV0LCAKKyAgICAgICAgICAgIGNsaWVudF9pZCk7CisjZWxpZiBkZWZpbmVkIChfT1NfVE9TKQorICAgICAgICBPU1NfUFJJTlRGKAorICAgICAgICAgICAgU1VCTURMX1RFU1QsIAorICAgICAgICAgICAgUFJJTlRfTEVWRUxfTk9STUFMLAorICAgICAgICAgICAgIltyYW1kdW1wXSBpY3Btc2cgc2VuZCBmYWlsLCByZXQgIT0gcnBtc2cubGVuW3JldDolZF0sIFtjbGllbnRfaWQ6JWRdXG4iLCAKKyAgICAgICAgICAgIHJldCwKKyAgICAgICAgICAgIGNsaWVudF9pZCk7CisjZW5kaWYKKyAgICAgICAgcmV0dXJuIHJldDsKKyAgICB9CisKKyAgICByZXR1cm4gUkFNRFVNUF9JQ1BfU1VDQ0VTUzsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoguabE3MPoyvY6ICAgICByYW1kdW1wX29zc19lcnJvcl9sb2dfY3JlYXQKKyogss7K/cu1w/c6ICAgICAKKyogICAotKvI67LOyv0pICBidWYgOiBhZGRyIHBvaW50CisqICAgKLSrs/ayzsr9KSAgdm9pZAorKiC3tSC72CDWtTogICAgIHZvaWQKKyogxuTL/Mu1w/c6ICAgIAorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3ZvaWQgcmFtZHVtcF9vc3NfZXJyb3JfbG9nX2NyZWF0KGNoYXIgKmJ1ZikKK3sKKyNpZmRlZiBfT1NfTElOVVgKKyAgICBpZiAoY3VycmVudC0+bW0gIT0gTlVMTCkKKyAgICAgICAgc3ByaW50ZigKKyAgICAgICAgICAgIGJ1ZiwgCisgICAgICAgICAgICAiIGR1bXAgYXQgdXNlciwgYXBwIG5hbWUgaXM6ICVzLCBsb2FkIGFkZHIgaXM6ICVsdSBcbiIsIAorICAgICAgICAgICAgY3VycmVudC0+Y29tbSwgCisgICAgICAgICAgICBjdXJyZW50LT5tbS0+c3RhcnRfY29kZSk7CisgICAgZWxzZQorICAgICAgICBzcHJpbnRmKAorICAgICAgICAgICAgYnVmLAorICAgICAgICAgICAgIiBkdW1wIGF0IGtlcm5lbCwgYXBwIG5hbWUgaXM6ICVzIFxuIiwgCisgICAgICAgICAgICBjdXJyZW50LT5jb21tKTsKKyNlbmRpZgorCit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqILmmxNzD6Mr2OiAgICByYW1kdW1wX29zc19pY3BfY3JlYXRlX2NoYW5uZWwKKyogss7K/cu1w/c6ICAgICAKKyogICAotKvI67LOyv0pIGFjdG9ySUQ6IGljcCBzZW5kIGNvcmUgaWQKKyAgICAgICAgICAgICAgIGNoSUQ6ICAgIGljcCBjaGFubmVsIGlkCisgICAgICAgICAgICAgICBzaXplOiAgICBpY3AgY2hhbm5lbCBzaXplCisqICAgKLSrs/ayzsr9KSB2b2lkIAorKiC3tSC72CDWtTogICAgaW50OiBpZiBtc2cgc2VuZCBzdWNjZXNzIAorKiDG5Mv8y7XD9zogICAgCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworaW50IHJhbWR1bXBfb3NzX2ljcF9jcmVhdGVfY2hhbm5lbCgKKyAgICAgICAgcmFtZHVtcF9vc3NfaWNwX2FjdG9yaWQgYWN0b3JJRCwgCisgICAgICAgIHJhbWR1bXBfb3NzX2ljcF9jaGFubmVsaWQgY2hJRCwgCisgICAgICAgIHVuc2lnbmVkIGludCBzaXplKQoreworI2lmZGVmIF9PU19MSU5VWAorICAgIHJldHVybiBDUFBTX0ZVTkMoY3Bwc19jYWxsYmFja3MsIHpEcnZScE1zZ19DcmVhdGVDaGFubmVsKShhY3RvcklELCBjaElELCBzaXplKTsKKyNlbGlmIGRlZmluZWQgKF9PU19UT1MpCisgICAgaWYgKGFjdG9ySUQgPT0gcmFtZHVtcF9jcHVfaWRbUkFNRFVNUF9DUFVfMl0pCisgICAgICAgIHJldHVybiAwOworICAgIGVsc2UKKyAgICAgICAgcmV0dXJuIHpEcnZScE1zZ19DcmVhdGVDaGFubmVsKGFjdG9ySUQsIGNoSUQsIHNpemUpOworI2VuZGlmCit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqILmmxNzD6Mr2OiAgICByYW1kdW1wX29zc19pY3BfcmVnY2FsbGJhY2sKKyogss7K/cu1w/c6ICAgICAKKyogICAotKvI67LOyv0pIGFjdG9ySUQ6IGljcCBzZW5kIGNvcmUgaWQKKyAgICAgICAgICAgICAgIGNoSUQ6ICAgIGljcCBjaGFubmVsIGlkCisgICAgICAgICAgICAgICBjYWxsYmFjazppY3AgY2FsbGJhY2sgZnVuCisqICAgKLSrs/ayzsr9KSB2b2lkIAorKiC3tSC72CDWtTogICAgaW50OiBpZiBtc2cgc2VuZCBzdWNjZXNzIAorKiDG5Mv8y7XD9zogICAgCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworaW50IHJhbWR1bXBfb3NzX2ljcF9yZWdjYWxsYmFjayAoCisgICAgICAgIHJhbWR1bXBfb3NzX2ljcF9hY3RvcmlkIGFjdG9ySUQsIAorICAgICAgICB1bnNpZ25lZCBpbnQgY2hJRCwgCisgICAgICAgIHJhbWR1bXBfb3NzX2ljcF9jYWxsYmFjayBjYWxsYmFjaykKK3sKKyNpZmRlZiBfT1NfTElOVVgKKyAgICByZXR1cm4gQ1BQU19GVU5DKGNwcHNfY2FsbGJhY2tzLCB6RHJ2UnBNc2dfUmVnQ2FsbEJhY2spKGFjdG9ySUQsY2hJRCxjYWxsYmFjayk7CisjZWxpZiBkZWZpbmVkIChfT1NfVE9TKQorICAgIGlmIChhY3RvcklEID09IHJhbWR1bXBfY3B1X2lkW1JBTURVTVBfQ1BVXzJdKQorICAgICAgICByZXR1cm4gekRydkljcF9SZWdDYWxsYmFjaygKKyAgICAgICAgICAgICAgICBJQ1BfQVJNMF9NT0RVTEVfSURfT1MsIAorICAgICAgICAgICAgICAgIGFjdG9ySUQsIAorICAgICAgICAgICAgICAgIGNhbGxiYWNrLCAKKyAgICAgICAgICAgICAgICBJQ1BfSVNSX0NBTExCQUNLKTsgCisgICAgZWxzZQorICAgICAgICByZXR1cm4gekRydlJwTXNnX1JlZ0NhbGxCYWNrKGFjdG9ySUQsY2hJRCxjYWxsYmFjayk7CisjZW5kaWYKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoguabE3MPoyvY6ICAgIHJhbWR1bXBfb3NzX2ljcF93cml0ZQorKiCyzsr9y7XD9zogICAgIAorKiAgICi0q8jrss7K/SkgcE1zZzogaWNwIHNlbmQgbXNnCisqICAgKLSrs/ayzsr9KSB2b2lkIAorKiC3tSC72CDWtTogICAgaW50OiBpZiBtc2cgc2VuZCBzdWNjZXNzIAorKiDG5Mv8y7XD9zogICAgCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworaW50IHJhbWR1bXBfb3NzX2ljcF93cml0ZShjb25zdCByYW1kdW1wX29zc19pY3BfbXNnICpwTXNnKQoreworI2lmZGVmIF9PU19MSU5VWAorICAgIHJldHVybiBDUFBTX0ZVTkMoY3Bwc19jYWxsYmFja3MsIHpEcnZScE1zZ19Xcml0ZSkocE1zZyk7CisjZWxpZiBkZWZpbmVkIChfT1NfVE9TKQorICAgIGlmICgocmFtZHVtcF9tc2dfdCAqKXBNc2ctPmFjdG9ySUQgPT0gcmFtZHVtcF9jcHVfaWRbUkFNRFVNUF9DUFVfMl0pCisgICAgeworICAgICAgICBzd2l0Y2ggKCgocmFtZHVtcF9tc2dfdCAqKShwTXNnLT5idWYpKS0+bXNnX2lkKQorICAgICAgICB7CisgICAgICAgICAgICBjYXNlIFJBTURVTVBfTVNHX0VYQ0VQVDoKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBUX0hhbEljcF9Nc2cgaWNwTXNnID0geyAwIH07CisgICAgICAgICAgICAgICAgaWNwTXNnLlNyY01vZElkICAgICAgICAgID0gSUNQX0FSTTBfTU9EVUxFX0lEX09TOworICAgICAgICAgICAgICAgIGljcE1zZy5kZXNNb2RJZCAgICAgICAgICA9IElDUF9BUk0xX01PRFVMRV9JRF9PUzsKKyAgICAgICAgICAgICAgICBpY3BNc2cuSW50SW5mby5oaWdoX3dvcmQgPSBaUExBVF9QUzJQSFlfUkFNRFVNUF9JTlRfSUNQX0NGOworICAgICAgICAgICAgICAgIHpEcnZJY3BfU2VuZE1zZygoY29uc3QgVF9IYWxJY3BfTXNnICopJmljcE1zZyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBjYXNlIFJBTURVTVBfTVNHX1NZTkM6CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIHJldHVybiBwTXNnLT5sZW47CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgICAgICByZXR1cm4gekRydlJwTXNnX1dyaXRlTG9ja0lycShwTXNnKTsKKyNlbmRpZgorfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiC5psTcw+jK9jogICAgIHJhbWR1bXBfb3NzX2RhdGFfdHJhbnNfaW5pdAorKiCyzsr9y7XD9zogICAgIAorKiAgICi0q8jrss7K/SkgIHZvaWQKKyogICAotKuz9rLOyv0pICB2b2lkCisqILe1ILvYINa1OiAgICAgdm9pZAorKiDG5Mv8y7XD9zogICAgCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwordm9pZCByYW1kdW1wX29zc19kYXRhX3RyYW5zX2luaXQodm9pZCkKK3sKKyNpZmRlZiBfT1NfTElOVVggCisgICAgekRydlVzYlBvbGxfSW5pdCgpOyAgICAgICAgICAgICAgICAgLyogs/XKvLuvVVNCICAgICAgICAqLworICAgIHdoaWxlICghekRydlVzYlBvbGxfaXNDb25uZWN0KCkpIDsgIC8qILLp0a9VU0LKx7fxway90yAgKi8KKyNlbmRpZgorfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiC5psTcw+jK9jogICAgIHJhbWR1bXBfb3NzX2RhdGFfdHJhbnNfcmVhZAorKiCyzsr9y7XD9zogICAgIAorKiAgICi0q8jrss7K/SkgYnVmZmVyOiBkYXRhIGJ1ZmYKKyAgICAgICAgICAgICAgIHNpemU6ICAgZGF0YSBzaXplCisqICAgKLSrs/ayzsr9KSB2b2lkIAorKiC3tSC72CDWtTogICAgdm9pZAorKiDG5Mv8y7XD9zogICAgCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwordm9pZCByYW1kdW1wX29zc19kYXRhX3RyYW5zX3JlYWQodW5zaWduZWQgY2hhciAqYnVmZmVyLCB1bnNpZ25lZCBpbnQgc2l6ZSkKK3sKKyNpZmRlZiBfT1NfTElOVVggCisgICAgdW5zaWduZWQgaW50IGNvdW50ID0gMDsKKworICAgIGRvCisgICAgeworICAgICAgICB6RHJ2VXNiUG9sbF9Jc3IoKTsKKyAgICAgICAgY291bnQgPSAodW5zaWduZWQgaW50KXpEcnZVc2JQb2xsX1JlYWQoYnVmZmVyLCBzaXplKTsKKyAgICAgICAgaWYgKCBzaXplIDw9IGNvdW50KQorICAgICAgICB7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfSAgICAgICAgCisgICAgICAgIGJ1ZmZlciArPSBjb3VudDsKKyAgICAgICAgc2l6ZSAtPWNvdW50OworICAgIH0KKyAgICB3aGlsZSAoc2l6ZSA+IDApOworI2VuZGlmCit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqILmmxNzD6Mr2OiAgICAgcmFtZHVtcF9vc3NfZGF0YV90cmFuc193cml0ZQorKiCyzsr9y7XD9zogICAgIAorKiAgICi0q8jrss7K/SkgYnVmZmVyOiBkYXRhIGJ1ZmYKKyAgICAgICAgICAgICAgIHNpemU6ICAgZGF0YSBzaXplCisqICAgKLSrs/ayzsr9KSB2b2lkIAorKiC3tSC72CDWtTogICAgdm9pZAorKiDG5Mv8y7XD9zogICAgCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwordm9pZCByYW1kdW1wX29zc19kYXRhX3RyYW5zX3dyaXRlKHVuc2lnbmVkIGNoYXIgKmJ1ZmZlciwgdW5zaWduZWQgaW50IHNpemUpCit7CisjaWZkZWYgX09TX0xJTlVYIAorICAgIHVuc2lnbmVkIGludCBjb3VudCA9IDA7CisKKyAgICB3aGlsZSAoc2l6ZSA+IDApCisgICAgeworICAgICAgICB6RHJ2VXNiUG9sbF9Jc3IoKTsKKyAgICAgICAgY291bnQgPSAodW5zaWduZWQgaW50KXpEcnZVc2JQb2xsX1dyaXRlKGJ1ZmZlciwgc2l6ZSk7CisgICAgICAgIGlmICggc2l6ZSA8PSBjb3VudCkKKyAgICAgICAgeworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGJ1ZmZlciArPSBjb3VudDsKKyAgICAgICAgc2l6ZSAtPWNvdW50OworICAgIH0KKyNlbmRpZgorfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiC5psTcw+jK9jogICAgIHJhbWR1bXBfb3NzX2RhdGFfdHJhbnNfZG9uZQorKiCyzsr9y7XD9zogICAgIAorKiAgICi0q8jrss7K/SkgIHZvaWQKKyogICAotKuz9rLOyv0pICB2b2lkCisqILe1ILvYINa1OiAgICAgdm9pZAorKiDG5Mv8y7XD9zogICAgCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwordm9pZCByYW1kdW1wX29zc19kYXRhX3RyYW5zX2RvbmUodm9pZCkKK3sKKyNpZmRlZiBfT1NfTElOVVggICAgIAorICAgIC8qILXItP3K/b7dt6LLzc3quvOjrNTZ1tjG9CAqLworICAgIHpEcnZVc2JQb2xsX0lzcigpOworI2VuZGlmCit9CisKK3ZvaWQgcmFtZHVtcF9vc3NfbG9nYnVmX2NyZWF0ZSh2b2lkKQoreworI2lmZGVmIF9PU19MSU5VWCAgCisjaWYgZGVmaW5lZCBDT05GSUdfUFJJTlRLCisKKwl1bnNpZ25lZCBsb25nIGFkZHI7CisJdW5zaWduZWQgbG9uZyBzaXplOworCQorCWdldF9sb2didWZfaW5mbygmYWRkciwgJnNpemUpOworCQorCXJhbWR1bXBfcmFtX2NvbmZfdGFibGVfYWRkKAorCQkiYXBfbG9nX2J1ZiIsIAorCQkodW5zaWduZWQgbG9uZylPU1NfVklSVF9UT19QSFkoYWRkciksIAorCQlzaXplLCAKKwkJYWRkciwKKwkJUkFNRFVNUF9GTEFHX05PTkUsCisJCTApOworI2VuZGlmCisjZW5kaWYKK30KKworI2lmZGVmIF9fY3BsdXNwbHVzCit9CisjZW5kaWYKKwpkaWZmIC0tZ2l0IGEvYXAvb3MvbGludXgvbGludXgtMy40LngvbW0vcmFtZHVtcC9yYW1kdW1wX3RyYW5zX3NlcnZlci5jIGIvYXAvb3MvbGludXgvbGludXgtMy40LngvbW0vcmFtZHVtcC9yYW1kdW1wX3RyYW5zX3NlcnZlci5jCm5ldyBmaWxlIG1vZGUgMTAwNzU1CmluZGV4IDAwMDAwMDAuLmRhMWE3OTEKLS0tIC9kZXYvbnVsbAorKysgYi9hcC9vcy9saW51eC9saW51eC0zLjQueC9tbS9yYW1kdW1wL3JhbWR1bXBfdHJhbnNfc2VydmVyLmMKQEAgLTAsMCArMSwxMjE3IEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiCw5sioy/nT0CAoQykyMDE2LCDW0NDLzajRtrnJt93T0M/euavLvqGjCisqIAorKiDOxLz+w/uzxjogICAgIHJhbWR1bXBfc2VydmVyX3RyYW5zLmMKKyogzsS8/rHqyrY6ICAgICByYW1kdW1wX3NlcnZlcl90cmFucy5jCisqIMTayN3VqtKqOiAgICAgcmFtZHVtcLf+zvG2y9Lss6PLwLv6z9azocr9vt21vLP2yrXP1gorKiAKKyog0N64xMjVxtogICAgICAgILDmsb66xSAgICAgINDeuMSx6rzHICAgICAgICDQ3rjEyMsgICAgICAgICAg0N64xMTayN0KKyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisqIDIwMTYvMy8xMCAgICAgIFYxLjAgICAgICAgIENyZWF0ZSAgICAgICAgICAg1dS+/L/8ICAgICAgICAgILS0vagKKyogCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgzbfOxLz+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaW5jbHVkZSAicmFtZHVtcF9wdWIuaCIKKyNpbmNsdWRlICJyYW1kdW1wX29zcy5oIgorI2luY2x1ZGUgPGxpbnV4L21vZHVsZS5oPgorCisjaWZkZWYgX19jcGx1c3BsdXMKK2V4dGVybiAiQyIgeworI2VuZGlmCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgILOjwb+2qNLlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNkZWZpbmUgX19VU0VfVFJBTlNfV0lUSF9DT0xMRUNUX18gIDEKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgILrqtqjS5SAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2RlZmluZSBSQU1EVU1QX09OX0RFRkFVTFRfVkFMICAoMSkKKworI2RlZmluZSBSQU1EVU1QX01NQVBfU1VDQ0VTUyAoUkFNRFVNUF9TVUNDRVNTKQorI2RlZmluZSBSQU1EVU1QX01NQVBfRkFJTEVEICAoUkFNRFVNUF9GQUlMRUQpCisKKyNkZWZpbmUgUlBfTVNHX1BTX1BIWV9SQU1EVU1QX0NIQU5ORUwgICAgICAgY2hhbm5lbF80MCAgICAgLy9hcm2honpzcNauvOS1xHJhbWR1bXDNqLXACisjZGVmaW5lIFJQX01TR19QU19QSFlfUkFNRFVNUF9TSVpFICAgICAgICAgIDB4NDAgICAgIC8vYXJtoaJ6c3DWrrzktcRyYW1kdW1wzai1wAorCisjaWZkZWYgX1VTRV9DQVBfU1lTCisjZGVmaW5lIFJBTURVTVBfSUNQX01TR19DQVBfU0laRSAgICAgICAgICAJMHg0MCAKKyNlbmRpZgorCisvKiByYW1kdW1wILrNIFBDx/22r7T6wO29u7ulw/zB7tS8tqggKi8KKy8qzayyvcfrx/MqLworI2RlZmluZSBSQU1EVU1QX1BDX0lOVEVSQUNUSVZFX1JFUSAgICAgICAgICAgICAgICAgIDEKKy8qzayyvcfrx/PTprTwLLSryuRyYW1kdW1wtcTOxLz+yv3EvyovCisjZGVmaW5lIFJBTURVTVBfVFJBTlNfU0VSVkVSX0lOVEVSQUNUSVZFX1JTUCAgICAgICAgMgorLyrH68fztKu13da4tqjOxLz+seC6xbXEzsS8/tDFz6IqLworI2RlZmluZSBSQU1EVU1QX1BDX0ZJTEVfSU5GT19SRUFEX1JFUSAgICAgICAgICAgICAgIDMKKy8qx+vH87Srtd3WuLaozsS8/rHgusW1xM7EvP7Qxc+itcTTprTwo6y0q8rkzsS8/sP7vLC089ChKi8KKyNkZWZpbmUgUkFNRFVNUF9UUkFOU19TRVJWRVJfRklMRV9JTkZPX1JFQURfUlNQICAgICA0CisvKsfrx/O2wcih1ri2qM7EvP6x4LrFtcTOxLz+xNrI3SovCisjZGVmaW5lIFJBTURVTVBfUENfRklMRV9EQVRBX1RSQU5TX1JFUSAgICAgICAgICAgICAgNQorLyrH68fztsHIoda4tqjOxLz+seC6xbXEzsS8/sTayN21xNOmtPCjrLSryuTOxLz+xNrI3SovCisjZGVmaW5lIFJBTURVTVBfVFJBTlNfU0VSVkVSX0ZJTEVfREFUQV9UUkFOU19SU1AgICAgNgorLyq0q8rkveHK+CovCisjZGVmaW5lIFJBTURVTVBfUENfRklMRV9UUkFOU19ET05FX1JFUSAgICAgICAgICAgICAgNworLyq0q8rkveHK+NOmtPAqLyAKKyNkZWZpbmUgUkFNRFVNUF9UUkFOU19TRVJWRVJfRklMRV9UUkFOU19ET05FX1JTUCAgICA4CisKKy8qILTtzvPA4NDNICovCisvKta4we607c7zKi8KKyNkZWZpbmUgUkFNRFVNUF9JTlRFUkFDVElWRV9DTURfRVJST1IgICAgICAgOQorLyrH68fztKu13da4tqjOxLz+seC6xbTtKi8KKyNkZWZpbmUgUkFNRFVNUF9GSUxFX05VTUJFUl9FUlJPUiAgICAgICAgICAgMTAKKy8qx+vH87Srtd3WuLaozsS8/s671sO089ChtO0qLworI2RlZmluZSBSQU1EVU1QX0ZJTEVfU0laRV9FUlJPUiAgICAgICAgICAgICAxMQorLyrWuMHu1qGzpLbIICovCisjZGVmaW5lIFJBTURVTVBfSU5URVJBQ1RJVkVfREFUQV9MRU4gICAgICAgIDE2CisKKyNkZWZpbmUgUkFNRFVNUF9UUkFOU19TRVJWRVJfRERSX0JJTk5BTUUgICJ0cmFuc19zZXJ2ZXJfZGRyLmJpbiIKKyNkZWZpbmUgUkFNRFVNUF9UUkFOU19TRVJWRVJfQ01NX1NDUk5BTUUgICJ0cmFuc19zZXJ2ZXJfY21tLmNtbSIKKyNkZWZpbmUgUkFNRFVNUF9UUkFOU19TRVJWRVJfRVJSX0xPRyAgICAgICJ0cmFuc19zZXJ2ZXJfZXJyb3JfbG9nLnR4dCIKKyNkZWZpbmUgUkFNRFVNUF9UUkFOU19TRVJWRVJfREVGX0JJTk5BTUUgICJ0cmFuc19zZXJ2ZXJfIgorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgyv2+3cDg0M22qNLlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovC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IGRhdGEgbXNnIHN0cnVjdCAqLwordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgICB1bnNpZ25lZCBsb25nICAgY21kOworICAgIHVuc2lnbmVkIGxvbmcgICBmaWxlX2lkOyAgICAgIC8qIM7EvP6x4LrFICAgICAgICAgKi8KKyAgICB1bnNpZ25lZCBsb25nICAgb2Zmc2V0OyAgICAgICAvKiBvZmZzZXTOqsr9vt3Gq9LGICovCisgICAgdW5zaWduZWQgbG9uZyAgIGxlbmd0aDsgICAgICAgLyogbGVuZ3RozqrK/b7ds6S2yCAqLworfSByYW1kdW1wX3BjX3RyYW5zX2RhdGFfcmVxOworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICC6r8r9yfnD9yAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmbmRlZiBDT05GSUdfU1lTVEVNX1JFQ09WRVJZCitleHRlcm4gdW5zaWduZWQgaW50IHpPc3NfR2V0RXhjZXB0UmVzZXRGbGFnKHZvaWQpOworZXh0ZXJuIGludCB6U3lzX0V4Y2VwdFJlYm9vdCh1bnNpZ25lZCBpbnQgIGV4Y2VwdF9jcHUpOworI2Vsc2UKK2V4dGVybiB2b2lkIGVtZXJnZW5jeV9yZXN0YXJ0KHZvaWQpOworI2VuZGlmCisKK2V4dGVybiB2b2lkIHp4X3dkdF9tMF9zdG9wKHZvaWQpOworZXh0ZXJuIHN0cnVjdCBtZW1pbmZvIG1lbWluZm87CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqICAgICAgICAgICAgICAgICAgICAg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5jX21zZ190IHJhbWR1bXBfY29sbGVjdF9zZXJ2ZXJfcmFtX2NvbmY7CisKK3N0YXRpYyByYW1kdW1wX3JhbV9jb25maWdfbXNnX3QgcmFtZHVtcF9hcF9jb25maWc7CitzdGF0aWMgaW50IHJhbWR1bXBfYXBfZmlsZV9udW07CisKKyNlbmRpZgorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgyKu+1rHkwb+2qNLlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKgorICogcnVuIHRpbWUgY29udHJvbCBkdW1wIG9yIG5vdCwgdXNlICggZWNobyAiMCIgPiByYW1kdW1wX29uICkgdG8gY2xvc2UgcmFtZHVtcAorICovCitpbnQgc3lzY3RsX3JhbWR1bXBfb25fcGFuaWMgPSBSQU1EVU1QX09OX0RFRkFVTFRfVkFMOworCisvKiBkaWZmIHNlcnZlciBjcmFzaCBvciBjbGllbnQgY3Jhc2ggKi8KK2ludCByYW1kdW1wX3RyYW5zX3NlcnZlcl9mb3JjZV9wYW5pY19mbGFnID0gUkFNRFVNUF9GQUxTRTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIL7Wsr+6r8r9yrXP1iAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiC5psTcw+jK9jogICAgIHJhbWR1bXBfdHJhbnNfc2VydmVyX2R5bmFtaWNfcmFtX2NvbmZfY29sbGVjdAorKiCyzsr9y7XD9zogICAgIAorKiAgICi0q8jrss7K/SkgIHZvaWQKKyogICAotKuz9rLOyv0pICB2b2lkCisqILe1ILvYINa1OiAgICAgdm9pZAorKiDG5Mv8y7XD9zogICAgIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCB0byBjb2xsZWN0IHNlcnZlciByYW0gY29uZiBiZWZvcmUgY2xpZW50IG1tYXAKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgdW5zaWduZWQgbG9uZyByYW1kdW1wX3BoeV90b192aXIocmFtZHVtcF9yYW1fY29uZmlnX3QgKiByYW1fY29uZmlnKQoreworICAgIHVuc2lnbmVkIGxvbmcgcGZuID0gMDsKKyAgICB1bnNpZ25lZCBsb25nIHZpcl9hZGRyID0gMDsKKworICAgIGlmKHJhbV9jb25maWctPnZpciAhPSAwKQorICAgICAgICByZXR1cm4gcmFtX2NvbmZpZy0+dmlyOworCisgICAgcGZuID0gT1NTX1BIWV9UT19QRk4oKHVuc2lnbmVkIGxvbmcpKHJhbV9jb25maWctPnBoeSkpOworICAgIGlmIChPU1NfUEZOX1ZBTElEKHBmbikpCisgICAgICAgIHZpcl9hZGRyID0gT1NTX1BIWV9UT19WSVJUKCh1bnNpZ25lZCBsb25nKXJhbV9jb25maWctPnBoeSk7CisgICAgZWxzZSAKKyAgICAgICAgaWYgKHJhbV9jb25maWctPmNvcHkgICE9IDAgJiYKKyAgICAgICAgICAgICAgICAgcmFtX2NvbmZpZy0+Y29weSAgIT0gcmFtX2NvbmZpZy0+cGh5KQorICAgICAgICB7CisgICAgICAgICAgICB2aXJfYWRkciA9KHVuc2lnbmVkIGxvbmcpcmFtX2NvbmZpZy0+Y29weTsKKyAgICAgICAgfQorICAgICAgICAgZWxzZSBpZiAocmFtX2NvbmZpZy0+ZXh0ZXIgICE9IDAgJiYgcmFtX2NvbmZpZy0+ZXh0ZXIgICE9IHJhbV9jb25maWctPnBoeSkKKyAgICAgICAgeworICAgICAgICAgICAgdmlyX2FkZHIgPSAodW5zaWduZWQgbG9uZylyYW1fY29uZmlnLT5leHRlcjsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgICB2aXJfYWRkciA9ICh1bnNpZ25lZCBsb25nKU9TU19NTUFQKHJhbV9jb25maWctPnBoeSwgcmFtX2NvbmZpZy0+c2l6ZSk7CisgICAgICAgIAorICAgIHJldHVybiB2aXJfYWRkcjsKK30KKworI2lmbmRlZiBfX1VTRV9UUkFOU19XSVRIX0NPTExFQ1RfXyAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqILmmxNzD6Mr2OiAgICAgcmFtZHVtcF90cmFuc19zZXJ2ZXJfcmFtX2NvbmZfdGFibGVfbW1hcAorKiCyzsr9y7XD9zogICAgIAorKiAgICi0q8jrss7K/SkgIGFycmF5OiByYW0gY29uZiB0YWJsZSBhZGRyCisqICAgICAgICAgICAgICAgbnI6IHJhbSBjb25mIHRhYmxlIHNpemUKKyogICAotKuz9rLOyv0pICB2b2lkCisqILe1ILvYINa1OiAgICAgdm9pZAorKiDG5Mv8y7XD9zogICAgIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCBmb3IgcmFtZHVtcCB0cmFucyB0byBtbWFwIGFkZHIgdGFibGUgc3BhY2UKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgdm9pZCByYW1kdW1wX3RyYW5zX3NlcnZlcl9yYW1fY29uZl90YWJsZV9tbWFwKAorICAgICAgICAgICAgICAgIHZvaWQgKmFycmF5LCAKKyAgICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgbnIpCit7CisgICAgdW5zaWduZWQgbG9uZyBjcHVfaWQgPSAwOworICAgIHVuc2lnbmVkIGxvbmcgdmlyX2FkZHIgPSAwOworICAgIHVuc2lnbmVkIGxvbmcgcGZuID0gMDsKKyAgICB3aGlsZSAoY3B1X2lkIDwgbnIpCisgICAgeworICAgICAgICB2aXJfYWRkciA9IDA7CisgICAgICAgIHBmbiA9IDA7CisgICAgICAgIHJhbWR1bXBfcmFtX2NvbmZpZ19tc2dfdCAqYXJyYXlfZW50cnkgPSAKKyAgICAgICAgICAgIChyYW1kdW1wX3JhbV9jb25maWdfbXNnX3QgKikoJihyYW1kdW1wX2NvbGxlY3Rfc2VydmVyX3JhbV9jb25mLmFycmF5W2NwdV9pZF0pKTsKKyAgICAgICAgaWYgKCgoKChyYW1kdW1wX3JhbV9jb25maWdfbXNnX3QgKilhcnJheSlbY3B1X2lkXSkuYXJyYXkpID09IE5VTEwgfHwgCisgICAgICAgICAgICAoKCgocmFtZHVtcF9yYW1fY29uZmlnX21zZ190ICopYXJyYXkpW2NwdV9pZF0pLm5yKSA9PSAwKQorICAgICAgICB7CisgICAgICAgICAgICBjcHVfaWQrKzsKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICB9CisKKyAgICAgICAgcGZuID0gT1NTX1BIWV9UT19QRk4oKHVuc2lnbmVkIGxvbmcpKCgoKHJhbWR1bXBfcmFtX2NvbmZpZ19tc2dfdCAqKWFycmF5KVtjcHVfaWRdKS5hcnJheSkpOworICAgICAgICBpZiAoT1NTX1BGTl9WQUxJRChwZm4pKQorICAgICAgICAgICAgdmlyX2FkZHIgPSBPU1NfUEhZX1RPX1ZJUlQoKHVuc2lnbmVkIGxvbmcpKCgoKHJhbWR1bXBfcmFtX2NvbmZpZ19tc2dfdCAqKWFycmF5KVtjcHVfaWRdKS5hcnJheSkpOworICAgICAgICBlbHNlIAorICAgICAgICAgICAgdmlyX2FkZHIgPSAodW5zaWduZWQgbG9uZylPU1NfTU1BUCgKKyAgICAgICAgICAgICAgICAodW5zaWduZWQgbG9uZykoKCgocmFtZHVtcF9yYW1fY29uZmlnX21zZ190ICopYXJyYXkpW2NwdV9pZF0pLmFycmF5KSwKKyAgICAgICAgICAgICAgICAoKCgocmFtZHVtcF9yYW1fY29uZmlnX21zZ190ICopYXJyYXkpW2NwdV9pZF0ubnIpICogc2l6ZW9mKHJhbWR1bXBfcmFtX2NvbmZpZ190KSkpOworICAgICAgICBpZiAodmlyX2FkZHIgPT0gMCkKKyAgICAgICAgeworICAgICAgICAgICAgT1NTX1BSSU5URigiW3JhbWR1bXBdIHRyYW5zIHNlcnZlciBtbWFwIGNvbGxlY3Qgc2VydmVyIHJhbSBjb25mIHRhYmxlIGVudHJ5IGZhaWxlZCFcbiIpOworICAgICAgICAgICAgY3B1X2lkKys7CisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIGFycmF5X2VudHJ5LT5hcnJheSA9IChyYW1kdW1wX3JhbV9jb25maWdfdCAqKXZpcl9hZGRyOworICAgICAgICAgICAgYXJyYXlfZW50cnktPm5yID0gKCgocmFtZHVtcF9yYW1fY29uZmlnX21zZ190ICopYXJyYXkpW2NwdV9pZF0ubnIpOworICAgICAgICB9CisKKyAgICAgICAgLyogbW1hcCBjb2xsZWN0IHJhbSBjb25mIHRhYmxlIHNwYWNlIHN5bmMgZG9uZSBmbGFnICovCisgICAgICAgIHZpcl9hZGRyID0gMDsKKyAgICAgICAgcGZuID0gT1NTX1BIWV9UT19QRk4oKHVuc2lnbmVkIGxvbmcpKCgoKHJhbWR1bXBfcmFtX2NvbmZpZ19tc2dfdCAqKWFycmF5KVtjcHVfaWRdKS5kb25lX2ZsYWcpKTsKKyAgICAgICAgaWYgKE9TU19QRk5fVkFMSUQocGZuKSkKKyAgICAgICAgICAgIHZpcl9hZGRyID0gT1NTX1BIWV9UT19WSVJUKCh1bnNpZ25lZCBsb25nKSgoKChyYW1kdW1wX3JhbV9jb25maWdfbXNnX3QgKilhcnJheSlbY3B1X2lkXSkuZG9uZV9mbGFnKSk7CisgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHZpcl9hZGRyID0gKHVuc2lnbmVkIGxvbmcpT1NTX01NQVAoCisgICAgICAgICAgICAgICAgKHVuc2lnbmVkIGxvbmcpKCgoKHJhbWR1bXBfcmFtX2NvbmZpZ19tc2dfdCAqKWFycmF5KVtjcHVfaWRdKS5kb25lX2ZsYWcpLAorICAgICAgICAgICAgICAgIHNpemVvZigqKCgoKHJhbWR1bXBfcmFtX2NvbmZpZ19tc2dfdCAqKWFycmF5KVtjcHVfaWRdKS5kb25lX2ZsYWcpKSk7CisgICAgICAgIGlmICh2aXJfYWRkciA9PSAwKQorICAgICAgICB7CisgICAgICAgICAgICBPU1NfUFJJTlRGKCJbcmFtZHVtcF0gdHJhbnMgc2VydmVyIG1tYXAgY29sbGVjdCBzZXJ2ZXIgdGFibGUgZW50cnkgZG9uZSBmbGFnIGZhaWxlZCFcbiIpOworICAgICAgICAgICAgY3B1X2lkKys7CisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIGFycmF5X2VudHJ5LT5kb25lX2ZsYWcgPSB2aXJfYWRkcjsKKyAgICAgICAgfQorICAgICAgICBjcHVfaWQrKzsKKyAgICB9CisKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoguabE3MPoyvY6ICAgICByYW1kdW1wX2R1bXBfcmFtX2NvbmZfbW1hcF9pbml0CisqILLOyv3LtcP3OiAgICAgCisqICAgKLSryOuyzsr9KSAgdm9pZAorKiAgICi0q7P2ss7K/SkgIHZvaWQKKyogt7Ugu9gg1rU6ICAgICB2b2lkCisqIMbky/zLtcP3OiAgICAgVGhpcyBmdW5jdGlvbiBpcyB1c2VkIGZvciByYW1kdW1wIGNsaWVudCBtbWFwIGluaXQKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgdm9pZCByYW1kdW1wX2R1bXBfcmFtX2NvbmZfbW1hcF9pbml0KHZvaWQpCit7CisgICAgdW5zaWduZWQgbG9uZyB2aXJfYWRkciA9IDA7CisgICAgaW50IGNwdV9pZCA9IDA7IAorCisgICAgLyogaXRlcmF0ZSBhbGwgY3B1ICovCisgICAgd2hpbGUgKGNwdV9pZCA8IHJhbWR1bXBfY29sbGVjdF9zZXJ2ZXJfcmFtX2NvbmYubnIpCisgICAgeworICAgICAgICBpbnQgdGJfaW5kZXggPSAwOworICAgICAgICB1bnNpZ25lZCBsb25nIHBmbiA9IDA7CisgICAgICAgIHJhbWR1bXBfcmFtX2NvbmZpZ19tc2dfdCAqYXJyYXlfZW50cnkgPSAKKyAgICAgICAgICAgIChyYW1kdW1wX3JhbV9jb25maWdfbXNnX3QgKikoJihyYW1kdW1wX2NvbGxlY3Rfc2VydmVyX3JhbV9jb25mLmFycmF5W2NwdV9pZF0pKTsKKyAgICAgICAgaWYgKGFycmF5X2VudHJ5LT5hcnJheSA9PSBOVUxMIHx8IGFycmF5X2VudHJ5LT5uciA9PSAwIHx8IGFycmF5X2VudHJ5LT5kb25lX2ZsYWcgPT0gTlVMTCkKKyAgICAgICAgeworICAgICAgICAgICAgT1NTX1BSSU5URigiUmFtZHVtcCBtYXliZSBoYXBwZW5zIGJlZm9yZSBjb2xsZWN0IHNlcnZlciBpbml0IGRvbmUsIHBsZWFzZSBjaGVjayFcbiIpOworICAgICAgICAgICAgY3B1X2lkKys7CisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgfQorCisgICAgICAgIC8qIHdhaXQgY29sbGVjdCBkYXRhIGRvbmUgKi8KKyAgICAgICAgd2hpbGUgKCooYXJyYXlfZW50cnktPmRvbmVfZmxhZykgPT0gUkFNRFVNUF9TWU5DX1JFU0VUKSAKKyAgICAgICAgICAgIHJhbWR1bXBfd2FpdF9kb25lX2RlbGF5KAorICAgICAgICAgICAgICAgIFJBTURVTVBfV0FJVF9USU1FTEVOLCAKKyAgICAgICAgICAgICAgICAodm9sYXRpbGUgdW5zaWduZWQgbG9uZyAqKWFycmF5X2VudHJ5LT5kb25lX2ZsYWcsIAorICAgICAgICAgICAgICAgIFJBTURVTVBfU1lOQ19SQU1fQ09ORklHX0RPTkUpOworCisgICAgICAgICAvKiBpdGVyYXRlIGFsbCByYW0gY29uZiB0YWJsZSBlbnRyeSAqLworICAgICAgICB3aGlsZSAodGJfaW5kZXggPCBhcnJheV9lbnRyeS0+bnIpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChhcnJheV9lbnRyeS0+YXJyYXlbdGJfaW5kZXhdLnBoeSA9PSAwIHx8CisgICAgICAgICAgICAgICAgYXJyYXlfZW50cnktPmFycmF5W3RiX2luZGV4XS5zaXplID09IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdGJfaW5kZXgrKzsKKyAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgdmlyX2FkZHIgPSByYW1kdW1wX3BoeV90b192aXIoJmFycmF5X2VudHJ5LT5hcnJheVt0Yl9pbmRleF0pOworICAgICAgICAgICAgaWYgKHZpcl9hZGRyID09IDApCisgICAgICAgICAgICAgICAgT1NTX1BSSU5URigiUmFtZHVtcCBpbml0IGZhaWxlZCwgY2xpZW50IG1lbSBtbWFwIGluaXQgd3JvbmchXG4iKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBhcnJheV9lbnRyeS0+YXJyYXlbdGJfaW5kZXhdLnZpciA9IHZpcl9hZGRyOworICAgICAgICAgICAgdGJfaW5kZXgrKzsKKyAgICAgICAgfQorICAgICAgICBjcHVfaWQrKzsKKyAgICB9CisKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoguabE3MPoyvY6ICAgIHJhbWR1bXBfZHVtcF9maWxlX251bV9yZWNhbGMKKyogss7K/cu1w/c6ICAgICAKKyogICAotKvI67LOyv0pIHZvaWQKKyogICAotKuz9rLOyv0pIHZvaWQKKyogt7Ugu9gg1rU6ICAgIHZvaWQKKyogxuTL/Mu1w/c6ICAgIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCB0byBjcmVhdGUgZXJyIGxvZyBmaWxlCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RhdGljIHZvaWQgcmFtZHVtcF9kdW1wX2ZpbGVfbnVtX3JlY2FsYyh2b2lkKQoreworICAgIHVuc2lnbmVkIGxvbmcgY3B1X2lkICAgID0gMDsKKyAgICBpZiAocmFtZHVtcF9jb2xsZWN0X3NlcnZlcl9yYW1fY29uZi5uciA9PSAwIHx8IAorICAgICAgICByYW1kdW1wX2NvbGxlY3Rfc2VydmVyX3JhbV9jb25mLmFycmF5ID09IE5VTEwpCisgICAgICAgIHdoaWxlKFRSVUUpOyAvKiBleGNlcHQgaGFwcGVuZHMgYmVmb3JlIHN5bmMgd2l0aCBvdGhlciBjb3JlIGRvbmUgKi8KKworICAgIHdoaWxlIChjcHVfaWQgPCByYW1kdW1wX2NvbGxlY3Rfc2VydmVyX3JhbV9jb25mLm5yKQorICAgIHsKKyAgICAgICAgdW5zaWduZWQgbG9uZyBhcnJfbnVtID0gMDsKKyAgICAgICAgdW5zaWduZWQgbG9uZyBmaWxlX251bSAgPSAwOworICAgICAgICB3aGlsZShhcnJfbnVtIDwgcmFtZHVtcF9jb2xsZWN0X3NlcnZlcl9yYW1fY29uZi5hcnJheVtjcHVfaWRdLm5yKQorICAgICAgICB7CisgICAgICAgICAgICAvKiByYW0gY29uZiBoYXZlIGNvbnRlbnRzLG5lZWQgdG8gZHVtcCAqLworICAgICAgICAgICAgaWYgKHJhbWR1bXBfY29sbGVjdF9zZXJ2ZXJfcmFtX2NvbmYuYXJyYXlbY3B1X2lkXS5hcnJheVthcnJfbnVtXS52aXIgIT0gMCAmJgorICAgICAgICAgICAgICAgIHJhbWR1bXBfY29sbGVjdF9zZXJ2ZXJfcmFtX2NvbmYuYXJyYXlbY3B1X2lkXS5hcnJheVthcnJfbnVtXS5zaXplICE9IDApCisgICAgICAgICAgICAgICAgZmlsZV9udW0rKzsKKyAgICAgICAgICAgIGFycl9udW0rKzsKKyAgICAgICAgfQorICAgICAgICByYW1kdW1wX2NvbGxlY3Rfc2VydmVyX3JhbV9jb25mLmFycmF5W2NwdV9pZF0ubnIgPSBmaWxlX251bTsKKyAgICAgICAgY3B1X2lkKys7CisgICAgfQorfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiC5psTcw+jK9jogICAgcmFtZHVtcF9maW5kX2NvbGxlY3RfcmFtX2NvbmZfZW50cnlfaWQKKyogss7K/cu1w/c6ICAgICAKKyogICAotKvI67LOyv0pIGZpbGVfaWQ6IGZpbGUgbnVtYmVyCisqICAgKLSrs/ayzsr9KSBjcHVfaWQgOiBjcHUgaW5kZXgKKyogt7Ugu9gg1rU6ICAgIHVuc2lnbmVkIGxvbmc6IGZpbGUgaWQKKyogxuTL/Mu1w/c6ICAgIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCBmb3IgcmFtZHVtcCB0byAKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgdW5zaWduZWQgbG9uZyByYW1kdW1wX2ZpbmRfY29sbGVjdF9yYW1fY29uZl9lbnRyeV9pZCgKKyAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZmlsZV9pZCwgCisgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nKiBjcHVfaWQpCit7CisgICAgdW5zaWduZWQgbG9uZyBjcHVfaW5kZXggPSAwOworICAgIHdoaWxlIChjcHVfaW5kZXggPCBSQU1EVU1QX0NQVV9NQVgpCisgICAgeworICAgICAgICBpZiAoZmlsZV9pZCA+PSByYW1kdW1wX2NvbGxlY3Rfc2VydmVyX3JhbV9jb25mLmFycmF5W2NwdV9pbmRleF0ubnIpCisgICAgICAgICAgICBmaWxlX2lkIC09IHJhbWR1bXBfY29sbGVjdF9zZXJ2ZXJfcmFtX2NvbmYuYXJyYXlbY3B1X2luZGV4XS5ucjsKKyAgICAgICAgZWxzZQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNwdV9pbmRleCsrOworICAgIH0KKworICAgICpjcHVfaWQgPSBjcHVfaW5kZXg7CisgICAgcmV0dXJuIGZpbGVfaWQ7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqILmmxNzD6Mr2OiAgICAgcmFtZHVtcF93YWl0X2NsaWVudHNfZHVtcF9kb25lCisqILLOyv3LtcP3OiAgICAgCisqICAgKLSryOuyzsr9KSAgdm9pZAorKiAgICi0q7P2ss7K/SkgIHZvaWQKKyogt7Ugu9gg1rU6ICAgICB2b2lkCisqIMbky/zLtcP3OiAgICAgVGhpcyBmdW5jdGlvbiBpcyB1c2VkIGZvciByYW1kdW1wIGNsaWVudCBkdW1wIGRvbmUgY2hhcmdlCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RhdGljIHZvaWQgcmFtZHVtcF93YWl0X2NsaWVudHNfZHVtcF9kb25lKHZvaWQpCit7ICAgIAorICAgIHVuc2lnbmVkIGxvbmcgY3B1X2lkID0gMDsKKyAgICB3aGlsZSAoY3B1X2lkIDwgUkFNRFVNUF9DUFVfTUFYKQorICAgIHsKKyAgICAgICAgaWYgKHJhbWR1bXBfY29sbGVjdF9zZXJ2ZXJfcmFtX2NvbmYuYXJyYXlbY3B1X2lkXS5hcnJheSA9PSBOVUxMIHx8CisgICAgICAgICAgICByYW1kdW1wX2NvbGxlY3Rfc2VydmVyX3JhbV9jb25mLmFycmF5W2NwdV9pZF0ubnIgPT0gTlVMTCB8fAorICAgICAgICAgICAgcmFtZHVtcF9jb2xsZWN0X3NlcnZlcl9yYW1fY29uZi5hcnJheVtjcHVfaWRdLmRvbmVfZmxhZyA9PSBOVUxMKQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIHdoaWxlICgqKHJhbWR1bXBfY29sbGVjdF9zZXJ2ZXJfcmFtX2NvbmYuYXJyYXlbY3B1X2lkXS5kb25lX2ZsYWcpID09IFJBTURVTVBfU1lOQ19SRVNFVCkgCisgICAgICAgICAgICByYW1kdW1wX3dhaXRfZG9uZV9kZWxheSgKKyAgICAgICAgICAgICAgICBSQU1EVU1QX1dBSVRfVElNRUxFTiwgCisgICAgICAgICAgICAgICAgKHZvbGF0aWxlIHVuc2lnbmVkIGxvbmcgKikocmFtZHVtcF9jb2xsZWN0X3NlcnZlcl9yYW1fY29uZi5hcnJheVtjcHVfaWRdLmRvbmVfZmxhZyksCisgICAgICAgICAgICAgICAgUkFNRFVNUF9TWU5DX1JBTV9DT05URU5UX0RPTkUpOworICAgICAgICBjcHVfaWQrKzsKKyAgICB9Cit9CisjZW5kaWYgLy8jaWZuZGVmIF9fVVNFX1RSQU5TX1dJVEhfQ09MTEVDVF9fIAorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiC5psTcw+jK9jogICAgIHJhbWR1bXBfZG9fcGFuaWMKKyogss7K/cu1w/c6ICAgICAKKyogICAotKvI67LOyv0pICB2b2lkCisqICAgKLSrs/ayzsr9KSAgdm9pZAorKiC3tSC72CDWtTogICAgIHZvaWQKKyogxuTL/Mu1w/c6ICAgICBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgZm9yIHJhbWR1bXAgY2xpZW50IGljcCBtc2cgaGFuZGxlLCBkbyBwYW5pYworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3N0YXRpYyB2b2lkIHJhbWR1bXBfZG9fcGFuaWModm9pZCkKK3sKKyAgICBpZiAocmFtZHVtcF90cmFuc19zZXJ2ZXJfZm9yY2VfcGFuaWNfZmxhZyA9PSBSQU1EVU1QX0NMSUVOVF9aU1ApCisgICAgICAgIE9TU19QQU5JQygidHJhbnMgc2VydmVyIHJlY2VpdmVkIGZvcmNlZCBkdW1wIHJlcXVlc3QgZnJvbSB6c3AgY2xpZW50IVxuIik7CisgICAgZWxzZSBpZiAocmFtZHVtcF90cmFuc19zZXJ2ZXJfZm9yY2VfcGFuaWNfZmxhZyA9PSBSQU1EVU1QX0NMSUVOVF9DQVApCisgICAgICAgIE9TU19QQU5JQygidHJhbnMgc2VydmVyIHJlY2VpdmVkIGZvcmNlZCBkdW1wIHJlcXVlc3QgZnJvbSBjYXAgY2xpZW50IVxuIik7CisgICAgZWxzZQorICAgICAgICBPU1NfUEFOSUMoIkFQIHNlcnZlciByZWN2IGVycm9yIGljcCBtc2dcbiIpOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiC5psTcw+jK9jogICAgIHJhbWR1bXBfY2xpZW50c19pY3BfaGFuZGxlCisqILLOyv3LtcP3OiAgICAgCisqICAgKLSryOuyzsr9KSAgYnVmOiBpY3AgbXNnIGFkZHIKKyogICAgICAgICAgICAgICBsZW46IGljcCBtc2cgbGVuCisqICAgKLSrs/ayzsr9KSAgdm9pZAorKiC3tSC72CDWtTogICAgIHZvaWQKKyogxuTL/Mu1w/c6ICAgICBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgZm9yIHJhbWR1bXAgY2xpZW50IGljcCBtc2cgaGFuZGxlLCBjb21tb24gZW50cnkKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgdm9pZCByYW1kdW1wX2NsaWVudHNfaWNwX2hhbmRsZSh2b2lkICpidWYsIHVuc2lnbmVkIGludCBsZW4pCit7CisgICAgdW5zaWduZWQgbG9uZyB2aXJfYWRkciA9IDA7CisgICAgcmFtZHVtcF9tc2dfdCAqaWNwX21zZyA9IChyYW1kdW1wX21zZ190ICopYnVmOworICAgIHN3aXRjaChpY3BfbXNnLT5tc2dfaWQpCisgICAgeworI2lmbmRlZiBfX1VTRV9UUkFOU19XSVRIX0NPTExFQ1RfXyAKKyAgICAgICAgY2FzZSBSQU1EVU1QX01TR19JTklUX1JFUToKKyAgICAgICAgeworICAgICAgICAgICAgLyogdHJhbnMgcmFtIGNvbmYgc2VuZCB0byBjb2xsZWN0IHNlcnZlciAqLworICAgICAgICAgICAgcmFtZHVtcF9tc2dfdCBpY3BfbXNnX3RvX3NlcnZlciA9IHswfTsKKyAgICAgICAgICAgIGljcF9tc2dfdG9fc2VydmVyLm1zZ19pZCAgICAgICAgPSBSQU1EVU1QX01TR19JTklUX1JTUDsKKyAgICAgICAgICAgIGljcF9tc2dfdG9fc2VydmVyLmNwdV9pZCAgICAgICAgPSByYW1kdW1wX2NwdV9pZFtSQU1EVU1QX0NQVV8xXTsKKyAgICAgICAgICAgIGljcF9tc2dfdG9fc2VydmVyLm1zZ19kYXRhX3QucmFtX2NvbmZpZy5hcnJheSA9IAorICAgICAgICAgICAgICAgIE9TU19WSVJUX1RPX1BIWShyYW1kdW1wX3RyYW5zX3NlcnZlcl9yYW1fY29uZik7CisgICAgICAgICAgICBpY3BfbXNnX3RvX3NlcnZlci5tc2dfZGF0YV90LnJhbV9jb25maWcubnIgPSAKKyAgICAgICAgICAgICAgICBSQU1EVU1QX0FSUkFZX05SKHJhbWR1bXBfdHJhbnNfc2VydmVyX3JhbV9jb25mKTsKKyAgICAgICAgICAgIGljcF9tc2dfdG9fc2VydmVyLm1zZ19kYXRhX3QucmFtX2NvbmZpZy5kb25lX2ZsYWcgPSAKKyAgICAgICAgICAgICAgICBPU1NfVklSVF9UT19QSFkoKHVuc2lnbmVkIGxvbmcqKSZyYW1kdW1wX3RyYW5zX3NlcnZlcl9kYXRhX2RvbmVfZmxhZyk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIHJhbWR1bXBfb3NzX2ljcF9zZW5kKCZpY3BfbXNnX3RvX3NlcnZlciwgcmFtZHVtcF9jcHVfaWRbUkFNRFVNUF9DUFVfMF0pOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgY2FzZSBSQU1EVU1QX01TR19TWU5DOiAvKiBoYW5kbGUgY29sbGVjdCByYW0gY29uZiAqLworICAgICAgICB7CisgICAgICAgICAgICB1bnNpZ25lZCBsb25nIGFkZHIgPSBSQU1EVU1QX1NZTkNfUkVTRVQ7CisgICAgICAgICAgICBpZiAoaWNwX21zZy0+bXNnX2RhdGFfdC5yYW1fY29uZmlnX3N5bmMuYXJyYXkgPT0gTlVMTCB8fCAKKyAgICAgICAgICAgICAgICBpY3BfbXNnLT5tc2dfZGF0YV90LnJhbV9jb25maWdfc3luYy5uciA9PSAwKQorICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAvKiBtbWFwIGNvbGxlY3QgcmFtIGNvbmYgdGFibGUgc3BhY2UgKi8KKyAgICAgICAgICAgIHZpcl9hZGRyID0gKHVuc2lnbmVkIGxvbmcpT1NTX01NQVAoCisgICAgICAgICAgICAgICAgKHVuc2lnbmVkIGxvbmcpaWNwX21zZy0+bXNnX2RhdGFfdC5yYW1fY29uZmlnX3N5bmMuYXJyYXksCisgICAgICAgICAgICAgICAgKChpY3BfbXNnLT5tc2dfZGF0YV90LnJhbV9jb25maWdfc3luYy5ucikgKiBzaXplb2YocmFtZHVtcF9yYW1fY29uZmlnX21zZ190KSkpOworICAgICAgICAgICAgaWYgKHZpcl9hZGRyID09IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgT1NTX1BSSU5URigiW3JhbWR1bXBdIHRyYW5zIHNlcnZlciBtbWFwIGNvbGxlY3Qgc2VydmVyIHJhbSBjb25mIHRhYmxlIGZhaWxlZCFcbiIpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmFtZHVtcF9jb2xsZWN0X3NlcnZlcl9yYW1fY29uZi5hcnJheSA9IChyYW1kdW1wX3JhbV9jb25maWdfbXNnX3QgKil2aXJfYWRkcjsKKyAgICAgICAgICAgIHJhbWR1bXBfY29sbGVjdF9zZXJ2ZXJfcmFtX2NvbmYubnIgPSBpY3BfbXNnLT5tc2dfZGF0YV90LnJhbV9jb25maWdfc3luYy5ucjsKKworICAgICAgICAgICAgLyogbW1hcCBjb2xsZWN0IHJhbSBjb25mIHRhYmxlIGVudHJ5IHNwYWNlICovCisgICAgICAgICAgICByYW1kdW1wX3RyYW5zX3NlcnZlcl9yYW1fY29uZl90YWJsZV9tbWFwKAorICAgICAgICAgICAgICAgIHJhbWR1bXBfY29sbGVjdF9zZXJ2ZXJfcmFtX2NvbmYuYXJyYXksIAorICAgICAgICAgICAgICAgIHJhbWR1bXBfY29sbGVjdF9zZXJ2ZXJfcmFtX2NvbmYubnIpOworCisgICAgICAgICAgICAvKiB3YWl0IGlvcmVtYXAgd29yayAqLworICAgICAgICAgICAgcmFtZHVtcF93YWl0X2RvbmVfZGVsYXkoUkFNRFVNUF9XQUlUX1RJTUVMRU4sICZhZGRyLCBSQU1EVU1QX1NZTkNfUkFNX0NPTkZJR19ET05FKTsKKworICAgICAgICAgICAgLyogd2UgaGF2ZSB0byBtbWFwIGZpcnN0LHNvbWV0aW1lIGV4Y2VwdCBoYXBwZW5kIGluIGludGVycnVwdCAKKyAgICAgICAgICAgIGhhbmRsZXJzICwgdGhlbiB3ZSBjYW5gdCBtbWFwIC0gLSEgKi8KKyAgICAgICAgICAgIHJhbWR1bXBfZHVtcF9yYW1fY29uZl9tbWFwX2luaXQoKTsKKworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyNlbmRpZgorICAgICAgICBjYXNlIFJBTURVTVBfTVNHX0VYQ0VQVDoKKyAgICAgICAgeworICAgICAgICAgICAgcmFtZHVtcF9kb19wYW5pYygpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgeworICAgICAgICAgICAgcmFtZHVtcF9kb19wYW5pYygpOwkKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqILqvyv3D+7PGo7ogICByYW1kdW1wX2ljcF9tc2dfZnJvbV96c3AKKyAqILmmxNzD6Mr2o7ogICBzZXJ2ZXIgtKbA7XpzcLXESUNQz/vPorqvyv0KKyAqILLOyv3LtcP3o7oKKyogICAotKvI67LOyv0pICBwTXNnOiBpYyBtc2cgYnVmCisqICAgKLSrs/ayzsr9KSAgdm9pZAorICogt7Ugu9gg1rWjuiAgIHZvaWQgICAKKyAqIMbky/zLtcP3o7ogICB2b2lkCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3N0YXRpYyB2b2lkIHJhbWR1bXBfaWNwX21zZ19mcm9tX3pzcCh2b2lkICpidWYsIHVuc2lnbmVkIGludCBsZW4pCit7CisgICAgcmFtZHVtcF90cmFuc19zZXJ2ZXJfZm9yY2VfcGFuaWNfZmxhZyA9IFJBTURVTVBfQ0xJRU5UX1pTUDsKKworICAgIHJhbWR1bXBfY2xpZW50c19pY3BfaGFuZGxlKGJ1ZiwgbGVuKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiC6r8r9w/uzxqO6ICAgcmFtZHVtcF9pY3BfbXNnX2Zyb21fY2FwCisgKiC5psTcw+jK9qO6ICAgc2VydmVyILSmwO16c3C1xElDUM/7z6K6r8r9CisgKiCyzsr9y7XD96O6CisqICAgKLSryOuyzsr9KSAgcE1zZzogaWMgbXNnIGJ1ZgorKiAgICi0q7P2ss7K/SkgIHZvaWQKKyAqILe1ILvYINa1o7ogICB2b2lkICAgCisgKiDG5Mv8y7XD96O6ICAgdm9pZAorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgdm9pZCByYW1kdW1wX2ljcF9tc2dfZnJvbV9jYXAodm9pZCAqYnVmLCB1bnNpZ25lZCBpbnQgbGVuKQoreworICAgIHJhbWR1bXBfdHJhbnNfc2VydmVyX2ZvcmNlX3BhbmljX2ZsYWcgPSBSQU1EVU1QX0NMSUVOVF9DQVA7CisKKyAgICByYW1kdW1wX2NsaWVudHNfaWNwX2hhbmRsZShidWYsIGxlbik7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoguq/K/cP7s8ajuiAgIHJhbWR1bXBfaWNwX21zZ19mcm9tX20wCisgKiC5psTcw+jK9qO6ICAgc2VydmVyILSmwO16c3C1xElDUM/7z6K6r8r9CisgKiCyzsr9y7XD96O6CisqICAgKLSryOuyzsr9KSAgcE1zZzogaWMgbXNnIGJ1ZgorKiAgICi0q7P2ss7K/SkgIHZvaWQKKyAqILe1ILvYINa1o7ogICB2b2lkICAgCisgKiDG5Mv8y7XD96O6ICAgdm9pZAorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCit2b2lkIHJhbWR1bXBfaWNwX21zZ19mcm9tX20wKHZvaWQgKmJ1ZiwgaW50IGxlbikKK3sKKyAgICByYW1kdW1wX3RyYW5zX3NlcnZlcl9mb3JjZV9wYW5pY19mbGFnID0gUkFNRFVNUF9DTElFTlRfTTA7CisgICAgT1NTX1BBTklDKCJ0cmFucyBzZXJ2ZXIgcmVjZWl2ZWQgZm9yY2VkIGR1bXAgcmVxdWVzdCBmcm9tIE0wIGNsaWVudCFcbiIpOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiC5psTcw+jK9jogICAgIHJhbWR1bXBfaWNwX2luaXQKKyogss7K/cu1w/c6ICAgICAKKyogICAotKvI67LOyv0pICB2b2lkCisqICAgKLSrs/ayzsr9KSAgdm9pZAorKiC3tSC72CDWtTogICAgIHZvaWQKKyogxuTL/Mu1w/c6ICAgICBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgZm9yIHJhbWR1bXAgY2xpZW50IGljcCBpbml0CisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RhdGljIGludCByYW1kdW1wX2ljcF9pbml0KHZvaWQpCit7CisgICAgaW50IHJldCA9IDA7CisjaWZuZGVmIF9fVVNFX1RSQU5TX1dJVEhfQ09MTEVDVF9fIAorICAgIHJldCA9IHJhbWR1bXBfb3NzX2ljcF9jcmVhdGVfY2hhbm5lbC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sKKyNlbmRpZgorfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiC5psTcw+jK9jogICAgcmFtZHVtcF9zZXJ2ZXJfc3RvcmVfcmFtX2NvbmYKKyogss7K/cu1w/c6ICAgICAKKyogICAotKvI67LOyv0pIG1lbTogYWRkcgorKiAgICi0q7P2ss7K/Skgdm9pZCAKKyogt7Ugu9gg1rU6ICAgIHVuc2lnZW5kIGNoYXIqOiBjaGFuZ2VkIGFkZHIKKyogxuTL/Mu1w/c6ICAgIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCB0byBzdG9yZSByYW0gY29uZgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3N0YXRpYyB1bnNpZ25lZCBjaGFyICpyYW1kdW1wX3NlcnZlcl9zdG9yZV9yYW1fY29uZih1bnNpZ25lZCBjaGFyICptZW0pCit7CisgICAgdW5zaWduZWQgbG9uZyBpX3JhbV9jb25mID0gMDsKKyAgICB3aGlsZSAocmFtZHVtcF90cmFuc19zZXJ2ZXJfcmFtX2NvbmZbaV9yYW1fY29uZl0udmlyICE9IDAgJiYgCisgICAgICAgICAgIHJhbWR1bXBfdHJhbnNfc2VydmVyX3JhbV9jb25mW2lfcmFtX2NvbmZdLnNpemUgIT0gMCkKKyAgICB7CisgICAgICAgIHJhbWR1bXBfcmFtX2NvbmZpZ190ICpjb25maWdfZW50cnkgPSAmKHJhbWR1bXBfdHJhbnNfc2VydmVyX3JhbV9jb25mW2lfcmFtX2NvbmZdKTsKKyAgICAgICAgLyogc2Vzc2lvbiBjYW4gYmUgYWNjZXNzICovCisgICAgICAgIGlmIChjb25maWdfZW50cnktPmNhbGxiYWNrID09IE5VTEwgfHwKKyAgICAgICAgICAgIChjb25maWdfZW50cnktPmNhbGxiYWNrICE9IE5VTEwgJiYKKyAgICAgICAgICAgICgqKGNvbmZpZ19lbnRyeS0+Y2FsbGJhY2spKSgpID09IFJBTURVTVBfVFJVRSkpCisgICAgICAgICAgICBtZW0gKz0gc3ByaW50ZigKKyAgICAgICAgICAgICAgICAgICAgbWVtLCAKKyAgICAgICAgICAgICAgICAgICAgImRhdGEubG9hZC5iaW5hcnkgJnJhbWR1bXBfZGlyXFwlcyAweCV4LS0weCV4IC9ub2NsZWFyXG4iLAorICAgICAgICAgICAgICAgICAgICAoY29uZmlnX2VudHJ5LT5uYW1lKSwKKyAgICAgICAgICAgICAgICAgICAgKHVuc2lnbmVkIGludCljb25maWdfZW50cnktPnBoeSwgCisgICAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCBpbnQpKGNvbmZpZ19lbnRyeS0+cGh5ICsgY29uZmlnX2VudHJ5LT5zaXplKSk7CisgICAgICAgIGlfcmFtX2NvbmYrKzsKKyAgICB9CisKKyAgICByZXR1cm4gbWVtOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiC5psTcw+jK9jogICAgcmFtZHVtcF90cmFuc19zZXJ2ZXJfY21tX2NyZWF0ZQorKiCyzsr9y7XD9zogICAgIAorKiAgICi0q8jrss7K/Skgdm9pZAorKiAgICi0q7P2ss7K/Skgdm9pZAorKiC3tSC72CDWtTogICAgdm9pZAorKiDG5Mv8y7XD9zogICAgVGhpcyBmdW5jdGlvbiBpcyB1c2VkIGZvciBzZXJ2ZXIgdG8gZ2VuZXJhdGUgY21tIHNjcmlwdHMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgdm9pZCByYW1kdW1wX3RyYW5zX3NlcnZlcl9jbW1fY3JlYXRlKHZvaWQpCit7CisgICAgdW5zaWduZWQgY2hhciAqcGNtbV9idWYgP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WQgaW50KXJhbWR1bXBfc2VydmVyX2NtbV9idWYpOworICAgIGlmIChjbW1fYnVmX2xlbiA8PSBSQU1EVU1QX0NNTV9TSVpFKQorICAgICAgICByYW1kdW1wX3JhbV9jb25mX3RhYmxlX2FkZCgKKyAgICAgICAgICAgIGNtbV9uYW1lLAorICAgICAgICAgICAgKHVuc2lnbmVkIGxvbmcpT1NTX1ZJUlRfVE9fUEhZKHJhbWR1bXBfc2VydmVyX2NtbV9idWYpLCAKKyAgICAgICAgICAgIGNtbV9idWZfbGVuLCAKKyAgICAgICAgICAgICh1bnNpZ25lZCBsb25nKXJhbWR1bXBfc2VydmVyX2NtbV9idWYsCisgICAgICAgICAgICBSQU1EVU1QX0ZMQUdfTk9ORSwKKyAgICAgICAgICAgIDApOworICAgIGVsc2UKKyAgICAgICAgcmFtZHVtcF9yYW1fY29uZl90YWJsZV9hZGQoCisgICAgICAgICAgICBjbW1fbmFtZSwgCisgICAgICAgICAgICAodW5zaWduZWQgbG9uZylPU1NfVklSVF9UT19QSFkocmFtZHVtcF9zZXJ2ZXJfY21tX2J1ZiksIAorICAgICAgICAgICAgUkFNRFVNUF9DTU1fU0laRSwgCisgICAgICAgICAgICAodW5zaWduZWQgbG9uZylyYW1kdW1wX3NlcnZlcl9jbW1fYnVmLAorICAgICAgICAgICAgUkFNRFVNUF9GTEFHX05PTkUsCisgICAgICAgICAgICAwKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoguabE3MPoyvY6ICAgIHJhbWR1bXBfdHJhbnNfc2VydmVyX2Vycm9yX2xvZ19jcmVhdGUKKyogss7K/cu1w/c6ICAgICAKKyogICAotKvI67LOyv0pIHZvaWQKKyogICAotKuz9rLOyv0pIHZvaWQKKyogt7Ugu9gg1rU6ICAgIHZvaWQKKyogxuTL/Mu1w/c6ICAgIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCB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KKyogICAotKuz9rLOyv0pIHZvaWQKKyogt7Ugu9gg1rU6ICAgIHZvaWQgCisqIMbky/zLtcP3OiAgICBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgZm9yIHJhbWR1bXAgdG8gdHJhbnMgZHVtcCBkYXRhIHRvIFBDCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RhdGljIHZvaWQgcmFtZHVtcF9kYXRhX3RyYW5zZmVyX3RvX3BjKHZvaWQpCit7CisgICAgY2hhciByZXFfYnVmW1JBTURVTVBfSU5URVJBQ1RJVkVfREFUQV9MRU5dID0gezB9OworCisgICAgLyogaW50ZXJhY3RpdmUgYmVnaW4gKi8KKyAgICByYW1kdW1wX29zc19kYXRhX3RyYW5zX2luaXQoKTsKKworICAgIGZvcig7OykKKyAgICB7CisgICAgICAgIHJhbWR1bXBfb3NzX2RhdGFfdHJhbnNfcmVhZCgodW5zaWduZWQgY2hhciAqKXJlcV9idWYsIFJBTURVTVBfSU5URVJBQ1RJVkVfREFUQV9MRU4pOworICAgICAgICBzd2l0Y2ggKCoodW5zaWduZWQgbG9uZyAqKXJlcV9idWYpCisgICAgICAgIHsKKyAgICAgICAgY2FzZSBSQU1EVU1QX1BDX0lOVEVSQUNUSVZFX1JFUToKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICByYW1kdW1wX3RyYW5zX3NlcnZlcl9pbnRlcmFjdGl2ZV9yc3Agc2VydmVyX3RvX3BjX21zZyA9IHswfTsKKyAgICAgICAgICAgICAgICBzZXJ2ZXJfdG9fcGNfbXNnLmNtZCA9IFJBTURVTVBfVFJBTlNfU0VSVkVSX0lOVEVSQUNUSVZFX1JTUDsKKyAgICAgICAgICAgICAgICBzZXJ2ZXJfdG9fcGNfbXNnLmZpbGVfbnVtID0gcmFtZHVtcF9maWxlX251bTsKKworICAgICAgICAgICAgICAgIHJhbWR1bXBfb3NzX2RhdGFfdHJhbnNfd3JpdGUoCisgICAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCBjaGFyKikoJnNlcnZlcl90b19wY19tc2cpLAorICAgICAgICAgICAgICAgICAgICBzaXplb2Yoc2VydmVyX3RvX3BjX21zZykpOworCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIGNhc2UgUkFNRFVNUF9QQ19GSUxFX0lORk9fUkVBRF9SRVE6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcmFtZHVtcF90cmFuc19zZXJ2ZXJfZmlsZV9pbmZvX3JzcCBzZXJ2ZXJfdG9fcGNfbXNnID0gezB9OworICAgICAgICAgICAgICAgIC8qIGRhdGEgZnJvbSBwYyB0byBzZXJ2ZXIgICovCisgICAgICAgICAgICAgICAgcmFtZHVtcF9wY19maWxlX2luZm9fcmVxICpwY190b19zZXJ2ZXJfbXNnID0gKHJhbWR1bXBfcGNfZmlsZV9pbmZvX3JlcSAqKXJlcV9idWY7CisKKyAgICAgICAgICAgICAgICAvKiBkYXRhIHJlc3BvbmQgcGMgZnJvbSBzZXJ2ZXIgICovCisgICAgICAgICAgICAgICAgc2VydmVyX3RvX3BjX21zZy5jbWQgPSBSQU1EVU1QX1RSQU5TX1NFUlZFUl9GSUxFX0lORk9fUkVBRF9SU1A7CisgICAgICAgICAgICAgICAgc3RybmNweShzZXJ2ZXJfdG9fcGNfbXNnLmZpbGVfbmFtZSwgCisgICAgICAgICAgICAgICAgICAgICAgICByYW1kdW1wX3RyYW5zX3NlcnZlcl9yYW1fY29uZltwY190b19zZXJ2ZXJfbXNnLT5maWxlX2lkXS5uYW1lLCAKKyAgICAgICAgICAgICAgICAgICAgICAgIFJBTURVTVBfUkFNQ09ORl9GSUxFTkFNRV9NQVhMRU4gLSAxKTsKKwkJCQlzZXJ2ZXJfdG9fcGNfbXNnLmZpbGVfbmFtZVtSQU1EVU1QX1JBTUNPTkZfRklMRU5BTUVfTUFYTEVOIC0gMV0gPSAnXDAnOworICAgICAgICAgICAgICAgIHNlcnZlcl90b19wY19tc2cuZmlsZV9zaXplID0gcmFtZHVtcF90cmFuc19zZXJ2ZXJfcmFtX2NvbmZbcGNfdG9fc2VydmVyX21zZy0+ZmlsZV9pZF0uc2l6ZTsKKyAgICAgICAgICAgICAgICBpZiAocmFtZHVtcF90cmFuc19zZXJ2ZXJfcmFtX2NvbmZbcGNfdG9fc2VydmVyX21zZy0+ZmlsZV9pZF0uY2FsbGJhY2sgIT0gTlVMTCAmJgorICAgICAgICAgICAgICAgICAgICAocmFtZHVtcF90cmFuc19zZXJ2ZXJfcmFtX2NvbmZbcGNfdG9fc2VydmVyX21zZy0+ZmlsZV9pZF0uY2FsbGJhY2spKCkgPT0gUkFNRFVNUF9GQUxTRSkKKyAgICAgICAgICAgICAgICAgICAgc2VydmVyX3RvX3BjX21zZy5maWxlX3NpemUgPSAwOworICAgICAgICAgICAgICAgIC8qIGludGVyYWN0aXZlIGRhdGEgdHJhbnMgKi8KKyAgICAgICAgICAgICAgICByYW1kdW1wX29zc19kYXRhX3RyYW5zX3dyaXRlKAorICAgICAgICAgICAgICAgICAgICAodW5zaWduZWQgY2hhciopKCZzZXJ2ZXJfdG9fcGNfbXNnKSwgCisgICAgICAgICAgICAgICAgICAgIHNpemVvZihzZXJ2ZXJfdG9fcGNfbXNnKSk7CisKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgY2FzZSBSQU1EVU1QX1BDX0ZJTEVfREFUQV9UUkFOU19SRVE6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcmFtZHVtcF90cmFuc19zZXJ2ZXJfZGF0YV90cmFuc19yc3Agc2VydmVyX3RvX3BjX21zZyA9IHswfTsKKyAgICAgICAgICAgICAgICAvKiBkYXRhIGZyb20gcGMgdG8gc2VydmVyICAqLworICAgICAgICAgICAgICAgIHJhbWR1bXBfcGNfdHJhbnNfZGF0YV9yZXEgKnBjX3RvX3NlcnZlcl9tc2cgPSAocmFtZHVtcF9wY190cmFuc19kYXRhX3JlcSAqKXJlcV9idWY7CisKKyAgICAgICAgICAgICAgICAvKiBkYXRhIHJlc3BvbmQgcGMgZnJvbSBzZXJ2ZXIgICovCisgICAgICAgICAgICAgICAgc2VydmVyX3RvX3BjX21zZy5jbWQgPSBSQU1EVU1QX1RSQU5TX1NFUlZFUl9GSUxFX0RBVEFfVFJBTlNfUlNQOworICAgICAgICAgICAgICAgIHNlcnZlcl90b19wY19tc2cuYnVmX2FkZHIgPSAKKyAgICAgICAgICAgICAgICAgICAgKHJhbWR1bXBfdHJhbnNfc2VydmVyX3JhbV9jb25mW3BjX3RvX3NlcnZlcl9tc2ctPmZpbGVfaWRdLnZpciArIAorICAgICAgICAgICAgICAgICAgICBwY190b19zZXJ2ZXJfbXNnLT5vZmZzZXQpOworICAgICAgICAgICAgICAgIHNlcnZlcl90b19wY19tc2cuYnVmX2xlZnRfc2l6ZSA9IHBjX3RvX3NlcnZlcl9tc2ctPmxlbmd0aDsKKyAgICAgICAgICAgICAgICAvKiBpbnRlcmFjdGl2ZSBkYXRhIHRyYW5zICovCisgICAgICAgICAgICAgICAgLyogCisgICAgICAgICAgICAgICAgICogVE9ETyEKKyAgICAgICAgICAgICAgICAgKiBub3cgbXVsdGlwbGV4IG9sZCBpbnRlcmFjdGl2ZSBmbG93LgorICAgICAgICAgICAgICAgICAqIG5lZWQgdG8gYmUgb3B0aW1pemUsIHdyaXRlIG9uY2UgaXMgYmV0dGVyLgorICAgICAgICAgICAgICAgICAqIGxpa2UgdGhpcyByYW1kdW1wX29zc19kYXRhX3RyYW5zX3dyaXRlKCh1bnNpZ25lZCBjaGFyICopKCZzZXJ2ZXJfdG9fcGNfbXNnKSwgCisgICAgICAgICAgICAgICAgICogc2l6ZW9mKHNlcnZlcl90b19wY19tc2cpKTsKKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICByYW1kdW1wX29zc19kYXRhX3RyYW5zX3dyaXRlKAorICAgICAgICAgICAgICAgICAgICAodW5zaWduZWQgY2hhciAqKSgmKHNlcnZlcl90b19wY19tc2cuY21kKSksCisgICAgICAgICAgICAgICAgICAgIHNpemVvZihzZXJ2ZXJfdG9fcGNfbXNnLmNtZCkpOworICAgICAgICAgICAgICAgIHJhbWR1bXBfb3NzX2RhdGFfdHJhbnNfd3JpdGUoCisgICAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCBjaGFyICopKHNlcnZlcl90b19wY19tc2cuYnVmX2FkZHIpLCAKKyAgICAgICAgICAgICAgICAgICAgc2VydmVyX3RvX3BjX21zZy5idWZfbGVmdF9zaXplKTsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgY2FzZSBSQU1EVU1QX1BDX0ZJTEVfVFJBTlNfRE9ORV9SRVE6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdW5zaWduZWQgbG9uZyBmaW5pc2hfY21kID0gUkFNRFVNUF9UUkFOU19TRVJWRVJfRklMRV9UUkFOU19ET05FX1JTUDsKKyAgICAgICAgICAgICAgICAvKiBpbnRlcmFjdGl2ZSBkYXRhIHRyYW5zICovCisgICAgICAgICAgICAgICAgcmFtZHVtcF9vc3NfZGF0YV90cmFuc193cml0ZSgKKyAgICAgICAgICAgICAgICAgICAgKHVuc2lnbmVkIGNoYXIgKikoJmZpbmlzaF9jbWQpLCAKKyAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKGZpbmlzaF9jbWQpKTsKKyAgICAgICAgICAgICAgICByYW1kdW1wX29zc19kYXRhX3RyYW5zX2RvbmUoKTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdW5zaWduZWQgbG9uZyBlcnJvcl9jbWQgPSBSQU1EVU1QX0lOVEVSQUNUSVZFX0NNRF9FUlJPUjsKKyAgICAgICAgICAgICAgICAvKiBpbnRlcmFjdGl2ZSBkYXRhIHRyYW5zICovCisgICAgICAgICAgICAgICAgcmFtZHVtcF9vc3NfZGF0YV90cmFuc193cml0ZSgodW5zaWduZWQgY2hhciAqKSgmZXJyb3JfY21kKSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKGVycm9yX2NtZCkpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9IAorICAgIH0KK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoguabE3MPoyvY6ICAgIHJhbWR1bXBfY2xpZW50X2NvcHlfZGF0YQorKiCyzsr9y7XD9zogICAgIAorKiAgICi0q8jrss7K/Skgdm9pZAorKiAgICi0q7P2ss7K/Skgdm9pZAorKiC3tSC72CDWtTogICAgdm9pZAorKiDG5Mv8y7XD9zogICAgVGhpcyBmdW5jdGlvbiBpcyB1c2VkIHRvIGNyZWF0ZSBlcnIgbG9nIGZpbGUKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgdm9pZCByYW1kdW1wX3RyYW5zX2NvcHlfZGF0YSh2b2lkKQoreworICAgIHVuc2lnbmVkIGxvbmcgaV9yYW1fY29uZiA9IDA7CisKKyAgICB3aGlsZSAocmFtZHVtcF90cmFuc19zZXJ2ZXJfcmFtX2NvbmZbaV9yYW1fY29uZl0ucGh5ICE9IDAgJiYgCisgICAgICAgICAgIHJhbWR1bXBfdHJhbnNfc2VydmVyX3JhbV9jb25mW2lfcmFtX2NvbmZdLnNpemUgIT0gMCkKKyAgICB7CisgICAgICAgIGlmIChyYW1kdW1wX3RyYW5zX3NlcnZlcl9yYW1fY29uZltpX3JhbV9jb25mXS5mbGFnID09IFJBTURVTVBfRkxBR19ORUVEX0NPUFkgJiYKKyAgICAgICAgICAgIHJhbWR1bXBfdHJhbnNfc2VydmVyX3JhbV9jb25mW2lfcmFtX2NvbmZdLmNvcHkgIT0gMCAmJgorICAgICAgICAgICAocmFtZHVtcF90cmFuc19zZXJ2ZXJfcmFtX2NvbmZbaV9yYW1fY29uZl0ucGh5ICE9IAorICAgICAgICAgICByYW1kdW1wX3RyYW5zX3NlcnZlcl9yYW1fY29uZltpX3JhbV9jb25mXS5jb3B5KSkKKyAgICAgICAgICAgIG1lbWNweSgKKyAgICAgICAgICAgICAgICByYW1kdW1wX3RyYW5zX3NlcnZlcl9yYW1fY29uZltpX3JhbV9jb25mXS5jb3B5LAorICAgICAgICAgICAgICAgIHJhbWR1bXBfdHJhbnNfc2VydmVyX3JhbV9jb25mW2lfcmFtX2NvbmZdLnBoeSwKKyAgICAgICAgICAgICAgICByYW1kdW1wX3RyYW5zX3NlcnZlcl9yYW1fY29uZltpX3JhbV9jb25mXS5zaXplKTsKKyAgICAgICAgaV9yYW1fY29uZisrOworICAgIH0KK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIMirvta6r8r9yrXP1iAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiC5psTcw+jK9jogICAgIHJhbWR1bXBfcmFtX2NvbmZfdGFibGVfYWRkCisqILLOyv3LtcP3OiAgICAgCisqICAgKLSryOuyzsr9KSAgcmFtX25hbWU6ICAgIGR1bXAgcmFtIG5hbWUKKyAgICAgICAgICAgICAgICByYW1fc3RhcnQ6ICAgZHVtcCByYW0gc3RhcnQodmlydHVhbCBhZGRyKQorICAgICAgICAgICAgICAgIHJhbV9zaXplOiAgICBkdW1wIHJhbSBzaXplCisgICAgICAgICAgICAgICAgcmFtX3ZpcnQ6ICAgIGR1bXAgcmFtIHZpcnQgYWRkcgorICAgICAgICAgICAgICAgIHJhbV9mbGFnOiAgICBkdW1wIHJhbSBmbGFnKGNvcHkvZXh0ZXIvY2FsbGJhY2spCisgICAgICAgICAgICAgICAgcmFtX2V4dHJhOiAgIGR1bXAgcmFtIGV4dHJhIGFjY2VzcyBhZGRyCisqICAgKLSrs/ayzsr9KSAgdm9pZAorKiC3tSC72CDWtTogICAgIHZvaWQKKyogxuTL/Mu1w/c6ICAgICBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgdG8gYWRkIGR1bXAgcmFtIGNvbmYgaW50byBwdWJsaWMgdGFibGUKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCit2b2lkIHJhbWR1bXBfcmFtX2NvbmZfdGFibGVfYWRkKAorICAgICAgICBjaGFyICpyYW1fbmFtZSwgCisgICAgICAgIHVuc2lnbmVkIGxvbmcgcmFtX3BoeSwgCisgICAgICAgIHVuc2lnbmVkIGxvbmcgcmFtX3NpemUsIAorICAgICAgICB1bnNpZ25lZCBsb25nIHJhbV92aXJ0LAorICAgICAgICB1bnNpZ25lZCBsb25nIHJhbV9mbGFnLAorICAgICAgICB1bnNpZ25lZCBsb25nIHJhbV9leHRyYSkKK3sKKyAgICBzdGF0aWMgdW5zaWduZWQgaW50IGlfZW50cnkgID0gMDsKKwkKKyAgICBpZiAoKHJhbV9waHkgPT0gMCkgJiYgKHJhbV9zaXplID09IDApKQorICAgICAgICByZXR1cm47CisKKyAgICBtdXRleF9sb2NrKCZyYW1kdW1wX211dGV4KTsKKwkKKyAgIC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hOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgUkFNRFVNUF9GTEFHX0hBU19DQUxMQkFDSzoKKyAgICAgICAgICAgIHJhbWR1bXBfdHJhbnNfc2VydmVyX3JhbV9jb25mW2lfZW50cnldLmNhbGxiYWNrICA9IHJhbV9leHRyYTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgYnJlYWs7CisgICAgfQorICAgIAorICAgIGlmIChyYW1fcGh5ICE9IDAgJiYgcmFtX3NpemUgIT0gMCkKKyAgICAgICAgcmFtZHVtcF90cmFuc19zZXJ2ZXJfcmFtX2NvbmZbaV9lbnRyeV0udmlyID0gcmFtZHVtcF9waHlfdG9fdmlyKCZyYW1kdW1wX3RyYW5zX3NlcnZlcl9yYW1fY29uZltpX2VudHJ5XSk7CisgICAgCisJaV9lbnRyeSsrOworCQorICAgIGlmIChpX2VudHJ5ID49IFJBTURVTVBfUkFNQ09ORl9UQUJMRV9NQVhfRU5UUllTKSAgICAgIAorCQlpX2VudHJ5ID0gMDsKKworCXJhbWR1bXBfZmlsZV9udW0gKys7CisgICAgbXV0ZXhfdW5sb2NrKCZyYW1kdW1wX211dGV4KTsgCit9CitFWFBPUlRfU1lNQk9MKHJhbWR1bXBfcmFtX2NvbmZfdGFibGVfYWRkKTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoguabE3MPoyvY6ICAgICByYW1kdW1wX2luaXQKKyogss7K/cu1w/c6ICAgICAKKyogICAotKvI67LOyv0pICB2b2lkCisqICAgKLSrs/ayzsr9KSAgdm9pZAorKiC3tSC72CDWtTogICAgIFJBTURVTVBfU1VDQ0VTUyBvciBSQU1EVU1QX0ZBSUxFRAorKiDG5Mv8y7XD9zogICAgIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCBmb3IgcmFtZHVtcCBpbml0CisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RhdGljIGludCB0ZXN0X2Z1bih2b2lkKQoreworICAgIHJldHVybiBSQU1EVU1QX1RSVUU7Cit9CitpbnQgcmFtZHVtcF9pbml0KHZvaWQpCit7CisgICAgaWYgKHJhbWR1bXBfc2VydmVyX2luaXRfZmxhZyA9PSBSQU1EVU1QX1RSVUUpCisgICAgICAgIHJldHVybiBSQU1EVU1QX1NVQ0NFU1M7CisKKyAgICBpbnQgcmV0ID0gMDsKKwlpbnQgaSA9IDA7CisgICAgY2hhciBiaW5fbmFtZVtSQU1EVU1QX1JBTUNPTkZfRklMRU5BTUVfTUFYTEVOXSA9IHswfTsKKwkKKwlmb3IoaSA9IDA7aSA8IG1lbWluZm8ubnJfYmFua3M7aSsrKSB7CisJCWlmKG1lbWluZm8uYmFua1tpXS5zdGFydCA9PSBSQU1EVU1QX1NFUlZFUl9ERFJfQkFTRSkKKwkJCWRkcl9hcF9zaXplID0gbWVtaW5mby5iYW5rW2ldLnNpemU7CisJfQorCUJVR19PTihkZHJfYXBfc2l6ZSA9PSAwKTsKKworICAgIC8qIGNoYW5nZSB0aGUgaW50ZXJhY3RpdmUgY3B1IHZhbHVlICovCisJcmFtZHVtcF9jcHVfaWRbUkFNRFVNUF9DUFVfMl0gPSBJQ1BfTVNHX0FDVE9SX1pTUDsKKwkKKyAgICAvKiBjbGllbnQgaWNwIGluaXQgKi8KKyAgICByZXQgPSByYW1kdW1wX2ljcF9pbml0KCk7CisgICAgaWYgKHJldCAhPSBSQU1EVU1QX0lDUF9TVUNDRVNTKQorICAgICAgICByZXR1cm4gcmV0OworCisgICAgc3ByaW50ZigKKyAgICAgICAgYmluX25hbWUsIAorICAgICAgICAiJXMtJXMiLCAKKyAgICAgICAgcmFtZHVtcF9jcHVfbmFtZVtSQU1EVU1QX0NQVV8xXSwgCisgICAgICAgIFJBTURVTVBfVFJBTl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BfRkxBR19OT05FLAorCQkwKTsKKyNlbmRpZgorI2lmZGVmIF9VU0VfQ0FQX1NZUworCS8qIGNhcCByYW1kdW1wIGNtbSAqLworCXJhbWR1bXBfcmFtX2NvbmZfdGFibGVfYWRkKAorICAgICAgICAiY2FwX2RkciIsIAorICAgICAgICBERFJfQkFTRV9DQVBfQUREUl9QQSwgCisgICAgICAgIEREUl9CQVNFX0xFTl9DQVAsCisgICAgICAgIDAsCisgICAgICAgIFJBTURVTVBfRkxBR19OT05FLAorICAgICAgICAwKTsKKwlyYW1kdW1wX3JhbV9jb25mX3RhYmxlX2FkZCgKKyAgICAgICAgImNhcC5jbW0iLCAKKyAgICAgICAgUkFNRFVNUF9DQVBfQ01NX0JVRl9BRERSLAorICAgICAgICBSQU1EVU1QX0NBUF9DTU1fQlVGX0xFTiwKKyAgICAgICAgMCwKKyAgICAgICAgUkFNRFVNUF9GTEFHX05PTkUsCisgICAgICAgIDApOworI2VuZGlmCisgICAgLyogc2V0IHRyYW5zIHJhbSBkYXRhIGRvbmUgZmxhZyAqLworLy8gICAgcmFtZHVtcF90cmFuc19zZXJ2ZXJfZGF0YV9kb25lX2ZsYWcgPSBSQU1EVU1QX1NZTkNfUkFNX0NPTlRFTlRfRE9ORTsKKworICAgIE9TU19QUklOVEYoIlJhbWR1bXAgc2VydmVyIGluaXQgc3VjY2VzcyFcbiIpOworICAgIHJhbWR1bXBfc2VydmVyX2luaXRfZmxhZyA9IFJBTURVTVBfVFJVRTsKKworICAgIHJldHVybiBSQU1EVU1QX1NVQ0NFU1M7Cit9CisvL09TU19JTklUKHJhbWR1bXBfaW5pdCk7IAorRVhQT1JUX1NZTUJPTChyYW1kdW1wX2luaXQpOworZXh0ZXJuIHZvaWQgc2hvd19zdGFja19zdGF0ZSgpOworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiC5psTcw+jK9jogICAgIHJhbWR1bXBfaW5mbworKiCyzsr9y7XD9zogICAgIAorKiAgICi0q8jrss7K/SkgIHZvaWQKKyogICAotKuz9rLOyv0pICB2b2lkCisqILe1ILvYINa1OiAgICAgdm9pZAorKiDG5Mv8y7XD9zogICAgIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCBmb3IgcHJpbnQgcmFtZHVtcCBpbmZvCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwordm9pZCByYW1kdW1wX2luZm8odm9pZCkKK3sKKwlpZihDUFBTX0ZVTkMoY3Bwc19jYWxsYmFja3MsIHpPc3NfR2V0RXhjZXB0UmVzZXRGbGFnKSgpID09IDEpCisJCXByaW50ayhLRVJOX0VNRVJHICJSYW1kdW1wIGluZm86IFJhbWR1bXAgRXhjZXB0IFJlYm9vdCBlbmFibGVkIVxuIik7CisJZWxzZSBpZihDUFBTX0ZVTkMoY3Bwc19jYWxsYmFja3MsIHpPc3NfR2V0RXhjZXB0UmVzZXRGbGFnKSgpID09IDIpCisJCXByaW50ayhLRVJOX0VNRVJHICJSYW1kdW1wIGluZm86IFJhbWR1bXAgRXhjZXB0IFJlYm9vdCBhZnRlciBleHBvcnQhXG4iKTsKKwlpZiAoc3lzY3RsX3JhbWR1bXBfb25fcGFuaWMgPT0gRkFMU0UpCisJCXByaW50ayhLRVJOX0VNRVJHICJSYW1kdW1wIGluZm86IFJhbWR1bXAgZGlzYWJsZWQhXG4iKTsKKwlwcmludGsoS0VSTl9FTUVSRyAiUmFtZHVtcCBpbmZvOiBDdXJyZW50IFByb2Nlc3MgaXM6ICVzLCBwaWQgaXMgJWkhXG4iLCBjdXJyZW50LT5jb21tLCBjdXJyZW50LT5waWQpOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiC5psTcw+jK9jogICAgIHJhbWR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