Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp733142lqt; Thu, 6 Jun 2024 17:49:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU/Oq59PJhNPgeHkf7IB+npUjWSEJ9QaEBL4BkDx29srbRB1ZK5rHiGLhkkGNe4zu1ArTUcqvMlkzTidQ6VZ3O68k5u1tc9/rSnh6rgEg== X-Google-Smtp-Source: AGHT+IFzHMkukC60joe/oQzbEcKDiqqAE04SC+z6YXka5MMnMZAwDQNpkuylhlNTAXfvq1BWdQZ0 X-Received: by 2002:a50:d718:0:b0:57c:46cb:a984 with SMTP id 4fb4d7f45d1cf-57c50883fc4mr495113a12.5.1717721366788; Thu, 06 Jun 2024 17:49:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717721366; cv=pass; d=google.com; s=arc-20160816; b=Kwb8hpbEhPzW/PDsqdPs75LwW/iZ6WnfnmNl71ZVH3xdc1YPWhry3FIT/fmbnYbLpM ZreW53aw7D8HG/eGB3VTn4fb46pxi+G/yQxbT7y6WqJNFx/au4FAqCKncveXM/lUIfGC CapOkmbCy1H2Gbb7NbxqA3gMug3we83YtTDKCJfVpNN95F1jlgYrVyPPGdFM5Gi/mvkp ZRwNVOZwBFEsgntCft0GAJzZJeqs25Ii1/w+WejsCz0XAvq0M1GzsTISB1P0+i7sbfZ/ cBGtBLOLdZNmeMk7YaIp6iGDKNRjJgV24fdbF4tgiW6vNR7c2aUttzfDmhaHjHuECMlU 9VRg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:message-id:reply-to:cc:to:from:date; bh=rcBMPVmKHAwcGO5NC2buAy/pTZcCcvESkinnNyeduXw=; fh=9gBO8iT5O8vnHW+7Crr7Ie0bFucH9Il7UtwGiTwjlMU=; b=Xrqqyp4CJGt7MVPVkWC5VrjXRQ+JtLIOxFkE8Cdvjb6vsiwzEwAzw9zw6fGeMLsoWF t2VXRNW6pYGirxk14JvjtEn7LmZ9fRU8p1rDyJjkR0MV/pue+DJzfITMo41S6x7HdXr0 W/4+W5NByLuDbV2/fezIqbVUyF1TE/YPoFQ/sVS5GjYcJL3MbfQ6zp38Bz+mkF6Cj92T w1nMvRuzKEguQLZrUzOOtx7HfnCIhyP2Q0JE+pN935gCl1KrMZkZl8MECNcVKCu3vUvl ns1EEtzY3pi+0MQLdSDbG0rdXIPOqSN1U6ll8dd7H8mvIkdIWoTWf5rDnuVCrl/vZMxT OFMw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=ubisectech.com); spf=pass (google.com: domain of linux-kernel+bounces-205190-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205190-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57aae0fc1d5si1265239a12.191.2024.06.06.17.49.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 17:49:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205190-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=ubisectech.com); spf=pass (google.com: domain of linux-kernel+bounces-205190-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205190-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id F10CE1F2444B for ; Fri, 7 Jun 2024 00:49:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DFFD49474; Fri, 7 Jun 2024 00:49:21 +0000 (UTC) Received: from out28-3.mail.aliyun.com (out28-3.mail.aliyun.com [115.124.28.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 254CA23AD for ; Fri, 7 Jun 2024 00:49:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.28.3 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717721355; cv=none; b=LQ0KYTb2mryPqT529SJbgG5+7RC/ZMl+/VBR1CU3KCH1SWMWyGsukDTuO2vtixTTs/Cc/A+wS533emctYxJlpcN61u1xzdn16U0dcObOhstfretW5xNePAtNusHrYPZc3wZeJqcXmdfr1RfgI+bMp7cbWJX/YIIY2JLdNs7BY9M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717721355; c=relaxed/simple; bh=rcBMPVmKHAwcGO5NC2buAy/pTZcCcvESkinnNyeduXw=; h=Date:From:To:Cc:Message-ID:Subject:MIME-Version:Content-Type; b=i6W9AaHmltMXhcaHzd57eGlrW2L03Zli15ek0pADl+2CTp1WvnVQarfyScwHgcKq0dCi+HMMPMzsk+D3NSjlLJgqxd5WO+Hl8gL20yYiZ2kuweg9kIEnuqb0W+FZ9woY1AZb3Rf8HFfOitl+Oqs9LNFQ5+Y1x5QU+KcCcvt2EWE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ubisectech.com; spf=pass smtp.mailfrom=ubisectech.com; arc=none smtp.client-ip=115.124.28.3 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ubisectech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ubisectech.com X-Alimail-AntiSpam:AC=CONTINUE;BC=0.07386655|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_system_inform|0.0181632-0.000634475-0.981202;FP=0|0|0|0|0|0|0|0;HT=maildocker-contentspam033071120082;MF=bugreport@ubisectech.com;NM=1;PH=DW;RN=10;RT=10;SR=0;TI=W4_0.2.3_v5ForWebDing_21250BAF_1717721209242_o7001c3286; Received: from WS-web (bugreport@ubisectech.com[W4_0.2.3_v5ForWebDing_21250BAF_1717721209242_o7001c3286]) at Fri, 07 Jun 2024 08:48:58 +0800 Date: Fri, 07 Jun 2024 08:48:58 +0800 From: "Ubisectech Sirius" To: "linux-kernel" Cc: "marcan" , "sven" , "marcel" , "luiz.dentz" , "johan.hedberg" , "davem" , "edumazet" , "pabeni" , "kuba" Reply-To: "Ubisectech Sirius" Message-ID: <27bdd414-dc29-449f-9814-2404a5874dd6.bugreport@ubisectech.com> Subject: =?UTF-8?B?S0FTQU46IHNsYWItdXNlLWFmdGVyLWZyZWUgUmVhZCBpbiBsb2NrX3NvY2tfbmVzdGVk?= X-Mailer: [Alimail-Mailagent][W4_0.2.3][v5ForWebDing][Chrome] Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 x-aliyun-im-through: {"mailThroughImNew":true} x-aliyun-mail-creator: W4_0.2.3_v5ForWebDing_M3LTW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzEyNS4wLjAuMCBTYWZhcmkvNTM3LjM2vN Content-Type: multipart/mixed; boundary="----=ALIBOUNDARY_1730_7f58dc35d700_666258fa_197702" This is a multi-part message in MIME format. ------=ALIBOUNDARY_1730_7f58dc35d700_666258fa_197702 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: base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ZmIgZmIgZmIg ZmIgZmIgZmIgZmIgZmIgZmIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF4K IGZmZmY4ODgwMjBkMDMxMDA6IGZiIGZiIGZiIGZiIGZiIGZiIGZiIGZiIGZiIGZiIGZiIGZiIGZi IGZiIGZiIGZiCiBmZmZmODg4MDIwZDAzMTgwOiBmYiBmYiBmYiBmYiBmYiBmYiBmYiBmYiBmYiBm YiBmYiBmYiBmYiBmYiBmYiBmYgo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KClRoYW5rIHlvdSBmb3IgdGFraW5nIHRoZSB0 aW1lIHRvIHJlYWQgdGhpcyBlbWFpbCBhbmQgd2UgbG9vayBmb3J3YXJkIHRvIHdvcmtpbmcgd2l0 aCB5b3UgZnVydGhlci4KCgoKCgoKCg== ------=ALIBOUNDARY_1730_7f58dc35d700_666258fa_197702 Content-Type: application/octet-stream Content-Disposition: attachment; filename="=?UTF-8?B?cG9jLmM=?=" Content-Transfer-Encoding: base64 Ly8gYXV0b2dlbmVyYXRlZCBieSBzeXprYWxsZXIgKGh0dHBzOi8vZ2l0aHViLmNvbS9nb29nbGUv c3l6a2FsbGVyKQoKI2RlZmluZSBfR05VX1NPVVJDRQoKI2luY2x1ZGUgPGFycGEvaW5ldC5oPgoj aW5jbHVkZSA8ZGlyZW50Lmg+CiNpbmNsdWRlIDxlbmRpYW4uaD4KI2luY2x1ZGUgPGVycm5vLmg+ CiNpbmNsdWRlIDxmY250bC5oPgojaW5jbHVkZSA8bmV0L2lmLmg+CiNpbmNsdWRlIDxuZXQvaWZf YXJwLmg+CiNpbmNsdWRlIDxuZXRpbmV0L2luLmg+CiNpbmNsdWRlIDxwdGhyZWFkLmg+CiNpbmNs dWRlIDxzY2hlZC5oPgojaW5jbHVkZSA8c2V0am1wLmg+CiNpbmNsdWRlIDxzaWduYWwuaD4KI2lu Y2x1ZGUgPHN0Z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wogIHNhLnNhX2hhbmRsZXIgPSBTSUdfSUdOOwogIHN5c2NhbGwo U1lTX3J0X3NpZ2FjdGlvbiwgMHgyMCwgJnNhLCBOVUxMLCA4KTsKICBzeXNjYWxsKFNZU19ydF9z aWdhY3Rpb24sIDB4MjEsICZzYSwgTlVMTCwgOCk7CiAgbWVtc2V0KCZzYSwgMCwgc2l6ZW9mKHNh KSk7CiAgc2Euc2Ffc2lnYWN0aW9uID0gc2Vndl9oYW5kbGVyOwogIHNhLnNhX2ZsYWdzID0gU0Ff Tk9ERUZFUiB8IFNBX1NJR0lORk87CiAgc2lnYWN0aW9uKFNJR1NFR1YsICZzYSwgTlVMTCk7CiAg c2lnYWN0aW9uKFNJR0JVUywgJnNhLCBOVUxMKTsKfQoKI2RlZmluZSBOT05GQUlMSU5HKC4uLikg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwK ICAoeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIFwKICAgIGludCBvayA9IDE7ICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgIF9fYXRv bWljX2ZldGNoX2FkZCgmc2tpcF9zZWd2LCAxLCBfX0FUT01JQ19TRVFfQ1NUKTsgICAgICAgICAg ICAgICAgICAgICAgIFwKICAgIGlmIChfc2V0am1wKHNlZ3ZfZW52KSA9PSAwKSB7ICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgX19WQV9BUkdTX187 ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIFwKICAgIH0gZWxzZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgb2sgPSAwOyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAg IF9fYXRvbWljX2ZldGNoX3N1Yigmc2tpcF9zZWd2LCAxLCBfX0FUT01JQ19TRVFfQ1NUKTsgICAg ICAgICAgICAgICAgICAgICAgIFwKICAgIG9rOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICB9KQoKc3RhdGlj IHZvaWQgc2xlZXBfbXModWludDY0X3QgbXMpCnsKICB1c2xlZXAobXMgKiAxMDAwKTsKfQoKc3Rh dGljIHVpbnQ2NF90IGN1cnJlbnRfdGltZV9tcyh2b2lkKQp7CiAgc3RydWN0IHRpbWVzcGVjIHRz OwogIGlmIChjbG9ja19nZXR0aW1lKENMT0NLX01PTk9UT05JQywgJnRzKSkKICAgIGV4aXQoMSk7 CiAgcmV0dXJuICh1aW50NjRfdCl0cy50dl9zZWMgKiAxMDAwICsgKHVpbnQ2NF90KXRzLnR2X25z ZWMgLyAxMDAwMDAwOwp9CgpzdGF0aWMgdm9pZCB1c2VfdGVtcG9yYXJ5X2Rpcih2b2lkKQp7CiAg Y2hhciB0bXBkaXJfdGVtcGxhdGVbXSA9ICIuL3N5emthbGxlci5YWFhYWFgiOwogIGNoYXIqIHRt cGRpciA9IG1rZHRlbXAodG1wZGlyX3RlbXBsYXRlKTsKICBpZiAoIXRtcGRpcikKICAgIGV4aXQo MSk7CiAgaWYgKGNobW9kKHRtcGRpciwgMDc3NykpCiAgICBleGl0KDEpOwogIGlmIChjaGRpcih0 bXBkaXIpKQogICAgZXhpdCgxKTsKfQoKc3RhdGljIHZvaWQgdGhyZWFkX3N0YXJ0KHZvaWQqICgq Zm4pKHZvaWQqKSwgdm9pZCogYXJnKQp7CiAgcHRocmVhZF90IHRoOwogIHB0aHJlYWRfYXR0cl90 IGF0dHI7CiAgcHRocmVhZF9hdHR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bWlseV9uYW1lLAogICAgICAgICAgICAgICBzdHJubGVuKGZhbWlseV9uYW1lLCBH RU5MX05BTVNJWiAtIDEpICsgMSk7CiAgaW50IG4gPSAwOwogIGludCBlcnIgPSBuZXRsaW5rX3Nl bmRfZXh0KG5sbXNnLCBzb2NrLCBHRU5MX0lEX0NUUkwsICZuLCBkb2ZhaWwpOwogIGlmIChlcnIg PCAwKSB7CiAgICByZXR1cm4gLTE7CiAgfQogIHVpbnQxNl90IGlkID0gMDsKICBzdHJ1Y3Qgbmxh dHRyKiBhdHRyID0gKHN0cnVjdCBubGF0dHIqKShubG1zZy0+YnVmICsgTkxNU0dfSERSTEVOICsK ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOTE1TR19BTElHTihzaXpl b2YoZ2VubGhkcikpKTsKICBmb3IgKDsgKGNoYXIqKWF0dHIgPCBubG1zZy0+YnVmICsgbjsKICAg ICAgIGF0dHIgPSAoc3RydWN0IG5sYXR0ciopKChjaGFyKilhdHRyICsgTkxNU0dfQUxJR04oYXR0 ci0+bmxhX2xlbikpKSB7CiAgICBpZiAoYXR0ci0+bmxhX3R5cGUgPT0gQ1RSTF9BVFRSX0ZBTUlM WV9JRCkgewogICAgICBpZCA9ICoodWludDE2X3QqKShhdHRyICsgMSk7CiAgICAgIGJyZWFrOwog ICAgfQogIH0KICBpZiAoIWlkKSB7CiAgICBlcnJubyA9IEVJTlZBTDsKICAgIHJldHVybiAtMTsK ICB9CiAgcmVjdihzb2NrLCBubG1zZy0+YnVmLCBzaXplb2Yobmxtc2ctPmJ1ZiksIDApOwogIHJl dHVybiBpZDsKfQoKc3RhdGljIGludCBuZXRsaW5rX25leHRfbXNnKHN0cnVjdCBubG1zZyogbmxt c2csIHVuc2lnbmVkIGludCBvZmZzZXQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNp Z25lZCBpbnQgdG90YWxfbGVuKQp7CiAgc3RydWN0IG5sbXNnaGRyKiBoZHIgPSAoc3Ryd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5hbWUsIGNvbnN0IGNoYXIqIGxpbmspCnsKICBuZXRsaW5rX2FkZF9kZXZpY2VfaW1w bChubG1zZywgdHlwZSwgbmFtZSwgZmFsc2UpOwogIG5ldGxpbmtfZG9uZShubG1zZyk7CiAgaW50 IGlmaW5kZXggPSBpZl9uYW1ldG9pbmRleChsaW5rKTsKICBuZXRsaW5rX2F0dHIobmxtc2csIElG TEFfTElOSywgJmlmaW5kZXgsIHNpemVvZihpZmluZGV4KSk7CiAgaW50IGVyciA9IG5ldGxpbmtf c2VuZChubG1zZywgc29jayk7CiAgaWYgKGVyciA8IDApIHsKICB9Cn0KCnN0YXRpYyB2b2lkIG5l dGxpbmtfYWRkX3ZsYW4oc3RydWN0IG5sbXNnKiBubG1zZywgaW50IHNvY2ssIGNvbnN0IGNoYXIq IG5hbWUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciogbGluaywgdWlu dDE2X3QgaWQsIHVpbnQxNl90IHByb3RvKQp7CiAgbmV0bGlua19hZGRfZGV2aWNlX2ltcGwobmxt c2csICJ2bGFuIiwgbmFtZSwgZmFsc2UpOwogIG5ldGxpbmtfbmVzdChubG1zZywgSUZMQV9JTkZP X0RBVEEpOwogIG5ldGxpbmtfYXR0cihubG1zZywgSUZMQV9WTEFOX0lELCAmaWQsIHNpemVvZihp ZCkpOwogIG5ldGxpbmtfYXR0cihubG1zZywgSUZMQV9WTEFOX1BST1RPQ09MLCAmcHJvdG8sIHNp emVvZihwcm90bykpOwogIG5ldGxpbmtfZG9uZShubG1zZyk7CiAgbmV0bGlua19kb25lKG5sbXNn KTsKICBpbnQgaWZpbmRleCA9IGlmX25hbWV0b2luZGV4KGxpbmspOwogIG5ldGxpbmtfYXR0cihu bG1zZywgSUZMQV9MSU5LLCAmaWZpbmRleCwgc2l6ZW9mKGlmaW5kZXgpKTsKICBpbnQgZXJyID0g bmV0bGlua19zZW5kKG5sbXNnLCBzb2NrKTsKICBpZiAoZXJyIDwgMCkgewogIH0KfQoKc3RhdGlj IHZvaWQgbmV0bGlua19hZGRfbWFjdmxhbihzdHJ1Y3Qgbmxtc2cqIG5sbXNnLCBpbnQgc29jaywg Y29uc3QgY2hhciogbmFtZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBj aGFyKiBsaW5rKQp7CiAgbmV0bGlua19hZGRfZGV2aWNlX2ltcGwobmxtc2csICJtYWN2bGFuIiwg bmFtZSwgZmFsc2UpOwogIG5ldGxpbmtfbmVzdChubG1zZywgSUZMQV9JTkZPX0RBVEEpOwogIHVp bnQzMl90IG1vZGUgPSBNQUNWTEFOX01PREVfQlJJREdFOwogIG5ldGxpbmtfYXR0cihubG1zZywg SUZMQV9NQUNWTEFOX01PREUsICZtb2RlLCBzaXplb2YobW9kZSkpOwogIG5ldGxpbmtfZG9uZShu bG1zZyk7CiAgbmV0bGlua19kb25lKG5sbXNnKTsKICBpbnQgaWZpbmRleCA9IGlmX25hbWV0b2lu ZGV4KGxpbmspOwogIG5ldGxpbmtfYXR0cihubG1zZywgSUZMQV9MSU5LLCAmaWZpbmRleCwgc2l6 ZW9mKGlmaW5kZXgpKTsKICBpbnQgZXJyID0gbmV0bGlua19zZW5kKG5sbXNnLCBzb2NrKTsKICBp ZiAoZXJyIDwgMCkgewogIH0KfQoKc3RhdGljIHZvaWQgbmV0bGlua19hZGRfZ2VuZXZlKHN0cnVj dCBubG1zZyogbmxtc2csIGludCBzb2NrLCBjb25zdCBjaGFyKiBuYW1lLAogICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgdWludDMyX3Qgdm5pLCBzdHJ1Y3QgaW5fYWRkciogYWRkcjQsCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaW42X2FkZHIqIGFkZHI2KQp7CiAg bmV0bGlua19hZGRfZGV2aWNlX2ltcGwobmxtc2csICJnZW5ldmUiLCBuYW1lLCBmYWxzZSk7CiAg bmV0bGlua19uZXN0KG5sbXNnLCBJRkxBX0lOR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mxhZ3MpKTsKICBu ZXRsaW5rX2RvbmUobmxtc2cpOwogIG5ldGxpbmtfZG9uZShubG1zZyk7CiAgaW50IGlmaW5kZXgg PSBpZl9uYW1ldG9pbmRleChsaW5rKTsKICBuZXRsaW5rX2F0dHIobmxtc2csIElGTEFfTElOSywg JmlmaW5kZXgsIHNpemVvZihpZmluZGV4KSk7CiAgaW50IGVyciA9IG5ldGxpbmtfc2VuZChubG1z Zywgc29jayk7CiAgaWYgKGVyciA8IDApIHsKICB9Cn0KCnN0YXRpYyB2b2lkIG5ldGxpbmtfZGV2 aWNlX2NoYW5nZShzdHJ1Y3Qgbmxtc2cqIG5sbXNnLCBpbnQgc29jaywKICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIqIG5hbWUsIGJvb2wgdXAsIGNvbnN0IGNoYXIq IG1hc3RlciwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZvaWQqIG1h YywgaW50IG1hY3NpemUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBj aGFyKiBuZXdfbmFtZSkKewogIHN0cnVjdCBpZmluZm9tc2cgaGRyOwogIG1lbXNldCgmaGRyLCAw LCBzaXplb2YoaGRyKSk7CiAgaWYgKHVwKQogICAgaGRyLmlmaV9mbGFncyA9IGhkci5pZmlfY2hh bmdlID0gSUZGX1VQOwogIGhkci5pZmlfaW5kZXggPSBpZl9uYW1ldG9pbmRleChuYW1lKTsKICBu ZXRsaW5rX2luaXQobmxtc2csIFJUTV9ORVdMSU5LLCAwLCAmaGRyLCBzaXplb2YoaGRyKSk7CiAg aWYgKG5ld19uYW1lKQogICAgbmV0bGlua19hdHRyKG5sbXNnLCBJRkxBX0lGTkFNRSwgbmV3X25h bWUsIHN0cmxlbihuZXdfbmFtZSkpOwogIGlmIChtYXN0ZXIpIHsKICAgIGludCBpZmluZGV4ID0g aWZfbmFtZXRvaW5kZXgobWFzdGVyKTsKICAgIG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LX0FUVFJfTkVUREVWX05BTUUgNwoKc3RhdGljIHN0cnVjdCBu bG1zZyBubG1zZzI7CgpzdGF0aWMgdm9pZCBpbml0aWFsaXplX2RldmxpbmtfcG9ydHMoY29uc3Qg Y2hhciogYnVzX25hbWUsIGNvbnN0IGNoYXIqIGRldl9uYW1lLAogICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciogbmV0ZGV2X3ByZWZpeCkKewogIHN0cnVjdCBn ZW5sbXNnaGRyIGdlbmxoZHI7CiAgaW50IGxlbiwgdG90YWxfbGVuLCBpZCwgZXJyLCBvZmZzZXQ7 CiAgdWludDE2X3QgbmV0ZGV2X2luZGV4OwogIGludCBzb2NrID0gc29ja2V0KEFGX05FVExJTkss IFNPQ0tfUkFXLCBORVRMSU5LX0dFTkVSSUMpOwogIGlmIChzb2NrID09IC0xKQogICAgZXhpdCgx KTsKICBpbnQgcnRzb2NrID0gc29ja2V0KEFGX05FVExJTkssIFNPQ0tfUkFXLCBORVRMSU5LX1JP VVRFKTsKICBpZiAocnRzb2NrID09IC0xKQogICAgZXhpdCgxKTsKICBpZCA9IG5ldGxpbmtfcXVl cnlfZmFtaWx5X2lkKCZubG1zZywgc29jaywgREVWTElOS19GQU1JTFlfTkFNRSwgdHJ1ZSk7CiAg aWYgKGlkID09IC0xKQogICAgZ290byBlcnJvcjsKICBtZW1zZXQoJmdlbmxoZHIsIDAsIHNpemVv ZihnZW5saGRyKSk7CiAgZ2VubGhkci5jbWQgPSBERVZMSU5LX0NNRF9QT1JUX0dFVDsKICBuZXRs aW5rX2luaXQoJm5sbXNnLCBpZCwgTkxNX0ZfRFVNUCwgJmdlbmxoZHIsIHNpemVvZihnZW5saGRy KSk7CiAgbmV0bGlua19hdHRyKCZubG1zZywgREVWTElOS19BVFRSX0JVU19OQU1FLCBidXNfbmFt ZSwgc3RybGVuKGJ1c19uYW1lKSArIDEpOwogIG5ldGxpbmtfYXR0cigmbmxtc2csIERFVkxJTktf QVRUUl9ERVZfTkFNRSwgZGV2X25hbWUsIHN0cmxlbihkZXZfbmFtZSkgKyAxKTsKICBlcnIgPSBu ZXRsaW5rX3NlbmRfZXh0KCZubG1zZywgc29jaywgaWQsICZ0b3RhbF9sZW4sIHRydWUpOwogIGlm IChlcnIgPCAwKSB7CiAgICBnb3RvIGVycm9yOwogIH0KICBvZmZzZXQgPSAwOwogIG5ldGRldl9p bmRleCA9IDA7CiAgd2hpbGUgKChsZW4gPSBuZXRsaW5rX25leHRfbXNnKCZubG1zZywgb2Zmc2V0 LCB0b3RhbF9sZW4pKSAhPSAtMSkgewogICAgc3RydWN0IG5sYXR0ciogYXR0ciA9IChzdHJ1Y3Qg bmxhdHRyKikobmxtc2cuYnVmICsgb2Zmc2V0ICsgTkxNU0dfSERSTEVOICsKICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5MTVNHX0FMSUdOKHNpemVvZihnZW5saGRy KSkpOwogICAgZm9yICg7IChjaGFyKilhdHRyIDwgbmxtc2cuYnVmICsgb2Zmc2V0ICsgbGVuOwog ICAgICAgICBhdHRyID0gKHN0cnVjdCBubGF0dHIqKSgoY2hhciopYXR0ciArIE5MTVNHX0FMSUdO KGF0dHItPm5sYV9sZW4pKSkgewogICAgICBpZiAoYXR0ci0+bmxhX3R5cGUgPT0gREVWTElOS19B VFRSX05FVERFVl9OQU1FKSB7CiAgICAgICAgY2hhciogcG9ydF9uYW1lOwogICAgICAgIGNoYXIg bmV0ZGV2X25hbWVbSUZOQU1TSVpdOwogICAgICAgIHBvcnRfbmFtZSA9IChjaGFyKikoYXR0ciAr IDEpOwogICAgICAgIHNucHJpbnRmKG5ldGRldl9uYW1lLCBzaXplb2YobmV0ZGV2X25hbWUpLCAi JXMlZCIsIG5ldGRldl9wcmVmaXgsCiAgICAgICAgICAgICAgICAgbmV0ZGV2X2luZGV4KTsKICAg ICAgICBuZXRsaW5rX2RldmljZV9jaGFuZ2UoJm5sbXNnMiwgcnRzb2NrLCBwb3J0X25hbWUsIHRy dWUsIDAsIDAsIDAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldGRldl9uYW1lKTsK ICAgICAgICBicmVhazsKICAgICAgfQogICAgfQogICAgb2Zmc2V0ICs9IGxlbjsKICAgIG5ldGRl dl9pbmRleCsrOwogIH0KZXJyb3I6CiAgY2xvc2UocnRzb2NrKTsKICBjbG9zZShzb2NrKTsKfQoK I2RlZmluZSBXSUZJX0lOSVRJQUxfREVWSUNFX0NPVU5UIDIKI2RlZmluZSBXSUZJX01BQ19CQVNF ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IFwKICB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgIDB4MDgsIDB4MDIsIDB4MTEsIDB4MDAsIDB4 MDAsIDB4MDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICB9CiNk ZWZpbmUgV0lGSV9JQlNTX0JTU0lEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBcCiAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAgICAweDUwLCAw eDUwLCAweDUwLCAweDUwLCAweDUwLCAweDUwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBcCiAgfQojZGVmaW5lIFdJRklfSUJTU19TU0lEICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogIHsgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgXAogICAgMHgxMCwgMHgxMCwgMHgxMCwgMHgxMCwgMHgxMC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gaWYg KGVyciA8IDApIHsKICB9CiAgcmV0dXJuIGVycjsKfQoKc3RhdGljIGludCBnZXRfaWZsYV9vcGVy c3RhdGUoc3RydWN0IG5sbXNnKiBubG1zZywgaW50IGlmaW5kZXgsIGJvb2wgZG9mYWlsKQp7CiAg c3RydWN0IGlmaW5mb21zZyBpbmZvOwogIG1lbXNldCgmaW5mbywgMCwgc2l6ZW9mKGluZm8pKTsK ICBpbmZvLmlmaV9mYW1pbHkgPSBBRl9VTlNQRUM7CiAgaW5mby5pZmlfaW5kZXggPSBpZmluZGV4 OwogIGludCBzb2NrID0gc29ja2V0KEFGX05FVExJTkssIFNPQ0tfUkFXLCBORVRMSU5LX1JPVVRF KTsKICBpZiAoc29jayA9PSAtMSkgewogICAgcmV0dXJuIC0xOwogIH0KICBuZXRsaW5rX2luaXQo bmxtc2csIFJUTV9HRVRMSU5LLCAwLCAmaW5mbywgc2l6ZW9mKGluZm8pKTsKICBpbnQgbjsKICBp bnQgZXJyID0gbmV0bGlua19zZW5kX2V4dChubG1zZywgc29jaywgUlRNX05FV0xJTkssICZuLCBk b2ZhaWwpOwogIGNsb3NlKHNvY2spOwogIGlmIChlcnIpIHsKICAgIHJldHVybiAtMTsKICB9CiAg c3RydWN0IHJ0YXR0ciogYXR0ciA9IElGTEFfUlRBKE5MTVNHX0RBVEEobmxtc2ctPmJ1ZikpOwog IGZvciAoOyBSVEFfT0soYXR0ciwgbik7IGF0dHIgPSBSVEFfTkVYVChhdHRyLCBuKSkgewogICAg aWYgKGF0dHItPnJ0YV90eXBlID09IElGTEFfT1BFUlNUQVRFKQogICAgICByZXR1cm4gKigoaW50 MzJfdCopUlRBX0RBVEEoYXR0cikpOwogIH0KICByZXR1cm4gLTE7Cn0KCnN0YXRpYyBpbnQgYXdh aXRfaWZsYV9vcGVyc3RhdGUoc3RydWN0IG5sbXNnKiBubG1zZywgY2hhciogaW50ZXJmYWNlLAog ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBvcGVyc3RhdGUsIGJvb2wgZG9mYWls KQp7CiAgaW50IGlmaW5kZXggPSBpZl9uYW1ldG9pbmRleChpbnRlcmZhY2UpOwogIHdoaWxlICh0 cnVlKSB7CiAgICB1c2xlZXAoMTAwMCk7CiAgICBpbnQgcmV0ID0gZ2V0X2lmbGFfb3BlcnN0YXRl KG5sbXNnLCBpZmluZGV4LCBkb2ZhaWwpOwogICAgaWYgKHJldCA8IDApCiAgICAgIHJldHVybiBy ZXQ7CiAgICBpZiAocmV0ID09IG9wZXJzdGF0ZSkKICAgICAgcmV0dXJuIDA7CiAgfQogIHJldHVy biAwOwp9CgpzdGF0aWMgaW50IG5sODAyMTFfc2V0dXBfaWJzc19pbnRlcmZhY2Uoc3RydWN0IG5s bXNnKiBubG1zZywgaW50IHNvY2ssCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBpbnQgbmw4MDIxMV9mYW1pbHlfaWQsIGNoYXIqIGludGVyZmFjZSwKICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBqb2luX2lic3NfcHJvcHMqIGlic3Nf cHJvcHMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGRvZmFp bCkKewogIGludCBpZmluZGV4ID0gaWZfbmFtZXRvaW5kZXgoaW50ZXJmYWNlKTsKICBpZiAoaWZp bmRleCA9PSAwKSB7CiAgICByZXR1cm4gLTE7CiAgfQogIGludCByZXQgPSBubDgwMjExX3NldF9p bnRlcmZhY2Uobmxtc2csIHNvY2ssIG5sODAyMTFfZmFtaWx5X2lkLCBpZmluZGV4LAogICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgTkw4MDIxMV9JRlRZUEVfQURIT0MsIGRvZmFpbCk7 CiAgaWYgKHJldCA8IDApIHsKICAgIHJldHVybiAtMTsKICB9CiAgcmV0ID0gc2V0X2ludGVyZmFj ZV9zdGF0ZShpbnRlcmZhY2UsIDEpOwogIGlmIChyZXQgPCAwKSB7CiAgICByZXR1cm4gLTE7CiAg fQogIHJldCA9IG5sODAyMTFfam9pbl9pYnNzKG5sbXNnLCBzb2NrLCBubDgwMjExX2ZhbWlseV9p ZCwgaWZpbmRleCwgaWJzc19wcm9wcywKICAgICAgICAgICAgICAgICAgICAgICAgICBkb2ZhaWwp OwogIGlmIChyZXQgPCAwKSB7CiAgICByZXR1cm4gLTE7CiAgfQogIHJldHVybiAwOwp9CgpzdGF0 aWMgaW50IGh3c2ltODAyMTFfY3JlYXRlX2RldmljZShzdHJ1Y3Qgbmxtc2cqIG5sbXNnLCBpbnQg c29jaywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGh3c2ltX2ZhbWls eSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDhfdCBtYWNfYWRkcltF VEhfQUxFTl0pCnsKICBzdHJ1Y3QgZ2VubG1zZ2hkciBnZW5saGRyOwogIG1lbXNldCgmZ2VubGhk ciwgMCwgc2l6ZW9mKGdlbmxoZHIpKTsKICBnZW5saGRyLmNtZCA9IEhXU0lNX0NNRF9ORVdfUkFE SU87CiAgbmV0bGlua19pbml0KG5sbXNnLCBod3NpbV9mYW1pbHksIDAsICZnZW5saGRyLCBzaXpl b2YoZ2VubGhkcikpOwogIG5ldGxpbmtfYXR0cihubG1zZywgSFdTSU1fQVRUUl9TVVBQT1JUX1Ay UF9ERVZJQ0UsIE5VTEwsIDApOwogIG5ldGxpbmtfYXR0cihubG1zZywgSFdTSU1fQVRUUl9QRVJN X0FERFIsIG1hY19hZGRyLCBFVEhfQUxFTik7CiAgaW50IGVyciA9IG5ldGxpbmtfc2VuZChubG1z Zywgc29jayk7CiAgaWYgKGVyciA8IDApIHsKICB9CiAgcmV0dXJuIGVycjsKfQoKc3RhdGljIHZv aWQgaW5pdGlhbGl6ZV93aWZpX2RldmljZXModm9pZCkKewogIGludCByZmtpbGwgPSBvcGVuKCIv ZGV2L3Jma2lsbCIsIE9fUkR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J1ZSwg dHJ1ZX0sCiAgfTsKICB1bnNpZ25lZCBpOwogIGZvciAoaSA9IDA7IGkgPCBzaXplb2YoZGV2dHlw ZXMpIC8gc2l6ZW9mKGRldnR5cGVzWzBdKTsgaSsrKSB7CiAgICBjaGFyIGRldlszMl0sIGFkZHJb MzJdOwogICAgc3ByaW50ZihkZXYsICIlcyVkIiwgZGV2dHlwZXNbaV0udHlwZSwgKGludClwcm9j aWQpOwogICAgc3ByaW50ZihhZGRyLCAiMTcyLjMwLiVkLiVkIiwgaSwgKGludClwcm9jaWQgKyAx KTsKICAgIG5ldGxpbmtfYWRkX2FkZHI0KCZubG1zZywgc29jaywgZGV2LCBhZGRyKTsKICAgIGlm ICghZGV2dHlwZXNbaV0ubm9pcHY2KSB7CiAgICAgIHNwcmludGYoYWRkciwgImZlODg6OiUwMng6 JTAyeCIsIGksIChpbnQpcHJvY2lkICsgMSk7CiAgICAgIG5ldGxpbmtfYWRkX2FkZHI2KCZubG1z Zywgc29jaywgZGV2LCBhZGRyKTsKICAgIH0KICAgIGludCBtYWNzaXplID0gZGV2dHlwZXNbaV0u bWFjc2l6ZTsKICAgIHVpbnQ2NF90IG1hY2FkZHIgPSAweGJiYmJiYiArCiAgICAgICAgICAgICAg ICAgICAgICAgKCh1bnNpZ25lZCBsb25nIGxvbmcpaSA8PCAoOCAqIChtYWNzaXplIC0gMikpKSAr CiAgICAgICAgICAgICAgICAgICAgICAgKHByb2NpZCA8PCAoOCAqIChtYWNzaXplIC0gMSkpKTsK ICAgIG5ldGxpbmtfZGV2aWNlX2NoYW5nZSgmbmxtc2csIHNvY2ssIGRldiwgIWRldnR5cGVzW2ld Lm5vdXAsIDAsICZtYWNhZGRyLAogICAgICAgICAgICAgICAgICAgICAgICAgIG1hY3NpemUsIE5V TEwpOwogIH0KICBjbG9zZShzb2NrKTsKfQoKc3RhdGljIGludCByZWFkX3R1bihjaGFyKiBkYXRh LCBpbnQgc2l6ZSkKewogIGlmICh0dW5mZCA8IDApCi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xKTsKICAgIGlmICh0YWJsZS0+aW5mby5udW1fZW50cmllcyA+ IFhUX01BWF9FTlRSSUVTKQogICAgICBleGl0KDEpOwogICAgc3RydWN0IGlwdF9nZXRfZW50cmll cyBlbnRyaWVzOwogICAgbWVtc2V0KCZlbnRyaWVzLCAwLCBzaXplb2YoZW50cmllcykpOwogICAg c3RyY3B5KGVudHJpZXMubmFtZSwgdGFibGUtPm5hbWUpOwogICAgZW50cmllcy5zaXplID0gdGFi bGUtPmluZm8uc2l6ZTsKICAgIG9wdGxlbiA9IHNpemVvZihlbnRyaWVzKSAtIHNpemVvZihlbnRy aWVzLmVudHJ5dGFibGUpICsgdGFibGUtPmluZm8uc2l6ZTsKICAgIGlmIChnZXRzb2Nrb3B0KGZk LCBsZXZlbCwgSVBUX1NPX0dFVF9FTlRSSUVTLCAmZW50cmllcywgJm9wdGxlbikpCiAgICAgIGV4 aXQoMSk7CiAgICB0YWJsZS0+cmVwbGFjZS52YWxpZF9ob29rcyA9IHRhYmxlLT5pbmZvLnZhbGlk X2hvb2tzOwogICAgdGFibGUtPnJlcGxhY2UubnVtX2VudHJpZXMgPSB0YWJsZS0+aW5mby5udW1f ZW50cmllczsKICAgIHRhYmxlLT5yZXBsYWNlLnNpemUgPSB0YWJsZS0+aW5mby5zaXplOwogICAg bWVtY3B5KHRhYmxlLT5yZXBsYWNlLmhvb2tfZW50cnksIHRhYmxlLT5pbmZvLmhvb2tfZW50cnks CiAgICAgICAgICAgc2l6ZW9mKHRhYmxlLT5yZXBsYWNlLmhvb2tfZW50cnkpKTsKICAgIG1lbWNw eSh0YWJsZS0+cmVwbGFjZS51bmRlcmZsb3csIHRhYmxlLT5pbmZvLnVuZGVyZmxvdywKICAgICAg ICAgICBzaXplb2YodGFibGUtPnJlcGxhY2UudW5kZXJmbG93KSk7CiAgICBtZW1jcHkodGFibGUt PnJlcGxhY2UuZW50cnl0YWJsZSwgZW50cmllcy5lbnRyeXRhYmxlLCB0YWJsZS0+aW5mby5zaXpl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cHY0X3Rh YmxlcykgLyBzaXplb2YoaXB2NF90YWJsZXNbMF0pLAogICAgICAgICAgICAgICAgIEFGX0lORVQs IFNPTF9JUCk7CiAgcmVzZXRfaXB0YWJsZXMoaXB2Nl90YWJsZXMsIHNpemVvZihpcHY2X3RhYmxl cykgLyBzaXplb2YoaXB2Nl90YWJsZXNbMF0pLAogICAgICAgICAgICAgICAgIEFGX0lORVQ2LCBT T0xfSVBWNik7Cn0KCnN0YXRpYyB2b2lkIG1vdW50X2Nncm91cHMoY29uc3QgY2hhciogZGlyLCBj b25zdCBjaGFyKiogY29udHJvbGxlcnMsIGludCBjb3VudCkKewogIGlmIChta2RpcihkaXIsIDA3 NzcpKSB7CiAgICByZXR1cm47CiAgfQogIGNoYXIgZW5hYmxlZFsxMjhdID0gezB9OwogIGludCBp ID0gMDsKICBmb3IgKDsgaSA8IGNvdW50OyBpKyspIHsKICAgIGlmIChtb3VudCgibm9uZSIsIGRp ciwgImNncm91cCIsIDAsIGNvbnRyb2xsZXJzW2ldKSkgewogICAgICBjb250aW51ZTsKICAgIH0K ICAgIHVtb3VudChkaXIpOwogICAgc3RyY2F0KGVuYWJsZWQsICIsIik7CiAgICBzdHJjYXQoZW5h YmxlZCwgY29udHJvbGxlcnNbaV0pOwogIH0KICBpZiAoZW5hYmxlZFswXSA9PSAwKSB7CiAgICBp ZiAocm1kaXIoZGlyKSAmJiBlcnJubyAhPSBFQlVTWSkKICAgICAgZXhpdCgxKTsKICAgIHJldHVy bjsKICB9CiAgaWYgKG1vdW50KCJub25lIiwgZGlyLCAiY2dyb3VwIiwgMCwgZW5hYmxlZCArIDEp KSB7CiAgICBpZiAocm1kaXIoZGlyKSAmJiBlcnJubyAhPSBFQlVTWSkKICAgICAgZXhpdCgxKTsK ICB9CiAgaWYgKGNobW9kKGRpciwgMDc3NykpIHsKICB9Cn0KCnN0YXRpYyB2b2lkIG1vdW50X2Nn cm91cHMyKGNvbnN0IGNoYXIqKiBjb250cm9sbGVycywgaW50IGNvdW50KQp7CiAgaWYgKG1rZGly KCIvc3l6Y2dyb3VwL3VuaWZpZWQiLCAwNzc3KSkgewogICAgcmV0dXJuOwogIH0KICBpZiAobW91 bnQoIm5vbmUiLCAiL3N5emNncm91cC91bmlmaWVkIiwgImNncm91cDIiLCAwLCBOVUxMKSkgewog ICAgaWYgKHJtZGlyKCIvc3l6Y2dyb3VwL3VuaWZpZWQiKSAmJiBlcnJubyAhPSBFQlVTWSkKICAg ICAgZXhpdCgxKTsKICAgIHJldHVybjsKICB9CiAgaWYgKGNobW9kKCIvc3l6Y2dyb3VwL3VuaWZp ZWQiLCAwNzc3KSkgewogIH0KICBpbnQgY29udHJvbCA9IG9wZW4oIi9zeXpjZ3JvdXAvdW5pZmll ZC9jZ3JvdXAuc3VidHJlZV9jb250cm9sIiwgT19XUk9OTFkpOwogIGlmIChjb250cm9sID09IC0x KQogICAgcmV0dXJuOwogIGludCBpOwogIGZvciAoaSA9IDA7IGkgPCBjb3VudDsgaSsrKQogICAg aWYgKHdyaXRlKGNvbnRyb2wsIGNvbnRyb2xsZXJzW2ldLCBzdHJsZW4oY29udHJvbGxlcnNbaV0p KSA8IDApIHsKICAgIH0KICBjbG9zZShjb250cm9sKTsKfQoKc3RhdGljIHZvaWQgc2V0dXBfY2dy b3VwcygpCnsKICBjb25zdCBjaGFyKiB1bmlmaWVkX2NvbnRyb2xsZXJzW10gPSB7IitjcHUiLCAi K2lvIiwgIitwaWRzIn07CiAgY29uc3QgY2hhciogbmV0X2NvbnRyb2xsZXJzW10gPSB7Im5ldCIs ICJuZXRfcHJpbyIsICJkZXZpY2VzIiwgImJsa2lvIiwKICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAiZnJlZXplciJ9OwogIGNvbnN0IGNoYXIqIGNwdV9jb250cm9sbGVyc1tdID0g eyJjcHVzZXQiLCAiY3B1YWNjdCIsICJodWdldGxiIiwgInJsaW1pdCIsCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgI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0luaXROZXROc0ZkKSA8IDApCiAgICBleGl0 KDEpOwogIGNsb3NlKG5ldG5zKTsKICBzdHJ1Y3QgcmxpbWl0IHJsaW07CiAgcmxpbS5ybGltX2N1 ciA9IHJsaW0ucmxpbV9tYXggPSAoMjAwIDw8IDIwKTsKICBzZXRybGltaXQoUkxJTUlUX0FTLCAm cmxpbSk7CiAgcmxpbS5ybGltX2N1ciA9IHJsaW0ucmxpbV9tYXggPSAzMiA8PCAyMDsKICBzZXRy bGltaXQoUkxJTUlUX01FTUxPQ0ssICZybGltKTsKICBybGltLnJsaW1fY3VyID0gcmxpbS5ybGlt X21heCA9IDEzNiA8PCAyMDsKICBzZXRybGltaXQoUkxJTUlUX0ZTSVpFLCAmcmxpbSk7CiAgcmxp bS5ybGltX2N1ciA9IHJsaW0ucmxpbV9tYXggPSAxIDw8IDIwOwogIHNldHJsaW1pdChSTElNSVRf U1RBQ0ssICZybGltKTsKICBybGltLnJsaW1fY3VyID0gcmxpbS5ybGltX21heCA9IDEyOCA8PCAy MDsKICBzZXRybGltaXQoUkxJTUlUX0NPUkUsICZybGltKTsKICBybGltLnJsaW1fY3VyID0gcmxp bS5ybGltX21heCA9IDI1NjsKICBzZXRybGltaXQoUkxJTUlUX05PRklMRSwgJnJsaW0pOwogIGlm ICh1bnNoYXJlKENMT05FX05FV05TKSkgewogIH0KICBpZiAobW91bnQoTlVMTCwgIi8iLCBOVUxM LCBNU19SRUMgfCBNU19QUklWQVRFLCBOVUxMKSkgewogIH0KICBpZiAodW5zaGFyZShDTE9ORV9O RVdJUEMpKSB7CiAgfQogIGlmICh1bnNoYXJlKDB4MDIwMDAwMDApKSB7CiAgfQogIGlmICh1bnNo YXJlKENMT05FX05FV1VUUykpIHsKICB9CiAgaWYgKHVuc2hhcmUoQ0xPTkVfU1lTVlNFTSkpIHsK ICB9CiAgdHlwZWRlZiBzdHJ1Y3QgewogICAgY29uc3QgY2hhciogbmFtZTsKICAgIGNvbnN0IGNo YXIqIHZhbHVlOw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AgaW50IGk7CiAgICBmb3IgKGkgPSAw OzsgaSsrKSB7CiAgICAgIGlmICh1bmxpbmsoZmlsZW5hbWUpID09IDApCiAgICAgICAgYnJlYWs7 CiAgICAgIGlmIChlcnJubyA9PSBFUEVSTSkgewogICAgICAgIGludCBmZCA9IG9wZW4oZmlsZW5h bWUsIE9fUkRPTkxZKTsKICAgICAgICBpZiAoZmQgIT0gLTEpIHsKICAgICAgICAgIGxvbmcgZmxh Z3MgPSAwOwogICAgICAgICAgaWYgKGlvY3RsKGZkLCBGU19JT0NfU0VURkxBR1MsICZmbGFncykg PT0gMCkgewogICAgICAgICAgfQogICAgICAgICAgY2xvc2UoZmQpOwogICAgICAgICAgY29udGlu dWU7CiAgICAgICAgfQogICAgICB9CiAgICAgIGlmIChlcnJubyA9PSBFUk9GUykgewogICAgICAg IGJyZWFrOwogICAgICB9CiAgICAgIGlmIChlcnJubyAhPSBFQlVTWSB8fCBpID4gMTAwKQogICAg ICAgIGV4aXQoMSk7CiAgICAgIGlmICh1bW91bnQyKGZpbGVuYW1lLCB1bW91bnRfZmxhZ3MpKQog ICAgICAgIGV4aXQoMSk7CiAgICB9CiAgfQogIGNsb3NlZGlyKGRwKTsKICBmb3IgKGludCBpID0g MDs7IGkrKykgewogICAgaWYgKHJtZGlyKGRpcikgPT0gMCkKICAgICAgYnJlYWs7CiAgICBpZiAo aSA8IDEwMCkgewogICAgICBpZiAoZXJybm8gPT0gRVBFUk0pIHsKICAgICAgICBpbnQgZmQgPSBv cGVuKGRpciwgT19SRE9OTFkpOwogICAgICAgIGlmIChmZCAhPSAtMSkgewogICAgICAgICAgbG9u ZyBmbGFncyA9IDA7CiAgICAgICAgICBpZiAoaW9jdGwoZmQsIEZTX0lPQ19TRVRGTEFHUywgJmZs YWdzKSA9PSAwKSB7CiAgICAgICAgICB9CiAgICAgICAgICBjbG9zZShmZCk7CiAgICAgICAgICBj b250aW51ZTsKICAgICAgICB9CiAgICAgIH0KICAgICAgaWYgKGVycm5vID09IEVST0ZTKSB7CiAg ICAgICAgYnJlYWs7CiAgICAgIH0KICAgICAgaWYgKGVycm5vID09IEVCVVNZKSB7CiAgICAgICAg aWYgKHVtb3VudDIoZGlyLCB1bW91bnRfZmxhZ3MpKQogICAgICAgICAgZXhpdCgxKTsKICAgICAg ICBjb250aW51ZTsKICAgICAgfQogICAgICBpZiAoZXJybm8gPT0gRU5PVEVNUFRZKSB7CiAgICAg ICAgaWYgKGl0ZXIgPCAxMDApIHsKICAgICAgICAgIGl0ZXIrKzsKICAgICAgICAgIGdvdG8gcmV0 cnk7CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICBleGl0KDEpOwogIH0KfQoKc3RhdGljIHZv aWQga2lsbF9hbmRfd2FpdChpbnQgcGlkLCBpbnQqIHN0YXR1cykKewogIGtpbGwoLXBpZCwgU0lH S0lMTCk7CiAga2lsbChwaWQsIFNJR0tJTEwpOwogIGZvciAoaW50IGkgPSAwOyBpIDwgMTAwOyBp KyspIHsKICAgIGlmICh3YWl0cGlkKC0xLCBzdGF0dXMsIFdOT0hBTkcgfCBfX1dBTEwpID09IHBp ZCkKICAgICAgcmV0dXJuOwogICAgdXNsZWVwKDEwMDApOwogIH0KICBESVIqIGRpciA9IG9wZW5k aXIoIi9zeXMvZnMvZnVzZS9jb25uZWN0aW9ucyIpOwogIGlmIChkaXIpIHsKICAgIGZvciAoOzsp IHsKICAgICAgc3RydWN0IGRpcmVudCogZW50ID0gcmVhZGRpcihkaXIpOwogICAgICBpZiAoIWVu dCkKICAgICAgICBicmVhazsKICAgICAgaWYgKHN0cmNtcChlbnQtPmRfbmFtZSwgIi4iKSA9PSAw IHx8IHN0cmNtcChlbnQtPmRfbmFtZSwgIi4uIikgPT0gMCkKICAgICAgICBjb250aW51ZTsKICAg ICAgY2hhciBhYm9ydFszMDBdOwogICAgICBzbnByaW50ZihhYm9ydCwgc2l6ZW9mKGFib3J0KSwg Ii9zeXMvZnMvZnVzZS9jb25uZWN0aW9ucy8lcy9hYm9yd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7CiAgICB9CiAg ICBpbnQgc3RhdHVzID0gMDsKICAgIHVpbnQ2NF90IHN0YXJ0ID0gY3VycmVudF90aW1lX21zKCk7 CiAgICBmb3IgKDs7KSB7CiAgICAgIGlmICh3YWl0cGlkKC0xLCAmc3RhdHVzLCBXTk9IQU5HIHwg V0FJVF9GTEFHUykgPT0gcGlkKQogICAgICAgIGJyZWFrOwogICAgICBzbGVlcF9tcygxKTsKICAg ICAgaWYgKGN1cnJlbnRfdGltZV9tcygpIC0gc3RhcnQgPCA1MDAwKQogICAgICAgIGNvbnRpbnVl OwogICAgICBraWxsX2FuZF93YWl0KHBpZCwgJnN0YXR1cyk7CiAgICAgIGJyZWFrOwogICAgfQog ICAgcmVtb3ZlX2Rpcihjd2RidWYpOwogIH0KfQoKdWludDY0X3QgclsxXSA9IHsweGZmZmZmZmZm ZmZmZmZmZmZ9OwoKdm9pZCBleGVjdXRlX2NhbGwoaW50IGNhbGwpCnsKICBpbnRwdHJfdCByZXMg PSAwOwogIHN3aXRjaCAoY2FsbCkgewogIGNhc2UgMDoKICAgIHJlcyA9IC0xOwogICAgTk9ORkFJ TElORyhyZXMgPSBzeXpfaW5pdF9uZXRfc29ja2V0KC8qZmFtPSovMHgxZiwgLyp0eXBlPVNPQ0tf UkFXKi8gMywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKnByb3Rv PSovMCkpOwogICAgaWYgKHJlcyAhPSAtMSkKICAgICAgclswXSA9IHJlczsKICAgIGJyZWFrOwog IGNhc2UgMToKICAgIE5PTkZBSUxJTkcoKih1aW50NjRfdCopMHgyMDAwMDFjMCA9IDApOwogICAg Tk9ORkFJTElORygqKHVpbnQzMl90KikweDIwMDAwMWM4ID0gMCk7CiAgICBOT05GQUlMSU5HKCoo dWludDY0X3QqKTB4MjAwMDAxZDAgPSAweDIwMDAwMzAwKTsKICAgIE5PTkZBSUxJTkcoKih1aW50 NjRfdCopMHgyMDAwMDMwMCA9IDApOwogICAgTk9ORkFJTElORygqKHVpbnQ2NF90KikweDIwMDAw MzA4ID0gMHgxYyk7CiAgICBOT05GQUlMSU5HKCoodWludDY0X3QqKTB4MjAwMDAxZDggPSAxKTsK ICAgIE5PTkZBSUxJTkcoKih1aW50NjRfdCopMHgyMDAwMDFlMCA9IDApOwogICAgTk9ORkFJTElO RygqKHVpbnQ2NF90KikweDIwMDAwMWU4ID0gMCk7CiAgICBOT05GQUlMSU5HKCoodWludDMyX3Qq KTB4MjAwMDAxZjAgPSAwKTsKICAgIHN5c2NhbGwoX19OUl9zZW5kbXNnLCAvKmZkPSovLTEsIC8q bXNnPSovMHgyMDAwMDFjMHVsLCAvKmY9Ki8wdWwpOwogICAgYnJlYWs7CiAgY2FzZSAyOgogICAg c3lzY2FsbChfX05SX3NvY2tldCwgLypkb21haW49Ki8weGZ1bCwgLyp0eXBlPSovM3VsLCAvKnBy b3RvPSovMik7CiAgICBicmVhazsKICBjYXNlIDM6CiAgICBOT05GQUlMSU5HKCoodWludDE2X3Qq KTB4MjAwMDAwNDAgPSAweDFmKTsKICAgIE5PTkZBSUxJTkcoKih1aW50MTZfdCopMHgyMDAwMDA0 MiA9IDApOwogICAgTk9ORkFJTElORyhtZW1zZXQoKHZvaWQqKTB4MjAwMDAwNDQsIDE3MCwgNSkp OwogICAgTk9ORkFJTElORygqKHVpbnQ4X3QqKTB4MjAwMDAwNDkgPSAweDEwKTsKICAgIE5PTkZB SUxJTkcoKih1aW50MTZfdCopMHgyMDAwMDA0YSA9IDApOwogICAgTk9ORkFJTElORygqKHVpbnQ4 X3QqKTB4MjAwMDAwNGMgPSAwKTsKICAgIHN5c2NhbGwoX19OUl9jb25uZWN0LCAvKmZkPSovclsw XSwgLyphZGRyPSovMHgyMDAwMDA0MHVsLAogICAgICAgICAgICAvKmFkZHJsZW49Ki8weGV1bCk7 CiAgICBicmVhazsKICBjYXNlIDQ6CiAgICBOT05GQUlMSU5HKAogICAgICAgIG1lbWNweSgodm9p ZCopMHgyMDAwMDBjMCw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