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ZSBzZWNvbmQgYmVpbmcgdGhlIGNvbm5lY3Rpb24ncyBzb3VyY2UuIFZhbGlkIG5hbWVzIGZvciBzb3VyY2VzIGFuZAorICAgIHNpbmtzIGFyZSB0aGUgV004OTA0J3MgcGlucywgYW5kIHRoZSBqYWNrcyBvbiB0aGUgYm9hcmQ6CisKKyAgICBXTTg5MDQgcGluczoKKworICAgICogSU4xTAorICAgICogSU4xUgorICAgICogSU4yTAorICAgICogSU4yUgorICAgICogSU4zTAorICAgICogSU4zUgorICAgICogSFBPVVRMCisgICAgKiBIUE9VVFIKKyAgICAqIExJTkVPVVRMCisgICAgKiBMSU5FT1VUUgorICAgICogTUlDQklBUworCisgICAgQm9hcmQgY29ubmVjdG9yczoKKworICAgICogSGVhZHBob25lIEphY2sKKyAgICAqIExpbmUgSW4gSmFjaworICAgICogTWljCisKKyAgLSBhdG1lbCxzc2MtY29udHJvbGxlcjogVGhlIHBoYW5kbGUgb2YgdGhlIFNTQyBjb250cm9sbGVyCisgIC0gYXRtZWwsYXVkaW8tY29kZWM6IFRoZSBwaGFuZGxlIG9mIHRoZSBXTTg5MDQgYXVkaW8gY29kZWMKKworT3B0aW9uYWwgcHJvcGVydGllczoKKyAgLSBwaW5jdHJsLW5hbWVzLCBwaW5jdHJsLTA6IFBsZWFzZSByZWZlciB0byBwaW5jdHJsLWJpbmRpbmdzLnR4dAorCitFeGFtcGxlOgorc291bmQgeworCWNvbXBhdGlibGUgPSAiYXRtZWwsYXNvYy13bTg5MDQiOworCXBpbmN0cmwtbmFtZXMgPSAiZGVmYXVsdCI7CisJcGluY3RybC0wID0gPCZwaW5jdHJsX3BjazBfYXNfbWNrPjsKKworCWF0bWVsLG1vZGVsID0gIndtODkwNCBAIEFUOTFTQU05TjEyRUsiOworCisJYXRtZWwsYXVkaW8tcm91dGluZyA9CisJCSJIZWFkcGhvbmUgSmFjayIsICJIUE9VVEwiLAorCQkiSGVhZHBob25lIEphY2siLCAiSFBPVVRSIiwKKwkJIklOMkwiL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250cm9sbGVyCitjb25maWd1cmF0aW9uIGFuZCBtdXhpbmcgbG9naWMgY2FuIGJlIGNvbnN0cnVjdGVkIGluIHNldmVyYWwgd2F5cy4gSGVyZQorYXJlIHR3byBleGFtcGxlczoKKworKEEpCisgICAgICAgICAgICAgICAgICAgICAgIHBpbiBjb25maWcKKyAgICAgICAgICAgICAgICAgICAgICAgbG9naWMgcmVncworICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgKy0gU1BJCisgICAgIFBoeXNpY2FsIHBpbnMgLS0tIHBhZCAtLS0gcGlubXV4IC0rLSBJMkMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICstIG1tYworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgKy0gR1BJTworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG11bHRpcGxleAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZ2ljIHJlZ3MKKworSGVyZSBzb21lIGVsZWN0cmljYWwgcHJvcGVydGllcyBvZiB0aGUgcGluIGNhbiBiZSBjb25maWd1cmVkIG5vIG1hdHRlcgord2hldGhlciB0aGUgcGluIGlzIHVzZWQgZm9yIEdQSU8gb3Igbm90LiBJZiB5b3UgbXVsdGlwbGV4IGEgR1BJTyBvbnRvIGEKK3BpbiwgeW91IGNhbiBhbHNvIGRyaXZlIGl0IGhpZ2gvbG93IGZyb20gIkdQSU8iIHJlZ2lzdGVycy4KK0FsdGVybmF0aXZlbHksIHRoZSBwaW4gY2FuIGJlIGNvbnRyb2xsZWQgYnkgYSBjZXJ0YWluIHBlcmlwaGVyYWwsIHdoaWxlCitzdGlsbCBhcHBseWluZyBkZXNpcmVkIHBpbiBjb25maWcgcHJvcGVydGllcy4gR1BJTyBmdW5jdGlvbmFsaXR5IGlzIHRodXMKK29ydGhvZ29uYWwgdG8gYW55IG90aGVyIGRldmljZSB1c2luZyB0aGUgcGluLgorCitJbiB0aGlzIGFycmFuZ2VtZW50IHRoZSByZWdpc3RlcnMgZm9yIHRoZSBHUElPIHBvcnRpb25zIG9mIHRoZSBwaW4gY29udHJvbGxlciwKK29yIHRoZSByZWdpc3RlcnMgZm9yIHRoZSBHUElPIGhhcmR3YXJlIG1vZHVsZSBhcmUgbGlrZWx5IHRvIHJlc2lkZSBpbiBhCitzZXBhcmF0ZSBtZW1vcnkgcmFuZ2Ugb25seSBpbnRlbmRlZCBmb3IgR1BJTyBkcml2aW5nLCBhbmQgdGhlIHJlZ2lzdGVyCityYW5nZSBkZWFsaW5nIHdpdGggcGluIGNvbmZpZyBhbmQgcGluIG11bHRpcGxleGluZyBnZXQgcGxhY2VkIGludG8gYQorZGlmZmVyZW50IG1lbW9yeSByYW5nZSBhbmQgYSBzZXBhcmF0ZSBzZWN0aW9uIG9mIHRoZSBkYXRhIHNoZWV0LgorCisoQikKKworICAgICAgICAgICAgICAgICAgICAgICBwaW4gY29uZmlnCisgICAgICAgICAgICAgICAgICAgICAgIGxvZ2ljIHJlZ3MKKyAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICstIFNQSQorICAgICBQaHlzaWNhbCBwaW5zIC0tLSBwYWQgLS0tIHBpbm11eCAtKy0gSTJDCisgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgfCAgICAgICArLSBtbWMKKyAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICB8CisgICAgICAgICAgICAgICAgICAgICAgIEdQSU8gICAgcGluCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXVsdGlwbGV4CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9naWMgcmVncworCitJbiB0aGlzIGFycmFuZ2VtZW50LCB0aGUgR1BJTyBmdW5jdGlvbmFsaXR5IGNhbiBhbHdheXMgYmUgZW5hYmxlZCwgc3VjaCB0aGF0CitlLmcuIGEgR1BJTyBpbnB1dCBjYW4gYmUgdXNlZ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KworVGhlIGFyY2hpdGVjdHVyZSBvZiB2VFBNIGlzIGRlc2NyaWJlZCBiZWxvdzoKKworKy0tLS0tLS0tLS0tLS0tLS0tLSsKK3wgICAgTGludXggRG9tVSAgICB8IC4uLgorfCAgICAgICB8ICBeICAgICAgIHwKK3wgICAgICAgdiAgfCAgICAgICB8Cit8ICAgeGVuLXRwbWZyb250ICAgfAorKy0tLS0tLS0tLS0tLS0tLS0tLSsKKyAgICAgICAgfCAgXgorICAgICAgICB2ICB8CisrLS0tLS0tLS0tLS0tLS0tLS0tKworfCBtaW5pLW9zL3RwbWJhY2sgIHwKK3wgICAgICAgfCAgXiAgICAgICB8Cit8ICAgICAgIHYgIHwgICAgICAgfAorfCAgdnRwbS1zdHViZG9tICAgIHwgLi4uCit8ICAgICAgIHwgIF4gICAgICAgfAorfCAgICAgICB2ICB8ICAgICAgIHwKK3wgbWluaS1vcy90cG1mcm9udCB8CisrLS0tLS0tLS0tLS0tLS0tLS0tKworICAgICAgICB8ICBeCisgICAgICAgIHYgIHwKKystLS0tLS0tLS0tLS0tLS0tLS0rCit8IG1pbmktb3MvdHBtYmFjayAgfAorfCAgICAgICB8ICBeICAgICAgIHwKK3wgICAgICAgdiAgfCAgICAgICB8Cit8IHZ0cG1tZ3Itc3R1YmRvbSAgfAorfCAgICAgICB8ICBeICAgICAgIHwKK3wgICAgICAgdiAgfCAgICAgICB8Cit8IG1pbmktb3MvdHBtX3RpcyAgfAorKy0tLS0tLS0tLS0tLS0tLS0tLSsKKyAgICAgICAgfCAgXgorICAgICAgICB2ICB8CisrLS0tLS0tLS0tLS0tLS0tLS0tKworfCAgIEhhcmR3YXJlIFRQTSAgIHwKKystLS0tLS0tLS0tLS0tLS0tLS0rCisKKyAqIExpbnV4IERvbVU6IFRoZSBMaW51eCBiYXNlZCBndWVzdCB0aGF0IHdhbnRzIHRvIHVzZSBhIHZUUE0uIFRoZXJlIG1heSBiZQorCSAgICAgICBtb3JlIHRoYW4gb25lIG9mIHRoZXNl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RMUl9OQU1FICIuMCIsIHJ1bml0KTsKIAlvcmlvbl9jbGtkZXZfYWRkKE5VTEwsIE1WNjRYWFhfSTJDX0NUTFJfTkFNRSAiLjEiLCBydW5pdCk7CiAKQEAgLTU2MCw3ICs1NjAsNyBAQAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgKiBBdWRpbwogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdGF0aWMgc3RydWN0IHJlc291cmNlIGtpcmt3b29kX2kyc19yZXNvdXJjZXNbXSA9IHsKK3N0YXRpYyBzdHJ1Y3QgcmVzb3VyY2Uga2lya3dvb2RfYXVkaW9fcmVzb3VyY2VzW10gPSB7CiAJWzBdID0gewogCQkuc3RhcnQgID0gQVVESU9fUEhZU19CQVNFLAogCQkuZW5kICAgID0gQVVESU9fUEhZU19CQVNFICsgU1pfMTZLIC0gMSwKQEAgLTU3MywyOSArNTczLDIzIEBACiAJfSwKIH07CiAKLXN0YXRpYyBzdHJ1Y3Qga2lya3dvb2RfYXNvY19wbGF0Zm9ybV9kYXRhIGtpcmt3b29kX2kyc19kYXRhID0geworc3RhdGljIHN0cnVjdCBraXJrd29vZF9hc29jX3BsYXRmb3JtX2RhdGEga2lya3dvb2RfYXVkaW9fZGF0YSA9IHsKIAkuYnVyc3QgICAgICAgPSAxMjgsCiB9OwogCi1zdGF0aWMgc3RydWN0IHBsYXRmb3JtX2RldmljZSBraXJrd29vZF9pMnNfZGV2aWNlID0gewotCS5uYW1lCQk9ICJraXJrd29vZC1pMnMiLAorc3RhdGljIHN0cnVjdCBwbGF0Zm9ybV9kZXZpY2Uga2lya3dvb2RfYXVkaW9fZGV2aWNlID0geworCS5uYW1lCQk9ICJtdmVidS1hdWRpbyIsCiAJLmlkCQk9IC0xLAotCS5udW1fcmVzb3Vy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AgTE9OR19TICAgICAJJDgsICBQVF9SOChrMSkKLSAgICBMT05HX1MgICAgIAkkOSwgIFBUX1I5KGsxKQotICAgIExPTkdfUyAgICAgCSQxMCwgUFRfUjEwKGsxKQotICAgIExPTkdfUyAgICAgCSQxMSwgUFRfUjExKGsxKQotICAgIExPTkdfUyAgICAgCSQxMiwgUFRfUjEyKGsxKQotICAgIExPTkdfUyAgICAgCSQxMywgUFRfUjEzKGsxKQotICAgIExPTkdfUyAgICAgCSQxNCwgUFRfUjE0KGsxKQotICAgIExPTkdfUyAgICAgCSQxNSwgUFRfUjE1KGsxKQotICAgIExPTkdfUyAgICAgCSQxNiwgUFRfUjE2KGsxKQotICAgIExPTkdfUyAgICAgCSQxNywgUFRfUjE3KGsxKQotCi0gICAgTE9OR19TICAgICAJJDE4LCBQVF9SMTgoazEpCi0gICAgTE9OR19TICAgICAJJDE5LCBQVF9SMTkoazEpCi0gICAgTE9OR19TICAgICAJJDIwLCBQVF9SMjAoazEpCi0gICAgTE9OR19TICAgICAJJDIxLCBQVF9SMjEoazEpCi0gICAgTE9OR19TICAgICAJJDIyLCBQVF9SMjIoazEpCi0gICAgTE9OR19TICAgICAJJDIzLCBQVF9SMjMoazEpCi0gICAgTE9OR19TICAgICAJJDI0LCBQVF9SMjQoazEpCi0gICAgTE9OR19TICAgICAJJDI1LCBQVF9SMjUoazEpCisJTE9OR19TCSQxOCwgUFRfUjE4KGsxKQorCUxPTkdfUwkkMTksIFBUX1IxOShrMSkKKwlMT05HX1MJJDIwLCBQVF9SMjAoazEpCisJTE9OR19TCSQyMSwgUFRfUjIxKGsxKQorCUxPTkdfUwkkMjIsIFBUX1IyMihrMSkKKwlMT05HX1MJJDIzLCBQVF9SMjMoazEpCisJTE9OR19TCSQyNCwgUFRfUjI0KGsxKQorCUxPTkdfUwkkMjUsIFBUX1IyNShrMSkKIAogCS8qIFhYWEtZTUEgazAvazEgbm90IHNhdmVkLCBub3QgYmVpbmcgdXNlZCBpZiB3ZSBnb3Q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B3aXRoIGtzZWcwIEAgMHg0MDAwMDAwMCwga2VybmVsICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBhZGRyZXNzZXMgc2hpZnQgdG8gMHg4MDAwMDAwMCAqLwotICAgIGJsdHogICAgICAgIHQwLCAxZiAgICAgICAgICAgICAgICAgICAgICAgICAgLyogSWYga2VybmVsICovCi0JYWRkaXUgICAgICAgdDEsIGsxLCBWQ1BVX0dVRVNUX0tFUk5FTF9BU0lEICAvKiAoQkQpICAqLwotICAgIGFkZGl1ICAgICAgIHQxLCBrMSwgVkNQVV9HVUVTVF9VU0VSX0FTSUQgICAgLyogZWxzZSB1c2VyICovCisJLyogU2V0IHRoZSBBU0lEIGZvciB0aGUgR3Vlc3QgS2VybmVsICovCisJSU5UX1NMTAl0MCwgdDAsIDEJLyogd2l0aCBrc2VnMCBAIDB4NDAwMDAwMDAsIGtlcm5lbCAqLworCQkJCS8qIGFkZHJlc3NlcyBzaGlmdCB0byAweDgwMDAwMDAwICovCisJYmx0egl0MCwgMWYJCS8qIElmIGtlcm5lbCAqLworCSBJTlRfQURESVUgdDEsIGsxLCBWQ1BVX0dVRVNUX0tFUk5FTF9BU0lEICAvKiAoQkQpICAqLworCUlOVF9BRERJVSB0MSwgazEsIFZDUFVfR1VFU1RfVVNFUl9BU0lEICAgIC8qIGVsc2UgdXNlciAqLwogMToKLSAgICAvKiB0MTogY29udGFpbnMgdGhlIGJhc2Ugb2YgdGhlIEFTSUQgYXJyYXksIG5lZWQgdG8gZ2V0IHRoZSBjcHUgaWQgICovCi0gICAgTE9OR19MICAgICAgdDIsIFRJX0NQVSgkMjgpICAgICAgICAgICAgIC8qIHNtcF9wcm9jZXNzb3JfaWQgKi8KLSAgICBzbGwgICAgICAgICB0MiwgdDIsIDIgICAgICAgICAgICAgICAgICAgLyogeDQgKi8KLSAgICBhZGR1ICAgICAgICB0MywgdDEsIHQyCi0gICAgTE9OR19MICAgICAgazAsICh0M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MU1VfREVSQVRfTUlTUywgICAgICAgICAgICAgICAgICAweDNkMDVhKQorRVZFTlQoUE1fTVJLX1NUX0NNUEwsICAgICAgICAgICAgICAgICAgICAgICAgIDB4MTAwMzQpCitFVkVOVChQTV9ORVNUX1BBSVIzX0FERCwgICAgICAgICAgICAgICAgICAgICAgMHg0MDg4MSkKK0VWRU5UKFBNX0wyX1NUX0RJU1AsICAgICAgICAgICAgICAgICAgICAgICAgICAweDQ2MTgwKQorRVZFTlQoUE1fTDJfQ0FTVE9VVF9NT0QsICAgICAgICAgICAgICAgICAgICAgIDB4MTYxODApCitFVkVOVChQTV9JU0VHLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMjBhNCkKK0VWRU5UKFBNX01SS19JTlNUX1RJTUVPLCAgICAgICAgICAgICAgICAgICAgICAweDQwMDM0KQorRVZFTlQoUE1fTDJfUkNTVF9ESVNQX0ZBSUxfQUREUiwgICAgICAgICAgICAgIDB4MzYyODIpCitFVkVOVChQTV9MU1UxX0RDX1BSRUZfU1RSRUFNX0NPTkZJUk0sICAgICAgICAgMHgwZDBiNikKK0VWRU5UKFBNX0lFUkFUX1dSXzY0SywgICAgICAgICAgICAgICAgICAgICAgICAweDA0MGJlKQorRVZFTlQoUE1fTVJLX0RUTEJfTUlTU18xNk0sICAgICAgICAgICAgICAgICAgIDB4NGQwNWUpCitFVkVOVChQTV9JRVJBVF9NSVNTLCAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxMDBmNikKK0VWRU5UKFBNX01SS19QVEVHX0ZST01fTE1FTSwgICAgICAgICAgICAgICAgICAweDRkMDUyKQorRVZFTlQoUE1fRkxPUCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MTAwZjQpCitFVkVOVChQTV9USFJEX1BSSU9fNF81X0NZQywgICAgICAgICAgICAgICAgICAgMHgwNDBiNCkKK0VWRU5UKFBNX0JSX1BSRURfVEEsICAgICAgICAgICAgICAgICAgICAgICAgICAweDA0MGFhKQorRVZFTlQoUE1fQ01QTFVfU1RBTExfRlhVLCAgICAgICAgICAgICAgICAgICAgIDB4MjAwMTQpCitFVkVOVChQTV9FWFRfSU5ULCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgyMDBmOCkKK0VWRU5UKFBNX1ZTVV9GU1FSVF9GRElWLCAgICAgICAgICAgICAgICAgICAgICAweDBhODg4KQorRVZFTlQoUE1fTVJLX0xEX01JU1NfRVhQT1NFRF9DWUMsICAgICAgICAgICAgIDB4MTAwM2UpCitFVkVOVChQTV9MU1UxX0xERiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwYzA4NikKK0VWRU5UKFBNX0lDX1dSSVRFX0FMTCwgICAgICAgICAgICAgICAgICAgICAgICAweDA0ODhjKQorRVZFTlQoUE1fTFNVMF9TUlFfU1RGV0QsICAgICAgICAgICAgICAgICAgICAgIDB4MGMwYTApCitFVkVOVChQTV9QVEVHX0ZST01fUkwyTDNfTU9ELCAgICAgICAgICAgICAgICAgMHgxYzA1MikKK0VWRU5UKFBNX01SS19EQVRBX0ZST01fTDMxX1NIUiwgICAgICAgICAgICAgICAweDFkMDRlKQorRVZFTlQoUE1fREFUQV9GUk9NX0wyMV9NT0QsICAgICAgICAgICAgICAgICAgIDB4M2MwNDYpCitFVkVOVChQTV9WU1UxX1NDQUxfRE9VQkxFX0lTU1VFRCwgICAgICAgICAgICAgMHgwYjA4YSkKK0VWRU5UKFBNX1ZTVTBfOEZMT1AsICAgICAgICAgICAgICAgICAgICAgICAgICAweDBhMGEwKQorRVZFTlQoUE1fUE9XRVJfRVZFTlQxLCAgICAgICAgICAgICAgICAgICAgICAgIDB4MTAwNmUpCitFVkVOVChQTV9ESVNQX0NMQl9IRUxEX0JBTCwgICAgICAgICAgICAgICAgICAgMHgwMjA5MikKK0VWRU5UKFBNX1ZTVTFfMkZMT1AsICAgICAgICAgICAgICAgICAgICAgICAgICAweDBhMDlhKQorRVZFTlQoUE1fTFdTWU5DX0hFTEQsICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDIwOWEpCitFVkVOVChQTV9QVEVHX0ZST01fREwyTDNfU0hSLCAgICAgICAgICAgICAgICAgMHgzYzA1NCkKK0VWRU5UKFBNX0lOU1RfRlJPTV9MMjFfTU9ELCAgICAgICAgICAgICAgICAgICAweDM0MDQ2KQorRVZFTlQoUE1fSUVSQVRfWExBVEVfV1JfMTZNUExVUywgICAgICAgICAgICAgIDB4MDQwYmMpCitFVkVOVChQTV9JQ19SRVFfQUxMLCAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwNDg4OCkKK0VWRU5UKFBNX0RTTEJfTUlTUywgICAgICAgICAgICAgICAgICAgICAgICAgICAweDBkMDkwKQorRVZFTlQoUE1fTDNfTUlTUywgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MWYwODIpCitFVkVOVChQTV9MU1UwX0wxX1BSRUYsICAgICAgICAgICAgICAgICAgICAgICAgMHgwZDBiOCkKK0VWRU5UKFBNX1ZTVV9TQ0FMQVJfU0lOR0xFX0lTU1VFRCwgICAgICAgICAgICAweDBiODg0KQorRVZFTlQoUE1fTFNVMV9EQ19QUkVGX1NUUkVBTV9DT05GSVJNX1NUUklERSwgIDB4MGQwYmUpCitFVkVOVChQTV9MMl9JTlNULCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzNjA4MCkKK0VWRU5UKFBNX1ZTVTBfRlJTUCwgICAgICAgICAgICAgICAgICAgICAgICAgICAweDBhMGI0KQorRVZFTlQoUE1fRkxVU0hfRElTUCwgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDIwODIpCitFVkVOVChQTV9QVEVHX0ZST01fTDJNSVNTLCAgICAgICAgICAgICAgICAgICAgMHg0YzA1OCkKK0VWRU5UKFBNX1ZTVTFfRFFfSVNTVUVELCAgICAgICAgICAgICAgICAgICAgICAweDBiMDlhKQorRVZFTlQoUE1fQ01QTFVfU1RBTExfTFNVLCAgICAgICAgICAgICAgICAgICAgIDB4MjAwMTIpCitFVkVOVChQTV9NUktfREFUQV9GUk9NX0RNRU0sICAgICAgICAgICAgICAgICAgMHgxZDA0YSkKK0VWRU5UKFBNX0xTVV9GTFVTSF9VTEQsICAgICAgICAgICAgICAgICAgICAgICAweDBjOGIwKQorRVZFTlQoUE1fUFRFR19GUk9NX0xNRU0sICAgICAgICAgICAgICAgICAgICAgIDB4NGMwNTIpCitFVkVOVChQTV9NUktfREVSQVRfTUlTU18xNk0sICAgICAgICAgICAgICAgICAgMHgzZDA1YykKK0VWRU5UKFBNX1RIUkRfQUxMX1JVTl9DWUMsICAgICAgICAgICAgICAgICAgICAweDIwMDBjKQorRVZFTlQoUE1fTUVNMF9QUkVGRVRDSF9ESVNQLCAgICAgICAgICAgICAgICAgIDB4MjAwODMpCitFVkVOVChQTV9NUktfU1RBTExfQ01QTFVfQ1lDX0NPVU5ULCAgICAgICAgICAgMHgzMDAzZikKK0VWRU5UKFBNX0RBVEFfRlJPTV9ETDJMM19NT0QsICAgICAgICAgICAgICAgICAweDNjMDRjKQorRVZFTlQoUE1fVlNVX0ZSU1AsICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MGE4YjQpCitFVkVOVChQTV9NUktfREFUQV9GUk9NX0wyMV9NT0QsICAgICAgICAgICAgICAgMHgzZDA0NikKK0VWRU5UKFBNX1BNQzFfT1ZFUkZMT1csICAgICAgICAgICAgICAgICAgICAgICAweDIwMDEwKQorRVZFTlQoUE1fVlNVMF9TSU5HTEUsICAgICAgICAgICAgICAgICAgICAgICAgIDB4MGEwYTgpCitFVkVOVChQTV9NUktfUFRFR19GUk9NX0wzTUlTUywgICAgICAgICAgICAgICAgMHgyZDA1OCkKK0VWRU5UKFBNX01SS19QVEVHX0ZST01fTDMxX1NIUiwgICAgICAgICAgICAgICAweDJkMDU2KQorRVZFTlQoUE1fVlNVMF9WRUNUT1JfU1BfSVNTVUVELCAgICAgICAgICAgICAgIDB4MGIwOTApCitFVkVOVChQTV9WU1UxX0ZFU1QsICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwYTBiYSkKK0VWRU5UKFBNX01SS19JTlNUX0RJU1AsICAgICAgICAgICAgICAgICAgICAgICAweDIwMDMwKQorRVZFTlQoUE1fVlNVMF9DT01QTEVYX0lTU1VFRCwgICAgICAgICAgICAgICAgIDB4MGIwOTYpCitFVkVOVChQTV9MU1UxX0ZMVVNIX1VTVCwgICAgICAgICAgICAgICAgICAgICAgMHgwYzBiNikKK0VWRU5UKFBNX0lOU1RfQ01QTCwgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAyKQorRVZFTlQoUE1fRlhVX0lETEUsICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MTAwMGUpCitFVkVOVChQTV9MU1UwX0ZMVVNIX1VMRCwgICAgICAgICAgICAgICAgICAgICAgMHgwYzBiMCkKK0VWRU5UKFBNX01SS19EQVRBX0ZST01fREwyTDNfTU9ELCAgICAgICAgICAgICAweDNkMDRjKQorRVZFTlQoUE1fTFNVX0xNUV9TUlFfRU1QVFlfQUxMX0NZQywgICAgICAgICAgIDB4MzAwMWMpCitFVkVOVChQTV9MU1UxX1JFSkVDVF9MTVFfRlVMTCwgICAgICAgICAgICAgICAgMHgwYzBhNikKK0VWRU5UKFBNX0lOU1RfUFRFR19GUk9NX0wyMV9NT0QsICAgICAgICAgICAgICAweDNlMDU2KQorRVZFTlQoUE1fSU5TVF9GUk9NX1JMMkwzX01PRCwgICAgICAgICAgICAgICAgIDB4MTQwNDIpCitFVkVOVChQTV9TSExfQ1JFQVRFRCwgICAgICAgICAgICAgICAgICAgICAgICAgMHgwNTA4MikKK0VWRU5UKFBNX0wyX1NUX0hJVCwgICAgICAgICAgICAgICAgICAgICAgICAgICAweDQ2MTgyKQorRVZFTlQoUE1fREFUQV9GUk9NX0RNRU0sICAgICAgICAgICAgICAgICAgICAgIDB4MWMwNGEpCitFVkVOVChQTV9MM19MRF9NSVNTLCAgICAgICAgICAgICAgICAgICAgICAgICAgMHgyZjA4MikKK0VWRU5UKFBNX0ZYVTFfQlVTWV9GWFUwX0lETEUsICAgICAgICAgICAgICAgICAweDQwMDBlKQorRVZFTlQoUE1fRElTUF9DTEJfSEVMRF9SRVMsICAgICAgICAgICAgICAgICAgIDB4MDIwOTQpCitFVkVOVChQTV9MMl9TTl9TWF9JX0RPTkUsICAgICAgICAgICAgICAgICAgICAgMHgzNjM4MikKK0VWRU5UKFBNX0dSUF9DTVBMLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMDA0KQorRVZFTlQoUE1fU1RDWF9DTVBMLCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MGMwOTgpCitFVkVOVChQTV9WU1UwXzJGTE9QLCAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwYTA5OCkKK0VWRU5UKFBNX0wzX1BSRUZfTUlTUywgICAgICAgICAgICAgICAgICAgICAgICAweDNmMDgyKQorRVZFTlQoUE1fTFNVX1NSUV9TWU5DX0NZQywgICAgICAgICAgICAgICAgICAgIDB4MGQwOTYpCitFVkVOVChQTV9MU1VfUkVKRUNUX0VSQVRfTUlTUywgICAgICAgICAgICAgICAgMHgyMDA2NCkKK0VWRU5UKFBNX0wxX0lDQUNIRV9NSVNTLCAgICAgICAgICAgICAgICAgICAgICAweDIwMGZjKQorRVZFTlQoUE1fTFNVMV9GTFVTSF9TUlEsICAgICAgICAgICAgICAgICAgICAgIDB4MGMwYmUpCitFVkVOVChQTV9MRF9SRUZfTDFfTFNVMCwgICAgICAgICAgICAgICAgICAgICAgMHgwYzA4MCkKK0VWRU5UKFBNX1ZTVTBfRkVTVCwgICAgICAgICAgICAgICAgICAgICAgICAgICAweDBhMGI4KQorRVZFTlQoUE1fVlNVX1ZFQ1RPUl9TSU5HTEVfSVNTVUVELCAgICAgICAgICAgIDB4MGI4OTApCitFVkVOVChQTV9GUkVRX1VQLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg0MDAwYykKK0VWRU5UKFBNX0RBVEFfRlJPTV9MTUVNLCAgICAgICAgICAgICAgICAgICAgICAweDNjMDRhKQorRVZFTlQoUE1fTFNVMV9MRFgsICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MGMwOGEpCitFVkVOVChQTV9QTUMzX09WRVJGTE9XLCAgICAgICAgICAgICAgICAgICAgICAgMHg0MDAxMCkKK0VWRU5UKFBNX01SS19CUl9NUFJFRCwgICAgICAgICAgICAgICAgICAgICAgICAweDMwMDM2KQorRVZFTlQoUE1fU0hMX01BVENILCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDUwODYpCitFVkVOVChQTV9NUktfQlJfVEFLRU4sICAgICAgICAgICAgICAgICAgICAgICAgMHgxMDAzNikKK0VWRU5UKFBNX0NNUExVX1NUQUxMX0JSVSwgICAgICAgICAgICAgICAgICAgICAweDQwMDRlKQorRVZFTlQoUE1fSVNMQl9NSVNTLCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MGQwOTIpCitFVkVOVChQTV9DWUMsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAxZSkKK0VWRU5UKFBNX0RJU1BfSEVMRF9USEVSTUFMLCAgICAgICAgICAgICAgICAgICAweDMwMDA2KQorRVZFTlQoUE1fSU5TVF9QVEVHX0ZST01fUkwyTDNfU0hSLCAgICAgICAgICAgIDB4MmUwNTQpCitFVkVOVChQTV9MU1UxX1NSUV9TVEZXRCwgICAgICAgICAgICAgICAgICAgICAgMHgwYzBhMikKK0VWRU5UKFBNX0dDVF9OT1NMT1RfQlJfTVBSRUQsICAgICAgICAgICAgICAgICAweDQwMDFhKQorRVZFTlQoUE1fMVBMVVNfUFBDX0NNUEwsICAgICAgICAgICAgICAgICAgICAgIDB4MTAwZjIpCitFVkVOVChQTV9QVEVHX0ZST01fRE1FTSwgICAgICAgICAgICAgICAgICAgICAgMHgyYzA1MikKK0VWRU5UKFBNX1ZTVV8yRkxPUCwgICAgICAgICAgICAgICAgICAgICAgICAgICAweDBhODk4KQorRVZFTlQoUE1fR0NUX0ZVTExfQ1lDLCAgICAgICAgICAgICAgICAgICAgICAgIDB4MDQwODYpCitFVkVOVChQTV9NUktfREFUQV9GUk9NX0wzX0NZQywgICAgICAgICAgICAgICAgMHg0MDAyMCkKK0VWRU5UKFBNX0xTVV9TUlFfUzBfQUxMT0MsICAgICAgICAgICAgICAgICAgICAweDBkMDlkKQorRVZFTlQoUE1fTVJLX0RFUkFUX01JU1NfNEssICAgICAgICAgICAgICAgICAgIDB4MWQwNWMpCitFVkVOVChQTV9CUl9NUFJFRF9UQSwgICAgICAgICAgICAgICAgICAgICAgICAgMHgwNDBhZSkKK0VWRU5UKFBNX0lOU1RfUFRFR19GUk9NX0wyTUlTUywgICAgICAgICAgICAgICAweDRlMDU4KQorRVZFTlQoUE1fRFBVX0hFTERfUE9XRVIsICAgICAgICAgICAgICAgICAgICAgIDB4MjAwMDYpCitFVkVOVChQTV9SVU5fSU5TVF9DTVBMLCAgICAgICAgICAgICAgICAgICAgICAgMHg0MDBmYSkKK0VWRU5UKFBNX01SS19WU1VfRklOLCAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMDMyKQorRVZFTlQoUE1fTFNVX1NSUV9TMF9WQUxJRCwgICAgICAgICAgICAgICAgICAgIDB4MGQwOWMpCitFVkVOVChQTV9HQ1RfRU1QVFlfQ1lDLCAgICAgICAgICAgICAgICAgICAgICAgMHgyMDAwOCkKK0VWRU5UKFBNX0lPUFNfRElTUCwgICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMDE0KQorRVZFTlQoUE1fUlVOX1NQVVJSLCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MTAwMDgpCitFVkVOVChQTV9QVEVHX0ZST01fTDIxX01PRCwgICAgICAgICAgICAgICAgICAgMHgzYzA1NikKK0VWRU5UKFBNX1ZTVTBfMUZMT1AsICAgICAgICAgICAgICAgICAgICAgICAgICAweDBhMDgwKQorRVZFTlQoUE1fU05PT1BfVExCSUUsICAgICAgICAgICAgICAgICAgICAgICAgIDB4MGQwYjIpCitFVkVOVChQTV9EQVRBX0ZST01fTDNNSVNTLCAgICAgICAgICAgICAgICAgICAgMHgyYzA0OCkKK0VWRU5UKFBNX1ZTVV9TSU5HTEUsICAgICAgICAgICAgICAgICAgICAgICAgICAweDBhOGE4KQorRVZFTlQoUE1fRFRMQl9NSVNTXzE2RywgICAgICAgICAgICAgICAgICAgICAgIDB4MWMwNWUpCitFVkVOVChQTV9DTVBMVV9TVEFMTF9WRUNUT1IsICAgICAgICAgICAgICAgICAgMHgyMDAxYykKK0VWRU5UKFBNX0ZMVVNILCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDQwMGY4KQorRVZFTlQoUE1fTDJfTERfSElULCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzYxODIpCitFVkVOVChQTV9ORVNUX1BBSVIyX0FORCwgICAgICAgICAgICAgICAgICAgICAgMHgzMDg4MykKK0VWRU5UKFBNX1ZTVTFfMUZMT1AsICAgICAgICAgICAgICAgICAgICAgICAgICAweDBhMDgyKQorRVZFTlQoUE1fSUNfUFJFRl9SRVEsICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDQwOGEpCitFVkVOVChQTV9MM19MRF9ISVQsICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgyZjA4MCkKK0VWRU5UKFBNX0dDVF9OT1NMT1RfSUNfTUlTUywgICAgICAgICAgICAgICAgICAweDIwMDFhKQorRVZFTlQoUE1fRElTUF9IRUxELCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MTAwMDYpCitFVkVOVChQTV9MMl9MRCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxNjA4MCkKK0VWRU5UKFBNX0xTVV9GTFVTSF9TUlEsICAgICAgICAgICAgICAgICAgICAgICAweDBjOGJjKQorRVZFTlQoUE1fQkNfUExVU184X0NPTlYsICAgICAgICAgICAgICAgICAgICAgIDB4MDQwYjgpCitFVkVOVChQTV9NUktfREFUQV9GUk9NX0wzMV9NT0RfQ1lDLCAgICAgICAgICAgMHg0MDAyNikKK0VWRU5UKFBNX0NNUExVX1NUQUxMX1ZFQ1RPUl9MT05HLCAgICAgICAgICAgICAweDQwMDRhKQorRVZFTlQoUE1fTDJfUkNTVF9CVVNZX1JDX0ZVTEwsICAgICAgICAgICAgICAgIDB4MjYyODIpCitFVkVOVChQTV9UQl9CSVRfVFJBTlMsICAgICAgICAgICAgICAgICAgICAgICAgMHgzMDBmOCkKK0VWRU5UKFBNX1RIRVJNQUxfTUFYLCAgICAgICAgICAgICAgICAgICAgICAgICAweDQwMDA2KQorRVZFTlQoUE1fTFNVMV9GTFVTSF9VTEQsICAgICAgICAgICAgICAgICAgICAgIDB4MGMwYjIpCitFVkVOVChQTV9MU1UxX1JFSkVDVF9MSFMsICAgICAgICAgICAgICAgICAgICAgMHgwYzBhZSkKK0VWRU5UKFBNX0xTVV9MUlFfUzBfQUxMT0MsICAgICAgICAgICAgICAgICAgICAweDBkMDlmKQorRVZFTlQoUE1fTDNfQ09fTDMxLCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4NGYwODApCitFVkVOVChQTV9QT1dFUl9FVkVOVDQsICAgICAgICAgICAgICAgICAgICAgICAgMHg0MDA2ZSkKK0VWRU5UKFBNX0RBVEFfRlJPTV9MMzFfU0hSLCAgICAgICAgICAgICAgICAgICAweDFjMDRlKQorRVZFTlQoUE1fQlJfVU5DT05ELCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDQwOWUpCitFVkVOVChQTV9MU1UxX0RDX1BSRUZfU1RSRUFNX0FMTE9DLCAgICAgICAgICAgMHgwZDBhYSkKK0VWRU5UKFBNX1BNQzRfUkVXSU5ELCAgICAgICAgICAgICAgICAgICAgICAgICAweDEwMDIwKQorRVZFTlQoUE1fTDJfUkNMRF9ESVNQLCAgICAgICAgICAgICAgICAgICAgICAgIDB4MTYyODApCitFVkVOVChQTV9USFJEX1BSSU9fMl8zX0NZQywgICAgICAgICAgICAgICAgICAgMHgwNDBiMikKK0VWRU5UKFBNX01SS19QVEVHX0ZST01fTDJNSVNTLCAgICAgICAgICAgICAgICAweDRkMDU4KQorRVZFTlQoUE1fSUNfREVNQU5EX0wyX0JIVF9SRURJUkVDVCwgICAgICAgICAgIDB4MDQwOTgpCitFVkVOVChQTV9MU1VfREVSQVRfTUlTUywgICAgICAgICAgICAgICAgICAgICAgMHgyMDBmNikKK0VWRU5UKFBNX0lDX1BSRUZfQ0FOQ0VMX0wyLCAgICAgICAgICAgICAgICAgICAweDA0MDk0KQorRVZFTlQoUE1fTVJLX0ZJTl9TVEFMTF9DWUNfQ09VTlQsICAgICAgICAgICAgIDB4MTAwM2QpCitFVkVOVChQTV9CUl9QUkVEX0NDQUNIRSwgICAgICAgICAgICAgICAgICAgICAgMHgwNDBhMCkKK0VWRU5UKFBNX0dDVF9VVElMXzFfVE9fMl9TTE9UUywgICAgICAgICAgICAgICAweDAyMDljKQorRVZFTlQoUE1fTVJLX1NUX0NNUExfSU5ULCAgICAgICAgICAgICAgICAgICAgIDB4MzAwMzQpCitFVkVOVChQTV9MU1VfVFdPX1RBQkxFV0FMS19DWUMsICAgICAgICAgICAgICAgMHgwZDBhNikKK0VWRU5UKFBNX01SS19EQVRBX0ZST01fTDNNSVNTLCAgICAgICAgICAgICAgICAweDJkMDQ4KQorRVZFTlQoUE1fR0NUX05PU0xPVF9DWUMsICAgICAgICAgICAgICAgICAgICAgIDB4MTAwZjgpCitFVkVOVChQTV9MU1VfU0VUX01QUkVELCAgICAgICAgICAgICAgICAgICAgICAgMHgwYzBhOCkKK0VWRU5UKFBNX0ZMVVNIX0RJU1BfVExCSUUsICAgICAgICAgICAgICAgICAgICAweDAyMDhhKQorRVZFTlQoUE1fVlNVMV9GQ09OViwgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MGEwYjIpCitFVkVOVChQTV9ERVJBVF9NSVNTXzE2RywgICAgICAgICAgICAgICAgICAgICAgMHg0YzA1YykKK0VWRU5UKFBNX0lOU1RfRlJPTV9MTUVNLCAgICAgICAgICAgICAgICAgICAgICAweDM0MDRhKQorRVZFTlQoUE1fSUNfREVNQU5EX0wyX0JSX1JFRElSRUNULCAgICAgICAgICAgIDB4MDQwOWEpCitFVkVOVChQTV9DTVBMVV9TVEFMTF9TQ0FMQVJfTE9ORywgICAgICAgICAgICAgMHgyMDAxOCkKK0VWRU5UKFBNX0lOU1RfUFRFR19GUk9NX0wyLCAgICAgICAgICAgICAgICAgICAweDFlMDUwKQorRVZFTlQoUE1fUFRFR19GUk9NX0wyLCAgICAgICAgICAgICAgICAgICAgICAgIDB4MWMwNTApCitFVkVOVChQTV9NUktfREFUQV9GUk9NX0wyMV9TSFJfQ1lDLCAgICAgICAgICAgMHgyMDAyNCkKK0VWRU5UKFBNX01SS19EVExCX01JU1NfNEssICAgICAgICAgICAgICAgICAgICAweDJkMDVhKQorRVZFTlQoUE1fVlNVMF9GUFNDUiwgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MGIwOWMpCitFVkVOVChQTV9WU1UxX1ZFQ1RfRE9VQkxFX0lTU1VFRCwgICAgICAgICAgICAgMHgwYjA4MikKK0VWRU5UKFBNX01SS19QVEVHX0ZST01fUkwyTDNfTU9ELCAgICAgICAgICAgICAweDFkMDUyKQorRVZFTlQoUE1fTUVNMF9SUV9ESVNQLCAgICAgICAgICAgICAgICAgICAgICAgIDB4MTAwODMpCitFVkVOVChQTV9MMl9MRF9NSVNTLCAgICAgICAgICAgICAgICAgICAgICAgICAgMHgyNjA4MCkKK0VWRU5UKFBNX1ZNWF9SRVNVTFRfU0FUXzEsICAgICAgICAgICAgICAgICAgICAweDBiMGEwKQorRVZFTlQoUE1fTDFfUFJFRiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MGQ4YjgpCitFVkVOVChQTV9NUktfREFUQV9GUk9NX0xNRU1fQ1lDLCAgICAgICAgICAgICAgMHgyMDAyYykKK0VWRU5UKFBNX0dSUF9JQ19NSVNTX05PTlNQRUMsICAgICAgICAgICAgICAgICAweDEwMDBjKQorRVZFTlQoUE1fUEJfTk9ERV9QVU1QLCAgICAgICAgICAgICAgICAgICAgICAgIDB4MTAwODEpCitFVkVOVChQTV9TSExfTUVSR0VELCAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwNTA4NCkKK0VWRU5UKFBNX05FU1RfUEFJUjFfQURELCAgICAgICAgICAgICAgICAgICAgICAweDIwODgxKQorRVZFTlQoUE1fREFUQV9GUk9NX0wzLCAgICAgICAgICAgICAgICAgICAgICAgIDB4MWMwNDgpCitFVkVOVChQTV9MU1VfRkxVU0gsICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMjA4ZSkKK0VWRU5UKFBNX0xTVV9TUlFfU1lOQ19DT1VOVCwgICAgICAgICAgICAgICAgICAweDBkMDk3KQorRVZFTlQoUE1fUE1DMl9PVkVSRkxPVywgICAgICAgICAgICAgICAgICAgICAgIDB4MzAwMTApCitFVkVOVChQTV9MU1VfTERGLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwYzg4NCkKK0VWRU5UKFBNX1BPV0VSX0VWRU5UMywgICAgICAgICAgICAgICAgICAgICAgICAweDMwMDZlKQorRVZFTlQoUE1fRElTUF9XVCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzAwMDgpCitFVkVOVChQTV9DTVBMVV9TVEFMTF9SRUpFQ1QsICAgICAgICAgICAgICAgICAgMHg0MDAxNikKK0VWRU5UKFBNX0lDX0JBTktfQ09ORkxJQ1QsICAgICAgICAgICAgICAgICAgICAweDA0MDgyKQorRVZFTlQoUE1fQlJfTVBSRURfQ1JfVEEsICAgICAgICAgICAgICAgICAgICAgIDB4MDQ4YWUpCitFVkVOVChQTV9MMl9JTlNUX01JU1MsICAgICAgICAgICAgICAgICAgICAgICAgMHgzNjA4MikKK0VWRU5UKFBNX0NNUExVX1NUQUxMX0VSQVRfTUlTUywgICAgICAgICAgICAgICAweDQwMDE4KQorRVZFTlQoUE1fTkVTVF9QQUlSMl9BREQsICAgICAgICAgICAgICAgICAgICAgIDB4MzA4ODEpCitFVkVOVChQTV9NUktfTFNVX0ZMVVNILCAgICAgICAgICAgICAgICAgICAgICAgMHgwZDA4YykKK0VWRU5UKFBNX0wyX0xEU1QsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDE2ODgwKQorRVZFTlQoUE1fSU5TVF9GUk9NX0wzMV9TSFIsICAgICAgICAgICAgICAgICAgIDB4MTQwNGUpCitFVkVOVChQTV9WU1UwX0ZJTiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwYTBiYykKK0VWRU5UKFBNX0xBUlhfTFNVLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDBjODk0KQorRVZFTlQoUE1fSU5TVF9GUk9NX1JNRU0sICAgICAgICAgICAgICAgICAgICAgIDB4MzQwNDIpCitFVkVOVChQTV9ESVNQX0NMQl9IRUxEX1RMQklFLCAgICAgICAgICAgICAgICAgMHgwMjA5NikKK0VWRU5UKFBNX01SS19EQVRBX0ZST01fRE1FTV9DWUMsICAgICAgICAgICAgICAweDIwMDJlKQorRVZFTlQoUE1fQlJfUFJFRF9DUiwgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDQwYTgpCitFVkVOVChQTV9MU1VfUkVKRUNULCAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxMDA2NCkKK0VWRU5UKFBNX0dDVF9VVElMXzNfVE9fNl9TTE9UUywgICAgICAgICAgICAgICAweDAyMDllKQorRVZFTlQoUE1fQ01QTFVfU1RBTExfRU5EX0dDVF9OT1NMT1QsICAgICAgICAgIDB4MTAwMjgpCitFVkVOVChQTV9MU1UwX1JFSkVDVF9MTVFfRlVMTCwgICAgICAgICAgICAgICAgMHgwYzBhNCkKK0VWRU5UKFBNX1ZTVV9GRVNULCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDBhOGI4KQorRVZFTlQoUE1fTkVTVF9QQUlSMF9BTkQsICAgICAgICAgICAgICAgICAgICAgIDB4MTA4ODMpCitFVkVOVChQTV9QVEVHX0ZST01fTDMsICAgICAgICAgICAgICAgICAgICAgICAgMHgyYzA1MCkKK0VWRU5UKFBNX1BPV0VSX0VWRU5UMiwgICAgICAgICAgICAgICAgICAgICAgICAweDIwMDZlKQorRVZFTlQoUE1fSUNfUFJFRl9DQU5DRUxfUEFHRSwgICAgICAgICAgICAgICAgIDB4MDQwOTApCitFVkVOVChQTV9WU1UwX0ZTUVJUX0ZESVYsICAgICAgICAgICAgICAgICAgICAgMHgwYTA4OCkKK0VWRU5UKFBNX01SS19HUlBfQ01QTCwgICAgICAgICAgICAgICAgICAgICAgICAweDQwMDMwKQorRVZFTlQoUE1fVlNVMF9TQ0FMX0RPVUJMRV9JU1NVRUQsICAgICAgICAgICAgIDB4MGIwODgpCitFVkVOVChQTV9HUlBfRElTUCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMDAwYSkKK0VWRU5UKFBNX0xTVTBfTERYLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDBjMDg4KQorRVZFTlQoUE1fREFUQV9GUk9NX0wyLCAgICAgICAgICAgICAgICAgICAgICAgIDB4MWMwNDApCitFVkVOVChQTV9NUktfREFUQV9GUk9NX1JMMkwzX01PRCwgICAgICAgICAgICAgMHgxZDA0MikKK0VWRU5UKFBNX0xEX1JFRl9MMSwgICAgICAgICAgICAgICAgICAgICAgICAgICAweDBjODgwKQorRVZFTlQoUE1fVlNVMF9WRUNUX0RPVUJMRV9JU1NVRUQsICAgICAgICAgICAgIDB4MGIwODApCitFVkVOVChQTV9WU1UxXzJGTE9QX0RPVUJMRSwgICAgICAgICAgICAgICAgICAgMHgwYTA4ZSkKK0VWRU5UKFBNX1RIUkRfUFJJT182XzdfQ1lDLCAgICAgICAgICAgICAgICAgICAweDA0MGI2KQorRVZFTlQoUE1fQkNfUExVU184X1JTTFZfVEFLRU4sICAgICAgICAgICAgICAgIDB4MDQwYmEpCitFVkVOVChQTV9CUl9NUFJFRF9DUiwgICAgICAgICAgICAgICAgICAgICAgICAgMHgwNDBhYykKK0VWRU5UKFBNX0wzX0NPX01FTSwgICAgICAgICAgICAgICAgICAgICAgICAgICAweDRmMDgyKQorRVZFTlQoUE1fTERfTUlTU19MMSwgICAgICAgICAgICAgICAgICAgICAgICAgIDB4NDAwZjApCitFVkVOVChQTV9EQVRBX0ZST01fUkwyTDNfTU9ELCAgICAgICAgICAgICAgICAgMHgxYzA0MikKK0VWRU5UKFBNX0xTVV9TUlFfRlVMTF9DWUMsICAgICAgICAgICAgICAgICAgICAweDEwMDFhKQorRVZFTlQoUE1fVEFCTEVXQUxLX0NZQywgICAgICAgICAgICAgICAgICAgICAgIDB4MTAwMjYpCitFVkVOVChQTV9NUktfUFRFR19GUk9NX1JNRU0sICAgICAgICAgICAgICAgICAgMHgzZDA1MikKK0VWRU5UKFBNX0xTVV9TUlFfU1RGV0QsICAgICAgICAgICAgICAgICAgICAgICAweDBjOGEwKQorRVZFTlQoUE1fSU5TVF9QVEVHX0ZST01fUk1FTSwgICAgICAgICAgICAgICAgIDB4M2UwNTIpCitFVkVOVChQTV9GWFUwX0ZJTiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxMDAwNCkKK0VWRU5UKFBNX0xTVTFfTDFfU1dfUFJFRiwgICAgICAgICAgICAgICAgICAgICAweDBjMDllKQorRVZFTlQoUE1fUFRFR19GUk9NX0wzMV9NT0QsICAgICAgICAgICAgICAgICAgIDB4MWMwNTQpCitFVkVOVChQTV9QTUM1X09WRVJGTE9XLCAgICAgICAgICAgICAgICAgICAgICAgMHgxMDAyNCkKK0VWRU5UKFBNX0xEX1JFRl9MMV9MU1UxLCAgICAgICAgICAgICAgICAgICAgICAweDBjMDgyKQorRVZFTlQoUE1fSU5TVF9QVEVHX0ZST01fTDIxX1NIUiwgICAgICAgICAgICAgIDB4NGUwNTYpCitFVkVOVChQTV9DTVBMVV9TVEFMTF9USFJELCAgICAgICAgICAgICAgICAgICAgMHgxMDAxYykKK0VWRU5UKFBNX0RBVEFfRlJPTV9STUVNLCAgICAgICAgICAgICAgICAgICAgICAweDNjMDQyKQorRVZFTlQoUE1fVlNVMF9TQ0FMX1NJTkdMRV9JU1NVRUQsICAgICAgICAgICAgIDB4MGIwODQpCitFVkVOVChQTV9CUl9NUFJFRF9MU1RBQ0ssICAgICAgICAgICAgICAgICAgICAgMHgwNDBhNikKK0VWRU5UKFBNX01SS19EQVRBX0ZST01fUkwyTDNfTU9EX0NZQywgICAgICAgICAweDQwMDI4KQorRVZFTlQoUE1fTFNVMF9GTFVTSF9VU1QsICAgICAgICAgICAgICAgICAgICAgIDB4MGMwYjQpCitFVkVOVChQTV9MU1VfTkNTVCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwYzA5MCkKK0VWRU5UKFBNX0JSX1RBS0VOLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDIwMDA0KQorRVZFTlQoUE1fSU5TVF9QVEVHX0ZST01fTE1FTSwgICAgICAgICAgICAgICAgIDB4NGUwNTIpCitFVkVOVChQTV9HQ1RfTk9TTE9UX0JSX01QUkVEX0lDX01JU1MsICAgICAgICAgMHg0MDAxYykKK0VWRU5UKFBNX0RUTEJfTUlTU180SywgICAgICAgICAgICAgICAgICAgICAgICAweDJjMDVhKQorRVZFTlQoUE1fUE1DNF9TQVZFRCwgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzAwMjIpCitFVkVOVChQTV9WU1UxX1BFUk1VVEVfSVNTVUVELCAgICAgICAgICAgICAgICAgMHgwYjA5MikKK0VWRU5UKFBNX1NMQl9NSVNTLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDBkODkwKQorRVZFTlQoUE1fTFNVMV9GTFVTSF9MUlEsICAgICAgICAgICAgICAgICAgICAgIDB4MGMwYmEpCitFVkVOVChQTV9EVExCX01JU1MsICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMDBmYykKK0VWRU5UKFBNX1ZTVTFfRlJTUCwgICAgICAgICAgICAgICAgICAgICAgICAgICAweDBhMGI2KQorRVZFTlQoUE1fVlNVX1ZFQ1RPUl9ET1VCTEVfSVNTVUVELCAgICAgICAgICAgIDB4MGI4ODApCitFVkVOVChQTV9MMl9DQVNUT1VUX1NIUiwgICAgICAgICAgICAgICAgICAgICAgMHgxNjE4MikKK0VWRU5UKFBNX0RBVEFfRlJPTV9ETDJMM19TSFIsICAgICAgICAgICAgICAgICAweDNjMDQ0KQorRVZFTlQoUE1fVlNVMV9TVEYsICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MGIwOGUpCitFVkVOVChQTV9TVF9GSU4sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgyMDBmMCkKK0VWRU5UKFBNX1BURUdfRlJPTV9MMjFfU0hSLCAgICAgICAgICAgICAgICAgICAweDRjMDU2KQorRVZFTlQoUE1fTDJfTE9DX0dVRVNTX1dST05HLCAgICAgICAgICAgICAgICAgIDB4MjY0ODApCitFVkVOVChQTV9NUktfU1RDWF9GQUlMLCAgICAgICAgICAgICAgICAgICAgICAgMHgwZDA4ZSkKK0VWRU5UKFBNX0xTVTBfUkVKRUNUX0xIUywgICAgICAgICAgICAgICAgICAgICAweDBjMGFjKQorRVZFTlQoUE1fSUNfUFJFRl9DQU5DRUxfSElULCAgICAgICAgICAgICAgICAgIDB4MDQwOTIpCitFVkVOVChQTV9MM19QUkVGX0JVU1ksICAgICAgICAgICAgICAgICAgICAgICAgMHg0ZjA4MCkKK0VWRU5UKFBNX01SS19CUlVfRklOLCAgICAgICAgICAgICAgICAgICAgICAgICAweDIwMDNhKQorRVZFTlQoUE1fTFNVMV9OQ0xELCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MGMwOGUpCitFVkVOVChQTV9JTlNUX1BURUdfRlJPTV9MMzFfTU9ELCAgICAgICAgICAgICAgMHgxZTA1NCkKK0VWRU5UKFBNX0xTVV9OQ0xELCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDBjODhjKQorRVZFTlQoUE1fTFNVX0xEWCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MGM4ODgpCitFVkVOVChQTV9MMl9MT0NfR1VFU1NfQ09SUkVDVCwgICAgICAgICAgICAgICAgMHgxNjQ4MCkKK0VWRU5UKFBNX1RIUkVTSF9USU1FTywgICAgICAgICAgICAgICAgICAgICAgICAweDEwMDM4KQorRVZFTlQoUE1fTDNfUFJFRl9TVCwgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MGQwYWUpCitFVkVOVChQTV9ESVNQX0NMQl9IRUxEX1NZTkMsICAgICAgICAgICAgICAgICAgMHgwMjA5OCkKK0VWRU5UKFBNX1ZTVV9TSU1QTEVfSVNTVUVELCAgICAgICAgICAgICAgICAgICAweDBiODk0KQorRVZFTlQoUE1fVlNVMV9TSU5HTEUsICAgICAgICAgICAgICAgICAgICAgICAgIDB4MGEwYWEpCitFVkVOVChQTV9EQVRBX1RBQkxFV0FMS19DWUMsICAgICAgICAgICAgICAgICAgMHgzMDAxYSkKK0VWRU5UKFBNX0wyX1JDX1NUX0RPTkUsICAgICAgICAgICAgICAgICAgICAgICAweDM2MzgwKQorRVZFTlQoUE1fTVJLX1BURUdfRlJPTV9MMjFfTU9ELCAgICAgICAgICAgICAgIDB4M2QwNTYpCitFVkVOVChQTV9MQVJYX0xTVTEsICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwYzA5NikKK0VWRU5UKFBNX01SS19EQVRBX0ZST01fUk1FTSwgICAgICAgICAgICAgICAgICAweDNkMDQyKQorRVZFTlQoUE1fRElTUF9DTEJfSEVMRCwgICAgICAgICAgICAgICAgICAgICAgIDB4MDIwOTApCitFVkVOVChQTV9ERVJBVF9NSVNTXzRLLCAgICAgICAgICAgICAgICAgICAgICAgMHgxYzA1YykKK0VWRU5UKFBNX0wyX1JDTERfRElTUF9GQUlMX0FERFIsICAgICAgICAgICAgICAweDE2MjgyKQorRVZFTlQoUE1fU0VHX0VYQ0VQVElPTiwgICAgICAgICAgICAgICAgICAgICAgIDB4MDI4YTQpCitFVkVOVChQTV9GTFVTSF9ESVNQX1NCLCAgICAgICAgICAgICAgICAgICAgICAgMHgwMjA4YykKK0VWRU5UKFBNX0wyX0RDX0lOViwgICAgICAgICAgICAgICAgICAgICAgICAgICAweDI2MTgyKQorRVZFTlQoUE1fUFRFR19GUk9NX0RMMkwzX01PRCwgICAgICAgICAgICAgICAgIDB4NGMwNTQpCitFVkVOVChQTV9EU0VHLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMjBhNikKK0VWRU5UKFBNX0JSX1BSRURfTFNUQUNLLCAgICAgICAgICAgICAgICAgICAgICAweDA0MGEyKQorRVZFTlQoUE1fVlNVMF9TVEYsICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MGIwOGMpCitFVkVOVChQTV9MU1VfRlhfRklOLCAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxMDA2NikKK0VWRU5UKFBNX0RFUkFUX01JU1NfMTZNLCAgICAgICAgICAgICAgICAgICAgICAweDNjMDVjKQorRVZFTlQoUE1fTVJLX1BURUdfRlJPTV9ETDJMM19NT0QsICAgICAgICAgICAgIDB4NGQwNTQpCitFVkVOVChQTV9HQ1RfVVRJTF8xMV9QTFVTX1NMT1RTLCAgICAgICAgICAgICAgMHgwMjBhMikKK0VWRU5UKFBNX0lOU1RfRlJPTV9MMywgICAgICAgICAgICAgICAgICAgICAgICAweDE0MDQ4KQorRVZFTlQoUE1fTVJLX0lGVV9GSU4sICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzAwM2EpCitFVkVOVChQTV9JVExCX01JU1MsICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg0MDBmYykKK0VWRU5UKFBNX1ZTVV9TVEYsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDBiODhjKQorRVZFTlQoUE1fTFNVX0ZMVVNIX1VTVCwgICAgICAgICAgICAgICAgICAgICAgIDB4MGM4YjQpCitFVkVOVChQTV9MMl9MRFNUX01JU1MsICAgICAgICAgICAgICAgICAgICAgICAgMHgyNjg4MCkKK0VWRU5UKFBNX0ZYVTFfRklOLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDQwMDA0KQorRVZFTlQoUE1fU0hMX0RFQUxMT0NBVEVELCAgICAgICAgICAgICAgICAgICAgIDB4MDUwODApCitFVkVOVChQTV9MMl9TTl9NX1dSX0RPTkUsICAgICAgICAgICAgICAgICAgICAgMHg0NjM4MikKK0VWRU5UKFBNX0xTVV9SRUpFQ1RfU0VUX01QUkVELCAgICAgICAgICAgICAgICAweDBjOGE4KQorRVZFTlQoUE1fTDNfUFJFRl9MRCwgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MGQwYWMpCitFVkVOVChQTV9MMl9TTl9NX1JEX0RPTkUsICAgICAgICAgICAgICAgICAgICAgMHg0NjM4MCkKK0VWRU5UKFBNX01SS19ERVJBVF9NSVNTXzE2RywgICAgICAgICAgICAgICAgICAweDRkMDVjKQorRVZFTlQoUE1fVlNVX0ZDT05WLCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MGE4YjApCitFVkVOVChQTV9BTllfVEhSRF9SVU5fQ1lDLCAgICAgICAgICAgICAgICAgICAgMHgxMDBmYSkKK0VWRU5UKFBNX0xTVV9MTVFfRlVMTF9DWUMsICAgICAgICAgICAgICAgICAgICAweDBkMGE0KQorRVZFTlQoUE1fTVJLX0xTVV9SRUpFQ1RfTEhTLCAgICAgICAgICAgICAgICAgIDB4MGQwODIpCitFVkVOVChQTV9NUktfTERfTUlTU19MMV9DWUMsICAgICAgICAgICAgICAgICAgMHg0MDAzZSkKK0VWRU5UKFBNX01SS19EQVRBX0ZST01fTDJfQ1lDLCAgICAgICAgICAgICAgICAweDIwMDIwKQorRVZFTlQoUE1fSU5TVF9JTUNfTUFUQ0hfRElTUCwgICAgICAgICAgICAgICAgIDB4MzAwMTYpCitFVkVOVChQTV9NUktfREFUQV9GUk9NX1JNRU1fQ1lDLCAgICAgICAgICAgICAgMHg0MDAyYykKK0VWRU5UKFBNX1ZTVTBfU0lNUExFX0lTU1VFRCwgICAgICAgICAgICAgICAgICAweDBiMDk0KQorRVZFTlQoUE1fQ01QTFVfU1RBTExfRElWLCAgICAgICAgICAgICAgICAgICAgIDB4NDAwMTQpCitFVkVOVChQTV9NUktfUFRFR19GUk9NX1JMMkwzX1NIUiwgICAgICAgICAgICAgMHgyZDA1NCkKK0VWRU5UKFBNX1ZTVV9GTUFfRE9VQkxFLCAgICAgICAgICAgICAgICAgICAgICAweDBhODkwKQorRVZFTlQoUE1fVlNVXzRGTE9QLCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MGE4OWMpCitFVkVOVChQTV9WU1UxX0ZJTiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwYTBiZSkKK0VWRU5UKFBNX05FU1RfUEFJUjFfQU5ELCAgICAgICAgICAgICAgICAgICAgICAweDIwODgzKQorRVZFTlQoUE1fSU5TVF9QVEVHX0ZST01fUkwyTDNfTU9ELCAgICAgICAgICAgIDB4MWUwNTIpCitFVkVOVChQTV9SVU5fQ1lDLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgyMDBmNCkKK0VWRU5UKFBNX1BURUdfRlJPTV9STUVNLCAgICAgICAgICAgICAgICAgICAgICAweDNjMDUyKQorRVZFTlQoUE1fTFNVX0xSUV9TMF9WQUxJRCwgICAgICAgICAgICAgICAgICAgIDB4MGQwOWUpCitFVkVOVChQTV9MU1UwX0xERiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwYzA4NCkKK0VWRU5UKFBNX0ZMVVNIX0NPTVBMRVRJT04sICAgICAgICAgICAgICAgICAgICAweDMwMDEyKQorRVZFTlQoUE1fU1RfTUlTU19MMSwgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzAwZjApCitFVkVOVChQTV9MMl9OT0RFX1BVTVAsICAgICAgICAgICAgICAgICAgICAgICAgMHgzNjQ4MCkKK0VWRU5UKFBNX0lOU1RfRlJPTV9ETDJMM19TSFIsICAgICAgICAgICAgICAgICAweDM0MDQ0KQorRVZFTlQoUE1fTVJLX1NUQUxMX0NNUExVX0NZQywgICAgICAgICAgICAgICAgIDB4MzAwM2UpCitFVkVOVChQTV9WU1UxX0RFTk9STSwgICAgICAgICAgICAgICAgICAgICAgICAgMHgwYTBhZSkKK0VWRU5UKFBNX01SS19EQVRBX0ZST01fTDMxX1NIUl9DWUMsICAgICAgICAgICAweDIwMDI2KQorRVZFTlQoUE1fTkVTVF9QQUlSMF9BREQsICAgICAgICAgICAgICAgICAgICAgIDB4MTA4ODEpCitFVkVOVChQTV9JTlNUX0ZST01fTDNNSVNTLCAgICAgICAgICAgICAgICAgICAgMHgyNDA0OCkKK0VWRU5UKFBNX0VFX09GRl9FWFRfSU5ULCAgICAgICAgICAgICAgICAgICAgICAweDAyMDgwKQorRVZFTlQoUE1fSU5TVF9QVEVHX0ZST01fRE1FTSwgICAgICAgICAgICAgICAgIDB4MmUwNTIpCitFVkVOVChQTV9JTlNUX0ZST01fREwyTDNfTU9ELCAgICAgICAgICAgICAgICAgMHgzNDA0YykKK0VWRU5UKFBNX1BNQzZfT1ZFUkZMT1csICAgICAgICAgICAgICAgICAgICAgICAweDMwMDI0KQorRVZFTlQoUE1fVlNVXzJGTE9QX0RPVUJMRSwgICAgICAgICAgICAgICAgICAgIDB4MGE4OGMpCitFVkVOVChQTV9UTEJfTUlTUywgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgyMDA2NikKK0VWRU5UKFBNX0ZYVV9CVVNZLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDIwMDBlKQorRVZFTlQoUE1fTDJfUkNMRF9ESVNQX0ZBSUxfT1RIRVIsICAgICAgICAgICAgIDB4MjYyODApCitFVkVOVChQTV9MU1VfUkVKRUNUX0xNUV9GVUxMLCAgICAgICAgICAgICAgICAgMHgwYzhhNCkKK0VWRU5UKFBNX0lDX1JFTE9BRF9TSFIsICAgICAgICAgICAgICAgICAgICAgICAweDA0MDk2KQorRVZFTlQoUE1fR1JQX01SSywgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MTAwMzEpCitFVkVOVChQTV9NUktfU1RfTkVTVCwgICAgICAgICAgICAgICAgICAgICAgICAgMHgyMDAzNCkKK0VWRU5UKFBNX1ZTVTFfRlNRUlRfRkRJViwgICAgICAgICAgICAgICAgICAgICAweDBhMDhhKQorRVZFTlQoUE1fTFNVMF9GTFVTSF9MUlEsICAgICAgICAgICAgICAgICAgICAgIDB4MGMwYjgpCitFVkVOVChQTV9MQVJYX0xTVTAsICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwYzA5NCkKK0VWRU5UKFBNX0lCVUZfRlVMTF9DWUMsICAgICAgICAgICAgICAgICAgICAgICAweDA0MDg0KQorRVZFTlQoUE1fTVJLX0RBVEFfRlJPTV9ETDJMM19TSFJfQ1lDLCAgICAgICAgIDB4MjAwMmEpCitFVkVOVChQTV9MU1VfRENfUFJFRl9TVFJFQU1fQUxMT0MsICAgICAgICAgICAgMHgwZDhhOCkKK0VWRU5UKFBNX0dSUF9NUktfQ1lDLCAgICAgICAgICAgICAgICAgICAgICAgICAweDEwMDMwKQorRVZFTlQoUE1fTVJLX0RBVEFfRlJPTV9STDJMM19TSFJfQ1lDLCAgICAgICAgIDB4MjAwMjgpCitFVkVOVChQTV9MMl9HTE9CX0dVRVNTX0NPUlJFQ1QsICAgICAgICAgICAgICAgMHgxNjQ4MikKK0VWRU5UKFBNX0xTVV9SRUpFQ1RfTEhTLCAgICAgICAgICAgICAgICAgICAgICAweDBjOGFjKQorRVZFTlQoUE1fTVJLX0RBVEFfRlJPTV9MTUVNLCAgICAgICAgICAgICAgICAgIDB4M2QwNGEpCitFVkVOVChQTV9JTlNUX1BURUdfRlJPTV9MMywgICAgICAgICAgICAgICAgICAgMHgyZTA1MCkKK0VWRU5UKFBNX0ZSRVFfRE9XTiwgICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMDBjKQorRVZFTlQoUE1fUEJfUkVUUllfTk9ERV9QVU1QLCAgICAgICAgICAgICAgICAgIDB4MzAwODEpCitFVkVOVChQTV9JTlNUX0ZST01fUkwyTDNfU0hSLCAgICAgICAgICAgICAgICAgMHgxNDA0YykKK0VWRU5UKFBNX01SS19JTlNUX0lTU1VFRCwgICAgICAgICAgICAgICAgICAgICAweDEwMDMyKQorRVZFTlQoUE1fUFRFR19GUk9NX0wzTUlTUywgICAgICAgICAgICAgICAgICAgIDB4MmMwNTgpCitFVkVOVChQTV9SVU5fUFVSUiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg0MDBmNCkKK0VWRU5UKFBNX01SS19HUlBfSUNfTUlTUywgICAgICAgICAgICAgICAgICAgICAweDQwMDM4KQorRVZFTlQoUE1fTVJLX0RBVEFfRlJPTV9MMywgICAgICAgICAgICAgICAgICAgIDB4MWQwNDgpCitFVkVOVChQTV9DTVBMVV9TVEFMTF9EQ0FDSEVfTUlTUywgICAgICAgICAgICAgMHgyMDAxNikKK0VWRU5UKFBNX1BURUdfRlJPTV9STDJMM19TSFIsICAgICAgICAgICAgICAgICAweDJjMDU0KQorRVZFTlQoUE1fTFNVX0ZMVVNIX0xSUSwgICAgICAgICAgICAgICAgICAgICAgIDB4MGM4YjgpCitFVkVOVChQTV9NUktfREVSQVRfTUlTU182NEssICAgICAgICAgICAgICAgICAgMHgyZDA1YykKK0VWRU5UKFBNX0lOU1RfUFRFR19GUk9NX0RMMkwzX01PRCwgICAgICAgICAgICAweDRlMDU0KQorRVZFTlQoUE1fTDJfU1RfTUlTUywgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MjYwODIpCitFVkVOVChQTV9NUktfUFRFR19GUk9NX0wyMV9TSFIsICAgICAgICAgICAgICAgMHg0ZDA1NikKK0VWRU5UKFBNX0xXU1lOQywgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDBkMDk0KQorRVZFTlQoUE1fTFNVMF9EQ19QUkVGX1NUUkVBTV9DT05GSVJNX1NUUklERSwgIDB4MGQwYmMpCitFVkVOVChQTV9NUktfTFNVX0ZMVVNIX0xSUSwgICAgICAgICAgICAgICAgICAgMHgwZDA4OCkKK0VWRU5UKFBNX0lOU1RfSU1DX01BVENIX0NNUEwsICAgICAgICAgICAgICAgICAweDEwMGYwKQorRVZFTlQoUE1fTkVTVF9QQUlSM19BTkQsICAgICAgICAgICAgICAgICAgICAgIDB4NDA4ODMpCitFVkVOVChQTV9QQl9SRVRSWV9TWVNfUFVNUCwgICAgICAgICAgICAgICAgICAgMHg0MDA4MSkKK0VWRU5UKFBNX01SS19JTlNUX0ZJTiwgICAgICAgICAgICAgICAgICAgICAgICAweDMwMDMwKQorRVZFTlQoUE1fTVJLX1BURUdfRlJPTV9ETDJMM19TSFIsICAgICAgICAgICAgIDB4M2QwNTQpCitFVkVOVChQTV9JTlNUX0ZST01fTDMxX01PRCwgICAgICAgICAgICAgICAgICAgMHgxNDA0NCkKK0VWRU5UKFBNX01SS19EVExCX01JU1NfNjRLLCAgICAgICAgICAgICAgICAgICAweDNkMDVlKQorRVZFTlQoUE1fTFNVX0ZJTiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzAwNjYpCitFVkVOVChQTV9NUktfTFNVX1JFSkVDVCwgICAgICAgICAgICAgICAgICAgICAgMHg0MDA2NCkKK0VWRU5UKFBNX0wyX0NPX0ZBSUxfQlVTWSwgICAgICAgICAgICAgICAgICAgICAweDE2MzgyKQorRVZFTlQoUE1fTUVNMF9XUV9ESVNQLCAgICAgICAgICAgICAgICAgICAgICAgIDB4NDAwODMpCitFVkVOVChQTV9EQVRBX0ZST01fTDMxX01PRCwgICAgICAgICAgICAgICAgICAgMHgxYzA0NCkKK0VWRU5UKFBNX1RIRVJNQUxfV0FSTiwgICAgICAgICAgICAgICAgICAgICAgICAweDEwMDE2KQorRVZFTlQoUE1fVlNVMF80RkxPUCwgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MGEwOWMpCitFVkVOVChQTV9CUl9NUFJFRF9DQ0FDSEUsICAgICAgICAgICAgICAgICAgICAgMHgwNDBhNCkKK0VWRU5UKFBNX0NNUExVX1NUQUxMX0lGVSwgICAgICAgICAgICAgICAgICAgICAweDQwMDRjKQorRVZFTlQoUE1fTDFfREVNQU5EX1dSSVRFLCAgICAgICAgICAgICAgICAgICAgIDB4MDQwOGMpCitFVkVOVChQTV9GTFVTSF9CUl9NUFJFRCwgICAgICAgICAgICAgICAgICAgICAgMHgwMjA4NCkKK0VWRU5UKFBNX01SS19EVExCX01JU1NfMTZHLCAgICAgICAgICAgICAgICAgICAweDFkMDVlKQorRVZFTlQoUE1fTVJLX1BURUdfRlJPTV9ETUVNLCAgICAgICAgICAgICAgICAgIDB4MmQwNTIpCitFVkVOVChQTV9MMl9SQ1NUX0RJU1AsICAgICAgICAgICAgICAgICAgICAgICAgMHgzNjI4MCkKK0VWRU5UKFBNX0NNUExVX1NUQUxMLCAgICAgICAgICAgICAgICAgICAgICAgICAweDQwMDBhKQorRVZFTlQoUE1fTFNVX1BBUlRJQUxfQ0RGLCAgICAgICAgICAgICAgICAgICAgIDB4MGMwYWEpCitFVkVOVChQTV9ESVNQX0NMQl9IRUxEX1NCLCAgICAgICAgICAgICAgICAgICAgMHgwMjBhOCkKK0VWRU5UKFBNX1ZTVTBfRk1BX0RPVUJMRSwgICAgICAgICAgICAgICAgICAgICAweDBhMDkwKQorRVZFTlQoUE1fRlhVMF9CVVNZX0ZYVTFfSURMRSwgICAgICAgICAgICAgICAgIDB4MzAwMGUpCitFVkVOVChQTV9JQ19ERU1BTkRfQ1lDLCAgICAgICAgICAgICAgICAgICAgICAgMHgxMDAxOCkKK0VWRU5UKFBNX01SS19EQVRBX0ZST01fTDIxX1NIUiwgICAgICAgICAgICAgICAweDNkMDRlKQorRVZFTlQoUE1fTVJLX0xTVV9GTFVTSF9VU1QsICAgICAgICAgICAgICAgICAgIDB4MGQwODYpCitFVkVOVChQTV9JTlNUX1BURUdfRlJPTV9MM01JU1MsICAgICAgICAgICAgICAgMHgyZTA1OCkKK0VWRU5UKFBNX1ZTVV9ERU5PUk0sICAgICAgICAgICAgICAgICAgICAgICAgICAweDBhOGFjKQorRVZFTlQoUE1fTVJLX0xTVV9QQVJUSUFMX0NERiwgICAgICAgICAgICAgICAgIDB4MGQwODApCitFVkVOVChQTV9JTlNUX0ZST01fTDIxX1NIUiwgICAgICAgICAgICAgICAgICAgMHgzNDA0ZSkKK0VWRU5UKFBNX0lDX1BSRUZfV1JJVEUsICAgICAgICAgICAgICAgICAgICAgICAweDA0MDhlKQorRVZFTlQoUE1fQlJfUFJFRCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDQwOWMpCitFVkVOVChQTV9JTlNUX0ZST01fRE1FTSwgICAgICAgICAgICAgICAgICAgICAgMHgxNDA0YSkKK0VWRU5UKFBNX0lDX1BSRUZfQ0FOQ0VMX0FMTCwgICAgICAgICAgICAgICAgICAweDA0ODkwKQorRVZFTlQoUE1fTFNVX0RDX1BSRUZfU1RSRUFNX0NPTkZJUk0sICAgICAgICAgIDB4MGQ4YjQpCitFVkVOVChQTV9NUktfTFNVX0ZMVVNIX1NSUSwgICAgICAgICAgICAgICAgICAgMHgwZDA4YSkKK0VWRU5UKFBNX01SS19GSU5fU1RBTExfQ1lDLCAgICAgICAgICAgICAgICAgICAweDEwMDNjKQorRVZFTlQoUE1fTDJfUkNTVF9ESVNQX0ZBSUxfT1RIRVIsICAgICAgICAgICAgIDB4NDYyODApCitFVkVOVChQTV9WU1UxX0REX0lTU1VFRCwgICAgICAgICAgICAgICAgICAgICAgMHgwYjA5OCkKK0VWRU5UKFBNX1BURUdfRlJPTV9MMzFfU0hSLCAgICAgICAgICAgICAgICAgICAweDJjMDU2KQorRVZFTlQoUE1fREFUQV9GUk9NX0wyMV9TSFIsICAgICAgICAgICAgICAgICAgIDB4M2MwNGUpCitFVkVOVChQTV9MU1UwX05DTEQsICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwYzA4YykKK0VWRU5UKFBNX1ZTVTFfNEZMT1AsICAgICAgICAgICAgICAgICAgICAgICAgICAweDBhMDllKQorRVZFTlQoUE1fVlNVMV84RkxPUCwgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MGEwYTIpCitFVkVOVChQTV9WU1VfOEZMT1AsICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwYThhMCkKK0VWRU5UKFBNX0xTVV9MTVFfU1JRX0VNUFRZX0NZQywgICAgICAgICAgICAgICAweDIwMDNlKQorRVZFTlQoUE1fRFRMQl9NSVNTXzY0SywgICAgICAgICAgICAgICAgICAgICAgIDB4M2MwNWUpCitFVkVOVChQTV9USFJEX0NPTkNfUlVOX0lOU1QsICAgICAgICAgICAgICAgICAgMHgzMDBmNCkKK0VWRU5UKFBNX01SS19QVEVHX0ZST01fTDIsICAgICAgICAgICAgICAgICAgICAweDFkMDUwKQorRVZFTlQoUE1fUEJfU1lTX1BVTVAsICAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAwODEpCitFVkVOVChQTV9WU1VfRklOLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwYThiYykKK0VWRU5UKFBNX01SS19EQVRBX0ZST01fTDMxX01PRCwgICAgICAgICAgICAgICAweDFkMDQ0KQorRVZFTlQoUE1fVEhSRF9QUklPXzBfMV9DWUMsICAgICAgICAgICAgICAgICAgIDB4MDQwYjApCitFVkVOVChQTV9ERVJBVF9NSVNTXzY0SywgICAgICAgICAgICAgICAgICAgICAgMHgyYzA1YykKK0VWRU5UKFBNX1BNQzJfUkVXSU5ELCAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMDIwKQorRVZFTlQoUE1fSU5TVF9GUk9NX0wyLCAgICAgICAgICAgICAgICAgICAgICAgIDB4MTQwNDApCitFVkVOVChQTV9HUlBfQlJfTVBSRURfTk9OU1BFQywgICAgICAgICAgICAgICAgMHgxMDAwYSkKK0VWRU5UKFBNX0lOU1RfRElTUCwgICAgICAgICAgICAgICAgICAgICAgICAgICAweDIwMGYyKQorRVZFTlQoUE1fTUVNMF9SRF9DQU5DRUxfVE9UQUwsICAgICAgICAgICAgICAgIDB4MzAwODMpCitFVkVOVChQTV9MU1UwX0RDX1BSRUZfU1RSRUFNX0NPTkZJUk0sICAgICAgICAgMHgwZDBiNCkKK0VWRU5UKFBNX0wxX0RDQUNIRV9SRUxPQURfVkFMSUQsICAgICAgICAgICAgICAweDMwMGY2KQorRVZFTlQoUE1fVlNVX1NDQUxBUl9ET1VCTEVfSVNTVUVELCAgICAgICAgICAgIDB4MGI4ODgpCitFVkVOVChQTV9MM19QUkVGX0hJVCwgICAgICAgICAgICAgICAgICAgICAgICAgMHgzZjA4MCkKK0VWRU5UKFBNX01SS19QVEVHX0ZST01fTDMxX01PRCwgICAgICAgICAgICAgICAweDFkMDU0KQorRVZFTlQoUE1fQ01QTFVfU1RBTExfU1RPUkUsICAgICAgICAgICAgICAgICAgIDB4MjAwNGEpCitFVkVOVChQTV9NUktfRlhVX0ZJTiwgICAgICAgICAgICAgICAgICAgICAgICAgMHgyMDAzOCkKK0VWRU5UKFBNX1BNQzRfT1ZFUkZMT1csICAgICAgICAgICAgICAgICAgICAgICAweDEwMDEwKQorRVZFTlQoUE1fTVJLX1BURUdfRlJPTV9MMywgICAgICAgICAgICAgICAgICAgIDB4MmQwNTApCitFVkVOVChQTV9MU1UwX0xNUV9MSFJfTUVSR0UsICAgICAgICAgICAgICAgICAgMHgwZDA5OCkKK0VWRU5UKFBNX0JUQUNfSElULCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDA1MDhhKQorRVZFTlQoUE1fTDNfUkRfQlVTWSwgICAgICAgICAgICAgICAgICAgICAgICAgIDB4NGYwODIpCitFVkVOVChQTV9MU1UwX0wxX1NXX1BSRUYsICAgICAgICAgICAgICAgICAgICAgMHgwYzA5YykKK0VWRU5UKFBNX0lOU1RfRlJPTV9MMk1JU1MsICAgICAgICAgICAgICAgICAgICAweDQ0MDQ4KQorRVZFTlQoUE1fTFNVMF9EQ19QUkVGX1NUUkVBTV9BTExPQywgICAgICAgICAgIDB4MGQwYTgpCitFVkVOVChQTV9MMl9TVCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxNjA4MikKK0VWRU5UKFBNX1ZTVTBfREVOT1JNLCAgICAgICAgICAgICAgICAgICAgICAgICAweDBhMGFjKQorRVZFTlQoUE1fTVJLX0RBVEFfRlJPTV9ETDJMM19TSFIsICAgICAgICAgICAgIDB4M2QwNDQpCitFVkVOVChQTV9CUl9QUkVEX0NSX1RBLCAgICAgICAgICAgICAgICAgICAgICAgMHgwNDhhYSkKK0VWRU5UKFBNX1ZTVTBfRkNPTlYsICAgICAgICAgICAgICAgICAgICAgICAgICAweDBhMGIwKQorRVZFTlQoUE1fTVJLX0xTVV9GTFVTSF9VTEQsICAgICAgICAgICAgICAgICAgIDB4MGQwODQpCitFVkVOVChQTV9CVEFDX01JU1MsICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwNTA4OCkKK0VWRU5UKFBNX01SS19MRF9NSVNTX0VYUE9TRURfQ1lDX0NPVU5ULCAgICAgICAweDEwMDNmKQorRVZFTlQoUE1fTVJLX0RBVEFfRlJPTV9MMiwgICAgICAgICAgICAgICAgICAgIDB4MWQwNDApCitFVkVOVChQTV9MU1VfRENBQ0hFX1JFTE9BRF9WQUxJRCwgICAgICAgICAgICAgMHgwZDBhMikKK0VWRU5UKFBNX1ZTVV9GTUEsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDBhODg0KQorRVZFTlQoUE1fTFNVMF9GTFVTSF9TUlEsICAgICAgICAgICAgICAgICAgICAgIDB4MGMwYmMpCitFVkVOVChQTV9MU1UxX0wxX1BSRUYsICAgICAgICAgICAgICAgICAgICAgICAgMHgwZDBiYSkKK0VWRU5UKFBNX0lPUFNfQ01QTCwgICAgICAgICAgICAgICAgICAgICAgICAgICAweDEwMDE0KQorRVZFTlQoUE1fTDJfU1lTX1BVTVAsICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzY0ODIpCitFVkVOVChQTV9MMl9SQ0xEX0JVU1lfUkNfRlVMTCwgICAgICAgICAgICAgICAgMHg0NjI4MikKK0VWRU5UKFBNX0xTVV9MTVFfUzBfQUxMT0MsICAgICAgICAgICAgICAgICAgICAweDBkMGExKQorRVZFTlQoUE1fRkxVU0hfRElTUF9TWU5DLCAgICAgICAgICAgICAgICAgICAgIDB4MDIwODgpCitFVkVOVChQTV9NUktfREFUQV9GUk9NX0RMMkwzX01PRF9DWUMsICAgICAgICAgMHg0MDAyYSkKK0VWRU5UKFBNX0wyX0lDX0lOViwgICAgICAgICAgICAgICAgICAgICAgICAgICAweDI2MTgwKQorRVZFTlQoUE1fTVJLX0RBVEFfRlJPTV9MMjFfTU9EX0NZQywgICAgICAgICAgIDB4NDAwMjQpCitFVkVOVChQTV9MM19QUkVGX0xEU1QsICAgICAgICAgICAgICAgICAgICAgICAgMHgwZDhhYykKK0VWRU5UKFBNX0xTVV9TUlFfRU1QVFlfQ1lDLCAgICAgICAgICAgICAgICAgICAweDQwMDA4KQorRVZFTlQoUE1fTFNVX0xNUV9TMF9WQUxJRCwgICAgICAgICAgICAgICAgICAgIDB4MGQwYTApCitFVkVOVChQTV9GTFVTSF9QQVJUSUFMLCAgICAgICAgICAgICAgICAgICAgICAgMHgwMjA4NikKK0VWRU5UKFBNX1ZTVTFfRk1BX0RPVUJMRSwgICAgICAgICAgICAgICAgICAgICAweDBhMDkyKQorRVZFTlQoUE1fMVBMVVNfUFBDX0RJU1AsICAgICAgICAgICAgICAgICAgICAgIDB4NDAwZjIpCitFVkVOVChQTV9EQVRBX0ZST01fTDJNSVNTLCAgICAgICAgICAgICAgICAgICAgMHgyMDBmZSkKK0VWRU5UKFBNX1NVU1BFTkRFRCwgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwKQorRVZFTlQoUE1fVlNVMF9GTUEsICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MGEwODQpCitFVkVOVChQTV9DTVBMVV9TVEFMTF9TQ0FMQVIsICAgICAgICAgICAgICAgICAgMHg0MDAxMikKK0VWRU5UKFBNX1NUQ1hfRkFJTCwgICAgICAgICAgICAgICAgICAgICAgICAgICAweDBjMDlhKQorRVZFTlQoUE1fVlNVMF9GU1FSVF9GRElWX0RPVUJMRSwgICAgICAgICAgICAgIDB4MGEwOTQpCitFVkVOVChQTV9EQ19QUkVGX0RTVCwgICAgICAgICAgICAgICAgICAgICAgICAgMHgwZDBiMCkKK0VWRU5UKFBNX1ZTVTFfU0NBTF9TSU5HTEVfSVNTVUVELCAgICAgICAgICAgICAweDBiMDg2KQorRVZFTlQoUE1fTDNfSElULCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MWYwODApCitFVkVOVChQTV9MMl9HTE9CX0dVRVNTX1dST05HLCAgICAgICAgICAgICAgICAgMHgyNjQ4MikKK0VWRU5UKFBNX01SS19ERlVfRklOLCAgICAgICAgICAgICAgICAgICAgICAgICAweDIwMDMyKQorRVZFTlQoUE1fSU5TVF9GUk9NX0wxLCAgICAgICAgICAgICAgICAgICAgICAgIDB4MDQwODApCitFVkVOVChQTV9CUlVfRklOLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxMDA2OCkKK0VWRU5UKFBNX0lDX0RFTUFORF9SRVEsICAgICAgICAgICAgICAgICAgICAgICAweDA0MDg4KQorRVZFTlQoUE1fVlNVMV9GU1FSVF9GRElWX0RPVUJMRSwgICAgICAgICAgICAgIDB4MGEwOTYpCitFVkVOVChQTV9WU1UxX0ZNQSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwYTA4NikKK0VWRU5UKFBNX01SS19MRF9NSVNTX0wxLCAgICAgICAgICAgICAgICAgICAgICAweDIwMDM2KQorRVZFTlQoUE1fVlNVMF8yRkxPUF9ET1VCTEUsICAgICAgICAgICAgICAgICAgIDB4MGEwOGMpCitFVkVOVChQTV9MU1VfRENfUFJFRl9TVFJJREVEX1NUUkVBTV9DT05GSVJNLCAgMHgwZDhiYykKK0VWRU5UKFBNX0lOU1RfUFRFR19GUk9NX0wzMV9TSFIsICAgICAgICAgICAgICAweDJlMDU2KQorRVZFTlQoUE1fTVJLX0xTVV9SRUpFQ1RfRVJBVF9NSVNTLCAgICAgICAgICAgIDB4MzAwNjQpCitFVkVOVChQTV9NUktfREFUQV9GUk9NX0wyTUlTUywgICAgICAgICAgICAgICAgMHg0ZDA0OCkKK0VWRU5UKFBNX0RBVEFfRlJPTV9STDJMM19TSFIsICAgICAgICAgICAgICAgICAweDFjMDRjKQorRVZFTlQoUE1fSU5TVF9GUk9NX1BSRUYsICAgICAgICAgICAgICAgICAgICAgIDB4MTQwNDYpCitFVkVOVChQTV9WU1UxX1NRLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwYjA5ZSkKK0VWRU5UKFBNX0wyX0xEX0RJU1AsICAgICAgICAgICAgICAgICAgICAgICAgICAweDM2MTgwKQorRVZFTlQoUE1fTDJfRElTUF9BTEwsICAgICAgICAgICAgICAgICAgICAgICAgIDB4NDYwODApCitFVkVOVChQTV9USFJEX0dSUF9DTVBMX0JPVEhfQ1lDLCAgICAgICAgICAgICAgMHgxMDAxMikKK0VWRU5UKFBNX1ZTVV9GU1FSVF9GRElWX0RPVUJMRSwgICAgICAgICAgICAgICAweDBhODk0KQorRVZFTlQoUE1fQlJfTVBSRUQsICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4NDAwZjYpCitFVkVOVChQTV9JTlNUX1BURUdfRlJPTV9ETDJMM19TSFIsICAgICAgICAgICAgMHgzZTA1NCkKK0VWRU5UKFBNX1ZTVV8xRkxPUCwgICAgICAgICAgICAgICAgICAgICAgICAgICAweDBhODgwKQorRVZFTlQoUE1fSFZfQ1lDLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAwMGEpCitFVkVOVChQTV9NUktfTFNVX0ZJTiwgICAgICAgICAgICAgICAgICAgICAgICAgMHg0MDAzMikKK0VWRU5UKFBNX01SS19EQVRBX0ZST01fUkwyTDNfU0hSLCAgICAgICAgICAgICAweDFkMDRjKQorRVZFTlQoUE1fRFRMQl9NSVNTXzE2TSwgICAgICAgICAgICAgICAgICAgICAgIDB4NGMwNWUpCitFVk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AoKihjaGFyICopIGFkZHIpCTogIlEiIChfb2lfYml0bWFwW25yICYgN10pCisJCTogIitRIiAoKihjaGFyICopIGFkZHIpCTogIlEiIChfb2lfYml0bWFwW25yICYgN10pCiAJCTogImNjIiwgIm1lbW9yeSIpOwogCXJldHVybiAoY2ggPj4gKG5yICYgNykpICYgMTsKIH0KQEAgLTMyMCw3ICszMjAsNyBAQAogCWNoID0gKih1bnNpZ25lZCBjaGFyICopIGFkZHI7CiAJYXNtIHZvbGF0aWxlKAogCQkiCW5jCSVPMCgxLCVSMCksJTEiCi0JCTogIj1RIiAoKihjaGFyICopIGFkZHIpCTogIlEiIChfbmlfYml0bWFwW25yICYgN10pCisJCTogIitRIiAoKihjaGFyICopIGFkZHIpCTogIlEiIChfbmlfYml0bWFwW25yICYgN10pCiAJCTogImNjIiwgIm1lbW9yeSIpOwogCXJldHVybiAoY2ggPj4gKG5yICYgNykpICYgMTsKIH0KQEAgLTMzOSw3ICszMzksNyBAQAogCWNoID0gKih1bnNpZ25lZCBjaGFyICopIGFkZHI7CiAJYXNtIHZvbGF0aWxlKAogCQkiCXhjCSVPMCgxLCVSMCksJTEiCi0JCTogIj1RIiAoKihjaGFyICopIGFkZHIpCTogIlEiIChfb2lfYml0bWFwW25yICYgN10pCisJCTogIitRIiAoKihjaGFyICopIGFkZHIpCTogIlEiIChfb2lfYml0bWFwW25yICYgN10pCiAJCTogImNjIiwgIm1lbW9yeSIpOwogCXJldHVybiAoY2ggPj4gKG5yICYgNykpICYgMTsKIH0KZGlmZiAtLWdpdCBhL2FyY2gvczM5MC9pbmNsdWRlL2FzbS9jaW8uaCBiL2FyY2gvczM5MC9pbmNsdWRlL2FzbS9jaW8uaAppbmRleCBmZmI4OTg5Li5kNDI2MjUwIDEwMDY0NAotLS0gYS9hcmNoL3MzOTAvaW5jbHVkZS9hc20vY2lvLmgKKysrIGIvYXJjaC9zMzkwL2luY2x1ZGUvYXNtL2Npby5oCkBAIC0yOTYsNiArMjk2LDcgQEAKI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b2lkIGludmFsaWRhdGVfaW50ZXJydXB0MTModm9pZCk7CitleHRlcm4gYXNtbGlua2FnZSB2b2lkIGludmFsaWRhdGVfaW50ZXJydXB0MTQodm9pZCk7CitleHRlcm4gYXNtbGlua2FnZSB2b2lkIGludmFsaWRhdGVfaW50ZXJydXB0MTUodm9pZCk7CitleHRlcm4gYXNtbGlua2FnZSB2b2lkIGludmFsaWRhdGVfaW50ZXJydXB0MTYodm9pZCk7CitleHRlcm4gYXNtbGlua2FnZSB2b2lkIGludmFsaWRhdGVfaW50ZXJydXB0MTcodm9pZCk7CitleHRlcm4gYXNtbGlua2FnZSB2b2lkIGludmFsaWRhdGVfaW50ZXJydXB0MTgodm9pZCk7CitleHRlcm4gYXNtbGlua2FnZSB2b2lkIGludmFsaWRhdGVfaW50ZXJydXB0MTkodm9pZCk7CitleHRlcm4gYXNtbGlua2FnZSB2b2lkIGludmFsaWRhdGVfaW50ZXJydXB0MjAodm9pZCk7CitleHRlcm4gYXNtbGlua2FnZSB2b2lkIGludmFsaWRhdGVfaW50ZXJydXB0MjEodm9pZCk7CitleHRlcm4gYXNtbGlua2FnZSB2b2lkIGludmFsaWRhdGVfaW50ZXJydXB0MjIodm9pZCk7CitleHRlcm4gYXNtbGlua2FnZSB2b2lkIGludmFsaWRhdGVfaW50ZXJydXB0MjModm9pZCk7CitleHRlcm4gYXNtbGlua2FnZSB2b2lkIGludmFsaWRhdGVfaW50ZXJydXB0MjQodm9pZCk7CitleHRlcm4gYXNtbGlua2FnZSB2b2lkIGludmFsaWRhdGVfaW50ZXJydXB0MjUodm9pZCk7CitleHRlcm4gYXNtbGlua2FnZSB2b2lkIGludmFsaWRhdGVfaW50ZXJydXB0MjYodm9pZCk7CitleHRlcm4gYXNtbGlua2FnZSB2b2lkIGludmFsaWRhdGVfaW50ZXJydXB0Mjcodm9pZCk7CitleHRlcm4gYXNtbGlua2FnZSB2b2lkIGludmFsaWRhdGVfaW50ZXJydXB0Mjgodm9pZCk7CitleHRlcm4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aWNhL25zd2Fsay5jIGIvZHJpdmVycy9hY3BpL2FjcGljYS9uc3dhbGsuYwppbmRleCBlNzA5MTFhLi5lODFmMTVlIDEwMDY0NAotLS0gYS9kcml2ZXJzL2FjcGkvYWNwaWNhL25zd2Fsay5jCisrKyBiL2RyaXZlcnMvYWNwaS9hY3BpY2EvbnN3YWxrLmMKQEAgLTE1Niw5ICsxNTYsOSBAQAogICogICAgICAgICAgICAgIG1heF9kZXB0aCAgICAgICAgICAgLSBEZXB0aCB0byB3aGljaCBzZWFyY2ggaXMgdG8gcmVhY2gKICAqICAgICAgICAgICAgICBmbGFncyAgICAgICAgICAgICAgIC0gV2hldGhlciB0byB1bmxvY2sgdGhlIE5TIGJlZm9yZSBpbnZva2luZwogICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgY2FsbGJhY2sgcm91dGluZQotICogICAgICAgICAgICAgIHByZV9vcmRlcl92aXNpdCAgICAgLSBDYWxsZWQgZHVyaW5nIHRyZWUgcHJlLW9yZGVyIHZpc2l0CisgKiAgICAgICAgICAgICAgZGVzY2VuZGluZ19jYWxsYmFjayAtIENhbGxlZCBkdXJpbmcgdHJlZSBkZXNjZW50CiAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoZW4gYW4gb2JqZWN0IG9mICJUeXBlIiBpcyBmb3VuZAotICogICAgICAgICAgICAgIHBvc3Rfb3JkZXJfdmlzaXQgICAgLSBDYWxsZWQgZHVyaW5nIHRyZWUgcG9zdC1vcmRlciB2aXNpdAorICogICAgICAgICAgICAgIGFzY2VuZGluZ19jYWxsYmFjayAgLSBDYWxsZWQgZHVyaW5nIHRyZWUgYXNjZW50CiAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoZW4gYW4gb2JqZWN0IG9mICJUeXBlIiBpcyBmb3VuZAogICogICAgICAgICAgICAgIGNvbnRleHQgICAgICAgICAgICAgLSBQYXNzZWQgdG8gdXNlciBmdW5jdGlvb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YXJjaCBpcyB0byByZWFjaAotICogICAgICAgICAgICAgIHByZV9vcmRlcl92aXNpdCAgICAgLSBDYWxsZWQgZHVyaW5nIHRyZWUgcHJlLW9yZGVyIHZpc2l0CisgKiAgICAgICAgICAgICAgZGVzY2VuZGluZ19jYWxsYmFjayAtIENhbGxlZCBkdXJpbmcgdHJlZSBkZXNjZW50CiAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoZW4gYW4gb2JqZWN0IG9mICJUeXBlIiBpcyBmb3VuZAotICogICAgICAgICAgICAgIHBvc3Rfb3JkZXJfdmlzaXQgICAgLSBDYWxsZWQgZHVyaW5nIHRyZWUgcG9zdC1vcmRlciB2aXNpdAorICogICAgICAgICAgICAgIGFzY2VuZGluZ19jYWxsYmFjayAgLSBDYWxsZWQgZHVyaW5nIHRyZWUgYXNjZW50CiAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoZW4gYW4gb2JqZWN0IG9mICJUeXBlIiBpcyBmb3VuZAogICogICAgICAgICAgICAgIGNvbnRleHQgICAgICAgICAgICAgLSBQYXNzZWQgdG8gdXNlciBmdW5jdGlvbihzKSBhYm92ZQogICogICAgICAgICAgICAgIHJldHVybl92YWx1ZSAgICAgICAgLSBMb2NhdGlvbiB3aGVyZSByZXR1cm4gdmFsdWUgb2YKQEAgLTU2Myw4ICs1NjMsOCBAQAogYWNwaV93YWxrX25hbWVzcGFjZShhY3BpX29iamVjdF90eXBlIHR5cGUsCiAJCSAgICBhY3BpX2hhbmRsZSBzdGFydF9vYmplY3QsCiAJCSAgICB1MzIgbWF4X2RlcHRoLAotCQkgICAgYWNwaV93YWxrX2NhbGxiYWNrIHByZV9vcmRlcl92aXNpdCwKLQkJICAgIGFjcGlfd2Fsa19jYWxsYmFjayBwb3N0X29yZGVyX3Zpc2l0LAorCQkgICAgYWNwaV93YWxrX2NhbGxiYWNrIGRlc2NlbmRpbmdfY2FsbGJhY2ssCisJCSAgICBhY3BpX3dh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YWNlLT5mbGFncyAmPSB+QUNQSV9PU0lfSU5WQUxJRDsKKwkJCX0KKwkJfQorCisJCW5leHRfaW50ZXJmYWNlID0gbmV4dF9pbnRlcmZhY2UtPm5leHQ7CisJfQorCisJcmV0dXJuIChBRV9PSyk7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgogICogRlVOQ1RJT046ICAgIGFjcGlfdXRfZ2V0X2ludGVyZmFjZQogICoKICAqIFBBUkFNRVRFUlM6ICBpbnRlcmZhY2VfbmFtZSAgICAgIC0gVGhlIGludGVyZmFjZSB0byBmaW5kCmRpZmYgLS1naXQgYS9kcml2ZXJzL2FjcGkvYWNwaWNhL3V0c3RyaW5nLmMgYi9kcml2ZXJzL2FjcGkvYWNwaWNhL3V0c3RyaW5nLmMKaW5kZXggYzUzNzU5Yi4uY2IxZTljYyAxMDA2NDQKLS0tIGEvZHJpdmVycy9hY3BpL2FjcGljYS91dHN0cmluZy5jCisrKyBiL2RyaXZlcnMvYWNwaS9hY3BpY2EvdXRzdHJpbmcuYwpAQCAtMzMzLDcgKzMzMyw4IEBACiAgKiBGVU5DVElPTjogICAgYWNwaV91dF9wcmludF9zdHJpbmcKICAqCiAgKiBQQVJBTUVURVJTOiAgc3RyaW5nICAgICAgICAgIC0gTnVsbCB0ZXJtaW5hdGVkIEFTQ0lJIHN0cmluZwotICogICAgICAgICAgICAgIG1heF9sZW5ndGggICAgICAtIE1heGltdW0gb3V0cHV0IGxlbmd0aAorICogICAgICAgICAgICAgIG1heF9sZW5ndGggICAgICAtIE1heGltdW0gb3V0cHV0IGxlbmd0aC4gVXNlZCB0byBjb25zdHJhaW4gdGhlCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVuZ3RoIG9mIHN0cmluZ3MgZHVyaW5nIGRlYnVnIG91dHB1dCBvbmx5LgogICoKICAqIFJFVFVSTjogICAgICBOb25lCiAgKgpAQCAtMzQyLDcgKzM0Myw3IEBACiAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAotdm9pZCBhY3BpX3V0X3ByaW50X3N0cmluZyhjaGFyICpzdHJpbmcsIHU4IG1heF9sZW5ndGgpCit2b2lkIGFjcGlfdXRfcHJpbnRfc3RyaW5nKGNoYXIgKnN0cmluZywgdTE2IG1heF9sZW5ndGgpCiB7CiAJdTMyIGk7CiAKZGlmZiAtLWdpdCBhL2RyaXZlcnMvYWNwaS9hY3BpY2EvdXR4ZmFjZS5jIGIvZHJpdmVycy9hY3BpL2FjcGljYS91dHhmYWNlLmMKaW5kZXggNjUwNTc3NC4uMDNhMjExZSAxMDA2NDQKLS0tIGEvZHJpdmVycy9hY3BpL2FjcGljYS91dHhmYWNlLmMKKysrIGIvZHJpdmVycy9hY3BpL2FjcGljYS91dHhmYWNlLmMKQEAgLTM4OSw2ICszODksMzQgQEAKIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgKgorICogRlVOQ1RJT046ICAgIGFjcGlfdXBkYXRlX2ludGVyZmFjZXMKKyAqCisgKiBQQVJBTUVURVJTOiAgYWN0aW9uICAgICAgICAgICAgICAtIEFjdGlvbnMgdG8gYmUgcGVyZm9ybWVkIGR1cmluZyB0aGUKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlCisgKgorICogUkVUVVJOOiAgICAgIFN0YXR1cworICoKKyAqIERFU0NSSVBUSU9OOiBVcGRhdGUgX09TSSBpbnRlcmZhY2Ugc3RyaW5ncywgZGlzYWJsaW5nIG9yIGVuYWJsaW5nIE9TIHZlbmRvcgorICogICAgICAgICAgICAgIHN0cmluZyBvci9hbmQgZmVhdHVyZSBncm91cCBzdHJpbmdzLgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworYWNwaV9zdGF0dXMgYWNwaV91cGRhdGVfaW50ZXJmYWNlcyh1OCBhY3Rpb24pCit7CisJYWNwaV9zdGF0dXMgc3RhdHVzOworCisJc3RhdHVzID0gYWNwaV9vc19hY3F1aXJlX211dGV4KGFjcGlfZ2JsX29zaV9tdXRleCwgQUNQSV9XQUlUX0ZPUkVWRVIpOworCWlmIChBQ1BJX0ZBSUxVUkUoc3RhdHVzKSkgeworCQlyZXR1cm4gKHN0YXR1cyk7CisJfQorCisJc3RhdHVzID0gYWNwaV91dF91cGRhdGVfaW50ZXJmYWNlcyhhY3Rpb24pOworCisJYWNwaV9vc19yZWxlYXNlX211dGV4KGFjcGlfZ2JsX29zaV9tdXRleCk7CisJcmV0dXJuIChzdGF0dXMpOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCiAgKiBGVU5DVElPTjogICAgYWNwaV9jaGVja19hZGRyZXNzX3JhbmdlCiAgKgogICogUEFSQU1FVEVSUzogIHNwYWNlX2lkICAgICAgICAgICAgLSBBZGRyZXNzIHNwYWNlIElECkBAIC00MDIsNiArNDMwLDcgQEAKICAqICAgICAgICAgICAgICBBU0wgb3BlcmF0aW9uIHJlZ2lvbiBhZGRyZXNzIHJhbmdlcy4KICAqCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwogdTMyCiBhY3BpX2NoZWNrX2FkZHJlc3NfcmFuZ2UoYWNwaV9hZHJfc3BhY2VfdHlwZSBzcGFjZV9pZCwKIAkJCSBhY3BpX3BoeXNpY2FsX2FkZHJlc3MgYWRkcmVzcywKZGlmZiAtLWdpdCBhL2RyaXZlcnMvYWNwaS9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aW5lIERPQ0tfRVZFTlQJMwogI2RlZmluZSBVTkRPQ0tfRVZFTlQJMgogCitlbnVtIGRvY2tfY2FsbGJhY2tfdHlwZSB7CisJRE9DS19DQUxMX0hBTkRMRVIsCisJRE9DS19DQUxMX0ZJWFVQLAorCURPQ0tfQ0FMTF9VRVZFTlQsCit9OworCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICAqICAgICAgICAgICAgICAgICAgICAgICAgIERvY2sgRGVwZW5kZW50IGRldmljZSBmdW5jdGlvbnMgICAgICAgICAgICAgICAgICAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwpAQCAtMTAxLDcgKzEwMyw3IEBACiAgKgogICogQWRkIHRoZSBkZXBlbmRlbnQgZGV2aWNlIHRvIHRoZSBkb2NrJ3MgZGVwZW5kZW50IGRldmljZSBsaXN0LgogICovCi1zdGF0aWMgaW50CitzdGF0aWMgaW50IF9faW5pdAogYWRkX2RvY2tfZGVwZW5kZW50X2RldmljZShzdHJ1Y3QgZG9ja19zdGF0aW9uICpkcywgYWNwaV9oYW5kbGUgaGFuZGxlKQogewogCXN0cnVjdCBkb2NrX2RlcGVuZGVudF9kZXZpY2UgKmRkOwpAQCAtMTEyLDE0ICsxMTQsMjEgQEAKIAogCWRkLT5oYW5kbGUgPSBoYW5kbGU7CiAJSU5JVF9MSVNUX0hFQUQoJmRkLT5saXN0KTsKLQotCXNwaW5fbG9jaygmZHMtPmRkX2xvY2spOwogCWxpc3RfYWRkX3RhaWwoJmRkLT5saXN0LCAmZHMtPmRlcGVuZGVudF9kZXZpY2VzKTsKLQlzcGluX3VubG9jaygmZHMtPmRkX2xvY2spOwogCiAJcmV0dXJuIDA7CiB9CiAKK3N0YXRpYyB2b2lkIHJlbW92ZV9kb2NrX2RlcGVuZGVudF9kZX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KwlpZiAoZXh5bm9zX3BjaWUtPnJlc2V0X2dwaW8gPj0gMCkKKwkJZGV2bV9ncGlvX3JlcXVlc3Rfb25lKHBwLT5kZXYsIGV4eW5vc19wY2llLT5yZXNldF9ncGlvLAorCQkJCUdQSU9GX09VVF9JTklUX0hJR0gsICJSRVNFVCIpOworCXJldHVybjsKK30KKworc3RhdGljIGludCBleHlub3NfcGNpZV9lc3RhYmxpc2hfbGluayhzdHJ1Y3QgcGNpZV9wb3J0ICpwcCkKK3sKKwl1MzIgdmFsOworCWludCBjb3VudCA9IDA7CisJc3RydWN0IGV4eW5vc19wY2llICpleHlub3NfcGNpZSA9IHRvX2V4eW5vc19wY2llKHBwKTsKKworCWlmIChkd19wY2llX2xpbmtfdXAocHApKSB7CisJCWRldl9lcnIocHAtPmRldiwgIkxpbmsgYWxyZWFkeSB1cFxuIik7CisJCXJldHVybiAwOworCX0KKworCS8qIGFzc2VydCByZXNldCBzaWduYWxzICovCisJZXh5bm9zX3BjaWVfYXNzZXJ0X2NvcmVfcmVzZXQocHApOworCWV4eW5vc19wY2llX2Fzc2VydF9waHlfcmVzZXQocHApOworCisJLyogZGUtYXNzZXJ0IHBoeSByZXNldCAqLworCWV4eW5vc19wY2llX2RlYXNzZXJ0X3BoeV9yZXNldChwcCk7CisKKwkvKiBpbml0aWFsaXplIHBoeSAqLworCWV4eW5vc19wY2llX2luaXRfcGh5KHBwKTsKKworCS8qIHB1bHNlIGZvciBjb21tb24gcmVzZXQgKi8KKwlleHlub3NfYmxrX3dyaXRlbChleHlub3NfcGNpZSwgMSwgUENJRV9QSFlfQ09NTU9OX1JFU0VUKTsKKwl1ZGVsYXkoNTAwKTsKKwlleHlub3NfYmxrX3dyaXRlbChleHlub3NfcGNpZSwgMCwgUENJRV9QSFlfQ09NTU9OX1JFU0VUKTsKKworCS8qIGRlLWFzc2VydCBjb3JlIHJlc2V0ICovCisJZXh5bm9zX3BjaWVfZGVhc3NlcnRfY29yZV9yZXNldChwcCk7CisKKw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ncm91cHNbXSA9IHsKKwkiZ3BpbzAiLAorCSJncGlvMSIsCisJImdwaW8yIiwKKwkiZ3BpbzMiLAorCSJncGlvNCIsCisJImdwaW81IiwKKwkiZ3BpbzYiLAorCSJncGlvNyIsCisJImdwaW84IiwKKwkiZ3BpbzkiLAorCSJncGlvMTAiLAorCSJncGlvMTEiLAorCSJncGlvMTIiLAorCSJncGlvMTUiLAorCSJ2YWMiLAorCSJwb3dlcmdvb2QiLAorfTsKKworc3RhdGljIGNvbnN0IGNoYXIgKiBjb25zdCBvcHQyX2dyb3Vwc1tdID0geworCSJncGlvMSIsCisJImdwaW8yIiwKKwkiZ3BpbzUiLAorCSJncGlvNyIsCit9OworCitzdGF0aWMgY29uc3QgY2hhciAqIGNvbnN0IG9wdDNfZ3JvdXBzW10gPSB7CisJImdwaW8xIiwKKwkiZ3BpbzIiLAorfTsKKworc3RhdGljIGNvbnN0IGNoYXIgKiBjb25zdCBncGlvX2dyb3Vwc1tdID0geworCSJncGlvMCIsCisJImdwaW8xIiwKKwkiZ3BpbzIiLAorCSJncGlvMyIsCisJImdwaW80IiwKKwkiZ3BpbzUiLAorCSJncGlvNiIsCisJImdwaW83IiwKKwkiZ3BpbzgiLAorCSJncGlvOSIsCisJImdwaW8xMCIsCisJImdwaW8xMSIsCisJImdwaW8xMiIsCisJImdwaW8xMyIsCisJImdwaW8xNCIsCisJImdwaW8xNSIsCit9OworCitzdGF0aWMgY29uc3QgY2hhciAqIGNvbnN0IGxlZF9ncm91cHNbXSA9IHsKKwkiZ3BpbzEiLAorCSJncGlvMiIsCit9OworCitzdGF0aWMgY29uc3QgY2hhciAqIGNvbnN0IHB3bV9ncm91cHNbXSA9IHsKKwkiZ3BpbzEiLAorCSJncGlvMiIsCit9OworCitzdGF0aWMgY29uc3QgY2hhciAqIGNvbnN0IHJlZ2VuX2dyb3Vwc1tdID0geworCSJncGlvMiIsCit9OworCitzdGF0aWMgY29uc3QgY2hhciAqIGNvbnN0IHN5c2VuX2dyb3Vwc1tdID0geworCSJncGlvNCIsCisJImdwaW82IiwKK307CisKK3N0YXRpYyBjb25zdCBjaGFyICogY29uc3QgY2xrMzJrZ2F1ZGlvX2dyb3Vwc1tdID0geworCSJncGlvNSIsCit9OworCitzdGF0aWMgY29uc3QgY2hhciAqIGNvbnN0IGlkX2dyb3Vwc1tdID0geworCSJncGlvMCIsCit9OworCitzdGF0aWMgY29uc3QgY2hhciAqIGNvbnN0IHZidXNfZGV0X2dyb3Vwc1tdID0geworCSJncGlvMSIsCit9OworCitzdGF0aWMgY29uc3QgY2hhciAqIGNvbnN0IGNocmdfZGV0X2dyb3Vwc1tdID0geworCSJncGlvMyIsCit9OworCitzdGF0aWMgY29uc3QgY2hhciAqIGNvbnN0IHZhY19ncm91cHNbXSA9IHsKKwkidmFjIiwKK307CisKK3N0YXRpYyBjb25zdCBjaGFyICogY29uc3QgdmFjb2tfZ3JvdXBzW10gPSB7CisJInZhYyIsCit9OworCitzdGF0aWMgY29uc3QgY2hhciAqIGNvbnN0IHBvd2VyZ29vZF9ncm91cHNbXSA9IHsKKwkicG93ZXJnb29kIiwKK307CisKK3N0YXRpYyBjb25zdCBjaGFyICogY29uc3QgdXNiX3BzZWxfZ3JvdXBzW10gPSB7CisJImdwaW81IiwKKwkicG93ZXJnb29kIiwKK307CisKK3N0YXRpYyBjb25zdCBjaGFyICogY29uc3QgbXNlY3VyZV9ncm91cHNbXSA9IHsKKwkiZ3BpbzciLAorfTsKKworc3RhdGljIGNvbnN0IGNoYXIgKiBjb25zdCBwd3Job2xkX2dyb3Vwc1tdID0geworCSJncGlvNyIsCit9OworCitzdGF0aWMgY29uc3QgY2hhciAqIGNvbnN0IGludF9ncm91cHNbXSA9IHsKKwkiaW50IiwKK307CisKK3N0YXRpYyBjb25zdCBjaGFyICogY29uc3QgbnJlc3dhcm1fZ3JvdXBzW10gPSB7CisJIm5yZXN3YXJtIiwKK307CisKK3N0YXRpYyBjb25zdCBjaGFyICogY29uc3Qgc2ltcnN0b19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uZmlncywgdW5zaWduZWQgKm51bV9jb25maWdzLAorCQl1bnNpZ25lZCBsb25nIGNvbmZpZykKK3sKKwl1bnNpZ25lZCBvbGRfbnVtID0gKm51bV9jb25maWdzOworCXVuc2lnbmVkIG5ld19udW0gPSBvbGRfbnVtICsgMTsKKwl1bnNpZ25lZCBsb25nICpuZXdfY29uZmlnczsKKworCW5ld19jb25maWdzID0ga3JlYWxsb2MoKmNvbmZpZ3MsIHNpemVvZigqbmV3X2NvbmZpZ3MpICogbmV3X251bSwKKwkJCSAgICAgICBHRlBfS0VSTkVMKTsKKwlpZiAoIW5ld19jb25maWdzKSB7CisJCWRldl9lcnIocGN0bGRldi0+ZGV2LCAia3JlYWxsb2MoY29uZmlncykgZmFpbGVkXG4iKTsKKwkJcmV0dXJuIC1FTk9NRU07CisJfQorCisJbmV3X2NvbmZpZ3Nbb2xkX251bV0gPSBjb25maWc7CisKKwkqY29uZmlncyA9IG5ld19jb25maWdzOworCSpudW1fY29uZmlncyA9IG5ld19udW07CisKKwlyZXR1cm4gMDsKK30KK0VYUE9SVF9TWU1CT0xfR1BMKHBpbmN0cmxfdXRpbHNfYWRkX2NvbmZpZyk7CisKK3ZvaWQgcGluY3RybF91dGlsc19kdF9mcmVlX21hcChzdHJ1Y3QgcGluY3RybF9kZXYgKnBjdGxkZXYsCisJICAgICAgc3RydWN0IHBpbmN0cmxfbWFwICptYXAsIHVuc2lnbmVkIG51bV9tYXBzKQoreworCWludCBpOworCisJZm9yIChpID0gMDsgaSA8IG51bV9tYXBzOyBpKyspIHsKKwkJc3dpdGNoIChtYXBbaV0udHlwZSkgeworCQljYXNlIFBJTl9NQVBfVFlQRV9DT05GSUdTX0dST1VQOgorCQljYXNlIFBJTl9NQVBfVFlQRV9DT05GSUdTX1BJTjoKKwkJCWtmcmVlKG1hcFtpXS5kYXRhLmNvbmZpZ3MuY29uZmlncyk7CisJCQlicmVhazsKKwkJZGVmYXVsdDoKKwkJCWJyZWFrOworCQl9CisJfQorCWtm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JfRFIyX01BUkssIERVMl9EUjFfTUFSSywgRFUyX0RSMF9NQVJLLAorCURVMl9ERzdfTUFSSywgRFUyX0RHNl9NQVJLLCBEVTJfREc1X01BUkssIERVMl9ERzRfTUFSSywKKwlEVTJfREczX01BUkssIERVMl9ERzJfTUFSSywgRFUyX0RHMV9NQVJLLCBEVTJfREcwX01BUkssCisJRFUyX0RCN19NQVJLLCBEVTJfREI2X01BUkssIERVMl9EQjVfTUFSSywgRFUyX0RCNF9NQVJLLAorCURVMl9EQjNfTUFSSywgRFUyX0RCMl9NQVJLLCBEVTJfREIxX01BUkssIERVMl9EQjBfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IGR1X2Nsa19vdXRfMF9waW5zW10gPSB7CisJLyogQ0xLT1VUICovCisJUkNBUl9HUF9QSU4oNSwgMiksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBkdV9jbGtfb3V0XzBfbXV4W10gPSB7CisJRFUwX0RPVENMS09VVF9NQVJLCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBkdV9jbGtfb3V0XzFfcGluc1tdID0geworCS8qIENMS09VVCAqLworCVJDQVJfR1BfUElOKDUsIDMpLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgZHVfY2xrX291dF8xX211eFtdID0geworCURVMV9ET1RDTEtPVVRfTUFSSworfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgZHVfc3luY18wX3BpbnNbXSA9IHsKKwkvKiBWU1lOQywgSFNZTkMsIERJU1AgKi8KKwlSQ0FSX0dQX1BJTig0LCAxNSksIFJDQVJfR1BfUElOKDQsIDE0KSwgUkNBUl9HUF9QSU4oNSwgMCksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBkdV9zeW5jXzBfbXV4W10gPSB7CisJRFUyX0VYVlNZTkNfRFUyX1ZTWU5DX01BUkssIERVMl9FWEhTWU5DX0RVMl9IU1lOQ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UUzFfTl9CX01BUkssIEhDVFMxX05fQl9NQVJLLAogfTsKKy8qIC0gSU5UQyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IGludGNfaXJxMF9waW5zW10gPSB7CisJLyogSVJRICovCisJUkNBUl9HUF9QSU4oMSwgMjUpLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgaW50Y19pcnEwX211eFtdID0geworCUlSUTBfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IGludGNfaXJxMV9waW5zW10gPSB7CisJLyogSVJRICovCisJUkNBUl9HUF9QSU4oMSwgMjcpLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgaW50Y19pcnExX211eFtdID0geworCUlSUTFfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IGludGNfaXJxMl9waW5zW10gPSB7CisJLyogSVJRICovCisJUkNBUl9HUF9QSU4oMSwgMjkpLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgaW50Y19pcnEyX211eFtdID0geworCUlSUTJfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IGludGNfaXJxM19waW5zW10gPSB7CisJLyogSVJRICovCisJUkNBUl9HUF9QSU4oMSwgMjMpLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgaW50Y19pcnEzX211eFtdID0geworCUlSUTNfTUFSSywKK307CisvKiAtIE1NQ0lGMCAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtbWMwX2RhdGExX3BpbnNbXSA9IHsKKwkvKiBEW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PRjFfU0NLX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfc3luY19waW5zW10gPSB7CisJLyogU1lOQyAqLworCVJDQVJfR1BfUElOKDQsIDkpLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YxX3N5bmNfbXV4W10gPSB7CisJTVNJT0YxX1NZTkNfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV9zczFfcGluc1tdID0geworCS8qIFNTMSAqLworCVJDQVJfR1BfUElOKDQsIDEwKSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV9zczFfbXV4W10gPSB7CisJTVNJT0YxX1NTMV9NQVJLLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YxX3NzMl9waW5zW10gPSB7CisJLyogU1MyICovCisJUkNBUl9HUF9QSU4oNCwgMTEpLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YxX3NzMl9tdXhbXSA9IHsKKwlNU0lPRjFfU1MyX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfcnhfcGluc1tdID0geworCS8qIFJYRCAqLworCVJDQVJfR1BfUElOKDQsIDEzKSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV9yeF9tdXhbXSA9IHsKKwlNU0lPRjFfUlhEX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfdHhfcGluc1tdID0geworCS8qIFRYRCAqLworCVJDQVJfR1BfUElOKDQsIDEyKSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV90eF9tdXhbXSA9IHsKKwlNU0lPRjFfVFhEX01BUkssCit9OworLyogLSBNU0lPRjIgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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XRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YyX3R4X3BpbnNbXSA9IHsKKwkvKiBUWEQgKi8KKwlSQ0FSX0dQX1BJTigwLCAyOCksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjJfdHhfbXV4W10gPSB7CisJTVNJT0YyX1RYRF9NQVJLLAorfTsKKy8qIC0gTVNJT0YzIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mM19jbGtfcGluc1tdID0geworCS8qIFNDSyAqLworCVJDQVJfR1BfUElOKDUsIDQpLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YzX2Nsa19tdXhbXSA9IHsKKwlNU0lPRjNfU0NLX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjNfc3luY19waW5zW10gPSB7CisJLyogU1lOQyAqLworCVJDQVJfR1BfUElOKDQsIDMwKSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mM19zeW5jX211eFtdID0geworCU1TSU9GM19TWU5DX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjNfc3MxX3BpbnNbXSA9IHsKKwkvKiBTUzEgKi8KKwlSQ0FSX0dQX1BJTig0LCAzMSksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjNfc3MxX211eFtdID0geworCU1TSU9GM19TUzFfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mM19zczJfcGluc1tdID0geworCS8qIFNTMiAqLworCVJDQVJfR1BfUElOKDQsIDI3KSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mM19zczJfbXV4W10gPSB7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DAwMDAsIGxkbzNfMTdfdm9sdF90YWJsZSksCisJUE04MDBfTERPKExETzYsIExET19FTkExXzEsIDUsIDMwMDAwMCwgbGRvM18xN192b2x0X3RhYmxlKSwKKwlQTTgwMF9MRE8oTERPNywgTERPX0VOQTFfMSwgNiwgMzAwMDAwLCBsZG8zXzE3X3ZvbHRfdGFibGUpLAorCVBNODAwX0xETyhMRE84LCBMRE9fRU5BMV8xLCA3LCAzMDAwMDAsIGxkbzNfMTdfdm9sdF90YWJsZSksCisJUE04MDBfTERPKExETzksIExET19FTkExXzIsIDAsIDMwMDAwMCwgbGRvM18xN192b2x0X3RhYmxlKSwKKwlQTTgwMF9MRE8oTERPMTAsIExET19FTkExXzIsIDEsIDMwMDAwMCwgbGRvM18xN192b2x0X3RhYmxlKSwKKwlQTTgwMF9MRE8oTERPMTEsIExET19FTkExXzIsIDIsIDMwMDAwMCwgbGRvM18xN192b2x0X3RhYmxlKSwKKwlQTTgwMF9MRE8oTERPMTIsIExET19FTkExXzIsIDMsIDMwMDAwMCwgbGRvM18xN192b2x0X3RhYmxlKSwKKwlQTTgwMF9MRE8oTERPMTMsIExET19FTkExXzIsIDQsIDMwMDAwMCwgbGRvM18xN192b2x0X3RhYmxlKSwKKwlQTTgwMF9MRE8oTERPMTQsIExET19FTkExXzIsIDUsIDMwMDAwMCwgbGRvM18xN192b2x0X3RhYmxlKSwKKwlQTTgwMF9MRE8oTERPMTUsIExET19FTkExXzIsIDYsIDMwMDAwMCwgbGRvM18xN192b2x0X3RhYmxlKSwKKwlQTTgwMF9MRE8oTERPMTYsIExET19FTkExXzIsIDcsIDMwMDAwMCwgbGRvM18xN192b2x0X3RhYmxlKSwKKwlQTTgwMF9MRE8oTERPMTcsIExET19FTkExXzMsIDAsIDMwMDAwMCwgbGRvM18xN192b2x0X3RhYmxlKSwKKwlQTTgwMF9MRE8oTERPMTgsIExET19FTkExXzMsIDEsIDIwMDAwMCwgbGRvMThfMTlfdm9sdF90YWJsZSksCisJUE04MDB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NfcmVndWxhdG9yc19wZGF0YSAqcmVnbF9wZGF0YSwgaW50IGlkKQoreworCWludCBpOworCisJZm9yIChpID0gMDsgaSA8IHJlZ2xfcGRhdGEtPm5fcmVndWxhdG9yczsgaSsrKSB7CisJCWlmIChpZCA9PSByZWdsX3BkYXRhLT5yZWd1bGF0b3JfZGF0YVtpXS5pZCkKKwkJCXJldHVybiByZWdsX3BkYXRhLT5yZWd1bGF0b3JfZGF0YVtpXS5pbml0ZGF0YTsKKwl9CisKKwlyZXR1cm4gTlVMTDsKK30KKworI2lmZGVmIENPTkZJR19PRgorc3RhdGljIHN0cnVjdCBvZl9yZWd1bGF0b3JfbWF0Y2ggZGE5MDYzX21hdGNoZXNbXSA9IHsKKwlbREE5MDYzX0lEX0JDT1JFMV0gICAgICAgICAgID0geyAubmFtZSA9ICJiY29yZTEiICAgICAgICAgICB9LAorCVtEQTkwNjNfSURfQkNPUkUyXSAgICAgICAgICAgPSB7IC5uYW1lID0gImJjb3JlMiIgICAgICAgICAgIH0sCisJW0RBOTA2M19JRF9CUFJPXSAgICAgICAgICAgICA9IHsgLm5hbWUgPSAiYnBybyIsICAgICAgICAgICAgfSwKKwlbREE5MDYzX0lEX0JNRU1dICAgICAgICAgICAgID0geyAubmFtZSA9ICJibWVtIiwgICAgICAgICAgICB9LAorCVtEQTkwNjNfSURfQklPXSAgICAgICAgICAgICAgPSB7IC5uYW1lID0gImJpbyIsICAgICAgICAgICAgIH0sCisJW0RBOTA2M19JRF9CUEVSSV0gICAgICAgICAgICA9IHsgLm5hbWUgPSAiYnBlcmkiLCAgICAgICAgICAgfSwKKwlbREE5MDYzX0lEX0JDT1JFU19NRVJHRURdICAgID0geyAubmFtZSA9ICJiY29yZXMtbWVyZ2VkIiAgICB9LAorCVtEQTkwNjNfSURfQk1FTV9CSU9fTUVSR0VEXSAgPSB7IC5uYW1lID0gImJtZW0tYmlvLW1lcmdlZCIsIH0sCisJW0RBOTA2M19JRF9MRE8xXSAgICAgICAgICAgICA9IHsgLm5hbWUgPSAibGRvMSIsICAgICAgICAgICAgfSwKKwlbREE5MDYzX0lEX0xETzJdICAgICAgICAgICAgID0geyAubmFtZSA9ICJsZG8yIiwgICAgICAgICAgICB9LAorCVtEQTkwNjNfSURfTERPM10gICAgICAgICAgICAgPSB7IC5uYW1lID0gImxkbzMiLCAgICAgICAgICAgIH0sCisJW0RBOTA2M19JRF9MRE80XSAgICAgICAgICAgICA9IHsgLm5hbWUgPSAibGRvNCIsICAgICAgICAgICAgfSwKKwlbREE5MDYzX0lEX0xETzVdICAgICAgICAgICAgID0geyAubmFtZSA9ICJsZG81IiwgICAgICAgICAgICB9LAorCVtEQTkwNjNfSURfTERPNl0gICAgICAgICAgICAgPSB7IC5uYW1lID0gImxkbzYiLCAgICAgICAgICAgIH0sCisJW0RBOTA2M19JRF9MRE83XSAgICAgICAgICAgICA9IHsgLm5hbWUgPSAibGRvNyIsICAgICAgICAgICAgfSwKKwlbREE5MDYzX0lEX0xETzhdICAgICAgICAgICAgID0geyAubmFtZSA9ICJsZG84IiwgICAgICAgICAgICB9LAorCVtEQTkwNjNfSURfTERPOV0gICAgICAgICAgICAgPSB7IC5uYW1lID0gImxkbzkiLCAgICAgICAgICAgIH0sCisJW0RBOTA2M19JRF9MRE8xMF0gICAgICAgICAgICA9IHsgLm5hbWUgPSAibGRvMTAiLCAgICAgICAgICAgfSwKKwlbREE5MDYzX0lEX0xETzExXSAgICAgICAgICAgID0geyAubmFtZSA9ICJsZG8xMSIsICAgICAgICAgICB9LAorfTsKKworc3RhdGljIHN0cnVjdCBkYTkwNjNfcmVndWxhdG9yc19wZGF0YSAqZGE5MDYzX3BhcnNlX3JlZ3VsYXRvcnNfZHQoCisJCXN0cnVjdCBwbGF0Zm9ybV9kZXZpY2UgKnBkZXYsCisJCXN0cnVjdCBvZl9yZWd1bGF0b3JfbWF0Y2ggKipkYTkwNjNfcmVnX21hdGNoZXMpCit7CisJc3RydWN0IGRhOTA2M19yZWd1bGF0b3JzX3BkY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9nZXRfZHJpdmVyX2luZm8geworCWNoYXIgbmFtZVs4MV07CisJY2hhciBkZXNjcmlwdGlvbls4MV07CisJdTE2IG1ham9yX3JldjsKKwl1MTYgbWlub3JfcmV2OworCXUxNiBidWlsZF9yZXY7CisJdTE2IHJlbGVhc2VfcmV2OworCXUxNiBjc21pX21ham9yX3JldjsKKwl1MTYgY3NtaV9taW5vcl9yZXY7CisJI2RlZmluZSBDU01JX01BSk9SX1JFVl8wXzgxICAgICAgMAorCSNkZWZpbmUgQ1NNSV9NSU5PUl9SRVZfMF84MSAgICAgIDgxCisKKwkjZGVmaW5lIENTTUlfTUFKT1JfUkVWICAgICAgICAgICBDU01JX01BSk9SX1JFVl8wXzgxCisJI2RlZmluZSBDU01JX01JTk9SX1JFViAgICAgICAgICAgQ1NNSV9NSU5PUl9SRVZfMF84MQorfTsKKworc3RydWN0IGF0dG9fY3NtaV9nZXRfcGNpX2J1c19hZGRyIHsKKwl1OCBidXNfbnVtOworCXU4IGRldmljZV9udW07CisJdTggZnVuY3Rpb25fbnVtOworCXU4IHJlc2VydmVkOworfTsKKworc3RydWN0IGF0dG9fY3NtaV9nZXRfY250bHJfY2ZnIHsKKwl1MzIgYmFzZV9pb19hZGRyOworCisJc3RydWN0IHsKKwkJdTMyIGJhc2VfbWVtYWRkcl9sbzsKKwkJdTMyIGJhc2VfbWVtYWRkcl9oaTsKKwl9OworCisJdTMyIGJvYXJkX2lkOworCXUxNiBzbG90X251bTsKKwkjZGVmaW5lIENTTUlfU0xPVF9OVU1fVU5LTk9XTiAgICAweEZGRkYKKworCXU4IGNudGxyX2NsYXNzOworCSNkZWZpbmUgQ1NNSV9DTlRMUl9DTEFTU19IQkEgICAgIDUKKworCXU4IGlvX2J1c190eXBlOworCSNkZWZpbmUgQ1NNSV9CVVNfVFlQRV9QQ0kgICAgICAgIDMKKwkjZGVmaW5lIENTTUlfQlVTX1RZUEVfUENNQ0lBICAgICA0CisKKwl1bmlvbiB7CisJCXN0cnVjdCBhdH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N0IGFzc29jaWF0ZWQgd2l0aCB0aGUgY29kZSBpcyBsaXN0ZWQgYWZ0ZXIgdGhlIGRlZmluaXRpb24gKi8KKyNkZWZpbmUgRVhQUkVTU19JT0NUTF9NSU4gICAgICAgICAgICAgMHg0NTAwCisjZGVmaW5lIEVYUFJFU1NfSU9DVExfUldfRklSTVdBUkUgICAgIDB4NDUwMCAgICAgICAgICAgIC8qIEZJUk1XQVJFUlcgICAgKi8KKyNkZWZpbmUgRVhQUkVTU19JT0NUTF9SRUFEX1BBUkFNUyAgICAgMHg0NTAxICAgICAgICAgICAgLyogUEFSQU1SVyAgICAgICAqLworI2RlZmluZSBFWFBSRVNTX0lPQ1RMX1dSSVRFX1BBUkFNUyAgICAweDQ1MDIgICAgICAgICAgICAvKiBQQVJBTVJXICAgICAgICovCisjZGVmaW5lIEVYUFJFU1NfSU9DVExfRkNfQVBJICAgICAgICAgIDB4NDUwMyAgICAgICAgICAgIC8qIGludGVybmFsICAgICAgKi8KKyNkZWZpbmUgRVhQUkVTU19JT0NUTF9HRVRfQ0hBTk5FTFMgICAgMHg0NTA0ICAgICAgICAgICAgLyogQ0hBTk5FTExJU1QgICAqLworI2RlZmluZSBFWFBSRVNTX0lPQ1RMX0NIQU5fSU5GTyAgICAgICAweDQ1MDUgICAgICAgICAgICAvKiBDSEFOTkVMSU5GTyAgICovCisjZGVmaW5lIEVYUFJFU1NfSU9DVExfREVGQVVMVF9QQVJBTVMgIDB4NDUwNiAgICAgICAgICAgIC8qIFBBUkFNUlcgICAgICAgKi8KKyNkZWZpbmUgRVhQUkVTU19BRERSX01FTU9SWSAgICAgICAgICAgMHg0NTA3ICAgICAgICAgICAgLyogTUVNQUREUiAgICAgICAqLworI2RlZmluZSBFWFBSRVNTX1JXX01FTU9SWSAgICAgICAgICAgICAweDQ1MDggICAgICAgICAgICAvKiBNRU1SVyAgICAgICAgICovCisjZGVmaW5lIEVYUFJFU1NfVFNES19EVU1QICAgICAgICAgICAgIDB4NDUwOSAgICAgICAgICAgIC8qIFRTREtEVU1QICAgICAgKi8KKyNkZWZpbmUgRVhQUkVTU19JT0NUTF9TTVAgICAgICAgICAgICAgMHg0NTBBICAgICAgICAgICAgLyogSU9DVExfU01QICAgICAqLworI2RlZmluZSBFWFBSRVNTX0NTTUkgICAgICAgICAgICAgICAgICAweDQ1MEIgICAgICAgICAgICAvKiBDU01JICAgICAgICAgICovCisjZGVmaW5lIEVYUFJFU1NfSU9DVExfSEJBICAgICAgICAgICAgIDB4NDUwQyAgICAgICAgICAgIC8qIElPQ1RMX0hCQSAgICAgKi8KKyNkZWZpbmUgRVhQUkVTU19JT0NUTF9WREEgICAgICAgICAgICAgMHg0NTBEICAgICAgICAgICAgLyogSU9DVExfVkRBICAgICAqLworI2RlZmluZSBFWFBSRVNTX0lPQ1RMX0dFVF9JRCAgICAgICAgICAweDQ1MEUgICAgICAgICAgICAvKiBHRVRfSUQgICAgICAgICovCisjZGVmaW5lIEVYUFJFU1NfSU9DVExfR0VUX01PRF9JTkZPICAgIDB4NDUwRiAgICAgICAgICAgIC8qIE1PRFVMRV9JTkZPICAgKi8KKyNkZWZpbmUgRVhQUkVTU19JT0NUTF9NQVggICAgICAgICAgICAgMHg0NTBGCisKKyNlbmRpZgpkaWZmIC0tZ2l0IGEvZHJpdmVycy9zY3NpL2VzYXMyci9hdHZkYS5oIGIvZHJpdmVycy9zY3NpL2VzYXMyci9hdHZkYS5oCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjVmYzFmOTkKLS0tIC9kZXYvbnVsbAorKysgYi9kcml2ZXJzL3Njc2kvZXNhczJyL2F0dmRhLmgKQEAgLTAsMCArMSwxMzE5IEBACisvKiAgbGludXgvZHJpdmVycy9zY3NpL2VzYXMyci9hdHZkYS5oCisgKiAgICAgICBBVFRPIFZEQSBpbnRlcmZhY2UgZGVmaW5pdGlvbnMKKyAqCisgKiAgQ29weXJpZ2h0IChjKSAyMDAxLTIwMTMgQVRUTyBUZWN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ICAgICAgICAgMHgwMSAgICAgICAgLyohIGludmFsaWQgY29tbWFuZCBmdW5jdGlvbiAgICAgICAgICovCisjZGVmaW5lIFJTX0JVU1kgICAgICAgICAgICAgMHgwMiAgICAgICAgLyohIGluc3VmZmljaWVudCByZXNvdXJjZXMgICAgICAgICAgICovCisjZGVmaW5lIFJTX1NFTCAgICAgICAgICAgICAgMHgwMyAgICAgICAgLyohIG5vIHRhcmdldCBhdCB0YXJnZXRfaWQgICAgICAgICAgICovCisjZGVmaW5lIFJTX05PX0xVTiAgICAgICAgICAgMHgwNCAgICAgICAgLyohIGludmFsaWQgTFVOICAgICAgICAgICAgICAgICAgICAgICovCisjZGVmaW5lIFJTX1RJTUVPVVQgICAgICAgICAgMHgwNSAgICAgICAgLyohIHJlcXVlc3QgdGltZW91dCAgICAgICAgICAgICAgICAgICovCisjZGVmaW5lIFJTX09WRVJSVU4gICAgICAgICAgMHgwNiAgICAgICAgLyohIGRhdGEgb3ZlcnJ1biAgICAgICAgICAgICAgICAgICAgICovCisjZGVmaW5lIFJTX1VOREVSUlVOICAgICAgICAgMHgwNyAgICAgICAgLyohIGRhdGEgdW5kZXJydW4gICAgICAgICAgICAgICAgICAgICovCisjZGVmaW5lIFJTX1NDU0lfRVJST1IgICAgICAgMHgwOCAgICAgICAgLyohIFNDU0kgZXJyb3Igb2NjdXJyZWQgICAgICAgICAgICAgICovCisjZGVmaW5lIFJTX0FCT1JURUQgICAgICAgICAgMHgwQSAgICAgICAgLyohIGNvbW1hbmQgYWJvcnRlZCAgICAgICAgICAgICAgICAgICovCisjZGVmaW5lIFJTX1JFU0lEX01JU00gICAgICAgMHgwQiAgICAgICAgLyohIHJlc2lkdWFsIGxlbmd0aCBpbmNvcnJlY3QgICAgICAgICovCisjZGVmaW5lIFJTX1RNX0ZBSUxFRCAgICAgICAgMHgwQyAgICAgICAgLyohIHRhc2sgbWFuYWdlbWVudCBmYWlsZWQgICAgICAgICAgICovCisjZGVmaW5lIFJTX1JFU0VUICAgICAgICAgICAgMHgwRCAgICAgICAgLyohIGFib3J0ZWQgZHVlIHRvIGJ1cyByZXNldCAgICAgICAgICovCisjZGVmaW5lIFJTX0VSUl9ETUFfU0cgICAgICAgMHgwRSAgICAgICAgLyohIGVycm9yIHJlYWRpbmcgU0cgbGlzdCAgICAgICAgICAgICovCisjZGVmaW5lIFJTX0VSUl9ETUFfREFUQSAgICAgMHgwRiAgICAgICAgLyohIGVycm9yIHRyYW5zZmVycmluZyBkYXRhICAgICAgICAgICovCisjZGVmaW5lIFJTX1VOU1VQUE9SVEVEICAgICAgMHgxMCAgICAgICAgLyohIHVuc3VwcG9ydGVkIHJlcXVlc3QgICAgICAgICAgICAgICovCisjZGVmaW5lIFJTX1NFTDIgICAgICAgICAgICAgMHg3MCAgICAgICAgLyohIGludGVybmFsIGdlbmVyYXRlZCBSU19TRUwgICAgICAgICovCisjZGVmaW5lIFJTX1ZEQV9CQVNFICAgICAgICAgMHg4MCAgICAgICAgLyohIGJhc2Ugb2YgVkRBLXNwZWNpZmljIGVycm9ycyAgICAgICovCisjZGVmaW5lIFJTX01HVF9CQVNFICAgICAgICAgMHg4MCAgICAgICAgLyohIGJhc2Ugb2YgVkRBIG1hbmFnZW1lbnQgZXJyb3JzICAgICovCisjZGVmaW5lIFJTX1NDQU5fRkFJTCAgICAgICAgKFJTX01HVF9CQVNFICsgMHgwMCkKKyNkZWZpbmUgUlNfREVWX0lOVkFMSUQgICAgICAoUlNfTUdUX0JBU0UgKyAweDAxKQorI2RlZmluZSBSU19ERVZfQVNTSUdORUQgICAgIChSU19NR1RfQkFTRSArIDB4MDIpCisjZGVmaW5lIFJTX0RFVl9SRU1PVkUgICAgICAgKFJTX01HVF9CQVNFICsgMHgwMykKKyNkZWZpbmUgUlNfREVWX0xPU1QgICAgICAgICAoUlNfTUdUX0JBU0UgKyAweDA0KQorI2RlZmluZSBSU19TQ0FOX0dFTiAgICAgICAgIChSU19NR1RfQkFTRSArIDB4MDUpCisjZGVmaW5lIFJTX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SU19GTFNfRVJSX0NIRUNLICAgIChSU19GTFNfQkFTRSArIDB4MDQpCisjZGVmaW5lIFJTX0ZMU19FUlJfRkFJTCAgICAgKFJTX0ZMU19CQVNFICsgMHgwNSkKKyNkZWZpbmUgUlNfRkxTX0VSUl9SU1JDICAgICAoUlNfRkxTX0JBU0UgKyAweDA2KQorI2RlZmluZSBSU19GTFNfRVJSX05PRklMRSAgIChSU19GTFNfQkFTRSArIDB4MDcpCisjZGVmaW5lIFJTX0ZMU19FUlJfRlNJWkUgICAgKFJTX0ZMU19CQVNFICsgMHgwOCkKKyNkZWZpbmUgUlNfQ0ZHX0JBU0UgICAgICAgICAweEMwICAgICAgICAvKiEgYmFzZSBvZiBWREEgY29uZmlndXJhdGlvbiBlcnJvcnMgKi8KKyNkZWZpbmUgUlNfQ0ZHX0VSUl9CVVNZICAgICAoUlNfQ0ZHX0JBU0UgKyAwKQorI2RlZmluZSBSU19DRkdfRVJSX1NHRSAgICAgIChSU19DRkdfQkFTRSArIDEpCisjZGVmaW5lIFJTX0NGR19FUlJfREFURSAgICAgKFJTX0NGR19CQVNFICsgMikKKyNkZWZpbmUgUlNfQ0ZHX0VSUl9USU1FICAgICAoUlNfQ0ZHX0JBU0UgKyAzKQorI2RlZmluZSBSU19ERUdSQURFRCAgICAgICAgIDB4RkIgICAgICAgIC8qISBkZWdyYWRlZCBtb2RlICAgICAgICAgICAgICAgICAgICAqLworI2RlZmluZSBSU19DTElfSU5URVJOQUwgICAgIDB4RkMgICAgICAgIC8qISBWREEgQ0xJIGludGVybmFsIGVycm9yICAgICAgICAgICAqLworI2RlZmluZSBSU19WREFfSU5URVJOQUwgICAgIDB4RkQgICAgICAgIC8qISBjYXRjaC1hbGwgICAgICAgICAgICAgICAgICAgICAgICAqLworI2RlZmluZSBSU19QRU5ESU5HICAgICAgICAgIDB4RkUgICAgICAgIC8qISBwZW5kaW5nLCBub3Qgc3RhcnRlZCAgICAgICAgICAgICAqLworI2RlZmluZSBSU19TVEFSVEV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gYmxvY2tfc2l6ZTsKKwl1OCBkZXZfdHlwZTsKKworCXVuaW9uIHsKKwkJdTggZGV2X3N0YXR1czsKKwkgICAgI2RlZmluZSBWREFERVZTVEFUX0lOVkFMSUQgICAweDAwCisJICAgICNkZWZpbmUgVkRBREVWU1RBVF9DT1JSVVBUICAgVkRBREVWU1RBVF9JTlZBTElECisJICAgICNkZWZpbmUgVkRBREVWU1RBVF9BU1NJR05FRCAgMHgwMQorCSAgICAjZGVmaW5lIFZEQURFVlNUQVRfU1BBUkUgICAgIDB4MDIKKwkgICAgI2RlZmluZSBWREFERVZTVEFUX1VOQVZBSUwgICAweDAzCisJICAgICNkZWZpbmUgVkRBREVWU1RBVF9QVF9NQUlOVCAgMHgwNAorCSAgICAjZGVmaW5lIFZEQURFVlNUQVRfTENMU1BBUkUgIDB4MDUKKwkgICAgI2RlZmluZSBWREFERVZTVEFUX1VOVVNFQUJMRSAweDA2CisJICAgICNkZWZpbmUgVkRBREVWU1RBVF9BVkFJTCAgICAgMHhGRgorCisJCXU4IG9wX2N0cmw7CisJICAgICNkZWZpbmUgVkRBX0RFVl9PUF9DVFJMX1NUQVJUICAgMHgwMQorCSAgICAjZGVmaW5lIFZEQV9ERVZfT1BfQ1RSTF9IQUxUICAgIDB4MDIKKwkgICAgI2RlZmluZSBWREFfREVWX09QX0NUUkxfUkVTVU1FICAweDAzCisJICAgICNkZWZpbmUgVkRBX0RFVl9PUF9DVFJMX0NBTkNFTCAgMHgwNAorCX07CisKKwl1OCBtZW1iZXJfc3RhdGU7CisJI2RlZmluZSBWREFNQlJTVEFURV9PTkxJTkUgICAweDAwCisJI2RlZmluZSBWREFNQlJTVEFURV9ERUdSQURFRCAweDAxCisJI2RlZmluZSBWREFNQlJTVEFURV9VTkFWQUlMICAweDAyCisJI2RlZmluZSBWREFNQlJTVEFURV9GQVVMVEVEICAweDAzCisJI2RlZmluZSBWREFNQlJTVEFURV9NSVNSRUFEICAweDA0CisJI2RlZmluZSBWREFNQlJTVEFURV9JTkNPTVBBVCAweDA1CisKKwl1OCBvcGVyYXRpb247CisJI2RlZmluZSBWREFPUF9OT05FICAgICAgICAgICAweDAwCisJI2RlZmluZSBWREFPUF9SRUJVSUxEICAgICAgICAweDAxCisJI2RlZmluZSBWREFPUF9FUkFTRSAgICAgICAgICAweDAyCisJI2RlZmluZSBWREFPUF9QQVRURVJOICAgICAgICAweDAzCisJI2RlZmluZSBWREFPUF9DT05WRVJTSU9OICAgICAweDA0CisJI2RlZmluZSBWREFPUF9GVUxMX0lOSVQgICAgICAweDA1CisJI2RlZmluZSBWREFPUF9RVUlDS19JTklUICAgICAweDA2CisJI2RlZmluZSBWREFPUF9TRUNUX1NDQU4gICAgICAweDA3CisJI2RlZmluZSBWREFPUF9TRUNUX1NDQU5fUEFSSVRZICAgICAgMHgwOAorCSNkZWZpbmUgVkRBT1BfU0VDVF9TQ0FOX1BBUklUWV9GSVggIDB4MDkKKwkjZGVmaW5lIFZEQU9QX1JFQ09WX1JFQlVJTEQgIDB4MEEKKworCXU4IG9wX3N0YXR1czsKKwkjZGVmaW5lIFZEQU9QU1RBVF9PSyAgICAgICAgIDB4MDAKKwkjZGVmaW5lIFZEQU9QU1RBVF9GQVVMVEVEICAgIDB4MDEKKwkjZGVmaW5lIFZEQU9QU1RBVF9IQUxURUQgICAgIDB4MDIKKwkjZGVmaW5lIFZEQU9QU1RBVF9JTlQgICAgICAgIDB4MDMKKworCXU4IHByb2dyZXNzOyAvKiAwIC0gMTAwJSAqLworCXUxNiBzZXNfZGV2X2luZGV4OworCSNkZWZpbmUgVkRBU0VTRElfSU5WQUxJRCAgICAgMHhGRkZGCisKKwl1OCBzZXJpYWxfbm9bMzJdOworCisJdW5pb24geworCQl1MTYgdGFyZ2V0X2lkOworCSNkZWZpbmUgVkRBVEdUSURfSU5WQUxJRCAgICAgMHhGRkZGCisKKwkJdTE2IGZlYXR1cmVzX21hc2s7CisJfTsKKworCXUxNiBsdW47CisJdTE2IGZlYXR1cmVzOworCSNkZ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KworCS8qCisJICogZm9yIGJhY2t3YXJkIGNvbXBhdGliaWxpdHksIGEgcHJlZmV0Y2ggdmFsdWUgb2YgemVybyBtZWFucyB0aGUKKwkgKiBzZXR0aW5nIGlzIGlnbm9yZWQvdW5zdXBwb3J0ZWQuICB0aGVyZWZvcmUsIHRoZSBmaXJtd2FyZSBzdXBwb3J0ZWQKKwkgKiAwLTYgdmFsdWVzIGFyZSBpbmNyZW1lbnRlZCB0byAxLTcuCisJICovCisKKwl1OCBwcmVmZXRjaDsKKwl1OCBvcF9zdGF0dXM7CisJI2RlZmluZSBWREFHUlBPUFNUQVRfTUFTSyAgICAgICAweDBGCisJI2RlZmluZSBWREFHUlBPUFNUQVRfSU5WQUxJRCAgICAweDAwCisJI2RlZmluZSBWREFHUlBPUFNUQVRfT0sgICAgICAgICAweDAxCisJI2RlZmluZSBWREFHUlBPUFNUQVRfRkFVTFRFRCAgICAweDAyCisJI2RlZmluZSBWREFHUlBPUFNUQVRfSEFMVEVEICAgICAweDAzCisJI2RlZmluZSBWREFHUlBPUFNUQVRfSU5UICAgICAgICAweDA0CisJI2RlZmluZSBWREFHUlBPUFBST0NfTUFTSyAgICAgICAweEYwCisJI2RlZmluZSBWREFHUlBPUFBST0NfU1RBUlRBQkxFICAweDEwCisJI2RlZmluZSBWREFHUlBPUFBST0NfQ0FOQ0VMQUJMRSAweDIwCisJI2RlZmluZSBWREFHUlBPUFBST0NfUkVTVU1BQkxFICAweDQwCisJI2RlZmluZSBWREFHUlBPUFBST0NfSEFMVEFCTEUgICAweDgwCisJdTggb3Zlcl9wcm92aXNpb247CisJdTggcmVzZXJ2ZWRbM107CisKK307CisKKworc3RydWN0IF9fcGFja2VkIGF0dG9fdmRhcGFydF9pbmZvIHsKKwl1OCBwYXJ0X25vOworCSNkZWZpbmUgVkRBX01BWF9QQVJUSVRJT05TICAgMTI4CisKKwljaGFyIGdycF9uYW1lWzE1XTsKKwl1NjQgcGFydF9zaXplOworCXU2NCBzdGFydF9sYmE7C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tYXJ0IHsKKwl1OCBhdHRyaWJfaWQ7CisJdTggY3VycmVudF92YWw7CisJdTggd29yc3Q7CisJdTggdGhyZXNob2xkOworCXU4IHJhd19kYXRhWzZdOworCXU4IHJhd19hdHRyaWJfc3RhdHVzOworCSNkZWZpbmUgVkRBREhTTV9SQVdTVEFUX1BSRUZBSUxfV0FSUkFOVFkgICAgICAgIDB4MDEKKwkjZGVmaW5lIFZEQURIU01fUkFXU1RBVF9PTkxJTkVfQ09MTEVDVElPTiAgICAgICAweDAyCisJI2RlZmluZSBWREFESFNNX1JBV1NUQVRfUEVSRk9STUFOQ0VfQVRUUiAgICAgICAgMHgwNAorCSNkZWZpbmUgVkRBREhTTV9SQVdTVEFUX0VSUk9SX1JBVEVfQVRUUiAgICAgICAgIDB4MDgKKwkjZGVmaW5lIFZEQURIU01fUkFXU1RBVF9FVkVOVF9DT1VOVF9BVFRSICAgICAgICAweDEwCisJI2RlZmluZSBWREFESFNNX1JBV1NUQVRfU0VMRl9QUkVTRVJWSU5HX0FUVFIgICAgMHgyMAorCisJdTggY2FsY19hdHRyaWJfc3RhdHVzOworCSNkZWZpbmUgVkRBREhTTV9DQUxDU1RBVF9VTktOT1dOICAgICAgICAgICAgICAgIDB4MDAKKwkjZGVmaW5lIFZEQURIU01fQ0FMQ1NUQVRfR09PRCAgICAgICAgICAgICAgICAgICAweDAxCisJI2RlZmluZSBWREFESFNNX0NBTENTVEFUX1BSRUZBSUwgICAgICAgICAgICAgICAgMHgwMgorCSNkZWZpbmUgVkRBREhTTV9DQUxDU1RBVF9PTERBR0UgICAgICAgICAgICAgICAgIDB4MDMKKworCXU4IHJlc2VydmVkWzRdOworfTsKKworCitzdHJ1Y3QgX19wYWNrZWQgYXR0b192ZGFfbWV0cmljc19pbmZvIHsKKwl1OCBkYXRhX3ZlcnNpb247CisJI2RlZmluZSBWREFNRVRfVkVSU0lPTjAgICAgICAgICAweDAwCisJI2RlZmluZSBWREFNRVRfVkVSU0lPTiAgICAgICAgICBW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FfYWVfaGRyIGhkcjsKK307CisKKworc3RydWN0IF9fcGFja2VkIGF0dG9fdmRhX2FlX2RldiB7CisJc3RydWN0IGF0dG9fdmRhX2FlX2hkciBoZHI7CisJc3RydWN0IGF0dG9fZGV2X2FkZHIgZGV2YWRkcjsKK307CisKKwordW5pb24gYXR0b192ZGFfYWUgeworCXN0cnVjdCBhdHRvX3ZkYV9hZV9oZHIgaGRyOworCXN0cnVjdCBhdHRvX3ZkYV9hZV9kaXNrIGRpc2s7CisJc3RydWN0IGF0dG9fdmRhX2FlX2x1IGx1OworCXN0cnVjdCBhdHRvX3ZkYV9hZV9yYWlkIHJhaWQ7CisJc3RydWN0IGF0dG9fdmRhX2FlX2xvZyBsb2c7CisJc3RydWN0IGF0dG9fdmRhX2FlX3RpbWVzdGFtcF9sb2cgdHNsb2c7CisJc3RydWN0IGF0dG9fdmRhX2FlX252YyBudmNhY2hlOworCXN0cnVjdCBhdHRvX3ZkYV9hZV9kZXYgZGV2OworfTsKKworCitzdHJ1Y3QgX19wYWNrZWQgYXR0b192ZGFfZGF0ZV9hbmRfdGltZSB7CisJdTggZmxhZ3M7CisJI2RlZmluZSBWREFfRFRfREFZX01BU0sgICAweDA3CisJI2RlZmluZSBWREFfRFRfREFZX05PTkUgICAweDAwCisJI2RlZmluZSBWREFfRFRfREFZX1NVTiAgICAweDAxCisJI2RlZmluZSBWREFfRFRfREFZX01PTiAgICAweDAyCisJI2RlZmluZSBWREFfRFRfREFZX1RVRSAgICAweDAzCisJI2RlZmluZSBWREFfRFRfREFZX1dFRCAgICAweDA0CisJI2RlZmluZSBWREFfRFRfREFZX1RIVSAgICAweDA1CisJI2RlZmluZSBWREFfRFRfREFZX0ZSSSAgICAweDA2CisJI2RlZmluZSBWREFfRFRfREFZX1NBVCAgICAweDA3CisJI2RlZmluZSBWREFfRFRfUE0gICAgICAgICAweDQwCisJI2RlZmluZSBWREFfRFRfTUlMSVRBUlkgICAweDgwCisKKwl1OCBzZWNvbmRzOworCXU4I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gIChFU0FTMlJfTUFYX05VTV9SRVFTICsgRVNBUzJSX05VTV9FWFRSQSkKKworLyoKKyAqIHRoZSBmb2xsb3dpbmcgcmVnaXN0ZXJzIGFyZSBmb3IgdGhlIENQVSBpbnRlcmZhY2UKKyAqLworI2RlZmluZSBNVV9DVExfU1RBVFVTX0lOICAgICAgICAodTMyKSgweDAwMDEwMTA4KQorICAgICNkZWZpbmUgTVVfQ1RMX0lOX0ZVTExfUlNUICAodTMyKSgweDAwMDAwMDIwKQorI2RlZmluZSBNVV9DVExfU1RBVFVTX0lOX0IyICAgICAodTMyKSgweDAwMDEwMTMwKQorICAgICNkZWZpbmUgTVVfQ1RMX0lOX0ZVTExfUlNUMiAodTMyKSgweDgwMDAwMDAwKQorI2RlZmluZSBNVV9ET09SQkVMTF9JTiAgICAgICAgICAodTMyKSgweDAwMDEwNDYwKQorICAgICNkZWZpbmUgRFJCTF9SRVNFVF9CVVMgICAgICAodTMyKSgweDAwMDAwMDAyKQorICAgICNkZWZpbmUgRFJCTF9QQVVTRV9BRSAgICAgICAodTMyKSgweDAwMDAwMDA0KQorICAgICNkZWZpbmUgRFJCTF9SRVNVTUVfQUUgICAgICAodTMyKSgweDAwMDAwMDA4KQorICAgICNkZWZpbmUgRFJCTF9NU0dfSUZDX0RPV04gICAodTMyKSgweDAwMDAwMDEwKQorICAgICNkZWZpbmUgRFJCTF9GTEFTSF9SRVEgICAgICAodTMyKSgweDAwMDAwMDIwKQorICAgICNkZWZpbmUgRFJCTF9GTEFTSF9ET05FICAgICAodTMyKSgweDAwMDAwMDQwKQorICAgICNkZWZpbmUgRFJCTF9GT1JDRV9JTlQgICAgICAodTMyKSgweDAwMDAwMDgwKQorICAgICNkZWZpbmUgRFJCTF9NU0dfSUZDX0lOSVQgICAodTMyKSgweDAwMDAwMTAwKQorICAgICNkZWZpbmUgRFJCTF9QT1dFUl9ET1dOICAgICAodTMyKSgweDAwMDAwMjAwKQorICAgICNkZWZpbmUgRFJCTF9EUlZfVkVSXzEgICAgICAodTMyKSgweDAwMDEwMDAwKQorICAgICNkZWZpbmUgRFJCTF9EUlZfVkVSICAgICAgICBEUkJMX0RSVl9WRVJfMQorI2RlZmluZSBNVV9ET09SQkVMTF9JTl9FTkIgICAgICAodTMyKSgweDAwMDEwNDY0KQorI2RlZmluZSBNVV9ET09SQkVMTF9PVVQgICAgICAgICAodTMyKSgweDAwMDEwNDgwKQorICNkZWZpbmUgRFJCTF9QQU5JQ19SRUFTT05fTUFTSyAodTMyKSgweDAwRjAwMDAwKQorICAgICNkZWZpbmUgRFJCTF9VTlVTRURfSEFORExFUiAodTMyKSgweDAwMTAwMDAwKQorICAgICNkZWZpbmUgRFJCTF9VTkRFRl9JTlNUUiAgICAodTMyKSgweDAwMjAwMDAwKQorICAgICNkZWZpbmUgRFJCTF9QUkVGRVRDSF9BQk9SVCAodTMyKSgweDAwMzAwMDAwKQorICAgICNkZWZpbmUgRFJCTF9EQVRBX0FCT1JUICAgICAodTMyKSgweDAwNDAwMDAwKQorICAgICNkZWZpbmUgRFJCTF9KVU1QX1RPX1pFUk8gICAodTMyKSgweDAwNTAwMDAwKQorICAjZGVmaW5lIERSQkxfRldfUkVTRVQgICAgICAgICAodTMyKSgweDAwMDgwMDAwKQorICAjZGVmaW5lIERSQkxfRldfVkVSX01TSyAgICAgICAodTMyKSgweDAwMDcwMDAwKQorICAjZGVmaW5lIERSQkxfRldfVkVSXzAgICAgICAgICAodTMyKSgweDAwMDAwMDAwKQorICAjZGVmaW5lIERSQkxfRldfVkVSXzEgICAgICAgICAodTMyKSgweDAwMDEwMDAwKQorICAjZGVmaW5lIERSQkxfRldfVkVSICAgICAgICAgICBEUkJMX0ZXX1ZFUl8xCisjZGVmaW5lIE1VX0RPT1JCRUxMX09VVF9FTkIgICAgICh1MzIpKDB4MDAwMTA0ODQpCisgICAgI2RlZmluZSBEUkJMX0VOQl9NQVNLICAgICAgICh1MzIpKDB4MDBGODAzRkYpCisjZGVmaW5lIE1VX0lOVF9TVEFU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jZGVmaW5lIGVzYXMycl9udnJhbWNhbGNfeG9yX2Nrc3VtKG4pICBcCisJKGVzYXMycl9jYWxjX2J5dGVfeG9yX2Nrc3VtKCh1OCAqKShuKSwgXAorCQkJCSAgICBzaXplb2Yoc3RydWN0IGVzYXMycl9zYXNfbnZyYW0pLCAwKSkKKworI2RlZmluZSBFU0FTMlJfRlNfRFJWUl9WRVIgMgorCitzdGF0aWMgc3RydWN0IGVzYXMycl9zYXNfbnZyYW0gZGVmYXVsdF9zYXNfbnZyYW0gPSB7CisJeyAnRScsCSdTJywgICdBJywgICdTJwkJCSAgICAgfSwgLyogc2lnbmF0dXJlICAgICAgICAgICovCisJU0FTTlZSX1ZFUlNJT04sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogdmVyc2lvbiAgICAgICAgICAgICovCisJMCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogY2hlY2tzdW0gICAgICAgICAgICovCisJMzEsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbWF4X2x1bl9mb3JfdGFyZ2V0ICovCisJU0FTTlZSX1BDSUxBVF9NQVgsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogcGNpX2xhdGVuY3kgICAgICAgICovCisJU0FTTlZSMV9CT09UX0RSVlIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogb3B0aW9uczEgICAgICAgICAgICovCisJU0FTTlZSMl9IRUFSVEJFQVQgICB8IFNBU05WUjJfU0lOR0xFX0JVUyAgICAgICAgLyogb3B0aW9uczIgICAgICAgICAgICovCisJfCBTQVNOVlIyX1NXX01VWF9DVFJMLAorCVNBU05WUl9DT0FMX0RJUywgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGludF9jb2FsZXNjaW5nICAgICAqLworCVNBU05WUl9DTURUSFJfTk9ORSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGNtZF90aHJvdHRsZSAgICAgICAqLworCTMsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGRldl93YWl0X3RpbWUgICAgICAqLworCTEsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGRldl93YWl0X2NvdW50ICAgICAqLworCTAsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHNwaW5fdXBfZGVsYXkgICAgICAqLworCTAsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHNzcF9hbGlnbl9yYXRlICAgICAqLworCXsgMHg1MCwgMHgwMSwgMHgwOCwgMHg2MCwgICAgICAgICAgICAgICAgICAgICAgIC8qIHNhc19hZGRyICAgICAgICAgICAqLworCSAgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCB9LAorCXsgU0FTTlZSX1NQRUVEX0FVVE8gfSwgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHBoeV9zcGVlZCAgICAgICAgICAqLworCXsgU0FTTlZSX01VWF9ESVNBQkxFRCB9LCAgICAgICAgICAgICAgICAgICAgICAgIC8qIFNBUyBtdWx0aXBsZXhpbmcgICAqLworCXsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHBoeV9mbGFncyAgICAgICAgICAqLworCVNBU05WUl9TT1JUX1NBU19BRERSLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHNvcnRfdHlwZSAgICAgICAgICAqLworCTMsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGRwbV9yZXFjbWRfbG10ICAgICAqLworCTMsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGRwbV9zdG5kYnlfdGltZSAgICAqLworCTAsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGRwbV9hY3RpdmVfdGltZSAgICAqLworCXsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHBoeV90YXJnZXRfaWQgICAgICAqLworCVNBU05WUl9WU01IX0RJU0FCTEVELCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHZpcnRfc2VzX21vZGUgICAgICAqLworCVNBU05WUl9SV01fREVGQVVMVCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHJlYWRfd3JpdGVfbW9kZSAgICAqLworCTAsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGxpbmsgZG93biB0aW1lb3V0ICAqLworCXsgMCB9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHJlc2VydmVkICAgICAgICAgICAqLworfTsKKworc3RhdGljIHU4IGNtZF90b19mbHNfZnVuY1tdID0geworCTB4RkYsCisJVkRBX0ZMQVNIX1JFQUQsCisJVkRBX0ZMQVNIX0JFR0lOVywKKwlWREFfRkxBU0hfV1JJVEUsCisJVkRBX0ZMQVNIX0NPTU1JVCwKKwlWREFfRkxBU0hfQ0FOQ0VMCit9OworCitzdGF0aWMgdTggZXNhczJyX2NhbGNfYnl0ZV94b3JfY2tzdW0odTggKmFkZHIsIHUzMiBsZW4sIHU4IHNlZWQpCit7CisJdTMyIGNrc3VtID0gc2VlZDsKKwl1OCAqcCA9ICh1OCAqKSZja3N1bTsKKworCXdoaWxlIChsZW4pIHsKKwkJaWYgKCgodWludHB0cl90KWFkZHIgJiAzKSA9PSAwKQorCQkJYnJlYWs7CisKKwkJY2tzdW0gPSBja3N1bSBeICphZGRyOworCQlhZGRyKys7CisJCWxlbi0tOworCX0KKwl3aGlsZSAobGVuID49IHNpemVvZih1MzIpKSB7CisJCWNrc3VtID0gY2tzdW0gXiAqKHUzMiAqKWFkZHI7CisJCWFkZHIgKz0gNDsKKwkJbGVuIC09IDQ7CisJfQorCXdoaWxlIChsZW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ogCQlpZiAoKGlyc3AtPnVscFN0YXR1cyA9PSBJT1NUQVRfTE9DQUxfUkVKRUNUKSAmJgpkaWZmIC0tZ2l0IGEvZHJpdmVycy9zY3NpL2xwZmMvbHBmY19kaXNjLmggYi9kcml2ZXJzL3Njc2kvbHBmYy9scGZjX2Rpc2MuaAppbmRleCBhZjQ5ZmIwLi5lNDA5YmE1IDEwMDY0NAotLS0gYS9kcml2ZXJzL3Njc2kvbHBmYy9scGZjX2Rpc2MuaAorKysgYi9kcml2ZXJzL3Njc2kvbHBmYy9scGZjX2Rpc2MuaApAQCAtMSw3ICsxLDcgQEAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgKiBUaGlzIGZpbGUgaXMgcGFydCBvZiB0aGUgRW11bGV4IExpbnV4IERldmljZSBEcml2ZXIgZm9yICAgICAgICAgKgogICogRmlicmUgQ2hhbm5lbCBIb3N0IEJ1cyBBZGFwdGVycy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqIENvcHlyaWdodCAoQykgMjAwNC0yMDA4IEVtdWxleC4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuICAgICAgICAgICAqCisgKiBDb3B5cmlnaHQgKEMpIDIwMDQtMjAxMyBFbXVsZXguICBBbGwgcmlnaHRzIHJlc2VydmVkLiAgICAgICAgICAgKgogICogRU1VTEVYIGFuZCBTTEkgYXJlIHRyYWRlbWFya3Mgb2YgRW11bGV4LiAgICAgICAgICAgICAgICAgICAgICAgICoKICAqIHd3dy5lbXVsZXguY29tICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCiAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgpAQCAtMTU0LDYgKzE1NCw3IEBACiAjZGVmaW5lIE5MUF9OT0RFVl9SRU1PVkUgICAweDA4MDAwMD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mMgYi9kcml2ZXJzL3Njc2kvbHBmYy9scGZjX3Zwb3J0LmMKaW5kZXggZTI4ZTQzMS4uYTg3ZWUzMyAxMDA2NDQKLS0tIGEvZHJpdmVycy9zY3NpL2xwZmMvbHBmY192cG9ydC5jCisrKyBiL2RyaXZlcnMvc2NzaS9scGZjL2xwZmNfdnBvcnQuYwpAQCAtMSw3ICsxLDcgQEAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgKiBUaGlzIGZpbGUgaXMgcGFydCBvZiB0aGUgRW11bGV4IExpbnV4IERldmljZSBEcml2ZXIgZm9yICAgICAgICAgKgogICogRmlicmUgQ2hhbm5lbCBIb3N0IEJ1cyBBZGFwdGVycy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqIENvcHlyaWdodCAoQykgMjAwNC0yMDA4IEVtdWxleC4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuICAgICAgICAgICAqCisgKiBDb3B5cmlnaHQgKEMpIDIwMDQtMjAxMyBFbXVsZXguICBBbGwgcmlnaHRzIHJlc2VydmVkLiAgICAgICAgICAgKgogICogRU1VTEVYIGFuZCBTTEkgYXJlIHRyYWRlbWFya3Mgb2YgRW11bGV4LiAgICAgICAgICAgICAgICAgICAgICAgICoKICAqIHd3dy5lbXVsZXguY29tICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCiAgKiBQb3J0aW9ucyBDb3B5cmlnaHQgKEMpIDIwMDQtMjAwNSBDaHJpc3RvcGggSGVsbHdpZyAgICAgICAgICAgICAgKgpAQCAtMzg3LDYgKzM4Nyw5IEBACiAJLyogQ3JlYXRlIGJpbmFyeSBzeXNmcyBhdHRyaWJ1dGUgZm9yIHZwb3J0ICovCiAJbHBmY19hbGxvY19zeXNmc19hdHRyKHZwb3J0KTsKIAorCS8qIFNldCB0aGUgREZUX0xVTl9RX0RFUFRIIGFj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aXQgYW5kIFByb2JlICAgICAgICB8ICAgICAgIDB4MDE0ZiAgICAgICB8IDB4NGIsMHhiYSwweGZhIHwKLSAqIHwgTWFpbGJveCBjb21tYW5kcyAgICAgICAgICAgICB8ICAgICAgIDB4MTE3YSAgICAgICB8IDB4MTExYS0weDExMWIgIHwKKyAqIHwgTW9kdWxlIEluaXQgYW5kIFByb2JlICAgICAgICB8ICAgICAgIDB4MDE1OSAgICAgICB8IDB4NGIsMHhiYSwweGZhIHwKKyAqIHwgTWFpbGJveCBjb21tYW5kcyAgICAgICAgICAgICB8ICAgICAgIDB4MTE4MSAgICAgICB8IDB4MTExYS0weDExMWIgIHwKICAqIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8IDB4MTE1NS0weDExNTggIHwKKyAqIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8IDB4MTAxOC0weDEwMTkgIHwKKyAqIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8IDB4MTExNS0weDExMTYgIHwKKyAqIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8IDB4MTBjYQkJfAogICogfCBEZXZpY2UgRGlzY292ZXJ5ICAgICAgICAgICAgIHwgICAgICAgMHgyMDk1ICAgICAgIHwgMHgyMDIwLTB4MjAyMiwgfAogICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHgyMDExLTB4MjAxMiwgfAogICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHgyMDE2ICAgICAgICAgfApAQCAtMjQsMTEgKzI3LDEyIEBACiAgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDMwMzYsMHgzMDM4ICB8CiAgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDMwM2EJCXwKICAqIHwgRFBDIFRocmVhZCAgICAgICAgICAgICAgICAgICB8ICAgICAgIDB4NDAyMiAgICAgICB8IDB4NDAwMiwweDQwMTMgIHwKLSAqIHwgQXN5bmMgRXZlbnRzICAgICAgICAgICAgICAgICB8ICAgICAgIDB4NTA4MSAgICAgICB8IDB4NTAyYi0weDUwMmYgIHwKKyAqIHwgQXN5bmMgRXZlbnRzICAgICAgICAgICAgICAgICB8ICAgICAgIDB4NTA4NyAgICAgICB8IDB4NTAyYi0weDUwMmYgIHwKICAqIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8IDB4NTA0NywweDUwNTIgIHwKLSAqIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8IDB4NTA0MCwweDUwNzUgIHwKLSAqIHwgVGltZXIgUm91dGluZXMgICAgICAgICAgICAgICB8ICAgICAgIDB4NjAxMSAgICAgICB8ICAgICAgICAgICAgICAgIHwKLSAqIHwgVXNlciBTcGFjZSBJbnRlcmFjdGlvbnMgICAgICB8ICAgICAgIDB4NzBkZCAgICAgICB8IDB4NzAxOCwweDcwMmUsIHwKKyAqIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8IDB4NTA4NCwweDUwNzUJfAorICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHg1MDNkLDB4NTA0NCAgfAorICogfCBUaW1lciBSb3V0aW5lcyAgICAgICAgICAgICAgIHwgICAgICAgMHg2MDEyICAgICAgIHwgICAgICAgICAgICAgICAgfAorICogfCBVc2VyIFNwYWNlIEludGVyYWN0aW9ucyAgICAgIHwgICAgICAgMHg3MGUxICAgICAgIHwgMHg3MDE4LDB4NzAyZSwgfAogICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHg3MDIwLDB4NzAyNCwgfAogICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHg3MDM5LDB4NzA0NSwgfAogICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHg3MDczLTB4NzA3NSwgfApAQCAtMzYsMTcgKzQwLDI4IEBACiAgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDcwYTUsMHg3MGE2LCB8CiAgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDcwYTgsMHg3MGFiLCB8CiAgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDcwYWQtMHg3MGFlLCB8Ci0gKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDcwZDEtMHg3MGRhLCB8CisgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDcwZDEtMHg3MGRiLCB8CiAgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDcwNDcsMHg3MDNiCXwKLSAqIHwgVGFzayBNYW5hZ2VtZW50ICAgICAgICAgICAgICB8ICAgICAgIDB4ODAzYyAgICAgICB8IDB4ODAyNS0weDgwMjYgIHwKKyAqIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8IDB4NzBkZS0weDcwZGYsIHwKKyAqIHwgVGFzayBNYW5hZ2VtZW50ICAgICAgICAgICAgICB8ICAgICAgIDB4ODAzZCAgICAgICB8IDB4ODAyNS0weDgwMjYgIHwKICAqIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8IDB4ODAwYiwweDgwMzkgIHwKICAqIHwgQUVSL0VFSCAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgIDB4OTAxMSAgICAgICB8CQl8CiAgKiB8IFZpcnR1YWwgUG9ydCAgICAgICAgICAgICAgICAgfCAgICAgICAweGEwMDcgICAgICAgfAkJfAotICogfCBJU1A4MlhYIFNwZWNpZmljICAgICAgICAgICAgIHwgICAgICAgMHhiMDg2ICAgICAgIHwgMHhiMDAyLDB4YjAyNCAgfAorICogfCBJU1A4MlhYIFNwZWNpZmljICAgICAgICAgICAgIHwgICAgICAgMHhiMTRjICAgICAgIHwgMHhiMDAyLDB4YjAyNCAgfAorICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHhiMDllLDB4YjBhZSAgfAorICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHhiMGUwLTB4YjBlZiAgfAorICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHhiMDg1LDB4YjBkYyAgfAorICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHhiMTA3LDB4YjEwOCAgfAorICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHhiMTExLDB4YjExZSAgfAorICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHhiMTJjLDB4YjEyZCAgfAorICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHhiMTNhLDB4YjE0MiAgfAorICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAg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wMDAKLTAwMDAwMDAwMSAgMTExMTExMTExMSAgICAgMTAwMDAwCi0wMDAwMDAwMSAgIDExMTExMTExMTExICAgIDEwMDAwMAotMDAwMDAwMDEgIDExMTExMTExMTExMSAgICAgMTAwMDAKLTAwMDAwMDEgICAxMTExMTExMTExMTEgICAgIDEwMDAwCi0wMDAwMDAxICAgMTExMTExMTExMTExICAgICAxMDAwMAotMDAwMDAwMSAgIDExMTExMTExMTExMSAgICAgMTAwMDAKLTAwMDAwMDEgICAxMTExMTExMTExMTEgICAgIDEwMDAwCi0wMDAwMDAwMTEgMTExMTExMTExMTEgICAgICAxMDAwMAotMDAwMDExIDExICAxMTExMTExMTExMSAgICAxMDAwMDAKLTAwMDEgIDExMTEgIDExMTExMTExMTExMTExMSAxMDAwCi0wMDEgMTExMTExMSAgMTExMTExMTExMTExMTEgMTAwMAotMDAxIDExMTExMTEgIDExMTExMTEgIDExMTExMSAxMDAKLTAwMSAxMTExMTExMSAxMTExMTEgICAxMTExMTExIDEwCi0wMDEgMTExMTExMTEgICAgICAgICAgMTExMTEgIDEwMAotMDAxICAxMTExMTExICAgICAgICAgIDExMSAgMTExMDAKLTAwMDExMSAgIDExMSAgIDExMTExICAxMSAgMTAwMDAwCi0wMDAwMDAxMTEgICAxMTExMTExMTEgICAgMTAwMDAwMApkaWZmIC0tZ2l0IGEvZHJpdmVycy9zdGFnaW5nL2FzdXNfb2xlZC90dXhfci50eHQgYi9kcml2ZXJzL3N0YWdpbmcvYXN1c19vbGVkL3R1eF9yLnR4dApkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggZmQ4MWEzZS4uMDAwMDAwMAotLS0gYS9kcml2ZXJzL3N0YWdpbmcvYXN1c19vbGVkL3R1eF9yLnR4dAorKysgL2Rldi9udWxsCkBAIC0xLDMzICswLDAgQEAKLTxyOjMyeDMyPgotMDAwMDAwMDAwMDAwMDExMTExMTEwMDAwMDAwMDAwMDAKLTAwMDAwMDAwMDAwMDEgICAgICAgMTAwMDAwMDAwMDAwCi0wMDAwMDAwMDAwMDEgICAgICAgICAxMDAwMDAwMDAwMAotMDAwMDAwMDAwMDAxICAgICAgICAgMTAwMDAwMDAwMDAKLTAwMDAwMDAwMDAwMSAgICAgICAgIDEwMDAwMDAwMDAwCi0wMDAwMDAwMDAwMDEgMSAgMTExICAxMDAwMDAwMDAwMAotMDAwMDAwMDAwMDAxICAgIDEgMSAgIDEwMDAwMDAwMDAKLTAwMDAwMDAwMDAwMSAgMTExICAgICAxMDAwMDAwMDAwCi0wMDAwMDAwMDAwMDEgMTExMTExICAgMTAwMDAwMDAwMAotMDAwMDAwMDAwMDAxIDExMTExMSAgIDEwMDAwMDAwMDAKLTAwMDAwMDAwMDAwMSAgICAxIDEgICAgMTAwMDAwMDAwCi0wMDAwMDAwMDAwMSAgICAgIDExICAgIDEwMDAwMDAwMAotMDAwMDAwMDAwMDEgMTExMTExMTEgICAgMTAwMDAwMDAKLTAwMDAwMDAwMDEgIDExMTExMTExICAgICAxMDAwMDAwCi0wMDAwMDAwMDEgICAxMTExMTExMTEgICAgMTAwMDAwMAotMDAwMDAwMDAxICAxMTExMTExMTExICAgICAxMDAwMDAKLTAwMDAwMDAxICAgMTExMTExMTExMTEgICAgMTAwMDAwCi0wMDAwMDAwMSAgMTExMTExMTExMTExICAgICAxMDAwMAotMDAwMDAwMSAgIDExMTExMTExMTExMSAgICAgMTAwMDAKLTAwMDAwMDEgICAxMTExMTExMTExMTEgICAgIDEwMDAwCi0wMDAwMDAxICAgMTExMTExMTExMTExICAgICAxMDAwMAotMDAwMDAwMSAgIDExMTExMTExMTExMSAgICAgMTAwMDAKLTAwMDAwMDAxMSAxMTExMTExMTExMSAgICAgIDEwMDAwCi0wMDAwMTEgMTEgIDExMTExMTExMTExICAgIDEwMDAwMAotMDAwMSAgMTExMSAgMTExMTExMTExMTExMTExIDEwMDAKLTAwMSAxMTExMTExICAxMTExMTExMTExMTExMSAxMDAwCi0wMDEgMTExMTExMSAgMTExMTExMSA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AgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgYl9UaW1lck1vZGUsICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVUxPTkdfIHVsX1JlbG9hZFZhbHVlLCAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgIGJfSW5wdXRDbG9ja1NlbGVjdGlvbiwgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgYl9JbnB1dENsb2NrTGV2ZWwsICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICBiX091dHB1dExldmVsLCAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgIGJfSGFyZHdhcmVHYXRlTGV2ZWwpCi1pbnQgaV9JbnNuQ29uZmlnX0luaXRUaW1lcihzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2LHN0cnVjdCBjb21lZGlfc3ViZGV2aWNlICpzLAotCXN0cnVjdCBjb21lZGlfaW5zbiAqaW5zbix1bnNpZ25lZCBpbnQgKmRhdGEpCi18Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgVGFzayAgICAgICAgICAgICAgOiBDb25maWd1cmUgdGhlIFRpbWVyIChiX1RpbWVyTmJyKSBvcGVyYXRpbmcgbW9kZSAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIChiX1RpbWVyTW9kZSkgZnJvbSBzZWxlY3RlZCBtb2R1bGUgKGJfTW9kdWxOYnIpLiAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgWW91IG11c3QgY2FsbGluZyB0aGlzIGZ1bmN0aW9uIGJlIGZvciB5b3UgY2FsbCBhbnkgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBvdGhlciBmdW5jdGlvbiB3aXRjaCBhY2Nlc3Mgb2YgdGhlIHRpbWVyLiAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgIFRpbWVyIG1vZGUgZGVzY3JpcHRpb24gdGFibGUgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18Ky0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tK3wKLXx8U2VsZWN0ZWQrICAgICAgTW9kZSBkZXNjcmlwdGlvbiAgICAgICArdV9SZWxvYWRWYWx1ZSB8IEhhcmR3YXJlIGdhdGUgaW5wdXR8fAotfHwgIG1vZGUgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgIGRlc2NyaXB0aW9uIHwgICAgICBhY3Rpb24gICAgICAgIHx8Ci18Ky0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tK3wKLXx8ICAgICAgICB8TW9kZSAwIGlzIHR5cGljYWxseSB1c2VkICAgICB8ICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8fAotfHwgICAgICAgIHxmb3IgZXZlbnQgY291bnRpbmcuIEFmdGVyICAgIHwgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHx8Ci18fCAgICAgICAgfHRoZSBpbml0aWFsaXNhdGlvbiwgT1VUICAgICAgfCAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfHwKLXx8ICAgICAgICB8aXMgaW5pdGlhbGx5IGxvdywgYW5kICAgICAgICB8ICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8fAotfHwgICAwICAgIHx3aWxsIHJlbWFpbiBsb3cgdW50aWwgdGhlICAgIHxTdGFydCBjb3VudGluZ3wgICBIYXJkd2FyZSBnYXRlICAgIHx8Ci18fCAgICAgICAgfGNvdW50ZXIgcmVhY2hlcyB6ZXJvLiAgICAgICAgfCAgIHZhbHVlICAgICAgfCAgICAgICAgICAgICAgICAgICAgfHwKLXx8ICAgICAgICB8T1VUIHRoZW4gZ29lcyBoaWdoIGFuZCAgICAgICB8ICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8fAotfHwgICAgICAgIHxyZW1haW5zIGhpZ2ggdW50aWwgYSBuZXcgICAgIHwgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHx8Ci18fCAgICAgICAgfGNvdW50IGlzIHdyaXR0ZW4uIFNlZSAgICAgICAgfCAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfHwKLXx8ICAgICAgICB8ImlfQVBDSTE3MTBfV3JpdGVUaW1lclZhbHVlIiB8ICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8fAotfHwgICAgICAgIHxmdW5jdGlvbi4gICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHx8Ci18Ky0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tK3wKLXx8ICAgICAgICB8TW9kZSAxIGlzIHNpbWlsYXIgdG8gbW9kZSAwICB8ICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8fAotfHwgICAgICAgIHxleGNlcHQgZm9yIHRoZSBnYXRlIGlucHV0ICAgIHwgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHx8Ci18fCAgIDEgICAgfGFjdGlvbi4gVGhlIGdhdGUgaW5wdXQgaXMgbm90fFN0YXJ0IGNvdW50aW5nfCAgSGFyZHdhcmUgdHJpZ2dlciAgfHwKLXx8ICAgICAgICB8dXNlZCBmb3IgZW5hYmxlZCBvciBkaXNhYmxlZCB8ICAgdmFsdWUgICAgICB8ICAgICAgICAgICAgICAgICAgICB8fAotfHwgICAgICAgIHx0aGUgdGltZXIuICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHx8Ci18fCAgICAgICAgfFRoZSBnYXRlIGlucHV0IGlzIHVzZWQgZm9yICAgfCAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfHwKLXx8ICAgICAgICB8dHJpZ2dlcmVkIHRoZSB0aW1lci4gICAgICAgICB8ICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8fAotfCstLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLSt8Ci18fCAgICAgICAgfFRoaXMgbW9kZSBmdW5jdGlvbnMgbGlrZSBhICAgfCAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfHwKLXx8ICAgICAgICB8ZGl2aWRlLWJ5LXVsX1JlbG9hZFZhbHVlICAgICB8ICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8fAotfHwgICAgICAgIHxjb3VudGVyLiBJdCBpcyB0eXBpY2FsbHkgdXNlZHwgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHx8Ci18fCAgICAgICAgfHRvIGdlbmVyYXRlIGEgcmVhbCB0aW1lIGNsb2NrfCAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfHwKLXx8ICAgICAgICB8aW50ZXJydXB0LiBPVVQgd2lsbCBpbml0aWFsbHl8ICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8fAotfHwgICAyICAgIHxiZSBoaWdoIGFmdGVyIHRoZSAgICAgICAgICAgIHwgICBEaXZpc2lvbiAgIHwgIEhhcmR3YXJlIGdhdGUgICAgIHx8Ci18fCAgICAgICAgfGluaXRpYWxpc2F0aW9uLiBXaGVuIHRoZSAgICAgfCAgICBmYWN0b3IgICAgfCAgICAgICAgICAgICAgICAgICAgfHwKLXx8ICAgICAgICB8aW5pdGlhbCBjb3VudCBoYXMgZGVjcmVtZW50ZWR8ICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8fAotfHwgICAgICAgIHx0byAxLCBPVVQgZ29lcyBsb3cgZm9yIG9uZSAgIHwgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHx8Ci18fCAgICAgICAgfENMSyBwdWxlLiBPVVQgdGhlbiBnb2VzIGhpZ2ggfCAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfHwKLXx8ICAgICAgICB8YWdhaW4sIHRoZSBjb3VudGVyIHJlbG9hZHMgICB8ICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8fAotfHwgICAgICAgIHx0aGUgaW5pdGlhbCBjb3VudCAgICAgICAgICAgIHwgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHx8Ci18fCAgICAgICAgfCh1bF9SZWxvYWRWYWx1ZSkgYW5kIHRoZSAgICAgfCAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfHwKLXx8ICAgICAgICB8cHJvY2VzcyBpcyByZXBlYXRlZC4gICAgICAgICB8ICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8fAotfHwgICAgICAgIHxUaGlzIGFjdGlvbiBjYW4gZ2VuZXJhdGVkIGEgIHwgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHx8Ci18fCAgICAgICAgfGludGVycnVwdC4gU2VlIGZ1bmN0aW9uICAgICAgfCAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfHwKLXx8ICAgICAgICB8ImlfQVBDSTE3MTBfU2V0Qm9hcmRJbnQtICAgICB8ICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8fAotfHwgICAgICAgIHxSb3V0aW5lWCIgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHx8Ci18fCAgICAgICAgfGFuZCAiaV9BUENJMTcxMF9FbmFibGVUaW1lciIgfCAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfHwKLXwrLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0rfAotfHwgICAgICAgIHxNb2RlIDMgaXMgdHlwaWNhbGx5IHVzZWQgZm9yIHwgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHx8Ci18fCAgICAgICAgfGJhdWQgcmF0ZSBnZW5lcmF0aW9uLiBUaGlzICAgfCAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfHwKLXx8ICAgICAgICB8bW9kZSBpcyBzaW1pbGFyIHRvIG1vZGUgMiAgICB8ICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8fAotfHwgICAgICAgIHxleGNlcHQgZm9yIHRoZSBkdXR5IGN5Y2xlIG9mIHwgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHx8Ci18fCAgIDMgICAgfE9VVC4gT1VUIHdpbGwgaW5pdGlhbGx5IGJlICAgfCAgRGl2aXNpb24gICAgfCAgIEhhcmR3YXJlIGdhdGUgICAgfHwKLXx8ICAgICAgICB8aGlnaCBhZnRlciB0aGUgaW5pdGlhbGlzYXRpb258ICAgZmFjdG9yICAgICB8ICAgICAgICAgICAgICAgICAgICB8fAotfHwgICAgICAgIHxXaGVuIGhhbGYgdGhlIGluaXRpYWwgY291bnQgIHwgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHx8Ci18fCAgICAgICAgfCh1bF9SZWxvYWRWYWx1ZSkgaGFzIGV4cGlyZWQsfCAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfHwKLXx8ICAgICAgICB8T1VUIGdvZXMgbG93IGZvciB0aGUgICAgICAgICB8ICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8fAotfHwgICAgICAgIHxyZW1haW5kZXIgb2YgdGhlIGNvdW50LiBUaGUgIHwgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHx8Ci18fCAgICAgICAgfG1vZGUgaXMgcGVyaW9kaWM7IHRoZSAgICAgICAgfCAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfHwKLXx8ICAgICAgICB8c2VxdWVuY2UgYWJvdmUgaXMgcmVwZWF0ZWQgICB8ICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8fAotfHwgICAgICAgIHxpbmRlZmluaXRlbHkuICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHx8Ci18Ky0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tK3wKLXx8ICAgICAgICB8T1VUIHdpbGwgYmUgaW5pdGlhbGx5IGhpZ2ggICB8ICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8fAotfHwgICAgICAgIHxhZnRlciB0aGUgaW5pdGlhbGlzYXRpb24uICAgIHwgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHx8Ci18fCAgICAgICAgfFdoZW4gdGhlIGluaXRpYWwgY291bnQgICAgICAgfCAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfHwKLXx8ICAgNCAgICB8ZXhwaXJlcyBPVVQgd2lsbCBnbyBsb3cgZm9yICB8U3RhcnQgY291bnRpbmd8ICBIYXJkd2FyZSBnYXRlICAgICB8fAotfHwgICAgICAgIHxvbmUgQ0xLIHB1bHNlIGFuZCB0aGVuIGdvICAgIHwgICAgdmFsdWUgICAgIHwgICAgICAgICAgICAgICAgICAgIHx8Ci18fCAgICAgICAgfGhpZ2ggYWdhaW4uICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfHwKLXx8ICAgICAgICB8VGhlIGNvdW50aW5nIHNlcXVlbmNlcyBpcyAgICB8ICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8fAotfHwgICAgICAgIHx0cmlnZ2VyZWQgYnkgd3JpdGluZyBhIG5ldyAgIHwgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHx8Ci18fCAgICAgICAgfHZhbHVlLiBTZWUgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfHwKLXx8ICAgICAgICB8ImlfQVBDSTE3MTBfV3JpdGVUaW1lclZhbHVlIiB8ICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8fAotfHwgICAgICAgIHxmdW5jdGlvbi4gSWYgYSBuZXcgY291bnQgaXMgIHwgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHx8Ci18fCAgICAgICAgfHdyaXR0ZW4gZHVyaW5nIGNvdW50aW5nLCAgICAgfCAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfHwKLXx8ICAgICAgICB8aXQgd2lsbCBiZSBsb2FkZWQgb24gdGhlICAgICB8ICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8fAotfHwgICAgICAgIHxuZXh0IENMSyBwdWxzZSAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHx8Ci18Ky0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tK3wKLXx8ICAgICAgICB8TW9kZSA1IGlzIHNpbWlsYXIgdG8gbW9kZSA0ICB8ICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8fAotfHwgICAgICAgIHxleGNlcHQgZm9yIHRoZSBnYXRlIGlucHV0ICAgIHwgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHx8Ci18fCAgICAgICAgfGFjdGlvbi4gVGhlIGdhdGUgaW5wdXQgaXMgbm90fCAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfHwKLXx8ICAgNSAgICB8dXNlZCBmb3IgZW5hYmxlZCBvciBkaXNhYmxlZCB8U3RhcnQgY291bnRpbmd8ICBIYXJkd2FyZSB0cmlnZ2VyICB8fAotfHwgICAgICAgIHx0aGUgdGltZXIuIFRoZSBnYXRlIGlucHV0IGlzIHwgICAgdmFsdWUgICAgIHwgICAgICAgICAgICAgICAgICAgIHx8Ci18fCAgICAgICAgfHVzZWQgZm9yIHRyaWdnZXJlZCB0aGUgdGltZXIufCAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfHwKLXwrLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0rfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICBJbnB1dCBjbG9jayBzZWxlY3Rpb24gdGFibGUgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rICAgfAotfCAgfCAgICAgICBiX0lucHV0Q2xvY2tTZWxlY3Rpb24gICAgfCAgICAgICAgICAgRGVzY3JpcHRpb24gICAgICAgICAgICAgIHwgICB8Ci18ICB8ICAgICAgICAgICBwYXJhbWV0ZXIgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgIHwKLXwgICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rICAgfAotfCAgfCAgICBBUENJMTcxMF9QQ0lfQlVTX0NMT0NLICAgICAgfCBGb3IgdGhlIHRpbWVyIGlucHV0IGNsb2NrLCB0aGUgUENJIHwgICB8Ci18ICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGJ1cyBjbG9jayAvIDQgaXMgdXNlZC4gVGhpcyBQQ0kgYnVzfCAgIHwKLXwgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgY2xvY2sgY2FuIGJlIDMwTUh6IG9yIDMzTUh6LiBGb3IgICB8ICAgfAotfCAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBUaW1lciAwIG9ubHkgdGhpcyBzZWxlY3Rpb24gYXJlICAgIHwgICB8Ci18ICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGF2YWlsYWJsZS4gICAgICAgICAgICAgICAgICAgICAgICAgfCAgIHwKLXwgICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rICAgfAotfCAgfCBBUENJMTcxMF8gRlJPTlRfQ09OTkVDVE9SX0lOUFVUfCBPZiB0aGUgZnJvbnQgY29ubmVjdG9yIHlvdSBoYXZlIHRoZXwgICB8Ci18ICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IHBvc3NpYmlsaXR5IHRvIGluamVjdCBhIGlucHV0IGNsb2NrfCAgIHwKLXwgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgZm9yIFRpbWVyIDEgb3IgVGltZXIgMi4gVGhlIHNvdXJjZSB8ICAgfAotfCAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBmcm9tIHRoaXMgY2xvY2sgY2FuIGVhdCB0aGUgb3V0cHV0IHwgICB8Ci18ICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGNsb2NrIGZyb20gVGltZXIgMCBvciBhbnkgb3RoZXIgICAgfCAgIHwKLXwgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgY2xvY2sgc291cmNlLiAgICAgICAgICAgICAgICAgICAgICB8ICAgfAotfCAgKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBJbnB1dCBQYXJhbWV0ZXJzICA6IHVuc2lnbmVkIGNoYXJfICAgYl9Cb2FyZEhhbmRsZSAgICAgICAgOiBIYW5kbGUgb2YgYm9hcmQgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFQQ0ktMTcxMCAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgIGJfTW9kdWxOYnIgICAgICAgICAgIDogTW9kdWxlIG51bWJlciB0byAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWd1cmUgKDAgdG8gMykgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICBiX1RpbWVyTmJyICAgICAgICAgICA6IFRpbWVyIG51bWJlciB0byAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlndXJlICgwIHRvIDIpICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgYl9UaW1lck1vZGUgICAgICAgICAgOiBUaW1lciBtb2RlIHNlbGVjdGlvbiAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgwIHRvIDUpICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDogSW50ZXJydXB0IG9uIHRlcm1pbmFsfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb3VudCAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE6IEhhcmR3YXJlICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0cmlnZ2VyYWJsZSBvbmUtICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaG90ICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI6IFJhdGUgZ2VuZXJhdG9yICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzogU3F1YXJlIHdhdmUgbW9kZSAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0OiBTb2Z0d2FyZSB0cmlnZ2VyZWQgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cm9iZSAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTogSGFyZHdhcmUgdHJpZ2dlcmVkICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJvYmUgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNlZSB0aW1lciBtb2RlICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRpb24gdGFibGUuICAgfAotfCAgICAgICAgICAgICAgICAgICAgIFVMT05HXyB1bF9SZWxvYWRWYWx1ZSAgICAgICAgIDogU3RhcnQgY291bnRpbmcgdmFsdWUgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvciBkaXZpc2lvbiBmYWN0b3IgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNlZSB0aW1lciBtb2RlICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRpb24gdGFibGUuICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICBiX0lucHV0Q2xvY2tTZWxlY3Rpb24gOiBTZWxlY3Rpb24gZnJvbSBpbnB1dCAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVyIGNsb2NrLiAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2VlIGlucHV0IGNsb2NrICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxlY3Rpb24gdGFibGUuICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgIGJfSW5wdXRDbG9ja0xldmVsICAgICA6IFNlbGVjdGlvbiBmcm9tIGlucHV0ICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xvY2sgbGV2ZWwuICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIDogTG93IGFjdGl2ZSAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoSW5wdXQgaW52ZXJ0ZWQpICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSA6IEhpZ2ggYWN0aXZlICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICBiX091dHB1dExldmVsLCAgICAgICAgOiBTZWxlY3Rpb24gZnJvbSBvdXRwdXQgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsb2NrIGxldmVsLiAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCA6IExvdyBhY3RpdmUgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxIDogSGlnaCBhY3RpdmUgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoT3V0cHV0IGludmVydGVkKSAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgYl9IYXJkd2FyZUdhdGVMZXZlbCAgIDogU2VsZWN0aW9uIGZyb20gICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYXJkd2FyZSBnYXRlIGxldmVsLiAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgOiBMb3cgYWN0aXZlICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChJbnB1dCBpbnZlcnRlZCkgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxIDogSGlnaCBhY3RpdmUgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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sKLXwgUmV0dXJuIFZhbHVlICAgICAgOiAwOiBObyBlcnJvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTE6IFRoZSBoYW5kbGUgcGFyYW1ldGVyIG9mIHRoZSBib2FyZCBpcyB3cm9uZyAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtMjogTW9kdWxlIHNlbGVjdGlvbiB3cm9uZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC0zOiBUaW1lciBzZWxlY3Rpb24gd3JvbmcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTQ6IFRoZSBtb2R1bGUgaXMgbm90IGEgVElNRVIgbW9kdWxlICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtNTogVGltZXIgbW9kZSBzZWxlY3Rpb24gaXMgd3JvbmcgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC02OiBJbnB1dCB0aW1lciBjbG9jayBzZWxlY3Rpb24gaXMgd3JvbmcgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTc6IFNlbGVjdGlvbiBmcm9tIGlucHV0IGNsb2NrIGxldmVsIGlzIHdyb25nICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtODogU2VsZWN0aW9uIGZyb20gb3V0cHV0IGNsb2NrIGxldmVsIGlzIHdyb25nICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC05OiBTZWxlY3Rpb24gZnJvbSBoYXJkd2FyZSBnYXRlIGxldmVsIGlzIHdyb25nICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgSW5wdXQgUGFyYW1ldGVycyAgOiB1bnNpZ25lZCBjaGFyXyAgIGJfQm9hcmRIYW5kbGUgICAgIDogSGFuZGxlIG9mIGJvYXJkICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBUENJLTE3MTAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICBiX01vZHVsTmJyICAgICAgICA6IFNlbGVjdGVkIG1vZHVsZSBudW1iZXIgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDAgdG8gMykgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgYl9UaW1lck5iciAgICAgICAgOiBUaW1lciBudW1iZXIgdG8gZW5hYmxlICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgwIHRvIDIpICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgIGJfSW50ZXJydXB0RW5hYmxlIDogRW5hYmxlIG9yIGRpc2FibGUgdGhlICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lciBpbnRlcnJ1cHQuICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFQQ0kxNzEwX0VOQUJMRSA6ICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRW5hYmxlIHRoZSB0aW1lciBpbnRlcnJ1cHQgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBUENJMTcxMF9ESVNBQkxFIDogICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERpc2FibGUgdGhlIHRpbWVyIGludGVycnVwdHwKLWlfUmV0dXJuVmFsdWU9aW5zbi0+bjsKLQliX01vZHVsTmJyICAgICAgICA9ICh1bnNpZ25lZCBjaGFyKSBDUl9BUkVGKGluc24tPmNoYW5zcGVjKTsKLQliX1RpbWVyTmJyCQkgID0gKHVuc2lnbmVkIGNoYXIpIENSX0NIQU4oaW5zbi0+Y2hhbnNwZWMpOwotCWJfQWN0aW9uVHlwZSAgICAgID0gKHVuc2lnbmVkIGNoYXIpIGRhdGFbMF07IC8qICBlbmFibGUgZGlzYWJsZSAqLwotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IE91dHB1dCBQYXJhbWV0ZXJzIDogLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBSZXR1cm4gVmFsdWUgICAgICA6IDA6IE5vIGVycm9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtMTogVGhlIGhhbmRsZSBwYXJhbWV0ZXIgb2YgdGhlIGJvYXJkIGlzIHdyb25nICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC0yOiBNb2R1bGUgc2VsZWN0aW9uIHdyb25nICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTM6IFRpbWVyIHNlbGVjdGlvbiB3cm9uZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtNDogVGhlIG1vZHVsZSBpcyBub3QgYSBUSU1FUiBtb2R1bGUgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC01OiBUaW1lciBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICJpX0FQQ0kxNzEwX0luaXRUaW1lciIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtNjogSW50ZXJydXB0IHBhcmFtZXRlciBpcyB3cm9uZyAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC03OiBJbnRlcnJ1cHQgZnVuY3Rpb24gbm90IGluaXRpYWxpc2VkLiAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgIFNlZSBmdW5jdGlvbiAiaV9BUENJMTcxMF9TZXRCb2FyZEludFJvdXRpbmVYIiAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSovCi1zdGF0aWMgaW50IGlfQVBDSTE3MTBfSW5zbldyaXRlRW5hYmxlRGlzYWJsZVRpbWVyKHN0cnVjdCBjb21lZGlfZGV2aWNlICpkZXYsCi0JCQkJCQkgc3RydWN0IGNvbWVkaV9zdWJkZXZpY2UgKnMsCi0JCQkJCQkgc3RydWN0IGNvbWVkaV9pbnNuICppbnNuLAotCQkJCQkJIHVuc2lnbmVkIGludCAqZGF0YSkKLXsKLQlzdHJ1Y3QgYWRkaV9wcml2YXRlICpkZXZwcml2ID0gZGV2LT5wcml2YXRlOwotCWludCBpX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lvbiBOYW1lICAgICA6IF9JTlRfICAgICBpX0FQQ0kxNzEwX1JlYWRBbGxUaW1lclZhbHVlICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHVuc2lnbmVkIGNoYXJfICAgICBiX0JvYXJkSGFuZGxlLCAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICAgIGJfTW9kdWxOYnIsICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQVUxPTkdfIHB1bF9UaW1lclZhbHVlQXJyYXkpCi1pbnQgaV9BUENJMTcxMF9JbnNuUmVhZEFsbFRpbWVyVmFsdWUoc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldixzdHJ1Y3QgY29tZWRpX3N1YmRldmljZSAqcywKLQlzdHJ1Y3QgY29tZWRpX2luc24gKmluc24sdW5zaWduZWQgaW50ICpkYXRhKSAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFRhc2sgICAgICAgICAgICAgIDogUmV0dXJuIHRoZSBhbGwgdGltZXIgdmFsdWVzIGZyb20gc2VsZWN0ZWQgdGltZXIgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBtb2R1bGUgKGJfTW9kdWxOYnIpLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IElucHV0IFBhcmFtZXRlcnMgIDogdW5zaWduZWQgY2hhcl8gICBiX0JvYXJkSGFuZGxlICAgICA6IEhhbmRsZSBvZiBib2FyZCAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQVBDSS0xNzEwICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgYl9Nb2R1bE5iciAgICAgICAgOiBTZWxlY3RlZCBtb2R1bGUgbnVtYmVyICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgwIHRvIDMpICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBPdXRwdXQgUGFyYW1ldGVycyA6IFBVTE9OR18gcHVsX1RpbWVyVmFsdWVBcnJheSA6IFRpbWVyIHZhbHVlIGFycmF5LiAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgRWxlbWVudCAwIGNvbnRhaW4gdGhlIHRpbWVyIDAgdmFsdWUuICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICBFbGVtZW50IDEgY29udGFpbiB0aGUgdGltZXIgMSB2YWx1ZS4gICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgIEVsZW1lbnQgMiBjb250YWluIHRoZSB0aW1lciAyIHZhbHVlLiAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgUmV0dXJuIFZhbHVlICAgICAgOiAwOiBObyBlcnJvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTE6IFRoZSBoYW5kbGUgcGFyYW1ldGVyIG9mIHRoZSBib2FyZCBpcyB3cm9uZyAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtMjogTW9kdWxlIHNlbGVjdGlvbiB3cm9uZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC0zOiBUaGUgbW9kdWxlIGlzIG5vdCBhIFRJTUVSIG1vZHVsZSAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTQ6IFRpbWVyIDAgbm90IGluaXRpYWxpc2VkIHNlZSBmdW5jdGlvbiAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgImlfQVBDSTE3MTBfSW5pdFRpbWVyIiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC01OiBUaW1lciAxIG5vdCBpbml0aWFsaXNlZCBzZWUgZnVuY3Rpb24gICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICJpX0FQQ0kxNzEwX0luaXRUaW1lciIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtNjogVGltZXIgMiBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAiaV9BUENJMTcxMF9Jbml0VGltZXIiICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0qLwotc3RhdGljIGludCBpX0FQQ0kxNzEwX0luc25SZWFkQWxsVGltZXJWYWx1ZShzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2LAotCQkJCQkgICAgc3RydWN0IGNvbWVkaV9zdWJkZXZpY2UgK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gICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICAgIGJfTW9kdWxOYnIsICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgICAgYl9UaW1lck5iciwgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBVTE9OR18gcHVsX1RpbWVyVmFsdWUpICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBUYXNrICAgICAgICAgICAgICA6IFJldHVybiB0aGUgdGltZXIgdmFsdWUgZnJvbSBzZWxlY3RlZCBkaWdpdGFsIHRpbWVyICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgKGJfVGltZXJOYnIpIGZyb20gc2VsZWN0ZWQgdGltZXIgIG1vZHVsZSAoYl9Nb2R1bE5icikuIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBJbnB1dCBQYXJhbWV0ZXJzICA6IHVuc2lnbmVkIGNoYXJfICAgYl9Cb2FyZEhhbmRsZSAgICAgOiBIYW5kbGUgb2YgYm9hcmQgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFQQ0ktMTcxMCAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgIGJfTW9kdWxOYnIgICAgICAgIDogU2VsZWN0ZWQgbW9kdWxlIG51bWJlciAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMCB0byAzKSAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICBiX1RpbWVyTmJyICAgICAgICA6IFRpbWVyIG51bWJlciB0byByZWFkICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDAgdG8gMikgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IE91dHB1dCBQYXJhbWV0ZXJzIDogUFVMT05HXyBwdWxfVGltZXJWYWx1ZSAgICA6IFRpbWVyIHZhbHVlICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBSZXR1cm4gVmFsdWUgICAgICA6IDA6IE5vIGVycm9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtMTogVGhlIGhhbmRsZSBwYXJhbWV0ZXIgb2YgdGhlIGJvYXJkIGlzIHdyb25nICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC0yOiBNb2R1bGUgc2VsZWN0aW9uIHdyb25nICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTM6IFRpbWVyIHNlbGVjdGlvbiB3cm9uZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtNDogVGhlIG1vZHVsZSBpcyBub3QgYSBUSU1FUiBtb2R1bGUgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC01OiBUaW1lciBub3QgaW5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CSAgIHwgVGFzayAgICAgICAgICAgICAgOiBSZXR1cm4gdGhlIG91dHB1dCBzaWduYWwgbGV2ZWwgKHBiX091dHB1dExldmVsKSBmcm9tICAgfAotCSAgIHwgICAgICAgICAgICAgICAgICAgICBzZWxlY3RlZCBkaWdpdGFsIHRpbWVyIChiX1RpbWVyTmJyKSBmcm9tIHNlbGVjdGVkIHRpbWVyfAotCSAgIHwgICAgICAgICAgICAgICAgICAgICBtb2R1bGUgKGJfTW9kdWxOYnIpLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotCSAgICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotCSAgIHwgSW5wdXQgUGFyYW1ldGVycyAgOiB1bnNpZ25lZCBjaGFyXyAgIGJfQm9hcmRIYW5kbGUgICAgIDogSGFuZGxlIG9mIGJvYXJkICAgICAgICAgICAgfAotCSAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQVBDSS0xNzEwICAgICAgICAgICAgICAgICAgfAotCSAgIHwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgIGJfTW9kdWxOYnIgICAgICAgIDogU2VsZWN0ZWQgbW9kdWxlIG51bWJlciAgICAgfAotCSAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDAgdG8gMykgICAgICAgICAgICAgICAgICAgfAotCSAgIHwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgIGJfVGltZXJOYnIgICAgICAgIDogVGltZXIgbnVtYmVyIHRvIHRlc3QgICAgICAgfAotCSAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDAgdG8gMikgICAgICAgICAgICAgICAgICAgfAotCSAgICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotCSAgIHwgT3V0cHV0IFBhcmFtZXRlcnMgOiB1bnNpZ25lZCBjaGFyICpfIHBiX091dHB1dExldmVsICAgICA6IE91dHB1dCBzaWduYWwgbGV2ZWwgICAgICAgIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgOiBUaGUgb3V0cHV0IGlzIGxvdyAgICAgIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgOiBUaGUgb3V0cHV0IGlzIGhpZ2ggICAgIHwKLQkgICArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLQkgICB8IFJldHVybiBWYWx1ZSAgICAgIDogMDogTm8gZXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgICAtMTogVGhlIGhhbmRsZSBwYXJhbWV0ZXIgb2YgdGhlIGJvYXJkIGlzIHdyb25nICAgICAgICAgIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgICAtMjogTW9kdWxlIHNlbGVjdGlvbiB3cm9uZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgICAtMzogVGltZXIgc2VsZWN0aW9uIHdyb25nICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgICAtNDogVGhlIG1vZHVsZSBpcyBub3QgYSBUSU1FUiBtb2R1bGUgICAgICAgICAgICAgICAgICAgIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgICAtNTogVGltZXIgb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ciA+PSAwKSAmJiAoYl9UaW1lck5iciA8PSAyKSkgKi8KLQkJfSBlbHNlIHsKLQkJCS8qIFRoZSBtb2R1bGUgaXMgbm90IGEgVElNRVIgbW9kdWxlICovCi0JCQlEUFJJTlRLKCJUaGUgbW9kdWxlIGlzIG5vdCBhIFRJTUVSIG1vZHVsZVxuIik7Ci0JCQlpX1JldHVyblZhbHVlID0gLTQ7Ci0JCX0KLQl9IGVsc2UgewotCQkvKiBNb2R1bGUgbnVtYmVyIGVycm9yICovCi0JCURQUklOVEsoIk1vZHVsZSBudW1iZXIgZXJyb3JcbiIpOwotCQlpX1JldHVyblZhbHVlID0gLTI7Ci0JfQotCi0JcmV0dXJuIGlfUmV0dXJuVmFsdWU7Ci19Ci0KLS8qCi0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgRnVuY3Rpb24gTmFtZSAgICAgOiBfSU5UXyAgICAgaV9BUENJMTcxMF9HZXRUaW1lclByb2dyZXNzU3RhdHVzICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCBjaGFyXyAgICAgYl9Cb2FyZEhhbmRsZSwgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgICBiX01vZHVsTmJyLCAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICAgIGJfVGltZXJOYnIsICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyICpfICAgcGJfVGltZXJTdGF0dXMpICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFRhc2sgICAgICAgICAgICAgIDogUmV0dXJuIHRoZSBwcm9ncmVzcyBzdGF0dXMgKHBiX1RpbWVyU3RhdHVzKSBmcm9tICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBzZWxlY3RlZCBkaWdpdGFsIHRpbWVyIChiX1RpbWVyTmJyKSBmcm9tIHNlbGVjdGVkIHRpbWVyfAotfCAgICAgICAgICAgICAgICAgICAgIG1vZHVsZSAoYl9Nb2R1bE5icikuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgSW5wdXQgUGFyYW1ldGVycyAgOiB1bnNpZ25lZCBjaGFyXyAgIGJfQm9hcmRIYW5kbGUgICAgIDogSGFuZGxlIG9mIGJvYXJkICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBUENJLTE3MTAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICBiX01vZHVsTmJyICAgICAgICA6IFNlbGVjdGVkIG1vZHVsZSBudW1iZXIgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDAgdG8gMykgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgYl9UaW1lck5iciAgICAgICAgOiBUaW1lciBudW1iZXIgdG8gdGVzdCAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgwIHRvIDIpICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBPdXRwdXQgUGFyYW1ldGVycyA6IHVuc2lnbmVkIGNoYXIgKl8gcGJfVGltZXJTdGF0dXMgICAgIDogT3V0cHV0IHNpZ25hbCBsZXZlbCAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIDogVGltZXIgbm90IGluIHByb2dyZXNzICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgOiBUaW1lciBpbiBwcm9ncmVzcyAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBSZXR1cm4gVmFsdWUgICAgICA6IDA6IE5vIGVycm9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtMTogVGhlIGhhbmRsZSBwYXJhbWV0ZXIgb2YgdGhlIGJvYXJkIGlzIHdyb25nICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC0yOiBNb2R1bGUgc2VsZWN0aW9uIHdyb25nICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTM6IFRpbWVyIHNlbGVjdGlvbiB3cm9uZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtNDogVGhlIG1vZHVsZSBpcyBub3QgYSBUSU1FUiBtb2R1bGUgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC01OiBUaW1lciBub3QgaW5pdGlhbGlzZWQgc2Vl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JvciAqLwotCi0JCWlfUmV0dXJuVmFsdWUgPSAtMjsKLQl9Ci0KLQlyZXR1cm4gaV9SZXR1cm5WYWx1ZTsKLX0KLQotLyoKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBGdW5jdGlvbiBOYW1lICAgICA6IF9JTlRfICAgICBpX0FQQ0kxNzEwX1dyaXRlVGltZXJWYWx1ZSAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHVuc2lnbmVkIGNoYXJfICAgYl9Cb2FyZEhhbmRsZSwgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICBiX01vZHVsTmJyLCAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgIGJfVGltZXJOYnIsICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVMT05HXyB1bF9Xcml0ZVZhbHVlKSAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBUYXNrICAgICAgICAgICAgICA6IFdyaXRlIHRoZSB2YWx1ZSAodWxfV3JpdGVWYWx1ZSkgaW50byB0aGUgc2VsZWN0ZWQgdGltZXJ8Ci18ICAgICAgICAgICAgICAgICAgICAgKGJfVGltZXJOYnIpIGZyb20gc2VsZWN0ZWQgdGltZXIgbW9kdWxlIChiX01vZHVsTmJyKS4gIHwKLXwgICAgICAgICAgICAgICAgICAgICBUaGUgYWN0aW9uIGluIGRlcGVuZCBvZiB0aGUgdGltZSBtb2RlIHNlbGVjdGlvbi4gICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIFNlZSB0aW1lciBtb2RlIGRlc2NyaXB0aW9uIHRhYmxlLiAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgSW5wdXQgUGFyYW1ldGVycyAgOiB1bnNpZ25lZCBjaGFyXyAgIGJfQm9hcmRIYW5kbGUgICAgIDogSGFuZGxlIG9mIGJvYXJkICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBUENJLTE3MTAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICBiX01vZHVsTmJyICAgICAgICA6IFNlbGVjdGVkIG1vZHVsZSBudW1iZXIgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDAgdG8gMykgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgYl9UaW1lck5iciAgICAgICAgOiBUaW1lciBudW1iZXIgdG8gd3JpdGUgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgwIHRvIDIpICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBVTE9OR18gdWxfV3JpdGVWYWx1ZSAgICAgIDogVmFsdWUgdG8gd3JpdGUgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IE91dHB1dCBQYXJhbWV0ZXJzIDogLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBSZXR1cm4gVmFsdWUgICAgICA6IDA6IE5vIGVycm9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtMTogVGhlIGhhbmRsZSBwYXJhbWV0ZXIgb2YgdGhlIGJvYXJkIGlzIHdyb25nICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC0yOiBNb2R1bGUgc2VsZWN0aW9uIHdyb25nICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTM6IFRpbWVyIHNlbGVjdGlvbiB3cm9uZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtNDogVGhlIG1vZHVsZSBpcyBub3QgYSBUSU1FUiBtb2R1bGUgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC01OiBUaW1lciBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICJpX0FQQ0kxNzEwX0luaXRUaW1lciIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSovCi1zdGF0aWMgaW50IGlfQVBDSTE3MTBfV3JpdGVUaW1lclZhbHVlKHN0cnVjdCBjb21lZGlfZGV2aWNlICpkZ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3Rpb24gTmFtZSAgICAgOiBfSU5UXyAgICAgaV9BUENJMTcxMF9Jbml0Q2hyb25vICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCBjaGFyXyAgICAgYl9Cb2FyZEhhbmRsZSwgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgICBiX01vZHVsTmJyLCAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICAgIGJfQ2hyb25vTW9kZSwgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgICAgYl9QQ0lJbnB1dENsb2NrLCAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgICBiX1RpbWluZ1VuaXQsICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVUxPTkdfICAgdWxfVGltaW5nSW50ZXJ2YWwsICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQVUxPTkdfIHB1bF9SZWFsVGltaW5nSW50ZXJ2YWwpCi0KLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBUYXNrICAgICAgICAgICAgICA6IENvbmZpZ3VyZSB0aGUgY2hyb25vbWV0ZXIgb3BlcmF0aW5nIG1vZGUgKGJfQ2hyb25vTW9kZSl8Ci18ICAgICAgICAgICAgICAgICAgICAgZnJvbSBzZWxlY3RlZCBtb2R1bGUgKGJfTW9kdWxOYnIpLiAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBUaGUgdWxfVGltaW5nSW50ZXJ2YWwgYW5kIHVsX1RpbWluZ1VuaXQgZGV0ZXJtaW5lIHRoZSAgfAotfCAgICAgICAgICAgICAgICAgICAgIHRpbWluZyBiYXNlIGZvciB0aGUgbWVhc3VyZW1lbnQuICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgVGhlIHB1bF9SZWFsVGltaW5nSW50ZXJ2YWwgcmV0dXJuIHRoZSByZWFsIHRpbWluZyAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB2YWx1ZS4gWW91IG11c3QgY2FsbGluZyB0aGlzIGZ1bmN0aW9uIGJlIGZvciB5b3UgY2FsbCAgfAotfCAgICAgICAgICAgICAgICAgICAgIGFueSBvdGhlciBmdW5jdGlvbiB3aXRjaCBhY2Nlc3Mgb2YgdGhlIGNocm9ub21ldGVyLiAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBXaXRjaCB0aGlzIGZ1bmN0aW9uYWxpdHkgZnJvbSB0aGUgQVBDSS0xNzEwIHlvdSBoYXZlICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHRoZSBwb3NzaWJpbGl0eSB0byBtZWFzdXJlIHRoZSB0aW1pbmcgd2l0Y2ggdHdvIGV2ZW50LiB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBUaGUgbW9kZSAwIGFuZCAxIGlzIGFwcHJvcHJpYXRlIGZvciBwZXJpb2QgbWVhc3VyZW1lbnQufAotfCAgICAgICAgICAgICAgICAgICAgIFRoZSBtb2RlIDIgYW5kIDMgaXMgYXBwcm9wcmlhdGUgZm9yIGZyZXF1ZW50ICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgbWVhc3VyZW1lbnQuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBUaGUgbW9kZSA0IHRvIDcgaXMgYXBwcm9wcmlhdGUgZm9yIG1lYXN1cmluZyB0aGUgdGltaW5nfAotfCAgICAgICAgICAgICAgICAgICAgIGJldHdlZW4gIHR3byBldmVudC4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgSW5wdXQgUGFyYW1ldGVycyAgOiB1bnNpZ25lZCBjaGFyXyAgIGJfQm9hcmRIYW5kbGUgICAgOiBIYW5kbGUgb2YgYm9hcmQgQVBDSS0xNzEwICAgfAotfCB1bnNpZ25lZCBjaGFyXyAgIGJfTW9kdWxOYnIgIENSX0FSRUYoaW5zbi0+Y2hhbnNwZWMpICA6IE1vZHVsZSBudW1iZXIgdG8gY29uZmlndXJlICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDAgdG8gMykgICAgICAgICAgICAgICAgICAgIHwKLXwgdW5zaWduZWQgY2hhcl8gICBiX0Nocm9ub01vZGUJCQkJZGF0YVswXSAgICA6IENocm9ub21ldGVyIGFjdGlvbiBtb2RlICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDAgdG8gNykuICAgICAgICAgICAgICAgICAgIHwKLXwgdW5zaWduZWQgY2hhcl8gICBiX1BDSUlucHV0Q2xvY2sJCQlkYXRhWzFdIDogU2VsZWN0aW9uIGZyb20gUENJIGJ1cyBjbG9ja3wKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIEFQQ0kxNzEwXzMwTUhaIDogICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGhlIFBDIGhhdmUgYSBQQ0kgYnVzICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbG9jayBmcm9tIDMwIE1IeiAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIEFQQ0kxNzEwXzMzTUhaIDogICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGhlIFBDIGhhdmUgYSBQQ0kgYnVzICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbG9jayBmcm9tIDMzIE1IeiAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIEFQQ0kxNzEwXzQwTUhaICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGhlIEFQQ0ktMTcxMCBoYXZlIGEgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRlZ3JhdGVkIDQwTWh6ICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHF1YXJ0ei4gICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgYl9UaW1pbmdVbml0CWRhdGFbMl0gICAgOiBCYXNlIHRpbWluZyB1bml0eSAoMCB0byA0KSB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgOiBucyAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSA6IMK1cyAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMiA6IG1zICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzIDogcyAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQgOiBtbiAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICBVTE9OR18gdWxfVGltaW5nSW50ZXJ2YWwgOiBkYXRhWzNdCSBCYXNlIHRpbWluZyB2YWx1ZS4gICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IE91dHB1dCBQYXJhbWV0ZXJzIDogUFVMT05HXyAgcHVsX1JlYWxUaW1pbmdJbnRlcnZhbCA6IFJlYWwgIGJhc2UgdGltaW5nICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUuCi18ICAgICAgICAgICAgICAgICAgICAgZGF0YVswXQotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFJldHVybiBWYWx1ZSAgICAgIDogIDA6IE5vIGVycm9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMTogVGhlIGhhbmRsZSBwYXJhbWV0ZXIgb2YgdGhlIGJvYXJkIGlzIHdyb25nICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0yOiBNb2R1bGUgc2VsZWN0aW9uIHdyb25nICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTM6IFRoZSBtb2R1bGUgaXMgbm90IGEgQ2hyb25vbWV0ZXIgbW9kdWxlICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtNDogQ2hyb25vbWV0ZXIgbW9kZSBzZWxlY3Rpb24gaXMgd3JvbmcgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC01OiBUaGUgc2VsZWN0ZWQgUENJIGlucHV0IGNsb2NrIGlzIHdyb25nICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTY6IFRpbWluZyB1bml0eSBzZWxlY3Rpb24gaXMgd3JvbmcgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtNzogQmFzZSB0aW1pbmcgc2VsZWN0aW9uIGlzIHdyb25nICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC04OiBZb3UgY2FuIG5vdCB1c2VkIHRoZSA0ME1IeiBjbG9jayBzZWxlY3Rpb24gd2l0aCAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMgYm9hcmQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtOTogWW91IGNhbiBub3QgdXNlZCB0aGUgNDBNSHogY2xvY2sgc2VsZWN0aW9uIHdpdGggICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzIENIUk9OT1MgdmVyc2lvbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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nNpZ25lZCBpbnQpIGRhdGFbM107Ci0JaV9SZXR1cm5WYWx1ZSA9IGluc24tPm47Ci0KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JLyogVGVzdCB0aGUgbW9kdWxlIG51bWJlciAqLwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCWlmIChiX01vZHVsTmJyIDwgNCkgewotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKi8KLQkJLyogVGVzdCBpZiBjaHJvbm9tZXRlciAqLwotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQlpZiAoKGRldnByaXYtPnNfQm9hcmRJbmZvcy4KLQkJCQlkd19Nb2xkdWxlQ29uZmlndXJhdGlvbltiX01vZHVsTmJyXSAmCi0JCQkJMHhGRkZGMDAwMFVMKSA9PSBBUENJMTcxMF9DSFJPTk9NRVRFUikgewotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCS8qIFRlc3QgdGhlIGNocm9ub21ldGVyIG1vZGUgKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCWlmIChiX0Nocm9ub01vZGUgPD0gNykgewotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCS8qIFRlc3QgdGhlIFBDSSBidXMgY2xvY2sgKi8KLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCWlmICgoYl9QQ0lJbnB1dENsb2NrID09IEFQQ0kxNzEwXzMwTUhaKSB8fAotCQkJCQkoYl9QQ0lJbnB1dENsb2NrID09IEFQQ0kxNzEwXzMzTUhaKSB8fAotCQkJCQkoYl9QQ0lJbnB1dENsb2NrID09IEFQQ0kxNzEwXzQwTUhaKSkgewotCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCS8qIFRlc3QgdGhlIHRpbWluZyB1bml0eSAqLwotCQkgICAgLyoqKioqKioqKioqKioqKioqKio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m8KLQkJCQkJCQkJCQlbYl9Nb2R1bE5icl0uCi0JCQkJCQkJCQkJc19DaHJvbm9Nb2R1bGVJbmZvLgotCQkJCQkJCQkJCWJfQ2hyb25vSW5pdAotCQkJCQkJCQkJCT0KLQkJCQkJCQkJCQkxOwotCQkJCQkJCQl9IGVsc2UgewotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCQkJCS8qIFRPUiB2ZXJzaW9uIGVycm9yIGZvciA0ME1IeiBjbG9jayBzZWxlY3Rpb24gKi8KLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJCQkJCURQUklOVEsoIlRPUiB2ZXJzaW9uIGVycm9yIGZvciA0ME1IeiBjbG9jayBzZWxlY3Rpb25cbiIpOwotCQkJCQkJCQkJaV9SZXR1cm5WYWx1ZQotCQkJCQkJCQkJCT0KLQkJCQkJCQkJCQktOTsKLQkJCQkJCQkJfQotCQkJCQkJCX0gZWxzZSB7Ci0JCQkgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCQkJLyogWW91IGNhbiBub3QgdXNlIHRoZSA0ME1IeiBjbG9jayBzZWxlY3Rpb24gd2l0aCB0aGlzIGJvYXJkICovCi0JCQkgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQkJCQlEUFJJTlRLKCJZb3UgY2FuIG5vdCB1c2VkIHRoZSA0ME1IeiBjbG9jayBzZWxlY3Rpb24gd2l0aCB0aGlzIGJvYXJkXG4iKTsKLQkJCQkJCQkJaV9SZXR1cm5WYWx1ZSA9Ci0JCQkJCQkJCQktODsKLQkJCQkJCQl9Ci0JCQkJCQl9IGVsc2UgewotCQkJICAvKioqKioqKioqKioqKioqKioqKioq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lZCBQQ0kgaW5wdXQgY2xvY2sgaXMgd3JvbmdcbiIpOwotCQkJCQlpX1JldHVyblZhbHVlID0gLTU7Ci0JCQkJfQkvKiAgaWYgKChiX1BDSUlucHV0Q2xvY2sgPT0gQVBDSTE3MTBfMzBNSFopIHx8IChiX1BDSUlucHV0Q2xvY2sgPT0gQVBDSTE3MTBfMzNNSFopKSAqLwotCQkJfQkvKiAgaWYgKGJfQ2hyb25vTW9kZSA+PSAwICYmIGJfQ2hyb25vTW9kZSA8PSA3KSAqLwotCQkJZWxzZSB7Ci0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCS8qIENocm9ub21ldGVyIG1vZGUgc2VsZWN0aW9uIGlzIHdyb25nICovCi0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJRFBSSU5USygiQ2hyb25vbWV0ZXIgbW9kZSBzZWxlY3Rpb24gaXMgd3JvbmdcbiIpOwotCQkJCWlfUmV0dXJuVmFsdWUgPSAtNDsKLQkJCX0JLyogIGlmIChiX0Nocm9ub01vZGUgPj0gMCAmJiBiX0Nocm9ub01vZGUgPD0gNykgKi8KLQkJfSBlbHNlIHsKLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogVGhlIG1vZHVsZSBpcyBub3QgYSBDaHJvbm9tZXRlciBtb2R1bGUgKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQlEUFJJTlRLKCJUaGUgbW9kdWxlIGlzIG5vdCBhIENocm9ub21ldGVyIG1vZHVsZVxuIik7Ci0JCQlpX1JldHVyblZhbHVlID0gLTM7Ci0JCX0KLQl9IGVsc2UgewotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKi8KLQkJLyogTW9kdWxlIG51bWJlciBlcnJvciAqLwotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQlEUFJJTlRLKCJNb2R1bGUgbnVtYmVyIGVycm9yXG4iKTsKLQkJaV9SZXR1cm5WYWx1ZSA9IC0yOwotCX0KLQlkYXRhWzBdID0gdWxfUmVhbFRpbWluZ0ludGVydmFsOwotCXJldHVybiBpX1JldHVyblZhbHVlOwotfQotCi0vKgotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IEZ1bmN0aW9uIE5hbWUgICAgIDogX0lOVF8gaV9BUENJMTcxMF9FbmFibGVDaHJvbm8gICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCBjaGFyXyBiX0JvYXJkSGFuZGxlLCAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfTW9kdWxOYnIsICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gYl9DeWNsZU1vZGUsICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyBiX0ludGVycnVwdEVuYWJsZSkKLWludCBpX0FQQ0kxNzEwX0luc25Xcml0ZUVuYWJsZURpc2FibGVDaHJvbm8oc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiwKLXN0cnVjdCBjb21lZGlfc3ViZGV2aWNlICpzLHN0cnVjdCBjb21lZGlfaW5zbiAqaW5zbix1bnNpZ25lZCBpbnQgKmRhdGEpCQkJCQkJIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBUYXNrICAgICAgICAgICAgICA6IEVuYWJsZSB0aGUgY2hyb25vbWV0ZXIgZnJvbSBzZWxlY3RlZCBtb2R1bGUgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgKGJfTW9kdWxOYnIpLiBZb3UgbXVzdCBjYWxsaW5nIHRoZSAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAiaV9BUENJMTcxMF9Jbml0Q2hyb25vIiBmdW5jdGlvbiBiZSBmb3IgeW91IGNhbGwgdGhpcyAgfAotfCAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgSWYgeW91IGVuYWJsZSB0aGUgY2hyb25vbWV0ZXIgaW50ZXJydXB0LCB0aGUgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBjaHJvbm9tZXRlciBnZW5lcmF0ZSBhIGludGVycnVwdCBhZnRlciB0aGUgc3RvcCBzaWduYWwufAotfCAgICAgICAgICAgICAgICAgICAgIFNlZSBmdW5jdGlvbiAiaV9BUENJMTcxMF9TZXRCb2FyZEludFJvdXRpbmVYIiBhbmQgdGhlICB8Ci18ICAgICAgICAgICAgICAgICAgICAgSW50ZXJydXB0IG1hc2sgZGVzY3JpcHRpb24gY2hhcHRlciBmcm9tIHRoaXMgbWFudWFsLiAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBUaGUgYl9DeWNsZU1vZGUgcGFyYW1ldGVyIGRldGVybWluZSBpZiB5b3Ugd2lsbCAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIG1lYXN1cmVkIGEgc2luZ2xlIG9yIG1vcmUgY3ljbGUuCi0KLXwJCQkJCSAgRGlzYWJsZSB0aGUgY2hyb25vbWV0ZXIgZnJvbSBzZWxlY3RlZ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gICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gYl9JbnRlcnJ1cHRFbmFibGUgOiBFbmFibGUgb3IgZGlzYWJsZSB0aGUgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbMl0gICAgICAgICAgICBjaHJvbm9tZXRlciBpbnRlcnJ1cHQuICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFQQ0kxNzEwX0VOQUJMRTogICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRW5hYmxlIHRoZSBjaHJvbm9tZXRlciAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRlcnJ1cHQgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFQQ0kxNzEwX0RJU0FCTEU6ICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRGlzYWJsZSB0aGUgY2hyb25vbWV0ZXIgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRlcnJ1cHQgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBPdXRwdXQgUGFyYW1ldGVycyA6IC0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgUmV0dXJuIFZhbHVlICAgICAgOiAgMDogTm8gZXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0xOiBUaGUgaGFuZGxlIHBhcmFtZXRlciBvZiB0aGUgYm9hcmQgaXMgd3JvbmcgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTI6IE1vZHVsZSBzZWxlY3Rpb24gd3JvbmcgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMzogVGhlIG1vZHVsZSBpcyBub3QgYSBDaHJvbm9tZXRlciBtb2R1bGUgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC00OiBDaHJvbm9tZXRlciBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICJpX0FQQ0kxNzEwX0luaXRDaHJvbm8iICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtNTogQ2hyb25vbWV0ZXIgYWNxdWlzaXRpb24gbW9kZSBjeWNsZSBpcyB3cm9uZyAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC02OiBJbnRlcnJ1cHQgcGFyYW1ldGVyIGlzIHdyb25nICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTc6IEludGVycnVwdCBmdW5jdGlvbiBub3QgaW5pdGlhbGlzZWQuICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgU2VlIGZ1bmN0aW9uICJpX0FQQ0kxNzEwX1NldEJvYXJkSW50Um91dGluZVgiCi0gICAgICAgICAgICAgICAgICAgICAgLTg6IGRhdGFbMF0gd3JvbmcgaW5wdXQgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0t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bE5icikpOwotCQkJCQl9Ci0JCQkJCWJyZWFrOwotCi0JCQkJZGVmYXVsdDoKLQkJCQkJRFBSSU5USygiSW5wdXRzIHdyb25nISBFbmFibGUgb3IgRGlzYWJsZSBjaHJvbm9cbiIpOwotCQkJCQlpX1JldHVyblZhbHVlID0gLTg7Ci0JCQkJfQkvKiAgc3dpdGNoIEVOQUJMRS9ESVNBQkxFICovCi0JCQl9IGVsc2UgewotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogQ2hyb25vbWV0ZXIgbm90IGluaXRpYWxpc2VkICovCi0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCURQUklOVEsoIkNocm9ub21ldGVyIG5vdCBpbml0aWFsaXNlZFxuIik7Ci0JCQkJaV9SZXR1cm5WYWx1ZSA9IC00OwotCQkJfQotCQl9IGVsc2UgewotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkvKiBUaGUgbW9kdWxlIGlzIG5vdCBhIENocm9ub21ldGVyIG1vZHVsZSAqLwotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCURQUklOVEsoIlRoZSBtb2R1bGUgaXMgbm90IGEgQ2hyb25vbWV0ZXIgbW9kdWxlXG4iKTsKLQkJCWlfUmV0dXJuVmFsdWUgPSAtMzsKLQkJfQotCX0gZWxzZSB7Ci0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqLwotCQkvKiBNb2R1bGUgbnVtYmVyIGVycm9yICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCURQUklOVEsoIk1vZHVsZSBudW1iZXIgZXJyb3JcbiIpOwotCQlpX1JldHVyblZhbHVlID0gLTI7Ci0JfQotCi0JcmV0dXJuIGlfUmV0dXJuVmFsdWU7Ci19Ci0KLS8qCi0rLS0tLS0tLS0tLS0tLS0tLS0t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W5zaWduZWQgY2hhcl8gYl9Nb2R1bE5iciAgICAgOiBTZWxlY3RlZCBtb2R1bGUgbnVtYmVyICgwIHRvIDMpIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBPdXRwdXQgUGFyYW1ldGVycyA6IFBVTE9OR18gIHBiX0Nocm9ub1N0YXR1cyA6IFJldHVybiB0aGUgY2hyb25vbWV0ZXIgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzLiAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIDogTWVhc3VyZW1lbnQgbm90IHN0YXJ0ZWQufAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBObyBzdGFydCBzaWduYWwgb2NjdXIuICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSA6IE1lYXN1cmVtZW50IHN0YXJ0ZWQuICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQSBzdGFydCBzaWduYWwgb2NjdXIuICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIgOiBNZWFzdXJlbWVudCBzdG9wcGVkLiAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEEgc3RvcCBzaWduYWwgb2NjdXIuICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGhlIG1lYXN1cmVtZW50IGlzICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXJtaW5hdGUuICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzogQSBvdmVyZmxvdyBvY2N1ci4gWW91ICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtdXN0IGNoYW5nZSB0aGUgYmFzZSAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWluZyB3aXRjaCB0aGUgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiaV9BUENJMTcxMF9Jbml0Q2hyb25vIiAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFJldHVybiBWYWx1ZSAgICAgIDogIDA6IE5vIGVycm9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMTogVGhlIGhhbmRsZSBwYXJhbWV0ZXIgb2YgdGhlIGJvYXJkIGlzIHdyb25nICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0yOiBNb2R1bGUgc2VsZWN0aW9uIHdyb25nICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTM6IFRoZSBtb2R1bGUgaXMgbm90IGEgQ2hyb25vbWV0ZXIgbW9kdWxlICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtNDogQ2hyb25vbWV0ZXIgbm90IGluaXRpYWxp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CBpZiBjaHJvbm9tZXRlciBpbml0aWFsaXNlZCAqLwotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJaWYgKGRldnByaXYtPgotCQkJCXNfTW9kdWxlSW5mb1tiX01vZHVsTmJyXS4KLQkJCQlzX0Nocm9ub01vZHVsZUluZm8uYl9DaHJvbm9Jbml0ID09IDEpIHsKLQotCQkJCWR3X1N0YXR1cyA9IGlubChkZXZwcml2LT5zX0JvYXJkSW5mb3MuCi0JCQkJCXVpX0FkZHJlc3MgKyA4ICsgKDY0ICogYl9Nb2R1bE5icikpOwotCi0JCSAvKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogVGVzdCBpZiBvdmVyZmxvdyAqLwotCQkgLyoqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJaWYgKChkd19TdGF0dXMgJiA4KSA9PSA4KSB7Ci0JCSAgICAvKioqKioqKioqKioqKioqKioqLwotCQkJCQkvKiBPdmVyZmxvdyBvY2N1ciAqLwotCQkgICAgLyoqKioqKioqKioqKioqKioqKi8KLQotCQkJCQkqcGJfQ2hyb25vU3RhdHVzID0gMzsKLQkJCQl9CS8qICBpZiAoKGR3X1N0YXR1cyAmIDgpID09IDgpICovCi0JCQkJZWxzZSB7Ci0JCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJLyogVGVzdCBpZiBtZWFzdXJlbWVudCBzdG9wcGVkICovCi0JCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQlpZiAoKGR3X1N0YXR1cyAmIDIpID09IDIpIHsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCS8qIEEgc3RvcCBzaWduYWwgb2NjdXIgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQkJKnBiX0Nocm9ub1N0YXR1cyA9IDI7Ci0JCQkJCX0JLyogIGlmICgoZHdfU3RhdHVzICYgMikgPT0gMikgKi8KLQkJCQkJZWxzZSB7Ci0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCS8qIFRlc3QgaWYgbWVhc3VyZW1lbnQgc3RhcnRlZCAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJCWlmICgoZHdfU3RhdHVzICYgMSkgPT0gMSkgewotCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJCS8qIEEgc3RhcnQgc2lnbmFsIG9jY3VyICovCi0JCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJCQkqcGJfQ2hyb25vU3RhdHVzID0gMTsKLQkJCQkJCX0JLyogIGlmICgoZHdfU3RhdHVzICYgMSkgPT0gMSkgKi8KLQkJCQkJCWVsc2UgewotCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJCS8qIE1lYXN1cmVtZW50IG5vdCBzdGFydGVkICovCi0JCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJCQkqcGJfQ2hyb25vU3RhdHVzID0gMDsKLQkJCQkJCX0JLyogIGlmICgoZHdfU3RhdHVzICYgMSkgPT0gMSkgKi8KLQkJCQkJfQkvKiAgaWYgKChkd19TdGF0dXMgJiAyKSA9PSAyKSAqLwotCQkJCX0JLyogIGlmICgoZHdfU3RhdHVzICYgOCkgPT0gOCkgKi8KLQkJCX0gZWxzZSB7Ci0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkvKiBDaHJvbm9tZXRlciBub3QgaW5pdGlhbGlzZWQgKi8KLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCURQUklOVEsoIkNocm9ub21ldGVyIG5vdCBpbml0aWFsaXNlZFxuIik7Ci0JCQkJaV9SZXR1cm5WYWx1ZSA9IC00OwotCQkJfQotCQl9IGVsc2UgewotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkvKiBUaGUgbW9kdWxlIGlzIG5vdCBhIENocm9ub21ldGVyIG1vZHVsZSAqLwotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQlEUFJJTlRLKCJUaGUgbW9kdWxlIGlzIG5vdCBhIENocm9ub21ldGVyIG1vZHVsZVxuIik7Ci0JCQlpX1JldHVyblZhbHVlID0gLTM7Ci0JCX0KLQl9IGVsc2UgewotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKi8KLQkJLyogTW9kdWxlIG51bWJlciBlcnJvciAqLwotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKi8KLQkJRFBSSU5USygiTW9kdWxlIG51bWJlciBlcnJvclxuIik7Ci0JCWlfUmV0dXJuVmFsdWUgPSAtMjsKLQl9Ci0KLQlyZXR1cm4gaV9SZXR1cm5WYWx1ZTsKLX0KLQotLyoKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBGdW5jdGlvbiBOYW1lICAgICA6IF9JTlRfIGlfQVBDSTE3MTBfUmVhZENocm9ub1ZhbHVlICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCBjaGFyXyAgICAgYl9Cb2FyZEhhbmRsZSwgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgICBiX01vZHVsTmJyLCAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgaW50XyAgICB1aV9UaW1lT3V0LCAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXIgKl8gICBwYl9DaHJvbm9TdGF0dXMsICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBVTE9OR18gcHVsX0Nocm9ub1ZhbHVlKSAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFRhc2sgICAgICAgICAgICAgIDogUmV0dXJuIHRoZSBjaHJvbm9tZXRlciBzdGF0dXMgKHBiX0Nocm9ub1N0YXR1cykgYW5kIHRoZXwKLXwgICAgICAgICAgICAgICAgICAgICB0aW1pbmcgdmFsdWUgKHB1bF9DaHJvbm9WYWx1ZSkgYWZ0ZXIgYSBzdG9wIHNpZ25hbCAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIG9jY3VyIGZyb20gc2VsZWN0ZWQgY2hyb25vbWV0ZXIgbW9kdWxlIChiX01vZHVsTmJyKS4gICB8Ci18ICAgICAgICAgICAgICAgICAgICAgVGhpcyBmdW5jdGlvbiBhcmUgb25seSBhdmFpYmxlIGlmIHlvdSBoYXZlIGRpc2FibGVkICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB0aGUgaW50ZXJydXB0IGZ1bmN0aW9uYWxpdHkuIFNlZSBmdW5jdGlvbiAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICJpX0FQQ0kxNzEwX0VuYWJsZUNocm9ubyIgYW5kIHRoZSBJbnRlcnJ1cHQgbWFzayAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRpb24gY2hhcHRlci4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBZb3UgY2FuIHRlc3QgdGhlIGNocm9ub21ldGVyIHN0YXR1cyB3aXRjaCB0aGUgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICJpX0FQQ0kxNzEwX0dldENocm9ub1Byb2dyZXNzU3RhdHVzIiBmdW5jdGlvbi4gICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBUaGUgcmV0dXJuZWQgdmFsdWUgZnJvbSBwdWxfQ2hyb25vVmFsdWUgcGFyYW1ldGVyIGlzICAgfAotfCAgICAgICAgICAgICAgICAgICAgIG5vdCByZWFsIG1lYXN1cmVkIHRpbWluZy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgWW91IG11c3QgdXNlZCB0aGUgImlfQVBDSTE3MTBfQ29udmVydENocm9ub1ZhbHVlIiAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBvciBtYWtlIHRoaXMgb3BlcmF0aW9uIGZvciBjYWxjdWxhdGUgdGhlICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHRpbWluZzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBUaW1pbmcgPSBwdWxfQ2hyb25vVmFsdWUgKiBwdWxfUmVhbFRpbWluZ0ludGVydmFsLiAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgcHVsX1JlYWxUaW1pbmdJbnRlcnZhbCBpcyB0aGUgc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8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSA6IE1lYXN1cmVtZW50IHN0YXJ0ZWQuICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQSBzdGFydCBzaWduYWwgb2NjdXIuICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIgOiBNZWFzdXJlbWVudCBzdG9wcGVkLiAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEEgc3RvcCBzaWduYWwgb2NjdXIuICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGhlIG1lYXN1cmVtZW50IGlzICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXJtaW5hdGUuICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzogQSBvdmVyZmxvdyBvY2N1ci4gWW91ICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtdXN0IGNoYW5nZSB0aGUgYmFzZSAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWluZyB3aXRjaCB0aGUgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiaV9BUENJMTcxMF9Jbml0Q2hyb25vIiAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGludCAqICBwdWxfQ2hyb25vVmFsdWUgIDogQ2hyb25vbWV0ZXIgdGltaW5nIHZhbHVlLiAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBSZXR1cm4gVmFsdWUgICAgICA6ICAwOiBObyBlcnJvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTE6IFRoZSBoYW5kbGUgcGFyYW1ldGVyIG9mIHRoZSBib2FyZCBpcyB3cm9uZyAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMjogTW9kdWxlIHNlbGVjdGlvbiB3cm9uZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0zOiBUaGUgbW9kdWxlIGlzIG5vdCBhIENocm9ub21ldGVyIG1vZHVsZSAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTQ6IENocm9ub21ldGVyIG5vdCBpbml0aWFsaXNlZCBzZWUgZnVuY3Rpb24gICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgImlfQVBDSTE3MTBfSW5pdENocm9ubyIgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC01OiBUaW1lb3V0IHBhcmFtZXRlciBpcyB3cm9uZyAoMCB0byA2NTUzNSkgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTY6IEludGVycnVwdCByb3V0aW5lIGluc3RhbGxlZC4gWW91IGNhbiBub3QgcmVhZCAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgZGlyZWN0bHkgdGhlIGNocm9ub21ldGVyIG1lYXN1cmVkIHRpbWluZy4gICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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LQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCWlmIChkZXZwcml2LT4KLQkJCQlzX01vZHVsZUluZm9bYl9Nb2R1bE5icl0uCi0JCQkJc19DaHJvbm9Nb2R1bGVJbmZvLmJfQ2hyb25vSW5pdCA9PSAxKSB7Ci0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogVGVzdCB0aGUgdGltb3V0IHBhcmFtZXRlciAqLwotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJaWYgKHVpX1RpbWVPdXQgPD0gNjU1MzVVTCkgewotCi0JCQkJCWZvciAoOzspIHsKLQkJCSAgLyoqKioqKioqKioqKioqKioqKiovCi0JCQkJCQkvKiBSZWFkIHRoZSBzdGF0dXMgKi8KLQkJCSAgLyoqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJCWR3X1N0YXR1cyA9Ci0JCQkJCQkJaW5sKGRldnByaXYtPgotCQkJCQkJCXNfQm9hcmRJbmZvcy4KLQkJCQkJCQl1aV9BZGRyZXNzICsgOCArCi0JCQkJCQkJKDY0ICogYl9Nb2R1bE5icikpOwotCi0JCQkgIC8qKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCS8qIFRlc3QgaWYgb3ZlcmZsb3cgKi8KLQkJCSAgLyoqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCQlpZiAoKGR3X1N0YXR1cyAmIDgpID09IDgpIHsKLQkJCSAgICAgLyoqKioqKioqKioqKioqKioqKi8KLQkJCQkJCQkvKiBPdmVyZmxvdyBvY2N1ciAqLwotCQkJICAgICAvKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCQkJKnBiX0Nocm9ub1N0YXR1cyA9IDM7Ci0KLQkJCSAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCQkvKiBUZXN0IGlmIGNvbnRpbnVvdXMgbW9kZSAqLwotCQkJICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCQkJaWYgKGRldnByaXYtPgotCQkJCQkJCQlzX01vZHVsZUluZm8KLQkJCQkJCQkJW2JfTW9kdWxOYnJdLgotCQkJCQkJCQlzX0Nocm9ub01vZHVsZUluZm8uCi0JCQkJCQkJCWJfQ3ljbGVNb2RlID09Ci0JCQkJCQkJCUFQQ0kxNzEwX0NPTlRJTlVPVVMpCi0JCQkJCQkJewotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJCQkvKiBDbGVhciBzdGF0dXMgcmVnaXN0ZXIgKi8KLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQkJCQlvdXRsKDAsIGRldnByaXYtPnNfQm9hcmRJbmZvcy51aV9BZGRyZXNzICsgMzYgKyAoNjQgKiBiX01vZHVsTmJyKSk7Ci0JCQkJCQkJfQotCi0JCQkJCQkJYnJlYWs7Ci0JCQkJCQl9CS8qICBpZiAoKGR3X1N0YXR1cyAmIDgpID09IDgpICovCi0JCQkJCQllbHNlIHsKLQkJCSAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCQkJLyogVGVzdCBpZiBtZWFzdXJlbWVudCBzdG9wcGVkICovCi0JCQkgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCQkJaWYgKChkd19TdGF0dXMgJiAyKSA9PQotCQkJCQkJCQkyKSB7Ci0JCQkJLyoqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJCQkvKiBBIHN0b3Agc2lnbmFsIG9jY3VyICovCi0JCQkJLyoqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCQkJCSpwYl9DaHJvbm9TdGF0dXMKLQkJCQkJCQkJCT0gMjsKLQotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCQkJCS8qIFRlc3QgaWYgY29udGlubm91cyBtb2RlICovCi0JCQk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dXMgJiAxKSA9PSAxKSAqLwotCQkJCQkJCQllbHNlIHsKLQkJCQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJCQkJLyogTWVhc3VyZW1lbnQgbm90IHN0YXJ0ZWQgKi8KLQkJCQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCQkJCQkqcGJfQ2hyb25vU3RhdHVzCi0JCQkJCQkJCQkJPQotCQkJCQkJCQkJCTA7Ci0JCQkJCQkJCX0JLyogIGlmICgoZHdfU3RhdHVzICYgMSkgPT0gMSkgKi8KLQkJCQkJCQl9CS8qICBpZiAoKGR3X1N0YXR1cyAmIDIpID09IDIpICovCi0JCQkJCQl9CS8qICBpZiAoKGR3X1N0YXR1cyAmIDgpID09IDgpICovCi0KLQkJCQkJCWlmIChkd19UaW1lT3V0ID09IHVpX1RpbWVPdXQpIHsKLQkJCSAgICAgLyoqKioqKioqKioqKioqKioqLwotCQkJCQkJCS8qIFRpbWVvdXQgb2NjdXIgKi8KLQkJCSAgICAgLyoqKioqKioqKioqKioqKioqLwotCi0JCQkJCQkJYnJlYWs7Ci0JCQkJCQl9IGVsc2UgewotCQkJICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCQkvKiBJbmNyZW1lbnQgdGhlIHRpbWVvdXQgKi8KLQkJCSAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJCQlkd19UaW1lT3V0ID0KLQkJCQkJCQkJZHdfVGltZU91dCArIDE7Ci0JCQkJCQkJbWRlbGF5KDEwMDApOwotCi0JCQkJCQl9Ci0JCQkJCX0JLyogIGZvciAoOzspICovCi0KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJLyogVGVzdCBpZiBzdG9wIHNpZ25hbCBvY2N1ciAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCWlmICgqcGJfQ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W1lb3V0IHBhcmFtZXRlciBpcyB3cm9uZyAqLwotCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJRFBSSU5USygiVGltZW91dCBwYXJhbWV0ZXIgaXMgd3JvbmdcbiIpOwotCQkJCQlpX1JldHVyblZhbHVlID0gLTU7Ci0JCQkJfQotCQkJfSBlbHNlIHsKLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCS8qIENocm9ub21ldGVyIG5vdCBpbml0aWFsaXNlZCAqLwotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJRFBSSU5USygiQ2hyb25vbWV0ZXIgbm90IGluaXRpYWxpc2VkXG4iKTsKLQkJCQlpX1JldHVyblZhbHVlID0gLTQ7Ci0JCQl9Ci0JCX0gZWxzZSB7Ci0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCS8qIFRoZSBtb2R1bGUgaXMgbm90IGEgQ2hyb25vbWV0ZXIgbW9kdWxlICovCi0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCURQUklOVEsoIlRoZSBtb2R1bGUgaXMgbm90IGEgQ2hyb25vbWV0ZXIgbW9kdWxlXG4iKTsKLQkJCWlfUmV0dXJuVmFsdWUgPSAtMzsKLQkJfQotCX0gZWxzZSB7Ci0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqLwotCQkvKiBNb2R1bGUgbnVtYmVyIGVycm9yICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqLwotCQlEUFJJTlRLKCJNb2R1bGUgbnVtYmVyIGVycm9yXG4iKTsKLQkJaV9SZXR1cm5WYWx1ZSA9IC0yOwotCX0KLQotCXJldHVybiBpX1JldHVyblZhbHVlOwotfQotCi0vKgotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IEZ1bmN0aW9uIE5hbWUgICAgIDogX0lOVF8gaV9BUENJMTcxMF9Db252ZXJ0Q2hyb25vVmFsdWUgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHVuc2lnbmVkIGNoYXJfICAgICBiX0JvYXJkSGFuZGxlLCAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICAgIGJfTW9kdWxOYnIsICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBVTE9OR18gICB1bF9DaHJvbm9WYWx1ZSwgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBVTE9OR18gcHVsX0hvdXIsICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhciAqXyAgIHBiX01pbnV0ZSwgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhciAqXyAgIHBiX1NlY29uZCwgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgaW50ICpfICBwdWlfTWlsbGlTZWNvbmQsICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgKl8gIHB1aV9NaWNyb1NlY29uZCwgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGludCAqXyAgcHVpX05hbm9TZWNvbmQpICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0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ICBwdWxfSG91ciAgICAgICAgOiBDaHJvbm9tZXRlciB0aW1pbmcgaG91ciAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhciAqXyAgICAgcGJfTWludXRlICAgICAgOiBDaHJvbm9tZXRlciB0aW1pbmcgbWludXRlICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhciAqXyAgICAgcGJfU2Vjb25kICAgICAgOiBDaHJvbm9tZXRlciB0aW1pbmcgc2Vjb25kICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgaW50ICpfICAgIHB1aV9NaWxsaVNlY29uZCAgOiBDaHJvbm9tZXRlciB0aW1pbmcgbWluaSAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vjb25kICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGludCAqXyAgICBwdWlfTWljcm9TZWNvbmQgOiBDaHJvbm9tZXRlciB0aW1pbmcgbWljcm8gICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlY29uZCAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgKl8gICAgcHVpX05hbm9TZWNvbmQgIDogQ2hyb25vbWV0ZXIgdGltaW5nIG5hbm8gICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWNvbmQgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgUmV0dXJuIFZhbHVlICAgICAgOiAgMDogTm8gZXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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Y29uZCkKLXsKLQlzdHJ1Y3QgYWRkaV9wcml2YXRlICpkZXZwcml2ID0gZGV2LT5wcml2YXRlOwotCWludCBpX1JldHVyblZhbHVlID0gMDsKLQlkb3VibGUgZF9Ib3VyOwotCWRvdWJsZSBkX01pbnV0ZTsKLQlkb3VibGUgZF9TZWNvbmQ7Ci0JZG91YmxlIGRfTWlsbGlTZWNvbmQ7Ci0JZG91YmxlIGRfTWljcm9TZWNvbmQ7Ci0JZG91YmxlIGRfTmFub1NlY29uZDsKLQotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkvKiBUZXN0IHRoZSBtb2R1bGUgbnVtYmVyICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JaWYgKGJfTW9kdWxOYnIgPCA0KSB7Ci0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqLwotCQkvKiBUZXN0IGlmIGNocm9ub21ldGVyICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCWlmICgoZGV2cHJpdi0+c19Cb2FyZEluZm9zLgotCQkJCWR3X01vbGR1bGVDb25maWd1cmF0aW9uW2JfTW9kdWxOYnJdICYKLQkJCQkweEZGRkYwMDAwVUwpID09IEFQQ0kxNzEwX0NIUk9OT01FVEVSKSB7Ci0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogVGVzdCBpZiBjaHJvbm9tZXRlciBpbml0aWFsaXNlZCAqLwotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJaWYgKGRldnByaXYtPgotCQkJCXNfTW9kdWxlSW5mb1tiX01vZHVsTmJyXS4KLQkJCQlzX0Nocm9ub01vZHVsZUluZm8uYl9DaHJvbm9Jbml0ID09IDEpIHsKLQkJCQlmcHVfYmVnaW4oKTsKLQotCQkJCWRfSG91ciA9IChkb3VibGUpdWxfQ2hyb25vVmFsdWUgKihkb3VibGUpCi0JCQkJCWRldn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G1pY3JvIHNlY29uZCAqLwotCQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJZF9OYW5vU2Vjb25kID0KLQkJCQkJCWRfTWljcm9TZWNvbmQgLQotCQkJCQkJKnB1aV9NaWNyb1NlY29uZDsKLQkJCQkJZF9OYW5vU2Vjb25kID0gZF9OYW5vU2Vjb25kICogMTAwMDsKLQkJCQkJKnB1aV9OYW5vU2Vjb25kID0gKHVuc2lnbmVkIGludCkgZF9OYW5vU2Vjb25kOwotCQkJCQlicmVhazsKLQkJCQl9Ci0KLQkJCQlmcHVfZW5kKCk7Ci0JCQl9IGVsc2UgewotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogQ2hyb25vbWV0ZXIgbm90IGluaXRpYWxpc2VkICovCi0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQlEUFJJTlRLKCJDaHJvbm9tZXRlciBub3QgaW5pdGlhbGlzZWRcbiIpOwotCQkJCWlfUmV0dXJuVmFsdWUgPSAtNDsKLQkJCX0KLQkJfSBlbHNlIHsKLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogVGhlIG1vZHVsZSBpcyBub3QgYSBDaHJvbm9tZXRlciBtb2R1bGUgKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJRFBSSU5USygiVGhlIG1vZHVsZSBpcyBub3QgYSBDaHJvbm9tZXRlciBtb2R1bGVcbiIpOwotCQkJaV9SZXR1cm5WYWx1ZSA9IC0zOwotCQl9Ci0JfSBlbHNlIHsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKiovCi0JCS8qIE1vZHVsZSBudW1iZXIgZXJyb3IgKi8KLQkgICAvKioqKioqKioqKioqKioqKioqKioqKiovCi0JCURQUklOVEsoIk1vZHVsZSBudW1iZXIgZXJyb3Jcb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gICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFRhc2sgICAgICAgICAgICAgIDogU2V0cyB0aGUgb3V0cHV0IHdpdGNoIGhhcyBiZWVuIHBhc3NlZCB3aXRoIHRoZSAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBwYXJhbWV0ZXIgYl9DaGFubmVsLiBTZXR0aW5nIGFuIG91dHB1dCBtZWFucyBzZXR0aW5nIGFufAotfCAgICAgICAgICAgICAgICAgICAgIG91dHB1dCBoaWdoLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgSW5wdXQgUGFyYW1ldGVycyAgOiB1bnNpZ25lZCBjaGFyXyBiX0JvYXJkSGFuZGxlICAgOiBIYW5kbGUgb2YgYm9hcmQgQVBDSS0xNzEwICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfTW9kdWxOYnIgICAgICA6IFNlbGVjdGVkIG1vZHVsZSBudW1iZXIgKDAgdG8gMyl8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gYl9PdXRwdXRDaGFubmVsIDogU2VsZWN0aW9uIGZyb20gZGlnaXRhbCBvdXRwdXQgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICBDUl9DSEFOKCkgICAgICAgICAgICAgICAgICBjaGFubmVsICgwIHRvIDIpICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIDogQ2hhbm5lbCBIICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgOiBDaGFubmVsIEEgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMiA6IENoYW5uZWwgQiAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IE91dHB1dCBQYXJhbWV0ZXJzIDogLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBSZXR1cm4gVmFsdWUgICAgICA6ICAwOiBObyBlcnJvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTE6IFRoZSBoYW5kbGUgcGFyYW1ldGVyIG9mIHRoZSBib2FyZCBpcyB3cm9uZyAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMjogTW9kdWxlIHNlbGVjdGlvbiB3cm9uZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0zOiBUaGUgbW9kdWxlIGlzIG5vdCBhIENocm9ub21ldGVyIG1vZHVsZSAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTQ6IFRoZSBzZWxlY3RlZCBkaWdpdGFsIG91dHB1dCBpcyB3cm9uZyAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtNTogQ2hyb25vbWV0ZXIgbm90IGluaXRpYWxpc2VkIHNlZSBmdW5jdGlvbiAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAiaV9BUENJMTcxMF9Jbml0Q2hyb25vIiAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSovCi0KLS8qCi0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgRnVuY3Rpb24gTmFtZSAgICAgOiBfSU5UXyBpX0FQQ0kxNzEwX1NldENocm9ub0NobE9mZiAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodW5zaWduZWQgY2hhcl8gIGJfQm9hcmRIYW5kbGUsICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgYl9Nb2R1bE5iciwgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICBiX091dHB1dENoYW5uZWwpICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFRhc2sgICAgICAgICAgICAgIDogUmVzZXRzIHRoZSBvdXRwdXQgd2l0Y2ggaGFzIGJlZW4gcGFzc2VkIHdpdGggdGhlICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBwYXJhbWV0ZXIgYl9DaGFubmVsLiBSZXNldHRpbmcgYW4gb3V0cHV0IG1lYW5zIHNldHRpbmcgfAotfCAgICAgICAgICAgICAgICAgICAgIGFuIG91dHB1dCBsb3cuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgSW5wdXQgUGFyYW1ldGVycyAgOiB1bnNpZ25lZCBjaGFyXyBiX0JvYXJkSGFuZGxlICAgOiBIYW5kbGUgb2YgYm9hcmQgQVBDSS0xNzEwCi0gICAgICAgICAgICAgICAgICAgICAgICBkYXRhWzBdIDogQ2hsIE9OLCBDaGwgT0ZGICwgQ2hsIFJlYWQgLCBQb3J0IFJlYWQKLQotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfTW9kdWxOYnIgIENSX0FSRUYgICAgOiBTZWxlY3RlZCBtb2R1bGUgbnVtYmVyICgwIHRvIDMpfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfT3V0cHV0Q2hhbm5lbCBDUl9DSEFOIDogU2VsZWN0aW9uIGZyb20gZGlnaXRhbCBvdXRwdXQgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsICgwIHRvIDIpICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIDogQ2hhbm5lbCBIICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgOiBDaGFubmVsIEEgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMiA6IENoYW5uZWwgQiAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IE91dHB1dCBQYXJhbWV0ZXJzIDogLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBSZXR1cm4gVmFsdWUgICAgICA6ICAwOiBObyBlcnJvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTE6IFRoZSBoYW5kbGUgcGFyYW1ldGVyIG9mIHRoZSBib2FyZCBpcyB3cm9uZyAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMjogTW9kdWxlIHNlbGVjdGlvbiB3cm9uZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0zOiBUaGUgbW9kdWxlIGlzIG5vdCBhIENocm9ub21ldGVyIG1vZHVsZSAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTQ6IFRoZSBzZWxlY3RlZCBkaWdpdGFsIG91dHB1dCBpcyB3cm9uZyAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtNTogQ2hyb25vbWV0ZXIgbm90IGluaXRpYWxpc2VkIHNlZSBmdW5jdGlvbiAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAiaV9BUENJMTcxMF9Jbml0Q2hyb25vIiAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSovCi0KLS8qCi0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgRnVuY3Rpb24gTmFtZSAgICAgOiBfSU5UXyBpX0FQQ0kxNzEwX1JlYWRDaHJvbm9DaGxWYWx1ZSAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodW5zaWduZWQgY2hhcl8gICBiX0JvYXJkSGFuZGxlLCAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgIGJfTW9kdWxOYnIsICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgYl9JbnB1dENoYW5uZWwsICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhciAqXyBwYl9DaGFubmVsU3RhdHVzKSAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFRhc2sgICAgICAgICAgICAgIDogUmV0dXJuIHRoZSBzdGF0dXMgZnJvbSBzZWxlY3RlZCBkaWdpdGFsIGlucHV0ICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAoYl9JbnB1dENoYW5uZWwpIGZyb20gc2VsZWN0ZWQgY2hyb25vbWV0ZXIgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIG1vZHVsZSAoYl9Nb2R1bE5icikuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgSW5wdXQgUGFyYW1ldGVycyAgOiB1bnNpZ25lZCBjaGFyXyBiX0JvYXJkSGFuZGxlICAgOiBIYW5kbGUgb2YgYm9hcmQgQVBDSS0xNzEwICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfTW9kdWxOYnIgICAgICA6IFNlbGVjdGVkIG1vZHVsZSBudW1iZXIgKDAgdG8gMyl8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gYl9JbnB1dENoYW5uZWwgIDogU2VsZWN0aW9uIGZyb20gZGlnaXRhbCBpbnB1dCAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsICgwIHRvIDIpICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ1JfQ0hBTigpICAgICAgICAgICAgIDAgOiBDaGFubmVsIEUgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSA6IENoYW5uZWwgRiAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyIDogQ2hhbm5lbCBHICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IE91dHB1dCBQYXJhbWV0ZXJzIDogdW5zaWduZWQgY2hhciAqXyBwYl9DaGFubmVsU3RhdHVzIDogRGlnaXRhbCBpbnB1dCBjaGFubmVsIHN0YXR1cy58Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhWzBdICAgICAgICAgICAgICAgIDAgOiBDaGFubmVsIGlzIG5vdCBhY3RpdmUgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSA6IENoYW5uZWwgaXMgYWN0aXZlICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBSZXR1cm4gVmFsdWUgICAgICA6ICAwOiBObyBlcnJvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTE6IFRoZSBoYW5kbGUgcGFyYW1ldGVyIG9mIHRoZSBib2FyZCBpcyB3cm9uZyAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMjogTW9kdWxlIHNlbGVjdGlvbiB3cm9uZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0zOiBUaGUgbW9kdWxlIGlzIG5vdCBhIENocm9ub21ldGVyIG1vZHVsZSAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTQ6IFRoZSBzZWxlY3RlZCBkaWdpdGFsIGlucHV0IGlzIHdyb25nICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtNTogQ2hyb25vbWV0ZXIgbm90IGluaXRpYWxpc2VkIHNlZSBmdW5jdGlvbiAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAiaV9BUENJMTcxMF9Jbml0Q2hyb25vIiAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSovCi0KLS8qCi0rLS0tLS0tLS0tLS0tLS0tLS0t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zaWduZWQgY2hhcl8gYl9Nb2R1bE5iciAgICAgIDogU2VsZWN0ZWQgbW9kdWxlIG51bWJlciAoMCB0byAzKXwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBPdXRwdXQgUGFyYW1ldGVycyA6IHVuc2lnbmVkIGNoYXIgKl8gcGJfUG9ydFZhbHVlICAgOiBEaWdpdGFsIGlucHV0cyBwb3J0IHN0YXR1cy4KLXwgICAgICAgICAgICAgICAgICAgICBkYXRhWzBdCi0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgUmV0dXJuIFZhbHVlICAgICAgOiAgMDogTm8gZXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0xOiBUaGUgaGFuZGxlIHBhcmFtZXRlciBvZiB0aGUgYm9hcmQgaXMgd3JvbmcgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTI6IE1vZHVsZSBzZWxlY3Rpb24gd3JvbmcgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMzogVGhlIG1vZHVsZSBpcyBub3QgYSBDaHJvbm9tZXRlciBtb2R1bGUgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC00OiBDaHJvbm9tZXRlciBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICJpX0FQQ0kxNzEwX0luaXRDaHJvbm8iICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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ogQ29uZmlndXJlIHRoZSBkaWdpdGFsIEkvTyBvcGVyYXRpbmcgbW9kZSBmcm9tIHNlbGVjdGVkIHwKLXwgICAgICAgICAgICAgICAgICAgICBtb2R1bGUgIChiX01vZHVsTmJyKS4gWW91IG11c3QgY2FsbGluZyB0aGlzIGZ1bmN0aW9uIGJlfAotfCAgICAgICAgICAgICAgICAgICAgIGZvciB5b3UgY2FsbCBhbnkgb3RoZXIgZnVuY3Rpb24gd2l0Y2ggYWNjZXNzIG9mIGRpZ2l0YWx8Ci18ICAgICAgICAgICAgICAgICAgICAgSS9PLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBJbnB1dCBQYXJhbWV0ZXJzICA6CQkJCQkJCQkJCQkJCSAgICAgfAotfCAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfTW9kdWxOYnIgICAgICBkYXRhWzBdOiBNb2R1bGUgbnVtYmVyIHRvICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZ3VyZSAoMCB0byAzKSAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gYl9DaGFubmVsQU1vZGUgZGF0YVsxXSAgOiBDaGFubmVsIEEgbW9kZSBzZWxlY3Rpb24gICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgOiBDaGFubmVsIHVzZWQgZm9yIGRpZ2l0YWwgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlucHV0ICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxIDogQ2hhbm5lbCB1c2VkIGZvciBkaWdpdGFsICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXRwdXQgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gYl9DaGFubmVsQk1vZGUgZGF0YVsyXSA6IENoYW5uZWwgQiBtb2RlIHNlbGVjdGlvbiAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCA6IENoYW5uZWwgdXNlZCBmb3IgZGlnaXRhbCAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5wdXQgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgOiBDaGFubmVsIHVzZWQgZm9yIGRpZ2l0YWwgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG91dHB1dAkJCQkJIHwKLQkJCQkJCWRhdGFbMF0JICBtZW1vcnkgb24vb2ZmCi1BY3RpdmF0ZXMgYW5kIGRlYWN0aXZhdGVzIHRoZSBkaWdpdGFsIG91dHB1dCBtZW1vcnkuCi0JCQkJCQlBZnRlciBoYXZpbmcgICAgICB8Ci18ICAgICAgICAgICAgICAgICBjYWxsZWQgdXAgdGhpcyBmdW5jdGlvbiB3aXRoIG1lbW9yeSBvbix0aGUgb3V0cHV0IHlvdSBoYXZlIHByZXZpb3VzbHl8Ci18ICAgICAgICAgICAgICAgICAgICAgYWN0aXZhdGVkIHdpdGggdGhlIGZ1bmN0aW9uIGFyZSBub3QgcmVzZXQKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBPdXRwdXQgUGFyYW1ldGVycyA6IC0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgUmV0dXJuIFZhbHVlICAgICAgOiAwOiBObyBlcnJvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTE6IFRoZSBoYW5kbGUgcGFyYW1ldGVyIG9mIHRoZSBib2FyZCBpcyB3cm9uZyAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtMjogVGhlIG1vZHVsZSBwYXJhbWV0ZXIgaXMgd3JvbmcgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC0zOiBUaGUgbW9kdWxlIGlzIG5vdCBhIGRpZ2l0YWwgSS9PIG1vZHVsZSAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTQ6IEJpLWRpcmVjdGlvbmFsIGNoYW5uZWwgQSBjb25maWd1cmF0aW9uIGVycm9yICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtNTogQmktZGlyZWN0aW9uYWwgY2hhbm5lbCBCIGNvbmZpZ3VyYXRpb24gZXJyb3IgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotKi8KLQotc3RhdGljIGludCBpX0FQQ0kxNzEwX0luc25Db25maWdEaWdpdGFsSU8oc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiwKLQkJCQkJICBzdHJ1Y3QgY29tZWRpX3N1YmR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AoYl9Db25maWdUeXBlKSB7Ci0JY2FzZSBBUENJMTcxMF9ESUdJT19NRU1PUllPTk9GRjoKLQotCQlpZiAoYl9NZW1vcnlPbk9mZikJLyogIElmIE1lbW9yeSBPTiAqLwotCQl7Ci0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCS8qIFNldCB0aGUgb3V0cHV0IG1lbW9yeSBvbiAqLwotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCWRldnByaXYtPnNfTW9kdWxlSW5mb1tiX01vZHVsTmJyXS4KLQkJCQlzX0RpZ2l0YWxJT0luZm8uYl9PdXRwdXRNZW1vcnlFbmFibGVkID0gMTsKLQotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCS8qIENsZWFyIHRoZSBvdXRwdXQgbWVtb3J5ICovCi0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJZGV2cHJpdi0+c19Nb2R1bGVJbmZvW2JfTW9kdWxOYnJdLgotCQkJCXNfRGlnaXRhbElPSW5mby5kd19PdXRwdXRNZW1vcnkgPSAwOwotCQl9IGVsc2UJCS8qICBJZiBtZW1vcnkgb2ZmICovCi0JCXsKLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCS8qIFNldCB0aGUgb3V0cHV0IG1lbW9yeSBvZmYgKi8KLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJZGV2cHJpdi0+c19Nb2R1bGVJbmZvW2JfTW9kdWxOYnJdLgotCQkJCXNfRGlnaXRhbElPSW5mby5iX091dHB1dE1lbW9yeUVuYWJsZWQgPSAwOwotCQl9Ci0JCWJyZWFrOwotCi0JY2FzZSBBUENJMTcxMF9ESUdJT19JTklUOgotCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCS8qIFRlc3QgaWYgZGlnaXRhbCBJL08gY291bnRlciAqLwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCWlmICgoZGV2cHJpdi0+c19Cb2FyZEluZm9zLgotCQkJCWR3X01vbGR1bGVDb25maWd1cmF0aW9uW2JfTW9kdWxOYnJdICYKLQkJCQkweEZGRkYwMDAwVUwpID09IEFQQ0kxNzEwX0RJR0lUQUxfSU8pIHsKLQotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkvKiBUZXN0IHRoZSBiaS1kaXJlY3Rpb25hbCBjaGFubmVsIEEgY29uZmlndXJhdGlvbiAqLwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCWlmICgoYl9DaGFubmVsQU1vZGUgPT0gMCkgfHwgKGJfQ2hhbm5lbEFNb2RlID09IDEpKSB7Ci0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkvKiBUZXN0IHRoZSBiaS1kaXJlY3Rpb25hbCBjaGFubmVsIEIgY29uZmlndXJhdGlvbiAqLwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQlpZiAoKGJfQ2hhbm5lbEJNb2RlID09IDApCi0JCQkJCXx8IChiX0NoYW5uZWxCTW9kZSA9PSAxKSkgewotCQkJCQlkZXZwcml2LT5zX01vZHVsZUluZm9bYl9Nb2R1bE5icl0uCi0JCQkJCQlzX0RpZ2l0YWxJT0luZm8uYl9EaWdpdGFsSW5pdCA9Ci0JCQkJCQkxOwotCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkvKiBTYXZlIGNoYW5uZWwgQSBjb25maWd1cmF0aW9uICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCWRldnByaXYtPnNfTW9kdWxlSW5mb1tiX01vZHVsTmJyXS4KLQkJCQkJCXNfRGlnaXRhbElPSW5mby4KLQkJCQkJCWJfQ2hhbm5lbEFNb2RlID0gYl9DaGFubmVsQU1vZGU7Ci0KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCS8qIFNhdmUgY2hhbm5lbCBCIGNvbmZpZ3VyYXRpb24gKi8KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJZGV2cHJpdi0+c19Nb2R1bGVJbmZvW2JfTW9kdWxOYnJdLgotCQkJCQkJc19EaWdpdGFsSU9JbmZvLgotCQkJCQkJYl9DaGFubmVsQk1vZGUgPSBiX0NoYW5uZWxCTW9kZTsKLQotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJLyogU2V0IHRoZSBjaGFubmVsIEEgYW5kIEIgY29uZmlndXJhdGlvbiAqLwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQlkd19Xcml0ZUNvbmZpZyA9Ci0JCQkJCQkodW5zaWduZWQgaW50KSAoYl9DaGFubmVsQU1vZGUgfAotCQkJCQkJKGJfQ2hhbm5lbEJNb2RlICogMikpOwotCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJLyogV3JpdGUgdGhlIGNvbmZpZ3VyYXRpb24gKi8KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCW91dGwoZHdfV3JpdGVDb25maWcsCi0JCQkJCQlkZXZwcml2LT5zX0JvYXJkSW5mb3MuCi0JCQkJCQl1aV9BZGRyZXNzICsgNCArCi0JCQkJCQkoNjQgKiBiX01vZHVsTmJyKSk7Ci0KLQkJCQl9IGVsc2UgewotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCS8qIEJpLWRpcmVjdGlvbmFsIGNoYW5uZWwgQiBjb25maWd1cmF0aW9uIGVyc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ciAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMCB0byAzKSAgICAgICAgICAgICAgICAgfAotfCAgdW5zaWduZWQgY2hhcl8gYl9JbnB1dENoYW5uZWwgQ1JfQ0hBTihjaGFuc3BlYykgICAgICAgIDogU2VsZWN0aW9uIGZyb20gZGlnaXRhbCAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnB1dCAoIDAgdG8gNikgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgOiBDaGFubmVsIEMgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSA6IENoYW5uZWwgRCAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyIDogQ2hhbm5lbCBFICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMgOiBDaGFubmVsIEYgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCA6IENoYW5uZWwgRyAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1IDogQ2hhbm5lbCBBICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDYgOiBDaGFubmVsIEIKLQotCi0JfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IE91dHB1dCBQYXJhbWV0ZXJzIDoJCQkJCSBkYXRhWzBdICAgOiBEaWdpdGFsIGlucHV0IGNoYW5uZWwgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCA6IENoYW5ubGUgaXMgbm90IGFjdGl2ZXwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxIDogQ2hhbm5sZSBpcyBhY3RpdmUgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFJldHVybiBWYWx1ZSAgICAgIDogMDogTm8gZXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC0xOiBUaGUgaGFuZGxlIHBhcmFtZXRlciBvZiB0aGUgYm9hcmQgaXMgd3JvbmcgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTI6IFRoZSBtb2R1bGUgcGFyYW1ldGVyIGlzIHdyb25nICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtMzogVGhlIG1vZHVsZSBpcyBub3QgYSBkaWdpdGFsIEkvTyBtb2R1bGUgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC00OiBUaGUgc2VsZWN0ZWQgZGlnaXRhbCBJL08gZGlnaXRhbCBpbnB1dCBpcyB3cm9uZyAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTU6IERpZ2l0YWwgSS9PIG5vdCBpbml0aWFsaXNlZCAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtNjogVGhlIGRpZ2l0YWwgY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MpOwotCWJfSW5wdXRDaGFubmVsID0gKHVuc2lnbmVkIGNoYXIpIENSX0NIQU4oaW5zbi0+Y2hhbnNwZWMpOwotCWRhdGFbMF0gPSAwOwotCXBiX0NoYW5uZWxTdGF0dXMgPSAodW5zaWduZWQgY2hhciAqKSAmZGF0YVswXTsKLQlpX1JldHVyblZhbHVlID0gaW5zbi0+bjsKLQotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkvKiBUZXN0IHRoZSBtb2R1bGUgbnVtYmVyICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JaWYgKGJfTW9kdWxOYnIgPCA0KSB7Ci0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCS8qIFRlc3QgaWYgZGlnaXRhbCBJL08gY291bnRlciAqLwotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCWlmICgoZGV2cHJpdi0+c19Cb2FyZEluZm9zLgotCQkJCWR3X01vbGR1bGVDb25maWd1cmF0aW9uW2JfTW9kdWxOYnJdICYKLQkJCQkweEZGRkYwMDAwVUwpID09IEFQQ0kxNzEwX0RJR0lUQUxfSU8pIHsKLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogVGVzdCB0aGUgZGlnaXRhbCBpbW5wdXQgY2hhbm5lbCBudW1iZXIgKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQlpZiAoYl9JbnB1dENoYW5uZWwgPD0gNikgewotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogVGVzdCBpZiB0aGUgZGlnaXRhbCBJL08gbW9kdWxlIGluaXRpYWxpc2VkICovCi0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCWlmIChkZXZwcml2LT5zX01vZHVsZUluZm9bYl9Nb2R1bE5icl0uCi0JCQkJCXNfRGlnaXRhbElPSW5mby5iX0RpZ2l0YWxJbml0ID09IDEpIHsKLQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkvKiBUZXN0IGlmIGNoYW5uZWwgQSBvciBjaGFubmVsIEIgKi8KLQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCWlmIChiX0lucHV0Q2hhbm5lbCA+IDQpIHsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCQkvKiBUZXN0IGlmIGNoYW5uZWwgQSAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQkJaWYgKGJfSW5wdXRDaGFubmVsID09IDUpIHsKLQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCQkvKiBUZXN0IHRoZSBjaGFubmVsIEEgbW9kZSAqLwotCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCQkJaWYgKGRldnByaXYtPgotCQkJCQkJCQlzX01vZHVsZUluZm8KLQkJCQkJCQkJW2JfTW9kdWxOYnJdLgotCQkJCQkJCQlzX0RpZ2l0YWxJT0luZm8uCi0JCQkJCQkJCWJfQ2hhbm5lbEFNb2RlCi0JCQkJCQkJCSE9IDApIHsKLQkJCSAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJCQkvKiBUaGUgZGlnaXRhbCBjaGFubmVsIEEgaXMgdXNlZCBmb3Igb3V0cHV0ICovCi0JCQkgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQkJCQlpX1JldHVyblZhbHVlID0KLQkJCQkJCQkJCS02OwotCQkJCQkJCX0KLQkJCQkJCX0JLyogIGlmIChiX0lucHV0Q2hhbm5lbCA9PSA1KSAqLwotCQkJCQkJZWxzZSB7Ci0JCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCQkJLyogVGVzdCB0aGUgY2hhbm5lbCBCIG1vZGUgKi8KLQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQkJCWlmIChkZXZwcml2LT4KLQkJCQkJCQkJc19Nb2R1bGVJbmZvCi0JCQkJCQkJCVtiX01vZHVsTmJyXS4KLQkJCQkJCQkJc19EaWdpdGFsSU9JbmZvLgotCQkJCQkJCQliX0NoYW5uZWxCTW9kZQotCQkJCQkJCQkhPSAwKSB7Ci0JCQkgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCQkJLyogVGhlIGRpZ2l0YWwgY2hhbm5lbCBCIGlzIHVzZWQgZm9yIG91dHB1dCAqLwotCQkJICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJCQkJaV9SZXR1cm5WYWx1ZSA9Ci0JCQkJCQkJCQktNzsKLQkJCQkJCQl9Ci0JCQkJCQl9CS8qICBpZiAoYl9JbnB1dENoYW5uZWwgPT0gNSkgKi8KLQkJCQkJfQkvKiAgaWYgKGJfSW5wdXRDaGFubmVsID4gNCkgKi8KLQotCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkvKiBUZXN0IGlmIGVycm9yIG9jY3VyICovCi0JCSAgICAvKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJaWYgKGlfUmV0dXJuVmFsdWUgPj0gMCkgewotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJLyogUmVhZCBhbGwgZGlnaXRhbCBpbnB1dCAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKgotKiBJTlBEVyAocHNfQVBDSTE3MT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AgY2hhbm5lbCAoMCB0byAyKSAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIDogQ2hhbm5lbCBIICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgOiBDaGFubmVsIEEgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMiA6IENoYW5uZWwgQiAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBPdXRwdXQgUGFyYW1ldGVycyA6IC0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgUmV0dXJuIFZhbHVlICAgICAgOiAwOiBObyBlcnJvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTE6IFRoZSBoYW5kbGUgcGFyYW1ldGVyIG9mIHRoZSBib2FyZCBpcyB3cm9uZyAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtMjogVGhlIG1vZHVsZSBwYXJhbWV0ZXIgaXMgd3JvbmcgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC0zOiBUaGUgbW9kdWxlIGlzIG5vdCBhIGRpZ2l0YWwgSS9PIG1vZHVsZSAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTQ6IFRoZSBzZWxlY3RlZCBkaWd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gaW5pdGlhbGlzZWQgKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJaWYgKGRldnByaXYtPnNfTW9kdWxlSW5mb1tiX01vZHVsTmJyXS4KLQkJCQlzX0RpZ2l0YWxJT0luZm8uYl9EaWdpdGFsSW5pdCA9PSAxKSB7Ci0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCS8qIFRlc3QgdGhlIGRpZ2l0YWwgb3V0cHV0IGNoYW5uZWwgbnVtYmVyICovCi0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJc3dpdGNoIChiX091dHB1dENoYW5uZWwpIHsKLQkJICAgIC8qKioqKioqKioqKioqLwotCQkJCQkvKiBDaGFubmVsIEggKi8KLQkJICAgIC8qKioqKioqKioqKioqLwotCi0JCQkJY2FzZSAwOgotCQkJCQlicmVhazsKLQotCQkgICAgLyoqKioqKioqKioqKiovCi0JCQkJCS8qIENoYW5uZWwgQSAqLwotCQkgICAgLyoqKioqKioqKioqKiovCi0KLQkJCQljYXNlIDE6Ci0JCQkJCWlmIChkZXZwcml2LT5zX01vZHVsZUluZm9bYl9Nb2R1bE5icl0uCi0JCQkJCQlzX0RpZ2l0YWxJT0luZm8uCi0JCQkJCQliX0NoYW5uZWxBTW9kZSAhPSAxKSB7Ci0JCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCQkvKiBUaGUgZGlnaXRhbCBjaGFubmVsIEEgaXMgdXNlZCBmb3IgaW5wdXQgKi8KLQkJCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQkJaV9SZXR1cm5WYWx1ZSA9IC02OwotCQkJCQl9Ci0JCQkJCWJyZWFrOwotCi0JCSAgICAvKioqKioqKioqKioqKi8KLQkJCQkJLyogQ2hhbm5lbCBCICovCi0JCSAgICAvKioqKioqKioqKioqKi8KLQotCQkJCWNhc2UgMjoKLQkJCQkJaWYgKGRldnByaXYtPnNfTW9kdWxlSW5mb1tiX01vZHVsTmJyXS4KLQkJCQkJCXNfRGlnaXRhbElPSW5mby4KLQkJCQkJCWJfQ2hhbm5lbEJNb2RlICE9IDEpIHsKLQkJCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCS8qIFRoZSBkaWdpdGFsIGNoYW5uZWwgQiBpcyB1c2VkIGZvciBpbnB1dCAqLwotCQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCQlpX1JldHVyblZhbHVlID0gLTc7Ci0JCQkJCX0KLQkJCQkJYnJlYWs7Ci0KLQkJCQlkZWZhdWx0OgotCQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkvKiBUaGUgc2VsZWN0ZWQgZGlnaXRhbCBvdXRwdXQgaXMgd3JvbmcgKi8KLQkJCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQlpX1JldHVyblZhbHVlID0gLTQ7Ci0JCQkJCWJyZWFrOwotCQkJCX0KLQotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCS8qIFRlc3QgaWYgZXJyb3Igb2NjdXIgKi8KLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCWlmIChpX1JldHVyblZhbHVlID49IDApIHsKLQotCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJLyogVGVzdCBpZiBzZXQgY2hhbm5lbCBPTiAgICAgICAgKi8KLQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCWlmIChkYXRhWzBdKSB7Ci0JCSAgICAvKioqKioqKioq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gICAtMjogVGhlIG1vZHVsZSBwYXJhbWV0ZXIgaXMgd3JvbmcgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC0zOiBUaGUgbW9kdWxlIGlzIG5vdCBhIGRpZ2l0YWwgSS9PIG1vZHVsZSAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTQ6IERpZ2l0YWwgSS9PIG5vdCBpbml0aWFsaXNlZAotCi0JCQkJT1VUUFVUOgkgIDA6IE5vIGVycm9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtMTogVGhlIGhhbmRsZSBwYXJhbWV0ZXIgb2YgdGhlIGJvYXJkIGlzIHdyb25nICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC0yOiBUaGUgbW9kdWxlIHBhcmFtZXRlciBpcyB3cm9uZyAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTM6IFRoZSBtb2R1bGUgaXMgbm90IGEgZGlnaXRhbCBJL08gbW9kdWxlICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtNDogT3V0cHV0IHZhbHVlIHdyb25nICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC01OiBkaWdpdGFsIEkvTyBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICIgaV9BUENJMTcxMF9Jbml0RGlnaXRhbElPIiAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtNjogVGhlIGRpZ2l0YWwgY2hhbm5lbCBBIGlzIHVzZWQgZm9yIGlucHV0ICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC03OiBUaGUgZGlnaXRhbCBjaGFubmVsIEIga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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCWlfUmV0dXJuVmFsdWUgPSAtNDsKLQkJCQl9Ci0JCQl9IGVsc2UgewotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogVGhlIG1vZHVsZSBpcyBub3QgYSBkaWdpdGFsIEkvTyBtb2R1bGUgKi8KLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJaV9SZXR1cm5WYWx1ZSA9IC0zOwotCQkJfQotCQl9IGVsc2UgewotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCS8qIE1vZHVsZSBudW1iZXIgZXJyb3IgKi8KLQkgICAvKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCWlfUmV0dXJuVmFsdWUgPSAtMjsKLQkJfQotCi0JCWJyZWFrOwotCi0JY2FzZSBBUENJMTcxMF9PVVRQVVQ6Ci0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkvKiBUZXN0IHRoZSBtb2R1bGUgbnVtYmVyICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCWlmIChiX01vZHVsTmJyIDwgNCkgewotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogVGVzdCBpZiBkaWdpdGFsIEkvTyBjb3VudGVyICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCWlmICgoZGV2cHJpdi0+c19Cb2FyZEluZm9zLgotCQkJCQlkd19Nb2xkdWxlQ29uZmlndXJhdGlvbltiX01vZHVsTmJyXSAmCi0JCQkJCTB4RkZGRjAwMDBVTCkgPT0gQVBDSTE3MTBfRElHSVRBTF9JTykgewotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCS8qIFRlc3QgaWYgdGhlIGRpZ2l0YWwgSS9PIG1vZHVsZSBpbml0aWFsaXNlZCAqLwotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJaWYgKGRldnByaXYtPnNfTW9kdWxlSW5mb1tiX01vZHVsTmJyXS4KLQkJCQkJc19EaWdpdGFsSU9JbmZvLmJfRGlnaXRhbEluaXQgPT0gMSkgewotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkvKiBUZXN0IHRoZSBwb3J0IHZhbHVlICovCi0JCSAvKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJaWYgKGJfUG9ydFZhbHVlIDw9IDcpIHsKLQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCS8qIFRlc3QgdGhlIGRpZ2l0YWwgb3V0cHV0IGNoYW5uZWwgKi8KLQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJLyogVGVzdCBpZiBjaGFubmVsIEEgdXNlZCAqLwotCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCQlpZiAoKGJfUG9ydFZhbHVlICYgMikgPT0gMikgewotCQkJCQkJCWlmIChkZXZwcml2LT4KLQkJCQkJCQkJc19Nb2R1bGVJbmZvCi0JCQkJCQkJCVtiX01vZHVsTmJyXS4KLQkJCQkJCQkJc19EaWdpdGFsSU9JbmZvLgotCQkJCQkJCQliX0NoYW5uZWxBTW9kZQotCQkJCQkJCQkhPSAxKSB7Ci0JCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJCQkvKiBUaGUgZGlnaXRhbCBjaGFubmVsIEEgaXMgdXNlZCBmb3IgaW5wdXQgKi8KLQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqK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ioqKioqKioqLwotCi0JCQkJCQlpX1JldHVyblZhbHVlID0gLTQ7Ci0JCQkJCX0KLQkJCQl9IGVsc2UgewotCQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJLyogRGlnaXRhbCBJL08gbm90IGluaXRpYWxpc2VkICovCi0JCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCWlfUmV0dXJuVmFsdWUgPSAtNTsKLQkJCQl9Ci0JCQl9IGVsc2UgewotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogVGhlIG1vZHVsZSBpcyBub3QgYSBkaWdpdGFsIEkvTyBtb2R1bGUgKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJaV9SZXR1cm5WYWx1ZSA9IC0zOwotCQkJfQotCQl9IGVsc2UgewotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCS8qIE1vZHVsZSBudW1iZXIgZXJyb3IgKi8KLQkgICAvKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCWlfUmV0dXJuVmFsdWUgPSAtMjsKLQkJfQotCQlicmVhazsKLQotCWRlZmF1bHQ6Ci0JCWlfUmV0dXJuVmFsdWUgPSAtOTsKLQkJRFBSSU5USygiTk8gSU5QVVQvT1VUUFVUIHNwZWNpZmllZFxuIik7Ci0JfQkJCS8qIHN3aXRjaCBJTlBVVCAvIE9VVFBVVCAqLwotCXJldHVybiBpX1JldHVyblZhbHVlOwotfQpkaWZmIC0tZ2l0IGEvZHJpdmVycy9zdGFnaW5nL2NvbWVkaS9kcml2ZXJzL2FkZGktZGF0YS9BUENJMTcxMF9JTkNDUFQuYyBiL2RyaXZlcnMvc3RhZ2luZy9jb21lZGkvZHJpdmVycy9hZGRpLWRhdGEvQVBDSTE3MTBfSU5DQ1BULmMKZGVsZXRlZCBma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U3RvbHogICB8IERhdGUgICAgIDogIDAyLzEyLzIwMDIgICAgICAgICAgICAgICAgfAotICArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0gIHwgRGVzY3JpcHRpb24gOiAgIEFQQ0ktMTcxMCBpbmNyZW1lbnRhbCBjb3VudGVyIG1vZHVsZSAgICAgICAgICAgICAgICAgIHwKLSAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVVBEQVRFUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0gIHwgICBEYXRlICAgfCAgIEF1dGhvciAgfCAgICAgICAgICBEZXNjcmlwdGlvbiBvZiB1cGRhdGVzICAgICAgICAgICAgICAgIHwKLSAgKy0tLS0tLS0tLS0rLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotICB8ICAgICAgICAgIHwgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gIHwtLS0tLS0tLS0tfC0tLS0tLS0tLS0tfC0tLS0tLS0tLS0tLS0t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duZWQgY2hhcl8gICAgICAgICAgYl9GaXJzdENvdW50ZXJNb2R1cywgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgICAgICAgICBiX0ZpcnN0Q291bnRlck9wdGlvbiwgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgICAgICAgIGJfU2Vjb25kQ291bnRlck1vZHVzLCAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICAgICAgICAgYl9TZWNvbmRDb3VudGVyT3B0aW9uKSAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgVGFzayAgICAgICAgICAgICAgOiBDb25maWd1cmUgdGhlIGNvdW50ZXIgb3BlcmF0aW5nIG1vZGUgZnJvbSBzZWxlY3RlZCAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIG1vZHVsZSAoYl9Nb2R1bE5icikuIFlvdSBtdXN0IGNhbGxpbmcgdGhpcyBmdW5jdGlvbiBiZSB8Ci18ICAgICAgICAgICAgICAgICAgICAgZm9yIHlvdSBjYWxsIGFueSBvdGhlciBmdW5jdGlvbiB3aXRjaCBhY2Nlc3Mgb2YgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBjb3VudGVycy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICBDb3VudGVyIHJhbmdlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgIC0tLS0tLS0tLS0tLS0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKyB8Ci18IHwgUGFyYW1ldGVyICAgICAgIFBhc3NlZCB2YWx1ZSAgICAgICB8ICAgICAgICBEZXNjcmlwdGlvbiAgICAgICAgICAgICAgICB8IHwKLXwgfC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLXwgfAotfCB8Yl9Nb2R1bE5iciAgIEFQQ0kxNzEwXzE2QklUX0NPVU5URVIgfCAgVGhlIG1vZHVsZSBpcyBjb25maWd1cmVkIGZvciAgICAgfCB8Ci18IHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICB0d28gMTYtYml0IGNvdW50ZXIuICAgICAgICAgICAgICB8IHwKLXwgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgIC0gYl9GaXJzdENvdW50ZXJNb2R1cyBhbmQgICAgICAgIHwgfAotfCB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICBiX0ZpcnN0Q291bnRlck9wdGlvbiAgICAgICAgICAgfCB8Ci18IHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgIGNvbmZpZ3VyZSB0aGUgZmlyc3QgMTYgYml0ICAgICB8IHwKLXwgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgY291bnRlci4gICAgICAgICAgICAgICAgICAgICAgIHwgfAotfCB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgLSBiX1NlY29uZENvdW50ZXJNb2R1cyBhbmQgICAgICAgfCB8Ci18IHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgIGJfU2Vjb25kQ291bnRlck9wdGlvbiAgICAgICAgICB8IHwKLXwgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgY29uZmlndXJlIHRoZSBzZWNvbmQgMTYgYml0ICAgIHwgfAotfCB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICBjb3VudGVyLiAgICAgICAgICAgICAgICAgICAgICAgfCB8Ci18IHwtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS18IHwKLXwgfGJfTW9kdWxOYnIgICBBUENJMTcxMF8zMkJJVF9DT1VOVEVSIHwgIFRoZSBtb2R1bGUgaXMgY29uZmlndXJlZCBmb3Igb25lIHwgfAotfCB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgMzItYml0IGNvdW50ZXIuICAgICAgICAgICAgICAgICAgfCB8Ci18IHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAtIGJfRmlyc3RDb3VudGVyTW9kdXMgYW5kICAgICAgICB8IHwKLXwgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgYl9GaXJzdENvdW50ZXJPcHRpb24gICAgICAgICAgIHwgfAotfCB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICBjb25maWd1cmUgdGhlIDMyIGJpdCBjb3VudGVyLiAgfCB8Ci18IHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAtIGJfU2Vjb25kQ291bnRlck1vZHVzIGFuZCAgICAgICB8IHwKLXwgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgYl9TZWNvbmRDb3VudGVyT3B0aW9uICAgICAgICAgIHwgfAotfCB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICBhcmUgbm90IHVzZWQgYW5kIGhhdmUgbm8gICAgICAgfCB8Ci18IHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgIGltcG9ydGFuY2UuICAgICAgICAgICAgICAgICAgICB8IHwKLXwgKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgIENvdW50ZXIgb3BlcmF0aW5nIG1vZGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICstLS0tLS0tLS0tLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rIHwKLXwgfCAgICBQYXJhbWV0ZXIgICAgICAgfCAgICAgUGFzc2VkIHZhbHVlICAgICAgICB8ICAgIERlc2NyaXB0aW9uICAgICAgICAgIHwgfAotfCB8LS0tLS0tLS0tLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tfCB8Ci18IHxiX0ZpcnN0Q291bnRlck1vZHVzIHwgQVBDSTE3MTBfUVVBRFJVUExFX01PREUgfCBJbiB0aGUgcXVhZHJ1cGxlIG1vZGUsICB8IHwKLXwgfCAgICAgICBvciAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICB8IHRoZSBlZGdlIGFuYWx5c2lzICAgICAgIHwgfAotfCB8Yl9TZWNvbmRDb3VudGVyTW9kdXN8ICAgICAgICAgICAgICAgICAgICAgICAgIHwgY2lyY3VpdCBnZW5lcmF0ZXMgYSAgICAgfCB8Ci18IHwgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgfCBjb3VudGluZyBwdWxzZSBmcm9tICAgICB8IHwKLXwgfCAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICB8IGVhY2ggZWRnZSBvZiAyIHNpZ25hbHMgIHwgfAotfCB8ICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgIHwgd2hpY2ggYXJlIHBoYXNlIHNoaWZ0ZWQgfCB8Ci18IHwgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgfCBpbiByZWxhdGlvbiB0byBlYWNoICAgICB8IHwKLXwgfCAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICB8IG90aGVyLiAgICAgICAgICAgICAgICAgIHwgfAotfCB8LS0tLS0tLS0tLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tfCB8Ci18IHxiX0ZpcnN0Q291bnRlck1vZHVzIHwgICBBUENJMTcxMF9ET1VCTEVfTU9ERSAgfCBGdW5jdGlvbnMgaW4gdGhlIHNhbWUgICB8IHwKLXwgfCAgICAgICBvciAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICB8IHdheSBhcyB0aGUgcXVhZHJ1cGxlICAgIHwgfAotfCB8Yl9TZWNvbmRDb3VudGVyTW9kdXN8ICAgICAgICAgICAgICAgICAgICAgICAgIHwgbW9kZSwgZXhjZXB0IHRoYXQgb25seSAgfCB8Ci18IHwgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgfCB0d28gb2YgdGhlIGZvdXIgZWRnZXMgICB8IHwKLXwgfCAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICB8IGFyZSBhbmFseXNlZCBwZXIgICAgICAgIHwgfAotfCB8ICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgIHwgcGVyaW9kICAgICAgICAgICAgICAgICAgfCB8Ci18IHwtLS0tLS0tLS0tLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS18IHwKLXwgfGJfRmlyc3RDb3VudGVyTW9kdXMgfCAgIEFQQ0kxNzEwX1NJTVBMRV9NT0RFICB8IEZ1bmN0aW9ucyBpbiB0aGUgc2FtZSAgIHwgfAotfCB8ICAgICAgIG9yICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgIHwgd2F5IGFzIHRoZSBxdWFkcnVwbGUgICAgfCB8Ci18IHxiX1NlY29uZENvdW50ZXJNb2R1c3wgICAgICAgICAgICAgICAgICAgICAgICAgfCBtb2RlLCBleGNlcHQgdGhhdCBvbmx5ICB8IHwKLXwgfCAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICB8IG9uZSBvZiB0aGUgZm91ciBlZGdlcyAgIHwgfAotfCB8ICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgIHwgaXMgYW5hbHlzZWQgcGVyICAgICAgICAgfCB8Ci18IHwgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgfCBwZXJpb2QuICAgICAgICAgICAgICAgICB8IHwKLXwgfC0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLXwgfAotfCB8Yl9GaXJzdENvdW50ZXJNb2R1cyB8ICAgQVBDSTE3MTBfRElSRUNUX01PREUgIHwgSW4gdGhlIGRpcmVjdCBtb2RlIHRoZSAgfCB8Ci18IHwgICAgICAgb3IgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgfCBib3RoIGVkZ2UgYW5hbHlzaXMgICAgICB8IHwKLXwgfGJfU2Vjb25kQ291bnRlck1vZHVzfCAgICAgICAgICAgICAgICAgICAgICAgICB8IGNpcmN1aXRzIGFyZSBpbmFjdGl2ZS4gIHwgfAotfCB8ICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgIHwgVGhlIGlucHV0cyBBLCBCIGluIHRoZSAgfCB8Ci18IHwgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgfCAzMi1iaXQgbW9kZSBvciBBLCBCIGFuZCB8IHwKLXwgfCAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICB8IEMsIEQgaW4gdGhlIDE2LWJpdCBtb2RlIHwgfAotfCB8ICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgIHwgcmVwcmVzZW50LCBlYWNoLCBvbmUgICAgfCB8Ci18IHwgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgfCBjbG9jayBwdWxzZSBnYXRlIGNpcmN1aXR8IHwKLXwgfCAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICB8IFRoZXJlIGJ5IGZyZXF1ZW5jeSBhbmQgIHwgfAotfCB8ICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgIHwgcHVsc2UgZHVyYXRpb24gICAgICAgICAgfCB8Ci18IHwgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgfCBtZWFzdXJlbWVudHMgY2FuIGJlICAgICB8IHwKLXwgfCAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICB8IHBlcmZvcm1lZC4gICAgICAgICAgICAgIHwgfAotfCArLS0tLS0tLS0tLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKyB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICBJTVBPUlRBTlQhICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgIElmIHlvdSBoYXZlIGNvbmZpZ3VyZWQgdGhlIG1vZHVsZSBmb3IgdHdvIDE2LWJpdCBjb3VudGVyLCBhIG1peGVkICAgIHwKLXwgICAgICAgbW9kZSB3aXRoIGEgY291bnRlciBpbiBxdWFkcnVwbGUvZG91YmxlL3NpbmdsZSBtb2RlICAgICAgICAgICAgICAgICAgfAotfCAgICAgICBhbmQgdGhlIG90aGVyIGNvdW50ZXIgaW4gZGlyZWN0IG1vZGUgaXMgbm90IHBvc3NpYmxlISAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgIENvdW50ZXIgb3BlcmF0aW5nIG9wdGlvbiBmb3IgcXVhZHJ1cGxlL2RvdWJsZS9zaW1wbGUgbW9kZSAgICAgICAgICB8Ci18ICAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSt8Ci18IHwgICAgICAgUGFyYW1ldGVyICAgICAgfCAgICAgUGFzc2VkIHZhbHVlICAgICAgICB8ICBEZXNjcmlwdGlvbiAgICAgICAgICAgfHwKLXwgfC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS18fAotfCB8Yl9GaXJzdENvdW50ZXJPcHRpb24gIHwgQVBDSTE3MTBfSFlTVEVSRVNJU19PTiAgfCBJbiBib3RoIGVkZ2UgYW5hbHlzaXMgIHx8Ci18IHwgICAgICAgIG9yICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICB8IGNpcmN1aXRzIGlzIGF2YWlsYWJsZSAgfHwKLXwgfGJfU2Vjb25kQ291bnRlck9wdGlvbiB8ICAgICAgICAgICAgICAgICAgICAgICAgIHwgb25lIGh5c3RlcmVzaXMgY2lyY3VpdC58fAotfCB8ICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgfCBJdCBzdXBwcmVzc2VzIGVhY2ggICAgIHx8Ci18IHwgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICB8IHRpbWUgdGhlIGZpcnN0IGNvdW50aW5nfHwKLXwgfCAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgIHwgcHVsc2UgYWZ0ZXIgYSBjaGFuZ2UgICB8fAotfCB8ICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgfCBvZiByb3RhdGlvbi4gICAgICAgICAgIHx8Ci18IHwtLS0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tfHwKLXwgfGJfRmlyc3RDb3VudGVyT3B0aW9uICB8IEFQQ0kxNzEwX0hZU1RFUkVTSVNfT0ZGIHwgVGhlIGZpcnN0IGNvdW50aW5nICAgICB8fAotfCB8ICAgICAgIG9yICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgfCBwdWxzZSBpcyBub3Qgc3VwcHJlc3MgIHx8Ci18IHxiX1NlY29uZENvdW50ZXJPcHRpb24gfCAgICAgICAgICAgICAgICAgICAgICAgICB8IGFmdGVyIGEgY2hhbmdlIG9mICAgICAgfHwKLXwgfCAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgIHwgcm90YXRpb24uICAgICAgICAgICAgICB8fAotfCArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSt8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICBJTVBPUlRBTlQhICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgIFRoaXMgb3B0aW9uIGFyZSBvbmx5IGF2YWlibGUgaWYgeW91IGhhdmUgc2VsZWN0ZWQgdGhlIGRpcmVjdCBtb2RlLiAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgQ291bnRlciBvcGVyYXRpbmcgb3B0aW9uIGZvciBkaXJlY3QgbW9kZSAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rIHwKLXwgfCAgICAgIFBhcmFtZXRlciAgICAgICB8ICAgICBQYXNzZWQgdmFsdWUgICB8ICAgICAgIERlc2NyaXB0aW9uICAgICAgICAgIHwgfAotfCB8LS0tLS0tLS0tLS0tLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tfCB8Ci18IHxiX0ZpcnN0Q291bnRlck9wdGlvbiAgfCBBUENJMTcxMF9JTkNSRU1FTlQgfCBUaGUgY291bnRlciBpbmNyZW1lbnQgZm9yICB8IHwKLXwgfCAgICAgICBvciAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8IGVhY2ggY291bnRpbmcgcHVsc2UgICAgICAgIHwgfAotfCB8Yl9TZWNvbmRDb3VudGVyT3B0aW9uIHwgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCB8Ci18IHwtLS0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS18IHwKLXwgfGJfRmlyc3RDb3VudGVyT3B0aW9uICB8IEFQQ0kxNzEwX0RFQ1JFTUVOVCB8IFRoZSBjb3VudGVyIGRlY3JlbWVudCBmb3IgIHwgfAotfCB8ICAgICAgIG9yICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgZWFjaCBjb3VudGluZyBwdWxzZSAgICAgICAgfCB8Ci18IHxiX1NlY29uZENvdW50ZXJPcHRpb24gfCAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IHwKLXwgKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgSW5wdXQgUGFyYW1ldGVycyAgOiB1bnNpZ25lZCBjaGFyXyBiX0JvYXJkSGFuZGxlICAgICAgICAgOiBIYW5kbGUgb2YgYm9hcmQgQVBDSS0xNzEwfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfTW9kdWxOYnIgICAgICAgICAgICA6IE1vZHVsZSBudW1iZXIgdG8gICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlndXJlICgwIHRvIDMpICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyBiX0NvdW50ZXJSYW5nZSAgICAgICAgOiBTZWxlY3Rpb24gZm9ybSBjb3VudGVyICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJhbmdlLiAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gYl9GaXJzdENvdW50ZXJNb2R1cyAgIDogRmlyc3QgY291bnRlciBvcGVyYXRpbmcgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RlLiAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfRmlyc3RDb3VudGVyT3B0aW9uICA6IEZpcnN0IGNvdW50ZXIgIG9wdGlvbi4gICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gYl9TZWNvbmRDb3VudGVyTW9kdXMgIDogU2Vjb25kIGNvdW50ZXIgb3BlcmF0aW5nIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RlLiAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfU2Vjb25kQ291bnRlck9wdGlvbiA6IFNlY29uZCBjb3VudGVyICBvcHRpb24uICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgT3V0cHV0IFBhcmFtZXRlcnMgOiAtICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFJldHVybiBWYWx1ZSAgICAgIDogMDogTm8gZXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC0xOiBUaGUgaGFuZGxlIHBhcmFtZXRlciBvZiB0aGUgYm9hcmQgaXMgd3JvbmcgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTI6IFRoZSBtb2R1bGUgaXMgbm90IGEgY291bnRlciBtb2R1bGUgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtMzogVGhlIHNlbGVjdGVkIGNvdW50ZXIgcmFuZ2UgaXMgd3JvbmcuICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC00OiBUaGUgc2VsZWN0ZWQgZmlyc3QgY291bnRlciBvcGVyYXRpbmcgbW9kZSBpcyB3cm9uZy4gfAotfCAgICAgICAgICAgICAgICAgICAgLTU6IFRoZSBzZWxlY3RlZCBmaXJzdCBjb3VudGVyIG9wZXJhdGluZyBvcHRpb24gaXMgd3Jvbmd8Ci18ICAgICAgICAgICAgICAgICAgICAtNjogVGhlIHNlbGVjdGVkIHNlY29uZCBjb3VudGVyIG9wZXJhdGluZyBtb2RlIGlzIHdyb25nLnwKLXwgICAgICAgICAgICAgICAgICAgIC03OiBUaGUgc2VsZWN0ZWQgc2Vjb25kIGNvdW50ZXIgb3BlcmF0aW5nIG9wdGlvbiBpcyAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgIHdyb25nLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSovCi1zdGF0aW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JCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJCS8qIFRoZSBzZWxlY3RlZCBzZWNvbmQgY291bnRlciBvcGVyYXRpbmcgbW9kZSBpcyB3cm9uZyAqLwotCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQkJCURQUklOVEsoIlRoZSBzZWxlY3RlZCBzZWNvbmQgY291bnRlciBvcGVyYXRpbmcgbW9kZSBpcyB3cm9uZ1xuIik7Ci0JCQkJCQkJaV9SZXR1cm5WYWx1ZSA9IC02OwotCQkJCQkJfQotCQkJCQl9Ci0JCQkJfSBlbHNlIHsKLQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJLyogVGhlIHNlbGVjdGVkIGZpcnN0IGNvdW50ZXIgb3BlcmF0aW5nIG9wdGlvbiBpcyB3cm9uZyAqLwotCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCURQUklOVEsoIlRoZSBzZWxlY3RlZCBmaXJzdCBjb3VudGVyIG9wZXJhdGluZyBvcHRpb24gaXMgd3JvbmdcbiIpOwotCQkJCQlpX1JldHVyblZhbHVlID0gLTU7Ci0JCQkJfQotCQkJfSBlbHNlIHsKLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogVGhlIHNlbGVjdGVkIGZpcnN0IGNvdW50ZXIgb3BlcmF0aW5nIG1vZGUgaXMgd3JvbmcgKi8KLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJRFBSSU5USygiVGhlIHNlbGVjdGVkIGZpcnN0IGNvdW50ZXIg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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodW5zaWduZWQgY2hhcl8gICAgIGJfQm9hcmRIYW5kbGUsICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyICpfICAgcGJfVGVzdFN0YXR1cykgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBUYXNrICAgICAgICAgICAgICA6IEEgdGVzdCBtb2RlIGlzIGludGVuZGVkIGZvciB0ZXN0aW5nIHRoZSBjb21wb25lbnQgYW5kICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdGhlIGNvbm5lY3RlZCBwZXJpcGhlcnkuIEFsbCB0aGUgOC1iaXQgY291bnRlciBjaGFpbnMgIHwKLXwgICAgICAgICAgICAgICAgICAgICBhcmUgb3BlcmF0ZWQgaW50ZXJuYWxseSBhcyBkb3duIGNvdW50ZXJzLiAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIEluZGVwZW5kZW50bHkgZnJvbSB0aGUgZXh0ZXJuYWwgc2lnbmFscywgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgYWxsIHRoZSBmb3VyIDgtYml0IGNvdW50ZXIgY2hhaW5zIGFyZSBkZWNyZW1lbnRlZCBpbiAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBwYXJhbGxlbCBieSBlYWNoIG5lZ2F0aXZlIGNsb2NrIHB1bHNlIGVkZ2Ugb2YgQ0xLWC4gICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICBDb3VudGVyIGF1dG8gdGVzdCBjb25jbHVzaW9uICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgKy0tLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKyAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICB8IHBiX1Rlc3RTdGF0dXMgICB8ICAgIEVycm9yIGRlc2NyaXB0aW9uICAgICAgICB8ICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgIHwgICAgIG1hc2sgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgfC0tLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tfCAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICB8ICAgIDAwMDAgICAgICAgICB8ICAgICBObyBlcnJvciBkZXRlY3RlZCAgICAgICB8ICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgIHwtLS0tLS0tLS0tLS0tLS0tLXwtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLXwgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgfCAgICAwMDAxICAgICAgICAgfCBFcnJvciBkZXRlY3RlZCBvZiBjb3VudGVyIDAgfCAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICB8LS0tLS0tLS0tLS0tLS0tLS18LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS18ICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgIHwgICAgMDAxMCAgICAgICAgIHwgRXJyb3IgZGV0ZWN0ZWQgb2YgY291bnRlciAxIHwgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgfC0tLS0tLS0tLS0tLS0tLS0tfC0tLS0tLS0tLS0tLS0tL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xlIGZvdW5kICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQlEUFJJTlRLKCJObyBjb3VudGVyIG1vZHVsZSBmb3VuZFxuIik7Ci0JCWlfUmV0dXJuVmFsdWUgPSAtMjsKLQl9Ci0KLQlyZXR1cm4gaV9SZXR1cm5WYWx1ZTsKLX0KLQotLyoKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBGdW5jdGlvbiBOYW1lICAgICA6IF9JTlRfIGlfQVBDSTE3MTBfSW5pdEluZGV4ICh1bnNpZ25lZCBjaGFyXyBiX0JvYXJkSGFuZGxlLCAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfTW9kdWxOYnIsICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gYl9SZWZlcmVuY2VBY3Rpb24sICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyBiX0luZGV4T3BlcmF0aW9uLCAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfQXV0b01vZGUsICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gYl9JbnRlcnJ1cHRFbmFibGUpICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFRhc2sgICAgICAgICAgICAgIDogSW5pdGlhbGlzZSB0aGUgaW5kZXggY29ycmVzcG9uZGluZyB0byB0aGUgc2VsZWN0ZWQgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBtb2R1bGUgKGJfTW9kdWxOYnIpLiBJZiBhIElOREVYIGZsYWcgb2NjdXIsIHlvdSBoYXZlICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHRoZSBwb3NzaWJpbGl0eSB0byBjbGVhciB0aGUgMzItQml0IGNvdW50ZXIgb3IgdG8gbGF0Y2h8Ci18ICAgICAgICAgICAgICAgICAgICAgdGhlIGN1cnJlbnQgMzItQml0IHZhbHVlIGluIHRvIHRoZSBmaXJzdCBsYXRjaCAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICByZWdpc3Rlci4gVGhlIGJfSW5kZXhPcGVyYXRpb24gcGFyYW1ldGVyIGdpdmUgdGhlICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHBvc3NpYmlsaXR5IHRvIGNob2ljZSB0aGUgSU5ERVggYWN0aW9uLiAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgSWYgeW91IGhhdmUgZW5hYmxlZCB0aGUgYXV0b21hdGljIG1vZGUsIGVhY2ggSU5ERVggICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBhY3Rpb24gaXMgY2xlYXJlZCBhdXRvbWF0aWNhbGx5LCBlbHNlIHlvdSBtdXN0IHJlYWQgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHRoZSBpbmRleCBzdGF0dXMgKCJpX0FQQ0kxNzEwX1JlYWRJbmRleFN0YXR1cyIpICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgYWZ0ZXIgZWFjaCBJTkRFWCBhY3Rpb24uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEluZGV4IGFjdGlvbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLS0tLS0tLS0tLS0tICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsgIHwKLXwgICAgICAgICAgIHwgICBiX0luZGV4T3BlcmF0aW9uICAgICB8ICAgICAgICAgT3BlcmF0aW9uICAgICAgICAgICAgICAgICAgfCAgfAotfCAgICAgICAgICAgfC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS18ICB8Ci18ICAgICAgICAgICB8QVBDSTE3MTBfTEFUQ0hfQ09VTlRFUiAgfCBBZnRlciBhIGluZGV4IHNpZ25hbCwgdGhlIGNvdW50ZXIgIHwgIHwKLXwgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICB8IHZhbHVlICgzMi1CaXQpIGlzIGxhdGNoZWQgaW4gdG8gICAgfCAgfAotfCAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgIHwgdGhlIGZpcnN0IGxhdGNoIHJlZ2lzdGVyICAgICAgICAgICB8ICB8Ci18ICAgICAgICAgICB8LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tfC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLXwgIHwKLXwgICAgICAgICAgIHxBUENJMTcxMF9DTEVBUl9DT1VOVEVSICB8IEFmdGVyIGEgaW5kZXggc2lnbmFsLCB0aGUgY291bnRlciAgfCAgfAotfCAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgIHwgdmFsdWUgaXMgY2xlYXJlZCAoMzItQml0KSAgICAgICAgICB8ICB8Ci18ICAgICAgICAgICArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBJbnB1dCBQYXJhbWV0ZXJzICA6IHVuc2lnbmVkIGNoYXJfIGJfQm9hcmRIYW5kbGUgICAgIDogSGFuZGxlIG9mIGJvYXJkIEFQQ0ktMTcxMCAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gYl9Nb2R1bE5iciAgICAgICAgOiBNb2R1bGUgbnVtYmVyIHRvIGNvbmZpZ3VyZSAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgwIHRvIDMpICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfUmVmZXJlbmNlQWN0aW9uIDogRGV0ZXJtaW5lIGlmIHRoZSByZWZlcmVuY2UgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtdXN0IHNldCBvciBubyBmb3IgdGhlICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjY2VwdGFuY2UgZnJvbSBpbmRleCAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQVBDSTE3MTBfRU5BQkxFIDogICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZWZlcmVuY2UgbXVzdCBiZSBzZXQgZm9yIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjY2VwdGVkIHRoZSBpbmRleCAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQVBDSTE3MTBfRElTQUJMRSA6ICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZWZlcmVuY2UgaGF2ZSBub3QgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltcG9ydGFuY2UgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfSW5kZXhPcGVyYXRpb24gIDogSW5kZXggb3BlcmF0aW5nIG1vZGUuICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTZWUgdGFibGUuICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyBiX0F1dG9Nb2RlICAgICAgICA6IEVuYWJsZSBvciBkaXNhYmxlIHRoZSAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXV0b21hdGljIGluZGV4IHJlc2V0LiAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBUENJMTcxMF9FTkFCTEUgOiAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRW5hYmxlIHRoZSBhdXRvbWF0aWMgbW9kZSAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQVBDSTE3MTBfRElTQUJMRSA6ICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERpc2FibGUgdGhlIGF1dG9tYXRpYyBtb2RlIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyBiX0ludGVycnVwdEVuYWJsZSA6IEVuYWJsZSBvciBkaXNhYmxlIHRoZSAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50ZXJydXB0LiAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBUENJMTcxMF9FTkFCTEUgOiAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVuYWJsZSB0aGUgaW50ZXJydXB0ICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQVBDSTE3MTBfRElTQUJMRSA6ICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEaXNhYmxlIHRoZSBpbnRlcnJ1cHQgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBPdXRwdXQgUGFyYW1ldGVycyA6IC0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgUmV0dXJuIFZhbHVlICAgICAgOiAgMDogTm8gZXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0xOiBUaGUgaGFuZGxlIHBhcmFtZXRlciBvZiB0aGUgYm9hcmQgaXMgd3JvbmcgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTI6IE5vIGNvdW50ZXIgbW9kdWxlIGZvdW5kICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMzogQ291bnRlciBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAiaV9BUENJMTcxMF9Jbml0Q291bnRlciIgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTQgIFRoZSByZWZlcmVuY2UgYWN0aW9uIHBhcmFtZXRlciBpcyB3cm9uZyAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtNTogVGhlIGluZGV4IG9wZXJhdGluZyBtb2RlIHBhcmFtZXRlciBpcyB3cm9uZyAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC02OiBUaGUgYXV0byBtb2RlIHBhcmFtZXRlciBpcyB3cm9uZyAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTc6IEludGVycnVwdCBwYXJhbWV0ZXIgaXMgd3JvbmcgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtODogSW50ZXJydXB0IGZ1bmN0aW9uIG5vdCBpbml0aWFsaXNlZC4gICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICBTZWUgZnVuY3Rpb24gImlfQVBDSTE3MTBfU2V0Qm9hcmRJbnRSb3V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i8KLQotCQkJCQlEUFJJTlRLKCJUaGUgaW5kZXggb3BlcmF0aW5nIG1vZGUgcGFyYW1ldGVyIGlzIHdyb25nXG4iKTsKLQkJCQkJaV9SZXR1cm5WYWx1ZSA9IC01OwotCQkJCX0KLQkJCX0gZWxzZSB7Ci0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkvKiBUaGUgcmVmZXJlbmNlIGFjdGlvbiBwYXJhbWV0ZXIgaXMgd3JvbmcgKi8KLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJRFBSSU5USygiVGhlIHJlZmVyZW5jZSBhY3Rpb24gcGFyYW1ldGVyIGlzIHdyb25nXG4iKTsKLQkJCQlpX1JldHVyblZhbHVlID0gLTQ7Ci0JCQl9Ci0JCX0gZWxzZSB7Ci0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkvKiBDb3VudGVyIG5vdCBpbml0aWFsaXNlZCBzZWUgZnVuY3Rpb24gKi8KLQkJCS8qICJpX0FQQ0kxNzEwX0luaXRDb3VudGVyIiAgICAgICAgICAgICAqLwotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQlEUFJJTlRLKCJDb3VudGVyIG5vdCBpbml0aWFsaXNlZFxuIik7Ci0JCQlpX1JldHVyblZhbHVlID0gLTM7Ci0JCX0KLQl9IGVsc2UgewotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkvKiBUaGUgc2VsZWN0ZWQgbW9kdWxlIG51bWJlciBwYXJhbWV0ZXIgaXMgd3JvbmcgKi8KLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQlEUFJJTlRLKCJUaGUgc2VsZWN0ZWQgbW9kdWxlIG51bWJlciBwYXJhbWV0ZXIgaXMgd3JvbmdcbiIpOwotCQlpX1JldHVyblZhbHVlID0gLTI7Ci0JfQotCi0JcmV0dXJuIGlfUmV0dXJuVmFsdWU7Ci19Ci0KLS8qCi0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgRnVuY3Rpb24gTmFtZSAgICAgOiBfSU5UXyBpX0FQQ0kxNzEwX0luaXRSZWZlcmVuY2UgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCBjaGFyXyBiX0JvYXJkSGFuZGxlLCAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfTW9kdWxOYnIsICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gYl9SZWZlcmVuY2VMZXZlbCkgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFRhc2sgICAgICAgICAgICAgIDogSW5pdGlhbGlzZSB0aGUgcmVmZXJlbmNlIGNvcnJlc3BvbmRpbmcgdG8gdGhlIHNlbGVjdGVkIHwKLXwgICAgICAgICAgICAgICAgICAgICBtb2R1bGUgKGJfTW9kdWxOYnIpLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlZmVyZW5jZSBsZXZlbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLS0tLS0tLS0tLS0tLS0tICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICArLS0tLS0tLS0tLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgIHwgYl9SZWZlcmVuY2VMZXZlbCAgIHwgICAgICAgICBPcGVyYXRpb24gICAgICAgfCAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgKy0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICB8ICAgQVBDSTE3MTBfTE9XICAgICB8ICBSZWZlcmVuY2Ugb2NjdXIgaWYgIjAiIHwgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgIHwtLS0tLS0tLS0tLS0tLS0tLS0tLXwtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tfCAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgfCAgIEFQQ0kxNzEwX0hJR0ggICAgfCAgUmVmZXJlbmNlIG9jY3VyIGlmICIxIiB8ICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICArLS0tLS0tLS0tLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgSW5wdXQgUGFyYW1ldGVycyAgOiB1bnNpZ25lZCBjaGFyXyBiX0JvYXJkSGFuZGxlICAgICA6IEhhbmRsZSBvZiBib2FyZCBBUENJLTE3MTAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfTW9kdWxOYnIgICAgICAgIDogTW9kdWxlIG51bWJlciB0byBjb25maWd1cmUgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMCB0byAzKSAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyBiX1JlZmVyZW5jZUxldmVsICA6IFJlZmVyZW5jZSBsZXZlbC4gICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IE91dHB1dCBQYXJhbWV0ZXJzIDogLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBSZXR1cm4gVmFsdWUgICAgICA6ICAwOiBObyBlcnJvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTE6IFRoZSBoYW5kbGUgcGFyYW1ldGVyIG9mIHRoZSBib2FyZCBpcyB3cm9uZyAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMjogVGhlIHNlbGVjdGVkIG1vZHVsZSBudW1iZXIgcGFyYW1ldGVyIGlzIHdyb25nICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0zOiBDb3VudGVyIG5vdCBpbml0aWFsaXNlZCBzZWUgZnVuY3Rpb24gICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICJpX0FQQ0kxNzEwX0luaXRDb3VudGVyIiAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtNDogUmVmZXJlbmNlIGxldmVsIHBhcmFtZXRlciBpcyB3cm9uZyAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0qLwotc3RhdGljIGludCBpX0FQQ0kxNzEwX0luaXRSZWZlcmVuY2Uoc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiwKLQkJCQkgICAgdW5zaWduZWQgY2hhciBiX01vZHVsTmJyLAotCQkJCSAgICB1bnNpZ25lZCBjaGFyIGJfUmVmZXJlbmNlTGV2ZWwpCi17Ci0Jc3RydWN0IGFkZGlfcHJpdmF0ZSAqZGV2cHJpdiA9IGRldi0+cHJpdmF0ZTsKLQlpbnQgaV9SZXR1cm5WYWx1ZSA9IDA7Ci0KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JLyogVGVzdCB0aGUgbW9kdWxlIG51bWJlciAqLwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCWlmIChiX01vZHVsTmJyIDwgNCkgewotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkvKiBUZXN0IGlmIGNvdW50ZXIgaW5pdGlhbGlzZWQgKi8KLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQlpZiAoZGV2cHJpdi0+Ci0JCQlzX01vZHVsZUluZm9bYl9Nb2R1bE5icl0uCi0JCQlzX1NpZW1lbnNDb3VudGVySW5mby5zX0luaXRGbGFnLmJfQ291bnRlckluaXQgPT0gMSkgewotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCS8qIFRlc3QgdGhlIHJlZmVyZW5jZSBs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ICAgICB8Ci18CQkJCQkJRXh0ZXJuYWwgbGF0Y2ggb2NjdXJzIGlmICIxIiB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgT3V0cHV0IFBhcmFtZXRlcnMgOiAtICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFJldHVybiBWYWx1ZSAgICAgIDogIDA6IE5vIGVycm9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMTogVGhlIGhhbmRsZSBwYXJhbWV0ZXIgb2YgdGhlIGJvYXJkIGlzIHdyb25nICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0yOiBUaGUgc2VsZWN0ZWQgbW9kdWxlIG51bWJlciBpcyB3cm9uZyAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTM6IENvdW50ZXIgbm90IGluaXRpYWxpc2VkLiAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwJCQkgIFNlZSBmdW5jdGlvbiAiaV9BUENJMTcxMF9Jbml0Q291bnRlciIgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtNDogRXh0ZXJuYWwgc3Ryb2JlIHNlbGVjdGlvbiBpcyB3cm9uZyAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC01OiBFeHRlcm5hbCBzdHJvYmUgbGV2ZWwgcGFyYW1ldGVyIGlzIHdyb25nICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0t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gIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQlEUFJJTlRLKCJDb3VudGVyIG5vdCBpbml0aWFsaXNlZFxuIik7Ci0JCQlpX1JldHVyblZhbHVlID0gLTM7Ci0JCX0KLQl9IGVsc2UgewotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkvKiBUaGUgc2VsZWN0ZWQgbW9kdWxlIG51bWJlciBwYXJhbWV0ZXIgaXMgd3JvbmcgKi8KLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQlEUFJJTlRLKCJUaGUgc2VsZWN0ZWQgbW9kdWxlIG51bWJlciBwYXJhbWV0ZXIgaXMgd3JvbmdcbiIpOwotCQlpX1JldHVyblZhbHVlID0gLTI7Ci0JfQotCi0JcmV0dXJuIGlfUmV0dXJuVmFsdWU7Ci19Ci0KLQkvKgotCSAgICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotCSAgIHwgRnVuY3Rpb24gTmFtZSAgICAgOiBfSU5UXyBpX0FQQ0kxNzEwX0luaXRDb21wYXJlTG9naWMgICAgICAgICAgICAgICAgICAgICAgfAotCSAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHVuc2lnbmVkIGNoYXJfICAgYl9Cb2FyZEhhbmRsZSwgICAgICAgICAgICAgICAgICAgICAgfAotCSAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgYl9Nb2R1bE5iciwgICAgICAgICAgICAgICAgICAgICAgICAgfAotCSAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGludF8gIHVpX0NvbXBhcmVWYWx1ZSkgICAgICAgICAgICAgIC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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLQkgICB8IE91dHB1dCBQYXJhbWV0ZXJzIDogLQotCSAgICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotCSAgIHwgUmV0dXJuIFZhbHVlICAgICAgOiAgMDogTm8gZXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotCSAgIHwgICAgICAgICAgICAgICAgICAgICAtMTogVGhlIGhhbmRsZSBwYXJhbWV0ZXIgb2YgdGhlIGJvYXJkIGlzIHdyb25nICAgICAgICAgfAotCSAgIHwgICAgICAgICAgICAgICAgICAgICAtMjogTm8gY291bnRlciBtb2R1bGUgZm91bmQgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotCSAgIHwgICAgICAgICAgICAgICAgICAgICAtMzogQ291bnRlciBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICAgICAgICAgICAgICAgfAotCSAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgImlfQVBDSTE3MTBfSW5pdENvdW50ZXIiICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotCSAgICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotCSAqLwotc3RhdGljIGludCBpX0FQQ0kxNzEwX0luaXRDb21wYXJlTG9naWMoc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiwKLQkJCQkgICAgICAgdW5zaWduZWQgY2hhciBiX01vZHVsTmJyLAotCQkJCSAgICAgICB1bnNpZ25lZCBpbnQgdWlfQ29tcGFyZVZhbHVlKQotewotCXN0cnVjdCBhZGRpX3ByaXZhdGUgKmRldnByaXYgPSBkZXYtPnByaXZhdGU7Ci0JaW50IGlfUmV0dXJuVmFsdWUgPSAwOwotCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCS8qIFRlc3QgdGhlIG1vZHVsZSBudW1iZXIgKi8KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQlpZiAoYl9Nb2R1bE5iciA8IDQpIHsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJLyogVGVzdCBpZiBjb3VudGVyIGluaXRpYWxpc2VkICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJaWYgKGRldnByaXYtPgotCQkJc19Nb2R1bGVJbmZvW2JfTW9kdWxOYnJdLgotCQkJc19TaWVtZW5zQ291bnRlckluZm8uc19Jbml0RmxhZy5iX0NvdW50ZXJJbml0ID09IDEpIHsKLQotCQkJb3V0bCh1aV9Db21wYXJlVmFsdWUsIGRldnByaXYtPnNfQm9hcmRJbmZvcy4KLQkJCQl1aV9BZGRyZXNzICsgMjggKyAoNjQgKiBiX01vZHVsTmJyKSk7Ci0KLQkJCWRldnByaXYtPgotCQkJCXNfTW9kdWxlSW5mb1tiX01vZHVsTmJyXS4KLQkJCQlzX1NpZW1lbnNDb3VudGVySW5mby4KLQkJCQlzX0luaXRGbGFnLmJfQ29tcGFyZUxvZ2ljSW5pdCA9IDE7Ci0JCX0gZWxzZSB7Ci0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkvKiBDb3VudGVyIG5vdCBpbml0aWFsaXNlZCBzZWUgZnVuY3Rpb24gKi8KLQkJCS8qICJpX0FQQ0kxNzEwX0luaXRDb3VudGVyIiAgICAgICAgICAgICAqLwotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQlEUFJJTlRLKCJDb3VudGVyIG5vdCBpbml0aWFsaXNlZFxuIik7Ci0JCQlpX1JldHVyblZhbHVlID0gLTM7Ci0J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y0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFJldHVybiBWYWx1ZSAgICAgIDogIDA6IE5vIGVycm9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMTogVGhlIGhhbmRsZSBwYXJhbWV0ZXIgb2YgdGhlIGJvYXJkIGlzIHdyb25nICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0yOiBUaGUgc2VsZWN0ZWQgbW9kdWxlIG51bWJlciBpcyB3cm9uZyAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTM6IENvdW50ZXIgbm90IGluaXRpYWxpc2VkIHNlZSBmdW5jdGlvbiAgICAgICAgICAgICAgIHwKLXwJCQkgICJpX0FQQ0kxNzEwX0luaXRDb3VudGVyIiAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtNDogVGhlIHNlbGVjdGVkIFBDSSBpbnB1dCBjbG9jayBpcyB3cm9uZyAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC01OiBUaW1pbmcgdW5pdHkgc2VsZWN0aW9uIGlzIHdyb25nICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTY6IEJhc2UgdGltaW5nIHNlbGVjdGlvbiBpcyB3cm9uZyAgICAgICAgICAgICAgICAgICAgIHwKLXwJCSAgICAgIC03OiA0ME1IeiBxdWFydHogbm90IG9uIGJvYXJkICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSovCi1zdGF0aWMgaW50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otCQkJCQkJCQkJCT0KLQkJCQkJCQkJCQktNzsKLQkJCQkJCQkJfQotCQkJCQkJCX0gZWxzZSB7Ci0JCQkgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCQkJLyogNDBNSHogcXVhcnR6IG5vdCBvbiBib2FyZCAqLwotCQkJICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCQkJCURQUklOVEsoIjQwTUh6IHF1YXJ0eiBub3Qgb24gYm9hcmRcbiIpOwotCQkJCQkJCQlpX1JldHVyblZhbHVlID0KLQkJCQkJCQkJCS03OwotCQkJCQkJCX0KLQkJCQkJCX0JLyogIGlmIChiX1BDSUlucHV0Q2xvY2sgPT0gQVBDSTE3MTBfNDBNSFopICovCi0KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCQkvKiBUZXN0IGlmIG5vdCBlcnJvciBvY2N1ciAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQkJaWYgKGlfUmV0dXJuVmFsdWUgPT0gMCkgewotCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCQkvKiBUZXN0IHRoZSBJTkNfQ1BUIHZlcnNpb24gKi8KLQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJCQlpZiAoKGRldnByaXYtPnNfQm9hcmRJbmZvcy5kd19Nb2xkdWxlQ29uZmlndXJhdGlvbltiX01vZHVsTmJyXSAmIDB4RkZGRikgPj0gMHgzMTMxKSB7Ci0KLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCQkJLyogVGVzdCBpZiA0ME1IeiB1c2VkICovCi0JCQkJLyoqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJCQkJaWYgKGJfUENJSW5wdXRDbG9jayA9PSBBUENJMTcxMF80ME1IWikgewotCQkJCSAgIC8qK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yB1bml0eSBzZWxlY3Rpb24gaXMgd3JvbmcgKi8KLQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQlEUFJJTlRLKCJUaW1pbmcgdW5pdHkgc2VsZWN0aW9uIGlzIHdyb25nXG4iKTsKLQkJCQkJaV9SZXR1cm5WYWx1ZSA9IC01OwotCQkJCX0KLQkJCX0gZWxzZSB7Ci0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogVGhlIHNlbGVjdGVkIFBDSSBpbnB1dCBjbG9jayBpcyB3cm9uZyAqLwotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJRFBSSU5USygiVGhlIHNlbGVjdGVkIFBDSSBpbnB1dCBjbG9jayBpcyB3cm9uZ1xuIik7Ci0JCQkJaV9SZXR1cm5WYWx1ZSA9IC00OwotCQkJfQotCQl9IGVsc2UgewotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogQ291bnRlciBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICovCi0JCQkvKiAiaV9BUENJMTcxMF9Jbml0Q291bnRlciIgICAgICAgICAgICAgKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJRFBSSU5USygiQ291bnRlciBub3QgaW5pdGlhbGlzZWRcbiIpOwotCQkJaV9SZXR1cm5WYWx1ZSA9IC0zOwotCQl9Ci0JfSBlbHNlIHsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJLyogVGhlIHNlbGVjdGVkIG1vZHVsZSBudW1iZXIgcGFyYW1ldGVyIGlzIHdyb25nICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0K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hhbmRsZSwgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICAgICAgYl9Nb2R1bE5icikgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgVGFzayAgICAgICAgICAgICAgOiBDbGVhciB0aGUgY291bnRlciB2YWx1ZSBmcm9tIHNlbGVjdGVkIG1vZHVsZSAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIChiX01vZHVsTmJyKS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgSW5wdXQgUGFyYW1ldGVycyAgOiB1bnNpZ25lZCBjaGFyXyBiX0JvYXJkSGFuZGxlIDogSGFuZGxlIG9mIGJvYXJkIEFQQ0ktMTcxMCAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfTW9kdWxOYnIgICAgOiBNb2R1bGUgbnVtYmVyIHRvIGNvbmZpZ3VyZSAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgwIHRvIDMpICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBPdXRwdXQgUGFyYW1ldGVycyA6IC0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgUmV0dXJuIFZhbHVlICAgICAgOiAgMDogTm8gZXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0xOiBUaGUgaGFuZGxlIHBhcmFtZXRlciBvZiB0aGUgYm9hcmQgaXMgd3JvbmcgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTI6IFRoZSBzZWxlY3RlZCBtb2R1bGUgbnVtYmVyIHBhcmFtZXRlciBpcyB3cm9uZyAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMzogQ291bnRlciBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAiaV9BUENJMTcxMF9Jbml0Q291bnRlciIgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSovCi1zdGF0aWMgaW50IGlfQVBDSTE3MTBfQ2xlYXJDb3VudGVyVmFsdWUoc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiwKLQkJCQkJdW5zaWduZWQgY2hhciBiX01vZHVsTmJyKQotewotCXN0cnVjdCBhZGRpX3ByaXZhdGUgKmRldnByaXYgPSBkZXYtPnByaXZhdGU7Ci0JaW50IGlfUmV0dXJuVmFsdWUgPSAwOwotCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCS8qIFRlc3QgdGhlIG1vZHVsZSBudW1iZXIgKi8KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQlpZiAoYl9Nb2R1bE5iciA8IDQpIHsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJLyogVGVzdCBpZiBjb3VudGVyIGluaXRpYWxpc2VkICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJaWYgKGRldnByaXYtPgotCQkJc19Nb2R1bGVJbmZvW2JfTW9kdWxOYnJdLgotCQkJc19TaWVtZW5zQ291bnRlckluZm8uc19Jbml0RmxhZy5iX0NvdW50ZXJJbml0ID09IDEpIHsKLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogQ2xlYXIgdGhlIGNvdW50ZXIgKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQlvdXRsKDEsIGRldnByaXYtPnNfQm9hcmRJbmZvcy4KLQkJCQl1aV9BZGRyZXNzICsgMTYgKyAoNjQgKiBiX01vZHVsTmJyKSk7Ci0JCX0gZWxzZSB7Ci0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkvKiBDb3VudGVyIG5vdCBpbml0aWFsaXNlZCBzZWUgZnVuY3Rpb24gKi8KLQkJCS8qICJpX0FQQ0kxNzEwX0luaXRDb3VudGVyIiAgICAgICAgICAgICAqLwotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQlEUFJJTlRLKCJDb3VudGVyIG5vdCBpbml0aWFsaXNlZFxuIik7Ci0JCQlpX1JldHVyblZhbHVlID0gLTM7Ci0JCX0KLQl9IGVsc2UgewotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkvKiBUaGUgc2VsZWN0ZWQgbW9kdWxlIG51bWJlciBwYXJhbWV0ZXIgaXMgd3JvbmcgKi8KLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQot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qKioqKioqKi8KLQkJCS8qIFRlc3QgaWYgZmlybXdhcmUgPj0gUmV2MS41ICovCi0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJaWYgKChkZXZwcml2LT5zX0JvYXJkSW5mb3MuCi0JCQkJCWR3X01vbGR1bGVDb25maWd1cmF0aW9uW2JfTW9kdWxOYnJdICYKLQkJCQkJMHhGRkZGKSA+PSAweDMxMzUpIHsKLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkvKiBUZXN0IHRoZSBQQ0kgYnVzIGNsb2NrICovCi0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQlpZiAoKGJfUENJSW5wdXRDbG9jayA9PSBBUENJMTcxMF8zME1IWikgfHwKLQkJCQkJKGJfUENJSW5wdXRDbG9jayA9PSBBUENJMTcxMF8zM01IWikgfHwKLQkJCQkJKGJfUENJSW5wdXRDbG9jayA9PSBBUENJMTcxMF80ME1IWikpIHsKLQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkvKiBUZXN0IHRoZSBmaWx0ZXIgdmFsdWUgKi8KLQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCWlmIChiX0ZpbHRlciA8IDE2KSB7Ci0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCS8qIFRlc3QgaWYgNDBNSHogdXNlZCAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJCWlmIChiX1BDSUlucHV0Q2xvY2sgPT0KLQkJCQkJCQlBUENJMTcxMF80ME1IWikgewotCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJCS8qIFRlc3QgaWYgNDBNSHogcXVhcnR6IG9uIGJvYXJkICovCi0JCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJCQlkd19TdGF0dXMgPQotCQkJCQkJCQlpbmwoZGV2cHJpdi0+Ci0JCQkJCQkJCXNfQm9hcmRJbmZvcy4KLQkJCQkJCQkJdWlfQWRkcmVzcyArCi0JCQkJCQkJCTM2ICsKLQkJCQkJCQkJKDY0ICogYl9Nb2R1bE5icikpOwotCi0JCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCQkJLyogVGVzdCB0aGUgcXVhcnR6IGZsYWcgKERRMCkgKi8KLQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQkJCWlmICgoZHdfU3RhdHVzICYgMSkgIT0KLQkJCQkJCQkJMSkgewotCQkJICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCQkJCS8qIDQwTUh6IHF1YXJ0eiBub3Qgb24gYm9hcmQgKi8KLQkJCSAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCQkJCURQUklOVEsoIjQwTUh6IHF1YXJ0eiBub3Qgb24gYm9hcmRcbiIpOwotCQkJCQkJCQlpX1JldHVyblZhbHVlID0KLQkJCQkJCQkJCS02OwotCQkJCQkJCX0KLQkJCQkJCX0JLyogIGlmIChiX1BDSUlucHV0Q2xvY2sgPT0gQVBDSTE3MTBfNDBNSFopICovCi0KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCQkvKiBUZXN0IGlmIGVycm9yIG5vdCBvY2N1ciAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQkJaWYgKGlfUmV0dXJuVmFsdWUgPT0gMCkgewotCQkJICAvKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCQkvKiBUZXN0IGlmIDQwTUh6IHVzZWQgKi8KLQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJCQlpZiAoYl9QQ0lJbnB1dENsb2NrID09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25nICovCi0JCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJRFBSSU5USygiVGhlIHNlbGVjdGVkIFBDSSBpbnB1dCBjbG9jayBpcyB3cm9uZ1xuIik7Ci0JCQkJCWlfUmV0dXJuVmFsdWUgPSA0OwotCQkJCX0JLyogIGlmICgoYl9QQ0lJbnB1dENsb2NrID09IEFQQ0kxNzEwXzMwTUhaKSB8fCAoYl9QQ0lJbnB1dENsb2NrID09IEFQQ0kxNzEwXzMzTUhaKSB8fCAoYl9QQ0lJbnB1dENsb2NrID09IEFQQ0kxNzEwXzQwTUhaKSkgKi8KLQkJCX0gZWxzZSB7Ci0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogVGhlIG1vZHVsZSBpcyBub3QgYSBjb3VudGVyIG1vZHVsZSAqLwotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJRFBSSU5USygiVGhlIG1vZHVsZSBpcyBub3QgYSBjb3VudGVyIG1vZHVsZVxuIik7Ci0JCQkJaV9SZXR1cm5WYWx1ZSA9IC0zOwotCQkJfQotCQl9IGVsc2UgewotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCS8qIFRoZSBtb2R1bGUgaXMgbm90IGEgY291bnRlciBtb2R1bGUgKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCURQUklOVEsoIlRoZSBtb2R1bGUgaXMgbm90IGEgY291bnRlciBtb2R1bGVcbiIpOwotCQkJaV9SZXR1cm5WYWx1ZSA9IC0zOwotCQl9Ci0JfSBlbHNlIHsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJLyogVGhlIHNlbGVjdGVkIG1vZHVsZSBudW1iZXIgcGFyYW1ldGVyIGlzIHdyb25nICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJRFBSSU5USygiVGhlIHNlbGVjdGVkIG1vZHVsZSBudW1iZXIgcGFyYW1ldGVyIGlzIHdyb25nXG4iKTsKLQkJaV9SZXR1cm5WYWx1ZSA9IC0yOwotCX0KLQotCXJldHVybiBpX1JldHVyblZhbHVlOwotfQotCi0vKgotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IEZ1bmN0aW9uIE5hbWUgICAgIDogX0lOVF8gaV9BUENJMTcxMF9MYXRjaENvdW50ZXIgKHVuc2lnbmVkIGNoYXJfIGJfQm9hcmRIYW5kbGUsICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gYl9Nb2R1bE5iciwgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyBiX0xhdGNoUmVnKSAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgVGFzayAgICAgICAgICAgICAgOiBMYXRjaCB0aGUgY291cmFudCB2YWx1ZSBmcm9tIHNlbGVjdGVkIG1vZHVsZSAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIChiX01vZHVsTmJyKSBpbiB0byB0aGUgc2VsZWN0ZWQgbGF0Y2ggcmVnaXN0ZXIgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgKGJfTGF0Y2hSZWcpLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBJbnB1dCBQYXJhbWV0ZXJzICA6IHVuc2lnbmVkIGNoYXJfIGJfQm9hcmRIYW5kbGUgOiBIYW5kbGUgb2YgYm9hcmQgQVBDSS0xNzEwICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gYl9Nb2R1bE5iciAgICA6IE1vZHVsZSBudW1iZXIgdG8gY29uZmlndXJlICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDAgdG8gMykgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfTGF0Y2hSZWcgICAgOiBTZWxlY3RlZCBsYXRjaCByZWdpc3RlciAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgOiBmb3IgdGhlIGZpcnN0IGxhdGNoIHJlZ2lzdGVyICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSA6IGZvciB0aGUgc2Vjb25kIGxhdGNoIHJlZ2lzdGVyICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IE91dHB1dCBQYXJhbWV0ZXJzIDogLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBSZXR1cm4gVmFsdWUgICAgICA6ICAwOiBObyBlcnJvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTE6IFRoZSBoYW5kbGUgcGFyYW1ldGVyIG9mIHRoZSBib2FyZCBpcyB3cm9uZyAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMjogTm8gY291bnRlciBtb2R1bGUgZm91bmQgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0zOiBDb3VudGVyIG5vdCBpbml0aWFsaXNlZCBzZWUgZnVuY3Rpb24gICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICJpX0FQQ0kxNzEwX0luaXRDb3VudGVyIiAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtNDogVGhlIHNlbGVjdGVkIGxhdGNoIHJlZ2lzdGVyIHBhcmFtZXRlciBpcyB3cm9uZyAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0qLwotc3RhdGljIGludCBpX0FQQ0kxNzEwX0xhdGNoQ291bnRlcihzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2LAotCQkJCSAgIHVuc2lnbmVkIGNoYXIgYl9Nb2R1bE5iciwKLQkJCQkgICB1bnNpZ25lZCBjaGFyIGJfTGF0Y2hSZWcpCi17Ci0Jc3RydWN0IGFkZGlfcHJpdmF0ZSAqZGV2cHJpdiA9IGRldi0+cHJpdmF0ZTsKLQlpbnQgaV9SZXR1cm5WYWx1ZSA9IDA7Ci0KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JLyogVGVzdCB0aGUgbW9kdWxlIG51bWJlciAqLwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCWlmIChiX01vZHVsTmJyIDwgNCkgewotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkvKiBUZXN0IGlmIGNvdW50ZXIgaW5pdGlhbGlzZWQgKi8KLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQlpZiAoZGV2cHJpdi0+Ci0JCQlzX01vZHVsZUluZm9bYl9Nb2R1bE5icl0uCi0JCQlzX1NpZW1lbnNDb3VudGVySW5mby5zX0luaXRGbGFnLmJfQ291bnRlckluaXQgPT0gMSkgewotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogVGVzdCB0aGUgbGF0Y2ggcmVnaXN0ZXIgcGFyYW1ldGVyICovCi0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCWlmIChiX0xhdGNoUmVnIDwgMikgewotCQkgLyoqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkvKiBUYXRjaCB0aGUgY291bnRlciAqLwotCQkgLyoqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCW91dGwoMSA8PCAoYl9MYXRjaFJlZyAqIDQpLAotCQkJCQlkZXZwcml2LT5zX0JvYXJkSW5mb3MudWlfQWRkcmVzcyArCi0JCQkJCSg2NCAqIGJfTW9kdWxOYnIpKTsKLQkJCX0gZWxzZSB7Ci0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogVGhlIHNlbGVjdGVkIGxhdGNoIHJlZ2lzdGVyIHBhcmFtZXRlciBpcyB3cm9uZyAqLwotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJRFBSSU5USygiVGhlIHNlbGVjdGVkIGxhdGNoIHJlZ2lzdGVyIHBhcmFtZXRlciBpcyB3cm9uZ1xuIik7Ci0JCQkJaV9SZXR1cm5WYWx1ZSA9IC00OwotCQkJfQotCQl9IGVsc2UgewotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogQ291bnRlciBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICovCi0JCQkvKiAiaV9BUENJMTcxMF9Jbml0Q291bnRlciIgICAgICAgICAgICAgKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJRFBSSU5USygiQ291bnRlciBub3QgaW5pdGlhbGlzZWRcbiIpOwotCQkJaV9SZXR1cm5WYWx1ZSA9IC0zOwotCQl9Ci0JfSBlbHNlIHsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJLyogVGhlIHNlbGVjdGVkIG1vZHVsZSBudW1iZXIgcGFyYW1ldGVyIGlzIHdyb25nICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJRFBSSU5USygiVGhlIHNlbGVjdGVkIG1vZHVsZSBudW1iZXIgcGFyYW1ldGVyIGlzIHdyb25nXG4iKTsKLQkJaV9SZXR1cm5WYWx1ZSA9IC0yOwotCX0KLQotCXJldHVybiBpX1JldHVyblZhbHVlOwotfQotCi0vKgotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IEZ1bmN0aW9uIE5hbWUgICAgIDogX0lOVF8JaV9BUENJMTcxMF9TZXRJbmRleEFuZFJlZmVyZW5jZVNvdXJjZSAgICAgICAgfAotfAkJCQkJKHVuc2lnbmVkIGNoYXJfIGJfQm9hcmRIYW5kbGUsICAgICAgICAgICAgICAgIHwKLXwJCQkJCSB1bnNpZ25lZCBjaGFyXyBiX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ICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0xOiBUaGUgaGFuZGxlIHBhcmFtZXRlciBvZiB0aGUgYm9hcmQgaXMgd3JvbmcgICAgICAgICB8Ci18CQkgICAgICAtMjogVGhlIHNlbGVjdGVkIG1vZHVsZSBudW1iZXIgaXMgd3JvbmcgICAgICAgICAgICAgICAgfAotfAkJICAgICAgLTM6IFRoZSBtb2R1bGUgaXMgbm90IGEgY291bnRlciBtb2R1bGUuICAgICAgICAgICAgICAgIHwKLXwJCSAgICAgIC00OiBUaGUgc291cmNlIHNlbGVjdGlvbiBpcyB3cm9uZyAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSovCi1zdGF0aWMgaW50IGlfQVBDSTE3MTBfU2V0SW5kZXhBbmRSZWZlcmVuY2VTb3VyY2Uoc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiwKLQkJCQkJCSB1bnNpZ25lZCBjaGFyIGJfTW9kdWxOYnIsCi0JCQkJCQkgdW5zaWduZWQgY2hhciBiX1NvdXJjZVNlbGVjdGlvbikKLXsKLQlzdHJ1Y3QgYWRkaV9wcml2YXRlICpkZXZwcml2ID0gZGV2LT5wcml2YXRlOwotCWludCBpX1JldHVyblZhbHVlID0gMDsKLQotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkvKiBUZXN0IHRoZSBtb2R1bGUgbnVtYmVyICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JaWYgKGJfTW9kdWxOYnIgPCA0KSB7Ci0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCS8qIFRlc3QgaWYgaW5jcmVtZW50YWwgY291bnRlciAqLwotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCWlmICgoZGV2cHJpdi0+c19Cb2FyZEluZm9zLgotCQkJCWR3X01vbGR1bGVDb25maWd1cmF0aW9uW2JfTW9kdWxOYnJdICYKLQkJCQkweEZGRkYwMDAwVUwpID09IEFQQ0kxNzEwX0lOQ1JFTUVOVEFMX0NPVU5URVIpIHsKLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogVGVzdCBpZiBmaXJtd2FyZSA+PSBSZXYxLjUgKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQlpZiAoKGRldnByaXYtPnNfQm9hcmRJbmZvcy4KLQkJCQkJZHdfTW9sZHVsZUNvbmZpZ3VyYXRpb25bYl9Nb2R1bE5icl0gJgotCQkJCQkweEZGRkYpID49IDB4MzEzNSkgewotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCS8qIFRlc3QgdGhlIHNvdXJjZSBzZWxlY3Rpb24gKi8KLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCWlmIChiX1NvdXJjZVNlbGVjdGlvbiA9PSBBUENJMTcxMF9TT1VSQ0VfMCB8fAotCQkJCQliX1NvdXJjZVNlbGVjdGlvbiA9PSBBUENJMTcxMF9TT1VSQ0VfMSkKLQkJCQl7Ci0JCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkvKiBUZXN0IGlmIGludmVydCB0aGUgaW5kZXggYW5kIHJlZmVyZW5jZSAqLwotCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQlpZiAoYl9Tb3VyY2VTZWxlY3Rpb24gPT0KLQkJCQkJCUFQQ0kxNzEwX1NPVVJDRV8xKSB7Ci0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCQkvKiBJbnZlcnQgaW5kZXggY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ICAgLTE6IFRoZSBoYW5kbGUgcGFyYW1ldGVyIG9mIHRoZSBib2FyZCBpcyB3cm9uZyAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMjogVGhlIHNlbGVjdGVkIG1vZHVsZSBudW1iZXIgaXMgd3JvbmcgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0zOiBDb3VudGVyIG5vdCBpbml0aWFsaXNlZCBzZWUgZnVuY3Rpb24gICAgICAgICAgICAgICB8Ci18CQkJICAiaV9BUENJMTcxMF9Jbml0Q291bnRlciIgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSovCi1zdGF0aWMgaW50IGlfQVBDSTE3MTBfU2V0RGlnaXRhbENobE9uKHN0cnVjdCBjb21lZGlfZGV2aWNlICpkZXYsCi0JCQkJICAgICAgdW5zaWduZWQgY2hhciBiX01vZHVsTmJyKQotewotCXN0cnVjdCBhZGRpX3ByaXZhdGUgKmRldnByaXYgPSBkZXYtPnByaXZhdGU7Ci0JaW50IGlfUmV0dXJuVmFsdWUgPSAwOwotCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCS8qIFRlc3QgdGhlIG1vZHVsZSBudW1iZXIgKi8KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQlpZiAoYl9Nb2R1bE5iciA8IDQpIHsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJLyogVGVzdCBpZiBjb3VudGVyIGluaXRpYWxpc2VkICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJaWYgKGRldnByaXYtPgotCQkJc19Nb2R1bGVJbmZvW2JfTW9kdWxOYnJdLgotCQkJc19TaWVtZW5zQ291bnRlckluZm8uc19J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gPSBkZXZwcml2LT4KLQkJCQlzX01vZHVsZUluZm9bYl9Nb2R1bE5icl0uCi0JCQkJc19TaWVtZW5zQ291bnRlckluZm8uCi0JCQkJc19Nb2RlUmVnaXN0ZXIuCi0JCQkJc19CeXRlTW9kZVJlZ2lzdGVyLmJfTW9kZVJlZ2lzdGVyMyAmIDB4RUY7Ci0KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCS8qIFNldCB0aGUgb3V0cHV0IE9mZiAqLwotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQlvdXRsKGRldnByaXYtPnNfTW9kdWxlSW5mb1tiX01vZHVsTmJyXS4KLQkJCQlzX1NpZW1lbnNDb3VudGVySW5mby4KLQkJCQlzX01vZGVSZWdpc3Rlci4KLQkJCQlkd19Nb2RlUmVnaXN0ZXIxXzJfM180LCBkZXZwcml2LT5zX0JvYXJkSW5mb3MuCi0JCQkJdWlfQWRkcmVzcyArIDIwICsgKDY0ICogYl9Nb2R1bE5icikpOwotCQl9IGVsc2UgewotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogQ291bnRlciBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICovCi0JCQkvKiAiaV9BUENJMTcxMF9Jbml0Q291bnRlciIgICAgICAgICAgICAgKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJRFBSSU5USygiQ291bnRlciBub3QgaW5pdGlhbGlzZWRcbiIpOwotCQkJaV9SZXR1cm5WYWx1ZSA9IC0zOwotCQl9Ci0JfSBlbHNlIHsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJLyogVGhlIHNlbGVjdGVkIG1vZHVsZSBudW1iZXIgcGFyYW1ldGVyIGlzIHdyb25nICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioq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gICAgIChiX01vZHVsTmJyKS4gRWFjaCBzb2Z0d2FyZSBvciBoYXJkd2FyZSBsYXRjaCBvY2N1ciBhICB8Ci18ICAgICAgICAgICAgICAgICAgICAgaW50ZXJydXB0LiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBJbnB1dCBQYXJhbWV0ZXJzICA6IHVuc2lnbmVkIGNoYXJfIGJfQm9hcmRIYW5kbGUgOiBIYW5kbGUgb2YgYm9hcmQgQVBDSS0xNzEwICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gYl9Nb2R1bE5iciAgICA6IE1vZHVsZSBudW1iZXIgdG8gY29uZmlndXJlICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDAgdG8gMykgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IE91dHB1dCBQYXJhbWV0ZXJzIDogLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBSZXR1cm4gVmFsdWUgICAgICA6ICAwOiBObyBlcnJvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTE6IFRoZSBoYW5kbGUgcGFyYW1ldGVyIG9mIHRoZSBib2FyZCBpcyB3cm9uZyAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMjogTm8gY291bnRlciBtb2R1bGUgZm91bmQgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0zOiBDb3VudGVyIG5vdCBpbml0aWFsaXNlZCBzZWUgZnVuY3Rpb24gICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICJpX0FQQ0kxNzEwX0luaXRDb3VudGVyIiAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtNDogSW50ZXJydXB0IHJvdXRpbmUgbm90IGluc3RhbGxlZCBzZWUgZnVuY3Rpb24gICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAiaV9BUENJMTcxMF9TZXRCb2FyZEludFJvdXRpbmUiICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSovCi1zdGF0aWMgaW50IGlfQVBDSTE3MTBfRW5hYmxlTGF0Y2hJbnRlcnJ1cHQoc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiwKLQkJCQkJICAgdW5zaWduZWQgY2hhciBiX01vZHVsTmJyKQotewotCXN0cnVjdCBhZGRpX3ByaXZhdGUgKmRldnByaXYgPSBkZXYtPnByaXZhdGU7Ci0JaW50IGlfUmV0dXJuVmFsdWUgPSAwOwotCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCS8qIFRlc3QgdGhlIG1vZHVsZSBudW1iZXIgKi8KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQlpZiAoYl9Nb2R1bE5iciA8IDQpIHsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJLyogVGVzdCBpZ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CArICg2NCAqIGJfTW9kdWxOYnIpKTsKLQkJfSBlbHNlIHsKLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCS8qIENvdW50ZXIgbm90IGluaXRpYWxpc2VkIHNlZSBmdW5jdGlvbiAqLwotCQkJLyogImlfQVBDSTE3MTBfSW5pdENvdW50ZXIiICAgICAgICAgICAgICovCi0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCURQUklOVEsoIkNvdW50ZXIgbm90IGluaXRpYWxpc2VkXG4iKTsKLQkJCWlfUmV0dXJuVmFsdWUgPSAtMzsKLQkJfQotCX0gZWxzZSB7Ci0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCS8qIFRoZSBzZWxlY3RlZCBtb2R1bGUgbnVtYmVyIHBhcmFtZXRlciBpcyB3cm9uZyAqLwotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCURQUklOVEsoIlRoZSBzZWxlY3RlZCBtb2R1bGUgbnVtYmVyIHBhcmFtZXRlciBpcyB3cm9uZ1xuIik7Ci0JCWlfUmV0dXJuVmFsdWUgPSAtMjsKLQl9Ci0KLQlyZXR1cm4gaV9SZXR1cm5WYWx1ZTsKLX0KLQotLyoKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBGdW5jdGlvbiBOYW1lICAgICA6IF9JTlRfIGlfQVBDSTE3MTBfRGlzYWJsZUxhdGNoSW50ZXJydXB0ICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCBjaGFyXyBiX0JvYXJkSGFuZGxlLCAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfTW9kdWxOYnIpICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFRhc2sgICAgICAgICAgICAgIDogRGlzYWJsZSB0aGUgbGF0Y2ggaW50ZXJydXB0IGZyb20gc2VsZWN0ZWQgbW9kdWxlICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAoYl9Nb2R1bE5icikuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IElucHV0IFBhcmFtZXRlcnMgIDogdW5zaWduZWQgY2hhcl8gYl9Cb2FyZEhhbmRsZSA6IEhhbmRsZSBvZiBib2FyZCBBUENJLTE3MTAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyBiX01vZHVsTmJyICAgIDogTW9kdWxlIG51bWJlciB0byBjb25maWd1cmUgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMCB0byAzKSAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgT3V0cHV0IFBhcmFtZXRlcnMgOiAtICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFJldHVybiBWYWx1ZSAgICAgIDogIDA6IE5vIGVycm9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMTogVGhlIGhhbmRsZSBwYXJhbWV0ZXIgb2YgdGhlIGJvYXJkIGlzIHdyb25nICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0yOiBObyBjb3VudGVyIG1vZHVsZSBmb3VuZCAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTM6IENvdW50ZXIgbm90IGluaXRpYWxpc2VkIHNlZSBmdW5jdGlvbiAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgImlfQVBDSTE3MTBfSW5pdENvdW50ZXIiICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC00OiBJbnRlcnJ1cHQgcm91dGluZSBub3QgaW5zdGFsbGVkIHNlZSBmdW5jdGlvbiAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICJpX0FQQ0kxNzEwX1NldEJvYXJkSW50Um91dGluZSIgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotKi8KLXN0YXRpYyBpbnQgaV9BUENJMTcxMF9EaXNhYmxlTGF0Y2hJbnRlcnJ1cHQoc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiwKLQkJCQkJICAgIHVuc2lnbmVkIGNoYXIgYl9Nb2R1bE5icikKLXsKLQlzdHJ1Y3QgYWRkaV9wcml2YXRlICpkZXZwcml2ID0gZGV2LT5wcml2YXRlOwotCWludCBpX1JldHVyblZhbHVlID0gMDsKLQotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkvKiBUZXN0IHRoZSBtb2R1bGUgbnVtYmVyICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JaWYgKGJfTW9kdWxOYnIgPCA0KSB7Ci0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCS8qIFRlc3QgaWYgY291bnRlciBpbml0aWFsaXNlZCAqLwotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCWlmIChkZXZwcml2LT4KLQkJCXNfTW9kdWxlSW5mb1tiX01vZHVsTmJyXS4KLQkJCXNfU2llbWVuc0NvdW50ZXJJbmZvLnNfSW5pdEZsYWcuYl9Db3VudGVySW5pdCA9PSAxKSB7Ci0KLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkvKiBXcml0ZSB0aGUgY29uZmlndXJhdGlvbiAqLwotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJb3V0bChkZXZwcml2LT5zX01vZHVsZUluZm9bYl9Nb2R1bE5icl0uCi0JCQkJc19TaWVtZW5zQ291bnRlckluZm8uCi0JCQkJc19Nb2RlUmVnaXN0ZXIuCi0JCQkJZHdfTW9kZVJlZ2lzdGVyMV8yXzNfNCAmCi0JCQkJKChBUENJMTcxMF9ESVNBQkxFX0xBVENIX0lOVCA8PCA4KSB8IDB4RkYpLAotCQkJCWRldnByaXYtPnNfQm9hcmRJbmZvcy51aV9BZGRyZXNzICsgMjAgKwotCQkJCSg2NCAqIGJfTW9kdWxOYnIpKTsKLQotCQkJbWRlbGF5KDEwMDApOwotCi0JCSAvKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogRGlzYWJsZSBpbnRlcnJ1cHQgKi8KLQkJIC8qKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCWRldnByaXYtPgotCQkJCXNfTW9kdWxlSW5mb1tiX01vZHVsTmJyXS4KLQkJCQlzX1NpZW1lbnNDb3VudGVySW5mby4KLQkJCQlzX01vZGVSZWdpc3Rlci4KLQkJCQlzX0J5dGVNb2RlUmVnaXN0ZXIuCi0JCQkJYl9Nb2RlUmVnaXN0ZXIyID0gZGV2cHJpdi0+Ci0JCQkJc19Nb2R1bGVJbmZvW2JfTW9kdWxOYnJdLgotCQkJCXNfU2llbWVuc0NvdW50ZXJJbmZvLgotCQkJCXNfTW9kZVJlZ2lzdGVyLgotCQkJCXNfQnl0ZU1vZGVSZWdpc3Rlci4KLQkJCQliX01vZGVSZWdpc3RlcjIgJiBBUENJMTcxMF9ESVNBQkxFX0xBVENIX0lOVDsKLQotCQl9IGVsc2UgewotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogQ291bnRlciBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICovCi0JCQkvKiAiaV9BUENJMTcxMF9Jbml0Q291bnRlciIgICAgICAgICAgICAgKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJRFBSSU5USygiQ291bnRlciBub3QgaW5pdGlhbGlzZWRcbiIpOwotCQkJaV9SZXR1cm5WYWx1ZSA9IC0zOwotCQl9Ci0JfSBlbHNlIHsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJLyogVGhlIHNlbGVjdGVkIG1vZHVsZSBudW1iZXIgcGFyYW1ldGVyIGlzIHdyb25nICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJRFBSSU5USygiVGhlIHNlbGVjdGVkIG1vZHVsZSBudW1iZXIgcGFyYW1ldGVyIGlzIHdyb25nXG4iKTsKLQkJaV9SZXR1cm5WYWx1ZSA9IC0yOwotCX0KLQotCXJldHVybiBpX1JldHVyblZhbHVlOwotfQotCi0vKgotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IEZ1bmN0aW9uIE5hbWUgICAgIDogX0lOVF8gaV9BUENJMTcxMF9Xcml0ZTE2Qml0Q291bnRlclZhbHVlICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCBjaGFyXyAgYl9Cb2FyZEhhbmRsZSAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICBiX01vZHVsTmJyLCAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gIGJfU2VsZWN0ZWRDb3VudGVyLCAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBpbnRfIHVpX1dyaXRlVmFsdWUpICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgVGFzayAgICAgICAgICAgICAgOiBXcml0ZSBhIDE2LUJpdCB2YWx1ZSAodWlfV3JpdGVWYWx1ZSkgaW4gdG8gdGhlIHNlbGVjdGVkfAotfCAgICAgICAgICAgICAgICAgICAgIDE2LUJpdCBjb3VudGVyIChiX1NlbGVjdGVkQ291bnRlcikgZnJvbSBzZWxlY3RlZCBtb2R1bGV8Ci18ICAgICAgICAgICAgICAgICAgICAgKGJfTW9kdWxOYnIpLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHw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iBWYWx1ZSAgICAgIDogIDA6IE5vIGVycm9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMTogVGhlIGhhbmRsZSBwYXJhbWV0ZXIgb2YgdGhlIGJvYXJkIGlzIHdyb25nICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0yOiBObyBjb3VudGVyIG1vZHVsZSBmb3VuZCAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTM6IENvdW50ZXIgbm90IGluaXRpYWxpc2VkIHNlZSBmdW5jdGlvbiAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgImlfQVBDSTE3MTBfSW5pdENvdW50ZXIiICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC00OiBUaGUgc2VsZWN0ZWQgMTYtQml0IGNvdW50ZXIgcGFyYW1ldGVyIGlzIHdyb25nICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSovCi1zdGF0aWMgaW50IGlfQVBDSTE3MTBfV3JpdGUxNkJpdENvdW50ZXJWYWx1ZShzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2LAotCQkJCQkgICAgIHVuc2lnbmVkIGNoYXIgYl9Nb2R1bE5iciwKLQkJCQkJICAgICB1bnNpZ25lZCBjaGFyIGJfU2VsZWN0ZWRDb3VudGVyLAotCQkJCQkgICAgIHVuc2lnbmVkIGludCB1aV9Xcml0ZVZhbHVlKQotewotCXN0cnVjdCBhZGRpX3ByaXZhdGUgKmRldnByaXYgPSBkZXYtPnByaXZhdGU7Ci0JaW50IGlfUmV0dXJuVmFsdWUgPSAwOwotCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCS8qIFRlc3QgdGhlIG1vZHVsZSBudW1iZXIgKi8KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQlpZiAoYl9Nb2R1bE5iciA8IDQpIHsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJLyogVGVzdCBpZiBjb3VudGVyIGluaXRpYWxpc2VkICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJaWYgKGRldnByaXYtPgotCQkJc19Nb2R1bGVJbmZvW2JfTW9kdWxOYnJdLgotCQkJc19TaWVtZW5zQ291bnRlckluZm8uc19Jbml0RmxhZy5iX0NvdW50ZXJJbml0ID09IDEpIHsKLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogVGVzdCB0aGUgY291bnRlciBzZWxlY3Rpb24gKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQlpZiAoYl9TZWxlY3RlZENvdW50ZXIgPCAyKSB7Ci0JCSAvKioqKioqKioqKioqKioqKioqKi8KLQkJCQkvKiBXcml0ZSB0aGUgdmFsdWUgKi8KLQkJIC8qKioqKioqKioqKioqKioqKioqLwotCi0JCQkJb3V0bCgodW5zaWduZWQgaW50KSAoKHVuc2lnbmVkIGludCkgKHVpX1dyaXRlVmFsdWUpIDw8ICgxNiAqCi0JCQkJCQkJYl9TZWxlY3RlZENvdW50ZXIpKSwKLQkJCQkJZGV2cHJpdi0+c19Cb2FyZEluZm9zLnVpX0FkZHJlc3MgKyA4ICsKLQkJCQkJKGJfU2VsZWN0ZWRDb3VudGVyICogNCkgKwotCQkJCQkoNjQgKiBiX01vZHVsTmJyKSk7Ci0JCQl9IGVsc2UgewotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCS8qIFRoZSBzZWxlY3RlZCAxNi1CaXQgY291bnRlciBwYXJhbWV0ZXIgaXMgd3JvbmcgKi8KLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCURQUklOVEsoIlRoZSBzZWxlY3RlZCAxNi1CaXQgY291bnRlciBwYXJhbWV0ZXIgaXMgd3JvbmdcbiIpOwotCQkJCWlfUmV0dXJuVmFsdWUgPSAtNDsKLQkJCX0KLQkJfSBlbHNlIHsKLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCS8qIENvdW50ZXIgbm90IGluaXRpYWxpc2VkIHNlZSBmdW5jdGlvbiAqLwotCQkJLyogImlfQVBDSTE3MTBfSW5pdENvdW50ZXIiICAgICAgICAgICAgICovCi0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCURQUklOVEsoIkNvdW50ZXIgbm90IGluaXRpYWxpc2VkXG4iKTsKLQkJCWlfUmV0dXJuVmFsdWUgPSAtMzsKLQkJfQotCX0gZWxzZSB7Ci0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCS8qIFRoZSBzZWxlY3RlZCBtb2R1bGUgbnVtYmVyIHBhcmFtZXRlciBpcyB3cm9uZyAqLwotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCURQUklOVEsoIlRoZSBzZWxlY3RlZCBtb2R1bGUgbnVtYmVyIHBhcmFtZXRlciBpcyB3cm9uZ1xuIik7Ci0JCWlfUmV0dXJuVmFsdWUgPSAtMjsKLQl9Ci0KLQlyZXR1cm4gaV9SZXR1cm5WYWx1ZTsKLX0KLQotLyoKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBGdW5jdGlvbiBOYW1lICAgICA6IF9JTlRfIGlfQVBDSTE3MTBfV3JpdGUzMkJpdENvdW50ZXJWYWx1ZSAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodW5zaWduZWQgY2hhcl8gICBiX0JvYXJkSGFuZGxlICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgIGJfTW9kdWxOYnIsICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVMT05HXyB1bF9Xcml0ZVZhbHVlKSAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgVGFzayAgICAgICAgICAgICAgOiBXcml0ZSBhIDMyLUJpdCB2YWx1ZSAodWlfV3JpdGVWYWx1ZSkgaW4gdG8gdGhlIHNlbGVjdGVkfAotfCAgICAgICAgICAgICAgICAgICAgIG1vZHVsZSAoYl9Nb2R1bE5icikuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgSW5wdXQgUGFyYW1ldGVycyAgOiB1bnNpZ25lZCBjaGFyXyBiX0JvYXJkSGFuZGxlICAgICA6IEhhbmRsZSBvZiBib2FyZCBBUENJLTE3MTAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfTW9kdWxOYnIgICAgICAgIDogTW9kdWxlIG51bWJlciB0byBjb25maWd1cmUgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgwIHRvIDMpICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBVTE9OR18gdWxfV3JpdGVWYWx1ZSAgICA6IDMyLUJpdCB3cml0ZSB2YWx1ZSAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IE91dHB1dCBQYXJhbWV0ZXJzIDogLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBSZXR1cm4gVmFsdWUgICAgICA6ICAwOiBObyBlcnJvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTE6IFRoZSBoYW5kbGUgcGFyYW1ldGVyIG9mIHRoZSBib2FyZCBpcyB3cm9uZyAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMjogTm8gY291bnRlciBtb2R1bGUgZm91bmQgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0zOiBDb3VudGVyIG5vdCBpbml0aWFsaXNlZCBzZWUgZnVuY3Rpb24gICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICJpX0FQQ0kxNzEwX0luaXRDb3VudGVyIiAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotKi8KLXN0YXRpYyBpbnQgaV9BUENJMTcxMF9Xcml0ZTMyQml0Q291bnRlclZhbHVlKHN0cnVjdCBjb21lZGlfZGV2aWNlICpkZXYsCi0JCQkJCSAgICAgdW5zaWduZWQgY2hhciBiX01vZHVsTmJyLAotCQkJCQkgICAgIHVuc2lnbmVkIGludCB1bF9Xcml0ZVZhbHVlKQotewotCXN0cnVjdCBhZGRpX3ByaXZhdGUgKmRldnByaXYgPSBkZXYtPnByaXZhdGU7Ci0JaW50IGlfUmV0dXJuVmFsdWUgPSAwOwotCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCS8qIFRlc3QgdGhlIG1vZHVsZSBudW1iZXIgKi8KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQlpZiAoYl9Nb2R1bE5iciA8IDQpIHsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJLyogVGVzdCBpZiBjb3VudGVyIGluaXRpYWxpc2VkICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJaWYgKGRldnByaXYtPgotCQkJc19Nb2R1bGVJbmZvW2JfTW9kdWxOYnJdLgotCQkJc19TaWVtZW5zQ291bnRlckluZm8uc19Jbml0RmxhZy5iX0NvdW50ZXJJbml0ID09IDEpIHsKLQkgICAgICAvKioqKioqKioqKioqKioqKioqKi8KLQkJCS8qIFdyaXRlIHRoZSB2YWx1ZSAqLwotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqLwotCi0JCQlvdXRsKHVsX1dyaXRlVmFsdWUsIGRldnByaXYtPnNfQm9hcmRJbmZvcy4KLQkJCQl1aV9BZGRyZXNzICsgNCArICg2NCAqIGJfTW9kdWxOYnIpKTsKLQkJfSBlbHNlIHsKLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCS8qIENvdW50ZXIgbm90IGluaXRpYWxpc2VkIHNlZSBmdW5jdGlvbiAqLwotCQkJLyogImlfQV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5ERVggYWN0aW9ucyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgSW5wdXQgUGFyYW1ldGVycyAgOiB1bnNpZ25lZCBjaGFyXyBiX0JvYXJkSGFuZGxlICAgICA6IEhhbmRsZSBvZiBib2FyZCBBUENJLTE3MTAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfTW9kdWxOYnIgICAgICAgIDogTW9kdWxlIG51bWJlciB0byBjb25maWd1cmUgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMCB0byAzKSAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBPdXRwdXQgUGFyYW1ldGVycyA6IC0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgUmV0dXJuIFZhbHVlICAgICAgOiAgMDogTm8gZXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0xOiBUaGUgaGFuZGxlIHBhcmFtZXRlciBvZiB0aGUgYm9hcmQgaXMgd3JvbmcgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTI6IE5vIGNvdW50ZXIgbW9kdWxlIGZvdW5kICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMzogQ291bnRlciBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAiaV9BUENJMTcxMF9Jbml0Q291bnRlciIgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTQ6IEluZGV4IG5vdCBpbml0aWFsaXNlZCBzZWUgZnVuY3Rpb24gICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgImlfQVBDSTE3MTBfSW5pdEluZGV4IiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0qLwotc3RhdGljIGludCBpX0FQQ0kxNzEwX0VuYWJsZUluZGV4KHN0cnVjdCBjb21lZGlfZGV2aWNlICpkZXYsCi0JCQkJICB1bnNpZ25lZCBjaGFyIGJfTW9kdWxOYnIpCi17Ci0Jc3RydWN0IGFkZGlfcHJpdmF0ZSAqZGV2cHJpdiA9IGRldi0+cHJpdmF0ZTsKLQlpbnQgaV9SZXR1cm5WYWx1ZSA9IDA7Ci0JdW5zaWduZWQgaW50IHVsX0ludGVycnVwdExhdGNoUmVnOwotCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCS8qIFRlc3QgdGhlIG1vZHVsZSBudW1iZXIgKi8KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQlpZiAoYl9Nb2R1bE5iciA8IDQpIHsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJLyogVGVzdCBpZiBjb3VudGVyIGluaXRpYWxpc2VkICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJaWY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CQkJCXNfTW9kZVJlZ2lzdGVyLgotCQkJCQlkd19Nb2RlUmVnaXN0ZXIxXzJfM180LAotCQkJCQlkZXZwcml2LT5zX0JvYXJkSW5mb3MudWlfQWRkcmVzcyArIDIwICsKLQkJCQkJKDY0ICogYl9Nb2R1bE5icikpOwotCQkJfSBlbHNlIHsKLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCS8qIEluZGV4IG5vdCBpbml0aWFsaXNlZCBzZWUgZnVuY3Rpb24gImlfQVBDSTE3MTBfSW5pdEluZGV4IiAqLwotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQlEUFJJTlRLKCJJbmRleCBub3QgaW5pdGlhbGlzZWQgXG4iKTsKLQkJCQlpX1JldHVyblZhbHVlID0gLTQ7Ci0JCQl9Ci0JCX0gZWxzZSB7Ci0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkvKiBDb3VudGVyIG5vdCBpbml0aWFsaXNlZCBzZWUgZnVuY3Rpb24gKi8KLQkJCS8qICJpX0FQQ0kxNzEwX0luaXRDb3VudGVyIiAgICAgICAgICAgICAqLwotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQlEUFJJTlRLKCJDb3VudGVyIG5vdCBpbml0aWFsaXNlZFxuIik7Ci0JCQlpX1JldHVyblZhbHVlID0gLTM7Ci0JCX0KLQl9IGVsc2UgewotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkvKiBUaGUgc2VsZWN0ZWQgbW9kdWxlIG51bWJlciBwYXJhbWV0ZXIgaXMgd3JvbmcgKi8KLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDAgdG8gMykgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgT3V0cHV0IFBhcmFtZXRlcnMgOiAtICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFJldHVybiBWYWx1ZSAgICAgIDogIDA6IE5vIGVycm9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMTogVGhlIGhhbmRsZSBwYXJhbWV0ZXIgb2YgdGhlIGJvYXJkIGlzIHdyb25nICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0yOiBObyBjb3VudGVyIG1vZHVsZSBmb3VuZCAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTM6IENvdW50ZXIgbm90IGluaXRpYWxpc2VkIHNlZSBmdW5jdGlvbiAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgImlfQVBDSTE3MTBfSW5pdENvdW50ZXIiICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC00OiBJbmRleCBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICJpX0FQQ0kxNzEwX0luaXRJbmRleCIgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0t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KiovCi0JCQkvKiBDb3VudGVyIG5vdCBpbml0aWFsaXNlZCBzZWUgZnVuY3Rpb24gKi8KLQkJCS8qICJpX0FQQ0kxNzEwX0luaXRDb3VudGVyIiAgICAgICAgICAgICAqLwotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQlEUFJJTlRLKCJDb3VudGVyIG5vdCBpbml0aWFsaXNlZFxuIik7Ci0JCQlpX1JldHVyblZhbHVlID0gLTM7Ci0JCX0KLQl9IGVsc2UgewotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkvKiBUaGUgc2VsZWN0ZWQgbW9kdWxlIG51bWJlciBwYXJhbWV0ZXIgaXMgd3JvbmcgKi8KLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQlEUFJJTlRLKCJUaGUgc2VsZWN0ZWQgbW9kdWxlIG51bWJlciBwYXJhbWV0ZXIgaXMgd3JvbmdcbiIpOwotCQlpX1JldHVyblZhbHVlID0gLTI7Ci0JfQotCi0JcmV0dXJuIGlfUmV0dXJuVmFsdWU7Ci19Ci0KLS8qCi0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgRnVuY3Rpb24gTmFtZSAgICAgOiBfSU5UXyBpX0FQQ0kxNzEwX0VuYWJsZUNvbXBhcmVMb2dpYyAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodW5zaWduZWQgY2hhcl8gICBiX0JvYXJkSGFuZGxlLCAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgIGJfTW9kdWxOYnIpICAgICAgICAgIC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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgUmV0dXJuIFZhbHVlICAgICAgOiAgMDogTm8gZXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0xOiBUaGUgaGFuZGxlIHBhcmFtZXRlciBvZiB0aGUgYm9hcmQgaXMgd3JvbmcgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTI6IE5vIGNvdW50ZXIgbW9kdWxlIGZvdW5kICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMzogQ291bnRlciBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAiaV9BUENJMTcxMF9Jbml0Q291bnRlciIgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTQ6IENvbXBhcmUgbG9naWMgbm90IGluaXRpYWxpc2VkLiAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgU2VlIGZ1bmN0aW9uICJpX0FQQ0kxNzEwX0luaXRDb21wYXJlTG9naWMiICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC01OiBJbnRlcnJ1cHQgZnVuY3Rpb24gbm90IGluaXRpYWxpc2VkLiAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgIFNlZSBmdW5jdGlvbiAiaV9BUENJMTcxMF9TZXRCb2FyZEludFJvdXRpbmVYIiAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotKi8KLXN0YXRpYyBpbnQgaV9BUENJMTcxMF9FbmFibGVDb21wYXJlTG9naWMoc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiwKLQkJCQkJIHVuc2lnbmVkIGNoYXIgYl9Nb2R1bE5icikKLXsKLQlzdHJ1Y3QgYWRkaV9wcml2YXRlICpkZXZwcml2ID0gZGV2LT5wcml2YXRlOwotCWludCBpX1JldHVyblZhbHVlID0gMDsKLQotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkvKiBUZXN0IHRoZSBtb2R1bGUgbnVtYmVyICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JaWYgKGJfTW9kdWxOYnIgPCA0KSB7Ci0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCS8qIFRlc3QgaWYgY291bnRlciBpbml0aWFsaXNlZCAqLwotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCWlmIChkZXZwcml2LT4KLQkJCXNfTW9kdWxlSW5mb1tiX01vZHVsTmJyXS4KLQkJCXNfU2llbWVuc0NvdW50ZXJJbmZvLnNfSW5pdEZsYWcuYl9Db3VudGVySW5pdCA9PSAxKSB7Ci0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkvKiBUZXN0IGlmIGNvbXBhcmUgbG9naWMgaW5pdGlhbGlzZWQgKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJaWYgKGRldnByaXYtPgotCQkJCXNfTW9kdWxlSW5mb1tiX01vZHVsTmJyXS4KLQkJCQlzX1NpZW1lbnNDb3VudGVySW5mby4KLQkJCQlzX0luaXRGbGFnLmJfQ29tcGFyZUxvZ2ljSW5pdCA9PSAxKSB7Ci0JCQkJZGV2cHJpdi0+Ci0JCQkJCXNfTW9kdWxlSW5mb1tiX01vZHVsTmJyXS4KLQkJCQkJc19TaWVtZW5zQ291bnRlckluZm8uCi0JCQkJCXNfTW9kZVJlZ2lzdGVyLgotCQkJCQ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ZWQgc2VlIGZ1bmN0aW9uICovCi0JCQkvKiAiaV9BUENJMTcxMF9Jbml0Q291bnRlciIgICAgICAgICAgICAgKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJRFBSSU5USygiQ291bnRlciBub3QgaW5pdGlhbGlzZWRcbiIpOwotCQkJaV9SZXR1cm5WYWx1ZSA9IC0zOwotCQl9Ci0JfSBlbHNlIHsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJLyogVGhlIHNlbGVjdGVkIG1vZHVsZSBudW1iZXIgcGFyYW1ldGVyIGlzIHdyb25nICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJRFBSSU5USygiVGhlIHNlbGVjdGVkIG1vZHVsZSBudW1iZXIgcGFyYW1ldGVyIGlzIHdyb25nXG4iKTsKLQkJaV9SZXR1cm5WYWx1ZSA9IC0yOwotCX0KLQotCXJldHVybiBpX1JldHVyblZhbHVlOwotfQotCi0vKgotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IEZ1bmN0aW9uIE5hbWUgICAgIDogX0lOVF8gaV9BUENJMTcxMF9EaXNhYmxlQ29tcGFyZUxvZ2ljICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHVuc2lnbmVkIGNoYXJfICAgYl9Cb2FyZEhhbmRsZSwgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICBiX01vZHVsTmJyKSAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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vZHVsZSBmb3VuZCAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTM6IENvdW50ZXIgbm90IGluaXRpYWxpc2VkIHNlZSBmdW5jdGlvbiAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgImlfQVBDSTE3MTBfSW5pdENvdW50ZXIiICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC00OiBDb21wYXJlIGxvZ2ljIG5vdCBpbml0aWFsaXNlZC4gICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgIFNlZSBmdW5jdGlvbiAiaV9BUENJMTcxMF9Jbml0Q29tcGFyZUxvZ2ljIiAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotKi8KLXN0YXRpYyBpbnQgaV9BUENJMTcxMF9EaXNhYmxlQ29tcGFyZUxvZ2ljKHN0cnVjdCBjb21lZGlfZGV2aWNlICpkZXYsCi0JCQkJCSAgdW5zaWduZWQgY2hhciBiX01vZHVsTmJyKQotewotCXN0cnVjdCBhZGRpX3ByaXZhdGUgKmRldnByaXYgPSBkZXYtPnByaXZhdGU7Ci0JaW50IGlfUmV0dXJuVmFsdWUgPSAwOwotCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCS8qIFRlc3QgdGhlIG1vZHVsZSBudW1iZXIgKi8KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQlpZiAoYl9Nb2R1bE5iciA8IDQpIHsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJLyogVGVzdCBpZiBjb3VudGVyIGluaXRpYWxpc2VkICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KL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kdWxlSW5mb1tiX01vZHVsTmJyXS4KLQkJCQkJc19TaWVtZW5zQ291bnRlckluZm8uCi0JCQkJCXNfTW9kZVJlZ2lzdGVyLgotCQkJCQlkd19Nb2RlUmVnaXN0ZXIxXzJfM180LAotCQkJCQlkZXZwcml2LT5zX0JvYXJkSW5mb3MudWlfQWRkcmVzcyArIDIwICsKLQkJCQkJKDY0ICogYl9Nb2R1bE5icikpOwotCQkJfSBlbHNlIHsKLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogQ29tcGFyZSBsb2dpYyBub3QgaW5pdGlhbGlzZWQgKi8KLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQlEUFJJTlRLKCJDb21wYXJlIGxvZ2ljIG5vdCBpbml0aWFsaXNlZFxuIik7Ci0JCQkJaV9SZXR1cm5WYWx1ZSA9IC00OwotCQkJfQotCQl9IGVsc2UgewotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogQ291bnRlciBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICovCi0JCQkvKiAiaV9BUENJMTcxMF9Jbml0Q291bnRlciIgICAgICAgICAgICAgKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJRFBSSU5USygiQ291bnRlciBub3QgaW5pdGlhbGlzZWRcbiIpOwotCQkJaV9SZXR1cm5WYWx1ZSA9IC0zOwotCQl9Ci0JfSBlbHNlIHsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJLyogVGhlIHNlbGVjdGVkIG1vZHVsZSBudW1iZXIgcGFyYW1ldGVyIGlzIHdyb25nICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJRFBSSU5USygiVGh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ZWQgY2hhcl8gIGJfQm9hcmRIYW5kbGUgICAgOiBIYW5kbGUgb2YgYm9hcmQgQVBDSS0xNzEwICAgIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gIGJfTW9kdWxOYnIgICAgICAgOiBOdW1iZXIgb2YgdGhlIG1vZHVsZSB0byBiZSAgIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWd1cmVkICgwIHRvIDMpICAgICAgICAgIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gIGJfSW50ZXJydXB0RW5hYmxlOiBFbmFibGUgb3IgZGlzYWJsZSB0aGUgICAgICAgIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRlcnJ1cHQuICAgICAgICAgICAgICAgICAgIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBUENJMTcxMF9FTkFCTEU6ICAgICAgICAgICAgIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFbmFibGUgdGhlIGludGVycnVwdCAgICAgICAgIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBUENJMTcxMF9ESVNBQkxFOiAgICAgICAgICAgIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEaXNhYmxlIHRoZSBpbnRlcnJ1cHQgICAgICAgIHwKLQkgICArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLQkgICB8IE91dHB1dCBQYXJhbWV0ZXJzIDogLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLQkgICArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLQkgICB8IFJldHVybiBWYWx1ZSAgICAgIDogIDA6IE5vIGVycm9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgICAgLTE6IFRoZSBoYW5kbGUgcGFyYW1ldGVyIG9mIHRoZSBib2FyZCBpcyB3cm9uZyAgICAgICAgIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgICAgLTI6IFRoZSBzZWxlY3RlZCBtb2R1bGUgbnVtYmVyIGlzIHdyb25nICAgICAgICAgICAgICAgIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgICAgLTM6IENvdW50ZXIgbm90IGluaXRpYWxpc2VkIHNlZSBmdW5jdGlvbiAgICAgICAgICAgICAgIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgICAgICJpX0FQQ0kxNzEwX0luaXRDb3VudGVyIiAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgICAgLTQ6IEZyZXF1ZW5jeSBtZWFzdXJlbWVudCBsb2dpYyBub3QgaW5pdGlhbGlzZWQuICAgICAgIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgICAgIFNlZSBmdW5jdGlvbiAiaV9BUENJMTcxMF9Jbml0RnJlcXVlbmN5TWVhc3VyZW1lbnQiIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgICAgLTU6IEludGVycnVwdCBwYXJhbWV0ZXIgaXMgd3JvbmcgICAgICAgICAgICAgICAgICAgICAgIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgICAgLTY6IEludGVycnVwdCBmdW5jdGlvbiBub3QgaW5pdGlhbGlzZWQuICAgICAgICAgICAgICAgIHwKLQkgICArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLQkgKi8KLXN0YXRpYyBpbnQgaV9BUENJMTcxMF9FbmFibGVGcmVxdWVuY3lNZWFzdXJlbWVudChzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2LAotCQkJCQkJIHVuc2lnbmVkIGNoYXIgYl9Nb2R1bE5iciwKLQkJCQkJCSB1bnNpZ25lZCBjaGFyIGJfSW50ZXJydXB0RW5hYmxlKQotewotCXN0cnVjdCBhZGRpX3ByaXZhdGUgKmRldnByaXYgPSBkZXYtPnByaXZhdGU7Ci0JaW50IGlfUmV0dXJuVmFsdWUgPSAwOwotCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCS8qIFRlc3QgdGhlIG1vZHVsZSBudW1iZXIgKi8KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQlpZiAoYl9Nb2R1bE5iciA8IDQpIHsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJLyogVGVzdCBpZiBjb3VudGVyIGluaXRpYWxpc2VkICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJaWYgKGRldnByaXYtPgotCQkJc19Nb2R1bGVJbmZvW2JfTW9kdWxOYnJdLgotCQkJc19TaWVtZW5zQ291bnRlckluZm8uc19Jbml0RmxhZy5iX0NvdW50ZXJJbml0ID09IDEpIHsKLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkvKiBUZXN0IGlmIGZyZXF1ZW5jeSBtZWFzdXJlbWVudCBpbml0aWFsaXNlZCAqLwotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJaWYgKGRldnByaXYtPgotCQkJCXNfTW9kdWxlSW5mb1tiX01vZHVsTmJyXS4K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kJCWRldnByaXYtPgotCQkJCQkJc19Nb2R1bGVJbmZvW2JfTW9kdWxOYnJdLgotCQkJCQkJc19TaWVtZW5zQ291bnRlckluZm8uCi0JCQkJCQlzX0luaXRGbGFnLgotCQkJCQkJYl9GcmVxdWVuY3lNZWFzdXJlbWVudEVuYWJsZSA9Ci0JCQkJCQkxOwotCQkJCX0gZWxzZSB7Ci0JCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCS8qIEludGVycnVwdCBwYXJhbWV0ZXIgaXMgd3JvbmcgKi8KLQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQlEUFJJTlRLKCJJbnRlcnJ1cHQgcGFyYW1ldGVyIGlzIHdyb25nXG4iKTsKLQkJCQkJaV9SZXR1cm5WYWx1ZSA9IC01OwotCQkJCX0KLQkJCX0gZWxzZSB7Ci0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogRnJlcXVlbmN5IG1lYXN1cmVtZW50IGxvZ2ljIG5vdCBpbml0aWFsaXNlZCAqLwotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJRFBSSU5USygiRnJlcXVlbmN5IG1lYXN1cmVtZW50IGxvZ2ljIG5vdCBpbml0aWFsaXNlZFxuIik7Ci0JCQkJaV9SZXR1cm5WYWx1ZSA9IC00OwotCQkJfQotCQl9IGVsc2UgewotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogQ291bnRlciBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICovCi0JCQkvKiAiaV9BUENJMTcxMF9Jbml0Q291bnRlciIgICAgICAgICAgICAgKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJRFBSSU5USygiQ291bnRlciBub3QgaW5pdGlhbGlzZWRcbiIpOwotCQkJaV9SZXR1cm5WYWx1ZSA9IC0zOwotCQl9Ci0JfSBlbHNlIHsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJLyogVGhlIHNlbGVjdGVkIG1vZHVsZSBudW1iZXIgcGFyYW1ldGVyIGlzIHdyb25nICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJRFBSSU5USygiVGhlIHNlbGVjdGVkIG1vZHVsZSBudW1iZXIgcGFyYW1ldGVyIGlzIHdyb25nXG4iKTsKLQkJaV9SZXR1cm5WYWx1ZSA9IC0yOwotCX0KLQotCXJldHVybiBpX1JldHVyblZhbHVlOwotfQotCi0JLyoKLQkgICArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLQkgICB8IEZ1bmN0aW9uIE5hbWUgICAgIDogX0lOVF8gaV9BUENJMTcxMF9EaXNhYmxlRnJlcXVlbmN5TWVhc3VyZW1lbnQgICAgICAgICAgIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCBjaGFyXyAgIGJfQm9hcmRIYW5kbGUsICAgICAgICAgICAgICAgICAgICAgIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgIGJfTW9kdWxOYnIpICAgICAgICAgICAgICAgICAgICAgICAgIHwKLQkgICArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLQkgICB8IFRhc2sgICAgICAgICAgICAgIDogRGlzYWJsZXMgdGhlIGZyZXF1ZW5j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gc2VsZWN0ZWQgbW9kdWxlIG51bWJlciBpcyB3cm9uZyAgICAgICAgICAgICAgICB8Ci0JICAgfCAgICAgICAgICAgICAgICAgICAgIC0zOiBDb3VudGVyIG5vdCBpbml0aWFsaXNlZCBzZWUgZnVuY3Rpb24gICAgICAgICAgICAgICB8Ci0JICAgfCAgICAgICAgICAgICAgICAgICAgICAiaV9BUENJMTcxMF9Jbml0Q291bnRlciIgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0JICAgfCAgICAgICAgICAgICAgICAgICAgIC00OiBGcmVxdWVuY3kgbWVhc3VyZW1lbnQgbG9naWMgbm90IGluaXRpYWxpc2VkLiAgICAgICB8Ci0JICAgfCAgICAgICAgICAgICAgICAgICAgICBTZWUgZnVuY3Rpb24gImlfQVBDSTE3MTBfSW5pdEZyZXF1ZW5jeU1lYXN1cmVtZW50IiB8Ci0JICAgKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0JICovCi1zdGF0aWMgaW50IGlfQVBDSTE3MTBfRGlzYWJsZUZyZXF1ZW5jeU1lYXN1cmVtZW50KHN0cnVjdCBjb21lZGlfZGV2aWNlICpkZXYsCi0JCQkJCQkgIHVuc2lnbmVkIGNoYXIgYl9Nb2R1bE5icikKLXsKLQlzdHJ1Y3QgYWRkaV9wcml2YXRlICpkZXZwcml2ID0gZGV2LT5wcml2YXRlOwotCWludCBpX1JldHVyblZhbHVlID0gMDsKLQotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkvKiBUZXN0IHRoZSBtb2R1bGUgbnVtYmVyICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JaWYgKGJfTW9kdWxOYnIgPCA0KSB7Ci0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCS8qIFRlc3QgaWYgY291bnRlciBpbml0aWFsa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cuCi0JCQkJCWJfRnJlcXVlbmN5TWVhc3VyZW1lbnRFbmFibGUgPSAwOwotCQkJfSBlbHNlIHsKLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkvKiBGcmVxdWVuY3kgbWVhc3VyZW1lbnQgbG9naWMgbm90IGluaXRpYWxpc2VkICovCi0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQlEUFJJTlRLKCJGcmVxdWVuY3kgbWVhc3VyZW1lbnQgbG9naWMgbm90IGluaXRpYWxpc2VkXG4iKTsKLQkJCQlpX1JldHVyblZhbHVlID0gLTQ7Ci0JCQl9Ci0JCX0gZWxzZSB7Ci0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkvKiBDb3VudGVyIG5vdCBpbml0aWFsaXNlZCBzZWUgZnVuY3Rpb24gKi8KLQkJCS8qICJpX0FQQ0kxNzEwX0luaXRDb3VudGVyIiAgICAgICAgICAgICAqLwotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQlEUFJJTlRLKCJDb3VudGVyIG5vdCBpbml0aWFsaXNlZFxuIik7Ci0JCQlpX1JldHVyblZhbHVlID0gLTM7Ci0JCX0KLQl9IGVsc2UgewotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkvKiBUaGUgc2VsZWN0ZWQgbW9kdWxlIG51bWJlciBwYXJhbWV0ZXIgaXMgd3JvbmcgKi8KLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQlEUFJJTlRLKCJUaGUgc2VsZWN0ZWQgbW9kdWxlIG51bWJlciBwYXJhbWV0ZXIgaXMgd3JvbmdcbiIpOwotCQlpX1JldHVyblZhbHVlID0gLT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hcl8gYl9Cb2FyZEhhbmRsZSA6IEhhbmRsZSBvZiBib2FyZCBBUENJLTE3MTAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyBiX01vZHVsTmJyICAgIDogTW9kdWxlIG51bWJlciB0byBjb25maWd1cmUgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMCB0byAzKSAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gYl9MYXRjaFJlZyAgICA6IFNlbGVjdGVkIGxhdGNoIHJlZ2lzdGVyICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCA6IGZvciB0aGUgZmlyc3QgbGF0Y2ggcmVnaXN0ZXIgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxIDogZm9yIHRoZSBzZWNvbmQgbGF0Y2ggcmVnaXN0ZXIgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgT3V0cHV0IFBhcmFtZXRlcnMgOiB1bnNpZ25lZCBjaGFyICpfIHBiX0xhdGNoU3RhdHVzIDogICBMYXRjaCByZWdpc3RlciBzdGF0dXMuICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgOiBObyBsYXRjaCBvY2N1ciAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSA6IEEgc29mdHdhcmUgbGF0Y2ggb2NjdXIgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyIDogQSBoYXJkd2FyZSBsYXRjaCBvY2N1ciAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMgOiBBIHNvZnR3YXJlIGFuZCBoYXJkd2FyZSAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxhdGNoIG9jY3VyICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgUmV0dXJuIFZhbHVlICAgICAgOiAgMDogTm8gZXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0xOiBUaGUgaGFuZGxlIHBhcmFtZXRlciBvZiB0aGUgYm9hcmQgaXMgd3JvbmcgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTI6IE5vIGNvdW50ZXIgbW9kdWxlIGZvdW5kICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMzogQ291bnRlciBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAiaV9BUENJMTcxMF9Jbml0Q291bnRlciIgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTQ6IFRoZSBzZWxlY3RlZCBsYXRjaCByZWdpc3RlciBwYXJhbWV0ZXIgaXMgd3JvbmcgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotKi8KLXN0YXRpYyBpbnQgaV9BUENJMTcxMF9SZWFkTGF0Y2hSZWdpc3RlclN0YXR1cyh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7Ci0KLQkJCQkqcGJfTGF0Y2hTdGF0dXMgPQotCQkJCQkodW5zaWduZWQgY2hhcikgKChkd19MYXRjaFJlZyA+PiAoYl9MYXRjaFJlZyAqCi0JCQkJCQkJNCkpICYgMHgzKTsKLQkJCX0gZWxzZSB7Ci0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogVGhlIHNlbGVjdGVkIGxhdGNoIHJlZ2lzdGVyIHBhcmFtZXRlciBpcyB3cm9uZyAqLwotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJRFBSSU5USygiVGhlIHNlbGVjdGVkIGxhdGNoIHJlZ2lzdGVyIHBhcmFtZXRlciBpcyB3cm9uZ1xuIik7Ci0JCQkJaV9SZXR1cm5WYWx1ZSA9IC00OwotCQkJfQotCQl9IGVsc2UgewotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogQ291bnRlciBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICovCi0JCQkvKiAiaV9BUENJMTcxMF9Jbml0Q291bnRlciIgICAgICAgICAgICAgKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJRFBSSU5USygiQ291bnRlciBub3QgaW5pdGlhbGlzZWRcbiIpOwotCQkJaV9SZXR1cm5WYWx1ZSA9IC0zOwotCQl9Ci0JfSBlbHNlIHsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJLyogVGhlIHNlbGVjdGVkIG1vZHVsZSBudW1iZXIgcGFyYW1ldGVyIGlzIHdyb25nICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJRFBSSU5USygiVGhlIHNlbGVjdGVkIG1vZHVsZSBudW1iZXIgcGFyYW1ldGVyIGlzIHdyb25nXG4iKTsKLQkJaV9SZXR1cm5WYWx1ZSA9IC0yOwotCX0KLQotCXJldHVybiBpX1JldHVyblZhbHVlOwotfQotCi0vKgotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IEZ1bmN0aW9uIE5hbWUgICAgIDogX0lOVF8gaV9BUENJMTcxMF9SZWFkTGF0Y2hSZWdpc3RlclZhbHVlICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodW5zaWduZWQgY2hhcl8gICAgIGJfQm9hcmRIYW5kbGUsfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgICAgYl9Nb2R1bE5iciwgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgICBiX0xhdGNoUmVnLCAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUFVMT05HXyBwdWxfTGF0Y2hWYWx1ZSkgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFRhc2sgICAgICAgICAgICAgIDogUmVhZCB0aGUgbGF0Y2ggcmVnaXN0ZXIgdmFsdWUgZnJvbSBzZWxlY3RlZCBtb2R1bGUgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAoYl9Nb2R1bE5icikgYW5kIHNlbGVjdGVkIGxhdGNoIHJlZ2lzdGVyIChiX0xhdGNoUmVnKS4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VybiBWYWx1ZSAgICAgIDogIDA6IE5vIGVycm9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMTogVGhlIGhhbmRsZSBwYXJhbWV0ZXIgb2YgdGhlIGJvYXJkIGlzIHdyb25nICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0yOiBObyBjb3VudGVyIG1vZHVsZSBmb3VuZCAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTM6IENvdW50ZXIgbm90IGluaXRpYWxpc2VkIHNlZSBmdW5jdGlvbiAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgImlfQVBDSTE3MTBfSW5pdENvdW50ZXIiICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC00OiBUaGUgc2VsZWN0ZWQgbGF0Y2ggcmVnaXN0ZXIgcGFyYW1ldGVyIGlzIHdyb25nICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSovCi1zdGF0aWMgaW50IGlfQVBDSTE3MTBfUmVhZExhdGNoUmVnaXN0ZXJWYWx1ZShzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2LAotCQkJCQkgICAgIHVuc2lnbmVkIGNoYXIgYl9Nb2R1bE5iciwKLQkJCQkJICAgICB1bnNpZ25lZCBjaGFyIGJfTGF0Y2hSZWcsCi0JCQkJCSAgICAgdW5zaWduZWQgaW50ICpwdWxfTGF0Y2hWYWx1ZSkKLXsKLQlzdHJ1Y3QgYWRkaV9wcml2YXRlICpkZXZwcml2ID0gZGV2LT5wcml2YXRlOwotCWludCBpX1JldHVyblZhbHVlID0gMDsKLQotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkvKiBUZXN0IHRoZSBtb2R1bGUgbnVtYmVyICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JaWYgKGJfTW9kdWxOYnIgPCA0KSB7Ci0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCS8qIFRlc3QgaWYgY291bnRlciBpbml0aWFsaXNlZCAqLwotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCWlmIChkZXZwcml2LT4KLQkJCXNfTW9kdWxlSW5mb1tiX01vZHVsTmJyXS4KLQkJCXNfU2llbWVuc0NvdW50ZXJJbmZvLnNfSW5pdEZsYWcuYl9Db3VudGVySW5pdCA9PSAxKSB7Ci0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkvKiBUZXN0IHRoZSBsYXRjaCByZWdpc3RlciBwYXJhbWV0ZXIgKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJaWYgKGJfTGF0Y2hSZWcgPCAyKSB7Ci0JCQkJKnB1bF9MYXRjaFZhbHVlID0gaW5sKGRldnByaXYtPnNfQm9hcmRJbmZvcy4KLQkJCQkJdWlfQWRkcmVzcyArICgoYl9MYXRjaFJlZyArIDEpICogNCkgKwotCQkJCQkoNjQgKiBiX01vZHVsTmJyKSk7Ci0KLQkJCX0gZWxzZSB7Ci0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogVGhlIHNlbGVjdGVkIGxhdGNoIHJlZ2lzdGVyIHBhcmFtZXRlciBpcyB3cm9uZyAqLwotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJRFBSSU5USygiVGhlIHNlbGVjdGVkIGxhdGNoIHJlZ2lzdGVyIHBhcmFtZXRlciBpcyB3cm9uZ1xuIik7Ci0JCQkJaV9SZXR1cm5WYWx1ZSA9IC00OwotCQkJfQotCQl9IGVsc2UgewotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogQ291bnRlciBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICovCi0JCQkvKiAiaV9BUENJMTcxMF9Jbml0Q291bnRlciIgICAgICAgICAgICAgKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJRFBSSU5USygiQ291bnRlciBub3QgaW5pdGlhbGlzZWRcbiIpOwotCQkJaV9SZXR1cm5WYWx1ZSA9IC0zOwotCQl9Ci0JfSBlbHNlIHsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJLyogVGhlIHNlbGVjdGVkIG1vZHVsZSBudW1iZXIgcGFyYW1ldGVyIGlzIHdyb25nICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJRFBSSU5USygiVGhlIHNlbGVjdGVkIG1vZHVsZSBudW1iZXIgcGFyYW1ldGVyIGlzIHdyb25nXG4iKTsKLQkJaV9SZXR1cm5WYWx1ZSA9IC0yOwotCX0KLQotCXJldHVybiBpX1JldHVyblZhbHVlOwotfQotCi0vKgotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IEZ1bmN0aW9uIE5hbWUgICAgIDogX0lOVF8gaV9BUENJMTcxMF9SZWFkMTZCaXRDb3VudGVyVmFsdWUgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodW5zaWduZWQgY2hhcl8gICAgIGJfQm9hcmRIYW5kbGUsICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgICAgYl9Nb2R1bE5iciwgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgICBiX1NlbGVjdGVkQ291bnRlciwgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgaW50ICpfICAgcHVpX0NvdW50ZXJWYWx1ZSkgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFRhc2sgICAgICAgICAgICAgIDogTGF0Y2ggdGhlIHNlbGVjdGVkIDE2LUJpdCBjb3VudGVyIChiX1NlbGVjdGVkQ291bnRlcikgIHwKLXwgICAgICAgICAgICAgICAgICAgICBmcm9tIHNlbGVjdGVkIG1vZHVsZSAoYl9Nb2R1bE5icikgaW4gdG8gdGhlIGZpcnN0ICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIGxhdGNoIHJlZ2lzdGVyIGFuZCByZXR1cm4gdGhlIGxhdGNoZWQgdmFsdWUuICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgSW5wdXQgUGFyYW1ldGVycyAgOiB1bnNpZ25lZCBjaGFyXyBiX0JvYXJkSGFuZGxlICAgICA6IEhhbmRsZSBvZiBib2FyZCBBUENJLTE3MTAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfTW9kdWxOYnIgICAgICAgIDogTW9kdWxlIG51bWJlciB0byBjb25maWd1cmUgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgwIHRvIDMpICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyBiX1NlbGVjdGVkQ291bnRlciA6IFNlbGVjdGVkIDE2LUJpdCBjb3VudGVyICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDAgb3IgMSkgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgT3V0cHV0IFBhcmFtZXRlcnMgOiB1bnNpZ25lZCBpbnQgKl8gcHVpX0NvdW50ZXJWYWx1ZSA6IDE2LUJpdCBjb3VudGVyIHZhbHVlICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFJldHVybiBWYWx1ZSAgICAgIDogIDA6IE5vIGVycm9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMTogVGhlIGhhbmRsZSBwYXJhbWV0ZXIgb2YgdGhlIGJvYXJkIGlzIHdyb25nICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0yOiBObyBjb3VudGVyIG1vZHVsZSBmb3VuZCAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTM6IENvdW50ZXIgbm90IGluaXRpYWxpc2VkIHNlZSBmdW5jdGlvbiAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgImlfQVBDSTE3MTBfSW5pdENvdW50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CSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkvKiBUZXN0IHRoZSBjb3VudGVyIHNlbGVjdGlvbiAqLwotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCWlmIChiX1NlbGVjdGVkQ291bnRlciA8IDIpIHsKLQkJIC8qKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogTGF0Y2ggdGhlIGNvdW50ZXIgKi8KLQkJIC8qKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQlvdXRsKDEsIGRldnByaXYtPnNfQm9hcmRJbmZvcy4KLQkJCQkJdWlfQWRkcmVzcyArICg2NCAqIGJfTW9kdWxOYnIpKTsKLQotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkvKiBSZWFkIHRoZSBsYXRjaCB2YWx1ZSAqLwotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCWR3X0xhdGhjaFZhbHVlID0gaW5sKGRldnByaXYtPnNfQm9hcmRJbmZvcy4KLQkJCQkJdWlfQWRkcmVzcyArIDQgKyAoNjQgKiBiX01vZHVsTmJyKSk7Ci0KLQkJCQkqcHVpX0NvdW50ZXJWYWx1ZSA9Ci0JCQkJCSh1bnNpZ25lZCBpbnQpICgoZHdfTGF0aGNoVmFsdWUgPj4gKDE2ICoKLQkJCQkJCQliX1NlbGVjdGVkQ291bnRlcikpICYKLQkJCQkJMHhGRkZGVSk7Ci0JCQl9IGVsc2UgewotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCS8qIFRoZSBzZWxlY3RlZCAxNi1CaXQgY291bnRlciBwYXJhbWV0ZXIgaXMgd3JvbmcgKi8KLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCURQUklOVEsoIlRoZSBzZWxlY3RlZCAxNi1CaXQgY291bnRlciBwYXJhbWV0ZXIgaXMgd3JvbmdcbiIpOwotCQkJCWlfUmV0dXJuVmFsdWUgPSAtNDsKLQkJCX0KLQkJfSBlbHNlIHsKLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCS8qIENvdW50ZXIgbm90IGluaXRpYWxpc2VkIHNlZSBmdW5jdGlvbiAqLwotCQkJLyogImlfQVBDSTE3MTBfSW5pdENvdW50ZXIiICAgICAgICAgICAgICovCi0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCURQUklOVEsoIkNvdW50ZXIgbm90IGluaXRpYWxpc2VkXG4iKTsKLQkJCWlfUmV0dXJuVmFsdWUgPSAtMzsKLQkJfQotCX0gZWxzZSB7Ci0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCS8qIFRoZSBzZWxlY3RlZCBtb2R1bGUgbnVtYmVyIHBhcmFtZXRlciBpcyB3cm9uZyAqLwotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCURQUklOVEsoIlRoZSBzZWxlY3RlZCBtb2R1bGUgbnVtYmVyIHBhcmFtZXRlciBpcyB3cm9uZ1xuIik7Ci0JCWlfUmV0dXJuVmFsdWUgPSAtMjsKLQl9Ci0KLQlyZXR1cm4gaV9SZXR1cm5WYWx1ZTsKLX0KLQotLyoKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBGdW5jdGlvbiBOYW1lICAgICA6IF9JTlRfIGlfQVBDSTE3MTBfUmVhZDMyQml0Q291bnRlclZhbHVlICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHVuc2lnbmVkIGNoYXJfICAgICBiX0JvYXJkSGFuZGxlLCAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICAgIGJfTW9kdWxOYnIsICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQVUxPTkdfIHB1bF9Db3VudGVyVmFsdWUpICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgVGFzayAgICAgICAgICAgICAgOiBMYXRjaCB0aGUgMzItQml0IGNvdW50ZXIgZnJvbSBzZWxlY3RlZCBtb2R1bGUgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIChiX01vZHVsTmJyKSBpbiB0byB0aGUgZmlyc3QgbGF0Y2ggcmVnaXN0ZXIgYW5kIHJldHVybiB8Ci18ICAgICAgICAgICAgICAgICAgICAgdGhlIGxhdGNoZWQgdmFsdWUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBJbnB1dCBQYXJhbWV0ZXJzICA6IHVuc2lnbmVkIGNoYXJfIGJfQm9hcmRIYW5kbGUgICAgIDogSGFuZGxlIG9mIGJvYXJkIEFQQ0ktMTcxMCAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gYl9Nb2R1bE5iciAgICAgICAgOiBNb2R1bGUgbnVtYmVyIHRvIGNvbmZpZ3VyZSAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDAgdG8gMykg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l9Nb2R1bE5iciwKLQkJCQkJICAgIHVuc2lnbmVkIGludCAqcHVsX0NvdW50ZXJWYWx1ZSkKLXsKLQlzdHJ1Y3QgYWRkaV9wcml2YXRlICpkZXZwcml2ID0gZGV2LT5wcml2YXRlOwotCWludCBpX1JldHVyblZhbHVlID0gMDsKLQotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkvKiBUZXN0IHRoZSBtb2R1bGUgbnVtYmVyICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JaWYgKGJfTW9kdWxOYnIgPCA0KSB7Ci0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCS8qIFRlc3QgaWYgY291bnRlciBpbml0aWFsaXNlZCAqLwotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCWlmIChkZXZwcml2LT4KLQkJCXNfTW9kdWxlSW5mb1tiX01vZHVsTmJyXS4KLQkJCXNfU2llbWVuc0NvdW50ZXJJbmZvLnNfSW5pdEZsYWcuYl9Db3VudGVySW5pdCA9PSAxKSB7Ci0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKi8KLQkJCS8qIFRhdGNoIHRoZSBjb3VudGVyICovCi0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJb3V0bCgxLCBkZXZwcml2LT5zX0JvYXJkSW5mb3MuCi0JCQkJdWlfQWRkcmVzcyArICg2NCAqIGJfTW9kdWxOYnIpKTsKLQotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkvKiBSZWFkIHRoZSBsYXRjaCB2YWx1ZSAqLwotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCSpwdWxfQ291bnRlclZhbHVlID0gaW5sKGRldnByaXYtPnNfQm9hcmRJbmZvcy4KLQkJCQl1aV9BZGRyZXNzICsgNCArICg2NCAqIGJfTW9kdWxOYnIpKTsKLQkJfSBlbHNlIHsKLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCS8qIENvdW50ZXIgbm90IGluaXRpYWxpc2VkIHNlZSBmdW5jdGlvbiAqLwotCQkJLyogImlfQVBDSTE3MTBfSW5pdENvdW50ZXIiICAgICAgICAgICAgICovCi0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCURQUklOVEsoIkNvdW50ZXIgbm90IGluaXRpYWxpc2VkXG4iKTsKLQkJCWlfUmV0dXJuVmFsdWUgPSAtMzsKLQkJfQotCX0gZWxzZSB7Ci0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCS8qIFRoZSBzZWxlY3RlZCBtb2R1bGUgbnVtYmVyIHBhcmFtZXRlciBpcyB3cm9uZyAqLwotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCURQUklOVEsoIlRoZSBzZWxlY3RlZCBtb2R1bGUgbnVtYmVyIHBhcmFtZXRlciBpcyB3cm9uZ1xuIik7Ci0JCWlfUmV0dXJuVmFsdWUgPSAtMjsKLQl9Ci0KLQlyZXR1cm4gaV9SZXR1cm5WYWx1ZTsKLX0KLQotLyoKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBGdW5jdGlvbiBOYW1lICAgICA6IF9JTlRfIGlfQVBDSTE3MTBfR2V0SW5kZXhTdGF0dXMgKHVuc2lnbmVkIGNoYXJfICAgYl9Cb2FyZEhhbmRsZSx8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICBiX01vZHVsTmJyLCAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyICpfIHBiX0luZGV4U3RhdHVzKXwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBUYXNrICAgICAgICAgICAgICA6IFJldHVybiB0aGUgaW5kZXggc3RhdHVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgSW5wdXQgUGFyYW1ldGVycyAgOiB1bnNpZ25lZCBjaGFyXyBiX0JvYXJkSGFuZGxlICAgICA6IEhhbmRsZSBvZiBib2FyZCBBUENJLTE3MTAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfTW9kdWxOYnIgICAgICAgIDogTW9kdWxlIG51bWJlciB0byBjb25maWd1cmUgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMCB0byAzKSAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBPdXRwdXQgUGFyYW1ldGVycyA6IHVuc2lnbmVkIGNoYXIgKl8gcGJfSW5kZXhTdGF0dXMgICA6IDAgOiBObyBJTkRFWCBvY2N1ciAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSA6IEEgSU5ERVggb2NjdXIgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgUmV0dXJuIFZhbHVlICAgICAgOiAgMDogTm8gZXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0xOiBUaGUgaGFuZGxlIHBhcmFtZXRlciBvZiB0aGUgYm9hcmQgaXMgd3JvbmcgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTI6IE5vIGNvdW50ZXIgbW9kdWxlIGZvdW5kICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMzogQ291bnRlciBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAiaV9BUENJMTcxMF9Jbml0Q291bnRlciIgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTQ6IEluZGV4IG5vdCBpbml0aWFsaXNlZCBzZWUgZnVuY3Rpb24gICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgImlfQVBDSTE3MTBfSW5pdEluZGV4IiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0qLwotc3RhdGljIGludCBpX0FQQ0kxNzEwX0dldEluZGV4U3RhdHVzKHN0cnVjdCBjb21lZGlfZGV2aWNlICpkZXYsCi0JCQkJICAgICB1bnNpZ25lZCBjaGFyIGJfTW9kdWxOYnIsCi0JCQkJICAgICB1bnNpZ25lZCBjaGFyICpwYl9JbmRleFN0YXR1cykKLXsKLQlzdHJ1Y3QgYWRkaV9wcml2YXRlICpkZXZwcml2ID0gZGV2LT5wcml2YXRlOwotCWludCBpX1JldHVyblZhbHVlID0gMDsKLQl1bnNpZ25lZCBpbnQgZHdfU3RhdHVzUmVnID0gMDsKLQotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkvKiBUZXN0IHRoZSBtb2R1bGUgbnVtYmVyICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JaWYgKGJfTW9kdWxOYnIgPCA0KSB7Ci0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCS8qIFRlc3QgaWYgY291bnRlciBpbml0aWFsaXNlZCAqLwotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCWlmIChkZXZwcml2LT4KLQkJCXNfTW9kdWxlSW5mb1tiX01vZHVsTmJyXS4KLQkJCXNfU2llbWVuc0NvdW50ZXJJbmZvLnNfSW5pdEZsYWcuYl9Db3VudGVySW5pdCA9PSAxKSB7Ci0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogVGVzdCBpZiBpbmRleCBpbml0aWFsaXNlZCAqLwotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJaWYgKGRldnByaXYtPgotCQkJCXNfTW9kdWxlSW5mb1tiX01vZHVsTmJyXS4KLQkJCQlzX1NpZW1lbnNDb3VudGVySW5mby5zX0luaXRGbGFnLmJfSW5kZXhJbml0KSB7Ci0JCQkJZHdfU3RhdHVzUmVnID0gaW5sKGRldnByaXYtPnNfQm9hcmRJbmZvcy4KLQkJCQkJdWlfQWRkcmVzcyArIDEyICsgKDY0ICogYl9Nb2R1bE5icikpOwotCi0JCQkJKnBiX0luZGV4U3RhdHVzID0gKHVuc2lnbmVkIGNoYXIpIChkd19TdGF0dXNSZWcgJiAxKTsKLQkJCX0gZWxzZSB7Ci0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkvKiBJbmRleCBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICJpX0FQQ0kxNzEwX0luaXRJbmRleCIgKi8KLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJRFBSSU5USygiSW5kZXggbm90IGluaXRpYWxpc2VkXG4iKTsKLQkJCQlpX1JldHVyblZhbHVlID0gLTQ7Ci0JCQl9Ci0JCX0gZWxzZSB7Ci0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkvKiBDb3VudGVyIG5vdCBpbml0aWFsaXNlZCBzZWUgZnVuY3Rpb24gKi8KLQkJCS8qICJpX0FQQ0kxNzEwX0luaXRDb3VudGVyIiAgICAgICAgICAgICAqLwotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQlEUFJJTlRLKCJDb3VudGVyIG5vdCBpbml0aWFsaXNlZFxuIik7Ci0JCQlpX1JldHVyblZhbHVlID0gLTM7Ci0JCX0KLQl9IGVsc2UgewotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkvKiBUaGUgc2VsZWN0ZWQgbW9kdWxlIG51bWJlciBwYXJhbWV0ZXIgaXMgd3JvbmcgKi8KLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQlEUFJJTlRLKCJUaGUgc2VsZWN0ZWQgbW9kdWxlIG51bWJlciBwYXJhbWV0ZXIgaXMgd3JvbmdcbiIpOwotCQlpX1JldHVyblZhbHVlID0gLTI7Ci0JfQotCi0JcmV0dXJuIGlfUmV0dXJuVmFsdWU7Ci19Ci0KLS8qCi0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgRnVuY3Rpb24gTmFtZSAgICAgOiBfSU5UXyBpX0FQQ0kxNzEwX0dldFJlZmVyZW5jZVN0YXR1cyAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCBjaGFyXyAgIGJfQm9hcmRIYW5kbGUsICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgYl9Nb2R1bE5iciwgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhciAqXyBwYl9SZWZlcmVuY2VTdGF0dXMpIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBUYXNrICAgICAgICAgICAgICA6IFJldHVybiB0aGUgcmVmZXJlbmNlIHN0YXR1cyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgSW5wdXQgUGFyYW1ldGVycyAgOiB1bnNpZ25lZCBjaGFyXyBiX0JvYXJkSGFuZGxlICAgICA6IEhhbmRsZSBvZiBib2FyZCBBUENJLTE3MTAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfTW9kdWxOYnIgICAgICAgIDogTW9kdWxlIG51bWJlciB0byBjb25maWd1cmUgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMCB0byAzKSAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBPdXRwdXQgUGFyYW1ldGVycyA6IHVuc2lnbmVkIGNoYXIgKl8gcGJfUmVmZXJlbmNlU3RhdHVzICAgOiAwIDogTm8gUkVGRVJFTkNFIG9jY3VyICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgOiBBIFJFRkVSRU5DRSBvY2N1ciAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgUmV0dXJuIFZhbHVlICAgICAgOiAgMDogTm8gZXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0xOiBUaGUgaGFuZGxlIHBhcmFtZXRlciBvZiB0aGUgYm9hcmQgaXMgd3JvbmcgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTI6IE5vIGNvdW50ZXIgbW9kdWxlIGZvdW5kICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMzogQ291bnRlciBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAiaV9BUENJMTcxMF9Jbml0Q291bnRlciIgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTQ6IFJlZmVyZW5jZSBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgImlfQVBDSTE3MTBfSW5pdFJlZmVyZW5jZSIgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0qLwotc3RhdGljIGludCBpX0FQQ0kxNzEwX0dldFJlZmVyZW5jZVN0YXR1cyhzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2LAotCQkJCQkgdW5zaWduZWQgY2hhciBiX01vZHVsTmJyLAotCQkJCQkgdW5zaWduZWQgY2hhciAqcGJfUmVmZXJlbmNlU3RhdHVzKQotewotCXN0cnVjdCBhZGRpX3ByaXZhdGUgKmRldnByaXYgPSBkZXYtPnByaXZhdGU7Ci0JaW50IGlfUmV0dXJuVmFsdWUgPSAwOwotCXVuc2lnbmVkIGludCBkd19TdGF0dXNSZWcgPSAwOwotCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCS8qIFRlc3QgdGhlIG1vZHVsZSBudW1iZXIgKi8KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQlpZiAoYl9Nb2R1bE5iciA8IDQpIHsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJLyogVGVzdCBpZiBjb3VudGVyIGluaXRpYWxpc2VkICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJaWYgKGRldnByaXYtPgotCQkJc19Nb2R1bGVJbmZvW2JfTW9kdWxOYnJdLgotCQkJc19TaWVtZW5zQ291bnRlckluZm8uc19Jbml0RmxhZy5iX0NvdW50ZXJJbml0ID09IDEpIHsKLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogVGVzdCBpZiByZWZlcmVuY2UgaW5pdGlhbGlzZWQgKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQlpZiAoZGV2cHJpdi0+Ci0JCQkJc19Nb2R1bGVJbmZvW2JfTW9kdWxOYnJdLgotCQkJCXNfU2llbWVuc0NvdW50ZXJJbmZvLgotCQkJCXNfSW5pdEZsYWcuYl9SZWZlcmVuY2VJbml0KSB7Ci0JCQkJZHdfU3RhdHVzUmVnID0gaW5sKGRldnByaXYtPnNfQm9hcmRJbmZvcy4KLQkJCQkJdWlfQWRkcmVzcyArIDI0ICsgKDY0ICogYl9Nb2R1bE5icikpOwotCi0JCQkJKnBiX1JlZmVyZW5jZVN0YXR1cyA9Ci0JCQkJCSh1bnNpZ25lZCBjaGFyKSAofmR3X1N0YXR1c1JlZyAmIDEpOwotCQkJfSBlbHNlIHsKLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogUmVmZXJlbmNlIG5vdCBpbml0aWFsaXNlZCBzZWUgZnVuY3Rpb24gImlfQVBDSTE3MTBfSW5pdFJlZmVyZW5jZSIgKi8KLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQlEUFJJTlRLKCJSZWZlcmVuY2Ugbm90IGluaXRpYWxpc2VkXG4iKTsKLQkJCQlpX1JldHVyblZhbHVlID0gLTQ7Ci0JCQl9Ci0JCX0gZWxzZSB7Ci0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkvKiBDb3VudGVyIG5vdCBpbml0aWFsaXNlZCBzZWUgZnVuY3Rpb24gKi8KLQkJCS8qICJpX0FQQ0kxNzEwX0luaXRDb3VudGVyIiAgICAgICAgICAgICAqLwotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQlEUFJJTlRLKCJDb3VudGVyIG5vdCBpbml0aWFsaXNlZFxuIik7Ci0JCQlpX1JldHVyblZhbHVlID0gLTM7Ci0JCX0KLQl9IGVsc2UgewotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkvKiBUaGUgc2VsZWN0ZWQgbW9kdWxlIG51bWJlciBwYXJhbWV0ZXIgaXMgd3JvbmcgKi8KLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQlEUFJJTlRLKCJUaGUgc2VsZWN0ZWQgbW9kdWxlIG51bWJlciBwYXJhbWV0ZXIgaXMgd3JvbmdcbiIpOwotCQlpX1JldHVyblZhbHVlID0gLTI7Ci0JfQotCi0JcmV0dXJuIGlfUmV0dXJuVmFsdWU7Ci19Ci0KLS8qCi0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgRnVuY3Rpb24gTmFtZSAgICAgOiBfSU5UXyBpX0FQQ0kxNzEwX0dldFVBU1N0YXR1cyAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodW5zaWduZWQgY2hhcl8gICBiX0JvYXJkSGFuZGxlLCAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgIGJfTW9kdWxOYnIsICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXIgKl8gcGJfVUFTU3RhdHVzKSAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBUYXNrICAgICAgICAgICAgICA6IFJldHVybiB0aGUgZXJyb3Igc2lnbmFsIChVQVMpIHN0YXR1cyAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgSW5wdXQgUGFyYW1ldGVycyAgOiB1bnNpZ25lZCBjaGFyXyBiX0JvYXJkSGFuZGxlICAgICA6IEhhbmRsZSBvZiBib2FyZCBBUENJLTE3MTAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfTW9kdWxOYnIgICAgICAgIDogTW9kdWxlIG51bWJlciB0byBjb25maWd1cmUgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMCB0byAzKSAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBPdXRwdXQgUGFyYW1ldGVycyA6IHVuc2lnbmVkIGNoYXIgKl8gcGJfVUFTU3RhdHVzICAgICAgOiAwIDogVUFTIGlzIGxvdyAiMCIgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgOiBVQVMgaXMgaGlnaCAiMSIgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgUmV0dXJuIFZhbHVlICAgICAgOiAgMDogTm8gZXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0xOiBUaGUgaGFuZGxlIHBhcmFtZXRlciBvZiB0aGUgYm9hcmQgaXMgd3JvbmcgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTI6IE5vIGNvdW50ZXIgbW9kdWxlIGZvdW5kICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMzogQ291bnRlciBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAiaV9BUENJMTcxMF9Jbml0Q291bnRlciIgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSovCi1zdGF0aWMgaW50IGlfQVBDSTE3MTBfR2V0VUFTU3RhdHVzKHN0cnVjdCBjb21lZGlfZGV2aWNlICpkZXYsCi0JCQkJICAgdW5zaWduZWQgY2hhciBiX01vZHVsTmJyLAotCQkJCSAgIHVuc2lnbmVkIGNoYXIgKnBiX1VBU1N0YXR1cykKLXsKLQlzdHJ1Y3QgYWRkaV9wcml2YXRlICpkZXZwcml2ID0gZGV2LT5wcml2YXRlOwotCWludCBpX1JldHVyblZhbHVlID0gMDsKLQl1bnNpZ25lZCBpbnQgZHdfU3RhdHVzUmVnID0gMDsKLQotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkvKiBUZXN0IHRoZSBtb2R1bGUgbnVtYmVyICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JaWYgKGJfTW9kdWxOYnIgPCA0KSB7Ci0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCS8qIFRlc3QgaWYgY291bnRlciBpbml0aWFsaXNlZCAqLwotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCWlmIChkZXZwcml2LT4KLQkJCXNfTW9kdWxlSW5mb1tiX01vZHVsTmJyXS4KLQkJCXNfU2llbWVuc0NvdW50ZXJJbmZvLnNfSW5pdEZsYWcuYl9Db3VudGVySW5pdCA9PSAxKSB7Ci0JCQlkd19TdGF0dXNSZWcgPSBpbmwoZGV2cHJpdi0+c19Cb2FyZEluZm9zLgotCQkJCXVpX0FkZHJlc3MgKyAyNCArICg2NCAqIGJfTW9kdWxOYnIpKTsKLQotCQkJKnBiX1VBU1N0YXR1cyA9ICh1bnNpZ25lZCBjaGFyKSAoKGR3X1N0YXR1c1JlZyA+PiAxKSAmIDEpOwotCQl9IGVsc2UgewotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogQ291bnRlciBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICovCi0JCQkvKiAiaV9BUENJMTcxMF9Jbml0Q291bnRlciIgICAgICAgICAgICAgKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJRFBSSU5USygiQ291bnRlciBub3QgaW5pdGlhbGlzZWRcbiIpOwotCQkJaV9SZXR1cm5WYWx1ZSA9IC0zOwotCQl9Ci0JfSBlbHNlIHsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJLyogVGhlIHNlbGVjdGVkIG1vZHVsZSBudW1iZXIgcGFyYW1ldGVyIGlzIHdyb25nICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJRFBSSU5USygiVGhlIHNlbGVjdGVkIG1vZHVsZSBudW1iZXIgcGFyYW1ldGVyIGlzIHdyb25nXG4iKTsKLQkJaV9SZXR1cm5WYWx1ZSA9IC0yOwotCi0JfQotCi0JcmV0dXJuIGlfUmV0dXJuVm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byBjb25maWd1cmUgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMCB0byAzKSAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBPdXRwdXQgUGFyYW1ldGVycyA6IHVuc2lnbmVkIGNoYXIgKl8gcGJfQ0JTdGF0dXMgICAgICA6IDAgOiBDb3VudGVyIG5vIG92ZXJmbG93ICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSA6IENvdW50ZXIgb3ZlcmZsb3cgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgUmV0dXJuIFZhbHVlICAgICAgOiAgMDogTm8gZXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0xOiBUaGUgaGFuZGxlIHBhcmFtZXRlciBvZiB0aGUgYm9hcmQgaXMgd3JvbmcgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTI6IE5vIGNvdW50ZXIgbW9kdWxlIGZvdW5kICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMzogQ291bnRlciBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAiaV9BUENJMTcxMF9Jbml0Q291bnRlciIgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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RlcjAgOiAwIDogTm8gb3ZlcmZsb3cgb2NjdXIgZm9yIHwKLXwJCQkJCQkgICAgICAgdGhlIGZpcnN0IDE2LWJpdCAgICAgIHwKLXwJCQkJCQkgICAgICAgY291bnRlciAgICAgICAgICAgICAgIHwKLXwJCQkJCQkgICAxIDogT3ZlcmZsb3cgb2NjdXIgZm9yIHRoZXwKLXwJCQkJCQkgICAgICAgZmlyc3QgMTYtYml0IGNvdW50ZXIgIHwKLXwJCSAgICAgIHVuc2lnbmVkIGNoYXIgKl8gcGJfQ0JTdGF0dXNDb3VudGVyMSA6IDAgOiBObyBvdmVyZmxvdyBvY2N1ciBmb3IgfAotfAkJCQkJCSAgICAgICB0aGUgc2Vjb25kIDE2LWJpdCAgICAgfAotfAkJCQkJCSAgICAgICBjb3VudGVyICAgICAgICAgICAgICAgfAotfAkJCQkJCSAgIDEgOiBPdmVyZmxvdyBvY2N1ciBmb3IgdGhlfAotfAkJCQkJCSAgICAgICBzZWNvbmQgMTYtYml0IGNvdW50ZXIgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFJldHVybiBWYWx1ZSAgICAgIDogIDA6IE5vIGVycm9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMTogVGhlIGhhbmRsZSBwYXJhbWV0ZXIgb2YgdGhlIGJvYXJkIGlzIHdyb25nICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0yOiBObyBjb3VudGVyIG1vZHVsZSBmb3VuZCAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTM6IENvdW50ZXIgbm90IGluaXRpYWxpc2VkIHNlZSBmdW5jdGlvbiAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgImlfQVBDSTE3MTBfSW5pdENvdW50ZXIiICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC00OiBDb3VudGVyIG5vdCBpbml0aWFsaXNlZCB0byAyKjE2LWJpdCBtb2RlLiAgICAgICAgICB8Ci18CQkJICBTZWUgZnVuY3Rpb24gImlfQVBDSTE3MTBfSW5pdENvdW50ZXIiICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTU6IEZpcm13YXJlIHJldmlzaW9uIGVycm9yICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotKi8KLXN0YXRpYyBpbnQgaV9BUENJMTcxMF9HZXQxNkJpdENCU3RhdHVzKHN0cnVjdCBjb21lZGlfZGV2aWNlICpkZXYsCi0JCQkJICAgICAgIHVuc2lnbmVkIGNoYXIgYl9Nb2R1bE5iciwKLQkJCQkgICAgICAgdW5zaWduZWQgY2hhciAqcGJfQ0JTdGF0dXNDb3VudGVyMCwKLQkJCQkgICAgICAgdW5zaWduZWQgY2hhciAqcGJfQ0JTdGF0dXNDb3VudGVyMSkKLXsKLQlzdHJ1Y3QgYWRkaV9wcml2YXRlICpkZXZwcml2ID0gZGV2LT5wcml2YXRlOwotCWludCBpX1JldHVyblZhbHVlID0gMDsKLQl1bnNpZ25lZCBpbnQgZHdfU3RhdHVzUmVnID0gMDsKLQotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkvKiBUZXN0IHRoZSBtb2R1bGUgbnVtYmVyICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JaWYgKGJfTW9kdWxOYnIgPCA0KSB7Ci0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCS8qIFRlc3QgaWYgY291bnRl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1NpZW1lbnNDb3VudGVySW5mby5zX0luaXRGbGFnLmJfQ291bnRlckluaXQgPT0gMSkgKi8KLQl9CQkJLyogIGlmIChiX01vZHVsTmJyIDwgNCkgKi8KLQllbHNlIHsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJLyogVGhlIHNlbGVjdGVkIG1vZHVsZSBudW1iZXIgcGFyYW1ldGVyIGlzIHdyb25nICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJRFBSSU5USygiVGhlIHNlbGVjdGVkIG1vZHVsZSBudW1iZXIgcGFyYW1ldGVyIGlzIHdyb25nXG4iKTsKLQkJaV9SZXR1cm5WYWx1ZSA9IC0yOwotCX0JCQkvKiAgaWYgKGJfTW9kdWxOYnIgPCA0KSAqLwotCi0JcmV0dXJuIGlfUmV0dXJuVmFsdWU7Ci19Ci0KLS8qCi0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgRnVuY3Rpb24gTmFtZSAgICAgOiBfSU5UXyBpX0FQQ0kxNzEwX0dldFVEU3RhdHVzICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodW5zaWduZWQgY2hhcl8gICBiX0JvYXJkSGFuZGxlLCAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgIGJfTW9kdWxOYnIsICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXIgKl8gcGJfVURTdGF0dXMpICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBUYXNrICAgICAgICAgICAgICA6IFJldHVybiB0aGUgY291bnRlciBwcm9ncmVzcyBzdGF0dXMgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgSW5wdXQgUGFyYW1ldGVycyAgOiB1bnNpZ25lZCBjaGFyXyBiX0JvYXJkSGFuZGxlICAgICA6IEhhbmRsZSBvZiBib2FyZCBBUENJLTE3MTAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfTW9kdWxOYnIgICAgICAgIDogTW9kdWxlIG51bWJlciB0byBjb25maWd1cmUgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMCB0byAzKSAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBPdXRwdXQgUGFyYW1ldGVycyA6IHVuc2lnbmVkIGNoYXIgKl8gcGJfVURTdGF0dXMgICAgICA6IDAgOiBDb3VudGVyIHByb2dyZXNzIGluIHRoZSAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGVjdGVkIG1vZGUgZG93biAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxIDogQ291bnRlciBwcm9ncmVzcyBpbiB0aGUgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxlY3RlZCBtb2RlIHVwICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFJldHVybiBWYWx1ZSAgICAgIDogIDA6IE5vIGVycm9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMTogVGhlIGhhbmRsZSBwYXJhbWV0ZXIgb2YgdGhlIGJvYXJkIGlzIHdyb25nICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0yOiBObyBjb3VudGVyIG1vZHVsZSBmb3VuZCAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTM6IENvdW50ZXIgbm90IGluaXRpYWxpc2VkIHNlZSBmdW5jdGlvbiAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgImlfQVBDSTE3MTBfSW5pdENvdW50ZXIiICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0qLwotc3RhdGljIGludCBpX0FQQ0kxNzEwX0dldFVEU3RhdHVzKHN0cnVjdCBjb21lZGlfZGV2aWNlICpkZXYsCi0JCQkJICB1bnNpZ25lZCBjaGFyIGJfTW9kdWxOYnIsCi0JCQkJICB1bnNpZ25lZCBjaGFyICpwYl9VRFN0YXR1cykKLXsKLQlzdHJ1Y3QgYWRkaV9wcml2YXRlICpkZXZwcml2ID0gZGV2LT5wcml2YXRlOwotCWludCBpX1JldHVyblZhbHVlID0gMDsKLQl1bnNpZ25lZCBpbnQgZHdfU3RhdHVzUmVnID0gMDsKLQotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkvKiBUZXN0IHRoZSBtb2R1bGUgbnVtYmVyICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JaWYgKGJfTW9kdWxOYnIgPCA0KSB7Ci0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCS8qIFRlc3QgaWYgY291bnRlciBpbml0aWFsaXNlZCAqLwotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCWlmIChkZXZwcml2LT4KLQkJCXNfTW9kdWxlSW5mb1tiX01vZHVsTmJyXS4KLQkJCXNfU2llbWVuc0NvdW50ZXJJbmZvLnNfSW5pdEZsYWcuYl9Db3VudGVySW5pdCA9PSAxKSB7Ci0JCQlkd19TdGF0dXNSZWcgPSBpbmwoZGV2cHJpdi0+c19Cb2FyZEluZm9zLgotCQkJCXVpX0FkZHJlc3MgKyAyNCArICg2NCAqIGJfTW9kdWxOYnIpKTsKLQotCQkJKnBiX1VEU3RhdHVzID0gKHVuc2lnbmVkIGNoYXIpICgoZHdfU3RhdHVzUmVnID4+IDIpICYgMSk7Ci0KLQkJfSBlbHNlIHsKLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCS8qIENvdW50ZXIgbm90IGluaXRpYWxpc2VkIHNlZSBmdW5jdGlvbiAqLwotCQkJLyogImlfQVBDSTE3MTBfSW5pdENvdW50ZXIiICAgICAgICAgICAgICovCi0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCURQUklOVEsoIkNvdW50ZXIgbm90IGluaXRpYWxpc2VkXG4iKTsKLQkJCWlfUmV0dXJuVmFsdWUgPSAtMzsKLQkJfQotCX0gZWxzZSB7Ci0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCS8qIFRoZSBzZWxlY3RlZCBtb2R1bGUgbnVtYmVyIHBhcmFtZXRlciBpcyB3cm9uZyAqLwotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCURQUklOVEsoIlRoZSBzZWxlY3RlZCBtb2R1bGUgbnVtYmVyIHBhcmFtZXRlciBpcyB3cm9uZ1xuIik7Ci0JCWlfUmV0dXJuVmFsdWUgPSAtMjsKLQl9Ci0KLQlyZXR1cm4gaV9SZXR1cm5WYWx1ZTsKLX0KLQotLyoKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBGdW5jdGlvbiBOYW1lICAgICA6IF9JTlRfIGlfQVBDSTE3MTBfR2V0SW50ZXJydXB0VURMYXRjaGVkU3RhdHVzICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCBjaGFyXyAgIGJfQm9hcmRIYW5kbGUsICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgYl9Nb2R1bE5iciwgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhciAqXyBwYl9VRFN0YXR1cykgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFRhc2sgICAgICAgICAgICAgIDogUmV0dXJuIHRoZSBjb3VudGVyIHByb2dyZXNzIGxhdGNoZWQgc3RhdHVzIGFmdGVyIGEgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBpbmRleCBpbnRlcnJ1cHQgb2NjdXIuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IElucHV0IFBhcmFtZXRlcnMgIDogdW5zaWduZWQgY2hhcl8gYl9Cb2FyZEhhbmRsZSAgICAgOiBIYW5kbGUgb2YgYm9hcmQgQVBDSS0xNzEwICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyBiX01vZHVsTmJyICAgICAgICA6IE1vZHVsZSBudW1iZXIgdG8gY29uZmlndXJlICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDAgdG8gMykgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgT3V0cHV0IFBhcmFtZXRlcnMgOiB1bnNpZ25lZCBjaGFyICpfIHBiX1VEU3RhdHVzICAgICAgOiAwIDogQ291bnRlciBwcm9ncmVzcyBpbiB0aGUgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxlY3RlZCBtb2RlIGRvd24gICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSA6IENvdW50ZXIgcHJvZ3Jlc3MgaW4gdGhlICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZWN0ZWQgbW9kZSB1cCAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIgOiBObyBpbmRleCBpbnRlcnJ1cHQgb2NjdXIgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFJldHVybiBWYWx1ZSAgICAgIDogIDA6IE5vIGVycm9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMTogVGhlIGhhbmRsZSBwYXJhbWV0ZXIgb2YgdGhlIGJvYXJkIGlzIHdyb25nICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0yOiBObyBjb3VudGVyIG1vZHVsZSBmb3VuZCAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTM6IENvdW50ZXIgbm90IGluaXRpYWxpc2VkIHNlZSBmdW5jdGlvbiAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgImlfQVBDSTE3MTBfSW5pdENvdW50ZXIiICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC00OiBJbnRlcnJ1cHQgZnVuY3Rpb24gbm90IGluaXRpYWxpc2VkLiAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgIFNlZSBmdW5jdGlvbiAiaV9BUENJMTcxMF9TZXRCb2FyZEludFJvdXRpbmVYIiAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotKi8KLXN0YXRpYyBpbnQgaV9BUENJMTcxMF9HZXRJbnRlcnJ1cHRVRExhdGNoZWRTdGF0dXMoc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiwKLQkJCQkJCSAgdW5zaWduZWQgY2hhciBiX01vZHVsTmJyLAotCQkJCQkJICB1bnNpZ25lZCBjaGFyICpwYl9VRFN0YXR1cykKLXsKLQlzdHJ1Y3QgYWRkaV9wcml2YXRlICpkZXZwcml2ID0gZGV2LT5wcml2YXRlOwotCWludCBpX1JldHVyblZhbHVlID0gMDsKLQl1bnNpZ25lZCBpbnQgZHdfU3RhdHVzUmVnID0gMDsKLQotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkvKiBUZXN0IHRoZSBtb2R1bGUgbnVtYmVyICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JaWYgKGJfTW9kdWxOYnIgPCA0KSB7Ci0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCS8qIFRlc3QgaWYgY291bnRlciBpbml0aWFsaXNlZCAqLwotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCWlmIChkZXZwcml2LT4KLQkJCXNfTW9kdWxlSW5mb1tiX01vZHVsTmJyXS4KLQkJCXNfU2llbWVuc0NvdW50ZXJJbmZvLnNfSW5pdEZsYWcuYl9Db3VudGVySW5pdCA9PSAxKSB7Ci0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogVGVzdCBpZiBpbmRleCBpbnRlcnJ1cHQgb2NjdXIgKi8KLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCWlmIChkZXZwcml2LT4KLQkJCQlzX01vZHVsZUluZm9bYl9Nb2R1bE5icl0uCi0JCQkJc19TaWVtZW5zQ291bnRlckluZm8uCi0JCQkJc19Jbml0RmxhZy5iX0luZGV4SW50ZXJydXB0T2NjdXIgPT0gMSkgewotCQkJCWRldnByaXYtPgotCQkJCQlzX01vZHVsZUluZm9bYl9Nb2R1bE5icl0uCi0JCQkJCXNfU2llbWVuc0NvdW50ZXJJbmZvLgotCQkJCQlzX0luaXRGbGFnLmJfSW5kZXhJbnRlcnJ1cHRPY2N1ciA9IDA7Ci0KLQkJCQlkd19TdGF0dXNSZWcgPSBpbmwoZGV2cHJpdi0+c19Cb2FyZEluZm9zLgotCQkJCQl1aV9BZGRyZXNzICsgMTIgKyAoNjQgKiBiX01vZHVsTmJyKSk7Ci0KLQkJCQkqcGJfVURTdGF0dXMgPSAodW5zaWduZWQgY2hhcikgKChkd19TdGF0dXNSZWcgPj4gMSkgJiAxKTsKLQkJCX0gZWxzZSB7Ci0JCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkvKiBObyBpbmRleCBpbnRlcnJ1cHQgb2NjdXIgKi8KLQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJKnBiX1VEU3RhdHVzID0gMjsKLQkJCX0KLQkJfSBlbHNlIHsKLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCS8qIENvdW50ZXIgbm90IGluaXRpYWxpc2VkIHNlZSBmdW5jdGlvbiAqLwotCQkJLyogImlfQVBDSTE3MTBfSW5pdENvdW50ZXIiICAgICAgICAgICAgICovCi0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCURQUklOVEsoIkNvdW50ZXIgbm90IGluaXRpYWxpc2VkXG4iKTsKLQkJCWlfUmV0dXJuVmFsdWUgPSAtMzsKLQkJfQotCX0gZWxzZSB7Ci0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCS8qIFRoZSBzZWxlY3RlZCBtb2R1bGUgbnVtYmVyIHBhcmFtZXRlciBpcyB3cm9uZyAqLwotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCURQUklOVEsoIlRoZSBzZWxlY3RlZCBtb2R1bGUgbnVtYmVyIHBhcmFtZXRlciBpcyB3cm9uZ1xuIik7Ci0JCWlfUmV0dXJuVmFsdWUgPSAtMjsKLQl9Ci0KLQlyZXR1cm4gaV9SZXR1cm5WYWx1ZTsKLX0KLQotCS8qCi0JICAgKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0JICAgfCBGdW5jdGlvbiBOYW1lICAgICA6IF9JTlRfIGlfQVBDSTE3MTBfUmVhZEZyZXF1ZW5jeU1lYXN1cmVtZW50ICAgICAgICAgICAgICB8Ci0JICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAodW5zaWduZWQgY2hhcl8gICAgICAgICAgICBiX0JvYXJkSGFuZGxlLCAgICAgICAgICAgICB8Ci0JICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICAgICAgICAgICBiX01vZHVsTmJyLCAgICAgICAgICAgICAgICB8Ci0JICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhciAqXyAgICAgICAgICBwYl9TdGF0dXMsICAgICAgICAgICAgICAgICAgfAotCSAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBVTE9OR18gICAgICAgIHB1bF9SZWFkVmFsdWUpICAgICAgICAgICAgICAgfAotCSAgICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotCSAgIHwgVGFzayAgICAgICAgICAgICAgOiBSZXR1cm5zIHRoZSBzdGF0dXMgKHBiX1N0YXR1cykgYW5kIHRoZSBudW1iZXIgb2YgICAgICAgfAotCSAgIHwgICAgICAgICAgICAgICAgICBpbmNyZW1lbnRzIGluIHRoZSBzZXQgdGltZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotCSAgIHwgICAgICAgICAgICAgICAgICBTZWUgZnVuY3Rpb24gIiBpX0FQQ0kxNzEwX0luaXRGcmVxdWVuY3lNZWFzdXJlbWVudCAiICAgfAotCSAgICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotCSAgIHwgSW5wdXQgUGFyYW1ldGVycyAgOiB1bnNpZ25lZCBjaGFyXyAgYl9Cb2FyZEhhbmRsZSAgICA6IEhhbmRsZSBvZiBib2FyZCBBUENJLTE3MTAgICAgfAotCSAgIHwgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgYl9Nb2R1bE5iciAgICAgICA6IE51bWJlciBvZiB0aGUgbW9kdWxlIHRvIGJlICAgfAotCSAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZ3VyZWQgKDAgdG8gMykgICAgICAgICAgfAotCSAgICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotCSAgIHwgT3V0cHV0IFBhcmFtZXRlcnMgOiB1bnNpZ25lZCBjaGFyICpfIHBiX1N0YXR1cyAgICAgOiBSZXR1cm5zIHRoZSBmcmVxdWVuY3kgICAgICAgIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZWFzdXJlbWVudCBzdGF0dXMgICAgICAgICAgIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIDogQ291bnRpbmcgY3ljbGUgbm90ICAgICAgIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRlZC4gICAgICAgICAgICAgICAgIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxIDogQ291bnRpbmcgY3ljbGUgc3RhcnRlZC4gIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyIDogQ291bnRpbmcgY3ljbGUgc3RvcHBlZC4gIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGhlIG1lYXN1cmVtZW50IGN5Y2xlIGlzIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tcGxldGVkLiAgICAgICAgICAgICAgIHwKLQkgICB8ICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhciAqXyBwYl9VRFN0YXR1cyAgICAgIDogMCA6IENvdW50ZXIgcHJvZ3Jlc3MgaW4gdGhlICB8Ci0JICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGVjdGVkIG1vZGUgZG93biAgICAgICB8Ci0JICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSA6IENvdW50ZXIgcHJvZ3Jlc3MgaW4gdGhlICB8Ci0JICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGVjdGVkIG1vZGUgdXAgICAgICAgICB8Ci0JICAgfCAgICAgICAgICAgICAgICAgIFBVTE9OR18gcHVsX1JlYWRWYWx1ZSAgIDogUmV0dXJuIHRoZSBudW1iZXIgb2YgICAgICAgICB8Ci0JICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5jcmVtZW50cyBpbiB0aGUgZGVmaW5lZCAgICB8Ci0JICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGltZSBiYXNlLiAgICAgICAgICAgICAgICAgICB8Ci0JICAgKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0JICAgfCBSZXR1cm4gVmFsdWUgICAgICA6ICAwOiBObyBlcnJvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0JICAgfCAgICAgICAgICAgICAgICAgICAgIC0xOiBUaGUgaGFuZGxlIHBhcmFtZXRlciBvZiB0aGUgYm9hcmQgaXMgd3JvbmcgICAgICAgICB8Ci0JICAgfCAgICAgICAgICAgICAgICAgICAgIC0yOiBUaGUgc2VsZWN0ZWQgbW9kdWxlIG51bWJlciBpcyB3cm9uZyAgICAgICAgICAgICAgICB8Ci0JICAgfCAgICAgICAgICAgICAgICAgICAgIC0zOiBDb3VudGVyIG5vdCBpbml0aWFsaXNlZCBzZWUgZnVuY3Rpb24gICAgICAgICAgICAgICB8Ci0JICAgfCAgICAgICAgICAgICAgICAgICAgICAiaV9BUENJMTcxMF9Jbml0Q291bnRlciIgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0JICAgfCAgICAgICAgICAgICAgICAgICAgIC00OiBGcmVxdWVuY3kgbWVhc3VyZW1lbnQgbG9naWMgbm90IGluaXRpYWxpc2VkLiAgICAgICB8Ci0JICAgfCAgICAgICAgICAgICAgICAgICAgICBTZWUgZnVuY3Rpb24gImlfQVBDSTE3MTBfSW5pdEZyZXF1ZW5jeU1lYXN1cmVtZW50IiB8Ci0JICAgKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0JICovCi1zdGF0aWMgaW50IGlfQVBDSTE3MTBfUmVhZEZyZXF1ZW5jeU1lYXN1cmVtZW50KHN0cnVjdCBjb21lZGlfZGV2aWNlICpkZXYsCi0JCQkJCSAgICAgICB1bnNpZ25lZCBjaGFyIGJfTW9kdWxOYnIsCi0JCQkJCSAgICAgICB1bnNpZ25lZCBjaGFyICpwYl9TdGF0dXMsCi0JCQkJCSAgICAgICB1bnNpZ25lZCBjaGFyICpwYl9VRFN0YXR1cywKLQkJCQkJICAgICAgIHVuc2lnbmVkIGludCAqcHVsX1JlYWRWYWx1ZSkKLXsKLQlzdHJ1Y3QgYWRkaV9wcml2YXRlICpkZXZwcml2ID0gZGV2LT5wcml2YXRlOwotCWludCBpX1JldHVyblZhbHVlID0gMDsKLQl1bnNpZ25lZCBpbnQgdWlfMTZCaXRWYWx1ZTsKLQl1bnNpZ25lZCBpbnQgZHdfU3RhdHVzUmVnOwotCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCS8qIFRlc3QgdGhlIG1vZHVsZSBudW1iZXIgKi8KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQlpZiAoYl9Nb2R1bE5iciA8IDQpIHsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJLyogVGVzdCBpZiBjb3VudGVyIGluaXRpYWxpc2VkICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJaWYgKGRldnByaXYtPgotCQkJc19Nb2R1bGVJbmZvW2JfTW9kdWxOYnJdLgotCQkJc19TaWVtZW5zQ291bnRlckluZm8uc19Jbml0RmxhZy5iX0NvdW50ZXJJbml0ID09IDEpIHsKLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkvKiBUZXN0IGlmIGZyZXF1ZW5jeSBtZWFzdXJlbWVudCBpbml0aWFsaXNlZCAqLwotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJaWYgKGRldnByaXYtPgotCQkJCXNfTW9kdWxlSW5mb1tiX01vZHVsTmJyXS4KLQkJCQlzX1NpZW1lbnNDb3VudGVySW5mby4KLQkJCQlzX0luaXRGbGFnLmJfRnJlcXVlbmN5TWVhc3VyZW1lbnRJbml0ID09IDEp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tLS0tLS0tLS0tLS0tLS0tLSsKLSAgfCBUZWwgOiArNDkgKDApIDcyMjMvOTQ5My0wICAgICB8IGVtYWlsICAgIDogaW5mb0BhZGRpLWRhdGEuY29tICAgICAgICAgfAotICB8IEZheCA6ICs0OSAoMCkgNzIyMy85NDkzLTkyICAgIHwgSW50ZXJuZXQgOiBodHRwOi8vd3d3LmFkZGktZGF0YS5jb20gICB8Ci0gICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSAgfCBQcm9qZWN0ICAgICA6IEFQSSBBUENJMTcxMCAgICB8IENvbXBpbGVyIDogZ2NjICAgICAgICAgICAgICAgICAgICAgICAgfAotICB8IE1vZHVsZSBuYW1lIDogSW5wX0NQVC5DICAgICAgIHwgVmVyc2lvbiAgOiAyLjk2ICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSAgfCBQcm9qZWN0IG1hbmFnZXI6IEVyaWMgU3RvbHogICB8IERhdGUgICAgIDogIDAyLzEyLzIwMDIgICAgICAgICAgICAgICAgfAotICArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0gIHwgRGVzY3JpcHRpb24gOiAgIEFQQ0ktMTcxMCBwdWxzZSBlbmNvZGVyIG1vZHVsZSAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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MF9DT05USU5VT1VTCQkxCi0KLSNkZWZpbmUgQVBDSTE3MTBfUFVMU0VFTkNPREVSX1JFQUQJMAotI2RlZmluZSBBUENJMTcxMF9QVUxTRUVOQ09ERVJfV1JJVEUJMQotCi0vKgotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IEZ1bmN0aW9uIE5hbWUgICAgIDogX0lOVF8gaV9BUENJMTcxMF9Jbml0UHVsc2VFbmNvZGVyICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHVuc2lnbmVkIGNoYXJfICAgICAgICAgIGJfQm9hcmRIYW5kbGUsICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICAgICAgICAgYl9Nb2R1bE5iciwgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgICAgICAgICBiX1B1bHNlRW5jb2Rlck5iciwgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgICAgICAgIGJfSW5wdXRMZXZlbFNlbGVjdGlvbiwgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICAgICAgICAgYl9UcmlnZ2VyT3V0cHV0QWN0aW9uLCAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBVTE9OR18gICAgICAgIHVsX1N0YXJ0VmFsdWUpICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBUYXNrICAgICAgICAgICAgICA6IENvbmZpZ3VyZSB0aGUgcHVsc2UgZW5jb2RlciBvcGVyYXRpbmcgbW9kZSBzZWxlY3RlZCB2aWF8Ci18ICAgICAgICAgICAgICAgICAgICAgYl9Nb2R1bE5iciBhbmQgYl9QdWxzZUVuY29kZXJOYnIuIFRoZSBwdWxzZSBlbmNvZGVyICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBhZnRlciBlYWNoIHB1bHNlIGRlY3JlbWVudCB0aGUgY291bnRlciB2YWx1ZSBmcm9tIDEuICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgWW91IG11c3QgY2FsbGluZyB0aGlzIGZ1bmN0aW9uIGJlIGZvciB5b3UgY2FsbCBhbnkgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBvdGhlciBmdW5jdGlvbiB3aXRjaCBhY2Nlc3Mgb2YgcHVsc2UgZW5jb2RlcnMuICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IElucHV0IFBhcmFtZXRlcnMgIDogdW5zaWduZWQgY2hhcl8gYl9Cb2FyZEhhbmRsZSAgICAgICAgIDogSGFuZGxlIG9mIGJvYXJkIEFQQ0ktMTcxMHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyBiX01vZHVsTmJyICAgICAgICAgICAgOiBNb2R1bGUgbnVtYmVyIHRvICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZ3VyZSAoMCB0byAzKSAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gYl9QdWxzZUVuY29kZXJOYnIgICAgIDogUHVsc2UgZW5jb2RlciBzZWxlY3Rpb24gIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMCB0byAzKSAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfSW5wdXRMZXZlbFNlbGVjdGlvbiA6IElucHV0IGxldmVsIHNlbGVjdGlvbiAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDAgb3IgMSkgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCA6IFNldCBwdWxzZSBlbmNvZGVyfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY291bnQgdGhlIHRoZSBsb3d8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXZlbCBwdWxzZS4gICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSA6IFNldCBwdWxzZSBlbmNvZGVyfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY291bnQgdGhlIHRoZSAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoaWdoIGxldmVsIHB1bHNlLnwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyBiX1RyaWdnZXJPdXRwdXRBY3Rpb24gOiBEaWdpdGFsIFRSSUdHRVIgb3V0cHV0ICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGlvbiAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgOiBObyBhY3Rpb24gICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSA6IFNldCB0aGUgdHJpZ2dlciAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0cHV0IHRvICIxIiAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaGlnaCkgYWZ0ZXIgdGhlIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhc3NhZ2UgZnJvbSAxIHRvfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCBmcm9tIHB1bHNlICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbmNvZGVyLiAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMiA6IFNldCB0aGUgdHJpZ2dlciAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0cHV0IHRvICIwIiAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobG93KSBhZnRlciB0aGUgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhc3NhZ2UgZnJvbSAxIHRvfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCBmcm9tIHB1bHNlICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbmNvZGVyICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBVTE9OR18gdWxfU3RhcnRWYWx1ZSAgICAgICAgOiBQdWxzZSBlbmNvZGVyIHN0YXJ0IHZhbHVlfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgxIHRvIDQyOTQ5NjcyOTUpCi0JYl9Nb2R1bE5icgkJCQk9KHVuc2lnbmVkIGNoYXIpIENSX0FSRUYoaW5zbi0+Y2hhbnNwZWMpOwotCWJfUHVsc2VFbmNvZGVyTmJyCQk9KHVuc2lnbmVkIGNoYXIpIGRhdGFbMF07Ci0JYl9JbnB1dExldmVsU2VsZWN0aW9uCT0odW5zaWduZWQgY2hhcikgZGF0YVsxXTsKLQliX1RyaWdnZXJPdXRwdXRBY3Rpb24JPSh1bnNpZ25lZCBjaGFyKSBkYXRhWzJdOwotCXVsX1N0YXJ0VmFsdWUJCQk9KHVuc2lnbmVkIGludCkgZGF0YVszXTsKLSAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgT3V0cHV0IFBhcmFtZXRlcnMgOiAtICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFJldHVybiBWYWx1ZSAgICAgIDogMDogTm8gZXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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NzEwX1BVTFNFX0VOQ09ERVIpIHsKLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogVGVzdCB0aGUgc2VsZWN0ZWQgcHVsc2UgZW5jb2RlciBudW1iZXIgKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQlpZiAoYl9QdWxzZUVuY29kZXJOYnIgPD0gMykgewotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkvKiBUZXN0IHRoZSBpbnB1dCBsZXZlbCAqLwotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCWlmICgoYl9JbnB1dExldmVsU2VsZWN0aW9uID09IDApCi0JCQkJCXx8IChiX0lucHV0TGV2ZWxTZWxlY3Rpb24gPT0gMSkpIHsKLQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkvKiBUZXN0IHRoZSBvdXB1dCBUUklHR0VSIGFjdGlvbiBzZWxlY3Rpb24gKi8KLQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCWlmICgoYl9UcmlnZ2VyT3V0cHV0QWN0aW9uIDw9IDIpCi0JCQkJCQl8fCAoYl9QdWxzZUVuY29kZXJOYnIgPiAwKSkgewotCQkJCQkJaWYgKHVsX1N0YXJ0VmFsdWUgPiAxKSB7Ci0KLQkJCQkJCQlkd19JbnRSZWdpc3RlciA9Ci0JCQkJCQkJCWlubChkZXZwcml2LT4KLQkJCQkJCQkJc19Cb2FyZEluZm9zLgotCQkJCQkJCQl1aV9BZGRyZXNzICsKLQkJCQkJCQkJMjAgKwotCQkJCQkJCQkoNjQgKiBiX01vZHVsTmJyKSk7Ci0KLQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJCS8qIFNldCB0aGUgc3RhcnQgdm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Ki8KLQkJCQkJCS8qIERpZ2l0YWwgVFJJR0dFUiBvdXRwdXQgYWN0aW9uIHNlbGVjdGlvbiBpcyB3cm9uZyAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJCURQUklOVEsoIkRpZ2l0YWwgVFJJR0dFUiBvdXRwdXQgYWN0aW9uIHNlbGVjdGlvbiBpcyB3cm9uZ1xuIik7Ci0JCQkJCQlpX1JldHVyblZhbHVlID0gLTU7Ci0JCQkJCX0KLQkJCQl9IGVsc2UgewotCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCS8qIElucHV0IGxldmVsIHNlbGVjdGlvbiBpcyB3cm9uZyAqLwotCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJRFBSSU5USygiSW5wdXQgbGV2ZWwgc2VsZWN0aW9uIGlzIHdyb25nXG4iKTsKLQkJCQkJaV9SZXR1cm5WYWx1ZSA9IC00OwotCQkJCX0KLQkJCX0gZWxzZSB7Ci0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCS8qIFB1bHNlIGVuY29kZXIgc2VsZWN0aW9uIGlzIHdyb25nICovCi0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJRFBSSU5USygiUHVsc2UgZW5jb2RlciBzZWxlY3Rpb24gaXMgd3JvbmdcbiIpOwotCQkJCWlfUmV0dXJuVmFsdWUgPSAtMzsKLQkJCX0KLQkJfSBlbHNlIHsKLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkvKiBUaGUgbW9kdWxlIGlzIG5vdCBhIHB1bHNlIGVuY29kZXIgbW9kdWxlICovCi0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQlEUFJJTlRLKCJUaGUgbW9kdWxlIGlzIG5vdCBhIHB1bHNlIGVuY29kZXIgbW9kdWxlXG4iKTsKLQkJCWlfUmV0dXJuVmFsdWUgPSAtMjsKLQkJfQotCX0gZWxzZSB7Ci0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkvKiBUaGUgbW9kdWxlIGlzIG5vdCBhIHB1bHNlIGVuY29kZXIgbW9kdWxlICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCURQUklOVEsoIlRoZSBtb2R1bGUgaXMgbm90IGEgcHVsc2UgZW5jb2RlciBtb2R1bGVcbiIpOwotCQlpX1JldHVyblZhbHVlID0gLTI7Ci0JfQotCi0JcmV0dXJuIGlfUmV0dXJuVmFsdWU7Ci19Ci0KLS8qCi0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgRnVuY3Rpb24gTmFtZSAgICAgOiBfSU5UXyBpX0FQQ0kxNzEwX0VuYWJsZVB1bHNlRW5jb2RlciAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCBjaGFyXyAgYl9Cb2FyZEhhbmRsZSwgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICBiX01vZHVsTmJyLCAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gIGJfUHVsc2VFbmNvZGVyTmJyLCAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnN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ICAgOiBIYW5kbGUgb2YgYm9hcmQgQVBDSS0xNzEwfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgYl9Nb2R1bE5iciAgICAgICAgICA6IE1vZHVsZSBudW1iZXIgdG8gICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlndXJlICgwIHRvIDMpICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgIGJfUHVsc2VFbmNvZGVyTmJyICAgOiBQdWxzZSBlbmNvZGVyIHNlbGVjdGlvbiAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgwIHRvIDMpICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICBiX0N5Y2xlU2VsZWN0aW9uICAgIDogQVBDSTE3MTBfQ09OVElOVU9VUzogICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRWFjaCB0aW1lIHRoZSAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb3VudGluZyB2YWx1ZSBpcyBzZXR8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uICIwIiwgdGhlIHB1bHNlICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW5jb2RlciBsb2FkIHRoZSAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydCB2YWx1ZSBhZnRlciAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBuZXh0IHB1bHNlLiAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBUENJMTcxMF9TSU5HTEU6ICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJZiB0aGUgY291bnRlciBpcyBzZXR8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uICIwIiwgdGhlIHB1bHNlICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW5jb2RlciBpcyBzdG9wcGVkLiAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgYl9JbnRlcnJ1cHRIYW5kbGluZyA6IEludGVycnVwdHMgY2FuIGJlICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2VuZXJhdGVkLCB3aGVuIHRoZSBwdWxzZXwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbmNvZGVyIGhhcyBydW4gZG93bi4gICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdpdGggdGhpcyBwYXJhbWV0ZXIgdGhlICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXNlciBkZWNpZGVzIGlmICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRlcnJ1cHRzIGFyZSB1c2VkIG9yICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vdC4gICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBUENJMTcxMF9FTkFCTEU6ICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludGVycnVwdHMgYXJlIGVuYWJsZWQgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQVBDSTE3MTBfRElTQUJMRTogICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnRlcnJ1cHRzIGFyZSBkaXNhYmxlZAotCi0JYl9Nb2R1bE5icgkJCT0odW5zaWduZWQgY2hhcikgQ1JfQVJFRihpbnNuLT5jaGFuc3BlYyk7Ci0JYl9BY3Rpb24JCQk9KHVuc2lnbmVkIGNoYXIpIGRhdGFbMF07Ci0JYl9QdWxzZUVuY29kZXJOYnIJPSh1bnNpZ25lZCBjaGFyKSBkYXRhWzFdOwotCWJfQ3ljbGVTZWxlY3Rpb24JPSh1bnNpZ25lZCBjaGFyKSBkYXRhWzJdOwotCWJfSW50ZXJydXB0SGFuZGxpbmcJPSh1bnNpZ25lZCBjaGFyKSBkYXRhWzNdO3wKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBPdXRwdXQgUGFyYW1ldGVycyA6IC0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgUmV0dXJuIFZhbHVlICAgICAgOiAgMDogTm8gZXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0xOiBUaGUgaGFuZGxlIHBhcmFtZXRlciBvZiB0aGUgYm9hcmQgaXMgd3JvbmcgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTI6IE1vZHVsZSBzZWxlY3Rpb24gaXMgd3JvbmcgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMzogUHVsc2UgZW5jb2RlciBzZWxlY3Rpb24gaXMgd3JvbmcgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC00OiBQdWxzZSBlbmNvZGVyIG5vdCBpbml0aWFsaXNlZC4gICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgIFNlZSBmdW5jdGlvbiAiaV9BUENJMTcxMF9Jbml0UHVsc2VFbmNvZGVyIiAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtNTogQ3ljbGUgc2VsZWN0aW9uIG1vZGUgaXMgd3JvbmcgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC02OiBJbnRlcnJ1cHQgaGFuZGxpbmcgbW9kZSBpcyB3cm9uZyAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTc6IEludGVycnVwdCByb3V0aW5lIG5vdCBpbnN0YWxsZWQuICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgU2VlIGZ1bmN0aW9uICJpX0FQQ0kxNzEwX1NldEJvYXJkSW50Um91dGluZVgiICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0qLwotCi1zdGF0aWMgaW50IGlfQVBDSTE3MTBfSW5zbldyaXRlRW5hYmxlRGlzYWJsZVB1bHNlR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qKioqKioqKioqKioqKioqKiovCi0JCS8qIFRlc3QgdGhlIHNlbGVjdGVkIHB1bHNlIGVuY29kZXIgbnVtYmVyICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQlpZiAoYl9QdWxzZUVuY29kZXJOYnIgPD0gMykgewotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogVGVzdCBpZiBwdWxzZSBlbmNvZGVyIGluaXRpYWxpc2VkICovCi0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCWlmIChkZXZwcml2LT5zX01vZHVsZUluZm9bYl9Nb2R1bE5icl0uCi0JCQkJc19QdWxzZUVuY29kZXJNb2R1bGVJbmZvLgotCQkJCXNfUHVsc2VFbmNvZGVySW5mb1tiX1B1bHNlRW5jb2Rlck5icl0uCi0JCQkJYl9QdWxzZUVuY29kZXJJbml0ID09IDEpIHsKLQkJCQlzd2l0Y2ggKGJfQWN0aW9uKSB7Ci0KLQkJCQljYXNlIEFQQ0kxNzEwX0VOQUJMRToKLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkvKiBUZXN0IHRoZSBjeWNsZSBzZWxlY3Rpb24gKi8KLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCWlmIChiX0N5Y2xlU2VsZWN0aW9uID09Ci0JCQkJCQlBUENJMTcxMF9DT05USU5VT1VTCi0JCQkJCQl8fCBiX0N5Y2xlU2VsZWN0aW9uID09Ci0JCQkJCQlBUENJMTcxMF9TSU5HTEUpIHsKLQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJLyogVGVzdCB0aGUgaW50ZXJydXB0IGhhbmRsaW5nICovCi0JCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQkJaWYgKGJfSW50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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBGdW5jdGlvbiBOYW1lICAgICA6IF9JTlRfIGlfQVBDSTE3MTBfUmVhZFB1bHNlRW5jb2RlclN0YXR1cyAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHVuc2lnbmVkIGNoYXJfICBiX0JvYXJkSGFuZGxlLCAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gIGJfTW9kdWxOYnIsICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgYl9QdWxzZUVuY29kZXJOYnIsICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXIgKl8gcGJfU3RhdHVzKSAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgVGFzayAgICBBUENJMTcxMF9QVUxTRUVOQ09ERVJfUkVBRCAgICAgICAgICA6IFJlYWRzIHRoZSBwdWxzZSBlbmNvZGVyIHN0YXR1cwotCQkJCQkJCQkJCQlhbmQgdmFsdWVmcm9tIHNlbGVjdGVkIHB1bHNlICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgZW5jb2RlciAoYl9QdWxzZUVuY29kZXJOYnIpIGZyb20gc2VsZWN0ZWQgbW9kdWxlICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAoYl9Nb2R1bE5icikuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgf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AgICAgICAgKDAgdG8gMykKLSAgIEFQQ0kxNzEwX1BVTFNFRU5DT0RFUl9XUklURQotCQkJCWRhdGFbMl0JCVVMT05HXyB1bF9Xcml0ZVZhbHVlICAgICAgICA6IDMyLWJpdCB2YWx1ZSB0byBiZSAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3JpdHRlbiAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgT3V0cHV0IFBhcmFtZXRlcnMgOiB1bnNpZ25lZCBjaGFyICpfIHBiX1N0YXR1cyAgICAgICAgICAgIDogUHVsc2UgZW5jb2RlciBzdGF0dXMuICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCA6IE5vIG92ZXJmbG93IG9jY3VyfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxIDogT3ZlcmZsb3cgb2NjdXIKLQkJCQkJCVBVTE9OR18gcHVsX1JlYWRWYWx1ZSAgICAgICA6IFB1bHNlIGVuY29kZXIgdmFsdWUgICAgICB8ICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgUmV0dXJuIFZhbHVlICAgICAgOiAgMDogTm8gZXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0xOiBUaGUgaGFuZGxlIHBhcmFtZXRlciBvZiB0aGUgYm9hcmQgaXMgd3JvbmcgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLT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V3JpdGUgdGhlIHZhbHVlICovCi0JCQkvKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQlvdXRsKHVsX1dyaXRlVmFsdWUsCi0JCQkJCQlkZXZwcml2LT5zX0JvYXJkSW5mb3MuCi0JCQkJCQl1aV9BZGRyZXNzICsKLQkJCQkJCSg0ICogYl9QdWxzZUVuY29kZXJOYnIpICsKLQkJCQkJCSg2NCAqIGJfTW9kdWxOYnIpKTsKLQotCQkJCX0JLyogZW5kIG9mIHN3aXRjaCAqLwotCQkJfSBlbHNlIHsKLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogUHVsc2UgZW5jb2RlciBub3QgaW5pdGlhbGlzZWQgKi8KLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQlEUFJJTlRLKCJQdWxzZSBlbmNvZGVyIG5vdCBpbml0aWFsaXNlZFxuIik7Ci0JCQkJaV9SZXR1cm5WYWx1ZSA9IC00OwotCQkJfQotCQl9IGVsc2UgewotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkvKiBQdWxzZSBlbmNvZGVyIHNlbGVjdGlvbiBpcyB3cm9uZyAqLwotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCURQUklOVEsoIlB1bHNlIGVuY29kZXIgc2VsZWN0aW9uIGlzIHdyb25nXG4iKTsKLQkJCWlfUmV0dXJuVmFsdWUgPSAtMzsKLQkJfQotCX0gZWxzZSB7Ci0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkvKiBNb2R1bGUgc2VsZWN0aW9uIGlzIHdyb25nICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCURQUklOVEsoIk1vZHVsZSBzZWxlY3Rpb24gaXMgd3JvbmdcbiIpOwotCQlpX1JldHVyblZhbHVlID0gLTI7Ci0J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LS0tLS0rCi0gIHwgUHJvamVjdCAgICAgOiBBUEkgQVBDSTE3MTAgICAgfCBDb21waWxlciA6IGdjYyAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgfCBNb2R1bGUgbmFtZSA6IFBXTS5DICAgICAgICAgICB8IFZlcnNpb24gIDogMi45NiAgICAgICAgICAgICAgICAgICAgICAgfAotICArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0gIHwgUHJvamVjdCBtYW5hZ2VyOiBFcmljIFN0b2x6ICAgfCBEYXRlICAgICA6ICAwMi8xMi8yMDAyICAgICAgICAgICAgICAgIHwKLSAgKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotICB8IERlc2NyaXB0aW9uIDogICBBUENJLTE3MTAgV3Vsc2Ugd2lkZSBtb2R1bGF0aW9uIG1vZHVsZSAgICAgICAgICAgICAgICB8Ci0gIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0gIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVQREFURVMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotICB8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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodW5zaWduZWQgY2hhcl8gICAgIGJfQm9hcmRIYW5kbGUsICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgICAgYl9Nb2R1bE5iciwgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgICBiX1BXTSwgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICAgIGJfQ2xvY2tTZWxlY3Rpb24sICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgICAgYl9UaW1pbmdVbml0LCAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVMT05HXyAgIHVsX0xvd1RpbWluZywgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVUxPTkdfICAgdWxfSGlnaFRpbWluZywgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQVUxPTkdfIHB1bF9SZWFsTG93VGltaW5nLCAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBVTE9OR18gcHVsX1JlYWxIaWdoVGltaW5nKSAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBUYXNrICAgICAgICAgICAgICA6IENvbmZpZ3VyZSB0aGUgc2VsZWN0ZWQgUFdNIChiX1BXTSkgZnJvbSBzZWxlY3RlZCBtb2R1bGV8Ci18ICAgICAgICAgICAgICAgICAgICAgKGJfTW9kdWxOYnIpLiBUaGUgdWxfTG93VGltaW5nLCB1bF9IaWdoVGltaW5nIGFuZCAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bF9UaW1pbmdVbml0IGRldGVybWluZSB0aGUgbG93L2hpZ2ggdGltaW5nIGJhc2UgZm9yICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHRoZSBwZXJpb2QuIHB1bF9SZWFsTG93VGltaW5nLCBwdWxfUmVhbEhpZ2hUaW1pbmcgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoZSByZWFsIHRpbWluZyB2YWx1ZS4gICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBZb3UgbXVzdCBjYWxsaW5nIHRoaXMgZnVuY3Rpb24gYmUgZm9yIHlvdSBjYWxsIGFueSAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIG90aGVyIGZ1bmN0aW9uIHdpdGNoIGFjY2VzcyBvZiB0aGUgUFdNLiAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgSW5wdXQgUGFyYW1ldGVycyAgOiB1bnNpZ25lZCBjaGFyXyAgICAgYl9Cb2FyZEhhbmRsZSAgICA6IEhhbmRsZSBvZiBib2FyZCBBUENJLTE3MTAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgICBiX01vZHVsTmJyICAgICAgIDogTW9kdWxlIG51bWJlciB0byBjb25maWd1cmV8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMCB0byAzKSAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgICAgYl9QV00gICAgICAgICAgICA6IFNlbGVjdGVkIFBXTSAoMCBvciAxKS4gICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgICBiX0Nsb2NrU2VsZWN0aW9uIDogU2VsZWN0aW9uIGZyb20gUENJIGJ1cyAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbG9jayAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIEFQQ0kxNzEwXzMwTUhaIDogICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGhlIFBDIGhhdmUgYSAzMCBNSHogICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQQ0kgYnVzIGNsb2NrICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIEFQQ0kxNzEwXzMzTUhaIDogICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGhlIFBDIGhhdmUgYSAzMyBNSHogICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQQ0kgYnVzIGNsb2NrICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIEFQQ0kxNzEwXzQwTUhaICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGhlIEFQQ0ktMTcxMCBoYXZlIGEgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRlZ3JhdGVkIDQwTWh6ICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHF1YXJ0ei4gICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgICBiX1RpbWluZ1VuaXQgICAgIDogQmFzZSB0aW1pbmcgVW5pdCAoMCB0byA0KSB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgOiBucyAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSA6IMOmcyAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMiA6IG1zICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzIDogcyAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQgOiBtbiAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBVTE9OR18gICAgdWxfTG93VGltaW5nICAgICA6IExvdyBiYXNlIHRpbWluZyB2YWx1ZS4gICAgfAotfCAgICAgICAgICAgICAgICAgICAgIFVMT05HXyAgICB1bF9IaWdoVGltaW5nICAgIDogSGlnaCBiYXNlIHRpbWluZyB2YWx1ZS4gICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgT3V0cHV0IFBhcmFtZXRlcnMgOiBQVUxPTkdfICBwdWxfUmVhbExvd1RpbWluZyAgOiBSZWFsIGxvdyBiYXNlIHRpbWluZyAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlLiAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgUFVMT05HXyAgcHVsX1JlYWxIaWdoVGltaW5nIDogUmVhbCBoaWdoIGJhc2UgdGltaW5nICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZS4gICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFJldHVybiBWYWx1ZSAgICAgIDogMDogTm8gZXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC0xOiBUaGUgaGFuZGxlIHBhcmFtZXRlciBvZiB0aGUgYm9hcmQgaXMgd3JvbmcgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTI6IE1vZHVsZSBzZWxlY3Rpb24gd3JvbmcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtMzogVGhlIG1vZHVsZSBpcyBub3QgYSBQV00gbW9kdWxlICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC00OiBQV00gc2VsZWN0aW9uIGlzIHdyb25nICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTU6IFRoZSBzZWxlY3RlZCBpbnB1dCBjbG9jayBpcyB3cm9uZyAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtNjogVGltaW5nIFVuaXQgc2VsZWN0aW9uIGlzIHdyb25nICAgICAgICAgICAgICAgICAgICAgIH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VlID0gMDsKLQl1bnNpZ25lZCBpbnQgdWxfTG93VGltZXJWYWx1ZSA9IDA7Ci0JdW5zaWduZWQgaW50IHVsX0hpZ2hUaW1lclZhbHVlID0gMDsKLQl1bnNpZ25lZCBpbnQgZHdfQ29tbWFuZDsKLQlkb3VibGUgZF9SZWFsTG93VGltaW5nID0gMDsKLQlkb3VibGUgZF9SZWFsSGlnaFRpbWluZyA9IDA7Ci0KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JLyogVGVzdCB0aGUgbW9kdWxlIG51bWJlciAqLwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCWlmIChiX01vZHVsTmJyIDwgNCkgewotCQkvKioqKioqKioqKioqKioqLwotCQkvKiBUZXN0IGlmIFBXTSAqLwotCQkvKioqKioqKioqKioqKioqLwotCi0JCWlmICgoZGV2cHJpdi0+c19Cb2FyZEluZm9zLgotCQkJCWR3X01vbGR1bGVDb25maWd1cmF0aW9uW2JfTW9kdWxOYnJdICYKLQkJCQkweEZGRkYwMDAwVUwpID09IEFQQ0kxNzEwX1BXTSkgewotCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogVGVzdCB0aGUgUFdNIHNlbGVjdGlvbiAqLwotCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQlpZiAoYl9QV00gPD0gMSkgewotCQkJCS8qKioqKioqKioqKioqKioqKiovCi0JCQkJLyogVGVzdCB0aGUgY2xvY2sgKi8KLQkJCQkvKioqKioqKioqKioqKioqKioqLwotCi0JCQkJaWYgKChiX0Nsb2NrU2VsZWN0aW9uID09IEFQQ0kxNzEwXzMwTUhaKSB8fAotCQkJCQkoYl9DbG9ja1NlbGVjdGlvbiA9PSBBUENJMTcxMF8zM01IWikgfHwKLQkJCQkJKGJfQ2xvY2tTZWxlY3Rpb24gPT0gQVBDSTE3MTBfNDBNSFopKSB7Ci0JCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQ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ICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHVuc2lnbmVkIGNoYXJfICAgICBiX0JvYXJkSGFuZGxlLCAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICAgIGJfTW9kdWxOYnIsICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgICAgYl9QV00sICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXIgKl8gICBwYl9UaW1pbmdVbml0LCAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBVTE9OR18gcHVsX0xvd1RpbWluZywgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUFVMT05HXyBwdWxfSGlnaFRpbWluZywgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyICpfICAgcGJfU3RhcnRMZXZlbCwgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyICpfICAgcGJfU3RvcE1vZGUsICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyICpfICAgcGJfU3RvcExldmVsLCAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyICpfICAgcGJfRXh0ZXJuR2F0ZSwgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyICpfICAgcGJfSW50ZXJydXB0RW5hYmxlLCAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyICpfICAgcGJfRW5hYmxlKSAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFRhc2sgICAgICAgICAgICAgIDogUmV0dXJuIHRoZSBQV00gKGJfUFdNKSBpbml0aWFsaXNhdGlvbiBmcm9tIHNlbGVjdGVkICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBtb2R1bGUgKGJfTW9kdWxOYnIpLiBZb3UgbXVzdCBjYWxsaW5nIHRoZSAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICJpX0FQQ0kxNzEwX0luaXRQV00iIGZ1bmN0aW9uIGJlIGZvciB5b3UgY2FsbCB0aGlzICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBJbnB1dCBQYXJhbWV0ZXJzICA6IHVuc2lnbmVkIGNoYXJfIGJfQm9hcmRIYW5kbGUgOiBIYW5kbGUgb2YgYm9hcmQgQVBDSS0xNzEwICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gYl9Nb2R1bE5iciAgICA6IFNlbGVjdGVkIG1vZHVsZSBudW1iZXIgKDAgdG8gMykgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyBiX1BXTSAgICAgICAgIDogU2VsZWN0ZWQgUFdNICgwIG9yIDEpICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IE91dHB1dCBQYXJhbWV0ZXJzIDogdW5zaWduZWQgY2hhciAqXyAgcGJfVGltaW5nVW5pdCAgICAgIDogQmFzZSB0aW1pbmcgVW5pdCAoMCB0byA0KSB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgOiBucyAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSA6IMOmcyAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMiA6IG1zICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzIDogcyAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQgOiBtbiAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBQVUxPTkdfIHB1bF9Mb3dUaW1pbmcgICAgICA6IExvdyBiYXNlIHRpbWluZyB2YWx1ZS4gICAgfAotfCAgICAgICAgICAgICAgICAgICAgIFBVTE9OR18gcHVsX0hpZ2hUaW1pbmcgICAgIDogSGlnaCBiYXNlIHRpbWluZyB2YWx1ZS4gICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhciAqXyAgcGJfU3RhcnRMZXZlbCAgICAgIDogU3RhcnQgcGVyaW9kIGxldmVsICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxlY3Rpb24gICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCA6IFRoZSBwZXJpb2Qgc3RhcnQgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2l0aCBhIGxvdyBsZXZlbCB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgOiBUaGUgcGVyaW9kIHN0YXJ0IHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGggYSBoaWdoIGxldmVsfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXIgKl8gIHBiX1N0b3BNb2RlICAgICAgICA6IFN0b3AgbW9kZSBzZWxlY3Rpb24gICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCA6IFRoZSBQV00gaXMgc3RvcHBlZCAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlyZWN0bHkgYWZ0ZXIgdGhlICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJpX0FQQ0kxNzEwX0Rpc2FibGVQV00ifAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGFuZCBicmVhayB0aGV8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGFzdCBwZXJpb2QgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgOiBBZnRlciB0aGUgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImlfQVBDSTE3MTBfRGlzYWJsZVBXTSJ8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gdGhlIFBXTSBpcyAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9wcGVkIGF0IHRoZSBlbmQgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyb20gbGFzdCBwZXJpb2QgY3ljbGV8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhciAqXyAgcGJfU3RvcExldmVsICAgICAgICA6IFN0b3AgUFdNIGxldmVsIHNlbGVjdGlvbiB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgOiBUaGUgb3V0cHV0IHNpZ25hbCAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtlZXAgdGhlIGxldmVsIGFmdGVyfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiaV9BUENJMTcxMF9EaXNhYmxlUFdNInwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxIDogVGhlIG91dHB1dCBzaWduYWwgaXN8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXQgdG8gbG93IGFmdGVyIHRoZXwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJpX0FQQ0kxNzEwX0Rpc2FibGVQV00ifAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIgOiBUaGUgb3V0cHV0IHNpZ25hbCBpc3wKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldCB0byBoaWdoIGFmdGVyICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiaV9BUENJMTcxMF9EaXNhYmxlUFdNInwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXIgKl8gIHBiX0V4dGVybkdhdGUgICAgICA6IEV4dGVybiBnYXRlIGFjdGlvbiAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZWN0aW9uICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCA6IEV4dGVybiBnYXRlIHNpZ25hbCAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm90IHVzZWQuICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgOiBFeHRlcm4gZ2F0ZSBzaWduYWwgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVzZWQuICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyICpfICBwYl9JbnRlcnJ1cHRFbmFibGUgOiBFbmFibGUgb3IgZGlzYWJsZSB0aGUgUFdNIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludGVycnVwdC4gICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBBUENJMTcxMF9FTkFCTEUgOiAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVuYWJsZSB0aGUgUFdNIGludGVycnVwdHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQSBpbnRlcnJ1cHQgb2NjdXIgYWZ0ZXIgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlYWNoIHBlcmlvZCAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIEFQQ0kxNzEwX0RJU0FCTEUgOiAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRGlzYWJsZSB0aGUgUFdNICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRlcnJ1cHQgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhciAqXyAgcGJfRW5hYmxlICAgICAgICAgIDogSW5kaWNhdGUgaWYgdGhlIFBXTSBpcyAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbmFibGVkIG9yIG5vICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCA6IFBXTSBub3QgZW5hYmxlZCAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxIDogUFdNIGVuYWJsZWQgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgUmV0dXJuIFZhbHVlICAgICAgOiAgMDogTm8gZXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0xOiBUaGUgaGFuZGxlIHBhcmFtZXRlciBvZiB0aGUgYm9hcmQgaXMgd3JvbmcgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTI6IE1vZHVsZSBzZWxlY3Rpb24gd3JvbmcgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMzogVGhlIG1vZHVsZSBpcyBub3QgYSBQV00gbW9kdWxlICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC00OiBQV00gc2VsZWN0aW9uIGlzIHdyb25nICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTU6IFBXTSBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgImlfQVBDSTE3M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ovCi0KLQlpZiAoYl9Nb2R1bE5iciA8IDQpIHsKLQkJLyoqKioqKioqKioqKioqKi8KLQkJLyogVGVzdCBpZiBQV00gKi8KLQkJLyoqKioqKioqKioqKioqKi8KLQotCQlpZiAoKGRldnByaXYtPnNfQm9hcmRJbmZvcy4KLQkJCQlkd19Nb2xkdWxlQ29uZmlndXJhdGlvbltiX01vZHVsTmJyXSAmCi0JCQkJMHhGRkZGMDAwMFVMKSA9PSBBUENJMTcxMF9QV00pIHsKLQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCS8qIFRlc3QgdGhlIFBXTSBzZWxlY3Rpb24gKi8KLQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJaWYgKGJfUFdNIDw9IDEpIHsKLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCS8qIFRlc3QgaWYgUFdNIGluaXRpYWxpc2VkICovCi0JCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCWR3X1N0YXR1cyA9IGlubChkZXZwcml2LT5zX0JvYXJkSW5mb3MuCi0JCQkJCXVpX0FkZHJlc3MgKyAxMiArICgyMCAqIGJfUFdNKSArCi0JCQkJCSg2NCAqIGJfTW9kdWxOYnIpKTsKLQotCQkJCWlmIChkd19TdGF0dXMgJiAweDEwKSB7Ci0JCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJLyogUmVhZCB0aGUgbG93IHRpbWluZyAqLwotCQkJCQkvKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJKnB1bF9Mb3dUaW1pbmcgPQotCQkJCQkJaW5sKGRldnByaXYtPnNfQm9hcmRJbmZvcy4KLQkJCQkJCXVpX0FkZHJlc3MgKyAwICsgKDIwICogYl9QV00pICsKLQkJCQkJCSg2NCAqIGJfTW9kdWxOYnIpKTsKLQotCQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkvKiBSZWFkI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0JvYXJkSGFuZGxlLCAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gIGJfTW9kdWxOYnIsICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgYl9QV00sICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICBiX1N0YXJ0TGV2ZWwsICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gIGJfU3RvcE1vZGUsICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgYl9TdG9wTGV2ZWwsICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICBiX0V4dGVybkdhdGUsICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gIGJfSW50ZXJydXB0RW5hYmxlKSAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFRhc2sgICAgICAgICAgICAgIDogRW5hYmxlIHRoZSBzZWxlY3RlZCBQV00gKGJfUFdNKSBmcm9tIHNlbGVjdGVkIG1vZHVsZSAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAoYl9Nb2R1bE5icikuIFlvdSBtdXN0IGNhbGxpbmcgdGhlICJpX0FQQ0kxNzEwX0luaXRQV00ifAotfCAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGJlIGZvciB5b3UgY2FsbCB0aGlzIGZ1bmN0aW9uLiAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgSWYgeW91IGVuYWJsZSB0aGUgUFdNIGludGVycnVwdCwgdGhlIFBXTSBnZW5lcmF0ZSBhICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBpbnRlcnJ1cHQgYWZ0ZXIgZWFjaCBwZXJpb2QuICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIFNlZSBmdW5jdGlvbiAiaV9BUENJMTcxMF9TZXRCb2FyZEludFJvdXRpbmVYIiBhbmQgdGhlICB8Ci18ICAgICAgICAgICAgICAgICAgICAgSW50ZXJydXB0IG1hc2sgZGVzY3JpcHRpb24gY2hhcHRlci4gICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBJbnB1dCBQYXJhbWV0ZXJzICA6IHVuc2lnbmVkIGNoYXJfIGJfQm9hcmRIYW5kbGUgICAgIDogSGFuZGxlIG9mIGJvYXJkIEFQQ0ktMTcxMCAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gYl9Nb2R1bE5iciAgICAgICAgOiBTZWxlY3RlZCBtb2R1bGUgbnVtYmVyICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgwIHRvIDMpICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfUFdNICAgICAgICAgICAgIDogU2VsZWN0ZWQgUFdNICgwIG9yIDEpICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gYl9TdGFydExldmVsICAgICAgOiBTdGFydCBwZXJpb2QgbGV2ZWwgc2VsZWN0aW9uIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIDogVGhlIHBlcmlvZCBzdGFydCB3aXRoIGEgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb3cgbGV2ZWwgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSA6IFRoZSBwZXJpb2Qgc3RhcnQgd2l0aCBhIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGlnaCBsZXZlbCAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfU3RvcE1vZGUgICAgICAgIDogU3RvcCBtb2RlIHNlbGVjdGlvbiAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCA6IFRoZSBQV00gaXMgc3RvcHBlZCAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlyZWN0bHkgYWZ0ZXIgdGhlICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiaV9BUENJMTcxMF9EaXNhYmxlUFdNIiB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGFuZCBicmVhayB0aGUgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGFzdCBwZXJpb2QgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgOiBBZnRlciB0aGUgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJpX0FQQ0kxNzEwX0Rpc2FibGVQV00iIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHRoZSBQV00gaXMgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcHBlZCBhdCB0aGUgZW5kIGZyb218Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYXN0IHBlcmlvZCBjeWNsZS4gICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyBiX1N0b3BMZXZlbCAgICAgICA6IFN0b3AgUFdNIGxldmVsIHNlbGVjdGlvbiAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgOiBUaGUgb3V0cHV0IHNpZ25hbCBrZWVwICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBsZXZlbCBhZnRlciB0aGUgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImlfQVBDSTE3MTBfRGlzYWJsZVBXTSIgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSA6IFRoZSBvdXRwdXQgc2lnbmFsIGlzIHNldHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG8gbG93IGFmdGVyIHRoZSAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiaV9BUENJMTcxMF9EaXNhYmxlUFdNIiB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyIDogVGhlIG91dHB1dCBzaWduYWwgaXMgc2V0fAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0byBoaWdoIGFmdGVyIHRoZSAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJpX0FQQ0kxNzEwX0Rpc2FibGVQV00iIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfRXh0ZXJuR2F0ZSAgICAgIDogRXh0ZXJuIGdhdGUgYWN0aW9uIHNlbGVjdGlvbiB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCA6IEV4dGVybiBnYXRlIHNpZ25hbCBub3QgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXNlZC4gICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgOiBFeHRlcm4gZ2F0ZSBzaWduYWwgdXNlZC58Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gYl9JbnRlcnJ1cHRFbmFibGUgOiBFbmFibGUgb3IgZGlzYWJsZSB0aGUgUFdNICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludGVycnVwdC4gICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBBUENJMTcxMF9FTkFCTEUgOiAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVuYWJsZSB0aGUgUFdNIGludGVycnVwdCAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQSBpbnRlcnJ1cHQgb2NjdXIgYWZ0ZXIgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlYWNoIHBlcmlvZCAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIEFQQ0kxNzEwX0RJU0FCTEUgOiAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRGlzYWJsZSB0aGUgUFdNIGludGVycnVwdCAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IE91dHB1dCBQYXJhbWV0ZXJzIDogLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBSZXR1cm4gVmFsdWUgICAgICA6IDA6ICBObyBlcnJvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtMTogIFRoZSBoYW5kbGUgcGFyYW1ldGVyIG9mIHRoZSBib2FyZCBpcyB3cm9uZyAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC0yOiAgTW9kdWxlIHNlbGVjdGlvbiB3cm9uZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTM6ICBUaGUgbW9kdWxlIGlzIG5vdCBhIFBXTSBtb2R1bGUgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtNDogIFBXTSBzZWxlY3Rpb24gaXMgd3JvbmcgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC01OiAgUFdNIG5vdCBpbml0aWFsaXNlZCBzZWUgZnVuY3Rpb24gICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAiaV9BUENJMTcxMF9Jbml0UFdNIiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtNjogIFBXTSBzdGFydCBsZXZlbCBzZWxlY3Rpb24gaXMgd3JvbmcgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC03OiAgUFdNIHN0b3AgbW9kZSBzZWxlY3Rpb24gaXMgd3JvbmcgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTg6ICBQV00gc3RvcCBsZXZlbCBzZWxlY3Rpb24gaXMgd3JvbmcgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtOTogIEV4dGVybiBnYXRlIHNpZ25hbCBzZWxlY3Rpb24gaXMgd3JvbmcgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC0xMDogSW50ZXJydXB0IHBhcmFtZXRlciBpcyB3cm9uZyAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTExOiBJbnRlcnJ1cH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wgNCkgewotCQkvKioqKioqKioqKioqKioqLwotCQkvKiBUZXN0IGlmIFBXTSAqLwotCQkvKioqKioqKioqKioqKioqLwotCi0JCWlmICgoZGV2cHJpdi0+c19Cb2FyZEluZm9zLgotCQkJCWR3X01vbGR1bGVDb25maWd1cmF0aW9uW2JfTW9kdWxOYnJdICYKLQkJCQkweEZGRkYwMDAwVUwpID09IEFQQ0kxNzEwX1BXTSkgewotCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogVGVzdCB0aGUgUFdNIHNlbGVjdGlvbiAqLwotCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQlpZiAoYl9QV00gPD0gMSkgewotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogVGVzdCBpZiBQV00gaW5pdGlhbGlzZWQgKi8KLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJZHdfU3RhdHVzID0gaW5sKGRldnByaXYtPnNfQm9hcmRJbmZvcy4KLQkJCQkJdWlfQWRkcmVzcyArIDEyICsgKDIwICogYl9QV00pICsKLQkJCQkJKDY0ICogYl9Nb2R1bE5icikpOwotCi0JCQkJaWYgKGR3X1N0YXR1cyAmIDB4MTApIHsKLQkJCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCS8qIFRlc3QgdGhlIHN0YXJ0IGxldmVsIHNlbGVjdGlvbiAqLwotCQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQlpZiAoYl9TdGFydExldmVsIDw9IDEpIHsKLQkJCQkJCS8qKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJLyogVGVzdCB0aGUgc3RvcCBtb2RlICovCi0JCQkJCQkvKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQkJaWYgKGJfU3RvcE1vZGUgPD0gMSkgewotCQkJCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCQkvKiBUZXN0IHRoZSBzdG9wIGxldmVsICovCi0JCQkJCQkJLyoqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCQkJaWYgKGJfU3RvcExldmVsIDw9IDIpIHsKLQkJCQkJCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJCQkvKiBUZXN0IHRoZSBleHRlcm4gZ2F0ZSBtb2RlICovCi0JCQkJCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQkJCQlpZiAoYl9FeHRlcm5HYXRlCi0JCQkJCQkJCQk8PSAxKSB7Ci0JCQkJCQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCQkJCQkvKiBUZXN0IHRoZSBpbnRlcnJ1cHQgYWN0aW9uICovCi0JCQkJCQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJCQkJCWlmIChiX0ludGVycnVwdEVuYWJsZSA9PSBBUENJMTcxMF9FTkFCTEUgfHwgYl9JbnRlcnJ1cHRFbmFibGUgPT0gQVBDSTE3MTBfRElTQUJMRSkgewotCQkJCQkJCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCQkJCQkJLyogVGVzdCBpZiBpbnRlcnJ1cHQgZnVuY3Rpb24gaW5pdGlhbGlzZWQgKi8KLQkJCQkJCQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCQkJCQkJLyoqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJCQkJCS8qIFJlYWQgdGhlIGNvbW1hbmQgKi8KLQkJCQkJCQkJCQkvKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJCQkJCQlkd19Db21tYW5kCi0JCQkJCQkJCQkJCT0KLQkJCQkJCQkJCQkJaW5sCi0JCQkJCQkJCQkJCShkZXZwcml2LT4K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CQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCQkvKiBQV00gc3RhcnQgbGV2ZWwgc2VsZWN0aW9uIGlzIHdyb25nICovCi0JCQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCQlEUFJJTlRLKCJQV00gc3RhcnQgbGV2ZWwgc2VsZWN0aW9uIGlzIHdyb25nXG4iKTsKLQkJCQkJCWlfUmV0dXJuVmFsdWUgPSAtNjsKLQkJCQkJfQkvKiAgaWYgKGJfU3RhcnRMZXZlbCA+PSAwICYmIGJfU3RhcnRMZXZlbCA8PSAxKSAqLwotCQkJCX0JLyogIGlmIChkd19TdGF0dXMgJiAweDEwKSAqLwotCQkJCWVsc2UgewotCQkJCQkvKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCS8qIFBXTSBub3QgaW5pdGlhbGlzZWQgKi8KLQkJCQkJLyoqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQlEUFJJTlRLKCJQV00gbm90IGluaXRpYWxpc2VkXG4iKTsKLQkJCQkJaV9SZXR1cm5WYWx1ZSA9IC01OwotCQkJCX0JLyogIGlmIChkd19TdGF0dXMgJiAweDEwKSAqLwotCQkJfQkvKiAgaWYgKGJfUFdNID49IDAgJiYgYl9QV00gPD0gMSkgKi8KLQkJCWVsc2UgewotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogVG9yIFBXTSBzZWxlY3Rpb24gaXMgd3JvbmcgKi8KLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCURQUklOVEsoIlRvciBQV00gc2VsZWN0aW9uIGlzIHdyb25nXG4iKTsKLQkJCQlpX1JldHVyblZhbHVlID0gLTQ7Ci0JCQl9CS8qICBpZiAoYl9QV00gPj0gMCAmJiBiX1BXTSA8PSAxKSAqLwotCQl9IGVsc2UgewotCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKio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gICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBSZXR1cm4gVmFsdWUgICAgICA6ICAwOiBObyBlcnJvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTE6IFRoZSBoYW5kbGUgcGFyYW1ldGVyIG9mIHRoZSBib2FyZCBpcyB3cm9uZyAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMjogTW9kdWxlIHNlbGVjdGlvbiB3cm9uZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0zOiBUaGUgbW9kdWxlIGlzIG5vdCBhIFBXTSBtb2R1bGUgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTQ6IFBXTSBzZWxlY3Rpb24gaXMgd3JvbmcgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtNTogUFdNIG5vdCBpbml0aWFsaXNlZCBzZWUgZnVuY3Rpb24gICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAiaV9BUENJMTcxMF9Jbml0UFdNIiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTY6IFBXTSBub3QgZW5hYmxlZCBzZWUgZnVuY3Rpb24gICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgImlfQVBDSTE3MTBfRW5hYmxlUFdNIiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0qLwotc3RhdGljIGludCBpX0FQQ0kxNzEwX0Rpc2FibGVQV00oc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiwKLQkJCQkgdW5zaWduZWQgY2hhciBiX01vZHVsTmJyLAotCQkJCSB1bnNpZ25lZCBjaGFyIGJfUFdNKQotewotCXN0cnVjdCBhZGRpX3ByaXZhdGUgKmRldnByaXYgPSBkZXYtPnByaXZhdGU7Ci0JaW50IGlfUmV0dXJuVmFsdWUgPSAwOwotCXVuc2lnbmVkIGludCBkd19TdGF0dXM7Ci0KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JLyogVGVzdCB0aGUgbW9kdWxlIG51bWJlciAqLwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCWlmIChiX01vZHVsTmJyIDwgNCkgewotCQkvKioqKioqKioqKioqKioqLwotCQkvKiBUZXN0IGlmIFBXTSAqLwotCQkvKioqKioqKioqKioqKioqLwotCi0JCWlmICgoZGV2cHJpdi0+c19Cb2FyZEluZm9zLgotCQkJCWR3X01vbGR1bGVDb25maWd1cmF0aW9uW2JfTW9kdWxOYnJdICYKLQkJCQkweEZGRkYwMDAwVUwpID09IEFQQ0kxNzEwX1BXTSkgewotCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogVGVzdCB0aGUgUFdNIHNlbGVjdGlvbiAqLwotCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQlpZiAoYl9QV00gPD0gMSkgewotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogVGVzdCBpZiBQV00gaW5pdGlhbGlzZWQgKi8KLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJZHdfU3RhdHVzID0gaW5sKGRldnByaXYtPnNfQm9hcmRJbmZvcy4KLQkJCQkJdWlfQWRkcmVzcyArIDEyICsgKDIwICogYl9QV00pICsKLQkJCQkJKDY0ICogYl9Nb2R1bE5icikpOwotCi0JCQkJaWYgKGR3X1N0YXR1cyAmIDB4MTApIHsKLQkJCQkJLyoqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkvKiBUZXN0IGlmIFBXTSBlbmFibGVkICovCi0JCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQlpZiAoZHdfU3RhdHVzICYgMHgxKSB7Ci0JCQkJCQkvKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCS8qIERpc2FibGUgdGhlIFBXTSAqLwotCQkJCQkJLyoqKioqKioqKioqKioqKioqKiovCi0JCQkJCQlvdXRsKDAsIGRldnByaXYtPnNfQm9hcmRJbmZvcy4KLQkJCQkJCQl1aV9BZGRyZXNzICsgMTIgKwotCQkJCQkJCSgyMCAqIGJfUFdNKSArCi0JCQkJCQkJKDY0ICogYl9Nb2R1bE5icikpOwotCQkJCQl9CS8qICBpZiAoZHdfU3RhdHVzICYgMHgxKSAqLwotCQkJCQllbHNlIHsKLQkJCQkJCS8qKioqKioqKioqKioqKioqKioqLwotCQkJCQkJLyogUFdNIG5vdCBlbmFibGVkICovCi0JCQkJCQkvKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCURQUklOVEsoIlBXTSBub3QgZW5hYmxlZFxuIik7Ci0JCQkJCQlpX1JldHVyblZhbHVlID0gLTY7Ci0JCQkJCX0JLyogIGlmIChkd19TdGF0dXMgJiAweDEpICovCi0JCQkJfQkvKiAgaWYgKGR3X1N0YXR1cyAmIDB4MTApICovCi0JCQkJZWxzZSB7Ci0JCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJLyogUFdNIG5vdCBpbml0aWFsaXNlZCAqLwotCQkJCQkvKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCURQUklOVEsoIiBQV00gbm90IGluaXRpYWxpc2VkXG4iKTsKLQkJCQkJaV9SZXR1cm5WYWx1ZSA9IC01OwotCQkJCX0JLyogIGlmIChkd19TdGF0dXMgJiA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gICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCBjaGFyXyAgICAgYl9Cb2FyZEhhbmRsZSwgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgICBiX01vZHVsTmJyLCAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICAgIGJfUFdNLCAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgICAgYl9DbG9ja1NlbGVjdGlvbiwgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgICBiX1RpbWluZ1VuaXQsICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVUxPTkdfICAgdWxfTG93VGltaW5nLCAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBVTE9OR18gICB1bF9IaWdoVGltaW5nKSAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgVGFzayAgICAgICAgICAgICAgOiBTZXQgYSBuZXcgdGltaW5nLiBUaGUgdWxfTG93VGltaW5nLCB1bF9IaWdoVGltaW5nIGFuZCAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVsX1RpbWluZ1VuaXQgZGV0ZXJtaW5lIHRoZSBsb3cvaGlnaCB0aW1pbmcgYmFzZSBmb3IgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdGhlIHBlcmlvZC4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBJbnB1dCBQYXJhbWV0ZXJzICA6IHVuc2lnbmVkIGNoYXJfICAgICBiX0JvYXJkSGFuZGxlICAgIDogSGFuZGxlIG9mIGJvYXJkIEFQQ0ktMTcxMCB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICAgIGJfTW9kdWxOYnIgICAgICAgOiBNb2R1bGUgbnVtYmVyIHRvIGNvbmZpZ3VyZXwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgwIHRvIDMpICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgICBiX1BXTSAgICAgICAgICAgIDogU2VsZWN0ZWQgUFdNICgwIG9yIDEpLiAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICAgIGJfVGltaW5nVW5pdCAgICAgOiBCYXNlIHRpbWluZyBVbml0ICgwIHRvIDQpIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCA6IG5zICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxIDogw6ZzICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyIDogbXMgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMgOiBzICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCA6IG1uICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIFVMT05HXyAgICB1bF9Mb3dUaW1pbmcgICAgIDogTG93IGJhc2UgdGltaW5nIHZhbHVlLiAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgVUxPTkdfICAgIHVsX0hpZ2hUaW1pbmcgICAgOiBIaWdoIGJhc2UgdGltaW5nIHZhbHVlLiAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBPdXRwdXQgUGFyYW1ldGVycyA6IC0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgUmV0dXJuIFZhbHVlICAgICAgOiAwOiBObyBlcnJvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTE6IFRoZSBoYW5kbGUgcGFyYW1ldGVyIG9mIHRoZSBib2FyZCBpcyB3cm9uZyAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtMjogTW9kdWxlIHNlbGVjdGlvbiB3cm9uZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC0zOiBUaGUgbW9kdWxlIGlzIG5vdCBhIFBXTSBtb2R1bGUgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTQ6IFBXTSBzZWxlY3Rpb24gaXMgd3JvbmcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtNTogUFdNIG5vdCBpbml0aWFsaXNlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC02OiBUaW1pbmcgVW5pdCBzZWxlY3Rpb24gaXMgd3JvbmcgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTc6IExvdyBiYXNlIHRpbWluZyBzZWxlY3Rpb24gaXMgd3JvbmcgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtODogSGlnaCBiYXNlIHRpbWluZyBzZWxlY3Rpb24gaXMgd3JvbmcgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotKi8KLXN0YXRpYyBpbnQgaV9BUENJMTcxMF9TZXROZXdQV01UaW1pbmcoc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiwKLQkJCQkgICAgICB1bnNpZ25lZCBjaGFyIGJfTW9kdWxOYnIsCi0JCQkJICAgICAgdW5zaWduZWQgY2hhciBiX1BXTSwKLQkJCQkgICAgICB1bnNpZ25lZCBjaGFyIGJfVGltaW5nVW5pdCwKLQkJCQkgICAgICB1bnNpZ25lZCBpbnQgdWxfTG93VGltaW5nLAotCQkJCSAgICAgIHVuc2lnbmVkIGludCB1bF9IaWdoVGltaW5nKQotewotCXN0cnVjdCBhZGRpX3ByaXZhdGUgKmRldnByaXYgPSBkZXYtPnByaXZhdGU7Ci0JdW5zaWduZWQgY2hhciBiX0Nsb2NrU2VsZWN0aW9uOwotCWludCBpX1JldHVyblZhbHVlID0gMDsKLQl1bnNpZ25lZCBpbnQgdWxfTG93VGltZXJWYWx1ZSA9IDA7Ci0JdW5zaWduZWQgaW50IHVsX0hpZ2hUaW1lclZhbHVlID0gMDs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ZHdfU3RhdHVzICYgMHgxMCkgKi8KLQkJCQllbHNlIHsKLQkJCQkJLyoqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkvKiBQV00gbm90IGluaXRpYWxpc2VkICovCi0JCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJRFBSSU5USygiUFdNIG5vdCBpbml0aWFsaXNlZFxuIik7Ci0JCQkJCWlfUmV0dXJuVmFsdWUgPSAtNTsKLQkJCQl9CS8qICBpZiAoZHdfU3RhdHVzICYgMHgxMCkgKi8KLQkJCX0JLyogIGlmIChiX1BXTSA+PSAwICYmIGJfUFdNIDw9IDEpICovCi0JCQllbHNlIHsKLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCS8qIFRvciBQV00gc2VsZWN0aW9uIGlzIHdyb25nICovCi0JCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQlEUFJJTlRLKCJUb3IgUFdNIHNlbGVjdGlvbiBpcyB3cm9uZ1xuIik7Ci0JCQkJaV9SZXR1cm5WYWx1ZSA9IC00OwotCQkJfQkvKiAgaWYgKGJfUFdNID49IDAgJiYgYl9QV00gPD0gMSkgKi8KLQkJfSBlbHNlIHsKLQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogVGhlIG1vZHVsZSBpcyBub3QgYSBQV00gbW9kdWxlICovCi0JCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCURQUklOVEsoIlRoZSBtb2R1bGUgaXMgbm90IGEgUFdNIG1vZHVsZVxuIik7Ci0JCQlpX1JldHVyblZhbHVlID0gLTM7Ci0JCX0KLQl9IGVsc2UgewotCQkvKioqKioqKioqKioqKioqKioqKioqKiovCi0JCS8qIE1vZHVsZSBudW1iZXIgZXJyb3IgKi8KLQkJLyoqKioqKioqKioqKioqKioqKioqKioqLwotCQlEUFJJTlRLKCJNb2R1bGUgbnVtYmVyIGVycm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Yl9QV00sICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyICpfICBwYl9QV01PdXRwdXRTdGF0dXMsICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyICpfICBwYl9FeHRlcm5HYXRlU3RhdHVzKSAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgVGFzayAgICAgICAgICAgICAgOiBSZXR1cm4gdGhlIHN0YXR1cyBmcm9tIHNlbGVjdGVkIFBXTSAoYl9QV00pIGZyb20gICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHNlbGVjdGVkIG1vZHVsZSAoYl9Nb2R1bE5icikuICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgSW5wdXQgUGFyYW1ldGVycyAgOiB1bnNpZ25lZCBjaGFyXyAgYl9Cb2FyZEhhbmRsZSA6IEhhbmRsZSBvZiBib2FyZCBBUENJLTE3MTAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICBiX1BXTSAgICAgICAgIDogU2VsZWN0ZWQgUFdNICgwIG9yIDEpICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gIGJfTW9kdWxOYnIgICAgOiBTZWxlY3RlZCBtb2R1bGUgbnVtYmVyICgwIHRvIDMpCi0JYl9Nb2R1bE5icgkJCT0odW5zaWduZWQgY2hhcikgIENSX0FSRUYoaW5zbi0+Y2hhbnNwZWMpOwotCWJfUFdNCQkJCT0odW5zaWduZWQgY2hhcikgIGRhdGFbMF07Ci0KLSB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgT3V0cHV0IFBhcmFtZXRlcnMgOiB1bnNpZ25lZCBjaGFyICpfICBwYl9QV01PdXRwdXRTdGF0dXMgIDogUmV0dXJuIHRoZSBQV00gb3V0cHV0ICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXZlbCBzdGF0dXMuICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIDogVGhlIFBXTSBvdXRwdXQgbGV2ZWx8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpcyBsb3cuICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSA6IFRoZSBQV00gb3V0cHV0IGxldmVsfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXMgaGlnaC4gICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhciAqXyAgcGJfRXh0ZXJuR2F0ZVN0YXR1cyA6IFJldHVybiB0aGUgZXh0ZXJuIGdhdGUgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV2ZWwgc3RhdHVzLiAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCA6IFRoZSBleHRlcm4gZ2F0ZSBpcyAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG93LiAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgOiBUaGUgZXh0ZXJuIGdhdGUgaXMgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpZ2guCi0gICAgcGJfUFdNT3V0cHV0U3RhdHVzCT0odW5zaWduZWQgY2hhciAqKSBkYXRhWzBdOwotCXBiX0V4dGVybkdhdGVTdGF0dXMgPSh1bnNpZ25lZCBjaGFyICopIGRhdGFbMV07ICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBSZXR1cm4gVmFsdWUgICAgICA6ICAwOiBObyBlcnJvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTE6IFRoZSBoYW5kbGUgcGFyYW1ldGVyIG9mIHRoZSBib2FyZCBpcyB3cm9uZyAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMjogTW9kdWxlIHNlbGVjdGlvbiB3cm9uZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0zOiBUaGUgbW9kdWxlIGlzIG5vdCBhIFBXTSBtb2R1bGUgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTQ6IFBXTSBzZWxlY3Rpb24gaXMgd3JvbmcgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtNTogUFdNIG5vdCBpbml0aWFsaXNlZCBzZWUgZnVuY3Rpb24gICAgICAgICA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zID0gKHVuc2lnbmVkIGNoYXIgKikgJmRhdGFbMF07Ci0JcGJfRXh0ZXJuR2F0ZVN0YXR1cyA9ICh1bnNpZ25lZCBjaGFyICopICZkYXRhWzFdOwotCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCS8qIFRlc3QgdGhlIG1vZHVsZSBudW1iZXIgKi8KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQlpZiAoYl9Nb2R1bE5iciA8IDQpIHsKLQkJLyoqKioqKioqKioqKioqKi8KLQkJLyogVGVzdCBpZiBQV00gKi8KLQkJLyoqKioqKioqKioqKioqKi8KLQotCQlpZiAoKGRldnByaXYtPnNfQm9hcmRJbmZvcy4KLQkJCQlkd19Nb2xkdWxlQ29uZmlndXJhdGlvbltiX01vZHVsTmJyXSAmCi0JCQkJMHhGRkZGMDAwMFVMKSA9PSBBUENJMTcxMF9QV00pIHsKLQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCS8qIFRlc3QgdGhlIFBXTSBzZWxlY3Rpb24gKi8KLQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJaWYgKGJfUFdNIDw9IDEpIHsKLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCS8qIFRlc3QgaWYgUFdNIGluaXRpYWxpc2VkICovCi0JCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCWR3X1N0YXR1cyA9IGlubChkZXZwcml2LT5zX0JvYXJkSW5mb3MuCi0JCQkJCXVpX0FkZHJlc3MgKyAxMiArICgyMCAqIGJfUFdNKSArCi0JCQkJCSg2NCAqIGJfTW9kdWxOYnIpKTsKLQotCQkJCWlmIChkd19TdGF0dXMgJiAweDEwKSB7Ci0JCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJLyogVGVzdCBpZiBQV00gZW5hYmxlZCAqLwotCQkJCQkvKioqKioqKioqKioqKioqKioqKioqKiovCi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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgRnVuY3Rpb24gTmFtZSAgICAgOiBfSU5UXyBpX0FQQ0kxNzEwX0luaXRTU0kgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodW5zaWduZWQgY2hhcl8gICAgYl9Cb2FyZEhhbmRsZSwgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgICBiX01vZHVsTmJyLCAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgIGJfU1NJUHJvZmlsZSwgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICAgYl9Qb3NpdGlvblR1cm5MZW5ndGgsICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgICBiX1R1cm5DcHRMZW5ndGgsICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgIGJfUENJSW5wdXRDbG9jaywgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVUxPTkdfICB1bF9TU0lPdXRwdXRDbG9jaywgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgICBiX1NTSUNvdW50aW5nTW9kZSkgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBUYXNrICAgICAgICAgICAgICA6IENvbmZpZ3VyZSB0aGUgU1NJIG9wZXJhdGluZyBtb2RlIGZyb20gc2VsZWN0ZWQgbW9kdWxlICB8Ci18ICAgICAgICAgICAgICAgICAgICAgKGJfTW9kdWxOYnIpLiBZb3UgbXVzdCBjYWxsaW5nIHRoaXMgZnVuY3Rpb24gYmUgZm9yIHlvdXwKLXwgICAgICAgICAgICAgICAgICAgICBjYWxsIGFueSBvdGhlciBmdW5jdGlvbiB3aXRjaCBhY2Nlc3Mgb2YgU1NJLiAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IElucHV0IFBhcmFtZXRlcnMgIDogdW5zaWduZWQgY2hhcl8gYl9Cb2FyZEhhbmRsZSAgICAgICAgIDogSGFuZGxlIG9mIGJvYXJkIEFQQ0ktMTcxMHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyBiX01vZHVsTmJyICAgICAgICAgICAgOiBNb2R1bGUgbnVtYmVyIHRvICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZ3VyZSAoMCB0byAzKSAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gIGJfU1NJUHJvZmlsZSAgICAgICAgIDogU2VsZWN0aW9uIGZyb20gU1NJICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9maWxlIGxlbmd0aCAoMiB0byAzMikufAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICBiX1Bvc2l0aW9uVHVybkxlbmd0aCA6IFNlbGVjdGlvbiBmcm9tIFNTSSAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gZGF0YSBsZW5ndGggICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMSB0byAzMSkuICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICBiX1R1cm5DcHRMZW5ndGggICAgICA6IFNlbGVjdGlvbiBmcm9tIFNTSSB0dXJuICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY291bnRlciBkYXRhIGxlbmd0aCAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMSB0byAzMSkuICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXIgICBiX1BDSUlucHV0Q2xvY2sgICAgICA6IFNlbGVjdGlvbiBmcm9tIFBDSSBidXMgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xvY2sgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBBUENJMTcxMF8zME1IWiA6ICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRoZSBQQyBoYXZlIGEgUENJIGJ1cyAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xvY2sgZnJvbSAzMCBNSHogICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBBUENJMTcxMF8zM01IWiA6ICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRoZSBQQyBoYXZlIGEgUENJIGJ1cyAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xvY2sgZnJvbSAzMyBNSHogICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBVTE9OR18gdWxfU1NJT3V0cHV0Q2xvY2sgICAgOiBTZWxlY3Rpb24gZnJvbSBTU0kgb3V0cHV0fAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsb2NrLiAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRnJvbSAgMjI5IHRvIDUgMDAwIDAwMCBIenwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgMzAgTUh6IHNlbGVjdGlvbi4gICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZyb20gIDI1MiB0byA1IDAwMCAwMDAgSHp8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIDMzIE1IeiBzZWxlY3Rpb24uICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyICAgYl9TU0lDb3VudGluZ01vZGUgICAgOiBTU0kgY291bnRpbmcgbW9kZSAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGVjdGlvbiAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gQVBDSTE3MTBfQklOQVJZX01PREUgOiAgIHwKLXwgICAgICAgICAgICA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gICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC0xOiBUaGUgaGFuZGxlIHBhcmFtZXRlciBvZiB0aGUgYm9hcmQgaXMgd3JvbmcgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTI6IFRoZSBtb2R1bGUgcGFyYW1ldGVyIGlzIHdyb25nICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtMzogVGhlIG1vZHVsZSBpcyBub3QgYSBTU0kgbW9kdWxlICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC00OiBUaGUgc2VsZWN0ZWQgU1NJIHByb2ZpbGUgbGVuZ3RoIGlzIHdyb25nICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTU6IFRoZSBzZWxlY3RlZCBTU0kgcG9zaXRpb24gZGF0YSBsZW5ndGggaXMgd3JvbmcgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtNjogVGhlIHNlbGVjdGVkIFNTSSB0dXJuIGNvdW50ZXIgZGF0YSBsZW5ndGggaXMgd3JvbmcgIHwKLXwgICAgICAgICAgICAgICAgICAgIC03OiBUaGUgc2VsZWN0ZWQgUENJIGlucHV0IGNsb2NrIGlzIHdyb25nICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTg6IFRoZSBzZWxlY3RlZCBTU0kgb3V0cHV0IGNsb2NrIGlzIHdyb25nICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtOTogVGhlIHNlbGVjdGVkIFNTSSBjb3VudGluZyBtb2RlIHBhcmFtZXRlciBpcyB3cm9uZyAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotKi8KLQotc3RhdGljIGludCBpX0FQQ0kxNzEwX0luc25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ioqKioqKioqKioqKioqLwotCi0JaWYgKGJfTW9kdWxOYnIgPCA0KSB7Ci0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqLwotCQkvKiBUZXN0IGlmIFNTSSBjb3VudGVyICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCWlmICgoZGV2cHJpdi0+c19Cb2FyZEluZm9zLgotCQkJCWR3X01vbGR1bGVDb25maWd1cmF0aW9uW2JfTW9kdWxOYnJdICYKLQkJCQkweEZGRkYwMDAwVUwpID09IEFQQ0kxNzEwX1NTSV9DT1VOVEVSKSB7Ci0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkvKiBUZXN0IHRoZSBTU0kgcHJvZmlsZSBsZW5ndGggKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJLyogIENHIDIyLzAzLzAwIGJfU1NJUHJvZmlsZSA+PSAyIGFuc3RhdHQgYl9TU0lQcm9maWxlID4gMiAqLwotCQkJaWYgKGJfU1NJUHJvZmlsZSA+PSAyICYmIGJfU1NJUHJvZmlsZSA8IDMzKSB7Ci0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkvKiBUZXN0IHRoZSBTU0kgcG9zaXRpb24gZGF0YSBsZW5ndGggKi8KLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJaWYgKGJfUG9zaXRpb25UdXJuTGVuZ3RoID4gMAotCQkJCQkmJiBiX1Bvc2l0aW9uVHVybkxlbmd0aCA8IDMyKSB7Ci0JCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCS8qIFRlc3QgdGhlIFNTSSB0dXJuIGNvdW50ZXIgZGF0YSBsZW5ndGggKi8KLQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJC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U0kgb3V0cHV0IGNsb2NrIGlzIHdyb25nICovCi0JCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQkJCQkJRFBSSU5USygiVGhlIHNlbGVjdGVkIFNTSSBvdXRwdXQgY2xvY2sgaXMgd3JvbmdcbiIpOwotCQkJCQkJCQkJaV9SZXR1cm5WYWx1ZQotCQkJCQkJCQkJCT0KLQkJCQkJCQkJCQktODsKLQkJCQkJCQkJfQotCQkJCQkJCX0gZWxzZSB7Ci0JCQkgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCQkJLyogVGhlIHNlbGVjdGVkIFBDSSBpbnB1dCBjbG9jayBpcyB3cm9uZyAqLwotCQkJICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJCQkJRFBSSU5USygiVGhlIHNlbGVjdGVkIFBDSSBpbnB1dCBjbG9jayBpcyB3cm9uZ1xuIik7Ci0JCQkJCQkJCWlfUmV0dXJuVmFsdWUgPQotCQkJCQkJCQkJLTc7Ci0JCQkJCQkJfQotCQkJCQkJfSBlbHNlIHsKLQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJCS8qIFRoZSBzZWxlY3RlZCBTU0kgcHJvZmlsZSBsZW5ndGggaXMgd3JvbmcgKi8KLQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCQkJRFBSSU5USygiVGhlIHNlbGVjdGVkIFNTSSBwcm9maWxlIGxlbmd0aCBpcyB3cm9uZ1xuIik7Ci0JCQkJCQkJaV9SZXR1cm5WYWx1ZSA9IC00OwotCQkJCQkJfQotCQkJCQl9IGVsc2UgewotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCS8qIFRoZSBzZWxlY3RlZCBTU0kgdHVybiBjb3VudGVyIGRhdGEgbGVuZ3RoIGlzIHdyb25nICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCQlEUFJJTlRLKCJUaGUgc2VsZWN0ZWQgU1NJIHR1cm4gY291bnRlciBkYXRhIGxlbmd0aCBpcyB3cm9uZ1xuIik7Ci0JCQkJCQlpX1JldHVyblZhbHVlID0gLTY7Ci0JCQkJCX0KLQkJCQl9IGVsc2UgewotCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkvKiBUaGUgc2VsZWN0ZWQgU1NJIHBvc2l0aW9uIGRhdGEgbGVuZ3RoIGlzIHdyb25nICovCi0JCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJRFBSSU5USygiVGhlIHNlbGVjdGVkIFNTSSBwb3NpdGlvbiBkYXRhIGxlbmd0aCBpcyB3cm9uZ1xuIik7Ci0JCQkJCWlfUmV0dXJuVmFsdWUgPSAtNTsKLQkJCQl9Ci0JCQl9IGVsc2UgewotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCS8qIFRoZSBzZWxlY3RlZCBTU0kgcHJvZmlsZSBsZW5ndGggaXMgd3JvbmcgKi8KLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCURQUklOVEsoIlRoZSBzZWxlY3RlZCBTU0kgcHJvZmlsZSBsZW5ndGggaXMgd3JvbmdcbiIpOwotCQkJCWlfUmV0dXJuVmFsdWUgPSAtNDsKLQkJCX0KLQkJfSBlbHNlIHsKLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCS8qIFRoZSBtb2R1bGUgaXMgbm90IGEgU1NJIG1vZHVsZSAqLwotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQlEUFJJTlRLKCJUaGUgbW9kdWxlIGlzIG5vdCBhIFNTSSBtb2R1bGVcbiIpOwotCQkJaV9SZXR1cm5WYWx1ZSA9IC0zOwotCQl9Ci0JfSBlbHNlIHsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKiovCi0JCS8qIE1vZHVsZSBudW1iZXIgZXJyb3IgKi8KLQkgICAvKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJRFBSSU5USygiTW9kdWxlIG51bWJlciBlcnJvclxuIik7Ci0JCWlfUmV0dXJuVmFsdWUgPSAtMjsKLQl9Ci0KLQlyZXR1cm4gaV9SZXR1cm5WYWx1ZTsKLX0KLQotLyoKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBGdW5jdGlvbiBOYW1lICAgICA6IF9JTlRfICBpX0FQQ0kxNzEwX1JlYWQxU1NJVmFsdWUgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCBjaGFyXyAgICAgYl9Cb2FyZEhhbmRsZSwgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgICBiX01vZHVsTmJyLCAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICAgIGJfU2VsZWN0ZWRTU0ksICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQVUxPTkdfIHB1bF9Qb3NpdGlvbiwgICAgICA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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFJldHVybiBWYWx1ZSAgICAgIDogMDogTm8gZXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC0xOiBUaGUgaGFuZGxlIHBhcmFtZXRlciBvZiB0aGUgYm9hcmQgaXMgd3JvbmcgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTI6IFRoZSBtb2R1bGUgcGFyYW1ldGVyIGlzIHdyb25nICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtMzogVGhlIG1vZHVsZSBpcyBub3QgYSBTU0kgbW9kdWxlICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC00OiBTU0kgbm90IGluaXRpYWxpc2VkIHNlZSBmdW5jdGlvbiAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICJpX0FQQ0kxNzEwX0luaXRTU0kiICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtNTogVGhlIHNlbGVjdGVkIFNTSSBpcyB3cm9uZyAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotKi8KLQotc3RhdGljIGludCBpX0FQQ0kxNzEwX0luc25SZWFkU1NJVmFsdWUoc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiwKLQkJCQkgICAgICAgc3RydWN0IGNvbWVkaV9zdWJkZXZpY2UgKnMsCi0JCQkJICAgICAgIHN0cnVjdCBjb21lZGlfaW5zbiAqaW5zbiwKLQkJCQkgICAgICAgdW5zaWduZWQgaW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WJlciBlcnJvciAqLwotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQlEUFJJTlRLKCJNb2R1bGUgbnVtYmVyIGVycm9yXG4iKTsKLQkJaV9SZXR1cm5WYWx1ZSA9IC0yOwotCX0KLQotCXJldHVybiBpX1JldHVyblZhbHVlOwotfQotCi0vKgotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IEZ1bmN0aW9uIE5hbWUgICAgIDogX0lOVF8gICBpX0FQQ0kxNzEwX1JlYWRTU0kxRGlnaXRhbElucHV0ICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodW5zaWduZWQgY2hhcl8gICAgIGJfQm9hcmRIYW5kbGUsICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgICAgYl9Nb2R1bE5iciwgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgICBiX0lucHV0Q2hhbm5lbCwgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhciAqXyAgIHBiX0NoYW5uZWxTdGF0dXMpICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBUYXNrICAgICAgICAgICAgICA6Ci0JCQkJCSgwKSBTZXQgdGhlIGRpZ2l0YWwgb3V0cHV0IGZyb20gc2VsZWN0ZWQgU1NJIG1vZHVsZSAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC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2l0YWwgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVswXSB3aGljaCBJT1RZUEUgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnB1dCAoIDAgdG8gMikgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IE91dHB1dCBQYXJhbWV0ZXJzIDogdW5zaWduZWQgY2hhciAqXyAgcGJfQ2hhbm5lbFN0YXR1cyAgICA6IERpZ2l0YWwgaW5wdXQgY2hhbm5lbCAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVswXSAgICAgICAgICAgICAgICAgIHN0YXR1cyAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCA6IENoYW5ubGUgaXMgbm90IGFjdGl2ZXwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxIDogQ2hhbm5sZSBpcyBhY3RpdmUgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFJldHVybiBWYWx1ZSAgICAgIDogMDogTm8gZXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC0xOiBUaGUgaGFuZGxlIHBhcmFtZXRlciBvZiB0aGUgYm9hcmQgaXMgd3JvbmcgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTI6IFRoZSBtb2R1bGUgcGFyYW1ldGVyIGlzIHdyb25nICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtMzog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WxlciA6IGdjYyAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgfCBNb2R1bGUgbmFtZSA6IFRPUi5DICAgICAgICAgICB8IFZlcnNpb24gIDogMi45NiAgICAgICAgICAgICAgICAgICAgICAgfAotICArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0gIHwgUHJvamVjdCBtYW5hZ2VyOiBFcmljIFN0b2x6ICAgfCBEYXRlICAgICA6ICAwMi8xMi8yMDAyICAgICAgICAgICAgICAgIHwKLSAgKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotICB8IERlc2NyaXB0aW9uIDogICBBUENJLTE3MTAgdG9yIGNvdW50ZXIgbW9kdWxlICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0gIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVQREFURVMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotICB8ICAgRGF0ZSAgIHwgICBBdXRob3IgIHwgICAgICAgICAgRGVzY3JpcHRpb24gb2YgdXBkYXR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TE3MTBfR0FURV9JTlBVVAkJMTAKLQotI2RlZmluZSBBUENJMTcxMF9UT1JfU0lNUExFX01PREUJMgotI2RlZmluZSBBUENJMTcxMF9UT1JfRE9VQkxFX01PREUJMwotI2RlZmluZSBBUENJMTcxMF9UT1JfUVVBRFJVUExFX01PREUJNAotCi0jZGVmaW5lIEFQQ0kxNzEwX1NJTkdMRQkJCTAKLSNkZWZpbmUgQVBDSTE3MTBfQ09OVElOVU9VUwkJMQotCi0jZGVmaW5lIEFQQ0kxNzEwX1RPUl9HRVRQUk9HUkVTU1NUQVRVUwkwCi0jZGVmaW5lIEFQQ0kxNzEwX1RPUl9HRVRDT1VOVEVSVkFMVUUJMQotI2RlZmluZSBBUENJMTcxMF9UT1JfUkVBRElOVEVSUlVQVAkyCi0KLS8qCi0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgRnVuY3Rpb24gTmFtZSAgICAgOiBfSU5UXyAgICAgaV9BUENJMTcxMF9Jbml0VG9yQ291bnRlciAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCBjaGFyXyAgICAgYl9Cb2FyZEhhbmRsZSwgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgICBiX01vZHVsTmJyLCAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICAgIGJfVG9yQ291bnRlciwgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgICAgYl9QQ0lJbnB1dENsb2NrLCAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgICBiX1RpbWluZ1VuaXQsICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVUxPTkdfICAgdWxfVGltaW5nSW50ZXJ2YWwsICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQVUxPTkdfIHB1bF9SZWFsVGltaW5nSW50ZXJ2YWwpICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgVGFzayAgICAgICAgICAgICAgOiBDb25maWd1cmUgdGhlIHNlbGVjdGVkIHRvciBjb3VudGVyIChiX1RvckNvdW50ZXIpICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIGZyb20gc2VsZWN0ZWQgbW9kdWxlIChiX01vZHVsTmJyKS4gICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgVGhlIHVsX1RpbWluZ0ludGVydmFsIGFuZCB1bF9UaW1pbmdVbml0IGRldGVybWluZSB0aGUgIHwKLXwgICAgICAgICAgICAgICAgICAgICB0aW1pbmcgYmFzZSBmb3IgdGhlIG1lYXN1cmVtZW50LiAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIFRoZSBwdWxfUmVhbFRpbWluZ0ludGVydmFsIHJldHVybiB0aGUgcmVhbCB0aW1pbmcgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdmFsdWUuIFlvdSBtdXN0IGNhbGxpbmcgdGhpcyBmdW5jdGlvbiBiZSBmb3IgeW91IGNhbGwgIHwKLXwgICAgICAgICAgICAgICAgICAgICBhbnkgb3RoZXIgZnVuY3Rpb24gd2l0Y2ggYWNjZXNzIG9mIHRoZSB0b3IgY291bnRlci4gICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgSW5wdXQgUGFyYW1ldGVycyAgOiAgICB8Ci18Ci0JCUNSX0FSRUYJdW5zaWduZWQgY2hhcl8gICBiX01vZHVsTmJyICAgICAgIDogTW9kdWxlIG51bWJlciB0byBjb25maWd1cmUgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMCB0byAzKSAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgZGF0YVswXSB1bnNpZ25lZCBjaGFyXyAgIGJfVG9yQ291bnRlciAgICAgOiBUb3IgY291bnRlciBzZWxlY3Rpb24gICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgwIG9yIDEpLiAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICBkYXRhWzFdIHVuc2lnbmVkIGNoYXJfICAgYl9QQ0lJbnB1dENsb2NrICA6IFNlbGVjdGlvbiBmcm9tIFBDSSBidXMgY2xvY2t8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBBUENJMTcxMF8zME1IWiA6ICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRoZSBQQyBoYXZlIGEgUENJIGJ1cyAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xvY2sgZnJvbSAzMCBNSHogICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBBUENJMTcxMF8zM01IWiA6ICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRoZSBQQyBoYXZlIGEgUENJIGJ1cyAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xvY2sgZnJvbSAzMyBNSHogICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBBUENJMTcxMF80ME1IWiAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRoZSBBUENJLTE3MTAgaGF2ZSBhICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50ZWdyYXRlZCA0ME1oeiAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWFydHouICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIEFQQ0kxNzEwX0dBVEVfSU5QVVQgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVXNlZCB0aGUgZ2F0ZSBpbnB1dCBmb3IgICB8Ci18CQkJCQkJICAgdGhlIGJhc2UgY2xvY2suIElmIHlvdSAgICB8Ci18CQkJCQkJICAgaGF2ZSBzZWxlY3RlZCB0aGlzIG9wdGlvbix8Ci18CQkJCQkJICAgdGhhbiBpdCBpcyBub3QgcG9zc2libCB0byB8Ci18CQkJCQkJICAgdXNlZCB0aGUgZ2F0ZSBpbnB1dCBmb3IgICB8Ci18CQkJCQkJICAgZW5hYmxlZCB0aGUgYWNxdWlzaXRpb24gICB8Ci18ICAgICAgICAgICBkYXRhWzJdIHVuc2lnbmVkIGNoYXJfICAgYl9UaW1pbmdVbml0ICAgIDogQmFzZSB0aW1pbmcgdW5pdCAoMCB0byA0KSAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgOiBucyAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSA6IMK1cyAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMiA6IG1zICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzIDogcyAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQgOiBtbiAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgIGRhdGFbM10gICAgICAgICAgVUxPTkdfIHVsX1RpbWluZ0ludGVydmFsIDogQmFzZSB0aW1pbmcgdmFsdWUuICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBPdXRwdXQgUGFyYW1ldGVycyA6IFBVTE9OR18gIHB1bF9SZWFsVGltaW5nSW50ZXJ2YWwgOiBSZWFsICBiYXNlIHRpbWluZyAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgZGF0YVswXSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZS4gICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgUmV0dXJuIFZhbHVlICAgICAgOiAgMDogTm8gZXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0xOiBUaGUgaGFuZGxlIHBhcmFtZXRlciBvZiB0aGUgYm9hcmQgaXMgd3JvbmcgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTI6IE1vZHVsZSBzZWxlY3Rpb24gd3JvbmcgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMzogVGhlIG1vZHVsZSBpcyBub3QgYSB0b3IgY291bnRlciBtb2R1bGUgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC00OiBUb3IgY291bnRlciBzZWxlY3Rpb24gaXMgd3JvbmcgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTU6IFRoZSBzZWxlY3RlZCBQQ0kgaW5wdXQgY2xvY2sgaXMgd3JvbmcgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtNjogVGltaW5nIHVuaXQgc2VsZWN0aW9uIGlzIHdyb25nICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC03OiBCYXNlIHRpbWluZyBzZWxlY3Rpb24gaXMgd3JvbmcgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTg6IFlvdSBjYW4gbm90IHVzZWQgdGhlIDQwTUh6IGNsb2NrIHNlbGVjdGlvbiB3aWNoICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcyBib2FyZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC05OiBZb3UgY2FuIG5vdCB1c2VkIHRoZSA0ME1IeiBjbG9jayBzZWxlY3Rpb24gd2ljaCAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgIH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ZGF0YVswXTsKLQliX1BDSUlucHV0Q2xvY2sgPSAodW5zaWduZWQgY2hhcikgZGF0YVsxXTsKLQliX1RpbWluZ1VuaXQgPSAodW5zaWduZWQgY2hhcikgZGF0YVsyXTsKLQl1bF9UaW1pbmdJbnRlcnZhbCA9ICh1bnNpZ25lZCBpbnQpIGRhdGFbM107Ci0JcHJpbnRrKCJJTlBVVCBjbG9jayAlZFxuIiwgYl9QQ0lJbnB1dENsb2NrKTsKLQotCQkvKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JLyogVGVzdCB0aGUgbW9kdWxlIG51bWJlciAqLwotCQkvKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQlpZiAoYl9Nb2R1bE5iciA8IDQpIHsKLQkJLyoqKioqKioqKioqKioqKioqKioqKioqLwotCQkvKiBUZXN0IGlmIHRvciBjb3VudGVyICovCi0JCS8qKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQlpZiAoKGRldnByaXYtPnNfQm9hcmRJbmZvcy4KLQkJCQlkd19Nb2xkdWxlQ29uZmlndXJhdGlvbltiX01vZHVsTmJyXSAmCi0JCQkJMHhGRkZGMDAwMFVMKSA9PSBBUENJMTcxMF9UT1JfQ09VTlRFUikgewotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogVGVzdCB0aGUgdG9yIGNvdW50ZXIgc2VsZWN0aW9uICovCi0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCWlmIChiX1RvckNvdW50ZXIgPD0gMSkgewotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCS8qIFRlc3QgdGhlIFBDSSBidXMgY2xvY2sgKi8KLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCWlmICgoYl9QQ0lJbnB1dENsb2NrID09IEFQQ0kxNzEwXzMwTUhaKSB8fAotCQkJCQkoYl9QQ0lJbnB1dENsb2NrID09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fUENJSW5wdXRDbG9jayAhPSBBUENJMTcxMF9HQVRFX0lOUFVUKSAqLwotCQkJCQkJCQkJZWxzZSB7Ci0JCQkJICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCQkJCQkJLyogMiBDbG9jayB1c2VkIGZvciB0aGUgb3ZlcmZsb3cgYW5kIHRoZSByZWxvYWQgZnJvbSBjb3VudGVyICovCi0JCQkJICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJCQkJCQl1bF9UaW1lclZhbHVlCi0JCQkJCQkJCQkJCT0KLQkJCQkJCQkJCQkJdWxfVGltaW5nSW50ZXJ2YWwKLQkJCQkJCQkJCQkJLQotCQkJCQkJCQkJCQkyOwotCQkJCQkJCQkJfQkvKiAgaWYgKGJfUENJSW5wdXRDbG9jayAhPSBBUENJMTcxMF9HQVRFX0lOUFVUKSAqLwotCi0JCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCQkJCQkvKiBTYXZlIHRoZSBQQ0kgaW5wdXQgY2xvY2sgKi8KLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCQkJCWRldnByaXYtPgotCQkJCQkJCQkJCXNfTW9kdWxlSW5mbwotCQkJCQkJCQkJCVtiX01vZHVsTmJyXS4KLQkJCQkJCQkJCQlzX1RvckNvdW50ZXJNb2R1bGVJbmZvLgotCQkJCQkJCQkJCWJfUENJSW5wdXRDbG9jawotCQkJCQkJCQkJCT0KLQkJCQkJCQkJCQliX1BDSUlucHV0Q2xvY2s7Ci0KLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJCQkJLyogU2F2ZSB0aGUgdGltaW5nIHVuaXQgKi8KLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCQkJCQlkZXZ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ZXJuIGNsb2NrIHVzZWQgKi8KLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJCQkJCWlmIChiX1BDSUlucHV0Q2xvY2sgPT0gQVBDSTE3MTBfR0FURV9JTlBVVCkgewotCQkJCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJCQkJCS8qIFNldCB0aGUgNDAgTUh6IHNlbGVjdGlvbiAqLwotCQkJCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCQkJCQkJZHdfQ29tbWFuZAotCQkJCQkJCQkJCQk9Ci0JCQkJCQkJCQkJCWR3X0NvbW1hbmQKLQkJCQkJCQkJCQkJfAotCQkJCQkJCQkJCQkweDIwOwotCQkJCQkJCQkJfQotCi0JCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCQkJCQkvKiBXcml0ZSB0aGUgbmV3IGNvbW1hbmQgKi8KLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQkJCQkJb3V0bChkd19Db21tYW5kLCBkZXZwcml2LT5zX0JvYXJkSW5mb3MudWlfQWRkcmVzcyArIDQgKyAoMTYgKiBiX1RvckNvdW50ZXIpICsgKDY0ICogYl9Nb2R1bE5icikpOwotCi0JCQkJLyoqKioqKioqKioqKioqKioqKiovCi0JCQkJCQkJCQkvKiBEaXNhYmxlIHRoZSB0b3IgKi8KLQkJCQkvKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQkJCQkJb3V0bCgwLCBkZXZwcml2LT5zX0JvYXJkSW5mb3MudWlfQWRkcmVzcyArIDggKyAoMTYgKiBiX1RvckNvdW50ZXIpICsgKDY0ICogYl9Nb2R1bE5icikpOwotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJCQkJLyogU2V0IHRoZSB0aW1lciAxIHZhbHVlICovCi0JCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJCQkJCW91dGwodWxfVGltZXJWYWx1ZSwgZGV2cHJpdi0+c19Cb2FyZEluZm9zLnVpX0FkZHJlc3MgKyAwICsgKDE2ICogYl9Ub3JDb3VudGVyKSArICg2NCAqIGJfTW9kdWxOYnIpKTsKLQotCQkJCS8qKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCQkJCQkvKiBUb3IgY291bnRlciBpbml0LiAqLwotCQkJCS8qKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJCQkJCWRldnByaXYtPgotCQkJCQkJCQkJCXNfTW9kdWxlSW5mbwotCQkJCQkJCQkJCVtiX01vZHVsTmJyXS4KLQkJCQkJCQkJCQlzX1RvckNvdW50ZXJNb2R1bGVJbmZvLgotCQkJCQkJCQkJCXNfVG9yQ291bnRlckluZm8KLQkJCQkJCQkJCQlbYl9Ub3JDb3VudGVyXS4KLQkJCQkJCQkJCQliX1RvckNvdW50ZXJJbml0Ci0JCQkJCQkJCQkJPQotCQkJCQkJCQkJCTE7Ci0JCQkJCQkJCX0gZWxzZSB7Ci0JCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJCQkJLyogVE9SIHZlcnNpb24gZXJyb3IgZm9yIDQwTUh6IGNsb2NrIHNlbGVjdGlvbiAqLwotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQkJCQkJRFBSSU5USygiVE9SIHZlcnNpb24gZXJyb3IgZm9yIDQwTUh6IGNsb2NrIHNlbGVjdGlvblxuIik7Ci0JCQkJCQkJCQlpX1JldHVyblZhbHVlCi0JCQkJCQkJCQkJPQotCQkJCQkJCQkJCS05OwotCQkJCQkJCQl9Ci0JCQkJCQkJfSBlbHNlIHsKLQkJCSAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJCQkvKiBZb3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IChiX1RpbWluZ1VuaXQgPD0gNCkpICovCi0JCQkJfQkvKiAgaWYgKChiX1BDSUlucHV0Q2xvY2sgPT0gQVBDSTE3MTBfMzBNSFopIHx8IChiX1BDSUlucHV0Q2xvY2sgPT0gQVBDSTE3MTBfMzNNSFopKSAqLwotCQkJCWVsc2UgewotCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkvKiBUaGUgc2VsZWN0ZWQgUENJIGlucHV0IGNsb2NrIGlzIHdyb25nICovCi0JCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJRFBSSU5USygiVGhlIHNlbGVjdGVkIFBDSSBpbnB1dCBjbG9jayBpcyB3cm9uZ1xuIik7Ci0JCQkJCWlfUmV0dXJuVmFsdWUgPSAtNTsKLQkJCQl9CS8qICBpZiAoKGJfUENJSW5wdXRDbG9jayA9PSBBUENJMTcxMF8zME1IWikgfHwgKGJfUENJSW5wdXRDbG9jayA9PSBBUENJMTcxMF8zM01IWikpICovCi0JCQl9CS8qICBpZiAoYl9Ub3JDb3VudGVyTW9kZSA+PSAwICYmIGJfVG9yQ291bnRlck1vZGUgPD0gNykgKi8KLQkJCWVsc2UgewotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogVG9yIENvdW50ZXIgc2VsZWN0aW9uIGlzIHdyb25nICovCi0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCURQUklOVEsoIlRvciBDb3VudGVyIHNlbGVjdGlvbiBpcyB3cm9uZ1xuIik7Ci0JCQkJaV9SZXR1cm5WYWx1ZSA9IC00OwotCQkJfQkvKiAgaWYgKGJfVG9yQ291bnRlck1vZGUgPj0gMCAmJiBiX1RvckNvdW50ZXJNb2RlIDw9IDcpICovCi0JCX0gZWxzZSB7Ci0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCS8qIFRoZSBtb2R1bGUgaXMgbm90IGEgdG9yIGNvdW50ZXIgbW9kdWxlICovCi0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJRFBSSU5USygiVGhlIG1vZHVsZSBpcyBub3QgYSB0b3IgY291bnRlciBtb2R1bGVcbiIpOwotCQkJaV9SZXR1cm5WYWx1ZSA9IC0zOwotCQl9Ci0JfSBlbHNlIHsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKiovCi0JCS8qIE1vZHVsZSBudW1iZXIgZXJyb3IgKi8KLQkgICAvKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJRFBSSU5USygiTW9kdWxlIG51bWJlciBlcnJvclxuIik7Ci0JCWlfUmV0dXJuVmFsdWUgPSAtMjsKLQl9Ci0JZGF0YVswXSA9ICh1bnNpZ25lZCBpbnQpIHVsX1JlYWxUaW1pbmdJbnRlcnZhbDsKLQlyZXR1cm4gaV9SZXR1cm5WYWx1ZTsKLX0KLQotLyoKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBGdW5jdGlvbiBOYW1lICAgICA6IF9JTlRfIGlfQVBDSTE3MTBfRW5hYmxlVG9yQ291bnRlciAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodW5zaWduZWQgY2hhcl8gYl9Cb2FyZEhhbmRsZSwgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyBiX01vZHVsTmJyLCAgICAgICAgICAgfAotfAkJCQkJCSB1bnNpZ25lZCBjaGFyXyBiX1RvckNvdW50ZXIsICAgICAgICAgfAotfAkJCQkJCSB1bnNpZ25lZCBjaGFyXyBiX0lucHV0TW9kZSwgICAgICAgICAgfAotfAkJCQkJCSB1bnNpZ25lZCBjaGFyXyBiX0V4dGVybkdhdGUsICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfQ3ljbGVNb2RlLCAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gYl9JbnRlcnJ1cHRFbmFibGUpICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBUYXNrICAgICAgICAgICAgICA6IEVuYWJsZSB0aGUgdG9yIGNvdW50ZXIgKGJfVG9yQ291bnRlcikgZnJvbSBzZWxlY3RlZCAgICB8Ci18CQkgICAgICBtb2R1bGUgKGJfTW9kdWxOYnIpLiBZb3UgbXVzdCBjYWxsaW5nIHRoZSAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICJpX0FQQ0kxNzEwX0luaXRUb3JDb3VudGVyIiBmdW5jdGlvbiBiZSBmb3IgeW91IGNhbGwgICB8Ci18CQkgICAgICB0aGlzIGZ1bmN0aW9uLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIElmIHlvdSBlbmFibGUgdGhlIHRvciBjb3VudGVyIGludGVycnVwdCwgdGhlICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdG9yIGNvdW50ZXIgZ2VuZXJhdGUgYSBpbnRlcnJ1cHQgYWZ0ZXIgdGhlIHRpbWluZyBjeWNsZXwKLXwgICAgICAgICAgICAgICAgICAgICBTZWUgZnVuY3Rpb24gImlfQVBDSTE3MTBfU2V0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jb3VudGVyICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY3F1aXNpdGlvbiBtb2RlICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyBiX0ludGVycnVwdEVuYWJsZSA6IEVuYWJsZSBvciBkaXNhYmxlIHRoZSAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9yIGNvdW50ZXIgaW50ZXJydXB0LiAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBUENJMTcxMF9FTkFCTEU6ICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVuYWJsZSB0aGUgdG9yIGNvdW50ZXIgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50ZXJydXB0ICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBUENJMTcxMF9ESVNBQkxFOiAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERpc2FibGUgdGhlIHRvciBjb3VudGVyICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50ZXJydXB0ICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgT3V0cHV0IFBhcmFtZXRlcnMgOiAtICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFJldHVybiBWYWx1ZSAgICAgIDogIDA6IE5vIGVycm9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMTogVGhlIGhhbmRsZSBwYXJhbWV0ZXIgb2YgdGhlIGJvYXJkIGlzIHdyb25nICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0yOiBNb2R1bGUgc2VsZWN0aW9uIHdyb25nICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTM6IFRoZSBtb2R1bGUgaXMgbm90IGEgdG9yIGNvdW50ZXIgbW9kdWxlICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtNDogVG9yIGNvdW50ZXIgc2VsZWN0aW9uIGlzIHdyb25nICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC01OiBUb3IgY291bnRlciBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICJpX0FQQ0kxNzEwX0luaXRUb3JDb3VudGVyIiAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtNjogVG9yIGlucHV0IHNpZ25hbCBzZWxlY3Rpb24gaXMgd3JvbmcgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC03OiBFeHRlcm4gZ2F0ZSBzaWduYWwgbW9kZSBpcyB3cm9uZyAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTg6IFRvciBjb3VudGVyIGFjcXVpc2l0aW9uIG1vZGUgY3ljbGUgaXMgd3JvbmcgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtOTogSW50ZXJydXB0IHBhcmFtZXRlciBpcyB3cm9uZyAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0xMDpJbnRlcnJ1cHQgZnVuY3Rpb24gbm90IGluaXRpYWxpc2VkLiAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgIFNlZSBmdW5jdGlvbiAiaV9BUENJMTcxMF9TZXRCb2FyZEludFJvdXRpbmVYIiAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotKi8KLS8qCi0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgRnVuY3Rpb24gTmFtZSAgICAgOiBfSU5UXyBpX0FQQ0kxNzEwX0Rpc2FibGVUb3JDb3VudGVyICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHVuc2lnbmVkIGNoYXJfICBiX0JvYXJkSGFuZGxlLCAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gIGJfTW9kdWxOYnIsICAgICAgICAgIHwKLXwJCQkJCQkgdW5zaWduZWQgY2hhcl8gIGJfVG9yQ291bnRlcikgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBUYXNrICAgICAgICAgICAgICA6IERpc2FibGUgdGhlIHRvciBjb3VudGVyIChiX1RvckNvdW50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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFJldHVybiBWYWx1ZSAgICAgIDogIDA6IE5vIGVycm9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMTogVGhlIGhhbmRsZSBwYXJhbWV0ZXIgb2YgdGhlIGJvYXJkIGlzIHdyb25nICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0yOiBNb2R1bGUgc2VsZWN0aW9uIHdyb25nICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTM6IFRoZSBtb2R1bGUgaXMgbm90IGEgdG9yIGNvdW50ZXIgbW9kdWxlICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtNDogVG9yIGNvdW50ZXIgc2VsZWN0aW9uIGlzIHdyb25nICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC01OiBUb3IgY291bnRlciBub3QgaW5pdGlhbGlzZWQgc2VlIGZ1bmN0aW9uICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICJpX0FQQ0kxNzEwX0luaXRUb3JDb3VudGVyIiAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtNjogVG9yIGNvdW50ZXIgbm90IGVuYWJsZWQgc2VlIGZ1bmN0aW9uICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAiaV9BUENJMTcxMF9FbmFibGVUb3JDb3VudGVyIiAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSovCi0KLXN0YXRpYyBpb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iAgaWYgKGJfSW5wdXRNb2RlID49IDAgJiYgYl9JbnB1dE1vZGUgPD0gMSkgKi8KLQkJCQkJCWVsc2UgewotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCQkvKiBUb3IgaW5wdXQgc2lnbmFsIHNlbGVjdGlvbiBpcyB3cm9uZyAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQkJCURQUklOVEsoIlRvciBpbnB1dCBzaWduYWwgc2VsZWN0aW9uIGlzIHdyb25nXG4iKTsKLQkJCQkJCQlpX1JldHVyblZhbHVlID0gLTY7Ci0JCQkJCQl9Ci0JCQkJCX0gZWxzZSB7Ci0JCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCS8qIFRvciBjb3VudGVyIG5vdCBpbml0aWFsaXNlZCAqLwotCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJCURQUklOVEsoIlRvciBjb3VudGVyIG5vdCBpbml0aWFsaXNlZFxuIik7Ci0JCQkJCQlpX1JldHVyblZhbHVlID0gLTU7Ci0JCQkJCX0KLQkJCQkJYnJlYWs7Ci0KLQkJCQljYXNlIEFQQ0kxNzEwX0RJU0FCTEU6Ci0JCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkvKiBUZXN0IGlmIHRvciBjb3VudGVyIGluaXRpYWxpc2VkICovCi0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJZHdfU3RhdHVzID0gaW5sKGRldnByaXYtPnNfQm9hcmRJbmZvcy4KLQkJCQkJCXVpX0FkZHJlc3MgKyA4ICsKLQkJCQkJCSgxNiAqIGJfVG9yQ291bnRlcikgKwotCQkJCQkJKDY0ICogYl9Nb2R1bE5icikpOwotCi0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJLyogVGVzdCBpZiBjb3VudGVyIGluaXRpYWxpc2VkICovCi0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQlpZiAoZHdfU3RhdHVzICYgMHgxMCkgewotCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCS8qIFRlc3QgaWYgY291bnRlciBlbmFibGVkICovCi0JCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCQlpZiAoZHdfU3RhdHVzICYgMHgxKSB7Ci0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCQkvKiBDbGVhciB0aGUgaW50ZXJydXB0IG1vZGUgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJCWRldnByaXYtPgotCQkJCQkJCQlzX01vZHVsZUluZm8KLQkJCQkJCQkJW2JfTW9kdWxOYnJdLgotCQkJCQkJCQlzX1RvckNvdW50ZXJNb2R1bGVJbmZvLgotCQkJCQkJCQlzX1RvckNvdW50ZXJJbmZvCi0JCQkJCQkJCVtiX1RvckNvdW50ZXJdLgotCQkJCQkJCQliX0ludGVycnVwdEVuYWJsZQotCQkJCQkJCQk9Ci0JCQkJCQkJCUFQQ0kxNzEwX0RJU0FCTEU7Ci0KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKiovCi0JCQkJCQkJLyogQ2xlYXIgdGhlIGdhdGUgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJCQlvdXRsKDAsIGRldnByaXYtPgotCQkJCQkJCQlzX0JvYXJkSW5mb3MuCi0JCQkJCQkJCXVpX0FkZHJlc3MgKyA4ICsKLQkJCQkJCQkJKDE2ICogYl9Ub3JDb3VudGVyKSArICg2NCAqIGJfTW9kdWxOYnIpKTsKLQkJCQkJCX0JLyogIGlmIChkd19TdGF0dXMgJiAweDEpICovCi0JCQkJCQllbHNlIHsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCQkJLyogVG9yIGNvdW50ZXIgbm90IGVuYWJsZWQgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJCQlEUFJJTlRLKCJUb3IgY291bnRlciBub3QgZW5hYmxlZCBcbiIpOwotCQkJCQkJCWlfUmV0dXJuVmFsdWUgPSAtNjsKLQkJCQkJCX0JLyogIGlmIChkd19TdGF0dXMgJiAweDEpICovCi0JCQkJCX0JLyogIGlmIChkd19TdGF0dXMgJiAweDEwKSAqLwotCQkJCQllbHNlIHsKLQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJLyogVG9yIGNvdW50ZXIgbm90IGluaXRpYWxpc2VkICovCi0JCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQkJRFBSSU5USygiVG9yIGNvdW50ZXIgbm90IGluaXRpYWxpc2VkXG4iKTsKLQkJCQkJCWlfUmV0dXJuVmFsdWUgPSAtNTsKLQkJCQkJfQkvKiAgLy8gaWYgKGR3X1N0YXR1cyAmIDB4MTApICovCi0KLQkJCQl9CS8qICBzd2l0Y2ggKi8KLQkJCX0JLyogIGlmIChiX1RvckNvdW50ZXIgPD0gMSkgKi8KLQkJCWVsc2UgewotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogVG9yIGNvdW50ZXIgc2VsZWN0aW9uIGlzIHdyb25nICovCi0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCURQUklOVEsoIlRvciBjb3VudGVyIHNlbGVjdGlvbiBpcyB3cm9uZ1xuIik7Ci0JCQkJaV9SZXR1cm5WYWx1ZSA9IC00OwotCQkJfQkvKiAgaWYgKGJfVG9yQ291bnRlciA8PSAxKSAqLwotCQl9IGVsc2UgewotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkvKiBUaGUgbW9kdWxlIGlzIG5vdCBhIHRvciBjb3VudGVyIG1vZHVsZSAqLwotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCURQUklOVEsoIlRoZSBtb2R1bGUgaXMgbm90IGEgdG9yIGNvdW50ZXIgbW9kdWxlIFxuIik7Ci0JCQlpX1JldHVyblZhbHVlID0gLTM7Ci0JCX0KLQl9IGVsc2UgewotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKi8KLQkJLyogTW9kdWxlIG51bWJlciBlcnJvciAqLwotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQlEUFJJTlRLKCJNb2R1bGUgbnVtYmVyIGVycm9yIFxuIik7Ci0JCWlfUmV0dXJuVmFsdWUgPSAtMjsKLQl9Ci0KLQlyZXR1cm4gaV9SZXR1cm5WYWx1ZTsKLX0KLQotLyoKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBGdW5jdGlvbiBOYW1lICAgICA6IF9JTlRfIGlfQVBDSTE3MTBfR2V0VG9yQ291bnRlckluaXRpYWxpc2F0aW9uICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodW5zaWduZWQgY2hhcl8gICAgIGJfQm9hcmRIYW5kbGUsICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgICAgYl9Nb2R1bE5iciwgICAgICAgfAotfAkJCQkJCSB1bnNpZ25lZCBjaGFyXyAgICAgYl9Ub3JDb3VudGVyLCAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAJIHVuc2lnbmVkIGNoYXIgKl8gICBwYl9UaW1pbmdVbml0LCAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAJIFBVTE9OR18gcHVsX1RpbWluZ0ludGVydmFsLCB8Ci18CQkJCQkJIHVuc2lnbmVkIGNoYXIgKl8gICBwYl9JbnB1dE1vZGUsICAgICAgfAotfAkJCQkJCSB1bnNpZ25lZCBjaGFyICpfICAgcGJfRXh0ZXJuR2F0ZSwgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyICpfICAgcGJfQ3ljbGVNb2RlLCAgICAgIHwKLXwJCQkJCQkgdW5zaWduZWQgY2hhciAqXyAgIHBiX0VuYWJsZSwgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhciAqXyAgIHBiX0ludGVycnVwdEVuYWJsZSl8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgVGFzayAgICAgICAgICAgICAgOiBFbmFibGUgdGhlIHRvciBjb3VudGVyIChiX1RvckNvdW50ZXIpIGZyb20gc2VsZWN0ZWQgICAgfAotfAkJICAgICAgbW9kdWxlIChiX01vZHVsTmJyKS4gWW91IG11c3QgY2FsbGluZyB0aGUgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAiaV9BUENJMTcxMF9Jbml0VG9yQ291bnRlciIgZnVuY3Rpb24gYmUgZm9yIHlvdSBjYWxsICAgfAotfAkJICAgICAgdGhpcyBmdW5jdGlvbi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICA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QVJFRihpbnNuLT5jaGFuc3BlYyk7Ci0JYl9Ub3JDb3VudGVyCQk9CUNSX0NIQU4oaW5zbi0+Y2hhbnNwZWMpOwotLiB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgT3V0cHV0IFBhcmFtZXRlcnMgOiB1bnNpZ25lZCBjaGFyICpfICBwYl9UaW1pbmdVbml0ICAgIDogQmFzZSB0aW1pbmcgdW5pdCAoMCB0byA0KSAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCA6IG5zICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxIDogwrVzICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyIDogbXMgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMgOiBzICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCA6IG1uICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIFBVTE9OR18gcHVsX1RpbWluZ0ludGVydmFsIDogQmFzZSB0aW1pbmcgdmFsdWUuICAgICAgICB8Ci18CQkgICAgICB1bnNpZ25lZCBjaGFyICpfIHBiX0lucHV0TW9kZSAgICAgICAgOiBJbnB1dCBzaWduYWwgbGV2ZWwgICAgICAgIHwKLXwJCQkJCQkgICBzZWxlY3Rpb24gIAkJICAgICB8Ci18CQkJCQkJMCA6IFRvciBjb3VudCBlYWNoIGxvdyBsZXZlbCB8Ci18CQkJCQkJMSA6IFRvciBjb3VudCBlYWNoIGhpZ2ggbGV2ZWx8Ci18CQkgICAgICB1bnNpZ25lZCBjaGFyICpfIHBiX0V4dGVybkdhdGUJOiBFeHRlcm4gZ2F0ZSBhY3Rpb24gICAgICAgICB8Ci18CQkJCQkJICBzZWxlY3Rpb24gICAgICAgICAgICAgICAgICB8Ci18CQkJCQkJICAwIDogRXh0ZXJuIGdhdGUgc2lnbmFsIG5vdCB8Ci18CQkJCQkJICAgICAgdXNlZCAgICAgICAgICAgICAgICAgICB8Ci18CQkJCQkJICAxIDogRXh0ZXJuIGdhdGUgc2lnbmFsIHVzZWR8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhciAqXyBwYl9DeWNsZU1vZGUgICAgICAgOiBUb3IgY291bnRlciBhY3F1aXNpdGlvbiAgICB8Ci18CQkJCQkJICBtb2RlICAgICAgICAgICAJICAgICB8Ci18CQkgICAgICB1bnNpZ25lZCBjaGFyICpfIHBiX0VuYWJsZQkJOiBJbmRpY2F0ZSBpZiB0aGUgdG9yIGNvdW50ZXJ8Ci18CQkJCQkJICBpcyBlbmFibGVkIG9yIG5vICAgICAgICAgICB8Ci18CQkJCQkJICAwIDogVG9yIGNvdW50ZXIgZGlzYWJsZWQgICB8Ci18CQkJCQkJICAxIDogVG9yIGNvdW50ZXIgZW5hYmxlZCAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhciAqXyBwYl9JbnRlcnJ1cHRFbmFibGUgOiBFbmFibGUgb3IgZGlzYWJsZSB0aGUgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvciBjb3VudGVyIGludGVycnVwdC4gICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQVBDSTE3MTBfRU5BQkxFOiAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFbmFibGUgdGhlIHRvciBjb3VudGVyICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludGVycnVwdCAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQVBDSTE3MTBfRElTQUJMRTogICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEaXNhYmxlIHRoZSB0b3IgY291bnRlciAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludGVycnVwdAotCXBiX1RpbWluZ1VuaXQJCT0JKHVuc2lnbmVkIGNoYXIgKikgJmRhdGFbMF07Ci0JcHVsX1RpbWluZ0ludGVydmFsCT0gICh1bnNpZ25lZCBpbnQgKikgJmRhdGFbMV07Ci0JcGJfSW5wdXRNb2RlCQk9CSh1bnNpZ25lZCBjaGFyICopICZkYXRhWzJdOwotCXBiX0V4dGVybkdhdGUJCT0JKHVuc2lnbmVkIGNoYXIgKikgJmRhdGFbM107Ci0JcGJfQ3ljbGVNb2RlCQk9CSh1bnNpZ25lZCBjaGFyICopICZkYXRhWzRdOwotCXBiX0VuYWJsZQkJCT0JKHVuc2lnbmVkIGNoYXIgKikgJmRhdGFbNV07Ci0JcGJfSW50ZXJydXB0RW5hYmxlCT0JKHVuc2lnbmVkIGNoYXIgKikgJmRhdGFbNl07Ci0gICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBSZXR1cm4gVmFsdWUgICAgICA6ICAwOiBObyBlcnJvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTE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gKGJfTW9kdWxOYnIgPCA0KSB7Ci0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqLwotCQkvKiBUZXN0IGlmIHRvciBjb3VudGVyICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCWlmICgoZGV2cHJpdi0+c19Cb2FyZEluZm9zLgotCQkJCWR3X01vbGR1bGVDb25maWd1cmF0aW9uW2JfTW9kdWxOYnJdICYKLQkJCQkweEZGRkYwMDAwVUwpID09IEFQQ0kxNzEwX1RPUl9DT1VOVEVSKSB7Ci0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkvKiBUZXN0IHRoZSB0b3IgY291bnRlciBzZWxlY3Rpb24gKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJaWYgKGJfVG9yQ291bnRlciA8PSAxKSB7Ci0KLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkvKiBUZXN0IGlmIHRvciBjb3VudGVyIGluaXRpYWxpc2VkICovCi0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQlkd19TdGF0dXMgPSBpbmwoZGV2cHJpdi0+c19Cb2FyZEluZm9zLgotCQkJCQl1aV9BZGRyZXNzICsgOCArICgxNiAqIGJfVG9yQ291bnRlcikgKwotCQkJCQkoNjQgKiBiX01vZHVsTmJyKSk7Ci0KLQkJCQlpZiAoZHdfU3RhdHVzICYgMHgxMCkgewotCQkJCQkqcGJfRW5hYmxlID0gZHdfU3RhdHVzICYgMTsKLQotCQkgICAgLyoqKioqKioqKioqKioqKioqKioqLwotCQkJCQkvKiBHZXQgdGhlIGNvbW1hbmRvICovCi0JCSAgICAvKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJZHdfU3RhdHVzID0gaW5sKGRldnByaXYtPnNfQm9hcmRJbmZvcy4KLQkJCQkJCXVpX0FkZHJlc3MgKyA0ICsKLQkJCQkJCSgxNiAqIGJfVG9yQ291bnRlcikgKwotCQkJCQkJKDY0ICogYl9Nb2R1bE5icikpOwotCi0JCQkJCSpwYl9DeWNsZU1vZGUgPQotCQkJCQkJKHVuc2lnbmVkIGNoYXIpICgoZHdfU3RhdHVzID4+IDQpICYgMSk7Ci0JCQkJCSpwYl9JbnRlcnJ1cHRFbmFibGUgPQotCQkJCQkJKHVuc2lnbmVkIGNoYXIpICgoZHdfU3RhdHVzID4+IDUpICYgMSk7Ci0KLQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCS8qIFRlc3QgaWYgZXh0ZXJuIGdhdGUgdXNlZCBmb3IgY2xvY2sgb3IgZm9yIHNpZ25hbCBCICovCi0JCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCWlmIChkd19TdGF0dXMgJiAweDYwMCkgewotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJLyogVGVzdCBpZiBleHRlcm4gZ2F0ZSB1c2VkIGZvciBzaWduYWwgQiAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCQlpZiAoZHdfU3RhdHVzICYgMHg0MDApIHsKLQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJCS8qIFRlc3QgaWYgc2ltcGxlIG1vZGUgKi8KLQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCQkJaWYgKChkd19TdGF0dXMgJiAweDc4MDApCi0JCQkJCQkJCT09IDB4NzgwMCkgewotCQkJCQkJCQkqcGJfSW5wdXRNb2RlID0KLQkJCQkJCQkJCUFQQ0kxNzEwX1RPUl9TSU1QTEVfTU9ERTsKLQkJCQkJCQl9Ci0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sZWN0aW9uIGlzIHdyb25nICovCi0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCURQUklOVEsoIlRvciBjb3VudGVyIHNlbGVjdGlvbiBpcyB3cm9uZyBcbiIpOwotCQkJCWlfUmV0dXJuVmFsdWUgPSAtNDsKLQkJCX0JLyogIGlmIChiX1RvckNvdW50ZXIgPD0gMSkgKi8KLQkJfSBlbHNlIHsKLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogVGhlIG1vZHVsZSBpcyBub3QgYSB0b3IgY291bnRlciBtb2R1bGUgKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQlEUFJJTlRLKCJUaGUgbW9kdWxlIGlzIG5vdCBhIHRvciBjb3VudGVyIG1vZHVsZVxuIik7Ci0JCQlpX1JldHVyblZhbHVlID0gLTM7Ci0JCX0KLQl9IGVsc2UgewotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKi8KLQkJLyogTW9kdWxlIG51bWJlciBlcnJvciAqLwotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQlEUFJJTlRLKCJNb2R1bGUgbnVtYmVyIGVycm9yXG4iKTsKLQkJaV9SZXR1cm5WYWx1ZSA9IC0yOwotCX0KLQotCXJldHVybiBpX1JldHVyblZhbHVlOwotfQotCi0vKgotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IEZ1bmN0aW9uIE5hbWUgICAgIDogX0lOVF8gaV9BUENJMTcxMF9SZWFkVG9yQ291bnRlclZhbHVlICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHVuc2lnbmVkIGNoYXJfICAgICBiX0JvYXJkSGFuZGxlLCAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICAgIGJfTW9kdWxOYnIsICAgICAgICAgICAgICAgICAgICAgICB8Ci18CQkJCSB1bnNpZ25lZCBjaGFyXyAgICAgYl9Ub3JDb3VudGVyLCAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGludF8gICAgdWlfVGltZU91dCwgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyICpfICAgcGJfVG9yQ291bnRlclN0YXR1cywgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQVUxPTkdfIHB1bF9Ub3JDb3VudGVyVmFsdWUpICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBUYXNrICAgICAgICAJY2FzZSBBUENJMTcxMF9UT1JfR0VUUFJPR1JFU1NTVEFUVVM6IFJldHVybiB0aGUgdG9yIGNvdW50ZXIKLShiX1RvckNvdW50ZXIpIHN0YXR1cyAocGJfVG9yQ291bnRlclN0YXR1cykgZnJvbSBzZWxlY3RlZCB0b3IgY291bnRlciAgICAgICAgfAotfAkJICAgICAgbW9kdWxlIChiX01vZHVsTmJyKS4KLQotCQkJCSBjYXNlIEFQQ0kxNzEwX1RPUl9HRVRDT1VOVEVSVkFMVUUgOgotICBSZXR1cm4gdGhlIHRvciBjb3VudGVyIChiX1RvckNvdW50ZXIpIHN0YXR1cyAgICAgICAgICAgfAotfAkJICAgICAgKHBiX1RvckNvdW50ZXJTdGF0dXMpIGFuZCB0aGUgdGltaW5nIHZhbHVlICAgICAgICAgICAgI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0dXJuIHRoZSB0b3IgY291bnRlciAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzLiAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCA6IENvbnRpbmcgY3ljbGUgbm90IHN0YXJ0ZWR8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU29mdHdhcmUgZ2F0ZSBub3Qgc2V0LiAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgOiBDb250aW5nIGN5Y2xlIHN0YXJ0ZWQuICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNvZnR3YXJlIGdhdGUgc2V0LiAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyIDogQ29udGluZyBjeWNsZSBzdG9wcGVkLiAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUaGUgY29udGluZyBjeWNsZSBpcyAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlcm1pbmF0ZS4gICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzIDogQSBvdmVyZmxvdyBvY2N1ci4gWW91ICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtdXN0IGNoYW5nZSB0aGUgYmFzZSAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWluZyB3aXRjaCB0aGUgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImlfQVBDSTE3MTBfSW5pdFRvckNvdW50ZXIifAotfAkJCQkJCTQgOiBUaW1lZW91dCBvY2N1ciAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGludCAqICBwdWxfVG9yQ291bnRlclZhbHVlICA6IFRvciBjb3VudGVyIHZhbHVlLgotCXBiX1RvckNvdW50ZXJTdGF0dXM9KHVuc2lnbmVkIGNoYXIgKikgJmRhdGFbMF07Ci0JcHVsX1RvckNvdW50ZXJWYWx1ZT0odW5zaWduZWQgaW50ICopICZkYXRhWzFdOyAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgUmV0dXJuIFZhbHVlICAgICAgOiAgMDogTm8gZXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC0xOiBUaGUgaGFuZGxlIHBhcmFtZXRlciBvZiB0aGUgYm9hcmQgaXMgd3JvbmcgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTI6IE1vZHVsZSBzZWxlY3Rpb24gd3JvbmcgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAtMzogVGhlIG1vZHVsZSBpcyBub3QgYSB0b3IgY291bnRlciBtb2R1bGUgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIC00OiBUb3IgY291bnRlciBzZWxlY3Rpb24gaXMgd3JvbmcgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgLTU6IFRvciBjb3VudG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ludGVycnVwdFBhcmFtZXRlcnMudWlfUmVhZF0udWxfT2xkSW50ZXJydXB0TWFzazsKLQkJZGF0YVsyXSA9IGRldnByaXYtPnNfSW50ZXJydXB0UGFyYW1ldGVycy4KLQkJCXNfRklGT0ludGVycnVwdFBhcmFtZXRlcnNbZGV2cHJpdi0+Ci0JCQlzX0ludGVycnVwdFBhcmFtZXRlcnMudWlfUmVhZF0udWxfT2xkQ291bnRlckxhdGNoVmFsdWU7Ci0KLQkJCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJLyogSW5jcmVtZW50IHRoZSByZWFkIEZJRk8gKi8KLQkJCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJZGV2cHJpdi0+Ci0JCQlzX0ludGVycnVwdFBhcmFtZXRlcnMuCi0JCQl1aV9SZWFkID0gKGRldnByaXYtPgotCQkJc19JbnRlcnJ1cHRQYXJhbWV0ZXJzLgotCQkJdWlfUmVhZCArIDEpICUgQVBDSTE3MTBfU0FWRV9JTlRFUlJVUFQ7Ci0KLQkJcmV0dXJuIGluc24tPm47Ci0JfQotCi0JaWYgKGJfTW9kdWxOYnIgPCA0KSB7Ci0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqLwotCQkvKiBUZXN0IGlmIHRvciBjb3VudGVyICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCWlmICgoZGV2cHJpdi0+c19Cb2FyZEluZm9zLgotCQkJCWR3X01vbGR1bGVDb25maWd1cmF0aW9uW2JfTW9kdWxOYnJdICYKLQkJCQkweEZGRkYwMDAwVUwpID09IEFQQ0kxNzEwX1RPUl9DT1VOVEVSKSB7Ci0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkvKiBUZXN0IHRoZSB0b3IgY291bnRlciBzZWxlY3Rpb24gKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJaWYgKGJfVG9yQ291bnRlciA8PSAxKSB7Ci0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogVGVzdCBpZiB0b3IgY291bnRlciBpbml0aWFsaXNlZCAqLwotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJZHdfU3RhdHVzID0gaW5sKGRldnByaXYtPnNfQm9hcmRJbmZvcy4KLQkJCQkJdWlfQWRkcmVzcyArIDggKyAoMTYgKiBiX1RvckNvdW50ZXIpICsKLQkJCQkJKDY0ICogYl9Nb2R1bE5icikpOwotCi0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkvKiBUZXN0IGlmIGNvdW50ZXIgaW5pdGlhbGlzZWQgKi8KLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJaWYgKGR3X1N0YXR1cyAmIDB4MTApIHsKLQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCS8qIFRlc3QgaWYgY291bnRlciBlbmFibGVkICovCi0JCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCWlmIChkd19TdGF0dXMgJiAweDEpIHsKLQotCQkJCQkJc3dpdGNoIChiX1JlYWRUeXBlKSB7Ci0KLQkJCQkJCWNhc2UgQVBDSTE3MTBfVE9SX0dFVFBST0dSRVNTU1RBVFVTOgotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKiovCi0JCQkJCQkJLyogUmVhZCB0aGUgc3RhdHVzICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQkJCWR3X1N0YXR1cyA9Ci0JCQkJCQkJCWlubChkZXZwcml2LT4KLQkJCQkJCQkJc19Cb2FyZEluZm9zLgotCQkJCQkJCQl1aV9BZGRyZXNzICsgNCArCi0JCQkJCQkJCSgxNiAqIGJfVG9yQ291bnRlcikgKyAoNjQgKiBiX01vZHVsTmJyKSk7Ci0KLQkJCQkJCQlkd19TdGF0dXMgPQotCQkJCQkJCQlkd19TdGF0dXMgJiAweEY7Ci0KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKi8KLQkJCQkJCQkvKiBUZXN0IGlmIHN0YXJ0ICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJCQlpZiAoZHdfU3RhdHVzICYgMSkgewotCQkJCQkJCQlpZiAoZHdfU3RhdHVzICYKLQkJCQkJCQkJCTIpIHsKLQkJCQkJCQkJCWlmIChkd19TdGF0dXMgJiA0KSB7Ci0JCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCQkJCQkvKiBUb3IgY291bnRlciBvdmVyZmxvdyAqLwotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJCQkJCQkqcGJfVG9yQ291bnRlclN0YXR1cwotCQkJCQkJCQkJCQk9Ci0JCQkJCQkJCQkJCTM7Ci0JCQkJCQkJCQl9IGVsc2UgewotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCQkJCQkvKiBUb3IgY291bnRlciBzdGFydGVkICovCi0JCQkJLyoqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCQkJCQkJKnBiX1RvckNvdW50ZXJTdGF0dXMKLQkJCQkJCQkJCQkJPQotCQkJCQkJCQkJCQkyOwotCQkJCQkJCQkJfQotCQkJCQkJCQl9IGVsc2UgewotCQkJICAgICAvKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCQkJCQkvKiBUb3IgY291bnRlciBzdGFydGVkICovCi0JCQkgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQkJCQkJKnBiX1RvckNvdW50ZXJTdGF0dXMKLQkJCQkJCQkJCQk9Ci0JCQkJCQkJCQkJMTsKLQkJCQkJCQkJfQotCQkJCQkJCX0gZWxzZSB7Ci0JCQkgIC8qKioqKioqKioqKioqKioqKioqKio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lciBub3QgZW5hYmxlZCAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQkJRFBSSU5USygiVG9yIGNvdW50ZXIgbm90IGVuYWJsZWRcbiIpOwotCQkJCQkJaV9SZXR1cm5WYWx1ZSA9IC02OwotCQkJCQl9CS8qICBpZiAoZHdfU3RhdHVzICYgMHgxKSAqLwotCQkJCX0gZWxzZSB7Ci0JCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJLyogVG9yIGNvdW50ZXIgbm90IGluaXRpYWxpc2VkICovCi0JCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQlEUFJJTlRLKCJUb3IgY291bnRlciBub3QgaW5pdGlhbGlzZWRcbiIpOwotCQkJCQlpX1JldHVyblZhbHVlID0gLTU7Ci0JCQkJfQotCQkJfQkvKiAgaWYgKGJfVG9yQ291bnRlciA8PSAxKSAqLwotCQkJZWxzZSB7Ci0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkvKiBUb3IgY291bnRlciBzZWxlY3Rpb24gaXMgd3JvbmcgKi8KLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJRFBSSU5USygiVG9yIGNvdW50ZXIgc2VsZWN0aW9uIGlzIHdyb25nXG4iKTsKLQkJCQlpX1JldHVyblZhbHVlID0gLTQ7Ci0JCQl9CS8qICBpZiAoYl9Ub3JDb3VudGVyIDw9IDEpICovCi0JCX0gZWxzZSB7Ci0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCS8qIFRoZSBtb2R1bGUgaXMgbm90IGEgdG9yIGNvdW50ZXIgbW9kdWxlICovCi0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJRFBSSU5USygiVGhlIG1vZHVsZS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OSAoMCkgNzIyMy85NDkzLTkyICAgIHwgSW50ZXJuZXQgOiBodHRwOi8vd3d3LmFkZGktZGF0YS5jb20gICB8Ci0gICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSAgfCBQcm9qZWN0ICAgICA6IEFQSSBBUENJMTcxMCAgICB8IENvbXBpbGVyIDogZ2NjICAgICAgICAgICAgICAgICAgICAgICAgfAotICB8IE1vZHVsZSBuYW1lIDogVFRMLkMgICAgICAgICAgIHwgVmVyc2lvbiAgOiAyLjk2ICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSAgfCBQcm9qZWN0IG1hbmFnZXI6IEVyaWMgU3RvbHogICB8IERhdGUgICAgIDogIDAyLzEyLzIwMDIgICAgICAgICAgICAgICAgfAotICArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0gIHwgRGVzY3JpcHRpb24gOiAgIEFQQ0ktMTcxMCBUVEwgSS9PIG1vZHVsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVVBEQVRFUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0gIHwgICBEYXRlICAgfCAgIEF1dGhvciAgfCAgICAgICAgICBEZXNjcmlwdGlvbiBvZiB1cGRhdGVzICAgICAgICAgICAgICAgIHwKLSAgKy0tLS0tLS0tLS0rLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotICB8IDEzLzA1Lzk4IHwgUy4gV2ViZXIgIHwgVFRMIGRpZ2l0YWwgaW5wdXQgLyBvdXRwdXQgaW1wbGVtZW50YXRpb24gICAgICB8Ci0gIHwtLS0tLS0tLS0tfC0tLS0tLS0tLS0tfC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLXwKLSAgfCAwOC8wNS8wMCB8IEd1aW5vdCBDICB8IC0gMDQwMC8wMjI4IEFsbCBGdW5jdGlvbiBpbiBSSU5HIDAgICAgICAgICAgICAgfAotICB8ICAgICAgICAgIHwgICAgICAgICAgIHwgICBhdmFpbGFibGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSAgfCAgICAgICAgICB8ICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICB8ICAgICAgICAgIHwgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICstLS0tLS0tLS0tL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RhdGFbMV07Ci0JCWJfUG9ydEJNb2RlID0gKHVuc2lnbmVkIGNoYXIpIGRhdGFbMl07Ci0JCWJfUG9ydENNb2RlID0gKHVuc2lnbmVkIGNoYXIpIGRhdGFbM107Ci0JCWJfUG9ydERNb2RlCT0gKHVuc2lnbmVkIGNoYXIpIGRhdGFbNF07fAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IE91dHB1dCBQYXJhbWV0ZXJzIDogLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBSZXR1cm4gVmFsdWUgICAgICA6IDA6IE5vIGVycm9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtMTogVGhlIGhhbmRsZSBwYXJhbWV0ZXIgb2YgdGhlIGJvYXJkIGlzIHdyb25nICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC0yOiBUaGUgbW9kdWxlIHBhcmFtZXRlciBpcyB3cm9uZyAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTM6IFRoZSBtb2R1bGUgaXMgbm90IGEgVFRMIG1vZHVsZSAgICAgICAgICAgICAgICAgICAgICB8Ci18CQkgICAgIC00OiBGdW5jdGlvbiBub3QgYXZhaWxhYmxlIGZvciB0aGlzIHZlcnNpb24gICAgICAgICAgICAgfAotfAkJICAgICAtNTogUG9ydCBBIG1vZGUgc2VsZWN0aW9uIGlzIHdyb25nICAgICAgICAgICAgICAgICAgICAgIHwKLXwJCSAgICAgLTY6IFBvcnQgQ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qKioqKioqKioqKioqKioqKioqKioqLwotCS8qIFRlc3QgdGhlIG1vZHVsZSBudW1iZXIgKi8KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQlpZiAoYl9Nb2R1bE5iciA8IDQpIHsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCS8qIFRlc3QgaWYgVFRMIEkvTyBtb2R1bGUgKi8KLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJaWYgKChkZXZwcml2LT5zX0JvYXJkSW5mb3MuCi0JCQkJZHdfTW9sZHVsZUNvbmZpZ3VyYXRpb25bYl9Nb2R1bE5icl0gJgotCQkJCTB4RkZGRjAwMDBVTCkgPT0gQVBDSTE3MTBfVFRMX0lPKSB7Ci0JCQlzd2l0Y2ggKGJfSW5pdFR5cGUpIHsKLQkJCWNhc2UgQVBDSTE3MTBfVFRMX0lOSVQ6Ci0KLQkJCQlkZXZwcml2LT5zX01vZHVsZUluZm9bYl9Nb2R1bE5icl0uCi0JCQkJCXNfVFRMSU9JbmZvLmJfVFRMSW5pdCA9IDE7Ci0KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCS8qIFNldCBUVEwgcG9ydCBBIHRvIGlucHV0ICovCi0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCWRldnByaXYtPnNfTW9kdWxlSW5mb1tiX01vZHVsTmJyXS4KLQkJCQkJc19UVExJT0luZm8uYl9Qb3J0Q29uZmlndXJhdGlvblswXSA9IDA7Ci0KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCS8qIFNldCBUVEwgcG9ydCBCIHRvIGlucHV0ICovCi0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCWRldnByaXYtPnNfTW9kdWxlSW5mb1tiX01vZHVsTmJyXS4KLQkJCQkJc19UVExJT0luZm8uYl9Qb3J0Q29uZmlndXJhdGlvblsxXSA9IDA7Ci0KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCS8qIFNldCBUVEwgcG9ydCBDIHRvIGlucHV0ICovCi0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCWRldnByaXYtPnNfTW9kdWxlSW5mb1tiX01vZHVsTmJyXS4KLQkJCQkJc19UVExJT0luZm8uYl9Qb3J0Q29uZmlndXJhdGlvblsyXSA9IDA7Ci0KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkvKiBTZXQgVFRMIHBvcnQgRCB0byBvdXRwdXQgKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCWRldnByaXYtPnNfTW9kdWxlSW5mb1tiX01vZHVsTmJyXS4KLQkJCQkJc19UVExJT0luZm8uYl9Qb3J0Q29uZmlndXJhdGlvblszXSA9IDE7Ci0KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkvKiBTZXQgdGhlIGNvbmZpZ3VyYXRpb24gKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCW91dGwoMHg4LAotCQkJCQlkZXZwcml2LT5zX0JvYXJkSW5mb3MudWlfQWRkcmVzcyArIDIwICsKLQkJCQkJKDY0ICogYl9Nb2R1bE5icikpOwotCQkJCWJyZWFrOwotCi0JCQljYXNlIEFQQ0kxNzEwX1RUTF9JTklURElSRUNUSU9OOgotCi0JCQkJYl9Qb3J0QU1vZGUgPSAodW5zaWduZWQgY2hhcikgZGF0YVsxXTsKLQkJCQliX1BvcnRCTW9kZSA9ICh1bnNpZ25lZCBjaGFyKSBkYXRhWzJdOwotCQkJCWJfUG9ydENNb2RlID0gKHVuc2lnbmVkIGNoYXIpIGRhdGFbM107Ci0JCQkJYl9Qb3J0RE1vZGUgPSAodW5zaWduZWQgY2hhcikgZGF0YVs0XTsKLQotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKi8KLQkJCQkvKiBUZXN0IHRoZSB2ZXJzaW9uICovCi0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJaWYgKChkZXZwcml2LT5zX0JvYXJkSW5mb3MuCi0JCQkJCQlkd19Nb2xkdWxlQ29uZmlndXJhdGlvbgotCQkJCQkJW2JfTW9kdWxOYnJdICYgMHhGRkZGKSA+PQotCQkJCQkweDMyMzApIHsKLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCS8qIFRlc3QgdGhlIHBvcnQgQSBtb2RlICovCi0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCWlmICgoYl9Qb3J0QU1vZGUgPT0gMCkKLQkJCQkJCXx8IChiX1BvcnRBTW9kZSA9PSAxKSkgewotCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCS8qIFRlc3QgdGhlIHBvcnQgQiBtb2RlICovCi0JCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCQlpZiAoKGJfUG9ydEJNb2RlID09IDApCi0JCQkJCQkJfHwgKGJfUG9ydEJNb2RlID09IDEpKSB7Ci0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJCS8qIFRlc3QgdGhlIHBvcnQgQyBtb2RlICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCQkJaWYgKChiX1BvcnRDTW9kZSA9PSAwKQotCQkJCQkJCQl8fCAoYl9Qb3J0Q01vZGUKLQkJCQkJCQkJCT09IDEpKSB7Ci0JCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCQkJCS8qIFRlc3QgdGhlIHBvcnQgRCBtb2RlICovCi0JCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJCQkJaWYgKChiX1BvcnRETW9kZSA9PSAwKSB8fCAoYl9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S8qIFBvcnQgRCBtb2RlIHNlbGVjdGlvbiBpcyB3cm9uZyAqLwotCQkJICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQkJCQkJRFBSSU5USygiUG9ydCBEIG1vZGUgc2VsZWN0aW9uIGlzIHdyb25nXG4iKTsKLQkJCQkJCQkJCWlfUmV0dXJuVmFsdWUKLQkJCQkJCQkJCQk9Ci0JCQkJCQkJCQkJLTg7Ci0JCQkJCQkJCX0KLQkJCQkJCQl9IGVsc2UgewotCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCQkJLyogUG9ydCBDIG1vZGUgc2VsZWN0aW9uIGlzIHdyb25nICovCi0JCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCQkJCURQUklOVEsoIlBvcnQgQyBtb2RlIHNlbGVjdGlvbiBpcyB3cm9uZ1xuIik7Ci0JCQkJCQkJCWlfUmV0dXJuVmFsdWUgPQotCQkJCQkJCQkJLTc7Ci0JCQkJCQkJfQotCQkJCQkJfSBlbHNlIHsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJCS8qIFBvcnQgQiBtb2RlIHNlbGVjdGlvbiBpcyB3cm9uZyAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJCQlEUFJJTlRLKCJQb3J0IEIgbW9kZSBzZWxlY3Rpb24gaXMgd3JvbmdcbiIpOwotCQkJCQkJCWlfUmV0dXJuVmFsdWUgPSAtNjsKLQkJCQkJCX0KLQkJCQkJfSBlbHNlIHsKLQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJLyogUG9ydCBBIG1vZGUgc2VsZWN0aW9uIGlzIHdyb25nICovCi0JCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQkJRFBSSU5USygiUG9ydCBBIG1vZGUgc2VsZWN0aW9uIGlzIHdyb25nXG4iKTsKLQkJCQkJCWlfUmV0dXJuVmFsdWUgPSAtNTsKLQkJCQkJfQotCQkJCX0gZWxzZSB7Ci0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJLyogRnVuY3Rpb24gbm90IGF2YWlsYWJsZSBmb3IgdGhpcyB2ZXJzaW9uICovCi0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQlEUFJJTlRLKCJGdW5jdGlvbiBub3QgYXZhaWxhYmxlIGZvciB0aGlzIHZlcnNpb25cbiIpOwotCQkJCQlpX1JldHVyblZhbHVlID0gLTQ7Ci0JCQkJfQotCQkJCWJyZWFrOwotCi0JCQkJRFBSSU5USygiXG4iKTsKLQkJCWRlZmF1bHQ6Ci0JCQkJcHJpbnRrKCJCYWQgQ29uZmlnIFR5cGVcbiIpOwotCQkJfQkvKiAgc3dpdGNoIGVuZCAqLwotCQl9IGVsc2UgewotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogVGhlIG1vZHVsZSBpcyBub3QgYSBUVEwgbW9kdWxlICovCi0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCURQUklOVEsoIlRoZSBtb2R1bGUgaXMgbm90IGEgVFRMIG1vZHVsZVxuIik7Ci0JCQlpX1JldHVyblZhbHVlID0gLTM7Ci0JCX0KLQl9IGVsc2UgewotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKi8KLQkJLyogTW9kdWxlIG51bWJlciBlcnJvciAqLwotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQlEUFJJTlRLKCJNb2R1bGUgbnVtYmVyIGVycm9yXG4iKTsKLQkJaV9SZXR1cm5WYWx1ZSA9IC0yOwotCX0KLQotCXJldHVybiBpX1JldHVyblZhbHVlOwotfQotCi0vKgotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgIElOUFVUIEZVTkNUSU9OUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotKi8KLQotLyoKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBGdW5jdGlvbiBOYW1lICAgICA6IF9JTlRfICAgaV9BUENJMTcxMF9SZWFkVFRMSU9DaGFubmVsVmFsdWUgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHVuc2lnbmVkIGNoYXJfICAgICBiX0JvYXJkSGFuZGxlLCAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICAgIGJfTW9kdWxOYnIsICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgICAgYl9TZWxlY3RlZFBvcnQsICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfICAgICBiX0lucHV0Q2hhbm5lbCwgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhciAqXyAgIHB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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWd1cmUgKDAgdG8gNykgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfU2VsZWN0ZWRQb3J0LCAgICAgICA6IFNlbGVjdGlvbiBmcm9tIFRUTCBJL08gICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9ydCAoMCB0byAyKSAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIDogUG9ydCBBIHNlbGVjdGlvbiAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgOiBQb3J0IEIgc2VsZWN0aW9uICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMiA6IFBvcnQgQyBzZWxlY3Rpb24gIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzIDogUG9ydCBEIHNlbGVjdGlvbiAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfSW5wdXRDaGFubmVsICAgICAgICA6IFNlbGVjdGlvbiBmcm9tIGRpZ2l0YWwgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5wdXQgKCAwIHRvIDIpCi1BUENJMTcxMF9UVExfUkVBRENIQU5ORUwKLQliX01vZHVsTmJyCSAgPSBDUl9BUkVGKGluc24tPmNoYW5zcGVjKTsKLQliX1NlbGVjdGVkUG9ydD0gQ1JfUkFOR0UoaW5zbi0+Y2hhbnNwZWMpOwotCWJfSW5wdXRDaGFubmVsPSBDUl9DSEFOKGluc24tPmNoYW5zcGVjKTsKLQliX1JlYWRUeXBlCSAgPSAodW5zaWduZWQgY2hhcikgZGF0YVswXTsKLQotIEFQQ0kxNzEwX1RUTF9SRUFEUE9SVHwKLQliX01vZHVsTmJyCSAgPSBDUl9BUkVGKGluc24tPmNoYW5zcGVjKTsKLQliX1NlbGVjdGVkUG9ydD0gQ1JfUkFOR0UoaW5zbi0+Y2hhbnNwZWMpOwotCWJfUmVhZFR5cGUJICA9ICh1bnNpZ25lZCBjaGFyKSBkYXRhWzBdOwotCi0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgT3V0cHV0IFBhcmFtZXRlcnMgOiBkYXRhWzBdCi0KLQl1bnNpZ25lZCBjaGFyICpfICBwYl9DaGFubmVsU3RhdHVzICAgIDogRGlnaXRhbCBpbnB1dCBjaGFubmVsICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgOiBDaGFubmxlIGlzIG5vdCBhY3RpdmV8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSA6IENoYW5ubGUgaXMgYWN0aXZlICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBSZXR1cm4gVmFsdWUgICAgICA6IDA6IE5vIGVycm9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtMTogVGhlIGhhbmRsZSBwYXJhbWV0ZXIgb2YgdGhlIGJvYXJkIGlzIHdyb25nICAgICAgICAgIHwKLXwgIC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2hhcikgKAotCQkJCQkJCQkJKGR3X1N0YXR1c1JlZwotCQkJCQkJCQkJCT4+Ci0JCQkJCQkJCQkJKDggKiBiX1NlbGVjdGVkUG9ydCkpID4+IGJfSW5wdXRDaGFubmVsKSAmIDE7Ci0JCQkJCQkJfSBlbHNlIHsKLQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCQkJCS8qIFNlbGVjdGVkIFRUTCBJL08gcG9ydCBlcnJvciAqLwotCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQkJCQlEUFJJTlRLKCJTZWxlY3RlZCBUVEwgSS9PIHBvcnQgZXJyb3JcbiIpOwotCQkJCQkJCQlpX1JldHVyblZhbHVlID0KLQkJCQkJCQkJCS00OwotCQkJCQkJCX0KLQkJCQkJCX0gZWxzZSB7Ci0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJCS8qIFRUTCBJL08gbm90IGluaXRpYWxpc2VkICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJCQkJRFBSSU5USygiVFRMIEkvTyBub3QgaW5pdGlhbGlzZWRcbiIpOwotCQkJCQkJCWlfUmV0dXJuVmFsdWUgPSAtNjsKLQkJCQkJCX0KLQkJCQkJfSBlbHNlIHsKLQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJCS8qIFNlbGVjdGVkIGRpZ2l0YWwgaW5wdXQgZXJyb3IgKi8KLQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCQkJRFBSSU5USygiU2VsZWN0ZWQgZGlnaXRhbCBpbnB1dCBlcnJvclxuIik7Ci0JCQkJCQlpX1JldHVyblZhbHVlID0gLTU7Ci0JCQkJCX0KLQkJCQl9IGVsc2UgewotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQ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WlfUmV0dXJuVmFsdWUgPSBpbnNuLT5uOwotCXB1bF9Qb3J0VmFsdWUgPSAodW5zaWduZWQgaW50ICopICZkYXRhWzBdOwotCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCS8qIFRlc3QgdGhlIG1vZHVsZSBudW1iZXIgKi8KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQlpZiAoYl9Nb2R1bE5iciA8IDQpIHsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCS8qIFRlc3QgaWYgVFRMIEkvTyBtb2R1bGUgKi8KLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJaWYgKChkZXZwcml2LT5zX0JvYXJkSW5mb3MuCi0JCQkJZHdfTW9sZHVsZUNvbmZpZ3VyYXRpb25bYl9Nb2R1bE5icl0gJgotCQkJCTB4RkZGRjAwMDBVTCkgPT0gQVBDSTE3MTBfVFRMX0lPKSB7Ci0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCS8qIFRlc3QgaWYgdGhlIFRUTCBJL08gbW9kdWxlIGluaXRpYWxpc2VkICovCi0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJaWYgKGRldnByaXYtPgotCQkJCXNfTW9kdWxlSW5mb1tiX01vZHVsTmJyXS4KLQkJCQlzX1RUTElPSW5mby5iX1RUTEluaXQgPT0gMSkgewotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCS8qIFJlYWQgYWxsIGRpZ2l0YWwgaW5wdXQgKi8KLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCWR3X1N0YXR1c1JlZyA9IGlubChkZXZwcml2LT5zX0JvYXJkSW5mb3MuCi0JCQkJCXVpX0FkZHJlc3MgKyAoNjQgKiBiX01vZHVsTmJyKSk7Ci0KLQkJIC8qKioqKioqKio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0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IEZ1bmN0aW9uIE5hbWUgICAgIDogX0lOVF8gaV9BUENJMTcxMF9TZXRUVExJT0NobE9uICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHVuc2lnbmVkIGNoYXJfICAgICAgICAgICBiX0JvYXJkSGFuZGxlLCAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhcl8gICAgICAgICAgIGJfTW9kdWxOYnIsICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyAgICAgICAgICAgYl9PdXRwdXRDaGFubmVsKQotaW50IGlfQVBDSTE3MTBfSW5zbldyaXRlU2V0VFRMSU9DaGxPbk9mZihzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2LHN0cnVjdCBjb21lZGlfc3ViZGV2aWNlICpzLAotCXN0cnVjdCBjb21lZGlfaW5zbiAqaW5zbix1bnNpZ25lZCBpbnQgKmRhdGEpICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgVGFzayAgICAgICAgICAgICAgOiBTZXRzIG9yIHJlc2V0cyAgdGhlIG91dHB1dCB3aXRjaCBoYXMgYmVlbiBwYXNzZWQgd2l0aCB0aGUgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgcGFyYW1ldGVyIGJfQ2hhbm5lbC4gU2V0dGluZyBhbiBvdXRwdXQgbWVhbnMgc2V0dGluZyAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBhbiBvdXB1dCBoaWdoLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IElucHV0IFBhcmFtZXRlcnMgIDogdW5zaWduZWQgY2hhcl8gYl9Cb2FyZEhhbmRsZSAgIDogSGFuZGxlIG9mIGJvYXJkIEFQQ0ktMTcxMCAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyXyBiX01vZHVsTmJyICAgICAgOiBTZWxlY3RlZCBtb2R1bGUgbnVtYmVyICgwIHRvIDMpfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXJfIGJfT3V0cHV0Q2hhbm5lbCA6IFNlbGVjdGlvbiBmcm9tIGRpZ2l0YWwgb3V0cHV0ICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhbm5lbCAoMCBvciAxKSAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgOiBQRDAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgICAgICA6IFBEMSAgICAgICAgICAgICAgICB8Ci18CQkJCQkJIDIgdG8gOSA6IFBBICAgICAgICAgICAgICAgICB8Ci18CQkJCQkJMTAgdG8gMTc6IFBCICAgICAgICAgICAgICAgICB8Ci18CQkJCQkJMTggdG8gMjU6IFBDICAgICAgICAgICAgICAgICB8Ci0KLSAgYl9Nb2R1bE5icgkgICA9IENSX0FSRUYoaW5zbi0+Y2hhbnNwZWMpOwotCWJfT3V0cHV0Q2hhbm5lbD0gQ1JfQ0hBTihpbnNuLT5jaGFuc3BlYyk7Ci0JdWlfU3RhdGUJICAgPSBkYXRhWzBdOyAvKiAgT04gb3IgT0ZGICovCi0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgT3V0cHV0IFBhcmFtZXRlcnMgOiAtICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFJldHVybiBWYWx1ZSAgICAgIDogMDogTm8gZXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC0xOiBUaGUgaGFuZGxlIHBhcmFtZXRlciBvZiB0aGUgYm9hcmQgaXMgd3JvbmcgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTI6IFRoZSBtb2R1bGUgcGFyYW1ldGVyIGlzIHdyb25nICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAtMzogVGhlIG1vZHVsZSBpcyBub3QgYSBUVEwgSS9PIG1vZHVsZSAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgIC00OiBUaGUgc2VsZWN0ZWQgZGlnaXRhbCBvdXRwdXQgaXMgd3JvbmcgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgLTU6IFRUTCBJL08gbm90IGluaXRpYWxpc2VkIHNlZSBmdW5jdGlvbiAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgIiBpX0FQQ0kxNzEwX0luaXRUVExJTyIKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotKi8KLQotc3RhdGljIGludCBpX0FQQ0kxNzEwX0luc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sKLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogVGVzdCBpZiB0aGUgVFRMIEkvTyBtb2R1bGUgaW5pdGlhbGlzZWQgKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQlpZiAoZGV2cHJpdi0+c19Nb2R1bGVJbmZvW2JfTW9kdWxOYnJdLgotCQkJCXNfVFRMSU9JbmZvLmJfVFRMSW5pdCA9PSAxKSB7Ci0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogVGVzdCB0aGUgVFRMIEkvTyBjaGFubmVsIG51bWJlciAqLwotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQkJaWYgKCgoYl9PdXRwdXRDaGFubmVsIDw9IDEpCi0JCQkJCQkmJiAoKGRldnByaXYtPnNfQm9hcmRJbmZvcy4KLQkJCQkJCQkJZHdfTW9sZHVsZUNvbmZpZ3VyYXRpb24KLQkJCQkJCQkJW2JfTW9kdWxOYnJdICYKLQkJCQkJCQkJMHhGRkZGKSA9PQotCQkJCQkJCTB4MzEzMCkpCi0JCQkJCXx8ICgoYl9PdXRwdXRDaGFubmVsIDw9IDI1KQotCQkJCQkJJiYgKChkZXZwcml2LT5zX0JvYXJkSW5mb3MuCi0JCQkJCQkJCWR3X01vbGR1bGVDb25maWd1cmF0aW9uCi0JCQkJCQkJCVtiX01vZHVsTmJyXSAmCi0JCQkJCQkJCTB4RkZGRikgPj0KLQkJCQkJCQkweDMyMzApKSkgewotCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCS8qIFRlc3QgaWYgdGhlIHNlbGVjdGVkIGNoYW5uZWwgaXMgYSBvdXRwdXQgY2hhbm5lbCAqLwotCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioq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ioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJCQkvKiBTZXQgdGhlIG5ldyBvdXRwdXQgdmFsdWUgKi8KLQkJCSAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJCQkJb3V0bChkd19TdGF0dXNSZWcsIGRldnByaXYtPnNfQm9hcmRJbmZvcy51aV9BZGRyZXNzICsgOCArICgoYl9PdXRwdXRDaGFubmVsIC8gOCkgKiA0KSArICg2NCAqIGJfTW9kdWxOYnIpKTsKLQkJCQkJCQl9Ci0JCQkJCQl9Ci0JCQkJCX0gZWxzZSB7Ci0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCQkJLyogVGhlIHNlbGVjdGVkIFRUTCBvdXRwdXQgaXMgd3JvbmcgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJCURQUklOVEsoIiBUaGUgc2VsZWN0ZWQgVFRMIG91dHB1dCBpcyB3cm9uZ1xuIik7Ci0JCQkJCQlpX1JldHVyblZhbHVlID0gLTQ7Ci0JCQkJCX0KLQkJCQl9IGVsc2UgewotCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJLyogVGhlIHNlbGVjdGVkIFRUTCBvdXRwdXQgaXMgd3JvbmcgKi8KLQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJRFBSSU5USygiVGhlIHNlbGVjdGVkIFRUTCBvdXRwdXQgaXMgd3JvbmdcbiIpOwotCQkJCQlpX1JldHVyblZhbHVlID0gLTQ7Ci0JCQkJfQotCQkJfSBlbHNlIHsKLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogVFRMIEkvTyBub3QgaW5pdGlhbGlzZWQgKi8KLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJ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LS0tKy0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSAgfCAgICAgICAgICB8ICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICB8ICAgICAgICAgIHwgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gIHwgICAgICAgICAgfCAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgKy0tLS0tLS0tLS0rLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotKi8KLQotI2RlZmluZSBDT01FRElfU1VCRF9UVExJTwkJMTEJLyogRGlnaXRhbCBJbnB1dCBPdXRwdXQgQnV0IFRUTCAqLwotI2RlZmluZSBDT01FRElfU1VCRF9QV00JCQkxMgkvKiBQdWxzZSB3aWR0aCBNZWFzdXJlbWVudCAqLwotI2RlZmluZSBDT01FRElfU1VCRF9TU0kJCQkxMwkvKiBTeW5jaHJvbm91cyBzZXJpYWwgaW50ZXJmYWNlICovCi0jZGVmaW5lIENPTUVESV9TVUJEX1RPUgkJCTE0CS8qIFRvciBjb3VudGVyICovCi0jZGVmaW5lIENPTUVESV9TVUJEX0NIUk9OTwkJMTUJLyogQ2hyb25vIG1ldGVyICovCi0jZGVmaW5lIENPTUVESV9TVUJEX1BVTFNFRU5DT0RFUgkxNgkvKiBQdWxzZSBFbmNvZGVyIElOUCBDUFQgKi8KLSNkZWZpbmUgQ09NRURJX1NVQkRfSU5DUkVNRU5UQUxDT1VOVEVSCTE3CS8qIEluY3JlbWVudGFsIENvdW50ZXIgKi8KLQotI2RlZmluZSBBUENJMTcxMF9CT0FSRF9OQU1FCQkiYXBjaTE3MTAiC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KioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogSW5jcmVtZW50IHRoZSB3cml0ZSBGSUZPICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCWRldnByaXYtPgotCQkJCQlzX0ludGVycnVwdFBhcmFtZXRlcnMuCi0JCQkJCXVpX1dyaXRlID0gKGRldnByaXYtPgotCQkJCQlzX0ludGVycnVwdFBhcmFtZXRlcnMuCi0JCQkJCXVpX1dyaXRlICsgMSkgJSBBUENJMTcxMF9TQVZFX0lOVEVSUlVQVDsKLQotCQkJCWJfSW50ZXJydXB0RmxhZyA9IDE7Ci0KLQkJCSAgICAgLyoqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogQ2FsbCB1c2VyIGZ1bmN0aW9uICovCi0JCQkgICAgIC8qKioqKioqKioqKioqKioqKioqKioqLwotCQkJCS8qIFNlbmQgYSBzaWduYWwgdG8gZnJvbSBrZXJuZWwgdG8gdXNlciBzcGFjZSAqLwotCQkJCXNlbmRfc2lnKFNJR0lPLCBkZXZwcml2LT50c2tfQ3VycmVudCwgMCk7Ci0KLQkJCX0JLyogIGlmICgodWxfODJYNTRJbnRlcnJ1cHRTdGF0dXMgJiAweDcpICE9IDApICovCi0JCX0JCS8qICA4Mlg1NCB0aW1lciAqLwotCi0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkvKiBUZXN0IGlmIGluY3JlbS4gY291bnRlciAqLwotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQlpZiAoKGRldnByaXYtPnNfQm9hcmRJbmZvcy4KLQkJCQlkd19Nb2xkdWxlQ29uZmlndXJhdGlvbltiX01vZHVsZUNwdF0gJgotCQkJCTB4RkZGRjAwMDBVTCkgPT0gQVBDSTE3MTBfSU5DUkVNRU5UQUxfQ09VTlRFUikgewotCi0JCQl1bF9JbnRlcnJ1cHRMYXRjaFJlZyA9IGlubChkZXZwcml2LT5zX0JvYXJ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uY3kgbWVhc3VyZW1lbnQgaW50ZXJydXB0ICovCi0JCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJaWYgKHVsX0ludGVycnVwdExhdGNoUmVnICYgMHgyMCkgewotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogUmVhZCB0aGUgc3RhdHVzICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCXVsX1N0YXR1c1JlZ2lzdGVyID0gaW5sKGRldnByaXYtPnNfQm9hcmRJbmZvcy4KLQkJCQkJdWlfQWRkcmVzcyArIDMyICsgKDY0ICogYl9Nb2R1bGVDcHQpKTsKLQotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKi8KLQkJCQkvKiBSZWFkIHRoZSB2YWx1ZSAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKi8KLQotCQkJCXVsX0xhdGNoUmVnaXN0ZXJWYWx1ZSA9Ci0JCQkJCWlubChkZXZwcml2LT5zX0JvYXJkSW5mb3MudWlfQWRkcmVzcyArCi0JCQkJCTI4ICsgKDY0ICogYl9Nb2R1bGVDcHQpKTsKLQotCQkJCXN3aXRjaCAoKHVsX1N0YXR1c1JlZ2lzdGVyID4+IDEpICYgMykgewotCQkJCWNhc2UgMDoKLQkJCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJLyogVGVzdCB0aGUgY291bnRlciBtb2RlICovCi0JCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQkJaWYgKChkZXZwcml2LT5zX01vZHVsZUluZm9bYl9Nb2R1bGVDcHRdLgotCQkJCQkJCXNfU2llbWVuc0NvdW50ZXJJbmZvLgotCQkJCQkJCXNfTW9kZVJlZ2lzdGVyLgotCQkJCQkJCXNfQnl0ZU1vZGVSZWdpc3Rlci4KLQkJCQkJCQliX01vZGVSZWdpc3RlcjEgJgotCQkJCQkJ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HVzZXIgZnVuY3Rpb24gKi8KLQkJCSAgICAgLyoqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogU2VuZCBhIHNpZ25hbCB0byBmcm9tIGtlcm5lbCB0byB1c2VyIHNwYWNlICovCi0JCQkJc2VuZF9zaWcoU0lHSU8sIGRldnByaXYtPnRza19DdXJyZW50LCAwKTsKLQotCQkJfQotCQl9CQkvKiAgSW5jcmVtZW50YWwgY291bnRlciAqLwotCi0JCSAvKioqKioqKioqKioqKioqLwotCQkvKiBUZXN0IGlmIENEQSAqLwotCQkgLyoqKioqKioqKioqKioqKi8KLQotCQlpZiAoKGRldnByaXYtPnNfQm9hcmRJbmZvcy4KLQkJCQlkd19Nb2xkdWxlQ29uZmlndXJhdGlvbltiX01vZHVsZUNwdF0gJgotCQkJCTB4RkZGRjAwMDBVTCkgPT0gQVBDSTE3MTBfQ0RBKSB7Ci0JCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogVGVzdCBpZiBDREEgZW5hYmxlIGFuZCBmdW5jdGlvbmFsaXR5IDAgKi8KLQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCWlmICgoZGV2cHJpdi0+c19Nb2R1bGVJbmZvW2JfTW9kdWxlQ3B0XS4KLQkJCQkJc19DREFNb2R1bGVJbmZvLgotCQkJCQliX0NEQUVuYWJsZSA9PSBBUENJMTcxMF9FTkFCTEUpCi0JCQkJJiYgKGRldnByaXYtPnNfTW9kdWxlSW5mb1tiX01vZHVsZUNwdF0uCi0JCQkJCXNfQ0RBTW9kdWxlSW5mby5iX0ZjdFNlbGVjdGlvbiA9PSAwKSkgewotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogR2V0IHRoZSBpbnRlcnJ1cHQgc3RhdHVzICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQ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0kxNzEwIENocm9ubyBJbnRlcnJ1cHRcbiIpOyAqLwotCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJLyogUmVhZCB0aGUgaW50ZXJydXB0IHN0YXR1cyAqLwotCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQl1bF9JbnRlcnJ1cHRMYXRjaFJlZyA9IGlubChkZXZwcml2LT5zX0JvYXJkSW5mb3MuCi0JCQkJdWlfQWRkcmVzcyArIDEyICsgKDY0ICogYl9Nb2R1bGVDcHQpKTsKLQotCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCS8qIFRlc3QgaWYgaW50ZXJydXB0IG9jY3VyICovCi0JCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0JCQlpZiAoKHVsX0ludGVycnVwdExhdGNoUmVnICYgMHg4KSA9PSAweDgpIHsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCS8qIENsZWFyIHRoZSBpbnRlcnJ1cHQgZmxhZyAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQkJCQlvdXRsKDAsIGRldnByaXYtPnNfQm9hcmRJbmZvcy4KLQkJCQkJdWlfQWRkcmVzcyArIDMyICsgKDY0ICogYl9Nb2R1bGVDcHQpKTsKLQotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkvKiBUZXN0IGlmIGNvbnRpbnVvdXMgbW9kZSAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCQkJCWlmIChwc19Nb2R1bGVJbmZvLT4KLQkJCQkJc19DaHJvbm9Nb2R1bGVJbmZvLgotCQkJCQliX0N5Y2xlTW9kZSA9PSBBUENJMTcxMF9FTkFCTEUpIHsKLQkJCSAgLyoqKioqKioqKioqKioqKioqKioqLwotCQkJCQkvKiBDbGVhciB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GludCBkYXMxNl9kb19pbnNuX2JpdHMoc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiwKKwkJCSAgICAgIHN0cnVjdCBjb21lZGlfc3ViZGV2aWNlICpzLAorCQkJICAgICAgc3RydWN0IGNvbWVkaV9pbnNuICppbnNuLAorCQkJICAgICAgdW5zaWduZWQgaW50ICpkYXRhKQoreworCXVuc2lnbmVkIGludCBtYXNrID0gZGF0YVswXTsKKwl1bnNpZ25lZCBpbnQgYml0cyA9IGRhdGFbMV07CisKKwlpZiAobWFzaykgeworCQlzLT5zdGF0ZSAmPSB+bWFzazsKKwkJcy0+c3RhdGUgfD0gKGJpdHMgJiBtYXNrKTsKKworCQlvdXRiKHMtPnN0YXRlLCBkZXYtPmlvYmFzZSArIERBUzE2X0RJT19SRUcpOworCX0KKworCWRhdGFbMV0gPSBzLT5zdGF0ZTsKKworCXJldHVybiBpbnNuLT5uOworfQorCitzdGF0aWMgaW50IGRhczE2X3Byb2JlKHN0cnVjdCBjb21lZGlfZGV2aWNlICpkZXYsIHN0cnVjdCBjb21lZGlfZGV2Y29uZmlnICppdCkKK3sKKwljb25zdCBzdHJ1Y3QgZGFzMTZfYm9hcmQgKmJvYXJkID0gY29tZWRpX2JvYXJkKGRldik7CisJaW50IGRpb2JpdHM7CisKKwkvKiBkaW9iaXRzIGluZGljYXRlcyBib2FyZHMgKi8KKwlkaW9iaXRzID0gaW5iKGRldi0+aW9iYXNlICsgREFTMTZfRElPX1JFRykgJiAweGYwOworCWlmIChib2FyZC0+aWQgIT0gZGlvYml0cykgeworCQlkZXZfZXJyKGRldi0+Y2xhc3NfZGV2LAorCQkJInJlcXVlc3RlZCBib2FyZCdzIGlkIGJpdHMgYXJlIGluY29ycmVjdCAoMHgleCAhPSAweCV4KVxuIiwKKwkJCWJvYXJkLT5pZCwgZGlvYml0cyk7CisJCXJldHVybiAtRUlOVkFMOworCX0KKworCXJldHVybiAwOworfQorCitzdGF0aWMgdm9pZCBkYXMxNl9yZXNldChzd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0cnVjdCBwY2lfZGV2ICpwZGV2LCBpbnQgZm91bmQpCiB7CiAgICAgaGR3X2luZm9fdCAqaGk7CmRpZmYgLS1naXQgYS9kcml2ZXJzL3N0YWdpbmcvY3h0MWUxL2xpbnV4LmMgYi9kcml2ZXJzL3N0YWdpbmcvY3h0MWUxL2xpbnV4LmMKaW5kZXggZTU4ODllZi4uMTQyNjkxYyAxMDA2NDQKLS0tIGEvZHJpdmVycy9zdGFnaW5nL2N4dDFlMS9saW51eC5jCisrKyBiL2RyaXZlcnMvc3RhZ2luZy9jeHQxZTEvbGludXguYwpAQCAtNTIsMTIgKzUyLDYgQEAKIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCi0jaWZkZWYgU0JFX0lOQ0xVREVfU1lNQk9MUwotI2RlZmluZSBTVEFUSUMKLSNlbHNlCi0jZGVmaW5lIFNUQVRJQyAgc3RhdGljCi0jZW5kaWYKLQogI2RlZmluZSBDSEFOTkFNRSAiaGRsYyIKIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCkBAIC0yODUsNyArMjc5LDcgQEAKIH0KIAogCi1TVEFUSUMgaW50CitzdGF0aWMgaW50CiBjaGFuX29wZW4gKHN0cnVjdCBuZXRfZGV2aWNlICpuZGV2KQogewogICAgIGhkbGNfZGV2aWNlICpoZGxjID0gZGV2X3RvX2hkbGMgKG5kZXYpOwpAQCAtMzA1LDcgKzI5OSw3IEBACiB9CiAKIAotU1RBVElDIGludAorc3RhdGljIGludAogY2hhbl9jbG9zZSAoc3RydWN0IG5ldF9kZXZpY2UgKm5kZXYpCiB7CiAgICAgaGRsY19kZXZpY2UgKmhkbGMgPSBkZXZfdG9faGRsYyAobmRldik7CkBAIC0zMTksMTQgKzMxMywxNCBAQAogfQogCiAKLVNUQVRJQyBpbn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wpAQCAtMzUsMTIgKzM1LDYgQEAKICNpbmNsdWRlICJwbWNjNC5oIgogI2luY2x1ZGUgIm11c3ljYy5oIgogCi0jaWZkZWYgU0JFX0lOQ0xVREVfU1lNQk9MUwotI2RlZmluZSBTVEFUSUMKLSNlbHNlCi0jZGVmaW5lIFNUQVRJQyAgc3RhdGljCi0jZW5kaWYKLQogI2RlZmluZSBzZF9maW5kX2NoYW4oY2ksY2gpICAgYzRfZmluZF9jaGFuKGNoKQogCiAKQEAgLTY1LDcgKzU5LDYgQEAKIHZvaWQgICAgICAgIG11c3ljY19iaF90eF9lb20obXBpX3QgKiwgaW50KTsKIGludCAgICAgICAgIG11c3ljY19jaGFuX3VwKGNpX3QgKiwgaW50KTsKIHN0YXR1c190IF9faW5pdCBtdXN5Y2NfaW5pdChjaV90ICopOwotU1RBVElDIHZvaWQgX19pbml0IG11c3ljY19pbml0X3BvcnQobXBpX3QgKik7CiB2b2lkICAgICAgICBtdXN5Y2NfaW50cl9iaF90YXNrbGV0KGNpX3QgKik7CiB2b2lkICAgICAgICBtdXN5Y2Nfc2Vydl9yZXEobXBpX3QgKiwgdV9pbnQzMl90KTsKIHZvaWQgICAgICAgIG11c3ljY191cGRhdGVfdGltZXNsb3RzKG1waV90ICopOwpAQCAtNzMsNyArNjYsNyBAQAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKICNpZiAxCi1TVEFUSUMgaW50CitzdGF0aWMgaW50CiBtdXN5Y2NfZHVtcF9yeGJ1ZmZlcl9yaW5nKG1jaF90ICpjaCwgaW50IGxvY2tpdCkKIHsKICAgICBzdHJ1Y3QgbWRlc2MgKm07CkBAIC0xMzksNyArMTMyLDcgQEAKICNlbmRpZgogCiAjaWYgMQotU1RBVElDIGludAorc3RhdGljIGludAogbXVzeWNjX2R1bXBfdHhidWZmZXJfcmluZyhtY2hfdCAqY2gsIGludCBsb2NraXQpCiB7CiAgICAg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ovCisJCQlsb25nICBwY2lidXM7CS8qIFBDSSBCVVMJCSovCisJCQljaGFyICAqcGNpYnVzc3RyOyAvKiBQQ0kgQlVTIGluIHN0cmluZyAqLworCQkJbG9uZyAgcGNpc2xvdDsJLyogUENJIFNMT1QJCSovCisJCQljaGFyICAqcGNpc2xvdHN0cjsgLyogUENJIFNMT1QgaW4gc3RyaW5nICovCisJCQljaGFyICBucG9ydDsJLyogTnVtYmVyIG9mIFBvcnRzCSovCisJCQljaGFyICAqaWQ7CS8qIHR0eSBpZAkJKi8KKwkJCWludCAgIHN0YXJ0OwkvKiBzdGFydCBvZiB0dHkgY291bnRpbmcgKi8KKwkJCWNoYXIgICptZXRob2Q7ICAvKiBJbnN0YWxsIG1ldGhvZCAgICAgICAqLworCQkJY2hhciAgdl90eXBlOworCQkJY2hhciAgdl9wb3J0OworCQkJY2hhciAgdl9hZGRyOworCQkJY2hhciAgdl9wY2lidXM7CisJCQljaGFyICB2X3BjaXNsb3Q7CisJCQljaGFyICB2X25wb3J0OworCQkJY2hhciAgdl9pZDsKKwkJCWNoYXIgIHZfc3RhcnQ7CisJCQljaGFyICB2X21ldGhvZDsKKwkJCWNoYXIgIGxpbmUxOworCQkJY2hhciAgbGluZTI7CisJCQljaGFyICBjb25jMTsgICAvKiB0b3RhbCBjb25jcyBpbiBsaW5lMSAqLworCQkJY2hhciAgY29uYzI7ICAgLyogdG90YWwgY29uY3MgaW4gbGluZTIgKi8KKwkJCWNoYXIgIG1vZHVsZTE7IC8qIHRvdGFsIG1vZHVsZXMgZm9yIGxpbmUxICovCisJCQljaGFyICBtb2R1bGUyOyAvKiB0b3RhbCBtb2R1bGVzIGZvciBsaW5lMiAqLworCQkJY2hhciAgKnN0YXR1czsgLyogY29uZmlnIHN0YXR1cyAqLworCQkJY2hhciAgKmRpbXN0YXR1czsJIC8qIFkvTiAqLworCQkJaW50ICAgc3RhdHVzX2luZGV4OyAvKiBmaWVsZCBwb2ludGVyICovCisJCX0gYm9hcmQ7CisK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QsIDB4MjAwMDAwKTsKKwkJaW91bm1hcChicmQtPnJlX21hcF9tZW1iYXNlKTsKKwkJQVBSKCgiZGdhcDogaW9yZW1hcCBJTyBtZW0gJWx4IGNhbm5vdCBiZSBtYXBwZWQuXG4iLAorCQkJYnJkLT5tZW1iYXNlICsgUENJX0lPX09GRlNFVCkpOworCQlyZXR1cm4gLUVOT01FTTsKKwl9CisKKwlEUFJfSU5JVCgoInJlbWFwcGVkIGlvOiAweCVwICByZW1hcHBlZCBtZW06IDB4JXBcbiIsCisJCWJyZC0+cmVfbWFwX3BvcnQsIGJyZC0+cmVfbWFwX21lbWJhc2UpKTsKKwlyZXR1cm4gMDsKK30KKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoKKyogRnVuY3Rpb246CisqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisqICAgIGRnYXBfcG9sbF9oYW5kbGVyCisqCisqIEF1dGhvcjoKKyoKKyogICAgU2NvdHQgSCBLaWxhdQorKiAgICAgICAKKyogUGFyYW1ldGVyczoKKyoKKyogICAgZHVtbXkgLS0gaWdub3JlZCAgICAgICAgICAgICAgICAgICAgCisqCisqIFJldHVybiBWYWx1ZXM6CisqCisqICAgIG5vbmUKKyoKKyogRGVzY3JpcHRpb246ICAgCisqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisqICAgIEFzIGVhY2ggdGltZXIgZXhwaXJlcywgaXQgZGV0ZXJtaW5lcyAoYSkgd2hldGhlciB0aGUgInRyYW5zbWl0IgorKiAgICB3YWl0ZXIgbmVlZHMgdG8gYmUgd29rZW4gdXAsIGFuZCAoYikgd2hldGhlciB0aGUgcG9sbGVyIG5lZWRzIHRvCisqICAgIGJlIHJlc2NoZWR1bGVkLgorKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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ludGVydmFsLgorCSAqLworCURHQVBfTE9DSyhkZ2FwX3BvbGxfbG9jaywgbG9ja19mbGFncyApOworCWRnYXBfcG9sbF90aW1lICs9ICBkZ2FwX2ppZmZpZXNfZnJvbV9tcyhkZ2FwX3BvbGxfdGljayk7CisKKwluZXdfdGltZSA9IGRnYXBfcG9sbF90aW1lIC0gamlmZmllczsKKworCWlmICgodWxvbmcpIG5ld190aW1lID49IDIgKiBkZ2FwX3BvbGxfdGljaykgeworCQlkZ2FwX3BvbGxfdGltZSA9IGppZmZpZXMgKyAgZGdhcF9qaWZmaWVzX2Zyb21fbXMoZGdhcF9wb2xsX3RpY2spOworCX0KKworCWRnYXBfcG9sbF90aW1lci5mdW5jdGlvbiA9IGRnYXBfcG9sbF9oYW5kbGVyOworCWRnYXBfcG9sbF90aW1lci5kYXRhID0gMDsKKwlkZ2FwX3BvbGxfdGltZXIuZXhwaXJlcyA9IGRnYXBfcG9sbF90aW1lOworCURHQVBfVU5MT0NLKGRnYXBfcG9sbF9sb2NrLCBsb2NrX2ZsYWdzICk7CisKKwlpZiAoIWRnYXBfcG9sbF9zdG9wKQorCQlhZGRfdGltZXIoJmRnYXBfcG9sbF90aW1lcik7Cit9CisKKworCisKKy8qCisgKiBkZ2FwX2ludHIoKQorICoKKyAqIERyaXZlciBpbnRlcnJ1cHQgaGFuZGxlci4KKyAqLworc3RhdGljIGlycXJldHVybl90IGRnYXBfaW50cihpbnQgaXJxLCB2b2lkICp2b2lkYnJkKQoreworCXN0cnVjdCBib2FyZF90ICpicmQgPSAoc3RydWN0IGJvYXJkX3QgKikgdm9pZGJyZDsKKworCWlmICghYnJkKSB7CisJCUFQUigoIlJlY2VpdmVkIGludGVycnVwdCAoJWQpIHdpdGggbnVsbCBib2FyZCBhc3NvY2lhdGVkXG4iLCBpcnEpKTsKKwkJcmV0dXJuIElSUV9OT05FOworCX0KKworCS8qCisJICogQ2hlY2sgdG8gbWFrZSBzdXJlIGl0cyBmb3IgdXMuCisJICovCisJaW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CisgKiBEcml2ZXIgaW5jbHVkZXMKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI2lmbmRlZiBfX0RHQVBfRFJJVkVSX0gKKyNkZWZpbmUgX19ER0FQX0RSSVZFUl9ICisKKyNpbmNsdWRlIDxsaW51eC92ZXJzaW9uLmg+CS8qIFRvIGdldCB0aGUgY3VycmVudCBMaW51eCB2ZXJzaW9uICovCisjaW5jbHVkZSA8bGludXgvdHlwZXMuaD4gICAgICAgIC8qIFRvIHBpY2sgdXAgdGhlIHZhcmlvbnMgTGludXggdHlwZXMgKi8KKyNpbmNsdWRlIDxsaW51eC90dHkuaD4gICAgICAgICAgLyogVG8gcGljayB1cCB0aGUgdmFyaW91cyB0dHkgc3RydWN0cy9kZWZpbmVzICovCisjaW5jbHVkZSA8bGludXgvaW50ZXJydXB0Lmg+ICAgIC8qIEZvciBpcnFyZXR1cm5fdCB0eXBlICovCisKKyNpbmNsdWRlICJkZ2FwX3R5cGVzLmgiICAgICAgICAgLyogQWRkaXRpb25hbCB0eXBlcyBuZWVkZWQgYnkgdGhlIERpZ2kgaGVhZGVyIGZpbGVzICovCisjaW5jbHVkZSAiZGlnaS5oIiAgICAgICAgICAgICAgIC8qIERpZ2kgc3BlY2lmaWMgaW9jdGwgaGVhZGVyICovCisjaW5jbHVkZSAiZGdhcF9rY29tcGF0LmgiICAgICAgIC8qIEtlcm5lbCAyLjQvMi42IGNvbXBhdCBpbmNsdWRlcyAqLworI2luY2x1ZGUgImRnYXBfc3lzZnMuaCIJCS8qIFN1cHBvcnQgZm9yIFNZU0ZTICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogRHJpdmVyIGRlZmluZXMKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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UFJPQ19DUkVBVElPTiwKKwlCT0FSRF9SRUFEWQorfTsKKworLyoKKyAqIEFsbCB0aGUgcG9zc2libGUgc3RhdGVzIHRoYXQgYSByZXF1ZXN0ZWQgY29uY2VudHJhdG9yIGltYWdlIGNhbiBiZSBpbi4KKyAqLworZW51bSB7CisJTk9fUEVORElOR19DT05DRU5UUkFUT1JfUkVRVUVTVFMgPSAwLAorCU5FRURfQ09OQ0VOVFJBVE9SLAorCVJFUVVFU1RFRF9DT05DRU5UUkFUT1IKK307CisKK2V4dGVybiBjaGFyICpkZ2FwX3N0YXRlX3RleHRbXTsKK2V4dGVybiBjaGFyICpkZ2FwX2RyaXZlcl9zdGF0ZV90ZXh0W107CisKKworLyogCisgKiBNb2RlbSBsaW5lIGNvbnN0YW50cyBhcmUgZGVmaW5lZCBhcyBtYWNyb3MgYmVjYXVzZSBEU1IgYW5kCisgKiBEQ0QgYXJlIHN3YXBhYmxlIHVzaW5nIHRoZSBkaXR0eSBhbHRwaW4gb3B0aW9uLgorICovCisjZGVmaW5lIERfQ0QoY2gpICAgICAgICBjaC0+Y2hfY2QgICAgICAgLyogQ2FycmllciBkZXRlY3QgICAgICAgKi8KKyNkZWZpbmUgRF9EU1IoY2gpICAgICAgIGNoLT5jaF9kc3IgICAgICAvKiBEYXRhIHNldCByZWFkeSAgICAgICAqLworI2RlZmluZSBEX1JUUyhjaCkgICAgICAgRE1fUlRTICAgICAgICAgIC8qIFJlcXVlc3QgdG8gc2VuZCAgICAgICovCisjZGVmaW5lIERfQ1RTKGNoKSAgICAgICBETV9DVFMgICAgICAgICAgLyogQ2xlYXIgdG8gc2VuZCAgICAgICAgKi8KKyNkZWZpbmUgRF9SSShjaCkgICAgICAgIERNX1JJICAgICAgICAgICAvKiBSaW5nIGluZGljYXRvciAgICAgICAqLworI2RlZmluZSBEX0RUUihjaCkgICAgICAgRE1fRFRSICAgICAgICAgIC8qIERhdGEgdGVybWluYWwgcmVhZHkgICovCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBTdHJ1Y3R1cmVzIGFuZCBjbG9zZWx5IHJlbGF0ZWQgZGVmaW5lcy4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworCisvKgorICogQSBzdHJ1Y3R1cmUgdG8gaG9sZCBhIHN0YXRpc3RpY3MgY291bnRlci4gIFdlIGFsc28KKyAqIGNvbXB1dGUgbW92aW5nIGF2ZXJhZ2VzIGZvciB0aGlzIGNvdW50ZXIuCisgKi8KK3N0cnVjdCBtYWNvdW50ZXIKK3sKKwl1MzIJCWNudDsJLyogVG90YWwgY291bnQgKi8KKwl1bG9uZwkJYWNjdW07CS8qIEFjdXVtdWxhdG9yIHBlciBwZXJpb2QgKi8KKwl1bG9uZwkJc21hOwkvKiBTaW1wbGUgbW92aW5nIGF2ZXJhZ2UgKi8KKwl1bG9uZwkJZW1hOwkvKiBFeHBvbmVudGlhbCBtb3ZpbmcgYXZlcmFnZSAqLworfTsKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqIAorICogRGV2aWNlIGZsYWcgZGVmaW5pdGlvbnMgZm9yIGJkX2ZsYWdzLgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNkZWZpbmUJQkRfRkVQNVBMVVMJMHgwMDAxICAgICAgICAgIC8qIFN1cHBvcnRzIEZFUDUgUGx1cyBjb21tYW5kcyAqLworI2RlZmluZSBCRF9IQVNfVlBECTB4MDAwMgkJLyogQm9hcmQgaGFzIFZQRCBpbmZvIGF2YWlsYWJsZSAqLworCisKKy8qCisgKglQZXItYm9hcmQgaW5mb3JtYXRpb24KKyAqLworc3Ryd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WQgaWYgYm9hcmQgaXMgZm91bmQgKi8KKworCXUxNgkJZHBhdHlwZTsJLyogVGhlIGJvYXJkICJ0eXBlIiwgYXMgZGVmaW5lZCBieSBEUEEgKi8KKwl1MTYJCWRwYXN0YXR1czsJLyogVGhlIGJvYXJkICJzdGF0dXMiLCBhcyBkZWZpbmVkIGJ5IERQQSAqLworCXdhaXRfcXVldWVfaGVhZF90IGttZV93YWl0OwkvKiBOZWVkZWQgZm9yIERQQSBzdXBwb3J0ICovCisKKwl1MzIJCWNvbmNfZGxfc3RhdHVzOwkvKiBTdGF0dXMgb2YgYW55IHBlbmRpbmcgY29uYyBkb3dubG9hZCAqLworCS8qCisJICoJTWdtdCBkYXRhLgorCSAqLworICAgICAgICBjaGFyCQkqbXNnYnVmX2hlYWQ7CisgICAgICAgIGNoYXIJCSptc2didWY7Cit9OworCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAKKyAqIFVuaXQgZmxhZyBkZWZpbml0aW9ucyBmb3IgdW5fZmxhZ3MuCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2RlZmluZSBVTl9JU09QRU4JMHgwMDAxCQkvKiBEZXZpY2UgaXMgb3BlbgkJKi8KKyNkZWZpbmUgVU5fQ0xPU0lORwkweDAwMDIJCS8qIExpbmUgaXMgYmVpbmcgY2xvc2VkCQkqLworI2RlZmluZSBVTl9JTU0JCTB4MDAwNAkJLyogU2VydmljZSBpbW1lZGlhdGVseQkJKi8KKyNkZWZpbmUgVU5fQlVTWQkJMHgwMDA4CQkvKiBTb21lIHdvcmsgdGhpcyBjaGFubmVsCSovCisjZGVmaW5lIFVOX0JSRUFLSQkweDAwMTAJCS8qIElucHV0IGJyZWFrIHJlY2VpdmVkCQkqLworI2RlZmluZSBVTl9QV0FJVAkweDAwMjAJCS8qIFByaW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0IHR0eSBzdHJ1Y3R1cmUJKi8KKwl1MzIJdW5fZmxhZ3M7CS8qIFVuaXQgZmxhZ3MJCQkJKi8KKwl3YWl0X3F1ZXVlX2hlYWRfdCB1bl9mbGFnc193YWl0OyAvKiBQbGFjZSB0byBzbGVlcCB0byB3YWl0IG9uIHVuaXQgKi8KKwl1MzIJdW5fZGV2OwkJLyogTWlub3IgZGV2aWNlIG51bWJlcgkJCSovCisJdGNmbGFnX3QgdW5fb2ZsYWc7CS8qIG9mbGFncyBiZWluZyBkb25lIG9uIGJvYXJkCQkqLworCXRjZmxhZ190IHVuX2xmbGFnOwkvKiBsZmxhZ3MgYmVpbmcgZG9uZSBvbiBib2FyZAkJKi8KKwlzdHJ1Y3QgZGV2aWNlICp1bl9zeXNmczsKK307CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAKKyAqIERldmljZSBmbGFnIGRlZmluaXRpb25zIGZvciBjaF9mbGFncy4KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjZGVmaW5lIENIX1BST04gICAgICAgICAweDAwMDEgICAgICAgICAgLyogUHJpbnRlciBvbiBzdHJpbmcgICAgICAgICAgICAgICAgKi8KKyNkZWZpbmUgQ0hfT1VUICAgICAgICAgIDB4MDAwMiAgICAgICAgICAvKiBEaWFsLW91dCBkZXZpY2Ugb3BlbiAgICAgICAgICAgICAqLworI2RlZmluZSBDSF9TVE9QICAgICAgICAgMHgwMDA0ICAgICAgICAgIC8qIE91dHB1dCBpcyBzdG9wcGVkICAgICAgICAgICAgICAgICovCisjZGVmaW5lIENIX1NUT1BJICAgICAgICAweDAwMDggICAgICAgICAgLyogSW5wdXQgaXMgc3RvcHBlZCAgICAgICAgICAgICAgICAgKi8KKyNkZWZpbmUgQ0hfQ0QgICAgICAgICAgIDB4MDAxMCAgICAgICAgICAvKiBDYXJyaWVyIGlzIHByZXNlbnQgICAgICAgICAgICAgICAqLworI2RlZmluZSBDSF9GQ0FSICAgICAgICAgMHgwMDIwICAgICAgICAgIC8qIENhcnJpZXIgZm9yY2VkIG9uICAgICAgICAgICAgICAgICovCisKKyNkZWZpbmUgQ0hfUlhCTE9DSyAgICAgIDB4MDA4MCAgICAgICAgICAvKiBFbmFibGUgcnggYmxvY2tlZCBmbGFnICAgICAgICAgICAqLworI2RlZmluZSBDSF9XTE9XICAgICAgICAgMHgwMTAwICAgICAgICAgIC8qIFRlcm0gd2FpdGluZyBsb3cgZXZlbnQgICAgICAgICAgICovCisjZGVmaW5lIENIX1dFTVBUWSAgICAgICAweDAyMDAgICAgICAgICAgLyogVGVybSB3YWl0aW5nIGVtcHR5IGV2ZW50ICAgICAgICAgKi8KKyNkZWZpbmUgQ0hfUkVOQUJMRSAgICAgIDB4MDQwMCAgICAgICAgICAvKiBCdWZmZXIganVzdCBlbXB0aWVkICAgICAgICAgICovCisjZGVmaW5lIENIX1JBQ1RJVkUgICAgICAweDA4MDAgICAgICAgICAgLyogUHJvY2VzcyBhY3RpdmUgaW4geHhyZWFkKCkgICAqLworI2RlZmluZSBDSF9SV0FJVCAgICAgICAgMHgxMDAwICAgICAgICAgIC8qIFByb2Nlc3Mgd2FpdGluZyBpbiB4eHJlYWQoKSAgKi8KKyNkZWZpbmUgQ0hfQkFVRDAJMHgyMDAwCQkvKiBVc2VkIGZvciBjaGVja2luZyBCMCB0cmFuc2l0aW9ucyAqLworI2RlZmluZSBDSF9IQU5HVVAgICAgICAgMHg4MDAwCQkvKiBIYW5ndXAgcmVjZWl2ZWQgICAgICAgICAgICAgICAgICAqLworCisvKgorICogRGVmaW5pdGlvbnMgZm9yIGNoX3NuaWZmX2ZsYWdzCisgKi8KKyNkZWZpbmUgU05JRkZfT1BFTgkweDEKKyNkZWZpbmUgU05JRkZfV0FJVF9EQVRBCTB4MgorI2RlZmluZSBTTklGRl9XQUlUX1NQQUNFIDB4NAorCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogCisgKiBDaGFubmVsIGluZm9ybWF0aW9uIHN0cnVjdHVyZS4KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdHJ1Y3QgY2hhbm5lbF90IHsKKwlpbnQgbWFnaWM7CQkJLyogQ2hhbm5lbCBNYWdpYyBOdW1iZXIJCSovCisJc3RydWN0IGJzX3QJKmNoX2JzOwkJLyogQmFzZSBzdHJ1Y3R1cmUgcG9pbnRlciAgICAgICAqLworCXN0cnVjdCBjbV90CSpjaF9jbTsJCS8qIENvbW1hbmQgcXVldWUgcG9pbnRlciAgICAgICAgKi8KKwlzdHJ1Y3QgYm9hcmRfdCAqY2hfYmQ7CQkvKiBCb2FyZCBzdHJ1Y3R1cmUgcG9pbnRlciAgICAgICovCisJdW5zaWduZWQgY2hhciAqY2hfdmFkZHI7CS8qIEZFUCBtZW1vcnkgb3JpZ2luICAgICAgICAgICAgKi8KKwl1bnNpZ25lZCBjaGFyICpjaF90YWRkcjsJLyogV3JpdGUgYnVmZmVyIG9yaWdpbiAgICAgICAgICAqLworCXVuc2lnbmVkIGNoYXIgKmNoX3JhZGRyOwkvKiBSZWFkIGJ1ZmZlciBvcmlnaW4gICAgICAgICAgICovCisJc3RydWN0IGRpZ2lfdCAgY2hfZGlnaTsJCS8qIFRyYW5zcGFyZW50IFByaW50IHN0cnVjdHVyZSAgKi8KKwlzdHJ1Y3QgdW5fdCBjaF90dW47CQkvKiBUZXJtaW5hbCB1bml0IGluZm8gICAgICAgICAgICovCisJc3RydWN0IHVuX3QgY2hfcHVuOwkJLyogUHJpbnRlciB1bml0IGluZm8gICAgICAgICAgICAqLworCisJc3BpbmxvY2tfdAljaF9sb2NrOwkvKiBwcm92aWRlIGZvciBzZXJpYWxpemF0a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WNoX2Vycl9wYXJpdHk7CQkvKiBDb3VudCBvZiBwYXJpdHkgZXJyb3JzIG9uIGNoYW5uZWwJKi8KKwl1bG9uZwljaF9lcnJfZnJhbWU7CQkvKiBDb3VudCBvZiBmcmFtaW5nIGVycm9ycyBvbiBjaGFubmVsCSovCisJdWxvbmcJY2hfZXJyX2JyZWFrOwkJLyogQ291bnQgb2YgYnJlYWtzIG9uIGNoYW5uZWwJKi8KKwl1bG9uZwljaF9lcnJfb3ZlcnJ1bjsJCS8qIENvdW50IG9mIG92ZXJydW5zIG9uIGNoYW5uZWwJKi8KKworCXVpbnQgY2hfc25pZmZfaW47CisJdWludCBjaF9zbmlmZl9vdXQ7CisJY2hhciAqY2hfc25pZmZfYnVmOwkJLyogU25pZmYgYnVmZmVyIGZvciBwcm9jICovCisJdWxvbmcgY2hfc25pZmZfZmxhZ3M7CQkvKiBDaGFubmVsIGZsYWdzICAgICAgICAgICAgICAgICovCisJd2FpdF9xdWV1ZV9oZWFkX3QgY2hfc25pZmZfd2FpdDsKK307CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBQcm90b3R5cGVzIGZvciBub24tc3RhdGljIGZ1bmN0aW9ucyB1c2VkIGluIG1vcmUgdGhhbiBvbmUgbW9kdWxlCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK2V4dGVybiBpbnQJCWRnYXBfbXNfc2xlZXAodWxvbmcgbXMpOworZXh0ZXJuIHZvaWQJCSpkZ2FwX2RyaXZlcl9rem1hbGxvYyhzaXplX3Qgc2l6ZSwgaW50IHByaW9yaXR5KTsKK2V4dGVybiBjaGFyCQkqZGdhcF9pb2N0bF9uYW1lKGludCBjbWQpOworZXh0ZXJuIHZvaWQJCWRnYXBfZG9fYmlvc19sb2FkKHN0cnVjdCBib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PT09PT09CisgKgorICogICAgICB1c2VydG9ib2FyZCAtIGNvcHkgZnJvbSB1c2VyIHNwYWNlIHRvIGJvYXJkIHNwYWNlLgorICoKKyAqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworc3RhdGljIGludCBkZ2FwX3VzZXJ0b2JvYXJkKHN0cnVjdCBib2FyZF90ICpicmQsIGNoYXIgKnRvX2FkZHIsIGNoYXIgX191c2VyICpmcm9tX2FkZHIsIGludCBsZW4pCit7CisJY2hhciBidWZbVTJCU0laRV07CisJaW50IG4gPSBVMkJTSVpFOworCisJaWYgKCFicmQgfHwgYnJkLT5tYWdpYyAhPSBER0FQX0JPQVJEX01BR0lDKQorCQlyZXR1cm4oLUVGQVVMVCk7CisKKwl3aGlsZSAobGVuKSB7CisJCWlmIChuID4gbGVuKQorCQkJbiA9IGxlbjsKKworCQlpZiAoY29weV9mcm9tX3VzZXIoKGNoYXIgKikgJmJ1ZiwgZnJvbV9hZGRyLCBuKSA9PSAtMSApIHsKKwkJCXJldHVybigtRUZBVUxUKTsKKwkJfQorCisJCS8qIENvcHkgZGF0YSBmcm9tIGJ1ZmZlciB0byBjYXJkIG1lbW9yeSAqLworCQltZW1jcHlfdG9pbyh0b19hZGRyLCBidWYsIG4pOworCisJCS8qIGluY3JlbWVudCBjb3VudHMgKi8KKwkJbGVuIC09IG47CisJCXRvX2FkZHIgKz0gbjsKKwkJZnJvbV9hZGRyICs9IG47ICAgCisJCW4gPSBVMkJTSVpFOworICAgICAgICB9CisJcmV0dXJuKDApOworfQorCisKKy8qCisgKiBDb3BpZXMgdGhlIEJJT1MgY29kZSBmcm9tIHRoZSB1c2VyIHRvIHRoZSBib2FyZCwKKyAqIGFuZCBzdGFydHMgdGhlIEJJT1MgcnVubmluZy4KKyAqLwordm9pZCBkZ2FwX2RvX2Jpb3NfbG9hZChzdHJ1Y3QgYm9hcmRfdCAqYnJkLCB1Y2hhciBfX3VzZXIgKnViaW9zLCBpbnQgbGVuKQoreworCXVjaGFyICphZGRyOworCXVpbnQgb2Zmc2V0OworCWludCBpOworCisJaWYgKCFicmQgfHwgKGJyZC0+bWFnaWMgIT0gREdBUF9CT0FSRF9NQUdJQykgfHwgIWJyZC0+cmVfbWFwX21lbWJhc2UpCisJCXJldHVybjsKKworCURQUl9JTklUKCgiZGdhcF9kb19iaW9zX2xvYWQoKSBzdGFydFxuIikpOworCisJYWRkciA9IGJyZC0+cmVfbWFwX21lbWJhc2U7CisKKwkvKgorCSAqIGNsZWFyIFBPU1QgYXJlYQorCSAqLworCWZvciAoaSA9IDA7IGkgPCAxNjsgaSsrKQorCQl3cml0ZWIoMCwgYWRkciArIFBPU1RBUkVBICsgaSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorCS8qCisJICogRG93bmxvYWQgYmlvcworCSAqLworCW9mZnNldCA9IDB4MTAwMDsKKwlpZiAoZGdhcF91c2VydG9ib2FyZChicmQsIGFkZHIgKyBvZmZzZXQsIHViaW9zLCBsZW4pID09IC0xICkgeworCQlicmQtPnN0YXRlID0gQk9BUkRfRkFJTEVEOworCQlicmQtPmRwYXN0YXR1cyA9IEJEX05PRkVQOworCQlyZXR1cm47CisJfQorCisJd3JpdGVsKDB4MGJmMDA0MDEsIGFkZHIpOworCXdyaXRlbCgwLCAoYWRkciArIDQpKTsKKworCS8qIENsZWFyIHRoZSByZXNldCwgYW5kIGNoYW5nZSBzdGF0ZXMuICovCisJd3JpdGViKEZFUENMUiwgYnJkLT5yZV9tYXBfcG9ydCk7CisJYnJkLT5zdGF0ZSA9IFdBSVRfQklPU19MT0FEOworfQorCisKKy8qCisgKiBDaGVja3MgdG8gc2VlIGlmIHRoZSBCSU9TIGNvbXBsZXRlZCBydW5uaW5nIG9uIHRoZSBjYXJkLgorICovCitzdGF0aWMgdm9pZCBkZ2FwX2RvX3dhaXRfZm9yX2Jpb3Moc3RydWN0IGJvYXJkX3QgKmJyZCkK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3VzZWQpIHsKKwkJCXdyaXRldygxLCAoYmQtPnJlX21hcF9tZW1iYXNlICsgRU5BQkxFX0lOVFIpKTsKKwkJCS8qCisJCQkgKiBUZWxsIHRoZSBib2FyZCB0byBwb2xsIHRoZSBVQVJUUyBhcyBmYXN0IGFzIHBvc3NpYmxlLgorCQkJICovCisJCQl3cml0ZXcoRkVQUE9MTF9NSU4sIChiZC0+cmVfbWFwX21lbWJhc2UgKyBGRVBQT0xMKSk7CisJCQliZC0+aW50cl9ydW5uaW5nID0gMTsKKwkJfQorCisJCS8qIFdha2UgdXAgYW55b25lIHdhaXRpbmcgZm9yIGJvYXJkIHN0YXRlIHRvIGNoYW5nZSB0byByZWFkeSAqLworCQl3YWtlX3VwX2ludGVycnVwdGlibGUoJmJkLT5zdGF0ZV93YWl0KTsKKwl9CisKKwlER0FQX1VOTE9DSyhiZC0+YmRfbG9jaywgbG9ja19mbGFncyk7Cit9CisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICoKKyAqICAgICAgZGdhcF9jbWRiIC0gU2VuZHMgYSAyIGJ5dGUgY29tbWFuZCB0byB0aGUgRkVQLgorICoKKyAqICAgICAgICAgICAgICBjaCAgICAgIC0gUG9pbnRlciB0byBjaGFubmVsIHN0cnVjdHVyZS4KKyAqICAgICAgICAgICAgICBjbWQgICAgIC0gQ29tbWFuZCB0byBiZSBzZW50LgorICogICAgICAgICAgICAgIGJ5dGUxICAgLSBJbnRlZ2VyIGNvbnRhaW5pbmcgZmlyc3QgYnl0ZSB0byBiZSBzZW50LgorICogICAgICAgICAgICAgIGJ5dGUyICAgLSBJbnRlZ2VyIGNvbnRhaW5pbmcgc2Vjb25kIGJ5dGUgdG8gYmUgc2VudC4KKyAqICAgICAgICAgICAgICBuY21kcyAgIC0gV2FpdCB1bnRpbCBuY21kcyBvciBmZXdlciBjbWRzIGFyZSBsZWZ0CisgKiAgICAgICAgICAgICAgICAgICAgICAgIGluIHRoZSBjbWQgYnVmZmVyIGJlZm9yZSByZXR1cm5pbmcuCisgKgorICo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkIGRnYXBfY21kYihzdHJ1Y3QgY2hhbm5lbF90ICpjaCwgdWNoYXIgY21kLCB1Y2hhciBieXRlMSwgdWNoYXIgYnl0ZTIsIHVpbnQgbmNtZHMpCit7ICAgICAgICAgICAgICAgICAgICAgICAKKwljaGFyCQkqdmFkZHIgPSBOVUxMOworCXN0cnVjdCBjbV90CSpjbV9hZGRyID0gTlVMTDsKKwl1aW50CQljb3VudDsKKwl1aW50CQluOworCXUxNgkJaGVhZDsKKyAgICAgICAgdTE2CQl0YWlsOworCisJaWYgKCFjaCB8fCBjaC0+bWFnaWMgIT0gREdBUF9DSEFOTkVMX01BR0lDKQorCQlyZXR1cm47CisKKwkvKgorCSAqIENoZWNrIGlmIGJvYXJkIGlzIHN0aWxsIGFsaXZlLgorCSAqLworCWlmIChjaC0+Y2hfYmQtPnN0YXRlID09IEJPQVJEX0ZBSUxFRCkgeworCQlEUFJfQ09SRSgoIiVzOiVkIGJvYXJkIGlzIGluIGZhaWxlZCBzdGF0ZS5cbiIsIF9fRklMRV9fLCBfX0xJTkVfXykpOworCQlyZXR1cm47CisgICAgICAgIH0gICAgICAgICAgICAgICAKKworCS8qCisJICogTWFrZSBzdXJlIHRoZSBwb2ludGVycyBhcmUgaW4gcmFuZ2UgYmVmb3JlCisJICogd3JpdGluZyB0byB0aGUgRkVQIG1lbW9yeS4KKwkgKi8KKwl2YWRkciA9IGNoLT5jaF9iZC0+cmVfbWFwX21lbWJhc2U7CisKKwlpZiAoIXZhZGRyKQorCQlyZXR1cm47CisKKwljbV9hZGRyID0gKHN0cnVjdCBjbV90ICopICh2YWRkciArIENNREJVRik7CisJaGVhZCA9IHJlYWR3KCYoY21fYWRkci0+Y21faGVhZCkp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ZSBGRVAgZGVhZC4KKwkgKi8KKwlmb3IgKGNvdW50ID0gZGdhcF9jb3VudCA7OykgeworCisJCWhlYWQgPSByZWFkdygmKGNtX2FkZHItPmNtX2hlYWQpKTsKKwkJdGFpbCA9IHJlYWR3KCYoY21fYWRkci0+Y21fdGFpbCkpOworCisJCW4gPSAoaGVhZCAtIHRhaWwpICYgKENNRE1BWCAtIENNRFNUQVJUIC0gNCk7CisKKwkJaWYgKG4gPD0gbmNtZHMgKiBzaXplb2Yoc3RydWN0IGNtX3QpKQorCQkJYnJlYWs7CisKKwkJaWYgKC0tY291bnQgPT0gMCkgeworCQkJRFBSX0NPUkUoKCIlczolZCBmYWlsaW5nIGJvYXJkLlxuIixfX0ZJTEVfXywgX19MSU5FX18pKTsKKwkJCWNoLT5jaF9iZC0+c3RhdGUgPSBCT0FSRF9GQUlMRUQ7CisJCQlyZXR1cm47CisJCX0KKwkJdWRlbGF5KDEwKTsKKwl9ICAKK30KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKgorICogICAgICBkZ2FwX2NtZHcgLSBTZW5kcyBhIDEgd29yZCBjb21tYW5kIHRvIHRoZSBGRVAuCisgKiAgICAgIAorICogICAgICAgICAgICAgIGNoICAgICAgLSBQb2ludGVyIHRvIGNoYW5uZWwgc3RydWN0dXJlLgorICogICAgICAgICAgICAgIGNtZCAgICAgLSBDb21tYW5kIHRvIGJlIHNlbnQuCisgKiAgICAgICAgICAgICAgd29yZCAgICAtIEludGVnZXIgY29udGFpbmluZyB3b3JkIHRvIGJlIHNlbnQuCisgKiAgICAgICAgICAgICAgbmNtZHMgICAtIFdhaXQgdW50aWwgbmNtZHMgb3IgZmV3ZXIgY21kcyBhcmUgbGVmdAorICogICAgICAgICAgICAgICAgICAgICAgICBpbiB0aGUgY21kIGJ1ZmZlciBiZWZvcmUgcmV0dXJuaW5nLgorICoKKyAqPT09PT09PT09PT09P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5jbWRzICogc2l6ZW9mKHN0cnVjdCBjbV90KSkKKwkJCWJyZWFrOworCisJCWlmICgtLWNvdW50ID09IDApIHsKKwkJCURQUl9DT1JFKCgiJXM6JWQgRmFpbGluZyBib2FyZC5cbiIsX19GSUxFX18sIF9fTElORV9fKSk7CisJCQljaC0+Y2hfYmQtPnN0YXRlID0gQk9BUkRfRkFJTEVEOworCQkJcmV0dXJuOworCQl9CisJCXVkZWxheSgxMCk7CisJfSAgCit9CisKKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKgorICogICAgICBkZ2FwX2NtZHdfZXh0IC0gU2VuZHMgYSBleHRlbmRlZCB3b3JkIGNvbW1hbmQgdG8gdGhlIEZFUC4KKyAqICAgICAgCisgKiAgICAgICAgICAgICAgY2ggICAgICAtIFBvaW50ZXIgdG8gY2hhbm5lbCBzdHJ1Y3R1cmUuCisgKiAgICAgICAgICAgICAgY21kICAgICAtIENvbW1hbmQgdG8gYmUgc2VudC4KKyAqICAgICAgICAgICAgICB3b3JkICAgIC0gSW50ZWdlciBjb250YWluaW5nIHdvcmQgdG8gYmUgc2VudC4KKyAqICAgICAgICAgICAgICBuY21kcyAgIC0gV2FpdCB1bnRpbCBuY21kcyBvciBmZXdlciBjbWRzIGFyZSBsZWZ0CisgKiAgICAgICAgICAgICAgICAgICAgICAgIGluIHRoZSBjbWQgYnVmZmVyIGJlZm9yZSByZXR1cm5pbmcuCisgKgorICo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitzdGF0aWMgdm9pZCBkZ2FwX2NtZHdfZXh0KHN0cnVjdCBjaGFubmVsX3QgKmNoLCB1MTYgY21kLCB1MTYgd29yZCwgdWludCBuY21kcykKK3sKKwljaGFyCQkqdmFkZHIgPSBOVUxMOworCXN0cnVjdCBjbV90CSpjbV9hZGRyID0gTlV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yBvdXRsYW5kaXNoLCBkZWNsYXJlIHRoZSBGRVAgZGVhZC4KKwkgKi8KKwlmb3IgKGNvdW50ID0gZGdhcF9jb3VudCA7OykgeworCisJCWhlYWQgPSByZWFkdygmKGNtX2FkZHItPmNtX2hlYWQpKTsKKwkJdGFpbCA9IHJlYWR3KCYoY21fYWRkci0+Y21fdGFpbCkpOworCisJCW4gPSAoaGVhZCAtIHRhaWwpICYgKENNRE1BWCAtIENNRFNUQVJUIC0gNCk7CisKKwkJaWYgKG4gPD0gbmNtZHMgKiBzaXplb2Yoc3RydWN0IGNtX3QpKQorCQkJYnJlYWs7CisKKwkJaWYgKC0tY291bnQgPT0gMCkgeworCQkJRFBSX0NPUkUoKCIlczolZCBGYWlsaW5nIGJvYXJkLlxuIixfX0ZJTEVfXywgX19MSU5FX18pKTsKKwkJCWNoLT5jaF9iZC0+c3RhdGUgPSBCT0FSRF9GQUlMRUQ7CisJCQlyZXR1cm47CisJCX0KKwkJdWRlbGF5KDEwKTsKKwl9ICAKK30KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKgorICogICAgICBkZ2FwX3dtb3ZlIC0gV3JpdGUgZGF0YSB0byBGRVAgYnVmZmVyLgorICoKKyAqICAgICAgICAgICAgICBjaCAgICAgIC0gUG9pbnRlciB0byBjaGFubmVsIHN0cnVjdHVyZS4KKyAqICAgICAgICAgICAgICBidWYgICAgIC0gUG9pdGVyIHRvIGNoYXJhY3RlcnMgdG8gYmUgbW92ZWQuCisgKiAgICAgICAgICAgICAgY250ICAgICAtIE51bWJlciBvZiBjaGFyYWN0ZXJzIHRvIG1vdmUuCisgKgorICo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkIGRnYXBfd21vdmUoc3RydWN0IGNoYW5uZWxfdCAqY2gsIGNoYXIgKmJ1Z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biBpbiBuZXh0IHN0YXRlICovCisJCQkJY2gtPnBzY2FuX3NhdmVjaGFyID0gYzsKKwkJCQljaC0+cHNjYW5fc3RhdGUgPSAyOyAKKwkJCX0KKwkJCWJyZWFrOworCisJCWNhc2UgMjoKKwkJCS8qIHRoaXJkIGNoYXJhY3RlciBvZiBmZiBzZXF1ZW5jZSAqLworCisJCQkqY291dCsrID0gYzsKKworCQkJaWYgKGNoLT5wc2Nhbl9zYXZlY2hhciA9PSAweDApIHsKKworCQkJCWlmIChjID09IDB4MCkgeworCQkJCQlEUFJfUFNDQU4oKCJkZ2FwX3Bhcml0eV9zY2FuIGluIDNyZCBjaGFyIG9mIGZmIHNlcS4gYzogJXggc2V0dGluZyBicmVhay5cbiIsIGMpKTsKKwkJCQkJY2gtPmNoX2Vycl9icmVhaysrOworCQkJCQkqZm91dCsrID0gVFRZX0JSRUFLOworCQkJCX0KKwkJCQllbHNlIHsKKwkJCQkJRFBSX1BTQ0FOKCgiZGdhcF9wYXJpdHlfc2NhbiBpbiAzcmQgY2hhciBvZiBmZiBzZXEuIGM6ICV4IHNldHRpbmcgcGFyaXR5LlxuIiwgYykpOworCQkJCQljaC0+Y2hfZXJyX3Bhcml0eSsrOworCQkJCQkqZm91dCsrID0gVFRZX1BBUklUWTsKKwkJCQl9CisJCQl9CisJCQllbHNlIHsKKwkJCQlEUFJfUFNDQU4oKCIlczolZCBMb2dpYyBFcnJvci5cbiIsIF9fRklMRV9fLCBfX0xJTkVfXykpOworCQkJfQorCisJCQljb3VudCArPSAxOworCQkJY2gtPnBzY2FuX3N0YXRlID0gMDsKKwkJfSAgICAgICAKKwl9CisJKmxlbiA9IGNvdW50OworCURQUl9QU0NBTigoImRnYXBfcGFyaXR5X3NjYW4gZmluaXNoXG4iKSk7Cit9CisKKworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqCisgKiAgICAgIGRnYXBfZ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sYXRlciB2ZXJzaW9uLgorICoKKyAqIFRoaXMgcHJvZ3JhbSBpcyBkaXN0cmlidXRlZCBpbiB0aGUgaG9wZSB0aGF0IGl0IHdpbGwgYmUgdXNlZnVsLAorICogYnV0IFdJVEhPVVQgQU5ZIFdBUlJBTlRZLCBFWFBSRVNTIE9SIElNUExJRUQ7IHdpdGhvdXQgZXZlbiB0aGUKKyAqIGltcGxpZWQgd2FycmFudHkgb2YgTUVSQ0hBTlRBQklMSVRZIG9yIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUgorICogUFVSUE9TRS4gIFNlZSB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgZm9yIG1vcmUgZGV0YWlscy4KKyAqCisgKiBZb3Ugc2hvdWxkIGhhdmUgcmVjZWl2ZWQgYSBjb3B5IG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZQorICogYWxvbmcgd2l0aCB0aGlzIHByb2dyYW07IGlmIG5vdCwgd3JpdGUgdG8gdGhlIEZyZWUgU29mdHdhcmUKKyAqIEZvdW5kYXRpb24sIEluYy4sIDY3NSBNYXNzIEF2ZSwgQ2FtYnJpZGdlLCBNQSAwMjEzOSwgVVNBLgorICoKKyAqCU5PVEU6IFRISVMgSVMgQSBTSEFSRUQgSEVBREVSLiBETyBOT1QgQ0hBTkdFIENPRElORyBTVFlMRSEhIQorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogCisgKioqCUZFUCBWZXJzaW9uIDUgZGVwZW5kZW50IGRlZmluaXRpb25zCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjaWZuZGVmIF9fREdBUF9GRVA1X0gKKyNkZWZpbmUgX19ER0FQX0ZFUDVfSAorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAgICAgIEZFUCBtZW1vcnkgb2Zmc2V0cworICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNkZWZpbmUgU1RBUlQgICAgICAgICAgIDB4MDAwNEwgICAgICAgICAvKiBFeGVjdXRpb24gc3RhcnQgYWRkcmVzcyAgICAgICovCisKKyNkZWZpbmUgQ01EQlVGICAgICAgICAgIDB4MGQxMEwgICAgICAgICAvKiBDb21tYW5kIChjbV90KSBzdHJ1Y3R1cmUgb2Zmc2V0ICovCisjZGVmaW5lIENNRFNUQVJUICAgICAgICAweDA0MDBMICAgICAgICAgLyogU3RhcnQgb2YgY29tbWFuZCBidWZmZXIgICAgICAqLyAgIAorI2RlZmluZSBDTURNQVggICAgICAgICAgMHgwODAwTCAgICAgICAgIC8qIEVuZCBvZiBjb21tYW5kIGJ1ZmZlciAgICAgICAgKi8KKworI2RlZmluZSBFVkJVRiAgICAgICAgICAgMHgwZDE4TCAgICAgICAgIC8qIEV2ZW50IChldl90KSBzdHJ1Y3R1cmUgICAgICAgKi8KKyNkZWZpbmUgRVZTVEFSVCAgICAgICAgIDB4MDgwMEwgICAgICAgICAvKiBTdGFydCBvZiBldmVudCBidWZmZXIgICAgICAgICovCisjZGVmaW5lIEVWTUFYICAgICAgICAgICAweDBjMDBMICAgICAgICAgLyogRW5kIG9mIGV2ZW50IGJ1ZmZlciAgICAgICAgICAqLworI2RlZmluZSBGRVA1X1BMVVMgICAgICAgMHgwRTQwICAgICAgICAgIC8qIEFTQ0lJICc1JyBhbmQgQVNDSUkgJ0EnIGlzIGhlcmUgICovCisjZGVmaW5lIEVDU19TRUcgICAgICAgICAweDBFNDQgICAgICAgICAgLyogU2VnbWVudCBvZiB0aGUgZXh0ZW5kZWQgY2hhbm5lbCBzdHJ1Y3R1cmUgKi8KKyNkZWZpbmUgTElORV9TUEVFRCAgICAgIDB4MTAgICAgICAgICAgICAvKiBPZmZzZXQgaW50byBFQ1NfU0VHIGZvciBsaW5lIHNwZWVkICAgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpZiB0aGUgZmVwIGhhcyBleHRlbmRlZCBjYXBhYmlsaXRpZXMgKi8KKworLyogQklPUyBNQUdJQyBTUE9UUyAqLworI2RlZmluZSBFUlJPUiAgICAgICAgICAgMHgwQzE0TAkJLyogQklPUyBlcnJvciBjb2RlICAgICAgICAgICAgICAqLworI2RlZmluZSBTRVFVRU5DRQkweDBDMTJMCQkvKiBCSU9TIHNlcXVlbmNlIGluZGljYXRvciAgICAgICovCisjZGVmaW5lIFBPU1RBUkVBCTB4MEMwMEwJCS8qIFBPU1QgY29tcGxldGUgbWVzc2FnZSBhcmVhICAgKi8KKworLyogRkVQIE1BR0lDIFNQT1RTICovCisjZGVmaW5lIEZFUFNUQVQgICAgICAgICBQT1NUQVJFQSAgICAgICAgLyogT1MgaGVyZSB3aGVuIEZFUCBjb21lcyB1cCAgICAqLworI2RlZmluZSBOQ0hBTiAgICAgICAgICAgMHgwQzAyTCAgICAgICAgIC8qIG51bWJlciBvZiBwb3J0cyBGRVAgc2VlcyAgICAgKi8KKyNkZWZpbmUgUEFOSUMgICAgICAgICAgIDB4MEMxMEwgICAgICAgICAvKiBQQU5JQyBhcmVhIGZvciBGRVAgICAgICAgICAgICovCisjZGVmaW5lIEtNRU1FTSAgICAgICAgICAweDBDMzBMICAgICAgICAgLyogTWVtb3J5IGZvciBLTUUgdXNlICAgICAgICAgICAqLyAgIAorI2RlZmluZSBDT05GSUcgICAgICAgICAgMHgwQ0QwTCAgICAgICAgIC8qIENvbmNlbnRyYXRvciBjb25maWd1cmF0aW9uIGluZm8gKi8KKyNkZWZpbmUgQ09ORklHU0laRSAgICAgIDB4MDAzMCAgICAgICAgICAvKiBjb25maWd1cmF0aW9uIGluZm8gc2l6ZSAgICAgICovCisjZGVmaW5lIERPV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AkJLyogbWF4aW11bSBvZiAyMCBtaWxsaXNlY29uZHMgKi8KKyNkZWZpbmUgRkVQUE9MTAkJCTB4MGMyNgkJLyogRmVwIGV2ZW50IHBvbGwgaW50ZXJ2YWwgKi8gICAKKworI2RlZmluZQlJQUxUUElOCQkJMHgwMDgwCQkvKiBJbnB1dCBmbGFnIHRvIHN3YXAgRFNSIDwtPiBEQ0QgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAKKyAqIENvbW1hbmQgc3RydWN0dXJlIGRlZmluaXRpb24uCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RydWN0IGNtX3QgeworCXZvbGF0aWxlIHVuc2lnbmVkIHNob3J0IGNtX2hlYWQ7CS8qIENvbW1hbmQgYnVmZmVyIGhlYWQgb2Zmc2V0CSovCisJdm9sYXRpbGUgdW5zaWduZWQgc2hvcnQgY21fdGFpbDsJLyogQ29tbWFuZCBidWZmZXIgdGFpbCBvZmZzZXQJKi8KKwl2b2xhdGlsZSB1bnNpZ25lZCBzaG9ydCBjbV9zdGFydDsJLyogc3RhcnQgb2Zmc2V0IG9mIGJ1ZmZlcgkqLworCXZvbGF0aWxlIHVuc2lnbmVkIHNob3J0IGNtX21heDsJCS8qIGxhc3Qgb2Zmc2V0IG9mIGJ1ZmZlcgkqLworfTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogRXZlbnQgc3RydWN0dXJlIGRlZmluaXRpb24uCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RydWN0IGV2X3QgeworCXZvbGF0aWxlIHVuc2lnbmVkIHNob3J0IGV2X2hlYWQ7CS8q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QgZGF0YSAgICAgICAgICAgICAgICAqLworfTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAKKyAqIFBlciBjaGFubmVsIGJ1ZmZlciBzdHJ1Y3R1cmUKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICAgICAgICAgICAgICBCYXNlIFN0cnVjdHVyZSBFbnRyaWVzIFVzYWdlIE1lYW5pbmdzIHRvIEhvc3QgICAgICAgICAgICogCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIAorICogICAgICAgIFcgPSByZWFkIHdyaXRlICAgICAgICBSID0gcmVhZCBvbmx5ICAgICAgICAgICAgICAgICAgICAgICAgICAgKiAKKyAqICAgICAgICBDID0gY2hhbmdlZCBieSBjb21tYW5kcyBvbmx5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogCisgKiAgICAgICAgVSA9IHVua25vd24gKG1heSBiZSBjaGFuZ2VkIHcvbyBub3RpY2UpICAgICAgICAgICAgICAgICAgICAgICAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RydWN0IGJzX3QgeworCXZvbGF0aWxlIHVuc2lnbmVkIHNob3J0ICB0cF9qbXA7CS8qIFRyYW5zbWl0IHBvbGwganVtcAkJICovCisJdm9sYXRpbGUgdW5zaWduZWQgc2hvcnQgIHRjX2ptcDsJLyogQ29va2VkIHByb2NlZHVyZSBqdW1wCSAqLworCXZvbGF0aWxlIHVuc2lnbmVkIHNob3J0ICByaV9qbXA7CS8qIE5vdCBjdXJyZW50bHkgdXNlZAkJICovCisJdm9sYXRpbGUgdW5zaWduZWQgc2hvcnQgIHJwX2ptcDsJLyog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HB1dCBjaGFyYWN0ZXIgbWFzayAgICAqLworCisJdm9sYXRpbGUgdW5zaWduZWQgY2hhciAgIGJmaWxsWzEzXTsJLyogVSAgIFJlc2VydmVkIGZvciBleHBhbnNpb24gICAqLyAgCisKKwl2b2xhdGlsZSB1bnNpZ25lZCBjaGFyICAgc2NjWzE2XTsJLyogVSAgIFNDQyByZWdpc3RlcnMgICAgICAgICAgICAqLworfTsKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICAgCisgKiBGRVAgc3VwcG9ydGVkIGZ1bmN0aW9ucworICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNkZWZpbmUgU1JMT1cJCTB4ZTAJCS8qIFNldCByZWNlaXZlIGxvdyB3YXRlcgkqLworI2RlZmluZSBTUkhJR0gJCTB4ZTEJCS8qIFNldCByZWNlaXZlIGhpZ2ggd2F0ZXIJKi8KKyNkZWZpbmUgRkxVU0hUWAkJMHhlMgkJLyogRmx1c2ggdHJhbnNtaXQgYnVmZmVyCSovCisjZGVmaW5lIFBBVVNFVFgJCTB4ZTMJCS8qIFBhdXNlIGRhdGEgdHJhbnNtaXNzaW9uCSovCisjZGVmaW5lIFJFU1VNRVRYCTB4ZTQJCS8qIFJlc3VtZSBkYXRhIHRyYW5zbWlzc2lvbgkqLworI2RlZmluZSBTTUlOVAkJMHhlNQkJLyogU2V0IE1vZGVtIEludGVycnVwdAkJKi8KKyNkZWZpbmUgU0FGTE9XQwkJMHhlNgkJLyogU2V0IEF1eC4gZmxvdyBjb250cm9sIGNoYXJzCSovCisjZGVmaW5lIFNCUkVBSwkJMHhlOAkJLyogU2VuZCBicmVhawkJCSovCisjZGVmaW5lIFNNT0RFTQkJMHhlOQkJLyogU2V0IDg1MzAgbW9kZW0gY29udHJvbCBsaW5lcwkqLyAgCisjZGVmaW5l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GVmaW5lIE1PREVfNDIyCTB4MDEKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqIAorICogICAgICBFdmVudCBmbGFncy4KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjZGVmaW5lIElGQlJFQUsgICAgICAgICAweDAxICAgICAgICAgICAgLyogQnJlYWsgcmVjZWl2ZWQgICAgICAgICAgICAgICAqLyAgCisjZGVmaW5lIElGVExXICAgICAgICAgICAweDAyICAgICAgICAgICAgLyogVHJhbnNtaXQgbG93IHdhdGVyICAgICAgICAgICAqLworI2RlZmluZSBJRlRFTSAgICAgICAgICAgMHgwNCAgICAgICAgICAgIC8qIFRyYW5zbWl0dGVyIGVtcHR5ICAgICAgICAgICAgKi8KKyNkZWZpbmUgSUZEQVRBICAgICAgICAgIDB4MDggICAgICAgICAgICAvKiBSZWNlaXZlIGRhdGEgcHJlc2VudCAgICAgICAgICovCisjZGVmaW5lIElGTU9ERU0gICAgICAgICAweDIwICAgICAgICAgICAgLyogTW9kZW0gc3RhdHVzIGNoYW5nZSAgICAgICAgICAqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICAgCisgKiAgICAgIE1vZGVtIGZsYWdzCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworIyAgICAgICBkZWZpbmUgIERNX1JUUyAgICAgICAgICAweDAyICAgIC8qIFJlcXVlc3QgdG8gc2VuZCAgICAgICAgICAgICAgKi8KKyMgICAgICAgZGVmaW5lICBETV9DRCAgICAgICAgICAgMHg4MCAgICAvKiBDYXJyaWVyIGRldGVjdCAgICAgICAgICAgICAgICovCisjICAgICAgIGRlZmluZSAgRE1fRFNS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BUSElTIENPREUhIAorICoKKyAqCVRoaXMgaXMgc2hhcmVkIGNvZGUgYmV0d2VlbiBEaWdpJ3MgQ1ZTIGFyY2hpdmUgYW5kIHRoZQorICoJTGludXggS2VybmVsIHNvdXJjZXMuCisgKglDaGFuZ2luZyB0aGUgc291cmNlIGp1c3QgZm9yIHJlZm9ybWF0dGluZyBuZWVkbGVzc2x5IGJyZWFrcworICoJb3VyIENWUyBkaWZmIGhpc3RvcnkuCisgKgorICoJU2VuZCBhbnkgYnVnIGZpeGVzL2NoYW5nZXMgdG86ICBFbmcuTGludXggYXQgZGlnaSBkb3QgY29tLiAKKyAqCVRoYW5rIHlvdS4gCisgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogCisgKiBUaGlzIGZpbGUgaW1wbGVtZW50cyB0aGUgdHR5IGRyaXZlciBmdW5jdGlvbmFsaXR5IGZvciB0aGUKKyAqIEZFUDUgYmFzZWQgcHJvZHVjdCBsaW5lcy4KKyAqIAorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqICRJZDogZGdhcF90dHkuYyx2IDEuMyAyMDExLzA2LzIzIDEyOjExOjMxIG1hcmtoIEV4cCAkCisgKi8KKworI2luY2x1ZGUgPGxpbnV4L2tlcm5lbC5oPgorI2luY2x1ZGUgPGxpbnV4L3ZlcnNpb24uaD4KKyNpbmNsdWRlIDxsaW51eC9zY2hlZC5oPgkvKiBGb3IgamlmZmllcywgdGFzayBzdGF0ZXMgKi8KKyNpbmNsdWRlIDxsaW51eC9pbnRlcnJ1cHQuaD4JLyogRm9yIHRhc2tsZXQgYW5kIGludGVycnVwdCBzdHJ1Y3RzL2RlZmluZXMgKi8KKyNpbmNsdWRlIDxsaW51eC9tb2R1bGUuaD4KKyNpbmNsdWRlIDxsaW51eC9jdHlwZS5oP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GxlID0gZGdhcF90dHlfdW50aHJvdHRsZSwKKwkuaGFuZ3VwID0gZGdhcF90dHlfaGFuZ3VwLAorCS5wdXRfY2hhciA9IGRnYXBfdHR5X3B1dF9jaGFyLAorCS50aW9jbWdldCA9IGRnYXBfdHR5X3Rpb2NtZ2V0LAorCS50aW9jbXNldCA9IGRnYXBfdHR5X3Rpb2Ntc2V0LAorCS5icmVha19jdGwgPSBkZ2FwX3R0eV9zZW5kX2JyZWFrLAorCS53YWl0X3VudGlsX3NlbnQgPSBkZ2FwX3R0eV93YWl0X3VudGlsX3NlbnQsCisJLnNlbmRfeGNoYXIgPSBkZ2FwX3R0eV9zZW5kX3hjaGFyCit9OworCisKKworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICAgICAgICAgICAgICAgICAgICAgIAorICogVFRZIEluaXRpYWxpemF0aW9uL0NsZWFudXAgRnVuY3Rpb25zCisgKiAgICAgIAorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyAgICAgICAgIAorLyoKKyAqIGRnYXBfdHR5X3ByZWluaXQoKQorICoKKyAqIEluaXRpYWxpemUgYW55IGdsb2JhbCB0dHkgcmVsYXRlZCBkYXRhIGJlZm9yZSB3ZSBkb3dubG9hZCBhbnkgYm9hcmRzLgorICovCitpbnQgZGdhcF90dHlfcHJlaW5pdCh2b2lkKQoreworCXVuc2lnbmVkIGxvbmcgZmxhZ3M7CisKKwlER0FQX0xPQ0soZGdhcF9nbG9iYWxfbG9jaywgZmxhZ3MpOyAgCisKKwkvKgorCSAqIEFsbG9jYXRlIGEgYnVmZmVyIGZvciBkb2luZyB0aGUgY29weSBmcm9tIHVzZXIgc3BhY2UgdG8KKwkgKiBrZXJuZWwgc3BhY2UgaW4gZGdhcF9pbnB1dCgpLiAgV2Ugb25seSB1c2Ugb25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B3aGlsZSAodG9vX211Y2hfZGF0YSk7Cit9CisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICoKKyAqICAgICAgZGdhcF9pbnB1dCAtIFByb2Nlc3MgcmVjZWl2ZWQgZGF0YS4KKyAqIAorICogICAgICAgICAgICAgIGNoICAgICAgLSBQb2ludGVyIHRvIGNoYW5uZWwgc3RydWN0dXJlLgorICogCisgKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKwordm9pZCBkZ2FwX2lucHV0KHN0cnVjdCBjaGFubmVsX3QgKmNoKQoreworCXN0cnVjdCBib2FyZF90ICpiZDsKKwlzdHJ1Y3QgYnNfdAkqYnM7CisJc3RydWN0IHR0eV9zdHJ1Y3QgKnRwOworCXN0cnVjdCB0dHlfbGRpc2MgKmxkOworCXVpbnQJcm1hc2s7CisJdWludAloZWFkOworCXVpbnQJdGFpbDsKKwlpbnQJZGF0YV9sZW47CisJdWxvbmcJbG9ja19mbGFnczsKKwl1bG9uZyAgIGxvY2tfZmxhZ3MyOworCWludCBmbGlwX2xlbjsKKwlpbnQgbGVuID0gMDsKKwlpbnQgbiA9IDA7CisJdWNoYXIgKmJ1ZjsKKwl1Y2hhciB0bXBjaGFyOworCWludCBzID0gMDsKKworCWlmICghY2ggfHwgY2gtPm1hZ2ljICE9IERHQVBfQ0hBTk5FTF9NQUdJQykKKwkJcmV0dXJuOworCisJdHAgPSBjaC0+Y2hfdHVuLnVuX3R0eTsKKworCWJzICA9IGNoLT5jaF9iczsKKwlpZiAoIWJzKSB7CisJCXJldHVybjsKKwl9CisKKwliZCA9IGNoLT5jaF9iZDsKKwlpZighYmQgfHwgYmQtPm1hZ2ljICE9IERHQVBfQk9BUkRfTUFHSUMpCisJCXJldHVybjsKKworCURQUl9SRUFEKCgiZGdhcF9pbnB1dCBzdGFyd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W5fdHR5KTsKKwkJfQorCisJCWlmIChjaC0+Y2hfcHVuLnVuX29wZW5fY291bnQgPiAwKSB7IAorCQkJRFBSX0NBUlIoKCJTZW5kaW5nIHByIGhhbmd1cFxuIikpOworCQkJdHR5X2hhbmd1cChjaC0+Y2hfcHVuLnVuX3R0eSk7CisJCX0KKwl9CisKKwkvKgorCSAqICBNYWtlIHN1cmUgdGhhdCBvdXIgY2FjaGVkIHZhbHVlcyByZWZsZWN0IHRoZSBjdXJyZW50IHJlYWxpdHkuCisJICovCisJaWYgKHZpcnRfY2FycmllciA9PSAxKQorCQljaC0+Y2hfZmxhZ3MgfD0gQ0hfRkNBUjsKKwllbHNlICAgICAgCisJCWNoLT5jaF9mbGFncyAmPSB+Q0hfRkNBUjsKKworCWlmIChwaHlzX2NhcnJpZXIgPT0gMSkKKwkJY2gtPmNoX2ZsYWdzIHw9IENIX0NEOworCWVsc2UKKwkJY2gtPmNoX2ZsYWdzICY9IH5DSF9DRDsKK30KKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAgICAgIAorICogVFRZIEVudHJ5IHBvaW50cyBhbmQgaGVscGVyIGZ1bmN0aW9ucworICogICAgICAgICAgICAgIAorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyoKKyAqIGRnYXBfdHR5X29wZW4oKQorICoKKyAqLworc3RhdGljIGludCBkZ2FwX3R0eV9vcGVuKHN0cnVjdCB0dHlfc3RydWN0ICp0dHksIHN0cnVjdCBmaWxlICpmaWxlKQoreworCXN0cnVjdCBib2FyZF90CSpicmQ7CisJc3RydWN0IGNoYW5uZWxfdCAqY2g7CisJc3RydWN0IHVuX3QJKnVuOworCXN0cnVjdCBic190CSpiczsKKwl1aW50CQltYWpvciA9IDA7CisJdWludAkJbWlub3IgPSAwOworCWludAkJcmMgP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iLCBjb21tYW5kLCBhcmcpKTsKKworCXN3aXRjaCAoY29tbWFuZCkgeworCWNhc2UgVElPQ01CSVM6CisJCWlmIChhcmcgJiBUSU9DTV9SVFMpIHsKKwkJCWNoLT5jaF9tZm9yY2UgfD0gRF9SVFMoY2gpOworCQkJY2gtPmNoX212YWwgICB8PSBEX1JUUyhjaCk7CisgICAgICAgIAl9CisKKwkJaWYgKGFyZyAmIFRJT0NNX0RUUikgeworCQkJY2gtPmNoX21mb3JjZSB8PSBEX0RUUihjaCk7CisJCQljaC0+Y2hfbXZhbCAgIHw9IERfRFRSKGNoKTsKKyAgICAgICAgCX0KKworCQlicmVhazsKKworCWNhc2UgVElPQ01CSUM6CisJCWlmIChhcmcgJiBUSU9DTV9SVFMpIHsKKwkJCWNoLT5jaF9tZm9yY2UgfD0gRF9SVFMoY2gpOworCQkJY2gtPmNoX212YWwgICAmPSB+KERfUlRTKGNoKSk7CisgICAgICAgIAl9CisKKwkJaWYgKGFyZyAmIFRJT0NNX0RUUikgeworCQkJY2gtPmNoX21mb3JjZSB8PSBEX0RUUihjaCk7CisJCQljaC0+Y2hfbXZhbCAgICY9IH4oRF9EVFIoY2gpKTsKKyAgICAgICAgCX0KKworCQlicmVhazsKKworICAgICAgICBjYXNlIFRJT0NNU0VUOgorCQljaC0+Y2hfbWZvcmNlID0gRF9EVFIoY2gpfERfUlRTKGNoKTsKKworCQlpZiAoYXJnICYgVElPQ01fUlRTKSB7CisJCQljaC0+Y2hfbXZhbCB8PSBEX1JUUyhjaCk7CisgICAgICAgIAl9CisJCWVsc2UgeworCQkJY2gtPmNoX212YWwgJj0gfihEX1JUUyhjaCkpOworCQl9CisKKwkJaWYgKGFyZyAmIFRJT0NNX0RUUikgeworCQkJY2gtPmNoX212YWwgfD0gKERfRFRSKGNoKSk7CisgICAgICAgIAl9CisJCWVsc2UgeworCQkJY2gtPmNoX212YWwgJj0gfihEX0RUUihjaCkpOworCQl9CisKKwkJYnJlYWs7CisKKwlkZWZhdWx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+Y2hfdHVuLnVuX2ZsYWdzICYgKFVOX0xPV3xVTl9FTVBUWSkpIHsKKwkJY2gtPmNoX3R1bi51bl9mbGFncyAmPSB+KFVOX0xPV3xVTl9FTVBUWSk7CisJCXdha2VfdXBfaW50ZXJydXB0aWJsZSgmY2gtPmNoX3R1bi51bl9mbGFnc193YWl0KTsKKwl9CisJaWYgKGNoLT5jaF9wdW4udW5fZmxhZ3MgJiAoVU5fTE9XfFVOX0VNUFRZKSkgeworCQljaC0+Y2hfcHVuLnVuX2ZsYWdzICY9IH4oVU5fTE9XfFVOX0VNUFRZKTsKKwkJd2FrZV91cF9pbnRlcnJ1cHRpYmxlKCZjaC0+Y2hfcHVuLnVuX2ZsYWdzX3dhaXQpOworCX0KKworCURHQVBfVU5MT0NLKGNoLT5jaF9sb2NrLCBsb2NrX2ZsYWdzMik7CisJREdBUF9VTkxPQ0soYmQtPmJkX2xvY2ssIGxvY2tfZmxhZ3MpOworCWlmICh3YWl0cXVldWVfYWN0aXZlKCZ0dHktPndyaXRlX3dhaXQpKQorCQl3YWtlX3VwX2ludGVycnVwdGlibGUoJnR0eS0+d3JpdGVfd2FpdCk7CisJdHR5X3dha2V1cCh0dHkpOworCisJRFBSX0lPQ1RMKCgiZGdhcF90dHlfZmx1c2hfYnVmZmVyIGZpbmlzaFxuIikpOworfQorCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogVGhlIElPQ1RMIGZ1bmN0aW9uIGFuZCBhbGwgb2YgaXRzIGhlbHBlcnMKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgICAgICAgICAgICAgICAgICAgICAKKy8qCisgKiBkZ2FwX3R0eV9pb2N0bCgpCisgKgorICogVGhlIHVzdWFsIGFzc29ydG1lbnQgb2YgaW9jdGw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JRUQ7IHdpdGhvdXQgZXZlbiB0aGUKKyAqIGltcGxpZWQgd2FycmFudHkgb2YgTUVSQ0hBTlRBQklMSVRZIG9yIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUgorICogUFVSUE9TRS4gIFNlZSB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgZm9yIG1vcmUgZGV0YWlscy4KKyAqCisgKiBZb3Ugc2hvdWxkIGhhdmUgcmVjZWl2ZWQgYSBjb3B5IG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZQorICogYWxvbmcgd2l0aCB0aGlzIHByb2dyYW07IGlmIG5vdCwgd3JpdGUgdG8gdGhlIEZyZWUgU29mdHdhcmUKKyAqIEZvdW5kYXRpb24sIEluYy4sIDY3NSBNYXNzIEF2ZSwgQ2FtYnJpZGdlLCBNQSAwMjEzOSwgVVNBLgorICoKKyAqICRJZDogZGlnaS5oLHYgMS4xIDIwMDkvMTAvMjMgMTQ6MDE6NTcgbWFya2ggRXhwICQKKyAqCisgKglOT1RFOiBUSElTIElTIEEgU0hBUkVEIEhFQURFUi4gRE8gTk9UIENIQU5HRSBDT0RJTkcgU1RZTEUhISEKKyAqLworCisjaWZuZGVmIF9fRElHSV9ICisjZGVmaW5lIF9fRElHSV9ICisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqKioJRGVmaW5pdGlvbnMgZm9yIERpZ2kgZGl0dHkoMSkgY29tbWFuZC4KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKworLyoKKyAqIENvcHlyaWdodCAoYykgMTk4OC05NiBEaWdpIEludGVybmF0aW9uYWwgSW5jLiwgQWxsIFJpZ2h0cyBSZXNlcnZlZC4KKyAqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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JR0lfRFRSX1RPR0dMRSAweDIwMDAJCS8qIFN1cHBvcnQgRFRSIFRvZ2dsZQkJKi8KKyNkZWZpbmUJRElHSV80MjIJMHg0MDAwCQkvKiBmb3IgNDIyLzIzMiBzZWxlY3RhYmxlIHBhbmVsICovCisjZGVmaW5lIERJR0lfUlRTX1RPR0dMRQkweDgwMDAJCS8qIFN1cHBvcnQgUlRTIFRvZ2dsZQkJKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogVGhlc2Ugb3B0aW9ucyBhcmUgbm90IHN1cHBvcnRlZCBvbiB0aGUgY29teGkuCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2RlZmluZQlESUdJX0NPTVhJCShESUdJX0ZBU1R8RElHSV9DT09LfERTUlBBQ0V8RENEUEFDRXxEVFJQQUNFKQorCisjZGVmaW5lIERJR0lfUExFTgkyOAkJLyogU3RyaW5nIGxlbmd0aAkJKi8KKyNkZWZpbmUJRElHSV9UU0laCTEwCQkvKiBUZXJtaW5hbCBzdHJpbmcgbGVuCQkqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBTdHJ1Y3R1cmUgdXNlZCB3aXRoIGlvY3RsIGNvbW1hbmRzIGZvciBESUdJIHBhcmFtZXRlcnMuCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RydWN0IGRpZ2lfdCB7CisJdW5zaWduZWQgc2hvcnQJZGlnaV9mbGFnczsJCS8qIEZsYWdzIChzZWUgYWJvdmUpCSovCisJdW5zaWduZWQgc2hvcnQJZGlnaV9tYXhjcHM7CQkvKiBNYXggcHJpbnRlciBDUFMJKi8KKwl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dW5zaWduZWQgY2hhcglzaHJpbmtfYnVmX3R5cGU7CS8qIEJvYXJkIHR5cGUgMSA9IFBDL1hpLAorCQkJCQkJCSAgICAgIDIgPSBQQy9YbSwKKwkJCQkJCQkgICAgICAzID0gUEMvWGUgIAorCQkJCQkJCSAgICAgIDQgPSBNQy9YaSAgCisJCQkJCQkJICAgICAgNSA9IENPTVgvaSAqLworCXVuc2lnbmVkIGNoYXIJc2hyaW5rX2J1Zl9jYXJkOwkvKiBDYXJkIG51bWJlciAqLworCQorfTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogU3RydWN0dXJlIHRvIGdldCBkcml2ZXIgc3RhdHVzIGluZm9ybWF0aW9uCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RydWN0IGRpZ2lfZGluZm8geworCXVuc2lnbmVkIGxvbmcJZGluZm9fbmJvYXJkczsJCS8qICMgYm9hcmRzIGNvbmZpZ3VyZWQJKi8KKwljaGFyCQlkaW5mb19yZXNlcnZlZFsxMl07CS8qIGZvciBmdXR1cmUgZXhwYW5zaW9uICovCisJY2hhcgkJZGluZm9fdmVyc2lvblsxNl07CS8qIGRyaXZlciB2ZXJzaW9uICAgICAgICovCit9OworCisjZGVmaW5lCURJR0lfR0VUREQJKCdkJzw8OCkgfCAyNDgJCS8qIGdldCBkcml2ZXIgaW5mbyAgICAgICovCisgCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBTdHJ1Y3R1cmUgdXNlZCB3aXRoIGlvY3RsIGNvbW1hbmRzIGZvciBwZXItYm9hcmQgaW5mb3JtYXRpb24KKyAqCisgKiBwaHlzc2l6ZSBhbmQgbWVtc2l6ZSBkaWZmZXIgd2hlbiBib2FyZCBoYXMgIndpbmRvd2VkIiBtZW1vcnkKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdHJ1Y3QgZGlnaV9pbmZvIHsKKwl1bnNpZ25lZCBsb25nCWluZm9fYmRudW07CQkvKiBCb2FyZCBudW1iZXIgKDAgYmFzZWQpICAqLworCXVuc2lnbmVkIGxvbmcJaW5mb19pb3BvcnQ7CQkvKiBpbyBwb3J0IGFkZHJlc3MgICAgICAgICAqLworCXVuc2lnbmVkIGxvbmcJaW5mb19waHlzYWRkcjsJCS8qIG1lbW9yeSBhZGRyZXNzICAgICAgICAgICovCisJdW5zaWduZWQgbG9uZwlpbmZvX3BoeXNzaXplOwkJLyogU2l6ZSBvZiBob3N0IG1lbSB3aW5kb3cgKi8KKwl1bnNpZ25lZCBsb25nCWluZm9fbWVtc2l6ZTsJCS8qIEFtb3VudCBvZiBkdWFsLXBvcnQgbWVtICovCisJCQkJCQkvKiBvbiBib2FyZCAgICAgICAgICAgICAgICAqLworCXVuc2lnbmVkIHNob3J0CWluZm9fYmR0eXBlOwkJLyogQm9hcmQgdHlwZSAgICAgICAgICAgICAgKi8KKwl1bnNpZ25lZCBzaG9ydAlpbmZvX25wb3J0czsJCS8qIG51bWJlciBvZiBwb3J0cyAgICAgICAgICovCisJY2hhcgkJaW5mb19iZHN0YXRlOwkJLyogYm9hcmQgc3RhdGUgICAgICAgICAgICAgKi8KKwljaGFyCQlpbmZvX3Jlc2VydmVkWzddOwkvKiBmb3IgZnV0dXJlIGV4cGFuc2lvbiAgICAqLworfTsKKworI2RlZmluZQlESUdJX0dFVEJECSgnZCc8PDgpIHwgMjQ5CQkvKiBnZXQgYm9hcmQgaW5mbyAgICAgICAgICAqLworIAorc3RydWN0IGRpZ2lfc3RhdCB7CisJdW5zaWduZWQgaW50CWluZm9fY2hhbjsJCS8qIENoYW5uZWwgbnVtYmVyICgwIGJhc2VkKSAgKi8KKwl1bnNpZ25lZCBpbnQJaW5mb19icmQ7CQkvKiBCb2FyZCBudW1iZXIgKDAgYmFzZWQpICAqLworCXVuc2lnbmVkIGxvbmcJaW5mb19jZmxhZzsJCS8qIGNmbGFnIGZvciBjaGFubmVsICAgICAgICovCisJdW5zaWduZWQgbG9uZwlpbmZvX2lmbGFnOwkJLyogaWZsYWcgZm9yIGNoYW5uZWwgICAgICAgKi8KKwl1bnNpZ25lZCBsb25nCWluZm9fb2ZsYWc7CQkvKiBvZmxhZyBmb3IgY2hhbm5lbCAgICAgICAqLworCXVuc2lnbmVkIGxvbmcJaW5mb19tc3RhdDsJCS8qIG1zdGF0IGZvciBjaGFubmVsICAgICAgICovCisJdW5zaWduZWQgbG9uZwlpbmZvX3R4X2RhdGE7CQkvKiB0eF9kYXRhIGZvciBjaGFubmVsICAgICAgICovCisJdW5zaWduZWQgbG9uZwlpbmZvX3J4X2RhdGE7CQkvKiByeF9kYXRhIGZvciBjaGFubmVsICAgICAgICovCisJdW5zaWduZWQgbG9uZwlpbmZvX2hmbG93OwkJLyogaGZsb3cgZm9yIGNoYW5uZWwgICAgICAgKi8KKwl1bnNpZ25lZCBsb25nCWluZm9fcmVzZXJ2ZWRbOF07CS8qIGZvciBmdXR1cmUgZXhwYW5zaW9uICAgICovCit9OworCisjZGVmaW5lCURJR0lfR0VUU1RBVAkoJ2QnPDw4KSB8IDI0NAkJLyogZ2V0IGJvYXJkIGluZm8gICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBTdHJ1Y3R1cmUgdXNlZCB3aXRoIGlvY3RsIGNvbW1hbmRzIGZvciBwZXItY2hhbm5lbCBpbmZvcm1hdGlvbgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdHJ1Y3QgZGlnaV9jaCB7Cis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aW1hZ2VfaW5mbyAqaSA9IE5VTEwgOyAKKworCWZvciAoIHggPSAwOyB4IDwgbmltYWdlczsgeCsrICkgeworCQlpPSZpbWFnZV9saXN0W3hdOworCQkJCQorCQlpZihpLT50eXBlICE9IElDT05DKQorCQkJY29udGludWU7CisKKwkJY29uc2lkZXJfZmlsZV9yZXNjYW4oaSkgOworCisJCWlwID0gKHN0cnVjdCBkb3dubGRfdCAqKSBpbWFnZV9saXN0W3hdLmltYWdlOworCQlpZiAoaXAgPT0gTlVMTCkgY29udGludWU7CisKKwkJLyoKKwkJICogV2hlbiBJIHJlbW92ZWQgQ2x1c3RlcnBvcnQsIEkga2VwdCBvbmx5IHRoZSBjb2RlIHRoYXQgSQorCQkgKiB3YXMgU1VSRSB3YXNuJ3QgQ2x1c3RlclBvcnQuICBXZSBtYXkgbm90IG5lZWQgdGhlIG5leHQgdHdvCisJCSAqIGxpbmVzIG9mIGNvZGUuCisJCSAqLworCQlpZiAoKGRwLT5kbF90eXBlICE9ICdQJyApICYmICggaXAtPmRsX3NyZXYgPT0gZHAtPmRsX3NyZXYgKSkKKwkJCXJldHVybiBpOworCX0gCisJcmV0dXJuIE5VTEwgOyAKK30KKworCitpbnQgbWFpbihpbnQgYXJnYywgY2hhciAqKmFyZ3YpCit7CisJc3RydWN0IGRvd25sZGlvCWRsaW87CisJaW50IAkJb2Zmc2V0LCBic2l6ZTsKKwlpbnQgCQl4OworCWNoYXIgCQkqZG93biwgKmltYWdlLCAqZm5hbWU7CisJc3RydWN0IGltYWdlX2luZm8gKmlpOworCisJcGdtID0gYXJndlswXTsKKwlkcCA9ICZkbGlvLmltYWdlLmRsOwkJLyogY29uYy4gZG93bmxvYWQgKi8KKworCXdoaWxlKChhcmdjID4gMikgJiYgIXN0cmNtcChhcmd2WzFdLCItZCIpKSB7CisJCWRlYnVnZmxhZysrIDsKKwkJYXJnYy0tIDsKKwkJYXJndisrIDsKKwl9CisKKwlpZihhcmdjIDwgMikgeworCQlmcHJpbnRmK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gICAgICAgPSBkZ25jX3BjaV90YmwsCisJLnJlbW92ZQkJPSBkZ25jX3JlbW92ZV9vbmUsCit9OworCisKK2NoYXIgKmRnbmNfc3RhdGVfdGV4dFtdID0geworCSJCb2FyZCBGYWlsZWQiLAorCSJCb2FyZCBGb3VuZCIsCisJIkJvYXJkIFJFQURZIiwKK307CisKK2NoYXIgKmRnbmNfZHJpdmVyX3N0YXRlX3RleHRbXSA9IHsKKwkiRHJpdmVyIEluaXRpYWxpemVkIiwKKwkiRHJpdmVyIFJlYWR5LiIKK307CisKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogRHJpdmVyIGxvYWQvdW5sb2FkIGZ1bmN0aW9ucworICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKworLyoKKyAqIGluaXRfbW9kdWxlKCkKKyAqCisgKiBNb2R1bGUgbG9hZC4gIFRoaXMgaXMgd2hlcmUgaXQgYWxsIHN0YXJ0cy4KKyAqLworaW50IGRnbmNfaW5pdF9tb2R1bGUodm9pZCkKK3sKKwlpbnQgcmMgPSAwOworCisJQVBSKCgiJXMsIERpZ2kgSW50ZXJuYXRpb25hbCBQYXJ0IE51bWJlciAlc1xuIiwgREdfTkFNRSwgREdfUEFSVCkpOworCisJLyoKKwkgKiBJbml0aWFsaXplIGdsb2JhbCBzdHVmZgorCSAqLworCXJjID0gZGduY19zdGFydCgpOworCisJaWYgKHJjIDwgMCkgeworCQlyZXR1cm4ocmMpOworCX0KKworCS8qCisJICogRmluZCBhbmQgY29uZmlndXJlIGFsbCB0aGUgY2FyZHMKKwkgKi8KKwlyYyA9IGRnbmNfaW5pdF9wY2koKTsKKworCS8qCisJICogSWYgc29tZXRoaW5nIHdlbnQgd3JvbmcgaW4gdGhlIHNjYW4sIGJhaWwgb3V0IG9mIGRya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isJRFBSX0lOSVQoKCJyZW1hcHBlZCBtZW06IDB4JXBcbiIsIGJyZC0+cmVfbWFwX21lbWJhc2UpKTsKK30KKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoKKyogRnVuY3Rpb246CisqCisqICAgIGRnbmNfcG9sbF9oYW5kbGVyCisqCisqIEF1dGhvcjoKKyoKKyogICAgU2NvdHQgSCBLaWxhdQorKgorKiBQYXJhbWV0ZXJzOgorKgorKiAgICBkdW1teSAtLSBpZ25vcmVkCisqCisqIFJldHVybiBWYWx1ZXM6CisqCisqICAgIG5vbmUKKyoKKyogRGVzY3JpcHRpb246CisqCisqICAgIEFzIGVhY2ggdGltZXIgZXhwaXJlcywgaXQgZGV0ZXJtaW5lcyAoYSkgd2hldGhlciB0aGUgInRyYW5zbWl0IgorKiAgICB3YWl0ZXIgbmVlZHMgdG8gYmUgd29rZW4gdXAsIGFuZCAoYikgd2hldGhlciB0aGUgcG9sbGVyIG5lZWRzIHRvCisqICAgIGJlIHJlc2NoZWR1bGVkLgorKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgdm9pZCBkZ25jX3BvbGxfaGFuZGxlcih1bG9uZyBkdW1teSkKK3sKKwlzdHJ1Y3QgYm9hcmRfdCAqYnJkOworCXVuc2lnbmVkIGxvbmcgbG9ja19mbGFnczsKKwlpbnQgaTsKKwl1bnNpZ25lZCBsb25nIG5ld190aW1lOworCisJZGduY19wb2xsX2NvdW50ZXIrKzsKKworCS8qCisJICogRG8gbm90IHN0YXJ0IHRoZSBib2FyZCBzdGF0ZSBtYWNoaW5lIHVudGlsCisJICogZHJpdmVyIHRlbGxzIHVzIGl0cyB1cCBhbmQgcnVubmluZywgYW5kIGhhcworCSAqIGV2ZXJ5dGhpbmcgaXQgbmVlZH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KioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogVXRpbGl0eSBmdW5jdGlvbnMKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKgorICogZGduY19tc19zbGVlcCgpCisgKgorICogUHV0IHRoZSBkcml2ZXIgdG8gc2xlZXAgZm9yIHggbXMncworICoKKyAqIFJldHVybnMgMCBpZiB0aW1lZCBvdXQsICEwIChzaG93aW5nIHNpZ25hbCkgaWYgaW50ZXJydXB0ZWQgYnkgYSBzaWduYWwuCisgKi8KK2ludCBkZ25jX21zX3NsZWVwKHVsb25nIG1zKQoreworCWN1cnJlbnQtPnN0YXRlID0gVEFTS19JTlRFUlJVUFRJQkxFOworCXNjaGVkdWxlX3RpbWVvdXQoKG1zICogSFopIC8gMTAwMCk7CisJcmV0dXJuIChzaWduYWxfcGVuZGluZyhjdXJyZW50KSk7Cit9CisKKworCisvKgorICogICAgICBkZ25jX2lvY3RsX25hbWUoKSA6IFJldHVybnMgYSB0ZXh0IHZlcnNpb24gb2YgZWFjaCBpb2N0bCB2YWx1ZS4KKyAqLworY2hhciAqZGduY19pb2N0bF9uYW1lKGludCBjbWQpCit7CisJc3dpdGNoKGNtZCkgeworCisJY2FzZSBUQ0dFVEE6CQlyZXR1cm4oIlRDR0VUQSIpOworCWNhc2UgVENHRVRTOgkJcmV0dXJuKCJUQ0dFVFMiKTsKKwljYXNlIFRDU0VUQToJCXJldHVybigiVENTRVRBIik7CisJY2FzZSBUQ1NFVFM6CQlyZXR1cm4oIlRDU0VUUyIpOworCWNhc2UgVENTRVRBVzoJCXJldHVybigiVENTRVRBVyIpOworCWNhc2UgVENTRVRTVzoJCXJldHVybigiVENTRVRTVyIpOworCWNhc2UgVENTRVRBRjoJCXJldHVybigiVENTRVRBRiIpOworCWNhc2UgVENTRVRTRjoJCXJldHVybigiVENTRVRTRiIpOworCWNhc2UgVENTQlJLOgkJcmV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ioqKioqKioqKi8KKworI2lmbmRlZiBfX0RHTkNfRFJJVkVSX0gKKyNkZWZpbmUgX19ER05DX0RSSVZFUl9ICisKKyNpbmNsdWRlIDxsaW51eC90eXBlcy5oPgkvKiBUbyBwaWNrIHVwIHRoZSB2YXJpb25zIExpbnV4IHR5cGVzICovCisjaW5jbHVkZSA8bGludXgvdHR5Lmg+CSAgLyogVG8gcGljayB1cCB0aGUgdmFyaW91cyB0dHkgc3RydWN0cy9kZWZpbmVzICovCisjaW5jbHVkZSA8bGludXgvaW50ZXJydXB0Lmg+CS8qIEZvciBpcnFyZXR1cm5fdCB0eXBlICovCisKKyNpbmNsdWRlICJkZ25jX3R5cGVzLmgiCQkvKiBBZGRpdGlvbmFsIHR5cGVzIG5lZWRlZCBieSB0aGUgRGlnaSBoZWFkZXIgZmlsZXMgKi8KKyNpbmNsdWRlICJkaWdpLmgiCQkvKiBEaWdpIHNwZWNpZmljIGlvY3RsIGhlYWRlciAqLworI2luY2x1ZGUgImRnbmNfa2NvbXBhdC5oIgkvKiBLZXJuZWwgMi40LzIuNiBjb21wYXQgaW5jbHVkZXMgKi8KKyNpbmNsdWRlICJkZ25jX3N5c2ZzLmgiCQkvKiBTdXBwb3J0IGZvciBTWVNGUyAqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIERyaXZlciBkZWZpbmVzCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qCisgKiBEcml2ZXIgaWRlbnRpZmljYXRpb24sIGVycm9yIGFuZCBkZWJ1Z2dpbmcgc3RhdG1lbnRzCisgKgorICogSW4gdGhlb3J5LCB5b3UgY2FuIGNoYW5nZSBhbGwgb2NjdXJhbmNlcyBvZiAiZGlnaSIgaW4gdGhlIG5leHQKKyAqIHRocmVlIGxpbmVzLCBhb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IFN0cnVjdHVyZXMgYW5kIGNsb3NlbHkgcmVsYXRlZCBkZWZpbmVzLgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdHJ1Y3QgYm9hcmRfdDsKK3N0cnVjdCBjaGFubmVsX3Q7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIFBlciBib2FyZCBvcGVyYXRpb25zIHN0cnVjdHVyZQkJCQkgICAgICAgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3N0cnVjdCBib2FyZF9vcHMgeworCXZvaWQgKCp0YXNrbGV0KSAodW5zaWduZWQgbG9uZyBkYXRhKTsKKwlpcnFyZXR1cm5fdCAoKmludHIpIChpbnQgaXJxLCB2b2lkICp2b2lkYnJkKTsKKwl2b2lkICgqdWFydF9pbml0KSAoc3RydWN0IGNoYW5uZWxfdCAqY2gpOworCXZvaWQgKCp1YXJ0X29mZikgKHN0cnVjdCBjaGFubmVsX3QgKmNoKTsKKwlpbnQgICgqZHJhaW4pIChzdHJ1Y3QgdHR5X3N0cnVjdCAqdHR5LCB1aW50IHNlY29uZHMpOworCXZvaWQgKCpwYXJhbSkgKHN0cnVjdCB0dHlfc3RydWN0ICp0dHkpOworCXZvaWQgKCp2cGQpIChzdHJ1Y3QgYm9hcmRfdCAqYnJkKTsKKwl2b2lkICgqYXNzZXJ0X21vZGVtX3NpZ25hbHMpIChzdHJ1Y3QgY2hhbm5lbF90ICpjaCk7CisJdm9pZCAoKmZsdXNoX3VhcnRfd3JpdGUpIChzdHJ1Y3QgY2hhbm5lbF90ICpjaCk7CisJdm9pZCAoKmZsdXNoX3VhcnRfcmVhZCkgKHN0cnVjdCBjaGFubmVsX3QgKmNoKTsKKwl2b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LworI2RlZmluZSBVTl9XT1BFTgkweDA0MDAJCS8qIERldmljZSB3YWl0aW5nIGZvciBvcGVuCSovCisjZGVmaW5lIFVOX1dJT0NUTAkweDA4MDAJCS8qIERldmljZSB3YWl0aW5nIGZvciBvcGVuCSovCisjZGVmaW5lIFVOX0hBTkdVUAkweDgwMDAJCS8qIENhcnJpZXIgbG9zdAkJCSovCisKK3N0cnVjdCBkZXZpY2U7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIFN0cnVjdHVyZSBmb3IgdGVybWluYWwgb3IgcHJpbnRlciB1bml0LgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3N0cnVjdCB1bl90IHsKKwlpbnQJbWFnaWM7CQkvKiBVbml0IE1hZ2ljIE51bWJlci4JCQkqLworCXN0cnVjdAljaGFubmVsX3QgKnVuX2NoOworCXVsb25nCXVuX3RpbWU7CisJdWludAl1bl90eXBlOworCXVpbnQJdW5fb3Blbl9jb3VudDsJLyogQ291bnRlciBvZiBvcGVucyB0byBwb3J0CQkqLworCXN0cnVjdCB0dHlfc3RydWN0ICp1bl90dHk7LyogUG9pbnRlciB0byB1bml0IHR0eSBzdHJ1Y3R1cmUJKi8KKwl1aW50CXVuX2ZsYWdzOwkvKiBVbml0IGZsYWdzCQkJCSovCisJd2FpdF9xdWV1ZV9oZWFkX3QgdW5fZmxhZ3Nfd2FpdDsgLyogUGxhY2UgdG8gc2xlZXAgdG8gd2FpdCBvbiB1bml0ICovCisJdWludAl1bl9kZXY7CQkvKiBNaW5vciBkZXZpY2UgbnVtYmVyCQkJKi8KKwlzdHJ1Y3QgZGV2aWNlICp1bl9zeXNmczsKK307CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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WludCBjaF9zbmlmZl9vdXQ7CisJY2hhciAqY2hfc25pZmZfYnVmOwkJLyogU25pZmYgYnVmZmVyIGZvciBwcm9jICovCisJdWxvbmcgY2hfc25pZmZfZmxhZ3M7CQkvKiBDaGFubmVsIGZsYWdzCQkqLworCXdhaXRfcXVldWVfaGVhZF90IGNoX3NuaWZmX3dhaXQ7Cit9OworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogUHJvdG90eXBlcyBmb3Igbm9uLXN0YXRpYyBmdW5jdGlvbnMgdXNlZCBpbiBtb3JlIHRoYW4gb25lIG1vZHVsZQorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitleHRlcm4gaW50CQlkZ25jX21zX3NsZWVwKHVsb25nIG1zKTsKK2V4dGVybiBjaGFyCQkqZGduY19pb2N0bF9uYW1lKGludCBjbWQpOworCisvKgorICogT3VyIEdsb2JhbCBWYXJpYWJsZXMuCisgKi8KK2V4dGVybiBpbnQJCWRnbmNfZHJpdmVyX3N0YXRlOwkvKiBUaGUgc3RhdGUgb2YgdGhlIGRyaXZlcgkqLworZXh0ZXJuIHVpbnQJCWRnbmNfTWFqb3I7CQkvKiBPdXIgZHJpdmVyL21nbXQgbWFqb3IJKi8KK2V4dGVybiBpbnQJCWRnbmNfZGVidWc7CQkvKiBEZWJ1ZyB2YXJpYWJsZQkJKi8KK2V4dGVybiBpbnQJCWRnbmNfcmF3cmVhZG9rOwkJLyogU2V0IGlmIHVzZXIgd2FudHMgcmF3cmVhZHMJKi8KK2V4dGVybiBpbnQJCWRnbmNfcG9sbF90aWNrOwkJLyogUG9sbCBpbnRlcnZhbCAtIDIwIG1zCSovCitleHRlcm4gaW50CQlkZ25jX3RyY2J1Zl9zaXplOwkvKiBTaXplIG9mIHRoZSByaW5nYnVmZmVy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XJjaGl2ZSBhbmQgdGhlCisgKglMaW51eCBLZXJuZWwgc291cmNlcy4KKyAqCUNoYW5naW5nIHRoZSBzb3VyY2UganVzdCBmb3IgcmVmb3JtYXR0aW5nIG5lZWRsZXNzbHkgYnJlYWtzCisgKglvdXIgQ1ZTIGRpZmYgaGlzdG9yeS4KKyAqCisgKglTZW5kIGFueSBidWcgZml4ZXMvY2hhbmdlcyB0bzogIEVuZy5MaW51eCBhdCBkaWdpIGRvdCBjb20uCisgKglUaGFuayB5b3UuCisgKgorICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBUaGlzIGZpbGUgaW1wbGVtZW50cyB0aGUgbWdtdCBmdW5jdGlvbmFsaXR5IGZvciB0aGUKKyAqIE5lbyBhbmQgQ2xhc3NpY0JvYXJkIGJhc2VkIHByb2R1Y3QgbGluZXMuCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICovCisjaW5jbHVkZSA8bGludXgva2VybmVsLmg+CisjaW5jbHVkZSA8bGludXgvY3R5cGUuaD4KKyNpbmNsdWRlIDxsaW51eC9zY2hlZC5oPgkvKiBGb3IgamlmZmllcywgdGFzayBzdGF0ZXMgKi8KKyNpbmNsdWRlIDxsaW51eC9pbnRlcnJ1cHQuaD4JLyogRm9yIHRhc2tsZXQgYW5kIGludGVycnVwdCBzdHJ1Y3RzL2RlZmluZXMgKi8KKyNpbmNsdWRlIDxsaW51eC9zZXJpYWxfcmVnLmg+CisjaW5jbHVkZSA8bGludXgvdGVybWlvcy5oPgorI2luY2x1ZGUgPGFzbS91YWNjZXNzLmg+CS8qIEZvciBjb3B5X2Zyb21fdXNlci9jb3B5X3RvX3VzZXIgKi8KKworI2luY2x1ZGUgImRnbmNfZHJpdmVyLmgiCisjaW5jbHVkZSAiZGduY19wY2kua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GRyZXNzKQoreworCXVuc2lnbmVkIGludCBlbmFibGU7CisJdW5zaWduZWQgaW50IGJpdHM7CisJdW5zaWduZWQgaW50IGRhdGFiaXQ7CisJdW5zaWduZWQgaW50IHZhbDsKKworCS8qIGVuYWJsZSBjaGlwIHNlbGVjdCAqLworCXdyaXRlYihORU9fRUVDUywgYmFzZSArIE5FT19FRVJFRyk7CisJLyogUkVBRCAqLworCWVuYWJsZSA9IChhZGRyZXNzIHwgMHgxODApOworCisJZm9yIChiaXRzID0gOTsgYml0cy0tOyApIHsKKwkJZGF0YWJpdCA9IChlbmFibGUgJiAoMSA8PCBiaXRzKSkgPyBORU9fRUVESSA6IDA7CisJCS8qIFNldCByZWFkIGFkZHJlc3MgKi8KKwkJd3JpdGViKGRhdGFiaXQgfCBORU9fRUVDUywgYmFzZSArIE5FT19FRVJFRyk7CisJCXdyaXRlYihkYXRhYml0IHwgTkVPX0VFQ1MgfCBORU9fRUVDSywgYmFzZSArIE5FT19FRVJFRyk7CisJfQorCisJdmFsID0gMDsKKworCWZvciAoYml0cyA9IDE3OyBiaXRzLS07ICkgeworCQkvKiBjbG9jayB0byBFRVBST00gKi8KKwkJd3JpdGViKE5FT19FRUNTLCBiYXNlICsgTkVPX0VFUkVHKTsKKwkJd3JpdGViKE5FT19FRUNTIHwgTkVPX0VFQ0ssIGJhc2UgKyBORU9fRUVSRUcpOworCQl2YWwgPDw9IDE7CisJCS8qIHJlYWQgRUVQUk9NICovCisJCWlmIChyZWFkYihiYXNlICsgTkVPX0VFUkVHKSAmIE5FT19FRURPKQorCQkJdmFsIHw9IDE7CisJfQorCisJLyogY2xvY2sgZmFsbGluZyBlZGdlICovCisJd3JpdGViKE5FT19FRUNTLCBiYXNlICsgTkVPX0VFUkVHKTsKKworCS8qIGRyb3AgY2hpcCBzZWxlY3QgKi8KKwl3cml0ZWIoMHgwMCwgYmFzZSArIE5FT19FRVJFRyk7CisKKwlyZXR1cm4gdmFsOworfQorCisKK3N0YXRpYyB2b2lk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CBQdWJsaWMgTGljZW5zZSBmb3IgbW9yZSBkZXRhaWxzLgorICoKKyAqIFlvdSBzaG91bGQgaGF2ZSByZWNlaXZlZCBhIGNvcHkgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlCisgKiBhbG9uZyB3aXRoIHRoaXMgcHJvZ3JhbTsgaWYgbm90LCB3cml0ZSB0byB0aGUgRnJlZSBTb2Z0d2FyZQorICogRm91bmRhdGlvbiwgSW5jLiwgNjc1IE1hc3MgQXZlLCBDYW1icmlkZ2UsIE1BIDAyMTM5LCBVU0EuCisgKgorICoJTk9URTogVEhJUyBJUyBBIFNIQVJFRCBIRUFERVIuIERPIE5PVCBDSEFOR0UgQ09ESU5HIFNUWUxFISEhCisgKgorICovCisKKyNpZm5kZWYgX19ER05DX05FT19ICisjZGVmaW5lIF9fREdOQ19ORU9fSAorCisjaW5jbHVkZSAiZGduY190eXBlcy5oIgorI2luY2x1ZGUgImRnbmNfZHJpdmVyLmgiCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIFBlciBjaGFubmVsL3BvcnQgTkVPIFVBUlQgc3RydWN0dXJlCQkJCQkqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgkJQmFzZSBTdHJ1Y3R1cmUgRW50cmllcyBVc2FnZSBNZWFuaW5ncyB0byBIb3N0CQkqCisgKgkJCQkJCQkJCSoKKyAqCVcgPSByZWFkIHdyaXRlCQlSID0gcmVhZCBvbmx5CQkJCSoKKyAqCQkJVSA9IFVudXNlZC4JCQkJCSoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3N0cnVjdCBuZW9fdWFydF9zdHJ1Y3QgeworCXU4IHR4cng7CQkvKi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3NpemVfdCBkZ25jX3ZwZF9zaG93KHN0cnVjdCBkZXZpY2UgKnAsIHN0cnVjdCBkZXZpY2VfYXR0cmlidXRlICphdHRyLCBjaGFyICpidWYpCit7CisJc3RydWN0IGJvYXJkX3QgKmJkOworCWludCBjb3VudCA9IDA7CisJaW50IGkgPSAwOworCisJREdOQ19WRVJJRllfQk9BUkQocCwgYmQpOworCisJY291bnQgKz0gc3ByaW50ZihidWYgKyBjb3VudCwgIlxuICAgICAgMCAgMSAgMiAgMyAgNCAgNSAgNiAgNyAgOCAgOSAgQSAgQiAgQyAgRCAgRSAgRiIpOworCWZvciAoaSA9IDA7IGkgPCAweDQwICogMjsgaSsrKSB7CisJCWlmICghKGkgJSAxNikpCisJCQljb3VudCArPSBzcHJpbnRmKGJ1ZiArIGNvdW50LCAiXG4lMDRYICIsIGkgKiAyKTsKKwkJY291bnQgKz0gc3ByaW50ZihidWYgKyBjb3VudCwgIiUwMlggIiwgYmQtPnZwZFtpXSk7CisJfQorCWNvdW50ICs9IHNwcmludGYoYnVmICsgY291bnQsICJcbiIpOworCisJcmV0dXJuIGNvdW50OworfQorc3RhdGljIERFVklDRV9BVFRSKHZwZCwgU19JUlVTUiwgZGduY192cGRfc2hvdywgTlVMTCk7CisKK3N0YXRpYyBzc2l6ZV90IGRnbmNfc2VyaWFsX251bWJlcl9zaG93KHN0cnVjdCBkZXZpY2UgKnAsIHN0cnVjdCBkZXZpY2VfYXR0cmlidXRlICphdHRyLCBjaGFyICpidWYpCit7CisJc3RydWN0IGJvYXJkX3QgKmJkOworCWludCBjb3VudCA9IDA7CisKKwlER05DX1ZFUklGWV9CT0FSRChwLCBiZCk7CisKKwlpZiAoYmQtPnNlcmlhbF9udW1bMF0gPT0gJ1wwJykKKwkJY291bnQgKz0gc3ByaW50ZihidWYgKyBjb3VudCwgIjxVTktOT1dOPlxuIik7CisJZWxzZQorCQljb3VudCArPSBzcHJpbnRmKGJ1ZiArIGNvdW50LCAiJXNcbiIsIGJkLT5zZXJpYWxfbnVtKTsKKworCXJldHVybiBjb3VudDsKK30KK3N0YXRpYyBERVZJQ0VfQVRUUihzZXJpYWxfbnVtYmVyLCBTX0lSVVNSLCBkZ25jX3NlcmlhbF9udW1iZXJfc2hvdywgTlVMTCk7CisKKworc3RhdGljIHNzaXplX3QgZGduY19wb3J0c19zdGF0ZV9zaG93KHN0cnVjdCBkZXZpY2UgKnAsIHN0cnVjdCBkZXZpY2VfYXR0cmlidXRlICphdHRyLCBjaGFyICpidWYpCit7CisJc3RydWN0IGJvYXJkX3QgKmJkOworCWludCBjb3VudCA9IDA7CisJaW50IGkgPSAwOworCisJREdOQ19WRVJJRllfQk9BUkQocCwgYmQpOworCisJZm9yIChpID0gMDsgaSA8IGJkLT5uYXN5bmM7IGkrKykgeworCQljb3VudCArPSBzbnByaW50ZihidWYgKyBjb3VudCwgUEFHRV9TSVpFIC0gY291bnQsCisJCQkiJWQgJXNcbiIsIGJkLT5jaGFubmVsc1tpXS0+Y2hfcG9ydG51bSwKKwkJCWJkLT5jaGFubmVsc1tpXS0+Y2hfb3Blbl9jb3VudCA/ICJPcGVuIiA6ICJDbG9zZWQiKTsKKwl9CisJcmV0dXJuIGNvdW50OworfQorc3RhdGljIERFVklDRV9BVFRSKHBvcnRzX3N0YXRlLCBTX0lSVVNSLCBkZ25jX3BvcnRzX3N0YXRlX3Nob3csIE5VTEwpOworCisKK3N0YXRpYyBzc2l6ZV90IGRnbmNfcG9ydHNfYmF1ZF9zaG93KHN0cnVjdCBkZXZpY2UgKnAsIHN0cnVjdCBkZXZpY2VfYXR0cmlidXRlICphdHRyLCBjaGFyICpidWYpCit7CisJc3RydWN0IGJvYXJkX3QgKmJkOworCWludCBjb3VudCA9IDA7CisJaW50IGkgPSAwOworCisJREdOQ19WRVJJRllfQk9BUkQocCwgYmQpOworCisJZm9yIChpID0gMDsgaSA8IGJkLT5uYXN5bmM7IGkrKykgeworCQljb3VudCArPSAgc25wcmludGYoYnVmICsgY291bnQsIFBBR0VfU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ZXRfdGVybWlvcywKKwkuc3RvcCA9IGRnbmNfdHR5X3N0b3AsCisJLnN0YXJ0ID0gZGduY190dHlfc3RhcnQsCisJLnRocm90dGxlID0gZGduY190dHlfdGhyb3R0bGUsCisJLnVudGhyb3R0bGUgPSBkZ25jX3R0eV91bnRocm90dGxlLAorCS5oYW5ndXAgPSBkZ25jX3R0eV9oYW5ndXAsCisJLnB1dF9jaGFyID0gZGduY190dHlfcHV0X2NoYXIsCisJLnRpb2NtZ2V0ID0gZGduY190dHlfdGlvY21nZXQsCisJLnRpb2Ntc2V0ID0gZGduY190dHlfdGlvY21zZXQsCisJLmJyZWFrX2N0bCA9IGRnbmNfdHR5X3NlbmRfYnJlYWssCisJLndhaXRfdW50aWxfc2VudCA9IGRnbmNfdHR5X3dhaXRfdW50aWxfc2VudCwKKwkuc2VuZF94Y2hhciA9IGRnbmNfdHR5X3NlbmRfeGNoYXIKK307CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBUVFkgSW5pdGlhbGl6YXRpb24vQ2xlYW51cCBGdW5jdGlvbnMKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKgorICogZGduY190dHlfcHJlaW5pdCgpCisgKgorICogSW5pdGlhbGl6ZSBhbnkgZ2xvYmFsIHR0eSByZWxhdGVkIGRhdGEgYmVmb3JlIHdlIGRvd25sb2FkIGFueSBib2FyZHMuCisgKi8KK2ludCBkZ25jX3R0eV9wcmVpbml0KHZvaWQpCit7CisJLyoKKwkgKiBBbGxvY2F0ZSBhIGJ1ZmZlciBmb3IgZG9pbmcgdGhlIGNvcHkgZnJvbSB1c2VyIHNwYWNlIHRvCisJICoga2VybmVsIHNwYWNlIGluIGRnbmNfd3JpdGUoKS4gIFdlIG9ubHkgdXNlIG9uZSBidWZmZXIgYW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qYnVmLCBpbnQgbGVuKQoreworCXN0cnVjdCB0aW1ldmFsIHR2OworCWludCBuOworCWludCByOworCWludCBuYnVmOworCWludCBpOworCWludCB0bXBidWZsZW47CisJY2hhciB0bXBidWZbVE1QQlVGTEVOXTsKKwljaGFyICpwID0gdG1wYnVmOworCWludCB0b29fbXVjaF9kYXRhOworCisJLyogTGVhdmUgaWYgc25pZmYgbm90IG9wZW4gKi8KKwlpZiAoIShjaC0+Y2hfc25pZmZfZmxhZ3MgJiBTTklGRl9PUEVOKSkKKwkJcmV0dXJuOworCisJZG9fZ2V0dGltZW9mZGF5KCZ0dik7CisKKwkvKiBDcmVhdGUgb3VyIGhlYWRlciBmb3IgZGF0YSBkdW1wICovCisJcCArPSBzcHJpbnRmKHAsICI8JWxkICVsZD48JXM+PCIsIHR2LnR2X3NlYywgdHYudHZfdXNlYywgdGV4dCk7CisJdG1wYnVmbGVuID0gcCAtIHRtcGJ1ZjsKKworCWRvIHsKKwkJdG9vX211Y2hfZGF0YSA9IDA7CisKKwkJZm9yIChpID0gMDsgaSA8IGxlbiAmJiB0bXBidWZsZW4gPCAoVE1QQlVGTEVOIC0gNCk7IGkrKykgeworCQkJcCArPSBzcHJpbnRmKHAsICIlMDJ4ICIsICpidWYpOworCQkJYnVmKys7CisJCQl0bXBidWZsZW4gPSBwIC0gdG1wYnVmOworCQl9CisKKwkJaWYgKHRtcGJ1ZmxlbiA8IChUTVBCVUZMRU4gLSA0KSkgeworCQkJaWYgKGkgPiAwKQorCQkJCXAgKz0gc3ByaW50ZihwIC0gMSwgIiVzXG4iLCAiPiIpOworCQkJZWxzZQorCQkJCXAgKz0gc3ByaW50ZihwLCAiJXNcbiIsICI+Iik7CisJCX0gZWxzZSB7CisJCQl0b29fbXVjaF9kYXRhID0gMTsKKwkJCWxlbiAtPSBpOworCQl9CisKKwkJbmJ1ZiA9IHN0cmxlbih0bXBidWYpOworCQlwID0gdG1wYnVmOworCisJCS8qCisJCSAqICBMb29wIHdoaWxlIGR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qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworc3RhdGljIHZvaWQgZGduY193bW92ZShzdHJ1Y3QgY2hhbm5lbF90ICpjaCwgY2hhciAqYnVmLCB1aW50IG4pCit7CisJaW50CXJlbWFpbjsKKwl1aW50CWhlYWQ7CisKKwlpZiAoIWNoIHx8IGNoLT5tYWdpYyAhPSBER05DX0NIQU5ORUxfTUFHSUMpCisJCXJldHVybjsKKworCWhlYWQgPSBjaC0+Y2hfd19oZWFkICYgV1FVRVVFTUFTSzsKKworCS8qCisJICogSWYgdGhlIHdyaXRlIHdyYXBzIG92ZXIgdGhlIHRvcCBvZiB0aGUgY2lyY3VsYXIgYnVmZmVyLAorCSAqIG1vdmUgdGhlIHBvcnRpb24gdXAgdG8gdGhlIHdyYXAgcG9pbnQsIGFuZCByZXNldCB0aGUKKwkgKiBwb2ludGVycyB0byB0aGUgYm90dG9tLgorCSAqLworCXJlbWFpbiA9IFdRVUVVRVNJWkUgLSBoZWFkOworCisJaWYgKG4gPj0gcmVtYWluKSB7CisJCW4gLT0gcmVtYWluOworCQltZW1jcHkoY2gtPmNoX3dxdWV1ZSArIGhlYWQsIGJ1ZiwgcmVtYWluKTsKKwkJaGVhZCA9IDA7CisJCWJ1ZiArPSByZW1haW47CisJfQorCisJaWYgKG4gPiAwKSB7CisJCS8qCisJCSAqIE1vdmUgcmVzdCBvZiBkYXRhLgorCQkgKi8KKwkJcmVtYWluID0gbjsKKwkJbWVtY3B5KGNoLT5jaF93cXVldWUgKyBoZWFkLCBidWYsIHJlbWFpbik7CisJCWhlYWQgKz0gcmVtYWluOworCX0KKworCWhlYWQgJj0gV1FVRVVFTUFTSzsKKwljaC0+Y2hfd19oZWFkID0gaGVhZDsKK30KKworCisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICoKKyAq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OworCX0KKworCWNoLT5jaF9yX3RhaWwgPSB0YWlsICYgcm1hc2s7CisJY2gtPmNoX2VfdGFpbCA9IHRhaWwgJiBybWFzazsKKwlkZ25jX2NoZWNrX3F1ZXVlX2Zsb3dfY29udHJvbChjaCk7CisJREdOQ19VTkxPQ0soY2gtPmNoX2xvY2ssIGxvY2tfZmxhZ3MpOworCisJLyogVGVsbCB0aGUgdHR5IGxheWVyIGl0cyBva2F5IHRvICJlYXQiIHRoZSBkYXRhIG5vdyAqLworCXR0eV9mbGlwX2J1ZmZlcl9wdXNoKHRwLT5wb3J0KTsKKworCWlmIChsZCkKKwkJdHR5X2xkaXNjX2RlcmVmKGxkKTsKKworCURQUl9SRUFEKCgiZGduY19pbnB1dCAtIGZpbmlzaFxuIikpOworfQorCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIERldGVybWluZXMgd2hlbiBDQVJSSUVSIGNoYW5nZXMgc3RhdGUgYW5kIHRha2VzIGFwcHJvcHJpYXRlCisgKiBhY3Rpb24uCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwordm9pZCBkZ25jX2NhcnJpZXIoc3RydWN0IGNoYW5uZWxfdCAqY2gpCit7CisJc3RydWN0IGJvYXJkX3QgKmJkOworCisJaW50IHZpcnRfY2FycmllciA9IDA7CisJaW50IHBoeXNfY2FycmllciA9IDA7CisKKwlEUFJfQ0FSUigoImRnbmNfY2FycmllciBjYWxsZWQuLi5cbiIpKTsKKworCWlmICghY2ggfHwgY2gtPm1hZ2ljICE9IERHTkNfQ0hBTk5FTF9NQUdJQykKKwkJcmV0dXJuOworCisJYmQgPSBjaC0+Y2hfYmQ7CisKKwlpZiAoIWJkIHx8IGJkLT5tYWdpYyAhPSBER05DX0JPQVJEX01BR0lDKQorCQlyZXR1cm47CisKKwlpZiAoY2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WSwgRVhQUkVTUyBPUiBJTVBMSUVEOyB3aXRob3V0IGV2ZW4gdGhlCisgKiBpbXBsaWVkIHdhcnJhbnR5IG9mIE1FUkNIQU5UQUJJTElUWSBvciBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIKKyAqIFBVUlBPU0UuICBTZWUgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGZvciBtb3JlIGRldGFpbHMuCisgKgorICogWW91IHNob3VsZCBoYXZlIHJlY2VpdmVkIGEgY29weSBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UKKyAqIGFsb25nIHdpdGggdGhpcyBwcm9ncmFtOyBpZiBub3QsIHdyaXRlIHRvIHRoZSBGcmVlIFNvZnR3YXJlCisgKiBGb3VuZGF0aW9uLCBJbmMuLCA2NzUgTWFzcyBBdmUsIENhbWJyaWRnZSwgTUEgMDIxMzksIFVTQS4KKyAqCisgKglOT1RFOiBUSElTIElTIEEgU0hBUkVEIEhFQURFUi4gRE8gTk9UIENIQU5HRSBDT0RJTkcgU1RZTEUhISEKKyAqLworCisjaWZuZGVmIF9fRElHSV9ICisjZGVmaW5lIF9fRElHSV9ICisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqKioJRGVmaW5pdGlvbnMgZm9yIERpZ2kgZGl0dHkoMSkgY29tbWFuZC4KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKworLyoKKyAqIENvcHlyaWdodCAoYykgMTk4OC05NiBEaWdpIEludGVybmF0aW9uYWwgSW5jLiwgQWxsIFJpZ2h0cyBSZXNlcnZlZC4KKyAqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBUaGlzIG1vZHVs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UUiBUb2dnbGUgICAgICAgICAgICovCisjZGVmaW5lIERJR0lfNDIyCTB4NDAwMAkJLyogZm9yIDQyMi8yMzIgc2VsZWN0YWJsZSBwYW5lbCAqLworI2RlZmluZSBESUdJX1JUU19UT0dHTEUJMHg4MDAwCQkvKiBTdXBwb3J0IFJUUyBUb2dnbGUJCSovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIFRoZXNlIG9wdGlvbnMgYXJlIG5vdCBzdXBwb3J0ZWQgb24gdGhlIGNvbXhpLgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNkZWZpbmUJRElHSV9DT01YSQkoRElHSV9GQVNUfERJR0lfQ09PS3xEU1JQQUNFfERDRFBBQ0V8RFRSUEFDRSkKKworI2RlZmluZSBESUdJX1BMRU4JMjgJCS8qIFN0cmluZyBsZW5ndGgJCSovCisjZGVmaW5lCURJR0lfVFNJWgkxMAkJLyogVGVybWluYWwgc3RyaW5nIGxlbgkJKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogU3RydWN0dXJlIHVzZWQgd2l0aCBpb2N0bCBjb21tYW5kcyBmb3IgRElHSSBwYXJhbWV0ZXJzLgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3N0cnVjdCBkaWdpX3QgeworCXVuc2lnbmVkIHNob3J0CWRpZ2lfZmxhZ3M7CQkvKiBGbGFncyAoc2VlIGFib3ZlKQkqLworCXVuc2lnbmVkIHNob3J0CWRpZ2lfbWF4Y3BzOwkJLyogTWF4IHByaW50ZXIgQ1BTCSovCisJdW5zaWduZWQgc2hvcnQJZGlnaV9tYXhjaGFyOwkJLyogTWF4IGNoYXJzIGluIHByaW50IHF1ZXVlICovCisJdW5zaWduZWQgc2hvcnQJZGlnaV9idWZzaXplOwkJLyogQnVmZmVyIHNpemUJCSovCisJdW5zaWduZWQgY2hhcglkaWdpX29ubGVuOwkJLyogTGVuZ3RoIG9mIE9OIHN0cmluZwkqLworCXVuc2lnbmVkIGNoYXIJZGlnaV9vZmZsZW47CQkvKiBMZW5ndGggb2YgT0ZGIHN0cmluZwkqLworCWNoYXIJCWRpZ2lfb25zdHJbRElHSV9QTEVOXTsJLyogUHJpbnRlciBvbiBzdHJpbmcJKi8KKwljaGFyCQlkaWdpX29mZnN0cltESUdJX1BMRU5dOwkvKiBQcmludGVyIG9mZiBzdHJpbmcJKi8KKwljaGFyCQlkaWdpX3Rlcm1bRElHSV9UU0laXTsJLyogdGVybWluYWwgc3RyaW5nCSovCit9OworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBLTUUgZGVmaW5pdGlvbnMgYW5kIHN0cnVjdHVyZXMuCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2RlZmluZQlSV19JRExFCQkwCS8qIE9wZXJhdGlvbiBjb21wbGV0ZQkJCSovCisjZGVmaW5lCVJXX1JFQUQJCTEJLyogUmVhZCBDb25jZW50cmF0b3IgTWVtb3J5CQkqLworI2RlZmluZQlSV19XUklURQkyCS8qIFdyaXRlIENvbmNlbnRyYXRvciBNZW1vcnkJCSovCisKK3N0cnVjdCByd190IHsKKwl1bnNpZ25lZCBjaGFyCXJ3X3JlcTsJCS8qIFJlcXVlc3QgdHlwZQkJCSovCisJdW5zaWduZWQgY2hhcglyd19ib2FyZDsJLyogSG9zdCBBZGFwdGVyIGJvYXJkIG51bWJlcgkqLworCXVuc2lnbmVkIGNoYXIJcndfY29uYzsJLyogQ29uY2VudHJ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DIgPSBQQy9YbSwKKwkJCQkJCQkgICAgICAzID0gUEMvWGUKKwkJCQkJCQkgICAgICA0ID0gTUMvWGkKKwkJCQkJCQkgICAgICA1ID0gQ09NWC9pICovCisJdW5zaWduZWQgY2hhcglzaHJpbmtfYnVmX2NhcmQ7CS8qIENhcmQgbnVtYmVyICovCisKK307CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIFN0cnVjdHVyZSB0byBnZXQgZHJpdmVyIHN0YXR1cyBpbmZvcm1hdGlvbgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3N0cnVjdCBkaWdpX2RpbmZvIHsKKwl1bnNpZ25lZCBpbnQJZGluZm9fbmJvYXJkczsJCS8qICMgYm9hcmRzIGNvbmZpZ3VyZWQJKi8KKwljaGFyCQlkaW5mb19yZXNlcnZlZFsxMl07CS8qIGZvciBmdXR1cmUgZXhwYW5zaW9uICovCisJY2hhcgkJZGluZm9fdmVyc2lvblsxNl07CS8qIGRyaXZlciB2ZXJzaW9uICAgICAgICovCit9OworCisjZGVmaW5lCURJR0lfR0VUREQJKCdkJzw8OCkgfCAyNDgJCS8qIGdldCBkcml2ZXIgaW5mbyAgICAgICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIFN0cnVjdHVyZSB1c2VkIHdpdGggaW9jdGwgY29tbWFuZHMgZm9yIHBlci1ib2FyZCBpbmZvcm1hdGlvbgorICoKKyAqIHBoeXNzaXplIGFuZCBtZW1zaXplIGRpZmZlciB3aGVuIGJvYXJkIGhhcyAid2luZG93ZWQiIG1lbW9yeQorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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hZyBmb3IgY2hhbm5lbCAgICAgICAqLworCXVuc2lnbmVkIGludAlpbmZvX2lmbGFnOwkJLyogaWZsYWcgZm9yIGNoYW5uZWwgICAgICAgKi8KKwl1bnNpZ25lZCBpbnQJaW5mb19vZmxhZzsJCS8qIG9mbGFnIGZvciBjaGFubmVsICAgICAgICovCisJdW5zaWduZWQgaW50CWluZm9fbXN0YXQ7CQkvKiBtc3RhdCBmb3IgY2hhbm5lbCAgICAgICAqLworCXVuc2lnbmVkIGludAlpbmZvX3R4X2RhdGE7CQkvKiB0eF9kYXRhIGZvciBjaGFubmVsICAgICAgICovCisJdW5zaWduZWQgaW50CWluZm9fcnhfZGF0YTsJCS8qIHJ4X2RhdGEgZm9yIGNoYW5uZWwgICAgICAgKi8KKwl1bnNpZ25lZCBpbnQJaW5mb19oZmxvdzsJCS8qIGhmbG93IGZvciBjaGFubmVsICAgICAgICovCisJdW5zaWduZWQgaW50CWluZm9fcmVzZXJ2ZWRbOF07CS8qIGZvciBmdXR1cmUgZXhwYW5zaW9uICAgICovCit9OworCisjZGVmaW5lCURJR0lfR0VUU1RBVAkoJ2QnPDw4KSB8IDI0NAkJLyogZ2V0IGJvYXJkIGluZm8gICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBTdHJ1Y3R1cmUgdXNlZCB3aXRoIGlvY3RsIGNvbW1hbmRzIGZvciBwZXItY2hhbm5lbCBpbmZvcm1hdGlvbgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdHJ1Y3QgZGlnaV9jaCB7CisJdW5zaWduZWQgaW50CWluZm9fYmRudW07CQkvKiBCb2FyZCBudW1iZXIgKDAgYmFzZWQpICAqLworCXVuc2lnbmVkIGludAlpbmZvX2NoYW5uZWw7CQkvKiBDaGFubmVsI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ICAgICAgICAwMDA3CisjZGVmaW5lIFRfUENYSSAgICAgICAgICAwMDAwCisjZGVmaW5lIFRfUENYRU0gICAgICAgICAwMDAxCisjZGVmaW5lIFRfUENYRSAgICAgICAgICAwMDAyCisjZGVmaW5lIFRfUENYUiAgICAgICAgICAwMDAzCisjZGVmaW5lIFRfU1AgICAgICAgICAgICAwMDA0CisjZGVmaW5lIFRfU1BfUExVUyAgICAgICAwMDA1CisKKyNkZWZpbmUgVF9IRVJDICAgMDAwMAorI2RlZmluZSBUX0hPVSAgICAwMDAxCisjZGVmaW5lIFRfTE9OICAgIDAwMDIKKyNkZWZpbmUgVF9DSEEgICAgMDAwMworCisjZGVmaW5lIFRfTkVPCSAwMDAwCisjZGVmaW5lIFRfTkVPX0VYUFJFU1MgIDAwMDEKKyNkZWZpbmUgVF9DTEFTU0lDIDAwMDIKKworI2RlZmluZSBGQU1JTFkgICAgICAgICAgMDA3MAorI2RlZmluZSBUX0NPTVhJICAgICAgICAgMDAwMAorI2RlZmluZQlUX05JCQkwMDAwCisjZGVmaW5lIFRfUENYWCAgICAgICAgICAwMDEwCisjZGVmaW5lIFRfQ1ggICAgICAgICAgICAwMDIwCisjZGVmaW5lIFRfRVBDICAgICAgICAgICAwMDMwCisjZGVmaW5lIFRfUENMSVRFICAgICAgICAwMDQwCisjZGVmaW5lIFRfU1BYWCAgICAgICAgICAwMDUwCisjZGVmaW5lIFRfQVZYWCAgICAgICAgICAwMDYwCisjZGVmaW5lIFRfRFhCICAgICAgICAgICAwMDcwCisjZGVmaW5lIFRfQTJLXzRfOCAgICAgICAwMDcwCisKKyNkZWZpbmUgQlVTVFlQRSAgICAgICAgIDA3MDAKKyNkZWZpbmUgVF9JU0FCVVMgICAgICAgIDAwMDAKKyNkZWZpbmUgVF9NQ0JVUyAgICAgICAgIDAxMDAKKyNkZWZpbmUgVF9FSVNBQlVTICAgICAgIDAyMDAKKyNkZWZpbmUgVF9QQ0lCVVMgICAgICAgIDA0MDAKKworLyogQm9hc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yIHRoaXMgcGFyYW1ldGVyIGlmCi0gKiAgICAgICAgICAgICAgICAgICAgICBub25lIGlzIHNwZWNpZmllZC4KLSAqICAgICAgICAgICAgICAgICAgICAgICAwIC0gSE5QIGFuZCBTUlAgY2FwYWJsZSAoZGVmYXVsdCkKKyAqIEBvdGdfY2FwOiAgICAgICAgICAgIFNwZWNpZmllcyB0aGUgT1RHIGNhcGFiaWxpdGllcy4KKyAqICAgICAgICAgICAgICAgICAgICAgICAwIC0gSE5QIGFuZCBTUlAgY2FwYWJsZQogICogICAgICAgICAgICAgICAgICAgICAgIDEgLSBTUlAgT25seSBjYXBhYmxlCi0gKiAgICAgICAgICAgICAgICAgICAgICAgMiAtIE5vIEhOUC9TUlAgY2FwYWJsZQorICogICAgICAgICAgICAgICAgICAgICAgIDIgLSBObyBITlAvU1JQIGNhcGFibGUgKGFsd2F5cyBhdmFpbGFibGUpCisgKiAgICAgICAgICAgICAgICAgICAgICBEZWZhdWx0cyB0byBiZXN0IGF2YWlsYWJsZSBvcHRpb24gKDAsIDEsIHRoZW4gMikKKyAqIEBvdGdfdmVyOiAgICAgICAgICAgIE9URyB2ZXJzaW9uIHN1cHBvcnRlZAorICogICAgICAgICAgICAgICAgICAgICAgIDAgLSAxLjMgKGRlZmF1bHQpCisgKiAgICAgICAgICAgICAgICAgICAgICAgMSAtIDIuMAogICogQGRtYV9lbmFibGU6ICAgICAgICAgU3BlY2lmaWVzIHdoZXRoZXIgdG8gdXNlIHNsYXZlIG9yIERNQSBtb2RlIGZvciBhY2Nlc3NpbmcKICAqICAgICAgICAgICAgICAgICAgICAgIHRoZSBkYXRhIEZJRk9zLiBUaGUgZHJpdmVyIHdpbGwgYXV0b21hdGljYWxseSBkZXRlY3QgdGhlCiAgKiAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSBmb3IgdGhpcyBwYXJhbWV0ZXIgaWYgbm9uZSBpcyBzcGVjaWZpZWQuCi0gKiAgICAgICAgICAgICAgICAgICAgICAgMCAtIFNsYXZlCisgKiAgICAgICAgICAgICAgICAgICAgICAgMCAtIFNsYXZlIChhbHdheXMgYXZhaWxhYmxlKQogICogICAgICAgICAgICAgICAgICAgICAgIDEgLSBETUEgKGRlZmF1bHQsIGlmIGF2YWlsYWJsZSkKICAqIEBkbWFfZGVzY19lbmFibGU6ICAgIFdoZW4gRE1BIG1vZGUgaXMgZW5hYmxlZCwgc3BlY2lmaWVzIHdoZXRoZXIgdG8gdXNlCiAgKiAgICAgICAgICAgICAgICAgICAgICBhZGRyZXNzIERNQSBtb2RlIG9yIGRlc2NyaXB0b3IgRE1BIG1vZGUgZm9yIGFjY2Vzc2luZwpAQCAtODgsMzkgKzkwLDQ3IEBACiAgKiBAc3BlZWQ6ICAgICAgICAgICAgICBTcGVjaWZpZXMgdGhlIG1heGltdW0gc3BlZWQgb2Ygb3BlcmF0aW9uIGluIGhvc3QgYW5kCiAgKiAgICAgICAgICAgICAgICAgICAgICBkZXZpY2UgbW9kZS4gVGhlIGFjdHVhbCBzcGVlZCBkZXBlbmRzIG9uIHRoZSBzcGVlZCBvZgogICogICAgICAgICAgICAgICAgICAgICAgdGhlIGF0dGFjaGVkIGRldmljZSBhbmQgdGhlIHZhbHVlIG9mIHBoeV90eXBlLgotICogICAgICAgICAgICAgICAgICAgICAgIDAgLSBIaWdoIFNwZWVkIChkZWZhdWx0KQorICogICAgICAgICAgICAgICAgICAgICAgIDAgLSBIaWdoIFNwZWVkCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgIChkZWZhdWx0IHdoZW4gcGh5X3R5cGUgaXMgVVRNSSsgb3IgVUxQSSkKICAqICAgICAgICAgICAgICAgICAgICAgICAxIC0gRnVsbCBTcGVlZAotICogQGhvc3Rfc3VwcG9ydF9mc19sc19sb3dfcG93ZXI6IFNwZWNpZmllcyB3aGV0aGVyIGxvdyBwb3dlciBtb2RlIGlzIHN1cHBvcnRlZAotICogICAgICAgICAgICAgICAgICAgICAgd2hlbiBhdHRhY2hlZCB0byBhIEZ1bGwgU3BlZWQgb3IgTG93IFNwZWVkIGRldmljZSBpbgotICogICAgICAgICAgICAgICAgICAgICAgaG9zdCBtb2RlLgotICogICAgICAgICAgICAgICAgICAgICAgIDAgLSBEb24ndCBzdXBwb3J0IGxvdyBwb3dlciBtb2RlIChkZWZhdWx0KQotICogICAgICAgICAgICAgICAgICAgICAgIDEgLSBTdXBwb3J0IGxvdyBwb3dlciBtb2RlCi0gKiBAaG9zdF9sc19sb3dfcG93ZXJfcGh5X2NsazogU3BlY2lmaWVzIHRoZSBQSFkgY2xvY2sgcmF0ZSBpbiBsb3cgcG93ZXIgbW9kZQotICogICAgICAgICAgICAgICAgICAgICAgd2hlbiBjb25uZWN0ZWQgdG8gYSBMb3cgU3BlZWQgZGV2aWNlIGluIGhvc3QgbW9kZS4gVGhpcwotICogICAgICAgICAgICAgICAgICAgICAgcGFyYW1ldGVyIGlzIGFwcGxpY2FibGUgb25seSBpZgotICogICAgICAgICAgICAgICAgICAgICAgaG9zdF9zdXBwb3J0X2ZzX2xzX2xvd19wb3dlciBpcyBlbmFibGVkLiBJZiBwaHlfdHlwZSBpcwotICogICAgICAgICAgICAgICAgICAgICAgc2V0IHRvIEZTIHRoZW4gZGVmYXVsdHMgdG8gNiBNSFogb3RoZXJ3aXNlIDQ4IE1IWi4KLSAqICAgICAgICAgICAgICAgICAgICAgICAwIC0gNDggTUh6Ci0gKiAgICAgICAgICAgICAgICAgICAgICAgMSAtIDYgTUh6CisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgIChkZWZhdWx0IHdoZW4gcGh5X3R5cGUgaXMgRnVsbCBTcGVlZCkKICAqIEBlbmFibGVfZHluYW1pY19maWZvOiAwIC0gVXNlIGNvcmVDb25zdWx0YW50LXNwZWNpZmllZCBGSUZPIHNpemUgcGFyYW1ldGVycwotICogICAgICAgICAgICAgICAgICAgICAgIDEgLSBBbGxvdyBkeW5hbWljIEZJRk8gc2l6aW5nIChkZWZhdWx0KQorICogICAgICAgICAgICAgICAgICAgICAgIDEgLSBBbGxvdyBkeW5hbWljIEZJRk8gc2l6aW5nIChkZWZhdWx0LCBpZiBhdmFpbGFibGUpCisgKiBAZW5fbXVsdGlwbGVfdHhfZmlmbzogU3BlY2lmaWVzIHdoZXRoZXIgZGVkaWNhdGVkIHBlci1lbmRwb2ludCB0cmFuc21pdCBGSUZPcworICogICAgICAgICAgICAgICAgICAgICAgYXJlIGVuYWJsZWQKICAqIEBob3N0X3J4X2ZpZm9fc2l6ZTogIE51bWJlciBvZiA0LWJ5dGUgd29yZHMgaW4gdGhlIFJ4IEZJRk8gaW4gaG9zdCBtb2RlIHdoZW4KICAqICAgICAgICAgICAgICAgICAgICAgIGR5bmFtaWMgRklGTyBzaXppbmcgaXMgZW5hYmxlZAotICogICAgICAgICAgICAgICAgICAgICAgIDE2IHRvIDMyNzY4IChkZWZhdWx0IDEwMjQpCisgKiAgICAgICAgICAgICAgICAgICAgICAgMTYgdG8gMzI3NjgKKyAqICAgICAgICAgICAgICAgICAgICAgIEFjdHVhbCBtYXhpbXVtIHZhbHVlIGlzIGF1dG9kZXRlY3RlZCBhbmQgYWxzbworICogICAgICAgICAgICAgICAgICAgICAgdGhlIGRlZmF1bHQuCiAgKiBAaG9zdF9ucGVyaW9fdHhfZmlmb19zaXplOiBOdW1iZXIgb2YgNC1ieXRlIHdvcmRzIGluIHRoZSBub24tcGVyaW9kaWMgVHggRklGTwogICogICAgICAgICAgICAgICAgICAgICAgaW4gaG9zdCBtb2RlIHdoZW4gZHluYW1pYyBGSUZPIHNpemluZyBpcyBlbmFibGVkCi0gKiAgICAgICAgICAgICAgICAgICAgICAgMTYgdG8gMzI3NjggKGRlZmF1bHQgMTAyNCkKKyAqICAgICAgICAgICAgICAgICAgICAgICAxNiB0byAzMjc2OAorICogICAgICAgICAgICAgICAgICAgICAgQWN0dWFsIG1heGltdW0gdmFsdWUgaXMgYXV0b2RldGVjdGVkIGFuZCBhbHNvCisgKiAgICAgICAgICAgICAgICAgICAgICB0aGUgZGVmYXVsdC4KICAqIEBob3N0X3BlcmlvX3R4X2ZpZm9fc2l6ZTogTnVtYmVyIG9mIDQtYnl0ZSB3b3JkcyBpbiB0aGUgcGVyaW9kaWMgVHggRklGTyBpbgogICogICAgICAgICAgICAgICAgICAgICAgaG9zdCBtb2RlIHdoZW4gZHluYW1pYyBGSUZPIHNpemluZyBpcyBlbmFibGVkCi0gKiAgICAgICAgICAgICAgICAgICAgICAgMTYgdG8gMzI3NjggKGRlZmF1bHQgMTAyNCkKKyAqICAgICAgICAgICAgICAgICAgICAgICAxNiB0byAzMjc2OAorICogICAgICAgICAgICAgICAgICAgICAgQWN0dWFsIG1heGltdW0gdmFsdWUgaXMgYXV0b2RldGVjdGVkIGFuZCBhbHNvCisgKiAgICAgICAgICAgICAgICAgICAgICB0aGUgZGVmYXVsdC4KICAqIEBtYXhfdHJhbnNmZXJfc2l6ZTogIFRoZSBtYXhpbXVtIHRyYW5zZmVyIHNpemUgc3VwcG9ydGVkLCBpbiBieXRlcwotICogICAgICAgICAgICAgICAgICAgICAgIDIwNDcgdG8gNjUsNTM1IChkZWZhdWx0IDY1LDUzNSkKKyAqICAgICAgICAgICAgICAgICAgICAgICAyMDQ3IHRvIDY1LDUzNQorICogICAgICAgICAgICAgICAgICAgICAgQWN0dWFsIG1heGltdW0gdmFsdWUgaXMgYXV0b2RldGVjdGVkIGFuZCBhbHNvCisgKiAgICAgICAgICAgICAgICAgICAgICB0aGUgZGVmYXVsdC4KICAqIEBtYXhfcGFja2V0X2NvdW50OiAgIFRoZSBtYXhpbXVtIG51bWJlciBvZiBwYWNrZXRzIGluIGEgdHJhbnNmZXIKLSAqICAgICAgICAgICAgICAgICAgICAgICAxNSB0byA1MTEgKGRlZmF1bHQgNTExKQorICogICAgICAgICAgICAgICAgICAgICAgIDE1IHRvIDUxMQorICogICAgICAgICAgICAgICAgICAgICAgQWN0dWFsIG1heGltdW0gdmFsdWUgaXMgYXV0b2RldGVjdGVkIGFuZCBhbHNvCisgKiAgICAgICAgICAgICAgICAgICAgICB0aGUgZGVmYXVsdC4KICAqIEBob3N0X2NoYW5uZWxzOiAgICAgIFRoZSBudW1iZXIgb2YgaG9zdCBjaGFubmVsIHJlZ2lzdGVycyB0byB1c2UKLSAqICAgICAgICAgICAgICAgICAgICAgICAxIHRvIDE2IChkZWZhdWx0IDEyKQorICogICAgICAgICAgICAgICAgICAgICAgIDEgdG8gMTYKKyAqICAgICAgICAgICAgICAgICAgICAgIEFjdHVhbCBtYXhpbXVtIHZhbHVlIGlzIGF1dG9kZXRlY3RlZCBhbmQgYWxzbworICogICAgICAgICAgICAgICAgICAgICAgdGhlIGRlZmF1bHQuCiAgKiBAcGh5X3R5cGU6ICAgICAgICAgICBTcGVjaWZpZXMgdGhlIHR5cGUgb2YgUEhZIGludGVyZmFjZSB0byB1c2UuIEJ5IGRlZmF1bHQsCiAgKiAgICAgICAgICAgICAgICAgICAgICB0aGUgZHJpdmVyIHdpbGwgYXV0b21hdGljYWxseSBkZXRlY3QgdGhlIHBoeV90eXBlLgorICogICAgICAgICAgICAgICAgICAgICAgIDAgLSBGdWxsIFNwZWVkIFBoeQorICogICAgICAgICAgICAgICAgICAgICAgIDEgLSBVVE1JKyBQaHkKKyAqICAgICAgICAgICAgICAgICAgICAgICAyIC0gVUxQSSBQaHkKKyAqICAgICAgICAgICAgICAgICAgICAgIERlZmF1bHRzIHRvIGJlc3QgYXZhaWxhYmxlIG9wdGlvbiAoMiwgMSwgdGhlbiAwKQogICogQHBoeV91dG1pX3dpZHRoOiAgICAgU3BlY2lmaWVzIHRoZSBVVE1JKyBEYXRhIFdpZHRoIChpbiBiaXRzKS4gVGhpcyBwYXJhbWV0ZXIKICAqICAgICAgICAgICAgICAgICAgICAgIGlzIGFwcGxpY2FibGUgZm9yIGEgcGh5X3R5cGUgb2YgVVRNSSsgb3IgVUxQSS4gKEZvciBhCiAgKiAgICAgICAgICAgICAgICAgICAgICBVTFBJIHBoeV90eXBlLCB0aGlzIHBhcmFtZXRlciBpbmRpY2F0ZXMgdGhlIGRhdGEgd2lkdGgKQEAgLTEyOSw3ICsxMzksNyBAQAogICogICAgICAgICAgICAgICAgICAgICAgcGFyYW1ldGVyIHdhcyBzZXQgdG8gIjggYW5kIDE2IGJpdHMiLCBtZWFuaW5nIHRoYXQgdGhlCiAgKiAgICAgICAgICAgICAgICAgICAgICBjb3JlIGhhcyBiZWVuIGNvbmZpZ3VyZWQgdG8gd29yayBhdCBlaXRoZXIgZGF0YSBwYXRoCiAgKiAgICAgICAgICAgICAgICAgICAgICB3aWR0aC4KLSAqICAgICAgICAgICAgICAgICAgICAgICA4IG9yIDE2IChkZWZhdWx0IDE2KQorICogICAgICAgICAgICAgICAgICAgICAgIDggb3IgMTYgKGRlZmF1bHQgMTYgaWYgYXZhaWxhYmxlKQogICogQHBoeV91bHBpX2RkcjogICAgICAgU3BlY2lmaWVzIHdoZXRoZXIgdGhlIFVMUEkgb3BlcmF0ZXMgYXQgZG91YmxlIG9yIHNpbmdsZQogICogICAgICAgICAgICAgICAgICAgICAgZGF0YSByYXRlLiBUaGlzIHBhcmFtZXRlciBpcyBvbmx5IGFwcGxpY2FibGUgaWYgcGh5X3R5cGUKICAqICAgICAgICAgICAgICAgICAgICAgIGlzIFVMUEkuCkBAIC0xMzksMjcgKzE0OSw1MSBAQAogICogICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhIGJ1cwogICogQHBoeV91bHBpX2V4dF92YnVzOiAgRm9yIGEgVUxQSSBwaHksIHNwZWNpZmllcyB3aGV0aGVyIHRvIHVzZSB0aGUgaW50ZXJuYWwgb3IKICAqICAgICAgICAgICAgICAgICAgICAgIGV4dGVybmFsIHN1cHBseSB0byBkcml2ZSB0aGUgVkJ1cworICogICAgICAgICAgICAgICAgICAgICAgIDAgLSBJbnRlcm5hbCBzdXBwbHkgKGRlZmF1bHQpCisgKiAgICAgICAgICAgICAgICAgICAgICAgMSAtIEV4dGVybmFsIHN1cHBseQogICogQGkyY19lbmFibGU6ICAgICAgICAgU3BlY2lmaWVzIHdoZXRoZXIgdG8gdXNlIHRoZSBJMkNpbnRlcmZhY2UgZm9yIGEgZnVsbAogICogICAgICAgICAgICAgICAgICAgICAgc3BlZWQgUEhZLiBUaGlzIHBhcmFtZXRlciBpcyBvbmx5IGFwcGxpY2FibGUgaWYgcGh5X3R5cGUKICAqICAgICAgICAgICAgICAgICAgICAgIGlzIEZTLgogICogICAgICAgICAgICAgICAgICAgICAgIDAgLSBObyAoZGVmYXVsdCkKICAqICAgICAgICAgICAgICAgICAgICAgICAxIC0gWWVzCi0gKiBAdWxwaV9mc19sczogICAgICAgICBUcnVlIHRvIG1ha2UgVUxQSSBwaHkgb3BlcmF0ZSBpbiBGUy9MUyBtb2RlIG9ubHkKLSAqIEB0c19kbGluZTogICAgICAgICAgIFRydWUgdG8gZW5hYmxlIFRlcm0gU2VsZWN0IERsaW5lIHB1bHNpbmcKLSAqIEBlbl9tdWx0aXBsZV90eF9maWZvOiBTcGVjaWZpZXMgd2hldGhlciBkZWRpY2F0ZWQgcGVyLWVuZHBvaW50IHRyYW5zbWl0IEZJRk9zCi0gKiAgICAgICAgICAgICAgICAgICAgICBhcmUgZW5hYmxlZAotICogQHJlbG9hZF9jdGw6ICAgICAgICAgVHJ1ZSB0byBhbGxvdyBkeW5hbWljIHJlbG9hZGluZyBvZiBIRklSIHJlZ2lzdGVyIGR1cmluZwotICogICAgICAgICAgICAgICAgICAgICAgcnVudGltZQotICogQGFoYl9zaW5nbGU6ICAgICAgICAgVGhpcyBiaXQgZW5hYmxlcyBTSU5HTEUgdHJhbnNmZXJzIGZvciByZW1haW5kZXIgZGF0YSBpbgotICogICAgICAgICAgICAgICAgICAgICAgYSB0cmFuc2ZlciBmb3IgRE1BIG1vZGUgb2Ygb3BlcmF0aW9uLgotICogICAgICAgICAgICAgICAgICAgICAgIDAgLSByZW1haW5kZXIgZGF0YSB3aWxsIGJlIHNlbnQgdXNpbmcgSU5DUiBidXJzdCBzaXplCi0gKiAgICAgICAgICAgICAgICAgICAgICAgMSAtIHJlbWFpbmRlciBkYXRhIHdpbGwgYmUgc2VudCB1c2luZyBTSU5HTEUgYnVyc3Qgc2l6ZQotICogQG90Z192ZXI6ICAgICAgICAgICAgT1RHIHZlcnNpb24gc3VwcG9ydGVkCi0gKiAgICAgICAgICAgICAgICAgICAgICAgMCAtIDEuMwotICogICAgICAgICAgICAgICAgICAgICAgIDEgLSAyLjAKKyAqIEB1bHBpX2ZzX2xzOiAgICAgICAgIE1ha2UgVUxQSSBwaHkgb3BlcmF0ZSBpbiBGUy9MUyBtb2RlIG9ubHkKKyAqICAgICAgICAgICAgICAgICAgICAgICAwIC0gTm8gKGRlZmF1bHQpCisgKiAgICAgICAgICAgICAgICAgICAgICAgMSAtIFllcworICogQGhvc3Rfc3VwcG9ydF9mc19sc19sb3dfcG93ZXI6IFNwZWNpZmllcyB3aGV0aGVyIGxvdyBwb3dlciBtb2RlIGlzIHN1cHBvcnRlZAorICogICAgICAgICAgICAgICAgICAgICAgd2hlbiBhdHRhY2hlZCB0byBhIEZ1bGwgU3BlZWQgb3IgTG93IFNwZWVkIGRldmljZSBpbgorICogICAgICAgICAgICAgICAgICAgICAgaG9zdCBtb2RlLgorICogICAgICAgICAgICAgICAgICAgICAgIDAgLSBEb24ndCBzdXBwb3J0IGxvdyBwb3dlciBtb2RlIChkZWZhdWx0KQorICogICAgICAgICAgICAgICAgICAgICAgIDEgLSBTdXBwb3J0IGxvdyBwb3dlciBtb2RlCisgKiBAaG9zdF9sc19sb3dfcG93ZXJfcGh5X2NsazogU3BlY2lmaWVzIHRoZSBQSFkgY2xvY2sgcmF0ZSBpbiBsb3cgcG93ZXIgbW9kZQorICogICAgICAgICAgICAgICAgICAgICAgd2hlbiBjb25uZWN0ZWQgdG8gYSBMb3cgU3BlZWQgZGV2aWNlIGluIGhvc3QKKyAqICAgICAgICAgICAgICAgICAgICAgIG1vZGUuIFRoaXMgcGFyYW1ldGVyIGlzIGFwcGxpY2FibGUgb25seSBpZgorICogICAgICAgICAgICAgICAgICAgICAgaG9zdF9zdXBwb3J0X2ZzX2xzX2xvd19wb3dlciBpcyBlbmFibGVkLgorICogICAgICAgICAgICAgICAgICAgICAgIDAgLSA0OCBNSHoKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRlZmF1bHQgd2hlbiBwaHlfdHlwZSBpcyBVVE1JKyBvciBVTFBJKQorICogICAgICAgICAgICAgICAgICAgICAgIDEgLSA2IE1IegorICogICAgICAgICAgICAgICAgICAgICAgICAgICAoZGVmYXVsdCB3aGVuIHBoeV90eXBlIGlzIEZ1bGwgU3BlZWQpCisgKiBAdHNfZGxpbmU6ICAgICAgICAgICBFbmFibGUgVGVybSBTZWxlY3QgRGxpbmUgcHVsc2luZworICogICAgICAgICAgICAgICAgICAgICAgIDAgLSBObyAoZGVmYXVsdCkKKyAqICAgICAgICAgICAgICAgICAgICAgICAxIC0gWWVzCisgKiBAcmVsb2FkX2N0bDogICAgICAgICBBbGxvdyBkeW5hbWljIHJlbG9hZGluZyBvZiBIRklSIHJlZ2lzdGVyIGR1cmluZyBydW50aW1lCisgKiAgICAgICAgICAgICAgICAgICAgICAgMCAtIE5vIChkZWZhdWx0IGZvciBjb3JlIDwgMi45MmEpCisgKiAgICAgICAgICAgICAgICAgICAgICAgMSAtIFllcyAoZGVmYXVsdCBmb3IgY29yZSA+PSAyLjkyYSkKKyAqIEBhaGJjZmc6ICAgICAgICAgICAgIFRoaXMgZmllbGQgYWxsb3dzIHRoZSBkZWZhdWx0IHZhbHVlIG9mIHRoZSBHQUhCQ0ZHCisgKiAgICAgICAgICAgICAgICAgICAgICByZWdpc3RlciB0byBiZSBvdmVycmlkZGVuCisgKiAgICAgICAgICAgICAgICAgICAgICAgLTEgICAgICAgICAtIEdBSEJDRkcgdmFsdWUgd2lsbCBiZSBzZXQgdG8gMHgwNgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoSU5DUjQsIGRlZmF1bHQpCisgKiAgICAgICAgICAgICAgICAgIC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X3BoeV9jbGs7CiAJaW50IHRzX2RsaW5lOwogCWludCByZWxvYWRfY3RsOwotCWludCBhaGJfc2luZ2xlOworCWludCBhaGJjZmc7Cit9OworCisvKioKKyAqIHN0cnVjdCBkd2MyX2h3X3BhcmFtcyAtIEF1dG9kZXRlY3RlZCBwYXJhbWV0ZXJzLgorICoKKyAqIFRoZXNlIHBhcmFtZXRlcnMgYXJlIHRoZSB2YXJpb3VzIHBhcmFtZXRlcnMgcmVhZCBmcm9tIGhhcmR3YXJlCisgKiByZWdpc3RlcnMgZHVyaW5nIGluaXRpYWxpemF0aW9uLiBUaGV5IHR5cGljYWxseSBjb250YWluIHRoZSBiZXN0CisgKiBzdXBwb3J0ZWQgb3IgbWF4aW11bSB2YWx1ZSB0aGF0IGNhbiBiZSBjb25maWd1cmVkIGluIHRoZQorICogY29ycmVzcG9uZGluZyBkd2MyX2NvcmVfcGFyYW1zIHZhbHVlLgorICoKKyAqIFRoZSB2YWx1ZXMgdGhhdCBhcmUgbm90IGluIGR3YzJfY29yZV9wYXJhbXMgYXJlIGRvY3VtZW50ZWQgYmVsb3cuCisgKgorICogQG9wX21vZGUgICAgICAgICAgICAgTW9kZSBvZiBPcGVyYXRpb24KKyAqICAgICAgICAgICAgICAgICAgICAgICAwIC0gSE5QLSBhbmQgU1JQLUNhcGFibGUgT1RHIChIb3N0ICYgRGV2aWNlKQorICogICAgICAgICAgICAgICAgICAgICAgIDEgLSBTUlAtQ2FwYWJsZSBPVEcgKEhvc3QgJiBEZXZpY2UpCisgKiAgICAgICAgICAgICAgICAgICAgICAgMiAtIE5vbi1ITlAgYW5kIE5vbi1TUlAgQ2FwYWJsZSBPVEcgKEhvc3QgJiBEZXZpY2UpCisgKiAgICAgICAgICAgICAgICAgICAgICAgMyAtIFNSUC1DYXBhYmxlIERldmljZQorICogICAgICAgICAgICAgICAgICAgICAgIDQgLSBOb24tT1RHIERldmljZQorICogICAgICAgICAgICAgICAgICAgICAgIDUgLSBTUlAtQ2FwYWJsZSBIb3N0CisgKiAgICAgICAgICAgICAgICAgICAgICAgNiAtIE5vbi1PVEcgSG9zdAorICogQGFyY2ggICAgICAgICAgICAgICAgQXJjaGl0ZWN0dXJlCisgKiAgICAgICAgICAgICAgICAgICAgICAgMCAtIFNsYXZlIG9ubHkKKyAqICAgICAgICAgICAgICAgICAgICAgICAxIC0gRXh0ZXJuYWwgRE1BCisgKiAgICAgICAgICAgICAgICAgICAgICAgMiAtIEludGVybmFsIERNQQorICogQHBvd2VyX29wdGltaXplZCAgICAgQXJlIHBvd2VyIG9wdGltaXphdGlvbnMgZW5hYmxlZD8KKyAqIEBudW1fZGV2X2VwICAgICAgICAgIE51bWJlciBvZiBkZXZpY2UgZW5kcG9pbnRzIGF2YWlsYWJsZQorICogQG51bV9kZXZfcGVyaW9faW5fZXAgTnVtYmVyIG9mIGRldmljZSBwZXJpb2RpYyBJTiBlbmRwb2ludHMKKyAqICAgICAgICAgICAgICAgICAgICAgIGF2YWlhbGFibGUKKyAqIEBkZXZfdG9rZW5fcV9kZXB0aCAgIERldmljZSBNb2RlIElOIFRva2VuIFNlcXVlbmNlIExlYXJuaW5nIFF1ZXVlCisgKiAgICAgICAgICAgICAgICAgICAgICBEZXB0aAorICogICAgICAgICAgICAgICAgICAgICAgIDAgdG8gMzAKKyAqIEBob3N0X3BlcmlvX3R4X3FfZGVwdGgKKyAqICAgICAgICAgICAgICAgICAgICAgIEhvc3QgTW9kZSBQZXJpb2RpYyBSZXF1ZXN0IFF1ZXVlIERlcHRoCisgKiAgICAgICAgICAgICAgICAgICAgICAgMiwgNCBvciA4CisgKiBAbnBlcmlvX3R4X3FfZGVwdGgKKyAqICAgICAgICAgICAgICAgICAgICAgIE5vbi1QZXJpb2RpYyBSZXF1ZXN0IFF1ZXVlIERlcHRoCisgKiAgICAgICAgICAgICAgICAgICAgICAgMiwgNCBvciA4CisgKiBAaHNfcGh5X3R5cGUgICAgICAgICBIaWdoLXNwZWVkIFBIWSBpbnRlcmZhY2UgdHlwZQorICogICAgICAgICAgICAgICAgICAgICAgIDAgLSBIaWdoLXNwZWVkIGludGVyZmFjZSBub3Qgc3VwcG9ydGVkCisgKiAgICAgICAgICAgICAgICAgICAgICAgMSAtIFVUTUkrCisgKiAgICAgICAgICAgICAgICAgICAgICAgMiAtIFVMUEkKKyAqICAgICAgICAgICAgICAgICAgICAgICAzIC0gVVRNSSsgYW5kIFVMUEkKKyAqIEBmc19waHlfdHlwZSAgICAgICAgIEZ1bGwtc3BlZWQgUEhZIGludGVyZmFjZSB0eXBlCisgKiAgICAgICAgICAgICAgICAgICAgICAgMCAtIEZ1bGwgc3BlZWQgaW50ZXJmYWNlIG5vdCBzdXBwb3J0ZWQKKyAqICAgICAgICAgICAgICAgICAgICAgICAxIC0gRGVkaWNhdGVkIGZ1bGwgc3BlZWQgaW50ZXJmYWNlCisgKiAgICAgICAgICAgICAgICAgICAgICAgMiAtIEZTIHBpbnMgc2hhcmVkIHdpdGggVVRNSSsgcGlucworICogICAgICAgICAgICAgICAgICAgICAgIDMgLSBGUyBwaW5zIHNoYXJlZCB3aXRoIFVMUEkgcGlucworICogQHRvdGFsX2ZpZm9fc2l6ZTogICAgVG90YWwgaW50ZXJuYWwgUkFNIGZvciBGSUZPcyAoYnl0ZXMpCisgKiBAdXRtaV9waHlfZGF0YV93aWR0aCBVVE1JKyBQSFkgZGF0YSB3aWR0aAorICogICAgICAgICAgICAgICAgICAgICAgIDAgLSA4IGJpdHMKKyAqICAgICAgICAgICAgICAgICAgICAgICAxIC0gMTYgYml0cworICogICAgICAgICAgICAgICAgICAgICAgIDIgLSA4IG9yIDE2IGJpdHMKKyAqIEBzbnBzaWQ6ICAgICAgICAgICAgIFZhbHVlIGZyb20gU05QU0lEIHJlZ2lzdGVyCisgKi8KK3N0cnVjdCBkd2MyX2h3X3BhcmFtcyB7CisJdW5zaWduZWQgb3BfbW9kZTozOworCXVuc2lnbmVkIGFyY2g6MjsKKwl1bnNpZ25lZCBkbWFfZGVzY19lbmFibGU6M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PTlYsICAgICAgICAgICJMRExNX0ZMX0JMT0NLX0NPTlYifSwKKyAge0xETE1fRkxfQkxPQ0tfV0FJVCwgICAgICAgICAgIkxETE1fRkxfQkxPQ0tfV0FJVCJ9LAorICB7TERMTV9GTF9BU1RfU0VOVCwgICAgICAgICAgICAiTERMTV9GTF9BU1RfU0VOVCJ9LAorICB7TERMTV9GTF9SRVBMQVksICAgICAgICAgICAgICAiTERMTV9GTF9SRVBMQVkifSwKKyAge0xETE1fRkxfSU5URU5UX09OTFksICAgICAgICAgIkxETE1fRkxfSU5URU5UX09OTFkifSwKKyAge0xETE1fRkxfSEFTX0lOVEVOVCwgICAgICAgICAgIkxETE1fRkxfSEFTX0lOVEVOVCJ9LAorICB7TERMTV9GTF9ESVNDQVJEX0RBVEEsICAgICAgICAiTERMTV9GTF9ESVNDQVJEX0RBVEEifSwKKyAge0xETE1fRkxfTk9fVElNRU9VVCwgICAgICAgICAgIkxETE1fRkxfTk9fVElNRU9VVCJ9LAorICB7TERMTV9GTF9CTE9DS19OT1dBSVQsICAgICAgICAiTERMTV9GTF9CTE9DS19OT1dBSVQifSwKKyAge0xETE1fRkxfVEVTVF9MT0NLLCAgICAgICAgICAgIkxETE1fRkxfVEVTVF9MT0NLIn0sCisgIHtMRExNX0ZMX0NBTkNFTF9PTl9CTE9DSywgICAgICJMRExNX0ZMX0NBTkNFTF9PTl9CTE9DSyJ9LAorICB7TERMTV9GTF9ERU5ZX09OX0NPTlRFTlRJT04sICAiTERMTV9GTF9ERU5ZX09OX0NPTlRFTlRJT04ifSwKKyAge0xETE1fRkxfQVNUX0RJU0NBUkRfREFUQSwgICAgIkxETE1fRkxfQVNUX0RJU0NBUkRfREFUQSJ9LAorICB7TERMTV9GTF9GQUlMX0xPQywgICAgICAgICAgICAiTERMTV9GTF9GQUlMX0xPQyJ9LAorICB7TERMTV9GTF9TS0lQUEVELCAgICAgICAgICAgICAiTERMTV9GTF9TS0lQUEVEIn0sCisgIHtMRExNX0ZMX0NCUEVORElORywgICAgICAgICAgICJMRExNX0ZMX0NCUEVORElORyJ9LAorICB7TERMTV9GTF9XQUlUX05PUkVQUk9DLCAgICAgICAiTERMTV9GTF9XQUlUX05PUkVQUk9DIn0sCisgIHtMRExNX0ZMX0NBTkNFTCwgICAgICAgICAgICAgICJMRExNX0ZMX0NBTkNFTCJ9LAorICB7TERMTV9GTF9MT0NBTF9PTkxZLCAgICAgICAgICAiTERMTV9GTF9MT0NBTF9PTkxZIn0sCisgIHtMRExNX0ZMX0ZBSUxFRCwgICAgICAgICAgICAgICJMRExNX0ZMX0ZBSUxFRCJ9LAorICB7TERMTV9GTF9DQU5DRUxJTkcsICAgICAgICAgICAiTERMTV9GTF9DQU5DRUxJTkcifSwKKyAge0xETE1fRkxfTE9DQUwsICAgICAgICAgICAgICAgIkxETE1fRkxfTE9DQUwifSwKKyAge0xETE1fRkxfTFZCX1JFQURZLCAgICAgICAgICAgIkxETE1fRkxfTFZCX1JFQURZIn0sCisgIHtMRExNX0ZMX0tNU19JR05PUkUsICAgICAgICAgICJMRExNX0ZMX0tNU19JR05PUkUifSwKKyAge0xETE1fRkxfQ1BfUkVRRCwgICAgICAgICAgICAgIkxETE1fRkxfQ1BfUkVRRCJ9LAorICB7TERMTV9GTF9DTEVBTkVELCAgICAgICAgICAgICAiTERMTV9GTF9DTEVBTkVEIn0sCisgIHtMRExNX0ZMX0FUT01JQ19DQiwgICAgICAgICAgICJMRExNX0ZMX0FUT01JQ19DQiJ9LAorICB7TERMTV9GTF9CTF9BU1QsICAgICAgICAgICAgICAiTERMTV9GTF9CTF9BU1QifSwKKyAge0xETE1fRkxfQkxfRE9ORSwgICAgICAgICAgICAgIkxETE1fRkxfQkxfRE9ORSJ9LAorICB7TERMTV9GTF9OT19MUlUsICAgICAgICAgICAgICAiTERMTV9GTF9OT19MUlUifSwKKyAge0xETE1fRkxfRkFJTF9OT1RJRklFRCwgICAgICAgIkxETE1fRkxfRkFJTF9OT1RJRklFRCJ9LAorICB7TERMTV9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IGx1c3RyZV9lcnJub19odG9uKHVuc2lnbmVkIGludCBoKQoreworCXVuc2lnbmVkIGludCBuOworCisJaWYgKGggPT0gMCkgeworCQluID0gMDsKKwl9IGVsc2UgaWYgKGggPCBBUlJBWV9TSVpFKGx1c3RyZV9lcnJub19odG9uX21hcHBpbmcpKSB7CisJCW4gPSBsdXN0cmVfZXJybm9faHRvbl9tYXBwaW5nW2hdOworCQlpZiAobiA9PSAwKQorCQkJZ290byBnZW5lcmljOworCX0gZWxzZSB7CitnZW5lcmljOgorCQkvKgorCQkgKiBBIGdlbmVyaWMgZXJybm8gaXMgYmV0dGVyIHRoYW4gdGhlIHVua25vd24gb25lIHRoYXQgY291bGQKKwkJICogbWVhbiBhbnl0aGluZyB0byBhIGRpZmZlcmVudCBob3N0LgorCQkgKi8KKwkJbiA9IExVU1RSRV9FSU87CisJfQorCisJcmV0dXJuIG47Cit9CitFWFBPUlRfU1lNQk9MKGx1c3RyZV9lcnJub19odG9uKTsKKwordW5zaWduZWQgaW50IGx1c3RyZV9lcnJub19udG9oKHVuc2lnbmVkIGludCBuKQoreworCXVuc2lnbmVkIGludCBoOworCisJaWYgKG4gPT0gMCkgeworCQloID0gMDsKKwl9IGVsc2UgaWYgKG4gPCBBUlJBWV9TSVpFKGx1c3RyZV9lcnJub19udG9oX21hcHBpbmcpKSB7CisJCWggPSBsdXN0cmVfZXJybm9fbnRvaF9tYXBwaW5nW25dOworCQlpZiAoaCA9PSAwKQorCQkJZ290byBnZW5lcmljOworCX0gZWxzZSB7CitnZW5lcmljOgorCQkvKgorCQkgKiBTaW1pbGFyIHRvIHRoZSBzaXR1YXRpb24gaW4gbHVzdHJlX2Vycm5vX2h0b24oKSwgYW4gdW5rbm93bgorCQkgKiBuZXR3b3JrIGVycm5vIGNvdWxkIGNvaW5jaWRlIHdpdGggYW55dGhpbmcuICBIZW5jZSwgaXQgaXMKKwkJICogYmV0dGVyIHRvIHJldHVybiBhIGdlbmVyaWMgZXJybm8uCisJCSAqLwor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mdW5jdGlvbiBwYXJhbWV0ZXIgaWYgZGVidWdnaW5nIGlzIG9uICovCi0jZGVmaW5lIENWTVhfVVNCX0xPR19QQVJBTShmb3JtYXQsIHBhcmFtKSBcCi0gICAgaWYgKGN2bXhfdW5saWtlbHkodXNiLT5pbml0X2ZsYWdzICYgQ1ZNWF9VU0JfSU5JVElBTElaRV9GTEFHU19ERUJVR19DQUxMUykpIFwKLSAgICAgICAgY3ZteF9kcHJpbnRmKCIlKnMlczogcGFyYW0gJXMgPSAiIGZvcm1hdCAiXG4iLCAyKnVzYi0+aW5kZW50LCAiIiwgX19GVU5DVElPTl9fLCAjcGFyYW0sIHBhcmFtKTsKLQotLyogVGhpcyBtYWNybyBsb2dzIG91dCB3aGVuIGEgZnVuY3Rpb24gcmV0dXJucyBhIHZhbHVlICovCi0jZGVmaW5lIENWTVhfVVNCX1JFVFVSTih2KSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgZG8geyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIHR5cGVvZih2KSByID0gdjsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIGlmIChjdm14X3VubGlrZWx5KHVzYi0+aW5pdF9mbGFncyAmIENWTVhfVVNCX0lOSVRJQUxJWkVfRkxBR1NfREVCVUdfQ0FMTFMpKSAgICBcCi0gICAgICAgICAgICBjdm14X2RwcmludGYoIiUqcyVzOiByZXR1cm5lZCAlcyglZClcbiIsIDIqLS11c2ItPmluZGVudCwgIiIsIF9fRlVOQ1RJT05fXywgI3YsIHIpOyBcCi0gICAgICAgIHJldHVybiByOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgfSB3aGlsZSAoMCk7Ci0KLS8qIFRoaXMgbWFjcm8gbG9ncyBvdXQ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Y3JvIHNwaW5zIG9uIGEgZmllbGQgd2FpdGluZyBmb3IgaXQgdG8gcmVhY2ggYSB2YWx1ZSAqLwogI2RlZmluZSBDVk1YX1dBSVRfRk9SX0ZJRUxEMzIoYWRkcmVzcywgdHlwZSwgZmllbGQsIG9wLCB2YWx1ZSwgdGltZW91dF91c2VjKVwKLSAgICAoe2ludCByZXN1bHQ7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICBkbyB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgdWludDY0X3QgZG9uZSA9IGN2bXhfZ2V0X2N5Y2xlKCkgKyAodWludDY0X3QpdGltZW91dF91c2VjICogICAgIFwKLQkJCW9jdGVvbl9nZXRfY2xvY2tfcmF0ZSgpIC8gMTAwMDAwMDsJCVwKLSAgICAgICAgdHlwZSBjOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgd2hpbGUgKDEpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgIGMudTMyID0gX19jdm14X3VzYl9yZWFkX2NzcjMyKHVzYiwgYWRkcmVzcyk7ICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgIGlmIChjLnMuZmllbGQgb3AgKHZhbHVlKSkgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICByZXN1bHQgPSAwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICBicmVhazsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgIH0gZWxzZSBpZiAoY3ZteF9nZXRfY3ljbGUoKSA+IGRvbmUpIHsgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICByZXN1bHQgPSAtMTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICBicmVhazsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgIH0gZWxzZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICBjdm14X3dhaXQoMTAwKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICB9IHdoaWxlICgwKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICByZXN1bHQ7fSkKKwkoe2ludCByZXN1bHQ7CQkJCQkJCSAgICBcCisJZG8gewkJCQkJCQkJICAgIFwKKwkJdWludDY0X3QgZG9uZSA9IGN2bXhfZ2V0X2N5Y2xlKCkgKyAodWludDY0X3QpdGltZW91dF91c2VjICogXAorCQkJb2N0ZW9uX2dldF9jbG9ja19yYXRlKCkgLyAxMDAwMDAwOwkJICAgIFwKKwkJdHlwZSBjOwkJCQkJCQkgICAgXAorCQl3aGlsZSAoMSkgewkJCQkJCSAgICBcCisJCQljLnUzMiA9IF9fY3ZteF91c2JfcmVhZF9jc3IzMih1c2IsIGFkZHJlc3MpOwkgICAgXAorCQkJaWYgKGMucy5maWVsZCBvcCAodmFsdWUpKSB7CQkJICAgIFwKKwkJCQlyZXN1bHQgPSAwOwkJCQkgICAgXAorCQkJCW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BVU0IgZGV2aWNlIHN0YXRlIHBvcHVsYXRlZCBieQotICogICAgICAgICAgICAgICAgICAgY3ZteF91c2JfaW5pdGlhbGl6ZSgpLgotICogQHBhcmFtIGZsYWdzICAgICAgT3B0aW9uYWwgcGlwZSBmbGFncyBkZWZpbmVkIGluCi0gKiAgICAgICAgICAgICAgICAgICBjdm14X3VzYl9waXBlX2ZsYWdzX3QuCi0gKiBAcGFyYW0gZGV2aWNlX2FkZHIKLSAqICAgICAgICAgICAgICAgICAgIFVTQiBkZXZpY2UgYWRkcmVzcyB0byBvcGVuIHRoZSBwaXBlIHRvCi0gKiAgICAgICAgICAgICAgICAgICAoMC0xMjcpLgotICogQHBhcmFtIGVuZHBvaW50X251bQotICogICAgICAgICAgICAgICAgICAgVVNCIGVuZHBvaW50IG51bWJlciB0byBvcGVuIHRoZSBwaXBlIHRvCi0gKiAgICAgICAgICAgICAgICAgICAoMC0xNSkuCi0gKiBAcGFyYW0gZGV2aWNlX3NwZWVkCi0gKiAgICAgICAgICAgICAgICAgICBUaGUgc3BlZWQgb2YgdGhlIGRldmljZSB0aGUgcGlwZSBpcyBnb2luZwotICogICAgICAgICAgICAgICAgICAgdG8uIFRoaXMgbXVzdCBtYXRjaCB0aGUgZGV2aWNlJ3Mgc3BlZWQsCi0gKiAgICAgICAgICAgICAgICAgICB3aGljaCBtYXkgYmUgZGlmZmVyZW50IHRoYW4gdGhlIHBvcnQgc3BlZWQuCi0gKiBAcGFyYW0gbWF4X3BhY2tldCBUaGUgbWF4aW11bSBwYWNrZXQgbGVuZ3RoIHRoZSBkZXZpY2UgY2FuCi0gKiAgICAgICAgICAgICAgICAgICB0cmFuc21pdC9yZWNlaXZlIChsb3cgc3BlZWQ9MC04LCBmdWxsCi0gKiAgICAgICAgICAgICAgICAgICBzcGVlZD0wLTEwMjMsIGhpZ2ggc3BlZWQ9MC0xMDI0KS4gVGhpcyB2YWx1ZQotICogICAgICAgICAgICAgICAgICAgY29tZXMgZnJvbSB0aGUgc3RhbmRhcmQgZW5kcG9pbnQgZGVzY3JpcHRvcgotICogICAgICAgICAgICAgICAgICAgZmllbGQgd01heFBhY2tldFNpemUgYml0cyA8MTA6MD4uCi0gKiBAcGFyYW0gdHJhbnNmZXJfdHlwZQotICogICAgICAgICAgICAgICAgICAgVGhlIHR5cGUgb2YgdHJhbnNmZXIgdGhpcyBwaXBlIGlzIGZvci4KLSAqIEBwYXJhbSB0cmFuc2Zlcl9kaXIKLSAqICAgICAgICAgICAgICAgICAgIFRoZSBkaXJlY3Rpb24gdGhlIHBpcGUgaXMgaW4uIFRoaXMgaXMgbm90Ci0gKiAgICAgICAgICAgICAgICAgICB1c2VkIGZvciBjb250cm9sIHBpcGVzLgotICogQHBhcmFtIGludGVydmFsICAgRm9yIElTT0NIUk9OT1VTIGFuZCBJTlRFUlJVUFQgdHJhbnNmZXJzLAotICogICAgICAgICAgICAgICAgICAgdGhpcyBpcyBob3cgb2Z0ZW4gdGhlIHRyYW5zZmVyIGlzIHNjaGVkdWxlZAotICogICAgICAgICAgICAgICAgICAgZm9yLiBBbGwgb3RoZXIgdHJhbnNmZXJzIHNob3VsZCBzcGVjaWZ5Ci0gKiAgICAgICAgICAgICAgICAgICB6ZXJvLiBUaGUgdW5pdHMgYXJlIGluIGZyYW1lcyAoODAwMC9zZWMgYXQKLSAqICAgICAgICAgICAgICAgICAgIGhpZ2ggc3BlZWQsIDEwMDAvc2VjIGZvciBmdWxsIHNwZWVkKS4KLSAqIEBwYXJhbSBtdWx0aV9jb3VudAotICogICAgICAgICAgICAgICAgICAgRm9yIGhpZ2ggc3BlZWQgZGV2aWNlcywgdGhpcyBpcyB0aGUgbWF4aW11bQotICogICAgICAgICAgICAgICAgICAgYWxsb3dlZCBudW1iZXIgb2YgcGFja2V0IHBlciBtaWNyb2ZyYW1lLgotICogICAgICAgICAgICAgICAgICAgU3BlY2lmeSB6ZXJvIGZvciBub24gaGlnaCBzcGVlZCBkZXZpY2VzLiBUaGlzCi0gKiAgICAgICAgIC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gICAgICAgIHdoaWxlICh3b3JkcyA+IDMpIHsKLSAgICAgICAgICAgIGN2bXhfd3JpdGU2NF91aW50MzIoY3NyX2FkZHJlc3MsICpwdHIrKyk7Ci0gICAgICAgICAgICBjdm14X3dyaXRlNjRfdWludDMyKGNzcl9hZGRyZXNzLCAqcHRyKyspOwotICAgICAgICAgICAgY3ZteF93cml0ZTY0X3VpbnQzMihjc3JfYWRkcmVzcywgKnB0cisrKTsKLSAgICAgICAgICAgIGN2bXhfcmVhZDY0X3VpbnQ2NChDVk1YX1VTQk5YX0RNQTBfSU5CX0NITjAodXNiLT5pbmRleCkpOwotICAgICAgICAgICAgd29yZHMgLT0gMzsKLSAgICAgICAgfQotICAgICAgICBjdm14X3dyaXRlNjRfdWludDMyKGNzcl9hZGRyZXNzLCAqcHRyKyspOwotICAgICAgICBpZiAoLS13b3JkcykgewotICAgICAgICAgICAgY3ZteF93cml0ZTY0X3VpbnQzMihjc3JfYWRkcmVzcywgKnB0cisrKTsKLSAgICAgICAgICAgIGlmICgtLXdvcmRzKQotICAgICAgICAgICAgICAgIGN2bXhfd3JpdGU2NF91aW50MzIoY3NyX2FkZHJlc3MsICpwdHIrKyk7Ci0gICAgICAgIH0KLSAgICAgICAgY3ZteF9yZWFkNjRfdWludDY0KENWTVhfVVNCTlhfRE1BMF9JTkJfQ0hOMCh1c2ItPmluZGV4KSk7Ci0gICAgfQotICAgIENWTVhfVVNCX1JFVFVSTihmaWZvLT5oZWFkICE9IGZpZm8tPnRhaWwpOworCQkvKgorCQkgKiBXcml0ZSB0aGUgSFcgZmlmbyBkYXRhLiBUaGUgcmVhZCBldmVyeSB0aHJlZSB3cml0ZXMgaXMgZHVlCisJCSAqIHRvIGFuIGVycmF0YSBvbiBDTjNYWFggY2hpcHMKKwkJICovCisJCXdoaWxlICh3b3JkcyA+IDMpIHsKKwkJCWN2bXhfd3JpdGU2NF91aW50MzIoY3NyX2FkZHJlc3MsICpwdHIrKyk7CisJCQljdm14X3dyaXRlNjR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YmNfaGN0c2l6LnMucGlkID0gX19jdm14X3VzYl9nZXRfZGF0YV9waWQocGlwZSk7Ci0gICAgICAgICAgICBpZiAoX19jdm14X3VzYl9waXBlX25lZWRzX3NwbGl0KHVzYiwgcGlwZSkpIHsKLSAgICAgICAgICAgICAgICBpZiAoaGVhZGVyLT5zLnJlcXVlc3RfdHlwZSAmIDB4ODApCi0gICAgICAgICAgICAgICAgICAgIGJ5dGVzX3RvX3RyYW5zZmVyID0gMDsKLSAgICAgICAgICAgICAgICBlbHNlIGlmIChieXRlc190b190cmFuc2ZlciA+IHBpcGUtPm1heF9wYWNrZXQpCi0gICAgICAgICAgICAgICAgICAgIGJ5dGVzX3RvX3RyYW5zZmVyID0gcGlwZS0+bWF4X3BhY2tldDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIFVTQl9TRVRfRklFTEQzMihDVk1YX1VTQkNYX0hDQ0hBUlgoY2hhbm5lbCwgdXNiLT5pbmRleCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY3ZteF91c2JjeF9oY2NoYXJ4X3QsIGVwZGlyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoaGVhZGVyLT5zLnJlcXVlc3RfdHlwZSAmIDB4ODApID8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ1ZNWF9VU0JfRElSRUNUSU9OX0lOIDoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ1ZNWF9VU0JfRElSRUNUSU9OX09VVCkpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgQ1ZNWF9VU0JfU1RBR0VfREFUQV9TUExJVF9DT01QTEVURToKLSAgICAgICAgICAgIHVzYmNfaGN0c2l6LnMucGlkID0gX19jdm14X3VzYl9nZXRfZGF0YV9waWQocGlwZSk7Ci0gICAgICAgICAgICBpZiAoIShoZWFkZXItPnMucmVxdWVzdF90eXBlICYgMHg4MCkpCi0gICAgICAgICAgICAgICAgYnl0ZXNfdG9fdHJhbnNmZXIgPSAwOwotICAgICAgICAgICAgVVNCX1NFVF9GSUVMRDMyKENWTVhfVVNCQ1hfSENDSEFSWChjaGFubmVsLCB1c2ItPmluZGV4KSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdm14X3VzYmN4X2hjY2hhcnhfdCwgZXBkaXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKChoZWFkZXItPnMucmVxdWVzdF90eXBlICYgMHg4MCkgPwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDVk1YX1VTQl9ESVJFQ1RJT05fSU4gOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDVk1YX1VTQl9ESVJFQ1RJT05fT1VUKSk7Ci0gICAgICAgICAgICBVU0JfU0VUX0ZJRUxEMzIoQ1ZNWF9VU0JDWF9IQ1NQTFRYKGNoYW5uZWwsIHVzYi0+aW5kZXgpLCBjdm14X3VzYmN4X2hjc3BsdHhfdCwgY29tcHNwbHQsIDEpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgQ1ZNWF9VU0JfU1RBR0VfU1RBVFVTOgotICAgICAgICAgICAgdXNiY19oY3RzaXoucy5waWQgPSBfX2N2bXhfdXNiX2dldF9kYXRhX3BpZChwaXBlKTsKLSAgICAgICAgICAgIGJ5dGVzX3RvX3RyYW5zZmVyID0gMDsKLSAgICAgICAgICAgIFVTQl9TRVRfRklFTEQzMihDVk1YX1VTQkNYX0hDQ0hBUlgoY2hhbm5lbCwgdXNiLT5pbmRleCksIGN2bXhfdXNiY3hfaGNjaGFyeF90LCBlcGRpciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGhlYWRlci0+cy5yZXF1ZXN0X3R5cGUgJiAweDgwKSA/Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIENWTVhfVVNCX0RJUkVDVElPTl9PVVQgOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDVk1YX1VTQl9ESVJFQ1RJT05fSU4pKTsKLSAgICA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0aGVyZSBpc24ndCBnb2luZwotICAgICAgICAgICAgICAgICAgICB0byBiZSBhIHNwbGl0IGNvbXBsZXRlICovCi0gICAgICAgICAgICAgICAgcGlwZS0+c3BsaXRfc2NfZnJhbWUgPSAtMTsKLSAgICAgICAgICAgICAgICAvKiBTZWUgaWYgd2UndmUgc3RhcnRlZCB0aGlzIHRyYW5zZmVyIGFuZCBzZW50IGRhdGEgKi8KLSAgICAgICAgICAgICAgICBpZiAodHJhbnNhY3Rpb24tPmFjdHVhbF9ieXRlcyA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8qIE5vdGhpbmcgc2VudCB5ZXQsIHRoaXMgaXMgZWl0aGVyIGEgYmVnaW4gb3IgdGhlCi0gICAgICAgICAgICAgICAgICAgICAgICBlbnRpcmUgcGF5bG9hZCAqLwotICAgICAgICAgICAgICAgICAgICBpZiAoYnl0ZXNfdG9fdHJhbnNmZXIgPD0gMTg4KQotICAgICAgICAgICAgICAgICAgICAgICAgdXNiY19oY3NwbHQucy54YWN0cG9zID0gMzsgLyogRW50aXJlIHBheWxvYWQgaW4gb25lIGdvICovCi0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgIHVzYmNfaGNzcGx0LnMueGFjdHBvcyA9IDI7IC8qIEZpcnN0IHBhcnQgb2YgcGF5bG9hZCAqLwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgLyogQ29udGludWluZyB0aGUgcHJldmlvdXMgZGF0YSwgd2UgbXVzdCBlaXRoZXIgYmUKLSAgICAgICAgICAgICAgICAgICAgICAgIGluIHRoZSBtaWRkbGUgb3IgYXQgdGhlIGVuZCAqLwotICAgICAgICAgICAgICAgICAgICBpZiAoYnl0ZXNfdG9fdHJhbnNmZXIgPD0gMTg4KQotICAgICAgICAgICAgICAgICAgICAgICAgdXNiY19oY3NwbHQucy54YWN0cG9zID0gMTsgLyogRW5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9sKHVzYiwgY2hhbm5lbCwgcGlwZSk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBDVk1YX1VTQl9UUkFOU0ZFUl9CVUxLOgotICAgICAgICBjYXNlIENWTVhfVVNCX1RSQU5TRkVSX0lOVEVSUlVQVDoKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIENWTVhfVVNCX1RSQU5TRkVSX0lTT0NIUk9OT1VTOgotICAgICAgICAgICAgaWYgKCFfX2N2bXhfdXNiX3BpcGVfbmVlZHNfc3BsaXQodXNiLCBwaXBlKSkgewotICAgICAgICAgICAgICAgIC8qIElTTyB0cmFuc2FjdGlvbnMgcmVxdWlyZSBkaWZmZXJlbnQgUElEcyBkZXBlbmRpbmcgb24gZGlyZWN0aW9uCi0gICAgICAgICAgICAgICAgICAgIGFuZCBob3cgbWFueSBwYWNrZXRzIGFyZSBuZWVkZWQgKi8KLSAgICAgICAgICAgICAgICBpZiAocGlwZS0+dHJhbnNmZXJfZGlyID09IENWTVhfVVNCX0RJUkVDVElPTl9PVVQpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHBpcGUtPm11bHRpX2NvdW50IDwgMikgLyogTmVlZCBEQVRBMCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgVVNCX1NFVF9GSUVMRDMyKENWTVhfVVNCQ1hfSENUU0laWChjaGFubmVsLCB1c2ItPmluZGV4KSwgY3ZteF91c2JjeF9oY3RzaXp4X3QsIHBpZCwgMCk7Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UgLyogTmVlZCBNREFUQSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgVVNCX1NFVF9GSUVMRDMyKENWTVhfVVNCQ1hfSENUU0laWChjaGFubmVsLCB1c2ItPmluZGV4KSwgY3ZteF91c2JjeF9oY3RzaXp4X3QsIHBpZCwgMyk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgfQotIC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gdHlwZSA9ICJCVUxLIjsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgZGVmYXVsdDogLyogQ1ZNWF9VU0JfVFJBTlNGRVJfSU5URVJSVVBUICovCi0gICAgICAgICAgICAgICAgICAgIHR5cGUgPSAiSU5URVJSVVBUIjsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBjdm14X2RwcmludGYoIiVzOiBTdGFydGluZyBwaXBlICVkLCB0cmFuc2FjdGlvbiAlZCBvbiBjaGFubmVsICVkLiAlcyAlcyBsZW49JWQgaGVhZGVyPTB4JWxseFxuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICBfX0ZVTkNUSU9OX18sIF9fY3ZteF91c2JfZ2V0X3BpcGVfaGFuZGxlKHVzYiwgcGlwZSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgX19jdm14X3VzYl9nZXRfc3VibWl0X2hhbmRsZSh1c2IsIHRyYW5zYWN0aW9uKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsLCB0eXBlLCBkaXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNhY3Rpb24tPmJ1ZmZlcl9sZW5ndGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgKGhlYWRlcikgPyAodW5zaWduZWQgbG9uZyBsb25nKWhlYWRlci0+dTY0IDogMHVsbCk7Ci0gICAgICAgIH0KLSAgICAgICAgX19jdm14X3VzYl9zdGFydF9jaGFubmVsKHVzYiwgY2hhbm5lbCwgcGlwZSk7Ci0gICAgfQorCQlfX2N2bXhfdXNiX3N0YXJ0X2NoYW5uZWwodXNiLCBjaGFubmVsLCBwaXBlKTsKKwl9CiAKIGRvbmU6Ci0gICAgLyogT25seSBlbmFibGUgU09GIGludGVycnVwdHMgd2hlbiB3ZSBoYXZlIHRyYW5zYWN0aW9ucyBwZW5kaW5nIGluIHRoZQotICAgICAgICBmdXR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GV4dGVybmFsIEFQSS4KICAqLwotc3RhdGljIGludCBfX2N2bXhfdXNiX3N1Ym1pdF90cmFuc2FjdGlvbihjdm14X3VzYl9pbnRlcm5hbF9zdGF0ZV90ICp1c2IsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBwaXBlX2hhbmRsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3ZteF91c2JfdHJhbnNmZXJfdCB0eXBlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZmxhZ3MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQ2NF90IGJ1ZmZlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGJ1ZmZlcl9sZW5ndGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQ2NF90IGNvbnRyb2xfaGVhZGVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaXNvX3N0YXJ0X2ZyYW1lLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaXNvX251bWJlcl9wYWNrZXRzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdm14X3VzYl9pc29fcGFja2V0X3QgKmlzb19wYWNrZXRzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdm14X3VzYl9jYWxsYmFja19mdW5jX3QgY2FsbGJhY2ssCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKnVzZXJfZGF0YSkKK3N0YXRpYyBpbnQgX19jdm14X3VzYl9zdWJtaXRfdHJhbnNhY3Rpb24oc3RydWN0IGN2bXhfdXNiX2ludGVybmFsX3N0YXRlICp1c2IsCisJCQkJCSBpbnQgcGlwZV9o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1ZNWF9VU0JfSU5WQUxJRF9QQVJBTSk7Ci0gICAgaWYgKGN2bXhfdW5saWtlbHkoYnVmZmVyX2xlbmd0aCA8IDApKQotICAgICAgICBDVk1YX1VTQl9SRVRVUk4oQ1ZNWF9VU0JfSU5WQUxJRF9QQVJBTSk7Ci0KLSAgICBzdWJtaXRfaGFuZGxlID0gX19jdm14X3VzYl9zdWJtaXRfdHJhbnNhY3Rpb24odXNiLCBwaXBlX2hhbmRsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ1ZNWF9VU0JfVFJBTlNGRVJfQlVMSywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgLyogZmxhZ3MgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBidWZmZXJfbGVuZ3RoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLCAvKiBjb250cm9sX2hlYWRlciAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLCAvKiBpc29fc3RhcnRfZnJhbWUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgLyogaXNvX251bWJlcl9wYWNrZXRzICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsIC8qIGlzb19wYWNrZXRzICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c2VyX2RhdGEpOwotICAgIENWTVhfVVNCX1JFVFVSTihzdWJtaXRfaGFuZGxlKTsKKwlzdWJtaXRfaGFuZGxlID0gX19jdm14X3VzYl9zdWJtaXRfdHJhbnNhY3Rpb24odXNiLCBwaXBlX2hhb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ihDVk1YX1VTQl9JTlZBTElEX1BBUkFNKTsKLSAgICBpZiAoY3ZteF91bmxpa2VseShidWZmZXJfbGVuZ3RoIDwgMCkpCi0gICAgICAgIENWTVhfVVNCX1JFVFVSTihDVk1YX1VTQl9JTlZBTElEX1BBUkFNKTsKLQotICAgIHN1Ym1pdF9oYW5kbGUgPSBfX2N2bXhfdXNiX3N1Ym1pdF90cmFuc2FjdGlvbih1c2IsIHBpcGVfaGFuZGxlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDVk1YX1VTQl9UUkFOU0ZFUl9JTlRFUlJVUFQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsIC8qIGZsYWdzICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyX2xlbmd0aCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgLyogY29udHJvbF9oZWFkZXIgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgLyogaXNvX3N0YXJ0X2ZyYW1lICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsIC8qIGlzb19udW1iZXJfcGFja2V0cyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLCAvKiBpc29fcGFja2V0cyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFjaywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXNlcl9kYXRhKTsKLSAgICBDVk1YX1VTQl9SRVRVUk4oc3VibWl0X2hhbmRsZSk7CisJc3VibWl0X2hhbmRsZSA9IF9fY3ZteF91c2Jfc3VibWl0X3RyYW5zYWN0aW9uKHVzYiwgc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ICAgICAgICAgICBidWZmZXJfbGVuZ3RoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250cm9sX2hlYWRlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgLyogaXNvX3N0YXJ0X2ZyYW1lICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsIC8qIGlzb19udW1iZXJfcGFja2V0cyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLCAvKiBpc29fcGFja2V0cyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFjaywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXNlcl9kYXRhKTsKLSAgICBDVk1YX1VTQl9SRVRVUk4oc3VibWl0X2hhbmRsZSk7CisJc3VibWl0X2hhbmRsZSA9IF9fY3ZteF91c2Jfc3VibWl0X3RyYW5zYWN0aW9uKHVzYiwgcGlwZV9oYW5kbGUsCisJCQkJCQkgICAgICBDVk1YX1VTQl9UUkFOU0ZFUl9DT05UUk9MLAorCQkJCQkJICAgICAgMCwgLyogZmxhZ3MgKi8KKwkJCQkJCSAgICAgIGJ1ZmZlciwKKwkJCQkJCSAgICAgIGJ1ZmZlcl9sZW5ndGgsCisJCQkJCQkgICAgICBjb250cm9sX2hlYWRlciwKKwkJCQkJCSAgICAgIDAsIC8qIGlzb19zdGFydF9mcmFtZSAqLworCQkJCQkJICAgICAgMCwgLyogaXNvX251bWJlcl9wYWNrZXRzICovCisJCQkJCQkgICAgICBOVUxMLCAvKiBpc29fcGFja2V0cyAqLworCQkJCQkJICAgICAgY2FsbGJhY2ssCisJCQkJCQkgICAgICB1c2VyX2RhdGEpOworCXJldHVybiBzdWJtaXRfaGFuZGxlOwogfQogCiAKIC8qKgogICogQ2FsbCB0byBzdWJtaXQgYSBVU0IgSXNvY2hyb25vdXMg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Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsIC8qIGNvbnRyb2xfaGVhZGVyICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0X2ZyYW1lLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudW1iZXJfcGFja2V0cywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFja2V0cywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2ssCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVzZXJfZGF0YSk7Ci0gICAgQ1ZNWF9VU0JfUkVUVVJOKHN1Ym1pdF9oYW5kbGUpOworCXN1Ym1pdF9oYW5kbGUgPSBfX2N2bXhfdXNiX3N1Ym1pdF90cmFuc2FjdGlvbih1c2IsIHBpcGVfaGFuZGxlLAorCQkJCQkJICAgICAgQ1ZNWF9VU0JfVFJBTlNGRVJfSVNPQ0hST05PVVMsCisJCQkJCQkgICAgICBmbGFncywKKwkJCQkJCSAgICAgIGJ1ZmZlciwKKwkJCQkJCSAgICAgIGJ1ZmZlcl9sZW5ndGgsCisJCQkJCQkgICAgICAwLCAvKiBjb250cm9sX2hlYWRlciAqLworCQkJCQkJICAgICAgc3RhcnRfZnJhbWUsCisJCQkJCQkgICAgICBudW1iZXJfcGFja2V0cywKKwkJCQkJCSAgICAgIHBhY2tldHMsCisJCQkJCQkgICAgICBjYWxsYmFjaywKKwkJCQkJCSAgICAgIHVzZXJfZGF0YSk7CisJcmV0dXJuIHN1Ym1pdF9oYW5kbGU7CiB9CiAKIApAQCAtMjUyNSw2MyArMjQ0MCw1OCBAQAogICogYSBmcmFtZSBvciB0d28gZm9yIHRoZSBjdm14X3VzYl9wb2xsKCkgZnVuY3Rpb24gdG8gY2FsbCB0aGUKICAqIGFzc29jaWF0ZWQgY2FsbGJhY2suCi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GlzYWJsZSBhbGwgaW50ZXJydXB0cyBleGNlcHQgQ0hITFREICovCi0gICAgICAgICAgICAgICAgaGNpbnRtc2sudTMyID0gMDsKLSAgICAgICAgICAgICAgICBoY2ludG1zay5zLmNoaGx0ZG1zayA9IDE7Ci0gICAgICAgICAgICAgICAgX19jdm14X3VzYl93cml0ZV9jc3IzMih1c2IsIENWTVhfVVNCQ1hfSENJTlRNU0tYKGNoYW5uZWwsIHVzYi0+aW5kZXgpLCBoY2ludG1zay51MzIpOwotICAgICAgICAgICAgICAgIHVzYmNfaGNjaGFyLnMuY2hkaXMgPSAxOwotICAgICAgICAgICAgICAgIF9fY3ZteF91c2Jfd3JpdGVfY3NyMzIodXNiLCBDVk1YX1VTQkNYX0hDQ0hBUlgoY2hhbm5lbCwgdXNiLT5pbmRleCksIHVzYmNfaGNjaGFyLnUzMik7Ci0gICAgICAgICAgICAgICAgQ1ZNWF9VU0JfUkVUVVJOKDApOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZiAodXNiY19oY2ludC5zLnhmZXJjb21wbCkgewotICAgICAgICAgICAgICAgIC8qIFN1Y2Nlc3NmdWwgSU4vT1VUIHdpdGggdHJhbnNmZXIgY29tcGxldGUuIENoYW5uZWwgaGFsdCBpc24ndCBuZWVkZWQgKi8KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgewotICAgICAgICAgICAgICAgIGN2bXhfZHByaW50ZigiVVNCJWQ6IENoYW5uZWwgJWQgaW50ZXJydXB0IHdpdGhvdXQgaGFsdFxuIiwgdXNiLT5pbmRleCwgY2hhbm5lbCk7Ci0gICAgICAgICAgICAgICAgQ1ZNWF9VU0JfUkVUVVJOKDApOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UgewotICAgICAgICAvKiBUaGVyZSBpcyBhcmUgbm8gaW50ZXJydXB0cyB0aGF0IHdlIG5lZWQgdG8gcHJvY2VzcyB3aGVuIHRoZSBjaGFubmVs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Ci0gICAgICAgIHBpcGUtPmZsYWdzICY9IH5fX0NWTVhfVVNCX1BJUEVfRkxBR1NfTkVFRF9QSU5HOwotCi0gICAgICAgIHN3aXRjaCAodHJhbnNhY3Rpb24tPnR5cGUpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGNhc2UgQ1ZNWF9VU0JfVFJBTlNGRVJfQ09OVFJPTDoKLSAgICAgICAgICAgICAgICBzd2l0Y2ggKHRyYW5zYWN0aW9uLT5zdGFnZSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGNhc2UgQ1ZNWF9VU0JfU1RBR0VfTk9OX0NPTlRST0w6Ci0gICAgICAgICAgICAgICAgICAgIGNhc2UgQ1ZNWF9VU0JfU1RBR0VfTk9OX0NPTlRST0xfU1BMSVRfQ09NUExFVEU6Ci0gICAgICAgICAgICAgICAgICAgICAgICAvKiBUaGlzIHNob3VsZCBiZSBpbXBvc3NpYmxlICovCi0gICAgICAgICAgICAgICAgICAgICAgICBfX2N2bXhfdXNiX3BlcmZvcm1fY29tcGxldGUodXNiLCBwaXBlLCB0cmFuc2FjdGlvbiwgQ1ZNWF9VU0JfQ09NUExFVEVfRVJST1IpOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIGNhc2UgQ1ZNWF9VU0JfU1RBR0VfU0VUVVA6Ci0gICAgICAgICAgICAgICAgICAgICAgICBwaXBlLT5waWRfdG9nZ2xlID0gMTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfX2N2bXhfdXNiX3BpcGVfbmVlZHNfc3BsaXQodXNiLCBwaXBlKSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2FjdGlvbi0+c3RhZ2UgPSBDVk1YX1VTQl9TVEFHRV9TRVRVUF9TUExJVF9DT01QTEVURTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN2bXhfdXNiX2NvbnRyb2xfaGVhZGVyX3QgKmhlYWRlciA9IGN2bXhfcGh5c190b19wdHIodHJhbnNhY3Rpb24tPmNvbnRyb2xfaGVhZGVyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaGVhZGVyLT5zLmxlbmd0aCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNhY3Rpb24tPnN0YWdlID0gQ1ZNWF9VU0JfU1RBR0VfREFUQTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zYWN0aW9uLT5zdGFnZSA9IENWTVhfVVNCX1NUQUdFX1NUQVRVUzsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICBjYXNlIENWTVhfVVNCX1NUQUdFX1NFVFVQX1NQTElUX0NPTVBMRVRFOgotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN2bXhfdXNiX2NvbnRyb2xfaGVhZGVyX3QgKmhlYWRlciA9IGN2bXhfcGh5c190b19wdHIodHJhbnNhY3Rpb24tPmNvbnRyb2xfaGVhZGVyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaGVhZGVyLT5zLmxlbmd0aCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNhY3Rpb24tPnN0YWdlID0gQ1ZNWF9VU0JfU1RBR0VfREFUQTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zYWN0aW9uLT5zdGFnZSA9IENWTVhfVVNCX1NUQUdFX1NUQVRVUzsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICBjYXNlIENWTVhfVVNCX1NUQUdFX0RBVEE6Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoX19jdm14X3VzYl9waXBlX25lZWRzX3NwbGl0KHVzYiwgcGlwZSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2FjdGlvbi0+c3RhZ2UgPSBDVk1YX1VTQl9TVEFHRV9EQVRBX1NQTElUX0NPTVBMRVRFOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEZvciBzZXR1cCBPVVQgZGF0YSB0aGF0IGFyZSBzcGxpdHMsIHRoZSBoYXJkd2FyZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2Vzbid0IGFwcGVhciB0byBjb3VudCB0cmFuc2ZlcnJlZCBkYXRhLiBIZXJlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdlIG1hbnVhbGx5IHVwZGF0ZSB0aGUgZGF0YSB0cmFuc2ZlcnJlZCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghdXNiY19oY2NoYXIucy5lcGRpcikgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYnVmZmVyX3NwYWNlX2xlZnQgPCBwaXBlLT5tYXhfcGFja2V0KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNhY3Rpb24tPmFjdHVhbF9ieXRlcyArPSBidWZmZXJfc3BhY2VfbGVmdDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNhY3Rpb24tPmFjdHVhbF9ieXRlcyArPSBwaXBlLT5tYXhfcGFja2V0OwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKChidWZmZXJfc3BhY2VfbGVmdCA9PSAwKSB8fCAoYnl0ZXNfaW5fbGFzdF9wYWNrZXQgPCBwaXBlLT5tYXhfcGFja2V0KSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpcGUtPnBpZF90b2dnbGUgPSAxOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zYWN0aW9uLT5zdGFnZSA9IENWTVhfVVNCX1NUQUdFX1NUQVRVUzsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICBjYXNlIENWTVhfVVNCX1NUQUdFX0RBVEFfU1BMSVRfQ09NUExFVEU6Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGJ1ZmZlcl9zcGFjZV9sZWZ0ID09IDApIHx8IChieXRlc19pbl9sYXN0X3BhY2tldCA8IHBpcGUtPm1heF9wYWNrZXQpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGlwZS0+cGlkX3RvZ2dsZSA9IDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNhY3Rpb24tPnN0YWdlID0gQ1ZNWF9VU0JfU1RBR0VfU1RBVFVTOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNhY3Rpb24tPnN0YWdlID0gQ1ZNWF9VU0JfU1RBR0VfREFUQTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICBjYXNlIENWTVhfVVNCX1NUQUdFX1NUQVRVUzoKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfX2N2bXhfdXNiX3BpcGVfbmVlZHNfc3BsaXQodXNiLCBwaXBlKSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2FjdGlvb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lwZV9uZWVkc19zcGxpdCh1c2IsIHBpcGUpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh0cmFuc2FjdGlvbi0+c3RhZ2UgPT0gQ1ZNWF9VU0JfU1RBR0VfTk9OX0NPTlRST0wpCi0gICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2FjdGlvbi0+c3RhZ2UgPSBDVk1YX1VTQl9TVEFHRV9OT05fQ09OVFJPTF9TUExJVF9DT01QTEVURTsKLSAgICAgICAgICAgICAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYnVmZmVyX3NwYWNlX2xlZnQgJiYgKGJ5dGVzX2luX2xhc3RfcGFja2V0ID09IHBpcGUtPm1heF9wYWNrZXQpKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zYWN0aW9uLT5zdGFnZSA9IENWTVhfVVNCX1NUQUdFX05PTl9DT05UUk9MOwotICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRyYW5zYWN0aW9uLT50eXBlID09IENWTVhfVVNCX1RSQU5TRkVSX0lOVEVSUlVQVCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGlwZS0+bmV4dF90eF9mcmFtZSArPSBwaXBlLT5pbnRlcnZhbDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2N2bXhfdXNiX3BlcmZvcm1fY29tcGxldGUodXNiLCBwaXBlLCB0cmFuc2FjdGlvbiwgQ1ZNWF9VU0JfQ09NUExFVEVfU1VDQ0VTUyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICgocGlwZS0+ZGV2aWNlX3NwZWVkID09IENWTVhfVVNCX1NQRUVEX0hJR0gpICYmCi0gICAgICAgICAgICAgICAgICAgICAgICAocGlwZS0+dHJhbnNmZXJfdHlwZSA9PSBDVk1YX1VTQl9UUkFOU0ZFUl9CVUxLKSAmJgotICAgICAgICAgICAgICAgICAgICAgICAgKHBpcGUtPnRyYW5zZmVyX2RpciA9PSBDVk1YX1VTQl9ESVJFQ1RJT05fT1VUKSAmJgotICAgICAgICAgICAgICAgICAgICAgICAgKHVzYmNfaGNpbnQucy5uYWspKQotICAgICAgICAgICAgICAgICAgICAgICAgcGlwZS0+ZmxhZ3MgfD0gX19DVk1YX1VTQl9QSVBFX0ZMQUdTX05FRURfUElORzsKLSAgICAgICAgICAgICAgICAgICAgaWYgKCFidWZmZXJfc3BhY2VfbGVmdCB8fCAoYnl0ZXNfaW5fbGFzdF9wYWNrZXQgPCBwaXBlLT5tYXhfcGFja2V0KSkgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRyYW5zYWN0aW9uLT50eXBlID09IENWTVhfVVNCX1RSQU5TRkVSX0lOVEVSUlVQVCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaXBlLT5uZXh0X3R4X2ZyYW1lICs9IHBpcGUtPmludGVydmFsOwotICAgICAgICAgICAgICAgICAgICAgICAgX19jdm14X3VzYl9wZXJmb3JtX2NvbXBsZXRlKHVzYiwgcGlwZSwgdHJhbnNhY3Rpb24sIENWTVhfVVNCX0NPTVBMRVRFX1NVQ0NFU1MpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSBDVk1YX1VTQl9UUkFOU0ZFUl9JU09DSFJPTk9VUzoKLSAgICAgICAgICAgICAgICBpZiAoX19jdm14X3VzYl9waXBlX25lZWRzX3NwbGl0KHVzYiwgcGlwZSkpIHsKLSAgICAgICAgICAgICAgICAgICAgLyogSVNPQ0hST05PVVMgT1VUIHNwbGl0cyBkb24ndCByZXF1aXJlIGEgY29tcGxldGUgc3BsaXQgc3RhZ2UuCi0gICAgICAgICAgICAgICAgICAgICAgICBJbnN0ZWFkIHRoZXkgdXNlIGEgc2VxdWVuY2Ugb2YgYmVnaW4gT1VUIHNwbGl0cyB0byB0cmFuc2ZlcgotICAgICAgICAgICAgICAgICAgICAgICAgdGhlIGRhdGEgMTg4IGJ5dGVzIGF0IGEgdGltZS4gT25jZSB0aGUgdHJhbnNmZXIgaXMgY29tcGxldGUsCi0gICAgICAgICAgICAgICAgICAgICAgICB0aGUgcGlwZSBzbGVlcHMgdW50aWwgdGhlIG5leHQgc2NoZWR1bGUgaW50ZXJ2YWwgKi8KLSAgICAgICAgICAgICAgICAgICAgaWYgKHBpcGUtPnRyYW5zZmVyX2RpciA9PSBDVk1YX1VTQl9ESVJFQ1RJT05fT1VUKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvKiBJZiBubyBzcGFjZSBsZWZ0IG9yIHRoaXMgd2Fzbid0IGEgbWF4IHNpemUgcGFja2V0IHRoZW4KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzIHRyYW5zZmVyIGlzIGNvbXBsZXRlLiBPdGhlcndpc2Ugc3RhcnQgaXQgYWdhaW4KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0byBzZW5kIHRoZSBuZXh0IDE4OCBieXRlcyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFidWZmZXJfc3BhY2VfbGVmdCB8fCAoYnl0ZXNfdGhpc190cmFuc2ZlciA8IDE4OCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaXBlLT5uZXh0X3R4X2ZyYW1lICs9IHBpcGUtPmludGVydmFsOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fY3ZteF91c2JfcGVyZm9ybV9jb21wbGV0ZSh1c2IsIHBpcGUsIHRyYW5zYWN0aW9uLCBDVk1YX1VTQl9DT01QTEVURV9TVUNDRVNTKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0cmFuc2FjdGlvbi0+c3RhZ2UgPT0gQ1ZNWF9VU0JfU1RBR0VfTk9OX0NPTlRST0xfU1BMSVRfQ09NUExFVEUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBXZSBhcmUgaW4gdGhlIGluY29taW5nIGRhdGEgcGhhc2UuIEtlZXAgZ2V0dGluZwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhIHVudGlsIHdlIHJ1biBvdXQgb2Ygc3BhY2Ugb3IgZ2V0IGEgc21hbGwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFja2V0ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChidWZmZXJfc3BhY2VfbGVmdCA9PSAwKSB8fCAoYnl0ZXNfaW5fbGFzdF9wYWNrZXQgPCBwaXBlLT5tYXhfcGFja2V0KSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaXBlLT5uZXh0X3R4X2ZyYW1lICs9IHBpcGUtPmludGVydmFsOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2N2bXhfdXNiX3BlcmZvcm1fY29tcGxldGUodXNiLCBwaXBlLCB0cmFuc2FjdGlvbiwgQ1ZNWF9VU0JfQ09NUExFVEVfU1VDQ0VTUyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zYWN0aW9uLT5zdGFnZSA9IENWTVhfVVNCX1NUQUdFX05PTl9DT05UUk9MX1NQTElUX0NPTVBMRVRFOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UgewotICAgICAg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B1c2JfcG9ydF9zdGF0dXM7Ci0gKiAgICAgaW50IHBvcnRfc3RhdHVzOwotICogICAgIHN0cnVjdCB1c2JfaHViX2Rlc2NyaXB0b3IgKmRlc2M7Ci0gKiAgICAgdW5zaWduZWQgbG9uZyBmbGFnczsKLSAqCi0gKiAgICAgc3dpdGNoICh0eXBlUmVxKQotICogICAgIHsKLSAqICAgICAgICAgY2FzZSBDbGVhckh1YkZlYXR1cmU6Ci0gKiAgICAgICAgICAgICBERUJVR19ST09UX0hVQigiT2N0ZW9uVVNCOiBDbGVhckh1YkZlYXR1cmVcbiIpOwotICogICAgICAgICAgICAgc3dpdGNoICh3VmFsdWUpCi0gKiAgICAgICAgICAgICB7Ci0gKiAgICAgICAgICAgICAgICAgY2FzZSBDX0hVQl9MT0NBTF9QT1dFUjoKLSAqICAgICAgICAgICAgICAgICBjYXNlIENfSFVCX09WRVJfQ1VSUkVOVDoKLSAqICAgICAgICAgICAgICAgICAgICAgLy8gTm90aGluZyByZXF1aXJlZCBoZXJlCi0gKiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICogICAgICAgICAgICAgICAgIGRlZmF1bHQ6Ci0gKiAgICAgICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICogICAgICAgICAgICAgfQotICogICAgICAgICAgICAgYnJlYWs7Ci0gKiAgICAgICAgIGNhc2UgQ2xlYXJQb3J0RmVhdHVyZToKLSAqICAgICAgICAgICAgIERFQlVHX1JPT1RfSFVCKCJPY3Rlb25VU0I6IENsZWFyUG9ydEZlYXR1cmUiKTsKLSAqICAgICAgICAgICAgIGlmICh3SW5kZXggIT0gMSkKLSAqICAgICAgICAgICAgIHsKLSAqICAgICAgICAgICAgICAgICBERUJVR19ST09UX0hVQigiIElOVkFMSURcbiIpOwotICogICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICogICAgICAgICAgICAgfQotICoKLSAqICAgICAgICAgICAgIHN3aXRjaCAod1ZhbHVlKQotICogICAgICAgICAgICAgewotICogICAgICAgICAgICAgICAgIGNhc2UgVVNCX1BPUlRfRkVBVF9FTkFCTEU6Ci0gKiAgICAgICAgICAgICAgICAgICAgIERFQlVHX1JPT1RfSFVCKCIgRU5BQkxFIik7Ci0gKiAgICAgICAgICAgICAgICAgICAgIGxvY2FsX2lycV9zYXZlKGZsYWdzKTsKLSAqICAgICAgICAgICAgICAgICAgICAgY3ZteF91c2JfZGlzYWJsZSh1c2IpOwotICogICAgICAgICAgICAgICAgICAgICBsb2NhbF9pcnFfcmVzdG9yZShmbGFncyk7Ci0gKiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICogICAgICAgICAgICAgICAgIGNhc2UgVVNCX1BPUlRfRkVBVF9TVVNQRU5EOgotICogICAgICAgICAgICAgICAgICAgICBERUJVR19ST09UX0hVQigiIFNVU1BFTkQiKTsKLSAqICAgICAgICAgICAgICAgICAgICAgLy8gTm90IHN1cHBvcnRlZCBvbiBPY3Rlb24KLSAqICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gKiAgICAgICAgICAgICAgICAgY2FzZSBVU0JfUE9SVF9GRUFUX1BPV0VSOgotICogICAgICAgICAgICAgICAgICAgICBERUJVR19ST09UX0hVQigiIFBPV0VSIik7Ci0gKiAgICAgICAgICAgICAgICAgICAgIC8vIE5vdCBzdXBwb3J0ZWQgb24gT2N0ZW9uCi0gKiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICogICAgICAgICAgICAgICAgIGNhc2UgVVNCX1BPUlRfRkVBVF9JTkRJQ0FUT1I6Ci0gKiAgICAgICAgICAgICAgICAgICAgIERFQlVHX1JPT1RfSFVCKCIgSU5ESUNBVE9SIik7Ci0gKiAgICAgICAgICAgICAgICAgICAgIC8vIFBvcnQgaW5pZGljYXRvciBub3Qgc3VwcG9ydGVkCi0gKiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICogICAgICAgICAgICAgICAgIGNhc2UgVVNCX1BPUlRfRkVBVF9DX0NPTk5FQ1RJT046Ci0gKiAgICAgICAgICAgICAgICAgICAgIERFQlVHX1JPT1RfSFVCKCIgQ19DT05ORUNUSU9OIik7Ci0gKiAgICAgICAgICAgICAgICAgICAgIC8vIENsZWFycyBkcml2ZXJzIGludGVybmFsIGNvbm5lY3Qgc3RhdHVzIGNoYW5nZSBmbGFnCi0gKiAgICAgICAgICAgICAgICAgICAgIGN2bXhfdXNiX3NldF9zdGF0dXModXNiLCBjdm14X3VzYl9nZXRfc3RhdHVzKHVzYikpOwotICogICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAqICAgICAgICAgICAgICAgICBjYXNlIFVTQl9QT1JUX0ZFQVRfQ19SRVNFVDoKLSAqICAgICAgICAgICAgICAgICAgICAgREVCVUdfUk9PVF9IVUIoIiBDX1JFU0VUIik7Ci0gKiAgICAgICAgICAgICAgICAgICAgIC8vIENsZWFycyB0aGUgZHJpdmVyJ3MgaW50ZXJuYWwgUG9ydCBSZXNldCBDaGFuZ2UgZmxhZwotICogICAgICAgICAgICAgICAgICAgICBjdm14X3VzYl9zZXRfc3RhdHVzKHVzYiwgY3ZteF91c2JfZ2V0X3N0YXR1cyh1c2IpKTsKLSAqICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gKiAgICAgICAgICAgICAgICAgY2FzZSBVU0JfUE9SVF9GRUFUX0NfRU5BQkxFOgotICogICAgICAgICAgICAgICAgICAgICBERUJVR19ST09UX0hVQigiIENfRU5BQkxFIik7Ci0gKiAgICAgICAgICAgICAgICAgICAgIC8vIENsZWFycyB0aGUgZHJpdmVyJ3MgaW50ZXJuYWwgUG9ydCBFbmFibGUvRGlzYWJsZSBDaGFuZ2UgZmxhZwotICogICAgICAgICAgICAgICAgICAgICBjdm14X3VzYl9zZXRfc3RhdHVzKHVzYiwgY3ZteF91c2JfZ2V0X3N0YXR1cyh1c2IpKTsKLSAqICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gKiAgICAgICAgICAgICAgICAgY2FzZSBVU0JfUE9SVF9GRUFUX0NfU1VTUEVORDoKLSAqICAgICAgICAgICAgICAgICAgICAgREVCVUdfUk9PVF9IVUIoIiBDX1NVU1BFTkQiKTsKLSAqICAgICAgICAgICAgICAgICAgICAgLy8gQ2xlYXJzIHRoZSBkcml2ZXIncyBpbnRlcm5hbCBQb3J0IFN1c3BlbmQgQ2hhbmdlIGZsYWcsCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICB3aGljaCBpcyBzZXQgd2hlbiByZXN1bWUgc2lnbmFsaW5nIG9uIHRoZSBob3N0IHBvcnQgaXMKLSAqICAgICAgICAgICAgICAgICAgICAgICAgIGNvbXBsZXRlCi0gKiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICogICAgICAgICAgICAgICAgIGNhc2UgVVNCX1BPUlRfRkVBVF9DX09WRVJfQ1VSUkVOVDoKLSAqICAgICAgICAgICAgICAgICAgICAgREVCVUdfUk9PVF9IVUIoIiBDX09WRVJfQ1VSUkVOVCIpOwotICogICAgICAgICAgICAgICAgICAgICAvLyBDbGVhcnMgdGhlIGRyaXZlcidzIG92ZXJjdXJyZW50IENoYW5nZSBmbGFnCi0gKiAgICAgICAgICAgICAgICAgICAgIGN2bXhfdXNiX3NldF9zdGF0dXModXNiLCBjdm14X3VzYl9nZXRfc3RhdHVzKHVzYikpOwotICogICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAqICAgICAgICAgICAgICAgICBkZWZhdWx0OgotICogICAgICAgICAgICAgICAgICAgICBERUJVR19ST09UX0hVQigiIFVOS05PV05cbiIpOwotICogICAgICAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAqICAgICAgICAgICAgIH0KLSAqICAgICAgICAgICAgIERFQlVHX1JPT1RfSFVCKCJcbiIpOwotICogICAgICAgICAgICAgYnJlYWs7Ci0gKiAgICAgICAgIGNhc2UgR2V0SHViRGVzY3JpcHRvcjoKLSAqICAgICAgICAgICAgIERFQlVHX1JPT1RfSFVCKCJPY3Rlb25VU0I6IEdldEh1YkRlc2NyaXB0b3JcbiIpOwotICogICAgICAgICAgICAgZGVzYyA9IChzdHJ1Y3QgdXNiX2h1Yl9kZXNjcmlwdG9yICopYnVmOwotICogICAgICAgICAgICAgZGVzYy0+YkRlc2NMZW5ndGggPSA5OwotICogICAgICAgICAgICAgZGVzYy0+YkRlc2NyaXB0b3JUeXBlID0gMHgyOTsKLSAqICAgICAgICAgICAgIGRlc2MtPmJOYnJQb3J0cyA9IDE7Ci0gKiAgICAgICAgICAgICBkZXNjLT53SHViQ2hhcmFjdGVyaXN0aWNzID0gMHgwODsKLSAqICAgICAgICAgICAgIGRlc2MtPmJQd3JPbjJQd3JHb29kID0gMTsKLSAqICAgICAgICAgICAgIGRlc2MtPmJIdWJDb250ckN1cnJlbnQgPSAwOwotICogICAgICAgICAgICAgZGVzYy0+Yml0bWFwWzBdID0gMDsKLSAqICAgICAgICAgICAgIGRlc2MtPmJpdG1hcFsxXSA9IDB4ZmY7Ci0gKiAgICAgICAgICAgICBicmVhazsKLSAqICAgICAgICAgY2FzZSBHZXRIdWJTdGF0dXM6Ci0gKiAgICAgICAgICAgICBERUJVR19ST09UX0hVQigiT2N0ZW9uVVNCOiBHZXRIdWJTdGF0dXNcbiIpOwotICogICAgICAgICAgICAgKihfX2xlMzIgKilidWYgPSAwOwotICogICAgICAgICAgICAgYnJlYWs7Ci0gKiAgICAgICAgIGNhc2UgR2V0UG9ydFN0YXR1czoKLSAqICAgICAgICAgICAgIERFQlVHX1JPT1RfSFVCKCJPY3Rlb25VU0I6IEdldFBvcnRTdGF0dXMiKTsKLSAqICAgICAgICAgICAgIGlmICh3SW5kZXggIT0gMSkKLSAqICAgICAgICAgICAgIHsKLSAqICAgICAgICAgICAgICAgICBERUJVR19ST09UX0hVQigiIElOVkFMSURcbiIpOwotICogICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICogICAgICAgICAgICAgfQotICoKLSAqICAgICAgICAgICAgIHVzYl9wb3J0X3N0YXR1cyA9IGN2bXhfdXNiX2dldF9zdGF0dXModXNiKTsKLSAqICAgICAgICAgICAgIHBvcnRfc3RhdHVzID0gMDsKLSAqCi0gKiAgICAgICAgICAgICBpZiAodXNiX3BvcnRfc3RhdHVzLmNvbm5lY3RfY2hhbmdlKQotICogICAgICAgICAgICAgewotICogICAgICAgICAgICAgICAgIHBvcnRfc3RhdHVzIHw9ICgxIDw8IFVTQl9QT1JUX0ZFQVRfQ19DT05ORUNUSU9OKTsKLSAqICAgICAgICAgICAgICAgICBERUJVR19ST09UX0hVQigiIENfQ09OTkVDVElPTiIpOwotICogICAgICAgICAgICAgfQotICoKLSAqICAgICAgICAgICAgIGlmICh1c2JfcG9ydF9zdGF0dXMucG9ydF9lbmFibGVkKQotICogICAgICAgICAgICAgewotICogICAgICAgICAgICAgICAgIHBvcnRfc3RhdHVzIHw9ICgxIDw8IFVTQl9QT1JUX0ZFQVRfQ19FTkFCTEUpOwotICogICAgICAgICAgICAgICAgIERFQlVHX1JPT1RfSFVCKCIgQ19FTkFCTEUiKTsKLSAqICAgICAgICAgICAgIH0KLSAqCi0gKiAgICAgICAgICAgICBpZiAodXNiX3BvcnRfc3RhdHVzLmNvbm5lY3RlZCkKLSAqICAgICAgICAgICAgIHsKLSAqICAgICAgICAgICAgICAgICBwb3J0X3N0YXR1cyB8PSAoMSA8PCBVU0JfUE9SVF9GRUFUX0NPTk5FQ1RJT04pOwotICogICAgICAgICAgICAgICAgIERFQlVHX1JPT1RfSFVCKCIgQ09OTkVDVElPTiIpOwotICogICAgICAgICAgICAgfQotICoKLSAqICAgICAgICAgICAgIGlmICh1c2JfcG9ydF9zdGF0dXMucG9ydF9lbmFibGVkKQotICogICAgICAgICAgICAgewotICogICAgICAgICAgICAgICAgIHBvcnRfc3RhdHVzIHw9ICgxIDw8IFVTQl9QT1JUX0ZFQVRfRU5BQkxFKTsKLSAqICAgICAgICAgICAgICAgICBERUJVR19ST09UX0hVQigiIEVOQUJMRSIpOwotICogICAgICAgICAgICAgfQotICoKLSAqICAgICAgICAgICAgIGlmICh1c2JfcG9ydF9zdGF0dXMucG9ydF9vdmVyX2N1cnJlbnQpCi0gKiAgICAgICAgICAgICB7Ci0gKiAgICAgICAgICAgICAgICAgcG9ydF9zdGF0dXMgfD0gKDEgPDwgVVNCX1BPUlRfRkVBVF9PVkVSX0NVUlJFTlQpOwotICogICAgICAgICAgICAgICAgIERFQlVHX1JPT1RfSFVCKCIgT1ZFUl9DVVJSRU5UIik7Ci0gKiAgICAgICAgICAgICB9Ci0gKgotICogICAgICAgICAgICAgaWYgKHVzYl9wb3J0X3N0YXR1cy5wb3J0X3Bvd2VyZWQpCi0gKiAgICAgICAgICAgICB7Ci0gKiAgICAgICAgICAgICAgICAgcG9ydF9zdGF0dXMgfD0gKDEgPDwgVVNCX1BPUlRfRkVBVF9QT1dFUik7Ci0gKiAgICAgICAgICAgICAgICAgREVCVUdfUk9PVF9IVUIoIiBQT1dFUiIpOwotICogICAgICAgICAgICAgfQotICoKLSAqICAgICAgICAgICAgIGlmICh1c2JfcG9ydF9zdGF0dXMucG9ydF9zcGVlZCA9PSBDVk1YX1VTQl9TUEVFRF9ISUdIKQotICogICAgICAgICAgICAgewotICogICAgICAgICAgICAgICAgIHBvcnRfc3RhdHVzIHw9ICgxIDw8IFVTQl9QT1JUX0ZFQVRfSElHSFNQRUVEKTsKLSAqICAgICAgICAgICAgICAgICBERUJVR19ST09UX0hVQigiIEhJR0hTUEVFRCIpOwotICogICAgICAgICAgICAgfQotICogICAgICAgICAgICAgZWxzZSBpZiAodXNiX3BvcnRfc3RhdHVzLnBvcnRfc3BlZWQgPT0gQ1ZNWF9VU0JfU1BFRURfTE9XKQotICogICAgICAgICAgICAgewotICogICAgICAgICAgICAgICAgIHBvcnRfc3RhdHVzIHw9ICgxIDw8IFVTQl9QT1JUX0ZFQVRfTE9XU1BFRUQpOwotICogICAgICAgICAgICAgICAgIERFQlVHX1JPT1RfSFVCKCIgTE9XU1BFRUQiKTsKLSAqICAgICAgICAgICAgIH0KLSAqCi0gKiAgICAgICAgICAgICAqKChfX2xlMzIgKilidWYpID0gY3B1X3RvX2xlMzIocG9ydF9zdGF0dXMpOwotICogICAgICAgICAgICAgREVCVUdfUk9PVF9IVUIoIlxuIik7Ci0gKiAgICAgICAgICAgICBicmVhazsKLSAqICAgICAgICAgY2FzZSBTZXRIdWJGZWF0dXJlOgotICogICAgICAgICAgICAgREVCVUdfUk9PVF9IVUIoIk9jdGVvblVTQjogU2V0SHViRmVhdHVyZVxuIik7Ci0gKiAgICAgICAgICAgICAvLyBObyBIVUIgZmVhdHVyZXMgc3VwcG9ydGVkCi0gKiAgICAgICAgICAgICBicmVhazsKLSAqICAgICAgICAgY2FzZSBTZXRQb3J0RmVhdHVyZToKLSAqICAgICAgICAgICAgIERFQlVHX1JPT1RfSFVCKCJPY3Rlb25VU0I6IFNldFBvcnRGZWF0dXJlIik7Ci0gKiAgICAgICAgICAgICBpZiAod0luZGV4ICE9IDEpCi0gKiAgICAgICAgICAgICB7Ci0gKiAgICAgICAgICAgICAgICAgREVCVUdfUk9PVF9IVUIoIiBJTlZBTElEXG4iKTsKLSAqICAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAqICAgICAgICAgICAgIH0KLSAqCi0gKiAgICAgICAgICAgICBzd2l0Y2ggKHdWYWx1ZSkKLSAqICAgICAgICAgICAgIHsKLSAqICAgICAgICAgICAgICAgICBjYXNlIFVTQl9QT1JUX0ZFQVRfU1VTUEVORDoKLSAqICAgICAgICAgICAgICAgICAgICAgREVCVUdfUk9PVF9IVUIoIiBTVVNQRU5EXG4iKTsKLSAqICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gKiAgICAgICAgICAgICAgICAgY2FzZSBVU0JfUE9SVF9GRUFUX1BPV0VSOgotICogICAgICAgICAgICAgICAgICAgICBERUJVR19ST09UX0hVQigiIFBPV0VSXG4iKTsKLSAqICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gKiAgICAgICAgICAgICAgICAgY2FzZSBVU0JfUE9SVF9GRUFUX1JFU0VUOgotICogICAgICAgICAgICAgICAgICAgICBERUJVR19ST09UX0hVQigiIFJFU0VUXG4iKTsKLSAqICAgICAgICAgICAgICAgICAgICAgbG9jYWxfaXJxX3NhdmUoZmxhZ3MpOwotICogICAgICAgICAgICAgICAgICAgICBjdm14X3VzYl9kaXNhYmxlKHVzYik7Ci0gKiAgICAgICAgICAgICAgICAgICAgIGlmIChjdm14X3VzYl9lbmFibGUodXNiKSkKLSAqICAgICAgICAgICAgICAgICAgICAgICAgIERFQlVHX0VSUk9SKCJGYWlsZWQgdG8gZW5hYmxlIHRoZSBwb3J0XG4iKTsKLSAqICAgICAgICAgICAgICAgICAgICAgbG9jYWxfaXJxX3Jlc3RvcmUoZmxhZ3MpOwotICogICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDsKLSAqICAgICAgICAgICAgICAgICBjYXNlIFVTQl9QT1JUX0ZFQVRfSU5ESUNBVE9SOgotICogICAgICAgICAgICAgICAgICAgICBERUJVR19ST09UX0hVQigiIElORElDQVRPUlxuIik7Ci0gKiAgICAgICAgICAgICAgICAgICAgIC8vIE5vdCBzdXBwb3J0ZWQKLSAqICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gKiAgICAgICAgICAgICAgICAgZGVmYXVsdDoKLSAqICAgICAgICAgICAgICAgICAgICAgREVCVUdfUk9PVF9IVUIoIiBVTktOT1dOXG4iKTsKLSAqICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gKiAgICAgICAgICAgICB9Ci0gKiAgICAgICAgICAgICBicmVhazsKLSAqICAgICAgICAgZGVmYXVsdDoKLSAqICAgICAgICAgICAgIERFQlVHX1JPT1RfSFVCKCJPY3Rlb25VU0I6IFVua25vd24gcm9vdCBodWIgcmVxdWVzdFxuIik7Ci0gKiAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAqICAgICB9Ci0gKiA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gICAgICAgICAgICAgICAgICAgIC8qKjwgVGhpcyBpcyB0aGUgbGVuZ3RoIGluIGJ5dGVzIG9mIHRoZSBkYXRhICovCi0gICAgY3ZteF91c2JfY29tcGxldGVfdCBzdGF0dXM7ICAgICAvKio8IFRoaXMgaXMgdGhlIHN0YXR1cyBvZiB0aGlzIGluZGl2aWR1YWwgcGFja2V0IHRyYW5zZmVyICovCi19IGN2bXhfdXNiX2lzb19wYWNrZXRfdDsKLQotLyoqCi0gKiBQb3NzaWJsZSBjYWxsYmFjayByZWFzb25zIGZvciB0aGUgVVNCIEFQSS4KLSAqLwotdHlwZWRlZiBlbnVtCi17Ci0gICAgQ1ZNWF9VU0JfQ0FMTEJBQ0tfVFJBTlNGRVJfQ09NUExFVEUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKio8IEEgY2FsbGJhY2sgb2YgdGhpcyB0eXBlIGlzIGNhbGxlZCB3aGVuIGEgc3VibWl0dGVkIHRyYW5zZmVyCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tcGxldGVzLiBUaGUgY29tcGxldGlvbiBjYWxsYmFjayB3aWxsIGJlIGNhbGxlZCBldmVuIGlmIHRoZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zZmVyIGZhaWxzIG9yIGlzIGNhbmNlbGVkLiBUaGUgc3RhdHVzIHBhcmFtZXRlciB3aWxsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGFpbiBkZXRhaWxzIG9mIHdoeSBoZSBjYWxsYmFjayB3YXMgY2FsbGVkLiAqLwotICAgIENWTVhfVVNCX0NBTExCQUNLX1BPUlRfQ0hBTkdFRCwgLyoqPCBUaGUgc3RhdHVzIG9mIHRoZSBwb3J0IGNoYW5nZWQuIEZvciBleGFtcGxlLCBzb21lb25lIG1heSBoYXZlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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dCByZWFzb24sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN2bXhfdXNiX2NvbXBsZXRlX3Qgc3RhdHVzLAordHlwZWRlZiB2b2lkICgqY3ZteF91c2JfY2FsbGJhY2tfZnVuY190KShzdHJ1Y3QgY3ZteF91c2Jfc3RhdGUgKnN0YXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIGN2bXhfdXNiX2NhbGxiYWNrIHJlYXNvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBjdm14X3VzYl9jb21wbGV0ZSBzdGF0dXMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBwaXBlX2hhbmRsZSwgaW50IHN1Ym1pdF9oYW5kbGUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBieXRlc190cmFuc2ZlcnJlZCwgdm9pZCAqdXNlcl9kYXRhKTsKIAogLyoqCi0gKiBGbGFncyB0byBwYXNzIHRoZSBpbml0aWFsaXphdGlvbiBmdW5jdGlvbi4KLSAqLwotdHlwZWRlZiBlbnVtCi17Ci0gICAgQ1ZNWF9VU0JfSU5JVElBTElaRV9GTEFHU19DTE9DS19YT19YSSA9IDE8PDAsICAgICAgIC8qKjwgVGhlIFVTQiBwb3J0IHVzZXMgYSAxMk1IeiBjcnlzdGFsIGFzIGNsb2NrIHNvdXJjZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXQgVVNCX1hPIGFuZCBVU0JfWEkuICovCi0gICAgQ1ZNWF9VU0JfSU5JVElBTElaRV9GTEFHU19DTE9DS19YT19HTkQgPSAxPDwxLCAgICAgIC8qKjwgVGhlIFVTQiBwb3J0IHVzZXMgMTIvMjQvNDhNSHogMi41ViBib2FyZCBjbG9jawotICAgICAgICAgICAgICAgICAgICAgICAgICA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AgICAgICAgZW51bSBjdm14X3VzYl9zcGVlZCBkZXZpY2Vfc3BlZWQsIGludCBtYXhfcGFja2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBjdm14X3VzYl90cmFuc2ZlciB0cmFuc2Zlcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBjdm14X3VzYl9kaXJlY3Rpb24gdHJhbnNmZXJfZGlyLCBpbnQgaW50ZXJ2YWwsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgbXVsdGlfY291bnQsIGludCBodWJfZGV2aWNlX2FkZHIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaHViX3BvcnQpOwotCi0vKioKLSAqIENhbGwgdG8gc3VibWl0IGEgVVNCIEJ1bGsgdHJhbnNmZXIgdG8gYSBwaXBlLgotICoKLSAqIEBwYXJhbSBzdGF0ZSAgICAgVVNCIGRldmljZSBzdGF0ZSBwb3B1bGF0ZWQgYnkKLSAqICAgICAgICAgICAgICAgICAgY3ZteF91c2JfaW5pdGlhbGl6ZSgpLgotICogQHBhcmFtIHBpcGVfaGFuZGxlCi0gKiAgICAgICAgICAgICAgICAgIEhhbmRsZSB0byB0aGUgcGlwZSBmb3IgdGhlIHRyYW5zZmVyLgotICogQHBhcmFtIGJ1ZmZlciAgICBQaHlzaWNhbCBhZGRyZXNzIG9mIHRoZSBkYXRhIGJ1ZmZlciBpbgotICogICAgICAgICAgICAgICAgICBtZW1vcnkuIE5vdGUgdGhhdCB0aGlzIGlzIE5PVCBBIFBPSU5URVIsIGJ1dAotICogICAgICAgICAgICAgICAgICB0aGUgZnVsbCA2NGJpdCBwaHlzaWNhbCBhZGRyZXNzIG9mIHRoZQotICogICAgICAgICAgICAgICAgICBidWZmZXIuIFRoaXMgbWF5IGJlIHplcm8gaWYgYnVmZmVyX2xlbmd0aCBpcwotICogICAgICAgICAgICAgICAgICB6ZXJvLgotICogQHBhcmFtIGJ1ZmZl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nNmZXIuCi0gKiBAcGFyYW0gY29udHJvbF9oZWFkZXIKLSAqICAgICAgICAgICAgICAgICAgVVNCIDggYnl0ZSBjb250cm9sIGhlYWRlciBwaHlzaWNhbCBhZGRyZXNzLgotICogICAgICAgICAgICAgICAgICBOb3RlIHRoYXQgdGhpcyBpcyBOT1QgQSBQT0lOVEVSLCBidXQgdGhlCi0gKiAgICAgICAgICAgICAgICAgIGZ1bGwgNjRiaXQgcGh5c2ljYWwgYWRkcmVzcyBvZiB0aGUgYnVmZmVyLgotICogQHBhcmFtIGJ1ZmZlciAgICBQaHlzaWNhbCBhZGRyZXNzIG9mIHRoZSBkYXRhIGJ1ZmZlciBpbgotICogICAgICAgICAgICAgICAgICBtZW1vcnkuIE5vdGUgdGhhdCB0aGlzIGlzIE5PVCBBIFBPSU5URVIsIGJ1dAotICogICAgICAgICAgICAgICAgICB0aGUgZnVsbCA2NGJpdCBwaHlzaWNhbCBhZGRyZXNzIG9mIHRoZQotICogICAgICAgICAgICAgICAgICBidWZmZXIuIFRoaXMgbWF5IGJlIHplcm8gaWYgYnVmZmVyX2xlbmd0aCBpcwotICogICAgICAgICAgICAgICAgICB6ZXJvLgotICogQHBhcmFtIGJ1ZmZlcl9sZW5ndGgKLSAqICAgICAgICAgICAgICAgICAgTGVuZ3RoIG9mIGJ1ZmZlciBpbiBieXRlcy4KLSAqIEBwYXJhbSBjYWxsYmFjayAgRnVuY3Rpb24gdG8gY2FsbCB3aGVuIHRoaXMgdHJhbnNhY3Rpb24KLSAqICAgICAgICAgICAgICAgICAgY29tcGxldGVzLiBJZiB0aGUgcmV0dXJuIHZhbHVlIG9mIHRoaXMKLSAqICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gaXNuJ3QgYW4gZXJyb3IsIHRoZW4gdGhpcyBmdW5jdGlvbgotICogICAgICAgICAgICAgICAgICBpcyBndWFyYW50ZWVkIHRvIGJlIGNhbGxlZCB3aGVuIHRoZQotICogICAgICAgICAgICAgICAgICB0cmFuc2Fj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hbCBwYWNrZXRzIHRvIHRyYW5zZmVyLgotICogICAgICAgICAgICAgICAgICAicGFja2V0cyIgaXMgYSBwb2ludGVyIHRvIGFuIGFycmF5IG9mIHRoaXMKLSAqICAgICAgICAgICAgICAgICAgbWFueSBwYWNrZXQgc3RydWN0dXJlcy4KLSAqIEBwYXJhbSBwYWNrZXRzICAgRGVzY3JpcHRpb24gb2YgZWFjaCB0cmFuc2ZlciBwYWNrZXQgYXMKLSAqICAgICAgICAgICAgICAgICAgZGVmaW5lZCBieSBjdm14X3VzYl9pc29fcGFja2V0X3QuIFRoZSBhcnJheQotICogICAgICAgICAgICAgICAgICBwb2ludGVkIHRvIGhlcmUgbXVzdCBzdGF5IHZhbGlkIHVudGlsIHRoZQotICogICAgICAgICAgICAgICAgICBjb21wbGV0ZSBjYWxsYmFjayBpcyBjYWxsZWQuCi0gKiBAcGFyYW0gYnVmZmVyICAgIFBoeXNpY2FsIGFkZHJlc3Mgb2YgdGhlIGRhdGEgYnVmZmVyIGluCi0gKiAgICAgICAgICAgICAgICAgIG1lbW9yeS4gTm90ZSB0aGF0IHRoaXMgaXMgTk9UIEEgUE9JTlRFUiwgYnV0Ci0gKiAgICAgICAgICAgICAgICAgIHRoZSBmdWxsIDY0Yml0IHBoeXNpY2FsIGFkZHJlc3Mgb2YgdGhlCi0gKiAgICAgICAgICAgICAgICAgIGJ1ZmZlci4gVGhpcyBtYXkgYmUgemVybyBpZiBidWZmZXJfbGVuZ3RoIGlzCi0gKiAgICAgICAgICAgICAgICAgIHplcm8uCi0gKiBAcGFyYW0gYnVmZmVyX2xlbmd0aAotICogICAgICAgICAgICAgICAgICBMZW5ndGggb2YgYnVmZmVyIGluIGJ5dGVzLgotICogQHBhcmFtIGNhbGxiYWNrICBGdW5jdGlvbiB0byBjYWxsIHdoZW4gdGhpcyB0cmFuc2FjdGlvbgotICogICAgICAgICAgICAgICAgICBjb21wbGV0ZXMuIElmIHRoZSByZXR1cm4gdmFsdWUgb2YgdGhpcwotICog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cGVfaGFuZGxlLAorZXh0ZXJuIGludCBjdm14X3VzYl9zdWJtaXRfaXNvY2hyb25vdXMoc3RydWN0IGN2bXhfdXNiX3N0YXRlICpzdGF0ZSwgaW50IHBpcGVfaGFuZGxlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHN0YXJ0X2ZyYW1lLCBpbnQgZmxhZ3MsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgbnVtYmVyX3BhY2tldHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdm14X3VzYl9pc29fcGFja2V0X3QgcGFja2V0c1tdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGN2bXhfdXNiX2lzb19wYWNrZXQgcGFja2V0c1tdLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDY0X3QgYnVmZmVyLCBpbnQgYnVmZmVyX2xlbmd0aCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN2bXhfdXNiX2NhbGxiYWNrX2Z1bmNfdCBjYWxsYmFjaywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKnVzZXJfZGF0YSk7Ci0KLS8qKgotICogQ2FuY2VsIG9uZSBvdXRzdGFuZGluZyByZXF1ZXN0IGluIGEgcGlwZS4gQ2FuY2VsaW5nIGEgcmVxdWVzdAotICogY2FuIGZhaWwgaWYgdGhlIHRyYW5zYWN0aW9uIGhhcyBhbHJlYWR5IGNvbXBsZXRlZCBiZWZvcmUgY2FuY2VsCi0gKiBpcyBjYWxsZWQuIEV2ZW4gYWZ0ZXIgYSBzdWNjZXNzZnVsIGNhbmNlbCBjYWxsLCBpdCBtYXkgdGFrZQotICogYSBmcmFtZSBvciB0d28gZm9yIHRoZSBjdm14X3VzYl9wb2xsKCkgZnVuY3Rpb24gdG8gY2FsbCB0aGUK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KKwlwcmVtYWluZGVyX2llID0gcHdwc19pZSArIHdwc19pZWxlbjsKKworCXJlbWFpbmRlcl9pZWxlbiA9IGllbGVuIC0gd3BzX29mZnNldCAtIHdwc19pZWxlbjsKKworCWlmIChyZW1haW5kZXJfaWVsZW4gPiAwKSB7CisJCXBiYWNrdXBfcmVtYWluZGVyX2llID0gcnR3X21hbGxvYyhyZW1haW5kZXJfaWVsZW4pOworCQlpZiAocGJhY2t1cF9yZW1haW5kZXJfaWUpCisJCQltZW1jcHkocGJhY2t1cF9yZW1haW5kZXJfaWUsIHByZW1haW5kZXJfaWUsIHJlbWFpbmRlcl9pZWxlbik7CisJfQorCisJcHdwc19pZV9zcmMgPSBwbWxtZXByaXYtPndwc19iZWFjb25faWU7CisJaWYgKHB3cHNfaWVfc3JjID09IE5VTEwpCisJCXJldHVybjsKKworCXdwc19pZWxlbiA9ICh1aW50KXB3cHNfaWVfc3JjWzFdOy8qIHRvIGdldCBpZSBkYXRhIGxlbiAqLworCWlmICgod3BzX29mZnNldCt3cHNfaWVsZW4rMityZW1haW5kZXJfaWVsZW4pIDw9IE1BWF9JRV9TWikgeworCQltZW1jcHkocHdwc19pZSwgcHdwc19pZV9zcmMsIHdwc19pZWxlbisyKTsKKwkJcHdwc19pZSArPSAod3BzX2llbGVuKzIpOworCisJCWlmIChwYmFja3VwX3JlbWFpbmRlcl9pZSkKKwkJCW1lbWNweShwd3BzX2llLCBwYmFja3VwX3JlbWFpbmRlcl9pZSwgcmVtYWluZGVyX2llbGVuKTsKKworCQkvKiB1cGRhdGUgSUVMZW5ndGggKi8KKwkJcG5ldHdvcmstPklFTGVuZ3RoID0gd3BzX29mZnNldCArICh3cHNfaWVsZW4rMikgKyByZW1haW5kZXJfaWVsZW47CisJfQorCisJaWYgKHBiYWNrdXBfcmVtYWluZGVyX2llKQorCQlrZnJlZShwYmFja3VwX3JlbWFpbmRlcl9pZSk7Cit9CisKK3N0YXRpYyB2b2lkIHVwZGF0ZV9iY25fcDJwX2ll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qKXJ0d19uZXRkZXZfcHJpdihkZXYpOworCWludCBsZW4gPSAwOworCWludCBpLCBqID0gMSwgcGF0aDsKKwl1MzIgdmFsdWU7CisKKwlsZW4gKz0gc25wcmludGYocGFnZSArIGxlbiwgY291bnQgLSBsZW4sICJcbj09PT09PT0gUkYgUkVHID09PT09PT1cbiIpOworCXBhdGggPSAyOworCWxlbiArPSBzbnByaW50ZihwYWdlICsgbGVuLCBjb3VudCAtIGxlbiwgIlxuUkZfUGF0aCgleClcbiIsIHBhdGgpOworCWZvciAoaSA9IDA7IGkgPCAweEMwOyBpKyspIHsKKwkJdmFsdWUgPSBydHdfaGFsX3JlYWRfcmZyZWcocGFkYXB0ZXIsIHBhdGgsIGksIDB4ZmZmZmZmZmYpOworCQlpZiAoaiU0ID09IDEpCisJCQlsZW4gKz0gc25wcmludGYocGFnZSArIGxlbiwgY291bnQgLSBsZW4sICIweCUwMnggIiwgaSk7CisJCWxlbiArPSBzbnByaW50ZihwYWdlICsgbGVuLCBjb3VudCAtIGxlbiwgIiAweCUwOHggIiwgdmFsdWUpOworCQlpZiAoKGorKyklNCA9PSAwKQorCQkJbGVuICs9IHNucHJpbnRmKHBhZ2UgKyBsZW4sIGNvdW50IC0gbGVuLCAiXG4iKTsKKwl9CisKKwkqZW9mID0gMTsKKwlyZXR1cm4gbGVuOworfQorCisKK2ludCBwcm9jX2dldF9yZl9yZWdfZHVtcDQoY2hhciAqcGFnZSwgY2hhciAqKnN0YXJ0LAorCQkJICBvZmZfdCBvZmZzZXQsIGludCBjb3VudCwKKwkJCSAgaW50ICplb2YsIHZvaWQgKmRhdGEpCit7CisJc3RydWN0IG5ldF9kZXZpY2UgKmRldiA9IGRhdGE7CisJc3RydWN0IGFkYXB0ZXIgKnBhZGFwdGVyID0gKHN0cnVjdCBhZGFwdGVyICopcnR3X25ldGRldl9wcml2KGRldik7CisJaW50IGxlbiA9IDA7CisJaW50IGksIGogPSAxLCBwYXRoOworCXUzMiB2YWx1ZTsKKworCWxl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gaWVsZW5ndGggPSAwOworCXVuc2lnbmVkIGludCBpLCBqOworCisJaSA9IDEyOyAvKiBhZnRlciB0aGUgZml4ZWQgSUUgKi8KKwl3aGlsZSAoaSA8IGluX2xlbikgeworCQlpZWxlbmd0aCA9IGluaXRpYWxfb3V0X2xlbjsKKworCQlpZiAoaW5faWVbaV0gPT0gMHhERCAmJiBpbl9pZVtpKzJdID09IDB4MDAgJiYgaW5faWVbaSszXSA9PSAweDUwICAmJiBpbl9pZVtpKzRdID09IDB4RjIgJiYgaW5faWVbaSs1XSA9PSAweDAyICYmIGkrNSA8IGluX2xlbikgeworCQkJLyogV01NIGVsZW1lbnQgSUQgYW5kIE9VSSAqLworCQkJLyogQXBwZW5kIFdNTSBJRSB0byB0aGUgbGFzdCBpbmRleCBvZiBvdXRfaWUgKi8KKworCQkJZm9yIChqID0gaTsgaiA8IGkgKyA5OyBqKyspIHsKKwkJCQlvdXRfaWVbaWVsZW5ndGhdID0gaW5faWVbal07CisJCQkJaWVsZW5ndGgrKzsKKwkJCX0KKwkJCW91dF9pZVtpbml0aWFsX291dF9sZW4gKyAxXSA9IDB4MDc7CisJCQlvdXRfaWVbaW5pdGlhbF9vdXRfbGVuICsgNl0gPSAweDAwOworCQkJb3V0X2llW2luaXRpYWxfb3V0X2xlbiArIDhdID0gMHgwMDsKKwkJCWJyZWFrOworCQl9CisJCWkgKz0gKGluX2llW2krMV0rMik7IC8qICB0byB0aGUgbmV4dCBJRSBlbGVtZW50ICovCisJfQorCXJldHVybiBpZWxlbmd0aDsKK30KKworLyogICovCisvKiAgUG9ydGVkIGZyb20gODE4NTogSXNJblByZUF1dGhLZXlMaXN0KCkuIChSZW5hbWVkIGZyb20gU2VjSXNJblByZUF1dGhLZXlMaXN0KCksIDIwMDYtMTAtMTMuKSAqLworLyogIEFkZGVkIGJ5IEFubmllLCAyMDA2LTA1LTA3LiAqLworLyogICovCisvKiAgU2VhcmNoIGJ5IEJTU0lELCAqLworLyogIFJldHVybiBWYWx1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IGNoYXIgUlNOX1RLSVBfQ0lQSEVSWzRdID0gezB4MDAsIDB4MGYsIDB4YWMsIDB4MDJ9OworCitleHRlcm4gdW5zaWduZWQgY2hhciBSRUFMVEVLXzk2Ql9JRVtdOworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKK01DUyByYXRlIGRlZmluaXRpb25zCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCit1bnNpZ25lZCBjaGFyCU1DU19yYXRlXzJSWzE2XSA9IHsweGZmLCAweGZmLCAweDAsIDB4MCwgMHgwMSwgMHgwLCAweDAsIDB4MCwgMHgwLCAweDAsIDB4MCwgMHgwLCAweDAsIDB4MCwgMHgwLCAweDB9OwordW5zaWduZWQgY2hhcglNQ1NfcmF0ZV8xUlsxNl0gPSB7MHhmZiwgMHgwMCwgMHgwLCAweDAsIDB4MDEsIDB4MCwgMHgwLCAweDAsIDB4MCwgMHgwLCAweDAsIDB4MCwgMHgwLCAweDAsIDB4MCwgMHgwfTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCitDaGFubmVsUGxhbiBkZWZpbml0aW9ucworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RhdGljIHN0cnVjdCBydF9jaGFubmVsX3BsYW5fMmcgUlRXX0NoYW5uZWxQbGFuMkdbUlRfQ0hBTk5FTF9ET01BSU5fMkdfTUFYXSA9IHsKKwl7ezEsIDIsIDMsIDQsIDUsIDYsIDcsIDgsIDksIDEwLCAxMSwgMTIsIDEzfSwgMTN9LAkJLyogIDB4MDAsIFJUX0NIQU5ORUxfRE9NQUlOXzJHX1dPUkxEICwgUGFzc2l2ZSBzY2FuIENIIDEyLCAxMyAqLworCXt7MSwgMiwgMywgNCwgNSwgNiwgNywgOCwgOSwgMTAsIDExLCA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fRE9NQUlOX0ZDQzFfTkNDMiAqLworCXsweDAzfSwJLyogMHg0MSwgUlRfQ0hBTk5FTF9ET01BSU5fR0xPQkFMX0RPQU1JTl8yRyAqLworfTsKKworc3RhdGljIHN0cnVjdCBydF9jaGFubmVsX3BsYW5fbWFwIFJUV19DSEFOTkVMX1BMQU5fTUFQX1JFQUxURUtfREVGSU5FID0gezB4MDN9OyAvKiB1c2UgdGhlIGNvbmJpbmF0aW9uIGZvciBtYXggY2hhbm5lbCBudW1iZXJzICovCisKKy8qCisgKiBTZWFyY2ggdGhlIEBwYXJhbSBjaGFubmVsX251bSBpbiBnaXZlbiBAcGFyYW0gY2hhbm5lbF9zZXQKKyAqIEBjaF9zZXQ6IHRoZSBnaXZlbiBjaGFubmVsIHNldAorICogQGNoOiB0aGUgZ2l2ZW4gY2hhbm5lbCBudW1iZXIKKyAqCisgKiByZXR1cm4gdGhlIGluZGV4IG9mIGNoYW5uZWxfbnVtIGluIGNoYW5uZWxfc2V0LCAtMSBpZiBub3QgZm91bmQKKyAqLworaW50IHJ0d19jaF9zZXRfc2VhcmNoX2NoKHN0cnVjdCBydF9jaGFubmVsX2luZm8gKmNoX3NldCwgY29uc3QgdTMyIGNoKQoreworCWludCBpOworCWZvciAoaSA9IDA7IGNoX3NldFtpXS5DaGFubmVsTnVtICE9IDA7IGkrKykgeworCQlpZiAoY2ggPT0gY2hfc2V0W2ldLkNoYW5uZWxOdW0pCisJCQlicmVhazsKKwl9CisKKwlpZiAoaSA+PSBjaF9zZXRbaV0uQ2hhbm5lbE51bSkKKwkJcmV0dXJuIC0xOworCXJldHVybiBpOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorCitGb2xsb3dpbmcgYXJlIHRoZSBpbml0aWFsaXphdGlvbiBmdW5jdGlvbnMgZm9yIFdpRmkgTUxNRQorCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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XB0ZXIsIHB0YWJsZSwgcHJlY3ZfZnJhbWUpOworI2VuZGlmCit9CisKKyNpZmRlZiBDT05GSUdfODhFVV9QMlAKK3N0YXRpYyB1MzIgcDJwX2xpc3Rlbl9zdGF0ZV9wcm9jZXNzKHN0cnVjdCBhZGFwdGVyICpwYWRhcHRlciwgdW5zaWduZWQgY2hhciAqZGEpCit7CisJYm9vbCByZXNwb25zZSA9IHRydWU7CisKKwkvKglkbyBub3RoaW5nIGlmIHRoZSBkZXZpY2UgbmFtZSBpcyBlbXB0eSAqLworCWlmICghcGFkYXB0ZXItPndkaW5mby5kZXZpY2VfbmFtZV9sZW4pCisJCXJlc3BvbnNlID0gZmFsc2U7CisKKwlpZiAocmVzcG9uc2UpCisJCWlzc3VlX3Byb2JlcnNwX3AycChwYWRhcHRlciwgZGEpOworCisJcmV0dXJuIF9TVUNDRVNTOworfQorI2VuZGlmIC8qIENPTkZJR184OEVVX1AyUCAqLworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisKK0ZvbGxvd2luZyBhcmUgdGhlIGNhbGxiYWNrIGZ1bmN0aW9ucyBmb3IgZWFjaCBzdWJ0eXBlIG9mIHRoZSBtYW5hZ2VtZW50IGZyYW1lcworCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordW5zaWduZWQgaW50IE9uUHJvYmVSZXEoc3RydWN0IGFkYXB0ZXIgKnBhZGFwdGVyLCB1bmlvbiByZWN2X2ZyYW1lICpwcmVjdl9mcmFtZSkKK3sKKwl1bnNpZ25lZCBpbnQJaWVsZW47CisJdW5zaWduZWQgY2hhcgkqcDsKKwlzdHJ1Y3QgbWxtZV9wcml2ICpwbWxtZXByaXYgPSAmcGFkYXB0ZXItPm1sbWVwcml2OworCXN0cnVjdCBtbG1lX2V4dF9wcml2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SW5mbyAqLworCS8qCTkuIE9wZXJhdGluZyBDaGFubmVsICovCisKKworCS8qCVAyUCBDYXBhYmlsaXR5ICovCisJLyoJVHlwZTogKi8KKwlwMnBpZVtwMnBpZWxlbisrXSA9IFAyUF9BVFRSX0NBUEFCSUxJVFk7CisKKwkvKglMZW5ndGg6ICovCisJKihfX2xlMTYgKikocDJwaWUgKyBwMnBpZWxlbikgPSBjcHVfdG9fbGUxNigweDAwMDIpOworCXAycGllbGVuICs9IDI7CisKKwkvKglWYWx1ZTogKi8KKwkvKglEZXZpY2UgQ2FwYWJpbGl0eSBCaXRtYXAsIDEgYnl0ZSAqLworCXAycGllW3AycGllbGVuKytdID0gRE1QX1AyUF9ERVZDQVBfU1VQUE9SVDsKKworCS8qCUdyb3VwIENhcGFiaWxpdHkgQml0bWFwLCAxIGJ5dGUgKi8KKwlpZiAocHdkaW5mby0+cGVyc2lzdGVudF9zdXBwb3J0ZWQpCisJCXAycGllW3AycGllbGVuKytdID0gUDJQX0dSUENBUF9DUk9TU19DT05OIHwgUDJQX0dSUENBUF9QRVJTSVNURU5UX0dST1VQOworCWVsc2UKKwkJcDJwaWVbcDJwaWVsZW4rK10gPSBQMlBfR1JQQ0FQX0NST1NTX0NPTk47CisKKwkvKglHcm91cCBPd25lciBJbnRlbnQgKi8KKwkvKglUeXBlOiAqLworCXAycGllW3AycGllbGVuKytdID0gUDJQX0FUVFJfR09fSU5URU5UOworCisJLyoJTGVuZ3RoOiAqLworCSooX19sZTE2ICopKHAycGllICsgcDJwaWVsZW4pID0gY3B1X3RvX2xlMTYoMHgwMDAxKTsKKwlwMnBpZWxlbiArPSAyOworCisJLyoJVmFsdWU6ICovCisJLyoJVG9kbyB0aGUgdGllIGJyZWFrZXIgYml0LiAqLworCXAycGllW3AycGllbGVuKytdID0gKChwd2RpbmZvLT5pbnRlbnQgPDwgMSkgfCBCSVQoMCkpOworCisJLyoJQ29uZmlndXJhdGlvbiBUaW1lb3V0ICovCisJLyoJVHlwZTogKi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ZW5fY2hhbm5lbDsJLyoJbGlzdGVuaW5nIGNoYW5uZWwgbnVtYmVyICovCisKKworCS8qCUV4dGVuZGVkIExpc3RlbiBUaW1pbmcgQVRUUiAqLworCS8qCVR5cGU6ICovCisJcDJwaWVbcDJwaWVsZW4rK10gPSBQMlBfQVRUUl9FWF9MSVNURU5fVElNSU5HOworCisJLyoJTGVuZ3RoOiAqLworCSooX19sZTE2ICopKHAycGllICsgcDJwaWVsZW4pID0gY3B1X3RvX2xlMTYoMHgwMDA0KTsKKwlwMnBpZWxlbiArPSAyOworCisJLyoJVmFsdWU6ICovCisJLyoJQXZhaWxhYmlsaXR5IFBlcmlvZCAqLworCSooX19sZTE2ICopKHAycGllICsgcDJwaWVsZW4pID0gY3B1X3RvX2xlMTYoMHhGRkZGKTsKKwlwMnBpZWxlbiArPSAyOworCisJLyoJQXZhaWxhYmlsaXR5IEludGVydmFsICovCisJKihfX2xlMTYgKikocDJwaWUgKyBwMnBpZWxlbikgPSBjcHVfdG9fbGUxNigweEZGRkYpOworCXAycGllbGVuICs9IDI7CisKKworCS8qCUludGVuZGVkIFAyUCBJbnRlcmZhY2UgQWRkcmVzcyAqLworCS8qCVR5cGU6ICovCisJcDJwaWVbcDJwaWVsZW4rK10gPSBQMlBfQVRUUl9JTlRFTlRFRF9JRl9BRERSOworCisJLyoJTGVuZ3RoOiAqLworCSooX19sZTE2ICopKHAycGllICsgcDJwaWVsZW4pID0gY3B1X3RvX2xlMTYoRVRIX0FMRU4pOworCXAycGllbGVuICs9IDI7CisKKwkvKglWYWx1ZTogKi8KKwltZW1jcHkocDJwaWUgKyBwMnBpZWxlbiwgbXlpZCgmcGFkYXB0ZXItPmVlcHJvbXByaXYpLCBFVEhfQUxFTik7CisJcDJwaWVsZW4gKz0gRVRIX0FMRU47CisKKworCS8qCUNoYW5uZWwgTGlzdCAqLworCS8qCVR5cGU6ICovCisJcDJwaWVbcDJwaWVsZW4rK10gPSBQMlBfQVRUUl9DSF9MSVNUOworCisJLy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JwaWVsZW4gKz0gRVRIX0FMRU47CisKKwkvKglDb25maWcgTWV0aG9kICovCisJLyoJVGhpcyBmaWVsZCBzaG91bGQgYmUgYmlnIGVuZGlhbi4gTm90ZWQgYnkgUDJQIHNwZWNpZmljYXRpb24uICovCisKKwkqKF9fYmUxNiAqKShwMnBpZSArIHAycGllbGVuKSA9IGNwdV90b19iZTE2KHB3ZGluZm8tPnN1cHBvcnRlZF93cHNfY20pOworCisJcDJwaWVsZW4gKz0gMjsKKworCS8qCVByaW1hcnkgRGV2aWNlIFR5cGUgKi8KKwkvKglDYXRlZ29yeSBJRCAqLworCSooX19iZTE2ICopKHAycGllICsgcDJwaWVsZW4pID0gY3B1X3RvX2JlMTYoV1BTX1BEVF9DSURfTVVMSVRfTUVESUEpOworCXAycGllbGVuICs9IDI7CisKKwkvKglPVUkgKi8KKwkqKF9fYmUzMiAqKShwMnBpZSArIHAycGllbGVuKSA9IGNwdV90b19iZTMyKFdQU09VSSk7CisJcDJwaWVsZW4gKz0gNDsKKworCS8qCVN1YiBDYXRlZ29yeSBJRCAqLworCSooX19iZTE2ICopKHAycGllICsgcDJwaWVsZW4pID0gY3B1X3RvX2JlMTYoV1BTX1BEVF9TQ0lEX01FRElBX1NFUlZFUik7CisJcDJwaWVsZW4gKz0gMjsKKworCS8qCU51bWJlciBvZiBTZWNvbmRhcnkgRGV2aWNlIFR5cGVzICovCisJcDJwaWVbcDJwaWVsZW4rK10gPSAweDAwOwkvKglObyBTZWNvbmRhcnkgRGV2aWNlIFR5cGUgTGlzdCAqLworCisJLyoJRGV2aWNlIE5hbWUgKi8KKwkvKglUeXBlOiAqLworCSooX19iZTE2ICopKHAycGllICsgcDJwaWVsZW4pID0gY3B1X3RvX2JlMTYoV1BTX0FUVFJfREVWSUNFX05BTUUpOworCXAycGllbGVuICs9IDI7CisKKwkvKglMZW5ndGg6ICovCisJKihfX2JlMTYgKikocDJwaWUgKyBwMnBpZWxlbikgPSBjcHVfdG9fYmUxNihwd2RpbmZ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VuKSA9IGNwdV90b19iZTE2KFdQU19QRFRfQ0lEX01VTElUX01FRElBKTsKKwlwMnBpZWxlbiArPSAyOworCisJLyoJT1VJICovCisJKihfX2JlMzIgKikocDJwaWUgKyBwMnBpZWxlbikgPSBjcHVfdG9fYmUzMihXUFNPVUkpOworCXAycGllbGVuICs9IDQ7CisKKwkvKglTdWIgQ2F0ZWdvcnkgSUQgKi8KKwkqKF9fYmUxNiAqKShwMnBpZSArIHAycGllbGVuKSA9IGNwdV90b19iZTE2KFdQU19QRFRfU0NJRF9NRURJQV9TRVJWRVIpOworCXAycGllbGVuICs9IDI7CisKKwkvKglOdW1iZXIgb2YgU2Vjb25kYXJ5IERldmljZSBUeXBlcyAqLworCXAycGllW3AycGllbGVuKytdID0gMHgwMDsJLyoJTm8gU2Vjb25kYXJ5IERldmljZSBUeXBlIExpc3QgKi8KKworCS8qCURldmljZSBOYW1lICovCisJLyoJVHlwZTogKi8KKwkqKF9fYmUxNiAqKShwMnBpZSArIHAycGllbGVuKSA9IGNwdV90b19iZTE2KFdQU19BVFRSX0RFVklDRV9OQU1FKTsKKwlwMnBpZWxlbiArPSAyOworCisJLyoJTGVuZ3RoOiAqLworCSooX19iZTE2ICopKHAycGllICsgcDJwaWVsZW4pID0gY3B1X3RvX2JlMTYocHdkaW5mby0+ZGV2aWNlX25hbWVfbGVuKTsKKwlwMnBpZWxlbiArPSAyOworCisJLyoJVmFsdWU6ICovCisJbWVtY3B5KHAycGllICsgcDJwaWVsZW4sIHB3ZGluZm8tPmRldmljZV9uYW1lICwgcHdkaW5mby0+ZGV2aWNlX25hbWVfbGVuKTsKKwlwMnBpZWxlbiArPSBwd2RpbmZvLT5kZXZpY2VfbmFtZV9sZW47CisKKwlpZiAocnR3X3AycF9jaGtfcm9sZShwd2RpbmZvLCBQMlBfUk9MRV9HTykpIHsKKwkJLyoJR3JvdXAgSUQgQXR0cmlidXRlICovCisJCS8qCVR5cGU6ICovCisJCXAycGllW3AycGllbGVuKytdID0gUDJ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QgKDJieXRlcykgKi8KKwkqKF9fbGUxNiAqKShwMnBpZSArIHAycGllbGVuKSA9IGNwdV90b19sZTE2KDIxICsgcHdkaW5mby0+ZGV2aWNlX25hbWVfbGVuKTsKKwlwMnBpZWxlbiArPSAyOworCisJLyoJVmFsdWU6ICovCisJLyoJUDJQIERldmljZSBBZGRyZXNzICovCisJbWVtY3B5KHAycGllICsgcDJwaWVsZW4sIG15aWQoJnBhZGFwdGVyLT5lZXByb21wcml2KSwgRVRIX0FMRU4pOworCXAycGllbGVuICs9IEVUSF9BTEVOOworCisJLyoJQ29uZmlnIE1ldGhvZCAqLworCS8qCVRoaXMgZmllbGQgc2hvdWxkIGJlIGJpZyBlbmRpYW4uIE5vdGVkIGJ5IFAyUCBzcGVjaWZpY2F0aW9uLiAqLworCSooX19iZTE2ICopKHAycGllICsgcDJwaWVsZW4pID0gY3B1X3RvX2JlMTYoV1BTX0NPTkZJR19NRVRIT0RfRElTUExBWSk7CisJcDJwaWVsZW4gKz0gMjsKKworCS8qCVByaW1hcnkgRGV2aWNlIFR5cGUgKi8KKwkvKglDYXRlZ29yeSBJRCAqLworCSooX19iZTE2ICopKHAycGllICsgcDJwaWVsZW4pID0gY3B1X3RvX2JlMTYoV1BTX1BEVF9DSURfTVVMSVRfTUVESUEpOworCXAycGllbGVuICs9IDI7CisKKwkvKglPVUkgKi8KKwkqKF9fYmUzMiAqKShwMnBpZSArIHAycGllbGVuKSA9IGNwdV90b19iZTMyKFdQU09VSSk7CisJcDJwaWVsZW4gICs9IDQ7CisKKwkvKglTdWIgQ2F0ZWdvcnkgSUQgKi8KKwkqKF9fYmUxNiAqKShwMnBpZSArIHAycGllbGVuKSA9IGNwdV90b19iZTE2KFdQU19QRFRfU0NJRF9NRURJQV9TRVJWRVIpOworCXAycGllbGVuICs9IDI7CisKKwkvKglOdW1iZXIgb2YgU2Vjb25kYXJ5IERldmljZSBUeXBlcyAqLworCXAycGllW3AycGllbGVuKytdID0gMHgwMDsJLyoJTm8gU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OworCX0KKwlwbWdudGZyYW1lLT5mcmFtZV90YWcgPSBNR05UX0ZSQU1FVEFHOworCXBtZ250ZnJhbWUtPnB4bWl0YnVmID0gcHhtaXRidWY7CisJcG1nbnRmcmFtZS0+YnVmX2FkZHIgPSBweG1pdGJ1Zi0+cGJ1ZjsKKwlweG1pdGJ1Zi0+cHJpdl9kYXRhID0gcG1nbnRmcmFtZTsKKwlyZXR1cm4gcG1nbnRmcmFtZTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKworRm9sbG93aW5nIGFyZSBzb21lIFRYIGZ1Y3Rpb25zIGZvciBXaUZpIE1MTUUKKworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3ZvaWQgdXBkYXRlX21nbnRfdHhfcmF0ZShzdHJ1Y3QgYWRhcHRlciAqcGFkYXB0ZXIsIHU4IHJhdGUpCit7CisJc3RydWN0IG1sbWVfZXh0X3ByaXYJKnBtbG1lZXh0ID0gJihwYWRhcHRlci0+bWxtZWV4dHByaXYpOworCisJcG1sbWVleHQtPnR4X3JhdGUgPSByYXRlOworCURCR184OEUoIiVzKCk6IHJhdGUgPSAleFxuIiwgX19mdW5jX18sIHJhdGUpOworfQorCit2b2lkIHVwZGF0ZV9tZ250ZnJhbWVfYXR0cmliKHN0cnVjdCBhZGFwdGVyICpwYWRhcHRlciwgc3RydWN0IHBrdF9hdHRyaWIgKnBhdHRyaWIpCit7CisJc3RydWN0IG1sbWVfZXh0X3ByaXYJKnBtbG1lZXh0ID0gJihwYWRhcHRlci0+bWxtZWV4dHByaXYpOworCisJX3J0d19tZW1zZXQoKHU4ICopKHBhdHRyaWIpLCAwLCBzaXplb2Yoc3RydWN0IHBrdF9hdHRyaWIpKTsKKworCXBhdHRyaWItPmhkcmxlbiA9IDI0OworCXBhdHR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UNfSU5DX1JFVFVSTigmcG1sbWVleHQtPmV2ZW50X3NlcSk7CisKKwlwYWRkX3N0YV9ldnQgPSAoc3RydWN0IHN0YXNzb2NfZXZlbnQgKikocGV2dGNtZCArIHNpemVvZihzdHJ1Y3QgQzJIRXZlbnRfSGVhZGVyKSk7CisJbWVtY3B5KCh1bnNpZ25lZCBjaGFyICopKCYocGFkZF9zdGFfZXZ0LT5tYWNhZGRyKSksIE1hY0FkZHIsIEVUSF9BTEVOKTsKKwlwYWRkX3N0YV9ldnQtPmNhbV9pZCA9IGNhbV9pZHg7CisKKwlEQkdfODhFKCJyZXBvcnRfYWRkX3N0YV9ldmVudDogYWRkIFNUQVxuIik7CisKKwlydHdfZW5xdWV1ZV9jbWQocGNtZHByaXYsIHBjbWRfb2JqKTsKKworCXJldHVybjsKK30KKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorCitGb2xsb3dpbmcgYXJlIHRoZSBldmVudCBjYWxsYmFjayBmdW5jdGlvbnMKKworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qIGZvciBzdGEvYWRob2MgbW9kZSAqLwordm9pZCB1cGRhdGVfc3RhX2luZm8oc3RydWN0IGFkYXB0ZXIgKnBhZGFwdGVyLCBzdHJ1Y3Qgc3RhX2luZm8gKnBzdGEpCit7CisJc3RydWN0IG1sbWVfcHJpdiAqcG1sbWVwcml2ID0gJihwYWRhcHRlci0+bWxtZXByaXYpOworCXN0cnVjdCBtbG1lX2V4dF9wcml2CSpwbWxtZWV4dCA9ICZwYWRhcHRlci0+bWxtZWV4dHByaXY7CisJc3RydWN0IG1sbWVfZXh0X2luZm8JKnBtbG1laW5mbyA9ICYocG1sbWVleHQtPm1sbWV4dF9pbmZvKTsKKworCS8qIEVSUCAqLworCVZDU191cGRhdGUocGF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geworCQkvKiB1MTYqKSAocDJwaWUgKyBwMnBpZWxlbikgPSBjcHVfdG9fYmUxNihXUFNfQ09ORklHX01FVEhPRF9ESVNQTEFZKTsgKi8KKwkJUlRXX1BVVF9CRTE2KHAycGllICsgcDJwaWVsZW4sIFdQU19DT05GSUdfTUVUSE9EX0RJU1BMQVkpOworCX0KKworCXAycGllbGVuICs9IDI7CisKKwkvKglQcmltYXJ5IERldmljZSBUeXBlICovCisJLyoJQ2F0ZWdvcnkgSUQgKi8KKwkvKiB1MTYqKSAocDJwaWUgKyBwMnBpZWxlbikgPSBjcHVfdG9fYmUxNihXUFNfUERUX0NJRF9NVUxJVF9NRURJQSk7ICovCisJUlRXX1BVVF9CRTE2KHAycGllICsgcDJwaWVsZW4sIFdQU19QRFRfQ0lEX01VTElUX01FRElBKTsKKwlwMnBpZWxlbiArPSAyOworCisJLyoJT1VJICovCisJLyogdTMyKikgKHAycGllICsgcDJwaWVsZW4pID0gY3B1X3RvX2JlMzIoV1BTT1VJKTsgKi8KKwlSVFdfUFVUX0JFMzIocDJwaWUgKyBwMnBpZWxlbiwgV1BTT1VJKTsKKwlwMnBpZWxlbiArPSA0OworCisJLyoJU3ViIENhdGVnb3J5IElEICovCisJLyogdTE2KikgKHAycGllICsgcDJwaWVsZW4pID0gY3B1X3RvX2JlMTYoV1BTX1BEVF9TQ0lEX01FRElBX1NFUlZFUik7ICovCisJUlRXX1BVVF9CRTE2KHAycGllICsgcDJwaWVsZW4sIFdQU19QRFRfU0NJRF9NRURJQV9TRVJWRVIpOworCXAycGllbGVuICs9IDI7CisKKwkvKglOdW1iZXIgb2YgU2Vjb25kYXJ5IERldmljZSBUeXBlcyAqLworCXAycGllW3AycGllbGVuKytdID0gMHgwMDsJLyoJTm8gU2Vjb25kYXJ5IERldmljZSBUeXBlIExpc3QgKi8KKworCS8qCURldmljZSBOYW1lICovCisJLyoJVHlwZTogKi8KKwkvKiB1MTYqKSAocDJwaWUgKyBwMnBpZWxlbikgPSBjcHV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mcmFtZSBmYWlsISAodmVyIT0wKVxuIikpOworCQlyZXR2YWwgPSBfRkFJTDsKKwkJZ290byBleGl0OworCX0KKworCXR5cGUgPSAgR2V0RnJhbWVUeXBlKHB0cik7CisJc3VidHlwZSA9IEdldEZyYW1lU3ViVHlwZShwdHIpOyAvKiBiaXQoNyl+Yml0KDIpICovCisKKwlwYXR0cmliLT50b19mcl9kcyA9IGdldF90b2ZyX2RzKHB0cik7CisKKwlwYXR0cmliLT5mcmFnX251bSA9IEdldEZyYWdOdW0ocHRyKTsKKwlwYXR0cmliLT5zZXFfbnVtID0gR2V0U2VxdWVuY2UocHRyKTsKKworCXBhdHRyaWItPnB3X3NhdmUgPSBHZXRQd3JNZ3QocHRyKTsKKwlwYXR0cmliLT5tZnJhZyA9IEdldE1GcmFnKHB0cik7CisJcGF0dHJpYi0+bWRhdGEgPSBHZXRNRGF0YShwdHIpOworCXBhdHRyaWItPnByaXZhY3kgPSBHZXRQcml2YWN5KHB0cik7CisJcGF0dHJpYi0+b3JkZXIgPSBHZXRPcmRlcihwdHIpOworCisJLyogRHVtcCByeCBwYWNrZXRzICovCisJcnR3X2hhbF9nZXRfZGVmX3ZhcihhZGFwdGVyLCBIQUxfREVGX0RCR19EVU1QX1JYUEtULCAmKGJEdW1wUnhQa3QpKTsKKwlpZiAoYkR1bXBSeFBrdCA9PSAxKSB7LyogZHVtcCBhbGwgcnggcGFja2V0cyAqLworCQlpbnQgaTsKKwkJREJHXzg4RSgiIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyNcbiIpOworCisJCWZvciAoaSA9IDA7IGkgPCA2NDsgaSA9IGkrOCkKKwkJCURCR184OEUoIiUwMlg6JTAyWDolMDJYOiUwMlg6JTAyWDolMDJYOiUwMlg6JTAyWDpcbiIsICoocHRyK2kpLAorCQkJCSoocHRyK2krMSksICoocHRyK2krMiksICoocHRyK2krMyksICoocHRyK2krNCksICoocHRyK2krNSksICoocHRyK2krNiksICoocHRyK2krNykpOworCQ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2l2ZW4gVEEsIFRLLCBJVjMyCisqCisqIElucHV0czoKKyogICAgIHRrW10gICAgICA9IHRlbXBvcmFsIGtleQkJCSBbMTI4IGJpdHNdCisqICAgICB0YVtdICAgICAgPSB0cmFuc21pdHRlcidzIE1BQyBhZGRyZXNzCSAgICBbIDQ4IGJpdHNdCisqICAgICBpdjMyICAgICAgPSB1cHBlciAzMiBiaXRzIG9mIElWCQkgIFsgMzIgYml0c10KKyogT3V0cHV0OgorKiAgICAgcDFrW10gICAgID0gUGhhc2UgMSBrZXkJCQkgIFsgODAgYml0c10KKyoKKyogTm90ZToKKyogICAgIFRoaXMgZnVuY3Rpb24gb25seSBuZWVkcyB0byBiZSBjYWxsZWQgZXZlcnkgMioqMTYgcGFja2V0cywKKyogICAgIGFsdGhvdWdoIGluIHRoZW9yeSBpdCBjb3VsZCBiZSBjYWxsZWQgZXZlcnkgcGFja2V0LgorKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKi8KK3N0YXRpYyB2b2lkIHBoYXNlMSh1MTYgKnAxaywgY29uc3QgdTggKnRrLCBjb25zdCB1OCAqdGEsIHUzMiBpdjMyKQoreworCWludCAgaTsKK19mdW5jX2VudGVyXzsKKwkvKiBJbml0aWFsaXplIHRoZSA4MCBiaXRzIG9mIFAxS1tdIGZyb20gSVYzMiBhbmQgVEFbMC4uNV0gICAgICovCisJcDFrWzBdICAgICAgPSBMbzE2KGl2MzIpOworCXAxa1sxXSAgICAgID0gSGkxNihpdjMyKTsKKwlwMWtbMl0gICAgICA9IE1rMTYodGFbMV0sIHRhWzBdKTsgLyogdXNlIFRBW10gYXMgbGl0dGxlLWVuZGlhbiAqLworCXAxa1szXSAgICAgID0gTWsxNih0YVszXSwgdGFbMl0pOworCXAxa1s0XSAgICAgID0gTWsxNih0YVs1XSwgdGFbNF0pOworCisJLyogTm93IGNvbXB1dGUgYW4gdW5iYWxhbmNlZCBGZWlzdGVsIGNpcGhlciB3aXRoIDgwLWJpdCBibG9jayAqLworCS8qIHNpemUgb24gdGhlIDgwLWJpdCBibG9jayBQMUtbXSwgdXNpbmcgdGhlIDEyOC1iaXQga2V5IFRLW10gKi8KKwlmb3IgKGkgPSAwOyBpIDwgUEhBU0UxX0xPT1BfQ05UOyBpKyspIHsgLyogRWFjaCBhZGQgb3BlcmF0aW9uIGhlcmUgaXMgbW9kIDIqKjE2ICovCisJCXAxa1swXSArPSBfU18ocDFrWzRdIF4gVEsxNigoaSYxKSswKSk7CisJCXAxa1sxXSArPSBfU18ocDFrWzBdIF4gVEsxNigoaSYxKSsyKSk7CisJCXAxa1syXSArPSBfU18ocDFrWzFdIF4gVEsxNigoaSYxKSs0KSk7CisJCXAxa1szXSArPSBfU18ocDFrWzJdIF4gVEsxNigoaSYxKSs2KSk7CisJCXAxa1s0XSArPSBfU18ocDFrWzNdIF4gVEsxNigoaSYxKSswKSk7CisJCXAxa1s0XSArPSAgKHVuc2lnbmVkIHNob3J0KWk7ICAgLyogYXZvaWQgInNsaWRlIGF0dGFja3MiICovCisJfQorX2Z1bmNfZXhpdF87Cit9CisKKy8qCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqIFJvdXRpbmU6IFBoYXNlIDIgLS0gZ2VuZXJhdGUgUkM0S0VZLCBnaXZlbiBUSywgUDFLLCBJVjE2CisqCisqIElucHV0czoKKyogICAgIHRrW10gICAgICA9IFRlbXBvcmFsIGtleQkJCSBbMTI4IGJpdHNdCisqICAgICBwMWtbXSAgICAgPSBQaGFzZSAxIG91dHB1dCBrZXkJCSAgIFsgODAgYml0c10KKyogICAgIGl2MTYgICAgICA9IGxvdyAxNiBiaXRzIG9mIElWIGNvdW50ZXIJICAgIFsgMTYgYml0c10KKyogT3V0cHV0OgorKiAgICAgcmM0a2V5W10gID0gdGhlIGtleSB1c2VkIHRvIGVuY3J5cHQgdGhlIHB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eIGJbaV07CitfZnVuY19leGl0XzsKK30KKworc3RhdGljIHZvaWQgeG9yXzMyKHU4ICphLCB1OCAqYiwgdTggKm91dCkKK3sKKwlpbnQgaTsKK19mdW5jX2VudGVyXzsKKwlmb3IgKGkgPSAwOyBpIDwgNDsgaSsrKQorCQlvdXRbaV0gPSBhW2ldIF4gYltpXTsKK19mdW5jX2V4aXRfOworfQorCitzdGF0aWMgdTggc2JveCh1OCBhKQoreworCXJldHVybiBzYm94X3RhYmxlWyhpbnQpYV07Cit9CisKK3N0YXRpYyB2b2lkIG5leHRfa2V5KHU4ICprZXksIGludCByb3VuZCkKK3sKKwl1OCByY29uOworCXU4IHNib3hfa2V5WzRdOworCXU4IHJjb25fdGFibGVbMTJdID0geworCQkweDAxLCAweDAyLCAweDA0LCAweDA4LCAweDEwLCAweDIwLCAweDQwLCAweDgwLAorCQkweDFiLCAweDM2LCAweDM2LCAweDM2CisJfTsKK19mdW5jX2VudGVyXzsKKwlzYm94X2tleVswXSA9IHNib3goa2V5WzEzXSk7CisJc2JveF9rZXlbMV0gPSBzYm94KGtleVsxNF0pOworCXNib3hfa2V5WzJdID0gc2JveChrZXlbMTVdKTsKKwlzYm94X2tleVszXSA9IHNib3goa2V5WzEyXSk7CisKKwlyY29uID0gcmNvbl90YWJsZVtyb3VuZF07CisKKwl4b3JfMzIoJmtleVswXSwgc2JveF9rZXksICZrZXlbMF0pOworCWtleVswXSA9IGtleVswXSBeIHJjb247CisKKwl4b3JfMzIoJmtleVs0XSwgJmtleVswXSwgJmtleVs0XSk7CisJeG9yXzMyKCZrZXlbOF0sICZrZXlbNF0sICZrZXlbOF0pOworCXhvcl8zMigma2V5WzEyXSwgJmtleVs4XSwgJmtleVsxMl0pOworX2Z1bmNfZXhpdF87Cit9CisKK3N0YXRpYyB2b2lkIGJ5dGVfc3ViKHU4ICppbiwgdTggKm91dCkKK3sKKwlpbnQgaTsKK19mdW5jX2VudGVyXzsKKwlmb3IgKGkgPSAwOyBpIDwgMTY7IGkrKykKKwkJb3V0W2ldID0gc2JveChpbltpXSk7CitfZnVuY19leGl0XzsKK30KKworc3RhdGljIHZvaWQgc2hpZnRfcm93KHU4ICppbiwgdTggKm91dCkKK3sKK19mdW5jX2VudGVyXzsKKwlvdXRbMF0gPSAgaW5bMF07CisJb3V0WzFdID0gIGluWzVdOworCW91dFsyXSA9ICBpblsxMF07CisJb3V0WzNdID0gIGluWzE1XTsKKwlvdXRbNF0gPSAgaW5bNF07CisJb3V0WzVdID0gIGluWzldOworCW91dFs2XSA9ICBpblsxNF07CisJb3V0WzddID0gIGluWzNdOworCW91dFs4XSA9ICBpbls4XTsKKwlvdXRbOV0gPSAgaW5bMTNdOworCW91dFsxMF0gPSBpblsyXTsKKwlvdXRbMTFdID0gaW5bN107CisJb3V0WzEyXSA9IGluWzEyXTsKKwlvdXRbMTNdID0gaW5bMV07CisJb3V0WzE0XSA9IGluWzZdOworCW91dFsxNV0gPSBpblsxMV07CitfZnVuY19leGl0XzsKK30KKworc3RhdGljIHZvaWQgbWl4X2NvbHVtbih1OCAqaW4sIHU4ICpvdXQpCit7CisJaW50IGk7CisJdTggYWRkMWJbNF07CisJdTggYWRkMWJmN1s0XTsKKwl1OCByb3RsWzRdOworCXU4IHN3YXBfaGFsZnNbNF07CisJdTggYW5kZjdbNF07CisJdTggcm90cls0XTsKKwl1OCB0ZW1wWzRdOworCXU4IHRlbXBiWzRdOworX2Z1bmNfZW50ZXJfOworCWZvciAoaSA9IDAgOyBpIDwgNDsgaSsrKSB7CisJCWlmICgoaW5baV0gJiAweDgwKSA9PSAweDgwKQorCQkJYWRkMWJbaV0gPSAweDFiOworCQllbHNlCisJCQlhZGQxYltpXSA9IDB4MDA7CisJfQorCisJc3dhcF9oYWxmc1swXSA9IGluWzJdOyAgICAvKiBTd2FwIGhhbGZzICovCisJc3dhcF9oYWxmc1sxXSA9IGluWzNdOworCXN3YXBfaGFsZnNbMl0gPSBpblswXTsKKwlzd2FwX2hhbGZzWzNdID0gaW5bM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wkJCW5leHRfa2V5KHJvdW5kX2tleSwgcm91bmQpOworCQl9CisJfQorX2Z1bmNfZXhpdF87Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBjb25zdHJ1Y3RfbWljX2l2KCkJCQkgICAqLworLyogQnVpbGRzIHRoZSBNSUMgSVYgZnJvbSBoZWFkZXIgZmllbGRzIGFuZCBQTiAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgdm9pZCBjb25zdHJ1Y3RfbWljX2l2KHU4ICptaWNfaXYsIGludCBxY19leGlzdHMsIGludCBhNF9leGlzdHMsIHU4ICptcGR1LAorCQkJICAgICB1aW50IHBheWxvYWRfbGVuZ3RoLCB1OCAqcG5fdmVjdG9yKQoreworCWludCBpOworX2Z1bmNfZW50ZXJfOworCW1pY19pdlswXSA9IDB4NTk7CisJaWYgKHFjX2V4aXN0cyAmJiBhNF9leGlzdHMpCisJCW1pY19pdlsxXSA9IG1wZHVbMzBdICYgMHgwZjsgICAgLyogUW9TX1RDCSAgICovCisJaWYgKHFjX2V4aXN0cyAmJiAhYTRfZXhpc3RzKQorCQltaWNfaXZbMV0gPSBtcGR1WzI0XSAmIDB4MGY7CS8qIG11dGUgYml0cyA3LTQgICAgKi8KKwlpZiAoIXFjX2V4aXN0cykKKwkJbWljX2l2WzFdID0gMHgwMDsKKwlmb3IgKGkgPSAyOyBpIDwgODsgaSsrKQorCQltaWNfaXZbaV0gPSBtcGR1W2kgKyA4XTsJLyogbWljX2l2WzI6N10gPSBBMlswOjVdID0gbXBkdVsxMDoxNV0gKi8KKwlmb3IgKGkgPSA4OyBpIDwgMTQ7IGkrKykKKwkJbWljX2l2W2ldID0gcG5fdmVjdG9yWzEzIC0gaV07CS8qIG1pY19pdls4OjEzXSA9IFBOWzU6MF0gKi8KKwltaWNfaXZbMTRdID0gKHVuc2lnbmVkIGNoYXIpIChwY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kZXIxWzldID0gbXBkdVs5XTsKKwltaWNfaGVhZGVyMVsxMF0gPSBtcGR1WzEwXTsgICAgIC8qIEEyICovCisJbWljX2hlYWRlcjFbMTFdID0gbXBkdVsxMV07CisJbWljX2hlYWRlcjFbMTJdID0gbXBkdVsxMl07CisJbWljX2hlYWRlcjFbMTNdID0gbXBkdVsxM107CisJbWljX2hlYWRlcjFbMTRdID0gbXBkdVsxNF07CisJbWljX2hlYWRlcjFbMTVdID0gbXBkdVsxNV07CitfZnVuY19leGl0XzsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qIGNvbnN0cnVjdF9taWNfaGVhZGVyMigpCQkgICAgICAqLworLyogQnVpbGRzIHRoZSBsYXN0IE1JQyBoZWFkZXIgYmxvY2sgZnJvbQkqLworLyogaGVhZGVyIGZpZWxkcy4JCQkgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgdm9pZCBjb25zdHJ1Y3RfbWljX2hlYWRlcjIodTggKm1pY19oZWFkZXIyLCB1OCAqbXBkdSwgaW50IGE0X2V4aXN0cywgaW50IHFjX2V4aXN0cykKK3sKKwlpbnQgaTsKK19mdW5jX2VudGVyXzsKKwlmb3IgKGkgPSAwOyBpIDwgMTY7IGkrKykKKwkJbWljX2hlYWRlcjJbaV0gPSAweDAwOworCisJbWljX2hlYWRlcjJbMF0gPSBtcGR1WzE2XTsgICAgLyogQTMgKi8KKwltaWNfaGVhZGVyMlsxXSA9IG1wZHVbMTddOworCW1pY19oZWFkZXIyWzJdID0gbXBkdVsxOF07CisJbWljX2hlYWRlcjJbM10gPSBtcGR1WzE5XTsKKwltaWNfaGVhZGVyMls0XSA9IG1wZHVbMjBdOworCW1pY19oZWFkZXIyWzVdID0gbXBkdVsyMV07CisKKwltaWNfaGVhZGVyMls2XSA9IDB4MDA7CisJbWljX2hlYWRlcjJbN10gPSAweDAwOyAvKiBtcGR1WzIzXTsgKi8KKworCWlmICghcWNfZXhpc3RzICYmIGE0X2V4aXN0cykgeworCQlmb3IgKGkgPSAwOyBpIDwgNjsgaSsrKQorCQkJbWljX2hlYWRlcjJbOCtpXSA9IG1wZHVbMjQraV07ICAgLyogQTQgKi8KKwl9CisKKwlpZiAocWNfZXhpc3RzICYmICFhNF9leGlzdHMpIHsKKwkJbWljX2hlYWRlcjJbOF0gPSBtcGR1WzI0XSAmIDB4MGY7IC8qIG11dGUgYml0cyAxNSAtIDQgKi8KKwkJbWljX2hlYWRlcjJbOV0gPSBtcGR1WzI1XSAmIDB4MDA7CisJfQorCisJaWYgKHFjX2V4aXN0cyAmJiBhNF9leGlzdHMpIHsKKwkJZm9yIChpID0gMDsgaSA8IDY7IGkrKykKKwkJCW1pY19oZWFkZXIyWzgraV0gPSBtcGR1WzI0K2ldOyAgIC8qIEE0ICovCisKKwkJbWljX2hlYWRlcjJbMTRdID0gbXBkdVszMF0gJiAweDBmOworCQltaWNfaGVhZGVyMlsxNV0gPSBtcGR1WzMxXSAmIDB4MDA7CisJfQorCitfZnVuY19leGl0XzsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qIGNvbnN0cnVjdF9taWNfaGVhZGVyMigpCQkgICAgICAqLworLyogQnVpbGRzIHRoZSBsYXN0IE1JQyBoZWFkZXIgYmxvY2sgZnJvbQkqLworLyogaGVhZGVyIGZpZWxkcy4JCQkgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgdm9pZCBjb25zdHJ1Y3RfY3RyX3ByZWxvYWQodTggKmN0cl9wcmVsb2FkLCBpbnQgYTRfZXhpc3RzLCBpbnQgcWNfZXhpc3RzLCB1OCAqbXBkdSwgdTggKnBuX3ZlY3RvciwgaW50IGMpCit7CisJaW50IGk7CitfZnVuY19lbnRlcl87CisJZm9yIChpID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sID0gSUVFRTgwMjExX09GRE1fUkFURV82TUI7CisJCWJyZWFrOworCWNhc2UgNToKKwkJdmFsID0gSUVFRTgwMjExX09GRE1fUkFURV85TUI7CisJCWJyZWFrOworCWNhc2UgNjoKKwkJdmFsID0gSUVFRTgwMjExX09GRE1fUkFURV8xMk1COworCQlicmVhazsKKwljYXNlIDc6CisJCXZhbCA9IElFRUU4MDIxMV9PRkRNX1JBVEVfMThNQjsKKwkJYnJlYWs7CisJY2FzZSA4OgorCQl2YWwgPSBJRUVFODAyMTFfT0ZETV9SQVRFXzI0TUI7CisJCWJyZWFrOworCWNhc2UgOToKKwkJdmFsID0gSUVFRTgwMjExX09GRE1fUkFURV8zNk1COworCQlicmVhazsKKwljYXNlIDEwOgorCQl2YWwgPSBJRUVFODAyMTFfT0ZETV9SQVRFXzQ4TUI7CisJCWJyZWFrOworCWNhc2UgMTE6CisJCXZhbCA9IElFRUU4MDIxMV9PRkRNX1JBVEVfNTRNQjsKKwkJYnJlYWs7CisJfQorCXJldHVybiB2YWw7Cit9CisKK3N0YXRpYyBpbnQgaXNfYmFzaWNyYXRlKHN0cnVjdCBhZGFwdGVyICpwYWRhcHRlciwgdW5zaWduZWQgY2hhciByYXRlKQoreworCWludCBpOworCXVuc2lnbmVkIGNoYXIgdmFsOworCXN0cnVjdCBtbG1lX2V4dF9wcml2ICpwbWxtZWV4dCA9ICZwYWRhcHRlci0+bWxtZWV4dHByaXY7CisKKwlmb3IgKGkgPSAwOyBpIDwgTnVtUmF0ZXM7IGkrKykgeworCQl2YWwgPSBwbWxtZWV4dC0+YmFzaWNyYXRlW2ldOworCisJCWlmICgodmFsICE9IDB4ZmYpICYmICh2YWwgIT0gMHhmZSkpIHsKKwkJCWlmIChyYXRlID09IHJhdGV0YmxfdmFsXzJ3aWZpcmF0ZSh2YWwpKQorCQkJCXJldHVybiB0cnVlOworCQl9CisJfQorCXJldHVybiBmYWxzZTsKK30KKworc3RhdGljIHVuc2lnbmVkIGludCByYXRldGJsMn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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI2luY2x1ZGUgIm9kbV9wcmVjb21wLmgiCisKKyNpbmNsdWRlIDxydHdfaW9sLmg+CisKKyNkZWZpbmUgcmVhZF9uZXh0X3BhaXIoYXJyYXksIHYxLCB2MiwgaSkJCVwKKwkgZG8gewkJCQkJCVwKKwkJIGkgKz0gMjsJCQkJXAorCQkgdjEgPSBhcnJheVtpXTsJCQkJXAorCQkgdjIgPSBhcnJheVtpKzFdOwkJCVwKKwkgfSB3aGlsZSAoMCkKKworc3RhdGljIGJvb2wgQ2hlY2tDb25kaXRpb24oY29uc3QgdTMyICBjb25kaXRpb24sIGNvbnN0IHUzMiAgaGV4KQoreworCXUzMiBfYm9hcmQgICAgID0gKGhleCAmIDB4MDAwMDAwRkYpOworCXUzMiBfaW50ZXJmYWNlID0gKGhleCAmIDB4MDAwMEZGMDApID4+IDg7CisJdTMyIF9wbGF0Zm9ybSAgPSAoaGV4ICYgMHgwMEZGMDAwMCkgPj4gMTY7CisJdTMyIGNvbmQgPSBjb25kaXRpb247CisKKwlpZiAoY29uZGl0aW9uID09IDB4Q0RDRENEQ0QpCisJCXJldHVybiB0cnVlOworCisJY29uZCA9IGNvbmRpdGlvbiAmIDB4MDAwMDAwRkY7CisJaWYgKChfYm9hcmQgPT0gY29uZCkgJiYgY29uZCAhPSAweDAwKQorCQlyZXR1cm4gZmFsc2U7CisKKwljb25kID0gY29uZGl0aW9uICYgMHgwMDAwRkYwMDsKKwljb25kID0gY29uZCA+PiA4OworCWlmICgoX2ludGVyZmFjZSAmIGNvbmQpID09IDAgJiYgY29uZCAhPSAweDA3KQorCQlyZXR1cm4gZmFsc2U7CisKKwljb25kID0gY29uZGl0aW9uICYgMHgwMEZGMDAwMDsKKwljb25kID0gY29uZCA+PiAxNjsKKwlpZiAoKF9wbGF0Zm9ybSAmIGNvbmQpID09IDAgJiYgY29uZCAhPSAwe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mICgoX2JvYXJkID09IGNvbmQpICYmIGNvbmQgIT0gMHgwMCkKKwkJcmV0dXJuIGZhbHNlOworCisJY29uZCA9IGNvbmRpdGlvbiAmIDB4MDAwMEZGMDA7CisJY29uZCA9IGNvbmQgPj4gODsKKwlpZiAoKF9pbnRlcmZhY2UgJiBjb25kKSA9PSAwICYmIGNvbmQgIT0gMHgwNykKKwkJcmV0dXJuIGZhbHNlOworCisJY29uZCA9IGNvbmRpdGlvbiAmIDB4MDBGRjAwMDA7CisJY29uZCA9IGNvbmQgPj4gMTY7CisJaWYgKChfcGxhdGZvcm0gJiBjb25kKSA9PSAwICYmIGNvbmQgIT0gMHgwRikKKwkJcmV0dXJuIGZhbHNlOworCXJldHVybiB0cnVlOworfQorCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyogICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfUkVHLlRYVAorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgdTMyIGFycmF5X01BQ19SRUdfODE4OEVbXSA9IHsKKwkJMHgwMjYsIDB4MDAwMDAwNDEsCisJCTB4MDI3LCAweDAwMDAwMDM1LAorCQkweDQyOCwgMHgwMDAwMDAwQSwKKwkJMHg0MjksIDB4MDAwMDAwMTAsCisJCTB4NDMwLCAweDAwMDAwMDAwLAorCQkweDQzMSwgMHgwMDAwMDAwMSwKKwkJMHg0MzIsIDB4MDAwMDAwMDIsCisJCTB4NDMzLCAweDAwMDAwMDA0LAorCQkweDQzNCwgMHgwMDAwMDAwNSwKKwkJMHg0MzUsIDB4MDAwMDAwMDYsCisJCTB4NDM2LCAweDAwMDAwMDA3LAorCQkweDQzNywgMHgwMDAwMDAwOCwKKwkJMHg0MzgsIDB4MDAwMDAwMDAsCisJCTB4NDM5LCAweDAwM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Y29uZCkgJiYgY29uZCAhPSAweDAwKQorCQlyZXR1cm4gZmFsc2U7CisKKwljb25kID0gQ29uZGl0aW9uICYgMHgwMDAwRkYwMDsKKwljb25kID0gY29uZCA+PiA4OworCWlmICgoX2ludGVyZmFjZSAmIGNvbmQpID09IDAgJiYgY29uZCAhPSAweDA3KQorCQlyZXR1cm4gZmFsc2U7CisKKwljb25kID0gQ29uZGl0aW9uICYgMHgwMEZGMDAwMDsKKwljb25kID0gY29uZCA+PiAxNjsKKwlpZiAoKF9wbGF0Zm9ybSAmIGNvbmQpID09IDAgJiYgY29uZCAhPSAweDBGKQorCQlyZXR1cm4gZmFsc2U7CisJcmV0dXJuIHRydWU7Cit9CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgIFJhZGlvQV8xVC5UWFQKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworc3RhdGljIHUzMiBBcnJheV9SYWRpb0FfMVRfODE4OEVbXSA9IHsKKwkJMHgwMDAsIDB4MDAwMzAwMDAsCisJCTB4MDA4LCAweDAwMDg0MDAwLAorCQkweDAxOCwgMHgwMDAwMDQwNywKKwkJMHgwMTksIDB4MDAwMDAwMTIsCisJCTB4MDFFLCAweDAwMDgwMDA5LAorCQkweDAxRiwgMHgwMDAwMDg4MCwKKwkJMHgwMkYsIDB4MDAwMUEwNjAsCisJCTB4MDNGLCAweDAwMDAwMDAwLAorCQkweDA0MiwgMHgwMDAwNjBDMCwKKwkJMHgwNTcsIDB4MDAwRDAwMDAsCisJCTB4MDU4LCAweDAwMEJFMTgwLAorCQkweDA2NywgMHgwMDAwMTU1MiwKKwkJMHgwODMsIDB4MDAwMDAwMDAsCisJCTB4MEIwLCAweDAwMEZGOEZDLAorCQkweDBC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ioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisgI2luY2x1ZGUgIm9kbV9wcmVjb21wLmgiCisKKy8qIDM9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KKy8qIDMgSVEgQ2FsaWJyYXRpb24gKi8KKy8qIDM9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KKwordm9pZCBPRE1fUmVzZXRJUUtSZXN1bHQoc3RydWN0IG9kbV9kbV9zdHJ1Y3QgKnBETV9PZG0pCit7Cit9CisKK3U4IE9ETV9HZXRSaWdodENobmxQbGFjZWZvcklRSyh1OCBjaG5sKQoreworCXU4CWNoYW5uZWxfYWxsW09ETV9UQVJHRVRfQ0hOTF9OVU1fMkdfNUddID0geworCQkxLCAyLCAzLCA0LCA1LCA2LCA3LCA4LCA5LCAxMCwgMTEsIDEyLCAxMywgMTQsCisJCTM2LCAzOCwgNDAsIDQyLCA0NCwgNDYsIDQ4LCA1MCwgNTIsIDU0LCA1NiwgNTgsIDYwLCA2MiwgNjQsCisJCTEwMCwgMTAyLCAxMDQsIDEwNiwgMTA4LCAxMTAsIDExMiwgMTE0LCAxMTYsIDExOCwgMTIwLCAxMjIsCisJCTEyNCwgMTI2LCAxMjgsIDEzMCwgMTMyLCAxMzQsIDEzNiwgMTM4LCAxNDAsIDE0OSwgMTUxLCAxNTMsCisJCTE1NSwgMTU3LCAxNTksIDE2MSwgMTYzLCAxNjUKKwl9OworCXU4CXBsYWNlID0gY2hubDsKKworCWlmIChjaG5sID4gMTQpIHsKKwkJZm9yIChwbGFjZSA9IDE0OyBwbGFjZSA8IHNpemVvZihjaGFubmVsX2FsbCk7IHBsYWNlKyspIHsKKwkJCWlmIChjaGFubmVsX2FsbFtwbGFjZV0gPT0gY2hubCkKKwkJCQlyZXR1cm4gcGxhY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BTZWUgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGZvcgorICogbW9yZSBkZXRhaWxzLgorICoKKyAqIFlvdSBzaG91bGQgaGF2ZSByZWNlaXZlZCBhIGNvcHkgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGFsb25nIHdpdGgKKyAqIHRoaXMgcHJvZ3JhbTsgaWYgbm90LCB3cml0ZSB0byB0aGUgRnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uLCBJbmMuLAorICogNTEgRnJhbmtsaW4gU3RyZWV0LCBGaWZ0aCBGbG9vciwgQm9zdG9uLCBNQSAwMjExMCwgVVNBCisgKgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNpbmNsdWRlICJvZG1fcHJlY29tcC5oIgorCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLURlZmluZSBMb2NhbCBDb25zdGFudC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisvKiAgMjAxMC8wNC8yNSBNSCBEZWZpbmUgdGhlIG1heCB0eCBwb3dlciB0cmFja2luZyB0eCBhZ2MgcG93ZXIuICovCisjZGVmaW5lCQlPRE1fVFhQV1JUUkFDS19NQVhfSURYXzg4RQkJNgorCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLURlZmluZSBMb2NhbCBDb25zdGFudC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisKKy8qIDM9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KKy8qIDMgVHggUG93ZXIgVHJhY2tpbmcgKi8KKy8qIDM9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KKy8qLS0tLS0tLS0tLS0t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HgwNSwgMHgwMywgMHgwMSwgMHgwMX0sIC8qICAzMSwgLTE1LjVkQiAqLworCXsweDA5LCAweDA4LCAweDA3LCAweDA2LCAweDA0LCAweDAzLCAweDAxLCAweDAxfQkvKiAgMzIsIC0xNi4wZEIgKi8KK307CisKK3U4IENDS1N3aW5nVGFibGVfQ2gxNFtDQ0tfVEFCTEVfU0laRV1bOF0gPSB7CisJezB4MzYsIDB4MzUsIDB4MmUsIDB4MWIsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9LCAvKiAgMCwgKzBkQiAqLworCXsweDMzLCAweDMyLCAweDJiLCAweDE5LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgLyogIDEsIC0wLjVkQiAqLworCXsweDMwLCAweDJmLCAweDI5LCAweDE4LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgLyogIDIsIC0xLjBkQiAqLworCXsweDJkLCAweDJkLCAweDE3LCAweDE3LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgLyogIDMsIC0xLjVkQiAqLworCXsweDJiLCAweDJhLCAweDI1LCAweDE1LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgLyogIDQsIC0yLjBkQiAqLworCXsweDI4LCAweDI4LCAweDI0LCAweDE0LCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgLyogIDUsIC0yLjVkQiAqLworCXsweDI2LCAweDI1LCAweDIxLCAweDEzLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgLyogIDYsIC0zLjBkQiAqLworCXsweDI0LCAweDIzLCAweDFmLCAweDEyLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgLyogIDcsIC0zLjVkQiAqLworCXsweDIyLCAweDIxLCAweDFkLCAweDExLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgLyogIDgsIC00LjBkQiAqLworCXsweDIwLCAweDIwLCAweDFiLCAweDEwLCAweDAwLCAweDAwLCAweDAwLCAweDAwfSwgLyogIDksIC00LjVkQiAqLworCXsweDFmL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+UmVnQzcwKTsKKwkJCU9ETV9TZXRCQlJlZyhwRE1fT2RtLCAweDg1YywgMHhGRjAwMDAwMCwgcERNX1BTVGFibGUtPlJlZzg1Qyk7CisJCQlPRE1fU2V0QkJSZWcocERNX09kbSwgMHhhNzQsIDB4RjAwMCwgcERNX1BTVGFibGUtPlJlZ0E3NCk7CisJCQlPRE1fU2V0QkJSZWcocERNX09kbSwgMHg4MTgsIEJJVDI4LCAweDApOworCisJCQlpZiAocERNX09kbS0+U3VwcG9ydElDVHlwZSA9PSBPRE1fUlRMODcyM0EpCisJCQkJT0RNX1NldEJCUmVnKHBETV9PZG0sIDB4ODc0LCBCSVQ1LCAweDApOyAvKiBSZWc4NzRbNV09MWInMCAqLworCQl9CisJCXBETV9QU1RhYmxlLT5QcmVSRlN0YXRlID0gcERNX1BTVGFibGUtPkN1clJGU3RhdGU7CisJfQorfQorCisvKiAzPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCisvKiAzIFJBVFIgTUFTSyAqLworLyogMz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworLyogMz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworLyogMyBSYXRlIEFkYXB0aXZlICovCisvKiAzPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCisKK3ZvaWQgb2RtX1JhdGVBZGFwdGl2ZU1hc2tJbml0KHN0cnVjdCBvZG1fZG1fc3RydWN0ICpwRE1fT2RtKQoreworCXN0cnVjdCBvZG1fcmF0ZV9hZGFwdCAqcE9kbVJBID0gJnBETV9PZG0tPlJhdGVBZGFwdGl2ZTsKKworCXBPZG1SQS0+VHlwZSA9IERNX1R5cGVfQnlEcml2ZXI7CisJaWYgKHBPZG1SQS0+VHlwZSA9PSBETV9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2Vuc2UgZm9yCisgKiBtb3JlIGRldGFpbHMuCisgKgorICogWW91IHNob3VsZCBoYXZlIHJlY2VpdmVkIGEgY29weSBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgYWxvbmcgd2l0aAorICogdGhpcyBwcm9ncmFtOyBpZiBub3QsIHdyaXRlIHRvIHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb24sIEluYy4sCisgKiA1MSBGcmFua2xpbiBTdHJlZXQsIEZpZnRoIEZsb29yLCBCb3N0b24sIE1BIDAyMTEwLCBVU0EKKyAqCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyogIGluY2x1ZGUgZmlsZXMgKi8KKworI2luY2x1ZGUgIm9kbV9wcmVjb21wLmgiCisKKyNkZWZpbmUgUkVBRF9BTkRfQ09ORklHICAgICBSRUFEX0FORF9DT05GSUdfTVAKKworI2RlZmluZSBSRUFEX0FORF9DT05GSUdfTVAoaWMsIHR4dCkgKE9ETV9SZWFkQW5kQ29uZmlnIyN0eHQjI2ljKGRtX29kbSkpCisjZGVmaW5lIFJFQURfQU5EX0NPTkZJR19UQyhpYywgdHh0KSAoT0RNX1JlYWRBbmRDb25maWdfVEMjI3R4dCMjaWMoZG1fb2RtKSkKKworc3RhdGljIHU4IG9kbV9RdWVyeVJ4UHdyUGVyY2VudGFnZShzOCBBbnRQb3dlcikKK3sKKwlpZiAoKEFudFBvd2VyIDw9IC0xMDApIHx8IChBbnRQb3dlciA+PSAyMCkpCisJCXJldHVybgkwOworCWVsc2UgaWYgKEFudFBvd2VyID49IDApCisJCXJldHVybgkxMDA7CisJZWxzZQorCQlyZXR1cm4gMTAwK0FudFBvd2VyOworfQorCisvKiAgMjAxMi8wMS8xMiBNSCBNT3ZlIHNvbWUgc2lnbmFsIHN0cmVuZ3RoIHNtb290aCBtZXRob2QgdG8gTVAgSEFM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GlvbiwgSW5jLiwKKyAqIDUxIEZyYW5rbGluIFN0cmVldCwgRmlmdGggRmxvb3IsIEJvc3RvbiwgTUEgMDIxMTAsIFVTQQorICoKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqCisgKiBNb2R1bGU6CXJ0bDgxOTJjX3JmNjA1Mi5jCSggU291cmNlIEMgRmlsZSkKKyAqCisgKiBOb3RlOglQcm92aWRlIFJGIDYwNTIgc2VyaWVzIHJlbGF0aXZlIEFQSS4KKyAqCisgKiBGdW5jdGlvbjoKKyAqCisgKiBFeHBvcnQ6CisgKgorICogQWJicmV2OgorICoKKyAqIEhpc3Rvcnk6CisgKiBEYXRhCQkJV2hvCQlSZW1hcmsKKyAqCisgKiAwOS8yNS8yMDA4CU1IQwkJQ3JlYXRlIGluaXRpYWwgdmVyc2lvbi4KKyAqIDExLzA1LzIwMDgJTUhDCQlBZGQgQVBJIGZvciB0dyBwb3dlciBzZXR0aW5nLgorICoKKyAqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNkZWZpbmUgX1JUTDgxODhFX1JGNjA1Ml9DXworCisjaW5jbHVkZSA8b3NkZXBfc2VydmljZS5oPgorI2luY2x1ZGUgPGRydl90eXBlcy5oPgorCisjaW5jbHVkZSA8cnRsODE4OGVfaGFsLmg+CisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tRGVmaW5lIExvY2FsIENvbnN0YW50LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKy8qICBEZWZpbmUgbG9jYWwgc3RydWN0dXJlIGZvciBkZWJ1ZyEhIS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fSU1HX0gKKworLyogc3RhdGljIGJvb2wgQ2hlY2tDb25kaXRpb24oY29uc3QgdTMyIENvbmRpdGlvbiwgY29uc3QgdTMyIEhleCk7ICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyogICAgICAgICAgICAgICAgICAgICAgICAgICBBR0NfVEFCXzFULlRYVAorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitlbnVtIEhBTF9TVEFUVVMgT0RNX1JlYWRBbmRDb25maWdfQUdDX1RBQl8xVF84MTg4RShzdHJ1Y3Qgb2RtX2RtX3N0cnVjdCAqb2RtKTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgIFBIWV9SRUdfMVQuVFhUCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK2VudW0gSEFMX1NUQVRVUyBPRE1fUmVhZEFuZENvbmZpZ19QSFlfUkVHXzFUXzgxODhFKHN0cnVjdCBvZG1fZG1fc3RydWN0ICpvZG0pOworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqICAgICAgICAgICAgICAgICAgICAgICAgICAgUEhZX1JFR19QRy5UWFQKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordm9pZCBPRE1fUmVhZEFuZENvbmZpZ19QSFlfUkVHX1BHXzgxODhFKHN0cnVjdCBvZG1fZG1fc3RydWN0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SVElDVUxBUiBQVVJQT1NFLiBTZWUgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGZvcgorKiBtb3JlIGRldGFpbHMuCisqCisqIFlvdSBzaG91bGQgaGF2ZSByZWNlaXZlZCBhIGNvcHkgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGFsb25nIHdpdGgKKyogdGhpcyBwcm9ncmFtOyBpZiBub3QsIHdyaXRlIHRvIHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb24sIEluYy4sCisqIDUxIEZyYW5rbGluIFN0cmVldCwgRmlmdGggRmxvb3IsIEJvc3RvbiwgTUEgMDIxMTAsIFVTQQorKgorKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjaWZuZGVmIF9fSU5DX0ZXXzgxODhFX0hXX0lNR19ICisjZGVmaW5lIF9fSU5DX0ZXXzgxODhFX0hXX0lNR19ICisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgIEZXX0FQLlRYVAorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgIEZXX1dvV0xBTi5UWFQKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNkZWZpbmUgQXJyYXlMZW5ndGhfODE4OEVfRldfV29XTEFOIDE1NzY0CitleHRlcm4gY29u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FCSUxJVFkgb3IKKyogRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFSIFBVUlBPU0UuIFNlZSB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgZm9yCisqIG1vcmUgZGV0YWlscy4KKyoKKyogWW91IHNob3VsZCBoYXZlIHJlY2VpdmVkIGEgY29weSBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgYWxvbmcgd2l0aAorKiB0aGlzIHByb2dyYW07IGlmIG5vdCwgd3JpdGUgdG8gdGhlIEZyZWUgU29mdHdhcmUgRm91bmRhdGlvbiwgSW5jLiwKKyogNTEgRnJhbmtsaW4gU3RyZWV0LCBGaWZ0aCBGbG9vciwgQm9zdG9uLCBNQSAwMjExMCwgVVNBCisqCisqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNpZm5kZWYgX19JTkNfTUFDXzgxODhFX0hXX0lNR19ICisjZGVmaW5lIF9fSU5DX01BQ184MTg4RV9IV19JTUdfSAorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX1JFRy5UWFQKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworZW51bSBIQUxfU1RBVFVTIE9ETV9SZWFkQW5kQ29uZmlnX01BQ19SRUdfODE4OEUoc3RydWN0IG9kbV9kbV9zdHJ1Y3QgKnBETV9PZG0pOworCisjZW5kaWYgLyogIGVuZCBvZiBIV0lNR19TVVBQT1JUICovCmRpZmYgLS1naXQgYS9kcml2ZXJzL3N0YWdpbmcvcnRsODE4OGV1L2luY2x1ZGUvSGFsSFdJbWc4MTg4RV9SRi5oIGIvZHJpdm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SBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBhbG9uZyB3aXRoCisqIHRoaXMgcHJvZ3JhbTsgaWYgbm90LCB3cml0ZSB0byB0aGUgRnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uLCBJbmMuLAorKiA1MSBGcmFua2xpbiBTdHJlZXQsIEZpZnRoIEZsb29yLCBCb3N0b24sIE1BIDAyMTEwLCBVU0EKKyoKKyoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI2lmbmRlZiBfX0lOQ19SRl84MTg4RV9IV19JTUdfSAorI2RlZmluZSBfX0lOQ19SRl84MTg4RV9IV19JTUdfSAorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgIFJhZGlvQV8xVC5UWFQKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK2VudW0gSEFMX1NUQVRVUyBPRE1fUmVhZEFuZENvbmZpZ19SYWRpb0FfMVRfODE4OEUoc3RydWN0IG9kbV9kbV9zdHJ1Y3QgKm9kbSk7CisKKyNlbmRpZiAvKiAgZW5kIG9mIEhXSU1HX1NVUFBPUlQgKi8KZGlmZiAtLWdpdCBhL2RyaXZlcnMvc3RhZ2luZy9ydGw4MTg4ZXUvaW5jbHVkZS9IYWxQaHlSZi5oIGIvZHJpdmVycy9zdGFnaW5nL3J0bDgxODhldS9pbmNsdWRlL0hhbFBoeVJmLmgKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMWVjNDk3MQotLS0gL2Rldi9udWxsCisrKyBiL2RyaXZlcnMvc3RhZ2luZy9ydGw4MTg4ZXUvaW5jbHVk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CSovCisjZGVmaW5lIEVUSF9QX0RFQyAgICAgICAweDYwMDAgICAgICAgICAgLyogREVDIEFzc2lnbmVkIHByb3RvICAgICAgICAgICAqLworI2RlZmluZSBFVEhfUF9ETkFfREwgICAgMHg2MDAxICAgICAgICAgIC8qIERFQyBETkEgRHVtcC9Mb2FkICAgICAgICAgICAgKi8KKyNkZWZpbmUgRVRIX1BfRE5BX1JDICAgIDB4NjAwMiAgICAgICAgICAvKiBERUMgRE5BIFJlbW90ZSBDb25zb2xlICAgICAgICovCisjZGVmaW5lIEVUSF9QX0ROQV9SVCAgICAweDYwMDMgICAgICAgICAgLyogREVDIEROQSBSb3V0aW5nICAgICAgICAgICAgICAqLworI2RlZmluZSBFVEhfUF9MQVQgICAgICAgMHg2MDA0ICAgICAgICAgIC8qIERFQyBMQVQgICAgICAgICAgICAgICAgICAgICAgKi8KKyNkZWZpbmUgRVRIX1BfRElBRyAgICAgIDB4NjAwNSAgICAgICAgICAvKiBERUMgRGlhZ25vc3RpY3MgICAgICAgICAgICAgICovCisjZGVmaW5lIEVUSF9QX0NVU1QgICAgICAweDYwMDYgICAgICAgICAgLyogREVDIEN1c3RvbWVyIHVzZSAgICAgICAgICAgICAqLworI2RlZmluZSBFVEhfUF9TQ0EgICAgICAgMHg2MDA3ICAgICAgICAgIC8qIERFQyBTeXN0ZW1zIENvbW1zIEFyY2ggICAgICAgKi8KKyNkZWZpbmUgRVRIX1BfUkFSUCAgICAgIDB4ODAzNQkJLyogUmV2ZXJzZSBBZGRyIFJlcyBwYWNrZXQJKi8KKyNkZWZpbmUgRVRIX1BfQVRBTEsJMHg4MDlCCQkvKiBBcHBsZXRhbGsgRERQCQkqLworI2RlZmluZSBFVEhfUF9BQVJQCTB4ODBGMwkJLyogQXBwbGV0YWxrIEFBUlAJCSovCisjZGVmaW5lIEVUSF9QXzgwMjFRCTB4ODEwMCAgICAgICAgICAvKiA4MDIuMVEgVkxBTiBFeHRlbmRlZCBIZWFkZXIgICovCisjZGVmaW5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kIG5ldyBmdW5jdGlvbiBTd0FudERpdkNoZWNrODE5MkMoKS4gKi8KKy8qICBUaGlzIGlzIHRoZSBtYWluIGZ1bmN0aW9uIG9mIEFudGVubmEgZGl2ZXJzaXR5IGZ1bmN0aW9uIGJlZm9yZSBsaW5rLiAqLworLyogIE1haW5seSwgaXQganVzdCByZXRhaW5zIGxhc3Qgc2NhbiByZXN1bHQgYW5kIHNjYW4gYWdhaW4uICovCisvKiAgQWZ0ZXIgdGhhdCwgaXQgY29tcGFyZXMgdGhlIHNjYW4gcmVzdWx0IHRvIHNlZSB3aGljaCBvbmUgZ2V0cyBiZXR0ZXIKKyAqICBSU1NJLiBJdCBzZWxlY3RzIGFudGVubmEgd2l0aCBiZXR0ZXIgcmVjZWl2aW5nIHBvd2VyIGFuZCByZXR1cm5zIGJldHRlcgorICogIHNjYW4gcmVzdWx0LiAqLworCisjZGVmaW5lCVRQX01PREUJCQkwCisjZGVmaW5lCVJTU0lfTU9ERQkJMQorI2RlZmluZQlUUkFGRklDX0xPVwkJMAorI2RlZmluZQlUUkFGRklDX0hJR0gJCTEKKworLyogMyBUeCBQb3dlciBUcmFja2luZyAqLworLyogMz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworI2RlZmluZQkJRFBLX0RFTFRBX01BUFBJTkdfTlVNCTEzCisjZGVmaW5lCQlpbmRleF9tYXBwaW5nX0hQX05VTQkxNQorCisKKy8qICAqLworLyogMyBQU0QgSGFuZGxlciAqLworLyogMz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworCisjZGVmaW5lCUFGSF9QU0QJCTEJLyogMDpub3JtYWwgUFNEIHNjYW4sIDE6IG9ubHkgZG8gMjAgcHRzIFBTRCAqLworI2RlZmluZQlNT0RFXzQwTQkwCS8qIDA6MjBNLCAxOjQwTSAqLworI2RlZmluZQlQU0RfVEgyCQkzCisjZGVma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gLyogUmFkaW8gUGF0aCBEICovCit9OworCitlbnVtIE9ETV9SRl9DT05URU5UIHsKKwlvZG1fcmFkaW9hX3R4dCA9IDB4MTAwMCwKKwlvZG1fcmFkaW9iX3R4dCA9IDB4MTAwMSwKKwlvZG1fcmFkaW9jX3R4dCA9IDB4MTAwMiwKKwlvZG1fcmFkaW9kX3R4dCA9IDB4MTAwMworfTsKKworZW51bSBvZG1fYmJfY29uZmlnX3R5cGUgeworICAgIENPTkZJR19CQl9QSFlfUkVHLAorICAgIENPTkZJR19CQl9BR0NfVEFCLAorICAgIENPTkZJR19CQl9BR0NfVEFCXzJHLAorICAgIENPTkZJR19CQl9BR0NfVEFCXzVHLAorICAgIENPTkZJR19CQl9QSFlfUkVHX1BHLAorfTsKKworLyogIFN0YXR1cyBjb2RlICovCitlbnVtIHJ0X3N0YXR1cyB7CisJUlRfU1RBVFVTX1NVQ0NFU1MsCisJUlRfU1RBVFVTX0ZBSUxVUkUsCisJUlRfU1RBVFVTX1BFTkRJTkcsCisJUlRfU1RBVFVTX1JFU09VUkNFLAorCVJUX1NUQVRVU19JTlZBTElEX0NPTlRFWFQsCisJUlRfU1RBVFVTX0lOVkFMSURfUEFSQU1FVEVSLAorCVJUX1NUQVRVU19OT1RfU1VQUE9SVCwKKwlSVF9TVEFUVVNfT1NfQVBJX0ZBSUxFRCwKK307CisKKy8qIDM9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworLyogMyBESUcgKi8KKy8qIDM9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworCitlbnVtIGRtX2RpZ19vcCB7CisJUlRfVFlQRV9USFJFU0hfSElHSAk9IDAsCisJUlRfVFlQRV9USFJFU0hfTE9XCT0gMSwKKwlSVF9UWVBFX0JBQ0tPRkYJCT0gMiwKKwlSVF9UWVBFX1JYX0dBSU5fTUlOCT0gMywKKwlSVF9UWVB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HX0ZBX1RIMF85MkQJCTB4MTAwCisjZGVmaW5lCQlETV9ESUdfRkFfVEgxXzkyRAkJMHg0MDAKKyNkZWZpbmUJCURNX0RJR19GQV9USDJfOTJECQkweDYwMAorCisjZGVmaW5lCQlETV9ESUdfQkFDS09GRl9NQVgJCTEyCisjZGVmaW5lCQlETV9ESUdfQkFDS09GRl9NSU4JCS00CisjZGVmaW5lCQlETV9ESUdfQkFDS09GRl9ERUZBVUxUCQkxMAorCisvKiAzPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KKy8qIDMgQUdDIFJYIEhpZ2ggUG93ZXIgTW9kZSAqLworLyogMz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCisjZGVmaW5lCSAgTE5BX0xvd19HYWluXzEJCTB4NjQKKyNkZWZpbmUJICBMTkFfTG93X0dhaW5fMgkJMHg1QQorI2RlZmluZQkgIExOQV9Mb3dfR2Fpbl8zCQkweDU4CisKKyNkZWZpbmUJICBGQV9SWEhQX1RIMQkJCTUwMDAKKyNkZWZpbmUJICBGQV9SWEhQX1RIMgkJCTE1MDAKKyNkZWZpbmUJICBGQV9SWEhQX1RIMwkJCTgwMAorI2RlZmluZQkgIEZBX1JYSFBfVEg0CQkJNjAwCisjZGVmaW5lCSAgRkFfUlhIUF9USDUJCQk1MDAKKworLyogMz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCisvKiAzIEVEQ0EgKi8KKy8qIDM9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworCisvKiAzPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KKy8qIDMgRHluYW1pYyBUeCBQb3dlciAqLworLyogMz09PT09PT09PT09PT09PT09PT09P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KworLyogMz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCisvKiAzIEJCIFBvd2VyIFNhdmUgKi8KKy8qIDM9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworCisKK2VudW0gZG1fMXJfY2NhIHsKKwlDQ0FfMVIgPSAwLAorCUNDQV8yUiA9IDEsCisJQ0NBX01BWCA9IDIsCit9OworCitlbnVtIGRtX3JmIHsKKwlSRl9TYXZlID0gMCwKKwlSRl9Ob3JtYWwgPSAxLAorCVJGX01BWCA9IDIsCit9OworCisvKiAzPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KKy8qIDMgQW50ZW5uYSBEaXZlcnNpdHkgKi8KKy8qIDM9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworZW51bSBkbV9zd2FzIHsKKwlBbnRlbm5hX0EgPSAxLAorCUFudGVubmFfQiA9IDIsCisJQW50ZW5uYV9NQVggPSAzLAorfTsKKworLyogIE1heGltYWwgbnVtYmVyIG9mIGFudGVubmEgZGV0ZWN0aW9uIG1lY2hhbmlzbSBuZWVkcyB0byBwZXJmb3JtLiAqLworI2RlZmluZQlNQVhfQU5URU5OQV9ERVRFQ1RJT05fQ05UCTEwCisKKy8qICBFeHRlcm4gR2xvYmFsIFZhcmlhYmxlcy4gKi8KKyNkZWZpbmUJT0ZETV9UQUJMRV9TSVpFXzkyQwkzNworI2RlZmluZQlPRkRNX1RBQkxFX1NJWkVfOTJECTQzCisjZGVmaW5lCUNDS19UQUJMRV9TSVpFCQkzMworCitleHRlcm4JdTMyIE9GRE1Td2luZ1RhYmxlW09GRE1fVEFCTEVfU0laRV85MkRdOworZXh0ZXJuCXU4IENDS1N3aW5nVGFibGVfQ2gxX0NoMTNbQ0NLX1RBQkxFX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FOWSBXQVJSQU5UWTsgd2l0aG91dCBldmVuIHRoZSBpbXBsaWVkIHdhcnJhbnR5IG9mIE1FUkNIQU5UQUJJTElUWSBvcgorICogRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFSIFBVUlBPU0UuIFNlZSB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgZm9yCisgKiBtb3JlIGRldGFpbHMuCisgKgorICogWW91IHNob3VsZCBoYXZlIHJlY2VpdmVkIGEgY29weSBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgYWxvbmcgd2l0aAorICogdGhpcyBwcm9ncmFtOyBpZiBub3QsIHdyaXRlIHRvIHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb24sIEluYy4sCisgKiA1MSBGcmFua2xpbiBTdHJlZXQsIEZpZnRoIEZsb29yLCBCb3N0b24sIE1BIDAyMTEwLCBVU0EKKyAqCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI2lmbmRlZglfX09ETV9JTlRFUkZBQ0VfSF9fCisjZGVmaW5lIF9fT0RNX0lOVEVSRkFDRV9IX18KKworLyogICovCisvKiAgPT09PT09PT09PT0gQ29uc3RhbnQvU3RydWN0dXJlL0VudW0vLi4uIERlZmluZSAqLworLyogICovCisKKy8qICAqLworLyogID09PT09PT09PT09IE1hY3JvIERlZmluZSAqLworLyogICovCisKKyNkZWZpbmUgX3JlZ19hbGwoX25hbWUpCQkJT0RNXyMjX25hbWUKKyNkZWZpbmUgX3JlZ19pYyhfbmFtZSwgX2ljKQkJT0RNXyMjX25hbWUjI19pYworI2RlZmluZSBfYml0X2FsbChfbmFtZSkJCQlCSVRfIyNfbmFtZQorI2RlZmluZSBfYml0X2ljKF9uYW1lLCBfaWMpCQlCSVRfIyNfbmFtZSMjX2ljCisKKy8qICBfY2F0OiBpbXBsZW1lbnRlZCBieSB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VlKQoreworCXJldHVybiAoJihxdWV1ZS0+cXVldWUpKTsKK30KKworCisjZGVmaW5lIExJU1RfQ09OVEFJTk9SKHB0ciwgdHlwZSwgbWVtYmVyKSBcCisgICAgICAgICgodHlwZSAqKSgoY2hhciAqKShwdHIpLShzaXplX3QpKCYoKHR5cGUgKikwKS0+bWVtYmVyKSkpCisKKworc3RhdGljIGlubGluZSB2b2lkIF9lbnRlcl9jcml0aWNhbChzcGlubG9ja190ICpwbG9jaywgdW5zaWduZWQgbG9uZyAqcGlycUwpCit7CisJc3Bpbl9sb2NrX2lycXNhdmUocGxvY2ssICpwaXJxTCk7Cit9CisKK3N0YXRpYyBpbmxpbmUgdm9pZCBfZXhpdF9jcml0aWNhbChzcGlubG9ja190ICpwbG9jaywgdW5zaWduZWQgbG9uZyAqcGlycUwpCit7CisJc3Bpbl91bmxvY2tfaXJxcmVzdG9yZShwbG9jaywgKnBpcnFMKTsKK30KKworc3RhdGljIGlubGluZSB2b2lkIF9lbnRlcl9jcml0aWNhbF9leChzcGlubG9ja190ICpwbG9jaywgdW5zaWduZWQgbG9uZyAqcGlycUwpCit7CisJc3Bpbl9sb2NrX2lycXNhdmUocGxvY2ssICpwaXJxTCk7Cit9CisKK3N0YXRpYyBpbmxpbmUgdm9pZCBfZXhpdF9jcml0aWNhbF9leChzcGlubG9ja190ICpwbG9jaywgdW5zaWduZWQgbG9uZyAqcGlycUwpCit7CisJc3Bpbl91bmxvY2tfaXJxcmVzdG9yZShwbG9jaywgKnBpcnFMKTsKK30KKworc3RhdGljIGlubGluZSB2b2lkIF9lbnRlcl9jcml0aWNhbF9iaChzcGlubG9ja190ICpwbG9jaywgdW5zaWduZWQgbG9uZyAqcGlycUwpCit7CisJc3Bpbl9sb2NrX2JoKHBsb2NrKTsKK30KKworc3RhdGljIGlubGluZSB2b2lkIF9leGl0X2NyaXRpY2FsX2JoKHNwaW5sb2NrX3QgKnBsb2NrLCB1bnNpZ25lZCBsb25nICpwaXJxTCkKK3sKKwl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c3luYyhwdGltZXIpOworCSpiY2FuY2VsbGVkPSAgdHJ1ZTsvKiB0cnVlID09MTsgZmFsc2U9PTAgKi8KK30KKworI2RlZmluZSBSVFdfVElNRVJfSERMX0FSR1Mgdm9pZCAqRnVuY3Rpb25Db250ZXh0CisjZGVmaW5lIFJUV19USU1FUl9IRExfTkFNRShuYW1lKSBydHdfIyNuYW1lIyNfdGltZXJfaGRsCisjZGVmaW5lIFJUV19ERUNMQVJFX1RJTUVSX0hETChuYW1lKSB2b2lkIFJUV19USU1FUl9IRExfTkFNRShuYW1lKShSVFdfVElNRVJfSERMX0FSR1MpCisKK3N0YXRpYyBpbmxpbmUgdm9pZCBfaW5pdF93b3JraXRlbShzdHJ1Y3Qgd29ya19zdHJ1Y3QgKnB3b3JrLCB2b2lkICpwZnVuYywgdm9pZCAqIGNudHgpCit7CisJSU5JVF9XT1JLKHB3b3JrLCBwZnVuYyk7Cit9CisKK3N0YXRpYyBpbmxpbmUgdm9pZCBfc2V0X3dvcmtpdGVtKHN0cnVjdCB3b3JrX3N0cnVjdCAqcHdvcmspCit7CisJc2NoZWR1bGVfd29yayhwd29yayk7Cit9CisKK3N0YXRpYyBpbmxpbmUgdm9pZCBfY2FuY2VsX3dvcmtpdGVtX3N5bmMoc3RydWN0IHdvcmtfc3RydWN0ICpwd29yaykKK3sKKwljYW5jZWxfd29ya19zeW5jKHB3b3JrKTsKK30KKy8qICAqLworLyogIEdsb2JhbCBNdXRleDogY2FuIG9ubHkgYmUgdXNlZCBhdCBQQVNTSVZFIGxldmVsLiAqLworLyogICovCisKKyNkZWZpbmUgQUNRVUlSRV9HTE9CQUxfTVVURVgoX011dGV4Q291bnRlcikgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCit7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCXdoaWxlIChhdG9taWNfaW5jX3JldHVybigoYXRvbWljX3QgKikmKF9NdXRleENvdW50ZXIpKSAhPSAxKVwKKwl7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJCWF0b21pY19kZWMoKGF0b21pY190ICopJihfTXV0ZXhDb3VudGVyKSk7ICAgICAgICBcCisJCW1zbGVlcCgxMCk7ICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorfQorCisjZGVmaW5lIFJFTEVBU0VfR0xPQkFMX01VVEVYKF9NdXRleENvdW50ZXIpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAoreyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwlhdG9taWNfZGVjKChhdG9taWNfdCAqKSYoX011dGV4Q291bnRlcikpOyAgICAgICAgXAorfQorCitzdGF0aWMgaW5saW5lIGludCBydHdfbmV0aWZfcXVldWVfc3RvcHBlZChzdHJ1Y3QgbmV0X2RldmljZSAqcG5ldGRldikKK3sKKwlyZXR1cm4gIG5ldGlmX3R4X3F1ZXVlX3N0b3BwZWQobmV0ZGV2X2dldF90eF9xdWV1ZShwbmV0ZGV2LCAwKSkgJiYKKwkJbmV0aWZfdHhfcXVldWVfc3RvcHBlZChuZXRkZXZfZ2V0X3R4X3F1ZXVlKHBuZXRkZXYsIDEpKSAmJgorCQluZXRpZl90eF9xdWV1ZV9zdG9wcGVkKG5ldGRldl9nZXRfdHhfcXVldWUocG5ldGRldiwgMikpICYmCisJCW5ldGlmX3R4X3F1ZXVlX3N0b3BwZWQobmV0ZGV2X2dldF90eF9xdWV1ZShwbmV0ZGV2LCAzKSk7Cit9CisKK3N0YXRpYyBpbmxpbmUgdm9pZCBydHdfbmV0aWZfd2FrZV9xdWV1ZShzdHJ1Y3QgbmV0X2RldmljZSAqcG5ldGRldikKK3sKKwluZXRpZl90eF93YWtlX2FsbF9xd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vaWQgcnR3X3lpZWxkX29zKHZvaWQpOworCitzdGF0aWMgaW5saW5lIHVuc2lnbmVkIGNoYXIgX2NhbmNlbF90aW1lcl9leChzdHJ1Y3QgdGltZXJfbGlzdCAqcHRpbWVyKQoreworCXJldHVybiBkZWxfdGltZXJfc3luYyhwdGltZXIpOworfQorCitzdGF0aWMgX19pbmxpbmUgdm9pZCB0aHJlYWRfZW50ZXIoY2hhciAqbmFtZSkKK3sKKyNpZmRlZiBkYWVtb25pemUKKwlkYWVtb25pemUoIiVzIiwgbmFtZSk7CisjZW5kaWYKKwlhbGxvd19zaWduYWwoU0lHVEVSTSk7Cit9CisKK3N0YXRpYyBpbmxpbmUgdm9pZCBmbHVzaF9zaWduYWxzX3RocmVhZCh2b2lkKQoreworCWlmIChzaWduYWxfcGVuZGluZyAoY3VycmVudCkpCisJCWZsdXNoX3NpZ25hbHMoY3VycmVudCk7Cit9CisKK3N0YXRpYyBpbmxpbmUgaW50IHJlc190b19zdGF0dXMoaW50IHJlcykKK3sKKwlyZXR1cm4gcmVzOworfQorCisjZGVmaW5lIF9STkQoc3osIHIpICgoKChzeikrKChyKS0xKSkvKHIpKSoocikpCisjZGVmaW5lIFJORDQoeCkJKCgoeCA+PiAyKSArICgoKHggJiAzKSA9PSAwKSA/ICAwOiAxKSkgPDwgMikKKworc3RhdGljIGlubGluZSB1MzIgX1JORDQodTMyIHN6KQoreworCXUzMgl2YWw7CisKKwl2YWwgPSAoKHN6ID4+IDIpICsgKChzeiAmIDMpID8gMTogMCkpIDw8IDI7CisJcmV0dXJuIHZhbDsKK30KKworc3RhdGljIGlubGluZSB1MzIgX1JORDgodTMyIHN6KQoreworCXUzMgl2YWw7CisKKwl2YWwgPSAoKHN6ID4+IDMpICsgKChzeiAmIDcpID8gMTogMCkpIDw8IDM7CisJcmV0dXJuIHZhbDsKK30KKworc3RhdGljIGlubGluZSB1MzIgX1JORDEyOCh1MzIgc3opCit7CisJdTMyCXZhbDsKKworCXZhbCA9ICgoc3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zg4RQkJNTEyCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CitIZXJlIHRoZSByZWdpc3RlciBkZWZpbmVzIGFyZSBmb3IgOTJDLiBXaGVuIHRoZSBkZWZpbmUgaXMgYXMgc2FtZSB3aXRoIDkyQywKK3dlIHdpbGwgdXNlIHRoZSA5MkMncyBkZWZpbmUgZm9yIHRoZSBjb25zaXN0ZW5jeQorU28gdGhlIGZvbGxvd2luZyBkZWZpbmVzIGZvciA5MkMgaXMgbm90IGVudGlyZSEhISEhIQorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Cis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworLyoKK0Jhc2VkIG9uIERhdGFzaGVldCBWMzMtLS0wOTA0MDEKK1JlZ2lzdGVyIFN1bW1hcnkKK0N1cnJlbnQgSU9SRUcgTUFQCisweDAwMDBoIH4gMHgwMEZGaCAgIFN5c3RlbSBDb25maWd1cmF0aW9uICgyNTYgQnl0ZXMpCisweDAxMDBoIH4gMHgwMUZGaCAgIE1BQ1RPUCBHZW5lcmFsIENvbmZpZ3VyYXRpb24gKDI1NiBCeXRlcykKKzB4MDIwMGggfiAweDAyN0ZoICAgVFhETUEgQ29uZmlndXJhdGlvbiAoMTI4IEJ5dGVzKQorMHgwMjgwaCB+IDB4MDJGRmggICBSWERNQSBDb25maWd1cmF0aW9uICgxMjggQnl0ZXMpCisweDAzMDBoIH4gMHgwM0ZGaCAgIFBDSUUgRU1BQyBSZXNlcnZlZCBSZWdpb24gKDI1NiBCeXRlcykKKzB4MDQwMGggfiAweDA0RkZoICAgUHJvdG9jb2wgQ29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uc2UgZm9yCisgKiBtb3JlIGRldGFpbHMuCisgKgorICogWW91IHNob3VsZCBoYXZlIHJlY2VpdmVkIGEgY29weSBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgYWxvbmcgd2l0aAorICogdGhpcyBwcm9ncmFtOyBpZiBub3QsIHdyaXRlIHRvIHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb24sIEluYy4sCisgKiA1MSBGcmFua2xpbiBTdHJlZXQsIEZpZnRoIEZsb29yLCBCb3N0b24sIE1BIDAyMTEwLCBVU0EKKyAqCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZm5kZWYgX19SVFdfTEVEX0hfCisjZGVmaW5lIF9fUlRXX0xFRF9IXworCisjaW5jbHVkZSA8b3NkZXBfc2VydmljZS5oPgorI2luY2x1ZGUgPGRydl90eXBlcy5oPgorCisjZGVmaW5lIE1TRUNTKHQpICAgICAgICAoSFogKiAoKHQpIC8gMTAwMCkgKyAoSFogKiAoKHQpICUgMTAwMCkpIC8gMTAwMCkKKworI2RlZmluZSBMRURfQkxJTktfTk9STUFMX0lOVEVSVkFMCQkxMDAKKyNkZWZpbmUgTEVEX0JMSU5LX1NMT1dMWV9JTlRFUlZBTAkJMjAwCisjZGVmaW5lIExFRF9CTElOS19MT05HX0lOVEVSVkFMCQkJNDAwCisKKyNkZWZpbmUgTEVEX0JMSU5LX05PX0xJTktfSU5URVJWQUxfQUxQSEEJMTAwMAorI2RlZmluZSBMRURfQkxJTktfTElOS19JTlRFUlZBTF9BTFBIQQkJNTAwCS8qIDUwMCAqLworI2RlZmluZSBMRURfQkxJTktfU0NBTl9JTlRFUlZBTF9BTFBIQQkJMTgwCS8qIDE1MCAqLworI2RlZmluZSBMRURfQkxJTktfRkFTVEVSX0lOVEVSVkFMX0FMUEhBCQk1MAorI2RlZmluZSBMRURfQkxJTkt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luIFN0cmVldCwgRmlmdGggRmxvb3IsIEJvc3RvbiwgTUEgMDIxMTAsIFVTQQorICoKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogTW9kdWxlOglfX1JUV19NUF9QSFlfUkVHREVGX0hfCisgKgorICoKKyAqIE5vdGU6CTEuIERlZmluZSBQTUFDL0JCIHJlZ2lzdGVyIG1hcAorICoJCQkyLiBEZWZpbmUgUkYgcmVnaXN0ZXIgbWFwCisgKgkJCTMuIFBNQUMvQkIgcmVnaXN0ZXIgYml0IG1hc2suCisgKgkJCTQuIFJGIHJlZyBiaXQgbWFzay4KKyAqCQkJNS4gT3RoZXIgQkIvUkYgcmVsYXRpdmUgZGVmaW5pdGlvbi4KKyAqCisgKgorICogRXhwb3J0OglDb25zdGFudHMsIG1hY3JvLCBmdW5jdGlvbnMoQVBJKSwgZ2xvYmFsIHZhcmlhYmxlcyhOb25lKS4KKyAqCisgKiBBYmJyZXY6CisgKgorICogSGlzdG9yeToKKyAqCURhdGEJCQlXaG8JCVJlbWFyaworICoJMDgvMDcvMjAwNwlNSEMJCTEuIFBvcnRpbmcgZnJvbSA5eCBzZXJpZXMgUEhZQ0ZHLmguCisgKgkJCQkJCTIuIFJlb3JnYW5pemUgY29kZSBhcmNoaXRlY3R1cmUuCisgKgkwOS8yNS8yMDA4CU1ICQkxLiBBZGQgUkw2MDUyIHJlZ2lzdGVyIGRlZmluaXRpb24KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWZuZGVmIF9fUlRXX01QX1BIWV9SRUdERUZfSF8KKyNkZWZpbmUgX19SVFdfTVBfUEhZX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kWzMyXTsKK307CisKK2VudW0gTkRJU184MDJfMTFfTkVUV09SS19UWVBFIHsKKwlOZGlzODAyXzExRkgsCisJTmRpczgwMl8xMURTLAorCU5kaXM4MDJfMTFPRkRNNSwKKwlOZGlzODAyXzExT0ZETTI0LAorCU5kaXM4MDJfMTFOZXR3b3JrVHlwZU1heCAgICAvKiAgZHVtbXkgdXBwZXIgYm91bmQgKi8KK307CisKK3N0cnVjdCBuZGlzXzgwMl8xMV9jb25maWdfZmggeworCXUzMiAgICAgICAgICAgTGVuZ3RoOwkJLyogIExlbmd0aCBvZiBzdHJ1Y3R1cmUgKi8KKwl1MzIgICAgICAgICAgIEhvcFBhdHRlcm47CS8qICBBcyBkZWZpbmVkIGJ5IDgwMi4xMSwgTVNCIHNldCAqLworCXUzMiAgICAgICAgICAgSG9wU2V0OwkJLyogIHRvIG9uZSBpZiBub24tODAyLjExICovCisJdTMyICAgICAgICAgICBEd2VsbFRpbWU7CS8qICB1bml0cyBhcmUgS3VzZWMgKi8KK307CisKKy8qCisgKglGVyB3aWxsIG9ubHkgc2F2ZSB0aGUgY2hhbm5lbCBudW1iZXIgaW4gRFNDb25maWcuCisgKglPREkgSGFuZGxlciB3aWxsIGNvbnZlcnQgdGhlIGNoYW5uZWwgbnVtYmVyIHRvIGZyZXEuIG51bWJlci4KKyAqLworc3RydWN0IG5kaXNfODAyXzExX2NvbmZpZyB7CisJdTMyICAgICAgICAgICBMZW5ndGg7ICAgICAgICAgICAgIC8qICBMZW5ndGggb2Ygc3RydWN0dXJlICovCisJdTMyICAgICAgICAgICBCZWFjb25QZXJpb2Q7ICAgICAgIC8qICB1bml0cyBhcmUgS3VzZWMgKi8KKwl1MzIgICAgICAgICAgIEFUSU1XaW5kb3c7ICAgICAgICAgLyogIHVuaXRzIGFyZSBLdXNlYyAqLworCXUzMiAgICAgICAgICAgRFNDb25maWc7ICAgICAgICAgICAvKiAgRnJlcXVlbmN5LCB1bml0cyBhcmUga0h6ICovCisJc3RydWN0IG5k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ZW5ndGg7CisJdTMyICBPZmZzZXRSZXNwb25zZUlFczsKK307CisKK2VudW0gbmRpc184MDJfMTFfcmVsb2FkX2RlZiB7CisJTmRpczgwMl8xMVJlbG9hZFdFUEtleXMKK307CisKKy8qICBLZXkgbWFwcGluZyBrZXlzIHJlcXVpcmUgYSBCU1NJRCAqLworc3RydWN0IG5kaXNfODAyXzExX2tleSB7CisJdTMyICAgICAgICAgICBMZW5ndGg7ICAgICAgICAgICAgIC8qICBMZW5ndGggb2YgdGhpcyBzdHJ1Y3R1cmUgKi8KKwl1MzIgICAgICAgICAgIEtleUluZGV4OworCXUzMiAgICAgICAgICAgS2V5TGVuZ3RoOyAgICAgICAgICAvKiAgbGVuZ3RoIG9mIGtleSBpbiBieXRlcyAqLworCXVuc2lnbmVkIGNoYXIgQlNTSURbRVRIX0FMRU5dOworCXVuc2lnbmVkIGxvbmcgbG9uZyBLZXlSU0M7CisJdTggICAgICAgICAgIEtleU1hdGVyaWFsWzMyXTsgIC8qIHZhciBsZW4gZGVwZW5kaW5nIG9uIGFib3ZlIGZpZWxkICovCit9OworCitzdHJ1Y3QgbmRpc184MDJfMTFfcmVtb3ZlX2tleSB7CisJdTMyICAgICAgICAgICAgICAgICAgIExlbmd0aDsgICAgICAgIC8qICBMZW5ndGggKi8KKwl1MzIgICAgICAgICAgICAgICAgICAgS2V5SW5kZXg7CisJdW5zaWduZWQgY2hhciBCU1NJRFtFVEhfQUxFTl07Cit9OworCitzdHJ1Y3QgbmRpc184MDJfMTFfd2VwIHsKKwl1MzIgICAgIExlbmd0aDsgICAgICAgIC8qICBMZW5ndGggb2YgdGhpcyBzdHJ1Y3R1cmUgKi8KKwl1MzIgICAgIEtleUluZGV4OyAgICAgIC8qICAwIGlzIHRoZSBwZXItY2xpZW50IGtleSwKKwkJCQkgICogMS1OIGFyZSB0aGUgZ2xvYmFsIGtleXMgKi8KKwl1MzIgICAgIEtleUxlbmd0aDsgICAgIC8qICBsZW5ndGggb2Yga2V5IGluIGJ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W1zbGVlcCgodW5zaWduZWQgaW50KW1zKTsKK30KKwordm9pZCBydHdfdXNsZWVwX29zKGludCB1cykKK3sKKwlpZiAoMSA8ICh1cy8xMDAwKSkKKwkJbXNsZWVwKDEpOworCWVsc2UKKwkJbXNsZWVwKCh1cy8xMDAwKSArIDEpOworfQorCit2b2lkIHJ0d19tZGVsYXlfb3MoaW50IG1zKQoreworCW1kZWxheSgodW5zaWduZWQgbG9uZyltcyk7Cit9CisKK3ZvaWQgcnR3X3VkZWxheV9vcyhpbnQgdXMpCit7CisJdWRlbGF5KCh1bnNpZ25lZCBsb25nKXVzKTsKK30KKwordm9pZCBydHdfeWllbGRfb3Modm9pZCkKK3sKKwl5aWVsZCgpOworfQorCisjZGVmaW5lIFJUV19TVVNQRU5EX0xPQ0tfTkFNRSAicnR3X3dpZmkiCisKK2lubGluZSB2b2lkIHJ0d19zdXNwZW5kX2xvY2tfaW5pdCh2b2lkKQoreworfQorCitpbmxpbmUgdm9pZCBydHdfc3VzcGVuZF9sb2NrX3VuaW5pdCh2b2lkKQoreworfQorCitpbmxpbmUgdm9pZCBydHdfbG9ja19zdXNwZW5kKHZvaWQpCit7Cit9CisKK2lubGluZSB2b2lkIHJ0d191bmxvY2tfc3VzcGVuZCh2b2lkKQoreworfQorCitpbmxpbmUgdm9pZCBBVE9NSUNfU0VUKEFUT01JQ19UICp2LCBpbnQgaSkKK3sKKwlhdG9taWNfc2V0KHYsIGkpOworfQorCitpbmxpbmUgaW50IEFUT01JQ19SRUFEKEFUT01JQ19UICp2KQoreworCXJldHVybiBhdG9taWNfcmVhZCh2KTsKK30KKworaW5saW5lIHZvaWQgQVRPTUlDX0FERChBVE9NSUNfVCAqdiwgaW50IGkpCit7CisJYXRvbWljX2FkZChpLCB2KTsKK30KKworaW5saW5lIHZvaWQgQVRPTUlDX1NVQihBVE9NSUNfVCAqdiwgaW50IGkpCit7CisJYXRvbWljX3N1YihpLCB2KTsKK30KKworaW5saW5lIHZvaWQgQVRPTUlDX0lOQyhBVE9NSUNfVCAqdikKK3sKKwlhdG9taWNfaW5jKHYpOworfQorCitpbmxpbmUgdm9pZCBBVE9NSUNfREVDKEFUT01JQ19UICp2KQoreworCWF0b21pY19kZWModik7Cit9CisKK2lubGluZSBpbnQgQVRPTUlDX0FERF9SRVRVUk4oQVRPTUlDX1QgKnYsIGludCBpKQoreworCXJldHVybiBhdG9taWNfYWRkX3JldHVybihpLCB2KTsKK30KKworaW5saW5lIGludCBBVE9NSUNfU1VCX1JFVFVSTihBVE9NSUNfVCAqdiwgaW50IGkpCit7CisJcmV0dXJuIGF0b21pY19zdWJfcmV0dXJuKGksIHYpOworfQorCitpbmxpbmUgaW50IEFUT01JQ19JTkNfUkVUVVJOKEFUT01JQ19UICp2KQoreworCXJldHVybiBhdG9taWNfaW5jX3JldHVybih2KTsKK30KKworaW5saW5lIGludCBBVE9NSUNfREVDX1JFVFVSTihBVE9NSUNfVCAqdikKK3sKKwlyZXR1cm4gYXRvbWljX2RlY19yZXR1cm4odik7Cit9CisKKy8qIE9wZW4gYSBmaWxlIHdpdGggdGhlIHNwZWNpZmljIEBwYXJhbSBwYXRoLCBAcGFyYW0gZmxhZywgQHBhcmFtIG1vZGUKKyAqIEBwYXJhbSBmcHAgdGhlIHBvaW50ZXIgb2Ygc3RydWN0IGZpbGUgcG9pbnRlciB0byBnZXQgc3RydWN0IGZpbGUgcG9pbnRlciB3aGlsZSBmaWxlIG9wZW5pbmcgaXMgc3VjY2VzcworICogQHBhcmFtIHBhdGggdGhlIHBhdGggb2YgdGhlIGZpbGUgdG8gb3BlbgorICogQHBhcmFtIGZsYWcgZmlsZSBvcGVyYXRpb24gZmxhZ3MsIHBsZWFzZSByZWZlciB0byBsaW51eCBkb2N1bWVudAorICogQHBhcmFtIG1vZGUgcGxlYXNlIHJlZmVyIHRvIGxpbnV4IGRvY3VtZW50CisgKiBAcmV0dXJuIExpbnV4IHNwZWNpZmljIGVycm9yIGNvZGUKKyAqLworc3RhdGljIGludCBvcGVu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6CisJCWJyZWFrOworCWNhc2UgQU5EUk9JRF9XSUZJX0NNRF9DT1VOVFJZOgorCQlieXRlc193cml0dGVuID0gYW5kcm9pZF9zZXRfY250cnkobmV0LCBjb21tYW5kLAorCQkJCQkJICBwcml2X2NtZC50b3RhbF9sZW4pOworCQlicmVhazsKKwljYXNlIEFORFJPSURfV0lGSV9DTURfUDJQX0RFVl9BRERSOgorCQlieXRlc193cml0dGVuID0gYW5kcm9pZF9nZXRfcDJwX2FkZHIobmV0LCBjb21tYW5kLAorCQkJCQkJICAgICBwcml2X2NtZC50b3RhbF9sZW4pOworCQlicmVhazsKKwljYXNlIEFORFJPSURfV0lGSV9DTURfUDJQX1NFVF9OT0E6CisJCWJyZWFrOworCWNhc2UgQU5EUk9JRF9XSUZJX0NNRF9QMlBfR0VUX05PQToKKwkJYnJlYWs7CisJY2FzZSBBTkRST0lEX1dJRklfQ01EX1AyUF9TRVRfUFM6CisJCWJyZWFrOworCWRlZmF1bHQ6CisJCURCR184OEUoIlVua25vd24gUFJJVkFURSBjb21tYW5kICVzIC0gaWdub3JlZFxuIiwgY29tbWFuZCk7CisJCXNucHJpbnRmKGNvbW1hbmQsIDMsICJPSyIpOworCQlieXRlc193cml0dGVuID0gc3RybGVuKCJPSyIpOworCX0KKworcmVzcG9uc2U6CisJaWYgKGJ5dGVzX3dyaXR0ZW4gPj0gMCkgeworCQlpZiAoKGJ5dGVzX3dyaXR0ZW4gPT0gMCkgJiYgKHByaXZfY21kLnRvdGFsX2xlbiA+IDApKQorCQkJY29tbWFuZFswXSA9ICdcMCc7CisJCWlmIChieXRlc193cml0dGVuID49IHByaXZfY21kLnRvdGFsX2xlbikgeworCQkJREJHXzg4RSgiJXM6IGJ5dGVzX3dyaXR0ZW4gPSAlZFxuIiwgX19mdW5jX18sCisJCQkJYnl0ZXNfd3JpdHRlbik7CisJCQlieXRlc193cml0dGVuID0gcHJpdl9jbWQudG90YWxfbGVuOworCQl9IGVsc2UgeworCQkJYnl0ZXNfd3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+c2lnbmFsID0gMHgwYTsKICAgICAgICAgZWxzZSAvLyBsb25nIHByZWFtYmxlCi0gICAgICAgICAgICAqcGJ5UGh5U2duID0gMHgwMjsKKwkJcGh5LT5zaWduYWwgPSAweDAyOwogICAgICAgICBicmVhazsKIAogICAgIGNhc2UgUkFURV8xMU0gOgpAQCAtNzg0LDEwMyArNzgzLDEwMiBAQAogICAgICAgICAgICAgICAgIGJFeHRCaXQgPSB0cnVlOwogICAgICAgICB9CiAgICAgICAgIGlmIChieVByZWFtYmxlVHlwZSA9PSAxKQotICAgICAgICAgICAgKnBieVBoeVNnbiA9IDB4MGI7CisJCXBoeS0+c2lnbmFsID0gMHgwYjsKICAgICAgICAgZWxzZSAvLyBsb25nIHByZWFtYmxlCi0gICAgICAgICAgICAqcGJ5UGh5U2duID0gMHgwMzsKKwkJcGh5LT5zaWduYWwgPSAweDAzOwogICAgICAgICBicmVhazsKIAogICAgIGNhc2UgUkFURV82TSA6CiAgICAgICAgIGlmKGJ5UGFja2V0VHlwZSA9PSBQS19UWVBFXzExQSkgey8vMTFhLCA1R0haCi0gICAgICAgICAgICAqcGJ5UGh5U2duID0gMHg5QjsgLy8xMDAxIDEwMTEKKwkJcGh5LT5zaWduYWwgPSAweDliOwogICAgICAgICB9CiAgICAgICAgIGVsc2Ugey8vMTFnLCAyLjRHSFoKLSAgICAgICAgICAgICpwYnlQaHlTZ24gPSAweDhCOyAvLzEwMDAgMTAxMQorCQlwaHktPnNpZ25hbCA9IDB4OGI7CiAgICAgICAgIH0KICAgICAgICAgYnJlYWs7CiAKICAgICBjYXNlIFJBVEVfOU0gOgogICAgICAgICBpZihieVBhY2tldFR5cGUgPT0gUEtfVFlQRV8xMUEpIHsvLzExYSwgNUdIWgotICAgICAgICAgICAgKnBieVBoeVNnbiA9IDB4OUY7IC8vMTAwMSAxMTExCisJCXBoeS0+c2lnbmFsID0gMHg5ZjsKICAgICAgICAgfQogICAgICAgICBlbHNlIHsvLzExZywgMi40R0haCi0gICAgICAgICAgICAqcGJ5UGh5U2duID0gMHg4RjsgLy8xMDAwIDExMTEKKwkJcGh5LT5zaWduYWwgPSAweDhmOwogICAgICAgICB9CiAgICAgICAgIGJyZWFrOwogCiAgICAgY2FzZSBSQVRFXzEyTSA6CiAgICAgICAgIGlmKGJ5UGFja2V0VHlwZSA9PSBQS19UWVBFXzExQSkgey8vMTFhLCA1R0haCi0gICAgICAgICAgICAqcGJ5UGh5U2duID0gMHg5QTsgLy8xMDAxIDEwMTAKKwkJcGh5LT5zaWduYWwgPSAweDlhOwogICAgICAgICB9CiAgICAgICAgIGVsc2Ugey8vMTFnLCAyLjRHSFoKLSAgICAgICAgICAgICpwYnlQaHlTZ24gPSAweDhBOyAvLzEwMDAgMTAxMAorCQlwaHktPnNpZ25hbCA9IDB4OGE7CiAgICAgICAgIH0KICAgICAgICAgYnJlYWs7CiAKICAgICBjYXNlIFJBVEVfMThNIDoKICAgICAgICAgaWYoYnlQYWNrZXRUeXBlID09IFBLX1RZUEVfMTFBKSB7Ly8xMWEsIDVHSFoKLSAgICAgICAgICAgICpwYnlQaHlTZ24gPSAweDlFOyAvLzEwMDEgMTExMAorCQlwaHktPnNpZ25hbCA9IDB4OWU7CiAgICAgICAgIH0KICAgICAgICAgZWxzZSB7Ly8xMWcsIDIuNEdIWgotICAgICAgICAgICAgKnBieVBoeVNnbiA9IDB4OEU7IC8vMTAwMCAxMTEwCisJCXBoeS0+c2lnbmFsID0gMHg4ZTsKICAgICAgICAgfQogICAgICAgICBicmVhazsKIAogICAgIGNhc2UgUkFURV8yNE0gOgogICAgICAgICBpZihieVBhY2tldFR5cGUgPT0gUEtfVFlQRV8xMUEpIHsvLzExYSwgNUdIWgotICAgICAgICAgICAgKnBieVBoeVNnbiA9IDB4OTk7IC8vMTAwMSAxMDAxCisJCXBoeS0+c2lnbmFsID0gMHg5OTsKICAgICAgICAgfQogICAgICAgICBlbHNlIHsvLzExZywgMi40R0haCi0gICAgICAgICAgICAqcGJ5UGh5U2duID0gM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AwMCAxMTAwCisJCXBoeS0+c2lnbmFsID0gMHg4YzsKICAgICAgICAgfQogICAgICAgICBicmVhazsKIAogICAgIGRlZmF1bHQgOgogICAgICAgICBpZiAoYnlQYWNrZXRUeXBlID09IFBLX1RZUEVfMTFBKSB7Ly8xMWEsIDVHSFoKLSAgICAgICAgICAgICpwYnlQaHlTZ24gPSAweDlDOyAvLzEwMDEgMTEwMAorCQlwaHktPnNpZ25hbCA9IDB4OWM7CiAgICAgICAgIH0KICAgICAgICAgZWxzZSB7Ly8xMWcsIDIuNEdIWgotICAgICAgICAgICAgKnBieVBoeVNnbiA9IDB4OEM7IC8vMTAwMCAxMTAwCisJCXBoeS0+c2lnbmFsID0gMHg4YzsKICAgICAgICAgfQogICAgICAgICBicmVhazsKICAgICB9CiAKLSAgICBpZiAoYnlQYWNrZXRUeXBlID09IFBLX1RZUEVfMTFCKSB7Ci0gICAgICAgICpwYnlQaHlTcnYgPSAweDAwOwotICAgICAgICBpZiAoYkV4dEJpdCkKLSAgICAgICAgICAgICpwYnlQaHlTcnYgPSAqcGJ5UGh5U3J2IHwgMHg4MDsKLSAgICAgICAgKnB3UGh5TGVuID0gKHUxNikgY2JVc0NvdW50OwotICAgIH0KLSAgICBlbHNlIHsKLSAgICAgICAgKnBieVBoeVNydiA9IDB4MDA7Ci0gICAgICAgICpwd1BoeUxlbiA9ICh1MTYpY2JGcmFtZUxlbmd0aDsKLSAgICB9CisJaWYgKGJ5UGFja2V0VHlwZSA9PSBQS19UWVBFXzExQikgeworCQlwaHktPnNlcnZpY2UgPSAweDAwOworCQlpZiAoYkV4dEJpdCkKKwkJCXBoeS0+c2VydmljZSB8PSAweDgwOworCQlwaHktPmxlbiA9IGNwdV90b19sZTE2KCh1MTYpY2JVc0NvdW50KTsKKwl9IGVsc2UgeworCQlwaHktPnNlcnZpY2UgPSAweDAwOworCQlwaHktPmxlbiA9IGNwdV90b19sZTE2KCh1MTYpY2JGcmFtZUxlbmd0aCk7CisJfQogfQogCiAvK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WxjdWxhdGVQYXJhbWV0ZXIocERldmljZSwgMTQsCisJCXN3R2V0Q0NLQ29udHJvbFJhdGUocERldmljZSwgUkFURV8xTSksIFBLX1RZUEVfMTFCLCAmcGh5WzBdKTsKIAogICAgIC8vL1JTUElORl9iXzIKLSAgICBCQnZDYWxjdWxhdGVQYXJhbWV0ZXIocERldmljZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAxNCwKLSAgICAgICAgICAgICAgICAgICAgICAgICBzd0dldENDS0NvbnRyb2xSYXRlKHBEZXZpY2UsIFJBVEVfMk0pLAotICAgICAgICAgICAgICAgICAgICAgICAgIFBLX1RZUEVfMTFCLAotICAgICAgICAgICAgICAgICAgICAgICAgICZhd0xlblsxXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAmYWJ5U2VydlsxXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAmYWJ5U2lnbmFsWzFdCi0gICAgKTsKKwlCQnZDYWxjdWxhdGVQYXJhbWV0ZXIocERldmljZSwgMTQsCisJCXN3R2V0Q0NLQ29udHJvbFJhdGUocERldmljZSwgUkFURV8yTSksIFBLX1RZUEVfMTFCLCAmcGh5WzFdKTsKIAogICAgIC8vUlNQSU5GX2JfNQotICAgIEJCdkNhbGN1bGF0ZVBhcmFtZXRlcihwRGV2aWNlLAotICAgICAgICAgICAgICAgICAgICAgICAgIDE0LAotICAgICAgICAgICAgICAgICAgICAgICAgIHN3R2V0Q0NLQ29udHJvbFJhdGUocERldmljZSwgUkFURV81TSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgUEtfVFlQRV8xMUIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgJmF3TGVuWzJdLAotICAgICAgICAgICAgICAgICAgICAgICAgICZhYnlTZXJ2WzJdLAotICAgICAgICAgICAgICAgICAgICAgICAgICZhYnlTaWduYWxbMl0KLSAgICApOworCUJCdkNhbGN1bGF0ZVBhcmFtZXRlcihwRGV2aWNlLCAxNCwKKwkJc3dHZXRDQ0tDb250cm9sUmF0ZShwRGV2aWNlLCBSQVRFXzVNKSwgUEtfVFlQRV8xMUIsICZwaHlbMl0pOwogCiAgICAgLy9SU1BJTkZfYl8xMQotICAgIEJCdkNhbGN1bGF0ZVBhcmFtZXRlcihwRGV2aWNlLAotICAgICAgICAgICAgICAgICAgICAgICAgIDE0LAotICAgICAgICAgICAgICAgICAgICAgICAgIHN3R2V0Q0NLQ29udHJvbFJhdGUocERldmljZSwgUkFURV8xMU0pLAotICAgICAgICAgICAgICAgICAgICAgICAgIFBLX1RZUEVfMTFCLAotICAgICAgICAgICAgICAgICAgICAgICAgICZhd0xlblszXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAmYWJ5U2VydlszXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAmYWJ5U2lnbmFsWzNdCi0gICAgKTsKKwlCQnZDYWxjdWxhdGVQYXJhbWV0ZXIocERldmljZSwgMTQsCisJCXN3R2V0Q0NLQ29udHJvbFJhdGUocERldmljZSwgUkFURV8xMU0pLCBQS19UWVBFXzExQiwgJnBoeVszXSk7CiAKICAgICAvL1JTUElORl9hXzYKICAgICBDQVJEdkNhbGN1bGF0ZU9GRE1SUGFyYW1ldGVyIChSQVRFXzZNLApAQCAtNDIxLDI1ICszOTUsMjEgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZhYnlUeFJhdGVbOF0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmYWJ5UnN2VGltZVs4XSk7CiAKLSAgICBhYnlEYXRhWzBdID0gKHU4KShhd0xlblswXSYweEZGKTsKLSAgICBhYnlEYXRhWzFdID0gKHU4KShhd0xlblswXT4+OCk7Ci0gICAgYWJ5RGF0YVsyXSA9IGFieVNpZ25hbFswXTsKLSAgICBhYnlEYXRhWzNdID0gYWJ5U2VydlswXTsKKwlwdXRfdW5hbGlnbmVkKHBoeVswXS5sZW4sICh1MTYgKikmYWJ5RGF0YVswXSk7CisJYWJ5RGF0YVsyXSA9IHBoeVswXS5za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zc3Miw3IEBACiAKICNkZWZpbmUgRGVxdWV1ZVJDQihIZWFkLCBUYWlsKSAgICAgICAgICAgICAgICAgICAgICAgICAgXAogeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgUFJDQiAgIFJDQiA9IEhlYWQ7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICBzdHJ1Y3Qgdm50X3JjYiAqUkNCID0gSGVhZDsgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgIGlmICghUkNCLT5OZXh0KSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAgICAgICAgIFRhaWwgPSBOVUxMOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICB9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXApkaWZmIC0tZ2l0IGEvZHJpdmVycy9zdGFnaW5nL3Z0NjY1Ni9kZXZpY2VfY2ZnLmggYi9kcml2ZXJzL3N0YWdpbmcvdnQ2NjU2L2RldmljZV9jZmcuaAppbmRleCBlYTY2Yjk3Li5hOTdmN2JiIDEwMDY0NAotLS0gYS9kcml2ZXJzL3N0YWdpbmcvdnQ2NjU2L2RldmljZV9jZmcuaAorKysgYi9kcml2ZXJzL3N0YWdpbmcvdnQ2NjU2L2RldmljZV9jZmcuaApAQCAtODIsMTggKzgyLDQgQEAKICAgICBWVDMxODQgPSAxCiB9IENISVBfVFlQRSwgKlBDSElQX1RZUEU7CiAKLSNpZmRlZiBWSUFXRVRfREVCVUcKLSNkZWZpbmUgQVNTRVJUKHgpIHsgXAotICAgIGlmICghKHgpKSB7IFwKLQlwcmludGsoS0VSTl9FUlIgImFzc2VydGlvbiAlcyBmYWlsZWQ6IGZpbGUgJXMgbGluZSAlZFxuIiwgI3gsIFwKLSAgICAgICAgX19GVU5DVElPTl9fLCBfX0xJTkVfXyk7XAotCSooaW50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W5zbWl0S2V5LT53VFNDMTVfMCA9PSAwKQorCQkJcFRyYW5zbWl0S2V5LT5kd1RTQzQ3XzE2Kys7CiAKLSAgICAgICAgLy9GaWxsIE1JQ0hEUjAKLSAgICAgICAgKnBNSUNIRFIgPSAweDU5OwotICAgICAgICAqKCh1OCAqKShwTUlDSERSKzEpKSA9IDA7IC8vIFR4UHJpb3JpdHkKLSAgICAgICAgbWVtY3B5KHBNSUNIRFIrMiwgJihwTUFDSGVhZGVyLT5hZGRyMlswXSksIDYpOwotICAgICAgICAqKCh1OCAqKShwTUlDSERSKzgpKSA9IEhJQllURShISVdPUkQocFRyYW5zbWl0S2V5LT5kd1RTQzQ3XzE2KSk7Ci0gICAgICAgICooKHU4ICopKHBNSUNIRFIrOSkpID0gTE9CWVRFKEhJV09SRChwVHJhbnNtaXRLZXktPmR3VFNDNDdfMTYpKTsKLSAgICAgICAgKigodTggKikocE1JQ0hEUisxMCkpID0gSElCWVRFKExPV09SRChwVHJhbnNtaXRLZXktPmR3VFNDNDdfMTYpKTsKLSAgICAgICAgKigodTggKikocE1JQ0hEUisxMSkpID0gTE9CWVRFKExPV09SRChwVHJhbnNtaXRLZXktPmR3VFNDNDdfMTYpKTsKLSAgICAgICAgKigodTggKikocE1JQ0hEUisxMikpID0gSElCWVRFKHBUcmFuc21pdEtleS0+d1RTQzE1XzApOwotICAgICAgICAqKCh1OCAqKShwTUlDSERSKzEzKSkgPSBMT0JZVEUocFRyYW5zbWl0S2V5LT53VFNDMTVfMCk7Ci0gICAgICAgICooKHU4ICopKHBNSUNIRFIrMTQpKSA9IEhJQllURSh3UGF5bG9hZExlbik7Ci0gICAgICAgICooKHU4ICopKHBNSUNIRFIrMTUpKSA9IExPQllURSh3UGF5bG9hZExlbik7CisJCVRLSVB2TWl4S2V5KHBUcmFuc21pdEtleS0+YWJ5S2V5LCBwRGV2aWNlLT5hYnlDdXJyZW50TmV0QWRkciwKKwkJCXBUcmFuc21pdEtleS0+d1RTQzE1XzAsIHBU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3RUeXBlLCAxNCwgcERldmljZS0+YnlUb3BPRkRNQmFzaWNSYXRlKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gKHBEZXZpY2UtPnVTSUZTICsgdUFja1RpbWUpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gMDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlIHsvL0ZpcnN0IEZyYWcgb3IgTWlkIEZyYWcKLSAgICAgICAgICAgIGlmKHVGcmFnSWR4ID09ICh1TUFDZnJhZ051bS0yKSl7Ci0gICAgICAgICAgICAJdU5leHRQa3RUaW1lID0gc191R2V0VHhSc3ZUaW1lKHBEZXZpY2UsIGJ5UGt0VHlwZSwgY2JMYXN0RnJhZ21lbnRTaXplLCB3UmF0ZSwgYk5lZWRBY2spOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICB1TmV4dFBrdFRpbWUgPSBzX3VHZXRUeFJzdlRpbWUocERldmljZSwgYnlQa3RUeXBlLCBjYkZyYW1lTGVuZ3RoLCB3UmF0ZSwgYk5lZWRBY2spOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYoYk5lZWRBY2spewotICAgICAgICAgICAgCXVBY2tUaW1lID0gQkJ1R2V0RnJhbWVUaW1lKHBEZXZpY2UtPmJ5UHJlYW1ibGVUeXBlLCBieVBrdFR5cGUsIDE0LCBwRGV2aWNlLT5ieVRvcE9GRE1CYXNpY1JhdGUpOwotICAgICAgICAgICAgICAgIHJldHVybiAocERldmljZS0+dVNJRlMgKyB1QWNrVGltZSArIHVOZXh0UGt0VGltZSk7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHJldHVybiAocERldmljZS0+dVNJRlMgKyB1TmV4dFBrdFRpbWUpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGJyZWFrOwotCi0gICAgY2FzZSBEQVRBRFVSX0FfRjA6ICAgIC8vREFUQURVUl9BX0YwCi0JICAgIGlmICgoKHVNQUNmcmFnTnVtPT0xKSkgfHwgKGJMYXN0RnJhZz09MSkpIHsvL05vbiBGcmFnIG9yIExhc3QgRnJhZwotICAgICAgICAgICAgaWYoYk5lZWRBY2spewotICAgICAgICAgICAgCXVBY2tUaW1lID0gQkJ1R2V0RnJhbWVUaW1lKHBEZXZpY2UtPmJ5UHJlYW1ibGVUeXBlLCBieVBrdFR5cGUsIDE0LCBwRGV2aWNlLT5ieVRvcE9GRE1CYXNpY1JhdGUpOwotICAgICAgICAgICAgICAgIHJldHVybiAocERldmljZS0+dVNJRlMgKyB1QWNrVGltZSk7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHJldHVybiAwOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0JICAgIGVsc2UgeyAvL0ZpcnN0IEZyYWcgb3IgTWlkIEZyYWcKLQkgICAgICAgIGlmIChieUZCT3B0aW9uID09IEFVVE9fRkJfMCkgewotICAgICAgICAgICAgICAgIGlmICh3UmF0ZSA8IFJBVEVfMThNKQotICAgICAgICAgICAgICAgICAgICB3UmF0ZSA9IFJBVEVfMThNOwotICAgICAgICAgICAgICAgIGVsc2UgaWYgKHdSYXRlID4gUkFURV81NE0pCi0gICAgICAgICAgICAgICAgICAgIHdSYXRlID0gUkFURV81NE07Ci0KLQkgICAgICAgICAgICBpZih1RnJhZ0lkeCA9PSAodU1BQ2ZyYWdOdW0tMikpewotICAgICAgICAgICAgCSAgICB1TmV4dFBrdFRpbWUgPSBzX3VHZXRUeFJzdlRpbWUocERldmljZSwgYnlQa3RUeXBlLCBjYkxhc3RGcmFnbWVudFNpemUsIHdGQl9PcHQwW0ZCX1JBVEUwXVt3UmF0ZS1SQVRFXzE4TV0sIGJOZWVkQWNrKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICB1TmV4dFBrdFRpbWUgPSBzX3VHZXRUeFJzdlRpbWUocERldmlj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8vR2V0IER1cmF0aW9uIGFuZCBUaW1lU3RhbXBPZmYKLSAgICAgICAgICAgIHBCdWYtPndEdXJhdGlvbiA9ICh1MTYpc191R2V0RGF0YUR1cmF0aW9uKHBEZXZpY2UsIERBVEFEVVJfQSwgY2JGcmFtZUxlbmd0aCwgYnlQa3RUeXBlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdDdXJyZW50UmF0ZSwgYk5lZWRBY2ssIHVGcmFnSWR4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNiTGFzdEZyYWdtZW50U2l6ZSwgdU1BQ2ZyYWdOdW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnlGQk9wdGlvbik7IC8vMTogMi40R0h6Ci0gICAgICAgICAgICBpZih1RE1BSWR4IT1UWVBFX0FUSU1ETUEpIHsKLSAgICAgICAgICAgICAgICBwQnVmLT53VGltZVN0YW1wT2ZmID0gd1RpbWVTdGFtcE9mZltwRGV2aWNlLT5ieVByZWFtYmxlVHlwZSUyXVt3Q3VycmVudFJhdGUlTUFYX1JBVEVdOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIChwQnVmLT53RHVyYXRpb24pOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgeyAvLyBEQVRBICYgTUFOQUdFIEZyYW1lCiAgICAgICAgICAgICBpZiAoYnlGQk9wdGlvbiA9PSBBVVRPX0ZCX05PTkUpIHsKLSAgICAgICAgICAgICAgICBQU1R4RGF0YUhlYWRfZyBwQnVmID0gKFBTVHhEYXRhSGVhZF9nKXBUeERhdGFIZWFkOworCQlzdHJ1Y3Qgdm50X3R4X2RhdGFoZWFkX2cgKnBCdWYgPQorCQkJCShzdHJ1Y3Qgdm50X3R4X2RhdGFoZWFkX2cgKilwVHhEYXRhSGVhZDsKICAgICAgICAgICAgICAgIC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FUQURVUl9BLCBjYkZyYW1lTGVuZ3RoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5UGt0VHlwZSwgd0N1cnJlbnRSYXRlLCBiTmVlZEFjaywgdUZyYWdJZHgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2JMYXN0RnJhZ21lbnRTaXplLCB1TUFDZnJhZ051bSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBieUZCT3B0aW9uKTsgLy8xOiAyLjRHSHoKLSAgICAgICAgICAgICAgICBwQnVmLT53RHVyYXRpb25fYiA9ICh1MTYpc191R2V0RGF0YUR1cmF0aW9uKHBEZXZpY2UsIERBVEFEVVJfQiwgY2JGcmFtZUxlbmd0aCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQS19UWVBFXzExQiwgcERldmljZS0+YnlUb3BDQ0tCYXNpY1JhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYk5lZWRBY2ssIHVGcmFnSWR4LCBjYkxhc3RGcmFnbWVudFNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdU1BQ2ZyYWdOdW0sIGJ5RkJPcHRpb24pOyAvLzE6IDIuNEdIegorCQlwQnVmLT53RHVyYXRpb25fYSA9IHNfdUdldERhdGFEdXJhdGlvbihwRGV2aWNlLAorCQkJCQkJCWJ5UGt0VHlwZSwgYk5lZWRBY2spOworCQlwQnVmLT53RHVyYXRpb25fYiA9IHNfdUdldERhdGFEdXJhdGlvbihwRGV2aWNlLAorCQkJCQkJCVBLX1RZUEVfMTFCLCBiTmVlZEFjayk7CiAKLSAgIC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W5kIFRpbWVTdGFtcE9mZgotICAgICAgICAgICAgcEJ1Zi0+d0R1cmF0aW9uID0gKHUxNilzX3VHZXREYXRhRHVyYXRpb24ocERldmljZSwgREFUQURVUl9BLCBjYkZyYW1lTGVuZ3RoLCBieVBrdFR5cGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd0N1cnJlbnRSYXRlLCBiTmVlZEFjaywgdUZyYWdJZHgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2JMYXN0RnJhZ21lbnRTaXplLCB1TUFDZnJhZ051bSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBieUZCT3B0aW9uKTsKLQotICAgICAgICAgICAgaWYodURNQUlkeCE9VFlQRV9BVElNRE1BKSB7Ci0gICAgICAgICAgICAgICAgcEJ1Zi0+d1RpbWVTdGFtcE9mZiA9IHdUaW1lU3RhbXBPZmZbcERldmljZS0+YnlQcmVhbWJsZVR5cGUlMl1bd0N1cnJlbnRSYXRlJU1BWF9SQVRFXTsKLSAgICAgICAgICAgIH0KKwkJcEJ1Zi0+d0R1cmF0aW9uID0gc191R2V0RGF0YUR1cmF0aW9uKHBEZXZpY2UsCisJCQkJYnlQa3RUeXBlLCBiTmVlZEFjayk7CisJCXBCdWYtPndUaW1lU3RhbXBPZmYgPSB2bnRfdGltZV9zdGFtcF9vZmYocERldmljZSwKKwkJCQkJCQkJd0N1cnJlbnRSYXRlKTsKICAgICAgICAgICAgIHJldHVybiAocEJ1Zi0+d0R1cmF0aW9uKTsKICAgICAgICAgfQogICAgIH0KICAgICBlbHNlIGlmIChieVBrdFR5cGUgPT0gUEtfVFlQRV8xMUIpIHsKLSAgICAgICAgICAgIFBTVHhEYXRhSGVhZF9hYiBwQnVmID0gKFBTVHhEYXRhSGVhZF9hYilwVHhEYXRhSGVhZDsKKwkJc3RydWN0IHZudF90eF9kYXRhaGVhZF9hYiAqcEJ1ZiA9CisJCQkoc3RydWN0IHZudF90eF9kYXRhaGVhZF9hYiAqKXBUeERhdGFIZWFkOwogICAgICAgICAgICAgLy9HZXQgU2lnbmFsRmllbGQsU2VydmljZUZpZWxkLExlbmd0aAotICAgICAgICAgICAgQkJ2Q2FsY3VsYXRlUGFyYW1ldGVyKHBEZXZpY2UsIGNiRnJhbWVMZW5ndGgsIHdDdXJyZW50UmF0ZSwgYnlQa3RUeXBlLAotICAgICAgICAgICAgICAgICh1MTYgKikmKHBCdWYtPndUcmFuc21pdExlbmd0aCksICh1OCAqKSYocEJ1Zi0+YnlTZXJ2aWNlRmllbGQpLCAodTggKikmKHBCdWYtPmJ5U2lnbmFsRmllbGQpCi0gICAgICAgICAgICApOworCQlCQnZDYWxjdWxhdGVQYXJhbWV0ZXIocERldmljZSwgY2JGcmFtZUxlbmd0aCwgd0N1cnJlbnRSYXRlLAorCQkJYnlQa3RUeXBlLCAmcEJ1Zi0+YWIpOwogICAgICAgICAgICAgLy9HZXQgRHVyYXRpb24gYW5kIFRpbWVTdGFtcE9mZgotICAgICAgICAgICAgcEJ1Zi0+d0R1cmF0aW9uID0gKHUxNilzX3VHZXREYXRhRHVyYXRpb24ocERldmljZSwgREFUQURVUl9CLCBjYkZyYW1lTGVuZ3RoLCBieVBrdFR5cGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd0N1cnJlbnRSYXRlLCBiTmVlZEFjaywgdUZyYWdJZHgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2JMYXN0RnJhZ21lbnRTaXplLCB1TUFDZnJhZ051bSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBieUZCT3B0aW9uKTsKLSAgICAgICAgICAgIGlmICh1RE1BSWR4ICE9IFRZUEVfQVRJTURNQSk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Q1RTCi0gICAgdTggICAgICAgICAgICBieUNUU1NpZ25hbEZpZWxkX2I7Ci0gICAgdTggICAgICAgICAgICBieUNUU1NlcnZpY2VGaWVsZF9iOwotICAgIHUxNiAgICAgICAgICAgIHdDVFNUcmFuc21pdExlbmd0aF9iOwotICAgIHUxNiAgICAgICAgICAgIHdDVFNEdXJhdGlvbl9iYTsKLSAgICB1MTYgICAgICAgICAgICB3UmVzZXJ2ZWQzOwotICAgIFNDVFNEYXRhRiAgICAgICBzQ1RTOworc3RydWN0IHZudF9jdHNfZmIgeworCXN0cnVjdCB2bnRfcGh5X2ZpZWxkIGI7CisJdTE2IHdEdXJhdGlvbl9iYTsKKwl1MTYgd1Jlc2VydmVkOworCXUxNiB3Q1RTRHVyYXRpb25fYmFfZjA7CisJdTE2IHdDVFNEdXJhdGlvbl9iYV9mMTsKKwlzdHJ1Y3QgaWVlZTgwMjExX2N0cyBkYXRhOworCXUxNiByZXNlcnZlZDI7Cit9IF9fcGFja2VkOwogCi0gICAgLy9EYXRhCi0gICAgdTggICAgICAgICAgICBieVNpZ25hbEZpZWxkX2I7Ci0gICAgdTggICAgICAgICAgICBieVNlcnZpY2VGaWVsZF9iOwotICAgIHUxNiAgICAgICAgICAgIHdUcmFuc21pdExlbmd0aF9iOwotICAgIHU4ICAgICAgICAgICAgYnlTaWduYWxGaWVsZF9hOwotICAgIHU4ICAgICAgICAgICAgYnlTZXJ2aWNlRmllbGRfYTsKLSAgICB1MTYgICAgICAgICAgICB3VHJhbnNtaXRMZW5ndGhfYTsKLSAgICB1MTYgICAgICAgICAgICB3RHVyYXRpb25fYjsKLSAgICB1MTYgICAgICAgICAgICB3RHVyYXRpb25fYTsKLSAgICB1MTYgICAgICAgICAgICB3VGltZVN0YW1wT2ZmX2I7Ci0gICAgdTE2ICAgICAgICAgICAgd1RpbWVTdGFtcE9mZl9hOwordW5pb24gdm50X3R4X2RhdGFfaGVhZCB7CisJLyogcnRzIGcgKi8KKwlzdHJ1Y3Qgdm50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BzdHJ1Y3QgdGFnU1RYX05BRl9BQl9SVFMKLXsKLSAgICAvL1JzdlRpbWUKLSAgICB1MTYgICAgICAgICAgICB3UlRTVHhScnZUaW1lX2FiOwotICAgIHUxNiAgICAgICAgICAgIHdUeFJydlRpbWVfYWI7Ci0KLSAgICAvL1JUUwotICAgIHU4ICAgICAgICAgICAgYnlSVFNTaWduYWxGaWVsZF9hYjsKLSAgICB1OCAgICAgICAgICAgIGJ5UlRTU2VydmljZUZpZWxkX2FiOwotICAgIHUxNiAgICAgICAgICAgIHdSVFNUcmFuc21pdExlbmd0aF9hYjsKLSAgICB1MTYgICAgICAgICAgICB3UlRTRHVyYXRpb25fYWI7Ci0gICAgdTE2ICAgICAgICAgICAgd1Jlc2VydmVkMjsKLSAgICBTUlRTRGF0YUYgICAgICAgc1JUUzsKLQotICAgIC8vRGF0YQotICAgIHU4ICAgICAgICAgICAgYnlTaWduYWxGaWVsZF9hYjsKLSAgICB1OCAgICAgICAgICAgIGJ5U2VydmljZUZpZWxkX2FiOwotICAgIHUxNiAgICAgICAgICAgIHdUcmFuc21pdExlbmd0aF9hYjsKLSAgICB1MTYgICAgICAgICAgICB3RHVyYXRpb25fYWI7Ci0gICAgdTE2ICAgICAgICAgICAgd1RpbWVTdGFtcE9mZl9hYjsKLQotfSBUWF9OQUZfQUJfUlRTLCAqUFRYX05BRl9BQl9SVFM7Ci0KLXR5cGVkZWYgc3RydWN0IHRhZ1NUWF9OQUZfQUJfUlRTX01JQwotewotICAgIC8vUnN2VGltZQotICAgIHUxNiAgICAgICAgICAgIHdSVFNUeFJydlRpbWVfYWI7Ci0gICAgdTE2ICAgICAgICAgICAgd1R4UnJ2VGltZV9hYjsKLQotICAgIFNNSUNIRFIgICAgICAgICBzTUlDSERSOwotCi0gICAgLy9SVFMKLSAgICB1OCAgICAgICAgICAgIGJ5UlRTU2lnbmFsRmllbGRfYWI7Ci0gICAgdTggICAgICAgICAgICBieVJUU1NlcnZpY2VGaWVsZF9hYjsKLSA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gICAgdTE2ICAgICAgICAgICAgd1Jlc2VydmVkMjsKLSAgICB1MTYgICAgICAgICAgICB3VHhScnZUaW1lX2I7Ci0gICAgdTE2ICAgICAgICAgICAgd1R4UnJ2VGltZV9hOwotCi0gICAgLy9SVFMKLSAgICB1OCAgICAgICAgICAgIGJ5UlRTU2lnbmFsRmllbGRfYjsKLSAgICB1OCAgICAgICAgICAgIGJ5UlRTU2VydmljZUZpZWxkX2I7Ci0gICAgdTE2ICAgICAgICAgICAgd1JUU1RyYW5zbWl0TGVuZ3RoX2I7Ci0gICAgdTggICAgICAgICAgICBieVJUU1NpZ25hbEZpZWxkX2E7Ci0gICAgdTggICAgICAgICAgICBieVJUU1NlcnZpY2VGaWVsZF9hOwotICAgIHUxNiAgICAgICAgICAgIHdSVFNUcmFuc21pdExlbmd0aF9hOwotICAgIHUxNiAgICAgICAgICAgIHdSVFNEdXJhdGlvbl9iYTsKLSAgICB1MTYgICAgICAgICAgICB3UlRTRHVyYXRpb25fYWE7Ci0gICAgdTE2ICAgICAgICAgICAgd1JUU0R1cmF0aW9uX2JiOwotICAgIHUxNiAgICAgICAgICAgIHdSZXNlcnZlZDM7Ci0gICAgdTE2ICAgICAgICAgICAgd1JUU0R1cmF0aW9uX2JhX2YwOwotICAgIHUxNiAgICAgICAgICAgIHdSVFNEdXJhdGlvbl9hYV9mMDsKLSAgICB1MTYgICAgICAgICAgICB3UlRTRHVyYXRpb25fYmFfZjE7Ci0gICAgdTE2ICAgICAgICAgICAgd1JUU0R1cmF0aW9uX2FhX2YxOwotICAgIFNSVFNEYXRhRiAgICAgICBzUlRTOwotCi0gICAgLy9EYXRhCi0gICAgdTggICAgICAgICAgICBieVNpZ25hbEZpZWxkX2I7Ci0gICAgdTggICAgICAgICAgICBieVNlcnZpY2VGaWVsZF9iOwotICAgIHUxNiAgICAgICAgICAgIHdUcmFuc21pdExlbmd0aF9iOwotICAgIHU4ICAgICAgICAgICAgYnlTaWduYWxGaWVsZF9hOwotICAgIHU4ICAgICAgICAgICAgYnlTZXJ2aWNlRmllbGRfYTsKLSAgICB1MTYgICAgICAgICAgICB3VHJhbnNtaXRMZW5ndGhfYTsKLSAgICB1MTYgICAgICAgICAgICB3RHVyYXRpb25fYjsKLSAgICB1MTYgICAgICAgICAgICB3RHVyYXRpb25fYTsKLSAgICB1MTYgICAgICAgICAgICB3RHVyYXRpb25fYV9mMDsKLSAgICB1MTYgICAgICAgICAgICB3RHVyYXRpb25fYV9mMTsKLSAgICB1MTYgICAgICAgICAgICB3VGltZVN0YW1wT2ZmX2I7Ci0gICAgdTE2ICAgICAgICAgICAgd1RpbWVTdGFtcE9mZl9hOwotCi19IFRYX0FGX0dfUlRTLCAqUFRYX0FGX0dfUlRTOwotCi10eXBlZGVmIHN0cnVjdCB0YWdTVFhfQUZfR19SVFNfTUlDCi17Ci0gICAgLy9Sc3ZUaW1lCi0gICAgdTE2ICAgICAgICAgICAgd1JUU1R4UnJ2VGltZV9iYTsKLSAgICB1MTYgICAgICAgICAgICB3UlRTVHhScnZUaW1lX2FhOwotICAgIHUxNiAgICAgICAgICAgIHdSVFNUeFJydlRpbWVfYmI7Ci0gICAgdTE2ICAgICAgICAgICAgd1Jlc2VydmVkMjsKLSAgICB1MTYgICAgICAgICAgICB3VHhScnZUaW1lX2I7Ci0gICAgdTE2ICAgICAgICAgICAgd1R4UnJ2VGltZV9hOwotCi0gICAgU01JQ0hEUiAgICAgICAgIHNNSUNIRFI7Ci0KLSAgICAvL1JUUwotICAgIHU4ICAgICAgICAgICAgYnlSVFNTaWduYWxGaWVsZF9iOwotICAgIHU4ICAgICAgICAgICAgYnlSVFNTZXJ2aWNlRmllbGRfYjsKLSAgICB1MTYgICAgICAgICAgICB3UlRTVHJhbnNtaXRMZW5ndGhfYjsKLSAgICB1OCAgICAgICAgICAgIGJ5UlRTU2lnbmFsRmllbGRfYTsKLSAgICB1OCAgICAgICAgICAgIGJ5UlRTU2VydmljZUZpZWxkX2E7Ci0gICAgdTE2ICAgICAgICAgIC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zsKLQotdHlwZWRlZiBzdHJ1Y3QgdGFnU1RYX0FGX0dfQ1RTCi17Ci0gICAgLy9Sc3ZUaW1lCi0gICAgdTE2ICAgICAgICAgICAgd0NUU1R4UnJ2VGltZV9iYTsKLSAgICB1MTYgICAgICAgICAgICB3UmVzZXJ2ZWQyOwotICAgIHUxNiAgICAgICAgICAgIHdUeFJydlRpbWVfYjsKLSAgICB1MTYgICAgICAgICAgICB3VHhScnZUaW1lX2E7Ci0KLSAgICAvL0NUUwotICAgIHU4ICAgICAgICAgICAgYnlDVFNTaWduYWxGaWVsZF9iOwotICAgIHU4ICAgICAgICAgICAgYnlDVFNTZXJ2aWNlRmllbGRfYjsKLSAgICB1MTYgICAgICAgICAgICB3Q1RTVHJhbnNtaXRMZW5ndGhfYjsKLSAgICB1MTYgICAgICAgICAgICB3Q1RTRHVyYXRpb25fYmE7Ci0gICAgdTE2ICAgICAgICAgICAgd1Jlc2VydmVkMzsKLSAgICB1MTYgICAgICAgICAgICB3Q1RTRHVyYXRpb25fYmFfZjA7Ci0gICAgdTE2ICAgICAgICAgICAgd0NUU0R1cmF0aW9uX2JhX2YxOwotICAgIFNDVFNEYXRhRiAgICAgICBzQ1RTOwotCi0gICAgLy9EYXRhCi0gICAgdTggICAgICAgICAgICBieVNpZ25hbEZpZWxkX2I7Ci0gICAgdTggICAgICAgICAgICBieVNlcnZpY2VGaWVsZF9iOwotICAgIHUxNiAgICAgICAgICAgIHdUcmFuc21pdExlbmd0aF9iOwotICAgIHU4ICAgICAgICAgICAgYnlTaWduYWxGaWVsZF9hOwotICAgIHU4ICAgICAgICAgICAgYnlTZXJ2aWNlRmllbGRfYTsKLSAgICB1MTYgICAgICAgICAgICB3VHJhbnNtaXRMZW5ndGhfYTsKLSAgICB1MTYgICAgICAgICAgICB3RHVyYXRpb25fYjsKLSAgICB1MTYgICAgICAgICAgICB3RHVyYXRpb25fYTsKLSAgICB1MTYgICAgICAgICAgICB3RHVyYXRpb25fYV9mMDsKLSAgICB1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ICB3VHJhbnNtaXRMZW5ndGhfYTsKLSAgICB1MTYgICAgICAgICAgICB3RHVyYXRpb25fYTsKLSAgICB1MTYgICAgICAgICAgICB3VGltZVN0YW1wT2ZmX2E7Ci0gICAgdTE2ICAgICAgICAgICAgd0R1cmF0aW9uX2FfZjA7Ci0gICAgdTE2ICAgICAgICAgICAgd0R1cmF0aW9uX2FfZjE7Ci0KLX0gVFhfQUZfQV9DVFNfTUlDLCAqUFRYX0FGX0FfQ1RTX01JQzsKLQotLy8KLS8vIHVuaW9uIHdpdGggYWxsIG9mIHRoZSBUWCBCdWZmZXIgVHlwZQotLy8KLXR5cGVkZWYgdW5pb24gdGFnVVRYX0JVRkZFUl9DT05UQUlORVIKLXsKLSAgICBUWF9OQUZfR19SVFMgICAgICAgICAgICAgICAgICAgIFJUU19HOwotICAgIFRYX05BRl9HX1JUU19NSUMgICAgICAgICAgICAgICAgUlRTX0dfTUlDOwotICAgIFRYX05BRl9HX0NUUyAgICAgICAgICAgICAgICAgICAgQ1RTX0c7Ci0gICAgVFhfTkFGX0dfQ1RTX01JQyAgICAgICAgICAgICAgICBDVFNfR19NSUM7Ci0gICAgLy9UWF9OQUZfR19CRUFDT04gICAgICAgICAgICAgICAgIEJlYWNvbl9HOwotICAgIFRYX05BRl9BQl9SVFMgICAgICAgICAgICAgICAgICAgUlRTX0FCOwotICAgIFRYX05BRl9BQl9SVFNfTUlDICAgICAgICAgICAgICAgUlRTX0FCX01JQzsKLSAgICBUWF9OQUZfQUJfQ1RTICAgICAgICAgICAgICAgICAgIENUU19BQjsKLSAgICBUWF9OQUZfQUJfQ1RTX01JQyAgICAgICAgICAgICAgIENUU19BQl9NSUM7Ci0gICAgLy9UWF9OQUZfQUJfQkVBQ09OICAgICAgICAgICAgICAgIEJlYWNvbl9BQjsKLSAgICBUWF9BRl9HX1JUUyAgICAgICAgICAgICAgICAgICAgIFJUU19HX0F1dG9GQjsKLSAgICBUWF9BRl9HX1JUU19NSUMgICAgICAgICAgICAgICAgIFJUU19HX0F1dG9GQl9NSUM7Ci0gICAgVFhfQUZfR19DVFMgICAgICAgICAgICAgICAgICAgICBDVFNfR19BdXRvRkI7Ci0gICAgVFhfQUZfR19DVFNfTUlDICAgICAgICAgICAgICAgICBDVFNfR19BdXRvRkJfTUlDOwotICAgIFRYX0FGX0FfUlRTICAgICAgICAgICAgICAgICAgICAgUlRTX0FfQXV0b0ZCOwotICAgIFRYX0FGX0FfUlRTX01JQyAgICAgICAgICAgICAgICAgUlRTX0FfQXV0b0ZCX01JQzsKLSAgICBUWF9BRl9BX0NUUyAgICAgICAgICAgICAgICAgICAgIENUU19BX0F1dG9GQjsKLSAgICBUWF9BRl9BX0NUU19NSUMgICAgICAgICAgICAgICAgIENUU19BX0F1dG9GQl9NSUM7Ci0KLX0gVFhfQlVGRkVSX0NPTlRBSU5FUiwgKlBUWF9CVUZGRVJfQ09OVEFJTkVSOwotCi0vLwotLy8gUmVtb3RlIE5ESVMgbWVzc2FnZSBmb3JtYXQKLS8vCi10eXBlZGVmIHN0cnVjdCB0YWdTVFhfQlVGRkVSCi17Ci0gICAgdTggICAgICAgICAgICAgICAgICAgICAgICAgICAgYnlUeXBlOwotICAgIHU4ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5UEtUTk87Ci0gICAgdTE2ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdUeEJ5dGVDb3VudDsKLQorc3RydWN0IHZudF90eF9idWZmZXIgeworCXU4IGJ5VHlwZTsKKwl1OCBieVBLVE5POworCXUxNiB3VHhCeXRlQ291bnQ7CiAJdTMyIGFkd1R4S2V5WzRdOwotICAgIHUxNiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3RklGT0N0bDsKLSAgICB1MTYgICAgICAgICAgICAgICAgICAgICAgICAgICAgd1RpbWVTdGFtcDsKLSAgICB1MTYgICAgICAgICAgICAgICAgICAgICAgICAgICAgd0ZyYWdDdGw7Ci0gICAgdTE2ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHd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xpbWl0RXhjZWVkZWQ6ICAgICAgJXVcbiIKLQkJICAgICJUeERpc2NhcmRzOiAgICAgICAgICAgICAgICAldVxuIgotCQkgICAgIlJ4VW5pY2FzdEZyYW1lczogICAgICAgICAgICV1XG4iCi0JCSAgICAiUnhNdWx0aWNhc3RGcmFtZXM6ICAgICAgICAgJXVcbiIKLQkJICAgICJSeEZyYWdtZW50czogICAgICAgICAgICAgICAldVxuIgotCQkgICAgIlJ4VW5pY2FzdE9jdGV0czogICAgICAgICAgICV1XG4iCi0JCSAgICAiUnhNdWx0aWNhc3RPY3RldHM6ICAgICAgICAgJXVcbiIKLQkJICAgICJSeEZDU0Vycm9yczogICAgICAgICAgICAgICAldVxuIgotCQkgICAgIlJ4RGlzY2FyZHNOb0J1ZmZlcjogICAgICAgICV1XG4iCi0JCSAgICAiVHhEaXNjYXJkc1dyb25nU0E6ICAgICAgICAgJXVcbiIKLQkJICAgICJSeFdFUFVuZGVjcnlwdGFibGU6ICAgICAgICAldVxuIgotCQkgICAgIlJ4TXNnSW5Nc2dGcmFnbWVudHM6ICAgICAgICV1XG4iCi0JCSAgICAiUnhNc2dJbkJhZE1zZ0ZyYWdtZW50czogICAgJXVcbiIKLQkJICAgICJSeERpc2NhcmRzV0VQSUNWRXJyb3I6ICAgICAldVxuIgotCQkgICAgIlJ4RGlzY2FyZHNXRVBFeGNsdWRlZDogICAgICV1XG4iCi0JCSAgICAsCi0JCSAgICAodW5zaWduZWQgaW50KXRhbGxpZXMuVHhVbmljYXN0RnJhbWVzLAotCQkgICAgKHVuc2lnbmVkIGludCl0YWxsaWVzLlR4TXVsdGljYXN0RnJhbWVzLAotCQkgICAgKHVuc2lnbmVkIGludCl0YWxsaWVzLlR4RnJhZ21lbnRzLAotCQkgICAgKHVuc2lnbmVkIGludCl0YWxsaWVzLlR4VW5pY2FzdE9jdGV0cywKLQkJICAgICh1bnNpZ25lZCBpbnQpdGFsbGllcy5UeE11bHRpY2FzdE9jdGV0cywKLQkJICAgICh1b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ICAgICAgICAgICAgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgICAgICAgICAgICAgWGlsbHlidXMgZHJpdmVyIGZvciBnZW5lcmljIEZQR0EgaW50ZXJmYWNlCisgICAgICAgICAgICAgICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworQXV0aG9yOiBFbGkgQmlsbGF1ZXIsIFhpbGx5YnVzIEx0ZC4gKGh0dHA6Ly94aWxseWJ1cy5jb20pCitFbWFpbDogIGVsaS5iaWxsYXVlckBnbWFpbC5jb20gb3IgYXMgYWR2ZXJ0aXNlZCBvbiBYaWxseWJ1cycgc2l0ZS4KKworQ29udGVudHM6CisKKyAtIEludHJvZHVjdGlvbgorICAtLSBCYWNrZ3JvdW5kCisgIC0tIFhpbGx5YnVzIE92ZXJ2aWV3CisKKyAtIFVzYWdlCisgIC0tIFVzZXIgaW50ZXJmYWNlCisgIC0tIFN5bmNocm9uaXphdGlvbgorICAtLSBTZWVrYWJsZSBwaXBlcworCistIEludGVybmFscworICAtLSBTb3VyY2UgY29kZSBvcmdhbml6YXRpb24KKyAgLS0gUGlwZSBhdHRyaWJ1dGVzCisgIC0tIEhvc3QgbmV2ZXIgcmVhZHMgZnJvbSB0aGUgRlBHQQorICAtLSBDaGFubmVscywgcGlwZXMsIGFuZCB0aGUgbWVzc2FnZSBjaGFubmVsCisgIC0tIERhdGEgc3RyZWFtaW5nCisgIC0tIERhdGEgZ3JhbnVsYXJpdHkKKyAgLS0gUHJvYmluZworICAtLSBCdWZmZXIgYWxsb2NhdGlvbgorICAtLSBNZW1vcnkgbWFuYWdlbWVudAorICAtLSBUaGUgIm5vbmVtcHR5IiBtZXNzYWdlIChzdXBwb3J0aW5nIHBvbGwpCisKKworSU5UUk9EVUNUSU9OCis9PT09PT09PT09PT0KKworQmFja2dyb3VuZAorLS0tLS0tLS0tLQorCitBbiBGUEdBIChGaWVsZCBQcm9ncmFtbWFibGUgR2F0ZSB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bGx5X2VuZHBvaW50ICplbmRwb2ludCwKKwkJCQljb25zdCB1bnNpZ25lZCBjaGFyICppZHQpCit7CisJaW50IHJjOworCWRldl90IGRldjsKKwlpbnQgZGV2bnVtLCBpLCBtaW5vciwgbWFqb3I7CisJY2hhciBkZXZuYW1lWzQ4XTsKKwlzdHJ1Y3QgZGV2aWNlICpkZXZpY2U7CisKKwlyYyA9IGFsbG9jX2NocmRldl9yZWdpb24oJmRldiwgMCwgLyogbWlub3Igc3RhcnQgKi8KKwkJCQkgZW5kcG9pbnQtPm51bV9jaGFubmVscywKKwkJCQkgeGlsbHluYW1lKTsKKworCWlmIChyYykgeworCQlwcl93YXJuKCJ4aWxseWJ1czogRmFpbGVkIHRvIG9idGFpbiBtYWpvci9taW5vcnMiKTsKKwkJZ290byBlcnJvcjE7CisJfQorCisJZW5kcG9pbnQtPm1ham9yID0gbWFqb3IgPSBNQUpPUihkZXYpOworCWVuZHBvaW50LT5sb3dlc3RfbWlub3IgPSBtaW5vciA9IE1JTk9SKGRldik7CisKKwljZGV2X2luaXQoJmVuZHBvaW50LT5jZGV2LCAmeGlsbHlidXNfZm9wcyk7CisJZW5kcG9pbnQtPmNkZXYub3duZXIgPSBlbmRwb2ludC0+ZXBody0+b3duZXI7CisJcmMgPSBjZGV2X2FkZCgmZW5kcG9pbnQtPmNkZXYsIE1LREVWKG1ham9yLCBtaW5vciksCisJCSAgICAgIGVuZHBvaW50LT5udW1fY2hhbm5lbHMpOworCWlmIChyYykgeworCQlwcl93YXJuKCJ4aWxseWJ1czogRmFpbGVkIHRvIGFkZCBjZGV2LiBBYm9ydGluZy5cbiIpOworCQlnb3RvIGVycm9yMjsKKwl9CisKKwlpZHQrKzsKKworCWZvciAoaSA9IG1pbm9yLCBkZXZudW0gPSAwOworCSAgICAgZGV2bnVtIDwgZW5kcG9pbnQtPm51bV9jaGFubmVsczsKKwkgICAgIGRldm51bSsrLCBpKyspIHsKKwkJc25wcmludGYoZGV2bmFtZSwgc2l6ZW9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pZiAocG9saWN5LT5tYXggPCBtaW4pCisJCXBvbGljeS0+bWF4ID0gbWluOworCWlmIChwb2xpY3ktPm1pbiA+IG1heCkKKwkJcG9saWN5LT5taW4gPSBtYXg7CisJaWYgKHBvbGljeS0+bWF4ID4gbWF4KQorCQlwb2xpY3ktPm1heCA9IG1heDsKKwlpZiAocG9saWN5LT5taW4gPiBwb2xpY3ktPm1heCkKKwkJcG9saWN5LT5taW4gPSBwb2xpY3ktPm1heDsKKwlyZXR1cm47CiB9Ci0jZW5kaWYKLQotLyoKLSAqIHF1ZXJ5IHRoZSBsYXN0IGtub3duIENQVSBmcmVxIChpbiBrSHopLiBJZiB6ZXJvLCBjcHVmcmVxIGNvdWxkbid0IGRldGVjdCBpdAotICovCi0jaWZkZWYgQ09ORklHX0NQVV9GUkVRCi11bnNpZ25lZCBpbnQgY3B1ZnJlcV9xdWlja19nZXQodW5zaWduZWQgaW50IGNwdSk7Ci11bnNpZ25lZCBpbnQgY3B1ZnJlcV9xdWlja19nZXRfbWF4KHVuc2lnbmVkIGludCBjcHUpOwotI2Vsc2UKLXN0YXRpYyBpbmxpbmUgdW5zaWduZWQgaW50IGNwdWZyZXFfcXVpY2tfZ2V0KHVuc2lnbmVkIGludCBjcHUpCi17Ci0JcmV0dXJuIDA7Ci19Ci1zdGF0aWMgaW5saW5lIHVuc2lnbmVkIGludCBjcHVmcmVxX3F1aWNrX2dldF9tYXgodW5zaWduZWQgaW50IGNwdSkKLXsKLQlyZXR1cm4gMDsKLX0KLSNlbmRpZgogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgQ1BVRlJFUSBERUZBVUxUIEdPVkVSTk9SICAgICAgICAgICAgICAgICAgICAqCisgKiAgICAgICAgICAgICAgICAgICAgIENQVUZSRVEgTk9USUZJRVIgSU5URVJGQUNFICAgICAgICAgICAgICAgICAgICAqCiAg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QorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgQ1BVRlJFUSBHT1ZFUk5PUlMgICAgICAgICAgICAgICAgICAgICAgICAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKgorICogSWYgKGNwdWZyZXFfZHJpdmVyLT50YXJnZXQpIGV4aXN0cywgdGhlIC0+Z292ZXJub3IgZGVjaWRlcyB3aGF0IGZyZXF1ZW5jeQorICogd2l0aGluIHRoZSBsaW1pdHMgaXMgdXNlZC4gSWYgKGNwdWZyZXFfZHJpdmVyLT5zZXRwb2xpY3k+IGV4aXN0cywgdGhlc2UKKyAqIHR3byBnZW5lcmljIHBvbGljaWVzIGFyZSBhdmFpbGFibGU6CisgKi8KKyNkZWZpbmUgQ1BVRlJFUV9QT0xJQ1lfUE9XRVJTQVZFCSgxKQorI2RlZmluZSBDUFVGUkVRX1BPTElDWV9QRVJGT1JNQU5DRQkoMikKKworLyogR292ZXJub3IgRXZlbnRzICovCisjZGVmaW5lIENQVUZSRVFfR09WX1NUQVJUCTEKKyNkZWZpbmUgQ1BVRlJFUV9HT1ZfU1RPUAkyCisjZGVmaW5lIENQVUZSRVFfR09WX0xJTUlUUwkzCisjZGVmaW5lIENQVUZSRVFfR09WX1BPTElDWV9JTklUCTQKKyNkZWZpbmUgQ1BVRlJFUV9HT1ZfUE9MSUNZX0VYSVQJNQorCitzdHJ1Y3QgY3B1ZnJlcV9nb3Zlcm5vciB7CisJY2hhcgluYW1lW0NQVUZSRVFfTkFNRV9MRU5dOworCWludAlpbml0aWFsaXplZDsKKwlpbnQJKCpnb3Zlcm5vcikJKHN0cnVjdCBjcHVmcmVxX3BvbGljeSAqcG9saWN5LAorCQkJCSB1bnNpZ25lZCBpbnQgZXZlbnQpOworCXNzaXplX3QJ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DJFCisjZGVmaW5lIEFSSVpPTkFfR1BfRk5fRFNQX0lSUTEgICAgICAgICAgICAgICAgICAgMHgzNQorI2RlZmluZSBBUklaT05BX0dQX0ZOX0RTUF9JUlEyICAgICAgICAgICAgICAgICAgIDB4MzYKKyNkZWZpbmUgQVJJWk9OQV9HUF9GTl9BU1lOQ19PUENMSyAgICAgICAgICAgICAgICAweDNECisjZGVmaW5lIEFSSVpPTkFfR1BfRk5fQk9PVF9ET05FICAgICAgICAgICAgICAgICAgMHg0NAorI2RlZmluZSBBUklaT05BX0dQX0ZOX0RTUDFfUkFNX1JFQURZICAgICAgICAgICAgIDB4NDUKKyNkZWZpbmUgQVJJWk9OQV9HUF9GTl9TWVNDTEtfRU5BX1NUQVRVUyAgICAgICAgICAweDRCCisjZGVmaW5lIEFSSVpPTkFfR1BfRk5fQVNZTkNDTEtfRU5BX1NUQVRVUyAgICAgICAgMHg0QworCisjZGVmaW5lIEFSSVpPTkFfR1BOX0RJUiAgICAgICAgICAgICAgICAgICAgICAgICAgMHg4MDAwICAvKiBHUE5fRElSICovCisjZGVmaW5lIEFSSVpPTkFfR1BOX0RJUl9NQVNLICAgICAgICAgICAgICAgICAgICAgMHg4MDAwICAvKiBHUE5fRElSICovCisjZGVmaW5lIEFSSVpPTkFfR1BOX0RJUl9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgIDE1ICAvKiBHUE5fRElSICovCisjZGVmaW5lIEFSSVpPTkFfR1BOX0RJUl9XSURUSCAgICAgICAgICAgICAgICAgICAgICAgICAxICAvKiBHUE5fRElSICovCisjZGVmaW5lIEFSSVpPTkFfR1BOX1BVICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg0MDAwICAvKiBHUE5fUFUgKi8KKyNkZWZpbmUgQVJJWk9OQV9HUE5fUFVfTUFTSyAgICAgICAgICAgICAgICAgICAgICAweDQwMDAgIC8qIEdQTl9QVSAqLworI2RlZmluZSBBUklaT05BX0dQTl9QVV9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAxNCAgLyogR1BOX1BVICovCisjZGVmaW5lIEFSSVpPTkFfR1BOX1BVX1dJRFRIICAgICAgICAgICAgICAgICAgICAgICAgICAxICAvKiBHUE5fUFUgKi8KKyNkZWZpbmUgQVJJWk9OQV9HUE5fUEQgICAgICAgICAgICAgICAgICAgICAgICAgICAweDIwMDAgIC8qIEdQTl9QRCAqLworI2RlZmluZSBBUklaT05BX0dQTl9QRF9NQVNLICAgICAgICAgICAgICAgICAgICAgIDB4MjAwMCAgLyogR1BOX1BEICovCisjZGVmaW5lIEFSSVpPTkFfR1BOX1BEX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgIDEzICAvKiBHUE5fUEQgKi8KKyNkZWZpbmUgQVJJWk9OQV9HUE5fUERfV0lEVEggICAgICAgICAgICAgICAgICAgICAgICAgIDEgIC8qIEdQTl9QRCAqLworI2RlZmluZSBBUklaT05BX0dQTl9MVkwgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDgwMCAgLyogR1BOX0xWTCAqLworI2RlZmluZSBBUklaT05BX0dQTl9MVkxfTUFTSyAgICAgICAgICAgICAgICAgICAgIDB4MDgwMCAgLyogR1BOX0xWTCAqLworI2RlZmluZSBBUklaT05BX0dQTl9MVkxfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAxMSAgLyogR1BOX0xWTCAqLworI2RlZmluZSBBUklaT05BX0dQTl9MVkxfV0lEVEggICAgICAgICAgICAgICAgICAgICAgICAgMSAgLyogR1BOX0xWTCAqLworI2RlZmluZSBBUklaT05BX0dQTl9QT0wgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDQwMCAgLyogR1BOX1BPTCAqLworI2RlZmluZSBBUklaT05BX0dQTl9QT0xfTUFTSyAgICAgICAgICAgICAgICAgICAgIDB4MDQwMCAgLyogR1BOX1BPTCAqLworI2RlZmluZSBBUklaT05BX0dQTl9QT0xfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAxMCAgLyogR1BOX1BPTCAqLworI2RlZmluZSBBUklaT05BX0dQTl9QT0xfV0lEVEggICAgICAgICAgICAgICAgICAgICAgICAgMSAgLyogR1BOX1BPTCAqLworI2RlZmluZSBBUklaT05BX0dQTl9PUF9DRkcgICAgICAgICAgICAgICAgICAgICAgIDB4MDIwMCAgLyogR1BOX09QX0NGRyAqLworI2RlZmluZSBBUklaT05BX0dQTl9PUF9DRkdfTUFTSyAgICAgICAgICAgICAgICAgIDB4MDIwMCAgLyogR1BOX09QX0NGRyAqLworI2RlZmluZSBBUklaT05BX0dQTl9PUF9DRkdfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgOSAgLyogR1BOX09QX0NGRyAqLworI2RlZmluZSBBUklaT05BX0dQTl9PUF9DRkdfV0lEVEggICAgICAgICAgICAgICAgICAgICAgMSAgLyogR1BOX09QX0NGRyAqLworI2RlZmluZSBBUklaT05BX0dQTl9EQiAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDEwMCAgLyogR1BOX0RCICovCisjZGVmaW5lIEFSSVpPTkFfR1BOX0RCX01BU0sgICAgICAgICAgICAgICAgICAgICAgMHgwMTAwICAvKiBHUE5fREIgKi8KKyNkZWZpbmUgQVJJWk9OQV9HUE5fREJfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgIDggIC8qIEdQTl9EQiAqLworI2RlZmluZSBBUklaT05BX0dQTl9EQl9XSURUSCAgICAgICAgICAgICAgICAgICAgICAgICAgMSAgLyogR1BOX0RCICovCisjZGVmaW5lIEFSSVpPTkFfR1BOX0ZOX01BU0sgICAgICAgICAgICAgICAgICAgICAgMHgwMDdGICAvKiBHUE5fREIgKi8KKyNkZWZpbmUgQVJJWk9OQV9HUE5fRk5fU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgIDAgIC8qIEdQTl9EQiAqLworI2RlZmluZSBBUklaT05BX0dQTl9GTl9XSURUSCAgICAgICAgICAgICAgICAgICAgICAgICAgNyAgLyogR1BOX0RCICovCisKKyNlbmRpZgpkaWZmIC0tZ2l0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zIxMC45ODc2OjU0MzIuMTA5ODo3NjU0LjMyMTA6IDAuLjMxCisgKiA6fHx8fC58fHx8Onx8fHwufHx8fDp8fHx8Lnx8fHw6fHx8fC58fHx8OgorICogOjg0MjEuODQyMTo4NDIxLjg0MjE6ODQyMS44NDIxOjg0MjEuODQyMTogaGV4IGRpZ2l0CisgKiA6ICAgIC4gICAgOiAgICAuICAgIDogICAgLiAgICA6ICB4IC4gICAgOiAgSERTUE1fQXVkaW9JbnRlcnJ1cHRFbmFibGUgXF8gc2V0dGluZyBib3RoIGJpdHMKKyAqIDogICAgLiAgICA6ICAgIC4gICAgOiAgICAuICAgIDogICAgLiAgIHg6ICBIRFNQTV9TdGFydCAgICAgICAgICAgICAgICAvICBlbmFibGVzIGF1ZGlvIElPCisgKiA6ICAgIC4gICAgOiAgICAuICAgIDogICAgLiAgICA6ICAgeC4gICAgOiAgSERTUE1fQ2xvY2tNb2RlTWFzdGVyIC0gMTogTWFzdGVyLCAwOiBTbGF2ZQorICogOiAgICAuICAgIDogICAgLiAgICA6ICAgIC4gICAgOiAgICAuMjEwIDogIEhEU1BNX0xhdGVuY3lNYXNrIC0gMyBCaXQgdmFsdWUgZm9yIGxhdGVuY3kKKyAqIDogICAgLiAgICA6ICAgIC4gICAgOiAgICAuICAgIDogICAgLiAgICA6ICAgICAgMDo2NCwgMToxMjgsIDI6MjU2LCAzOjUxMiwKKyAqIDogICAgLiAgICA6ICAgIC4gICAgOiAgICAuICAgIDogICAgLiAgICA6ICAgICAgNDoxMDI0LCA1OjIwNDgsIDY6NDA5NiwgNzo4MTkyCisgKiA6eCAgIC4gICAgOiAgICAuICAgIDogICAgLiAgIHg6eHggIC4gICAgOiAgSERTUE1fRnJlcXVlbmN5TWFzaworICogOiAgICAuICAgIDogICAgLiAgICA6ICAgIC4gICAgOjEwICAuICAgIDogIEhEU1BNX0ZyZXF1ZW5jeTF8SERTUE1fRnJlcXVlbmN5MDogMT0zMkssMj00NC4xSywzPTQ4SywwPT8/CisgKiA6ICAgIC4gICAgOiAgICAuICAgIDogICAgLiAgIHg6ICAgIC4gICAgOiAgPE1BREk+IEhEU1BNX0RvdWJsZVNwZWVkCisgKiA6eCAgIC4gICAgOiAgICAuICAgIDogICAgLiAgICA6ICAgIC4gICAgOiAgPE1BREk+IEhEU1BNX1F1YWRTcGVlZAorICogOiAgICAuICAzIDogICAgLiAgMTA6ICAyIC4gICAgOiAgICAuICAgIDogIEhEU1BNX1N5bmNSZWZNYXNrIDoKKyAqIDogICAgLiAgICA6ICAgIC4gICB4OiAgICAuICAgIDogICAgLiAgICA6ICBIRFNQTV9TeW5jUmVmMAorICogOiAgICAuICAgIDogICAgLiAgeCA6ICAgIC4gICAgOiAgICAuICAgIDogIEhEU1BNX1N5bmNSZWYxCisgKiA6ICAgIC4gICAgOiAgICAuICAgIDogIHggLiAgICA6ICAgIC4gICAgOiAgPEFFUzMyPiBIRFNQTV9TeW5jUmVmMgorICogOiAgICAuICB4IDogICAgLiAgICA6ICAgIC4gICAgOiAgICAuICAgIDogIDxBRVMzMj4gSERTUE1fU3luY1JlZjMKKyAqIDogICAgLiAgICA6ICAgIC4gIDEwOiAgICAuICAgIDogICAgLiAgICA6ICA8TUFEST4gc3luYyByZWY6IDA6V0MsIDE6TWFkaSwgMjpUQ08sIDM6U3luY0luCisgKiA6ICAgIC4gIDMgOiAgICAuICAxMDogIDIgLiAgICA6ICAgIC4gICAgOiAgPEFFUzMyPiAgMDpXQywgMTpBRVMxIC4uLiA4OkFFUzgsIDk6IFRDTywgMTA6U3luY0luPworICogOiAgICAuICB4IDogICAgLiAgICA6ICAgIC4gICAgOiAgICAuICAgIDogIDxNQURJZT4gSERTUGVfRkxPQVRfRk9STUFUCisgKiA6ICAgIC4gICAgOiAgICAuICAgIDogeCAgLiAgICA6ICAgIC4gICAgOiAgPE1BREk+IEhEU1BNX0lucHV0U2VsZWN0MCA6IDA9b3B0aWNhbCwxPWNvYXgKKyAqIDogICAgLiAgICA6ICAgIC4gICAgOnggICAuICAgIDogICAgLiAgICA6ICA8TUFEST4gSERTUE1fSW5wdXRTZWxlY3QxCisgKiA6ICAgIC4gICAgOiAgICAueCAgIDogICAgLiAgICA6ICAgIC4gICAgOiAgPE1BREk+IEhEU1BNX2Nscl90bXMKKyAqIDogICAgLiAgICA6ICAgIC4gICAgOiAgICAuIHggIDogICAgLiAgICA6ICA8TUFEST4gSERTUE1fVFhfNjRjaAorICogOiAgICAuICAgIDogICAgLiAgICA6ICAgIC4geCAgOiAgICAuICAgIDogIDxBRVMzMj4gSERTUE1fRW1waGFzaXMKKyAqIDogICAgLiAgICA6ICAgIC4gICAgOiAgICAueCAgIDogICAgLiAgICA6ICA8TUFEST4gSERTUE1fQXV0b0lucAorICogOiAgICAuICAgIDogICAgLiB4ICA6ICAgIC4gICAgOiAgICAuICAgIDogIDxNQURJPiBIRFNQTV9TTVVYCisgKiA6ICAgIC4gICAgOiAgICAueCAgIDogICAgLiAgICA6ICAgIC4gICAgOiAgPE1BREk+IEhEU1BNX2Nscl90bXMKKyAqIDogICAgLiAgICA6ICAgeC4gICAgOiAgICAuICAgIDogICAgLiAgICA6ICA8TUFEST4gSERTUE1fdGF4aV9yZXNldAorICogOiAgICAuICAgeDogICAgLiAgICA6ICAgIC4gICAgOiAgICAuICAgIDogIDxNQURJPiBIRFNQTV9MaW5lT3V0CisgKiA6ICAgIC4gICB4OiAgICAuICAgIDogICAgLiAgICA6ICAgIC4gICAgOiAgPEFFUzMyPiA/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8KKyAqIDogICAgLiAgICA6ICAgeC4gICAgOiAgICAuICAgIDogICAgLiAgICA6ICA8QUVTMzI+IEhEU1BNX1dDSzQ4CisgKiA6ICAgIC4gICAgOiAgICAuICAgIDogICAgLnggICA6ICAgIC4gICAgOiAgPEFFUzMyPiBIRFNQTV9Eb2xieQorICogOiAgICAuICAgIDogeCAgLiAgICA6ICAgIC4gICAgOiAgICAuICAgIDogIEhEU1BNX01pZGkwSW50ZXJydXB0RW5hYmxlCisgKiA6ICAgIC4gICAgOnggICAuICAgIDogICAgLiAgICA6ICAgIC4gICAgOiAgSERTUE1fTWlkaTFJbnRlcnJ1cHRFbmFibGUKKyAqIDogICAgLiAgICA6ICB4IC4gICAgOiAgICAuICAgIDogICAgLiAgICA6ICBIRFNQTV9NaWRpMkludGVycnVwdEVuYWJsZQorICogOiAgICAuIHggIDogICAgLiAgICA6ICAgIC4gICAgOiAgICAuICAgIDogIDxNQURJPiBIRFNQTV9NaWRpM0ludGVycnVwdEVuYWJsZQorICogOiAgICAuIHggIDogICAgLiAgICA6ICAgIC4gICAgOiAgICAuICAgIDogIDxBRVMzMj4gSERTUE1fRFNfRG91YmxlV2lyZQorICogOiAgICAueCAgIDogICAgLiAgICA6ICAgIC4gICAgOiAgICAuICAgIDogIDxBRVMzMj4gSERTUE1fUVNfRG91YmxlV2lyZQorICogOiAgIHguICAgIDogICAgLiAgICA6ICAgIC4gICAgOiAgICAuICAgIDogIDxBRVMzMj4gSERTUE1fUVNfUXVhZFdpcmUKKyAqIDogICAgLiAgICA6ICAgIC4gICAgOiAgICAuICB4IDogICAgLiAgICA6ICA8QUVTMzI+IEhEU1BNX1Byb2Zlc3Npb25hbAorICogOiB4ICAuICAgIDogICAgLiAgICA6ICAgIC4gICAgOiAgICAuICAgIDogIEhEU1BNX3djbGtfc2VsCisgKiA6ICAgIC4gICAgOiAgICAuICAgIDogICAgLiAgICA6ICAgIC4gICAgOgorICogOjc2NTQuMzIxMDo3NjU0LjMyMTA6NzY1NC4zMjEwOjc2NTQuMzIxMDogYml0IG51bWJlciBwZXIgYnl0ZQorICogOnx8fHwufHx8fDp8fHx8Lnx8fHw6fHx8fC58fHx8Onx8fHwufHx8fDoKKyAqIDozMzIyLjIyMjI6MjIyMi4xMTExOjExMTEuMTEwMDowMDAwLjAwMDA6IGJpdCBudW1iZXIKKyAqIDoxMDk4Ljc2NTQ6MzIxMC45ODc2OjU0MzIuMTA5ODo3NjU0LjMyMTA6IDAuLjMxC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BfU3luY1JlZjMKKyAqIDogICAgLiAgICA6ICAgIC4gICAgOiAgICAuICAgIDogICAzLjIxMCA6IEhEU1BNX2MwX1N5bmNSZWZNYXNrOgorICogOiAgICAuICAgIDogICAgLiAgICA6ICAgIC4gICAgOiAgICAuICAgIDogIFJheURhdDogMDpXQywgMTpBRVMsIDI6U1BESUYsIDMuLjY6IEFEQVQxLi40LAorICogOiAgICAuICAgIDogICAgLiAgICA6ICAgIC4gICAgOiAgICAuICAgIDogICAgICAgICAgOTpUQ08sIDEwOlN5bmNJbgorICogOiAgICAuICAgIDogICAgLiAgICA6ICAgIC4gICAgOiAgICAuICAgIDogIEFJTzogMDpXQywgMTpBRVMsIDI6IFNQRElGLCAzOiBBVEFULAorICogOiAgICAuICAgIDogICAgLiAgICA6ICAgIC4gICAgOiAgICAuICAgIDogICAgICAgICAgOTpUQ08sIDEwOlN5bmNJbgorICogOiAgICAuICAgIDogICAgLiAgICA6ICAgIC4gICAgOiAgICAuICAgIDoKKyAqIDogICAgLiAgICA6ICAgIC4gICAgOiAgICAuICAgIDogICAgLiAgICA6CisgKiA6MzMyMi4yMjIyOjIyMjIuMTExMToxMTExLjExMDA6MDAwMC4wMDAwOiBiaXQgbnVtYmVyIHBlciBieXRlCisgKiA6MTA5OC43NjU0OjMyMTAuOTg3Njo1NDMyLjEwOTg6NzY1NC4zMjEwOgorICogOnx8fHwufHx8fDp8fHx8Lnx8fHw6fHx8fC58fHx8Onx8fHwufHx8fDogYml0IG51bWJlcgorICogOjc2NTQuMzIxMDo3NjU0LjMyMTA6NzY1NC4zMjEwOjc2NTQuMzIxMDogMC4uMzEKKyAqIDp8fHx8Lnx8fHw6fHx8fC58fHx8Onx8fHwufHx8fDp8fHx8Lnx8fHw6CisgKiA6ODQyMS44NDIxOjg0MjEuODQyMTo4NDIxLjg0MjE6ODQyMS44NDIxOiBoZXggZGlnaXQKKyAqCisgKi8KICNpbmNsdWRlIDxsaW51eC9pbml0Lmg+CiAjaW5jbHVkZSA8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uZF9jbGsocG9zLCBhZGcsIGkpCQlcCisJZm9yIChpID0gMCwgKHBvcykgPSBhZGctPmNsa1tpXTsJXAorCSAgICAgaSA8IENMS01BWDsJCQlcCisJICAgICBpKyssIChwb3MpID0gYWRnLT5jbGtbaV0pCisjZGVmaW5lIHJzbmRfcHJpdl90b19hZGcocHJpdikgKChzdHJ1Y3QgcnNuZF9hZGcgKikocHJpdiktPmFkZykKKworc3RhdGljIGVudW0gcnNuZF9yZWcgcnNuZF9hZGdfc3NpX3JlZ19nZXQoaW50IGlkKQoreworCWVudW0gcnNuZF9yZWcgcmVnOworCisJLyoKKwkgKiBTU0kgOCBpcyBub3QgY29ubmVjdGVkIHRvIEFERy4KKwkgKiBpdCB3b3JrcyB3aXRoIFNTSSA3CisJICovCisJaWYgKGlkID09IDgpCisJCXJldHVybiBSU05EX1JFR19NQVg7CisKKwlpZiAoMCA8PSBpZCAmJiBpZCA8PSAzKQorCQlyZWcgPSBSU05EX1JFR19BVURJT19DTEtfU0VMMDsKKwllbHNlIGlmICg0IDw9IGlkICYmIGlkIDw9IDcpCisJCXJlZyA9IFJTTkRfUkVHX0FVRElPX0NMS19TRUwxOworCWVsc2UKKwkJcmVnID0gUlNORF9SRUdfQVVESU9fQ0xLX1NFTDI7CisKKwlyZXR1cm4gcmVnOworfQorCitpbnQgcnNuZF9hZGdfc3NpX2Nsa19zdG9wKHN0cnVjdCByc25kX21vZCAqbW9kKQoreworCXN0cnVjdCByc25kX3ByaXYgKnByaXYgPSByc25kX21vZF90b19wcml2KG1vZCk7CisJZW51bSByc25kX3JlZyByZWc7CisJaW50IGlkOworCisJLyoKKwkgKiAibW9kIiA9ICJzc2kiIGhlcmUuCisJICogd2UgY2FuIGdldCAic3NpIGlkIiBmcm9tIG1vZAorCSAqLworCWlkICA9IHJzbmRfbW9kX2lkKG1vZCk7CisJcmVnID0gcnNuZF9hZGdfc3NpX3JlZ19nZXQoaWQpOworCisJcnNuZF93cml0ZShwcml2LCBtb2QsIHJlZ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Ryb2wgaXQKKyAqICAgfAorICogICArLSByZGFpWzBdCisgKiAgIHwgICB8CQkgc3J1ICAgICBzc2l1ICAgICAgc3NpCisgKiAgIHwgICArLSBwbGF5YmFjayAtPiBbbW9kXSAtPiBbbW9kXSAtPiBbbW9kXSAtPiAuLi4KKyAqICAgfCAgIHwKKyAqICAgfCAgIHwJCSBzcnUgICAgIHNzaXUgICAgICBzc2kKKyAqICAgfCAgICstIGNhcHR1cmUgIC0+IFttb2RdIC0+IFttb2RdIC0+IFttb2RdIC0+IC4uLgorICogICB8CisgKiAgICstIHJkYWlbMV0KKyAqICAgfCAgIHwJCSBzcnUgICAgIHNzaXUgICAgICBzc2kKKyAqICAgfCAgICstIHBsYXliYWNrIC0+IFttb2RdIC0+IFttb2RdIC0+IFttb2RdIC0+IC4uLgorICogICB8ICAgfAorICogICB8ICAgfAkJIHNydSAgICAgc3NpdSAgICAgIHNzaQorICogICB8ICAgKy0gY2FwdHVyZSAgLT4gW21vZF0gLT4gW21vZF0gLT4gW21vZF0gLT4gLi4uCisgKiAgIC4uLgorICogICB8CisgKiAgIHwgKiogdGhlc2UgY29udHJvbCBzc2kKKyAqICAgfAorICogICArLSBzc2kKKyAqICAgfCAgfAorICogICB8ICArLSBzc2lbMF0KKyAqICAgfCAgKy0gc3NpWzFdCisgKiAgIHwgICstIHNzaVsyXQorICogICB8ICAuLi4KKyAqICAgfAorICogICB8ICoqIHRoZXNlIGNvbnRyb2wgc2N1CisgKiAgIHwKKyAqICAgKy0gc2N1CisgKiAgICAgIHwKKyAqICAgICAgKy0gc2N1WzBdCisgKiAgICAgICstIHNjdVsxXQorICogICAgICArLSBzY3VbMl0KKyAqICAgICAgLi4uCisgKgorICoKKyAqIGZvcl9lYWNoX3JzbmRfZGFpKHh4LCBwcml2LCB4eCkKKyAqICByZGFpWzBdID0+IHJkYWlbMV0gPT4gcmRhaVsyXSA9PiAuLi4KKyAqCisgKiBmb3JfZWFjaF9yc25kX21vZCh4eCwgcmRhaSwgeH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1Y3QgcnNuZF9wcml2ICpwcml2OworCXN0cnVjdCBkZXZpY2UgKmRldiA9ICZwZGV2LT5kZXY7CisJaW50IHJldDsKKworCWluZm8gPSBwZGV2LT5kZXYucGxhdGZvcm1fZGF0YTsKKwlpZiAoIWluZm8pIHsKKwkJZGV2X2VycihkZXYsICJkcml2ZXIgbmVlZHMgUi1DYXIgc291bmQgaW5mb3JtYXRpb25cbiIpOworCQlyZXR1cm4gLUVOT0RFVjsKKwl9CisKKwkvKgorCSAqCWluaXQgcHJpdiBkYXRhCisJICovCisJcHJpdiA9IGRldm1fa3phbGxvYyhkZXYsIHNpemVvZigqcHJpdiksIEdGUF9LRVJORUwpOworCWlmICghcHJpdikgeworCQlkZXZfZXJyKGRldiwgInByaXYgYWxsb2NhdGUgZmFpbGVkXG4iKTsKKwkJcmV0dXJuIC1FTk9ERVY7CisJfQorCisJcHJpdi0+ZGV2CT0gZGV2OworCXByaXYtPmluZm8JPSBpbmZvOworCXNwaW5fbG9ja19pbml0KCZwcml2LT5sb2NrKTsKKworCS8qCisJICoJaW5pdCBlYWNoIG1vZHVsZQorCSAqLworCXJldCA9IHJzbmRfZ2VuX3Byb2JlKHBkZXYsIGluZm8sIHByaXYpOworCWlmIChyZXQgPCAwKQorCQlyZXR1cm4gcmV0OworCisJcmV0ID0gcnNuZF9zY3VfcHJvYmUocGRldiwgaW5mbywgcHJpdik7CisJaWYgKHJldCA8IDApCisJCXJldHVybiByZXQ7CisKKwlyZXQgPSByc25kX2FkZ19wcm9iZShwZGV2LCBpbmZvLCBwcml2KTsKKwlpZiAocmV0IDwgMCkKKwkJcmV0dXJuIHJldDsKKworCXJldCA9IHJzbmRfc3NpX3Byb2JlKHBkZXYsIGluZm8sIHByaXYpOworCWlmIChyZXQgPCAwKQorCQlyZXR1cm4gcmV0OworCisJcmV0ID0gcnNuZF9kYWlfcHJvYmUocGRldiwgaW5mbywgcHJpdik7CisJaWYgKHJldCA8IDApCisJCXJldHVybiByZXQ7CisKKwkv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ByaXYgKnByaXYpOwordm9pZCByc25kX2FkZ19yZW1vdmUoc3RydWN0IHBsYXRmb3JtX2RldmljZSAqcGRldiwKKwkJICAgc3RydWN0IHJzbmRfcHJpdiAqcHJpdik7CisKKy8qCisgKglSLUNhciBzb3VuZCBwcml2CisgKi8KK3N0cnVjdCByc25kX3ByaXYgeworCisJc3RydWN0IGRldmljZSAqZGV2OworCXN0cnVjdCByY2FyX3NuZF9pbmZvICppbmZvOworCXNwaW5sb2NrX3QgbG9jazsKKworCS8qCisJICogYmVsb3cgdmFsdWUgd2lsbCBiZSBmaWxsZWQgb24gcnNuZF9nZW5fcHJvYmUoKQorCSAqLworCXZvaWQgKmdlbjsKKworCS8qCisJICogYmVsb3cgdmFsdWUgd2lsbCBiZSBmaWxsZWQgb24gcnNuZF9zY3VfcHJvYmUoKQorCSAqLworCXZvaWQgKnNjdTsKKwlpbnQgc2N1X25yOworCisJLyoKKwkgKiBiZWxvdyB2YWx1ZSB3aWxsIGJlIGZpbGxlZCBvbiByc25kX2FkZ19wcm9iZSgpCisJICovCisJdm9pZCAqYWRnOworCisJLyoKKwkgKiBiZWxvdyB2YWx1ZSB3aWxsIGJlIGZpbGxlZCBvbiByc25kX3NzaV9wcm9iZSgpCisJICovCisJdm9pZCAqc3NpdTsKKworCS8qCisJICogYmVsb3cgdmFsdWUgd2lsbCBiZSBmaWxsZWQgb24gcnNuZF9kYWlfcHJvYmUoKQorCSAqLworCXN0cnVjdCBzbmRfc29jX2RhaV9kcml2ZXIgKmRhaWRydjsKKwlzdHJ1Y3QgcnNuZF9kYWkgKnJkYWk7CisJaW50IGRhaV9ucjsKK307CisKKyNkZWZpbmUgcnNuZF9wcml2X3RvX2Rldihwcml2KQkoKHByaXYpLT5kZXYpCisjZGVmaW5lIHJzbmRfbG9jayhwcml2LCBmbGFncykgc3Bpbl9sb2NrX2lycXNhdmUoJnByaXYtPmxvY2ssIGZsYWdzKQorI2RlZmluZSByc25kX3VubG9jayhwcml2LCBmbGFncykgc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9kICptb2QsCisJCQkgICAgIHN0cnVjdCByc25kX2RhaSAqcmRhaSwKKwkJCSAgICAgc3RydWN0IHJzbmRfZGFpX3N0cmVhbSAqaW8pCit7CisJaW50IGlkID0gcnNuZF9tb2RfaWQobW9kKTsKKwl1MzIgdmFsOworCisJaWYgKHJzbmRfaXNfZ2VuMShwcml2KSkgeworCQl2YWwgPSAoMSA8PCBpZCk7CisJCXJzbmRfbW9kX2JzZXQobW9kLCBTUkNfQ1RSTCwgdmFsLCB2YWwpOworCX0KKworCXJldHVybiAwOworfQorCitzdGF0aWMgaW50IHJzbmRfc2N1X3NldF9ocGJpZihzdHJ1Y3QgcnNuZF9wcml2ICpwcml2LAorCQkJICAgICAgc3RydWN0IHJzbmRfbW9kICptb2QsCisJCQkgICAgICBzdHJ1Y3QgcnNuZF9kYWkgKnJkYWksCisJCQkgICAgICBzdHJ1Y3QgcnNuZF9kYWlfc3RyZWFtICppbykKK3sKKwlzdHJ1Y3Qgc25kX3BjbV9ydW50aW1lICpydW50aW1lID0gcnNuZF9pb190b19ydW50aW1lKGlvKTsKKwl1MzIgYWRpbnIgPSBydW50aW1lLT5jaGFubmVsczsKKworCXN3aXRjaCAocnVudGltZS0+c2FtcGxlX2JpdHMpIHsKKwljYXNlIDE2OgorCQlhZGluciB8PSBPVEJMXzE2OworCQlicmVhazsKKwljYXNlIDMyOgorCQlhZGluciB8PSBPVEJMXzI0OworCQlicmVhazsKKwlkZWZhdWx0OgorCQlyZXR1cm4gLUVJTzsKKwl9CisKKwlyc25kX21vZF93cml0ZShtb2QsIEJVU0lGX01PREUsIDEpOworCXJzbmRfbW9kX3dyaXRlKG1vZCwgQlVTSUZfQURJTlIsIGFkaW5yKTsKKworCXJldHVybiAwOworfQorCitzdGF0aWMgaW50IHJzbmRfc2N1X3N0YXJ0KHN0cnVjdCByc25kX21vZCAqbW9kLAorCQkJICBzdHJ1Y3QgcnNuZF9kYWkgKnJkYWksCisJCQkgIHN0cnVjdCByc25kX2RhaV9zd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CisJCWNhc2UgODoKKwkJCXNzaV9wYXJlbnRfc2V0KDcsIDAsIDAsIDApOworCQkJYnJlYWs7CisJCX0KKworCQlzc2l1LT5zc2lfbW9kZTEgfD0gdmFsOworCX0KK30KKworc3RhdGljIHZvaWQgcnNuZF9zc2lfbW9kZV9zZXQoc3RydWN0IHJzbmRfc3NpICpzc2kpCit7CisJc3RydWN0IHJzbmRfc3NpdSAqc3NpdSA9IHJzbmRfc3NpX3RvX3NzaXUoc3NpKTsKKworCXJzbmRfbW9kX3dyaXRlKCZzc2ktPm1vZCwgU1NJX01PREUwLCBzc2l1LT5zc2lfbW9kZTApOworCXJzbmRfbW9kX3dyaXRlKCZzc2ktPm1vZCwgU1NJX01PREUxLCBzc2l1LT5zc2lfbW9kZTEpOworfQorCitzdGF0aWMgdm9pZCByc25kX3NzaV9zdGF0dXNfY2hlY2soc3RydWN0IHJzbmRfbW9kICptb2QsCisJCQkJICB1MzIgYml0KQoreworCXN0cnVjdCByc25kX3ByaXYgKnByaXYgPSByc25kX21vZF90b19wcml2KG1vZCk7CisJc3RydWN0IGRldmljZSAqZGV2ID0gcnNuZF9wcml2X3RvX2Rldihwcml2KTsKKwl1MzIgc3RhdHVzOworCWludCBpOworCisJZm9yIChpID0gMDsgaSA8IDEwMjQ7IGkrKykgeworCQlzdGF0dXMgPSByc25kX21vZF9yZWFkKG1vZCwgU1NJU1IpOworCQlpZiAoc3RhdHVzICYgYml0KQorCQkJcmV0dXJuOworCisJCXVkZWxheSg1MCk7CisJfQorCisJZGV2X3dhcm4oZGV2LCAic3RhdHVzIGNoZWNrIGZhaWxlZFxuIik7Cit9CisKK3N0YXRpYyBpbnQgcnNuZF9zc2lfbWFzdGVyX2Nsa19zdGFydChzdHJ1Y3QgcnNuZF9zc2kgKnNzaSwKKwkJCQkgICAgIHVuc2lnbmVkIGludCByYXRlKQoreworCXN0cnVjdCByc25kX3ByaXYgKnByaXYgPSByc25kX21vZF90b19wcml2KCZzc2ktPm1vZCk7CisJc3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CT0gInNzaSAoZG1hKSIsCisJLmluaXQJPSByc25kX3NzaV9pbml0LAorCS5xdWl0CT0gcnNuZF9zc2lfcXVpdCwKKwkuc3RhcnQJPSByc25kX3NzaV9kbWFfc3RhcnQsCisJLnN0b3AJPSByc25kX3NzaV9kbWFfc3RvcCwKK307CisKKy8qCisgKgkJTm9uIFNTSQorICovCitzdGF0aWMgaW50IHJzbmRfc3NpX25vbihzdHJ1Y3QgcnNuZF9tb2QgKm1vZCwKKwkJCXN0cnVjdCByc25kX2RhaSAqcmRhaSwKKwkJCXN0cnVjdCByc25kX2RhaV9zdHJlYW0gKmlvKQoreworCXN0cnVjdCByc25kX3ByaXYgKnByaXYgPSByc25kX21vZF90b19wcml2KG1vZCk7CisJc3RydWN0IGRldmljZSAqZGV2ID0gcnNuZF9wcml2X3RvX2Rldihwcml2KTsKKworCWRldl9kYmcoZGV2LCAiJXNcbiIsIF9fZnVuY19fKTsKKworCXJldHVybiAwOworfQorCitzdGF0aWMgc3RydWN0IHJzbmRfbW9kX29wcyByc25kX3NzaV9ub25fb3BzID0geworCS5uYW1lCT0gInNzaSAobm9uKSIsCisJLmluaXQJPSByc25kX3NzaV9ub24sCisJLnF1aXQJPSByc25kX3NzaV9ub24sCisJLnN0YXJ0CT0gcnNuZF9zc2lfbm9uLAorCS5zdG9wCT0gcnNuZF9zc2lfbm9uLAorfTsKKworLyoKKyAqCQlzc2kgbW9kIGZ1bmN0aW9uCisgKi8KK3N0cnVjdCByc25kX21vZCAqcnNuZF9zc2lfbW9kX2dldF9mcm1fZGFpKHN0cnVjdCByc25kX3ByaXYgKnByaXYsCisJCQkJCSAgaW50IGRhaV9pZCwgaW50IGlzX3BsYXkpCit7CisJc3RydWN0IHJzbmRfc3NpICpzc2k7CisJaW50IGksIGhhc19wbGF5OworCisJaXNfcGxheSA9ICEhaXNfcGxheTsKKworCWZvcl9lYWNoX3JzbmRfc3NpKHNzaSwgcHJpdiwgaSkgeworCQlpZiAocnNuZF9zc2lfZGFp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ICAgICAgICBmMworICBiICAgICAgICAgIHggICAgICAgICAgICAgICAgICAgIGY0CisgIGIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZjYKKyAgICAgICAgICAgICB4ICAgICAgICAgeCAgICAgICAgICBmNQorCistIHBlcmYgZGlmZiBCIEEgQworCisgIGJhc2VsaW5lL0IgY29tcHV0ZS9BIGNvbXB1dGUvQyAgc2FtcGxlcworICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgYiAgICAgICAgICB4ICAgICAgICAgeCAgICAgICAgICBmMgorICBiICAgICAgICAgIHggICAgICAgICAgICAgICAgICAgIGY0CisgIGIgICAgICAgICAgICAgICAgICAgIHggICAgICAgICAgZjUKKyAgICAgICAgICAgICB4ICAgICAgICAgeCAgICAgICAgICBmMQorICAgICAgICAgICAgIHggICAgICAgICAgICAgICAgICAgIGYzCisgICAgICAgICAgICAgeCAgICAgICAgICAgICAgICAgICAgZjYKKworLSBwZXJmIGRpZmYgQyBCIEEKKworICBiYXNlbGluZS9DIGNvbXB1dGUvQiBjb21wdXRlL0EgIHNhbXBsZXMKKyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgIGIgICAgICAgICAgICAgICAgICAgIHggICAgICAgICAgZjEKKyAgYiAgICAgICAgICB4ICAgICAgICAgeCAgICAgICAgICBmMgorICBiICAgICAgICAgIHggICAgICAgICAgICAgICAgICAgIGY1CisgICAgICAgICAgICAgICAgICAgICAgIHggICAgICAgICAgZjMKKyAgICAgICAgICAgICB4ICAgICAgICAgeCAgICAgICAgICBmNAorICAgICAgICAgICAgICAgICAgICAgICB4ICAgICAgICAgIGY2CisKIENPTVBBUklTT04gTUVUSE9EUwogLS0tLS0tLS0tLS0tLS0tLS0tCiBkZWx0YQpAQCAtOTYsNyArMTUxLDcgQEAKICAgZCA9IEEtPnBlcmlvZF9wZXJjZW50IC0gQi0+cGVyaW9kX3Blcm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X19tYXliZV91bnVzZWQsCisJCQkJCSB1OCAqYXJnX21hc2sgX19tYXliZV91bnVzZWQpCit7CisJcmV0dXJuIHNjbnByaW50ZihiZiwgc2l6ZSwgIiUjbHgiLCBhcmcpOworfQorCisjZGVmaW5lIFNDQV9IRVggc3lzY2FsbF9hcmdfX3NjbnByaW50Zl9oZXgKKworc3RhdGljIHNpemVfdCBzeXNjYWxsX2FyZ19fc2NucHJpbnRmX3doZW5jZShjaGFyICpiZiwgc2l6ZV90IHNpemUsCisJCQkJCSAgICB1bnNpZ25lZCBsb25nIGFyZywKKwkJCQkJICAgIHU4IGFyZ19pZHggX19tYXliZV91bnVzZWQsCisJCQkJCSAgICB1OCAqYXJnX21hc2sgX19tYXliZV91bnVzZWQpCit7CisJaW50IHdoZW5jZSA9IGFyZzsKKworCXN3aXRjaCAod2hlbmNlKSB7CisjZGVmaW5lIFBfV0hFTkNFKG4pIGNhc2UgU0VFS18jI246IHJldHVybiBzY25wcmludGYoYmYsIHNpemUsICNuKQorCVBfV0hFTkNFKFNFVCk7CisJUF9XSEVOQ0UoQ1VSKTsKKwlQX1dIRU5DRShFTkQpOworI2lmZGVmIFNFRUtfREFUQQorCVBfV0hFTkNFKERBVEEpOworI2VuZGlmCisjaWZkZWYgU0VFS19IT0xFCisJUF9XSEVOQ0UoSE9MRSk7CisjZW5kaWYKKyN1bmRlZiBQX1dIRU5DRQorCWRlZmF1bHQ6IGJyZWFrOworCX0KKworCXJldHVybiBzY25wcmludGYoYmYsIHNpemUsICIlI3giLCB3aGVuY2UpOworfQorCisjZGVmaW5lIFNDQV9XSEVOQ0Ugc3lzY2FsbF9hcmdfX3NjbnByaW50Zl93aGVuY2UKKworc3RhdGljIHNpemVfdCBzeXNjYWxsX2FyZ19fc2NucHJpbnRmX21tYXBfcHJvdChjaGFyICpiZiwgc2l6ZV90IHNpemUsCisJCQkJCSAgICAgICB1bnNpZ25lZCBsb25nIGFyZywKKwkJCQkJICAgICAgIHU4IGFyZ19pZHggX19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CisJCWlmIChidWZbaV0gIT0gaSkgeworCQkJcHJfZGVidWcoInFzb3J0IGZhaWxlZFxuIik7CisJCQlicmVhazsKKwkJfQorCX0KK30KKworc3RhdGljIHZvaWQgc29ydF9zb21ldGhpbmcodm9pZCkKK3sKKwlpbnQgaTsKKworCWZvciAoaSA9IDA7IGkgPCAxMDsgaSsrKQorCQlkb19zb3J0X3NvbWV0aGluZygpOworfQorCitzdGF0aWMgdm9pZCBzeXNjYWxsX3NvbWV0aGluZyh2b2lkKQoreworCWludCBwaXBlZmRbMl07CisJaW50IGk7CisKKwlmb3IgKGkgPSAwOyBpIDwgMTAwMDsgaSsrKSB7CisJCWlmIChwaXBlKHBpcGVmZCkgPCAwKSB7CisJCQlwcl9kZWJ1ZygicGlwZSBmYWlsZWRcbiIpOworCQkJYnJlYWs7CisJCX0KKwkJY2xvc2UocGlwZWZkWzFdKTsKKwkJY2xvc2UocGlwZWZkWzBdKTsKKwl9Cit9CisKK3N0YXRpYyB2b2lkIGZzX3NvbWV0aGluZyh2b2lkKQoreworCWNvbnN0IGNoYXIgKnRlc3RfZmlsZV9uYW1lID0gInRlbXAtcGVyZi1jb2RlLXJlYWRpbmctdGVzdC1maWxlLS0iOworCUZJTEUgKmY7CisJaW50IGk7CisKKwlmb3IgKGkgPSAwOyBpIDwgMTAwMDsgaSsrKSB7CisJCWYgPSBmb3Blbih0ZXN0X2ZpbGVfbmFtZSwgIncrIik7CisJCWlmIChmKSB7CisJCQlmY2xvc2UoZik7CisJCQl1bmxpbmsodGVzdF9maWxlX25hbWUpOworCQl9CisJfQorfQorCitzdGF0aWMgdm9pZCBkb19zb21ldGhpbmcodm9pZCkKK3sKKwlmc19zb21ldGhpbmcoKTsKKworCXNvcnRfc29tZXRoaW5nKCk7CisKKwlzeXNjYWxsX3NvbWV0aGluZygpOworfQorCitlbnVtIHsKKwlURVNUX0NPREVfUkVBRElOR19PSywKKwlURVNUX0NPREVfUkVBRElOR19OT19WTUxJTlVYLAorCVRFU1Rf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