Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp5743217ioo; Wed, 1 Jun 2022 11:35:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTJ0QWMgETztBFfOc933Lfcjcd7t0Sj0qqgJit/wE0r6RE4fPtGKz9ClDuBshqDaFoNzyg X-Received: by 2002:a63:cc4f:0:b0:3c5:fc22:f6a with SMTP id q15-20020a63cc4f000000b003c5fc220f6amr616214pgi.67.1654108541745; Wed, 01 Jun 2022 11:35:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654108541; cv=none; d=google.com; s=arc-20160816; b=cR4NUDabXAhy3SQNxK8Rp5mGsdXpq8t3vr6T2WRH4HTVu/Q07yKYUasxm5y3xft0kr 4Bo4vuNNQ14O5U4OQdxI5W86xoWVfNnGvdQJt6D8Agb0MUZNprmXv7kfjDUrSE/pD2R5 aqYmafE6JXFrC7eT6v+ksGj64wphvbyNs6il2XDv+iix9sufPJOF6sQicvoU54quapnJ j6J+SohJhZAPmCjXmN2dSZgzCBdWZR5LYiQBDsMyCDArLv+xcCrWKGMxRB/4WrYRlsSM 2x6nwdnZjLtylSHcQSUDgZD0pgKW7dFRYw9a6hTvvVymz6ZtnH3se8RTTTMtIKHdnIA8 6CQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=apk/UAb/neUlHrDkl89uDGRZQuLIpQf32UztZXnQDWU=; b=SAZAa6KsVQxQ8IaM6W1xCDp8hLSr7XT6t3RO3y/95VyopsNTT14DEEJfoNIhOtzI6U kqvbWhFy6AsAnFIL+JrETMmpb2LFDEPKUmJJxzmFkE8jLbH2xH9J7oCgUnfRHPHvpFax AA9BIakcFKdFhvqCADAAsQHObh1bYRIOCnLrkjQ+4vOfg2z+4ltqYEsQRBERWbyhga9Z 1Iyd8xUL312jILhlBykRwcafzZ67SA2pGEaKxWnBhp5L6BqmUsf9S7B/3ea4PUfHUXhT SW4zE//rS/4NxGzHaG6S6rpbP7xqU2q9jep5djqCDvNOwl1FOmOwWt+YVLLTx0KbIE3O AxjQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id l190-20020a6388c7000000b003fae0c67055si2812602pgd.777.2022.06.01.11.35.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 11:35:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 10B78AFADB; Wed, 1 Jun 2022 11:35:28 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350724AbiFAIZ5 (ORCPT + 99 others); Wed, 1 Jun 2022 04:25:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350710AbiFAIZz (ORCPT ); Wed, 1 Jun 2022 04:25:55 -0400 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.86.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4AF8F25C65 for ; Wed, 1 Jun 2022 01:25:52 -0700 (PDT) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-13-F1naXgNMMQ6vpKhGtlWFvA-1; Wed, 01 Jun 2022 09:25:49 +0100 X-MC-Unique: F1naXgNMMQ6vpKhGtlWFvA-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) by AcuMS.aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) with Microsoft SMTP Server (TLS) id 15.0.1497.36; Wed, 1 Jun 2022 09:25:47 +0100 Received: from AcuMS.Aculab.com ([fe80::994c:f5c2:35d6:9b65]) by AcuMS.aculab.com ([fe80::994c:f5c2:35d6:9b65%12]) with mapi id 15.00.1497.036; Wed, 1 Jun 2022 09:25:47 +0100 From: David Laight To: 'Yu-Jen Chang' CC: "ak@linux.intel.com" , "jdike@linux.intel.com" , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "dave.hansen@linux.intel.com" , "x86@kernel.org" , "hpa@zytor.com" , "keescook@chromium.org" , "linux-kernel@vger.kernel.org" , "linux-hardening@vger.kernel.org" , "richard@nod.at" , "anton.ivanov@cambridgegreys.com" , "johannes@sipsolutions.net" , "linux-um@lists.infradead.org" , "jserv@ccns.ncku.edu.tw" Subject: RE: [PATCH 1/2] x86/lib: Optimize memchr() Thread-Topic: [PATCH 1/2] x86/lib: Optimize memchr() Thread-Index: AQHYcmroNJne+UgOCEK2wOYbJvL5k603Dq9wgAL1CoCAADiXEA== Date: Wed, 1 Jun 2022 08:25:47 +0000 Message-ID: <5afc275656764ee6818693dfd39df764@AcuMS.aculab.com> References: <20220528081236.3020-1-arthurchang09@gmail.com> <20220528081236.3020-2-arthurchang09@gmail.com> <8b480c85f53c4f3b88bf99ba585e8768@AcuMS.aculab.com> In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org RnJvbTogWXUtSmVuIENoYW5nDQo+IFNlbnQ6IDAxIEp1bmUgMjAyMiAwNjo1OQ0KPiANCj4gRGF2 aWQgTGFpZ2h0IDxEYXZpZC5MYWlnaHRAYWN1bGFiLmNvbT4g5pa8IDIwMjLlubQ15pyIMzDml6Ug 6YCx5LiAIOS4i+WNiDQ6MTDlr6vpgZPvvJoNCj4gPg0KPiA+IEZyb206IFl1LUplbiBDaGFuZw0K PiA+ID4gU2VudDogMjggTWF5IDIwMjIgMDk6MTMNCj4gPiA+DQo+ID4gPiBUaGUgb3JpZ2luYWwg YXNzZW1ibHkgdmVyc2lvbiBvZiBtZW1jaHIoKSBpcyBpbXBsZW1lbnRlZCB3aXRoDQo+ID4gPiB0 aGUgYnl0ZS13aXNlIGNvbXBhcmluZyB0ZWNobmlxdWUsIHdoaWNoIGRvZXMgbm90IGZ1bGx5DQo+ ID4gPiB1c2UgNjQtYml0cyByZWdpc3RlcnMgaW4geDg2XzY0IENQVS4gV2UgdXNlIHdvcmQtd2lk ZQ0KPiA+ID4gY29tcGFyaW5nIHNvI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Qo+ID4gPiArICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgbWFzayA9IGQgPDwgOCB8IGQ7DQo+ ID4gPiArICAgICAgICAgICAgIHVuc2lnbmVkIGludCBpID0gMzI7DQo+ID4gPiArICAgICAgICAg ICAgIGxvbmcgeG9yLCBkYXRhOw0KPiA+ID4gKyAgICAgICAgICAgICBjb25zdCBsb25nIGNvbnN0 YSA9IDB4RkVGRUZFRkVGRUZFRkVGRiwNCj4gPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICBj b25zdGIgPSAweDgwODA4MDgwODA4MDgwODA7DQo+ID4gPiArDQo+ID4gPiArICAgICAgICAgICAg IC8qDQo+ID4gPiArICAgICAgICAgICAgICAqIENyZWF0ZSBhIDgtYnl0ZXMgbWFzayBmb3Igd29y ZC13aXNlIGNvbXBhcmluZy4NCj4gPiA+ICsgICAgICAgICAgICAgICogRm9yIGV4YW1wbGUsIGEg bWFzayBmb3IgJ2EnIGlzIDB4NjE2MTYxNjE2MTYxNjE2MS4NCj4gPiA+ICsgICAgICAgICAgICAg ICovDQo+ID4gPiArDQo+ID4gPiArICAgICAgICAgICAgIG1hc2sgfD0gbWFzayA8PCAxNjsNCj4g PiA+ICsgICAgICAgICAgICAgZm9yIChpID0gMzI7IGkgPCBMQkxPQ0tTSVpFICogODsgaSA8PD0g MSkNCj4gPiA+ICsgICAgICAgICAgICAgICAgICAgICBtYXNrIHw9IG1hc2sgPDwgaTsNCj4gPg0K PiA+IEdpdmVuIHRoYXQgY29uc3RhL2Igb25seSBzdXBwb3J0IDY0IGJpdCB3aHkgdGhlIGxvb3Au DQo+ID4gSnVzdCBkbyBtYXNrIHw9IG1hc2sgPDwgMzIuDQo+ID4gSSdkIGFsc28gcHV0IGFsbCAz IGNhbGN1bGF0aW9ucyB0b2dldGhlciAtIG5vdCBoaWRlIG9uZQ0KPiA+IGluIHRoZSBpbml0aWFs aXNlci4NCj4gPg0KPiA+ID4gKyAgICAgICAgICAgICAvKg0KPiA+ID4gKyAgICAgICAgICAgICAg KiBXZSBwZXJmb3JtIHdvcmQtd2lzZSBjb21wYXJpbmcgd2l0aCBmb2xsb3dpbmcgb3BlcmF0aW9u Og0KPiA+ID4gKyAgICAgICAgICAgICAgKiAgICAgIDEuIFBlcmZvcm0geG9yIG9uIHRoZSBsb25n IHdvcmQgQHNyYyBhbmQgQG1hc2sNCj4gPiA+ICsgICAgICAgICAgICAgICogICAgICAgICBhbmQg cHV0IGludG8gQHhvci4NCj4gPiA+ICsgICAgICAgICAgICAgICogICAgICAyLiBBZGQgQHhvciB3 aXRoIEBjb25zdGEuDQo+ID4gPiArICAgICAgICAgICAgICAqICAgICAgMy4gfkB4b3IgJiBAY29u c3RiLg0KPiA+ID4gKyAgICAgICAgICAgICAgKiAgICAgIDQuIFBlcmZvcm0gJiB3aXRoIHRoZSBy ZXN1bHQgb2Ygc3RlcCAyIGFuZCAzLg0KPiA+ID4gKyAgICAgICAgICAgICAgKg0KPiA+ID4gKyAg ICAgICAgICAgICAgKiBTdGVwIDEgY3JlYXRlcyBhIGJ5dGUgd2hpY2ggaXMgMCBpbiB0aGUgbG9u ZyB3b3JkIGlmDQo+ID4gPiArICAgICAgICAgICAgICAqIHRoZXJlIGlzIGF0IGxlYXN0IG9uZSB0 YXJnZXQgYnl0ZSBpbiBpdC4NCj4gPiA+ICsgICAgICAgICAgICAgICoNCj4gPiA+ICsgICAgICAg ICAgICAgICogU3RlcCAyIHRvIFN0ZXAgNCBmaW5kIGlmIHRoZXJlIGlzIGEgYnl0ZSB3aXRoIDAg aW4NCj4gPiA+ICsgICAgICAgICAgICAgICogdGhlIGxvbmcgd29yZC4NCj4gPiA+ICsgICAgICAg ICAgICAgICovDQo+ID4gPiArICAgICAgICAgICAgIGFzbSB2b2xhdGlsZSgiMTpcblx0Ig0KPiA+ ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgIm1vdnEgKCUwKSwlMVxuXHQiDQo+ID4gPiAr ICAgICAgICAgICAgICAgICAgICAgICAgICAieG9ycSAlNiwlMVxuXHQiDQo+ID4gPiArICAgICAg ICAgICAgICAgICAgICAgICAgICAibGVhICglMSwlNCksICUyXG5cdCINCj4gPiA+ICsgICAgICAg ICAgICAgICAgICAgICAgICAgICJub3RxICUxXG5cdCINCj4gPiA+ICsgICAgICAgICAgICAgICAg ICAgICAgICAgICJhbmRxICU1LCUxXG5cdCINCj4gPiA+ICsgICAgICAgICAgICAgICAgICAgICAg ICAgICJ0ZXN0cSAlMSwlMlxuXHQiDQo+ID4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAi am5lIDJmXG5cdCINCj4gPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICJhZGQgJDgsJTBc blx0Ig0KPiA+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgInN1YiAkOCwlM1xuXHQiDQo+ ID4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAiY21wICQ3LCUzXG5cdCINCj4gPiA+ICsg ICAgICAgICAgICAgICAgICAgICAgICAgICJqYSAxYlxuXHQiDQo+ID4gPiArICAgICAgICAgICAg ICAgICAgICAgICAgICAiMjpcblx0Ig0KPiA+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAg OiAiPUQiKHNyYyksICI9ciIoeG9yKSwgIj1yIihkYXRhKSwgIj1yIihsZW5ndGgpDQo+ID4NCj4g PiBXaHkgY29uc3RyYWluIHNyYyB0byAlcmRpPw0KPiANCj4gQXQgZmlyc3QgSSB0cnkgdG8gdXNl IHNvbWUgaW5zdHJ1Y3Rpb25zIHJlbGF0ZWQgdG8gJXJkaSwgYnV0IEkgcmVhbGl6ZQ0KPiB0aGF0 IEkgd29uJ3QgdXNlIHRoZXNlIGluc3RydWN0aW9ucy4gSXQgaXMgdW5uZWNlc3NhcnkgdG8gY29u c3RyYWluDQo+IHNyYyB0byAlcmRpLg0KPiANCj4gPg0KPiA+ID4gKyAgICAgICAgICAgICAgICAg ICAgICAgICAgOiAiciIoY29uc3RhKSwgInIiKGNvbnN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gICAgICAgICAgICAg ICAgICAgICAgICBjb25zdGIgPSAweDgwODA4MDgwODA4MDgwODA7DQo+ICAgICAgICAgICAgICBj b25zdCB1bnNpZ25lZCBjaGFyICpkc3QgPSAoY29uc3QgdW5zaWduZWQgY2hhciAqKXNyYyArDQo+ ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGxlbmd0aCAm IDB4RkZGRkZGRkZGRkZGRkZGOCk7DQo+IA0KPiAgICAgICAgICAgICAgLyoNCj4gICAgICAgICAg ICAgICAqIENyZWF0ZSBhIDgtYnl0ZXMgbWFzayBmb3Igd29yZC13aXNlIGNvbXBhcmluZy4NCj4g ICAgICAgICAgICAgICAqIEZvciBleGFtcGxlLCBhIG1hc2sgZm9yICdhJyBpcyAweDYxNjE2MTYx NjE2MTYxNjEuDQo+ICAgICAgICAgICAgICAgKi8NCj4gDQo+ICAgICAgICAgICAgICBtYXNrIHw9 IG1hc2sgPDwgMTY7DQo+ICAgICAgICAgICAgICBtYXNrIHw9IG1hc2sgPDwgMzI7DQo+ICAgICAg ICAgICAgICAvKg0KPiAgICAgICAgICAgICAgICogV2UgcGVyZm9ybSB3b3JkLXdpc2UgY29tcGFy aW5nIHdpdGggZm9sbG93aW5nIG9wZXJhdGlvbjoNCj4gICAgICAgICAgICAgICAqIDEuIFBlcmZv cm0geG9yIG9uIHRoZSBsb25nIHdvcmQgQHNyYyBhbmQgQG1hc2sNCj4gICAgICAgICAgICAgICAq ICAgIGFuZCBwdXQgaW50byBAeG9yLg0KPiAgICAgICAgICAgICAgICogMi4gQWRkIEB4b3Igd2l0 aCBAY29uc3RhLg0KPiAgICAgICAgICAgICAgICogMy4gfkB4b3IgJiBAY29uc3RiLg0KPiAgICAg ICAgICAgICAgICogNC4gUGVyZm9ybSAmIHdpdGggdGhlIHJlc3VsdCBvZiBzdGVwIDIgYW5kIDMu DQo+ICAgICAgICAgICAgICAgKg0KPiAgICAgICAgICAgICAgICogSWYgdGhlcmUgaXMgYSB6ZXJv IGJ5dGUgaW4gQHhvciwgc3RlcCAyIHR1cm5zIGl0IGludG8NCj4gICAgICAgICAgICAgICAqIDB4 RkYuIFRoZW4gc3RlcCAzIGFuZCA0IHR1cm4gaXQgaW50byAweDgwLg0KPiAgICAgICAgICAgICAg ICoNCj4gICAgICAgICAgICAgICAqIElmIHRoZXJlIGlzIGEgbm9uZS16ZXJvIGJ5dGUgaW4gQHhv ciwgbGV0IGsNCj4gICAgICAgICAgICAgICAqICgwIDw9IGsgPD0gNykgYmUgdGhlIGxvd2VzdCAx IGluIHRoaXMgYnl0ZS4gVGhlIGxvd2VzdA0KPiAgICAgICAgICAgICAgICogayBiaXRzIGFyZSAw LiBBZnRlciBzdGVwIDIsIHRoZSBieXRlIGVuZHMgaW4gYSBzaW5nbGUNCj4gICAgICAgICAgICAg ICAqIGJpdCBvZiB2YWx1ZSAwLiBTdGVwIDMgYW5kIDQgdHVybnMgdGhpcyBieXRlIGludG8gaw0K PiAgICAgICAgICAgICAgICogYml0cyBvZiAxLCB3aGljaCBpcyAyXmsgLSAxLCBhdCBmaXJzdC4g VGhlbiAmIEBjb25zdGINCj4gICAgICAgICAgICAgICAqIG1ha2VzIGl0IGludG8gMC4NCj4gICAg ICAgICAgICAgICAqDQo+ICAgICAgICAgICAgICAgKiBTdGVwIDIgdG8gU3RlcCA0IGZpbmQgaWYg dGhlcmUgaXMgYSBieXRlIHdpdGggMCBpbg0KPiAgICAgICAgICAgICAgICogdGhlIGxvbmcgd29y ZC4NCj4gICAgICAgICAgICAgICAqLw0KPiAgICAgICAgICAgICAgIGFzbSB2b2xhdGlsZSgiMTpc blx0Ig0KPiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIm1vdnEgKCVbc3JjXSksJVt4b3Jd XG5cdCINCj4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICJ4b3JxICVbbWFza10sJVt4b3Jd XG5cdCINCj4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICJsZWEgKCVbeG9yXSwlW2NvbnN0 X2FdKSwgJVt0bXBdXG5cdCINCj4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICJub3RxICVb eG9yXVxuXHQiDQo+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiYW5kcSAlW2NvbnN0X2Jd LCVbeG9yXVxuXHQiDQo+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAidGVzdHEgJVt4b3Jd LCVbdG1wXVxuXHQiDQo+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiam56IDJmXG5cdCIN Cj4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICJhZGQgJDgsJVtzcmNdXG5cdCINCj4gICAg ICAgICAgICAgICAgICAgICAgICAgICAgICJjbXAgJVtzcmNdLCAlW2RzdF1cblx0Ig0KPiAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgImphIDFiXG5cdCINCj4gICAgICAgICAgICAgICAgICAg ICAgICAgICAgICIyOlxuXHQiDQo+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6DQo+ICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBbc3JjXSAiK3IiKHNyYyksIFt4b3JdICIrciIoeG9y KSwgW3RtcF0gIityIihkYXRhKQ0KPiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBbY29u c3RfYV0gInIiKGNvbnN0YSksIFtjb25zdF9iXSAiciIoY29uc3RiKSwNCj4gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgW21hc2tdICJyIihtYXNrKSwgW2RzdF0gInIiKGRzdCkNCj4gICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogIm1lbW9yeSIsICJjYyIpOw0KPiAgICAgICAgIH0N Cj4gDQo+ICAgICAgICAgd2hpbGUgKHNyYyA8PSBlbmQpIHsNCj4gICAgICAgICAgICAgIGlmICgq c3JjID09IGQpDQoNCkkgdGhpbmsgeW91IG1lYW4gJ2MnLg0KDQo+ICAgICAgICAgICAgICAgICAg ICAgIHJldHVybiAodm9pZCAqKXN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