From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: zailiang.sun@intel.com) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by groups.io with SMTP; Sun, 30 Jun 2019 21:08:28 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jun 2019 21:08:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,437,1557212400"; d="scan'208";a="168345412" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga006.jf.intel.com with ESMTP; 30 Jun 2019 21:08:23 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 30 Jun 2019 21:08:21 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.110]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.55]) with mapi id 14.03.0439.000; Mon, 1 Jul 2019 12:08:19 +0800 From: "Sun, Zailiang" To: "Kinney, Michael D" , "devel@edk2.groups.io" CC: "Qian, Yi" Subject: Re: [edk2-platforms Patch 10/14] Vlv2TbltDevicePkg: Switch to MdeModulePkg BdsDxe Thread-Topic: [edk2-platforms Patch 10/14] Vlv2TbltDevicePkg: Switch to MdeModulePkg BdsDxe Thread-Index: AQHVL7iuO0drzeWiHkC4M4Ia7PkGGKa1JcMg Date: Mon, 1 Jul 2019 04:08:19 +0000 Message-ID: <7CB7EF03E15B5D48981329A508747A9850C9057F@SHSMSX104.ccr.corp.intel.com> References: <20190701025553.18596-1-michael.d.kinney@intel.com> <20190701025553.18596-11-michael.d.kinney@intel.com> In-Reply-To: <20190701025553.18596-11-michael.d.kinney@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: zailiang.sun@intel.com Content-Language: en-US Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 UmV2aWV3ZWQtQnk6IFphaWxpYW5nIFN1biA8emFpbGlhbmcuc3VuQGludGVsLmNvbT4NCg0KLS0t LS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCkZyb206IEtpbm5leSwgTWljaGFlbCBEIA0KU2VudDog TW9uZGF5LCBKdWx5IDAxLCAyMDE5IDEwOjU2IEFNDQpUbzogZGV2ZWxAZWRrMi5ncm91cHMuaW8N CkNjOiBTdW4sIFphaWxpYW5nIDx6YWlsaWFuZy5zdW5AaW50ZWwuY29tPjsgUWlhbiwgWWkgPHlp LnFpYW5AaW50ZWwuY29tPg0KU3ViamVjdDogW2VkazItcGxhdGZvcm1zIFBhdGNoIDEwLzE0XSBW bHYyVGJsdERldmljZVBrZzogU3dpdGNoIHRvIE1kZU1vZHVsZVBrZyBCZHNEeGUNCg0KU3dpdGNo IGZyb20gSW50ZWwgRnJhbWV3b3JrIEJEUyBtb2R1bGUgYW5kIGxpYnJhcmllcyB0byB0aGUNCk1k ZU1vZHVsZVBrZyBCZHNEeGUgbW9kdWxlIGFuZCBsaWJyYXJpZXMuDQoNClVwZGF0ZSBGTEFTSCBt YXAgZm9yIGZ1bGwgOE1CIEZMQVNIIHNpemUNCg0KQ2M6IFphaWxpYW5nIFN1biA8emFpbGlhbmcu c3VuQGludGVsLmNvbT4NCkNjOiBZaSBRaWFuIDx5aS5xaWFuQGludGVsLmNvbT4NClNpZ25lZC1v ZmYtYnk6IE1pY2hhZWwgRCBLaW5uZXkgPG1pY2hhZWwuZC5raW5uZXlAaW50ZWwuY29tPg0KLS0t DQogLi4uL0xpYnJhcnkvRm1wRGV2aWNlTGliL0ZtcERldmljZUxpYi5jICAgICAgIHwgICAxMiAr LQ0KIC4uLi9EeGVQbGF0Zm9ybUJvb3RNY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mNsdWRlIDxQcm90b2NvbC9Vc2JJby5oPg0KKyNpbmNsdWRlIDxMaWJyYXJ5L0Jvb3RMb2dvTGli Lmg+DQorDQorI2luY2x1ZGUgPExpYnJhcnkvVWVmaUJvb3RNYW5hZ2VyTGliLmg+DQorDQorR0xP QkFMX1JFTU9WRV9JRl9VTlJFRkVSRU5DRUQgRUZJX0JPT1RfTU9ERSAgICAgICAgICAgICAgICAg Z0Jvb3RNb2RlOw0KKw0KK0JPT0xFQU4gICAgICAgICAgICAgICAgICAgICAgZ1BQUmVxdWlyZVVJ Q29uZmlybTsNCisNCitleHRlcm4gVUlOVE4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIG1Cb290TWVudU9wdGlvbk51bWJlcjsNCisNCitHTE9CQUxfUkVNT1ZFX0lGX1VOUkVG RVJFTkNFRCBVU0JfQ0xBU1NfRk9STUFUX0RFVklDRV9QQVRIIGdVc2JDbGFzc0tleWJvYXJkRGV2 aWNlUGF0aCA9IHsNCisgIHsNCisgICAgew0KKyAgICAgIE1FU1NBR0lOR19ERVZJQ0VfUEFUSCwN CisgICAgICBNU0dfVVNCX0NMQVNTX0RQLA0KKyAgICAgIHsNCisgICAgICAgIChVSU5UOCkgKHNp emVvZiAoVVNCX0NMQVNTX0RFVklDRV9QQVRIKSksDQorICAgICAgICAoVUlOVDgpICgoc2l6ZW9m IChVU0JfQ0xBU1NfREVWSUNFX1BBVEgpKSA+PiA4KQ0KKyAgICAgIH0NCisgICAgfSwNCisgICAg MHhmZmZmLCAgICAgICAgICAgLy8gVmVuZG9ySWQNCisgICAgMHhmZmZmLCAgICAgICAgICAgLy8g UHJvZHVjdElkDQorICAgIENMQVNTX0hJRCwgICAgICAgIC8vIERldmljZUNsYXNzDQorICAgIFNV QkNMQVNTX0JPT1QsICAgIC8vIERldmljZVN1YkNsYXNzDQorICAgIFBST1RPQ09MX0tFWUJPQVJE IC8vIERldmljZVByb3RvY29sDQorICB9LA0KKyAgZ0VuZEVudGl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vLyBDaGVjayBpZiB0aGUgTU9SIGJpdCBpcyBzZXQuDQorICAvLw0KKyAgRGF0YVNpemUgPSBz aXplb2YgKE1vckNvbnRyb2wpOw0KKyAgU3RhdHVzID0gZ1JULT5HZXRWYXJpYWJsZSAoDQorICAg ICAgICAgICAgICAgICAgTUVNT1JZX09WRVJXUklURV9SRVFVRVNUX1ZBUklBQkxFX05BTUUsDQor ICAgICAgICAgICAgICAgICAgJmdFZmlNZW1vcnlPdmVyd3JpdGVDb250cm9sRGF0YUd1aWQsDQor ICAgICAgICAgICAgICAgICAgTlVMTCwNCisgICAgICAgICAgICAgICAgICAmRGF0YVNpemUsDQor ICAgICAgICAgICAgICAgICAgJk1vckNvbnRyb2wNCisgICAgICAgICAgICAgICAgICApOw0KKyAg aWYgKEVGSV9FUlJPUiAoU3RhdHVzKSkgew0KKyAgICBERUJVRyAoKERFQlVHX0lORk8sICIgUGxh dGZvcm1Cb290TWFuZ2VyTGliOiBnRWZpTWVtb3J5T3ZlcndyaXRlQ29udHJvbERhdGFHdWlkIGRv ZXNuJ3QgZXhpc3QhISoqKlxuIikpOw0KKyAgICBNb3JDb250cm9sID0gMDsNCisgIH0gZWxzZSB7 DQorICAgIERFQlVHICgoREVCVUdfSU5GTywgIiBQbGF0Zm9ybUJvb3RNYW5nZXJMaWI6IEdldCB0 aGUgZ0VmaU1lbW9yeU92ZXJ3cml0ZUNvbnRyb2xEYXRhR3VpZCA9ICV4ISEqKipcbiIsIE1vckNv bnRyb2wpKTsNCisgIH0NCisNCisgIHJldHVybiAoQk9PTEVBTikgKE1vckNvbnRyb2wgJiAweDAx KTsNCit9DQorDQorVk9JRA0KK0R1bXBEZXZpY2VQYXRoICgNCisgIElOIENIQVIxNiAgICAgICAg ICAgKk5hbWUsDQorICBJTiBFRklfREVWSUNFX1BBVEggICpEZXZpY2VQYXRoDQorICApDQorew0K KyAgQ0hBUjE2ICpTdHI7DQorDQorICBTdHIgPSBDb252ZXJ0RGV2aWNlUGF0aFRvVGV4dChEZXZp Y2VQYXRoLCBUUlVFLCBUUlVFKTsNCisgIERFQlVHICgoREVCVUdfSU5GTywgIiVzOiAlc1xuIiwg TmFtZSwgU3RyKSk7DQorICBpZiAoU3RyICE9IE5VTEwpIHsNCisgICAgRnJlZVBvb2wgKFN0cik7 DQorICB9DQorfQ0KKw0KKy8qKg0KKyAgQW4gZW1wdHkgZnVuY3Rpb24gdG8gcGFzcyBlcnJvciBj aGVja2luZyBvZiBDcmVhdGVFdmVudEV4ICgpLg0KKw0KKyAgVGhpcyBlbXB0eSBmdW5jdGlvbiBl bnN1cmVzIHRoYXQgRVZUX05PVElGWV9TSUdOQUxfQUxMIGlzIGVycm9yDQorICBjaGVja2VkIGNv cnJlY3RseSBzaW5jZSBpdCBpcyBub3cgbWFwcGVkIGludG8gQ3JlYXRlRXZlbnRFeCgpIGluIFVF RkkgMi4wLg0KKw0KKyAgQHBhcmFtICBFdmVudCAgICAgICAgICAgICAgICAgRXZlbnQgd2hvc2Ug bm90aWZpY2F0aW9uIGZ1bmN0aW9uIGlzIGJlaW5nIGludm9rZWQuDQorICBAcGFyYW0gIENvbnRl eHQgICAgICAgICAgICAgICBUaGUgcG9pbnRlciB0byB0aGUgbm90aWZpY2F0aW9uIGZ1bmN0aW9u J3MgY29udGV4dCwNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWNoIGlzIGlt cGxlbWVudGF0aW9uLWRlcGVuZGVudC4NCisqKi8NCitWT0lEDQorRUZJQVBJDQorSW50ZXJuYWxC ZHNFbXB0eUNhbGxiYWNrRnVudGlvbiAoDQorICBJTiBFRklfRVZFTlQgICAgICAgICAgICAgICAg RXZlbnQsDQorICBJTiBWT0lEICAgICAgICAgICAgICAgICAgICAgKkNvbnRleHQNCisgICkNCit7 DQorICByZXR1cm47DQorfQ0KKw0KK1ZPSUQNCitFeGl0UG1BdXRoICgNCisgIFZPSUQNCisgICkN Cit7DQorICBFRklfSEFORExFICAgICAgICAgICAgICAgICBIYW5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NCitC T09MRUFODQorSXNUcnVzdGVkQ29uc29sZSAoDQorICBJTiBDT05TT0xFX1RZUEUgICAgICAgICAg ICAgIENvbnNvbGVUeXBlLA0KKyAgSU4gRUZJX0RFVklDRV9QQVRIX1BST1RPQ09MICAqRGV2aWNl DQorICApDQorew0KKyAgVk9JRCAgICAgICAgICAgICAgICAgICAgICAqVHJ1c3RlZENvbnNvbGVE ZXZpY2VwYXRoOw0KKyAgRUZJX0RFVklDRV9QQVRIX1BST1RPQ09MICAqVGVtcERldmljZVBhdGg7 DQorICBFRklfREVWSUNFX1BBVEhfUFJPVE9DT0wgICpJbnN0YW5jZTsNCisgIFVJTlROICAgICAg ICAgICAgICAgICAgICAgU2l6ZTsNCisgIEVGSV9ERVZJQ0VfUEFUSF9QUk9UT0NPTCAgKkNvbnNv bGVEZXZpY2U7DQorDQorICBpZiAoRGV2aWNlID09IE5VTEwpIHsNCisgICAgcmV0dXJuIEZBTFNF Ow0KKyAgfQ0KKw0KKyAgQ29uc29sZURldmljZSA9IER1cGxpY2F0ZURldmljZVBhdGgoRGV2aWNl KTsNCisNCisgIFRydXN0ZWRDb25zb2xlRGV2aWNlcGF0aCA9IE5VTEw7DQorDQorICBzd2l0Y2gg KENvbnNvbGVUeXBlKSB7DQorICBjYXNlIENvbkluOg0KKyAgICBUcnVzdGVkQ29uc29sZURldmlj ZXBhdGggPSBQY2RHZXRQdHIgKFBjZFRydXN0ZWRDb25zb2xlSW5wdXREZXZpY2VQYXRoKTsNCisg ICAgYnJlYWs7DQorICBjYXNlIENvbk91dDoNCisgICAgLy8NCisgICAgLy8gQ2hlY2sgR09QIGFu ZCByZW1vdmUgbGFzdCBub2RlDQorICAgIC8vDQorICAgIFRlbXBEZXZpY2VQYXRoID0gQ29uc29s ZURldmljZTsNCisgICAgd2hpbGUgKCFJc0RldmljZVBhdGhFbmRUeXBlIChUZW1wRGV2aWNlUGF0 aCkpIHsNCisgICAgICBpZiAoRGV2aWNlUGF0aFR5cGUgKFRlbXBEZXZpY2VQYXRoKSA9PSBBQ1BJ X0RFVklDRV9QQVRIICYmDQorICAgICAgICAgIERldmljZVBhdGhTdWJUeXBlIChUZW1wRGV2aWNl UGF0aCkgPT0gQUNQSV9BRFJfRFApIHsNCisgICAgICAgIFNldERldmljZVBhdGhFbmROb2RlIChU ZW1wRGV2aWNlUGF0aCk7DQorICAgICAgICBicmVhazsNCisgICAgICB9DQorICAgICAgVGVtcERl dmljZVBhdGggPSBOZXh0RGV2aWNlUGF0aE5vZGUgKFRlbXBEZXZpY2VQYXRoKTsNCisgICAgfQ0K Kw0KKyAgICBUcnVzdGVkQ29uc29sZURldmljZXBhdGggPSBQY2RHZXRQdHIgKFBjZFRydXN0ZWRD b25zb2xlT3V0cHV0RGV2aWNlUGF0aCk7DQorICAgIGJyZWFrOw0KKyAgZGVmYXVsdDoNCisgICAg QVNTRVJUKEZBTFNFKTsNCisgICAgYnJlYWs7DQorICB9DQorDQorICBUZW1wRGV2aWNlUGF0aCA9 IFRydXN0ZWRDb25zb2xlRGV2aWNlcGF0aDsNCisgIGRvIHsNCisgICAgSW5zdGFuY2UgPSBHZXRO ZXh0RGV2aWNlUGF0aEluc3RhbmNlICgmVGVtcERldmljZVBhdGgsICZTaXplKTsNCisgICAgaWYg KEluc3RhbmNlID09IE5VTEwpIHsNCisgICAgICBicmVhazsNCisgICAgfQ0KKw0KKyAgICBpZiAo Q29tcGFyZU1lbSAoQ29uc29sZURldmljZSwgSW5zdGFuY2UsIFNpemUgLSBFTkRfREVWSUNFX1BB VEhfTEVOR1RIKSA9PSAwKSB7DQorICAgICAgRnJlZVBvb2wgKEluc3RhbmNlKTsNCisgICAgICBG cmVlUG9vbCAoQ29uc29sZURldmljZSk7DQorICAgICAgcmV0dXJuIFRSVUU7DQorICAgIH0NCisN CisgICAgRnJlZVBvb2wgKEluc3RhbmNlKTsNCisgIH0gd2hpbGUgKFRlbXBEZXZpY2VQYXRoICE9 IE5VTEwpOw0KKw0KKyAgRnJlZVBvb2wgKENvbnNvbGVEZXZpY2UpOw0KKw0KKyAgcmV0dXJuIEZB TFNFOw0KK30NCisNCitCT09MRUFODQorSXNVc2JTaG9ydEZvcm0gKA0KKyAgSU4gRUZJX0RFVklD RV9QQVRIX1BST1RPQ09MICAqRGV2aWNlUGF0aA0KKyAgKQ0KK3sNCisgIGlmICgoRGV2aWNlUGF0 aFR5cGUgKERldmljZVBhdGgpID09IE1FU1NBR0lOR19ERVZJQ0VfUEFUSCkgJiYNCisgICAgICAo KERldmljZVBhdGhTdWJUeXBlIChEZXZpY2VQYXRoKSA9PSBNU0dfVVNCX0NMQVNTX0RQKSB8fCAo RGV2aWNlUGF0aFN1YlR5cGUgKERldmljZVBhdGgpID09IE1TR19VU0JfV1dJRF9EUCkpICkgew0K KyAgICByZXR1cm4gVFJVRTsNCisgIH0NCisNCisgIHJldHVybiBGQUxTRTsNCit9DQorDQorLyoq DQorICBDb25uZWN0IHRoZSBVU0Igc2hvcnQgZm9ybSBkZXZpY2UgcGF0aC4NCisNCisgIEBwYXJh bSBEZXZpY2VQYXRoICAgVVNCIHNob3J0IGZvcm0gZGV2aWNlIHBhdGgNCisNCisgIEByZXR2YWwg RUZJX1NVQ0NFU1MgICAgICAgICAgIFN1Y2Nlc3NmdWxseSBjb25uZWN0ZWQgdGhlIFVTQiBkZXZp Y2UNCisgIEByZXR2YWwgRUZJX05PVF9GT1VORCAgICAgICAgIENhbm5vdCBjb25uZWN0IHRoZSBV U0IgZGV2aWNlDQorICBAcmV0dmFsIEVGSV9JTlZBTElEX1BBUkFNRVRFUiBUaGUgZGV2aWNlIHBh dGggaXMgaW52YWxpZC4NCisqKi8NCitFRklfU1RBVFVTDQorQ29ubmVjdFVzYlNob3J0Rm9ybURl dmljZVBhdGggKA0KKyAgSU4gRUZJX0RFVklDRV9QQVRIX1BST1RPQ09MICAgKkRldmljZVBhdGgN CisgICkNCit7DQorICBFRklfU1RBVFVTICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0YXR1 czsNCisgIEVGSV9IQU5ETEUgICAgICAgICAgICAgICAgICAgICAgICAgICAgKkhhbmRsZXM7DQor ICBVSU5UTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhhbmRsZUNvdW50Ow0KKyAg VUlOVE4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbmRleDsNCisgIEVGSV9QQ0lf SU9fUFJPVE9DT0wgICAgICAgICAgICAgICAgICAgKlBjaUlvOw0KKyAgVUlOVDggICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBDbGFzc1szXTsNCisgIEJPT0xFQU4gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgQXRMZWFzdE9uZUNvbm5lY3RlZDsNCisNCisgIC8vDQorICAvLyBD aGVjayB0aGUgcGFzc2VkIGluIHBhcmFtZXRlcnMNCisgIC8vDQorICBpZiAoRGV2aWNlUGF0aCA9 PSBOVUxMKSB7DQorICAgIHJldHVybiBFRklfSU5WQUxJRF9QQVJBTUVURVI7DQorICB9DQorDQor ICBpZiAoIUlzVXNiU2hvcnRGb3JtIChEZXZpY2VQYXRoKSkgew0KKyAgICByZXR1cm4gRUZJX0lO VkFMSURfUEFSQU1FVEVSOw0KKyAgfQ0KKw0KKyAgLy8NCisgIC8vIEZpbmQgdGhlIHVzYiBob3N0 IGNvbnRyb2xsZXIgZmlyc3RseSwgdGhlbiBjb25uZWN0IHdpdGggdGhlIHJlbWFpbmluZyBkZXZp Y2UgcGF0aA0KKyAgLy8NCisgIEF0TGVhc3RPbmVDb25uZWN0ZWQgPSBGQUxTRTsNCisgIFN0YXR1 cyA9IGdCUy0+TG9jYXRlSGFuZGxlQnVmZmVyICgNCisgICAgICAgICAgICAgICAgICBCeVByb3Rv Y29sLA0KKyAgICAgICAgICAgICAgICAgICZnRWZpUGNpSW9Qcm90b2NvbEd1aWQsDQorICAgICAg ICAgICAgICAgICAgTlVMTCwNCisgICAgICAgICAgICAgICAgICAmSGFuZGxlQ291bnQsDQorICAg ICAgICAgICAgICAgICAgJkhhbmRsZXMNCisgICAgICAgICAgICAgICAgICApOw0KKyAgZm9yIChJ bmRleCA9IDA7IEluZGV4IDwgSGFuZGxlQ291bnQ7IEluZGV4KyspIHsNCisgICAgU3RhdHVzID0g Z0JTLT5IYW5kbGVQcm90b2NvbCAoDQorICAgICAgICAgICAgICAgICAgICBIYW5kbGVzW0luZGV4 XSwNCisgICAgICAgICAgICAgICAgICAgICZnRWZpUGNpSW9Qcm90b2NvbEd1aWQsDQorICAgICAg ICAgICAgICAgICAgICAoVk9JRCAqKikgJlBjaUlvDQorICAgICAgICAgICAgICAgICAgICApOw0K KyAgICBpZiAoIUVGSV9FUlJPUiAoU3RhdHVzKSkgew0KKyAgICAgIC8vDQorICAgICAgLy8gQ2hl Y2sgd2hldGhlciB0aGUgUGNpIGRldmljZSBpcyB0aGUgd2FudGVkIHVzYiBob3N0IGNvbnRyb2xs ZXINCisgICAgICAvLw0KKyAgICAgIFN0YXR1cyA9IFBjaUlvLT5QY2kuUmVhZCAoUGNpSW8sIEVm aVBjaUlvV2lkdGhVaW50OCwgMHgwOSwgMywgJkNsYXNzKTsNCisgICAgICBpZiAoIUVGSV9FUlJP UiAoU3RhdHVzKSAmJg0KKyAgICAgICAgICAoKFBDSV9DTEFTU19TRVJJQUwgPT0gQ2xhc3NbMl0p ICYmIChQQ0lfQ0xBU1NfU0VSSUFMX1VTQiA9PSBDbGFzc1sxXSkpDQorICAgICAgICAgKSB7DQor ICAgICAgICBTdGF0dXMgPSBnQlMtPkNvbm5lY3RDb250cm9sbGVyICgNCisgICAgICAgICAgICAg ICAgICAgICAgICBIYW5kbGVzW0luZGV4XSwNCisgICAgICAgICAgICAgICAgICAgICAgICBOVUxM LA0KKyAgICAgICAgICAgICAgICAgICAgICAgIERldmljZVBhdGgsDQorICAgICAgICAgICAgICAg ICAgICAgICAgRkFMU0UNCisgICAgICAgICAgICAgICAgICAgICAgICApOw0KKyAgICAgICAgaWYg KCFFRklfRVJST1IoU3RhdHVzKS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ZnRWZpUGNpSW9Qcm90b2NvbEd1aWQsDQorICAgICAgICAgICAgICAg ICAgKFZPSUQgKiopJlBjaUlvDQorICAgICAgICAgICAgICAgICAgKTsNCisgIGlmICghRUZJX0VS Uk9SIChTdGF0dXMpKSB7DQorICAgIFN0YXR1cyA9IFBjaUlvLT5QY2kuUmVhZCAoDQorICAgICAg ICAgICAgICAgICAgICAgICAgICBQY2lJbywNCisgICAgICAgICAgICAgICAgICAgICAgICAgIEVm aVBjaUlvV2lkdGhVaW50MzIsDQorICAgICAgICAgICAgICAgICAgICAgICAgICAwLA0KKyAgICAg ICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mIChQY2kpIC8gc2l6ZW9mIChVSU5UMzIpLA0KKyAg ICAgICAgICAgICAgICAgICAgICAgICAgJlBjaQ0KKyAgICAgICAgICAgICAgICAgICAgICAgICAg KTsNCisgICAgaWYgKCFFRklfRVJST1IgKFN0YXR1cykpIHsNCisgICAgICBpZiAoSVNfUENJX1ZH QSAoJlBjaSkgfHwgSVNfUENJX09MRF9WR0EgKCZQY2kpKSB7DQorICAgICAgICByZXR1cm4gVFJV RTsNCisgICAgICB9DQorICAgIH0NCisgIH0NCisgIHJldHVybiBGQUxTRTsNCit9DQorDQorRUZJ X0hBTkRMRQ0KK0lzVmlkZW9Db250cm9sbGVyICgNCisgIElOIEVGSV9ERVZJQ0VfUEFUSF9QUk9U T0NPTCAgKkRldmljZVBhdGgNCisgICkNCit7DQorICBFRklfREVWSUNFX1BBVEhfUFJPVE9DT0wg ICpEdXBEZXZpY2VQYXRoOw0KKyAgRUZJX0RFVklDRV9QQVRIX1BST1RPQ09MICAqVGVtcERldmlj ZVBhdGg7DQorICBFRklfU1RBVFVTICAgICAgICAgICAgICAgIFN0YXR1czsNCisgIEVGSV9IQU5E TEUgICAgICAgICAgICAgICAgRGV2aWNlSGFuZGxlOw0KKw0KKyAgRHVwRGV2aWNlUGF0aCA9IER1 cGxpY2F0ZURldmljZVBhdGggKERldmljZVBhdGgpOw0KKyAgQVNTRVJUIChEdXBEZXZpY2VQYXRo ICE9IE5VTEwpOw0KKyAgaWYgKER1cERldmljZVBhdGggPT0gTlVMTCkgew0KKyAgICByZXR1cm4g TlVMTDsNCisgIH0NCisNCisgIFRlbXBEZXZpY2VQYXRoID0gRHVwRGV2aWNlUGF0aDsNCisgIFN0 YXR1cyA9IGdCUy0+TG9jYXRlRGV2aWNlUGF0aCAoDQorICAgICAgICAgICAgICAgICAgJmdFZmlE ZXZpY2VQYXRoUHJvdG9jb2xHdWlkLA0KKyAgICAgICAgICAgICAgICAgICZUZW1wRGV2aWNlUGF0 aCwNCisgICAgICAgICAgICAgICAgICAmRGV2aWNlSGFuZGxlDQorICAgICAgICAgICAgICAgICAg KTsNCisgIEZyZWVQb29sIChEdXBEZXZpY2VQYXRoKTsNCisgIGlmIChFRklfRVJST1IgKFN0YXR1 cykpIHsNCisgICAgcmV0dXJuIE5VTEw7DQorICB9DQorDQorICBpZiAoSXNWZ2FIYW5kbGUgKERl dmljZUhhbmRsZSkpIHsNCisgICAgcmV0dXJuIERldmljZUhhbmRsZTsNCisgIH0gZWxzZSB7DQor ICAgIHJldHVybiBOVUxMOw0KKyAgfQ0KK30NCisNCitCT09MRUFODQorSXNHb3BEZXZpY2VQYXRo ICgNCisgIElOIEVGSV9ERVZJQ0VfUEFUSF9QUk9UT0NPTCAgKkRldmljZVBhdGgNCisgICkNCit7 DQorICB3aGlsZSAoIUlzRGV2aWNlUGF0aEVuZFR5cGUgKERldmljZVBhdGgpKSB7DQorICAgIGlm IChEZXZpY2VQYXRoVHlwZSAoRGV2aWNlUGF0aCkgPT0gQUNQSV9ERVZJQ0VfUEFUSCAmJg0KKyAg ICAgICAgRGV2aWNlUGF0aFN1YlR5cGUgKERldmljZVBhdGgpID09IEFDUElfQURSX0RQKSB7DQor ICAgICAgcmV0dXJuIFRSVUU7DQorICAgIH0NCisgICAgRGV2aWNlUGF0aCA9IE5leHREZXZpY2VQ YXRoTm9kZSAoRGV2aWNlUGF0aCk7DQorICB9DQorICByZXR1cm4gRkFMU0U7DQorfQ0KKw0KKy8q Kg0KKyAgUmVtb3ZlIGFsbCBHT1AgZGV2aWNlIHBhdGggaW5zdGFuY2UgZnJvbSBEZXZpY2VQYXRo IGFuZCBhZGQgdGhlIEdvcCB0byB0aGUgRGV2aWNlUGF0aC4NCisqKi8NCitFRklfREVWSUNFX1BB VEhfUFJPVE9DT0wgKg0KK1VwZGF0ZUdvcERldmljZVBhdGggKA0KKyAgRUZJX0RFVklDRV9QQVRI X1BST1RPQ09MICpEZXZpY2VQYXRoLA0KKyAgRUZJX0RFVklDRV9QQVRIX1BST1RPQ09MICpHb3AN CisgICkNCit7DQorICBVSU5UTiAgICAgICAgICAgICAgICAgICAgU2l6ZTsNCisgIFVJTlROICAg ICAgICAgICAgICAgICAgICBHb3BTaXplOw0KKyAgRUZJX0RFVklDRV9QQVRIX1BST1RPQ09MICpU ZW1wOw0KKyAgRUZJX0RFVklDRV9QQVRIX1BST1RPQ09MICpSZXR1cm47DQorICBFRklfREVWSUNF X1BBVEhfUFJPVE9DT0wgKkluc3RhbmNlOw0KKyAgQk9PTEVBTiAgICAgICAgICAgICAgICAgIEV4 aXN0Ow0KKw0KKyAgRXhpc3QgPSBGQUxTRTsNCisgIFJldHVybiA9IE5VTEw7DQorICBHb3BTaXpl ID0gR2V0RGV2aWNlUGF0aFNpemUgKEdvcCk7DQorICBkbyB7DQorICAgIEluc3RhbmNlID0gR2V0 TmV4dERldmljZVBhdGhJbnN0YW5jZSAoJkRldmljZVBhdGgsICZTaXplKTsNCisgICAgaWYgKElu c3RhbmNlID09IE5VTEwpIHsNCisgICAgICBicmVhazsNCisgICAgfQ0KKyAgICBpZiAoIUlzR29w RGV2aWNlUGF0aCAoSW5zdGFuY2UpIHx8DQorICAgICAgICAoU2l6ZSA9PSBHb3BTaXplICYmIENv bXBhcmVNZW0gKEluc3RhbmNlLCBHb3AsIEdvcFNpemUpID09IDApDQorICAgICAgICkgew0KKyAg ICAgIGlmIChTaXplID09IEdvcFNpemUgJiYgQ29tcGFyZU1lbSAoSW5zdGFuY2UsIEdvcCwgR29w U2l6ZSkgPT0gMCkgew0KKyAgICAgICAgRXhpc3QgPSBUUlVFOw0KKyAgICAgIH0NCisgICAgICBU ZW1wID0gUmV0dXJuOw0KKyAgICAgIFJldHVybiA9IEFwcGVuZERldmljZVBhdGhJbnN0YW5jZSAo UmV0dXJuLCBJbnN0YW5jZSk7DQorICAgICAgaWYgKFRlbXAgIT0gTlVMTCkgew0KKyAgICAgICAg RnJlZVBvb2wgKFRlbXApOw0KKyAgICAgIH0NCisgICAgfQ0KKyAgICBGcmVlUG9vbCAoSW5zdGFu Y2UpOw0KKyAgfSB3aGlsZSAoRGV2aWNlUGF0aCAhPSBOVUxMKTsNCisNCisgIGlmICghRXhpc3Qp IHsNCisgICAgVGVtcCA9IFJldHVybjsNCisgICAgUmV0dXJuID0gQXBwZW5kRGV2aWNlUGF0aElu c3RhbmNlIChSZXR1cm4sIEdvcCk7DQorICAgIGlmIChUZW1wICE9IE5VTEwpIHsNCisgICAgICBG cmVlUG9vbCAoVGVtcCk7DQorICAgIH0NCisgIH0NCisgIHJldHVybiBSZXR1cm47DQorfQ0KKw0K Ky8qKg0KKyAgR2V0IEdyYXBoaWNzIENvbnRyb2xsZXIgSGFuZGxlLg0KKw0KKyAgQHJldHZhbCBH cmFwaGljc0NvbnRyb2xsZXIgICAgU3VjY2Vzc2Z1bGx5IGxvY2F0ZWQNCisgIEByZXR2YWwgTlVM TCAgICAgICAgICAgICAgICAgIEZhaWxlZCB0byBsb2NhdGUNCisqKi8NCitFRklfSEFORExFDQor RUZJQVBJDQorR2V0R3JhcGhpY3NDb250cm9sbGVyICgNCisgIElOIEJPT0xFQU4gICAgTmVlZFRy dXN0ZWRDb25zb2xlDQorICApDQorew0KKyAgRUZJX1NUQVRVUyAgICAgICAgICAgICAgICBTdGF0 dXM7DQorICBVSU5UTiAgICAgICAgICAgICAgICAgICAgIEluZGV4Ow0KKyAgRUZJX0hBTkRMRSAg ICAgICAgICAgICAgICAqUGNpSGFuZGxlczsNCisgIFVJTlROICAgICAgICAgICAgICAgICAgICAg UGNpSGFuZGxlc1NpemU7DQorICBFRklfREVWSUNFX1BBVEhfUFJPVE9DT0wgICpEZXZpY2VQYXRo Ow0KKw0KKyAgU3RhdHVzID0gZ0JTLT5Mb2NhdGVIYW5kbGVCdWZmZXIgKA0KKyAgICAgICAgICAg ICAgICAgIEJ5UHJvdG9jb2wsDQorICAgICAgICAgICAgICAgICAgJmdFZmlQY2lJb1Byb3RvY29s R3VpZCwNCisgICAgICAgICAgICAgICAgICBOVUxMLA0KKyAgICAgICAgICAgICAgICAgICZQY2lI YW5kbGVzU2l6ZSwNCisgICAgICAgICAgICAgICAgICAmUGNpSGFuZGxlcw0KKyAgICAgICAgICAg ICAgICAgICk7DQorICBpZiAoRUZJX0VSUk9SIChTdGF0dXMpKSB7DQorICAgIHJldHVybiBOVUxM Ow0KKyAgfQ0KKw0KKyAgZm9yIChJbmRleCA9IDA7IEluZGV4IDwgUGNpSGFuZGxlc1NpemU7IElu ZGV4KyspIHsNCisgICAgU3RhdHVzID0gZ0JTLT5IYW5kbGVQcm90b2NvbCAoDQorICAgICAgICAg ICAgICAgICAgICBQY2lIYW5kbGVzW0luZGV4XSwNCisgICAgICAgICAgICAgICAgICAgICZnRWZp RGV2aWNlUGF0aFByb3RvY29sR3VpZCwNCisgICAgICAgICAgICAgICAgICAgIChWT0lEICoqKSAm RGV2aWNlUGF0aA0KKyAgICAgICAgICAgICAgICAgICAgKTsNCisgICAgaWYgKEVGSV9FUlJPUihT dGF0dXMpKSB7DQorICAgICAgY29udGludWU7DQorICAgIH0NCisgICAgaWYgKCFJc1ZnYUhhbmRs ZSAoUGNpSGFuZGxlc1tJbmRleF0pKSB7DQorICAgICAgY29udGludWU7DQorICAgIH0NCisgICAg aWYgKChOZWVkVHJ1c3RlZENvbnNvbGUgJiYgSXNUcnVzdGVkQ29uc29sZSAoQ29uT3V0LCBEZXZp Y2VQYXRoKSkgfHwNCisgICAgICAgICgoIU5lZWRUcnVzdGVkQ29uc29sZSkgJiYgKCFJc1RydXN0 ZWRDb25zb2xlIChDb25PdXQsIERldmljZVBhdGgpKSkpIHsNCisgICAgICByZXR1cm4gUGNpSGFu ZGxlc1tJbmRleF07DQorICAgIH0NCisgIH0NCisNCisgIHJldHVybiBOVUxMOw0KK30NCisNCitW T0lEDQorVXBkYXRlR3JhcGhpY0Nvbk91dCAoDQorICBJTiBCT09MRUFOICAgIE5lZWRUcnVzdGVk Q29uc29sZQ0KKyAgKQ0KK3sNCisgIEVGSV9IQU5ETEUgICAgICAgICAgICAgICAgICAgICAgICAg IEdyYXBoaWNzQ29udHJvbGxlckhhbmRsZTsNCisgIEVGSV9ERVZJQ0VfUEFUSF9QUk9UT0NPTCAg ICAgICAgICAgICpHb3BEZXZpY2VQYXRoOw0KKyAgRUZJX0RFVklDRV9QQVRIX1BST1RPQ09MICAg ICAgICAgICAgKkNvbk91dERldmljZVBhdGg7DQorICBFRklfREVWSUNFX1BBVEhfUFJPVE9DT0wg ICAgICAgICAgICAqVXBkYXRlZENvbk91dERldmljZVBhdGg7DQorDQorICAvLw0KKyAgLy8gVXBk YXRlIENvbk91dCB2YXJpYWJsZQ0KKyAgLy8NCisgIEdyYXBoaWNzQ29udHJvbGxlckhhbmRsZSA9 IEdldEdyYXBoaWNzQ29udHJvbGxlciAoTmVlZFRydXN0ZWRDb25zb2xlKTsNCisgIGlmIChHcmFw aGljc0NvbnRyb2xsZXJIYW5kbGUgIT0gTlVMTCkgew0KKyAgICAvLw0KKyAgICAvLyBDb25uZWN0 IHRoZSBHT1AgZHJpdmVyDQorICAgIC8vDQorICAgIGdCUy0+Q29ubmVjdENvbnRyb2xsZXIgKEdy YXBoaWNzQ29udHJvbGxlckhhbmRsZSwgTlVMTCwgTlVMTCwgVFJVRSk7DQorDQorICAgIC8vDQor ICAgIC8vIEdldCB0aGUgR09QIGRldmljZSBwYXRoDQorICAgIC8vIE5PVEU6IFdlIG1heSBnZXQg YSBkZXZpY2UgcGF0aCB0aGF0IGNvbnRhaW5zIENvbnRyb2xsZXIgbm9kZSBpbiBpdC4NCisgICAg Ly8NCisgICAgR29wRGV2aWNlUGF0aCA9IEVmaUJvb3RNYW5hZ2VyR2V0R29wRGV2aWNlUGF0aCAo R3JhcGhpY3NDb250cm9sbGVySGFuZGxlKTsNCisgICAgaWYgKEdvcERldmljZVBhdGggIT0gTlVM TCkgew0KKyAgICAgIEdldEVmaUdsb2JhbFZhcmlhYmxlMiAoTCJDb25PdXQiLCAoVk9JRCAqKikm Q29uT3V0RGV2aWNlUGF0aCwgTlVMTCk7DQorICAgICAgVXBkYXRlZENvbk91dERldmljZVBhdGgg PSBVcGRhdGVHb3BEZXZpY2VQYXRoIChDb25PdXREZXZpY2VQYXRoLCBHb3BEZXZpY2VQYXRoKTsN CisgICAgICBpZiAoQ29uT3V0RGV2aWNlUGF0aCAhPSBOVUxMKSB7DQorICAgICAgICBGcmVlUG9v bCAoQ29uT3V0RGV2aWNlUGF0aCk7DQorICAgICAgfQ0KKyAgICAgIEZyZWVQb29sIChHb3BEZXZp Y2VQYXRoKTsNCisgICAgICBnUlQtPlNldFZhcmlhYmxlICgNCisgICAgICAgICAgICAgICAgICAg ICAgTCJDb25PdXQiLA0KKyAgICAgICAgICAgICAgICAgICAgICAmZ0VmaUdsb2JhbFZhcmlhYmxl R3VpZCwNCisgICAgICAgICAgICAgICAgICAgICAgRUZJX1ZBUklBQkxFX05PTl9WT0xBVElMRSB8 IEVGSV9WQVJJQUJMRV9SVU5USU1FX0FDQ0VTUyB8IEVGSV9WQVJJQUJMRV9CT09UU0VSVklDRV9B Q0NFU1MsDQorICAgICAgICAgICAgICAgICAgICAgIEdldERldmljZVBhdGhTaXplIChVcGRhdGVk Q29uT3V0RGV2aWNlUGF0aCksDQorICAgICAgICAgICAgICAgICAgICAgIFVwZGF0ZWRDb25PdXRE ZXZpY2VQYXRoDQorICAgICAgICAgICAgICAgICAgICAgICk7DQorICAgIH0NCisgIH0NCit9DQor DQorVk9JRA0KK0FkZENvbnNvbGVWYXJpYWJsZSAoDQorICBJTiBDT05TT0xFX1RZUEUgICAgICAg ICAgICAgIENvbnNvbGVUeXBlLA0KKyAgSU4gRUZJX0RFVklDRV9QQVRIICAgICAgICAgICAqQ29u c29sZURldmljZVBhdGgNCisgICkNCit7DQorICBFRklfREVWSUNFX1BBVEggICAgICAgICAgICpU ZW1wRGV2aWNlUGF0aDsNCisgIEVGSV9ERVZJQ0VfUEFUSCAgICAgICAgICAgKkluc3RhbmNlOw0K KyAgVUlOVE4gICAgICAgICAgICAgICAgICAgICBTaXplOw0KKyAgRUZJX0hBTkRMRSAgICAgICAg ICAgICAgICBHcmFwaGljc0NvbnRyb2xsZXJIYW5kbGU7DQorICBFRklfREVWSUNFX1BBVEggICAg ICAgICAgICpHb3BEZXZpY2VQYXRoOw0KKw0KKyAgVGVtcERldmljZVBhdGggPSBDb25zb2xlRGV2 aWNlUGF0aDsNCisgIGRvIHsNCisgICAgSW5zdGFuY2UgPSBHZXROZXh0RGV2aWNlUGF0aEluc3Rh bmNlICgmVGVtcERldmljZVBhdGgsICZTaXplKTsNCisgICAgaWYgKEluc3RhbmNlID09IE5VTEwp IHsNCisgICAgICBicmVhazsNCisgICAgfQ0KKw0KKyAgICBzd2l0Y2ggKENvbnNvbGVUeXBlKSB7 DQorICAgIGNhc2UgQ29uSW46DQorICAgICAgaWYgKElzVXNiU2hvcnRGb3JtIChJbnN0YW5jZSkp IHsNCisgICAgICAgIC8vDQorICAgICAgICAvLyBBcHBlbmQgVXNiIEtleWJvYXJkIHNob3J0IGZv cm0gRGV2aWNlUGF0aCBpbnRvICJDb25JbkRldiINCisgICAgICAgIC8vDQorICAgICAgICBFZmlC b290TWFuYWdlclVwZGF0ZUNvbnNvbGVWYXJpYWJsZSAoQ29uSW5EZXYsIEluc3RhbmNlLCBOVUxM KTsNCisgICAgICB9DQorICAgICAgRWZpQm9vdE1hbmFnZXJVcGRhdGVDb25zb2xlVmFyaWFibGUg KENvbnNvbGVUeXBlLCBJbnN0YW5jZSwgTlVMTCk7DQorICAgICAgYnJlYWs7DQorICAgIGNhc2Ug Q29uT3V0Og0KKyAgICAgIEdyYXBoaWNzQ29udHJvbGxlckhhbmRsZSA9IElzVmlkZW9Db250cm9s bGVyIChJbnN0YW5jZSk7DQorICAgICAgaWYgKEdyYXBoaWNzQ29udHJvbGxlckhhbmRsZSA9PSBO VUxMKSB7DQorICAgICAgICBFZmlCb290TWFuYWdlclVwZGF0ZUNvbnNvbGVWYXJpYWJsZSAoQ29u c29sZVR5cGUsIEluc3RhbmNlLCBOVUxMKTsNCisgICAgICB9IGVsc2Ugew0KKyAgICAgICAgLy8N CisgICAgICAgIC8vIENvbm5lY3QgdGhlIEdPUCBkcml2ZXINCisgICAgICAgIC8vDQorICAgICAg ICBnQlMtPkNvbm5lY3RDb250cm9sbGVyIChHcmFwaGljc0NvbnRyb2xsZXJIYW5kbGUsIE5VTEws IE5VTEwsIFRSVUUpOw0KKyAgICAgICAgLy8NCisgICAgICAgIC8vIEdldCB0aGUgR09QIGRldmlj ZSBwYXRoDQorICAgICAgICAvLyBOT1RFOiBXZSBtYXkgZ2V0IGEgZGV2aWNlIHBhdGggdGhhdCBj b250YWlucyBDb250cm9sbGVyIG5vZGUgaW4gaXQuDQorICAgICAgICAvLw0KKyAgICAgICAgR29w RGV2aWNlUGF0aCA9IEVmaUJvb3RNYW5hZ2VyR2V0R29wRGV2aWNlUGF0aCAoR3JhcGhpY3NDb250 cm9sbGVySGFuZGxlKTsNCisgICAgICAgIGlmIChHb3BEZXZpY2VQYXRoICE9IE5VTEwpIHsNCisg ICAgICAgICAgRWZpQm9vdE1hbmFnZXJVcGRhdGVDb25zb2xlVmFyaWFibGUgKENvbnNvbGVUeXBl LCBHb3BEZXZpY2VQYXRoLCBOVUxMKTsNCisgICAgICAgIH0NCisgICAgICB9DQorICAgICAgYnJl YWs7DQorICAgIGRlZmF1bHQ6DQorICAgICAgQVNTRVJUKEZBTFNFKTsNCisgICAgICBicmVhazsN CisgICAgfQ0KKw0KKyAgICBGcmVlUG9vbCAoSW5zdGFuY2UpOw0KKyAgfSB3aGlsZSAoVGVtcERl dmljZVBhdGggIT0gTlVMTCk7DQorfQ0KKw0KKy8qKg0KKyAgVGhlIGZ1bmN0aW9uIGNvbm5lY3Rz IHRoZSB0cnVzdGVkIGNvbnNvbGVzLg0KKyoqLw0KK1ZPSUQNCitDb25uZWN0VHJ1c3RlZENvbnNv bGUgKA0KKyAgVk9JRA0KKyAgKQ0KK3sNCisgIEVGSV9ERVZJQ0VfUEFUSF9QUk9UT0NPTCAgICAg KkNvbnNvbGVzOw0KKyAgRUZJX0RFVklDRV9QQVRIX1BST1RPQ09MICAgICAqVGVtcERldmljZVBh dGg7DQorICBFRklfREVWSUNFX1BBVEhfUFJPVE9DT0wgICAgICpJbnN0YW5jZTsNCisgIEVGSV9E RVZJQ0VfUEFUSF9QUk9UT0NPTCAgICAgKk5leHQ7DQorICBVSU5UTiAgICAgICAgICAgICAgICAg ICAgICAgIFNpemU7DQorICBVSU5UTiAgICAgICAgICAgICAgICAgICAgICAgIEluZGV4Ow0KKyAg RUZJX0hBTkRMRSAgICAgICAgICAgICAgICAgICBIYW5kbGU7DQorICBFRklfU1RBVFVTICAgICAg ICAgICAgICAgICAgIFN0YXR1czsNCisgIENIQVIxNiAgICAgICAgICAgICAgICAgICAgICAgKkNv bnNvbGVWYXJbXSA9IHtMIkNvbkluIiwgTCJDb25PdXQifTsNCisgIFZPSUQgICAgICAgICAgICAg ICAgICAgICAgICAgKlRydXN0ZWRDb25zb2xlRGV2aWNlcGF0aDsNCisNCisgIFRydXN0ZWRDb25z b2xlRGV2aWNlcGF0aCA9IFBjZEdldFB0ciAoUGNkVHJ1c3RlZENvbnNvbGVJbnB1dERldmljZVBh dGgpOw0KKyAgRHVtcERldmljZVBhdGggKEwiVHJ1c3RlZENvbnNvbGVJbiI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V9ERVZJQ0VfUEFUSCAmJiBEZXZpY2VQYXRoU3ViVHlwZSAoTmV4dCkg PT0gQUNQSV9BRFJfRFApIHsNCisgICAgICAgICAgICAgIGJyZWFrOw0KKyAgICAgICAgICAgIH0g ZWxzZSBpZiAoRGV2aWNlUGF0aFR5cGUgKE5leHQpID09IEhBUkRXQVJFX0RFVklDRV9QQVRIICYm DQorICAgICAgICAgICAgICAgICAgICAgICBEZXZpY2VQYXRoU3ViVHlwZSAoTmV4dCkgPT0gSFdf Q09OVFJPTExFUl9EUCAmJg0KKyAgICAgICAgICAgICAgICAgICAgICAgRGV2aWNlUGF0aFR5cGUg KE5leHREZXZpY2VQYXRoTm9kZSAoTmV4dCkpID09IEFDUElfREVWSUNFX1BBVEggJiYNCisgICAg ICAgICAgICAgICAgICAgICAgIERldmljZVBhdGhTdWJUeXBlIChOZXh0RGV2aWNlUGF0aE5vZGUg KE5leHQpKSA9PSBBQ1BJX0FEUl9EUA0KKyAgICAgICAgICAgICAgICAgICAgICAgKSB7DQorICAg ICAgICAgICAgICBicmVhazsNCisgICAgICAgICAgICB9DQorICAgICAgICAgIH0NCisgICAgICAg ICAgaWYgKCFJc0RldmljZVBhdGhFbmQgKE5leHQpKSB7DQorICAgICAgICAgICAgU2V0RGV2aWNl UGF0aEVuZE5vZGUgKE5leHQpOw0KKyAgICAgICAgICAgIFN0YXR1cyA9IEVmaUJvb3RNYW5hZ2Vy Q29ubmVjdERldmljZVBhdGggKEluc3RhbmNlLCAmSGFuZGxlKTsNCisgICAgICAgICAgICBpZiAo IUVGSV9FUlJPUiAoU3RhdHVzKSkgew0KKyAgICAgICAgICAgICAgZ0JTLT5Db25uZWN0Q29udHJv bGxlciAoSGFuZGxlLCBOVUxMLCBOVUxMLCBUUlVFKTsNCisgICAgICAgICAgICB9DQorICAgICAg ICAgIH0gZWxzZSB7DQorICAgICAgICAgICAgRWZpQm9vdE1hbmFnZXJDb25uZWN0RGV2aWNlUGF0 aCAoSW5zdGFuY2UsIE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CisgIGlmIChnUFBSZXF1aXJlVUlDb25maXJtKSB7DQorICAgIENvbm5l Y3RUcnVzdGVkQ29uc29sZSAoKTsNCisgIH0NCisNCisgIFRjZzJQaHlzaWNhbFByZXNlbmNlTGli UHJvY2Vzc1JlcXVlc3QgKE5VTEwpOw0KK30NCisNCisvKioNCisgIFRoZSBmdW5jdGlvbiBjb25u ZWN0cyB0aGUgdHJ1c3RlZCBzdG9yYWdlIHRvIHBlcmZvcm0gVFBlclJlc2V0Lg0KKyoqLw0KK1ZP SUQNCitQcm9jZXNzVGNnTW9yICgNCisgIFZPSUQNCisgICkNCit7DQorICBpZiAoSXNNb3JCaXRT ZXQgKCkpIHsNCisgICAgQ29ubmVjdFRydXN0ZWRDb25zb2xlKCk7DQorICAgIENvbm5lY3RUcnVz dGVkU3RvcmFnZSgpOw0KKyAgfQ0KK30NCisNCisvKioNCisgIENoZWNrIGlmIGN1cnJlbnQgQm9v dEN1cnJlbnQgdmFyaWFibGUgaXMgaW50ZXJuYWwgc2hlbGwgYm9vdCBvcHRpb24uDQorDQorICBA cmV0dmFsICBUUlVFICAgICAgICAgQm9vdEN1cnJlbnQgaXMgaW50ZXJuYWwgc2hlbGwuDQorICBA cmV0dmFsICBGQUxTRSAgICAgICAgQm9vdEN1cnJlbnQgaXMgbm90IGludGVybmFsIHNoZWxsLg0K KyoqLw0KK0JPT0xFQU4NCitCb290Q3VycmVudElzSW50ZXJuYWxTaGVsbCAoDQorICBWT0lEDQor ICApDQorew0KKyAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgICAgVmFyU2l6ZTsNCisgIFVJ TlQxNiAgICAgICAgICAgICAgICAgICAgICAgIEJvb3RDdXJyZW50Ow0KKyAgQ0hBUjE2ICAgICAg ICAgICAgICAgICAgICAgICAgQm9vdE9wdGlvbk5hbWVbMTZdOw0KKyAgVUlOVDggICAgICAgICAg ICAgICAgICAgICAgICAgKkJvb3RPcHRpb247DQorICBVSU5UOCAgICAgICAgICAgICAgICAgICAg ICAgICAqUHRyOw0KKyAgQk9PTEVBTiAgICAgICAgICAgICAgICAgICAgICAgUmVzdWx0Ow0KKyAg RUZJX1NUQVRVUyAgICAgICAgICAgICAgICAgICAgU3RhdHVzOw0KKyAgRUZJX0RFVklDRV9QQVRI X1BST1RPQ09MICAgICAgKlRlbXBEZXZpY2VQYXRoOw0KKyAgRUZJX0RFVklDRV9QQVRIX1BST1RP Q09MICAgICAgKkxhc3REZXZpY2VOb2RlOw0KKyAgRUZJX0dVSUQgICAgICAgICAgICAgICAgICAg ICAgKkd1aWRQb2ludDsNCisNCisgIEJvb3RPcHRpb24gPSBOVUxMOw0KKyAgUmVzdWx0ICAgICA9 IEZBTFNFOw0KKw0KKyAgLy8NCisgIC8vIEdldCBCb290Q3VycmVudCB2YXJpYWJsZQ0KKyAgLy8N CisgIFZhclNpemUgPSBzaXplb2YgKFVJTlQxNik7DQorICBTdGF0dXMgPSBnUlQtPkdldFZhcmlh YmxlICgNCisgICAgICAgICAgICAgICAgICBMIkJvb3RDdXJyZW50IiwNCisgICAgICAgICAgICAg ICAgICAmZ0VmaUdsb2JhbFZhcmlhYmxlR3VpZCwNCisgICAgICAgICAgICAgICAgICBOVUxMLA0K KyAgICAgICAgICAgICAgICAgICZWYXJTaXplLA0KKyAgICAgICAgICAgICAgICAgICZCb290Q3Vy cmVudA0KKyAgICAgICAgICAgICAgICAgICk7DQorICBpZiAoRUZJX0VSUk9SIChTdGF0dXMpKSB7 DQorICAgIHJldHVybiBGQUxTRTsNCisgIH0NCisNCisgIC8vDQorICAvLyBDcmVhdGUgYm9vdCBv cHRpb24gQm9vdHh4eHggZnJvbSBCb290Q3VycmVudA0KKyAgLy8NCisgIFVuaWNvZGVTUHJpbnQg KEJvb3RPcHRpb25OYW1lLCBzaXplb2YoQm9vdE9wdGlvbk5hbWUpLCBMIkJvb3QlMDRYIiwgQm9v dEN1cnJlbnQpOw0KKw0KKyAgR2V0RWZpR2xvYmFsVmFyaWFibGUyIChCb290T3B0aW9uTmFtZSwg KFZPSUQgKiopICZCb290T3B0aW9uLCAmVmFyU2l6ZSk7DQorICBpZiAoQm9vdE9wdGlvbiA9PSBO VUxMIHx8IFZhclNpemUgPT0gMCkgew0KKyAgICByZXR1cm4gRkFMU0U7DQorICB9DQorDQorICBQ dHIgPSBCb290T3B0aW9uOw0KKyAgUHRyICs9IHNpemVvZiAoVUlOVDMyKTsNCisgIFB0ciArPSBz aXplb2YgKFVJTlQxNik7DQorICBQdHIgKz0gU3RyU2l6ZSAoKENIQVIxNiAqKSBQdHIpOw0KKyAg VGVtcERldmljZVBhdGggPSAoRUZJX0RFVklDRV9QQVRIX1BST1RPQ09MICopIFB0cjsNCisgIExh c3REZXZpY2VOb2RlID0gVGVtcERldmljZVBhdGg7DQorICB3aGlsZSAoIUlzRGV2aWNlUGF0aEVu ZCAoVGVtcERldmljZVBhdGgpKSB7DQorICAgIExhc3REZXZpY2VOb2RlID0gVGVtcERldmljZVBh dGg7DQorICAgIFRlbXBEZXZpY2VQYXRoID0gTmV4dERldmljZVBhdGhOb2RlIChUZW1wRGV2aWNl UGF0aCk7DQorICB9DQorICBHdWlkUG9pbnQgPSBFZmlHZXROYW1lR3VpZEZyb21Gd1ZvbERldmlj ZVBhdGhOb2RlICgNCisgICAgICAgICAgICAgICAgKE1FRElBX0ZXX1ZPTF9GSUxFUEFUSF9ERVZJ Q0VfUEFUSCAqKSBMYXN0RGV2aWNlTm9kZQ0KKyAgICAgICAgICAgICAgICApOw0KKyAgaWYgKChH dWlkUG9pbnQgIT0gTlVMTCkgJiYNCisgICAgICAoKENvbXBhcmVHdWlkIChHdWlkUG9pbnQsICZn VWVmaVNoZWxsRmlsZUd1aWQpKSkNCisgICAgKSB7DQorICAgIC8vDQorICAgIC8vIGlmIHRoaXMg b3B0aW9uIGlzIGludGVybmFsIHNoZWxsLCByZXR1cm4gVFJVRQ0KKyAgICAvLw0KKyAgICBSZXN1 bHQgPSBUUlVFOw0KKyAgfQ0KKw0KKyAgaWYgKEJvb3RPcHRpb24gIT0gTlVMTCkgew0KKyAgICBG cmVlUG9vbCAoQm9vdE9wdGlvbik7DQorICAgIEJvb3RPcHRpb24gPSBOVUxMOw0KKyAgfQ0KKw0K KyAgcmV0dXJuIFJlc3VsdDsNCit9DQorDQorLyoqDQorICBUaGlzIGZ1bmN0aW9uIHdpbGwgY2hh bmdlIHZpZGVvIHJlc29sdXRpb24gYW5kIHRleHQgbW9kZQ0KKyAgZm9yIGludGVybmwgc2hlbGwg d2hlbiBpbnRlcm5hbCBzaGVsbCBpcyBsYXVuY2hlZC4NCisNCisgIEBwYXJhbSAgIE5vbmUuDQor DQorICBAcmV0dmFsICBFRklfU1VDQ0VTUyAgTW9kZSBpcyBjaGFuZ2VkIHN1Y2Nlc3NmdWxseS4N CisgIEByZXR2YWwgIE90aGVycyAgICAgICBNb2RlIGZhaWxlZCB0byBjaGFuZ2VkLg0KKyoqLw0K K0VGSV9TVEFUVVMNCitFRklBUEkNCitDaGFuZ2VNb2RlRm9ySW50ZXJuYWxTaGVsbCAoDQorICBW T0lEDQorICApDQorew0KKyAgRUZJX0dSQVBISUNTX09VVFBVVF9QUk9UT0NPTCAgICAgICAgICAq R3JhcGhpY3NPdXRwdXQ7DQorICBFRklfU0lNUExFX1RFWFRfT1VUUFVUX1BST1RPQ09MICAgICAg ICpTaW1wbGVUZXh0T3V0Ow0KKyAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBTaXplT2ZJbmZvOw0KKyAgRUZJX0dSQVBISUNTX09VVFBVVF9NT0RFX0lORk9STUFUSU9OICAq SW5mbzsNCisgIFVJTlQzMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTWF4R29wTW9k ZTsNCisgIFVJTlQzMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTWF4VGV4dE1vZGU7 DQorICBVSU5UMzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1vZGVOdW1iZXI7DQor ICBVSU5UTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhhbmRsZUNvdW50Ow0KKyAg RUZJX0hBTkRMRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqSGFuZGxlQnVmZmVyOw0KKyAg RUZJX1NUQVRVUyAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdGF0dXM7DQorICBVSU5UTiAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEluZGV4Ow0KKyAgVUlOVE4gICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBDdXJyZW50Q29sdW1uOw0KKyAgVUlOVE4gICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBDdXJyZW50Um93Ow0KKw0KKyAgU3RhdHVzID0gZ0JTLT5I YW5kbGVQcm90b2NvbCAoDQorICAgICAgICAgICAgICAgICAgZ1NULT5Db25zb2xlT3V0SGFuZGxl LA0KKyAgICAgICAgICAgICAgICAgICZnRWZpR3JhcGhpY3NPdXRwdXRQcm90b2NvbEd1aWQsDQor ICAgICAgICAgICAgICAgICAgKFZPSUQqKikmR3JhcGhpY3NPdXRwdXQNCisgICAgICAgICAgICAg ICAgICApOw0KKyAgaWYgKEVGSV9FUlJPUiAoU3RhdHVzKSkgew0KKyAgICBHcmFwaGljc091dHB1 dCA9IE5VTEw7DQorICB9DQorDQorICBTdGF0dXMgPSBnQlMtPkhhbmRsZVByb3RvY29sICgNCisg ICAgICAgICAgICAgICAgICBnU1QtPkNvbnNvbGVPdXRIYW5kbGUsDQorICAgICAgICAgICAgICAg ICAgJmdFZmlTaW1wbGVUZXh0T3V0UHJvdG9jb2xHdWlkLA0KKyAgICAgICAgICAgICAgICAgIChW T0lEKiopJlNpbXBsZVRleHRPdXQNCisgICAgICAgICAgICAgICAgICApOw0KKyAgaWYgKEVGSV9F UlJPUiAoU3RhdHVzKSkgew0KKyAgICBTaW1wbGVUZXh0T3V0ID0gTlVMTDsNCisgIH0NCisNCisg IGlmICgoR3JhcGhpY3NPdXRwdXQgPT0gTlVMTCkg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1iZXIsDQorICAgICAgICAg ICAgICAgICAgICAgICAmU2l6ZU9mSW5mbywNCisgICAgICAgICAgICAgICAgICAgICAgICZJbmZv DQorICAgICAgICAgICAgICAgICAgICAgICApOw0KKyAgICBpZiAoIUVGSV9FUlJPUiAoU3RhdHVz KSkgew0KKyAgICAgIGlmICgoSW5mby0+SG9yaXpvbnRhbFJlc29sdXRpb24gPT0gbVNoZWxsSG9y aXpvbnRhbFJlc29sdXRpb24pICYmDQorICAgICAgICAgIChJbmZvLT5WZXJ0aWNhbFJlc29sdXRp b24gPT0gbVNoZWxsVmVydGljYWxSZXNvbHV0aW9uKSkgew0KKyAgICAgICAgaWYgKChHcmFwaGlj c091dHB1dC0+TW9kZS0+SW5mby0+SG9yaXpvbnRhbFJlc29sdXRpb24gPT0gbVNoZWxsSG9yaXpv bnRhbFJlc29sdXRpb24pICYmDQorICAgICAgICAgICAgKEdyYXBoaWNzT3V0cHV0LT5Nb2RlLT5J bmZvLT5WZXJ0aWNhbFJlc29sdXRpb24gPT0gbVNoZWxsVmVydGljYWxSZXNvbHV0aW9uKSkgew0K KyAgICAgICAgICAvLw0KKyAgICAgICAgICAvLyBJZiBjdXJyZW50IHZpZGVvIHJlc29sdXRpb24g aXMgc2FtZSB3aXRoIG5ldyByZXNvbHV0aW9uLA0KKyAgICAgICAgICAvLyB0aGVuIGNoZWNrIGlm IGN1cnJlbnQgdGV4dCBtb2RlIGlzIHNhbWUgd2l0aCBuZXcgdGV4dCBtb2RlLg0KKyAgICAgICAg ICAvLw0KKyAgICAgICAgICBTdGF0dXMgPSBTaW1wbGVUZXh0T3V0LT5RdWVyeU1vZGUgKFNpbXBs ZVRleHRPdXQsIFNpbXBsZVRleHRPdXQtPk1vZGUtPk1vZGUsICZDdXJyZW50Q29sdW1uLCAmQ3Vy cmVudFJvdyk7DQorICAgICAgICAgIEFTU0VSVF9FRklfRVJST1IgKFN0YXR1cyk7DQorICAgICAg ICAgIGlmIChDdXJyZW50Q29sdW1uID09IG1TaGVsbE1vZGVDb2x1bW4gJiYgQ3VycmVudFJvdyA9 PSBtU2hlbGxNb2RlUm93KSB7DQorICAgICAgICAgICAgLy8NCisgICAgICAgICAgICAvLyBDdXJy ZW50IHRleHQgbW9kZSBpcyBzYW1lIHdpdGggbmV3IHRleHQgbW9kZSwgdGV4dCBtb2RlIG5lZWQg bm90IGJlIGNoYW5nZS4NCisgICAgICAgICAgICAvLw0KKyAgICAgICAgICAgIEZyZWVQb29sIChJ bmZvKTsNCisgICAgICAgICAgICByZXR1cm4gRUZJX1NVQ0NFU1M7DQorICAgICAgICAgIH0gZWxz ZSB7DQorICAgICAgICAgICAgLy8NCisgICAgICAgICAgICAvLyBDdXJyZW50IHRleHQgbW9kZSBp cyBkaWZmZXJlbnQgd2l0aCBuZXcgdGV4dCBtb2RlLCB0ZXh0IG1vZGUgbmVlZCBiZSBjaGFuZ2Ug dG8gbmV3IHRleHQgbW9kZS4NCisgICAgICAgICAgICAvLw0KKyAgICAgICAgICAgIGZvciAoSW5k ZXggPSAwOyBJbmRleCA8IE1heFRleHRNb2RlOyBJbmRleCsrKSB7DQorICAgICAgICAgICAgICBT dGF0dXMgPSBTaW1wbGVUZXh0T3V0LT5RdWVyeU1vZGUgKFNpbXBsZVRleHRPdXQsIEluZGV4LCAm Q3VycmVudENvbHVtbiwgJkN1cnJlbnRSb3cpOw0KKyAgICAgICAgICAgICAgaWYgKCFFRklfRVJS T1IoU3RhdHVzKSkgew0KKyAgICAgICAgICAgICAgICBpZiAoKEN1cnJlbnRDb2x1bW4gPT0gbVNo ZWxsTW9kZUNvbHVtbikgJiYgKEN1cnJlbnRSb3cgPT0gbVNoZWxsTW9kZVJvdykpIHsNCisgICAg ICAgICAgICAgICAgICAvLw0KKyAgICAgICAgICAgICAgICAgIC8vIE5ldyB0ZXh0IG1vZGUgaXMg c3VwcG9ydGVkLCBzZXQgaXQuDQorICAgICAgICAgICAgICAgICAgLy8NCisgICAgICAgICAgICAg ICAgICBTdGF0dXMgPSBTaW1wbGVUZXh0T3V0LT5TZXRNb2RlIChTaW1wbGVUZXh0T3V0LCBJbmRl eCk7DQorICAgICAgICAgICAgICAgICAgQVNTRVJUX0VGSV9FUlJPUiAoU3RhdHVzKTsNCisgICAg ICAgICAgICAgICAgICAvLw0KKyAgICAgICAgICAgICAgICAgIC8vIFVwZGF0ZSB0ZXh0IG1vZGUg UENELg0KKyAgICAgICAgICAgICAgICAgIC8vDQorICAgICAgICAgICAgICAgICAgU3RhdHVzID0g UGNkU2V0MzJTIChQY2RDb25PdXRDb2x1bW4sIG1TaGVsbE1vZGVDb2x1bW4pOw0KKyAgICAgICAg ICAgICAgICAgIEFTU0VSVF9FRklfRVJST1IgKFN0YXR1cyk7DQorDQorICAgICAgICAgICAgICAg ICAgU3RhdHVzID0gUGNkU2V0MzJTIChQY2RDb25PdXRSb3csIG1TaGVsbE1vZGVSb3cpOw0KKyAg ICAgICAgICAgICAgICAgIEFTU0VSVF9FRklfRVJST1IgKFN0YXR1cyk7DQorDQorICAgICAgICAg ICAgICAgICAgRnJlZVBvb2wgKEluZm8pOw0KKyAgICAgICAgICAgICAgICAgIHJldHVybiBFRklf U1VDQ0VTUzsNCisgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgfQ0KKyAgICAgICAg ICAgIH0NCisgICAgICAgICAgICBpZiAoSW5kZXggPT0gTWF4VGV4dE1vZGUpIHsNCisgICAgICAg ICAgICAgIC8vDQorICAgICAgICAgICAgICAvLyBJZiBuZXcgdGV4dCBtb2RlIGlzIG5vdCBzdXBw b3J0ZWQsIHJldHVybiBlcnJvci4NCisgICAgICAgICAgICAgIC8vDQorICAgICAgICAgICAgICBG cmVlUG9vbCAoSW5mbyk7DQorICAgICAgICAgICAgICByZXR1cm4gRUZJX1VOU1VQUE9SVEVEOw0K KyAgICAgICAgICAgIH0NCisgICAgICAgICAgfQ0KKyAgICAgICAgfSBlbHNlIHsNCisgICAgICAg ICAgRnJlZVBvb2wgKEluZm8pOw0KKyAgICA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ChQ Y2RDb25PdXRDb2x1bW4sIG1TaGVsbE1vZGVDb2x1bW4pOw0KKyAgICAgICAgICAgIEFTU0VSVF9F RklfRVJST1IgKFN0YXR1cyk7DQorDQorICAgICAgICAgICAgU3RhdHVzID0gUGNkU2V0MzJTIChQ Y2RDb25PdXRSb3csIG1TaGVsbE1vZGVSb3cpOw0KKyAgICAgICAgICAgIEFTU0VSVF9FRklfRVJS T1IgKFN0YXR1cyk7DQorDQorICAgICAgICAgICAgU3RhdHVzID0gZ0JTLT5Mb2NhdGVIYW5kbGVC dWZmZXIgKA0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQnlQcm90b2NvbCwNCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICZnRWZpU2ltcGxlVGV4dE91dFByb3RvY29sR3VpZCwN CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsDQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmSGFuZGxlQ291bnQsDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm SGFuZGxlQnVmZmVyDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICApOw0KKyAgICAgICAg ICAgIGlmICghRUZJX0VSUk9SIChTdGF0dXMpKSB7DQorICAgICAgICAgICAgICBmb3IgKEluZGV4 ID0gMDsgSW5kZXggPCBIYW5kbGVDb3VudDsgSW5kZXgrKykgew0KKyAgICAgICAgICAgICAgICBn QlMtPkRpc2Nvbm5lY3RDb250cm9sbGVyIChIYW5kbGVCdWZmZXJbSW5kZXhdLCBOVUxMLCBOVUxM KTsNCisgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgIGZvciAoSW5kZXggPSAwOyBJbmRl eCA8IEhhbmRsZUNvdW50OyBJbmRleCsrKSB7DQorICAgICAgICAgICAgICAgIGdCUy0+Q29ubmVj dENvbnRyb2xsZXIgKEhhbmRsZUJ1ZmZlcltJbmRleF0sIE5VTEwsIE5VTEwsIFRSVUUpOw0KKyAg ICAgICAgICAgICAg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SSBzaGVsbCwgY29ubmVjdGluZyBpbnB1 dCBjb25zb2xlcyBhcmUgcmVxdWlyZWQuDQorDQorICBAcGFyYW0gIEV2ZW50ICAgUG9pbnRlciB0 byB0aGlzIGV2ZW50DQorICBAcGFyYW0gIENvbnRleHQgRXZlbnQgaGFubGRlciBwcml2YXRlIGRh dGENCisNCisgIEByZXR2YWwgTm9uZS4NCisqKi8NCitWT0lEDQorRUZJQVBJDQorT25SZWFkeVRv Qm9vdENhbGxCYWNrICgNCisgIElOICBFRklfRVZFTlQgICAgICAgICAgICAgICAgIEV2ZW50LA0K KyAgSU4gIFZPSUQgICAgICAgICAgICAgICAgICAgICAgKkNvbnRleHQNCisgICkNCit7DQorICBE RUJVRyAoKERFQlVHX0lORk8sICJPblJlYWR5VG9Cb290Q2FsbEJhY2tcbiIpKTsNCisNCisgIGlm IChCb290Q3VycmVudElzSW50ZXJuYWxTaGVsbCAoKSkgew0KKw0KKyAgICBDaGFuZ2VNb2RlRm9y SW50ZXJuYWxTaGVsbCAoKTsNCisgICAgRWZpQm9vdE1hbmFnZXJDb25uZWN0QWxsRGVmYXVsdENv bnNvbGVzKCk7DQorICAgIGdEUy0+RGlzcGF0Y2ggKCk7DQorICB9DQorfQ0KKw0KKy8qKg0KKyAg UGxhdGZvcm0gQmRzIGluaXQuIEluY3VkZSB0aGUgcGxhdGZvcm0gZmlybXdhcmUgdmVuZG9yLCBy ZXZpc2lvbg0KKyAgYW5kIHNvIGNyYyBjaGVjay4NCisqKi8NCitWT0lEDQorRUZJQVBJDQorUGxh dGZvcm1Cb290TWFuYWdlckJlZm9yZUNvbnNvbGUgKA0KKyAgVk9JRA0KKyAgKQ0KK3sNCisgIEVG SV9TVEFUVVMgICAgICAgICAgICAgICAgICAgICAgICAgIFN0YXR1czsNCisgIEVGSV9ERVZJQ0Vf UEFUSF9QUk9UT0NPTCAgICAgICAgICAgICpWYXJDb25PdXQ7DQorICBFRklfREVWSUNFX1BBVEhf UFJPVE9DT0wgICAgICAgICAgICAqVmFyQ29uSW47DQorICBFRklfRVZFTlQgICAgICAgICAgICAg ICAgICAgICAgICAgICBFdmVudDsNCisNCisgIERFQlVHICgoREVCVUdfSU5GTywgIlBsYXRmb3Jt Qm9vdE1hbmFnZXJCZWZvcmVDb25zb2xlXG4iKSk7DQorDQorICBTdGF0dXMgPSBFRklfU1VDQ0VT UzsNCisNCisgIC8vDQorICAvLyBHZXQgdXNlciBkZWZpbmVkIHRleHQgbW9kZSBmb3IgaW50ZXJu YWwgc2hlbGwgb25seSBvbmNlLg0KKyAgLy8NCisgIG1TaGVsbEhvcml6b250YWxSZXNvbHV0aW9u ID0gUGNkR2V0MzIgKFBjZFNldHVwVmlkZW9Ib3Jpem9udGFsUmVzb2x1dGlvbik7DQorICBtU2hl bGxWZXJ0aWNhbFJlc29sdXRpb24gICA9IFBjZEdldDMyIChQY2RTZXR1cFZpZGVvVmVydGljYWxS ZXNvbHV0aW9uKTsNCisgIG1TaGVsbE1vZGVDb2x1bW4gICAgICAgICAgID0gUGNkR2V0MzIgKFBj ZFNldHVwQ29uT3V0Q29sdW1uKTsNCisgIG1TaGVsbE1vZGVSb3cgICAgICAgICAgICAgID0gUGNk R2V0MzIgKFBjZFNldHVwQ29uT3V0Um93KTsNCisNCisgIC8vDQorICAvLyBDcmVhdGUgZXZlbnQg dG8gc2V0IHByb3BlciB2aWRlbyByZXNvbHV0aW9uIGFuZCB0ZXh0IG1vZGUgZm9yIGludGVybmFs IHNoZWxsLg0KKyAgLy8NCisgIFN0YXR1cyA9IEVmaUNyZWF0ZUV2ZW50UmVhZHlUb0Jvb3RFeCAo DQorICAgICAgICAgICAgIFRQTF9DQUxMQkFDSywNCisgICAgICAgICAgICAgT25SZWFkeVRvQm9v dENhbGxCYWNrLA0KKyAgICAgICAgICAgICBOVUxMLA0KKyAgICAgICAgICAgICAmRXZlbnQNCisg ICAgICAgICAgICAgKTsNCisgIEFTU0VSVF9FRklfRVJST1IgKFN0YXR1cyk7DQorDQorICAvLw0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KKyMjIw0KKw0KK1tE ZWZpbmVzXQ0KKyAgSU5GX1ZFUlNJT04gICAgICAgICAgICAgICAgICAgID0gMHgwMDAxMDAxNw0K KyAgQkFTRV9OQU1FICAgICAgICAgICAgICAgICAgICAgID0gRHhlUGxhdGZvcm1Cb290TWFuYWdl ckxpYg0KKyAgRklMRV9HVUlEICAgICAgICAgICAgICAgICAgICAgID0gQTZCQzM4NUQtNTlFNS00 Qjc3LTg3RDctMjAwQUJBQTgzQzE1DQorICBWRVJTSU9OX1NUUklORyAgICAgICAgICAgICAgICAg PSAxLjANCisgIE1PRFVMRV9UWVBFICAgICAgICAgICAgICAgICAgICA9IERYRV9EUklWRVINCisg IFVFRklfU1BFQ0lGSUNBVElPTl9WRVJTSU9OICAgICA9IDIuMTANCisgIExJQlJBUllfQ0xBU1Mg ICAgICAgICAgICAgICAgICA9IFBsYXRmb3JtQm9vdE1hbmFnZXJMaWJ8RFhFX0RSSVZFUg0KKyMN CisjIFRoZSBmb2xsb3dpbmcgaW5mb3JtYXRpb24gaXMgZm9yIHJlZmVyZW5jZSBvbmx5IGFuZCBu b3QgcmVxdWlyZWQgYnkgdGhlIGJ1aWxkIHRvb2xzLg0KKyMNCisjIFZBTElEX0FSQ0hJVEVDVFVS RVMgPSBJQTMyIFg2NCBFQkMNCisjDQorDQorW0xpYnJhcnlDbGFzc2VzXQ0KKyAgQmFzZUxpYg0K KyAgTWVtb3J5QWxsb2NhdGlvbkxpYg0KKyAgVWVmaUJvb3RTZXJ2aWNlc1RhYmxlTGliDQorICBV ZWZpUnVudGltZVNlcnZpY2VzVGFibGVMaWINCisgIEJhc2VNZW1vcnlMaWINCisgIERlYnVnTGli DQorICBQY2RMaWINCisgIFByaW50TGliDQorICBEZXZpY2VQYXRoTGliDQorICBVZWZpTGliDQor ICBIb2JMaWINCisgIER4ZVNlcnZpY2VzTGliDQorICBEeGVTZXJ2aWNlc1RhYmxlTGliDQorICBI aWlMaWINCisgIFVlZmlCb290TWFuYWdlckxpY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b24uYw0KKyAgTWVt b3J5VGVzdC5jDQorDQorW1Byb3RvY29sc10NCisgIGdFZmlQY2lSb290QnJpZGdlSW9Qcm90b2Nv bEd1aWQgICAgICAgICAgICAgICAjIyBDT05TVU1FUw0KKyAgZ0VmaVBjaUlvUHJvdG9jb2xHdWlk ICAgICAgICAgICAgICAgICAgICAgICAgICMjIENPTlNVTUVTDQorICBnRWZpQ3B1SW8yUHJvdG9j b2xHdWlkICAgICAgICAgICAgICAgICAgICAgICAgIyMgQ09OU1VNRVMNCisgIGdFZmlEeGVTbW1S ZWFkeVRvTG9ja1Byb3RvY29sR3VpZCAgICAgICAgICAgICAjIyBQUk9EVUNFUw0KKyAgZ0VmaUdl bmVyaWNNZW1UZXN0UHJvdG9jb2xHdWlkICAgICAgICAgICAgICAgICMjIENPTlNVTUVTDQorICBn RWZpRGlza0luZm9Qcm90b2NvbEd1aWQgICAgICAgICAgICAgICAgICAgICAgIyMgQ09OU1VNRVMN CisgIGdFZmlEZXZpY2VQYXRoVG9UZXh0UHJvdG9jb2xHdWlkICAgICAgICAgICAgICAjIyBDT05T VU1FUw0KKyAgZ0VmaVNpbXBsZVRleHRJbnB1dEV4UHJvdG9jb2xHdWlkICAgICAgICAgICAgICMj IENPTlNVTUVTDQorICBnRWZpRmlybXdhcmVWb2x1bWUyUHJvdG9jb2xHdWlkICAgICAgICAgICAg ICAgIyMgQ09OU1VNRVMNCisgIGdFZmlGb3JtQnJvd3NlcjJQcm90b2NvbEd1aWQgICAgICAgICAg ICAgICAgICAjIyBDT05TVU1FUw0KKyAgZ0VmaUdlbmVyaWNNZW1UZXN0UHJvdG9jb2xHdWlkICAg ICAgICAgICAgICAgICMjIENPTlNVTUVTDQorDQorW0d1aWRzXQ0KKyAgZ0VmaUdsb2JhbFZhcmlh YmxlR3VpZCAgICAgICAgICAgICAgICAgICAgICAgICMjIFBST0RVQ0VTDQorICBnRWZpTWVtb3J5 T3ZlcndyaXRlQ29udHJvbERhdGFHdWlkICAgICAgICA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0IGludGVuc2l2ZSBsZXZlbCwNCisgIGFuZCB1 cGRhdGUgdGhlIG1lbW9yeSByZXNvdXJjZS4NCisNCisgIEBwYXJhbSAgTGV2ZWwgICAgICAgICBU aGUgbWVtb3J5IHRlc3QgaW50ZW5zaXZlIGxldmVsLg0KKw0KKyAgQHJldHZhbCBFRklfU1RBVFVT ICAgIFN1Y2Nlc3MgdGVzdCBhbGwgdGhlIHN5c3RlbSBtZW1vcnkgYW5kIHVwZGF0ZQ0KKyAgICAg ICAgICAgICAgICAgICAgICAgIHRoZSBtZW1vcnkgcmVzb3VyY2UNCisNCisqKi8NCitFRklfU1RB VFVTDQorTWVtb3J5VGVzdCAoDQorICBJTiBFWFRFTkRNRU1fQ09WRVJBR0VfTEVWRUwgTGV2ZWwN CisgICkNCit7DQorICBFRklfU1RBVFVTICAgICAgICAgICAgICAgICAgICAgICAgU3RhdHVzOw0K KyAgQk9PTEVBTiAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlcXVpcmVTb2Z0RUNDSW5pdDsN CisgIEVGSV9HRU5FUklDX01FTU9SWV9URVNUX1BST1RPQ09MICAqR2VuTWVtb3J5VGVzdDsNCisg IFVJTlQ2NCAgICAgICAgICAgICAgICAgICAgICAgICAgICBUZXN0ZWRNZW1vcnlTaXplOw0KKyAg VUlOVDY0ICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRvdGFsTWVtb3J5U2l6ZTsNCisgIEJP T0xFQU4gICAgICAgICAgICAgICAgICAgICAgICAgICBFcnJvck91dDsNCisgIEJPT0xFQU4gICAg ICAgICAgICAgICAgICAgICAgICAgICBUZXN0QWJvcnQ7DQorDQorICBUZXN0ZWRNZW1vcnlTaXpl ICA9IDA7DQorICBUb3RhbE1lbW9yeVNpemUgICA9IDA7DQorICBFcnJvck91dCAgICAgICAgICA9 IEZBTFNFOw0KKyAgVGVzdEFib3J0ICAgICAgICAgPSBGQUxTRTsNCisNCisgIFJlcXVpcmVTb2Z0 RUNDSW5pdCA9IEZBTFNFOw0KKw0KKyAgU3RhdHVzID0gZ0JTLT5Mb2NhdGVQcm90b2NvbCAoDQor ICAgICAgICAgICAgICAgICAgJmdFZmlHZW5lcmljTWVtVGVzdFByb3RvY29sR3VpZCwNCisgICAg ICAgICAgICAgICAgICBOVUxMLA0KKyAgICAgICAgICAgICAgICAgIChWT0lEICoqKSAmR2VuTWVt b3J5VGVzdA0KKyAgICAgICAgICAgICAgICAgICk7DQorICBpZiAoRUZJX0VSUk9SIChTdGF0dXMp KSB7DQorICAgIHJldHVybiBFRklfU1VDQ0VTUzsNCisgIH0NCisNCisgIFN0YXR1cyA9IEdlbk1l bW9yeVRlc3QtPk1lbW9yeVRlc3RJbml0ICgNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIEdlbk1lbW9yeVRlc3QsDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMZXZl bCwNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZSZXF1aXJlU29mdEVDQ0luaXQN CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7DQorICBpZiAoU3RhdHVzID09IEVG SV9OT19NRURJQSkgew0KKyAgICAvLw0KKyAgICAvLyBUaGUgUEVJIGNvZGVzIGFsc28gaGF2ZSB0 aGUgcmVsZXZhbnQgbWVtb3J5IHRlc3QgY29kZSB0byBjaGVjayB0aGUgbWVtb3J5LA0KKyAgICAv LyBpdCBjYW4gc2VsZWN0IHRvIHRlc3Qgc29tZSByYW5nZSBvZiB0aGUgbWVtb3J5IG9yIGFsbCBv ZiB0aGVtLiBJZiBQRUkgY29kZQ0KKyAgICAvLyBjaGVja3MgYWxsIHRoZSBtZW1vcnksIHRoaXMg QkRTIG1lbW9yeSB0ZXN0IHdpbGwgaGFzIG5vIG5vdC10ZXN0IG1lbW9yeSB0bw0KKyAgICAvLyBk byB0aGUgdGVzdCwgYW5kIHRoZW4gdGhlIHN0YXR1cyBvZiBFRklfTk9fTUVESUEgd2lsbCBiZSBy ZXR1cm5lZCBieQ0KKyAgICAvLyAiTWVtb3J5VGVzdEluaXQiLiBTbyBpdCBkb2VzIG5vdCBuZWVk IHRvIHRlc3QgbWVtb3J5IGFnYWluLCBqdXN0IHJldHVybi4NCisgICAgLy8NCisgICAgcmV0dXJu IEVGSV9TVUNDRVNTOw0KKyAgfQ0KKw0KKyAgZG8gew0KKyAgICBTdGF0dXMgPSBHZW5NZW1vcnlU ZXN0LT5QZXJmb3JtTWVtb3J5VGVzdCAoDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg R2VuTWVtb3J5VGVzdCwNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmVGVzdGVkTWVt b3J5U2l6ZSwNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmVG90YWxNZW1vcnlTaXpl LA0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZFcnJvck91dCwNCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBUZXN0QWJvcnQNCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICApOw0KKyAgICBpZiAoRXJyb3JPdXQgJiYgKFN0YXR1cyA9PSBFRklfREVWSUNFX0VSUk9S KSkgew0KKyAgICAgIEFTU0VSVCAoMCk7DQorICAgIH0NCisgIH0gd2hpbGUgKFN0YXR1cyAhPSBF RklfTk9UX0ZPVU5EKTsNCisNCisgIFN0YXR1cyA9IEdlbk1lbW9yeVRlc3QtPkZpbmlzaGVkIChH ZW5NZW1vcnlUZXN0KTsNCisNCisgIHJldHVybiBFRklfU1VDQ0VTUzsNCit9DQpkaWZmIC0tZ2l0 IGEvUGxhdGZvcm0vSW50ZWwvVmx2MlRibHREZXZpY2VQa2cvTGlicmFyeS9EeGVQbGF0Zm9ybUJv b3RNYW5hZ2VyTGliL1BsYXRmb3JtQm9vdE9wdGlvbi5jIGIvUGxhdGZvcm0vSW50ZWwvVmx2MlRi bHREZXZpY2VQa2cvTGlicmFyeS9EeGVQbGF0Zm9ybUJvb3RNYW5hZ2V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9uIHdpbGwg Y3JlYXRlIGEgU0hFTEwgQm9vdE9wdGlvbiB0byBib290Lg0KKw0KK0FyZ3VtZW50czoNCisNCisg IE5vbmUuDQorDQorUmV0dXJuczoNCisNCisgIFNoZWxsIERldmljZSBwYXRoIGZvciBib290aW5n Lg0KKw0KKy0tKi8NCit7DQorICBVSU5UTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRnZI YW5kbGVDb3VudDsNCisgIEVGSV9IQU5ETEUgICAgICAgICAgICAgICAgICAgICAgICAqRnZIYW5k bGVCdWZmZXI7DQorICBVSU5UTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW5kZXg7DQor ICBFRklfU1RBVFVTICAgICAgICAgICAgICAgICAgICAgICAgU3RhdHVzOw0KKyAgRUZJX0ZJUk1X QVJFX1ZPTFVNRTJfUFJPVE9DT0wgICAgICpGdjsNCisgIFVJTlROICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBTaXplOw0KKyAgVUlOVDMyICAgICAgICAgICAgICAgICAgICAgICAgICAgIEF1 dGhlbnRpY2F0aW9uU3RhdHVzOw0KKyAgRUZJX0RFVklDRV9QQVRIX1BST1RPQ09MICAgICAgICAg ICpEZXZpY2VQYXRoOw0KKyAgVk9JRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICpCdWZm ZXI7DQorDQorICBEZXZpY2VQYXRoICA9IE5VTEw7DQorICBTdGF0dXMgICAgICA9IEVGSV9TVUND RVNTOw0KKw0KKyAgREVCVUcgKChERUJVR19JTkZPLCAiQmRzQ3JlYXRlU2hlbGxEZXZpY2VQYXRo XG4iKSk7DQorICBnQlMtPkxvY2F0ZUhhbmRsZUJ1ZmZlciAoDQorICAgICAgICBCeVByb3RvY29s LA0KKyAgICAgICAgJmdFZmlGaXJtd2FyZVZvbHVtZTJQcm90b2NvbEd1aWQsDQorICAgICAgICBO VUxMLA0KKyAgICAgICAgJkZ2SGFuZGxlQ291bnQsDQorICAgICAgICAmRnZIYW5kbGVCdWZmZXIN CisgICAgICAgICk7DQorDQorICBmb3IgKEluZGV4ID0gMDsgSW5kZXggPCBGdkhhbmRsZUNvdW50 OyBJbmRleCsrKSB7DQorICAgIGdCUy0+SGFuZGxlUHJvdG9jb2wgKA0KKyAgICAgICAgICBGdkhh bmRsZUJ1ZmZlcltJbmRleF0sDQorICAgICAgICAgICZnRWZpRmlybXdhcmVWb2x1bWUyUHJvdG9j b2xHdWlkLA0KKyAgICAgICAgICAoVk9JRCAqKikgJkZ2DQorICAgICAgICAgICk7DQorDQorICAg IEJ1ZmZlciAgPSBOVUxMOw0KKyAgICBTaXplICAgID0gMDsNCisgICAgU3RhdHVzICA9IEZ2LT5S ZWFkU2VjdGlvbiAoDQorICAgICAgICAgICAgICAgICAgICBGdiwNCisgICAgICAgICAgICAgICAg ICAgICZnVWVmaVNoZWxsRmlsZUd1aWQsDQorICAgICAgICAgICAgICAgICAgICBFRklfU0VDVElP Tl9QRTMyLA0KKyAgICAgICAgICAgICAgICAgICAgMCwNCisgICAgICAgICAgICAgICAgICAgICZC dWZmZXIsDQorICAgICAgICAgICAgICAgICAgICAmU2l6ZSwNCisgICAgICAgICAgICAgICAgICAg ICZBdXRoZW50aWNhdGlvblN0YXR1cw0KKyAgICAgICAgICAgICAgICAgICAgKTsNCisgICAgaWYg KEVGSV9FUlJPUiAoU3RhdHVzKSkgew0KKyAgICAgIC8vDQorICAgICAgLy8gU2tpcCBpZiBubyBz aGVsbCBmaWxlIGluIHRoZSBGVg0KKyAgICAgIC8vDQorICAgICAgY29udGludWU7DQorICAgIH0g ZWxzZSB7DQorICAgICAgLy8NCisgICAgICAvLyBGb3VuZCB0aGUgc2hlbGwNCisgICAgICAvLw0K KyAgICAgIGJyZWFrOw0KKyAgICB9DQorICB9DQorDQorICBpZiAoRUZJX0VSUk9SIChTdGF0dXMp KSB7DQorICAgIC8vDQorICAgIC8vIE5vIHNoZWxsIHByZXNlbnQNCisgICAgLy8NCisgICAgaWYg KEZ2SGFuZGxlQ291bnQpIHsNCisgICAgICBGcmVlUG9vbCAoRnZIYW5kbGVCdWZmZXIpOw0KKyAg ICB9DQorICAgIHJldHVybiBOVUxMOw0KKyAgfQ0KKyAgLy8NCisgIC8vIEJ1aWxkIHRoZSBzaGVs bCBib290IG9wdGlvbg0KKyAgLy8NCisgIERldmljZVBhdGggPSBEZXZpY2VQYXRoRnJvbUhhbmRs ZSAoRnZIYW5kbGVCdWZmZXJbSW5kZXhdKTsNCisNCisgIGlmIChGdkhhbmRsZUNvdW50KSB7DQor ICAgIEZyZWVQb29sIChGdkhhbmRsZUJ1ZmZlcik7DQorICB9DQorDQorICByZXR1cm4gRGV2aWNl UGF0aDsNCit9DQorDQorDQorRUZJX1NUQVRVUw0KK0NyZWF0ZUZ2Qm9vdE9wdGlvbiAoDQorICBF RklfR1VJRCAgICAgICAgICAgICAgICAgICAgICpGaWxlR3VpZCwNCisgIENIQVIxNiAgICAgICAg ICAgICAgICAgICAgICAgKkRlc2NyaXB0aW9uLA0KKyAgRUZJX0JPT1RfTUFOQUdFUl9MT0FEX09Q VElPTiAqQm9vdE9wdGlvbiwNCisgIFVJTlQzMiAgICAgICAgICAgICAgICAgICAgICAgQXR0cmli dXRlcywNCisgIFVJTlQ4ICAgICAgICAgICAgICAgICAgICAgICAgKk9wdGlvbmFsRGF0YSwgICAg T1BUSU9OQUwNCisgIFVJTlQzMiAgICAgICAgICAgICAgICAgICAgICAgT3B0aW9uYWxEYXRhU2l6 ZQ0KKyAgKQ0KK3sNCisgIEVGSV9TVEFUVVMgICAgICAgICAgICAgICAgICAgICAgICAgU3RhdHVz Ow0KKyAgRUZJX0RFVklDRV9QQVRIX1BST1RPQ09MICAgICAgICAgICAqRGV2aWNlUGF0aDsNCisg IEVGSV9MT0FERURfSU1BR0VfUFJPVE9DT0wgICAgICAgICAgKkxvYWRlZEltYWdlOw0KKyAgTUVE SUFfRldfVk9MX0ZJTEVQQVRIX0RFVklDRV9QQVRIICBGaWxlTm9kZTsNCisgIEVGSV9GSVJNV0FS RV9WT0xVTUUyX1BST1RPQ09MICAgICAgKkZ2Ow0KKyAgVUlOVDMyICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBBdXRoZW50aWNhdGlvblN0YXR1czsNCisgIFZPSUQgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgKkJ1ZmZlcjsNCisgIFVJTlROICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgU2l6ZTsNCisNCisgIGlmICgoQm9vdE9wdGlvbiA9PSBOVUxMKSB8fCAoRmlsZUd1aWQg PT0gTlVMTCkgfHwgKERlc2NyaXB0aW9uID09IE5VTEwpKSB7DQorICAgIHJldHVybiBFRklfSU5W QUxJRF9QQVJBTUVURVI7DQorICB9DQorDQorICBFZmlJbml0aWFsaXplRndWb2xEZXZpY2VwYXRo Tm9kZSAoJkZpbGVOb2RlLCBGaWxlR3VpZCk7DQorDQorICBpZiAoIUNvbXBhcmVHdWlkICgmZ1Vl ZmlTaGVsbEZpbGVHdWlkLCBGaWxlR3VpZCkpIHsNCisgICAgU3RhdHVzID0gZ0JTLT5IYW5kbGVQ cm90b2NvbCAoDQorICAgICAgICAgICAgICAgICAgICBnSW1hZ2VIYW5kbGUsDQorICAgICAgICAg ICAgICAgICAgICAmZ0VmaUxvYWRlZEltYWdlUHJvdG9jb2xHdWlkLA0KKyAgICAgICAgICAgICAg ICAgICAgKFZPSUQgKiopICZMb2FkZWRJbWFnZQ0KKyAgICAgICAgICAgICAgICAgICAgKTsNCisg ICAgaWYgKCFFRklfRVJST1IgKFN0YXR1cykpIHsNCisgICAgICBTdGF0dXMgPSBnQlMtPkhhbmRs ZVByb3RvY29sICgNCisgICAgICAgICAgICAgICAgICAgICAgTG9hZGVkSW1hZ2UtPkRldmljZUhh bmRsZSwNCisgICAgICAgICAgICAgICAgICAgICAgJmdFZmlGaXJtd2FyZVZvbHVtZTJQcm90b2Nv bEd1aWQsDQorICAgICAgICAgICAgICAgICAgICAgIChWT0lEICoqKSAmRnYNCisgICAgICAgICAg ICAgICAgICAgICAgKTsNCisgICAgICBpZiAoIUVGSV9FUlJPUiAoU3RhdHVzKSkgew0KKyAgICAg ICAgQnVmZmVyICA9IE5VTEw7DQorICAgICAgICBTaXplICAgID0gMDsNCisgICAgICAgIFN0YXR1 cyAgPSBGdi0+UmVhZFNlY3Rpb24gKA0KKyAgICAgICAgICAgICAgICAgICAgICAgIEZ2LA0KKyAg ICAgICAgICAgICAgICAgICAgICAgIEZpbGVHdWlkLA0KKyAgICAgICAgICAgICAgICAgICAgICAg IEVGSV9TRUNUSU9OX1BFMzIsDQorICAgICAgICAgICAgICAgICAgICAgICAgMCwNCisgICAgICAg ICAgICAgICAgICAgICAgICAmQnVmZmVyLA0KKyAgICAgICAgICAgICAgICAgICAgICAgICZTaXpl LA0KKyAgICAgICAgICAgICAgICAgICAgICAgICZBdXRoZW50aWNhdGlvblN0YXR1cw0KKyAgICAg ICAgICAgICAgICAgICAgICAgICk7DQorICAgICAgICBpZiAoQnVmZmVyICE9IE5VTEwpIHsNCisg ICAgICAgICAgRnJlZVBvb2wgKEJ1ZmZlcik7DQorICAgICAgICB9DQorICAgICAgfQ0KKyAgICB9 DQorICAgIGlmIChFRklfRVJST1IgKFN0YXR1cykpIHsNCisgICAgICByZXR1cm4gRUZJX05PVF9G T1VORDsNCisgICAgfQ0KKw0KKyAgICBEZXZpY2VQYXRoID0gQXBwZW5kRGV2aWNlUGF0aE5vZGUg KA0KKyAgICAgICAgICAgICAgICAgICBEZXZpY2VQYXRoRnJvbUhhbmRsZSAoTG9hZGVkSW1hZ2Ut PkRldmljZUhhbmRsZSksDQorICAgICAgICAgICAgICAgICAgIChFRklfREVWSUNFX1BBVEhfUFJP VE9DT0wgKikgJkZpbGVOb2RlDQorICAgICAgICAgICAgICAgICAgICk7DQorICB9IGVsc2Ugew0K KyAgICBEZXZpY2VQYXRoID0gQXBwZW5kRGV2aWNlUGF0aE5vZGUgKA0KKyAgICAgICAgICAgICAg ICAgICBCZHNDcmVhdGVTaGVsbERldmljZVBhdGggKCksDQorICAgICAgICAgICAgICAgICAgIChF RklfREVWSUNFX1BBVEhfUFJPVE9DT0wgKikgJkZpbGVOb2RlDQorICAgICAgICAgICAgICAgICAg ICk7DQorICB9DQorDQorICBTdGF0dXMgPSBFZmlCb290TWFuYWdlckluaXRpYWxpemVMb2FkT3B0 aW9uICgNCisgICAgICAgICAgICAgQm9vdE9wdGlvbiwNCisgICAgICAgICAgICAgTG9hZE9wdGlv bk51bWJlclVuYXNzaWduZWQsDQorICAgICAgICAgICAgIExvYWRPcHRpb25UeXBlQm9vdCwNCisg ICAgICAgICAgICAgQXR0cmlidXRlcywNCisgICAgICAgICAgICAgRGVzY3JpcHRpb24sDQorICAg ICAgICAgICAgIERldmljZVBhdGgsDQorICAgICAgICAgICAgIE9wdGlvbmFsRGF0YSwNCisgICAg ICAgICAgICAgT3B0aW9uYWxEYXRhU2l6ZQ0KKyAgICAgICAgICAgICApOw0KKyAgRnJlZVBvb2wg KERldmljZVBhdGgpOw0KKyAgcmV0dXJuIFN0YXR1czsNCit9DQorDQorRUZJX0dVSUQgbVVpRmls ZSA9IHsNCisgIDB4NDYyQ0FBMjEsIDB4NzYxNCwgMHg0NTAzLCB7IDB4ODMsIDB4NkUsIDB4OEEs IDB4QjYsIDB4RjQsIDB4NjYsIDB4MjMsIDB4MzEgfQ0KK307DQorRUZJX0dVSUQgbUJvb3RNZW51 RmlsZSA9IHsNCisgIDB4RUVDMjVCREMsIDB4NjdGMiwgMHg0RDk1LCB7IDB4QjEsIDB4RDUsIDB4 RjgsIDB4MUIsIDB4MjAsIDB4MzksIDB4RDEsIDB4MUQgfQ0KK307DQorDQorDQorLyoqDQorICBS ZXR1cm4gdGhlIGluZGV4IG9mIHRoZSBsb2FkIG9wdGlvbiBpbiB0aGUgbG9hZCBvcHRpb24gYXJy YXkuDQorDQorICBUaGUgZnVuY3Rpb24gY29uc2lkZXIgdHdvIGxvYWQgb3B0aW9ucyBhcmUgZXF1 YWwgd2hlbiB0aGUNCisgIE9wdGlvblR5cGUsIEF0dHJpYnV0ZXMsIERlc2NyaXB0aW9uLCBGaWxl UGF0aCBhbmQgT3B0aW9uYWxEYXRhIGFyZSBlcXVhbC4NCisNCisgIEBwYXJhbSBLZXkgICAgUG9p bnRlciB0byB0aGUgbG9hZCBvcHRpb24gdG8gYmUgZm91bmQuDQorICBAcGFyYW0gQXJyYXkgIFBv aW50ZXIgdG8gdGhlIGFycmF5IG9mIGxvYWQgb3B0aW9ucyB0byBiZSBmb3VuZC4NCisgIEBwYXJh bSBDb3VudCAgTnVtYmVyIG9mIGVudHJpZXMgaW4gdGhlIEFycmF5Lg0KKw0KKyAgQHJldHZhbCAt MSAgICAgICAgICBLZXkgd2Fzbid0IGZvdW5kIGluIHRoZSBBcnJheS4NCisgIEByZXR2YWwgMCB+ IENvdW50LTEgVGhlIGluZGV4IG9mIHRoZSBLZXkgaW4gdGhlIEFycmF5Lg0KKyoqLw0KK0lOVE4N CitQbGF0Zm9ybUZpbmRMb2FkT3B0aW9uICgNCisgIElOIENPTlNUIEVGSV9CT09UX01BTkFHRVJf TE9BRF9PUFRJT04gKktleSwNCisgIElOIENPTlNUIEVGSV9CT09UX01BTkFHRVJfTE9BRF9PUFRJ T04gKkFycmF5LA0KKyAgSU4gVUlOVE4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDb3Vu dA0KKyAgKQ0KK3sNCisgIFVJTlROICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbmRleDsN CisNCisgIGZvciAoSW5kZXggPSAwOyBJbmRleCA8IENvdW50OyBJbmRleCsrKSB7DQorICAgIGlm ICgoS2V5LT5PcHRpb25UeXBlID09IEFycmF5W0luZGV4XS5PcHRpb25UeXBlKSAmJg0KKyAgICAg ICAgKEtleS0+QXR0cmlidXRlcyA9PSBBcnJheVtJbmRleF0uQXR0cmlidXRlcykgJiYNCisgICAg ICAgIChTdHJDbXAgKEtleS0+RGVzY3JpcHRpb24sIEFycmF5W0luZGV4XS5EZXNjcmlwdGlvbikg PT0gMCkgJiYNCisgICAgICAgIChDb21wYXJlTWVtIChLZXktPkZpbGVQYXRoLCBBcnJheVtJbmRl eF0uRmlsZVBhdGgsIEdldERldmljZVBhdGhTaXplIChLZXktPkZpbGVQYXRoKSkgPT0gMCkgJiYN CisgICAgICAgIChLZXktPk9wdGlvbmFsRGF0YVNpemUgPT0gQXJyYXlbSW5kZXhdLk9wdGlvbmFs RGF0YVNpemUpICYmDQorICAgICAgICAoQ29tcGFyZU1lbSAoS2V5LT5PcHRpb25hbERhdGEsIEFy cmF5W0luZGV4XS5PcHRpb25hbERhdGEsIEtleS0+T3B0aW9uYWxEYXRhU2l6ZSkgPT0gMCkpIHsN CisgICAgICByZXR1cm4gKElOVE4pIEluZGV4Ow0KKyAgICB9DQorICB9DQorDQorICByZXR1cm4g LTE7DQorfQ0KKw0KK1VJTlRODQorUmVnaXN0ZXJGdkJvb3RPcHRpb24gKA0KKyAgRUZJX0dVSUQg ICAgICAgICAgICAgICAgICAgICAgICAgKkZpbGVHdWlkLA0KKyAgQ0hBUjE2ICAgICAgICAgICAg ICAgICAgICAgICAgICAgKkRlc2NyaXB0aW9uLA0KKyAgVUlOVE4gICAgICAgICAgICAgICAgICAg ICAgICAgICAgUG9zaXRpb24sDQorICBVSU5UMzIgICAgICAgICAgICAgICAgICAgICAgICAgICBB dHRyaWJ1dGVzLA0KKyAgVUlOVDggICAgICAgICAgICAgICAgICAgICAgICAgICAgKk9wdGlvbmFs RGF0YSwgICAgT1BUSU9OQUwNCisgIFVJTlQzMiAgICAgICAgICAgICAgICAgICAgICAgICAgIE9w dGlvbmFsRGF0YVNpemUNCisgICkNCit7DQorICBFRklfU1RBVFVTICAgICAgICAgICAgICAgICAg ICAgICBTdGF0dXM7DQorICBVSU5UTiAgICAgICAgICAgICAgICAgICAgICAgICAgICBPcHRpb25J bmRleDsNCisgIEVGSV9CT09UX01BTkFHRVJfTE9BRF9PUFRJT04gICAgIE5ld09wdGlvbjsNCisg IEVGSV9C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M T0dJQ0FMX1VOSVRfRFApIHsNCisgICAgICAgIC8vDQorICAgICAgICAvLyBpZiB0aGUgbmV4dCBu b2RlIHR5cGUgaXMgRGV2aWNlIExvZ2ljYWwgVW5pdCwgd2hpY2ggc3BlY2lmeSB0aGUgTG9naWNh bCBVbml0IE51bWJlciAoTFVOKSwNCisgICAgICAgIC8vIHNraXAgaXQNCisgICAgICAgIC8vDQor ICAgICAgICBOZXh0Tm9kZSA9IE5leHREZXZpY2VQYXRoTm9kZSAoTmV4dE5vZGUpOw0KKyAgICAg IH0NCisgICAgICBpZiAoSXNEZXZpY2VQYXRoRW5kVHlwZSAoTmV4dE5vZGUpKSB7DQorICAgICAg ICBpZiAoKERldmljZVBhdGhUeXBlIChOb2RlKSA9PSBNRVNTQUdJTkdfREVWSUNFX1BBVEgpKSB7 DQorICAgICAgICAgIHJldHVybiBEZXZpY2VQYXRoU3ViVHlwZSAoTm9kZSk7DQorICAgICAgICB9 IGVsc2Ugew0KKyAgICAgICAgICByZXR1cm4gTVNHX1NBVEFfRFA7DQorICAgICAgICB9DQorICAg ICAgfQ0KKyAgICB9DQorICB9DQorDQorICByZXR1cm4gKFVJTlQ4KSAtMTsNCit9DQorDQorLyoq DQorICBSZXR1cm5zIHRoZSBwcmlvcml0eSBudW1iZXIuDQorICBPcHRpb25UeXBlICAgICAgICAg ICAgICAgICBFRkkNCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KKyAg UFhFICAgICAgICAgICAgICAgICAgICAgICAgIDINCisgIERWRCAgICAgICAgICAgICAgICAgICAg ICAgICA0DQorICBVU0IgICAgICAgICAgICAgICAgICAgICAgICAgNg0KKyAgTlZNRSAgICAgICAg ICAgICAgICAgICAgICAgIDcNCisgIEhERCAgICAgICAgICAgICAgICAgICAgICAgICA4DQorICBF RkkgU2hlbGwgICAgICAgICAgICAgICAgICAgOQ0KKyAgT3RoZXJzICAgICAgICAgICAgICAgICAg ICAgIDEwMA0KKw0KKyAgQHBhcmFtIEJvb3RPcHRpb24NCisqKi8NCitVSU5UTg0KK0Jvb3RPcHRp b25Qcmlvcml0eSAoDQorICBDT05TVCBFRklfQk9PVF9NQU5BR0VSX0xPQURfT1BUSU9OICpCb290 T3B0aW9uDQorICApDQorew0KKyAgICAvLw0KKyAgICAvLyBFRkkgYm9vdCBvcHRpb25zDQorICAg IC8vDQorICAgIHN3aXRjaCAoQm9vdE9wdGlvblR5cGUgKEJvb3RPcHRpb24tPkZpbGVQYXRoKSkg ew0KKyAgICBjYXNlIE1TR19NQUNfQUREUl9EUDoNCisgICAgY2FzZSBNU0dfVkxBTl9EUDoNCisg ICAgY2FzZSBNU0dfSVB2NF9EUDoNCisgICAgY2FzZSBNU0dfSVB2Nl9EUDoNCisgICAgICByZXR1 cm4gMjsNCisNCisgICAgY2FzZSBNU0dfU0FUQV9EUDoNCisgICAgY2FzZSBNU0dfQVRBUElfRFA6 DQorICAgIGNhc2UgTVNHX1VGU19EUDoNCisgICAgY2FzZSBNU0dfTlZNRV9OQU1FU1BBQ0VfRFA6 DQorICAgICAgcmV0dXJuIDQ7DQorDQorICAgIGNhc2UgTVNHX1VTQl9EUDoNCisgICAgICByZXR1 cm4gNjsNCisNCisgICAgfQ0KKyAgICBpZiAoU3RyQ21wIChCb290T3B0aW9uLT5EZXNjcmlwdGlv biwgSU5URVJOQUxfVUVGSV9TSEVMTF9OQU1FKSA9PSAwKSB7DQorICAgICAgaWYgKFBjZEdldEJv b2wgKFBjZEJvb3RUb1NoZWxsT25seSkpIHsNCisgICAgICAgIHJldHVybiAwOw0KKyAgICAgIH0N CisgICAgICByZXR1cm4gOTsNCisgICAgfQ0KKyAgICBpZiAoU3RyQ21wIChCb290T3B0aW9uLT5E ZXNjcmlwdGlvbiwgVUVGSV9IQVJEX0RSSVZFX05BTUUpID09IDApIHsNCisgICAgICByZXR1cm4g ODsNCisgICAgfQ0KKyAgICByZXR1cm4gMTAwOw0KK30NCisNCitJTlRODQorRUZJQV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AgICAgICAgICAgICAgICAgIG1Vc2JLZXlib2Fy ZENvbm5lY3RFdmVudCA9IE5VTEw7DQotQk9PTEVBTiAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBtSG90S2V5UHJlc3NlZCA9IEZBTFNFOw0KLVZPSUQgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKm1IaXRIb3RrZXlSZWdpc3RyYXRp b247DQotI2RlZmluZSBLRVlCT0FSRF9USU1FUl9JTlRFUlZBTCAgICAgICAgICAgICAgICAgICAy MDAwMCAvLyAwLjAycw0KLQ0KLVZPSUQNCi1Db25uZWN0VVNCQ29udHJvbGxlciAoDQotICBWT0lE DQotICApOw0KLQ0KLUVGSV9TVEFUVVMNCi1QbGF0Zm9ybUJkc0Nvbm5lY3RTaW1wbGVDb25zb2xl ICgNCi0gIElOIEJEU19DT05TT0xFX0NPTk5FQ1RfRU5UUlkgICAqUGxhdGZvcm1Db25zb2xlDQot KTsNCi0NCi1WT0lEIA0KLUJvb3RJbnRvRmlybXdhcmVJbnRlcmZhY2UoDQotICBWT0lEDQotICAp Ow0KLSAgDQotVk9JRA0KLUVGSUFQSQ0KLVBsYXRmb3JtQmRzSW5pdEhvdEtleUV2ZW50ICgNCi0g IFZPSUQNCi0gICk7DQotDQotVk9JRA0KLUVGSUFQSQ0KLURpc2FibGVBaGNpQ3RsciAoDQotICBJ TiBFRklfRVZFTlQgICAgICAgICAgICAgICAgICAgICAgICAgIEV2ZW50LA0KLSAgSU4gVk9JRCAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqQ29udGV4dA0KLSAgKQ0KLXsNCi0gIFVJTlQz MiAgICAgICAgICAgICAgICAgICAgUG1jRGlzYWJsZUFkZHJlc3M7DQotICBVSU5UOCAgICAgICAg ICAgICAgICAgICAgIFNhdGFTdG9yYWdlQW1vdW50Ow0KLSAgVUlOVDMyICAgICAgICAgICAgICAg ICAgICBTYXRhQmFzZTsNCi0gI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gICAgICAgICAgICAgIE5VTEwsDQotICAg ICAgICAgICAgICAgICAgKFZPSUQgKiopICZTbW1BY2Nlc3MNCi0gICAgICAgICAgICAgICAgICAp Ow0KLSAgaWYgKCFFRklfRVJST1IgKFN0YXR1cykpIHsNCi0NCi0gICAgLy8NCi0gICAgLy8gUHJl cGFyZSBTMyBpbmZvcm1hdGlvbiwgdGhpcyBNVVNUIGJlIGRvbmUgYmVmb3JlIER4ZVNtbVJlYWR5 VG9Mb2NrDQotICAgIC8vDQotICAgIFN0YXR1cyA9IGdCUy0+TG9jYXRlUHJvdG9jb2wgKA0KLSAg ICAgICAgICAgICAgICAgICAgJmdFZmlBY3BpUzNTYXZlUHJvdG9jb2xHdWlkLA0KLSAgICAgICAg ICAgICAgICAgICAgTlVMTCwNCi0gICAgICAgICAgICAgICAgICAgIChWT0lEICoqKSZBY3BpUzNT YXZlDQotICAgICAgICAgICAgICAgICAgICApOw0KLSAgICBpZiAoIUVGSV9FUlJPUiAoU3RhdHVz KSkgew0KLSAgICAgIEFjcGlTM1NhdmUtPlMzU2F2ZSAoQWNwaVMzU2F2ZSwgTlVMTCk7DQotICAg IH0NCi0NCi0gICAgSGFuZGxlID0gTlVMTDsNCi0gICAgU3RhdHVzID0gZ0JTLT5JbnN0YWxsUHJv dG9jb2xJbnRlcmZhY2UgKA0KLSAgICAgICAgICAgICAgICAgICAgJkhhbmRsZSwNCi0gICAgICAg ICAgICAgICAgICAgICZnRXhpdFBtQXV0aFByb3RvY29sR3VpZCwNCi0gICAgICAgICAgICAgICAg ICAgIEVGSV9OQVRJVkVfSU5URVJGQUNFLA0KLSAgICAgICAgICAgICAgICAgICAgTlVMTA0KLSAg ICAgICAgICAgICAgICAgICAgKTsNCi0gICAgQVNTRVJUX0VGSV9FUlJPUiAoU3RhdHVzKTsNCi0N Ci0gICAgLy8NCi0gICAgLy8gU2lnbmFsIEVuZE9mRHhlIFBJIEV2ZW50DQotICAgIC8vDQotICAg IEVmaUV2ZW50R3JvdXBT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VhdGVFdmVudCAoDQotICAgICAgICAgICAgICAg ICAgICBFRklfRVZFTlRfTk9USUZZX1NJR05BTCwNCi0gICAgICAgICAgICAgICAgICAgIEVGSV9U UExfQ0FMTEJBQ0ssDQotICAgICAgICAgICAgICAgICAgICBTaGVsbEltYWdlQ2FsbGJhY2ssDQot ICAgICAgICAgICAgICAgICAgICBOVUxMLA0KLSAgICAgICAgICAgICAgICAgICAgJlNoZWxsSW1h Z2VFdmVudA0KLSAgICAgICAgICAgICAgICAgICAgKTsNCi0gICAgaWYgKCFFRklfRVJST1IgKFN0 YXR1cykpIHsNCi0gICAgICBTdGF0dXMgPSBnQlMtPlJlZ2lzdGVyUHJvdG9jb2xOb3RpZnkgKA0K LSAgICAgICAgICAgICAgICAgICAgICAmU2hlbGxFbnZQcm90b2NvbCwNCi0gICAgICAgICAgICAg ICAgICAgICAgU2hlbGxJbWFnZUV2ZW50LA0KLSAgICAgICAgICAgICAgICAgICAgICAmbVNoZWxs SW1hZ2VDYWxsYmFja1JlZw0KLSAgICAgICAgICAgICAgICAgICAgICApOw0KLQ0KLSAgICAgIERF QlVHICgoRUZJX0RfSU5GTywgIkJkc0VudHJ5IFNoZWxsSW1hZ2VDYWxsYmFjayBcbiIpKTsNCi0g ICAgfQ0KLSAgfQ0KLX0NCi0NCi1FRklfU1RBVFVTDQotR2V0R29wRGV2aWNlUGF0aCAoDQotICAg SU4gIEVGSV9ERVZJQ0VfUEFUSF9QUk9UT0NPTCAqUGNpRGV2aWNlUGF0aCwNCi0gICBPVVQgRUZJ X0RFVklDRV9QQVRIX1BST1RPQ09MICoqR29wRGV2aWNlUGF0aA0KLSAgICkNCi17DQotICBVSU5U TiAgICAgICAgICAgICAgICAgICAgICAgICAgIEluZGV4Ow0KLSAgRUZJX1NUQVRVUyAgICAgICAg ICAgICAgICAgICAgICBTdGF0dXM7DQotICBFRklfSEFORExFICAgICAgICAgICAgICAgICAgICAg IFBjaURldmljZUhhbmRsZTsNCi0gIEVGSV9ERVZJQ0VfUEFUSF9QUk9UT0NPTCAgICAgICAgKlRl bXBEZXZpY2VQYXRoOw0KLSAgRUZJX0RFVklDRV9QQVRIX1BST1RPQ09MICAgICAgICAqVGVtcFBj aURldmljZVBhdGg7DQotICBVSU5UTiAgICAgICAgICAgICAgICAgICAgICAgICAgIEdvcEhhbmRs ZUNvdW50Ow0KLSAgRUZJX0hBTkRMRSAgICAgICAgICAgICAgICAgICAgICAqR29wSGFuZGxlQnVm ZmVyOw0KLQ0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWYXJTaXpl Ow0KLSAgU1lTVEVNX0NPTkZJR1VSQVRJT04gIG1TeXN0ZW1Db25maWd1cmF0aW9uOw0KLQ0KLSAg aWYgKFBjaURldmljZVBhdGggPT0gTlVMTCB8fCBHb3BEZXZpY2VQYXRoID09IE5VTEwpIHsNCi0g ICAgcmV0dXJuIEVGSV9JTlZBTElEX1BBUkFNRVRFUjsNCi0gIH0NCi0NCi0gIC8vDQotICAvLyBJ bml0aWFsaXplIHRoZSBHb3BEZXZpY2VQYXRoIHRvIGJlIFBjaURldmljZVBhdGgNCi0gIC8vDQot ICAqR29wRGV2aWNlUGF0aCAgICA9IFBjaURldmljZVBhdGg7DQotICBUZW1wUGNpRGV2aWNlUGF0 aCA9IFBjaURldmljZVBhdGg7DQotDQotICBTdGF0dXMgPSBnQlMtPkxvY2F0ZURldmljZVBhdGgg KA0KLSAgICAgICAgICAgICAgICAgICZnRWZpRGV2aWNlUGF0aFByb3RvY29sR3VpZCwNCi0gICAg ICAgICAgICAgICAgICAmVGVtcFBjaURldmljZVBhdGgsDQotICAgICAgICAgICAgICAgICAgJlBj aURldmljZUhhbmRsZQ0KLSAgICAgICAgICAgICAgICAgICk7DQotICBpZiAoRUZJX0VSUk9SIChT dGF0dXMpKSB7DQotICAgIHJldHVybiBTdGF0dXM7DQotICB9DQotDQotICAvLw0KLSAgLy8gVHJ5 IHRvIGNvbm5lY3QgdGhpcyBoYW5k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Ci0gICAgICBicmVhazsNCi0gICAg fQ0KLQ0KLSAgICBTZXREZXZpY2VQYXRoTm9kZUxlbmd0aCAoJkFjcGlBZHIuSGVhZGVyLCBzaXpl b2YgKEFDUElfQURSX0RFVklDRV9QQVRIKSk7DQotDQotICAgIE15RGV2aWNlUGF0aCA9IEFwcGVu ZERldmljZVBhdGhOb2RlKE15RGV2aWNlUGF0aCwgKEVGSV9ERVZJQ0VfUEFUSF9QUk9UT0NPTCop JkFjcGlBZHIpOw0KLQ0KLSAgICBnQlMtPkNvbm5lY3RDb250cm9sbGVyICgNCi0gICAgICAgICAg IFBjaURldmljZUhhbmRsZSwNCi0gICAgICAgICAgIE5VTEwsDQotICAgICAgICAgICBNeURldmlj ZVBhdGgsDQotICAgICAgICAgICBGQUxTRQ0KLSAgICAgICAgICAgKTsNCi0NCi0gICAgRnJlZVBv b2woTXlEZXZpY2VQYXRoKTsNCi0gIH0NCi0gIGVsc2UNCi0gIHsNCi0gICAgZ0JTLT5Db25uZWN0 Q29udHJvbGxlciAoDQotICAgICAgICAgICBQY2lEZXZpY2VIYW5kbGUsDQotICAgICAgICAgICBO VUxMLA0KLSAgICAgICAgICAgTlVMTCwNCi0gICAgICAgICAgIEZBTFNFDQotICAgICAgICAgICAp Ow0KLSAgfQ0KLQ0KLSAgU3RhdHVzID0gZ0JTLT5Mb2NhdGVIYW5kbGVCdWZmZXIgKA0KLSAgICAg ICAgICAgICAgICAgIEJ5UHJvdG9jb2wsDQotICAgICAgICAgICAgICAgICAgJmdFZmlHcmFwaGlj c091dHB1dFByb3RvY29sR3VpZCwNCi0gICAgICAgICAgICAgICAgICBOVUxMLA0KLSAgICAgICAg ICAgICAgICAgICZHb3BIYW5kbGVDb3VudCwNCi0gICAgICAgICAgICAgICAgICAmR29wSGFuZGxl QnVmZmVyDQotICAgICAgICAgICAgICAgICAgKTsNCi0gIGlmICghRUZJX0VSUk9SIChTdGF0dXMp KSB7DQotICAgIC8vDQotICAgIC8vIEFkZCBhbGwgdGhlIGNoaWxkIGhhbmRsZXMgYXMgcG9zc2li bGUgQ29uc29sZSBEZXZpY2UNCi0gICAgLy8NCi0gICAgZm9yIChJbmRleCA9IDA7IEluZGV4IDwg R29wSGFuZGxlQ291bnQ7IEluZGV4KyspIHsNCi0gICAgICBTdGF0dXMgPSBnQlMtPkhhbmRsZVBy b3RvY29sICgNCi0gICAgICAgICAgICAgICAgICAgICAgR29wSGFuZGxlQnVmZmVyW0luZGV4XSwN Ci0gICAgICAgICAgICAgICAgICAgICAgJmdFZmlEZXZpY2VQYXRoUHJvdG9jb2xHdWlkLA0KLSAg ICAgICAgICAgICAgICAgICAgICAoVk9JRCoqKSZUZW1wRGV2aWNlUGF0aA0KLSAgICAgICAgICAg ICAgICAgICAgICApOw0KLSAgICAgIGlmIChFRklfRVJST1IgKFN0YXR1cykpIHsNCi0gICAgICAg IGNvbnRpbnVlOw0KLSAgICAgIH0NCi0gICAgICBpZiAoQ29tcGFyZU1lbSAoDQotICAgICAgICAg ICAgUGNpRGV2aWNlUGF0aCwNCi0gICAgICAgICAgICBUZW1wRGV2aWNlUGF0aCwNCi0gICAgICAg ICAgICBHZXREZXZpY2VQYXRoU2l6ZSAoUGNpRGV2aWNlUGF0aCkgLSBFTkRfREVWSUNFX1BBVEhf TEVOR1RIDQotICAgICAgICAgICAgKSA9PSAwKSB7DQotICAgICAgICAvLw0KLSAgICAgICAgLy8g SW4gY3VycmVudCBpbXBsZW1lbnRhdGlvbiwgd2Ugb25seSBlbmFibGUgb25lIG9mIHRoZSBjaGls ZCBoYW5kbGVzDQotICAgICAgICAvLyBhcyBjb25zb2xlIGRldmljZSwgaS5lLiBzb3RyZSBvbmUg b2YgdGhlIGNoaWxkIGhhbmRsZSdzIGRldmljZQ0KLSAgICAgICAgLy8gcGF0aCB0byB2YXJpYWJs ZSAiQ29uT3V0Ig0KLSAgICAgICAgLy8gSW4gZnV0dXJlLCB3ZSBjb3VsZCBzZWxlY3QgYWxsIGNo aWxkIGhhbmRsZX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KLSAgQHJldHZhbCBFRklfU1RBVFVTICAgICAgICAg ICAgICAgUmV0dXJuIHRoZSBzdGF0dXMgb2YgZ0JTLT5Mb2NhdGVEZXZpY2VQYXRoICgpLA0KLSAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ0JTLT5Db25uZWN0Q29udHJvbGxlciAo KSwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuZCBnQlMtPkxvY2F0ZUhh bmRsZUJ1ZmZlciAoKS4NCi0NCi0qKi8NCi1FRklfU1RBVFVTDQotR2V0UGx1Z0luUGNpVmdhRGV2 aWNlUGF0aCAoDQotICBJTiBPVVQgRUZJX0RFVklDRV9QQVRIX1BST1RPQ09MICAgICAqKlBsdWdJ blBjaVZnYURldmljZVBhdGgsDQotICBJTiBPVVQgRUZJX0RFVklDRV9QQVRIX1BST1RPQ09MICAg ICAqKk9uYm9hcmRQY2lWZ2FEZXZpY2VQYXRoDQotICApDQotew0KLSAgRUZJX1NUQVRVUyAgICAg ICAgICAgICAgICBTdGF0dXM7DQotICBFRklfSEFORExFICAgICAgICAgICAgICAgIFJvb3RIYW5k bGU7DQotICBVSU5UTiAgICAgICAgICAgICAgICAgICAgIEhhbmRsZUNvdW50Ow0KLSAgRUZJX0hB TkRMRSAgICAgICAgICAgICAgICAqSGFuZGxlQnVmZmVyOw0KLSAgVUlOVE4gICAgICAgICAgICAg ICAgICAgICBJbmRleDsNCi0gIFVJTlROICAgICAgICAgICAgICAgICAgICAgSW5kZXgxOw0KLSAg RUZJX0RFVklDRV9QQVRIX1BST1RPQ09MICAqRGV2aWNlUGF0aDsNCi0gIEJPT0xFQU4gICAgICAg ICAgICAgICAgICAgUGx1Z0luUGNpVmdhOw0KLSAgRUZJX1BDSV9JT19QUk9UT0NPTCAgICAgICAq UGNpSW87DQotICBQQ0lfVFlQRTAwICAgICAgICAgICAgICAgIFBjaTsNCi0NCi0gIERldmljZVBh dGggPSBOVUxMOw0KLSAgUGx1Z0lu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nVm ZmVyICgNCi0gICAgICAgICAgICAgICAgICBCeVByb3RvY29sLA0KLSAgICAgICAgICAgICAgICAg ICZnRWZpUGNpSW9Qcm90b2NvbEd1aWQsDQotICAgICAgICAgICAgICAgICAgTlVMTCwNCi0gICAg ICAgICAgICAgICAgICAmSGFuZGxlQ291bnQsDQotICAgICAgICAgICAgICAgICAgJkhhbmRsZUJ1 ZmZlcg0KLSAgICAgICAgICAgICAgICAgICk7DQotICBpZiAoRUZJX0VSUk9SIChTdGF0dXMpKSB7 DQotICAgIHJldHVybiBTdGF0dXM7DQotICB9DQotDQotICBmb3IgKEluZGV4ID0gMDsgSW5kZXgg PCBIYW5kbGVDb3VudDsgSW5kZXgrKykgew0KLSAgICBTdGF0dXMgPSBnQlMtPkhhbmRsZVByb3Rv Y29sICgNCi0gICAgICAgICAgICAgICAgICAgIEhhbmRsZUJ1ZmZlcltJbmRleF0sDQotICAgICAg ICAgICAgICAgICAgICAmZ0VmaVBjaUlvUHJvdG9jb2xHdWlkLA0KLSAgICAgICAgICAgICAgICAg ICAgKFZPSUQqKikmUGNpSW8NCi0gICAgICAgICAgICAgICAgICAgICk7DQotICAgIGlmICghRUZJ X0VSUk9SIChTdGF0dXMpKSB7DQotDQotICAgICAgLy8NCi0gICAgICAvLyBDaGVjayBmb3IgYWxs IFZHQSBkZXZpY2UNCi0gICAgICAvLw0KLSAgICAgIFN0YXR1cyA9IFBjaUlvLT5QY2kuUmVhZCAo DQotICAgICAgICAgICAgICAgICAgICAgICAgUGNpSW8sDQotICAgICAgICAgICAgICAgICAgICAg ICAgRWZpUGNpSW9XaWR0aFVpbnQzMiwNCi0gICAgICAgICAgICAgICAgICAgICAgICAwLA0KLSAg ICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiAoUGNpKSAvIHNpemVvZiAoVUlOVDMyKSwNCi0g ICAgICAgICAgICAgICAgICAgICAgICAmUGNpDQotICAgICAgICAgICAgICAgICAgICAgICAgKTsN Ci0gICAgICBpZiAoRUZJX0V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WNlUGF0aCk7DQot DQotICBpZiAoUGx1Z0luUGNpVmdhRGV2aWNlUGF0aCA9PSBOVUxMICYmIE9uYm9hcmRQY2lWZ2FE ZXZpY2VQYXRoID09IE5VTEwpIHsNCi0gICAgcmV0dXJuIEVGSV9VTlNVUFBPUlRFRDsNCi0gIH0N Ci0NCi0gIFZhclNpemUgPSBzaXplb2YoU1lTVEVNX0NPTkZJR1VSQVRJT04pOw0KLSAgU3RhdHVz ID0gZ1JULT5HZXRWYXJpYWJsZSgNCi0gICAgICAgICAgICAgICAgICBMIlNldHVwIiwNCi0gICAg ICAgICAgICAgICAgICAmZ0VmaU5vcm1hbFNldHVwR3VpZCwNCi0gICAgICAgICAgICAgICAgICBO VUxMLA0KLSAgICAgICAgICAgICAgICAgICZWYXJTaXplLA0KLSAgICAgICAgICAgICAgICAgICZt U3lzdGVtQ29uZmlndXJhdGlvbg0KLSAgICAgICAgICAgICAgICAgICk7DQotICBpZiAoRUZJX0VS Uk9SIChTdGF0dXMpIHx8IFZhclNpemUgIT0gc2l6ZW9mKFNZU1RFTV9DT05GSUdVUkFUSU9OKSkg ew0KLSAgICAvL1RoZSBzZXR1cCB2YXJpYWJsZSBpcyBjb3JydXB0ZWQNCi0gICAgVmFyU2l6ZSA9 IHNpemVvZihTWVNURU1fQ09ORklHVVJBVElPTik7DQotICAgIFN0YXR1cyA9IGdSVC0+R2V0VmFy aWFibGUoDQotICAgICAgICAgICAgICBMIlNldHVwUmVjb3ZlcnkiLA0KLSAgICAgICAgICAgICAg JmdFZmlOb3JtYWxTZXR1cEd1aWQsDQotICAgICAgICAgICAgICBOVUxMLA0KLSAgICAgICAgICAg ICAgJlZhclNpemUsDQotICAgICAgICAgICAgICAmbVN5c3RlbUNvbmZpZ3VyYXRpb24NCi0gICAg ICAgICAgICAgICk7DQotICAgIEFTU0VSVF9FRklfRVJST1IgKFN0YXR1cyk7DQotICB9ICAgIA0K LQ0KLQ0KLSAgaWYgKChQbHVnSW5QY2lWZ2FEZXZ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F0aDsNCi0NCi0gIFN0YXR1 cyA9IEJkc0xpYlVwZGF0ZUNvbnNvbGVWYXJpYWJsZSAoDQotICAgICAgICAgICAgIEwiQ29uT3V0 IiwNCi0gICAgICAgICAgICAgRGV2aWNlUGF0aEZpcnN0LA0KLSAgICAgICAgICAgICBEZXZpY2VQ YXRoU2Vjb25kDQotICAgICAgICAgICAgICk7DQotDQotICByZXR1cm4gU3RhdHVzOw0KLX0NCi0N Ci1WT0lEDQotVXBkYXRlQ29uc29sZVJlc29sdXRpb24oDQotICBWT0lEDQotICApDQotew0KLSAg VUlOVDMyICAgICAgICAgICAgICAgICBIb3Jpem9udGFsUmVzb2x1dGlvbjsNCi0gIFVJTlQzMiAg ICAgICAgICAgICAgICAgVmVydGljYWxSZXNvbHV0aW9uOw0KLSAgU1lTVEVNX0NPTkZJR1VSQVRJ T04gICBTeXN0ZW1Db25maWd1cmF0aW9uOw0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICBWYXJT aXplOw0KLSAgRUZJX1NUQVRVUyAgICAgICAgICAgICBTdGF0dXM7DQotDQotDQotICBIb3Jpem9u dGFsUmVzb2x1dGlvbiA9IFBjZEdldDMyIChQY2RTZXR1cFZpZGVvSG9yaXpvbnRhbFJlc29sdXRp b24pOw0KLSAgVmVydGljYWxSZXNvbHV0aW9uID0gUGNkR2V0MzIgKFBjZFNldHVwVmlkZW9WZXJ0 aWNhbFJlc29sdXRpb24pOw0KLQ0KLSAgVmFyU2l6ZSA9IHNpemVvZihTWVNURU1fQ09ORklHVVJB VElPTik7DQotICBTdGF0dXMgPSBnUlQtPkdldFZhcmlhYmxlKA0KLSAgICAgICAgICAgICAgICAg IEwiU2V0dXAiLA0KLSAgICAgICAgICAgICAgICAgICZnRWZpTm9ybWFsU2V0dXBHdWlkLA0KLSAg ICAgICAgICAgICAgICAgIE5VTEwsDQotICAgICAgICAgICAgICAgICAgJlZhclNpemUsDQotICAg ICAgICAgICAgICAgICAgJlN5c3RlbUNvbmZpZ3VyY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ldmljZSwgbGlrZSBVU0IgZmxhc2ggZGlzaywgRFZELCBGbG9wcHkgZXRjLg0KLSAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIFRoZXNlIGRldmljZSBzaG91bGQgY29udGFpbiBhICpyZW1v dmFibGUqIGJsb2NrSW8NCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm90b2NvbCBp biB0aGVpciBkZXZpY2UgaGFuZGxlLg0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJk cyB3aWxsIHRyeSB0byBhdXRvbWF0aWNhbGx5IGNyZWF0ZSB0aGlzIHR5cGUgYm9vdCBvcHRpb24N Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGVuIGVudW1lcmF0ZS4NCi0gIDQuIEZp eGVkIEJsb2NrSW8gICAgICAgICAgLSBUaGUgYm9vdCBvcHRpb24gb25seSBwb2ludHMgdG8gYSBG aXhlZCBibG9ja0lvIGRldmljZSwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaWtl IEhhcmREaXNrLg0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRoZXNlIGRldmljZSBz aG91bGQgY29udGFpbiBhICpmaXhlZCogYmxvY2tJbw0KLSAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHByb3RvY29sIGluIHRoZWlyIGRldmljZSBoYW5kbGUuDQotICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgQkRTIHdpbGwgc2tpcCBmaXhlZCBibG9ja0lvIGRldmljZXMsIGFuZCBO T1QNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdXRvbWF0aWNhbGx5IGNyZWF0ZSBi b290IG9wdGlvbiBmb3IgdGhlbS4gQnV0IEJEUw0KLSAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHdpbGwgaGVscCB0byBkZWxldGUgdGhvc2UgZml4ZWQgYmxvY2tJbyBib290IG9wdGlvbiwN Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aG9zZSBkZXNjcmlwdGlvbiBydWxlIGNv bmZsaWN0IHdpdGggb3RoZXIgYXV0by1jcmVhdGVkDQotICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgYm9vdCBvcHRpb25zLg0KLSAgNS4gTm9uLUJsb2NrSW8gU2ltcGxlZmlsZSAtIFRoZSBi b290IG9wdGlvbiBwb2ludHMgdG8gYSBkZXZpY2Ugd2hvc2UgaGFuZGxlDQotICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgaGFzIFNpbXBsZUZpbGVTeXN0ZW0gUHJvdG9jb2wsIGJ1dCBoYXMg bm8gYmxvY2tpbw0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3RvY29sLiBUaGVz ZSBkZXZpY2VzIGRvIG5vdCBvZmZlciBibG9ja0lvDQotICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgcHJvdG9jb2wsIGJ1dCBCRFMgc3RpbGwgY2FuIGdldCB0aGUNCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBcRUZJXEJPT1RcYm9vdHttYWNoaW5lbmFtZX0uRUZJIGJ5IFNpbXBs ZUZpbGVTeXN0ZW0NCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQcm90b2NvbC4NCi0g IDYuIEZpbGUgICAgLSBUaGUgYm9vdCBvcHRpb24gcG9pbnRzIHRvIGEgZmlsZS4gVGhlc2UgYm9v dCBvcHRpb25zIGFyZSB1c3VhbGx5DQotICAgICAgICAgICAgICAgY3JlYXRlZCBieSB1c2VyIG1h bnVhbGx5IG9yIE9TIGxvYWRlci4gQkRTIHdpbGwgbm90IGRlbGV0ZSBvciBtb2RpZnkNCi0gICAg ICAgICAgICAgICB0aGVzZSBib290IG9wdGlvbnMuDQotDQotICBUaGlzIGZ1bmN0aW9uIHdpbGwg ZW51bWVyYXRlIGFsbCBwb3NzaWJsZSBib290IGRldmljZSBpbiB0aGUgc3lzdGVtLCBhbmQNCi0g IGF1dG9tY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gICAgICAgSGFyZGRyaXZlTnVtYmVyOw0KLSAgVUlOVDE2ICAgICAg ICAgICAgICAgICAgICAgICAgQ2Ryb21OdW1iZXI7DQotICBVSU5UMTYgICAgICAgICAgICAgICAg ICAgICAgICBVc2JOdW1iZXI7DQotICBVSU5UMTYgICAgICAgICAgICAgICAgICAgICAgICBNaXNj TnVtYmVyOw0KLSAgVUlOVDE2ICAgICAgICAgICAgICAgICAgICAgICAgU2NzaU51bWJlcjsNCi0g IFVJTlQxNiAgICAgICAgICAgICAgICAgICAgICAgIE5vbkJsb2NrTnVtYmVyOw0KLSAgVUlOVE4g ICAgICAgICAgICAgICAgICAgICAgICAgTnVtYmVyQmxvY2tJb0hhbmRsZXM7DQotICBFRklfSEFO RExFICAgICAgICAgICAgICAgICAgICAqQmxvY2tJb0hhbmRsZXM7DQotICBFRklfQkxPQ0tfSU9f UFJPVE9DT0wgICAgICAgICAqQmxrSW87DQotICBCT09MRUFOICAgICAgICAgICAgICAgICAgICAg ICBSZW1vdmFibGVbMl07DQotICBVSU5UTiAgICAgICAgICAgICAgICAgICAgICAgICBSZW1vdmFi bGVJbmRleDsNCi0gIFVJTlROICAgICAgICAgICAgICAgICAgICAgICAgIEluZGV4Ow0KLSAgVUlO VE4gICAgICAgICAgICAgICAgICAgICAgICAgTnVtT2ZMb2FkRmlsZUhhbmRsZXM7DQotICBFRklf SEFORExFICAgICAgICAgICAgICAgICAgICAqTG9hZEZpbGVIYW5kbGVzOw0KLSAgVUlOVE4gICAg ICAgICAgICAgICAgICAgICAgICAgRnZIYW5kbGVDb3VudDsNCi0gIEVGSV9IQU5ETEUgICAgICAg ICAgICAgICAgICAgICpGdkhhbmRsZUJ1ZmZlcjsNCi0gIEVGSV9GVl9GSUxFVFlQRSAgICAgICAg ICAgICAgIFR5cGU7DQotICBVSU5UTiAgICAgICAgICAgICAgICAgICAgICAgICBTaXplOw0KLSAg RUZJX0ZWX0ZJTEVfQVRUUklCVVRFUyAgICAgICAgQXR0cmlidXRlczsNCi0gIFVJTlQzMiAgICAg ICAgICAgICAgICAgICAgICAgIEF1dGhlbnRpY2F0aW9uU3RhdHVzOw0KLSAgRUZJX0ZJUk1XQVJF X1ZPTFVNRTJfUFJPVE9DT0wgKkZ2Ow0KLSAgRUZJX0RFVklDRV9QQVRIX1BST1RPQ09MICAgICAg KkRldmljZVBhdGg7DQotICBVSU5UTiAgICAgICAgICAgICAgICAgICAgICAgICBEZXZpY2VQYXRo VHlwZTsNCi0gIENIQVIxNiAgICAgICAgICAgICAgICAgICAgICAgIEJ1ZmZlcls0MF07DQotICBF RklfSEFORExFICAgICAgICAgICAgICAgICAgICAqRmlsZVN5c3RlbUhhbmRsZXM7DQotICBVSU5U TiAgICAgICAgICAgICAgICAgICAgICAgICBOdW1iZXJGaWxlU3lzdGVtSGFuZGxlczsNCi0gIEJP T0xFQU4gICAgICAgICAgICAgICAgICAgICAgIE5lZWREZWxldGU7DQotICBFRklfSU1BR0VfRE9T X0hFQURFUiAgICAgICAgICBEb3NIZWFkZXI7DQotICBDSEFSOCAgICAgICAgICAgICAgICAgICAg ICAgICAqUGxhdExhbmc7DQotICBDSEFSOCAgICAgICAgICAgICAgICAgICAgICAgICAqTGFzdExh bmc7DQotICBFRklfSU1BR0VfT1BUSU9OQUxfSEVBREVSX1VOSU9OICAgICAgIEhkckRhdGE7DQot ICBFRklfSU1BR0VfT1BUSU9OQUxfSEVBREVSX1BUUl9VTklPTiAgIEhkcjsNCi0gIENIQVIxNiAg ICAgICAgICAgICAgICAgICAgICAgICpNYWNTdHI7DQotICBDSEFSMTYgICAgICAgICAgICAgICAg ICAgICAgICAqSVB2ZXJTdHI7DQotICBFRklfSEFORExFICAgICAgICAgICAgICAgICAgICAqTmV0 d29ya0hhbmRsZXM7DQotICBVSU5UTiAgICAgICAgICAgICAgICAgICAgICAgICBCdWZmZXJTaXpl Ow0KLQ0KLSAgRmxvcHB5TnVtYmVyICAgID0gMDsNCi0gIEhhcmRkcml2ZU51bWJlciA9IDA7D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WQsDQotICAgICAgICBO VUxMLA0KLSAgICAgICAgJk51bWJlckZpbGVTeXN0ZW1IYW5kbGVzLA0KLSAgICAgICAgJkZpbGVT eXN0ZW1IYW5kbGVzDQotICAgICAgICApOw0KLSAgZm9yIChJbmRleCA9IDA7IEluZGV4IDwgTnVt YmVyRmlsZVN5c3RlbUhhbmRsZXM7IEluZGV4KyspIHsNCi0gICAgU3RhdHVzID0gZ0JTLT5IYW5k bGVQcm90b2NvbCAoDQotICAgICAgICAgICAgICAgICAgICBGaWxlU3lzdGVtSGFuZGxlc1tJbmRl eF0sDQotICAgICAgICAgICAgICAgICAgICAmZ0VmaUJsb2NrSW9Qcm90b2NvbEd1aWQsDQotICAg ICAgICAgICAgICAgICAgICAoVk9JRCAqKikgJkJsa0lvDQotICAgICAgICAgICAgICAgICAgICAp Ow0KLSAgICAgaWYgKCFFRklfRVJST1IgKFN0YXR1cykpIHsNCi0gICAgICAvLw0KLSAgICAgIC8v ICBTa2lwIGlmIHRoZSBmaWxlIHN5c3RlbSBoYW5kbGUgc3VwcG9ydHMgYSBCbGtJbyBwcm90b2Nv bCwNCi0gICAgICAvLw0KLSAgICAgIGNvbnRpbnVlOw0KLSAgICB9DQotDQotICAgIC8vDQotICAg IC8vIERvIHRoZSByZW1vdmFibGUgTWVkaWEgdGhpbmcuIFxFRklcQk9PVFxib290e21hY2hpbmVu YW1lfS5FRkkNCi0gICAgLy8gIG1hY2hpbmVuYW1lIGlzIGlhMzIsIGlhNjQsIHg2NCwgLi4uDQot ICAgIC8vDQotICAgIEhkci5VbmlvbiAgPSAmSGRyRGF0YTsNCi0gICAgTmVlZERlbGV0ZSA9IFRS VUU7DQotICAgIFN0YXR1cyAgICAgPSBCZHNMaWJHZXRJbWFnZUhlYWRlciAoDQotICAgICAgICAg ICAgICAgICAgIEZpbGVTeXN0ZW1IYW5kbGVzW0luZGV4XSwNCi0gICAgICAgICAgICAgICAgICAg RUZJX1JFTU9WQUJMRV9NRURJQV9GSUxFX05BTUU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FkRmlsZUhhbmRsZXM7IEluZGV4KyspIHsNCi0NCi0vLw0KLS8vTG9jYXRlIEVGSV9ERVZJ Q0VfUEFUSF9QUk9UT0NPTCB0byBkeW5hbWljYWxseSBnZXQgSVB2NC9JUHY2IHByb3RvY29sIGlu Zm9ybWF0aW9uLg0KLS8vDQotDQotIFN0YXR1cyA9IGdCUy0+SGFuZGxlUHJvdG9jb2wgKA0KLSAg ICAgICAgICAgICAgICAgIExvYWRGaWxlSGFuZGxlc1tJbmRleF0sDQotICAgICAgICAgICAgICAg ICAgJmdFZmlEZXZpY2VQYXRoUHJvdG9jb2xHdWlkLA0KLSAgICAgICAgICAgICAgICAgIChWT0lE ICoqKSAmRGV2aWNlUGF0aA0KLSAgICAgICAgICAgICAgICAgICk7DQotICANCi0gQVNTRVJUX0VG SV9FUlJPUiAoU3RhdHVzKTsNCi0NCi0gIHdoaWxlICghSXNEZXZpY2VQYXRoRW5kIChEZXZpY2VQ YXRoKSkgew0KLSAgICBpZiAoKERldmljZVBhdGgtPlR5cGUgPT0gTUVTU0FHSU5HX0RFVklDRV9Q QVRIKSAmJg0KLSAgICAgICAgKERldmljZVBhdGgtPlN1YlR5cGUgPT0gTVNHX0lQdjRfRFApKSB7 DQotDQotICAvLw0KLSAgLy9HZXQgaGFuZGxlIGluZm9tYXRpb24NCi0gIC8vDQotICBCdWZmZXJT aXplID0gMDsNCi0gIE5ldHdvcmtIYW5kbGVzID0gTlVMTDsNCi0gIFN0YXR1cyA9IGdCUy0+TG9j YXRlSGFuZGxlICgNCi0gICAgICAgICAgICAgICAgICBCeVByb3RvY29sLCANCi0gICAgICAgICAg ICAgICAgICAmZ0VmaVNpbXBsZU5ldHdvcmtQcm90b2NvbEd1aWQsDQotICAgICAgICAgICAgICAg ICAgTlVMTCwNCi0gICAgICAgICAgICAgICAgICAmQnVmZmVyU2l6ZSwNCi0gICAgICAgICAgICAg ICAgICBOZXR3b3JrSGFuZGxlcw0KLSAgICAgICAgICAgICAgICAgICk7DQ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2ZXJTdHIpOw0KLSAgYnJlYWs7DQotICB9DQotICAgIGlmKChEZXZpY2VQ YXRoLT5UeXBlID09IE1FU1NBR0lOR19ERVZJQ0VfUEFUSCkgJiYNCi0gICAgICAgIChEZXZpY2VQ YXRoLT5TdWJUeXBlID09IE1TR19JUHY2X0RQKSkgew0KLQ0KLSAgLy8NCi0gIC8vR2V0IGhhbmRs ZSBpbmZvbWF0aW9uDQotICAvLw0KLSAgQnVmZmVyU2l6ZSA9IDA7DQotICBOZXR3b3JrSGFuZGxl cyA9IE5VTEw7DQotICBTdGF0dXMgPSBnQlMtPkxvY2F0ZUhhbmRsZSAoDQotICAgICAgICAgICAg ICAgICAgQnlQcm90b2NvbCwgDQotICAgICAgICAgICAgICAgICAgJmdFZmlTaW1wbGVOZXR3b3Jr UHJvdG9jb2xHdWlkLA0KLSAgICAgICAgICAgICAgICAgIE5VTEwsDQotICAgICAgICAgICAgICAg ICAgJkJ1ZmZlclNpemUsDQotICAgICAgICAgICAgICAgICAgTmV0d29ya0hhbmRsZXMNCi0gICAg ICAgICAgICAgICAgICApOw0KLQ0KLSAgaWYgKFN0YXR1cyA9PSBFRklfQlVGRkVSX1RPT19TTUFM TCkgew0KLSAgICBOZXR3b3JrSGFuZGxlcyA9IEFsbG9jYXRlWmVyb1Bvb2woQnVmZmVyU2l6ZSk7 DQotICAgIGlmIChOZXR3b3JrSGFuZGxlcyA9PSBOVUxMKSB7DQotICAgICAgIHJldHVybiAoRUZJ X09VVF9PRl9SRVNPVVJDRVMpOw0KLSAgICB9DQotICAgIFN0YXR1cyA9IGdCUy0+TG9jYXRlSGFu ZGxlKA0KLSAgICAgICAgICAgICAgICAgICAgQnlQcm90b2NvbCwNCi0gICAgICAgICAgICAgICAg ICAgICZnRWZpU2ltcGxlTmV0d29ya1Byb3RvY29sR3VpZCwNCi0gICAgICAgICAgICAgICAgICAg IE5VTEwsDQotICAgICAgICAgICAgICAgICAgICAmQnVmZmVyU2l6ZSwNCi0gICAgICAgICAg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AgICAgICBCeVByb3RvY29sLA0KLSAgICAgICAgJmdFZmlGaXJt d2FyZVZvbHVtZTJQcm90b2NvbEd1aWQsDQotICAgICAgICBOVUxMLA0KLSAgICAgICAgJkZ2SGFu ZGxlQ291bnQsDQotICAgICAgICAmRnZIYW5kbGVCdWZmZXINCi0gICAgICAgICk7DQotICBmb3Ig KEluZGV4ID0gMDsgSW5kZXggPCBGdkhhbmRsZUNvdW50OyBJbmRleCsrKSB7DQotICAgIGdCUy0+ SGFuZGxlUHJvdG9jb2wgKA0KLSAgICAgICAgICBGdkhhbmRsZUJ1ZmZlcltJbmRleF0sDQotICAg ICAgICAgICZnRWZpRmlybXdhcmVWb2x1bWUyUHJvdG9jb2xHdWlkLA0KLSAgICAgICAgICAoVk9J RCAqKikgJkZ2DQotICAgICAgICAgICk7DQotDQotICAgIFN0YXR1cyA9IEZ2LT5SZWFkRmlsZSAo DQotICAgICAgICAgICAgICAgICAgRnYsDQotICAgICAgICAgICAgICAgICAgJmdVZWZpU2hlbGxG aWxlR3VpZCwNCi0gICAgICAgICAgICAgICAgICBOVUxMLA0KLSAgICAgICAgICAgICAgICAgICZT aXplLA0KLSAgICAgICAgICAgICAgICAgICZUeXBlLA0KLSAgICAgICAgICAgICAgICAgICZBdHRy aWJ1dGVzLA0KLSAgICAgICAgICAgICAgICAgICZBdXRoZW50aWNhdGlvblN0YXR1cw0KLSAgICAg ICAgICAgICAgICAgICk7DQotICAgIGlmIChFRklfRVJST1IgKFN0YXR1cykpIHsNCi0gICAgICAv Lw0KLSAgICAgIC8vIFNraXAgaWYgbm8gc2hlbGwgZmlsZSBpbiB0aGUgRlYNCi0gICAgICAvLw0K LSAgICAgIGNvbnRpbnVlOw0KLSAgICB9DQotICAgIC8vDQotICAgIC8vIEJ1aWxkIHRoZSBzaGVs bCBib290IG9wdGlvbg0KLSAgICAvLw0KLSAgICBCZHNMaWJCdWlsZE9wdGlvbkZyb21TaGVsbCAo RnZIYW5kbGVCdWZmZXJbSW5kZXh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Ci0NCi0gIEByZXR2YWwgTm9uZS4NCi0NCi0qKi8NCi1WT0lEDQotRUZJQVBJDQotUGxh dGZvcm1CZHNQb2xpY3lCZWhhdmlvciAoDQotICBJTiBPVVQgTElTVF9FTlRSWSAgICAgICAgICAg ICAgICAgICpEcml2ZXJPcHRpb25MaXN0LA0KLSAgSU4gT1VUIExJU1RfRU5UUlkgICAgICAgICAg ICAgICAgICAqQm9vdE9wdGlvbkxpc3QsDQotICBJTiBQUk9DRVNTX0NBUFNVTEVTICAgICAgICAg ICAgICAgIEJkc1Byb2Nlc3NDYXBzdWxlcywNCi0gIElOIEJBU0VNX01FTU9SWV9URVNUICAgICAg ICAgICAgICAgQmFzZU1lbW9yeVRlc3QNCi0gICkNCi17DQotICBFRklfU1RBVFVTICAgICAgICAg ICAgICAgICAgICAgICAgIFN0YXR1czsNCi0gIFVJTlQxNiAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgVGltZW91dDsNCi0gIEVGSV9CT09UX01PREUgICAgICAgICAgICAgICAgICAgICAgQm9v dE1vZGU7DQotICBCT09MRUFOICAgICAgICAgICAgICAgICAgICAgICAgICAgIERlZmVycmVkSW1h Z2VFeGlzdDsNCi0gIFVJTlROICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW5kZXg7DQot ICBTWVNURU1fQ09ORklHVVJBVElPTiAgICAgICAgICAgICAgIFN5c3RlbUNvbmZpZ3VyYXRpb247 DQotICBVSU5UTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZhclNpemU7DQotICBQTEFU Rk9STV9QQ0lfREVWSUNFX1BBVEggICAgICAgICAgICpFbW1jQm9vdERldlBhdGg7DQotICBFRklf R0xPQkFMX05WU19BUkVBX1BST1RPQ09MICAgICAgICpHbG9iYWxOdnNBcmVhOw0KLSAgRUZJX0hB TkRMRSAgICAgICAgICAgICAgICAgICAgICAgICBGdlByb3RvY29sSGFuZGxlOw0KLSAgVUlOVE4g ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIYW5kbGVDb3VudDsNCi0gIEVGSV9IQU5ETEUg ICAgICAgICAgICAgICAgICAgICAgICAgKkhhbmRsZUJ1ZmZlcjsNCi0gIFVJTlROICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgSW5kZXgxOw0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBTYXRhUGNpUmVnQmFzZSA9IDA7DQotICBVSU5UMTYgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIFNhdGFNb2RlU2VsZWN0ID0gMDsNCi0gIFZPSUQgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgKlJlZ2lzdHJhdGlvbkV4aXRQbUF1dGggPSBOVUxMOw0KLSAgRUZJX0VW RU5UICAgICAgICAgICAgICAgICAgICAgICAgICBFdmVudDsNCi0gIEJPT0xFQU4gICAgICAgICAg ICAgICAgICAgICAgICAgICAgSXNGaXJzdEJvb3Q7DQotICBVSU5UMTYgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICpCb290T3JkZXI7DQotICBVSU5UTiAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIEJvb3RPcmRlclNpemU7DQotICBFU1JUX01BTkFHRU1FTlRfUFJPVE9DT0wgICAgICAg ICAgICpFc3J0TWFuYWdlbWVudDsNCi0NCi0gIFRpbWVvdXQgPSBQY2RHZXQxNiAoUGNkUGxhdGZv cm1Cb290VGltZU91dCk7DQotICBpZiAoVGltZW91dCA+IDEwICkgew0KLSAgICAvL3dlIHRoaW5r IHRoZSBUaW1lb3V0IHZhcmlhYmxlIGlzIGNvcnJ1cHRlZA0KLSAgICBUaW1lb3V0ID0gMTA7DQot ICB9DQotDQotICBWYXJTaXplID0gc2l6ZW9mKFNZU1RFTV9DT05GSUdVUkFUSU9OKTsNCi0gIFN0 YXR1cyA9IGdSVC0+R2V0VmFyaWFibGUoDQotICAgICAgICAgICAgICAgICAgTk9STUFMX1NFVFVQ X05BTUUsDQotICAgICAgICAgICAgICAgICAgJmdFZmlOb3JtYWxTZXR1cEd1aWQsDQotICAgICAg ICAgICAgICAgICAgTlVMTCwNCi0gICAgICAgICAgICAgICAgICAmVmFyU2l6ZSwNCi0gICAgICAg ICAgICAgICAgICAmU3lzdGVtQ29uZmlndXJhdGlvbg0KLSAgICAgICAgICAgICAgICAgICk7DQot DQotICBpZiAoRUZJX0VSUk9SIChTdGF0dXMpIHx8IFZhclNpemUgIT0gc2l6ZW9mKFNZU1RFTV9D T05GSUdVUkFUSU9OKSkgew0KLSAgICAvL1RoZSBzZXR1cCB2YXJpYWJsZSBpcyBjb3JydXB0ZWQN Ci0gICAgVmFyU2l6ZSA9IHNpemVvZihTWVNURU1fQ09ORklHVVJBVElPTik7DQotICAgIFN0YXR1 cyA9IGdSVC0+R2V0VmFyaWFibGUoDQotICAgICAgICAgICAgICBMIlNldHVwUmVjb3ZlcnkiLA0K LSAgICAgICAgICAgICAgJmdFZmlOb3JtYWxTZXR1cEd1aWQsDQotICAgICAgICAgICAgICBOVUxM LA0KLSAgICAgICAgICAgICAgJlZhclNpemUsDQotICAgICAgICAgICAgICAmU3lzdGVtQ29uZmln dXJhdGlvbg0KLSAgICAgICAgICAgICAgKTsNCi0gICAgQVNTRVJUX0VGSV9FUlJPUiAoU3RhdHVz KTsNCi0gIH0NCi0NCi0gIC8vDQotICAvLyBMb2FkIHRoZSBkcml2ZXIgb3B0aW9uIGFzIHRoZSBk cml2ZXIgb3B0aW9uIGxpc3QNCi0gIC8vDQotICBQbGF0Zm9ybUJkc0dldERyaXZlck9wdGlvbiAo RHJpdmVyT3B0aW9uTGlzdCk7DQotDQotICAvLw0KLSAgLy8gR2V0IGN1cnJlbnQgQm9vdCBNb2Rl DQotICAvLw0KLSAgQm9vdE1vZGUgPSBHZXRCb290TW9kZUhvYigpOw0KLQ0KLSAgLy8NCi0gIC8v IE5vIGRlZmVycmVkIGltYWdlcyBleGlzdCBieSBkZWZhdWx0DQotICAvLw0KLSAgRGVmZXJyZWRJ bWFnZUV4aXN0ID0gRkFM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BTQVRBIEhERCBpcyBkaWNv bm5lY3RlZCwNCi0gIC8vIFNBVEEgQUhDSSBDVExSIGRldmljZSB3aWxsIHNob3cgeWVsbG93IGJh bmcsIGltcGxlbWVudCB0aGlzIHNvbHV0aW9uIHRvIHNvbHZlIGl0Lg0KLSAgLy8NCi0gIFNhdGFQ Y2lSZWdCYXNlICA9IE1tUGNpQWRkcmVzcyAoMCwgMCwgUENJX0RFVklDRV9OVU1CRVJfUENIX1NB VEEsIDAsIDApOw0KLSAgU2F0YU1vZGVTZWxlY3QgID0gTW1pb1JlYWQxNiAoU2F0YVBjaVJlZ0Jh c2UgKyBSX1BDSF9TQVRBX01BUCkgJiBCX1BDSF9TQVRBX01BUF9TTVNfTUFTSzsNCi0gIFN0YXR1 cyAgICAgICAgICA9IEVGSV9TVUNDRVNTOw0KLSAgaWYgKFNhdGFNb2RlU2VsZWN0ICE9IFZfUENI X1NBVEFfTUFQX1NNU19JREUpIHsNCi0gICAgU3RhdHVzID0gZ0JTLT5DcmVhdGVFdmVudCAoDQot ICAgICAgICAgICAgICAgICAgICBFVlRfTk9USUZZX1NJR05BTCwNCi0gICAgICAgICAgICAgICAg ICAgIFRQTF9DQUxMQkFDSywNCi0gICAgICAgICAgICAgICAgICAgIERpc2FibGVBaGNpQ3RsciwN Ci0gICAgICAgICAgICAgICAgICAgICZTYXRhUGNpUmVnQmFzZSwNCi0gICAgICAgICAgICAgICAg ICAgICZFdmVudA0KLSAgICAgICAgICAgICAgICAgICAgICk7DQotICAgIGlmICghRUZJX0VSUk9S IChTdGF0dXMpKSB7DQotICAgICAgU3RhdHVzID0gZ0JTLT5SZWdpc3RlclByb3RvY29sTm90aWZ5 ICgNCi0gICAgICAgICAgICAgICAgICAgICAgJmdFeGl0UG1BdXRoUHJvdG9jb2xHdWlkLA0KLSAg ICAgICAgICAgICAgICAgICAgICBFdmVudCwNCi0gICAgICAgICAgICAgICAgICAgICAgJlJlZ2lz dHJhdGlvbkV4aXRQbUF1dGgNCi0gIC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ICAgICAgICAgICAgICAgICAg ICAgICZIYW5kbGVCdWZmZXINCi0gICAgICAgICAgICAgICAgICAgICAgKTsNCi0gICAgICBpZiAo IUVGSV9FUlJPUiAoU3RhdHVzKSkgew0KLSAgICAgICAgZm9yIChJbmRleDEgPSAwOyBJbmRleDEg PCBIYW5kbGVDb3VudDsgSW5kZXgxKyspIHsNCi0gICAgICAgICAgZ0JTLT5Db25uZWN0Q29udHJv bGxlciAoDQotICAgICAgICAgICAgICAgICBIYW5kbGVCdWZmZXJbSW5kZXgxXSwNCi0gICAgICAg ICAgICAgICAgIE5VTEwsDQotICAgICAgICAgICAgICAgICBOVUxMLA0KLSAgICAgICAgICAgICAg ICAgVFJVRQ0KLSAgICAgICAgICAgICAgICAgKTsNCi0gICAgICAgIH0NCi0gICAgICB9DQotDQot ICAgICAgaWYgKEhhbmRsZUJ1ZmZlciAhPSBOVUxMKSB7DQotICAgICAgICBGcmVlUG9vbCAoSGFu ZGxlQnVmZmVyKTsNCi0gICAgICB9DQotDQotICAgICAgZ0RTLT5EaXNwYXRjaCAoKTsNCi0gICAg fQ0KLQ0KLSAgICAvLw0KLSAgICAvLyAgTG9jYXRlIHRoZSBHbG9iYWwgTlZTIFByb3RvY29sLg0K LSAgICAvLw0KLSAgICBTdGF0dXMgPSBnQlMtPkxvY2F0ZVByb3RvY29sICgNCi0gICAgICAgICAg ICAgICAgICAgICZnRWZpR2xvYmFsTnZzQXJlYVByb3RvY29sR3VpZCwNCi0gICAgICAgICAgICAg ICAgICAgIE5VTEwsDQotICAgICAgICAgICAgICAgICAgICAodm9pZCAqKikmR2xvYmFsTnZzQXJl YQ0KLSAgICAgICAgICAgICAgICAgICAgKTsNCi0gICAgaWYgKEdsb2JhbE52c0FyZWEtPkFyZWEt PmVtbWNWZXJzaW9uID09IDApew0KLSAgICAgIEVtbWNCb290RGV2UGF0aCA9IChQTEFURk9STV9Q Q0lfREVWSUNFX1BBVEggKilnUGxhdGZvcm1TaW1wbGVCb290T3B0aW9uWzBdOw0KLSAgICAgIEVt bWNCb290RGV2UGF0aC0+UGNpRGV2aWNlLkRldmljZSA9IDB4MTA7DQotICAgIH0NCi0NCi0gICAg Ly8NCi0gICAgLy8gQ29ubmVjdCBib290IGRldmljZSBoZXJlIHRvIGdpdmUgdGltZSB0byByZWFk IGtleWJvYXJkLg0KLSAgICAvLw0KLSAgICBCZHNMaWJDb25uZWN0RGV2aWNlUGF0aCAoZ1BsYXRm b3JtU2ltcGxlQm9vdE9wdGlvblswXSk7DQotDQotICAgIC8vDQotICAgIC8vIFRoaXMgaXMgYSB3 b3Jrcm91bmQgZm9yIGRlY3RlY3RpbmcgaG90a2V5IGZyb20gVVNCIGtleWJvYXJkLg0KLSAgICAv Lw0KLSAgICBnQlMtPlN0YWxsKEtFWUJPQVJEX1RJTUVSX0lOVEVSVkFMKTsNCi0NCi0gICAgaWYg KG1Ib3RLZXlUaW1lckV2ZW50ICE9IE5VTEwpIHsNCi0gICAgICBnQlMtPlNldFRpbWVyICgNCi0g ICAgICAgICAgICAgbUhvdEtleVRpbWVyRXZlbnQsDQotICAgICAgICAgICAgIFRpbWVyQ2FuY2Vs LA0KLSAgICAgICAgICAgICAwDQotICAgICAgICAgICAgICk7DQotICAgICAgZ0JTLT5DbG9zZUV2 ZW50IChtSG90S2V5VGltZXJFdmVudCk7DQotICAgICAgbUhvdEtleVRpbWVyRXZlbnQgPSBOVUxM Ow0KLSAgICB9DQotICAgIGlmIChtSG90S2V5UHJlc3NlZCkgew0KLSAgICAgIC8vDQotICAgICAg Ly8gU2tpcCBzaG93IHByb2dyZXNzIGNvdW50IGRvd24NCi0gICAgICAvLw0KLSAgICAgIFRpbWVv dXQgPSAweEZGRkY7DQotICAgICAgZ290byBGVUxMX0NPTkZJR1VSQVRJT047DQotICAgIH0NCi0N Ci0gICAgRW5hYmxlUXVpZXRCb290IChQY2RHZXRQdHIoUGNkTG9nb0ZpbGUpKTsNCi0gICAgaWYg KCFTeXN0ZW1Db25maWd1cmF0aW9uL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Ci0gIFRoaXMgZnVuY3Rpb24g Y29ubmVjdHMgdGhlIHByZWRlZmluZWQgZGV2aWNlIHBhdGggZm9yIGF1dGhlbnRpY2F0aW9uIGRl dmljZSwNCi0gIGFuZCBpZiB0aGUgcHJlZGVmaW5lZCBkZXZpY2UgcGF0aCBoYXMgY2hpbGQgZGV2 aWNlIHBhdGgsIHRoZSBjaGlsZCBoYW5kbGUgd2lsbA0KLSAgYmUgY29ubmVjdGVkIHRvby4gQnV0 IHRoZSBjaGlsZCBoYW5kbGUgb2YgdGhlIGNoaWxkIHdpbGwgbm90IGJlIGNvbm5lY3RlZC4NCi0N Ci0qKi8NCi1WT0lEDQotRUZJQVBJDQotUGxhdGZvcm1CZHNDb25uZWN0QXV0aERldmljZSAoDQot ICBWT0lEDQotICApDQotew0KLSAgRUZJX1NUQVRVUyAgICAgICAgICAgICAgICAgICBTdGF0dXM7 DQotICBVSU5UTiAgICAgICAgICAgICAgICAgICAgICAgIEluZGV4Ow0KLSAgVUlOVE4gICAgICAg ICAgICAgICAgICAgICAgICBIYW5kbGVJbmRleDsNCi0gIFVJTlROICAgICAgICAgICAgICAgICAg ICAgICAgSGFuZGxlQ291bnQ7DQotICBFRklfSEFORExFICAgICAgICAgICAgICAgICAgICpIYW5k bGVCdWZmZXI7DQotICBFRklfREVWSUNFX1BBVEhfUFJPVE9DT0wgICAgICpDaGlsZERldmljZVBh dGg7DQotICBFRklfVVNFUl9NQU5BR0VSX1BST1RPQ09MICAgICpNYW5hZ2VyOw0KLQ0KLSAgU3Rh dHVzID0gZ0JTLT5Mb2NhdGVQcm90b2NvbCAoDQotICAgICAgICAgICAgICAgICAgJmdFZmlVc2Vy TWFuYWdlclByb3RvY29sR3VpZCwNCi0gICAgICAgICAgICAgICAgICBOVUxMLA0KLSAgICAgICAg ICAgICAgICAgIChWT0lEICoqKSAmTWFuYWdlcg0KLSAgICAgICAgICAgICAgICAgICk7DQotICBp ZiAoRUZJX0VSUk9SIChTdGF0dXMpKSB7DQot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AgICk7DQotICAgIEFTU0VSVCAoIUVGSV9FUlJPUiAoU3RhdHVzKSk7DQotDQotICAgIC8vDQot ICAgIC8vIEZpbmQgYW5kIGNvbm5lY3QgdGhlIGNoaWxkIGRldmljZSBwYXRocyBvZiBnVXNlcklk ZW50aWZpY2F0aW9uRGV2aWNlW0luZGV4XQ0KLSAgICAvLw0KLSAgICBmb3IgKEhhbmRsZUluZGV4 ID0gMDsgSGFuZGxlSW5kZXggPCBIYW5kbGVDb3VudDsgSGFuZGxlSW5kZXgrKykgew0KLSAgICAg IENoaWxkRGV2aWNlUGF0aCA9IE5VTEw7DQotICAgICAgU3RhdHVzID0gZ0JTLT5IYW5kbGVQcm90 b2NvbCAoDQotICAgICAgICAgICAgICAgICAgICAgIEhhbmRsZUJ1ZmZlcltIYW5kbGVJbmRleF0s DQotICAgICAgICAgICAgICAgICAgICAgICZnRWZpRGV2aWNlUGF0aFByb3RvY29sR3VpZCwNCi0g ICAgICAgICAgICAgICAgICAgICAgKFZPSUQgKiopICZDaGlsZERldmljZVBhdGgNCi0gICAgICAg ICAgICAgICAgICAgICAgKTsNCi0gICAgICBpZiAoRUZJX0VSUk9SIChTdGF0dXMpIHx8IENoaWxk RGV2aWNlUGF0aCA9PSBOVUxMKSB7DQotICAgICAgICBjb250aW51ZTsNCi0gICAgICB9DQotDQot ICAgICAgaWYgKENvbXBhcmVNZW0gKA0KLSAgICAgICAgICAgIENoaWxkRGV2aWNlUGF0aCwNCi0g ICAgICAgICAgICBnVXNlckF1dGhlbnRpY2F0aW9uRGV2aWNlW0luZGV4XSwNCi0gICAgICAgICAg ICAoR2V0RGV2aWNlUGF0aFNpemUgKGdVc2VyQXV0aGVudGljYXRpb25EZXZpY2VbSW5kZXhdKSAt IHNpemVvZiAoRUZJX0RFVklDRV9QQVRIX1BST1RPQ09MKSkNCi0gICAgICAgICAgICApICE9IDAp IHsNCi0gICAgICAgIGNvbnRpbnVlOw0KLSAgICAgIH0NCi0gICAgICBnQlMtPkNvbm5lY3RDb250 cm9sbGVyICgNCi0gICAgICAgICAgICAgSGFuZGxlQnVmZmVyW0hhbmRsZUluZGV4XSwNCi0gICAg ICAgICAgICAgTlVMTCwNCi0gICAgICAgICAgICAgTlVMTCwNCi0gICAgICAgICAgICAgVFJVRQ0K LSAgICAgICAgICAgICApOw0KLSAgICB9DQotICB9DQotDQotICBpZiAoSGFuZGxlQnVmZmVyICE9 IE5VTEwpIHsNCi0gICAgRnJlZVBvb2wgKEhhbmRsZUJ1ZmZlcik7DQotICB9DQotfQ0KLQ0KLS8q Kg0KLSAgVGhpcyBmdW5jdGlvbiBpcyB0byBpZGVudGlmeSBhIHVzZXIsIGFuZCByZXR1cm4gd2hl dGhlciBkZWZlcnJlZCBpbWFnZXMgZXhpc3QuDQotDQotICBAcGFyYW1bb3V0XSAgVXNlciAgICAg ICAgICAgICAgIFBvaW50IHRvIHVzZXIgcHJvZmlsZSBoYW5kbGUuDQotICBAcGFyYW1bb3V0XSAg RGVmZXJyZWRJbWFnZUV4aXN0IE9uIHJldHVybiwgcG9pbnRzIHRvIFRSVUUgaWYgdGhlIGRlZmVy cmVkIGltYWdlDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4aXN0IG9yIEZB TFNFIGlmIGl0IGRpZCBub3QgZXhpc3QuDQotDQotKiovDQotVk9JRA0KLUVGSUFQSQ0KLVBsYXRm b3JtQmRzVXNlcklkZW50aWZ5ICgNCi0gIE9VVCBFRklfVVNFUl9QUk9GSUxFX0hBTkRMRSAgICAg ICAgKlVzZXIsDQotICBPVVQgQk9PTEVBTiAgICAgICAgICAgICAgICAgICAgICAgICpEZWZlcnJl ZEltYWdlRXhpc3QNCi0gICkNCi17DQotICBFRklfU1RBVFVTICAgICAgICAgICAgICAgICAgICAg ICAgIFN0YXR1czsNCi0gIEVGSV9ERUZFUlJFRF9JTUFHRV9MT0FEX1BST1RPQ09MICAgKkRlZmVy cmVkSW1hZ2U7DQotICBVSU5UTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhhbmRsZUNv dW50Ow0KLSAgRUZJX0hBTkRMRSAgICAgICAgICAgICAgICAgICAgICAgICAqSGFuZGxlQnVmOw0K LSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbmRleDsNCi0gIFVJTlROICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgRHJpdmVySW5kZXg7DQotICBFRklfREVWSUNFX1BB VEhfUFJPVE9DT0wgICAgICAgICAgICpJbWFnZURldmljZVBhdGg7DQotICBWT0lEICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICpEcml2ZXJJbWFnZTsNCi0gIFVJTlROICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgSW1hZ2VTaXplOw0KLSAgQk9PTEVBTiAgICAgICAgICAgICAgICAg ICAgICAgICAgICBCb290T3B0aW9uOw0KLQ0KLSAgLy8NCi0gIC8vIFBlcmZvcm0gdXNlciBpZGVu dGlmaWNhdGlvbg0KLSAgLy8NCi0gIGRvIHsNCi0gICAgU3RhdHVzID0gQmRzTGliVXNlcklkZW50 aWZ5IChVc2VyKTsNCi0gIH0gd2hpbGUgKEVGSV9FUlJPUiAoU3RhdHVzKSk7DQotDQotICAvLw0K LSAgLy8gQWZ0ZXIgdXNlciBhdXRoZW50aWNhdGlvbiBub3csIHRyeSB0byBmaW5kIHdoZXRoZXIg ZGVmZXJyZWQgaW1hZ2UgZXhpc3RzDQotICAvLw0KLSAgSGFuZGxlQ291bnQgPSAwOw0KLSAgSGFu ZGxlQnVmICAgPSBOVUxMOw0KLSAgKkRlZmVycmVkSW1hZ2VFeGlzdCA9IEZBTFNFOw0KLSAgU3Rh dHVzID0gZ0JTLT5Mb2NhdGVIYW5kbGVCdWZmZXIgKA0KLSAgICAgICAgICAgICAgICAgIEJ5UHJv dG9jb2wsDQotICAgICAgICAgICAgICAgICAgJmdFZmlEZWZlcnJlZEltYWdlTG9hZFByb3RvY29s R3VpZCwNCi0gICAgICAgICAgICAgICAgICBOVUxMLA0KLSAgICAgICAgICAgICAgICAgICZIYW5k bGVDb3VudCwNCi0gICAgICAgICAgICAgICAgICAmSGFuZGxlQnVmDQotICAgICAgICAgICAgICAg ICAgKTsNCi0gIGlmIChFRklfRVJST1IgKFN0YXR1cykpIHsNCi0gICAgcmV0dXJuIDsNCi0gIH0N Ci0NCi0gIGZvciAoSW5kZXggPSAwOyBJbmRleCA8IEhhbmRsZUNvdW50OyBJbmRleCsrKSB7DQot ICAgIFN0YXR1cyA9IGdCUy0+SGFuZGxlUHJvdG9jb2wgKA0KLSAgICAgICAgICAgICAgICAgICAg SGFuZGxlQnVmW0luZGV4XSwNCi0gICAgICAgICAgICAgICAgICAgICZnRWZpRGVmZXJyZWRJbWFn ZUxvYWRQcm90b2NvbEd1aWQsDQotICAgICAgICAgICAgICAgICAgICAoVk9JRCAqKikgJkRlZmVy cmVkSW1hZ2UNCi0gICAgICAgICAgICAgICAgICAgICk7DQotICAgIGlmICghRUZJX0VSUk9SIChT dGF0dXMpKSB7DQotICAgICAgLy8NCi0gICAgICAvLyBGaW5kIHdoZXRoZXIgZGVmZXJyZWQgaW1h Z2UgZXhpc3RzIGluIHRoaXMgaW5zdGFuY2UuDQotICAgICAgLy8NCi0gICAgICBEcml2ZXJJbmRl eCA9IDA7DQotICAgICAgU3RhdHVzID0gRGVmZXJyZWRJbWFnZS0+R2V0SW1hZ2VJbmZvKA0KLSAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRGVmZXJyZWRJbWFnZSwNCi0gICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIERyaXZlckluZGV4LA0KLSAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJkltYWdlRGV2aWNlUGF0aCwNCi0gICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIChWT0lEICoqKSAmRHJpdmVySW1hZ2UsDQotICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmSW1hZ2VTaXplLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJkJv b3RPcHRpb24NCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7DQotICAgICAgaWYg KCFFRklfRVJST1IgKFN0YXR1cykpIHsNCi0gICAgICAgIC8vDQotICAgICAgICAvLyBUaGUgZGVm ZXJyZWQgaW1hZ2UgaXMgZm91bmQuDQotICAgICAgICAvLw0KLSAgICAgICAgRnJlZVBvb2wgKEhh bmRsZUJ1Zik7DQotICAgICAgICAqRGVmZXJyZWRJbWFnZUV4aXN0ID0gVFJVRTsNCi0gICAgICAg IHJldHVybiA7DQotICAgICAgfQ0KLSAgICB9DQotICB9DQotDQotICBGcmVlUG9vbCAoSGFuZGxl QnVmKTsNCi19DQotDQotVUlOVE4gZ0hvdEtleSA9IDA7DQotDQotDQotRUZJX1NUQVRVUw0KLVNo b3dQcm9ncmVzc0hvdEtleSAoDQotICBJTiBVSU5UMTYgICAgICAgICAgICAgICAgICAgICAgIFRp bWVvdXREZWZhdWx0DQotICApDQotew0KLSAgQ0hBUjE2ICAgICAgICAgICAgICAgICAgICAgICAg KlRtcFN0cjsNCi0gIFVJTlQxNiAgICAgICAgICAgICAgICAgICAgICAgIFRpbWVvdXRSZW1haW47 DQotICBFRklfU1RBVFVTICAgICAgICAgICAgICAgICAgICBTdGF0dXM7DQotICBFRklfSU5QVVRf S0VZICAgICAgICAgICAgICAgICBLZXk7DQotICBFRklfR1JBUEhJQ1NfT1VUUFVUX0JMVF9QSVhF TCBGb3JlZ3JvdW5kOw0KLSAgRUZJX0dSQVBISUNTX09VVFBVVF9CTFRfUElYRUwgQmFja2dyb3Vu ZDsNCi0gIEVGSV9HUkFQSElDU19PVVRQVVRfQkxUX1BJWEVMIENvbG9yOw0KLSAgVUlOVDMyICAg ICAgICAgICAgICAgICAgICAgICAgR3Bpb1ZhbHVlOw0KLSAgQ0hBUjE2ICAgICAgICAgICAgICAg ICAgICAgICAgKlRtcFN0cjE7DQotICBDSEFSMTYgICAgICAgICAgICAgICAgICAgIC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RleHQgbW9kZSBiZWZvcmUgbGF1bmNoaW5nIHNldHVwIGF0IGZpcnN0IHRpbWUuDQot ICAgIC8vDQotICAgIFN0YXR1cyA9IGdCUy0+SGFuZGxlUHJvdG9jb2wgKA0KLSAgICAgICAgICAg ICAgICAgICAgZ1NULT5Db25zb2xlT3V0SGFuZGxlLA0KLSAgICAgICAgICAgICAgICAgICAgJmdF ZmlHcmFwaGljc091dHB1dFByb3RvY29sR3VpZCwNCi0gICAgICAgICAgICAgICAgICAgIChWT0lE KiopJkdyYXBoaWNzT3V0cHV0DQotICAgICAgICAgICAgICAgICAgICApOw0KLSAgICBpZiAoRUZJ X0VSUk9SIChTdGF0dXMpKSB7DQotICAgICAgR3JhcGhpY3NPdXRwdXQgPSBOVUxMOw0KLSAgICB9 DQotDQotICAgIFN0YXR1cyA9IGdCUy0+SGFuZGxlUHJvdG9jb2wgKA0KLSAgICAgICAgICAgICAg ICAgICAgZ1NULT5Db25zb2xlT3V0SGFuZGxlLA0KLSAgICAgICAgICAgICAgICAgICAgJmdFZmlT aW1wbGVUZXh0T3V0UHJvdG9jb2xHdWlkLA0KLSAgICAgICAgICAgICAgICAgICAgKFZPSUQqKikm U2ltcGxlVGV4dE91dA0KLSAgICAgICAgICAgICAgICAgICAgKTsNCi0gICAgaWYgKEVGSV9FUlJP UiAoU3RhdHVzKSkgew0KLSAgICAgIFNpbXBsZVRleHRPdXQgPSBOVUxMOw0KLSAgICB9DQotDQot ICAgIGlmIChHcmFwaGljc091dHB1dCAhPSBOVUxMKSB7DQotICAgICAgLy8NCi0gICAgICAvLyBH ZXQgY3VycmVudCB2aWRlbyByZXNvbHV0aW9uIGFuZCB0ZXh0IG1vZGUuDQotICAgICAgLy8NCi0g ICAgICBtQm9vdEhvcml6b250YWxSZXNvbHV0aW9uID0gR3JhcGhpY3NPdXRwdXQtPk1vZGUtPklu Zm8tPkhvcml6b250YWxSZXNvbHV0aW9uOw0KLSAgICAgIG1Cb290VmVydGljYWxSZXNvbHV0aW9u ICAgPSBHcmFwaGljc091dHB1dC0+TW9kZS0+SW5mby0+VmVydGljYWxSZXNvbHV0aW9uOw0KLSAg ICB9DQotDQotICAgIGlmIChTaW1wbGVUZXh0T3V0ICE9IE5VTEwpIHsNCi0gICAgICBTdGF0dXMg PSBTaW1wbGVUZXh0T3V0LT5RdWVyeU1vZGUgKA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgU2ltcGxlVGV4dE91dCwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNp bXBsZVRleHRPdXQtPk1vZGUtPk1vZGUsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmQm9vdFRleHRDb2x1bW4sDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmQm9v dFRleHRSb3cNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7DQotICAgICAgbUJv b3RUZXh0TW9kZUNvbHVtbiA9IChVSU5UMzIpQm9vdFRleHRDb2x1bW47DQotICAgICAgbUJvb3RU ZXh0TW9kZVJvdyAgICA9IChVSU5UMzIpQm9vdFRleHRSb3c7DQotICAgIH0NCi0NCi0gICAgLy8N Ci0gICAgLy8gR2V0IHVzZXIgZGVmaW5lZCB0ZXh0IG1vZGUgZm9yIHNldHVwLg0KLSAgICAvLw0K LSAgICBtU2V0dXBIb3Jpem9udGFsUmVzb2x1dGlvbiA9IFBjZEdldDMyIChQY2RTZXR1cFZpZGVv SG9yaXpvbnRhbFJlc29sdXRpb24pOw0KLSAgICBtU2V0dXBWZXJ0aWNhbFJlc29sdXRpb24gICA9 IFBjZEdldDMyIChQY2RTZXR1cFZpZGVvVmVydGljYWxSZXNvbHV0aW9uKTsNCi0gICAgbVNldHVw VGV4dE1vZGVDb2x1bW4gICAgICAgPSBQY2RHZXQzMiAoUGNkU2V0dXBDb25PdXRDb2x1bW4pOw0K LSAgICBtU2V0dXBUZXh0TW9kZVJvdyAgICAgICAgICA9IFBjZEdldDMyIChQY2RT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YWJsZSAoDQotICAgICAgICAgICAgICAgICAg TCJPc0luZGljYXRpb25zIiwNCi0gICAgICAgICAgICAgICAgICAmZ0VmaUdsb2JhbFZhcmlhYmxl R3VpZCwNCi0gICAgICAgICAgICAgICAgICBOVUxMLA0KLSAgICAgICAgICAgICAgICAgICZEYXRh U2l6ZSwNCi0gICAgICAgICAgICAgICAgICAmT3NJbmRpY2F0aW9uDQotICAgICAgICAgICAgICAg ICAgKTsNCi0JCQkJICANCi0gIERFQlVHICgoRUZJX0RfSU5GTywgIk9TSW5kaWNhdGlvbiBWYXJp YWJsZSBWYWx1ZSAlZFxuIiwgT3NJbmRpY2F0aW9uKSk7DQotICAvLw0KLSAgLy9Hb3RvIEZyb250 UGFnZSBkaXJlY3RseSB3aGVuIGJpdCBFRklfT1NfSU5ESUNBVElPTlNfQk9PVF9UT19GV19VSSBp biBPU0luZGljYXRpb24gVmFyaWFibGUgaXMgc2V0dGVkLg0KLSAgLy8gIA0KLSAgaWYgKCFFRklf RVJST1IoU3RhdHVzKSAmJiAoT3NJbmRpY2F0aW9uICE9IDApKSB7CQkJCSAgDQotICAgVGltZW91 dCA9IDB4ZmZmZjsNCi0gICBQbGF0Zm9ybUJkc0VudGVyRnJvbnRQYWdlIChUaW1lb3V0LCBGQUxT RSk7DQotICAgfQ0KLX0NCi0NCi0NCi1FRklfU1RBVFVTDQotUGxhdGZvcm1CZHNDb25uZWN0U2lt cGxlQ29uc29sZSAoDQotICBJTiBCRFNfQ09OU09MRV9DT05ORUNUX0VOVFJZICAgKlBsYXRmb3Jt Q29uc29sZQ0KLSkNCi17DQotICBFRklfU1RBVFVTICAgICAgICAgICAgICAgICAgICAgICAgIFN0 YXR1czsNCi0gIFVJTlROICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW5kZXg7DQotICBF RklfREVWSUNFX1BBVEhfUFJPVE9DT0wgICAgICAgICAgICpWYXJDb25vdXQ7DQotICBFRklfREVW SUNFX1BBVEhfUFJPVE9DT0wgICAgICAg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fQ0KLQ0KLQ0KLS8qKg0KLSAgQ2FsbGJhY2sgZnVuY3Rpb24gZm9yIFNpbXBs ZVRleHRJbkV4IHByb3RvY29sIGluc3RhbGwgZXZlbnRzDQotDQotICBAcGFyYW0gRXZlbnQgICAg ICAgICAgIHRoZSBldmVudCB0aGF0IGlzIHNpZ25hbGVkLg0KLSAgQHBhcmFtIENvbnRleHQgICAg ICAgICBub3QgdXNlZCBoZXJlLg0KLQ0KLSoqLw0KLVZPSUQNCi1FRklBUEkNCi1IaXRIb3RrZXlF dmVudCAoDQotICBJTiBFRklfRVZFTlQgICAgRXZlbnQsDQotICBJTiBWT0lEICAgICAgICAgKkNv bnRleHQNCi0gICkNCi17DQotICBFRklfU1RBVFVTICAgICAgICAgICAgICAgICAgICAgICAgIFN0 YXR1czsNCi0NCi0gIFN0YXR1cyA9IGdCUy0+Q2xvc2VFdmVudChtSGl0SG90a2V5RXZlbnQpOw0K LSAgaWYgKEVGSV9FUlJPUiAoU3RhdHVzKSkgew0KLSAgICByZXR1cm47DQotICB9DQotICBTdGF0 dXMgPSBnQlMtPkNyZWF0ZUV2ZW50ICgNCi0gICAgICAgICAgICAgICAgICBFVlRfVElNRVIgfCBF VlRfTk9USUZZX1NJR05BTCwNCi0gICAgICAgICAgICAgICAgICBUUExfTk9USUZZLA0KLSAgICAg ICAgICAgICAgICAgIEhvdEtleVRpbWVySGFuZGxlciwNCi0gICAgICAgICAgICAgICAgICBOVUxM LA0KLSAgICAgICAgICAgICAgICAgICZtSG90S2V5VGltZXJFdmVudA0KLSAgICAgICAgICAgICAg ICAgICk7DQotICBpZiAoRUZJX0VSUk9SIChTdGF0dXMpKSB7DQotICAgIHJldHVybjsNCi0gIH0N Ci0gIFN0YXR1cyA9IGdCUy0+U2V0VGltZXIgKA0KLSAgICAgICAgICAgICAgICAgIG1Ib3RLZXlU aW1lckV2ZW50LA0KLSAgICAgICAgICAgICAgICAgIFRpbWVyUGVyaW9kaWMsDQotICAgICAgICAg ICAgICAgICAgS0VZQk9BUkRfVElNRVJfSU5URVJWQUwNCi0gICAgICAgICAgICAgICAgICApOw0K LSAgaWYgKEVGSV9FUlJPUiAoU3RhdHVzKSkgew0KLSAgICByZXR1cm47DQotICB9DQotDQotICBy ZXR1cm47DQotfQ0KLQ0KLQ0KLVZPSUQNCi1FRklBUEkNCi1QbGF0Zm9ybUJkc0luaXRIb3RLZXlF dmVudCAoDQotICBWT0lEDQotICApDQotew0KLSAgRUZJX1NUQVRVUyAgICAgIFN0YXR1czsNCi0N Ci0gIC8vDQotICAvLyBSZWdpc3RlciBQcm90b2NvbCBub3RpZnkgZm9yIEhvdGtleSBzZXJ2aWNl DQotICAvLw0KLSAgU3RhdHVzID0gZ0JTLT5DcmVhdGVFdmVudCAoDQotICAgICAgICAgICAgICAg ICAgRVZUX05PVElGWV9TSUdOQUwsDQotICAgICAgICAgICAgICAgICAgVFBMX0NBTExCQUNLLA0K LSAgICAgICAgICAgICAgICAgIEhpdEhvdGtleUV2ZW50LA0KLSAgICAgICAgICAgICAgICAgIE5V TEwsDQotICAgICAgICAgICAgICAgICAgJm1IaXRIb3RrZXlFdmVudA0KLSAgICAgICAgICAgICAg ICAgICk7DQotICBBU1NFUlRfRUZJX0VSUk9SIChTdGF0dXMpOw0KLQ0KLSAgLy8NCi0gIC8vIFJl Z2lzdGVyIGZvciBwcm90b2NvbCBub3RpZmljYXRpb25zIG9uIHRoaXMgZXZlbnQNCi0gIC8vDQot ICBTdGF0dXMgPSBnQlMtPlJlZ2lzdGVyUHJvdG9jb2xOb3RpZnkgKA0KLSAgICAgICAgICAgICAg ICAgICZnRWZpU2ltcGxlVGV4dElucHV0RXhQcm90b2NvbEd1aWQsDQotICAgICAgICAgICAgICAg ICAgbUhpdEhvdGtleUV2ZW50LA0KLSAgICAgICAgICAgICAgICAgICZtSGl0SG90a2V5UmVnaXN0 cmF0aW9uDQotICAgICAgICAgICAgICAgICAgKTsNCi0gIEFTU0VSVF9FRklfRVJST1IgKFN0YXR1 cyk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ICAgICAgICAgICAgICAgICA3ICAgICAgICAgICAvLyA7IERpc3BsYXlQb3J0IEIN Ci0jZGVmaW5lIFBPUlRfQ19EUCAgICAgICAgICAgICAgICAgICAgICA4ICAgICAgICAgICAvLyA7 IERpc3BsYXlQb3J0IEMNCi0jZGVmaW5lIFBPUlRfRF9EUCAgICAgICAgICAgICAgICAgICAgICA5 ICAgICAgICAgICAvLyA7IERpc3BsYXlQb3J0IEQNCi0jZGVmaW5lIFBPUlRfQV9EUCAgICAgICAg ICAgICAgICAgICAgICAxMCAgICAgICAgICAvLyA7IERpc3BsYXlQb3J0IEEgKGZvciBlRFAgb24g SUxLKQ0KLSNkZWZpbmUgUE9SVF9CX0hETUkgICAgICAgICAgICAgICAgICAgIDExICAgICAgICAg IC8vIDsgSERNSSBCDQotI2RlZmluZSBQT1JUX0NfSERNSSAgICAgICAgICAgICAgICAgICAgMTIg ICAgICAgICAgLy8gOyBIRE1JIEMNCi0jZGVmaW5lIFBPUlRfRF9IRE1JICAgICAgICAgICAgICAg ICAgICAxMyAgICAgICAgICAvLyA7IEhETUkgRA0KLSNkZWZpbmUgUE9SVF9CX0RWSSAgICAgICAg ICAgICAgICAgICAgIDE0ICAgICAgICAgIC8vIDsgRFZJIEINCi0jZGVmaW5lIFBPUlRfQ19EVkkg ICAgICAgICAgICAgICAgICAgICAxNSAgICAgICAgICAvLyA7IERWSSBDDQotI2RlZmluZSBQT1JU X0RfRFZJICAgICAgICAgICAgICAgICAgICAgMTYgICAgICAgICAgLy8gOyBEVkkgRA0KLSNkZWZp bmUgUE9SVF9NSVBJX0EgICAgICAgICAgICAgICAgICAgIDIxICAgICAgICAgIC8vIDsgTUlQSQ0K LSNkZWZpbmUgUE9SVF9NSVBJX0IgICAgICAgICAgICAgICAgICAgIDIyDQotI2RlZmluZSBQT1JU X01JUElfQyAgICAgICAgICAgICAgICAgICAgMjMNCi0NCi0NCi1leHRlcm4gQk9PTEVBTiBnQ29u bmVjdEFsbEhhcHBlbmVkOw0K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gICJFRkkgU0NTSSBEZXZpY2UiDQotICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI2xhbmd1YWdlIGZyLUZSICAiZnItRlI6IEVG SSBTQ1NJIERldmljZSINCi0jc3RyaW5nIFNUUl9ERVNDUklQVElPTl9NSVNDICAgICAgICAgICAj bGFuZ3VhZ2UgZW4tVVMgICJFRkkgTWlzYyBEZXZpY2UiDQotICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgI2xhbmd1YWdlIGZyLUZSICAiZnItRlI6IEVGSSBNaXNjIERldmlj ZSINCi0jc3RyaW5nIFNUUl9ERVNDUklQVElPTl9ORVRXT1JLICAgICAgICAjbGFuZ3VhZ2UgZW4t VVMgICJFRkkgTmV0d29yayINCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAjbGFuZ3VhZ2UgZnItRlIgICJmci1GUjogRUZJIE5ldHdvcmsiDQotI3N0cmluZyBTVFJfREVT Q1JJUFRJT05fTk9OX0JMT0NLICAgICAgI2xhbmd1YWdlIGVuLVVTICAiRUZJIE5vbi1CbG9jayBC b290IERldmljZSINCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAjbGFu Z3VhZ2UgZnItRlIgICJmci1GUjogRUZJIE5vbi1CbG9jayBCb290IERldmljZSINCmRpZmYgLS1n aXQgYS9QbGF0Zm9ybS9JbnRlbC9WbHYyVGJsdERldmljZVBrZy9MaWJyYXJ5L1BsYXRmb3JtQmRz TGliL1BsYXRmb3JtRGF0YS5jIGIvUGxhdGZvcm0vSW50ZWwvVmx2MlRibHREZXZpY2VQa2cvTGli cmFyeS9QbGF0Zm9ybUJkc0xpYi9QbGF0Zm9ybURhdGEuYw0KZGVsZXRlZCBmaWxlIG1vZGUgMTAw NjQ0DQppbmRleCA5ZGZmOTNmNTJiLi4wMDAwMDAwMDAwDQotLS0gYS9QbGF0Zm9ybS9JbnRlbC9W bHYyVGJsdERldmljZVBrZy9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0KLSAgSU4gRUZJX0RFVklDRV9QQVRIX1BST1RPQ09MICAgICAgICAgKkN1cnJlbnRCYnNE ZXZQYXRoLA0KLSAgSU4gVUlOVE4gICAgICAgICAgICAgICAgICAgICAgICAgICAgSW5kZXgsDQot ICBJTiBPVVQgVUlOVDE2ICAgICAgICAgICAgICAgICAgICAgICAqKkJvb3RPcmRlckxpc3QsDQot ICBJTiBPVVQgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgICAqQm9vdE9yZGVyTGlzdFNpemUN Ci0gICkNCi17DQotICBFRklfU1RBVFVTICAgICAgICAgICBTdGF0dXM7DQotICBVSU5UMTYgICAg ICAgICAgICAgICBDdXJyZW50Qm9vdE9wdGlvbk5vOw0KLSAgVUlOVDE2ICAgICAgICAgICAgICAg Qm9vdFN0cmluZ1sxMF07DQotICBDSEFSMTYgICAgICAgICAgICAgICBCb290RGVzY1sxMDBdOw0K LSAgQ0hBUjggICAgICAgICAgICAgICAgSGVscFN0cmluZ1sxMDBdOw0KLSAgVUlOVDE2ICAgICAg ICAgICAgICAgKk5ld0Jvb3RPcmRlckxpc3Q7DQotICBVSU5UTiAgICAgICAgICAgICAgICBCdWZm ZXJTaXplOw0KLSAgVUlOVE4gICAgICAgICAgICAgICAgU3RyaW5nTGVuOw0KLSAgVk9JRCAgICAg ICAgICAgICAgICAgKkJ1ZmZlcjsNCi0gIFVJTlQ4ICAgICAgICAgICAgICAgICpQdHI7DQotICBV SU5UMTYgICAgICAgICAgICAgICBDdXJyZW50QmJzRGV2UGF0aFNpemU7DQotICBVSU5UTiAgICAg ICAgICAgICAgICBCb290T3JkZXJJbmRleDsNCi0gIFVJTlROICAgICAgICAgICAgICAgIEJvb3RP cmRlckxhc3RJbmRleDsNCi0gIFVJTlROICAgICAgICAgICAgICAgIEFycmF5SW5kZXg7DQotICBC T09MRUFOICAgICAgICAgICAgICBJbmRleE5vdEZvdW5kOw0KLSAgQkJTX0JCU19ERVZJQ0VfUEFU SCAgKk5ld0Jic0RldlBhdGhOb2RlOw0KLQ0KLSAgaWYgKCgqQm9vdE9yZGVyTGlzdCkgPT0gTlVM TCkgew0KLSAgICBDdXJyZW50Qm9vdE9wdGlvbk5vID0gMDsNCi0gIH0gZWxzZSB7DQotICAgIGZv ciAoQXJyYXlJbmRleCA9IDA7IEFycmF5SW5kZXggPCAoVUlOVE4pICgqQm9vdE9yZGVyTGlzdFNp emUgLyBzaXplb2YgKFVJTlQxNikpOyBBcnJheUluZGV4KyspIHsNCi0gICAgICBJbmRleE5vdEZv dW5kID0gVFJVRTsNCi0gICAgICBmb3IgKEJvb3RPcmRlckluZGV4ID0gMDsgQm9vdE9yZGVySW5k ZXggPCAoVUlOVE4pICgqQm9vdE9yZGVyTGlzdFNpemUgLyBzaXplb2YgKFVJTlQxNikpOyBCb290 T3JkZXJJbmRleCsrKSB7DQotICAgICAgICBpZiAoKCpCb290T3JkZXJMaXN0KVtCb290T3JkZXJJ bmRleF0gPT0gQXJyYXlJbmRleCkgew0KLSAgICAgICAgICBJbmRleE5vdEZvdW5kID0gRkFMU0U7 DQotICAgICAgICAgIGJyZWFrOw0KLSAgICAgICAgfQ0KLSAgICAgIH0NCi0NCi0gICAgICBpZiAo IUluZGV4Tm90Rm91bmQpIHsNCi0gICAgICAgIGNvbnRpbnVlOw0KLSAgICAgIH0gZWxzZSB7DQot ICAgICAgICBicmVhazsNCi0gICAgICB9DQotICAgIH0NCi0NCi0gICAgQ3VycmVudEJvb3RPcHRp b25ObyA9IChVSU5UMTYpIEFycmF5SW5kZXg7DQotICB9DQotDQotICBVbmljb2RlU1ByaW50ICgN Ci0gICAgQm9vdFN0cmluZywNCi0gICAgc2l6ZW9mIChCb290U3RyaW5nKSwNCi0gICAgTCJCb290 JTA0eCIsDQotICAgIEN1cnJlbnRCb290T3B0aW9uTm8NCi0gICAgKTsNCi0NCi0gIEJkc0J1aWxk TGVnYWN5RGV2TmFtZVN0cmluZyAoQ3VycmVudEJic0VudHJ5LCBJbmRleCwgc2l6ZW9mI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0gKA0KLSAgICBQdHIsDQotICAgIEJvb3REZXNj LA0KLSAgICBTdHJTaXplIChCb290RGVzYykNCi0gICAgKTsNCi0gIFB0ciArPSBTdHJTaXplIChC b290RGVzYyk7DQotDQotICBDb3B5TWVtICgNCi0gICAgUHRyLA0KLSAgICBDdXJyZW50QmJzRGV2 UGF0aCwNCi0gICAgQ3VycmVudEJic0RldlBhdGhTaXplDQotICAgICk7DQotICBQdHIgKz0gQ3Vy cmVudEJic0RldlBhdGhTaXplOw0KLQ0KLSAgQ29weU1lbSAoDQotICAgIFB0ciwNCi0gICAgQ3Vy cmVudEJic0VudHJ5LA0KLSAgICBzaXplb2YgKEJCU19UQUJMRSkNCi0gICAgKTsNCi0NCi0gIFB0 ciArPSBzaXplb2YgKEJCU19UQUJMRSk7DQotICAqKChVSU5UMTYgKikgUHRyKSA9IChVSU5UMTYp IEluZGV4Ow0KLQ0KLSAgU3RhdHVzID0gZ1JULT5TZXRWYXJpYWJsZSAoDQotICAgICAgICAgICAg ICAgICAgQm9vdFN0cmluZywNCi0gICAgICAgICAgICAgICAgICAmZ0VmaUdsb2JhbFZhcmlhYmxl R3VpZCwNCi0gICAgICAgICAgICAgICAgICBFRklfVkFSSUFCTEVfQk9PVFNFUlZJQ0VfQUNDRVNT IHwgRUZJX1ZBUklBQkxFX1JVTlRJTUVfQUNDRVNTIHwgRUZJX1ZBUklBQkxFX05PTl9WT0xBVElM RSwNCi0gICAgICAgICAgICAgICAgICBCdWZmZXJTaXplLA0KLSAgICAgICAgICAgICAgICAgIEJ1 ZmZlcg0KLSAgICAgICAgICAgICAgICAgICk7DQotDQotICBGcmVlUG9vbCAoQnVmZmVyKTsNCi0g IA0KLSAgQnVmZmVyID0gTlVMTDsNCi0NCi0gIE5ld0Jvb3RPcmRlckxpc3QgPSBBbGxvY2F0ZVpl cm9Qb29sICgqQm9vdE9yZGVyTGlzdFNpemUgKyBzaXplb2YgKFVJTlQxNikpOw0KLSAgaWYgKE5V TEwgPT0gTmV3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EFCTEUpOw0KLSAgICAqQmJzSW5kZXggPSAqKFVJTlQxNiAqKSBQdHI7DQotICAgIFJldCAg ICAgICA9IFRSVUU7DQotICB9IGVsc2Ugew0KLSAgICAqQmJzRW50cnkgPSBOVUxMOw0KLSAgICBS ZXQgICAgICAgPSBGQUxTRTsNCi0gIH0NCi0NCi0gIHJldHVybiBSZXQ7DQotfQ0KLQ0KLS8qKg0K LSAgRGVsZXRlIGFsbCB0aGUgaW52YWxpZCBsZWdhY3kgYm9vdCBvcHRpb25zLg0KLQ0KLSAgQHJl dHZhbCBFRklfU1VDQ0VTUyAgICAgICAgICAgICBBbGwgaW52YWxpZGUgbGVnYWN5IGJvb3Qgb3B0 aW9ucyBhcmUgZGVsZXRlZC4NCi0gIEByZXR2YWwgRUZJX09VVF9PRl9SRVNPVVJDRVMgICAgRmFp bCB0byBhbGxvY2F0ZSBuZWNlc3NhcnkgbWVtb3J5Lg0KLSAgQHJldHZhbCBFRklfTk9UX0ZPVU5E ICAgICAgICAgICBGYWlsIHRvIHJldHJpdmUgdmFyaWFibGUgb2YgYm9vdCBvcmRlci4NCi0qKi8N Ci1FRklfU1RBVFVTDQotRUZJQVBJDQotQmRzRGVsZXRlQWxsSW52YWxpZExlZ2FjeUJvb3RPcHRp b25zICgNCi0gIFZPSUQNCi0gICkNCi17DQotICBVSU5UMTYgICAgICAgICAgICAgICAgICAgICpC b290T3JkZXI7DQotICBVSU5UOCAgICAgICAgICAgICAgICAgICAgICpCb290T3B0aW9uVmFyOw0K LSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICBCb290T3JkZXJTaXplOw0KLSAgVUlOVE4gICAg ICAgICAgICAgICAgICAgICBCb290T3B0aW9uU2l6ZTsNCi0gIEVGSV9TVEFUVVMgICAgICAgICAg ICAgICAgU3RhdHVzOw0KLSAgVUlOVDE2ICAgICAgICAgICAgICAgICAgICBIZGRDb3VudDsNCi0g IFVJTlQxNiAgICAgICAgICAgICAgICAgICAgQmJzQ291bnQ7DQotICBIRERfSU5GTyAgICAgICAg ICAgICAgICAgICpMb2NhbEhkZEluZm87DQotICBCQlNfVEFCTEUgICAgICAgICAgICAgICAgICpM b2NhbEJic1RhYmxlOw0KLSAgQkJTX1RBQkxFICAgICAgICAgICAgICAgICAqQmJzRW50cnk7DQot ICBVSU5UMTYgICAgICAgICAgICAgICAgICAgIEJic0luZGV4Ow0KLSAgRUZJX0xFR0FDWV9CSU9T X1BST1RPQ09MICAqTGVnYWN5QmlvczsNCi0gIFVJTlROICAgICAgICAgICAgICAgICAgICAgSW5k ZXg7DQotICBVSU5UMTYgICAgICAgICAgICAgICAgICAgIEJvb3RPcHRpb25bMTBdOw0KLSAgVUlO VDE2ICAgICAgICAgICAgICAgICAgICBCb290RGVzY1sxMDBdOw0KLSAgQk9PTEVBTiAgICAgICAg ICAgICAgICAgICBEZXNjU3RyaW5nTWF0Y2g7DQotDQotICBTdGF0dXMgICAgICAgID0gRUZJX1NV Q0NFU1M7DQotICBCb290T3JkZXIgICAgID0gTlVMTDsNCi0gIEJvb3RPcmRlclNpemUgPSAwOw0K LSAgSGRkQ291bnQgICAgICA9IDA7DQotICBCYnNDb3VudCAgICAgID0gMDsNCi0gIExvY2FsSGRk SW5mbyAgPSBOVUxMOw0KLSAgTG9jYWxCYnNUYWJsZSA9IE5VTEw7DQotICBCYnNFbnRyeSAgICAg ID0gTlVMTDsNCi0NCi0gIFN0YXR1cyAgICAgICAgPSBnQlMtPkxvY2F0ZVByb3RvY29sICgmZ0Vm aUxlZ2FjeUJpb3NQcm90b2NvbEd1aWQsIE5VTEwsIChWT0lEICoqKSAmTGVnYWN5Qmlvcyk7DQot ICBpZiAoRUZJX0VSUk9SIChTdGF0dXMpKSB7DQotICAgIHJldHVybiBTdGF0dXM7DQotICB9DQot DQotICBCb290T3JkZXIgPSBCZHNMaWJHZXRWYXJpYWJsZUFuZFNpemUgKA0KLSAgICAgICAgICAg ICAgICBMIkJvb3RPcmRlciIsDQotICAgICAgICAgICAgICAgICZnRWZpR2xvYmFsVmFyaWFibGVH dWlkLA0KLSAgICAgICAgICAgICAgICAmQm9vdE9yZGVyU2l6ZQ0KLSAgICAgICAgICAgICAgICAp Ow0KLSAgaWYgKEJvb3RPcmRlciA9PSBOVUxMKSB7DQotICAgIHJldHVybiBFRklfTk9UX0ZPVU5E Ow0KLSAgfQ0KLQ0KLSAgTGVnYWN5Qmlvcy0+R2V0QmJzSW5mbyAoDQotICAgICAgICAgICAgICAg IExlZ2FjeUJpb3MsDQotICAgICAgICAgICAgICAgICZIZGRDb3VudCwNCi0gICAgICAgICAgICAg ICAgJkxvY2FsSGRkSW5mbywNCi0gICAgICAgICAgICAgICAgJkJic0NvdW50LA0KLSAgICAgICAg ICAgICAgICAmTG9jYWxCYnNUYWJsZQ0KLSAgICAgICAgICAgICAgICApOw0KLQ0KLSAgSW5kZXgg PSAwOw0KLSAgd2hpbGUgKEluZGV4IDwgQm9vdE9yZGVyU2l6ZSAvIHNpemVvZiAoVUlOVDE2KSkg ew0KLSAgICBVbmljb2RlU1ByaW50IChCb290T3B0aW9uLCBzaXplb2YgKEJvb3RPcHRpb24pLCBM IkJvb3QlMDR4IiwgQm9vdE9yZGVyW0luZGV4XSk7DQotICAgIEJvb3RPcHRpb25WYXIgPSBCZHNM aWJHZXRWYXJpYWJsZUFuZFNpemUgKA0KLSAgICAgICAgICAgICAgICAgICAgICBCb290T3B0aW9u LA0KLSAgICAgICAgICAgICAgICAgICAgICAmZ0VmaUdsb2JhbFZhcmlhYmxlR3VpZCwNCi0gICAg ICAgICAgICAgICAgICAgICAgJkJvb3RPcHRpb25TaXplDQotICAgICAgICAgICAgICAgICAgICAg ICk7DQotICAgIGlmIChOVUxMID09IEJvb3RPcHRpb25WYXIpIHsNCi0gICAgICBCb290T3B0aW9u U2l6ZSA9IDA7DQotICAgICAgU3RhdHVzID0gZ1JULT5HZXRWYXJpYWJsZSAoDQotICAgICAgICAg ICAgICAgICAgICAgIEJvb3RPcHRpb24sDQotICAgICAgICAgICAgICAgICAgICAgICZnRWZpR2xv YmFsVmFyaWFibGVHdWlkLA0KLSAgICAgICAgICAgICAgICAgICAgICBOVUxMLA0KLSAgICAgICAg ICAgICAgICAgICAgICAmQm9vdE9wdGlvblNpemUsDQotICAgICAgICAgICAgICAgICAgICAgIEJv b3RPcHRpb25WYXINCi0gICAgICAgICAgICAgICAgICAgICAgKTsNCi0gICAgICBpZiAoU3RhdHVz ID09IEVGSV9OT1RfRk9VTkQpIHsNCi0gICAgICAgIC8vDQotICAgICAgICAvLyBVcGRhdGUgQm9v dE9yZGVyDQotICAgICAgICAvLw0KLSAgICAgICAgQmRzRGVsZXRlQm9vdE9wdGlvbiAoDQotICAg ICAgICAgIEJvb3RPcmRlcltJbmRleF0sDQotICAgICAgICAgIEJvb3RPcmRlciwNCi0gICAgICAg ICAgJkJvb3RPcmRlclNpemUNCi0gICAgICAgICAgKTsNCi0gICAgICAgIGNvbnRpbnVlOw0KLSAg ICAgIH0gZWxzZSB7DQotICAgICAgICBGcmVlUG9vbCAoQm9vdE9yZGVyKTsNCi0gICAgICAgIHJl dHVybiBFRklfT1VUX09GX1JFU09VUkNFUzsNCi0gICAgICB9DQotICAgIH0NCi0gIA0KLSAgICAv Lw0KLSAgICAvLyBTa2lwIE5vbi1MZWdhY3kgYm9vdCBvcHRpb24NCi0gICAgLy8gDQotICAgIGlm ICghQmRzSXNMZWdhY3lCb290T3B0aW9uIChCb290T3B0aW9uVmFyLCAmQmJzRW50cnksICZCYnNJ bmRleCkpIHsNCi0gICAgICBpZiAoQm9vdE9wdGlvblZhciE9IE5VTEwpIHsNCi0gICAgICAgIEZy ZWVQb29sIChCb290T3B0aW9uVmFyKTsNCi0gICAgICB9DQotICAgICAgSW5kZXgrKzsNCi0gICAg ICBjb250aW51ZTsNCi0gICAgfQ0KLQ0KLSAgICBpZiAoQmJzSW5kZXggPCBCYnNDb3VudCkgew0K LSAgICAgIC8vDQotICAgICAgLy8gQ2hlY2sgaWYgQkJTIERlc2NyaXB0aW9uIFN0cmluZyBpcyBj aGFuZ2VkDQotICAgICAgLy8NCi0gICAgICBEZXNjU3RyaW5nTWF0Y2ggPSBGQUxTRTsNCi0gICAg ICBCZHNCdWlsZExlZ2FjeURldk5hbWVTdHJpbmcgKA0KLSAgICAgICAgJkxvY2FsQmJzVGFibGVb QmJzSW5kZXhdLA0KLSAgICAgICAgQmJzSW5kZXgsDQotICAgICAgICBzaXplb2YgKEJvb3REZXNj KSwNCi0gICAgICAgIEJvb3REZXNjDQotICAgICAgICApOw0KLQ0KLSAgICAgIGlmIChTdHJDbXAg KEJvb3REZXNjLCAoVUlOVDE2KikoQm9vdE9wdGlvblZhciArIHNpemVvZiAoVUlOVDMyKSArIHNp emVvZiAoVUlOVDE2KSkpID09IDApIHsNCi0gICAgICAgIERlc2NTdHJpbmdNYXRjaCA9IFRSVUU7 DQotICAgICAgfQ0KLQ0KLSAgICAgIGlmICghKChMb2NhbEJic1RhYmxlW0Jic0luZGV4XS5Cb290 UHJpb3JpdHkgPT0gQkJTX0lHTk9SRV9FTlRSWSkgfHwNCi0gICAgICAgICAgICAoTG9jYWxCYnNU YWJsZVtCYnNJbmRleF0uQm9vdFByaW9yaXR5ID09IEJCU19ET19OT1RfQk9PVF9GUk9NKSkgJiYN Ci0gICAgICAgICAgKExvY2FsQmJzVGFibGVbQmJzSW5kZXhdLkRldmljZVR5cGUgPT0gQmJzRW50 cnktPkRldmljZVR5cGUpICYmDQotICAgICAgICAgIERlc2NTdHJpbmdNYXRjaCkgew0KLSAgICAg ICAgSW5kZXgrKzsNCi0gICAgICAgIGNvbnRpbnVlOw0KLSAgICAgIH0NCi0gICAgfQ0KLQ0KLSAg ICBpZiAoQm9vdE9wdGlvblZhciAhPSBOVUxMKSB7DQotICAgICAgRnJlZVBvb2wgKEJvb3RPcHRp b25WYXIpOw0KLSAgICB9DQotICAgIC8vDQotICAgIC8vIHNob3VsZCBkZWxldGUNCi0gICAgLy8N Ci0gICAgQmRzRGVsZXRlQm9vdE9wdGlvbi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0KLSAgQk9PTEVBTiAgIEZvdW5kOw0KLQ0KLSAg QmJzRW50cnkgID0gTlVMTDsNCi0gIEZvdW5kICAgICA9IEZBTFNFOw0KLQ0KLSAgaWYgKE5VTEwg PT0gQm9vdE9yZGVyKSB7DQotICAgIHJldHVybiBGb3VuZDsNCi0gIH0NCi0NCi0gIC8vDQotICAv LyBMb29wIGFsbCBib290IG9wdGlvbiBmcm9tIHZhcmlhYmxlDQotICAvLw0KLSAgZm9yIChJbmRl eCA9IDA7IEluZGV4IDwgQm9vdE9wdGlvbk51bTsgSW5kZXgrKykgew0KLSAgICBVbmljb2RlU1By aW50IChCb290T3B0aW9uLCBzaXplb2YgKEJvb3RPcHRpb24pLCBMIkJvb3QlMDR4IiwgKFVJTlRO KSBCb290T3JkZXJbSW5kZXhdKTsNCi0gICAgQm9vdE9wdGlvblZhciA9IEJkc0xpYkdldFZhcmlh YmxlQW5kU2l6ZSAoDQotICAgICAgICAgICAgICAgICAgICAgIEJvb3RPcHRpb24sDQotICAgICAg ICAgICAgICAgICAgICAgICZnRWZpR2xvYmFsVmFyaWFibGVHdWlkLA0KLSAgICAgICAgICAgICAg ICAgICAgICAmQm9vdE9wdGlvblNpemUNCi0gICAgICAgICAgICAgICAgICAgICAgKTsNCi0gICAg aWYgKE5VTEwgPT0gQm9vdE9wdGlvblZhcikgew0KLSAgICAgIGNvbnRpbnVlOw0KLSAgICB9DQot DQotICAgIC8vDQotICAgIC8vIFNraXAgTm9uLWxlZ2FjeSBib290IG9wdGlvbg0KLSAgICAvLw0K LSAgICBpZiAoIUJkc0lzTGVnYWN5Qm9vdE9wdGlvbiAoQm9vdE9wdGlvblZhciwgJkJic0VudHJ5 LCBCYnNJbmRleCkpIHsNCi0gICAgICBGcmVlUG9vbCAoQm9vdE9wdGlvblZhcik7DQotICAgICAg Y29udGludWU7DQotICAgIH0NCi0NCi0gICAgaWYgKA0KLSAgICAgICAgKEJic0VudHJ5LT5EZXZp Y2VUeXBlICE9IERldlR5cGUp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gKA0KLSAgICAgICAgICAgICAgTlVMTCwNCi0gICAgICAgICAgICAgIChFRklfREVWSUNF X1BBVEhfUFJPVE9DT0wgKikgJkJic0RldlBhdGhOb2RlDQotICAgICAgICAgICAgICApOw0KLSAg aWYgKE5VTEwgPT0gRGV2UGF0aCkgew0KLSAgICByZXR1cm4gRUZJX09VVF9PRl9SRVNPVVJDRVM7 DQotICB9DQotDQotICBTdGF0dXMgPSBCZHNDcmVhdGVMZWdhY3lCb290T3B0aW9uICgNCi0gICAg ICAgICAgICBCYnNJdGVtLA0KLSAgICAgICAgICAgIERldlBhdGgsDQotICAgICAgICAgICAgSW5k ZXgsDQotICAgICAgICAgICAgQm9vdE9yZGVyTGlzdCwNCi0gICAgICAgICAgICBCb290T3JkZXJM aXN0U2l6ZQ0KLSAgICAgICAgICAgICk7DQotICBCYnNJdGVtLT5Cb290UHJpb3JpdHkgPSAweDAw Ow0KLQ0KLSAgRnJlZVBvb2wgKERldlBhdGgpOw0KLQ0KLSAgcmV0dXJuIFN0YXR1czsNCi19DQot DQotLyoqDQotICBBZGQgdGhlIGxlZ2FjeSBib290IG9wdGlvbnMgZnJvbSBCQlMgdGFibGUgaWYg dGhleSBkbyBub3QgZXhpc3QuDQotDQotICBAcmV0dmFsIEVGSV9TVUNDRVNTICAgICAgICAgIFRo ZSBib290IG9wdGlvbnMgYXJlIGFkZGVkIHN1Y2Nlc3NmdWxseSANCi0gICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgb3IgdGhleSBhcmUgYWxyZWFkeSBpbiBib290IG9wdGlvbnMuDQotICBA cmV0dmFsIEVGSV9OT1RfRk9VTkQgICAgICAgIE5vIGxlZ2FjeSBib290IG9wdGlvbnMgaXMgZm91 bmQuDQotICBAcmV0dmFsIEVGSV9PVVRfT0ZfUkVTT1VSQ0UgIE5vIGVub3VnaCBtZW1vcnkuDQot ICBAcmV0dXJuIE90aGVyIHZhbHVlICAgICAgICAgIExlZ2FjeUJvb3Qgb3B0aW9ucyBhcmUgbm90 IGFkZGVkLg0KLSoqLw0KLUVGSV9TVEFUVVMNCi1FRklBUEkNCi1CZHNBZGROb25FeGlzdGluZ0xl Z2FjeUJvb3RPcHRpb25zICgNCi0gIFZPSUQNCi0gICkNCi17DQotICBVSU5UMTYgICAgICAgICAg ICAgICAgICAgICpCb290T3JkZXI7DQotICBVSU5UTiAgICAgICAgICAgICAgICAgICAgIEJvb3RP cmRlclNpemU7DQotICBFRklfU1RBVFVTICAgICAgICAgICAgICAgIFN0YXR1czsNCi0gIENIQVIx NiAgICAgICAgICAgICAgICAgICAgRGVzY1sxMDBdOw0KLSAgVUlOVDE2ICAgICAgICAgICAgICAg ICAgICBIZGRDb3VudDsNCi0gIFVJTlQxNiAgICAgICAgICAgICAgICAgICAgQmJzQ291bnQ7DQot ICBIRERfSU5GTyAgICAgICAgICAgICAgICAgICpMb2NhbEhkZEluZm87DQotICBCQlNfVEFCTEUg ICAgICAgICAgICAgICAgICpMb2NhbEJic1RhYmxlOw0KLSAgVUlOVDE2ICAgICAgICAgICAgICAg ICAgICBCYnNJbmRleDsNCi0gIEVGSV9MRUdBQ1lfQklPU19QUk9UT0NPTCAgKkxlZ2FjeUJpb3M7 DQotICBVSU5UMTYgICAgICAgICAgICAgICAgICAgIEluZGV4Ow0KLSAgVUlOVDMyICAgICAgICAg ICAgICAgICAgICBBdHRyaWJ1dGU7DQotICBVSU5UMTYgICAgICAgICAgICAgICAgICAgIE9wdGlv bk51bWJlcjsNCi0gIEJPT0xFQU4gICAgICAgICAgICAgICAgICAgRXhpc3Q7DQotDQotICBIZGRD b3VudCAgICAgID0gMDsNCi0gIEJic0NvdW50ICAgICAgPSAwOw0KLSAgTG9jYWxIZGRJbmZvICA9 IE5VTEw7DQotICBMb2NhbEJic1RhYmxlID0gTlVMTDsNCi0NCi0gIFN0YXR1cyAgICAgICAgPSBn QlMtPkxvY2F0ZVByb3RvY29sICgmZ0VmaUxlZ2FjeUJpb3NQcm90b2NvbEd1aWQsIE5VTEwsIChW T0lEICoqKSAmTGVnYWN5Qmlvcyk7DQotICBpZiAoRUZJX0VSUk9SIChTdGF0dXMpKSB7DQotICAg IHJldHVybiBTdGF0dXM7DQotICB9DQotDQotICBMZWdhY3lCaW9zLT5HZXRCYnNJbmZvICgNCi0g ICAgICAgICAgICAgICAgTGVnYWN5QmlvcywNCi0gICAgICAgICAgICAgICAgJkhkZENvdW50LA0K LSAgICAgICAgICAgICAgICAmTG9jYWxIZGRJbmZvLA0KLSAgICAgICAgICAgICAgICAmQmJzQ291 bnQsDQotICAgICAgICAgICAgICAgICZMb2NhbEJic1RhYmxlDQotICAgICAgICAgICAgICAgICk7 DQotDQotICBCb290T3JkZXIgPSBCZHNMaWJHZXRWYXJpYWJsZUFuZFNpemUgKA0KLSAgICAgICAg ICAgICAgICBMIkJvb3RPcmRlciIsDQotICAgICAgICAgICAgICAgICZnRWZpR2xvYmFsVmFyaWFi bGVHdWlkLA0KLSAgICAgICAgICAgICAgICAmQm9vdE9yZGVyU2l6ZQ0KLSAgICAgICAgICAgICAg ICApOw0KLSAgaWYgKEJvb3RPcmRlciA9PSBOVUxMKSB7DQotICAgIEJvb3RPcmRlclNpemUgPSAw Ow0KLSAgfQ0KLQ0KLSAgZm9yIChJbmRleCA9IDA7IEluZGV4IDwgQmJzQ291bnQ7IEluZGV4Kysp IHsNCi0gICAgaWYgKChMb2NhbEJic1RhYmxlW0luZGV4XS5Cb290UHJpb3JpdHkgPT0gQkJTX0lH Tk9SRV9FTlRSWSkgfHwNCi0gICAgICAgIChMb2NhbEJic1RhYmxlW0luZGV4XS5Cb290UHJpb3Jp dHkgPT0gQkJTX0RPX05PVF9CT09UX0ZST00pDQotICAgICAgICApIHsNCi0gICAgICBjb250aW51 ZTsNCi0gICAgfQ0KLQ0KLSAgICBCZHNCdWlsZExlZ2FjeURldk5hbWVTdHJpbmcgKCZMb2NhbEJi c1RhYmxlW0luZGV4XSwgSW5kZXgsIHNpemVvZiAoRGVzYyksIERlc2MpOw0KLQ0KLSAgICBFeGlz dCA9IEJkc0ZpbmRMZWdhY3lCb290T3B0aW9uQnlEZXZUeXBlQW5kTmFtZSAoDQotICAgICAgICAg ICAgICBCb290T3JkZXIsDQotICAgICAgICAgICAgICBCb290T3JkZXJTaXplIC8gc2l6ZW9mIChV SU5UMTYpLA0KLSAgICAgICAgICAgICAgTG9jYWxCYnNUYWJsZVtJbmRleF0uRGV2aWNlVHlwZSwN Ci0gICAgICAgICAgICAgIERlc2MsDQotICAgICAgICAgICAgICAmQXR0cmlidXRlLA0KLSAgICAg ICAgICAgICAgJkJic0luZGV4LA0KLSAgICAgICAgICAgICAgJk9wdGlvbk51bWJlcg0KLSAgICAg ICAgICAgICAgKTsNCi0gICAgaWYgKCFFeGlzdCkgew0KLSAgICAgIC8vDQotICAgICAgLy8gTm90 IGZvdW5kIHN1Y2ggdHlwZSBvZiBsZWdhY3kgZGV2aWNlIGluIGJvb3Qgb3B0aW9ucyBvciB3ZSBm b3VuZCBidXQgaXQncyBkaXNhYmxlZA0KLSAgICAgIC8vIHNvIHdlIGhhdmUgdG8gY3JlYXRlIG9u ZSBhbmQgcHV0IGl0IHRvIHRoZSB0YWlsIG9mIGJvb3Qgb3JkZXIgbGlzdA0KLSAgICAgIC8vDQot ICAgICAgU3RhdHVzID0gQmRzQ3JlYXRlT25lTGVnYWN5Qm9vdE9wdGlvbiAoDQotICAgICAgICAg ICAgICAgICZMb2NhbEJic1RhYmxlW0luZGV4XSwNCi0gICAgICAgICAgICAgICAgSW5kZXgsDQot ICAgICAgICAgICAgICAgICZCb290T3JkZXIsDQotICAgICAgICAgICAgICAgICZCb290T3JkZXJT aXplDQotICAgICAgICAgICAgICAgICk7DQotICAgICAgaWYgKCFFRklfRVJST1IgKFN0YXR1cykp IHsNCi0gICAgICAgIEFTU0VSVCAoQm9vdE9yZGVyICE9IE5VTEwpOw0KLSAgICAgICAgQmJzSW5k ZXggICAgID0gSW5kZXg7DQotICAgICAgICBPcHRpb25OdW1iZXIgPSBCb290T3J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AgICAgICAgICAgICAqQmJzVGFibGUsDQotICBJTiBCQlNf VFlQRSAgICAgICAgICAgICAgICAgICAgIEJic1R5cGUsDQotICBJTiBVSU5UTiAgICAgICAgICAg ICAgICAgICAgICAgIEJic0NvdW50LA0KLSAgT1VUIFVJTlQxNiAgICAgICAgICAgICAgICAgICAg ICAqQnVmDQotICApDQotew0KLSAgVUlOVE4gSW5kZXg7DQotDQotICBmb3IgKEluZGV4ID0gMDsg SW5kZXggPCBCYnNDb3VudDsgSW5kZXgrKykgew0KLSAgICBpZiAoQmJzVGFibGVbSW5kZXhdLkJv b3RQcmlvcml0eSA9PSBCQlNfSUdOT1JFX0VOVFJZKSB7DQotICAgICAgY29udGludWU7DQotICAg IH0NCi0NCi0gICAgaWYgKEJic1RhYmxlW0luZGV4XS5EZXZpY2VUeXBlICE9IEJic1R5cGUpIHsN Ci0gICAgICBjb250aW51ZTsNCi0gICAgfQ0KLQ0KLSAgICAqQnVmID0gKFVJTlQxNikgKEluZGV4 ICYgMHhGRik7DQotICAgIEJ1ZisrOw0KLSAgfQ0KLQ0KLSAgcmV0dXJuIEJ1ZjsNCi19DQotDQot LyoqDQotICBDcmVhdGUgdGhlIGRldmljZSBvcmRlciBidWZmZXIuDQotDQotICBAcGFyYW0gQmJz VGFibGUgICAgICAgIFRoZSBCQlMgdGFibGUuDQotICBAcGFyYW0gQmJzQ291bnQgICAgICAgIFRo ZSBCQlMgQ291bnQuDQotDQotICBAcmV0dmFsIEVGSV9TVUNDRVMgICAgICAgICAgICAgVGhlIGJ1 ZmZlciBpcyBjcmVhdGVkIGFuZCB0aGUgRUZJIHZhcmlhYmxlIG5hbWVkIA0KLSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIFZBUl9MRUdBQ1lfREVWX09SREVSIGFuZCBnRWZpTGVnYWN5 RGV2T3JkZXJWYXJpYWJsZUd1aWQgaXMNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBzZXQgY29ycmVjdGx5Lg0KLSAgQHJldHZhbCBFRklfT1VUX09GX1JFU09VUkNFUyAgIE1lbW1v cnkgb3Igc3RvcmFnZSBpcyBub3QgZW5vdWdoLg0KLSAgQHJldHZhbCBFRklfREVWSUNFX0VSUk9S ICAgICAgIEZhaWwgdG8gYWRkIHRoZSBkZXZpY2Ugb3JkZXIgaW50byBFRkkgdmFyaWFibGUgZmFp bA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJlY2F1c2Ugb2YgaGFyZHdhcmUg ZXJyb3IuDQotKiovDQotRUZJX1NUQVRVUw0KLUJkc0NyZWF0ZURldk9yZGVyICgNCi0gIElOIEJC U19UQUJMRSAgICAgICAgICAgICAgICAgICpCYnNUYWJsZSwNCi0gIElOIFVJTlQxNiAgICAgICAg ICAgICAgICAgICAgIEJic0NvdW50DQotICApDQotew0KLSAgVUlOVE4gICAgICAgICAgICAgICAg ICAgICAgIEluZGV4Ow0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgIEZEQ291bnQ7DQot ICBVSU5UTiAgICAgICAgICAgICAgICAgICAgICAgSERDb3VudDsNCi0gIFVJTlROICAgICAgICAg ICAgICAgICAgICAgICBDRENvdW50Ow0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgIE5F VENvdW50Ow0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgIEJFVkNvdW50Ow0KLSAgVUlO VE4gICAgICAgICAgICAgICAgICAgICAgIFRvdGFsU2l6ZTsNCi0gIFVJTlROICAgICAgICAgICAg ICAgICAgICAgICBIZWFkZXJTaXplOw0KLSAgTEVHQUNZX0RFVl9PUkRFUl9FTlRSWSAgICAgICpE ZXZPcmRlcjsNCi0gIExFR0FDWV9ERVZfT1JERVJfRU5UUlkgICAgICAqRGV2T3JkZXJQdHI7DQot ICBFRklfU1RBVFVTICAgICAgICAgICAgICAgICAgU3RhdHVzOw0KLQ0KLSAgRkRDb3VudCAgICAg PSAwOw0KLSAgSERDb3VudCAgICAgPSA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0KLSAgVUlOVE4g ICAgICAgICAgICAgICAgICAgICAgIEluZGV4Ow0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAg ICAgIEluZGV4MjsNCi0gIFVJTlROICAgICAgICAgICAgICAgICAgICAgICAqSWR4Ow0KLSAgVUlO VE4gICAgICAgICAgICAgICAgICAgICAgIEZEQ291bnQ7DQotICBVSU5UTiAgICAgICAgICAgICAg ICAgICAgICAgSERDb3VudDsNCi0gIFVJTlROICAgICAgICAgICAgICAgICAgICAgICBDRENvdW50 Ow0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgIE5FVENvdW50Ow0KLSAgVUlOVE4gICAg ICAgICAgICAgICAgICAgICAgIEJFVkNvdW50Ow0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAg ICAgIFRvdGFsU2l6ZTsNCi0gIFVJTlROICAgICAgICAgICAgICAgICAgICAgICBIZWFkZXJTaXpl Ow0KLSAgVUlOVDE2ICAgICAgICAgICAgICAgICAgICAgICpOZXdGRFB0cjsNCi0gIFVJTlQxNiAg ICAgICAgICAgICAgICAgICAgICAqTmV3SERQdHI7DQotICBVSU5UMTYgICAgICAgICAgICAgICAg ICAgICAgKk5ld0NEUHRyOw0KLSAgVUlOVDE2ICAgICAgICAgICAgICAgICAgICAgICpOZXdORVRQ dHI7DQotICBVSU5UMTYgICAgICAgICAgICAgICAgICAgICAgKk5ld0JFVlB0cjsNCi0gIFVJTlQx NiAgICAgICAgICAgICAgICAgICAgICAqTmV3RGV2UHRyOw0KLSAgVUlOVE4gICAgICAgICAgICAg ICAgICAgICAgIEZESW5kZXg7DQotICBVSU5UTiAgICAgICAgICAgICAgICAgICAgICAgSERJbmRl eDsNCi0gIFVJTlROICAgICAgICAgICAgICAgICAgICAgICBDREluZGV4Ow0KLSAgVUlOVE4gICAg ICAgICAgICAgICAgICAgICAgIE5FVEluZGV4Ow0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAg ICAgIEJFVkluZGV4Ow0KLQ0KLSAgSWR4ICAgICAgICAgICA9IE5VTEw7DQotICBGRENvdW50ICAg ICAgID0gMDsNCi0gIEhEQ291bnQgICAgICAgPSAwOw0KLSAgQ0RDb3VudCAgICAgICA9IDA7DQot ICBORVRDb3VudCAgICAgID0gMDsNCi0gIEJFVkNvdW50ICAgICAgPSAwOw0KLSAgVG90YWxTaXpl ICAgICA9IDA7DQotICBIZWFkZXJTaXplICAgID0gc2l6ZW9mIChCQlNfVFlQRSkgKyBzaXplb2Yg KFVJTlQxNik7DQotICBGREluZGV4ICAgICAgID0gMDsNCi0gIEhESW5kZXggICAgICAgPSAwOw0K LSAgQ0RJbmRleCAgICAgICA9IDA7DQotICBORVRJbmRleCAgICAgID0gMDsNCi0gIEJFVkluZGV4 ICAgICAgPSAwOw0KLSAgTmV3RGV2UHRyICAgICA9IE5VTEw7DQotDQotICBTdGF0dXMgICAgICAg ID0gZ0JTLT5Mb2NhdGVQcm90b2NvbCAoJmdFZmlMZWdhY3lCaW9zUHJvdG9jb2xHdWlkLCBOVUxM LCAoVk9JRCAqKikgJkxlZ2FjeUJpb3MpOw0KLSAgaWYgKEVGSV9FUlJPUiAoU3RhdHVzKSkgew0K LSAgICByZXR1cm4gU3RhdHVzOw0KLSAgfQ0KLQ0KLSAgU3RhdHVzID0gTGVnYWN5Qmlvcy0+R2V0 QmJzSW5mbyAoDQotICAgICAgICAgICAgICAgICAgICAgICAgIExlZ2FjeUJpb3MsDQotICAgICAg ICAgICAgICAgICAgICAgICAgICZIZGRDb3VudCwNCi0gICAgICAgICAgICAgICAgICAgICAgICAg JkxvY2FsSGRkSW5mbywNCi0gICAgICAgICAgICAgICAgICAgICAgICAgJkJic0NvdW50LA0KLSAg ICAgICAgICAgICAgICAgICAgICAgICAmTG9jYWxCYnNUYWJsZQ0KLSAgICAgICAgICAgICAgICAg ICAgICAgICApOw0KLSAgaWYgKEVGSV9FUlJPUiAoU3RhdHVzKSkgew0KLSAgICByZXR1cm4gU3Rh dHVzOw0KLSAgfQ0KL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DQotDQotICAgIGNh c2UgQkJTX0VNQkVEX05FVFdPUks6DQotICAgICAgTkVUQ291bnQrKzsNCi0gICAgICBicmVhazsN Ci0NCi0gICAgY2FzZSBCQlNfQkVWX0RFVklDRToNCi0gICAgICBCRVZDb3VudCsrOw0KLSAgICAg IGJyZWFrOw0KLQ0KLSAgICBkZWZhdWx0Og0KLSAgICAgIGJyZWFrOw0KLSAgICB9DQotICB9DQot DQotICBUb3RhbFNpemUgKz0gKEhlYWRlclNpemUgKyBGRENvdW50ICogc2l6ZW9mIChVSU5UMTYp KTsNCi0gIFRvdGFsU2l6ZSArPSAoSGVhZGVyU2l6ZSArIEhEQ291bnQgKiBzaXplb2YgKFVJTlQx NikpOw0KLSAgVG90YWxTaXplICs9IChIZWFkZXJTaXplICsgQ0RDb3VudCAqIHNpemVvZiAoVUlO VDE2KSk7DQotICBUb3RhbFNpemUgKz0gKEhlYWRlclNpemUgKyBORVRDb3VudCAqIHNpemVvZiAo VUlOVDE2KSk7DQotICBUb3RhbFNpemUgKz0gKEhlYWRlclNpemUgKyBCRVZDb3VudCAqIHNpemVv ZiAoVUlOVDE2KSk7DQotDQotICBOZXdEZXZPcmRlciA9IEFsbG9jYXRlWmVyb1Bvb2wgKFRvdGFs U2l6ZSk7DQotICBpZiAoTlVMTCA9PSBOZXdEZXZPcmRlcikgew0KLSAgICByZXR1cm4gRUZJX09V VF9PRl9SRVNPVVJDRVM7DQotICB9DQotDQotDQotDQotICAvLw0KLSAgLy8gY29weSBGRA0KLSAg Ly8NCi0gIFB0ciAgICAgICAgICAgICA9IERldk9yZGVyOw0KLSAgTmV3UHRyICAgICAgICAgID0g TmV3RGV2T3JkZXI7DQotICBOZXdQdHItPkJic1R5cGUgPSBQdHItPkJic1R5cGU7DQotICBOZXdQ dHItPkxlbmd0aCAgPSAoVUlOVDE2KSAoc2l6ZW9mIChVSU5UMTYpICsgRkRDb3VudCAqIHNpemVv ZiAoVUlOVDE2KSk7DQotICBmb3IgKEluZGV4ID0g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ZGV2aWNlLg0KLSAgQHJldHZhbCBFRklfT1VUX09GX1JFU09VUkNFUyAgRmFpbGVkIHRv IGdldCB0aGUgZWZpIHZhcmlhYmxlIG9mIGRldmljZSBvcmRlci4NCi0NCi0qKi8NCi1FRklfU1RB VFVTDQotQmRzU2V0Qm9vdFByaW9yaXR5NFNhbWVUeXBlRGV2ICgNCi0gIElOIFVJTlQxNiAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEZXZpY2VUeXBlLA0KLSAg SU4gVUlOVE4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJi c0luZGV4LA0KLSAgSU4gT1VUIEJCU19UQUJMRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICpMb2NhbEJic1RhYmxlLA0KLSAgSU4gT1VUIFVJTlQxNiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICpQcmlvcml0eQ0KLSAgKQ0KLXsNCi0gIExFR0FD WV9ERVZfT1JERVJfRU5UUlkgICAgICAqRGV2T3JkZXI7DQotICBMRUdBQ1lfREVWX09SREVSX0VO VFJZICAgICAgKkRldk9yZGVyUHRyOw0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgIERl dk9yZGVyU2l6ZTsNCi0gIFVJTlROICAgICAgICAgICAgICAgICAgICAgICBJbmRleDsNCi0NCi0g IERldk9yZGVyID0gQmRzTGliR2V0VmFyaWFibGVBbmRTaXplICgNCi0gICAgICAgICAgICAgICBW QVJfTEVHQUNZX0RFVl9PUkRFUiwNCi0gICAgICAgICAgICAgICAmZ0VmaUxlZ2FjeURldk9yZGVy VmFyaWFibGVHdWlkLA0KLSAgICAgICAgICAgICAgICZEZXZPcmRlclNpemUNCi0gICAgICAgICAg ICAgICApOw0KLSAgaWYgKE5VTEwgPT0gRGV2T3JkZXIpIHsNCi0gICAgcmV0dXJuIEVGSV9PVVRf T0ZfUkVTT1VSQ0VT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ICAvLw0KLSAgICAgIC8vIExvY2FsQmJzVGFi bGVbRGV2SW5kZXhbSW5kZXhdICYgMHhGRl0uQm9vdFByaW9yaXR5ID0gQkJTX0RJU0FCTEVEX0VO VFJZOw0KLSAgICAgIC8vDQotICAgIH0gZWxzZSBpZiAoRGV2T3JkZXJQdHItPkRhdGFbSW5kZXhd ICE9IEJic0luZGV4KSB7DQotICAgICAgTG9jYWxCYnNUYWJsZVtEZXZPcmRlclB0ci0+RGF0YVtJ bmRleF1dLkJvb3RQcmlvcml0eSA9ICpQcmlvcml0eTsNCi0gICAgICAoKlByaW9yaXR5KSsrOw0K LSAgICB9DQotICB9DQotDQotICBGcmVlUG9vbCAoRGV2T3JkZXIpOw0KLSAgcmV0dXJuIEVGSV9T VUNDRVNTOw0KLX0NCi0NCi0vKioNCi0gIFByaW50IHRoZSBCQlMgVGFibGUuDQotDQotICBAcGFy YW0gTG9jYWxCYnNUYWJsZSAgIFRoZSBCQlMgdGFibGUuDQotICBAcGFyYW0gQmJzQ291bnQgICAg ICAgIFRoZSBjb3VudCBvZiBlbnRyeSBpbiBCQlMgdGFibGUuDQotKiovDQotVk9JRA0KLVByaW50 QmJzVGFibGUgKA0KLSAgSU4gQkJTX1RBQkxFICAqTG9jYWxCYnNUYWJsZSwNCi0gIElOIFVJTlQx NiAgICAgQmJzQ291bnQNCi0gICkNCi17DQotICBVSU5UMTYgIElkeDsNCi0NCi0gIERFQlVHICgo REVCVUdfRVJST1IsICJcbiIpKTsNCi0gIERFQlVHICgoREVCVUdfRVJST1IsICIgTk8gIFByaW8g YmIvZGQvZmYgY2wvc2MgVHlwZSBTdGF0IHNlZ206b2Zmc1xuIikpOw0KLSAgREVCVUcgKChERUJV R19FUlJPUiwgIj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxu IikpOw0KLSAgZm9yIChJZHggPSAwOyBJZHggPCBCYnNDb3VudDsgSWR4KyspIHsNCi0gICAgaWYg KChMb2NhbEJic1RhYm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EFUVVMgICAg ICAgICAgICAgICAgU3RhdHVzOw0KLSAgVUlOVDE2ICAgICAgICAgICAgICAgICAgICBCYnNJbmRl eDsNCi0gIFVJTlQxNiAgICAgICAgICAgICAgICAgICAgSGRkQ291bnQ7DQotICBVSU5UMTYgICAg ICAgICAgICAgICAgICAgIEJic0NvdW50Ow0KLSAgSEREX0lORk8gICAgICAgICAgICAgICAgICAq TG9jYWxIZGRJbmZvOw0KLSAgQkJTX1RBQkxFICAgICAgICAgICAgICAgICAqTG9jYWxCYnNUYWJs ZTsNCi0gIFVJTlQxNiAgICAgICAgICAgICAgICAgICAgRGV2VHlwZTsNCi0gIEVGSV9MRUdBQ1lf QklPU19QUk9UT0NPTCAgKkxlZ2FjeUJpb3M7DQotICBVSU5UTiAgICAgICAgICAgICAgICAgICAg IEluZGV4Ow0KLSAgVUlOVDE2ICAgICAgICAgICAgICAgICAgICBQcmlvcml0eTsNCi0gIFVJTlQx NiAgICAgICAgICAgICAgICAgICAgKkJvb3RPcmRlcjsNCi0gIFVJTlROICAgICAgICAgICAgICAg ICAgICAgQm9vdE9yZGVyU2l6ZTsNCi0gIFVJTlQ4ICAgICAgICAgICAgICAgICAgICAgKkJvb3RP cHRpb25WYXI7DQotICBVSU5UTiAgICAgICAgICAgICAgICAgICAgIEJvb3RPcHRpb25TaXplOw0K LSAgQ0hBUjE2ICAgICAgICAgICAgICAgICAgICBCb290T3B0aW9uWzldOw0KLSAgVUlOVDggICAg ICAgICAgICAgICAgICAgICAqUHRyOw0KLSAgVUlOVDE2ICAgICAgICAgICAgICAgICAgICBEZXZQ YXRoTGVuOw0KLSAgRUZJX0RFVklDRV9QQVRIX1BST1RPQ09MICAqRGV2UGF0aDsNCi0gIFVJTlQx NiAgICAgICAgICAgICAgICAgICAgKkRldmljZVR5cGU7DQotICBVSU5UTiAgICAgICAgICAgICAg ICAgICAgIERldmljZVR5cGVDb3VudDsNCi0gIFVJTlROICAgICAgICAgICAgICAgICAgICAgRGV2 aWNlVHlw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k9NID09IExvY2FsQmJzVGFibGVbSW5kZXhdLkJv b3RQcmlvcml0eSkgfHwNCi0gICAgICAgICAoQkJTX0xPV0VTVF9QUklPUklUWSA9PSBMb2NhbEJi c1RhYmxlW0luZGV4XS5Cb290UHJpb3JpdHkpKSkgew0KLSAgICAgIExvY2FsQmJzVGFibGVbSW5k ZXhdLkJvb3RQcmlvcml0eSA9IEJCU19VTlBSSU9SSVRJWkVEX0VOVFJZOw0KLSAgICB9DQotICB9 DQotICAvLw0KLSAgLy8gYm9vdCBwcmlvcml0eSBhbHdheXMgc3RhcnRzIGF0IDANCi0gIC8vDQot ICBQcmlvcml0eSA9IDA7DQotICBpZiAoRW50cnktPkxvYWRPcHRpb25zU2l6ZSA9PSBzaXplb2Yg KEJCU19UQUJMRSkgKyBzaXplb2YgKFVJTlQxNikpIHsNCi0gICAgLy8NCi0gICAgLy8gSWYgRW50 cnkgc3RhbmRzIGZvciBhIGxlZ2FjeSBib290IG9wdGlvbiwgd2UgcHJpb3JpdGl6ZSB0aGUgZGV2 aWNlcyB3aXRoIHRoZSBzYW1lIHR5cGUgZmlyc3QuDQotICAgIC8vDQotICAgIERldlR5cGUgID0g KChCQlNfVEFCTEUgKikgRW50cnktPkxvYWRPcHRpb25zKS0+RGV2aWNlVHlwZTsNCi0gICAgQmJz SW5kZXggPSAqKFVJTlQxNiAqKSAoKEJCU19UQUJMRSAqKSBFbnRyeS0+TG9hZE9wdGlvbnMgKyAx KTsNCi0gICAgU3RhdHVzID0gQmRzU2V0Qm9vdFByaW9yaXR5NFNhbWVUeXBlRGV2ICgNCi0gICAg ICAgICAgICAgIERldlR5cGUsDQotICAgICAgICAgICAgICBCYnNJbmRleCwNCi0gICAgICAgICAg ICAgIExvY2FsQmJzVGFibGUsDQotICAgICAgICAgICAgICAmUHJpb3JpdHkNCi0gICAgICAgICAg ICAgICk7DQotICAgIGlmIChFRklfRVJST1IgKFN0YXR1cykpIHsNCi0gICAgICByZXR1cm4gU3Rh dHVzOw0KLSAgICB9DQotICB9DQotICAvLw0KLSAgLy8gd2UgaGF2ZSB0byBzZXQgdGhlIGJvb3Qg cHJpb3JpdHkgZm9yIG90aGVyIEJCUyBlbnRyaWVzIHdpdGggZGlmZmVyZW50IGRldmljZSB0eXBl cw0KLSAgLy8NCi0gIEJvb3RPcmRlciA9IEJkc0xpYkdldFZhcmlhYmxlQW5kU2l6ZSAoDQotICAg ICAgICAgICAgICAgIEwiQm9vdE9yZGVyIiwNCi0gICAgICAgICAgICAgICAgJmdFZmlHbG9iYWxW YXJpYWJsZUd1aWQsDQotICAgICAgICAgICAgICAgICZCb290T3JkZXJTaXplDQotICAgICAgICAg ICAgICAgICk7DQotICBEZXZpY2VUeXBlID0gQWxsb2NhdGVQb29sIChCb290T3JkZXJTaXplICsg c2l6ZW9mIChVSU5UMTYpKTsNCi0gIEFTU0VSVCAoRGV2aWNlVHlwZSAhPSBOVUxMKTsNCi0NCi0g IERldmljZVR5cGVbMF0gICA9IERldlR5cGU7DQotICBEZXZpY2VUeXBlQ291bnQgPSAxOw0KLSAg Zm9yIChJbmRleCA9IDA7ICgoQm9vdE9yZGVyICE9IE5VTEwpICYmIChJbmRleCA8IEJvb3RPcmRl clNpemUgLyBzaXplb2YgKFVJTlQxNikpKTsgSW5kZXgrKykgew0KLSAgICBVbmljb2RlU1ByaW50 IChCb290T3B0aW9uLCBzaXplb2YgKEJvb3RPcHRpb24pLCBMIkJvb3QlMDR4IiwgQm9vdE9yZGVy W0luZGV4XSk7DQotICAgIEJvb3RPcHRpb25WYXIgPSBCZHNMaWJHZXRWYXJpYWJsZUFuZFNpemUg KA0KLSAgICAgICAgICAgICAgICAgICAgICBCb290T3B0aW9uLA0KLSAgICAgICAgICAgICAgICAg ICAgICAmZ0VmaUdsb2JhbFZhcmlhYmxlR3VpZCwNCi0gICAgICAgICAgICAgICAgICAgICAgJkJv b3RPcHRpb25TaXplDQotICAgICAgICAgICAgICAgICAgICAgICk7DQotICAgIGlmIChOVUxMID09 IEJvb3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i0gICAgLy8NCi0gICAgLy8gQ3JlYXRlIGFuIGV2ZW50IHRvIGJlIHNpZ25h bGxlZCB3aGVuIExlZ2FjeSBCb290IG9jY3VycyB0byB3cml0ZSBwZXJmb3JtYW5jZSBkYXRhLg0K LSAgICAvLw0KLSAgICBTdGF0dXMgPSBFZmlDcmVhdGVFdmVudExlZ2FjeUJvb3RFeCgNCi0gICAg ICAgICAgICAgICBUUExfTk9USUZZLA0KLSAgICAgICAgICAgICAgIEJtRW5kT2ZCZHNQZXJmQ29k ZSwNCi0gICAgICAgICAgICAgICBOVUxMLCANCi0gICAgICAgICAgICAgICAmTGVnYWN5Qm9vdEV2 ZW50DQotICAgICAgICAgICAgICAgKTsNCi0gICAgQVNTRVJUX0VGSV9FUlJPUiAoU3RhdHVzKTsN Ci0gICk7DQotDQotICBERUJVRyAoKERFQlVHX0lORk8gfCBERUJVR19MT0FELCAiTGVnYWN5IEJv b3Q6ICVTXG4iLCBPcHRpb24tPkRlc2NyaXB0aW9uKSk7DQotICByZXR1cm4gTGVnYWN5Qmlvcy0+ TGVnYWN5Qm9vdCAoDQotICAgICAgICAgICAgICAgICAgICAgIExlZ2FjeUJpb3MsDQotICAgICAg ICAgICAgICAgICAgICAgIChCQlNfQkJTX0RFVklDRV9QQVRIICopIE9wdGlvbi0+RGV2aWNlUGF0 aCwNCi0gICAgICAgICAgICAgICAgICAgICAgT3B0aW9uLT5Mb2FkT3B0aW9uc1NpemUsDQotICAg ICAgICAgICAgICAgICAgICAgIE9wdGlvbi0+TG9hZE9wdGlvbnMNCi0gICAgICAgICAgICAgICAg ICAgICAgKTsNCi19DQotDQotLyoqDQotICBJbnRlcm5hbCBmdW5jdGlvbiB0byBjaGVjayBpZiB0 aGUgaW5wdXQgYm9vdCBvcHRpb24gaXMgYSB2YWxpZCBFRkkgTlYgQm9vdCMjIyMuDQotDQotICBA cGFyYW0gT3B0aW9uVG9DaGVjayAgQm9vdCBvcHRpb24gdG8gYmUgY2hlY2tlZC4NCi0N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09MICAgICAgICAqVXNiSW8sDQotICBJTiBVU0JfV1dJRF9ERVZJQ0VfUEFUSCAgICAgICAqVXNi V3dpZA0KLSAgKQ0KLXsNCi0gIEVGSV9TVEFUVVMgICAgICAgICAgICAgICAgICAgU3RhdHVzOw0K LSAgRUZJX1VTQl9ERVZJQ0VfREVTQ1JJUFRPUiAgICBEZXZEZXNjOw0KLSAgRUZJX1VTQl9JTlRF UkZBQ0VfREVTQ1JJUFRPUiBJZkRlc2M7DQotICBVSU5UMTYgICAgICAgICAgICAgICAgICAgICAg ICpMYW5nSWRUYWJsZTsNCi0gIFVJTlQxNiAgICAgICAgICAgICAgICAgICAgICAgVGFibGVTaXpl Ow0KLSAgVUlOVDE2ICAgICAgICAgICAgICAgICAgICAgICBJbmRleDsNCi0gIENIQVIxNiAgICAg ICAgICAgICAgICAgICAgICAgKkNvbXBhcmVTdHI7DQotICBVSU5UTiAgICAgICAgICAgICAgICAg ICAgICAgIENvbXBhcmVMZW47DQotICBDSEFSMTYgICAgICAgICAgICAgICAgICAgICAgICpTZXJp YWxOdW1iZXJTdHI7DQotICBVSU5UTiAgICAgICAgICAgICAgICAgICAgICAgIExlbmd0aDsNCi0N Ci0gIGlmICgoRGV2aWNlUGF0aFR5cGUgKFVzYld3aWQpICE9IE1FU1NBR0lOR19ERVZJQ0VfUEFU SCkgfHwNCi0gICAgICAoRGV2aWNlUGF0aFN1YlR5cGUgKFVzYld3aWQpICE9IE1TR19VU0JfV1dJ RF9EUCApKXsNCi0gICAgcmV0dXJuIEZBTFNFOw0KLSAgfQ0KLQ0KLSAgLy8NCi0gIC8vIENoZWNr IFZlbmRvciBJZCBhbmQgUHJvZHVjdCBJZC4NCi0gIC8vDQotICBTdGF0dXMgPSBVc2JJby0+VXNi R2V0RGV2aWNlRGVzY3JpcHRvciAoVXNiSW8sICZEZXZEZXNjKTsNCi0gIGlmIChFRklfRVJST1Ig KFN0YXR1cykpIHsNCi0gICAgcmV0dXJuIEZBTFNFOw0KLSAgfQ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aW4gVVNCIFdXSUQg ZGV2aWNlIHBhdGggaXMgdGhlIGxhc3QgNjQtb3ItbGVzcyBVVEYtMTYgY2hhcmFjdGVycy4NCi0g IC8vDQotICBDb21wYXJlU3RyID0gKENIQVIxNiAqKSAoVUlOVE4pIChVc2JXd2lkICsgMSk7DQot ICBDb21wYXJlTGVuID0gKERldmljZVBhdGhOb2RlTGVuZ3RoIChVc2JXd2lkKSAtIHNpemVvZiAo VVNCX1dXSURfREVWSUNFX1BBVEgpKSAvIHNpemVvZiAoQ0hBUjE2KTsNCi0gIGlmIChDb21wYXJl U3RyW0NvbXBhcmVMZW4gLSAxXSA9PSBMJ1wwJykgew0KLSAgICBDb21wYXJlTGVuLS07DQotICB9 DQotDQotICAvLw0KLSAgLy8gQ29tcGFyZSBzZXJpYWwgbnVtYmVyIGluIGVhY2ggc3VwcG9ydGVk IGxhbmd1YWdlLg0KLSAgLy8NCi0gIGZvciAoSW5kZXggPSAwOyBJbmRleCA8IFRhYmxlU2l6ZSAv IHNpemVvZiAoVUlOVDE2KTsgSW5kZXgrKykgew0KLSAgICBTZXJpYWxOdW1iZXJTdHIgPSBOVUxM Ow0KLSAgICBTdGF0dXMgPSBVc2JJby0+VXNiR2V0U3RyaW5nRGVzY3JpcHRvciAoDQotICAgICAg ICAgICAgICAgICAgICAgIFVzYklvLA0KLSAgICAgICAgICAgICAgICAgICAgICBMYW5nSWRUYWJs ZVtJbmRleF0sDQotICAgICAgICAgICAgICAgICAgICAgIERldkRlc2MuU3RyU2VyaWFsTnVtYmVy LA0KLSAgICAgICAgICAgICAgICAgICAgICAmU2VyaWFsTnVtYmVyU3RyDQotICAgICAgICAgICAg ICAgICAgICAgICk7DQotICAgIGlmIChFRklfRVJST1IgKFN0YXR1cykgfHwgKFNlcmlhbE51bWJl clN0ciA9PSBOVUxMKSkgew0KLSAgICAgIGNvbnRpbnVlOw0KLSAgICB9DQotDQotICAgIExlbmd0 aCA9IFN0ckxlbiAoU2VyaWFsTnVtYmVyU3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vIG1hdGNoLg0KLQ0KLSAgQHJldHVybiAgVGhl IGltYWdlIEhhbmRsZSBpZiBmaW5kIGxvYWQgZmlsZSBmcm9tIHNwZWNpZmllZCBzaG9ydC1mb3Jt IGRldmljZSBwYXRoDQotICAgICAgICAgICBvciBOVUxMIGlmIG5vdCBmb3VuZC4NCi0NCi0qKi8N Ci1FRklfSEFORExFICoNCi1CZHNGaW5kVXNiRGV2aWNlICgNCi0gIElOIEVGSV9ERVZJQ0VfUEFU SF9QUk9UT0NPTCAgICpQYXJlbnREZXZpY2VQYXRoLA0KLSAgSU4gRUZJX0RFVklDRV9QQVRIX1BS T1RPQ09MICAgKlNob3J0Rm9ybURldmljZVBhdGgNCi0gICkNCi17DQotICBFRklfU1RBVFVTICAg ICAgICAgICAgICAgIFN0YXR1czsNCi0gIFVJTlROICAgICAgICAgICAgICAgICAgICAgVXNiSW9I YW5kbGVDb3VudDsNCi0gIEVGSV9IQU5ETEUgICAgICAgICAgICAgICAgKlVzYklvSGFuZGxlQnVm ZmVyOw0KLSAgRUZJX0RFVklDRV9QQVRIX1BST1RPQ09MICAqVXNiSW9EZXZpY2VQYXRoOw0KLSAg RUZJX1VTQl9JT19QUk9UT0NPTCAgICAgICAqVXNiSW87DQotICBVSU5UTiAgICAgICAgICAgICAg ICAgICAgIEluZGV4Ow0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICBQYXJlbnRTaXplOw0K LSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICBTaXplOw0KLSAgRUZJX0hBTkRMRSAgICAgICAg ICAgICAgICBJbWFnZUhhbmRsZTsNCi0gIEVGSV9IQU5ETEUgICAgICAgICAgICAgICAgSGFuZGxl Ow0KLSAgRUZJX0RFVklDRV9QQVRIX1BST1RPQ09MICAqRnVsbERldmljZVBhdGg7DQotICBFRklf REVWSUNFX1BBVEhfUFJPVE9DT0wgICpOZXh0RGV2aWNlUGF0aDsNCi0NCi0gIEZ1bGxEZXZpY2VQ YXRoID0gTlVMTDsNCi0gIEltYWdlSGFuZGxlICAgID0gTlVMTDsNCi0NCi0gIC8vDQotICAvLyBH ZXQgYWxsIFVzYklvIEhhbmRsZXMuDQotICAvLw0KLSAgVXNiSW9IYW5kbGVDb3VudCA9IDA7DQot ICBVc2JJb0hhbmRsZUJ1ZmZlciA9IE5VTEw7DQotICBTdGF0dXMgPSBnQlMtPkxvY2F0ZUhhbmRs ZUJ1ZmZlciAoDQotICAgICAgICAgICAgICAgICAgQnlQcm90b2NvbCwNCi0gICAgICAgICAgICAg ICAgICAmZ0VmaVVzYklvUHJvdG9jb2xHdWlkLA0KLSAgICAgICAgICAgICAgICAgIE5VTEwsDQot ICAgICAgICAgICAgICAgICAgJlVzYklvSGFuZGxlQ291bnQsDQotICAgICAgICAgICAgICAgICAg JlVzYklvSGFuZGxlQnVmZmVyDQotICAgICAgICAgICAgICAgICAgKTsNCi0gIGlmIChFRklfRVJS T1IgKFN0YXR1cykgfHwgKFVzYklvSGFuZGxlQ291bnQgPT0gMCkgfHwgKFVzYklvSGFuZGxlQnVm ZmVyID09IE5VTEwpKSB7DQotICAgIHJldHVybiBOVUxMOw0KLSAgfQ0KLQ0KLSAgUGFyZW50U2l6 ZSA9IChQYXJlbnREZXZpY2VQYXRoID09IE5VTEwpID8gMCA6IEdldERldmljZVBhdGhTaXplIChQ YXJlbnREZXZpY2VQYXRoKTsNCi0gIGZvciAoSW5kZXggPSAwOyBJbmRleCA8IFVzYklvSGFuZGxl Q291bnQ7IEluZGV4KyspIHsNCi0gICAgLy8NCi0gICAgLy8gR2V0IHRoZSBVc2IgSU8gaW50ZXJm YWNlLg0KLSAgICAvLw0KLSAgICBTdGF0dXMgPSBnQlMtPkhhbmRsZVByb3RvY29sKA0KLSAgICAg ICAgICAgICAgICAgICAgVXNiSW9IYW5kbGVCdWZmZXJbSW5kZXhdLA0KLSAgICAgICAgICAgICAg ICAgICAgJmdFZmlVc2JJb1Byb3RvY29sR3VpZCwNCi0gICAgICAgICAgICAgICAgICAgIChWT0lE ICoqKSAmVXNiSW8NCi0gICAgICAgICAgICAgICAgICAgICk7DQotICAgIGlmIChFRklfRVJST1Ig KFN0YXR1cykpIHsNCi0gICAgICBjb250aW51ZTsNCi0gICAgfQ0KLQ0KLSAgICBVc2JJb0Rldmlj ZVBhdGggPSBEZXZpY2VQYXRoRnJvbUhhbmRsZSAoVXNiSW9IYW5kbGVCdWZmZXJbSW5kZXhdKTsN Ci0gICAgaWYgKFVzYklvRGV2aWNlUGF0aCA9PSBOVUxMKSB7DQotICAgICAgY29udGludWU7DQot ICAgIH0NCi0NCi0gICAgaWYgKFBhcmVudERldmljZVBhdGggIT0gTlVMTCkgew0KLSAgICAgIC8v DQotICAgICAgLy8gQ29tcGFyZSBzdGFydGluZyBwYXJ0IG9mIFVzYklvSGFuZGxlJ3MgZGV2aWNl IHBhdGggd2l0aCBQYXJlbnREZXZpY2VQYXRoLg0KLSAgICAgIC8vDQotICAgICAgU2l6ZSA9IEdl dERldmljZVBhdGhTaXplIChVc2JJb0RldmljZVBhdGgpOw0KLSAgICAgIGlmICgoU2l6ZSA8IFBh cmVudFNpemUpIHx8DQotICAgICAgICAgIChDb21wYXJlTWVtIChVc2JJb0RldmljZVBhdGgsIFBh cmVudERldmljZVBhdGgsIFBhcmVudFNpemUgLSBFTkRfREVWSUNFX1BBVEhfTEVOR1RIKSAhPSAw KSkgew0KLSAgICAgICAgY29udGludWU7DQotICAgICAgfQ0KLSAgICB9DQotDQotICAgIGlmIChC ZHNNYXRjaFVzYkNsYXNzIChVc2JJbywgKFVTQl9DTEFTU19ERVZJQ0VfUEFUSCAqKSBTaG9ydEZv cm1EZXZpY2VQYXRoKSB8fA0KLSAgICAgICAgQmRzTWF0Y2hVc2JXd2lkIChVc2JJbywgKFVTQl9X V0lEX0RFVklDRV9QQVRIICopIFNob3J0Rm9ybURldmljZVBhdGgpKSB7DQotICAgICAgLy8NCi0g ICAgICAvLyBUcnkgdG8gZmluZCBpZiB0aGVyZSBpcyB0aGUgYm9vdCBmaWxlIGluIHRoaXMgRGV2 aWNlUGF0aA0KLSAgICAgIC8vDQotICAgICAgTmV4dERldmljZVBhdGggPSBOZXh0RGV2aWNlUGF0 aE5vZGUgKFNob3J0Rm9ybURldmljZVBhdGgpOw0KLSAgICAgIGlmICghSXNEZXZpY2VQYXRoRW5k IChOZXh0RGV2aWNlUGF0aCkpIHsNCi0gICAgICAgIEZ1bGxEZXZpY2VQYXRoID0gQXBwZW5kRGV2 aWNlUGF0aCAoVXNiSW9EZXZpY2VQYXRoLCBOZXh0RGV2aWNlUGF0aCk7DQotICAgICAgICAvLw0K LSAgICAgICAgLy8gQ29ubmVjdCB0aGUgZnVsbCBkZXZpY2UgcGF0aCwgc28gdGhhdCBTaW1wbGUg RmlsZSBTeXN0ZW0gcHJvdG9jb2wNCi0gICAgICAgIC8vIGNvdWxkIGJlIGluc3RhbGxlZCBmb3Ig dGhpcyBVU0IgZGV2aWNlLg0KLSAgICAgICAgLy8NCi0gICAgICAgIEJkc0xpYkNvbm5lY3REZXZp Y2VQYXRoIChGdWxsRGV2aWNlUGF0aCk7DQotICAgICAgICBSRVBPUlRfU1RBVFVTX0NPREUgKEVG SV9QUk9HUkVTU19DT0RFLCBQY2RHZXQzMiAoUGNkUHJvZ3Jlc3NDb2RlT3NMb2FkZXJMb2FkKSk7 DQotICAgICAgICBTdGF0dXMgPSBnQlMtPkxvYWRJbWFnZSAoDQotICAgICAgICAgICAgICAgICAg ICAgICBUUlVFLA0KLSAgICAgICAgICAgICAgICAgICAgICAgZ0ltYWdlSGFuZGxlLA0KLSAgICAg ICAgICAgICAgICAgICAgICAgRnVsbERldmljZVBhdGgsDQotICAgICAgICAgICAgICAgICAgICAg ICBOVUxMLA0KLSAgICAgICAgICAgICAgICAgICAgICAgMCwNCi0gICAgICAgICAgICAgICAgICAg ICAgICZJbWFnZUhhbmRsZQ0KLSAgICAgICAgICAgICAgICAgICAgICAgKTsNCi0gICAgICAgIEZy ZWVQb29sIChGdWxsRGV2aWNlUGF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AgICAgIC8vDQotICAg ICAgICBGdWxsRGV2aWNlUGF0aCA9IEZpbGVEZXZpY2VQYXRoIChIYW5kbGUsIEVGSV9SRU1PVkFC TEVfTUVESUFfRklMRV9OQU1FKTsNCi0gICAgICAgIGlmIChGdWxsRGV2aWNlUGF0aCAhPSBOVUxM KSB7DQotICAgICAgICAgIFJFUE9SVF9TVEFUVVNfQ09ERSAoRUZJX1BST0dSRVNTX0NPREUsIFBj ZEdldDMyIChQY2RQcm9ncmVzc0NvZGVPc0xvYWRlckxvYWQpKTsNCi0gICAgICAgICAgU3RhdHVz ID0gZ0JTLT5Mb2FkSW1hZ2UgKA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgVFJVRSwNCi0g ICAgICAgICAgICAgICAgICAgICAgICAgIGdJbWFnZUhhbmRsZSwNCi0gICAgICAgICAgICAgICAg ICAgICAgICAgIEZ1bGxEZXZpY2VQYXRoLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgTlVM TCwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgIDAsDQotICAgICAgICAgICAgICAgICAgICAg ICAgICAmSW1hZ2VIYW5kbGUNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICk7DQotICAgICAg ICAgIGlmIChFRklfRVJST1IgKFN0YXR1cykpIHsNCi0gICAgICAgICAgICAvLw0KLSAgICAgICAg ICAgIC8vIFRoZSBEZXZpY2VQYXRoIGZhaWxlZCwgYW5kIGl0J3Mgbm90IGEgdmFsaWQNCi0gICAg ICAgICAgICAvLyByZW1vdmFibGUgbWVkaWEgZGV2aWNlLg0KLSAgICAgICAgICAgIC8vDQotICAg ICAgICAgICAgY29udGludWU7DQotICAgICAgICAgIH0NCi0gICAgICAgIH0gZWxzZSB7DQotICAg ICAgICAgIGNvbnRpbnVlOw0KLSAgICAgICAgfQ0KLSAgICAgIH0NCi0gICAgICBicmVhazsNCi0g ICAgfQ0KLSAgfQ0KLQ0KLSAgRnJlZVBvb2wgKFVzYklvSGFuZGxlQnVm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i0gICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICB0aGUgbGVnYWN5IE9TDQotICBAcGFyYW0gIEV4aXREYXRhU2l6ZSAgICAg ICAgICAgVGhlIHNpemUgb2YgZXhpdCBkYXRhLg0KLSAgQHBhcmFtICBFeGl0RGF0YSAgICAgICAg ICAgICAgIERhdGEgcmV0dXJuZWQgd2hlbiBCb290IGltYWdlIGZhaWxlZC4NCi0NCi0gIEByZXR2 YWwgRUZJX1NVQ0NFU1MgICAgICAgICAgICBCb290IGZyb20gdGhlIGlucHV0IGJvb3Qgb3B0aW9u IHN1Y2Nlc3NmdWxseS4NCi0gIEByZXR2YWwgRUZJX05PVF9GT1VORCAgICAgICAgICBJZiB0aGUg RGV2aWNlIFBhdGggaXMgbm90IGZvdW5kIGluIHRoZSBzeXN0ZW0NCi0NCi0qKi8NCi1FRklfU1RB VFVTDQotRUZJQVBJDQotQmRzTGliQm9vdFZpYUJvb3RPcHRpb24gKA0KLSAgSU4gIEJEU19DT01N T05fT1BUSU9OICAgICAgICAgICAgICpPcHRpb24sDQotICBJTiAgRUZJX0RFVklDRV9QQVRIX1BS T1RPQ09MICAgICAgKkRldmljZVBhdGgsDQotICBPVVQgVUlOVE4gICAgICAgICAgICAgICAgICAg ICAgICAgKkV4aXREYXRhU2l6ZSwNCi0gIE9VVCBDSEFSMTYgICAgICAgICAgICAgICAgICAgICAg ICAqKkV4aXREYXRhIE9QVElPTkFMDQotICApDQotew0KLSAgRUZJX1NUQVRVUyAgICAgICAgICAg ICAgICBTdGF0dXM7DQotICBFRklfU1RBVFVTICAgICAgICAgICAgICAgIFN0YXR1c0xvZ287DQot ICBFRklfSEFORExFICAgICAgICAgICAgICAgIEhhbmRsZTsNCi0gIEVGSV9IQU5ETEUgICAgICAg ICAgICAgICAgSW1hZ2VIYW5kbGU7DQotICBFRklfREVWSUNFX1BBVEhfUFJPVE9DT0wgICpGaWxl UGF0aDsNCi0gIEVGSV9MT0FERURfSU1BR0VfUFJPVE9DT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oT3B0aW9uLT5EZXNjcmlwdGlvbiA9PSBOVUxMKSB7DQotICAgICAgREVCVUcgKChERUJV R19JTkZPIHwgREVCVUdfTE9BRCwgIkJvb3RpbmcgZnJvbSB1bmtub3duIGRldmljZSBwYXRoXG4i KSk7DQotICAgIH0gZWxzZSB7DQotICAgICAgREVCVUcgKChERUJVR19JTkZPIHwgREVCVUdfTE9B RCwgIkJvb3RpbmcgJVNcbiIsIE9wdGlvbi0+RGVzY3JpcHRpb24pKTsNCi0gICAgfQ0KLSAgICAg ICAgDQotICAgIERFQlVHX0NPREVfRU5EKCk7DQotICANCi0gICAgLy8NCi0gICAgLy8gUmVwb3J0 IHN0YXR1cyBjb2RlIGZvciBPUyBMb2FkZXIgTG9hZEltYWdlLg0KLSAgICAvLw0KLSAgICBSRVBP UlRfU1RBVFVTX0NPREUgKEVGSV9QUk9HUkVTU19DT0RFLCBQY2RHZXQzMiAoUGNkUHJvZ3Jlc3ND b2RlT3NMb2FkZXJMb2FkKSk7DQotICAgIFN0YXR1cyA9IGdCUy0+TG9hZEltYWdlICgNCi0gICAg ICAgICAgICAgICAgICAgIFRSVUUsDQotICAgICAgICAgICAgICAgICAgICBnSW1hZ2VIYW5kbGUs DQotICAgICAgICAgICAgICAgICAgICBEZXZpY2VQYXRoLA0KLSAgICAgICAgICAgICAgICAgICAg TlVMTCwNCi0gICAgICAgICAgICAgICAgICAgIDAsDQotICAgICAgICAgICAgICAgICAgICAmSW1h Z2VIYW5kbGUNCi0gICAgICAgICAgICAgICAgICAgICk7DQotDQotICAgIC8vDQotICAgIC8vIElm IHdlIGRpZG4ndCBmaW5kIGFuIGltYWdlIGRpcmVjdGx5LCB3ZSBuZWVkIHRvIHRyeSBhcyBpZiBp dCBpcyBhIHJlbW92YWJsZSBkZXZpY2UgYm9vdCBvcHRpb24NCi0gICAgLy8gYW5kIGxvYWQgdGhl IGltYWdlIGFjY29yZGluZyB0byB0aGUgZGVmYXVsdCBib290IGJlaGF2aW9yIGZvciByZW1vdmFi bGUgZGV2aWNlLg0KLSAgICAvLw0KLSAgICBpZiAoRUZJX0VSUk9SIChTdGF0dXMpKSB7DQotICAg ICAgLy8NCi0gICAgICAvLyBjaGVjayBpZiB0aGVyZSBpcyBhIGJvb3RhYmxlIHJlbW92YWJsZSBt ZWRpYSBjb3VsZCBiZSBmb3VuZCBpbiB0aGlzIGRldmljZSBwYXRoICwNCi0gICAgICAvLyBhbmQg Z2V0IHRoZSBib290YWJsZSBtZWRpYSBoYW5kbGUNCi0gICAgICAvLw0KLSAgICAgIEhhbmRsZSA9 IEJkc0xpYkdldEJvb3RhYmxlSGFuZGxlKERldmljZVBhdGgpOw0KLSAgICAgIGlmIChIYW5kbGUg IT0gTlVMTCkgew0KLSAgICAgICAgLy8NCi0gICAgICAgIC8vIExvYWQgdGhlIGRlZmF1bHQgYm9v dCBmaWxlIFxFRklcQk9PVFxib290e21hY2hpbmVuYW1lfS5FRkkgZnJvbSByZW1vdmFibGUgTWVk aWENCi0gICAgICAgIC8vICBtYWNoaW5lbmFtZSBpcyBpYTMyLCBpYTY0LCB4NjQsIC4uLg0KLSAg ICAgICAgLy8NCi0gICAgICAgIEZpbGVQYXRoID0gRmlsZURldmljZVBhdGggKEhhbmRsZSwgRUZJ X1JFTU9WQUJMRV9NRURJQV9GSUxFX05BTUUpOw0KLSAgICAgICAgaWYgKEZpbGVQYXRoICE9IE5V TEwpIHsNCi0gICAgICAgICAgUkVQT1JUX1NUQVRVU19DT0RFIChFRklfUFJPR1JFU1NfQ09ERSwg UGNkR2V0MzIgKFBjZFByb2dyZXNzQ29kZU9zTG9hZGVyTG9hZCkpOw0KLSAgICAgICAgICBTdGF0 dXMgPSBnQlMtPkxvYWRJbWFnZSAoDQotICAgICAgICAgICAgICAgICAgICAgICAgICBUUlVFLA0K LSAgICAgICAgICAgICAgICAgICAgICAgICAgZ0ltYWdlSGFuZGxlLA0KLSAgICAgICAgICAgICAg ICAgICAgICAgICAgRmlsZVBhdGgsDQotICAgICAgICAg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0aCA9IEFwcGVuZERldmljZVBhdGhJbnN0YW5j ZSAoSW5zdGFuY2UsIENhY2hlZERldmljZVBhdGggKTsNCi0gICAgICAgIEZyZWVQb29sIChUZW1w TmV3RGV2aWNlUGF0aCk7DQotICAgICAgICAvLw0KLSAgICAgICAgLy8gU2F2ZSB0aGUgbWF0Y2hp bmcgRGV2aWNlIFBhdGggc28gd2UgZG9uJ3QgbmVlZCB0byBkbyBhIGNvbm5lY3QgYWxsIG5leHQg dGltZQ0KLSAgICAgICAgLy8gRmFpbHVyZSB0byBzZXQgdGhlIHZhcmlhYmxlIG9ubHkgaW1wYWN0 cyB0aGUgcGVyZm9ybWFuY2Ugd2hlbiBuZXh0IHRpbWUgZXhwYW5kaW5nIHRoZSBzaG9ydC1mb3Jt IGRldmljZSBwYXRoLg0KLSAgICAgICAgLy8NCi0gICAgICAgIFN0YXR1cyA9IGdSVC0+U2V0VmFy aWFibGUgKA0KLSAgICAgICAgICAgICAgICAgICAgICAgIEhEX0JPT1RfREVWSUNFX1BBVEhfVkFS SUFCTEVfTkFNRSwNCi0gICAgICAgICAgICAgICAgICAgICAgICAmZ0hkQm9vdERldmljZVBhdGhW YXJpYWJsR3VpZCwNCi0gICAgICAgICAgICAgICAgICAgICAgICBFRklfVkFSSUFCTEVfQk9PVFNF UlZJQ0VfQUNDRVNTIHwgRUZJX1ZBUklBQkxFX05PTl9WT0xBVElMRSwNCi0gICAgICAgICAgICAg ICAgICAgICAgICBHZXREZXZpY2VQYXRoU2l6ZSAoQ2FjaGVkRGV2aWNlUGF0aCksDQotICAgICAg ICAgICAgICAgICAgICAgICAgQ2FjaGVkRGV2aWNlUGF0aA0KLSAgICAgICAgICAgICAgICAgICAg ICAgICk7DQotICAgICAgfQ0KLQ0KLSAgICAgIEZyZWVQb29sIChJbnN0YW5jZSk7DQotICAgICAg RnJlZVBvb2wgKENhY2hlZERldmljZVBhdGgpOw0KLSAgICAgIHJldHVybiBGdWxsRGV2aWNlUGF0 aDsNCi0gICA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yeSwgDQotICAgICAg ICAvLyB0aGUgSERfQk9PVF9ERVZJQ0VfUEFUSF9WQVJJQUJMRV9OQU1FIHZhcmlhYmxlIG1heWJl IGJlY29tZSBsYXJnZXIgYW5kIGxhcmdlci4NCi0gICAgICAgIC8vDQotICAgICAgICBJbnN0YW5j ZU51bSA9IDA7DQotICAgICAgICBBU1NFUlQgKENhY2hlZERldmljZVBhdGggIT0gTlVMTCk7DQot ICAgICAgICBUZW1wTmV3RGV2aWNlUGF0aCA9IENhY2hlZERldmljZVBhdGg7DQotICAgICAgICB3 aGlsZSAoIUlzRGV2aWNlUGF0aEVuZCAoVGVtcE5ld0RldmljZVBhdGgpKSB7DQotICAgICAgICAg IFRlbXBOZXdEZXZpY2VQYXRoID0gTmV4dERldmljZVBhdGhOb2RlIChUZW1wTmV3RGV2aWNlUGF0 aCk7DQotICAgICAgICAgIC8vDQotICAgICAgICAgIC8vIFBhcnNlIG9uZSBpbnN0YW5jZQ0KLSAg ICAgICAgICAvLw0KLSAgICAgICAgICB3aGlsZSAoIUlzRGV2aWNlUGF0aEVuZFR5cGUgKFRlbXBO ZXdEZXZpY2VQYXRoKSkgew0KLSAgICAgICAgICAgIFRlbXBOZXdEZXZpY2VQYXRoID0gTmV4dERl dmljZVBhdGhOb2RlIChUZW1wTmV3RGV2aWNlUGF0aCk7DQotICAgICAgICAgIH0NCi0gICAgICAg ICAgSW5zdGFuY2VOdW0rKzsNCi0gICAgICAgICAgLy8NCi0gICAgICAgICAgLy8gSWYgdGhlIENh Y2hlZERldmljZVBhdGggdmFyaWFibGUgY29udGFpbiB0b28gbXVjaCBpbnN0YW5jZSwgb25seSBy ZW1haW4gMTIgaW5zdGFuY2VzLg0KLSAgICAgICAgICAvLw0KLSAgICAgICAgICBpZiAoSW5zdGFu Y2VOdW0gPj0gMTIpIHsNCi0gICAgICAgICAgICBTZXREZXZpY2VQYXRoRW5kTm9kZSAoVGVtcE5l d0RldmljZVBhdGgpOw0KLSAgICAgICAgICAgIGJyZWFrOw0KLSAgICAgICAgICB9DQotICAgICAg ICB9DQotICAgICAgfSBlbHNlIHsNCi0gICAgICAgIENhY2hlZERldmljZVBhdGggPSBEdXBsaWNh dGVEZXZpY2VQYXRoIChCbG9ja0lvRGV2aWNlUGF0aCk7DQotICAgICAgfQ0KLQ0KLSAgICAgIC8v DQotICAgICAgLy8gU2F2ZSB0aGUgbWF0Y2hpbmcgRGV2aWNlIFBhdGggc28gd2UgZG9uJ3QgbmVl ZCB0byBkbyBhIGNvbm5lY3QgYWxsIG5leHQgdGltZQ0KLSAgICAgIC8vIEZhaWx1cmUgdG8gc2V0 IHRoZSB2YXJpYWJsZSBvbmx5IGltcGFjdHMgdGhlIHBlcmZvcm1hbmNlIHdoZW4gbmV4dCB0aW1l IGV4cGFuZGluZyB0aGUgc2hvcnQtZm9ybSBkZXZpY2UgcGF0aC4NCi0gICAgICAvLw0KLSAgICAg IFN0YXR1cyA9IGdSVC0+U2V0VmFyaWFibGUgKA0KLSAgICAgICAgICAgICAgICAgICAgICBIRF9C T09UX0RFVklDRV9QQVRIX1ZBUklBQkxFX05BTUUsDQotICAgICAgICAgICAgICAgICAgICAgICZn SGRCb290RGV2aWNlUGF0aFZhcmlhYmxHdWlkLA0KLSAgICAgICAgICAgICAgICAgICAgICBFRklf VkFSSUFCTEVfQk9PVFNFUlZJQ0VfQUNDRVNTIHwgRUZJX1ZBUklBQkxFX05PTl9WT0xBVElMRSwN Ci0gICAgICAgICAgICAgICAgICAgICAgR2V0RGV2aWNlUGF0aFNpemUgKENhY2hlZERldmljZVBh dGgpLA0KLSAgICAgICAgICAgICAgICAgICAgICBDYWNoZWREZXZpY2VQYXRoDQotICAgICAgICAg ICAgICAgICAgICAgICk7DQotDQotICAgICAgYnJlYWs7DQotICAgIH0NCi0gIH0NCi0NCi0gIGlm IChDYWNoZWREZXZpY2VQYXRoICE9IE5VTEwpIHsNCi0gICAgRnJlZVBvb2wgKENhY2hlZERldmlj ZVBhdGgpOw0KLSAgfQ0K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I7DQotICBVSU5UTiAgICAgICAg ICAgICAgICAgICAgIEJvb3RPcmRlclNpemU7DQotICBVSU5UTiAgICAgICAgICAgICAgICAgICAg IEJvb3RPcHRpb25TaXplOw0KLSAgRUZJX1NUQVRVUyAgICAgICAgICAgICAgICBTdGF0dXM7DQot ICBVSU5UTiAgICAgICAgICAgICAgICAgICAgIEluZGV4Ow0KLSAgVUlOVDE2ICAgICAgICAgICAg ICAgICAgICBCb290T3B0aW9uW0JPT1RfT1BUSU9OX01BWF9DSEFSXTsNCi0gIFVJTlROICAgICAg ICAgICAgICAgICAgICAgRGV2aWNlUGF0aFNpemU7DQotICBVSU5UTiAgICAgICAgICAgICAgICAg ICAgIE9wdGlvbkRldmljZVBhdGhTaXplOw0KLSAgRUZJX0RFVklDRV9QQVRIX1BST1RPQ09MICAq RGV2aWNlUGF0aDsNCi0gIEVGSV9ERVZJQ0VfUEFUSF9QUk9UT0NPTCAgKk9wdGlvbkRldmljZVBh dGg7DQotICBVSU5UOCAgICAgICAgICAgICAgICAgICAgICpUZW1wUHRyOw0KLQ0KLSAgU3RhdHVz ICAgICAgICA9IEVGSV9TVUNDRVNTOw0KLSAgQm9vdE9yZGVyICAgICA9IE5VTEw7DQotICBCb290 T3JkZXJTaXplID0gMDsNCi0NCi0gIC8vDQotICAvLyBDaGVjayAiQm9vdE9yZGVyIiB2YXJpYWJs ZSwgaWYgbm8sIG1lYW5zIHRoZXJlIGlzIG5vIGFueSBib290IG9yZGVyLg0KLSAgLy8NCi0gIEJv b3RPcmRlciA9IEJkc0xpYkdldFZhcmlhYmxlQW5kU2l6ZSAoDQotICAgICAgICAgICAgICAgIEwi Qm9vdE9yZGVyIiwNCi0gICAgICAgICAgICAgICAgJmdFZmlHbG9iYWxWYXJpYWJsZUd1aWQsDQot ICAgICAgICAgICAgICAgICZCb290T3JkZXJTaXplDQotICAgICAgICAgICAgICAgICk7DQotICBp ZiAoQm9vdE9yZGVyID09IE5VTEwpIHsNCi0gICAgcmV0dXJuIEVGSV9OT1RfRk9VTkQ7DQotICB9 DQotDQotICAvLw0KLSAgLy8gQ29udmVydCBkZXZpY2UgaGFuZGxlIHRvIGRldmljZSBwYXRoIHBy b3RvY29sIGluc3RhbmNlDQotICAvLw0KLSAgRGV2aWNlUGF0aCA9IERldmljZVBhdGhGcm9tSGFu ZGxlIChIYW5kbGUpOw0KLSAgaWYgKERldmljZVBhdGggPT0gTlVMTCkgew0KLSAgICByZXR1cm4g RUZJX05PVF9GT1VORDsNCi0gIH0NCi0gIERldmljZVBhdGhTaXplID0gR2V0RGV2aWNlUGF0aFNp emUgKERldmljZVBhdGgpOw0KLQ0KLSAgLy8NCi0gIC8vIExvb3AgYWxsIGJvb3Qgb3JkZXIgdmFy aWFibGUgYW5kIGZpbmQgdGhlIG1hdGNoaW5nIGRldmljZSBwYXRoDQotICAvLw0KLSAgSW5kZXgg PSAwOw0KLSAgd2hpbGUgKEluZGV4IDwgQm9vdE9yZGVyU2l6ZSAvIHNpemVvZiAoVUlOVDE2KSkg ew0KLSAgICBVbmljb2RlU1ByaW50IChCb290T3B0aW9uLCBzaXplb2YgKEJvb3RPcHRpb24pLCBM IkJvb3QlMDR4IiwgQm9vdE9yZGVyW0luZGV4XSk7DQotICAgIEJvb3RPcHRpb25WYXIgPSBCZHNM aWJHZXRWYXJpYWJsZUFuZFNpemUgKA0KLSAgICAgICAgICAgICAgICAgICAgICBCb290T3B0aW9u LA0KLSAgICAgICAgICAgICAgICAgICAgICAmZ0VmaUdsb2JhbFZhcmlhYmxlR3VpZCwNCi0gICAg ICAgICAgICAgICAgICAgICAgJkJvb3RPcHRpb25TaXplDQotICAgICAgICAgICAgICAgICAgICAg ICk7DQotDQotICAgIGlmIChCb290T3B0aW9uVmFyID09IE5VTEwpIHsNCi0gICAgICBGcmVlUG9v bCAoQm9vdE9yZGVyKTsNCi0gICAgICByZXR1cm4gRUZJX09VVF9PRl9SRVNPVVJDRVM7DQotICAg IH0NCi0NCi0gICAgaWYgKCFWYWxpZGF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NrIG9mIG1lbW9yeSByZXNvdXJjZQ0KLSAgQHJldHZhbCBPdGhl ciAgICAgICAgICAgICAgICAgIEVycm9yIHJldHVybiB2YWx1ZSBmcm9tIFNldFZhcmlhYmxlKCkN Ci0NCi0qKi8NCi1FRklfU1RBVFVTDQotQmRzRGVsZXRlQWxsSW52YWxpZEVmaUJvb3RPcHRpb24g KA0KLSAgVk9JRA0KLSAgKQ0KLXsNCi0gIFVJTlQxNiAgICAgICAgICAgICAgICAgICAgKkJvb3RP cmRlcjsNCi0gIFVJTlQ4ICAgICAgICAgICAgICAgICAgICAgKkJvb3RPcHRpb25WYXI7DQotICBV SU5UTiAgICAgICAgICAgICAgICAgICAgIEJvb3RPcmRlclNpemU7DQotICBVSU5UTiAgICAgICAg ICAgICAgICAgICAgIEJvb3RPcHRpb25TaXplOw0KLSAgRUZJX1NUQVRVUyAgICAgICAgICAgICAg ICBTdGF0dXM7DQotICBVSU5UTiAgICAgICAgICAgICAgICAgICAgIEluZGV4Ow0KLSAgVUlOVE4g ICAgICAgICAgICAgICAgICAgICBJbmRleDI7DQotICBVSU5UMTYgICAgICAgICAgICAgICAgICAg IEJvb3RPcHRpb25bQk9PVF9PUFRJT05fTUFYX0NIQVJdOw0KLSAgRUZJX0RFVklDRV9QQVRIX1BS T1RPQ09MICAqT3B0aW9uRGV2aWNlUGF0aDsNCi0gIFVJTlQ4ICAgICAgICAgICAgICAgICAgICAg KlRlbXBQdHI7DQotICBDSEFSMTYgICAgICAgICAgICAgICAgICAgICpEZXNjcmlwdGlvbjsNCi0g IEJPT0xFQU4gICAgICAgICAgICAgICAgICAgQ29ycnVwdGVkOw0KLQ0KLSAgU3RhdHVzICAgICAg ICAgICA9IEVGSV9TVUNDRVNTOw0KLSAgQm9vdE9yZGVyICAgICAgICA9IE5VTEw7DQotICBEZXNj cmlwdGlvbiAgICAgID0gTlVMTDsNCi0gIE9wdGlvbkRldmljZVBhdGggPSBOVUxMOw0KLSAgQm9v dE9yZGVyU2l6ZSAgICA9IDA7DQotICBDb3JydXB0ZWQgICAgICAgID0gRkFMU0U7DQotDQotICAv Lw0KLSAgLy8gQ2hlY2sgIkJvb3RPcmRlciIgdmFyaWFibGUgZmlyc3RseSwgdGhpcyB2YXJpYWJs ZSBob2xkIHRoZSBudW1iZXIgb2YgYm9vdCBvcHRpb25zDQotICAvLw0KLSAgQm9vdE9yZGVyID0g QmRzTGliR2V0VmFyaWFibGVBbmRTaXplICgNCi0gICAgICAgICAgICAgICAgTCJCb290T3JkZXIi LA0KLSAgICAgICAgICAgICAgICAmZ0VmaUdsb2JhbFZhcmlhYmxlR3VpZCwNCi0gICAgICAgICAg ICAgICAgJkJvb3RPcmRlclNpemUNCi0gICAgICAgICAgICAgICAgKTsNCi0gIGlmIChOVUxMID09 IEJvb3RPcmRlcikgew0KLSAgICByZXR1cm4gRUZJX05PVF9GT1VORDsNCi0gIH0NCi0NCi0gIElu ZGV4ID0gMDsNCi0gIHdoaWxlIChJbmRleCA8IEJvb3RPcmRlclNpemUgLyBzaXplb2YgKFVJTlQx NikpIHsNCi0gICAgVW5pY29kZVNQcmludCAoQm9vdE9wdGlvbiwgc2l6ZW9mIChCb290T3B0aW9u KSwgTCJCb290JTA0eCIsIEJvb3RPcmRlcltJbmRleF0pOw0KLSAgICBCb290T3B0aW9uVmFyID0g QmRzTGliR2V0VmFyaWFibGVBbmRTaXplICgNCi0gICAgICAgICAgICAgICAgICAgICAgQm9vdE9w dGlvbiwNCi0gICAgICAgICAgICAgICAgICAgICAgJmdFZmlHbG9iYWxWYXJpYWJsZUd1aWQsDQot ICAgICAgICAgICAgICAgICAgICAgICZCb290T3B0aW9uU2l6ZQ0KLSAgICAgICAgICAgICAgICAg ICAgICApOw0KLSAgICBpZiAoTlVMTCA9PSBCb290T3B0aW9uVmFyKSB7DQotICAgICAgRnJlZVBv b2wgKEJvb3RPcmRlcik7DQotICAgICAgcmV0dXJuIEVGSV9PVVRfT0ZfUkVTT1VSQ0VTOw0KLSAg ICB9DQotDQotICAgIGlmICghVmFsaWRhdGVPcHRpb24oQm9vdE9wdGlvblZhciwgQm9vdE9wdGlv blNpemUpKSB7DQotICAgICAgQ29ycnVwdGVkID0gVFJVRTsNCi0gICAgfSBlbHNlIHsNCi0gICAg ICBUZW1wUHRyID0gQm9vdE9wdGlvblZhcjsNCi0gICAgICBUZW1wUHRyICs9IHNpemVvZiAoVUlO VDMyKSArIHNpemVvZiAoVUlOVDE2KTsNCi0gICAgICBEZXNjcmlwdGlvbiA9IChDSEFSMTYgKikg VGVtcFB0cjsNCi0gICAgICBUZW1wUHRyICs9IFN0clNpemUgKChDSEFSMTYgKikgVGVtcFB0cik7 DQotICAgICAgT3B0aW9uRGV2aWNlUGF0aCA9IChFRklfREVWSUNFX1BBVEhfUFJPVE9DT0wgKikg VGVtcFB0cjsNCi0NCi0gICAgICAvLw0KLSAgICAgIC8vIFNraXAgbGVnYWN5IGJvb3Qgb3B0aW9u IChCQlMgYm9vdCBkZXZpY2UpDQotICAgICAgLy8NCi0gICAgICBpZiAoKERldmljZVBhdGhUeXBl IChPcHRpb25EZXZpY2VQYXRoKSA9PSBCQlNfREVWSUNFX1BBVEgpICYmDQotICAgICAgICAgIChE ZXZpY2VQYXRoU3ViVHlwZSAoT3B0aW9uRGV2aWNlUGF0aCkgPT0gQkJTX0JCU19EUCkpIHsNCi0g ICAgICAgIEZyZWVQb29sIChCb290T3B0aW9uVmFyKTsNCi0gICAgICAgIEluZGV4Kys7DQotICAg ICAgICBjb250aW51ZTsNCi0gICAgICB9DQotICAgIH0NCi0NCi0gICAgaWYgKENvcnJ1cHRlZCB8 fCAhQmRzTGliSXNWYWxpZEVGSUJvb3RPcHREZXZpY2VQYXRoRXh0IChPcHRpb25EZXZpY2VQYXRo LCBGQUxTRSwgRGVzY3JpcHRpb24pKSB7DQotICAgICAgLy8NCi0gICAgICAvLyBEZWxldGUgdGhp cyBpbnZhbGlkIGJvb3Qgb3B0aW9uICJCb290IyMjIyINCi0gICAgICAvLw0KLSAgICAgIFN0YXR1 cyA9IGdSVC0+U2V0VmFyaWFibGUgKA0KLSAgICAgICAgICAgICAgICAgICAgICBCb290T3B0aW9u LA0KLSAgICAgICAgICAgICAgICAgICAgICAmZ0VmaUdsb2JhbFZhcmlhYmxlR3VpZCwNCi0gICAg ICAgICAgICAgICAgICAgICAgRUZJX1ZBUklBQkxFX0JPT1RTRVJWSUNFX0FDQ0VTUyB8IEVGSV9W QVJJQUJMRV9SVU5USU1FX0FDQ0VTUyB8IEVGSV9WQVJJQUJMRV9OT05fVk9MQVRJTEUsDQotICAg ICAgICAgICAgICAgICAgICAgIDAsDQotICAgICAgICAgICAgICAgICAgICAgIE5VTEwNCi0gICAg ICAgICAgICAgICAgICAgICAgKTsNCi0gICAgICAvLw0KLSAgICAgIC8vIERlbGV0aW5nIHZhcmlh YmxlIHdpdGggY3VycmVudCB2YXJpYWJsZSBpbXBsZW1lbnRhdGlvbiBzaG91bGRuJ3QgZmFpbC4N Ci0gICAgICAvLw0KLSAgICAgIEFTU0VSVF9FRklfRVJST1IgKFN0YXR1cyk7DQotICAgICAgLy8N Ci0gICAgICAvLyBNYXJrIHRoaXMgYm9vdCBvcHRpb24gaW4gYm9vdCBvcmRlciBhcyBkZWxldGVk DQotICAgICAgLy8NCi0gICAgICBCb290T3JkZXJbSW5kZXhdID0gMHhmZmZmOw0KLSAgICAgIENv cnJ1cHRlZCAgICAgICAgPSBGQUxTRTsNCi0gICAgfQ0KLQ0KLSAgICBGcmVlUG9vbCAoQm9vdE9w dGlvblZhcik7DQotICAgIEluZGV4Kys7DQotICB9DQotDQotICAvLw0KLSAgLy8gQWRqdXN0IGJv b3Qgb3JkZXIgYXJyYXkNCi0gIC8vDQotICBJbmRleDIgPSAwOw0KLSAgZm9yIChJbmRleCA9IDA7 IEluZGV4IDwgQm9vdE9yZGVyU2l6ZSAvIHNpemVvZiAoVUlOVDE2KTsgSW5kZXgrKykgew0KLSAg ICBpZiAoQm9vdE9yZGVyW0luZGV4XSAhPSAweG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UuDQot ICAyLiBTaGVsbCAgIC0gVGhlIGJvb3Qgb3B0aW9uIHBvaW50cyB0byBpbnRlcm5hbCBmbGFzaCBz aGVsbC4NCi0gICAgICAgICAgICAgICBCZHMgd2lsbCB0cnkgdG8gYXV0b21hdGljYWxseSBjcmVh dGUgdGhpcyB0eXBlIGJvb3Qgb3B0aW9uIHdoZW4gZW51bWVyYXRlLg0KLSAgMy4gUmVtb3ZhYmxl IEJsb2NrSW8gICAgICAtIFRoZSBib290IG9wdGlvbiBvbmx5IHBvaW50cyB0byB0aGUgcmVtb3Zh YmxlIG1lZGlhDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGV2aWNlLCBsaWtlIFVT QiBmbGFzaCBkaXNrLCBEVkQsIEZsb3BweSBldGMuDQotICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgVGhlc2UgZGV2aWNlIHNob3VsZCBjb250YWluIGEgKnJlbW92YWJsZSogYmxvY2tJbw0K LSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3RvY29sIGluIHRoZWlyIGRldmljZSBo YW5kbGUuDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmRzIHdpbGwgdHJ5IHRvIGF1 dG9tYXRpY2FsbHkgY3JlYXRlIHRoaXMgdHlwZSBib290IG9wdGlvbg0KLSAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHdoZW4gZW51bWVyYXRlLg0KLSAgNC4gRml4ZWQgQmxvY2tJbyAgICAg ICAgICAtIFRoZSBib290IG9wdGlvbiBvbmx5IHBvaW50cyB0byBhIEZpeGVkIGJsb2NrSW8gZGV2 aWNlLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpa2UgSGFyZERpc2suDQotICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgVGhlc2UgZGV2aWNlIHNob3VsZCBjb250YWluIGEg KmZpeGVkKiBibG9ja0lvDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvdG9jb2wg aW4gdGhlaXIgZGV2aWNlIGhhbmRsZS4NCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBC RFMgd2lsbCBza2lwIGZpeGVkIGJsb2NrSW8gZGV2aWNlcywgYW5kIE5PVA0KLSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGF1dG9tYXRpY2FsbHkgY3JlYXRlIGJvb3Qgb3B0aW9uIGZvciB0 aGVtLiBCdXQgQkRTDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lsbCBoZWxwIHRv IGRlbGV0ZSB0aG9zZSBmaXhlZCBibG9ja0lvIGJvb3Qgb3B0aW9uLA0KLSAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHdob3NlIGRlc2NyaXB0aW9uIHJ1bGUgY29uZmxpY3Qgd2l0aCBvdGhl ciBhdXRvLWNyZWF0ZWQNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib290IG9wdGlv bnMuDQotICA1LiBOb24tQmxvY2tJbyBTaW1wbGVmaWxlIC0gVGhlIGJvb3Qgb3B0aW9uIHBvaW50 cyB0byBhIGRldmljZSB3aG9zZSBoYW5kbGUNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBoYXMgU2ltcGxlRmlsZVN5c3RlbSBQcm90b2NvbCwgYnV0IGhhcyBubyBibG9ja2lvDQotICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvdG9jb2wuIFRoZXNlIGRldmljZXMgZG8gbm90 IG9mZmVyIGJsb2NrSW8NCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm90b2NvbCwg YnV0IEJEUyBzdGlsbCBjYW4gZ2V0IHRoZQ0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IFxFRklcQk9PVFxib290e21hY2hpbmVuYW1lfS5FRkkgYnkgU2ltcGxlRmlsZVN5c3RlbQ0KLSAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIFByb3RvY29sLg0KLSAgNi4gRmlsZSAgICA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YXRlIHRoZSBib290IG9wdGlvbiBsaXN0DQotKiovDQotRUZJX1NUQVRV Uw0KLUVGSUFQSQ0KLUJkc0xpYkVudW1lcmF0ZUFsbEJvb3RPcHRpb24gKA0KLSAgSU4gT1VUIExJ U1RfRU5UUlkgICAgICAgICAgKkJkc0Jvb3RPcHRpb25MaXN0DQotICApDQotew0KLSAgRUZJX1NU QVRVUyAgICAgICAgICAgICAgICAgICAgU3RhdHVzOw0KLSAgVUlOVDE2ICAgICAgICAgICAgICAg ICAgICAgICAgRmxvcHB5TnVtYmVyOw0KLSAgVUlOVDE2ICAgICAgICAgICAgICAgICAgICAgICAg SGFyZGRyaXZlTnVtYmVyOw0KLSAgVUlOVDE2ICAgICAgICAgICAgICAgICAgICAgICAgQ2Ryb21O dW1iZXI7DQotICBVSU5UMTYgICAgICAgICAgICAgICAgICAgICAgICBVc2JOdW1iZXI7DQotICBV SU5UMTYgICAgICAgICAgICAgICAgICAgICAgICBNaXNjTnVtYmVyOw0KLSAgVUlOVDE2ICAgICAg ICAgICAgICAgICAgICAgICAgU2NzaU51bWJlcjsNCi0gIFVJTlQxNiAgICAgICAgICAgICAgICAg ICAgICAgIE5vbkJsb2NrTnVtYmVyOw0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgICAg TnVtYmVyQmxvY2tJb0hhbmRsZXM7DQotICBFRklfSEFORExFICAgICAgICAgICAgICAgICAgICAq QmxvY2tJb0hhbmRsZXM7DQotICBFRklfQkxPQ0tfSU9fUFJPVE9DT0wgICAgICAgICAqQmxrSW87 DQotICBCT09MRUFOICAgICAgICAgICAgICAgICAgICAgICBSZW1vdmFibGVbMl07DQotICBVSU5U TiAgICAgICAgICAgICAgICAgICAgICAgICBSZW1vdmFibGVJbmRleDsNCi0gIFVJTlROICAgICAg ICAgICAgICAgICAgICAgICAgIEluZGV4Ow0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAg ICAgTnVtT2ZMb2FkRmlsZUhhbmRsZXM7DQotICBFRklfSEFORExFICAgICAgICAgICAgICAgICAg ICAqTG9hZEZpbGVIYW5kbGVzOw0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgICAgRnZI YW5kbGVDb3VudDsNCi0gIEVGSV9IQU5ETEUgICAgICAgICAgICAgICAgICAgICpGdkhhbmRsZUJ1 ZmZlcjsNCi0gIEVGSV9GVl9GSUxFVFlQRSAgICAgICAgICAgICAgIFR5cGU7DQotICBVSU5UTiAg ICAgICAgICAgICAgICAgICAgICAgICBTaXplOw0KLSAgRUZJX0ZWX0ZJTEVfQVRUUklCVVRFUyAg ICAgICAgQXR0cmlidXRlczsNCi0gIFVJTlQzMiAgICAgICAgICAgICAgICAgICAgICAgIEF1dGhl bnRpY2F0aW9uU3RhdHVzOw0KLSAgRUZJX0ZJUk1XQVJFX1ZPTFVNRTJfUFJPVE9DT0wgKkZ2Ow0K LSAgRUZJX0RFVklDRV9QQVRIX1BST1RPQ09MICAgICAgKkRldmljZVBhdGg7DQotICBVSU5UTiAg ICAgICAgICAgICAgICAgICAgICAgICBEZXZpY2VQYXRoVHlwZTsNCi0gIENIQVIxNiAgICAgICAg ICAgICAgICAgICAgICAgIEJ1ZmZlcls0MF07DQotICBFRklfSEFORExFICAgICAgICAgICAgICAg ICAgICAqRmlsZVN5c3RlbUhhbmRsZXM7DQotICBVSU5UTiAgICAgICAgICAgICAgICAgICAgICAg ICBOdW1iZXJGaWxlU3lzdGVtSGFuZGxlczsNCi0gIEJPT0xFQU4gICAgICAgICAgICAgICAgICAg ICAgIE5lZWREZWxldGU7DQotICBFRklfSU1BR0VfRE9TX0hFQURFUiAgICAgICAgICBEb3NIZWFk ZXI7DQotICBDSEFSOCAgICAgICAgICAgICAgICAgICAgICAgICAqUGxhdExhbmc7DQotICBDSEFS OCAgICAgICAgICAgICAgICAgICAgICAgICAqTGFzdExhbmc7DQotICBFRklfSU1BR0VfT1BUSU9O QUxfSEVBREVSX1VOSU9OICAgICAgIEhkckRhdGE7DQotICBFRklfSU1BR0VfT1BUSU9OQUxfSEVB REVSX1BUUl9VTklPTiAgIEhkcjsNCi0gIENIQVIxNiAgICAgICAgICAgICAgICAgICAgICAgICpN YWNTdHI7DQotICBDSEFSMTYgICAgICAgICAgICAgICAgICAgICAgICAqSVB2ZXJTdHI7DQotICBF RklfSEFORExFICAgICAgICAgICAgICAgICAgICAqTmV0d29ya0hhbmRsZXM7DQotICBVSU5UTiAg ICAgICAgICAgICAgICAgICAgICAgICBCdWZmZXJTaXplOw0KLQ0KLSAgRmxvcHB5TnVtYmVyICAg ID0gMDsNCi0gIEhhcmRkcml2ZU51bWJlciA9IDA7DQotICBDZHJvbU51bWJlciAgICAgPSAwOw0K LSAgVXNiTnVtYmVyICAgICAgID0gMDsNCi0gIE1pc2NOdW1iZXIgICAgICA9IDA7DQotICBTY3Np TnVtYmVyICAgICAgPSAwOw0KLSAgUGxhdExhbmcgICAgICAgID0gTlVMTDsNCi0gIExhc3RMYW5n ICAgICAgICA9IE5VTEw7DQotICBaZXJvTWVtIChCdWZmZXIsIHNpemVvZiAoQnVmZmVyKSk7DQot DQotICAvLw0KLSAgLy8gSWYgdGhlIGJvb3QgZGV2aWNlIGVudW1lcmF0ZSBoYXBwZW5lZCwganVz dCBnZXQgdGhlIGJvb3QNCi0gIC8vIGRldmljZSBmcm9tIHRoZSBib290IG9yZGVyIHZhcmlhYmxl DQotICAvLw0KLSAgaWYgKG1FbnVtQm9vdERldmljZSkgew0KLSAgICBHZXRWYXJpYWJsZTIgKExB U1RfRU5VTV9MQU5HVUFHRV9WQVJJQUJMRV9OQU1FLCAmZ0xhc3RFbnVtTGFuZ0d1aWQsIChWT0lE KiopJkxhc3RMYW5nLCBOVUxMKTsNCi0gICAgR2V0RWZpR2xvYmFsVmFyaWFibGUyIChMIlBsYXRm b3JtTGFuZyIsIChWT0lEKiopJlBsYXRMYW5nLCBOVUxMKTsNCi0gICAgQVNTRVJUIChQbGF0TGFu ZyAhPSBOVUxMKTsNCi0gICAgaWYgKChMYXN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JsZUluZGV4KyspIHsN Ci0gICAgZm9yIChJbmRleCA9IDA7IEluZGV4IDwgTnVtYmVyQmxvY2tJb0hhbmRsZXM7IEluZGV4 KyspIHsNCi0gICAgICBTdGF0dXMgPSBnQlMtPkhhbmRsZVByb3RvY29sICgNCi0gICAgICAgICAg ICAgICAgICAgICAgQmxvY2tJb0hhbmRsZXNbSW5kZXhdLA0KLSAgICAgICAgICAgICAgICAgICAg ICAmZ0VmaUJsb2NrSW9Qcm90b2NvbEd1aWQsDQotICAgICAgICAgICAgICAgICAgICAgIChWT0lE ICoqKSAmQmxrSW8NCi0gICAgICAgICAgICAgICAgICAgICAgKTsNCi0gICAgICAvLw0KLSAgICAg IC8vIHNraXAgdGhlIGxvZ2ljYWwgcGFydGl0aW9uDQotICAgICAgLy8NCi0gICAgICBpZiAoRUZJ X0VSUk9SIChTdGF0dXMpIHx8IEJsa0lvLT5NZWRpYS0+TG9naWNhbFBhcnRpdGlvbikgew0KLSAg ICAgICAgY29udGludWU7DQotICAgICAgfQ0KLQ0KLSAgICAgIC8vDQotICAgICAgLy8gZmlyc3Rs eSBmaXhlZCBibG9jayBpbyB0aGVuIHRoZSByZW1vdmFibGUgYmxvY2sgaW8NCi0gICAgICAvLw0K LSAgICAgIGlmIChCbGtJby0+TWVkaWEtPlJlbW92YWJsZU1lZGlhID09IFJlbW92YWJsZVtSZW1v dmFibGVJbmRleF0pIHsNCi0gICAgICAgIGNvbnRpbnVlOw0KLSAgICAgIH0NCi0gICAgICBEZXZp Y2VQYXRoICA9IERldmljZVBhdGhGcm9tSGFuZGxlIChCbG9ja0lvSGFuZGxlc1tJbmRleF0pOw0K LSAgICAgIERldmljZVBhdGhUeXBlID0gQmRzR2V0Qm9vdFR5cGVGcm9tRGV2aWNlUGF0aCAoRGV2 aWNlUGF0aCk7DQotDQotICAgICAgc3dpdGNoIChEZXZpY2VQYXRoVHlwZSkgew0KLSAgICAgIGNh c2UgQkRTX0VGSV9BQ1BJX0ZMT1BQWV9CT09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ICAgICAgICAgICAgTmV0d29ya0hhbmRsZXMNCi0gICAgICAgICAgICAgICAgICApOw0K LQ0KLSAgaWYgKFN0YXR1cyA9PSBFRklfQlVGRkVSX1RPT19TTUFMTCkgew0KLSAgICBOZXR3b3Jr SGFuZGxlcyA9IEFsbG9jYXRlWmVyb1Bvb2woQnVmZmVyU2l6ZSk7DQotICAgIGlmIChOZXR3b3Jr SGFuZGxlcyA9PSBOVUxMKSB7DQotICAgICAgcmV0dXJuIChFRklfT1VUX09GX1JFU09VUkNFUyk7 DQotICAgIH0NCi0gICAgU3RhdHVzID0gZ0JTLT5Mb2NhdGVIYW5kbGUoDQotICAgICAgICAgICAg ICAgICAgICBCeVByb3RvY29sLA0KLSAgICAgICAgICAgICAgICAgICAgJmdFZmlTaW1wbGVOZXR3 b3JrUHJvdG9jb2xHdWlkLA0KLSAgICAgICAgICAgICAgICAgICAgTlVMTCwNCi0gICAgICAgICAg ICAgICAgICAgICZCdWZmZXJTaXplLA0KLSAgICAgICAgICAgICAgICAgICAgTmV0d29ya0hhbmRs ZXMNCi0gICAgICAgICAgICAgICAgICAgICk7DQotIH0NCi0gICAgICAgICAgICAgICANCi0gIC8v DQotICAvL0dldCB0aGUgTUFDIHN0cmluZw0KLSAgLy8NCi0gIFN0YXR1cyA9IE5ldExpYkdldE1h Y1N0cmluZyAoDQotICAgICAgICAgICAgICpOZXR3b3JrSGFuZGxlcywNCi0gICAgICAgICAgICAg TlVMTCwNCi0gICAgICAgICAgICAgJk1hY1N0cg0KLSAgICAgICAgICAgICApOw0KLSAgaWYgKEVG SV9FUlJPUiAoU3RhdHVzKSkgewkNCi0gICAgcmV0dXJuIFN0YXR1czsNCi0gIH0NCi0gIElQdmVy U3RyID0gTCIgSVB2NCI7DQotICBVbmljb2RlU1ByaW50IChCdWZmZXIsIHNpemVvZiAoQnVmZmVy KSwgTCIlcyVzJXMiLCBCZHNMaWJHZXRTdHJpbmdCeUlkIChTVFJJTkdfVE9LRU4gKFNUUl9ERVND U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y0+TG9jYXRlSGFuZGxlQnVmZmVyICgNCi0gICAgICAgIEJ5UHJvdG9jb2wsDQotICAgICAg ICAmZ0VmaUZpcm13YXJlVm9sdW1lMlByb3RvY29sR3VpZCwNCi0gICAgICAgIE5VTEwsDQotICAg ICAgICAmRnZIYW5kbGVDb3VudCwNCi0gICAgICAgICZGdkhhbmRsZUJ1ZmZlcg0KLSAgICAgICAg KTsNCi0gIGZvciAoSW5kZXggPSAwOyBJbmRleCA8IEZ2SGFuZGxlQ291bnQ7IEluZGV4KyspIHsN Ci0gICAgZ0JTLT5IYW5kbGVQcm90b2NvbCAoDQotICAgICAgICAgIEZ2SGFuZGxlQnVmZmVyW0lu ZGV4XSwNCi0gICAgICAgICAgJmdFZmlGaXJtd2FyZVZvbHVtZTJQcm90b2NvbEd1aWQsDQotICAg ICAgICAgIChWT0lEICoqKSAmRnYNCi0gICAgICAgICAgKTsNCi0NCi0gICAgU3RhdHVzID0gRnYt PlJlYWRGaWxlICgNCi0gICAgICAgICAgICAgICAgICBGdiwNCi0gICAgICAgICAgICAgICAgICAm Z1VlZmlTaGVsbEZpbGVHdWlkLA0KLSAgICAgICAgICAgICAgICAgIE5VTEwsDQotICAgICAgICAg ICAgICAgICAgJlNpemUsDQotICAgICAgICAgICAgICAgICAgJlR5cGUsDQotICAgICAgICAgICAg ICAgICAgJkF0dHJpYnV0ZXMsDQotICAgICAgICAgICAgICAgICAgJkF1dGhlbnRpY2F0aW9uU3Rh dHVzDQotICAgICAgICAgICAgICAgICAgKTsNCi0gICAgaWYgKEVGSV9FUlJPUiAoU3RhdHVzKSkg ew0KLSAgICAgIC8vDQotICAgICAgLy8gU2tpcCBpZiBubyBzaGVsbCBmaWxlIGluIHRoZSBGVg0K LSAgICAgIC8vDQotICAgICAgY29udGludWU7DQotICAgIH0NCi0gICAgLy8NCi0gICAgLy8gQnVp bGQgdGhlIHNoZWxsIGJvb3Qgb3B0aW9uDQotICAgIC8vDQotICAgIEJkc0xpYkJ1aWxkT3B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gU3RhdHVzOw0KLSAgVUlOVDE2ICAgICAg ICAgICAgKkJvb3ROZXh0Ow0KLSAgVUlOVE4gICAgICAgICAgICAgQm9vdE5leHRTaXplOw0KLSAg Q0hBUjE2ICAgICAgICAgICAgQnVmZmVyWzIwXTsNCi0gIEJEU19DT01NT05fT1BUSU9OICpCb290 T3B0aW9uOw0KLSAgTElTVF9FTlRSWSAgICAgICAgVGVtcExpc3Q7DQotICBVSU5UTiAgICAgICAg ICAgICBFeGl0RGF0YVNpemU7DQotICBDSEFSMTYgICAgICAgICAgICAqRXhpdERhdGE7DQotDQot ICAvLw0KLSAgLy8gSW5pdCB0aGUgYm9vdCBvcHRpb24gbmFtZSBidWZmZXIgYW5kIHRlbXAgbGlu ayBsaXN0DQotICAvLw0KLSAgSW5pdGlhbGl6ZUxpc3RIZWFkICgmVGVtcExpc3QpOw0KLSAgWmVy b01lbSAoQnVmZmVyLCBzaXplb2YgKEJ1ZmZlcikpOw0KLQ0KLSAgQm9vdE5leHQgPSBCZHNMaWJH ZXRWYXJpYWJsZUFuZFNpemUgKA0KLSAgICAgICAgICAgICAgTCJCb290TmV4dCIsDQotICAgICAg ICAgICAgICAmZ0VmaUdsb2JhbFZhcmlhYmxlR3VpZCwNCi0gICAgICAgICAgICAgICZCb290TmV4 dFNpemUNCi0gICAgICAgICAgICAgICk7DQotDQotICAvLw0KLSAgLy8gQ2xlYXIgdGhlIGJvb3Qg bmV4dCB2YXJpYWJsZSBmaXJzdA0KLSAgLy8NCi0gIGlmIChCb290TmV4dCAhPSBOVUxMKSB7DQot ICAgIFN0YXR1cyA9IGdSVC0+U2V0VmFyaWFibGUgKA0KLSAgICAgICAgICAgICAgICAgICAgTCJC b290TmV4dCIsDQotICAgICAgICAgICAgICAgICAgICAmZ0VmaUdsb2JhbFZhcmlhYmxlR3VpZCwN Ci0gICAgICAgICAgICAgICAgICAgIEVGSV9WQVJJQUJMRV9CT09UU0VSVklDRV9BQ0NFU1MgfCBF RklfVkFSSUFCTEV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hbmRsZXMpOw0KLSAgfQ0KLQ0KLSAgZ0JT LT5SZXN0b3JlVFBMIChPbGRUcGwpOw0KLQ0KLSAgcmV0dXJuIFJldHVybkhhbmRsZTsNCi19DQot DQotLyoqDQotICBDaGVjayB0byBzZWUgaWYgdGhlIG5ldHdvcmsgY2FibGUgaXMgcGx1Z2dlZCBp bi4gSWYgdGhlIERldmljZVBhdGggaXMgbm90DQotICBjb25uZWN0ZWQgaXQgd2lsbCBiZSBjb25u ZWN0ZWQuDQotDQotICBAcGFyYW0gIERldmljZVBhdGggICAgICAgICAgICAgRGV2aWNlIFBhdGgg dG8gY2hlY2sNCi0NCi0gIEByZXR2YWwgVFJVRSAgICAgICAgICAgICAgICAgICBEZXZpY2VQYXRo IHBvaW50cyB0byBhbiBOZXR3b3JrIHRoYXQgaXMgY29ubmVjdGVkDQotICBAcmV0dmFsIEZBTFNF ICAgICAgICAgICAgICAgICAgRGV2aWNlUGF0aCBkb2VzIG5vdCBwb2ludCB0byBhIGJvb3RhYmxl IG5ldHdvcmsNCi0NCi0qKi8NCi1CT09MRUFODQotQmRzTGliTmV0d29ya0Jvb3RXaXRoTWVkaWFQ cmVzZW50ICgNCi0gIElOICBFRklfREVWSUNFX1BBVEhfUFJPVE9DT0wgICAgICAqRGV2aWNlUGF0 aA0KLSAgKQ0KLXsNCi0gIEVGSV9TVEFUVVMgICAgICAgICAgICAgICAgICAgICAgU3RhdHVzOw0K LSAgRUZJX0RFVklDRV9QQVRIX1BST1RPQ09MICAgICAgICAqVXBkYXRlZERldmljZVBhdGg7DQot ICBFRklfSEFORExFICAgICAgICAgICAgICAgICAgICAgIEhhbmRsZTsNCi0gIEVGSV9TSU1QTEVf TkVUV09SS19QUk9UT0NPTCAgICAgKlNucDsNCi0gIEJPT0xFQU4gICAgICAgICAgICAgICAgICAg ICAgICAgTWVkaWFQcmVzZW50Ow0KLSAgVUlOVDMyICAgICAgICAgICAgICAgICAgICAgICAgICBJ bnRlcnJ1cHRTdGF0dXM7D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gICAgICAgICAvLw0KLSAgICAgICAgICAvLyBJbiBjYXNlIHNvbWUgb25lIGVsc2UgaXMgdXNp bmcgdGhlIFNOUCBjaGVjayB0byBzZWUgaWYgaXQncyBjb25uZWN0ZWQNCi0gICAgICAgICAgLy8N Ci0gICAgICAgICAgTWVkaWFQcmVzZW50ID0gU25wLT5Nb2RlLT5NZWRpYVByZXNlbnQ7DQotICAg ICAgICB9IGVsc2Ugew0KLSAgICAgICAgICAvLw0KLSAgICAgICAgICAvLyBObyBvbmUgaXMgdXNp bmcgU05QIHNvIHdlIG5lZWQgdG8gU3RhcnQgYW5kIEluaXRpYWxpemUgc28NCi0gICAgICAgICAg Ly8gTWVkaWFQcmVzZW50IHdpbGwgYmUgdmFsaWQuDQotICAgICAgICAgIC8vDQotICAgICAgICAg IFN0YXR1cyA9IFNucC0+U3RhcnQgKFNucCk7DQotICAgICAgICAgIGlmICghRUZJX0VSUk9SIChT dGF0dXMpKSB7DQotICAgICAgICAgICAgU3RhdHVzID0gU25wLT5Jbml0aWFsaXplIChTbnAsIDAs IDApOw0KLSAgICAgICAgICAgIGlmICghRUZJX0VSUk9SIChTdGF0dXMpKSB7DQotICAgICAgICAg ICAgICBNZWRpYVByZXNlbnQgPSBTbnAtPk1vZGUtPk1lZGlhUHJlc2VudDsNCi0gICAgICAgICAg ICAgIFNucC0+U2h1dGRvd24gKFNucCk7DQotICAgICAgICAgICAgfQ0KLSAgICAgICAgICAgIFNu cC0+U3RvcCAoU25wKTsNCi0gICAgICAgICAgfQ0KLSAgICAgICAgfQ0KLSAgICAgIH0gZWxzZSB7 DQotICAgICAgICBNZWRpYVByZXNlbnQgPSBUUlVFOw0KLSAgICAgIH0NCi0gICAgfQ0KLSAgfQ0K LQ0KLSAgcmV0dXJuIE1lZGlhUHJlc2VudDsNCi19DQotDQotLyoqDQotICBGb3IgYSBib290YWJs ZSBEZXZpY2UgcGF0aCwgcmV0dXJuIGl0cyBib290IHR5cGUuDQotDQotICBAcGFyYW0gIERldmlj ZVBhdGggICAgICAgICAgICAgICAgICAgICAgVGhlIGJvb3RhYmxlIGRldmljZSBQYXRoIHRvIGNo ZWNrDQotDQotICBAcmV0dmFsIEJEU19FRklfTUVESUFfSERfQk9PVCAgICAgICAgICAgSWYgZ2l2 ZW4gZGV2aWNlIHBhdGggY29udGFpbnMgTUVESUFfREVWSUNFX1BBVEggdHlwZSBkZXZpY2UgcGF0 aCBub2RlDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpY2gg c3VidHlwZSBpcyBNRURJQV9IQVJERFJJVkVfRFANCi0gIEByZXR2YWwgQkRTX0VGSV9NRURJQV9D RFJPTV9CT09UICAgICAgICBJZiBnaXZlbiBkZXZpY2UgcGF0aCBjb250YWlucyBNRURJQV9ERVZJ Q0VfUEFUSCB0eXBlIGRldmljZSBwYXRoIG5vZGUNCi0gICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICB3aGljaCBzdWJ0eXBlIGlzIE1FRElBX0NEUk9NX0RQDQotICBAcmV0 dmFsIEJEU19FRklfQUNQSV9GTE9QUFlfQk9PVCAgICAgICAgSWYgZ2l2ZW4gZGV2aWNlIHBhdGgg Y29udGFpbnMgQUNQSV9ERVZJQ0VfUEFUSCB0eXBlIGRldmljZSBwYXRoIG5vZGUNCi0gICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGljaCBISUQgaXMgZmxvcHB5IGRl dmljZS4NCi0gIEByZXR2YWwgQkRTX0VGSV9NRVNTQUdFX0FUQVBJX0JPT1QgICAgICBJZiBnaXZl biBkZXZpY2UgcGF0aCBjb250YWlucyBNRVNTQUdJTkdfREVWSUNFX1BBVEggdHlwZSBkZXZpY2Ug cGF0aCBub2RlDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5k IGl0cyBsYXN0IGRldmljZSBwYXRoIG5vZGUncyBzdWJ0eXBlIGlzIE1TR19BVEFQSV9EU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gICAgIH0NCi0gICAgICAgIC8vDQotICAgICAgICAvLyBpZiB0aGUgZGV2 aWNlIHBhdGggbm90IG9ubHkgcG9pbnQgdG8gZHJpdmVyIGRldmljZSwgaXQgaXMgbm90IGEgbWVz c2FnaW5nIGRldmljZSBwYXRoLA0KLSAgICAgICAgLy8NCi0gICAgICAgIGlmICghSXNEZXZpY2VQ YXRoRW5kVHlwZSAoTGFzdERldmljZU5vZGUpKSB7DQotICAgICAgICAgIGJyZWFrOw0KLSAgICAg ICAgfQ0KLQ0KLSAgICAgICAgc3dpdGNoIChEZXZpY2VQYXRoU3ViVHlwZSAoVGVtcERldmljZVBh dGgpKSB7DQotICAgICAgICBjYXNlIE1TR19BVEFQSV9EUDoNCi0gICAgICAgICAgQm9vdFR5cGUg PSBCRFNfRUZJX01FU1NBR0VfQVRBUElfQk9PVDsNCi0gICAgICAgICAgYnJlYWs7DQotDQotICAg ICAgICBjYXNlIE1TR19VU0JfRFA6DQotICAgICAgICAgIEJvb3RUeXBlID0gQkRTX0VGSV9NRVNT QUdFX1VTQl9ERVZJQ0VfQk9PVDsNCi0gICAgICAgICAgYnJlYWs7DQotDQotICAgICAgICBjYXNl IE1TR19TQ1NJX0RQOg0KLSAgICAgICAgICBCb290VHlwZSA9IEJEU19FRklfTUVTU0FHRV9TQ1NJ X0JPT1Q7DQotICAgICAgICAgIGJyZWFrOw0KLQ0KLSAgICAgICAgY2FzZSBNU0dfU0FUQV9EUDoN Ci0gICAgICAgICAgQm9vdFR5cGUgPSBCRFNfRUZJX01FU1NBR0VfU0FUQV9CT09UOw0KLSAgICAg ICAgICBicmVhazsNCi0NCi0gICAgICAgIGNhc2UgTVNHX01BQ19BRERSX0RQOg0KLSAgICAgICAg Y2FzZSBNU0dfVkxBTl9EUDoNCi0gICAgICAgIGNhc2UgTVNHX0lQdjRfRFA6DQotICAgICAgICBj YXNlIE1TR19JUHY2X0RQOg0KLSAgICAgICAgICBCb290VHlwZSA9IEJEU19FRklfTUVTU0FHRV9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RklfRVJST1IgKFN0YXR1cykpIHsNCi0gICAgLy8NCi0gICAgLy8gRGV2 aWNlIG5vdCBwcmVzZW50IHNvIHNlZSBpZiB3ZSBuZWVkIHRvIGNvbm5lY3QgaXQNCi0gICAgLy8N Ci0gICAgVGVtcERldmljZVBhdGggPSBEZXZQYXRoOw0KLSAgICBCZHNMaWJDb25uZWN0RGV2aWNl UGF0aCAoVGVtcERldmljZVBhdGgpOw0KLSAgICBTdGF0dXMgPSBnQlMtPkxvY2F0ZURldmljZVBh dGggKA0KLSAgICAgICAgICAgICAgICAgICAgJmdFZmlMb2FkRmlsZVByb3RvY29sR3VpZCwNCi0g ICAgICAgICAgICAgICAgICAgICZUZW1wRGV2aWNlUGF0aCwNCi0gICAgICAgICAgICAgICAgICAg ICZIYW5kbGUNCi0gICAgICAgICAgICAgICAgICAgICk7DQotICB9DQotDQotICBpZiAoIUVGSV9F UlJPUiAoU3RhdHVzKSkgew0KLSAgICBpZiAoIUlzRGV2aWNlUGF0aEVuZCAoVGVtcERldmljZVBh dGgpKSB7DQotICAgICAgLy8NCi0gICAgICAvLyBMb2FkRmlsZSBwcm90b2NvbCBpcyBub3QgaW5z dGFsbGVkIG9uIGhhbmRsZSB3aXRoIGV4YWN0bHkgdGhlIHNhbWUgRGV2UGF0aA0KLSAgICAgIC8v DQotICAgICAgcmV0dXJuIEZBTFNFOw0KLSAgICB9DQotDQotICAgIGlmIChDaGVja01lZGlhKSB7 DQotICAgICAgLy8NCi0gICAgICAvLyBUZXN0IGlmIGl0IGlzIHJlYWR5IHRvIGJvb3Qgbm93DQot ICAgICAgLy8NCi0gICAgICBpZiAoQmRzTGliTmV0d29ya0Jvb3RXaXRoTWVkaWFQcmVzZW50KERl dlBhdGgpKSB7DQotICAgICAgICByZXR1cm4gVFJVRTsNCi0gICAgICB9DQotICAgIH0gZWxzZSB7 DQotICAgICAgcmV0dXJuIFRSVUU7DQotICAgIH0gICAgDQotICB9DQotDQotICAvLw0KLSAgLy8g SWYgdGh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ZVBhdGggZG9lcyBub3QgY29udGFpbiBGdiBmaWxlDQotICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgZ3VpbGQgYXQgYWxsDQotICBAcmV0dmFsIEVGSV9BTFJFQURZ X1NUQVJURUQgICAgdGhlIGlucHV0IERldmljZVBhdGggaGFzIHBvaW50ZWQgdG8gRnYgZmlsZSwg aXQgaXMNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWxpZA0KLSAgQHJldHZh bCBFRklfU1VDQ0VTUyAgICAgICAgICAgIGhhcyBzdWNjZXNzZnVsbHkgdXBkYXRlZCB0aGUgaW52 YWxpZCBEZXZpY2VQYXRoLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuZCBy ZXR1cm4gdGhlIHVwZGF0ZWQgZGV2aWNlIHBhdGggaW4gRGV2aWNlUGF0aA0KLQ0KLSoqLw0KLUVG SV9TVEFUVVMNCi1FRklBUEkNCi1CZHNMaWJVcGRhdGVGdkZpbGVEZXZpY2VQYXRoICgNCi0gIElO ICBPVVQgRUZJX0RFVklDRV9QQVRIX1BST1RPQ09MICAgICAgKiogRGV2aWNlUGF0aCwNCi0gIElO ICBFRklfR1VJRCAgICAgICAgICAgICAgICAgICAgICAgICAgKkZpbGVHdWlkDQotICApDQotew0K LSAgRUZJX0RFVklDRV9QQVRIX1BST1RPQ09MICAgICAgKlRlbXBEZXZpY2VQYXRoOw0KLSAgRUZJ X0RFVklDRV9QQVRIX1BST1RPQ09MICAgICAgKkxhc3REZXZpY2VOb2RlOw0KLSAgRUZJX1NUQVRV UyAgICAgICAgICAgICAgICAgICAgU3RhdHVzOw0KLSAgRUZJX0dVSUQgICAgICAgICAgICAgICAg ICAgICAgKkd1aWRQb2ludDsNCi0gIFVJTlROICAgICAgICAgICAgICAgICAgICAgICAgIEluZGV4 Ow0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgICAgRnZIYW5kbGVDb3VudDsNCi0gIEVG SV9IQU5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mRsZSA9IE5VTEw7DQotICBTdGF0dXMgPSBnQlMtPkxvY2F0 ZURldmljZVBhdGggKA0KLSAgICAgICAgICAgICAgICAgICZnRWZpRmlybXdhcmVWb2x1bWUyUHJv dG9jb2xHdWlkLA0KLSAgICAgICAgICAgICAgICAgICZUZW1wRGV2aWNlUGF0aCwNCi0gICAgICAg ICAgICAgICAgICAmRm91bmRGdkhhbmRsZQ0KLSAgICAgICAgICAgICAgICAgICk7DQotICBpZiAo IUVGSV9FUlJPUiAoU3RhdHVzKSkgew0KLSAgICBTdGF0dXMgPSBnQlMtPkhhbmRsZVByb3RvY29s ICgNCi0gICAgICAgICAgICAgICAgICAgIEZvdW5kRnZIYW5kbGUsDQotICAgICAgICAgICAgICAg ICAgICAmZ0VmaUZpcm13YXJlVm9sdW1lMlByb3RvY29sR3VpZCwNCi0gICAgICAgICAgICAgICAg ICAgIChWT0lEICoqKSAmRnYNCi0gICAgICAgICAgICAgICAgICAgICk7DQotICAgIGlmICghRUZJ X0VSUk9SIChTdGF0dXMpKSB7DQotICAgICAgLy8NCi0gICAgICAvLyBTZXQgRlYgUmVhZEZpbGUg QnVmZmVyIGFzIE5VTEwsIG9ubHkgbmVlZCB0byBjaGVjayB3aGV0aGVyIGlucHV0IEZ2IGZpbGUg ZXhpc3QgdGhlcmUNCi0gICAgICAvLw0KLSAgICAgIFN0YXR1cyA9IEZ2LT5SZWFkRmlsZSAoDQot ICAgICAgICAgICAgICAgICAgICBGdiwNCi0gICAgICAgICAgICAgICAgICAgIEZpbGVHdWlkLA0K LSAgICAgICAgICAgICAgICAgICAgTlVMTCwNCi0gICAgICAgICAgICAgICAgICAgICZTaXplLA0K LSAgICAgICAgICAgICAgICAgICAgJlR5cGUsDQotICAgICAgICAgICAgICAgICAgICAmQXR0cmli dXRlcywNCi0gICAgICAgICAgICAgICAgICAgICZBdXRoZW50aWNhdGlvblN0YXR1cw0KLSAgICAg ICAgICAgICAgICAgICAgKTsNCi0gICAgICBpZiAoIUVGSV9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AgICAgICAgICAgICAgTlVMTCwNCi0gICAgICAgICAgICAgICAgICAgICZT aXplLA0KLSAgICAgICAgICAgICAgICAgICAgJlR5cGUsDQotICAgICAgICAgICAgICAgICAgICAm QXR0cmlidXRlcywNCi0gICAgICAgICAgICAgICAgICAgICZBdXRoZW50aWNhdGlvblN0YXR1cw0K LSAgICAgICAgICAgICAgICAgICAgKTsNCi0gICAgICBpZiAoIUVGSV9FUlJPUiAoU3RhdHVzKSkg ew0KLSAgICAgICAgRmluZEZ2RmlsZSA9IFRSVUU7DQotICAgICAgICBGb3VuZEZ2SGFuZGxlID0g TG9hZGVkSW1hZ2UtPkRldmljZUhhbmRsZTsNCi0gICAgICB9DQotICAgIH0NCi0gIH0NCi0gIC8v DQotICAvLyBTZWNvbmQsIGlmIGZhaWwgdG8gZmluZCwgdHJ5IHRvIGVudW1lcmF0ZSBhbGwgRlYN Ci0gIC8vDQotICBpZiAoIUZpbmRGdkZpbGUpIHsNCi0gICAgRnZIYW5kbGVCdWZmZXIgPSBOVUxM Ow0KLSAgICBnQlMtPkxvY2F0ZUhhbmRsZUJ1ZmZlciAoDQotICAgICAgICAgIEJ5UHJvdG9jb2ws DQotICAgICAgICAgICZnRWZpRmlybXdhcmVWb2x1bWUyUHJvdG9jb2xHdWlkLA0KLSAgICAgICAg ICBOVUxMLA0KLSAgICAgICAgICAmRnZIYW5kbGVDb3VudCwNCi0gICAgICAgICAgJkZ2SGFuZGxl QnVmZmVyDQotICAgICAgICAgICk7DQotICAgIGZvciAoSW5kZXggPSAwOyBJbmRleCA8IEZ2SGFu ZGxlQ291bnQ7IEluZGV4KyspIHsNCi0gICAgICBnQlMtPkhhbmRsZVByb3RvY29sICgNCi0gICAg ICAgICAgICBGdkhhbmRsZUJ1ZmZlcltJbmRleF0sDQotICAgICAgICAgICAgJmdFZmlGaXJtd2Fy ZVZvbHVtZTJQcm90b2NvbEd1aWQsDQotICAgICAgICAgICAgKFZPSUQgKiopICZGdg0KLSAgICAg ICAgICAgICk7DQotDQotICAgICAgU3RhdHVzID0gRnYtPlJlYWRGaWxlICgNCi0gICAgICAgICAg ICAgICAgICAgIEZ2LA0KLSAgICAgICAgICAgICAgICAgICAgRmlsZUd1aWQsDQotICAgICAgICAg ICAgICAgICAgICBOVUxMLA0KLSAgICAgICAgICAgICAgICAgICAgJlNpemUsDQotICAgICAgICAg ICAgICAgICAgICAmVHlwZSwNCi0gICAgICAgICAgICAgICAgICAgICZBdHRyaWJ1dGVzLA0KLSAg ICAgICAgICAgICAgICAgICAgJkF1dGhlbnRpY2F0aW9uU3RhdHVzDQotICAgICAgICAgICAgICAg ICAgICApOw0KLSAgICAgIGlmIChFRklfRVJST1IgKFN0YXR1cykpIHsNCi0gICAgICAgIC8vDQot ICAgICAgICAvLyBTa2lwIGlmIGlucHV0IEZ2IGZpbGUgbm90IGluIHRoZSBGVg0KLSAgICAgICAg Ly8NCi0gICAgICAgIGNvbnRpbnVlOw0KLSAgICAgIH0NCi0gICAgICBGaW5kRnZGaWxlID0gVFJV RTsNCi0gICAgICBGb3VuZEZ2SGFuZGxlID0gRnZIYW5kbGVCdWZmZXJbSW5kZXhdOw0KLSAgICAg IGJyZWFrOw0KLSAgICB9DQotDQotICAgIGlmIChGdkhhbmRsZUJ1ZmZlciAhPSBOVUxMKSB7DQot ICAgICAgRnJlZVBvb2wgKEZ2SGFuZGxlQnVmZmVyKTsNCi0gICAgfQ0KLSAgfQ0KLQ0KLSAgaWYg KEZpbmRGdkZpbGUpIHsNCi0gICAgLy8NCi0gICAgLy8gQnVpbGQgdGhlIHNoZWxsIGRldmljZSBw YXRoDQotICAgIC8vDQotICAgIE5ld0RldmljZVBhdGggPSBEZXZpY2VQYXRoRnJvbUhhbmRsZSAo Rm91bmRGdkhhbmRsZSk7DQotICAgIEVmaUluaXRpYWxpemVGd1ZvbERldmljZXBhdGhOb2RlICgm RnZGaWxlTm9kZSwgRmlsZUd1aWQpOw0KLSAgICBOZXdEZXZpY2VQYXRoID0gQXBwZW5kRG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9IQU5ETEUgICAgICAgICAgICAgICAgUHJldmlvdXNIYW5kbGU7DQotICBVSU5U TiAgICAgICAgICAgICAgICAgICAgIFNpemU7DQotICBFRklfVFBMICAgICAgICAgICAgICAgICAg IEN1cnJlbnRUcGw7DQotDQotICBpZiAoRGV2aWNlUGF0aFRvQ29ubmVjdCA9PSBOVUxMKSB7DQot ICAgIHJldHVybiBFRklfU1VDQ0VTUzsNCi0gIH0NCi0NCi0gIEN1cnJlbnRUcGwgID0gRWZpR2V0 Q3VycmVudFRwbCAoKTsNCi0NCi0gIERldmljZVBhdGggICAgICAgID0gRHVwbGljYXRlRGV2aWNl UGF0aCAoRGV2aWNlUGF0aFRvQ29ubmVjdCk7DQotICBpZiAoRGV2aWNlUGF0aCA9PSBOVUxMKSB7 DQotICAgIHJldHVybiBFRklfT1VUX09GX1JFU09VUkNFUzsNCi0gIH0NCi0gIENvcHlPZkRldmlj ZVBhdGggID0gRGV2aWNlUGF0aDsNCi0gIA0KLSAgZG8gew0KLSAgICAvLw0KLSAgICAvLyBUaGUg b3V0ZXIgbG9vcCBoYW5kbGVzIG11bHRpIGluc3RhbmNlIGRldmljZSBwYXRocy4NCi0gICAgLy8g T25seSBjb25zb2xlIHZhcmlhYmxlcyBjb250YWluIG11bHRpcGxlIGluc3RhbmNlIGRldmljZSBw YXRocy4NCi0gICAgLy8NCi0gICAgLy8gQWZ0ZXIgdGhpcyBjYWxsIERldmljZVBhdGggcG9pbnRz IHRvIHRoZSBuZXh0IEluc3RhbmNlDQotICAgIC8vDQotICAgIEluc3RhbmNlICA9IEdldE5leHRE ZXZpY2VQYXRoSW5zdGFuY2UgKCZEZXZpY2VQYXRoLCAmU2l6ZSk7DQotICAgIGlmIChJbnN0YW5j ZSA9PSBOVUxMKSB7DQotICAgICAgRnJlZVBvb2wgKENvcHlPZkRldmljZVBhdGgpOw0KLSAgICAg IHJldHVybiBFRklfT1VUX09GX1JFU09VUkNFUzsNCi0gICAgfQ0KLSAgICANCi0gICAgTmV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tIGRl dmljZSBwYXRoIHRoYXQgc3RhcnRzIHdpdGggdGhlIGZpcnN0DQotICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBlbGVtZW50ICBiZWluZyBhIFVTQiBXV0lEIG9yIGEgVVNCIENsYXNzIGRl dmljZQ0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aA0KLQ0KLSAgQHJldHVy biBFRklfSU5WQUxJRF9QQVJBTUVURVIgIFJlbWFpbmluZ0RldmljZVBhdGggaXMgTlVMTCBwb2lu dGVyLg0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlbWFpbmluZ0RldmljZVBh dGggaXMgbm90IGEgVVNCIGRldmljZSBwYXRoLg0KLSAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIEludmFsaWQgSG9zdENvbnRyb2xsZXJQSSB0eXBlLg0KLSAgQHJldHVybiBFRklfU1VD Q0VTUyAgICAgICAgICAgIFN1Y2Nlc3MgdG8gY29ubmVjdCBVU0IgZGV2aWNlDQotICBAcmV0dXJu IEVGSV9OT1RfRk9VTkQgICAgICAgICAgRmFpbCB0byBmaW5kIGhhbmRsZSBmb3IgVVNCIGNvbnRy b2xsZXIgdG8gY29ubmVjdC4NCi0NCi0qKi8NCi1FRklfU1RBVFVTDQotRUZJQVBJDQotQmRzTGli Q29ubmVjdFVzYkRldkJ5U2hvcnRGb3JtRFAoDQotICBJTiBVSU5UOCAgICAgICAgICAgICAgICAg ICAgICBIb3N0Q29udHJvbGxlclBJLA0KLSAgSU4gRUZJX0RFVklDRV9QQVRIX1BST1RPQ09MICAg KlJlbWFpbmluZ0RldmljZVBhdGgNCi0gICkNCi17DQotICBFRklfU1RBVFVTICAgICAgICAgICAg ICAgICAgICAgICAgICAgIFN0YXR1czsNCi0gIEVGSV9IQU5ETEUgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKkhhbmRsZUFycmF5Ow0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBIYW5kbGVBcnJheUNvdW50Ow0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBJbmRleDsNCi0gIEVGSV9QQ0lfSU9fUFJPVE9DT0wgICAgICAgICAgICAgICAg ICAgKlBjaUlvOw0KLSAgVUlOVDggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDbGFz c1szXTsNCi0gIEJPT0xFQU4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXRMZWFzdE9u ZUNvbm5lY3RlZDsNCi0NCi0gIC8vDQotICAvLyBDaGVjayB0aGUgcGFzc2VkIGluIHBhcmFtZXRl cnMNCi0gIC8vDQotICBpZiAoUmVtYWluaW5nRGV2aWNlUGF0aCA9PSBOVUxMKSB7DQotICAgIHJl dHVybiBFRklfSU5WQUxJRF9QQVJBTUVURVI7DQotICB9DQotDQotICBpZiAoKERldmljZVBhdGhU eXBlIChSZW1haW5pbmdEZXZpY2VQYXRoKSAhPSBNRVNTQUdJTkdfREVWSUNFX1BBVEgpIHx8DQot ICAgICAgKChEZXZpY2VQYXRoU3ViVHlwZSAoUmVtYWluaW5nRGV2aWNlUGF0aCkgIT0gTVNHX1VT Ql9DTEFTU19EUCkNCi0gICAgICAmJiAoRGV2aWNlUGF0aFN1YlR5cGUgKFJlbWFpbmluZ0Rldmlj ZVBhdGgpICE9IE1TR19VU0JfV1dJRF9EUCkNCi0gICAgICApKSB7DQotICAgIHJldHVybiBFRklf SU5WQUxJRF9QQVJBTUVURVI7DQotICB9DQotDQotICBpZiAoSG9zdENvbnRyb2xsZXJQSSAhPSAw eEZGICYmDQotICAgICAgSG9zdENvbnRyb2xsZXJQSSAhPSAweDAwICYmDQotICAgICAgSG9zdENv bnRyb2xsZXJQSSAhPSAweDIwKSB7DQotICAgIHJldHVybiBFRklfSU5WQUxJRF9QQVJBTUVURVI7 DQotICB9DQotDQotICAvLw0KLSAgLy8gRmluZCB0aGUgdXNiIGhvc3QgY29udHJvbGxlciBmaXJz dGx5LCB0aGVuIGNvbm5lY3Qgd2l0aCB0aGUgcmVtYWluaW5nIGRldmljZSBwYXRoDQotICAvLw0K LSAgQXRMZWFzdE9uZUNvbm5lY3RlZCA9IEZBTFNFOw0KLSAgU3RhdHVzID0gZ0JTLT5Mb2NhdGVI YW5kbGVCdWZmZXIgKA0KLSAgICAgICAgICAgICAgICAgIEJ5UHJvdG9jb2wsDQotICAgICAgICAg ICAgICAgICAgJmdFZmlQY2lJb1Byb3RvY29sR3VpZCwNCi0gICAgICAgICAgICAgICAgICBOVUxM LA0KLSAgICAgICAgICAgICAgICAgICZIYW5kbGVBcnJheUNvdW50LA0KLSAgICAgICAgICAgICAg ICAgICZIYW5kbGVBcnJheQ0KLSAgICAgICAgICAgICAgICAgICk7DQotICBpZiAoIUVGSV9FUlJP UiAoU3RhdHVzKSkgew0KLSAgICBmb3IgKEluZGV4ID0gMDsgSW5kZXggPCBIYW5kbGVBcnJheUNv dW50OyBJbmRleCsrKSB7DQotICAgICAgU3RhdHVzID0gZ0JTLT5IYW5kbGVQcm90b2NvbCAoDQot ICAgICAgICAgICAgICAgICAgICAgIEhhbmRsZUFycmF5W0luZGV4XSwNCi0gICAgICAgICAgICAg ICAgICAgICAgJmdFZmlQY2lJb1Byb3RvY29sR3VpZCwNCi0gICAgICAgICAgICAgICAgICAgICAg KFZPSUQgKiopJlBjaUlvDQotICAgICAgICAgICAgICAgICAgICAgICk7DQotICAgICAgaWYgKCFF RklfRVJST1IgKFN0YXR1cykpIHsNCi0gICAgICAgIC8vDQotICAgICAgICAvLyBDaGVjayB3aGV0 aGVyIHRoZSBQY2kgZGV2aWNlIGlzIHRoZSB3YW50ZWQgdXNiIGhvc3QgY29udHJvbGxlcg0KLSAg ICAgICAgLy8NCi0gICAgICAgIFN0YXR1cyA9IFBjaUlvLT5QY2kuUmVhZCAoUGNpSW8sIEVmaVBj aUlvV2lkdGhVaW50OCwgMHgwOSwgMywgJkNsYXNzKTsNCi0gICAgICAgIGlmICghRUZJX0VSUk9S IChTdGF0dXMpKSB7DQotICAgICAgICAgIGlmICgoUENJX0NMQVNTX1NFUklBTCA9PSBDbGFzc1sy XSkgJiYNCi0gICAgICAgICAgICAgIChQQ0lfQ0xBU1NfU0VSSUFMX1VTQiA9PSBDbGFzc1sxXSkp IHsNCi0gICAgICAgICAgICBpZiAoSG9zdENvbnRyb2xsZXJQSSA9PSBDbGFzc1swXSB8fCBIb3N0 Q29udHJvbGxlclBJID09IDB4RkYpIHsNCi0gICAgICAgICAgICAgIFN0YXR1cyA9IGdCUy0+Q29u bmVjdENvbnRyb2xsZXIgKA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhhbmRsZUFy cmF5W0luZGV4XSwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLA0KLSAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIFJlbWFpbmluZ0RldmljZVBhdGgsDQotICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgRkFMU0UNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAg ICApOw0KLSAgICAgICAgICAgICAgaWYgKCFFRklfRVJST1IoU3RhdHVzKSkgew0KLSAgICAgICAg ICAgICAgICBBdExlYXN0T25lQ29ubmVjdGVkID0gVFJVRTsNCi0gICAgICAgICAgICAgIH0NCi0g ICAgICAgICAgICB9DQotICAgICAgICAgIH0NCi0gICAgICAgIH0NCi0gICAgICB9DQotICAgIH0N Ci0NCi0gICAgaWYgKEhhbmRsZUFycmF5ICE9IE5VTEwpIHsNCi0gICAgICBGcmVlUG9vbCAoSGFu ZGxlQXJyYXkpOw0KLSAgICB9DQotDQotICAgIGlmIChBdExlYXN0T25lQ29ubmVjdGVkKSB7DQot ICAgICAgcmV0dXJuIEVGSV9TVUNDRVNTOw0KLSAgICB9DQotICB9DQotDQotICByZXR1cm4gRUZJ X05PVF9GT1VORDsNCi19DQpkaWZmIC0tZ2l0IGEvUGxhdGZvcm0vSW50ZWwvVmx2MlRibHREZ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1UYWJsZUNvbnNvbGUgKA0KLSAgSU4gICAgIENI QVIxNiAgICAgICAgICAgICAgICAgICAgICAgICAgKlZhck5hbWUsDQotICBJTiAgICAgRUZJX0dV SUQgICAgICAgICAgICAgICAgICAgICAgICAqQ29uc29sZUd1aWQsDQotICBJTiBPVVQgRUZJX0hB TkRMRSAgICAgICAgICAgICAgICAgICAgICAqQ29uc29sZUhhbmRsZSwNCi0gIElOIE9VVCBWT0lE ICAgICAgICAgICAgICAgICAgICAgICAgICAgICoqUHJvdG9jb2xJbnRlcmZhY2UNCi0gICkNCi17 DQotICBFRklfU1RBVFVTICAgICAgICAgICAgICAgIFN0YXR1czsNCi0gIFVJTlROICAgICAgICAg ICAgICAgICAgICAgRGV2aWNlUGF0aFNpemU7DQotICBFRklfREVWSUNFX1BBVEhfUFJPVE9DT0wg ICpGdWxsRGV2aWNlUGF0aDsNCi0gIEVGSV9ERVZJQ0VfUEFUSF9QUk9UT0NPTCAgKlZhckNvbnNv bGU7DQotICBFRklfREVWSUNFX1BBVEhfUFJPVE9DT0wgICpJbnN0YW5jZTsNCi0gIFZPSUQgICAg ICAgICAgICAgICAgICAgICAgKkludGVyZmFjZTsNCi0gIEVGSV9IQU5ETEUgICAgICAgICAgICAg ICAgTmV3SGFuZGxlOw0KLSAgRUZJX1NJTVBMRV9URVhUX09VVFBVVF9QUk9UT0NPTCAqVGV4dE91 dDsNCi0NCi0gIEFTU0VSVCAoVmFyTmFtZSAhPSBOVUxMKTsNCi0gIEFTU0VSVCAoQ29uc29sZUhh bmRsZSAhPSBOVUxMKTsNCi0gIEFTU0VSVCAoQ29uc29sZUd1aWQgIT0gTlVMTCk7DQotICBBU1NF UlQgKFByb3RvY29sSW50ZXJmYWNlICE9IE5VTEwpOw0KLQ0KLSAgaWYgKCpDb25zb2xlSGFuZGxl ICE9IE5VTEwpIHsNCi0gICAgU3RhdHVzID0gZ0JTLT5IYW5kbGVQcm90b2NvbCAoDQotICAgICAg ICAgICAgICAgICAgICpDb25zb2xlSGFuZGxlLA0KLSAgICAgICAgICAgICAgICAgICBDb25zb2xl R3VpZCwNCi0gICAgICAgICAgICAgICAgICAgJkludGVyZmFjZQ0KLSAgICAgICAgICAgICAgICAg ICApOw0KLSAgICBpZiAoU3RhdHVzID09IEVGSV9TVUNDRVNTICYmIEludGVyZmFjZSA9PSAqUHJv dG9jb2xJbnRlcmZhY2UpIHsNCi0gICAgICAvLw0KLSAgICAgIC8vIElmIENvbnNvbGVIYW5kbGUg aXMgdmFsaWQgYW5kIGNvbnNvbGUgcHJvdG9jb2wgb24gdGhpcyBoYW5kbGUgYWxzbw0KLSAgICAg IC8vIGFsc28gbWF0Y2hlZCwganVzdCByZXR1cm4uDQotICAgICAgLy8NCi0gICAgICByZXR1cm4g RkFMU0U7DQotICAgIH0NCi0gIH0NCi0gIA0KLSAgLy8NCi0gIC8vIEdldCBhbGwgcG9zc2libGUg Y29uc29sZXMgZGV2aWNlIHBhdGggZnJvbSBFRkkgdmFyaWFibGUNCi0gIC8vDQotICBWYXJDb25z b2xlID0gQmRzTGliR2V0VmFyaWFibGVBbmRTaXplICgNCi0gICAgICAgICAgICAgICAgVmFyTmFt ZSwNCi0gICAgICAgICAgICAgICAgJmdFZmlHbG9iYWxWYXJpYWJsZUd1aWQsDQotICAgICAgICAg ICAgICAgICZEZXZpY2VQYXRoU2l6ZQ0KLSAgICAgICAgICAgICAgICApOw0KLSAgaWYgKFZhckNv bnNvbGUgPT0gTlVMTCkgew0KLSAgICAvLw0KLSAgICAvLyBJZiB0aGVyZSBpcyBubyBhbnkgY29u c29sZSBkZXZpY2UsIGp1c3QgcmV0dXJuLg0KLSAgICAvLw0KLSAgICByZXR1cm4gRkFMU0U7DQot ICB9DQotDQotICBGdWxsRGV2aWNlUGF0aCA9IFZhckNvbnNvbGU7DQotDQotICBkbyB7DQotICAg IC8vDQotICAgIC8vIENoZWNrIGV2ZXJ5IGluc3RhbmNlIG9mIHRoZSBjb25zb2xlIHZhcmlhYmxl DQotICAgIC8vDQotICAgIEluc3RhbmNlICA9IEdldE5leHREZXZpY2VQYXRoSW5zdGFuY2UgKCZW YXJDb25zb2xlLCAmRGV2aWNlUGF0aFNpemUpOw0KLSAgICBpZiAoSW5zdGFuY2UgPT0gTlVMTCkg ew0KLSAgICAgIEZyZWVQb29sIChGdWxsRGV2aWNlUGF0aCk7DQotICAgICAgQVNTRVJUIChGQUxT RSk7DQotICAgIH0NCi0gICAgDQotICAgIC8vDQotICAgIC8vIEZpbmQgY29uc29sZSBkZXZpY2Ug aGFuZGxlIGJ5IGRldmljZSBwYXRoIGluc3RhbmNlDQotICAgIC8vDQotICAgIFN0YXR1cyA9IGdC Uy0+TG9jYXRlRGV2aWNlUGF0aCAoDQotICAgICAgICAgICAgICAgICAgIENvbnNvbGVHdWlkLA0K LSAgICAgICAgICAgICAgICAgICAmSW5zdGFuY2UsDQotICAgICAgICAgICAgICAgICAgICZOZXdI YW5kbGUNCi0gICAgICAgICAgICAgICAgICAgKTsNCi0gICAgaWYgKCFFRklfRVJST1IgKFN0YXR1 cykpIHsNCi0gICAgICAvLw0KLSAgICAgIC8vIEdldCB0aGUgY29uc29sZSBwcm90b2NvbCBvbiB0 aGlzIGNvbnNvbGUgZGV2aWNlIGhhbmRsZQ0KLSAgICAgIC8vDQotICAgICAgU3RhdHVzID0gZ0JT LT5IYW5kbGVQcm90b2NvbCAoDQotICAgICAgICAgICAgICAgICAgICAgTmV3SGFuZGxlLA0KLSAg ICAgICAgICAgICAgICAgICAgIENvbnNvbGVHdWlkLA0KLSAgICAgICAgICAgICAgICAgICAgICZJ bnRlcmZhY2UNCi0gICAgICAgICAgICAgICAgICAgICApOw0KLSAgICAgIGlmICghRUZJX0VSUk9S IChTdGF0dXMpKSB7DQotICAgICAgICAvLw0KLSAgICAgICAgLy8gVXBkYXRlIG5ldyBjb25zb2xl IGhhbmRsZSBpbiBTeXN0ZW0gVGFibGUuDQotICAgICAgICAvLw0KLSAgICAgICAgKkNvbnNvbGVI YW5kbGUgIC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LCBDb25JbiwgQ29uT3V0LA0KLSAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgRXJyT3V0Lg0KLSAgQHBhcmFtICBDdXN0b21pemVk Q29uRGV2aWNlUGF0aCAgVGhlIGNvbnNvbGUgZGV2aWNlIHBhdGggd2hpY2ggd2lsbCBiZSBhZGRl ZCB0bw0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIGNvbnNvbGUgdmFy aWFibGUgQ29uVmFyTmFtZSwgdGhpcyBwYXJhbWV0ZXINCi0gICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGNhbiBub3QgYmUgbXVsdGktaW5zdGFuY2UuDQotICBAcGFyYW0gIEV4Y2x1 c2l2ZURldmljZVBhdGggICAgICBUaGUgY29uc29sZSBkZXZpY2UgcGF0aCB3aGljaCB3aWxsIGJl IHJlbW92ZWQNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyb20gdGhlIGNv bnNvbGUgdmFyaWFibGUgQ29uVmFyTmFtZSwgdGhpcw0KLSAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgcGFyYW1ldGVyIGNhbiBub3QgYmUgbXVsdGktaW5zdGFuY2UuDQotDQotICBA cmV0dmFsIEVGSV9VTlNVUFBPUlRFRCAgICAgICAgICBUaGUgYWRkZWQgZGV2aWNlIHBhdGggaXMg c2FtZSB0byB0aGUgcmVtb3ZlZCBvbmUuDQotICBAcmV0dmFsIEVGSV9TVUNDRVNTICAgICAgICAg ICAgICBTdWNjZXNzIGFkZCBvciByZW1vdmUgdGhlIGRldmljZSBwYXRoIGZyb20gIHRoZQ0KLSAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZSB2YXJpYWJsZS4NCi0NCi0q Ki8NCi1FRklfU1RBVFVTDQotRUZJQVBJDQotQmRzTGliVXBkYXRlQ29uc29sZVZhcmlhYmxlICgN Ci0gIElOICBDSEFSMTYgICAgICAgICAg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SGFuZGxlQnVmZmVyDQotICAg ICAgICAgICk7DQotDQotICBmb3IgKEluZGV4ID0gMDsgSW5kZXggPCBIYW5kbGVDb3VudDsgSW5k ZXgrKykgew0KLSAgICBnQlMtPkhhbmRsZVByb3RvY29sICgNCi0gICAgICAgICAgICBIYW5kbGVC dWZmZXJbSW5kZXhdLA0KLSAgICAgICAgICAgICZnRWZpRGV2aWNlUGF0aFByb3RvY29sR3VpZCwN Ci0gICAgICAgICAgICAoVk9JRCAqKikgJkNvbkRldmljZVBhdGgNCi0gICAgICAgICAgICApOw0K LSAgICBCZHNMaWJVcGRhdGVDb25zb2xlVmFyaWFibGUgKEwiQ29uSW4iLCBDb25EZXZpY2VQYXRo LCBOVUxMKTsNCi0gIH0NCi0NCi0gIGlmIChIYW5kbGVCdWZmZXIgIT0gTlVMTCkgew0KLSAgICBG cmVlUG9vbChIYW5kbGVCdWZmZXIpOw0KLSAgICBIYW5kbGVCdWZmZXIgPSBOVUxMOw0KLSAgfQ0K LQ0KLSAgZ0JTLT5Mb2NhdGVIYW5kbGVCdWZmZXIgKA0KLSAgICAgICAgICBCeVByb3RvY29sLA0K LSAgICAgICAgICAmZ0VmaVNpbXBsZVRleHRPdXRQcm90b2NvbEd1aWQsDQotICAgICAgICAgIE5V TEwsDQotICAgICAgICAgICZIYW5kbGVDb3VudCwNCi0gICAgICAgICAgJkhhbmRsZUJ1ZmZlcg0K LSAgICAgICAgICApOw0KLSAgZm9yIChJbmRleCA9IDA7IEluZGV4IDwgSGFuZGxlQ291bnQ7IElu ZGV4KyspIHsNCi0gICAgZ0JTLT5IYW5kbGVQcm90b2NvbCAoDQotICAgICAgICAgICAgSGFuZGxl QnVmZmVyW0luZGV4XSwNCi0gICAgICAgICAgICAmZ0VmaURldmljZVBhdGhQcm90b2NvbEd1aWQs DQotICAgICAgICAgICAgKFZPSUQgKiopICZDb25EZXZpY2VQYXRoDQotICAgICAgICAgICAgKTsN Ci0gICAgQmRzTGliVXBkYXRlQ29uc29sZV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Ag ICAgICAgICAgRGVzdFk7DQotICBVSU5UOCAgICAgICAgICAgICAgICAgICAgICAgICAqSW1hZ2VE YXRhOw0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgICAgSW1hZ2VTaXplOw0KLSAgVUlO VE4gICAgICAgICAgICAgICAgICAgICAgICAgQmx0U2l6ZTsNCi0gIFVJTlQzMiAgICAgICAgICAg ICAgICAgICAgICAgIEluc3RhbmNlOw0KLSAgRUZJX0JBREdJTkdfRk9STUFUICAgICAgICAgICAg Rm9ybWF0Ow0KLSAgRUZJX0JBREdJTkdfRElTUExBWV9BVFRSSUJVVEUgQXR0cmlidXRlOw0KLSAg VUlOVE4gICAgICAgICAgICAgICAgICAgICAgICAgQ29vcmRpbmF0ZVg7DQotICBVSU5UTiAgICAg ICAgICAgICAgICAgICAgICAgICBDb29yZGluYXRlWTsNCi0gIFVJTlROICAgICAgICAgICAgICAg ICAgICAgICAgIEhlaWdodDsNCi0gIFVJTlROICAgICAgICAgICAgICAgICAgICAgICAgIFdpZHRo Ow0KLSAgRUZJX0dSQVBISUNTX09VVFBVVF9CTFRfUElYRUwgKkJsdDsNCi0gIEVGSV9VR0FfRFJB V19QUk9UT0NPTCAgICAgICAgICpVZ2FEcmF3Ow0KLSAgVUlOVDMyICAgICAgICAgICAgICAgICAg ICAgICAgQ29sb3JEZXB0aDsNCi0gIFVJTlQzMiAgICAgICAgICAgICAgICAgICAgICAgIFJlZnJl c2hSYXRlOw0KLSAgRUZJX0dSQVBISUNTX09VVFBVVF9QUk9UT0NPTCAgKkdyYXBoaWNzT3V0cHV0 Ow0KLSAgRUZJX0JPT1RfTE9HT19QUk9UT0NPTCAgICAgICAgKkJvb3RMb2dvOw0KLSAgVUlOVE4g ICAgICAgICAgICAgICAgICAgICAgICAgTnVtYmVyT2ZMb2dvczsNCi0gIEVGSV9HUkFQSElDU19P VVRQVVRfQkxUX1BJWEVMICpMb2dvQmx0Ow0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICA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ByZXR1cm4gRUZJX1VO U1VQUE9SVEVEOw0KLSAgICB9DQotICB9IGVsc2Ugew0KLSAgICByZXR1cm4gRUZJX1VOU1VQUE9S VEVEOw0KLSAgfQ0KLQ0KLSAgQmx0ID0gTlVMTDsNCi0gIE51bWJlck9mTG9nb3MgPSAwOw0KLSAg TG9nb0Rlc3RYID0gMDsNCi0gIExvZ29EZXN0WSA9IDA7DQotICBMb2dvSGVpZ2h0ID0gMDsNCi0g IExvZ29XaWR0aCA9IDA7DQotICBOZXdEZXN0WCA9IDA7DQotICBOZXdEZXN0WSA9IDA7DQotICBO ZXdIZWlnaHQgPSAwOw0KLSAgTmV3V2lkdGggPSAwOw0KLSAgSW5zdGFuY2UgPSAwOw0KLSAgd2hp bGUgKDEpIHsNCi0gICAgSW1hZ2VEYXRhID0gTlVMTDsNCi0gICAgSW1hZ2VTaXplID0gMDsNCi0N Ci0gICAgaWYgKEJhZGdpbmcgIT0gTlVMTCkgew0KLSAgICAgIC8vDQotICAgICAgLy8gR2V0IGlt YWdlIGZyb20gT0VNQmFkZ2luZyBwcm90b2NvbC4NCi0gICAgICAvLw0KLSAgICAgIFN0YXR1cyA9 IEJhZGdpbmctPkdldEltYWdlICgNCi0gICAgICAgICAgICAgICAgICAgICAgICAgIEJhZGdpbmcs DQotICAgICAgICAgICAgICAgICAgICAgICAgICAmSW5zdGFuY2UsDQotICAgICAgICAgICAgICAg ICAgICAgICAgICAmRm9ybWF0LA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgJkltYWdlRGF0 YSwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICZJbWFnZVNpemUsDQotICAgICAgICAgICAg ICAgICAgICAgICAgICAmQXR0cmlidXRlLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgJkNv b3JkaW5hdGVYLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgJkNvb3JkaW5hdGVZDQotICAg ICAgICAgICAgICAgICAgICAgICAgICApOw0KLSAgICAgIGlmIChFRklfR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E5VTEwpIHsNCi0gICAgICBGcmVlUG9vbCAoQmx0KTsNCi0gICAgfQ0KLSAgICBCbHQg PSBOVUxMOw0KLSAgICBTdGF0dXMgPSBUcmFuc2xhdGVCbXBUb0dvcEJsdCAoDQotICAgICAgICAg ICAgICBJbWFnZURhdGEsDQotICAgICAgICAgICAgICBJbWFnZVNpemUsDQotICAgICAgICAgICAg ICAmQmx0LA0KLSAgICAgICAgICAgICAgJkJsdFNpemUsDQotICAgICAgICAgICAgICAmSGVpZ2h0 LA0KLSAgICAgICAgICAgICAgJldpZHRoDQotICAgICAgICAgICAgICApOw0KLSAgICBpZiAoRUZJ X0VSUk9SIChTdGF0dXMpKSB7DQotICAgICAgRnJlZVBvb2wgKEltYWdlRGF0YSk7DQotDQotICAg ICAgaWYgKEJhZGdpbmcgPT0gTlVMTCkgew0KLSAgICAgICAgcmV0dXJuIFN0YXR1czsNCi0gICAg ICB9IGVsc2Ugew0KLSAgICAgICAgY29udGludWU7DQotICAgICAgfQ0KLSAgICB9DQotDQotICAg IC8vDQotICAgIC8vIENhbGN1bGF0ZSB0aGUgZGlzcGxheSBwb3NpdGlvbiBhY2NvcmRpbmcgdG8g QXR0cmlidXRlLg0KLSAgICAvLw0KLSAgICBzd2l0Y2ggKEF0dHJpYnV0ZSkgew0KLSAgICBjYXNl IEVmaUJhZGdpbmdEaXNwbGF5QXR0cmlidXRlTGVmdFRvcDoNCi0gICAgICBEZXN0WCA9IENvb3Jk aW5hdGVYOw0KLSAgICAgIERlc3RZID0gQ29vcmRpbmF0ZVk7DQotICAgICAgYnJlYWs7DQotDQot ICAgIGNhc2UgRWZpQmFkZ2luZ0Rpc3BsYXlBdHRyaWJ1dGVDZW50ZXJUb3A6DQotICAgICAgRGVz dFggPSAoU2l6ZU9mWCAtIFdpZHRoKSAvIDI7DQotICAgICAgRGVzdFkgPSBDb29yZGluYXRlWTsN Ci0gICAgICBicmVhazsNCi0NCi0gICAgY2FzZSBFZmlCYWRnaW5nRGlzcGxheUF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mRpbmF0ZVg7DQotICAgICAgRGVzdFkgPSAoU2l6ZU9mWSAtIEhlaWdodCkgLyAyOw0KLSAg ICAgIGJyZWFrOw0KLQ0KLSAgICBjYXNlIEVmaUJhZGdpbmdEaXNwbGF5QXR0cmlidXRlQ2VudGVy Og0KLSAgICAgIERlc3RYID0gKFNpemVPZlggLSBXaWR0aCkgLyAyOw0KLSAgICAgIERlc3RZID0g KFNpemVPZlkgLSBIZWlnaHQpIC8gMjsNCi0gICAgICBicmVhazsNCi0NCi0gICAgY2FzZSBFZmlC YWRnaW5nRGlzcGxheUF0dHJpYnV0ZUN1c3RvbWl6ZWQ6DQotICAgICAgRGVzdFggPSAoU2l6ZU9m WCAtIFdpZHRoKSAvIDI7DQotICAgICAgRGVzdFkgPSAoKFNpemVPZlkgKiAzODIpIC8gMTAwMCkg LSBIZWlnaHQgLyAyOw0KLSAgICAgIGJyZWFrOw0KLQ0KLSAgICBkZWZhdWx0Og0KLSAgICAgIERl c3RYID0gQ29vcmRpbmF0ZVg7DQotICAgICAgRGVzdFkgPSBDb29yZGluYXRlWTsNCi0gICAgICBi cmVhazsNCi0gICAgfQ0KLQ0KLSAgICBpZiAoKERlc3RYID49IDApICYmIChEZXN0WSA+PSAwKSkg ew0KLSAgICAgIGlmIChHcmFwaGljc091dHB1dCAhPSBOVUxMKSB7DQotICAgICAgICBTdGF0dXMg PSBHcmFwaGljc091dHB1dC0+Qmx0ICgNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgR3Jh cGhpY3NPdXRwdXQsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJsdCwNCi0gICAgICAg ICAgICAgICAgICAgICAgICAgICAgRWZpQmx0QnVmZmVyVG9WaWRlbywNCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICAgMCwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwNCi0gICAg ICAgICAgICAgICAgICAgICAgICAgICAgKFVJTlROKSBEZXN0WCwNCi0gICAgICAgICAgICAgICAg ICAgICAgICAgICAgKFVJTlROKSBEZXN0WSwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAg V2lkdGgsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhlaWdodCwNCi0gICAgICAgICAg ICAgICAgICAgICAgICAgICAgV2lkdGggKiBzaXplb2YgKEVGSV9HUkFQSElDU19PVVRQVVRfQkxU X1BJWEVMKQ0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICApOw0KLSAgICAgIH0gZWxzZSBp ZiAoVWdhRHJhdyAhPSBOVUxMICYmIEZlYXR1cmVQY2RHZXQgKFBjZFVnYUNvbnN1bWVTdXBwb3J0 KSkgew0KLSAgICAgICAgU3RhdHVzID0gVWdhRHJhdy0+Qmx0ICgNCi0gICAgICAgICAgICAgICAg ICAgICAgICAgICAgVWdhRHJhdywNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKEVGSV9V R0FfUElYRUwgKikgQmx0LA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBFZmlVZ2FCbHRC dWZmZXJUb1ZpZGVvLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLA0KLSAgICAgICAg ICAgICAgICAgICAgICAgICAgICAwLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAoVUlO VE4pIERlc3RYLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAoVUlOVE4pIERlc3RZLA0K LSAgICAgICAgICAgICAgICAgICAgICAgICAgICBXaWR0aCwNCi0gICAgICAgICAgICAgICAgICAg ICAgICAgICAgSGVpZ2h0LA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBXaWR0aCAqIHNp emVvZiAoRUZJX1VHQV9QSVhFTCkNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsNCi0g ICAgICB9IGVsc2Ugew0KLSAgICAgICAgU3RhdHVzID0gRUZJX1VOU1VQUE9SVEVEOw0KLSAgICAg IH0NCi0NCi0gICAgICAvLw0KLSAgICAgIC8vI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ZGVvVG9CbHRCdWZmZXIsDQot ICAgICAgICAgICAgICAgICAgICAgICAgICBMb2dvRGVzdFgsDQotICAgICAgICAgICAgICAgICAg ICAgICAgICBMb2dvRGVzdFksDQotICAgICAgICAgICAgICAgICAgICAgICAgICAwLA0KLSAgICAg ICAgICAgICAgICAgICAgICAgICAgMCwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgIExvZ29X aWR0aCwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgIExvZ29IZWlnaHQsDQotICAgICAgICAg ICAgICAgICAgICAgICAgICBMb2dvV2lkdGggKiBzaXplb2YgKEVGSV9HUkFQSElDU19PVVRQVVRf QkxUX1BJWEVMKQ0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgKTsNCi0gICAgfSBlbHNlIGlm IChVZ2FEcmF3ICE9IE5VTEwgJiYgRmVhdHVyZVBjZEdldCAoUGNkVWdhQ29uc3VtZVN1cHBvcnQp KSB7DQotICAgICAgU3RhdHVzID0gVWdhRHJhdy0+Qmx0ICgNCi0gICAgICAgICAgICAgICAgICAg ICAgICAgIFVnYURyYXcsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAoRUZJX1VHQV9QSVhF TCAqKSBMb2dvQmx0LA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgRWZpVWdhVmlkZW9Ub0Js dEJ1ZmZlciwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgIExvZ29EZXN0WCwNCi0gICAgICAg ICAgICAgICAgICAgICAgICAgIExvZ29EZXN0WSwNCi0gICAgICAgICAgICAgICAgICAgICAgICAg IDAsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAwLA0KLSAgICAgICAgICAgICAgICAgICAg ICAgICAgTG9nb1dpZHRoLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nb0hlaWdodCwN Ci0gICAgICAgICAgICAgICAgICAgICAgICAgIExvZ29XaWR0aCAqIHNpemVvZiAoRUZJX1VHQV9Q SVhFTCkNCi0gICAgICAgICAgIC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BldmVyeSBkcml2ZXIgdGhlIGRyaXZlciBvcHRpb24gZGV2aWNlIHBhdGgg cG9pbnQgdG8uDQotDQotICBAcGFyYW0gIEJkc0RyaXZlckxpc3RzICAgICAgICBUaGUgaGVhZGVy IG9mIHRoZSBjdXJyZW50IGRyaXZlciBvcHRpb24gbGluayBsaXN0DQotDQotKiovDQotVk9JRA0K LUVGSUFQSQ0KLUJkc0xpYkxvYWREcml2ZXJzICgNCi0gIElOIExJU1RfRU5UUlkgICAgICAgICAg ICAgICAgICAgKkJkc0RyaXZlckxpc3RzDQotICApDQotew0KLSAgRUZJX1NUQVRVUyAgICAgICAg ICAgICAgICBTdGF0dXM7DQotICBMSVNUX0VOVFJZICAgICAgICAgICAgICAgICpMaW5rOw0KLSAg QkRTX0NPTU1PTl9PUFRJT04gICAgICAgICAqT3B0aW9uOw0KLSAgRUZJX0hBTkRMRSAgICAgICAg ICAgICAgICBJbWFnZUhhbmRsZTsNCi0gIEVGSV9MT0FERURfSU1BR0VfUFJPVE9DT0wgKkltYWdl SW5mbzsNCi0gIFVJTlROICAgICAgICAgICAgICAgICAgICAgRXhpdERhdGFTaXplOw0KLSAgQ0hB UjE2ICAgICAgICAgICAgICAgICAgICAqRXhpdERhdGE7DQotICBCT09MRUFOICAgICAgICAgICAg ICAgICAgIFJlY29ubmVjdEFsbDsNCi0NCi0gIFJlY29ubmVjdEFsbCA9IEZBTFNFOw0KLQ0KLSAg Ly8NCi0gIC8vIFByb2Nlc3MgdGhlIGRyaXZlciBvcHRpb24NCi0gIC8vDQotICBmb3IgKExpbmsg PSBCZHNEcml2ZXJMaXN0cy0+Rm9yd2FyZExpbms7IExpbmsgIT0gQmRzRHJpdmVyTGlzdHM7IExp bmsgPSBMaW5rLT5Gb3J3YXJkTGluaykgew0KLSAgICBPcHRpb24gPSBDUiAoTGluaywgQkRTX0NP TU1PTl9PUFRJT04sIExpbmssIEJEU19MT0FEX09QVElPTl9TSUdOQVRVUkUpOw0KLSAgICANCi0g ICAg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cw0KLSAgICAvLw0KLSAgICBTdGF0dXMgPSBnQlMtPkxvYWRJbWFnZSAoDQotICAgICAg ICAgICAgICAgICAgICBGQUxTRSwNCi0gICAgICAgICAgICAgICAgICAgIGdJbWFnZUhhbmRsZSwN Ci0gICAgICAgICAgICAgICAgICAgIE9wdGlvbi0+RGV2aWNlUGF0aCwNCi0gICAgICAgICAgICAg ICAgICAgIE5VTEwsDQotICAgICAgICAgICAgICAgICAgICAwLA0KLSAgICAgICAgICAgICAgICAg ICAgJkltYWdlSGFuZGxlDQotICAgICAgICAgICAgICAgICAgICApOw0KLQ0KLSAgICBpZiAoIUVG SV9FUlJPUiAoU3RhdHVzKSkgew0KLSAgICAgIGdCUy0+SGFuZGxlUHJvdG9jb2wgKEltYWdlSGFu ZGxlLCAmZ0VmaUxvYWRlZEltYWdlUHJvdG9jb2xHdWlkLCAoVk9JRCAqKikgJkltYWdlSW5mbyk7 DQotDQotICAgICAgLy8NCi0gICAgICAvLyBWZXJpZnkgd2hldGhlciB0aGlzIGltYWdlIGlzIGEg ZHJpdmVyLCBpZiBub3QsDQotICAgICAgLy8gZXhpdCBpdCBhbmQgY29udGludWUgdG8gcGFyc2Ug bmV4dCBsb2FkIG9wdGlvbg0KLSAgICAgIC8vDQotICAgICAgaWYgKEltYWdlSW5mby0+SW1hZ2VD b2RlVHlwZSAhPSBFZmlCb290U2VydmljZXNDb2RlICYmIEltYWdlSW5mby0+SW1hZ2VDb2RlVHlw ZSAhPSBFZmlSdW50aW1lU2VydmljZXNDb2RlKSB7DQotICAgICAgICBnQlMtPkV4aXQgKEltYWdl SGFuZGxlLCBFRklfSU5WQUxJRF9QQVJBTUVURVIsIDAsIE5VTEwpOw0KLSAgICAgICAgY29udGlu dWU7DQotICAgICAgfQ0KLQ0KLSAgICAgIGlmIChPcHRpb24tPkxvYWRPcHRpb25zU2l6ZSAhPSAw KSB7DQotICAgICAgICBJbWFnZUluZm8tPkxvYWRPcHRpb25zU2l6ZSAgPSBPcHRpb24t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b3IgZHJpdmVyIyMjIw0KLSAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9uIHByZXNlbnQNCi0gIEBwYXJhbSAgU3Ry aW5nICAgICAgICAgICAgICAgIFRoZSBkZXNjcmlwdGlvbiBvZiB0aGUgYm9vdCMjIyMgb3IgZHJp dmVyIyMjIw0KLSAgQHBhcmFtICBWYXJpYWJsZU5hbWUgICAgICAgICAgSW5kaWNhdGUgaWYgdGhl IGJvb3QjIyMjIG9yIGRyaXZlciMjIyMgb3B0aW9uDQotDQotICBAcmV0dmFsIEVGSV9TVUNDRVNT ICAgICAgICAgICBUaGUgYm9vdCMjIyMgb3IgZHJpdmVyIyMjIyBoYXZlIGJlZW4gc3VjY2Vzcw0K LSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVnaXN0ZXJlZA0KLSAgQHJldHZhbCBF RklfU1RBVFVTICAgICAgICAgICAgUmV0dXJuIHRoZSBzdGF0dXMgb2YgZ1JULT5TZXRWYXJpYWJs ZSAoKS4NCi0NCi0qKi8NCi1FRklfU1RBVFVTDQotRUZJQVBJDQotQmRzTGliUmVnaXN0ZXJOZXdP cHRpb24gKA0KLSAgSU4gIExJU1RfRU5UUlkgICAgICAgICAgICAgICAgICAgICAqQmRzT3B0aW9u TGlzdCwNCi0gIElOICBFRklfREVWSUNFX1BBVEhfUFJPVE9DT0wgICAgICAgKkRldmljZVBhdGgs DQotICBJTiAgQ0hBUjE2ICAgICAgICAgICAgICAgICAgICAgICAgICpTdHJpbmcsDQotICBJTiAg Q0hBUjE2ICAgICAgICAgICAgICAgICAgICAgICAgICpWYXJpYWJsZU5hbWUNCi0gICkNCi17DQot ICBFRklfU1RBVFVTICAgICAgICAgICAgICAgIFN0YXR1czsNCi0gIFVJTlROICAgICAgICAgICAg ICAgICAgICAgSW5kZXg7DQotICBVSU5UMTYgICAgICAgICAgICAgICAgICAgIFJlZ2lzdGVyT3B0 aW9uTnVtYmVyOw0KLSAgVUlOVDE2ICAgICAgICAgICAgICAgICAgICAqVGVtcE9wdGlvblB0cjsN Ci0gIFVJTlROICAgICAgICAgICAgICAgICAgICAgVGVtcE9wdGlvblNpemU7DQotICBVSU5UMTYg ICAgICAgICAgICAgICAgICAgICpPcHRpb25PcmRlclB0cjsNCi0gIFZPSUQgICAgICAgICAgICAg ICAgICAgICAgKk9wdGlvblB0cjsNCi0gIFVJTlROICAgICAgICAgICAgICAgICAgICAgT3B0aW9u U2l6ZTsNCi0gIFVJTlQ4ICAgICAgICAgICAgICAgICAgICAgKlRlbXBQdHI7DQotICBFRklfREVW SUNFX1BBVEhfUFJPVE9DT0wgICpPcHRpb25EZXZpY2VQYXRoOw0KLSAgQ0hBUjE2ICAgICAgICAg ICAgICAgICAgICAqRGVzY3JpcHRpb247DQotICBDSEFSMTYgICAgICAgICAgICAgICAgICAgIE9w dGlvbk5hbWVbMTBdOw0KLSAgQk9PTEVBTiAgICAgICAgICAgICAgICAgICBVcGRhdGVEZXNjcmlw dGlvbjsNCi0gIFVJTlQxNiAgICAgICAgICAgICAgICAgICAgQm9vdE9yZGVyRW50cnk7DQotICBV SU5UTiAgICAgICAgICAgICAgICAgICAgIE9yZGVySXRlbU51bTsNCi0NCi0gIGlmIChEZXZpY2VQ YXRoID09IE5VTEwpIHsNCi0gICAgcmV0dXJuIEVGSV9JTlZBTElEX1BBUkFNRVRFUjsNCi0gIH0N Ci0NCi0gIE9wdGlvblB0ciAgICAgICAgICAgICA9IE5VTEw7DQotICBPcHRpb25TaXplICAgICAg ICAgICAgPSAwOw0KLSAgVGVtcFB0ciAgICAgICAgICAgICAgID0gTlVMTDsNCi0gIE9wdGlvbkRl dmljZVBhdGggICAgICA9IE5VTEw7DQotICBEZXNjcmlwdGlvbiAgICAgICAgICAgPSBOVUxMOw0K LSAgT3B0aW9uT3JkZXJQdHIgICAgICAgID0gTlVMTDsNCi0gIFVwZGF0ZURlc2NyaXB0aW9uICAg ICA9IEZBTFNFOw0KLSAgU3RhdHVzICAgICAgICA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XBPcHRp b25QdHJbSW5kZXhdKTsNCi0gICAgfQ0KLQ0KLSAgICBPcHRpb25QdHIgPSBCZHNMaWJHZXRWYXJp YWJsZUFuZFNpemUgKA0KLSAgICAgICAgICAgICAgICAgIE9wdGlvbk5hbWUsDQotICAgICAgICAg ICAgICAgICAgJmdFZmlHbG9iYWxWYXJpYWJsZUd1aWQsDQotICAgICAgICAgICAgICAgICAgJk9w dGlvblNpemUNCi0gICAgICAgICAgICAgICAgICApOw0KLSAgICBpZiAoT3B0aW9uUHRyID09IE5V TEwpIHsNCi0gICAgICBjb250aW51ZTsNCi0gICAgfQ0KLQ0KLSAgICAvLw0KLSAgICAvLyBWYWxp ZGF0ZSB0aGUgdmFyaWFibGUuDQotICAgIC8vDQotICAgIGlmICghVmFsaWRhdGVPcHRpb24oT3B0 aW9uUHRyLCBPcHRpb25TaXplKSkgew0KLSAgICAgIEZyZWVQb29sKE9wdGlvblB0cik7DQotICAg ICAgY29udGludWU7DQotICAgIH0NCi0NCi0gICAgVGVtcFB0ciAgICAgICAgID0gICBPcHRpb25Q dHI7DQotICAgIFRlbXBQdHIgICAgICAgICArPSAgc2l6ZW9mIChVSU5UMzIpICsgc2l6ZW9mIChV SU5UMTYpOw0KLSAgICBEZXNjcmlwdGlvbiAgICAgPSAgIChDSEFSMTYgKikgVGVtcFB0cjsNCi0g ICAgVGVtcFB0ciAgICAgICAgICs9ICBTdHJTaXplICgoQ0hBUjE2ICopIFRlbXBQdHIpOw0KLSAg ICBPcHRpb25EZXZpY2VQYXRoID0gIChFRklfREVWSUNFX1BBVEhfUFJPVE9DT0wgKikgVGVtcFB0 cjsNCi0NCi0gICAgLy8NCi0gICAgLy8gTm90ZXM6IHRoZSBkZXNjcmlwdGlvbiBtYXkgd2lsbCBj aGFuZ2UgYmFzZSBvbiB0aGUgR2V0U3RyaW5nVG9rZW4NCi0gICAgLy8NCi0gICAgaWYgKENvbXBh cmVNZW0gKE9wdGlvbkRldmljZVBhdGgsIERldmljZVBhdGgsIEdldERldmljZVBhdGhTaXplIChP cHRpb25EZXZpY2VQYXRoKSkgPT0gMCkgew0KLSAgICAgIGlmIChDb21wYXJlTWVtIChEZXNjcmlw dGlvbiwgU3RyaW5nLCBTdHJTaXplIChEZXNjcmlwdGlvbikpID09IDApIHsgDQotICAgICAgICAv Lw0KLSAgICAgICAgLy8gR290IHRoZSBvcHRpb24sIHNvIGp1c3QgcmV0dXJuDQotICAgICAgICAv Lw0KLSAgICAgICAgRnJlZVBvb2wgKE9wdGlvblB0cik7DQotICAgICAgICBGcmVlUG9vbCAoVGVt cE9wdGlvblB0cik7DQotICAgICAgICByZXR1cm4gRUZJX1NVQ0NFU1M7DQotICAgICAgfSBlbHNl IHsNCi0gICAgICAgIC8vDQotICAgICAgICAvLyBPcHRpb24gZGVzY3JpcHRpb24gY2hhbmdlZCwg bmVlZCB1cGRhdGUuDQotICAgICAgICAvLw0KLSAgICAgICAgVXBkYXRlRGVzY3JpcHRpb24gPSBU UlVFOw0KLSAgICAgICAgRnJlZVBvb2wgKE9wdGlvblB0cik7DQotICAgICAgICBicmVhazsNCi0g ICAgICB9DQotICAgIH0NCi0NCi0gICAgRnJlZVBvb2wgKE9wdGlvblB0cik7DQotICB9DQotDQot ICBPcHRpb25TaXplICAgICAgICAgID0gc2l6ZW9mIChVSU5UMzIpICsgc2l6ZW9mIChVSU5UMTYp ICsgU3RyU2l6ZSAoU3RyaW5nKTsNCi0gIE9wdGlvblNpemUgICAgICAgICAgKz0gR2V0RGV2aWNl UGF0aFNpemUgKERldmljZVBhdGgpOw0KLSAgT3B0aW9uUHRyICAgICAgICAgICA9IEFsbG9jYXRl WmVyb1Bvb2wgKE9wdGlvblNpemUpOw0KLSAgQVNTRVJUIChPcHRpb25QdHIgIT0gTlVMTCk7DQot ICANCi0gIFRlbXBQdHIgICAgICAgICAgICAgPSBPcHRpb25QdHI7DQotICAqKFVJTlQzMiAqKSBU ZW1wUHRyID0gTE9BRF9PUFRJT05fQUNUSVZFOw0KLSA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XRoIG5vZGUuIElmIERldmljZVBhdGggDQotICBpcyBOVUxMLCB0aGVuIDAgaXMgcmV0dXJu ZWQuIElmIHRoZSBsZW5ndGggb2YgdGhlIGRldmljZSBwYXRoIGlzIGJpZ2dlciB0aGFuDQotICBN YXhTaXplLCBhbHNvIHJldHVybiAwIHRvIGluZGljYXRlIHRoaXMgaXMgYW4gaW52YWxpZGF0ZSBk ZXZpY2UgcGF0aC4NCi0NCi0gIEBwYXJhbSAgRGV2aWNlUGF0aCAgICAgICAgIEEgcG9pbnRlciB0 byBhIGRldmljZSBwYXRoIGRhdGEgc3RydWN0dXJlLg0KLSAgQHBhcmFtICBNYXhTaXplICAgICAg ICAgICAgTWF4IHZhbGlkIGRldmljZSBwYXRoIHNpemUuIElmIGJpZyB0aGFuIHRoaXMgc2l6ZSwg DQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZXJyb3IuDQotICANCi0gIEBy ZXR2YWwgMCAgICAgICAgICAgICAgICAgIEFuIGludmFsaWQgZGV2aWNlIHBhdGguDQotICBAcmV0 dmFsIE90aGVycyAgICAgICAgICAgICBUaGUgc2l6ZSBvZiBhIGRldmljZSBwYXRoIGluIGJ5dGVz Lg0KLQ0KLSoqLw0KLVVJTlRODQotR2V0RGV2aWNlUGF0aFNpemVFeCAoDQotICBJTiBDT05TVCBF RklfREVWSUNFX1BBVEhfUFJPVE9DT0wgICpEZXZpY2VQYXRoLA0KLSAgSU4gVUlOVE4gICAgICAg ICAgICAgICAgICAgICAgICAgICBNYXhTaXplDQotICApDQotew0KLSAgVUlOVE4gIFNpemU7DQot ICBVSU5UTiAgTm9kZVNpemU7DQotDQotICBpZiAoRGV2aWNlUGF0aCA9PSBOVUxMKSB7DQotICAg IHJldHVybiAwOw0KLSAgfQ0KLQ0KLSAgLy8NCi0gIC8vIFNlYXJjaCBmb3IgdGhlIGVuZCBvZiB0 aGUgZGV2aWNlIHBhdGggc3RydWN0dXJlDQotICAvLw0KLSAgU2l6ZSA9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IGlmIGl0IGlzIGJvb3QjIyMjIG9yDQotICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBkcml2ZXIjIyMjDQotDQotICBAcmV0dmFsIEJEU19DT01NT05fT1BUSU9OICAg ICBHZXQgdGhlIG9wdGlvbiBqdXN0IGJlZW4gY3JlYXRlZA0KLSAgQHJldHZhbCBOVUxMICAgICAg ICAgICAgICAgICAgRmFpbGVkIHRvIGdldCB0aGUgbmV3IG9wdGlvbg0KLQ0KLSoqLw0KLUJEU19D T01NT05fT1BUSU9OICoNCi1FRklBUEkNCi1CZHNMaWJWYXJpYWJsZVRvT3B0aW9uICgNCi0gIElO IE9VVCBMSVNUX0VOVFJZICAgICAgICAgICAgICAgICAgICpCZHNDb21tb25PcHRpb25MaXN0LA0K LSAgSU4gIENIQVIxNiAgICAgICAgICAgICAgICAgICAgICAgICAgKlZhcmlhYmxlTmFtZQ0KLSAg KQ0KLXsNCi0gIFVJTlQzMiAgICAgICAgICAgICAgICAgICAgQXR0cmlidXRlOw0KLSAgVUlOVDE2 ICAgICAgICAgICAgICAgICAgICBGaWxlUGF0aFNpemU7DQotICBVSU5UOCAgICAgICAgICAgICAg ICAgICAgICpWYXJpYWJsZTsNCi0gIFVJTlQ4ICAgICAgICAgICAgICAgICAgICAgKlRlbXBQdHI7 DQotICBVSU5UTiAgICAgICAgICAgICAgICAgICAgIFZhcmlhYmxlU2l6ZTsNCi0gIEVGSV9ERVZJ Q0VfUEFUSF9QUk9UT0NPTCAgKkRldmljZVBhdGg7DQotICBCRFNfQ09NTU9OX09QVElPTiAgICAg ICAgICpPcHRpb247DQotICBWT0lEICAgICAgICAgICAgICAgICAgICAgICpMb2FkT3B0aW9uczsN Ci0gIFVJTlQzMiAgICAgICAgICAgICAgICAgICAgTG9hZE9wdGlvbnNTaXplOw0KLSAgQ0hBUjE2 ICAgICAgICAgICAgICAgICAgICAqRGVzY3JpcHRpb247DQotICBVSU5UOCAgICAgICAgICAgICAg ICAgICAgIE51bU9mZjs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gICAgICAgICAgICAgICAgICAgICAgc3RydWN0dXJlLg0KLSAgQHBhcmFtICBT aW5nbGUgICAgICAgICAgICAgICAgQSBwb2ludGVyIHRvIGEgc2luZ2xlLWluc3RhbmNlIGRldmlj ZSBwYXRoIGRhdGENCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdHVyZS4N Ci0NCi0gIEByZXR1cm4gVGhpcyBmdW5jdGlvbiB3aWxsIHJlbW92ZSB0aGUgZGV2aWNlIHBhdGgg aW5zdGFuY2VzIGluIE11bHRpIHdoaWNoIHBhcnRseQ0KLSAgICAgICAgICBtYXRjaCB3aXRoIHRo ZSBTaW5nbGUsIGFuZCByZXR1cm4gdGhlIHJlc3VsdCBkZXZpY2UgcGF0aC4gSWYgdGhlcmUgaXMg bm8NCi0gICAgICAgICAgcmVtYWluaW5nIGRldmljZSBwYXRoIGFzIGEgcmVzdWx0LCB0aGlzIGZ1 bmN0aW9uIHdpbGwgcmV0dXJuIE5VTEwuDQotDQotKiovDQotRUZJX0RFVklDRV9QQVRIX1BST1RP Q09MICoNCi1FRklBUEkNCi1CZHNMaWJEZWxQYXJ0TWF0Y2hJbnN0YW5jZSAoDQotICBJTiAgICAg RUZJX0RFVklDRV9QQVRIX1BST1RPQ09MICAqTXVsdGksDQotICBJTiAgICAgRUZJX0RFVklDRV9Q QVRIX1BST1RPQ09MICAqU2luZ2xlDQotICApDQotew0KLSAgRUZJX0RFVklDRV9QQVRIX1BST1RP Q09MICAqSW5zdGFuY2U7DQotICBFRklfREVWSUNFX1BBVEhfUFJPVE9DT0wgICpOZXdEZXZpY2VQ YXRoOw0KLSAgRUZJX0RFVklDRV9QQVRIX1BST1RPQ09MICAqVGVtcE5ld0RldmljZVBhdGg7DQot ICBVSU5UTiAgICAgICAgICAgICAgICAgICAgIEluc3RhbmNlU2l6ZTsNCi0gIFVJTlROICAgICAg ICAgICAgICAgICAgICAgU2luZ2xlRHBTaXplOw0KLSAgVUlOVE4gICAgICAgICAg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ID0gVGhpc0ZpbGUtPkdldEluZm8gKA0KLSAgICAgICAgICAgICAgICAg ICAgICAgICBUaGlzRmlsZSwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgJmdFZmlGaWxlSW5m b0d1aWQsDQotICAgICAgICAgICAgICAgICAgICAgICAgICZCdWZmZXJTaXplLA0KLSAgICAgICAg ICAgICAgICAgICAgICAgICBJbmZvDQotICAgICAgICAgICAgICAgICAgICAgICAgICk7DQotICAg IGlmICghRUZJX0VSUk9SIChTdGF0dXMpKSB7DQotICAgICAgYnJlYWs7DQotICAgIH0NCi0gICAg aWYgKFN0YXR1cyAhPSBFRklfQlVGRkVSX1RPT19TTUFMTCkgew0KLSAgICAgIEZyZWVQb29sIChJ bmZvKTsNCi0gICAgICBnb3RvIERvbmU7DQotICAgIH0NCi0gICAgRnJlZVBvb2wgKEluZm8pOw0K LSAgfSB3aGlsZSAoVFJVRSk7DQotDQotICBGaWxlU2l6ZSA9IEluZm8tPkZpbGVTaXplOw0KLSAg RnJlZVBvb2wgKEluZm8pOw0KLQ0KLSAgLy8NCi0gIC8vIFJlYWQgZG9zIGhlYWRlcg0KLSAgLy8N Ci0gIEJ1ZmZlclNpemUgPSBzaXplb2YgKEVGSV9JTUFHRV9ET1NfSEVBREVSKTsNCi0gIFN0YXR1 cyA9IFRoaXNGaWxlLT5SZWFkIChUaGlzRmlsZSwgJkJ1ZmZlclNpemUsIERvc0hlYWRlcik7DQot ICBpZiAoRUZJX0VSUk9SIChTdGF0dXMpIHx8DQotICAgICAgQnVmZmVyU2l6ZSA8IHNpemVvZiAo RUZJX0lNQUdFX0RPU19IRUFERVIpIHx8DQotICAgICAgRmlsZVNpemUgPD0gRG9zSGVhZGVyLT5l X2xmYW5ldyB8fA0KLSAgICAgIERvc0hlYWRlci0+ZV9tYWdpYyAhPSBFRklfSU1BR0VfRE9TX1NJ R05BVFVSRSkgew0KLSAgICBTdGF0dXMgPSBFRklfTE9BRF9FUlJPUjsNCi0gICAgZ290byBEb25l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9MT0FEX0VSUk9SOw0KLSAgICBnb3RvIERvbmU7DQotICB9DQotDQotIERv bmU6DQotICBpZiAoVGhpc0ZpbGUgIT0gTlVMTCkgew0KLSAgICBUaGlzRmlsZS0+Q2xvc2UgKFRo aXNGaWxlKTsNCi0gIH0NCi0gIGlmIChSb290ICE9IE5VTEwpIHsNCi0gICAgUm9vdC0+Q2xvc2Ug KFJvb3QpOw0KLSAgfQ0KLSAgcmV0dXJuIFN0YXR1czsNCi19DQotDQotLyoqDQotICBUaGlzIHJv dXRpbmUgYWRqdXN0IHRoZSBtZW1vcnkgaW5mb3JtYXRpb24gZm9yIGRpZmZlcmVudCBtZW1vcnkg dHlwZSBhbmQgDQotICBzYXZlIHRoZW0gaW50byB0aGUgdmFyaWFibGVzIGZvciBuZXh0IGJvb3Qu DQotKiovDQotVk9JRA0KLUJkc1NldE1lbW9yeVR5cGVJbmZvcm1hdGlvblZhcmlhYmxlICgNCi0g IFZPSUQNCi0gICkNCi17DQotICBFRklfU1RBVFVTICAgICAgICAgICAgICAgICAgIFN0YXR1czsN Ci0gIEVGSV9NRU1PUllfVFlQRV9JTkZPUk1BVElPTiAgKlByZXZpb3VzTWVtb3J5VHlwZUluZm9y bWF0aW9uOw0KLSAgRUZJX01FTU9SWV9UWVBFX0lORk9STUFUSU9OICAqQ3VycmVudE1lbW9yeVR5 cGVJbmZvcm1hdGlvbjsNCi0gIFVJTlROICAgICAgICAgICAgICAgICAgICAgICAgVmFyaWFibGVT aXplOw0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgICBJbmRleDsNCi0gIFVJTlROICAg ICAgICAgICAgICAgICAgICAgICAgSW5kZXgxOw0KLSAgVUlOVDMyICAgICAgICAgICAgICAgICAg ICAgICBQcmV2aW91czsNCi0gIFVJTlQzMiAgICAgICAgICAgICAgICAgICAgICAgQ3VycmVudDsN Ci0gIFVJTlQzMiAgICAgICAgICAgICAgICAgICAgICAgTmV4dDsNCi0gIEVGSV9IT0JfR1VJRF9U W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ICAgICAgICAgICAgICAg ICAgICAgICAgICAgIG9yIEVGSV9WQVJJQUJMRV9USU1FX0JBU0VEX0FVVEhFTlRJQ0FURURfV1JJ VEVfQUNFU1MgYmVpbmcgc2V0LCBidXQgdGhlIEF1dGhJbmZvIA0KLSAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGRvZXMgTk9UIHBhc3MgdGhlIHZhbGlkYXRpb24gY2hlY2sgY2Fycmll ZCBvdXQgYnkgdGhlIGZpcm13YXJlLg0KLQ0KLSAgQHJldHZhbCBFRklfTk9UX0ZPVU5EICAgICAg ICAgIFRoZSB2YXJpYWJsZSB0cnlpbmcgdG8gYmUgdXBkYXRlZCBvciBkZWxldGVkIHdhcyBub3Qg Zm91bmQuDQotKiovDQotRUZJX1NUQVRVUw0KLVNldFZhcmlhYmxlQW5kUmVwb3J0U3RhdHVzQ29k ZU9uRXJyb3IgKA0KLSAgSU4gQ0hBUjE2ICAgICAqVmFyaWFibGVOYW1lLA0KLSAgSU4gRUZJX0dV SUQgICAqVmVuZG9yR3VpZCwNCi0gIElOIFVJTlQzMiAgICAgQXR0cmlidXRlcywNCi0gIElOIFVJ TlROICAgICAgRGF0YVNpemUsDQotICBJTiBWT0lEICAgICAgICpEYXRhDQotICApDQotew0KLSAg RUZJX1NUQVRVUyAgICAgICAgICAgICAgICAgU3RhdHVzOw0KLSAgRURLSUlfU0VUX1ZBUklBQkxF X1NUQVRVUyAgKlNldFZhcmlhYmxlU3RhdHVzOw0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAg ICAgTmFtZVNpemU7DQotDQotICBTdGF0dXMgPSBnUlQtPlNldFZhcmlhYmxlICgNCi0gICAgICAg ICAgICAgICAgICBWYXJpYWJsZU5hbWUsDQotICAgICAgICAgICAgICAgICAgVmVuZG9yR3VpZCwN Ci0gICAgICAgICAgICAgICAgICBBdHRyaWJ1dGVzLA0KLSAgICAgICAgICAgICAgICAgIERhdGFT aXplLA0KLSAgICAgICAgICAgICAgICAgIERh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29sR3VpZCAgICAgICAgICAgICAgICAgICAjIyBTT01F VElNRVNfQ09OU1VNRVMNCi0gIGdFZmlTaW1wbGVOZXR3b3JrUHJvdG9jb2xHdWlkICAgICAgICAg ICAgICAgICAjIyBTT01FVElNRVNfQ09OU1VNRVMNCi0gIGdFZmlEZWJ1Z1BvcnRQcm90b2NvbEd1 aWQgICAgICAgICAgICAgICAgICAgICAjIyBTT01FVElNRVNfQ09OU1VNRVMNCi0gIGdFZmlTaW1w bGVUZXh0SW5Qcm90b2NvbEd1aWQgICAgICAgICAgICAgICAgICAjIyBDT05TVU1FUw0KLSAgZ0Vm aUJsb2NrSW9Qcm90b2NvbEd1aWQgICAgICAgICAgICAgICAgICAgICAgICMjIFNPTUVUSU1FU19D T05TVU1FUw0KLSAgZ0VmaUZpcm13YXJlVm9sdW1lMlByb3RvY29sR3VpZCAgICAgICAgICAgICAg ICMjIFNPTUVUSU1FU19DT05TVU1FUw0KLSAgZ0VmaUxlZ2FjeUJpb3NQcm90b2NvbEd1aWQgICAg ICAgICAgICAgICAgICAgICMjIFNPTUVUSU1FU19DT05TVU1FUw0KLSAgZ0VmaUNwdUFyY2hQcm90 b2NvbEd1aWQgICAgICAgICAgICAgICAgICAgICAgICMjIENPTlNVTUVTDQotICBnRWZpRGV2aWNl UGF0aFByb3RvY29sR3VpZCAgICAgICAgICAgICAgICAgICAgIyMgQ09OU1VNRVMNCi0gIGdFZmlB Y3BpUzNTYXZlUHJvdG9jb2xHdWlkICAgICAgICAgICAgICAgICAgICAjIyBTT01FVElNRVNfQ09O U1VNRVMNCi0gIGdFZmlHcmFwaGljc091dHB1dFByb3RvY29sR3VpZCAgICAgICAgICAgICAgICAj IyBTT01FVElNRVNfQ09OU1VNRVMNCi0gIGdFZmlVZ2FEcmF3UHJvdG9jb2xHdWlkIHxnRWZpTWRl UGtnVG9rZW5TcGFjZUd1aWQuUGNkVWdhQ29uc3VtZVN1cHBvcnQgIyMgU09NRVRJTUVTX0NPTlNV TUVTDQotIC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HB5Ig0KLSNzdHJpbmcgU1RSX0RFU0NSSVBUSU9O X0NEX0RWRCAgICAgICAgICNsYW5ndWFnZSBlbi1VUyAgIkVGSSBEVkQvQ0RST00iDQotICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI2xhbmd1YWdlIGZyLUZSICAiZnItRlI6 IEVGSSBEVkQvQ0RST00iDQotI3N0cmluZyBTVFJfREVTQ1JJUFRJT05fSEFSRERSSVZFICAgICAg I2xhbmd1YWdlIGVuLVVTICAiRUZJIEhhcmQgRHJpdmUiDQotICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgI2xhbmd1YWdlIGZyLUZSICAiZnItRlI6IEVGSSBIYXJkIERyaXZl Ig0KLSNzdHJpbmcgU1RSX0RFU0NSSVBUSU9OX1VTQiAgICAgICAgICAgICNsYW5ndWFnZSBlbi1V UyAgIkVGSSBVU0IgRGV2aWNlIg0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICNsYW5ndWFnZSBmci1GUiAgImZyLUZSOiBFRkkgVVNCIERldmljZSINCi0jc3RyaW5nIFNU Ul9ERVNDUklQVElPTl9TQ1NJICAgICAgICAgICAjbGFuZ3VhZ2UgZW4tVVMgICJFRkkgU0NTSSBE ZXZpY2UiDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI2xhbmd1YWdl IGZyLUZSICAiZnItRlI6IEVGSSBTQ1NJIERldmljZSINCi0jc3RyaW5nIFNUUl9ERVNDUklQVElP Tl9NSVNDICAgICAgICAgICAjbGFuZ3VhZ2UgZW4tVVMgICJFRkkgTWlzYyBEZXZpY2UiDQotICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI2xhbmd1YWdlIGZyLUZSICAiZnIt RlI6IEVGSSBNaXNjIERldmljZSINCi0jc3RyaW5nIFNUUl9ERVNDUklQVElPTl9ORVRXT1JLICAg ICAgICAjbGFuZ3VhZ2UgZW4tVVMg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NlLg0KLURFRklORSBGTEFTSF9BUkVBX0JB U0VfQUREUkVTUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSAweEZGODAwMDAwDQot REVGSU5FIEZMQVNIX0FSRUFfU0laRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA9IDB4MDA4MDAwMDANCitERUZJTkUgRkxBU0hfQkFTRSAgICAgICA9IDB4RkY4MDAwMDAg ICAgICNUaGUgYmFzZSBhZGRyZXNzIG9mIHRoZSA4TWIgRkxBU0ggRGV2aWNlLg0KK0RFRklORSBG TEFTSF9TSVpFICAgICAgID0gMHgwMDgwMDAwMCAgICAgI1RoZSBmbGFzaCBzaXplIGluIGJ5dGVz IG9mIHRoZSA4TWIgRkxBU0ggRGV2aWNlLg0KK0RFRklORSBGTEFTSF9CTE9DS19TSVpFID0gMHgx MDAwICAgICAgICAgI1RoZSBibG9jayBzaXplIGluIGJ5dGVzIG9mIHRoZSA4TWIgRkxBU0ggRGV2 aWNlLg0KK0RFRklORSBGTEFTSF9OVU1fQkxPQ0tTID0gMHg4MDAgICAgICAgICAgI1RoZSBudW1i ZXIgb2YgYmxvY2tzIGluIDhNYiBGTEFTSCBEZXZpY2UuDQogDQotREVGSU5FIEZMQVNIX1JFR0lP Tl9WTFZNSUNST0NPREVfT0ZGU0VUICAgICAgICAgICAgICAgICAgICAgICA9IDB4MDAwMDAwMDAN CitERUZJTkUgRkxBU0hfUkVHSU9OX1ZMVk1JQ1JPQ09ERV9PRkZTRVQgICAgICAgICAgICAgICAg ICAgICAgID0gMHgwMDQwMDAwMA0KIERFRklORSBGTEFTSF9SRUdJT05fVkxWTUlDUk9DT0RFX1NJ WkUgICAgICAgICAgICAgICAgICAgICAgICAgPSAweDAwMDQwMDAwDQogREVGSU5FIEZMQVNIX1JF R0lPTl9WTFZNSUNST0NPREVfQkFTRSAgICAgICAgICAgICAgICAgICAgICAgICA9IDB4RkZDMDAw MDANCiANCi1ERUZJTkUgRkxBU0hfUkVHSU9OX1ZQRF9PRkZTRVQgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID0gMHgwMDA0MDAwMA0KK0RFRklORSBGTEFTSF9SRUdJT05fVlBEX09GRlNF VCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSAweDAwNDQwMDAwDQogREVGSU5FIEZM QVNIX1JFR0lPTl9WUERfU0laRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IDB4 MDAwM0UwMDANCiANCi1ERUZJTkUgRkxBU0hfUkVHSU9OX05WU1RPUkFHRV9TVUJSRUdJT05fTlZf RlRXX1dPUktJTkdfT0ZGU0VUID0gMHgwMDA3RTAwMA0KK0RFRklORSBGTEFTSF9SRUdJT05fTlZT VE9SQUdFX1NVQlJFR0lPTl9OVl9GVFdfV09SS0lOR19PRkZTRVQgPSAweDAwNDdFMDAwDQogREVG SU5FIEZMQVNIX1JFR0lPTl9OVlNUT1JBR0VfU1VCUkVHSU9OX05WX0ZUV19XT1JLSU5HX1NJWkUg ICA9IDB4MDAwMDIwMDANCiANCiANCi1ERUZJTkUgRkxBU0hfUkVHSU9OX05WU1RPUkFHRV9TVUJS RUdJT05fTlZfRlRXX1NQQVJFX09GRlNFVCAgID0gMHgwMDA4MDAwMA0KK0RFRklORSBGTEFTSF9S RUdJT05fTlZTVE9SQUdFX1NVQlJFR0lPTl9OVl9GVFdfU1BBUkVfT0ZGU0VUICAgPSAweDAwNDgw MDAwDQogREVGSU5FIEZMQVNIX1JFR0lPTl9OVlNUT1JBR0VfU1VCUkVHSU9OX05WX0ZUV19TUEFS RV9TSVpFICAgICA9IDB4MDAwNDAwMDANCiANCi1ERUZJTkUgRkxBU0hfUkVHSU9OX0ZWTUFJTl9P RkZTRVQgICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gMHgwMDExMDAwMA0KLURFRklORSBG TEFTSF9SRUdJT05fRlZNQUlOX1NJWkUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSAw eDAwMjE1MDAwDQorREVGSU5FIEZMQVNIX1JFR0lPTl9GVk1BSU5fT0ZGU0VUICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA9IDB4MDA1MTAwMDANCitERUZJTkUgRkxBU0hfUkVHSU9OX0ZWTUFJ Tl9TSVpFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gMHgwMDIxMDAwMA0KIA0KLURF RklORSBGTEFTSF9SRUdJT05fRlZfUkVDT1ZFUlkyX09GRlNFVCAgICAgICAgICAgICAgICAgICAg ICAgPSAweDAwMzI1MDAwDQotREVGSU5FIEZMQVNIX1JFR0lPTl9GVl9SRUNPVkVSWTJfU0laRSAg ICAgICAgICAgICAgICAgICAgICAgICA9IDB4MDAwNkIwMDANCitERUZJTkUgRkxBU0hfUkVHSU9O X0ZWX1JFQ09WRVJZMl9PRkZTRVQgICAgICAgICAgICAgICAgICAgICAgID0gMHgwMDcyMDAwMA0K K0RFRklORSBGTEFTSF9SRUdJT05fRlZfUkVDT1ZFUlkyX1NJWkUgICAgICAgICAgICAgICAgICAg ICAgICAgPSAweDAwMDcwMDAwDQogDQotREVGSU5FIEZMQVNIX1JFR0lPTl9GVl9SRUNPVkVSWV9P RkZTRVQgICAgICAgICAgICAgICAgICAgICAgICA9IDB4MDAzOTAwMDANCitERUZJTkUgRkxBU0hf UkVHSU9OX0ZWX1JFQ09WRVJZX09GRlNFVCAgICAgICAgICAgICAgICAgICAgICAgID0gMHgwMDc5 MDAwMA0KIERFRklORSBGTEFTSF9SRUdJT05fRlZfUkVDT1ZFUllfU0laRSAgICAgICAgICAgICAg ICAgICAgICAgICAgPSAweDAwMDcwMDAwDQogDQogIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMNCkBA IC02Miw4ICs2MCwxMSBAQCBbRkQuVmx2XQ0KICMNCiAjRmxhc2ggbG9jYXRpb24gb3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i0NCi0g IENvcHlyaWdodCAoYykgMjAwNCAgLSAyMDE0LCBJbnRlbCBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0 cyByZXNlcnZlZC48QlI+DQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICANCg0KLSAgU1BEWC1M aWNlbnNlLUlkZW50aWZpZXI6IEJTRC0yLUNsYXVzZS1QYXRlbnQNCi0NCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIA0KDQotDQotDQotDQotKiovDQotDQotLyoqDQotICBUaGUgdXNlciBFbnRy eSBQb2ludCBmb3IgQXBwbGljYXRpb24uIFRoZSB1c2VyIGNvZGUgc3RhcnRzIHdpdGggdGhpcyBm dW5jdGlvbg0KLSAgYXMgdGhlIHJlYWwgZW50cnkgcG9pbnQgZm9yIHRoZSBpbWFnZSBnb2VzIGlu dG8gYSBsaWJyYXJ5IHRoYXQgY2FsbHMgdGhpcw0KLSAgZnVuY3Rpb24uDQotDQotICBAcGFyYW1b aW5dIEltYWdlSGFuZGxlICAgIFRoZSBmaXJtd2FyZSBhbGxvY2F0ZWQgaGFuZGxlIGZvciB0aGUg RUZJIGltYWdlLg0KLSAgQHBhcmFtW2luXSBTeXN0ZW1UYWJsZSAgICBBIHBvaW50ZXIgdG8gdGhl IEVGSSBTeXN0ZW0gVGFibGUuDQotDQotICBAcmV0dmFsIEVGSV9TVUNDRVNTICAgICAgIFRoZSBl bnRyeSBwb2ludCBpcyBleGVjdXRlZCBzdWNjZXNzZnVsbHkuDQotICBAcmV0dmFsIG90aGVyICAg ICAgICAgICAgIFNvbWUgZXJyb3Igb2NjdXJzIHdoZW4gZXhlY3V0aW5nIHRoaXMgZW50cnkgcG9p bnQuDQotDQotKiovDQotRUZJX1NUQVRVUw0KLUVGSUFQSQ0KLUluaXRpYWxpemVVc2VySW50ZXJm YWNlICgNCi0gIElOIEVGSV9IQU5ETEUgICAgICAgIEltYWdlSGFuZGxlLA0KLSAgSU4gRUZJX1NZ U1RFTV9UQUJMRSAgKlN5c3RlbVRhYmxlDQotICApDQotew0KLSAgcmV0dXJuIEVGSV9TVUNDRVNT Ow0KLX0NCmRpZmYgLS1naXQgYS9QbGF0Zm9ybS9JbnRlbC9WbHYyVGJsdERldmljZVBrZy9VaUFw cC9VaUFwcC5pbmYgYi9QbGF0Zm9ybS9JbnRlbC9WbHYyVGJsdERldmljZVBrZy9VaUFwcC9VaUFw cC5pbmYNCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NA0KaW5kZXggZjdhMGE4M2I4MC4uMDAwMDAw MDAwMA0KLS0tIGEvUGxhdGZvcm0vSW50ZWwvVmx2MlRibHREZXZpY2VQa2cvVWlBcHAvVWlBcHAu aW5mDQorKysgL2Rldi9udWxsDQpAQCAtMSwzMiArMCwwIEBADQotIw0KLSMNCi0jIENvcHlyaWdo dCAoYykgMjAxNCAtIDIwMTgsIEludGVsIENvcnBvcmF0aW9uLiBBbGwgcmlnaHRzIHJlc2VydmVk LjxCUj4NCi0jICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIA0KDQotIyBTUERYLUxpY2Vuc2UtSWRl bnRpZmllcjogQlNELTItQ2xhdXNlLVBhdGVudA0KLQ0KLSMgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgDQoNCi0jDQotIyMNCi0NCi1bRGVmaW5lc10NCi0gIElORl9WRVJTSU9OICAgICAgICAgICAg ICAgICAgICA9IDB4MDAwMTAwMDUNCi0gIEJBU0VfTkFNRSAgICAgICAgICAgICAgICAgICAgICA9 IFVpQXBwDQotICBGSUxFX0dVSUQgICAgICAgICAgICAgICAgICAgICAgPSA0NjJDQUEyMS03NjE0 LTQ1MDMtODM2RS04QUI2RjQ2NjIzMzENCi0gIE1PRFVMRV9UWVBFICAgICAgICAgICAgICAgICAg ICA9IFVFRklfQVBQTElDQVRJT04NCi0gIFZFUlNJT05fU1RSSU5HICAgICAgICAgICAgICAgICA9 IDEuMA0KLSAgRU5UUllfUE9JTlQgICAgICAgICAgICAgICAgICAgID0gSW5pdGlhbGl6ZVVzZXJJ bnRlcmZhY2UNCi0NCi0jDQotIyBUaGUgZm9sbG93aW5nIGluZm9ybWF0aW9uIGlzIGZvciByZWZl cmVuY2Ugb25seSBhbmQgbm90IHJlcXVpcmVkIGJ5IHRoZSBidWlsZCB0b29scy4NCi0jDQotIyAg VkFMSURfQVJDSElURUNUVVJFUyAgICAgICAgICAgPSBJQTMyIFg2NCBFQkMNCi0jDQotDQotW1Nv dXJjZXNdDQotICBGcm9udFBhZ2UuYw0KLQ0KLVtQYWNrYWdlc10NCi0gIE1kZVBrZy9NZGVQa2cu ZGVjDQotDQotW0xpYnJhcnlDbGFzc2VzXQ0KLSAgVWVmaUFwcGxpY2F0aW9uRW50cnlQb2ludA0K LS0gDQoyLjIxLjAud2luZG93cy4xDQoNCg==