Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp2910394pxy; Mon, 3 May 2021 10:43:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2hAQhovIw5CV8NClCllGvv9+w+eEZkAGyUPybJDS/HWZ/g5xtQDOqHAyMPc1jmof/srvs X-Received: by 2002:aa7:cb0a:: with SMTP id s10mr21172610edt.36.1620063811663; Mon, 03 May 2021 10:43:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620063811; cv=none; d=google.com; s=arc-20160816; b=WWCryei4MDPaHdG/IJvdbR4AiB9ObT5scT64k3IKIiCa5LXbyWjUyL+tc0WDnDkeP7 NedbE+uQvF0e5Ob/ZBDSLJH64dWK2clp64+JkwT7RESdagDcD4k5MIB2q8+2NrDIVAwi W6GcbiKa2WkaN4cwAEhJYO78bnpx2+KR34qk/MJJr9c364djPWsuo3QmhAwZ0Tj40Kzq Olm6v5sFMa+U9iOJdCUYf8BTWOER+0i36pWELHXRN+ipMOxoKcARg2VAqYyta7cvB4yN EgEasw9mwg3E3TejoW+i3sTu1FJ/Z+aJpHF+XkjaX+Gp19zIrgOWGFj2xAaz1C4bRNTq Uq8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=JTrVhmqs0/THvWVizOAQ1V0Ua9ksOL1tR8elAhbdnDM=; b=DCFBqLVrKHVYenefYGwjMpqzdFBYmEtnzOAKiuV38r52uKLA782bZkz7h7Bsd2MQUZ Doa9ywhW2aATLsokfypGDrneMsvj0+Glralfud82WvFxXXXpQ0RiF0Okiw9tvAif1eff wvTA1oOir7qyvXWC2PQprW3r4fROsusVrWxTTHWUjZDMb5Kl8v47/ns/yxRhxYjpNVRD GehXloWk5sCnVDpjbjat8CgB74jSuUEuDZkJLtZwoEY0A/X/MNR9HAJZbnUNdftDOPdh NOO1TRDVYa8hDGHXV96XAH5EEIqeYnAxdR87varcx+cgO1e0Q8O3u+XBHRRlBg8BZQUB KIfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="NOm3b/yo"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n16si9553182edw.216.2021.05.03.10.43.05; Mon, 03 May 2021 10:43:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="NOm3b/yo"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231573AbhECRnB (ORCPT + 99 others); Mon, 3 May 2021 13:43:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231347AbhECRm7 (ORCPT ); Mon, 3 May 2021 13:42:59 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50851C06174A for ; Mon, 3 May 2021 10:42:05 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id s25so7843839lji.0 for ; Mon, 03 May 2021 10:42:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JTrVhmqs0/THvWVizOAQ1V0Ua9ksOL1tR8elAhbdnDM=; b=NOm3b/yoMltjxbQo/V+8GYwfZgK7a6HqXVL2PTvEwRV/I2CPuGxS/zEbcki+juN1G+ HxrENwT+dlZujbg8O/zL4/bTfRDFHyrP1weqkqJXSeP5GGStsZz7NSWK5fLH3S6OdBr2 126zZXTP05NgOMxNIDS2U6ERUGk6V/SPPEPDA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JTrVhmqs0/THvWVizOAQ1V0Ua9ksOL1tR8elAhbdnDM=; b=XHlf7YEC9LJlWBvsYHmfOkN1moGvtRbGoeWRBotkRuiQnHAnj9c3v7jtXcIXHigE3W xW4bDKfUVaWUU+jyhxBh7fDtSuD6kifCS5tR1WOl5sLeTRNMjETVxqyp2awcLS5uF+CV v9BuVq2A8vJhPfDz2ogeGKgMpG+z7byfcXQs7xFhDyplCq2Mj/lwulkHT/gx3rEaTmgP pjMFmgJ8YBH3gUt4SkjZb26bM9IcUl6pHlWVLgeufMzCjE/j80D8E8m4rwrRSP1gcg85 0mXXQqErMQX7dpg//J5WIsYoD2wyBc1hKrDRBWQ99uAz8xOCrYTteyy0TypnR5adkJfE VH4w== X-Gm-Message-State: AOAM5339L8UyWlSYQH0ys294uzABgy0+uQ7SkWFyPxGAz3PZvIgbju5P iYkie+pq6KV6mu1H/CRjnzd141CUT1ogkJHANIQ= X-Received: by 2002:a2e:87d2:: with SMTP id v18mr14508684ljj.186.1620063723400; Mon, 03 May 2021 10:42:03 -0700 (PDT) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com. [209.85.167.44]) by smtp.gmail.com with ESMTPSA id e17sm1343481ljn.29.2021.05.03.10.42.01 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 03 May 2021 10:42:02 -0700 (PDT) Received: by mail-lf1-f44.google.com with SMTP id j10so9244709lfb.12 for ; Mon, 03 May 2021 10:42:01 -0700 (PDT) X-Received: by 2002:a05:6512:3763:: with SMTP id z3mr13360332lft.487.1620063721523; Mon, 03 May 2021 10:42:01 -0700 (PDT) MIME-Version: 1.0 References: <75d07691-1e4f-741f-9852-38c0b4f520bc@synopsys.com> In-Reply-To: <75d07691-1e4f-741f-9852-38c0b4f520bc@synopsys.com> From: Linus Torvalds Date: Mon, 3 May 2021 10:41:45 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Heads up: gcc miscompiling initramfs zlib decompression code at -O3 To: Vineet Gupta Cc: Arnd Bergmann , Peter Zijlstra , Masahiro Yamada , Jann Horn , lkml , arcml , "linux-arch@vger.kernel.org" Content-Type: multipart/mixed; boundary="000000000000a2b63c05c1707ab9" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --000000000000a2b63c05c1707ab9 Content-Type: text/plain; charset="UTF-8" On Fri, Apr 30, 2021 at 1:46 PM Vineet Gupta wrote: > > I've hit a mainline gcc 10.2 (also gcc 9.3) bug which triggers at -O3 > causing wrong codegen. So it does seem to be a gcc bug or at least mis-feature where gcc gets the aliasing decision wrong when vectorizing the code. That said, the fact that gcc even tries to vectorize the code shows how pointless it was for us to (years ago) try to make it use 16-bit accesses in the first place. So can you try this patch that basically reverts some of those kernel-specific changes to zlib's inffast.c - and does so by just upgrading it to a newer version from a more modern zlib (which in this case still means "from 2017", but that's the most recent version there is). This is a fairly quick hack, and I really tried to keep it to just inffast.c and inftrees.c with a few minimal fixups to inflate.c itself. Most of the changes are for naming (which seems to be at least partly for C++ namespace reasons, ie "this" -> "here"), but there's some cleanup wrt maximum table sizes etc too. NOTE! I have not tested this patch in any other way than "it compiles with allmodconfig". The diff looks reasonable to me, but that's all I'm really going to say. Does this avoid the gcc -O3 problem for you? It would be lovely if somebody also took a look at some of the other zlib code, like inflate.c itself. But some of that code has rather subtle changes for things like s390 hardware support, and we have thihngs like our fallthrough rules etc, so it gets a bit hairier. Which is why I did just this fairly minimal part. Note that the commit message has a "Not-yet-signed-off-by:" from me. That's purely because I wanted it to be obvious that this needs a lot more testing - I'm not comfy with this patch unless somebody takes it upon themselves to actually test it under different loads (and different architectures). Linus --000000000000a2b63c05c1707ab9 Content-Type: text/x-patch; charset="US-ASCII"; name="0001-Update-zlib-inffast-code-to-more-modern-zlib.patch" Content-Disposition: attachment; filename="0001-Update-zlib-inffast-code-to-more-modern-zlib.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_ko8vy28w0 RnJvbSAzZWEyMTlhMTRiZDZmMzZkZmVkNWU0NjEwNjczNDlhYjg2YTAyOTM1IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBMaW51cyBUb3J2YWxkcyA8dG9ydmFsZHNAbGludXgtZm91bmRh dGlvbi5vcmc+CkRhdGU6IE1vbiwgMyBNYXkgMjAyMSAxMDoyNzozNCAtMDcwMApTdWJqZWN0OiBb UEFUQ0hdIFVwZGF0ZSB6bGliIGluZmZhc3QgY29kZSB0byBtb3JlIG1vZGVybiB6bGliCgpUaGlz IHVwZGF0ZXMgcGFydCBvZiBvdXIgemxpYiBpbmZsYXRlIGNvZGUgdG8gdGhlIG1vc3QgY3VycmVu dCB6bGliCnNvdXJjZXMgYXMgb2YgemxpYiAxLjIuMTEgKHJlbGVhc2VkIGJ5IE1hcmsgQWRsZXIg YmFjayBpbiAyMDE3KS4KClRoaXMgaXMgb25seSBhIHBhcnRpYWwgdXBkYXRlIHRvIGEgbW9yZSBt b2Rlcm4gemxpYiBiYXNlLCBtYWlubHkgdG8gZ2V0CnRoZSBjdXJyZW50ICdpbmZmYXN0JyBhbmQg J2luZnRyZWVzJyBjb2RlLiAgSW4gdGhlIHByb2Nlc3MsIHRoaXMKZWZmZWN0aXZlbHkgcmV2ZXJ0 cyBzb21lIG9mIG91ciBsb2NhbCBrZXJuZWwgb3B0aW1pemF0aW9ucyB0aGF0IGhhdmUKY2F1c2Vk IHByb2JsZW1zLgoKSW4gcGFydGljdWxhciwgc2VlCgogICBodHRwczovL2djYy5nbnUub3JnL2J1 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AgICAgICAgICAvKiB2YWxpZCBieXRl cyBpbiB0aGUgd2luZG93ICovCi0gICAgdW5zaWduZWQgd3JpdGU7ICAgICAgICAgICAgIC8qIHdp bmRvdyB3cml0ZSBpbmRleCAqLworICAgIHVuc2lnbmVkIHduZXh0OyAgICAgICAgICAgICAvKiB3 aW5kb3cgd3JpdGUgaW5kZXggKi8KICAgICB1bnNpZ25lZCBjaGFyICp3aW5kb3c7ICAgICAgLyog YWxsb2NhdGVkIHNsaWRpbmcgd2luZG93LCBpZiB3c2l6ZSAhPSAwICovCiAgICAgdW5zaWduZWQg bG9uZyBob2xkOyAgICAgICAgIC8qIGxvY2FsIHN0cm0tPmhvbGQgKi8KICAgICB1bnNpZ25lZCBi aXRzOyAgICAgICAgICAgICAgLyogbG9jYWwgc3RybS0+Yml0cyAqLwpAQCAtODUsNyArNzcsNyBA QCB2b2lkIGluZmxhdGVfZmFzdCh6X3N0cmVhbXAgc3RybSwgdW5zaWduZWQgc3RhcnQpCiAgICAg Y29kZSBjb25zdCAqZGNvZGU7ICAgICAgICAgIC8qIGxvY2FsIHN0cm0tPmRpc3Rjb2RlICovCiAg ICAgdW5zaWduZWQgbG1hc2s7ICAgICAgICAgICAgIC8qIG1hc2sgZm9yIGZpcnN0IGxldmVsIG9m IGxlbmd0aCBjb2RlcyAqLwogICAgIHVuc2lnbmVkIGRtYXNrOyAgICAgICAgICAgICAvKiBtYXNr IGZvciBmaXJzdCBsZXZlbCBvZiBkaXN0YW5jZSBjb2RlcyAqLwotICAgIGNvZGUgdGhpczsgICAg ICAgICAgICAgICAgICAvKiByZXRyaWV2ZWQgdGFibGUgZW50cnkgKi8KKyAgICBjb2RlIGhlcmU7 ICAgICAgICAgICAgICAgICAgLyogcmV0cmlldmVkIHRhYmxlIGVudHJ5ICovCiAgICAgdW5zaWdu ZWQgb3A7ICAgICAgICAgICAgICAgIC8qIGNvZGUgYml0cywgb3BlcmF0aW9uLCBleHRyYSBiaXRz LCBvciAqLwogICAgICAgICAg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lcmUub3ApOwogICAg ICAgICBpZiAob3AgPT0gMCkgeyAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbGl0ZXJhbCAq LwotICAgICAgICAgICAgKm91dCsrID0gKHVuc2lnbmVkIGNoYXIpKHRoaXMudmFsKTsKKyAgICAg ICAgICAgICpvdXQrKyA9ICh1bnNpZ25lZCBjaGFyKShoZXJlLnZhbCk7CiAgICAgICAgIH0KICAg ICAgICAgZWxzZSBpZiAob3AgJiAxNikgeyAgICAgICAgICAgICAgICAgICAgIC8qIGxlbmd0aCBi YXNlICovCi0gICAgICAgICAgICBsZW4gPSAodW5zaWduZWQpKHRoaXMudmFsKTsKKyAgICAgICAg ICAgIGxlbiA9ICh1bnNpZ25lZCkoaGVyZS52YWwpOwogICAgICAgICAgICAgb3AgJj0gMTU7ICAg ICAgICAgICAgICAgICAgICAgICAgICAgLyogbnVtYmVyIG9mIGV4dHJhIGJpdHMgKi8KICAgICAg ICAgICAgIGlmIChvcCkgewogICAgICAgICAgICAgICAgIGlmIChiaXRzIDwgb3ApIHsKQEAgLTE0 OSwxNCArMTQxLDE0IEBAIHZvaWQgaW5mbGF0ZV9mYXN0KHpfc3RyZWFtcCBzdHJtLCB1bnNpZ25l ZCBzdGFydCkKICAgICAgICAgICAgICAgICBob2xkICs9ICh1bnNpZ25lZCBsb25nKSgqaW4rKykg PDwgYml0czsKICAgICAgICAgICAgICAgICBiaXRzICs9IDg7CiAgICAgICAgICAgICB9Ci0gICAg ICAgICAgICB0aGlzID0gZGNvZGVbaG9sZCAmIGRtYXNrXTsKKyAgICAgICAgICAgIGhlcmUgPSBk Y29kZVtob2xkICYgZG1hc2tdOwogICAgICAgICAgIGRvZGlzdDoKLSAgICAgICAgICAgIG9wID0g KHVuc2lnbmVkKSh0aGlzLmJpdHMpOworICAgICAgICAgICAgb3AgPSAodW5zaWduZWQpKGhlcmUu Yml0cyk7CiAgICAgICAgICAgICBob2xkID4+PSBvcDsKICAgICAgICAgICAgIGJpdHMgLT0gb3A7 Ci0gICAgICAgICAgICBvcCA9ICh1bnNpZ25lZCkodGhpcy5vcCk7CisgICAgICAgICAgICBvcCA9 ICh1bnNpZ25lZCkoaGVyZS5vcCk7CiAgICAgICAgICAgICBpZiAob3AgJiAxNikgeyAgICAgICAg ICAgICAgICAgICAgICAvKiBkaXN0YW5jZSBiYXNlICovCi0gICAgICAgICAgICAgICAgZGlzdCA9 ICh1bnNpZ25lZCkodGhpcy52YWwpOworICAgICAgICAgICAgICAgIGRpc3QgPSAodW5zaWduZWQp KGhlcmUudmFsKTsKICAgICAgICAgICAgICAgICBvcCAmPSAxNTsgICAgICAgICAgICAgICAgICAg ICAgIC8qIG51bWJlciBvZiBleHRyYSBiaXRzICovCiAgICAgICAgICAgICAgICAgaWYgKGJpdHMg PCBvcCkgewogICAgICAgICAgICAgICAgICAgICBob2xkICs9ICh1bnNpZ25lZCBsb25nKSgqaW4r KykgPDwgYml0czsKQEAgLTE4MCwxMiArMTcyLDM0IEBAIHZvaWQgaW5mbGF0ZV9mYXN0KHpfc3Ry ZWFtcCBzdHJtLCB1bnNpZ25lZCBzdGFydCkKICAgICAgICAgICAgICAgICBpZiAoZGlzdCA+IG9w KSB7ICAgICAgICAgICAgICAgIC8qIHNlZSBpZiBjb3B5IGZyb20gd2luZG93ICovCiAgICAgICAg ICAgICAgICAgICAgIG9wID0gZGlzdCAtIG9wOyAgICAgICAgICAgICAvKiBkaXN0YW5jZSBiYWNr IGluIHdpbmRvdyAqLwogICAgICAgICAgICAgICAgICAgICBpZiAob3AgPiB3aGF2ZSkgewotICAg ICAgICAgICAgICAgICAgICAgICAgc3RybS0+bXNnID0gKGNoYXIgKikiaW52YWxpZCBkaXN0YW5j ZSB0b28gZmFyIGJhY2siOwotICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGUtPm1vZGUgPSBC QUQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAg ICAgIGlmIChzdGF0ZS0+c2FuZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cm0t Pm1zZyA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjaGFyICopImludmFsaWQg ZGlzdGFuY2UgdG9vIGZhciBiYWNrIjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0 ZS0+bW9kZSA9IEJBRDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAg ICAgICAgICAgICAgICAgICAgIH0KKyNpZmRlZiBJTkZMQVRFX0FMTE9XX0lOVkFMSURfRElTVEFO Q0VfVE9PRkFSX0FSUlIKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsZW4gPD0gb3AgLSB3 aGF2ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHsKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgKm91dCsrID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICB9IHdoaWxlICgtLWxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7 CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBsZW4g LT0gb3AgLSB3aGF2ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRvIHsKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAqb3V0KysgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgfSB3 aGlsZSAoLS1vcCA+IHdoYXZlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcCA9PSAw KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJvbSA9IG91dCAtIGRpc3Q7CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgZG8geworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAqb3V0KysgPSAqZnJvbSsrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hp bGUgKC0tbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAg ICAgICAgICAgICAgICAgICAgIH0KKyNlbmRpZgogICAgICAgICAgICAgICAgICAgICB9CiAgICAg ICAgICAgICAgICAgICAgIGZyb20gPSB3aW5kb3c7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh3 cml0ZSA9PSAwKSB7ICAgICAgICAgICAvKiB2ZXJ5IGNvbW1vbiBjYXNlICovCisgICAgICAgICAg ICAgICAgICAgIGlmICh3bmV4dCA9PSAwKSB7ICAgICAgICAgICAvKiB2ZXJ5IGNvbW1vbiBjYXNl ICovCiAgICAgICAgICAgICAgICAgICAgICAgICBmcm9tICs9IHdzaXplIC0gb3A7CiAgICAgICAg ICAgICAgICAgICAgICAgICBpZiAob3AgPCBsZW4pIHsgICAgICAgICAvKiBzb21lIGZyb20gd2lu ZG93ICovCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVuIC09IG9wOwpAQCAtMTk1LDE3 ICsyMDksMTcgQEAgdm9pZCBpbmZsYXRlX2Zhc3Qoel9zdHJlYW1wIHN0cm0sIHVuc2lnbmVkIHN0 YXJ0KQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyb20gPSBvdXQgLSBkaXN0OyAgLyog cmVzdCBmcm9tIG91dHB1dCAqLwogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAg ICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHdyaXRlIDwgb3ApIHsg ICAgICAvKiB3cmFwIGFyb3VuZCB3aW5kb3cgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIGZy b20gKz0gd3NpemUgKyB3cml0ZSAtIG9wOwotICAgICAgICAgICAgICAgICAgICAgICAgb3AgLT0g d3JpdGU7CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHduZXh0IDwgb3ApIHsgICAgICAv KiB3cmFwIGFyb3VuZCB3aW5kb3cgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgIGZyb20gKz0g d3NpemUgKyB3bmV4dCAtIG9wOworICAgICAgICAgICAgICAgICAgICAgICAgb3AgLT0gd25leHQ7 CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob3AgPCBsZW4pIHsgICAgICAgICAvKiBzb21l IGZyb20gZW5kIG9mIHdpbmRvdyAqLwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlbiAt PSBvcDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7CiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICpvdXQrKyA9ICpmcm9tKys7CiAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgfSB3aGlsZSAoLS1vcCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJvbSA9 IHdpbmRvdzsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAod3JpdGUgPCBsZW4pIHsg IC8qIHNvbWUgZnJvbSBzdGFydCBvZiB3aW5kb3cgKi8KLSAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgb3AgPSB3cml0ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAod25l eHQgPCBsZW4pIHsgIC8qIHNvbWUgZnJvbSBzdGFydCBvZiB3aW5kb3cgKi8KKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgb3AgPSB3bmV4dDsKICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgbGVuIC09IG9wOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7 CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqb3V0KysgPSAqZnJvbSsrOwpA QCAtMjE1LDcgKzIyOSw3IEBAIHZvaWQgaW5mbGF0ZV9mYXN0KHpfc3RyZWFtcCBzdHJtLCB1bnNp Z25lZCBzdGFydCkKICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAg ICAgfQogICAgICAgICAgICAgICAgICAgICBlbHNlIHsgICAgICAgICAgICAgICAgICAgICAgLyog Y29udGlndW91cyBpbiB3aW5kb3cgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIGZyb20gKz0g d3JpdGUgLSBvcDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZyb20gKz0gd25leHQgLSBvcDsK ICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcCA8IGxlbikgeyAgICAgICAgIC8qIHNvbWUg ZnJvbSB3aW5kb3cgKi8KICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZW4gLT0gb3A7CiAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8gewpAQCAtMjM3LDU0ICsyNTEsMjIgQEAgdm9p ZCBpbmZsYXRlX2Zhc3Qoel9zdHJlYW1wIHN0cm0sIHVuc2lnbmVkIHN0YXJ0KQogICAgICAgICAg ICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGVsc2Ugewot CQkgICAgdW5zaWduZWQgc2hvcnQgKnNvdXQ7Ci0JCSAgICB1bnNpZ25lZCBsb25nIGxvb3BzOwot CiAgICAgICAgICAgICAgICAgICAgIGZyb20gPSBvdXQgLSBkaXN0OyAgICAgICAgICAvKiBjb3B5 IGRpcmVjdCBmcm9tIG91dHB1dCAqLwotCQkgICAgLyogbWluaW11bSBsZW5ndGggaXMgdGhyZWUg Ki8KLQkJICAgIC8qIEFsaWduIG91dCBhZGRyICovCi0JCSAgICBpZiAoISgobG9uZykob3V0IC0g MSkgJiAxKSkgewotCQkJKm91dCsrID0gKmZyb20rKzsKLQkJCWxlbi0tOwotCQkgICAgfQotCQkg ICAgc291dCA9ICh1bnNpZ25lZCBzaG9ydCAqKShvdXQpOwotCQkgICAgaWYgKGRpc3QgPiAyKSB7 Ci0JCQl1bnNpZ25lZCBzaG9ydCAqc2Zyb207Ci0KLQkJCXNmcm9tID0gKHVuc2lnbmVkIHNob3J0 ICopKGZyb20pOwotCQkJbG9vcHMgPSBsZW4gPj4gMT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m91dCsrID0gKmZyb20rKzsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxlbiAt PSAzOworICAgICAgICAgICAgICAgICAgICB9IHdoaWxlIChsZW4gPiAyKTsKKyAgICAgICAgICAg ICAgICAgICAgaWYgKGxlbikgeworICAgICAgICAgICAgICAgICAgICAgICAgKm91dCsrID0gKmZy b20rKzsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsZW4gPiAxKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICpvdXQrKyA9ICpmcm9tKys7CisgICAgICAgICAgICAgICAgICAgIH0K ICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBlbHNlIGlmICgo b3AgJiA2NCkgPT0gMCkgeyAgICAgICAgICAvKiAybmQgbGV2ZWwgZGlzdGFuY2UgY29kZSAqLwot ICAgICAgICAgICAgICAgIHRoaXMgPSBkY29kZVt0aGlzLnZhbCArIChob2xkICYgKCgxVSA8PCBv cCkgLSAxKSldOworICAgICAgICAgICAgICAgIGhlcmUgPSBkY29kZVtoZXJlLnZhbCArIChob2xk ICYgKCgxVSA8PCBvcCkgLSAxKSldOwogICAgICAgICAgICAgICAgIGdvdG8gZG9kaXN0OwogICAg ICAgICAgICAgfQogICAgICAgICAgICAgZWxzZSB7CkBAIC0yOTQsNyArMjc2LDcgQEAgdm9pZCBp bmZsYXRlX2Zhc3Qoel9zdHJlYW1wIHN0cm0sIHVuc2lnbmVkIHN0YXJ0KQogICAgICAgICAgICAg fQogICAgICAgICB9CiAgICAgICAgIGVsc2UgaWYgKChvcCAmIDY0KSA9PSAwKSB7ICAgICAgICAg ICAgICAvKiAybmQgbGV2ZWwgbGVuZ3RoIGNvZGUgKi8KLSAgICAgICAgICAgIHRoaXMgPSBsY29k ZVt0aGlzLnZhbCArIChob2xkICYgKCgxVSA8PCBvcCkgLSAxKSldOworICAgICAgICAgICAgaGVy ZSA9IGxjb2RlW2hlcmUudmFsICsgKGhvbGQgJiAoKDFVID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gIHN0YXRlLT53cml0ZSA9IGNvcHk7CisgICAg ICAgICAgICBzdGF0ZS0+d25leHQgPSBjb3B5OwogICAgICAgICAgICAgc3RhdGUtPndoYXZlID0g c3RhdGUtPndzaXplOwogICAgICAgICB9CiAgICAgICAgIGVsc2UgewotICAgICAgICAgICAgc3Rh dGUtPndyaXRlICs9IGRpc3Q7Ci0gICAgICAgICAgICBpZiAoc3RhdGUtPndyaXRlID09IHN0YXRl LT53c2l6ZSkgc3RhdGUtPndyaXRlID0gMDsKKyAgICAgICAgICAgIHN0YXRlLT53bmV4dCArPSBk aXN0OworICAgICAgICAgICAgaWYgKHN0YXRlLT53bmV4dCA9PSBzdGF0ZS0+d3NpemUpIHN0YXRl LT53bmV4dCA9IDA7CiAgICAgICAgICAgICBpZiAoc3RhdGUtPndoYXZlIDwgc3RhdGUtPndzaXpl KSBzdGF0ZS0+d2hhdmUgKz0gZGlzdDsKICAgICAgICAgfQogICAgIH0KQEAgLTY3NSwxMiArNjgw LDEyIEBAIGludCB6bGliX2luZmxhdGUoel9zdHJlYW1wIHN0cm0sIGludCBmbHVzaCkKICAgICAg ICAgICAgIGNvcHkgPSBvdXQgLSBsZWZ0OwogICAgICAgICAgICAgaWYgKHN0YXRlLT5vZmZzZXQg PiBjb3B5KSB7ICAgICAgICAgLyogY29weSBmcm9tIHdpbmRvdyAqLwogICAgICAgICAgICAgICAg IGNvcHkgPSBzdGF0ZS0+b2Zmc2V0IC0gY29weTsKLSAgICAgICAgICAgICAgICBpZiAoY29weSA+ IHN0YXRlLT53cml0ZSkgewotICAgICAgICAgICAgICAgICAgICBjb3B5IC09IHN0YXRlLT53cml0 ZTsKKyAgICAgICAgICAgICAgICBpZiAoY29weSA+IHN0YXRlLT53bmV4dCkgeworICAgICAgICAg ICAgICAgICAgICBjb3B5IC09IHN0YXRlLT53bmV4dDsKICAgICAgICAgICAgICAgICAgICAgZnJv bSA9IHN0YXRlLT53aW5kb3cgKyAoc3RhdGUtPndzaXplIC0gY29weS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ml0cywgaW5jbHVkaW5nIGxhc3QtZmxhZyBi aXQgKi8KICAgICAgICAgVFlQRURPLCAgICAgLyogaTogc2FtZSwgYnV0IHNraXAgY2hlY2sgdG8g ZXhpdCBpbmZsYXRlIG9uIG5ldyBibG9jayAqLwogICAgICAgICBTVE9SRUQsICAgICAvKiBpOiB3 YWl0aW5nIGZvciBzdG9yZWQgc2l6ZSAobGVuZ3RoIGFuZCBjb21wbGVtZW50KSAqLworICAgICAg ICBDT1BZXywgICAgICAvKiBpL286IHNhbWUgYXMgQ09QWSBiZWxvdywgYnV0IG9ubHkgZmlyc3Qg dGltZSBpbiAqLwogICAgICAgICBDT1BZLCAgICAgICAvKiBpL286IHdhaXRpbmcgZm9yIGlucHV0 IG9yIG91dHB1dCB0byBjb3B5IHN0b3JlZCBibG9jayAqLwogICAgICAgICBUQUJMRSwgICAgICAv KiBpOiB3YWl0aW5nIGZvciBkeW5hbWljIGJsb2NrIHRhYmxlIGxlbmd0aHMgKi8KICAgICAgICAg TEVOTEVOUywgICAgLyogaTogd2FpdGluZyBmb3IgY29kZSBsZW5ndGggY29kZSBsZW5ndGhzICov CiAgICAgICAgIENPREVMRU5TLCAgIC8qIGk6IHdhaXRpbmcgZm9yIGxlbmd0aC9saXQgYW5kIGRp c3RhbmNlIGNvZGUgbGVuZ3RocyAqLwotICAgICAgICAgICAgTEVOLCAgICAgICAgLyogaTogd2Fp dGluZyBmb3IgbGVuZ3RoL2xpdCBjb2RlICovCisgICAgICAgICAgICBMRU5fLCAgICAgICAvKiBp OiBzYW1lIGFzIExFTiBiZWxvdywgYnV0IG9ubHkgZmlyc3QgdGltZSBpbiAqLworICAgICAgICAg ICAgTEVOLCAgICAgICAgLyogaTogd2FpdGluZyBmb3IgbGVuZ3RoL2xpdC9lb2IgY29kZSAqLwog ICAgICAgICAgICAgTEVORVhULCAgICAgLyogaTogd2FpdGluZyBmb3IgbGVuZ3RoIGV4dHJhIGJp dHMgKi8KICAgICAgICAgICAgIERJU1QsICAg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8KLSAgICAgICAgdGhpcy5iaXRzID0gKHVuc2lnbmVkIGNoYXIpMTsK LSAgICAgICAgdGhpcy52YWwgPSAodW5zaWduZWQgc2hvcnQpMDsKLSAgICAgICAgKigqdGFibGUp KysgPSB0aGlzOyAgICAgICAgICAgICAvKiBtYWtlIGEgdGFibGUgdG8gZm9yY2UgYW4gZXJyb3Ig Ki8KLSAgICAgICAgKigqdGFibGUpKysgPSB0aGlzOworICAgICAgICBoZXJlLm9wID0gKHVuc2ln bmVkIGNoYXIpNjQ7ICAgIC8qIGludmFsaWQgY29kZSBtYXJrZXIgKi8KKyAgICAgICAgaGVyZS5i aXRzID0gKHVuc2lnbmVkIGNoYXIpMTsKKyAgICAgICAgaGVyZS52YWwgPSAodW5zaWduZWQgc2hv cnQpMDsKKyAgICAgICAgKigqdGFibGUpKysgPSBoZXJlOyAgICAgICAgICAgICAvKiBtYWtlIGEg dGFibGUgdG8gZm9yY2UgYW4gZXJyb3IgKi8KKyAgICAgICAgKigqdGFibGUpKysgPSBoZXJlOwog ICAgICAgICAqYml0cyA9IDE7CiAgICAgICAgIHJldHVybiAwOyAgICAgLyogbm8gc3ltYm9scywg YnV0IHdhaXQgZm9yIGRlY29kaW5nIHRvIHJlcG9ydCBlcnJvciAqLwogICAgIH0KLSAgICBmb3Ig KG1pbiA9IDE7IG1pbiA8IE1BWEJJVFM7IG1pbisrKQorICAgIGZvciAobWluID0gMTsgbWluIDwg bWF4OyBtaW4rKykKICAgICAgICAgaWYgKGNvdW50W21pbl0gIT0gMCkgYnJlYWs7CiAgICAgaWYg KHJvb3QgPCBtaW4pIHJvb3QgPSBtaW47CiAKQEAgLTE1MiwxMSArMTUyLDEwIEBAIGludCB6bGli X2luZmxhdGVfdGFibGUoY29kZXR5cGUgdHlwZSwgdW5zaWduZWQgc2hvcnQgKmxlbnMsIHVuc2ln bmVkIGNvZGVzLAogICAgICAgIGVudGVyZWQgaW4gdGhlIHRhYmxlcy4KIAogICAgICAgIHVzZWQg a2Vlc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WF4LCBpLmUuIGFsbCBjb2RlcywgaGF2ZSBiZWVuIHByb2Nlc3NlZC4gIFRo aXMKQEAgLTE2OCwxOSArMTY3LDE3IEBAIGludCB6bGliX2luZmxhdGVfdGFibGUoY29kZXR5cGUg dHlwZSwgdW5zaWduZWQgc2hvcnQgKmxlbnMsIHVuc2lnbmVkIGNvZGVzLAogICAgIHN3aXRjaCAo dHlwZSkgewogICAgIGNhc2UgQ09ERVM6CiAgICAgICAgIGJhc2UgPSBleHRyYSA9IHdvcms7ICAg IC8qIGR1bW15IHZhbHVlLS1ub3QgdXNlZCAqLwotICAgICAgICBlbmQgPSAxOTsKKyAgICAgICAg bWF0Y2ggPSAyMDsKICAgICAgICAgYnJlYWs7CiAgICAgY2FzZSBMRU5TOgogICAgICAgICBiYXNl ID0gbGJhc2U7Ci0gICAgICAgIGJhc2UgLT0gMjU3OwogICAgICAgICBleHRyYSA9IGxleHQ7Ci0g ICAgICAgIGV4dHJhIC09IDI1NzsKLSAgICAgICAgZW5kID0gMjU2OworICAgICAgICBtYXRjaCA9 IDI1NzsKICAgICAgICAgYnJlYWs7Ci0gICAgZGVmYXVsdDogICAgICAgICAgICAvKiBESVNUUyAq LworICAgIGRlZmF1bHQ6ICAgIC8qIERJU1RTICovCiAgICAgICAgIGJhc2UgPSBkYmFzZTsKICAg ICAgICAgZXh0cmEgPSBkZXh0OwotICAgICAgICBlbmQgPSAtMTsKKyAgICAgICAgbWF0Y2ggPSAw OwogICAgIH0KIAogICAgIC8qIGluaXRpYWxpemUgc3RhdGUgZm9yIGxvb3AgKi8KQEAgLTE5NSwy NCArMTkyLDI1IEBAIGludCB6bGliX2luZmxhdGVfdGFibGUoY29kZXR5cGUgdHlwZSwgdW5zaWdu ZWQgc2hvcnQgKmxlbnMsIHVuc2lnbmVkIGNvZGVzLAogICAgIG1hc2sgPSB1c2VkIC0gMTsgICAg ICAgICAgICAvKiBtYXNrIGZvciBjb21wYXJpbmcgbG93ICovCiAKICAgICAvKiBjaGVjayBhdmFp bGFibGUgdGFibGUgc3BhY2UgKi8KLSAgICBpZiAodHlwZSA9PSBMRU5TICYmIHVzZWQgPj0gRU5P VUdIIC0gTUFYRCkKKyAgICBpZiAoKHR5cGUgPT0gTEVOUyAmJiB1c2VkID4gRU5PVUdIX0xFTlMp IHx8CisgICAgICAgICh0eXBlID09IERJU1RTICYmIHVzZWQgPiBFTk9VR0hfRElTVFMpKQogICAg ICAgICByZXR1cm4gMTsKIAogICAgIC8qIHByb2Nlc3MgYWxsIGNvZGVzIGFuZCBtYWtlIHRhYmxl IGVudHJpZXMgKi8KICAgICBmb3IgKDs7KSB7CiAgICAgICAgIC8qIGNyZWF0ZSB0YWJsZSBlbnRy eSAqLwotICAgICAgICB0aGlzLmJpdHMgPSAodW5zaWduZWQgY2hhcikobGVuIC0gZHJvcCk7Ci0g ICAgICAgIGlmICgoaW50KSh3b3JrW3N5bV0pIDwgZW5kKSB7Ci0gICAgICAgICAgICB0aGlzLm9w ID0gKHVuc2lnbmVkIGNoYXIpMDsKLSAgICAgICAgICAgIHRoaXMudmFsID0gd29ya1tzeW1dOwor ICAgICAgICBoZXJlLmJpdHMgPSAodW5zaWduZWQgY2hhcikobGVuIC0gZHJvcCk7CisgICAgICAg IGlmICh3b3JrW3N5bV0gKyAxVSA8IG1hdGNoKSB7CisgICAgICAgICAgICBoZXJlLm9wID0gKHVu c2lnbmVkIGNoYXIpMDsKKyAgICAgICAgICAgIGhlcmUudmFsID0gd29ya1tzeW1dOwogICAgICAg ICB9Ci0gICAgICAgIGVsc2UgaWYgKChpbnQpKHdvcmtbc3ltXSkgPiBlbmQpIHsKLSAgICAgICAg ICAgIHRoaXMub3AgPSAodW5zaWduZWQgY2hhcikoZXh0cmFbd29ya1tzeW1dXSk7Ci0gICAgICAg ICAgICB0aGlzLnZhbCA9IGJhc2Vbd29ya1tzeW1dXTsKKyAgICAgICAgZWxzZSBpZiAod29ya1tz eW1dID49IG1hdGNoKSB7CisgICAgICAgICAgICBoZXJlLm9wID0gKHVuc2lnbmVkIGNoYXIpKGV4 dHJhW3dvcmtbc3ltXSAtIG1hdGNoXSk7CisgICAgICAgICAgICBoZXJlLnZhbCA9IGJhc2Vbd29y a1tzeW1dIC0gbWF0Y2hdOwogICAgICAgICB9CiAgICAgICAgIGVsc2UgewotICAgICAgICAgICAg dGhpcy5vcCA9ICh1bnNpZ25lZCBjaGFyKSgzMiArIDY0KTsgICAgICAgICAvKiBlbmQgb2YgYmxv Y2sgKi8KLSAgICAgICAgICAgIHRoaXMudmFsID0gMDsKKyAgICAgICAgICAgIGhlcmUub3AgPSAo dW5zaWduZWQgY2hhcikoMzIgKyA2NCk7ICAgICAgICAgLyogZW5kIG9mIGJsb2NrICovCisgICAg ICAgICAgICBoZXJlLnZhbCA9IDA7CiAgICAgICAgIH0KIAogICAgICAgICAvKiByZXBsaWNhdGUg Zm9yIHRob3NlIGluZGljZXMgd2l0aCBsb3cgbGVuIGJpdHMgZXF1YWwgdG8gaHVmZiAqLwpAQCAt MjIxLDcgKzIxOSw3IEBAIGludCB6bGliX2luZmxhdGVfdGFibGUoY29kZXR5cGUgdHlwZSwgdW5z aWduZWQgc2hvcnQgKmxlbnMsIHVuc2lnbmVkIGNvZGVzLAogICAgICAgICBtaW4gPSBmaWxsOyAg ICAgICAgICAgICAgICAgLyogc2F2ZSBvZmZzZXQgdG8gbmV4dCB0YWJsZSAqLwogICAgICAgICBk byB7CiAgICAgICAgICAgICBmaWxsIC09IGluY3I7Ci0gICAgICAgICAgICBuZXh0WyhodWZmID4+ IGRyb3ApICsgZmlsbF0gPSB0aGlzOworICAgICAgICAgICAgbmV4dFsoaHVmZiA+PiBkcm9wKSAr IGZpbGxdID0gaGVyZTsKICAgICAgICAgfSB3aGlsZSAoZmlsbCAhPSAwKTsKIAogICAgICAgICAv KiBiYWNrd2FyZHMgaW5jcmVtZW50IHRoZSBsZW4tYml0IGNvZGUgaHVmZiAqLwpAQCAtMjYzLDcg KzI2MSw4IEBAIGludCB6bGliX2luZ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wg dGhlIGxvb3AKLSAgICAgICBkcm9wcyBiYWNrIHRvIHRoZSByb290IHRhYmxlIHRvIGZpbGwgaW4g YW55IHJlbWFpbmluZyBlbnRyaWVzIHRoZXJlLgotICAgICAqLwotICAgIHRoaXMub3AgPSAodW5z aWduZWQgY2hhcik2NDsgICAgICAgICAgICAgICAgLyogaW52YWxpZCBjb2RlIG1hcmtlciAqLwot ICAgIHRoaXMuYml0cyA9ICh1bnNpZ25lZCBjaGFyKShsZW4gLSBkcm9wKTsKLSAgICB0aGlzLnZh bCA9ICh1bnNpZ25lZCBzaG9ydCkwOwotICAgIHdoaWxlIChodWZmICE9IDApIHsKLSAgICAgICAg Lyogd2hlbiBkb25lIHdpdGggc3ViLXRhYmxlLCBkcm9wIGJhY2sgdG8gcm9vdCB0YWJsZSAqLwot ICAgICAgICBpZiAoZHJvcCAhPSAwICYmIChodWZmICYgbWFzaykgIT0gbG93KSB7Ci0gICAgICAg ICAgICBkcm9wID0gMDsKLSAgICAgICAgICAgIGxlbiA9IHJvb3Q7Ci0gICAgICAgICAgICBuZXh0 ID0gKnRhYmxlOwotICAgICAgICAgICAgdGhpcy5iaXRzID0gKHVuc2lnbmVkIGNoYXIpbGVuOwot ICAgICAgICB9Ci0KLSAgICAgICAgLyogcHV0IGludmFsaWQgY29kZSBtYXJrZXIgaW4gdGFibGUg Ki8KLSAgICAgICAgbmV4dFtodWZmID4+IGRyb3BdID0gdGhpczsKLQotICAgICAgICAvKiBiYWNr d2FyZHMgaW5jcmVtZW50IHRoZSBsZW4tYml0IGNvZGUgaHVmZiAqLwotICAgICAgICBpbmNyID0g MVUgPDwgKGxlbiAtIDEpOwotICAgICAgICB3aGlsZSAoaHVmZiAmIGluY3IpCi0gICAgICAgICAg ICBpbmNyID4+PSAxOwotICAgICAgICBpZiAoaW5jciAhPSAwKSB7Ci0gICAgICAgICAgICBodWZm ICY9IGluY3IgLSAxOwotICAgICAgICAgICAgaHVmZiArPSBpbmNyOwotICAgICAgICB9Ci0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VFMKIH0gY29kZXR5cGU7CiAKLWV4dGVybiBpbnQg emxpYl9pbmZsYXRlX3RhYmxlIChjb2RldHlwZSB0eXBlLCB1bnNpZ25lZCBzaG9ydCAqbGVucywK K2ludCB6bGliX2luZmxhdGVfdGFibGUgKGNvZGV0eXBlIHR5cGUsIHVuc2lnbmVkIHNob3J0ICps ZW5zLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjb2RlcywgY29kZSAq KnRhYmxlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCAqYml0cywgdW5z aWduZWQgc2hvcnQgKndvcmspOwotI2VuZGlmCi0tIAoyLjMxLjEuMzY1LmdhMmEwNWEzOWM1Cgo= --000000000000a2b63c05c1707ab9--