From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.6215.1608710508825104201 for ; Wed, 23 Dec 2020 00:01:49 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=bPjvqLmZ; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: gregx.yeh@intel.com) IronPort-SDR: 9NxdQV85GguuvEjvFq5Q57KcZmUwisFtRF2HZRQhpIYrIVG0+6TvoMpwKcQWOpwXZFPGOJZ7D/ 036thoZnvIuA== X-IronPort-AV: E=McAfee;i="6000,8403,9843"; a="163037329" X-IronPort-AV: E=Sophos;i="5.78,441,1599548400"; d="scan'208,223";a="163037329" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Dec 2020 00:01:46 -0800 IronPort-SDR: Mf/ewgRDEab9hwgJXQGKAOV/s7xUNU+8kbCfI+QmFOMrTitjU5MnH/O/IpkuS42lvnXeTxU383 +dFruM7tqreg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,441,1599548400"; d="scan'208,223";a="338728884" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga007.fm.intel.com with ESMTP; 23 Dec 2020 00:01:47 -0800 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 23 Dec 2020 00:01:46 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Wed, 23 Dec 2020 00:01:46 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.104) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Wed, 23 Dec 2020 00:00:45 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OxnhLmZMXSiOI+8qXrQya/fdvvJUGfQa1hvrh2PykpbwUccS24DrszGj4kGKVQKbrsQpdGkNoTbwybUJcSk5Z3mnz6jaxIjITAMrtC/XZ1hKG9QtSYQ6N5XmFtklUzCVboqQnjfMjAzNIb5k1P4BYQ3jg3Qc6fPCYUvpRwyXfKnkzMLo/4loRV3SbNwTTlQApSQXfFTG8cqmMvXPcbJAYPTcF0SjE9KPuknksL7dB4OT4ybBH3LWlJjfeIsO0SJpsMl9npSB3/bm6VxJf2Q3jjHxc2r0cSvYubuPBvovrzH55jxp9662sGdtWGEcxiCWXPwLrJcClI6JziBHY+EfOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qKv+wv2ltKLcCkCgqt+2VMWEdP53IgLgYDbWeFJ81Do=; b=j+zrxQbXp+IlIMeK1xWGgyXX3/R7yVI+O/tlO8l93Z5ccuiYCszbIXhFN/LlxaZar0ySF+DASlYzIYwdUWLq3gvRwA1EFF5S0f7dxyYXenXs6paWV8YPngn4HSEE7gRTgQIqcqLahNQ22ho1NeZkHpHy5JCSS5BTf6Yb60xjSYwF6r/AqkLWB6BOKp5m7gZoLm+Dy+yfkzLCOo2/c2EpPLXJExKN8se0dvcPu2v/5AEfiP/yi5O690ZPQO4mor1itqF54qATtlabB7aqOnpwLnGS+ZBiEyt6Cv+fbiv7aUczj7aPtDybBdzO+nPdN12oD+hB3TTapUX/FPTZ8bXTYA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qKv+wv2ltKLcCkCgqt+2VMWEdP53IgLgYDbWeFJ81Do=; b=bPjvqLmZWfRqqGf4VRxNSFrkR/x8hDsDZVqIRdFNmFWpDaL/tr33Ir/GftDs9TsISW5UG8MhGHeM02NYxYB+AT7PTvhBwu8CKnWhXDr0bbeYH95OlkhT3+xmHclKS8PK5beeksJrD3vnO4RaOSX36P9nqAVI1MYZdasb2oVz0B0= Received: from DM6PR11MB3370.namprd11.prod.outlook.com (2603:10b6:5:56::31) by DM6PR11MB4171.namprd11.prod.outlook.com (2603:10b6:5:191::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3676.29; Wed, 23 Dec 2020 08:00:44 +0000 Received: from DM6PR11MB3370.namprd11.prod.outlook.com ([fe80::2c68:6fda:bd88:b8d5]) by DM6PR11MB3370.namprd11.prod.outlook.com ([fe80::2c68:6fda:bd88:b8d5%7]) with mapi id 15.20.3676.033; Wed, 23 Dec 2020 08:00:44 +0000 From: "GregX Yeh" To: "Feng, Bob C" , "devel@edk2.groups.io" CC: Liming Gao , 'Yunhua Feng' Subject: Re: [PATCH] [edk2-staging] BaseTools/FMMT: Replace file failure when FV level over 2 Thread-Topic: [PATCH] [edk2-staging] BaseTools/FMMT: Replace file failure when FV level over 2 Thread-Index: AQHWzTRNhDK8qHoARk2EOwuMJJvSt6n8ojCAgAfF7nA= Date: Wed, 23 Dec 2020 08:00:44 +0000 Message-ID: References: <20201208073222.19400-1-gregx.yeh@intel.com> In-Reply-To: Accept-Language: zh-TW, en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.55.52.220] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2afd8298-06c3-45ab-6a39-08d8a718d9af x-ms-traffictypediagnostic: DM6PR11MB4171: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: K9Eu56oWuHKgr0SYv/mbpg6mvIs0ktr9HwUfSU60ma7ZSckRqpqcTdATUbZOh/N47ve7p+T+W0ASwIa/kgj+ZQwiRFs8WrD2I8YywEuQ2WfwRl0MHNi7SbC6TYDo2emlf5RR0QNOJbJPFHjoCvPojxVVuW6qcCEbVwRmOw1HHfDBzvgM6MWhi64tnFxIx9pK0ACzVH0KpsoYrsHzjcrDM6AJDe949koln4HQZ4BABXp4juXWkR+LaNM2y41PPcuiaNFelVFzuzy1logCyKSuqBgPddAGjlXMNRazNqXLTUzRZy+vRm5fNNwnooFnFA90RAzivxvxGiPC3OGBMu2z0CDyn4/z3RwDUi6TbjZHNZ5ggNfqCZ+6sgrFb4kac0WAvNu8xQgoKUK62dDq8PGEOA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB3370.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(346002)(39860400002)(396003)(366004)(136003)(376002)(66446008)(66946007)(7696005)(83380400001)(55016002)(66556008)(54906003)(64756008)(66476007)(86362001)(6506007)(66616009)(478600001)(110136005)(33656002)(316002)(99936003)(2906002)(8676002)(26005)(71200400001)(52536014)(9686003)(5660300002)(53546011)(186003)(8936002)(76116006)(4326008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?Va94uODerCF1khe34hJWQm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Q124kmhUIWE960RDaM/AxxOamrEp6rc/ZNvTxztvHhMuz97t2oxpI0F?= =?us-ascii?Q?vD4O7OxqzYfobXUmwkZTi2Dtr25zq09oEl+ERaH4g+M=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB3370.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2afd8298-06c3-45ab-6a39-08d8a718d9af X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Dec 2020 08:00:44.4631 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: tuPqLDkAsWMJoD65frsUGFe4BzfXk9a5gHezzwh1U4tE1hE/+H3QSu5szfk+kmdRmRFY8rJhr9pbfGUnyiUKpg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4171 Return-Path: gregx.yeh@intel.com X-OriginatorOrg: intel.com X-Groupsio-MsgNum: 69408 Content-Language: en-US Content-Type: multipart/mixed; boundary="_002_DM6PR11MB33703A6646C1E61462D0ADEEFADE0DM6PR11MB3370namp_" --_002_DM6PR11MB33703A6646C1E61462D0ADEEFADE0DM6PR11MB3370namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Bob, I have fixed for loop that use FfsNumbers. I attach new patch file. Thanks, Greg -----Original Message----- From: Feng, Bob C =20 Sent: Friday, December 18, 2020 5:33 PM To: Yeh, GregX ; devel@edk2.groups.io Cc: Liming Gao ; 'Yunhua Feng' Subject: RE: [PATCH] [edk2-staging] BaseTools/FMMT: Replace file failure wh= en FV level over 2 Hi Greg For the change of the following block, 1.=20 - CurrentFv->FfsNumbers =3D *FfsCount; - *FfsCount +=3D 1; =20 + CurrentFv->FfsNumbers =3D *FfsCount; + 2. - for (Index=3D0; Index <=3D FvInFd->FfsNumbers; Index++) { + for (Index=3D0; Index < FvInFd->FfsNumbers; Index++) { I think it's correct but I see there are many places still have such statem= ent:=20 "for (Index =3D 0; Index <=3D FvInFd->FfsNumbers; Index++) { " I think all others may also need to be changed from "for (Index =3D 0; Inde= x <=3D FvInFd->FfsNumbers; Index++) {" need to change to "for (Index =3D 0;= Index < FvInFd->FfsNumbers; Index++) {" Thanks, Bob -----Original Message----- From: Yeh, GregX Sent: Tuesday, December 8, 2020 3:32 PM To: devel@edk2.groups.io Cc: Feng, Bob C ; Liming Gao Subject: [PATCH] [edk2-staging] BaseTools/FMMT: Replace file failure when F= V level over 2 Fixed replace file failure when FFS in multiple level FV and FV level over = 2. Signed-off-by: GregX Yeh Cc: Bob Feng Cc: Liming Gao --- BaseTools/Source/C/FMMT/FmmtLib.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/BaseTools/Source/C/FMMT/FmmtLib.c b/BaseTools/Source/C/FMMT/Fm= mtLib.c index b945e9b63d..bfb3b57d4a 100644 --- a/BaseTools/Source/C/FMMT/FmmtLib.c +++ b/BaseTools/Source/C/FMMT/FmmtLib.c @@ -709,10 +709,10 @@ LibGenFfsFile ( free(FfsFileName); FfsFileName =3D NULL; =20 - CurrentFv->FfsNumbers =3D *FfsCount; - *FfsCount +=3D 1; =20 + CurrentFv->FfsNumbers =3D *FfsCount; + if (ErasePolarity) { CurrentFile->State =3D (UINT8)~(CurrentFile->State); } @@ -833,7 +833,6 @@ LibParseSection ( CHAR8 *ToolInputFileName; CHAR8 *ToolOutputFileName; BOOLEAN HasUiSection; - BOOLEAN FirstInFlag; =20 DataOffset =3D 0; GuidAttr =3D 0; @@ -869,7 +868,6 @@ LibParseSection ( EncapDataNeedUpdata =3D TRUE; LargeHeaderOffset =3D 0; HasUiSection =3D FALSE; - FirstInFlag =3D TRUE; =20 =20 while (ParsedLength < BufferLength) { @@ -997,9 +995,7 @@ LibParseSectio= n ( break; =20 case EFI_SECTION_COMPRESSION: - if (FirstInFlag) { - Level ++; - } + Level ++; NumberOfSections ++; =20 EncapDataNeedUpdata =3D TRUE; @@ -1181,9 +1177,7 @@ LibParseSection ( // looks up the appropriate tool to use for extracting // a GUID defined FV section. // - if (FirstInFlag) { - Level ++; - } + Level ++; NumberOfSections++; EncapDataNeedUpdata =3D TRUE; HasUiSection =3D TRUE; @@ -1682,7 +1676,6 @@ LibParseSection ( } =20 ParsedLength +=3D SectionLength; - FirstInFlag =3D FALSE; // // We make then next section begin on a 4-byte boundary // @@ -4198,10 +4191,13 @@ LibEncapNewFvFile( UINT32 header; UINT8 AlignN; UINT8 AlignV[1] =3D {0xFF}; + UINT32 EntryFvId; + AlignN =3D 0; Id =3D 0; InputFileSize =3D 0; TmpFileSize =3D 0; + AlignmentFileSize =3D 0; EncapFvIndex =3D 0; Index =3D 0; OuterIndex =3D 0; @@ -4224,7 +4220,7 @@ LibEncapNewFvFile( IsLargeFile =3D FALSE; OutputFileSize =3D 0; LargeFileSize =3D 0x1000000; - + EntryFvId =3D 0; =20 OutputFileNameList =3D (FFS_INFORMATION *)malloc(sizeof(FFS_INFORMATION)= ); if (OutputFileNameList =3D=3D NULL) { @@ -4261,6 +4257,9 @@ LibEncapNewFvFile( LocalEncapData =3D CurrentEncapData; if (LocalEncapData =3D=3D NULL) { LocalEncapData =3D FvInFd->EncapData; + EntryFvId =3D 0xFFFFFFFF; + } else { + EntryFvId =3D LocalEncapData->FvId; } Level =3D LocalEncapData->Level; Type =3D LocalEncapData->Type; @@ -4274,7 +4273,7 @@ LibEncapNewFvFile( LocalEncapDataNext =3D LocalEncapDataTemp->NextNode; if (LocalEncapDataNext !=3D NULL && LocalEncapDataNext->NextNo= de !=3D NULL) { =20 - LibEncapNewFvFile(FvInFd, TemDir, LocalEncapDataTemp, 1, &= ChildFileNameList); + LibEncapNewFvFile(FvInFd, TemDir,=20 + LocalEncapDataTemp,LocalEncapDataTemp->Level - 1, &ChildFileNameList); ChildFileNameList->ParentLevel =3D LocalEncapDataTemp->Lev= el -1; if (FvInFd->ChildFvFFS =3D=3D NULL) { FvInFd->ChildFvFFS =3D ChildFileNameList; @@ -4329,7 += 4328,7 @@ LibEncapNewFvFile( } else { LocalEncapData =3D CurrentEncapData; while (LocalEncapData !=3D NULL) { - if (Level_Break > 1 && LocalEncapData->Type =3D=3D FMMT_ENCAP_TREE_F= FS) { + if ((LocalEncapData->FvId > EntryFvId) && (LocalEncapData->Type=20 + =3D=3D FMMT_ENCAP_TREE_FFS)) { LocalEncapDataTemp =3D LocalEncapData->RightNode; while (LocalEncapDataTemp !=3D NULL) { LocalEncapDataNext =3D LocalEncapDataTemp->NextNode; @@ -4485,= 7 +4484,7 @@ LibEncapNewFvFile( // FfsFoundFlag =3D FALSE; IsRootFv =3D FALSE; - for (Index=3D0; Index <=3D FvInFd->FfsNumbers; Index++) { + for (Index=3D0; Index < FvInFd->FfsNumbers; Index++) { if (OutputFileNameList !=3D NULL && OutputFileNameList->FFSNam= e !=3D NULL && OutputFileNameList->IsFFS =3D=3D FALSE){ break; } @@ -4818,6 +4817,7 @@ LibEncapNewFvFile( memcpy((char *)OutputFileNameList->FFSName, (char *)OutputFileName, = strlen(OutputFileName)+1); OutputFileNameList->IsFFS =3D TRUE; OutputFileNameList->ParentLevel =3D ParentLevel - 1; + OutputFileNameList->InFvId =3D Id; if (OutputFileNameList->Next =3D=3D NULL){ break; } @@ -5077,10 +5077,6 @@ LibEncapNewFvFile( if (CurrentEncapData =3D=3D NULL) { LocalEncapData =3D FvInFd->EncapData; } else { - if (OutputFileNameList !=3D NULL && OutputFileNameList->FFSName != =3D NULL && OutputFileNameList->IsFFS =3D=3D TRUE) { - *OutputFile =3D OutputFileNameList; - return EFI_SUCCESS; - } LocalEncapData =3D CurrentEncapData; } ParentLevel -=3D 1; -- 2.16.2.windows.1 --_002_DM6PR11MB33703A6646C1E61462D0ADEEFADE0DM6PR11MB3370namp_ Content-Type: application/octet-stream; name="0001-edk2-staging-BaseTools-FMMT-Replace-file-failure-whe.patch" Content-Description: 0001-edk2-staging-BaseTools-FMMT-Replace-file-failure-whe.patch Content-Disposition: attachment; filename="0001-edk2-staging-BaseTools-FMMT-Replace-file-failure-whe.patch"; size=6327; creation-date="Wed, 23 Dec 2020 08:00:34 GMT"; modification-date="Wed, 23 Dec 2020 07:56:54 GMT" Content-Transfer-Encoding: base64 RnJvbSA1NGVkZmFkNDU2ZmRlZjQ4OGM5NTM0MDRmNzFiMmFlZjY0NmJjMTQzIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBHcmVnWCBZZWggPGdyZWd4LnllaEBpbnRlbC5jb20+CkRhdGU6 IFR1ZSwgMSBEZWMgMjAyMCAxNTozNzoyMyArMDgwMApTdWJqZWN0OiBbUEFUQ0hdIFtlZGsyLXN0 YWdpbmddIEJhc2VUb29scy9GTU1UOiBSZXBsYWNlIGZpbGUgZmFpbHVyZSB3aGVuIEZWCiBsZXZl bCBvdmVyIDIKCkZpeGVkIHJlcGxhY2UgZmlsZSBmYWlsdXJlIHdoZW4gRkZTIGluIG11bHRpcGxl IGxldmVsIEZWIGFuZCBGViBsZXZlbCBvdmVyIDIuCgpTaWduZWQtb2ZmLWJ5OiBHcmVnWCBZZWgg PGdyZWd4LnllaEBpbnRlbC5jb20+CkNjOiBCb2IgRmVuZyA8Ym9iLmMuZmVuZ0BpbnRlbC5jb20+ CkNjOiBMaW1pbmcgR2FvIDxnYW9saW1pbmdAYnlvc29mdC5jb20uY24+Ci0tLQogQmFzZVRvb2xz L1NvdXJjZS9DL0ZNTVQvRm1tdExpYi5jIHwgMzYgKysrKysrKysrKysrKysrKy0tLS0tLS0tLS0t LS0tLS0tLS0tCiAxIGZpbGUgY2hhbmdlZCwgMTYgaW5zZXJ0aW9ucygrKSwgMjAgZGVsZXRpb25z KC0pCgpkaWZmIC0tZ2l0IGEvQmFzZVRvb2xzL1NvdXJjZS9DL0ZNTVQvRm1tdExpYi5jIGIvQmF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2UgdGhlbiBu ZXh0IHNlY3Rpb24gYmVnaW4gb24gYSA0LWJ5dGUgYm91bmRhcnkNCiAgICAgLy8NCkBAIC00MTk4 LDEwICs0MTkxLDEzIEBAIExpYkVuY2FwTmV3RnZGaWxlKAogICBVSU5UMzIgICAgICAgICAgICAg ICAgICAgICAgaGVhZGVyOw0KICAgVUlOVDggICAgICAgICAgICAgICAgICAgICAgIEFsaWduTjsN CiAgIFVJTlQ4ICAgICAgICAgICAgICAgICAgICAgICBBbGlnblZbMV0gPSB7MHhGRn07DQorICBV SU5UMzIgICAgICAgICAgICAgICAgICAgICAgRW50cnlGdklkOw0KKw0KICAgQWxpZ25OICAgICAg ICAgICAgICAgICAgICAgID0gMDsNCiAgIElkICAgICAgICAgICAgICAgICAgICAgICAgICA9IDA7 DQogICBJbnB1dEZpbGVTaXplICAgICAgICAgICAgICAgPSAwOw0KICAgVG1wRmlsZVNpemUgICAg ICAgICAgICAgICAgID0gMDsNCisgIEFsaWdubWVudEZpbGVTaXplICAgICAgICAgICA9IDA7DQog ICBFbmNhcEZ2SW5kZXggICAgICAgICAgICAgICAgPSAwOw0KICAgSW5kZXggICAgICAgICAgICAg ICAgICAgICAgID0gMDsNCiAgIE91dGVySW5kZXggICAgICAgICAgICAgICAgICA9IDA7DQpAQCAt NDIyNCw3ICs0MjIwLDcgQEAgTGliRW5jYXBOZXdGdkZpbGUoCiAgIElzTGFyZ2VGaWxlICAgICAg ICAgICAgICAgICA9IEZBTFNFOw0KICAgT3V0cHV0RmlsZVNpemUgICAgICAgICAgICAgID0gMDsN CiAgIExhcmdlRmlsZVNpemUgICAgICAgICAgICAgICA9IDB4MTAwMDAwMDsNCi0NCisgIEVudHJ5 RnZJZCAgICAgICAgICAgICAgICAgICA9IDA7DQogDQogICBPdXRwdXRGaWxlTmFtZUxpc3QgPSAo RkZTX0lORk9STUFUSU9OICopbWFsbG9jKHNpemVvZihGRlNfSU5GT1JNQVRJT04pKTsNCiAgIGlm IChPdXRwdXRGaW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