From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.bugs Subject: bug#43100: 28.0.50; pcase not binding variables conditionally Date: Mon, 31 Aug 2020 19:32:43 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="0000000000009fed8e05ae317999" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16099"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Philipp Stephani , 43100@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 31 21:34:13 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kCpZE-00044m-3y for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 31 Aug 2020 21:34:12 +0200 Original-Received: from localhost ([::1]:59264 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kCpZD-0005Ae-6J for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 31 Aug 2020 15:34:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53352) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kCpZ4-00059V-Rn for bug-gnu-emacs@gnu.org; Mon, 31 Aug 2020 15:34:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42197) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kCpZ4-0005at-Hp for bug-gnu-emacs@gnu.org; Mon, 31 Aug 2020 15:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kCpZ4-0001Fc-Ee for bug-gnu-emacs@gnu.org; Mon, 31 Aug 2020 15:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Pip Cet Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 31 Aug 2020 19:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43100 X-GNU-PR-Package: emacs Original-Received: via spool by 43100-submit@debbugs.gnu.org id=B43100.15989024104747 (code B ref 43100); Mon, 31 Aug 2020 19:34:02 +0000 Original-Received: (at 43100) by debbugs.gnu.org; 31 Aug 2020 19:33:30 +0000 Original-Received: from localhost ([127.0.0.1]:53738 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kCpYX-0001EU-LU for submit@debbugs.gnu.org; Mon, 31 Aug 2020 15:33:30 -0400 Original-Received: from mail-ot1-f46.google.com ([209.85.210.46]:43934) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kCpYU-0001EF-Jd for 43100@debbugs.gnu.org; Mon, 31 Aug 2020 15:33:28 -0400 Original-Received: by mail-ot1-f46.google.com with SMTP id v16so6361976otp.10 for <43100@debbugs.gnu.org>; Mon, 31 Aug 2020 12:33:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OOxEnggrg5w3krgjf2IcUnPALzRdHZ7/QVxHdTs8oS4=; b=HW51mbI/rMzKIGOrH6U1DPhPkGTZarXoBAC9sPowHWxAPz/AP1nburmrr/59axW05J zuC8EbzK37jfAv8L5RS4cdQqUMd7o3l5nGSDxBmZyNgts6DVAPG18GXKQCjU0Y5Jqlcj yaLtXA1xeZGhmNW1JCjpORryZbbaXZfEc2foiNzTr2HWepPd7k33FU7FWxzJiA3HSBDK j0Au8vJuBxkOKkeW7VstWqkX0IV2WwxKQ54Oc70O4JcZEZQ81WCmGqRTLhzO2qSdRKml ipbjWJUoGPBibjMDYDuHt2FbeC0A/zgfs/TK5V4g5u1PwH5S58DdClHSZ/3NLzc3MZ5t BMhA== 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=OOxEnggrg5w3krgjf2IcUnPALzRdHZ7/QVxHdTs8oS4=; b=GWP7CuQMunbtVySsjD3tykasfhlEf0a5jqowyAGC3bd2tpq+eYkAt10+wcaIR/khgS L9OFOOPE9blNxCbvOUEVZmJnfB//PoiEJGLSOsCeBNGxjJFDDuIgS0gTTLcZDwcWptaQ yCCTWgUfrolaSje7lS4MJwi+79n+++WirJx681CpRbmG7t2phlCmDqMuN3k3SL8N1BqE GcNrd7Z3rdUZkaoYNUhuZbglgqqRrBNBeJjDVfxwnogLXMlxgRxFIJ7oYr5J/QcyDFLq K1u1LSKtCwqcRcw6CNGwj6oDB8lRF360xOHKXUc28p4Ac2sAFtjf1F7XyT5+SvmMYVKb yGBA== X-Gm-Message-State: AOAM531wEVgHfhZQaawblX2IRrOyVdAIZ9ZUU+o6ScN4AuvroQxsUPUZ LzFQtnfqGt+89TCWsVfONiBs0bNYf9NZisYaZ4g= X-Google-Smtp-Source: ABdhPJyFESWBl+QKFzmW/Pa5ZS+lcPw6YE3T9SMslk3E2mBL6KF7RhPc6Vtj9d9t3fh3ylser0xygCszTr+p/XmSSr8= X-Received: by 2002:a9d:6d92:: with SMTP id x18mr1981049otp.287.1598902400698; Mon, 31 Aug 2020 12:33:20 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:186793 Archived-At: --0000000000009fed8e05ae317999 Content-Type: text/plain; charset="UTF-8" Hello Stefan, On Sun, Aug 30, 2020 at 6:07 PM Stefan Monnier wrote: > > >> IIUC you want > >> > >> (pcase V > >> ((or (pred symbolp) name) > >> (let ((foo 'bar)) name))) > >> > >> to behave like > >> > >> (cond > >> ((symbolp V) (let ((foo 'bar)) name)) > >> (t (let ((name V)) (let ((foo 'bar)) name)))) > >> > >> ? > > > > Yes, that's correct. It's also how (pcase V ((or (pred symbolp) name) > > name) behaves... > > Indeed, but that's an accident. Ideally it should either signal an > error at macro-expansion time, or return nil when V is a symbol. So, as I half-expected, the reaction to "pcase isn't powerful enough" is "let's make it less powerful" :-) Seriously, I get the impression you strongly feel pcase shouldn't be (more) powerful, it should instead make non-explicit but fairly strong complexity promises. I disagree: in practice, complexity promises and optimization based on them are often unnecessary. In fact, there's a Lisp tradition of using assq and memq rather than building ad-hoc hash tables, even though that often means run time is theoretically O(n^2) rather than O(n log(n)). > Since the current implementation doesn't go to the effort of doing > either of those, we instead limit ourselves to recommend against using > such patterns (IOW, "use at your own risks"). > >> I'd rather not go there > > You'd rather have the behavior of (pcase V ((or pred symbolp) name) > > EXPR) depend on the complexity of EXPR? > > More specifically, I'd rather not choose a semantics that imposes > duplicating the branch body, since we have no control over its size and > that can hence lead to potential code size explosion. You're right, and it's a good thing that the duplication of the branch body is a fixable implementation detail rather than something imposed by the semantics. > A code size explosion due to a particular implementation choice is > undesirable, but a code size explosion imposed by the semantics is much > more problematic. Again, I don't think that's the case here. > > I think it would be nice to have a lexical three-argument version of > > pcase which specifies which variables are output values, treating the > > remaining ones as input values, to make it easier to build > > non-constant patterns. > > The design of `pcase` assumes you want to optimize away the tests that > are common to the various patterns. That can't be done with dynamic > patterns. Or it's a bit more difficult, at least... > > IOW, if you want to call a function with arguments determined by > > pcase-like patterns, why not introduce pcase-call so something like > > the following would work: > > > > (defun f (hello world) (cons hello world)) > > > > (let ((space " ") (hw "hello world")) > > (pcase-call 'f ((concat hello space world) hw))) > > How do you intend to implement this? Proof-of-concept attached; I'm no longer sure I want to be able to say (concat hello space world) rather than (concat hello (pred (equal space)) world); it's inconsistent to use `equal' here rather than `eq' for ordinary symbols (can't we at least use `eql'?), and I'm too worried about adding an optional argument called `space' and changing the interpretation of pcase-calls far away. The difficult part, in fact, is deciding that we want the arglist to be part of the exposed function API: given an "arglist" function, the rest of the implementation seems unproblematic, though some workarounds for lexical binding are required (if nothing else, this is an interesting exercise in how painful lexical binding can be to work with). > > As for duplicating the body, that is an implementation detail. You can > > easily avoid it by producing > > > > (let ((name name)) > > (cond ((symbolp V) X) > > (progn (setq name V) X))) > > So it's more like my option of returning nil, except it would return > the value of a surrounding `name` variable? That could be done, but I'm > not convinced it'd be more often useful. I started out with a fairly explicit practical problem: parsing GCC machine descriptions, which are (essentially) sexps but have made the mistake of having "optional" non-final parts, and I think it would be great to express that in a pcase pattern, both for the obvious reasons of legibility and for some non-obvious reasons of my own. > > disallowing the modification of name in X. > > That's rather hard to do (and I don't see what would be the benefit here). I meant adding a cautionary note about it in the documentation, not actively preventing it. If we had read-only bindings, pcase would probably use them, but we don't. > >> The "intended" behavior instead would be to behave like > >> > >> (cond > >> ((symbolp V) (let ((name nil)) (let ((foo 'bar)) name))) > >> (t (let ((name V)) (let ((foo 'bar)) name)))) > >> > >> That's already the behavior you get if you switch the two: > >> > >> (macroexpand '(pcase V > >> ((or (and (pred foo) name) (pred symbolp)) > >> (let ((foo 'bar)) name)))) > >> => > >> (let* ((pcase-0 (lambda (name) (let ((foo 'bar)) name)))) > >> (cond ((foo V) (funcall pcase-0 V)) > >> ((symbolp V) (funcall pcase-0 nil)) > >> (t nil))) > > > > I don't see where the nil comes from, or why it's a useful choice for > > a default value. > > It comes from the absence of a binding for `name` and was chosen because > nil is the standard default value in Elisp. Sorry, I meant I don't see anything in the pcase input that justifies our using a nil value. > It comes from this code in pcase.el: > > (let ((args (mapcar (lambda (pa) > (let ((v (assq (car pa) vars))) > (setq vars (delq v vars)) > (cdr v))) > prevvars))) > ;; If some of `vars' were not found in `prevvars', that's > ;; OK it just means those vars aren't present in all > ;; branches, so they can be used within the pattern > ;; (e.g. by a `guard/let/pred') but not in the branch. > ;; FIXME: But if some of `prevvars' are not in `vars' we > ;; should remove them from `prevvars'! > `(funcall ,res ,@args))))))) > > The computation of `args` searches in `vars` for the bindings expected > by the branch (stored in `prevvars` the first time we encountered that > branch). The assq+cdr will return nil if a var from `prevvars` isn't > found in `vars`. Yes, it's the precise code I want to change. > >> the fact that the behavior depends on the order of elements in `or` is > >> an undesirable side effect of the implementation technique. > > It also depends on the complexity of the branch. > > It seems to me there are at least three consistent ways of behaving > > (throw an error, bind name to nil, bind name to name), with an > > inconsistent fourth way being what's currently implemented. > > The current implementation amounts to "we should signal an error but we > don't bother doing so and just warn against it in the manual". > Patch welcome ;-) You mean a patch that would make pcase less powerful by making what I want to do impossible rather than merely difficult? > >> I don't know of a simple implementation. > > Here's my better-than-nothing attempt. I don't think that's complex; > > if anything, it's too trivial. > > So you give it a search-based semantics. I don't think the semantics are at all unclear, except for the greedy vs shy question. The implementation could be very different, reasoning about the length of sequences matched by pcase subpatterns, of course. > The problem with it for me is that if we turn > > `(,a ,@b) > > into > > (append `(,a) b) List-final ,@ is too special, IMHO, to be turned into an (append) pattern at all. > the pcase match will take a lot more time than the equivalent > > `(,a . ,b) > > Of course, you can try and handle these "easy" cases more efficiently, > but then your ,@ will sometimes be very cheap and sometimes very > expensive (depending on when an optimization can be applied), which > I think is a misfeature (it's for this same reason that I dislike CL > keyword arguments for functions). I think it's an implementation detail. Some reasoning about the minimum and maximum length of sequences matched by pcase patterns could help ordinary pcases, too, though: (pcase '(a b c d) (`(,a ,b ,c ,d) (list a b c d))) could call (pcase--check-length EXPVAL 4 4) rather than calling consp four times, potentially descending into expensive predicates that are unnecessary. It's strange to read quotes that yo In general, of course, multiple ,@s in the same list will be slow because it's a difficult problem. > I think it's fine to have such a search-based `append` (because it's > "reliably expensive") but I'd rather not automatically use it for ,@ Again, I think that's a fundamental difference between us when it comes to the philosophy behind pcase. If I understand you correctly, you deliberately want to limit pcase, moving away from the intuitive definition of it that I gave above, because there might be a situation in which people expect better performance than our limited implementation can give them. Is that correct? I think that's a weak reason for a strong limitation, but of course those are subjective questions. For example, I don't expect (pcase 9 ((* x x) x)) to work, and the intuitive try-everything oracle would work for it. In any case, if there is such a fundamental difference of opinion, pcase simply isn't what I should be looking at. > [ BTW, you don't need (nor want) `eval` in your definition. ] Thank you! Premature "optimization"... Thanks again! --0000000000009fed8e05ae317999 Content-Type: text/x-emacs-lisp; charset="US-ASCII"; name="pcall.el" Content-Disposition: attachment; filename="pcall.el" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_keix5kit0 OzsgLSotIGxleGljYWwtYmluZGluZzogdDsgLSotCgooZGVmdW4gZiAoaGVsbG8gd29ybGQpCiAg KGNvbnMgaGVsbG8gd29ybGQpKQoKKGRlZnVuIHBjYWxsLWNvbGxlY3Qtc3ltYm9scy0xIChleHBy IHB1c2hlcikKICAoY29uZAogICAoKGNvbnNwIGV4cHIpCiAgICAocGNhbGwtY29sbGVjdC1zeW1i b2xzLTEgKGNhciBleHByKSBwdXNoZXIpCiAgICAocGNhbGwtY29sbGVjdC1zeW1ib2xzLTEgKGNk ciBleHByKSBwdXNoZXIpKQogICAoKHN5bWJvbHAgZXhwcikKICAgIChmdW5jYWxsIHB1c2hlciBl eHByKSkpKQoKKGRlZnVuIHBjYWxsLWNvbGxlY3Qtc3ltYm9scyAoYmluZGluZ3MpCiAgKGxldCAo bGlzdCkKICAgIChkb2xpc3QgKGJpbmRpbmcgYmluZGluZ3MpCiAgICAgIChwY2FsbC1jb2xsZWN0 LXN5bWJvbHMtMSBiaW5kaW5nCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobGFtYmRh ICh4KQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodW5sZXNzIChtZW1xIHggbGlz dCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocHVzaCB4IGxpc3QpKSkpKQog ICAgbGlzdCkpCgooZGVmdW4gcGNhbGwtbWFrZS1lbnZpcm9ubWVudCAoc3ltcykKICAobGV0IChl bnYpCiAgICAoZG9saXN0IChzeW0gc3ltcykKICAgICAgKHB1c2ggKGxpc3QgJ2NvbnMKICAgICAg ICAgICAgICAgICAgKGxpc3QgJ3F1b3RlIHN5bSkKICAgICAgICAgICAgICAgICAgYChjb25kaXRp b24tY2FzZSBlcnJvcgogICAgICAgICAgICAgICAgICAgICAgICxzeW0KICAgICAgICAgICAgICAg ICAgICAgKHZvaWQtdmFyaWFibGUgKHB1c2ggJyxzeW0gdW5ib3VuZC1zeW1zKSkpKQogICAgICAg ICAgICBlbnYpKQogICAgKGNvbnMgJ2xpc3QgKG5yZXZlcnNlIGVudikpKSkKCihkZWZ1biBwY2Fs bGVyIChmdW5jIHBhdHMpCiAgKGxldCogKChhcmdsaXN0IChhcmdsaXN0IGZ1bmMpKQogICAgICAg ICAoYXJnLXN5bWJvbHMgKHBjYWxsLWNvbGxlY3Qtc3ltYm9scyBhcmdsaXN0KSkpCiAgICBgKGxh bWJkYSAoZW52IHZhbHMpCiAgICAgICAoZG9saXN0IChzeW0gJyxhcmdsaXN0KQogICAgICAgICA7 OyAoaWYgKGFzc3Egc3ltIGVudikKICAgICAgICAgOzsgICAgICh3YXJuICJzaGFkb3dpbmcgdmFy aWFibGUgYmluZGluZyBmb3IgJVMiCiAgICAgICAgIDs7ICAgICAgICAgICBzeW0pKQogICAgICAg ICAoc2V0cSBlbnYgKGFzc3EtZGVsZXRlLWFsbCBzeW0gZW52KSkpCiAgICAgICAoZXZhbCAnKGZp bHRlcmVkLXBjYXNlIHZhbHMKICAgICAgICAgICAgICAgIChsYW1iZGEgKHgpCiAgICAgICAgICAg ICAgICAgIChhc3NxIHggZW52KSkKICAgICAgICAgICAgICAgICgsKGxpc3QgJ1xgIChtYXBjYXIg KGxhbWJkYSAoeCkgKGxpc3QgJ1wsIHgpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBwYXRzKSkKICAgICAgICAgICAgICAgICAoZnVuY2FsbCAnLGZ1bmMgLEBhcmdsaXN0KSkp CiAgICAgICAgICAgICBlbnYpKSkpCgooZGVmdW4gYXJnbGlzdCAoZnVuYykKICAod2hpbGUgKGFu ZCAoc3ltYm9scCBmdW5jKQoJICAgICAgKHNldHEgZnVuYyAoc3ltYm9sLWZ1bmN0aW9uIGZ1bmMp KSkpCiAgKHBjYXNlIGZ1bmMKICAgICgob3IgYChsYW1iZGEgLGFyZ2xpc3QgLiAsYm9keSkKCSBg KGNsb3N1cmUgLGxleGVudiAsYXJnbGlzdCAuICxib2R5KSkKICAgICBhcmdsaXN0KQogICAgKF8g KGNkciAocmVhZAoJICAgICAoZG93bmNhc2UKCSAgICAgIChjYXIgKGhlbHAtc3BsaXQtZnVuZG9j IChkb2N1bWVudGF0aW9uIGZ1bmMgdCkgZnVuYyB0KSkpKSkpKSkKCihkZWZtYWNybyBwY2FsbCAo ZnVuYyAmcmVzdCBiaW5kaW5ncykKICAobGV0KiAoKHN5bXMgKHBjYWxsLWNvbGxlY3Qtc3ltYm9s cyBiaW5kaW5ncykpCiAgICAgICAgIChlbnYgKHBjYWxsLW1ha2UtZW52aXJvbm1lbnQgc3ltcykp CiAgICAgICAgIChwYXRzIChtYXBjYXIgIydjYXIgYmluZGluZ3MpKQogICAgICAgICAodmFscyAo bWFwY2FyICMnY2FkciBiaW5kaW5ncykpKQogIGAobGV0ICgoZnVuYyAnLGZ1bmMpKQogICAgICh3 aGlsZSAoYW5kIChzeW1ib2xwIGZ1bmMpCgkgICAgICAgICAoc2V0cSBmdW5jIChzeW1ib2wtZnVu Y3Rpb24gZnVuYykpKSkKICAgICAobGV0ICgocGNhbGxlciAoZnVuY2FsbCAjJ3BjYWxsZXIgZnVu YyAnLHBhdHMpKSkKICAgICAgIChsZXQqICgodW5ib3VuZC1zeW1zIChsaXN0IG5pbCkpCiAgICAg ICAgICAgICAgKGVudiAsZW52KQoJICAgICAgKHBjYXNlLS1lbnYgZW52KSkKICAgICAgICAgKGRv bGlzdCAoc3ltIHVuYm91bmQtc3ltcykKICAgICAgICAgICAoc2V0cSBlbnYgKGFzc3EtZGVsZXRl LWFsbCBzeW0gZW52KSkpCiAgICAgICAgIChmdW5jYWxsIHBjYWxsZXIgZW52IChsaXN0ICxAdmFs cykpKSkpKSkKCihkZWZ1biBwY2FzZS0tZXhwYW5kIChleHAgY2FzZXMgZmlsdGVyKQogIDs7ICht ZXNzYWdlICJwaWQ9JVMgKHBjYXNlLS1leHBhbmQgJVMgLi4uaGFzaD0lUykiCiAgOzsgICAgICAg ICAgKGVtYWNzLXBpZCkgZXhwIChzeGhhc2ggY2FzZXMpKQogIChtYWNyb2V4cC1sZXQyIG1hY3Jv ZXhwLWNvcHlhYmxlLXAgdmFsIGV4cAogICAgKGxldCogKChkZWZzICgpKQogICAgICAgICAgIChz ZWVuICcoKSkKICAgICAgICAgICAoY29kZWdlbgogICAgICAgICAgICAobGFtYmRhIChjb2RlIHZh cnMpCiAgICAgICAgICAgICAgKGxldCAoKHZhcnMgKHBjYXNlLS1mZ3JlcCB2YXJzIGNvZGUpKQog ICAgICAgICAgICAgICAgICAgIChwcmV2IChhc3NxIGNvZGUgc2VlbikpKQogICAgICAgICAgICAg ICAgKGlmIChub3QgcHJldikKICAgICAgICAgICAgICAgICAgICAobGV0ICgocmVzIChwY2FzZS1j b2RlZ2VuIGNvZGUgdmFycykpKQogICAgICAgICAgICAgICAgICAgICAgKHB1c2ggKGxpc3QgY29k ZSB2YXJzIHJlcykgc2VlbikKICAgICAgICAgICAgICAgICAgICAgIHJlcykKICAgICAgICAgICAg ICAgICAgOzsgU2luY2Ugd2UgdXNlIGEgdHJlZS1iYXNlZCBwYXR0ZXJuIG1hdGNoaW5nCiAgICAg ICAgICAgICAgICAgIDs7IHRlY2huaXF1ZSwgdGhlIGxlYXZlcyAodGhlIHBsYWNlcyB0aGF0IGNv bnRhaW4gdGhlCiAgICAgICAgICAgICAgICAgIDs7IGNvZGUgdG8gcnVuIG9uY2UgYSBwYXR0ZXJu IGlzIG1hdGNoZWQpIGNhbiBnZXQKICAgICAgICAgICAgICAgICAgOzsgY29waWVkIGEgdmVyeSBs YXJnZSBudW1iZXIgb2YgdGltZXMsIHNvIHRvIGF2b2lkCiAgICAgICAgICAgICAgICAgIDs7IGNv ZGUgZXhwbG9zaW9uLCB3ZSBuZWVkIHRvIGtlZXAgdHJhY2sgb2YgaG93IG1hbnkKICAgICAgICAg ICAgICAgICAgOzsgdGltZXMgd2UndmUgdXNlZCBlYWNoIGxlYWYgYW5kIG1vdmUgaXQKICAgICAg ICAgICAgICAgICAgOzsgdG8gYSBzZXBhcmF0ZSBmdW5jdGlvbiBpZiB0aGF0IG51bWJlciBpcyB0 b28gaGlnaC4KICAgICAgICAgICAgICAgICAgOzsKICAgICAgICAgICAgICAgICAgOzsgV2UndmUg YWxyZWFkeSB1c2VkIHRoaXMgYnJhbmNoLiAgU28gaXQgaXMgc2hhcmVkLgogICAgICAgICAgICAg ICAgICAobGV0KiAoKGNvZGUgKGNhciBwcmV2KSkgICAgICAgICAoY2RycHJldiAoY2RyIHByZXYp KQogICAgICAgICAgICAgICAgICAgICAgICAgKHByZXZ2YXJzIChjYXIgY2RycHJldikpICAoY2Rk cnByZXYgKGNkciBjZHJwcmV2KSkKICAgICAgICAgICAgICAgICAgICAgICAgIChyZXMgKGNhciBj ZGRycHJldikpKQogICAgICAgICAgICAgICAgICAgICh1bmxlc3MgKHN5bWJvbHAgcmVzKQogICAg ICAgICAgICAgICAgICAgICAgOzsgVGhpcyBpcyB0aGUgZmlyc3QgcmVwZWF0LCBzbyB3ZSBoYXZl IHRvIG1vdmUKICAgICAgICAgICAgICAgICAgICAgIDs7IHRoZSBicmFuY2ggdG8gYSBzZXBhcmF0 ZSBmdW5jdGlvbi4KICAgICAgICAgICAgICAgICAgICAgIChsZXQgKChic3ltCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgKG1ha2Utc3ltYm9sIChmb3JtYXQgInBjYXNlLSVkIiAobGVuZ3Ro IGRlZnMpKSkpKQogICAgICAgICAgICAgICAgICAgICAgICAocHVzaCBgKCxic3ltIChsYW1iZGEg LChtYXBjYXIgIydjYXIgcHJldnZhcnMpICxAY29kZSkpCiAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGRlZnMpCiAgICAgICAgICAgICAgICAgICAgICAgIChzZXRjYXIgcmVzICdmdW5jYWxs KQogICAgICAgICAgICAgICAgICAgICAgICAoc2V0Y2RyIHJlcyAoY29ucyBic3ltIChtYXBjYXIg IydjZHIgcHJldnZhcnMpKSkKICAgICAgICAgICAgICAgICAgICAgICAgKHNldGNhciAoY2RkciBw cmV2KSBic3ltKQogICAgICAgICAgICAgICAgICAgICAgICAoc2V0cSByZXMgYnN5bSkpKQogICAg ICAgICAgICAgICAgICAgIChzZXRxIHZhcnMgKGNvcHktc2VxdWVuY2UgdmFycykpCiAgICAgICAg ICAgICAgICAgICAgKGxldCAoKGFyZ3MgKG1hcGNhciAobGFtYmRhIChwYSkKICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGxldCAoKHYgKGFzc3EgKGNhciBwYSkgdmFy cykpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChzZXRxIHZh cnMgKGRlbHEgdiB2YXJzKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAoY2RyIHYpKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBy ZXZ2YXJzKSkpCiAgICAgICAgICAgICAgICAgICAgICA7OyBJZiBzb21lIG9mIGB2YXJzJyB3ZXJl IG5vdCBmb3VuZCBpbiBgcHJldnZhcnMnLCB0aGF0J3MKICAgICAgICAgICAgICAgICAgICAgIDs7 IE9LIGl0IGp1c3QgbWVhbnMgdGhvc2UgdmFycyBhcmVuJ3QgcHJlc2VudCBpbiBhbGwKICAgICAg ICAgICAgICAgICAgICAgIDs7IGJyYW5jaGVzLCBzbyB0aGV5IGNhbiBiZSB1c2VkIHdpdGhpbiB0 aGUgcGF0dGVybgogICAgICAgICAgICAgICAgICAgICAgOzsgKGUuZy4gYnkgYSBgZ3VhcmQvbGV0 L3ByZWQnKSBidXQgbm90IGluIHRoZSBicmFuY2guCiAgICAgICAgICAgICAgICAgICAgICA7OyBG SVhNRTogQnV0IGlmIHNvbWUgb2YgYHByZXZ2YXJzJyBhcmUgbm90IGluIGB2YXJzJyB3ZQogICAg ICAgICAgICAgICAgICAgICAgOzsgc2hvdWxkIHJlbW92ZSB0aGVtIGZyb20gYHByZXZ2YXJzJyEK ICAgICAgICAgICAgICAgICAgICAgIGAoZnVuY2FsbCAscmVzICxAYXJncykpKSkpKSkKICAgICAg ICAgICAodXNlZC1jYXNlcyAoKSkKICAgICAgICAgICAobWFpbgogICAgICAgICAgICAocGNhc2Ut LXUKICAgICAgICAgICAgIChtYXBjYXIgKGxhbWJkYSAoY2FzZSkKICAgICAgICAgICAgICAgICAg ICAgICBgKCwocGNhc2UtLW1hdGNoIHZhbCAocGNhc2UtLW1hY3JvZXhwYW5kIChjYXIgY2FzZSkp KQogICAgICAgICAgICAgICAgICAgICAgICAgLChsYW1iZGEgKHZhcnMpCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAodW5sZXNzIChtZW1xIGNhc2UgdXNlZC1jYXNlcykKICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOzsgS2VlcCB0cmFjayBvZiB0aGUgY2FzZXMgdGhhdCBhcmUgdXNl ZC4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHB1c2ggY2FzZSB1c2VkLWNhc2VzKSkK ICAgICAgICAgICAgICAgICAgICAgICAgICAgIChmdW5jYWxsCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKGlmIChwY2FzZS0tc21hbGwtYnJhbmNoLXAgKGNkciBjYXNlKSkKICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOzsgRG9uJ3QgYm90aGVyIHNoYXJpbmcgbXVsdGlwbGUK ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOzsgb2NjdXJyZW5jZXMgb2YgdGhpcyBs ZWFmIHNpbmNlIGl0J3Mgc21hbGwuCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChs YW1iZGEgKGNvZGUgdmFycykKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocGNh c2UtY29kZWdlbiBjb2RlCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKHBjYXNlLS1mZ3JlcCB2YXJzIGNvZGUpKSkKICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGNvZGVnZW4pCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNkciBjYXNl KQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhcnMpKSkpCiAgICAgICAgICAgICAgICAg ICAgIGNhc2VzKQogICAgICAgICAgICAgZmlsdGVyKSkpCiAgICAgIChkb2xpc3QgKGNhc2UgY2Fz ZXMpCiAgICAgICAgKHVubGVzcyAob3IgKG1lbXEgY2FzZSB1c2VkLWNhc2VzKQogICAgICAgICAg ICAgICAgICAgIChtZW1xIChjYXIgY2FzZSkgcGNhc2UtLWRvbnR3YXJuLXVwYXRzKSkKICAgICAg ICAgIChtZXNzYWdlICJSZWR1bmRhbnQgcGNhc2UgcGF0dGVybjogJVMiIChjYXIgY2FzZSkpKSkK ICAgICAgKG1hY3JvZXhwLWxldCogZGVmcyBtYWluKSkpKQoKKGRlZnZhciBwY2FzZS0tZW52IG5p bCkKCihwY2FzZS1kZWZtYWNybyBjb25jYXQgKCZyZ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0aGluZy4KICAoY29uZAogICAoKG51 bGwgbWF0Y2hlcykgKGZ1bmNhbGwgY29kZSB2YXJzKSkKICAgKChlcSA6cGNhc2UtLWZhaWwgKGNh ciBtYXRjaGVzKSkgKHBjYXNlLS11IHJlc3QgZmlsdGVyKSkKICAgKChlcSA6cGNhc2UtLXN1Y2Nl ZWQgKGNhciBtYXRjaGVzKSkKICAgIChwY2FzZS0tdTEgKGNkciBtYXRjaGVzKSBjb2RlIHZhcnMg cmVzdCBmaWx0ZXIpKQogICAoKGVxICdhbmQgKGNhYXIgbWF0Y2hlcykpCiAgICAocGNhc2UtLXUx IChhcHBlbmQgKGNkYXIgbWF0Y2hlcykgKGNkciBtYXRjaGVzKSkgY29kZSB2YXJzIHJlc3QKICAg ICAgICAgICAgICAgZmlsdGVyKSkKICAgKChlcSAnb3IgKGNhYXIgbWF0Y2hlcykpCiAgICAobGV0 KiAoKGFsdHMgKGNkYXIgbWF0Y2hlcykpCiAgICAgICAgICAgKHZhciAoaWYgKGVxIChjYWFyIGFs dHMpICdtYXRjaCkgKGNhZHIgKGNhciBhbHRzKSkpKQogICAgICAgICAgIChzaW1wbGVzICcoKSkg KG90aGVycyAnKCkpIChtZW0tZnVuICdtZW1xKSkKICAgICAgKHdoZW4gdmFyCiAgICAgICAgKGRv bGlzdCAoYWx0IGFsdHMpCiAgICAgICAgICAoaWYgKGFuZCAoZXEgKGNhciBhbHQpICdtYXRjaCkg KGVxIHZhciAoY2FkciBhbHQpKQogICAgICAgICAgICAgICAgICAgKGxldCAoKHVwYXQgKGNkZHIg YWx0KSkpCiAgICAgICAgICAgICAgICAgICAgIChlcSAoY2FyLXNhZmUgdXBhdCkgJ3F1b3RlKSkp CiAgICAgICAgICAgICAgKGxldCAoKHZhbCAoY2FkciAoY2RkciBhbHQpKSkpCiAgICAgICAgICAg ICAgICAoY29uZCAoKGludGVnZXJwIHZhbCkKICAgICAgICAgICAgICAgICAgICAgICAod2hlbiAo ZXEgbWVtLWZ1biAnbWVtcSkKICAgICAgICAgICAgICAgICAgICAgICAgIChzZXRxIG1lbS1mdW4g J21lbXFsKSkpCiAgICAgICAgICAgICAgICAgICAgICAoKG5vdCAoc3ltYm9scCB2YWwpKQogICAg ICAgICAgICAgICAgICAgICAgIChzZXRxIG1lbS1mdW4gJ21lbWJlcikpKQogICAgICAgICAgICAg ICAgKHB1c2ggdmFsIHNpbXBsZXMpKQogICAgICAgICAgICAocHVzaCBhbHQgb3RoZXJzKSkpKQog ICAgICAoY29uZAogICAgICAgKChudWxsIGFsdHMpIChlcnJvciAiUGxlYXNlIGF2b2lkIGl0Iikg KHBjYXNlLS11IHJlc3QgZmlsdGVyKSkKICAgICAgIDs7IFllcywgd2UgY2FuIHVzZSBgbWVtcWwn IChvciBgbWVtYmVyJykhCiAgICAgICAoKD4gKGxlbmd0aCBzaW1wbGVzKSAxKQogICAgICAgIChw Y2FzZS0tdTEgKGNvbnMgYChtYXRjaCAsdmFyCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIC4gKHByZWQgKHBjYXNlLS1mbGlwICxtZW0tZnVuICcsc2ltcGxlcykpKQogICAgICAgICAg ICAgICAgICAgICAgICAgKGNkciBtYXRjaGVzKSkKICAgICAgICAgICAgICAgICAgIGNvZGUgdmFy cwogICAgICAgICAgICAgICAgICAgKGlmIChudWxsIG90aGVycykgcmVzdAogICAgICAgICAgICAg ICAgICAgICAoY29ucyAoY29ucwogICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBjYXNlLS1h bmQgKGlmIChjZHIgb3RoZXJzKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIChjb25zICdvciAobnJldmVyc2Ugb3RoZXJzKSkKICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgKGNhciBvdGhlcnMpKQogICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgKGNkciBtYXRjaGVzKSkKICAgICAgICAgICAgICAgICAgICAgICAg ICAgIChjb25zIGNvZGUgdmFycykpCiAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3QpKQog ICAgICAgICAgICAgICAgICAgZmlsdGVyKSkKICAgICAgICh0CiAgICAgICAgKHBjYXNlLS11MSAo Y29ucyAocG9wIGFsdHMpIChjZHIgbWF0Y2hlcykpIGNvZGUgdmFycwogICAgICAgICAgICAgICAg ICAgKGlmIChudWxsIGFsdHMpIChwcm9nbiAoZXJyb3IgIlBsZWFzZSBhdm9pZCBpdCIpIHJlc3Qp CiAgICAgICAgICAgICAgICAgICAgIChjb25zIChjb25zCiAgICAgICAgICAgICAgICAgICAgICAg ICAgICAocGNhc2UtLWFuZCAoaWYgKGNkciBhbHRzKQogICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIChjb25zICdvciBhbHRzKSAoY2FyIGFsdHMpKQogICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNkciBtYXRjaGVzKSkKICAgICAgICAgICAg ICAgICAgICAgICAgICAgIChjb25zIGNvZGUgdmFycykpCiAgICAgICAgICAgICAgICAgICAgICAg ICAgIHJlc3QpKQogICAgICAgICAgICAgICAgICAgZmlsdGVyKSkpKSkKICAgKChlcSAnbWF0Y2gg KGNhYXIgbWF0Y2hlcykpCiAgICAobGV0KiAoKHBvcG1hdGNoZXMgKHBvcCBtYXRjaGVzKSkKICAg ICAgICAgICAoX29wIChjYXIgcG9wbWF0Y2hlcykpICAgICAgKGNkcnBvcG1hdGNoZXMgKGNkciBw b3BtYXRjaGVzKSkKICAgICAgICAgICAoc3ltIChjYXIgY2RycG9wbWF0Y2hlcykpCiAgICAgICAg ICAgKHVwYXQgKGNkciBjZHJwb3BtYXRjaGVzKSkpCiAgICAgIChjb25kCiAgICAgICAoKG1lbXEg dXBhdCAnKHQgXykpCiAgICAgICAgKGxldCAoKGNvZGUgKHBjYXNlLS11MSBtYXRjaGVzIGNvZGUg dmFycyByZXN0IGZpbHRlcikpKQogICAgICAgICAgKGlmIChlcSB1cGF0ICdfKSBjb2RlCiAgICAg ICAgICAgIChtYWNyb2V4cC0td2Fybi1hbmQtcmV0dXJuCiAgICAgICAgICAgICAiUGF0dGVybiB0 IGlzIGRlcHJlY2F0ZWQuICBVc2UgYF8nIGluc3RlYWQiCiAgICAgICAgICAgICBjb2RlKSkpKQog ICAgICAgKChlcSB1cGF0ICdwY2FzZS0tZG9udGNhcmUpIDpwY2FzZS0tZG9udGNhcmUpCiAgICAg ICAoKG1lbXEgKGNhci1zYWZlIHVwYXQpICcoZ3VhcmQgcHJlZCkpCiAgICAgICAgKGlmIChlcSAo Y2FyIHVwYXQpICdwcmVkKSAocGNhc2UtLW1hcmstdXNlZCBzeW0pKQogICAgICAgIChsZXQqICgo c3BsaXRyZXN0CiAgICAgICAgICAgICAgICAocGNhc2UtLXNwbGl0LXJlc3QKICAgICAgICAgICAg ICAgICBzeW0gKGxhbWJkYSAocGF0KSAocGNhc2UtLXNwbGl0LXByZWQgdmFycyB1cGF0IHBhdCkp IHJlc3QpKQogICAgICAgICAgICAgICAodGhlbi1yZXN0IChjYXIgc3BsaXRyZXN0KSkKICAgICAg ICAgICAgICAgKGVsc2UtcmVzdCAoY2RyIHNwbGl0cmVzdCkpKQogICAgICAgICAgKHBjYXNlLS1p ZiAoaWYgKGVxIChjYXIgdXBhdCkgJ3ByZWQpCiAgICAgICAgICAgICAgICAgICAgICAgICAocGNh c2UtLWZ1bmNhbGwgKGNhZHIgdXBhdCkgc3ltIHZhcnMpCiAgICAgICAgICAgICAgICAgICAgICAg KHBjYXNlLS1ldmFsIChjYWRyIHVwYXQpIHZhcnMpKQogICAgICAgICAgICAgICAgICAgICAocGNh c2UtLXUxIG1hdGNoZXMgY29kZSB2YXJzIHRoZW4tcmVzdCBmaWx0ZXIpCiAgICAgICAgICAgICAg ICAgICAgIChwY2FzZS0tdSBlbHNlLXJlc3QgZmlsdGVyKSkpKQogICAgICAgKChhbmQgKHN5bWJv bHAgdXBhdCkgdXBhdCkKICAgICAgICAocGNhc2UtLW1hcmstdXNlZCBzeW0pCiAgICAgICAgKGNv bmQKICAgICAgICAgKChhbmQgZmlsdGVyIChmdW5jYWxsIGZpbHRlciB1cGF0KSkKICAgICAgICAg IChwY2FzZS0tdTEgKGNvbnMgYChtYXRjaCAsc3ltIC4gKHByZWQgKGxhbWJkYSAoeCkgKGVxdWFs ICwoY2RyIChmdW5jYWxsIGZpbHRlciB1cGF0KSkgeCkpKSkKICAgICAgICAgICAgICAgICAgICAg ICAgICAgbWF0Y2hlcykKICAgICAgICAgICAgICAgICAgICAgY29kZSB2YXJzIHJlc3QgZmlsdGVy KSkKICAgICAgICAgKChub3QgKGFzc3EgdXBhdCB2YXJzKSkKICAgICAgICAgIChwY2FzZS0tdTEg bWF0Y2hlcyBjb2RlIChjb25zIChjb25zIHVwYXQgc3ltKSB2YXJzKSByZXN0IGZpbHRlcikpCiAg ICAgICAgICg7OyBOb24tbGluZWFyIHBhdHRlcm4uICBUdXJuIGl0IGludG8gYW4gYGVxJyB0ZXN0 LgogICAgICAgICAgKHBjYXNlLS11MSAoY29ucyBgKG1hdGNoICxzeW0gLiAocHJlZCAoZXEgLChj ZHIgKGFzc3EgdXBhdCB2YXJzKSkpKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF0Y2hl cykKICAgICAgICAgICAgICAgICAgICAgY29kZSB2YXJzIHJlc3QgZmlsdGVyKSkpKQogICAgICAg KChlcSAoY2FyLXNhZmUgdXBhdCkgJ2xldCkKICAgICAgICA7OyBBIHVwYXQgb2YgdGhlIGZvcm0g KGxldCBWQVIgRVhQKS4KICAgICAgICA7OyAocGNhc2UtLXUxIG1hdGNoZXMgY29kZQogICAgICAg IDs7ICAgICAgICAgICAgKGNvbnMgKGNvbnMgKG50aCAxIHVwYXQpIChudGggMiB1cGF0KSkgdmFy cykgcmVzdCkKICAgICAgICAobWFjcm9leHAtbGV0MgogICAgICAgICAgICBtYWNyb2V4cC1jb3B5 YWJsZS1wIHN5bQogICAgICAgICAgICAocGNhc2UtLWV2YWwgKG50aCAyIHVwYXQpIHZhcnMpCiAg ICAgICAgICAocGNhc2UtLXUxIChjb25zIChwY2FzZS0tbWF0Y2ggc3ltIChudGggMSB1cGF0KSkg bWF0Y2hlcykKICAgICAgICAgICAgICAgICAgICAgY29kZSB2YXJzIHJlc3QgZmlsdGVyKSkpCiAg ICAgICAoKGVxIChjYXItc2FmZSB1cGF0KSAnYXBwKQogICAgICAgIDs7IEEgdXBhdCBvZiB0aGUg Zm9ybSAoYXBwIEZVTiBQQVQpCiAgICAgICAgKHBjYXNlLS1tYXJrLXVzZWQgc3ltKQogICAgICAg IChsZXQqICgoZnVuIChudGggMSB1cGF0KSkKICAgICAgICAgICAgICAgKG5zeW0gKGdlbnN5bSAi eCIpKQogICAgICAgICAgICAgICAoYm9keQogICAgICAgICAgICAgICAgOzsgV2UgZG9uJ3QgY2hh bmdlIGBtYXRjaGVzJyB0byByZXVzZSB0aGUgbmV3bHkgY29tcHV0ZWQgdmFsdWUsCiAgICAgICAg ICAgICAgICA7OyBiZWNhdXNlIHdlIGFzc3VtZSB0aGVyZSBzaG91bGRuJ3QgYmUgc3VjaCByZWR1 bmRhbmN5IGluIHRoZXJlLgogICAgICAgICAgICAgICAgKHBjYXNlLS11MSAoY29ucyAocGNhc2Ut LW1hdGNoIG5zeW0gKG50aCAyIHVwYXQpKSBtYXRjaGVzKQogICAgICAgICAgICAgICAgICAgICAg ICAgICBjb2RlIHZhcnMKICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBjYXNlLS1hcHAtc3Vi c3QtcmVzdCByZXN0IHN5bSBmdW4gbnN5bSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgKGxh bWJkYSAoeCkgKGFuZCAobm90IChlcSB4IG5zeW0pKSkgKGFuZCBmaWx0ZXIgKGZ1bmNhbGwgZmls dGVyIHgpKSkpKSkKICAgICAgICAgIChpZiAobm90IChnZXQgbnN5bSAncGNhc2UtdXNlZCkpCiAg ICAgICAgICAgICAgYm9keQogICAgICAgICAgICAobWFjcm9leHAtbGV0KgogICAgICAgICAgICAg YCgoLG5zeW0gLChwY2FzZS0tZnVuY2FsbCBmdW4gc3ltIHZhcnMpKSkKICAgICAgICAgICAgIGJv ZHkpKSkpCiAgICAgICAoKGVxIChjYXItc2FmZSB1cGF0KSAncXVvdGUpCiAgICAgICAgKHBjYXNl LS1tYXJrLXVzZWQgc3ltKQogICAgICAgIChsZXQqICgodmFsIChjYWRyIHVwYXQpKQogICAgICAg ICAgICAgICAoc3BsaXRyZXN0IChwY2FzZS0tc3BsaXQtcmVzdAogICAgICAgICAgICAgICAgICAg ICAgICAgICBzeW0gKGxhbWJkYSAocGF0KSAocGNhc2UtLXNwbGl0LWVxdWFsIHZhbCBwYXQpKSBy ZXN0KSkKICAgICAgICAgICAgICAgKHRoZW4tcmVzdCAoY2FyIHNwbGl0cmVzdCkpCiAgICAgICAg ICAgICAgIChlbHNlLXJlc3QgKGNkciBzcGxpdHJlc3QpKSkKICAgICAgICAgIChwY2FzZS0taWYg KGNvbmQKICAgICAgICAgICAgICAgICAgICAgICgobnVsbCB2YWwpIGAobnVsbCAsc3ltKSkKICAg ICAgICAgICAgICAgICAgICAgICgoaW50ZWdlcnAgdmFsKSBgKGVxbCAsc3ltICx2YWwpKQogICAg ICAgICAgICAgICAgICAgICAgKChzeW1ib2xwIHZhbCkKICAgICAgICAgICAgICAgICAgICAgICAo aWYgKHBjYXNlLS1zZWxmLXF1b3RpbmctcCB2YWwpCiAgICAgICAgICAgICAgICAgICAgICAgICAg IGAoZXEgLHN5bSAsdmFsKQogICAgICAgICAgICAgICAgICAgICAgICAgYChlcSAsc3ltICcsdmFs KSkpCiAgICAgICAgICAgICAgICAgICAgICAodCBgKGVxdWFsICxzeW0gJyx2YWwpKSkKICAgICAg ICAgICAgICAgICAgICAgKHBjYXNlLS11MSBtYXRjaGVzIGNvZGUgdmFycyB0aGVuLXJlc3QgZmls dGVyKQogICAgICAgICAgICAgICAgICAgICAocGN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XZlcmFsIHRpbWVzOiBj b2RlIGJsb3cgdXAgaXMgbGlrZWx5LgogICAgICAgICAgICAgICAgICAgKGxhbWJkYSAoX3ZhcnMp CiAgICAgICAgICAgICAgICAgICAgIDs7IGB2YXJzJyB3aWxsIGxpa2VseSBjb250YWluIGJpbmRp bmdzIHdoaWNoIGFyZQogICAgICAgICAgICAgICAgICAgICA7OyBub3QgYWx3YXlzIGF2YWlsYWJs ZSBpbiBvdGhlciBwYXRocyB0bwogICAgICAgICAgICAgICAgICAgICA7OyBgcmVzdCcsIHNvIHRo ZXJlJyBubyBwb2ludCB0cnlpbmcgdG8gcGFzcwogICAgICAgICAgICAgICAgICAgICA7OyB0aGVt IGRvd24uCiAgICAgICAgICAgICAgICAgICAgIChwY2FzZS0tdSByZXN0IGZpbHRlcikpCiAgICAg ICAgICAgICAgICAgICB2YXJzCiAgICAgICAgICAgICAgICAgICAobGlzdCBgKChhbmQgLiAsbWF0 Y2hlcykgLGNvZGUgLiAsdmFycykpCiAgICAgICAgICAgICAgICAgICBmaWx0ZXIpKQogICAgICAg KHQgKGVycm9yICJVbmtub3duIHBhdHRlcm4gYCVTJyIgdXBhdCkpKSkpCiAgICh0IChlcnJvciAi SW5jb3JyZWN0IE1BVENIICVTIiAoY2FyIG1hdGNoZXMpKSkpKQoKKGxldCAoKHNwYWNlICIgIikp CiAgKHBjYWxsIGYgKChjb25jYXQgaGVsbG8gc3BhY2Ugd29ybGQpICJoZWxsbyB3b3JsZCIpKSkK CihkZWZ1biBwY2FzZS0tbGVuZ3RoIChwYXR0ZXJuKQogICAgKHNldHEgcGF0dGVybiAocGNhc2Ut LW1hY3JvZXhwYW5kIHBhdHRlcm4pKQogICAgKHBjYXNlIHBhdHRlcm4KICAgICAgKGAocHJlZCBu dWxsKSAoY29ucyAwIDApKQogICAgICAoYCduaWwgKGNvbnMgMCAwKSkKICAgICAgKGAocHJlZCBj b25zcCkgKGNvbnMgMSAxLjBlK0lORikpCiAgICAgIChgKGFwcCBjZHIgLHBhdHRlcm4pCiAgICAg ICAobGV0ICgobGVuZ3RoIChwY2FzZS0tbGVuZ3RoIHBhdHRlcm4pKSkKCSAoaWYgKD4gKGNhciBs ZW5ndGgpIDApCgkgICAgIChjb25zICgxKyAoY2FyIGxlbmd0aCkpICgxKyAoY2RyIGxlbmd0aCkp KQoJICAgKGNvbnMgMCAoMSsgKGNkciBsZW5ndGgpKSkpKSkKICAgICAgKGAob3IgLiAscGF0dGVy bnMpCiAgICAgICAobGV0ICgoaW5mIDApCgkgICAgIChzdXAgMS4wZStJTkYpKQoJIChkb2xpc3Qg KHBhdHRlcm4gcGF0dGVybnMpCgkgICAobGV0KiAoKGlzIChwY2FzZS0tbGVuZ3RoIHBhdHRlcm4p KQoJCSAgKGkgKGNhciBpcykpCgkJICAocyAoY2RyIGlzKSkpCgkgICAgIChzZXRxIGluZiAobWlu IGluZiBpKSkKCSAgICAgKHNldHEgc3VwIChtYXggc3VwIHMpKSkpCgkgKGNvbnMgaW5mIHN1cCkp KQogICAgICAoYChhbmQgLiAscGF0dGVybnMpCiAgICAgICAobGV0ICgoaW5mIDApCgkgICAgIChz dXAgMS4wZStJTkYpKQoJIChkb2xpc3QgKHBhdHRlcm4gcGF0dGVybnMpCgkgICAobGV0KiAoKGlz IChwY2FzZS0tbGVuZ3RoIHBhdHRlcm4pKQoJCSAgKGkgKGNhciBpcykpCgkJICAocyAoY2RyIGlz KSkpCgkgICAgIChzZXRxIGluZiAobWF4IGluZiBpKSkKCSAgICAgKHNldHEgc3VwIChtaW4gc3Vw IHMpKSkpCgkgKGNvbnMgaW5mIHN1cCkpKQogICAgICAoXyAoY29ucyAwIDEuMGUrSU5GKSkpKQoK KHBjYXNlLWRlZm1hY3JvIG5vdCAocGF0KQogIGAoYXBwIChsYW1iZGEgKGV4cHZhbCkgKG5vdCAo cGNhc2UgZXhwdmFsICgscGF0IHQpKSkpCiAgICAgICAgKHByZWQgaWRlbnRpdHkpKSkK --0000000000009fed8e05ae317999--