From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-io0-x241.google.com ([2607:f8b0:4001:c06::241]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aKyIh-0004g4-Rt for barebox@lists.infradead.org; Mon, 18 Jan 2016 01:08:12 +0000 Received: by mail-io0-x241.google.com with SMTP id q21so39422911iod.3 for ; Sun, 17 Jan 2016 17:07:47 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1452251635-14689-7-git-send-email-s.hauer@pengutronix.de> References: <1452251635-14689-1-git-send-email-s.hauer@pengutronix.de> <1452251635-14689-7-git-send-email-s.hauer@pengutronix.de> Date: Sun, 17 Jan 2016 17:07:46 -0800 Message-ID: From: Andrey Smirnov List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: [PATCH 6/8] host side for barebox remote control To: Sascha Hauer Cc: =?UTF-8?Q?Jan_L=C3=BCbbe?= , Barebox List T25lIG1vcmUgdGltZSBzYW5zIEhUTUwKCk9uIEZyaSwgSmFuIDgsIDIwMTYgYXQgMzoxMyBBTSwg U2FzY2hhIEhhdWVyIDxzLmhhdWVyQHBlbmd1dHJvbml4LmRlPiB3cm90ZToKPiBGcm9tOiBKYW4g THVlYmJlIDxqbHVAcGVuZ3V0cm9uaXguZGU+Cj4KPiBUaGlzIGNvbnRhaW5zIHRoZSBob3N0IHRv b2wgZm9yIGJhcmVib3ggcmVtb3RlIGNvbnRyb2wuIEl0IGlzIHdyaXR0ZW4gaW4KPiBQaHl0aG9u IHdpdGggaXRzIG93biBpbXBsZW1lbnRhdGlvbiBvZiB0aGUgUkFUUCBwcm90b2NvbC4gQ3VycmVu dGx5IHRoaXMKPiBpcyBhIHZlcnkgc2ltcGxlIHRvb2wgd2hpY2ggbmVlZHMgbW9yZSB3b3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+ICsgICAg ICAgICAgICBiYnBrdCA9IHVucGFjayhwa3QpCj4gKyAgICAgICAgICAgIGlmIGlzaW5zdGFuY2Uo YmJwa3QsIGJidHlwZSk6Cj4gKyAgICAgICAgICAgICAgICByZXR1cm4gYmJwa3QKPiArICAgICAg ICAgICAgZWxzZToKPiArICAgICAgICAgICAgICAgIHNlbGYuX2hhbmRsZShiYnBrdCkKPiArCj4g KyAgICBkZWYgZXhwb3J0KHNlbGYsIHBhdGgpOgo+ICsgICAgICAgIHNlbGYuZnNzZXJ2ZXIgPSBS YXRwRlNTZXJ2ZXIocGF0aCkKPiArCj4gKyAgICBkZWYgcGluZyhzZWxmKToKPiArICAgICAgICBz ZWxmLl9zZW5kKEJCUGFja2V0UGluZygpKQo+ICsgICAgICAgIHIgPSBzZWxmLl9leHBlY3QoQkJQ YWNrZXRQb25nKQo+ICsgICAgICAgIGxvZ2dpbmcuaW5mbygiUGluZzogJXIiLCByKQo+ICsgICAg ICAgIGlmIG5vdCByOgo+ICsgICAgICAgICAgICByZXR1cm4gMQo+ICsgICAgICAgIGVsc2U6Cj4g KyAgICAgICAgICAgIHByaW50KCJwb25nIikKPiArICAgICAgICAgICAgcmV0dXJuIDAKPiArCj4g KyAgICBkZWYgY29tbWFuZChzZWxmLCBjbWQpOgo+ICsgICAgICAgIHNlbGYuX3NlbmQoQkJQYWNr ZXRDb21tYW5kKGNtZD1jbWQpKQo+ICsgICAgICAgIHIgPSBzZWxmLl9leHBlY3QoQkJQYWNrZXRD b21tYW5kUmV0dXJuLCB0aW1lb3V0PU5vbmUpCj4gKyAgICAgICAgbG9nZ2luZy5pbmZvKCJDb21t YW5kOiAlciIsIHIpCj4gKyAgICAgICAgcmV0dXJuIHIuZXhpdF9jb2RlCj4gKwo+ICsgICAgZGVm IGdldGVudihzZWxmLCB2YXJuYW1lKToKPiArICAgICAgICBzZWxmLl9zZW5kKEJCUGFja2V0R2V0 ZW52KHZhcm5hbWU9dmFybmFtZSkpCj4gKyAgICAgICAgciA9IHNlbGYuX2V4cGVjdChCQlBhY2tl dEdldGVudlJldHVybikKPiArICAgICAgICByZXR1cm4gci50ZXh0Cj4gKwo+ICsgICAgZGVmIGNs b3NlKHNlbGYpOgo+ICsgICAgICAgIHNlbGYuY29ubi5jbG9zZSgpCj4gKwo+ICsgICAgZGVmIHJ1 bihzZWxmKToKPiArICAgICAgICBhc3NlcnQgc2VsZi5yeHEgaXMgbm90IE5vbmUKPiArICAgICAg ICB0cnk6Cj4gKyAgICAgICAgICAgIHdoaWxlIG5vdCBzZWxmLl9zdG9wOgo+ICsgICAgICAgICAg ICAgICAgIyByZWNlaXZlCj4gKyAgICAgICAgICAgICAgICBwa3QgPSBzZWxmLmNvbm4ucmVjdigp Cj4gKyAgICAgICAgICAgICAgICBpZiBwa3Q6Cj4gKyAgICAgICAgICAgICAgICAgICAgYmJwa3Qg PSB1bnBhY2socGt0KQo+ICsgICAgICAgICAgICAgICAgICAgIGlmIGlzaW5zdGFuY2UoYmJwa3Qs IEJCUGFja2V0Q29uc29sZU1zZyk6Cj4gKyAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYucnhx LnB1dCgoc2VsZiwgYmJwa3QudGV4dCkpCj4gKyAgICAgICAgICAgICAgICAgICAgZWxzZToKPiAr ICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5faGFuZGxlKGJicGt0KQo+ICsgICAgICAgICAg ICAgICAgIyBzZW5kCj4gKyAgICAgICAgICAgICAgICB0cnk6Cj4gKyAgICAgICAgICAgICAgICAg ICAgcGt0ID0gc2VsZi5fdHhxLmdldChibG9jaz1GYWxzZSkKPiArICAgICAgICAgICAgICAgIGV4 Y2VwdCBFbXB0eToKPiArICAgICAgICAgICAgICAgICAgICBwa3QgPSBOb25lCj4gKyAgICAgICAg ICAgICAgICBpZiBwa3Q6Cj4gKyAgICAgICAgICAgICAgICAgICAgc2VsZi5fc2VuZChwa3QpCj4g KyAgICAgICAgZXhjZXB0IFJhdHBFcnJvciBhcyBkZXRhaWw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gaWYgcmVzOgo+ICsgICAgICAgIHJlcyA9IDEK PiArICAgIGN0cmwuY2xvc2UoKQo+ICsgICAgcmV0dXJuIHJlcwo+ICsKPiArCj4gK2RlZiBoYW5k bGVfcGluZyhhcmdzKToKPiArICAgIGN0cmwgPSBnZXRfY29udHJvbGxlcihhcmdzKQo+ICsgICAg cmVzID0gY3RybC5waW5nKCkKPiArICAgIGlmIHJlczoKPiArICAgICAgICByZXMgPSAxCj4gKyAg ICBjdHJsLmNsb3NlKCkKPiArICAgIHJldHVybiByZXMKPiArCj4gKwo+ICtkZWYgaGFuZGxlX2dl dGVudihhcmdzKToKPiArICAgIGN0cmwgPSBnZXRfY29udHJvbGxlcihhcmdzKQo+ICsgICAgdmFs dWUgPSBjdHJsLmdldGVudignICcuam9pbihhcmdzLmFyZykpCj4gKyAgICBpZiBub3QgdmFsdWU6 Cj4gKyAgICAgICAgcmVzID0gMQo+ICsgICAgZWxzZToKPiArICAgICAgICBwcmludCh2YWx1ZSkK PiArICAgICAgICByZXMgPSAwCj4gKyAgICBjdHJsLmNsb3NlKCkKPiArICAgIHJldHVybiByZXMK PiArCj4gKwo+ICtkZWYgaGFuZGxlX2xpc3RlbihhcmdzKToKPiArICAgIHBvcnQgPSBzZXJpYWwu c2VyaWFsX2Zvcl91cmwoYXJncy5wb3J0LCBhcmdzLmJhdWRyYXRlKQo+ICsgICAgY29ubiA9IFNl cmlhbFJhdHBDb25uZWN0aW9uKHBvcnQpCj4gKyAgICBjb25uLmxpc3RlbigpCj4gKyAgICB3aGls ZSBUcnVlOgo+ICsgICAgICAgIGNvbm4ud2FpdChOb25lKQo+ICsgICAgY29ubi5jbG9zZSgpCj4g Kwo+ICsKPiArZGVmIGhhbmRsZV9jb25zb2xlKGFyZ3MpOgo+ICsgICAgcXVldWUgPSBRdWV1ZSgp Cj4gKyAgICBjdHJsID0gZ2V0X2NvbnRyb2xsZXIoYXJncykKPiArICAgIGN0cmwuZXhwb3J0KGFy Z3MuZXhwb3J0KQo+ICsgICAgY3RybC5zdGFydChxdWV1ZSkKPiArICAgIGN0cmwuc2VuZF9hc3lu Y19jb25zb2xlKCdccicpCj4gKyAgICBjb25zID0gQ29uc29sZUlucHV0KHF1ZXVlLCBleGl0PSdc eDE0JykgICMgQ1RSTC1UCj4gKyAgICBjb25zLnN0YXJ0KCkKPiArICAgIHRyeToKPiArICAgICAg ICB3aGlsZSBUcnVlOgo+ICsgICAgICAgICAgICBldmVudCA9IHF1ZXVlLmdldChibG9jaz1UcnVl KQo+ICsgICAgICAgICAgICBzcmMsIGRhdGEgPSBldmVudAo+ICsgICAgICAgICAgICBpZiBzcmMg PT0gY29uczoKPiArICAgICAgICAgICAgICAgIGlmIGRhdGEgaXMgTm9uZTogICMgc2h1dGRvd24K PiArICAgICAgICAgICAgICAgICAgICBjb25zLmpvaW4oKQo+ICsgICAgICAgICAgICAgICAgICAg IGJyZWFrCj4gKyAgICAgICAgICAgICAgICBlbGlmIGRhdGEgPT0gJ1x4MTAnOiAgIyBDVFJMLVAK PiArICAgICAgICAgICAgICAgICAgICBjdHJsLnNlbmRfYXN5bmNfcGluZygpCj4gKyAgICAgICAg ICAgICAgICBlbHNlOgo+ICsgICAgICAgICAgICAgICAgICAgIGN0cmwuc2VuZF9hc3luY19jb25z b2xlKGRhdGEpCj4gKyAgICAgICAgICAgIGVsaWYgc3JjID09IGN0cmw6Cj4gKyAgICAgICAgICAg ICAgICBpZiBkYXRhIGlzIE5vbmU6ICAjIHNodXRkb3duCj4gKyAgICAgICAgICAgICAgICAgICAg c3lzLmV4aXQoMSkKPiArICAgICAgICAgICAgICAgICAgICBicmVhawo+ICsgICAgICAgICAgICAg ICAgZWxzZToKPiArICAgICAgICAgICAgICAgICAgICBvcy53cml0ZShzeXMuc3Rkb3V0LmZpbGVu bygpLCBkYXRhKQo+ICsgICAgICAgIGN0cmwuc3RvcCgpCj4gKyAgICAgICAgY3RybC5jbG9zZSgp Cj4gKyAgICBmaW5hbGx5Ogo+ICsgICAgICAgIH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cj4gKyAgICAgICAgc2VsZi50ZXh0ID0gcGF5bG9hZAo+ICsKPiArICAgIGRlZiBfcGFja19w YXlsb2FkKHNlbGYpOgo+ICsgICAgICAgIHJldHVybiBzZWxmLnRleHQKPiArCj4gKwo+ICtjbGFz cyBCQlBhY2tldFBpbmcoQkJQYWNrZXQpOgo+ICsgICAgZGVmIF9faW5pdF9fKHNlbGYsIHJhdz1O b25lKToKPiArICAgICAgICBzdXBlcihCQlBhY2tldFBpbmcsIHNlbGYpLl9faW5pdF9fKEJCVHlw ZS5waW5nLCByYXc9cmF3KQo+ICsKPiArICAgIGRlZiBfX3JlcHJfXyhzZWxmKToKPiArICAgICAg ICByZXR1cm4gIkJCUGFja2V0UGluZygpIgo+ICsKPiArCj4gK2NsYXNzIEJCUGFja2V0UG9uZyhC QlBhY2tldCk6Cj4gKyAgICBkZWYgX19pbml0X18oc2VsZiwgcmF3PU5vbmUpOgo+ICsgICAgICAg IHN1cGVyKEJCUGFja2V0UG9uZywgc2VsZikuX19pbml0X18oQkJUeXBlLnBvbmcsIHJhdz1yYXcp Cj4gKwo+ICsgICAgZGVmIF9fcmVwcl9fKHNlbGYpOgo+ICsgICAgICAgIHJldHVybiAiQkJQYWNr ZXRQb25nKCkiCj4gKwo+ICsKPiArY2xhc3MgQkJQYWNrZXRHZXRlbnYoQkJQYWNrZXQpOgo+ICsg ICAgZGVmIF9faW5pdF9fKHNlbGYsIHJhdz1Ob25lLCB2YXJuYW1lPU5vbmUpOgo+ICsgICAgICAg IHNlbGYudmFybmFtZSA9IHZhcm5hbWUKPiArICAgICAgICBzdXBlcihCQlBhY2tldEdldGVudiwg c2VsZikuX19pbml0X18oQkJUeXBlLmdldGVudiwgcmF3PXJhdykKPiArCj4gKyAgICBkZWYgX19y ZXByX18oc2VsZik6Cj4gKyAgICAgICAgcmV0dXJuICJCQlBhY2tldEdldGVudih2YXJuYW1lPSVy KSIgJSBzZWxmLnZhcm5hbWUKPiArCj4gKyAgICBkZWYgX3VucGFja19wYXlsb2FkKHNlbGYsIHBh eWxvYWQpOgo+ICsgICAgICAgIHNlbGYudmFybmFtZSA9IHBheWxvYWQKPiArCj4gKyAgICBkZWYg X3BhY2tfcGF5bG9hZChzZWxmKToKPiArICAgICAgICByZXR1cm4gc2VsZi52YXJuYW1lCj4gKwo+ ICsKPiArY2xhc3MgQkJQYWNrZXRHZXRlbnZSZXR1cm4oQkJQYWNrZXQpOgo+ICsgICAgZGVmIF9f aW5pdF9fKHNlbGYsIHJhdz1Ob25lLCB0ZXh0PU5vbmUpOgo+ICsgICAgICAgIHNlbGYudGV4dCA9 IHRleHQKPiArICAgICAgICBzdXBlcihCQlBhY2tldEdldGVudlJldHVybiwgc2VsZikuX19pbml0 X18oQkJUeXBlLmdldGVudl9yZXR1cm4sCj4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHJhdz1yYXcpCj4gKwo+ICsgICAgZGVmIF9fcmVwcl9fKHNl bGYpOgo+ICsgICAgICAgIHJldHVybiAiQkJQYWNrZXRHZXRlbnZSZXR1cm4odmFydmFsdWU9JXMp IiAlIHNlbGYudGV4dAo+ICsKPiArICAgIGRlZiBfdW5wYWNrX3BheWxvYWQoc2VsZiwgcGF5bG9h ZCk6Cj4gKyAgICAgICAgc2VsZi50ZXh0ID0gcGF5bG9hZAo+ICsKPiArICAgIGRlZiBfcGFja19w YXlsb2FkKHNlbGYpOgo+ICsgICAgICAgIHJldHVybiBzZWxmLnRleHQKPiArCj4gKwo+ICtjbGFz cyBCQlBhY2tldEZTKEJCUGFja2V0KToKPiArICAgIGRlZiBfX2luaXRfXyhzZWxmLCByYXc9Tm9u ZSwgcGF5bG9hZD1Ob25lKToKPiArICAgICAgICBzdXBlcihCQlBhY2tldEZTLCBzZWxmKS5fX2lu aXRfXyhCQlR5cGUuZnMsIHBheWxvYWQ9cGF5bG9hZCwgcmF3PXJhdykKPiArCj4gKyAgICBkZWYg X19yZXByX18oc2VsZik6Cj4gK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lbGYsIGRhdGE9Tm9uZSwgZmxhZ3M9 JycpOgo+ICsgICAgICAgIHNlbGYucGF5bG9hZCA9IE5vbmUKPiArICAgICAgICBzZWxmLnN5bmNo ID0gMHgwMQo+ICsgICAgICAgIHNlbGYuX2NvbnRyb2wgPSAwCj4gKyAgICAgICAgc2VsZi5sZW5n dGggPSAwCj4gKyAgICAgICAgc2VsZi5jc3VtID0gMAo+ICsgICAgICAgIHNlbGYuY19zeW4gPSBG YWxzZQo+ICsgICAgICAgIHNlbGYuY19hY2sgPSBGYWxzZQo+ICsgICAgICAgIHNlbGYuY19maW4g PSBGYWxzZQo+ICsgICAgICAgIHNlbGYuY19yc3QgPSBGYWxzZQo+ICsgICAgICAgIHNlbGYuY19z biA9IDAKPiArICAgICAgICBzZWxmLmNfYW4gPSAwCj4gKyAgICAgICAgc2VsZi5jX2VvciA9IEZh bHNlCj4gKyAgICAgICAgc2VsZi5jX3NvID0gRmFsc2UKPiArICAgICAgICBpZiBkYXRhOgo+ICsg ICAgICAgICAgICAoc2VsZi5zeW5jaCwgc2VsZi5fY29udHJvbCwgc2VsZi5sZW5ndGgsIHNlbGYu Y3N1bSkgPSBcCj4gKyAgICAgICAgICAgICAgICBzdHJ1Y3QudW5wYWNrKCchQkJCQicsIGRhdGEp Cj4gKyAgICAgICAgICAgIGlmIHNlbGYuc3luY2ggIT0gMHgwMToKPiArICAgICAgICAgICAgICAg IHJhaXNlIFJhdHBJbnZhbGlkSGVhZGVyKCJpbnZhbGlkIHN5bmNoIG9jdGV0ICgleCAhPSAleCki ICUKPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChzZWxmLnN5bmNo LCAweDAxKSkKPiArICAgICAgICAgICAgY3N1bSA9IChzZWxmLl9jb250cm9sICsgc2VsZi5sZW5n dGggKyBzZWxmLmNzdW0pICYgMHhmZgo+ICsgICAgICAgICAgICBpZiBjc3VtICE9IDB4ZmY6Cj4g KyAgICAgICAgICAgICAgICByYWlzZSBSYXRwSW52YWxpZEhlYWRlcigiaW52YWxpZCBjc3VtIG9j dGV0ICgleCAhPSAleCkiICUKPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIChjc3VtLCAweGZmKSkKPiArICAgICAgICAgICAgc2VsZi5fdW5wYWNrX2NvbnRyb2woKQo+ ICsgICAgICAgIGVsaWYgZmxhZ3M6Cj4gKyAgICAgICAgICAgIGlmICdTJyBpbiBmbGFnczoKPiAr ICAgICAgICAgICAgICAgIHNlbGYuY19zeW4gPSBUcnVlCj4gKyAgICAgICAgICAgIGlmICdBJyBp biBmbGFnczoKPiArICAgICAgICAgICAgICAgIHNlbGYuY19hY2sgPSBUcnVlCj4gKyAgICAgICAg ICAgIGlmICdGJyBpbiBmbGFnczoKPiArICAgICAgICAgICAgICAgIHNlbGYuY19maW4gPSBUcnVl Cj4gKyAgICAgICAgICAgIGlmICdSJyBpbiBmbGFnczoKPiArICAgICAgICAgICAgICAgIHNlbGYu Y19yc3QgPSBUcnVlCj4gKyAgICAgICAgICAgIGlmICdFJyBpbiBmbGFnczoKPiArICAgICAgICAg ICAgICAgIHNlbGYuY19lb3IgPSBUcnVlCj4gKwo+ICsgICAgZGVmIF9fcmVwcl9fKHNlbGYpOgo+ ICsgICAgICAgIHMgPSAiUmF0cFBhY2tldCgiCj4gKyAgICAgICAgaWYgc2VsZi5jX3N5bjoKPiAr ICAgICAgICAgICAgcyArPSAiU1lOLCIKPiArICAgICAgICBpZiBzZWxmLmNfYWNrOgo+ICsgICAg ICAgICAgICBzICs9ICJBQ0ssIgo+ICsgICAgICAgIGlmIHNlbGYuY19maW46Cj4gKyAgICAgICAg ICAgIHMgKz0gIkZJTiwiCj4gKyAgICAgICAgaWYgc2VsZi5jX3JzdDoKPiArICAgICAgICAgICAg cyArPSAiUlNULCIKPiArICAgICAgICBzICs9ICJTTj0laSxBTj0laSwiICUgKHNlbGYuY19zbiwg c2VsZi5jX2FuKQo+ICsgICAgICAgIGlmIHNlbGYuY19lb3I6Cj4gKyAgICAgICAgICAgIHMgKz0g IkVPUiwiCj4gKyAgICAgICAgaWYgc2VsZi5jX3NvOgo+ICsgICAgICAgICAgICBzICs9ICJTTyxE QVRBPSVpKSIgJSBzZWxmLmxlbmd0aAo+ICsgICAgICAgIGVsc2U6Cj4gKyAgICAgICAgICAgIHMg Kz0gIkRBVEE9JWkpIiAlIHNlbGYubGVuZ3RoCj4gKyAgICAgICAgcmV0dXJuIHMKPiArCj4gKyAg ICBkZWYgX3BhY2tfY29udHJvbChzZWxmKToKPiArICAgICAgICBzZWxmLl9jb250cm9sID0gMCB8 IFwKPiArICAgICAgICAgICAgc2VsZi5jX3N5biA8PCA3IHwgXAo+ICsgICAgICAgICAgICBzZWxm LmNfYWNrIDw8IDYgfCBcCj4gKyAgICAgICAgICAgIHNlbGYuY19maW4gPDwgNSB8IFwKPiArICAg ICAgICAgICAgc2VsZi5jX3JzdCA8PCA0IHwgXAo+ICsgICAgICAgICAgICBzZWxmLmNfc24gPDwg MyB8IFwKPiArICAgICAgICAgICAgc2VsZi5jX2FuIDw8IDIgfCBcCj4gKyAgICAgICAgICAgIHNl bGYuY19lb3IgPDwgMSB8IFwKPiArICAgICAgICAgICAgc2VsZi5jX3NvIDw8IDAKPiArCj4gKyAg ICBkZWYgX3VucGFja19jb250cm9sKHNlbGYpOgo+ICsgICAgICAgIHNlbGYuY19zeW4gPSBib29s KHNlbGYuX2NvbnRyb2wgJiAxIDw8IDcpCj4gKyAgICAgICAgc2VsZi5jX2FjayA9IGJvb2woc2Vs Zi5fY29udHJvbCAmIDEgPDwgNikKPiArICAgICAgICBzZWxmLmNfZmluID0gYm9vbChzZWxmLl9j b250cm9sICYgMSA8PCA1KQo+ICsgICAgICAgIHNlbGYuY19yc3QgPSBib29sKHNlbGYuX2NvbnRy b2wgJiAxIDw8IDQpCj4gKyAgICAgICAgc2VsZi5jX3NuID0gYm9vbChzZWxmLl9jb250cm9sICYg MSA8PCAzKQo+ICsgICAgICAgIHNlbGYuY19hbiA9IGJvb2woc2VsZi5fY29udHJvbCAmIDEgPDwg MikKPiArICAgICAgICBzZWxmLmNfZW9yID0gYm9vbChzZWxmLl9jb250cm9sICYgMSA8PCAxKQo+ ICsgICAgICAgIHNlbGYuY19zbyA9IGJvb2woc2VsZi5fY29udHJvbCAmIDEgPDwgMCkKPiArCj4g KyAgICBkZWYgcGFjayhzZWxmKToKPiArICAgICAgICBzZWxmLl9wYWNrX2NvbnRyb2woKQo+ICsg ICAgICAgIHNlbGYuY3N1bSA9IDAKPiArICAgICAgICBzZWxmLmNzdW0gPSAoc2VsZi5fY29udHJv bCArIHNlbGYubGVuZ3RoICsgc2VsZi5jc3VtKQo+ICsgICAgICAgIHNlbGYuY3N1bSA9IChzZWxm LmNzdW0gJiAweGZmKSBeIDB4ZmYKPiArICAgICAgICByZXR1cm4gc3RydWN0LnBhY2soJyFCQkJC Jywgc2VsZi5zeW5jaCwgc2VsZi5fY29udHJvbCwgc2VsZi5sZW5ndGgsCj4gKyAgICAgICAgICAg ICAgICAgICAgICAgICAgIHNlbGYuY3N1bSkKPiArCj4gKyAgICBkZWYgdW5wYWNrX3BheWxvYWQo c2VsZiwgcGF5bG9hZCk6Cj4gKyAgICAgICAgKGNfcmVjdiwpID0gc3RydWN0LnVucGFjaygnIUgn LCBwYXlsb2FkWy0yOl0pCj4gKyAgICAgICAgY19jYWxjID0gY3N1bV9mdW5jKHBheWxvYWRbOi0y XSkKPiArICAgICAgICBpZiBjX3JlY3YgIT0gY19jYWxjOgo+ICsgICAgICAgICAgICByYWlzZSBS YXRwSW52YWxpZFBheWxvYWQoImJhZCBjaGVja3N1bSAoJTA0eCAhPSAlMDR4KSIgJQo+ICsgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNfcmVjdiwgY19jYWxjKSkKPiArICAg ICAgICBzZWxmLnBheWxvYWQgPSBwYXlsb2FkWzotMl0KPiArCj4gKyAgICBkZWYgcGFja19wYXls b2FkKHNlbGYpOgo+ICs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ICAgICAgICByYWlzZSBSYXRwRXJyb3IoIk1heGltdW0gcmV0cmFuc21p dCBjb3VudCBleGNlZWRlZCIpCj4gKyAgICAgICAgICAgIHNlbGYuX3JldHJhbnNfZGVhZGxpbmUg PSBtb25vdG9uaWMoKStzZWxmLl9nZXRfcnRvKCkKPiArCj4gKyAgICAgICAgbG9nZ2luZy5pbmZv KCJXcml0ZTogJXIiLCBwa3QpCj4gKwo+ICsgICAgICAgIHNlbGYuX3dyaXRlX3Jhdyhwa3QucGFj aygpKQo+ICsgICAgICAgIGlmIHBrdC5wYXlsb2FkOgo+ICsgICAgICAgICAgICBzZWxmLl93cml0 ZV9yYXcocGt0LnBhY2tfcGF5bG9hZCgpKQo+ICsgICAgICAgIHNlbGYuX3R4X3RpbWVzdGFtcCA9 IG1vbm90b25pYygpCj4gKwo+ICsgICAgZGVmIF9jaGVja19ydG8oc2VsZik6Cj4gKyAgICAgICAg aWYgc2VsZi5fcmV0cmFucyBpcyBOb25lOgo+ICsgICAgICAgICAgICByZXR1cm4KPiArCj4gKyAg ICAgICAgaWYgc2VsZi5fcmV0cmFuc19kZWFkbGluZSA8IG1vbm90b25pYygpOgo+ICsgICAgICAg ICAgICBsb2dnaW5nLmRlYnVnKCJSZXRyYW5zbWl0Li4uIikKPiArICAgICAgICAgICAgc2VsZi5f d3JpdGUoc2VsZi5fcmV0cmFucykKPiArCj4gKyAgICBkZWYgX2NoZWNrX3RpbWVfd2FpdChzZWxm KToKPiArICAgICAgICBpZiBub3Qgc2VsZi5fc3RhdGUgPT0gUmF0cFN0YXRlLnRpbWVfd2FpdDoK PiArICAgICAgICAgICAgcmV0dXJuCj4gKwo+ICsgICAgICAgIHJlbWFpbmluZyA9IHNlbGYuX3Rp bWVfd2FpdF9kZWFkbGluZSAtIG1vbm90b25pYygpCj4gKyAgICAgICAgaWYgcmVtYWluaW5nIDwg MDoKPiArICAgICAgICAgICAgc2VsZi5fc3RhdGUgPSBSYXRwU3RhdGUuY2xvc2VkCj4gKy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GVuZ3RoKzI6Cj4gKyAgICAgICAgICAgIHNlbGYuX2lucHV0ICs9 IHNlbGYuX3JlYWRfcmF3KCkKPiArCj4gKyAgICAgICAgdHJ5Ogo+ICsgICAgICAgICAgICBwa3Qu dW5wYWNrX3BheWxvYWQoc2VsZi5faW5wdXRbOnBrdC5sZW5ndGgrMl0pCj4gKyAgICAgICAgZXhj ZXB0IFJhdHBJbnZhbGlkUGF5bG9hZCBhcyBlOgo+ICsgICAgICAgICAgICBzZWxmLnRvdGFsX2Ny Y19lcnJvcnMgKz0gMQo+ICsgICAgICAgICAgICByZXR1cm4KPiArICAgICAgICBmaW5hbGx5Ogo+ ICsgICAgICAgICAgICBzZWxmLl9pbnB1dCA9IHNlbGYuX2lucHV0W3BrdC5sZW5ndGgrMjpdCj4g Kwo+ICsgICAgICAgIHJldHVybiBwa3QKPiArCj4gKyAgICBkZWYgX2Nsb3NlKHNlbGYpOgo+ICsg ICAgICAgIHBhc3MKPiArCj4gKyAgICBkZWYgX2Eoc2VsZiwgcik6Cj4gKyAgICAgICAgbG9nZ2lu Zy5pbmZvKCJBIikKPiArCj4gKyAgICAgICAgaWYgci5jX3JzdDoKPiArICAgICAgICAgICAgcmV0 dXJuIFRydWUKPiArCj4gKyAgICAgICAgaWYgci5jX2FjazoKPiArICAgICAgICAgICAgcyA9IFJh dHBQYWNrZXQoZmxhZ3M9J1InKQo+ICsgICAgICAgICAgICBzLmNfc24gPSByLmNfYW4KPiArICAg ICAgICAgICAgc2VsZi5fd3JpdGUocykKPiArICAgICAgICAgICAgcmV0dXJuIEZhbHNlCj4gKwo+ ICsgICAgICAgIGlmIHIuY19zeW46Cj4gKyAgICAgICAgICAgIHNlbGYuX3JfbWRsID0gci5sZW5n dGgKPiArCj4gKyAgICAgICAgICAgIHMgPSBSYXRwUGFja2V0KGZsYWdzPSdTQScpCj4gKyAgICAg ICAgICAgIHMuY19zbiA9IDAKPiArICAgICAgICAgICAgcy5jX2FuID0gKHIuY19zbiArIDEpICUg Mgo+ICsgICAgICAgICAgICBzLmxlbmd0aCA9IHNlbGYuX3NfbWRsCj4gKyAgICAgICAgICAgIHNl bGYuX3dyaXRlKHMpCj4gKyAgICAgICAgICAgIHNlbGYuX3N0YXRlID0gUmF0cFN0YXRlLnN5bl9y ZWNlaXZlZAo+ICsgICAgICAgICAgICByZXR1cm4gRmFsc2UKPiArCj4gKyAgICAgICAgcmV0dXJu IEZhbHNlCj4gKwo+ICsgICAgZGVmIF9iKHNlbGYsIHIpOgo+ICsgICAgICAgIGxvZ2dpbmcuaW5m bygiQiIpCj4gKwo+ICsgICAgICAgIGlmIHIuY19hY2sgYW5kIHIuY19hbiAhPSAoc2VsZi5fc19z biArIDEpICUgMjoKPiArICAgICAgICAgICAgaWYgci5jX3JzdDoKPiArICAgICAgICAgICAgICAg IHJldHVybiBGYWxzZQo+ICsgICAgICAgICAgICBlbHNlOgo+ICsgICAgICAgICAgICAgICAgcyA9 IFJhdHBQYWNrZXQoZmxhZ3M9J1InKQo+ICsgICAgICAgICAgICAgICAgcy5jX3NuID0gci5jX2Fu Cj4gKyAgICAgICAgICAgICAgICBzZWxmLl93cml0ZShzKQo+ICsgICAgICAgICAgICAgICAgcmV0 dXJuIEZhbHNlCj4gKwo+ICsgICAgICAgIGlmIHIuY19yc3Q6Cj4gKyAgICAgICAgICAgIGlmIHIu Y19hY2s6Cj4gKyAgICAgICAgICAgICAgICBzZWxmLl9yZXRyYW5zID0gTm9uZQo+ICsgICAgICAg ICAgICAgICAgIyBGSVhNRTogZGVsZXRlIHRoZSBUQ0IKPiArICAgICAgICAgICAgICAgIHNlbGYu X3N0YXRlID0gUmF0cFN0YXRlLmNsb3NlZAo+ICsgICAgICAgICAgICAgICAgcmV0dXJuIEZhbHNl Cj4gKyAgICAgICAgICAgIGVsc2U6Cj4gKyAgICAgICAgICAgICAgICByZXR1cm4gRmFsc2UKPiAr Cj4gKyAgICAgICAgaWYgci5jX3N5bjoKPiArICAgICAgICAgICAgaWYgci5jX2FjazoKPiArICAg ICAgICAgICAgICAgIHNlbGYuX3JfbWRsID0gci5sZW5ndGgKPiArICAgICAgICAgICAgICAgIHNl bGYuX3JldHJhbnMgPSBOb25lCj4gKyAgICAgICAgICAgICAgICBzZWxmLl9yX3NuID0gci5jX3Nu Cj4gKyAgICAgICAgICAgICAgICBzID0gUmF0cFBhY2tldChmbGFncz0nQScpCj4gKyAgICAgICAg ICAgICAgICBzLmNfc24gPSByLmNfYW4KPiArICAgICAgICAgICAgICAgIHMuY19hbiA9IChyLmNf c24gKyAxKSAlIDIKPiArICAgICAgICAgICAgICAgIHNlbGYuX3dyaXRlKHMpCj4gKyAgICAgICAg ICAgICAgICBzZWxmLl9zdGF0ZSA9IFJhdHBTdGF0ZS5lc3RhYmxpc2hlZAo+ICsgICAgICAgICAg ICAgICAgcmV0dXJuIEZhbHNlCj4gKyAgICAgICAgICAgIGVsc2U6Cj4gKyAgICAgICAgICAgICAg ICBzZWxmLl9yZXRyYW5zID0gTm9uZQo+ICsgICAgICAgICAgICAgICAgcyA9IFJhdHBQYWNrZXQo ZmxhZ3M9J1NBJykKPiArICAgICAgICAgICAgICAgIHMuY19zbiA9IDAKPiArICAgICAgICAgICAg ICAgIHMuY19hbiA9IChyLmNfc24gKyAxKSAlIDIKPiArICAgICAgICAgICAgICAgIHMubGVuZ3Ro ID0gc2VsZi5fc19tZGwKPiArICAgICAgICAgICAgICAgIHNlbGYuX3dyaXRlKHMpCj4gKyAgICAg ICAgICAgICAgICBzZWxmLl9zdGF0ZSA9IFJhdHBTdGF0ZS5zeW5fcmVjZWl2ZWQKPiArICAgICAg ICAgICAgICAgIHJldHVybiBGYWxzZQo+ICsKPiArICAgICAgICByZXR1cm4gRmFsc2UKPiArCj4g KyAgICBkZWYgX2MxKHNlbGYsIHIpOgo+ICsgICAgICAgIGxvZ2dpbmcuaW5mbygiQzEiKQo+ICsK PiArICAgICAgICBpZiByLmNfc24gIT0gc2VsZi5fcl9zbjoKPiArICAgICAgICAgICAgcmV0dXJu IFRydWUKPiArCj4gKyAgICAgICAgaWYgci5jX3JzdCBvciByLmNfZmluOgo+ICsgICAgICAgICAg ICByZXR1cm4gRmFsc2UKPiArCj4gKyAgICAgICAgcyA9IFJhdHBQYWNrZXQoZmxhZ3M9J0EnKQo+ ICsgICAgICAgIHMuY19zbiA9IHIuY19hbgo+ICsgICAgICAgIHMuY19hbiA9IChyLmNfc24gKyAx KSAlIDIKPiArICAgICAgICBzZWxmLl93cml0ZShzKQo+ICsgICAgICAgIHJldHVybiBGYWxzZQo+ ICsKPiArICAgIGRlZiBfYzIoc2VsZiwgcik6Cj4gKyAgICAgICAgbG9nZ2luZy5pbmZvKCJDMiIp Cj4gKwo+ICsgICAgICAgIGlmIHIubGVuZ3RoID09IDAgYW5kIHIuY19zbyA9PSAwOgo+ICsgICAg ICAgICAgICByZXR1cm4gVHJ1ZQo+ICsKPiArICAgICAgICBpZiByLmNfc24gIT0gc2VsZi5fcl9z bjoKPiArICAgICAgICAgICAgcmV0dXJuIFRydWUKPiArCj4gKyAgICAgICAgaWYgci5jX3JzdCBv ciByLmNfZmluOgo+ICsgICAgICAgICAgICByZXR1cm4gRmFsc2UKPiArCj4gKyAgICAgICAgaWYg ci5jX3N5bjoKPiArICAgICAgICAgICAgcyA9IFJhdHBQYWNrZXQoZmxhZ3M9J1JBJykKPiArICAg ICAgICAgICAgcy5jX3NuID0gci5jX2FuCj4gKyAgICAgICAgICAgIHMuY19hbiA9IChyLmNfc24g KyAxKSAlIDIKPiArICAgICAgICAgICAgc2VsZi5fd3JpdGUocykKPiArICAgICAgICAgICAgc2Vs Zi5fcmV0cmFucyA9IE5vbmUKPiArICAgICAgICAgICAgIyBGSVhNRTogaW5mb3JtIHRoZSB1c2Vy ICJFcnJvcjogQ29ubmVjdGlvbiByZXNldCIKPiArICAgICAgICAgICAgc2VsZi5fc3RhdGUgPSBS YXRwU3RhdGUuY2xvc2VkCj4gKyAgICAgICAgICAgIHJldHVybiBGYWxzZQo+ICsKPiArICAgICAg ICAjIEZJWE1FOiBvbmx5IGFjayBkdXBsaWNhdGUgZGF0YSBwYWNrYWdlcz8KPiArICAgICAgICAj IFRoaXMgaXMgbm90IGRvY3VtZW50ZWQgaW4gUkZDIDkxNgo+ICsgICAgICAgIGlmIHIubGVuZ3Ro IG9yIHIuY19zbzoKPiArICAgICAgICAgICAgbG9nZ2luZy5pbmZvKCJDMjogZHVwbGljYXRlIGRh dGEgcGFja2V0LCBkcm9wcGluZyIpCj4gKyAgICAgICAgICAgIHMgPSBSYXRwUGFja2V0KGZsYWdz PSdBJykKPiArICAgICAgICAgICAgcy5jX3NuID0gci5jX2FuCj4gKyAgICAgICAgICAgIHMuY19h biA9IChyLmNfc24gKyAxKSAlIDIKPiArICAgICAgICAgICAgc2VsZi5fd3JpdGUocykKPiArCj4g KyAgICAgICAgcmV0dXJuIEZhbHNlCj4gKwo+ICsgICAgZGVmIF9kMShzZWxmLCByKToKPiArICAg ICAgICBsb2dnaW5nLmluZm8oIkQxIikKPiArCj4gKyAgICAgICAgaWYgbm90IHIuY19yc3Q6Cj4g KyAgICAgICAgICAgIHJldHVybiBUcnVlCj4gKwo+ICsgICAgICAgIGlmIHNlbGYuX3Bhc3NpdmU6 Cj4gKyAgICAgICAgICAgIHNlbGYuX3JldHJhbnMgPSBOb25lCj4gKyAgICAgICAgICAgIHNlbGYu X3N0YXRlID0gUmF0cFN0YXRlLmxpc3Rlbgo+ICsgICAgICAgICAgICByZXR1cm4gRmFsc2UKPiAr ICAgICAgICBlbHNlOgo+ICsgICAgICAgICAgICBzZWxmLl9yZXRyYW5zID0gTm9uZQo+ICsKPiAr ICAgICAgICAgICAgc2VsZi5fc3RhdGUgPSBSYXRwU3RhdGUuY2xvc2VkCj4gKyAgICAgICAgICAg IHJhaXNlIFJhdHBFcnJvcigiQ29ubmVjdGlvbiByZWZ1c2VkIikKPiArCj4gKyAgICBkZWYgX2Qy KHNlbGYsIHIpOgo+ICsgICAgICAgIGxvZ2dpbmcuaW5mbygiRDIiKQo+ICsKPiArICAgICAgICBp ZiBub3Qgci5jX3JzdDoKPiArICAgICAgICAgICAgcmV0dXJuIFRydWUKPiArCj4gKyAgICAgICAg c2VsZi5fcmV0cmFucyA9IE5vbmUKPiArCj4gKyAgICAgICAgc2VsZi5fc3RhdGUgPSBSYXRwU3Rh dGUuY2xvc2VkCj4gKwo+ICsgICAgICAgIHJhaXNlIFJhdHBFcnJvcigiQ29ubmVjdGlvbiByZXNl dCIpCj4gKwo+ICsgICAgZGVmIF9kMyhzZWxmLCByKToKPiArICAgICAgICBsb2dnaW5nLmluZm8o IkMzIikKPiArCj4gKyAgICAgICAgaWYgbm90IHIuY19yc3Q6Cj4gKyAgICAgICAgICAgIHJldHVy biBUcnVlCj4gKwo+ICsgICAgICAgIHNlbGYuX3N0YXRlID0gUmF0cFN0YXRlLmNsb3NlZAo+ICsg ICAgICAgIHJldHVybiBGYWxzZQo+ICsKPiArICAgIGRlZiBfZShzZWxmLCByKToKPiArICAgICAg ICBsb2dnaW5nLmluZm8oIkUiKQo+ICsKPiArICAgICAgICBpZiBub3Qgci5jX3N5bjoKPiArICAg ICAgICAgICAgcmV0dXJuIFRydWUKPiArCj4gKyAgICAgICAgc2VsZi5fcmV0cmFucyA9IE5vbmUK PiArICAgICAgICBzID0gUmF0cFBhY2tldChmbGFncz0nUicpCj4gKyAgICAgICAgaWYgci5jX2Fj azoKPiArICAgICAgICAgICAgcy5jX3NuID0gci5jX2FuCj4gKyAgICAgICAgZWxzZToKPiArICAg ICAgICAgICAgcy5jX3NuID0gMAo+ICsgICAgICAgIHNlbGYuX3dyaXRlKHMpCj4gKyAgICAgICAg c2VsZi5fc3RhdGUgPSBSYXRwU3RhdGUuY2xvc2VkCj4gKyAgICAgICAgcmFpc2UgUmF0cEVycm9y KCJDb25uZWN0aW9uIHJlc2V0IikKPiArCj4gKyAgICBkZWYgX2YxKHNlbGYsIHIpOgo+ICsgICAg ICAgIGxvZ2dpbmcuaW5mbygiRjEiKQo+ICsKPiArICAgICAgICBpZiBub3Qgci5jX2FjazoKPiAr ICAgICAgICAgICAgcmV0dXJuIEZhbHNlCj4gKwo+ICsgICAgICAgIGlmIHIuY19hbiA9PSAoc2Vs Zi5fc19zbiArIDEpICUgMjoKPiArICAgICAgICAgICAgcmV0dXJuIFRydWUKPiArCj4gKyAgICAg ICAgaWYgc2VsZi5fcGFzc2l2ZToKPiArICAgICAgICAgICAgc2VsZi5fcmV0cmFucyA9IE5vbmUK PiArICAgICAgICAgICAgcyA9IFJhdHBQYWNrZXQoZmxhZ3M9J1InKQo+ICsgICAgICAgICAgICBz LmNfc24gPSByLmNfYW4KPiArICAgICAgICAgICAgc2VsZi5fd3JpdGUocykKPiArICAgICAgICAg ICAgc2VsZi5fc3RhdGUgPSBSYXRwU3RhdGUubGlzdGVuCj4gKyAgICAgICAgICAgIHJldHVybiBG YWxzZQo+ICsgICAgICAgIGVsc2U6Cj4gKyAgICAgICAgICAgIHNlbGYuX3JldHJhbnMgPSBOb25l Cj4gKyAgICAgICAgICAgIHMgPSBSYXRwUGFja2V0KGZsYWdzPSdSJykKPiArICAgICAgICAgICAg cy5jX3NuID0gci5jX2FuCj4gKyAgICAgICAgICAgIHNlbGYuX3dyaXRlKHMpCj4gKyAgICAgICAg ICAgIHNlbGYuX3N0YXRlID0gUmF0cFN0YXRlLmNsb3NlZAo+ICsgICAgICAgICAgICByYWlzZSBS YXRwRXJyb3IoIkNvbm5lY3Rpb24gcmVmdXNlZCIpCj4gKwo+ICsgICAgZGVmIF9mMihzZWxmLCBy KToKPiArICAgICAgICBsb2dnaW5nLmluZm8oIkYyIikKPiArCj4gKyAgICAgICAgaWYgbm90IHIu Y19hY2s6Cj4gKyAgICAgICAgICAgIHJldHVybiBGYWxzZQo+ICsKPiArICAgICAgICBpZiByLmNf YW4gPT0gKHNlbGYuX3Nfc24gKyAxKSAlIDI6Cj4gKyAgICAgICAgICAgIGlmIHNlbGYuX3JldHJh bnM6Cj4gKyAgICAgICAgICAgICAgICBzZWxmLl9yZXRyYW5zID0gTm9uZQo+ICsgICAgICAgICAg ICAgICAgc2VsZi5fdXBkYXRlX3NydHQobW9ub3RvbmljKCktc2VsZi5fdHhfdGltZXN0YW1wKQo+ ICsgICAgICAgICAgICAgICAgIyBGSVhNRTogaW5mb3JtIHRoZSB1c2VyIHdpdGggYW4gIk9rIiBp ZiBhIGJ1ZmZlciBoYXMgYmVlbgo+ICsgICAgICAgICAgICAgICAgIyBlbnRpcmVseSBhY2tub3ds ZWRnZWQuICBBbm90aGVyIHBhY2tldCBjb250YWluaW5nIGRhdGEgbWF5Cj4gKyAgICAgICAgICAg ICAgICAjIG5vdyBiZSBzZW50Lgo+ICsgICAgICAgICAgICByZXR1cm4gVHJ1ZQo+ICsKPiArICAg ICAgICByZXR1cm4gVHJ1ZQo+ICsKPiArICAgIGRlZiBfZjMoc2VsZiwgcik6Cj4gKyAgICAgICAg bG9nZ2luZy5pbmZvKCJGMyIpCj4gKwo+ICsgICAgICAgIGlmIG5vdCByLmNfYWNrOgo+ICsgICAg ICAgICAgICByZXR1cm4gRmFsc2UKPiArCj4gKyAgICAgICAgaWYgci5jX2FuID09IChzZWxmLl9z X3NuICsgMSkgJSAyOgo+ICsgICAgICAgICAgICByZXR1cm4gVHJ1ZQo+ICsKPiArICAgICAgICBy ZXR1cm4gVHJ1ZQo+ICsKPiArICAgIGRlZiBfZyhzZWxmLCByKToKPiArICAgICAgICBsb2dnaW5n LmluZm8oIkciKQo+ICsKPiArICAgICAgICBpZiBub3Qgci5jX3JzdDoKPiArICAgICAgICAgICAg cmV0dXJuIEZhbHNlCj4gKwo+ICsgICAgICAgIHNlbGYuX3JldHJhbnMgPSBOb25lCj4gKyAgICAg ICAgaWYgci5jX2FjazoKPiArICAgICAgICAgICAgcyA9IFJhdHBQYWNrZXQoZmxhZ3M9J1InKQo+ ICsgICAgICAgICAgICBzLmNfc24gPSByLmNfYW4KPiArICAgICAgICAgICAgc2VsZi5fd3JpdGUo cykKPiArICAgICAgICBlbHNlOgo+ICsgICAgICAgICAgICBzID0gUmF0cFBhY2tldChmbGFncz0n UkEnKQo+ICsgICAgICAgICAgICBzLmNfc24gPSByLmNfYW4KPiArICAgICAgICAgICAgcy5jX2Fu ID0gKHIuY19zbiArIDEpICUgMgo+ICsgICAgICAgICAgICBzZWxmLl93cml0ZShzKQo+ICsKPiAr ICAgICAgICByZXR1cm4gRmFsc2UKPiArCj4gKyAgICBkZWYgX2gxKHNlbGYsIHIpOgo+ICsgICAg ICAgIGxvZ2dpbmcuaW5mbygiSDEiKQo+ICsKPiArICAgICAgICAjIEZJWE1FOiBpbml0aWFsIGRh dGE/Cj4gKyAgICAgICAgc2VsZi5fc3RhdGUgPSBSYXRwU3RhdGUuZXN0YWJsaXNoZWQKPiArICAg ICAgICBzZWxmLl9yX3NuID0gci5jX3NuCj4gKwo+ICsgICAgICAgIHJldHVybiBGYWxzZQo+ICsK PiArICAgIGRlZiBfaDIoc2VsZiwgcik6Cj4gKyAgICAgICAgbG9nZ2luZy5pbmZvKCJIMiIpCj4g Kwo+ICsgICAgICAgIGlmIG5vdCByLmNfZmluOgo+ICsgICAgICAgICAgICByZXR1cm4gVHJ1ZQo+ ICsKPiArICAgICAgICBpZiBzZWxmLl9yZXRyYW5zIGlzIG5vdCBOb25lOgo+ICsgICAgICAgICAg ICAjIEZJWE1FOiBpbmZvcm0gdGhlIHVzZXIgIldhcm5pbmc6IERhdGEgbGVmdCB1bnNlbnQuIiwg IkNvbm5lY3Rpb24gY2xvc2luZy4iCj4gKyAgICAgICAgICAgIHNlbGYuX3JldHJhbnMgPSBOb25l Cj4gKyAgICAgICAgcyA9IFJhdHBQYWNrZXQoZmxhZ3M9J0ZBJykKPiArICAgICAgICBzLmNfc24g PSByLmNfYW4KPiArICAgICAgICBzLmNfYW4gPSAoci5jX3NuICsgMSkgJSAyCj4gKyAgICAgICAg c2VsZi5fd3JpdGUocykKPiArICAgICAgICBzZWxmLl9zdGF0ZSA9IFJhdHBTdGF0ZS5sYXN0X2Fj awo+ICsgICAgICAgIHJhaXNlIFJhdHBFcnJvcigiQ29ubmVjdGlvbiBjbG9zZWQgYnkgcmVtb3Rl IikKPiArCj4gKyAgICBkZWYgX2gzKHNlbGYsIHIpOgo+ICsgICAgICAgIGxvZ2dpbmcuaW5mbygi SDMiKQo+ICsKPiArICAgICAgICBpZiBub3Qgci5jX2ZpbjoKPiArICAgICAgICAgICAgIyBPdXIg ZmluIHdhcyBsb3N0LCByZWx5IG9uIHJldHJhbnNtaXNzaW9uCj4gKyAgICAgICAgICAgIHJldHVy biBGYWxzZQo+ICsKPiArICAgICAgICBpZiByLmxlbmd0aCBvciByLmNfc286Cj4gKyAgICAgICAg ICAgIHNlbGYuX3JldHJhbnMgPSBOb25lCj4gKyAgICAgICAgICAgIHMgPSBSYXRwUGFja2V0KGZs YWdzPSdSQScpCj4gKyAgICAgICAgICAgIHMuY19zbiA9IHIuY19hbgo+ICsgICAgICAgICAgICBz LmNfYW4gPSAoci5jX3NuICsgMSkgJSAyCj4gKyAgICAgICAgICAgIHNlbGYuX3dyaXRlKHMpCj4g KyAgICAgICAgICAgIHNlbGYuX3N0YXRlID0gUmF0cFN0YXRlLmNsb3NlZAo+ICsgICAgICAgICAg ICByYWlzZSBSYXRwRXJyb3IoIkNvbm5lY3Rpb24gcmVzZXQiKQo+ICsKPiArICAgICAgICBpZiBy LmNfYW4gPT0gKHNlbGYuX3Nfc24gKyAxKSAlIDI6Cj4gKyAgICAgICAgICAgIHNlbGYuX3JldHJh bnMgPSBOb25lCj4gKyAgICAgICAgICAgIHMgPSBSYXRwUGFja2V0KGZsYWdzPSdBJykKPiArICAg ICAgICAgICAgcy5jX3NuID0gci5jX2FuCj4gKyAgICAgICAgICAgIHMuY19hbiA9IChyLmNfc24g KyAxKSAlIDIKPiArICAgICAgICAgICAgc2VsZi5fd3JpdGUocykKPiArICAgICAgICAgICAgc2Vs Zi5fdGltZV93YWl0X2RlYWRsaW5lID0gbW9ub3RvbmljKCkgKyBzZWxmLl9nZXRfcnRvKCkKPiAr ICAgICAgICAgICAgc2VsZi5fc3RhdGUgPSBSYXRwU3RhdGUudGltZV93YWl0Cj4gKyAgICAgICAg ICAgIHJldHVybiBGYWxzZQo+ICsgICAgICAgIGVsc2U6Cj4gKyAgICAgICAgICAgIHNlbGYuX3Jl dHJhbnMgPSBOb25lCj4gKyAgICAgICAgICAgIHMgPSBSYXRwUGFja2V0KGZsYWdzPSdBJykKPiAr ICAgICAgICAgICAgcy5jX3NuID0gci5jX2FuCj4gKyAgICAgICAgICAgIHMuY19hbiA9IChyLmNf c24gKyAxKSAlIDIKPiArICAgICAgICAgICAgc2VsZi5fd3JpdGUocykKPiArICAgICAgICAgICAg c2VsZi5fc3RhdGUgPSBSYXRwU3RhdGUuY2xvc2luZwo+ICsgICAgICAgICAgICByZXR1cm4gRmFs c2UKPiArCj4gKyAgICBkZWYgX2g0KHNlbGYsIHIpOgo+ICsgICAgICAgIGxvZ2dpbmcuaW5mbygi SDQiKQo+ICsKPiArICAgICAgICBpZiByLmNfYW4gPT0gKHNlbGYuX3Nfc24gKyAxKSAlIDI6Cj4g KyAgICAgICAgICAgIHNlbGYuX3JldHJhbnMgPSBOb25lCj4gKyAgICAgICAgICAgIHNlbGYuX3Rp bWVfd2FpdF9kZWFkbGluZSA9IG1vbm90b25pYygpICsgc2VsZi5fZ2V0X3J0bygpCj4gKyAgICAg ICAgICAgIHNlbGYuX3N0YXRlID0gUmF0cFN0YXRlLnRpbWVfd2FpdAo+ICsgICAgICAgICAgICBy ZXR1cm4gRmFsc2UKPiArCj4gKyAgICAgICAgcmV0dXJuIEZhbHNlCj4gKwo+ICsgICAgZGVmIF9o NShzZWxmLCByKToKPiArICAgICAgICBsb2dnaW5nLmluZm8oIkg1IikKPiArCj4gKyAgICAgICAg aWYgci5jX2FuID09IChzZWxmLl9zX3NuICsgMSkgJSAyOgo+ICsgICAgICAgICAgICBzZWxmLl90 aW1lX3dhaXRfZGVhZGxpbmUgPSBtb25vdG9uaWMoKSArIHNlbGYuX2dldF9ydG8oKQo+ICsgICAg ICAgICAgICBzZWxmLl9zdGF0ZSA9IFJhdHBTdGF0ZS50aW1lX3dhaXQKPiArICAgICAgICAgICAg cmV0dXJuIEZhbHNlCj4gKwo+ICsgICAgICAgIHJldHVybiBGYWxzZQo+ICsKPiArICAgIGRlZiBf aDYoc2VsZiwgcik6Cj4gKyAgICAgICAgbG9nZ2luZy5pbmZvKCJINiIpCj4gKwo+ICsgICAgICAg IGlmIG5vdCByLmNfYWNrOgo+ICsgICAgICAgICAgICByZXR1cm4gRmFsc2UKPiArCj4gKyAgICAg ICAgaWYgbm90IHIuY19maW46Cj4gKyAgICAgICAgICAgIHJldHVybiBGYWxzZQo+ICsKPiArICAg ICAgICBzZWxmLl9yZXRyYW5zID0gTm9uZQo+ICsgICAgICAgIHMgPSBSYXRwUGFja2V0KGZsYWdz PSdBJykKPiArICAgICAgICBzLmNfc24gPSByLmNfYW4KPiArICAgICAgICBzLmNfYW4gPSAoci5j X3NuICsgMSkgJSAyCj4gKyAgICAgICAgc2VsZi5fd3JpdGUocykKPiArICAgICAgICBzZWxmLl90 aW1lX3dhaXRfZGVhZGxpbmUgPSBtb25vdG9uaWMoKSArIHNlbGYuX2dldF9ydG8oKQo+ICsgICAg ICAgIHJldHVybiBGYWxzZQo+ICsKPiArICAgIGRlZiBfaTEoc2VsZiwgcik6Cj4gKyAgICAgICAg bG9nZ2luZy5pbmZvKCJJMSIpCj4gKwo+ICsgICAgICAgIGlmIHIuY19zbzoKPiArICAgICAgICAg ICAgc2VsZi5fcl9zbiA9IHIuY19zbgo+ICsgICAgICAgICAgICBzZWxmLl9yeF9idWYuYXBwZW5k KGNocihyLmxlbmd0aCkpCj4gKyAgICAgICAgZWxpZiByLmxlbmd0aDoKPiArICAgICAgICAgICAg c2VsZi5fcl9zbiA9IHIuY19zbgo+ICsgICAgICAgICAgICBzZWxmLl9yeF9idWYuYXBwZW5kKHIu cGF5bG9hZCkKPiArICAgICAgICBlbHNlOg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s Zi5fZjEocGt0KSBhbmQgXAo+ICsgICAgICAgICAgICAgICAgc2VsZi5faDEocGt0KQo+ICsgICAg ICAgIGVsaWYgc2VsZi5fc3RhdGUgPT0gUmF0cFN0YXRlLmVzdGFibGlzaGVkOgo+ICsgICAgICAg ICAgICBzZWxmLl9jMihwa3QpIGFuZCBcCj4gKyAgICAgICAgICAgICAgICBzZWxmLl9kMihwa3Qp IGFuZCBcCj4gKyAgICAgICAgICAgICAgICBzZWxmLl9lKHBrdCkgYW5kIFwKPiArICAgICAgICAg ICAgICAgIHNlbGYuX2YyKHBrdCkgYW5kIFwKPiArICAgICAgICAgICAgICAgIHNlbGYuX2gyKHBr dCkgYW5kIFwKPiArICAgICAgICAgICAgICAgIHNlbGYuX2kxKHBrdCkKPiArICAgICAgICBlbGlm IHNlbGYuX3N0YXRlID09IFJhdHBTdGF0ZS5maW5fd2FpdDoKPiArICAgICAgICAgICAgc2VsZi5f YzIocGt0KSBhbmQgXAo+ICsgICAgICAgICAgICAgICAgc2VsZi5fZDIocGt0KSBhbmQgXAo+ICsg ICAgICAgICAgICAgICAgc2VsZi5fZShwa3QpIGFuZCBcCj4gKyAgICAgICAgICAgICAgICBzZWxm Ll9mMyhwa3QpIGFuZCBcCj4gKyAgICAgICAgICAgICAgICBzZWxmLl9oMyhwa3QpCj4gKyAgICAg ICAgZWxpZiBzZWxmLl9zdGF0ZSA9PSBSYXRwU3RhdGUubGFzdF9hY2s6Cj4gKyAgICAgICAgICAg IHNlbGYuX2MyKHBrdCkgYW5kIFwKPiArICAgICAgICAgICAgICAgIHNlbGYuX2QzKHBrdCkgYW5k IFwKPiArICAgICAgICAgICAgICAgIHNlbGYuX2UocGt0KSBhbmQgXAo+ICsgICAgICAgICAgICAg ICAgc2VsZi5fZjMocGt0KSBhbmQgXAo+ICsgICAgICAgICAgICAgICAgc2VsZi5faDQocGt0KQo+ ICsgICAgICAgIGVsaWYgc2VsZi5fc3RhdGUgPT0gUmF0cFN0YXRlLmNsb3Npbmc6Cj4gKyAgICAg ICAgICAgIHNlbGYuX2MyKHBrdCkgYW5kIFwKPiArICAgICAgICAgICAgICAgIHNlbGYuX2QzKHBr dCkgYW5kIFwKPiArICAgICAgICAgICAgICAgIHNlbGYuX2UocGt0KSBhbmQgXAo+ICsgICAgICAg ICAgICAgICAgc2VsZi5fZjMocGt0KSBhbmQgXAo+ICsgICAgICAgICAgICAgICAgc2VsZi5faDUo cGt0KQo+ICsgICAgICAgIGVsaWYgc2VsZi5fc3RhdGUgPT0gUmF0cFN0YXRlLnRpbWVfd2FpdDoK PiArICAgICAgICAgICAgc2VsZi5fZDMocGt0KSBhbmQgXAo+ICsgICAgICAgICAgICAgICAgc2Vs Zi5fZShwa3QpIGFuZCBcCj4gKyAgICAgICAgICAgICAgICBzZWxmLl9mMyhwa3QpIGFuZCBcCj4g KyAgICAgICAgICAgICAgICBzZWxmLl9oNihwa3QpCj4gKyAgICAgICAgZWxpZiBzZWxmLl9zdGF0 ZSA9PSBSYXRwU3RhdGUuY2xvc2VkOgo+ICsgICAgICAgICAgICBzZWxmLl9nKHBrdCkKPiArCj4g KyAgICBkZWYgd2FpdChzZWxmLCBkZWFkbGluZSk6Cj4gKyAgICAgICAgd2hpbGUgZGVhZGxpbmUg aXMgTm9uZSBvciBkZWFkbGluZSA+IG1vbm90b25pYygpOgo+ICsgICAgICAgICAgICBwa3QgPSBz ZWxmLl9yZWFkKCkKPiArICAgICAgICAgICAgaWYgcGt0Ogo+ICsgICAgICAgICAgICAgICAgc2Vs Zi5fbWFjaGluZShwa3QpCj4gKyAgICAgICAgICAgIGVsc2U6Cj4gKyAgICAgICAgICAgICAgICBz ZWxmLl9jaGVja19ydG8oKQo+ICsgICAgICAgICAgICAgICAgc2VsZi5fY2hlY2tfdGltZV93YWl0 KCkKPiArICAgICAgICAgICAgaWYgbm90IHNlbGYuX3JldHJhbnMgb3Igc2VsZi5fcnhfcXVldWU6 Cj4gKyAgICAgICAgICAgICAgICByZXR1cm4KPiArCj4gK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KyAgICAgICAg dHJ5Ogo+ICsgICAgICAgICAgICBmID0gb3Mub3BlbihzZWxmLl9yZXNvbHZlKHBhdGgpLCBmbGFn cywgMDY2NikKPiArICAgICAgICBleGNlcHQgT1NFcnJvciBhcyBlOgo+ICsgICAgICAgICAgICBy ZXR1cm4gc3RydWN0LnBhY2soJyFJSScsIDAsIGUuZXJybm8pCj4gKyAgICAgICAgaCA9IHNlbGYu X2FsbG9jX2hhbmRsZSgpCj4gKyAgICAgICAgc2VsZi5maWxlc1toXSA9IGYKPiArICAgICAgICBz aXplID0gb3MubHNlZWsoZiwgMCwgb3MuU0VFS19FTkQpCj4gKyAgICAgICAgcmV0dXJuIHN0cnVj dC5wYWNrKCchSUknLCBoLCBzaXplKQo+ICsKPiArICAgIGRlZiBoYW5kbGVfcmVhZChzZWxmLCBw YXJhbXMpOgo+ICsgICAgICAgIGgsIHBvcywgc2l6ZSA9IHN0cnVjdC51bnBhY2soJyFJSUknLCBw YXJhbXMpCj4gKyAgICAgICAgZiA9IHNlbGYuZmlsZXNbaF0KPiArICAgICAgICBvcy5sc2Vlayhm LCBwb3MsIG9zLlNFRUtfU0VUKQo+ICsgICAgICAgIHNpemUgPSBtaW4oc2l6ZSwgNDA5NikKPiAr ICAgICAgICByZXR1cm4gb3MucmVhZChmLCBzaXplKQo+ICsKPiArICAgIGRlZiBoYW5kbGVfd3Jp dGUoc2VsZiwgcGFyYW1zKToKPiArICAgICAgICBoLCBwb3MgPSBzdHJ1Y3QudW5wYWNrKCchSUkn LCBwYXJhbXNbOjhdKQo+ICsgICAgICAgIHBheWxvYWQgPSBwYXJhbXNbODpdCj4gKyAgICAgICAg ZiA9IHNlbGYuZmlsZXNbaF0KPiArICAgICAgICBwb3MgPSBvcy5sc2VlayhmLCBwb3MsIG9zLlNF RUtfU0VUKQo+ICsgICAgICAgIGFzc2VydCBvcy53cml0ZShmLCBwYXlsb2FkKSA9PSBsZW4ocGF5 bG9hZCkKPiArICAgICAgICByZXR1cm4gIiIK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ICAgICAgICBmc3JldHVybiA9IFJhdHBGU1BhY2tldCh0eXBlPVJhdHBGU1R5cGUuaW52YWxpZCkK PiArICAgICAgICBlbGlmIGZzY2FsbC50eXBlID09IFJhdHBGU1R5cGUubW91bnRfY2FsbDoKPiAr ICAgICAgICAgICAgc2VsZi5tb3VudGVkID0gVHJ1ZQo+ICsgICAgICAgICAgICBmc3JldHVybiA9 IFJhdHBGU1BhY2tldCh0eXBlPVJhdHBGU1R5cGUubW91bnRfcmV0dXJuKQo+ICsgICAgICAgIGVs aWYgbm90IHNlbGYubW91bnRlZDoKPiArICAgICAgICAgICAgbG9nZ2luZy53YXJuaW5nKCJmaWxl c3lzdGVtIG5vdCBtb3VudGVkIikKPiArICAgICAgICAgICAgZnNyZXR1cm4gPSBSYXRwRlNQYWNr ZXQodHlwZT1SYXRwRlNUeXBlLmludmFsaWQpCj4gKyAgICAgICAgZWxpZiBmc2NhbGwudHlwZSA9 PSBSYXRwRlNUeXBlLnJlYWRkaXJfY2FsbDoKPiArICAgICAgICAgICAgcGF5bG9hZCA9IHNlbGYu aGFuZGxlX3JlYWRkaXIoZnNjYWxsLnBheWxvYWQpCj4gKyAgICAgICAgICAgIGZzcmV0dXJuID0g UmF0cEZTUGFja2V0KHR5cGU9UmF0cEZTVHlwZS5yZWFkZGlyX3JldHVybiwKPiArICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF5bG9hZD1wYXlsb2FkKQo+ICsgICAgICAgIGVs aWYgZnNjYWxsLnR5cGUgPT0gUmF0cEZTVHlwZS5zdGF0X2NhbGw6Cj4gKyAgICAgICAgICAgIHBh eWxvYWQgPSBzZWxmLmhhbmRsZV9zdGF0KGZzY2FsbC5wYXlsb2FkKQo+ICsgICAgICAgICAgICBm c3JldHVybiA9IFJhdHBGU1BhY2tldCh0eXBlPVJhdHBGU1R5cGUuc3RhdF9yZXR1cm4sCj4gKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBheWxvYWQ9cGF5bG9hZCkKPiArICAg ICAgICBlbGlmIGZzY2FsbC50eXBlID09IFJhdHBGU1R5cGUub3Blbl9jYWxsOgo+ICsgICAgICAg ICAgICBwYXlsb2FkID0gc2VsZi5oYW5kbGVfb3Blbihmc2NhbGwucGF5bG9hZCkKPiArICAgICAg ICAgICAgZnNyZXR1cm4gPSBSYXRwRlNQYWNrZXQodHlwZT1SYXRwRlNUeXBlLm9wZW5fcmV0dXJu LAo+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXlsb2FkPXBheWxvYWQp Cj4gKyAgICAgICAgZWxpZiBmc2NhbGwudHlwZSA9PSBSYXRwRlNUeXBlLnJlYWRfY2FsbDoKPiAr ICAgICAgICAgICAgcGF5bG9hZCA9IHNlbGYuaGFuZGxlX3JlYWQoZnNjYWxsLnBheWxvYWQpCj4g KyAgICAgICAgICAgIGZzcmV0dXJuID0gUmF0cEZTUGFja2V0KHR5cGU9UmF0cEZTVHlwZS5yZWFk X3JldHVybiwKPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF5bG9hZD1w YXlsb2FkKQo+ICsgICAgICAgIGVsaWYgZnNjYWxsLnR5cGUgPT0gUmF0cEZTVHlwZS53cml0ZV9j YWxsOgo+ICsgICAgICAgICAgICBwYXlsb2FkID0gc2VsZi5oYW5kbGVfd3JpdGUoZnNjYWxsLnBh eWxvYWQpCj4gKyAgICAgICAgICAgIGZzcmV0dXJuID0gUmF0cEZTUGFja2V0KHR5cGU9UmF0cEZT VHlwZS53cml0ZV9yZXR1cm4sCj4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHBheWxvYWQ9cGF5bG9hZCkKPiArICAgICAgICBlbGlmIGZzY2FsbC50eXBlID09IFJhdHBGU1R5 cGUuY2xvc2VfY2FsbDoKPiArICAgICAgICAgICAgcGF5bG9hZCA9IHNlbGYuaGFuZGxlX2Nsb3Nl KGZzY2FsbC5wYXlsb2FkKQo+ICsgICA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j bGVhbnVwKQo+ICsKPiArICAgIGRlZiBydW4oc2VsZik6Cj4gKyAgICAgICAgd2hpbGUgVHJ1ZToK PiArICAgICAgICAgICAgYyA9IG9zLnJlYWQoc2VsZi5mZCwgMSkKPiArICAgICAgICAgICAgaWYg YyA9PSBzZWxmLl9leGl0Ogo+ICsgICAgICAgICAgICAgICAgc2VsZi5xLnB1dCgoc2VsZiwgTm9u ZSkpCj4gKyAgICAgICAgICAgICAgICByZXR1cm4KPiArICAgICAgICAgICAgZWxzZToKPiArICAg ICAgICAgICAgICAgIHNlbGYucS5wdXQoKHNlbGYsIGMpKQo+ICsKPiAraWYgX19uYW1lX18gPT0g Il9fbWFpbl9fIjoKPiArICAgIHEgPSBRdWV1ZSgpCj4gKyAgICBpID0gQ29uc29sZUlucHV0KHEp Cj4gKyAgICBpLnN0YXJ0KCkKPiArICAgIHdoaWxlIFRydWU6Cj4gKyAgICAgICAgZXZlbnQgPSBx LmdldChibG9jaz1UcnVlKQo+ICsgICAgICAgIHNyYywgYyA9IGV2ZW50Cj4gKyAgICAgICAgaWYg YyA9PSAnXHgwNCc6Cj4gKyAgICAgICAgICAgIGJyZWFrCj4gKyAgICAgICAgb3Mud3JpdGUoc3lz LnN0ZG91dC5maWxlbm8oKSwgYy51cHBlcigpKQo+ICsKPiAtLQo+IDIuNi40Cj4KPgo+IF9fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCj4gYmFyZWJveCBtYWls aW5nIGxpc3QKPiBiYXJlYm94QGxpc3RzLmluZnJhZGVhZC5vcmcKPiBodHRwOi8vbGlzdHMuaW5m cmFkZWFkLm9yZy9tYWlsbWFuL2xpc3RpbmZvL2JhcmVib3gKCl9fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fCmJhcmVib3ggbWFpbGluZyBsaXN0CmJhcmVib3hA bGlzdHMuaW5mcmFkZWFkLm9yZwpodHRwOi8vbGlzdHMuaW5mcmFkZWFkLm9yZy9tYWlsbWFuL2xp c3RpbmZvL2JhcmVib3gK