From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id D39F23954F61 for ; Sun, 18 Sep 2022 08:24:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D39F23954F61 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.93,325,1654588800"; d="diff'?scan'208";a="83043778" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 18 Sep 2022 00:24:57 -0800 IronPort-SDR: yacPmAsLk58aoj5x3jdJGf7590HDDB7+JnT8E32DSQ0VCpj8dQGd/ODS2aS0ztESagW/W8Twnk 1AyDFfmqzZYlI6ykDMa7g2801wpsQcYc7hbtPnZBMa/ZQDD9LuRoJAllkEGpiUAE0VQhCYPwwq nDhG0AiNLJRPwZgtlq6V4zQFLESf6UzLmCLBTBUvEfv42mi1mqZgOppJNx2VJJYRBAGzInhuWs 16EUDJkT5j5OCWo1taGk4OAKAEdBDNZwDIQPBHMymRNMZCM2qLGSIA0iiie5VHqRrG2rzqJVEB xvs= Content-Type: multipart/mixed; boundary="------------z2Cb8jRQW6LfOzBqBCpKORuL" Message-ID: <3195cfa5-0612-5b52-4c24-9763c9a56864@codesourcery.com> Date: Sun, 18 Sep 2022 10:24:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 From: Marcel Vollweiler Subject: Re: [Patch] OpenMP, libgomp, gimple: omp_get_max_teams, omp_set_num_teams, and omp_{gs}et_teams_thread_limit on offload devices To: Jakub Jelinek CC: References: <94d20b62-d841-c4f0-f167-ed76a0b4dbfd@codesourcery.com> In-Reply-To: <94d20b62-d841-c4f0-f167-ed76a0b4dbfd@codesourcery.com> X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-15.mgc.mentorg.com (139.181.222.15) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-14.5 required=5.0 tests=BAYES_00,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,KAM_SHORT,NICE_REPLY_A,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --------------z2Cb8jRQW6LfOzBqBCpKORuL Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable Hi Jakub, The last version of this patch was slightly adapted to the latest changes o= f the device-specific environment variable syntax (https://gcc.gnu.org/pipermail/gcc-patches/2022-September/601145.html), als= o considering the latest related bug fixes (commits 994ea892bd02d and 7d37c7f= 67c1bb). The new patch version was bootstrapped and tested on x86_64-linux with nvpt= x and amdgcn offloading without regressions. Marcel ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955 --------------z2Cb8jRQW6LfOzBqBCpKORuL Content-Type: text/plain; charset="UTF-8"; name="teams_and_threads_on_device.diff" Content-Disposition: attachment; filename="teams_and_threads_on_device.diff" Content-Transfer-Encoding: base64 VGhpcyBwYXRjaCBhZGRzIHN1cHBvcnQgZm9yIG9tcF9nZXRfbWF4X3RlYW1zLCBvbXBfc2V0 X251bV90ZWFtcywgYW5kCm9tcF97Z3N9ZXRfdGVhbXNfdGhyZWFkX2xpbWl0IG9uIG9mZmxv YWQgZGV2aWNlcy4gVGhhdCBpbmNsdWRlcyB0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lYWRfbGltaXQpCit7CisgIGlmICh0aHJlYWRfbGlt aXQgPj0gMCkKKyAgICBHT01QX0FERElUSU9OQUxfSUNWUy50ZWFtc190aHJlYWRfbGltaXQg PSB0aHJlYWRfbGltaXQ7Cit9CisKIGlhbGlhcyAob21wX3NldF9kZWZhdWx0X2RldmljZSkK IGlhbGlhcyAob21wX2dldF9kZWZhdWx0X2RldmljZSkKIGlhbGlhcyAob21wX2dldF9pbml0 aWFsX2RldmljZSkKQEAgLTg5LDMgKzEwMiw1IEBAIGlhbGlhcyAob21wX2lzX2luaXRpYWxf ZGV2aWNlKQogaWFsaWFzIChvbXBfZ2V0X2RldmljZV9udW0pCiBpYWxpYXMgKG9tcF9nZXRf bWF4X3RlYW1zKQogaWFsaWFzIChvbXBfc2V0X251bV90ZWFtcykKK2lhbGlhcyAob21wX2dl dF90ZWFtc190aHJlYWRfbGltaXQpCitpYWxpYXMgKG9tcF9zZXRfdGVhbXNfdGhyZWFkX2xp bWl0KQpkaWZmIC0tZ2l0IGEvbGliZ29tcC9pY3YtZGV2aWNlLmMgYi9saWJnb21wL2ljdi1k ZXZpY2UuYwppbmRleCBkOGFjZjBlLi40ODYwN2NlIDEwMDY0NAotLS0gYS9saWJnb21wL2lj di1kZXZpY2UuYworKysgYi9saWJnb21wL2ljdi1kZXZpY2UuYwpAQCAtOTcsMyArOTcsMjAg QEAgb21wX3NldF9udW1fdGVhbXMgKGludCBudW1fdGVhbXMpCiB9CiAKIGlhbGlhcyAob21w X3NldF9udW1fdGVhbXMpCisKK2ludAorb21wX2dldF90ZWFtc190aHJlYWRfbGltaXQgKHZv aWQpCit7CisgIHJldHVybiBnb21wX3RlYW1zX3RocmVhZF9saW1pdF92YXI7Cit9CisKK2lh bGlhcyAob21wX2dldF90ZWFtc190aHJlYWRfbGltaXQpCisKK3ZvaWQKK29tcF9zZXRfdGVh bXNfdGhyZWFkX2xpbWl0IChpbnQgdGhyZWFkX2xpbWl0KQoreworICBpZiAodGhyZWFkX2xp b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F9uZXdfYXJncysrID0gKHZvaWQgKikgbmV3X3ZhbDsKKwkgICAgfQorCSAgZWxzZQor CSAgICB7CisJICAgICAgKnRtcF9uZXdfYXJncysrID0gKHZvaWQgKikgKEdPTVBfVEFSR0VU X0FSR19TVUJTRVFVRU5UX1BBUkFNCisJCQkJCSAgfCBHT01QX1RBUkdFVF9BUkdfTlVNX1RF QU1TKTsKKwkgICAgICAqdG1wX25ld19hcmdzKysgPSAodm9pZCAqKSBuZXdfdmFsOworCSAg ICB9CisJfQorCisgICAgICAvKiBBZGQgdGhlIG5ldyBUSFJFQURTIGFyZyB0byB0aGUgbmV3 IGFyZ3MgbGlzdCBpZiBpdCBoYXMgYmVlbiBjaGFuZ2VkLiAqLworICAgICAgaWYgKG9yaWdf dGhyZWFkcyAhPSBuZXdfdGhyZWFkcykKKwl7CisJICBpbnRwdHJfdCBuZXdfdmFsID0gbmV3 X3RocmVhZHM7CisJICBpZiAodGhzX2xlbiA9PSAxKQorCSAgICB7CisJICAgICAgbmV3X3Zh bCA9IChuZXdfdmFsIDw8IEdPTVBfVEFSR0VUX0FSR19WQUxVRV9TSElGVCkKKwkJCSB8IEdP TVBfVEFSR0VUX0FSR19USFJFQURfTElNSVQ7CisJICAgICAgKnRtcF9uZXdfYXJncysrID0g KHZvaWQgKikgbmV3X3ZhbDsKKwkgICAgfQorCSAgZWxzZQorCSAgICB7CisJICAgICAgKnRt cF9uZXdfYXJncysrID0gKHZvaWQgKikgKEdPTVBfVEFSR0VUX0FSR19TVUJTRVFVRU5UX1BB UkFNCisJCQkJCSAgfCBHT01QX1RBUkdFVF9BUkdfVEhSRUFEX0xJTUlUKTsKKwkgICAgICAq dG1wX25ld19hcmdzKysgPSAodm9pZCAqKSBuZXdfdmFsOworCSAgICB9CisJfQorCisgICAg ICAqdG1wX25ld19hcmdzID0gTlVMTDsKKyAgICB9CisKICAgZmxhZ3MgPSBjbGVhcl91bnN1 cHBvcnRlZF9mbGFncyAoZGV2aWNlcCwgZmxhZ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gICAgICBhYm9y dCAoKTsKKyAgfQorCisgICNwcmFnbWEgb21wIHRlYW1zIG51bV90ZWFtcygzKSB0aHJlYWRf bGltaXQoMikKKyAgeworICAgIGlmIChvbXBfZ2V0X251bV90ZWFtcyAoKSAhPSAzCisJfHwg b21wX2dldF90ZWFtX251bSAoKSA+PSAzKQorICAgIGFib3J0ICgpOworICAgICNwcmFnbWEg b21wIHBhcmFsbGVsCisgICAgaWYgKG9tcF9nZXRfdGhyZWFkX2xpbWl0ICgpID4gMgorCXx8 IG9tcF9nZXRfdGhyZWFkX251bSAoKSA+PSAyKQorICAgICAgYWJvcnQgKCk7CisgIH0KKwor ICAjcHJhZ21hIG9tcCB0ZWFtcyBudW1fdGVhbXMoNSkgdGhyZWFkX2xpbWl0KDQpCisgIHsK KyAgICBpZiAob21wX2dldF9udW1fdGVhbXMgKCkgIT0gNQorCXx8IG9tcF9nZXRfdGVhbV9u dW0gKCkgPj0gNSkKKyAgICBhYm9ydCAoKTsKKyAgICAjcHJhZ21hIG9tcCBwYXJhbGxlbAor ICAgIGlmIChvbXBfZ2V0X3RocmVhZF9saW1pdCAoKSA+IDQKKwl8fCBvbXBfZ2V0X3RocmVh ZF9udW0gKCkgPj0gNCkKKyAgICAgIGFib3J0ICgpOworICB9CisKICAgaW50IG51bV9kZXZp Y2VzID0gb21wX2dldF9udW1fZGV2aWNlcyAoKSA+IDMgPyAzIDogb21wX2dldF9udW1fZGV2 aWNlcyAoKTsKLSAgZm9yIChpbnQgaT0wOyBpIDwgbnVtX2RldmljZXM7IGkrKykKLSAgICAj cHJhZ21hIG9tcCB0YXJnZXQgZGV2aWNlIChpKQotICAgICAgaWYgKG9tcF9nZXRfbWF4X3Rl YW1zICgpICE9IDQyICsgaSkKKworICBmb3IgKGludCBpID0gMDsgaSA8IG51bV9kZXZpY2Vz OyBpKyspCisgICAgeworICAgICAgI3ByYWdtYSBvbXAgdGFyZ2V0IGRldmljZSAoaSkKKyAg ICAgIGlmIChvbXBfZ2V0X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vbXAgdGVhbXMKKyAgICAgIHsKKwlpZiAob21wX2dldF9udW1fdGVhbXMgKCkg PiA0CisJICAgIHx8IG9tcF9nZXRfdGVhbV9udW0gKCkgPj0gNCkKKwkgIGFib3J0ICgpOwor CSNwcmFnbWEgb21wIHBhcmFsbGVsCisJaWYgKG9tcF9nZXRfdGhyZWFkX2xpbWl0ICgpID4g MworCSAgICB8fCBvbXBfZ2V0X3RocmVhZF9udW0gKCkgPj0gMykKKwkgIGFib3J0ICgpOwor ICAgICAgfQorCisgICAgICAjcHJhZ21hIG9tcCB0YXJnZXQgZGV2aWNlIChpKQorICAgICAg eworCW9tcF9zZXRfbnVtX3RlYW1zICgzICsgaSk7CisJb21wX3NldF90ZWFtc190aHJlYWRf bGltaXQgKDIgKyBpKTsKKwlpZiAob21wX2dldF9tYXhfdGVhbXMgKCkgIT0gMyArIGkKKwkg ICAgfHwgb21wX2dldF90ZWFtc190aHJlYWRfbGltaXQgKCkgIT0gMiArIGkpCisJICBhYm9y dCAoKTsKKyAgICAgIH0KKworICAgICAvKiBvbXBfc2V0X251bV90ZWFtcyBhYm92ZSBzZXQg dGhlIHZhbHVlIG9mIG50ZWFtcy12YXIgSUNWIG9uIGRldmljZSAnaScsCisJIHdoaWNoIGhh cyBzY29wZSAnZGV2aWNlJyBhbmQgc2hvdWxkIGJlIGF2YWlibGUgaW4gc3Vic2VxdWVudCB0 YXJnZXQKKwkgcmVnaW9ucy4gICovCisgICAgICAjcHJhZ21hIG9tcCB0YXJnZXQgZGV2aWNl IChpKQorICAgICAgaWYgKG9tcF9nZXRfbWF4X3RlYW1zICgpICE9IDMgKyBpCisJICB8fCBv bXBfZ2V0X3RlYW1zX3RocmVhZF9saW1pdCAoKSAhPSAyICsgaSkKKwlhYm9ydCAoKTsKKwor ICAgICAgI3ByYWdtYSBvbXAgdGFyZ2V0IGRldmljZSAoaSkKKyAgICAgICNwcmFnbWEgb21w IHRlYW1zCisgICAgICB7CisJaWYgKG9tcF9nZXRfbnVtX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oIk9NUF9OVU1fVEVBTVNfREVWIikgfHwgZ2V0ZW52ICgiT01QX1RF QU1TX1RIUkVBRF9MSU1JVF9ERVYiKSkKKyAgICByZXR1cm4gMDsKKwogICBpbnQgbnVtX2Rl dmljZXMgPSBvbXBfZ2V0X251bV9kZXZpY2VzICgpID4gMyA/IDMgOiBvbXBfZ2V0X251bV9k ZXZpY2VzICgpOwotICBmb3IgKGludCBpPTA7IGkgPCBudW1fZGV2aWNlczsgaSsrKQotICAg ICNwcmFnbWEgb21wIHRhcmdldCBkZXZpY2UgKGkpCi0gICAgICBpZiAob21wX2dldF9tYXhf dGVhbXMgKCkgIT0gNDIpCisgIGZvciAoaW50IGkgPSAwOyBpIDwgbnVtX2RldmljZXM7IGkr KykKKyAgICB7CisgICAgICBjaGFyIG50ZWFtc1tzaXplb2YgKCJPTVBfTlVNX1RFQU1TX0RF Vl8xIildOworICAgICAgc3RyY3B5IChudGVhbXMsICJPTVBfTlVNX1RFQU1TX0RFVl8xIik7 CisgICAgICBudGVhbXNbc2l6ZW9mICgiT01QX05VTV9URUFNU19ERVZfMSIpIC0gMl0gPSAn MCcgKyBpOworICAgICAgY2hhciB0ZWFtc190aHJlYWRfbGltaXRbc2l6ZW9mICgiT01QX1RF QU1TX1RIUkVBRF9MSU1JVF9ERVZfMSIpXTsKKyAgICAgIHN0cmNweSAodGVhbXNfdGhyZWFk X2xpbWl0LCAiT01QX1RFQU1TX1RIUkVBRF9MSU1JVF9ERVZfMSIpOworICAgICAgdGVhbXNf dGhyZWFkX2xpbWl0W3NpemVvZiAoIk9NUF9URUFNU19USFJFQURfTElNSVRfREVWXzEiKSAt IDJdID0gJzAnICsgaTsKKyAgICAgIGlmIChnZXRlbnYgKG50ZWFtcykgfHwgZ2V0ZW52ICh0 ZWFtc190aHJlYWRfbGltaXQpKQorCWNvbnRpbnVlOworCisgICAgICAjcHJhZ21hIG9tcCB0 YXJnZXQgZGV2aWNlIChpKQorICAgICAgaWYgKG9tcF9nZXRfbWF4X3RlYW1zICgpICE9IDcK KwkgIHx8IG9tcF9nZXRfdGVhbXNfdGhyZWFkX2xpbWl0ICgpICE9IDIpCisJYWJvcnQgKCk7 CisKKyAgICAgICNwcmFnbWEgb21wIHRhcmdldCBkZXZpY2UgKGkpCisgICAgICAjcHJhZ21h IG9tcCB0ZWFtcworICAgICAgaWYgKG9tcF9nZXRfbnVtX3RlYW1zICgpID4gNworCSAgfHwg b21wX2dldF90ZWFtX251bSAoKSA+PSA3KQorCWFib3J0ICgpOworCisgICAgICAjcHJhZ21h IG9tcCB0YXJnZXQgZGV2aWNlIChpKQorICAgICAgeworCW9tcF9zZXRfbnVtX3RlYW1zICg4 ICsgaSk7CisJb21wX3NldF90ZWFtc190aHJlYWRfbGltaXQgKDQgKyBpKTsKKwlpZiAob21w X2dldF9tYXhfdGVhbXMgKCkgIT0gOCArIGkKKwkgICAgfHwgb21wX2dldF90ZWFtc190aHJl YWRfbGltaXQgKCkgIT0gNCArIGkpCisJICBhYm9ydCAoKTsKKyAgICAgIH0KKworICAgICAv KiBvbXBfc2V0X251bV90ZWFtcyBhYm92ZSBzZXQgdGhlIHZhbHVlIG9mIG50ZWFtcy12YXIg SUNWIG9uIGRldmljZSAnaScsCisJIHdoaWNoIGhhcyBzY29wZSAnZGV2aWNlJyBhbmQgc2hv dWxkIGJlIGF2YWlibGUgaW4gc3Vic2VxdWVudCB0YXJnZXQKKwkgcmVnaW9ucy4gICovCisg ICAgICAjcHJhZ21hIG9tcCB0YXJnZXQgZGV2aWNlIChpKQorICAgICAgaWYgKG9tcF9nZXRf bWF4X3RlYW1zICgpICE9IDggKyBpCisJICB8fCBvbXBfZ2V0X3RlYW1zX3RocmVhZF9saW1p dCAoKSAhPSA0ICsgaSkKKwlhYm9ydCAoKTsKKworICAgICAgI3ByYWdtYSBvbXAgdGFyZ2V0 IGRldmljZSAoaSkKKyAgICAgICNwcmFnbWEgb21wIHRlYW1zCisgICAgICBpZiAob21wX2dl dF9udW1fdGVhbXMgKCkg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WYgKG9tcF9nZXRfbWF4X3RlYW1zICgpICE9IDkK KyAgICAgIHx8IG9tcF9nZXRfdGVhbXNfdGhyZWFkX2xpbWl0ICgpICE9IDIpCisgICAgYWJv cnQgKCk7CisKKyAgI3ByYWdtYSBvbXAgdGVhbXMKKyAgaWYgKG9tcF9nZXRfbnVtX3RlYW1z ICgpID4gOQorICAgICAgfHwgb21wX2dldF90ZWFtX251bSAoKSA+PSA5KQorICAgIGFib3J0 ICgpOworCisgICNwcmFnbWEgb21wIHRlYW1zIG51bV90ZWFtcyg1KQorICBpZiAob21wX2dl dF9udW1fdGVhbXMgKCkgPiA1CisgICAgICB8fCBvbXBfZ2V0X3RlYW1fbnVtICgpID49IDUp CisgICAgYWJvcnQgKCk7CisKKyAgaW50IG51bV9kZXZpY2VzID0gb21wX2dldF9udW1fZGV2 aWNlcyAoKSA+IDMgPyAzIDogb21wX2dldF9udW1fZGV2aWNlcyAoKTsKKyAgZm9yIChpbnQg aSA9IDA7IGkgPCBudW1fZGV2aWNlczsgaSsrKQorICAgIHsKKyAgICAgICNwcmFnbWEgb21w IHRhcmdldCBkZXZpY2UgKGkpCisgICAgICBpZiAob21wX2dldF9tYXhfdGVhbXMgKCkgIT0g MAorCSAgfHwgb21wX2dldF90ZWFtc190aHJlYWRfbGltaXQgKCkgIT0gMCkKKwlhYm9ydCAo KTsKKworICAgICAgI3ByYWdtYSBvbXAgdGFyZ2V0IGRldmljZSAoaSkKKyAgICAgIHsKKwlv bXBfc2V0X251bV90ZWFtcyAoOCArIGkpOworCW9tcF9zZXRfdGVhbXNfdGhyZWFkX2xpbWl0 ICgzICsgaSk7CisJaWYgKG9tcF9nZXRfbWF4X3RlYW1zICgpICE9IDggKyBpCisJICAgIHx8 IG9tcF9nZXRfdGVhbXNfdGhyZWFkX2xpbWl0ICgpICE9IDMgKyBpKQorCSAgYWJvcnQgKCk7 CisgICAgICB9CisKKyAgICAgLyogb21wX3NldF9udW1fdGVhbXMgYWJvdmUgc2V0IHRoZ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bmRleCAwMDAwMDAwLi4wNWEzNWZhCi0tLSAvZGV2L251bGwKKysrIGIvbGliZ29t cC90ZXN0c3VpdGUvbGliZ29tcC5mb3J0cmFuL2ljdi01LmY5MApAQCAtMCwwICsxLDIyNiBA QAorISB7IGRnLXNldC10YXJnZXQtZW52LXZhciBPTVBfTlVNX1RFQU1TX0FMTCAiMyIgfQor ISB7IGRnLXNldC10YXJnZXQtZW52LXZhciBPTVBfTlVNX1RFQU1TX0RFViAiNCIgfQorISB7 IGRnLXNldC10YXJnZXQtZW52LXZhciBPTVBfTlVNX1RFQU1TICI1IiB9CishIHsgZGctc2V0 LXRhcmdldC1lbnYtdmFyIE9NUF9OVU1fVEVBTVNfREVWXzAgIjYiIH0KKyEgeyBkZy1zZXQt dGFyZ2V0LWVudi12YXIgT01QX05VTV9URUFNU19ERVZfMSAiNyIgfQorISB7IGRnLXNldC10 YXJnZXQtZW52LXZhciBPTVBfTlVNX1RFQU1TX0RFVl8yICI4IiB9CishIHsgZGctc2V0LXRh cmdldC1lbnYtdmFyIE9NUF9URUFNU19USFJFQURfTElNSVRfQUxMICIyIiB9CishIHsgZGct c2V0LXRhcmdldC1lbnYtdmFyIE9NUF9URUFNU19USFJFQURfTElNSVRfREVWICIzIiB9Cish IHsgZGctc2V0LXRhcmdldC1lbnYtdmFyIE9NUF9URUFNU19USFJFQURfTElNSVQgIjQiIH0K KyEgeyBkZy1zZXQtdGFyZ2V0LWVudi12YXIgT01QX1RFQU1TX1RIUkVBRF9MSU1JVF9ERVZf MCAiNSIgfQorISB7IGRnLXNldC10YXJnZXQtZW52LXZhciBPTVBfVEVBTVNfVEhSRUFEX0xJ TUlUX0RFVl8xICI2IiB9CishIHsgZGctc2V0LXRhcmdldC1lbnYtdmFyIE9NUF9URUFNU19U SFJFQURfTElNSVRfREVWXzIgIjciIH0KKwordXNlIG9tcF9saWIKK2ltcGxpY2l0IG5vbmUg KHR5cGUsIGV4dGVybmFsKQorICBpbnRlZ2VyIDo6IG51bV9kZXZpY2VzLCBpLCBsYXJnZV9u dW1fdGVhbXMsIGxhcmdlX3RocmVhZHNfbGltaXQKKyAgbG9naWNhbCA6OiBlcnIKKworICBp ZiAob21wX2dldF9udW1fZGV2aWNlcyAoKSA+IDMpIHRoZW4KKyAgICBudW1fZGV2aWNlcyA9 IDMKKyAgZWxzZQorICAgIG51bV9kZXZpY2VzID0gb21wX2dldF9udW1fZGV2aWNlcyAoKQor ICBlbmQgaWYKKworICBkbyBpPTAsbnVtX2RldmljZXMtMQorCisgICAgISBUZXN0aW5nIE5V TV9URUFNUy4KKyAgICBpZiAoZW52X2lzX3NldF9kZXYgKCJPTVBfTlVNX1RFQU1TX0RFVl8i LCBpLCA2ICsgaSkpIHRoZW4KKyAgICAgIGVyciA9IC5mYWxzZS4KKyAgICAgICEkb21wIHRh cmdldCBkZXZpY2UoaSkgbWFwKHRvZnJvbTogZXJyKQorICAgICAgaWYgKG9tcF9nZXRfbWF4 X3RlYW1zICgpIC89IDYgKyBpKSBlcnIgPSAudHJ1ZS4KKyAgICAgICEkb21wIGVuZCB0YXJn ZXQKKyAgICAgIGlmIChlcnIpIHN0b3AgMQorCisgICAgICBlcnIgPSAuZmFsc2UuCisgICAg ICAhJG9tcCB0YXJnZXQgZGV2aWNlKGkpIG1hcCh0b2Zyb206IGVycikKKyAgICAgICEkb21w IHRlYW1zCisgICAgICBpZiAob21wX2dldF9udW1fdGVhbXMgKCkgPiA2ICsgaSAub3IuIG9t cF9nZXRfdGVhbV9udW0gKCkgPj0gNiArIGkpICYKKyAgICAgICAgZXJyID0gLnRydWUuCisg ICAgICAhJG9tcCBlbmQgdGVhbXMKKyAgICAgICEkb21wIGVuZCB0YXJnZXQKKyAgICAgIGlm IChlcnIpIHN0b3AgMgorCisgICAgICBlcnIgPSAuZmFsc2UuCisgICAgICAhJG9tcCB0YXJn ZXQgZGV2aWNlKGkpIG1hcCh0b2Zyb206IGVycikKKyAgICAgIGNhbGwgb21wX3NldF9udW1f dGVhbXMgKDUgKyBpKQorICAgICAgaWYgKG9tcF9nZXRfbWF4X3RlYW1zICgpIC89IDUgKyBp KSBlcnIgPSAudHJ1ZS4KKyAgICAgICEkb21wIGVuZCB0YXJnZXQKKyAgICAgIGlmIChlcnIp IHN0b3AgMworCisgICAgICBlcnIgPSAuZmFsc2UuCisgICAgICAhJG9tcCB0YXJnZXQgZGV2 aWNlKGkpIG1hcCh0b2Zyb206IGVycikKKyAgICAgIGlmIChvbXBfZ2V0X21heF90ZWFtcyAo KSAvPSA1ICsgaSkgZXJyID0gLnRydWUuCisgICAgICAhJG9tcCBlbmQgdGFyZ2V0CisgICAg ICBpZiAoZXJyKSBzdG9wIDQKKworICAgICAgZXJyID0gLmZhbHNlLgorICAgICAgISRvbXAg dGFyZ2V0IGRldmljZShpKSBtYXAodG9mcm9tOiBlcnIpCisgICAgICAhJG9tcCB0ZWFtcwor ICAgICAgaWYgKG9tcF9nZXRfbnVtX3RlYW1zICgpID4gNSArIGkgLm9yLiBvbXBfZ2V0X3Rl YW1fbnVtICgpID49IDUgKyBpKSAmCisgICAgICAgIGVyciA9IC50cnVlLgorICAgICAgISRv bXAgZW5kIHRlYW1zCisgICAgICAhJG9tcCBlbmQgdGFyZ2V0CisgICAgICBpZiAoZXJyKSBz dG9wIDUKKworICAgICAgZXJyID0gLmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0IGRldmlj ZShpKSBtYXAodG9mcm9tOiBlcnIpCisgICAgICAhJG9tcCB0ZWFtcyBudW1fdGVhbXMoNiAr IGkpCisgICAgICBpZiAob21wX2dldF9udW1fdGVhbXMgKCkgPiA2ICsgaSAub3IuIG9tcF9n ZXRfdGVhbV9udW0gKCkgPj0gNiArIGkpICYKKyAgICAgICAgZXJyID0gLnRydWUuCisgICAg ICAhJG9tcCBlbmQgdGVhbXMKKyAgICAgICEkb21wIGVuZCB0YXJnZXQKKyAgICAgIGlmIChl cnIpIHN0b3AgNgorCisgICAgICBlcnIgPSAuZmFsc2UuCisgICAgICAhJG9tcCB0YXJnZXQg ZGV2aWNlKGkpIG1hcCh0b2Zyb206IGVycikKKyAgICAgICEkb21wIHRlYW1zIG51bV90ZWFt cyg0ICsgaSkKKyAgICAgIGlmIChvbXBfZ2V0X251bV90ZWFtcyAoKSA+IDQgKyBpIC5vci4g b21wX2dldF90ZWFtX251bSAoKSA+PSA0ICsgaSkgJgorICAgICAgICBlcnIgPSAudHJ1ZS4K KyAgICAgICEkb21wIGVuZCB0ZWFtcworICAgICAgISRvbXAgZW5kIHRhcmdldAorICAgICAg aWYgKGVycikgc3RvcCA3CisKKyAgICAgIGxhcmdlX251bV90ZWFtcyA9IDY2MDAwCisgICAg ICBlcnIgPSAuZmFsc2UuCisgICAgICAhJG9tcCB0YXJnZXQgZGV2aWNlKGkpIG1hcCh0b2Zy b206IGVycikKKyAgICAgIGNhbGwgb21wX3NldF9udW1fdGVhbXMgKGxhcmdlX251bV90ZWFt cyArIGkpCisgICAgICBpZiAob21wX2dldF9tYXhfdGVhbXMgKCkgLz0gbGFyZ2VfbnVtX3Rl YW1zICsgaSkgZXJyID0gLnRydWUuCisgICAgICAhJG9tcCBlbmQgdGFyZ2V0CisgICAgICBp ZiAoZXJyKSBzdG9wIDgKKworICAgICAgZXJyID0gLmZhbHNlLgorICAgICAgISRvbXAgdGFy Z2V0IGRldmljZShpKSBtYXAodG9mcm9tOiBlcnIpCisgICAgICBpZiAob21wX2dldF9tYXhf dGVhbXMgKCkgLz0gbGFyZ2VfbnVtX3RlYW1zICsgaSkgZXJyID0gLnRydWUuCisgICAgICAh JG9tcCBlbmQgdGFyZ2V0CisgICAgICBpZiAoZXJyKSBzdG9wIDkKKworICAgICAgZXJyID0g LmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0IGRldmljZShpKSBtYXAodG9mcm9tOiBlcnIp CisgICAgICAhJG9tcCB0ZWFtcworICAgICAgaWYgKG9tcF9nZXRfbnVtX3RlYW1zICgpID4g bGFyZ2VfbnVtX3RlYW1zICsgaSAmCisgICAgICAgICAgLm9yLiBvbXBfZ2V0X3RlYW1fbnVt ICgpID49IGxhcmdlX251bV90ZWFtcyArIGkpIGVyciA9IC50cnVlLgorICAgICAgISRvbXAg ZW5kIHRlYW1zCisgICAgICAhJG9tcCBlbmQgdGFyZ2V0CisgICAgICBpZiAoZXJyKSBzdG9w IDEwCisgICAgZW5kIGlmCisKKyAgICAhIFRlc3RpbmcgVEVBTVMtVEhSRUFELUxJTUlUCisg ICAgaWYgKGVudl9pc19zZXRfZGV2ICgiT01QX1RFQU1TX1RIUkVBRF9MSU1JVF9ERVZfIiwg aSwgNSArIGkpKSB0aGVuCisgICAgICBlcnIgPSAuZmFsc2UuCisgICAgICAhJG9tcCB0YXJn ZXQgZGV2aWNlKGkpIG1hcCh0b2Zyb206IGVycikKKyAgICAgIGlmIChvbXBfZ2V0X3RlYW1z X3RocmVhZF9saW1pdCAoKSAvPSA1ICsgaSkgZXJyID0gLnRydWUuCisgICAgICAhJG9tcCBl bmQgdGFyZ2V0CisgICAgICBpZiAoZXJyKSBzdG9wIDExCisKKyAgICAgIGVyciA9IC5mYWxz ZS4KKyAgICAgICEkb21wIHRhcmdldCBkZXZpY2UoaSkgbWFwKHRvZnJvbTogZXJyKQorICAg ICAgISRvbXAgdGVhbXMKKyAgICAgICEkb21wIHBhcmFsbGVsCisgICAgICBpZiAob21wX2dl dF90aHJlYWRfbGltaXQgKCkgPiA1ICsgaSAub3IuIG9tcF9nZXRfdGhyZWFkX251bSAoKSA+ PSA1ICsgaSkgJgorICAgICAgICBlcnIgPSAudHJ1ZS4KKyAgICAgICEkb21wIGVuZCBwYXJh bGxlbAorICAgICAgISRvbXAgZW5kIHRlYW1zCisgICAgICAhJG9tcCBlbmQgdGFyZ2V0Cisg ICAgICBpZiAoZXJyKSBzdG9wIDEyCisKKyAgICAgIGVyciA9IC5mYWxzZS4KKyAgICAgICEk b21wIHRhcmdldCBkZXZpY2UoaSkgbWFwKHRvZnJvbTogZXJyKQorICAgICAgY2FsbCBvbXBf c2V0X3RlYW1zX3RocmVhZF9saW1pdCAoNCArIGkpCisgICAgICBpZiAob21wX2dldF90ZWFt c190aHJlYWRfbGltaXQgKCkgLz0gNCArIGkpIGVyciA9IC50cnVlLgorICAgICAgISRvbXAg ZW5kIHRhcmdldAorICAgICAgaWYgKGVycikgc3RvcCAxMworCisgICAgICBlcnIgPSAuZmFs c2UuCisgICAgICAhJG9tcCB0YXJnZXQgZGV2aWNlKGkpIG1hcCh0b2Zyb206IGVycikKKyAg ICAgIGlmIChvbXBfZ2V0X3RlYW1zX3RocmVhZF9saW1pdCAoKSAvPSA0ICsgaSkgZXJyID0g LnRydWUuCisgICAgICAhJG9tcCBlbmQgdGFyZ2V0CisgICAgICBpZiAoZXJyKSBzdG9wIDE0 CisKKyAgICAgIGVyciA9IC5mYWxzZS4KKyAgICAgICEkb21wIHRhcmdldCBkZXZpY2UoaSkg bWFwKHRvZnJvbTogZXJyKQorICAgICAgISRvbXAgdGVhbXMKKyAgICAgICEkb21wIHBhcmFs bGVsCisgICAgICBpZiAob21wX2dldF90aHJlYWRfbGltaXQgKCkgPiA0ICsgaSAub3IuIG9t cF9nZXRfdGhyZWFkX251bSAoKSA+PSA0ICsgaSkgJgorICAgICAgICBlcnIgPSAudHJ1ZS4K KyAgICAgICEkb21wIGVuZCBwYXJhbGxlbAorICAgICAgISRvbXAgZW5kIHRlYW1zCisgICAg ICAhJG9tcCBlbmQgdGFyZ2V0CisgICAgICBpZiAoZXJyKSBzdG9wIDE1CisKKyAgICAgIGVy ciA9IC5mYWxzZS4KKyAgICAgICEkb21wIHRhcmdldCBkZXZpY2UoaSkgbWFwKHRvZnJvbTog ZXJyKQorICAgICAgISRvbXAgdGVhbXMgdGhyZWFkX2xpbWl0KDUgKyBpKQorICAgICAgISRv bXAgcGFyYWxsZWwKKyAgICAgIGlmIChvbXBfZ2V0X3RocmVhZF9saW1pdCAoKSA+IDUgKyBp IC5vci4gb21wX2dldF90aHJlYWRfbnVtICgpID49IDUgKyBpKSAmCisgICAgICAgIGVyciA9 IC50cnVlLgorICAgICAgISRvbXAgZW5kIHBhcmFsbGVsCisgICAgICAhJG9tcCBlbmQgdGVh bXMKKyAgICAgICEkb21wIGVuZCB0YXJnZXQKKyAgICAgIGlmIChlcnIpIHN0b3AgMTYKKwor ICAgICAgZXJyID0gLmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0IGRldmljZShpKSBtYXAo dG9mcm9tOiBlcnIpCisgICAgICAhJG9tcCB0ZWFtcyB0aHJlYWRfbGltaXQoMyArIGkpCisg ICAgICAhJG9tcCBwYXJhbGxlbAorICAgICAgaWYgKG9tcF9nZXRfdGhyZWFkX2xpbWl0ICgp ID4gMyArIGkgLm9yLiBvbXBfZ2V0X3RocmVhZF9udW0gKCkgPj0gMyArIGkpICYKKyAgICAg ICAgZXJyID0gLnRydWUuCisgICAgICAhJG9tcCBlbmQgcGFyYWxsZWwKKyAgICAgICEkb21w IGVuZCB0ZWFtcworICAgICAgISRvbXAgZW5kIHRhcmdldAorICAgICAgaWYgKGVycikgc3Rv cCAxNworCisgICAgICBsYXJnZV90aHJlYWRzX2xpbWl0ID0gNjcwMDAKKyAgICAgIGVyciA9 IC5mYWxzZS4KKyAgICAgICEkb21wIHRhcmdldCBkZXZpY2UoaSkgbWFwKHRvZnJvbTogZXJy KQorICAgICAgY2FsbCBvbXBfc2V0X3RlYW1zX3RocmVhZF9saW1pdCAobGFyZ2VfdGhyZWFk c19saW1pdCArIGkpCisgICAgICBpZiAob21wX2dldF90ZWFtc190aHJlYWRfbGltaXQgKCkg Lz0gbGFyZ2VfdGhyZWFkc19saW1pdCArIGkpIGVyciA9IC50cnVlLgorICAgICAgISRvbXAg ZW5kIHRhcmdldAorICAgICAgaWYgKGVycikgc3RvcCAxOAorCisgICAgICBlcnIgPSAuZmFs c2UuCisgICAgICAhJG9tcCB0YXJnZXQgZGV2aWNlKGkpIG1hcCh0b2Zyb206IGVycikKKyAg ICAgIGlmIChvbXBfZ2V0X3RlYW1zX3RocmVhZF9saW1pdCAoKSAvPSBsYXJnZV90aHJlYWRz X2xpbWl0ICsgaSkgZXJyID0gLnRydWUuCisgICAgICAhJG9tcCBlbmQgdGFyZ2V0CisgICAg ICBpZiAoZXJyKSBzdG9wIDE5CisKKyAgICAgIGVyciA9IC5mYWxzZS4KKyAgICAgICEkb21w IHRhcmdldCBkZXZpY2UoaSkgbWFwKHRvZnJvbTogZXJyKQorICAgICAgISRvbXAgdGVhbXMK KyAgICAgICEkb21wIHBhcmFsbGVsCisgICAgICBpZiAob21wX2dldF90aHJlYWRfbGltaXQg KCkgPiBsYXJnZV90aHJlYWRzX2xpbWl0ICsgaSAmCisgICAgICAgICAgLm9yLiBvbXBfZ2V0 X3RocmVhZF9udW0gKCkgPj0gbGFyZ2VfdGhyZWFkc19saW1pdCArIGkpIGVyciA9IC50cnVl LgorICAgICAgISRvbXAgZW5kIHBhcmFsbGVsCisgICAgICAhJG9tcCBlbmQgdGVhbXMKKyAg ICAgICEkb21wIGVuZCB0YXJnZXQKKyAgICAgIGlmIChlcnIpIHN0b3AgMjAKKyAgICBlbmQg aWYKKworICBlbmQgZG8KKworY29udGFpbnMKKyAgbG9naWNhbCBmdW5jdGlvbiBlbnZfaXNf c2V0IChuYW1lLCB2YWwpCisgICAgY2hhcmFjdGVyKGxlbj0qKSA6OiBuYW1lLCB2YWwKKyAg ICBjaGFyYWN0ZXIobGVuPTQwKSA6OiB2YWwyCisgICAgaW50ZWdlciA6OiBzdGF0CisgICAg Y2FsbCBnZXRfZW52aXJvbm1lbnRfdmFyaWFibGUgKG5hbWUsIHZhbDIsIHN0YXR1cz1zdGF0 KQorICAgIGlmIChzdGF0ID09IDApIHRoZW4KKyAgICAgIGlmICh2YWwgPT0gdmFsMikgdGhl bgorICAgICAgICBlbnZfaXNfc2V0ID0gLnRydWUuCisgICAgICAgIHJldHVybgorICAgICAg ZW5kIGlmCisgICAgZWxzZSBpZiAoc3RhdCAvPSAxKSB0aGVuCisgICAgICBlcnJvciBzd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Aoc3RhdCAvPSAxKSByZXR1cm4KKyAgY2FsbCBn ZXRfZW52aXJvbm1lbnRfdmFyaWFibGUgKCJPTVBfVEVBTVNfVEhSRUFEX0xJTUlUX0RFVl8x IiwgdmFsLCBzdGF0dXM9c3RhdCkKKyAgaWYgKHN0YXQgLz0gMSkgcmV0dXJuCisgIGNhbGwg Z2V0X2Vudmlyb25tZW50X3ZhcmlhYmxlICgiT01QX1RFQU1TX1RIUkVBRF9MSU1JVF9ERVZf MiIsIHZhbCwgc3RhdHVzPXN0YXQpCisgIGlmIChzdGF0IC89IDEpIHJldHVybgorCisgIGlm IChvbXBfZ2V0X251bV9kZXZpY2VzICgpID4gMykgdGhlbgorICAgIG51bV9kZXZpY2VzID0g MworICBlbHNlCisgICAgbnVtX2RldmljZXMgPSBvbXBfZ2V0X251bV9kZXZpY2VzICgpCisg IGVuZCBpZgorCisgIGRvIGk9MCxudW1fZGV2aWNlcy0xCisKKyAgICAhIFRlc3RpbmcgTlVN X1RFQU1TLgorICAgIGlmIChlbnZfaXNfc2V0ICgiT01QX05VTV9URUFNU19ERVYiLCAiNCIp KSB0aGVuCisgICAgICBlcnIgPSAuZmFsc2UuCisgICAgICAhJG9tcCB0YXJnZXQgZGV2aWNl KGkpIG1hcCh0b2Zyb206IGVycikKKyAgICAgIGlmIChvbXBfZ2V0X21heF90ZWFtcyAoKSAv PSA0KSBlcnIgPSAudHJ1ZS4KKyAgICAgICEkb21wIGVuZCB0YXJnZXQKKyAgICAgIGlmIChl cnIpIHN0b3AgMQorCisgICAgICBlcnIgPSAuZmFsc2UuCisgICAgICAhJG9tcCB0YXJnZXQg ZGV2aWNlKGkpIG1hcCh0b2Zyb206IGVycikKKyAgICAgICEkb21wIHRlYW1zCisgICAgICBp ZiAob21wX2dldF9udW1fdGVhbXMgKCkgPiA0IC5vci4gb21wX2dldF90ZWFtX251bSAoKSA+ PSA0KSAmCisgICAgICAgIGVyciA9IC50cnVlLgorICAgICAgISRvbXAgZW5kIHRlYW1zCisg ICAgICAhJG9tcCBlbmQgdGFyZ2V0CisgICAgICBpZiAoZXJyKSBzdG9wIDIKKworICAgICAg ZXJyID0gLmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0IGRldmljZShpKSBtYXAodG9mcm9t OiBlcnIpCisgICAgICBjYWxsIG9tcF9zZXRfbnVtX3RlYW1zICgzICsgaSkKKyAgICAgIGlm IChvbXBfZ2V0X21heF90ZWFtcyAoKSAvPSAzICsgaSkgZXJyID0gLnRydWUuCisgICAgICAh JG9tcCBlbmQgdGFyZ2V0CisgICAgICBpZiAoZXJyKSBzdG9wIDMKKworICAgICAgZXJyID0g LmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0IGRldmljZShpKSBtYXAodG9mcm9tOiBlcnIp CisgICAgICBpZiAob21wX2dldF9tYXhfdGVhbXMgKCkgLz0gMyArIGkpIGVyciA9IC50cnVl LgorICAgICAgISRvbXAgZW5kIHRhcmdldAorICAgICAgaWYgKGVycikgc3RvcCA0CisKKyAg ICAgIGVyciA9IC5mYWxzZS4KKyAgICAgICEkb21wIHRhcmdldCBkZXZpY2UoaSkgbWFwKHRv ZnJvbTogZXJyKQorICAgICAgISRvbXAgdGVhbXMKKyAgICAgIGlmIChvbXBfZ2V0X251bV90 ZWFtcyAoKSA+IDMgKyBpIC5vci4gb21wX2dldF90ZWFtX251bSAoKSA+PSAzICsgaSkgJgor ICAgICAgICBlcnIgPSAudHJ1ZS4KKyAgICAgICEkb21wIGVuZCB0ZWFtcworICAgICAgISRv bXAgZW5kIHRhcmdldAorICAgICAgaWYgKGVycikgc3RvcCA1CisgICAgZW5kIGlmCisKKyAg ICAhIFRlc3RpbmcgVEVBTVMtVEhSRUFELUxJTUlUCisgICAgaWYgKGVudl9pc19zZXQgKCJP TVBfVEVBTVNfVEhSRUFEX0xJTUlUX0RFViIsICIzIikpIHRoZW4KKyAgICAgIGVyciA9IC5m YWxzZS4KKyAgICAgICEkb21wIHRhcmdldCBkZXZpY2UoaSkgbWFwKHRvZnJvbTogZXJyKQor ICAgICAgaWYgKG9tcF9nZXRfdGVhbXNfdGhyZWFkX2xpbWl0ICgpIC89IDMpIGVyciA9IC50 cnVlLgorICAgICAgISRvbXAgZW5kIHRhcmdldAorICAgICAgaWYgKGVycikgc3RvcCA2CisK KyAgICAgIGVyciA9IC5mYWxzZS4KKyAgICAgICEkb21wIHRhcmdldCBkZXZpY2UoaSkgbWFw KHRvZnJvbTogZXJyKQorICAgICAgISRvbXAgdGVhbXMKKyAgICAgICEkb21wIHBhcmFsbGVs CisgICAgICBpZiAob21wX2dldF90aHJlYWRfbGltaXQgKCkgPiAzIC5vci4gb21wX2dldF90 aHJlYWRfbnVtICgpID49IDMpICYKKyAgICAgICAgZXJyID0gLnRydWUuCisgICAgICAhJG9t cCBlbmQgcGFyYWxsZWwKKyAgICAgICEkb21wIGVuZCB0ZWFtcworICAgICAgISRvbXAgZW5k IHRhcmdldAorICAgICAgaWYgKGVycikgc3RvcCA3CisKKyAgICAgIGVyciA9IC5mYWxzZS4K KyAgICAgICEkb21wIHRhcmdldCBkZXZpY2UoaSkgbWFwKHRvZnJvbTogZXJyKQorICAgICAg Y2FsbCBvbXBfc2V0X3RlYW1zX3RocmVhZF9saW1pdCAoMiArIGkpCisgICAgICBpZiAob21w X2dldF90ZWFtc190aHJlYWRfbGltaXQgKCkgLz0gMiArIGkpIGVyciA9IC50cnVlLgorICAg ICAgISRvbXAgZW5kIHRhcmdldAorICAgICAgaWYgKGVycikgc3RvcCA4CisKKyAgICAgIGVy ciA9IC5mYWxzZS4KKyAgICAgICEkb21wIHRhcmdldCBkZXZpY2UoaSkgbWFwKHRvZnJvbTog ZXJyKQorICAgICAgaWYgKG9tcF9nZXRfdGVhbXNfdGhyZWFkX2xpbWl0ICgpIC89IDIgKyBp KSBlcnIgPSAudHJ1ZS4KKyAgICAgICEkb21wIGVuZCB0YXJnZXQKKyAgICAgIGlmIChlcnIp IHN0b3AgOQorCisgICAgICBlcnIgPSAuZmFsc2UuCisgICAgICAhJG9tcCB0YXJnZXQgZGV2 aWNlKGkpIG1hcCh0b2Zyb206IGVycikKKyAgICAgICEkb21wIHRlYW1zCisgICAgICAhJG9t cCBwYXJhbGxlbAorICAgICAgaWYgKG9tcF9nZXRfdGhyZWFkX2xpbWl0ICgpID4gMiArIGkg Lm9yLiBvbXBfZ2V0X3RocmVhZF9udW0gKCkgPj0gMiArIGkpICYKKyAgICAgICAgZXJyID0g LnRydWUuCisgICAgICAhJG9tcCBlbmQgcGFyYWxsZWwKKyAgICAgICEkb21wIGVuZCB0ZWFt cworICAgICAgISRvbXAgZW5kIHRhcmdldAorICAgICAgaWYgKGVycikgc3RvcCAxMAorICAg IGVuZCBpZgorCisgIGVuZCBkbworCitjb250YWlucworICBsb2dpY2FsIGZ1bmN0aW9uIGVu dl9pc19zZXQgKG5hbWUsIHZhbCkKKyAgICBjaGFyYWN0ZXIobGVuPSopIDo6IG5hbWUsIHZh bAorICAgIGNoYXJhY3RlcihsZW49NDApIDo6IHZhbDIKKyAgICBpbnRlZ2VyIDo6IHN0YXQK KyAgICBjYWxsIGdldF9lbnZpcm9ubWVudF92YXJpYWJsZSAobmFtZSwgdmFsMiwgc3RhdHVz PXN0YXQpCisgICAgaWYgKHN0YXQgPT0gMCkgdGhlbgorICAgICAgaWYgKHZhbCA9PSB2YWwy KSB0aGVuCisgICAgICAgIGVudl9pc19zZXQgPSAudHJ1ZS4KKyAgICAgICAgcmV0dXJuCisg ICAgICBlbmQgaWYKKyAgICBlbHNlIGlmIChzdGF0IC89IDEpIHRoZW4KKyAgICAgIGVycm9y IHN0b3AgMTAKKyAgICBlbmRpZgorICAgIGVudl9pc19zZXQgPSAuZmFsc2UuCisgIGVuZAor ZW5kCg== --------------z2Cb8jRQW6LfOzBqBCpKORuL--