From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 485D578003C for ; Fri, 10 Nov 2023 23:59:27 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=SYnpC+Wj//Udaj91533vWiko0fgw4wklaRi517yapoY=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1699660766; v=1; b=N/oYkCFMmG7swLMmNaPgE94tOg0dSDoaSr7AlDzTGKUR4kjMfa1OHta8smQVfDn3fnBNkacW 7NpELI22Yizx1oIGVn8AjtZjrUoxmoJKIApU97k2OVgMe/v/V1KC4rF4AZu9odsRuotznrbsaq1 kDNSYezg98Stg7F9M7ZAHtDs= X-Received: by 127.0.0.2 with SMTP id H2cMYY7687511xCLeUUWgNtK; Fri, 10 Nov 2023 15:59:26 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web11.42833.1699660764883146547 for ; Fri, 10 Nov 2023 15:59:25 -0800 X-Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-679-e9xGhhu6OmGjKDfQzMOPSw-1; Fri, 10 Nov 2023 18:59:21 -0500 X-MC-Unique: e9xGhhu6OmGjKDfQzMOPSw-1 X-Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D91371C0518D; Fri, 10 Nov 2023 23:59:20 +0000 (UTC) X-Received: from lacos-laptop-9.usersys.redhat.com (unknown [10.39.192.173]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9885CC15881; Fri, 10 Nov 2023 23:59:19 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Gerd Hoffmann , Jiewen Yao Subject: [edk2-devel] [PATCH 15/37] OvmfPkg: remove LegacyBiosDxe Date: Sat, 11 Nov 2023 00:57:58 +0100 Message-Id: <20231110235820.644381-16-lersek@redhat.com> In-Reply-To: <20231110235820.644381-1-lersek@redhat.com> References: <20231110235820.644381-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: S8H3i9AydQOflX5laa6Ss6bJx7686176AA= Content-Transfer-Encoding: base64 Content-Type: text/plain; charset="US-ASCII"; x-default=true X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b="N/oYkCFM"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io TGVnYWN5Qmlvc0R4ZSBpcyBub3QgdXNlZCBieSBhbnkgcGxhdGZvcm0gYXQgdGhpcyBwb2ludCwg cmVtb3ZlIGl0LgoKVGhpcyBwYXRjaCByZW1vdmVzIG1lbnRpb25zIG9mIHRoZSBmb2xsb3dpbmcg Q1NNIHJ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lDQotDQotW0d1aWRzLlg2NF0NCi0gIGdFZmlBY3BpMjBUYWJsZUd1aWQgICAgICAgICAgICAg ICAgICAgICAgICAgICAjIyBTT01FVElNRVNfQ09OU1VNRVMgIyNTeXN0ZW1UYWJsZQ0KLSAgZ0Vm aUFjcGkxMFRhYmxlR3VpZCAgICAgICAgICAgICAgICAgICAgICAgICAgICMjIFNPTUVUSU1FU19D T05TVU1FUyAjI1N5c3RlbVRhYmxlDQotDQotDQotW1Byb3RvY29sc10NCi0gIGdFZmlMb2FkZWRJ bWFnZVByb3RvY29sR3VpZCAgICAgICAgICAgICAgICAgICAjIyBTT01FVElNRVNfQ09OU1VNRVMN Ci0gIGdFZmlEZXZpY2VQYXRoUHJvdG9jb2xHdWlkICAgICAgICAgICAgICAgICAgICAjIyBTT01F VElNRVNfQ09OU1VNRVMNCi0gIGdFZmlQY2lSb290QnJpZGdlSW9Qcm90b2NvbEd1aWQgICAgICAg ICAgICAgICAjIyBTT01FVElNRVNfQ09OU1VNRVMNCi0gIGdFZmlDcHVBcmNoUHJvdG9jb2xHdWlk ICAgICAgICAgICAgICAgICAgICAgICAjIyBDT05TVU1FUw0KLSAgZ0VmaVRpbWVyQXJjaFByb3Rv Y29sR3VpZCAgICAgICAgICAgICAgICAgICAgICMjIENPTlNVTUVTDQotICBnRWZpSXNhSW9Qcm90 b2NvbEd1aWQgICAgICAgICAgICAgICAgICAgICAgICAgIyMgU09NRVRJTUVTX0NPTlNVTUVTDQot ICBnRWZpQmxvY2tJb1Byb3RvY29sR3VpZCAgICAgICAgICAgICAgICAgICAgICAgIyMgU09NRVRJ TUVTX0NPTlNVTUVTDQotICBnRWZpUGNpSW9Qcm90b2NvbEd1aWQgICAgICAgICAgICAgICAgICAg ICAgICAgIyMgU09NRVRJTUVTX0NPTlNVTUVTDQotICBnRWZpR2VuZXJpY01lbVRlc3RQcm90b2Nv bEd1aWQgICAgICAgICAgICAgICAgIyMgQ09OU1VNRVMNCi0gIGdFZmlEaXNrSW5m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3RlY3RlZCBt b2RlIElEVA0KLSAgVUlOVDMyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZsYXRTczsN Ci0gIFVJTlQzMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGbGF0RXNwOw0KLQ0KLSAg VUlOVDMyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvd0NvZGVTZWxlY3RvcjsgLy8g TG93IGNvZGUgc2VsZWN0b3IgaW4gR0RUDQotICBVSU5UMzIgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgTG93RGF0YVNlbGVjdG9yOyAvLyBMb3cgZGF0YSBzZWxlY3RvciBpbiBHRFQNCi0g IFVJTlQzMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb3dTdGFjazsNCi0gIERFU0NS SVBUT1IzMiAgICAgICAgICAgICAgICAgICAgICAgICBSZWFsTW9kZUlkdERlc2M7DQotDQotICAv Lw0KLSAgLy8gcmVhbC1tb2RlIEdEVCAodGVtcG9yYXJ5IEdEVCB3aXRoIHR3byByZWFsIG1vZGUg c2VnbWVudCBkZXNjcmlwdG9ycykNCi0gIC8vDQotICBHRFQzMiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgUmVhbE1vZGVHZHRbTlVNX1JFQUxfR0RUX0VOVFJJRVNdOw0KLSAgREVTQ1JJ UFRPUjMyICAgICAgICAgICAgICAgICAgICAgICAgIFJlYWxNb2RlR2R0RGVzYzsNCi0NCi0gIC8v DQotICAvLyBNZW1iZXJzIHNwZWNpZmljYWxseSBmb3IgdGhlIHJldmVyc2UgdGh1bmsNCi0gIC8v ICBUaGUgUmV2UmVhbCogbWVtYmVycyBhcmUgdXNlZCB0byBzdG9yZSB0aGUgY3VycmVudCBzdGF0 ZSBvZiByZWFsIG1vZGUNCi0gIC8vICBiZWZvcmUgcGVyZm9ybWluZyB0aGUgcmV2ZXJzZSB0aHVu ay4gIFRoZSBSZXZGbGF0KiBtZW1iZXJzIG11c3QgYmUgc2V0DQotICAvLyAgYmVmb3JlIGNhbGxp bmcgdGhlIHJldmVyc2UgdGh1bmsgYXNzZW1ibHkgY29kZS4NCi0gIC8vDQotICBVSU5UMTYgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgUmV2UmVhbERzOw0KLSAgVUlOVDE2ICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIFJldlJlYWxTczsNCi0gIFVJTlQzMiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBSZXZSZWFsRXNwOw0KLSAgREVTQ1JJUFRPUjMyICAgICAgICAgICAg ICAgICAgICAgICAgIFJldlJlYWxJZHREZXNjOw0KLSAgVUlOVDE2ICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIFJldkZsYXREYXRhU2VsZWN0b3I7IC8vIEZsYXQgZGF0YSBzZWxlY3RvciBp biBHRFQNCi0gIFVJTlQzMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXZGbGF0U3Rh Y2s7DQotDQotICAvLw0KLSAgLy8gQSBsb3cgbWVtb3J5IHN0YWNrDQotICAvLw0KLSAgQ0hBUjgg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0YWNrW0xPV19TVEFDS19TSVpFXTsNCi0N Ci0gIC8vDQotICAvLyBTdGFjayBmb3IgZmxhdCBtb2RlIGFmdGVyIHJldmVyc2UgdGh1bmsNCi0g IC8vIEBidWcgICAgLSBUaGlzIG1heSBubyBsb25nZXIgYmUgbmVjZXNzYXJ5IGlmIHRoZSByZXZl cnNlIHRodW5rIGludGVyZmFjZQ0KLSAgLy8gICAgICAgICAgIGlzIGNoYW5nZWQgdG8gaGF2ZSB0 aGUgZmxhdCBzdGFjayBpbiBhIGRpZmZlcmVudCBsb2NhdGlvbi4NCi0gIC8vDQotICBDSEFSOCAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmV2VGh1bmtTdGFja1tMT1dfU1RBQ0tfU0la RV07DQotDQotICAvLw0KLSAgLy8gTGVnYWN5MTYgSW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ICAgICAgICAgICAgICAgWDY0SWR0RGVzYzsgICAgICAgLy8gUHJvdGVjdGVkIG1v ZGUgSURUDQotICBVSU5UTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWDY0U3M7DQot ICBVSU5UTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWDY0RXNwOw0KLQ0KLSAgVUlO VE4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlYWxTdGFjazsNCi0gIERFU0NSSVBU T1IzMiAgICAgICAgICAgICAgICAgICAgICAgICBSZWFsTW9kZUlkdERlc2M7DQotICBERVNDUklQ VE9SMzIgICAgICAgICAgICAgICAgICAgICAgICAgUmVhbE1vZGVHZHREZXNjOw0KLQ0KLSAgLy8N Ci0gIC8vIHJlYWwtbW9kZSBHRFQgKHRlbXBvcmFyeSBHRFQgd2l0aCB0d28gcmVhbCBtb2RlIHNl Z21lbnQgZGVzY3JpcHRvcnMpDQotICAvLw0KLSAgR0RUNjQgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIFJlYWxNb2RlR2R0W05VTV9SRUFMX0dEVF9FTlRSSUVTXTsNCi0gIFVJTlQ2NCAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQYWdlTWFwTGV2ZWw0Ow0KLQ0KLSAgLy8NCi0g IC8vIEEgbG93IG1lbW9yeSBzdGFjaw0KLSAgLy8NCi0gIENIQVI4ICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBTdGFja1tMT1dfU1RBQ0tfU0laRV07DQotDQotICAvLw0KLSAgLy8gTGVn YWN5MTYgSW5pdCBtZW1vcnkgbWFwIGluZm8NCi0gIC8vDQotICBFRklfVE9fQ09NUEFUSUJJTElU WTE2X0lOSVRfVEFCTEUgICAgRWZpVG9MZWdhY3kxNkluaXRUYWJsZTsNCi0NCi0gIEVGSV9UT19D T01QQVRJQklMSVRZMTZfQk9PVF9UQUJMRSAgICBFZmlUb0xlZ2FjeTE2Qm9vdFRhYmxlOw0KLQ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EdW1w WzRdOw0KLQ0KLSAgLy8NCi0gIC8vICRFRkkgTGVnYWN5MTYgY29kZSBlbnRyeSBpbmZvIGluIG1l bW9yeSA8IDEgTUI7DQotICAvLw0KLSAgRUZJX0NPTVBBVElCSUxJVFkxNl9UQUJMRSAgICAgICAg ICAgICpMZWdhY3kxNlRhYmxlOw0KLSAgVk9JRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICpMZWdhY3kxNkluaXRQdHI7DQotICBWT0lEICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgKkxlZ2FjeTE2Qm9vdFB0cjsNCi0gIFZPSUQgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAqSW50ZXJuYWxJcnFSb3V0aW5nVGFibGU7DQotICBVSU5UMzIgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgTnVtYmVySXJxUm91dGluZ0VudHJpZXM7DQotICBWT0lEICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKkJic1RhYmxlUHRyOw0KLSAgVk9JRCAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICpIZGRUYWJsZVB0cjsNCi0gIFVJTlQzMiAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBOdW1iZXJIZGRDb250cm9sbGVyczsNCi0NCi0gIC8vDQot ICAvLyBDYWNoZWQgY29weSBvZiBMZWdhY3kxNiBlbnRyeSBwb2ludA0KLSAgLy8NCi0gIFVJTlQx NiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMZWdhY3kxNkNhbGxTZWdtZW50Ow0KLSAg VUlOVDE2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExlZ2FjeTE2Q2FsbE9mZnNldDsN Ci0NCi0gIC8vDQotICAvLyBSZXR1cm5lZCBmcm9tICRFRkkgYW5kIHBhc3NlZCBpbiB0byBPUFJP TVMNCi0gIC8vDQotICBVSU5UMTYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUG5QSW5z dGFsbGF0aW9uQ2hlY2tTZWdtZW50Ow0KLSAgVUlOVDE2ICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIFBuUEluc3RhbGxhdGlvbkNoZWNrT2Zmc2V0Ow0KLQ0KLSAgLy8NCi0gIC8vIEU4MjAg dGFibGUNCi0gIC8vDQotICBFRklfRTgyMF9FTlRSWSAgICAgICAgICAgICAgICAgICAgICAgRTgy MFRhYmxlW0VGSV9NQVhfRTgyMF9FTlRSWV07DQotICBVSU5UMzIgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgTnVtYmVyRTgyMEVudHJpZXM7DQotDQotICAvLw0KLSAgLy8gVHJ1ZSBpZiBs ZWdhY3kgVkdBIElOVCAxMGggaGFuZGxlciBpbnN0YWxsZWQNCi0gIC8vDQotICBCT09MRUFOICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgVmdhSW5zdGFsbGVkOw0KLQ0KLSAgLy8NCi0gIC8v IE51bWJlciBvZiBJREUgZHJpdmVzDQotICAvLw0KLSAgVUlOVDggICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIElkZURyaXZlQ291bnQ7DQotDQotICAvLw0KLSAgLy8gQ3VycmVudCBGcmVl IE9wdGlvbiBST00gc3BhY2UuIEFuIG9wdGlvbiBST00gbXVzdCBOT1QgZ28gcGFzdA0KLSAgLy8g Qmlvc1N0YXJ0Lg0KLSAgLy8NCi0gIFVJTlQzMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBPcHRpb25Sb207DQotDQotICAvLw0KLSAgLy8gU2F2ZSBMZWdhY3kxNiB1bmV4cGVjdGVkIGlu dGVycnVwdCB2ZWN0b3IuIFJlcHJvZ3JhbSBJTlQgNjgtNkYgZnJvbQ0KLSAgLy8gRUZJIHZhbHVl cyB0byBsZWdhY3kgdmFsdWUganVzdCBiZWZvcmUgYm9vdC4NCi0gIC8vDQotICBVSU5UMzIgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgQmlvc1VuZXhwZWN0ZWRJbnQ7DQotICBVSU5UMzIg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGh1bmtTYXZlZEludFs4XTsNCi0gIFVJTlQx NiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUaHVua1NlZzsNCi0gIExFR0FDWV9FRklf SEREX1RBQkxFICAgICAgICAgICAgICAgICAqTGVnYWN5RWZpSGRkVGFibGU7DQotICBVSU5UMTYg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGVnYWN5RWZpSGRkVGFibGVJbmRleDsNCi0g IFVJTlQ4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEaXNrRW5kOw0KLSAgVUlOVDgg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERpc2s0MDc1Ow0KLSAgVUlOVDE2ICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIFRyYWNlSW5kZXg7DQotICBVSU5UMTYgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgVHJhY2VbMHgyMDBdOw0KLQ0KLSAgLy8NCi0gIC8vIEluZGlj YXRlIHRoYXQgd2hldGhlciBHZW5lcmljTGVnYWN5Qm9vdCBpcyBlbnRlcmVkIG9yIG5vdA0KLSAg Ly8NCi0gIEJPT0xFQU4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMZWdhY3lCb290RW50 ZXJlZDsNCi0NCi0gIC8vDQotICAvLyBDU00xNiBQQ0kgSW50ZXJmYWNlIFZlcnNpb24NCi0gIC8v DQotICBVSU5UMTYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ3NtMTZQY2lJbnRlcmZh Y2VWZXJzaW9uOw0KLX0gTEVHQUNZX0JJT1NfSU5TVEFOQ0U7DQotDQotI3ByYWdtYSBwYWNrKDEp DQotDQotLyoNCi0gIDQwOjAwLTAxIENvbTENCi0gIDQwOjAyLTAzIENvbTINCi0gIDQwOjA0LTA1 IENvbTMNCi0gIDQwOjA2LTA3IENvbTQNCi0gIDQwOjA4LTA5IExwdDENC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FtICBSZWdzICAgICAgICAgICAgICAgICAgIFJlZ2lz dGVyIGNvbnRleHRlZCBwYXNzZWQgaW50byAoYW5kIHJldHVybmVkKSBmcm9tDQotICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgdGh1bmsgdG8gIDE2LWJpdCBtb2RlDQotICBAcGFyYW0g IFN0YWNrICAgICAgICAgICAgICAgICAgQ2FsbGVyIGFsbG9jYXRlZCBzdGFjayB1c2VkIHRvIHBh c3MgYXJndW1lbnRzDQotICBAcGFyYW0gIFN0YWNrU2l6ZSAgICAgICAgICAgICAgU2l6ZSBvZiBT dGFjayBpbiBieXRlcw0KLQ0KLSAgQHJldHZhbCBGQUxTRSAgICAgICAgICAgICAgICAgIFRodW5r IGNvbXBsZXRlZCwgYW5kIHRoZXJlIHdlcmUgbm8gQklPUyBlcnJvcnMgaW4NCi0gICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICB0aGUgdGFyZ2V0IGNvZGUuIFNlZSBSZWdzIGZvciBzdGF0 dXMuDQotICBAcmV0dmFsIFRSVUUgICAgICAgICAgICAgICAgICAgVGhlcmUgd2FzIGEgQklPUyBl cnJvIGluIHRoZSB0YXJnZXQgY29kZS4NCi0NCi0qKi8NCi1CT09MRUFODQotRUZJQVBJDQotTGVn YWN5Qmlvc0ZhckNhbGw4NiAoDQotICBJTiAgRUZJX0xFR0FDWV9CSU9TX1BST1RPQ09MICAqVGhp cywNCi0gIElOICBVSU5UMTYgICAgICAgICAgICAgICAgICAgIFNlZ21lbnQsDQotICBJTiAgVUlO VDE2ICAgICAgICAgICAgICAgICAgICBPZmZzZXQsDQotICBJTiAgRUZJX0lBMzJfUkVHSVNURVJf U0VUICAgICAqUmVncywNCi0gIElOICBWT0lEICAgICAgICAgICAgICAgICAgICAgICpTdGFjaywN Ci0gIElOICBVSU5UTiAgICAgICAgICAgICAgICAgICAgIFN0YWNrU2l6ZQ0KLSAgKTsNCi0NCi0v KioNCi0gIFRlc3QgdG8gc2VlIGlmIG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uLU5VTEwNCi0gICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBpZiB0aGVyZSBpcyBubyBoYXJkd2FyZSBhc3NvY2lhdGVkIHdpdGggdGhl IFJPTQ0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuZCB0aHVzIG5vIFBjaUhh bmRsZSwgb3RoZXJ3aXNlIGlzIG11c3QgYmUgTlVMTC4NCi0gICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBFeGFtcGxlIGlzIFBYRSBiYXNlIGNvZGUuDQotICBAcGFyYW0gIEZsYWdzICAg ICAgICAgICAgICAgICAgSW5kaWNhdGVzIGlmIFJPTSBmb3VuZCBhbmQgaWYgUEMtQVQuDQotICBA cGFyYW0gIERpc2tTdGFydCAgICAgICAgICAgICAgRGlzayBudW1iZXIgb2YgZmlyc3QgZGV2aWNl IGhvb2tlZCBieSB0aGUgUk9NLiBJZg0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IERpc2tTdGFydCBpcyB0aGUgc2FtZSBhcyBEaXNrRW5kIG5vIGRpc2tlZCB3ZXJlDQotICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgaG9va2VkLg0KLSAgQHBhcmFtICBEaXNrRW5kICAg ICAgICAgICAgICAgIERpc2sgbnVtYmVyIG9mIHRoZSBsYXN0IGRldmljZSBob29rZWQgYnkgdGhl IFJPTS4NCi0gIEBwYXJhbSAgUm9tU2hhZG93QWRkcmVzcyAgICAgICBTaGFkb3cgYWRkcmVzcyBv ZiBQQy1BVCBST00NCi0gIEBwYXJhbSAgUm9tU2hhZG93ZWRTaXplICAgICAgICBTaXplIG9mIFJv bVNoYWRvd0FkZHJlc3MgaW4gYnl0ZXMNCi0NCi0gIEByZXR2YWwgRUZJX1NVQ0NFU1MgICAgICAg ICAgICBMZWdhY3kgUk9NIGxvYWRlZCBmb3IgdGhpcyBkZXZpY2UNCi0gIEByZXR2YWwgRUZJX0lO VkFMSURfUEFSQU1FVEVSICBQY2lIYW5kbGUgbm90IGZvdW5kDQotICBAcmV0dmFsIEVGSV9VTlNV UFBPUlRFRCAgICAgICAgVGhlcmUgaXMgbm8gUENJIFJPTSBpbiB0aGUgUk9NIEJBUiBvciBubyBv bmJvYXJkDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUk9NDQotDQotKiovDQot RUZJX1NUQVRVUw0KLUVGSUFQSQ0KLUxlZ2FjeUJpb3NJbnN0YWxsUGNpUm9tICgNCi0gIElOICBF RklfTEVHQUNZX0JJT1NfUFJPVE9DT0wgICpUaGlzLA0KLSAgSU4gIEVGSV9IQU5ETEUgICAgICAg ICAgICAgICAgUGNpSGFuZGxlLA0KLSAgSU4gIFZPSUQgICAgICAgICAgICAgICAgICAgICAgKipS b21JbWFnZSwNCi0gIE9VVCBVSU5UTiAgICAgICAgICAgICAgICAgICAgICpGbGFncywNCi0gIE9V VCBVSU5UOCAgICAgICAgICAgICAgICAgICAgICpEaXNrU3RhcnQgIE9QVElPTkFMLA0KLSAgT1VU IFVJTlQ4ICAgICAgICAgICAgICAgICAgICAgKkRpc2tFbmQgIE9QVElPTkFMLA0KLSAgT1VUIFZP SUQgICAgICAgICAgICAgICAgICAgICAgKipSb21TaGFkb3dBZGRyZXNzICBPUFRJT05BTCwNCi0g IE9VVCBVSU5UMzIgICAgICAgICAgICAgICAgICAgICpSb21TaGFkb3dlZFNpemUgT1BUSU9OQUwN Ci0gICk7DQotDQotLyoqDQotICBGaWxsIGluIHRoZSBzdGFuZGFyZCBCREEgZm9yIEtleWJvYXJk IExFRHMNCi0NCi0gIEBwYXJhbSAgVGhpcyAgICAgICAgICAgICAgICAgICBQcm90b2NvbCBpbnN0 YW5jZSBwb2ludGVyLg0KLSAgQHBhcmFtICBMZWRzICAgICAgICAgICAgICAgICAgIEN1cnJlbnQg TEVEIHN0YXR1cw0KLQ0KLSAgQHJldHZhbCBFRklfU1VDQ0VTUyAgICAgICAgICAgIEl0IHNob3Vs ZCBhbHdheXMgd29yay4NCi0NCi0qKi8NCi1FRklfU1RBVFVTDQotRUZJQVBJDQotTGVnYWN5Qmlv c1VwZGF0ZUtleWJvYXJkTGVkU3RhdHVzICgNCi0gIElOIEVGSV9MRUdBQ1lfQklPU19QUk9UT0NP TCAgKlRoaXMsDQotICBJTiBVSU5UOCAgICAgICAgICAgICAgICAgICAgIExlZHMNCi0gICk7DQot DQotLyoqDQotICBHZXQgYWxsIEJCUyBpbmZvDQotDQotICBAcGFyYW0gIFRoaXMgICAgICAgICAg ICAgICAgICAgUHJvdG9jb2wgaW5zdGFuY2UgcG9pbnRlci4NCi0gIEBwYXJhbSAgSGRkQ291bnQg ICAgICAgICAgICAgICBOdW1iZXIgb2YgSEREX0lORk8gc3RydWN0dXJlcw0KLSAgQHBhcmFtICBI ZGRJbmZvICAgICAgICAgICAgICAgIE9uYm9hcmQgSURFIGNvbnRyb2xsZXIgaW5mb3JtYXRpb24N Ci0gIEBwYXJhbSAgQmJzQ291bnQgICAgICAgICAgICAgICBOdW1iZXIgb2YgQkJTX1RBQkxFIHN0 cnVjdHVyZXMNCi0gIEBwYXJhbSAgQmJzVGFibGUgICAgICAgICAgICAgICBMaXN0IEJCUyBlbnRy aWVzDQotDQotICBAcmV0dmFsIEVGSV9TVUNDRVNTICAgICAgICAgICAgVGFibGVzIHJldHVybmVk DQotICBAcmV0dmFsIEVGSV9OT1RfRk9VTkQgICAgICAgICAgcmVzb3VyY2Ugbm90IGZvdW5kDQot ICBAcmV0dmFsIEVGSV9ERVZJQ0VfRVJST1IgICAgICAgY2FuIG5vdCBnZXQgQkJTIHRhYmxlDQot DQotKiovDQotRUZJX1NUQVRVUw0KLUVGSUFQSQ0KLUxlZ2FjeUJpb3NHZXRCYnNJbmZvICgNCi0g IElOICBFRklfTEVHQUNZX0JJT1NfUFJPVE9DT0wgICpUaGlzLA0KLSAgT1VUIFVJTlQxNiAgICAg ICAgICAgICAgICAgICAgKkhkZENvdW50LA0KLSAgT1VUIEhERF9JTkZPICAg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1BbGxv Y2F0ZUxlZ2FjeU1lbW9yeSAoDQotICBJTiAgRUZJX0FMTE9DQVRFX1RZUEUgICAgIEFsbG9jYXRl VHlwZSwNCi0gIElOICBFRklfTUVNT1JZX1RZUEUgICAgICAgTWVtb3J5VHlwZSwNCi0gIElOICBF RklfUEhZU0lDQUxfQUREUkVTUyAgU3RhcnRQYWdlQWRkcmVzcywNCi0gIElOICBVSU5UTiAgICAg ICAgICAgICAgICAgUGFnZXMsDQotICBPVVQgRUZJX1BIWVNJQ0FMX0FERFJFU1MgICpSZXN1bHQN Ci0gICk7DQotDQotLyoqDQotICBHZXQgYSByZWdpb24gZnJvbSB0aGUgTGVnYWN5QmlvcyBmb3Ig VGlhbm8gdXNhZ2UuIENhbiBvbmx5IGJlIGludm9rZWQgb25jZS4NCi0NCi0gIEBwYXJhbSAgVGhp cyAgICAgICAgICAgICAgICAgICAgICAgUHJvdG9jb2wgaW5zdGFuY2UgcG9pbnRlci4NCi0gIEBw YXJhbSAgTGVnYWN5TWVtb3J5U2l6ZSAgICAgICAgICAgU2l6ZSBvZiByZXF1aXJlZCByZWdpb24N Ci0gIEBwYXJhbSAgUmVnaW9uICAgICAgICAgICAgICAgICAgICAgUmVnaW9uIHRvIHVzZS4gMDAg PSBFaXRoZXIgMHhFMDAwMCBvciAweEYwMDAwDQotICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGJsb2NrIEJpdDAgPSAxIDB4RjAwMDAgYmxvY2sgQml0MSA9IDEgMHhFMDAwMA0K LSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibG9jaw0KLSAgQHBhcmFtICBB bGlnbm1lbnQgICAgICAgICAgICAgICAgICBBZGRyZXNzIGFsaWdubWVudC4gQml0IG1hcHBlZC4g Rmlyc3Qgbm9uLXplcm8NCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYml0 IGZyb20gcmlnaHQgaXMgYWxpZ25tZW50Lg0KLSAgQHBhcmFtIC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tLS0tLS0tLS0tLS0t LS0tDQotOyBQcm9jZWR1cmU6ICAgIEludGVycnVwdFJlZGlyZWN0aW9uVGVtcGxhdGU6IFJlZGly ZWN0cyBpbnRlcnJ1cHRzIDB4NjgtMHg2Rg0KLTsNCi07IElucHV0OiAgICAgICAgTm9uZQ0KLTsN Ci07IE91dHB1dDogICAgICAgTm9uZQ0KLTsNCi07IFByb3RvdHlwZTogICAgVk9JRA0KLTsgICAg ICAgICAgICAgICBJbnRlcnJ1cHRSZWRpcmVjdGlvblRlbXBsYXRlICgNCi07ICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBWT0lEDQotOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgKTsNCi07DQotOyBTYXZlczogICAgICAgIE5vbmUNCi07DQotOyBNb2RpZmllZDogICAgIE5v bmUNCi07DQotOyBEZXNjcmlwdGlvbjogIENvbnRhaW5zIHRoZSBjb2RlIHRoYXQgaXMgY29waWVk IGludG8gbG93IG1lbW9yeSAoYmVsb3cgNjQwSykuDQotOyAgICAgICAgICAgICAgIFRoaXMgY29k ZSByZWZsZWN0cyBpbnRlcnJ1cHRzIDB4NjgtMHg2ZiB0byBpbnRlcnJ1cHRzIDB4MDgtMHgwZi4N Ci07ICAgICAgICAgICAgICAgVGhpcyB0ZW1wbGF0ZSBtdXN0IGJlIGNvcGllZCBpbnRvIGxvdyBt ZW1vcnksIGFuZCB0aGUgSURUIGVudHJpZXMNCi07ICAgICAgICAgICAgICAgMHg2OC0weDZGIG11 c3QgYmUgcG9pbnQgdG8gdGhlIGxvdyBtZW1vcnkgY29weSBvZiB0aGlzIGNvZGUuICBFYWNoDQot OyAgICAgICAgICAgICAgIGVudHJ5IGlzIDQgYnl0ZXMgbG9uZywgc28gSURUIGVudHJpZXMgMHg2 OC0weDZGIGNhbiBiZSBlYXNpbHkNCi07ICAgICAgICAgICAgICAgY29tcHV0ZWQuDQotOw0KLTst LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tDQotDQotZ2xvYmFsIEFTTV9QRlgoSW50ZXJydXB0UmVkaXJlY3Rp b25UZW1wbGF0ZSkNCi1BU01fUEZYKEludGVycnVwdFJlZGlyZWN0aW9uVGVtcGxhdGUpOg0KLSAg aW50ICAgICAweDgNCi0gIERCICAgICAgMHhjZiAgICAgICAgICA7IElSRVQNCi0gIG5vcA0KLSAg aW50ICAgICAweDkNCi0gIERCICAgICAgMHhjZiAgICAgICAgICA7IElSRVQNCi0gIG5vcA0KLSAg aW50ICAgICAweGENCi0gIERCICAgICAgMHhjZiAgICAgICAgICA7IElSRVQNCi0gIG5vcA0KLSAg aW50ICAgICAweGINCi0gIERCICAgICAgMHhjZiAgICAgICAgICA7IElSRVQNCi0gIG5vcA0KLSAg aW50ICAgICAweGMNCi0gIERCICAgICAgMHhjZiAgICAgICAgICA7IElSRVQNCi0gIG5vcA0KLSAg aW50ICAgICAweGQNCi0gIERCICAgICAgMHhjZiAgICAgICAgICA7IElSRVQNCi0gIG5vcA0KLSAg aW50ICAgICAweGUNCi0gIERCICAgICAgMHhjZiAgICAgICAgICA7IElSRVQNCi0gIG5vcA0KLSAg aW50ICAgICAweGYNCi0gIERCICAgICAgMHhjZiAgICAgICAgICA7IElSRVQNCi0gIG5vcA0KLQ0K ZGlmZiAtLWdpdCBhL092bWZQa2cvQ3NtL0xlZ2FjeUJpb3NEeGUvTGVnYWN5QmJzLmMgYi9Pdm1m UGtnL0NzbS9MZWdhY3lCaW9zRHhlL0xlZ2FjeUJicy5jCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0 NAppbmRleCBjZDgwNzIwYTFkMDguLjAwMDAwMDAwMDAwMAotLS0gYS9Pdm1mUGtnL0NzbS9MZWdh Y3lCaW9zRHhlL0xlZ2FjeUJicy5jCisrKyAvZGV2L251bGwKQEAgLTEsNTMwICswLDAgQEAKLS8q KiBAZmls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AgQmJzSW5kZXggPSBIZGRJbmRleCAqIDIgKyAxOw0KLSAgICBmb3IgKEluZGV4ID0g MDsgSW5kZXggPCAyOyArK0luZGV4KSB7DQotICAgICAgQmJzVGFibGVbQmJzSW5kZXggKyBJbmRl eF0uQnVzICAgICAgICAgICAgICAgICAgICAgID0gSGRkSW5mb1tIZGRJbmRleF0uQnVzOw0KLSAg ICAgIEJic1RhYmxlW0Jic0luZGV4ICsgSW5kZXhdLkRldmljZSAgICAgICAgICAgICAgICAgICA9 IEhkZEluZm9bSGRkSW5kZXhdLkRldmljZTsNCi0gICAgICBCYnNUYWJsZVtCYnNJbmRleCArIElu ZGV4XS5GdW5jdGlvbiAgICAgICAgICAgICAgICAgPSBIZGRJbmZvW0hkZEluZGV4XS5GdW5jdGlv bjsNCi0gICAgICBCYnNUYWJsZVtCYnNJbmRleCArIEluZGV4XS5DbGFzcyAgICAgICAgICAgICAg ICAgICAgPSAwMTsNCi0gICAgICBCYnNUYWJsZVtCYnNJbmRleCArIEluZGV4XS5TdWJDbGFzcyAg ICAgICAgICAgICAgICAgPSAwMTsNCi0gICAgICBCYnNUYWJsZVtCYnNJbmRleCArIEluZGV4XS5T dGF0dXNGbGFncy5PbGRQb3NpdGlvbiAgPSAwOw0KLSAgICAgIEJic1RhYmxlW0Jic0luZGV4ICsg SW5kZXhdLlN0YXR1c0ZsYWdzLlJlc2VydmVkMSAgICA9IDA7DQotICAgICAgQmJzVGFibGVbQmJz SW5kZXggKyBJbmRleF0uU3RhdHVzRmxhZ3MuRW5hYmxlZCAgICAgID0gMDsNCi0gICAgICBCYnNU YWJsZVtCYnNJbmRleCArIEluZGV4XS5TdGF0dXNGbGFncy5GYWlsZWQgICAgICAgPSAwOw0KLSAg ICAgIEJic1RhYmxlW0Jic0luZGV4ICsgSW5kZXhdLlN0YXR1c0ZsYWdzLk1lZGlhUHJlc2VudCA9 IDA7DQotICAgICAgQmJzVGFibGVbQmJzSW5kZXggKyBJbmRleF0uU3RhdHVzRmxh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DRFJPTTsNCi0gICAgICAgICAgICB9IGVsc2Ugew0KLSAg ICAgICAgICAgICAgLy8NCi0gICAgICAgICAgICAgIC8vIGZvciBaSVBESVNLDQotICAgICAgICAg ICAgICAvLw0KLSAgICAgICAgICAgICAgQmJzVGFibGVbQmJzSW5kZXggKyBJbmRleF0uRGV2aWNl VHlwZSA9IEJCU19IQVJERElTSzsNCi0gICAgICAgICAgICB9DQotICAgICAgICAgIH0gZWxzZSB7 DQotICAgICAgICAgICAgQmJzVGFibGVbQmJzSW5kZXggKyBJbmRleF0uQm9vdFByaW9yaXR5ID0g QkJTX0lHTk9SRV9FTlRSWTsNCi0gICAgICAgICAgfQ0KLSAgICAgICAgfSBlbHNlIHsNCi0gICAg ICAgICAgaWYgKChIZGRJbmZvW0hkZEluZGV4XS5TdGF0dXMgJiAoSEREX1NMQVZFX0lERSB8IEhE RF9TTEFWRV9BVEFQSV9DRFJPTSB8IEhERF9TTEFWRV9BVEFQSV9aSVBESVNLKSkgIT0gMCkgew0K LSAgICAgICAgICAgIEJic1RhYmxlW0Jic0luZGV4ICsgSW5kZXhdLkJvb3RQcmlvcml0eSA9IEJC U19VTlBSSU9SSVRJWkVEX0VOVFJZOw0KLSAgICAgICAgICAgIGlmICgoSGRkSW5mb1tIZGRJbmRl eF0uU3RhdHVzICYgSEREX1NMQVZFX0lERSkgIT0gMCkgew0KLSAgICAgICAgICAgICAgQmJzVGFi bGVbQmJzSW5kZXggKyBJbmRleF0uRGV2aWNlVHlwZSA9IEJCU19IQVJERElTSzsNCi0gICAgICAg ICAgICB9IGVsc2UgaWYgKChIZGRJbmZvW0hkZEluZGV4XS5TdGF0dXMgJiBIRERfU0xBVkVfQVRB UElfQ0RST00pICE9IDApIHsNCi0gICAgICAgICAgICAgIEJic1RhYmxlW0Jic0luZGV4ICsgSW5k ZXhdLkRldmljZVR5cGUgPSBCQlNfQ0RST007DQotICAgICAgICAgICAgfSBlbHNlIHsNCi0gICAg ICAgICAgICAgIC8vDQotICAgICAgICAgICAgICAvLyBmb3IgWklQRElTSw0KLSAgICAgICAgICAg ICAgLy8NCi0gICAgICAgICAgICAgIEJic1RhYmxlW0Jic0luZGV4ICsgSW5kZXhdLkRldmljZVR5 cGUgPSBCQlNfSEFSRERJU0s7DQotICAgICAgICAgICAgfQ0KLSAgICAgICAgICB9IGVsc2Ugew0K LSAgICAgICAgICAgIEJic1RhYmxlW0Jic0luZGV4ICsgSW5kZXhdLkJvb3RQcmlvcml0eSA9IEJC U19JR05PUkVfRU5UUlk7DQotICAgICAgICAgIH0NCi0gICAgICAgIH0NCi0gICAgICB9DQotICAg IH0NCi0gIH0NCi0NCi0gIC8vDQotICAvLyBBZGQgbm9uLUlERSBibG9jayBkZXZpY2VzDQotICAv Lw0KLSAgQmJzSW5kZXggPSBIZGRJbmRleCAqIDIgKyAxOw0KLQ0KLSAgU3RhdHVzID0gZ0JTLT5M b2NhdGVIYW5kbGVCdWZmZXIgKA0KLSAgICAgICAgICAgICAgICAgIEJ5UHJvdG9jb2wsDQotICAg ICAgICAgICAgICAgICAgJmdFZmlCbG9ja0lvUHJvdG9jb2xHdWlkLA0KLSAgICAgICAgICAgICAg ICAgIE5VTEwsDQotICAgICAgICAgICAgICAgICAgJk51bWJlckJsb2NrSW9IYW5kbGVzLA0KLSAg ICAgICAgICAgICAgICAgICZCbG9ja0lvSGFuZGxlcw0KLSAgICAgICAgICAgICAgICAgICk7DQot DQotICBpZiAoIUVGSV9FUlJPUiAoU3RhdHVzKSkgew0KLSAgICBVSU5UTiAgICAgICAgICAgICAg ICAgICAgIFJlbW92YWJsZTsNCi0gICAgRUZJX0JMT0NLX0lPX1BST1RPQ09MICAgICAqQmxrSW87 DQotICAgIEVGSV9QQ0lfSU9fUFJPVE9DT0wgICAgICAgKlBjaUlvOw0KLSAgICBFRklfREVWSUNF X1BBVEhfUFJPVE9DT0wgICpEZXZpY2VQYXRoOw0KLSAgICBFRklfREVWSUNFX1BBVEhfUFJPVE9D T0wgICpEZXZpY2VQYXRoTm9kZTsNCi0gICAgRUZJX0hBTkRMRSAgICAgICAgICAgICAgICBQY2lI YW5kbGU7DQotICAgIFVJTlROICAgICAgICAgICAgICAgICAgICAgU2VnTnVtOw0KLSAgICBVSU5U TiAgICAgICAgICAgICAgICAgICAgIEJ1c051bTsNCi0gICAgVUlOVE4gICAgICAgICAgICAgICAg ICAgICBEZXZOdW07DQotICAgIFVJTlROICAgICAgICAgICAgICAgICAgICAgRnVuY051bTsNCi0N Ci0gICAgZm9yIChSZW1vdmFibGUgPSAwOyBSZW1vdmFibGUgPCAyOyBSZW1vdmFibGUrKykgew0K LSAgICAgIGZvciAoQmxvY2tJbmRleCA9IDA7IEJsb2NrSW5kZXggPCBOdW1iZXJCbG9ja0lvSGFu ZGxlczsgQmxvY2tJbmRleCsrKSB7DQotICAgICAgICBTdGF0dXMgPSBnQlMtPkhhbmRsZVByb3Rv Y29sICgNCi0gICAgICAgICAgICAgICAgICAgICAgICBCbG9ja0lvSGFuZGxlc1tCbG9ja0luZGV4 XSwNCi0gICAgICAgICAgICAgICAgICAgICAgICAmZ0VmaUJsb2NrSW9Qcm90b2NvbEd1aWQsDQot ICAgICAgICAgICAgICAgICAgICAgICAgKFZPSUQgKiopJkJsa0lvDQotICAgICAgICAgICAgICAg ICAgICAgICAgKTsNCi0NCi0gICAgICAgIGlmIChFRklfRVJST1IgKFN0YXR1cykpIHsNCi0gICAg ICAgICAgY29udGludWU7DQotICAgICAgICB9DQotDQotICAgICAgICAvLw0KLSAgICAgICAgLy8g U2tpcCB0aGUgbG9naWNhbCBwYXJ0aXRpb25zDQotICAgICAgICAvLw0KLSAgICAgICAgaWYgKEJs a0lvLT5NZWRpYS0+TG9naWNhbFBhcnRpdGlvbikgew0KLSAgICAgICAgICBjb250aW51ZTsNCi0g ICAgICAgIH0NCi0NCi0gICAgICAgIC8vDQotICAgICAgICAvLyBTa2lwIHRoZSBmaXhlZCBibG9j ayBpbyB0aGVuIHRoZSByZW1vdmFibGUgYmxvY2sgaW8NCi0gICAgICAgIC8vDQotICAgICAgICBp ZiAoQmxrSW8tPk1lZGlhLT5SZW1vdmFibGVNZWRpYSA9PSAoKFJlbW92YWJsZSA9PSAwKSA/IEZB TFNFIDogVFJVRSkpIHsNCi0gICAgICAgICAgY29udGludWU7DQotICAgICAgICB9DQotDQotICAg ICAgICAvLw0KLSAgICAgICAgLy8gR2V0IERldmljZSBQYXRoDQotICAgICAgICAvLw0KLSAgICAg ICAgU3RhdHVzID0gZ0JTLT5IYW5kbGVQcm90b2NvbCAoDQotICAgICAgICAgICAgICAgICAgICAg ICAgQmxvY2tJb0hhbmRsZXNbQmxvY2tJbmRleF0sDQotICAgICAgICAgICAgICAgICAgICAgICAg JmdFZmlEZXZpY2VQYXRoUHJvdG9jb2xHdWlkLA0KLSAgICAgICAgICAgICAgICAgICAgICAgIChW T0lEICoqKSZEZXZpY2VQYXRoDQotICAgICAgICAgICAgICAgICAgICAgICAgKTsNCi0gICAgICAg IGlmIChFRklfRVJST1IgKFN0YXR1cykpIHsNCi0gICAgICAgICAgY29udGludWU7DQotICAgICAg ICB9DQotDQotICAgICAgICAvLw0KLSAgICAgICAgLy8gU2tpcCBBVEEgZGV2aWNlcyBhcyB0aGV5 IGhhdmUgYWxyZWFkeSBiZWVuIGhhbmRsZWQNCi0gICAgICAgIC8vDQotICAgICAgICBEZXZpY2VQ YXRoTm9kZSA9IERldmljZVBhdGg7DQotICAgICAgICB3aGlsZSAoIUlzRGV2aWNlUGF0aEVuZCAo RGV2aWNlUGF0aE5vZGUpKSB7DQotICAgICAgICAgIGlmICgoRGV2aWNlUGF0aFR5cGUgKERldmlj ZVBhdGhOb2RlKSA9PSBNRVNTQUdJTkdfREVWSUNFX1BBVEgpICYmDQotICAgICAgICAgICAgICAo RGV2aWNlUGF0aFN1YlR5cGUgKERldmljZVBhdGhOb2RlKSA9PSBNU0dfQVRBUElfRFApKQ0KLSAg ICAgICAgICB7DQotICAgICAgICAgICAgYnJlYWs7DQotICAgICAgICAgIH0NCi0NCi0gICAgICAg ICAgRGV2aWNlUGF0aE5vZGUgPSBOZXh0RGV2aWNlUGF0aE5vZGUgKERldmljZVBhdGhOb2RlKTsN Ci0gICAgICAgIH0NCi0NCi0gICAgICAgIGlmICghSXNEZXZpY2VQYXRoRW5kIChEZXZpY2VQYXRo Tm9kZSkpIHsNCi0gICAgICAgICAgY29udGludWU7DQotICAgICAgICB9DQotDQotICAgICAgICAv Lw0KLSAgICAgICAgLy8gIExvY2F0ZSB3aGljaCBQQ0kgZGV2aWNlDQotICAgICAgICAvLw0KLSAg ICAgICAgU3RhdHVzID0gZ0JTLT5Mb2NhdGVEZXZpY2VQYXRoICgNCi0gICAgICAgICAgICAgICAg ICAgICAgICAmZ0VmaVBjaUlvUHJvdG9jb2xHdWlkLA0KLSAgICAgICAgICAgICAgICAgICAgICAg ICZEZXZpY2VQYXRoLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICZQY2lIYW5kbGUNCi0gICAg ICAgICAgICAgICAgICAgICAgICApOw0KLSAgICAgICAgaWYgKEVGSV9FUlJPUiAoU3RhdHVzKSkg ew0KLSAgICAgICAgICBjb250aW51ZTsNCi0gICAgICAgIH0NCi0NCi0gICAgICAgIFN0YXR1cyA9 IGdCUy0+SGFuZGxlUHJvdG9jb2wgKA0KLSAgICAgICAgICAgICAgICAgICAgICAgIFBjaUhhbmRs ZSwNCi0gICAgICAgICAgICAgICAgICAgICAgICAmZ0VmaVBjaUlvUHJvdG9jb2xHdWlkLA0KLSAg ICAgICAgICAgICAgICAgICAgICAgIChWT0lEICoqKSZQY2lJbw0KLSAgICAgICAgICAgICAgICAg ICAgICAgICk7DQotICAgICAgICBpZiAoRUZJX0VSUk9SIChTdGF0dXMpKSB7DQotICAgICAgICAg IGNvbnRpbnVlOw0KLSAgICAgICAgfQ0KLQ0KLSAgICAgICAgU3RhdHVzID0gUGNpSW8tPkdldExv Y2F0aW9uICgNCi0gICAgICAgICAgICAgICAgICAgICAgICAgIFBjaUlvLA0KLSAgICAgICAgICAg ICAgICAgICAgICAgICAgJlNlZ051bSwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICZCdXNO dW0sDQotICAgICAgICAgICAgICAgICAgICAgICAgICAmRGV2TnVtLA0KLSAgICAgICAgICAgICAg ICAgICAgICAgICAgJkZ1bmNOdW0NCi0gICAgICAgICAgICAgICAgICAgICAgICAgICk7DQotICAg ICAgICBpZiAoRUZJX0VSUk9SIChTdGF0dXMpKSB7DQotICAgICAgICAgIGNvbnRpbnVlOw0KLSAg ICAgICAgfQ0KLQ0KLSAgICAgICAgaWYgKFNlZ051bSAhPSAwKSB7DQotICAgICAgICAgIERFQlVH ICgoDQotICAgICAgICAgICAgREVCVUdfV0FSTiwNCi0gICAgICAgICAgICAiQ1NNIGNhbm5vdCB1 c2UgUENJIGRldmljZXMgaW4gc2VnbWVudCAlTHVcbiIsDQotICAgICAgICAgICAgKFVJTlQ2NClT ZWdOdW0NCi0gICAgICAgICAgICApKTsNCi0gICAgICAgICAgY29udGludWU7DQotICAgICAgICB9 DQotDQotICAgICAgICBERUJVRyAoKA0KLSAgICAgICAgICBERUJVR19JTkZPLA0KLSAgICAgICAg ICAiQWRkIExlZ2FjeSBCYnMgZW50cnkgZm9yIFBDSSAlZC8lZC8lZFxuIiwNCi0gICAgICAgICAg QnVzTnVtLA0KLSAgICAgICAgICBEZXZOdW0sDQotICAgICAgICAgIEZ1bmNOdW0NCi0gICAgICAg ICAgKSk7DQotDQotICAgICAgICBCYnNUYWJsZVtCYnNJbmRleF0uQnVzICAgICAgICAgICAgICAg ICAgICAgID0gQnVzTnVtOw0KLSAgICAgICAgQmJzVGFibGVbQmJzSW5kZXhdLkRldmljZSAgICAg ICAgICAgICAgICAgICA9IERldk51bTsNCi0gICAgICAgIEJic1RhYmxlW0Jic0luZGV4XS5GdW5j dGlvbiAgICAgICAgICAgICAgICAgPSBGdW5jTnVtOw0KLSAgICAgICAgQmJzVGFibGVbQmJzSW5k ZXhdLkNsYXNzICAgICAgICAgICAgICAgICAgICA9IDE7DQotICAgICAgICBCYnNUYWJsZVtCYnNJ bmRleF0uU3ViQ2xhc3MgICAgICAgICAgICAgICAgID0gMHg4MDsNCi0gICAgICAgIEJic1RhYmxl W0Jic0luZGV4XS5TdGF0dXNGbGFncy5PbGRQb3NpdGlvbiAgPSAwOw0KLSAgICAgICAgQmJzVGFi bGVbQmJzSW5kZXhdLlN0YXR1c0ZsYWdzLlJlc2VydmVkMSAgICA9IDA7DQotICAgICAgICBCYnNU YWJsZVtCYnNJbmRleF0uU3RhdHVzRmxhZ3MuRW5hYmxlZCAgICAgID0gMDsNCi0gICAgICAgIEJi c1RhYmxlW0Jic0luZGV4XS5TdGF0dXNGbGFncy5GYWlsZWQgICAgICAgPSAwOw0KLSAgICAgICAg QmJzVGFibGVbQmJzSW5kZXhdLlN0YXR1c0ZsYWdzLk1lZGlhUHJlc2VudCA9IDA7DQotICAgICAg ICBCYnNUYWJsZVtCYnNJbmRleF0uU3RhdHVzRmxhZ3MuUmVzZXJ2ZWQyICAgID0gMDsNCi0gICAg ICAgIEJic1RhYmxlW0Jic0luZGV4XS5EZXZpY2VUeXBlICAgICAgICAgICAgICAgPSBCQlNfSEFS RERJU0s7DQotICAgICAgICBCYnNUYWJsZVtCYnNJbmRleF0uQm9vdFByaW9yaXR5ICAgICAgICAg ICAgID0gQkJTX1VOUFJJT1JJVElaRURfRU5UUlk7DQotICAgICAgICBCYnNJbmRleCsrOw0KLQ0K LSAgICAgICAgaWYgKEJic0luZGV4ID09IE1BWF9CQlNfRU5UUklFUykgew0KLSAgICAgICAgICBS ZW1vdmFibGUgPSAyOw0KLSAgICAgICAgICBicmVhazsNCi0gICAgICAgIH0NCi0gICAgICB9DQot ICAgIH0NCi0NCi0gICAgRnJlZVBvb2wgKEJsb2NrSW9IYW5kbGVzKTsNCi0gIH0NCi0NCi0gIHJl dHVybiBFRklfU1VDQ0VTUzsNCi19DQotDQotLyoqDQotICBHZXQgYWxsIEJCUyBpbmZvDQotDQot ICBAcGFyYW0gIFRoaXMgICAgICAgICAgICAgICAgICAgIFByb3RvY29sIGluc3RhbmNlIHBvaW50 ZXIuDQotICBAcGFyYW0gIEhkZENvdW50ICAgICAgICAgICAgICAgIE51bWJlciBvZiBIRERfSU5G TyBzdHJ1Y3R1cmVzDQotICBAcGFyYW0gIEhkZEluZm8gICAgICAgICAgICAgICAgIE9uYm9hcmQg SURFIGNvbnRyb2xsZXIgaW5mb3JtYXRpb24NCi0gIEBwYXJhbSAgQmJzQ291bnQgICAgICAgICAg ICAgICAgTnVtYmVyIG9mIEJCU19UQUJMRSBzdHJ1Y3R1cmVzDQotICBAcGFyYW0gIEJic1RhYmxl ICAgICAgICAgICAgICAgIExpc3QgQkJTIGVudHJpZXMNCi0NCi0gIEByZXR2YWwgRUZJX1NVQ0NF U1MgICAgICAgICAgICAgVGFibGVzIHJldHVybmVkDQotICBAcmV0dmFsIEVGSV9OT1RfRk9VTkQg ICAgICAgICAgIHJlc291cmNlIG5vdCBmb3VuZA0KLSAgQHJldHZhbCBFRklfREVWSUNFX0VSUk9S ICAgICAgICBjYW4gbm90IGdldCBCQlMgdGFibGUNCi0NCi0qKi8NCi1FRklfU1RBVFVTDQotRUZJ QVBJDQotTGVnYWN5Qmlvc0dldEJic0luZm8gKA0KLSAgSU4gRUZJX0xFR0FDWV9CSU9TX1BST1RP Q09MICAqVGhpcywNCi0gIE9VVCBVSU5UMTYgICAgICAgICAgICAgICAgICAgKkhkZENvdW50LA0K LSAgT1VUIEhERF9JTkZPICAgICAgICAgICAgICAgICAqKkhkZEluZm8sDQotICBPVVQgVUlOVDE2 ICAgICAgICAgICAgICAgICAgICpCYnNDb3VudCwNCi0gIE9VVCBCQlNfVEFCTEUgICAgICAgICAg ICAgICAgKipCYnNUYWJsZQ0KLSAgKQ0KLXsNCi0gIExFR0FDWV9CSU9TX0lOU1RBTkNFICAgICAg ICAgICAgICAgKlByaXZhdGU7DQotICBFRklfSUEzMl9SRUdJU1RFUl9TRVQgICAgICAg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cmFudWxhcml0eSk7DQotDQotICAgIC8v DQotICAgIC8vIENhbGwgaW50byBMZWdhY3kxNiBjb2RlIHRvIGFkZCB0byBCQlMgdGFibGUgZm9y IG5vbiBCQlMgY29tcGxpYW50IE9QUk9Ncy4NCi0gICAgLy8NCi0gICAgWmVyb01lbSAoJlJlZ3Ms IHNpemVvZiAoRUZJX0lBMzJfUkVHSVNURVJfU0VUKSk7DQotICAgIFJlZ3MuWC5BWCA9IExlZ2Fj eTE2VXBkYXRlQmJzOw0KLQ0KLSAgICAvLw0KLSAgICAvLyBQYXNzIGluIGhhbmRvZmYgZGF0YQ0K LSAgICAvLw0KLSAgICBUZW1wRGF0YSAgPSAoVUlOVE4pRWZpVG9MZWdhY3kxNkJvb3RUYWJsZTsN Ci0gICAgUmVncy5YLkVTID0gTk9STUFMSVpFX0VGSV9TRUdNRU5UICgoVUlOVDMyKVRlbXBEYXRh KTsNCi0gICAgUmVncy5YLkJYID0gTk9STUFMSVpFX0VGSV9PRkZTRVQgKChVSU5UMzIpVGVtcERh dGEpOw0KLQ0KLSAgICBQcml2YXRlLT5MZWdhY3lCaW9zLkZhckNhbGw4NiAoDQotICAgICAgICAg ICAgICAgICAgICAgICAgICBUaGlzLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgUHJpdmF0 ZS0+TGVnYWN5MTZDYWxsU2VnbWVudCwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgIFByaXZh dGUtPkxlZ2FjeTE2Q2FsbE9mZnNldCwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICZSZWdz LA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwNCi0gICAgICAgICAgICAgICAgICAg ICAgICAgIDANCi0gICAgICAgICAgICAgICAgICAgICAgICAgICk7DQotDQotICAgIFByaXZhdGUt PkNwdS0+Rmx1c2hEYXRhQ2FjaGUgKFByaXZhdGUtPkNwdSwgMHhFMDAwMCwgMHgyMDAwMCwgRWZp Q3B1Rmx1c2hUeXBlV3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ByZXR1cm4gU3RhdHVzOw0KLX0NCi0NCi0vKioNCi0gIFRoaXMgZnVu Y3Rpb24gaXMgY2FsbGVkIHdoZW4gRUZJIG5lZWRzIHRvIHJlc2VydmUgYW4gYXJlYSBpbiB0aGUg MHhFMDAwMCBvciAweEYwMDAwDQotICA2NCBLQiBibG9ja3MuDQotDQotICBOb3RlOiBpbmNvbnNp c3RlbmN5IHdpdGggdGhlIEZyYW1ld29yayBDU00gc3BlYy4gUGVyIHRoZSBzcGVjLCB0aGlzIGZ1 bmN0aW9uIG1heSBiZQ0KLSAgaW52b2tlZCBvbmx5IG9uY2UuIFRoaXMgbGltaXRhdGlvbiBpcyBy ZWxheGVkIHRvIGFsbG93IG11bHRpcGxlIGNhbGxzIGluIHRoaXMgaW1wbGVtZW50YXRpb24uDQot DQotICBAcGFyYW0gIFRoaXMgICAgICAgICAgICAgICAgICAgICAgIFByb3RvY29sIGluc3RhbmNl IHBvaW50ZXIuDQotICBAcGFyYW0gIExlZ2FjeU1lbW9yeVNpemUgICAgICAgICAgIFNpemUgb2Yg cmVxdWlyZWQgcmVnaW9uDQotICBAcGFyYW0gIFJlZ2lvbiAgICAgICAgICAgICAgICAgICAgIFJl Z2lvbiB0byB1c2UuIDAwID0gRWl0aGVyIDB4RTAwMDAgb3IgMHhGMDAwMA0KLSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBibG9jayBCaXQwID0gMSAweEYwMDAwIGJsb2NrIEJp dDEgPSAxIDB4RTAwMDANCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmxv Y2sNCi0gIEBwYXJhbSAgQWxpZ25tZW50ICAgICAgICAgICAgICAgICAgQWRkcmVzcyBhbGlnbm1l bnQuIEJpdCBtYXBwZWQuIEZpcnN0IG5vbi16ZXJvDQotICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGJpdCBmcm9tIHJpZ2h0IGlzIGFsaWdubWVudC4NCi0gIEBwYXJhbSAgTG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Q0KLSAgKQ0KLXsNCi0gIEVGSV9TVEFUVVMgICAgICAg ICAgICAgICAgICAgICAgICAgU3RhdHVzOw0KLSAgVUlOVDggICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAqUHRyOw0KLSAgVUlOVDggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqUHRy RW5kOw0KLSAgQk9PTEVBTiAgICAgICAgICAgICAgICAgICAgICAgICAgICBEb25lOw0KLSAgRUZJ X0NPTVBBVElCSUxJVFkxNl9UQUJMRSAgICAgICAgICAqVGFibGU7DQotICBVSU5UOCAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIENoZWNrU3VtOw0KLSAgRUZJX0lBMzJfUkVHSVNURVJfU0VU ICAgICAgICAgICAgICBSZWdzOw0KLSAgRUZJX1RPX0NPTVBBVElCSUxJVFkxNl9JTklUX1RBQkxF ICAqRWZpVG9MZWdhY3kxNkluaXRUYWJsZTsNCi0gIEVGSV9UT19DT01QQVRJQklMSVRZMTZfQk9P VF9UQUJMRSAgKkVmaVRvTGVnYWN5MTZCb290VGFibGU7DQotICBWT0lEICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICpMZWdhY3lCaW9zSW1hZ2U7DQotICBVSU5UTiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIExlZ2FjeUJpb3NJbWFnZVNpemU7DQotICBVSU5UTiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIEU4MjBTaXplOw0KLSAgVUlOVDMyICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAqQ2xlYXJQdHI7DQotICBCQlNfVEFCTEUgICAgICAgICAgICAgICAgICAgICAg ICAgICpCYnNUYWJsZTsNCi0gIExFR0FDWV9FRklfSEREX1RBQkxFICAgICAgICAgICAgICAgKkxl Z2FjeUVmaUhkZFRhYmxlOw0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJ bmRleDsNCi0gIFVJTlQzMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVHBtUG9pbnRlcjsN Ci0gIFZPSUQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKlRwbUJpbmFyeUltYWdlOw0K LSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUcG1CaW5hcnlJbWFnZVNpemU7 DQotICBVSU5UTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvY2F0aW9uOw0KLSAgVUlO VE4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBbGlnbm1lbnQ7DQotICBVSU5UTiAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIFRlbXBEYXRhOw0KLSAgRUZJX1BIWVNJQ0FMX0FERFJF U1MgICAgICAgICAgICAgICBBZGRyZXNzOw0KLSAgVUlOVDE2ICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBPbGRNYXNrOw0KLSAgVUlOVDE2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBO ZXdNYXNrOw0KLSAgVUlOVDMyICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHcmFudWxhcml0 eTsNCi0gIEVGSV9HQ0RfTUVNT1JZX1NQQUNFX0RFU0NSSVBUT1IgICAgRGVzY3JpcHRvcjsNCi0N Ci0gIExvY2F0aW9uICA9IDA7DQotICBBbGlnbm1lbnQgPSAwOw0KLQ0KLSAgLy8NCi0gIC8vIHdl IGFsbG9jYXRlIHRoZSBDL0QvRS9GIHNlZ21lbnQgYXMgUlQgY29kZSBzbyBubyBvbmUgd2lsbCB1 c2UgaXQgYW55IG1vcmUuDQotICAvLw0KLSAgQWRkcmVzcyA9IDB4QzAwMDA7DQotICBnRFMtPkdl dE1lbW9yeVNwYWNlRGVzY3JpcHRvciAoQWRkcmVzcywgJkRlc2NyaXB0b3IpOw0KLSAgaWYgKERl c2NyaXB0b3IuR2NkTWVtb3J5VHlwZSA9PSBFZmlHY2RNZW1vcnlUeXBlU3lzdGVtTWVtb3J5KSB7 DQotICAgIC8vDQotICAgIC8vIElmIGl0IGlzIGFscm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Q0VTUywNCi0gIC8vICAgICAgICAgICAgICAgICAgICBzaXplb2YgKFVJTlQ2NCksDQotICAv LyAgICAgICAgICAgICAgICAgICAgKFZPSUQgKikmVGlja2VyDQotICAvLyAgICAgICAgICAgICAg ICAgICAgKTsNCi0gIC8vIGVuZCB0ZXN0dGVzdA0KLSAgLy8NCi0gIEVmaVRvTGVnYWN5MTZCb290 VGFibGUgPSAmUHJpdmF0ZS0+SW50VGh1bmstPkVmaVRvTGVnYWN5MTZCb290VGFibGU7DQotICBT dGF0dXMgICAgICAgICAgICAgICAgID0gUHJpdmF0ZS0+TGVnYWN5Qmlvc1BsYXRmb3JtLT5HZXRQ bGF0Zm9ybUluZm8gKA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBQcml2YXRlLT5MZWdhY3lCaW9zUGxhdGZvcm0sDQotICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVmaUdldFBs YXRmb3JtQmluYXJ5U3lzdGVtUm9tLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmTGVnYWN5Qmlvc0ltYWdlLA0KLSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmTGVnYWN5Qmlv c0ltYWdlU2l6ZSwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJkxvY2F0aW9uLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmQWxpZ25tZW50LA0KLSAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLA0KLSAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAw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VHdWlkLA0KLSAgLy8gICAgICAgICAgICAgICAgICAgIEVG SV9WQVJJQUJMRV9OT05fVk9MQVRJTEUgfCBFRklfVkFSSUFCTEVfQk9PVFNFUlZJQ0VfQUNDRVNT IHwgRUZJX1ZBUklBQkxFX1JVTlRJTUVfQUNDRVNTLA0KLSAgLy8gICAgICAgICAgICAgICAgICAg IHNpemVvZiAoVUlOVDY0KSwNCi0gIC8vICAgICAgICAgICAgICAgICAgICAoVk9JRCAqKSZUaWNr ZXINCi0gIC8vICAgICAgICAgICAgICAgICAgICApOw0KLSAgLy8gZW5kIHRlc3R0ZXN0DQotICAv Lw0KLSAgLy8gQ29weSBFODIwIHRhYmxlIGFmdGVyIEluaXRpYWxpemVZb3Vyc2VsZiBpcyBjb21w bGV0ZWQNCi0gIC8vDQotICBaZXJvTWVtICgmUmVncywgc2l6ZW9mIChFRklfSUEzMl9SRUdJU1RF Ul9TRVQpKTsNCi0gIFJlZ3MuWC5BWCA9IExlZ2FjeTE2R2V0VGFibGVBZGRyZXNzOw0KLSAgUmVn cy5YLkNYID0gKFVJTlQxNilFODIwU2l6ZTsNCi0gIFJlZ3MuWC5EWCA9IDE7DQotICBQcml2YXRl LT5MZWdhY3lCaW9zLkZhckNhbGw4NiAoDQotICAgICAgICAgICAgICAgICAgICAgICAgJlByaXZh dGUtPkxlZ2FjeUJpb3MsDQotICAgICAgICAgICAgICAgICAgICAgICAgVGFibGUtPkNvbXBhdGli aWxpdHkxNkNhbGxTZWdtZW50LA0KLSAgICAgICAgICAgICAgICAgICAgICAgIFRhYmxlLT5Db21w YXRpYmlsaXR5MTZDYWxsT2Zmc2V0LA0KLSAgICAgICAgICAgICAgICAgICAgICAgICZSZWdzLA0K LSAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsDQotICAgICAgICAgICAgICAgICAgICAgICAg MA0KLSAgICAgICAgICAgICAgICAgICAgICAgICk7DQotDQotICBUYWJsZS0+RTgyMFBvaW50ZXIg PSAoVUlOVDMyKShSZWdz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ICAgICAgICAgICAgTlVMTCwNCi0g ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLA0KLSAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZMb2NhdGlvbiwNCi0gICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmQWxpZ25tZW50LA0KLSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsDQotICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgMA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICk7DQotICBpZiAoIUVGSV9FUlJPUiAoU3RhdHVzKSkgew0KLSAgICBQcml2YXRl LT5MZWdhY3kxNlRhYmxlLT5QY2lFeHByZXNzQmFzZSA9IChVSU5UMzIpTG9jYXRpb247DQotICAg IExvY2F0aW9uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gMDsNCi0gIH0NCi0NCi0g IC8vDQotICAvLyBDaGVjayBpZiBUUE0gaXMgc3VwcG9ydGVkLiBJZiB5ZXMgZ2V0IGEgcmVnaW9u IGluIEUwMDAwLEYwMDAwIHRvIGNvcHkgaXQNCi0gIC8vIGludG8sIGNvcHkgaXQgYW5kIHVwZGF0 ZSBwb2ludGVyIHRvIGJpbmFyeSBpbWFnZS4gVGhpcyBuZWVkcyB0byBiZQ0KLSAgLy8gZG9uZSBw cmlvciB0byBhbnkgT1BST00gZm9yIHNlY3VyaXR5IHB1cnBvc2VzLg0KLSAgLy8NCi0gIFN0YXR1 cyA9IFByaXZhdGUtPkxlZ2FjeUJpb3NQbGF0Zm9ybS0+R2V0UGxhdGZvcm1JbmZvICgNCi0gICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQcml2YXRlLT5MZWdhY3lCaW9z UGxhdGZvcm0sDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRWZp R2V0UGxhdGZvcm1CaW5hcnlUcG1CaW5hcnksDQotICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJlRwbUJpbmFyeUltYWdlLA0KLSAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICZUcG1CaW5hcnlJbWFnZVNpemUsDQotICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJkxvY2F0aW9uLA0KLSAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICZBbGlnbm1lbnQsDQotICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgMCwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAwDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgKTsNCi0gIGlmICghRUZJX0VSUk9SIChTdGF0dXMpKSB7DQotICAgIFplcm9NZW0gKCZSZWdz LCBzaXplb2YgKEVGSV9JQTMyX1JFR0lTVEVSX1NFVCkpOw0KLSAgICBSZWdzLlguQVggPSBMZWdh Y3kxNkdldFRhYmxlQWRkcmVzczsNCi0gICAgUmVncy5YLkNYID0gKFVJTlQxNilUcG1CaW5hcnlJ bWFnZVNpemU7DQotICAgIFJlZ3MuWC5EWCA9IDE7DQotICAgIFByaXZhdGUtPkxlZ2FjeUJpb3Mu RmFyQ2FsbDg2ICgNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICZQcml2YXRlLT5MZWdhY3lC aW9zLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgVGFibGUtPkNvbXBhdGliaWxpdHkxNkNh bGxTZWdtZW50LA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgVGFibGUtPkNvbXBhdGliaWxp dHkxNkNhbGxPZmZzZXQsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAmUmVncywNCi0gICAg ICAgICAgICAgICAgICAgICAgICAgIE5VTEwsDQotICAgICAg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ICAgPSAwOw0KLSAgICBERUJVRyAoKERFQlVHX0lORk8sICJPcmlnaW5h bCBzaXplIGlzIG5vdCBlbm91Z2guIFJlLWFsbG9jYXRlIHRoZSBtZW1vcnkuXG4iKSk7DQotICB9 DQotDQotICBpZiAobVN0cnVjdHVyZVRhYmxlQWRkcmVzcyA9PSAwKSB7DQotICAgIC8vDQotICAg IC8vIEFsbG9jYXRlIHJlc2VydmVkIG1lbW9yeSBiZWxvdyA0R0IuDQotICAgIC8vIFNtYmlvcyBz cGVjIHJlcXVpcmVzIHRoZSBzdHJ1Y3R1cmUgdGFibGUgaXMgYmVsb3cgNEdCLg0KLSAgICAvLw0K LSAgICBtU3RydWN0dXJlVGFibGVBZGRyZXNzID0gU0laRV80R0IgLSAxOw0KLSAgICBtU3RydWN0 dXJlVGFibGVQYWdlcyAgID0gRUZJX1NJWkVfVE9fUEFHRVMgKEVudHJ5UG9pbnRTdHJ1Y3R1cmUt PlRhYmxlTGVuZ3RoKTsNCi0gICAgU3RhdHVzICAgICAgICAgICAgICAgICA9IGdCUy0+QWxsb2Nh dGVQYWdlcyAoDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQWxsb2NhdGVN YXhBZGRyZXNzLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVmaVJlc2Vy dmVkTWVtb3J5VHlwZSwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU3Ry dWN0dXJlVGFibGVQYWdlcywNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm bVN0cnVjdHVyZVRhYmxlQWRkcmVzcw0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICk7DQotICAgIGlmIChFRklfRVJST1IgKFN0YXR1cykpIHsNCi0gICAgICBnQlMtPkZyZWVQ YWdlcyAoDQotICAgICAgICAgICAgIG1SZXNlcnZlU21iaW9zRW50cnlQb2ludCwNCi0gICAgICAg ICAgICAgRUZJX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Jlc3NV bmRlcjFNQjsNCi0gIFVJTlROICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW5kZXg7DQot ICBVSU5UMzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICpCYXNlVmVjdG9yTWFzdGVyOw0K LSAgRUZJX1BIWVNJQ0FMX0FERFJFU1MgICAgICAgICAgICAgICBTdGFydEFkZHJlc3M7DQotICBV SU5UMzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICpDbGVhclB0cjsNCi0gIEVGSV9QSFlT SUNBTF9BRERSRVNTICAgICAgICAgICAgICAgTWVtU3RhcnQ7DQotICBVSU5UMzIgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIEludFJlZGlyQ29kZTsNCi0gIFVJTlQzMiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgR3JhbnVsYXJpdHk7DQotICBCT09MRUFOICAgICAgICAgICAgICAgICAg ICAgICAgICAgIERlY29kZU9uOw0KLSAgVUlOVDMyICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBNZW1vcnlTaXplOw0KLSAgRUZJX0dDRF9NRU1PUllfU1BBQ0VfREVTQ1JJUFRPUiAgICBEZXNj cmlwdG9yOw0KLSAgVUlOVDY0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMZW5ndGg7DQot ICBVSU5UOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICpTZWN1cmVCb290Ow0KLSAgRUZJ X0VWRU5UICAgICAgICAgICAgICAgICAgICAgICAgICBJbnN0YWxsU21iaW9zRXZlbnQ7DQotICBF RklfRVZFTlQgICAgICAgICAgICAgICAgICAgICAgICAgIEVuZE9mRHhlRXZlbnQ7DQotDQotICAv Lw0KLSAgLy8gTG9hZCB0aGlzIGRyaXZlcidzIGltYWdlIHRvIG1lbW9yeQ0KLSAgLy8NCi0gIFN0 YXR1cyA9IFJlbG9jYXRlSW1hZ2VVbmRlcjRHSWZOZWVkZWQgKEltYWdlSGFuZGxlLCBTeXN0ZW1U YWJsZSk7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2wgKA0KLSAgICAgICAgICAgICAgICAgICZnRWZpR2VuZXJpY01lbVRlc3RQcm90b2NvbEd1aWQs DQotICAgICAgICAgICAgICAgICAgTlVMTCwNCi0gICAgICAgICAgICAgICAgICAoVk9JRCAqKikm UHJpdmF0ZS0+R2VuZXJpY01lbW9yeVRlc3QNCi0gICAgICAgICAgICAgICAgICApOw0KLSAgQVNT RVJUX0VGSV9FUlJPUiAoU3RhdHVzKTsNCi0NCi0gIC8vDQotICAvLyBNYWtlIHN1cmUgYWxsIG1l bW9yeSBmcm9tIDAtNjQwSyBpcyB0ZXN0ZWQNCi0gIC8vDQotICBmb3IgKFN0YXJ0QWRkcmVzcyA9 IDA7IFN0YXJ0QWRkcmVzcyA8IDB4YTAwMDA7ICkgew0KLSAgICBnRFMtPkdldE1lbW9yeVNwYWNl RGVzY3JpcHRvciAoU3RhcnRBZGRyZXNzLCAmRGVzY3JpcHRvcik7DQotICAgIGlmIChEZXNjcmlw dG9yLkdjZE1lbW9yeVR5cGUgIT0gRWZpR2NkTWVtb3J5VHlwZVJlc2VydmVkKSB7DQotICAgICAg U3RhcnRBZGRyZXNzID0gRGVzY3JpcHRvci5CYXNlQWRkcmVzcyArIERlc2NyaXB0b3IuTGVuZ3Ro Ow0KLSAgICAgIGNvbnRpbnVlOw0KLSAgICB9DQotDQotICAgIExlbmd0aCA9IE1JTiAoRGVzY3Jp cHRvci5MZW5ndGgsIDB4YTAwMDAgLSBTdGFydEFkZHJlc3MpOw0KLSAgICBQcml2YXRlLT5HZW5l cmljTWVtb3J5VGVzdC0+Q29tcGF0aWJsZVJhbmdlVGVzdCAoDQotICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIFByaXZhdGUtPkdlbmVyaWNNZW1vcnlUZXN0LA0KLSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBTdGFydEFkZHJlc3MsDQotICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIExlbmd0aA0KLSAgICAgICAgICAgICA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Ag ICAgICAgICAgTlVMTCwNCi0gICAgICAgICAgICAgICAgICAmZ0VmaUVuZE9mRHhlRXZlbnRHcm91 cEd1aWQsDQotICAgICAgICAgICAgICAgICAgJkVuZE9mRHhlRXZlbnQNCi0gICAgICAgICAgICAg ICAgICApOw0KLSAgQVNTRVJUX0VGSV9FUlJPUiAoU3RhdHVzKTsNCi0NCi0gIC8vDQotICAvLyBN YWtlIGEgbmV3IGhhbmRsZSBhbmQgaW5zdGFsbCB0aGUgcHJvdG9jb2wNCi0gIC8vDQotICBQcml2 YXRlLT5IYW5kbGUgPSBOVUxMOw0KLSAgU3RhdHVzICAgICAgICAgID0gZ0JTLT5JbnN0YWxsUHJv dG9jb2xJbnRlcmZhY2UgKA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICZQcml2YXRlLT5I YW5kbGUsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgJmdFZmlMZWdhY3lCaW9zUHJvdG9j b2xHdWlkLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgIEVGSV9OQVRJVkVfSU5URVJGQUNF LA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICZQcml2YXRlLT5MZWdhY3lCaW9zDQotICAg ICAgICAgICAgICAgICAgICAgICAgICAgKTsNCi0gIFByaXZhdGUtPkNzbTE2UGNpSW50ZXJmYWNl VmVyc2lvbiA9IEdldFBjaUludGVyZmFjZVZlcnNpb24gKFByaXZhdGUpOw0KLQ0KLSAgREVCVUcg KCgNCi0gICAgREVCVUdfSU5GTywNCi0gICAgIkNTTTE2IFBDSSBCSU9TIEludGVyZmFjZSBWZXJz aW9uOiAlMDJ4LiUwMnhcbiIsDQotICAgIChVSU5UOCkoUHJpdmF0ZS0+Q3NtMTZQY2lJbnRlcmZh Y2VWZXJzaW9uID4+IDgpLA0KLSAgICAoVUlOVDgpUHJpdmF0ZS0+Q3NtMTZQY2lJbnRlcmZhY2VW ZXJzaW9uDQotICAgICkpOw0KLSAgQVNTRVJUIChQcml2YXRl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BERUJVRyAoKERFQlVHX0lORk8sICIgTk8gIFByaW8gYmIvZGQvZmYgY2wv c2MgVHlwZSBTdGF0IHNlZ206b2ZmcyBtZmdzOm1mZ28gZGVzczpkZXNvXG4iKSk7DQotICBERUJV RyAoKERFQlVHX0lORk8sICI9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PVxuIikpOw0KLSAgZm9yIChJbmRleCA9IDA7IEluZGV4 IDwgTUFYX0JCU19FTlRSSUVTOyBJbmRleCsrKSB7DQotICAgIC8vDQotICAgIC8vIEZpbHRlcg0K LSAgICAvLw0KLSAgICBpZiAoQmJzVGFibGVbSW5kZXhdLkJvb3RQcmlvcml0eSA9PSBCQlNfSUdO T1JFX0VOVFJZKSB7DQotICAgICAgY29udGludWU7DQotICAgIH0NCi0NCi0gICAgREVCVUcgKCgN Ci0gICAgICBERUJVR19JTkZPLA0KLSAgICAgICIgJTAyeDogJTA0eCAlMDJ4LyUwMngvJTAyeCAl MDJ4LyUwMnggJTA0eCAlMDR4IiwNCi0gICAgICAoVUlOVE4pSW5kZXgsDQotICAgICAgKFVJTlRO KUJic1RhYmxlW0luZGV4XS5Cb290UHJpb3JpdHksDQotICAgICAgKFVJTlROKUJic1RhYmxlW0lu ZGV4XS5CdXMsDQotICAgICAgKFVJTlROKUJic1RhYmxlW0luZGV4XS5EZXZpY2UsDQotICAgICAg KFVJTlROKUJic1RhYmxlW0luZGV4XS5GdW5jdGlvbiwNCi0gICAgICAoVUlOVE4pQmJzVGFibGVb SW5kZXhdLkNsYXNzLA0KLSAgICAgIChVSU5UTilCYnNUYWJsZVtJbmRleF0uU3ViQ2xhc3MsDQot ICAgICAgKFVJTlROKUJic1RhYmxlW0luZGV4XS5EZXZpY2VUeXBlLA0KLSAgICAgIChVSU5UTikq KFVJTlQxNiAqKSZCYnNUYWJsZVtJbmRleF0uU3RhdHVzRmxhZ3MNCi0gICAgICApKTsNCi0gICAg REVCVUcgKCgNCi0gICAgICBERUJVR19JTkZPLA0KLSAgICAgICIgJTA0eDolMDR4ICUwNHg6JTA0 eCAlMDR4OiUwNHgiLA0KLSAgICAgIChVSU5UTilCYnNUYWJsZVtJbmRleF0uQm9vdEhhbmRsZXJT ZWdtZW50LA0KLSAgICAgIChVSU5UTilCYnNUYWJsZVtJbmRleF0uQm9vdEhhbmRsZXJPZmZzZXQs DQotICAgICAgKFVJTlROKUJic1RhYmxlW0luZGV4XS5NZmdTdHJpbmdTZWdtZW50LA0KLSAgICAg IChVSU5UTilCYnNUYWJsZVtJbmRleF0uTWZnU3RyaW5nT2Zmc2V0LA0KLSAgICAgIChVSU5UTilC YnNUYWJsZVtJbmRleF0uRGVzY1N0cmluZ1NlZ21lbnQsDQotICAgICAgKFVJTlROKUJic1RhYmxl W0luZGV4XS5EZXNjU3RyaW5nT2Zmc2V0DQotICAgICAgKSk7DQotDQotICAgIC8vDQotICAgIC8v IFByaW50IERlc2NTdHJpbmcNCi0gICAgLy8NCi0gICAgU3RyaW5nID0gKENIQVI4ICopKCgoVUlO VE4pQmJzVGFibGVbSW5kZXhdLkRlc2NTdHJpbmdTZWdtZW50IDw8IDQpICsgQmJzVGFibGVbSW5k ZXhdLkRlc2NTdHJpbmdPZmZzZXQpOw0KLSAgICBpZiAoU3RyaW5nICE9IE5VTEwpIHsNCi0gICAg ICBERUJVRyAoKERFQlVHX0lORk8sICIgKCIpKTsNCi0gICAgICBmb3IgKFN1YkluZGV4ID0gMDsg U3RyaW5nW1N1YkluZGV4XSAhPSAwOyBTdWJJbmRleCsrKSB7DQotICAgICAgICBERUJVRyAoKERF QlVHX0lORk8sICIlYyIsIFN0cmluZ1tTdWJJbmRleF0pKTsNCi0gICAgICB9DQotDQotICAgICAg REVCVUcgKChERUJVR19JTkZPLCAiKSIpKTsNCi0gICAgfQ0KLQ0KLSAgICBERUJVRyAoKERFQlVH X0lORk8sICJcbiIpKTsNCi0gIH0NCi0NCi0gIERFQlVHICgoREVCVUdfSU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FzdGVyQWRkcmVzcykpOw0KLSAgICBERUJVRyAoKERFQlVHX0lORk8sICIgIEhk ZElycSAgICAtICUwMnhcbiIsIEhkZEluZm9bSW5kZXhdLkhkZElycSkpOw0KLSAgICBERUJVRyAo KERFQlVHX0lORk8sICIgIElkZW50aWZ5RHJpdmVbMF0uUmF3WzBdIC0gJXhcbiIsIEhkZEluZm9b SW5kZXhdLklkZW50aWZ5RHJpdmVbMF0uUmF3WzBdKSk7DQotICAgIERFQlVHICgoREVCVUdfSU5G TywgIiAgSWRlbnRpZnlEcml2ZVsxXS5SYXdbMF0gLSAleFxuIiwgSGRkSW5mb1tJbmRleF0uSWRl bnRpZnlEcml2ZVsxXS5SYXdbMF0pKTsNCi0gIH0NCi0NCi0gIERFQlVHICgoREVCVUdfSU5GTywg IlxuIikpOw0KLQ0KLSAgcmV0dXJuOw0KLX0NCi0NCi0vKioNCi0gIFByaW50IHRoZSBQQ0kgSW50 ZXJydXB0IExpbmUgYW5kIEludGVycnVwdCBQaW4gcmVnaXN0ZXJzLg0KLSoqLw0KLVZPSUQNCi1Q cmludFBjaUludGVycnVwdFJlZ2lzdGVyICgNCi0gIFZPSUQNCi0gICkNCi17DQotICBFRklfU1RB VFVTICAgICAgICAgICBTdGF0dXM7DQotICBVSU5UTiAgICAgICAgICAgICAgICBJbmRleDsNCi0g IEVGSV9IQU5ETEUgICAgICAgICAgICpIYW5kbGVzOw0KLSAgVUlOVE4gICAgICAgICAgICAgICAg SGFuZGxlTnVtOw0KLSAgRUZJX1BDSV9JT19QUk9UT0NPTCAgKlBjaUlvOw0KLSAgVUlOVDggICAg ICAgICAgICAgICAgSW50ZXJydXB0WzJdOw0KLSAgVUlOVE4gICAgICAgICAgICAgICAgU2VnbWVu dDsNCi0gIFVJTlROICAgICAgICAgICAgICAgIEJ1czsNCi0gIFVJTlROICAgICAgICAgICAgICAg IERldmljZTsNCi0gIFVJTlROICAgICAgICAgICAgICAgIEZ1bmN0aW9uOw0KLQ0KLSAgZ0JTLT5M b2NhdGVIYW5kbGVCdWZmZXIgKA0KLSAgICAgICAgIEJ5UHJvdG9jb2wsDQotICAgICAgICAgJmdF ZmlQY2lJb1Byb3RvY29sR3VpZCwNCi0gICAgICAgICBOVUxMLA0KLSAgICAgICAgICZIYW5kbGVO dW0sDQotICAgICAgICAgJkhhbmRsZXMNCi0gICAgICAgICApOw0KLQ0KLSAgQnVzICAgICAgPSAw Ow0KLSAgRGV2aWNlICAgPSAwOw0KLSAgRnVuY3Rpb24gPSAwOw0KLQ0KLSAgREVCVUcgKChERUJV R19JTkZPLCAiXG4iKSk7DQotICBERUJVRyAoKERFQlVHX0lORk8sICIgYmIvZGQvZmYgaW50ZXJy dXB0IGxpbmUgaW50ZXJydXB0IHBpblxuIikpOw0KLSAgREVCVUcgKChERUJVR19JTkZPLCAiPT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiIpKTsNCi0gIGZvciAoSW5kZXgg PSAwOyBJbmRleCA8IEhhbmRsZU51bTsgSW5kZXgrKykgew0KLSAgICBTdGF0dXMgPSBnQlMtPkhh bmRsZVByb3RvY29sIChIYW5kbGVzW0luZGV4XSwgJmdFZmlQY2lJb1Byb3RvY29sR3VpZCwgKFZP SUQgKiopJlBjaUlvKTsNCi0gICAgaWYgKCFFRklfRVJST1IgKFN0YXR1cykpIHsNCi0gICAgICBT dGF0dXMgPSBQY2lJby0+UGNpLlJlYWQgKA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBQ Y2lJbywNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgRWZpUGNpSW9XaWR0aFVpbnQ4LA0K LSAgICAgICAgICAgICAgICAgICAgICAgICAgICBQQ0lfSU5UX0xJTkVfT0ZGU0VULA0KLSAgICAg ICAgICAgICAgICAgICAgICAgICAgICAyLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBJ bnRlcnJ1cHQNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsNCi0gICAgfQ0KLQ0KLSAg ICBpZiAoIUVGSV9FUlJPUiAoU3RhdHVzKSkgew0KLSAgICAgIFN0YXR1cyA9IFBjaUlvLT5HZXRM b2NhdGlvbiAoDQotICAgICAgICAgICAgICAgICAgICAgICAgUGNpSW8sDQotICAgICAgICAgICAg ICAgICAgICAgICAgJlNlZ21lbnQsDQotICAgICAgICAgICAgICAgICAgICAgICAgJkJ1cywNCi0g ICAgICAgICAgICAgICAgICAgICAgICAmRGV2aWNlLA0KLSAgICAgICAgICAgICAgICAgICAgICAg ICZGdW5jdGlvbg0KLSAgICAgICAgICAgICAgICAgICAgICAgICk7DQotICAgIH0NCi0NCi0gICAg aWYgKCFFRklfRVJST1IgKFN0YXR1cykpIHsNCi0gICAgICBERUJVRyAoKA0KLSAgICAgICAgREVC VUdfSU5GTywNCi0gICAgICAgICIgJTAyeC8lMDJ4LyUwMnggMHglMDJ4ICAgICAgICAgICAweCUw MnhcbiIsDQotICAgICAgICBCdXMsDQotICAgICAgICBEZXZpY2UsDQotICAgICAgICBGdW5jdGlv biwNCi0gICAgICAgIEludGVycnVwdFswXSwNCi0gICAgICAgIEludGVycnVwdFsxXQ0KLSAgICAg ICAgKSk7DQotICAgIH0NCi0gIH0NCi0NCi0gIERFQlVHICgoREVCVUdfSU5GTywgIlxuIikpOw0K LQ0KLSAgaWYgKEhhbmRsZXMgIT0gTlVMTCkgew0KLSAgICBGcmVlUG9vbCAoSGFuZGxlcyk7DQot ICB9DQotfQ0KLQ0KLS8qKg0KLSAgSWRlbnRpZnkgZHJpdmUgZGF0YSBtdXN0IGJlIHVwZGF0ZWQg dG8gYWN0dWFsIHBhcmFtZXRlcnMgYmVmb3JlIGJvb3QuDQotDQotICBAcGFyYW0gIElkZW50aWZ5 RHJpdmVEYXRhICAgICAgIEFUQSBJZGVudGlmeSBEYXRhDQotDQotKiovDQotVk9JRA0KLVVwZGF0 ZUlkZW50aWZ5RHJpdmVEYXRhICgNCi0gIElOICBVSU5UOCAgKklkZW50aWZ5RHJpdmVEYXRhDQot ICApOw0KLQ0KLS8qKg0KLSAgVXBkYXRlIFNJTyBkYXRhLg0KLQ0KLSAgQHBhcmFtICBQcml2YXRl ICAgICAgICAgICAgICAgICBMZWdhY3kgQklPUyBJbnN0YW5jZSBkYXRhDQotDQotICBAcmV0dmFs IEVGSV9TVUNDRVNTICAgICAgICAgICAgIFJlbW92YWJsZSBtZWRpYSBub3QgcHJlc2VudA0KLQ0K LSoqLw0KLUVGSV9TVEFUVVMNCi1VcGRhdGVTaW9EYXRhICgNCi0gIElOICBMRUdBQ1lfQklPU19J TlNUQU5DRSAgKlByaXZhdGUNCi0gICkNCi17DQotICBFRklfU1RBVFVTICAgICAgICAgICAgICAg ICAgICAgICAgICAgU3RhdHVzOw0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIEluZGV4Ow0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEluZGV4 MTsNCi0gIFVJTlQ4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMZWdhY3lJbnRlcnJ1 cHRzWzE2XTsNCi0gIEVGSV9MRUdBQ1lfSVJRX1JPVVRJTkdfRU5UUlkgICAgICAgICAqUm91dGlu Z1RhYmxlOw0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJvdXRpbmdU YWJsZUVudHJpZXM7DQotICBFRklfTEVHQUNZX0lSUV9QUklPUklUWV9UQUJMRV9FTlRSWSAgKkly cVByaW9yaXR5VGFibGU7DQotICBVSU5UTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg TnVtYmVyUHJpb3JpdHlFbnRyaWVzOw0KLSAgRUZJX1RPX0NPTVBBVElCSUxJVFkxNl9CT09UX1RB QkxFICAgICpFZmlUb0xlZ2FjeTE2Qm9vdFRhYmxlOw0KLSAgVUlOVDggICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIEhkZElycTsNCi0gIFVJTlQxNiAgICAgICAgICAg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0gNF0uSXJxOw0KLSAgfQ0KLQ0KLSAgTGVnYWN5SW50ZXJydXB0 c1s3XSA9IEVmaVRvTGVnYWN5MTZCb290VGFibGUtPlNpb0RhdGEuRmxvcHB5LklycTsNCi0NCi0g IC8vDQotICAvLyBHZXQgTGVnYWN5IEhkZCBJUlFzLiBJZiBuYXRpdmUgbW9kZSB0cmVhdCBhcyBQ Q0kNCi0gIC8vDQotICBmb3IgKEluZGV4ID0gMDsgSW5kZXggPCAyOyBJbmRleCsrKSB7DQotICAg IEhkZElycSA9IEVmaVRvTGVnYWN5MTZCb290VGFibGUtPkhkZEluZm9bSW5kZXhdLkhkZElycTsN Ci0gICAgaWYgKChIZGRJcnEgIT0gMCkgJiYgKChIZGRJcnEgPT0gMTUpIHx8IChIZGRJcnEgPT0g MTQpKSkgew0KLSAgICAgIExlZ2FjeUludGVycnVwdHNbSW5kZXggKyA4XSA9IEhkZElycTsNCi0g ICAgfQ0KLSAgfQ0KLQ0KLSAgUHJpdmF0ZS0+TGVnYWN5Qmlvc1BsYXRmb3JtLT5HZXRSb3V0aW5n VGFibGUgKA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFByaXZhdGUtPkxlZ2Fj eUJpb3NQbGF0Zm9ybSwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoVk9JRCAq KSZSb3V0aW5nVGFibGUsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJlJvdXRp bmdUYWJsZUVudHJpZXMsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwN Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLA0KLSAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIChWT0lEICoqKSZJcnFQcmlvcml0eVRhYmxlLA0KLSAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICZOdW1iZXJQcmlvcml0eUVudHJpZXMNCi0gICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICApOw0KLSAgLy8NCi0gIC8vIFJlbW92ZSBsZWdhY3kg aW50ZXJydXB0cyBmcm9tIHRoZSBsaXN0IG9mIFBDSSBpbnRlcnJ1cHRzIGF2YWlsYWJsZS4NCi0g IC8vDQotICBmb3IgKEluZGV4ID0gMDsgSW5kZXggPD0gMHgwYjsgSW5kZXgrKykgew0KLSAgICBm b3IgKEluZGV4MSA9IDA7IEluZGV4MSA8PSBOdW1iZXJQcmlvcml0eUVudHJpZXM7IEluZGV4MSsr KSB7DQotICAgICAgaWYgKExlZ2FjeUludGVycnVwdHNbSW5kZXhdICE9IDApIHsNCi0gICAgICAg IExlZ2FjeUludCA9IChVSU5UMTYpKExlZ2FjeUludCB8ICgxIDw8IExlZ2FjeUludGVycnVwdHNb SW5kZXhdKSk7DQotICAgICAgICBpZiAoTGVnYWN5SW50ZXJydXB0c1tJbmRleF0gPT0gSXJxUHJp b3JpdHlUYWJsZVtJbmRleDFdLklycSkgew0KLSAgICAgICAgICBJcnFQcmlvcml0eVRhYmxlW0lu ZGV4MV0uVXNlZCA9IExFR0FDWV9VU0VEOw0KLSAgICAgICAgfQ0KLSAgICAgIH0NCi0gICAgfQ0K LSAgfQ0KLQ0KLSAgUHJpdmF0ZS0+TGVnYWN5ODI1OS0+R2V0TWFzayAoDQotICAgICAgICAgICAg ICAgICAgICAgICAgIFByaXZhdGUtPkxlZ2FjeTgyNTksDQotICAgICAgICAgICAgICAgICAgICAg ICAgICZMZWdNYXNrLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLA0KLSAgICAgICAg ICAgICAgICAgICAgICAgICBOVUxMLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMDQot ICAgICAgICAgICAgICAgICAgICAgICAgICk7DQotDQotICAvLw0KLSAgLy8gU2V0IFNJTyBpbnRl cnJ1cHRzIGFuZCBkaXNhYmxlIG1vdXNlLiBMZXQgbW91c2UgZHJpdmVyDQotICAvLyByZS1lbmFi bGUgaXQuDQotICAvLw0KLSAgTGVnTWFzayA9IChVSU5UMTYpKChMZWdNYXNrICZ+TGVnYWN5SW50 KSB8IDB4MTAwMCk7DQotICBQcml2YXRlLT5MZWdhY3k4MjU5LT5TZXRNYXNrICgNCi0gICAgICAg ICAgICAgICAgICAgICAgICAgUHJpdmF0ZS0+TGVnYWN5ODI1OSwNCi0gICAgICAgICAgICAgICAg ICAgICAgICAgJkxlZ01hc2ssDQotICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsDQotICAg ICAgICAgICAgICAgICAgICAgICAgIE5VTEwsDQotICAgICAgICAgICAgICAgICAgICAgICAgIE5V TEwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgKTsNCi0NCi0gIC8vDQotICAvLyBEaXNhYmxl IG1vdXNlIGluIGtleWJvYXJkIGNvbnRyb2xsZXINCi0gIC8vDQotICBSZWdpc3RlciA9IDB4QTc7 DQotICBTdGF0dXMgICA9IGdCUy0+TG9jYXRlSGFuZGxlQnVmZmVyICgNCi0gICAgICAgICAgICAg ICAgICAgIEJ5UHJvdG9jb2wsDQotICAgICAgICAgICAgICAgICAgICAmZ0VmaUlzYUlvUHJvdG9j b2xHdWlkLA0KLSAgICAgICAgICAgICAgICAgICAgTlVMTCwNCi0gICAgICAgICAgICAgICAgICAg ICZIYW5kbGVDb3VudCwNCi0gICAgICAgICAgICAgICAgICAgICZIYW5kbGVCdWZmZXINCi0gICAg ICAgICAgICAgICAgICAgICk7DQotICBpZiAoRUZJX0VSUk9SIChTdGF0dXMpKSB7DQotICAgIHJl dHVybiBTdGF0dXM7DQotICB9DQotDQotICBmb3IgKEluZGV4ID0gMDsgSW5kZXggPCBIYW5kbGVD b3VudDsgSW5kZXgrKykgew0KLSAgICBTdGF0dXMgPSBnQlMtPkhhbmRsZVByb3RvY29sICgNCi0g ICAgICAgICAgICAgICAgICAgIEhhbmRsZUJ1ZmZlcltJbmRleF0sDQotICAgICAgICAgICAgICAg ICAgICAmZ0VmaUlzYUlvUHJvdG9jb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VudGlmeURyaXZlWzFdLlJhd1swXSkpOw0KLSAgICB9DQot ICB9DQotfQ0KLQ0KLS8qKg0KLSAgRW5hYmxlIGlkZSBjb250cm9sbGVyLiAgVGhpcyBnZXRzIGRp c2FibGVkIHdoZW4gTGVnYWN5Qm9vdC5jIGlzIGFib3V0DQotICB0byBydW4gdGhlIE9wdGlvbiBS T01zLg0KLQ0KLSAgQHBhcmFtICBQcml2YXRlICAgICAgICBMZWdhY3kgQklPUyBJbnN0YW5jZSBk YXRhDQotDQotDQotKiovDQotVk9JRA0KLUVuYWJsZUlkZUNvbnRyb2xsZXIgKA0KLSAgSU4gTEVH QUNZX0JJT1NfSU5TVEFOQ0UgICpQcml2YXRlDQotICApDQotew0KLSAgRUZJX1BDSV9JT19QUk9U T0NPTCAgKlBjaUlvOw0KLSAgRUZJX1NUQVRVUyAgICAgICAgICAgU3RhdHVzOw0KLSAgRUZJX0hB TkRMRSAgICAgICAgICAgSWRlQ29udHJvbGxlcjsNCi0gIFVJTlQ4ICAgICAgICAgICAgICAgIEJ5 dGVCdWZmZXI7DQotICBVSU5UTiAgICAgICAgICAgICAgICBIYW5kbGVDb3VudDsNCi0gIEVGSV9I QU5ETEUgICAgICAgICAgICpIYW5kbGVCdWZmZXI7DQotDQotICBTdGF0dXMgPSBQcml2YXRlLT5M ZWdhY3lCaW9zUGxhdGZvcm0tPkdldFBsYXRmb3JtSGFuZGxlICgNCi0gICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBQcml2YXRlLT5MZWdhY3lCaW9zUGxhdGZvcm0sDQot ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRWZpR2V0UGxhdGZvcm1J ZGVIYW5kbGUsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwN Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmSGFuZGxlQnVmZmVy LA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZIYW5kbGVDb3Vu dCwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMDQotICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsNCi0gIGlmICghRUZJX0VS Uk9SIChTdGF0dXMpKSB7DQotICAgIElkZUNvbnRyb2xsZXIgPSBIYW5kbGVCdWZmZXJbMF07DQot ICAgIFN0YXR1cyAgICAgICAgPSBnQlMtPkhhbmRsZVByb3RvY29sICgNCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICBJZGVDb250cm9sbGVyLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAg ICZnRWZpUGNpSW9Qcm90b2NvbEd1aWQsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgKFZP SUQgKiopJlBjaUlvDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsNCi0gICAgQnl0ZUJ1 ZmZlciA9IDB4MWY7DQotICAgIGlmICghRUZJX0VSUk9SIChTdGF0dXMpKSB7DQotICAgICAgUGNp SW8tPlBjaS5Xcml0ZSAoUGNpSW8sIEVmaVBjaUlvV2lkdGhVaW50OCwgMHgwNCwgMSwgJkJ5dGVC dWZmZXIpOw0KLSAgICB9DQotICB9DQotfQ0KLQ0KLS8qKg0KLSAgRW5hYmxlIGlkZSBjb250cm9s bGVyLiAgVGhpcyBnZXRzIGRpc2FibGVkIHdoZW4gTGVnYWN5Qm9vdC5jIGlzIGFib3V0DQotICB0 byBydW4gdGhlIE9wdGlvbiBST01zLg0KLQ0KLSAgQHBhcmFtICBQcml2YXRlICAgICAgICAgICAg ICAgICBMZWdhY3kgQklPUyBJbnN0YW5jZSBkYXRhDQotDQotDQotKiovDQotVk9JRA0KLUVuYWJs ZUFsbENvbnRyb2xsZXJzICgNCi0gIElOIExFR0FDWV9CSU9TX0lOU1RBTkNFICAqUHJpdmF0ZQ0K LSAgKQ0KLXsNCi0gIFVJTlROICAgICAgICAgICAgICAgIEhhbmRsZUNvdW50Ow0KLSAgRUZJX0hB TkRMRSAgICAgICAgICAgKkhhbmRsZUJ1ZmZlcjsNCi0gIFVJTlROICAgICAgICAgICAgICAgIElu ZGV4Ow0KLSAgRUZJX1BDSV9JT19QUk9UT0NPTCAgKlBjaUlvOw0KLSAgUENJX1RZUEUwMSAgICAg ICAgICAgUGNpQ29uZmlnSGVhZGVyOw0KLSAgRUZJX1NUQVRVUyAgICAgICAgICAgU3RhdHVzOw0K LQ0KLSAgLy8NCi0gIC8vDQotICAvLw0KLSAgRW5hYmxlSWRlQ29udHJvbGxlciAoUHJpdmF0ZSk7 DQotDQotICAvLw0KLSAgLy8gQXNzdW1wdGlvbiBpcyB0YWJsZSBpcyBidWlsdCBmcm9tIGxvdyBi dXMgdG8gaGlnaCBidXMgbnVtYmVycy4NCi0gIC8vDQotICBTdGF0dXMgPSBnQlMtPkxvY2F0ZUhh bmRsZUJ1ZmZlciAoDQotICAgICAgICAgICAgICAgICAgQnlQcm90b2NvbCwNCi0gICAgICAgICAg ICAgICAgICAmZ0VmaVBjaUlvUHJvdG9jb2xHdWlkLA0KLSAgICAgICAgICAgICAgICAgIE5VTEws DQotICAgICAgICAgICAgICAgICAgJkhhbmRsZUNvdW50LA0KLSAgICAgICAgICAgICAgICAgICZI YW5kbGVCdWZmZXINCi0gICAgICAgICAgICAgICAgICApOw0KLSAgQVNTRVJUX0VGSV9FUlJPUiAo U3RhdHVzKTsNCi0NCi0gIGZvciAoSW5kZXggPSAwOyBJbmRleCA8IEhhbmRsZUNvdW50OyBJbmRl eCsrKSB7DQotICAgIFN0YXR1cyA9IGdCUy0+SGFuZGxlUHJvdG9jb2wgKA0KLSAgICAgICAgICAg ICAgICAgICAgSGFuZGxlQnVmZmVyW0luZGV4XSwNCi0gICAgICAgICAgICAgICAgICAgICZnRWZp UGNpSW9Qcm90b2NvbEd1aWQsDQotICAgICAgICAgICAgICAgICAgICAoVk9JRCAqKikmUGNpSW8N Ci0g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UVVMNCi1MZWdhY3lHZXREYXRhT3JUYWJsZSAoDQotICBJTiBFRklfTEVHQUNZX0JJT1Nf UFJPVE9DT0wgICAgKlRoaXMsDQotICBJTiBFRklfR0VUX1BMQVRGT1JNX0lORk9fTU9ERSAgSWQN Ci0gICkNCi17DQotICBWT0lEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICpUYWJsZTsN Ci0gIFVJTlQzMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGFibGVQdHI7DQotICBVSU5U TiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRhYmxlU2l6ZTsNCi0gIFVJTlROICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgQWxpZ25tZW50Ow0KLSAgVUlOVE4gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBMb2NhdGlvbjsNCi0gIEVGSV9TVEFUVVMgICAgICAgICAgICAgICAg ICAgICAgICAgU3RhdHVzOw0KLSAgRUZJX0xFR0FDWV9CSU9TX1BMQVRGT1JNX1BST1RPQ09MICAq TGVnYWN5Qmlvc1BsYXRmb3JtOw0KLSAgRUZJX0NPTVBBVElCSUxJVFkxNl9UQUJMRSAgICAgICAg ICAqTGVnYWN5MTZUYWJsZTsNCi0gIEVGSV9JQTMyX1JFR0lTVEVSX1NFVCAgICAgICAgICAgICAg UmVnczsNCi0gIExFR0FDWV9CSU9TX0lOU1RBTkNFICAgICAgICAgICAgICAgKlByaXZhdGU7DQot DQotICBQcml2YXRlID0gTEVHQUNZX0JJT1NfSU5TVEFOQ0VfRlJPTV9USElTIChUaGlzKTsNCi0N Ci0gIExlZ2FjeUJpb3NQbGF0Zm9ybSA9IFByaXZhdGUtPkxlZ2FjeUJpb3NQbGF0Zm9ybTsNCi0g IExlZ2FjeTE2VGFibGUgICAgICA9IFByaXZhdGUtPkxlZ2FjeTE2VGFibGU7DQotDQotICAvLw0K LSAgLy8gUGhhc2UgMSAtIGdldCBhbiBhZGRyZXNzIGFsbG9jYXRlZCBpbiAxNi1iaXQgY29kZQ0K LSAgLy8NCi0gIHdoaWxlIChUUlVFKSB7DQotICAgIHN3aXRjaCAoSWQpIHsNCi0gICAgICBjYXNl IEVmaUdldFBsYXRmb3JtQmluYXJ5TXBUYWJsZToNCi0gICAgICBjYXNlIEVmaUdldFBsYXRmb3Jt QmluYXJ5T2VtSW50RGF0YToNCi0gICAgICBjYXNlIEVmaUdldFBsYXRmb3JtQmluYXJ5T2VtMzJE YXRhOg0KLSAgICAgIGNhc2UgRWZpR2V0UGxhdGZvcm1CaW5hcnlPZW0xNkRhdGE6DQotICAgICAg ew0KLSAgICAgICAgU3RhdHVzID0gTGVnYWN5Qmlvc1BsYXRmb3JtLT5HZXRQbGF0Zm9ybUluZm8g KA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExlZ2FjeUJpb3NQbGF0 Zm9ybSwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJZCwNCi0gICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoVk9JRCAqKSZUYWJsZSwNCi0gICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmVGFibGVTaXplLA0KLSAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZMb2NhdGlvbiwNCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmQWxpZ25tZW50LA0KLSAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDAsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgMA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7DQot ICAgICAgICBERUJVRyAoKERFQlVHX0lORk8sICJMZWdhY3lHZXREYXRhT3JUYWJsZSAtIElEOiAl eCwgJXJcbiIsIChVSU5UTilJZCwgU3RhdHVzKSk7DQotICAgICAgICBERUJVRyAoKERFQlVHX0lO Rk8sICIgIFRhYmxlIC0gJXgsIFNpemUgLSAleCwgTG9jYXRpb24gLSAleCwgQWxpZ25tZW50IC0g JXhcbiIsIChVSU5UTilUYWJsZSwgKFVJTlROKVRhYmxlU2l6ZSwgKFVJTlROKUxvY2F0aW9uLCAo VUlOVE4pQWxpZ25tZW50KSk7DQotICAgICAgICBicmVhazsNCi0gICAgICB9DQotDQotICAgICAg ZGVmYXVsdDoNCi0gICAgICB7DQotICAgICAgICByZXR1cm4gRUZJX0lOVkFMSURfUEFSQU1FVEVS Ow0KLSAgICAgIH0NCi0gICAgfQ0KLQ0KLSAgICBpZiAoRUZJX0VSUk9SIChTdGF0dXMpKSB7DQot ICAgICAgcmV0dXJuIFN0YXR1czsNCi0gICAgfQ0KLQ0KLSAgICBaZXJvTWVtICgmUmVncywgc2l6 ZW9mIChFRklfSUEzMl9SRUdJU1RFUl9TRVQpKTsNCi0gICAgUmVncy5YLkFYID0gTGVnYWN5MTZH ZXRUYWJsZUFkZHJlc3M7DQotICAgIFJlZ3MuWC5DWCA9IChVSU5UMTYpVGFibGVTaXplOw0KLSAg ICBSZWdzLlguQlggPSAoVUlOVDE2KUxvY2F0aW9uOw0KLSAgICBSZWdzLlguRFggPSAoVUlOVDE2 KUFsaWdubWVudDsNCi0gICAgUHJpdmF0ZS0+TGVnYWN5Qmlvcy5GYXJDYWxsODYgKA0KLSAgICAg ICAgICAgICAgICAgICAgICAgICAgVGhpcywNCi0gICAgICAgICAgICAgICAgICAgICAgICAgIFBy aXZhdGUtPkxlZ2FjeTE2Q2FsbFNlZ21lbnQsDQotICAgICAgICAgICAgICAgICAgICAgICAgICBQ cml2YXRlLT5MZWdhY3kxNkNhbGxPZmZzZXQsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAm UmVncywNCi0gICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsDQotICAgICAgICAgICAgICAg ICAgICAgICAgICAwDQotICAgICAgICAgICAgICAgICAgICAgICAgICApOw0KLQ0KLSAgICBpZiAo UmVncy5YLkFYICE9IDApIHsNCi0gICAgICBERUJVRyAoKERFQlVHX0VSUk9SLCAiVGFibGUgSUQg JXggbGVuZ3RoIGluc3VmZmljaWVudFxuIiwgSWQpKTsNCi0gICAgICByZXR1cm4gRUZJX09VVF9P Rl9SRVNPVVJDRVM7DQotICAgIH0gZWxzZSB7DQotICAgICAgYnJlYWs7DQotICAgIH0NCi0gIH0N Ci0NCi0gIC8vDQotICAvLyBQaGFzZSAyIENhbGwgcm91dGluZSBzZWNvbmQgdGltZSB3aXRoIGFk ZHJlc3MgdG8gYWxsb3cgYWRkcmVzcyBhZGp1c3RtZW50DQotICAvLw0KLSAgU3RhdHVzID0gTGVn YWN5Qmlvc1BsYXRmb3JtLT5HZXRQbGF0Zm9ybUluZm8gKA0KLSAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIExlZ2FjeUJpb3NQbGF0Zm9ybSwNCi0gICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBJZCwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoVk9JRCAq KSZUYWJsZSwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmVGFibGVTaXplLA0K LSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZMb2NhdGlvbiwNCi0gICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmQWxpZ25tZW50LA0KLSAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIFJlZ3MuWC5EUywNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBSZWdzLlguQlgNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApOw0KLSAgc3dp dGNoIChJZCkgew0KLSAgICBjYXNlIEVmaUdldFBsYXRmb3JtQmluYXJ5TXBUYWJsZToNCi0gICAg ew0KLSAgICAgIExlZ2FjeTE2VGFibGUtPk1wVGFibGVQdHIgICAgPSAoVUlOVDMyKShSZWdzLlgu RFMgKiAxNiArIFJlZ3MuWC5CWCk7DQotIC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KLSAgVUlOVE4gICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBDb3B5U2l6ZTsNCi0gIFZPSUQgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKkFjcGlQdHI7DQotICBIRERfSU5GTyAgICAgICAgICAgICAgICAgICAgICAg ICAgICpIZGRJbmZvOw0KLSAgSEREX0lORk8gICAgICAgICAgICAgICAgICAgICAgICAgICAqTG9j YWxIZGRJbmZvOw0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbmRleDsN Ci0gIEVGSV9DT01QQVRJQklMSVRZMTZfVEFCTEUgICAgICAgICAgKkxlZ2FjeTE2VGFibGU7DQot ICBVSU5UMzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICpCZGFQdHI7DQotICBVSU5UMTYg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhkZENvdW50Ow0KLSAgVUlOVDE2ICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBCYnNDb3VudDsNCi0gIEJCU19UQUJMRSAgICAgICAgICAgICAg ICAgICAgICAgICAgKkxvY2FsQmJzVGFibGU7DQotICBVSU5UMzIgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICpCYXNlVmVjdG9yTWFzdGVyOw0KLSAgRUZJX1RJTUUgICAgICAgICAgICAgICAg ICAgICAgICAgICBCb290VGltZTsNCi0gIFVJTlQzMiAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgTG9jYWxUaW1lOw0KLSAgRUZJX0hBTkRMRSAgICAgICAgICAgICAgICAgICAgICAgICBJZGVD b250cm9sbGVyOw0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIYW5kbGVD b3VudDsNCi0gIEVGSV9IQU5ETEUgICAgICAgICAgICAgICAgICAgICAgICAgKkhhbmRsZUJ1ZmZl cjsNCi0gIFZPSUQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKkFjcGlUYWJsZTsNCi0g IFVJTlROICAgICAgICAgICAgIC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Q0KLSAgLy8gYm9vdCBtb2RlIGJ5IGNhbGxpbmcgR2V0 SWRlSGFuZGxlLg0KLSAgLy8gQSByZWNvbm5lY3QgLXIgY2FuIGZvcmNlIGFsbCBIRERzIGJhY2sg dG8gbmF0aXZlIG1vZGUuDQotICAvLw0KLSAgSWRlQ29udHJvbGxlciA9IE5VTEw7DQotICBpZiAo KG1Cb290TW9kZSA9PSBCT09UX0xFR0FDWV9PUykgfHwgKG1Cb290TW9kZSA9PSBCT09UX1VOQ09O VkVOVElPTkFMX0RFVklDRSkpIHsNCi0gICAgU3RhdHVzID0gTGVnYWN5Qmlvc1BsYXRmb3JtLT5H ZXRQbGF0Zm9ybUhhbmRsZSAoDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQ cml2YXRlLT5MZWdhY3lCaW9zUGxhdGZvcm0sDQotICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBFZmlHZXRQbGF0Zm9ybUlkZUhhbmRsZSwNCi0gICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDAsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmSGFu ZGxlQnVmZmVyLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJkhhbmRsZUNv dW50LA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTA0KLSAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsNCi0gICAgaWYgKCFFRklfRVJST1IgKFN0YXR1 cykpIHsNCi0gICAgICBJZGVDb250cm9sbGVyID0gSGFuZGxlQnVmZmVyWzBdOw0KLSAgICB9DQot ICB9DQotDQotICAvLw0KLSAgLy8gVW5sb2NrIHRoZSBMZWdhY3kgQklPUyByZWdpb24NCi0gIC8v DQotICBQcml2YXRlLT5MZWdhY3lSZWdpb24tPlVuTG9jayAoDQotICAgICAgICAgICAgICAgICAg ICAgICAgICAgUHJpdmF0ZS0+TGVnYWN5UmVnaW9uLA0KLSAgICAgICAgICAgICAgICAgICAgICAg ICAgIDB4RTAwMDAsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgyMDAwMCwNCi0gICAg ICAgICAgICAgICAgICAgICAgICAgICAmR3JhbnVsYXJpdHkNCi0gICAgICAgICAgICAgICAgICAg ICAgICAgICApOw0KLQ0KLSAgLy8NCi0gIC8vIFJlY29uc3RydWN0IHRoZSBMZWdhY3kxNiBib290 IG1lbW9yeSBtYXANCi0gIC8vDQotICBMZWdhY3lCaW9zQnVpbGRFODIwIChQcml2YXRlLCAmQ29w eVNpemUpOw0KLSAgaWYgKENvcHlTaXplID4gUHJpdmF0ZS0+TGVnYWN5MTZUYWJsZS0+RTgyMExl bmd0aCkgew0KLSAgICBaZXJvTWVtICgmUmVncywgc2l6ZW9mIChFRklfSUEzMl9SRUdJU1RFUl9T RVQpKTsNCi0gICAgUmVncy5YLkFYID0gTGVnYWN5MTZHZXRUYWJsZUFkZHJlc3M7DQotICAgIFJl Z3MuWC5CWCA9IChVSU5UMTYpMHgwOyAgLy8gQW55IHJlZ2lvbg0KLSAgICBSZWdzLlguQ1ggPSAo VUlOVDE2KUNvcHlTaXplOw0KLSAgICBSZWdzLlguRFggPSAoVUlOVDE2KTB4NDsgIC8vIEFsaWdu bWVudA0KLSAgICBQcml2YXRlLT5MZWdhY3lCaW9zLkZhckNhbGw4NiAoDQotICAgICAgICAgICAg ICAgICAgICAgICAgICAmUHJpdmF0ZS0+TGVnYWN5QmlvcywNCi0gICAgICAgICAgICAgICAgICAg ICAgICAgIFByaXZhdGUtPkxlZ2FjeTE2VGFibGUtPkNvbXBhdGliaWxpdHkxNkNhbGxTZWdtZW50 LA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgUHJpdmF0ZS0+TGVnYWN5MTZUYWJsZS0+Q29t cGF0aWJpbGl0eTE2Q2FsbE9mZnNldCwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICZSZWdz LA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwNCi0gICAgICAgICAgICAgICAgICAg ICAgICAgIDANCi0gICAgICAgICAgICAgICAgICAgICAgICAgICk7DQotDQotICAgIFByaXZhdGUt PkxlZ2FjeTE2VGFibGUtPkU4MjBQb2ludGVyID0gKFVJTlQzMikoUmVncy5YLkRTICogMTYgKyBS ZWdzLlguQlgpOw0KLSAgICBQcml2YXRlLT5MZWdhY3kxNlRhYmxlLT5FODIwTGVuZ3RoICA9IChV SU5UMzIpQ29weVNpemU7DQotICAgIGlmIChSZWdzLlguQVggIT0gMCkgew0KLSAgICAgIERFQlVH ICgoREVCVUdfRVJST1IsICJMZWdhY3kxNiBFODIwIGxlbmd0aCBpbnN1ZmZpY2llbnRcbiIpKTsN Ci0gICAgICByZXR1cm4gRUZJX09VVF9PRl9SRVNPVVJDRVM7DQotICAgIH0gZWxzZSB7DQotICAg ICAgQ29weU1lbSAoDQotICAgICAgICAoVk9JRCAqKShVSU5UTilQcml2YXRlLT5MZWdhY3kxNlRh YmxlLT5FODIwUG9pbnRlciwNCi0gICAgICAgIFByaXZhdGUtPkU4MjBUYWJsZSwNCi0gICAgICAg IENvcHlTaXplDQotICAgICAgICApOw0KLSAgICB9DQotICB9IGVsc2Ugew0KLSAgICBDb3B5TWVt ICgNCi0gICAgICAoVk9JRCAqKShVSU5UTilQcml2YXRlLT5MZWdhY3kxNlRhYmxlLT5FODIwUG9p bnRlciwNCi0gICAgICBQcml2YXRlLT5FODIwVGFibGUsDQotICAgICAgQ29weVNpemUNCi0gICAg ICApOw0KLSAgICBQcml2YXRlLT5MZWdhY3kxNlRhYmxlLT5FODIwTGVuZ3RoID0gKFVJTlQzMilD b3B5U2l6ZTsNCi0gIH0NCi0NCi0gIC8vDQotICAvLyBXZSBkbyBub3QgQVNTRVJUIGlmIFNtYmlv c1RhYmxlIG5vdCBmb3VuZC4gSXQgaXMgcG9zc2libGUgdGhhdCBhIHBsYXRmb3JtIGRvZXMgbm90 IHByb2R1Y2UgU21iaW9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DQotICAvLyBjYW4g bG9jayBpdC4NCi0gIC8vDQotICBQcml2YXRlLT5MZWdhY3lSZWdpb24tPlVuTG9jayAoDQotICAg ICAgICAgICAgICAgICAgICAgICAgICAgUHJpdmF0ZS0+TGVnYWN5UmVnaW9uLA0KLSAgICAgICAg ICAgICAgICAgICAgICAgICAgIFByaXZhdGUtPkJpb3NTdGFydCwNCi0gICAgICAgICAgICAgICAg ICAgICAgICAgICBQcml2YXRlLT5MZWdhY3lCaW9zSW1hZ2VTaXplLA0KLSAgICAgICAgICAgICAg ICAgICAgICAgICAgICZHcmFudWxhcml0eQ0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICk7 DQotDQotICAvLw0KLSAgLy8gQ29uZmlndXJlIExlZ2FjeSBEZXZpY2UgTWFnaWMNCi0gIC8vDQot ICAvLyBPbmx5IGRvIHRoaXMgY29kZSBpZiBib290aW5nIGxlZ2FjeSBPUw0KLSAgLy8NCi0gIGlm ICgobUJvb3RNb2RlID09IEJPT1RfTEVHQUNZX09TKSB8fCAobUJvb3RNb2RlID09IEJPT1RfVU5D T05WRU5USU9OQUxfREVWSUNFKSkgew0KLSAgICBVcGRhdGVTaW9EYXRhIChQcml2YXRlKTsNCi0g IH0NCi0NCi0gIC8vDQotICAvLyBTZXR1cCBCREEgYW5kIEVCREEgc3RhbmRhcmQgYXJlYXMgYmVm b3JlIExlZ2FjeSBCb290DQotICAvLw0KLSAgQUNDRVNTX1BBR0UwX0NPREUgKA0KLSAgICBMZWdh Y3lCaW9zQ29tcGxldGVCZGFCZWZvcmVCb290IChQcml2YXRlKTsNCi0gICAgKTsNCi0gIExlZ2Fj eUJpb3NDb21wbGV0ZVN0YW5kYXJkQ21vc0JlZm9yZUJvb3QgKFByaXZhdGUpOw0KLQ0KLSAgLy8N Ci0gIC8vIFdlIG11c3QgYnVpbGQgSURFIGRhdGEsIGlmIGl0IGhhc24ndCBiZWVuIGRvbmUsIGJl Zm9yZSBQY2lTaGFkb3dSb21zDQotICAvLyB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AsDQotICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgMCwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmU2hhZG93QWRkcmVzcywNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBM ZWdhY3kxNlRhYmxlLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwNCi0g ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApOw0KLSAgUHJpdmF0ZS0+T3B0aW9uUm9t ID0gKFVJTlQzMilTaGFkb3dBZGRyZXNzOw0KLSAgLy8NCi0gIC8vIFJlZ2lzdGVyIExlZ2FjeSBT TUkgSGFuZGxlcg0KLSAgLy8NCi0gIExlZ2FjeUJpb3NQbGF0Zm9ybS0+U21tSW5pdCAoDQotICAg ICAgICAgICAgICAgICAgICAgICAgTGVnYWN5Qmlvc1BsYXRmb3JtLA0KLSAgICAgICAgICAgICAg ICAgICAgICAgIEVmaVRvTGVnYWN5MTZCb290VGFibGUNCi0gICAgICAgICAgICAgICAgICAgICAg ICApOw0KLQ0KLSAgLy8NCi0gIC8vIExldCBwbGF0Zm9ybSBjb2RlIGtub3cgdGhlIGJvb3Qgb3B0 aW9ucw0KLSAgLy8NCi0gIExlZ2FjeUJpb3NHZXRCYnNJbmZvICgNCi0gICAgVGhpcywNCi0gICAg JkhkZENvdW50LA0KLSAgICAmTG9jYWxIZGRJbmZvLA0KLSAgICAmQmJzQ291bnQsDQotICAgICZM b2NhbEJic1RhYmxlDQotICAgICk7DQotDQotICBERUJVR19DT0RFICgNCi0gICAgUHJpbnRQY2lJ bnRlcnJ1cHRSZWdpc3RlciAoKTsNCi0gICAgUHJpbnRCYnNUYWJsZSAoTG9jYWxCYnNUYWJsZSk7 DQotICAgIFByaW50SGRkSW5mbyAoTG9jYWxIZGRJbmZvKTsNCi0gICAgKTsNCi0gIC8vDQotICAv LyBJZiBkcml2ZSB3YXNuJ3Qgc3B1biB1cCB0aGVuIEJ1aWxkSWRlRGF0YSBtYXkgaGF2ZSBmb3Vu ZCBuZXcgZHJpdmVzLg0KLSAgLy8gTmVlZCB0byB1cGRhdGUgQkJTIGJvb3QgcHJpb3JpdHkuDQot ICAvLw0KLSAgZm9yIChJbmRleCA9IDA7IEluZGV4IDwgTUFYX0lERV9DT05UUk9MTEVSOyBJbmRl eCsrKSB7DQotICAgIGlmICgoTG9jYWxIZGRJbmZvW0luZGV4XS5JZGVudGlmeURyaXZlWzBdLlJh d1swXSAhPSAwKSAmJg0KLSAgICAgICAgKExvY2FsQmJzVGFibGVbMiAqIEluZGV4ICsgMV0uQm9v dFByaW9yaXR5ID09IEJCU19JR05PUkVfRU5UUlkpDQotICAgICAgICApDQotICAgIHsNCi0gICAg ICBMb2NhbEJic1RhYmxlWzIgKiBJbmRleCArIDFdLkJvb3RQcmlvcml0eSA9IEJCU19VTlBSSU9S SVRJWkVEX0VOVFJZOw0KLSAgICB9DQotDQotICAgIGlmICgoTG9jYWxIZGRJbmZvW0luZGV4XS5J ZGVudGlmeURyaXZlWzFdLlJhd1swXSAhPSAwKSAmJg0KLSAgICAgICAgKExvY2FsQmJzVGFibGVb MiAqIEluZGV4ICsgMl0uQm9vdFByaW9yaXR5ID09IEJCU19JR05PUkVfRU5UUlkpDQotICAgICAg ICApDQotICAgIHsNCi0gICAgICBMb2NhbEJic1RhYmxlWzIgKiBJbmRleCArIDJdLkJvb3RQcmlv cml0eSA9IEJCU19VTlBSSU9SSVRJWkVEX0VOVFJZOw0KLSAgICB9DQotICB9DQotDQotICBQcml2 YXRlLT5MZWdhY3lSZWdpb24tPlVuTG9jayAoDQotICAgICAgICAgICAgICAgICAgICAgICAgICAg UHJpdmF0ZS0+TGVnYWN5UmVnaW9uLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4YzAw MDAsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg0MDAwMCwNCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICAmR3JhbnVsYXJpdHkNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAp Ow0KLQ0KLSAgTGVnYWN5Qmlvc1BsYXRmb3JtLT5QcmVwYXJlVG9Cb290ICgNCi0gICAgICAgICAg ICAgICAgICAgICAgICBMZWdhY3lCaW9zUGxhdGZvcm0sDQotICAgICAgICAgICAgICAgICAgICAg ICAgbUJic0RldmljZVBhdGhQdHIsDQotICAgICAgICAgICAgICAgICAgICAgICAgbUJic1RhYmxl LA0KLSAgICAgICAgICAgICAgICAgICAgICAgIG1Mb2FkT3B0aW9uc1NpemUsDQotICAgICAgICAg ICAgICAgICAgICAgICAgbUxvYWRPcHRpb25zLA0KLSAgICAgICAgICAgICAgICAgICAgICAgIChW T0lEICopJlByaXZhdGUtPkludFRodW5rLT5FZmlUb0xlZ2FjeTE2Qm9vdFRhYmxlDQotICAgICAg ICAgICAgICAgICAgICAgICAgKTsNCi0NCi0gIC8vDQotICAvLyBJZiBubyBib290IGRldmljZSBy ZXR1cm4gdG8gQkRTDQotICAvLw0KLSAgaWYgKChtQm9vdE1vZGUgPT0gQk9PVF9MRUdBQ1lfT1Mp IHx8IChtQm9vdE1vZGUgPT0gQk9PVF9VTkNPTlZFTlRJT05BTF9ERVZJQ0UpKSB7DQotICAgIGZv ciAoSW5kZXggPSAwOyBJbmRleCA8IEJic0NvdW50OyBJbmRleCsrKSB7DQotICAgICAgaWYgKChM b2NhbEJic1RhYmxlW0luZGV4XS5Cb290UHJpb3JpdHkgIT0gQkJTX0RPX05PVF9CT09UX0ZST00p ICYmDQotICAgICAgICAgIChMb2NhbEJic1RhYmxlW0luZGV4XS5Cb290UHJpb3JpdHkgIT0gQkJT X1VOUFJJT1JJVElaRURfRU5UUlkpICYmDQotICAgICAgICAgIChMb2NhbEJic1RhYmxlW0luZGV4 XS5Cb290UHJpb3JpdHkgIT0gQkJTX0lHTk9SRV9FTlRSWSkpDQotICAgICAgew0KLSAgICAgICAg YnJlYWs7DQotICAgICAgfQ0KLSAgICB9DQotDQotICAgIG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ICAgICAgICAgICAgICAgICAgIFByaXZhdGUtPkxlZ2FjeTE2Q2FsbFNlZ21lbnQsDQotICAg ICAgICAgICAgICAgICAgICAgICAgUHJpdmF0ZS0+TGVnYWN5MTZDYWxsT2Zmc2V0LA0KLSAgICAg ICAgICAgICAgICAgICAgICAgICZSZWdzLA0KLSAgICAgICAgICAgICAgICAgICAgICAgIE5VTEws DQotICAgICAgICAgICAgICAgICAgICAgICAgMA0KLSAgICAgICAgICAgICAgICAgICAgICAgICk7 DQotDQotICBpZiAoUmVncy5YLkFYICE9IDApIHsNCi0gICAgcmV0dXJuIEVGSV9ERVZJQ0VfRVJS T1I7DQotICB9DQotDQotICAvLw0KLSAgLy8gTG9jayB0aGUgTGVnYWN5IEJJT1MgcmVnaW9uDQot ICAvLw0KLSAgUHJpdmF0ZS0+TGVnYWN5UmVnaW9uLT5Mb2NrICgNCi0gICAgICAgICAgICAgICAg ICAgICAgICAgICBQcml2YXRlLT5MZWdhY3lSZWdpb24sDQotICAgICAgICAgICAgICAgICAgICAg ICAgICAgMHhjMDAwMCwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAweDQwMDAwLA0KLSAg ICAgICAgICAgICAgICAgICAgICAgICAgICZHcmFudWxhcml0eQ0KLSAgICAgICAgICAgICAgICAg ICAgICAgICAgICk7DQotDQotICBpZiAoKFByaXZhdGUtPkxlZ2FjeTE2VGFibGUtPlRhYmxlTGVu Z3RoID49IE9GRlNFVF9PRiAoRUZJX0NPTVBBVElCSUxJVFkxNl9UQUJMRSwgSGlQZXJtYW5lbnRN ZW1vcnlBZGRyZXNzKSkgJiYNCi0gICAgICAoKFByaXZhdGUtPkxlZ2FjeTE2VGFibGUtPlVtYUFk ZHJlc3MgIT0gMCkgJiYgKFByaXZhdGUtPkxlZ2FjeTE2VGFibGUtPlVtYVNpemUgIT0gMCkpKQ0K LSAgew0KLSAgICAvLw0KLSAgICAvLyBIZXJlIHdlIGNvdWxkIHJlZHVjZSBVbWFBZGRyZXNzIGRv d24gYXMgZmFyIGFzIFByaXZhdGUtPk9wdGlvblJvbSwgdGFraW5nIGludG8NCi0gICAgLy8gYWNj b3VudCB0aGUgZ3JhbnVsYXJpdHkgb2YgdGhlIGFjY2VzcyBjb250cm9sLg0KLSAgICAvLw0KLSAg ICBERUJVRyAoKA0KLSAgICAgIERFQlVHX0lORk8sDQotICAgICAgIlVubG9ja2luZyBVTUIgUkFN IHJlZ2lvbiAweCV4LTB4JXhcbiIsDQotICAgICAgUHJpdmF0ZS0+TGVnYWN5MTZUYWJsZS0+VW1h QWRkcmVzcywNCi0gICAgICBQcml2YXRlLT5MZWdhY3kxNlRhYmxlLT5VbWFBZGRyZXNzICsgUHJp dmF0ZS0+TGVnYWN5MTZUYWJsZS0+VW1hU2l6ZQ0KLSAgICAgICkpOw0KLQ0KLSAgICBQcml2YXRl LT5MZWdhY3lSZWdpb24tPlVuTG9jayAoDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQ cml2YXRlLT5MZWdhY3lSZWdpb24sDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQcml2 YXRlLT5MZWdhY3kxNlRhYmxlLT5VbWFBZGRyZXNzLA0KLSAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgUHJpdmF0ZS0+TGVnYWN5MTZUYWJsZS0+VW1hU2l6ZSwNCi0gICAgICAgICAgICAgICAg ICAgICAgICAgICAgICZHcmFudWxhcml0eQ0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAg KTsNCi0gIH0NCi0NCi0gIC8vDQotICAvLyBMb2NrIGF0dHJpYnV0ZXMgb2YgdGhlIExlZ2FjeSBS ZWdpb24gaWYgY2hpcHNldCBzdXBwb3J0cw0KLSAgLy8NCi0gIFByaXZhdGUtPkxlZ2FjeVJlZ2lv bi0+Qm9vdExvY2sgKA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgIFByaXZhdGUtPkxlZ2Fj eVJlZ2lvbiwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAweGMwMDAwLA0KLSAgICAgICAg ICAgICAgICAgICAgICAgICAgIDB4NDAwMDAsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAg JkdyYW51bGFyaXR5DQotICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsNCi0NCi0gIC8vDQot ICAvLyBDYWxsIGludG8gTGVnYWN5MTYgY29kZSB0byBkbyB0aGUgSU5UIDE5aA0KLSAgLy8NCi0g IEVuYWJsZUFsbENvbnRyb2xsZXJzIChQcml2YXRlKTsNCi0gIGlmICgobUJvb3RNb2RlID09IEJP T1RfTEVHQUNZX09TKSB8fCAobUJvb3RNb2RlID09IEJPT1RfVU5DT05WRU5USU9OQUxfREVWSUNF KSkgew0KLSAgICAvLw0KLSAgICAvLyBTaWduYWwgYWxsIHRoZSBldmVudHMgdGhhdCBhcmUgd2Fp dGluZyBvbiBFVlRfU0lHTkFMX0xFR0FDWV9CT09UDQotICAgIC8vDQotICAgIEVmaVNpZ25hbEV2 ZW50TGVnYWN5Qm9vdCAoKTsNCi0NCi0gICAgLy8NCi0gICAgLy8gUmVwb3J0IFN0YXR1cyBDb2Rl IHRvIGluZGljYXRlIGxlZ2FjeSBib290IGV2ZW50IHdhcyBzaWduYWxsZWQNCi0gICAgLy8NCi0g ICAgUkVQT1JUX1NUQVRVU19DT0RFICgNCi0gICAgICBFRklfUFJPR1JFU1NfQ09ERSwNCi0gICAg ICAoRUZJX1NPRlRXQVJFX0RYRV9CU19EUklWRVIgfCBFRklfU1dfRFhFX0JTX1BDX0xFR0FDWV9C T09UX0VWRU5UKQ0KLSAgICAgICk7DQotDQotICAgIERFQlVHICgoREVCVUdfSU5GTywgIkxlZ2Fj eSBJTlQxOSBCb290Li4uXG4iKSk7DQotDQotICAgIC8vDQotICAgIC8vIERpc2FibGUgRFhFIFRp bWVyIHdoaWxlIGV4ZWN1dGluZyBpbiByZWFsIG1vZGUNCi0gICAgLy8NCi0gICAgUHJpdmF0ZS0+ VGltZXItPlNldFRpbWVyUGVyaW9k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GV4XSA9IChVSU5UMzIpKFByaXZhdGUtPkJpb3NV bmV4cGVjdGVkSW50KTsNCi0gICAgICB9DQotICAgIH0NCi0NCi0gICAgICApOw0KLQ0KLSAgICBa ZXJvTWVtICgmUmVncywgc2l6ZW9mIChFRklfSUEzMl9SRUdJU1RFUl9TRVQpKTsNCi0gICAgUmVn cy5YLkFYID0gTGVnYWN5MTZCb290Ow0KLQ0KLSAgICBQcml2YXRlLT5MZWdhY3lCaW9zLkZhckNh bGw4NiAoDQotICAgICAgICAgICAgICAgICAgICAgICAgICBUaGlzLA0KLSAgICAgICAgICAgICAg ICAgICAgICAgICAgUHJpdmF0ZS0+TGVnYWN5MTZDYWxsU2VnbWVudCwNCi0gICAgICAgICAgICAg ICAgICAgICAgICAgIFByaXZhdGUtPkxlZ2FjeTE2Q2FsbE9mZnNldCwNCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICZSZWdzLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwNCi0g ICAgICAgICAgICAgICAgICAgICAgICAgIDANCi0gICAgICAgICAgICAgICAgICAgICAgICAgICk7 DQotDQotICAgIEFDQ0VTU19QQUdFMF9DT0RFICgNCi0gICAgICBCYXNlVmVjdG9yTWFzdGVyID0g KFVJTlQzMiAqKShzaXplb2YgKFVJTlQzMikgKiBQUk9URUNURURfTU9ERV9CQVNFX1ZFQ1RPUl9N QVNURVIpOw0KLSAgICAgIGZvciAoSW5kZXggPSAwOyBJbmRleCA8IDg7IEluZGV4KyspIHsNCi0g ICAgICBCYXNlVmVjdG9yTWFzdGVyW0luZGV4XSA9IFByaXZhdGUtPlRodW5rU2F2ZWRJbnRbSW5k ZXhdOw0KLSAgICB9DQotDQotICAgICAgKTsNCi0gIH0NCi0NCi0gIFByaXZhdGUtPkxlZ2FjeUJv b3RFbnRlcmVkID0gVFJVRTsNCi0gIGlmICgobUJvb3RNb2RlID09IEJPT1RfTEVHQUNZX09TKSB8 fCAobUJvb3RNb2RlID09IEJPT1Rf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nbmVkDQotDQotKiovDQot RUZJX1NUQVRVUw0KLUVGSUFQSQ0KLUxlZ2FjeUJpb3NQcmVwYXJlVG9Cb290RWZpICgNCi0gIElO IEVGSV9MRUdBQ1lfQklPU19QUk9UT0NPTCAgKlRoaXMsDQotICBPVVQgVUlOVDE2ICAgICAgICAg ICAgICAgICAgICpCYnNDb3VudCwNCi0gIE9VVCBCQlNfVEFCTEUgICAgICAgICAgICAgICAgKipC YnNUYWJsZQ0KLSAgKQ0KLXsNCi0gIEVGSV9TVEFUVVMgICAgICAgICAgICAgICAgICAgICAgICAg U3RhdHVzOw0KLSAgRUZJX1RPX0NPTVBBVElCSUxJVFkxNl9CT09UX1RBQkxFICAqRWZpVG9MZWdh Y3kxNkJvb3RUYWJsZTsNCi0gIExFR0FDWV9CSU9TX0lOU1RBTkNFICAgICAgICAgICAgICAgKlBy aXZhdGU7DQotDQotICBQcml2YXRlICAgICAgICAgICAgICAgID0gTEVHQUNZX0JJT1NfSU5TVEFO Q0VfRlJPTV9USElTIChUaGlzKTsNCi0gIEVmaVRvTGVnYWN5MTZCb290VGFibGUgPSAmUHJpdmF0 ZS0+SW50VGh1bmstPkVmaVRvTGVnYWN5MTZCb290VGFibGU7DQotICBtQm9vdE1vZGUgICAgICAg ICAgICAgID0gQk9PVF9FRklfT1M7DQotICBtQmJzRGV2aWNlUGF0aFB0ciAgICAgID0gTlVMTDsN Ci0gIFN0YXR1cyAgICAgICAgICAgICAgICAgPSBHZW5lcmljTGVnYWN5Qm9vdCAoVGhpcyk7DQot ICAqQmJzVGFibGUgICAgICAgICAgICAgID0gKEJCU19UQUJMRSAqKShVSU5UTilFZmlUb0xlZ2Fj eTE2Qm9vdFRhYmxlLT5CYnNUYWJsZTsNCi0gICpCYnNDb3VudCAgICAgICAgICAgICAgPSAoVUlO VDE2KShzaXplb2YgKFByaXZhdGUtPkludFRodW5rLT5CYnNUYWJsZSkgLyBzaXplb2YgKEJCU19U QUJMRSkpOw0KLSAgcmV0dXJuIFN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TX1BST1RPQ09M ICAqVGhpcywNCi0gIElOIFVEQ19BVFRSSUJVVEVTICAgICAgICAgICAgQXR0cmlidXRlcywNCi0g IElOIFVJTlROICAgICAgICAgICAgICAgICAgICAgQmJzRW50cnksDQotICBJTiBWT0lEICAgICAg ICAgICAgICAgICAgICAgICpCZWVyRGF0YSwNCi0gIElOIFZPSUQgICAgICAgICAgICAgICAgICAg ICAgKlNlcnZpY2VBcmVhRGF0YQ0KLSAgKQ0KLXsNCi0gIEVGSV9TVEFUVVMgICAgICAgICAgICAg ICAgICAgICAgICAgU3RhdHVzOw0KLSAgRUZJX1RPX0NPTVBBVElCSUxJVFkxNl9CT09UX1RBQkxF ICAqRWZpVG9MZWdhY3kxNkJvb3RUYWJsZTsNCi0gIExFR0FDWV9CSU9TX0lOU1RBTkNFICAgICAg ICAgICAgICAgKlByaXZhdGU7DQotICBVRF9UQUJMRSAgICAgICAgICAgICAgICAgICAgICAgICAg ICpVY2RUYWJsZTsNCi0gIFVJTlROICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW5kZXg7 DQotICBVSU5UMTYgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJvb3RQcmlvcml0eTsNCi0g IEJCU19UQUJMRSAgICAgICAgICAgICAgICAgICAgICAgICAgKkJic1RhYmxlOw0KLQ0KLSAgQm9v dFByaW9yaXR5ICAgICAgPSAwOw0KLSAgUHJpdmF0ZSAgICAgICAgICAgPSBMRUdBQ1lfQklPU19J TlNUQU5DRV9GUk9NX1RISVMgKFRoaXMpOw0KLSAgbUJvb3RNb2RlICAgICAgICAgPSBCT09UX1VO Q09OVkVOVElPTkFMX0RFVklDRTsNCi0gIG1CYnNEZXZpY2VQYXRoUHRyID0gJm1CYnNEZXZpY2VQ YXRoTm9kZTsNCi0gIG1BdHRyaWJ1dGVzICAgICAgID0gQXR0cmlidXRlczsNCi0gIG1CYnNFbnRy eSAgICAgICAgID0gQmJzRW50cnk7DQotICBtQmVlckRhdGEgICAgICAgICA9IEJ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GUsDQotICBPVVQgVUlO VE4gICAgICAgICAgICAgICAgICpTaXplDQotICApDQotew0KLSAgRUZJX1NUQVRVUyAgICAgICAg ICAgICAgICAgICBTdGF0dXM7DQotICBFRklfRTgyMF9FTlRSWTY0ICAgICAgICAgICAgICpFODIw VGFibGU7DQotICBFRklfTUVNT1JZX0RFU0NSSVBUT1IgICAgICAgICpFZmlNZW1vcnlNYXA7DQot ICBFRklfTUVNT1JZX0RFU0NSSVBUT1IgICAgICAgICpFZmlNZW1vcnlNYXBFbmQ7DQotICBFRklf TUVNT1JZX0RFU0NSSVBUT1IgICAgICAgICpFZmlFbnRyeTsNCi0gIEVGSV9NRU1PUllfREVTQ1JJ UFRPUiAgICAgICAgKk5leHRFZmlFbnRyeTsNCi0gIEVGSV9NRU1PUllfREVTQ1JJUFRPUiAgICAg ICAgVGVtcEVmaUVudHJ5Ow0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgICBFZmlNZW1v cnlNYXBTaXplOw0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgICBFZmlNYXBLZXk7DQot ICBVSU5UTiAgICAgICAgICAgICAgICAgICAgICAgIEVmaURlc2NyaXB0b3JTaXplOw0KLSAgVUlO VDMyICAgICAgICAgICAgICAgICAgICAgICBFZmlEZXNjcmlwdG9yVmVyc2lvbjsNCi0gIFVJTlRO ICAgICAgICAgICAgICAgICAgICAgICAgSW5kZXg7DQotICBFRklfUEVJX0hPQl9QT0lOVEVSUyAg ICAgICAgIEhvYjsNCi0gIEVGSV9IT0JfUkVTT1VSQ0VfREVTQ1JJUFRPUiAgKlJlc291cmNlSG9i Ow0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgICBUZW1wSW5kZXg7DQotICBVSU5UTiAg ICAgICAgICAgICAgICAgICAgICAgIEluZGV4U29ydDsNCi0gIFVJTlROICAgICAgICAgICAgICAg ICAgICAgICAgVGVtcE5leHRJbmRleDsNCi0gIEVGSV9FODIwX0VOVFJZNjQgICAgICAgICAgICAg VGVtcEU4MjA7DQotICBFRklfQUNQSV9NRU1PUllfVFlQRSAgICAgICAgIFRlbXBUeXBlOw0KLSAg Qk9PTEVBTiAgICAgICAgICAgICAgICAgICAgICBDaGFuZ2VkRmxhZzsNCi0gIFVJTlROICAgICAg ICAgICAgICAgICAgICAgICAgQWJvdmUxTUluZGV4Ow0KLSAgVUlOVDY0ICAgICAgICAgICAgICAg ICAgICAgICBNZW1vcnlCbG9ja0xlbmd0aDsNCi0NCi0gIEU4MjBUYWJsZSA9IChFRklfRTgyMF9F TlRSWTY0ICopUHJpdmF0ZS0+RTgyMFRhYmxlOw0KLQ0KLSAgLy8NCi0gIC8vIEdldCB0aGUgRUZJ IG1lbW9yeSBtYXAuDQotICAvLw0KLSAgRWZpTWVtb3J5TWFwU2l6ZSA9IDA7DQotICBFZmlNZW1v cnlNYXAgICAgID0gTlVMTDsNCi0gIFN0YXR1cyAgICAgICAgICAgPSBnQlMtPkdldE1lbW9yeU1h cCAoDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICZFZmlNZW1vcnlNYXBTaXplLA0KLSAg ICAgICAgICAgICAgICAgICAgICAgICAgICBFZmlNZW1vcnlNYXAsDQotICAgICAgICAgICAgICAg ICAgICAgICAgICAgICZFZmlNYXBLZXksDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICZF ZmlEZXNjcmlwdG9yU2l6ZSwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgJkVmaURlc2Ny aXB0b3JWZXJzaW9uDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7DQotICBBU1NFUlQg KFN0YXR1cyA9PSBFRklfQlVGRkVSX1RPT19TTUFMTCk7DQotDQotICBkbyB7DQotICAgIC8vDQot ICAgIC8vIFVzZSBzaXplIHJldHVybmVkIGZvciB0aGUgQWxsb2NhdGVQb29sLg0KLSAgICAvLyBX ZSBkb24ndCBqdXN0IG11bHRpcGx5IGJ5IDIgc2luY2UgdGhlICJmb3IiIGxvb3AgY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0gMSkgew0KLSAgICAgICAgRTgyMFRhYmxlW1RlbXBJbmRleF0uQmFz ZUFkZHIgPSAwOw0KLSAgICAgICAgRTgyMFRhYmxlW1RlbXBJbmRleF0uTGVuZ3RoICAgPSAwOw0K LSAgICAgICAgRTgyMFRhYmxlW1RlbXBJbmRleF0uVHlwZSAgICAgPSAoRUZJX0FDUElfTUVNT1JZ X1RZUEUpMDsNCi0gICAgICAgIEluZGV4LS07DQotICAgICAgICBicmVhazsNCi0gICAgICB9IGVs c2Ugew0KLSAgICAgICAgZm9yIChJbmRleFNvcnQgPSBUZW1wSW5kZXg7IEluZGV4U29ydCA8IElu ZGV4IC0gMTsgSW5kZXhTb3J0KyspIHsNCi0gICAgICAgICAgRTgyMFRhYmxlW0luZGV4U29ydF0u QmFzZUFkZHIgPSBFODIwVGFibGVbSW5kZXhTb3J0ICsgMV0uQmFzZUFkZHI7DQotICAgICAgICAg IEU4MjBUYWJsZVtJbmRleFNvcnRdLkxlbmd0aCAgID0gRTgyMFRhYmxlW0luZGV4U29ydCArIDFd Lkxlbmd0aDsNCi0gICAgICAgICAgRTgyMFRhYmxlW0luZGV4U29ydF0uVHlwZSAgICAgPSBFODIw VGFibGVbSW5kZXhTb3J0ICsgMV0uVHlwZTsNCi0gICAgICAgIH0NCi0NCi0gICAgICAgIEluZGV4 LS07DQotICAgICAgfQ0KLSAgICB9DQotICB9DQotDQotICBQcml2YXRlLT5JbnRUaHVuay0+RWZp VG9MZWdhY3kxNkluaXRUYWJsZS5OdW1iZXJFODIwRW50cmllcyA9IChVSU5UMzIpSW5kZXg7DQot ICBQcml2YXRlLT5JbnRUaHVuay0+RWZpVG9MZWdhY3kxNkJvb3RUYWJsZS5OdW1iZXJFODIwRW50 cmllcyA9IChVSU5UMzIpSW5kZXg7DQotICBQcml2YXRlLT5OdW1iZXJFODIwRW50cmllcyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IChVSU5UMzIpSW5kZXg7DQotICAqU2l6ZSAg IC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AgIFJl Y29ubmVjdCBJZGVDb250cm9sbGVyIG9yIG5vdA0KLQ0KLSAgQHJldHZhbCBFRklfU1VDQ0VTUyAg ICBJdCBzaG91bGQgYWx3YXlzIHdvcmsuDQotDQotKiovDQotRUZJX1NUQVRVUw0KLUxlZ2FjeUJp b3NCdWlsZElkZURhdGEgKA0KLSAgSU4gIExFR0FDWV9CSU9TX0lOU1RBTkNFICAqUHJpdmF0ZSwN Ci0gIElOICBIRERfSU5GTyAgICAgICAgICAgICAgKipIZGRJbmZvLA0KLSAgSU4gIFVJTlQxNiAg ICAgICAgICAgICAgICBGbGFnDQotICApDQotew0KLSAgRUZJX1NUQVRVUyAgICAgICAgICAgICAg ICBTdGF0dXM7DQotICBFRklfSEFORExFICAgICAgICAgICAgICAgIElkZUNvbnRyb2xsZXI7DQot ICBVSU5UTiAgICAgICAgICAgICAgICAgICAgIEhhbmRsZUNvdW50Ow0KLSAgRUZJX0hBTkRMRSAg ICAgICAgICAgICAgICAqSGFuZGxlQnVmZmVyOw0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAg ICBJbmRleDsNCi0gIEVGSV9ESVNLX0lORk9fUFJPVE9DT0wgICAgKkRpc2tJbmZvOw0KLSAgVUlO VDMyICAgICAgICAgICAgICAgICAgICBJZGVDaGFubmVsOw0KLSAgVUlOVDMyICAgICAgICAgICAg ICAgICAgICBJZGVEZXZpY2U7DQotICBVSU5UMzIgICAgICAgICAgICAgICAgICAgIFNpemU7DQot ICBVSU5UOCAgICAgICAgICAgICAgICAgICAgICpJbnF1aXJ5RGF0YTsNCi0gIFVJTlQzMiAgICAg ICAgICAgICAgICAgICAgSW5xdWlyeURhdGFTaXplOw0KLSAgSEREX0lORk8gICAgICAgICAgICAg ICAgICAqTG9jYWxIZGRJbmZvOw0KLSAgVUlOVDMyICAgICAgICAgICAgICAgICAgICBQY2lJbmRl eDsNCi0gIEVGSV9ERVZJQ0VfUEFUSF9QUk9UT0NPTCAgKkRldmljZVBhdGg7DQotICBF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bmZvICA9ICpIZGRJbmZv Ow0KLSAgU3RhdHVzICAgICAgICA9IFByaXZhdGUtPkxlZ2FjeUJpb3NQbGF0Zm9ybS0+R2V0UGxh dGZvcm1IYW5kbGUgKA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBQcml2YXRlLT5MZWdhY3lCaW9zUGxhdGZvcm0sDQotICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVmaUdldFBsYXRmb3JtSWRlSGFuZGxlLA0K LSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLA0KLSAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmSGFuZGxlQnVm ZmVyLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm SGFuZGxlQ291bnQsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIChWT0lEICopJkxvY2FsSGRkSW5mbw0KLSAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICApOw0KLSAgaWYgKCFFRklfRVJST1IgKFN0YXR1cykpIHsN Ci0gICAgSWRlQ29udHJvbGxlciA9IEhhbmRsZUJ1ZmZlclswXTsNCi0gICAgLy8NCi0gICAgLy8g Rm9yY2UgSURFIGRyaXZlIHNwaW4gdXAhDQotICAgIC8vDQotICAgIGlmIChGbGFnICE9IDApIHsN Ci0gICAgICBnQlMtPkRpc2Nvbm5lY3RDb250cm9sbGVyICgNCi0gICAgICAgICAgICAgSWRlQ29u dHJvbGxlciwNCi0gICAgICAgICAgICAgTlVMTCwNCi0gICAgICAgICAgICAgTlVMTA0KLSAgICAg ICAgICAgICApOw0KLSAgICB9DQotDQotICAgIGdCUy0+Q29ubmVjdENvbnRyb2xsZXIgKElkZUNv bnRyb2xsZXIsIE5VTEwsIE5VTEwsIEZBTFNFKTsNCi0NCi0gICAgLy8NCi0gICAgLy8gRG8gR2V0 SWRlSGFuZGxlIHR3aWNlIHNpbmNlIGRpc2Nvbm5lY3QvcmVjb25uZWN0IHdpbGwgc3dpdGNoIHRv IG5hdGl2ZSBtb2RlDQotICAgIC8vIEFuZCBHZXRJZGVIYW5kbGUgd2lsbCBzd2l0Y2ggdG8gTGVn YWN5IG1vZGUsIGlmIHJlcXVpcmVkLg0KLSAgICAvLw0KLSAgICBQcml2YXRlLT5MZWdhY3lCaW9z UGxhdGZvcm0tPkdldFBsYXRmb3JtSGFuZGxlICgNCi0gICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIFByaXZhdGUtPkxlZ2FjeUJpb3NQbGF0Zm9ybSwNCi0gICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIEVmaUdldFBsYXRmb3JtSWRlSGFuZGxlLA0KLSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgMCwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICZIYW5kbGVCdWZmZXIsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmSGFuZGxlQ291bnQsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoVk9J RCAqKSZMb2NhbEhkZEluZm8NCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7 DQotICB9DQotDQotICBtSWRlRGF0YUJ1aWx0RmxhZyA9IFRSVUU7DQotDQotICAvLw0KLSAgLy8g R2V0IElkZW50aXR5IGNvbW1hbmQgZnJvbSBhbGwgZHJpdmVzDQotICAvLw0KLSAgZ0JTLT5Mb2Nh dGVIYW5kbGVCdWZmZXIgKA0KLSAgICAgICAgIEJ5UHJvdG9jb2wsDQotICAgICAgICAgJmdFZmlE aXNrSW5mb1Byb3RvY29sR3VpZCwNCi0gICAgICAgICBOVUxMLA0KLSAgICAgICAgICZIYW5kbGVD b3VudCwNCi0gICAgICAgICAmSGFuZGxlQnVmZmVyDQotICAgICAgICAgKTsNCi0NCi0gIFByaXZh dGUtPklkZURyaXZlQ291bnQgPSAoVUlOVDgpSGFuZGxlQ291bnQ7DQotICBmb3IgKEluZGV4ID0g MDsgSW5kZXggPCBIYW5kbGVDb3VudDsgSW5kZXgrKykgew0KLSAgICBTdGF0dXMgPSBnQlMtPkhh bmRsZVByb3RvY29sICgNCi0gICAgICAgICAgICAgICAgICAgIEhhbmRsZUJ1ZmZlcltJbmRleF0s DQotICAgICAgICAgICAgICAgICAgICAmZ0VmaURpc2tJbmZvUHJvdG9jb2xHdWlkLA0KLSAgICAg ICAgICAgICAgICAgICAgKFZPSUQgKiopJkRpc2tJbmZvDQotICAgICAgICAgICAgICAgICAgICAp Ow0KLSAgICBBU1NFUlRfRUZJX0VSUk9SIChTdGF0dXMpOw0KLQ0KLSAgICBpZiAoQ29tcGFyZUd1 aWQgKCZEaXNrSW5mby0+SW50ZXJmYWNlLCAmZ0VmaURpc2tJbmZvSWRlSW50ZXJmYWNlR3VpZCkp IHsNCi0gICAgICAvLw0KLSAgICAgIC8vICBMb2NhdGUgd2hpY2ggUENJIGRldmljZQ0KLSAgICAg IC8vDQotICAgICAgU3RhdHVzID0gZ0JTLT5IYW5kbGVQcm90b2NvbCAoDQotICAgICAgICAgICAg ICAgICAgICAgIEhhbmRsZUJ1ZmZlcltJbmRleF0sDQotICAgICAgICAgICAgICAgICAgICAgICZn RWZpRGV2aWNlUGF0aFByb3RvY29sR3VpZCwNCi0gICAgICAgICAgICAgICAgICAgICAgKFZPSUQg KikmRGV2aWNlUGF0aA0KLSAgICAgICAgICAgICAgICAgICAgICApOw0KLSAgICAgIEFTU0VSVF9F RklfRVJST1IgKFN0YXR1cyk7DQotDQotICAgICAgRGV2aWNlUGF0aE5vZGUgPSBEZXZpY2VQYXRo Ow0KLSAgICAgIHdoaWxlICghSXNEZXZpY2VQYXRoRW5kIChEZXZpY2VQYXRoTm9kZSkpIHsNCi0g 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AgICBpZiAoIUVGSV9F UlJPUiAoU3RhdHVzKSkgew0KLSAgICAgICAgU2l6ZSA9IHNpemVvZiAoQVRBUElfSURFTlRJRlkp Ow0KLSAgICAgICAgRGlza0luZm8tPklkZW50aWZ5ICgNCi0gICAgICAgICAgICAgICAgICAgIERp c2tJbmZvLA0KLSAgICAgICAgICAgICAgICAgICAgJkxvY2FsSGRkSW5mb1tQY2lJbmRleCArIElk ZUNoYW5uZWxdLklkZW50aWZ5RHJpdmVbSWRlRGV2aWNlXSwNCi0gICAgICAgICAgICAgICAgICAg ICZTaXplDQotICAgICAgICAgICAgICAgICAgICApOw0KLSAgICAgICAgaWYgKElkZUNoYW5uZWwg PT0gMCkgew0KLSAgICAgICAgICBMb2NhbEhkZEluZm9bUGNpSW5kZXggKyBJZGVDaGFubmVsXS5T dGF0dXMgfD0gSEREX1BSSU1BUlk7DQotICAgICAgICB9IGVsc2UgaWYgKElkZUNoYW5uZWwgPT0g MSkgew0KLSAgICAgICAgICBMb2NhbEhkZEluZm9bUGNpSW5kZXggKyBJZGVDaGFubmVsXS5TdGF0 dXMgfD0gSEREX1NFQ09OREFSWTsNCi0gICAgICAgIH0NCi0NCi0gICAgICAgIElucXVpcnlEYXRh ICAgICA9IE5VTEw7DQotICAgICAgICBJbnF1aXJ5RGF0YVNpemUgPSAwOw0KLSAgICAgICAgU3Rh dHVzICAgICAgICAgID0gRGlza0luZm8tPklucXVpcnkgKA0KLSAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgRGlza0luZm8sDQotICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBOVUxMLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JklucXVpcnlEYXRhU2l6ZQ0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg KTsNCi0gICAgICAgIGlmIChTdGF0dXMgPT0gRUZJX0JVRkZFUl9UT09fU01BTEwpIHsNCi0gICAg ICAgICAgSW5xdWlyeURhdGEgPSAoVUlOVDggKilBbGxvY2F0ZVBvb2wgKA0KLSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgSW5xdWlyeURhdGFTaXplDQotICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICApOw0KLSAgICAgICAgICBpZiAoSW5xdWlyeURhdGEgIT0gTlVM TCkgew0KLSAgICAgICAgICAgIFN0YXR1cyA9IERpc2tJbmZvLT5JbnF1aXJ5ICgNCi0gICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBEaXNrSW5mbywNCi0gICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBJbnF1aXJ5RGF0YSwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmSW5xdWlyeURhdGFTaXplDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg KTsNCi0gICAgICAgICAgfQ0KLSAgICAgICAgfSBlbHNlIHsNCi0gICAgICAgICAgU3RhdHVzID0g RUZJX0RFVklDRV9FUlJPUjsNCi0gICAgICAgIH0NCi0NCi0gICAgICAgIC8vDQotICAgICAgICAv LyBJZiBBVEFQSSBkZXZpY2UgdGhlbiBJbnF1aXJ5IHdpbGwgcGFzcyBhbmQgQVRBIGZhaWwuDQot ICAgICAgICAvLw0KLSAgICAgICAgaWYgKCFFRklfRVJST1IgKFN0YXR1cykpIHsNCi0gICAgICAg ICAgQVNTRVJUIChJbnF1aXJ5RGF0YSAhPSBOVUxMKTsNCi0gICAgICAgICAgLy8NCi0gICAgICAg ICAgLy8gSWYgSWRlRGV2aWNlID0gMCB0aGVuIHNldCBtYXN0ZXIgYml0LCBlbHNlIHNsYXZlIGJp dA0KLSAgICAgICAgICAvLw0KLSAgICAgICAgICBpZiAoSWRlRGV2aWNlID09IDApIHsNCi0gICAg ICAgICAgICBpZiAoKElucXVpcnlEYXRhWzBdICYgMHgxZikgPT0gMHgwNSkgew0KLSAgICAgICAg ICAgICAgTG9jYWxIZGRJbmZvW1BjaUluZGV4ICsgSWRlQ2hhbm5lbF0uU3RhdHVzIHw9IEhERF9N QVNURVJfQVRBUElfQ0RST007DQotICAgICAgICAgICAgfSBlbHNlIGlmICgoSW5xdWlyeURhdGFb MF0gJiAweDFmKSA9PSAweDAwKSB7DQotICAgICAgICAgICAgICBMb2NhbEhkZEluZm9bUGNpSW5k ZXggKyBJZGVDaGFubmVsXS5TdGF0dXMgfD0gSEREX01BU1RFUl9BVEFQSV9aSVBESVNLOw0KLSAg ICAgICAgICAgIH0NCi0gICAgICAgICAgfSBlbHNlIHsNCi0gICAgICAgICAgICBpZiAoKElucXVp cnlEYXRhWzBdICYgMHgxZikgPT0gMHgwNSkgew0KLSAgICAgICAgICAgICAgTG9jYWxIZGRJbmZv W1BjaUluZGV4ICsgSWRlQ2hhbm5lbF0uU3RhdHVzIHw9IEhERF9TTEFWRV9BVEFQSV9DRFJPTTsN Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKChJbnF1aXJ5RGF0YVswXSAmIDB4MWYpID09IDB4MDAp IHsNCi0gICAgICAgICAgICAgIExvY2FsSGRkSW5mb1tQY2lJbmRleCArIElkZUNoYW5uZWxdLlN0 YXR1cyB8PSBIRERfU0xBVkVfQVRBUElfWklQRElTSzsNCi0gICAgICAgICAgICB9DQotICAgICAg ICAgIH0NCi0NCi0gICAgICAgICAgRnJlZVBvb2wgKElucXVpcnlEYXRhKTsNCi0gICAgICAgIH0g ZWxzZSB7DQotICAgICAgICAgIGlmIChJZGVEZXZpY2UgPT0gMCkgew0KLSAgICAgICAgICAgIExv Y2FsSGRkSW5mb1tQY2lJbmRleCArIElkZUNoYW5uZWxdLlN0YXR1cyB8PSBIRERfTUFTVEVSX0lE RTsNCi0gICAgICAgICAgfSBlbHNlIHsNCi0gICAgICAgICAgICBMb2NhbEhkZEluZm9bUGNpSW5k ZXggKyBJZGVDaGFubmVsXS5TdGF0dXMgfD0gSEREX1NMQVZFX0lERTsNCi0gICAgICAgICAgfQ0K LSAgICAgICA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AoKCh4KSArIDB4N2ZmKSAmIH4weDdmZikNCi0NCi0j ZGVmaW5lIE1BWF9CUklER0VfSU5ERVggIDB4MjANCi10eXBlZGVmIHN0cnVjdCB7DQotICBVSU5U TiAgICBQY2lTZWdtZW50Ow0KLSAgVUlOVE4gICAgUGNpQnVzOw0KLSAgVUlOVE4gICAgUGNpRGV2 aWNlOw0KLSAgVUlOVE4gICAgUGNpRnVuY3Rpb247DQotICBVSU5UOCAgICBQcmltYXJ5QnVzOw0K LSAgVUlOVDggICAgU2Vjb25kYXJ5QnVzOw0KLSAgVUlOVDggICAgU3Vib3JkaW5hdGVCdXM7DQot fSBCUklER0VfVEFCTEU7DQotDQotI2RlZmluZSBST01fTUFYX0VOVFJJRVMgIDI0DQotQlJJREdF X1RBQkxFICAgICAgICAgICAgICAgICBCcmlkZ2VzW01BWF9CUklER0VfSU5ERVhdOw0KLVVJTlRO ICAgICAgICAgICAgICAgICAgICAgICAgU29ydGVkQnJpZGdlSW5kZXhbTUFYX0JSSURHRV9JTkRF WF07DQotVUlOVE4gICAgICAgICAgICAgICAgICAgICAgICBOdW1iZXJPZkJyaWRnZXM7DQotTEVH QUNZX1BOUF9FWFBBTlNJT05fSEVBREVSICAqbUJhc2VQbnBQdHI7DQotVUlOVDE2ICAgICAgICAg ICAgICAgICAgICAgICBtQmJzUm9tU2VnbWVudDsNCi1VSU5UTiAgICAgICAgICAgICAgICAgICAg ICAgIG1IYW5kbGVDb3VudDsNCi1FRklfSEFORExFICAgICAgICAgICAgICAgICAgIG1WZ2FIYW5k bGU7DQotQk9PTEVBTiAgICAgICAgICAgICAgICAgICAgICBtSWdub3JlQmJzVXBkYXRlRmxhZzsN Ci1CT09MRUFOICAgICAgICAgICAgICAgICAgICAgIG1WZ2FJbnN0YWxsYXRpb25JblByb2dyZXNz ID0gRkFMU0U7DQotVUlOVDMyICAgICAgICAgICAgICAgICAgICAgICBtUm9tQ291bnQgICAgICAg ICAgICAgICAgICA9IDB4MDA7DQotUk9NX0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0gIE9VVCBVSU5UOCAgICAgICpEaXNrRW5kICAgICAgICAgICAg T1BUSU9OQUwsDQotICBPVVQgVk9JRCAgICAgICAqKlJvbVNoYWRvd0FkZHJlc3MgIE9QVElPTkFM LA0KLSAgT1VUIFVJTlROICAgICAgKlNoYWRvd2VkU2l6ZSAgICAgICBPUFRJT05BTA0KLSAgKQ0K LXsNCi0gIEVGSV9TVEFUVVMgICAgICAgICAgIFN0YXR1czsNCi0gIEVGSV9QQ0lfSU9fUFJPVE9D T0wgICpQY2lJbzsNCi0gIFVJTlROICAgICAgICAgICAgICAgIEluZGV4Ow0KLSAgVUlOVE4gICAg ICAgICAgICAgICAgUGNpU2VnbWVudDsNCi0gIFVJTlROICAgICAgICAgICAgICAgIFBjaUJ1czsN Ci0gIFVJTlROICAgICAgICAgICAgICAgIFBjaURldmljZTsNCi0gIFVJTlROICAgICAgICAgICAg ICAgIFBjaUZ1bmN0aW9uOw0KLQ0KLSAgLy8NCi0gIC8vIEdldCB0aGUgUENJIEkvTyBQcm90b2Nv bCBvbiBQY2lIYW5kbGUNCi0gIC8vDQotICBTdGF0dXMgPSBnQlMtPkhhbmRsZVByb3RvY29sICgN Ci0gICAgICAgICAgICAgICAgICBQY2lIYW5kbGUsDQotICAgICAgICAgICAgICAgICAgJmdFZmlQ Y2lJb1Byb3RvY29sR3VpZCwNCi0gICAgICAgICAgICAgICAgICAoVk9JRCAqKikmUGNpSW8NCi0g ICAgICAgICAgICAgICAgICApOw0KLSAgaWYgKEVGSV9FUlJPUiAoU3RhdHVzKSkgew0KLSAgICBy ZXR1cm4gU3RhdHVzOw0KLSAgfQ0KLQ0KLSAgLy8NCi0gIC8vIEdldCB0aGUgbG9jYXRpb24gb2Yg dGhlIFBDSSBkZXZpY2UNCi0gIC8vDQotICBQY2lJby0+R2V0TG9jYXRpb24gKA0KLSAgICAgICAg ICAgUGNpSW8sDQotICAgICAgICAgICAmUGNpU2VnbWVudCwNCi0gICAgICAgICAgICZQY2lCdXMs DQotIC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qKi8NCi1F RklfU1RBVFVTDQotSXNMZWdhY3lSb20gKA0KLSAgSU4gIEVGSV9IQU5ETEUgIFBjaUhhbmRsZQ0K LSAgKQ0KLXsNCi0gIEVGSV9TVEFUVVMgICAgICAgICAgIFN0YXR1czsNCi0gIEVGSV9QQ0lfSU9f UFJPVE9DT0wgICpQY2lJbzsNCi0gIFVJTlROICAgICAgICAgICAgICAgIEluZGV4Ow0KLSAgVUlO VE4gICAgICAgICAgICAgICAgU2VnbWVudDsNCi0gIFVJTlROICAgICAgICAgICAgICAgIEJ1czsN Ci0gIFVJTlROICAgICAgICAgICAgICAgIERldmljZTsNCi0gIFVJTlROICAgICAgICAgICAgICAg IEZ1bmN0aW9uOw0KLQ0KLSAgLy8NCi0gIC8vIEdldCB0aGUgUENJIEkvTyBQcm90b2NvbCBvbiBQ Y2lIYW5kbGUNCi0gIC8vDQotICBTdGF0dXMgPSBnQlMtPkhhbmRsZVByb3RvY29sICgNCi0gICAg ICAgICAgICAgICAgICBQY2lIYW5kbGUsDQotICAgICAgICAgICAgICAgICAgJmdFZmlQY2lJb1By b3RvY29sR3VpZCwNCi0gICAgICAgICAgICAgICAgICAoVk9JRCAqKikmUGNpSW8NCi0gICAgICAg ICAgICAgICAgICApOw0KLSAgaWYgKEVGSV9FUlJPUiAoU3RhdHVzKSkgew0KLSAgICByZXR1cm4g U3RhdHVzOw0KLSAgfQ0KLQ0KLSAgLy8NCi0gIC8vIEdldCB0aGUgbG9jYXRpb24gb2YgdGhlIFBD SSBkZXZpY2UNCi0gIC8vDQotICBQY2lJby0+R2V0TG9jYXRpb24gKA0KLSAgICAgICAgICAgUGNp SW8sDQotICAgICAgICAgICAmU2VnbWVudCwNCi0gICAgICAgICAgICZCdXMsDQotICAgICAgICAg ICAmRGV2aWNlLA0KLSAgICAgICAgICAgJkZ1bmN0aW9uDQotICAgICAgICAgICApOw0KLQ0KLSAg Ly8NCi0gIC8vIFNlZSBpZiB0aGUgb3B0aW9uIFJPTSBmcm9tI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C8vIENoZWNraW5nIHRoZSBkZXZpY2UgbGlzdA0KLSAgICAg ICAgICAvLw0KLSAgICAgICAgICB3aGlsZSAoKkRldmljZUlkTGlzdCAhPSAwKSB7DQotICAgICAg ICAgICAgaWYgKCpEZXZpY2VJZExpc3QgPT0gRGV2aWNlSWQpIHsNCi0gICAgICAgICAgICAgIE1h dGNoID0gVFJVRTsNCi0gICAgICAgICAgICAgIGJyZWFrOw0KLSAgICAgICAgICAgIH0NCi0NCi0g ICAgICAgICAgICBEZXZpY2VJZExpc3QrKzsNCi0gICAgICAgICAgfQ0KLSAgICAgICAgfQ0KLSAg ICAgIH0NCi0NCi0gICAgICBpZiAoTWF0Y2gpIHsNCi0gICAgICAgIGlmIChDc20xNlJldmlzaW9u ID49IDB4MDMwMCkgew0KLSAgICAgICAgICAvLw0KLSAgICAgICAgICAvLyBDYXNlIDE6IENTTTE2 IDMuMA0KLSAgICAgICAgICAvLw0KLSAgICAgICAgICBpZiAoUGNpci0+UmV2aXNpb24gPj0gMykg ew0KLSAgICAgICAgICAgIC8vDQotICAgICAgICAgICAgLy8gY2FzZSAxLjE6IG1lZXRzIE9wUm9t IDMuMA0KLSAgICAgICAgICAgIC8vICAgICAgICAgICBQZXJmZWN0ISEhDQotICAgICAgICAgICAg Ly8NCi0gICAgICAgICAgICBCZXN0SW1hZ2UgPSBSb21IZWFkZXIuUmF3Ow0KLSAgICAgICAgICAg IGJyZWFrOw0KLSAgICAgICAgICB9IGVsc2Ugew0KLSAgICAgICAgICAgIC8vDQotICAgICAgICAg ICAgLy8gY2FzZSAxLjI6IG1lZXRzIE9wUm9tIDIueA0KLSAgICAgICAgICAgIC8vICAgICAgICAg ICBTdG9yZSBpdCBhbmQgdHJ5IHRvIGZpbmQgdGhlIE9wUm9tIDMuMA0KLSAgICAgICAgICAgIC8v DQotICAgICAgICAgICAgQmFja3VwSW1hZ2UgPSBSb21IZWFkZXIuUmF3Ow0KLSAgICAgICAgICB9 DQotICAgICAgICB9IGVsc2Ugew0KLSAgICAgICAgICAvLw0KLSAgICAgICAgICAvLyBDYXNlIDI6 IENTTTE2IDIueA0KLSAgICAgICAgICAvLw0KLSAgICAgICAgICBpZiAoUGNpci0+UmV2aXNpb24g Pj0gMykgew0KLSAgICAgICAgICAgIC8vDQotICAgICAgICAgICAgLy8gY2FzZSAyLjE6IG1lZXRz IE9wUm9tIDMuMA0KLSAgICAgICAgICAgIC8vICAgICAgICAgICBTdG9yZSBpdCBhbmQgdHJ5IHRv IGZpbmQgdGhlIE9wUm9tIDIueA0KLSAgICAgICAgICAgIC8vDQotICAgICAgICAgICAgQmFja3Vw SW1hZ2UgPSBSb21IZWFkZXIuUmF3Ow0KLSAgICAgICAgICB9IGVsc2Ugew0KLSAgICAgICAgICAg IC8vDQotICAgICAgICAgICAgLy8gY2FzZSAyLjI6IG1lZXRzIE9wUm9tIDIueA0KLSAgICAgICAg ICAgIC8vICAgICAgICAgICBQZXJmZWN0ISEhDQotICAgICAgICAgICAgLy8NCi0gICAgICAgICAg ICBCZXN0SW1hZ2UgPSBSb21IZWFkZXIuUmF3Ow0KLSAgICAgICAgICAgIGJyZWFrOw0KLSAgICAg ICAgICB9DQotICAgICAgICB9DQotICAgICAgfSBlbHNlIHsNCi0gICAgICAgIERFQlVHICgoREVC VUdfRVJST1IsICJHZXRQY2lMZWdhY3lSb20gLSBPcFJvbSBub3QgbWF0Y2ggKCUwNHgtJTA0eClc biIsIChVSU5UTilWZW5kb3JJZCwgKFVJTlROKURldmljZUlkKSk7DQotICAgICAgfQ0KLSAgICB9 DQotDQotICAgIGlmICgoUGNpci0+SW5kaWNhdG9yICYgMHg4MCkgPT0gMHg4MCkgew0KLSAgICAg IGJyZWFrOw0KLSAgICB9IGVsc2Ugew0KLSAgICAgIFJvbUhlYWRlci5SYXcgKz0gNTEyICogUGNp ci0+SW1hZ2VMZW5ndGg7DQotICAgIH0NCi0gIH0NCi0NCi0gIGlmIChCZXN0SW1hZ2UgPT0gTlVM TCkgew0KLSAgICBpZ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DQotICBJTiBFRklfTEVHQUNZX0lSUV9ST1VU SU5HX0VOVFJZICAqUm91dGluZ1RhYmxlLA0KLSAgSU4gVUlOVE4gICAgICAgICAgICAgICAgICAg ICAgICAgUm91dGluZ1RhYmxlRW50cmllcw0KLSAgKQ0KLXsNCi0gIEVGSV9TVEFUVVMgICAgICAg ICAgIFN0YXR1czsNCi0gIFVJTlROICAgICAgICAgICAgICAgIEhhbmRsZUNvdW50Ow0KLSAgRUZJ X0hBTkRMRSAgICAgICAgICAgKkhhbmRsZUJ1ZmZlcjsNCi0gIFVJTlROICAgICAgICAgICAgICAg IEJyaWRnZUluZGV4Ow0KLSAgVUlOVE4gICAgICAgICAgICAgICAgSW5kZXg7DQotICBVSU5UTiAg ICAgICAgICAgICAgICBJbmRleDE7DQotICBFRklfUENJX0lPX1BST1RPQ09MICAqUGNpSW87DQot ICBQQ0lfVFlQRTAxICAgICAgICAgICBQY2lDb25maWdIZWFkZXI7DQotICBCUklER0VfVEFCTEUg ICAgICAgICBTbG90QnJpZGdlc1tNQVhfQlJJREdFX0lOREVYXTsNCi0gIFVJTlROICAgICAgICAg ICAgICAgIFNsb3RCcmlkZ2VJbmRleDsNCi0NCi0gIEJyaWRnZUluZGV4ICAgICA9IDB4MDA7DQot ICBTbG90QnJpZGdlSW5kZXggPSAweDAwOw0KLQ0KLSAgLy8NCi0gIC8vIEFzc3VtcHRpb24gaXMg dGFibGUgaXMgYnVpbHQgZnJvbSBsb3cgYnVzIHRvIGhpZ2ggYnVzIG51bWJlcnMuDQotICAvLw0K LSAgU3RhdHVzID0gZ0JTLT5Mb2NhdGVIYW5kbGVCdWZmZXIgKA0KLSAgICAgICAgICAgICAgICAg IEJ5UHJvdG9jb2wsDQotICAgICAgICAgICAgICAgICAgJmdFZmlQY2lJb1Byb3RvY29sR3VpZCwN Ci0gICAgICAgICAgICAgICAgICBOVUxMLA0KLSAgICAgICAgICAgICAgICAgICZIYW5kbGVDb3Vu dCwNCi0gICAgICAgICAgICAgICAgICAmSGFuZGxlQnVmZmVyDQotICAgICAgICAgICAgICAgICAg KTsNCi0gIGlmIChFRklfRVJST1IgKFN0YXR1cykpIHsNCi0gICAgcmV0dXJuIEVGSV9OT1RfRk9V TkQ7DQotICB9DQotDQotICBmb3IgKEluZGV4ID0gMDsgSW5kZXggPCBIYW5kbGVDb3VudDsgSW5k ZXgrKykgew0KLSAgICBTdGF0dXMgPSBnQlMtPkhhbmRsZVByb3RvY29sICgNCi0gICAgICAgICAg ICAgICAgICAgIEhhbmRsZUJ1ZmZlcltJbmRleF0sDQotICAgICAgICAgICAgICAgICAgICAmZ0Vm aVBjaUlvUHJvdG9jb2xHdWlkLA0KLSAgICAgICAgICAgICAgICAgICAgKFZPSUQgKiopJlBjaUlv DQotICAgICAgICAgICAgICAgICAgICApOw0KLSAgICBpZiAoRUZJX0VSUk9SIChTdGF0dXMpKSB7 DQotICAgICAgY29udGludWU7DQotICAgIH0NCi0NCi0gICAgUGNpSW8tPlBjaS5SZWFkICgNCi0g ICAgICAgICAgICAgICAgIFBjaUlvLA0KLSAgICAgICAgICAgICAgICAgRWZpUGNpSW9XaWR0aFVp bnQzMiwNCi0gICAgICAgICAgICAgICAgIDAsDQotICAgICAgICAgICAgICAgICBzaXplb2YgKFBj aUNvbmZpZ0hlYWRlcikgLyBzaXplb2YgKFVJTlQzMiksDQotICAgICAgICAgICAgICAgICAmUGNp Q29uZmlnSGVhZGVyDQotICAgICAgICAgICAgICAgICApOw0KLQ0KLSAgICBpZiAoSVNfUENJX1Ay UCAoJlBjaUNvbmZpZ0hlYWRlcikgJiYgKEJyaWRnZUluZGV4IDwgTUFYX0JSSURHRV9JTkRFWCkp IHsNCi0gICAgICBQY2lJby0+R2V0TG9jYXRpb24gKA0KLSAgICAgICAgICAgICAgIFBjaUlvLA0K LSAgICAgICAgICAgICAgICZCcmlkZ2VzW0JyaWRnZUluZGV4XS5QY2lTZWdtZW50LA0KLSAgICAg ICAgICAgICAgICZCcmlkZ2VzW0JyaWRnZ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BQSVJRIHJv dXRpbmcgaXMgQyxELEEsQg0KLSAgICAgICAgICAgIEJ1cyAyLCBEZXZpY2UgNyBpcyBhIGJyaWRn ZS4gSXQgaGFzIDEgYnJpZGdlIGJlaGluZCBpdC4NCi0gICAgICAgICAgICAgIFByaW1hcnkgYnVz ICMgPSAyDQotICAgICAgICAgICAgICBTZWNvbmRhcnkgYnVzID0gNCAgIERldmljZSA2IHRha2Vz IGJ1cyAyLg0KLSAgICAgICAgICAgICAgU3Vib3JkaW5hdGUgYnVzID0gNS4NCi0gICAgICAgICAg ICAgIEJyaWRnZSBQSVJRIHJvdXRpbmcgaXMgRCxBLEIsQw0KLSAgICAgICAgICAgICAgICAgQnVz IDQsIERldmljZSAyIGlzIGEgYnJpZGdlLiBJdCBoYXMgbm8gYnJpZGdlcyBiZWhpbmQgaXQuDQot ICAgICAgICAgICAgICAgICAgIFByaW1hcnkgYnVzICMgPSA0DQotICAgICAgICAgICAgICAgICAg IFNlY29uZGFyeSBidXMgIyA9IDUNCi0gICAgICAgICAgICAgICAgICAgU3Vib3JkaW5hdGUgYnVz ID0gNQ0KLSAgICAgICAgICAgICAgICAgICBCcmlkZ2UgUElSUSByb3V0aW5nIGlzIEIsQyxELEEN Ci0gICAgICAgICAgICAgICAgICAgICAgQnVzIDUsIERldmljZSAxIGlzIHRvIGJlIHByb2dyYW1t ZWQuDQotICAgICAgICAgICAgICAgICAgICAgICAgIERldmljZSBQSVJRIHJvdXRpbmcgaXMgQyxE LEEsQg0KLQ0KLQ0KLVNlYXJjaCBidXNzZXMgc3RhcnRpbmcgZnJvbSBzbG90IGJ1cyBmb3IgZmlu YWwgYnVzID49IFNlY29uZGFyeSBidXMgYW5kDQotZmluYWwgYnVzIDw9IFN1Ym9yZGluYXRlIGJ1 cy4gQXNzdW1wdGlvbiBpcyBidXMgZW50cmllcyBpbmNyZWFzZSBpbiBidXMNCi1udW1iZXIuDQot U3RhcnRpbmcgUElSUSBpcyBBLEIsQyxELg0KLUJ1cyAy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6ZQ0KLSAgKQ0KLXsNCi0gIEVGSV9JQTMyX1JF R0lTVEVSX1NFVCAgUmVnczsNCi0gIFVJTlQzMiAgICAgICAgICAgICAgICAgR3JhbnVsYXJpdHk7 DQotDQotICAvLw0KLSAgLy8gQ29weSAkUElSIHRhYmxlLCBpZiBpdCBleGlzdHMuDQotICAvLw0K LSAgaWYgKFBpcnFUYWJsZSAhPSBOVUxMKSB7DQotICAgIFByaXZhdGUtPkxlZ2FjeVJlZ2lvbi0+ VW5Mb2NrICgNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIFByaXZhdGUtPkxlZ2FjeVJl Z2lvbiwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4RTAwMDAsDQotICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAweDIwMDAwLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJkdyYW51bGFyaXR5DQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICApOw0KLQ0KLSAg ICBQcml2YXRlLT5JbnRlcm5hbElycVJvdXRpbmdUYWJsZSA9IFJvdXRpbmdUYWJsZTsNCi0gICAg UHJpdmF0ZS0+TnVtYmVySXJxUm91dGluZ0VudHJpZXMgPSAoVUlOVDE2KShSb3V0aW5nVGFibGVF bnRyaWVzKTsNCi0gICAgWmVyb01lbSAoJlJlZ3MsIHNpemVvZiAoRUZJX0lBMzJfUkVHSVNURVJf U0VUKSk7DQotDQotICAgIFJlZ3MuWC5BWCA9IExlZ2FjeTE2R2V0VGFibGVBZGRyZXNzOw0KLSAg ICBSZWdzLlguQ1ggPSAoVUlOVDE2KVBpcnFUYWJsZVNpemU7DQotICAgIC8vDQotICAgIC8vIEFs bG9jYXRlIGF0IEYgc2VnbWVudCBhY2NvcmRpbmcgdG8gUENJIElSUSBSb3V0aW5nIFRhYmxlIFNw ZWNpZmljYXRpb24NCi0gICAgLy8NCi0gICAgUmVncy5YLkJYID0gKFVJTlQxNikweDE7DQotICAg IC8vDQotICAgIC8vIDE2LWJ5dGUgYm91bmRhcnkgYWxpZ25tZW50IHJlcXVpcmVtZW50IGFjY29y ZGluZyB0bw0KLSAgICAvLyBQQ0kgSVJRIFJvdXRpbmcgVGFibGUgU3BlY2lmaWNhdGlvbg0KLSAg ICAvLw0KLSAgICBSZWdzLlguRFggPSAweDEwOw0KLSAgICBQcml2YXRlLT5MZWdhY3lCaW9zLkZh ckNhbGw4NiAoDQotICAgICAgICAgICAgICAgICAgICAgICAgICAmUHJpdmF0ZS0+TGVnYWN5Qmlv cywNCi0gICAgICAgICAgICAgICAgICAgICAgICAgIFByaXZhdGUtPkxlZ2FjeTE2Q2FsbFNlZ21l bnQsDQotICAgICAgICAgICAgICAgICAgICAgICAgICBQcml2YXRlLT5MZWdhY3kxNkNhbGxPZmZz ZXQsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAmUmVncywNCi0gICAgICAgICAgICAgICAg ICAgICAgICAgIE5VTEwsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAwDQotICAgICAgICAg ICAgICAgICAgICAgICAgICApOw0KLQ0KLSAgICBQcml2YXRlLT5MZWdhY3kxNlRhYmxlLT5JcnFS b3V0aW5nVGFibGVQb2ludGVyID0gKFVJTlQzMikoUmVncy5YLkRTICogMTYgKyBSZWdzLlguQlgp Ow0KLSAgICBpZiAoUmVncy5YLkFYICE9IDApIHsNCi0gICAgICBERUJVRyAoKERFQlVHX0VSUk9S LCAiUElSUSB0YWJsZSBsZW5ndGggaW5zdWZmaWNpZW50IC0gJXhcbiIsIFBpcnFUYWJsZVNpemUp KTsNCi0gICAgfSBlbHNlIHsNCi0gICAgICBERUJVRyAoKERFQlVHX0lORk8sICJQSVJRIHRhYmxl IGluIGxlZ2FjeSByZWdpb24gLSAleFxuIiwgUHJpdmF0ZS0+TGVnYWN5MTZUYWJsZS0+SXJxUm91 dGluZ1RhYmxlUG9pbnRlcikpOw0KLSAgICAgIFByaXZhdGUtPkxlZ2FjeTE2VGFibGUtPklycVJv dXRpbmdUYWJsZUxlbmd0aCA9IChVSU5UMzIpUGlycVRhYmxlU2l6ZTsNCi0gICAgICBDb3B5TWVt ICgNCi0gICAgICAgIChWT0lEICopKFVJTlROKVByaXZhdGUtPkxlZ2FjeTE2VGFibGUtPklycVJv dXRpbmdUYWJsZVBvaW50ZXIsDQotICAgICAgICBQaXJxVGFibGUsDQotICAgICAgICBQaXJxVGFi bGVTaXplDQotICAgICAgICApOw0KLSAgICB9DQotDQotICAgIFByaXZhdGUtPkNwdS0+Rmx1c2hE YXRhQ2FjaGUgKFByaXZhdGUtPkNwdSwgMHhFMDAwMCwgMHgyMDAwMCwgRWZpQ3B1Rmx1c2hUeXBl V3JpdGVCYWNrSW52YWxpZGF0ZSk7DQotICAgIFByaXZhdGUtPkxlZ2FjeVJlZ2lvbi0+TG9jayAo DQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQcml2YXRlLT5MZWdhY3lSZWdpb24sDQot ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEUwMDAwLA0KLSAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgMHgyMDAwMCwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICZHcmFu dWxhcml0eQ0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsNCi0gIH0NCi0NCi0gIFBy aXZhdGUtPlBjaUludGVycnVwdExpbmUgPSBUUlVFOw0KLSAgbUhhbmRsZUNvdW50ICAgICAgICAg ICAgICA9IDA7DQotfQ0KLQ0KLS8qKg0KLSAgRHVtcCBFRklfTEVHQUNZX0lOU1RBTExfUENJX0hB TkRMRVIgc3RydWN0dXJlIGluZm9ybWF0aW9uLg0KLQ0KLSAgQHBhcmFtICBQY2lIYW5kbGUgICAg ICAgICAgICAgICBUaGUgcG9pbnRlciB0byBFRklfTEVHQUNZX0lOU1RBTExfUENJX0hBTkRMRVIg c3RydWN0dXJlDQotDQotKiovDQotVk9JRA0KLUR1bXBQY2lIYW5kbGUgKA0KLSAgSU4gRUZJX0x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mFtICBQY2lJbyAgICAgICAgICAgICAgICAgIFBvaW50 ZXIgdG8gUENJX0lPIHByb3RvY29sDQotICBAcGFyYW0gIFBjaUlycSAgICAgICAgICAgICAgICAg UGNpIElSUSBudW1iZXINCi0gIEBwYXJhbSAgUGNpQ29uZmlnSGVhZGVyICAgICAgICBUeXBlMDAg UGNpIGNvbmZpZ3VyYXRpb24gaGVhZGVyDQotDQotKiovDQotVk9JRA0KLUluc3RhbGxMZWdhY3lJ cnFIYW5kbGVyICgNCi0gIElOIExFR0FDWV9CSU9TX0lOU1RBTkNFICAqUHJpdmF0ZSwNCi0gIElO IEVGSV9QQ0lfSU9fUFJPVE9DT0wgICAqUGNpSW8sDQotICBJTiBVSU5UOCAgICAgICAgICAgICAg ICAgUGNpSXJxLA0KLSAgSU4gUENJX1RZUEUwMCAgICAgICAgICAgICpQY2lDb25maWdIZWFkZXIN Ci0gICkNCi17DQotICBFRklfSUEzMl9SRUdJU1RFUl9TRVQgICAgIFJlZ3M7DQotICBVSU5UMTYg ICAgICAgICAgICAgICAgICAgIExlZ01hc2s7DQotICBVSU5UTiAgICAgICAgICAgICAgICAgICAg IFBjaVNlZ21lbnQ7DQotICBVSU5UTiAgICAgICAgICAgICAgICAgICAgIFBjaUJ1czsNCi0gIFVJ TlROICAgICAgICAgICAgICAgICAgICAgUGNpRGV2aWNlOw0KLSAgVUlOVE4gICAgICAgICAgICAg ICAgICAgICBQY2lGdW5jdGlvbjsNCi0gIEVGSV9MRUdBQ1lfODI1OV9QUk9UT0NPTCAgKkxlZ2Fj eTgyNTk7DQotICBVSU5UMTYgICAgICAgICAgICAgICAgICAgIFByaW1hcnlNYXN0ZXI7DQotICBV SU5UMTYgICAgICAgICAgICAgICAgICAgIFNlY29uZGFyeU1hc3RlcjsNCi0gIFVJTlROICAgICAg ICAgICAgICAgICAgICAgVGVtcERhdGE7DQotICBVSU5UTiAgICAgICAgICAgICAgICAgICAgIFJl Z2lzdGVyQWRkcmVzczsNCi0gIFVJTlQzMiAgICAgICAgICAgICAgICAgICAgR3JhbnVsYXJpdHk7 DQotDQotICBQcmltYXJ5TWFzdGVyICAgPSAwOw0KLSAgU2Vjb25kYXJ5TWFzdGVyID0gMDsNCi0g IExlZ2FjeTgyNTkgICAgICA9IFByaXZhdGUtPkxlZ2FjeTgyNTk7DQotICAvLw0KLSAgLy8gRGlz YWJsZSBpbnRlcnJ1cHQgaW4gUElDLCBpbiBjYXNlIHNoYXJlZCwgdG8gcHJldmVudCBhbg0KLSAg Ly8gaW50ZXJydXB0IGZyb20gb2NjdXJyaW5nLg0KLSAgLy8NCi0gIExlZ2FjeTgyNTktPkdldE1h c2sgKA0KLSAgICAgICAgICAgICAgICBMZWdhY3k4MjU5LA0KLSAgICAgICAgICAgICAgICAmTGVn TWFzaywNCi0gICAgICAgICAgICAgICAgTlVMTCwNCi0gICAgICAgICAgICAgICAgTlVMTCwNCi0g ICAgICAgICAgICAgICAgTlVMTA0KLSAgICAgICAgICAgICAgICApOw0KLQ0KLSAgTGVnTWFzayA9 IChVSU5UMTYpKExlZ01hc2sgfCAoVUlOVDE2KSgxIDw8IFBjaUlycSkpOw0KLQ0KLSAgTGVnYWN5 ODI1OS0+U2V0TWFzayAoDQotICAgICAgICAgICAgICAgIExlZ2FjeTgyNTksDQotICAgICAgICAg ICAgICAgICZMZWdNYXNrLA0KLSAgICAgICAgICAgICAgICBOVUxMLA0KLSAgICAgICAgICAgICAg ICBOVUxMLA0KLSAgICAgICAgICAgICAgICBOVUxMDQotICAgICAgICAgICAgICAgICk7DQotDQot ICBQY2lJby0+R2V0TG9jYXRpb24gKA0KLSAgICAgICAgICAgUGNpSW8sDQotICAgICAgICAgICAm UGNpU2VnbWVudCwNCi0gICAgICAgICAgICZQY2lCdXMsDQotICAgICAgICAgICAmUGNpRGV2aWNl LA0KLSAgICAgICAgICAgJlBjaUZ1bmN0aW9uDQotICAgICAgICAgICApOw0KLSAgUHJpdmF0ZS0+ SW50VGh1bmstPlBjaUhhbmRsZXIuU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aUhhbmRsZXIpOw0KLQ0KLSAgUHJpdmF0ZS0+TGVnYWN5Qmlvcy5G YXJDYWxsODYgKA0KLSAgICAgICAgICAgICAgICAgICAgICAgICZQcml2YXRlLT5MZWdhY3lCaW9z LA0KLSAgICAgICAgICAgICAgICAgICAgICAgIFByaXZhdGUtPkxlZ2FjeTE2Q2FsbFNlZ21lbnQs DQotICAgICAgICAgICAgICAgICAgICAgICAgUHJpdmF0ZS0+TGVnYWN5MTZDYWxsT2Zmc2V0LA0K LSAgICAgICAgICAgICAgICAgICAgICAgICZSZWdzLA0KLSAgICAgICAgICAgICAgICAgICAgICAg IE5VTEwsDQotICAgICAgICAgICAgICAgICAgICAgICAgMA0KLSAgICAgICAgICAgICAgICAgICAg ICAgICk7DQotDQotICBQcml2YXRlLT5DcHUtPkZsdXNoRGF0YUNhY2hlIChQcml2YXRlLT5DcHUs IDB4RTAwMDAsIDB4MjAwMDAsIEVmaUNwdUZsdXNoVHlwZVdyaXRlQmFja0ludmFsaWRhdGUpOw0K LSAgUHJpdmF0ZS0+TGVnYWN5UmVnaW9uLT5Mb2NrICgNCi0gICAgICAgICAgICAgICAgICAgICAg ICAgICBQcml2YXRlLT5MZWdhY3lSZWdpb24sDQotICAgICAgICAgICAgICAgICAgICAgICAgICAg MHhFMDAwMCwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAweDIwMDAwLA0KLSAgICAgICAg ICAgICAgICAgICAgICAgICAgICZHcmFudWxhcml0eQ0KLSAgICAgICAgICAgICAgICAgICAgICAg ICAgICk7DQotfQ0KLQ0KLS8qKg0KLSAgUHJvZ3JhbSB0aGUgaW50ZXJydXB0IHJvdXRpbmcgcmVn aXN0ZXIgaW4gYWxsIHRoZSBQQ0kgZGV2aWNlcy4gT24gYSBQQyBBVCBzeXN0ZW0NCi0gIHRoaXMg cmVnaXN0ZXIgY29udGFpbnMgdGhlIDgyNTkgSVJRIHZlY3RvciB0aGF0IG1hdGNoZXMgaXRzIFBD SSBpbnRlcnJ1cHQuDQotDQotICBAcGFyYW0gIFByaXZhdGUgICAgICAgICAgICAgICAgTGVnYWN5 ICBCSU9TIEluc3RhbmNlIGRhdGENCi0NCi0gIEByZXR2YWwgRUZJX1NVQ0NFU1MgICAgICAgICAg ICBTdWNjZWVkLg0KLSAgQHJldHZhbCBFRklfQUxSRUFEWV9TVEFSVEVEICAgIEFsbCBQQ0kgZGV2 aWNlcyBoYXZlIGJlZW4gcHJvY2Vzc2VkLg0KLQ0KLSoqLw0KLUVGSV9TVEFUVVMNCi1QY2lQcm9n cmFtQWxsSW50ZXJydXB0TGluZVJlZ2lzdGVycyAoDQotICBJTiAgTEVHQUNZX0JJT1NfSU5TVEFO Q0UgICpQcml2YXRlDQotICApDQotew0KLSAgRUZJX1NUQVRVUyAgICAgICAgICAgICAgICAgICAg ICAgICBTdGF0dXM7DQotICBFRklfUENJX0lPX1BST1RPQ09MICAgICAgICAgICAgICAgICpQY2lJ bzsNCi0gIEVGSV9MRUdBQ1lfODI1OV9QUk9UT0NPTCAgICAgICAgICAgKkxlZ2FjeTgyNTk7DQot ICBFRklfTEVHQUNZX0lOVEVSUlVQVF9QUk9UT0NPTCAgICAgICpMZWdhY3lJbnRlcnJ1cHQ7DQot ICBFRklfTEVHQUNZX0JJT1NfUExBVEZPUk1fUFJPVE9DT0wgICpMZWdhY3lCaW9zUGxhdGZvcm07 DQotICBVSU5UOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludGVycnVwdFBpbjsNCi0g IFVJTlROICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW5kZXg7DQotICBVSU5UTiAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIEhhbmRsZUNvdW50Ow0KLSAgRUZJX0hBTkRMRSAgICAg ICAgICAgICAgICAgICAgICAgICAqSGFuZGxlQnVmZmVyOw0KLSAgVUlOVE4gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBNYXNzU3RvcmFnZUhhbmRsZUNvdW50Ow0KLSAgRUZJX0hBTkRMRSAg ICAgICAgICAgICAgICAgICAgICAgICAqTWFzc1N0b3JhZ2VIYW5kbGVCdWZmZXI7DQotICBVSU5U TiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1hc3NTdG9yYWdlSGFuZGxlSW5kZXg7DQot ICBVSU5UOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBjaUlycTsNCi0gIFVJTlQxNiAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgQ29tbWFuZDsNCi0gIFVJTlROICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgUGNpU2VnbWVudDsNCi0gIFVJTlROICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgUGNpQnVzOw0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBQY2lEZXZpY2U7DQotICBVSU5UTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBjaUZ1 bmN0aW9uOw0KLSAgRUZJX0xFR0FDWV9JUlFfUk9VVElOR19FTlRSWSAgICAgICAqUm91dGluZ1Rh YmxlOw0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSb3V0aW5nVGFibGVF bnRyaWVzOw0KLSAgVUlOVDE2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMZWdNYXNrOw0K LSAgVUlOVDE2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMZWdFZGdlTGV2ZWw7DQotICBQ Q0lfVFlQRTAwICAgICAgICAgICAgICAgICAgICAgICAgIFBjaUNvbmZpZ0hlYWRlcjsNCi0gIEVG SV9MRUdBQ1lfUElSUV9UQUJMRV9IRUFERVIgICAgICAgKlBpcnFUYWJsZTsNCi0gIFVJTlROICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgUGlycVRhYmxlU2l6ZTsNCi0gIFVJTlROICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgRmxhZ3M7DQotICBIRERfSU5GTyAgICAgICAgICAgICAg ICAgICAgICAgICAgICpIZGRJ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ZS0+TGVnYWN5Qmlvc1BsYXRmb3JtOw0KLQ0KLSAgTGVnYWN5Qmlv c1BsYXRmb3JtLT5HZXRSb3V0aW5nVGFibGUgKA0KLSAgICAgICAgICAgICAgICAgICAgICAgIFBy aXZhdGUtPkxlZ2FjeUJpb3NQbGF0Zm9ybSwNCi0gICAgICAgICAgICAgICAgICAgICAgICAoVk9J RCAqKSZSb3V0aW5nVGFibGUsDQotICAgICAgICAgICAgICAgICAgICAgICAgJlJvdXRpbmdUYWJs ZUVudHJpZXMsDQotICAgICAgICAgICAgICAgICAgICAgICAgKFZPSUQgKikmUGlycVRhYmxlLA0K LSAgICAgICAgICAgICAgICAgICAgICAgICZQaXJxVGFibGVTaXplLA0KLSAgICAgICAgICAgICAg ICAgICAgICAgIE5VTEwsDQotICAgICAgICAgICAgICAgICAgICAgICAgTlVMTA0KLSAgICAgICAg ICAgICAgICAgICAgICAgICk7DQotICBDcmVhdGVCcmlkZ2VUYWJsZSAoUm91dGluZ1RhYmxlLCBS b3V0aW5nVGFibGVFbnRyaWVzKTsNCi0NCi0gIGlmICghUHJpdmF0ZS0+UGNpSW50ZXJydXB0TGlu ZSkgew0KLSAgICBDb3B5UGlycVRhYmxlICgNCi0gICAgICBQcml2YXRlLA0KLSAgICAgIFJvdXRp bmdUYWJsZSwNCi0gICAgICBSb3V0aW5nVGFibGVFbnRyaWVzLA0KLSAgICAgIFBpcnFUYWJsZSwN Ci0gICAgICBQaXJxVGFibGVTaXplDQotICAgICAgKTsNCi0gIH0NCi0NCi0gIFN0YXR1cyA9IGdC Uy0+TG9jYXRlSGFuZGxlQnVmZmVyICgNCi0gICAgICAgICAgICAgICAgICBCeVByb3RvY29sLA0K LSAgICAgICAgICAgICAgICAgICZnRWZpUGNpSW9Qcm90b2NvbEd1aWQsDQotICAgICAgICAgICAg ICAgICAgTlVMTCwNCi0gICAgICAgICAgICAgICAgICAmSGFuZGxlQ291bnQsDQotICAgICAgICAg ICAgICAgICAgJkhhbmRsZUJ1Z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AwOw0KLSAg ICB9DQotDQotICAgIFN0YXR1cyA9IGdCUy0+SGFuZGxlUHJvdG9jb2wgKA0KLSAgICAgICAgICAg ICAgICAgICAgSGFuZGxlQnVmZmVyW0luZGV4XSwNCi0gICAgICAgICAgICAgICAgICAgICZnRWZp UGNpSW9Qcm90b2NvbEd1aWQsDQotICAgICAgICAgICAgICAgICAgICAoVk9JRCAqKikmUGNpSW8N Ci0gICAgICAgICAgICAgICAgICAgICk7DQotICAgIEFTU0VSVF9FRklfRVJST1IgKFN0YXR1cyk7 DQotDQotICAgIC8vDQotICAgIC8vIFRlc3Qgd2hldGhlciB0aGUgZGV2aWNlIGNhbiBiZSBlbmFi bGVkIG9yIG5vdC4NCi0gICAgLy8gSWYgaXQgY2FuJ3QgYmUgZW5hYmxlZCwgdGhlbiBqdXN0IHNr aXAgaXQgdG8gYXZvaWQgZnVydGhlciBvcGVyYXRpb24uDQotICAgIC8vDQotICAgIFBjaUlvLT5Q Y2kuUmVhZCAoDQotICAgICAgICAgICAgICAgICBQY2lJbywNCi0gICAgICAgICAgICAgICAgIEVm aVBjaUlvV2lkdGhVaW50MzIsDQotICAgICAgICAgICAgICAgICAwLA0KLSAgICAgICAgICAgICAg ICAgc2l6ZW9mIChQY2lDb25maWdIZWFkZXIpIC8gc2l6ZW9mIChVSU5UMzIpLA0KLSAgICAgICAg ICAgICAgICAgJlBjaUNvbmZpZ0hlYWRlcg0KLSAgICAgICAgICAgICAgICAgKTsNCi0gICAgQ29t bWFuZCA9IFBjaUNvbmZpZ0hlYWRlci5IZHIuQ29tbWFuZDsNCi0NCi0gICAgLy8NCi0gICAgLy8g Tm90ZSBQY2lJby0+QXR0cmlidXRlcyBkb2VzIG5vdCBwcm9ncmFtIHRoZSBQQ0kgY29tbWFuZCBy ZWdpc3Rlcg0KLSAgICAvLw0KLSAgICBTdGF0dXMgPSBQY2lJby0+QXR0cmlidXRlcyAoDQotICAg ICAgICAgICAgICAgICAgICAgIFBjaUlvLA0KLSAgICAgICAgICAgICAgICAgICAgICBFZmlQY2lJ b0F0dHJpYnV0ZU9wZXJhdGlvblN1cHBvcnRlZCwNCi0gICAgICAgICAgICAgICAgICAgICAgMCwN Ci0gICAgICAgICAgICAgICAgICAgICAgJlN1cHBvcnRzDQotICAgICAgICAgICAgICAgICAgICAg ICk7DQotICAgIGlmICghRUZJX0VSUk9SIChTdGF0dXMpKSB7DQotICAgICAgU3VwcG9ydHMgJj0g KFVJTlQ2NClFRklfUENJX0RFVklDRV9FTkFCTEU7DQotICAgICAgU3RhdHVzICAgID0gUGNpSW8t PkF0dHJpYnV0ZXMgKA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgIFBjaUlvLA0KLSAgICAg ICAgICAgICAgICAgICAgICAgICAgIEVmaVBjaUlvQXR0cmlidXRlT3BlcmF0aW9uRW5hYmxlLA0K LSAgICAgICAgICAgICAgICAgICAgICAgICAgIFN1cHBvcnRzLA0KLSAgICAgICAgICAgICAgICAg ICAgICAgICAgIE5VTEwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICApOw0KLSAgICB9DQot DQotICAgIFBjaUlvLT5QY2kuV3JpdGUgKFBjaUlvLCBFZmlQY2lJb1dpZHRoVWludDE2LCAweDA0 LCAxLCAmQ29tbWFuZCk7DQotDQotICAgIGlmIChFRklfRVJST1IgKFN0YXR1cykpIHsNCi0gICAg ICBjb250aW51ZTsNCi0gICAgfQ0KLQ0KLSAgICBJbnRlcnJ1cHRQaW4gPSBQY2lDb25maWdIZWFk ZXIuRGV2aWNlLkludGVycnVwdFBpbjsNCi0NCi0gICAgaWYgKChJbnRlcnJ1cHRQaW4gIT0gMCkg JiYgKFBjaUNvbmZpZ0hlYWRlci5EZXZpY2UuSW50ZXJydXB0TGluZSA9PSBQQ0lfSU5UX0xJTkVf VU5LTk9XTikpIHsNCi0gICAgICBQY2lJby0+R2V0TG9jYXRpb24gKA0KLSAgICAgICAgICAgICAg IFBjaUlvLA0KLSAgICAgICAgICAgICAgICZQY2lTZWdtZW50LA0KLSAgICAgICAgICAgICAgICZQ Y2lCdXMsDQotICAgICAgICAgICAgICAgJlBjaURldmljZSwNCi0gICAgICAgICAgICAgICAmUGNp RnVuY3Rpb24NCi0gICAgICAgICAgICAgICApOw0KLSAgICAgIC8vDQotICAgICAgLy8gVHJhbnNs YXRlIFBJUlEgaW5kZXggYmFjayB0aHJ1IGJ1c3NlcyB0byBzbG90IGJ1cyB3aXRoIEludGVycnVw dFBpbg0KLSAgICAgIC8vIHplcm8gYmFzZWQNCi0gICAgICAvLw0KLSAgICAgIEludGVycnVwdFBp biAtPSAxOw0KLQ0KLSAgICAgIFN0YXR1cyA9IEdldEJhc2VCdXMgKA0KLSAgICAgICAgICAgICAg ICAgUHJpdmF0ZSwNCi0gICAgICAgICAgICAgICAgIFBjaUJ1cywNCi0gICAgICAgICAgICAgICAg IFBjaURldmljZSwNCi0gICAgICAgICAgICAgICAgIFJvdXRpbmdUYWJsZSwNCi0gICAgICAgICAg ICAgICAgIFJvdXRpbmdUYWJsZUVudHJpZXMNCi0gICAgICAgICAgICAgICAgICk7DQotDQotICAg ICAgaWYgKFN0YXR1cyA9PSBFRklfTk9UX0ZPVU5EKSB7DQotICAgICAgICBUcmFuc2xhdGVCdXNQ aXJxICgNCi0gICAgICAgICAgUHJpdmF0ZSwNCi0gICAgICAgICAgJlBjaUJ1cywNCi0gICAgICAg ICAgJlBjaURldmljZSwNCi0gICAgICAgICAgJlBjaUZ1bmN0aW9uLA0KLSAgICAgICAgICAmSW50 ZXJydXB0UGluDQotICAgICAgICAgICk7DQotICAgICAgfQ0KLQ0KLSAgICAgIC8vDQotICAgICAg Ly8gVHJhbnNsYXRlIEludGVycnVwdFBpbigwLTMpIGludG8gUElSUQ0KLSAgICAgIC8vDQotICAg ICAgU3RhdHVzID0gTGVnYWN5Qmlvc1BsYXRmb3JtLT5UcmFuc2xhdGVQaXJxICgNCi0gICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGVnYWN5Qmlvc1BsYXRmb3JtLA0KLSAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQY2lCdXMsDQotICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIChQY2lEZXZpY2UgPDwgMyksDQotICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIFBjaUZ1bmN0aW9uLA0KLSAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmSW50ZXJydXB0UGluLA0KLSAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmUGNpSXJxDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICk7DQotICAgICAgLy8NCi0gICAgICAvLyBUcmFuc2xhdGVQaXJxKCkgc2hvdWxkIG5ldmVy IGZhaWwgb3Igd2UgYXJlIGluIHRyb3VibGUNCi0gICAgICAvLyBJZiBpdCBkb2VzIHJldHVybiBm YWlsdXJlIHN0YXR1cywgY2hlY2sgeW91ciBQSVJRIHJvdXRpbmcgdGFibGUgdG8gc2VlIGlmIHNv bWUgaXRlbSBpcyBtaXNzaW5nIG9yIGluY29ycmVjdA0KLSAgICAgIC8vDQotICAgICAgaWYgKEVG SV9FUlJPUiAoU3RhdHVzKSkgew0KLSAgICAgICAgREVCVUcgKChERUJVR19FUlJPUiwgIlRyYW5z bGF0ZSBQaXJxIEZhaWxlZCAtIFN0YXR1cyA9ICVyXG4gIiwgU3RhdHVzKSk7DQotICAgICAgICBj b250aW51ZTsNCi0gICAgICB9DQotDQotICAgICAgTGVnYWN5SW50ZXJydXB0LT5Xcml0ZVBpcnEg KA0KLSAgICAgICAgICAgICAgICAgICAgICAgICBMZWdhY3lJbnRlcnJ1cHQsDQotICAgICAgICAg ICAgICAgICAgICAgICAgIEludGVycnVwdFBpbiwNCi0gICAgICAgICAgICAgICAgICAgICAgICAg UGNpSXJxDQotICAgICAgICAgICAgICAgICAgICAgICAgICk7DQotDQotICAgICAgLy8NCi0gICAg ICAvLyBDaGVjayBp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QQ0kgY29uZmlnIHNwYWNl IGFmdGVyIGFzIGl0IGNhbg0KLSAgICAgICAgLy8gY2hhbmdlDQotICAgICAgICAvLw0KLSAgICAg ICAgLy8NCi0gICAgICAgIC8vIEdldCBJREUgSGFuZGxlLiBJZiBtYXRjaGVzIGhhbmRsZSB0aGVu IHNraXAgQ29ubmVjdENvbnRyb2xsZXINCi0gICAgICAgIC8vIHNpbmNlIENvbm5lY3RDb250cm9s bGVyIG1heSBmb3JjZSBuYXRpdmUgbW9kZSBhbmQgd2UgZG9uJ3QNCi0gICAgICAgIC8vIHdhbnQg dGhhdCBmb3IgcHJpbWFyeSBJREUgY29udHJvbGxlcg0KLSAgICAgICAgLy8NCi0gICAgICAgIE1h c3NTdG9yYWdlSGFuZGxlQ291bnQgID0gMDsNCi0gICAgICAgIE1hc3NTdG9yYWdlSGFuZGxlQnVm ZmVyID0gTlVMTDsNCi0gICAgICAgIExlZ2FjeUJpb3NQbGF0Zm9ybS0+R2V0UGxhdGZvcm1IYW5k bGUgKA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFByaXZhdGUtPkxlZ2FjeUJpb3NQ bGF0Zm9ybSwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFZmlHZXRQbGF0Zm9ybUlk ZUhhbmRsZSwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLA0KLSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICZNYXNzU3RvcmFnZUhhbmRsZUJ1ZmZlciwNCi0gICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmTWFzc1N0b3JhZ2VIYW5kbGVDb3VudCwNCi0gICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBOVUxMDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg KTsNCi0NCi0gICAgICAgIEhkZEluZm8gPSAmUHJpdmF0ZS0+SW50VGh1bmstPkVmaVRvTGVnYWN5 MTZCb290VGFibGUuSGRkSW5mb1swXTsNCi0NCi0gICAgICAgIExlZ2FjeUJpb3NCdWlsZElkZURh dGEgKFByaXZhdGUsICZIZGRJbmZvLCAwKTsNCi0gICAgICAgIFBjaUlvLT5QY2kuUmVhZCAoDQot ICAgICAgICAgICAgICAgICAgICAgUGNpSW8sDQotICAgICAgICAgICAgICAgICAgICAgRWZpUGNp SW9XaWR0aFVpbnQzMiwNCi0gICAgICAgICAgICAgICAgICAgICAwLA0KLSAgICAgICAgICAgICAg ICAgICAgIHNpemVvZiAoUGNpQ29uZmlnSGVhZGVyKSAvIHNpemVvZiAoVUlOVDMyKSwNCi0gICAg ICAgICAgICAgICAgICAgICAmUGNpQ29uZmlnSGVhZGVyDQotICAgICAgICAgICAgICAgICAgICAg KTsNCi0NCi0gICAgICAgIGZvciAoTWFzc1N0b3JhZ2VIYW5kbGVJbmRleCA9IDA7IE1hc3NTdG9y YWdlSGFuZGxlSW5kZXggPCBNYXNzU3RvcmFnZUhhbmRsZUNvdW50OyBNYXNzU3RvcmFnZUhhbmRs ZUluZGV4KyspIHsNCi0gICAgICAgICAgaWYgKE1hc3NTdG9yYWdlSGFuZGxlQnVmZmVyW01hc3NT dG9yYWdlSGFuZGxlSW5kZXhdID09IEhhbmRsZUJ1ZmZlcltJbmRleF0pIHsNCi0gICAgICAgICAg ICAvLw0KLSAgICAgICAgICAgIC8vIEluc3RhbGxMZWdhY3lJcnFIYW5kbGVyIGFjY29yZGluZyB0 byBQbGF0Zm9ybSByZXF1aXJlbWVudA0KLSAgICAgICAgICAgIC8vDQotICAgICAgICAgICAgSW5z dGFsbExlZ2FjeUlycUhhbmRsZXIgKA0KLSAgICAgICAgICAgICAgUHJpdmF0ZSwNCi0gICAgICAg ICAgICAgIFBjaUlvLA0KLSAgICAgICAgICAgICAgUGNpSXJxLA0KLSAgICAgICAgICAgICAgJlBj aUNvbmZpZ0hlYWRlcg0KLSAgICAgICAgICAgICAgKTsNCi0gICAgICAgICAgICBicmVhazsNCi0g ICAgICAgICAgfQ0KLSAgICAgICAgfQ0KLSAgICAgIH0NCi0NCi0gICAgICAvLw0KLSAgICAgIC8v IFdyaXRlIEludGVycnVwdFBpbiBhbmQgZW5hYmxlIDgyNTkuDQotICAgICAgLy8NCi0gICAgICBQ Y2lJby0+UGNpLldyaXRlICgNCi0gICAgICAgICAgICAgICAgICAgUGNpSW8sDQotICAgICAgICAg ICAgICAgICAgIEVmaVBjaUlvV2lkdGhVaW50OCwNCi0gICAgICAgICAgICAgICAgICAgMHgzYywN Ci0gICAgICAgICAgICAgICAgICAgMSwNCi0gICAgICAgICAgICAgICAgICAgJlBjaUlycQ0KLSAg ICAgICAgICAgICAgICAgICApOw0KLSAgICAgIFByaXZhdGUtPkludFRodW5rLT5FZmlUb0xlZ2Fj eTE2Qm9vdFRhYmxlLlBjaUlycU1hc2sgPSAoVUlOVDE2KShQcml2YXRlLT5JbnRUaHVuay0+RWZp VG9MZWdhY3kxNkJvb3RUYWJsZS5QY2lJcnFNYXNrIHwgKFVJTlQxNikoMSA8PCBQY2lJcnEpKTsN Ci0NCi0gICAgICBMZWdhY3k4MjU5LT5HZXRNYXNrICgNCi0gICAgICAgICAgICAgICAgICAgIExl Z2FjeTgyNTksDQotICAgICAgICAgICAgICAgICAgICAmTGVnTWFzaywNCi0gICAgICAgICAgICAg ICAgICAgICZMZWdFZGdlTGV2ZWwsDQotICAgICAgICAgICAgICAgICAgICBOVUxMLA0KLSAgICAg ICAgICAgICAgICAgICAgTlVMTA0KLSAgICAgICAgICAgICAgICAgICAgKTsNCi0NCi0gICAgICBM ZWdNYXNrICAgICAgPSAoVUlOVDE2KShMZWdNYXNrICYgKFVJTlQxNikgfigxIDw8IFBjaUlycSkp Ow0KLSAgICAgIExlZ0VkZ2VMZXZlbCA9IChVSU5UMTYpKExlZ0VkZ2VMZXZlbCB8IChVSU5UMTYp KDEgPDwgUGNpSXJxKSk7DQotICAgICAgTGVnYWN5ODI1OS0+U2V0TWFzayAoDQotICAgICAgICAg ICAgICAgICAgICBMZWdhY3k4MjU5LA0KLSAgICAgICAgICAgICAgICAgICAgJkxlZ01hc2ssDQot ICAgICAgICAgICAgICAgICAgICAmTGVnRWRnZUxldmVsLA0KLSAgICAgICAgICAgICAgICAgICAg TlVMTCwNCi0gICAgICAgICAgICAgICAgICAgIE5VTEwNCi0gICAgICAgICAgICAgICAgICAgICk7 DQotICAgIH0NCi0gIH0NCi0NCi0gIEZyZWVQb29sIChIYW5kbGVCdWZmZXIpOw0KLSAgcmV0dXJu IEVGSV9TVUNDRVNTOw0KLX0NCi0NCi0vKioNCi0gIEZpbmQgJiB2ZXJpZnkgUG5QIEV4cGFuc2lv biBoZWFkZXIgaW4gUk9NIGltYWdlDQotDQotICBAcGFyYW0gIFByaXZhdGUgICAgICAgICAgICAg ICAgUHJvdG9jb2wgaW5zdGFuY2UgcG9pbnRlci4NCi0gIEBwYXJhbSAgRmlyc3RIZWFkZXIgICAg ICAgICAgICAxID0gRmluZCBmaXJzdCBoZWFkZXIsIDAgPSBGaW5kIHN1Y2Nlc3NpdmUgaGVhZGVy cw0KLSAgQHBhcmFtICBQbnBQdHIgICAgICAgICAgICAgICAgIElucHV0IFJvbSBzdGFydCBpZiBG aXJzdEhlYWRlciA9MSwgQ3VycmVudCBIZWFkZXINCi0gICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBvdGhlcndpc2UgT3V0cHV0IE5leHQgaGVhZGVyLCBpZiBpdCBleGlzdHMNCi0NCi0g IEByZXR2YWwgRUZJX1NVQ0NFU1MgICAgICAgICAgICBOZXh0IEhlYWRlciBmb3VuZCBhdCBCYXNl UG5wUHRyDQotICBAcmV0dmFsIEVGSV9OT1RfRk9VTkQgICAgICAgICAgTm8gbW9yZSBoZWFkZXJz DQotDQotKiovDQotRUZJX1NUQVRVUw0KLUZpbmROZXh0UG5wRXhwYW5zaW9uSGVhZGVyICgNCi0g IElOICBMRUdBQ1lfQklPU19JTlNUQU5DRSAgICAgICAgICAgICpQcml2YXRlLA0KLSAgSU4gQk9P TEVBTiAgICAgICAgICAg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Bj aUlvDQotICApDQotew0KLSAgVk9JRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKlJvbUVu ZDsNCi0gIEJCU19UQUJMRSAgICAgICAgICAgICAgICAgICAgICAgICpCYnNUYWJsZTsNCi0gIFVJ TlROICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJic0luZGV4Ow0KLSAgRUZJX0xFR0FDWV9F WFBBTlNJT05fUk9NX0hFQURFUiAgKlBjaVB0cjsNCi0gIExFR0FDWV9QTlBfRVhQQU5TSU9OX0hF QURFUiAgICAgICpQbnBQdHI7DQotICBCT09MRUFOICAgICAgICAgICAgICAgICAgICAgICAgICBJ bnN0YW5jZTsNCi0gIEVGSV9TVEFUVVMgICAgICAgICAgICAgICAgICAgICAgIFN0YXR1czsNCi0g IFVJTlROICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNlZ21lbnQ7DQotICBVSU5UTiAgICAg ICAgICAgICAgICAgICAgICAgICAgICBCdXM7DQotICBVSU5UTiAgICAgICAgICAgICAgICAgICAg ICAgICAgICBEZXZpY2U7DQotICBVSU5UTiAgICAgICAgICAgICAgICAgICAgICAgICAgICBGdW5j dGlvbjsNCi0gIFVJTlQ4ICAgICAgICAgICAgICAgICAgICAgICAgICAgIENsYXNzOw0KLSAgVUlO VDE2ICAgICAgICAgICAgICAgICAgICAgICAgICAgRGV2aWNlVHlwZTsNCi0NCi0gIFNlZ21lbnQg ICAgPSAwOw0KLSAgQnVzICAgICAgICA9IDA7DQotICBEZXZpY2UgICAgID0gMDsNCi0gIEZ1bmN0 aW9uICAgPSAwOw0KLSAgQ2xhc3MgICAgICA9IDA7DQotICBEZXZpY2VUeXBlID0gQkJTX1VOS05P V047DQotDQotICAvLw0KLSAgLy8gU2tpcCBmbG9wcHkgYW5kIDIqb25ib2FyZCBJREUgY29udHJv bGxlciBlbnRyaWVzKE1hc3Rlci9TbGF2ZSBwZXINCi0gIC8vIGNvbnRyb2xsZXIpLg0KLSAgLy8N Ci0gIEJic0luZGV4ID0gUHJpdmF0ZS0+SW50VGh1bmstPkVmaVRvTGVnYWN5MTZCb290VGFibGUu TnVtYmVyQmJzRW50cmllczsNCi0NCi0gIEJic1RhYmxlID0gKEJCU19UQUJMRSAqKShVSU5UTilQ cml2YXRlLT5JbnRUaHVuay0+RWZpVG9MZWdhY3kxNkJvb3RUYWJsZS5CYnNUYWJsZTsNCi0gIFBu cFB0ciAgID0gKExFR0FDWV9QTlBfRVhQQU5TSU9OX0hFQURFUiAqKVJvbVN0YXJ0Ow0KLSAgUGNp UHRyICAgPSAoRUZJX0xFR0FDWV9FWFBBTlNJT05fUk9NX0hFQURFUiAqKVJvbVN0YXJ0Ow0KLQ0K LSAgUm9tRW5kICAgPSAoVk9JRCAqKShQY2lQdHItPlNpemU1MTIgKiA1MTIgKyAoVUlOVE4pUGNp UHRyKTsNCi0gIEluc3RhbmNlID0gRklSU1RfSU5TVEFOQ0U7DQotICAvLw0KLSAgLy8gT1BST01z IGxpa2UgUFhFIG1heSBub3QgYmUgdGllZCB0byBhIHBpZWNlIG9mIGhhcmR3YXJlIGFuZCB0aHVz DQotICAvLyBkb24ndCBoYXZlIGEgUGNpSW8gYXNzb2NpYXRlZCB3aXRoIHRoZW0NCi0gIC8vDQot ICBpZiAoUGNpSW8gIT0gTlVMTCkgew0KLSAgICBQY2lJby0+R2V0TG9jYXRpb24gKA0KLSAgICAg ICAgICAgICBQY2lJbywNCi0gICAgICAgICAgICAgJlNlZ21lbnQsDQotICAgICAgICAgICAgICZC dXMsDQotICAgICAgICAgICAgICZEZXZpY2UsDQotICAgICAgICAgICAgICZGdW5jdGlvbg0KLSAg ICAgICAgICAgICApOw0KLSAgICBQY2lJby0+UGNpLlJlYWQgKA0KLSAgICAgICAgICAgICAgICAg UGNpSW8sDQotICAgICAgICAgICAgICAgICBFZmlQY2lJb1dpZHRoVWludDgsDQotICAgICAgICAg ICAgICAgICAweDBiLA0KLSAgICAgICAgICAgICAgICAgMSwNCi0gICAgICAgICAgICAgICAgICZD b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ICAgICAgICAg UGNpQ29uZmlnSGVhZGVyOw0KLSAgVUlOVDE2ICAgICAgICAgICAgICAgKkNvbW1hbmQ7DQotICBV SU5UNjQgICAgICAgICAgICAgICBTdXBwb3J0czsNCi0NCi0gIC8vDQotICAvLyBNYWtlIHRoZSBW R0EgZGV2aWNlIGZpcnN0DQotICAvLw0KLSAgU3RhdHVzID0gUHJpdmF0ZS0+TGVnYWN5Qmlvc1Bs YXRmb3JtLT5HZXRQbGF0Zm9ybUhhbmRsZSAoDQotICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgUHJpdmF0ZS0+TGVnYWN5Qmlvc1BsYXRmb3JtLA0KLSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVmaUdldFBsYXRmb3JtVmdhSGFuZGxlLA0K LSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsDQotICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJkhhbmRsZUJ1ZmZlciwNCi0gICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmSGFuZGxlQ291bnQsDQotICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTA0KLSAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7DQotICBpZiAoRUZJX0VSUk9SIChTdGF0dXMp KSB7DQotICAgIHJldHVybiBFRklfVU5TVVBQT1JURUQ7DQotICB9DQotDQotICBWZ2FIYW5kbGUg PSBIYW5kbGVCdWZmZXJbMF07DQotDQotICBTdGF0dXMgPSBnQlMtPkxvY2F0ZUhhbmRsZUJ1ZmZl ciAoDQotICAgICAgICAgICAgICAgICAgQnlQcm90b2NvbCwNCi0gICAgICAgICAgICAgICAgICAm Z0VmaVBjaUlvUHJvdG9jb2xHdWlkLA0KLSAgICAgICAgICAgICAgICAgIE5VTEwsDQotICAgICAg ICAgICAgICAgICAg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RUZJX09VVF9PRl9SRVNPVVJDRVM7DQot ICB9DQotDQotICAvLw0KLSAgLy8gRGlzY29ubmVjdCBhbGwgRUZJIGRldmljZXMgZmlyc3QuIFRo aXMgY292ZXJzIGNhc2VzIHdoZXJlIGFsZWdhY3kgQklPUw0KLSAgLy8gbWF5IGNvbnRyb2wgbXVs dGlwbGUgUENJIGRldmljZXMuDQotICAvLw0KLSAgZm9yIChJbmRleCA9IDA7IEluZGV4IDwgSGFu ZGxlQ291bnQ7IEluZGV4KyspIHsNCi0gICAgU3RhdHVzID0gZ0JTLT5IYW5kbGVQcm90b2NvbCAo DQotICAgICAgICAgICAgICAgICAgICBIYW5kbGVCdWZmZXJbSW5kZXhdLA0KLSAgICAgICAgICAg ICAgICAgICAgJmdFZmlQY2lJb1Byb3RvY29sR3VpZCwNCi0gICAgICAgICAgICAgICAgICAgIChW T0lEICoqKSZQY2lJbw0KLSAgICAgICAgICAgICAgICAgICAgKTsNCi0gICAgQVNTRVJUX0VGSV9F UlJPUiAoU3RhdHVzKTsNCi0NCi0gICAgLy8NCi0gICAgLy8gU2F2ZSBjb21tYW5kIHJlZ2lzdGVy IGZvciAiY29ubmVjdCIgbG9vcA0KLSAgICAvLw0KLSAgICBQY2lJby0+UGNpLlJlYWQgKA0KLSAg ICAgICAgICAgICAgICAgUGNpSW8sDQotICAgICAgICAgICAgICAgICBFZmlQY2lJb1dpZHRoVWlu dDMyLA0KLSAgICAgICAgICAgICAgICAgMCwNCi0gICAgICAgICAgICAgICAgIHNpemVvZiAoUGNp Q29uZmlnSGVhZGVyKSAvIHNpemVvZiAoVUlOVDMyKSwNCi0gICAgICAgICAgICAgICAgICZQY2lD b25maWdIZWFkZXINCi0gICAgICAgICAgICAgICAgICk7DQotICAgIENvbW1hbmRbSW5kZXhdID0g UGNpQ29uZmlnSGVhZGVyLkhkci5Db21tYW5kOw0KLSAgICAvLw0KLSAgICAvLyBTa2lwIGFueSBk ZXZpY2UgdGhhdCBhbHJlYWR5IGhhcy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GFsbCBsZWdhY3kgVkJJT1MgaGVyZS4NCi0g ICAgLy8NCi0gICAgaWYgKElTX1BDSV9ESVNQTEFZICgmUGNpKSAmJiAoSW5kZXggPT0gMCkpIHsN Ci0gICAgICBTdGF0dXMgPSBMZWdhY3lCaW9zSW5zdGFsbFZnYVJvbSAoUHJpdmF0ZSk7DQotICAg ICAgLy8NCi0gICAgICAvLyBBIHJldHVybiBzdGF0dXMgb2YgRUZJX05PVF9GT1VORCBpcyBjb25z aWRlcmVkIHZhbGlkIChObyBFRkkNCi0gICAgICAvLyBkcml2ZXIgaXMgY29udHJvbGxpbmcgdmlk ZW8pLg0KLSAgICAgIC8vDQotICAgICAgQVNTRVJUICgoU3RhdHVzID09IEVGSV9TVUNDRVNTKSB8 fCAoU3RhdHVzID09IEVGSV9OT1RfRk9VTkQpKTsNCi0gICAgICBjb250aW51ZTsNCi0gICAgfQ0K LQ0KLSAgICAvLw0KLSAgICAvLyBJbnN0YWxsIGxlZ2FjeSBST00NCi0gICAgLy8NCi0gICAgU3Rh dHVzID0gTGVnYWN5Qmlvc0luc3RhbGxQY2lSb20gKA0KLSAgICAgICAgICAgICAgICZQcml2YXRl LT5MZWdhY3lCaW9zLA0KLSAgICAgICAgICAgICAgIEhhbmRsZUJ1ZmZlcltJbmRleF0sDQotICAg ICAgICAgICAgICAgTlVMTCwNCi0gICAgICAgICAgICAgICAmRmxhZ3MsDQotICAgICAgICAgICAg ICAgTlVMTCwNCi0gICAgICAgICAgICAgICBOVUxMLA0KLSAgICAgICAgICAgICAgIChWT0lEICoq KSZSb21TdGFydCwNCi0gICAgICAgICAgICAgICBOVUxMDQotICAgICAgICAgICAgICAgKTsNCi0g ICAgaWYgKEVGSV9FUlJPUiAoU3RhdHVzKSkgew0KLSAgICAgIGlmICghKChTdGF0dXMgPT0gRUZJ X1VOU1VQUE9SVEVEKSAmJiAoRmxhZ3MgPT0gTk9fUk9NKSkpIHsNCi0gICAgICAgIGNvbnRpbnVl Ow0KLSAgICAgI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gIFBjaUlvLA0KLSAgICAg ICAgICAgICAgICAgICAgICAgICAgRWZpUGNpSW9BdHRyaWJ1dGVPcGVyYXRpb25TdXBwb3J0ZWQs DQotICAgICAgICAgICAgICAgICAgICAgICAgICAwLA0KLSAgICAgICAgICAgICAgICAgICAgICAg ICAgJlN1cHBvcnRzDQotICAgICAgICAgICAgICAgICAgICAgICAgICApOw0KLSAgICAgICAgaWYg KCFFRklfRVJST1IgKFN0YXR1cykpIHsNCi0gICAgICAgICAgU3VwcG9ydHMgJj0gKFVJTlQ2NClF RklfUENJX0RFVklDRV9FTkFCTEU7DQotICAgICAgICAgIFN0YXR1cyAgICA9IFBjaUlvLT5BdHRy aWJ1dGVzICgNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGNpSW8sDQotICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIEVmaVBjaUlvQXR0cmlidXRlT3BlcmF0aW9uRW5hYmxl LA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdXBwb3J0cywNCi0gICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgTlVMTA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICApOw0KLSAgICAgICAgfQ0KLQ0KLSAgICAgICAgaWYgKCFFRklfRVJST1IgKFN0YXR1cykpIHsN Ci0gICAgICAgICAgQ29tbWFuZFtJbmRleF0gPSAweDFmOw0KLSAgICAgICAgfQ0KLSAgICAgIH0N Ci0gICAgfQ0KLQ0KLSAgICBQY2lJby0+UGNpLldyaXRlICgNCi0gICAgICAgICAgICAgICAgIFBj aUlvLA0KLSAgICAgICAgICAgICAgICAgRWZpUGNpSW9XaWR0aFVpbnQxNiwNCi0gICAgICAgICAg ICAgICAgIDB4MDQsDQotICAgICAgICAgICAgICAgICAxLA0KLSAgICAgICAgICAgICAgICAgJkNv bW1hbmRbSW5kZXhdDQotICAgICAgICAgICAgICAgICApOw0KLSAgfQ0KLQ0KLSAgRnJlZVBvb2wg KENvbW1hbm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DWV9CSU9TX1BST1RPQ09MICAqVGhpcywNCi0gIElO ICBFRklfSEFORExFICAgICAgICAgICAgICAgUGNpSGFuZGxlLA0KLSAgT1VUIFZPSUQgICAgICAg ICAgICAgICAgICAgICAqKlJvbUltYWdlICBPUFRJT05BTCwNCi0gIE9VVCBVSU5UTiAgICAgICAg ICAgICAgICAgICAgKlJvbVNpemUgIE9QVElPTkFMLA0KLSAgT1VUIFVJTlROICAgICAgICAgICAg ICAgICAgICAqRmxhZ3MNCi0gICkNCi17DQotICByZXR1cm4gTGVnYWN5Qmlvc0NoZWNrUGNpUm9t RXggKA0KLSAgICAgICAgICAgVGhpcywNCi0gICAgICAgICAgIFBjaUhhbmRsZSwNCi0gICAgICAg ICAgIFJvbUltYWdlLA0KLSAgICAgICAgICAgUm9tU2l6ZSwNCi0gICAgICAgICAgIE5VTEwsDQot ICAgICAgICAgICBGbGFncywNCi0gICAgICAgICAgIE5VTEwsDQotICAgICAgICAgICBOVUxMDQot ICAgICAgICAgICApOw0KLX0NCi0NCi0vKioNCi0NCi0gIFJvdXRpbmUgRGVzY3JpcHRpb246DQot ICAgIFRlc3QgdG8gc2VlIGlmIGEgbGVnYWN5IFBDSSBST00gZXhpc3RzIGZvciB0aGlzIGRldmlj ZS4gT3B0aW9uYWxseSByZXR1cm4NCi0gICAgdGhlIExlZ2FjeSBST00gaW5zdGFuY2UgZm9yIHRo aXMgUENJIGRldmljZS4NCi0NCi0gICAgQHBhcmFtW2luXSBUaGlzICAgICAgICAgIFByb3RvY29s IGluc3RhbmNlIHBvaW50ZXIuDQotICAgIEBwYXJhbVtpbl0gUGNpSGFuZGxlICAgICAgICAgICAg ICAgVGhlIFBDSSBQQy1BVCBPUFJPTSBmcm9tIHRoaXMgZGV2aWNlcyBST00gQkFSIHdpbGwgYmUg bG9hZGVkDQotICAgIEBwYXJhbVtvdXRdIFJvbUltYWdlICAgICAgICAgICAgICAgUmV0dXJuIHRo ZSBsZWdhY3kgUENJIFJPTSBmb3IgdGh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ICAgICAqUm9tU2l6ZSAg T1BUSU9OQUwsDQotICBPVVQgVUlOVE4gICAgICAgICAgICAgICAgICAgICpSdW50aW1lSW1hZ2VM ZW5ndGggIE9QVElPTkFMLA0KLSAgT1VUIFVJTlROICAgICAgICAgICAgICAgICAgICAqRmxhZ3Mg IE9QVElPTkFMLA0KLSAgT1VUIFVJTlQ4ICAgICAgICAgICAgICAgICAgICAqT3Byb21SZXZpc2lv biAgT1BUSU9OQUwsDQotICBPVVQgVk9JRCAgICAgICAgICAgICAgICAgICAgICoqQ29uZmlnVXRp bGl0eUNvZGVIZWFkZXIgT1BUSU9OQUwNCi0gICkNCi17DQotICBFRklfU1RBVFVTICAgICAgICAg ICAgU3RhdHVzOw0KLSAgTEVHQUNZX0JJT1NfSU5TVEFOQ0UgICpQcml2YXRlOw0KLSAgRUZJX1BD SV9JT19QUk9UT0NPTCAgICpQY2lJbzsNCi0gIFVJTlROICAgICAgICAgICAgICAgICBMb2NhbFJv bVNpemU7DQotICBWT0lEICAgICAgICAgICAgICAgICAgKkxvY2FsUm9tSW1hZ2U7DQotICBQQ0lf VFlQRTAwICAgICAgICAgICAgUGNpQ29uZmlnSGVhZGVyOw0KLSAgVk9JRCAgICAgICAgICAgICAg ICAgICpMb2NhbENvbmZpZ1V0aWxpdHlDb2RlSGVhZGVyOw0KLQ0KLSAgTG9jYWxDb25maWdVdGls aXR5Q29kZUhlYWRlciA9IE5VTEw7DQotICAqRmxhZ3MgICAgICAgICAgICAgICAgICAgICAgID0g Tk9fUk9NOw0KLSAgU3RhdHVzICAgICAgICAgICAgICAgICAgICAgICA9IGdCUy0+SGFuZGxlUHJv dG9jb2wgKA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQY2lIYW5k bGUsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZnRWZpUGNpSW9Q cm90b2NvbEd1aWQsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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h0SW4gYW5k IGZpbmQgUFMyIGNvbnRyb2xsZXINCi0gIC8vDQotICBTdGF0dXMgPSBnQlMtPkxvY2F0ZUhhbmRs ZUJ1ZmZlciAoDQotICAgICAgICAgICAgICAgICAgQnlQcm90b2NvbCwNCi0gICAgICAgICAgICAg ICAgICAmZ0VmaVNpbXBsZVRleHRJblByb3RvY29sR3VpZCwNCi0gICAgICAgICAgICAgICAgICBO VUxMLA0KLSAgICAgICAgICAgICAgICAgICZIYW5kbGVDb3VudCwNCi0gICAgICAgICAgICAgICAg ICAmSGFuZGxlQnVmZmVyDQotICAgICAgICAgICAgICAgICAgKTsNCi0gIGlmIChFRklfRVJST1Ig KFN0YXR1cykpIHsNCi0gICAgcmV0dXJuIEVGSV9OT1RfRk9VTkQ7DQotICB9DQotDQotICBmb3Ig KEluZGV4ID0gMDsgSW5kZXggPCBIYW5kbGVDb3VudDsgSW5kZXgrKykgew0KLSAgICAvLw0KLSAg ICAvLyBPcGVuIHRoZSBJTyBBYnN0cmFjdGlvbihzKSBuZWVkZWQgdG8gcGVyZm9ybSB0aGUgc3Vw cG9ydGVkIHRlc3QNCi0gICAgLy8NCi0gICAgU3RhdHVzID0gZ0JTLT5PcGVuUHJvdG9jb2wgKA0K LSAgICAgICAgICAgICAgICAgICAgSGFuZGxlQnVmZmVyW0luZGV4XSwNCi0gICAgICAgICAgICAg ICAgICAgICZnRWZpSXNhSW9Qcm90b2NvbEd1aWQsDQotICAgICAgICAgICAgICAgICAgICAoVk9J RCAqKikmSXNhSW8sDQotICAgICAgICAgICAgICAgICAgICBOVUxMLA0KLSAgICAgICAgICAgICAg ICAgICAgSGFuZGxlQnVmZmVyW0luZGV4XSwNCi0gICAgICAgICAgICAgICAgICAgIEVGSV9PUEVO X1BST1RPQ09MX0JZX0hBTkRMRV9QUk9UT0NPTA0KLSAgICAgICAgICAgICAgICAgICAgKTsNCi0N Ci0gICAgaWYgKCFFRklfRVJST1IgKFN0YXR1cykpIHsNCi0gICAgICAvLw0K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mb3IgdGhpcyBkZXZpY2UuDQotICBAcmV0dmFsIEVGSV9ERVZJQ0Vf RVJST1IgICAgICAgTm8gVkdBIGRldmljZSBoYW5kbGUgZm91bmQsIG9yIG5hdGl2ZSBFRkkgdmlk ZW8NCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcml2ZXIgY2Fubm90IGJlIHN1 Y2Nlc3NmdWxseSBkaXNjb25uZWN0ZWQsIG9yIFZHQQ0KLSAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHRodW5rIGRyaXZlciBjYW5ub3QgYmUgc3VjY2Vzc2Z1bGx5IGNvbm5lY3RlZC4N Ci0NCi0qKi8NCi1FRklfU1RBVFVTDQotTGVnYWN5Qmlvc0luc3RhbGxWZ2FSb20gKA0KLSAgSU4g IExFR0FDWV9CSU9TX0lOU1RBTkNFICAqUHJpdmF0ZQ0KLSAgKQ0KLXsNCi0gIEVGSV9TVEFUVVMg ICAgICAgICAgICAgICAgICAgICAgICAgICBTdGF0dXM7DQotICBFRklfSEFORExFICAgICAgICAg ICAgICAgICAgICAgICAgICAgVmdhSGFuZGxlOw0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIEhhbmRsZUNvdW50Ow0KLSAgRUZJX0hBTkRMRSAgICAgICAgICAgICAgICAg ICAgICAgICAgICpIYW5kbGVCdWZmZXI7DQotICBFRklfSEFORExFICAgICAgICAgICAgICAgICAg ICAgICAgICAgKkNvbm5lY3RIYW5kbGVCdWZmZXI7DQotICBFRklfUENJX0lPX1BST1RPQ09MICAg ICAgICAgICAgICAgICAgKlBjaUlvOw0KLSAgUENJX1RZUEUwMCAgICAgICAgICAgICAgICAgICAg ICAgICAgIFBjaUNvbmZpZ0hlYWRlcjsNCi0gIFVJTlQ2NCAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBTdXBwb3J0czsNCi0gIEVGSV9PUEVOX1BST1RPQ09MX0lORk9STUFUSU9OX0VOVFJZ ICAqT3Bl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Bpcw0KLSAgLy8gICAgICAgICAgIG9uIHRoZSBpbWFnZSBo YW5kbGUuDQotICAvLyAgICAgQWN0aW9uOiBEbyBub3RoaW5nIGFuZCBzZXQgUHJpdmF0ZS0+Vmdh SW5zdGFsbGVkID0gVFJVRS4NCi0gIC8vICAgICAgICAgICAgIFRoZW4gdGhpcyByb3V0aW5lIGlz IG5vdCBjYWxsZWQgYW55IG1vcmUuDQotICAvLw0KLSAgLy8NCi0gIC8vIEdldCB0aGUgVkdBIGRl dmljZS4NCi0gIC8vDQotICBTdGF0dXMgPSBQcml2YXRlLT5MZWdhY3lCaW9zUGxhdGZvcm0tPkdl dFBsYXRmb3JtSGFuZGxlICgNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBQcml2YXRlLT5MZWdhY3lCaW9zUGxhdGZvcm0sDQotICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgRWZpR2V0UGxhdGZvcm1WZ2FIYW5kbGUsDQotICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwNCi0gICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmSGFuZGxlQnVmZmVyLA0KLSAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICZIYW5kbGVDb3VudCwNCi0gICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMDQotICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgKTsNCi0gIGlmIChFRklfRVJST1IgKFN0YXR1cykpIHsNCi0gICAg cmV0dXJuIEVGSV9ERVZJQ0VfRVJST1I7DQotICB9DQotDQotICBWZ2FIYW5kbGUgPSBIYW5kbGVC dWZmZXJbMF07DQotDQotICAvLw0KLSAgLy8gQ2hlY2sgd2hldGhlciB2aWRlbyB0aHVuayBkcml2 ZXIgYWxyZWFkeSBzdGFydHMuDQotICAvLw0KLSAgU3RhdHVzID0gZ0JTLT5PcGVuUHJvdG9jb2xJ bmZvcm1hdGlvbiAoDQotICAgICAgICAgICAgICAgICAgVmdhSGFuZGxlLA0KLSAgICAgICAgICAg ICAgICAgICZnRWZpUGNpSW9Qcm90b2NvbEd1aWQsDQotICAgICAgICAgICAgICAgICAgJk9wZW5J bmZvQnVmZmVyLA0KLSAgICAgICAgICAgICAgICAgICZFbnRyeUNvdW50DQotICAgICAgICAgICAg ICAgICAgKTsNCi0gIGlmIChFRklfRVJST1IgKFN0YXR1cykpIHsNCi0gICAgcmV0dXJuIFN0YXR1 czsNCi0gIH0NCi0NCi0gIGZvciAoSW5kZXggPSAwOyBJbmRleCA8IEVudHJ5Q291bnQ7IEluZGV4 KyspIHsNCi0gICAgaWYgKChPcGVuSW5mb0J1ZmZlcltJbmRleF0uQXR0cmlidXRlcyAmIEVGSV9P UEVOX1BST1RPQ09MX0JZX0RSSVZFUikgIT0gMCkgew0KLSAgICAgIFN0YXR1cyA9IGdCUy0+SGFu ZGxlUHJvdG9jb2wgKA0KLSAgICAgICAgICAgICAgICAgICAgICBPcGVuSW5mb0J1ZmZlcltJbmRl eF0uQWdlbnRIYW5kbGUsDQotICAgICAgICAgICAgICAgICAgICAgICZnRWZpTGVnYWN5Qmlvc0d1 aWQsDQotICAgICAgICAgICAgICAgICAgICAgIChWT0lEICoqKSZJbnRlcmZhY2UNCi0gICAgICAg ICAgICAgICAgICAgICAgKTsNCi0gICAgICBpZiAoIUVGSV9FUlJPUiAoU3RhdHVzKSkgew0KLSAg ICAgICAgLy8NCi0gICAgICAgIC8vIFRoaXMgc2hvdWxkIGJlIHZpZGVvIHRodW5rIGRyaXZlciB3 aGljaCBpcyBtYW5hZ2luZyB2aWRlbyBkZXZpY2UNCi0gICAgICAgIC8vIFNvIGl0IG5lZWQgbm90 IHN0YXJ0IGFnYWluDQotICAgICAgICAvLw0KLSAgICAgICAgREVCVUcgKChERUJVR19JTkZPLCAi VmlkZW8gdGh1bmsgZHJpdmVyIGFscmVhZHkgc3RhcnQhIFJldHVybiFcbiIpKTsNCi0gICAgICAg IFByaXZhdGUtPlZnYUluc3RhbGxlZCA9IFRSVUU7DQotICAgICAgICByZXR1cm4gRUZJX1NVQ0NF U1M7DQotICAgICAgfQ0KLSAgICB9DQotICB9DQotDQotICAvLw0KLSAgLy8gS2ljayBvZmYgdGhl IG5hdGl2ZSBFRkkgZHJpdmVyDQotICAvLw0KLSAgU3RhdHVzID0gZ0JTLT5EaXNjb25uZWN0Q29u dHJvbGxlciAoDQotICAgICAgICAgICAgICAgICAgVmdhSGFuZGxlLA0KLSAgICAgICAgICAgICAg ICAgIE5VTEwsDQotICAgICAgICAgICAgICAgICAgTlVMTA0KLSAgICAgICAgICAgICAgICAgICk7 DQotICBpZiAoRUZJX0VSUk9SIChTdGF0dXMpKSB7DQotICAgIGlmIChTdGF0dXMgIT0gRUZJX05P VF9GT1VORCkgew0KLSAgICAgIHJldHVybiBFRklfREVWSUNFX0VSUk9SOw0KLSAgICB9IGVsc2Ug ew0KLSAgICAgIHJldHVybiBTdGF0dXM7DQotICAgIH0NCi0gIH0NCi0NCi0gIC8vDQotICAvLyBG aW5kIGFsbCB0aGUgVGh1bmsgRHJpdmVyDQotICAvLw0KLSAgSGFuZGxlQnVmZmVyID0gTlVMTDsN Ci0gIFN0YXR1cyAgICAgICA9IGdCUy0+TG9jYXRlSGFuZGxlQnVmZmVyICgNCi0gICAgICAgICAg ICAgICAgICAgICAgICBCeVByb3RvY29sLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICZnRWZp TGVnYWN5Qmlvc0d1aWQsDQotICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwNCi0gICAgICAg ICAgICAgICAgICAgICAgICAmSGFuZGxlQ291bnQsDQotICAgICAgICAgICAgICAgICAgICAgICAg JkhhbmRsZUJ1ZmZlcg0KLSAgICAgICAgICAgICAgICAgICAgICAgICk7DQotICBBU1NFUlRfRUZJ X0VSUk9SIChTdGF0dXMpOw0KLSAgQ29ubmVjdEhhbmRsZUJ1ZmZlciA9IChFRklfSEFORExFICop QWxsb2NhdGVQb29sIChzaXplb2YgKEVGSV9IQU5ETEUpICogKEhhbmRsZUNvdW50ICsgMSkpOw0K LSAgQVNTRVJUIChDb25uZWN0SGFuZGxlQnVmZmVyICE9IE5VTEwpOw0KLQ0KLSAgQ29weU1lbSAo DQotICAgIENvbm5lY3RIYW5kbGVCdWZmZXIsDQotICAgIEhhbmRsZUJ1ZmZlciwNCi0gICAgc2l6 ZW9mIChFRklfSEFORExFKSAqIEhhbmRsZUNvdW50DQotICAgICk7DQotICBDb25uZWN0SGFuZGxl QnVmZmVyW0hhbmRsZUNvdW50XSA9IE5VTEw7DQotDQotICBGcmVlUG9vbCAoSGFuZGxlQnVmZmVy KTsNCi0NCi0gIC8vDQotICAvLyBFbmFibGUgdGhlIGRldmljZSBhbmQgbWFrZSBzdXJlIFZHQSBj eWNsZXMgYXJlIGJlaW5nIGZvcndhcmRlZCB0byB0aGlzIFZHQSBkZXZpY2UNCi0gIC8vDQotICBT dGF0dXMgPSBnQlMtPkhhbmRsZVByb3RvY29sICgNCi0gICAgICAgICAgICAgICAgICBWZ2FIYW5k bGUsDQotICAgICAgICAgICAgICAgICAgJmdFZmlQY2lJb1Byb3RvY29sR3VpZCwNCi0gICAgICAg ICAgICAgICAgICAoVk9JRCAqKikmUGNpSW8NCi0gICAgICAgICAgICAgICAgICApOw0KLSAgQVNT RVJUX0VGSV9FUlJPUiAoU3RhdHVzKTsNCi0gIFBjaUlvLT5QY2kuUmVhZCAoDQotICAgICAgICAg ICAgICAgUGNpSW8sDQotICAgICAgICAgICAgICAgRWZpUGNpSW9XaWR0aFVpbnQzMiwNCi0gICAg ICAgICAgICAgICAwLA0KLSAgICAgICAgICAgICAgIHNpemVvZiAoUGNpQ29uZmlnSGVhZGVyKSAv IHNpemVvZiAoVUlOVDMyKSwNCi0gICAgICAgICAgICAgICAmUGNpQ29uZmlnSGVhZGVyDQotICAg ICAgICAgICAgICAgKTsNCi0NCi0gIFN0YXR1cyA9IFBjaUlvLT5BdHRyaWJ1dGVzICgNCi0gICAg ICAgICAgICAgICAgICAgIFBjaUlvLA0KLSAgICAgICAgICAgICAgICAgICAgRWZpUGNpSW9BdHRy aWJ1dGVPcGVyYXRpb25TdXBwb3J0ZWQsDQotICAgICAgICAgICAgICAgICAgICAwLA0KLSAgICAg ICAgICAgICAgICAgICAgJlN1cHBvcnRzDQotICAgICAgICAgICAgICAgICAgICApOw0KLSAgaWYg KCFFRklfRVJST1IgKFN0YXR1cykpIHsNCi0gICAgU3VwcG9ydHMgJj0gKFVJTlQ2NCkoRUZJX1BD SV9ERVZJQ0VfRU5BQkxFIHwgRUZJX1BDSV9JT19BVFRSSUJVVEVfVkdBX01FTU9SWSB8IFwNCi0g ICAgICAgICAgICAgICAgICAgICAgICAgRUZJX1BDSV9JT19BVFRSSUJVVEVfVkdBX0lPIHwgRUZJ X1BDSV9JT19BVFRSSUJVVEVfVkdBX0lPXzE2KTsNCi0gICAgU3RhdHVzID0gUGNpSW8tPkF0dHJp YnV0ZXMgKA0KLSAgICAgICAgICAgICAgICAgICAgICBQY2lJbywNCi0gICAgICAgICAgICAgICAg ICAgICAgRWZpUGNpSW9BdHRyaWJ1dGVPcGVyYXRpb25FbmFibGUsDQotICAgICAgICAgICAgICAg ICAgICAgIFN1cHBvcnRzLA0KLSAgICAgICAgICAgICAgICAgICAgICBOVUxMDQotICAgICAgICAg ICAgICAgICAgICAgICk7DQotICB9DQotDQotICBpZiAoU3RhdHVzID09IEVGSV9TVUNDRVNTKSB7 DQotICAgIFByaXZhdGUtPlZnYUluc3RhbGxlZCA9IFRSVUU7DQotDQotICAgIC8vDQotICAgIC8v IEF0dGFjaCB0aGUgVkdBIHRodW5rIGRyaXZlci4NCi0gICAgLy8gQXNzdW1lIHRoZSB2aWRlbyBp cyBpbnN0YWxsZWQuIFRoaXMgcHJldmVudHMgcG90ZW50aWFsIG9mIGluZmluaXRlIHJlY3Vyc2lv bi4NCi0gICAgLy8NCi0gICAgU3RhdHVzID0gZ0JTLT5Db25uZWN0Q29udHJvbGxlciAoDQotICAg ICAgICAgICAgICAgICAgICBWZ2FIYW5kbGUsDQotICAgICAgICAgICAgICAgICAgICBDb25uZWN0 SGFuZGxlQnVmZmVyLA0KLSAgICAgICAgICAgICAgICAgICAgTlVMTCwNCi0gICAgICAgICAgICAg ICAgICAgIFRSVUUNCi0gICAgICAgICAgICAgICAgICAgICk7DQotICB9DQotDQotICBGcmVlUG9v bCAoQ29ubmVjdEhhbmRsZUJ1ZmZlcik7DQotDQotICBpZiAoRUZJX0VSUk9SIChTdGF0dXMpKSB7 DQotICAgIFByaXZhdGUtPlZnYUluc3RhbGxlZCA9IEZBTFNFOw0KLQ0KLSAgICAvLw0KLSAgICAv LyBSZWNvbm5lY3QgdGhlIEVGSSBWR0EgZHJpdmVyLg0KLSAgICAvLw0KLSAgICBnQlMtPkNvbm5l Y3RDb250cm9sbGVyIChWZ2FIYW5kbGUsIE5VTEwsIE5VTEwsIFRSVUUpOw0KLSAgICByZXR1cm4g RUZJX0RFVklDRV9FUlJPUjsNCi0gIH0NCi0NCi0gIHJldHVybiBFRklfU1VDQ0VTUzsNCi19DQot DQotLyoqDQotICBMb2FkIGEgbGVnYWN5IFBDLUFUIE9wUk9NLg0KLQ0KLSAgQHBhcmFtICBUaGlz ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUHJvdG9jb2wgaW5zdGFuY2UgcG9pbnRlci4N Ci0gIEBwYXJhbSAgUHJpdmF0ZSAgICAgICAgICAgICAgICAgICAgICAgICAgRHJpdmVyJ3MgcHJp dmF0ZSBkYXRhLg0KLSAgQHBhcmFtICBQY2lIYW5kbGUgICAgICAgICAgICAgICAgICAgICAgVGhl IEVGSSBoYW5kbGUgZm9yIHRoZSBQQ0kgZGV2aWNlLiBJdCBjb3VsZCBiZQ0KLSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMIGlmIHRoZSAgT3BS T00gaW1hZ2UgaXMgbm90IGFzc29jaWF0ZWQgd2l0aA0KLSAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbnkgZGV2aWNlLg0KLSAgQHBhcmFtICBPcHJv bVJldmlzaW9uICAgICAgICAgICAgICBUaGUgcmV2aXNpb24gb2YgUENJIFBDLUFUIFJPTSBpbWFn ZS4NCi0gIEBwYXJhbSAgUm9tSW1hZ2UgICAgICAgICAgICAgICAgICAgIFBvaW50ZXIgdG8gUENJ IFBDLUFUIFJPTSBpbWFnZSBoZWFkZXIuIEl0IG11c3Qgbm90DQotICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJlIE5VTEwuDQotICBAcGFyYW0gIElt YWdlU2l6ZSAgICAgICAgICAgICAgICAgICAgIFNpemUgb2YgdGhlIFBDSSBQQy1BVCBST00gaW1h Z2UuDQotICBAcGFyYW0gIFJ1bnRpbWVJbWFnZUxlbmd0aCAgICAgIE9uIGlucHV0IGlzIHRoZSBt YXggcnVudGltZSBpbWFnZSBsZW5ndGggaW5kaWNhdGVkIGJ5IHRoZSBQQ0lSIHN0cnVjdHVyZQ0K LSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPbiBv dXRwdXQgaXMgdGhlIGFjdHVhbCBydW50aW1lIGltYWdlIGxlbmd0aA0KLSAgQHBhcmFtICBEaXNr U3RhcnQgICAgICAgICAgICAgICAgICAgICAgIERpc2sgbnVtYmVyIG9mIGZpcnN0IGRldmljZSBo b29rZWQgYnkgdGhlIFJPTS4gSWYNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgRGlza1N0YXJ0IGlzIHRoZSBzYW1lIGFzIERpc2tFbmQgbm8gZGlz a2VkIHdlcmUNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgaG9va2VkLg0KLSAgQHBhcmFtICBEaXNrRW5kICAgICAgICAgICAgICAgICAgICAgICAg IERpc2sgbnVtYmVyIG9mIHRoZSBsYXN0IGRldmljZSBob29rZWQgYnkgdGhlIFJPTS4NCi0gIEBw YXJhbSAgUm9tU2hhZG93QWRkcmVzcyAgICAgICBTaGFkb3cgYWRkcmVzcyBvZiBQQy1BVCBST00N Ci0NCi0gIEByZXR2YWwgRUZJX1NVQ0NFU1MgICAgICAgICAgICBMZWdhY3kgUk9NIGxvYWRlZCBm b3IgdGhpcyBkZXZpY2UNCi0gIEByZXR2YWwgRUZJX09VVF9PRl9SRVNPVVJDRVMgICBObyBtb3Jl IHNwYWNlIGZvciB0aGlzIFJPTQ0KLQ0KLSoqLw0KLUVGSV9TVEFUVVMNCi1FRklBUEkNCi1MZWdh Y3lCaW9zSW5zdGFsbFJvbSAoDQotICBJTiBFRklfTEVHQUNZX0JJT1NfUFJPVE9DT0wgICpUaGlz LA0KLSAgSU4gTEVHQUNZX0JJT1NfSU5TVEFOQ0UgICAgICAqUHJpdmF0ZSwNCi0gIElOIEVGSV9I QU5ETEUgICAgICAgICAgICAgICAgUGNpSGFuZGxlLA0KLSAgSU4gVUlOVDggICAgICAgICAgICAg ICAgICAgICBPcHJvbVJldmlzaW9uLA0KLSAgSU4gVk9JRCAgICAgICAgICAgICAgICAgICAgICAq Um9tSW1hZ2UsDQotICBJTiBVSU5UTiAgICAgICAgICAgICAgICAgICAgIEltYWdlU2l6ZSwNCi0g IElOIE9VVCBVSU5UTiAgICAgICAgICAgICAgICAgKlJ1bnRpbWVJbWFnZUxlbmd0aCwNCi0gIE9V VCBVSU5UOCAgICAgICAgICAgICAgICAgICAgKkRpc2tTdGFydCAgT1BUSU9OQUwsDQotICBPVVQg VUlOVDggICAgICAgICAgICAgICAgICAgICpEaXNrRW5kICBPUFRJT05BTCwNCi0gIE9VVCBWT0lE ICAgICAgICAgICAgICAgICAgICAgKipSb21TaGFkb3dBZGRyZXNzIE9QVElPTkFMDQotICApDQot ew0KLSAgRUZJX1NUQVRVUyAgICAgICAgICAgICBTdGF0dXM7DQotICBFRklfU1RBVFVTICAgICAg ICAgICAgIFBjaUVuYWJsZVN0YXR1czsNCi0gIEVGSV9QQ0lfSU9fUFJPVE9DT0wgICAgKlBjaUlv Ow0KLSAgVUlOVDggICAgICAgICAgICAgICAgICBMb2NhbERpc2tTdGFydDsNCi0gIFVJTlQ4ICAg ICAgICAgICAgICAgICAgTG9jYWxEaXNrRW5kOw0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICBT ZWdtZW50Ow0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICBCdXM7DQotICBVSU5UTiAgICAgICAg ICAgICAgICAgIERldmljZTsNCi0gIFVJTlROICAgICAgICAgICAgICAgICAgRnVuY3Rpb247DQot ICBFRklfSUEzMl9SRUdJU1RFUl9TRVQgIFJlZ3M7DQotICBVSU5UOCAgICAgICAgICAgICAgICAg IFZpZGVvTW9kZTsNCi0gIFVJTlQ4ICAgICAgICAgICAgICAgICAgT2xkVmlkZW9Nb2RlOw0KLSAg RUZJX1RJTUUgICAgICAgICAgICAgICBCb290VGltZTsNCi0gIFVJTlQzMiAgICAgICAgICAgICAg ICAgKkJkYVB0cjsNCi0gIFVJTlQzMiAgICAgICAgICAgICAgICAgTG9jYWxUaW1lOw0KLSAgVUlO VDMyICAgICAgICAgICAgICAgICBTdGFydEJic0luZGV4Ow0KLSAgVUlOVDMyICAgICAgICAgICAg ICAgICBFbmRCYnNJbmRleDsNCi0gIFVJTlQzMiAgICAgICAgICAgICAgICAgTWF4Um9tQWRkcjsN Ci0gIFVJTlROICAgICAgICAgICAgICAgICAgVGVtcERhdGE7DQotICBVSU5UTiAgICAgICAgICAg ICAgICAgIEluaXRBZGRyZXNzOw0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICBSdW50aW1lQWRk cmVzczsNCi0gIEVGSV9QSFlTSUNBTF9BRERSRVNTICAgUGh5c2ljYWxBZG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ZmFjZVZlcnNpb24gPj0gMHgwMzAwKSkgew0KLSAgICAvLw0KLSAgICAvLyBD U00xNiAzLjAgbWVldHMgUENJIDMuMCBPcFJPTQ0KLSAgICAvLyAgIGZpcnN0IHRlc3QgaWYgdGhl cmUgaXMgZW5vdWdoIHNwYWNlIGZvciBpdHMgSU5JVCBjb2RlDQotICAgIC8vDQotICAgIFBoeXNp Y2FsQWRkcmVzcyA9IENPTlZFTlRJT05BTF9NRU1PUllfVE9QOw0KLSAgICBTdGF0dXMgICAgICAg ICAgPSBnQlMtPkFsbG9jYXRlUGFnZXMgKA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAg QWxsb2NhdGVNYXhBZGRyZXNzLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRWZpQm9v dFNlcnZpY2VzQ29kZSwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVGSV9TSVpFX1RP X1BBR0VTIChJbWFnZVNpemUpLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJlBoeXNp Y2FsQWRkcmVzcw0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsNCi0NCi0gICAgaWYg KEVGSV9FUlJPUiAoU3RhdHVzKSkgew0KLSAgICAgIERFQlVHICgoREVCVUdfRVJST1IsICJyZXR1 cm4gTGVnYWN5Qmlvc0luc3RhbGxSb20oJWQpOiBFRklfT1VUX09GX1JFU09VUkNFUyAobm8gbW9y ZSBzcGFjZSBmb3IgT3BST00pXG4iLCBERUJVR19MSU5FX05VTUJFUikpOw0KLSAgICAgIC8vDQot ICAgICAgLy8gUmVwb3J0IFN0YXR1cyBDb2RlIHRvIGluZGljYXRlIHRoYXQgdGhlcmUgaXMgbm8g ZW5vdWdoIHNwYWNlIGZvciBPcFJPTQ0KLSAgICAgIC8vDQotICAgICAgUkVQT1JUX1NUQVRVU19D T0RFICgNCi0gICAgICAgIEVGSV9FUlJPUl9DT0RFIHwgRUZJX0VSUk9SX01JTk9SLA0KL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VzcyA9IEluaXRBZGRyZXNzOw0KLSAg fQ0KLQ0KLSAgUHJpdmF0ZS0+TGVnYWN5UmVnaW9uLT5VbkxvY2sgKA0KLSAgICAgICAgICAgICAg ICAgICAgICAgICAgIFByaXZhdGUtPkxlZ2FjeVJlZ2lvbiwNCi0gICAgICAgICAgICAgICAgICAg ICAgICAgICAweEUwMDAwLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAwMDAsDQot ICAgICAgICAgICAgICAgICAgICAgICAgICAgJkdyYW51bGFyaXR5DQotICAgICAgICAgICAgICAg ICAgICAgICAgICAgKTsNCi0NCi0gIFByaXZhdGUtPkxlZ2FjeVJlZ2lvbi0+VW5Mb2NrICgNCi0g ICAgICAgICAgICAgICAgICAgICAgICAgICBQcml2YXRlLT5MZWdhY3lSZWdpb24sDQotICAgICAg ICAgICAgICAgICAgICAgICAgICAgKFVJTlQzMilSdW50aW1lQWRkcmVzcywNCi0gICAgICAgICAg ICAgICAgICAgICAgICAgICAoVUlOVDMyKUltYWdlU2l6ZSwNCi0gICAgICAgICAgICAgICAgICAg ICAgICAgICAmR3JhbnVsYXJpdHkNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICApOw0KLQ0K LSAgREVCVUcgKChERUJVR19JTkZPLCAiIFNoYWRvd2luZyBPcFJPTSBpbml0L3J1bnRpbWUvaXNp emUgPSAleC8leC8leFxuIiwgSW5pdEFkZHJlc3MsIFJ1bnRpbWVBZGRyZXNzLCBJbWFnZVNpemUp KTsNCi0NCi0gIENvcHlNZW0gKChWT0lEICopSW5pdEFkZHJlc3MsIFJvbUltYWdlLCBJbWFnZVNp emUpOw0KLQ0KLSAgLy8NCi0gIC8vIFJlYWQgdGhlIGhpZ2hlc3QgZGlzayBudW1iZXIgImluc3Rh bGxlZDogYW5kIGFzc3VtZSBhIG5ldyBkaXNrIHdpbGwNCi0gIC8vIHNob3cgdXAgb24gdGhlIGZp cnN0IGRyaXZlIHBhc3QgdGhlIGN1cnJlbnQg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Qcml2YXRlLT5MZWdhY3lCaW9zUGxh dGZvcm0tPlBsYXRmb3JtSG9va3MgKA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIFByaXZhdGUtPkxlZ2FjeUJpb3NQbGF0Zm9ybSwNCi0gICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBFZmlQbGF0Zm9ybUhvb2tQcmVwYXJlVG9TY2FuUm9t LA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsDQotICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGNpSGFuZGxlLA0KLSAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZJbml0QWRkcmVzcywNCi0gICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLA0KLSAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwNCi0gICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICApOw0KLQ0KLSAgLy8NCi0gIC8vIElmIFN0YXR1cyByZXR1cm5l ZCBpcyBFRklfVU5TVVBQT1JURUQgdGhlbiBhYm9ydCBkdWUgdG8gcGxhdGZvcm0NCi0gIC8vIHBv bGljeS4NCi0gIC8vDQotICBpZiAoU3RhdHVzID09IEVGSV9VTlNVUFBPUlRFRCkgew0KLSAgICBn b3RvIERvbmU7DQotICB9DQotDQotICAvLw0KLSAgLy8gUmVwb3J0IGNvcnJlc3BvbmRpbmcgc3Rh dHVzIGNvZGUNCi0gIC8vDQotICBSRVBPUlRfU1RBVFVTX0NPREUgKA0KLSAgICBFRklfUFJPR1JF U1NfQ09ERSwNCi0gICAgKEVGSV9TT0ZUV0FSRV9EWEVfQlNfRFJJVkVSIHwgRUZJX1NXX0NTTV9M RUdBQ1lfUk9NX0lOSVQpDQotICAgICk7DQotDQotICAvLw0KLSAgLy8gR2VuZ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K LSAgICAgICAgICAgICAgICAgICAgKTsNCi0gICAgQVNTRVJUX0VGSV9FUlJPUiAoU3RhdHVzKTsN Ci0NCi0gICAgLy8NCi0gICAgLy8gRW5hYmxlIGNvbW1hbmQgcmVnaXN0ZXIuDQotICAgIC8vDQot ICAgIFBjaUVuYWJsZVN0YXR1cyA9IFBjaUlvLT5BdHRyaWJ1dGVzICgNCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgUGNpSW8sDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IEVmaVBjaUlvQXR0cmlidXRlT3BlcmF0aW9uRW5hYmxlLA0KLSAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBFRklfUENJX0RFVklDRV9FTkFCTEUsDQotICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIE5VTEwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsNCi0NCi0g ICAgUGNpSW8tPkdldExvY2F0aW9uICgNCi0gICAgICAgICAgICAgUGNpSW8sDQotICAgICAgICAg ICAgICZTZWdtZW50LA0KLSAgICAgICAgICAgICAmQnVzLA0KLSAgICAgICAgICAgICAmRGV2aWNl LA0KLSAgICAgICAgICAgICAmRnVuY3Rpb24NCi0gICAgICAgICAgICAgKTsNCi0gICAgREVCVUcg KChERUJVR19JTkZPLCAiU2hhZG93aW5nIE9wUk9NIG9uIHRoZSBQQ0kgZGV2aWNlICV4LyV4LyV4 XG4iLCBCdXMsIERldmljZSwgRnVuY3Rpb24pKTsNCi0gIH0NCi0NCi0gIG1JZ25vcmVCYnNVcGRh dGVGbGFnID0gRkFMU0U7DQotICBSZWdzLlguQVggICAgICAgICAgICA9IExlZ2FjeTE2RGlzcGF0 Y2hPcHJvbTsNCi0NCi0gIC8vDQotICAvLyBHZW5lcmF0ZSBEaXNwYXRjaE9wUm9tVGFibGUgZGF0 YQ0KLSAgLy8NCi0gIFByaXZhdGUtPkludFRodW5rLT5EaXNwYXRjaE9wcm9tVGFibGUuUG5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byb21SZXZpc2lvbiA8IDMpID8gMHhmZmZmIDogKFJ1 bnRpbWVBZGRyZXNzID4+IDQpKTsNCi0gIFRlbXBEYXRhICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gKFVJTlROKSZQcml2YXRlLT5JbnRU aHVuay0+RGlzcGF0Y2hPcHJvbVRhYmxlOw0KLSAgUmVncy5YLkVTICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSBFRklfU0VHTUVOVCAoKFVJ TlQzMilUZW1wRGF0YSk7DQotICBSZWdzLlguQlggICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IEVGSV9PRkZTRVQgKChVSU5UMzIpVGVtcERh dGEpOw0KLSAgLy8NCi0gIC8vIFNraXAgZGlzcGF0Y2hpbmcgUk9NIGZvciB0aG9zZSBQQ0kgZGV2 aWNlcyB0aGF0IGNhbiBub3QgYmUgZW5hYmxlZCBieSBQY2lJby0+QXR0cmlidXRlcw0KLSAgLy8g T3RoZXJ3aXNlLCBpdCBtYXkgY2F1c2UgdGhlIHN5c3RlbSB0byBoYW5nIGluIHNvbWUgY2FzZXMN Ci0gIC8vDQotICBpZiAoIUVGSV9FUlJPUiAoUGNpRW5hYmxlU3RhdHVzKSkgew0KLSAgICBERUJV RyAoKERFQlVHX0lORk8sICIgTGVnYWN5MTZEaXNwYXRjaE9wcm9tIC0gJTAyeC8lMDJ4LyUwMnhc biIsIEJ1cywgRGV2aWNlLCBGdW5jdGlvbikpOw0KLSAgICBQcml2YXRlLT5MZWdhY3lCaW9zLkZh ckNhbGw4NiAoDQotICAgICAgICAgICAgICAgICAgICAgICAgICAmUHJpdmF0ZS0+TGVnYWN5Qmlv cywNCi0gICAgICAgICAgICAgICAgICAgICAgICAgIFByaXZhdGUtPkxlZ2FjeTE2Q2FsbFNlZ21l bnQsDQotICAgICAgICAgICAgICAgICAgICAgICAgICBQcml2YXRlLT5MZWdhY3kxNkNhbGxPZmZz ZXQsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAmUmVncywNCi0gICAgICAgICAgICAgICAg ICAgICAgICAgIE5VTEwsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAwDQotICAgICAgICAg ICAgICAgICAgICAgICAgICApOw0KLSAgfSBlbHNlIHsNCi0gICAgUmVncy5YLkJYID0gMDsNCi0g IH0NCi0NCi0gIGlmIChQcml2YXRlLT5JbnRUaHVuay0+RGlzcGF0Y2hPcHJvbVRhYmxlLk51bWJl ckJic0VudHJpZXMgIT0gKFVJTlQ4KVByaXZhdGUtPkludFRodW5rLT5FZmlUb0xlZ2FjeTE2Qm9v dFRhYmxlLk51bWJlckJic0VudHJpZXMpIHsNCi0gICAgUHJpdmF0ZS0+SW50VGh1bmstPkVmaVRv TGVnYWN5MTZCb290VGFibGUuTnVtYmVyQmJzRW50cmllcyA9IChVSU5UOClQcml2YXRlLT5JbnRU aHVuay0+RGlzcGF0Y2hPcHJvbVRhYmxlLk51bWJlckJic0VudHJpZXM7DQotICAgIG1JZ25vcmVC YnNVcGRhdGVGbGFnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSBUUlVF Ow0KLSAgfQ0KLQ0KLSAgLy8NCi0gIC8vIENoZWNrIGlmIG5vbi1CQlMgY29tcGxpYW50IGRyaXZl cyBmb3VuZA0KLSAgLy8NCi0gIGlmIChSZWdzLlguQlggIT0gMCkgew0KLSAgICBMb2NhbERpc2tF bmQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID0gKFVJTlQ4KShMb2NhbERpc2tTdGFydCArIFJlZ3MuSC5CTCk7DQotICAgIFBy aXZhdGUtPkxlZ2FjeUVmaUhkZFRhYmxlW1ByaXZhdGUtPkxlZ2FjeUVmaUhkZFRhYmxlSW5kZXhd LlBjaVNlZ21lbnQgICAgIC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VM ZW5ndGgsIDB4ZmYpOw0KLSAgICB9DQotICB9DQotDQotICBBQ0NFU1NfUEFHRTBfQ09ERSAoDQot ICAgIExvY2FsRGlza0VuZCA9IChVSU5UOCkoKCooVUlOVDggKikoKFVJTlROKTB4NDc1KSkgKyAw eDgwKTsNCi0gICAgKTsNCi0NCi0gIC8vDQotICAvLyBBbGxvdyBwbGF0Zm9ybSB0byBwZXJmb3Jt IGFueSByZXF1aXJlZCBhY3Rpb25zIGFmdGVyIHRoZQ0KLSAgLy8gT1BST00gaGFzIGJlZW4gaW5p dGlhbGl6ZWQuDQotICAvLw0KLSAgU3RhdHVzID0gUHJpdmF0ZS0+TGVnYWN5Qmlvc1BsYXRmb3Jt LT5QbGF0Zm9ybUhvb2tzICgNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBQcml2YXRlLT5MZWdhY3lCaW9zUGxhdGZvcm0sDQotICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgRWZpUGxhdGZvcm1Ib29rQWZ0ZXJSb21Jbml0LA0KLSAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsDQotICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgUGNpSGFuZGxlLA0KLSAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICZSdW50aW1lQWRkcmVzcywNCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLA0KLSAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIE5VTEwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICApOw0KLSAgaWYgKFBjaUhhbmRsZSAhPSBOVUxMKSB7DQotICAgIC8vDQot ICAgIC8vIElmIG5vIFBDSSBIYW5kbGUgdGhlbiBubyBoZWFkZXIgb3IgQmV2cy4NCi0gICAgLy8N Ci0gICAgaW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UHJv dG9jb2wgKCZnRWRraWlJb01tdVByb3RvY29sR3VpZCwgTlVMTCwgKFZPSUQgKiopJm1Jb01tdSk7 DQotICB9DQotDQotICBpZiAobUlvTW11ICE9IE5VTEwpIHsNCi0gICAgU3RhdHVzID0gbUlvTW11 LT5NYXAgKA0KLSAgICAgICAgICAgICAgICAgICAgICAgbUlvTW11LA0KLSAgICAgICAgICAgICAg ICAgICAgICAgRWRraWlJb01tdU9wZXJhdGlvbkJ1c01hc3RlckNvbW1vbkJ1ZmZlciwNCi0gICAg ICAgICAgICAgICAgICAgICAgIChWT0lEICopKFVJTlROKUhvc3RBZGRyZXNzLA0KLSAgICAgICAg ICAgICAgICAgICAgICAgJk51bWJlck9mQnl0ZXMsDQotICAgICAgICAgICAgICAgICAgICAgICAm RGV2aWNlQWRkcmVzcywNCi0gICAgICAgICAgICAgICAgICAgICAgICZNYXBwaW5nDQotICAgICAg ICAgICAgICAgICAgICAgICApOw0KLSAgICBpZiAoRUZJX0VSUk9SIChTdGF0dXMpKSB7DQotICAg ICAgREVCVUcgKChERUJVR19FUlJPUiwgIkxlZ2FjeVBjaSAtIElvTW11TWFwIC0gJXJcbiIsIFN0 YXR1cykpOw0KLSAgICB9IGVsc2Ugew0KLSAgICAgIEFTU0VSVCAoRGV2aWNlQWRkcmVzcyA9PSBI b3N0QWRkcmVzcyk7DQotICAgICAgU3RhdHVzID0gbUlvTW11LT5TZXRBdHRyaWJ1dGUgKA0KLSAg ICAgICAgICAgICAgICAgICAgICAgICBtSW9NbXUsDQotICAgICAgICAgICAgICAgICAgICAgICAg IFBjaUhhbmRsZSwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgTWFwcGluZywNCi0gICAgICAg ICAgICAgICAgICAgICAgICAgRURLSUlfSU9NTVVfQUNDRVNTX1JFQUQgfCBFREtJSV9JT01NVV9B Q0NFU1NfV1JJVEUNCi0gICAgICAgICAgICAgICAgICAgICAgICAgKTsNCi0gICAgICBpZiAoRUZJ X0VSUk9SIChTd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0aGUgUk9NDQotICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5kIHRodXMgbm8gUGNpSGFuZGxlLCBvdGhl cndpc2UgaXMgbXVzdCBiZSBOVUxMLg0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IEV4YW1wbGUgaXMgUFhFIGJhc2UgY29kZS4NCi0gIEBwYXJhbSAgRmxhZ3MgICAgICAgICAgICAg ICAgICBJbmRpY2F0ZXMgaWYgUk9NIGZvdW5kIGFuZCBpZiBQQy1BVC4NCi0gIEBwYXJhbSAgRGlz a1N0YXJ0ICAgICAgICAgICAgICBEaXNrIG51bWJlciBvZiBmaXJzdCBkZXZpY2UgaG9va2VkIGJ5 IHRoZSBST00uIElmDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRGlza1N0YXJ0 IGlzIHRoZSBzYW1lIGFzIERpc2tFbmQgbm8gZGlza2VkIHdlcmUNCi0gICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBob29rZWQuDQotICBAcGFyYW0gIERpc2tFbmQgICAgICAgICAgICAg ICAgRGlzayBudW1iZXIgb2YgdGhlIGxhc3QgZGV2aWNlIGhvb2tlZCBieSB0aGUgUk9NLg0KLSAg QHBhcmFtICBSb21TaGFkb3dBZGRyZXNzICAgICAgIFNoYWRvdyBhZGRyZXNzIG9mIFBDLUFUIFJP TQ0KLSAgQHBhcmFtICBSb21TaGFkb3dlZFNpemUgICAgICAgIFNpemUgb2YgUm9tU2hhZG93QWRk cmVzcyBpbiBieXRlcw0KLQ0KLSAgQHJldHZhbCBFRklfU1VDQ0VTUyAgICAgICAgICAgIExlZ2Fj eSBST00gbG9hZGVkIGZvciB0aGlzIGRldmljZQ0KLSAgQHJldHZhbCBFRklfSU5WQUxJRF9QQVJB TUVURVIgIFBjaUhhbmRsZSBub3QgZm91bmQNCi0gIEByZXR2YWwgRUZJX1VOU1VQUE9SVEVEICAg ICAgICBUaGVyZSBpcyBubyBQQ0kgUk9NIGluIHRoZSBST00gQkFSIG9yIG5vIG9uYm9hcmQNCi0g ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBST00NCi0NCi0qKi8NCi1FRklfU1RBVFVT DQotRUZJQVBJDQotTGVnYWN5Qmlvc0luc3RhbGxQY2lSb20gKA0KLSAgSU4gRUZJX0xFR0FDWV9C SU9TX1BST1RPQ09MICAqVGhpcywNCi0gIElOICBFRklfSEFORExFICAgICAgICAgICAgICAgUGNp SGFuZGxlLA0KLSAgSU4gIFZPSUQgICAgICAgICAgICAgICAgICAgICAqKlJvbUltYWdlLA0KLSAg T1VUIFVJTlROICAgICAgICAgICAgICAgICAgICAqRmxhZ3MsDQotICBPVVQgVUlOVDggICAgICAg ICAgICAgICAgICAgICpEaXNrU3RhcnQgIE9QVElPTkFMLA0KLSAgT1VUIFVJTlQ4ICAgICAgICAg ICAgICAgICAgICAqRGlza0VuZCAgT1BUSU9OQUwsDQotICBPVVQgVk9JRCAgICAgICAgICAgICAg ICAgICAgICoqUm9tU2hhZG93QWRkcmVzcyAgT1BUSU9OQUwsDQotICBPVVQgVUlOVDMyICAgICAg ICAgICAgICAgICAgICpSb21TaGFkb3dlZFNpemUgT1BUSU9OQUwNCi0gICkNCi17DQotICBFRklf U1RBVFVTICAgICAgICAgICAgICBTdGF0dXM7DQotICBMRUdBQ1lfQklPU19JTlNUQU5DRSAgICAq UHJpdmF0ZTsNCi0gIFZPSUQgICAgICAgICAgICAgICAgICAgICpMb2NhbFJvbUltYWdlOw0KLSAg VUlOVE4gICAgICAgICAgICAgICAgICAgSW1hZ2VTaXplOw0KLSAgVUlOVE4gICAgICAgICAgICAg ICAgICAgUnVudGltZUltYWdlTGVuZ3RoOw0KLSAgRUZJX1BDSV9JT19QUk9UT0NPTCAgICAgKlBj aUlvOw0KLSAgUENJX1RZUEUwMSAgICAgICAgICAgICAgUGNpQ29uZmlnSGVhZGVyOw0KLSAgVUlO VE4gICAgICAgICAgICAgICAgICAgSGFuZGxlQ291bnQ7DQotICBFRklfSEFORExFICAgICAgICAg ICAgICAqSGFuZGxlQnVmZmVyOw0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAgUGNpU2VnbWVu dDsNCi0gIFVJTlROICAgICAgICAgICAgICAgICAgIFBjaUJ1czsNCi0gIFVJTlROICAgICAgICAg ICAgICAgICAgIFBjaURldmljZTsNCi0gIFVJTlROICAgICAgICAgICAgICAgICAgIFBjaUZ1bmN0 aW9uOw0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAgTGFzdEJ1czsNCi0gIFVJTlROICAgICAg ICAgICAgICAgICAgIEluZGV4Ow0KLSAgVUlOVDggICAgICAgICAgICAgICAgICAgT3Byb21SZXZp c2lvbjsNCi0gIFVJTlQzMiAgICAgICAgICAgICAgICAgIEdyYW51bGFyaXR5Ow0KLSAgUENJXzNf MF9EQVRBX1NUUlVDVFVSRSAgKlBjaXI7DQotDQotICBPcHJvbVJldmlzaW9uID0gMDsNCi0NCi0g IFByaXZhdGUgPSBMRUdBQ1lfQklPU19JTlNUQU5DRV9GUk9NX1RISVMgKFRoaXMpOw0KLSAgaWYg KFByaXZhdGUtPkxlZ2FjeTE2VGFibGUtPkxhc3RQY2lCdXMgPT0gMCkgew0KLSAgICAvLw0KLSAg ICAvLyBHZXQgbGFzdCBidXMgbnVtYmVyIGlmIG5vdCBhbHJlYWR5IGZvdW5kDQotICAgIC8vDQot ICAgIFN0YXR1cyA9IGdCUy0+TG9jYXRlSGFuZGxlQnVmZmVyICgNCi0gICAgICAgICAgICAgICAg ICAgIEJ5UHJvdG9jb2wsDQotICAgICAgICAgICAgICAgICAgICAmZ0VmaVBjaUlvUHJvdG9jb2xH dWlkLA0KLSAgICAgICAgICAgICAgICAgICAgTlVMTCwNCi0gICAgICAgICAgICAgICAgICAgICZI YW5kbGVDb3VudCwNCi0gICAgICAgICAgICAgICAgICAgICZIYW5kbGVCdWZmZXINCi0gICAgICAg ICAgICAgICAgICAgICk7DQotDQotICAgIExhc3RCdXMgPSAwOw0KLSAgICBmb3IgKEluZGV4ID0g MDsgSW5kZXggPCBIYW5kbGVDb3VudDsgSW5kZXgrKykgew0KLSAgICAgIFN0YXR1cyA9IGdCUy0+ SGFuZGxlUHJvdG9jb2wgKA0KLSAgICAgICAgICAgICAgICAgICAgICBIYW5kbGVCdWZmZXJbSW5k ZXhdLA0KLSAgICAgICAgICAgICAgICAgICAgICAmZ0VmaVBjaUlvUHJvdG9jb2xHdWlkLA0KLSAg ICAgICAgICAgICAgICAgICAgICAoVk9JRCAqKikmUGNpSW8NCi0gICAgICAgICAgICAgICAgICAg ICAgKTsNCi0gICAgICBpZiAoRUZJX0VSUk9SIChTdGF0dXMpKSB7DQotICAgICAgICBjb250aW51 ZTsNCi0gICAgICB9DQotDQotICAgICAgU3RhdHVzID0gUGNpSW8tPkdldExvY2F0aW9uICgNCi0g ICAgICAgICAgICAgICAgICAgICAgICBQY2lJbywNCi0gICAgICAgICAgICAgICAgICAgICAgICAm UGNpU2VnbWVudCwNCi0gICAgICAgICAgICAgICAgICAgICAgICAmUGNpQnVzLA0KLSAgICAgICAg ICAgICAgICAgICAgICAgICZQY2lEZXZpY2UsDQotICAgICAgICAgICAgICAgICAgICAgICAgJlBj aUZ1bmN0aW9uDQotICAgICAgICAgICAgICAgICAgICAgICAgKTsNCi0gICAgICBpZiAoUGNpQnVz ID4gTGFzdEJ1cykgew0KLSAgICAgICAgTGFzdEJ1cyA9IFBjaUJ1czsNCi0gICAgICB9DQotICAg IH0NCi0NCi0gICAgUHJpdmF0ZS0+TGVnYWN5UmVnaW9uLT5VbkxvY2sgKA0KLSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgUHJpdmF0ZS0+TGVnYWN5UmVnaW9uLA0KLSAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgMHhFMDAwMCwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4 MjAwMDAsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmR3JhbnVsYXJpdHkNCi0gICAg ICAgICAgICAgICAgICAgICAgICAgICAgICk7DQotICAgIFByaXZhdGUtPkxlZ2FjeTE2VGFibGUt Pkxhc3RQY2lCdXMgPSAoVUlOVDgpTGFzdEJ1czsNCi0gICAgUHJpdmF0ZS0+TGVnYWN5UmVnaW9u LT5Mb2NrICgNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIFByaXZhdGUtPkxlZ2FjeVJl Z2lvbiwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4RTAwMDAsDQotICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAweDIwMDAwLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJkdyYW51bGFyaXR5DQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICApOw0KLSAgfQ0K LQ0KLSAgKkZsYWdzID0gMDsNCi0gIGlmICgoUGNpSGFuZGxlICE9IE5VTEwpICYmIChSb21JbWFn ZSA9PSBOVUxMKSkgew0KLSAgICAvLw0KLSAgICAvLyBJZiBQY2lIYW5kbGUgaGFzIE9wUm9tIHRv IEV4ZWN1dGUNCi0gICAgLy8gYW5kIE9wUm9tIGFyZSBhbGwgYXNzb2NpYXRlZCB3aXRoIEhhcmR3 YXJlDQotICAgIC8vDQotICAgIFN0YXR1cyA9IGdCUy0+SGFuZGxlUHJvdG9jb2wgKA0KLSAgICAg ICAgICAgICAgICAgICAgUGNpSGFuZGxlLA0KLSAgICAgICAgICAgICAgICAgICAgJmdFZmlQY2lJ b1Byb3RvY29sR3VpZCwNCi0gICAgICAgICAgICAgICAgICAgIChWT0lEICoqKSZQY2lJbw0KLSAg ICAgICAgICAgICAgICAgICAgKTsNCi0NCi0gICAgaWYgKCFFRklfRVJST1IgKFN0YXR1cykpIHsN Ci0gICAgICBQY2lJby0+UGNpLlJlYWQgKA0KLSAgICAgICAgICAgICAgICAgICBQY2lJbywNCi0g ICAgICAgICAgICAgICAgICAgRWZpUGNpSW9XaWR0aFVpbnQzMiwNCi0gICAgICAgICAgICAgICAg ICAgMCwNCi0gICAgICAgICAgICAgICAgICAgc2l6ZW9mIChQY2lDb25maWdIZWFkZXIpIC8gc2l6 ZW9mIChVSU5UMzIpLA0KLSAgICAgICAgICAgICAgICAgICAmUGNpQ29uZmlnSGVhZGVyDQotICAg ICAgICAgICAgICAgICAgICk7DQotDQotICAgICAgLy8NCi0gICAgICAvLyBpZiB2aWRlbyBpbnN0 YWxsZWQgJiBPUFJPTSBpcyB2aWRlbyByZXR1cm4NCi0gICAgICAvLw0KLSAgICAgIGlmICgNCi0g ICAgICAgICAgICAoDQotICAgICAgICAgICAgICAgKChQY2lDb25maWdIZWFkZXIuSGRyLkNsYXNz Q29kZVsyXSA9PSBQQ0lfQ0xBU1NfT0xEKSAmJg0KLSAgICAgICAgICAgICAgKFBjaUNvbmZpZ0hl YWRlci5IZHIuQ2xhc3NDb2RlWzFdID09IFBDSV9DTEFTU19PTERfVkdBKSkNCi0gICAgICAgICAg ICB8fA0KLSAgICAgICAgICAgICAoKFBjaUNvbmZpZ0hlYWRlci5IZHIuQ2xhc3NDb2RlWzJdID09 IFBDSV9DTEFTU19ESVNQTEFZKSAmJg0KLSAgICAgICAgICAgICAgKFBjaUNvbmZpZ0hlYWRlci5I ZHIuQ2xhc3NDb2RlWzFdID09IFBDSV9DTEFTU19ESVNQTEFZX1ZHQSkpDQotICAgICAgICAgICAg KQ0KLSAgICAgICAgICYmDQotICAgICAgICAgICAgKCFQcml2YXRlLT5WZ2FJbnN0YWxsZWQpDQot ICAgICAgICAgICAgKQ0KLSAgICAgIHsNCi0gICAgICAgIG1WZ2FJbnN0YWxsYXRpb25JblByb2dy ZXNzID0gVFJVRTsNCi0NCi0gICAgICAgIC8vDQotICAgICAgICAvLyAgICAgIHJldHVybiBFRklf VU5TVVBQT1JURUQ7DQotICAgICAgICAvLw0KLSAgICAgIH0NCi0gICAgfQ0KLQ0KLSAgICAvLw0K LSAgICAvLyBUbyBydW4gYW55IGxlZ2FjeSBpbWFnZSwgdGhlIFZHQSBuZWVkcyB0byBiZSBpbnN0 YWxsZWQgZmlyc3QuDQotICAgIC8vIGlmIGluc3RhbGxpbmcgdGhlIHZpZGVvLCB0aGVuIGRvbid0 IG5lZWQgdGhlIHRodW5rIGFzIGFscmVhZHkgaW5zdGFsbGVkLg0KLSAgICAvLw0KLSAgICBTdGF0 dXMgPSBQcml2YXRlLT5MZWdhY3lCaW9zUGxhdGZvcm0tPkdldFBsYXRmb3JtSGFuZGxlICgNCi0g ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFByaXZhdGUtPkxlZ2Fj eUJpb3NQbGF0Zm9ybSwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIEVmaUdldFBsYXRmb3JtVmdhSGFuZGxlLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgMCwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICZIYW5kbGVCdWZmZXIsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmSGFuZGxlQ291bnQsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBOVUxMDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICApOw0KLQ0KLSAgICBpZiAoIUVGSV9FUlJPUiAoU3RhdHVzKSkgew0KLSAgICAg IG1WZ2FIYW5kbGUgPSBIYW5kbGVCdWZmZXJbMF07DQotICAgICAgaWYgKCghUHJpdmF0ZS0+Vmdh SW5zdGFsbGVkKSAmJiAoUGNpSGFuZGxlICE9IG1WZ2FIYW5kbGUpKSB7DQotICAgICAgICAvLw0K LSAgICAgICAgLy8gQSByZXR1cm4gc3RhdHVzIG9mIEVGSV9OT1RfRk9VTkQgaXMgY29uc2lkZXJl ZCB2YWxpZCAoTm8gRUZJDQotICAgICAgICAvLyBkcml2ZXIgaXMgY29udHJvbGxpbmc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0NCi0gICAgU3RhdHVzID0gTGVnYWN5Qmlvc0NoZWNr UGNpUm9tRXggKA0KLSAgICAgICAgICAgICAgICZQcml2YXRlLT5MZWdhY3lCaW9zLA0KLSAgICAg ICAgICAgICAgIFBjaUhhbmRsZSwNCi0gICAgICAgICAgICAgICAmTG9jYWxSb21JbWFnZSwNCi0g ICAgICAgICAgICAgICAmSW1hZ2VTaXplLA0KLSAgICAgICAgICAgICAgICZSdW50aW1lSW1hZ2VM ZW5ndGgsDQotICAgICAgICAgICAgICAgRmxhZ3MsDQotICAgICAgICAgICAgICAgJk9wcm9tUmV2 aXNpb24sDQotICAgICAgICAgICAgICAgTlVMTA0KLSAgICAgICAgICAgICAgICk7DQotICAgIGlm IChFRklfRVJST1IgKFN0YXR1cykpIHsNCi0gICAgICAvLw0KLSAgICAgIC8vIFRoZXJlIGlzIG5v IFBDSSBST00gaW4gdGhlIFJPTSBCQVIgb3Igbm8gb25ib2FyZCBST00NCi0gICAgICAvLw0KLSAg ICAgIG1WZ2FJbnN0YWxsYXRpb25JblByb2dyZXNzID0gRkFMU0U7DQotICAgICAgcmV0dXJuIEVG SV9VTlNVUFBPUlRFRDsNCi0gICAgfQ0KLSAgfSBlbHNlIHsNCi0gICAgaWYgKChSb21JbWFnZSA9 PSBOVUxMKSB8fCAoKlJvbUltYWdlID09IE5VTEwpKSB7DQotICAgICAgLy8NCi0gICAgICAvLyBJ ZiBQY2lIYW5kbGUgaXMgTlVMTCwgYW5kIG5vIE9wUm9tIGlzIHRvIGJlIGFzc29jaWF0ZWQNCi0g ICAgICAvLw0KLSAgICAgIG1WZ2FJbnN0YWxsYXRpb25JblByb2dyZXNzID0gRkFMU0U7DQotICAg ICAgcmV0dXJuIEVGSV9VTlNVUFBPUlRFRDsNCi0gICAgfQ0KLQ0KLSAgICBTdGF0dXMgPSBQcml2 YXRlLT5MZWdhY3lCaW9zUGxhdGZvcm0tPkdldFBsYXRmb3JtSGFuZGxlICgNCi0gICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFByaXZhdGUtPkxlZ2FjeUJpb3NQbGF0 Zm9ybSwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVmaUdl dFBsYXRmb3JtVmdhSGFuZGxlLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgMCwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICZIYW5kbGVCdWZmZXIsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmSGFuZGxlQ291bnQsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBOVUxMDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICApOw0KLSAgICBpZiAoKCFFRklfRVJST1IgKFN0YXR1cykpICYmICghUHJpdmF0ZS0+VmdhSW5z dGFsbGVkKSkgew0KLSAgICAgIC8vDQotICAgICAgLy8gQSByZXR1cm4gc3RhdHVzIG9mIEVGSV9O T1RfRk9VTkQgaXMgY29uc2lkZXJlZCB2YWxpZCAoTm8gRUZJDQotICAgICAgLy8gZHJpdmVyIGlz IGNvbnRyb2xsaW5nIHZpZGVvLg0KLSAgICAgIC8vDQotICAgICAgbVZnYUluc3RhbGxhdGlvbklu UHJvZ3Jlc3MgPSBUUlVFOw0KLSAgICAgIFN0YXR1cyAgICAgICAgICAgICAgICAgICAgID0gTGVn YWN5Qmlvc0luc3RhbGxWZ2FSb20gKFByaXZhdGUpOw0KLSAgICAgIGlmIChFRklfRVJST1IgKFN0 YXR1cykpIHsNCi0gICAgICAgIGlmIChTdGF0dXMgIT0gRUZJX05PVF9GT1VORCkgew0KLSAgICAg ICAgICBtVmdhSW5zdGFsbGF0aW9uSW5Qcm9ncmVzcyA9IEZBTFNFOw0KLSAgICAgICAgICByZXR1 cm4gU3RhdHVzOw0KLSAgICAgICAgfQ0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dGUtPlRy YWNlW1ByaXZhdGUtPlRyYWNlSW5kZXhdID0gTEVHQUNZX1BDSV9UUkFDRV8wMDA7DQotICBQcml2 YXRlLT5UcmFjZUluZGV4Kys7DQotICBQcml2YXRlLT5UcmFjZUluZGV4ID0gKFVJTlQxNikoUHJp dmF0ZS0+VHJhY2VJbmRleCAlIDB4MjAwKTsNCi0gIFN0YXR1cyAgICAgICAgICAgICAgPSBMZWdh Y3lCaW9zSW5zdGFsbFJvbSAoDQotICAgICAgICAgICAgICAgICAgICAgICAgICBUaGlzLA0KLSAg ICAgICAgICAgICAgICAgICAgICAgICAgUHJpdmF0ZSwNCi0gICAgICAgICAgICAgICAgICAgICAg ICAgIFBjaUhhbmRsZSwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgIE9wcm9tUmV2aXNpb24s DQotICAgICAgICAgICAgICAgICAgICAgICAgICBMb2NhbFJvbUltYWdlLA0KLSAgICAgICAgICAg ICAgICAgICAgICAgICAgSW1hZ2VTaXplLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgJlJ1 bnRpbWVJbWFnZUxlbmd0aCwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgIERpc2tTdGFydCwN Ci0gICAgICAgICAgICAgICAgICAgICAgICAgIERpc2tFbmQsDQotICAgICAgICAgICAgICAgICAg ICAgICAgICBSb21TaGFkb3dBZGRyZXNzDQotICAgICAgICAgICAgICAgICAgICAgICAgICApOw0K LSAgaWYgKFJvbVNoYWRvd2VkU2l6ZSAhPSBOVUxMKSB7DQotICAgICpSb21TaGFkb3dlZFNpemUg PSAoVUlOVDMyKVJ1bnRpbWVJbWFnZUxlbmd0aDsNCi0gIH0NCi0NCi0gIG1WZ2FJbnN0YWxsYXRp b25JblByb2dyZXNzID0gRkFMU0U7DQotICByZXR1cm4gU3RhdHVzOw0KLX0NCmRpZmYgLS1naXQg YS9Pdm1mUGtnL0NzbS9MZWdhY3lCaW9zRHhlL0xlZ2FjeVNpby5jIGIvT3ZtZlBrZy9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ICpTaW9QdHINCi0g ICkNCi17DQotICBFRklfU1RBVFVTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0 YXR1czsNCi0gIERFVklDRV9QUk9EVUNFUl9TRVJJQUwgICAgICAgICAgICAgICAgICAgICAgKlNp b1NlcmlhbDsNCi0gIERFVklDRV9QUk9EVUNFUl9QQVJBTExFTCAgICAgICAgICAgICAgICAgICAg KlNpb1BhcmFsbGVsOw0KLSAgREVWSUNFX1BST0RVQ0VSX0ZMT1BQWSAgICAgICAgICAgICAgICAg ICAgICAqU2lvRmxvcHB5Ow0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBIYW5kbGVDb3VudDsNCi0gIEVGSV9IQU5ETEUgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKkhhbmRsZUJ1ZmZlcjsNCi0gIFVJTlROICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgSW5kZXg7DQotICBVSU5UTiAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIENoaWxkSW5kZXg7DQotICBFRklfU0lPX1BST1RPQ09MICAgICAgICAg ICAgICAgICAgICAgICAgICAgICpTaW87DQotICBBQ1BJX1JFU09VUkNFX0hFQURFUl9QVFIgICAg ICAgICAgICAgICAgICAgIFJlc291cmNlczsNCi0gIEVGSV9BQ1BJX0lPX1BPUlRfREVTQ1JJUFRP UiAgICAgICAgICAgICAgICAgKklvUmVzb3VyY2U7DQotICBFRklfQUNQSV9GSVhFRF9MT0NBVElP Tl9JT19QT1JUX0RFU0NSSVBUT1IgICpGaXhlZElvUmVzb3VyY2U7DQotICBFRklfQUNQSV9ETUFf REVTQ1JJUFRPUiAgICAgICAgICAgICAgICAgICAgICpEbWFSZXNvdXJjZTsNCi0gIEVGSV9BQ1BJ X0lSUV9OT0ZMQUdfREVTQ1JJUFRPUiAgICAgICAgICAgICAgKklycVJlc291cmNlOw0KLSAgVUlO VDE2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBZGRyZXNzOw0KLSAgVUlO VDggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEbWE7DQotICBVSU5UOCAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElycTsNCi0gIFVJTlROICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRW50cnlDb3VudDsNCi0gIEVGSV9PUEVO X1BST1RPQ09MX0lORk9STUFUSU9OX0VOVFJZICAgICAgICAgKk9wZW5JbmZvQnVmZmVyOw0KLSAg RUZJX0JMT0NLX0lPX1BST1RPQ09MICAgICAgICAgICAgICAgICAgICAgICAqQmxvY2tJbzsNCi0g IEVGSV9TRVJJQUxfSU9fUFJPVE9DT0wgICAgICAgICAgICAgICAgICAgICAgKlNlcmlhbElvOw0K LSAgRUZJX0RFVklDRV9QQVRIX1BST1RPQ09MICAgICAgICAgICAgICAgICAgICAqRGV2aWNlUGF0 aDsNCi0gIEFDUElfSElEX0RFVklDRV9QQVRIICAgICAgICAgICAgICAgICAgICAgICAgKkFjcGk7 DQotDQotICAvLw0KLSAgLy8gR2V0IHRoZSBsaXN0IG9mIElTQSBjb250cm9sbGVycyBpbiB0aGUg c3lzdGVtDQotICAvLw0KLSAgU3RhdHVzID0gZ0JTLT5Mb2NhdGVIYW5kbGVCdWZmZXIgKA0KLSAg ICAgICAgICAgICAgICAgIEJ5UHJvdG9jb2wsDQotICAgICAgICAgICAgICAgICAgJmdFZmlTaW9Q cm90b2NvbEd1aWQsDQotICAgICAgICAgICAgICAgICAgTlVMTCwNCi0gICAgICAgICAgICAgICAg ICAmSGFuZGxlQ291bnQsDQotICAgICAgICAgICAgICAgICAgJkhhbmRsZUJ1ZmZlcg0KLSAgICAg ICAgICAgICAgICAgICk7DQotICBpZiAoRUZJX0VSUk9SIChTdGF0dXMpKSB7DQotICAgIHJldHVy biBFRklfTk9UX0ZPVU5EOw0KLSAgfQ0KLQ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gICAgICAgICAgIEFk ZHJlc3MgICAgPSBJb1Jlc291cmNlLT5CYXNlQWRkcmVzc01pbjsNCi0gICAgICAgICAgICBicmVh azsNCi0NCi0gICAgICAgICAgY2FzZSBBQ1BJX0ZJWEVEX0xPQ0FUSU9OX0lPX1BPUlRfREVTQ1JJ UFRPUjoNCi0gICAgICAgICAgICBGaXhlZElvUmVzb3VyY2UgPSAoRUZJX0FDUElfRklYRURfTE9D QVRJT05fSU9fUE9SVF9ERVNDUklQVE9SICopUmVzb3VyY2VzLlNtYWxsSGVhZGVyOw0KLSAgICAg ICAgICAgIEFkZHJlc3MgICAgICAgICA9IEZpeGVkSW9SZXNvdXJjZS0+QmFzZUFkZHJlc3M7DQot ICAgICAgICAgICAgYnJlYWs7DQotDQotICAgICAgICAgIGNhc2UgQUNQSV9ETUFfREVTQ1JJUFRP UjoNCi0gICAgICAgICAgICBEbWFSZXNvdXJjZSA9IChFRklfQUNQSV9ETUFfREVTQ1JJUFRPUiAq KVJlc291cmNlcy5TbWFsbEhlYWRlcjsNCi0gICAgICAgICAgICBEbWEgICAgICAgICA9IChVSU5U OClMb3dCaXRTZXQzMiAoRG1hUmVzb3VyY2UtPkNoYW5uZWxNYXNrKTsNCi0gICAgICAgICAgICBi cmVhazsNCi0NCi0gICAgICAgICAgY2FzZSBBQ1BJX0lSUV9ERVNDUklQVE9SOg0KLSAgICAgICAg ICBjYXNlIEFDUElfSVJRX05PRkxBR19ERVNDUklQVE9SOg0KLSAgICAgICAgICAgIElycVJlc291 cmNlID0gKEVGSV9BQ1BJX0lSUV9OT0ZMQUdfREVTQ1JJUFRPUiAqKVJlc291cmNlcy5TbWFsbEhl YWRlcjsNCi0gICAgICAgICAgICBJcnEgICAgICAgICA9IChVSU5UOClMb3dCaXRTZXQzMiAoSXJx UmVzb3VyY2UtPk1hc2spOw0KLSAgICAgICAgICAgIGJyZWFrOw0KLQ0KLSAgICAgICAgICBkZWZh dWx0Og0KLSAgICAgICAgICAgIGJyZWFrOw0KLSAgICAgICAgfQ0KLQ0KLSAgICAgICAgaWYgKFJl c291cmNlcy5TbWFsbEhlYWRlci0+Qml0cy5UeXBlID09IDApIHsNCi0gICAgICAgICAgUmVzb3Vy Y2VzLlNtYWxsSGVhZGVyID0gKEFDUElfU01BTExfUkVTT1VSQ0VfSEVBREVSICopKChVSU5UOCAq KVJlc291cmNlcy5TbWFsbEhlYWRlcg0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBSZXNvdXJjZXMuU21hbGxIZWFkZXIt PkJpdHMuTGVuZ3RoDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICArIHNpemVvZiAoKlJlc291cmNlcy5TbWFsbEhlYWRlcikp Ow0KLSAgICAgICAgfSBlbHNlIHsNCi0gICAgICAgICAgUmVzb3VyY2VzLkxhcmdlSGVhZGVyID0g KEFDUElfTEFSR0VfUkVTT1VSQ0VfSEVBREVSICopKChVSU5UOCAqKVJlc291cmNlcy5MYXJnZUhl YWRlcg0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgKyBSZXNvdXJjZXMuTGFyZ2VIZWFkZXItPkxlbmd0aA0KLSAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg KyBzaXplb2YgKCpSZXNvdXJjZXMuTGFyZ2VIZWFkZXIpKTsNCi0gICAgICAgIH0NCi0gICAgICB9 DQotICAgIH0NCi0NCi0gICAgREVCVUcgKChERUJVR19JTkZPLCAiTGVnYWN5U2lvOiBBZGRyZXNz L0RtYS9JcnEgPSAleC8lZC8lZFxuIiwgQWRkcmVzcywgRG1hLCBJcnEpKTsNCi0NCi0gICAgRGV2 aWNlUGF0aCA9IERldmljZVBhdGhGcm9tSGFuZGxlIChIYW5kbGV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xlIG9mIHRoZSBjaGlsZCBkZXZpY2UgdGhhdCBoYXMgb3BlbmVkIHRoZSBTdXBlciBJ L08gUHJvdG9jb2wNCi0gICAgICAgIC8vDQotICAgICAgICBTdGF0dXMgPSBnQlMtPk9wZW5Qcm90 b2NvbEluZm9ybWF0aW9uICgNCi0gICAgICAgICAgICAgICAgICAgICAgICBIYW5kbGVCdWZmZXJb SW5kZXhdLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICZnRWZpU2lvUHJvdG9jb2xHdWlkLA0K LSAgICAgICAgICAgICAgICAgICAgICAgICZPcGVuSW5mb0J1ZmZlciwNCi0gICAgICAgICAgICAg ICAgICAgICAgICAmRW50cnlDb3VudA0KLSAgICAgICAgICAgICAgICAgICAgICAgICk7DQotICAg ICAgICBpZiAoRUZJX0VSUk9SIChTdGF0dXMpKSB7DQotICAgICAgICAgIGNvbnRpbnVlOw0KLSAg ICAgICAgfQ0KLQ0KLSAgICAgICAgZm9yIChDaGlsZEluZGV4ID0gMDsgQ2hpbGRJbmRleCA8IEVu dHJ5Q291bnQ7IENoaWxkSW5kZXgrKykgew0KLSAgICAgICAgICBpZiAoKE9wZW5JbmZvQnVmZmVy W0NoaWxkSW5kZXhdLkF0dHJpYnV0ZXMgJiBFRklfT1BFTl9QUk9UT0NPTF9CWV9DSElMRF9DT05U Uk9MTEVSKSAhPSAwKSB7DQotICAgICAgICAgICAgU3RhdHVzID0gZ0JTLT5IYW5kbGVQcm90b2Nv bCAoT3BlbkluZm9CdWZmZXJbQ2hpbGRJbmRleF0uQ29udHJvbGxlckhhbmRsZSwgJmdFZmlTZXJp YWxJb1Byb3RvY29sR3VpZCwgKFZPSUQgKiopJlNlcmlhbElvKTsNCi0gICAgICAgICAgICBpZiAo IUVGSV9FUlJPUiAoU3RhdHVzKSkgew0KLSAgICAgICAgICAgICAgU2lvU2VyaWFsICAgICAgICAg ID0gJlNpb1B0ci0+U2VyaWFsW0FjcGktPlVJRF07DQotICAgICAgICAgICAgICBTaW9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wtPkRtYSAgICAgPSBEbWE7DQotICAgICAgICBTaW9QYXJhbGxlbC0+TW9k ZSAgICA9IERFVklDRV9QQVJBTExFTF9NT0RFX01PREVfT1VUUFVUX09OTFk7DQotICAgICAgfQ0K LSAgICB9DQotDQotICAgIC8vDQotICAgIC8vIFNlZSBpZiB0aGlzIGlzIGFuIElTQSBmbG9wcHkg Y29udHJvbGxlcg0KLSAgICAvLw0KLSAgICBpZiAoQWNwaS0+SElEID09IEVJU0FfUE5QX0lEICgw eDYwNCkpIHsNCi0gICAgICBpZiAoKEFkZHJlc3MgIT0gTUFYX1VJTlQxNikgJiYgKElycSAhPSBN QVhfVUlOVDgpICYmIChEbWEgIT0gTUFYX1VJTlQ4KSkgew0KLSAgICAgICAgU3RhdHVzID0gZ0JT LT5IYW5kbGVQcm90b2NvbCAoSGFuZGxlQnVmZmVyW0luZGV4XSwgJmdFZmlCbG9ja0lvUHJvdG9j b2xHdWlkLCAoVk9JRCAqKikmQmxvY2tJbyk7DQotICAgICAgICBpZiAoIUVGSV9FUlJPUiAoU3Rh dHVzKSkgew0KLSAgICAgICAgICBTaW9GbG9wcHkgICAgICAgICAgPSAmU2lvUHRyLT5GbG9wcHk7 DQotICAgICAgICAgIFNpb0Zsb3BweS0+QWRkcmVzcyA9IEFkZHJlc3M7DQotICAgICAgICAgIFNp b0Zsb3BweS0+SXJxICAgICA9IElycTsNCi0gICAgICAgICAgU2lvRmxvcHB5LT5EbWEgICAgID0g RG1hOw0KLSAgICAgICAgICBTaW9GbG9wcHktPk51bWJlck9mRmxvcHB5Kys7DQotICAgICAgICB9 DQotICAgICAgfQ0KLSAgICB9DQotDQotICAgIC8vDQotICAgIC8vIFNlZSBpZiB0aGlzIGlzIGEg bW91c2UNCi0gICAgLy8gQWx3YXlzIHNldCBtb3VzZSBmb3VuZCBzbyBVU0IgaG90IHBsdWcgd2ls bCB3b3JrDQotICAgIC8vDQotICAgIC8vIElnbm9yZSBsb3dlciBieXRlIG9mIEhJRC4gUG5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Uw0KLUxlZ2FjeUJpb3NCdWlsZFNpb0RhdGFGcm9tSXNhSW8gKA0K LSAgSU4gREVWSUNFX1BST0RVQ0VSX0RBVEFfSEVBREVSICAqU2lvUHRyDQotICApDQotew0KLSAg RUZJX1NUQVRVUyAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0YXR1czsNCi0gIERFVklDRV9Q Uk9EVUNFUl9TRVJJQUwgICAgICAgICAgICAgICAqU2lvU2VyaWFsOw0KLSAgREVWSUNFX1BST0RV Q0VSX1BBUkFMTEVMICAgICAgICAgICAgICpTaW9QYXJhbGxlbDsNCi0gIERFVklDRV9QUk9EVUNF Ul9GTE9QUFkgICAgICAgICAgICAgICAqU2lvRmxvcHB5Ow0KLSAgVUlOVE4gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIEhhbmRsZUNvdW50Ow0KLSAgRUZJX0hBTkRMRSAgICAgICAgICAg ICAgICAgICAgICAgICAgICpIYW5kbGVCdWZmZXI7DQotICBVSU5UTiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgSW5kZXg7DQotICBVSU5UTiAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgUmVzb3VyY2VJbmRleDsNCi0gIFVJTlROICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBDaGlsZEluZGV4Ow0KLSAgRUZJX0lTQV9JT19QUk9UT0NPTCAgICAgICAgICAgICAgICAg ICpJc2FJbzsNCi0gIEVGSV9JU0FfQUNQSV9SRVNPVVJDRV9MSVNUICAgICAgICAgICAqUmVzb3Vy Y2VMaXN0Ow0KLSAgRUZJX0lTQV9BQ1BJX1JFU09VUkNFICAgICAgICAgICAgICAgICpJb1Jlc291 cmNlOw0KLSAgRUZJX0lTQV9BQ1BJX1JFU09VUkNFICAgICAgICAgICAgICAgICpEbWFSZXNvdXJj ZTsNCi0gIEVGSV9JU0FfQUNQSV9SRVNPVVJDRSAgICAgICAgICAgICAgICAqSW50ZXJydXB0UmVz b3VyY2U7DQotICBVS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ZiAoRUZJX0VSUk9S IChTdGF0dXMpKSB7DQotICAgICAgY29udGludWU7DQotICAgIH0NCi0NCi0gICAgUmVzb3VyY2VM aXN0ID0gSXNhSW8tPlJlc291cmNlTGlzdDsNCi0NCi0gICAgaWYgKFJlc291cmNlTGlzdCA9PSBO VUxMKSB7DQotICAgICAgY29udGludWU7DQotICAgIH0NCi0NCi0gICAgLy8NCi0gICAgLy8gQ29s bGVjdCB0aGUgcmVzb3VyY2UgdHlwZXMgbmVlZGVkdG8gZmlsbCBpbiB0aGUgU0lPIGRhdGEgc3Ry dWN0dXJlDQotICAgIC8vDQotICAgIElvUmVzb3VyY2UgICAgICAgID0gTlVMTDsNCi0gICAgRG1h UmVzb3VyY2UgICAgICAgPSBOVUxMOw0KLSAgICBJbnRlcnJ1cHRSZXNvdXJjZSA9IE5VTEw7DQot ICAgIGZvciAoUmVzb3VyY2VJbmRleCA9IDA7DQotICAgICAgICAgUmVzb3VyY2VMaXN0LT5SZXNv dXJjZUl0ZW1bUmVzb3VyY2VJbmRleF0uVHlwZSAhPSBFZmlJc2FBY3BpUmVzb3VyY2VFbmRPZkxp c3Q7DQotICAgICAgICAgUmVzb3VyY2VJbmRleCsrDQotICAgICAgICAgKQ0KLSAgICB7DQotICAg ICAgc3dpdGNoIChSZXNvdXJjZUxpc3QtPlJlc291cmNlSXRlbVtSZXNvdXJjZUluZGV4XS5UeXBl KSB7DQotICAgICAgICBjYXNlIEVmaUlzYUFjcGlSZXNvdXJjZUlvOg0KLSAgICAgICAgICBJb1Jl c291cmNlID0gJlJlc291cmNlTGlzdC0+UmVzb3VyY2VJdGVtW1Jlc291cmNlSW5kZXhdOw0KLSAg ICAgICAgICBicmVhazsNCi0NCi0gICAgICAgIGNhc2UgRWZpSXNhQWNwaVJlc291cmNlTWVtb3J5 Og0KLSAgICAgICAgICBicmVhazsNCi0NCi0gICAgICAgIGNhc2UgRWZpSXNhQWNwaVJlc291cmNl RG1hOg0KLSAgICAgICAgICBEbWFSZXNvd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b24gKA0K LSAgICAgICAgICAgICAgICAgICAgICAgIEhhbmRsZUJ1ZmZlcltJbmRleF0sDQotICAgICAgICAg ICAgICAgICAgICAgICAgJmdFZmlJc2FJb1Byb3RvY29sR3VpZCwNCi0gICAgICAgICAgICAgICAg ICAgICAgICAmT3BlbkluZm9CdWZmZXIsDQotICAgICAgICAgICAgICAgICAgICAgICAgJkVudHJ5 Q291bnQNCi0gICAgICAgICAgICAgICAgICAgICAgICApOw0KLSAgICAgICAgaWYgKEVGSV9FUlJP UiAoU3RhdHVzKSkgew0KLSAgICAgICAgICBjb250aW51ZTsNCi0gICAgICAgIH0NCi0NCi0gICAg ICAgIC8vDQotICAgICAgICAvLyBXZSB3YW50IHJlc291cmNlIGZvciBsZWdhY3kgZXZlbiBpZiBu byAzMi1iaXQgZHJpdmVyIGluc3RhbGxlZA0KLSAgICAgICAgLy8NCi0gICAgICAgIGZvciAoQ2hp bGRJbmRleCA9IDA7IENoaWxkSW5kZXggPCBFbnRyeUNvdW50OyBDaGlsZEluZGV4KyspIHsNCi0g ICAgICAgICAgaWYgKChPcGVuSW5mb0J1ZmZlcltDaGlsZEluZGV4XS5BdHRyaWJ1dGVzICYgRUZJ X09QRU5fUFJPVE9DT0xfQllfQ0hJTERfQ09OVFJPTExFUikgIT0gMCkgew0KLSAgICAgICAgICAg IFN0YXR1cyA9IGdCUy0+SGFuZGxlUHJvdG9jb2wgKE9wZW5JbmZvQnVmZmVyW0NoaWxkSW5kZXhd LkNvbnRyb2xsZXJIYW5kbGUsICZnRWZpU2VyaWFsSW9Qcm90b2NvbEd1aWQsIChWT0lEICoqKSZT ZXJpYWxJbyk7DQotICAgICAgICAgICAgaWYgKCFFRklfRVJST1IgKFN0YXR1cykpIHsNCi0gICAg ICAgICAgICAgIFNpb1NlcmlhbCAgICAgICAgICA9ICZTaW9QdHItPlNlcmlhbFtSZXNvdXJjZUxp c3QtPkRldmljZS5VSURdOw0KLSAgICAgICAgICAgICAgU2lvU2VyaWFsLT5BZ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REVWSUNFX1BST0RVQ0VSX0RBVEFfSEVBREVSKSwgMCk7DQot DQotICAvLw0KLSAgLy8gRmluZCB0aGUgSVNBIEJ1cyBDb250cm9sbGVyIHVzZWQgZm9yIGxlZ2Fj eQ0KLSAgLy8NCi0gIFN0YXR1cyA9IFByaXZhdGUtPkxlZ2FjeUJpb3NQbGF0Zm9ybS0+R2V0UGxh dGZvcm1IYW5kbGUgKA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IFByaXZhdGUtPkxlZ2FjeUJpb3NQbGF0Zm9ybSwNCi0gICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBFZmlHZXRQbGF0Zm9ybUlzYUJ1c0hhbmRsZSwNCi0gICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLA0KLSAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICZIYW5kbGVCdWZmZXIsDQotICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJkhhbmRsZUNvdW50LA0KLSAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwNCi0gICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICApOw0KLSAgSXNhQnVzQ29udHJvbGxlciA9IEhhbmRsZUJ1ZmZlclsw XTsNCi0gIGlmICghRUZJX0VSUk9SIChTdGF0dXMpKSB7DQotICAgIC8vDQotICAgIC8vIEZvcmNl IElTQSBCdXMgQ29udHJvbGxlciB0byBwcm9kdWNlIGFsbCBJU0EgZGV2aWNlcw0KLSAgICAvLw0K LSAgICBnQlMtPkNvbm5lY3RDb250cm9sbGVyIChJc2FCdXNDb250cm9sbGVyLCBOVUxMLCBOVUxM LCBUUlVFKTsNCi0gIH0NCi0NCi0gIFN0YXR1cyA9IExlZ2FjeUJpb3NCdWlsZFNpb0RhdGFGcm9t SXNhSW8gKFNpb1B0cik7DQotICB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Ci0gICAgKTsNCi0NCi0gIHJldHVybiBJbnRl cm5hbExlZ2FjeUJpb3NGYXJDYWxsICgNCi0gICAgICAgICAgIFRoaXMsDQotICAgICAgICAgICBT ZWdtZW50LA0KLSAgICAgICAgICAgT2Zmc2V0LA0KLSAgICAgICAgICAgUmVncywNCi0gICAgICAg ICAgICZSZWdzLT5YLkZsYWdzLA0KLSAgICAgICAgICAgc2l6ZW9mIChSZWdzLT5YLkZsYWdzKQ0K LSAgICAgICAgICAgKTsNCi19DQotDQotLyoqDQotICBUaHVuayB0byAxNi1iaXQgcmVhbCBtb2Rl IGFuZCBjYWxsIFNlZ21lbnQ6T2Zmc2V0LiBSZWdzIHdpbGwgY29udGFpbiB0aGUNCi0gIDE2LWJp dCByZWdpc3RlciBjb250ZXh0IG9uIGVudHJ5IGFuZCBleGl0LiBBcmd1bWVudHMgY2FuIGJlIHBh c3NlZCBvbg0KLSAgdGhlIFN0YWNrIGFyZ3VtZW50DQotDQotICBAcGFyYW0gIFRoaXMgICAgICAg ICAgICAgICAgICAgUHJvdG9jb2wgaW5zdGFuY2UgcG9pbnRlci4NCi0gIEBwYXJhbSAgU2VnbWVu dCAgICAgICAgICAgICAgICBTZWdlbW50IG9mIDE2LWJpdCBtb2RlIGNhbGwNCi0gIEBwYXJhbSAg T2Zmc2V0ICAgICAgICAgICAgICAgICBPZmZzZXQgb2YgMTYtYml0IG1kb2UgY2FsbA0KLSAgQHBh cmFtICBSZWdzICAgICAgICAgICAgICAgICAgIFJlZ2lzdGVyIGNvbnRleHRlZCBwYXNzZWQgaW50 byAoYW5kIHJldHVybmVkKSBmcm9tDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg dGh1bmsgdG8gIDE2LWJpdCBtb2RlDQotICBAcGFyYW0gIFN0YWNrICAgICAgICAgICAgICAgICAg Q2FsbGVyIGFsbG9jYXRlZCBzdGFjayB1c2VkIHRvIHBhc3MgYXJndW1lbnRzDQotICBAcGFyYW0g IFN0YWNrU2l6ZS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